@zavudev/sdk 0.53.0 → 0.54.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 (44) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +1 -1
  3. package/resources/broadcasts/broadcasts.d.mts +20 -4
  4. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  5. package/resources/broadcasts/broadcasts.d.ts +20 -4
  6. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  7. package/resources/broadcasts/broadcasts.js +20 -4
  8. package/resources/broadcasts/broadcasts.js.map +1 -1
  9. package/resources/broadcasts/broadcasts.mjs +20 -4
  10. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  11. package/resources/functions/functions.d.mts +88 -3
  12. package/resources/functions/functions.d.mts.map +1 -1
  13. package/resources/functions/functions.d.ts +88 -3
  14. package/resources/functions/functions.d.ts.map +1 -1
  15. package/resources/functions/functions.js.map +1 -1
  16. package/resources/functions/functions.mjs.map +1 -1
  17. package/resources/phone-numbers.d.mts +7 -3
  18. package/resources/phone-numbers.d.mts.map +1 -1
  19. package/resources/phone-numbers.d.ts +7 -3
  20. package/resources/phone-numbers.d.ts.map +1 -1
  21. package/resources/phone-numbers.js +4 -1
  22. package/resources/phone-numbers.js.map +1 -1
  23. package/resources/phone-numbers.mjs +4 -1
  24. package/resources/phone-numbers.mjs.map +1 -1
  25. package/resources/senders/agent/tools.d.mts +13 -1
  26. package/resources/senders/agent/tools.d.mts.map +1 -1
  27. package/resources/senders/agent/tools.d.ts +13 -1
  28. package/resources/senders/agent/tools.d.ts.map +1 -1
  29. package/resources/senders/senders.d.mts +45 -0
  30. package/resources/senders/senders.d.mts.map +1 -1
  31. package/resources/senders/senders.d.ts +45 -0
  32. package/resources/senders/senders.d.ts.map +1 -1
  33. package/resources/senders/senders.js.map +1 -1
  34. package/resources/senders/senders.mjs.map +1 -1
  35. package/src/resources/broadcasts/broadcasts.ts +20 -4
  36. package/src/resources/functions/functions.ts +90 -3
  37. package/src/resources/phone-numbers.ts +7 -3
  38. package/src/resources/senders/agent/tools.ts +14 -1
  39. package/src/resources/senders/senders.ts +48 -0
  40. package/src/version.ts +1 -1
  41. package/version.d.mts +1 -1
  42. package/version.d.ts +1 -1
  43. package/version.js +1 -1
  44. package/version.mjs +1 -1
@@ -401,6 +401,18 @@ export namespace FunctionDeployResponse {
401
401
  */
402
402
  version: number;
403
403
 
404
+ /**
405
+ * What the build printed: dependency installation, the bundler's output, and the
406
+ * compiler's message when it failed. Returned when fetching a single deployment,
407
+ * omitted from the list. Read this first when a deploy fails — `errorMessage` is
408
+ * often the outer wrapper's summary, and the line that names the broken import or
409
+ * the syntax error is here.
410
+ */
411
+ buildLogs?: string | null;
412
+
413
+ /**
414
+ * Size of the built bundle in bytes. Null until the build finishes.
415
+ */
404
416
  bundleBytes?: number | null;
405
417
 
406
418
  deployedAt?: string | null;
@@ -410,6 +422,9 @@ export namespace FunctionDeployResponse {
410
422
  */
411
423
  errorMessage?: string | null;
412
424
 
425
+ /**
426
+ * Total size of the deployed source tree in bytes.
427
+ */
413
428
  sourceCodeBytes?: number | null;
414
429
  }
415
430
  }
@@ -436,6 +451,18 @@ export namespace FunctionGetDeploymentResponse {
436
451
  */
437
452
  version: number;
438
453
 
454
+ /**
455
+ * What the build printed: dependency installation, the bundler's output, and the
456
+ * compiler's message when it failed. Returned when fetching a single deployment,
457
+ * omitted from the list. Read this first when a deploy fails — `errorMessage` is
458
+ * often the outer wrapper's summary, and the line that names the broken import or
459
+ * the syntax error is here.
460
+ */
461
+ buildLogs?: string | null;
462
+
463
+ /**
464
+ * Size of the built bundle in bytes. Null until the build finishes.
465
+ */
439
466
  bundleBytes?: number | null;
440
467
 
441
468
  deployedAt?: string | null;
@@ -445,6 +472,9 @@ export namespace FunctionGetDeploymentResponse {
445
472
  */
446
473
  errorMessage?: string | null;
447
474
 
475
+ /**
476
+ * Total size of the deployed source tree in bytes.
477
+ */
448
478
  sourceCodeBytes?: number | null;
449
479
  }
450
480
  }
