@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
@@ -1 +1 @@
1
- {"version":3,"file":"share-rule-models.d.ts","sourceRoot":"","sources":["../../../src/models/rules/share-rule-models.ts"],"names":[],"mappings":"AACA;;GAEG;AAIH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,UAAU,EAAE,CAAC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,wBAAwB,EAAE,UAAU,EAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,2BAA2B,EAAE,CAAC;IAC5C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAMD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACnB;AAMD;;GAEG;AACH,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,EAAE,OAAO;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,CAAC,iBAAiB,GAAG,eAAe,CAAC,EAAE,CAAC;CAClD;AAMD;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,2BAA2B,EAAE,CAAC;IAC5C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAkBD,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAA4B,CAAC;AAElF,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,CAAC,iBAAiB,GAAG,eAAe,CAAC,EAAE,CAAC;CAClD;AAMD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACnB"}
@@ -1,11 +1,17 @@
1
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.IShareRuleSetSchema = exports.IShareRuleGroupSchema = exports.IRuleEvaluationResultsSchema = exports.IShareRulesEvaluationResultSchema = exports.IShareRuleEvalutionResultSchema = exports.IShareRuleAppliedSchema = exports.IShareRuleSchema = exports.IConditionSchema = exports.IConditionShareRuleSchema = exports.IConditionSpecialSchema = exports.IConditionEmptySchema = exports.IConditionBooleanSchema = exports.IConditionNullSchema = exports.IConditionStartsEndsWithSchema = exports.IConditionContainsSchema = exports.IConditionRangeSchema = exports.IConditionEqualitySchema = exports.IConditionTypeOfSchema = exports.IConditionBaseSchema = exports.ConditionTypeOfSchema = exports.ConditionTypeOf = exports.ConditionTypeSchema = exports.ConditionTypeSpecialSchema = exports.ConditionTypeSpecial = exports.ConditionTypeBooleanSchema = exports.ConditionTypeBoolean = exports.ConditionTypeStartsEndsWithSchema = exports.ConditionTypeStartsEndsWith = exports.ConditionTypeRangeSchema = exports.ConditionTypeRange = exports.ConditionTypeSingleSchema = exports.ConditionTypeSingle = exports.ConditionTypeQualifierSchema = exports.ConditionTypeQualifier = exports.LogicalOperatorSchema = exports.LogicalOperator = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ // This file doesn't use the full zod protocalls because of the recursive nature
9
+ // of the share data conditions. The interfaces are duplicated in the share data
10
+ // conditions to allow for the recursive nature of the share data conditions.
2
11
  /**
3
12
  * This file contains the models for the rules used in the share data.
4
13
  */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ConditionTypeOf = exports.ConditionTypeSpecial = exports.ConditionTypeBoolean = exports.ConditionTypeStartsEndsWith = exports.ConditionTypeRange = exports.ConditionTypeSingle = exports.ConditionTypeQualifier = exports.LogicalOperator = void 0;
7
- //#endregion RuleSet
8
- //#region RuleGroup
14
+ //#region enums
9
15
  /**
10
16
  * This contains the logical operators for combining rules.
11
17
  */
@@ -14,80 +20,378 @@ var LogicalOperator;
14
20
  LogicalOperator["AND"] = "AND";
15
21
  LogicalOperator["OR"] = "OR";
16
22
  })(LogicalOperator || (exports.LogicalOperator = LogicalOperator = {}));
23
+ exports.LogicalOperatorSchema = zod_1.default.enum([
24
+ 'AND',
25
+ 'OR',
26
+ ]);
17
27
  /**
18
28
  * This contains the choices for the type of qualifier.
19
29
  */
20
30
  var ConditionTypeQualifier;
21
31
  (function (ConditionTypeQualifier) {
22
- ConditionTypeQualifier["IS"] = "is";
23
- ConditionTypeQualifier["IS_NOT"] = "is not";
32
+ ConditionTypeQualifier["IS"] = "IS";
33
+ ConditionTypeQualifier["IS_NOT"] = "IS_NOT";
24
34
  })(ConditionTypeQualifier || (exports.ConditionTypeQualifier = ConditionTypeQualifier = {}));
