retell-utils 0.3.1 → 0.3.2

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/dist/call.d.ts CHANGED
@@ -233,7 +233,7 @@ export declare function createCallSchemas<TMeta extends z.ZodType, TDynVars exte
233
233
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
234
234
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
235
235
  duration_ms: z.ZodCatch<z.ZodNumber>;
236
- disconnection_reason: z.ZodEnum<{
236
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
237
237
  user_hangup: "user_hangup";
238
238
  agent_hangup: "agent_hangup";
239
239
  call_transfer: "call_transfer";
@@ -262,7 +262,7 @@ export declare function createCallSchemas<TMeta extends z.ZodType, TDynVars exte
262
262
  error_unknown: "error_unknown";
263
263
  error_user_not_joined: "error_user_not_joined";
264
264
  registered_call_timeout: "registered_call_timeout";
265
- }>;
265
+ }>>;
266
266
  transcript: z.ZodOptional<z.ZodString>;
267
267
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
268
268
  role: z.ZodEnum<{
@@ -514,7 +514,7 @@ export declare function createCallSchemas<TMeta extends z.ZodType, TDynVars exte
514
514
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
515
515
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
516
516
  duration_ms: z.ZodCatch<z.ZodNumber>;
517
- disconnection_reason: z.ZodEnum<{
517
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
518
518
  user_hangup: "user_hangup";
519
519
  agent_hangup: "agent_hangup";
520
520
  call_transfer: "call_transfer";
@@ -543,7 +543,7 @@ export declare function createCallSchemas<TMeta extends z.ZodType, TDynVars exte
543
543
  error_unknown: "error_unknown";
544
544
  error_user_not_joined: "error_user_not_joined";
545
545
  registered_call_timeout: "registered_call_timeout";
546
- }>;
546
+ }>>;
547
547
  transcript: z.ZodOptional<z.ZodString>;
