@degenerate/generic 0.1.9 → 0.1.11

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 (95) hide show
  1. package/dist/application/audit-log/create-application-audit-log.d.ts.map +1 -1
  2. package/dist/application/audit-log/create-application-audit-log.js +1 -1
  3. package/dist/application/database/firestore/generics/add-items-to-database.d.ts.map +1 -1
  4. package/dist/application/database/firestore/generics/add-items-to-database.js +2 -2
  5. package/dist/application/database/firestore/generics/add-or-update-items-to-database.d.ts.map +1 -1
  6. package/dist/application/database/firestore/generics/add-or-update-items-to-database.js +3 -3
  7. package/dist/application/database/firestore/generics/delete-items-on-database.d.ts.map +1 -1
  8. package/dist/application/database/firestore/generics/delete-items-on-database.js +2 -2
  9. package/dist/application/database/firestore/generics/get-item-from-database.d.ts.map +1 -1
  10. package/dist/application/database/firestore/generics/get-item-from-database.js +2 -2
  11. package/dist/application/database/firestore/generics/get-items-different-path-on-database.d.ts.map +1 -1
  12. package/dist/application/database/firestore/generics/get-items-different-path-on-database.js +2 -2
  13. package/dist/application/database/firestore/generics/get-items-from-database.d.ts.map +1 -1
  14. package/dist/application/database/firestore/generics/get-items-from-database.js +2 -2
  15. package/dist/application/database/firestore/generics/update-items-on-database.d.ts.map +1 -1
  16. package/dist/application/database/firestore/generics/update-items-on-database.js +2 -2
  17. package/dist/application/database/firestore/generics/update-items-properties-on-database.d.ts.map +1 -1
  18. package/dist/application/database/firestore/generics/update-items-properties-on-database.js +2 -2
  19. package/dist/authorization/jwt/sign/create-authorization-issuer.d.ts +2 -2
  20. package/dist/authorization/jwt/sign/create-authorization-issuer.d.ts.map +1 -1
  21. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts +2 -2
  22. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts.map +1 -1
  23. package/dist/authorization/jwt/sign/create-jwt-options.d.ts +2 -2
  24. package/dist/authorization/jwt/sign/create-jwt-options.d.ts.map +1 -1
  25. package/dist/authorization/safe/authorization/authorized-authorities.d.ts +5 -5
  26. package/dist/authorization/safe/authorization/authorized-authorities.d.ts.map +1 -1
  27. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts +2 -2
  28. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts.map +1 -1
  29. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts +2 -2
  30. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts.map +1 -1
  31. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts +2 -2
  32. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts.map +1 -1
  33. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts +2 -2
  34. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts.map +1 -1
  35. package/dist/helpers/request/params-object-helpers.d.ts +7 -1
  36. package/dist/helpers/request/params-object-helpers.d.ts.map +1 -1
  37. package/dist/helpers/request/params-object-helpers.js +10 -1
  38. package/dist/helpers/request/request-object-helpers.d.ts +16 -1
  39. package/dist/helpers/request/request-object-helpers.d.ts.map +1 -1
  40. package/dist/helpers/request/request-object-helpers.js +25 -2
  41. package/dist/models/application/audit-log/application-audit-log-models.d.ts +144 -60
  42. package/dist/models/application/audit-log/application-audit-log-models.d.ts.map +1 -1
  43. package/dist/models/application/audit-log/application-audit-log-models.js +87 -41
  44. package/dist/models/application/database/firestore-models.d.ts +370 -54
  45. package/dist/models/application/database/firestore-models.d.ts.map +1 -1
  46. package/dist/models/application/database/firestore-models.js +119 -1
  47. package/dist/models/authorization/authorization-models.d.ts +76 -33
  48. package/dist/models/authorization/authorization-models.d.ts.map +1 -1
  49. package/dist/models/authorization/authorization-models.js +82 -12
  50. package/dist/models/crypto/crypto-models.d.ts +10 -2
  51. package/dist/models/crypto/crypto-models.d.ts.map +1 -1
  52. package/dist/models/crypto/crypto-models.js +6 -0
  53. package/dist/models/data/data-models.d.ts +18 -5
  54. package/dist/models/data/data-models.d.ts.map +1 -1
  55. package/dist/models/data/data-models.js +24 -1
  56. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts +13 -3
  57. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts.map +1 -1
  58. package/dist/models/dynamic-execution/dynamic-execution-models.js +10 -0
  59. package/dist/models/events/share-event-models.d.ts +145 -24
  60. package/dist/models/events/share-event-models.d.ts.map +1 -1
  61. package/dist/models/events/share-event-models.js +53 -2
  62. package/dist/models/functions/share-data-function-models.d.ts +251 -32
  63. package/dist/models/functions/share-data-function-models.d.ts.map +1 -1
  64. package/dist/models/functions/share-data-function-models.js +100 -3
  65. package/dist/models/generic/request-response-models.d.ts +11 -3
  66. package/dist/models/generic/request-response-models.d.ts.map +1 -1
  67. package/dist/models/generic/request-response-models.js +9 -0
  68. package/dist/models/index.d.ts +2 -1
  69. package/dist/models/index.d.ts.map +1 -1
  70. package/dist/models/index.js +6 -1
  71. package/dist/models/safe/rules/share-rule-models.d.ts +931 -0
  72. package/dist/models/safe/rules/share-rule-models.d.ts.map +1 -0
  73. package/dist/models/safe/rules/share-rule-models.js +341 -0
  74. package/dist/models/safe/safe-transaction-models.d.ts +137 -20
  75. package/dist/models/safe/safe-transaction-models.d.ts.map +1 -1
  76. package/dist/models/safe/safe-transaction-models.js +88 -3
  77. package/dist/models/safe/transactions/authorities-transactions-models.d.ts +391 -0
  78. package/dist/models/safe/transactions/authorities-transactions-models.d.ts.map +1 -0
  79. package/dist/models/safe/transactions/authorities-transactions-models.js +56 -0
  80. package/dist/models/share-data/share-data.d.ts +144 -23
  81. package/dist/models/share-data/share-data.d.ts.map +1 -1
  82. package/dist/models/share-data/share-data.js +66 -1
  83. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts +14 -0
  84. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -0
  85. package/dist/transactions/authority/create-safe-transaction-authority-data.js +21 -0
  86. package/dist/transactions/authority/create-safe-transaction-authority.d.ts +15 -0
  87. package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -0
  88. package/dist/transactions/authority/create-safe-transaction-authority.js +29 -0
  89. package/dist/transactions/index.d.ts +3 -0
  90. package/dist/transactions/index.d.ts.map +1 -0
  91. package/dist/transactions/index.js +20 -0
  92. package/package.json +2 -2
  93. package/dist/models/rules/share-rule-models.d.ts +0 -303
  94. package/dist/models/rules/share-rule-models.d.ts.map +0 -1
  95. package/dist/models/rules/share-rule-models.js +0 -93
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShareDataEventSchema = exports.IShareDataEventSchema = exports.ShareDataAndFunctionEventSchema = exports.ShareDataEventProcessingTypeSchema = exports.ShareDataEventProcessingType = exports.EventSourceTruthProofTypeSchema = exports.EventSourceTruthProofType = exports.EventSourceTruthTypeSchema = exports.EventSourceTruthType = exports.ShareEventTypeSchema = exports.ShareEventType = void 0;
4
+ const zod_1 = require("zod");
2
5
  /**
3
6
  * This contains the interfaces for all event data types that can be run on the network.
4
7
  */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ShareDataEventProcessingType = exports.EventSourceTruthProofType = exports.EventSourceTruthType = exports.ShareEventType = void 0;
