@pax2pay/model-banking 0.1.433 → 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.
- package/Account/Creatable.ts +12 -1
- package/Account/index.ts +4 -5
- package/Settlement/Entry/index.ts +1 -3
- package/dist/Account/Creatable.d.ts +9 -0
- package/dist/Account/Creatable.js +10 -1
- package/dist/Account/Creatable.js.map +1 -1
- package/dist/Account/index.d.ts +4 -4
- package/dist/Account/index.js +4 -5
- package/dist/Account/index.js.map +1 -1
- package/dist/Settlement/Entry/index.js +1 -1
- package/dist/Settlement/Entry/index.js.map +1 -1
- package/package.json +1 -1
package/Account/Creatable.ts
CHANGED
|
@@ -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
|
|
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 =
|
|
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
|
}
|
|
@@ -62,9 +62,7 @@ export namespace Entry {
|
|
|
62
62
|
const result = []
|
|
63
63
|
!creatable.authorization && result.push("Missing authorization.")
|
|
64
64
|
if (gracely.Error.is(transaction))
|
|
65
|
-
result.push(
|
|
66
|
-
`gracely error: ${transaction.status}, ${transaction.type}, ${transaction.header}, ${transaction.body}`
|
|
67
|
-
)
|
|
65
|
+
result.push(`gracely error: ${JSON.stringify(transaction)}`)
|
|
68
66
|
else if (typeof transaction != "string")
|
|
69
67
|
result.push(`Transaction ${transaction.id} on account ${transaction.accountId} unable to be finalized.`)
|
|
70
68
|
else
|
|
@@ -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
|
-
|
|
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":"
|
|
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"}
|
package/dist/Account/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/Account/index.js
CHANGED
|
@@ -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 =
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Account/index.ts"],"names":[],"mappings":"AAAA,OA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B,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,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"}
|
|
@@ -42,7 +42,7 @@ export var Entry;
|
|
|
42
42
|
const result = [];
|
|
43
43
|
!creatable.authorization && result.push("Missing authorization.");
|
|
44
44
|
if (gracely.Error.is(transaction))
|
|
45
|
-
result.push(`gracely error: ${
|
|
45
|
+
result.push(`gracely error: ${JSON.stringify(transaction)}`);
|
|
46
46
|
else if (typeof transaction != "string")
|
|
47
47
|
result.push(`Transaction ${transaction.id} on account ${transaction.accountId} unable to be finalized.`);
|
|
48
48
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Settlement/Entry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,MAAM,IAA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