@zavudev/sdk 0.47.0 → 0.48.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 (82) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/broadcasts/broadcasts.d.mts +1 -1
  11. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  12. package/resources/broadcasts/broadcasts.d.ts +1 -1
  13. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  14. package/resources/broadcasts/broadcasts.js.map +1 -1
  15. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  16. package/resources/contacts/channels.d.mts +1 -1
  17. package/resources/contacts/channels.d.mts.map +1 -1
  18. package/resources/contacts/channels.d.ts +1 -1
  19. package/resources/contacts/channels.d.ts.map +1 -1
  20. package/resources/contacts/contacts.d.mts +2 -2
  21. package/resources/contacts/contacts.d.mts.map +1 -1
  22. package/resources/contacts/contacts.d.ts +2 -2
  23. package/resources/contacts/contacts.d.ts.map +1 -1
  24. package/resources/exports.d.mts +0 -97
  25. package/resources/exports.d.mts.map +1 -1
  26. package/resources/exports.d.ts +0 -97
  27. package/resources/exports.d.ts.map +1 -1
  28. package/resources/exports.js +0 -44
  29. package/resources/exports.js.map +1 -1
  30. package/resources/exports.mjs +0 -44
  31. package/resources/exports.mjs.map +1 -1
  32. package/resources/index.d.mts +3 -3
  33. package/resources/index.d.mts.map +1 -1
  34. package/resources/index.d.ts +3 -3
  35. package/resources/index.d.ts.map +1 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/messages.d.mts +19 -9
  40. package/resources/messages.d.mts.map +1 -1
  41. package/resources/messages.d.ts +19 -9
  42. package/resources/messages.d.ts.map +1 -1
  43. package/resources/phone-numbers.d.mts +1 -1
  44. package/resources/phone-numbers.d.mts.map +1 -1
  45. package/resources/phone-numbers.d.ts +1 -1
  46. package/resources/phone-numbers.d.ts.map +1 -1
  47. package/resources/plan.d.mts +0 -39
  48. package/resources/plan.d.mts.map +1 -1
  49. package/resources/plan.d.ts +0 -39
  50. package/resources/plan.d.ts.map +1 -1
  51. package/resources/plan.js +0 -7
  52. package/resources/plan.js.map +1 -1
  53. package/resources/plan.mjs +0 -7
  54. package/resources/plan.mjs.map +1 -1
  55. package/resources/urls.d.mts +2 -2
  56. package/resources/urls.d.mts.map +1 -1
  57. package/resources/urls.d.ts +2 -2
  58. package/resources/urls.d.ts.map +1 -1
  59. package/resources/usage.d.mts +0 -32
  60. package/resources/usage.d.mts.map +1 -1
  61. package/resources/usage.d.ts +0 -32
  62. package/resources/usage.d.ts.map +1 -1
  63. package/resources/usage.js +0 -7
  64. package/resources/usage.js.map +1 -1
  65. package/resources/usage.mjs +0 -7
  66. package/resources/usage.mjs.map +1 -1
  67. package/src/client.ts +6 -22
  68. package/src/resources/broadcasts/broadcasts.ts +1 -10
  69. package/src/resources/contacts/channels.ts +1 -1
  70. package/src/resources/contacts/contacts.ts +2 -2
  71. package/src/resources/exports.ts +1 -137
  72. package/src/resources/index.ts +3 -11
  73. package/src/resources/messages.ts +19 -8
  74. package/src/resources/phone-numbers.ts +1 -1
  75. package/src/resources/plan.ts +1 -58
  76. package/src/resources/urls.ts +2 -2
  77. package/src/resources/usage.ts +1 -44
  78. package/src/version.ts +1 -1
  79. package/version.d.mts +1 -1
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
  82. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -30,15 +30,7 @@ import {
30
30
  AddressesCursor,
31
31
  } from './resources/addresses';
32
32
  import { Balance, BalanceRetrieveResponse } from './resources/balance';
