@pax2pay/model-banking 0.1.491 → 0.1.492

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.
Files changed (76) hide show
  1. package/Backup/Account.ts +24 -0
  2. package/Backup/Base.ts +32 -0
  3. package/Backup/Card.ts +25 -0
  4. package/Backup/Operation.ts +25 -0
  5. package/Backup/Organization.ts +26 -0
  6. package/Backup/Rule.ts +25 -0
  7. package/Backup/Transaction.ts +28 -0
  8. package/Backup/User.ts +25 -0
  9. package/Backup/index.ts +30 -0
  10. package/Card/Meta.ts +1 -2
  11. package/dist/cjs/Backup/Account.d.ts +15 -0
  12. package/dist/cjs/Backup/Account.js +20 -0
  13. package/dist/cjs/Backup/Account.js.map +1 -0
  14. package/dist/cjs/Backup/Base.d.ts +29 -0
  15. package/dist/cjs/Backup/Base.js +18 -0
  16. package/dist/cjs/Backup/Base.js.map +1 -0
  17. package/dist/cjs/Backup/Card.d.ts +14 -0
  18. package/dist/cjs/Backup/Card.js +20 -0
  19. package/dist/cjs/Backup/Card.js.map +1 -0
  20. package/dist/cjs/Backup/Operation.d.ts +15 -0
  21. package/dist/cjs/Backup/Operation.js +19 -0
  22. package/dist/cjs/Backup/Operation.js.map +1 -0
  23. package/dist/cjs/Backup/Organization.d.ts +13 -0
  24. package/dist/cjs/Backup/Organization.js +19 -0
  25. package/dist/cjs/Backup/Organization.js.map +1 -0
  26. package/dist/cjs/Backup/Rule.d.ts +17 -0
  27. package/dist/cjs/Backup/Rule.js +19 -0
  28. package/dist/cjs/Backup/Rule.js.map +1 -0
  29. package/dist/cjs/Backup/Transaction.d.ts +25 -0
  30. package/dist/cjs/Backup/Transaction.js +20 -0
  31. package/dist/cjs/Backup/Transaction.js.map +1 -0
  32. package/dist/cjs/Backup/User.d.ts +15 -0
  33. package/dist/cjs/Backup/User.js +18 -0
  34. package/dist/cjs/Backup/User.js.map +1 -0
  35. package/dist/cjs/Backup/index.d.ts +26 -0
  36. package/dist/cjs/Backup/index.js +23 -0
  37. package/dist/cjs/Backup/index.js.map +1 -0
  38. package/dist/cjs/Card/Meta.d.ts +1 -3
  39. package/dist/cjs/Card/Meta.js.map +1 -1
  40. package/dist/cjs/pax2pay.d.ts +1 -0
  41. package/dist/cjs/pax2pay.js +3 -1
  42. package/dist/cjs/pax2pay.js.map +1 -1
  43. package/dist/mjs/Backup/Account.d.ts +15 -0
  44. package/dist/mjs/Backup/Account.js +17 -0
  45. package/dist/mjs/Backup/Account.js.map +1 -0
  46. package/dist/mjs/Backup/Base.d.ts +29 -0
  47. package/dist/mjs/Backup/Base.js +15 -0
  48. package/dist/mjs/Backup/Base.js.map +1 -0
  49. package/dist/mjs/Backup/Card.d.ts +14 -0
  50. package/dist/mjs/Backup/Card.js +17 -0
  51. package/dist/mjs/Backup/Card.js.map +1 -0
  52. package/dist/mjs/Backup/Operation.d.ts +15 -0
  53. package/dist/mjs/Backup/Operation.js +16 -0
  54. package/dist/mjs/Backup/Operation.js.map +1 -0
  55. package/dist/mjs/Backup/Organization.d.ts +13 -0
  56. package/dist/mjs/Backup/Organization.js +16 -0
  57. package/dist/mjs/Backup/Organization.js.map +1 -0
  58. package/dist/mjs/Backup/Rule.d.ts +17 -0
  59. package/dist/mjs/Backup/Rule.js +16 -0
  60. package/dist/mjs/Backup/Rule.js.map +1 -0
  61. package/dist/mjs/Backup/Transaction.d.ts +25 -0
  62. package/dist/mjs/Backup/Transaction.js +17 -0
  63. package/dist/mjs/Backup/Transaction.js.map +1 -0
  64. package/dist/mjs/Backup/User.d.ts +15 -0
  65. package/dist/mjs/Backup/User.js +15 -0
  66. package/dist/mjs/Backup/User.js.map +1 -0
  67. package/dist/mjs/Backup/index.d.ts +26 -0
  68. package/dist/mjs/Backup/index.js +20 -0
  69. package/dist/mjs/Backup/index.js.map +1 -0
  70. package/dist/mjs/Card/Meta.d.ts +1 -3
  71. package/dist/mjs/Card/Meta.js.map +1 -1
  72. package/dist/mjs/pax2pay.d.ts +1 -0
  73. package/dist/mjs/pax2pay.js +1 -0
  74. package/dist/mjs/pax2pay.js.map +1 -1
  75. package/package.json +4 -4
  76. package/pax2pay.ts +1 -0
