@dbos-inc/dbos-sdk 3.0.27-preview → 3.0.29-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.
Files changed (40) hide show
  1. package/dist/src/datasource.d.ts +14 -3
  2. package/dist/src/datasource.d.ts.map +1 -1
  3. package/dist/src/datasource.js +5 -2
  4. package/dist/src/datasource.js.map +1 -1
  5. package/dist/src/dbos-executor.d.ts +28 -64
  6. package/dist/src/dbos-executor.d.ts.map +1 -1
  7. package/dist/src/dbos-executor.js +60 -243
  8. package/dist/src/dbos-executor.js.map +1 -1
  9. package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
  10. package/dist/src/dbos-runtime/runtime.js +0 -9
  11. package/dist/src/dbos-runtime/runtime.js.map +1 -1
  12. package/dist/src/dbos.d.ts +6 -22
  13. package/dist/src/dbos.d.ts.map +1 -1
  14. package/dist/src/dbos.js +6 -17
  15. package/dist/src/dbos.js.map +1 -1
  16. package/dist/src/decorators.d.ts +26 -53
  17. package/dist/src/decorators.d.ts.map +1 -1
  18. package/dist/src/decorators.js +150 -162
  19. package/dist/src/decorators.js.map +1 -1
  20. package/dist/src/httpServer/handler.js +1 -1
  21. package/dist/src/httpServer/handler.js.map +1 -1
  22. package/dist/src/httpServer/server.d.ts.map +1 -1
  23. package/dist/src/httpServer/server.js +4 -3
  24. package/dist/src/httpServer/server.js.map +1 -1
  25. package/dist/src/index.d.ts +2 -4
  26. package/dist/src/index.d.ts.map +1 -1
  27. package/dist/src/index.js +7 -11
  28. package/dist/src/index.js.map +1 -1
  29. package/dist/src/scheduler/scheduler.d.ts.map +1 -1
  30. package/dist/src/scheduler/scheduler.js +3 -2
  31. package/dist/src/scheduler/scheduler.js.map +1 -1
  32. package/dist/src/system_database.d.ts +5 -6
  33. package/dist/src/system_database.d.ts.map +1 -1
  34. package/dist/src/system_database.js.map +1 -1
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +1 -1
  37. package/dist/src/eventreceiver.d.ts +0 -152
  38. package/dist/src/eventreceiver.d.ts.map +0 -1
  39. package/dist/src/eventreceiver.js +0 -3
  40. package/dist/src/eventreceiver.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbos-inc/dbos-sdk",
3
- "version": "3.0.27-preview",
3
+ "version": "3.0.29-preview",
4
4
  "description": "A Typescript framework built on the database",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,152 +0,0 @@
