@pax2pay/model-banking 0.1.358 → 0.1.360
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/Analytics/Configuration/AuditLog.ts +0 -2
- package/Analytics/Configuration/Base.ts +7 -11
- package/Analytics/Configuration/Ledger/Base.ts +29 -0
- package/Analytics/Configuration/Ledger/index.ts +5 -0
- package/Analytics/Configuration/Transaction.ts +43 -20
- package/Analytics/Configuration/index.ts +6 -3
- package/Analytics/Event/Base.ts +2 -0
- package/Analytics/Event/Ledger/Account.ts +23 -0
- package/Analytics/Event/Ledger/Base.ts +7 -0
- package/Analytics/Event/Ledger/Operation.ts +28 -0
- package/Analytics/Event/Ledger/Organization.ts +20 -0
- package/Analytics/Event/Ledger/Rule.ts +38 -0
- package/Analytics/Event/{Transaction.ts → Ledger/Transaction.ts} +3 -3
- package/Analytics/Event/Ledger/index.ts +15 -0
- package/Analytics/Event/index.ts +10 -5
- package/dist/Analytics/Configuration/AuditLog.d.ts +0 -1
- package/dist/Analytics/Configuration/AuditLog.js +0 -2
- package/dist/Analytics/Configuration/AuditLog.js.map +1 -1
- package/dist/Analytics/Configuration/Base.d.ts +5 -2
- package/dist/Analytics/Configuration/Base.js +4 -4
- package/dist/Analytics/Configuration/Base.js.map +1 -1
- package/dist/Analytics/Configuration/Ledger/Base.d.ts +31 -0
- package/dist/Analytics/Configuration/Ledger/Base.js +22 -0
- package/dist/Analytics/Configuration/Ledger/Base.js.map +1 -0
- package/dist/Analytics/Configuration/Ledger/index.d.ts +4 -0
- package/dist/Analytics/Configuration/Ledger/index.js +6 -0
- package/dist/Analytics/Configuration/Ledger/index.js.map +1 -0
- package/dist/Analytics/Configuration/Transaction.d.ts +41 -10
- package/dist/Analytics/Configuration/Transaction.js +38 -18
- package/dist/Analytics/Configuration/Transaction.js.map +1 -1
- package/dist/Analytics/Configuration/index.d.ts +6 -3
- package/dist/Analytics/Configuration/index.js +3 -3
- package/dist/Analytics/Configuration/index.js.map +1 -1
- package/dist/Analytics/Event/Base.d.ts +2 -0
- package/dist/Analytics/Event/Ledger/Account.d.ts +16 -0
- package/dist/Analytics/Event/Ledger/Account.js +17 -0
- package/dist/Analytics/Event/Ledger/Account.js.map +1 -0
- package/dist/Analytics/Event/Ledger/Base.d.ts +6 -0
- package/dist/Analytics/Event/Ledger/Base.js +2 -0
- package/dist/Analytics/Event/Ledger/Base.js.map +1 -0
- package/dist/Analytics/Event/Ledger/Operation.d.ts +13 -0
- package/dist/Analytics/Event/{Operation.js → Ledger/Operation.js} +3 -1
- package/dist/Analytics/Event/Ledger/Operation.js.map +1 -0
- package/dist/Analytics/Event/Ledger/Organization.d.ts +13 -0
- package/dist/Analytics/Event/Ledger/Organization.js +15 -0
- package/dist/Analytics/Event/Ledger/Organization.js.map +1 -0
- package/dist/Analytics/Event/Ledger/Rule.d.ts +18 -0
- package/dist/Analytics/Event/Ledger/Rule.js +22 -0
- package/dist/Analytics/Event/Ledger/Rule.js.map +1 -0
- package/dist/Analytics/Event/{Transaction.d.ts → Ledger/Transaction.d.ts} +4 -4
- package/dist/Analytics/Event/Ledger/Transaction.js.map +1 -0
- package/dist/Analytics/Event/Ledger/index.d.ts +14 -0
- package/dist/Analytics/Event/Ledger/index.js +14 -0
- package/dist/Analytics/Event/Ledger/index.js.map +1 -0
- package/dist/Analytics/Event/index.d.ts +3 -5
- package/dist/Analytics/Event/index.js +2 -4
- package/dist/Analytics/Event/index.js.map +1 -1
- package/package.json +4 -4
- package/Analytics/Configuration/Operation.ts +0 -36
- package/Analytics/Event/Operation.ts +0 -20
- package/dist/Analytics/Configuration/Operation.d.ts +0 -22
- package/dist/Analytics/Configuration/Operation.js +0 -34
- package/dist/Analytics/Configuration/Operation.js.map +0 -1
- package/dist/Analytics/Event/Operation.d.ts +0 -13
- package/dist/Analytics/Event/Operation.js.map +0 -1
- package/dist/Analytics/Event/Transaction.js.map +0 -1
- /package/dist/Analytics/Event/{Transaction.js → Ledger/Transaction.js} +0 -0
|
@@ -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,15 @@
|
|
|
1
1
|
import { filter, listener } from "cloudly-analytics-common"
|
|
2
|
+
import { Event } from "../Event"
|
|
3
|
+
import type { FlattenKeys } from ".";
|
|
2
4
|
|
|
3
5
|
export namespace Base {
|
|
4
|
-
type Selectors =
|
|
5
|
-
| "realm"
|
|
6
|
-
| "entity.type"
|
|
7
|
-
| "entity.id"
|
|
8
|
-
| "action"
|
|
9
|
-
| "created"
|
|
10
|
-
| "isError"
|
|
6
|
+
export type Selectors = FlattenKeys<Required<Omit<Event.Base<any>, "value">>>
|
|
11
7
|
| "version"
|
|
12
8
|
| "source"
|
|
13
9
|
export const mapping = {
|
|
14
10
|
realm: "realm",
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
entityType: "entity.type",
|
|
12
|
+
entity: "entity.id",
|
|
17
13
|
action: "action",
|
|
18
14
|
created: "created",
|
|
19
15
|
isError: { selector: "isError", transform: "boolean" },
|
|
@@ -25,10 +21,10 @@ export namespace Base {
|
|
|
25
21
|
export const schema: listener.BigQueryApi.BaseField<Fields>[] = [
|
|
26
22
|
{ name: "realm", type: "STRING" },
|
|
27
23
|
{ name: "entity", type: "STRING" },
|
|
28
|
-
{ name: "
|
|
24
|
+
{ name: "entityType", type: "STRING" },
|
|
29
25
|
{ name: "action", type: "STRING" },
|
|
30
26
|
{ name: "created", type: "TIMESTAMP" },
|
|
31
|
-
{ name: "isError", type: "BOOLEAN" },
|
|
27
|
+
{ name: "isError", type: "BOOLEAN", mode: "NULLABLE" },
|
|
32
28
|
{ name: "source", type: "STRING" },
|
|
33
29
|
{ name: "version", type: "STRING" },
|
|
34
30
|
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { filter, listener } from "cloudly-analytics-common"
|
|
2
|
+
import { Event } from "../../Event"
|
|
3
|
+
import { FlattenKeys } from ".."
|
|
4
|
+
import { Base as ConfigBase } from "../Base"
|
|
5
|
+
|
|
6
|
+
export namespace Base {
|
|
7
|
+
export type Selectors = FlattenKeys<Required<Event.Ledger.Base<any>>>
|
|
8
|
+
| "version"
|
|
9
|
+
| "source"
|
|
10
|
+
export const mapping = {
|
|
11
|
+
...ConfigBase.mapping,
|
|
12
|
+
organization: "organization",
|
|
13
|
+
account: "account",
|
|
14
|
+
meta: { selector: "meta", transform: "array" },
|
|
15
|
+
value: { selector: "value", transform: "stringify" }
|
|
16
|
+
// eslint-disable-next-line
|
|
17
|
+
} as const satisfies filter.Mapping.RecordWithSelector<Selectors>;
|
|
18
|
+
export type Fields = keyof typeof mapping
|
|
19
|
+
export const schema: listener.BigQueryApi.BaseField<Fields>[] = [
|
|
20
|
+
...ConfigBase.schema,
|
|
21
|
+
{ name: "organization", type: "STRING", mode: "NULLABLE" },
|
|
22
|
+
{ name: "account", type: "STRING", mode: "NULLABLE" },
|
|
23
|
+
{ name: "meta", type: "RECORD", mode: "REPEATED", fields: [
|
|
24
|
+
{ name: "key", type: "STRING" },
|
|
25
|
+
{ name: "value", type: "STRING" },
|
|
26
|
+
]},
|
|
27
|
+
{ name: "value", type: "STRING" }
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -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: "
|
|
14
|
+
amount: { selector: "value.amount", transform: "string" },
|
|
10
15
|
description: "value.description",
|
|
11
16
|
organization: "value.organization",
|
|
12
|
-
|
|
17
|
+
account: "value.accountId",
|
|
13
18
|
accountName: "value.accountName",
|
|
14
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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: {
|
|
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: "
|
|
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: "
|
|
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<
|
|
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: "
|
|
71
|
-
{ name: "transacted", type: "
|
|
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: "
|
|
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: "
|
|
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"
|
|
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 {
|
|
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
|
|
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>]
|
package/Analytics/Event/Base.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
entity: { type: "account"; id: string }
|
|
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: { type: "account", id: value.id },
|
|
16
|
+
organization,
|
|
17
|
+
action,
|
|
18
|
+
created: isoly.DateTime.now(),
|
|
19
|
+
meta: { accountKey: value.key ?? "" },
|
|
20
|
+
value,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
entity: { type: "operation"; id: string }
|
|
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
|
+
entity: { type: "operation", id: value.signature ?? "" },
|
|
21
|
+
organization,
|
|
22
|
+
account,
|
|
23
|
+
action,
|
|
24
|
+
created: isoly.DateTime.now(),
|
|
25
|
+
value,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
entity: { type: "organization"; id: string }
|
|
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
|
+
entity: { type: "organization", id: value.code },
|
|
15
|
+
action,
|
|
16
|
+
created: isoly.DateTime.now(),
|
|
17
|
+
value,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
entity: { type: "rule"; id: string }
|
|
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
|
+
entity: { type: "rule", id: value.code },
|
|
26
|
+
organization,
|
|
27
|
+
account,
|
|
28
|
+
action,
|
|
29
|
+
created: isoly.DateTime.now(),
|
|
30
|
+
meta: {
|
|
31
|
+
ruleType: value.type,
|
|
32
|
+
ruleCategory: value.category,
|
|
33
|
+
ruleAction: value.action,
|
|
34
|
+
},
|
|
35
|
+
value,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
-
import { Realm } from "
|
|
3
|
-
import { Transaction as modelTransaction } from "
|
|
2
|
+
import { Realm } from "../../../Realm"
|
|
3
|
+
import { Transaction as modelTransaction } from "../../../Transaction"
|
|
4
4
|
import { Base } from "./Base"
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export interface Transaction extends Base<modelTransaction> {
|
|
7
7
|
entity: { type: "transaction"; id: string }
|
|
8
8
|
action: "created" | "finalized" | "cancelled" | "failed"
|
|
9
9
|
isError?: true
|
|
@@ -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
|
+
}
|
package/Analytics/Event/index.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { AuditLog as AuditLogEvent } from "./AuditLog"
|
|
2
2
|
import { Base as EventBase } from "./Base"
|
|
3
|
-
import {
|
|
4
|
-
import { Transaction as TransactionEvent } from "./Transaction"
|
|
3
|
+
import { Ledger as EventLedger } from "./Ledger"
|
|
5
4
|
|
|
6
|
-
export type Event = (
|
|
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
|
|
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,
|
|
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,12 @@
|
|
|
1
1
|
import { listener } from "cloudly-analytics-common";
|
|
2
|
+
import { Event } from "../Event";
|
|
3
|
+
import type { FlattenKeys } from ".";
|
|
2
4
|
export declare namespace Base {
|
|
5
|
+
type Selectors = FlattenKeys<Required<Omit<Event.Base<any>, "value">>> | "version" | "source";
|
|
3
6
|
const mapping: {
|
|
4
7
|
readonly realm: "realm";
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
8
|
+
readonly entityType: "entity.type";
|
|
9
|
+
readonly entity: "entity.id";
|
|
7
10
|
readonly action: "action";
|
|
8
11
|
readonly created: "created";
|
|
9
12
|
readonly isError: {
|
|
@@ -2,8 +2,8 @@ export var Base;
|
|
|
2
2
|
(function (Base) {
|
|
3
3
|
Base.mapping = {
|
|
4
4
|
realm: "realm",
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
entityType: "entity.type",
|
|
6
|
+
entity: "entity.id",
|
|
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: "
|
|
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":"
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"../","sources":["Analytics/Configuration/Base.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,IAAI,CA0BpB;AA1BD,WAAiB,IAAI;IAIP,YAAO,GAAG;QACtB,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,WAAW;QACnB,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,31 @@
|
|
|
1
|
+
import { listener } from "cloudly-analytics-common";
|
|
2
|
+
import { Event } from "../../Event";
|
|
3
|
+
import { FlattenKeys } from "..";
|
|
4
|
+
export declare namespace Base {
|
|
5
|
+
type Selectors = FlattenKeys<Required<Event.Ledger.Base<any>>> | "version" | "source";
|
|
6
|
+
const mapping: {
|
|
7
|
+
readonly organization: "organization";
|
|
8
|
+
readonly account: "account";
|
|
9
|
+
readonly meta: {
|
|
10
|
+
readonly selector: "meta";
|
|
11
|
+
readonly transform: "array";
|
|
12
|
+
};
|
|
13
|
+
readonly value: {
|
|
14
|
+
readonly selector: "value";
|
|
15
|
+
readonly transform: "stringify";
|
|
16
|
+
};
|
|
17
|
+
readonly realm: "realm";
|
|
18
|
+
readonly entityType: "entity.type";
|
|
19
|
+
readonly entity: "entity.id";
|
|
20
|
+
readonly action: "action";
|
|
21
|
+
readonly created: "created";
|
|
22
|
+
readonly isError: {
|
|
23
|
+
readonly selector: "isError";
|
|
24
|
+
readonly transform: "boolean";
|
|
25
|
+
};
|
|
26
|
+
readonly version: "version";
|
|
27
|
+
readonly source: "source";
|
|
28
|
+
};
|
|
29
|
+
type Fields = keyof typeof mapping;
|
|
30
|
+
const schema: listener.BigQueryApi.BaseField<Fields>[];
|
|
31
|
+
}
|
|
@@ -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":"AAGA,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 @@
|
|
|
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"}
|