@pax2pay/client 0.5.7 → 0.5.8

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.
@@ -11,5 +11,6 @@ export interface BeneficiaryResponse {
11
11
  history?: BeneficiaryResponse[];
12
12
  }
13
13
  export declare namespace BeneficiaryResponse {
14
- function is(value: BeneficiaryResponse | any): value is BeneficiaryResponse;
14
+ const type: import("isly/dist/cjs/object").IslyObject<BeneficiaryResponse, object>;
15
+ const is: (value: BeneficiaryResponse | any) => value is BeneficiaryResponse;
15
16
  }
@@ -1,18 +1,18 @@
1
+ import { isly } from "isly";
1
2
  import { BeneficiaryStatus } from "./BeneficiaryStatus";
2
3
  import { TransferDestinationInfo } from "./TransferDestinationInfo";
3
4
  export var BeneficiaryResponse;
4
5
  (function (BeneficiaryResponse) {
5
- function is(value) {
6
- return (typeof value == "object" &&
7
- TransferDestinationInfo.is(value.transferDestination) &&
8
- BeneficiaryStatus.is(value.status) &&
9
- typeof value.name == "string" &&
10
- typeof value.beneficiaryId == "string" &&
11
- typeof value.createdOn == "string" &&
12
- (value.fullName == undefined || typeof value.fullName == "string") &&
13
- (value.defaultReference == undefined || typeof value.defaultReference == "string") &&
14
- (value.history == undefined || Array.isArray(value.history)));
15
- }
16
- BeneficiaryResponse.is = is;
6
+ BeneficiaryResponse.type = isly.object({
7
+ transferDestination: isly.fromIs("TransferDestinationInfo", TransferDestinationInfo.is),
8
+ status: isly.fromIs("BeneficiaryStatus", BeneficiaryStatus.is),
9
+ name: isly.string(),
10
+ beneficiaryId: isly.string(),
11
+ createdOn: isly.string(),
12
+ defaultReference: isly.string().optional(),
13
+ fullName: isly.string().optional(),
14
+ history: isly.fromIs("BeneficiaryResponse[]", Array.isArray).optional(),
15
+ });
16
+ BeneficiaryResponse.is = BeneficiaryResponse.type.is;
17
17
  })(BeneficiaryResponse || (BeneficiaryResponse = {}));
18
18
  //# sourceMappingURL=BeneficiaryResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BeneficiaryResponse.js","sourceRoot":"../","sources":["model/BeneficiaryResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAanE,MAAM,KAAW,mBAAmB,CAcnC;AAdD,WAAiB,mBAAmB;IACnC,SAAgB,EAAE,CAAC,KAAgC;QAClD,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ;YACxB,uBAAuB,CAAC,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC;YACrD,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;YAClC,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,OAAO,KAAK,CAAC,aAAa,IAAI,QAAQ;YACtC,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ;YAClC,CAAC,KAAK,CAAC,QAAQ,IAAI,SAAS,IAAI,OAAO,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;YAClE,CAAC,KAAK,CAAC,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,CAAC,gBAAgB,IAAI,QAAQ,CAAC;YAClF,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAC5D,CAAA;IACF,CAAC;IAZe,sBAAE,KAYjB,CAAA;AACF,CAAC,EAdgB,mBAAmB,KAAnB,mBAAmB,QAcnC"}
1
+ {"version":3,"file":"BeneficiaryResponse.js","sourceRoot":"../","sources":["model/BeneficiaryResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAanE,MAAM,KAAW,mBAAmB,CAYnC;AAZD,WAAiB,mBAAmB;IACtB,wBAAI,GAAG,IAAI,CAAC,MAAM,CAAsB;QACpD,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,yBAAyB,EAAE,uBAAuB,CAAC,EAAE,CAAC;QACvF,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,CAAC;QAC9D,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE;QAC5B,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,gBAAgB,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1C,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAClC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;KACvE,CAAC,CAAA;IACW,sBAAE,GAAG,oBAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAZgB,mBAAmB,KAAnB,mBAAmB,QAYnC"}
@@ -1,3 +1,4 @@
1
+ import { isly } from "isly"
1
2
  import { BeneficiaryStatus } from "./BeneficiaryStatus"
2
3
  import { TransferDestinationInfo } from "./TransferDestinationInfo"
3
4
 
@@ -13,17 +14,15 @@ export interface BeneficiaryResponse {
13
14
  }
14
15
 
15
16
  export namespace BeneficiaryResponse {
16
- export function is(value: BeneficiaryResponse | any): value is BeneficiaryResponse {
17
- return (
18
- typeof value == "object" &&
19
- TransferDestinationInfo.is(value.transferDestination) &&
20
- BeneficiaryStatus.is(value.status) &&
21
- typeof value.name == "string" &&
22
- typeof value.beneficiaryId == "string" &&
23
- typeof value.createdOn == "string" &&
24
- (value.fullName == undefined || typeof value.fullName == "string") &&
25
- (value.defaultReference == undefined || typeof value.defaultReference == "string") &&
26
- (value.history == undefined || Array.isArray(value.history)) //not checking same type because of risk of being slow
27
- )
28
- }
17
+ export const type = isly.object<BeneficiaryResponse>({
18
+ transferDestination: isly.fromIs("TransferDestinationInfo", TransferDestinationInfo.is),
19
+ status: isly.fromIs("BeneficiaryStatus", BeneficiaryStatus.is),
20
+ name: isly.string(),
21
+ beneficiaryId: isly.string(),
22
+ createdOn: isly.string(),
23
+ defaultReference: isly.string().optional(),
24
+ fullName: isly.string().optional(),
25
+ history: isly.fromIs("BeneficiaryResponse[]", Array.isArray).optional(), // Not checking same type because of risk of being slow
26
+ })
27
+ export const is = type.is
29
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/client",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Client library for the Pax2Pay API",
5
5
  "author": "Pax2Pay Ltd.",
6
6
  "license": "MIT",