@degenerate/generic 0.1.10 → 0.1.12

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 (60) hide show
  1. package/dist/authorization/jwt/sign/create-authorization-issuer.d.ts +2 -2
  2. package/dist/authorization/jwt/sign/create-authorization-issuer.d.ts.map +1 -1
  3. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts +2 -2
  4. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts.map +1 -1
  5. package/dist/authorization/jwt/sign/create-jwt-options.d.ts +2 -2
  6. package/dist/authorization/jwt/sign/create-jwt-options.d.ts.map +1 -1
  7. package/dist/authorization/safe/authorization/authorized-authorities.d.ts +5 -5
  8. package/dist/authorization/safe/authorization/authorized-authorities.d.ts.map +1 -1
  9. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts +2 -2
  10. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts.map +1 -1
  11. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts +2 -2
  12. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts.map +1 -1
  13. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts +2 -2
  14. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts.map +1 -1
  15. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts +2 -2
  16. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts.map +1 -1
  17. package/dist/models/authorization/authorization-models.d.ts +3 -3
  18. package/dist/models/authorization/authorization-models.d.ts.map +1 -1
  19. package/dist/models/authorization/authorization-models.js +3 -1
  20. package/dist/models/crypto/crypto-models.d.ts +10 -2
  21. package/dist/models/crypto/crypto-models.d.ts.map +1 -1
  22. package/dist/models/crypto/crypto-models.js +6 -0
  23. package/dist/models/data/data-models.d.ts +18 -5
  24. package/dist/models/data/data-models.d.ts.map +1 -1
  25. package/dist/models/data/data-models.js +24 -1
  26. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts +13 -3
  27. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts.map +1 -1
  28. package/dist/models/dynamic-execution/dynamic-execution-models.js +10 -0
  29. package/dist/models/events/share-event-models.d.ts +145 -24
  30. package/dist/models/events/share-event-models.d.ts.map +1 -1
  31. package/dist/models/events/share-event-models.js +53 -2
  32. package/dist/models/functions/share-data-function-models.d.ts +251 -32
  33. package/dist/models/functions/share-data-function-models.d.ts.map +1 -1
  34. package/dist/models/functions/share-data-function-models.js +100 -3
  35. package/dist/models/generic/request-response-models.d.ts +11 -3
  36. package/dist/models/generic/request-response-models.d.ts.map +1 -1
  37. package/dist/models/generic/request-response-models.js +9 -0
  38. package/dist/models/index.d.ts +2 -0
  39. package/dist/models/index.d.ts.map +1 -1
  40. package/dist/models/index.js +6 -0
  41. package/dist/models/rules/share-rule-models.d.ts +1355 -130
  42. package/dist/models/rules/share-rule-models.d.ts.map +1 -1
  43. package/dist/models/rules/share-rule-models.js +342 -38
  44. package/dist/models/safe/safe-transaction-models.d.ts +31 -40
  45. package/dist/models/safe/safe-transaction-models.d.ts.map +1 -1
  46. package/dist/models/safe/safe-transaction-models.js +49 -3
  47. package/dist/models/safe/transactions/authorities-transactions-models.d.ts +518 -0
  48. package/dist/models/safe/transactions/authorities-transactions-models.d.ts.map +1 -0
  49. package/dist/models/safe/transactions/authorities-transactions-models.js +97 -0
  50. package/dist/models/safe/transactions/rules-transactions-models.d.ts +628 -0
  51. package/dist/models/safe/transactions/rules-transactions-models.d.ts.map +1 -0
  52. package/dist/models/safe/transactions/rules-transactions-models.js +73 -0
  53. package/dist/models/share-data/share-data.d.ts +143 -18
  54. package/dist/models/share-data/share-data.d.ts.map +1 -1
  55. package/dist/models/share-data/share-data.js +61 -1
  56. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts +4 -3
  57. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -1
  58. package/dist/transactions/authority/create-safe-transaction-authority.d.ts +2 -1
  59. package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -1
  60. package/package.json +2 -2
