@degenerate/endpoints 0.0.10 → 0.0.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 (61) hide show
  1. package/README.md +27 -2
  2. package/dist/__tests__/jest.setup.d.ts +10 -0
  3. package/dist/__tests__/jest.setup.d.ts.map +1 -0
  4. package/dist/__tests__/jest.setup.js +2 -0
  5. package/dist/cors/authority/jwt/validate-jwt-authorities.d.ts +2 -2
  6. package/dist/cors/authority/jwt/validate-jwt-authorities.d.ts.map +1 -1
  7. package/dist/cors/authority/jwt/validate-jwt-endpoints.d.ts +16 -0
  8. package/dist/cors/authority/jwt/validate-jwt-endpoints.d.ts.map +1 -0
  9. package/dist/cors/authority/jwt/validate-jwt-endpoints.js +32 -0
  10. package/dist/cors/authority/jwt/validate-jwt-events.d.ts +16 -0
  11. package/dist/cors/authority/jwt/validate-jwt-events.d.ts.map +1 -0
  12. package/dist/cors/authority/jwt/validate-jwt-events.js +32 -0
  13. package/dist/cors/authority/jwt/validate-jwt-functions.d.ts +16 -0
  14. package/dist/cors/authority/jwt/validate-jwt-functions.d.ts.map +1 -0
  15. package/dist/cors/authority/jwt/validate-jwt-functions.js +32 -0
  16. package/dist/cors/authority/jwt/validate-jwt-rules.d.ts +16 -0
  17. package/dist/cors/authority/jwt/validate-jwt-rules.d.ts.map +1 -0
  18. package/dist/cors/authority/jwt/validate-jwt-rules.js +32 -0
  19. package/dist/cors/authority/jwt/validate-jwt-share-data.d.ts +16 -0
  20. package/dist/cors/authority/jwt/validate-jwt-share-data.d.ts.map +1 -0
  21. package/dist/cors/authority/jwt/validate-jwt-share-data.js +32 -0
  22. package/dist/cors/endpoints/helpers/validate-incoming-request-data.d.ts.map +1 -1
  23. package/dist/cors/endpoints/helpers/validate-incoming-request-data.js +1 -0
  24. package/dist/cors/index.d.ts +12 -4
  25. package/dist/cors/index.d.ts.map +1 -1
  26. package/dist/cors/index.js +20 -6
  27. package/dist/cors/logging/add-unique-tracking.d.ts +11 -0
  28. package/dist/cors/logging/add-unique-tracking.d.ts.map +1 -0
  29. package/dist/cors/logging/add-unique-tracking.js +18 -0
  30. package/dist/cors/logging/request-logging.d.ts +11 -0
  31. package/dist/cors/logging/request-logging.d.ts.map +1 -0
  32. package/dist/cors/logging/request-logging.js +26 -0
  33. package/dist/cors/routes/authorities/v1.routes.d.ts +2 -0
  34. package/dist/cors/routes/authorities/v1.routes.d.ts.map +1 -0
  35. package/dist/cors/routes/authorities/v1.routes.js +88 -0
  36. package/dist/cors/routes/authorities.routes.d.ts.map +1 -1
  37. package/dist/cors/routes/authorities.routes.js +8 -61
  38. package/dist/cors/routes/rules/v1/rule-set.routes.d.ts +2 -0
  39. package/dist/cors/routes/rules/v1/rule-set.routes.d.ts.map +1 -0
  40. package/dist/cors/routes/rules/v1/rule-set.routes.js +104 -0
  41. package/dist/cors/routes/rules/v1.routes.d.ts +2 -0
  42. package/dist/cors/routes/rules/v1.routes.d.ts.map +1 -0
  43. package/dist/cors/routes/rules/v1.routes.js +44 -0
  44. package/dist/cors/routes/rules.routes.d.ts.map +1 -1
  45. package/dist/cors/routes/rules.routes.js +6 -24
  46. package/dist/schema/rules-transactions.schema.d.ts +278 -0
  47. package/dist/schema/rules-transactions.schema.d.ts.map +1 -0
  48. package/dist/schema/rules-transactions.schema.js +63 -0
  49. package/dist/schema/transactions.schema.d.ts +44 -0
  50. package/dist/schema/transactions.schema.d.ts.map +1 -0
  51. package/dist/schema/transactions.schema.js +41 -0
  52. package/package.json +3 -3
  53. package/dist/cors/endpoints/authorities/validate-authorities-transaction.d.ts +0 -30
  54. package/dist/cors/endpoints/authorities/validate-authorities-transaction.d.ts.map +0 -1
  55. package/dist/cors/endpoints/authorities/validate-authorities-transaction.js +0 -155
  56. package/dist/schema/authorities.schema.d.ts +0 -343
  57. package/dist/schema/authorities.schema.d.ts.map +0 -1
  58. package/dist/schema/authorities.schema.js +0 -84
  59. package/dist/schema/transaction.schema.d.ts +0 -8
  60. package/dist/schema/transaction.schema.d.ts.map +0 -1
  61. package/dist/schema/transaction.schema.js +0 -28
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.schema.d.ts","sourceRoot":"","sources":["../../src/schema/transactions.schema.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,yBAAyB,oFAOpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,+BAA+B,wCAI1C,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC"}
@@ -0,0 +1,41 @@
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.ISAFETransactionBaseSchema = exports.SAFETransactionActionTypeSchema = exports.SAFETransactionTypeSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ //#region Enums
9
+ // This is the schema for the authority data.
10
+ exports.SAFETransactionTypeSchema = zod_1.default.enum([
11
+ 'AUTHORITY',
12
+ 'SHAREDATA',
13
+ 'FUNCTIONS',
14
+ 'RULES',
15
+ 'EVENTS',
16
+ 'ENDPOINTS',
17
+ ]);
18
+ /**
19
+ * This is the type of function that is being targetted in the transaction.
20
+ */
21
+ exports.SAFETransactionActionTypeSchema = zod_1.default.enum([
22
+ 'ADD',
23
+ 'REMOVE',
24
+ 'UPDATE',
25
+ ]);
26
+ //#endregion Enums
27
+ //#region Transaction
28
+ /**
29
+ * This is the schema for the SAFE transaction base.
30
+ */
31
+ exports.ISAFETransactionBaseSchema = zod_1.default.object({
32
+ createdAt: zod_1.default.number(), // the javascript timestamp of when the transaction was created
33
+ authority: zod_1.default.string(), // the public key of the authority that created the transaction
34
+ authoritySignature: zod_1.default.string(), // the signature of the authority that created the transaction
35
+ transaction: zod_1.default.object({
36
+ type: exports.SAFETransactionTypeSchema, // the type of transaction
37
+ action: exports.SAFETransactionActionTypeSchema, // the action to perform on the transaction
38
+ }),
39
+ version: zod_1.default.number(), // the version of the transaction
40
+ });
41
+ //#endregion Transaction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degenerate/endpoints",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "devDependencies": {
@@ -39,9 +39,9 @@
39
39
  "author": "Degenerate Inc.",
