Skip to content

Commit 54b3121

Browse files
authored
add PinStatus to sdk (#73)
* added PinStatus to sdk * lint-fix
1 parent 23d8ac5 commit 54b3121

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

resources/cards.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Card, CreateDebitCardRequest, ReplaceCardRequest } from "../types/cards"
1+
import { Card, CreateDebitCardRequest, PinStatus, ReplaceCardRequest } from "../types/cards"
22
import { Include, UnitConfig, UnitResponse } from "../types/common"
33
import { Customer } from "../types/customer"
44
import { Account } from "../types/account"
@@ -14,7 +14,7 @@ export class Cards extends BaseResource {
1414
return await this.httpPost<UnitResponse<Card>>("", { data: request })
1515
}
1616

17-
public async reportStolen(id: number): Promise<UnitResponse<Card>> {
17+
public async reportStolen(id: string): Promise<UnitResponse<Card>> {
1818
const path = `/${id}/report-stolen`
1919
return await this.httpPost<UnitResponse<Card>>(path)
2020
}
@@ -73,6 +73,12 @@ export class Cards extends BaseResource {
7373

7474
return this.httpGet<UnitResponse<Card[]> & Include<Account[] | Customer[]>>("", { params: parameters })
7575
}
76+
77+
public async getPinStatus(id: string): Promise<UnitResponse<PinStatus>> {
78+
const path = `/${id}/secure-data/pin/status`
79+
80+
return await this.httpGet<UnitResponse<PinStatus>>(path)
81+
}
7682
}
7783

7884
export interface CardListParams {

types/applicationForm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ export interface CreateApplicationFormRequest {
2626
* Optional. Array of Individual, Business or SoleProprietorship. Restrict the available application type for this specific application.
2727
*/
2828
allowedApplicationTypes?: Array<"Individual" | "SoleProprietorship" | "Business">
29-
},
29+
}
3030
relationships?: {
3131
/**
3232
* See [Create an Application Form from an existing Application](https://developers.unit.co/application-forms/#create-an-application-form-from-an-existing-application)
3333
*/
3434
application?: {
3535
data: {
36-
type: "application",
36+
type: "application"
3737
id: string
3838
}
3939
}

types/cards.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,3 +520,10 @@ export interface ReplaceCardRequest {
520520
}
521521

522522

523+
export interface PinStatus {
524+
type: "pinStatus"
525+
526+
attributes: {
527+
status: "Set" | "NotSet"
528+
}
529+
}

0 commit comments

Comments
 (0)