548
548
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
549
549
  role: z.ZodEnum<{
@@ -899,7 +899,7 @@ export declare const CallSchemas: {
899
899
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
900
900
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
901
901
  duration_ms: z.ZodCatch<z.ZodNumber>;
902
- disconnection_reason: z.ZodEnum<{
902
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
903
903
  user_hangup: "user_hangup";
904
904
  agent_hangup: "agent_hangup";
905
905
  call_transfer: "call_transfer";
@@ -928,7 +928,7 @@ export declare const CallSchemas: {
928
928
  error_unknown: "error_unknown";
929
929
  error_user_not_joined: "error_user_not_joined";
930
930
  registered_call_timeout: "registered_call_timeout";
931
- }>;
931
+ }>>;
932
932
  transcript: z.ZodOptional<z.ZodString>;
933
933
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
934
934
  role: z.ZodEnum<{
@@ -1180,7 +1180,7 @@ export declare const CallSchemas: {
1180
1180
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
1181
1181
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
1182
1182
  duration_ms: z.ZodCatch<z.ZodNumber>;
1183
- disconnection_reason: z.ZodEnum<{
1183
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
1184
1184
  user_hangup: "user_hangup";
1185
1185
  agent_hangup: "agent_hangup";
1186
1186
  call_transfer: "call_transfer";
@@ -1209,7 +1209,7 @@ export declare const CallSchemas: {
1209
1209
  error_unknown: "error_unknown";
1210
1210
  error_user_not_joined: "error_user_not_joined";
1211
1211
  registered_call_timeout: "registered_call_timeout";
1212
- }>;
1212
+ }>>;
1213
1213
  transcript: z.ZodOptional<z.ZodString>;
1214
1214
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
1215
1215
  role: z.ZodEnum<{
package/dist/call.js CHANGED
@@ -94,8 +94,11 @@ export function createCallSchemas(config) {
94
94
  end_timestamp: z.coerce.date().catch(new Date(0)),
95
95
  /** Call duration in milliseconds. */
96
96
  duration_ms: z.number().catch(0),
97
- /** Why the call was disconnected. */
98
- disconnection_reason: DisconnectionReasonSchema,
97
+ /**
98
+ * Why the call was disconnected. Falls back to "error_unknown" if
99
+ * missing/invalid.
100
+ */
101
+ disconnection_reason: DisconnectionReasonSchema.catch("error_unknown"),
99
102
  /** Plain-text transcript. May be absent if data storage settings strip it. */
100
103
  transcript: z.string().optional(),
101
104
  /** Structured transcript with word-level timestamps. */
package/dist/webhook.d.ts CHANGED
@@ -246,7 +246,7 @@ export declare const WebhookSchemas: {
246
246
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
247
247
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
248
248
  duration_ms: z.ZodCatch<z.ZodNumber>;
249
- disconnection_reason: z.ZodEnum<{
249
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
250
250
  user_hangup: "user_hangup";
251
251
  agent_hangup: "agent_hangup";
252
252
  call_transfer: "call_transfer";
@@ -275,7 +275,7 @@ export declare const WebhookSchemas: {
275
275
  error_unknown: "error_unknown";
276
276
  error_user_not_joined: "error_user_not_joined";
277
277
  registered_call_timeout: "registered_call_timeout";
278
- }>;
278
+ }>>;
279
279
  transcript: z.ZodOptional<z.ZodString>;
280
280
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
281
281
  role: z.ZodEnum<{
@@ -530,7 +530,7 @@ export declare const WebhookSchemas: {
530
530
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
531
531
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
532
532
  duration_ms: z.ZodCatch<z.ZodNumber>;
533
- disconnection_reason: z.ZodEnum<{
533
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
534
534
  user_hangup: "user_hangup";
535
535
  agent_hangup: "agent_hangup";
536
536
  call_transfer: "call_transfer";
@@ -559,7 +559,7 @@ export declare const WebhookSchemas: {
559
559
  error_unknown: "error_unknown";
560
560
  error_user_not_joined: "error_user_not_joined";
561
561
  registered_call_timeout: "registered_call_timeout";
562
- }>;
562
+ }>>;
563
563
  transcript: z.ZodOptional<z.ZodString>;
564
564
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
565
565
  role: z.ZodEnum<{
@@ -1073,7 +1073,7 @@ export declare const WebhookSchemas: {
1073
1073
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
1074
1074
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
1075
1075
  duration_ms: z.ZodCatch<z.ZodNumber>;
1076
- disconnection_reason: z.ZodEnum<{
1076
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
1077
1077
  user_hangup: "user_hangup";
1078
1078
  agent_hangup: "agent_hangup";
1079
1079
  call_transfer: "call_transfer";
@@ -1102,7 +1102,7 @@ export declare const WebhookSchemas: {
1102
1102
  error_unknown: "error_unknown";
1103
1103
  error_user_not_joined: "error_user_not_joined";
1104
1104
  registered_call_timeout: "registered_call_timeout";
1105
- }>;
1105
+ }>>;
1106
1106
  transcript: z.ZodOptional<z.ZodString>;
1107
1107
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
1108
1108
  role: z.ZodEnum<{
@@ -1356,7 +1356,7 @@ export declare const WebhookSchemas: {
1356
1356
  }, z.core.$strip>], "call_type">>, z.ZodObject<{
1357
1357
  end_timestamp: z.ZodCatch<z.ZodCoercedDate<unknown>>;
1358
1358
  duration_ms: z.ZodCatch<z.ZodNumber>;
1359
- disconnection_reason: z.ZodEnum<{
1359
+ disconnection_reason: z.ZodCatch<z.ZodEnum<{
1360
1360
  user_hangup: "user_hangup";
1361
1361
  agent_hangup: "agent_hangup";
1362
1362
  call_transfer: "call_transfer";
@@ -1385,7 +1385,7 @@ export declare const WebhookSchemas: {
1385
1385
  error_unknown: "error_unknown";
1386
1386
  error_user_not_joined: "error_user_not_joined";
1387
1387
  registered_call_timeout: "registered_call_timeout";
1388
- }>;
1388
+ }>>;
1389
1389
  transcript: z.ZodOptional<z.ZodString>;
1390
1390
  transcript_object: z.ZodOptional<z.ZodArray<z.ZodObject<{
1391
1391
  role: z.ZodEnum<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retell-utils",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Type-safe Zod schemas for Retell AI API resources with lifecycle-aware discriminated unions and generic customization",
5
5
  "type": "module",
6
6
  "zshy": {