@degenerate/generic 0.2.6 → 0.2.7

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.
@@ -47,5 +47,12 @@ declare const getParamEventId: (req: any) => string;
47
47
  * @returns
48
48
  */
49
49
  declare const getAuthorityId: (req: any) => string;
50
- export { getParamShareDataId, getParamFunctionId, getParamRulesId, getParamRuleSetsId, getParamEventId, getAuthorityId, };
50
+ /**
51
+ * The function gets the function id from the restful parameter object
52
+ *
53
+ * @param req the incoming request
54
+ * @returns
55
+ */
56
+ declare const getFunctionId: (req: any) => string;
57
+ export { getParamShareDataId, getParamFunctionId, getParamRulesId, getParamRuleSetsId, getParamEventId, getAuthorityId, getFunctionId };
51
58
  //# sourceMappingURL=params-object-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"params-object-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/request/params-object-helpers.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAIH;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,KAAG,MAEvC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,KAAG,MAElC,CAAA;AAID,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,GACjB,CAAA"}
1
+ {"version":3,"file":"params-object-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/request/params-object-helpers.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAIH;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,KAAG,MAEvC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,KAAG,MAElC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,aAAa,QAAS,GAAG,KAAG,MAEjC,CAAA;AAID,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,aAAa,EAChB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  // This file contains the functions to get the incoming params in the request object.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getAuthorityId = exports.getParamEventId = exports.getParamRuleSetsId = exports.getParamRulesId = exports.getParamFunctionId = exports.getParamShareDataId = void 0;
5
+ exports.getFunctionId = exports.getAuthorityId = exports.getParamEventId = exports.getParamRuleSetsId = exports.getParamRulesId = exports.getParamFunctionId = exports.getParamShareDataId = void 0;
6
6
  /**
7
7
  * The pattern for this is:
8
8
  * Parameters are always in the request object and lowercase.
@@ -71,3 +71,13 @@ const getAuthorityId = (req) => {
71
71
  return req.params.authorityid;
72
72
  };
73
73
  exports.getAuthorityId = getAuthorityId;
74
+ /**
75
+ * The function gets the function id from the restful parameter object
76
+ *
77
+ * @param req the incoming request
78
+ * @returns
79
+ */
80
+ const getFunctionId = (req) => {
81
+ return req.params.functionid;
82
+ };
83
+ exports.getFunctionId = getFunctionId;
@@ -102,7 +102,7 @@ export declare const ShareDataEventSchema: z.ZodObject<{
102
102
  eventSource: z.ZodString;
103
103
  eventSourceTruthType: z.ZodEnum<["Crypto", "Oauth", "ShareBlock"]>;
104
104
  eventSourceTruthProofType: z.ZodEnum<["Hash", "Signature"]>;
105
- EventSourceTruthProof: z.ZodString;
105
+ eventSourceTruthProof: z.ZodString;
106
106
  triggerCondition: z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodBoolean>;
107
107
  shareDataEventInformation: z.ZodArray<z.ZodObject<{
108
108
  shareData: z.ZodArray<z.ZodObject<{
@@ -147,7 +147,7 @@ export declare const ShareDataEventSchema: z.ZodObject<{
147
147
  eventSource: string;
148
148
  eventSourceTruthType: "Crypto" | "Oauth" | "ShareBlock";
149
149
  eventSourceTruthProofType: "Hash" | "Signature";
150
- EventSourceTruthProof: string;
150
+ eventSourceTruthProof: string;
151
151
  triggerCondition: (args_0: any, ...args: unknown[]) => boolean;
152
152
  shareDataEventInformation: {
153
153
  shareData: {
@@ -166,7 +166,7 @@ export declare const ShareDataEventSchema: z.ZodObject<{
166
166
  eventSource: string;
167
167
  eventSourceTruthType: "Crypto" | "Oauth" | "ShareBlock";
168
168
  eventSourceTruthProofType: "Hash" | "Signature";
169
- EventSourceTruthProof: string;
169
+ eventSourceTruthProof: string;
170
170
  triggerCondition: (args_0: any, ...args: unknown[]) => boolean;
171
171
  shareDataEventInformation: {
172
172
  shareData: {
@@ -95,7 +95,7 @@ exports.ShareDataEventSchema = zod_1.z.object({
95
95
  eventSource: zod_1.z.string(),
96
96
  eventSourceTruthType: exports.EventSourceTruthTypeSchema,
97
97
  eventSourceTruthProofType: exports.EventSourceTruthProofTypeSchema,
98
- EventSourceTruthProof: zod_1.z.string(),
98
+ eventSourceTruthProof: zod_1.z.string(),
99
99
  // eventSourceTruthProof: z.union([z.string(), BufferSchema]),
100
100
  triggerCondition: zod_1.z.function().args(zod_1.z.any()).returns(zod_1.z.boolean()),
101
101
  shareDataEventInformation: zod_1.z.array(exports.IShareDataEventSchema),
@@ -9,7 +9,10 @@ export * from './functions/share-data-function-models';
9
9
  export * from './generic/request-response-models';
10
10
  export * from './rules/share-rule-models';
11
11
  export * from './safe/transactions/authorities-transactions-models';
12
+ export * from './safe/transactions/events-transactions-models';
13
+ export * from './safe/transactions/functions-transactions-models';
12
14
  export * from './safe/transactions/rules-transactions-models';
15
+ export * from './safe/transactions/sharedata-transactions-models';
13
16
  export * from './safe/safe-transaction-models';
14
17
  export * from './share-data/share-data';
15
18
  //# 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;AAElD,cAAc,2BAA2B,CAAC;AAE1C,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gCAAgC,CAAC;AAG/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,2BAA2B,CAAC;AAE1C,cAAc,qDAAqD,CAAC;AACpE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,gCAAgC,CAAC;AAG/C,cAAc,yBAAyB,CAAC"}
@@ -28,7 +28,10 @@ __exportStar(require("./generic/request-response-models"), exports);
28
28
  __exportStar(require("./rules/share-rule-models"), exports);
29
29
  //#region transactions
30
30
  __exportStar(require("./safe/transactions/authorities-transactions-models"), exports);
31
+ __exportStar(require("./safe/transactions/events-transactions-models"), exports);
32
+ __exportStar(require("./safe/transactions/functions-transactions-models"), exports);
31
33
  __exportStar(require("./safe/transactions/rules-transactions-models"), exports);
34
+ __exportStar(require("./safe/transactions/sharedata-transactions-models"), exports);
32
35
  __exportStar(require("./safe/safe-transaction-models"), exports);
33
36
  //#endregion transactions
34
37
  //#endregion safe
@@ -0,0 +1,439 @@
1
+ import { z } from 'zod';
2
+ import { SAFETransactionType, SAFETransactionActionType } from '../safe-transaction-models';
3
+ /**
4
+ * This is the data for the event in the SAFE Ecosystem.
5
+ */
6
+ export declare const ISAFETransactionEventDataSchema: z.ZodObject<{
7
+ eventId: z.ZodString;
8
+ eventType: z.ZodString;
9
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ eventId: string;
12
+ eventType: string;
13
+ eventData: Record<string, any>;
14
+ }, {
15
+ eventId: string;
16
+ eventType: string;
17
+ eventData: Record<string, any>;
18
+ }>;
19
+ export type ISAFETransactionEventData = z.infer<typeof ISAFETransactionEventDataSchema>;
20
+ /**
21
+ * This is the transaction targeting an event in the SAFE Ecosystem.
22
+ */
23
+ export declare const ISAFETransactionEventSchema: z.ZodObject<z.objectUtil.extendShape<{
24
+ createdAt: z.ZodNumber;
25
+ authority: z.ZodString;
26
+ authoritySignature: z.ZodString;
27
+ transaction: z.ZodObject<{
28
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
29
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
32
+ action: "ADD" | "DELETE" | "UPDATE";
33
+ }, {
34
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
35
+ action: "ADD" | "DELETE" | "UPDATE";
36
+ }>;
37
+ version: z.ZodNumber;
38
+ }, {
39
+ transaction: z.ZodObject<{
40
+ type: z.ZodLiteral<SAFETransactionType.EVENTS>;
41
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
42
+ data: z.ZodObject<{
43
+ eventId: z.ZodString;
44
+ eventType: z.ZodString;
45
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ eventId: string;
48
+ eventType: string;
49
+ eventData: Record<string, any>;
50
+ }, {
51
+ eventId: string;
52
+ eventType: string;
53
+ eventData: Record<string, any>;
54
+ }>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ type: SAFETransactionType.EVENTS;
57
+ action: "ADD" | "DELETE" | "UPDATE";
58
+ data: {
59
+ eventId: string;
60
+ eventType: string;
61
+ eventData: Record<string, any>;
62
+ };
63
+ }, {
64
+ type: SAFETransactionType.EVENTS;
65
+ action: "ADD" | "DELETE" | "UPDATE";
66
+ data: {
67
+ eventId: string;
68
+ eventType: string;
69
+ eventData: Record<string, any>;
70
+ };
71
+ }>;
72
+ version: z.ZodNumber;
73
+ }>, "strip", z.ZodTypeAny, {
74
+ createdAt: number;
75
+ version: number;
76
+ authority: string;
77
+ authoritySignature: string;
78
+ transaction: {
79
+ type: SAFETransactionType.EVENTS;
80
+ action: "ADD" | "DELETE" | "UPDATE";
81
+ data: {
82
+ eventId: string;
83
+ eventType: string;
84
+ eventData: Record<string, any>;
85
+ };
86
+ };
87
+ }, {
88
+ createdAt: number;
89
+ version: number;
90
+ authority: string;
91
+ authoritySignature: string;
92
+ transaction: {
93
+ type: SAFETransactionType.EVENTS;
94
+ action: "ADD" | "DELETE" | "UPDATE";
95
+ data: {
96
+ eventId: string;
97
+ eventType: string;
98
+ eventData: Record<string, any>;
99
+ };
100
+ };
101
+ }>;
102
+ export type ISAFETransactionEvent = z.infer<typeof ISAFETransactionEventSchema>;
103
+ /**
104
+ * This is the schema for the event transaction add.
105
+ */
106
+ export declare const ISAFETransactionEventAddSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
107
+ createdAt: z.ZodNumber;
108
+ authority: z.ZodString;
109
+ authoritySignature: z.ZodString;
110
+ transaction: z.ZodObject<{
111
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
112
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
115
+ action: "ADD" | "DELETE" | "UPDATE";
116
+ }, {
117
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
118
+ action: "ADD" | "DELETE" | "UPDATE";
119
+ }>;
120
+ version: z.ZodNumber;
121
+ }, {
122
+ transaction: z.ZodObject<{
123
+ type: z.ZodLiteral<SAFETransactionType.EVENTS>;
124
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
125
+ data: z.ZodObject<{
126
+ eventId: z.ZodString;
127
+ eventType: z.ZodString;
128
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ eventId: string;
131
+ eventType: string;
132
+ eventData: Record<string, any>;
133
+ }, {
134
+ eventId: string;
135
+ eventType: string;
136
+ eventData: Record<string, any>;
137
+ }>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ type: SAFETransactionType.EVENTS;
140
+ action: "ADD" | "DELETE" | "UPDATE";
141
+ data: {
142
+ eventId: string;
143
+ eventType: string;
144
+ eventData: Record<string, any>;
145
+ };
146
+ }, {
147
+ type: SAFETransactionType.EVENTS;
148
+ action: "ADD" | "DELETE" | "UPDATE";
149
+ data: {
150
+ eventId: string;
151
+ eventType: string;
152
+ eventData: Record<string, any>;
153
+ };
154
+ }>;
155
+ version: z.ZodNumber;
156
+ }>, {
157
+ transaction: z.ZodObject<{
158
+ action: z.ZodLiteral<SAFETransactionActionType.ADD>;
159
+ data: z.ZodObject<{
160
+ eventId: z.ZodString;
161
+ eventType: z.ZodString;
162
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ eventId: string;
165
+ eventType: string;
166
+ eventData: Record<string, any>;
167
+ }, {
168
+ eventId: string;
169
+ eventType: string;
170
+ eventData: Record<string, any>;
171
+ }>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ action: SAFETransactionActionType.ADD;
174
+ data: {
175
+ eventId: string;
176
+ eventType: string;
177
+ eventData: Record<string, any>;
178
+ };
179
+ }, {
180
+ action: SAFETransactionActionType.ADD;
181
+ data: {
182
+ eventId: string;
183
+ eventType: string;
184
+ eventData: Record<string, any>;
185
+ };
186
+ }>;
187
+ }>, "strip", z.ZodTypeAny, {
188
+ createdAt: number;
189
+ version: number;
190
+ authority: string;
191
+ authoritySignature: string;
192
+ transaction: {
193
+ action: SAFETransactionActionType.ADD;
194
+ data: {
195
+ eventId: string;
196
+ eventType: string;
197
+ eventData: Record<string, any>;
198
+ };
199
+ };
200
+ }, {
201
+ createdAt: number;
202
+ version: number;
203
+ authority: string;
204
+ authoritySignature: string;
205
+ transaction: {
206
+ action: SAFETransactionActionType.ADD;
207
+ data: {
208
+ eventId: string;
209
+ eventType: string;
210
+ eventData: Record<string, any>;
211
+ };
212
+ };
213
+ }>;
214
+ export type ISAFETransactionEventAdd = z.infer<typeof ISAFETransactionEventAddSchema>;
215
+ /**
216
+ * This is the schema for the event transaction update.
217
+ */
218
+ export declare const ISAFETransactionEventUpdateSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
219
+ createdAt: z.ZodNumber;
220
+ authority: z.ZodString;
221
+ authoritySignature: z.ZodString;
222
+ transaction: z.ZodObject<{
223
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
224
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
227
+ action: "ADD" | "DELETE" | "UPDATE";
228
+ }, {
229
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
230
+ action: "ADD" | "DELETE" | "UPDATE";
231
+ }>;
232
+ version: z.ZodNumber;
233
+ }, {
234
+ transaction: z.ZodObject<{
235
+ type: z.ZodLiteral<SAFETransactionType.EVENTS>;
236
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
237
+ data: z.ZodObject<{
238
+ eventId: z.ZodString;
239
+ eventType: z.ZodString;
240
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ eventId: string;
243
+ eventType: string;
244
+ eventData: Record<string, any>;
245
+ }, {
246
+ eventId: string;
247
+ eventType: string;
248
+ eventData: Record<string, any>;
249
+ }>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ type: SAFETransactionType.EVENTS;
252
+ action: "ADD" | "DELETE" | "UPDATE";
253
+ data: {
254
+ eventId: string;
255
+ eventType: string;
256
+ eventData: Record<string, any>;
257
+ };
258
+ }, {
259
+ type: SAFETransactionType.EVENTS;
260
+ action: "ADD" | "DELETE" | "UPDATE";
261
+ data: {
262
+ eventId: string;
263
+ eventType: string;
264
+ eventData: Record<string, any>;
265
+ };
266
+ }>;
267
+ version: z.ZodNumber;
268
+ }>, {
269
+ transaction: z.ZodObject<{
270
+ action: z.ZodLiteral<SAFETransactionActionType.UPDATE>;
271
+ data: z.ZodObject<{
272
+ eventId: z.ZodString;
273
+ eventType: z.ZodString;
274
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
275
+ }, "strip", z.ZodTypeAny, {
276
+ eventId: string;
277
+ eventType: string;
278
+ eventData: Record<string, any>;
279
+ }, {
280
+ eventId: string;
281
+ eventType: string;
282
+ eventData: Record<string, any>;
283
+ }>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ action: SAFETransactionActionType.UPDATE;
286
+ data: {
287
+ eventId: string;
288
+ eventType: string;
289
+ eventData: Record<string, any>;
290
+ };
291
+ }, {
292
+ action: SAFETransactionActionType.UPDATE;
293
+ data: {
294
+ eventId: string;
295
+ eventType: string;
296
+ eventData: Record<string, any>;
297
+ };
298
+ }>;
299
+ }>, "strip", z.ZodTypeAny, {
300
+ createdAt: number;
301
+ version: number;
302
+ authority: string;
303
+ authoritySignature: string;
304
+ transaction: {
305
+ action: SAFETransactionActionType.UPDATE;
306
+ data: {
307
+ eventId: string;
308
+ eventType: string;
309
+ eventData: Record<string, any>;
310
+ };
311
+ };
312
+ }, {
313
+ createdAt: number;
314
+ version: number;
315
+ authority: string;
316
+ authoritySignature: string;
317
+ transaction: {
318
+ action: SAFETransactionActionType.UPDATE;
319
+ data: {
320
+ eventId: string;
321
+ eventType: string;
322
+ eventData: Record<string, any>;
323
+ };
324
+ };
325
+ }>;
326
+ export type ISAFETransactionEventUpdate = z.infer<typeof ISAFETransactionEventUpdateSchema>;
327
+ /**
328
+ * This is the schema for the event transaction delete.
329
+ */
330
+ export declare const ISAFETransactionEventDeleteSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
331
+ createdAt: z.ZodNumber;
332
+ authority: z.ZodString;
333
+ authoritySignature: z.ZodString;
334
+ transaction: z.ZodObject<{
335
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
336
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
339
+ action: "ADD" | "DELETE" | "UPDATE";
340
+ }, {
341
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
342
+ action: "ADD" | "DELETE" | "UPDATE";
343
+ }>;
344
+ version: z.ZodNumber;
345
+ }, {
346
+ transaction: z.ZodObject<{
347
+ type: z.ZodLiteral<SAFETransactionType.EVENTS>;
348
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
349
+ data: z.ZodObject<{
350
+ eventId: z.ZodString;
351
+ eventType: z.ZodString;
352
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
353
+ }, "strip", z.ZodTypeAny, {
354
+ eventId: string;
355
+ eventType: string;
356
+ eventData: Record<string, any>;
357
+ }, {
358
+ eventId: string;
359
+ eventType: string;
360
+ eventData: Record<string, any>;
361
+ }>;
362
+ }, "strip", z.ZodTypeAny, {
363
+ type: SAFETransactionType.EVENTS;
364
+ action: "ADD" | "DELETE" | "UPDATE";
365
+ data: {
366
+ eventId: string;
367
+ eventType: string;
368
+ eventData: Record<string, any>;
369
+ };
370
+ }, {
371
+ type: SAFETransactionType.EVENTS;
372
+ action: "ADD" | "DELETE" | "UPDATE";
373
+ data: {
374
+ eventId: string;
375
+ eventType: string;
376
+ eventData: Record<string, any>;
377
+ };
378
+ }>;
379
+ version: z.ZodNumber;
380
+ }>, {
381
+ transaction: z.ZodObject<{
382
+ action: z.ZodLiteral<SAFETransactionActionType.DELETE>;
383
+ data: z.ZodObject<{
384
+ eventId: z.ZodString;
385
+ eventType: z.ZodString;
386
+ eventData: z.ZodRecord<z.ZodString, z.ZodAny>;
387
+ }, "strip", z.ZodTypeAny, {
388
+ eventId: string;
389
+ eventType: string;
390
+ eventData: Record<string, any>;
391
+ }, {
392
+ eventId: string;
393
+ eventType: string;
394
+ eventData: Record<string, any>;
395
+ }>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ action: SAFETransactionActionType.DELETE;
398
+ data: {
399
+ eventId: string;
400
+ eventType: string;
401
+ eventData: Record<string, any>;
402
+ };
403
+ }, {
404
+ action: SAFETransactionActionType.DELETE;
405
+ data: {
406
+ eventId: string;
407
+ eventType: string;
408
+ eventData: Record<string, any>;
409
+ };
410
+ }>;
411
+ }>, "strip", z.ZodTypeAny, {
412
+ createdAt: number;
413
+ version: number;
414
+ authority: string;
415
+ authoritySignature: string;
416
+ transaction: {
417
+ action: SAFETransactionActionType.DELETE;
418
+ data: {
419
+ eventId: string;
420
+ eventType: string;
421
+ eventData: Record<string, any>;
422
+ };
423
+ };
424
+ }, {
425
+ createdAt: number;
426
+ version: number;
427
+ authority: string;
428
+ authoritySignature: string;
429
+ transaction: {
430
+ action: SAFETransactionActionType.DELETE;
431
+ data: {
432
+ eventId: string;
433
+ eventType: string;
434
+ eventData: Record<string, any>;
435
+ };
436
+ };
437
+ }>;
438
+ export type ISAFETransactionEventDelete = z.infer<typeof ISAFETransactionEventDeleteSchema>;
439
+ //# sourceMappingURL=events-transactions-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events-transactions-models.d.ts","sourceRoot":"","sources":["../../../../src/models/safe/transactions/events-transactions-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,yBAAyB,EAG5B,MAAM,4BAA4B,CAAC;AAIpC;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAI1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ISAFETransactionEventDeleteSchema = exports.ISAFETransactionEventUpdateSchema = exports.ISAFETransactionEventAddSchema = exports.ISAFETransactionEventSchema = exports.ISAFETransactionEventDataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const safe_transaction_models_1 = require("../safe-transaction-models");
6
+ //#region Events Transaction
7
+ /**
8
+ * This is the data for the event in the SAFE Ecosystem.
9
+ */
10
+ exports.ISAFETransactionEventDataSchema = zod_1.z.object({
11
+ eventId: zod_1.z.string(),
12
+ eventType: zod_1.z.string(),
13
+ eventData: zod_1.z.record(zod_1.z.any()),
14
+ });
15
+ /**
16
+ * This is the transaction targeting an event in the SAFE Ecosystem.
17
+ */
18
+ exports.ISAFETransactionEventSchema = safe_transaction_models_1.ISAFETransactionBaseSchema.extend({
19
+ transaction: zod_1.z.object({
20
+ type: zod_1.z.literal(safe_transaction_models_1.SAFETransactionType.EVENTS),
21
+ action: safe_transaction_models_1.SAFETransactionActionTypeSchema,
22
+ data: exports.ISAFETransactionEventDataSchema,
23
+ }),
24
+ version: zod_1.z.number().min(1),
25
+ });
26
+ //#endregion Events Transaction
27
+ /**
28
+ * This is the schema for the event transaction add.
29
+ */
30
+ exports.ISAFETransactionEventAddSchema = exports.ISAFETransactionEventSchema.extend({
31
+ transaction: zod_1.z.object({
32
+ action: zod_1.z.literal(safe_transaction_models_1.SAFETransactionActionType.ADD),
33
+ data: exports.ISAFETransactionEventDataSchema,
34
+ }),
35
+ });
36
+ /**
37
+ * This is the schema for the event transaction update.
38
+ */
39
+ exports.ISAFETransactionEventUpdateSchema = exports.ISAFETransactionEventSchema.extend({
40
+ transaction: zod_1.z.object({
41
+ action: zod_1.z.literal(safe_transaction_models_1.SAFETransactionActionType.UPDATE),
42
+ data: exports.ISAFETransactionEventDataSchema,
43
+ }),
44
+ });
45
+ /**
46
+ * This is the schema for the event transaction delete.
47
+ */
48
+ exports.ISAFETransactionEventDeleteSchema = exports.ISAFETransactionEventSchema.extend({
49
+ transaction: zod_1.z.object({
50
+ action: zod_1.z.literal(safe_transaction_models_1.SAFETransactionActionType.DELETE),
51
+ data: exports.ISAFETransactionEventDataSchema,
52
+ }),
53
+ });