@pax2pay/model-banking 0.1.315 → 0.1.317

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 (66) hide show
  1. package/Analytics/Configuration/Mapping/Field.ts +16 -0
  2. package/Analytics/Configuration/Mapping/Transform.ts +8 -0
  3. package/Analytics/Configuration/Mapping/index.ts +9 -0
  4. package/Analytics/Configuration/Schema/Field.ts +16 -0
  5. package/Analytics/Configuration/Schema/Mode.ts +8 -0
  6. package/Analytics/Configuration/Schema/Type.ts +23 -0
  7. package/Analytics/Configuration/Schema/index.ts +7 -0
  8. package/Analytics/Configuration/index.ts +72 -0
  9. package/Analytics/Event/Base.ts +10 -0
  10. package/Analytics/Event/Operation.ts +20 -0
  11. package/Analytics/Event/Transaction.ts +22 -0
  12. package/Analytics/Event/index.ts +10 -0
  13. package/Analytics/index.ts +22 -0
  14. package/Transaction/index.ts +63 -39
  15. package/dist/Analytics/Configuration/Mapping/Field.d.ts +12 -0
  16. package/dist/Analytics/Configuration/Mapping/Field.js +11 -0
  17. package/dist/Analytics/Configuration/Mapping/Field.js.map +1 -0
  18. package/dist/Analytics/Configuration/Mapping/Transform.d.ts +6 -0
  19. package/dist/Analytics/Configuration/Mapping/Transform.js +7 -0
  20. package/dist/Analytics/Configuration/Mapping/Transform.js.map +1 -0
  21. package/dist/Analytics/Configuration/Mapping/index.d.ts +7 -0
  22. package/dist/Analytics/Configuration/Mapping/index.js +8 -0
  23. package/dist/Analytics/Configuration/Mapping/index.js.map +1 -0
  24. package/dist/Analytics/Configuration/Schema/Field.d.ts +14 -0
  25. package/dist/Analytics/Configuration/Schema/Field.js +15 -0
  26. package/dist/Analytics/Configuration/Schema/Field.js.map +1 -0
  27. package/dist/Analytics/Configuration/Schema/Mode.d.ts +6 -0
  28. package/dist/Analytics/Configuration/Schema/Mode.js +7 -0
  29. package/dist/Analytics/Configuration/Schema/Mode.js.map +1 -0
  30. package/dist/Analytics/Configuration/Schema/Type.d.ts +6 -0
  31. package/dist/Analytics/Configuration/Schema/Type.js +22 -0
  32. package/dist/Analytics/Configuration/Schema/Type.js.map +1 -0
  33. package/dist/Analytics/Configuration/Schema/index.d.ts +6 -0
  34. package/dist/Analytics/Configuration/Schema/index.js +7 -0
  35. package/dist/Analytics/Configuration/Schema/index.js.map +1 -0
  36. package/dist/Analytics/Configuration/index.d.ts +76 -0
  37. package/dist/Analytics/Configuration/index.js +62 -0
  38. package/dist/Analytics/Configuration/index.js.map +1 -0
  39. package/dist/Analytics/Event/Base.d.ts +12 -0
  40. package/dist/Analytics/Event/Base.js +2 -0
  41. package/dist/Analytics/Event/Base.js.map +1 -0
  42. package/dist/Analytics/Event/Operation.d.ts +13 -0
  43. package/dist/Analytics/Event/Operation.js +15 -0
  44. package/dist/Analytics/Event/Operation.js.map +1 -0
  45. package/dist/Analytics/Event/Transaction.d.ts +14 -0
  46. package/dist/Analytics/Event/Transaction.js +16 -0
  47. package/dist/Analytics/Event/Transaction.js.map +1 -0
  48. package/dist/Analytics/Event/index.d.ts +11 -0
  49. package/dist/Analytics/Event/index.js +8 -0
  50. package/dist/Analytics/Event/index.js.map +1 -0
  51. package/dist/Analytics/index.d.ts +6 -0
  52. package/dist/Analytics/index.js +8 -0
  53. package/dist/Analytics/index.js.map +1 -0
  54. package/dist/Identity.d.ts +2 -2
  55. package/dist/Transaction/index.d.ts +21 -7
  56. package/dist/Transaction/index.js +54 -26
  57. package/dist/Transaction/index.js.map +1 -1
  58. package/dist/pax2pay.d.ts +1 -1
  59. package/dist/pax2pay.js +1 -1
  60. package/dist/pax2pay.js.map +1 -1
  61. package/package.json +7 -7
  62. package/pax2pay.ts +1 -1
  63. package/Event/index.ts +0 -97
  64. package/dist/Event/index.d.ts +0 -40
  65. package/dist/Event/index.js +0 -101
  66. package/dist/Event/index.js.map +0 -1
