@hatchet-dev/typescript-sdk 0.1.5 → 0.1.8
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/clients/admin/admin-client.d.ts +2 -2
- package/clients/admin/admin-client.js +2 -2
- package/clients/dispatcher/action-listener.d.ts +3 -3
- package/clients/dispatcher/action-listener.js +2 -2
- package/clients/dispatcher/dispatcher-client.d.ts +5 -5
- package/clients/dispatcher/dispatcher-client.js +3 -3
- package/clients/event/event-client.d.ts +4 -4
- package/clients/event/event-client.js +3 -3
- package/clients/hatchet-client/hatchet-client.d.ts +6 -6
- package/clients/hatchet-client/hatchet-client.js +6 -6
- package/clients/worker/worker.d.ts +6 -6
- package/clients/worker/worker.js +6 -6
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +5 -5
- package/sdk.d.ts +1 -1
- package/sdk.js +1 -1
- package/step.js +1 -1
- package/util/config-loader/config-loader.d.ts +1 -1
- package/util/config-loader/config-loader.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Channel, ClientFactory } from 'nice-grpc';
|
|
2
|
-
import { CreateWorkflowVersionOpts, WorkflowServiceClient } from '
|
|
3
|
-
import { ClientConfig } from '
|
|
2
|
+
import { CreateWorkflowVersionOpts, WorkflowServiceClient } from '../../protoc/workflows';
|
|
3
|
+
import { ClientConfig } from '../hatchet-client/client-config';
|
|
4
4
|
export declare class AdminClient {
|
|
5
5
|
config: ClientConfig;
|
|
6
6
|
client: WorkflowServiceClient;
|
|
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.AdminClient = void 0;
|
|
16
|
-
const workflows_1 = require("
|
|
17
|
-
const hatchet_error_1 = __importDefault(require("
|
|
16
|
+
const workflows_1 = require("../../protoc/workflows");
|
|
17
|
+
const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error"));
|
|
18
18
|
class AdminClient {
|
|
19
19
|
constructor(config, channel, factory) {
|
|
20
20
|
this.config = config;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DispatcherClient as PbDispatcherClient, AssignedAction } from '
|
|
2
|
-
import { ClientConfig } from '
|
|
1
|
+
import { DispatcherClient as PbDispatcherClient, AssignedAction } from '../../protoc/dispatcher';
|
|
2
|
+
import { ClientConfig } from '../hatchet-client/client-config';
|
|
3
3
|
import { DispatcherClient } from './dispatcher-client';
|
|
4
4
|
export interface Action {
|
|
5
5
|
tenantId: string;
|
|
@@ -22,5 +22,5 @@ export declare class ActionListener {
|
|
|
22
22
|
constructor(client: DispatcherClient, listener: AsyncIterable<AssignedAction>, workerId: string);
|
|
23
23
|
actions: () => AsyncGenerator<Action, void, unknown>;
|
|
24
24
|
retrySubscribe(): Promise<void>;
|
|
25
|
-
unregister(): Promise<import("
|
|
25
|
+
unregister(): Promise<import("../../protoc/dispatcher").WorkerUnsubscribeResponse>;
|
|
26
26
|
}
|
|
@@ -34,8 +34,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.ActionListener = void 0;
|
|
36
36
|
const nice_grpc_1 = require("nice-grpc");
|
|
37
|
-
const sleep_1 = __importDefault(require("
|
|
38
|
-
const hatchet_error_1 = __importDefault(require("
|
|
37
|
+
const sleep_1 = __importDefault(require("../../util/sleep"));
|
|
38
|
+
const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error"));
|
|
39
39
|
const DEFAULT_ACTION_LISTENER_RETRY_INTERVAL = 5; // seconds
|
|
40
40
|
const DEFAULT_ACTION_LISTENER_RETRY_COUNT = 5;
|
|
41
41
|
class ActionListener {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Channel, ClientFactory } from 'nice-grpc';
|
|
2
|
-
import { DispatcherClient as PbDispatcherClient, StepActionEvent, GroupKeyActionEvent } from '
|
|
3
|
-
import { ClientConfig } from '
|
|
4
|
-
import { Logger } from '
|
|
2
|
+
import { DispatcherClient as PbDispatcherClient, StepActionEvent, GroupKeyActionEvent } from '../../protoc/dispatcher';
|
|
3
|
+
import { ClientConfig } from '../hatchet-client/client-config';
|
|
4
|
+
import { Logger } from '../../util/logger';
|
|
5
5
|
import { ActionListener } from './action-listener';
|
|
6
6
|
interface GetActionListenerOptions {
|
|
7
7
|
workerName: string;
|
|
@@ -14,7 +14,7 @@ export declare class DispatcherClient {
|
|
|
14
14
|
logger: Logger;
|
|
15
15
|
constructor(config: ClientConfig, channel: Channel, factory: ClientFactory);
|
|
16
16
|
getActionListener(options: GetActionListenerOptions): Promise<ActionListener>;
|
|
17
|
-
sendStepActionEvent(in_: StepActionEvent): Promise<import("
|
|
18
|
-
sendGroupKeyActionEvent(in_: GroupKeyActionEvent): Promise<import("
|
|
17
|
+
sendStepActionEvent(in_: StepActionEvent): Promise<import("../../protoc/dispatcher").ActionEventResponse>;
|
|
18
|
+
sendGroupKeyActionEvent(in_: GroupKeyActionEvent): Promise<import("../../protoc/dispatcher").ActionEventResponse>;
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DispatcherClient = void 0;
|
|
16
|
-
const dispatcher_1 = require("
|
|
17
|
-
const hatchet_error_1 = __importDefault(require("
|
|
18
|
-
const logger_1 = require("
|
|
16
|
+
const dispatcher_1 = require("../../protoc/dispatcher");
|
|
17
|
+
const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error"));
|
|
18
|
+
const logger_1 = require("../../util/logger");
|
|
19
19
|
const action_listener_1 = require("./action-listener");
|
|
20
20
|
class DispatcherClient {
|
|
21
21
|
constructor(config, channel, factory) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Channel, ClientFactory } from 'nice-grpc';
|
|
2
|
-
import { EventsServiceClient } from '
|
|
3
|
-
import { ClientConfig } from '
|
|
4
|
-
import { Logger } from '
|
|
2
|
+
import { EventsServiceClient } from '../../protoc/events/events';
|
|
3
|
+
import { ClientConfig } from '../hatchet-client/client-config';
|
|
4
|
+
import { Logger } from '../../util/logger';
|
|
5
5
|
export declare class EventClient {
|
|
6
6
|
config: ClientConfig;
|
|
7
7
|
client: EventsServiceClient;
|
|
8
8
|
logger: Logger;
|
|
9
9
|
constructor(config: ClientConfig, channel: Channel, factory: ClientFactory);
|
|
10
|
-
push<T>(type: string, input: T): Promise<import("
|
|
10
|
+
push<T>(type: string, input: T): Promise<import("../../protoc/events/events").Event>;
|
|
11
11
|
}
|
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.EventClient = void 0;
|
|
7
|
-
const events_1 = require("
|
|
8
|
-
const hatchet_error_1 = __importDefault(require("
|
|
9
|
-
const logger_1 = require("
|
|
7
|
+
const events_1 = require("../../protoc/events/events");
|
|
8
|
+
const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error"));
|
|
9
|
+
const logger_1 = require("../../util/logger");
|
|
10
10
|
class EventClient {
|
|
11
11
|
constructor(config, channel, factory) {
|
|
12
12
|
this.config = config;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EventClient } from '
|
|
2
|
-
import { DispatcherClient } from '
|
|
3
|
-
import { AdminClient } from '
|
|
1
|
+
import { EventClient } from '../event/event-client';
|
|
2
|
+
import { DispatcherClient } from '../dispatcher/dispatcher-client';
|
|
3
|
+
import { AdminClient } from '../admin/admin-client';
|
|
4
4
|
import { Channel, ChannelCredentials } from 'nice-grpc';
|
|
5
|
-
import { Workflow } from '
|
|
6
|
-
import { Worker } from '
|
|
7
|
-
import Logger from '
|
|
5
|
+
import { Workflow } from '../../workflow';
|
|
6
|
+
import { Worker } from '../worker';
|
|
7
|
+
import Logger from '../../util/logger/logger';
|
|
8
8
|
import { ClientConfig } from './client-config';
|
|
9
9
|
export interface HatchetClientOptions {
|
|
10
10
|
config_path?: string;
|
|
@@ -39,13 +39,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.HatchetClient = void 0;
|
|
41
41
|
const zod_1 = require("zod");
|
|
42
|
-
const config_loader_1 = require("
|
|
43
|
-
const event_client_1 = require("
|
|
44
|
-
const dispatcher_client_1 = require("
|
|
45
|
-
const admin_client_1 = require("
|
|
42
|
+
const config_loader_1 = require("../../util/config-loader");
|
|
43
|
+
const event_client_1 = require("../event/event-client");
|
|
44
|
+
const dispatcher_client_1 = require("../dispatcher/dispatcher-client");
|
|
45
|
+
const admin_client_1 = require("../admin/admin-client");
|
|
46
46
|
const nice_grpc_1 = require("nice-grpc");
|
|
47
|
-
const worker_1 = require("
|
|
48
|
-
const logger_1 = __importDefault(require("
|
|
47
|
+
const worker_1 = require("../worker");
|
|
48
|
+
const logger_1 = __importDefault(require("../../util/logger/logger"));
|
|
49
49
|
const client_config_1 = require("./client-config");
|
|
50
50
|
const addTokenMiddleware = (token) => function _(call, options) {
|
|
51
51
|
return __asyncGenerator(this, arguments, function* _1() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HatchetClient } from '
|
|
2
|
-
import { Action, ActionListener } from '
|
|
3
|
-
import { StepActionEvent, StepActionEventType, GroupKeyActionEvent, GroupKeyActionEventType } from '
|
|
4
|
-
import HatchetPromise from '
|
|
5
|
-
import { Workflow } from '
|
|
6
|
-
import { Logger } from '
|
|
1
|
+
import { HatchetClient } from '../hatchet-client';
|
|
2
|
+
import { Action, ActionListener } from '../dispatcher/action-listener';
|
|
3
|
+
import { StepActionEvent, StepActionEventType, GroupKeyActionEvent, GroupKeyActionEventType } from '../../protoc/dispatcher';
|
|
4
|
+
import HatchetPromise from '../../util/hatchet-promise/hatchet-promise';
|
|
5
|
+
import { Workflow } from '../../workflow';
|
|
6
|
+
import { Logger } from '../../util/logger';
|
|
7
7
|
import { Context } from '../../step';
|
|
8
8
|
export type ActionRegistry = Record<Action['actionId'], Function>;
|
|
9
9
|
export declare class Worker {
|
package/clients/worker/worker.js
CHANGED
|
@@ -20,12 +20,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.Worker = void 0;
|
|
23
|
-
const hatchet_error_1 = __importDefault(require("
|
|
24
|
-
const dispatcher_1 = require("
|
|
25
|
-
const hatchet_promise_1 = __importDefault(require("
|
|
26
|
-
const workflows_1 = require("
|
|
27
|
-
const logger_1 = require("
|
|
28
|
-
const sleep_1 = __importDefault(require("
|
|
23
|
+
const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error"));
|
|
24
|
+
const dispatcher_1 = require("../../protoc/dispatcher");
|
|
25
|
+
const hatchet_promise_1 = __importDefault(require("../../util/hatchet-promise/hatchet-promise"));
|
|
26
|
+
const workflows_1 = require("../../protoc/workflows");
|
|
27
|
+
const logger_1 = require("../../util/logger");
|
|
28
|
+
const sleep_1 = __importDefault(require("../../util/sleep"));
|
|
29
29
|
const step_1 = require("../../step");
|
|
30
30
|
class Worker {
|
|
31
31
|
constructor(client, options) {
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HatchetClient as Hatchet } from '
|
|
1
|
+
import { HatchetClient as Hatchet } from './clients/hatchet-client';
|
|
2
2
|
export default Hatchet;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"url": "https://github.com/hatchet-dev/hatchet.git"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
+
"build": "echo 'build hatchet sdk with `npn run tsc:build` to ensure it is not build during the publish step' && exit 0",
|
|
17
18
|
"prepare": "npm run build",
|
|
18
|
-
"
|
|
19
|
-
"build": "tsc && resolve-tspaths",
|
|
19
|
+
"tsc:build": "tsc && resolve-tspaths",
|
|
20
20
|
"test": "jest",
|
|
21
21
|
"test:watch": "jest --watch",
|
|
22
22
|
"generate": "./generate-protoc.sh",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"worker:dag": "npm run exec -- ./examples/dag-worker.ts",
|
|
33
33
|
"worker:concurrency": "npm run exec -- ./examples/concurrency/concurrency-worker.ts",
|
|
34
34
|
"event:concurrency": "npm run exec -- ./examples/concurrency/concurrency-event.ts",
|
|
35
|
-
"prepublish": "cp package.json dist/package.json",
|
|
36
|
-
"publish:ci": "npm run prepublish && cd dist && npm publish --access public"
|
|
35
|
+
"prepublish": "cp package.json dist/package.json;",
|
|
36
|
+
"publish:ci": "rm -rf ./dist && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [],
|
|
39
39
|
"author": "",
|
package/sdk.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HatchetClient as Hatchet } from '
|
|
1
|
+
import { HatchetClient as Hatchet } from './clients/hatchet-client';
|
|
2
2
|
export default Hatchet;
|
package/sdk.js
CHANGED
package/step.js
CHANGED
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Context = exports.CreateStepSchema = void 0;
|
|
30
|
-
const hatchet_error_1 = __importDefault(require("
|
|
30
|
+
const hatchet_error_1 = __importDefault(require("./util/errors/hatchet-error"));
|
|
31
31
|
const z = __importStar(require("zod"));
|
|
32
32
|
const workflow_1 = require("./workflow");
|
|
33
33
|
exports.CreateStepSchema = z.object({
|
|
@@ -28,7 +28,7 @@ const yaml_1 = require("yaml");
|
|
|
28
28
|
const fs_1 = require("fs");
|
|
29
29
|
const p = __importStar(require("path"));
|
|
30
30
|
const zod_1 = require("zod");
|
|
31
|
-
const hatchet_client_1 = require("
|
|
31
|
+
const hatchet_client_1 = require("../../clients/hatchet-client");
|
|
32
32
|
const nice_grpc_1 = require("nice-grpc");
|
|
33
33
|
const DEFAULT_CONFIG_FILE = '.hatchet.yaml';
|
|
34
34
|
class ConfigLoader {
|