@degenerate/endpoints 0.0.11 → 0.0.13

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 (35) hide show
  1. package/dist/cors/endpoints/helpers/validate-incoming-request-data.d.ts.map +1 -1
  2. package/dist/cors/endpoints/helpers/validate-incoming-request-data.js +1 -0
  3. package/dist/cors/index.d.ts +1 -2
  4. package/dist/cors/index.d.ts.map +1 -1
  5. package/dist/cors/index.js +2 -3
  6. package/dist/cors/logging/add-unique-tracking.js +2 -2
  7. package/dist/cors/routes/authorities/v1.routes.d.ts.map +1 -1
  8. package/dist/cors/routes/authorities/v1.routes.js +8 -8
  9. package/dist/cors/routes/rules/v1/rule-set.routes.d.ts.map +1 -1
  10. package/dist/cors/routes/rules/v1/rule-set.routes.js +4 -6
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +16 -0
  14. package/package.json +3 -3
  15. package/dist/cors/endpoints/authorities/validate-authorities-transaction.d.ts +0 -30
  16. package/dist/cors/endpoints/authorities/validate-authorities-transaction.d.ts.map +0 -1
  17. package/dist/cors/endpoints/authorities/validate-authorities-transaction.js +0 -155
  18. package/dist/schema/authorities-transactions.schema.d.ts +0 -306
  19. package/dist/schema/authorities-transactions.schema.d.ts.map +0 -1
  20. package/dist/schema/authorities-transactions.schema.js +0 -71
  21. package/dist/schema/rules/rules-conditions.schema.d.ts +0 -402
  22. package/dist/schema/rules/rules-conditions.schema.d.ts.map +0 -1
  23. package/dist/schema/rules/rules-conditions.schema.js +0 -99
  24. package/dist/schema/rules/rules-enums.schema.d.ts +0 -39
  25. package/dist/schema/rules/rules-enums.schema.d.ts.map +0 -1
  26. package/dist/schema/rules/rules-enums.schema.js +0 -90
  27. package/dist/schema/rules/rules.schema.d.ts +0 -2839
  28. package/dist/schema/rules/rules.schema.d.ts.map +0 -1
  29. package/dist/schema/rules/rules.schema.js +0 -76
  30. package/dist/schema/rules-transactions.schema.d.ts +0 -450
  31. package/dist/schema/rules-transactions.schema.d.ts.map +0 -1
  32. package/dist/schema/rules-transactions.schema.js +0 -63
  33. package/dist/schema/transactions.schema.d.ts +0 -45
  34. package/dist/schema/transactions.schema.d.ts.map +0 -1
  35. package/dist/schema/transactions.schema.js +0 -43