7
8
  //#region Share Event Data Enums
8
9
  /**
9
10
  * This is the types of events that can be run on the network.
@@ -14,6 +15,11 @@ var ShareEventType;
14
15
  ShareEventType["DataChange"] = "DataChange";
15
16
  ShareEventType["Scheduled"] = "Scheduled";
16
17
  })(ShareEventType || (exports.ShareEventType = ShareEventType = {}));
18
+ exports.ShareEventTypeSchema = zod_1.z.enum([
19
+ 'Application',
20
+ 'DataChange',
21
+ 'Scheduled',
22
+ ]);
17
23
  /**
18
24
  * All sources of event trusts
19
25
  */
@@ -23,6 +29,11 @@ var EventSourceTruthType;
23
29
  EventSourceTruthType["Oauth"] = "Oauth";
24
30
  EventSourceTruthType["ShareBlock"] = "ShareBlock";
25
31
  })(EventSourceTruthType || (exports.EventSourceTruthType = EventSourceTruthType = {}));
32
+ exports.EventSourceTruthTypeSchema = zod_1.z.enum([
33
+ 'Crypto',
34
+ 'Oauth',
35
+ 'ShareBlock',
36
+ ]);
26
37
  /**
27
38
  * All the types of proofs that can be sent from the sources of event execution truths.
28
39
  */
