@hatchet-dev/typescript-sdk 0.1.5 → 0.1.7
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 +3 -0
- package/dist/README.md +3 -0
- package/{clients → dist/clients}/admin/admin-client.d.ts +2 -2
- package/{clients → dist/clients}/admin/admin-client.js +2 -2
- package/{clients → dist/clients}/dispatcher/action-listener.d.ts +3 -3
- package/{clients → dist/clients}/dispatcher/action-listener.js +2 -2
- package/{clients → dist/clients}/dispatcher/dispatcher-client.d.ts +5 -5
- package/{clients → dist/clients}/dispatcher/dispatcher-client.js +3 -3
- package/dist/clients/event/event-client.d.ts +11 -0
- package/{clients → dist/clients}/event/event-client.js +3 -3
- package/{clients → dist/clients}/hatchet-client/hatchet-client.d.ts +6 -6
- package/{clients → dist/clients}/hatchet-client/hatchet-client.js +6 -6
- package/{clients → dist/clients}/worker/worker.d.ts +6 -6
- package/{clients → dist/clients}/worker/worker.js +6 -6
- package/dist/index.d.ts +2 -0
- package/{index.js → dist/index.js} +1 -1
- package/dist/package.json +73 -0
- package/dist/sdk.d.ts +2 -0
- package/{sdk.js → dist/sdk.js} +1 -1
- package/{step.js → dist/step.js} +1 -1
- package/dist/tsconfig.json +119 -0
- package/{util → dist/util}/config-loader/config-loader.d.ts +1 -1
- package/{util → dist/util}/config-loader/config-loader.js +1 -1
- package/package.json +21 -25
- package/clients/event/event-client.d.ts +0 -11
- package/index.d.ts +0 -2
- package/sdk.d.ts +0 -2
- /package/{clients → dist/clients}/hatchet-client/client-config.d.ts +0 -0
- /package/{clients → dist/clients}/hatchet-client/client-config.js +0 -0
- /package/{clients → dist/clients}/hatchet-client/index.d.ts +0 -0
- /package/{clients → dist/clients}/hatchet-client/index.js +0 -0
- /package/{clients → dist/clients}/worker/index.d.ts +0 -0
- /package/{clients → dist/clients}/worker/index.js +0 -0
- /package/{protoc → dist/protoc}/dispatcher/dispatcher.d.ts +0 -0
- /package/{protoc → dist/protoc}/dispatcher/dispatcher.js +0 -0
- /package/{protoc → dist/protoc}/dispatcher/index.d.ts +0 -0
- /package/{protoc → dist/protoc}/dispatcher/index.js +0 -0
- /package/{protoc → dist/protoc}/events/events.d.ts +0 -0
- /package/{protoc → dist/protoc}/events/events.js +0 -0
- /package/{protoc → dist/protoc}/events/index.d.ts +0 -0
- /package/{protoc → dist/protoc}/events/index.js +0 -0
- /package/{protoc → dist/protoc}/google/protobuf/timestamp.d.ts +0 -0
- /package/{protoc → dist/protoc}/google/protobuf/timestamp.js +0 -0
- /package/{protoc → dist/protoc}/google/protobuf/wrappers.d.ts +0 -0
- /package/{protoc → dist/protoc}/google/protobuf/wrappers.js +0 -0
- /package/{protoc → dist/protoc}/workflows/index.d.ts +0 -0
- /package/{protoc → dist/protoc}/workflows/index.js +0 -0
- /package/{protoc → dist/protoc}/workflows/workflows.d.ts +0 -0
- /package/{protoc → dist/protoc}/workflows/workflows.js +0 -0
- /package/{step.d.ts → dist/step.d.ts} +0 -0
- /package/{util → dist/util}/config-loader/index.d.ts +0 -0
- /package/{util → dist/util}/config-loader/index.js +0 -0
- /package/{util → dist/util}/errors/hatchet-error.d.ts +0 -0
- /package/{util → dist/util}/errors/hatchet-error.js +0 -0
- /package/{util → dist/util}/hatchet-promise/hatchet-promise.d.ts +0 -0
- /package/{util → dist/util}/hatchet-promise/hatchet-promise.js +0 -0
- /package/{util → dist/util}/logger/index.d.ts +0 -0
- /package/{util → dist/util}/logger/index.js +0 -0
- /package/{util → dist/util}/logger/logger.d.ts +0 -0
- /package/{util → dist/util}/logger/logger.js +0 -0
- /package/{util → dist/util}/sleep.d.ts +0 -0
- /package/{util → dist/util}/sleep.js +0 -0
- /package/{workflow.d.ts → dist/workflow.d.ts} +0 -0
- /package/{workflow.js → dist/workflow.js} +0 -0
package/README.md
ADDED
package/dist/README.md
ADDED
|
@@ -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) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Channel, ClientFactory } from 'nice-grpc';
|
|
2
|
+
import { EventsServiceClient } from '../../protoc/events/events';
|
|
3
|
+
import { ClientConfig } from '../hatchet-client/client-config';
|
|
4
|
+
import { Logger } from '../../util/logger';
|
|
5
|
+
export declare class EventClient {
|
|
6
|
+
config: ClientConfig;
|
|
7
|
+
client: EventsServiceClient;
|
|
8
|
+
logger: Logger;
|
|
9
|
+
constructor(config: ClientConfig, channel: Channel, factory: ClientFactory);
|
|
10
|
+
push<T>(type: string, input: T): Promise<import("../../protoc/events/events").Event>;
|
|
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 {
|
|
@@ -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/dist/index.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Background task orchestration & visibility for developers",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"*",
|
|
9
|
+
"!**/*.test.js",
|
|
10
|
+
"!**/*.test.d.ts"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/hatchet-dev/hatchet.git"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepare": "npm run build",
|
|
18
|
+
"build": "tsc && resolve-tspaths",
|
|
19
|
+
"test": "jest",
|
|
20
|
+
"test:watch": "jest --watch",
|
|
21
|
+
"generate": "./generate-protoc.sh",
|
|
22
|
+
"lint:check": "npm run eslint:check && npm run prettier:check",
|
|
23
|
+
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
|
|
24
|
+
"eslint:check": "eslint \"{hatchet,tests}/**/*.{ts,tsx,js}\"",
|
|
25
|
+
"eslint:fix": "eslint \"{hatchet,tests}/**/*.{ts,tsx,js}\" --fix",
|
|
26
|
+
"prettier:check": "prettier \"hatchet/**/*.{ts,tsx}\" --list-different",
|
|
27
|
+
"prettier:fix": "prettier \"hatchet/**/*.{ts,tsx}\" --write",
|
|
28
|
+
"exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json",
|
|
29
|
+
"example:event": "npm run exec -- ./examples/example-event.ts",
|
|
30
|
+
"worker:simple": "npm run exec -- ./examples/simple-worker.ts",
|
|
31
|
+
"worker:dag": "npm run exec -- ./examples/dag-worker.ts",
|
|
32
|
+
"worker:concurrency": "npm run exec -- ./examples/concurrency/concurrency-worker.ts",
|
|
33
|
+
"event:concurrency": "npm run exec -- ./examples/concurrency/concurrency-event.ts",
|
|
34
|
+
"prepublish": "cp package.json dist/package.json; cp tsconfig.json dist/tsconfig.json; cp README.md dist/README.md;",
|
|
35
|
+
"publish:ci": "npm run prepublish && cd dist && npm publish --access public"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [],
|
|
38
|
+
"author": "",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/jest": "^29.5.11",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
|
43
|
+
"autoprefixer": "^10.4.16",
|
|
44
|
+
"dotenv-cli": "^7.3.0",
|
|
45
|
+
"eslint": "^8.56.0",
|
|
46
|
+
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
47
|
+
"eslint-config-prettier": "^9.1.0",
|
|
48
|
+
"eslint-config-standard-with-typescript": "^43.0.0",
|
|
49
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
50
|
+
"eslint-plugin-import": "^2.29.1",
|
|
51
|
+
"eslint-plugin-jest": "^27.6.3",
|
|
52
|
+
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
|
|
53
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
54
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
55
|
+
"eslint-plugin-unused-imports": "^3.0.0",
|
|
56
|
+
"grpc-tools": "^1.12.4",
|
|
57
|
+
"jest": "^29.7.0",
|
|
58
|
+
"prettier": "^3.1.1",
|
|
59
|
+
"resolve-tspaths": "^0.8.17",
|
|
60
|
+
"ts-jest": "^29.1.1",
|
|
61
|
+
"ts-node": "^10.9.2",
|
|
62
|
+
"ts-proto": "^1.167.0",
|
|
63
|
+
"typescript": "^5.3.3"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"long": "^5.2.3",
|
|
67
|
+
"nice-grpc": "^2.1.7",
|
|
68
|
+
"nice-grpc-common": "^2.0.2",
|
|
69
|
+
"protobufjs": "^7.2.6",
|
|
70
|
+
"yaml": "^2.3.4",
|
|
71
|
+
"zod": "^3.22.4"
|
|
72
|
+
}
|
|
73
|
+
}
|
package/dist/sdk.d.ts
ADDED
package/{sdk.js → dist/sdk.js}
RENAMED
package/{step.js → dist/step.js}
RENAMED
|
@@ -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({
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["src/**/*.ts"],
|
|
3
|
+
"exclude": ["./dist"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
6
|
+
|
|
7
|
+
/* Projects */
|
|
8
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
9
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
10
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
11
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
12
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
13
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
14
|
+
|
|
15
|
+
/* Language and Environment */
|
|
16
|
+
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
17
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
18
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
19
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
20
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
21
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
22
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
23
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
24
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
25
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
26
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
27
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
28
|
+
|
|
29
|
+
/* Modules */
|
|
30
|
+
"module": "commonjs" /* Specify what module code is generated. */,
|
|
31
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
32
|
+
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
33
|
+
"baseUrl": "." /* Specify the base directory to resolve non-relative module names. */,
|
|
34
|
+
"paths": {
|
|
35
|
+
// NOTE: also set in jest.config.ts
|
|
36
|
+
"@hatchet/*": ["./src/*"],
|
|
37
|
+
"@util/*": ["./src/util/*"],
|
|
38
|
+
"@models/*": ["./src/models/*"],
|
|
39
|
+
"@clients/*": ["./src/clients/*"],
|
|
40
|
+
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
|
|
41
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
42
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
43
|
+
"types": [
|
|
44
|
+
"jest",
|
|
45
|
+
] /* Specify type package names to be included without being referenced in a source file. */,
|
|
46
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
47
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
48
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
49
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
50
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
51
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
52
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
53
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
54
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
55
|
+
|
|
56
|
+
/* JavaScript Support */
|
|
57
|
+
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
|
|
58
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
59
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
60
|
+
|
|
61
|
+
/* Emit */
|
|
62
|
+
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
63
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
64
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
65
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
66
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
67
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
68
|
+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
69
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
70
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
71
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
72
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
73
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
74
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
75
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
76
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
77
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
78
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
79
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
80
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
81
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
82
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
83
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
84
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
85
|
+
|
|
86
|
+
/* Interop Constraints */
|
|
87
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
88
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
89
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
90
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
91
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
92
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
93
|
+
|
|
94
|
+
/* Type Checking */
|
|
95
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
96
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
97
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
98
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
99
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
100
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
101
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
102
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
103
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
104
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
105
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
106
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
107
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
108
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
109
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
110
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
111
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
112
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
113
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
114
|
+
|
|
115
|
+
/* Completeness */
|
|
116
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
117
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
|
118
|
+
},
|
|
119
|
+
}
|
|
@@ -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 {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"
|
|
8
|
+
"dist",
|
|
9
9
|
"!**/*.test.js",
|
|
10
10
|
"!**/*.test.d.ts"
|
|
11
11
|
],
|
|
@@ -13,28 +13,6 @@
|
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/hatchet-dev/hatchet.git"
|
|
15
15
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"prepare": "npm run build",
|
|
18
|
-
"fix-paths": "",
|
|
19
|
-
"build": "tsc && resolve-tspaths",
|
|
20
|
-
"test": "jest",
|
|
21
|
-
"test:watch": "jest --watch",
|
|
22
|
-
"generate": "./generate-protoc.sh",
|
|
23
|
-
"lint:check": "npm run eslint:check && npm run prettier:check",
|
|
24
|
-
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
|
|
25
|
-
"eslint:check": "eslint \"{hatchet,tests}/**/*.{ts,tsx,js}\"",
|
|
26
|
-
"eslint:fix": "eslint \"{hatchet,tests}/**/*.{ts,tsx,js}\" --fix",
|
|
27
|
-
"prettier:check": "prettier \"hatchet/**/*.{ts,tsx}\" --list-different",
|
|
28
|
-
"prettier:fix": "prettier \"hatchet/**/*.{ts,tsx}\" --write",
|
|
29
|
-
"exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json",
|
|
30
|
-
"example:event": "npm run exec -- ./examples/example-event.ts",
|
|
31
|
-
"worker:simple": "npm run exec -- ./examples/simple-worker.ts",
|
|
32
|
-
"worker:dag": "npm run exec -- ./examples/dag-worker.ts",
|
|
33
|
-
"worker:concurrency": "npm run exec -- ./examples/concurrency/concurrency-worker.ts",
|
|
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"
|
|
37
|
-
},
|
|
38
16
|
"keywords": [],
|
|
39
17
|
"author": "",
|
|
40
18
|
"license": "MIT",
|
|
@@ -70,5 +48,23 @@
|
|
|
70
48
|
"protobufjs": "^7.2.6",
|
|
71
49
|
"yaml": "^2.3.4",
|
|
72
50
|
"zod": "^3.22.4"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc && resolve-tspaths",
|
|
54
|
+
"test": "jest",
|
|
55
|
+
"test:watch": "jest --watch",
|
|
56
|
+
"generate": "./generate-protoc.sh",
|
|
57
|
+
"lint:check": "npm run eslint:check && npm run prettier:check",
|
|
58
|
+
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
|
|
59
|
+
"eslint:check": "eslint \"{hatchet,tests}/**/*.{ts,tsx,js}\"",
|
|
60
|
+
"eslint:fix": "eslint \"{hatchet,tests}/**/*.{ts,tsx,js}\" --fix",
|
|
61
|
+
"prettier:check": "prettier \"hatchet/**/*.{ts,tsx}\" --list-different",
|
|
62
|
+
"prettier:fix": "prettier \"hatchet/**/*.{ts,tsx}\" --write",
|
|
63
|
+
"exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json",
|
|
64
|
+
"example:event": "npm run exec -- ./examples/example-event.ts",
|
|
65
|
+
"worker:simple": "npm run exec -- ./examples/simple-worker.ts",
|
|
66
|
+
"worker:dag": "npm run exec -- ./examples/dag-worker.ts",
|
|
67
|
+
"worker:concurrency": "npm run exec -- ./examples/concurrency/concurrency-worker.ts",
|
|
68
|
+
"event:concurrency": "npm run exec -- ./examples/concurrency/concurrency-event.ts"
|
|
73
69
|
}
|
|
74
|
-
}
|
|
70
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Channel, ClientFactory } from 'nice-grpc';
|
|
2
|
-
import { EventsServiceClient } from '../../../../src/protoc/events/events';
|
|
3
|
-
import { ClientConfig } from '../../../../src/clients/hatchet-client/client-config';
|
|
4
|
-
import { Logger } from '../../../../src/util/logger';
|
|
5
|
-
export declare class EventClient {
|
|
6
|
-
config: ClientConfig;
|
|
7
|
-
client: EventsServiceClient;
|
|
8
|
-
logger: Logger;
|
|
9
|
-
constructor(config: ClientConfig, channel: Channel, factory: ClientFactory);
|
|
10
|
-
push<T>(type: string, input: T): Promise<import("../../../../src/protoc/events/events").Event>;
|
|
11
|
-
}
|
package/index.d.ts
DELETED
package/sdk.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|