@@ -1,306 +0,0 @@
1
- import z from 'zod';
2
- import { AuthorityValidationType, SAFETransactionActionType, SAFETransactionType } from '@degenerate/generic';
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<[AuthorityValidationType]>;
10
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
11
- }, "strip", z.ZodTypeAny, {
12
- authorizationIssuer: string;
13
- authorizationPublicKey: string;
14
- authorityValidationType: AuthorityValidationType;
15
- authorityOver: SAFETransactionType[];
16
- }, {
17
- authorizationIssuer: string;
18
- authorizationPublicKey: string;
19
- authorityValidationType: AuthorityValidationType;
20
- authorityOver: SAFETransactionType[];
21
- }>;
22
- /**
23
- * This is the transaction targetting an authority in the SAFE Ecosystem.
24
- *
25
- const sampleTransactionAuthority: ISAFETransactionAuthority = {
26
- createdAt: Date.now(),
27
- authority: '0xAuthorityPublicKey',
28
- authoritySignature: '0xAuthoritySignature',
29
- transaction: {
30
- type: SAFETransactionType.AUTHORITY,
31
- action: SAFETransactionActionType.CREATE,
32
- data: {
33
- authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
34
- authorizationPublicKey: '0xAuthorizationPublicKey',
35
- authorityValidationType: AuthorityValidationType.JWT,
36
- authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
37
- },
38
- },
39
- version: 1,
40
- };
41
- */
42
- /**
43
- * This is the schema for the authority transaction add.
44
- */
45
- export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUtil.extendShape<{
46
- createdAt: z.ZodNumber;
47
- authority: z.ZodString;
48
- authoritySignature: z.ZodString;
49
- transaction: z.ZodObject<{
50
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
51
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
52
- }, "strip", z.ZodTypeAny, {
53
- type: SAFETransactionType;
54
- action: SAFETransactionActionType;
55
- }, {
56
- type: SAFETransactionType;
57
- action: SAFETransactionActionType;
58
- }>;
59
- version: z.ZodNumber;
60
- }, {
61
- transaction: z.ZodObject<{
62
- type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
63
- action: z.ZodLiteral<SAFETransactionActionType.ADD>;
64
- data: z.ZodObject<{
65
- authorizationIssuer: z.ZodString;
66
- authorizationPublicKey: z.ZodString;
67
- authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
68
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
69
- }, "strip", z.ZodTypeAny, {
70
- authorizationIssuer: string;
71
- authorizationPublicKey: string;
72
- authorityValidationType: AuthorityValidationType;
73
- authorityOver: SAFETransactionType[];
74
- }, {
75
- authorizationIssuer: string;
76
- authorizationPublicKey: string;
77
- authorityValidationType: AuthorityValidationType;
78
- authorityOver: SAFETransactionType[];
79
- }>;
80
- }, "strip", z.ZodTypeAny, {
81
- type: SAFETransactionType.AUTHORITY;
82
- action: SAFETransactionActionType.ADD;
83
- data: {
84
- authorizationIssuer: string;
85
- authorizationPublicKey: string;
86
- authorityValidationType: AuthorityValidationType;
87
- authorityOver: SAFETransactionType[];
88
- };
89
- }, {
90
- type: SAFETransactionType.AUTHORITY;
91
- action: SAFETransactionActionType.ADD;
92
- data: {
93
- authorizationIssuer: string;
94
- authorizationPublicKey: string;
95
- authorityValidationType: AuthorityValidationType;
96
- authorityOver: SAFETransactionType[];
97
- };
98
- }>;
99
- }>, "strip", z.ZodTypeAny, {
100
- transaction: {
101
- type: SAFETransactionType.AUTHORITY;
102
- action: SAFETransactionActionType.ADD;
103
- data: {
104
- authorizationIssuer: string;
105
- authorizationPublicKey: string;
106
- authorityValidationType: AuthorityValidationType;
107
- authorityOver: SAFETransactionType[];
108
- };
109
- };
110
- createdAt: number;
111
- authority: string;
112
- authoritySignature: string;
113
- version: number;
114
- }, {
115
- transaction: {
116
- type: SAFETransactionType.AUTHORITY;
117
- action: SAFETransactionActionType.ADD;
118
- data: {
119
- authorizationIssuer: string;
120
- authorizationPublicKey: string;
121
- authorityValidationType: AuthorityValidationType;
122
- authorityOver: SAFETransactionType[];
123
- };
124
- };
125
- createdAt: number;
126
- authority: string;
127
- authoritySignature: string;
128
- version: number;
129
- }>;
130
- /**
131
- * This is the schema for the authority transaction update.
132
- */
133
- export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.objectUtil.extendShape<{
134
- createdAt: z.ZodNumber;
135
- authority: z.ZodString;
136
- authoritySignature: z.ZodString;
137
- transaction: z.ZodObject<{
138
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
139
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
140
- }, "strip", z.ZodTypeAny, {
141
- type: SAFETransactionType;
142
- action: SAFETransactionActionType;
143
- }, {
144
- type: SAFETransactionType;
145
- action: SAFETransactionActionType;
146
- }>;
147
- version: z.ZodNumber;
148
- }, {
149
- transaction: z.ZodObject<{
150
- type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
151
- action: z.ZodLiteral<SAFETransactionActionType.UPDATE>;
152
- data: z.ZodObject<{
153
- authorizationIssuer: z.ZodString;
154
- authorizationPublicKey: z.ZodString;
155
- authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
156
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
157
- }, "strip", z.ZodTypeAny, {
158
- authorizationIssuer: string;
159
- authorizationPublicKey: string;
160
- authorityValidationType: AuthorityValidationType;
161
- authorityOver: SAFETransactionType[];
162
- }, {
163
- authorizationIssuer: string;
164
- authorizationPublicKey: string;
165
- authorityValidationType: AuthorityValidationType;
166
- authorityOver: SAFETransactionType[];
167
- }>;
168
- }, "strip", z.ZodTypeAny, {
169
- type: SAFETransactionType.AUTHORITY;
170
- action: SAFETransactionActionType.UPDATE;
171
- data: {
172
- authorizationIssuer: string;
173
- authorizationPublicKey: string;
174
- authorityValidationType: AuthorityValidationType;
175
- authorityOver: SAFETransactionType[];
176
- };
177
- }, {
178
- type: SAFETransactionType.AUTHORITY;
179
- action: SAFETransactionActionType.UPDATE;
180
- data: {
181
- authorizationIssuer: string;
182
- authorizationPublicKey: string;
183
- authorityValidationType: AuthorityValidationType;
184
- authorityOver: SAFETransactionType[];
185
- };
186
- }>;
187
- }>, "strip", z.ZodTypeAny, {
188
- transaction: {
189
- type: SAFETransactionType.AUTHORITY;
190
- action: SAFETransactionActionType.UPDATE;
191
- data: {
192
- authorizationIssuer: string;
193
- authorizationPublicKey: string;
194
- authorityValidationType: AuthorityValidationType;
195
- authorityOver: SAFETransactionType[];
196
- };
197
- };
198
- createdAt: number;
199
- authority: string;
200
- authoritySignature: string;
201
- version: number;
202
- }, {
203
- transaction: {
204
- type: SAFETransactionType.AUTHORITY;
205
- action: SAFETransactionActionType.UPDATE;
206
- data: {
207
- authorizationIssuer: string;
208
- authorizationPublicKey: string;
209
- authorityValidationType: AuthorityValidationType;
210
- authorityOver: SAFETransactionType[];
211
- };
212
- };
213
- createdAt: number;
214
- authority: string;
215
- authoritySignature: string;
216
- version: number;
217
- }>;
218
- /**
219
- * This is the schema for the authority transaction remove.
220
- */
221
- export declare const ISAFETransactionAuthorityRemoveSchema: z.ZodObject<z.objectUtil.extendShape<{
222
- createdAt: z.ZodNumber;
223
- authority: z.ZodString;
224
- authoritySignature: z.ZodString;
225
- transaction: z.ZodObject<{
226
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
227
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
228
- }, "strip", z.ZodTypeAny, {
229
- type: SAFETransactionType;
230
- action: SAFETransactionActionType;
231
- }, {
232
- type: SAFETransactionType;
233
- action: SAFETransactionActionType;
234
- }>;
235
- version: z.ZodNumber;
236
- }, {
237
- transaction: z.ZodObject<{
238
- type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
239
- action: z.ZodLiteral<SAFETransactionActionType.REMOVE>;
240
- data: z.ZodObject<{
241
- authorizationIssuer: z.ZodString;
242
- authorizationPublicKey: z.ZodString;
243
- authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
244
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
245
- }, "strip", z.ZodTypeAny, {
246
- authorizationIssuer: string;
247
- authorizationPublicKey: string;
248
- authorityValidationType: AuthorityValidationType;
249
- authorityOver: SAFETransactionType[];
250
- }, {
251
- authorizationIssuer: string;
252
- authorizationPublicKey: string;
253
- authorityValidationType: AuthorityValidationType;
254
- authorityOver: SAFETransactionType[];
255
- }>;
256
- }, "strip", z.ZodTypeAny, {
257
- type: SAFETransactionType.AUTHORITY;
258
- action: SAFETransactionActionType.REMOVE;
259
- data: {
260
- authorizationIssuer: string;
261
- authorizationPublicKey: string;
262
- authorityValidationType: AuthorityValidationType;
263
- authorityOver: SAFETransactionType[];
264
- };
265
- }, {
266
- type: SAFETransactionType.AUTHORITY;
267
- action: SAFETransactionActionType.REMOVE;
268
- data: {
269
- authorizationIssuer: string;
270
- authorizationPublicKey: string;
271
- authorityValidationType: AuthorityValidationType;
272
- authorityOver: SAFETransactionType[];
273
- };
274
- }>;
275
- }>, "strip", z.ZodTypeAny, {
276
- transaction: {
277
- type: SAFETransactionType.AUTHORITY;
278
- action: SAFETransactionActionType.REMOVE;
279
- data: {
280
- authorizationIssuer: string;
281
- authorizationPublicKey: string;
282
- authorityValidationType: AuthorityValidationType;
283
- authorityOver: SAFETransactionType[];
284
- };
285
- };
286
- createdAt: number;
287
- authority: string;
288
- authoritySignature: string;
289
- version: number;
290
- }, {
291
- transaction: {
292
- type: SAFETransactionType.AUTHORITY;
293
- action: SAFETransactionActionType.REMOVE;
294
- data: {
295
- authorizationIssuer: string;
296
- authorizationPublicKey: string;
297
- authorityValidationType: AuthorityValidationType;
298
- authorityOver: SAFETransactionType[];
299
- };
300
- };
301
- createdAt: number;
302
- authority: string;
303
- authoritySignature: string;
304
- version: number;
305
- }>;
306
- //# sourceMappingURL=authorities-transactions.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorities-transactions.schema.d.ts","sourceRoot":"","sources":["../../src/schema/authorities-transactions.schema.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAMpB,OAAO,EACH,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAK7B;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;EAK9C,CAAC;AAIH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM7C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhD,CAAC"}
@@ -1,71 +0,0 @@
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.ISAFETransactionAuthorityRemoveSchema = exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthorityDataSchema = void 0;
7
- // This contains the schemas for the authorities objects in the zod format..
8
- const zod_1 = __importDefault(require("zod"));
9
- const transactions_schema_1 = require("./transactions.schema");
10
- const generic_1 = require("@degenerate/generic");
11
- const IAuthorizationIssuerSchema = zod_1.default.string().regex(/^[a-zA-Z0-9]+-[a-zA-Z0-9]+$/);
12
- const AuthorityValidationTypeSchema = zod_1.default.enum([generic_1.AuthorityValidationType.JWT]);
13
- /**
14
- * This is the data for the authority in the SAFE Ecosystem.
15
- */
16
- exports.ISAFETransactionAuthorityDataSchema = zod_1.default.object({
17
- authorizationIssuer: IAuthorizationIssuerSchema,
18
- authorizationPublicKey: zod_1.default.string(),
19
- authorityValidationType: AuthorityValidationTypeSchema,
20
- authorityOver: zod_1.default.array(transactions_schema_1.SAFETransactionTypeSchema),
21
- });
22
- /**
23
- * This is the transaction targetting an authority in the SAFE Ecosystem.
24
- *
25
- const sampleTransactionAuthority: ISAFETransactionAuthority = {
26
- createdAt: Date.now(),
27
- authority: '0xAuthorityPublicKey',
28
- authoritySignature: '0xAuthoritySignature',
29
- transaction: {
30
- type: SAFETransactionType.AUTHORITY,
31
- action: SAFETransactionActionType.CREATE,
32
- data: {
33
- authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
34
- authorizationPublicKey: '0xAuthorizationPublicKey',
35
- authorityValidationType: AuthorityValidationType.JWT,
36
- authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
37
- },
38
- },
39
- version: 1,
40
- };
41
- */
42
- /**
43
- * This is the schema for the authority transaction add.
44
- */
45
- exports.ISAFETransactionAuthorityAddSchema = transactions_schema_1.ISAFETransactionBaseSchema.extend({
46
- transaction: zod_1.default.object({
47
- type: zod_1.default.literal(generic_1.SAFETransactionType.AUTHORITY),
48
- action: zod_1.default.literal(generic_1.SAFETransactionActionType.ADD),
49
- data: exports.ISAFETransactionAuthorityDataSchema,
50
- }),
51
- });
52
- /**
53
- * This is the schema for the authority transaction update.
54
- */
55
- exports.ISAFETransactionAuthorityUpdateSchema = transactions_schema_1.ISAFETransactionBaseSchema.extend({
56
- transaction: zod_1.default.object({
57
- type: zod_1.default.literal(generic_1.SAFETransactionType.AUTHORITY),
58
- action: zod_1.default.literal(generic_1.SAFETransactionActionType.UPDATE),
59
- data: exports.ISAFETransactionAuthorityDataSchema,
60
- }),
61
- });
62
- /**
63
- * This is the schema for the authority transaction remove.
64
- */
65
- exports.ISAFETransactionAuthorityRemoveSchema = transactions_schema_1.ISAFETransactionBaseSchema.extend({
66
- transaction: zod_1.default.object({
67
- type: zod_1.default.literal(generic_1.SAFETransactionType.AUTHORITY),
68
- action: zod_1.default.literal(generic_1.SAFETransactionActionType.REMOVE),
69
- data: exports.ISAFETransactionAuthorityDataSchema,
70
- }),
71
- });