sendblue 1.1.9 → 2.0.1
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 +83 -0
- package/LICENSE +201 -21
- package/README.md +349 -38
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +203 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +203 -0
- package/client.d.ts.map +1 -0
- package/client.js +489 -0
- package/client.js.map +1 -0
- package/client.mjs +485 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -78
- package/index.d.ts.map +1 -0
- package/index.js +28 -104
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +129 -39
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/contacts/bulk.d.mts +61 -0
- package/resources/contacts/bulk.d.mts.map +1 -0
- package/resources/contacts/bulk.d.ts +61 -0
- package/resources/contacts/bulk.d.ts.map +1 -0
- package/resources/contacts/bulk.js +35 -0
- package/resources/contacts/bulk.js.map +1 -0
- package/resources/contacts/bulk.mjs +31 -0
- package/resources/contacts/bulk.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +239 -0
- package/resources/contacts/contacts.d.mts.map +1 -0
- package/resources/contacts/contacts.d.ts +239 -0
- package/resources/contacts/contacts.d.ts.map +1 -0
- package/resources/contacts/contacts.js +101 -0
- package/resources/contacts/contacts.js.map +1 -0
- package/resources/contacts/contacts.mjs +96 -0
- package/resources/contacts/contacts.mjs.map +1 -0
- package/resources/contacts/index.d.mts +3 -0
- package/resources/contacts/index.d.mts.map +1 -0
- package/resources/contacts/index.d.ts +3 -0
- package/resources/contacts/index.d.ts.map +1 -0
- package/resources/contacts/index.js +9 -0
- package/resources/contacts/index.js.map +1 -0
- package/resources/contacts/index.mjs +4 -0
- package/resources/contacts/index.mjs.map +1 -0
- package/resources/contacts.d.mts +2 -0
- package/resources/contacts.d.mts.map +1 -0
- package/resources/contacts.d.ts +2 -0
- package/resources/contacts.d.ts.map +1 -0
- package/resources/contacts.js +6 -0
- package/resources/contacts.js.map +1 -0
- package/resources/contacts.mjs +3 -0
- package/resources/contacts.mjs.map +1 -0
- package/resources/groups.d.mts +77 -0
- package/resources/groups.d.mts.map +1 -0
- package/resources/groups.d.ts +77 -0
- package/resources/groups.d.ts.map +1 -0
- package/resources/groups.js +38 -0
- package/resources/groups.js.map +1 -0
- package/resources/groups.mjs +34 -0
- package/resources/groups.mjs.map +1 -0
- package/resources/index.d.mts +7 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +7 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +17 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/lookups.d.mts +30 -0
- package/resources/lookups.d.mts.map +1 -0
- package/resources/lookups.d.ts +30 -0
- package/resources/lookups.d.ts.map +1 -0
- package/resources/lookups.js +16 -0
- package/resources/lookups.js.map +1 -0
- package/resources/lookups.mjs +12 -0
- package/resources/lookups.mjs.map +1 -0
- package/resources/media-objects.d.mts +31 -0
- package/resources/media-objects.d.mts.map +1 -0
- package/resources/media-objects.d.ts +31 -0
- package/resources/media-objects.d.ts.map +1 -0
- package/resources/media-objects.js +22 -0
- package/resources/media-objects.js.map +1 -0
- package/resources/media-objects.mjs +18 -0
- package/resources/media-objects.mjs.map +1 -0
- package/resources/messages.d.mts +487 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +487 -0
- package/resources/messages.d.ts.map +1 -0
- package/resources/messages.js +64 -0
- package/resources/messages.js.map +1 -0
- package/resources/messages.mjs +60 -0
- package/resources/messages.mjs.map +1 -0
- package/resources/typing-indicators.d.mts +42 -0
- package/resources/typing-indicators.d.mts.map +1 -0
- package/resources/typing-indicators.d.ts +42 -0
- package/resources/typing-indicators.d.ts.map +1 -0
- package/resources/typing-indicators.js +24 -0
- package/resources/typing-indicators.js.map +1 -0
- package/resources/typing-indicators.mjs +20 -0
- package/resources/typing-indicators.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +840 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/contacts/bulk.ts +85 -0
- package/src/resources/contacts/contacts.ts +338 -0
- package/src/resources/contacts/index.ts +24 -0
- package/src/resources/contacts.ts +3 -0
- package/src/resources/groups.ts +102 -0
- package/src/resources/index.ts +40 -0
- package/src/resources/lookups.ts +44 -0
- package/src/resources/media-objects.ts +43 -0
- package/src/resources/messages.ts +720 -0
- package/src/resources/typing-indicators.ts +54 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/.env +0 -5
- package/.prettierrc +0 -1
- package/config.js +0 -31
- package/dist/base/Message.d.ts +0 -43
- package/dist/base/Message.js +0 -30
- package/dist/base/RequestClient.d.ts +0 -27
- package/dist/base/RequestClient.js +0 -138
- package/dist/base/SendblueClient.d.ts +0 -18
- package/dist/base/SendblueClient.js +0 -33
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -4
- package/dist/rest/group-message/index.d.ts +0 -23
- package/dist/rest/group-message/index.js +0 -73
- package/dist/rest/message/index.d.ts +0 -14
- package/dist/rest/message/index.js +0 -66
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -2
- package/test/basic.test.js +0 -47
- package/tsconfig.json +0 -10
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
export class Bulk extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Create multiple contacts in bulk
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const bulk = await client.contacts.bulk.create({
|
|
10
|
+
* contacts: [{ phone: 'phone' }],
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
create(body, options) {
|
|
15
|
+
return this._client.post('/api/v2/contacts/bulk', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Delete multiple contacts by their IDs
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const bulk = await client.contacts.bulk.delete({
|
|
23
|
+
* contact_ids: ['+1234567890', '+0987654321'],
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
delete(body, options) {
|
|
28
|
+
return this._client.delete('/api/v2/contacts', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=bulk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk.mjs","sourceRoot":"","sources":["../../src/resources/contacts/bulk.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as BulkAPI from "./bulk.mjs";
|
|
3
|
+
import { Bulk, BulkCreateParams, BulkCreateResponse, BulkDeleteParams, BulkDeleteResponse } from "./bulk.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
6
|
+
export declare class Contacts extends APIResource {
|
|
7
|
+
bulk: BulkAPI.Bulk;
|
|
8
|
+
/**
|
|
9
|
+
* Create a new contact or update existing if update_if_exists is true
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const contact = await client.contacts.create({
|
|
14
|
+
* number: 'number',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
create(body: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieve a specific contact by phone number
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const contact = await client.contacts.retrieve(
|
|
25
|
+
* '+1234567890',
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
retrieve(phoneNumber: string, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Update an existing contact
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const contact = await client.contacts.update('+1234567890');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
update(phoneNumber: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<ContactUpdateResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieve a list of contacts for the authenticated account
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const contacts = await client.contacts.list();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
list(query?: ContactListParams | null | undefined, options?: RequestOptions): APIPromise<ContactListResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a specific contact
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const contact = await client.contacts.delete('+1234567890');
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
delete(phoneNumber: string, options?: RequestOptions): APIPromise<ContactDeleteResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Get the total number of contacts
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const response = await client.contacts.count();
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
count(options?: RequestOptions): APIPromise<ContactCountResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Send a verification message to a contact
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const response = await client.contacts.verify({
|
|
72
|
+
* number: 'number',
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
verify(body: ContactVerifyParams, options?: RequestOptions): APIPromise<ContactVerifyResponse>;
|
|
77
|
+
}
|
|
78
|
+
export interface Contact {
|
|
79
|
+
/**
|
|
80
|
+
* Email of assigned user
|
|
81
|
+
*/
|
|
82
|
+
assignedToEmail?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Company name
|
|
85
|
+
*/
|
|
86
|
+
companyName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* When the contact was created
|
|
89
|
+
*/
|
|
90
|
+
created_at?: string;
|
|
91
|
+
/**
|
|
92
|
+
* First name
|
|
93
|
+
*/
|
|
94
|
+
firstName?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Last name
|
|
97
|
+
*/
|
|
98
|
+
lastName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Phone number in E.164 format
|
|
101
|
+
*/
|
|
102
|
+
phone?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Associated Sendblue phone number
|
|
105
|
+
*/
|
|
106
|
+
sendblueNumber?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Tags associated with the contact
|
|
109
|
+
*/
|
|
110
|
+
tags?: Array<string>;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the contact is verified
|
|
113
|
+
*/
|
|
114
|
+
verified?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface ContactCreateResponse {
|
|
117
|
+
contact?: Contact;
|
|
118
|
+
status?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface ContactRetrieveResponse {
|
|
121
|
+
contact?: Contact;
|
|
122
|
+
status?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ContactUpdateResponse {
|
|
125
|
+
contact?: Contact;
|
|
126
|
+
status?: string;
|
|
127
|
+
}
|
|
128
|
+
export type ContactListResponse = Array<Contact>;
|
|
129
|
+
export interface ContactDeleteResponse {
|
|
130
|
+
status?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ContactCountResponse {
|
|
133
|
+
/**
|
|
134
|
+
* Total number of contacts
|
|
135
|
+
*/
|
|
136
|
+
count?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface ContactVerifyResponse {
|
|
139
|
+
status?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ContactCreateParams {
|
|
142
|
+
/**
|
|
143
|
+
* Contact's phone number in E.164 format
|
|
144
|
+
*/
|
|
145
|
+
number: string;
|
|
146
|
+
/**
|
|
147
|
+
* Email of assigned user
|
|
148
|
+
*/
|
|
149
|
+
assigned_to_email?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Email of assigned user (alternative)
|
|
152
|
+
*/
|
|
153
|
+
assignedToEmail?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Contact's first name
|
|
156
|
+
*/
|
|
157
|
+
first_name?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Contact's first name (alternative)
|
|
160
|
+
*/
|
|
161
|
+
firstName?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Contact's last name
|
|
164
|
+
*/
|
|
165
|
+
last_name?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Contact's last name (alternative)
|
|
168
|
+
*/
|
|
169
|
+
lastName?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Contact's phone number (alternative)
|
|
172
|
+
*/
|
|
173
|
+
phone_number?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Contact's phone number (alternative)
|
|
176
|
+
*/
|
|
177
|
+
phoneNumber?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Associated Sendblue phone number
|
|
180
|
+
*/
|
|
181
|
+
sendblue_number?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Associated Sendblue phone number (alternative)
|
|
184
|
+
*/
|
|
185
|
+
sendblueNumber?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Tags for the contact
|
|
188
|
+
*/
|
|
189
|
+
tags?: Array<string>;
|
|
190
|
+
/**
|
|
191
|
+
* If true, updates the contact if it already exists
|
|
192
|
+
*/
|
|
193
|
+
update_if_exists?: boolean;
|
|
194
|
+
}
|
|
195
|
+
export interface ContactUpdateParams {
|
|
196
|
+
assignedToEmail?: string;
|
|
197
|
+
companyName?: string;
|
|
198
|
+
firstName?: string;
|
|
199
|
+
lastName?: string;
|
|
200
|
+
sendblueNumber?: string;
|
|
201
|
+
tags?: Array<string>;
|
|
202
|
+
}
|
|
203
|
+
export interface ContactListParams {
|
|
204
|
+
/**
|
|
205
|
+
* Filter by contact ID
|
|
206
|
+
*/
|
|
207
|
+
cid?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Maximum number of contacts to return
|
|
210
|
+
*/
|
|
211
|
+
limit?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Number of contacts to skip
|
|
214
|
+
*/
|
|
215
|
+
offset?: number;
|
|
216
|
+
/**
|
|
217
|
+
* Field to sort by
|
|
218
|
+
*/
|
|
219
|
+
order_by?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Sort direction
|
|
222
|
+
*/
|
|
223
|
+
order_direction?: 'asc' | 'desc';
|
|
224
|
+
/**
|
|
225
|
+
* Filter by phone number
|
|
226
|
+
*/
|
|
227
|
+
phone_number?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface ContactVerifyParams {
|
|
230
|
+
/**
|
|
231
|
+
* Phone number to verify
|
|
232
|
+
*/
|
|
233
|
+
number: string;
|
|
234
|
+
}
|
|
235
|
+
export declare namespace Contacts {
|
|
236
|
+
export { type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactVerifyParams as ContactVerifyParams, };
|
|
237
|
+
export { Bulk as Bulk, type BulkCreateResponse as BulkCreateResponse, type BulkDeleteResponse as BulkDeleteResponse, type BulkCreateParams as BulkCreateParams, type BulkDeleteParams as BulkDeleteParams, };
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=contacts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.d.mts","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE;OACpF,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IAEpD;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAA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EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as BulkAPI from "./bulk.js";
|
|
3
|
+
import { Bulk, BulkCreateParams, BulkCreateResponse, BulkDeleteParams, BulkDeleteResponse } from "./bulk.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
export declare class Contacts extends APIResource {
|
|
7
|
+
bulk: BulkAPI.Bulk;
|
|
8
|
+
/**
|
|
9
|
+
* Create a new contact or update existing if update_if_exists is true
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const contact = await client.contacts.create({
|
|
14
|
+
* number: 'number',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
create(body: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieve a specific contact by phone number
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const contact = await client.contacts.retrieve(
|
|
25
|
+
* '+1234567890',
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
retrieve(phoneNumber: string, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Update an existing contact
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const contact = await client.contacts.update('+1234567890');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
update(phoneNumber: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<ContactUpdateResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieve a list of contacts for the authenticated account
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const contacts = await client.contacts.list();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
list(query?: ContactListParams | null | undefined, options?: RequestOptions): APIPromise<ContactListResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a specific contact
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const contact = await client.contacts.delete('+1234567890');
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
delete(phoneNumber: string, options?: RequestOptions): APIPromise<ContactDeleteResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Get the total number of contacts
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const response = await client.contacts.count();
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
count(options?: RequestOptions): APIPromise<ContactCountResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Send a verification message to a contact
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const response = await client.contacts.verify({
|
|
72
|
+
* number: 'number',
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
verify(body: ContactVerifyParams, options?: RequestOptions): APIPromise<ContactVerifyResponse>;
|
|
77
|
+
}
|
|
78
|
+
export interface Contact {
|
|
79
|
+
/**
|
|
80
|
+
* Email of assigned user
|
|
81
|
+
*/
|
|
82
|
+
assignedToEmail?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Company name
|
|
85
|
+
*/
|
|
86
|
+
companyName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* When the contact was created
|
|
89
|
+
*/
|
|
90
|
+
created_at?: string;
|
|
91
|
+
/**
|
|
92
|
+
* First name
|
|
93
|
+
*/
|
|
94
|
+
firstName?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Last name
|
|
97
|
+
*/
|
|
98
|
+
lastName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Phone number in E.164 format
|
|
101
|
+
*/
|
|
102
|
+
phone?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Associated Sendblue phone number
|
|
105
|
+
*/
|
|
106
|
+
sendblueNumber?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Tags associated with the contact
|
|
109
|
+
*/
|
|
110
|
+
tags?: Array<string>;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the contact is verified
|
|
113
|
+
*/
|
|
114
|
+
verified?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface ContactCreateResponse {
|
|
117
|
+
contact?: Contact;
|
|
118
|
+
status?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface ContactRetrieveResponse {
|
|
121
|
+
contact?: Contact;
|
|
122
|
+
status?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ContactUpdateResponse {
|
|
125
|
+
contact?: Contact;
|
|
126
|
+
status?: string;
|
|
127
|
+
}
|
|
128
|
+
export type ContactListResponse = Array<Contact>;
|
|
129
|
+
export interface ContactDeleteResponse {
|
|
130
|
+
status?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ContactCountResponse {
|
|
133
|
+
/**
|
|
134
|
+
* Total number of contacts
|
|
135
|
+
*/
|
|
136
|
+
count?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface ContactVerifyResponse {
|
|
139
|
+
status?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ContactCreateParams {
|
|
142
|
+
/**
|
|
143
|
+
* Contact's phone number in E.164 format
|
|
144
|
+
*/
|
|
145
|
+
number: string;
|
|
146
|
+
/**
|
|
147
|
+
* Email of assigned user
|
|
148
|
+
*/
|
|
149
|
+
assigned_to_email?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Email of assigned user (alternative)
|
|
152
|
+
*/
|
|
153
|
+
assignedToEmail?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Contact's first name
|
|
156
|
+
*/
|
|
157
|
+
first_name?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Contact's first name (alternative)
|
|
160
|
+
*/
|
|
161
|
+
firstName?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Contact's last name
|
|
164
|
+
*/
|
|
165
|
+
last_name?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Contact's last name (alternative)
|
|
168
|
+
*/
|
|
169
|
+
lastName?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Contact's phone number (alternative)
|
|
172
|
+
*/
|
|
173
|
+
phone_number?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Contact's phone number (alternative)
|
|
176
|
+
*/
|
|
177
|
+
phoneNumber?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Associated Sendblue phone number
|
|
180
|
+
*/
|
|
181
|
+
sendblue_number?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Associated Sendblue phone number (alternative)
|
|
184
|
+
*/
|
|
185
|
+
sendblueNumber?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Tags for the contact
|
|
188
|
+
*/
|
|
189
|
+
tags?: Array<string>;
|
|
190
|
+
/**
|
|
191
|
+
* If true, updates the contact if it already exists
|
|
192
|
+
*/
|
|
193
|
+
update_if_exists?: boolean;
|
|
194
|
+
}
|
|
195
|
+
export interface ContactUpdateParams {
|
|
196
|
+
assignedToEmail?: string;
|
|
197
|
+
companyName?: string;
|
|
198
|
+
firstName?: string;
|
|
199
|
+
lastName?: string;
|
|
200
|
+
sendblueNumber?: string;
|
|
201
|
+
tags?: Array<string>;
|
|
202
|
+
}
|
|
203
|
+
export interface ContactListParams {
|
|
204
|
+
/**
|
|
205
|
+
* Filter by contact ID
|
|
206
|
+
*/
|
|
207
|
+
cid?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Maximum number of contacts to return
|
|
210
|
+
*/
|
|
211
|
+
limit?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Number of contacts to skip
|
|
214
|
+
*/
|
|
215
|
+
offset?: number;
|
|
216
|
+
/**
|
|
217
|
+
* Field to sort by
|
|
218
|
+
*/
|
|
219
|
+
order_by?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Sort direction
|
|
222
|
+
*/
|
|
223
|
+
order_direction?: 'asc' | 'desc';
|
|
224
|
+
/**
|
|
225
|
+
* Filter by phone number
|
|
226
|
+
*/
|
|
227
|
+
phone_number?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface ContactVerifyParams {
|
|
230
|
+
/**
|
|
231
|
+
* Phone number to verify
|
|
232
|
+
*/
|
|
233
|
+
number: string;
|
|
234
|
+
}
|
|
235
|
+
export declare namespace Contacts {
|
|
236
|
+
export { type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactVerifyParams as ContactVerifyParams, };
|
|
237
|
+
export { Bulk as Bulk, type BulkCreateResponse as BulkCreateResponse, type BulkDeleteResponse as BulkDeleteResponse, type BulkCreateParams as BulkCreateParams, type BulkDeleteParams as BulkDeleteParams, };
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=contacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE;OACpF,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,IAAI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BAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Contacts = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const BulkAPI = tslib_1.__importStar(require("./bulk.js"));
|
|
8
|
+
const bulk_1 = require("./bulk.js");
|
|
9
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
10
|
+
class Contacts extends resource_1.APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.bulk = new BulkAPI.Bulk(this._client);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create a new contact or update existing if update_if_exists is true
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const contact = await client.contacts.create({
|
|
21
|
+
* number: 'number',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(body, options) {
|
|
26
|
+
return this._client.post('/api/v2/contacts', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve a specific contact by phone number
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const contact = await client.contacts.retrieve(
|
|
34
|
+
* '+1234567890',
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
retrieve(phoneNumber, options) {
|
|
39
|
+
return this._client.get((0, path_1.path) `/api/v2/contacts/${phoneNumber}`, options);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Update an existing contact
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const contact = await client.contacts.update('+1234567890');
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
update(phoneNumber, body, options) {
|
|
50
|
+
return this._client.put((0, path_1.path) `/api/v2/contacts/${phoneNumber}`, { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve a list of contacts for the authenticated account
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const contacts = await client.contacts.list();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
list(query = {}, options) {
|
|
61
|
+
return this._client.get('/api/v2/contacts', { query, ...options });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Delete a specific contact
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const contact = await client.contacts.delete('+1234567890');
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
delete(phoneNumber, options) {
|
|
72
|
+
return this._client.delete((0, path_1.path) `/api/v2/contacts/${phoneNumber}`, options);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the total number of contacts
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const response = await client.contacts.count();
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
count(options) {
|
|
83
|
+
return this._client.get('/api/v2/contacts/count', options);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Send a verification message to a contact
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const response = await client.contacts.verify({
|
|
91
|
+
* number: 'number',
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
verify(body, options) {
|
|
96
|
+
return this._client.post('/api/v2/contacts/verify', { body, ...options });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.Contacts = Contacts;
|
|
100
|
+
Contacts.Bulk = bulk_1.Bulk;
|
|
101
|
+
//# sourceMappingURL=contacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,2DAAkC;AAClC,oCAA0G;AAG1G,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkGtD,CAAC;IAhGC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,WAAmB,EACnB,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;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