33
- import {
34
- DataExport,
35
- DataExportsCursor,
36
- ExportCreateParams,
37
- ExportCreateResponse,
38
- ExportListParams,
39
- ExportRetrieveResponse,
40
- Exports,
41
- } from './resources/exports';
33
+ import { Exports } from './resources/exports';
42
34
  import {
43
35
  Introspect,
44
36
  IntrospectValidatePhoneParams,
@@ -96,7 +88,7 @@ import {
96
88
  RequirementFieldType,
97
89
  RequirementType,
98
90
  } from './resources/phone-numbers';
99
- import { Plan, PlanRetrieveResponse } from './resources/plan';
91
+ import { Plan } from './resources/plan';
100
92
  import {
101
93
  RegulatoryDocument,
102
94
  RegulatoryDocumentCreateParams,
@@ -125,7 +117,7 @@ import {
125
117
  VerifiedURL,
126
118
  VerifiedURLsCursor,
127
119
  } from './resources/urls';
128
- import { Usage, UsageRetrieveResponse } from './resources/usage';
120
+ import { Usage } from './resources/usage';
129
121
  import {
130
122
  Broadcast,
131
123
  BroadcastCancelResponse,
@@ -1146,15 +1138,7 @@ export declare namespace Zavudev {
1146
1138
  type InvitationListParams as InvitationListParams,
1147
1139
  };
1148
1140
 
1149
- export {
1150
- Exports as Exports,
1151
- type DataExport as DataExport,
1152
- type ExportCreateResponse as ExportCreateResponse,
1153
- type ExportRetrieveResponse as ExportRetrieveResponse,
1154
- type DataExportsCursor as DataExportsCursor,
1155
- type ExportCreateParams as ExportCreateParams,
1156
- type ExportListParams as ExportListParams,
1157
- };
1141
+ export { Exports as Exports };
1158
1142
 
1159
1143
  export {
1160
1144
  URLs as URLs,
@@ -1168,9 +1152,9 @@ export declare namespace Zavudev {
1168
1152
 
1169
1153
  export { Balance as Balance, type BalanceRetrieveResponse as BalanceRetrieveResponse };
1170
1154
 
1171
- export { Plan as Plan, type PlanRetrieveResponse as PlanRetrieveResponse };
1155
+ export { Plan as Plan };
1172
1156
 
1173
- export { Usage as Usage, type UsageRetrieveResponse as UsageRetrieveResponse };
1157
+ export { Usage as Usage };
1174
1158
 
1175
1159
  export {
1176
1160
  SubAccounts as SubAccounts,
@@ -319,16 +319,7 @@ export namespace Broadcast {
319
319
  /**
320
320
  * Broadcast delivery channel. Use 'smart' for per-contact intelligent routing.
321
321
  */
322
- export type BroadcastChannel =
323
- | 'smart'
324
- | 'sms'
325
- | 'sms_oneway'
326
- | 'whatsapp'
327
- | 'telegram'
328
- | 'email'
329
- | 'instagram'
330
- | 'messenger'
331
- | 'voice';
322
+ export type BroadcastChannel = 'smart' | 'sms' | 'sms_oneway' | 'whatsapp' | 'telegram' | 'email';
332
323
 
333
324
  export interface BroadcastContact {
334
325
  id: string;
@@ -133,7 +133,7 @@ export interface ChannelAddParams {
133
133
  /**
134
134
  * Channel type.
135
135
  */
136
- channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'messenger' | 'voice';
136
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
137
137
 
138
138
  /**
139
139
  * Channel identifier (phone number in E.164 format or email address).
@@ -223,7 +223,7 @@ export interface ContactChannel {
223
223
  /**
224
224
  * Channel type.
225
225
  */
226
- channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'messenger' | 'voice';
226
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
227
227
 
228
228
  createdAt: string;
229
229
 
@@ -309,7 +309,7 @@ export namespace ContactCreateParams {
309
309
  /**
310
310
  * Channel type.
311
311
  */
312
- channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'messenger' | 'voice';
312
+ channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
313
313
 
314
314
  /**
315
315
  * Channel identifier (phone number in E.164 format or email address).
@@ -1,141 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
6
- import { RequestOptions } from '../internal/request-options';
7
- import { path } from '../internal/utils/path';
8
4
 
9
- export class Exports extends APIResource {
10
- /**
11
- * Create a new data export job. The export will be processed asynchronously and
12
- * the download URL will be available when status is 'completed'. Export links
13
- * expire after 24 hours.
14
- *
15
- * @example
16
- * ```ts
17
- * const _export = await client.exports.create({
18
- * dataTypes: ['messages', 'conversations'],
19
- * dateFrom: '2024-01-01T00:00:00Z',
20
- * dateTo: '2024-12-31T23:59:59Z',
21
- * });
22
- * ```
23
- */
24
- create(body: ExportCreateParams, options?: RequestOptions): APIPromise<ExportCreateResponse> {
25
- return this._client.post('/v1/exports', { body, ...options });
26
- }
27
-
28
- /**
29
- * Get details of a specific data export, including download URL when completed.
30
- *
31
- * @example
32
- * ```ts
33
- * const _export = await client.exports.retrieve('exportId');
34
- * ```
35
- */
36
- retrieve(exportID: string, options?: RequestOptions): APIPromise<ExportRetrieveResponse> {
37
- return this._client.get(path`/v1/exports/${exportID}`, options);
38
- }
39
-
40
- /**
41
- * List data exports for this project.
42
- *
43
- * @example
44
- * ```ts
45
- * // Automatically fetches more pages as needed.
46
- * for await (const dataExport of client.exports.list()) {
47
- * // ...
48
- * }
49
- * ```
50
- */
51
- list(
52
- query: ExportListParams | null | undefined = {},
53
- options?: RequestOptions,
54
- ): PagePromise<DataExportsCursor, DataExport> {
55
- return this._client.getAPIList('/v1/exports', Cursor<DataExport>, { query, ...options });
56
- }
57
- }
58
-
59
- export type DataExportsCursor = Cursor<DataExport>;
60
-
61
- export interface DataExport {
62
- id: string;
63
-
64
- createdAt: string;
65
-
66
- dataTypes: Array<'messages' | 'conversations' | 'webhookDeliveries' | 'agentExecutions' | 'activities'>;
67
-
68
- /**
69
- * When the export download link expires (24 hours after creation).
70
- */
71
- expiresAt: string;
72
-
73
- /**
74
- * Status of a data export job.
75
- */
76
- status: 'pending' | 'processing' | 'completed' | 'failed';
77
-
78
- completedAt?: string | null;
79
-
80
- dateFrom?: string | null;
81
-
82
- dateTo?: string | null;
83
-
84
- /**
85
- * URL to download the export file. Only available when status is 'completed'.
86
- */
87
- downloadUrl?: string | null;
88
-
89
- /**
90
- * Error message if the export failed.
91
- */
92
- errorMessage?: string | null;
93
-
94
- /**
95
- * Size of the export file in bytes.
96
- */
97
- fileSize?: number | null;
98
- }
99
-
100
- export interface ExportCreateResponse {
101
- export: DataExport;
102
- }
103
-
104
- export interface ExportRetrieveResponse {
105
- export: DataExport;
106
- }
107
-
108
- export interface ExportCreateParams {
109
- /**
110
- * List of data types to include in the export.
111
- */
112
- dataTypes: Array<'messages' | 'conversations' | 'webhookDeliveries' | 'agentExecutions' | 'activities'>;
113
-
114
- /**
115
- * Start date for data to export (inclusive).
116
- */
117
- dateFrom?: string;
118
-
119
- /**
120
- * End date for data to export (inclusive).
121
- */
122
- dateTo?: string;
123
- }
124
-
125
- export interface ExportListParams extends CursorParams {
126
- /**
127
- * Status of a data export job.
128
- */
129
- status?: 'pending' | 'processing' | 'completed' | 'failed';
130
- }
131
-
132
- export declare namespace Exports {
133
- export {
134
- type DataExport as DataExport,
135
- type ExportCreateResponse as ExportCreateResponse,
136
- type ExportRetrieveResponse as ExportRetrieveResponse,
137
- type DataExportsCursor as DataExportsCursor,
138
- type ExportCreateParams as ExportCreateParams,
139
- type ExportListParams as ExportListParams,
140
- };
141
- }
5
+ export class Exports extends APIResource {}
@@ -47,15 +47,7 @@ export {
47
47
  type ContactMergeParams,
48
48
  type ContactsCursor,
49
49
  } from './contacts/contacts';
50
- export {
51
- Exports,
52
- type DataExport,
53
- type ExportCreateResponse,
54
- type ExportRetrieveResponse,
55
- type ExportCreateParams,
56
- type ExportListParams,
57
- type DataExportsCursor,
58
- } from './exports';
50
+ export { Exports } from './exports';
59
51
  export {
60
52
  Functions,
61
53
  type FunctionCreateResponse,
@@ -128,7 +120,7 @@ export {
128
120
  type PhoneNumberSearchAvailableParams,
129
121
  type OwnedPhoneNumbersCursor,
130
122
  } from './phone-numbers';
131
- export { Plan, type PlanRetrieveResponse } from './plan';
123
+ export { Plan } from './plan';
132
124
  export {
133
125
  RegulatoryDocuments,
134
126
  type RegulatoryDocument,
@@ -188,4 +180,4 @@ export {
188
180
  type URLSubmitForVerificationParams,
189
181
  type VerifiedURLsCursor,
190
182
  } from './urls';
191
- export { Usage, type UsageRetrieveResponse } from './usage';
183
+ export { Usage } from './usage';
@@ -140,13 +140,17 @@ export class Messages extends APIResource {
140
140
  export type MessagesCursor = Cursor<Message>;
141
141
 
142
142
  /**
143
- * Delivery channel. Use 'auto' for intelligent routing.
143
+ * Delivery channel. Use 'auto' for intelligent routing. `whatsapp_alt` is the
144
+ * QR-linked WhatsApp channel and is only accepted for teams with the WhatsApp
145
+ * Alternative feature enabled; the sender must have a connected whatsapp_alt
146
+ * session.
144
147
  */
145
148
  export type Channel =
146
149
  | 'auto'
147
150
  | 'sms'
148
151
  | 'sms_oneway'
149
152
  | 'whatsapp'
153
+ | 'whatsapp_alt'
150
154
  | 'telegram'
151
155
  | 'email'
152
156
  | 'instagram'
@@ -157,7 +161,10 @@ export interface Message {
157
161
  id: string;
158
162
 
159
163
  /**
160
- * Delivery channel. Use 'auto' for intelligent routing.
164
+ * Delivery channel. Use 'auto' for intelligent routing. `whatsapp_alt` is the
165
+ * QR-linked WhatsApp channel and is only accepted for teams with the WhatsApp
166
+ * Alternative feature enabled; the sender must have a connected whatsapp_alt
167
+ * session.
161
168
  */
162
169
  channel: Channel;
163
170
 
@@ -179,17 +186,18 @@ export interface Message {
179
186
  content?: MessageContent;
180
187
 
181
188
  /**
182
- * MAU cost in USD (charged for first contact of the month).
189
+ * Zavu platform charge in USD for this message. Messaging is billed against your
190
+ * plan's monthly limits plus usage-based overage.
183
191
  */
184
192
  cost?: number | null;
185
193
 
186
194
  /**
187
- * Provider cost in USD (Telnyx, SES, etc.).
195
+ * Carrier and delivery cost in USD.
188
196
  */
189
197
  costProvider?: number | null;
190
198
 
191
199
  /**
192
- * Total cost in USD (MAU + provider cost).
200
+ * Total cost in USD (platform charge + delivery cost).
193
201
  */
194
202
  costTotal?: number | null;
195
203
 
@@ -463,11 +471,14 @@ export interface MessageShowTypingResponse {
463
471
 
464
472
  export interface MessageListParams extends CursorParams {
465
473
  /**
466
- * Delivery channel. Use 'auto' for intelligent routing.
474
+ * Filter by delivery channel.
467
475
  */
468
- channel?: Channel;
476
+ channel?: 'sms' | 'sms_oneway' | 'whatsapp' | 'email' | 'telegram' | 'instagram' | 'messenger' | 'voice';
469
477
 
470
- status?: MessageStatus;
478
+ /**
479
+ * Filter by status. Not all stored statuses are filterable.
480
+ */
481
+ status?: 'queued' | 'sending' | 'sent' | 'delivered' | 'failed' | 'received';
471
482
 
472
483
  to?: string;
473
484
  }
@@ -223,7 +223,7 @@ export interface PhoneNumberPricing {
223
223
 
224
224
  export type PhoneNumberStatus = 'active' | 'suspended' | 'pending';
225
225
 
226
- export type PhoneNumberType = 'local' | 'mobile' | 'tollFree';
226
+ export type PhoneNumberType = 'local' | 'national' | 'tollFree';
227
227
 
228
228
  /**
229
229
  * A group of requirements for a specific country/phone type combination.
@@ -1,62 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { RequestOptions } from '../internal/request-options';
6
4
 
7
- export class Plan extends APIResource {
8
- /**
9
- * Get the current subscription plan for the API key's team, including tier,
10
- * billing interval, and period dates.
11
- */
12
- retrieve(options?: RequestOptions): APIPromise<PlanRetrieveResponse> {
13
- return this._client.get('/v1/plan', options);
14
- }
15
- }
16
-
17
- export interface PlanRetrieveResponse {
18
- billingInterval: 'monthly' | 'annual';
19
-
20
- status: 'active' | 'past_due' | 'canceled' | 'trialing';
21
-
22
- /**
23
- * Current subscription tier.
24
- */
25
- tier: 'free' | 'pro' | 'scale' | 'enterprise';
26
-
27
- cancelAtPeriodEnd?: boolean;
28
-
29
- currentPeriodEnd?: string;
30
-
31
- currentPeriodStart?: string;
32
-
33
- limits?: PlanRetrieveResponse.Limits;
34
- }
35
-
36
- export namespace PlanRetrieveResponse {
37
- export interface Limits {
38
- broadcasts?: boolean;
39
-
40
- /**
41
- * Monthly email limit.
42
- */
43
- emails?: number;
44
-
45
- /**
46
- * Monthly A2P message limit.
47
- */
48
- messagesA2P?: number;
49
-
50
- phoneNumbers?: number;
51
-
52
- senders?: number;
53
-
54
- subAccounts?: boolean;
55
-
56
- wabaConnections?: number;
57
- }
58
- }
59
-
60
- export declare namespace Plan {
61
- export { type PlanRetrieveResponse as PlanRetrieveResponse };
62
- }
5
+ export class Plan extends APIResource {}
@@ -76,7 +76,7 @@ export interface VerifiedURL {
76
76
  /**
77
77
  * Status of a verified URL.
78
78
  */
79
- status: 'pending' | 'approved' | 'rejected' | 'malicious';
79
+ status: 'pending' | 'approved' | 'rejected' | 'escalated' | 'malicious';
80
80
 
81
81
  /**
82
82
  * The verified URL.
@@ -103,7 +103,7 @@ export interface URLListVerifiedParams extends CursorParams {
103
103
  /**
104
104
  * Filter by verification status.
105
105
  */
106
- status?: 'pending' | 'approved' | 'rejected' | 'malicious';
106
+ status?: 'pending' | 'approved' | 'rejected' | 'escalated' | 'malicious';
107
107
  }
108
108
 
109
109
  export interface URLSubmitForVerificationParams {
@@ -1,48 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { RequestOptions } from '../internal/request-options';
6
4
 
7
- export class Usage extends APIResource {
8
- /**
9
- * Get the current month's usage counters for A2P messages and emails, along with
10
- * the tier limits.
11
- */
12
- retrieve(options?: RequestOptions): APIPromise<UsageRetrieveResponse> {
13
- return this._client.get('/v1/usage', options);
14
- }
15
- }
16
-
17
- export interface UsageRetrieveResponse {
18
- /**
19
- * Emails sent this month.
20
- */
21
- emailsSent: number;
22
-
23
- limits: UsageRetrieveResponse.Limits;
24
-
25
- /**
26
- * A2P messages sent this month (WhatsApp replies + Telegram).
27
- */
28
- messagesA2P: number;
29
-
30
- /**
31
- * Current month in YYYY-MM format.
32
- */
33
- monthKey: string;
34
-
35
- tier: 'free' | 'pro' | 'scale' | 'enterprise';
36
- }
37
-
38
- export namespace UsageRetrieveResponse {
39
- export interface Limits {
40
- emails?: number;
41
-
42
- messagesA2P?: number;
43
- }
44
- }
45
-
46
- export declare namespace Usage {
47
- export { type UsageRetrieveResponse as UsageRetrieveResponse };
48
- }
5
+ export class Usage extends APIResource {}
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.47.0'; // x-release-please-version
1
+ export const VERSION = '0.48.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.47.0";
1
+ export declare const VERSION = "0.48.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.47.0";
1
+ export declare const VERSION = "0.48.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.47.0'; // x-release-please-version
4
+ exports.VERSION = '0.48.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.47.0'; // x-release-please-version
1
+ export const VERSION = '0.48.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map