@zavudev/sdk 0.12.0 → 0.15.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.
- package/CHANGELOG.md +34 -0
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/contacts.d.mts +4 -0
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +4 -0
- package/resources/contacts.d.ts.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/senders.d.mts +224 -3
- package/resources/senders.d.mts.map +1 -1
- package/resources/senders.d.ts +224 -3
- package/resources/senders.d.ts.map +1 -1
- package/resources/senders.js +90 -0
- package/resources/senders.js.map +1 -1
- package/resources/senders.mjs +90 -0
- package/resources/senders.mjs.map +1 -1
- package/resources/templates.d.mts +25 -1
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +25 -1
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +16 -0
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +16 -0
- package/resources/templates.mjs.map +1 -1
- package/src/client.ts +16 -0
- package/src/resources/contacts.ts +5 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/senders.ts +297 -2
- package/src/resources/templates.ts +30 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/senders.js
CHANGED
|
@@ -9,30 +9,61 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
9
9
|
class Senders extends resource_1.APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Create sender
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const sender = await client.senders.create({
|
|
16
|
+
* name: 'name',
|
|
17
|
+
* phoneNumber: 'phoneNumber',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
create(body, options) {
|
|
14
22
|
return this._client.post('/v1/senders', { body, ...options });
|
|
15
23
|
}
|
|
16
24
|
/**
|
|
17
25
|
* Get sender
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const sender = await client.senders.retrieve('senderId');
|
|
30
|
+
* ```
|
|
18
31
|
*/
|
|
19
32
|
retrieve(senderID, options) {
|
|
20
33
|
return this._client.get((0, path_1.path) `/v1/senders/${senderID}`, options);
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
36
|
* Update sender
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const sender = await client.senders.update('senderId');
|
|
41
|
+
* ```
|
|
24
42
|
*/
|
|
25
43
|
update(senderID, body, options) {
|
|
26
44
|
return this._client.patch((0, path_1.path) `/v1/senders/${senderID}`, { body, ...options });
|
|
27
45
|
}
|
|
28
46
|
/**
|
|
29
47
|
* List senders
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const sender of client.senders.list()) {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
30
56
|
*/
|
|
31
57
|
list(query = {}, options) {
|
|
32
58
|
return this._client.getAPIList('/v1/senders', (pagination_1.Cursor), { query, ...options });
|
|
33
59
|
}
|
|
34
60
|
/**
|
|
35
61
|
* Delete sender
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* await client.senders.delete('senderId');
|
|
66
|
+
* ```
|
|
36
67
|
*/
|
|
37
68
|
delete(senderID, options) {
|
|
38
69
|
return this._client.delete((0, path_1.path) `/v1/senders/${senderID}`, {
|
|
@@ -40,13 +71,72 @@ class Senders extends resource_1.APIResource {
|
|
|
40
71
|
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
41
72
|
});
|
|
42
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the WhatsApp Business profile for a sender. The sender must have a WhatsApp
|
|
76
|
+
* Business Account connected.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const whatsappBusinessProfileResponse =
|
|
81
|
+
* await client.senders.getProfile('senderId');
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
getProfile(senderID, options) {
|
|
85
|
+
return this._client.get((0, path_1.path) `/v1/senders/${senderID}/profile`, options);
|
|
86
|
+
}
|
|
43
87
|
/**
|
|
44
88
|
* Regenerate the webhook secret for a sender. The old secret will be invalidated
|
|
45
89
|
* immediately.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const webhookSecretResponse =
|
|
94
|
+
* await client.senders.regenerateWebhookSecret('senderId');
|
|
95
|
+
* ```
|
|
46
96
|
*/
|
|
47
97
|
regenerateWebhookSecret(senderID, options) {
|
|
48
98
|
return this._client.post((0, path_1.path) `/v1/senders/${senderID}/webhook/secret`, options);
|
|
49
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Update the WhatsApp Business profile for a sender. The sender must have a
|
|
102
|
+
* WhatsApp Business Account connected.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const response = await client.senders.updateProfile(
|
|
107
|
+
* 'senderId',
|
|
108
|
+
* {
|
|
109
|
+
* about: 'Succulent specialists!',
|
|
110
|
+
* description:
|
|
111
|
+
* 'We specialize in providing high-quality succulents.',
|
|
112
|
+
* email: 'contact@example.com',
|
|
113
|
+
* vertical: 'RETAIL',
|
|
114
|
+
* websites: ['https://www.example.com'],
|
|
115
|
+
* },
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
updateProfile(senderID, body, options) {
|
|
120
|
+
return this._client.patch((0, path_1.path) `/v1/senders/${senderID}/profile`, { body, ...options });
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Upload a new profile picture for the WhatsApp Business profile. The image will
|
|
124
|
+
* be uploaded to Meta and set as the profile picture.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const response = await client.senders.uploadProfilePicture(
|
|
129
|
+
* 'senderId',
|
|
130
|
+
* {
|
|
131
|
+
* imageUrl: 'https://example.com/profile.jpg',
|
|
132
|
+
* mimeType: 'image/jpeg',
|
|
133
|
+
* },
|
|
134
|
+
* );
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
uploadProfilePicture(senderID, body, options) {
|
|
138
|
+
return this._client.post((0, path_1.path) `/v1/senders/${senderID}/profile/picture`, { body, ...options });
|
|
139
|
+
}
|
|
50
140
|
}
|
|
51
141
|
exports.Senders = Senders;
|
|
52
142
|
//# sourceMappingURL=senders.js.map
|
package/resources/senders.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senders.js","sourceRoot":"","sources":["../src/resources/senders.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAC5E,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC
|
|
1
|
+
{"version":3,"file":"senders.js","sourceRoot":"","sources":["../src/resources/senders.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAC5E,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,I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B;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CACX,QAAgB,EAChB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,oBAAoB,CAClB,QAAgB,EAChB,IAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;CACF;AAtJD,0BAsJC"}
|
package/resources/senders.mjs
CHANGED
|
@@ -6,30 +6,61 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
6
6
|
export class Senders extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Create sender
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const sender = await client.senders.create({
|
|
13
|
+
* name: 'name',
|
|
14
|
+
* phoneNumber: 'phoneNumber',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
9
17
|
*/
|
|
10
18
|
create(body, options) {
|
|
11
19
|
return this._client.post('/v1/senders', { body, ...options });
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
22
|
* Get sender
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const sender = await client.senders.retrieve('senderId');
|
|
27
|
+
* ```
|
|
15
28
|
*/
|
|
16
29
|
retrieve(senderID, options) {
|
|
17
30
|
return this._client.get(path `/v1/senders/${senderID}`, options);
|
|
18
31
|
}
|
|
19
32
|
/**
|
|
20
33
|
* Update sender
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const sender = await client.senders.update('senderId');
|
|
38
|
+
* ```
|
|
21
39
|
*/
|
|
22
40
|
update(senderID, body, options) {
|
|
23
41
|
return this._client.patch(path `/v1/senders/${senderID}`, { body, ...options });
|
|
24
42
|
}
|
|
25
43
|
/**
|
|
26
44
|
* List senders
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Automatically fetches more pages as needed.
|
|
49
|
+
* for await (const sender of client.senders.list()) {
|
|
50
|
+
* // ...
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
27
53
|
*/
|
|
28
54
|
list(query = {}, options) {
|
|
29
55
|
return this._client.getAPIList('/v1/senders', (Cursor), { query, ...options });
|
|
30
56
|
}
|
|
31
57
|
/**
|
|
32
58
|
* Delete sender
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* await client.senders.delete('senderId');
|
|
63
|
+
* ```
|
|
33
64
|
*/
|
|
34
65
|
delete(senderID, options) {
|
|
35
66
|
return this._client.delete(path `/v1/senders/${senderID}`, {
|
|
@@ -37,12 +68,71 @@ export class Senders extends APIResource {
|
|
|
37
68
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
38
69
|
});
|
|
39
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Get the WhatsApp Business profile for a sender. The sender must have a WhatsApp
|
|
73
|
+
* Business Account connected.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const whatsappBusinessProfileResponse =
|
|
78
|
+
* await client.senders.getProfile('senderId');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
getProfile(senderID, options) {
|
|
82
|
+
return this._client.get(path `/v1/senders/${senderID}/profile`, options);
|
|
83
|
+
}
|
|
40
84
|
/**
|
|
41
85
|
* Regenerate the webhook secret for a sender. The old secret will be invalidated
|
|
42
86
|
* immediately.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const webhookSecretResponse =
|
|
91
|
+
* await client.senders.regenerateWebhookSecret('senderId');
|
|
92
|
+
* ```
|
|
43
93
|
*/
|
|
44
94
|
regenerateWebhookSecret(senderID, options) {
|
|
45
95
|
return this._client.post(path `/v1/senders/${senderID}/webhook/secret`, options);
|
|
46
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Update the WhatsApp Business profile for a sender. The sender must have a
|
|
99
|
+
* WhatsApp Business Account connected.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const response = await client.senders.updateProfile(
|
|
104
|
+
* 'senderId',
|
|
105
|
+
* {
|
|
106
|
+
* about: 'Succulent specialists!',
|
|
107
|
+
* description:
|
|
108
|
+
* 'We specialize in providing high-quality succulents.',
|
|
109
|
+
* email: 'contact@example.com',
|
|
110
|
+
* vertical: 'RETAIL',
|
|
111
|
+
* websites: ['https://www.example.com'],
|
|
112
|
+
* },
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
updateProfile(senderID, body, options) {
|
|
117
|
+
return this._client.patch(path `/v1/senders/${senderID}/profile`, { body, ...options });
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Upload a new profile picture for the WhatsApp Business profile. The image will
|
|
121
|
+
* be uploaded to Meta and set as the profile picture.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* const response = await client.senders.uploadProfilePicture(
|
|
126
|
+
* 'senderId',
|
|
127
|
+
* {
|
|
128
|
+
* imageUrl: 'https://example.com/profile.jpg',
|
|
129
|
+
* mimeType: 'image/jpeg',
|
|
130
|
+
* },
|
|
131
|
+
* );
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
uploadProfilePicture(senderID, body, options) {
|
|
135
|
+
return this._client.post(path `/v1/senders/${senderID}/profile/picture`, { body, ...options });
|
|
136
|
+
}
|
|
47
137
|
}
|
|
48
138
|
//# sourceMappingURL=senders.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senders.mjs","sourceRoot":"","sources":["../src/resources/senders.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"senders.mjs","sourceRoot":"","sources":["../src/resources/senders.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;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EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;CACF"}
|
|
@@ -51,6 +51,20 @@ export declare class Templates extends APIResource {
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
delete(templateID: string, options?: RequestOptions): APIPromise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Submit a WhatsApp template to Meta for approval. The template must be in draft
|
|
56
|
+
* status and associated with a sender that has a WhatsApp Business Account
|
|
57
|
+
* configured.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const template = await client.templates.submit(
|
|
62
|
+
* 'templateId',
|
|
63
|
+
* { senderId: 'sender_abc123', category: 'UTILITY' },
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
submit(templateID: string, body: TemplateSubmitParams, options?: RequestOptions): APIPromise<Template>;
|
|
54
68
|
}
|
|
55
69
|
export type TemplatesCursor = Cursor<Template>;
|
|
56
70
|
export interface Template {
|
|
@@ -140,7 +154,17 @@ export interface TemplateCreateParams {
|
|
|
140
154
|
}
|
|
141
155
|
export interface TemplateListParams extends CursorParams {
|
|
142
156
|
}
|
|
157
|
+
export interface TemplateSubmitParams {
|
|
158
|
+
/**
|
|
159
|
+
* The sender ID with the WhatsApp Business Account to submit the template to.
|
|
160
|
+
*/
|
|
161
|
+
senderId: string;
|
|
162
|
+
/**
|
|
163
|
+
* Template category. If not provided, uses the category set on the template.
|
|
164
|
+
*/
|
|
165
|
+
category?: WhatsappCategory;
|
|
166
|
+
}
|
|
143
167
|
export declare namespace Templates {
|
|
144
|
-
export { type Template as Template, type WhatsappCategory as WhatsappCategory, type TemplatesCursor as TemplatesCursor, type TemplateCreateParams as TemplateCreateParams, type TemplateListParams as TemplateListParams, };
|
|
168
|
+
export { type Template as Template, type WhatsappCategory as WhatsappCategory, type TemplatesCursor as TemplatesCursor, type TemplateCreateParams as TemplateCreateParams, type TemplateListParams as TemplateListParams, type TemplateSubmitParams as TemplateSubmitParams, };
|
|
145
169
|
}
|
|
146
170
|
//# sourceMappingURL=templates.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.mts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAI5E;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,eAAe,EAAE,QAAQ,CAAC;IAIzC;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.d.mts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IA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AAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/templates.d.ts
CHANGED
|
@@ -51,6 +51,20 @@ export declare class Templates extends APIResource {
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
delete(templateID: string, options?: RequestOptions): APIPromise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Submit a WhatsApp template to Meta for approval. The template must be in draft
|
|
56
|
+
* status and associated with a sender that has a WhatsApp Business Account
|
|
57
|
+
* configured.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const template = await client.templates.submit(
|
|
62
|
+
* 'templateId',
|
|
63
|
+
* { senderId: 'sender_abc123', category: 'UTILITY' },
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
submit(templateID: string, body: TemplateSubmitParams, options?: RequestOptions): APIPromise<Template>;
|
|
54
68
|
}
|
|
55
69
|
export type TemplatesCursor = Cursor<Template>;
|
|
56
70
|
export interface Template {
|
|
@@ -140,7 +154,17 @@ export interface TemplateCreateParams {
|
|
|
140
154
|
}
|
|
141
155
|
export interface TemplateListParams extends CursorParams {
|
|
142
156
|
}
|
|
157
|
+
export interface TemplateSubmitParams {
|
|
158
|
+
/**
|
|
159
|
+
* The sender ID with the WhatsApp Business Account to submit the template to.
|
|
160
|
+
*/
|
|
161
|
+
senderId: string;
|
|
162
|
+
/**
|
|
163
|
+
* Template category. If not provided, uses the category set on the template.
|
|
164
|
+
*/
|
|
165
|
+
category?: WhatsappCategory;
|
|
166
|
+
}
|
|
143
167
|
export declare namespace Templates {
|
|
144
|
-
export { type Template as Template, type WhatsappCategory as WhatsappCategory, type TemplatesCursor as TemplatesCursor, type TemplateCreateParams as TemplateCreateParams, type TemplateListParams as TemplateListParams, };
|
|
168
|
+
export { type Template as Template, type WhatsappCategory as WhatsappCategory, type TemplatesCursor as TemplatesCursor, type TemplateCreateParams as TemplateCreateParams, type TemplateListParams as TemplateListParams, type TemplateSubmitParams as TemplateSubmitParams, };
|
|
145
169
|
}
|
|
146
170
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAI5E;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,eAAe,EAAE,QAAQ,CAAC;IAIzC;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;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,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/templates.js
CHANGED
|
@@ -66,6 +66,22 @@ class Templates extends resource_1.APIResource {
|
|
|
66
66
|
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Submit a WhatsApp template to Meta for approval. The template must be in draft
|
|
71
|
+
* status and associated with a sender that has a WhatsApp Business Account
|
|
72
|
+
* configured.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const template = await client.templates.submit(
|
|
77
|
+
* 'templateId',
|
|
78
|
+
* { senderId: 'sender_abc123', category: 'UTILITY' },
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
submit(templateID, body, options) {
|
|
83
|
+
return this._client.post((0, path_1.path) `/v1/templates/${templateID}/submit`, { body, ...options });
|
|
84
|
+
}
|
|
69
85
|
}
|
|
70
86
|
exports.Templates = Templates;
|
|
71
87
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAC5E,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA0B,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAkB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,EAAE,EAAE,OAAO,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BAAgB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,UAAkB,EAAE,IAA0B,EAAE,OAAwB;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AAnFD,8BAmFC"}
|
package/resources/templates.mjs
CHANGED
|
@@ -63,5 +63,21 @@ export class Templates extends APIResource {
|
|
|
63
63
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Submit a WhatsApp template to Meta for approval. The template must be in draft
|
|
68
|
+
* status and associated with a sender that has a WhatsApp Business Account
|
|
69
|
+
* configured.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const template = await client.templates.submit(
|
|
74
|
+
* 'templateId',
|
|
75
|
+
* { senderId: 'sender_abc123', category: 'UTILITY' },
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
submit(templateID, body, options) {
|
|
80
|
+
return this._client.post(path `/v1/templates/${templateID}/submit`, { body, ...options });
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
//# sourceMappingURL=templates.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA0B,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAkB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,MAAgB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,iBAAiB,UAAU,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE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
CHANGED
|
@@ -68,16 +68,24 @@ import {
|
|
|
68
68
|
SenderCreateParams,
|
|
69
69
|
SenderListParams,
|
|
70
70
|
SenderUpdateParams,
|
|
71
|
+
SenderUpdateProfileParams,
|
|
72
|
+
SenderUpdateProfileResponse,
|
|
73
|
+
SenderUploadProfilePictureParams,
|
|
74
|
+
SenderUploadProfilePictureResponse,
|
|
71
75
|
SenderWebhook,
|
|
72
76
|
Senders,
|
|
73
77
|
SendersCursor,
|
|
74
78
|
WebhookEvent,
|
|
75
79
|
WebhookSecretResponse,
|
|
80
|
+
WhatsappBusinessProfile,
|
|
81
|
+
WhatsappBusinessProfileResponse,
|
|
82
|
+
WhatsappBusinessProfileVertical,
|
|
76
83
|
} from './resources/senders';
|
|
77
84
|
import {
|
|
78
85
|
Template,
|
|
79
86
|
TemplateCreateParams,
|
|
80
87
|
TemplateListParams,
|
|
88
|
+
TemplateSubmitParams,
|
|
81
89
|
Templates,
|
|
82
90
|
TemplatesCursor,
|
|
83
91
|
WhatsappCategory,
|
|
@@ -863,6 +871,7 @@ export declare namespace Zavudev {
|
|
|
863
871
|
type TemplatesCursor as TemplatesCursor,
|
|
864
872
|
type TemplateCreateParams as TemplateCreateParams,
|
|
865
873
|
type TemplateListParams as TemplateListParams,
|
|
874
|
+
type TemplateSubmitParams as TemplateSubmitParams,
|
|
866
875
|
};
|
|
867
876
|
|
|
868
877
|
export {
|
|
@@ -871,10 +880,17 @@ export declare namespace Zavudev {
|
|
|
871
880
|
type SenderWebhook as SenderWebhook,
|
|
872
881
|
type WebhookEvent as WebhookEvent,
|
|
873
882
|
type WebhookSecretResponse as WebhookSecretResponse,
|
|
883
|
+
type WhatsappBusinessProfile as WhatsappBusinessProfile,
|
|
884
|
+
type WhatsappBusinessProfileResponse as WhatsappBusinessProfileResponse,
|
|
885
|
+
type WhatsappBusinessProfileVertical as WhatsappBusinessProfileVertical,
|
|
886
|
+
type SenderUpdateProfileResponse as SenderUpdateProfileResponse,
|
|
887
|
+
type SenderUploadProfilePictureResponse as SenderUploadProfilePictureResponse,
|
|
874
888
|
type SendersCursor as SendersCursor,
|
|
875
889
|
type SenderCreateParams as SenderCreateParams,
|
|
876
890
|
type SenderUpdateParams as SenderUpdateParams,
|
|
877
891
|
type SenderListParams as SenderListParams,
|
|
892
|
+
type SenderUpdateProfileParams as SenderUpdateProfileParams,
|
|
893
|
+
type SenderUploadProfilePictureParams as SenderUploadProfilePictureParams,
|
|
878
894
|
};
|
|
879
895
|
|
|
880
896
|
export {
|
package/src/resources/index.ts
CHANGED
|
@@ -73,9 +73,16 @@ export {
|
|
|
73
73
|
type SenderWebhook,
|
|
74
74
|
type WebhookEvent,
|
|
75
75
|
type WebhookSecretResponse,
|
|
76
|
+
type WhatsappBusinessProfile,
|
|
77
|
+
type WhatsappBusinessProfileResponse,
|
|
78
|
+
type WhatsappBusinessProfileVertical,
|
|
79
|
+
type SenderUpdateProfileResponse,
|
|
80
|
+
type SenderUploadProfilePictureResponse,
|
|
76
81
|
type SenderCreateParams,
|
|
77
82
|
type SenderUpdateParams,
|
|
78
83
|
type SenderListParams,
|
|
84
|
+
type SenderUpdateProfileParams,
|
|
85
|
+
type SenderUploadProfilePictureParams,
|
|
79
86
|
type SendersCursor,
|
|
80
87
|
} from './senders';
|
|
81
88
|
export {
|
|
@@ -84,5 +91,6 @@ export {
|
|
|
84
91
|
type WhatsappCategory,
|
|
85
92
|
type TemplateCreateParams,
|
|
86
93
|
type TemplateListParams,
|
|
94
|
+
type TemplateSubmitParams,
|
|
87
95
|
type TemplatesCursor,
|
|
88
96
|
} from './templates';
|