@pax2pay/model-banking 0.1.434 → 0.1.435

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.
@@ -1,9 +1,20 @@
1
+ import { DurableObjectLocationHint } from "@cloudflare/workers-types"
1
2
  import { isly } from "isly"
2
3
 
3
4
  export interface Creatable {
4
5
  name: string
6
+ location?: Creatable.Location
5
7
  }
6
8
 
7
9
  export namespace Creatable {
8
- export const type = isly.object<Creatable>({ name: isly.string() })
10
+ export type Location = typeof Location.values[number]
11
+ export namespace Location {
12
+ export const values = ["east-north-america", "west-europe"] as const
13
+ export function toCloudflare(value: Location): DurableObjectLocationHint {
14
+ return value == "east-north-america" ? "enam" : "weur"
15
+ }
16
+ // All location hints: ["wnam", "enam", "sam", "weur", "eeur", "apac", "oc", "afr", "me"]
17
+ export const type = isly.string(values)
18
+ }
19
+ export const type = isly.object<Creatable>({ name: isly.string(), location: Location.type.optional() })
9
20
  }
package/Account/index.ts CHANGED
@@ -19,12 +19,14 @@ export interface Account extends Account.Creatable {
19
19
  status: Account.Status
20
20
  }
21
21
  export namespace Account {
22
+ export import Creatable = AccountCreatable
23
+ export import Status = AccountStatus
24
+ export import History = AccountHistory
22
25
  export type Legacy = Omit<Account, "status">
23
26
  export function fromLegacy(maybeLegacy: Legacy | Account, status?: Account.Status): Account {
24
27
  return { ...maybeLegacy, status: status ?? ("status" in maybeLegacy ? maybeLegacy.status : { mode: "active" }) }
25
28
  }
26
- export const type = isly.object<Account>({
27
- name: isly.string(),
29
+ export const type = Creatable.type.extend<Account>({
28
30
  id: isly.string(),
29
31
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
30
32
  balances: Balances.type,
@@ -37,7 +39,4 @@ export namespace Account {
37
39
  export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
38
40
  return cryptly.Identifier.is(value, 8)
39
41
  }
40
- export import Creatable = AccountCreatable
41
- export import Status = AccountStatus
42
- export import History = AccountHistory
43
42
  }
@@ -1,6 +1,15 @@
1
+ import { DurableObjectLocationHint } from "@cloudflare/workers-types";
2
+ import { isly } from "isly";
1
3
  export interface Creatable {
2
4
  name: string;
5
+ location?: Creatable.Location;
3
6
  }
4
7
  export declare namespace Creatable {
8
+ type Location = typeof Location.values[number];
9
+ namespace Location {
10
+ const values: readonly ["east-north-america", "west-europe"];
11
+ function toCloudflare(value: Location): DurableObjectLocationHint;
12
+ const type: isly.Type<"east-north-america" | "west-europe">;
13
+ }
5
14
  const type: import("isly/dist/cjs/object").IslyObject<Creatable, object>;
6
15
  }
@@ -1,6 +1,15 @@
1
1
  import { isly } from "isly";
2
2
  export var Creatable;
3
3
  (function (Creatable) {
4
- Creatable.type = isly.object({ name: isly.string() });
4
+ let Location;
5
+ (function (Location) {
6
+ Location.values = ["east-north-america", "west-europe"];
7
+ function toCloudflare(value) {
8
+ return value == "east-north-america" ? "enam" : "weur";
9
+ }
10
+ Location.toCloudflare = toCloudflare;
11
+ Location.type = isly.string(Location.values);
12
+ })(Location = Creatable.Location || (Creatable.Location = {}));
13
+ Creatable.type = isly.object({ name: isly.string(), location: Location.type.optional() });
5
14
  })(Creatable || (Creatable = {}));
6
15
  //# sourceMappingURL=Creatable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Account/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAM3B,MAAM,KAAW,SAAS,CAEzB;AAFD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AACpE,CAAC,EAFgB,SAAS,KAAT,SAAS,QAEzB"}
1
+ {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Account/Creatable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAO3B,MAAM,KAAW,SAAS,CAWzB;AAXD,WAAiB,SAAS;IAEzB,IAAiB,QAAQ,CAOxB;IAPD,WAAiB,QAAQ;QACX,eAAM,GAAG,CAAC,oBAAoB,EAAE,aAAa,CAAU,CAAA;QACpE,SAAgB,YAAY,CAAC,KAAe;YAC3C,OAAO,KAAK,IAAI,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;QACvD,CAAC;QAFe,qBAAY,eAE3B,CAAA;QAEY,aAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAA,MAAM,CAAC,CAAA;IACxC,CAAC,EAPgB,QAAQ,GAAR,kBAAQ,KAAR,kBAAQ,QAOxB;IACY,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACxG,CAAC,EAXgB,SAAS,KAAT,SAAS,QAWzB"}
@@ -17,11 +17,11 @@ export interface Account extends Account.Creatable {
17
17
  status: Account.Status;
18
18
  }
19
19
  export declare namespace Account {
20
- type Legacy = Omit<Account, "status">;
21
- function fromLegacy(maybeLegacy: Legacy | Account, status?: Account.Status): Account;
22
- const type: import("isly/dist/cjs/object").IslyObject<Account, object>;
23
- function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
24
20
  export import Creatable = AccountCreatable;
25
21
  export import Status = AccountStatus;
26
22
  export import History = AccountHistory;
23
+ type Legacy = Omit<Account, "status">;
24
+ function fromLegacy(maybeLegacy: Legacy | Account, status?: Account.Status): Account;
25
+ const type: import("isly/dist/cjs/object").IslyObject<Account, Creatable>;
26
+ function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
27
27
  }
@@ -9,12 +9,14 @@ import { History as AccountHistory } from "./History";
9
9
  import { Status as AccountStatus } from "./Status";
10
10
  export var Account;
11
11
  (function (Account) {
12
+ Account.Creatable = AccountCreatable;
13
+ Account.Status = AccountStatus;
14
+ Account.History = AccountHistory;
12
15
  function fromLegacy(maybeLegacy, status) {
13
16
  return { ...maybeLegacy, status: status ?? ("status" in maybeLegacy ? maybeLegacy.status : { mode: "active" }) };
14
17
  }
15
18
  Account.fromLegacy = fromLegacy;
16
- Account.type = isly.object({
17
- name: isly.string(),
19
+ Account.type = Account.Creatable.type.extend({
18
20
  id: isly.string(),
19
21
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
20
22
  balances: Balances.type,
@@ -28,8 +30,5 @@ export var Account;
28
30
  return cryptly.Identifier.is(value, 8);
29
31
  }
30
32
  Account.isIdentifier = isIdentifier;
31
- Account.Creatable = AccountCreatable;
32
- Account.Status = AccountStatus;
33
- Account.History = AccountHistory;
34
33
  })(Account || (Account = {}));
35
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,UAAU,CAAA;AAYlD,MAAM,KAAW,OAAO,CAsBvB;AAtBD,WAAiB,OAAO;IAEvB,SAAgB,UAAU,CAAC,WAA6B,EAAE,MAAuB;QAChF,OAAO,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,MAAM,IAA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,IAAI,CAAC,CAAC,QAAQ,EAAE;QACpG,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QACnC,MAAM,EAAE,aAAa,CAAC,IAAI;KAC1B,CAAC,CAAA;IACF,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,oBAAY,eAE3B,CAAA;AACF,CAAC,EArBgB,OAAO,KAAP,OAAO,QAqBvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.434",
3
+ "version": "0.1.435",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",