@pax2pay/model-banking 0.1.358 → 0.1.359

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 (71) hide show
  1. package/Analytics/Configuration/AuditLog.ts +0 -2
  2. package/Analytics/Configuration/Base.ts +6 -11
  3. package/Analytics/Configuration/Ledger/Base.ts +28 -0
  4. package/Analytics/Configuration/Ledger/index.ts +5 -0
  5. package/Analytics/Configuration/Transaction.ts +43 -20
  6. package/Analytics/Configuration/index.ts +6 -3
  7. package/Analytics/Event/AuditLog.ts +3 -2
  8. package/Analytics/Event/Base.ts +4 -1
  9. package/Analytics/Event/Ledger/Account.ts +24 -0
  10. package/Analytics/Event/Ledger/Base.ts +7 -0
  11. package/Analytics/Event/Ledger/Operation.ts +29 -0
  12. package/Analytics/Event/Ledger/Organization.ts +21 -0
  13. package/Analytics/Event/Ledger/Rule.ts +39 -0
  14. package/Analytics/Event/{Transaction.ts → Ledger/Transaction.ts} +6 -5
  15. package/Analytics/Event/Ledger/index.ts +15 -0
  16. package/Analytics/Event/index.ts +10 -5
  17. package/dist/Analytics/Configuration/AuditLog.d.ts +0 -1
  18. package/dist/Analytics/Configuration/AuditLog.js +0 -2
  19. package/dist/Analytics/Configuration/AuditLog.js.map +1 -1
  20. package/dist/Analytics/Configuration/Base.d.ts +4 -2
  21. package/dist/Analytics/Configuration/Base.js +4 -4
  22. package/dist/Analytics/Configuration/Base.js.map +1 -1
  23. package/dist/Analytics/Configuration/Ledger/Base.d.ts +30 -0
  24. package/dist/Analytics/Configuration/Ledger/Base.js +22 -0
  25. package/dist/Analytics/Configuration/Ledger/Base.js.map +1 -0
  26. package/dist/Analytics/Configuration/Ledger/index.d.ts +4 -0
  27. package/dist/Analytics/Configuration/Ledger/index.js +6 -0
  28. package/dist/Analytics/Configuration/Ledger/index.js.map +1 -0
  29. package/dist/Analytics/Configuration/Transaction.d.ts +41 -10
  30. package/dist/Analytics/Configuration/Transaction.js +38 -18
  31. package/dist/Analytics/Configuration/Transaction.js.map +1 -1
  32. package/dist/Analytics/Configuration/index.d.ts +6 -3
  33. package/dist/Analytics/Configuration/index.js +3 -3
  34. package/dist/Analytics/Configuration/index.js.map +1 -1
  35. package/dist/Analytics/Event/AuditLog.d.ts +1 -4
  36. package/dist/Analytics/Event/AuditLog.js +2 -1
  37. package/dist/Analytics/Event/AuditLog.js.map +1 -1
  38. package/dist/Analytics/Event/Base.d.ts +4 -4
  39. package/dist/Analytics/Event/Ledger/Account.d.ts +13 -0
  40. package/dist/Analytics/Event/Ledger/Account.js +18 -0
  41. package/dist/Analytics/Event/Ledger/Account.js.map +1 -0
  42. package/dist/Analytics/Event/Ledger/Base.d.ts +6 -0
  43. package/dist/Analytics/Event/Ledger/Base.js +2 -0
  44. package/dist/Analytics/Event/Ledger/Base.js.map +1 -0
  45. package/dist/Analytics/Event/Ledger/Operation.d.ts +10 -0
  46. package/dist/Analytics/Event/{Operation.js → Ledger/Operation.js} +5 -2
  47. package/dist/Analytics/Event/Ledger/Operation.js.map +1 -0
  48. package/dist/Analytics/Event/Ledger/Organization.d.ts +10 -0
  49. package/dist/Analytics/Event/Ledger/Organization.js +16 -0
  50. package/dist/Analytics/Event/Ledger/Organization.js.map +1 -0
  51. package/dist/Analytics/Event/Ledger/Rule.d.ts +15 -0
  52. package/dist/Analytics/Event/Ledger/Rule.js +23 -0
  53. package/dist/Analytics/Event/Ledger/Rule.js.map +1 -0
  54. package/dist/Analytics/Event/{Transaction.d.ts → Ledger/Transaction.d.ts} +5 -8
  55. package/dist/Analytics/Event/{Transaction.js → Ledger/Transaction.js} +2 -1
  56. package/dist/Analytics/Event/Ledger/Transaction.js.map +1 -0
  57. package/dist/Analytics/Event/Ledger/index.d.ts +14 -0
  58. package/dist/Analytics/Event/Ledger/index.js +14 -0
  59. package/dist/Analytics/Event/Ledger/index.js.map +1 -0
  60. package/dist/Analytics/Event/index.d.ts +3 -5
  61. package/dist/Analytics/Event/index.js +2 -4
  62. package/dist/Analytics/Event/index.js.map +1 -1
  63. package/package.json +4 -4
  64. package/Analytics/Configuration/Operation.ts +0 -36
  65. package/Analytics/Event/Operation.ts +0 -20
  66. package/dist/Analytics/Configuration/Operation.d.ts +0 -22
  67. package/dist/Analytics/Configuration/Operation.js +0 -34
  68. package/dist/Analytics/Configuration/Operation.js.map +0 -1
  69. package/dist/Analytics/Event/Operation.d.ts +0 -13
  70. package/dist/Analytics/Event/Operation.js.map +0 -1
  71. package/dist/Analytics/Event/Transaction.js.map +0 -1
