@pax2pay/model-banking 0.1.304 → 0.1.306

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/Card/Stack.ts CHANGED
@@ -19,4 +19,15 @@ export namespace Stack {
19
19
  export function toRealm(stack: Stack): Realm {
20
20
  return stack.split("-")[0] as Realm
21
21
  }
22
+ export function toScheme(stack: Stack): string {
23
+ const scheme = stack.split("-")[1]
24
+ return scheme == "mc" ? "mastercard" : scheme == "diners" ? "diners" : "unknown"
25
+ }
26
+ export function toProcessor(stack: Stack): string {
27
+ return stack
28
+ .split("-")
29
+ .slice(2)
30
+ .map(e => (e == "tpl" ? "transact" : e))
31
+ .join("-")
32
+ }
22
33
  }
package/Rule/Rule/Base.ts CHANGED
@@ -13,7 +13,7 @@ export interface Base {
13
13
  export namespace Base {
14
14
  export const kinds = ["authorization", "outbound", "inbound"] as const
15
15
  export type Kind = typeof kinds[number]
16
- export const categories = ["customer", "product", "fincrime"] as const
16
+ export const categories = ["fincrime", "product", "customer"] as const
17
17
  export type Category = typeof categories[number]
18
18
  export const type = isly.object<Base>({
19
19
  code: isly.string(new RegExp(/^[a-z0-9\-_]+$/)),
@@ -7,4 +7,6 @@ export declare namespace Stack {
7
7
  const is: isly.Type.IsFunction<"test-paxgiro" | "test-tpl-paxgiro" | "testUK-marqeta" | "testUK-tpl-marqeta" | "test-diners-dpg" | "uk-mc-tpl-marqeta">;
8
8
  const flaw: isly.Type.FlawFunction;
9
9
  function toRealm(stack: Stack): Realm;
10
+ function toScheme(stack: Stack): string;
11
+ function toProcessor(stack: Stack): string;
10
12
  }
@@ -16,5 +16,18 @@ export var Stack;
16
16
  return stack.split("-")[0];
17
17
  }
18
18
  Stack.toRealm = toRealm;
19
+ function toScheme(stack) {
20
+ const scheme = stack.split("-")[1];
21
+ return scheme == "mc" ? "mastercard" : scheme == "diners" ? "diners" : "unknown";
22
+ }
23
+ Stack.toScheme = toScheme;
24
+ function toProcessor(stack) {
25
+ return stack
26
+ .split("-")
27
+ .slice(2)
28
+ .map(e => (e == "tpl" ? "transact" : e))
29
+ .join("-");
30
+ }
31
+ Stack.toProcessor = toProcessor;
19
32
  })(Stack || (Stack = {}));
20
33
  //# sourceMappingURL=Stack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.js","sourceRoot":"../","sources":["Card/Stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAM3B,MAAM,KAAW,KAAK,CAerB;AAfD,WAAiB,KAAK;IACR,YAAM,GAAG;QACrB,cAAc;QACd,kBAAkB;QAClB,gBAAgB;QAChB,oBAAoB;QACpB,iBAAiB;QACjB,mBAAmB;KACV,CAAA;IACG,UAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,CAAA;IAC1B,QAAE,GAAG,MAAA,IAAI,CAAC,EAAE,CAAA;IACZ,UAAI,GAAG,MAAA,IAAI,CAAC,IAAI,CAAA;IAC7B,SAAgB,OAAO,CAAC,KAAY;QACnC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAU,CAAA;IACpC,CAAC;IAFe,aAAO,UAEtB,CAAA;AACF,CAAC,EAfgB,KAAK,KAAL,KAAK,QAerB"}
1
+ {"version":3,"file":"Stack.js","sourceRoot":"../","sources":["Card/Stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAM3B,MAAM,KAAW,KAAK,CA0BrB;AA1BD,WAAiB,KAAK;IACR,YAAM,GAAG;QACrB,cAAc;QACd,kBAAkB;QAClB,gBAAgB;QAChB,oBAAoB;QACpB,iBAAiB;QACjB,mBAAmB;KACV,CAAA;IACG,UAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,CAAA;IAC1B,QAAE,GAAG,MAAA,IAAI,CAAC,EAAE,CAAA;IACZ,UAAI,GAAG,MAAA,IAAI,CAAC,IAAI,CAAA;IAC7B,SAAgB,OAAO,CAAC,KAAY;QACnC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAU,CAAA;IACpC,CAAC;IAFe,aAAO,UAEtB,CAAA;IACD,SAAgB,QAAQ,CAAC,KAAY;QACpC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QAClC,OAAO,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAA;IACjF,CAAC;IAHe,cAAQ,WAGvB,CAAA;IACD,SAAgB,WAAW,CAAC,KAAY;QACvC,OAAO,KAAK;aACV,KAAK,CAAC,GAAG,CAAC;aACV,KAAK,CAAC,CAAC,CAAC;aACR,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACvC,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,CAAC;IANe,iBAAW,cAM1B,CAAA;AACF,CAAC,EA1BgB,KAAK,KAAL,KAAK,QA0BrB"}
@@ -3,6 +3,6 @@ import { Address as RailAddress } from "./Address";
3
3
  export type Rail = typeof Rail.rails[number];
4
4
  export declare namespace Rail {
5
5
  const rails: readonly ["internal", "paxgiro", "paxgiro-credit", "mastercard", "diners", "fasterpayments", "chaps", "bacs", "transfer", "credit"];
6
- const type: isly.Type<"paxgiro" | "internal" | "paxgiro-credit" | "mastercard" | "diners" | "fasterpayments" | "chaps" | "bacs" | "transfer" | "credit">;
6
+ const type: isly.Type<"paxgiro" | "mastercard" | "diners" | "internal" | "paxgiro-credit" | "fasterpayments" | "chaps" | "bacs" | "transfer" | "credit">;
7
7
  export import Address = RailAddress;
8
8
  }
@@ -12,7 +12,7 @@ export interface Base {
12
12
  export declare namespace Base {
13
13
  const kinds: readonly ["authorization", "outbound", "inbound"];
14
14
  type Kind = typeof kinds[number];
15
- const categories: readonly ["customer", "product", "fincrime"];
15
+ const categories: readonly ["fincrime", "product", "customer"];
16
16
  type Category = typeof categories[number];
17
17
  const type: isly.object.ExtendableType<Base>;
18
18
  }
@@ -2,7 +2,7 @@ import { isly } from "isly";
2
2
  export var Base;
3
3
  (function (Base) {
4
4
  Base.kinds = ["authorization", "outbound", "inbound"];
5
- Base.categories = ["customer", "product", "fincrime"];
5
+ Base.categories = ["fincrime", "product", "customer"];
6
6
  Base.type = isly.object({
7
7
  code: isly.string(new RegExp(/^[a-z0-9\-_]+$/)),
8
8
  name: isly.string(),
@@ -10,7 +10,7 @@ export declare namespace Rule {
10
10
  }
11
11
  type Category = ModelRule.Base.Category;
12
12
  namespace Category {
13
- const values: readonly ["customer", "product", "fincrime"];
13
+ const values: readonly ["fincrime", "product", "customer"];
14
14
  }
15
15
  type Kind = ModelRule.Base.Kind;
16
16
  namespace Kind {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.304",
3
+ "version": "0.1.306",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",