@@ -31,6 +42,10 @@ var EventSourceTruthProofType;
31
42
  EventSourceTruthProofType["Hash"] = "Hash";
32
43
  EventSourceTruthProofType["Signature"] = "Signature";
33
44
  })(EventSourceTruthProofType || (exports.EventSourceTruthProofType = EventSourceTruthProofType = {}));
45
+ exports.EventSourceTruthProofTypeSchema = zod_1.z.enum([
46
+ 'Hash',
47
+ 'Signature',
48
+ ]);
34
49
  /**
35
50
  * This is the type of processing that can be done on the share data event.
36
51
  */
@@ -39,6 +54,42 @@ var ShareDataEventProcessingType;
39
54
  ShareDataEventProcessingType["Parallel"] = "parallel";
40
55
  ShareDataEventProcessingType["Linear"] = "linear";
41
56
  })(ShareDataEventProcessingType || (exports.ShareDataEventProcessingType = ShareDataEventProcessingType = {}));
57
+ exports.ShareDataEventProcessingTypeSchema = zod_1.z.enum([
58
+ 'parallel',
59
+ 'linear',
60
+ ]);
61
+ //#endregion Share Event Data Enums
62
+ /**
63
+ * This is all data that is required to find the sharedata and function to execute.
64
+ */
65
+ exports.ShareDataAndFunctionEventSchema = zod_1.z.object({
66
+ shareDataId: zod_1.z.string(),
67
+ functionId: zod_1.z.string(),
68
+ shareDataInputs: zod_1.z.array(zod_1.z.string()),
69
+ inputs: zod_1.z.any(),
70
+ });
71
+ /**
72
+ * This is the interface for the share data event.
73
+ */
74
+ exports.IShareDataEventSchema = zod_1.z.object({
75
+ shareData: zod_1.z.array(exports.ShareDataAndFunctionEventSchema), // the data required to find an execute a function in the network. These run in order of the items in the array.
76
+ processingType: exports.ShareDataEventProcessingTypeSchema, // specifies whether to process the shareData in parallel or linear order.
77
+ });
78
+ /**
79
+ * This is the interface for the share data event.
80
+ */
81
+ exports.ShareDataEventSchema = zod_1.z.object({
82
+ eventId: zod_1.z.string(),
83
+ locked: zod_1.z.boolean(),
84
+ eventType: exports.ShareEventTypeSchema,
85
+ eventSource: zod_1.z.string(),
86
+ eventSourceTruthType: exports.EventSourceTruthTypeSchema,
87
+ eventSourceTruthProofType: exports.EventSourceTruthProofTypeSchema,
88
+ eventSourceTruthProof: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.instanceof(Buffer)]),
89
+ triggerCondition: zod_1.z.function().args(zod_1.z.any()).returns(zod_1.z.boolean()),
90
+ shareDataEventInformation: zod_1.z.array(exports.IShareDataEventSchema),
91
+ eventContext: zod_1.z.record(zod_1.z.any()),
92
+ });
42
93
  // const applicationEvent: ShareDataEvent = {
43
94
  // eventId: 'appEvent123',
44
95
  // eventType: 'Application',
@@ -1,86 +1,305 @@
1
+ import { z } from 'zod';
1
2
  /**
2
- * This contains the data for the sahre functions
3
+ * This contains the data for the share functions
3
4
  */
4
- /**
5
- * This is the incoming object for the share functions.
6
- */
7
- export interface ITargetObject {
8
- [key: string]: unknown;
9
- }
10
5
  /**
11
6
  * This contains all the proof types that exist for the network.
12
7
  */
13
8
  export declare enum INetworkProofType {
14
9
  CRYPTOGRAPHIC_SIGNATURE = "CRYPTOGRAPHIC_SIGNATURE"
15
10
  }
