@pax2pay/client 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client/Accounts/index.ts +35 -0
- package/dist/Client/Accounts/index.d.ts +7 -0
- package/dist/Client/Accounts/index.js +13 -0
- package/dist/Client/Accounts/index.js.map +1 -1
- package/dist/model/OrganisationResponse.d.ts +3 -3
- package/dist/model/OrganisationResponse.js +3 -3
- package/dist/model/OrganisationResponse.js.map +1 -1
- package/model/OrganisationResponse.ts +6 -6
- package/package.json +1 -1
package/Client/Accounts/index.ts
CHANGED
|
@@ -22,4 +22,39 @@ export class Accounts extends List<model.AccountResponse, model.AccountSearchReq
|
|
|
22
22
|
static create(connection: Connection) {
|
|
23
23
|
return new Accounts(connection)
|
|
24
24
|
}
|
|
25
|
+
async getAccountSummary(
|
|
26
|
+
providerCodes: model.ProviderCode[],
|
|
27
|
+
accountId?: number,
|
|
28
|
+
accountStates?: model.AccountState[],
|
|
29
|
+
providerAccountId?: string
|
|
30
|
+
) {
|
|
31
|
+
const response = await this.connection.get<
|
|
32
|
+
| {
|
|
33
|
+
list: model.AccountSummary[]
|
|
34
|
+
totalCount: number
|
|
35
|
+
}
|
|
36
|
+
| model.ErrorResponse
|
|
37
|
+
>(`account-summaries?refresh=false&providerCodes=${providerCodes}${accountId ? `&accountId=${accountId}` : ""}${
|
|
38
|
+
accountStates ? `&accountStates=${accountStates}` : ""
|
|
39
|
+
}${providerAccountId ? `&providerAccountId=${providerAccountId}` : ""}
|
|
40
|
+
`)
|
|
41
|
+
return this.extractResponse(response)
|
|
42
|
+
}
|
|
43
|
+
async updateFundingAccount(
|
|
44
|
+
providerCode: model.ProviderCode,
|
|
45
|
+
providerAccountId: string,
|
|
46
|
+
request: model.UpdateAccountRequest
|
|
47
|
+
) {
|
|
48
|
+
const response = await this.connection.put<Promise<model.ErrorResponse | model.AccountResponse>>(
|
|
49
|
+
`funding-accounts/${providerCode}/${providerAccountId}`,
|
|
50
|
+
request
|
|
51
|
+
)
|
|
52
|
+
return response
|
|
53
|
+
}
|
|
54
|
+
async cancelLimitAlert(providerCode: model.ProviderCode, providerAccountId: string) {
|
|
55
|
+
const response = await this.connection.remove<Promise<model.ErrorResponse | model.AccountResponse>>(
|
|
56
|
+
`funding-accounts/${providerCode}/${providerAccountId}/limits`
|
|
57
|
+
)
|
|
58
|
+
return response
|
|
59
|
+
}
|
|
25
60
|
}
|
|
@@ -10,4 +10,11 @@ export declare class Accounts extends List<model.AccountResponse, model.AccountS
|
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}>;
|
|
12
12
|
static create(connection: Connection): Accounts;
|
|
13
|
+
getAccountSummary(providerCodes: model.ProviderCode[], accountId?: number, accountStates?: model.AccountState[], providerAccountId?: string): Promise<model.ErrorResponse | model.AccountSummary[]>;
|
|
14
|
+
updateFundingAccount(providerCode: model.ProviderCode, providerAccountId: string, request: model.UpdateAccountRequest): Promise<model.AccountResponse | model.ErrorResponse | (model.ErrorResponse & {
|
|
15
|
+
status: 400 | 404 | 500 | 403 | 503;
|
|
16
|
+
})>;
|
|
17
|
+
cancelLimitAlert(providerCode: model.ProviderCode, providerAccountId: string): Promise<model.AccountResponse | model.ErrorResponse | (model.ErrorResponse & {
|
|
18
|
+
status: 400 | 404 | 500 | 403 | 503;
|
|
19
|
+
})>;
|
|
13
20
|
}
|
|
@@ -14,5 +14,18 @@ export class Accounts extends List {
|
|
|
14
14
|
static create(connection) {
|
|
15
15
|
return new Accounts(connection);
|
|
16
16
|
}
|
|
17
|
+
async getAccountSummary(providerCodes, accountId, accountStates, providerAccountId) {
|
|
18
|
+
const response = await this.connection.get(`account-summaries?refresh=false&providerCodes=${providerCodes}${accountId ? `&accountId=${accountId}` : ""}${accountStates ? `&accountStates=${accountStates}` : ""}${providerAccountId ? `&providerAccountId=${providerAccountId}` : ""}
|
|
19
|
+
`);
|
|
20
|
+
return this.extractResponse(response);
|
|
21
|
+
}
|
|
22
|
+
async updateFundingAccount(providerCode, providerAccountId, request) {
|
|
23
|
+
const response = await this.connection.put(`funding-accounts/${providerCode}/${providerAccountId}`, request);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
async cancelLimitAlert(providerCode, providerAccountId) {
|
|
27
|
+
const response = await this.connection.remove(`funding-accounts/${providerCode}/${providerAccountId}/limits`);
|
|
28
|
+
return response;
|
|
29
|
+
}
|
|
17
30
|
}
|
|
18
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,MAAM,OAAO,QAAS,SAAQ,IAAuD;IAEpF,YAAoB,UAAsB;QACzC,KAAK,CAAC,UAAU,CAAC,CAAA;QAFR,WAAM,GAAG,kBAAkB,CAAA;IAGrC,CAAC;IACS,eAAe,CAAC,QAA+B;QACxD,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC9E,CAAC;IACS,cAAc,CAAC,QAA+B;QACvD,OAAO,IAAI,OAAO,CACjB,IAAI,CAAC,UAAU,EACf,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACtE,QAAQ,CACR,CAAA;IACF,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAA;IAChC,CAAC;CACD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OA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,iBAAyB,EACzB,OAAmC;QAEnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CACzC,oBAAoB,YAAY,IAAI,iBAAiB,EAAE,EACvD,OAAO,CACP,CAAA;QACD,OAAO,QAAQ,CAAA;IAChB,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,YAAgC,EAAE,iBAAyB;QACjF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAC5C,oBAAoB,YAAY,IAAI,iBAAiB,SAAS,CAC9D,CAAA;QACD,OAAO,QAAQ,CAAA;IAChB,CAAC;CACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OrganisationBalanceLimitResponse } from "./OrganisationBalanceLimitResponse";
|
|
2
2
|
export interface OrganisationResponse {
|
|
3
|
-
code
|
|
4
|
-
name
|
|
5
|
-
status
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
status: "ACTIVE" | "DELETED";
|
|
6
6
|
limitResponse?: OrganisationBalanceLimitResponse;
|
|
7
7
|
}
|
|
8
8
|
export declare namespace OrganisationResponse {
|
|
@@ -3,9 +3,9 @@ export var OrganisationResponse;
|
|
|
3
3
|
(function (OrganisationResponse) {
|
|
4
4
|
function is(value) {
|
|
5
5
|
return (typeof value == "object" &&
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(value.status ==
|
|
6
|
+
typeof value.code == "string" &&
|
|
7
|
+
typeof value.name == "string" &&
|
|
8
|
+
(value.status == "ACTIVE" || value.status == "DELETED") &&
|
|
9
9
|
(value.limitResponse == undefined || OrganisationBalanceLimitResponse.is(value.limitResponse)));
|
|
10
10
|
}
|
|
11
11
|
OrganisationResponse.is = is;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganisationResponse.js","sourceRoot":"../","sources":["model/OrganisationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAA;AAYrF,MAAM,KAAW,oBAAoB,CAUpC;AAVD,WAAiB,oBAAoB;IACpC,SAAgB,EAAE,CAAC,KAAiC;QACnD,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ;YACxB,
|
|
1
|
+
{"version":3,"file":"OrganisationResponse.js","sourceRoot":"../","sources":["model/OrganisationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAA;AAYrF,MAAM,KAAW,oBAAoB,CAUpC;AAVD,WAAiB,oBAAoB;IACpC,SAAgB,EAAE,CAAC,KAAiC;QACnD,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,CAAC,KAAK,CAAC,MAAM,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC;YACvD,CAAC,KAAK,CAAC,aAAa,IAAI,SAAS,IAAI,gCAAgC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAC9F,CAAA;IACF,CAAC;IARe,uBAAE,KAQjB,CAAA;AACF,CAAC,EAVgB,oBAAoB,KAApB,oBAAoB,QAUpC"}
|
|
@@ -4,9 +4,9 @@ import { OrganisationBalanceLimitResponse } from "./OrganisationBalanceLimitResp
|
|
|
4
4
|
* Organisation information of the creating user
|
|
5
5
|
*/
|
|
6
6
|
export interface OrganisationResponse {
|
|
7
|
-
code
|
|
8
|
-
name
|
|
9
|
-
status
|
|
7
|
+
code: string
|
|
8
|
+
name: string
|
|
9
|
+
status: "ACTIVE" | "DELETED"
|
|
10
10
|
limitResponse?: OrganisationBalanceLimitResponse
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -14,9 +14,9 @@ export namespace OrganisationResponse {
|
|
|
14
14
|
export function is(value: OrganisationResponse | any): value is OrganisationResponse {
|
|
15
15
|
return (
|
|
16
16
|
typeof value == "object" &&
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(value.status ==
|
|
17
|
+
typeof value.code == "string" &&
|
|
18
|
+
typeof value.name == "string" &&
|
|
19
|
+
(value.status == "ACTIVE" || value.status == "DELETED") &&
|
|
20
20
|
(value.limitResponse == undefined || OrganisationBalanceLimitResponse.is(value.limitResponse))
|
|
21
21
|
)
|
|
22
22
|
}
|