@dbos-inc/dbos-sdk 4.28.7-preview → 4.28.8-preview
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/schemas/system_db_schema.d.ts +0 -1
- package/dist/schemas/system_db_schema.d.ts.map +1 -1
- package/dist/schemas/system_db_schema.js.map +1 -1
- package/dist/src/client.d.ts +8 -0
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +2 -3
- package/dist/src/client.js.map +1 -1
- package/dist/src/context.d.ts +0 -25
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js.map +1 -1
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +10 -7
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos.d.ts +8 -44
- package/dist/src/dbos.d.ts.map +1 -1
- package/dist/src/dbos.js +6 -75
- package/dist/src/dbos.js.map +1 -1
- package/dist/src/debouncer.d.ts.map +1 -1
- package/dist/src/debouncer.js +9 -0
- package/dist/src/debouncer.js.map +1 -1
- package/dist/src/decorators.d.ts +0 -56
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +7 -331
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/enqueue_options.d.ts.map +1 -1
- package/dist/src/enqueue_options.js +0 -1
- package/dist/src/enqueue_options.js.map +1 -1
- package/dist/src/error.d.ts +0 -8
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +1 -27
- package/dist/src/error.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/scheduler/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler/scheduler.js +0 -1
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/system_database.d.ts +2 -1
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +7 -14
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/workflow.d.ts +2 -1
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js.map +1 -1
- package/dist/src/workflow_management.d.ts.map +1 -1
- package/dist/src/workflow_management.js +0 -1
- package/dist/src/workflow_management.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -4
- package/dist/src/authdecorators.d.ts +0 -2
- package/dist/src/authdecorators.d.ts.map +0 -1
- package/dist/src/authdecorators.js +0 -48
- package/dist/src/authdecorators.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbos-inc/dbos-sdk",
|
|
3
|
-
"version": "4.28.
|
|
3
|
+
"version": "4.28.8-preview",
|
|
4
4
|
"description": "A Typescript framework built on the database",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"@types/jest": "^30.0.0",
|
|
86
86
|
"@types/node": "^20.19.1",
|
|
87
87
|
"@types/pg": "^8.11.2",
|
|
88
|
-
"@types/supertest": "^6.0.2",
|
|
89
88
|
"@types/ws": "^8.18.0",
|
|
90
89
|
"eslint": "^9.22.0",
|
|
91
90
|
"husky": "^9.1.7",
|
|
@@ -93,8 +92,6 @@
|
|
|
93
92
|
"lint-staged": "^15.4.3",
|
|
94
93
|
"prettier": "^3.4.2",
|
|
95
94
|
"publint": "^0.3.21",
|
|
96
|
-
"supertest": "^7.0.0",
|
|
97
|
-
"testcontainers": "^12.0.1",
|
|
98
95
|
"ts-jest": "^29.2.4",
|
|
99
96
|
"typescript": "^5.4.5",
|
|
100
97
|
"typescript-eslint": "^8.26.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authdecorators.d.ts","sourceRoot":"","sources":["../../src/authdecorators.ts"],"names":[],"mappings":"AAsDA,wBAAgB,mBAAmB,SAElC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerAuthChecker = void 0;
|
|
4
|
-
const context_1 = require("./context");
|
|
5
|
-
const dbos_1 = require("./dbos");
|
|
6
|
-
const decorators_1 = require("./decorators");
|
|
7
|
-
const error_1 = require("./error");
|
|
8
|
-
function checkMethodAuth(methReg, args) {
|
|
9
|
-
// Validate the user authentication and populate the role field
|
|
10
|
-
const requiredRoles = methReg.getRequiredRoles();
|
|
11
|
-
if (requiredRoles.length > 0) {
|
|
12
|
-
dbos_1.DBOS.span?.setAttribute('requiredRoles', requiredRoles);
|
|
13
|
-
const curRoles = dbos_1.DBOS.authenticatedRoles;
|
|
14
|
-
let authorized = false;
|
|
15
|
-
const set = new Set(curRoles);
|
|
16
|
-
for (const role of requiredRoles) {
|
|
17
|
-
if (set.has(role)) {
|
|
18
|
-
authorized = true;
|
|
19
|
-
if ((0, context_1.getCurrentContextStore)()) {
|
|
20
|
-
(0, context_1.getCurrentContextStore)().assumedRole = role;
|
|
21
|
-
}
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (!authorized) {
|
|
26
|
-
const err = new error_1.DBOSNotAuthorizedError(`User does not have a role with permission to call ${methReg.name}`, 403);
|
|
27
|
-
dbos_1.DBOS.span?.addEvent('DBOSNotAuthorizedError', { message: err.message });
|
|
28
|
-
throw err;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return args;
|
|
32
|
-
}
|
|
33
|
-
class AuthChecker {
|
|
34
|
-
installMiddleware(methReg) {
|
|
35
|
-
const classAuth = methReg?.defaults?.getRegisteredInfo(decorators_1.DBOS_AUTH);
|
|
36
|
-
const methodAuth = methReg?.getRegisteredInfo(decorators_1.DBOS_AUTH);
|
|
37
|
-
const shouldCheck = classAuth?.requiredRole !== undefined || methodAuth?.requiredRole !== undefined;
|
|
38
|
-
if (shouldCheck) {
|
|
39
|
-
methReg.addEntryInterceptor(checkMethodAuth, 10);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const authChecker = new AuthChecker();
|
|
44
|
-
function registerAuthChecker() {
|
|
45
|
-
(0, decorators_1.registerMiddlewareInstaller)(authChecker);
|
|
46
|
-
}
|
|
47
|
-
exports.registerAuthChecker = registerAuthChecker;
|
|
48
|
-
//# sourceMappingURL=authdecorators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authdecorators.js","sourceRoot":"","sources":["../../src/authdecorators.ts"],"names":[],"mappings":";;;AAAA,uCAAmD;AACnD,iCAA8B;AAC9B,6CAOsB;AACtB,mCAAiD;AAEjD,SAAS,eAAe,CAAC,OAA+B,EAAE,IAAe;IACvE,+DAA+D;IAC/D,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IACjD,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,WAAI,CAAC,IAAI,EAAE,YAAY,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,WAAI,CAAC,kBAAkB,CAAC;QACzC,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClB,UAAU,GAAG,IAAI,CAAC;gBAClB,IAAI,IAAA,gCAAsB,GAAE,EAAE,CAAC;oBAC7B,IAAA,gCAAsB,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC/C,CAAC;gBACD,MAAM;YACR,CAAC;QACH,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,IAAI,8BAAsB,CAAC,qDAAqD,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CA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