11
+ export declare const INetworkProofTypeSchema: z.ZodEnum<["CRYPTOGRAPHIC_SIGNATURE"]>;
16
12
  /**
17
- * This contains the network proof for the share data network functions.
13
+ * This is the incoming object for the share functions.
18
14
  */
19
- export type INetworkProof = ICryptographicSignatureProof;
15
+ export declare const ITargetObjectSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
16
+ export type ITargetObject = Record<string, unknown>;
20
17
  /**
21
18
  * This contains the cryptographic signature proof for the share data network functions.
22
19
  */
23
- export interface ICryptographicSignatureProof {
20
+ export declare const ICryptographicSignatureProofSchema: z.ZodObject<{
21
+ publicKey: z.ZodString;
22
+ signature: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
24
  publicKey: string;
25
25
  signature: string;
26
- }
26
+ }, {
27
+ publicKey: string;
28
+ signature: string;
29
+ }>;
30
+ export type ICryptographicSignatureProof = z.infer<typeof ICryptographicSignatureProofSchema>;
31
+ /**
32
+ * This contains the network proof for the share data network functions.
33
+ */
34
+ export declare const INetworkProofSchema: z.ZodObject<{
35
+ publicKey: z.ZodString;
36
+ signature: z.ZodString;
37
+ }, "strip", z.ZodTypeAny, {
38
+ publicKey: string;
39
+ signature: string;
40
+ }, {
41
+ publicKey: string;
42
+ signature: string;
43
+ }>;
44
+ export type INetworkProof = z.infer<typeof INetworkProofSchema>;
27
45
  /**
28
46
  * This contains the data for a share data network function without the signature
29
47
  */
30
- export interface IShareDataFunctionBasic {
48
+ export declare const IShareDataFunctionBasicSchema: z.ZodObject<{
49
+ createdAt: z.ZodNumber;
50
+ previousHash: z.ZodString;
51
+ stringifiedFunction: z.ZodString;
52
+ currentHash: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
31
54
  createdAt: number;
32
55
  previousHash: string;
33
56
  stringifiedFunction: string;
34
57
  currentHash: string;
35
- }
58
+ }, {
59
+ createdAt: number;
60
+ previousHash: string;
61
+ stringifiedFunction: string;
62
+ currentHash: string;
63
+ }>;
64
+ export type IShareDataFunctionBasic = z.infer<typeof IShareDataFunctionBasicSchema>;
36
65
  /**
37
- * This contains the data for a share data network function.
66
+ * This contains a share data function
38
67
  */
39
- export interface IShareDataFunction extends IShareDataFunctionBasic {
40
- proof: INetworkProof;
41
- proofType: INetworkProofType;
42
- }
68
+ export declare const IShareDataFunctionSchema: z.ZodObject<{
69
+ proof: z.ZodObject<{
70
+ publicKey: z.ZodString;
71
+ signature: z.ZodString;
72
+ }, "strip", z.ZodTypeAny, {
73
+ publicKey: string;
74
+ signature: string;
75
+ }, {
76
+ publicKey: string;
77
+ signature: string;
78
+ }>;
79
+ proofType: z.ZodEnum<["CRYPTOGRAPHIC_SIGNATURE"]>;
80
+ createdAt: z.ZodNumber;
81
+ previousHash: z.ZodString;
82
+ stringifiedFunction: z.ZodString;
83
+ currentHash: z.ZodString;
84
+ }, "strip", z.ZodTypeAny, {
85
+ createdAt: number;
86
+ previousHash: string;
87
+ stringifiedFunction: string;
88
+ currentHash: string;
89
+ proof: {
90
+ publicKey: string;
91
+ signature: string;
92
+ };
93
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
94
+ }, {
95
+ createdAt: number;
96
+ previousHash: string;
97
+ stringifiedFunction: string;
98
+ currentHash: string;
99
+ proof: {
100
+ publicKey: string;
101
+ signature: string;
102
+ };
103
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
104
+ }>;
105
+ export type IShareDataFunction = z.infer<typeof IShareDataFunctionSchema>;
43
106
  /**
44
107
  * This contains a share data network function
45
108
  */
