@pax2pay/model-banking 0.1.327 → 0.1.329

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 (57) hide show
  1. package/.eslintrc +7 -0
  2. package/Analytics/Configuration/Base.ts +36 -0
  3. package/Analytics/Configuration/Mapping.ts +13 -0
  4. package/Analytics/Configuration/Operation.ts +37 -0
  5. package/Analytics/Configuration/{Schema/index.ts → Schema.ts} +2 -2
  6. package/Analytics/Configuration/Transaction.ts +88 -0
  7. package/Analytics/Configuration/index.ts +48 -41
  8. package/Analytics/index.ts +0 -15
  9. package/Treasury/Snapshot/Fragment.ts +12 -0
  10. package/dist/Analytics/Configuration/Base.d.ts +18 -0
  11. package/dist/Analytics/Configuration/Base.js +24 -0
  12. package/dist/Analytics/Configuration/Base.js.map +1 -0
  13. package/dist/Analytics/Configuration/Mapping.d.ts +11 -0
  14. package/dist/Analytics/Configuration/Mapping.js +12 -0
  15. package/dist/Analytics/Configuration/Mapping.js.map +1 -0
  16. package/dist/Analytics/Configuration/Operation.d.ts +22 -0
  17. package/dist/Analytics/Configuration/Operation.js +34 -0
  18. package/dist/Analytics/Configuration/Operation.js.map +1 -0
  19. package/dist/Analytics/Configuration/{Schema/index.d.ts → Schema.d.ts} +2 -2
  20. package/dist/Analytics/Configuration/Schema.js +7 -0
  21. package/dist/Analytics/Configuration/Schema.js.map +1 -0
  22. package/dist/Analytics/Configuration/Transaction.d.ts +86 -0
  23. package/dist/Analytics/Configuration/Transaction.js +85 -0
  24. package/dist/Analytics/Configuration/Transaction.js.map +1 -0
  25. package/dist/Analytics/Configuration/index.d.ts +17 -71
  26. package/dist/Analytics/Configuration/index.js +28 -36
  27. package/dist/Analytics/Configuration/index.js.map +1 -1
  28. package/dist/Treasury/Snapshot/Fragment.d.ts +3 -0
  29. package/dist/Treasury/Snapshot/Fragment.js +14 -0
  30. package/dist/Treasury/Snapshot/Fragment.js.map +1 -1
  31. package/package.json +13 -12
  32. package/Analytics/Configuration/Mapping/Field.ts +0 -16
  33. package/Analytics/Configuration/Mapping/Transform.ts +0 -8
  34. package/Analytics/Configuration/Mapping/index.ts +0 -9
  35. package/Analytics/Configuration/Schema/Field.ts +0 -16
  36. package/Analytics/Configuration/Schema/Mode.ts +0 -8
  37. package/Analytics/Configuration/Schema/Type.ts +0 -23
  38. package/dist/Analytics/Configuration/Mapping/Field.d.ts +0 -12
  39. package/dist/Analytics/Configuration/Mapping/Field.js +0 -11
  40. package/dist/Analytics/Configuration/Mapping/Field.js.map +0 -1
  41. package/dist/Analytics/Configuration/Mapping/Transform.d.ts +0 -6
  42. package/dist/Analytics/Configuration/Mapping/Transform.js +0 -7
  43. package/dist/Analytics/Configuration/Mapping/Transform.js.map +0 -1
  44. package/dist/Analytics/Configuration/Mapping/index.d.ts +0 -7
  45. package/dist/Analytics/Configuration/Mapping/index.js +0 -8
  46. package/dist/Analytics/Configuration/Mapping/index.js.map +0 -1
  47. package/dist/Analytics/Configuration/Schema/Field.d.ts +0 -14
  48. package/dist/Analytics/Configuration/Schema/Field.js +0 -15
  49. package/dist/Analytics/Configuration/Schema/Field.js.map +0 -1
  50. package/dist/Analytics/Configuration/Schema/Mode.d.ts +0 -6
  51. package/dist/Analytics/Configuration/Schema/Mode.js +0 -7
  52. package/dist/Analytics/Configuration/Schema/Mode.js.map +0 -1
  53. package/dist/Analytics/Configuration/Schema/Type.d.ts +0 -6
  54. package/dist/Analytics/Configuration/Schema/Type.js +0 -22
  55. package/dist/Analytics/Configuration/Schema/Type.js.map +0 -1
  56. package/dist/Analytics/Configuration/Schema/index.js +0 -7
  57. package/dist/Analytics/Configuration/Schema/index.js.map +0 -1