@@ -0,0 +1,518 @@
1
+ import z from 'zod';
2
+ import { SAFETransactionType } from '../safe-transaction-models';
3
+ /**
4
+ * This is the data for the authority in the SAFE Ecosystem.
5
+ */
6
+ export declare const ISAFETransactionAuthorityDataSchema: z.ZodObject<{
7
+ authorizationIssuer: z.ZodString;
8
+ authorizationPublicKey: z.ZodString;
9
+ authorityValidationType: z.ZodEnum<["JWT"]>;
10
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
11
+ }, "strip", z.ZodTypeAny, {
12
+ authorizationIssuer: string;
13
+ authorizationPublicKey: string;
14
+ authorityValidationType: "JWT";
15
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
16
+ }, {
17
+ authorizationIssuer: string;
18
+ authorizationPublicKey: string;
19
+ authorityValidationType: "JWT";
20
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
21
+ }>;
22
+ export type ISAFETransactionAuthorityData = z.infer<typeof ISAFETransactionAuthorityDataSchema>;
23
+ /**
24
+ * This is the transaction targetting an authority in the SAFE Ecosystem.
25
+ *
26
+ const sampleTransactionAuthority: ISAFETransactionAuthority = {
27
+ createdAt: Date.now(),
28
+ authority: '0xAuthorityPublicKey',
29
+ authoritySignature: '0xAuthoritySignature',
30
+ transaction: {
31
+ type: SAFETransactionType.AUTHORITY,
32
+ action: SAFETransactionActionType.CREATE,
33
+ data: {
34
+ authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
35
+ authorizationPublicKey: '0xAuthorizationPublicKey',
36
+ authorityValidationType: AuthorityValidationType.JWT,
37
+ authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
38
+ },
39
+ },
40
+ version: 1,
41
+ };
42
+ */
43
+ export declare const ISAFETransactionAuthoritySchema: z.ZodObject<z.objectUtil.extendShape<{
44
+ createdAt: z.ZodNumber;
45
+ authority: z.ZodString;
46
+ authoritySignature: z.ZodString;
47
+ transaction: z.ZodObject<{
48
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
49
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
52
+ action: "ADD" | "DELETE" | "UPDATE";
53
+ }, {
54
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
55
+ action: "ADD" | "DELETE" | "UPDATE";
56
+ }>;
57
+ version: z.ZodNumber;
58
+ }, {
59
+ transaction: z.ZodObject<{
60
+ type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
61
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
62
+ data: z.ZodObject<{
63
+ authorizationIssuer: z.ZodString;
64
+ authorizationPublicKey: z.ZodString;
65
+ authorityValidationType: z.ZodEnum<["JWT"]>;
66
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
67
+ }, "strip", z.ZodTypeAny, {
68
+ authorizationIssuer: string;
69
+ authorizationPublicKey: string;
70
+ authorityValidationType: "JWT";
71
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
72
+ }, {
73
+ authorizationIssuer: string;
74
+ authorizationPublicKey: string;
75
+ authorityValidationType: "JWT";
76
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
77
+ }>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ type: SAFETransactionType.AUTHORITY;
80
+ action: "ADD" | "DELETE" | "UPDATE";
81
+ data: {
82
+ authorizationIssuer: string;
83
+ authorizationPublicKey: string;
84
+ authorityValidationType: "JWT";
85
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
86
+ };
87
+ }, {
88
+ type: SAFETransactionType.AUTHORITY;
89
+ action: "ADD" | "DELETE" | "UPDATE";
90
+ data: {
91
+ authorizationIssuer: string;
92
+ authorizationPublicKey: string;
93
+ authorityValidationType: "JWT";
94
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
95
+ };
96
+ }>;
97
+ }>, "strip", z.ZodTypeAny, {
98
+ createdAt: number;
99
+ version: number;
100
+ authority: string;
101
+ authoritySignature: string;
102
+ transaction: {
103
+ type: SAFETransactionType.AUTHORITY;
104
+ action: "ADD" | "DELETE" | "UPDATE";
105
+ data: {
106
+ authorizationIssuer: string;
107
+ authorizationPublicKey: string;
108
+ authorityValidationType: "JWT";
109
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
110
+ };
111
+ };
112
+ }, {
113
+ createdAt: number;
114
+ version: number;
115
+ authority: string;
116
+ authoritySignature: string;
117
+ transaction: {
118
+ type: SAFETransactionType.AUTHORITY;
119
+ action: "ADD" | "DELETE" | "UPDATE";
120
+ data: {
121
+ authorizationIssuer: string;
122
+ authorizationPublicKey: string;
123
+ authorityValidationType: "JWT";
124
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
125
+ };
126
+ };
127
+ }>;
128
+ export type ISAFETransactionAuthority = z.infer<typeof ISAFETransactionAuthoritySchema>;
129
+ /**
130
+ * This is the transaction targetting an authority in the SAFE Ecosystem.
131
+ *
132
+ const sampleTransactionAuthority: ISAFETransactionAuthority = {
133
+ createdAt: Date.now(),
134
+ authority: '0xAuthorityPublicKey',
135
+ authoritySignature: '0xAuthoritySignature',
136
+ transaction: {
137
+ type: SAFETransactionType.AUTHORITY,
138
+ action: SAFETransactionActionType.CREATE,
139
+ data: {
140
+ authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
141
+ authorizationPublicKey: '0xAuthorizationPublicKey',
142
+ authorityValidationType: AuthorityValidationType.JWT,
143
+ authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
144
+ },
145
+ },
146
+ version: 1,
147
+ };
148
+ */
149
+ /**
150
+ * This is the schema for the authority transaction add.
151
+ */
152
+ export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
153
+ createdAt: z.ZodNumber;
154
+ authority: z.ZodString;
155
+ authoritySignature: z.ZodString;
156
+ transaction: z.ZodObject<{
157
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
158
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
161
+ action: "ADD" | "DELETE" | "UPDATE";
162
+ }, {
163
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
164
+ action: "ADD" | "DELETE" | "UPDATE";
165
+ }>;
166
+ version: z.ZodNumber;
167
+ }, {
168
+ transaction: z.ZodObject<{
169
+ type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
170
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
171
+ data: z.ZodObject<{
172
+ authorizationIssuer: z.ZodString;
173
+ authorizationPublicKey: z.ZodString;
174
+ authorityValidationType: z.ZodEnum<["JWT"]>;
175
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
176
+ }, "strip", z.ZodTypeAny, {
177
+ authorizationIssuer: string;
178
+ authorizationPublicKey: string;
179
+ authorityValidationType: "JWT";
180
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
181
+ }, {
182
+ authorizationIssuer: string;
183
+ authorizationPublicKey: string;
184
+ authorityValidationType: "JWT";
185
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
186
+ }>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ type: SAFETransactionType.AUTHORITY;
189
+ action: "ADD" | "DELETE" | "UPDATE";
190
+ data: {
191
+ authorizationIssuer: string;
192
+ authorizationPublicKey: string;
193
+ authorityValidationType: "JWT";
194
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
195
+ };
196
+ }, {
197
+ type: SAFETransactionType.AUTHORITY;
198
+ action: "ADD" | "DELETE" | "UPDATE";
199
+ data: {
200
+ authorizationIssuer: string;
201
+ authorizationPublicKey: string;
202
+ authorityValidationType: "JWT";
203
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
204
+ };
205
+ }>;
206
+ }>, {
207
+ transaction: z.ZodObject<{
208
+ action: z.ZodLiteral<"ADD">;
209
+ data: z.ZodObject<{
210
+ authorizationIssuer: z.ZodString;
211
+ authorizationPublicKey: z.ZodString;
212
+ authorityValidationType: z.ZodEnum<["JWT"]>;
213
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
214
+ }, "strip", z.ZodTypeAny, {
215
+ authorizationIssuer: string;
216
+ authorizationPublicKey: string;
217
+ authorityValidationType: "JWT";
218
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
219
+ }, {
220
+ authorizationIssuer: string;
221
+ authorizationPublicKey: string;
222
+ authorityValidationType: "JWT";
223
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
224
+ }>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ action: "ADD";
227
+ data: {
228
+ authorizationIssuer: string;
229
+ authorizationPublicKey: string;
230
+ authorityValidationType: "JWT";
231
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
232
+ };
233
+ }, {
234
+ action: "ADD";
235
+ data: {
236
+ authorizationIssuer: string;
237
+ authorizationPublicKey: string;
238
+ authorityValidationType: "JWT";
239
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
240
+ };
241
+ }>;
242
+ }>, "strip", z.ZodTypeAny, {
243
+ createdAt: number;
244
+ version: number;
245
+ authority: string;
246
+ authoritySignature: string;
247
+ transaction: {
248
+ action: "ADD";
249
+ data: {
250
+ authorizationIssuer: string;
251
+ authorizationPublicKey: string;
252
+ authorityValidationType: "JWT";
253
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
254
+ };
255
+ };
256
+ }, {
257
+ createdAt: number;
258
+ version: number;
259
+ authority: string;
260
+ authoritySignature: string;
261
+ transaction: {
262
+ action: "ADD";
263
+ data: {
264
+ authorizationIssuer: string;
265
+ authorizationPublicKey: string;
266
+ authorityValidationType: "JWT";
267
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
268
+ };
269
+ };
270
+ }>;
271
+ export type ISAFETransactionAuthorityAdd = z.infer<typeof ISAFETransactionAuthorityAddSchema>;
272
+ /**
273
+ * This is the schema for the authority transaction update.
274
+ */
275
+ export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
276
+ createdAt: z.ZodNumber;
277
+ authority: z.ZodString;
278
+ authoritySignature: z.ZodString;
279
+ transaction: z.ZodObject<{
280
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
281
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
284
+ action: "ADD" | "DELETE" | "UPDATE";
285
+ }, {
286
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
287
+ action: "ADD" | "DELETE" | "UPDATE";
288
+ }>;
289
+ version: z.ZodNumber;
290
+ }, {
291
+ transaction: z.ZodObject<{
292
+ type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
293
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
294
+ data: z.ZodObject<{
295
+ authorizationIssuer: z.ZodString;
296
+ authorizationPublicKey: z.ZodString;
297
+ authorityValidationType: z.ZodEnum<["JWT"]>;
298
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
299
+ }, "strip", z.ZodTypeAny, {
300
+ authorizationIssuer: string;
301
+ authorizationPublicKey: string;
302
+ authorityValidationType: "JWT";
303
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
304
+ }, {
305
+ authorizationIssuer: string;
306
+ authorizationPublicKey: string;
307
+ authorityValidationType: "JWT";
308
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
309
+ }>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ type: SAFETransactionType.AUTHORITY;
312
+ action: "ADD" | "DELETE" | "UPDATE";
313
+ data: {
314
+ authorizationIssuer: string;
315
+ authorizationPublicKey: string;
316
+ authorityValidationType: "JWT";
317
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
318
+ };
319
+ }, {
320
+ type: SAFETransactionType.AUTHORITY;
321
+ action: "ADD" | "DELETE" | "UPDATE";
322
+ data: {
323
+ authorizationIssuer: string;
324
+ authorizationPublicKey: string;
325
+ authorityValidationType: "JWT";
326
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
327
+ };
328
+ }>;
329
+ }>, {
330
+ transaction: z.ZodObject<{
331
+ action: z.ZodLiteral<"UPDATE">;
332
+ data: z.ZodObject<{
333
+ authorizationIssuer: z.ZodString;
334
+ authorizationPublicKey: z.ZodString;
335
+ authorityValidationType: z.ZodEnum<["JWT"]>;
336
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
337
+ }, "strip", z.ZodTypeAny, {
338
+ authorizationIssuer: string;
339
+ authorizationPublicKey: string;
340
+ authorityValidationType: "JWT";
341
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
342
+ }, {
343
+ authorizationIssuer: string;
344
+ authorizationPublicKey: string;
345
+ authorityValidationType: "JWT";
346
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
347
+ }>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ action: "UPDATE";
350
+ data: {
351
+ authorizationIssuer: string;
352
+ authorizationPublicKey: string;
353
+ authorityValidationType: "JWT";
354
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
355
+ };
356
+ }, {
357
+ action: "UPDATE";
358
+ data: {
359
+ authorizationIssuer: string;
360
+ authorizationPublicKey: string;
361
+ authorityValidationType: "JWT";
362
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
363
+ };
364
+ }>;
365
+ }>, "strip", z.ZodTypeAny, {
366
+ createdAt: number;
367
+ version: number;
368
+ authority: string;
369
+ authoritySignature: string;
370
+ transaction: {
371
+ action: "UPDATE";
372
+ data: {
373
+ authorizationIssuer: string;
374
+ authorizationPublicKey: string;
375
+ authorityValidationType: "JWT";
376
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
377
+ };
378
+ };
379
+ }, {
380
+ createdAt: number;
381
+ version: number;
382
+ authority: string;
383
+ authoritySignature: string;
384
+ transaction: {
385
+ action: "UPDATE";
386
+ data: {
387
+ authorizationIssuer: string;
388
+ authorizationPublicKey: string;
389
+ authorityValidationType: "JWT";
390
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
391
+ };
392
+ };
393
+ }>;
394
+ export type ISAFETransactionAuthorityUpdate = z.infer<typeof ISAFETransactionAuthorityUpdateSchema>;
395
+ /**
396
+ * This is the schema for the authority transaction remove.
397
+ */
398
+ export declare const ISAFETransactionAuthorityDeleteSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
399
+ createdAt: z.ZodNumber;
400
+ authority: z.ZodString;
401
+ authoritySignature: z.ZodString;
402
+ transaction: z.ZodObject<{
403
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
404
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
407
+ action: "ADD" | "DELETE" | "UPDATE";
408
+ }, {
409
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
410
+ action: "ADD" | "DELETE" | "UPDATE";
411
+ }>;
412
+ version: z.ZodNumber;
413
+ }, {
414
+ transaction: z.ZodObject<{
415
+ type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
416
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
417
+ data: z.ZodObject<{
418
+ authorizationIssuer: z.ZodString;
419
+ authorizationPublicKey: z.ZodString;
420
+ authorityValidationType: z.ZodEnum<["JWT"]>;
421
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
422
+ }, "strip", z.ZodTypeAny, {
423
+ authorizationIssuer: string;
424
+ authorizationPublicKey: string;
425
+ authorityValidationType: "JWT";
426
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
427
+ }, {
428
+ authorizationIssuer: string;
429
+ authorizationPublicKey: string;
430
+ authorityValidationType: "JWT";
431
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
432
+ }>;
433
+ }, "strip", z.ZodTypeAny, {
434
+ type: SAFETransactionType.AUTHORITY;
435
+ action: "ADD" | "DELETE" | "UPDATE";
436
+ data: {
437
+ authorizationIssuer: string;
438
+ authorizationPublicKey: string;
439
+ authorityValidationType: "JWT";
440
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
441
+ };
442
+ }, {
443
+ type: SAFETransactionType.AUTHORITY;
444
+ action: "ADD" | "DELETE" | "UPDATE";
445
+ data: {
446
+ authorizationIssuer: string;
447
+ authorizationPublicKey: string;
448
+ authorityValidationType: "JWT";
449
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
450
+ };
451
+ }>;
452
+ }>, {
453
+ transaction: z.ZodObject<{
454
+ action: z.ZodLiteral<"DELETE">;
455
+ data: z.ZodObject<{
456
+ authorizationIssuer: z.ZodString;
457
+ authorizationPublicKey: z.ZodString;
458
+ authorityValidationType: z.ZodEnum<["JWT"]>;
459
+ authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
460
+ }, "strip", z.ZodTypeAny, {
461
+ authorizationIssuer: string;
462
+ authorizationPublicKey: string;
463
+ authorityValidationType: "JWT";
464
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
465
+ }, {
466
+ authorizationIssuer: string;
467
+ authorizationPublicKey: string;
468
+ authorityValidationType: "JWT";
469
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
470
+ }>;
471
+ }, "strip", z.ZodTypeAny, {
472
+ action: "DELETE";
473
+ data: {
474
+ authorizationIssuer: string;
475
+ authorizationPublicKey: string;
476
+ authorityValidationType: "JWT";
477
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
478
+ };
479
+ }, {
480
+ action: "DELETE";
481
+ data: {
482
+ authorizationIssuer: string;
483
+ authorizationPublicKey: string;
484
+ authorityValidationType: "JWT";
485
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
486
+ };
487
+ }>;
488
+ }>, "strip", z.ZodTypeAny, {
489
+ createdAt: number;
490
+ version: number;
491
+ authority: string;
492
+ authoritySignature: string;
493
+ transaction: {
494
+ action: "DELETE";
495
+ data: {
496
+ authorizationIssuer: string;
497
+ authorizationPublicKey: string;
498
+ authorityValidationType: "JWT";
499
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
500
+ };
501
+ };
502
+ }, {
503
+ createdAt: number;
504
+ version: number;
505
+ authority: string;
506
+ authoritySignature: string;
507
+ transaction: {
508
+ action: "DELETE";
509
+ data: {
510
+ authorizationIssuer: string;
511
+ authorizationPublicKey: string;
512
+ authorityValidationType: "JWT";
513
+ authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
514
+ };
515
+ };
516
+ }>;
517
+ export type ISAFETransactionAuthorityDelete = z.infer<typeof ISAFETransactionAuthorityDeleteSchema>;
518
+ //# sourceMappingURL=authorities-transactions-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorities-transactions-models.d.ts","sourceRoot":"","sources":["../../../../src/models/safe/transactions/authorities-transactions-models.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,EAGH,mBAAmB,EAEtB,MAAM,4BAA4B,CAAC;AAOpC;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;EAK9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ISAFETransactionAuthorityDeleteSchema = exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthoritySchema = exports.ISAFETransactionAuthorityDataSchema = void 0;
7
+ // This contains the schemas for the authorities transaction models
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const authorization_models_1 = require("../../authorization/authorization-models");
10
+ const safe_transaction_models_1 = require("../safe-transaction-models");
11
+ //#region Authorities Transaction
12
+ // const AuthorizationIssuerSchema = z.string().regex(/^[a-zA-Z0-9]+-[a-zA-Z0-9]+$/);
13
+ // const AuthorityValidationTypeSchema = z.enum(['JWT']);
14
+ /**
15
+ * This is the data for the authority in the SAFE Ecosystem.
16
+ */
17
+ exports.ISAFETransactionAuthorityDataSchema = zod_1.default.object({
18
+ authorizationIssuer: authorization_models_1.AuthorizationIssuerSchema,
19
+ authorizationPublicKey: zod_1.default.string(),
20
+ authorityValidationType: authorization_models_1.AuthorityValidationTypeSchema,
21
+ authorityOver: zod_1.default.array(safe_transaction_models_1.SAFETransactionTypeSchema),
22
+ });
23
+ /**
24
+ * This is the transaction targetting an authority in the SAFE Ecosystem.
25
+ *
26
+ const sampleTransactionAuthority: ISAFETransactionAuthority = {
27
+ createdAt: Date.now(),
28
+ authority: '0xAuthorityPublicKey',
29
+ authoritySignature: '0xAuthoritySignature',
30
+ transaction: {
31
+ type: SAFETransactionType.AUTHORITY,
32
+ action: SAFETransactionActionType.CREATE,
33
+ data: {
34
+ authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
35
+ authorizationPublicKey: '0xAuthorizationPublicKey',
36
+ authorityValidationType: AuthorityValidationType.JWT,
37
+ authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
38
+ },
39
+ },
40
+ version: 1,
41
+ };
42
+ */
43
+ exports.ISAFETransactionAuthoritySchema = safe_transaction_models_1.ISAFETransactionBaseSchema.extend({
44
+ transaction: zod_1.default.object({
45
+ type: zod_1.default.literal(safe_transaction_models_1.SAFETransactionType.AUTHORITY),
46
+ action: safe_transaction_models_1.SAFETransactionActionTypeSchema,
47
+ data: exports.ISAFETransactionAuthorityDataSchema,
48
+ }),
49
+ });
50
+ //#endregion Authorities Transaction
51
+ /**
52
+ * This is the transaction targetting an authority in the SAFE Ecosystem.
53
+ *
54
+ const sampleTransactionAuthority: ISAFETransactionAuthority = {
55
+ createdAt: Date.now(),
56
+ authority: '0xAuthorityPublicKey',
57
+ authoritySignature: '0xAuthoritySignature',
58
+ transaction: {
59
+ type: SAFETransactionType.AUTHORITY,
60
+ action: SAFETransactionActionType.CREATE,
61
+ data: {
62
+ authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
63
+ authorizationPublicKey: '0xAuthorizationPublicKey',
64
+ authorityValidationType: AuthorityValidationType.JWT,
65
+ authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
66
+ },
67
+ },
68
+ version: 1,
69
+ };
70
+ */
71
+ /**
72
+ * This is the schema for the authority transaction add.
73
+ */
74
+ exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthoritySchema.extend({
75
+ transaction: zod_1.default.object({
76
+ action: zod_1.default.literal(safe_transaction_models_1.SAFETransactionActionTypeSchema.Enum.ADD),
77
+ data: exports.ISAFETransactionAuthorityDataSchema,
78
+ }),
79
+ });
80
+ /**
81
+ * This is the schema for the authority transaction update.
82
+ */
83
+ exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthoritySchema.extend({
84
+ transaction: zod_1.default.object({
85
+ action: zod_1.default.literal(safe_transaction_models_1.SAFETransactionActionTypeSchema.Enum.UPDATE),
86
+ data: exports.ISAFETransactionAuthorityDataSchema,
87
+ }),
88
+ });
89
+ /**
90
+ * This is the schema for the authority transaction remove.
91
+ */
92
+ exports.ISAFETransactionAuthorityDeleteSchema = exports.ISAFETransactionAuthoritySchema.extend({
93
+ transaction: zod_1.default.object({
94
+ action: zod_1.default.literal(safe_transaction_models_1.SAFETransactionActionTypeSchema.Enum.DELETE),
95
+ data: exports.ISAFETransactionAuthorityDataSchema,
96
+ }),
97
+ });