1
- import { Tracer } from './telemetry/traces';
2
- import { GlobalLogger } from './telemetry/logs';
3
- import type { GetQueuedWorkflowsInput, GetWorkflowsInput, StepInfo, WorkflowHandle, WorkflowParams, WorkflowStatus } from './workflow';
4
- import type { MethodRegistrationBase } from './decorators';
5
- import type { Notification } from 'pg';
6
- export type DBNotification = Notification;
7
- export type DBNotificationCallback = (n: DBNotification) => void;
8
- export interface DBNotificationListener {
9
- close(): Promise<void>;
10
- }
11
- /**
12
- * Interface for registration information provided to `DBOSEventReceiver`
13
- * instances about each method and containing class. This contains any
14
- * information stored by the decorators that registered the method with
15
- * its event receiver.
16
- */
17
- export interface DBOSEventReceiverRegistration {
18
- /** Method-level configuration information, as stored by the event receiver's decorators (or other registration mechanism) */
19
- methodConfig: unknown;
20
- /** Class-level configuration information, as stored by the event receiver's decorators (or other registration mechanism) */
21
- classConfig: unknown;
22
- /** Method to dispatch, and associated DBOS registration information */
23
- methodReg: MethodRegistrationBase;
24
- }
25
- export interface DBOSExecutorContext {
26
- /** Logging service; @deprecated: Use `DBOS.logger` instead. */
27
- readonly logger: GlobalLogger;
28
- /** Tracing service; @deprecated: Use `DBOS.tracer` instead. */
29
- readonly tracer: Tracer;
30
- /** @deprecated */
31
- getConfig<T>(key: string): T | undefined;
32
- /** @deprecated */
33
- getConfig<T>(key: string, defaultValue: T): T;
34
- /**
35
- * Get the registrations for a receiver
36
- * @param eri - all registrations for this `DBOSEventReceiver` will be returned
37
- * @returns array of all methods registered for the receiver, including:
38
- * methodConfig: the method info the receiver stored
39
- * classConfig: the class info the receiver stored
40
- * methodReg: the method registration (w/ workflow, transaction, function, and other info)
41
- */
42
- getRegistrationsFor(eri: DBOSEventReceiver): DBOSEventReceiverRegistration[];
43
- /**
44
- * Invoke a transaction function.
45
- * Note that functions can be called directly instead of using this interface.
46
- */
47
- transaction<T extends unknown[], R>(txn: (...args: T) => Promise<R>, params: WorkflowParams, ...args: T): Promise<R>;
48
- /**
49
- * Invoke a workflow function.
50
- * Note that functions can be enqueued directly with `DBOS.startWorkflow` instead of using this interface.
51
- */
52
- workflow<T extends unknown[], R>(wf: (...args: T) => Promise<R>, params: WorkflowParams, ...args: T): Promise<WorkflowHandle<R>>;
53
- /**
54
- * @deprecated
55
- * Invoke a step function.
56
- * Note that functions can be called directly instead of using this interface.
57
- */
58
- external<T extends unknown[], R>(func: (...args: T) => Promise<R>, params: WorkflowParams, ...args: T): Promise<R>;
59
- /**
60
- * @deprecated
61
- * Invoke a stored procedure function.
62
- * Note that functions can be called directly instead of using this interface.
63
- */
64
- procedure<T extends unknown[], R>(proc: (...args: T) => Promise<R>, params: WorkflowParams, ...args: T): Promise<R>;
65
- /**
66
- * Send a messsage to workflow with a given ID.
67
- * @deprecated `DBOS.send` can be used instead.
68
- * @param destinationID - ID of workflow to receive the message
69
- * @param message - Message
70
- * @param topic - Topic for message
71
- * @param idempotencyKey - For sending exactly once
72
- * @template T - Type of object to send
73
- */
74
- send<T>(destinationID: string, message: T, topic?: string, idempotencyKey?: string): Promise<void>;
75
- /**
76
- * Get an event set by a workflow.
77
- * @deprecated Note that `DBOS.getEvent` can be used instead.
78
- */
79
- getEvent<T>(workflowID: string, key: string, timeoutSeconds?: number): Promise<T | null>;
80
- /**
81
- * Retrieve a workflow handle given the workflow ID.
82
- * @deprecated Note that `DBOS.retrieveWorkflow` can be used instead
83
- */
84
- retrieveWorkflow<R>(workflowID: string): WorkflowHandle<R>;
85
- /** @deprecated Use functions on `DBOS` */
86
- getWorkflowStatus(workflowID: string, callerID?: string, callerFN?: number): Promise<WorkflowStatus | null>;
87
- /** @deprecated Use functions on `DBOS` */
88
- listWorkflows(input: GetWorkflowsInput): Promise<WorkflowStatus[]>;
89
- /** @deprecated Use functions on `DBOS` */
90
- listQueuedWorkflows(input: GetQueuedWorkflowsInput): Promise<WorkflowStatus[]>;
91
- /** @deprecated Use functions on `DBOS` */
92
- listWorkflowSteps(workflowID: string): Promise<StepInfo[] | undefined>;
93
- /** @deprecated Use functions on `DBOS` */
94
- cancelWorkflow(workflowID: string): Promise<void>;
95
- /** @deprecated Use functions on `DBOS` */
96
- resumeWorkflow(workflowID: string): Promise<void>;
97
- /** @deprecated Use functions on `DBOS` */
98
- forkWorkflow(workflowID: string, startStep: number, options?: {
99
- newWorkflowID?: string;
100
- applicationVersion?: string;
101
- timeoutMS?: number;
102
- }): Promise<string>;
103
- /** @deprecated see DBOS.getEventDispatchState */
104
- getEventDispatchState(service: string, workflowFnName: string, key: string): Promise<DBOSEventReceiverState | undefined>;
105
- /** @deprecated see DBOS.upsertEventDispatchState */
106
- upsertEventDispatchState(state: DBOSEventReceiverState): Promise<DBOSEventReceiverState>;
107
- /** @deprecated Use `DBOS.queryUserDB` */
108
- queryUserDB(sql: string, params?: unknown[]): Promise<unknown[]>;
109
- /** @deprecated Listen for notifications from the user DB */
110
- userDBListen(channels: string[], callback: DBNotificationCallback): Promise<DBNotificationListener>;
111
- }
112
- /**
113
- * Interface for DBOS pluggable event receivers.
114
- * This is for things like kafka, SQS, HTTP, schedulers, etc., that listen or poll
115
- * for events and dispatch workflows in response.
116
- * A `DBOSEventReceiver` will be:
117
- * Registered with DBOS executor when any endpoint workflow function needs it
118
- * Initialized with the executor during launch
119
- * Destroyed upon any clean `shutdown()`
120
- * It is the implementer's job to keep going and dispatch workflows between
121
- * `initialize` and `destroy`
122
- */
123
- export interface DBOSEventReceiver {
124
- /** Executor, for providing state and dispatching DBOS workflows or other methods */
125
- executor?: DBOSExecutorContext;
126
- /** Called upon shutdown (usually in tests) to stop event receivers and free resources */
127
- destroy(): Promise<void>;
128
- /** Called during DBOS launch to indicate that event receiving should start */
129
- initialize(executor: DBOSExecutorContext): Promise<void>;
130
- /** Called at launch; Implementers should emit a diagnostic list of all registrations */
131
- logRegisteredEndpoints(): void;
132
- }
133
- /**
134
- * State item to be kept in the DBOS system database on behalf of `DBOSEventReceiver`s
135
- * @see DBOSEventReceiver.upsertEventDispatchState
136
- * @see DBOSEventReceiver.getEventDispatchState
137
- */
138
- export interface DBOSEventReceiverState {
139
- /** Name of event receiver service */
140
- service: string;
141
- /** Fully qualified function name for which state is kept */
142
- workflowFnName: string;
143
- /** subkey within the service+workflowFnName */
144
- key: string;
145
- /** Value kept for the service+workflowFnName+key combination */
146
- value?: string;
147
- /** Updated time (used to version the value) */
148
- updateTime?: number;
149
- /** Updated sequence number (used to version the value) */
150
- updateSeq?: bigint;
151
- }
152
- //# sourceMappingURL=eventreceiver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eventreceiver.d.ts","sourceRoot":"","sources":["../../src/eventreceiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;AAC1C,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;AACjE,MAAM,WAAW,sBAAsB;IACrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;GAKG;AACH,M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IACxF,sBAAsB,IAAI,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=eventreceiver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eventreceiver.js","sourceRoot":"","sources":["../../src/eventreceiver.ts"],"names":[],"mappings":""}