@pax2pay/client 0.9.21 → 0.9.23

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.
@@ -60,4 +60,8 @@ export class Credentials {
60
60
  header
61
61
  )
62
62
  }
63
+ async remove(organisationCode: string, providerCode: ProviderCode): Promise<undefined | model.ErrorResponse> {
64
+ const header = { "x-assume": organisationCode }
65
+ return await this.connection.remove<undefined>(`${this.folder}/${providerCode}`, undefined, undefined, header)
66
+ }
63
67
  }
@@ -10,4 +10,5 @@ export declare class Credentials {
10
10
  getAll(organisationCode: string): Promise<model.CredentialResponse[] | model.ErrorResponse>;
11
11
  update(organisationCode: string, providerCode: ProviderCode, request: model.CredentialRequest): Promise<model.CredentialResponse | model.ErrorResponse>;
12
12
  save(organisationCode: string, providerCode: ProviderCode, request: model.CredentialRequest): Promise<model.CredentialResponse | model.ErrorResponse>;
13
+ remove(organisationCode: string, providerCode: ProviderCode): Promise<undefined | model.ErrorResponse>;
13
14
  }
@@ -28,5 +28,9 @@ export class Credentials {
28
28
  const header = { "x-assume": organisationCode };
29
29
  return await this.connection.post(`${this.folder}/${providerCode}`, request, undefined, header);
30
30
  }
31
+ async remove(organisationCode, providerCode) {
32
+ const header = { "x-assume": organisationCode };
33
+ return await this.connection.remove(`${this.folder}/${providerCode}`, undefined, undefined, header);
34
+ }
31
35
  }
32
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Credentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC,MAAM,OAAO,WAAW;IAEvB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QADhC,WAAM,GAAG,aAAa,CAAA;IACa,CAAC;IACvD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,CAAA;IACnC,CAAC;IACD,KAAK,CA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AU,CAAC,GAAG,CAC/B,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,EAAE,EAChC,OAAO,EACP,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IACD,KAAK,CAAC,IAAI,CACT,gBAAwB,EACxB,YAA0B,EAC1B,OAAgC;QAEhC,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;QAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAChC,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,EAAE,EAChC,OAAO,EACP,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,gBAAwB,EAAE,YAA0B;QAChE,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;QAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAY,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IAC/G,CAAC;CACD"}
@@ -12,7 +12,8 @@ export interface CardStatement {
12
12
  currency?: isoly.Currency;
13
13
  reason?: string;
14
14
  additionalInformation?: Record<string, any>;
15
+ id?: string;
15
16
  }
16
17
  export declare namespace CardStatement {
17
- function is(value: CardStatement | any): value is CardStatement;
18
+ const type: import("isly/dist/types/object").IslyObject<CardStatement, object>;
18
19
  }
@@ -1,21 +1,21 @@
1
1
  import * as isoly from "isoly";
2
+ import { isly } from "isly";
2
3
  import { ProviderCode } from "./ProviderCode";
3
4
  export var CardStatement;
4
5
  (function (CardStatement) {
5
- function is(value) {
6
- return (typeof value == "object" &&
7
- isoly.DateTime.is(value.timestamp) &&
8
- ProviderCode.is(value.provider) &&
9
- (value.reference == undefined || typeof value.reference == "string") &&
10
- typeof value.description == "string" &&
11
- typeof value.type == "string" &&
12
- (value.status == undefined || typeof value.status == "string") &&
13
- typeof value.balance == "number" &&
14
- (value.fundsChanged == undefined || typeof value.fundsChanged == "number") &&
15
- (value.currency == undefined || isoly.Currency.is(value.currency)) &&
16
- (value.reason == undefined || typeof value.reason == "string") &&
17
- (value.additionalInformation == undefined || typeof value.additionalInformation == "object"));
18
- }
19
- CardStatement.is = is;
6
+ CardStatement.type = isly.object({
7
+ timestamp: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
8
+ provider: isly.fromIs("ProviderCode", ProviderCode.is),
9
+ reference: isly.string().optional(),
10
+ description: isly.string(),
11
+ type: isly.string(),
12
+ status: isly.string().optional(),
13
+ balance: isly.number(),
14
+ fundsChanged: isly.number().optional(),
15
+ currency: isly.fromIs("isoly.Currency", isoly.Currency.is).optional(),
16
+ reason: isly.string().optional(),
17
+ additionalInformation: isly.record(isly.string(), isly.any()).optional(),
18
+ id: isly.string().optional(),
19
+ });
20
20
  })(CardStatement || (CardStatement = {}));
