@pax2pay/model-banking 0.1.50 → 0.1.51

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/Realm/index.ts CHANGED
@@ -1,13 +1,17 @@
1
- export const Realms = ["test", "uk", "eu"] as const
1
+ import { isly } from "isly"
2
+
3
+ export const Realms = ["test", "testUK", "uk", "eu"] as const
2
4
  export type Realm = typeof Realms[number]
3
5
 
4
6
  export namespace Realm {
5
7
  export const realms: Realm[] = [...Realms]
6
-
7
- export function is(value: any | Realm): value is Realm {
8
- return value && (value == "test" || value == "uk" || value == "eu")
9
- //return value && realms.includes(value)
10
- }
8
+ export const type: isly.Type<Realm> = isly.union(
9
+ isly.string("test"),
10
+ isly.string("testUK"),
11
+ isly.string("uk"),
12
+ isly.string("eu")
13
+ )
14
+ export const is = type.is
11
15
  export function toString(): string {
12
16
  return realms.toString().replaceAll(",", ", ") + "."
13
17
  }
@@ -1,7 +1,9 @@
1
- export declare const Realms: readonly ["test", "uk", "eu"];
1
+ import { isly } from "isly";
2
+ export declare const Realms: readonly ["test", "testUK", "uk", "eu"];
2
3
  export type Realm = typeof Realms[number];
3
4
  export declare namespace Realm {
4
5
  const realms: Realm[];
5
- function is(value: any | Realm): value is Realm;
6
+ const type: isly.Type<Realm>;
7
+ const is: isly.Type.IsFunction<"eu" | "uk" | "test" | "testUK">;
6
8
  function toString(): string;
7
9
  }
@@ -1,11 +1,10 @@
1
- export const Realms = ["test", "uk", "eu"];
1
+ import { isly } from "isly";
2
+ export const Realms = ["test", "testUK", "uk", "eu"];
2
3
  export var Realm;
3
4
  (function (Realm) {
4
5
  Realm.realms = [...Realms];
5
- function is(value) {
6
- return value && (value == "test" || value == "uk" || value == "eu");
7
- }
8
- Realm.is = is;
6
+ Realm.type = isly.union(isly.string("test"), isly.string("testUK"), isly.string("uk"), isly.string("eu"));
7
+ Realm.is = Realm.type.is;
9
8
  function toString() {
10
9
  return Realm.realms.toString().replaceAll(",", ", ") + ".";
11
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Realm/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAGnD,MAAM,KAAW,KAAK,CAUrB;AAVD,WAAiB,KAAK;IACR,YAAM,GAAY,CAAC,GAAG,MAAM,CAAC,CAAA;IAE1C,SAAgB,EAAE,CAAC,KAAkB;QACpC,OAAO,KAAK,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,CAAA;IAEpE,CAAC;IAHe,QAAE,KAGjB,CAAA;IACD,SAAgB,QAAQ;QACvB,OAAO,MAAA,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAA;IACrD,CAAC;IAFe,cAAQ,WAEvB,CAAA;AACF,CAAC,EAVgB,KAAK,KAAL,KAAK,QAUrB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Realm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAG7D,MAAM,KAAW,KAAK,CAYrB;AAZD,WAAiB,KAAK;IACR,YAAM,GAAY,CAAC,GAAG,MAAM,CAAC,CAAA;IAC7B,UAAI,GAAqB,IAAI,CAAC,KAAK,CAC/C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EACnB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CACjB,CAAA;IACY,QAAE,GAAG,MAAA,IAAI,CAAC,EAAE,CAAA;IACzB,SAAgB,QAAQ;QACvB,OAAO,MAAA,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAA;IACrD,CAAC;IAFe,cAAQ,WAEvB,CAAA;AACF,CAAC,EAZgB,KAAK,KAAL,KAAK,QAYrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",