@@ -481,6 +511,23 @@ export interface FunctionCreateParams {
481
511
 
482
512
  description?: string;
483
513
 
514
+ /**
515
+ * Which file in `files` is the entry point. Defaults to `index.ts`.
516
+ */
517
+ entrypoint?: string;
518
+
519
+ /**
520
+ * The project's source files, keyed by path relative to the project root (e.g.
521
+ * `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
522
+ * function is built, so a function can be split across as many files as it needs.
523
+ *
524
+ * Paths must be relative and use forward slashes; `..`, `node_modules/` and
525
+ * `package.json` are rejected. npm packages are not uploaded here — declare them
526
+ * under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
527
+ * for the whole tree.
528
+ */
529
+ files?: { [key: string]: string };
530
+
484
531
  /**
485
532
  * Whether to expose a public HTTPS URL for this function.
486
533
  */
@@ -494,7 +541,9 @@ export interface FunctionCreateParams {
494
541
  runtime?: 'nodejs24';
495
542
 
496
543
  /**
497
- * TypeScript source code for the function entry point (max ~900KB).
544
+ * Shortcut for a single-file function: exactly equivalent to sending `files` with
545
+ * one entry named after `entrypoint` (`index.ts` by default). Fully supported —
546
+ * use whichever fits. If both are sent, `files` wins.
498
547
  */
499
548
  sourceCode?: string;
500
549
 
@@ -513,6 +562,23 @@ export interface FunctionUpdateParams {
513
562
  */
514
563
  dependencies?: { [key: string]: string };
515
564
 
565
+ /**
566
+ * Which file in `files` is the entry point. Defaults to `index.ts`.
567
+ */
568
+ entrypoint?: string;
569
+
570
+ /**
571
+ * The project's source files, keyed by path relative to the project root (e.g.
572
+ * `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
573
+ * function is built, so a function can be split across as many files as it needs.
574
+ *
575
+ * Paths must be relative and use forward slashes; `..`, `node_modules/` and
576
+ * `package.json` are rejected. npm packages are not uploaded here — declare them
577
+ * under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
578
+ * for the whole tree.
579
+ */
580
+ files?: { [key: string]: string };
581
+
516
582
  /**
517
583
  * Expose the function on its public HTTPS URL, or take it down. Applies to the
518
584
  * already-deployed function without redeploying; the URL is returned as
@@ -521,7 +587,9 @@ export interface FunctionUpdateParams {
521
587
  httpEnabled?: boolean;
522
588
 
523
589
  /**
524
- * New source code for the draft (replaces it).
590
+ * Shortcut for a single-file function: exactly equivalent to sending `files` with
591
+ * one entry named after `entrypoint` (`index.ts` by default). Fully supported —
592
+ * use whichever fits. If both are sent, `files` wins.
525
593
  */
526
594
  sourceCode?: string;
527
595
  }
@@ -533,7 +601,26 @@ export interface FunctionDeployParams {
533
601
  dependencies?: { [key: string]: string };
534
602
 
535
603
  /**
536
- * New source code to publish (replaces the draft).
604
+ * Which file in `files` is the entry point. Defaults to `index.ts`.
605
+ */
606
+ entrypoint?: string;
607
+
608
+ /**
609
+ * The project's source files, keyed by path relative to the project root (e.g.
610
+ * `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
611
+ * function is built, so a function can be split across as many files as it needs.
612
+ *
613
+ * Paths must be relative and use forward slashes; `..`, `node_modules/` and
614
+ * `package.json` are rejected. npm packages are not uploaded here — declare them
615
+ * under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
616
+ * for the whole tree.
617
+ */
618
+ files?: { [key: string]: string };
619
+
620
+ /**
621
+ * Shortcut for a single-file function: exactly equivalent to sending `files` with
622
+ * one entry named after `entrypoint` (`index.ts` by default). Fully supported —
623
+ * use whichever fits. If both are sent, `files` wins.
537
624
  */
538
625
  sourceCode?: string;
539
626
  }
@@ -62,7 +62,10 @@ export class PhoneNumbers extends APIResource {
62
62
  /**
63
63
  * Purchase an available phone number. Requires a paid plan: the Free plan cannot
64
64
  * purchase phone numbers and receives `402` with code `paid_plan_required`. Paid
65
- * plans include the first US number at no charge.
65
+ * plans include one US number at no charge. The included number is one per account
66
+ * and is granted once: claiming it spends the benefit for good, so releasing that
67
+ * number does not make another one free, and numbers the account already bought do
68
+ * not consume it.
66
69
  *
67
70
  * @example
68
71
  * ```ts
@@ -207,8 +210,9 @@ export interface PhoneNumberCapabilities {
207
210
 
208
211
  export interface PhoneNumberPricing {
209
212
  /**
210
- * Whether this number qualifies as the plan-included first US number on paid
211
- * plans.
213
+ * Whether this number qualifies as the plan-included US number on paid plans. The
214
+ * benefit is one per account: it is never offered again once claimed, not even
215
+ * after the number is released.
212
216
  */
213
217
  isFreeEligible?: boolean;
214
218
 
@@ -172,6 +172,17 @@ export interface AgentTool {
172
172
  * HTTPS URL to call when the tool is executed.
173
173
  */
174
174
  webhookUrl: string;
175
+
176
+ /**
177
+ * Signing secret for this tool's webhook. **Returned only when the tool is
178
+ * created**, never on a later read.
179
+ *
180
+ * Zavu generates one if you do not supply it, and signs every call to this tool
181
+ * with it: `X-Zavu-Signature: <hex>`, the HMAC-SHA256 of the request body. Verify
182
+ * it before trusting the call. Lost it? Rotate with
183
+ * `POST /v1/senders/{senderId}/agent/tools/{toolId}/webhook/secret`.
184
+ */
185
+ webhookSecret?: string;
175
186
  }
176
187
 
177
188
  export interface ToolParameters {
@@ -268,7 +279,9 @@ export interface ToolCreateParams {
268
279
  enabled?: boolean;
269
280
 
270
281
  /**
271
- * Optional secret for webhook signature verification.
282
+ * Signing secret for the webhook. Optional: Zavu generates one when omitted and
283
+ * returns it on this response only. Supply your own if you already have a secret
284
+ * you want reused.
272
285
  */
273
286
  webhookSecret?: string;
274
287
  }
@@ -300,6 +300,22 @@ export interface SenderWebhook {
300
300
  */
301
301
  events: Array<WebhookEvent>;
302
302
 
303
+ /**
304
+ * Which `X-Zavu-Signature` scheme this receiver is sent.
305
+ *
306
+ * - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
307
+ * configurable. Existing webhooks stay on it until you move them.
308
+ * - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
309
+ * default for new senders. It signs the timestamp together with the body.
310
+ * - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
311
+ * reading either one works, so you can deploy and confirm your new verifier
312
+ * before switching over.
313
+ *
314
+ * Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
315
+ * https://docs.zavu.dev/guides/receiving-messages/signature-migration
316
+ */
317
+ signatureVersion: 'v1' | 'v1+v2' | 'v2';
318
+
303
319
  /**
304
320
  * HTTPS URL that will receive webhook events.
305
321
  */
@@ -570,6 +586,22 @@ export interface SenderCreateParams {
570
586
  */
571
587
  webhookEvents?: Array<WebhookEvent>;
572
588
 
589
+ /**
590
+ * Which `X-Zavu-Signature` scheme this receiver is sent.
591
+ *
592
+ * - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
593
+ * configurable. Existing webhooks stay on it until you move them.
594
+ * - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
595
+ * default for new senders. It signs the timestamp together with the body.
596
+ * - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
597
+ * reading either one works, so you can deploy and confirm your new verifier
598
+ * before switching over.
599
+ *
600
+ * Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
601
+ * https://docs.zavu.dev/guides/receiving-messages/signature-migration
602
+ */
603
+ webhookSignatureVersion?: 'v1' | 'v1+v2' | 'v2';
604
+
573
605
  /**
574
606
  * HTTPS URL for webhook events.
575
607
  */
@@ -634,6 +666,22 @@ export interface SenderUpdateParams {
634
666
  */
635
667
  webhookEvents?: Array<WebhookEvent>;
636
668
 
669
+ /**
670
+ * Which `X-Zavu-Signature` scheme this receiver is sent.
671
+ *
672
+ * - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
673
+ * configurable. Existing webhooks stay on it until you move them.
674
+ * - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
675
+ * default for new senders. It signs the timestamp together with the body.
676
+ * - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
677
+ * reading either one works, so you can deploy and confirm your new verifier
678
+ * before switching over.
679
+ *
680
+ * Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
681
+ * https://docs.zavu.dev/guides/receiving-messages/signature-migration
682
+ */
683
+ webhookSignatureVersion?: 'v1' | 'v1+v2' | 'v2';
684
+
637
685
  /**
638
686
  * HTTPS URL for webhook events. Set to null to remove webhook.
639
687
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.53.0'; // x-release-please-version
1
+ export const VERSION = '0.54.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.53.0";
1
+ export declare const VERSION = "0.54.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.53.0";
1
+ export declare const VERSION = "0.54.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.53.0'; // x-release-please-version
4
+ exports.VERSION = '0.54.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.53.0'; // x-release-please-version
1
+ export const VERSION = '0.54.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map