21
21
  //# sourceMappingURL=CardStatement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardStatement.js","sourceRoot":"../","sources":["model/CardStatement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAgB7C,MAAM,KAAW,aAAa,CAiB7B;AAjBD,WAAiB,aAAa;IAC7B,SAAgB,EAAE,CAAC,KAA0B;QAC5C,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ;YACxB,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;YAClC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC/B,CAAC,KAAK,CAAC,SAAS,IAAI,SAAS,IAAI,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ,CAAC;YACpE,OAAO,KAAK,CAAC,WAAW,IAAI,QAAQ;YACpC,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,CAAC,KAAK,CAAC,MAAM,IAAI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QACnB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QACrE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;QACxE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC5B,CAAC,CAAA;AACH,CAAC,EAfgB,aAAa,KAAb,aAAa,QAe7B"}
@@ -0,0 +1,25 @@
1
+ import { isly } from "isly";
2
+ import { ProviderCode } from "../ProviderCode";
3
+ export type Credentials = Partial<Record<ProviderCode, Record<string, any>>> & {
4
+ pax2pay?: Credentials.Pax2Pay;
5
+ };
6
+ export declare namespace Credentials {
7
+ const type: isly.Type<{
8
+ unknown: any;
9
+ conferma: any;
10
+ ixaris: any;
11
+ wex: any;
12
+ fake: any;
13
+ lodged: any;
14
+ modulr: any;
15
+ pax2pay: any;
16
+ }>;
17
+ type Pax2Pay = {
18
+ cardHolderName: string;
19
+ organisationId: string;
20
+ };
21
+ namespace Pax2Pay {
22
+ const keys: (keyof Pax2Pay)[];
23
+ const type: import("isly/dist/types/object").IslyObject<Pax2Pay, object>;
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ import { isly } from "isly";
2
+ import { ProviderCode } from "../ProviderCode";
3
+ export var Credentials;
4
+ (function (Credentials) {
5
+ Credentials.type = isly.record(ProviderCode.type, isly.any());
6
+ let Pax2Pay;
7
+ (function (Pax2Pay) {
8
+ Pax2Pay.keys = ["cardHolderName", "organisationId"];
9
+ Pax2Pay.type = isly.object({
10
+ cardHolderName: isly.string(),
11
+ organisationId: isly.string(),
12
+ });
13
+ })(Pax2Pay = Credentials.Pax2Pay || (Credentials.Pax2Pay = {}));
14
+ })(Credentials || (Credentials = {}));
15
+ //# sourceMappingURL=Credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Credentials.js","sourceRoot":"../","sources":["model/OrganisationResponseV2/Credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAK9C,MAAM,KAAW,WAAW,CAe3B;AAfD,WAAiB,WAAW;IACd,gBAAI,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;IAO9D,IAAiB,OAAO,CAMvB;IAND,WAAiB,OAAO;QACV,YAAI,GAAsB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;QAC9D,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU;YACxC,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE;YAC7B,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE;SAC7B,CAAC,CAAA;IACH,CAAC,EANgB,OAAO,GAAP,mBAAO,KAAP,mBAAO,QAMvB;AACF,CAAC,EAfgB,WAAW,KAAX,WAAW,QAe3B"}
@@ -1,16 +1,17 @@
1
1
  import { DateTime } from "isoly";
2
- import { CardTypeInformation } from "./CardTypeInformation";
3
- import { Config } from "./Config";
4
- import { OrganisationFlag } from "./OrganisationFlag";
5
- import { OrganisationRealm } from "./OrganisationRealm";
6
- import { OrganisationStatusV2 } from "./OrganisationStatusV2";
7
- import { ProviderCode } from "./ProviderCode";
2
+ import { CardTypeInformation } from "../CardTypeInformation";
3
+ import { Config } from "../Config";
4
+ import { OrganisationFlag } from "../OrganisationFlag";
5
+ import { OrganisationRealm } from "../OrganisationRealm";
6
+ import { OrganisationStatusV2 } from "../OrganisationStatusV2";
7
+ import { ProviderCode } from "../ProviderCode";
8
+ import { Credentials as OCredentials } from "./Credentials";
8
9
  export interface OrganisationResponseV2 {
9
10
  code: string;
10
11
  name: string;
11
12
  status: OrganisationStatusV2;
12
13
  realm?: OrganisationRealm | OrganisationRealm[];
13
- credentials?: Partial<Record<ProviderCode, Record<string, any>>>;
14
+ credentials?: OCredentials;
14
15
  organisationConfig?: Config.Organisation;
15
16
  internalOrganisationConfig?: Config.InternalOrganisation;
16
17
  cardTypes?: Partial<Record<ProviderCode, CardTypeInformation>>;
@@ -18,6 +19,7 @@ export interface OrganisationResponseV2 {
18
19
  channelPartners?: OrganisationFlag[];
19
20
  }
20
21
  export declare namespace OrganisationResponseV2 {
22
+ export import Credentials = OCredentials;
21
23
  const type: import("isly/dist/types/object").IslyObject<OrganisationResponseV2, object>;
22
24
  const is: (value: OrganisationResponseV2 | any) => value is OrganisationResponseV2;
23
25
  }
@@ -1,19 +1,21 @@
1
1
  import { DateTime } from "isoly";
2
2
  import { isly } from "isly";
3
- import { CardTypeInformation } from "./CardTypeInformation";
4
- import { Config } from "./Config";
5
- import { OrganisationFlag } from "./OrganisationFlag";
6
- import { OrganisationRealm } from "./OrganisationRealm";
7
- import { OrganisationStatusV2 } from "./OrganisationStatusV2";
8
- import { ProviderCode } from "./ProviderCode";
3
+ import { CardTypeInformation } from "../CardTypeInformation";
4
+ import { Config } from "../Config";
5
+ import { OrganisationFlag } from "../OrganisationFlag";
6
+ import { OrganisationRealm } from "../OrganisationRealm";
7
+ import { OrganisationStatusV2 } from "../OrganisationStatusV2";
8
+ import { ProviderCode } from "../ProviderCode";
9
+ import { Credentials as OCredentials } from "./Credentials";
9
10
  export var OrganisationResponseV2;
10
11
  (function (OrganisationResponseV2) {
12
+ OrganisationResponseV2.Credentials = OCredentials;
11
13
  OrganisationResponseV2.type = isly.object({
12
14
  code: isly.string(),
13
15
  name: isly.string(),
14
16
  status: OrganisationStatusV2.type,
15
17
  realm: isly.union(OrganisationRealm.type, isly.array(OrganisationRealm.type)).optional(),
16
- credentials: isly.record(ProviderCode.type, isly.any()).optional(),
18
+ credentials: OCredentials.type.optional(),
17
19
  organisationConfig: isly.fromIs("Config.Organisation", Config.Organisation.is).optional(),
18
20
  internalOrganisationConfig: isly.fromIs("Config.InternalOrganisation", Config.InternalOrganisation.is).optional(),
19
21
  cardTypes: isly.record(ProviderCode.type, isly.fromIs("CardTypeInformation", CardTypeInformation.is)).optional(),
@@ -22,4 +24,4 @@ export var OrganisationResponseV2;
22
24
  });
23
25
  OrganisationResponseV2.is = OrganisationResponseV2.type.is;
24
26
  })(OrganisationResponseV2 || (OrganisationResponseV2 = {}));
25
- //# sourceMappingURL=OrganisationResponseV2.js.map
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["model/OrganisationResponseV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,eAAe,CAAA;AAe3D,MAAM,KAAW,sBAAsB,CAgBtC;AAhBD,WAAiB,sBAAsB;IACxB,kCAAW,GAAG,YAAY,CAAA;IAE3B,2BAAI,GAAG,IAAI,CAAC,MAAM,CAAyB;QACvD,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,oBAAoB,CAAC,IAAI;QACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE;QACxF,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;QACzC,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QACzF,0BAA0B,EAAE,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QACjH,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;QAChH,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC/C,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;KAC7D,CAAC,CAAA;IACW,yBAAE,GAAG,uBAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAhBgB,sBAAsB,KAAtB,sBAAsB,QAgBtC"}
@@ -1,4 +1,5 @@
1
1
  import * as isoly from "isoly"
2
+ import { isly } from "isly"
2
3
  import { ProviderCode } from "./ProviderCode"
3
4
 
4
5
  export interface CardStatement {
@@ -13,23 +14,22 @@ export interface CardStatement {
13
14
  currency?: isoly.Currency
14
15
  reason?: string
15
16
  additionalInformation?: Record<string, any>
17
+ id?: string
16
18
  }
17
19
 
18
20
  export namespace CardStatement {
19
- export function is(value: CardStatement | any): value is CardStatement {
20
- return (
21
- typeof value == "object" &&
22
- isoly.DateTime.is(value.timestamp) &&
23
- ProviderCode.is(value.provider) &&
24
- (value.reference == undefined || typeof value.reference == "string") &&
25
- typeof value.description == "string" &&
26
- typeof value.type == "string" &&
27
- (value.status == undefined || typeof value.status == "string") &&
28
- typeof value.balance == "number" &&
29
- (value.fundsChanged == undefined || typeof value.fundsChanged == "number") &&
30
- (value.currency == undefined || isoly.Currency.is(value.currency)) &&
31
- (value.reason == undefined || typeof value.reason == "string") &&
32
- (value.additionalInformation == undefined || typeof value.additionalInformation == "object")
33
- )
34
- }
21
+ export const type = isly.object<CardStatement>({
22
+ timestamp: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
23
+ provider: isly.fromIs("ProviderCode", ProviderCode.is),
24
+ reference: isly.string().optional(),
25
+ description: isly.string(),
26
+ type: isly.string(),
27
+ status: isly.string().optional(),
28
+ balance: isly.number(),
29
+ fundsChanged: isly.number().optional(),
30
+ currency: isly.fromIs("isoly.Currency", isoly.Currency.is).optional(),
31
+ reason: isly.string().optional(),
32
+ additionalInformation: isly.record(isly.string(), isly.any()).optional(),
33
+ id: isly.string().optional(),
34
+ })
35
35
  }
@@ -0,0 +1,22 @@
1
+ import { isly } from "isly"
2
+ import { ProviderCode } from "../ProviderCode"
3
+
4
+ export type Credentials = Partial<Record<ProviderCode, Record<string, any>>> & {
5
+ pax2pay?: Credentials.Pax2Pay
6
+ }
7
+ export namespace Credentials {
8
+ export const type = isly.record(ProviderCode.type, isly.any())
9
+
10
+ // Pax2PayBankingCredentials in mpay
11
+ export type Pax2Pay = {
12
+ cardHolderName: string
13
+ organisationId: string
14
+ }
15
+ export namespace Pax2Pay {
16
+ export const keys: (keyof Pax2Pay)[] = ["cardHolderName", "organisationId"]
17
+ export const type = isly.object<Pax2Pay>({
18
+ cardHolderName: isly.string(),
19
+ organisationId: isly.string(),
20
+ })
21
+ }
22
+ }
@@ -1,18 +1,19 @@
1
1
  import { DateTime } from "isoly"
2
2
  import { isly } from "isly"
3
- import { CardTypeInformation } from "./CardTypeInformation"
4
- import { Config } from "./Config"
5
- import { OrganisationFlag } from "./OrganisationFlag"
6
- import { OrganisationRealm } from "./OrganisationRealm"
7
- import { OrganisationStatusV2 } from "./OrganisationStatusV2"
8
- import { ProviderCode } from "./ProviderCode"
3
+ import { CardTypeInformation } from "../CardTypeInformation"
4
+ import { Config } from "../Config"
5
+ import { OrganisationFlag } from "../OrganisationFlag"
6
+ import { OrganisationRealm } from "../OrganisationRealm"
7
+ import { OrganisationStatusV2 } from "../OrganisationStatusV2"
8
+ import { ProviderCode } from "../ProviderCode"
9
+ import { Credentials as OCredentials } from "./Credentials"
9
10
 
10
11
  export interface OrganisationResponseV2 {
11
12
  code: string
12
13
  name: string
13
14
  status: OrganisationStatusV2
14
15
  realm?: OrganisationRealm | OrganisationRealm[]
15
- credentials?: Partial<Record<ProviderCode, Record<string, any>>>
16
+ credentials?: OCredentials
16
17
  organisationConfig?: Config.Organisation
17
18
  internalOrganisationConfig?: Config.InternalOrganisation
18
19
  cardTypes?: Partial<Record<ProviderCode, CardTypeInformation>>
@@ -21,12 +22,14 @@ export interface OrganisationResponseV2 {
21
22
  }
22
23
 
23
24
  export namespace OrganisationResponseV2 {
25
+ export import Credentials = OCredentials
26
+
24
27
  export const type = isly.object<OrganisationResponseV2>({
25
28
  code: isly.string(),
26
29
  name: isly.string(),
27
30
  status: OrganisationStatusV2.type,
28
31
  realm: isly.union(OrganisationRealm.type, isly.array(OrganisationRealm.type)).optional(),
29
- credentials: isly.record(ProviderCode.type, isly.any()).optional(),
32
+ credentials: OCredentials.type.optional(),
30
33
  organisationConfig: isly.fromIs("Config.Organisation", Config.Organisation.is).optional(),
31
34
  internalOrganisationConfig: isly.fromIs("Config.InternalOrganisation", Config.InternalOrganisation.is).optional(),
32
35
  cardTypes: isly.record(ProviderCode.type, isly.fromIs("CardTypeInformation", CardTypeInformation.is)).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/client",
3
- "version": "0.9.21",
3
+ "version": "0.9.23",
4
4
  "description": "Client library for the Pax2Pay API",
5
5
  "author": "Pax2Pay Ltd.",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"OrganisationResponseV2.js","sourceRoot":"../","sources":["model/OrganisationResponseV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAe7C,MAAM,KAAW,sBAAsB,CActC;AAdD,WAAiB,sBAAsB;IACzB,2BAAI,GAAG,IAAI,CAAC,MAAM,CAAyB;QACvD,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,oBAAoB,CAAC,IAAI;QACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE;QACxF,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;QAClE,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,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