@dbos-inc/dbos-sdk 0.7.18-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/dbos-config.schema.json +121 -0
- package/dbos-test-config.yaml +16 -0
- package/dist/schemas/system_db_schema.d.ts +34 -0
- package/dist/schemas/system_db_schema.d.ts.map +1 -0
- package/dist/schemas/system_db_schema.js +75 -0
- package/dist/schemas/system_db_schema.js.map +1 -0
- package/dist/schemas/user_db_schema.d.ts +11 -0
- package/dist/schemas/user_db_schema.d.ts.map +1 -0
- package/dist/schemas/user_db_schema.js +16 -0
- package/dist/schemas/user_db_schema.js.map +1 -0
- package/dist/src/cloud-cli/applications/configure.d.ts +2 -0
- package/dist/src/cloud-cli/applications/configure.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/configure.js +57 -0
- package/dist/src/cloud-cli/applications/configure.js.map +1 -0
- package/dist/src/cloud-cli/applications/delete-app.d.ts +2 -0
- package/dist/src/cloud-cli/applications/delete-app.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/delete-app.js +36 -0
- package/dist/src/cloud-cli/applications/delete-app.js.map +1 -0
- package/dist/src/cloud-cli/applications/deploy-app-code.d.ts +2 -0
- package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/deploy-app-code.js +64 -0
- package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -0
- package/dist/src/cloud-cli/applications/get-app-logs.d.ts +2 -0
- package/dist/src/cloud-cli/applications/get-app-logs.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/get-app-logs.js +37 -0
- package/dist/src/cloud-cli/applications/get-app-logs.js.map +1 -0
- package/dist/src/cloud-cli/applications/index.d.ts +8 -0
- package/dist/src/cloud-cli/applications/index.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/index.js +18 -0
- package/dist/src/cloud-cli/applications/index.js.map +1 -0
- package/dist/src/cloud-cli/applications/list-apps.d.ts +2 -0
- package/dist/src/cloud-cli/applications/list-apps.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/list-apps.js +45 -0
- package/dist/src/cloud-cli/applications/list-apps.js.map +1 -0
- package/dist/src/cloud-cli/applications/register-app.d.ts +2 -0
- package/dist/src/cloud-cli/applications/register-app.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/register-app.js +41 -0
- package/dist/src/cloud-cli/applications/register-app.js.map +1 -0
- package/dist/src/cloud-cli/applications/types.d.ts +7 -0
- package/dist/src/cloud-cli/applications/types.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/types.js +3 -0
- package/dist/src/cloud-cli/applications/types.js.map +1 -0
- package/dist/src/cloud-cli/applications/update-app.d.ts +2 -0
- package/dist/src/cloud-cli/applications/update-app.d.ts.map +1 -0
- package/dist/src/cloud-cli/applications/update-app.js +42 -0
- package/dist/src/cloud-cli/applications/update-app.js.map +1 -0
- package/dist/src/cloud-cli/cli.d.ts +3 -0
- package/dist/src/cloud-cli/cli.d.ts.map +1 -0
- package/dist/src/cloud-cli/cli.js +148 -0
- package/dist/src/cloud-cli/cli.js.map +1 -0
- package/dist/src/cloud-cli/login.d.ts +7 -0
- package/dist/src/cloud-cli/login.d.ts.map +1 -0
- package/dist/src/cloud-cli/login.js +40 -0
- package/dist/src/cloud-cli/login.js.map +1 -0
- package/dist/src/cloud-cli/register.d.ts +2 -0
- package/dist/src/cloud-cli/register.d.ts.map +1 -0
- package/dist/src/cloud-cli/register.js +35 -0
- package/dist/src/cloud-cli/register.js.map +1 -0
- package/dist/src/cloud-cli/userdb.d.ts +4 -0
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -0
- package/dist/src/cloud-cli/userdb.js +149 -0
- package/dist/src/cloud-cli/userdb.js.map +1 -0
- package/dist/src/cloud-cli/utils.d.ts +3 -0
- package/dist/src/cloud-cli/utils.d.ts.map +1 -0
- package/dist/src/cloud-cli/utils.js +17 -0
- package/dist/src/cloud-cli/utils.js.map +1 -0
- package/dist/src/communicator.d.ts +24 -0
- package/dist/src/communicator.d.ts.map +1 -0
- package/dist/src/communicator.js +26 -0
- package/dist/src/communicator.js.map +1 -0
- package/dist/src/context.d.ts +60 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +94 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/data_validation.d.ts +3 -0
- package/dist/src/data_validation.d.ts.map +1 -0
- package/dist/src/data_validation.js +168 -0
- package/dist/src/data_validation.js.map +1 -0
- package/dist/src/dbos-executor.d.ts +79 -0
- package/dist/src/dbos-executor.d.ts.map +1 -0
- package/dist/src/dbos-executor.js +408 -0
- package/dist/src/dbos-executor.js.map +1 -0
- package/dist/src/dbos-runtime/TypeParser.d.ts +33 -0
- package/dist/src/dbos-runtime/TypeParser.d.ts.map +1 -0
- package/dist/src/dbos-runtime/TypeParser.js +104 -0
- package/dist/src/dbos-runtime/TypeParser.js.map +1 -0
- package/dist/src/dbos-runtime/applicationVersion.d.ts +3 -0
- package/dist/src/dbos-runtime/applicationVersion.d.ts.map +1 -0
- package/dist/src/dbos-runtime/applicationVersion.js +13 -0
- package/dist/src/dbos-runtime/applicationVersion.js.map +1 -0
- package/dist/src/dbos-runtime/cli.d.ts +8 -0
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -0
- package/dist/src/dbos-runtime/cli.js +52 -0
- package/dist/src/dbos-runtime/cli.js.map +1 -0
- package/dist/src/dbos-runtime/config.d.ts +28 -0
- package/dist/src/dbos-runtime/config.d.ts.map +1 -0
- package/dist/src/dbos-runtime/config.js +111 -0
- package/dist/src/dbos-runtime/config.js.map +1 -0
- package/dist/src/dbos-runtime/init.d.ts +7 -0
- package/dist/src/dbos-runtime/init.d.ts.map +1 -0
- package/dist/src/dbos-runtime/init.js +51 -0
- package/dist/src/dbos-runtime/init.js.map +1 -0
- package/dist/src/dbos-runtime/openApi.d.ts +35 -0
- package/dist/src/dbos-runtime/openApi.d.ts.map +1 -0
- package/dist/src/dbos-runtime/openApi.js +595 -0
- package/dist/src/dbos-runtime/openApi.js.map +1 -0
- package/dist/src/dbos-runtime/runtime.d.ts +28 -0
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -0
- package/dist/src/dbos-runtime/runtime.js +96 -0
- package/dist/src/dbos-runtime/runtime.js.map +1 -0
- package/dist/src/dbos-runtime/tsDiagUtil.d.ts +16 -0
- package/dist/src/dbos-runtime/tsDiagUtil.d.ts.map +1 -0
- package/dist/src/dbos-runtime/tsDiagUtil.js +72 -0
- package/dist/src/dbos-runtime/tsDiagUtil.js.map +1 -0
- package/dist/src/decorators.d.ts +118 -0
- package/dist/src/decorators.d.ts.map +1 -0
- package/dist/src/decorators.js +467 -0
- package/dist/src/decorators.js.map +1 -0
- package/dist/src/error.d.ts +44 -0
- package/dist/src/error.d.ts.map +1 -0
- package/dist/src/error.js +164 -0
- package/dist/src/error.js.map +1 -0
- package/dist/src/httpServer/handler.d.ts +62 -0
- package/dist/src/httpServer/handler.d.ts.map +1 -0
- package/dist/src/httpServer/handler.js +168 -0
- package/dist/src/httpServer/handler.js.map +1 -0
- package/dist/src/httpServer/middleware.d.ts +56 -0
- package/dist/src/httpServer/middleware.d.ts.map +1 -0
- package/dist/src/httpServer/middleware.js +57 -0
- package/dist/src/httpServer/middleware.js.map +1 -0
- package/dist/src/httpServer/server.d.ts +40 -0
- package/dist/src/httpServer/server.d.ts.map +1 -0
- package/dist/src/httpServer/server.js +231 -0
- package/dist/src/httpServer/server.js.map +1 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +75 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/provenance/provenance_daemon.d.ts +34 -0
- package/dist/src/provenance/provenance_daemon.d.ts.map +1 -0
- package/dist/src/provenance/provenance_daemon.js +86 -0
- package/dist/src/provenance/provenance_daemon.js.map +1 -0
- package/dist/src/system_database.d.ts +69 -0
- package/dist/src/system_database.d.ts.map +1 -0
- package/dist/src/system_database.js +384 -0
- package/dist/src/system_database.js.map +1 -0
- package/dist/src/telemetry/collector.d.ts +17 -0
- package/dist/src/telemetry/collector.d.ts.map +1 -0
- package/dist/src/telemetry/collector.js +77 -0
- package/dist/src/telemetry/collector.js.map +1 -0
- package/dist/src/telemetry/exporters.d.ts +29 -0
- package/dist/src/telemetry/exporters.d.ts.map +1 -0
- package/dist/src/telemetry/exporters.js +186 -0
- package/dist/src/telemetry/exporters.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +7 -0
- package/dist/src/telemetry/index.d.ts.map +1 -0
- package/dist/src/telemetry/index.js +3 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/logs.d.ts +25 -0
- package/dist/src/telemetry/logs.d.ts.map +1 -0
- package/dist/src/telemetry/logs.js +91 -0
- package/dist/src/telemetry/logs.js.map +1 -0
- package/dist/src/telemetry/signals.d.ts +30 -0
- package/dist/src/telemetry/signals.d.ts.map +1 -0
- package/dist/src/telemetry/signals.js +11 -0
- package/dist/src/telemetry/signals.js.map +1 -0
- package/dist/src/telemetry/traces.d.ts +17 -0
- package/dist/src/telemetry/traces.d.ts.map +1 -0
- package/dist/src/telemetry/traces.js +76 -0
- package/dist/src/telemetry/traces.js.map +1 -0
- package/dist/src/testing/testing_runtime.d.ts +76 -0
- package/dist/src/testing/testing_runtime.d.ts.map +1 -0
- package/dist/src/testing/testing_runtime.js +147 -0
- package/dist/src/testing/testing_runtime.js.map +1 -0
- package/dist/src/transaction.d.ts +28 -0
- package/dist/src/transaction.d.ts.map +1 -0
- package/dist/src/transaction.js +27 -0
- package/dist/src/transaction.js.map +1 -0
- package/dist/src/user_database.d.ts +132 -0
- package/dist/src/user_database.d.ts.map +1 -0
- package/dist/src/user_database.js +324 -0
- package/dist/src/user_database.js.map +1 -0
- package/dist/src/utils.d.ts +6 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +35 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/src/workflow.d.ts +179 -0
- package/dist/src/workflow.d.ts.map +1 -0
- package/dist/src/workflow.js +446 -0
- package/dist/src/workflow.js.map +1 -0
- package/examples/hello/README.md +41 -0
- package/examples/hello/dbos-config.yaml +15 -0
- package/examples/hello/jest.config.js +8 -0
- package/examples/hello/knexfile.ts +23 -0
- package/examples/hello/migrations/create_dbos_hello_tables.ts +12 -0
- package/examples/hello/package.json +21 -0
- package/examples/hello/src/operations.test.ts +38 -0
- package/examples/hello/src/operations.ts +21 -0
- package/examples/hello/start_postgres_docker.sh +23 -0
- package/examples/hello/tsconfig.json +24 -0
- package/package.json +78 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
"use strict";
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
5
|
+
};
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
const config_1 = require("./config");
|
8
|
+
const runtime_1 = require("./runtime");
|
9
|
+
const commander_1 = require("commander");
|
10
|
+
const init_1 = require("./init");
|
11
|
+
const openApi_1 = require("./openApi");
|
12
|
+
const yaml_1 = __importDefault(require("yaml"));
|
13
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
14
|
+
const node_path_1 = __importDefault(require("node:path"));
|
15
|
+
const program = new commander_1.Command();
|
16
|
+
program
|
17
|
+
.command("openapi")
|
18
|
+
.argument('<entrypoint>', 'Specify the entrypoint file path')
|
19
|
+
.action(async (entrypoint) => {
|
20
|
+
const openapi = await (0, openApi_1.generateOpenApi)(entrypoint);
|
21
|
+
if (openapi) {
|
22
|
+
const filename = node_path_1.default.join(node_path_1.default.dirname(entrypoint), "openapi.yaml");
|
23
|
+
const yaml = `# OpenApi specification generated for application\n\n` + yaml_1.default.stringify(openapi, { aliasDuplicateObjects: false });
|
24
|
+
await promises_1.default.writeFile(filename, yaml, { encoding: 'utf-8' });
|
25
|
+
}
|
26
|
+
});
|
27
|
+
program
|
28
|
+
.command('start')
|
29
|
+
.description('Start the server')
|
30
|
+
.option('-p, --port <number>', 'Specify the port number')
|
31
|
+
.option('-l, --loglevel <string>', 'Specify log level')
|
32
|
+
.option('-c, --configfile <string>', 'Specify the config file path', config_1.dbosConfigFilePath)
|
33
|
+
.option('-e, --entrypoint <string>', 'Specify the entrypoint file path')
|
34
|
+
.action(async (options) => {
|
35
|
+
const [dbosConfig, runtimeConfig] = (0, config_1.parseConfigFile)(options);
|
36
|
+
const runtime = new runtime_1.DBOSRuntime(dbosConfig, runtimeConfig);
|
37
|
+
await runtime.init();
|
38
|
+
runtime.startServer();
|
39
|
+
});
|
40
|
+
program
|
41
|
+
.command('init')
|
42
|
+
.description('Init a DBOS application')
|
43
|
+
.option('-n, --appName <application-name>', 'Application name', 'dbos-hello-app')
|
44
|
+
.action(async (options) => {
|
45
|
+
await (0, init_1.init)(options.appName);
|
46
|
+
});
|
47
|
+
program.parse(process.argv);
|
48
|
+
// If no arguments provided, display help by default
|
49
|
+
if (!process.argv.slice(2).length) {
|
50
|
+
program.outputHelp();
|
51
|
+
}
|
52
|
+
//# sourceMappingURL=cli.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/dbos-runtime/cli.ts"],"names":[],"mappings":";;;;;;AAEA,qCAA+D;AAC/D,uCAA2D;AAC3D,yCAAoC;AAEpC,iCAA8B;AAC9B,uCAA4C;AAC5C,gDAAwB;AACxB,gEAAkC;AAClC,0DAA6B;AAE7B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAa9B,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,QAAQ,CAAC,cAAc,EAAE,kCAAkC,CAAC;KAC5D,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,EAAE;IACnC,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAe,EAAC,UAAU,CAAC,CAAC;IAClD,IAAI,OAAO,EAAE;QACX,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,mBAAI,CAAC,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B,oDAAoD;AACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;IACjC,OAAO,CAAC,UAAU,EAAE,CAAC;CACtB"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { DBOSConfig } from "../dbos-executor";
|
2
|
+
import { DBOSRuntimeConfig } from "./runtime";
|
3
|
+
import { UserDatabaseName } from "../user_database";
|
4
|
+
import { DBOSCLIStartOptions } from "./cli";
|
5
|
+
import { TelemetryConfig } from "../telemetry";
|
6
|
+
export declare const dbosConfigFilePath = "dbos-config.yaml";
|
7
|
+
export interface ConfigFile {
|
8
|
+
version: string;
|
9
|
+
database: {
|
10
|
+
hostname: string;
|
11
|
+
port: number;
|
12
|
+
username: string;
|
13
|
+
password?: string;
|
14
|
+
connectionTimeoutMillis: number;
|
15
|
+
user_database: string;
|
16
|
+
system_database: string;
|
17
|
+
ssl_ca?: string;
|
18
|
+
observability_database: string;
|
19
|
+
user_dbclient?: UserDatabaseName;
|
20
|
+
};
|
21
|
+
telemetry?: TelemetryConfig;
|
22
|
+
application: any;
|
23
|
+
runtimeConfig?: DBOSRuntimeConfig;
|
24
|
+
dbClientMetadata?: any;
|
25
|
+
}
|
26
|
+
export declare function loadConfigFile(configFilePath: string): ConfigFile | undefined;
|
27
|
+
export declare function parseConfigFile(cliOptions?: DBOSCLIStartOptions): [DBOSConfig, DBOSRuntimeConfig];
|
28
|
+
//# sourceMappingURL=config.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,uBAAuB,EAAE,MAAM,CAAC;QAChC,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,sBAAsB,EAAE,MAAM,CAAC;QAE/B,aAAa,CAAC,EAAE,gBAAgB,CAAC;KAClC,CAAC;IACF,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,WAAW,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAcD,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAa7E;AAMD,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,CAAC,UAAU,EAAE,iBAAiB,CAAC,CA0EjG"}
|
@@ -0,0 +1,111 @@
|
|
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.parseConfigFile = exports.loadConfigFile = exports.dbosConfigFilePath = void 0;
|
7
|
+
const error_1 = require("../error");
|
8
|
+
const utils_1 = require("../utils");
|
9
|
+
const yaml_1 = __importDefault(require("yaml"));
|
10
|
+
const user_database_1 = require("../user_database");
|
11
|
+
const applicationVersion_1 = require("./applicationVersion");
|
12
|
+
exports.dbosConfigFilePath = "dbos-config.yaml";
|
13
|
+
/*
|
14
|
+
* Substitute environment variables using a regex for matching.
|
15
|
+
* Will find anything in curly braces.
|
16
|
+
* TODO: Use a more robust solution.
|
17
|
+
*/
|
18
|
+
function substituteEnvVars(content) {
|
19
|
+
const regex = /\${([^}]+)}/g; // Regex to match ${VAR_NAME} style placeholders
|
20
|
+
return content.replace(regex, (_, g1) => {
|
21
|
+
return process.env[g1] || ""; // If the env variable is not set, return an empty string.
|
22
|
+
});
|
23
|
+
}
|
24
|
+
function loadConfigFile(configFilePath) {
|
25
|
+
let configFile;
|
26
|
+
try {
|
27
|
+
const configFileContent = (0, utils_1.readFileSync)(configFilePath);
|
28
|
+
const interpolatedConfig = substituteEnvVars(configFileContent);
|
29
|
+
configFile = yaml_1.default.parse(interpolatedConfig);
|
30
|
+
}
|
31
|
+
catch (e) {
|
32
|
+
if (e instanceof Error) {
|
33
|
+
throw new error_1.DBOSInitializationError(`Failed to load config from ${configFilePath}: ${e.message}`);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
return configFile;
|
37
|
+
}
|
38
|
+
exports.loadConfigFile = loadConfigFile;
|
39
|
+
/*
|
40
|
+
* Parse `dbosConfigFilePath` and return DBOSConfig and DBOSRuntimeConfig
|
41
|
+
* Considers DBOSCLIStartOptions if provided, which takes precedence over config file
|
42
|
+
* */
|
43
|
+
function parseConfigFile(cliOptions) {
|
44
|
+
const configFilePath = cliOptions?.configfile ?? exports.dbosConfigFilePath;
|
45
|
+
const configFile = loadConfigFile(configFilePath);
|
46
|
+
if (!configFile) {
|
47
|
+
throw new error_1.DBOSInitializationError(`DBOS configuration file ${configFilePath} is empty`);
|
48
|
+
}
|
49
|
+
(0, applicationVersion_1.setApplicationVersion)(configFile.version);
|
50
|
+
/*******************************/
|
51
|
+
/* Handle user database config */
|
52
|
+
/*******************************/
|
53
|
+
if (!configFile.database) {
|
54
|
+
throw new error_1.DBOSInitializationError(`DBOS configuration ${configFilePath} does not contain database config`);
|
55
|
+
}
|
56
|
+
const poolConfig = {
|
57
|
+
host: configFile.database.hostname,
|
58
|
+
port: configFile.database.port,
|
59
|
+
user: configFile.database.username,
|
60
|
+
password: configFile.database.password,
|
61
|
+
connectionTimeoutMillis: configFile.database.connectionTimeoutMillis || 3000,
|
62
|
+
database: configFile.database.user_database,
|
63
|
+
};
|
64
|
+
if (!poolConfig.password) {
|
65
|
+
throw new error_1.DBOSInitializationError(`DBOS configuration ${configFilePath} does not contain database password`);
|
66
|
+
}
|
67
|
+
if (configFile.database.ssl_ca) {
|
68
|
+
poolConfig.ssl = { ca: [(0, utils_1.readFileSync)(configFile.database.ssl_ca)], rejectUnauthorized: true };
|
69
|
+
}
|
70
|
+
/***************************/
|
71
|
+
/* Handle telemetry config */
|
72
|
+
/***************************/
|
73
|
+
// Consider CLI --loglevel flag. A bit verbose because everything is optional.
|
74
|
+
if (cliOptions?.loglevel) {
|
75
|
+
if (!configFile.telemetry) {
|
76
|
+
configFile.telemetry = { logs: { logLevel: cliOptions.loglevel } };
|
77
|
+
}
|
78
|
+
else if (!configFile.telemetry.logs) {
|
79
|
+
configFile.telemetry.logs = { logLevel: cliOptions.loglevel };
|
80
|
+
}
|
81
|
+
else {
|
82
|
+
configFile.telemetry.logs.logLevel = cliOptions.loglevel;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
/************************************/
|
86
|
+
/* Build final DBOS configuration */
|
87
|
+
/************************************/
|
88
|
+
const dbosConfig = {
|
89
|
+
poolConfig: poolConfig,
|
90
|
+
userDbclient: configFile.database.user_dbclient || user_database_1.UserDatabaseName.KNEX,
|
91
|
+
telemetry: configFile.telemetry || undefined,
|
92
|
+
system_database: configFile.database.system_database ?? "dbos_systemdb",
|
93
|
+
observability_database: configFile.database.observability_database || undefined,
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
95
|
+
application: configFile.application || undefined,
|
96
|
+
dbClientMetadata: {
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
98
|
+
entities: configFile.dbClientMetadata?.entities,
|
99
|
+
},
|
100
|
+
};
|
101
|
+
/*************************************/
|
102
|
+
/* Build final runtime Configuration */
|
103
|
+
/*************************************/
|
104
|
+
const runtimeConfig = {
|
105
|
+
entrypoint: cliOptions?.entrypoint || configFile.runtimeConfig?.entrypoint || "dist/operations.js",
|
106
|
+
port: cliOptions?.port || configFile.runtimeConfig?.port || 3000,
|
107
|
+
};
|
108
|
+
return [dbosConfig, runtimeConfig];
|
109
|
+
}
|
110
|
+
exports.parseConfigFile = parseConfigFile;
|
111
|
+
//# sourceMappingURL=config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dbos-runtime/config.ts"],"names":[],"mappings":";;;;;;AAAA,oCAAmD;AACnD,oCAAwC;AAGxC,gDAAwB;AAExB,oDAAoD;AAGpD,6DAA6D;AAEhD,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAyBrD;;;;EAIE;AACF,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,KAAK,GAAG,cAAc,CAAC,CAAE,gDAAgD;IAC/E,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAU,EAAE,EAAE;QAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAE,0DAA0D;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,cAAsB;IACnD,IAAI,UAAkC,CAAC;IACvC,IAAI;QACF,MAAM,iBAAiB,GAAG,IAAA,oBAAY,EAAC,cAAc,CAAC,CAAC;QACvD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,iBAA2B,CAAC,CAAC;QAC1E,UAAU,GAAG,cAAI,CAAC,KAAK,CAAC,kBAAkB,CAAe,CAAC;KAC3D;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CA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AI,UAAU,CAAC,aAAa,EAAE,UAAU,IAAI,oBAAoB;QAClG,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,UAAU,CAAC,aAAa,EAAE,IAAI,IAAI,IAAI;KACjE,CAAC;IAEF,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACrC,CAAC;AA1ED,0CA0EC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
interface CopyOption {
|
2
|
+
rename?: (basename: string) => string;
|
3
|
+
}
|
4
|
+
export declare const copy: (src: string, targets: string[], dest: string, { rename }?: CopyOption) => Promise<void[]>;
|
5
|
+
export declare function init(appName: string): Promise<void>;
|
6
|
+
export {};
|
7
|
+
//# sourceMappingURL=init.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/init.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;CACtC;AAID,eAAO,MAAM,IAAI,QACV,MAAM,WACF,MAAM,EAAE,QACX,MAAM,eACW,UAAU,oBA6BlC,CAAA;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,MAAM,iBAiBzC"}
|
@@ -0,0 +1,51 @@
|
|
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.init = exports.copy = void 0;
|
7
|
+
const fast_glob_1 = require("fast-glob");
|
8
|
+
const path_1 = __importDefault(require("path"));
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
10
|
+
const child_process_1 = require("child_process");
|
11
|
+
const error_1 = require("../error");
|
12
|
+
const identity = (x) => x;
|
13
|
+
const copy = async (src, targets, dest, { rename = identity } = {}) => {
|
14
|
+
if (targets.length === 0 || !dest) {
|
15
|
+
throw new TypeError('`src` and `dest` are required');
|
16
|
+
}
|
17
|
+
const sourceFiles = await (0, fast_glob_1.async)(targets, {
|
18
|
+
cwd: src,
|
19
|
+
dot: true,
|
20
|
+
absolute: false,
|
21
|
+
stats: false,
|
22
|
+
ignore: ['**/node_modules/**', '**/dist/**']
|
23
|
+
});
|
24
|
+
return Promise.all(sourceFiles.map(async (p) => {
|
25
|
+
const dirname = path_1.default.dirname(p);
|
26
|
+
const basename = rename(path_1.default.basename(p));
|
27
|
+
const from = path_1.default.resolve(src, p);
|
28
|
+
const to = path_1.default.join(dest, dirname, basename);
|
29
|
+
// Ensure the destination directory exists
|
30
|
+
await fs_1.default.promises.mkdir(path_1.default.dirname(to), { recursive: true });
|
31
|
+
return fs_1.default.promises.copyFile(from, to);
|
32
|
+
}));
|
33
|
+
};
|
34
|
+
exports.copy = copy;
|
35
|
+
async function init(appName) {
|
36
|
+
if (fs_1.default.existsSync(appName)) {
|
37
|
+
throw new error_1.DBOSError(`Directory ${appName} already exists, exiting...`);
|
38
|
+
}
|
39
|
+
const templatePath = path_1.default.resolve(__dirname, '..', '..', '..', 'examples', 'hello');
|
40
|
+
const targets = ["**"];
|
41
|
+
await (0, exports.copy)(templatePath, targets, appName);
|
42
|
+
const packageJsonName = path_1.default.resolve(appName, 'package.json');
|
43
|
+
const content = fs_1.default.readFileSync(packageJsonName, 'utf-8');
|
44
|
+
let updatedContent = content.replace('"name": "dbos-hello"', `"name": "${appName}"`);
|
45
|
+
updatedContent = updatedContent.replace('"@dbos-inc/dbos-sdk": "../..",', ``);
|
46
|
+
fs_1.default.writeFileSync(packageJsonName, updatedContent, 'utf-8');
|
47
|
+
(0, child_process_1.execSync)("npm i", { cwd: appName, stdio: 'inherit' });
|
48
|
+
(0, child_process_1.execSync)("npm install --save @dbos-inc/dbos-sdk", { cwd: appName, stdio: 'inherit' });
|
49
|
+
}
|
50
|
+
exports.init = init;
|
51
|
+
//# sourceMappingURL=init.js.map
|
@@ -0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jBD,oBAiBC"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import ts from 'typescript';
|
2
|
+
import { DecoratorInfo, MethodInfo, ClassInfo, ParameterInfo } from './TypeParser';
|
3
|
+
import { APITypes, ArgSources } from '../httpServer/handler';
|
4
|
+
import { Schema } from 'ts-json-schema-generator';
|
5
|
+
import { OpenAPIV3 as OpenApi3 } from 'openapi-types';
|
6
|
+
interface HttpEndpointInfo {
|
7
|
+
verb: APITypes;
|
8
|
+
path: string;
|
9
|
+
}
|
10
|
+
export declare class OpenApiGenerator {
|
11
|
+
#private;
|
12
|
+
readonly program: ts.Program;
|
13
|
+
get diags(): readonly ts.Diagnostic[];
|
14
|
+
constructor(program: ts.Program);
|
15
|
+
generate(classes: readonly ClassInfo[], title: string, version: string): OpenApi3.Document | undefined;
|
16
|
+
generatePath(method: MethodInfo, { verb, path }: HttpEndpointInfo, defaultRoles: readonly string[], securityScheme: string | undefined): [string, OpenApi3.PathItemObject] | undefined;
|
17
|
+
getMethodReturnType(node: ts.MethodDeclaration): ts.Type | undefined;
|
18
|
+
generateResponse(method: MethodInfo): [string, OpenApi3.ResponseObject] | undefined;
|
19
|
+
generateParameters(sourcedParams: [ParameterInfo, ArgSources][]): OpenApi3.ParameterObject[];
|
20
|
+
generateParameter(parameter: ParameterInfo, argSource: ArgSources): OpenApi3.ParameterObject | undefined;
|
21
|
+
getLocation(parameter: ParameterInfo, argSource: ArgSources): "query" | "path" | undefined;
|
22
|
+
generateRequestBody(sourcedParams: [ParameterInfo, ArgSources][]): OpenApi3.RequestBodyObject | undefined;
|
23
|
+
generateSchema(node?: ts.Node): OpenApi3.SchemaObject | OpenApi3.ReferenceObject | undefined;
|
24
|
+
getDBOSDecorator(decorated: MethodInfo | ParameterInfo | ClassInfo, name: string): DecoratorInfo | undefined;
|
25
|
+
getHttpInfo(method: MethodInfo): HttpEndpointInfo | undefined;
|
26
|
+
getParamSource(parameter: ParameterInfo, verb: APITypes): ArgSources.BODY | ArgSources.QUERY | ArgSources.URL | undefined;
|
27
|
+
getParamName(parameter: ParameterInfo): string | undefined;
|
28
|
+
mapSchema(schema: Schema): OpenApi3.SchemaObject | OpenApi3.ReferenceObject | undefined;
|
29
|
+
parseStringLiteralArray(node: ts.Expression | undefined): string[] | undefined;
|
30
|
+
parseSecurityScheme(arg?: ts.Expression): SecurityScheme | undefined;
|
31
|
+
}
|
32
|
+
type SecurityScheme = Exclude<OpenApi3.SecuritySchemeObject, OpenApi3.OAuth2SecurityScheme>;
|
33
|
+
export declare function generateOpenApi(entrypoint: string): Promise<OpenApi3.Document | undefined>;
|
34
|
+
export {};
|
35
|
+
//# sourceMappingURL=openApi.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"openApi.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/openApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAc,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAmG,MAAM,EAAuD,MAAM,0BAA0B,CAAC;AACxM,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOtD,UAAU,gBAAgB;IAAG,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE;AAqD5D,qBAAa,gBAAgB;;IAQf,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO;IAFxC,IAAI,KAAK,6BAAgC;gBAEpB,OAAO,EAAE,EAAE,CAAC,OAAO;IAWxC,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,GAAG,SAAS;IAmCtG,YAAY,CAAC,MAAM,EAAE,UAAU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