@@ -0,0 +1,16 @@
1
+ import { isly } from "isly"
2
+ import { Transform as FieldTransform } from "./Transform"
3
+
4
+ type Transformer = { selector: string; transform: Field.Transform }
5
+ export type Field = string | Transformer
6
+
7
+ export namespace Field {
8
+ export import Transform = FieldTransform
9
+ export const type = isly.union<string | Transformer, string, Transformer>(
10
+ isly.string(),
11
+ isly.object<Transformer>({
12
+ selector: isly.string(),
13
+ transform: Transform.type,
14
+ })
15
+ )
16
+ }
@@ -0,0 +1,8 @@
1
+ import { isly } from "isly"
2
+
3
+ export type Transform = typeof Transform.values[number]
4
+
5
+ export namespace Transform {
6
+ export const values = ["string", "stringify", "boolean", "float", "integer", "number", "point"] as const
7
+ export const type = isly.string<Transform>(values)
8
+ }
@@ -0,0 +1,9 @@
1
+ import { isly } from "isly"
2
+ import { Field as FieldMapping } from "./Field"
3
+
4
+ export type Mapping<T extends string = string> = Record<T, Mapping.Field>
5
+
6
+ export namespace Mapping {
7
+ export import Field = FieldMapping
8
+ export const type = isly.record<Mapping>(isly.string(), Field.type)
9
+ }
@@ -0,0 +1,16 @@
1
+ import { isly } from "isly"
2
+ import { Mode as FieldMode } from "./Mode"
3
+ import { Type as FieldType } from "./Type"
4
+
5
+ export type Field<T extends string = string> = { name: T; type: Field.Type; mode?: Field.Mode; fields?: Field[] }
6
+
7
+ export namespace Field {
8
+ export import Type = FieldType
9
+ export import Mode = FieldMode
10
+ export const type = isly.object<Field>({
11
+ name: isly.string(),
12
+ type: Type.type,
13
+ mode: Mode.type.optional(),
14
+ fields: isly.lazy((): isly.Type<Field<string>[] | undefined> => type.array().optional(), "fields"),
15
+ })
16
+ }
@@ -0,0 +1,8 @@
1
+ import { isly } from "isly"
2
+
3
+ export type Mode = typeof Mode.values[number]
4
+
5
+ export namespace Mode {
6
+ export const values = ["NULLABLE", "REQUIRED", "REPEATED"] as const
7
+ export const type = isly.string<Mode>(values)
8
+ }
@@ -0,0 +1,23 @@
1
+ import { isly } from "isly"
2
+
3
+ export type Type = typeof Type.values[number]
4
+
5
+ export namespace Type {
6
+ export const values = [
7
+ "STRING",
8
+ "BYTES",
9
+ "INTEGER",
10
+ "FLOAT",
11
+ "NUMERIC",
12
+ "BIGNUMERIC",
13
+ "BOOLEAN",
14
+ "TIMESTAMP",
15
+ "DATE",
16
+ "TIME",
17
+ "DATETIME",
18
+ "INTERVAL",
19
+ "RECORD",
20
+ "GEOGRAPHY",
21
+ ] as const
22
+ export const type = isly.string<Type>(values)
23
+ }
@@ -0,0 +1,7 @@
1
+ import { Field as SchemaField } from "./Field"
2
+
3
+ export type Schema<T extends string = string> = Schema.Field<T>[]
4
+ export namespace Schema {
5
+ export import Field = SchemaField
6
+ export const type = Field.type.array()
7
+ }
@@ -0,0 +1,72 @@
1
+ import { Mapping } from "./Mapping"
2
+ import { Schema } from "./Schema"
3
+
4
+ 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",
25
+ }
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
+ export function create(
37
+ mapping: Mapping,
38
+ schema: Schema,
39
+ config: { projectName?: "paxpay-prod" | "paxpay-nonprod"; datasetName?: string; tableName: string },
40
+ filter?: string
41
+ ) {
42
+ return {
43
+ name: "ledger-events",
44
+ type: "bigquery",
45
+ filter: [
46
+ {
47
+ type: "selectively",
48
+ expression: filter ?? "source:pax2pay-worker-banking-ledger",
49
+ },
50
+ { type: "useragent" },
51
+ {
52
+ type: "mapping",
53
+ mapping: {
54
+ ...baseMapping,
55
+ ...mapping,
56
+ },
57
+ },
58
+ ],
59
+ batchSize: 10,
60
+ batchInterval: 3,
61
+ projectName: "paxpay-nonprod",
62
+ datasetName: "banking_ledger",
63
+ ...config,
64
+ tableSchema: [...baseTableSchema, ...schema],
65
+ }
66
+ }
67
+ export const backup = create(
68
+ { value: { selector: "value", transform: "stringify" } },
69
+ [{ name: "value", type: "STRING" }],
70
+ { tableName: "backup_test" }
71
+ )
72
+ }
@@ -0,0 +1,10 @@
1
+ import { isoly } from "isoly"
2
+ import { Realm } from "../../Realm"
3
+
4
+ export type Base<T> = {
5
+ realm: Realm
6
+ entity: { type: string; id: string }
7
+ action: string
8
+ created: isoly.DateTime
9
+ value: T
10
+ }
@@ -0,0 +1,20 @@
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 type Operation = Base<modelOperation> & {
7
+ entity: { type: "operation"; id: string }
8
+ action: "created"
9
+ }
10
+ export namespace Operation {
11
+ export function create(value: modelOperation, realm: Realm, action: Operation["action"]): Operation {
12
+ return {
13
+ realm,
14
+ entity: { type: "operation", id: value.signature ?? "" },
15
+ action,
16
+ created: isoly.DateTime.now(),
17
+ value,
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,22 @@
1
+ import { isoly } from "isoly"
2
+ import { Realm } from "../../Realm"
3
+ import { Transaction as modelTransaction } from "../../Transaction"
4
+ import { Base } from "./Base"
5
+
6
+ export type Transaction = Base<modelTransaction> & {
7
+ entity: { type: "transaction"; id: string }
8
+ action: "created" | "finalized" | "cancelled" | "failed"
9
+ isError?: true
10
+ }
11
+ export namespace Transaction {
12
+ export function create(value: modelTransaction, realm: Realm, action: Transaction["action"]): Transaction {
13
+ return {
14
+ realm,
15
+ entity: { type: "transaction", id: value.id },
16
+ action,
17
+ ...(action == "failed" ? { isError: true } : {}),
18
+ created: isoly.DateTime.now(),
19
+ value,
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,10 @@
1
+ import { Base as EventBase } from "./Base"
2
+ import { Operation as OperationEvent } from "./Operation"
3
+ import { Transaction as TransactionEvent } from "./Transaction"
4
+
5
+ export type Event = (Event.Transaction | Event.Operation) & { version: string }
6
+ export namespace Event {
7
+ export type Base<T> = EventBase<T>
8
+ export import Transaction = TransactionEvent
9
+ export import Operation = OperationEvent
10
+ }
@@ -0,0 +1,22 @@
1
+ import { Configuration as AnalyticsConfiguration } from "./Configuration"
2
+ import { Event as AnalyticsEvent } from "./Event"
3
+
4
+ export namespace Analytics {
5
+ export import Event = AnalyticsEvent
6
+ export import Configuration = AnalyticsConfiguration
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>;
@@ -52,7 +52,6 @@ export namespace Transaction {
52
52
  export import Reference = TransactionReference
53
53
  export import Note = TransactionNote
54
54
  export import Status = TransactionStatus
55
-
56
55
  export const type = isly.object<Transaction>({
57
56
  counterpart: isly.fromIs("Rail.Address", Rail.Address.is),
58
57
  currency: isly.fromIs("isoly.Currency", isoly.Currency.is),
@@ -96,38 +95,74 @@ export namespace Transaction {
96
95
  }
97
96
  }
98
97
  export function fromCreatable(
99
- organization: string,
100
- accountId: string,
101
- accountName: string,
102
- account: Rail.Address,
103
- rail: Rail,
104
98
  creatable: Creatable & { counterpart: Rail.Address },
105
- operations: Operation.Creatable[],
106
- balance: {
107
- actual: number
108
- reserved: number
109
- available: number
110
- },
111
- by?: string
99
+ id: string,
100
+ state: Rule.State.Evaluated,
101
+ account: { id: string; name: string; organization: string; address: Rail.Address },
102
+ balance: { actual: number; reserved: number; available: number },
103
+ by: string | undefined,
104
+ operation: Operation | undefined,
105
+ reason: Status.Reason | undefined
112
106
  ): Transaction {
113
- const id = Identifier.generate()
114
- const amount = -creatable.amount
107
+ const status: Status = reason
108
+ ? ["rejected", reason]
109
+ : state.outcome == "reject"
110
+ ? ["rejected", "denied"]
111
+ : state.outcome == "review"
112
+ ? "review"
113
+ : "processing"
114
+ const rail: Rail = state.card
115
+ ? state.card.scheme
116
+ : account.address.type == "internal"
117
+ ? "internal"
118
+ : account.address.type == "paxgiro"
119
+ ? "paxgiro"
120
+ : "fasterpayments"
115
121
  return {
116
122
  ...creatable,
117
- amount,
118
- type: getType(creatable, accountName),
119
- direction: getDirection(amount),
120
- organization,
121
- accountId,
122
- accountName,
123
- account,
123
+ amount: -creatable.amount,
124
+ type: getType(creatable.counterpart, account.name),
125
+ direction: "outbound",
126
+ organization: account.organization,
127
+ accountId: account.id,
128
+ accountName: account.name,
129
+ account: account.address,
124
130
  id,
125
131
  posted: isoly.DateTime.now(),
126
132
  by,
127
133
  balance,
128
- operations: operations.map(o => Operation.fromCreatable(id, o)),
129
- status: "review",
134
+ operations: !operation ? [] : [operation],
135
+ status,
130
136
  rail,
137
+ flags: state.flags,
138
+ oldFlags: [],
139
+ notes: state.notes,
140
+ state,
141
+ risk: state.transaction.risk,
142
+ }
143
+ }
144
+ export function empty(
145
+ creatable: Creatable & { counterpart: Rail.Address },
146
+ account: { id: string; name: string; organization: string; address: Rail.Address },
147
+ balance: { actual: number; reserved: number; available: number },
148
+ by: string | undefined
149
+ ): Transaction {
150
+ return {
151
+ ...creatable,
152
+ amount: 0,
153
+ type: getType(creatable.counterpart, account.name),
154
+ direction: "inbound",
155
+ organization: account.organization,
156
+ accountId: account.id,
157
+ accountName: account.name,
158
+ account: account.address,
159
+ id: Identifier.generate(),
160
+ posted: isoly.DateTime.now(),
161
+ by,
162
+ balance,
163
+ operations: [],
164
+ status: "review",
165
+ rail: "internal",
131
166
  flags: [],
132
167
  oldFlags: [],
133
168
  notes: [],
@@ -148,7 +183,7 @@ export namespace Transaction {
148
183
  const id = Identifier.generate()
149
184
  return {
150
185
  ...transaction,
151
- type: getType(transaction, accountName),
186
+ type: getType(transaction.counterpart, accountName),
152
187
  direction: "inbound",
153
188
  organization,
154
189
  accountId,
@@ -180,29 +215,18 @@ export namespace Transaction {
180
215
  transaction.flags = Array.from(current)
181
216
  transaction.oldFlags = Array.from(old)
182
217
  }
183
- export function getType(
184
- transaction: TransactionCreatable & { counterpart: Rail.Address },
185
- accountName: string
186
- ): Types {
218
+ export function getType(counterpart: Rail.Address, accountName: string): Types {
187
219
  let result: Types
188
220
  if (accountName.startsWith("settlement-") || accountName.startsWith("fee-"))
189
221
  result = "system"
190
- else if (transaction.counterpart.type == "internal")
222
+ else if (counterpart.type == "internal")
191
223
  result = "internal"
192
- else if (transaction.counterpart.type == "card")
224
+ else if (counterpart.type == "card")
193
225
  result = "card"
194
226
  else
195
227
  result = "external"
196
228
  return result
197
229
  }
198
- export function getDirection(amount: number): Direction {
199
- let result: Direction
200
- if (amount < 0)
201
- result = "outbound"
202
- else
203
- result = "inbound"
204
- return result
205
- }
206
230
 
207
231
  const csvMap: Record<string, (transaction: Transaction) => string | number | undefined> = {
208
232
  id: (transaction: Transaction) => transaction.id,
@@ -0,0 +1,12 @@
1
+ import { isly } from "isly";
2
+ import { Transform as FieldTransform } from "./Transform";
3
+ type Transformer = {
4
+ selector: string;
5
+ transform: Field.Transform;
6
+ };
7
+ export type Field = string | Transformer;
8
+ export declare namespace Field {
9
+ export import Transform = FieldTransform;
10
+ const type: isly.Type<string | Transformer>;
11
+ }
12
+ export {};
@@ -0,0 +1,11 @@
1
+ import { isly } from "isly";
2
+ import { Transform as FieldTransform } from "./Transform";
3
+ export var Field;
4
+ (function (Field) {
5
+ Field.Transform = FieldTransform;
6
+ Field.type = isly.union(isly.string(), isly.object({
7
+ selector: isly.string(),
8
+ transform: Field.Transform.type,
9
+ }));
10
+ })(Field || (Field = {}));
11
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","sourceRoot":"../","sources":["Analytics/Configuration/Mapping/Field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AAKzD,MAAM,KAAW,KAAK,CASrB;AATD,WAAiB,KAAK;IACP,eAAS,GAAG,cAAc,CAAA;IAC3B,UAAI,GAAG,IAAI,CAAC,KAAK,CAC7B,IAAI,CAAC,MAAM,EAAE,EACb,IAAI,CAAC,MAAM,CAAc;QACxB,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;QACvB,SAAS,EAAE,MAAA,SAAS,CAAC,IAAI;KACzB,CAAC,CACF,CAAA;AACF,CAAC,EATgB,KAAK,KAAL,KAAK,QASrB"}
@@ -0,0 +1,6 @@
1
+ import { isly } from "isly";
2
+ export type Transform = typeof Transform.values[number];
3
+ export declare namespace Transform {
4
+ const values: readonly ["string", "stringify", "boolean", "float", "integer", "number", "point"];
5
+ const type: isly.Type<"string" | "number" | "boolean" | "integer" | "stringify" | "float" | "point">;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { isly } from "isly";
2
+ export var Transform;
3
+ (function (Transform) {
4
+ Transform.values = ["string", "stringify", "boolean", "float", "integer", "number", "point"];
5
+ Transform.type = isly.string(Transform.values);
6
+ })(Transform || (Transform = {}));
7
+ //# sourceMappingURL=Transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transform.js","sourceRoot":"../","sources":["Analytics/Configuration/Mapping/Transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,SAAS,CAGzB;AAHD,WAAiB,SAAS;IACZ,gBAAM,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;IAC3F,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY,UAAA,MAAM,CAAC,CAAA;AACnD,CAAC,EAHgB,SAAS,KAAT,SAAS,QAGzB"}
@@ -0,0 +1,7 @@
1
+ import { isly } from "isly";
2
+ import { Field as FieldMapping } from "./Field";
3
+ export type Mapping<T extends string = string> = Record<T, Mapping.Field>;
4
+ export declare namespace Mapping {
5
+ export import Field = FieldMapping;
6
+ const type: isly.Type<Mapping<string>>;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { isly } from "isly";
2
+ import { Field as FieldMapping } from "./Field";
3
+ export var Mapping;
4
+ (function (Mapping) {
5
+ Mapping.Field = FieldMapping;
6
+ Mapping.type = isly.record(isly.string(), Mapping.Field.type);
7
+ })(Mapping || (Mapping = {}));
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Configuration/Mapping/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,SAAS,CAAA;AAI/C,MAAM,KAAW,OAAO,CAGvB;AAHD,WAAiB,OAAO;IACT,aAAK,GAAG,YAAY,CAAA;IACrB,YAAI,GAAG,IAAI,CAAC,MAAM,CAAU,IAAI,CAAC,MAAM,EAAE,EAAE,QAAA,KAAK,CAAC,IAAI,CAAC,CAAA;AACpE,CAAC,EAHgB,OAAO,KAAP,OAAO,QAGvB"}
@@ -0,0 +1,14 @@
1
+ import { isly } from "isly";
2
+ import { Mode as FieldMode } from "./Mode";
3
+ import { Type as FieldType } from "./Type";
4
+ export type Field<T extends string = string> = {
5
+ name: T;
6
+ type: Field.Type;
7
+ mode?: Field.Mode;
8
+ fields?: Field[];
9
+ };
10
+ export declare namespace Field {
11
+ export import Type = FieldType;
12
+ export import Mode = FieldMode;
13
+ const type: isly.object.ExtendableType<Field<string>>;
14
+ }
@@ -0,0 +1,15 @@
1
+ import { isly } from "isly";
2
+ import { Mode as FieldMode } from "./Mode";
3
+ import { Type as FieldType } from "./Type";
4
+ export var Field;
5
+ (function (Field) {
6
+ Field.Type = FieldType;
7
+ Field.Mode = FieldMode;
8
+ Field.type = isly.object({
9
+ name: isly.string(),
10
+ type: Field.Type.type,
11
+ mode: Field.Mode.type.optional(),
12
+ fields: isly.lazy(() => Field.type.array().optional(), "fields"),
13
+ });
14
+ })(Field || (Field = {}));
15
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","sourceRoot":"../","sources":["Analytics/Configuration/Schema/Field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAI1C,MAAM,KAAW,KAAK,CASrB;AATD,WAAiB,KAAK;IACP,UAAI,GAAG,SAAS,CAAA;IAChB,UAAI,GAAG,SAAS,CAAA;IACjB,UAAI,GAAG,IAAI,CAAC,MAAM,CAAQ;QACtC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC1B,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,GAA2C,EAAE,CAAC,MAAA,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC;KAClG,CAAC,CAAA;AACH,CAAC,EATgB,KAAK,KAAL,KAAK,QASrB"}
@@ -0,0 +1,6 @@
1
+ import { isly } from "isly";
2
+ export type Mode = typeof Mode.values[number];
3
+ export declare namespace Mode {
4
+ const values: readonly ["NULLABLE", "REQUIRED", "REPEATED"];
5
+ const type: isly.Type<"NULLABLE" | "REQUIRED" | "REPEATED">;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { isly } from "isly";
2
+ export var Mode;
3
+ (function (Mode) {
4
+ Mode.values = ["NULLABLE", "REQUIRED", "REPEATED"];
5
+ Mode.type = isly.string(Mode.values);
6
+ })(Mode || (Mode = {}));
7
+ //# sourceMappingURL=Mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Mode.js","sourceRoot":"../","sources":["Analytics/Configuration/Schema/Mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,IAAI,CAGpB;AAHD,WAAiB,IAAI;IACP,WAAM,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;IACtD,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO,KAAA,MAAM,CAAC,CAAA;AAC9C,CAAC,EAHgB,IAAI,KAAJ,IAAI,QAGpB"}
@@ -0,0 +1,6 @@
1
+ import { isly } from "isly";
2
+ export type Type = typeof Type.values[number];
3
+ export declare namespace Type {
4
+ const values: readonly ["STRING", "BYTES", "INTEGER", "FLOAT", "NUMERIC", "BIGNUMERIC", "BOOLEAN", "TIMESTAMP", "DATE", "TIME", "DATETIME", "INTERVAL", "RECORD", "GEOGRAPHY"];
5
+ const type: isly.Type<"STRING" | "BYTES" | "INTEGER" | "FLOAT" | "NUMERIC" | "BIGNUMERIC" | "BOOLEAN" | "TIMESTAMP" | "DATE" | "TIME" | "DATETIME" | "INTERVAL" | "RECORD" | "GEOGRAPHY">;
6
+ }
@@ -0,0 +1,22 @@
1
+ import { isly } from "isly";
2
+ export var Type;
3
+ (function (Type) {
4
+ Type.values = [
5
+ "STRING",
6
+ "BYTES",
7
+ "INTEGER",
8
+ "FLOAT",
9
+ "NUMERIC",
10
+ "BIGNUMERIC",
11
+ "BOOLEAN",
12
+ "TIMESTAMP",
13
+ "DATE",
14
+ "TIME",
15
+ "DATETIME",
16
+ "INTERVAL",
17
+ "RECORD",
18
+ "GEOGRAPHY",
19
+ ];
20
+ Type.type = isly.string(Type.values);
21
+ })(Type || (Type = {}));
22
+ //# sourceMappingURL=Type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Type.js","sourceRoot":"../","sources":["Analytics/Configuration/Schema/Type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,KAAW,IAAI,CAkBpB;AAlBD,WAAiB,IAAI;IACP,WAAM,GAAG;QACrB,QAAQ;QACR,OAAO;QACP,SAAS;QACT,OAAO;QACP,SAAS;QACT,YAAY;QACZ,SAAS;QACT,WAAW;QACX,MAAM;QACN,MAAM;QACN,UAAU;QACV,UAAU;QACV,QAAQ;QACR,WAAW;KACF,CAAA;IACG,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO,KAAA,MAAM,CAAC,CAAA;AAC9C,CAAC,EAlBgB,IAAI,KAAJ,IAAI,QAkBpB"}
@@ -0,0 +1,6 @@
1
+ import { Field as SchemaField } from "./Field";
2
+ export type Schema<T extends string = string> = Schema.Field<T>[];
3
+ export declare namespace Schema {
4
+ export import Field = SchemaField;
5
+ const type: import("isly/dist/cjs/Type").Type<Field<string>[]>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { Field as SchemaField } from "./Field";
2
+ export var Schema;
3
+ (function (Schema) {
4
+ Schema.Field = SchemaField;
5
+ Schema.type = Schema.Field.type.array();
6
+ })(Schema || (Schema = {}));
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Configuration/Schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,SAAS,CAAA;AAG9C,MAAM,KAAW,MAAM,CAGtB;AAHD,WAAiB,MAAM;IACR,YAAK,GAAG,WAAW,CAAA;IACpB,WAAI,GAAG,OAAA,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;AACvC,CAAC,EAHgB,MAAM,KAAN,MAAM,QAGtB"}