35
+ exports.ConditionTypeQualifierSchema = zod_1.default.enum([
36
+ 'IS',
37
+ 'IS_NOT',
38
+ ]);
25
39
  /**
26
40
  * This contains the choices for the type of condition.
27
41
  */
28
42
  var ConditionTypeSingle;
29
43
  (function (ConditionTypeSingle) {
30
- ConditionTypeSingle["TYPEOF"] = "typeof";
31
- ConditionTypeSingle["EQUAL"] = "equal";
32
- ConditionTypeSingle["CONTAINS"] = "contains";
33
- ConditionTypeSingle["NULL"] = "null";
34
- ConditionTypeSingle["EMPTY"] = "empty";
35
- ConditionTypeSingle["SHARE_RULE"] = "share-rule";
44
+ ConditionTypeSingle["TYPEOF"] = "TYPEOF";
45
+ ConditionTypeSingle["EQUAL"] = "EQUAL";
46
+ ConditionTypeSingle["CONTAINS"] = "CONTAINS";
47
+ ConditionTypeSingle["NULL"] = "NULL";
48
+ ConditionTypeSingle["EMPTY"] = "EMPTY";
49
+ ConditionTypeSingle["SHARE_RULE"] = "SHARE_RULE";
36
50
  })(ConditionTypeSingle || (exports.ConditionTypeSingle = ConditionTypeSingle = {}));
51
+ exports.ConditionTypeSingleSchema = zod_1.default.enum([
52
+ 'TYPEOF',
53
+ 'EQUAL',
54
+ 'CONTAINS',
55
+ 'NULL',
56
+ 'EMPTY',
57
+ 'SHARE_RULE',
58
+ ]);
37
59
  /**
38
60
  * This contains the choices for the range conditions.
39
61
  */
40
62
  var ConditionTypeRange;
41
63
  (function (ConditionTypeRange) {
42
- ConditionTypeRange["GREATER_THAN"] = "greater than";
43
- ConditionTypeRange["LESS_THAN"] = "less than";
44
- ConditionTypeRange["GREATER_THAN_OR_EQUAL"] = "greater than or equal";
45
- ConditionTypeRange["LESS_THAN_OR_EQUAL"] = "less than or equal";
64
+ ConditionTypeRange["GREATER_THAN"] = "GREATER_THAN";
65
+ ConditionTypeRange["LESS_THAN"] = "LESS_THAN";
66
+ ConditionTypeRange["GREATER_THAN_OR_EQUAL"] = "GREATER_THAN_OR_EQUAL";
67
+ ConditionTypeRange["LESS_THAN_OR_EQUAL"] = "LESS_THAN_OR_EQUAL";
46
68
  })(ConditionTypeRange || (exports.ConditionTypeRange = ConditionTypeRange = {}));
69
+ exports.ConditionTypeRangeSchema = zod_1.default.enum([
70
+ 'GREATER_THAN',
71
+ 'LESS_THAN',
72
+ 'GREATER_THAN_OR_EQUAL',
73
+ 'LESS_THAN_OR_EQUAL',
74
+ ]);
47
75
  /**
48
76
  * This contains the choices for the starts with and ends with conditions.
49
77
  */
50
78
  var ConditionTypeStartsEndsWith;
51
79
  (function (ConditionTypeStartsEndsWith) {
52
- ConditionTypeStartsEndsWith["STARTS_WITH"] = "starts with";
53
- ConditionTypeStartsEndsWith["ENDS_WITH"] = "ends with";
80
+ ConditionTypeStartsEndsWith["STARTS_WITH"] = "STARTS_WITH";
81
+ ConditionTypeStartsEndsWith["ENDS_WITH"] = "ENDS_WITH";
54
82
  })(ConditionTypeStartsEndsWith || (exports.ConditionTypeStartsEndsWith = ConditionTypeStartsEndsWith = {}));
83
+ exports.ConditionTypeStartsEndsWithSchema = zod_1.default.enum([
84
+ 'STARTS_WITH',
85
+ 'ENDS_WITH',
86
+ ]);
55
87
  /**
56
88
  * This contains the choices for the boolean conditions.
57
89
  */
58
90
  var ConditionTypeBoolean;
