@degenerate/endpoints 0.0.6 → 0.0.8
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.
- package/dist/{endpoints/src/cors → cors}/authority/audience/get-set-audiences.d.ts +7 -7
- package/dist/cors/authority/audience/get-set-audiences.d.ts.map +1 -0
- package/dist/{endpoints/src/cors → cors}/authority/audience/get-set-audiences.js +18 -7
- package/dist/cors/authority/jwt/validate-jwt-authorities.d.ts.map +1 -0
- package/dist/{endpoints/src/cors → cors}/authority/jwt/validate-jwt-authorities.js +2 -3
- package/dist/cors/endpoints/authorities/validate-authorities-transaction.d.ts.map +1 -0
- package/dist/cors/endpoints/helpers/validate-request-body.d.ts.map +1 -0
- package/dist/cors/errors/all-error-handler.d.ts.map +1 -0
- package/dist/cors/errors/bad-request-handler.d.ts.map +1 -0
- package/dist/cors/errors/unauthorized-handler.d.ts.map +1 -0
- package/dist/cors/index.d.ts.map +1 -0
- package/dist/cors/routes/authorities.routes.d.ts.map +1 -0
- package/dist/{endpoints/src/cors → cors}/routes/authorities.routes.js +2 -2
- package/dist/cors/routes/events.routes.d.ts.map +1 -0
- package/dist/cors/routes/functions.routes.d.ts.map +1 -0
- package/dist/cors/routes/rules.routes.d.ts.map +1 -0
- package/dist/cors/routes/share-data.routes.d.ts.map +1 -0
- package/dist/examples/express-server/app.d.ts.map +1 -0
- package/dist/examples/express-server/server.d.ts.map +1 -0
- package/dist/{endpoints/src/index.d.ts.map → index.d.ts.map} +1 -1
- package/dist/schema/authorities.schema.d.ts +413 -0
- package/dist/schema/authorities.schema.d.ts.map +1 -0
- package/dist/schema/authorities.schema.js +88 -0
- package/dist/schema/transaction.schema.d.ts +8 -0
- package/dist/schema/transaction.schema.d.ts.map +1 -0
- package/dist/schema/transaction.schema.js +28 -0
- package/package.json +5 -4
- package/dist/endpoints/src/cors/authority/audience/get-set-audiences.d.ts.map +0 -1
- package/dist/endpoints/src/cors/authority/jwt/validate-jwt-authorities.d.ts.map +0 -1
- package/dist/endpoints/src/cors/endpoints/authorities/validate-authorities-transaction.d.ts.map +0 -1
- package/dist/endpoints/src/cors/endpoints/helpers/validate-request-body.d.ts.map +0 -1
- package/dist/endpoints/src/cors/errors/all-error-handler.d.ts.map +0 -1
- package/dist/endpoints/src/cors/errors/bad-request-handler.d.ts.map +0 -1
- package/dist/endpoints/src/cors/errors/unauthorized-handler.d.ts.map +0 -1
- package/dist/endpoints/src/cors/index.d.ts.map +0 -1
- package/dist/endpoints/src/cors/routes/authorities.routes.d.ts.map +0 -1
- package/dist/endpoints/src/cors/routes/events.routes.d.ts.map +0 -1
- package/dist/endpoints/src/cors/routes/functions.routes.d.ts.map +0 -1
- package/dist/endpoints/src/cors/routes/rules.routes.d.ts.map +0 -1
- package/dist/endpoints/src/cors/routes/share-data.routes.d.ts.map +0 -1
- package/dist/endpoints/src/examples/express-server/app.d.ts.map +0 -1
- package/dist/endpoints/src/examples/express-server/server.d.ts.map +0 -1
- package/dist/generic/src/errors/audit-log/audit-log-errors.d.ts +0 -20
- package/dist/generic/src/errors/audit-log/audit-log-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/audit-log/audit-log-errors.js +0 -31
- package/dist/generic/src/errors/authorization/authorization-errors.d.ts +0 -106
- package/dist/generic/src/errors/authorization/authorization-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/authorization/authorization-errors.js +0 -160
- package/dist/generic/src/errors/base-error.d.ts +0 -23
- package/dist/generic/src/errors/base-error.d.ts.map +0 -1
- package/dist/generic/src/errors/base-error.js +0 -34
- package/dist/generic/src/errors/database/database-errors.d.ts +0 -24
- package/dist/generic/src/errors/database/database-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/database/database-errors.js +0 -33
- package/dist/generic/src/errors/generic/generic-errors.d.ts +0 -35
- package/dist/generic/src/errors/generic/generic-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/generic/generic-errors.js +0 -47
- package/dist/generic/src/errors/index.d.ts +0 -10
- package/dist/generic/src/errors/index.d.ts.map +0 -1
- package/dist/generic/src/errors/index.js +0 -26
- package/dist/generic/src/errors/request/request-errors.d.ts +0 -98
- package/dist/generic/src/errors/request/request-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/request/request-errors.js +0 -134
- package/dist/generic/src/errors/safe/safe-rules-errors.d.ts +0 -102
- package/dist/generic/src/errors/safe/safe-rules-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/safe/safe-rules-errors.js +0 -152
- package/dist/generic/src/errors/scheduler/scheduler-errors.d.ts +0 -8
- package/dist/generic/src/errors/scheduler/scheduler-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/scheduler/scheduler-errors.js +0 -14
- package/dist/generic/src/errors/share-data/share-data-errors.d.ts +0 -67
- package/dist/generic/src/errors/share-data/share-data-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/share-data/share-data-errors.js +0 -92
- package/dist/generic/src/models/application/audit-log/application-audit-log-models.d.ts +0 -87
- package/dist/generic/src/models/application/audit-log/application-audit-log-models.d.ts.map +0 -1
- package/dist/generic/src/models/application/audit-log/application-audit-log-models.js +0 -59
- package/dist/generic/src/models/application/database/firestore-models.d.ts +0 -84
- package/dist/generic/src/models/application/database/firestore-models.d.ts.map +0 -1
- package/dist/generic/src/models/application/database/firestore-models.js +0 -4
- package/dist/generic/src/models/authorization/authorization-models.d.ts +0 -81
- package/dist/generic/src/models/authorization/authorization-models.d.ts.map +0 -1
- package/dist/generic/src/models/authorization/authorization-models.js +0 -33
- package/dist/generic/src/models/crypto/crypto-models.d.ts +0 -5
- package/dist/generic/src/models/crypto/crypto-models.d.ts.map +0 -1
- package/dist/generic/src/models/crypto/crypto-models.js +0 -3
- package/dist/generic/src/models/data/data-models.d.ts +0 -24
- package/dist/generic/src/models/data/data-models.d.ts.map +0 -1
- package/dist/generic/src/models/data/data-models.js +0 -3
- package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.d.ts +0 -9
- package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.d.ts.map +0 -1
- package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.js +0 -2
- package/dist/generic/src/models/events/share-event-models.d.ts +0 -65
- package/dist/generic/src/models/events/share-event-models.d.ts.map +0 -1
- package/dist/generic/src/models/events/share-event-models.js +0 -70
- package/dist/generic/src/models/functions/share-data-function-models.d.ts +0 -86
- package/dist/generic/src/models/functions/share-data-function-models.d.ts.map +0 -1
- package/dist/generic/src/models/functions/share-data-function-models.js +0 -17
- package/dist/generic/src/models/generic/request-response-models.d.ts +0 -8
- package/dist/generic/src/models/generic/request-response-models.d.ts.map +0 -1
- package/dist/generic/src/models/generic/request-response-models.js +0 -2
- package/dist/generic/src/models/index.d.ts +0 -13
- package/dist/generic/src/models/index.d.ts.map +0 -1
- package/dist/generic/src/models/index.js +0 -29
- package/dist/generic/src/models/rules/share-rule-models.d.ts +0 -303
- package/dist/generic/src/models/rules/share-rule-models.d.ts.map +0 -1
- package/dist/generic/src/models/rules/share-rule-models.js +0 -93
- package/dist/generic/src/models/safe/safe-transaction-models.d.ts +0 -81
- package/dist/generic/src/models/safe/safe-transaction-models.d.ts.map +0 -1
- package/dist/generic/src/models/safe/safe-transaction-models.js +0 -26
- package/dist/generic/src/models/share-data/share-data.d.ts +0 -56
- package/dist/generic/src/models/share-data/share-data.d.ts.map +0 -1
- package/dist/generic/src/models/share-data/share-data.js +0 -20
- /package/dist/{endpoints/src/cors → cors}/authority/jwt/validate-jwt-authorities.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/endpoints/authorities/validate-authorities-transaction.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/endpoints/authorities/validate-authorities-transaction.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/endpoints/helpers/validate-request-body.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/endpoints/helpers/validate-request-body.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/errors/all-error-handler.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/errors/all-error-handler.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/errors/bad-request-handler.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/errors/bad-request-handler.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/errors/unauthorized-handler.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/errors/unauthorized-handler.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/index.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/index.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/authorities.routes.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/events.routes.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/events.routes.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/functions.routes.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/functions.routes.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/rules.routes.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/rules.routes.js +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/share-data.routes.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/routes/share-data.routes.js +0 -0
- /package/dist/{endpoints/src/examples → examples}/express-server/app.d.ts +0 -0
- /package/dist/{endpoints/src/examples → examples}/express-server/app.js +0 -0
- /package/dist/{endpoints/src/examples → examples}/express-server/server.d.ts +0 -0
- /package/dist/{endpoints/src/examples → examples}/express-server/server.js +0 -0
- /package/dist/{endpoints/src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{endpoints/src/index.js → index.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthorizationAudience } from '@degenerate/generic';
|
|
2
|
-
import { Request } from 'express';
|
|
2
|
+
import { Request, Response, NextFunction } from 'express';
|
|
3
3
|
/**
|
|
4
4
|
* This function gets the audience authority.
|
|
5
5
|
*
|
|
@@ -16,7 +16,7 @@ export declare function getAudienceAuthority(req: Request): AuthorizationAudienc
|
|
|
16
16
|
* @param res the response object
|
|
17
17
|
* @param next the next function
|
|
18
18
|
*/
|
|
19
|
-
export declare function setAudienceAuthority(req: Request): void;
|
|
19
|
+
export declare function setAudienceAuthority(req: Request, res: Response, next: NextFunction): void;
|
|
20
20
|
/**
|
|
21
21
|
* This function sets the audience to share data.
|
|
22
22
|
*
|
|
@@ -24,7 +24,7 @@ export declare function setAudienceAuthority(req: Request): void;
|
|
|
24
24
|
* @param res the response object
|
|
25
25
|
* @param next the next function
|
|
26
26
|
*/
|
|
27
|
-
export declare function setAudienceShareData(req: Request): void;
|
|
27
|
+
export declare function setAudienceShareData(req: Request, res: Response, next: NextFunction): void;
|
|
28
28
|
/**
|
|
29
29
|
* This function sets the audience to functions.
|
|
30
30
|
*
|
|
@@ -32,7 +32,7 @@ export declare function setAudienceShareData(req: Request): void;
|
|
|
32
32
|
* @param res the response object
|
|
33
33
|
* @param next the next function
|
|
34
34
|
*/
|
|
35
|
-
export declare function setAudienceFunctions(req: Request): void;
|
|
35
|
+
export declare function setAudienceFunctions(req: Request, res: Response, next: NextFunction): void;
|
|
36
36
|
/**
|
|
37
37
|
* This function sets the audience to rules.
|
|
38
38
|
*
|
|
@@ -40,7 +40,7 @@ export declare function setAudienceFunctions(req: Request): void;
|
|
|
40
40
|
* @param res the response object
|
|
41
41
|
* @param next the next function
|
|
42
42
|
*/
|
|
43
|
-
export declare function setAudienceRules(req: Request): void;
|
|
43
|
+
export declare function setAudienceRules(req: Request, res: Response, next: NextFunction): void;
|
|
44
44
|
/**
|
|
45
45
|
* This function sets the audience to events.
|
|
46
46
|
*
|
|
@@ -48,7 +48,7 @@ export declare function setAudienceRules(req: Request): void;
|
|
|
48
48
|
* @param res the response object
|
|
49
49
|
* @param next the next function
|
|
50
50
|
*/
|
|
51
|
-
export declare function setAudienceEvents(req: Request): void;
|
|
51
|
+
export declare function setAudienceEvents(req: Request, res: Response, next: NextFunction): void;
|
|
52
52
|
/**
|
|
53
53
|
* This function sets the audience to endpoints.
|
|
54
54
|
*
|
|
@@ -56,5 +56,5 @@ export declare function setAudienceEvents(req: Request): void;
|
|
|
56
56
|
* @param res the response object
|
|
57
57
|
* @param next the next function
|
|
58
58
|
*/
|
|
59
|
-
export declare function setAudienceEndpoints(req: Request): void;
|
|
59
|
+
export declare function setAudienceEndpoints(req: Request, res: Response, next: NextFunction): void;
|
|
60
60
|
//# sourceMappingURL=get-set-audiences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-set-audiences.d.ts","sourceRoot":"","sources":["../../../../src/cors/authority/audience/get-set-audiences.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EAGxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CAGxE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAI1F;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAI1F;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAI1F;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAItF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAIvF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAI1F"}
|
|
@@ -28,9 +28,10 @@ function getAudienceAuthority(req) {
|
|
|
28
28
|
* @param res the response object
|
|
29
29
|
* @param next the next function
|
|
30
30
|
*/
|
|
31
|
-
function setAudienceAuthority(req) {
|
|
32
|
-
console.log('setAudienceAuthority called');
|
|
31
|
+
function setAudienceAuthority(req, res, next) {
|
|
33
32
|
(0, generic_1.setAuthorizationAudience)(req, generic_1.AuthorizationAudience.AUTHORITIES);
|
|
33
|
+
next();
|
|
34
|
+
return;
|
|
34
35
|
}
|
|
35
36
|
;
|
|
36
37
|
/**
|
|
@@ -40,8 +41,10 @@ function setAudienceAuthority(req) {
|
|
|
40
41
|
* @param res the response object
|
|
41
42
|
* @param next the next function
|
|
42
43
|
*/
|
|
43
|
-
function setAudienceShareData(req) {
|
|
44
|
+
function setAudienceShareData(req, res, next) {
|
|
44
45
|
(0, generic_1.setAuthorizationAudience)(req, generic_1.AuthorizationAudience.SHAREDATA);
|
|
46
|
+
next();
|
|
47
|
+
return;
|
|
45
48
|
}
|
|
46
49
|
;
|
|
47
50
|
/**
|
|
@@ -51,8 +54,10 @@ function setAudienceShareData(req) {
|
|
|
51
54
|
* @param res the response object
|
|
52
55
|
* @param next the next function
|
|
53
56
|
*/
|
|
54
|
-
function setAudienceFunctions(req) {
|
|
57
|
+
function setAudienceFunctions(req, res, next) {
|
|
55
58
|
(0, generic_1.setAuthorizationAudience)(req, generic_1.AuthorizationAudience.FUNCTIONS);
|
|
59
|
+
next();
|
|
60
|
+
return;
|
|
56
61
|
}
|
|
57
62
|
;
|
|
58
63
|
/**
|
|
@@ -62,8 +67,10 @@ function setAudienceFunctions(req) {
|
|
|
62
67
|
* @param res the response object
|
|
63
68
|
* @param next the next function
|
|
64
69
|
*/
|
|
65
|
-
function setAudienceRules(req) {
|
|
70
|
+
function setAudienceRules(req, res, next) {
|
|
66
71
|
(0, generic_1.setAuthorizationAudience)(req, generic_1.AuthorizationAudience.RULES);
|
|
72
|
+
next();
|
|
73
|
+
return;
|
|
67
74
|
}
|
|
68
75
|
;
|
|
69
76
|
/**
|
|
@@ -73,8 +80,10 @@ function setAudienceRules(req) {
|
|
|
73
80
|
* @param res the response object
|
|
74
81
|
* @param next the next function
|
|
75
82
|
*/
|
|
76
|
-
function setAudienceEvents(req) {
|
|
83
|
+
function setAudienceEvents(req, res, next) {
|
|
77
84
|
(0, generic_1.setAuthorizationAudience)(req, generic_1.AuthorizationAudience.EVENTS);
|
|
85
|
+
next();
|
|
86
|
+
return;
|
|
78
87
|
}
|
|
79
88
|
;
|
|
80
89
|
/**
|
|
@@ -84,7 +93,9 @@ function setAudienceEvents(req) {
|
|
|
84
93
|
* @param res the response object
|
|
85
94
|
* @param next the next function
|
|
86
95
|
*/
|
|
87
|
-
function setAudienceEndpoints(req) {
|
|
96
|
+
function setAudienceEndpoints(req, res, next) {
|
|
88
97
|
(0, generic_1.setAuthorizationAudience)(req, generic_1.AuthorizationAudience.ENDPOINTS);
|
|
98
|
+
next();
|
|
99
|
+
return;
|
|
89
100
|
}
|
|
90
101
|
;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-jwt-authorities.d.ts","sourceRoot":"","sources":["../../../../src/cors/authority/jwt/validate-jwt-authorities.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,iBAelF"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.validateJWTAuthorities = validateJWTAuthorities;
|
|
5
5
|
const generic_1 = require("@degenerate/generic");
|
|
6
6
|
const get_set_audiences_1 = require("../audience/get-set-audiences");
|
|
7
|
-
const errors_1 = require("@degenerate/generic/src/errors");
|
|
8
7
|
/**
|
|
9
8
|
* This function validates that the incoming request has a valid JWT token and it is authorized
|
|
10
9
|
* for the expected function.
|
|
@@ -23,10 +22,10 @@ async function validateJWTAuthorities(req, res, next) {
|
|
|
23
22
|
// get audience from the request
|
|
24
23
|
const audience = (0, get_set_audiences_1.getAudienceAuthority)(req);
|
|
25
24
|
if (!audience) {
|
|
26
|
-
throw new
|
|
25
|
+
throw new generic_1.RequestNotAuthorizedError('No audience found in the request');
|
|
27
26
|
}
|
|
28
27
|
if (audience !== generic_1.AuthorizationAudience.AUTHORITIES) {
|
|
29
|
-
throw new
|
|
28
|
+
throw new generic_1.RequestNotAuthorizedError('the audience included is not for authorities');
|
|
30
29
|
}
|
|
31
30
|
// check if an Authority is present.
|
|
32
31
|
next();
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-request-body.d.ts","sourceRoot":"","sources":["../../../../src/cors/endpoints/helpers/validate-request-body.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAC/B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,GACnB,IAAI,CAgBN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all-error-handler.d.ts","sourceRoot":"","sources":["../../../src/cors/errors/all-error-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAElE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC3B,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,GACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAOpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bad-request-handler.d.ts","sourceRoot":"","sources":["../../../src/cors/errors/bad-request-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG1D;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,kDAYrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unauthorized-handler.d.ts","sourceRoot":"","sources":["../../../src/cors/errors/unauthorized-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAC/B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,kDAYrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cors/index.ts"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAM9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAI3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AAEzD,cAAc,0DAA0D,CAAC;AACzE,cAAc,2CAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorities.routes.d.ts","sourceRoot":"","sources":["../../../src/cors/routes/authorities.routes.ts"],"names":[],"mappings":"AAuDA,eAAO,MAAM,WAAW,4CAAS,CAAC"}
|
|
@@ -27,8 +27,8 @@ exports.authorities = void 0;
|
|
|
27
27
|
const express = __importStar(require("express"));
|
|
28
28
|
const get_set_audiences_1 = require("../authority/audience/get-set-audiences");
|
|
29
29
|
const validate_jwt_authorities_1 = require("../authority/jwt/validate-jwt-authorities");
|
|
30
|
-
const params_object_helpers_1 = require("@degenerate/generic/src/helpers/request/params-object-helpers");
|
|
31
30
|
const validate_request_body_1 = require("../endpoints/helpers/validate-request-body");
|
|
31
|
+
const generic_1 = require("@degenerate/generic");
|
|
32
32
|
// eslint-disable-next-line new-cap
|
|
33
33
|
const router = express.Router({ mergeParams: true });
|
|
34
34
|
router.use(get_set_audiences_1.setAudienceAuthority); // set the audience to share data (this will throw an error if the audience is not set)
|
|
@@ -50,7 +50,7 @@ router.get('/', async (req, res) => {
|
|
|
50
50
|
});
|
|
51
51
|
router.get('/:authorityid', async (req, res) => {
|
|
52
52
|
console.log('GET /authorities params called');
|
|
53
|
-
const authorityId = (0,
|
|
53
|
+
const authorityId = (0, generic_1.getAuthorityId)(req); // get the authority id.
|
|
54
54
|
console.log(`Authority ID: ${authorityId}`);
|
|
55
55
|
return res.status(200).send({ successful: true, authorityId });
|
|
56
56
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.routes.d.ts","sourceRoot":"","sources":["../../../src/cors/routes/events.routes.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,MAAM,4CAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.routes.d.ts","sourceRoot":"","sources":["../../../src/cors/routes/functions.routes.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,SAAS,4CAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.routes.d.ts","sourceRoot":"","sources":["../../../src/cors/routes/rules.routes.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,KAAK,4CAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-data.routes.d.ts","sourceRoot":"","sources":["../../../src/cors/routes/share-data.routes.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,SAAS,4CAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/examples/express-server/app.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,GAAG,6CAAY,CAAC;AAiBtB,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/examples/express-server/server.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,413 @@
|
|
|
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
|
+
transaction: {
|
|
42
|
+
type: SAFETransactionType;
|
|
43
|
+
action: SAFETransactionActionType;
|
|
44
|
+
};
|
|
45
|
+
createdAt: number;
|
|
46
|
+
authority: string;
|
|
47
|
+
authoritySignature: string;
|
|
48
|
+
version: number;
|
|
49
|
+
}, {
|
|
50
|
+
transaction: {
|
|
51
|
+
type: SAFETransactionType;
|
|
52
|
+
action: SAFETransactionActionType;
|
|
53
|
+
};
|
|
54
|
+
createdAt: number;
|
|
55
|
+
authority: string;
|
|
56
|
+
authoritySignature: string;
|
|
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.
|
|
81
|
+
*/
|
|
82
|
+
export declare const ISAFETransactionAuthoritySchema: 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.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
|
|
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
|
+
data: {
|
|
119
|
+
authorizationIssuer: string;
|
|
120
|
+
authorizationPublicKey: string;
|
|
121
|
+
authorityValidationType: AuthorityValidationType;
|
|
122
|
+
authorityOver: SAFETransactionType[];
|
|
123
|
+
};
|
|
124
|
+
type: SAFETransactionType.AUTHORITY;
|
|
125
|
+
action: SAFETransactionActionType;
|
|
126
|
+
}, {
|
|
127
|
+
data: {
|
|
128
|
+
authorizationIssuer: string;
|
|
129
|
+
authorizationPublicKey: string;
|
|
130
|
+
authorityValidationType: AuthorityValidationType;
|
|
131
|
+
authorityOver: SAFETransactionType[];
|
|
132
|
+
};
|
|
133
|
+
type: SAFETransactionType.AUTHORITY;
|
|
134
|
+
action: SAFETransactionActionType;
|
|
135
|
+
}>;
|
|
136
|
+
}>, "strip", z.ZodTypeAny, {
|
|
137
|
+
transaction: {
|
|
138
|
+
data: {
|
|
139
|
+
authorizationIssuer: string;
|
|
140
|
+
authorizationPublicKey: string;
|
|
141
|
+
authorityValidationType: AuthorityValidationType;
|
|
142
|
+
authorityOver: SAFETransactionType[];
|
|
143
|
+
};
|
|
144
|
+
type: SAFETransactionType.AUTHORITY;
|
|
145
|
+
action: SAFETransactionActionType;
|
|
146
|
+
};
|
|
147
|
+
createdAt: number;
|
|
148
|
+
authority: string;
|
|
149
|
+
authoritySignature: string;
|
|
150
|
+
version: number;
|
|
151
|
+
}, {
|
|
152
|
+
transaction: {
|
|
153
|
+
data: {
|
|
154
|
+
authorizationIssuer: string;
|
|
155
|
+
authorizationPublicKey: string;
|
|
156
|
+
authorityValidationType: AuthorityValidationType;
|
|
157
|
+
authorityOver: SAFETransactionType[];
|
|
158
|
+
};
|
|
159
|
+
type: SAFETransactionType.AUTHORITY;
|
|
160
|
+
action: SAFETransactionActionType;
|
|
161
|
+
};
|
|
162
|
+
createdAt: number;
|
|
163
|
+
authority: string;
|
|
164
|
+
authoritySignature: string;
|
|
165
|
+
version: number;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* This is the schema for the authority transaction add.
|
|
169
|
+
*/
|
|
170
|
+
export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUtil.extendShape<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.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, 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
|
+
data: {
|
|
207
|
+
authorizationIssuer: string;
|
|
208
|
+
authorizationPublicKey: string;
|
|
209
|
+
authorityValidationType: AuthorityValidationType;
|
|
210
|
+
authorityOver: SAFETransactionType[];
|
|
211
|
+
};
|
|
212
|
+
type: SAFETransactionType.AUTHORITY;
|
|
213
|
+
action: SAFETransactionActionType;
|
|
214
|
+
}, {
|
|
215
|
+
data: {
|
|
216
|
+
authorizationIssuer: string;
|
|
217
|
+
authorizationPublicKey: string;
|
|
218
|
+
authorityValidationType: AuthorityValidationType;
|
|
219
|
+
authorityOver: SAFETransactionType[];
|
|
220
|
+
};
|
|
221
|
+
type: SAFETransactionType.AUTHORITY;
|
|
222
|
+
action: SAFETransactionActionType;
|
|
223
|
+
}>;
|
|
224
|
+
}>, {
|
|
225
|
+
transaction: z.ZodObject<{
|
|
226
|
+
action: z.ZodLiteral<SAFETransactionActionType.ADD>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
action: SAFETransactionActionType.ADD;
|
|
229
|
+
}, {
|
|
230
|
+
action: SAFETransactionActionType.ADD;
|
|
231
|
+
}>;
|
|
232
|
+
}>, "strip", z.ZodTypeAny, {
|
|
233
|
+
transaction: {
|
|
234
|
+
action: SAFETransactionActionType.ADD;
|
|
235
|
+
};
|
|
236
|
+
createdAt: number;
|
|
237
|
+
authority: string;
|
|
238
|
+
authoritySignature: string;
|
|
239
|
+
version: number;
|
|
240
|
+
}, {
|
|
241
|
+
transaction: {
|
|
242
|
+
action: SAFETransactionActionType.ADD;
|
|
243
|
+
};
|
|
244
|
+
createdAt: number;
|
|
245
|
+
authority: string;
|
|
246
|
+
authoritySignature: string;
|
|
247
|
+
version: number;
|
|
248
|
+
}>;
|
|
249
|
+
/**
|
|
250
|
+
* This is the schema for the authority transaction update.
|
|
251
|
+
*/
|
|
252
|
+
export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
253
|
+
createdAt: z.ZodNumber;
|
|
254
|
+
authority: z.ZodString;
|
|
255
|
+
authoritySignature: z.ZodString;
|
|
256
|
+
transaction: z.ZodObject<{
|
|
257
|
+
type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
|
|
258
|
+
action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
type: SAFETransactionType;
|
|
261
|
+
action: SAFETransactionActionType;
|
|
262
|
+
}, {
|
|
263
|
+
type: SAFETransactionType;
|
|
264
|
+
action: SAFETransactionActionType;
|
|
265
|
+
}>;
|
|
266
|
+
version: z.ZodNumber;
|
|
267
|
+
}, {
|
|
268
|
+
transaction: z.ZodObject<{
|
|
269
|
+
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
270
|
+
action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
|
|
271
|
+
data: z.ZodObject<{
|
|
272
|
+
authorizationIssuer: z.ZodString;
|
|
273
|
+
authorizationPublicKey: z.ZodString;
|
|
274
|
+
authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
|
|
275
|
+
authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
authorizationIssuer: string;
|
|
278
|
+
authorizationPublicKey: string;
|
|
279
|
+
authorityValidationType: AuthorityValidationType;
|
|
280
|
+
authorityOver: SAFETransactionType[];
|
|
281
|
+
}, {
|
|
282
|
+
authorizationIssuer: string;
|
|
283
|
+
authorizationPublicKey: string;
|
|
284
|
+
authorityValidationType: AuthorityValidationType;
|
|
285
|
+
authorityOver: SAFETransactionType[];
|
|
286
|
+
}>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
data: {
|
|
289
|
+
authorizationIssuer: string;
|
|
290
|
+
authorizationPublicKey: string;
|
|
291
|
+
authorityValidationType: AuthorityValidationType;
|
|
292
|
+
authorityOver: SAFETransactionType[];
|
|
293
|
+
};
|
|
294
|
+
type: SAFETransactionType.AUTHORITY;
|
|
295
|
+
action: SAFETransactionActionType;
|
|
296
|
+
}, {
|
|
297
|
+
data: {
|
|
298
|
+
authorizationIssuer: string;
|
|
299
|
+
authorizationPublicKey: string;
|
|
300
|
+
authorityValidationType: AuthorityValidationType;
|
|
301
|
+
authorityOver: SAFETransactionType[];
|
|
302
|
+
};
|
|
303
|
+
type: SAFETransactionType.AUTHORITY;
|
|
304
|
+
action: SAFETransactionActionType;
|
|
305
|
+
}>;
|
|
306
|
+
}>, {
|
|
307
|
+
transaction: z.ZodObject<{
|
|
308
|
+
action: z.ZodLiteral<SAFETransactionActionType.UPDATE>;
|
|
309
|
+
}, "strip", z.ZodTypeAny, {
|
|
310
|
+
action: SAFETransactionActionType.UPDATE;
|
|
311
|
+
}, {
|
|
312
|
+
action: SAFETransactionActionType.UPDATE;
|
|
313
|
+
}>;
|
|
314
|
+
}>, "strip", z.ZodTypeAny, {
|
|
315
|
+
transaction: {
|
|
316
|
+
action: SAFETransactionActionType.UPDATE;
|
|
317
|
+
};
|
|
318
|
+
createdAt: number;
|
|
319
|
+
authority: string;
|
|
320
|
+
authoritySignature: string;
|
|
321
|
+
version: number;
|
|
322
|
+
}, {
|
|
323
|
+
transaction: {
|
|
324
|
+
action: SAFETransactionActionType.UPDATE;
|
|
325
|
+
};
|
|
326
|
+
createdAt: number;
|
|
327
|
+
authority: string;
|
|
328
|
+
authoritySignature: string;
|
|
329
|
+
version: number;
|
|
330
|
+
}>;
|
|
331
|
+
/**
|
|
332
|
+
* This is the schema for the authority transaction remove.
|
|
333
|
+
*/
|
|
334
|
+
export declare const ISAFETransactionAuthorityRemoveSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
335
|
+
createdAt: z.ZodNumber;
|
|
336
|
+
authority: z.ZodString;
|
|
337
|
+
authoritySignature: z.ZodString;
|
|
338
|
+
transaction: z.ZodObject<{
|
|
339
|
+
type: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
|
|
340
|
+
action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
|
|
341
|
+
}, "strip", z.ZodTypeAny, {
|
|
342
|
+
type: SAFETransactionType;
|
|
343
|
+
action: SAFETransactionActionType;
|
|
344
|
+
}, {
|
|
345
|
+
type: SAFETransactionType;
|
|
346
|
+
action: SAFETransactionActionType;
|
|
347
|
+
}>;
|
|
348
|
+
version: z.ZodNumber;
|
|
349
|
+
}, {
|
|
350
|
+
transaction: z.ZodObject<{
|
|
351
|
+
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
352
|
+
action: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
|
|
353
|
+
data: z.ZodObject<{
|
|
354
|
+
authorizationIssuer: z.ZodString;
|
|
355
|
+
authorizationPublicKey: z.ZodString;
|
|
356
|
+
authorityValidationType: z.ZodEnum<[AuthorityValidationType]>;
|
|
357
|
+
authorityOver: z.ZodArray<z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>, "many">;
|
|
358
|
+
}, "strip", z.ZodTypeAny, {
|
|
359
|
+
authorizationIssuer: string;
|
|
360
|
+
authorizationPublicKey: string;
|
|
361
|
+
authorityValidationType: AuthorityValidationType;
|
|
362
|
+
authorityOver: SAFETransactionType[];
|
|
363
|
+
}, {
|
|
364
|
+
authorizationIssuer: string;
|
|
365
|
+
authorizationPublicKey: string;
|
|
366
|
+
authorityValidationType: AuthorityValidationType;
|
|
367
|
+
authorityOver: SAFETransactionType[];
|
|
368
|
+
}>;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
data: {
|
|
371
|
+
authorizationIssuer: string;
|
|
372
|
+
authorizationPublicKey: string;
|
|
373
|
+
authorityValidationType: AuthorityValidationType;
|
|
374
|
+
authorityOver: SAFETransactionType[];
|
|
375
|
+
};
|
|
376
|
+
type: SAFETransactionType.AUTHORITY;
|
|
377
|
+
action: SAFETransactionActionType;
|
|
378
|
+
}, {
|
|
379
|
+
data: {
|
|
380
|
+
authorizationIssuer: string;
|
|
381
|
+
authorizationPublicKey: string;
|
|
382
|
+
authorityValidationType: AuthorityValidationType;
|
|
383
|
+
authorityOver: SAFETransactionType[];
|
|
384
|
+
};
|
|
385
|
+
type: SAFETransactionType.AUTHORITY;
|
|
386
|
+
action: SAFETransactionActionType;
|
|
387
|
+
}>;
|
|
388
|
+
}>, {
|
|
389
|
+
transaction: z.ZodObject<{
|
|
390
|
+
action: z.ZodLiteral<SAFETransactionActionType.REMOVE>;
|
|
391
|
+
}, "strip", z.ZodTypeAny, {
|
|
392
|
+
action: SAFETransactionActionType.REMOVE;
|
|
393
|
+
}, {
|
|
394
|
+
action: SAFETransactionActionType.REMOVE;
|
|
395
|
+
}>;
|
|
396
|
+
}>, "strip", z.ZodTypeAny, {
|
|
397
|
+
transaction: {
|
|
398
|
+
action: SAFETransactionActionType.REMOVE;
|
|
399
|
+
};
|
|
400
|
+
createdAt: number;
|
|
401
|
+
authority: string;
|
|
402
|
+
authoritySignature: string;
|
|
403
|
+
version: number;
|
|
404
|
+
}, {
|
|
405
|
+
transaction: {
|
|
406
|
+
action: SAFETransactionActionType.REMOVE;
|
|
407
|
+
};
|
|
408
|
+
createdAt: number;
|
|
409
|
+
authority: string;
|
|
410
|
+
authoritySignature: string;
|
|
411
|
+
version: number;
|
|
412
|
+
}>;
|
|
413
|
+
//# sourceMappingURL=authorities.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI7C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhD,CAAC"}
|