46
- export interface IShareDataNetworkFunction {
109
+ export declare const IShareDataNetworkFunctionSchema: z.ZodObject<{
110
+ id: z.ZodString;
111
+ name: z.ZodString;
112
+ description: z.ZodString;
113
+ shareDataFunctions: z.ZodArray<z.ZodObject<{
114
+ proof: z.ZodObject<{
115
+ publicKey: z.ZodString;
116
+ signature: z.ZodString;
117
+ }, "strip", z.ZodTypeAny, {
118
+ publicKey: string;
119
+ signature: string;
120
+ }, {
121
+ publicKey: string;
122
+ signature: string;
123
+ }>;
124
+ proofType: z.ZodEnum<["CRYPTOGRAPHIC_SIGNATURE"]>;
125
+ createdAt: z.ZodNumber;
126
+ previousHash: z.ZodString;
127
+ stringifiedFunction: z.ZodString;
128
+ currentHash: z.ZodString;
129
+ }, "strip", z.ZodTypeAny, {
130
+ createdAt: number;
131
+ previousHash: string;
132
+ stringifiedFunction: string;
133
+ currentHash: string;
134
+ proof: {
135
+ publicKey: string;
136
+ signature: string;
137
+ };
138
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
139
+ }, {
140
+ createdAt: number;
141
+ previousHash: string;
142
+ stringifiedFunction: string;
143
+ currentHash: string;
144
+ proof: {
145
+ publicKey: string;
146
+ signature: string;
147
+ };
148
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
149
+ }>, "many">;
150
+ proof: z.ZodObject<{
151
+ publicKey: z.ZodString;
152
+ signature: z.ZodString;
153
+ }, "strip", z.ZodTypeAny, {
154
+ publicKey: string;
155
+ signature: string;
156
+ }, {
157
+ publicKey: string;
158
+ signature: string;
159
+ }>;
160
+ proofType: z.ZodEnum<["CRYPTOGRAPHIC_SIGNATURE"]>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ proof: {
163
+ publicKey: string;
164
+ signature: string;
165
+ };
166
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
47
167
  id: string;
48
168
  name: string;
49
169
  description: string;
50
- shareDataFunctions: IShareDataFunction[];
51
- proof: INetworkProof;
52
- proofType: INetworkProofType;
53
- }
54
- export interface IShareDataNetworkFunctionDescriptor {
170
+ shareDataFunctions: {
171
+ createdAt: number;
172
+ previousHash: string;
173
+ stringifiedFunction: string;
174
+ currentHash: string;
175
+ proof: {
176
+ publicKey: string;
177
+ signature: string;
178
+ };
179
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
180
+ }[];
181
+ }, {
182
+ proof: {
183
+ publicKey: string;
184
+ signature: string;
185
+ };
186
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
187
+ id: string;
188
+ name: string;
189
+ description: string;
190
+ shareDataFunctions: {
191
+ createdAt: number;
192
+ previousHash: string;
193
+ stringifiedFunction: string;
194
+ currentHash: string;
195
+ proof: {
196
+ publicKey: string;
197
+ signature: string;
198
+ };
199
+ proofType: "CRYPTOGRAPHIC_SIGNATURE";
200
+ }[];
201
+ }>;
202
+ export type IShareDataNetworkFunction = z.infer<typeof IShareDataNetworkFunctionSchema>;
203
+ /**
204
+ * This contains the data for a share data network function descriptor.
205
+ */
206
+ export declare const IShareDataNetworkFunctionDescriptorSchema: z.ZodObject<{
207
+ functionNumber: z.ZodNumber;
208
+ name: z.ZodString;
209
+ description: z.ZodString;
210
+ }, "strip", z.ZodTypeAny, {
211
+ name: string;
212
+ description: string;
55
213
  functionNumber: number;
214
+ }, {
56
215
  name: string;
57
216
  description: string;
58
- }
217
+ functionNumber: number;
218
+ }>;
219
+ export type IShareDataNetworkFunctionDescriptor = z.infer<typeof IShareDataNetworkFunctionDescriptorSchema>;
59
220
  /**
60
221
  * This contains the data for a share data network rule that is the basic shape.
61
222
  */
62
- export interface IShareDataRuleBasic {
223
+ export declare const IShareDataRuleBasicSchema: z.ZodObject<{
224
+ createdAt: z.ZodNumber;
225
+ previousHash: z.ZodString;
226
+ stringifiedRule: z.ZodString;
227
+ currentHash: z.ZodString;
228
+ }, "strip", z.ZodTypeAny, {
63
229
  createdAt: number;
64
230
  previousHash: string;
231
+ currentHash: string;
65
232
  stringifiedRule: string;
233
+ }, {
234
+ createdAt: number;
235
+ previousHash: string;
66
236
  currentHash: string;
67
- }
237
+ stringifiedRule: string;
238
+ }>;
239
+ export type IShareDataRuleBasic = z.infer<typeof IShareDataRuleBasicSchema>;
68
240
  /**
69
241
  * This contains the interface for a share function record in the share data object
70
242
  */