59
91
  (function (ConditionTypeBoolean) {
60
- ConditionTypeBoolean["TRUE"] = "true";
61
- ConditionTypeBoolean["FALSE"] = "false";
92
+ ConditionTypeBoolean["TRUE"] = "TRUE";
93
+ ConditionTypeBoolean["FALSE"] = "FALSE";
62
94
  })(ConditionTypeBoolean || (exports.ConditionTypeBoolean = ConditionTypeBoolean = {}));
95
+ exports.ConditionTypeBooleanSchema = zod_1.default.enum([
96
+ 'TRUE',
97
+ 'FALSE',
98
+ ]);
63
99
  /**
64
100
  * This contains the choices for the special conditions.
65
101
  */
66
102
  var ConditionTypeSpecial;
67
103
  (function (ConditionTypeSpecial) {
68
- ConditionTypeSpecial["PATTERN"] = "pattern";
104
+ ConditionTypeSpecial["PATTERN"] = "PATTERN";
69
105
  })(ConditionTypeSpecial || (exports.ConditionTypeSpecial = ConditionTypeSpecial = {}));
106
+ exports.ConditionTypeSpecialSchema = zod_1.default.enum([
107
+ 'PATTERN',
108
+ ]);
109
+ exports.ConditionTypeSchema = zod_1.default.union([
110
+ exports.ConditionTypeSingleSchema,
111
+ exports.ConditionTypeRangeSchema,
112
+ exports.ConditionTypeStartsEndsWithSchema,
113
+ exports.ConditionTypeBooleanSchema,
114
+ exports.ConditionTypeSpecialSchema,
115
+ ]);
70
116
  /**
71
117
  * These are the different choices for the types of data in a condition.
72
118
  */
73
119
  var ConditionTypeOf;
74
120
  (function (ConditionTypeOf) {
75
- ConditionTypeOf["STRING"] = "string";
76
- ConditionTypeOf["NUMBER"] = "number";
77
- ConditionTypeOf["INTEGER"] = "integer";
78
- ConditionTypeOf["BOOLEAN"] = "boolean";
79
- ConditionTypeOf["OBJECT"] = "object";
80
- ConditionTypeOf["ARRAY"] = "array";
81
- ConditionTypeOf["NULL"] = "null";
82
- ConditionTypeOf["UNDEFINED"] = "undefined";
83
- ConditionTypeOf["FUNCTION"] = "function";
84
- ConditionTypeOf["BIGINT"] = "bigint";
121
+ ConditionTypeOf["STRING"] = "STRING";
122
+ ConditionTypeOf["NUMBER"] = "NUMBER";
123
+ ConditionTypeOf["INTEGER"] = "INTEGER";
124
+ ConditionTypeOf["BOOLEAN"] = "BOOLEAN";
125
+ ConditionTypeOf["OBJECT"] = "OBJECT";
126
+ ConditionTypeOf["ARRAY"] = "ARRAY";
127
+ ConditionTypeOf["NULL"] = "NULL";
128
+ ConditionTypeOf["UNDEFINED"] = "UNDEFINED";
129
+ ConditionTypeOf["FUNCTION"] = "FUNCTION";
130
+ ConditionTypeOf["BIGINT"] = "BIGINT";
85
131
  })(ConditionTypeOf || (exports.ConditionTypeOf = ConditionTypeOf = {}));
