@zavudev/sdk 0.2.0 → 0.4.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 (54) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +9 -10
  9. package/resources/contacts.d.mts +12 -4
  10. package/resources/contacts.d.mts.map +1 -1
  11. package/resources/contacts.d.ts +12 -4
  12. package/resources/contacts.d.ts.map +1 -1
  13. package/resources/index.d.mts +2 -2
  14. package/resources/index.d.mts.map +1 -1
  15. package/resources/index.d.ts +2 -2
  16. package/resources/index.d.ts.map +1 -1
  17. package/resources/index.js.map +1 -1
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/introspect.d.mts +4 -4
  20. package/resources/introspect.d.mts.map +1 -1
  21. package/resources/introspect.d.ts +4 -4
  22. package/resources/introspect.d.ts.map +1 -1
  23. package/resources/messages.d.mts +8 -7
  24. package/resources/messages.d.mts.map +1 -1
  25. package/resources/messages.d.ts +8 -7
  26. package/resources/messages.d.ts.map +1 -1
  27. package/resources/senders.d.mts +7 -19
  28. package/resources/senders.d.mts.map +1 -1
  29. package/resources/senders.d.ts +7 -19
  30. package/resources/senders.d.ts.map +1 -1
  31. package/resources/senders.js +2 -2
  32. package/resources/senders.js.map +1 -1
  33. package/resources/senders.mjs +2 -2
  34. package/resources/senders.mjs.map +1 -1
  35. package/resources/templates.d.mts +53 -3
  36. package/resources/templates.d.mts.map +1 -1
  37. package/resources/templates.d.ts +53 -3
  38. package/resources/templates.d.ts.map +1 -1
  39. package/resources/templates.js +2 -2
  40. package/resources/templates.js.map +1 -1
  41. package/resources/templates.mjs +2 -2
  42. package/resources/templates.mjs.map +1 -1
  43. package/src/client.ts +4 -0
  44. package/src/resources/contacts.ts +14 -4
  45. package/src/resources/index.ts +2 -0
  46. package/src/resources/introspect.ts +5 -5
  47. package/src/resources/messages.ts +8 -7
  48. package/src/resources/senders.ts +14 -23
  49. package/src/resources/templates.ts +72 -3
  50. package/src/version.ts +1 -1
  51. package/version.d.mts +1 -1
  52. package/version.d.ts +1 -1
  53. package/version.js +1 -1
  54. package/version.mjs +1 -1
@@ -100,15 +100,15 @@ export class Messages extends APIResource {
100
100
  }
101
101
 
102
102
  /**
103
- * Delivery channel.
103
+ * Delivery channel. Use 'auto' for intelligent routing.
104
104
  */
105
- export type Channel = 'sms' | 'whatsapp' | 'email';
105
+ export type Channel = 'auto' | 'sms' | 'whatsapp' | 'email';
106
106
 
