@hatchet-dev/typescript-sdk 1.24.1 → 1.24.3
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/README.md
CHANGED
|
@@ -32,7 +32,7 @@ pnpm add @hatchet-dev/typescript-sdk
|
|
|
32
32
|
|
|
33
33
|
## Quick Start
|
|
34
34
|
|
|
35
|
-
For examples of how to use the Hatchet TypeScript SDK, including worker setup and task execution, please see our [official documentation](https://docs.hatchet.run/
|
|
35
|
+
For examples of how to use the Hatchet TypeScript SDK, including worker setup and task execution, please see our [official documentation](https://docs.hatchet.run/v1).
|
|
36
36
|
|
|
37
37
|
## Features
|
|
38
38
|
|
|
@@ -187,7 +187,9 @@ class DurableListenerClient {
|
|
|
187
187
|
}
|
|
188
188
|
_connect() {
|
|
189
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
var _a;
|
|
190
191
|
this.logger.info('durable event listener connecting...');
|
|
192
|
+
(_a = this._receiveAbort) === null || _a === void 0 ? void 0 : _a.abort();
|
|
191
193
|
this._requestQueue = [];
|
|
192
194
|
this._receiveAbort = new AbortController();
|
|
193
195
|
this._enqueueRequest({
|
|
@@ -248,12 +250,15 @@ class DurableListenerClient {
|
|
|
248
250
|
}
|
|
249
251
|
_requestIterator() {
|
|
250
252
|
return __asyncGenerator(this, arguments, function* _requestIterator_1() {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
const queue = this._requestQueue;
|
|
254
|
+
const { signal } = this._receiveAbort;
|
|
255
|
+
while (this._running && !signal.aborted) {
|
|
256
|
+
while (queue.length > 0) {
|
|
257
|
+
yield yield __await(queue.shift());
|
|
254
258
|
}
|
|
255
259
|
yield __await(new Promise((resolve) => {
|
|
256
260
|
this._requestNotify = resolve;
|
|
261
|
+
signal.addEventListener('abort', () => resolve(), { once: true });
|
|
257
262
|
}));
|
|
258
263
|
this._requestNotify = undefined;
|
|
259
264
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.3",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -15,8 +15,22 @@
|
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "https://github.com/hatchet-dev/hatchet.git"
|
|
17
17
|
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
|
|
18
|
+
"keywords": [
|
|
19
|
+
"typescript",
|
|
20
|
+
"hatchet",
|
|
21
|
+
"workflow",
|
|
22
|
+
"orchestration",
|
|
23
|
+
"background-tasks",
|
|
24
|
+
"job-queue",
|
|
25
|
+
"task-scheduling"
|
|
26
|
+
],
|
|
27
|
+
"author": "Hatchet <contact@hatchet.run>",
|
|
28
|
+
"contributors": [
|
|
29
|
+
"Alexander Belanger <alexander@hatchet.run>",
|
|
30
|
+
"Matt Kaye <matt@hatchet.run>",
|
|
31
|
+
"Gabe Ruttner <gabe@hatchet.run>",
|
|
32
|
+
"Mohammed Nafees <nafees@hatchet.run>"
|
|
33
|
+
],
|
|
20
34
|
"license": "MIT",
|
|
21
35
|
"devDependencies": {
|
|
22
36
|
"@aws-sdk/client-s3": "^3.1042.0",
|
package/v1/client/client.d.ts
CHANGED
|
@@ -46,8 +46,6 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
46
46
|
/** The tenant ID for the Hatchet client */
|
|
47
47
|
tenantId: string;
|
|
48
48
|
logger: Logger;
|
|
49
|
-
_isV1: boolean | undefined;
|
|
50
|
-
get isV1(): boolean;
|
|
51
49
|
/**
|
|
52
50
|
* Creates a new Hatchet client instance.
|
|
53
51
|
* @param config - Optional configuration for the client
|
|
@@ -132,7 +130,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
|
|
|
132
130
|
* @param options - Configuration options for the workflow run
|
|
133
131
|
* @returns A WorkflowRunRef containing the run ID and methods to interact with the run
|
|
134
132
|
*/
|
|
135
|
-
runNoWait<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> | LegacyWorkflow | string, input: I, options
|
|
133
|
+
runNoWait<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> | LegacyWorkflow | string, input: I, options?: RunOpts): Promise<WorkflowRunRef<O>>;
|
|
136
134
|
/**
|
|
137
135
|
* Triggers a workflow run and waits for the result.
|
|
138
136
|
* @template I - The input type for the workflow
|
package/v1/client/client.js
CHANGED
|
@@ -54,9 +54,6 @@ class HatchetClient {
|
|
|
54
54
|
}
|
|
55
55
|
return this._v0;
|
|
56
56
|
}
|
|
57
|
-
get isV1() {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
57
|
/**
|
|
61
58
|
* Creates a new Hatchet client instance.
|
|
62
59
|
* @param config - Optional configuration for the client
|
|
@@ -66,7 +63,6 @@ class HatchetClient {
|
|
|
66
63
|
*/
|
|
67
64
|
constructor(config, options, axiosConfig) {
|
|
68
65
|
var _a;
|
|
69
|
-
this._isV1 = true;
|
|
70
66
|
try {
|
|
71
67
|
const loaded = config_loader_1.ConfigLoader.loadClientConfig(config, {
|
|
72
68
|
path: options === null || options === void 0 ? void 0 : options.config_path,
|
|
@@ -185,8 +181,8 @@ class HatchetClient {
|
|
|
185
181
|
* @param options - Configuration options for the workflow run
|
|
186
182
|
* @returns A WorkflowRunRef containing the run ID and methods to interact with the run
|
|
187
183
|
*/
|
|
188
|
-
runNoWait(
|
|
189
|
-
return __awaiter(this,
|
|
184
|
+
runNoWait(workflow_1, input_1) {
|
|
185
|
+
return __awaiter(this, arguments, void 0, function* (workflow, input, options = {}) {
|
|
190
186
|
const name = (0, legacy_transformer_1.getWorkflowName)(workflow);
|
|
191
187
|
return this.admin.runWorkflow(name, input, options);
|
|
192
188
|
});
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.24.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.24.3";
|
package/version.js
CHANGED