@pax2pay/client 0.3.135 → 0.3.137

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.
@@ -2,10 +2,9 @@ import { AmountPair } from "./AmountPair";
2
2
  export interface BillingTransactionAmountPair {
3
3
  billing: AmountPair;
4
4
  transaction: AmountPair;
5
- fxRate: number;
6
- rebate?: number;
7
- rebateRate?: number;
5
+ fxRate?: number;
8
6
  }
9
7
  export declare namespace BillingTransactionAmountPair {
10
- function is(value: BillingTransactionAmountPair | any): value is BillingTransactionAmountPair;
8
+ const type: import("isly/dist/cjs/object").IslyObject<BillingTransactionAmountPair, object>;
9
+ const is: (value: BillingTransactionAmountPair | any) => value is BillingTransactionAmountPair;
11
10
  }
@@ -1,14 +1,12 @@
1
+ import { isly } from "isly";
1
2
  import { AmountPair } from "./AmountPair";
2
3
  export var BillingTransactionAmountPair;
3
4
  (function (BillingTransactionAmountPair) {
4
- function is(value) {
5
- return (typeof value == "object" &&
6
- AmountPair.is(value.billing) &&
7
- AmountPair.is(value.transaction) &&
8
- typeof value.fxRate == "number" &&
9
- (typeof value.rebate == "number" || value.rebate == undefined) &&
10
- (typeof value.rebateRate == "number" || value.rebateRate == undefined));
11
- }
12
- BillingTransactionAmountPair.is = is;
5
+ BillingTransactionAmountPair.type = isly.object({
6
+ billing: isly.fromIs("AmountPair", AmountPair.is),
7
+ transaction: isly.fromIs("AmountPair", AmountPair.is),
8
+ fxRate: isly.number().optional(),
9
+ });
10
+ BillingTransactionAmountPair.is = BillingTransactionAmountPair.type.is;
13
11
  })(BillingTransactionAmountPair || (BillingTransactionAmountPair = {}));
14
12
  //# sourceMappingURL=BillingTransactionAmountPair.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BillingTransactionAmountPair.js","sourceRoot":"../","sources":["model/BillingTransactionAmountPair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AASzC,MAAM,KAAW,4BAA4B,CAW5C;AAXD,WAAiB,4BAA4B;IAC5C,SAAgB,EAAE,CAAC,KAAyC;QAC3D,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ;YACxB,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC;YAChC,OAAO,KAAK,CAAC,MAAM,IAAI,QAAQ;YAC/B,CAAC,OAAO,KAAK,CAAC,MAAM,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC;YAC9D,CAAC,OAAO,KAAK,CAAC,UAAU,IAAI,QAAQ,IAAI,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC,CACtE,CAAA;IACF,CAAC;IATe,+BAAE,KASjB,CAAA;AACF,CAAC,EAXgB,4BAA4B,KAA5B,4BAA4B,QAW5C"}