40
40
  "license": "ISC",
41
41
  "dependencies": {
42
- "@degenerate/generic": "^0.1.9",
42
+ "@degenerate/generic": "^0.1.11",
43
43
  "express": "^4.21.1",
44
44
  "zod": "^3.23.8"
45
45
  },
46
- "gitHead": "5e38293cf889de1089ca2cda356191136a493507"
46
+ "gitHead": "737d8d07f08124b2f4c05bd9e4a41c96bd571791"
47
47
  }
@@ -1,30 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- /**
3
- * This takes the incoming object and validates that it is the correct shape
4
- * @param req
5
- * @param res
6
- * @param next
7
- * @returns
8
- */
9
- export declare function validateAuthoritiesTransaction(req: Request, res: Response, next: NextFunction): Response<any, Record<string, any>> | undefined;
10
- /**
11
- * This is the transaction targetting an authority in the SAFE Ecosystem.
12
- *
13
- const sampleTransactionAuthority: ISAFETransactionAuthority = {
14
- createdAt: Date.now(),
15
- authority: '0xAuthorityPublicKey',
16
- authoritySignature: '0xAuthoritySignature',
17
- transaction: {
18
- type: SAFETransactionType.AUTHORITY,
19
- action: SAFETransactionActionType.CREATE,
20
- data: {
21
- authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
22
- authorizationPublicKey: '0xAuthorizationPublicKey',
23
- authorityValidationType: AuthorityValidationType.JWT,
24
- authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
25
- },
26
- },
27
- version: 1,
28
- };
29
- */
30
- //# sourceMappingURL=validate-authorities-transaction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-authorities-transaction.d.ts","sourceRoot":"","sources":["../../../../src/cors/endpoints/authorities/validate-authorities-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,kDAY7F;AAED;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -1,155 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateAuthoritiesTransaction = validateAuthoritiesTransaction;
4
- /**
5
- * This takes the incoming object and validates that it is the correct shape
6
- * @param req
7
- * @param res
8
- * @param next
9
- * @returns
10
- */
11
- function validateAuthoritiesTransaction(req, res, next) {
12
- const { transaction } = req.body;
13
- if (!transaction) {
14
- return res.status(400).send({ error: 'No transaction provided' });
15
- }
16
- if (!transaction.authorities) {
17
- return res.status(400).send({ error: 'No authorities provided' });
18
- }
19
- if (!transaction.authorities.length) {
20
- return res.status(400).send({ error: 'No authorities provided' });
21
- }
22
- next();
23
- }
24
- /**
25
- * This is the transaction targetting an authority in the SAFE Ecosystem.
26
- *
27
- const sampleTransactionAuthority: ISAFETransactionAuthority = {
28
- createdAt: Date.now(),
29
- authority: '0xAuthorityPublicKey',
30
- authoritySignature: '0xAuthoritySignature',
31
- transaction: {
32
- type: SAFETransactionType.AUTHORITY,
33
- action: SAFETransactionActionType.CREATE,
34
- data: {
35
- authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
36
- authorizationPublicKey: '0xAuthorizationPublicKey',
37
- authorityValidationType: AuthorityValidationType.JWT,
38
- authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
39
- },
40
- },
41
- version: 1,
42
- };
43
- */
44
- /* eslint-disable @typescript-eslint/no-explicit-any */
45
- // /**
46
- // * This validates the incoming request for the shape of the add account holder record to a user
47
- // *
48
- // * @param req the incoming request
49
- // * @param res the response
50
- // * @param next the next function
51
- // * @returns
52
- // */
53
- // export function validateAddAccountHolderRecord(req: Request, res: Response, next: NextFunction): void | Response<any> {
54
- // let parsedBody;
55
- // if (typeof req.body === 'object') {
56
- // parsedBody = req.body;
57
- // } else {
58
- // parsedBody = JSON.parse(req.body);
59
- // }
60
- // // if we can't parse the body then it's not a valid object
61
- // if (!parsedBody) throw new RequestObjectValidationFailedError(req.body, 'req.body', 'object');
62
- // const bodyKeys = Object.keys(parsedBody);
63
- // if (bodyKeys.length !== 2) {
64
- // throw new RequestObjectShouldOnlyHaveXPropertiesError(parsedBody, 'req.body', bodyKeys.length, 2);
65
- // }
66
- // if (!validateString(parsedBody.userId, true, false, false)) {
67
- // throw new RequestObjectValidationFailedError(parsedBody.userId, 'userId', 'string');
68
- // }
69
- // if (!validateArray(parsedBody.accountHolderRecords)) {
70
- // throw new RequestObjectValidationFailedError(parsedBody.accountHolderRecords, 'accountHolderRecords', 'array');
71
- // }
72
- // for (const accountHolderRecord of parsedBody.accountHolderRecords) {
73
- // validateAccountHolderRecord(accountHolderRecord);
74
- // }
75
- // req.body = parsedBody as IAccountHolderRecordDoc;
76
- // next();
77
- // return;
78
- // }
79
- // /**
80
- // * Make sure the account holder record is valid
81
- // *
82
- // * @param accountHolderRecord the account holder record
83
- // */
84
- // function validateAccountHolderRecord(accountHolderRecord: any): void {
85
- // if (!accountHolderRecord) throw new RequestObjectValidationFailedError(accountHolderRecord, 'accountHolderRecord', 'object');
86
- // const bodyKeys = Object.keys(accountHolderRecord);
87
- // if (bodyKeys.length !== 3) {
88
- // throw new RequestObjectShouldOnlyHaveXPropertiesError(accountHolderRecord, 'accountHolderRecord', bodyKeys.length, 3);
89
- // }
90
- // if (!validateString(accountHolderRecord.financialEndpointProviderId, false, true, true)) {
91
- // throw new RequestObjectValidationFailedError(accountHolderRecord.financialEndpointProviderId,
92
- // 'financialEndpointProviderId', 'string');
93
- // }
94
- // if (!validateString(accountHolderRecord.institutionId, false, true, true)) {
95
- // throw new RequestObjectValidationFailedError(accountHolderRecord.institutionId, 'institutionId', 'string');
96
- // }
97
- // if (!accountHolderRecord.accountHolder) throw new RequestObjectValidationFailedError(accountHolderRecord, 'accountHolder', 'object');
98
- // validateAccountHolder(accountHolderRecord.accountHolder);
99
- // return;
100
- // }
101
- // /**
102
- // * This validates the account holder object
103
- // *
104
- // * @param accountHolder
105
- // * @returns
106
- // */
107
- // function validateAccountHolder(accountHolder: any): void {
108
- // if (!accountHolder) throw new RequestObjectValidationFailedError(accountHolder, 'accountHolder', 'object');
109
- // const bodyKeys = Object.keys(accountHolder);
110
- // if (bodyKeys.length !== 5) {
111
- // throw new RequestObjectShouldOnlyHaveXPropertiesError(accountHolder, 'accountHolder', bodyKeys.length, 5);
112
- // }
113
- // if (!validateString(accountHolder.accountId, false, true, true)) {
114
- // throw new RequestObjectValidationFailedError(accountHolder.accountId, 'accountId', 'string');
115
- // }
116
- // if (!accountHolder.address) throw new RequestObjectValidationFailedError(accountHolder, 'address', 'object');
117
- // validateAccountHolderAddress(accountHolder.address);
118
- // if (!validateString(accountHolder.name, false, true, true)) {
119
- // throw new RequestObjectValidationFailedError(accountHolder.name, 'name', 'string');
120
- // }
121
- // if (!validateString(accountHolder.email, false, true, true)) {
122
- // throw new RequestObjectValidationFailedError(accountHolder.email, 'email', 'string');
123
- // }
124
- // if (!validateString(accountHolder.phoneNumber, false, true, true)) {
125
- // throw new RequestObjectValidationFailedError(accountHolder.phoneNumber, 'phoneNumber', 'string');
126
- // }
127
- // return;
128
- // }
129
- // /**
130
- // * This validates the account holder address record
131
- // *
132
- // * @param address
133
- // */
134
- // function validateAccountHolderAddress(address: any): void {
135
- // if (!address) throw new RequestObjectValidationFailedError(address, 'address', 'object');
136
- // if (!validateString(address.civicAddress, false, true, true)) {
137
- // throw new RequestObjectValidationFailedError(address.civicAddress, 'civicAddress', 'string');
138
- // }
139
- // if (!validateString(address.city, false, true, true)) {
140
- // throw new RequestObjectValidationFailedError(address.city, 'city', 'string');
141
- // }
142
- // if (!validateString(address.province, false, true, true)) {
143
- // throw new RequestObjectValidationFailedError(address.province, 'province', 'string');
144
- // }
145
- // if (!validateString(address.postalCode, false, true, true)) {
146
- // throw new RequestObjectValidationFailedError(address.postalCode, 'postalCode', 'string');
147
- // }
148
- // if (!validateString(address.poBox, false, true, true)) {
149
- // throw new RequestObjectValidationFailedError(address.poBox, 'poBox', 'string');
150
- // }
151
- // if (!validateString(address.country, false, true, true)) {
152
- // throw new RequestObjectValidationFailedError(address.country, 'country', 'string');
153
- // }
154
- // return;
155
- // }
@@ -1,343 +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 schema for the SAFE transaction base.
24
- */
25
- export declare const ISAFETransactionBaseSchema: z.ZodObject<{
26
- createdAt: z.ZodNumber;
27
- authority: z.ZodString;
28
- authoritySignature: z.ZodString;
29
- transaction: z.ZodObject<{
30
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
31
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
32
- }, "strip", z.ZodTypeAny, {
33
- type: SAFETransactionType;
34
- action: SAFETransactionActionType;
35
- }, {
36
- type: SAFETransactionType;
37
- action: SAFETransactionActionType;
38
- }>;
39
- version: z.ZodNumber;
40
- }, "strip", z.ZodTypeAny, {
41
- createdAt: number;
42
- authority: string;
43
- authoritySignature: string;
44
- transaction: {
45
- type: SAFETransactionType;
46
- action: SAFETransactionActionType;
47
- };
48
- version: number;
49
- }, {
50
- createdAt: number;
51
- authority: string;
52
- authoritySignature: string;
53
- transaction: {
54
- type: SAFETransactionType;
55
- action: SAFETransactionActionType;
56
- };
57
- version: number;
58
- }>;
59
- /**
60
- * This is the transaction targetting an authority in the SAFE Ecosystem.
61
- *
62
- const sampleTransactionAuthority: ISAFETransactionAuthority = {
63
- createdAt: Date.now(),
64
- authority: '0xAuthorityPublicKey',
65
- authoritySignature: '0xAuthoritySignature',
66
- transaction: {
67
- type: SAFETransactionType.AUTHORITY,
68
- action: SAFETransactionActionType.CREATE,
69
- data: {
70
- authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
71
- authorizationPublicKey: '0xAuthorizationPublicKey',
72
- authorityValidationType: AuthorityValidationType.JWT,
73
- authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
74
- },
75
- },
76
- version: 1,
77
- };
78
- */
79
- /**
80
- * This is the schema for the authority transaction add.
81
- */
82
- export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUtil.extendShape<{
83
- createdAt: z.ZodNumber;
84
- authority: z.ZodString;
85
- authoritySignature: z.ZodString;
86
- transaction: z.ZodObject<{
87
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
88
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
89
- }, "strip", z.ZodTypeAny, {
90
- type: SAFETransactionType;
91
- action: SAFETransactionActionType;
92
- }, {
93
- type: SAFETransactionType;
94
- action: SAFETransactionActionType;
95
- }>;
96
- version: z.ZodNumber;
97
- }, {
98
- transaction: z.ZodObject<{
99
- type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
100
- action: z.ZodLiteral<SAFETransactionActionType.ADD>;
101
- data: z.ZodObject<{
102
- authorizationIssuer: z.ZodString;
103
- authorizationPublicKey: z.ZodString;
104
- authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
105
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
106
- }, "strip", z.ZodTypeAny, {
107
- authorizationIssuer: string;
108
- authorizationPublicKey: string;
109
- authorityValidationType: AuthorityValidationType;
110
- authorityOver: SAFETransactionType[];
111
- }, {
112
- authorizationIssuer: string;
113
- authorizationPublicKey: string;
114
- authorityValidationType: AuthorityValidationType;
115
- authorityOver: SAFETransactionType[];
116
- }>;
117
- }, "strip", z.ZodTypeAny, {
118
- type: SAFETransactionType.AUTHORITY;
119
- action: SAFETransactionActionType.ADD;
120
- data: {
121
- authorizationIssuer: string;
122
- authorizationPublicKey: string;
123
- authorityValidationType: AuthorityValidationType;
124
- authorityOver: SAFETransactionType[];
125
- };
126
- }, {
127
- type: SAFETransactionType.AUTHORITY;
128
- action: SAFETransactionActionType.ADD;
129
- data: {
130
- authorizationIssuer: string;
131
- authorizationPublicKey: string;
132
- authorityValidationType: AuthorityValidationType;
133
- authorityOver: SAFETransactionType[];
134
- };
135
- }>;
136
- }>, "strip", z.ZodTypeAny, {
137
- createdAt: number;
138
- authority: string;
139
- authoritySignature: string;
140
- transaction: {
141
- type: SAFETransactionType.AUTHORITY;
142
- action: SAFETransactionActionType.ADD;
143
- data: {
144
- authorizationIssuer: string;
145
- authorizationPublicKey: string;
146
- authorityValidationType: AuthorityValidationType;
147
- authorityOver: SAFETransactionType[];
148
- };
149
- };
150
- version: number;
151
- }, {
152
- createdAt: number;
153
- authority: string;
154
- authoritySignature: string;
155
- transaction: {
156
- type: SAFETransactionType.AUTHORITY;
157
- action: SAFETransactionActionType.ADD;
158
- data: {
159
- authorizationIssuer: string;
160
- authorizationPublicKey: string;
161
- authorityValidationType: AuthorityValidationType;
162
- authorityOver: SAFETransactionType[];
163
- };
164
- };
165
- version: number;
166
- }>;
167
- /**
168
- * This is the schema for the authority transaction update.
169
- */
170
- export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.objectUtil.extendShape<{
171
- createdAt: z.ZodNumber;
172
- authority: z.ZodString;
173
- authoritySignature: z.ZodString;
174
- transaction: z.ZodObject<{
175
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
176
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
177
- }, "strip", z.ZodTypeAny, {
178
- type: SAFETransactionType;
179
- action: SAFETransactionActionType;
180
- }, {
181
- type: SAFETransactionType;
182
- action: SAFETransactionActionType;
183
- }>;
184
- version: z.ZodNumber;
185
- }, {
186
- transaction: z.ZodObject<{
187
- type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
188
- action: z.ZodLiteral<SAFETransactionActionType.UPDATE>;
189
- data: z.ZodObject<{
190
- authorizationIssuer: z.ZodString;
191
- authorizationPublicKey: z.ZodString;
192
- authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
193
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
194
- }, "strip", z.ZodTypeAny, {
195
- authorizationIssuer: string;
196
- authorizationPublicKey: string;
197
- authorityValidationType: AuthorityValidationType;
198
- authorityOver: SAFETransactionType[];
199
- }, {
200
- authorizationIssuer: string;
201
- authorizationPublicKey: string;
202
- authorityValidationType: AuthorityValidationType;
203
- authorityOver: SAFETransactionType[];
204
- }>;
205
- }, "strip", z.ZodTypeAny, {
206
- type: SAFETransactionType.AUTHORITY;
207
- action: SAFETransactionActionType.UPDATE;
208
- data: {
209
- authorizationIssuer: string;
210
- authorizationPublicKey: string;
211
- authorityValidationType: AuthorityValidationType;
212
- authorityOver: SAFETransactionType[];
213
- };
214
- }, {
215
- type: SAFETransactionType.AUTHORITY;
216
- action: SAFETransactionActionType.UPDATE;
217
- data: {
218
- authorizationIssuer: string;
219
- authorizationPublicKey: string;
220
- authorityValidationType: AuthorityValidationType;
221
- authorityOver: SAFETransactionType[];
222
- };
223
- }>;
224
- }>, "strip", z.ZodTypeAny, {
225
- createdAt: number;
226
- authority: string;
227
- authoritySignature: string;
228
- transaction: {
229
- type: SAFETransactionType.AUTHORITY;
230
- action: SAFETransactionActionType.UPDATE;
231
- data: {
232
- authorizationIssuer: string;
233
- authorizationPublicKey: string;
234
- authorityValidationType: AuthorityValidationType;
235
- authorityOver: SAFETransactionType[];
236
- };
237
- };
238
- version: number;
239
- }, {
240
- createdAt: number;
241
- authority: string;
242
- authoritySignature: string;
243
- transaction: {
244
- type: SAFETransactionType.AUTHORITY;
245
- action: SAFETransactionActionType.UPDATE;
246
- data: {
247
- authorizationIssuer: string;
248
- authorizationPublicKey: string;
249
- authorityValidationType: AuthorityValidationType;
250
- authorityOver: SAFETransactionType[];
251
- };
252
- };
253
- version: number;
254
- }>;
255
- /**
256
- * This is the schema for the authority transaction remove.
257
- */
258
- export declare const ISAFETransactionAuthorityRemoveSchema: z.ZodObject<z.objectUtil.extendShape<{
259
- createdAt: z.ZodNumber;
260
- authority: z.ZodString;
261
- authoritySignature: z.ZodString;
262
- transaction: z.ZodObject<{
263
- type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
264
- action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
265
- }, "strip", z.ZodTypeAny, {
266
- type: SAFETransactionType;
267
- action: SAFETransactionActionType;
268
- }, {
269
- type: SAFETransactionType;
270
- action: SAFETransactionActionType;
271
- }>;
272
- version: z.ZodNumber;
273
- }, {
274
- transaction: z.ZodObject<{
275
- type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
276
- action: z.ZodLiteral<SAFETransactionActionType.REMOVE>;
277
- data: z.ZodObject<{
278
- authorizationIssuer: z.ZodString;
279
- authorizationPublicKey: z.ZodString;
280
- authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
281
- authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
282
- }, "strip", z.ZodTypeAny, {
283
- authorizationIssuer: string;
284
- authorizationPublicKey: string;
285
- authorityValidationType: AuthorityValidationType;
286
- authorityOver: SAFETransactionType[];
287
- }, {
288
- authorizationIssuer: string;
289
- authorizationPublicKey: string;
290
- authorityValidationType: AuthorityValidationType;
291
- authorityOver: SAFETransactionType[];
292
- }>;
293
- }, "strip", z.ZodTypeAny, {
294
- type: SAFETransactionType.AUTHORITY;
295
- action: SAFETransactionActionType.REMOVE;
296
- data: {
297
- authorizationIssuer: string;
298
- authorizationPublicKey: string;
299
- authorityValidationType: AuthorityValidationType;
300
- authorityOver: SAFETransactionType[];
301
- };
302
- }, {
303
- type: SAFETransactionType.AUTHORITY;
304
- action: SAFETransactionActionType.REMOVE;
305
- data: {
306
- authorizationIssuer: string;
307
- authorizationPublicKey: string;
308
- authorityValidationType: AuthorityValidationType;
309
- authorityOver: SAFETransactionType[];
310
- };
311
- }>;
312
- }>, "strip", z.ZodTypeAny, {
313
- createdAt: number;
314
- authority: string;
315
- authoritySignature: string;
316
- transaction: {
317
- type: SAFETransactionType.AUTHORITY;
318
- action: SAFETransactionActionType.REMOVE;
319
- data: {
320
- authorizationIssuer: string;
321
- authorizationPublicKey: string;
322
- authorityValidationType: AuthorityValidationType;
323
- authorityOver: SAFETransactionType[];
324
- };
325
- };
326
- version: number;
327
- }, {
328
- createdAt: number;
329
- authority: string;
330
- authoritySignature: string;
331
- transaction: {
332
- type: SAFETransactionType.AUTHORITY;
333
- action: SAFETransactionActionType.REMOVE;
334
- data: {
335
- authorizationIssuer: string;
336
- authorizationPublicKey: string;
337
- authorityValidationType: AuthorityValidationType;
338
- authorityOver: SAFETransactionType[];
339
- };
340
- };
341
- version: number;
342
- }>;
343
- //# sourceMappingURL=authorities.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorities.schema.d.ts","sourceRoot":"","sources":["../../src/schema/authorities.schema.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,EACH,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAK7B;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;EAK9C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;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"}