86
- // /**
87
- // * This is the interface for the combined rule condition.
88
- // */
89
- // export interface IConditionCombinedRules extends IConditionBase {
90
- // conditionType: ConditionTypeCombinedRules; // the type of condition to evaluate
91
- // conditionValue: IShareRuleGroup; // the value to evaluate the condition against
92
- // }
132
+ exports.ConditionTypeOfSchema = zod_1.default.enum([
133
+ 'STRING',
134
+ 'NUMBER',
135
+ 'INTEGER',
136
+ 'BOOLEAN',
137
+ 'OBJECT',
138
+ 'ARRAY',
139
+ 'NULL',
140
+ 'UNDEFINED',
141
+ 'FUNCTION',
142
+ 'BIGINT',
143
+ ]);
144
+ //#endregion enums
145
+ //#region Conditions
146
+ /**
147
+ * This is the interface for the base condition.
148
+ */
149
+ exports.IConditionBaseSchema = zod_1.default.object({
150
+ conditionType: exports.ConditionTypeSchema,
151
+ conditionTypeQualifier: exports.ConditionTypeQualifierSchema,
152
+ targettedProperty: zod_1.default.string(),
153
+ });
154
+ /**
155
+ * This is the interface for the type of condition.
156
+ *
157
+ const exampleConditionTypeOf: IConditionTypeOf = {
158
+ conditionType: ConditionTypeSingle.TYPEOF,
159
+ ConditionTypeQualifier: ConditionTypeQualifier.IS,
160
+ conditionValue: ConditionTypeOf.NUMBER,
161
+ targettedProperty: 'address.city.total',
162
+ };
163
+ */
164
+ exports.IConditionTypeOfSchema = exports.IConditionBaseSchema.extend({
165
+ conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.TYPEOF),
166
+ conditionValue: exports.ConditionTypeOfSchema,
167
+ });
168
+ /**
169
+ * This is the interface for the equality condition.
170
+ *
171
+ const exampleConditionEquality: IConditionEquality = {
172
+ conditionType: ConditionTypeSingle.EQUAL,
173
+ ConditionTypeQualifier: ConditionTypeQualifier.IS,
174
+ conditionValue: 100,
175
+ targettedProperty: 'address.city.total',
176
+ };
177
+ */
178
+ exports.IConditionEqualitySchema = exports.IConditionBaseSchema.extend({
179
+ conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.EQUAL),
180
+ conditionValue: zod_1.default.union([zod_1.default.number(), zod_1.default.string()]),
181
+ });
182
+ /**
183
+ * This is the interface for the range condition.
184
+ *
185
+ const exampleConditionRange: IConditionRange = {
186
+ conditionType: ConditionTypeRange.GREATER_THAN,
187
+ ConditionTypeQualifier: ConditionTypeQualifier.IS,
188
+ conditionValue: 100,
189
+ targettedProperty: 'address.city.total',
190
+ };
191
+ */
192
+ exports.IConditionRangeSchema = exports.IConditionBaseSchema.extend({
193
+ conditionType: exports.ConditionTypeRangeSchema,
194
+ conditionValue: zod_1.default.union([zod_1.default.number(), zod_1.default.string()]),
195
+ });
196
+ /**
197
+ * This is the interface for the contains condition.
198
+ *
199
+ const exampleConditionContains: IConditionContains = {
200
+ conditionType: ConditionTypeSingle.CONTAINS,
201
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
202
+ conditionValue: ['gar'| 'garison' | 'garage']
203
+ targettedProperty: 'address.city.name',
204
+ * };
205
+ */
206
+ exports.IConditionContainsSchema = exports.IConditionBaseSchema.extend({
207
+ conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.CONTAINS),
208
+ conditionValue: zod_1.default.union([zod_1.default.string(), zod_1.default.array(zod_1.default.string()), zod_1.default.array(zod_1.default.number())]),
209
+ });
210
+ /**
211
+ * This is the interface for the starts with and ends with condition.
212
+ *
213
+ const exampleConditionStartsEndsWith: IConditionStartsEndsWith = {
214
+ conditionType: ConditionTypeStartsEndsWith.STARTS_WITH,
215
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
216
+ conditionValue: 'cal'
217
+ targettedProperty: 'address.city.name',
218
+ };
219
+ */
220
+ exports.IConditionStartsEndsWithSchema = exports.IConditionBaseSchema.extend({
221
+ conditionType: exports.ConditionTypeStartsEndsWithSchema,
222
+ conditionValue: zod_1.default.string(),
223
+ });
224
+ /**
225
+ * This is the interface for the null condition.
226
+ *
227
+ const exampleConditionNull: IConditionNull = {
228
+ conditionType: ConditionTypeSingle.NULL
229
+ targettedProperty: 'address.city.name',
230
+ };
231
+ */
232
+ exports.IConditionNullSchema = exports.IConditionBaseSchema.extend({
233
+ conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.NULL),
234
+ });
235
+ /**
236
+ * This is the interface for the boolean condition.
237
+ *
238
+ const exampleConditionBoolean: IConditionBoolean = {
239
+ conditionType: ConditionTypeBoolean.TRUE,
240
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
241
+ targettedProperty: 'address.city.name',
242
+ };
243
+ */
244
+ exports.IConditionBooleanSchema = exports.IConditionBaseSchema.extend({
245
+ conditionType: exports.ConditionTypeBooleanSchema,
246
+ });
247
+ /**
248
+ * This is the interface for the empty condition.
249
+ *
250
+ const exampleConditionEmpty: IConditionEmpty = {
251
+ conditionType: ConditionTypeEmpty.IS_EMPTY,
252
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
253
+ targettedProperty: 'address.city.name',
254
+ };
255
+ */
256
+ exports.IConditionEmptySchema = exports.IConditionBaseSchema.extend({
257
+ conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.EMPTY),
258
+ });
259
+ /**
260
+ * This is the interface for the special condition.
261
+ *
262
+ const exampleConditionSpecial: IConditionSpecial = {
263
+ conditionType: ConditionTypeSpecial.PATTERN,
264
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
265
+ conditionValue: '^[a-zA-Z0-9]*$'
266
+ targettedProperty: 'address.city.name',
267
+ };
268
+ */
269
+ exports.IConditionSpecialSchema = exports.IConditionBaseSchema.extend({
270
+ conditionType: exports.ConditionTypeSpecialSchema,
271
+ conditionValue: zod_1.default.string(),
272
+ });
273
+ /**
274
+ * This is the interface for the share rule condition.
275
+ *
276
+
277
+ const nestedShareRule: IShareRule = {
278
+ ruleId: 'nestedRule',
279
+ currentDataConditions: [
280
+ {
281
+ targettedProperty: 'nestedProperty',
282
+ conditionType: 'EQUAL',
283
+ conditionValue: 'expectedValue',
284
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
285
+ },
286
+ ],
287
+ proposedDataConditions: [
288
+ {
289
+ targettedProperty: 'nestedProperty',
290
+ conditionType: 'EQUAL',
291
+ conditionValue: 'newValue',
292
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
293
+ },
294
+ ],
295
+ };
296
+
297
+ const conditionWithShareRule: IConditionShareRule = {
298
+ conditionType: ConditionTypeSingle.SHARE_RULE,
299
+ conditionTypeQualifier: ConditionTypeQualifier.IS,
300
+ targettedProperty: 'parentProperty',
301
+ rule: nestedShareRule,
302
+ };
303
+ */
304
+ // // Define the base schema for IConditionShareRuleSchema
305
+ const BaseConditionShareRuleSchema = zod_1.default.object({
306
+ conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.SHARE_RULE),
307
+ conditionValue: zod_1.default.lazy(() => exports.IShareRuleSchema),
308
+ });
309
+ // Define the recursive schema using z.lazy
310
+ exports.IConditionShareRuleSchema = BaseConditionShareRuleSchema;
311
+ /**
312
+ * This is the interface for the conditional information in the checks.
313
+ */
314
+ exports.IConditionSchema = zod_1.default.union([
315
+ exports.IConditionTypeOfSchema,
316
+ exports.IConditionEqualitySchema,
317
+ exports.IConditionRangeSchema,
318
+ exports.IConditionContainsSchema,
319
+ exports.IConditionStartsEndsWithSchema,
320
+ exports.IConditionNullSchema,
321
+ exports.IConditionBooleanSchema,
322
+ exports.IConditionEmptySchema,
323
+ exports.IConditionSpecialSchema,
324
+ exports.IConditionShareRuleSchema,
325
+ ]);
93
326
  //#endregion Conditions