1
+ {"version":3,"file":"BillingTransactionAmountPair.js","sourceRoot":"../","sources":["model/BillingTransactionAmountPair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAOzC,MAAM,KAAW,4BAA4B,CAO5C;AAPD,WAAiB,4BAA4B;IAC/B,iCAAI,GAAG,IAAI,CAAC,MAAM,CAA+B;QAC7D,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,CAAC;QACjD,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,CAAC;QACrD,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAA;IACW,+BAAE,GAAG,6BAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAPgB,4BAA4B,KAA5B,4BAA4B,QAO5C"}
@@ -1,6 +1,7 @@
1
- declare const transferStatus: readonly ["PENDING", "PENDING_FOR_DATE", "PENDING_FOR_FUNDS", "SETTLED", "CANCELLED", "ERROR_REJECTED", "APPROVAL_PENDING", "DECLINED", "APPROVED", "GENERATED"];
2
- export type TransferStatus = typeof transferStatus[number];
1
+ import { isly } from "isly";
2
+ export type TransferStatus = typeof TransferStatus.values[number];
3
3
  export declare namespace TransferStatus {
4
- function is(value: unknown): value is TransferStatus;
4
+ const values: readonly ["PENDING", "PENDING_FOR_DATE", "PENDING_FOR_FUNDS", "SETTLED", "CANCELLED", "ERROR_REJECTED", "APPROVAL_PENDING", "DECLINED", "APPROVED", "GENERATED"];
5
+ const type: isly.Type<"PENDING" | "APPROVED" | "DECLINED" | "GENERATED" | "CANCELLED" | "APPROVAL_PENDING" | "SETTLED" | "PENDING_FOR_DATE" | "PENDING_FOR_FUNDS" | "ERROR_REJECTED">;
6
+ const is: (value: any | ("PENDING" | "APPROVED" | "DECLINED" | "GENERATED" | "CANCELLED" | "APPROVAL_PENDING" | "SETTLED" | "PENDING_FOR_DATE" | "PENDING_FOR_FUNDS" | "ERROR_REJECTED")) => value is "PENDING" | "APPROVED" | "DECLINED" | "GENERATED" | "CANCELLED" | "APPROVAL_PENDING" | "SETTLED" | "PENDING_FOR_DATE" | "PENDING_FOR_FUNDS" | "ERROR_REJECTED";
5
7
  }
6
- export {};
@@ -1,20 +1,19 @@
1
- const transferStatus = [
2
- "PENDING",
3
- "PENDING_FOR_DATE",
4
- "PENDING_FOR_FUNDS",
5
- "SETTLED",
6
- "CANCELLED",
7
- "ERROR_REJECTED",
8
- "APPROVAL_PENDING",
9
- "DECLINED",
10
- "APPROVED",
11
- "GENERATED",
12
- ];
1
+ import { isly } from "isly";
13
2
  export var TransferStatus;
14
3
  (function (TransferStatus) {
15
- function is(value) {
16
- return typeof value == "string" && transferStatus.includes(value);
17
- }
18
- TransferStatus.is = is;
4
+ TransferStatus.values = [
5
+ "PENDING",
6
+ "PENDING_FOR_DATE",
7
+ "PENDING_FOR_FUNDS",
8
+ "SETTLED",
9
+ "CANCELLED",
10
+ "ERROR_REJECTED",
11
+ "APPROVAL_PENDING",
12
+ "DECLINED",
13
+ "APPROVED",
14
+ "GENERATED",
15
+ ];
16
+ TransferStatus.type = isly.string(TransferStatus.values);
17
+ TransferStatus.is = TransferStatus.type.is;
19
18
  })(TransferStatus || (TransferStatus = {}));
20
19
  //# sourceMappingURL=TransferStatus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransferStatus.js","sourceRoot":"../","sources":["model/TransferStatus.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG;IACtB,SAAS;IACT,kBAAkB;IAClB,mBAAmB;IACnB,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,WAAW;CACF,CAAA;AAIV,MAAM,KAAW,cAAc,CAI9B;AAJD,WAAiB,cAAc;IAC9B,SAAgB,EAAE,CAAC,KAAc;QAChC,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAuB,CAAC,CAAA;IACpF,CAAC;IAFe,iBAAE,KAEjB,CAAA;AACF,CAAC,EAJgB,cAAc,KAAd,cAAc,QAI9B"}
1
+ {"version":3,"file":"TransferStatus.js","sourceRoot":"../","sources":["model/TransferStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,cAAc,CAe9B;AAfD,WAAiB,cAAc;IACjB,qBAAM,GAAG;QACrB,SAAS;QACT,kBAAkB;QAClB,mBAAmB;QACnB,SAAS;QACT,WAAW;QACX,gBAAgB;QAChB,kBAAkB;QAClB,UAAU;QACV,UAAU;QACV,WAAW;KACF,CAAA;IACG,mBAAI,GAAG,IAAI,CAAC,MAAM,CAAC,eAAA,MAAM,CAAC,CAAA;IAC1B,iBAAE,GAAG,eAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAfgB,cAAc,KAAd,cAAc,QAe9B"}
@@ -1,21 +1,16 @@
1
+ import { isly } from "isly"
1
2
  import { AmountPair } from "./AmountPair"
2
3
 
3
4
  export interface BillingTransactionAmountPair {
4
5
  billing: AmountPair
5
6
  transaction: AmountPair
6
- fxRate: number
7
- rebate?: number
8
- rebateRate?: number
7
+ fxRate?: number
9
8
  }
10
9
  export namespace BillingTransactionAmountPair {
11
- export function is(value: BillingTransactionAmountPair | any): value is BillingTransactionAmountPair {
12
- return (
13
- typeof value == "object" &&
14
- AmountPair.is(value.billing) &&
15
- AmountPair.is(value.transaction) &&
16
- typeof value.fxRate == "number" &&
17
- (typeof value.rebate == "number" || value.rebate == undefined) &&
18
- (typeof value.rebateRate == "number" || value.rebateRate == undefined)
19
- )
20
- }
10
+ export const type = isly.object<BillingTransactionAmountPair>({
11
+ billing: isly.fromIs("AmountPair", AmountPair.is),
12
+ transaction: isly.fromIs("AmountPair", AmountPair.is),
13
+ fxRate: isly.number().optional(),
14
+ })
15
+ export const is = type.is
21
16
  }
@@ -1,20 +1,20 @@
1
- const transferStatus = [
2
- "PENDING",
3
- "PENDING_FOR_DATE",
4
- "PENDING_FOR_FUNDS",
5
- "SETTLED",
6
- "CANCELLED",
7
- "ERROR_REJECTED",
8
- "APPROVAL_PENDING",
9
- "DECLINED",
10
- "APPROVED",
11
- "GENERATED",
12
- ] as const
1
+ import { isly } from "isly"
13
2
 
14
- export type TransferStatus = typeof transferStatus[number]
3
+ export type TransferStatus = typeof TransferStatus.values[number]
15
4
 
16
5
  export namespace TransferStatus {
17
- export function is(value: unknown): value is TransferStatus {
18
- return typeof value == "string" && transferStatus.includes(value as TransferStatus)
19
- }
6
+ export const values = [
7
+ "PENDING",
8
+ "PENDING_FOR_DATE",
9
+ "PENDING_FOR_FUNDS",
10
+ "SETTLED",
11
+ "CANCELLED",
12
+ "ERROR_REJECTED",
13
+ "APPROVAL_PENDING",
14
+ "DECLINED",
15
+ "APPROVED",
16
+ "GENERATED",
17
+ ] as const
18
+ export const type = isly.string(values)
19
+ export const is = type.is
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/client",
3
- "version": "0.3.135",
3
+ "version": "0.3.137",
4
4
  "description": "Client library for the Pax2Pay API",
5
5
  "author": "Pax2Pay Ltd.",
6
6
  "license": "MIT",