@pax2pay/model-banking 0.1.114 → 0.1.116

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.
@@ -6,16 +6,18 @@ import { Creatable } from "./Creatable"
6
6
 
7
7
  export interface Failed extends Base {
8
8
  status: { code: string; reason: string | string[] }
9
+ error?: gracely.Error
9
10
  }
10
11
 
11
12
  export namespace Failed {
12
13
  export const type = Base.type.extend<Failed>({
13
14
  status: isly.object({ code: isly.string(), reason: isly.union(isly.string(), isly.string().array()) }),
15
+ error: isly.fromIs("error", gracely.Error.is).optional(),
14
16
  })
15
17
  export const is = type.is
16
18
  export const flaw = type.flaw
17
- export function fromCreatable(authorization: Creatable, transaction: gracely.Error): Failed {
18
- return { ...Base.fromCreatable(authorization), ...statusFrom(transaction) }
19
+ export function fromCreatable(authorization: Creatable, error: gracely.Error): Failed {
20
+ return { ...Base.fromCreatable(authorization), ...statusFrom(error), error }
19
21
  }
20
22
  export function statusFrom(transaction: gracely.Error): Pick<Failed, "status"> {
21
23
  let result: Pick<Failed, "status">
package/Card/Preset.ts CHANGED
@@ -3,8 +3,8 @@ import { isly } from "isly"
3
3
  export type Preset = typeof Preset.names[number]
4
4
 
5
5
  export namespace Preset {
6
- export const names = ["p2p-pg-200", "p2p-mc-200", "p2p-ta-pg-200", "p2p-ta-mc-200"] as const
7
- export const type = isly.string(names) //isly.union(isly.string("p2p-pg-200"), isly.string("p2p-mc-200"))
6
+ export const names = ["p2p-mc-200", "test-mc-200", "test-pg-200", "test-ta-pg-200", "test-ta-mc-200"] as const
7
+ export const type = isly.string(names)
8
8
  export const is = type.is
9
9
  export const flaw = type.flaw
10
10
  }
@@ -7,11 +7,12 @@ export interface Failed extends Base {
7
7
  code: string;
8
8
  reason: string | string[];
9
9
  };
10
+ error?: gracely.Error;
10
11
  }
11
12
  export declare namespace Failed {
12
13
  const type: isly.object.ExtendableType<Failed>;
13
14
  const is: isly.Type.IsFunction<Failed>;
14
15
  const flaw: isly.Type.FlawFunction;
15
- function fromCreatable(authorization: Creatable, transaction: gracely.Error): Failed;
16
+ function fromCreatable(authorization: Creatable, error: gracely.Error): Failed;
16
17
  function statusFrom(transaction: gracely.Error): Pick<Failed, "status">;
17
18
  }
@@ -5,11 +5,12 @@ export var Failed;
5
5
  (function (Failed) {
6
6
  Failed.type = Base.type.extend({
7
7
  status: isly.object({ code: isly.string(), reason: isly.union(isly.string(), isly.string().array()) }),
8
+ error: isly.fromIs("error", gracely.Error.is).optional(),
8
9
  });
9
10
  Failed.is = Failed.type.is;
10
11
  Failed.flaw = Failed.type.flaw;
11
- function fromCreatable(authorization, transaction) {
12
- return { ...Base.fromCreatable(authorization), ...statusFrom(transaction) };
12
+ function fromCreatable(authorization, error) {
13
+ return { ...Base.fromCreatable(authorization), ...statusFrom(error), error };
13
14
  }
14
15
  Failed.fromCreatable = fromCreatable;
15
16
  function statusFrom(transaction) {
@@ -1 +1 @@
1
- {"version":3,"file":"Failed.js","sourceRoot":"../","sources":["Authorization/Failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAO7B,MAAM,KAAW,MAAM,CAiCtB;AAjCD,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAS;QAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;KACtG,CAAC,CAAA;IACW,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IACZ,WAAI,GAAG,OAAA,IAAI,CAAC,IAAI,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AAG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,CAAA;QAC5D,OAAO,MAAM,CAAA;IACd,CAAC;IAvBe,iBAAU,aAuBzB,CAAA;AACF,CAAC,EAlCgB,MAAM,KAAN,MAAM,QAkCtB"}
@@ -1,8 +1,8 @@
1
1
  import { isly } from "isly";
2
2
  export type Preset = typeof Preset.names[number];
3
3
  export declare namespace Preset {
4
- const names: readonly ["p2p-pg-200", "p2p-mc-200", "p2p-ta-pg-200", "p2p-ta-mc-200"];
5
- const type: isly.Type<"p2p-pg-200" | "p2p-mc-200" | "p2p-ta-pg-200" | "p2p-ta-mc-200">;
6
- const is: isly.Type.IsFunction<"p2p-pg-200" | "p2p-mc-200" | "p2p-ta-pg-200" | "p2p-ta-mc-200">;
4
+ const names: readonly ["p2p-mc-200", "test-mc-200", "test-pg-200", "test-ta-pg-200", "test-ta-mc-200"];
5
+ const type: isly.Type<"p2p-mc-200" | "test-mc-200" | "test-pg-200" | "test-ta-pg-200" | "test-ta-mc-200">;
6
+ const is: isly.Type.IsFunction<"p2p-mc-200" | "test-mc-200" | "test-pg-200" | "test-ta-pg-200" | "test-ta-mc-200">;
7
7
  const flaw: isly.Type.FlawFunction;
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import { isly } from "isly";
2
2
  export var Preset;
3
3
  (function (Preset) {
4
- Preset.names = ["p2p-pg-200", "p2p-mc-200", "p2p-ta-pg-200", "p2p-ta-mc-200"];
4
+ Preset.names = ["p2p-mc-200", "test-mc-200", "test-pg-200", "test-ta-pg-200", "test-ta-mc-200"];
5
5
  Preset.type = isly.string(Preset.names);
6
6
  Preset.is = Preset.type.is;
7
7
  Preset.flaw = Preset.type.flaw;
@@ -1 +1 @@
1
- {"version":3,"file":"Preset.js","sourceRoot":"../","sources":["Card/Preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,MAAM,CAKtB;AALD,WAAiB,MAAM;IACT,YAAK,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,CAAU,CAAA;IAC/E,WAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAA,KAAK,CAAC,CAAA;IACzB,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IACZ,WAAI,GAAG,OAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EALgB,MAAM,KAAN,MAAM,QAKtB"}
1
+ {"version":3,"file":"Preset.js","sourceRoot":"../","sources":["Card/Preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,MAAM,CAKtB;AALD,WAAiB,MAAM;IACT,YAAK,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,CAAU,CAAA;IACjG,WAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAA,KAAK,CAAC,CAAA;IACzB,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IACZ,WAAI,GAAG,OAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EALgB,MAAM,KAAN,MAAM,QAKtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.114",
3
+ "version": "0.1.116",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",