sendblue 1.1.9 → 2.0.2
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 +161 -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 +206 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +206 -0
- package/client.d.ts.map +1 -0
- package/client.js +492 -0
- package/client.js.map +1 -0
- package/client.mjs +488 -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 +132 -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 +213 -0
- package/resources/contacts/contacts.d.mts.map +1 -0
- package/resources/contacts/contacts.d.ts +213 -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 +8 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +8 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +19 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +9 -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 +479 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +479 -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/webhooks.d.mts +224 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +224 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +82 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +78 -0
- package/resources/webhooks.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 +865 -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 +302 -0
- package/src/resources/contacts/index.ts +23 -0
- package/src/resources/contacts.ts +3 -0
- package/src/resources/groups.ts +102 -0
- package/src/resources/index.ts +50 -0
- package/src/resources/lookups.ts +44 -0
- package/src/resources/media-objects.ts +43 -0
- package/src/resources/messages.ts +710 -0
- package/src/resources/typing-indicators.ts +54 -0
- package/src/resources/webhooks.ts +284 -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,54 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class TypingIndicators extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Send an indication that you are typing to a user. This shows up as the animated
|
|
10
|
+
* three dots on the recipient's device. Only available for existing chats and not
|
|
11
|
+
* supported in group chats.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response = await client.typingIndicators.send({
|
|
16
|
+
* number: '+19998887777',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
send(body: TypingIndicatorSendParams, options?: RequestOptions): APIPromise<TypingIndicatorSendResponse> {
|
|
21
|
+
return this._client.post('/api/send-typing-indicator', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TypingIndicatorSendResponse {
|
|
26
|
+
/**
|
|
27
|
+
* The error message if the status is ERROR
|
|
28
|
+
*/
|
|
29
|
+
error_message?: string | null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The number you evaluated in E.164 format
|
|
33
|
+
*/
|
|
34
|
+
number?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The status of the typing indicator you tried to send
|
|
38
|
+
*/
|
|
39
|
+
status?: 'SENT' | 'ERROR';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface TypingIndicatorSendParams {
|
|
43
|
+
/**
|
|
44
|
+
* The number you want to send a typing indicator to (E.164 format)
|
|
45
|
+
*/
|
|
46
|
+
number: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export declare namespace TypingIndicators {
|
|
50
|
+
export {
|
|
51
|
+
type TypingIndicatorSendResponse as TypingIndicatorSendResponse,
|
|
52
|
+
type TypingIndicatorSendParams as TypingIndicatorSendParams,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Webhooks extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Add new webhooks to your account. This endpoint appends webhooks to the existing
|
|
10
|
+
* list.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const webhook = await client.webhooks.create({
|
|
15
|
+
* webhooks: [
|
|
16
|
+
* 'https://example.com/new-webhook',
|
|
17
|
+
* {
|
|
18
|
+
* url: 'https://example.com/webhook-with-secret',
|
|
19
|
+
* secret: 'my-webhook-secret',
|
|
20
|
+
* },
|
|
21
|
+
* ],
|
|
22
|
+
* globalSecret: 'optional-global-secret',
|
|
23
|
+
* type: 'receive',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse> {
|
|
28
|
+
return this._client.post('/api/v2/account/webhooks', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Replace all webhooks for your account. This endpoint completely replaces the
|
|
33
|
+
* existing webhook configuration.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const webhook = await client.webhooks.update({
|
|
38
|
+
* webhooks: {
|
|
39
|
+
* receive: [
|
|
40
|
+
* 'https://example.com/webhook1',
|
|
41
|
+
* {
|
|
42
|
+
* url: 'https://example.com/webhook2',
|
|
43
|
+
* secret: 'webhook-secret',
|
|
44
|
+
* },
|
|
45
|
+
* ],
|
|
46
|
+
* call_log: ['https://example.com/call-webhook'],
|
|
47
|
+
* contact_created: [
|
|
48
|
+
* 'https://example.com/contact-webhook',
|
|
49
|
+
* ],
|
|
50
|
+
* globalSecret: 'my-global-secret',
|
|
51
|
+
* },
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
update(body: WebhookUpdateParams, options?: RequestOptions): APIPromise<WebhookUpdateResponse> {
|
|
56
|
+
return this._client.put('/api/v2/account/webhooks', { body, ...options });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get all webhooks configured for your account.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const webhooks = await client.webhooks.list();
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
list(options?: RequestOptions): APIPromise<WebhookListResponse> {
|
|
68
|
+
return this._client.get('/api/v2/account/webhooks', options);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Delete specific webhooks from your account.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const webhook = await client.webhooks.delete({
|
|
77
|
+
* webhooks: ['https://example.com'],
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
delete(body: WebhookDeleteParams, options?: RequestOptions): APIPromise<WebhookDeleteResponse> {
|
|
82
|
+
return this._client.delete('/api/v2/account/webhooks', { body, ...options });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface WebhookConfiguration {
|
|
87
|
+
/**
|
|
88
|
+
* Webhooks for call logs
|
|
89
|
+
*/
|
|
90
|
+
call_log?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Webhooks for contact creation (URL strings only)
|
|
94
|
+
*/
|
|
95
|
+
contact_created?: Array<string>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Global secret applied to all webhooks
|
|
99
|
+
*/
|
|
100
|
+
globalSecret?: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Webhooks for line assignment
|
|
104
|
+
*/
|
|
105
|
+
line_assigned?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Webhooks for blocked lines
|
|
109
|
+
*/
|
|
110
|
+
line_blocked?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Webhooks for outbound messages
|
|
114
|
+
*/
|
|
115
|
+
outbound?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Webhooks for inbound messages
|
|
119
|
+
*/
|
|
120
|
+
receive?: Array<string | WebhookConfiguration.WebhookObject>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Legacy secret field
|
|
124
|
+
*/
|
|
125
|
+
secret?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export namespace WebhookConfiguration {
|
|
129
|
+
export interface WebhookObject {
|
|
130
|
+
/**
|
|
131
|
+
* Webhook URL (HTTPS only)
|
|
132
|
+
*/
|
|
133
|
+
url: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Secret for webhook verification
|
|
137
|
+
*/
|
|
138
|
+
secret?: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface WebhookObject {
|
|
142
|
+
/**
|
|
143
|
+
* Webhook URL (HTTPS only)
|
|
144
|
+
*/
|
|
145
|
+
url: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Secret for webhook verification
|
|
149
|
+
*/
|
|
150
|
+
secret?: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface WebhookObject {
|
|
154
|
+
/**
|
|
155
|
+
* Webhook URL (HTTPS only)
|
|
156
|
+
*/
|
|
157
|
+
url: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Secret for webhook verification
|
|
161
|
+
*/
|
|
162
|
+
secret?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface WebhookObject {
|
|
166
|
+
/**
|
|
167
|
+
* Webhook URL (HTTPS only)
|
|
168
|
+
*/
|
|
169
|
+
url: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Secret for webhook verification
|
|
173
|
+
*/
|
|
174
|
+
secret?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface WebhookObject {
|
|
178
|
+
/**
|
|
179
|
+
* Webhook URL (HTTPS only)
|
|
180
|
+
*/
|
|
181
|
+
url: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Secret for webhook verification
|
|
185
|
+
*/
|
|
186
|
+
secret?: string;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface WebhookCreateResponse {
|
|
191
|
+
status: 'OK' | 'ERROR';
|
|
192
|
+
|
|
193
|
+
message?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Updated webhook configration (partial)
|
|
197
|
+
*/
|
|
198
|
+
webhooks?: WebhookConfiguration;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface WebhookUpdateResponse {
|
|
202
|
+
status: 'OK' | 'ERROR';
|
|
203
|
+
|
|
204
|
+
message?: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Updated webhook configration (partial)
|
|
208
|
+
*/
|
|
209
|
+
webhooks?: WebhookConfiguration;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface WebhookListResponse {
|
|
213
|
+
status: 'OK' | 'ERROR';
|
|
214
|
+
|
|
215
|
+
message?: string;
|
|
216
|
+
|
|
217
|
+
webhooks?: WebhookConfiguration;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface WebhookDeleteResponse {
|
|
221
|
+
status: 'OK' | 'ERROR';
|
|
222
|
+
|
|
223
|
+
message?: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface WebhookCreateParams {
|
|
227
|
+
/**
|
|
228
|
+
* Array of webhook URLs or webhook objects to add
|
|
229
|
+
*/
|
|
230
|
+
webhooks: Array<string | WebhookCreateParams.WebhookObject>;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Optional global secret to apply to all webhooks
|
|
234
|
+
*/
|
|
235
|
+
globalSecret?: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Webhook type (default to 'receive')
|
|
239
|
+
*/
|
|
240
|
+
type?: 'receive' | 'call_log' | 'line_blocked' | 'line_assigned' | 'outbound' | 'contact_created';
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export namespace WebhookCreateParams {
|
|
244
|
+
export interface WebhookObject {
|
|
245
|
+
/**
|
|
246
|
+
* Webhook URL (HTTPS only)
|
|
247
|
+
*/
|
|
248
|
+
url: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Secret for webhook verification
|
|
252
|
+
*/
|
|
253
|
+
secret?: string;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface WebhookUpdateParams {
|
|
258
|
+
webhooks: WebhookConfiguration;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface WebhookDeleteParams {
|
|
262
|
+
/**
|
|
263
|
+
* Array of webhook URLs to delete
|
|
264
|
+
*/
|
|
265
|
+
webhooks: Array<string>;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Webhook type (default to 'receive')
|
|
269
|
+
*/
|
|
270
|
+
type?: 'receive' | 'call_log' | 'line_blocked' | 'line_assigned' | 'outbound' | 'contact_created';
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export declare namespace Webhooks {
|
|
274
|
+
export {
|
|
275
|
+
type WebhookConfiguration as WebhookConfiguration,
|
|
276
|
+
type WebhookCreateResponse as WebhookCreateResponse,
|
|
277
|
+
type WebhookUpdateResponse as WebhookUpdateResponse,
|
|
278
|
+
type WebhookListResponse as WebhookListResponse,
|
|
279
|
+
type WebhookDeleteResponse as WebhookDeleteResponse,
|
|
280
|
+
type WebhookCreateParams as WebhookCreateParams,
|
|
281
|
+
type WebhookUpdateParams as WebhookUpdateParams,
|
|
282
|
+
type WebhookDeleteParams as WebhookDeleteParams,
|
|
283
|
+
};
|
|
284
|
+
}
|
package/src/resources.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './resources/index';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
// this config is included in the published src directory to prevent TS errors
|
|
3
|
+
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
+
// via declaration maps
|
|
5
|
+
"include": ["index.ts"],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"target": "ES2015",
|
|
8
|
+
"lib": ["DOM", "DOM.Iterable", "ES2018"],
|
|
9
|
+
"moduleResolution": "node"
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/uploads.ts
ADDED
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = '2.0.2'; // x-release-please-version
|
package/uploads.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
|
package/uploads.d.ts
ADDED
package/uploads.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
|
package/uploads.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/uploads instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/uploads.js"), exports);
|
|
6
|
+
//# sourceMappingURL=uploads.js.map
|
package/uploads.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4DAA+B"}
|
package/uploads.mjs
ADDED
package/uploads.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
|
package/version.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/version.d.ts
ADDED
package/version.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/version.js
ADDED
package/version.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
ADDED
package/version.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|
package/.env
DELETED
package/.prettierrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/config.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const DEFAULT_ENGINE = 'davinci';
|
|
2
|
-
const ORIGIN = 'https://api.openai.com';
|
|
3
|
-
const API_VERSION = 'v1';
|
|
4
|
-
const OPEN_AI_URL = `${ORIGIN}/${API_VERSION}`;
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
completionURL(engine) {
|
|
8
|
-
return `${OPEN_AI_URL}/engines/${engine}/completions`;
|
|
9
|
-
},
|
|
10
|
-
searchURL(engine) {
|
|
11
|
-
return `${OPEN_AI_URL}/engines/${engine}/search`;
|
|
12
|
-
},
|
|
13
|
-
enginesUrl() {
|
|
14
|
-
return `${OPEN_AI_URL}/engines`;
|
|
15
|
-
},
|
|
16
|
-
engineUrl(engine) {
|
|
17
|
-
return `${OPEN_AI_URL}/engines/${engine}`;
|
|
18
|
-
},
|
|
19
|
-
classificationsUrl() {
|
|
20
|
-
return `${OPEN_AI_URL}/classifications`;
|
|
21
|
-
},
|
|
22
|
-
filesUrl() {
|
|
23
|
-
return `${OPEN_AI_URL}/files`;
|
|
24
|
-
},
|
|
25
|
-
answersUrl() {
|
|
26
|
-
return `${OPEN_AI_URL}/answers`;
|
|
27
|
-
},
|
|
28
|
-
embeddingsUrl(engine) {
|
|
29
|
-
return `${OPEN_AI_URL}/engines/${engine}/embeddings`;
|
|
30
|
-
}
|
|
31
|
-
};
|
package/dist/base/Message.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare type MessageTypes = 'group' | 'message';
|
|
2
|
-
export interface Message {
|
|
3
|
-
accountEmail?: string;
|
|
4
|
-
content?: string;
|
|
5
|
-
is_outbound?: boolean;
|
|
6
|
-
status?: string;
|
|
7
|
-
error_code?: string;
|
|
8
|
-
error_message?: string;
|
|
9
|
-
message_handle?: string;
|
|
10
|
-
date_sent?: Date;
|
|
11
|
-
date_updated?: Date;
|
|
12
|
-
from_number?: string;
|
|
13
|
-
number?: string;
|
|
14
|
-
to_number?: string;
|
|
15
|
-
was_downgraded?: boolean;
|
|
16
|
-
plan?: string;
|
|
17
|
-
media_url?: string;
|
|
18
|
-
message_type?: string;
|
|
19
|
-
group_id?: string;
|
|
20
|
-
participants?: string[];
|
|
21
|
-
}
|
|
22
|
-
export declare class MessageImpl {
|
|
23
|
-
accountEmail: string | undefined;
|
|
24
|
-
content: string | undefined;
|
|
25
|
-
is_outbound: boolean | undefined;
|
|
26
|
-
status: string | undefined;
|
|
27
|
-
error_code: string | undefined;
|
|
28
|
-
error_message: string | undefined;
|
|
29
|
-
message_handle: string | undefined;
|
|
30
|
-
date_sent: Date | undefined;
|
|
31
|
-
date_updated: Date | undefined;
|
|
32
|
-
from_number: string | undefined;
|
|
33
|
-
number: string | undefined;
|
|
34
|
-
to_number: string | undefined;
|
|
35
|
-
was_downgraded: boolean | undefined;
|
|
36
|
-
plan: string | undefined;
|
|
37
|
-
media_url: string | undefined;
|
|
38
|
-
message_type: string | undefined;
|
|
39
|
-
group_id: string | undefined;
|
|
40
|
-
participants: string[] | undefined;
|
|
41
|
-
constructor(message: Message);
|
|
42
|
-
static from(data: Message): MessageImpl;
|
|
43
|
-
}
|
package/dist/base/Message.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageImpl = void 0;
|
|
4
|
-
var MessageImpl = /** @class */ (function () {
|
|
5
|
-
function MessageImpl(message) {
|
|
6
|
-
this.accountEmail = message.accountEmail;
|
|
7
|
-
this.content = message.content;
|
|
8
|
-
this.is_outbound = message.is_outbound;
|
|
9
|
-
this.status = message.status;
|
|
10
|
-
this.error_code = message.error_code;
|
|
11
|
-
this.error_message = message.error_message;
|
|
12
|
-
this.message_handle = message.message_handle;
|
|
13
|
-
this.date_sent = message.date_sent;
|
|
14
|
-
this.date_updated = message.date_updated;
|
|
15
|
-
this.from_number = message.from_number;
|
|
16
|
-
this.number = message.number;
|
|
17
|
-
this.to_number = message.to_number;
|
|
18
|
-
this.was_downgraded = message.was_downgraded;
|
|
19
|
-
this.plan = message.plan;
|
|
20
|
-
this.media_url = message.media_url;
|
|
21
|
-
this.message_type = message.message_type;
|
|
22
|
-
this.group_id = message.group_id;
|
|
23
|
-
this.participants = message.participants;
|
|
24
|
-
}
|
|
25
|
-
MessageImpl.from = function (data) {
|
|
26
|
-
return new MessageImpl(data);
|
|
27
|
-
};
|
|
28
|
-
return MessageImpl;
|
|
29
|
-
}());
|
|
30
|
-
exports.MessageImpl = MessageImpl;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Agent, AgentOptions } from 'https';
|
|
3
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
4
|
-
export interface RequestClientOptions {
|
|
5
|
-
timeout?: number;
|
|
6
|
-
keepAlive?: boolean;
|
|
7
|
-
keepAliveMsecs?: number;
|
|
8
|
-
maxSockets?: number;
|
|
9
|
-
maxTotalSockets?: number;
|
|
10
|
-
maxFreeSockets?: number;
|
|
11
|
-
scheduling?: 'fifo' | 'lifo';
|
|
12
|
-
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
13
|
-
}
|
|
14
|
-
export interface RequestClientRequestOptions {
|
|
15
|
-
logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
16
|
-
}
|
|
17
|
-
export declare class RequestClient {
|
|
18
|
-
defaultTimeout: number;
|
|
19
|
-
agentOpts: AgentOptions;
|
|
20
|
-
agent: Agent;
|
|
21
|
-
axios: AxiosInstance;
|
|
22
|
-
logLevel: string;
|
|
23
|
-
constructor(opts: RequestClientOptions, apiKey: string, apiSecret: string);
|
|
24
|
-
request(opts: AxiosRequestConfig & RequestClientRequestOptions): Promise<any>;
|
|
25
|
-
filterLoggingHeaders(headers: any): string[];
|
|
26
|
-
logRequest(options: AxiosRequestConfig): void;
|
|
27
|
-
}
|