@hatchet-dev/typescript-sdk 1.33.2 → 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 (52) hide show
  1. package/clients/admin/admin-client.d.ts +6 -1
  2. package/clients/admin/admin-client.js +9 -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/package.json +95 -2
  28. package/protoc-es/dispatcher/dispatcher_pb.d.ts +1357 -0
  29. package/protoc-es/dispatcher/dispatcher_pb.js +371 -0
  30. package/protoc-es/events/events_pb.d.ts +294 -0
  31. package/protoc-es/events/events_pb.js +61 -0
  32. package/protoc-es/google/rpc/status_pb.d.ts +48 -0
  33. package/protoc-es/google/rpc/status_pb.js +27 -0
  34. package/protoc-es/v1/dispatcher_pb.d.ts +676 -0
  35. package/protoc-es/v1/dispatcher_pb.js +155 -0
  36. package/protoc-es/v1/shared/condition_pb.d.ts +166 -0
  37. package/protoc-es/v1/shared/condition_pb.js +68 -0
  38. package/protoc-es/v1/shared/trigger_pb.d.ts +160 -0
  39. package/protoc-es/v1/shared/trigger_pb.js +55 -0
  40. package/protoc-es/v1/workflows_pb.d.ts +995 -0
  41. package/protoc-es/v1/workflows_pb.js +280 -0
  42. package/protoc-es/workflows/workflows_pb.d.ts +715 -0
  43. package/protoc-es/workflows/workflows_pb.js +216 -0
  44. package/scripts/check-exports.mjs +171 -0
  45. package/util/grpc-error.d.ts +3 -1
  46. package/util/grpc-error.js +13 -4
  47. package/v1/client/admin.d.ts +2 -1
  48. package/v1/client/admin.js +34 -114
  49. package/v1/client/client.d.ts +1 -0
  50. package/v1/client/client.js +8 -5
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
@@ -39,6 +39,7 @@ export declare class HatchetClient<GlobalInput extends Record<string, any> = {},
39
39
  private _axiosConfig;
40
40
  private _clientFactory;
41
41
  private _credentials;
42
+ private _transport;
42
43
  /**
43
44
  * @deprecated v0 client will be removed in a future release, please upgrade to v1
44
45
  * @hidden
@@ -29,6 +29,7 @@ const dispatcher_client_1 = require("../../clients/dispatcher/dispatcher-client"
29
29
  const child_listener_client_1 = require("../../clients/listeners/run-listener/child-listener-client");
30
30
  const durable_listener_client_1 = require("../../clients/listeners/durable-listener/durable-listener-client");
31
31
  const grpc_helpers_1 = require("../../util/grpc-helpers");
32
+ const transport_1 = require("../../clients/transport");
32
33
  const nice_grpc_1 = require("nice-grpc");
33
34
  const declaration_1 = require("../declaration");
34
35
  const legacy_transformer_1 = require("../../legacy/legacy-transformer");
@@ -50,7 +51,8 @@ class HatchetClient {
50
51
  */
51
52
  get v0() {
52
53
  if (!this._v0) {
53
- this._v0 = new hatchet_client_1.LegacyHatchetClient(this._config, this._options, this._axiosConfig, this.runs, this._listener, this.events, this.dispatcher, this.logger, this.durableListener);
54
+ // The legacy facade shares this client's unary transport rather than building its own.
55
+ this._v0 = new hatchet_client_1.LegacyHatchetClient(this._config, Object.assign(Object.assign({}, this._options), { transport: this._transport }), this._axiosConfig, this.runs, this._listener, this.events, this.dispatcher, this.logger, this.durableListener);
54
56
  }
55
57
  return this._v0;
56
58
  }
@@ -62,7 +64,7 @@ class HatchetClient {
62
64
  * @internal
63
65
  */
64
66
  constructor(config, options, axiosConfig) {
65
- var _a;
67
+ var _a, _b;
66
68
  try {
67
69
  const loaded = config_loader_1.ConfigLoader.loadClientConfig(config, {
68
70
  path: options === null || options === void 0 ? void 0 : options.config_path,
@@ -80,6 +82,7 @@ class HatchetClient {
80
82
  this._clientFactory = (0, nice_grpc_1.createClientFactory)().use((0, grpc_helpers_1.addTokenMiddleware)(this.config.token));
81
83
  this._credentials =
82
84
  (_a = options === null || options === void 0 ? void 0 : options.credentials) !== null && _a !== void 0 ? _a : config_loader_1.ConfigLoader.createCredentials(this.config.tls_config);
85
+ this._transport = (_b = options === null || options === void 0 ? void 0 : options.transport) !== null && _b !== void 0 ? _b : (0, transport_1.createNodeTransport)(this.config);
83
86
  this._listener = new child_listener_client_1.RunListenerClient(this.config, (0, grpc_helpers_1.channelFactory)(this.config, this._credentials), this._clientFactory, this.api);
84
87
  this._options = options;
85
88
  this._axiosConfig = axiosConfig;
@@ -104,7 +107,7 @@ class HatchetClient {
104
107
  // Do nothing here
105
108
  });
106
109
  }
107
- catch (_b) {
110
+ catch (_c) {
108
111
  // Do nothing here
109
112
  }
110
113
  }
@@ -295,7 +298,7 @@ class HatchetClient {
295
298
  */
296
299
  get events() {
297
300
  if (!this._event) {
298
- this._event = new event_client_1.EventClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory, this.api);
301
+ this._event = new event_client_1.EventClient(this._config, (0, grpc_helpers_1.channelFactory)(this._config, this._credentials), this._clientFactory, this.api, this._transport);
299
302
  }
300
303
  return this._event;
301
304
  }
@@ -437,7 +440,7 @@ class HatchetClient {
437
440
  */
438
441
  get admin() {
439
442
  if (!this._admin) {
440
- this._admin = new admin_1.AdminClient(this._config, this.api, this.runs);
443
+ this._admin = new admin_1.AdminClient(this._config, this.api, this.runs, this._transport);
441
444
  }
442
445
  return this._admin;
443
446
  }
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "1.33.2";
1
+ export declare const HATCHET_VERSION = "1.34.0-alpha.0";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HATCHET_VERSION = void 0;
4
- exports.HATCHET_VERSION = '1.33.2';
4
+ exports.HATCHET_VERSION = '1.34.0-alpha.0';