@sentdm/sentdm 0.7.2 → 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 +132 -0
- package/README.md +71 -34
- package/client.d.mts +49 -21
- package/client.d.mts.map +1 -1
- package/client.d.ts +49 -21
- package/client.d.ts.map +1 -1
- package/client.js +52 -38
- package/client.js.map +1 -1
- package/client.mjs +52 -38
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +0 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +0 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/contacts.d.mts +243 -49
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +243 -49
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +112 -15
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +112 -15
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.mts +8 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +269 -0
- package/resources/me.d.mts.map +1 -0
- package/resources/me.d.ts +269 -0
- package/resources/me.d.ts.map +1 -0
- package/resources/me.js +40 -0
- package/resources/me.js.map +1 -0
- package/resources/me.mjs +36 -0
- package/resources/me.mjs.map +1 -0
- package/resources/messages.d.mts +239 -133
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +239 -133
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +42 -50
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +42 -50
- package/resources/messages.mjs.map +1 -1
- package/resources/numbers.d.mts +70 -0
- package/resources/numbers.d.mts.map +1 -0
- package/resources/numbers.d.ts +70 -0
- package/resources/numbers.d.ts.map +1 -0
- package/resources/numbers.js +36 -0
- package/resources/numbers.js.map +1 -0
- package/resources/numbers.mjs +32 -0
- package/resources/numbers.mjs.map +1 -0
- package/resources/profiles/campaigns.d.mts +339 -0
- package/resources/profiles/campaigns.d.mts.map +1 -0
- package/resources/profiles/campaigns.d.ts +339 -0
- package/resources/profiles/campaigns.d.ts.map +1 -0
- package/resources/profiles/campaigns.js +148 -0
- package/resources/profiles/campaigns.js.map +1 -0
- package/resources/profiles/campaigns.mjs +144 -0
- package/resources/profiles/campaigns.mjs.map +1 -0
- package/resources/profiles/index.d.mts +3 -0
- package/resources/profiles/index.d.mts.map +1 -0
- package/resources/profiles/index.d.ts +3 -0
- package/resources/profiles/index.d.ts.map +1 -0
- package/resources/profiles/index.js +9 -0
- package/resources/profiles/index.js.map +1 -0
- package/resources/profiles/index.mjs +4 -0
- package/resources/profiles/index.mjs.map +1 -0
- package/resources/profiles/profiles.d.mts +967 -0
- package/resources/profiles/profiles.d.mts.map +1 -0
- package/resources/profiles/profiles.d.ts +967 -0
- package/resources/profiles/profiles.d.ts.map +1 -0
- package/resources/profiles/profiles.js +227 -0
- package/resources/profiles/profiles.js.map +1 -0
- package/resources/profiles/profiles.mjs +222 -0
- package/resources/profiles/profiles.mjs.map +1 -0
- package/resources/profiles.d.mts +2 -0
- package/resources/profiles.d.mts.map +1 -0
- package/resources/profiles.d.ts +2 -0
- package/resources/profiles.d.ts.map +1 -0
- package/resources/profiles.js +6 -0
- package/resources/profiles.js.map +1 -0
- package/resources/profiles.mjs +3 -0
- package/resources/profiles.mjs.map +1 -0
- package/resources/templates.d.mts +327 -191
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +327 -191
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +80 -35
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +80 -35
- package/resources/templates.mjs.map +1 -1
- package/resources/users.d.mts +251 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +251 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +124 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +120 -0
- package/resources/users.mjs.map +1 -0
- package/resources/webhooks.d.mts +639 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +639 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +237 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +233 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +228 -80
- package/src/internal/utils/log.ts +0 -1
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/contacts.ts +335 -57
- package/src/resources/index.ts +81 -12
- package/src/resources/me.ts +333 -0
- package/src/resources/messages.ts +306 -147
- package/src/resources/numbers.ts +102 -0
- package/src/resources/profiles/campaigns.ts +501 -0
- package/src/resources/profiles/index.ts +38 -0
- package/src/resources/profiles/profiles.ts +1302 -0
- package/src/resources/profiles.ts +3 -0
- package/src/resources/templates.ts +424 -202
- package/src/resources/users.ts +366 -0
- package/src/resources/webhooks.ts +923 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/number-lookup.d.mts +0 -59
- package/resources/number-lookup.d.mts.map +0 -1
- package/resources/number-lookup.d.ts +0 -59
- package/resources/number-lookup.d.ts.map +0 -1
- package/resources/number-lookup.js +0 -17
- package/resources/number-lookup.js.map +0 -1
- package/resources/number-lookup.mjs +0 -13
- package/resources/number-lookup.mjs.map +0 -1
- package/src/resources/number-lookup.ts +0 -80
package/resources/templates.d.ts
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
2
|
import * as TemplatesAPI from "./templates.js";
|
|
3
|
+
import * as WebhooksAPI from "./webhooks.js";
|
|
3
4
|
import { APIPromise } from "../core/api-promise.js";
|
|
4
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
+
/**
|
|
7
|
+
* Manage message templates with variable substitution
|
|
8
|
+
*/
|
|
5
9
|
export declare class Templates extends APIResource {
|
|
6
10
|
/**
|
|
7
|
-
* Creates a new message template
|
|
8
|
-
* template
|
|
9
|
-
*
|
|
10
|
-
* category). Optionally submits the template for WhatsApp review. The customer ID
|
|
11
|
-
* is extracted from the authentication token.
|
|
11
|
+
* Creates a new message template with header, body, footer, and buttons. The
|
|
12
|
+
* template can be submitted for review immediately or saved as draft for later
|
|
13
|
+
* submission.
|
|
12
14
|
*
|
|
13
15
|
* @example
|
|
14
16
|
* ```ts
|
|
15
|
-
* const
|
|
16
|
-
*
|
|
17
|
-
|
|
17
|
+
* const apiResponseTemplate = await client.templates.create();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(params: TemplateCreateParams, options?: RequestOptions): APIPromise<APIResponseTemplate>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a specific template by its ID. Returns template details including
|
|
23
|
+
* name, category, language, status, and definition.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const apiResponseTemplate = await client.templates.retrieve(
|
|
28
|
+
* '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
29
|
+
* );
|
|
18
30
|
* ```
|
|
19
31
|
*/
|
|
20
|
-
|
|
32
|
+
retrieve(id: string, params?: TemplateRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseTemplate>;
|
|
21
33
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* headers, body, footer, and interactive buttons. The customer ID is extracted
|
|
25
|
-
* from the authentication token.
|
|
34
|
+
* Updates an existing template's name, category, language, definition, or submits
|
|
35
|
+
* it for review.
|
|
26
36
|
*
|
|
27
37
|
* @example
|
|
28
38
|
* ```ts
|
|
29
|
-
* const
|
|
39
|
+
* const apiResponseTemplate = await client.templates.update(
|
|
30
40
|
* '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
31
41
|
* );
|
|
32
42
|
* ```
|
|
33
43
|
*/
|
|
34
|
-
|
|
44
|
+
update(id: string, params: TemplateUpdateParams, options?: RequestOptions): APIPromise<APIResponseTemplate>;
|
|
35
45
|
/**
|
|
36
|
-
* Retrieves
|
|
37
|
-
*
|
|
38
|
-
* interactive buttons. Supports advanced filtering by search term, status, and
|
|
39
|
-
* category, plus pagination. The customer ID is extracted from the authentication
|
|
40
|
-
* token.
|
|
46
|
+
* Retrieves a paginated list of message templates for the authenticated customer.
|
|
47
|
+
* Supports filtering by status, category, and search term.
|
|
41
48
|
*
|
|
42
49
|
* @example
|
|
43
50
|
* ```ts
|
|
44
51
|
* const templates = await client.templates.list({
|
|
45
52
|
* page: 0,
|
|
46
|
-
*
|
|
53
|
+
* page_size: 0,
|
|
47
54
|
* });
|
|
48
55
|
* ```
|
|
49
56
|
*/
|
|
50
|
-
list(
|
|
57
|
+
list(params: TemplateListParams, options?: RequestOptions): APIPromise<TemplateListResponse>;
|
|
51
58
|
/**
|
|
52
|
-
* Deletes a
|
|
53
|
-
*
|
|
54
|
-
* template has NO messages: Permanently deleted from database (hard delete). - If
|
|
55
|
-
* template has messages: Marked as deleted but preserved for message history (soft
|
|
56
|
-
* delete with snapshot). The template must exist and belong to the authenticated
|
|
57
|
-
* customer to be deleted successfully. The customer ID is extracted from the
|
|
58
|
-
* authentication token.
|
|
59
|
+
* Deletes a template by ID. Optionally, you can also delete the template from
|
|
60
|
+
* WhatsApp/Meta by setting delete_from_meta=true.
|
|
59
61
|
*
|
|
60
62
|
* @example
|
|
61
63
|
* ```ts
|
|
@@ -64,201 +66,208 @@ export declare class Templates extends APIResource {
|
|
|
64
66
|
* );
|
|
65
67
|
* ```
|
|
66
68
|
*/
|
|
67
|
-
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
69
|
+
delete(id: string, params: TemplateDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
68
70
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Standard API response envelope for all v3 endpoints
|
|
73
|
+
*/
|
|
74
|
+
export interface APIResponseTemplate {
|
|
75
|
+
/**
|
|
76
|
+
* Template response for v3 API
|
|
77
|
+
*/
|
|
78
|
+
data?: Template | null;
|
|
79
|
+
/**
|
|
80
|
+
* Error information
|
|
81
|
+
*/
|
|
82
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
83
|
+
/**
|
|
84
|
+
* Request and response metadata
|
|
85
|
+
*/
|
|
86
|
+
meta?: WebhooksAPI.APIMeta;
|
|
87
|
+
/**
|
|
88
|
+
* Indicates whether the request was successful
|
|
89
|
+
*/
|
|
90
|
+
success?: boolean;
|
|
73
91
|
}
|
|
74
92
|
/**
|
|
75
|
-
*
|
|
76
|
-
* buttons
|
|
93
|
+
* Configuration for AUTHENTICATION category templates
|
|
77
94
|
*/
|
|
78
|
-
export interface
|
|
95
|
+
export interface SentDmServicesCommonContractsPocOsAuthenticationConfig {
|
|
79
96
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
97
|
+
* Whether to add the security recommendation text: "For your security, do not
|
|
98
|
+
* share this code."
|
|
82
99
|
*/
|
|
83
|
-
|
|
100
|
+
addSecurityRecommendation?: boolean;
|
|
84
101
|
/**
|
|
85
|
-
*
|
|
102
|
+
* Code expiration time in minutes (1-90). If set, adds footer: "This code expires
|
|
103
|
+
* in X minutes."
|
|
86
104
|
*/
|
|
87
|
-
|
|
105
|
+
codeExpirationMinutes?: number | null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Body section of a message template with channel-specific content
|
|
109
|
+
*/
|
|
110
|
+
export interface SentDmServicesCommonContractsPocOsTemplateBody {
|
|
88
111
|
/**
|
|
89
|
-
*
|
|
112
|
+
* Content that will be used for all channels (SMS and WhatsApp) unless
|
|
113
|
+
* channel-specific content is provided
|
|
90
114
|
*/
|
|
91
|
-
|
|
115
|
+
multiChannel?: TemplateBodyContent | null;
|
|
92
116
|
/**
|
|
93
|
-
*
|
|
117
|
+
* SMS-specific content that overrides multi-channel content for SMS messages
|
|
94
118
|
*/
|
|
95
|
-
|
|
119
|
+
sms?: TemplateBodyContent | null;
|
|
96
120
|
/**
|
|
97
|
-
*
|
|
121
|
+
* WhatsApp-specific content that overrides multi-channel content for WhatsApp
|
|
122
|
+
* messages
|
|
98
123
|
*/
|
|
99
|
-
|
|
124
|
+
whatsapp?: TemplateBodyContent | null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Interactive button in a message template
|
|
128
|
+
*/
|
|
129
|
+
export interface SentDmServicesCommonContractsPocOsTemplateButton {
|
|
130
|
+
/**
|
|
131
|
+
* The unique identifier of the button (1-based index)
|
|
132
|
+
*/
|
|
133
|
+
id?: number;
|
|
100
134
|
/**
|
|
101
|
-
*
|
|
135
|
+
* Properties specific to the button type
|
|
102
136
|
*/
|
|
103
|
-
|
|
137
|
+
props?: SentDmServicesCommonContractsPocOsTemplateButtonProps;
|
|
138
|
+
/**
|
|
139
|
+
* The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
|
|
140
|
+
*/
|
|
141
|
+
type?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface SentDmServicesCommonContractsPocOsTemplateButtonProps {
|
|
144
|
+
activeFor?: number | null;
|
|
145
|
+
autofillText?: string | null;
|
|
146
|
+
countryCode?: string | null;
|
|
147
|
+
offerCode?: string | null;
|
|
148
|
+
otpType?: string | null;
|
|
149
|
+
packageName?: string | null;
|
|
150
|
+
phoneNumber?: string | null;
|
|
151
|
+
quickReplyType?: string | null;
|
|
152
|
+
signatureHash?: string | null;
|
|
153
|
+
text?: string | null;
|
|
154
|
+
url?: string | null;
|
|
155
|
+
urlType?: string | null;
|
|
104
156
|
}
|
|
105
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Footer section of a message template
|
|
159
|
+
*/
|
|
160
|
+
export interface SentDmServicesCommonContractsPocOsTemplateFooter {
|
|
106
161
|
/**
|
|
107
|
-
*
|
|
108
|
-
* SMS-specific, or WhatsApp-specific)
|
|
162
|
+
* The footer template text with optional variable placeholders
|
|
109
163
|
*/
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Content that will be used for all channels (SMS and WhatsApp) unless
|
|
113
|
-
* channel-specific content is provided
|
|
114
|
-
*/
|
|
115
|
-
multiChannel?: TemplatesAPI.TemplateBodyContent | null;
|
|
116
|
-
/**
|
|
117
|
-
* SMS-specific content that overrides multi-channel content for SMS messages
|
|
118
|
-
*/
|
|
119
|
-
sms?: TemplatesAPI.TemplateBodyContent | null;
|
|
120
|
-
/**
|
|
121
|
-
* WhatsApp-specific content that overrides multi-channel content for WhatsApp
|
|
122
|
-
* messages
|
|
123
|
-
*/
|
|
124
|
-
whatsapp?: TemplatesAPI.TemplateBodyContent | null;
|
|
125
|
-
}
|
|
164
|
+
template?: string;
|
|
126
165
|
/**
|
|
127
|
-
*
|
|
166
|
+
* The type of footer (typically "text")
|
|
128
167
|
*/
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Whether to add the security recommendation text: "For your security, do not
|
|
132
|
-
* share this code."
|
|
133
|
-
*/
|
|
134
|
-
addSecurityRecommendation?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Code expiration time in minutes (1-90). If set, adds footer: "This code expires
|
|
137
|
-
* in X minutes."
|
|
138
|
-
*/
|
|
139
|
-
codeExpirationMinutes?: number | null;
|
|
140
|
-
}
|
|
168
|
+
type?: string | null;
|
|
141
169
|
/**
|
|
142
|
-
*
|
|
170
|
+
* List of variables used in the footer template
|
|
143
171
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* Properties specific to the button type
|
|
151
|
-
*/
|
|
152
|
-
props?: Button.Props;
|
|
153
|
-
/**
|
|
154
|
-
* The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
|
|
155
|
-
*/
|
|
156
|
-
type?: string;
|
|
157
|
-
}
|
|
158
|
-
namespace Button {
|
|
159
|
-
/**
|
|
160
|
-
* Properties specific to the button type
|
|
161
|
-
*/
|
|
162
|
-
interface Props {
|
|
163
|
-
activeFor?: number | null;
|
|
164
|
-
autofillText?: string | null;
|
|
165
|
-
countryCode?: string | null;
|
|
166
|
-
offerCode?: string | null;
|
|
167
|
-
otpType?: string | null;
|
|
168
|
-
packageName?: string | null;
|
|
169
|
-
phoneNumber?: string | null;
|
|
170
|
-
quickReplyType?: string | null;
|
|
171
|
-
signatureHash?: string | null;
|
|
172
|
-
text?: string | null;
|
|
173
|
-
url?: string | null;
|
|
174
|
-
urlType?: string | null;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
172
|
+
variables?: Array<TemplateVariable> | null;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Header section of a message template
|
|
176
|
+
*/
|
|
177
|
+
export interface SentDmServicesCommonContractsPocOsTemplateHeader {
|
|
177
178
|
/**
|
|
178
|
-
*
|
|
179
|
+
* The header template text with optional variable placeholders (e.g., "Welcome to
|
|
180
|
+
* {{0:variable}}")
|
|
179
181
|
*/
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The footer template text with optional variable placeholders
|
|
183
|
-
*/
|
|
184
|
-
template?: string;
|
|
185
|
-
/**
|
|
186
|
-
* The type of footer (typically "text")
|
|
187
|
-
*/
|
|
188
|
-
type?: string | null;
|
|
189
|
-
/**
|
|
190
|
-
* List of variables used in the footer template
|
|
191
|
-
*/
|
|
192
|
-
variables?: Array<TemplatesAPI.TemplateVariable> | null;
|
|
193
|
-
}
|
|
182
|
+
template?: string;
|
|
194
183
|
/**
|
|
195
|
-
*
|
|
184
|
+
* The type of header (e.g., "text", "image", "video", "document")
|
|
196
185
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
template?: string;
|
|
203
|
-
/**
|
|
204
|
-
* The type of header (e.g., "text", "image", "video", "document")
|
|
205
|
-
*/
|
|
206
|
-
type?: string | null;
|
|
207
|
-
/**
|
|
208
|
-
* List of variables used in the header template
|
|
209
|
-
*/
|
|
210
|
-
variables?: Array<TemplatesAPI.TemplateVariable> | null;
|
|
211
|
-
}
|
|
186
|
+
type?: string | null;
|
|
187
|
+
/**
|
|
188
|
+
* List of variables used in the header template
|
|
189
|
+
*/
|
|
190
|
+
variables?: Array<TemplateVariable> | null;
|
|
212
191
|
}
|
|
213
192
|
/**
|
|
214
|
-
*
|
|
215
|
-
* structure
|
|
193
|
+
* Template response for v3 API
|
|
216
194
|
*/
|
|
217
|
-
export interface
|
|
195
|
+
export interface Template {
|
|
218
196
|
/**
|
|
219
|
-
*
|
|
197
|
+
* Unique template identifier
|
|
220
198
|
*/
|
|
221
199
|
id?: string;
|
|
222
200
|
/**
|
|
223
|
-
*
|
|
201
|
+
* Template category: MARKETING, UTILITY, AUTHENTICATION
|
|
224
202
|
*/
|
|
225
203
|
category?: string;
|
|
226
204
|
/**
|
|
227
|
-
*
|
|
205
|
+
* Supported channels: sms, whatsapp
|
|
228
206
|
*/
|
|
229
|
-
|
|
207
|
+
channels?: Array<string> | null;
|
|
230
208
|
/**
|
|
231
|
-
*
|
|
209
|
+
* When the template was created
|
|
232
210
|
*/
|
|
233
|
-
|
|
211
|
+
created_at?: string;
|
|
234
212
|
/**
|
|
235
|
-
*
|
|
213
|
+
* Whether the template is published and active
|
|
236
214
|
*/
|
|
237
|
-
|
|
215
|
+
is_published?: boolean;
|
|
238
216
|
/**
|
|
239
|
-
*
|
|
217
|
+
* Template language code (e.g., en_US)
|
|
240
218
|
*/
|
|
241
|
-
|
|
219
|
+
language?: string;
|
|
242
220
|
/**
|
|
243
|
-
*
|
|
221
|
+
* Template display name
|
|
244
222
|
*/
|
|
245
|
-
|
|
223
|
+
name?: string;
|
|
246
224
|
/**
|
|
247
|
-
*
|
|
225
|
+
* Template status: APPROVED, PENDING, REJECTED
|
|
248
226
|
*/
|
|
249
227
|
status?: string;
|
|
250
228
|
/**
|
|
251
|
-
*
|
|
229
|
+
* When the template was last updated
|
|
252
230
|
*/
|
|
253
|
-
|
|
231
|
+
updated_at?: string | null;
|
|
254
232
|
/**
|
|
255
|
-
*
|
|
233
|
+
* Template variables for personalization
|
|
256
234
|
*/
|
|
257
|
-
|
|
235
|
+
variables?: Array<string> | null;
|
|
236
|
+
}
|
|
237
|
+
export interface TemplateBodyContent {
|
|
238
|
+
template?: string;
|
|
239
|
+
type?: string | null;
|
|
240
|
+
variables?: Array<TemplateVariable> | null;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Complete definition of a message template including header, body, footer, and
|
|
244
|
+
* buttons
|
|
245
|
+
*/
|
|
246
|
+
export interface TemplateDefinition {
|
|
258
247
|
/**
|
|
259
|
-
*
|
|
248
|
+
* Body section of a message template with channel-specific content
|
|
260
249
|
*/
|
|
261
|
-
|
|
250
|
+
body: SentDmServicesCommonContractsPocOsTemplateBody;
|
|
251
|
+
/**
|
|
252
|
+
* Configuration for AUTHENTICATION category templates
|
|
253
|
+
*/
|
|
254
|
+
authenticationConfig?: SentDmServicesCommonContractsPocOsAuthenticationConfig | null;
|
|
255
|
+
/**
|
|
256
|
+
* Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
|
|
257
|
+
*/
|
|
258
|
+
buttons?: Array<SentDmServicesCommonContractsPocOsTemplateButton> | null;
|
|
259
|
+
/**
|
|
260
|
+
* The version of the template definition format
|
|
261
|
+
*/
|
|
262
|
+
definitionVersion?: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* Footer section of a message template
|
|
265
|
+
*/
|
|
266
|
+
footer?: SentDmServicesCommonContractsPocOsTemplateFooter | null;
|
|
267
|
+
/**
|
|
268
|
+
* Header section of a message template
|
|
269
|
+
*/
|
|
270
|
+
header?: SentDmServicesCommonContractsPocOsTemplateHeader | null;
|
|
262
271
|
}
|
|
263
272
|
export interface TemplateVariable {
|
|
264
273
|
id?: number;
|
|
@@ -270,64 +279,191 @@ export declare namespace TemplateVariable {
|
|
|
270
279
|
interface Props {
|
|
271
280
|
alt?: string | null;
|
|
272
281
|
mediaType?: string | null;
|
|
282
|
+
regex?: string | null;
|
|
273
283
|
sample?: string | null;
|
|
274
284
|
shortUrl?: string | null;
|
|
275
285
|
url?: string | null;
|
|
276
286
|
variableType?: string | null;
|
|
277
287
|
}
|
|
278
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Standard API response envelope for all v3 endpoints
|
|
291
|
+
*/
|
|
279
292
|
export interface TemplateListResponse {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
293
|
+
/**
|
|
294
|
+
* Paginated list of templates
|
|
295
|
+
*/
|
|
296
|
+
data?: TemplateListResponse.Data | null;
|
|
297
|
+
/**
|
|
298
|
+
* Error information
|
|
299
|
+
*/
|
|
300
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
301
|
+
/**
|
|
302
|
+
* Request and response metadata
|
|
303
|
+
*/
|
|
304
|
+
meta?: WebhooksAPI.APIMeta;
|
|
305
|
+
/**
|
|
306
|
+
* Indicates whether the request was successful
|
|
307
|
+
*/
|
|
308
|
+
success?: boolean;
|
|
309
|
+
}
|
|
310
|
+
export declare namespace TemplateListResponse {
|
|
311
|
+
/**
|
|
312
|
+
* Paginated list of templates
|
|
313
|
+
*/
|
|
314
|
+
interface Data {
|
|
315
|
+
/**
|
|
316
|
+
* Pagination metadata for list responses
|
|
317
|
+
*/
|
|
318
|
+
pagination?: WebhooksAPI.PaginationMeta;
|
|
319
|
+
/**
|
|
320
|
+
* List of templates
|
|
321
|
+
*/
|
|
322
|
+
templates?: Array<TemplatesAPI.Template>;
|
|
323
|
+
}
|
|
285
324
|
}
|
|
286
325
|
export interface TemplateCreateParams {
|
|
287
326
|
/**
|
|
288
|
-
*
|
|
327
|
+
* Body param: Template category: MARKETING, UTILITY, AUTHENTICATION (optional,
|
|
328
|
+
* auto-detected if not provided)
|
|
329
|
+
*/
|
|
330
|
+
category?: string | null;
|
|
331
|
+
/**
|
|
332
|
+
* Body param: Source of template creation (default: from-api)
|
|
289
333
|
*/
|
|
290
|
-
|
|
334
|
+
creation_source?: string | null;
|
|
335
|
+
/**
|
|
336
|
+
* Body param: Complete definition of a message template including header, body,
|
|
337
|
+
* footer, and buttons
|
|
338
|
+
*/
|
|
339
|
+
definition?: TemplateDefinition;
|
|
340
|
+
/**
|
|
341
|
+
* Body param: Template language code (e.g., en_US) (optional, auto-detected if not
|
|
342
|
+
* provided)
|
|
343
|
+
*/
|
|
344
|
+
language?: string | null;
|
|
291
345
|
/**
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
|
|
346
|
+
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
347
|
+
* effects Useful for testing integrations without actual execution
|
|
348
|
+
*/
|
|
349
|
+
sandbox?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* Body param: Whether to submit the template for review after creation (default:
|
|
352
|
+
* false)
|
|
353
|
+
*/
|
|
354
|
+
submit_for_review?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
357
|
+
* alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
358
|
+
* hours per key per customer.
|
|
359
|
+
*/
|
|
360
|
+
'Idempotency-Key'?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
363
|
+
* organization API keys can use this header. The profile must belong to the
|
|
364
|
+
* calling organization.
|
|
365
|
+
*/
|
|
366
|
+
'x-profile-id'?: string;
|
|
367
|
+
}
|
|
368
|
+
export interface TemplateRetrieveParams {
|
|
369
|
+
/**
|
|
370
|
+
* Profile UUID to scope the request to a child profile. Only organization API keys
|
|
371
|
+
* can use this header. The profile must belong to the calling organization.
|
|
372
|
+
*/
|
|
373
|
+
'x-profile-id'?: string;
|
|
374
|
+
}
|
|
375
|
+
export interface TemplateUpdateParams {
|
|
376
|
+
/**
|
|
377
|
+
* Body param: Template category: MARKETING, UTILITY, AUTHENTICATION
|
|
295
378
|
*/
|
|
296
379
|
category?: string | null;
|
|
297
380
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
381
|
+
* Body param: Complete definition of a message template including header, body,
|
|
382
|
+
* footer, and buttons
|
|
383
|
+
*/
|
|
384
|
+
definition?: TemplateDefinition | null;
|
|
385
|
+
/**
|
|
386
|
+
* Body param: Template language code (e.g., en_US)
|
|
300
387
|
*/
|
|
301
388
|
language?: string | null;
|
|
302
389
|
/**
|
|
303
|
-
*
|
|
304
|
-
|
|
390
|
+
* Body param: Template display name
|
|
391
|
+
*/
|
|
392
|
+
name?: string | null;
|
|
393
|
+
/**
|
|
394
|
+
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
395
|
+
* effects Useful for testing integrations without actual execution
|
|
396
|
+
*/
|
|
397
|
+
sandbox?: boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Body param: Whether to submit the template for review after updating (default:
|
|
400
|
+
* false)
|
|
401
|
+
*/
|
|
402
|
+
submit_for_review?: boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
405
|
+
* alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
406
|
+
* hours per key per customer.
|
|
407
|
+
*/
|
|
408
|
+
'Idempotency-Key'?: string;
|
|
409
|
+
/**
|
|
410
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
411
|
+
* organization API keys can use this header. The profile must belong to the
|
|
412
|
+
* calling organization.
|
|
305
413
|
*/
|
|
306
|
-
|
|
414
|
+
'x-profile-id'?: string;
|
|
307
415
|
}
|
|
308
416
|
export interface TemplateListParams {
|
|
309
417
|
/**
|
|
310
|
-
*
|
|
418
|
+
* Query param: Page number (1-indexed)
|
|
311
419
|
*/
|
|
312
420
|
page: number;
|
|
313
421
|
/**
|
|
314
|
-
*
|
|
422
|
+
* Query param: Number of items per page
|
|
315
423
|
*/
|
|
316
|
-
|
|
424
|
+
page_size: number;
|
|
317
425
|
/**
|
|
318
|
-
*
|
|
426
|
+
* Query param: Optional category filter: MARKETING, UTILITY, AUTHENTICATION
|
|
319
427
|
*/
|
|
320
428
|
category?: string | null;
|
|
321
429
|
/**
|
|
322
|
-
*
|
|
430
|
+
* Query param: Optional filter by welcome playground flag
|
|
431
|
+
*/
|
|
432
|
+
is_welcome_playground?: boolean | null;
|
|
433
|
+
/**
|
|
434
|
+
* Query param: Optional search term for filtering templates
|
|
323
435
|
*/
|
|
324
436
|
search?: string | null;
|
|
325
437
|
/**
|
|
326
|
-
*
|
|
438
|
+
* Query param: Optional status filter: APPROVED, PENDING, REJECTED
|
|
327
439
|
*/
|
|
328
440
|
status?: string | null;
|
|
441
|
+
/**
|
|
442
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
443
|
+
* organization API keys can use this header. The profile must belong to the
|
|
444
|
+
* calling organization.
|
|
445
|
+
*/
|
|
446
|
+
'x-profile-id'?: string;
|
|
447
|
+
}
|
|
448
|
+
export interface TemplateDeleteParams {
|
|
449
|
+
/**
|
|
450
|
+
* Body param: Whether to also delete the template from WhatsApp/Meta (optional,
|
|
451
|
+
* defaults to false)
|
|
452
|
+
*/
|
|
453
|
+
delete_from_meta?: boolean | null;
|
|
454
|
+
/**
|
|
455
|
+
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
456
|
+
* effects Useful for testing integrations without actual execution
|
|
457
|
+
*/
|
|
458
|
+
sandbox?: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
461
|
+
* organization API keys can use this header. The profile must belong to the
|
|
462
|
+
* calling organization.
|
|
463
|
+
*/
|
|
464
|
+
'x-profile-id'?: string;
|
|
329
465
|
}
|
|
330
466
|
export declare namespace Templates {
|
|
331
|
-
export { type
|
|
467
|
+
export { type APIResponseTemplate as APIResponseTemplate, type SentDmServicesCommonContractsPocOsAuthenticationConfig as SentDmServicesCommonContractsPocOsAuthenticationConfig, type SentDmServicesCommonContractsPocOsTemplateBody as SentDmServicesCommonContractsPocOsTemplateBody, type SentDmServicesCommonContractsPocOsTemplateButton as SentDmServicesCommonContractsPocOsTemplateButton, type SentDmServicesCommonContractsPocOsTemplateButtonProps as SentDmServicesCommonContractsPocOsTemplateButtonProps, type SentDmServicesCommonContractsPocOsTemplateFooter as SentDmServicesCommonContractsPocOsTemplateFooter, type SentDmServicesCommonContractsPocOsTemplateHeader as SentDmServicesCommonContractsPocOsTemplateHeader, type Template as Template, type TemplateBodyContent as TemplateBodyContent, type TemplateDefinition as TemplateDefinition, type TemplateVariable as TemplateVariable, type TemplateListResponse as TemplateListResponse, type TemplateCreateParams as TemplateCreateParams, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateUpdateParams as TemplateUpdateParams, type TemplateListParams as TemplateListParams, type TemplateDeleteParams as TemplateDeleteParams, };
|
|
332
468
|
}
|
|
333
469
|
//# sourceMappingURL=templates.d.ts.map
|