327
+ //#region Rule
328
+ /**
329
+ * This contains the interface for a share rule in the share data object
330
+ */
331
+ exports.IShareRuleSchema = zod_1.default.object({
332
+ ruleId: zod_1.default.string(),
333
+ currentDataConditions: zod_1.default.array(exports.IConditionSchema),
334
+ proposedDataConditions: zod_1.default.array(exports.IConditionSchema),
335
+ });
336
+ /**
337
+ * This contains the applied rule informaiton in the share data object.
338
+ */
339
+ exports.IShareRuleAppliedSchema = exports.IShareRuleSchema.extend({
340
+ targettedProperty: zod_1.default.string(),
341
+ });
342
+ //#endregion Rule
343
+ //#region Rule Evaluation
344
+ /**
345
+ * This contains the interface for the rule evaluation.
346
+ */
347
+ exports.IShareRuleEvalutionResultSchema = zod_1.default.object({
348
+ ruleId: zod_1.default.string(),
349
+ currentResult: zod_1.default.boolean(),
350
+ currentConditionFailure: zod_1.default.array(exports.IConditionBaseSchema),
351
+ proposedResult: zod_1.default.boolean(),
352
+ proposedConditionFailure: zod_1.default.array(exports.IConditionBaseSchema),
353
+ });
354
+ /**
355
+ * This contains the interface for the rule evaluation.
356
+ */
357
+ exports.IShareRulesEvaluationResultSchema = zod_1.default.object({
358
+ rootParam: zod_1.default.string(),
359
+ passedRuleCheck: zod_1.default.boolean(),
360
+ passedRuleId: zod_1.default.string(),
361
+ shareRuleEvalutionResults: zod_1.default.array(exports.IShareRuleEvalutionResultSchema),
362
+ });
363
+ /**
364
+ * This contains the interface for the rule evaluation results.
365
+ */
366
+ exports.IRuleEvaluationResultsSchema = zod_1.default.object({
367
+ shareDataId: zod_1.default.string(),
368
+ rulesResults: zod_1.default.array(exports.IShareRulesEvaluationResultSchema),
369
+ isValidProposal: zod_1.default.boolean(),
370
+ });
371
+ //#endregion Rule Evaluation
372
+ //#region RuleGroup
373
+ /**
374
+ * This contains the interface for a rule group.
375
+ *
376
+ * A rule group can contain individual rules or nested rule groups.
377
+ */
378
+ // Define the base schema for IShareRuleGroupSchema
379
+ const BaseShareRuleGroupSchema = zod_1.default.object({
380
+ operator: exports.LogicalOperatorSchema,
381
+ rules: zod_1.default.array(zod_1.default.union([exports.IShareRuleAppliedSchema, zod_1.default.lazy(() => exports.IShareRuleGroupSchema)])),
382
+ });
383
+ // Define the recursive schema using z.lazy
384
+ exports.IShareRuleGroupSchema = BaseShareRuleGroupSchema;
385
+ //#endregion RuleGroup
386
+ //#region RuleSet
387
+ /**
388
+ * This contains the interface for the rule set in the share data object
389
+ */
390
+ exports.IShareRuleSetSchema = zod_1.default.object({
391
+ description: zod_1.default.string().optional(),
392
+ id: zod_1.default.string(),
393
+ name: zod_1.default.string(),
394
+ ruleGroups: zod_1.default.array(exports.IShareRuleGroupSchema),
395
+ version: zod_1.default.number(),
396
+ });
397
+ //#endregion RuleSet
@@ -1,12 +1,13 @@
1
- import { AuthorityValidationType, IAuthorizationIssuer } from '../authorization/authorization-models';
1
+ import z from 'zod';
2
2
  /**
3
3
  * This is the type of function that is being targetted in the transaction.
4
4
  */
