@pax2pay/model-banking 0.1.289 → 0.1.291
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/Counterparts.ts +13 -0
- package/Client/Accounts/index.ts +3 -1
- package/Rail/Address/index.ts +10 -2
- package/dist/Client/Accounts/Counterparts.d.ts +9 -0
- package/dist/Client/Accounts/Counterparts.js +12 -0
- package/dist/Client/Accounts/Counterparts.js.map +1 -0
- package/dist/Client/Accounts/index.d.ts +2 -0
- package/dist/Client/Accounts/index.js +2 -0
- package/dist/Client/Accounts/index.js.map +1 -1
- package/dist/Rail/Address/index.d.ts +4 -2
- package/dist/Rail/Address/index.js +8 -1
- package/dist/Rail/Address/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { gracely } from "gracely"
|
|
2
|
+
import { http } from "cloudly-http"
|
|
3
|
+
import { Rail } from "../../Rail"
|
|
4
|
+
|
|
5
|
+
export class Counterparts {
|
|
6
|
+
constructor(private readonly client: http.Client) {}
|
|
7
|
+
async replace(account: string, code: string, address: Rail.Address): Promise<Rail.Address | gracely.Error> {
|
|
8
|
+
return this.client.put<Rail.Address>(`/account/${account}/counterpart/${code}`, address)
|
|
9
|
+
}
|
|
10
|
+
async remove(account: string, code: string): Promise<Rail.Address | gracely.Error> {
|
|
11
|
+
return this.client.delete<Rail.Address>(`/account/${account}/counterpart/${code}`)
|
|
12
|
+
}
|
|
13
|
+
}
|
package/Client/Accounts/index.ts
CHANGED
|
@@ -2,13 +2,15 @@ import { gracely } from "gracely"
|
|
|
2
2
|
import { http } from "cloudly-http"
|
|
3
3
|
import * as rest from "cloudly-rest"
|
|
4
4
|
import { Account } from "../../Account"
|
|
5
|
+
import { Counterparts } from "./Counterparts"
|
|
5
6
|
import { Rails } from "./Rails"
|
|
6
7
|
import { Rules } from "./Rules"
|
|
7
8
|
|
|
8
9
|
export class Accounts extends rest.Collection<gracely.Error> {
|
|
9
10
|
readonly Rails = new Rails(this.client)
|
|
10
|
-
|
|
11
11
|
readonly rules = new Rules(this.client)
|
|
12
|
+
readonly counterparts = new Counterparts(this.client)
|
|
13
|
+
|
|
12
14
|
constructor(client: http.Client) {
|
|
13
15
|
super(client)
|
|
14
16
|
}
|
package/Rail/Address/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { Realm } from "../../Realm"
|
|
2
3
|
import { Card as AddressCard } from "./Card"
|
|
3
4
|
import { Iban as AddressIban } from "./Iban"
|
|
4
5
|
import { Internal as AddressInternal } from "./internal"
|
|
@@ -15,8 +16,15 @@ export type Address =
|
|
|
15
16
|
| AddressPaxGiro
|
|
16
17
|
| AddressScan
|
|
17
18
|
export namespace Address {
|
|
18
|
-
export const
|
|
19
|
-
|
|
19
|
+
export const realm: Record<Realm, string[]> = {
|
|
20
|
+
test: ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"],
|
|
21
|
+
testUK: ["internal", "iban", "scan", "card"],
|
|
22
|
+
uk: ["internal", "iban", "scan", "card"],
|
|
23
|
+
eu: ["internal", "iban", "scan", "card"],
|
|
24
|
+
upcheck: ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"],
|
|
25
|
+
}
|
|
26
|
+
export const values = ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"] as const
|
|
27
|
+
export type Type = typeof values[number]
|
|
20
28
|
export function compare(addresses: [Address, Address]): boolean {
|
|
21
29
|
return Object.entries(addresses[0]).every(
|
|
22
30
|
([key, value]: [keyof Address, Address[keyof Address]]) => value == addresses[1][key]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { gracely } from "gracely";
|
|
2
|
+
import { http } from "cloudly-http";
|
|
3
|
+
import { Rail } from "../../Rail";
|
|
4
|
+
export declare class Counterparts {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: http.Client);
|
|
7
|
+
replace(account: string, code: string, address: Rail.Address): Promise<Rail.Address | gracely.Error>;
|
|
8
|
+
remove(account: string, code: string): Promise<Rail.Address | gracely.Error>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class Counterparts {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
async replace(account, code, address) {
|
|
6
|
+
return this.client.put(`/account/${account}/counterpart/${code}`, address);
|
|
7
|
+
}
|
|
8
|
+
async remove(account, code) {
|
|
9
|
+
return this.client.delete(`/account/${account}/counterpart/${code}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Counterparts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Counterparts.js","sourceRoot":"../","sources":["Client/Accounts/Counterparts.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,YAAY;IACxB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,IAAY,EAAE,OAAqB;QACjE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,YAAY,OAAO,gBAAgB,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAe,YAAY,OAAO,gBAAgB,IAAI,EAAE,CAAC,CAAA;IACnF,CAAC;CACD"}
|
|
@@ -2,11 +2,13 @@ import { gracely } from "gracely";
|
|
|
2
2
|
import { http } from "cloudly-http";
|
|
3
3
|
import * as rest from "cloudly-rest";
|
|
4
4
|
import { Account } from "../../Account";
|
|
5
|
+
import { Counterparts } from "./Counterparts";
|
|
5
6
|
import { Rails } from "./Rails";
|
|
6
7
|
import { Rules } from "./Rules";
|
|
7
8
|
export declare class Accounts extends rest.Collection<gracely.Error> {
|
|
8
9
|
readonly Rails: Rails;
|
|
9
10
|
readonly rules: Rules;
|
|
11
|
+
readonly counterparts: Counterparts;
|
|
10
12
|
constructor(client: http.Client);
|
|
11
13
|
create(account: Account.Creatable): Promise<Account | gracely.Error>;
|
|
12
14
|
list(options?: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as rest from "cloudly-rest";
|
|
2
|
+
import { Counterparts } from "./Counterparts";
|
|
2
3
|
import { Rails } from "./Rails";
|
|
3
4
|
import { Rules } from "./Rules";
|
|
4
5
|
export class Accounts extends rest.Collection {
|
|
@@ -6,6 +7,7 @@ export class Accounts extends rest.Collection {
|
|
|
6
7
|
super(client);
|
|
7
8
|
this.Rails = new Rails(this.client);
|
|
8
9
|
this.rules = new Rules(this.client);
|
|
10
|
+
this.counterparts = new Counterparts(this.client);
|
|
9
11
|
}
|
|
10
12
|
async create(account) {
|
|
11
13
|
return this.client.post("/account", account);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAK3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QALL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,iBAAY,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAIrD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,UAAU,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8C,UAAU,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;CACD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
+
import { Realm } from "../../Realm";
|
|
2
3
|
import { Card as AddressCard } from "./Card";
|
|
3
4
|
import { Iban as AddressIban } from "./Iban";
|
|
4
5
|
import { Internal as AddressInternal } from "./internal";
|
|
@@ -7,8 +8,9 @@ import { PaxgiroCredit as AddressPaxgiroCredit } from "./PaxgiroCredit";
|
|
|
7
8
|
import { Scan as AddressScan } from "./Scan";
|
|
8
9
|
export type Address = AddressCard | AddressCard.Counterpart | AddressPaxgiroCredit | AddressIban | AddressInternal | AddressPaxGiro | AddressScan;
|
|
9
10
|
export declare namespace Address {
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const realm: Record<Realm, string[]>;
|
|
12
|
+
const values: readonly ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"];
|
|
13
|
+
type Type = typeof values[number];
|
|
12
14
|
function compare(addresses: [Address, Address]): boolean;
|
|
13
15
|
function parse(value: string): Address | undefined;
|
|
14
16
|
function stringify(Address: Address): string;
|
|
@@ -7,7 +7,14 @@ import { PaxgiroCredit as AddressPaxgiroCredit } from "./PaxgiroCredit";
|
|
|
7
7
|
import { Scan as AddressScan } from "./Scan";
|
|
8
8
|
export var Address;
|
|
9
9
|
(function (Address_1) {
|
|
10
|
-
Address_1.
|
|
10
|
+
Address_1.realm = {
|
|
11
|
+
test: ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"],
|
|
12
|
+
testUK: ["internal", "iban", "scan", "card"],
|
|
13
|
+
uk: ["internal", "iban", "scan", "card"],
|
|
14
|
+
eu: ["internal", "iban", "scan", "card"],
|
|
15
|
+
upcheck: ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"],
|
|
16
|
+
};
|
|
17
|
+
Address_1.values = ["paxgiro", "internal", "iban", "scan", "card", "paxgiro-credit"];
|
|
11
18
|
function compare(addresses) {
|
|
12
19
|
return Object.entries(addresses[0]).every(([key, value]) => value == addresses[1][key]);
|
|
13
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rail/Address/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rail/Address/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAA;AAU5C,MAAM,KAAW,OAAO,CAyFvB;AAzFD,WAAiB,SAAO;IACV,eAAK,GAA4B;QAC7C,IAAI,EAAE,CA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