@hatchet-dev/typescript-sdk 1.33.1 → 1.34.0-alpha.0

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 (64) hide show
  1. package/clients/admin/admin-client.d.ts +6 -1
  2. package/clients/admin/admin-client.js +13 -4
  3. package/clients/admin/rpc.d.ts +13 -0
  4. package/clients/admin/rpc.js +23 -0
  5. package/clients/event/event-client.d.ts +2 -1
  6. package/clients/event/event-client.js +6 -3
  7. package/clients/event/rpc.d.ts +7 -0
  8. package/clients/event/rpc.js +13 -0
  9. package/clients/rest/generated/data-contracts.d.ts +2 -0
  10. package/clients/transport/grpc-target.d.ts +19 -0
  11. package/clients/transport/grpc-target.js +85 -0
  12. package/clients/transport/index.d.ts +4 -0
  13. package/clients/transport/index.js +15 -0
  14. package/clients/transport/message-bridge.d.ts +32 -0
  15. package/clients/transport/message-bridge.js +20 -0
  16. package/clients/transport/node-transport.d.ts +50 -0
  17. package/clients/transport/node-transport.js +123 -0
  18. package/clients/transport/transport.d.ts +14 -0
  19. package/clients/transport/transport.js +24 -0
  20. package/clients/transport/ts-proto-client.d.ts +41 -0
  21. package/clients/transport/ts-proto-client.js +143 -0
  22. package/core/index.d.ts +9 -0
  23. package/core/index.js +12 -0
  24. package/dist/check-exports.mjs +171 -0
  25. package/legacy/legacy-client.d.ts +4 -0
  26. package/legacy/legacy-client.js +5 -3
  27. package/legacy/legacy-transformer.d.ts +2 -1
  28. package/legacy/legacy-transformer.js +11 -0
  29. package/legacy/workflow.d.ts +1 -1
  30. package/legacy/workflow.js +1 -1
  31. package/package.json +95 -2
  32. package/protoc/dispatcher/dispatcher.d.ts +2 -0
  33. package/protoc/dispatcher/dispatcher.js +21 -1
  34. package/protoc-es/dispatcher/dispatcher_pb.d.ts +1357 -0
  35. package/protoc-es/dispatcher/dispatcher_pb.js +371 -0
  36. package/protoc-es/events/events_pb.d.ts +294 -0
  37. package/protoc-es/events/events_pb.js +61 -0
  38. package/protoc-es/google/rpc/status_pb.d.ts +48 -0
  39. package/protoc-es/google/rpc/status_pb.js +27 -0
  40. package/protoc-es/v1/dispatcher_pb.d.ts +676 -0
  41. package/protoc-es/v1/dispatcher_pb.js +155 -0
  42. package/protoc-es/v1/shared/condition_pb.d.ts +166 -0
  43. package/protoc-es/v1/shared/condition_pb.js +68 -0
  44. package/protoc-es/v1/shared/trigger_pb.d.ts +160 -0
  45. package/protoc-es/v1/shared/trigger_pb.js +55 -0
  46. package/protoc-es/v1/workflows_pb.d.ts +995 -0
  47. package/protoc-es/v1/workflows_pb.js +280 -0
  48. package/protoc-es/workflows/workflows_pb.d.ts +715 -0
  49. package/protoc-es/workflows/workflows_pb.js +216 -0
  50. package/scripts/check-exports.mjs +171 -0
  51. package/step.js +0 -2
  52. package/util/grpc-error.d.ts +3 -1
  53. package/util/grpc-error.js +13 -4
  54. package/util/v0-deprecation-warning.d.ts +6 -13
  55. package/util/v0-deprecation-warning.js +6 -13
  56. package/v1/client/admin.d.ts +2 -1
  57. package/v1/client/admin.js +34 -114
  58. package/v1/client/client.d.ts +1 -0
  59. package/v1/client/client.js +8 -5
  60. package/v1/client/features/schedules.d.ts +1 -1
  61. package/v1/examples/concurrency-rr/workflow.js +4 -4
  62. package/version.d.ts +1 -1
  63. package/version.js +1 -1
  64. package/workflow.js +0 -2
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ // @generated by protoc-gen-es v2.15.0 with parameter "target=ts"
3
+ // @generated from file workflows/workflows.proto (syntax proto3)
4
+ /* eslint-disable */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WorkflowService = exports.RateLimitDurationSchema = exports.RateLimitDuration = exports.ConcurrencyLimitStrategySchema = exports.ConcurrencyLimitStrategy = exports.WorkflowKindSchema = exports.WorkflowKind = exports.StickyStrategySchema = exports.StickyStrategy = exports.PutRateLimitResponseSchema = exports.PutRateLimitRequestSchema = exports.TriggerWorkflowResponseSchema = exports.BulkTriggerWorkflowResponseSchema = exports.BulkTriggerWorkflowRequestSchema = exports.WorkflowTriggerCronRefSchema = exports.WorkflowTriggerEventRefSchema = exports.WorkflowVersionSchema = exports.ScheduledWorkflowSchema = exports.ScheduleWorkflowRequestSchema = exports.ListWorkflowsRequestSchema = exports.CreateStepRateLimitSchema = exports.CreateWorkflowStepOptsSchema = exports.CreateWorkflowJobOptsSchema = exports.WorkflowConcurrencyOptsSchema = exports.CreateWorkflowVersionOptsSchema = exports.PutWorkflowRequestSchema = exports.file_workflows_workflows = void 0;
7
+ const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
8
+ const wkt_1 = require("@bufbuild/protobuf/wkt");
9
+ const trigger_pb_1 = require("../v1/shared/trigger_pb");
10
+ /**
11
+ * Describes the file workflows/workflows.proto.
12
+ */
13
+ exports.file_workflows_workflows = (0, codegenv2_1.fileDesc)("Chl3b3JrZmxvd3Mvd29ya2Zsb3dzLnByb3RvIj4KElB1dFdvcmtmbG93UmVxdWVzdBIoCgRvcHRzGAEgASgLMhouQ3JlYXRlV29ya2Zsb3dWZXJzaW9uT3B0cyK/BAoZQ3JlYXRlV29ya2Zsb3dWZXJzaW9uT3B0cxIMCgRuYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEg8KB3ZlcnNpb24YAyABKAkSFgoOZXZlbnRfdHJpZ2dlcnMYBCADKAkSFQoNY3Jvbl90cmlnZ2VycxgFIAMoCRI2ChJzY2hlZHVsZWRfdHJpZ2dlcnMYBiADKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiQKBGpvYnMYByADKAsyFi5DcmVhdGVXb3JrZmxvd0pvYk9wdHMSLQoLY29uY3VycmVuY3kYCCABKAsyGC5Xb3JrZmxvd0NvbmN1cnJlbmN5T3B0cxIdChBzY2hlZHVsZV90aW1lb3V0GAkgASgJSACIAQESFwoKY3Jvbl9pbnB1dBgKIAEoCUgBiAEBEjMKDm9uX2ZhaWx1cmVfam9iGAsgASgLMhYuQ3JlYXRlV29ya2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2luZBIMCghGVU5DVElPThAAEgsKB0RVUkFCTEUQARIHCgNEQUcQAip/ChhDb25jdXJyZW5jeUxpbWl0U3RyYXRlZ3kSFgoSQ0FOQ0VMX0lOX1BST0dSRVNTEAASDwoLRFJPUF9ORVdFU1QQARIQCgxRVUVVRV9ORVdFU1QQAhIVChFHUk9VUF9ST1VORF9ST0JJThADEhEKDUNBTkNFTF9ORVdFU1QQBCpdChFSYXRlTGltaXREdXJhdGlvbhIKCgZTRUNPTkQQABIKCgZNSU5VVEUQARIICgRIT1VSEAISBwoDREFZEAMSCAoEV0VFSxAEEgkKBU1PTlRIEAUSCAoEWUVBUhAGMt8CCg9Xb3JrZmxvd1NlcnZpY2USNAoLUHV0V29ya2Zsb3cSEy5QdXRXb3JrZmxvd1JlcXVlc3QaEC5Xb3JrZmxvd1ZlcnNpb24SPgoQU2NoZWR1bGVXb3JrZmxvdxIYLlNjaGVkdWxlV29ya2Zsb3dSZXF1ZXN0GhAuV29ya2Zsb3dWZXJzaW9uEkcKD1RyaWdnZXJXb3JrZmxvdxIaLnYxLlRyaWdnZXJXb3JrZmxvd1JlcXVlc3QaGC5UcmlnZ2VyV29ya2Zsb3dSZXNwb25zZRJQChNCdWxrVHJpZ2dlcldvcmtmbG93EhsuQnVsa1RyaWdnZXJXb3JrZmxvd1JlcXVlc3QaHC5CdWxrVHJpZ2dlcldvcmtmbG93UmVzcG9uc2USOwoMUHV0UmF0ZUxpbWl0EhQuUHV0UmF0ZUxpbWl0UmVxdWVzdBoVLlB1dFJhdGVMaW1pdFJlc3BvbnNlQkJaQGdpdGh1Yi5jb20vaGF0Y2hldC1kZXYvaGF0Y2hldC9pbnRlcm5hbC9zZXJ2aWNlcy9hZG1pbi9jb250cmFjdHNiBnByb3RvMw", [wkt_1.file_google_protobuf_timestamp, trigger_pb_1.file_v1_shared_trigger]);
14
+ /**
15
+ * Describes the message PutWorkflowRequest.
16
+ * Use `create(PutWorkflowRequestSchema)` to create a new message.
17
+ */
18
+ exports.PutWorkflowRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 0);
19
+ /**
20
+ * Describes the message CreateWorkflowVersionOpts.
21
+ * Use `create(CreateWorkflowVersionOptsSchema)` to create a new message.
22
+ */
23
+ exports.CreateWorkflowVersionOptsSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 1);
24
+ /**
25
+ * Describes the message WorkflowConcurrencyOpts.
26
+ * Use `create(WorkflowConcurrencyOptsSchema)` to create a new message.
27
+ */
28
+ exports.WorkflowConcurrencyOptsSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 2);
29
+ /**
30
+ * Describes the message CreateWorkflowJobOpts.
31
+ * Use `create(CreateWorkflowJobOptsSchema)` to create a new message.
32
+ */
33
+ exports.CreateWorkflowJobOptsSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 3);
34
+ /**
35
+ * Describes the message CreateWorkflowStepOpts.
36
+ * Use `create(CreateWorkflowStepOptsSchema)` to create a new message.
37
+ */
38
+ exports.CreateWorkflowStepOptsSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 4);
39
+ /**
40
+ * Describes the message CreateStepRateLimit.
41
+ * Use `create(CreateStepRateLimitSchema)` to create a new message.
42
+ */
43
+ exports.CreateStepRateLimitSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 5);
44
+ /**
45
+ * Describes the message ListWorkflowsRequest.
46
+ * Use `create(ListWorkflowsRequestSchema)` to create a new message.
47
+ */
48
+ exports.ListWorkflowsRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 6);
49
+ /**
50
+ * Describes the message ScheduleWorkflowRequest.
51
+ * Use `create(ScheduleWorkflowRequestSchema)` to create a new message.
52
+ */
53
+ exports.ScheduleWorkflowRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 7);
54
+ /**
55
+ * Describes the message ScheduledWorkflow.
56
+ * Use `create(ScheduledWorkflowSchema)` to create a new message.
57
+ */
58
+ exports.ScheduledWorkflowSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 8);
59
+ /**
60
+ * Describes the message WorkflowVersion.
61
+ * Use `create(WorkflowVersionSchema)` to create a new message.
62
+ */
63
+ exports.WorkflowVersionSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 9);
64
+ /**
65
+ * Describes the message WorkflowTriggerEventRef.
66
+ * Use `create(WorkflowTriggerEventRefSchema)` to create a new message.
67
+ */
68
+ exports.WorkflowTriggerEventRefSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 10);
69
+ /**
70
+ * Describes the message WorkflowTriggerCronRef.
71
+ * Use `create(WorkflowTriggerCronRefSchema)` to create a new message.
72
+ */
73
+ exports.WorkflowTriggerCronRefSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 11);
74
+ /**
75
+ * Describes the message BulkTriggerWorkflowRequest.
76
+ * Use `create(BulkTriggerWorkflowRequestSchema)` to create a new message.
77
+ */
78
+ exports.BulkTriggerWorkflowRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 12);
79
+ /**
80
+ * Describes the message BulkTriggerWorkflowResponse.
81
+ * Use `create(BulkTriggerWorkflowResponseSchema)` to create a new message.
82
+ */
83
+ exports.BulkTriggerWorkflowResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 13);
84
+ /**
85
+ * Describes the message TriggerWorkflowResponse.
86
+ * Use `create(TriggerWorkflowResponseSchema)` to create a new message.
87
+ */
88
+ exports.TriggerWorkflowResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 14);
89
+ /**
90
+ * Describes the message PutRateLimitRequest.
91
+ * Use `create(PutRateLimitRequestSchema)` to create a new message.
92
+ */
93
+ exports.PutRateLimitRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 15);
94
+ /**
95
+ * Describes the message PutRateLimitResponse.
96
+ * Use `create(PutRateLimitResponseSchema)` to create a new message.
97
+ */
98
+ exports.PutRateLimitResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_workflows_workflows, 16);
99
+ /**
100
+ * @generated from enum StickyStrategy
101
+ */
102
+ var StickyStrategy;
103
+ (function (StickyStrategy) {
104
+ /**
105
+ * @generated from enum value: SOFT = 0;
106
+ */
107
+ StickyStrategy[StickyStrategy["SOFT"] = 0] = "SOFT";
108
+ /**
109
+ * @generated from enum value: HARD = 1;
110
+ */
111
+ StickyStrategy[StickyStrategy["HARD"] = 1] = "HARD";
112
+ })(StickyStrategy || (exports.StickyStrategy = StickyStrategy = {}));
113
+ /**
114
+ * Describes the enum StickyStrategy.
115
+ */
116
+ exports.StickyStrategySchema = (0, codegenv2_1.enumDesc)(exports.file_workflows_workflows, 0);
117
+ /**
118
+ * @generated from enum WorkflowKind
119
+ */
120
+ var WorkflowKind;
121
+ (function (WorkflowKind) {
122
+ /**
123
+ * @generated from enum value: FUNCTION = 0;
124
+ */
125
+ WorkflowKind[WorkflowKind["FUNCTION"] = 0] = "FUNCTION";
126
+ /**
127
+ * @generated from enum value: DURABLE = 1;
128
+ */
129
+ WorkflowKind[WorkflowKind["DURABLE"] = 1] = "DURABLE";
130
+ /**
131
+ * @generated from enum value: DAG = 2;
132
+ */
133
+ WorkflowKind[WorkflowKind["DAG"] = 2] = "DAG";
134
+ })(WorkflowKind || (exports.WorkflowKind = WorkflowKind = {}));
135
+ /**
136
+ * Describes the enum WorkflowKind.
137
+ */
138
+ exports.WorkflowKindSchema = (0, codegenv2_1.enumDesc)(exports.file_workflows_workflows, 1);
139
+ /**
140
+ * @generated from enum ConcurrencyLimitStrategy
141
+ */
142
+ var ConcurrencyLimitStrategy;
143
+ (function (ConcurrencyLimitStrategy) {
144
+ /**
145
+ * @generated from enum value: CANCEL_IN_PROGRESS = 0;
146
+ */
147
+ ConcurrencyLimitStrategy[ConcurrencyLimitStrategy["CANCEL_IN_PROGRESS"] = 0] = "CANCEL_IN_PROGRESS";
148
+ /**
149
+ * deprecated
150
+ *
151
+ * @generated from enum value: DROP_NEWEST = 1;
152
+ */
153
+ ConcurrencyLimitStrategy[ConcurrencyLimitStrategy["DROP_NEWEST"] = 1] = "DROP_NEWEST";
154
+ /**
155
+ * deprecated
156
+ *
157
+ * @generated from enum value: QUEUE_NEWEST = 2;
158
+ */
159
+ ConcurrencyLimitStrategy[ConcurrencyLimitStrategy["QUEUE_NEWEST"] = 2] = "QUEUE_NEWEST";
160
+ /**
161
+ * @generated from enum value: GROUP_ROUND_ROBIN = 3;
162
+ */
163
+ ConcurrencyLimitStrategy[ConcurrencyLimitStrategy["GROUP_ROUND_ROBIN"] = 3] = "GROUP_ROUND_ROBIN";
164
+ /**
165
+ * @generated from enum value: CANCEL_NEWEST = 4;
166
+ */
167
+ ConcurrencyLimitStrategy[ConcurrencyLimitStrategy["CANCEL_NEWEST"] = 4] = "CANCEL_NEWEST";
168
+ })(ConcurrencyLimitStrategy || (exports.ConcurrencyLimitStrategy = ConcurrencyLimitStrategy = {}));
169
+ /**
170
+ * Describes the enum ConcurrencyLimitStrategy.
171
+ */
172
+ exports.ConcurrencyLimitStrategySchema = (0, codegenv2_1.enumDesc)(exports.file_workflows_workflows, 2);
173
+ /**
174
+ * @generated from enum RateLimitDuration
175
+ */
176
+ var RateLimitDuration;
177
+ (function (RateLimitDuration) {
178
+ /**
179
+ * @generated from enum value: SECOND = 0;
180
+ */
181
+ RateLimitDuration[RateLimitDuration["SECOND"] = 0] = "SECOND";
182
+ /**
183
+ * @generated from enum value: MINUTE = 1;
184
+ */
185
+ RateLimitDuration[RateLimitDuration["MINUTE"] = 1] = "MINUTE";
186
+ /**
187
+ * @generated from enum value: HOUR = 2;
188
+ */
189
+ RateLimitDuration[RateLimitDuration["HOUR"] = 2] = "HOUR";
190
+ /**
191
+ * @generated from enum value: DAY = 3;
192
+ */
193
+ RateLimitDuration[RateLimitDuration["DAY"] = 3] = "DAY";
194
+ /**
195
+ * @generated from enum value: WEEK = 4;
196
+ */
197
+ RateLimitDuration[RateLimitDuration["WEEK"] = 4] = "WEEK";
198
+ /**
199
+ * @generated from enum value: MONTH = 5;
200
+ */
201
+ RateLimitDuration[RateLimitDuration["MONTH"] = 5] = "MONTH";
202
+ /**
203
+ * @generated from enum value: YEAR = 6;
204
+ */
205
+ RateLimitDuration[RateLimitDuration["YEAR"] = 6] = "YEAR";
206
+ })(RateLimitDuration || (exports.RateLimitDuration = RateLimitDuration = {}));
207
+ /**
208
+ * Describes the enum RateLimitDuration.
209
+ */
210
+ exports.RateLimitDurationSchema = (0, codegenv2_1.enumDesc)(exports.file_workflows_workflows, 3);
211
+ /**
212
+ * WorkflowService represents a set of RPCs for managing workflows.
213
+ *
214
+ * @generated from service WorkflowService
215
+ */
216
+ exports.WorkflowService = (0, codegenv2_1.serviceDesc)(exports.file_workflows_workflows, 0);
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+ // Verifies the package's `exports` map against the built `dist/`: every documented import
4
+ // path resolves from both a native ESM module and a CommonJS module, every directory that
5
+ // ships an `index.js` has an explicit entry (a wildcard cannot map a bare directory to its
6
+ // index), every entry's target exists, and a TypeScript consumer compiles against the
7
+ // declarations, including an explicit `.d.ts` import path.
8
+ //
9
+ // The published package root is `dist/` (`publish:ci` copies package.json there and publishes
10
+ // from it), so the map is checked from a scratch package whose node_modules links to `dist/`.
11
+ // Run after `pnpm run tsc:build` (the `check:exports` script does both).
12
+ import { spawnSync } from 'node:child_process';
13
+ import { createRequire } from 'node:module';
14
+ import {
15
+ cpSync,
16
+ existsSync,
17
+ mkdirSync,
18
+ mkdtempSync,
19
+ readFileSync,
20
+ readdirSync,
21
+ rmSync,
22
+ symlinkSync,
23
+ writeFileSync,
24
+ } from 'node:fs';
25
+ import { tmpdir } from 'node:os';
26
+ import { dirname, join, resolve } from 'node:path';
27
+ import { fileURLToPath, pathToFileURL } from 'node:url';
28
+
29
+ const PACKAGE = '@hatchet-dev/typescript-sdk';
30
+
31
+ // Import paths users and the serverless package rely on, with and without the `.js` suffix.
32
+ const DOCUMENTED_SUBPATHS = [
33
+ '.',
34
+ './v1',
35
+ './edge',
36
+ './edge/index.js',
37
+ './core',
38
+ './clients/hatchet-client',
39
+ './v1/client/client.js',
40
+ './protoc/dispatcher/dispatcher',
41
+ ];
42
+
43
+ // Type-only imports a consumer's TypeScript may use: the explicit declaration-file path a
44
+ // `types` condition cannot produce on its own (`./*` would append `.d.ts` twice), next to the
45
+ // bare, `.js`-suffixed and directory-entry forms.
46
+ const TYPE_CONSUMER = [
47
+ "import type { ClientConfig } from '@hatchet-dev/typescript-sdk/clients/hatchet-client/client-config.d.ts';",
48
+ "import type { HatchetClient } from '@hatchet-dev/typescript-sdk/v1';",
49
+ "import type { AdminClient } from '@hatchet-dev/typescript-sdk/v1/client/admin';",
50
+ "import type { EventClient } from '@hatchet-dev/typescript-sdk/clients/event/event-client.js';",
51
+ 'export type Consumer = [ClientConfig, HatchetClient, AdminClient, EventClient];',
52
+ '',
53
+ ].join('\n');
54
+ const TYPE_RESOLUTIONS = ['node16', 'bundler'];
55
+
56
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
57
+ const dist = join(root, 'dist');
58
+ const tsc = join(root, 'node_modules', 'typescript', 'bin', 'tsc');
59
+
60
+ if (!existsSync(join(dist, 'index.js'))) {
61
+ console.error(`dist is not built: ${dist}/index.js is missing. Run \`pnpm run tsc:build\` first.`);
62
+ process.exit(1);
63
+ }
64
+
65
+ const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
66
+ const exportsMap = pkg.exports ?? {};
67
+ const explicitSubpaths = Object.keys(exportsMap).filter((k) => !k.includes('*'));
68
+ const failures = [];
69
+
70
+ function indexDirectories(dir, prefix = '.') {
71
+ const out = [];
72
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
73
+ if (!entry.isDirectory()) continue;
74
+ const sub = `${prefix}/${entry.name}`;
75
+ if (existsSync(join(dir, entry.name, 'index.js'))) out.push(sub);
76
+ out.push(...indexDirectories(join(dir, entry.name), sub));
77
+ }
78
+ return out;
79
+ }
80
+
81
+ for (const sub of indexDirectories(dist)) {
82
+ if (!(sub in exportsMap)) {
83
+ failures.push(`${sub} ships an index.js but has no explicit "exports" entry`);
84
+ }
85
+ }
86
+
87
+ for (const sub of explicitSubpaths) {
88
+ const target = exportsMap[sub];
89
+ const files = typeof target === 'string' ? [target] : Object.values(target);
90
+ for (const file of files) {
91
+ if (file !== './package.json' && !existsSync(join(dist, file))) {
92
+ failures.push(`"${sub}" target ${file} does not exist in dist`);
93
+ }
94
+ }
95
+ }
96
+
97
+ const scratch = mkdtempSync(join(tmpdir(), 'hatchet-check-exports-'));
98
+ try {
99
+ // The published layout: package.json next to the build output, reached through node_modules.
100
+ cpSync(join(root, 'package.json'), join(dist, 'package.json'));
101
+ mkdirSync(join(scratch, 'node_modules', '@hatchet-dev'), { recursive: true });
102
+ symlinkSync(dist, join(scratch, 'node_modules', '@hatchet-dev', 'typescript-sdk'), 'dir');
103
+
104
+ const esmDir = join(scratch, 'esm');
105
+ const cjsDir = join(scratch, 'cjs');
106
+ mkdirSync(esmDir);
107
+ mkdirSync(cjsDir);
108
+ writeFileSync(join(esmDir, 'package.json'), '{ "type": "module" }\n');
109
+ writeFileSync(join(cjsDir, 'package.json'), '{ "type": "commonjs" }\n');
110
+ const cjsRequire = createRequire(join(cjsDir, 'probe.js'));
111
+
112
+ const subpaths = [...new Set([...DOCUMENTED_SUBPATHS, ...explicitSubpaths])];
113
+ for (const [i, sub] of subpaths.entries()) {
114
+ const specifier = sub === '.' ? PACKAGE : `${PACKAGE}/${sub.slice(2)}`;
115
+
116
+ const probe = join(esmDir, `probe-${i}.mjs`);
117
+ const attributes = sub === './package.json' ? ' with { type: "json" }' : '';
118
+ writeFileSync(probe, `import ${JSON.stringify(specifier)}${attributes};\n`);
119
+ try {
120
+ await import(pathToFileURL(probe).href);
121
+ } catch (e) {
122
+ failures.push(`ESM import of ${specifier} failed: ${e.message}`);
123
+ }
124
+
125
+ try {
126
+ cjsRequire(specifier);
127
+ } catch (e) {
128
+ failures.push(`CJS require of ${specifier} failed: ${e.message}`);
129
+ }
130
+ }
131
+
132
+ const typesDir = join(scratch, 'types');
133
+ mkdirSync(typesDir);
134
+ writeFileSync(join(typesDir, 'consumer.ts'), TYPE_CONSUMER);
135
+ for (const moduleResolution of TYPE_RESOLUTIONS) {
136
+ const tsconfig = join(typesDir, `tsconfig.${moduleResolution}.json`);
137
+ writeFileSync(
138
+ tsconfig,
139
+ JSON.stringify({
140
+ compilerOptions: {
141
+ target: 'ES2022',
142
+ module: moduleResolution === 'bundler' ? 'ESNext' : moduleResolution,
143
+ moduleResolution,
144
+ strict: true,
145
+ noEmit: true,
146
+ skipLibCheck: true,
147
+ types: [],
148
+ },
149
+ files: ['consumer.ts'],
150
+ })
151
+ );
152
+ const result = spawnSync(process.execPath, [tsc, '-p', tsconfig], { encoding: 'utf8' });
153
+ if (result.status !== 0) {
154
+ failures.push(
155
+ `type consumer (moduleResolution ${moduleResolution}) failed:\n${result.stdout}${result.stderr}`
156
+ );
157
+ }
158
+ }
159
+ } finally {
160
+ rmSync(scratch, { recursive: true, force: true });
161
+ }
162
+
163
+ if (failures.length) {
164
+ console.error('exports map check failed:');
165
+ for (const f of failures) console.error(` ${f}`);
166
+ process.exit(1);
167
+ }
168
+
169
+ console.log(
170
+ `exports map resolves ${DOCUMENTED_SUBPATHS.length} documented and ${explicitSubpaths.length} explicit subpaths from ESM and CJS, and a type consumer compiles under ${TYPE_RESOLUTIONS.join(' and ')}`
171
+ );
package/step.js CHANGED
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- const v0_deprecation_warning_1 = require("./util/v0-deprecation-warning");
18
17
  __exportStar(require("./legacy/step"), exports);