5
5
  export declare enum SAFETransactionActionType {
6
6
  ADD = "ADD",
7
- REMOVE = "REMOVE",
7
+ DELETE = "DELETE",
8
8
  UPDATE = "UPDATE"
9
9
  }
10
+ export declare const SAFETransactionActionTypeSchema: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
10
11
  /**
11
12
  * This is the transaction for sharing data in the SAFE Ecosystem.
12
13
  */
@@ -18,6 +19,7 @@ export declare enum SAFETransactionType {
18
19
  EVENTS = "EVENTS",// the events in the SAFE Ecosystem
19
20
  ENDPOINTS = "ENDPOINTS"
20
21
  }
22
+ export declare const SAFETransactionTypeSchema: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
21
23
  /**
22
24
  * This contains the minimum information required for a SAFE transaction.
23
25
  *
@@ -32,50 +34,39 @@ const sampleTransactionBase: ISAFETransactionBase = {
32
34
  version: 1,
33
35
  };
34
36
  */
35
- export interface ISAFETransactionBase {
37
+ export declare const ISAFETransactionBaseSchema: z.ZodObject<{
38
+ createdAt: z.ZodNumber;
39
+ authority: z.ZodString;
40
+ authoritySignature: z.ZodString;
41
+ transaction: z.ZodObject<{
42
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
43
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
46
+ action: "ADD" | "DELETE" | "UPDATE";
47
+ }, {
48
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
49
+ action: "ADD" | "DELETE" | "UPDATE";
50
+ }>;
51
+ version: z.ZodNumber;
52
+ }, "strip", z.ZodTypeAny, {
36
53
  createdAt: number;
54
+ version: number;
37
55
  authority: string;
38
56
  authoritySignature: string;
39
57
  transaction: {
40
- type: SAFETransactionType;
41
- action: SAFETransactionActionType;
58
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
59
+ action: "ADD" | "DELETE" | "UPDATE";
42
60
  };
61
+ }, {
62
+ createdAt: number;
43
63
  version: number;
44
- }
45
- /**
46
- * This is the transaction targetting an authority in the SAFE Ecosystem.
47
- *
48
- const sampleTransactionAuthority: ISAFETransactionAuthority = {
49
- createdAt: Date.now(),
50
- authority: '0xAuthorityPublicKey',
51
- authoritySignature: '0xAuthoritySignature',
52
- transaction: {
53
- type: SAFETransactionType.AUTHORITY,
54
- action: SAFETransactionActionType.CREATE,
55
- data: {
56
- authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
57
- authorizationPublicKey: '0xAuthorizationPublicKey',
58
- authorityValidationType: AuthorityValidationType.JWT,
59
- authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
60
- },
61
- },
62
- version: 1,
63
- };
64
- */
65
- export interface ISAFETransactionAuthority extends ISAFETransactionBase {
64
+ authority: string;
65
+ authoritySignature: string;
66
66
  transaction: {
67
- type: SAFETransactionType.AUTHORITY;
68
- action: SAFETransactionActionType;
69
- data: ISAFETransactionAuthorityData;
67
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
68
+ action: "ADD" | "DELETE" | "UPDATE";
70
69
  };
71
- }
72
- /**
73
- * This is the data for the authority in the SAFE Ecosystem.
74
- */
75
- export interface ISAFETransactionAuthorityData {
76
- authorizationIssuer: IAuthorizationIssuer;
77
- authorizationPublicKey: string;
78
- authorityValidationType: AuthorityValidationType;
79
- authorityOver: SAFETransactionType[];
80
- }
70
+ }>;
71
+ export type ISAFETransactionBase = z.infer<typeof ISAFETransactionBaseSchema>;
81
72
  //# sourceMappingURL=safe-transaction-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"safe-transaction-models.d.ts","sourceRoot":"","sources":["../../../src/models/safe/safe-transaction-models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAItG;;GAEG;AACH,oBAAY,yBAAyB;IACjC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED;;GAEG;AACH,oBAAY,mBAAmB;IAC3B,SAAS,cAAc,CAAE,sCAAsC;IAC/D,SAAS,cAAc,CAAE,uCAAuC;IAChE,SAAS,cAAc,CAAE,sCAAsC;IAC/D,KAAK,UAAU,CAAE,kCAAkC;IACnD,MAAM,WAAW,CAAE,mCAAmC;IACtD,SAAS,cAAc;CAC1B;AAID;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE;QACT,IAAI,EAAE,mBAAmB,CAAC;QAC1B,MAAM,EAAE,yBAAyB,CAAC;KACrC,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACnE,WAAW,EAAE;QACT,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC;QACpC,MAAM,EAAE,yBAAyB,CAAC;QAClC,IAAI,EAAE,6BAA6B,CAAC;KACvC,CAAA;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,mBAAmB,EAAE,oBAAoB,CAAC;IAC1C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACxC"}
