@zavudev/sdk 0.58.1 → 0.59.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 +27 -0
- 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 +29 -12
- 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 +2429 -0
- package/src/v2/v2.ts +315 -0
- package/src/v2.ts +3 -0
- package/src/version.ts +1 -1
- package/types.d.mts +29 -12
- package/types.d.mts.map +1 -1
- package/types.d.ts +29 -12
- 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 +2188 -0
- package/v2/types.d.mts.map +1 -0
- package/v2/types.d.ts +2188 -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,62 @@
|
|
|
1
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
6
|
+
/** Contacts and the identifiers they are reached at. */
|
|
7
|
+
export class Contacts extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List contacts
|
|
10
|
+
*
|
|
11
|
+
* List contacts with their channels. A repeated `tag` means all of them.
|
|
12
|
+
*
|
|
13
|
+
* `GET /v2/contacts`
|
|
14
|
+
*/
|
|
15
|
+
list(query = {}, options) {
|
|
16
|
+
return this._client.getAPIList('/v2/contacts', (Cursor), { query, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create a contact
|
|
20
|
+
*
|
|
21
|
+
* Create a contact with one or more channels. An identifier another contact
|
|
22
|
+
* already holds on the same channel is refused (`400 duplicate_identifier`, with
|
|
23
|
+
* `details.conflicts[{channel, identifier, contactId}]`); update the existing
|
|
24
|
+
* contact with `PATCH /v2/contacts/{contactId}` instead.
|
|
25
|
+
*
|
|
26
|
+
* `POST /v2/contacts`
|
|
27
|
+
*/
|
|
28
|
+
create(body, options) {
|
|
29
|
+
return this._client.post('/v2/contacts', { body, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get a contact
|
|
33
|
+
*
|
|
34
|
+
* `GET /v2/contacts/{contactId}`
|
|
35
|
+
*/
|
|
36
|
+
retrieve(contactID, options) {
|
|
37
|
+
return this._client.get(path `/v2/contacts/${contactID}`, options);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Update a contact
|
|
41
|
+
*
|
|
42
|
+
* `PATCH /v2/contacts/{contactId}`
|
|
43
|
+
*/
|
|
44
|
+
update(contactID, body = {}, options) {
|
|
45
|
+
return this._client.patch(path `/v2/contacts/${contactID}`, { body, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Delete a contact
|
|
49
|
+
*
|
|
50
|
+
* Permanently delete a contact and its channels (right to erasure). Conversations,
|
|
51
|
+
* message history and campaign delivery logs are kept and no longer reference it.
|
|
52
|
+
*
|
|
53
|
+
* `DELETE /v2/contacts/{contactId}`
|
|
54
|
+
*/
|
|
55
|
+
delete(contactID, options) {
|
|
56
|
+
return this._client.delete(path `/v2/contacts/${contactID}`, {
|
|
57
|
+
...options,
|
|
58
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=contacts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.mjs","sourceRoot":"","sources":["../../src/v2/resources/contacts.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,MAAM,EAAe,kCAA8B;AAC5D,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAGjD,wDAAwD;AACxD,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;OAMG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,MAAe,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,SAAiB,EACjB,OAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { Cursor, PagePromise } from "../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
+
import type * as T from "../types.mjs";
|
|
6
|
+
import { type Message, type MessagesCursor } from "./messages.mjs";
|
|
7
|
+
/** Inbox threads, one per contact across channels. */
|
|
8
|
+
export declare class Conversations extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List conversations
|
|
11
|
+
*
|
|
12
|
+
* List inbox threads, most recently active first. Filter by `from` (one of your
|
|
13
|
+
* addresses) and `channel`. Each conversation carries `from`, the address it was
|
|
14
|
+
* last handled from.
|
|
15
|
+
*
|
|
16
|
+
* `GET /v2/conversations`
|
|
17
|
+
*/
|
|
18
|
+
list(query?: ConversationListParams | null | undefined, options?: RequestOptions): PagePromise<ConversationsCursor, Conversation>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a conversation
|
|
21
|
+
*
|
|
22
|
+
* `GET /v2/conversations/{conversationId}`
|
|
23
|
+
*/
|
|
24
|
+
retrieve(conversationID: string, options?: RequestOptions): APIPromise<ConversationRetrieveResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* List a conversation's messages
|
|
27
|
+
*
|
|
28
|
+
* Reply with `POST /v2/messages` and this `conversationId`.
|
|
29
|
+
*
|
|
30
|
+
* `GET /v2/conversations/{conversationId}/messages`
|
|
31
|
+
*/
|
|
32
|
+
listMessages(conversationID: string, query?: ConversationListMessagesParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, Message>;
|
|
33
|
+
/**
|
|
34
|
+
* Mark a conversation read
|
|
35
|
+
*
|
|
36
|
+
* Resets `unreadCount` in your inbox. Sends no read receipt to the contact.
|
|
37
|
+
*
|
|
38
|
+
* `POST /v2/conversations/{conversationId}/read`
|
|
39
|
+
*/
|
|
40
|
+
markAsRead(conversationID: string, options?: RequestOptions): APIPromise<ConversationMarkAsReadResponse>;
|
|
41
|
+
}
|
|
42
|
+
export type ConversationListParams = T.ConversationsListParams;
|
|
43
|
+
export type Conversation = T.Conversation;
|
|
44
|
+
export type ConversationsCursor = Cursor<T.Conversation>;
|
|
45
|
+
export type ConversationRetrieveResponse = T.GetConversationV2Response;
|
|
46
|
+
export type ConversationListMessagesParams = T.ConversationsListMessagesParams;
|
|
47
|
+
export type ConversationMarkAsReadResponse = T.MarkConversationReadV2Response;
|
|
48
|
+
export declare namespace Conversations {
|
|
49
|
+
export { type Conversation as Conversation, type ConversationListMessagesParams as ConversationListMessagesParams, type ConversationListParams as ConversationListParams, type ConversationMarkAsReadResponse as ConversationMarkAsReadResponse, type ConversationRetrieveResponse as ConversationRetrieveResponse, type ConversationsCursor as ConversationsCursor, };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=conversations.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.mts","sourceRoot":"","sources":["../../src/v2/resources/conversations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,kCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,qBAAiB;AACnC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,uBAAmB;AAE/D,sDAAsD;AACtD,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAIjD;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAIpG;;;;;;OAMG;IACH,YAAY,CACV,cAAc,EAAE,MAAM,EACtB,KAAK,GAAE,8BAA8B,GAAG,IAAI,GAAG,SAAc,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC;IAOvC;;;;;;OAMG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;CAGzG;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,uBAAuB,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AAEzD,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,yBAAyB,CAAC;AAEvE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,+BAA+B,CAAC;AAE/E,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,8BAA8B,CAAC;AAE9E,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { Cursor, PagePromise } from "../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
import type * as T from "../types.js";
|
|
6
|
+
import { type Message, type MessagesCursor } from "./messages.js";
|
|
7
|
+
/** Inbox threads, one per contact across channels. */
|
|
8
|
+
export declare class Conversations extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List conversations
|
|
11
|
+
*
|
|
12
|
+
* List inbox threads, most recently active first. Filter by `from` (one of your
|
|
13
|
+
* addresses) and `channel`. Each conversation carries `from`, the address it was
|
|
14
|
+
* last handled from.
|
|
15
|
+
*
|
|
16
|
+
* `GET /v2/conversations`
|
|
17
|
+
*/
|
|
18
|
+
list(query?: ConversationListParams | null | undefined, options?: RequestOptions): PagePromise<ConversationsCursor, Conversation>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a conversation
|
|
21
|
+
*
|
|
22
|
+
* `GET /v2/conversations/{conversationId}`
|
|
23
|
+
*/
|
|
24
|
+
retrieve(conversationID: string, options?: RequestOptions): APIPromise<ConversationRetrieveResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* List a conversation's messages
|
|
27
|
+
*
|
|
28
|
+
* Reply with `POST /v2/messages` and this `conversationId`.
|
|
29
|
+
*
|
|
30
|
+
* `GET /v2/conversations/{conversationId}/messages`
|
|
31
|
+
*/
|
|
32
|
+
listMessages(conversationID: string, query?: ConversationListMessagesParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, Message>;
|
|
33
|
+
/**
|
|
34
|
+
* Mark a conversation read
|
|
35
|
+
*
|
|
36
|
+
* Resets `unreadCount` in your inbox. Sends no read receipt to the contact.
|
|
37
|
+
*
|
|
38
|
+
* `POST /v2/conversations/{conversationId}/read`
|
|
39
|
+
*/
|
|
40
|
+
markAsRead(conversationID: string, options?: RequestOptions): APIPromise<ConversationMarkAsReadResponse>;
|
|
41
|
+
}
|
|
42
|
+
export type ConversationListParams = T.ConversationsListParams;
|
|
43
|
+
export type Conversation = T.Conversation;
|
|
44
|
+
export type ConversationsCursor = Cursor<T.Conversation>;
|
|
45
|
+
export type ConversationRetrieveResponse = T.GetConversationV2Response;
|
|
46
|
+
export type ConversationListMessagesParams = T.ConversationsListMessagesParams;
|
|
47
|
+
export type ConversationMarkAsReadResponse = T.MarkConversationReadV2Response;
|
|
48
|
+
export declare namespace Conversations {
|
|
49
|
+
export { type Conversation as Conversation, type ConversationListMessagesParams as ConversationListMessagesParams, type ConversationListParams as ConversationListParams, type ConversationMarkAsReadResponse as ConversationMarkAsReadResponse, type ConversationRetrieveResponse as ConversationRetrieveResponse, type ConversationsCursor as ConversationsCursor, };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/v2/resources/conversations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,iCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,oBAAiB;AACnC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAmB;AAE/D,sDAAsD;AACtD,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAIjD;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAIpG;;;;;;OAMG;IACH,YAAY,CACV,cAAc,EAAE,MAAM,EACtB,KAAK,GAAE,8BAA8B,GAAG,IAAI,GAAG,SAAc,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC;IAOvC;;;;;;OAMG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;CAGzG;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,uBAAuB,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AAEzD,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,yBAAyB,CAAC;AAEvE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,+BAA+B,CAAC;AAE/E,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,8BAA8B,CAAC;AAE9E,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Conversations = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
/** Inbox threads, one per contact across channels. */
|
|
9
|
+
class Conversations extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List conversations
|
|
12
|
+
*
|
|
13
|
+
* List inbox threads, most recently active first. Filter by `from` (one of your
|
|
14
|
+
* addresses) and `channel`. Each conversation carries `from`, the address it was
|
|
15
|
+
* last handled from.
|
|
16
|
+
*
|
|
17
|
+
* `GET /v2/conversations`
|
|
18
|
+
*/
|
|
19
|
+
list(query = {}, options) {
|
|
20
|
+
return this._client.getAPIList('/v2/conversations', (pagination_1.Cursor), { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get a conversation
|
|
24
|
+
*
|
|
25
|
+
* `GET /v2/conversations/{conversationId}`
|
|
26
|
+
*/
|
|
27
|
+
retrieve(conversationID, options) {
|
|
28
|
+
return this._client.get((0, path_1.path) `/v2/conversations/${conversationID}`, options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List a conversation's messages
|
|
32
|
+
*
|
|
33
|
+
* Reply with `POST /v2/messages` and this `conversationId`.
|
|
34
|
+
*
|
|
35
|
+
* `GET /v2/conversations/{conversationId}/messages`
|
|
36
|
+
*/
|
|
37
|
+
listMessages(conversationID, query = {}, options) {
|
|
38
|
+
return this._client.getAPIList((0, path_1.path) `/v2/conversations/${conversationID}/messages`, (pagination_1.Cursor), {
|
|
39
|
+
query,
|
|
40
|
+
...options,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Mark a conversation read
|
|
45
|
+
*
|
|
46
|
+
* Resets `unreadCount` in your inbox. Sends no read receipt to the contact.
|
|
47
|
+
*
|
|
48
|
+
* `POST /v2/conversations/{conversationId}/read`
|
|
49
|
+
*/
|
|
50
|
+
markAsRead(conversationID, options) {
|
|
51
|
+
return this._client.post((0, path_1.path) `/v2/conversations/${conversationID}/read`, options);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.Conversations = Conversations;
|
|
55
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/v2/resources/conversations.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,qDAAkD;AAElD,yDAA4D;AAE5D,uDAAiD;AAIjD,sDAAsD;AACtD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAA,mBAAoB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CACV,cAAsB,EACtB,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,WAAW,EAAE,CAAA,mBAAe,CAAA,EAAE;YAClG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,cAAsB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,OAAO,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACF;AAtDD,sCAsDC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../../core/pagination.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
/** Inbox threads, one per contact across channels. */
|
|
6
|
+
export class Conversations extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* List conversations
|
|
9
|
+
*
|
|
10
|
+
* List inbox threads, most recently active first. Filter by `from` (one of your
|
|
11
|
+
* addresses) and `channel`. Each conversation carries `from`, the address it was
|
|
12
|
+
* last handled from.
|
|
13
|
+
*
|
|
14
|
+
* `GET /v2/conversations`
|
|
15
|
+
*/
|
|
16
|
+
list(query = {}, options) {
|
|
17
|
+
return this._client.getAPIList('/v2/conversations', (Cursor), { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a conversation
|
|
21
|
+
*
|
|
22
|
+
* `GET /v2/conversations/{conversationId}`
|
|
23
|
+
*/
|
|
24
|
+
retrieve(conversationID, options) {
|
|
25
|
+
return this._client.get(path `/v2/conversations/${conversationID}`, options);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* List a conversation's messages
|
|
29
|
+
*
|
|
30
|
+
* Reply with `POST /v2/messages` and this `conversationId`.
|
|
31
|
+
*
|
|
32
|
+
* `GET /v2/conversations/{conversationId}/messages`
|
|
33
|
+
*/
|
|
34
|
+
listMessages(conversationID, query = {}, options) {
|
|
35
|
+
return this._client.getAPIList(path `/v2/conversations/${conversationID}/messages`, (Cursor), {
|
|
36
|
+
query,
|
|
37
|
+
...options,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Mark a conversation read
|
|
42
|
+
*
|
|
43
|
+
* Resets `unreadCount` in your inbox. Sends no read receipt to the contact.
|
|
44
|
+
*
|
|
45
|
+
* `POST /v2/conversations/{conversationId}/read`
|
|
46
|
+
*/
|
|
47
|
+
markAsRead(conversationID, options) {
|
|
48
|
+
return this._client.post(path `/v2/conversations/${conversationID}/read`, options);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=conversations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.mjs","sourceRoot":"","sources":["../../src/v2/resources/conversations.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,MAAM,EAAe,kCAA8B;AAE5D,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAIjD,sDAAsD;AACtD,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAA,MAAoB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CACV,cAAsB,EACtB,QAA2D,EAAE,EAC7D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,qBAAqB,cAAc,WAAW,EAAE,CAAA,MAAe,CAAA,EAAE;YAClG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,cAAsB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,cAAc,OAAO,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
import type * as T from "../types.mjs";
|
|
5
|
+
/** Domains to send email from. */
|
|
6
|
+
export declare class EmailDomains extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* List email domains
|
|
9
|
+
*
|
|
10
|
+
* Email domains of this project.
|
|
11
|
+
*
|
|
12
|
+
* `GET /v2/email-domains`
|
|
13
|
+
*/
|
|
14
|
+
list(options?: RequestOptions): APIPromise<EmailDomainListResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Add an email domain
|
|
17
|
+
*
|
|
18
|
+
* Add a domain to send email from. `domain` is validated first: a bare domain (a
|
|
19
|
+
* leading `https://` and a trailing path are dropped); anything else, spaces
|
|
20
|
+
* included, is `400` with `details.errors[0].path` `["domain"]`. Adding a domain
|
|
21
|
+
* the project already has returns it with `200` (nothing created), like `POST
|
|
22
|
+
* /v2/channels`.
|
|
23
|
+
*
|
|
24
|
+
* Returns the DNS records to publish; the DKIM CNAMEs are required. If they could
|
|
25
|
+
* not be generated, the domain is still created (`201`) but comes back
|
|
26
|
+
* `verifiable: false` with `setupError`: remove it and add it again, or contact
|
|
27
|
+
* support. Verify cannot fix it.
|
|
28
|
+
*
|
|
29
|
+
* Publish the records exactly as returned, verify, then connect an address with
|
|
30
|
+
* `POST /v2/channels {"type":"email"}`.
|
|
31
|
+
*
|
|
32
|
+
* `POST /v2/email-domains`
|
|
33
|
+
*/
|
|
34
|
+
create(body: EmailDomainCreateParams, options?: RequestOptions): APIPromise<EmailDomainCreateResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Get an email domain
|
|
37
|
+
*
|
|
38
|
+
* The domain with its DNS records and status.
|
|
39
|
+
*
|
|
40
|
+
* `GET /v2/email-domains/{emailDomainId}`
|
|
41
|
+
*/
|
|
42
|
+
retrieve(emailDomainID: string, options?: RequestOptions): APIPromise<EmailDomainRetrieveResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove an email domain
|
|
45
|
+
*
|
|
46
|
+
* `DELETE /v2/email-domains/{emailDomainId}`
|
|
47
|
+
*/
|
|
48
|
+
delete(emailDomainID: string, options?: RequestOptions): APIPromise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Verify an email domain
|
|
51
|
+
*
|
|
52
|
+
* Re-check the domain's DNS records and refresh its status. `404` only for a
|
|
53
|
+
* domain that is not this project's; `503 verification_unavailable` when the check
|
|
54
|
+
* could not run (nothing changed, retry). A domain with no DKIM records
|
|
55
|
+
* (`verifiable: false`) cannot verify whatever DNS says: verify runs the check (it
|
|
56
|
+
* may recover the records), and when the domain still has none it answers `409
|
|
57
|
+
* domain_setup_failed` with the same `setupError` the domain carries.
|
|
58
|
+
*
|
|
59
|
+
* `POST /v2/email-domains/{emailDomainId}/verify`
|
|
60
|
+
*/
|
|
61
|
+
verify(emailDomainID: string, options?: RequestOptions): APIPromise<EmailDomainVerifyResponse>;
|
|
62
|
+
}
|
|
63
|
+
export type EmailDomainListResponse = T.ListEmailDomainsV2Response;
|
|
64
|
+
export type EmailDomain = T.EmailDomain;
|
|
65
|
+
export type EmailDomainCreateParams = T.EmailDomainsCreateParams;
|
|
66
|
+
export type EmailDomainCreateResponse = T.AddEmailDomainV2Response;
|
|
67
|
+
export type EmailDomainRetrieveResponse = T.GetEmailDomainV2Response;
|
|
68
|
+
export type EmailDomainVerifyResponse = T.VerifyEmailDomainV2Response;
|
|
69
|
+
export declare namespace EmailDomains {
|
|
70
|
+
export { type EmailDomain as EmailDomain, type EmailDomainCreateParams as EmailDomainCreateParams, type EmailDomainCreateResponse as EmailDomainCreateResponse, type EmailDomainListResponse as EmailDomainListResponse, type EmailDomainRetrieveResponse as EmailDomainRetrieveResponse, type EmailDomainVerifyResponse as EmailDomainVerifyResponse, };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=email-domains.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-domains.d.mts","sourceRoot":"","sources":["../../src/v2/resources/email-domains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,qBAAiB;AAEnC,kCAAkC;AAClC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAInE;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAItG;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;IAIlG;;;;OAIG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOzE;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;CAG/F;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,0BAA0B,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAEjE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAEnE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAErE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,2BAA2B,CAAC;AAEtE,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
import type * as T from "../types.js";
|
|
5
|
+
/** Domains to send email from. */
|
|
6
|
+
export declare class EmailDomains extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* List email domains
|
|
9
|
+
*
|
|
10
|
+
* Email domains of this project.
|
|
11
|
+
*
|
|
12
|
+
* `GET /v2/email-domains`
|
|
13
|
+
*/
|
|
14
|
+
list(options?: RequestOptions): APIPromise<EmailDomainListResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Add an email domain
|
|
17
|
+
*
|
|
18
|
+
* Add a domain to send email from. `domain` is validated first: a bare domain (a
|
|
19
|
+
* leading `https://` and a trailing path are dropped); anything else, spaces
|
|
20
|
+
* included, is `400` with `details.errors[0].path` `["domain"]`. Adding a domain
|
|
21
|
+
* the project already has returns it with `200` (nothing created), like `POST
|
|
22
|
+
* /v2/channels`.
|
|
23
|
+
*
|
|
24
|
+
* Returns the DNS records to publish; the DKIM CNAMEs are required. If they could
|
|
25
|
+
* not be generated, the domain is still created (`201`) but comes back
|
|
26
|
+
* `verifiable: false` with `setupError`: remove it and add it again, or contact
|
|
27
|
+
* support. Verify cannot fix it.
|
|
28
|
+
*
|
|
29
|
+
* Publish the records exactly as returned, verify, then connect an address with
|
|
30
|
+
* `POST /v2/channels {"type":"email"}`.
|
|
31
|
+
*
|
|
32
|
+
* `POST /v2/email-domains`
|
|
33
|
+
*/
|
|
34
|
+
create(body: EmailDomainCreateParams, options?: RequestOptions): APIPromise<EmailDomainCreateResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Get an email domain
|
|
37
|
+
*
|
|
38
|
+
* The domain with its DNS records and status.
|
|
39
|
+
*
|
|
40
|
+
* `GET /v2/email-domains/{emailDomainId}`
|
|
41
|
+
*/
|
|
42
|
+
retrieve(emailDomainID: string, options?: RequestOptions): APIPromise<EmailDomainRetrieveResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove an email domain
|
|
45
|
+
*
|
|
46
|
+
* `DELETE /v2/email-domains/{emailDomainId}`
|
|
47
|
+
*/
|
|
48
|
+
delete(emailDomainID: string, options?: RequestOptions): APIPromise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Verify an email domain
|
|
51
|
+
*
|
|
52
|
+
* Re-check the domain's DNS records and refresh its status. `404` only for a
|
|
53
|
+
* domain that is not this project's; `503 verification_unavailable` when the check
|
|
54
|
+
* could not run (nothing changed, retry). A domain with no DKIM records
|
|
55
|
+
* (`verifiable: false`) cannot verify whatever DNS says: verify runs the check (it
|
|
56
|
+
* may recover the records), and when the domain still has none it answers `409
|
|
57
|
+
* domain_setup_failed` with the same `setupError` the domain carries.
|
|
58
|
+
*
|
|
59
|
+
* `POST /v2/email-domains/{emailDomainId}/verify`
|
|
60
|
+
*/
|
|
61
|
+
verify(emailDomainID: string, options?: RequestOptions): APIPromise<EmailDomainVerifyResponse>;
|
|
62
|
+
}
|
|
63
|
+
export type EmailDomainListResponse = T.ListEmailDomainsV2Response;
|
|
64
|
+
export type EmailDomain = T.EmailDomain;
|
|
65
|
+
export type EmailDomainCreateParams = T.EmailDomainsCreateParams;
|
|
66
|
+
export type EmailDomainCreateResponse = T.AddEmailDomainV2Response;
|
|
67
|
+
export type EmailDomainRetrieveResponse = T.GetEmailDomainV2Response;
|
|
68
|
+
export type EmailDomainVerifyResponse = T.VerifyEmailDomainV2Response;
|
|
69
|
+
export declare namespace EmailDomains {
|
|
70
|
+
export { type EmailDomain as EmailDomain, type EmailDomainCreateParams as EmailDomainCreateParams, type EmailDomainCreateResponse as EmailDomainCreateResponse, type EmailDomainListResponse as EmailDomainListResponse, type EmailDomainRetrieveResponse as EmailDomainRetrieveResponse, type EmailDomainVerifyResponse as EmailDomainVerifyResponse, };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=email-domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-domains.d.ts","sourceRoot":"","sources":["../../src/v2/resources/email-domains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,oBAAiB;AAEnC,kCAAkC;AAClC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAInE;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAItG;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;IAIlG;;;;OAIG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOzE;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;CAG/F;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,0BAA0B,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAEjE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAEnE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAErE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,2BAA2B,CAAC;AAEtE,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EmailDomains = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
/** Domains to send email from. */
|
|
9
|
+
class EmailDomains extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List email domains
|
|
12
|
+
*
|
|
13
|
+
* Email domains of this project.
|
|
14
|
+
*
|
|
15
|
+
* `GET /v2/email-domains`
|
|
16
|
+
*/
|
|
17
|
+
list(options) {
|
|
18
|
+
return this._client.get('/v2/email-domains', options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Add an email domain
|
|
22
|
+
*
|
|
23
|
+
* Add a domain to send email from. `domain` is validated first: a bare domain (a
|
|
24
|
+
* leading `https://` and a trailing path are dropped); anything else, spaces
|
|
25
|
+
* included, is `400` with `details.errors[0].path` `["domain"]`. Adding a domain
|
|
26
|
+
* the project already has returns it with `200` (nothing created), like `POST
|
|
27
|
+
* /v2/channels`.
|
|
28
|
+
*
|
|
29
|
+
* Returns the DNS records to publish; the DKIM CNAMEs are required. If they could
|
|
30
|
+
* not be generated, the domain is still created (`201`) but comes back
|
|
31
|
+
* `verifiable: false` with `setupError`: remove it and add it again, or contact
|
|
32
|
+
* support. Verify cannot fix it.
|
|
33
|
+
*
|
|
34
|
+
* Publish the records exactly as returned, verify, then connect an address with
|
|
35
|
+
* `POST /v2/channels {"type":"email"}`.
|
|
36
|
+
*
|
|
37
|
+
* `POST /v2/email-domains`
|
|
38
|
+
*/
|
|
39
|
+
create(body, options) {
|
|
40
|
+
return this._client.post('/v2/email-domains', { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get an email domain
|
|
44
|
+
*
|
|
45
|
+
* The domain with its DNS records and status.
|
|
46
|
+
*
|
|
47
|
+
* `GET /v2/email-domains/{emailDomainId}`
|
|
48
|
+
*/
|
|
49
|
+
retrieve(emailDomainID, options) {
|
|
50
|
+
return this._client.get((0, path_1.path) `/v2/email-domains/${emailDomainID}`, options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Remove an email domain
|
|
54
|
+
*
|
|
55
|
+
* `DELETE /v2/email-domains/{emailDomainId}`
|
|
56
|
+
*/
|
|
57
|
+
delete(emailDomainID, options) {
|
|
58
|
+
return this._client.delete((0, path_1.path) `/v2/email-domains/${emailDomainID}`, {
|
|
59
|
+
...options,
|
|
60
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Verify an email domain
|
|
65
|
+
*
|
|
66
|
+
* Re-check the domain's DNS records and refresh its status. `404` only for a
|
|
67
|
+
* domain that is not this project's; `503 verification_unavailable` when the check
|
|
68
|
+
* could not run (nothing changed, retry). A domain with no DKIM records
|
|
69
|
+
* (`verifiable: false`) cannot verify whatever DNS says: verify runs the check (it
|
|
70
|
+
* may recover the records), and when the domain still has none it answers `409
|
|
71
|
+
* domain_setup_failed` with the same `setupError` the domain carries.
|
|
72
|
+
*
|
|
73
|
+
* `POST /v2/email-domains/{emailDomainId}/verify`
|
|
74
|
+
*/
|
|
75
|
+
verify(emailDomainID, options) {
|
|
76
|
+
return this._client.post((0, path_1.path) `/v2/email-domains/${emailDomainID}/verify`, options);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.EmailDomains = EmailDomains;
|
|
80
|
+
//# sourceMappingURL=email-domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-domains.js","sourceRoot":"","sources":["../../src/v2/resources/email-domains.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAGjD,kCAAkC;AAClC,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;OAMG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,aAAqB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,qBAAqB,aAAa,EAAE,EAAE;YACnE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,aAAa,SAAS,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AAzED,oCAyEC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
/** Domains to send email from. */
|
|
6
|
+
export class EmailDomains extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* List email domains
|
|
9
|
+
*
|
|
10
|
+
* Email domains of this project.
|
|
11
|
+
*
|
|
12
|
+
* `GET /v2/email-domains`
|
|
13
|
+
*/
|
|
14
|
+
list(options) {
|
|
15
|
+
return this._client.get('/v2/email-domains', options);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Add an email domain
|
|
19
|
+
*
|
|
20
|
+
* Add a domain to send email from. `domain` is validated first: a bare domain (a
|
|
21
|
+
* leading `https://` and a trailing path are dropped); anything else, spaces
|
|
22
|
+
* included, is `400` with `details.errors[0].path` `["domain"]`. Adding a domain
|
|
23
|
+
* the project already has returns it with `200` (nothing created), like `POST
|
|
24
|
+
* /v2/channels`.
|
|
25
|
+
*
|
|
26
|
+
* Returns the DNS records to publish; the DKIM CNAMEs are required. If they could
|
|
27
|
+
* not be generated, the domain is still created (`201`) but comes back
|
|
28
|
+
* `verifiable: false` with `setupError`: remove it and add it again, or contact
|
|
29
|
+
* support. Verify cannot fix it.
|
|
30
|
+
*
|
|
31
|
+
* Publish the records exactly as returned, verify, then connect an address with
|
|
32
|
+
* `POST /v2/channels {"type":"email"}`.
|
|
33
|
+
*
|
|
34
|
+
* `POST /v2/email-domains`
|
|
35
|
+
*/
|
|
36
|
+
create(body, options) {
|
|
37
|
+
return this._client.post('/v2/email-domains', { body, ...options });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get an email domain
|
|
41
|
+
*
|
|
42
|
+
* The domain with its DNS records and status.
|
|
43
|
+
*
|
|
44
|
+
* `GET /v2/email-domains/{emailDomainId}`
|
|
45
|
+
*/
|
|
46
|
+
retrieve(emailDomainID, options) {
|
|
47
|
+
return this._client.get(path `/v2/email-domains/${emailDomainID}`, options);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Remove an email domain
|
|
51
|
+
*
|
|
52
|
+
* `DELETE /v2/email-domains/{emailDomainId}`
|
|
53
|
+
*/
|
|
54
|
+
delete(emailDomainID, options) {
|
|
55
|
+
return this._client.delete(path `/v2/email-domains/${emailDomainID}`, {
|
|
56
|
+
...options,
|
|
57
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Verify an email domain
|
|
62
|
+
*
|
|
63
|
+
* Re-check the domain's DNS records and refresh its status. `404` only for a
|
|
64
|
+
* domain that is not this project's; `503 verification_unavailable` when the check
|
|
65
|
+
* could not run (nothing changed, retry). A domain with no DKIM records
|
|
66
|
+
* (`verifiable: false`) cannot verify whatever DNS says: verify runs the check (it
|
|
67
|
+
* may recover the records), and when the domain still has none it answers `409
|
|
68
|
+
* domain_setup_failed` with the same `setupError` the domain carries.
|
|
69
|
+
*
|
|
70
|
+
* `POST /v2/email-domains/{emailDomainId}/verify`
|
|
71
|
+
*/
|
|
72
|
+
verify(emailDomainID, options) {
|
|
73
|
+
return this._client.post(path `/v2/email-domains/${emailDomainID}/verify`, options);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=email-domains.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-domains.mjs","sourceRoot":"","sources":["../../src/v2/resources/email-domains.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAGjD,kCAAkC;AAClC,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;OAMG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,aAAqB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,qBAAqB,aAAa,EAAE,EAAE;YACnE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,aAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,aAAa,SAAS,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF"}
|