@@ -0,0 +1,24 @@
1
+ import { isoly } from "isoly"
2
+ import { Account as modelAccount } from "../Account"
3
+ import { Base } from "./Base"
4
+
5
+ export interface Account extends Base<modelAccount> {
6
+ entityType: "account"
7
+ entity: string
8
+ organization: string
9
+ account: string
10
+ meta: { key: string }
11
+ }
12
+ export namespace Account {
13
+ export const create: Base.Create<modelAccount, Account> = (value: modelAccount, action: Base.Action) => ({
14
+ entityType: "account",
15
+ entity: value.id,
16
+ organization: value.organization,
17
+ account: value.id,
18
+ action,
19
+ created: isoly.DateTime.now(),
20
+ meta: { key: value.key ?? "" },
21
+ value,
22
+ })
23
+ export const addSender = Base.pipeToSender(create)
24
+ }
package/Backup/Base.ts ADDED
@@ -0,0 +1,32 @@
1
+ import { isoly } from "isoly"
2
+ import { Realm } from "../Realm"
3
+
4
+ export type Base<T> = {
5
+ realm?: Realm
6
+ organization?: string
7
+ account?: string
8
+ entity: string
9
+ entityType: string
10
+ action: Base.Action
11
+ created: isoly.DateTime
12
+ isError?: true
13
+ meta?: any
14
+ value: T
15
+ }
16
+ export namespace Base {
17
+ export type Action = typeof Action.values[number]
18
+ export namespace Action {
19
+ export const values = ["created", "updated", "cancelled", "removed"] as const
20
+ }
21
+ export type Data = { realm?: Realm; organization?: string; account?: string; isError?: true; meta?: any }
22
+ export type Create<T, B extends Base<T>, D extends Data = Record<string, never>> = (...args: [T, Action, D?]) => B
23
+ export function pipeToSender<T, B extends Base<T>, D extends Data = Record<string, never>>(
24
+ mapper: Base.Create<T, B, D>
25
+ ): (sender: (backup: B) => any | Promise<any>) => (...args: Parameters<typeof mapper>) => ReturnType<typeof sender> {
26
+ return sender =>
27
+ (...args) => {
28
+ const backup = mapper(...args)
29
+ return sender(backup)
30
+ }
31
+ }
32
+ }
package/Backup/Card.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { isoly } from "isoly"
2
+ import { Card as modelCard } from "../Card"
3
+ import { Realm } from "../Realm"
4
+ import { Base } from "./Base"
5
+
6
+ export interface Card extends Base<modelCard> {
7
+ realm: Realm
8
+ entityType: "card"
9
+ entity: string
10
+ organization: string
11
+ account: string
12
+ }
13
+ export namespace Card {
14
+ export const create: Base.Create<modelCard, Card> = (value: modelCard, action: Base.Action) => ({
15
+ realm: value.realm,
16
+ entityType: "card",
17
+ entity: value.id,
18
+ organization: value.organization,
19
+ account: value.account,
20
+ action,
21
+ created: isoly.DateTime.now(),
22
+ value,
23
+ })
24
+ export const addSender = Base.pipeToSender(create)
25
+ }
@@ -0,0 +1,25 @@
1
+ import { isoly } from "isoly"
2
+ import { Operation as modelOperation } from "../Operation"
3
+ import { Base } from "./Base"
4
+
5
+ export interface Operation extends Base<modelOperation> {
6
+ entityType: "operation"
7
+ entity: string
8
+ account: string
9
+ }
10
+ export namespace Operation {
11
+ export const create: Base.Create<modelOperation, Operation, { organization: string }> = (
12
+ value: modelOperation,
13
+ action: Base.Action,
14
+ data?: { organization: string }
15
+ ) => ({
16
+ entityType: "operation",
17
+ entity: value.signature ?? "",
18
+ ...data,
19
+ account: value.account,
20
+ action,
21
+ created: isoly.DateTime.now(),
22
+ value,
23
+ })
24
+ export const addSender = Base.pipeToSender(create)
25
+ }
@@ -0,0 +1,26 @@
1
+ import { isoly } from "isoly"
2
+ import { Organization as modelOrganization } from "../Organization"
3
+ import { Realm } from "../Realm"
4
+ import { Base } from "./Base"
5
+
6
+ export interface Organization extends Base<modelOrganization> {
7
+ realm: Realm
8
+ entityType: "organization"
9
+ entity: string
10
+ organization: string
11
+ }
12
+ export namespace Organization {
13
+ export const create: Base.Create<modelOrganization, Organization> = (
14
+ value: modelOrganization,
15
+ action: Base.Action
16
+ ) => ({
17
+ realm: value.realm,
18
+ entityType: "organization",
19
+ entity: value.code,
20
+ organization: value.code,
21
+ action,
22
+ created: isoly.DateTime.now(),
23
+ value,
24
+ })
25
+ export const addSender = Base.pipeToSender(create)
26
+ }
package/Backup/Rule.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { isoly } from "isoly"
2
+ import { Rule as modelRule } from "../Rule"
3
+ import { Base } from "./Base"
4
+
5
+ export interface Rule extends Base<modelRule> {
6
+ entityType: "rule"
7
+ entity: string
8
+ meta: string
9
+ }
10
+ export namespace Rule {
11
+ export const create: Base.Create<modelRule, Rule, { organization?: string; account?: string }> = (
12
+ value: modelRule,
13
+ action: Base.Action,
14
+ data?: { organization?: string; account?: string }
15
+ ) => ({
16
+ entityType: "rule",
17
+ entity: value.code,
18
+ ...data,
19
+ action,
20
+ created: isoly.DateTime.now(),
21
+ meta: `${value.category}.${value.type}.${value.action}`,
22
+ value,
23
+ })
24
+ export const addSender = Base.pipeToSender(create)
25
+ }
@@ -0,0 +1,28 @@
1
+ import { isoly } from "isoly"
2
+ import { Transaction as modelTransaction } from "../Transaction"
3
+ import { Base } from "./Base"
4
+
5
+ export interface Transaction extends Base<modelTransaction & { state?: any }> {
6
+ entityType: "transaction"
7
+ entity: string
8
+ organization: string
9
+ account: string
10
+ isError?: true
11
+ }
12
+ export namespace Transaction {
13
+ export const create: Base.Create<modelTransaction & { state?: any }, Transaction, { isError?: true; meta?: any }> = (
14
+ value: modelTransaction & { state?: any },
15
+ action: Base.Action,
16
+ data?: { isError?: true; meta?: any }
17
+ ) => ({
18
+ entityType: "transaction",
19
+ entity: value.id,
20
+ organization: value.organization,
21
+ account: value.accountId,
22
+ action,
23
+ ...data,
24
+ created: isoly.DateTime.now(),
25
+ value,
26
+ })
27
+ export const addSender = Base.pipeToSender(create)
28
+ }
package/Backup/User.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { isoly } from "isoly"
2
+ import { userwidgets } from "@userwidgets/model"
3
+ import { Realm } from "../Realm"
4
+ import { Base } from "./Base"
5
+
6
+ export type User = Base<userwidgets.User> & {
7
+ entityType: "user"
8
+ entity: string
9
+ }
10
+
11
+ export namespace User {
12
+ export const create: Base.Create<userwidgets.User, User, { realm: Realm }> = (
13
+ value: userwidgets.User,
14
+ action: Base.Action,
15
+ data?: { realm: Realm }
16
+ ) => ({
17
+ ...data,
18
+ entityType: "user",
19
+ entity: value.email,
20
+ action,
21
+ created: isoly.DateTime.now(),
22
+ value,
23
+ })
24
+ export const addSender = Base.pipeToSender(create)
25
+ }
@@ -0,0 +1,30 @@
1
+ import { Realm } from "../Realm"
2
+ import { Account as AccountBackup } from "./Account"
3
+ import { Base as BaseBackup } from "./Base"
4
+ import { Card as CardBackup } from "./Card"
5
+ import { Operation as OperationBackup } from "./Operation"
6
+ import { Organization as OrganizationBackup } from "./Organization"
7
+ import { Rule as RuleBackup } from "./Rule"
8
+ import { Transaction as TransactionBackup } from "./Transaction"
9
+ import { User as UserBackup } from "./User"
10
+
11
+ export type Backup = Backup.Partial & Backup.Identifier
12
+ export namespace Backup {
13
+ export type Identifier = { realm: Realm; version: string; source: string }
14
+ export type Partial =
15
+ | TransactionBackup
16
+ | OperationBackup
17
+ | OrganizationBackup
18
+ | RuleBackup
19
+ | AccountBackup
20
+ | CardBackup
21
+ | UserBackup
22
+ export import Base = BaseBackup
23
+ export import Transaction = TransactionBackup
24
+ export import Account = AccountBackup
25
+ export import Organization = OrganizationBackup
26
+ export import Rule = RuleBackup
27
+ export import Operation = OperationBackup
28
+ export import User = UserBackup
29
+ export import Card = CardBackup
30
+ }
package/Card/Meta.ts CHANGED
@@ -1,6 +1,5 @@
1
- type Value = Meta | Value[] | undefined | number | string | boolean
2
1
  export interface Meta {
3
- [key: string]: Value
2
+ [key: string]: any
4
3
  }