1
+ {"version":3,"file":"safe-transaction-models.d.ts","sourceRoot":"","sources":["../../../src/models/safe/safe-transaction-models.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAUpB;;GAEG;AACH,oBAAY,yBAAyB;IACjC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,+BAA+B,wCAI1C,CAAC;AAEH;;GAEG;AACH,oBAAY,mBAAmB;IAC3B,SAAS,cAAc,CAAE,sCAAsC;IAC/D,SAAS,cAAc,CAAE,uCAAuC;IAChE,SAAS,cAAc,CAAE,sCAAsC;IAC/D,KAAK,UAAU,CAAE,kCAAkC;IACnD,MAAM,WAAW,CAAE,mCAAmC;IACtD,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,yBAAyB,oFAOpC,CAAC;AAMH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
- /// This file is used to keep all safe transactions for the SAFE system.
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
3
5
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.SAFETransactionType = exports.SAFETransactionActionType = void 0;
6
+ exports.ISAFETransactionBaseSchema = exports.SAFETransactionTypeSchema = exports.SAFETransactionType = exports.SAFETransactionActionTypeSchema = exports.SAFETransactionActionType = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ /// This file is used to keep all safe transactions for the SAFE system.
5
9
  //#region Enums
6
10
  /**
7
11
  * This is the type of function that is being targetted in the transaction.
@@ -9,9 +13,14 @@ exports.SAFETransactionType = exports.SAFETransactionActionType = void 0;
9
13
  var SAFETransactionActionType;
10
14
  (function (SAFETransactionActionType) {
11
15
  SAFETransactionActionType["ADD"] = "ADD";
12
- SAFETransactionActionType["REMOVE"] = "REMOVE";
16
+ SAFETransactionActionType["DELETE"] = "DELETE";
13
17
  SAFETransactionActionType["UPDATE"] = "UPDATE";
14
18
  })(SAFETransactionActionType || (exports.SAFETransactionActionType = SAFETransactionActionType = {}));
19
+ exports.SAFETransactionActionTypeSchema = zod_1.default.enum([
20
+ 'ADD',
21
+ 'DELETE',
22
+ 'UPDATE',
23
+ ]);
15
24
  /**
16
25
  * This is the transaction for sharing data in the SAFE Ecosystem.
17
26
  */
@@ -24,3 +33,40 @@ var SAFETransactionType;
24
33
  SAFETransactionType["EVENTS"] = "EVENTS";
25
34
  SAFETransactionType["ENDPOINTS"] = "ENDPOINTS";
26
35
  })(SAFETransactionType || (exports.SAFETransactionType = SAFETransactionType = {}));
