@dbos-inc/dbos-sdk 0.8.45-preview.g56ba028de5 → 0.8.48-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
- package/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
- package/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
- package/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
- package/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/register-app.js +1 -2
- package/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/update-app.js +1 -2
- package/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
- package/dist/packages/dbos-cloud/cli.js +0 -12
- package/dist/packages/dbos-cloud/cli.js.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
- package/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.js +44 -3
- package/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
- package/dist/packages/dbos-cloud/login.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/login.js +3 -4
- package/dist/packages/dbos-cloud/login.js.map +1 -1
- package/dist/packages/dbos-cloud/register.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/register.js +1 -2
- package/dist/packages/dbos-cloud/register.js.map +1 -1
- package/dist/packages/dbos-cloud/userdb.d.ts +0 -2
- package/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/userdb.js +4 -177
- package/dist/packages/dbos-cloud/userdb.js.map +1 -1
- package/dist/src/context.d.ts +1 -0
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/dbos-executor.d.ts +0 -1
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +4 -8
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.js +15 -2
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.d.ts +3 -0
- package/dist/src/dbos-runtime/migrate.d.ts.map +1 -0
- package/dist/src/dbos-runtime/migrate.js +175 -0
- package/dist/src/dbos-runtime/migrate.js.map +1 -0
- package/dist/src/dbos-runtime/runtime.d.ts +7 -9
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +35 -21
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +3 -2
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +10 -7
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +23 -29
- package/dist/src/httpServer/server.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/system_database.d.ts +2 -0
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +31 -16
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/collector.d.ts.map +1 -1
- package/dist/src/telemetry/collector.js +1 -0
- package/dist/src/telemetry/collector.js.map +1 -1
- package/dist/src/telemetry/exporters.d.ts +2 -0
- package/dist/src/telemetry/exporters.d.ts.map +1 -1
- package/dist/src/telemetry/exporters.js +4 -0
- package/dist/src/telemetry/exporters.js.map +1 -1
- package/dist/src/telemetry/logs.d.ts.map +1 -1
- package/dist/src/telemetry/logs.js +15 -33
- package/dist/src/telemetry/logs.js.map +1 -1
- package/dist/src/telemetry/traces.js +2 -2
- package/dist/src/telemetry/traces.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +4 -1
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +6 -0
- package/dist/src/testing/testing_runtime.js.map +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +20 -4
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/examples/hello/start_postgres_docker.sh +1 -1
- package/migrations/20240123182943_schema.js +8 -0
- package/migrations/20240123183021_tables.js +48 -0
- package/migrations/20240123183025_indexes.js +14 -0
- package/migrations/20240123183030_triggers.js +39 -0
- package/migrations/20240124015239_status_timestamp.js +22 -0
- package/package.json +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js +0 -12
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js +44 -3
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/login.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js +3 -4
- package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/register.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts +0 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js +4 -177
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js.map +1 -1
- package/packages/dbos-cloud/dist/src/utils.d.ts +1 -1
- package/packages/dbos-cloud/dist/src/utils.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/src/utils.js +20 -4
- package/packages/dbos-cloud/dist/src/utils.js.map +1 -1
- package/packages/dbos-cloud/package.json +1 -1
- package/packages/dbos-openapi/package.json +1 -1
- package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts +0 -34
- package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/schemas/system_db_schema.js +0 -77
- package/packages/dbos-cloud/dist/schemas/system_db_schema.js.map +0 -1
- package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts +0 -11
- package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/schemas/user_db_schema.js +0 -16
- package/packages/dbos-cloud/dist/schemas/user_db_schema.js.map +0 -1
- package/packages/dbos-cloud/dist/src/communicator.d.ts +0 -25
- package/packages/dbos-cloud/dist/src/communicator.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/communicator.js +0 -26
- package/packages/dbos-cloud/dist/src/communicator.js.map +0 -1
- package/packages/dbos-cloud/dist/src/context.d.ts +0 -64
- package/packages/dbos-cloud/dist/src/context.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/context.js +0 -96
- package/packages/dbos-cloud/dist/src/context.js.map +0 -1
- package/packages/dbos-cloud/dist/src/data_validation.d.ts +0 -3
- package/packages/dbos-cloud/dist/src/data_validation.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/data_validation.js +0 -168
- package/packages/dbos-cloud/dist/src/data_validation.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-executor.d.ts +0 -102
- package/packages/dbos-cloud/dist/src/dbos-executor.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-executor.js +0 -631
- package/packages/dbos-cloud/dist/src/dbos-executor.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts +0 -3
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js +0 -13
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts +0 -8
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js +0 -47
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts +0 -29
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.js +0 -111
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts +0 -4
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js +0 -21
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts +0 -7
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.js +0 -51
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts +0 -28
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js +0 -95
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js.map +0 -1
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts +0 -38
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js +0 -211
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js.map +0 -1
- package/packages/dbos-cloud/dist/src/decorators.d.ts +0 -118
- package/packages/dbos-cloud/dist/src/decorators.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/decorators.js +0 -467
- package/packages/dbos-cloud/dist/src/decorators.js.map +0 -1
- package/packages/dbos-cloud/dist/src/error.d.ts +0 -47
- package/packages/dbos-cloud/dist/src/error.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/error.js +0 -171
- package/packages/dbos-cloud/dist/src/error.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts +0 -54
- package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handler.js +0 -175
- package/packages/dbos-cloud/dist/src/httpServer/handler.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts +0 -11
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js +0 -19
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts +0 -56
- package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/middleware.js +0 -57
- package/packages/dbos-cloud/dist/src/httpServer/middleware.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/server.d.ts +0 -45
- package/packages/dbos-cloud/dist/src/httpServer/server.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/server.js +0 -253
- package/packages/dbos-cloud/dist/src/httpServer/server.js.map +0 -1
- package/packages/dbos-cloud/dist/src/system_database.d.ts +0 -89
- package/packages/dbos-cloud/dist/src/system_database.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/system_database.js +0 -447
- package/packages/dbos-cloud/dist/src/system_database.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts +0 -16
- package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/collector.js +0 -65
- package/packages/dbos-cloud/dist/src/telemetry/collector.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts +0 -15
- package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/exporters.js +0 -59
- package/packages/dbos-cloud/dist/src/telemetry/exporters.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/index.d.ts +0 -11
- package/packages/dbos-cloud/dist/src/telemetry/index.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/index.js +0 -19
- package/packages/dbos-cloud/dist/src/telemetry/index.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts +0 -47
- package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/logs.js +0 -195
- package/packages/dbos-cloud/dist/src/telemetry/logs.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts +0 -14
- package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/traces.js +0 -52
- package/packages/dbos-cloud/dist/src/telemetry/traces.js.map +0 -1
- package/packages/dbos-cloud/dist/src/transaction.d.ts +0 -29
- package/packages/dbos-cloud/dist/src/transaction.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/transaction.js +0 -27
- package/packages/dbos-cloud/dist/src/transaction.js.map +0 -1
- package/packages/dbos-cloud/dist/src/user_database.d.ts +0 -132
- package/packages/dbos-cloud/dist/src/user_database.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/user_database.js +0 -332
- package/packages/dbos-cloud/dist/src/user_database.js.map +0 -1
- package/packages/dbos-cloud/dist/src/workflow.d.ts +0 -195
- package/packages/dbos-cloud/dist/src/workflow.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/workflow.js +0 -498
- package/packages/dbos-cloud/dist/src/workflow.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../register.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../register.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6CAA8D;AAEvD,KAAK,UAAU,YAAY,CAAC,QAAgB,EAAE,IAAY;IAC/D,MAAM,eAAe,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IACtD,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAA,sBAAS,GAAE,CAAC;IAC3B,IAAI,CAAC;QACH,4BAA4B;QAC5B,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,WAAW,IAAI,OAAO,EACtB;YACE,IAAI,EAAE,QAAQ;SACf,EACD;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAc,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,mBAAmB,QAAQ,WAAW,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,eAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA9BD,oCA8BC"}
|
@@ -7,7 +7,5 @@ export interface UserDBInstance {
|
|
7
7
|
export declare function createUserDb(host: string, dbName: string, adminName: string, adminPassword: string, sync: boolean): Promise<void>;
|
8
8
|
export declare function deleteUserDb(host: string, dbName: string): Promise<void>;
|
9
9
|
export declare function getUserDb(host: string, dbName: string): Promise<void>;
|
10
|
-
export declare function migrate(): Promise<number>;
|
11
|
-
export declare function rollbackMigration(): number;
|
12
10
|
export declare function getUserDBInfo(host: string, dbName: string): Promise<UserDBInstance>;
|
13
11
|
//# sourceMappingURL=userdb.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.d.ts","sourceRoot":"","sources":["../../../userdb.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"userdb.d.ts","sourceRoot":"","sources":["../../../userdb.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,iBAmCvH;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAoB9D;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAa3D;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAYzF"}
|
@@ -3,19 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getUserDBInfo = exports.
|
6
|
+
exports.getUserDBInfo = exports.getUserDb = exports.deleteUserDb = exports.createUserDb = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
|
-
const logs_1 = require("../../src/telemetry/logs");
|
9
8
|
const cloudutils_1 = require("./cloudutils");
|
10
9
|
const utils_1 = require("../../src/utils");
|
11
|
-
const config_1 = require("../../src/dbos-runtime/config");
|
12
|
-
const child_process_1 = require("child_process");
|
13
|
-
const user_database_1 = require("../../src/user_database");
|
14
|
-
const pg_1 = require("pg");
|
15
|
-
const system_db_schema_1 = require("../../schemas/system_db_schema");
|
16
|
-
const user_db_schema_1 = require("../../schemas/user_db_schema");
|
17
10
|
async function createUserDb(host, dbName, adminName, adminPassword, sync) {
|
18
|
-
const logger =
|
11
|
+
const logger = (0, cloudutils_1.getLogger)();
|
19
12
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
20
13
|
const bearerToken = "Bearer " + userCredentials.token;
|
21
14
|
try {
|
@@ -47,7 +40,7 @@ async function createUserDb(host, dbName, adminName, adminPassword, sync) {
|
|
47
40
|
}
|
48
41
|
exports.createUserDb = createUserDb;
|
49
42
|
async function deleteUserDb(host, dbName) {
|
50
|
-
const logger =
|
43
|
+
const logger = (0, cloudutils_1.getLogger)();
|
51
44
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
52
45
|
const bearerToken = "Bearer " + userCredentials.token;
|
53
46
|
try {
|
@@ -70,7 +63,7 @@ async function deleteUserDb(host, dbName) {
|
|
70
63
|
}
|
71
64
|
exports.deleteUserDb = deleteUserDb;
|
72
65
|
async function getUserDb(host, dbName) {
|
73
|
-
const logger =
|
66
|
+
const logger = (0, cloudutils_1.getLogger)();
|
74
67
|
try {
|
75
68
|
const userDBInfo = await getUserDBInfo(host, dbName);
|
76
69
|
logger.info(userDBInfo);
|
@@ -85,118 +78,6 @@ async function getUserDb(host, dbName) {
|
|
85
78
|
}
|
86
79
|
}
|
87
80
|
exports.getUserDb = getUserDb;
|
88
|
-
async function migrate() {
|
89
|
-
const logger = new logs_1.GlobalLogger();
|
90
|
-
// Read the configuration YAML file
|
91
|
-
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
92
|
-
if (!configFile) {
|
93
|
-
logger.error(`Failed to parse ${config_1.dbosConfigFilePath}`);
|
94
|
-
return 1;
|
95
|
-
}
|
96
|
-
const userDBName = configFile.database.user_database;
|
97
|
-
logger.info(`Creating database ${userDBName} if it does not already exist`);
|
98
|
-
const createDB = `createdb -h ${configFile.database.hostname} -p ${configFile.database.port} ${userDBName} -U ${configFile.database.username} -ew ${userDBName}`;
|
99
|
-
try {
|
100
|
-
process.env.PGPASSWORD = configFile.database.password;
|
101
|
-
const createDBOutput = (0, child_process_1.execSync)(createDB, { env: process.env }).toString();
|
102
|
-
if (createDBOutput.includes(`database "${userDBName}" already exists`)) {
|
103
|
-
logger.info(`Database ${userDBName} already exists`);
|
104
|
-
}
|
105
|
-
else {
|
106
|
-
logger.info(createDBOutput);
|
107
|
-
}
|
108
|
-
}
|
109
|
-
catch (e) {
|
110
|
-
if (e instanceof Error) {
|
111
|
-
if (e.message.includes(`database "${userDBName}" already exists`)) {
|
112
|
-
logger.info(`Database ${userDBName} already exists`);
|
113
|
-
}
|
114
|
-
else {
|
115
|
-
logger.error(`Error creating database: ${e.message}`);
|
116
|
-
return 1;
|
117
|
-
}
|
118
|
-
}
|
119
|
-
else {
|
120
|
-
logger.error(e);
|
121
|
-
return 1;
|
122
|
-
}
|
123
|
-
}
|
124
|
-
const dbType = configFile.database.user_dbclient || user_database_1.UserDatabaseName.KNEX;
|
125
|
-
const migrationScript = `node_modules/.bin/${dbType}`;
|
126
|
-
const migrationCommands = configFile.database.migrate;
|
127
|
-
try {
|
128
|
-
migrationCommands?.forEach((cmd) => {
|
129
|
-
const command = `node ${migrationScript} ${cmd}`;
|
130
|
-
logger.info(`Executing migration command: ${command}`);
|
131
|
-
const migrateCommandOutput = (0, child_process_1.execSync)(command).toString();
|
132
|
-
logger.info(migrateCommandOutput);
|
133
|
-
});
|
134
|
-
}
|
135
|
-
catch (e) {
|
136
|
-
logger.error("Error running migration");
|
137
|
-
if (e instanceof Error) {
|
138
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
139
|
-
const stderr = e.stderr;
|
140
|
-
if (stderr && Buffer.isBuffer(stderr) && stderr.length > 0) {
|
141
|
-
logger.error(`Standard Error: ${stderr.toString().trim()}`);
|
142
|
-
}
|
143
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
144
|
-
const stdout = e.stdout;
|
145
|
-
if (stdout && Buffer.isBuffer(stdout) && stdout.length > 0) {
|
146
|
-
logger.error(`Standard Output: ${stdout.toString().trim()}`);
|
147
|
-
}
|
148
|
-
if (e.message) {
|
149
|
-
logger.error(e.message);
|
150
|
-
}
|
151
|
-
}
|
152
|
-
else {
|
153
|
-
logger.error(e);
|
154
|
-
}
|
155
|
-
return 1;
|
156
|
-
}
|
157
|
-
logger.info("Creating DBOS tables and system database.");
|
158
|
-
try {
|
159
|
-
await createDBOSTables(configFile);
|
160
|
-
}
|
161
|
-
catch (e) {
|
162
|
-
if (e instanceof Error) {
|
163
|
-
logger.error(`Error creating DBOS system database: ${e.message}`);
|
164
|
-
}
|
165
|
-
else {
|
166
|
-
logger.error(e);
|
167
|
-
}
|
168
|
-
return 1;
|
169
|
-
}
|
170
|
-
return 0;
|
171
|
-
}
|
172
|
-
exports.migrate = migrate;
|
173
|
-
function rollbackMigration() {
|
174
|
-
const logger = new logs_1.GlobalLogger();
|
175
|
-
// read the yaml file
|
176
|
-
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
177
|
-
if (!configFile) {
|
178
|
-
logger.error(`failed to parse ${config_1.dbosConfigFilePath}`);
|
179
|
-
return 1;
|
180
|
-
}
|
181
|
-
let dbType = configFile.database.user_dbclient;
|
182
|
-
if (dbType == undefined) {
|
183
|
-
dbType = "knex";
|
184
|
-
}
|
185
|
-
const rollbackcommands = configFile.database.rollback;
|
186
|
-
try {
|
187
|
-
rollbackcommands?.forEach((cmd) => {
|
188
|
-
const command = "npx " + dbType + " " + cmd;
|
189
|
-
logger.info("Executing " + command);
|
190
|
-
(0, child_process_1.execSync)(command);
|
191
|
-
});
|
192
|
-
}
|
193
|
-
catch (e) {
|
194
|
-
logger.error("Error rolling back migration. ");
|
195
|
-
return 1;
|
196
|
-
}
|
197
|
-
return 0;
|
198
|
-
}
|
199
|
-
exports.rollbackMigration = rollbackMigration;
|
200
81
|
async function getUserDBInfo(host, dbName) {
|
201
82
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
202
83
|
const bearerToken = "Bearer " + userCredentials.token;
|
@@ -209,58 +90,4 @@ async function getUserDBInfo(host, dbName) {
|
|
209
90
|
return res.data;
|
210
91
|
}
|
211
92
|
exports.getUserDBInfo = getUserDBInfo;
|
212
|
-
// Create DBOS system DB and tables.
|
213
|
-
// TODO: replace this with knex to manage schema.
|
214
|
-
async function createDBOSTables(configFile) {
|
215
|
-
const logger = new logs_1.GlobalLogger();
|
216
|
-
const userPoolConfig = {
|
217
|
-
host: configFile.database.hostname,
|
218
|
-
port: configFile.database.port,
|
219
|
-
user: configFile.database.username,
|
220
|
-
password: configFile.database.password,
|
221
|
-
connectionTimeoutMillis: configFile.database.connectionTimeoutMillis || 3000,
|
222
|
-
database: configFile.database.user_database,
|
223
|
-
};
|
224
|
-
if (configFile.database.ssl_ca) {
|
225
|
-
userPoolConfig.ssl = { ca: [(0, utils_1.readFileSync)(configFile.database.ssl_ca)], rejectUnauthorized: true };
|
226
|
-
}
|
227
|
-
const systemPoolConfig = { ...userPoolConfig };
|
228
|
-
systemPoolConfig.database = `${userPoolConfig.database}_dbos_sys`;
|
229
|
-
const pgUserClient = new pg_1.Client(userPoolConfig);
|
230
|
-
await pgUserClient.connect();
|
231
|
-
// Create DBOS table/schema in user DB.
|
232
|
-
const schemaExists = await pgUserClient.query(`SELECT EXISTS (SELECT FROM information_schema.schemata WHERE schema_name = 'dbos')`);
|
233
|
-
if (!schemaExists.rows[0].exists) {
|
234
|
-
await pgUserClient.query(user_db_schema_1.createUserDBSchema);
|
235
|
-
await pgUserClient.query(user_db_schema_1.userDBSchema);
|
236
|
-
}
|
237
|
-
// Create the DBOS system database.
|
238
|
-
const dbExists = await pgUserClient.query(`SELECT EXISTS (SELECT FROM pg_database WHERE datname = '${systemPoolConfig.database}')`);
|
239
|
-
if (!dbExists.rows[0].exists) {
|
240
|
-
await pgUserClient.query(`CREATE DATABASE ${systemPoolConfig.database}`);
|
241
|
-
}
|
242
|
-
// Load the DBOS system schema.
|
243
|
-
const pgSystemClient = new pg_1.Client(systemPoolConfig);
|
244
|
-
await pgSystemClient.connect();
|
245
|
-
try {
|
246
|
-
const tableExists = await pgSystemClient.query(`SELECT EXISTS (SELECT FROM information_schema.schemata WHERE schema_name = 'dbos')`);
|
247
|
-
if (!tableExists.rows[0].exists) {
|
248
|
-
await pgSystemClient.query(system_db_schema_1.systemDBSchema);
|
249
|
-
}
|
250
|
-
}
|
251
|
-
catch (e) {
|
252
|
-
const tableExists = await pgSystemClient.query(`SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_schema = 'dbos' AND table_name = 'operation_outputs')`);
|
253
|
-
if (tableExists.rows[0].exists) {
|
254
|
-
// If the table has been created by someone else. Ignore the error.
|
255
|
-
logger.warn(`System tables creation failed, may conflict with concurrent tasks: ${e.message}`);
|
256
|
-
}
|
257
|
-
else {
|
258
|
-
throw e;
|
259
|
-
}
|
260
|
-
}
|
261
|
-
finally {
|
262
|
-
await pgSystemClient.end();
|
263
|
-
await pgUserClient.end();
|
264
|
-
}
|
265
|
-
}
|
266
93
|
//# sourceMappingURL=userdb.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
1
|
+
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../userdb.ts"],"names":[],"mappings":"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"}
|
@@ -2,5 +2,5 @@
|
|
2
2
|
export declare function readFileSync(path: string, encoding?: BufferEncoding): string | Buffer;
|
3
3
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
4
4
|
export type ValuesOf<T> = T[keyof T];
|
5
|
-
export declare function
|
5
|
+
export declare function findPackageRoot(start: string | string[]): string;
|
6
6
|
//# sourceMappingURL=utils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils.ts"],"names":[],"mappings":";AASA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,cAAuB,GAAG,MAAM,GAAG,MAAM,CAa7F;AAED,eAAO,MAAM,KAAK,OAAQ,MAAM,qBAA0C,CAAC;AAE3E,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAGrC,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAoBhE"}
|
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
6
|
+
exports.findPackageRoot = exports.sleep = exports.readFileSync = void 0;
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
8
|
+
const path_1 = __importDefault(require("path"));
|
8
9
|
/*
|
9
10
|
* Use the node.js `fs` module to read the content of a file
|
10
11
|
* Handles cases where:
|
@@ -28,8 +29,23 @@ function readFileSync(path, encoding = "utf8") {
|
|
28
29
|
exports.readFileSync = readFileSync;
|
29
30
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
30
31
|
exports.sleep = sleep;
|
31
|
-
|
32
|
-
|
32
|
+
// Adapated and translated from from: https://github.com/junosuarez/find-root
|
33
|
+
function findPackageRoot(start) {
|
34
|
+
if (typeof start === 'string') {
|
35
|
+
if (!start.endsWith(path_1.default.sep)) {
|
36
|
+
start += path_1.default.sep;
|
37
|
+
}
|
38
|
+
start = start.split(path_1.default.sep);
|
39
|
+
}
|
40
|
+
if (start.length === 0) {
|
41
|
+
throw new Error('package.json not found in path');
|
42
|
+
}
|
43
|
+
start.pop();
|
44
|
+
const dir = start.join(path_1.default.sep);
|
45
|
+
if (fs_1.default.existsSync(path_1.default.join(dir, 'package.json'))) {
|
46
|
+
return dir;
|
47
|
+
}
|
48
|
+
return findPackageRoot(start);
|
33
49
|
}
|
34
|
-
exports.
|
50
|
+
exports.findPackageRoot = findPackageRoot;
|
35
51
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB;;;;;IAKI;AACJ,SAAgB,YAAY,CAAC,IAAY,EAAE,WAA2B,MAAM;IAC1E,wBAAwB;IACxB,YAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAmC,EAAE,KAAe,EAAE,EAAE;QACrE,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QACxE,CAAC;aAAM,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,gBAAgB,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,yBAAyB;IACzB,MAAM,WAAW,GAAW,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAE,CAAC;IACjE,OAAO,WAAW,CAAC;AACrB,CAAC;AAbD,oCAaC;AAEM,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAA9D,QAAA,KAAK,SAAyD;AAI3E,6EAA6E;AAC7E,SAAgB,eAAe,CAAC,KAAwB;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,KAAK,IAAI,cAAI,CAAC,GAAG,CAAC;QACtB,CAAC;QACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,cAAI,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,GAAG,EAAE,CAAC;IACZ,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,cAAI,CAAC,GAAG,CAAC,CAAC;IAEjC,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAChD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AApBD,0CAoBC"}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
export interface workflow_status {
|
2
|
-
workflow_uuid: string;
|
3
|
-
status: string;
|
4
|
-
name: string;
|
5
|
-
authenticated_user: string;
|
6
|
-
output: string;
|
7
|
-
error: string;
|
8
|
-
assumed_role: string;
|
9
|
-
authenticated_roles: string;
|
10
|
-
request: string;
|
11
|
-
executor_id: string;
|
12
|
-
}
|
13
|
-
export interface notifications {
|
14
|
-
destination_uuid: string;
|
15
|
-
topic: string;
|
16
|
-
message: string;
|
17
|
-
}
|
18
|
-
export interface workflow_events {
|
19
|
-
workflow_uuid: string;
|
20
|
-
key: string;
|
21
|
-
value: string;
|
22
|
-
}
|
23
|
-
export interface operation_outputs {
|
24
|
-
workflow_uuid: string;
|
25
|
-
function_id: number;
|
26
|
-
output: string;
|
27
|
-
error: string;
|
28
|
-
}
|
29
|
-
export interface workflow_inputs {
|
30
|
-
workflow_uuid: string;
|
31
|
-
inputs: string;
|
32
|
-
}
|
33
|
-
export declare const systemDBSchema = "\n CREATE SCHEMA IF NOT EXISTS dbos;\n\n CREATE TABLE IF NOT EXISTS dbos.operation_outputs (\n workflow_uuid TEXT NOT NULL,\n function_id INT NOT NULL,\n output TEXT,\n error TEXT,\n PRIMARY KEY (workflow_uuid, function_id)\n );\n\n CREATE TABLE IF NOT EXISTS dbos.workflow_inputs (\n workflow_uuid TEXT PRIMARY KEY NOT NULL,\n inputs TEXT NOT NULL\n );\n\n CREATE TABLE IF NOT EXISTS dbos.workflow_status (\n workflow_uuid TEXT PRIMARY KEY,\n status TEXT,\n name TEXT,\n authenticated_user TEXT,\n assumed_role TEXT,\n authenticated_roles TEXT,\n request TEXT,\n output TEXT,\n error TEXT,\n executor_id TEXT\n );\n\n CREATE TABLE IF NOT EXISTS dbos.notifications (\n destination_uuid TEXT NOT NULL,\n topic TEXT,\n message TEXT NOT NULL,\n created_at_epoch_ms BIGINT NOT NULL DEFAULT (EXTRACT(EPOCH FROM now())*1000)::bigint\n );\n\n CREATE TABLE IF NOT EXISTS dbos.workflow_events (\n workflow_uuid TEXT NOT NULL,\n key TEXT NOT NULL,\n value TEXT NOT NULL,\n PRIMARY KEY (workflow_uuid, key)\n );\n\n CREATE INDEX IF NOT EXISTS idx_workflow_topic ON dbos.notifications (destination_uuid, topic);\n\n CREATE OR REPLACE FUNCTION dbos.notifications_function() RETURNS TRIGGER AS $$\n DECLARE\n payload text := NEW.destination_uuid || '::' || NEW.topic;\n BEGIN\n -- Publish a notification for all keys\n PERFORM pg_notify('dbos_notifications_channel', payload);\n RETURN NEW;\n END;\n $$ LANGUAGE plpgsql;\n\n CREATE OR REPLACE TRIGGER dbos_notifications_trigger\n AFTER INSERT ON dbos.notifications\n FOR EACH ROW EXECUTE FUNCTION dbos.notifications_function();\n\n CREATE OR REPLACE FUNCTION dbos.workflow_events_function() RETURNS TRIGGER AS $$\n DECLARE\n payload text := NEW.workflow_uuid || '::' || NEW.key;\n BEGIN\n -- Publish a notification for all keys\n PERFORM pg_notify('dbos_workflow_events_channel', payload);\n RETURN NEW;\n END;\n $$ LANGUAGE plpgsql;\n\n CREATE OR REPLACE TRIGGER dbos_workflow_events_trigger\n AFTER INSERT ON dbos.workflow_events\n FOR EACH ROW EXECUTE FUNCTION dbos.workflow_events_function();\n";
|
34
|
-
//# sourceMappingURL=system_db_schema.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"system_db_schema.d.ts","sourceRoot":"","sources":["../../../../schemas/system_db_schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,cAAc,orEAwE1B,CAAC"}
|
@@ -1,77 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.systemDBSchema = void 0;
|
4
|
-
exports.systemDBSchema = `
|
5
|
-
CREATE SCHEMA IF NOT EXISTS dbos;
|
6
|
-
|
7
|
-
CREATE TABLE IF NOT EXISTS dbos.operation_outputs (
|
8
|
-
workflow_uuid TEXT NOT NULL,
|
9
|
-
function_id INT NOT NULL,
|
10
|
-
output TEXT,
|
11
|
-
error TEXT,
|
12
|
-
PRIMARY KEY (workflow_uuid, function_id)
|
13
|
-
);
|
14
|
-
|
15
|
-
CREATE TABLE IF NOT EXISTS dbos.workflow_inputs (
|
16
|
-
workflow_uuid TEXT PRIMARY KEY NOT NULL,
|
17
|
-
inputs TEXT NOT NULL
|
18
|
-
);
|
19
|
-
|
20
|
-
CREATE TABLE IF NOT EXISTS dbos.workflow_status (
|
21
|
-
workflow_uuid TEXT PRIMARY KEY,
|
22
|
-
status TEXT,
|
23
|
-
name TEXT,
|
24
|
-
authenticated_user TEXT,
|
25
|
-
assumed_role TEXT,
|
26
|
-
authenticated_roles TEXT,
|
27
|
-
request TEXT,
|
28
|
-
output TEXT,
|
29
|
-
error TEXT,
|
30
|
-
executor_id TEXT
|
31
|
-
);
|
32
|
-
|
33
|
-
CREATE TABLE IF NOT EXISTS dbos.notifications (
|
34
|
-
destination_uuid TEXT NOT NULL,
|
35
|
-
topic TEXT,
|
36
|
-
message TEXT NOT NULL,
|
37
|
-
created_at_epoch_ms BIGINT NOT NULL DEFAULT (EXTRACT(EPOCH FROM now())*1000)::bigint
|
38
|
-
);
|
39
|
-
|
40
|
-
CREATE TABLE IF NOT EXISTS dbos.workflow_events (
|
41
|
-
workflow_uuid TEXT NOT NULL,
|
42
|
-
key TEXT NOT NULL,
|
43
|
-
value TEXT NOT NULL,
|
44
|
-
PRIMARY KEY (workflow_uuid, key)
|
45
|
-
);
|
46
|
-
|
47
|
-
CREATE INDEX IF NOT EXISTS idx_workflow_topic ON dbos.notifications (destination_uuid, topic);
|
48
|
-
|
49
|
-
CREATE OR REPLACE FUNCTION dbos.notifications_function() RETURNS TRIGGER AS $$
|
50
|
-
DECLARE
|
51
|
-
payload text := NEW.destination_uuid || '::' || NEW.topic;
|
52
|
-
BEGIN
|
53
|
-
-- Publish a notification for all keys
|
54
|
-
PERFORM pg_notify('dbos_notifications_channel', payload);
|
55
|
-
RETURN NEW;
|
56
|
-
END;
|
57
|
-
$$ LANGUAGE plpgsql;
|
58
|
-
|
59
|
-
CREATE OR REPLACE TRIGGER dbos_notifications_trigger
|
60
|
-
AFTER INSERT ON dbos.notifications
|
61
|
-
FOR EACH ROW EXECUTE FUNCTION dbos.notifications_function();
|
62
|
-
|
63
|
-
CREATE OR REPLACE FUNCTION dbos.workflow_events_function() RETURNS TRIGGER AS $$
|
64
|
-
DECLARE
|
65
|
-
payload text := NEW.workflow_uuid || '::' || NEW.key;
|
66
|
-
BEGIN
|
67
|
-
-- Publish a notification for all keys
|
68
|
-
PERFORM pg_notify('dbos_workflow_events_channel', payload);
|
69
|
-
RETURN NEW;
|
70
|
-
END;
|
71
|
-
$$ LANGUAGE plpgsql;
|
72
|
-
|
73
|
-
CREATE OR REPLACE TRIGGER dbos_workflow_events_trigger
|
74
|
-
AFTER INSERT ON dbos.workflow_events
|
75
|
-
FOR EACH ROW EXECUTE FUNCTION dbos.workflow_events_function();
|
76
|
-
`;
|
77
|
-
//# sourceMappingURL=system_db_schema.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"system_db_schema.js","sourceRoot":"","sources":["../../../../schemas/system_db_schema.ts"],"names":[],"mappings":";;;AAqCa,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE7B,CAAC"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
export interface transaction_outputs {
|
2
|
-
workflow_uuid: string;
|
3
|
-
function_id: number;
|
4
|
-
output: string;
|
5
|
-
error: string;
|
6
|
-
txn_id: string;
|
7
|
-
txn_snapshot: string;
|
8
|
-
}
|
9
|
-
export declare const createUserDBSchema = "CREATE SCHEMA IF NOT EXISTS dbos;";
|
10
|
-
export declare const userDBSchema = "\n CREATE TABLE IF NOT EXISTS dbos.transaction_outputs (\n workflow_uuid TEXT NOT NULL,\n function_id INT NOT NULL,\n output TEXT,\n error TEXT,\n txn_id TEXT,\n txn_snapshot TEXT NOT NULL,\n PRIMARY KEY (workflow_uuid, function_id)\n );\n";
|
11
|
-
//# sourceMappingURL=user_db_schema.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user_db_schema.d.ts","sourceRoot":"","sources":["../../../../schemas/user_db_schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,sCAAsC,CAAC;AAEtE,eAAO,MAAM,YAAY,2QAUxB,CAAC"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.userDBSchema = exports.createUserDBSchema = void 0;
|
4
|
-
exports.createUserDBSchema = `CREATE SCHEMA IF NOT EXISTS dbos;`;
|
5
|
-
exports.userDBSchema = `
|
6
|
-
CREATE TABLE IF NOT EXISTS dbos.transaction_outputs (
|
7
|
-
workflow_uuid TEXT NOT NULL,
|
8
|
-
function_id INT NOT NULL,
|
9
|
-
output TEXT,
|
10
|
-
error TEXT,
|
11
|
-
txn_id TEXT,
|
12
|
-
txn_snapshot TEXT NOT NULL,
|
13
|
-
PRIMARY KEY (workflow_uuid, function_id)
|
14
|
-
);
|
15
|
-
`;
|
16
|
-
//# sourceMappingURL=user_db_schema.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user_db_schema.js","sourceRoot":"","sources":["../../../../schemas/user_db_schema.ts"],"names":[],"mappings":";;;AASa,QAAA,kBAAkB,GAAG,mCAAmC,CAAC;AAEzD,QAAA,YAAY,GAAG;;;;;;;;;;CAU3B,CAAC"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { Span } from "@opentelemetry/sdk-trace-base";
|
2
|
-
import { GlobalLogger as Logger } from "./telemetry/logs";
|
3
|
-
import { WorkflowContextImpl } from "./workflow";
|
4
|
-
import { DBOSContext, DBOSContextImpl } from "./context";
|
5
|
-
import { WorkflowContextDebug } from "./debugger/debug_workflow";
|
6
|
-
export type Communicator<T extends any[], R> = (ctxt: CommunicatorContext, ...args: T) => Promise<R>;
|
7
|
-
export interface CommunicatorConfig {
|
8
|
-
retriesAllowed?: boolean;
|
9
|
-
intervalSeconds?: number;
|
10
|
-
maxAttempts?: number;
|
11
|
-
backoffRate?: number;
|
12
|
-
}
|
13
|
-
export interface CommunicatorContext extends DBOSContext {
|
14
|
-
readonly retriesAllowed: boolean;
|
15
|
-
readonly maxAttempts: number;
|
16
|
-
}
|
17
|
-
export declare class CommunicatorContextImpl extends DBOSContextImpl implements CommunicatorContext {
|
18
|
-
readonly functionID: number;
|
19
|
-
readonly retriesAllowed: boolean;
|
20
|
-
readonly intervalSeconds: number;
|
21
|
-
readonly maxAttempts: number;
|
22
|
-
readonly backoffRate: number;
|
23
|
-
constructor(workflowContext: WorkflowContextImpl | WorkflowContextDebug, functionID: number, span: Span, logger: Logger, params: CommunicatorConfig, commName: string);
|
24
|
-
}
|
25
|
-
//# sourceMappingURL=communicator.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"communicator.d.ts","sourceRoot":"","sources":["../../../../src/communicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAErG,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IAEtD,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,qBAAa,uBAAwB,SAAQ,eAAgB,YAAW,mBAAmB;IACzF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAGjB,eAAe,EAAE,mBAAmB,GAAG,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM;CAYtK"}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.CommunicatorContextImpl = void 0;
|
4
|
-
const context_1 = require("./context");
|
5
|
-
class CommunicatorContextImpl extends context_1.DBOSContextImpl {
|
6
|
-
functionID;
|
7
|
-
retriesAllowed;
|
8
|
-
intervalSeconds;
|
9
|
-
maxAttempts;
|
10
|
-
backoffRate;
|
11
|
-
// TODO: Validate the parameters.
|
12
|
-
constructor(workflowContext, functionID, span, logger, params, commName) {
|
13
|
-
super(commName, span, logger, workflowContext);
|
14
|
-
this.functionID = functionID;
|
15
|
-
this.retriesAllowed = params.retriesAllowed ?? true;
|
16
|
-
this.intervalSeconds = params.intervalSeconds ?? 1;
|
17
|
-
this.maxAttempts = params.maxAttempts ?? 3;
|
18
|
-
this.backoffRate = params.backoffRate ?? 2;
|
19
|
-
if (workflowContext.applicationConfig) {
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
21
|
-
this.applicationConfig = workflowContext.applicationConfig;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
exports.CommunicatorContextImpl = CommunicatorContextImpl;
|
26
|
-
//# sourceMappingURL=communicator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"communicator.js","sourceRoot":"","sources":["../../../../src/communicator.ts"],"names":[],"mappings":";;;AAGA,uCAAyD;AAmBzD,MAAa,uBAAwB,SAAQ,yBAAe;IACjD,UAAU,CAAS;IACnB,cAAc,CAAU;IACxB,eAAe,CAAS;IACxB,WAAW,CAAS;IACpB,WAAW,CAAS;IAE7B,iCAAiC;IACjC,YAAY,eAA2D,EAAE,UAAkB,EAAE,IAAU,EAAE,MAAc,EAAE,MAA0B,EAAE,QAAgB;QACnK,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC;QACpD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,eAAe,CAAC,iBAAiB,EAAE,CAAC;YACtC,mEAAmE;YACnE,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;QAC7D,CAAC;IACH,CAAC;CACF;AApBD,0DAoBC"}
|
@@ -1,64 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
|
-
/// <reference types="node/http" />
|
4
|
-
/// <reference types="@koa/bodyparser/dist/body-parser" />
|
5
|
-
import { Span } from "@opentelemetry/sdk-trace-base";
|
6
|
-
import { GlobalLogger as Logger, Logger as DBOSLogger } from "./telemetry/logs";
|
7
|
-
import { IncomingHttpHeaders } from "http";
|
8
|
-
import { ParsedUrlQuery } from "querystring";
|
9
|
-
import { DBOSExecutor } from "./dbos-executor";
|
10
|
-
export interface HTTPRequest {
|
11
|
-
readonly headers?: IncomingHttpHeaders;
|
12
|
-
readonly rawHeaders?: string[];
|
13
|
-
readonly params?: unknown;
|
14
|
-
readonly body?: unknown;
|
15
|
-
readonly rawBody?: string;
|
16
|
-
readonly query?: ParsedUrlQuery;
|
17
|
-
readonly querystring?: string;
|
18
|
-
readonly url?: string;
|
19
|
-
readonly ip?: string;
|
20
|
-
readonly requestID?: string;
|
21
|
-
}
|
22
|
-
export interface DBOSContext {
|
23
|
-
readonly request: HTTPRequest;
|
24
|
-
readonly workflowUUID: string;
|
25
|
-
readonly authenticatedUser: string;
|
26
|
-
readonly authenticatedRoles: string[];
|
27
|
-
readonly assumedRole: string;
|
28
|
-
readonly logger: DBOSLogger;
|
29
|
-
readonly span: Span;
|
30
|
-
getConfig<T>(key: string): T | undefined;
|
31
|
-
getConfig<T>(key: string, defaultValue: T): T;
|
32
|
-
}
|
33
|
-
export declare class DBOSContextImpl implements DBOSContext {
|
34
|
-
readonly operationName: string;
|
35
|
-
readonly span: Span;
|
36
|
-
request: HTTPRequest;
|
37
|
-
authenticatedUser: string;
|
38
|
-
authenticatedRoles: string[];
|
39
|
-
assumedRole: string;
|
40
|
-
workflowUUID: string;
|
41
|
-
executorID: string;
|
42
|
-
readonly logger: DBOSLogger;
|
43
|
-
constructor(operationName: string, span: Span, logger: Logger, parentCtx?: DBOSContextImpl);
|
44
|
-
/*** Application configuration ***/
|
45
|
-
applicationConfig?: any;
|
46
|
-
getConfig<T>(key: string): T | undefined;
|
47
|
-
getConfig<T>(key: string, defaultValue: T): T;
|
48
|
-
}
|
49
|
-
/**
|
50
|
-
* TODO : move logger and application, getConfig to a BaseContext which is at the root of all contexts
|
51
|
-
*/
|
52
|
-
export declare class InitContext {
|
53
|
-
readonly dbosExec: DBOSExecutor;
|
54
|
-
readonly logger: Logger;
|
55
|
-
private userDatabase;
|
56
|
-
private application;
|
57
|
-
constructor(dbosExec: DBOSExecutor);
|
58
|
-
createUserSchema(): Promise<void>;
|
59
|
-
dropUserSchema(): Promise<void>;
|
60
|
-
queryUserDB<R>(sql: string, ...params: unknown[]): Promise<R[]>;
|
61
|
-
getConfig<T>(key: string): T | undefined;
|
62
|
-
getConfig<T>(key: string, defaultValue: T): T;
|
63
|
-
}
|
64
|
-
//# sourceMappingURL=context.d.ts.map
|