71
- export interface IShareDataNetworkRule {
243
+ export declare const IShareDataNetworkRuleSchema: z.ZodObject<{
244
+ id: z.ZodString;
245
+ shareDataRules: z.ZodArray<z.ZodObject<{
246
+ createdAt: z.ZodNumber;
247
+ previousHash: z.ZodString;
248
+ stringifiedRule: z.ZodString;
249
+ currentHash: z.ZodString;
250
+ }, "strip", z.ZodTypeAny, {
251
+ createdAt: number;
252
+ previousHash: string;
253
+ currentHash: string;
254
+ stringifiedRule: string;
255
+ }, {
256
+ createdAt: number;
257
+ previousHash: string;
258
+ currentHash: string;
259
+ stringifiedRule: string;
260
+ }>, "many">;
261
+ applicationId: z.ZodString;
262
+ applicationIdProof: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
72
264
  id: string;
73
- shareDataRules: IShareDataRule[];
265
+ shareDataRules: {
266
+ createdAt: number;
267
+ previousHash: string;
268
+ currentHash: string;
269
+ stringifiedRule: string;
270
+ }[];
74
271
  applicationId: string;
75
272
  applicationIdProof: string;
76
- }
273
+ }, {
274
+ id: string;
275
+ shareDataRules: {
276
+ createdAt: number;
277
+ previousHash: string;
278
+ currentHash: string;
279
+ stringifiedRule: string;
280
+ }[];
281
+ applicationId: string;
282
+ applicationIdProof: string;
283
+ }>;
284
+ export type IShareDataNetworkRule = z.infer<typeof IShareDataNetworkRuleSchema>;
77
285
  /**
78
286
  * This contains the data for a share data network rule.
79
287
  */
80
- export interface IShareDataRule {
288
+ export declare const IShareDataRuleSchema: z.ZodObject<{
289
+ createdAt: z.ZodNumber;
290
+ previousHash: z.ZodString;
291
+ stringifiedRule: z.ZodString;
292
+ currentHash: z.ZodString;
293
+ }, "strip", z.ZodTypeAny, {
81
294
  createdAt: number;
82
295
  previousHash: string;
296
+ currentHash: string;
83
297
  stringifiedRule: string;
298
+ }, {
299
+ createdAt: number;
300
+ previousHash: string;
84
301
  currentHash: string;
85
- }
302
+ stringifiedRule: string;
303
+ }>;
304
+ export type IShareDataRule = z.infer<typeof IShareDataRuleSchema>;
86
305
  //# sourceMappingURL=share-data-function-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"share-data-function-models.d.ts","sourceRoot":"","sources":["../../../src/models/functions/share-data-function-models.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,uBAAuB,4BAA4B;CACtD;AACD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AACD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IAC/D,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,iBAAiB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;IACzC,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,mCAAmC;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACvB;AAGD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACvB"}