@@ -4,7 +4,6 @@ import { Audit } from "../../Audit"
4
4
  export namespace AuditLog {
5
5
  type Selectors = `value.${Exclude<keyof Audit, "resource"> | `resource.${keyof Audit["resource"]}`}`
6
6
  export const mapping = {
7
- auditId: "value.id",
8
7
  auditCreated: "value.created",
9
8
  resourceId: "value.resource.id",
10
9
  resourceType: "value.resource.type",
@@ -17,7 +16,6 @@ export namespace AuditLog {
17
16
  } as const satisfies filter.Mapping.RecordWithSelector<Selectors>;
18
17
  export type Fields = keyof typeof mapping
19
18
  export const schema: listener.BigQueryApi.BaseField<Fields>[] = [
20
- { name: "auditId", type: "STRING" },
21
19
  { name: "auditCreated", type: "TIMESTAMP" },
22
20
  { name: "resourceId", type: "STRING" },
23
21
  { name: "resourceType", type: "STRING" },
@@ -1,19 +1,14 @@
1
1
  import { filter, listener } from "cloudly-analytics-common"
2
+ import { Event } from "../Event"
2
3
 
3
4
  export namespace Base {
4
- type Selectors =
5
- | "realm"
6
- | "entity.type"
7
- | "entity.id"
8
- | "action"
9
- | "created"
10
- | "isError"
5
+ export type Selectors = keyof Required<Omit<Event.Base<any>, "value">>
11
6
  | "version"
12
7
  | "source"
13
8
  export const mapping = {
14
9
  realm: "realm",
15
- entity: "entity.type",
16
- entityId: "entity.id",
10
+ entityType: "entityType",
11
+ entity: "entity",
17
12
  action: "action",
18
13
  created: "created",
19
14
  isError: { selector: "isError", transform: "boolean" },
@@ -25,10 +20,10 @@ export namespace Base {
25
20
  export const schema: listener.BigQueryApi.BaseField<Fields>[] = [
26
21
  { name: "realm", type: "STRING" },
27
22
  { name: "entity", type: "STRING" },
28
- { name: "entityId", type: "STRING" },
23
+ { name: "entityType", type: "STRING" },
29
24
  { name: "action", type: "STRING" },
30
25
  { name: "created", type: "TIMESTAMP" },
31
- { name: "isError", type: "BOOLEAN" },
26
+ { name: "isError", type: "BOOLEAN", mode: "NULLABLE" },
32
27
  { name: "source", type: "STRING" },
33
28
  { name: "version", type: "STRING" },
34
29
  ]
@@ -0,0 +1,28 @@
1
+ import { filter, listener } from "cloudly-analytics-common"
2
+ import { Event } from "../../Event"
3
+ import { Base as ConfigBase } from "../Base"
4
+
5
+ export namespace Base {
6
+ export type Selectors = keyof Required<Event.Ledger.Base<any>>
7
+ | "version"
8
+ | "source"
9
+ export const mapping = {
10
+ ...ConfigBase.mapping,
11
+ organization: "organization",
12
+ account: "account",
13
+ meta: { selector: "meta", transform: "array" },
14
+ value: { selector: "value", transform: "stringify" }
15
+ // eslint-disable-next-line
16
+ } as const satisfies filter.Mapping.RecordWithSelector<Selectors>;
17
+ export type Fields = keyof typeof mapping
18
+ export const schema: listener.BigQueryApi.BaseField<Fields>[] = [
19
+ ...ConfigBase.schema,
20
+ { name: "organization", type: "STRING", mode: "NULLABLE" },
21
+ { name: "account", type: "STRING", mode: "NULLABLE" },
22
+ { name: "meta", type: "RECORD", mode: "REPEATED", fields: [
23
+ { name: "key", type: "STRING" },
24
+ { name: "value", type: "STRING" },
25
+ ]},
26
+ { name: "value", type: "STRING" }
27
+ ]
28
+ }
@@ -0,0 +1,5 @@
1
+ import { Base as ConfigBase } from "./Base"
2
+
3
+ export namespace Ledger {
4
+ export import Base = ConfigBase
5
+ }
@@ -1,17 +1,22 @@
1
1
  import { filter, listener } from "cloudly-analytics-common"
2
+ import { Transaction as ModelTransaction } from "../../Transaction"
3
+ import type { FlattenKeys } from "."
4
+ import { Base } from "./Base"
2
5
 
3
6
  export namespace Transaction {
7
+ type Selectors = Base.Selectors | `value.${FlattenKeys<Required<ModelTransaction>>}${"[*]" | ""}`
4
8
  export const mapping = {
9
+ ...Base.mapping,
5
10
  counterpartType: "value.counterpart.type",
6
11
  counterpart: { selector: "value.counterpart", transform: "stringify" },
7
12
  counterpartCode: "value.counterpart.code",
8
13
  currency: "value.currency",
9
- amount: { selector: "value.amount", transform: "number" },
14
+ amount: { selector: "value.amount", transform: "string" },
10
15
  description: "value.description",
11
16
  organization: "value.organization",
12
- accountId: "value.accountId",
17
+ account: "value.accountId",
13
18
  accountName: "value.accountName",
14
- account: { selector: "value.account", transform: "stringify" },
19
+ accountAddress: { selector: "value.account", transform: "stringify" },
15
20
  accountType: "value.account.type",
16
21
  type: "value.type",
17
22
  direction: "value.direction",
@@ -23,32 +28,50 @@ export namespace Transaction {
23
28
  posted: "value.posted",
24
29
  transacted: "value.transacted",
25
30
  by: "value.by",
26
- actualBalance: { selector: "value.balance.actual", transform: "number" },
27
- reservedBalance: { selector: "value.balance.reserved", transform: "number" },
28
- availableBalance: { selector: "value.balance.available", transform: "number" },
31
+ fee: { selector: "value.fee", transform: "string" },
32
+ actualBalance: { selector: "value.balance.actual", transform: "string" },
33
+ reservedBalance: { selector: "value.balance.reserved", transform: "string" },
34
+ availableBalance: { selector: "value.balance.available", transform: "string" },
29
35
  operations: { selector: "value.operations[*]", transform: {
30
36
  account: "account",
31
37
  currency: "currency",
32
- changes: { selector: "changes", transform: "array" },
38
+ changes: {
39
+ selector: "changes",
40
+ transform: [
41
+ "array",
42
+ {
43
+ key: "key",
44
+ value: {
45
+ selector: "value",
46
+ transform: {
47
+ type: "type",
48
+ amount: { selector: "amount", transform: "string" },
49
+ status: "status",
50
+ result: { selector: "result", transform: "string" }
51
+ }
52
+ }
53
+ }
54
+ ]
55
+ },
33
56
  type: "type",
34
57
  transaction: "transaction",
35
- counter: { selector: "counter", transform: "integer"},
58
+ counter: { selector: "counter", transform: "string" },
36
59
  created: "created",
37
60
  signature: "signature",
38
61
  previous: "previous",
39
62
  }},
40
63
  status: "value.status",
41
64
  rail: "value.rail",
42
- railType: "value.rail.type",
43
65
  flags: "value.flags",
44
66
  oldFlags: "value.oldFlags",
45
67
  notes: { selector: "value.notes", transform: "stringify" },
46
- risk: { selector: "value.risk", transform: "number" },
68
+ risk: { selector: "value.risk", transform: "string" },
47
69
  state: { selector: "value.state", transform: "stringify" },
48
70
  // eslint-disable-next-line
49
- } as const satisfies filter.Mapping.RecordWithSelector<string>;
71
+ } as const satisfies filter.Mapping.RecordWithSelector<Selectors>;
50
72
  export type Fields = keyof typeof mapping
51
73
  export const schema: listener.BigQueryApi.BaseField<Fields>[] = [
74
+ ...Base.schema,
52
75
  { name: "counterpartType", type: "STRING" },
53
76
  { name: "counterpart", type: "STRING" },
54
77
  { name: "counterpartCode", type: "STRING", mode: "NULLABLE" },
@@ -56,9 +79,9 @@ export namespace Transaction {
56
79
  { name: "amount", type: "NUMERIC" },
57
80
  { name: "description", type: "STRING" },
58
81
  { name: "organization", type: "STRING" },
59
- { name: "accountId", type: "STRING" },
60
- { name: "accountName", type: "STRING", mode: "NULLABLE" },
61
82
  { name: "account", type: "STRING" },
83
+ { name: "accountName", type: "STRING", mode: "NULLABLE" },
84
+ { name: "accountAddress", type: "STRING" },
62
85
  { name: "accountType", type: "STRING" },
63
86
  { name: "type", type: "STRING", mode: "NULLABLE" },
64
87
  { name: "direction", type: "STRING", mode: "NULLABLE" },
@@ -67,9 +90,10 @@ export namespace Transaction {
67
90
  { name: "referenceReference", type: "STRING", mode: "NULLABLE" },
68
91
  { name: "referenceReturnId", type: "STRING", mode: "NULLABLE" },
69
92
  { name: "referenceEndToEndId", type: "STRING", mode: "NULLABLE" },
70
- { name: "posted", type: "DATETIME" },
71
- { name: "transacted", type: "DATETIME", mode: "NULLABLE" },
93
+ { name: "posted", type: "TIMESTAMP" },
94
+ { name: "transacted", type: "TIMESTAMP", mode: "NULLABLE" },
72
95
  { name: "by", type: "STRING", mode: "NULLABLE" },
96
+ { name: "fee", type: "NUMERIC", mode: "NULLABLE" },
73
97
  { name: "actualBalance", type: "NUMERIC" },
74
98
  { name: "reservedBalance", type: "NUMERIC" },
75
99
  { name: "availableBalance", type: "NUMERIC" },
@@ -82,23 +106,22 @@ export namespace Transaction {
82
106
  { name: "type", type: "STRING" },
83
107
  { name: "amount", type: "NUMERIC" },
84
108
  { name: "status", type: "STRING" },
85
- { name: "result", type: "STRING", mode: "NULLABLE" },
109
+ { name: "result", type: "NUMERIC", mode: "NULLABLE" },
86
110
  ]}
87
111
  ] },
88
112
  { name: "type", type: "STRING" },
89
113
  { name: "transaction", type: "STRING" },
90
114
  { name: "counter", type: "NUMERIC" },
91
- { name: "created", type: "DATETIME" },
115
+ { name: "created", type: "TIMESTAMP" },
92
116
  { name: "signature", type: "STRING" },
93
117
  { name: "previous", type: "STRING" },
94
- ]
118
+ ]
95
119
  },
96
120
  { name: "status", type: "STRING" },
97
121
  { name: "rail", type: "STRING", mode: "NULLABLE" },
98
- { name: "railType", type: "STRING" },
99
122
  { name: "flags", type: "STRING", mode: "REPEATED" },
100
123
  { name: "oldFlags", type: "STRING", mode: "REPEATED" },
101
- { name: "notes", type: "STRING", mode: "REPEATED" },
124
+ { name: "notes", type: "STRING" },
102
125
  { name: "risk", type: "NUMERIC", mode: "NULLABLE" },
103
126
  { name: "state", type: "STRING", mode: "NULLABLE" },
104
127
  ]
@@ -1,11 +1,14 @@
1
1
  import { AuditLog as ConfigAuditLog } from "./AuditLog"
2
2
  import { Base as ConfigBase } from "./Base"
3
- import { Operation as ConfigOperation } from "./Operation"
3
+ import { Ledger as ConfigLedger } from "./Ledger"
4
4
  import { Transaction as ConfigTransaction } from "./Transaction"
5
5
 
6
6
  export namespace Configuration {
7
7
  export import Base = ConfigBase
8
- export import Transaction = ConfigTransaction
9
- export import Operation = ConfigOperation
8
+ export import Ledger = ConfigLedger
10
9
  export import AuditLog = ConfigAuditLog
10
+ export import Transaction = ConfigTransaction
11
11
  }
12
+ export type FlattenKeys<T extends Record<string, unknown>> = {
13
+ [K in Extract<keyof T, string>]: T[K] extends Record<string, unknown> ? K | `${K}.${Extract<keyof T[K], string>}` : K
14
+ }[Extract<keyof T, string>]
@@ -4,14 +4,15 @@ import { Realm } from "../../Realm"
4
4
  import { Base } from "./Base"
5
5
 
6
6
  export type AuditLog = Base<Audit> & {
7
- entity: { type: "auditLog"; id: string }
7
+ entityType: "auditLog"
8
8
  action: "created"
9
9
  }
10
10
  export namespace AuditLog {
11
11
  export function create(value: Audit, realm: Realm, action: AuditLog["action"]): AuditLog {
12
12
  return {
13
13
  realm,
14
- entity: { type: "auditLog", id: value.id },
14
+ entityType: "auditLog",
15
+ entity: value.id,
15
16
  action,
16
17
  created: isoly.DateTime.now(),
17
18
  value,
@@ -3,8 +3,11 @@ import { Realm } from "../../Realm"
3
3
 
4
4
  export type Base<T> = {
5
5
  realm: Realm
6
- entity: { type: string; id: string }
6
+ entity: string
7
+ entityType: string
7
8
  action: string
8
9
  created: isoly.DateTime
10
+ isError?: true
11
+ meta?: Record<string, unknown>
9
12
  value: T
10
13
  }
@@ -0,0 +1,24 @@
1
+ import { isoly } from "isoly"
2
+ import { Account as modelAccount } from "../../../Account"
3
+ import { Realm } from "../../../Realm"
4
+ import { Base } from "./Base"
5
+
6
+ export interface Account extends Base<modelAccount> {
7
+ entityType: "account"
8
+ action: "created" | "updated"
9
+ meta: { accountKey: string }
10
+ }
11
+ export namespace Account {
12
+ export function create(value: modelAccount, organization: string, realm: Realm, action: Account["action"]): Account {
13
+ return {
14
+ realm,
15
+ entity: value.id,
16
+ entityType: "account",
17
+ organization,
18
+ action,
19
+ created: isoly.DateTime.now(),
20
+ meta: { accountKey: value.key ?? "" },
21
+ value,
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,7 @@
1
+ import { Base as EventBase } from "../Base"
2
+
3
+ export interface Base<T> extends EventBase<T> {
4
+ organization?: string
5
+ account?: string
6
+ meta?: Record<string, string>
7
+ }
@@ -0,0 +1,29 @@
1
+ import { isoly } from "isoly"
2
+ import { Operation as modelOperation } from "../../../Operation"
3
+ import { Realm } from "../../../Realm"
4
+ import { Base } from "./Base"
5
+
6
+ export interface Operation extends Base<modelOperation> {
7
+ entityType: "operation"
8
+ action: "created"
9
+ }
10
+ export namespace Operation {
11
+ export function create(
12
+ value: modelOperation,
13
+ realm: Realm,
14
+ action: Operation["action"],
15
+ organization?: string,
16
+ account?: string
17
+ ): Operation {
18
+ return {
19
+ realm,
20
+ entityType: "operation",
21
+ entity: value.signature ?? "",
22
+ organization,
23
+ account,
24
+ action,
25
+ created: isoly.DateTime.now(),
26
+ value,
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,21 @@
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
+ entityType: "organization"
8
+ action: "created" | "updated"
9
+ }
10
+ export namespace Organization {
11
+ export function create(value: modelOrganization, realm: Realm, action: Organization["action"]): Organization {
12
+ return {
13
+ realm,
14
+ entityType: "organization",
15
+ entity: value.code,
16
+ action,
17
+ created: isoly.DateTime.now(),
18
+ value,
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,39 @@
1
+ import { isoly } from "isoly"
2
+ import { Realm } from "../../../Realm"
3
+ import { Rule as modelRule } from "../../../Rule"
4
+ import { Base } from "./Base"
5
+
6
+ export interface Rule extends Base<modelRule> {
7
+ entityType: "rule"
8
+ action: "created" | "updated" | "removed"
9
+ meta: {
10
+ ruleType: modelRule.Kind
11
+ ruleCategory: modelRule.Category
12
+ ruleAction: modelRule.Action
13
+ }
14
+ }
15
+ export namespace Rule {
16
+ export function create(
17
+ value: modelRule,
18
+ realm: Realm,
19
+ action: Rule["action"],
20
+ organization?: string,
21
+ account?: string
22
+ ): Rule {
23
+ return {
24
+ realm,
25
+ entityType: "rule",
26
+ entity: value.code,
27
+ organization,
28
+ account,
29
+ action,
30
+ created: isoly.DateTime.now(),
31
+ meta: {
32
+ ruleType: value.type,
33
+ ruleCategory: value.category,
34
+ ruleAction: value.action,
35
+ },
36
+ value,
37
+ }
38
+ }
39
+ }
@@ -1,10 +1,10 @@
1
1
  import { isoly } from "isoly"
2
- import { Realm } from "../../Realm"
3
- import { Transaction as modelTransaction } from "../../Transaction"
2
+ import { Realm } from "../../../Realm"
3
+ import { Transaction as modelTransaction } from "../../../Transaction"
4
4
  import { Base } from "./Base"
5
5
 
6
- export type Transaction = Base<modelTransaction> & {
7
- entity: { type: "transaction"; id: string }
6
+ export interface Transaction extends Base<modelTransaction> {
7
+ entityType: "transaction"
8
8
  action: "created" | "finalized" | "cancelled" | "failed"
9
9
  isError?: true
10
10
  }
@@ -12,7 +12,8 @@ export namespace Transaction {
12
12
  export function create(value: modelTransaction, realm: Realm, action: Transaction["action"]): Transaction {
13
13
  return {
14
14
  realm,
15
- entity: { type: "transaction", id: value.id },
15
+ entityType: "transaction",
16
+ entity: value.id,
16
17
  action,
17
18
  ...(action == "failed" ? { isError: true } : {}),
18
19
  created: isoly.DateTime.now(),
@@ -0,0 +1,15 @@
1
+ import { Account as AccountEvent } from "./Account"
2
+ import { Base as EventBase } from "./Base"
3
+ import { Operation as OperationEvent } from "./Operation"
4
+ import { Organization as OrganizationEvent } from "./Organization"
5
+ import { Rule as RuleEvent } from "./Rule"
6
+ import { Transaction as TransactionEvent } from "./Transaction"
7
+
8
+ export namespace Ledger {
9
+ export type Base<T> = EventBase<T>
10
+ export import Transaction = TransactionEvent
11
+ export import Account = AccountEvent
12
+ export import Organization = OrganizationEvent
13
+ export import Rule = RuleEvent
14
+ export import Operation = OperationEvent
15
+ }
@@ -1,12 +1,17 @@
1
1
  import { AuditLog as AuditLogEvent } from "./AuditLog"
2
2
  import { Base as EventBase } from "./Base"
3
- import { Operation as OperationEvent } from "./Operation"
4
- import { Transaction as TransactionEvent } from "./Transaction"
3
+ import { Ledger as EventLedger } from "./Ledger"
5
4
 
6
- export type Event = (Event.Transaction | Event.Operation | Event.AuditLog) & { version: string }
5
+ export type Event = (
6
+ | Event.Ledger.Transaction
7
+ | Event.Ledger.Operation
8
+ | Event.Ledger.Organization
9
+ | Event.Ledger.Rule
10
+ | Event.Ledger.Account
11
+ | Event.AuditLog
12
+ ) & { version: string }
7
13
  export namespace Event {
8
14
  export type Base<T> = EventBase<T>
9
- export import Transaction = TransactionEvent
10
- export import Operation = OperationEvent
15
+ export import Ledger = EventLedger
11
16
  export import AuditLog = AuditLogEvent
12
17
  }
@@ -1,7 +1,6 @@
1
1
  import { listener } from "cloudly-analytics-common";
2
2
  export declare namespace AuditLog {
3
3
  const mapping: {
4
- readonly auditId: "value.id";
5
4
  readonly auditCreated: "value.created";
6
5
  readonly resourceId: "value.resource.id";
7
6
  readonly resourceType: "value.resource.type";
@@ -1,7 +1,6 @@
1
1
  export var AuditLog;
2
2
  (function (AuditLog) {
3
3
  AuditLog.mapping = {
4
- auditId: "value.id",
5
4
  auditCreated: "value.created",
6
5
  resourceId: "value.resource.id",
7
6
  resourceType: "value.resource.type",
@@ -12,7 +11,6 @@ export var AuditLog;
12
11
  messages: "value.messages"
13
12
  };
14
13
  AuditLog.schema = [
15
- { name: "auditId", type: "STRING" },
16
14
  { name: "auditCreated", type: "TIMESTAMP" },
17
15
  { name: "resourceId", type: "STRING" },
18
16
  { name: "resourceType", type: "STRING" },
@@ -1 +1 @@
1
- {"version":3,"file":"AuditLog.js","sourceRoot":"../","sources":["Analytics/Configuration/AuditLog.ts"],"names":[],"mappings":"AAGA,MAAM,KAAW,QAAQ,CA0BxB;AA1BD,WAAiB,QAAQ;IAEX,gBAAO,GAAG;QACtB,OAAO,EAAE,UAAU;QACnB,YAAY,EAAE,eAAe;QAC7B,UAAU,EAAE,mBAAmB;QAC/B,YAAY,EAAE,qBAAqB;QACnC,cAAc,EAAE,uBAAuB;QACvC,MAAM,EAAE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,SAAS,EAAE,WAAW,EAAE;QACrE,KAAK,EAAE,EAAE,QAAQ,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE;QACnE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,gBAAgB;KAEsC,CAAC;IAErD,eAAM,GAA6C;QAC/D,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;QACnC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE;QAC3C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1C,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;KACtD,CAAA;AACF,CAAC,EA1BgB,QAAQ,KAAR,QAAQ,QA0BxB"}
1
+ {"version":3,"file":"AuditLog.js","sourceRoot":"../","sources":["Analytics/Configuration/AuditLog.ts"],"names":[],"mappings":"AAGA,MAAM,KAAW,QAAQ,CAwBxB;AAxBD,WAAiB,QAAQ;IAEX,gBAAO,GAAG;QACtB,YAAY,EAAE,eAAe;QAC7B,UAAU,EAAE,mBAAmB;QAC/B,YAAY,EAAE,qBAAqB;QACnC,cAAc,EAAE,uBAAuB;QACvC,MAAM,EAAE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,SAAS,EAAE,WAAW,EAAE;QACrE,KAAK,EAAE,EAAE,QAAQ,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE;QACnE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,gBAAgB;KAEsC,CAAC;IAErD,eAAM,GAA6C;QAC/D,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE;QAC3C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1C,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;KACtD,CAAA;AACF,CAAC,EAxBgB,QAAQ,KAAR,QAAQ,QAwBxB"}
@@ -1,9 +1,11 @@
1
1
  import { listener } from "cloudly-analytics-common";
2
+ import { Event } from "../Event";
2
3
  export declare namespace Base {
4
+ type Selectors = keyof Required<Omit<Event.Base<any>, "value">> | "version" | "source";
3
5
  const mapping: {
4
6
  readonly realm: "realm";
5
- readonly entity: "entity.type";
6
- readonly entityId: "entity.id";
7
+ readonly entityType: "entityType";
8
+ readonly entity: "entity";
7
9
  readonly action: "action";
8
10
  readonly created: "created";
9
11
  readonly isError: {
@@ -2,8 +2,8 @@ export var Base;
2
2
  (function (Base) {
3
3
  Base.mapping = {
4
4
  realm: "realm",
5
- entity: "entity.type",
6
- entityId: "entity.id",
5
+ entityType: "entityType",
6
+ entity: "entity",
7
7
  action: "action",
8
8
  created: "created",
9
9
  isError: { selector: "isError", transform: "boolean" },
@@ -13,10 +13,10 @@ export var Base;
13
13
  Base.schema = [
14
14
  { name: "realm", type: "STRING" },
15
15
  { name: "entity", type: "STRING" },
16
- { name: "entityId", type: "STRING" },
16
+ { name: "entityType", type: "STRING" },
17
17
  { name: "action", type: "STRING" },
18
18
  { name: "created", type: "TIMESTAMP" },
19
- { name: "isError", type: "BOOLEAN" },
19
+ { name: "isError", type: "BOOLEAN", mode: "NULLABLE" },
20
20
  { name: "source", type: "STRING" },
21
21
  { name: "version", type: "STRING" },
22
22
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"Base.js","sourceRoot":"../","sources":["Analytics/Configuration/Base.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,IAAI,CAgCpB;AAhCD,WAAiB,IAAI;IAUP,YAAO,GAAG;QACtB,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE;QACtD,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;KAEgD,CAAC;IAErD,WAAM,GAA6C;QAC/D,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;QACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;QACtC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;QACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;KACnC,CAAA;AACF,CAAC,EAhCgB,IAAI,KAAJ,IAAI,QAgCpB"}
1
+ {"version":3,"file":"Base.js","sourceRoot":"../","sources":["Analytics/Configuration/Base.ts"],"names":[],"mappings":"AAGA,MAAM,KAAW,IAAI,CA0BpB;AA1BD,WAAiB,IAAI;IAIP,YAAO,GAAG;QACtB,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,YAAY;QACxB,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE;QACtD,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;KAEgD,CAAC;IAErD,WAAM,GAA6C;QAC/D,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;QACtC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;QACtD,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;KACnC,CAAA;AACF,CAAC,EA1BgB,IAAI,KAAJ,IAAI,QA0BpB"}
@@ -0,0 +1,30 @@
1
+ import { listener } from "cloudly-analytics-common";
2
+ import { Event } from "../../Event";
3
+ export declare namespace Base {
4
+ type Selectors = keyof Required<Event.Ledger.Base<any>> | "version" | "source";
5
+ const mapping: {
6
+ readonly organization: "organization";
7
+ readonly account: "account";
8
+ readonly meta: {
9
+ readonly selector: "meta";
10
+ readonly transform: "array";
11
+ };
12
+ readonly value: {
13
+ readonly selector: "value";
14
+ readonly transform: "stringify";
15
+ };
16
+ readonly realm: "realm";
17
+ readonly entityType: "entityType";
18
+ readonly entity: "entity";
19
+ readonly action: "action";
20
+ readonly created: "created";
21
+ readonly isError: {
22
+ readonly selector: "isError";
23
+ readonly transform: "boolean";
24
+ };
25
+ readonly version: "version";
26
+ readonly source: "source";
27
+ };
28
+ type Fields = keyof typeof mapping;
29
+ const schema: listener.BigQueryApi.BaseField<Fields>[];
30
+ }
@@ -0,0 +1,22 @@
1
+ import { Base as ConfigBase } from "../Base";
2
+ export var Base;
3
+ (function (Base) {
4
+ Base.mapping = {
5
+ ...ConfigBase.mapping,
6
+ organization: "organization",
7
+ account: "account",
8
+ meta: { selector: "meta", transform: "array" },
9
+ value: { selector: "value", transform: "stringify" }
10
+ };
11
+ Base.schema = [
12
+ ...ConfigBase.schema,
13
+ { name: "organization", type: "STRING", mode: "NULLABLE" },
14
+ { name: "account", type: "STRING", mode: "NULLABLE" },
15
+ { name: "meta", type: "RECORD", mode: "REPEATED", fields: [
16
+ { name: "key", type: "STRING" },
17
+ { name: "value", type: "STRING" },
18
+ ] },
19
+ { name: "value", type: "STRING" }
20
+ ];
21
+ })(Base || (Base = {}));
22
+ //# sourceMappingURL=Base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Base.js","sourceRoot":"../","sources":["Analytics/Configuration/Ledger/Base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,SAAS,CAAA;AAE5C,MAAM,KAAW,IAAI,CAuBpB;AAvBD,WAAiB,IAAI;IAIP,YAAO,GAAG;QACtB,GAAG,UAAU,CAAC,OAAO;QACrB,YAAY,EAAE,cAAc;QAC5B,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE;QAC9C,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE;KAEY,CAAC;IAErD,WAAM,GAA6C;QAC/D,GAAG,UAAU,CAAC,MAAM;QACpB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;QAC1D,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;QACrD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE;gBACzD,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC/B,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;aACjC,EAAC;QACF,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;KACjC,CAAA;AACF,CAAC,EAvBgB,IAAI,KAAJ,IAAI,QAuBpB"}
@@ -0,0 +1,4 @@
1
+ import { Base as ConfigBase } from "./Base";
2
+ export declare namespace Ledger {
3
+ export import Base = ConfigBase;
4
+ }
@@ -0,0 +1,6 @@
1
+ import { Base as ConfigBase } from "./Base";
2
+ export var Ledger;
3
+ (function (Ledger) {
4
+ Ledger.Base = ConfigBase;
5
+ })(Ledger || (Ledger = {}));
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Configuration/Ledger/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAA;AAE3C,MAAM,KAAW,MAAM,CAEtB;AAFD,WAAiB,MAAM;IACR,WAAI,GAAG,UAAU,CAAA;AAChC,CAAC,EAFgB,MAAM,KAAN,MAAM,QAEtB"}