19
- (0, v0_deprecation_warning_1.emitV0RemovedWarning)('step');
@@ -17,6 +17,8 @@ export declare function isTimeoutOrAbortError(e: unknown): boolean;
17
17
  */
18
18
  export declare function getGrpcErrorCode(e: unknown): number | undefined;
19
19
  /**
20
- * Returns the gRPC error details string from an unknown value (e.g. from a catch block).
20
+ * Returns the gRPC status message from an unknown value (e.g. from a catch block): the
21
+ * `details` string of a `nice-grpc` or `@grpc/grpc-js` error, or the `rawMessage` of a
22
+ * `ConnectError`, which carries the same server-provided text without the code prefix.
21
23
  */
22
24
  export declare function getGrpcErrorDetails(e: unknown): string | undefined;
@@ -35,12 +35,21 @@ function getGrpcErrorCode(e) {
35
35
  return undefined;
36
36
  }
37
37
  /**
38
- * Returns the gRPC error details string from an unknown value (e.g. from a catch block).
38
+ * Returns the gRPC status message from an unknown value (e.g. from a catch block): the
39
+ * `details` string of a `nice-grpc` or `@grpc/grpc-js` error, or the `rawMessage` of a
40
+ * `ConnectError`, which carries the same server-provided text without the code prefix.
39
41
  */