5
4
 
6
5
  export namespace Meta {
@@ -0,0 +1,15 @@
1
+ import { Account as modelAccount } from "../Account";
2
+ import { Base } from "./Base";
3
+ export interface Account extends Base<modelAccount> {
4
+ entityType: "account";
5
+ entity: string;
6
+ organization: string;
7
+ account: string;
8
+ meta: {
9
+ key: string;
10
+ };
11
+ }
12
+ export declare namespace Account {
13
+ const create: Base.Create<modelAccount, Account>;
14
+ const addSender: (sender: (backup: Account) => any | Promise<any>) => (args_0: modelAccount, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: Record<string, never> | undefined) => ReturnType<(backup: Account) => any | Promise<any>>;
15
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Account = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var Account;
7
+ (function (Account) {
8
+ Account.create = (value, action) => ({
9
+ entityType: "account",
10
+ entity: value.id,
11
+ organization: value.organization,
12
+ account: value.id,
13
+ action,
14
+ created: isoly_1.isoly.DateTime.now(),
15
+ meta: { key: value.key ?? "" },
16
+ value,
17
+ });
18
+ Account.addSender = Base_1.Base.pipeToSender(Account.create);
19
+ })(Account || (exports.Account = Account = {}));
20
+ //# sourceMappingURL=Account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../Backup/Account.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,iCAA6B;AAS7B,IAAiB,OAAO,CAYvB;AAZD,WAAiB,OAAO;IACV,cAAM,GAAuC,CAAC,KAAmB,EAAE,MAAmB,EAAE,EAAE,CAAC,CAAC;QACxG,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,KAAK,CAAC,EAAE;QAChB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,OAAO,EAAE,KAAK,CAAC,EAAE;QACjB,MAAM;QACN,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,EAAE;QAC9B,KAAK;KACL,CAAC,CAAA;IACW,iBAAS,GAAG,WAAI,CAAC,YAAY,CAAC,QAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAZgB,OAAO,uBAAP,OAAO,QAYvB"}
@@ -0,0 +1,29 @@
1
+ import { isoly } from "isoly";
2
+ import { Realm } from "../Realm";
3
+ export type Base<T> = {
4
+ realm?: Realm;
5
+ organization?: string;
6
+ account?: string;
7
+ entity: string;
8
+ entityType: string;
9
+ action: Base.Action;
10
+ created: isoly.DateTime;
11
+ isError?: true;
12
+ meta?: any;
13
+ value: T;
14
+ };
15
+ export declare namespace Base {
16
+ type Action = typeof Action.values[number];
17
+ namespace Action {
18
+ const values: readonly ["created", "updated", "cancelled", "removed"];
19
+ }
20
+ type Data = {
21
+ realm?: Realm;
22
+ organization?: string;
23
+ account?: string;
24
+ isError?: true;
25
+ meta?: any;
26
+ };
27
+ type Create<T, B extends Base<T>, D extends Data = Record<string, never>> = (...args: [T, Action, D?]) => B;
28
+ function pipeToSender<T, B extends Base<T>, D extends Data = Record<string, never>>(mapper: Base.Create<T, B, D>): (sender: (backup: B) => any | Promise<any>) => (...args: Parameters<typeof mapper>) => ReturnType<typeof sender>;
29
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Base = void 0;
4
+ var Base;
5
+ (function (Base) {
6
+ let Action;
7
+ (function (Action) {
8
+ Action.values = ["created", "updated", "cancelled", "removed"];
9
+ })(Action = Base.Action || (Base.Action = {}));
10
+ function pipeToSender(mapper) {
11
+ return sender => (...args) => {
12
+ const backup = mapper(...args);
13
+ return sender(backup);
14
+ };
15
+ }
16
+ Base.pipeToSender = pipeToSender;
17
+ })(Base || (exports.Base = Base = {}));
18
+ //# sourceMappingURL=Base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../Backup/Base.ts"],"names":[],"mappings":";;;AAeA,IAAiB,IAAI,CAgBpB;AAhBD,WAAiB,IAAI;IAEpB,IAAiB,MAAM,CAEtB;IAFD,WAAiB,MAAM;QACT,aAAM,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAU,CAAA;IAC9E,CAAC,EAFgB,MAAM,GAAN,WAAM,KAAN,WAAM,QAEtB;IAGD,SAAgB,YAAY,CAC3B,MAA4B;QAE5B,OAAO,MAAM,CAAC,EAAE,CACf,CAAC,GAAG,IAAI,EAAE,EAAE;YACX,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;YAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;QACtB,CAAC,CAAA;IACH,CAAC;IARe,iBAAY,eAQ3B,CAAA;AACF,CAAC,EAhBgB,IAAI,oBAAJ,IAAI,QAgBpB"}
@@ -0,0 +1,14 @@
1
+ import { Card as modelCard } from "../Card";
2
+ import { Realm } from "../Realm";
3
+ import { Base } from "./Base";
4
+ export interface Card extends Base<modelCard> {
5
+ realm: Realm;
6
+ entityType: "card";
7
+ entity: string;
8
+ organization: string;
9
+ account: string;
10
+ }
11
+ export declare namespace Card {
12
+ const create: Base.Create<modelCard, Card>;
13
+ const addSender: (sender: (backup: Card) => any | Promise<any>) => (args_0: modelCard, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: Record<string, never> | undefined) => ReturnType<(backup: Card) => any | Promise<any>>;
14
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Card = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var Card;
7
+ (function (Card) {
8
+ Card.create = (value, action) => ({
9
+ realm: value.realm,
10
+ entityType: "card",
11
+ entity: value.id,
12
+ organization: value.organization,
13
+ account: value.account,
14
+ action,
15
+ created: isoly_1.isoly.DateTime.now(),
16
+ value,
17
+ });
18
+ Card.addSender = Base_1.Base.pipeToSender(Card.create);
19
+ })(Card || (exports.Card = Card = {}));
20
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../Backup/Card.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAG7B,iCAA6B;AAS7B,IAAiB,IAAI,CAYpB;AAZD,WAAiB,IAAI;IACP,WAAM,GAAiC,CAAC,KAAgB,EAAE,MAAmB,EAAE,EAAE,CAAC,CAAC;QAC/F,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,KAAK,CAAC,EAAE;QAChB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM;QACN,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,KAAK;KACL,CAAC,CAAA;IACW,cAAS,GAAG,WAAI,CAAC,YAAY,CAAC,KAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAZgB,IAAI,oBAAJ,IAAI,QAYpB"}
@@ -0,0 +1,15 @@
1
+ import { Operation as modelOperation } from "../Operation";
2
+ import { Base } from "./Base";
3
+ export interface Operation extends Base<modelOperation> {
4
+ entityType: "operation";
5
+ entity: string;
6
+ account: string;
7
+ }
8
+ export declare namespace Operation {
9
+ const create: Base.Create<modelOperation, Operation, {
10
+ organization: string;
11
+ }>;
12
+ const addSender: (sender: (backup: Operation) => any | Promise<any>) => (args_0: modelOperation, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: {
13
+ organization: string;
14
+ } | undefined) => ReturnType<(backup: Operation) => any | Promise<any>>;
15
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Operation = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var Operation;
7
+ (function (Operation) {
8
+ Operation.create = (value, action, data) => ({
9
+ entityType: "operation",
10
+ entity: value.signature ?? "",
11
+ ...data,
12
+ account: value.account,
13
+ action,
14
+ created: isoly_1.isoly.DateTime.now(),
15
+ value,
16
+ });
17
+ Operation.addSender = Base_1.Base.pipeToSender(Operation.create);
18
+ })(Operation || (exports.Operation = Operation = {}));
19
+ //# sourceMappingURL=Operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../../Backup/Operation.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,iCAA6B;AAO7B,IAAiB,SAAS,CAezB;AAfD,WAAiB,SAAS;IACZ,gBAAM,GAAqE,CACvF,KAAqB,EACrB,MAAmB,EACnB,IAA+B,EAC9B,EAAE,CAAC,CAAC;QACL,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE;QAC7B,GAAG,IAAI;QACP,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM;QACN,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,KAAK;KACL,CAAC,CAAA;IACW,mBAAS,GAAG,WAAI,CAAC,YAAY,CAAC,UAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAfgB,SAAS,yBAAT,SAAS,QAezB"}
@@ -0,0 +1,13 @@
1
+ import { Organization as modelOrganization } from "../Organization";
2
+ import { Realm } from "../Realm";
3
+ import { Base } from "./Base";
4
+ export interface Organization extends Base<modelOrganization> {
5
+ realm: Realm;
6
+ entityType: "organization";
7
+ entity: string;
8
+ organization: string;
9
+ }
10
+ export declare namespace Organization {
11
+ const create: Base.Create<modelOrganization, Organization>;
12
+ const addSender: (sender: (backup: Organization) => any | Promise<any>) => (args_0: modelOrganization, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: Record<string, never> | undefined) => ReturnType<(backup: Organization) => any | Promise<any>>;
13
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Organization = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var Organization;
7
+ (function (Organization) {
8
+ Organization.create = (value, action) => ({
9
+ realm: value.realm,
10
+ entityType: "organization",
11
+ entity: value.code,
12
+ organization: value.code,
13
+ action,
14
+ created: isoly_1.isoly.DateTime.now(),
15
+ value,
16
+ });
17
+ Organization.addSender = Base_1.Base.pipeToSender(Organization.create);
18
+ })(Organization || (exports.Organization = Organization = {}));
19
+ //# sourceMappingURL=Organization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Organization.js","sourceRoot":"","sources":["../../../Backup/Organization.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAG7B,iCAA6B;AAQ7B,IAAiB,YAAY,CAc5B;AAdD,WAAiB,YAAY;IACf,mBAAM,GAAiD,CACnE,KAAwB,EACxB,MAAmB,EAClB,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,UAAU,EAAE,cAAc;QAC1B,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,MAAM;QACN,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,KAAK;KACL,CAAC,CAAA;IACW,sBAAS,GAAG,WAAI,CAAC,YAAY,CAAC,aAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAdgB,YAAY,4BAAZ,YAAY,QAc5B"}
@@ -0,0 +1,17 @@
1
+ import { Rule as modelRule } from "../Rule";
2
+ import { Base } from "./Base";
3
+ export interface Rule extends Base<modelRule> {
4
+ entityType: "rule";
5
+ entity: string;
6
+ meta: string;
7
+ }
8
+ export declare namespace Rule {
9
+ const create: Base.Create<modelRule, Rule, {
10
+ organization?: string;
11
+ account?: string;
12
+ }>;
13
+ const addSender: (sender: (backup: Rule) => any | Promise<any>) => (args_0: modelRule, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: {
14
+ organization?: string;
15
+ account?: string;
16
+ } | undefined) => ReturnType<(backup: Rule) => any | Promise<any>>;
17
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Rule = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var Rule;
7
+ (function (Rule) {
8
+ Rule.create = (value, action, data) => ({
9
+ entityType: "rule",
10
+ entity: value.code,
11
+ ...data,
12
+ action,
13
+ created: isoly_1.isoly.DateTime.now(),
14
+ meta: `${value.category}.${value.type}.${value.action}`,
15
+ value,
16
+ });
17
+ Rule.addSender = Base_1.Base.pipeToSender(Rule.create);
18
+ })(Rule || (exports.Rule = Rule = {}));
19
+ //# sourceMappingURL=Rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../Backup/Rule.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,iCAA6B;AAO7B,IAAiB,IAAI,CAepB;AAfD,WAAiB,IAAI;IACP,WAAM,GAA8E,CAChG,KAAgB,EAChB,MAAmB,EACnB,IAAkD,EACjD,EAAE,CAAC,CAAC;QACL,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,GAAG,IAAI;QACP,MAAM;QACN,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;QACvD,KAAK;KACL,CAAC,CAAA;IACW,cAAS,GAAG,WAAI,CAAC,YAAY,CAAC,KAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAfgB,IAAI,oBAAJ,IAAI,QAepB"}
@@ -0,0 +1,25 @@
1
+ import { Transaction as modelTransaction } from "../Transaction";
2
+ import { Base } from "./Base";
3
+ export interface Transaction extends Base<modelTransaction & {
4
+ state?: any;
5
+ }> {
6
+ entityType: "transaction";
7
+ entity: string;
8
+ organization: string;
9
+ account: string;
10
+ isError?: true;
11
+ }
12
+ export declare namespace Transaction {
13
+ const create: Base.Create<modelTransaction & {
14
+ state?: any;
15
+ }, Transaction, {
16
+ isError?: true;
17
+ meta?: any;
18
+ }>;
19
+ const addSender: (sender: (backup: Transaction) => any | Promise<any>) => (args_0: modelTransaction & {
20
+ state?: any;
21
+ }, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: {
22
+ isError?: true;
23
+ meta?: any;
24
+ } | undefined) => ReturnType<(backup: Transaction) => any | Promise<any>>;
25
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Transaction = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var Transaction;
7
+ (function (Transaction) {
8
+ Transaction.create = (value, action, data) => ({
9
+ entityType: "transaction",
10
+ entity: value.id,
11
+ organization: value.organization,
12
+ account: value.accountId,
13
+ action,
14
+ ...data,
15
+ created: isoly_1.isoly.DateTime.now(),
16
+ value,
17
+ });
18
+ Transaction.addSender = Base_1.Base.pipeToSender(Transaction.create);
19
+ })(Transaction || (exports.Transaction = Transaction = {}));
20
+ //# sourceMappingURL=Transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../Backup/Transaction.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,iCAA6B;AAS7B,IAAiB,WAAW,CAgB3B;AAhBD,WAAiB,WAAW;IACd,kBAAM,GAAiG,CACnH,KAAyC,EACzC,MAAmB,EACnB,IAAqC,EACpC,EAAE,CAAC,CAAC;QACL,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,KAAK,CAAC,EAAE;QAChB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,OAAO,EAAE,KAAK,CAAC,SAAS;QACxB,MAAM;QACN,GAAG,IAAI;QACP,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,KAAK;KACL,CAAC,CAAA;IACW,qBAAS,GAAG,WAAI,CAAC,YAAY,CAAC,YAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAhBgB,WAAW,2BAAX,WAAW,QAgB3B"}
@@ -0,0 +1,15 @@
1
+ import { userwidgets } from "@userwidgets/model";
2
+ import { Realm } from "../Realm";
3
+ import { Base } from "./Base";
4
+ export type User = Base<userwidgets.User> & {
5
+ entityType: "user";
6
+ entity: string;
7
+ };
8
+ export declare namespace User {
9
+ const create: Base.Create<userwidgets.User, User, {
10
+ realm: Realm;
11
+ }>;
12
+ const addSender: (sender: (backup: User) => any | Promise<any>) => (args_0: userwidgets.User, args_1: "created" | "cancelled" | "updated" | "removed", args_2?: {
13
+ realm: Realm;
14
+ } | undefined) => ReturnType<(backup: User) => any | Promise<any>>;
15
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.User = void 0;
4
+ const isoly_1 = require("isoly");
5
+ const Base_1 = require("./Base");
6
+ var User;
7
+ (function (User) {
8
+ User.create = (value, action, data) => ({
9
+ ...data,
10
+ entityType: "user",
11
+ entity: value.email,
12
+ action,
13
+ created: isoly_1.isoly.DateTime.now(),
14
+ value,
15
+ });
16
+ User.addSender = Base_1.Base.pipeToSender(User.create);
17
+ })(User || (exports.User = User = {}));
18
+ //# sourceMappingURL=User.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../Backup/User.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAG7B,iCAA6B;AAO7B,IAAiB,IAAI,CAcpB;AAdD,WAAiB,IAAI;IACP,WAAM,GAA0D,CAC5E,KAAuB,EACvB,MAAmB,EACnB,IAAuB,EACtB,EAAE,CAAC,CAAC;QACL,GAAG,IAAI;QACP,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,KAAK,CAAC,KAAK;QACnB,MAAM;QACN,OAAO,EAAE,aAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC7B,KAAK;KACL,CAAC,CAAA;IACW,cAAS,GAAG,WAAI,CAAC,YAAY,CAAC,KAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAdgB,IAAI,oBAAJ,IAAI,QAcpB"}
@@ -0,0 +1,26 @@
1
+ import { Realm } from "../Realm";
2
+ import { Account as AccountBackup } from "./Account";
3
+ import { Base as BaseBackup } from "./Base";
4
+ import { Card as CardBackup } from "./Card";
5
+ import { Operation as OperationBackup } from "./Operation";
6
+ import { Organization as OrganizationBackup } from "./Organization";
7
+ import { Rule as RuleBackup } from "./Rule";
8
+ import { Transaction as TransactionBackup } from "./Transaction";
9
+ import { User as UserBackup } from "./User";
10
+ export type Backup = Backup.Partial & Backup.Identifier;
11
+ export declare namespace Backup {
12
+ type Identifier = {
13
+ realm: Realm;
14
+ version: string;
15
+ source: string;
16
+ };
17
+ type Partial = TransactionBackup | OperationBackup | OrganizationBackup | RuleBackup | AccountBackup | CardBackup | UserBackup;
18
+ export import Base = BaseBackup;
19
+ export import Transaction = TransactionBackup;
20
+ export import Account = AccountBackup;
21
+ export import Organization = OrganizationBackup;
22
+ export import Rule = RuleBackup;
23
+ export import Operation = OperationBackup;
24
+ export import User = UserBackup;
25
+ export import Card = CardBackup;
26
+ }