107
107
  export interface Message {
108
108
  id: string;
109
109
 
110
110
  /**
111
- * Delivery channel.
111
+ * Delivery channel. Use 'auto' for intelligent routing.
112
112
  */
113
113
  channel: Channel;
114
114
 
@@ -280,7 +280,7 @@ export interface MessageResponse {
280
280
  message: Message;
281
281
  }
282
282
 
283
- export type MessageStatus = 'queued' | 'sending' | 'sent' | 'delivered' | 'read' | 'failed';
283
+ export type MessageStatus = 'queued' | 'sending' | 'delivered' | 'failed' | 'received';
284
284
 
285
285
  /**
286
286
  * Type of message. Non-text types are WhatsApp only.
@@ -307,7 +307,7 @@ export interface MessageListResponse {
307
307
 
308
308
  export interface MessageListParams {
309
309
  /**
310
- * Delivery channel.
310
+ * Delivery channel. Use 'auto' for intelligent routing.
311
311
  */
312
312
  channel?: Channel;
313
313
 
@@ -340,8 +340,9 @@ export interface MessageSendParams {
340
340
  to: string;
341
341
 
342
342
  /**
343
- * Body param: Delivery channel. If omitted with non-text messageType, WhatsApp is
344
- * used. For email recipients, defaults to 'email'.
343
+ * Body param: Delivery channel. Use 'auto' for intelligent routing. If omitted
344
+ * with non-text messageType, WhatsApp is used. For email recipients, defaults to
345
+ * 'email'.
345
346
  */
346
347
  channel?: Channel;
347
348
 
@@ -31,8 +31,11 @@ export class Senders extends APIResource {
31
31
  /**
32
32
  * List senders
33
33
  */
34
- list(options?: RequestOptions): APIPromise<SenderListResponse> {
35
- return this._client.get('/v1/senders', options);
34
+ list(
35
+ query: SenderListParams | null | undefined = {},
36
+ options?: RequestOptions,
37
+ ): APIPromise<SenderListResponse> {
38
+ return this._client.get('/v1/senders', { query, ...options });
36
39
  }
37
40
 
38
41
  /**
@@ -56,8 +59,6 @@ export interface Sender {
56
59
  */
57
60
  phoneNumber: string;
58
61
 
59
- capabilities?: Sender.Capabilities;
60
-
61
62
  createdAt?: string;
62
63
 
63
64
  /**
@@ -68,27 +69,10 @@ export interface Sender {
68
69
  updatedAt?: string;
69
70
  }
70
71
 
71
- export namespace Sender {
72
- export interface Capabilities {
73
- /**
74
- * Whether Email is enabled for this sender.
75
- */
76
- email?: boolean;
77
-
78
- /**
79
- * Whether SMS is enabled for this sender.
80
- */
81
- sms?: boolean;
82
-
83
- /**
84
- * Whether WhatsApp is enabled for this sender.
85
- */
86
- whatsapp?: boolean;
87
- }
88
- }
89
-
90
72
  export interface SenderListResponse {
91
73
  items: Array<Sender>;
74
+
75
+ nextCursor?: string | null;
92
76
  }
93
77
 
94
78
  export interface SenderCreateParams {
@@ -105,11 +89,18 @@ export interface SenderUpdateParams {
105
89
  setAsDefault?: boolean;
106
90
  }
107
91
 
92
+ export interface SenderListParams {
93
+ cursor?: string;
94
+
95
+ limit?: number;
96
+ }
97
+
108
98
  export declare namespace Senders {
109
99
  export {
110
100
  type Sender as Sender,
111
101
  type SenderListResponse as SenderListResponse,
112
102
  type SenderCreateParams as SenderCreateParams,
113
103
  type SenderUpdateParams as SenderUpdateParams,
104
+ type SenderListParams as SenderListParams,
114
105
  };
115
106
  }
@@ -48,8 +48,11 @@ export class Templates extends APIResource {
48
48
  * const templates = await client.templates.list();
49
49
  * ```
50
50
  */
51
- list(options?: RequestOptions): APIPromise<TemplateListResponse> {
52
- return this._client.get('/v1/templates', options);
51
+ list(
52
+ query: TemplateListParams | null | undefined = {},
53
+ options?: RequestOptions,
54
+ ): APIPromise<TemplateListResponse> {
55
+ return this._client.get('/v1/templates', { query, ...options });
53
56
  }
54
57
 
55
58
  /**
@@ -91,9 +94,29 @@ export interface Template {
91
94
  */
92
95
  name: string;
93
96
 
97
+ /**
98
+ * Template buttons.
99
+ */
100
+ buttons?: Array<Template.Button>;
101
+
94
102
  createdAt?: string;
95
103
 
96
- status?: 'pending' | 'approved' | 'rejected';
104
+ /**
105
+ * Footer text for the template.
106
+ */
107
+ footer?: string;
108
+
109
+ /**
110
+ * Header content (text or media URL).
111
+ */
112
+ headerContent?: string;
113
+
114
+ /**
115
+ * Type of header (text, image, video, document).
116
+ */
117
+ headerType?: string;
118
+
119
+ status?: 'draft' | 'pending' | 'approved' | 'rejected';
97
120
 
98
121
  updatedAt?: string;
99
122
 
@@ -101,6 +124,43 @@ export interface Template {
101
124
  * List of variable names for documentation.
102
125
  */
103
126
  variables?: Array<string>;
127
+
128
+ /**
129
+ * WhatsApp-specific template information.
130
+ */
131
+ whatsapp?: Template.Whatsapp;
132
+ }
133
+
134
+ export namespace Template {
135
+ export interface Button {
136
+ phoneNumber?: string;
137
+
138
+ text?: string;
139
+
140
+ type?: string;
141
+
142
+ url?: string;
143
+ }
144
+
145
+ /**
146
+ * WhatsApp-specific template information.
147
+ */
148
+ export interface Whatsapp {
149
+ /**
150
+ * WhatsApp Business Account namespace.
151
+ */
152
+ namespace?: string;
153
+
154
+ /**
155
+ * WhatsApp approval status.
156
+ */
157
+ status?: string;
158
+
159
+ /**
160
+ * WhatsApp template name.
161
+ */
162
+ templateName?: string;
163
+ }
104
164
  }
105
165
 
106
166
  /**
@@ -110,6 +170,8 @@ export type WhatsappCategory = 'UTILITY' | 'MARKETING' | 'AUTHENTICATION';
110
170
 
111
171
  export interface TemplateListResponse {
112
172
  items: Array<Template>;
173
+
174
+ nextCursor?: string | null;
113
175
  }
114
176
 
115
177
  export interface TemplateCreateParams {
@@ -127,11 +189,18 @@ export interface TemplateCreateParams {
127
189
  whatsappCategory?: WhatsappCategory;
128
190
  }
129
191
 
192
+ export interface TemplateListParams {
193
+ cursor?: string;
194
+
195
+ limit?: number;
196
+ }
197
+
130
198
  export declare namespace Templates {
131
199
  export {
132
200
  type Template as Template,
133
201
  type WhatsappCategory as WhatsappCategory,
134
202
  type TemplateListResponse as TemplateListResponse,
135
203
  type TemplateCreateParams as TemplateCreateParams,
204
+ type TemplateListParams as TemplateListParams,
136
205
  };
137
206
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.4.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.2.0'; // x-release-please-version
4
+ exports.VERSION = '0.4.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map