package/.eslintrc CHANGED
@@ -30,6 +30,13 @@
30
30
  "varsIgnorePattern": "h"
31
31
  }
32
32
  ],
33
+ "@typescript-eslint/no-unused-expressions": [
34
+ 2,
35
+ {
36
+ "allowShortCircuit": true,
37
+ "allowTernary": true
38
+ }
39
+ ],
33
40
  "@typescript-eslint/explicit-module-boundary-types": "off",
34
41
  "no-case-declarations": "off",
35
42
  "no-inner-declarations": "off",
@@ -0,0 +1,36 @@
1
+ import { Mapping } from "./Mapping"
2
+ import { Schema } from "./Schema"
3
+
4
+ export namespace Base {
5
+ type Selectors =
6
+ | "realm"
7
+ | "entity.type"
8
+ | "entity.id"
9
+ | "action"
10
+ | "created"
11
+ | "isError"
12
+ | "version"
13
+ | "source"
14
+ export const mapping = {
15
+ realm: "realm",
16
+ entity: "entity.type",
17
+ entityId: "entity.id",
18
+ action: "action",
19
+ created: "created",
20
+ isError: { selector: "isError", transform: "boolean" },
21
+ version: "version",
22
+ source: "source",
23
+ // eslint-disable-next-line
24
+ } as const satisfies Mapping<Selectors>;
25
+ export type Fields = keyof typeof mapping
26
+ export const schema: Schema<Fields> = [
27
+ { name: "realm", type: "STRING" },
28
+ { name: "entity", type: "STRING" },
29
+ { name: "entityId", type: "STRING" },
30
+ { name: "action", type: "STRING" },
31
+ { name: "created", type: "TIMESTAMP" },
32
+ { name: "isError", type: "BOOLEAN" },
33
+ { name: "source", type: "STRING" },
34
+ { name: "version", type: "STRING" },
35
+ ]
36
+ }
@@ -0,0 +1,13 @@
1
+ import { Filter } from "cloudly-analytics-administration"
2
+ import { isly } from "isly"
3
+
4
+ export type Mapping<T extends string = string> = Filter.Mapping.RecordWithSelector<T>
5
+
6
+ export namespace Mapping {
7
+ export type Field = string | Filter.Mapping.Getter
8
+ export namespace Field {
9
+ export import Transform = Filter.Mapping.Transform
10
+ export const type = isly.union(isly.string(), Filter.Mapping.Getter.type)
11
+ }
12
+ export const type = isly.record<Mapping>(isly.string(), Field.type)
13
+ }
@@ -0,0 +1,37 @@
1
+ import { Mapping } from "./Mapping"
2
+ import { Schema } from "./Schema"
3
+
4
+ export namespace Operation {
5
+ export const mapping = {
6
+ account: "value.account",
7
+ currency: "value.currency",
8
+ changes: { selector: "value.changes", transform: "array" },
9
+ type: "value.type",
10
+ transaction: "value.transaction",
11
+ counter: { selector: "value.counter", transform: "integer"},
12
+ created: "value.created",
13
+ signature: "value.signature",
14
+ previous: "value.previous",
15
+ // eslint-disable-next-line
16
+ } as const satisfies Mapping
17
+ export type Fields = keyof typeof mapping
18
+ export const schema: Schema<Fields> = [
19
+ { name: "account", type: "STRING" },
20
+ { name: "currency", type: "STRING" },
21
+ { name: "changes", type: "RECORD", mode: "REPEATED", fields: [
22
+ { name: "key", type: "STRING" },
23
+ { name: "value", type: "RECORD", fields: [
24
+ { name: "type", type: "STRING" },
25
+ { name: "amount", type: "NUMERIC" },
26
+ { name: "status", type: "STRING" },
27
+ { name: "result", type: "STRING", mode: "NULLABLE" },
28
+ ]}
29
+ ] },
30
+ { name: "type", type: "STRING" },
31
+ { name: "transaction", type: "STRING" },
32
+ { name: "counter", type: "NUMERIC" },
33
+ { name: "created", type: "DATETIME" },
34
+ { name: "signature", type: "STRING" },
35
+ { name: "previous", type: "STRING" },
36
+ ]
37
+ }
@@ -1,7 +1,7 @@
1
- import { Field as SchemaField } from "./Field"
1
+ import { Listener } from "cloudly-analytics-administration"
2
2
 