36
+ exports.SAFETransactionTypeSchema = zod_1.default.enum([
37
+ 'AUTHORITY',
38
+ 'SHAREDATA',
39
+ 'FUNCTIONS',
40
+ 'RULES',
41
+ 'EVENTS',
42
+ 'ENDPOINTS',
43
+ ]);
44
+ //#endregion Enums
45
+ //#region Base Transaction
46
+ /**
47
+ * This contains the minimum information required for a SAFE transaction.
48
+ *
49
+ const sampleTransactionBase: ISAFETransactionBase = {
50
+ createdAt: Date.now(),
51
+ authority: '0xAuthorityPublicKey',
52
+ authoritySignature: '0xAuthoritySignature',
53
+ transaction: {
54
+ type: SAFETransactionType.AUTHORITY,
55
+ action: SAFETransactionActionType.CREATE,
56
+ },
57
+ version: 1,
58
+ };
59
+ */
60
+ exports.ISAFETransactionBaseSchema = zod_1.default.object({
61
+ createdAt: zod_1.default.number(), // the time the transaction was created (in milliseconds)
62
+ authority: zod_1.default.string(), // the public key of the authority that created the transaction
63
+ authoritySignature: zod_1.default.string(), // the signature of the authority that created the transaction
64
+ transaction: zod_1.default.object({
65
+ type: exports.SAFETransactionTypeSchema, // the type of transaction
66
+ action: exports.SAFETransactionActionTypeSchema, // the action to perform on the transaction
67
+ }),
68
+ version: zod_1.default.number(), // the version of the transaction
69
+ });
70
+ //#endregion Base Transaction
71
+ //#region Share Rules Transaction
72
+ //#endregion Share Rules Transaction