40
42
  function getGrpcErrorDetails(e) {
41
- if (e != null && typeof e === 'object' && 'details' in e) {
42
- const { details } = e;
43
- return typeof details === 'string' ? details : undefined;
43
+ if (e != null && typeof e === 'object') {
44
+ if ('rawMessage' in e) {
45
+ const { rawMessage } = e;
46
+ if (typeof rawMessage === 'string')
47
+ return rawMessage;
48
+ }
49
+ if ('details' in e) {
50
+ const { details } = e;
51
+ return typeof details === 'string' ? details : undefined;
52
+ }
44
53
  }
45
54
  return undefined;
46
55
  }
@@ -1,18 +1,11 @@
1
1
  /**
2
- * v0 SDK root-import deprecation warnings.
2
+ * The v0 SDK deprecation warning, emitted when a v0 workflow is actually used (registered on a
3
+ * worker or put to the engine), never when a module is merely imported: the root entry still
4
+ * re-exports the v0 `workflow` and `step` modules for consumers that only use v1 APIs, and
5
+ * loading them must stay silent.
3
6
  *
4
- * The legacy `workflow` and `step` re-exports under the root specifier need
5
- * to keep nagging consumers to migrate to v1, but the original implementation
6
- * used `console.warn` at module evaluation time, which:
7
- * - cannot be silenced by Node's standard `--no-deprecation`,
8
- * `--no-warnings`, or `--no-warnings=DeprecationWarning` flags;
9
- * - has no stable `code` for `process.on('warning', ...)` handlers; and
10
- * - is duplicated when both submodules are loaded (which happens for
11
- * anyone importing from the root, since `index.ts` re-exports both).
12
- *
13
- * Switching to `process.emitWarning` with a fixed code makes the warnings
14
- * filterable, dedupable, and consistent with the rest of Node's deprecation
15
- * surface, while still being visible by default.
7
+ * `process.emitWarning` with a fixed code keeps the warning filterable with Node's standard
8
+ * `--no-deprecation` and `--no-warnings` flags and addressable from `process.on('warning')`.
16
9
  */
17
10
  export declare const V0_DEPRECATION_CODE = "HATCHET_V0_REMOVED";
18
11
  /** Reset hook for tests. Not part of the public API. */
@@ -1,19 +1,12 @@
1
1
  "use strict";
2
2
  /**
3
- * v0 SDK root-import deprecation warnings.
3
+ * The v0 SDK deprecation warning, emitted when a v0 workflow is actually used (registered on a
4
+ * worker or put to the engine), never when a module is merely imported: the root entry still
5
+ * re-exports the v0 `workflow` and `step` modules for consumers that only use v1 APIs, and
6
+ * loading them must stay silent.
4
7
  *
5
- * The legacy `workflow` and `step` re-exports under the root specifier need
6
- * to keep nagging consumers to migrate to v1, but the original implementation
7
- * used `console.warn` at module evaluation time, which:
8
- * - cannot be silenced by Node's standard `--no-deprecation`,
9
- * `--no-warnings`, or `--no-warnings=DeprecationWarning` flags;
10
- * - has no stable `code` for `process.on('warning', ...)` handlers; and
11
- * - is duplicated when both submodules are loaded (which happens for
12
- * anyone importing from the root, since `index.ts` re-exports both).
13
- *
14
- * Switching to `process.emitWarning` with a fixed code makes the warnings
15
- * filterable, dedupable, and consistent with the rest of Node's deprecation
16
- * surface, while still being visible by default.
8
+ * `process.emitWarning` with a fixed code keeps the warning filterable with Node's standard
9
+ * `--no-deprecation` and `--no-warnings` flags and addressable from `process.on('warning')`.
17
10
  */
18
11
  Object.defineProperty(exports, "__esModule", { value: true });
19
12
  exports.V0_DEPRECATION_CODE = void 0;
@@ -5,6 +5,7 @@ import { RunListenerClient } from '../../clients/listeners/run-listener/child-li
5
5
  import { Api } from '../../clients/rest/generated/Api';
6
6
  import { WorkflowServiceClient } from '../../protoc/workflows';
7
7
  import { AdminServiceClient, CreateWorkflowVersionRequest } from '../../protoc/v1/workflows';
8
+ import { type Transport } from '../../clients/transport';
8
9
  import { Logger } from '../../util/logger';
9
10
  type DesiredWorkerLabelOpt = {
10
11
  value: string | number;
@@ -40,7 +41,7 @@ export declare class AdminClient {
40
41
  listenerClient: RunListenerClient;
41
42
  runs: RunsClient;
42
43
  logger: Logger;
43
- constructor(config: ClientConfig, api: Api, runs: RunsClient);
44
+ constructor(config: ClientConfig, api: Api, runs: RunsClient, transport?: Transport);
44
45
  /**
45
46
  * Creates a new workflow or updates an existing workflow via the v1 admin service.
46
47
  * @param workflow a workflow definition to create