3
3
  export type Schema<T extends string = string> = Schema.Field<T>[]
4
4
  export namespace Schema {
5
- export import Field = SchemaField
5
+ export import Field = Listener.Configuration.BigQuery.Api.BaseField
6
6
  export const type = Field.type.array()
7
7
  }
@@ -0,0 +1,88 @@
1
+ import { Mapping } from "./Mapping"
2
+ import { Operation } from "./Operation"
3
+ import { Schema } from "./Schema"
4
+
5
+ export namespace Transaction {
6
+ export const mapping = {
7
+ counterpartType: "value.counterpart.type",
8
+ counterpart: { selector: "value.counterpart", transform: "stringify" },
9
+ counterpartCode: "value.counterpart.code",
10
+ currency: "value.currency",
11
+ amount: { selector: "value.amount", transform: "number" },
12
+ description: "value.description",
13
+ organization: "value.organization",
14
+ accountId: "value.accountId",
15
+ accountName: "value.accountName",
16
+ account: { selector: "value.account", transform: "stringify" },
17
+ accountType: "value.account.type",
18
+ type: "value.type",
19
+ direction: "value.direction",
20
+ id: "value.id",
21
+ referenceSupplier: "value.reference.supplier",
22
+ referenceReference: "value.reference.reference",
23
+ referenceReturnId: "value.reference.returnId",
24
+ referenceEndToEndId: "value.reference.endToEndId",
25
+ posted: "value.posted",
26
+ transacted: "value.transacted",
27
+ by: "value.by",
28
+ actualBalance: { selector: "value.balance.actual", transform: "number" },
29
+ reservedBalance: { selector: "value.balance.reserved", transform: "number" },
30
+ availableBalance: { selector: "value.balance.available", transform: "number" },
31
+ operations: { selector: "value.operations[*]", transform: {
32
+ account: "account",
33
+ currency: "currency",
34
+ changes: { selector: "changes", transform: "array" },
35
+ type: "type",
36
+ transaction: "transaction",
37
+ counter: { selector: "counter", transform: "integer"},
38
+ created: "created",
39
+ signature: "signature",
40
+ previous: "previous",
41
+ }},
42
+ status: "value.status",
43
+ rail: "value.rail",
44
+ railType: "value.rail.type",
45
+ flags: "value.flags",
46
+ oldFlags: "value.oldFlags",
47
+ notes: { selector: "value.notes", transform: "stringify" },
48
+ risk: { selector: "value.risk", transform: "number" },
49
+ state: { selector: "value.state", transform: "stringify" },
50
+ // eslint-disable-next-line
51
+ } as const satisfies Mapping
52
+ export type Fields = keyof typeof mapping
53
+ export const schema: Schema<Fields> = [
54
+ { name: "counterpartType", type: "STRING" },
55
+ { name: "counterpart", type: "STRING" },
56
+ { name: "counterpartCode", type: "STRING", mode: "NULLABLE" },
57
+ { name: "currency", type: "STRING" },
58
+ { name: "amount", type: "NUMERIC" },
59
+ { name: "description", type: "STRING" },
60
+ { name: "organization", type: "STRING" },
61
+ { name: "accountId", type: "STRING" },
62
+ { name: "accountName", type: "STRING", mode: "NULLABLE" },
63
+ { name: "account", type: "STRING" },
64
+ { name: "accountType", type: "STRING" },
65
+ { name: "type", type: "STRING", mode: "NULLABLE" },
66
+ { name: "direction", type: "STRING", mode: "NULLABLE" },
67
+ { name: "id", type: "STRING" },
68
+ { name: "referenceSupplier", type: "STRING", mode: "NULLABLE" },
69
+ { name: "referenceReference", type: "STRING", mode: "NULLABLE" },
70
+ { name: "referenceReturnId", type: "STRING", mode: "NULLABLE" },
71
+ { name: "referenceEndToEndId", type: "STRING", mode: "NULLABLE" },
72
+ { name: "posted", type: "DATETIME" },
73
+ { name: "transacted", type: "DATETIME", mode: "NULLABLE" },
74
+ { name: "by", type: "STRING", mode: "NULLABLE" },
75
+ { name: "actualBalance", type: "NUMERIC" },
76
+ { name: "reservedBalance", type: "NUMERIC" },
77
+ { name: "availableBalance", type: "NUMERIC" },
78
+ { name: "operations", type: "RECORD", mode: "REPEATED", fields: Operation.schema },
79
+ { name: "status", type: "STRING" },
80
+ { name: "rail", type: "STRING", mode: "NULLABLE" },
81
+ { name: "railType", type: "STRING" },
82
+ { name: "flags", type: "STRING", mode: "REPEATED" },
83
+ { name: "oldFlags", type: "STRING", mode: "REPEATED" },
84
+ { name: "notes", type: "STRING", mode: "REPEATED" },
85
+ { name: "risk", type: "NUMERIC", mode: "NULLABLE" },
86
+ { name: "state", type: "STRING", mode: "NULLABLE" },
87
+ ]
88
+ }
@@ -1,72 +1,79 @@
1
- import { Mapping } from "./Mapping"
2
- import { Schema } from "./Schema"
1
+ import { Listener } from "cloudly-analytics-administration"
2
+ import { Base as ConfigBase } from "./Base"
3
+ import { Mapping as AnalyticsMapping } from "./Mapping"
4
+ import { Operation as ConfigOperation } from "./Operation"
5
+ import { Schema as AnalyticsSchema } from "./Schema"
6
+ import { Transaction as ConfigTransaction } from "./Transaction"
3
7
 
