@zavudev/sdk 0.58.0 → 0.59.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 +27 -1
- package/README.md +18 -0
- package/client.d.mts +2 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -0
- package/client.d.ts.map +1 -1
- package/client.js +2 -0
- package/client.js.map +1 -1
- package/client.mjs +2 -0
- package/client.mjs.map +1 -1
- package/package.json +21 -1
- package/src/client.ts +2 -0
- package/src/types.ts +8 -4
- package/src/v2/index.ts +4 -0
- package/src/v2/resources/agents/agents.ts +142 -0
- package/src/v2/resources/agents/channels.ts +66 -0
- package/src/v2/resources/agents/index.ts +18 -0
- package/src/v2/resources/agents.ts +3 -0
- package/src/v2/resources/campaigns/campaigns.ts +178 -0
- package/src/v2/resources/campaigns/index.ts +27 -0
- package/src/v2/resources/campaigns/recipients.ts +62 -0
- package/src/v2/resources/campaigns.ts +3 -0
- package/src/v2/resources/channels.ts +156 -0
- package/src/v2/resources/contacts.ts +112 -0
- package/src/v2/resources/conversations.ts +89 -0
- package/src/v2/resources/email-domains.ts +107 -0
- package/src/v2/resources/functions.ts +73 -0
- package/src/v2/resources/index.ts +138 -0
- package/src/v2/resources/messages.ts +129 -0
- package/src/v2/resources/numbers.ts +74 -0
- package/src/v2/resources/templates.ts +104 -0
- package/src/v2/resources/webhook.ts +102 -0
- package/src/v2/types.ts +2412 -0
- package/src/v2/v2.ts +315 -0
- package/src/v2.ts +3 -0
- package/src/version.ts +1 -1
- package/types.d.mts +8 -4
- package/types.d.mts.map +1 -1
- package/types.d.ts +8 -4
- package/types.d.ts.map +1 -1
- package/v2/index.d.mts +3 -0
- package/v2/index.d.mts.map +1 -0
- package/v2/index.d.ts +3 -0
- package/v2/index.d.ts.map +1 -0
- package/v2/index.js +9 -0
- package/v2/index.js.map +1 -0
- package/v2/index.mjs +4 -0
- package/v2/index.mjs.map +1 -0
- package/v2/resources/agents/agents.d.mts +81 -0
- package/v2/resources/agents/agents.d.mts.map +1 -0
- package/v2/resources/agents/agents.d.ts +81 -0
- package/v2/resources/agents/agents.d.ts.map +1 -0
- package/v2/resources/agents/agents.js +88 -0
- package/v2/resources/agents/agents.js.map +1 -0
- package/v2/resources/agents/agents.mjs +83 -0
- package/v2/resources/agents/agents.mjs.map +1 -0
- package/v2/resources/agents/channels.d.mts +39 -0
- package/v2/resources/agents/channels.d.mts.map +1 -0
- package/v2/resources/agents/channels.d.ts +39 -0
- package/v2/resources/agents/channels.d.ts.map +1 -0
- package/v2/resources/agents/channels.js +44 -0
- package/v2/resources/agents/channels.js.map +1 -0
- package/v2/resources/agents/channels.mjs +40 -0
- package/v2/resources/agents/channels.mjs.map +1 -0
- package/v2/resources/agents/index.d.mts +3 -0
- package/v2/resources/agents/index.d.mts.map +1 -0
- package/v2/resources/agents/index.d.ts +3 -0
- package/v2/resources/agents/index.d.ts.map +1 -0
- package/v2/resources/agents/index.js +9 -0
- package/v2/resources/agents/index.js.map +1 -0
- package/v2/resources/agents/index.mjs +4 -0
- package/v2/resources/agents/index.mjs.map +1 -0
- package/v2/resources/agents.d.mts +2 -0
- package/v2/resources/agents.d.mts.map +1 -0
- package/v2/resources/agents.d.ts +2 -0
- package/v2/resources/agents.d.ts.map +1 -0
- package/v2/resources/agents.js +6 -0
- package/v2/resources/agents.js.map +1 -0
- package/v2/resources/agents.mjs +3 -0
- package/v2/resources/agents.mjs.map +1 -0
- package/v2/resources/campaigns/campaigns.d.mts +100 -0
- package/v2/resources/campaigns/campaigns.d.mts.map +1 -0
- package/v2/resources/campaigns/campaigns.d.ts +100 -0
- package/v2/resources/campaigns/campaigns.d.ts.map +1 -0
- package/v2/resources/campaigns/campaigns.js +106 -0
- package/v2/resources/campaigns/campaigns.js.map +1 -0
- package/v2/resources/campaigns/campaigns.mjs +101 -0
- package/v2/resources/campaigns/campaigns.mjs.map +1 -0
- package/v2/resources/campaigns/index.d.mts +3 -0
- package/v2/resources/campaigns/index.d.mts.map +1 -0
- package/v2/resources/campaigns/index.d.ts +3 -0
- package/v2/resources/campaigns/index.d.ts.map +1 -0
- package/v2/resources/campaigns/index.js +9 -0
- package/v2/resources/campaigns/index.js.map +1 -0
- package/v2/resources/campaigns/index.mjs +4 -0
- package/v2/resources/campaigns/index.mjs.map +1 -0
- package/v2/resources/campaigns/recipients.d.mts +43 -0
- package/v2/resources/campaigns/recipients.d.mts.map +1 -0
- package/v2/resources/campaigns/recipients.d.ts +43 -0
- package/v2/resources/campaigns/recipients.d.ts.map +1 -0
- package/v2/resources/campaigns/recipients.js +41 -0
- package/v2/resources/campaigns/recipients.js.map +1 -0
- package/v2/resources/campaigns/recipients.mjs +37 -0
- package/v2/resources/campaigns/recipients.mjs.map +1 -0
- package/v2/resources/campaigns.d.mts +2 -0
- package/v2/resources/campaigns.d.mts.map +1 -0
- package/v2/resources/campaigns.d.ts +2 -0
- package/v2/resources/campaigns.d.ts.map +1 -0
- package/v2/resources/campaigns.js +6 -0
- package/v2/resources/campaigns.js.map +1 -0
- package/v2/resources/campaigns.mjs +3 -0
- package/v2/resources/campaigns.mjs.map +1 -0
- package/v2/resources/channels.d.mts +101 -0
- package/v2/resources/channels.d.mts.map +1 -0
- package/v2/resources/channels.d.ts +101 -0
- package/v2/resources/channels.d.ts.map +1 -0
- package/v2/resources/channels.js +107 -0
- package/v2/resources/channels.js.map +1 -0
- package/v2/resources/channels.mjs +103 -0
- package/v2/resources/channels.mjs.map +1 -0
- package/v2/resources/contacts.d.mts +62 -0
- package/v2/resources/contacts.d.mts.map +1 -0
- package/v2/resources/contacts.d.ts +62 -0
- package/v2/resources/contacts.d.ts.map +1 -0
- package/v2/resources/contacts.js +66 -0
- package/v2/resources/contacts.js.map +1 -0
- package/v2/resources/contacts.mjs +62 -0
- package/v2/resources/contacts.mjs.map +1 -0
- package/v2/resources/conversations.d.mts +51 -0
- package/v2/resources/conversations.d.mts.map +1 -0
- package/v2/resources/conversations.d.ts +51 -0
- package/v2/resources/conversations.d.ts.map +1 -0
- package/v2/resources/conversations.js +55 -0
- package/v2/resources/conversations.js.map +1 -0
- package/v2/resources/conversations.mjs +51 -0
- package/v2/resources/conversations.mjs.map +1 -0
- package/v2/resources/email-domains.d.mts +72 -0
- package/v2/resources/email-domains.d.mts.map +1 -0
- package/v2/resources/email-domains.d.ts +72 -0
- package/v2/resources/email-domains.d.ts.map +1 -0
- package/v2/resources/email-domains.js +80 -0
- package/v2/resources/email-domains.js.map +1 -0
- package/v2/resources/email-domains.mjs +76 -0
- package/v2/resources/email-domains.mjs.map +1 -0
- package/v2/resources/functions.d.mts +41 -0
- package/v2/resources/functions.d.mts.map +1 -0
- package/v2/resources/functions.d.ts +41 -0
- package/v2/resources/functions.d.ts.map +1 -0
- package/v2/resources/functions.js +41 -0
- package/v2/resources/functions.js.map +1 -0
- package/v2/resources/functions.mjs +37 -0
- package/v2/resources/functions.mjs.map +1 -0
- package/v2/resources/index.d.mts +12 -0
- package/v2/resources/index.d.mts.map +1 -0
- package/v2/resources/index.d.ts +12 -0
- package/v2/resources/index.d.ts.map +1 -0
- package/v2/resources/index.js +27 -0
- package/v2/resources/index.js.map +1 -0
- package/v2/resources/index.mjs +13 -0
- package/v2/resources/index.mjs.map +1 -0
- package/v2/resources/messages.d.mts +82 -0
- package/v2/resources/messages.d.mts.map +1 -0
- package/v2/resources/messages.d.ts +82 -0
- package/v2/resources/messages.d.ts.map +1 -0
- package/v2/resources/messages.js +74 -0
- package/v2/resources/messages.js.map +1 -0
- package/v2/resources/messages.mjs +70 -0
- package/v2/resources/messages.mjs.map +1 -0
- package/v2/resources/numbers.d.mts +46 -0
- package/v2/resources/numbers.d.mts.map +1 -0
- package/v2/resources/numbers.d.ts +46 -0
- package/v2/resources/numbers.d.ts.map +1 -0
- package/v2/resources/numbers.js +41 -0
- package/v2/resources/numbers.js.map +1 -0
- package/v2/resources/numbers.mjs +37 -0
- package/v2/resources/numbers.mjs.map +1 -0
- package/v2/resources/templates.d.mts +56 -0
- package/v2/resources/templates.d.mts.map +1 -0
- package/v2/resources/templates.d.ts +56 -0
- package/v2/resources/templates.d.ts.map +1 -0
- package/v2/resources/templates.js +61 -0
- package/v2/resources/templates.js.map +1 -0
- package/v2/resources/templates.mjs +57 -0
- package/v2/resources/templates.mjs.map +1 -0
- package/v2/resources/webhook.d.mts +67 -0
- package/v2/resources/webhook.d.mts.map +1 -0
- package/v2/resources/webhook.d.ts +67 -0
- package/v2/resources/webhook.d.ts.map +1 -0
- package/v2/resources/webhook.js +70 -0
- package/v2/resources/webhook.js.map +1 -0
- package/v2/resources/webhook.mjs +66 -0
- package/v2/resources/webhook.mjs.map +1 -0
- package/v2/types.d.mts +2171 -0
- package/v2/types.d.mts.map +1 -0
- package/v2/types.d.ts +2171 -0
- package/v2/types.d.ts.map +1 -0
- package/v2/types.js +4 -0
- package/v2/types.js.map +1 -0
- package/v2/types.mjs +3 -0
- package/v2/types.mjs.map +1 -0
- package/v2/v2.d.mts +40 -0
- package/v2/v2.d.mts.map +1 -0
- package/v2/v2.d.ts +40 -0
- package/v2/v2.d.ts.map +1 -0
- package/v2/v2.js +47 -0
- package/v2/v2.js.map +1 -0
- package/v2/v2.mjs +42 -0
- package/v2/v2.mjs.map +1 -0
- package/v2.d.mts +2 -0
- package/v2.d.mts.map +1 -0
- package/v2.d.ts +2 -0
- package/v2.d.ts.map +1 -0
- package/v2.js +6 -0
- package/v2.js.map +1 -0
- package/v2.mjs +3 -0
- package/v2.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import type * as T from '../types';
|
|
7
|
+
|
|
8
|
+
/** Search and buy phone numbers. */
|
|
9
|
+
export class Numbers extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Search numbers to buy
|
|
12
|
+
*
|
|
13
|
+
* Search numbers to buy, by country and type.
|
|
14
|
+
*
|
|
15
|
+
* `GET /v2/numbers/available`
|
|
16
|
+
*/
|
|
17
|
+
searchAvailable(
|
|
18
|
+
query: NumberSearchAvailableParams,
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): APIPromise<NumberSearchAvailableResponse> {
|
|
21
|
+
return this._client.get('/v2/numbers/available', { query, ...options });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Buy a number
|
|
26
|
+
*
|
|
27
|
+
* Buy a number and make it an SMS channel in the same call. The purchase follows
|
|
28
|
+
* the same rules as `POST /v1/phone-numbers`, including regulatory requirements,
|
|
29
|
+
* and the number comes back with SMS on. There is no separate assign step. Where
|
|
30
|
+
* it lands: when the project's default channel group has no number yet, the number
|
|
31
|
+
* joins that group (and becomes the project's first channel and default when there
|
|
32
|
+
* is none); otherwise it gets a channel group of its own.
|
|
33
|
+
*
|
|
34
|
+
* While the number is in regulatory review (`number.regulatoryStatus:
|
|
35
|
+
* pending_review`) it is attached but cannot send, and `channels` can be empty
|
|
36
|
+
* until it is approved. If the purchase succeeded but turning SMS on failed, the
|
|
37
|
+
* number is still bought and billed; the response says so in `setupError` rather
|
|
38
|
+
* than failing the call.
|
|
39
|
+
*
|
|
40
|
+
* `POST /v2/numbers`
|
|
41
|
+
*/
|
|
42
|
+
purchase(body: NumberPurchaseParams, options?: RequestOptions): APIPromise<NumberPurchaseResponse> {
|
|
43
|
+
return this._client.post('/v2/numbers', { body, ...options });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type NumberSearchAvailableParams = T.NumbersSearchAvailableParams;
|
|
48
|
+
|
|
49
|
+
export type NumberSearchAvailableResponse = T.SearchNumbersV2Response;
|
|
50
|
+
|
|
51
|
+
export type AvailablePhoneNumber = T.AvailablePhoneNumber;
|
|
52
|
+
|
|
53
|
+
export type PhoneNumberType = T.PhoneNumberType;
|
|
54
|
+
|
|
55
|
+
export type NumberPurchaseParams = T.NumbersPurchaseParams;
|
|
56
|
+
|
|
57
|
+
export type NumberPurchaseResponse = T.PurchaseNumberV2Response;
|
|
58
|
+
|
|
59
|
+
export type ErrorBody = T.ErrorBody;
|
|
60
|
+
|
|
61
|
+
export type OwnedPhoneNumber = T.OwnedPhoneNumber;
|
|
62
|
+
|
|
63
|
+
export declare namespace Numbers {
|
|
64
|
+
export {
|
|
65
|
+
type AvailablePhoneNumber as AvailablePhoneNumber,
|
|
66
|
+
type ErrorBody as ErrorBody,
|
|
67
|
+
type NumberPurchaseParams as NumberPurchaseParams,
|
|
68
|
+
type NumberPurchaseResponse as NumberPurchaseResponse,
|
|
69
|
+
type NumberSearchAvailableParams as NumberSearchAvailableParams,
|
|
70
|
+
type NumberSearchAvailableResponse as NumberSearchAvailableResponse,
|
|
71
|
+
type OwnedPhoneNumber as OwnedPhoneNumber,
|
|
72
|
+
type PhoneNumberType as PhoneNumberType,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { Cursor, PagePromise } from '../../core/pagination';
|
|
6
|
+
import { buildHeaders } from '../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
import type * as T from '../types';
|
|
10
|
+
|
|
11
|
+
/** WhatsApp message templates. */
|
|
12
|
+
export class Templates extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* List templates
|
|
15
|
+
*
|
|
16
|
+
* `GET /v2/templates`
|
|
17
|
+
*/
|
|
18
|
+
list(
|
|
19
|
+
query: TemplateListParams | null | undefined = {},
|
|
20
|
+
options?: RequestOptions,
|
|
21
|
+
): PagePromise<TemplatesCursor, Template> {
|
|
22
|
+
return this._client.getAPIList('/v2/templates', Cursor<Template>, { query, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a template
|
|
27
|
+
*
|
|
28
|
+
* `POST /v2/templates`
|
|
29
|
+
*/
|
|
30
|
+
create(body: TemplateCreateParams, options?: RequestOptions): APIPromise<TemplateCreateResponse> {
|
|
31
|
+
return this._client.post('/v2/templates', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get a template
|
|
36
|
+
*
|
|
37
|
+
* `GET /v2/templates/{templateId}`
|
|
38
|
+
*/
|
|
39
|
+
retrieve(templateID: string, options?: RequestOptions): APIPromise<TemplateRetrieveResponse> {
|
|
40
|
+
return this._client.get(path`/v2/templates/${templateID}`, options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Delete a template
|
|
45
|
+
*
|
|
46
|
+
* As `DELETE /v1/templates/{templateId}`.
|
|
47
|
+
*
|
|
48
|
+
* `DELETE /v2/templates/{templateId}`
|
|
49
|
+
*/
|
|
50
|
+
delete(templateID: string, options?: RequestOptions): APIPromise<void> {
|
|
51
|
+
return this._client.delete(path`/v2/templates/${templateID}`, {
|
|
52
|
+
...options,
|
|
53
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Submit a template to WhatsApp
|
|
59
|
+
*
|
|
60
|
+
* Submit a draft template to Meta for approval, naming the WhatsApp number by its
|
|
61
|
+
* address (`from`).
|
|
62
|
+
*
|
|
63
|
+
* `POST /v2/templates/{templateId}/submit`
|
|
64
|
+
*/
|
|
65
|
+
submit(
|
|
66
|
+
templateID: string,
|
|
67
|
+
body: TemplateSubmitParams,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): APIPromise<TemplateSubmitResponse> {
|
|
70
|
+
return this._client.post(path`/v2/templates/${templateID}/submit`, { body, ...options });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type TemplateListParams = T.TemplatesListParams;
|
|
75
|
+
|
|
76
|
+
export type Template = T.Template;
|
|
77
|
+
|
|
78
|
+
export type TemplatesCursor = Cursor<T.Template>;
|
|
79
|
+
|
|
80
|
+
export type WhatsAppCategory = T.WhatsAppCategory;
|
|
81
|
+
|
|
82
|
+
export type TemplateCreateParams = T.TemplatesCreateParams;
|
|
83
|
+
|
|
84
|
+
export type TemplateCreateResponse = T.Template;
|
|
85
|
+
|
|
86
|
+
export type TemplateRetrieveResponse = T.Template;
|
|
87
|
+
|
|
88
|
+
export type TemplateSubmitParams = T.TemplatesSubmitParams;
|
|
89
|
+
|
|
90
|
+
export type TemplateSubmitResponse = T.Template;
|
|
91
|
+
|
|
92
|
+
export declare namespace Templates {
|
|
93
|
+
export {
|
|
94
|
+
type Template as Template,
|
|
95
|
+
type TemplateCreateParams as TemplateCreateParams,
|
|
96
|
+
type TemplateCreateResponse as TemplateCreateResponse,
|
|
97
|
+
type TemplateListParams as TemplateListParams,
|
|
98
|
+
type TemplateRetrieveResponse as TemplateRetrieveResponse,
|
|
99
|
+
type TemplateSubmitParams as TemplateSubmitParams,
|
|
100
|
+
type TemplateSubmitResponse as TemplateSubmitResponse,
|
|
101
|
+
type TemplatesCursor as TemplatesCursor,
|
|
102
|
+
type WhatsAppCategory as WhatsAppCategory,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import type * as T from '../types';
|
|
8
|
+
|
|
9
|
+
/** The one project webhook for every event. */
|
|
10
|
+
export class Webhook extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Get the project webhook
|
|
13
|
+
*
|
|
14
|
+
* One webhook for the whole project and every event, `message.*`,
|
|
15
|
+
* `conversation.new` and `call.*` included. Payloads name addresses (`from`, `to`)
|
|
16
|
+
* and the transport (`type`), never a sender id; see `WebhookPayloadV2`.
|
|
17
|
+
*
|
|
18
|
+
* **Alongside /v1 webhooks.** Configuring this webhook is the opt-in. From then on
|
|
19
|
+
* each event is delivered here *in addition to* any /v1 sender webhook or /v1
|
|
20
|
+
* project webhook subscribed to it, as independent deliveries with different event
|
|
21
|
+
* ids. Nothing is deduplicated. `senderWebhooks` lists the /v1 sender webhooks
|
|
22
|
+
* still on; switch them off with `disableSenderWebhooks` on `PUT` once this one is
|
|
23
|
+
* verified.
|
|
24
|
+
*
|
|
25
|
+
* It does not share storage with `/v1/invitations/webhook`.
|
|
26
|
+
*
|
|
27
|
+
* `GET /v2/webhook`
|
|
28
|
+
*/
|
|
29
|
+
retrieve(options?: RequestOptions): APIPromise<WebhookRetrieveResponse> {
|
|
30
|
+
return this._client.get('/v2/webhook', options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Create or replace the project webhook
|
|
35
|
+
*
|
|
36
|
+
* Create or replace the webhook. `url` must be HTTPS. The signature scheme
|
|
37
|
+
* defaults to `v2`. A webhook cannot move straight from `v1` to `v2`, or from `v2`
|
|
38
|
+
* to `v1` (`400`): a receiver verifying the current scheme would break on the next
|
|
39
|
+
* delivery, so both directions go through `v1+v2`. Replacing keeps the secret.
|
|
40
|
+
*
|
|
41
|
+
* Pass `disableSenderWebhooks: true` to switch off the /v1 sender webhooks of this
|
|
42
|
+
* project in the same call, so each event arrives once.
|
|
43
|
+
*
|
|
44
|
+
* `PUT /v2/webhook`
|
|
45
|
+
*/
|
|
46
|
+
set(body: WebhookSetParams, options?: RequestOptions): APIPromise<WebhookSetResponse> {
|
|
47
|
+
return this._client.put('/v2/webhook', { body, ...options });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Remove the webhook
|
|
52
|
+
*
|
|
53
|
+
* Remove the /v2 webhook and its secret. /v1 sender webhooks are not touched,
|
|
54
|
+
* including any `disableSenderWebhooks` switched off: they stay off.
|
|
55
|
+
*
|
|
56
|
+
* `DELETE /v2/webhook`
|
|
57
|
+
*/
|
|
58
|
+
delete(options?: RequestOptions): APIPromise<void> {
|
|
59
|
+
return this._client.delete('/v2/webhook', {
|
|
60
|
+
...options,
|
|
61
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Rotate the webhook secret
|
|
67
|
+
*
|
|
68
|
+
* `POST /v2/webhook/secret`
|
|
69
|
+
*/
|
|
70
|
+
rotateSecret(options?: RequestOptions): APIPromise<WebhookRotateSecretResponse> {
|
|
71
|
+
return this._client.post('/v2/webhook/secret', options);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type WebhookRetrieveResponse = T.GetWebhookV2Response;
|
|
76
|
+
|
|
77
|
+
export type ProjectWebhookV2 = T.ProjectWebhookV2;
|
|
78
|
+
|
|
79
|
+
export type SenderWebhookV1 = T.SenderWebhookV1;
|
|
80
|
+
|
|
81
|
+
export type WebhookSetParams = T.WebhookSetParams;
|
|
82
|
+
|
|
83
|
+
export type WebhookSetResponse = T.PutWebhookV2Response;
|
|
84
|
+
|
|
85
|
+
export type WebhookEvent = T.WebhookEvent;
|
|
86
|
+
|
|
87
|
+
export type WebhookSignatureVersion = T.WebhookSignatureVersion;
|
|
88
|
+
|
|
89
|
+
export type WebhookRotateSecretResponse = T.RotateWebhookSecretV2Response;
|
|
90
|
+
|
|
91
|
+
export declare namespace Webhook {
|
|
92
|
+
export {
|
|
93
|
+
type ProjectWebhookV2 as ProjectWebhookV2,
|
|
94
|
+
type SenderWebhookV1 as SenderWebhookV1,
|
|
95
|
+
type WebhookEvent as WebhookEvent,
|
|
96
|
+
type WebhookRetrieveResponse as WebhookRetrieveResponse,
|
|
97
|
+
type WebhookRotateSecretResponse as WebhookRotateSecretResponse,
|
|
98
|
+
type WebhookSetParams as WebhookSetParams,
|
|
99
|
+
type WebhookSetResponse as WebhookSetResponse,
|
|
100
|
+
type WebhookSignatureVersion as WebhookSignatureVersion,
|
|
101
|
+
};
|
|
102
|
+
}
|