@hatchet-dev/typescript-sdk 1.1.7 → 1.1.8-alpha.1

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.
@@ -46,6 +46,8 @@ export declare const ClientConfigSchema: z.ZodObject<{
46
46
  log_level: z.ZodOptional<z.ZodEnum<["OFF", "DEBUG", "INFO", "WARN", "ERROR"]>>;
47
47
  tenant_id: z.ZodString;
48
48
  namespace: z.ZodOptional<z.ZodString>;
49
+ grpc_max_send_message_length: z.ZodOptional<z.ZodNumber>;
50
+ grpc_max_recv_message_length: z.ZodOptional<z.ZodNumber>;
49
51
  }, "strip", z.ZodTypeAny, {
50
52
  token: string;
51
53
  tls_config: {
@@ -60,6 +62,8 @@ export declare const ClientConfigSchema: z.ZodObject<{
60
62
  tenant_id: string;
61
63
  log_level?: "OFF" | "DEBUG" | "INFO" | "WARN" | "ERROR" | undefined;
62
64
  namespace?: string | undefined;
65
+ grpc_max_send_message_length?: number | undefined;
66
+ grpc_max_recv_message_length?: number | undefined;
63
67
  }, {
64
68
  token: string;
65
69
  tls_config: {
@@ -74,6 +78,8 @@ export declare const ClientConfigSchema: z.ZodObject<{
74
78
  tenant_id: string;
75
79
  log_level?: "OFF" | "DEBUG" | "INFO" | "WARN" | "ERROR" | undefined;
76
80
  namespace?: string | undefined;
81
+ grpc_max_send_message_length?: number | undefined;
82
+ grpc_max_recv_message_length?: number | undefined;
77
83
  }>;
78
84
  export type LogConstructor = (context: string, logLevel?: LogLevel) => Logger;
79
85
  export type ClientConfig = z.infer<typeof ClientConfigSchema> & {
@@ -17,4 +17,6 @@ exports.ClientConfigSchema = zod_1.z.object({
17
17
  log_level: zod_1.z.enum(['OFF', 'DEBUG', 'INFO', 'WARN', 'ERROR']).optional(),
18
18
  tenant_id: zod_1.z.string(),
19
19
  namespace: zod_1.z.string().optional(),
20
+ grpc_max_send_message_length: zod_1.z.number().optional(),
21
+ grpc_max_recv_message_length: zod_1.z.number().optional(),
20
22
  });
@@ -53,12 +53,12 @@ const cron_client_1 = require("./features/cron-client");
53
53
  const schedule_client_1 = require("./features/schedule-client");
54
54
  const durable_listener_client_1 = require("../listeners/durable-listener/durable-listener-client");
55
55
  const channelFactory = (config, credentials) => (0, nice_grpc_1.createChannel)(config.host_port, credentials, {
56
+ 'grpc.max_send_message_length': config.grpc_max_send_message_length,
57
+ 'grpc.max_receive_message_length': config.grpc_max_recv_message_length,
56
58
  'grpc.ssl_target_name_override': config.tls_config.server_name,
57
59
  'grpc.keepalive_timeout_ms': 60 * 1000,
58
60
  'grpc.client_idle_timeout_ms': 60 * 1000,
59
- // Send keepalive pings every 10 seconds, default is 2 hours.
60
- 'grpc.keepalive_time_ms': 10 * 1000,
61
- // Allow keepalive pings when there are no gRPC calls.
61
+ 'grpc.http2.max_pings_without_data': 0,
62
62
  'grpc.keepalive_permit_without_calls': 1,
63
63
  });
64
64
  exports.channelFactory = channelFactory;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.1.7",
3
+ "version": "1.1.8-alpha.1",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -44,7 +44,7 @@ const token_1 = require("./token");
44
44
  const DEFAULT_CONFIG_FILE = '.hatchet.yaml';
45
45
  class ConfigLoader {
46
46
  static loadClientConfig(override, config) {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
48
48
  const yaml = this.loadYamlConfig(config === null || config === void 0 ? void 0 : config.path);
49
49
  const tlsConfig = (_a = override === null || override === void 0 ? void 0 : override.tls_config) !== null && _a !== void 0 ? _a : {
50
50
  tls_strategy: (_d = (_c = (_b = yaml === null || yaml === void 0 ? void 0 : yaml.tls_config) === null || _b === void 0 ? void 0 : _b.tls_strategy) !== null && _c !== void 0 ? _c : this.env('HATCHET_CLIENT_TLS_STRATEGY')) !== null && _d !== void 0 ? _d : 'tls',
@@ -76,14 +76,18 @@ class ConfigLoader {
76
76
  apiUrl = (_z = (_y = override === null || override === void 0 ? void 0 : override.api_url) !== null && _y !== void 0 ? _y : yaml === null || yaml === void 0 ? void 0 : yaml.api_url) !== null && _z !== void 0 ? _z : this.env('HATCHET_CLIENT_API_URL');
77
77
  }
78
78
  const namespace = (_1 = (_0 = override === null || override === void 0 ? void 0 : override.namespace) !== null && _0 !== void 0 ? _0 : yaml === null || yaml === void 0 ? void 0 : yaml.namespace) !== null && _1 !== void 0 ? _1 : this.env('HATCHET_CLIENT_NAMESPACE');
79
+ const grpcMaxSendMessageLength = (_3 = (_2 = override === null || override === void 0 ? void 0 : override.grpc_max_send_message_length) !== null && _2 !== void 0 ? _2 : yaml === null || yaml === void 0 ? void 0 : yaml.grpc_max_send_message_length) !== null && _3 !== void 0 ? _3 : parseInt((_4 = this.env('HATCHET_CLIENT_GRPC_MAX_SEND_MESSAGE_LENGTH')) !== null && _4 !== void 0 ? _4 : '-1', 10);
80
+ const grpcMaxRecvMessageLength = (_6 = (_5 = override === null || override === void 0 ? void 0 : override.grpc_max_recv_message_length) !== null && _5 !== void 0 ? _5 : yaml === null || yaml === void 0 ? void 0 : yaml.grpc_max_recv_message_length) !== null && _6 !== void 0 ? _6 : parseInt((_7 = this.env('HATCHET_CLIENT_GRPC_MAX_RECV_MESSAGE_LENGTH')) !== null && _7 !== void 0 ? _7 : '-1', 10);
79
81
  return {
80
- token: (_3 = (_2 = override === null || override === void 0 ? void 0 : override.token) !== null && _2 !== void 0 ? _2 : yaml === null || yaml === void 0 ? void 0 : yaml.token) !== null && _3 !== void 0 ? _3 : this.env('HATCHET_CLIENT_TOKEN'),
82
+ token: (_9 = (_8 = override === null || override === void 0 ? void 0 : override.token) !== null && _8 !== void 0 ? _8 : yaml === null || yaml === void 0 ? void 0 : yaml.token) !== null && _9 !== void 0 ? _9 : this.env('HATCHET_CLIENT_TOKEN'),
81
83
  host_port: grpcBroadcastAddress,
82
84
  api_url: apiUrl,
83
85
  tls_config: tlsConfig,
84
- log_level: (_6 = (_5 = (_4 = override === null || override === void 0 ? void 0 : override.log_level) !== null && _4 !== void 0 ? _4 : yaml === null || yaml === void 0 ? void 0 : yaml.log_level) !== null && _5 !== void 0 ? _5 : this.env('HATCHET_CLIENT_LOG_LEVEL')) !== null && _6 !== void 0 ? _6 : 'INFO',
86
+ log_level: (_12 = (_11 = (_10 = override === null || override === void 0 ? void 0 : override.log_level) !== null && _10 !== void 0 ? _10 : yaml === null || yaml === void 0 ? void 0 : yaml.log_level) !== null && _11 !== void 0 ? _11 : this.env('HATCHET_CLIENT_LOG_LEVEL')) !== null && _12 !== void 0 ? _12 : 'INFO',
85
87
  tenant_id: tenantId,
86
88
  namespace: namespace ? `${namespace}_`.toLowerCase() : '',
89
+ grpc_max_send_message_length: grpcMaxSendMessageLength > 0 ? grpcMaxSendMessageLength : undefined,
90
+ grpc_max_recv_message_length: grpcMaxRecvMessageLength > 0 ? grpcMaxRecvMessageLength : undefined,
87
91
  };
88
92
  }
89
93
  static get default_yaml_config_path() {
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "1.1.7";
1
+ export declare const HATCHET_VERSION = "1.1.8-alpha.1";
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.1.7';
4
+ exports.HATCHET_VERSION = '1.1.8-alpha.1';