1
+ {"version":3,"file":"share-data-function-models.d.ts","sourceRoot":"","sources":["../../../src/models/functions/share-data-function-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB;;GAEG;AAKH;;GAEG;AACH,oBAAY,iBAAiB;IACzB,uBAAuB,4BAA4B;CACtD;AAED,eAAO,MAAM,uBAAuB,wCAElC,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,mBAAmB,wCAAwB,CAAC;AACzD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;EAAqC,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EAKxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAiBpF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;EAIpD,CAAC;AAEH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IShareDataRuleSchema = exports.IShareDataNetworkRuleSchema = exports.IShareDataRuleBasicSchema = exports.IShareDataNetworkFunctionDescriptorSchema = exports.IShareDataNetworkFunctionSchema = exports.IShareDataFunctionSchema = exports.IShareDataFunctionBasicSchema = exports.INetworkProofSchema = exports.ICryptographicSignatureProofSchema = exports.ITargetObjectSchema = exports.INetworkProofTypeSchema = exports.INetworkProofType = void 0;
4
+ const zod_1 = require("zod");
2
5
  /**
3
- * This contains the data for the sahre functions
6
+ * This contains the data for the share functions
4
7
  */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.INetworkProofType = void 0;
8
+ //#region enum
7
9
  /**
8
10
  * This contains all the proof types that exist for the network.
9
11
  */
@@ -11,6 +13,101 @@ var INetworkProofType;
11
13
  (function (INetworkProofType) {
12
14
  INetworkProofType["CRYPTOGRAPHIC_SIGNATURE"] = "CRYPTOGRAPHIC_SIGNATURE";
13
15
  })(INetworkProofType || (exports.INetworkProofType = INetworkProofType = {}));
16
+ exports.INetworkProofTypeSchema = zod_1.z.enum([
17
+ 'CRYPTOGRAPHIC_SIGNATURE',
18
+ ]);
19
+ //#endregion enum
20
+ /**
21
+ * This is the incoming object for the share functions.
22
+ */
23
+ exports.ITargetObjectSchema = zod_1.z.record(zod_1.z.unknown());
24
+ /**
25
+ * This contains the cryptographic signature proof for the share data network functions.
26
+ */
27
+ exports.ICryptographicSignatureProofSchema = zod_1.z.object({
28
+ publicKey: zod_1.z.string(), // the public key of the signature
29
+ signature: zod_1.z.string(), // the cryptographic signature
30
+ });
31
+ /**
32
+ * This contains the network proof for the share data network functions.
33
+ */
34
+ exports.INetworkProofSchema = exports.ICryptographicSignatureProofSchema;
35
+ /**
36
+ * This contains the data for a share data network function without the signature
37
+ */
38
+ exports.IShareDataFunctionBasicSchema = zod_1.z.object({
39
+ createdAt: zod_1.z.number(), // the time the function was created (in milliseconds)
40
+ previousHash: zod_1.z.string(), // the previous hash of the function
41
+ stringifiedFunction: zod_1.z.string(), // the stringified function
42
+ currentHash: zod_1.z.string(), // the hash of the stringified function + previous hash
43
+ });
44
+ // const shareDataFunction: IShareDataFunction = {
45
+ // createdAt: 1234567890,
46
+ // previousHash: 'example-previous-hash',
47
+ // stringifiedFunction: 'example-stringified-function',
48
+ // currentHash: 'example-current-hash',
49
+ // // Properties specific to IShareDataFunction
50
+ // proof: {
51
+ // signature: 'example-signature',
52
+ // publicKey: 'example-public-key',
53
+ // // Add other properties of ICryptographicSignatureProof as needed
54
+ // },
55
+ // proofType: INetworkProofType.CRYPTOGRAPHIC_SIGNATURE,
56
+ // };
57
+ /**
58
+ * This contains a share data function
59
+ */
60
+ exports.IShareDataFunctionSchema = zod_1.z.object({
61
+ ...exports.IShareDataFunctionBasicSchema.shape,
62
+ proof: exports.INetworkProofSchema, // the proof that the function is valid
63
+ proofType: exports.INetworkProofTypeSchema, // the type of proof
64
+ });
65
+ /**
66
+ * This contains a share data network function
67
+ */
68
+ exports.IShareDataNetworkFunctionSchema = zod_1.z.object({
69
+ id: zod_1.z.string(), // the id of the function (this will be the original hex representation of the following fields)
70
+ name: zod_1.z.string(), // the name of the function
71
+ description: zod_1.z.string(), // the description of the function
72
+ shareDataFunctions: zod_1.z.array(exports.IShareDataFunctionSchema), // the stringified function
73
+ proof: exports.INetworkProofSchema, // the proof that the function is valid
74
+ proofType: exports.INetworkProofTypeSchema, // the type of proof
75
+ });
76
+ /**
77
+ * This contains the data for a share data network function descriptor.
78
+ */
79
+ exports.IShareDataNetworkFunctionDescriptorSchema = zod_1.z.object({
80
+ functionNumber: zod_1.z.number(), // the number of the function in the list
81
+ name: zod_1.z.string(), // the name of the function
82
+ description: zod_1.z.string(), // the description of the function
83
+ });
84
+ /**
85
+ * This contains the data for a share data network rule that is the basic shape.
86
+ */
87
+ exports.IShareDataRuleBasicSchema = zod_1.z.object({
88
+ createdAt: zod_1.z.number(), // the time the rule was created (in milliseconds)
89
+ previousHash: zod_1.z.string(), // the previous hash of the rule
90
+ stringifiedRule: zod_1.z.string(), // the stringified rule
91
+ currentHash: zod_1.z.string(), // the hash of the stringified rule + previous hash
92
+ });
93
+ /**
94
+ * This contains the interface for a share function record in the share data object
95
+ */
96
+ exports.IShareDataNetworkRuleSchema = zod_1.z.object({
97
+ id: zod_1.z.string(), // the id of the rule (this will be the original hex representation of the following fields)
98
+ shareDataRules: zod_1.z.array(exports.IShareDataRuleBasicSchema), // the stringified rule
99
+ applicationId: zod_1.z.string(), // the application id that owns the rule
100
+ applicationIdProof: zod_1.z.string(), // the proof that the application id owns the rule
101
+ });
102
+ /**
103
+ * This contains the data for a share data network rule.
104
+ */
105
+ exports.IShareDataRuleSchema = zod_1.z.object({
106
+ createdAt: zod_1.z.number(), // the time the rule was created (in milliseconds)
107
+ previousHash: zod_1.z.string(), // the previous hash of the rule
108
+ stringifiedRule: zod_1.z.string(), // the stringified rule
109
+ currentHash: zod_1.z.string(), // the hash of the stringified rule + previous hash
110
+ });
14
111
  /// Use of user defined function in the share data
15
112
  /// Storage / Retrieval of the user defined functions in the network. (logic library)
16
113
  // Use of user defined rules in the share data (product)
@@ -1,8 +1,16 @@
1
+ import { z } from 'zod';
1
2
  /**
2
3
  * This contains a generic response of the application when complex or other data is not required.
3
4
  */
4
- export interface IGenericResponse {
5
+ export declare const IGenericResponseSchema: z.ZodObject<{
6
+ successful: z.ZodBoolean;
7
+ error: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
5
9
  successful: boolean;
6
- error?: string;
7
- }
10
+ error?: string | undefined;
11
+ }, {
12
+ successful: boolean;
13
+ error?: string | undefined;
14
+ }>;
15
+ export type IGenericResponse = z.infer<typeof IGenericResponseSchema>;
8
16
  //# sourceMappingURL=request-response-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-response-models.d.ts","sourceRoot":"","sources":["../../../src/models/generic/request-response-models.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"request-response-models.d.ts","sourceRoot":"","sources":["../../../src/models/generic/request-response-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,2 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IGenericResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * This contains a generic response of the application when complex or other data is not required.
7
+ */
8
+ exports.IGenericResponseSchema = zod_1.z.object({
9
+ successful: zod_1.z.boolean(), // whether the request was successful
10
+ error: zod_1.z.string().optional(), // the error of the request
11
+ });
@@ -7,7 +7,8 @@ export * from './dynamic-execution/dynamic-execution-models';
7
7
  export * from './events/share-event-models';
8
8
  export * from './functions/share-data-function-models';
9
9
  export * from './generic/request-response-models';
10
- export * from './rules/share-rule-models';
10
+ export * from './safe/rules/share-rule-models';
11
+ export * from './safe/transactions/authorities-transactions-models';
11
12
  export * from './safe/safe-transaction-models';
12
13
  export * from './share-data/share-data';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAEA,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAEA,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAElD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,qDAAqD,CAAC;AAEpE,cAAc,gCAAgC,CAAC;AAG/C,cAAc,yBAAyB,CAAC"}
@@ -24,6 +24,11 @@ __exportStar(require("./dynamic-execution/dynamic-execution-models"), exports);
24
24
  __exportStar(require("./events/share-event-models"), exports);
25
25
  __exportStar(require("./functions/share-data-function-models"), exports);
26
26
  __exportStar(require("./generic/request-response-models"), exports);
27
- __exportStar(require("./rules/share-rule-models"), exports);
27
+ //#region safe
28
+ __exportStar(require("./safe/rules/share-rule-models"), exports);
29
+ //#region transactions
30
+ __exportStar(require("./safe/transactions/authorities-transactions-models"), exports);
28
31
  __exportStar(require("./safe/safe-transaction-models"), exports);
32
+ //#endregion transactions
33
+ //#endregion safe
29
34
  __exportStar(require("./share-data/share-data"), exports);