8
+ //cSpell: ignore: paxpay nonprod
4
9
  export namespace Configuration {
5
- export const baseFields = [
6
- "realm",
7
- "entity",
8
- "entityId",
9
- "action",
10
- "created",
11
- "isError",
12
- "version",
13
- "source",
14
- ] as const
15
- export type BaseFields = typeof baseFields[number]
16
- export const baseMapping: Mapping<BaseFields> = {
17
- realm: "realm",
18
- entity: "entity.type",
19
- entityId: "entity.id",
20
- action: "action",
21
- created: "created",
22
- isError: { selector: "isError", transform: "boolean" },
23
- version: "version",
24
- source: "source",
10
+ export import Mapping = AnalyticsMapping
11
+ export import Schema = AnalyticsSchema
12
+ export import Base = ConfigBase
13
+ export import Transaction = ConfigTransaction
14
+ export import Operation = ConfigOperation
15
+ export type BigQueryTableConfig = {
16
+ projectName: "paxpay-prod" | "paxpay-nonprod"
17
+ datasetName: string
18
+ tableName: string
25
19
  }
26
- export const baseTableSchema: Schema<BaseFields> = [
27
- { name: "realm", type: "STRING" },
28
- { name: "entity", type: "STRING" },
29
- { name: "entityId", type: "STRING" },
30
- { name: "action", type: "STRING" },
31
- { name: "created", type: "TIMESTAMP" },
32
- { name: "isError", type: "BOOLEAN" },
33
- { name: "source", type: "STRING" },
34
- { name: "version", type: "STRING" },
35
- ]
36
20
  export function create(
37
21
  mapping: Mapping,
38
22
  schema: Schema,
39
- config: { projectName?: "paxpay-prod" | "paxpay-nonprod"; datasetName?: string; tableName: string },
40
- filter?: string
41
- ) {
23
+ config: BigQueryTableConfig,
24
+ filter: string
25
+ ): Listener.Configuration.BigQuery.BaseConfiguration {
42
26
  return {
43
27
  name: "ledger-events",
44
28
  type: "bigquery",
45
29
  filter: [
46
30
  {
47
31
  type: "selectively",
48
- expression: filter ?? "source:pax2pay-worker-banking-ledger",
32
+ expression: filter,
49
33
  },
50
34
  { type: "useragent" },
51
35
  {
52
36
  type: "mapping",
53
37
  mapping: {
54
- ...baseMapping,
38
+ ...Base.mapping,
55
39
  ...mapping,
56
40
  },
57
41
  },
58
42
  ],
59
43
  batchSize: 10,
60
44
  batchInterval: 3,
61
- projectName: "paxpay-nonprod",
62
- datasetName: "banking_ledger",
63
45
  ...config,
64
- tableSchema: [...baseTableSchema, ...schema],
46
+ tableSchema: [...Base.schema, ...schema],
65
47
  }
66
48
  }
67
49
  export const backup = create(
68
50
  { value: { selector: "value", transform: "stringify" } },
69
51
  [{ name: "value", type: "STRING" }],
70
- { tableName: "backup_test" }
52
+ {
53
+ projectName: "paxpay-prod",
54
+ datasetName: "pays_ledger",
55
+ tableName: "backup",
56
+ },
57
+ "source:pax2pay-worker-banking-ledger realm:within(uk, eu)"
58
+ )
59
+ export const operation = create(
60
+ Operation.mapping,
61
+ Operation.schema,
62
+ {
63
+ projectName: "paxpay-prod",
64
+ datasetName: "pays_ledger",
65
+ tableName: "operations",
66
+ },
67
+ "source:pax2pay-worker-banking-ledger entity:operation realm:within(uk, eu)"
68
+ )
69
+ export const transaction = create(
70
+ Transaction.mapping,
71
+ Transaction.schema,
72
+ {
73
+ projectName: "paxpay-prod",
74
+ datasetName: "pays_ledger",
75
+ tableName: "transactions",
76
+ },
77
+ "source:pax2pay-worker-banking-ledger entity:transaction realm:within(uk, eu)"
71
78
  )
72
79
  }
@@ -5,18 +5,3 @@ export namespace Analytics {
5
5
  export import Event = AnalyticsEvent
6
6
  export import Configuration = AnalyticsConfiguration
7
7
  }
8
-
9
- // /**
10
- // * It is possible to set default values for analytics:
11
- // *
12
- // * Both properties in Event and in AnalyticsExtra can be used.
13
- // * This needs to satisfies Partial<Event & AnalyticsExtra>, but not be declared as that.
14
- // * Do not use `as` or declare the const as Partial<Event & AnalyticsExtra>.
15
- // * If satisfies isn't possible to use (eg old typescript version or es-lint parsing error etc)
16
- // * remove type-declaration.
17
- // *
18
- // * This is because the actual type of this object will effect the type of
19
- // * the event-parameter for `Analytics.send(event)`
20
- // */
21
- // //eslint-disable-next-line
22
- // export const analyticsDefault = { version: data.version, source: "pax2pay-worker-banking-ledger", } satisfies Partial<types.Event & AnalyticsExtra>;
@@ -1,3 +1,4 @@
1
+ import { isoly } from "isoly"
1
2
  import { isly } from "isly"
2
3
  import { Balances } from "../../Balances"
3
4
  import { Account } from "../Account"
@@ -35,6 +36,9 @@ export namespace Fragment {
35
36
  export namespace Burned {
36
37
  export const type = isly.record<Burned>(isly.string(), Fragment.Coinage.change)
37
38
  }
39
+ export function sum(currency: isoly.Currency, coinage: Burned | Minted): number {
40
+ return Object.values(coinage).reduce((result, change) => isoly.Currency.add(currency, result, change.amount), 0)
41
+ }
38
42
  }
39
43
  export const type = isly.object<Fragment>({
40
44
  warnings: Warning.type.array(),
@@ -50,4 +54,12 @@ export namespace Fragment {
50
54
  accounts: Account.type.array(),
51
55
  }),
52
56
  })
