@degenerate/endpoints 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cors/authority/audience/get-set-audiences.d.ts.map +1 -0
- 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/package.json +2 -2
- 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/audience/get-set-audiences.d.ts +0 -0
- /package/dist/{endpoints/src/cors → cors}/authority/audience/get-set-audiences.js +0 -0
- /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
|
@@ -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,MAAM,SAAS,CAAC;AAElC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CAGxE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAGhD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,QAE5C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,QAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAEhD"}
|
|
@@ -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":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@degenerate/endpoints",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"devDependencies": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@degenerate/generic": "^0.1.7",
|
|
43
43
|
"express": "^4.21.1"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "d158ea8a4c8109a7a5373cbd3d5c89f89888af6e"
|
|
46
46
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,SAAS,CAAC;AAElC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CAGxE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAGhD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,QAE5C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,QAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,QAEhD"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/endpoints/src/cors/endpoints/authorities/validate-authorities-transaction.d.ts.map
DELETED
|
@@ -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 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorities.routes.d.ts","sourceRoot":"","sources":["../../../../../src/cors/routes/authorities.routes.ts"],"names":[],"mappings":"AAuDA,eAAO,MAAM,WAAW,4CAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.routes.d.ts","sourceRoot":"","sources":["../../../../../src/cors/routes/events.routes.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,MAAM,4CAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.routes.d.ts","sourceRoot":"","sources":["../../../../../src/cors/routes/functions.routes.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,SAAS,4CAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rules.routes.d.ts","sourceRoot":"","sources":["../../../../../src/cors/routes/rules.routes.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,KAAK,4CAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../src/examples/express-server/server.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseError } from '../base-error';
|
|
2
|
-
/**
|
|
3
|
-
* This is throw when the Audit Log Additional Id's reference id is not provided.
|
|
4
|
-
*/
|
|
5
|
-
export declare class AuditLogAlaiIdNotProvidedError extends BaseError {
|
|
6
|
-
/**
|
|
7
|
-
* This is throw when the Additional Log Additional Id's reference id is not provided.
|
|
8
|
-
*/
|
|
9
|
-
constructor();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* This is throw when the Audit Log Additional Id's query is not provided.
|
|
13
|
-
*/
|
|
14
|
-
export declare class AuditLogAlaiQueryNotProvidedError extends BaseError {
|
|
15
|
-
/**
|
|
16
|
-
* This is throw when the Audit Log Additional Id's query is not provided.
|
|
17
|
-
*/
|
|
18
|
-
constructor();
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=audit-log-errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log-errors.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/errors/audit-log/audit-log-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,SAAS;IACzD;;OAEG;;CAIN;AAED;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,SAAS;IAC5D;;OAEG;;CAIN"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuditLogAlaiQueryNotProvidedError = exports.AuditLogAlaiIdNotProvidedError = void 0;
|
|
4
|
-
// This file contains the errors for that can occur in the audit log.
|
|
5
|
-
const base_error_1 = require("../base-error");
|
|
6
|
-
//#region Audit Log Additional Id's Errors
|
|
7
|
-
/**
|
|
8
|
-
* This is throw when the Audit Log Additional Id's reference id is not provided.
|
|
9
|
-
*/
|
|
10
|
-
class AuditLogAlaiIdNotProvidedError extends base_error_1.BaseError {
|
|
11
|
-
/**
|
|
12
|
-
* This is throw when the Additional Log Additional Id's reference id is not provided.
|
|
13
|
-
*/
|
|
14
|
-
constructor() {
|
|
15
|
-
super('Audit Log Additional Id\'s reference id is not provided');
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.AuditLogAlaiIdNotProvidedError = AuditLogAlaiIdNotProvidedError;
|
|
19
|
-
/**
|
|
20
|
-
* This is throw when the Audit Log Additional Id's query is not provided.
|
|
21
|
-
*/
|
|
22
|
-
class AuditLogAlaiQueryNotProvidedError extends base_error_1.BaseError {
|
|
23
|
-
/**
|
|
24
|
-
* This is throw when the Audit Log Additional Id's query is not provided.
|
|
25
|
-
*/
|
|
26
|
-
constructor() {
|
|
27
|
-
super('Audit Log Additional Id\'s query is not provided');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.AuditLogAlaiQueryNotProvidedError = AuditLogAlaiQueryNotProvidedError;
|
|
31
|
-
//#endregion Audit Log Additional Id's Errors
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { AuthorityValidationType } from '../../models/authorization/authorization-models';
|
|
2
|
-
import { BaseError } from '../base-error';
|
|
3
|
-
/**
|
|
4
|
-
* This is thrown when the removal of a IJWTAuthority fails because it does not exist.
|
|
5
|
-
*/
|
|
6
|
-
export declare class SafeAuthorizationIssuerDoesNotExistError extends BaseError {
|
|
7
|
-
constructor(issuer: string);
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* This is thrown when a authority validation request is received the type of validation requested is unknown.
|
|
11
|
-
* (this should not happen).
|
|
12
|
-
*/
|
|
13
|
-
export declare class SafeAuthorizationAuthorityValidationTypeNotValidError extends BaseError {
|
|
14
|
-
constructor(validationType: AuthorityValidationType);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* This is throw when a database records is not found.
|
|
18
|
-
*/
|
|
19
|
-
export declare class SafeAuthorizationSubjectNotValidError extends BaseError {
|
|
20
|
-
constructor(subjectType: string, subjectId: string);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* This is thrown when the public key given for the issuer is not valid.
|
|
24
|
-
*/
|
|
25
|
-
export declare class SafeAuthorizationIssuerPublicKeyNotValidError extends BaseError {
|
|
26
|
-
constructor(issuerName: string, publicKey: string);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This is thrown when the issuer is not valid.
|
|
30
|
-
*/
|
|
31
|
-
export declare class SafeAuthorizationIssuerNotValidError extends BaseError {
|
|
32
|
-
constructor(issuer: string);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* This is thrown when the JWT token is not the corrent base64 encoding
|
|
36
|
-
*/
|
|
37
|
-
export declare class SafeAuthorizationTokenNotBase64Error extends BaseError {
|
|
38
|
-
constructor();
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* This is thrown when the secret key or public key is not included for token verification.
|
|
42
|
-
*/
|
|
43
|
-
export declare class SafeAuthorizationKeyNotIncludedForVerificationError extends BaseError {
|
|
44
|
-
constructor();
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* This is thrown when the authorization payload is not valid.
|
|
48
|
-
*/
|
|
49
|
-
export declare class SafeAuthorizationPayloadNotValidError extends BaseError {
|
|
50
|
-
constructor();
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* This is thrown when the type of data in a token is not valid
|
|
54
|
-
*/
|
|
55
|
-
export declare class SafeAuthorizationTokenPropertyDataTypeNotValidError extends BaseError {
|
|
56
|
-
constructor(property: string, propertyValue: any, expectedDataType: string);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* This is thrown when the authorization payload is missing a property
|
|
60
|
-
*/
|
|
61
|
-
export declare class SafeAuthorizationMissingPropertyError extends BaseError {
|
|
62
|
-
constructor(property: string);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* This is thrown when the issued at time is before the current time
|
|
66
|
-
*/
|
|
67
|
-
export declare class SafeAuthorizationTokenIssuedAtTimeNotValidError extends BaseError {
|
|
68
|
-
constructor();
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* This is thrown not authorization exists on the request.
|
|
72
|
-
*/
|
|
73
|
-
export declare class SafeAuthorizationNotExistsError extends BaseError {
|
|
74
|
-
constructor();
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* This is thrown when the bearer token is not found
|
|
78
|
-
*/
|
|
79
|
-
export declare class SafeAuthorizationBearerTokenNotFound extends BaseError {
|
|
80
|
-
constructor();
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* This is thrown when the authorization request headers are not found.
|
|
84
|
-
*/
|
|
85
|
-
export declare class SafeRequestAuthorizationHeadersNotFound extends BaseError {
|
|
86
|
-
constructor();
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* This is thrown when the authorization is not found in the request headers.
|
|
90
|
-
*/
|
|
91
|
-
export declare class SafeRequestAuthorizationHeaderNotFound extends BaseError {
|
|
92
|
-
constructor();
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* This is thrown when the Issuer does not match the expected issuer.
|
|
96
|
-
*/
|
|
97
|
-
export declare class SafeAuthorizationIssuerNotMatchingExpectedError extends BaseError {
|
|
98
|
-
constructor(expectedIssuer: string, actualIssuer: string);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* This is thrown when the decoded token null or a string (not an object)
|
|
102
|
-
*/
|
|
103
|
-
export declare class SafeAuthorizationTokenNotObjectError extends BaseError {
|
|
104
|
-
constructor();
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=authorization-errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-errors.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/errors/authorization/authorization-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,qBAAa,wCAAyC,SAAQ,SAAS;gBACvD,MAAM,EAAE,MAAM;CAG7B;AAED;;;GAGG;AACH,qBAAa,qDAAsD,SAAQ,SAAS;gBACpE,cAAc,EAAE,uBAAuB;CAGtD;AAED;;GAEG;AACH,qBAAa,qCAAsC,SAAQ,SAAS;gBACpD,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAGrD;AAED;;GAEG;AACH,qBAAa,6CAA8C,SAAQ,SAAS;gBAC5D,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAGpD;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,SAAS;gBACnD,MAAM,EAAE,MAAM;CAG7B;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,SAAS;;CAIlE;AAED;;GAEG;AACH,qBAAa,mDAAoD,SAAQ,SAAS;;CAIjF;AAED;;GAEG;AACH,qBAAa,qCAAsC,SAAQ,SAAS;;CAInE;AAED;;GAEG;AACH,qBAAa,mDAAoD,SAAQ,SAAS;gBAClE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM;CAG7E;AAED;;GAEG;AACH,qBAAa,qCAAsC,SAAQ,SAAS;gBACpD,QAAQ,EAAE,MAAM;CAG/B;AAED;;GAEG;AACH,qBAAa,+CAAgD,SAAQ,SAAS;;CAI7E;AAED;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;;CAI7D;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,SAAS;;CAIlE;AAKD;;GAEG;AACH,qBAAa,uCAAwC,SAAQ,SAAS;;CAIrE;AAED;;GAEG;AACH,qBAAa,sCAAuC,SAAQ,SAAS;;CAIpE;AAED;;GAEG;AACH,qBAAa,+CAAgD,SAAQ,SAAS;gBAC9D,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAG3D;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,SAAS;;CAIlE"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SafeAuthorizationTokenNotObjectError = exports.SafeAuthorizationIssuerNotMatchingExpectedError = exports.SafeRequestAuthorizationHeaderNotFound = exports.SafeRequestAuthorizationHeadersNotFound = exports.SafeAuthorizationBearerTokenNotFound = exports.SafeAuthorizationNotExistsError = exports.SafeAuthorizationTokenIssuedAtTimeNotValidError = exports.SafeAuthorizationMissingPropertyError = exports.SafeAuthorizationTokenPropertyDataTypeNotValidError = exports.SafeAuthorizationPayloadNotValidError = exports.SafeAuthorizationKeyNotIncludedForVerificationError = exports.SafeAuthorizationTokenNotBase64Error = exports.SafeAuthorizationIssuerNotValidError = exports.SafeAuthorizationIssuerPublicKeyNotValidError = exports.SafeAuthorizationSubjectNotValidError = exports.SafeAuthorizationAuthorityValidationTypeNotValidError = exports.SafeAuthorizationIssuerDoesNotExistError = void 0;
|
|
4
|
-
const base_error_1 = require("../base-error");
|
|
5
|
-
/**
|
|
6
|
-
* This is thrown when the removal of a IJWTAuthority fails because it does not exist.
|
|
7
|
-
*/
|
|
8
|
-
class SafeAuthorizationIssuerDoesNotExistError extends base_error_1.BaseError {
|
|
9
|
-
constructor(issuer) {
|
|
10
|
-
super(`The authorization issuer ${issuer} does not exist`);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.SafeAuthorizationIssuerDoesNotExistError = SafeAuthorizationIssuerDoesNotExistError;
|
|
14
|
-
/**
|
|
15
|
-
* This is thrown when a authority validation request is received the type of validation requested is unknown.
|
|
16
|
-
* (this should not happen).
|
|
17
|
-
*/
|
|
18
|
-
class SafeAuthorizationAuthorityValidationTypeNotValidError extends base_error_1.BaseError {
|
|
19
|
-
constructor(validationType) {
|
|
20
|
-
super(`The authority validation type is not valid, the type is ${validationType}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.SafeAuthorizationAuthorityValidationTypeNotValidError = SafeAuthorizationAuthorityValidationTypeNotValidError;
|
|
24
|
-
/**
|
|
25
|
-
* This is throw when a database records is not found.
|
|
26
|
-
*/
|
|
27
|
-
class SafeAuthorizationSubjectNotValidError extends base_error_1.BaseError {
|
|
28
|
-
constructor(subjectType, subjectId) {
|
|
29
|
-
super(`The authorization subject ${subjectType} with id ${subjectId} is not valid`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.SafeAuthorizationSubjectNotValidError = SafeAuthorizationSubjectNotValidError;
|
|
33
|
-
/**
|
|
34
|
-
* This is thrown when the public key given for the issuer is not valid.
|
|
35
|
-
*/
|
|
36
|
-
class SafeAuthorizationIssuerPublicKeyNotValidError extends base_error_1.BaseError {
|
|
37
|
-
constructor(issuerName, publicKey) {
|
|
38
|
-
super(`The authorization issuer ${issuerName} with public key ${publicKey} is not valid`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.SafeAuthorizationIssuerPublicKeyNotValidError = SafeAuthorizationIssuerPublicKeyNotValidError;
|
|
42
|
-
/**
|
|
43
|
-
* This is thrown when the issuer is not valid.
|
|
44
|
-
*/
|
|
45
|
-
class SafeAuthorizationIssuerNotValidError extends base_error_1.BaseError {
|
|
46
|
-
constructor(issuer) {
|
|
47
|
-
super(`The authorization issuer ${issuer} is not valid`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.SafeAuthorizationIssuerNotValidError = SafeAuthorizationIssuerNotValidError;
|
|
51
|
-
/**
|
|
52
|
-
* This is thrown when the JWT token is not the corrent base64 encoding
|
|
53
|
-
*/
|
|
54
|
-
class SafeAuthorizationTokenNotBase64Error extends base_error_1.BaseError {
|
|
55
|
-
constructor() {
|
|
56
|
-
super('The authorization token is not a valid base64 encoding');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.SafeAuthorizationTokenNotBase64Error = SafeAuthorizationTokenNotBase64Error;
|
|
60
|
-
/**
|
|
61
|
-
* This is thrown when the secret key or public key is not included for token verification.
|
|
62
|
-
*/
|
|
63
|
-
class SafeAuthorizationKeyNotIncludedForVerificationError extends base_error_1.BaseError {
|
|
64
|
-
constructor() {
|
|
65
|
-
super('The secret of public key is not included for token verification');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.SafeAuthorizationKeyNotIncludedForVerificationError = SafeAuthorizationKeyNotIncludedForVerificationError;
|
|
69
|
-
/**
|
|
70
|
-
* This is thrown when the authorization payload is not valid.
|
|
71
|
-
*/
|
|
72
|
-
class SafeAuthorizationPayloadNotValidError extends base_error_1.BaseError {
|
|
73
|
-
constructor() {
|
|
74
|
-
super('The authorization payload is not valid');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.SafeAuthorizationPayloadNotValidError = SafeAuthorizationPayloadNotValidError;
|
|
78
|
-
/**
|
|
79
|
-
* This is thrown when the type of data in a token is not valid
|
|
80
|
-
*/
|
|
81
|
-
class SafeAuthorizationTokenPropertyDataTypeNotValidError extends base_error_1.BaseError {
|
|
82
|
-
constructor(property, propertyValue, expectedDataType) {
|
|
83
|
-
super(`The property ${property} with value ${propertyValue} is not a valid ${expectedDataType}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.SafeAuthorizationTokenPropertyDataTypeNotValidError = SafeAuthorizationTokenPropertyDataTypeNotValidError;
|
|
87
|
-
/**
|
|
88
|
-
* This is thrown when the authorization payload is missing a property
|
|
89
|
-
*/
|
|
90
|
-
class SafeAuthorizationMissingPropertyError extends base_error_1.BaseError {
|
|
91
|
-
constructor(property) {
|
|
92
|
-
super(`The authorization payload is missing the property ${property}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.SafeAuthorizationMissingPropertyError = SafeAuthorizationMissingPropertyError;
|
|
96
|
-
/**
|
|
97
|
-
* This is thrown when the issued at time is before the current time
|
|
98
|
-
*/
|
|
99
|
-
class SafeAuthorizationTokenIssuedAtTimeNotValidError extends base_error_1.BaseError {
|
|
100
|
-
constructor() {
|
|
101
|
-
super('The issued at time of the token is not valid: ');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.SafeAuthorizationTokenIssuedAtTimeNotValidError = SafeAuthorizationTokenIssuedAtTimeNotValidError;
|
|
105
|
-
/**
|
|
106
|
-
* This is thrown not authorization exists on the request.
|
|
107
|
-
*/
|
|
108
|
-
class SafeAuthorizationNotExistsError extends base_error_1.BaseError {
|
|
109
|
-
constructor() {
|
|
110
|
-
super('The authorization does not exist');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.SafeAuthorizationNotExistsError = SafeAuthorizationNotExistsError;
|
|
114
|
-
/**
|
|
115
|
-
* This is thrown when the bearer token is not found
|
|
116
|
-
*/
|
|
117
|
-
class SafeAuthorizationBearerTokenNotFound extends base_error_1.BaseError {
|
|
118
|
-
constructor() {
|
|
119
|
-
super('The bearer token is not found');
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.SafeAuthorizationBearerTokenNotFound = SafeAuthorizationBearerTokenNotFound;
|
|
123
|
-
//#region Safe Request Authorization Errors
|
|
124
|
-
/**
|
|
125
|
-
* This is thrown when the authorization request headers are not found.
|
|
126
|
-
*/
|
|
127
|
-
class SafeRequestAuthorizationHeadersNotFound extends base_error_1.BaseError {
|
|
128
|
-
constructor() {
|
|
129
|
-
super('The authorization request headers are not found');
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
exports.SafeRequestAuthorizationHeadersNotFound = SafeRequestAuthorizationHeadersNotFound;
|
|
133
|
-
/**
|
|
134
|
-
* This is thrown when the authorization is not found in the request headers.
|
|
135
|
-
*/
|
|
136
|
-
class SafeRequestAuthorizationHeaderNotFound extends base_error_1.BaseError {
|
|
137
|
-
constructor() {
|
|
138
|
-
super('The authorization header is not found');
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
exports.SafeRequestAuthorizationHeaderNotFound = SafeRequestAuthorizationHeaderNotFound;
|
|
142
|
-
/**
|
|
143
|
-
* This is thrown when the Issuer does not match the expected issuer.
|
|
144
|
-
*/
|
|
145
|
-
class SafeAuthorizationIssuerNotMatchingExpectedError extends base_error_1.BaseError {
|
|
146
|
-
constructor(expectedIssuer, actualIssuer) {
|
|
147
|
-
super(`The expected issuer ${expectedIssuer} does not match the actual issuer ${actualIssuer}`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
exports.SafeAuthorizationIssuerNotMatchingExpectedError = SafeAuthorizationIssuerNotMatchingExpectedError;
|
|
151
|
-
/**
|
|
152
|
-
* This is thrown when the decoded token null or a string (not an object)
|
|
153
|
-
*/
|
|
154
|
-
class SafeAuthorizationTokenNotObjectError extends base_error_1.BaseError {
|
|
155
|
-
constructor() {
|
|
156
|
-
super('The decoded token is not an object');
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.SafeAuthorizationTokenNotObjectError = SafeAuthorizationTokenNotObjectError;
|
|
160
|
-
//#endregion Safe Request Authorization Errors
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is the base error class that all other errors should extend from.
|
|
3
|
-
*/
|
|
4
|
-
export declare class BaseError extends Error {
|
|
5
|
-
errorCode?: number;
|
|
6
|
-
/**
|
|
7
|
-
* This is the base error type for the application.
|
|
8
|
-
*
|
|
9
|
-
* @param message the message to include.
|
|
10
|
-
* @param errorCode the error code if we want to include one.
|
|
11
|
-
*/
|
|
12
|
-
constructor(message: string, errorCode?: number);
|
|
13
|
-
/**
|
|
14
|
-
* This function returns the error as a JSON object.
|
|
15
|
-
*/
|
|
16
|
-
toJSON(): {
|
|
17
|
-
message: string;
|
|
18
|
-
errorType: string;
|
|
19
|
-
errorCode: number | undefined;
|
|
20
|
-
stack: string | undefined;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=base-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-error.d.ts","sourceRoot":"","sources":["../../../../../generic/src/errors/base-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAU/C;;OAEG;IACI,MAAM;;;;;;CAQhB"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseError = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This is the base error class that all other errors should extend from.
|
|
6
|
-
*/
|
|
7
|
-
class BaseError extends Error {
|
|
8
|
-
/**
|
|
9
|
-
* This is the base error type for the application.
|
|
10
|
-
*
|
|
11
|
-
* @param message the message to include.
|
|
12
|
-
* @param errorCode the error code if we want to include one.
|
|
13
|
-
*/
|
|
14
|
-
constructor(message, errorCode) {
|
|
15
|
-
super(message); // Pass the message to the Error constructor
|
|
16
|
-
this.name = this.constructor.name; // Set the name of the error
|
|
17
|
-
this.errorCode = errorCode; // Set the error code
|
|
18
|
-
// This line is needed to restore the correct prototype chain.
|
|
19
|
-
// (see note below)
|
|
20
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* This function returns the error as a JSON object.
|
|
24
|
-
*/
|
|
25
|
-
toJSON() {
|
|
26
|
-
return {
|
|
27
|
-
message: this.message,
|
|
28
|
-
errorType: this.name,
|
|
29
|
-
errorCode: this.errorCode,
|
|
30
|
-
stack: this.stack,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.BaseError = BaseError;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BaseError } from '../base-error';
|
|
2
|
-
/**
|
|
3
|
-
* This is throw when a database records is not found.
|
|
4
|
-
*/
|
|
5
|
-
export declare class DatabaseRecordNotFoundError extends BaseError {
|
|
6
|
-
/**
|
|
7
|
-
* This is thrown when a database record is not found.
|
|
8
|
-
*
|
|
9
|
-
* @param databasePath the path to the database record.
|
|
10
|
-
*/
|
|
11
|
-
constructor(databasePath: string);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* This is throw when too many database records are found.
|
|
15
|
-
*/
|
|
16
|
-
export declare class DatabaseTooManyRecordsError extends BaseError {
|
|
17
|
-
/**
|
|
18
|
-
* This is thrown when too many database records are found.
|
|
19
|
-
*
|
|
20
|
-
* @param databasePath the path to the database record.
|
|
21
|
-
*/
|
|
22
|
-
constructor(databasePath: string);
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=database-errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"database-errors.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/errors/database/database-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;IACtD;;;;OAIG;gBACS,YAAY,EAAE,MAAM;CAGnC;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,SAAS;IACtD;;;;OAIG;gBACS,YAAY,EAAE,MAAM;CAGnC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatabaseTooManyRecordsError = exports.DatabaseRecordNotFoundError = void 0;
|
|
4
|
-
// This file contains all the errors that are related to database records.
|
|
5
|
-
const base_error_1 = require("../base-error");
|
|
6
|
-
/**
|
|
7
|
-
* This is throw when a database records is not found.
|
|
8
|
-
*/
|
|
9
|
-
class DatabaseRecordNotFoundError extends base_error_1.BaseError {
|
|
10
|
-
/**
|
|
11
|
-
* This is thrown when a database record is not found.
|
|
12
|
-
*
|
|
13
|
-
* @param databasePath the path to the database record.
|
|
14
|
-
*/
|
|
15
|
-
constructor(databasePath) {
|
|
16
|
-
super(`The database record at ${databasePath} was not found`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.DatabaseRecordNotFoundError = DatabaseRecordNotFoundError;
|
|
20
|
-
/**
|
|
21
|
-
* This is throw when too many database records are found.
|
|
22
|
-
*/
|
|
23
|
-
class DatabaseTooManyRecordsError extends base_error_1.BaseError {
|
|
24
|
-
/**
|
|
25
|
-
* This is thrown when too many database records are found.
|
|
26
|
-
*
|
|
27
|
-
* @param databasePath the path to the database record.
|
|
28
|
-
*/
|
|
29
|
-
constructor(databasePath) {
|
|
30
|
-
super(`Too many records found at ${databasePath}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.DatabaseTooManyRecordsError = DatabaseTooManyRecordsError;
|