@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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ISAFETransactionAuthorityRemoveSchema = exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthoritySchema = exports.ISAFETransactionBaseSchema = exports.ISAFETransactionAuthorityDataSchema = void 0;
|
|
7
|
+
// This contains the schemas for the authorities objects in the zod format..
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const transaction_schema_1 = require("./transaction.schema");
|
|
10
|
+
const generic_1 = require("@degenerate/generic");
|
|
11
|
+
const IAuthorizationIssuerSchema = zod_1.default.string().regex(/^[a-zA-Z0-9]+-[a-zA-Z0-9]+$/);
|
|
12
|
+
const AuthorityValidationTypeSchema = zod_1.default.enum([generic_1.AuthorityValidationType.JWT]);
|
|
13
|
+
/**
|
|
14
|
+
* This is the data for the authority in the SAFE Ecosystem.
|
|
15
|
+
*/
|
|
16
|
+
exports.ISAFETransactionAuthorityDataSchema = zod_1.default.object({
|
|
17
|
+
authorizationIssuer: IAuthorizationIssuerSchema,
|
|
18
|
+
authorizationPublicKey: zod_1.default.string(),
|
|
19
|
+
authorityValidationType: AuthorityValidationTypeSchema,
|
|
20
|
+
authorityOver: zod_1.default.array(transaction_schema_1.SAFETransactionTypeSchema),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* This is the schema for the SAFE transaction base.
|
|
24
|
+
*/
|
|
25
|
+
exports.ISAFETransactionBaseSchema = zod_1.default.object({
|
|
26
|
+
createdAt: zod_1.default.number(), // the javascript timestamp of when the transaction was created
|
|
27
|
+
authority: zod_1.default.string(), // the public key of the authority that created the transaction
|
|
28
|
+
authoritySignature: zod_1.default.string(), // the signature of the authority that created the transaction
|
|
29
|
+
transaction: zod_1.default.object({
|
|
30
|
+
type: transaction_schema_1.SAFETransactionTypeSchema, // the type of transaction
|
|
31
|
+
action: transaction_schema_1.SAFETransactionActionTypeSchema, // the action to perform on the transaction
|
|
32
|
+
}),
|
|
33
|
+
version: zod_1.default.number(), // the version of the transaction
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
37
|
+
*
|
|
38
|
+
const sampleTransactionAuthority: ISAFETransactionAuthority = {
|
|
39
|
+
createdAt: Date.now(),
|
|
40
|
+
authority: '0xAuthorityPublicKey',
|
|
41
|
+
authoritySignature: '0xAuthoritySignature',
|
|
42
|
+
transaction: {
|
|
43
|
+
type: SAFETransactionType.AUTHORITY,
|
|
44
|
+
action: SAFETransactionActionType.CREATE,
|
|
45
|
+
data: {
|
|
46
|
+
authorizationIssuer: 'exampleIssuer-12345678' as IAuthorizationIssuer,
|
|
47
|
+
authorizationPublicKey: '0xAuthorizationPublicKey',
|
|
48
|
+
authorityValidationType: AuthorityValidationType.JWT,
|
|
49
|
+
authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
version: 1,
|
|
53
|
+
};
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* This is the schema for the authority transaction.
|
|
57
|
+
*/
|
|
58
|
+
exports.ISAFETransactionAuthoritySchema = exports.ISAFETransactionBaseSchema.extend({
|
|
59
|
+
transaction: zod_1.default.object({
|
|
60
|
+
type: zod_1.default.literal(generic_1.SAFETransactionType.AUTHORITY),
|
|
61
|
+
action: transaction_schema_1.SAFETransactionActionTypeSchema,
|
|
62
|
+
data: exports.ISAFETransactionAuthorityDataSchema,
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* This is the schema for the authority transaction add.
|
|
67
|
+
*/
|
|
68
|
+
exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthoritySchema.extend({
|
|
69
|
+
transaction: zod_1.default.object({
|
|
70
|
+
action: zod_1.default.literal(generic_1.SAFETransactionActionType.ADD),
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* This is the schema for the authority transaction update.
|
|
75
|
+
*/
|
|
76
|
+
exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthoritySchema.extend({
|
|
77
|
+
transaction: zod_1.default.object({
|
|
78
|
+
action: zod_1.default.literal(generic_1.SAFETransactionActionType.UPDATE),
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* This is the schema for the authority transaction remove.
|
|
83
|
+
*/
|
|
84
|
+
exports.ISAFETransactionAuthorityRemoveSchema = exports.ISAFETransactionAuthoritySchema.extend({
|
|
85
|
+
transaction: zod_1.default.object({
|
|
86
|
+
action: zod_1.default.literal(generic_1.SAFETransactionActionType.REMOVE),
|
|
87
|
+
}),
|
|
88
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { SAFETransactionActionType, SAFETransactionType } from '@degenerate/generic';
|
|
3
|
+
export declare const SAFETransactionTypeSchema: z.ZodEnum<[SAFETransactionType.AUTHORITY, SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS, SAFETransactionType.RULES, SAFETransactionType.EVENTS, SAFETransactionType.ENDPOINTS]>;
|
|
4
|
+
/**
|
|
5
|
+
* This is the type of function that is being targetted in the transaction.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SAFETransactionActionTypeSchema: z.ZodEnum<[SAFETransactionActionType.ADD, SAFETransactionActionType.REMOVE, SAFETransactionActionType.UPDATE]>;
|
|
8
|
+
//# sourceMappingURL=transaction.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.schema.d.ts","sourceRoot":"","sources":["../../src/schema/transaction.schema.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACH,yBAAyB,EACzB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAM7B,eAAO,MAAM,yBAAyB,gMAOpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,+BAA+B,gHAI1C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.SAFETransactionActionTypeSchema = exports.SAFETransactionTypeSchema = void 0;
|
|
7
|
+
//This file contains the schema for the transaction data in the SAFE Ecosystem in zod format.
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const generic_1 = require("@degenerate/generic");
|
|
10
|
+
//#region Enums
|
|
11
|
+
// This is the schema for the authority data.
|
|
12
|
+
exports.SAFETransactionTypeSchema = zod_1.default.enum([
|
|
13
|
+
generic_1.SAFETransactionType.AUTHORITY,
|
|
14
|
+
generic_1.SAFETransactionType.SHAREDATA,
|
|
15
|
+
generic_1.SAFETransactionType.FUNCTIONS,
|
|
16
|
+
generic_1.SAFETransactionType.RULES,
|
|
17
|
+
generic_1.SAFETransactionType.EVENTS,
|
|
18
|
+
generic_1.SAFETransactionType.ENDPOINTS,
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* This is the type of function that is being targetted in the transaction.
|
|
22
|
+
*/
|
|
23
|
+
exports.SAFETransactionActionTypeSchema = zod_1.default.enum([
|
|
24
|
+
generic_1.SAFETransactionActionType.ADD,
|
|
25
|
+
generic_1.SAFETransactionActionType.REMOVE,
|
|
26
|
+
generic_1.SAFETransactionActionType.UPDATE,
|
|
27
|
+
]);
|
|
28
|
+
//#endregion Enums
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@degenerate/endpoints",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"devDependencies": {
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
"author": "Degenerate Inc.",
|
|
40
40
|
"license": "ISC",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@degenerate/generic": "^0.1.
|
|
43
|
-
"express": "^4.21.1"
|
|
42
|
+
"@degenerate/generic": "^0.1.8",
|
|
43
|
+
"express": "^4.21.1",
|
|
44
|
+
"zod": "^3.23.8"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "2037872036e4ccce0805f049b125983d3cb7415b"
|
|
46
47
|
}
|
|
@@ -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"}
|