57
+ export function validate(currency: isoly.Currency, fragment: Fragment): boolean {
58
+ const issuable = fragment.fiat.total
59
+ const actual = fragment.emoney.actual ?? 0
60
+ const burned = Coinage.sum(currency, fragment.burned)
61
+ const minted = Coinage.sum(currency, fragment.minted)
62
+ const total = isoly.Currency.subtract(currency, isoly.Currency.add(currency, actual, burned), minted)
63
+ return issuable == total
64
+ }
53
65
  }
@@ -0,0 +1,18 @@
1
+ import { Schema } from "./Schema";
2
+ export declare namespace Base {
3
+ const mapping: {
4
+ readonly realm: "realm";
5
+ readonly entity: "entity.type";
6
+ readonly entityId: "entity.id";
7
+ readonly action: "action";
8
+ readonly created: "created";
9
+ readonly isError: {
10
+ readonly selector: "isError";
11
+ readonly transform: "boolean";
12
+ };
13
+ readonly version: "version";
14
+ readonly source: "source";
15
+ };
16
+ type Fields = keyof typeof mapping;
17
+ const schema: Schema<Fields>;
18
+ }
@@ -0,0 +1,24 @@
1
+ export var Base;
2
+ (function (Base) {
3
+ Base.mapping = {
4
+ realm: "realm",
5
+ entity: "entity.type",
6
+ entityId: "entity.id",
7
+ action: "action",
8
+ created: "created",
9
+ isError: { selector: "isError", transform: "boolean" },
10
+ version: "version",
11
+ source: "source",
12
+ };
13
+ Base.schema = [
14
+ { name: "realm", type: "STRING" },
15
+ { name: "entity", type: "STRING" },
16
+ { name: "entityId", type: "STRING" },
17
+ { name: "action", type: "STRING" },
18
+ { name: "created", type: "TIMESTAMP" },
19
+ { name: "isError", type: "BOOLEAN" },
20
+ { name: "source", type: "STRING" },
21
+ { name: "version", type: "STRING" },
22
+ ];
23
+ })(Base || (Base = {}));
24
+ //# sourceMappingURL=Base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Base.js","sourceRoot":"../","sources":["Analytics/Configuration/Base.ts"],"names":[],"mappings":"AAGA,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;KAEsB,CAAC;IAE3B,WAAM,GAAmB;QACrC,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"}
@@ -0,0 +1,11 @@
1
+ import { Filter } from "cloudly-analytics-administration";
2
+ import { isly } from "isly";
3
+ export type Mapping<T extends string = string> = Filter.Mapping.RecordWithSelector<T>;
4
+ export declare namespace Mapping {
5
+ type Field = string | Filter.Mapping.Getter;
6
+ namespace Field {
7
+ export import Transform = Filter.Mapping.Transform;
8
+ const type: isly.Type<string | Filter.Mapping.Getter<string>>;
9
+ }
10
+ const type: isly.Type<Mapping<string>>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import { Filter } from "cloudly-analytics-administration";
2
+ import { isly } from "isly";
3
+ export var Mapping;
4
+ (function (Mapping) {
5
+ let Field;
6
+ (function (Field) {
7
+ Field.Transform = Filter.Mapping.Transform;
8
+ Field.type = isly.union(isly.string(), Filter.Mapping.Getter.type);
9
+ })(Field = Mapping.Field || (Mapping.Field = {}));
10
+ Mapping.type = isly.record(isly.string(), Field.type);
11
+ })(Mapping || (Mapping = {}));
12
+ //# sourceMappingURL=Mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Mapping.js","sourceRoot":"../","sources":["Analytics/Configuration/Mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,OAAO,CAOvB;AAPD,WAAiB,OAAO;IAEvB,IAAiB,KAAK,CAGrB;IAHD,WAAiB,KAAK;QACP,eAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAA;QACrC,UAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC1E,CAAC,EAHgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAGrB;IACY,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;AACpE,CAAC,EAPgB,OAAO,KAAP,OAAO,QAOvB"}
@@ -0,0 +1,22 @@
1
+ import { Schema } from "./Schema";
2
+ export declare namespace Operation {
3
+ const mapping: {
4
+ readonly account: "value.account";
5
+ readonly currency: "value.currency";
6
+ readonly changes: {
7
+ readonly selector: "value.changes";
8
+ readonly transform: "array";
9
+ };
10
+ readonly type: "value.type";
11
+ readonly transaction: "value.transaction";
12
+ readonly counter: {
13
+ readonly selector: "value.counter";
14
+ readonly transform: "integer";
15
+ };
16
+ readonly created: "value.created";
17
+ readonly signature: "value.signature";
18
+ readonly previous: "value.previous";
19
+ };
20
+ type Fields = keyof typeof mapping;
21
+ const schema: Schema<Fields>;
22
+ }
@@ -0,0 +1,34 @@
1
+ export var Operation;
2
+ (function (Operation) {
3
+ Operation.mapping = {
4
+ account: "value.account",
5
+ currency: "value.currency",
6
+ changes: { selector: "value.changes", transform: "array" },
7
+ type: "value.type",
8
+ transaction: "value.transaction",
9
+ counter: { selector: "value.counter", transform: "integer" },
10
+ created: "value.created",
11
+ signature: "value.signature",
12
+ previous: "value.previous",
13
+ };
14
+ Operation.schema = [
15
+ { name: "account", type: "STRING" },
16
+ { name: "currency", type: "STRING" },
17
+ { name: "changes", type: "RECORD", mode: "REPEATED", fields: [
18
+ { name: "key", type: "STRING" },
19
+ { name: "value", type: "RECORD", fields: [
20
+ { name: "type", type: "STRING" },
21
+ { name: "amount", type: "NUMERIC" },
22
+ { name: "status", type: "STRING" },
23
+ { name: "result", type: "STRING", mode: "NULLABLE" },
24
+ ] }
25
+ ] },
26
+ { name: "type", type: "STRING" },
27
+ { name: "transaction", type: "STRING" },
28
+ { name: "counter", type: "NUMERIC" },
29
+ { name: "created", type: "DATETIME" },
30
+ { name: "signature", type: "STRING" },
31
+ { name: "previous", type: "STRING" },
32
+ ];
33
+ })(Operation || (Operation = {}));
34
+ //# sourceMappingURL=Operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operation.js","sourceRoot":"../","sources":["Analytics/Configuration/Operation.ts"],"names":[],"mappings":"AAGA,MAAM,KAAW,SAAS,CAiCzB;AAjCD,WAAiB,SAAS;IACZ,iBAAO,GAAG;QACtB,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,gBAAgB;QAC1B,OAAO,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE;QAC1D,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAC;QAC3D,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,iBAAiB;QAC5B,QAAQ,EAAE,gBAAgB;KAEC,CAAA;IAEf,gBAAM,GAAmB;QACrC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;QACnC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;QACpC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE;gBAC5D,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC/B,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE;wBACxC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;wBACnC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;qBACpD,EAAC;aACF,EAAE;QACH,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;QAChC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;QACpC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;QACrC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;QACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;KACpC,CAAA;AACF,CAAC,EAjCgB,SAAS,KAAT,SAAS,QAiCzB"}
@@ -1,6 +1,6 @@
1
- import { Field as SchemaField } from "./Field";
1
+ import { Listener } from "cloudly-analytics-administration";
2
2
  export type Schema<T extends string = string> = Schema.Field<T>[];
3
3
  export declare namespace Schema {
4
- export import Field = SchemaField;
4
+ export import Field = Listener.Configuration.BigQuery.Api.BaseField;
5
5
  const type: import("isly/dist/cjs/Type").Type<Field<string>[]>;
6
6
  }
@@ -0,0 +1,7 @@
1
+ import { Listener } from "cloudly-analytics-administration";
2
+ export var Schema;
3
+ (function (Schema) {
4
+ Schema.Field = Listener.Configuration.BigQuery.Api.BaseField;
5
+ Schema.type = Schema.Field.type.array();
6
+ })(Schema || (Schema = {}));
7
+ //# sourceMappingURL=Schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.js","sourceRoot":"../","sources":["Analytics/Configuration/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAG3D,MAAM,KAAW,MAAM,CAGtB;AAHD,WAAiB,MAAM;IACR,YAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAA;IACtD,WAAI,GAAG,OAAA,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;AACvC,CAAC,EAHgB,MAAM,KAAN,MAAM,QAGtB"}
@@ -0,0 +1,86 @@
1
+ import { Schema } from "./Schema";
2
+ export declare namespace Transaction {
3
+ const mapping: {
4
+ readonly counterpartType: "value.counterpart.type";
5
+ readonly counterpart: {
6
+ readonly selector: "value.counterpart";
7
+ readonly transform: "stringify";
8
+ };
9
+ readonly counterpartCode: "value.counterpart.code";
10
+ readonly currency: "value.currency";
11
+ readonly amount: {
12
+ readonly selector: "value.amount";
13
+ readonly transform: "number";
14
+ };
15
+ readonly description: "value.description";
16
+ readonly organization: "value.organization";
17
+ readonly accountId: "value.accountId";
18
+ readonly accountName: "value.accountName";
19
+ readonly account: {
20
+ readonly selector: "value.account";
21
+ readonly transform: "stringify";
22
+ };
23
+ readonly accountType: "value.account.type";
24
+ readonly type: "value.type";
25
+ readonly direction: "value.direction";
26
+ readonly id: "value.id";
27
+ readonly referenceSupplier: "value.reference.supplier";
28
+ readonly referenceReference: "value.reference.reference";
29
+ readonly referenceReturnId: "value.reference.returnId";
30
+ readonly referenceEndToEndId: "value.reference.endToEndId";
31
+ readonly posted: "value.posted";
32
+ readonly transacted: "value.transacted";
33
+ readonly by: "value.by";
34
+ readonly actualBalance: {
35
+ readonly selector: "value.balance.actual";
36
+ readonly transform: "number";
37
+ };
38
+ readonly reservedBalance: {
39
+ readonly selector: "value.balance.reserved";
40
+ readonly transform: "number";
41
+ };
42
+ readonly availableBalance: {
43
+ readonly selector: "value.balance.available";
44
+ readonly transform: "number";
45
+ };
46
+ readonly operations: {
47
+ readonly selector: "value.operations[*]";
48
+ readonly transform: {
49
+ readonly account: "account";
50
+ readonly currency: "currency";
51
+ readonly changes: {
52
+ readonly selector: "changes";
53
+ readonly transform: "array";
54
+ };
55
+ readonly type: "type";
56
+ readonly transaction: "transaction";
57
+ readonly counter: {
58
+ readonly selector: "counter";
59
+ readonly transform: "integer";
60
+ };
61
+ readonly created: "created";
62
+ readonly signature: "signature";
63
+ readonly previous: "previous";
64
+ };
65
+ };
66
+ readonly status: "value.status";
67
+ readonly rail: "value.rail";
68
+ readonly railType: "value.rail.type";
69
+ readonly flags: "value.flags";
70
+ readonly oldFlags: "value.oldFlags";
71
+ readonly notes: {
72
+ readonly selector: "value.notes";
73
+ readonly transform: "stringify";
74
+ };
75
+ readonly risk: {
76
+ readonly selector: "value.risk";
77
+ readonly transform: "number";
78
+ };
79
+ readonly state: {
80
+ readonly selector: "value.state";
81
+ readonly transform: "stringify";
82
+ };
83
+ };
84
+ type Fields = keyof typeof mapping;
85
+ const schema: Schema<Fields>;
86
+ }