@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAe/F;;;;;;;;;;OAUG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAWlC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAelC;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CA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S,CAAC;IACjC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,sDAAsD,IAAI,sDAAsD,EACrH,KAAK,8CAA8C,IAAI,8CAA8C,EACrG,KAAK,gDAAgD,IAAI,gDAAgD,EACzG,KAAK,qDAAqD,IAAI,qDAAqD,EACnH,KAAK,gDAAgD,IAAI,gDAAgD,EACzG,KAAK,gDAAgD,IAAI,gDAAgD,EACzG,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/templates.js
CHANGED
|
@@ -5,66 +5,106 @@ exports.Templates = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const headers_1 = require("../internal/headers.js");
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Manage message templates with variable substitution
|
|
10
|
+
*/
|
|
8
11
|
class Templates extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
|
-
* Creates a new message template
|
|
11
|
-
* template
|
|
12
|
-
*
|
|
13
|
-
* category). Optionally submits the template for WhatsApp review. The customer ID
|
|
14
|
-
* is extracted from the authentication token.
|
|
13
|
+
* Creates a new message template with header, body, footer, and buttons. The
|
|
14
|
+
* template can be submitted for review immediately or saved as draft for later
|
|
15
|
+
* submission.
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```ts
|
|
18
|
-
* const
|
|
19
|
-
*
|
|
20
|
-
|
|
19
|
+
* const apiResponseTemplate = await client.templates.create();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(params, options) {
|
|
23
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
24
|
+
return this._client.post('/v3/templates', {
|
|
25
|
+
body,
|
|
26
|
+
...options,
|
|
27
|
+
headers: (0, headers_1.buildHeaders)([
|
|
28
|
+
{
|
|
29
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
30
|
+
...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
|
|
31
|
+
},
|
|
32
|
+
options?.headers,
|
|
33
|
+
]),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a specific template by its ID. Returns template details including
|
|
38
|
+
* name, category, language, status, and definition.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const apiResponseTemplate = await client.templates.retrieve(
|
|
43
|
+
* '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
44
|
+
* );
|
|
21
45
|
* ```
|
|
22
46
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
47
|
+
retrieve(id, params = {}, options) {
|
|
48
|
+
const { 'x-profile-id': xProfileID } = params ?? {};
|
|
49
|
+
return this._client.get((0, path_1.path) `/v3/templates/${id}`, {
|
|
50
|
+
...options,
|
|
51
|
+
headers: (0, headers_1.buildHeaders)([
|
|
52
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
53
|
+
options?.headers,
|
|
54
|
+
]),
|
|
55
|
+
});
|
|
25
56
|
}
|
|
26
57
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* headers, body, footer, and interactive buttons. The customer ID is extracted
|
|
30
|
-
* from the authentication token.
|
|
58
|
+
* Updates an existing template's name, category, language, definition, or submits
|
|
59
|
+
* it for review.
|
|
31
60
|
*
|
|
32
61
|
* @example
|
|
33
62
|
* ```ts
|
|
34
|
-
* const
|
|
63
|
+
* const apiResponseTemplate = await client.templates.update(
|
|
35
64
|
* '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
36
65
|
* );
|
|
37
66
|
* ```
|
|
38
67
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
68
|
+
update(id, params, options) {
|
|
69
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
70
|
+
return this._client.put((0, path_1.path) `/v3/templates/${id}`, {
|
|
71
|
+
body,
|
|
72
|
+
...options,
|
|
73
|
+
headers: (0, headers_1.buildHeaders)([
|
|
74
|
+
{
|
|
75
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
76
|
+
...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
|
|
77
|
+
},
|
|
78
|
+
options?.headers,
|
|
79
|
+
]),
|
|
80
|
+
});
|
|
41
81
|
}
|
|
42
82
|
/**
|
|
43
|
-
* Retrieves
|
|
44
|
-
*
|
|
45
|
-
* interactive buttons. Supports advanced filtering by search term, status, and
|
|
46
|
-
* category, plus pagination. The customer ID is extracted from the authentication
|
|
47
|
-
* token.
|
|
83
|
+
* Retrieves a paginated list of message templates for the authenticated customer.
|
|
84
|
+
* Supports filtering by status, category, and search term.
|
|
48
85
|
*
|
|
49
86
|
* @example
|
|
50
87
|
* ```ts
|
|
51
88
|
* const templates = await client.templates.list({
|
|
52
89
|
* page: 0,
|
|
53
|
-
*
|
|
90
|
+
* page_size: 0,
|
|
54
91
|
* });
|
|
55
92
|
* ```
|
|
56
93
|
*/
|
|
57
|
-
list(
|
|
58
|
-
|
|
94
|
+
list(params, options) {
|
|
95
|
+
const { 'x-profile-id': xProfileID, ...query } = params;
|
|
96
|
+
return this._client.get('/v3/templates', {
|
|
97
|
+
query,
|
|
98
|
+
...options,
|
|
99
|
+
headers: (0, headers_1.buildHeaders)([
|
|
100
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
101
|
+
options?.headers,
|
|
102
|
+
]),
|
|
103
|
+
});
|
|
59
104
|
}
|
|
60
105
|
/**
|
|
61
|
-
* Deletes a
|
|
62
|
-
*
|
|
63
|
-
* template has NO messages: Permanently deleted from database (hard delete). - If
|
|
64
|
-
* template has messages: Marked as deleted but preserved for message history (soft
|
|
65
|
-
* delete with snapshot). The template must exist and belong to the authenticated
|
|
66
|
-
* customer to be deleted successfully. The customer ID is extracted from the
|
|
67
|
-
* authentication token.
|
|
106
|
+
* Deletes a template by ID. Optionally, you can also delete the template from
|
|
107
|
+
* WhatsApp/Meta by setting delete_from_meta=true.
|
|
68
108
|
*
|
|
69
109
|
* @example
|
|
70
110
|
* ```ts
|
|
@@ -73,10 +113,15 @@ class Templates extends resource_1.APIResource {
|
|
|
73
113
|
* );
|
|
74
114
|
* ```
|
|
75
115
|
*/
|
|
76
|
-
delete(id, options) {
|
|
77
|
-
|
|
116
|
+
delete(id, params, options) {
|
|
117
|
+
const { 'x-profile-id': xProfileID, ...body } = params;
|
|
118
|
+
return this._client.delete((0, path_1.path) `/v3/templates/${id}`, {
|
|
119
|
+
body,
|
|
78
120
|
...options,
|
|
79
|
-
headers: (0, headers_1.buildHeaders)([
|
|
121
|
+
headers: (0, headers_1.buildHeaders)([
|
|
122
|
+
{ Accept: '*/*', ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
123
|
+
options?.headers,
|
|
124
|
+
]),
|
|
80
125
|
});
|
|
81
126
|
}
|
|
82
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD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iBAAiB,EAAE,EAAE,EAAE;YACpD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACvF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAhID,8BAgIC"}
|
package/resources/templates.mjs
CHANGED
|
@@ -2,66 +2,106 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Manage message templates with variable substitution
|
|
7
|
+
*/
|
|
5
8
|
export class Templates extends APIResource {
|
|
6
9
|
/**
|
|
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.
|
|
10
|
+
* Creates a new message template with header, body, footer, and buttons. The
|
|
11
|
+
* template can be submitted for review immediately or saved as draft for later
|
|
12
|
+
* submission.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
|
-
* const
|
|
16
|
-
*
|
|
17
|
-
|
|
16
|
+
* const apiResponseTemplate = await client.templates.create();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(params, options) {
|
|
20
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
21
|
+
return this._client.post('/v3/templates', {
|
|
22
|
+
body,
|
|
23
|
+
...options,
|
|
24
|
+
headers: buildHeaders([
|
|
25
|
+
{
|
|
26
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
27
|
+
...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
|
|
28
|
+
},
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves a specific template by its ID. Returns template details including
|
|
35
|
+
* name, category, language, status, and definition.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const apiResponseTemplate = await client.templates.retrieve(
|
|
40
|
+
* '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
41
|
+
* );
|
|
18
42
|
* ```
|
|
19
43
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
44
|
+
retrieve(id, params = {}, options) {
|
|
45
|
+
const { 'x-profile-id': xProfileID } = params ?? {};
|
|
46
|
+
return this._client.get(path `/v3/templates/${id}`, {
|
|
47
|
+
...options,
|
|
48
|
+
headers: buildHeaders([
|
|
49
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
50
|
+
options?.headers,
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
22
53
|
}
|
|
23
54
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* headers, body, footer, and interactive buttons. The customer ID is extracted
|
|
27
|
-
* from the authentication token.
|
|
55
|
+
* Updates an existing template's name, category, language, definition, or submits
|
|
56
|
+
* it for review.
|
|
28
57
|
*
|
|
29
58
|
* @example
|
|
30
59
|
* ```ts
|
|
31
|
-
* const
|
|
60
|
+
* const apiResponseTemplate = await client.templates.update(
|
|
32
61
|
* '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
|
|
33
62
|
* );
|
|
34
63
|
* ```
|
|
35
64
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
65
|
+
update(id, params, options) {
|
|
66
|
+
const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
|
|
67
|
+
return this._client.put(path `/v3/templates/${id}`, {
|
|
68
|
+
body,
|
|
69
|
+
...options,
|
|
70
|
+
headers: buildHeaders([
|
|
71
|
+
{
|
|
72
|
+
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
|
|
73
|
+
...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
|
|
74
|
+
},
|
|
75
|
+
options?.headers,
|
|
76
|
+
]),
|
|
77
|
+
});
|
|
38
78
|
}
|
|
39
79
|
/**
|
|
40
|
-
* Retrieves
|
|
41
|
-
*
|
|
42
|
-
* interactive buttons. Supports advanced filtering by search term, status, and
|
|
43
|
-
* category, plus pagination. The customer ID is extracted from the authentication
|
|
44
|
-
* token.
|
|
80
|
+
* Retrieves a paginated list of message templates for the authenticated customer.
|
|
81
|
+
* Supports filtering by status, category, and search term.
|
|
45
82
|
*
|
|
46
83
|
* @example
|
|
47
84
|
* ```ts
|
|
48
85
|
* const templates = await client.templates.list({
|
|
49
86
|
* page: 0,
|
|
50
|
-
*
|
|
87
|
+
* page_size: 0,
|
|
51
88
|
* });
|
|
52
89
|
* ```
|
|
53
90
|
*/
|
|
54
|
-
list(
|
|
55
|
-
|
|
91
|
+
list(params, options) {
|
|
92
|
+
const { 'x-profile-id': xProfileID, ...query } = params;
|
|
93
|
+
return this._client.get('/v3/templates', {
|
|
94
|
+
query,
|
|
95
|
+
...options,
|
|
96
|
+
headers: buildHeaders([
|
|
97
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
98
|
+
options?.headers,
|
|
99
|
+
]),
|
|
100
|
+
});
|
|
56
101
|
}
|
|
57
102
|
/**
|
|
58
|
-
* Deletes a
|
|
59
|
-
*
|
|
60
|
-
* template has NO messages: Permanently deleted from database (hard delete). - If
|
|
61
|
-
* template has messages: Marked as deleted but preserved for message history (soft
|
|
62
|
-
* delete with snapshot). The template must exist and belong to the authenticated
|
|
63
|
-
* customer to be deleted successfully. The customer ID is extracted from the
|
|
64
|
-
* authentication token.
|
|
103
|
+
* Deletes a template by ID. Optionally, you can also delete the template from
|
|
104
|
+
* WhatsApp/Meta by setting delete_from_meta=true.
|
|
65
105
|
*
|
|
66
106
|
* @example
|
|
67
107
|
* ```ts
|
|
@@ -70,10 +110,15 @@ export class Templates extends APIResource {
|
|
|
70
110
|
* );
|
|
71
111
|
* ```
|
|
72
112
|
*/
|
|
73
|
-
delete(id, options) {
|
|
74
|
-
|
|
113
|
+
delete(id, params, options) {
|
|
114
|
+
const { 'x-profile-id': xProfileID, ...body } = params;
|
|
115
|
+
return this._client.delete(path `/v3/templates/${id}`, {
|
|
116
|
+
body,
|
|
75
117
|
...options,
|
|
76
|
-
headers: buildHeaders([
|
|
118
|
+
headers: buildHeaders([
|
|
119
|
+
{ Accept: '*/*', ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
120
|
+
options?.headers,
|
|
121
|
+
]),
|
|
77
122
|
});
|
|
78
123
|
}
|
|
79
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAA4B,EAAE,OAAwB;QAC3D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC1F,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE;YACxC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,cA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|
+
import * as WebhooksAPI from "./webhooks.mjs";
|
|
4
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Invite, update, and manage organization users and roles
|
|
8
|
+
*/
|
|
9
|
+
export declare class Users extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves detailed information about a specific user in an organization or
|
|
12
|
+
* profile. Requires developer role or higher.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const apiResponseOfUser = await client.users.retrieve(
|
|
17
|
+
* 'userId',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(userID: string, params?: UserRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseOfUser>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves all users who have access to the organization or profile identified by
|
|
24
|
+
* the API key, including their roles and status. Shows invited users (pending
|
|
25
|
+
* acceptance) and active users. Requires developer role or higher.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const users = await client.users.list();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(params?: UserListParams | null | undefined, options?: RequestOptions): APIPromise<UserListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Sends an invitation to a user to join the organization or profile with a
|
|
35
|
+
* specific role. Requires admin role. The user will receive an invitation email
|
|
36
|
+
* with a token to accept. Invitation tokens expire after 7 days.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const apiResponseOfUser = await client.users.invite();
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
invite(params: UserInviteParams, options?: RequestOptions): APIPromise<APIResponseOfUser>;
|
|
44
|
+
/**
|
|
45
|
+
* Removes a user's access to an organization or profile. Requires admin role. You
|
|
46
|
+
* cannot remove yourself or remove the last admin.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* await client.users.remove('userId', { body: {} });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
remove(userID: string, params: UserRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Updates a user's role in the organization or profile. Requires admin role. You
|
|
56
|
+
* cannot change your own role or demote the last admin.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const apiResponseOfUser = await client.users.updateRole(
|
|
61
|
+
* 'userId',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
updateRole(userID: string, params: UserUpdateRoleParams, options?: RequestOptions): APIPromise<APIResponseOfUser>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Standard API response envelope for all v3 endpoints
|
|
69
|
+
*/
|
|
70
|
+
export interface APIResponseOfUser {
|
|
71
|
+
/**
|
|
72
|
+
* User response for v3 API
|
|
73
|
+
*/
|
|
74
|
+
data?: UserResponse | null;
|
|
75
|
+
/**
|
|
76
|
+
* Error information
|
|
77
|
+
*/
|
|
78
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
79
|
+
/**
|
|
80
|
+
* Request and response metadata
|
|
81
|
+
*/
|
|
82
|
+
meta?: WebhooksAPI.APIMeta;
|
|
83
|
+
/**
|
|
84
|
+
* Indicates whether the request was successful
|
|
85
|
+
*/
|
|
86
|
+
success?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* User response for v3 API
|
|
90
|
+
*/
|
|
91
|
+
export interface UserResponse {
|
|
92
|
+
/**
|
|
93
|
+
* User unique identifier
|
|
94
|
+
*/
|
|
95
|
+
id?: string;
|
|
96
|
+
/**
|
|
97
|
+
* When the user was added to the organization
|
|
98
|
+
*/
|
|
99
|
+
created_at?: string;
|
|
100
|
+
/**
|
|
101
|
+
* User email address
|
|
102
|
+
*/
|
|
103
|
+
email?: string;
|
|
104
|
+
/**
|
|
105
|
+
* When the user was invited
|
|
106
|
+
*/
|
|
107
|
+
invited_at?: string | null;
|
|
108
|
+
/**
|
|
109
|
+
* When the user last logged in
|
|
110
|
+
*/
|
|
111
|
+
last_login_at?: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* User full name
|
|
114
|
+
*/
|
|
115
|
+
name?: string;
|
|
116
|
+
/**
|
|
117
|
+
* User role in the organization: admin, billing, developer
|
|
118
|
+
*/
|
|
119
|
+
role?: string;
|
|
120
|
+
/**
|
|
121
|
+
* User status: active, invited, suspended, rejected
|
|
122
|
+
*/
|
|
123
|
+
status?: string;
|
|
124
|
+
/**
|
|
125
|
+
* When the user record was last updated
|
|
126
|
+
*/
|
|
127
|
+
updated_at?: string | null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Standard API response envelope for all v3 endpoints
|
|
131
|
+
*/
|
|
132
|
+
export interface UserListResponse {
|
|
133
|
+
/**
|
|
134
|
+
* List of users response
|
|
135
|
+
*/
|
|
136
|
+
data?: UserListResponse.Data | null;
|
|
137
|
+
/**
|
|
138
|
+
* Error information
|
|
139
|
+
*/
|
|
140
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
141
|
+
/**
|
|
142
|
+
* Request and response metadata
|
|
143
|
+
*/
|
|
144
|
+
meta?: WebhooksAPI.APIMeta;
|
|
145
|
+
/**
|
|
146
|
+
* Indicates whether the request was successful
|
|
147
|
+
*/
|
|
148
|
+
success?: boolean;
|
|
149
|
+
}
|
|
150
|
+
export declare namespace UserListResponse {
|
|
151
|
+
/**
|
|
152
|
+
* List of users response
|
|
153
|
+
*/
|
|
154
|
+
interface Data {
|
|
155
|
+
/**
|
|
156
|
+
* List of users in the organization
|
|
157
|
+
*/
|
|
158
|
+
users?: Array<UsersAPI.UserResponse>;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export interface UserRetrieveParams {
|
|
162
|
+
/**
|
|
163
|
+
* Profile UUID to scope the request to a child profile. Only organization API keys
|
|
164
|
+
* can use this header. The profile must belong to the calling organization.
|
|
165
|
+
*/
|
|
166
|
+
'x-profile-id'?: string;
|
|
167
|
+
}
|
|
168
|
+
export interface UserListParams {
|
|
169
|
+
/**
|
|
170
|
+
* Profile UUID to scope the request to a child profile. Only organization API keys
|
|
171
|
+
* can use this header. The profile must belong to the calling organization.
|
|
172
|
+
*/
|
|
173
|
+
'x-profile-id'?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface UserInviteParams {
|
|
176
|
+
/**
|
|
177
|
+
* Body param: User email address (required)
|
|
178
|
+
*/
|
|
179
|
+
email?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Body param: User full name (required)
|
|
182
|
+
*/
|
|
183
|
+
name?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Body param: User role: admin, billing, or developer (required)
|
|
186
|
+
*/
|
|
187
|
+
role?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
190
|
+
* effects Useful for testing integrations without actual execution
|
|
191
|
+
*/
|
|
192
|
+
sandbox?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
195
|
+
* alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
196
|
+
* hours per key per customer.
|
|
197
|
+
*/
|
|
198
|
+
'Idempotency-Key'?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
201
|
+
* organization API keys can use this header. The profile must belong to the
|
|
202
|
+
* calling organization.
|
|
203
|
+
*/
|
|
204
|
+
'x-profile-id'?: string;
|
|
205
|
+
}
|
|
206
|
+
export interface UserRemoveParams {
|
|
207
|
+
/**
|
|
208
|
+
* Body param: Request to remove a user from an organization
|
|
209
|
+
*/
|
|
210
|
+
body: UserRemoveParams.Body;
|
|
211
|
+
/**
|
|
212
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
213
|
+
* organization API keys can use this header. The profile must belong to the
|
|
214
|
+
* calling organization.
|
|
215
|
+
*/
|
|
216
|
+
'x-profile-id'?: string;
|
|
217
|
+
}
|
|
218
|
+
export declare namespace UserRemoveParams {
|
|
219
|
+
/**
|
|
220
|
+
* Request to remove a user from an organization
|
|
221
|
+
*/
|
|
222
|
+
interface Body extends WebhooksAPI.MutationRequest {
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
export interface UserUpdateRoleParams {
|
|
226
|
+
/**
|
|
227
|
+
* Body param: User role: admin, billing, or developer (required)
|
|
228
|
+
*/
|
|
229
|
+
role?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Body param: Sandbox flag - when true, the operation is simulated without side
|
|
232
|
+
* effects Useful for testing integrations without actual execution
|
|
233
|
+
*/
|
|
234
|
+
sandbox?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
237
|
+
* alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
238
|
+
* hours per key per customer.
|
|
239
|
+
*/
|
|
240
|
+
'Idempotency-Key'?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
243
|
+
* organization API keys can use this header. The profile must belong to the
|
|
244
|
+
* calling organization.
|
|
245
|
+
*/
|
|
246
|
+
'x-profile-id'?: string;
|
|
247
|
+
}
|
|
248
|
+
export declare namespace Users {
|
|
249
|
+
export { type APIResponseOfUser as APIResponseOfUser, type UserResponse as UserResponse, type UserListResponse as UserListResponse, type UserRetrieveParams as UserRetrieveParams, type UserListParams as UserListParams, type UserInviteParams as UserInviteParams, type UserRemoveParams as UserRemoveParams, type UserUpdateRoleParams as UserUpdateRoleParams, };
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=users.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.mts","sourceRoot":"","s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