telnyx 7.11.0 → 7.13.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 +24 -0
- package/client.d.mts +56 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +56 -2
- package/client.d.ts.map +1 -1
- package/client.js +54 -0
- package/client.js.map +1 -1
- package/client.mjs +54 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +6 -0
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +6 -0
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/anthropic/v1.d.mts +3 -1
- package/resources/ai/anthropic/v1.d.mts.map +1 -1
- package/resources/ai/anthropic/v1.d.ts +3 -1
- package/resources/ai/anthropic/v1.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.d.mts +6 -2
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +6 -2
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/chat.d.mts +6 -0
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +6 -0
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/openai/chat.d.mts +6 -0
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +6 -0
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/openai/openai.d.mts +6 -0
- package/resources/ai/openai/openai.d.mts.map +1 -1
- package/resources/ai/openai/openai.d.ts +6 -0
- package/resources/ai/openai/openai.d.ts.map +1 -1
- package/resources/ai/openai/openai.js.map +1 -1
- package/resources/ai/openai/openai.mjs.map +1 -1
- package/resources/calls/actions.d.mts +223 -48
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +223 -48
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/actions.js +31 -0
- package/resources/calls/actions.js.map +1 -1
- package/resources/calls/actions.mjs +31 -0
- package/resources/calls/actions.mjs.map +1 -1
- package/resources/calls/calls.d.mts +3 -2
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +3 -2
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/calls/index.d.mts +1 -1
- package/resources/calls/index.d.mts.map +1 -1
- package/resources/calls/index.d.ts +1 -1
- package/resources/calls/index.d.ts.map +1 -1
- package/resources/calls/index.js.map +1 -1
- package/resources/calls/index.mjs.map +1 -1
- package/resources/custom-storage-credentials.d.mts +110 -14
- package/resources/custom-storage-credentials.d.mts.map +1 -1
- package/resources/custom-storage-credentials.d.ts +110 -14
- package/resources/custom-storage-credentials.d.ts.map +1 -1
- package/resources/dir/dir.d.mts +3 -2
- package/resources/dir/dir.d.mts.map +1 -1
- package/resources/dir/dir.d.ts +3 -2
- package/resources/dir/dir.d.ts.map +1 -1
- package/resources/dir/dir.js +3 -2
- package/resources/dir/dir.js.map +1 -1
- package/resources/dir/dir.mjs +3 -2
- package/resources/dir/dir.mjs.map +1 -1
- package/resources/dir/references.d.mts +41 -11
- package/resources/dir/references.d.mts.map +1 -1
- package/resources/dir/references.d.ts +41 -11
- package/resources/dir/references.d.ts.map +1 -1
- package/resources/dir/references.js +30 -8
- package/resources/dir/references.js.map +1 -1
- package/resources/dir/references.mjs +30 -8
- package/resources/dir/references.mjs.map +1 -1
- package/resources/dir/verify-email.d.mts +10 -0
- package/resources/dir/verify-email.d.mts.map +1 -1
- package/resources/dir/verify-email.d.ts +10 -0
- package/resources/dir/verify-email.d.ts.map +1 -1
- package/resources/email-blocks/email-blocks.d.mts +255 -0
- package/resources/email-blocks/email-blocks.d.mts.map +1 -0
- package/resources/email-blocks/email-blocks.d.ts +255 -0
- package/resources/email-blocks/email-blocks.d.ts.map +1 -0
- package/resources/email-blocks/email-blocks.js +99 -0
- package/resources/email-blocks/email-blocks.js.map +1 -0
- package/resources/email-blocks/email-blocks.mjs +94 -0
- package/resources/email-blocks/email-blocks.mjs.map +1 -0
- package/resources/email-blocks/import.d.mts +111 -0
- package/resources/email-blocks/import.d.mts.map +1 -0
- package/resources/email-blocks/import.d.ts +111 -0
- package/resources/email-blocks/import.d.ts.map +1 -0
- package/resources/email-blocks/import.js +40 -0
- package/resources/email-blocks/import.js.map +1 -0
- package/resources/email-blocks/import.mjs +36 -0
- package/resources/email-blocks/import.mjs.map +1 -0
- package/resources/email-blocks/index.d.mts +3 -0
- package/resources/email-blocks/index.d.mts.map +1 -0
- package/resources/email-blocks/index.d.ts +3 -0
- package/resources/email-blocks/index.d.ts.map +1 -0
- package/resources/email-blocks/index.js +9 -0
- package/resources/email-blocks/index.js.map +1 -0
- package/resources/email-blocks/index.mjs +4 -0
- package/resources/email-blocks/index.mjs.map +1 -0
- package/resources/email-blocks.d.mts +2 -0
- package/resources/email-blocks.d.mts.map +1 -0
- package/resources/email-blocks.d.ts +2 -0
- package/resources/email-blocks.d.ts.map +1 -0
- package/resources/email-blocks.js +6 -0
- package/resources/email-blocks.js.map +1 -0
- package/resources/email-blocks.mjs +3 -0
- package/resources/email-blocks.mjs.map +1 -0
- package/resources/email-domains/email-domains.d.mts +344 -0
- package/resources/email-domains/email-domains.d.mts.map +1 -0
- package/resources/email-domains/email-domains.d.ts +344 -0
- package/resources/email-domains/email-domains.d.ts.map +1 -0
- package/resources/email-domains/email-domains.js +146 -0
- package/resources/email-domains/email-domains.js.map +1 -0
- package/resources/email-domains/email-domains.mjs +141 -0
- package/resources/email-domains/email-domains.mjs.map +1 -0
- package/resources/email-domains/index.d.mts +3 -0
- package/resources/email-domains/index.d.mts.map +1 -0
- package/resources/email-domains/index.d.ts +3 -0
- package/resources/email-domains/index.d.ts.map +1 -0
- package/resources/email-domains/index.js +9 -0
- package/resources/email-domains/index.js.map +1 -0
- package/resources/email-domains/index.mjs +4 -0
- package/resources/email-domains/index.mjs.map +1 -0
- package/resources/email-domains/webhooks.d.mts +170 -0
- package/resources/email-domains/webhooks.d.mts.map +1 -0
- package/resources/email-domains/webhooks.d.ts +170 -0
- package/resources/email-domains/webhooks.d.ts.map +1 -0
- package/resources/email-domains/webhooks.js +110 -0
- package/resources/email-domains/webhooks.js.map +1 -0
- package/resources/email-domains/webhooks.mjs +106 -0
- package/resources/email-domains/webhooks.mjs.map +1 -0
- package/resources/email-domains.d.mts +2 -0
- package/resources/email-domains.d.mts.map +1 -0
- package/resources/email-domains.d.ts +2 -0
- package/resources/email-domains.d.ts.map +1 -0
- package/resources/email-domains.js +6 -0
- package/resources/email-domains.js.map +1 -0
- package/resources/email-domains.mjs +3 -0
- package/resources/email-domains.mjs.map +1 -0
- package/resources/email-events.d.mts +186 -0
- package/resources/email-events.d.mts.map +1 -0
- package/resources/email-events.d.ts +186 -0
- package/resources/email-events.d.ts.map +1 -0
- package/resources/email-events.js +26 -0
- package/resources/email-events.js.map +1 -0
- package/resources/email-events.mjs +22 -0
- package/resources/email-events.mjs.map +1 -0
- package/resources/email-inboxes/drafts.d.mts +549 -0
- package/resources/email-inboxes/drafts.d.mts.map +1 -0
- package/resources/email-inboxes/drafts.d.ts +549 -0
- package/resources/email-inboxes/drafts.d.ts.map +1 -0
- package/resources/email-inboxes/drafts.js +161 -0
- package/resources/email-inboxes/drafts.js.map +1 -0
- package/resources/email-inboxes/drafts.mjs +157 -0
- package/resources/email-inboxes/drafts.mjs.map +1 -0
- package/resources/email-inboxes/email-inboxes.d.mts +131 -0
- package/resources/email-inboxes/email-inboxes.d.mts.map +1 -0
- package/resources/email-inboxes/email-inboxes.d.ts +131 -0
- package/resources/email-inboxes/email-inboxes.d.ts.map +1 -0
- package/resources/email-inboxes/email-inboxes.js +93 -0
- package/resources/email-inboxes/email-inboxes.js.map +1 -0
- package/resources/email-inboxes/email-inboxes.mjs +88 -0
- package/resources/email-inboxes/email-inboxes.mjs.map +1 -0
- package/resources/email-inboxes/filters.d.mts +137 -0
- package/resources/email-inboxes/filters.d.mts.map +1 -0
- package/resources/email-inboxes/filters.d.ts +137 -0
- package/resources/email-inboxes/filters.d.ts.map +1 -0
- package/resources/email-inboxes/filters.js +81 -0
- package/resources/email-inboxes/filters.js.map +1 -0
- package/resources/email-inboxes/filters.mjs +77 -0
- package/resources/email-inboxes/filters.mjs.map +1 -0
- package/resources/email-inboxes/index.d.mts +6 -0
- package/resources/email-inboxes/index.d.mts.map +1 -0
- package/resources/email-inboxes/index.d.ts +6 -0
- package/resources/email-inboxes/index.d.ts.map +1 -0
- package/resources/email-inboxes/index.js +15 -0
- package/resources/email-inboxes/index.js.map +1 -0
- package/resources/email-inboxes/index.mjs +7 -0
- package/resources/email-inboxes/index.mjs.map +1 -0
- package/resources/email-inboxes/messages/actions.d.mts +190 -0
- package/resources/email-inboxes/messages/actions.d.mts.map +1 -0
- package/resources/email-inboxes/messages/actions.d.ts +190 -0
- package/resources/email-inboxes/messages/actions.d.ts.map +1 -0
- package/resources/email-inboxes/messages/actions.js +106 -0
- package/resources/email-inboxes/messages/actions.js.map +1 -0
- package/resources/email-inboxes/messages/actions.mjs +102 -0
- package/resources/email-inboxes/messages/actions.mjs.map +1 -0
- package/resources/email-inboxes/messages/index.d.mts +4 -0
- package/resources/email-inboxes/messages/index.d.mts.map +1 -0
- package/resources/email-inboxes/messages/index.d.ts +4 -0
- package/resources/email-inboxes/messages/index.d.ts.map +1 -0
- package/resources/email-inboxes/messages/index.js +11 -0
- package/resources/email-inboxes/messages/index.js.map +1 -0
- package/resources/email-inboxes/messages/index.mjs +5 -0
- package/resources/email-inboxes/messages/index.mjs.map +1 -0
- package/resources/email-inboxes/messages/labels.d.mts +101 -0
- package/resources/email-inboxes/messages/labels.d.mts.map +1 -0
- package/resources/email-inboxes/messages/labels.d.ts +101 -0
- package/resources/email-inboxes/messages/labels.d.ts.map +1 -0
- package/resources/email-inboxes/messages/labels.js +69 -0
- package/resources/email-inboxes/messages/labels.js.map +1 -0
- package/resources/email-inboxes/messages/labels.mjs +65 -0
- package/resources/email-inboxes/messages/labels.mjs.map +1 -0
- package/resources/email-inboxes/messages/messages.d.mts +212 -0
- package/resources/email-inboxes/messages/messages.d.mts.map +1 -0
- package/resources/email-inboxes/messages/messages.d.ts +212 -0
- package/resources/email-inboxes/messages/messages.d.ts.map +1 -0
- package/resources/email-inboxes/messages/messages.js +89 -0
- package/resources/email-inboxes/messages/messages.js.map +1 -0
- package/resources/email-inboxes/messages/messages.mjs +84 -0
- package/resources/email-inboxes/messages/messages.mjs.map +1 -0
- package/resources/email-inboxes/messages.d.mts +2 -0
- package/resources/email-inboxes/messages.d.mts.map +1 -0
- package/resources/email-inboxes/messages.d.ts +2 -0
- package/resources/email-inboxes/messages.d.ts.map +1 -0
- package/resources/email-inboxes/messages.js +6 -0
- package/resources/email-inboxes/messages.js.map +1 -0
- package/resources/email-inboxes/messages.mjs +3 -0
- package/resources/email-inboxes/messages.mjs.map +1 -0
- package/resources/email-inboxes/threads/index.d.mts +3 -0
- package/resources/email-inboxes/threads/index.d.mts.map +1 -0
- package/resources/email-inboxes/threads/index.d.ts +3 -0
- package/resources/email-inboxes/threads/index.d.ts.map +1 -0
- package/resources/email-inboxes/threads/index.js +9 -0
- package/resources/email-inboxes/threads/index.js.map +1 -0
- package/resources/email-inboxes/threads/index.mjs +4 -0
- package/resources/email-inboxes/threads/index.mjs.map +1 -0
- package/resources/email-inboxes/threads/labels.d.mts +99 -0
- package/resources/email-inboxes/threads/labels.d.mts.map +1 -0
- package/resources/email-inboxes/threads/labels.d.ts +99 -0
- package/resources/email-inboxes/threads/labels.d.ts.map +1 -0
- package/resources/email-inboxes/threads/labels.js +64 -0
- package/resources/email-inboxes/threads/labels.js.map +1 -0
- package/resources/email-inboxes/threads/labels.mjs +60 -0
- package/resources/email-inboxes/threads/labels.mjs.map +1 -0
- package/resources/email-inboxes/threads/threads.d.mts +199 -0
- package/resources/email-inboxes/threads/threads.d.mts.map +1 -0
- package/resources/email-inboxes/threads/threads.d.ts +199 -0
- package/resources/email-inboxes/threads/threads.d.ts.map +1 -0
- package/resources/email-inboxes/threads/threads.js +51 -0
- package/resources/email-inboxes/threads/threads.js.map +1 -0
- package/resources/email-inboxes/threads/threads.mjs +46 -0
- package/resources/email-inboxes/threads/threads.mjs.map +1 -0
- package/resources/email-inboxes/threads.d.mts +2 -0
- package/resources/email-inboxes/threads.d.mts.map +1 -0
- package/resources/email-inboxes/threads.d.ts +2 -0
- package/resources/email-inboxes/threads.d.ts.map +1 -0
- package/resources/email-inboxes/threads.js +6 -0
- package/resources/email-inboxes/threads.js.map +1 -0
- package/resources/email-inboxes/threads.mjs +3 -0
- package/resources/email-inboxes/threads.mjs.map +1 -0
- package/resources/email-inboxes.d.mts +2 -0
- package/resources/email-inboxes.d.mts.map +1 -0
- package/resources/email-inboxes.d.ts +2 -0
- package/resources/email-inboxes.d.ts.map +1 -0
- package/resources/email-inboxes.js +6 -0
- package/resources/email-inboxes.js.map +1 -0
- package/resources/email-inboxes.mjs +3 -0
- package/resources/email-inboxes.mjs.map +1 -0
- package/resources/email-messages/email-messages.d.mts +543 -0
- package/resources/email-messages/email-messages.d.mts.map +1 -0
- package/resources/email-messages/email-messages.d.ts +543 -0
- package/resources/email-messages/email-messages.d.ts.map +1 -0
- package/resources/email-messages/email-messages.js +186 -0
- package/resources/email-messages/email-messages.js.map +1 -0
- package/resources/email-messages/email-messages.mjs +181 -0
- package/resources/email-messages/email-messages.mjs.map +1 -0
- package/resources/email-messages/index.d.mts +3 -0
- package/resources/email-messages/index.d.mts.map +1 -0
- package/resources/email-messages/index.d.ts +3 -0
- package/resources/email-messages/index.d.ts.map +1 -0
- package/resources/email-messages/index.js +9 -0
- package/resources/email-messages/index.js.map +1 -0
- package/resources/email-messages/index.mjs +4 -0
- package/resources/email-messages/index.mjs.map +1 -0
- package/resources/email-messages/recipients.d.mts +118 -0
- package/resources/email-messages/recipients.d.mts.map +1 -0
- package/resources/email-messages/recipients.d.ts +118 -0
- package/resources/email-messages/recipients.d.ts.map +1 -0
- package/resources/email-messages/recipients.js +48 -0
- package/resources/email-messages/recipients.js.map +1 -0
- package/resources/email-messages/recipients.mjs +44 -0
- package/resources/email-messages/recipients.mjs.map +1 -0
- package/resources/email-messages.d.mts +2 -0
- package/resources/email-messages.d.mts.map +1 -0
- package/resources/email-messages.d.ts +2 -0
- package/resources/email-messages.d.ts.map +1 -0
- package/resources/email-messages.js +6 -0
- package/resources/email-messages.js.map +1 -0
- package/resources/email-messages.mjs +3 -0
- package/resources/email-messages.mjs.map +1 -0
- package/resources/email-templates.d.mts +236 -0
- package/resources/email-templates.d.mts.map +1 -0
- package/resources/email-templates.d.ts +236 -0
- package/resources/email-templates.d.ts.map +1 -0
- package/resources/email-templates.js +124 -0
- package/resources/email-templates.js.map +1 -0
- package/resources/email-templates.mjs +120 -0
- package/resources/email-templates.mjs.map +1 -0
- package/resources/email-threads.d.mts +71 -0
- package/resources/email-threads.d.mts.map +1 -0
- package/resources/email-threads.d.ts +71 -0
- package/resources/email-threads.d.ts.map +1 -0
- package/resources/email-threads.js +34 -0
- package/resources/email-threads.js.map +1 -0
- package/resources/email-threads.mjs +30 -0
- package/resources/email-threads.mjs.map +1 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.mts +90 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.mts.map +1 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.ts +90 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.ts.map +1 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.js +70 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.js.map +1 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.mjs +65 -0
- package/resources/email-unsubscribe-groups/email-unsubscribe-groups.mjs.map +1 -0
- package/resources/email-unsubscribe-groups/index.d.mts +3 -0
- package/resources/email-unsubscribe-groups/index.d.mts.map +1 -0
- package/resources/email-unsubscribe-groups/index.d.ts +3 -0
- package/resources/email-unsubscribe-groups/index.d.ts.map +1 -0
- package/resources/email-unsubscribe-groups/index.js +9 -0
- package/resources/email-unsubscribe-groups/index.js.map +1 -0
- package/resources/email-unsubscribe-groups/index.mjs +4 -0
- package/resources/email-unsubscribe-groups/index.mjs.map +1 -0
- package/resources/email-unsubscribe-groups/suppressions.d.mts +54 -0
- package/resources/email-unsubscribe-groups/suppressions.d.mts.map +1 -0
- package/resources/email-unsubscribe-groups/suppressions.d.ts +54 -0
- package/resources/email-unsubscribe-groups/suppressions.d.ts.map +1 -0
- package/resources/email-unsubscribe-groups/suppressions.js +52 -0
- package/resources/email-unsubscribe-groups/suppressions.js.map +1 -0
- package/resources/email-unsubscribe-groups/suppressions.mjs +48 -0
- package/resources/email-unsubscribe-groups/suppressions.mjs.map +1 -0
- package/resources/email-unsubscribe-groups.d.mts +2 -0
- package/resources/email-unsubscribe-groups.d.mts.map +1 -0
- package/resources/email-unsubscribe-groups.d.ts +2 -0
- package/resources/email-unsubscribe-groups.d.ts.map +1 -0
- package/resources/email-unsubscribe-groups.js +6 -0
- package/resources/email-unsubscribe-groups.js.map +1 -0
- package/resources/email-unsubscribe-groups.mjs +3 -0
- package/resources/email-unsubscribe-groups.mjs.map +1 -0
- package/resources/email-validations/batch.d.mts +136 -0
- package/resources/email-validations/batch.d.mts.map +1 -0
- package/resources/email-validations/batch.d.ts +136 -0
- package/resources/email-validations/batch.d.ts.map +1 -0
- package/resources/email-validations/batch.js +51 -0
- package/resources/email-validations/batch.js.map +1 -0
- package/resources/email-validations/batch.mjs +47 -0
- package/resources/email-validations/batch.mjs.map +1 -0
- package/resources/email-validations/email-validations.d.mts +87 -0
- package/resources/email-validations/email-validations.d.mts.map +1 -0
- package/resources/email-validations/email-validations.d.ts +87 -0
- package/resources/email-validations/email-validations.d.ts.map +1 -0
- package/resources/email-validations/email-validations.js +43 -0
- package/resources/email-validations/email-validations.js.map +1 -0
- package/resources/email-validations/email-validations.mjs +38 -0
- package/resources/email-validations/email-validations.mjs.map +1 -0
- package/resources/email-validations/index.d.mts +3 -0
- package/resources/email-validations/index.d.mts.map +1 -0
- package/resources/email-validations/index.d.ts +3 -0
- package/resources/email-validations/index.d.ts.map +1 -0
- package/resources/email-validations/index.js +9 -0
- package/resources/email-validations/index.js.map +1 -0
- package/resources/email-validations/index.mjs +4 -0
- package/resources/email-validations/index.mjs.map +1 -0
- package/resources/email-validations.d.mts +2 -0
- package/resources/email-validations.d.mts.map +1 -0
- package/resources/email-validations.d.ts +2 -0
- package/resources/email-validations.d.ts.map +1 -0
- package/resources/email-validations.js +6 -0
- package/resources/email-validations.js.map +1 -0
- package/resources/email-validations.mjs +3 -0
- package/resources/email-validations.mjs.map +1 -0
- package/resources/index.d.mts +11 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +11 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +24 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +10 -0
- package/resources/index.mjs.map +1 -1
- package/resources/pricing/index.d.mts +3 -0
- package/resources/pricing/index.d.mts.map +1 -0
- package/resources/pricing/index.d.ts +3 -0
- package/resources/pricing/index.d.ts.map +1 -0
- package/resources/pricing/index.js +9 -0
- package/resources/pricing/index.js.map +1 -0
- package/resources/pricing/index.mjs +4 -0
- package/resources/pricing/index.mjs.map +1 -0
- package/resources/pricing/pricing.d.mts +10 -0
- package/resources/pricing/pricing.d.mts.map +1 -0
- package/resources/pricing/pricing.d.ts +10 -0
- package/resources/pricing/pricing.d.ts.map +1 -0
- package/resources/pricing/pricing.js +17 -0
- package/resources/pricing/pricing.js.map +1 -0
- package/resources/pricing/pricing.mjs +12 -0
- package/resources/pricing/pricing.mjs.map +1 -0
- package/resources/pricing/products.d.mts +161 -0
- package/resources/pricing/products.d.mts.map +1 -0
- package/resources/pricing/products.d.ts +161 -0
- package/resources/pricing/products.d.ts.map +1 -0
- package/resources/pricing/products.js +32 -0
- package/resources/pricing/products.js.map +1 -0
- package/resources/pricing/products.mjs +28 -0
- package/resources/pricing/products.mjs.map +1 -0
- package/resources/pricing.d.mts +2 -0
- package/resources/pricing.d.mts.map +1 -0
- package/resources/pricing.d.ts +2 -0
- package/resources/pricing.d.ts.map +1 -0
- package/resources/pricing.js +6 -0
- package/resources/pricing.js.map +1 -0
- package/resources/pricing.mjs +3 -0
- package/resources/pricing.mjs.map +1 -0
- package/resources/speech-to-text/speech-to-text.d.mts +4 -4
- package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts +4 -4
- package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
- package/resources/speech-to-text/speech-to-text.js +1 -1
- package/resources/speech-to-text/speech-to-text.mjs +1 -1
- package/resources/uac-connections/uac-connections.d.mts +5 -0
- package/resources/uac-connections/uac-connections.d.mts.map +1 -1
- package/resources/uac-connections/uac-connections.d.ts +5 -0
- package/resources/uac-connections/uac-connections.d.ts.map +1 -1
- package/resources/uac-connections/uac-connections.js.map +1 -1
- package/resources/uac-connections/uac-connections.mjs.map +1 -1
- package/resources/webhooks.d.mts +483 -85
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +483 -85
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +260 -0
- package/src/resources/ai/ai.ts +7 -0
- package/src/resources/ai/anthropic/v1.ts +3 -1
- package/src/resources/ai/assistants/assistants.ts +6 -1
- package/src/resources/ai/chat.ts +7 -0
- package/src/resources/ai/openai/chat.ts +7 -0
- package/src/resources/ai/openai/openai.ts +7 -0
- package/src/resources/calls/actions.ts +269 -51
- package/src/resources/calls/calls.ts +8 -0
- package/src/resources/calls/index.ts +3 -0
- package/src/resources/custom-storage-credentials.ts +140 -14
- package/src/resources/dir/dir.ts +3 -2
- package/src/resources/dir/references.ts +41 -11
- package/src/resources/dir/verify-email.ts +12 -0
- package/src/resources/email-blocks/email-blocks.ts +358 -0
- package/src/resources/email-blocks/import.ts +143 -0
- package/src/resources/email-blocks/index.ts +16 -0
- package/src/resources/email-blocks.ts +3 -0
- package/src/resources/email-domains/email-domains.ts +510 -0
- package/src/resources/email-domains/index.ts +33 -0
- package/src/resources/email-domains/webhooks.ts +267 -0
- package/src/resources/email-domains.ts +3 -0
- package/src/resources/email-events.ts +269 -0
- package/src/resources/email-inboxes/drafts.ts +746 -0
- package/src/resources/email-inboxes/email-inboxes.ts +276 -0
- package/src/resources/email-inboxes/filters.ts +193 -0
- package/src/resources/email-inboxes/index.ts +58 -0
- package/src/resources/email-inboxes/messages/actions.ts +258 -0
- package/src/resources/email-inboxes/messages/index.ts +27 -0
- package/src/resources/email-inboxes/messages/labels.ts +139 -0
- package/src/resources/email-inboxes/messages/messages.ts +313 -0
- package/src/resources/email-inboxes/messages.ts +3 -0
- package/src/resources/email-inboxes/threads/index.ts +21 -0
- package/src/resources/email-inboxes/threads/labels.ts +143 -0
- package/src/resources/email-inboxes/threads/threads.ts +292 -0
- package/src/resources/email-inboxes/threads.ts +3 -0
- package/src/resources/email-inboxes.ts +3 -0
- package/src/resources/email-messages/email-messages.ts +713 -0
- package/src/resources/email-messages/index.ts +26 -0
- package/src/resources/email-messages/recipients.ts +182 -0
- package/src/resources/email-messages.ts +3 -0
- package/src/resources/email-templates.ts +333 -0
- package/src/resources/email-threads.ts +100 -0
- package/src/resources/email-unsubscribe-groups/email-unsubscribe-groups.ts +171 -0
- package/src/resources/email-unsubscribe-groups/index.ts +19 -0
- package/src/resources/email-unsubscribe-groups/suppressions.ts +90 -0
- package/src/resources/email-unsubscribe-groups.ts +3 -0
- package/src/resources/email-validations/batch.ts +187 -0
- package/src/resources/email-validations/email-validations.ts +141 -0
- package/src/resources/email-validations/index.ts +15 -0
- package/src/resources/email-validations.ts +3 -0
- package/src/resources/index.ts +103 -0
- package/src/resources/pricing/index.ts +13 -0
- package/src/resources/pricing/pricing.ts +33 -0
- package/src/resources/pricing/products.ts +226 -0
- package/src/resources/pricing.ts +3 -0
- package/src/resources/speech-to-text/speech-to-text.ts +6 -3
- package/src/resources/uac-connections/uac-connections.ts +6 -0
- package/src/resources/webhooks.ts +636 -110
- package/src/version.ts +1 -1
- 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,255 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as ImportAPI from "./import.mjs";
|
|
3
|
+
import { EmailBlockImportResponse, Import, ImportCreateParams } from "./import.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { DefaultFlatPagination, type DefaultFlatPaginationParams, PagePromise } from "../../core/pagination.mjs";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Recipient suppression records (`/v2/email_blocks`).
|
|
9
|
+
*/
|
|
10
|
+
export declare class EmailBlocks extends APIResource {
|
|
11
|
+
import: ImportAPI.Import;
|
|
12
|
+
/**
|
|
13
|
+
* Account-scoped list. Two mutually exclusive pagination modes:
|
|
14
|
+
*
|
|
15
|
+
* - **Offset**: `page[number]` (default 1) + `page[size]` (default 25, max 100).
|
|
16
|
+
* `meta` contains `total_pages`.
|
|
17
|
+
* - **Cursor**: `page[after]` and/or `page[before]` (opaque `Base.url_encode64` of
|
|
18
|
+
* `{"created_at","id"}`). Cannot combine with `page[number]`; `after`+`before`
|
|
19
|
+
* together is an error. `meta` contains `next_cursor` / `previous_cursor`
|
|
20
|
+
* (omitted when their flag is false).
|
|
21
|
+
*
|
|
22
|
+
* Sort defaults to `-created_at` (desc); only `created_at` is sortable. A `--`
|
|
23
|
+
* prefix is an error. `nil`/empty filter values are silently dropped.
|
|
24
|
+
*/
|
|
25
|
+
list(query?: EmailBlockListParams | null | undefined, options?: RequestOptions): PagePromise<EmailBlocksDefaultFlatPagination, EmailBlock>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a suppression with `reason: manual_block` and `source: manual`.
|
|
28
|
+
* Caller-supplied `reason` / `source` are **ignored**; `scope` is **derived**
|
|
29
|
+
* server-side from `domain_id` / `from` and is never trusted. Idempotent: if a
|
|
30
|
+
* matching row already exists (NULL-safe dedupe key: account_id, scope, to,
|
|
31
|
+
* reason, domain_id, from), returns the existing record with `200` (no new audit
|
|
32
|
+
* event).
|
|
33
|
+
*
|
|
34
|
+
* `bounce_category`, `dsn_code`, `meta`, and `group_id` are **not accepted** on
|
|
35
|
+
* the public surface. Use the unsubscribe-group suppression endpoint or the
|
|
36
|
+
* internal create surface for those.
|
|
37
|
+
*/
|
|
38
|
+
create(body: EmailBlockCreateParams, options?: RequestOptions): APIPromise<EmailBlockResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Streams the account's suppressions as a chunked CSV (server-side cursor; never
|
|
41
|
+
* materialized). Content-type `text/csv`, header
|
|
42
|
+
* `Content-Disposition: attachment; filename="email_blocks_export.csv"`.
|
|
43
|
+
*
|
|
44
|
+
* Filters (`filter[reason]`, `filter[domain_id]`, `filter[created_after]`,
|
|
45
|
+
* `filter[created_before]`) are the only params that affect output. `sort` and
|
|
46
|
+
* `page[*]` are **parsed** (bad values still produce `400`) but **ignored** — rows
|
|
47
|
+
* stream `ORDER BY created_at ASC, id ASC` with no pagination.
|
|
48
|
+
*
|
|
49
|
+
* CSV columns:
|
|
50
|
+
* `id,to,from,reason,source,scope,status,domain_id, created_at,updated_at,expires_at,group_id`.
|
|
51
|
+
* The CSV carries the `group_id` column so group-scoped suppressions' group link
|
|
52
|
+
* survives the export (empty for account-scope rows).
|
|
53
|
+
*/
|
|
54
|
+
retrieveExport(query?: EmailBlockRetrieveExportParams | null | undefined, options?: RequestOptions): APIPromise<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Soft-deletes (status → `removed`; tombstone retained). A `removed` audit event
|
|
57
|
+
* is appended unless the block was already `removed` (idempotent — returns the
|
|
58
|
+
* existing row with `200` and no new event). Mutates `updated_at`.
|
|
59
|
+
*/
|
|
60
|
+
delete(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieve a suppression
|
|
63
|
+
*/
|
|
64
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Offset pagination only (`page[number]` default 1, `page[size]` default **50**,
|
|
67
|
+
* max 100). No `sort`, no `filter`, no cursor — ordering is fixed
|
|
68
|
+
* `desc occurred_at, desc id`. Verifies the block belongs to the account first
|
|
69
|
+
* (cross-account → 404).
|
|
70
|
+
*/
|
|
71
|
+
retrieveEvents(id: string, query?: EmailBlockRetrieveEventsParams | null | undefined, options?: RequestOptions): APIPromise<EmailBlockRetrieveEventsResponse>;
|
|
72
|
+
}
|
|
73
|
+
export type EmailBlocksDefaultFlatPagination = DefaultFlatPagination<EmailBlock>;
|
|
74
|
+
/**
|
|
75
|
+
* Suppression record. Schema fields hidden by the view: `account_id`,
|
|
76
|
+
* `bounce_category`, `dsn_code`, `meta`.
|
|
77
|
+
*/
|
|
78
|
+
export interface EmailBlock {
|
|
79
|
+
id: string;
|
|
80
|
+
created_at: string;
|
|
81
|
+
reason: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
|
|
82
|
+
/**
|
|
83
|
+
* View-only discriminator.
|
|
84
|
+
*/
|
|
85
|
+
record_type: 'email_block';
|
|
86
|
+
/**
|
|
87
|
+
* Derived server-side from `domain_id`/`from`; never trusted from the caller.
|
|
88
|
+
*/
|
|
89
|
+
scope: 'account' | 'domain' | 'address';
|
|
90
|
+
source: 'feedback' | 'manual' | 'import' | 'system';
|
|
91
|
+
status: 'active' | 'expired' | 'removed';
|
|
92
|
+
/**
|
|
93
|
+
* Normalized recipient. (schema: to_address)
|
|
94
|
+
*/
|
|
95
|
+
to: string;
|
|
96
|
+
updated_at: string;
|
|
97
|
+
/**
|
|
98
|
+
* `null` ⇒ account scope. Stored on the row; exposed here.
|
|
99
|
+
*/
|
|
100
|
+
domain_id?: string | null;
|
|
101
|
+
expires_at?: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* `null` ⇒ not address-scope. (schema: from_address)
|
|
104
|
+
*/
|
|
105
|
+
from?: string | null;
|
|
106
|
+
/**
|
|
107
|
+
* `null` ⇒ global; set ⇒ group-scoped opt-out.
|
|
108
|
+
*/
|
|
109
|
+
group_id?: string | null;
|
|
110
|
+
}
|
|
111
|
+
export interface EmailBlockResponse {
|
|
112
|
+
/**
|
|
113
|
+
* Suppression record. Schema fields hidden by the view: `account_id`,
|
|
114
|
+
* `bounce_category`, `dsn_code`, `meta`.
|
|
115
|
+
*/
|
|
116
|
+
data: EmailBlock;
|
|
117
|
+
}
|
|
118
|
+
export interface OffsetMeta {
|
|
119
|
+
page_number: number;
|
|
120
|
+
page_size: number;
|
|
121
|
+
total_pages: number;
|
|
122
|
+
total_results: number;
|
|
123
|
+
}
|
|
124
|
+
export interface EmailBlockRetrieveEventsResponse {
|
|
125
|
+
data: Array<EmailBlockRetrieveEventsResponse.Data>;
|
|
126
|
+
meta: OffsetMeta;
|
|
127
|
+
}
|
|
128
|
+
export declare namespace EmailBlockRetrieveEventsResponse {
|
|
129
|
+
interface Data {
|
|
130
|
+
id: string;
|
|
131
|
+
/**
|
|
132
|
+
* Free-text (`user_id`/`org_id`/`api_key`/`dev_bypass`/`system`/`manual`).
|
|
133
|
+
*/
|
|
134
|
+
actor: string;
|
|
135
|
+
event_type: 'created' | 'removed' | 'expired' | 'override_used';
|
|
136
|
+
occurred_at: string;
|
|
137
|
+
/**
|
|
138
|
+
* Free-text snapshot of the block's reason at event time.
|
|
139
|
+
*/
|
|
140
|
+
reason: string;
|
|
141
|
+
/**
|
|
142
|
+
* View-only.
|
|
143
|
+
*/
|
|
144
|
+
record_type: 'email_block_event';
|
|
145
|
+
/**
|
|
146
|
+
* Free-text snapshot of the block's source at event time.
|
|
147
|
+
*/
|
|
148
|
+
source: string;
|
|
149
|
+
/**
|
|
150
|
+
* `null` when the schema field is nil (the context usually sets it to `{}`).
|
|
151
|
+
*/
|
|
152
|
+
meta?: {
|
|
153
|
+
[key: string]: unknown;
|
|
154
|
+
} | null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* CSV with header row
|
|
159
|
+
* `id,to,from,reason,source,scope,status,domain_id,created_at,updated_at,expires_at,group_id`.
|
|
160
|
+
*/
|
|
161
|
+
export type EmailBlockRetrieveExportResponse = string;
|
|
162
|
+
export interface EmailBlockListParams extends DefaultFlatPaginationParams {
|
|
163
|
+
/**
|
|
164
|
+
* `created_at > value` (ISO 8601).
|
|
165
|
+
*/
|
|
166
|
+
'filter[created_after]'?: string;
|
|
167
|
+
/**
|
|
168
|
+
* `created_at < value` (ISO 8601).
|
|
169
|
+
*/
|
|
170
|
+
'filter[created_before]'?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Exact-match filter on domain_id (UUID).
|
|
173
|
+
*/
|
|
174
|
+
'filter[domain_id]'?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Exact-match filter on reason.
|
|
177
|
+
*/
|
|
178
|
+
'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
|
|
179
|
+
/**
|
|
180
|
+
* Opaque cursor (`Base.url_encode64` of `{"created_at","id"}`). Cursor mode;
|
|
181
|
+
* mutually exclusive with `page[number]` and `page[before]`.
|
|
182
|
+
*/
|
|
183
|
+
'page[after]'?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Opaque cursor (see `page[after]`). Mutually exclusive with `page[after]` and
|
|
186
|
+
* `page[number]`.
|
|
187
|
+
*/
|
|
188
|
+
'page[before]'?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Sort field. Leading `-` = desc; only `created_at` is sortable. Default
|
|
191
|
+
* `-created_at`. `--` is an error.
|
|
192
|
+
*/
|
|
193
|
+
sort?: 'created_at' | '-created_at';
|
|
194
|
+
}
|
|
195
|
+
export interface EmailBlockCreateParams {
|
|
196
|
+
/**
|
|
197
|
+
* Recipient address (normalized: trim + lower-case).
|
|
198
|
+
*/
|
|
199
|
+
to: string;
|
|
200
|
+
/**
|
|
201
|
+
* `null` ⇒ account scope.
|
|
202
|
+
*/
|
|
203
|
+
domain_id?: string | null;
|
|
204
|
+
expires_at?: string | null;
|
|
205
|
+
/**
|
|
206
|
+
* Sender address (normalized). `null` ⇒ account/domain scope.
|
|
207
|
+
*/
|
|
208
|
+
from?: string | null;
|
|
209
|
+
}
|
|
210
|
+
export interface EmailBlockRetrieveExportParams {
|
|
211
|
+
/**
|
|
212
|
+
* `created_at > value` (ISO 8601).
|
|
213
|
+
*/
|
|
214
|
+
'filter[created_after]'?: string;
|
|
215
|
+
/**
|
|
216
|
+
* `created_at < value` (ISO 8601).
|
|
217
|
+
*/
|
|
218
|
+
'filter[created_before]'?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Exact-match filter on domain_id (UUID).
|
|
221
|
+
*/
|
|
222
|
+
'filter[domain_id]'?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Exact-match filter on reason.
|
|
225
|
+
*/
|
|
226
|
+
'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
|
|
227
|
+
/**
|
|
228
|
+
* Offset page number (≥1, default 1).
|
|
229
|
+
*/
|
|
230
|
+
'page[number]'?: number;
|
|
231
|
+
/**
|
|
232
|
+
* Page size (1–100, default 25).
|
|
233
|
+
*/
|
|
234
|
+
'page[size]'?: number;
|
|
235
|
+
/**
|
|
236
|
+
* Sort field. Leading `-` = desc; only `created_at` is sortable. Default
|
|
237
|
+
* `-created_at`. `--` is an error.
|
|
238
|
+
*/
|
|
239
|
+
sort?: 'created_at' | '-created_at';
|
|
240
|
+
}
|
|
241
|
+
export interface EmailBlockRetrieveEventsParams {
|
|
242
|
+
/**
|
|
243
|
+
* Offset page number (≥1, default 1).
|
|
244
|
+
*/
|
|
245
|
+
'page[number]'?: number;
|
|
246
|
+
/**
|
|
247
|
+
* Page size (default 50, max 100).
|
|
248
|
+
*/
|
|
249
|
+
'page[size]'?: number;
|
|
250
|
+
}
|
|
251
|
+
export declare namespace EmailBlocks {
|
|
252
|
+
export { type EmailBlock as EmailBlock, type EmailBlockResponse as EmailBlockResponse, type OffsetMeta as OffsetMeta, type EmailBlockRetrieveEventsResponse as EmailBlockRetrieveEventsResponse, type EmailBlockRetrieveExportResponse as EmailBlockRetrieveExportResponse, type EmailBlocksDefaultFlatPagination as EmailBlocksDefaultFlatPagination, type EmailBlockListParams as EmailBlockListParams, type EmailBlockCreateParams as EmailBlockCreateParams, type EmailBlockRetrieveExportParams as EmailBlockRetrieveExportParams, type EmailBlockRetrieveEventsParams as EmailBlockRetrieveEventsParams, };
|
|
253
|
+
export { Import as Import, type EmailBlockImportResponse as EmailBlockImportResponse, type ImportCreateParams as ImportCreateParams, };
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=email-blocks.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-blocks.d.mts","sourceRoot":"","sources":["../../src/resources/email-blocks/email-blocks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,kBAAkB,EAAE,qBAAiB;AAChF,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,WAAW,EAAE,kCAA8B;AAE7G,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C,MAAM,EAAE,SAAS,CAAC,MAAM,C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AA8B;IAC7C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as ImportAPI from "./import.js";
|
|
3
|
+
import { EmailBlockImportResponse, Import, ImportCreateParams } from "./import.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { DefaultFlatPagination, type DefaultFlatPaginationParams, PagePromise } from "../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
/**
|
|
8
|
+
* Recipient suppression records (`/v2/email_blocks`).
|
|
9
|
+
*/
|
|
10
|
+
export declare class EmailBlocks extends APIResource {
|
|
11
|
+
import: ImportAPI.Import;
|
|
12
|
+
/**
|
|
13
|
+
* Account-scoped list. Two mutually exclusive pagination modes:
|
|
14
|
+
*
|
|
15
|
+
* - **Offset**: `page[number]` (default 1) + `page[size]` (default 25, max 100).
|
|
16
|
+
* `meta` contains `total_pages`.
|
|
17
|
+
* - **Cursor**: `page[after]` and/or `page[before]` (opaque `Base.url_encode64` of
|
|
18
|
+
* `{"created_at","id"}`). Cannot combine with `page[number]`; `after`+`before`
|
|
19
|
+
* together is an error. `meta` contains `next_cursor` / `previous_cursor`
|
|
20
|
+
* (omitted when their flag is false).
|
|
21
|
+
*
|
|
22
|
+
* Sort defaults to `-created_at` (desc); only `created_at` is sortable. A `--`
|
|
23
|
+
* prefix is an error. `nil`/empty filter values are silently dropped.
|
|
24
|
+
*/
|
|
25
|
+
list(query?: EmailBlockListParams | null | undefined, options?: RequestOptions): PagePromise<EmailBlocksDefaultFlatPagination, EmailBlock>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a suppression with `reason: manual_block` and `source: manual`.
|
|
28
|
+
* Caller-supplied `reason` / `source` are **ignored**; `scope` is **derived**
|
|
29
|
+
* server-side from `domain_id` / `from` and is never trusted. Idempotent: if a
|
|
30
|
+
* matching row already exists (NULL-safe dedupe key: account_id, scope, to,
|
|
31
|
+
* reason, domain_id, from), returns the existing record with `200` (no new audit
|
|
32
|
+
* event).
|
|
33
|
+
*
|
|
34
|
+
* `bounce_category`, `dsn_code`, `meta`, and `group_id` are **not accepted** on
|
|
35
|
+
* the public surface. Use the unsubscribe-group suppression endpoint or the
|
|
36
|
+
* internal create surface for those.
|
|
37
|
+
*/
|
|
38
|
+
create(body: EmailBlockCreateParams, options?: RequestOptions): APIPromise<EmailBlockResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Streams the account's suppressions as a chunked CSV (server-side cursor; never
|
|
41
|
+
* materialized). Content-type `text/csv`, header
|
|
42
|
+
* `Content-Disposition: attachment; filename="email_blocks_export.csv"`.
|
|
43
|
+
*
|
|
44
|
+
* Filters (`filter[reason]`, `filter[domain_id]`, `filter[created_after]`,
|
|
45
|
+
* `filter[created_before]`) are the only params that affect output. `sort` and
|
|
46
|
+
* `page[*]` are **parsed** (bad values still produce `400`) but **ignored** — rows
|
|
47
|
+
* stream `ORDER BY created_at ASC, id ASC` with no pagination.
|
|
48
|
+
*
|
|
49
|
+
* CSV columns:
|
|
50
|
+
* `id,to,from,reason,source,scope,status,domain_id, created_at,updated_at,expires_at,group_id`.
|
|
51
|
+
* The CSV carries the `group_id` column so group-scoped suppressions' group link
|
|
52
|
+
* survives the export (empty for account-scope rows).
|
|
53
|
+
*/
|
|
54
|
+
retrieveExport(query?: EmailBlockRetrieveExportParams | null | undefined, options?: RequestOptions): APIPromise<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Soft-deletes (status → `removed`; tombstone retained). A `removed` audit event
|
|
57
|
+
* is appended unless the block was already `removed` (idempotent — returns the
|
|
58
|
+
* existing row with `200` and no new event). Mutates `updated_at`.
|
|
59
|
+
*/
|
|
60
|
+
delete(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieve a suppression
|
|
63
|
+
*/
|
|
64
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Offset pagination only (`page[number]` default 1, `page[size]` default **50**,
|
|
67
|
+
* max 100). No `sort`, no `filter`, no cursor — ordering is fixed
|
|
68
|
+
* `desc occurred_at, desc id`. Verifies the block belongs to the account first
|
|
69
|
+
* (cross-account → 404).
|
|
70
|
+
*/
|
|
71
|
+
retrieveEvents(id: string, query?: EmailBlockRetrieveEventsParams | null | undefined, options?: RequestOptions): APIPromise<EmailBlockRetrieveEventsResponse>;
|
|
72
|
+
}
|
|
73
|
+
export type EmailBlocksDefaultFlatPagination = DefaultFlatPagination<EmailBlock>;
|
|
74
|
+
/**
|
|
75
|
+
* Suppression record. Schema fields hidden by the view: `account_id`,
|
|
76
|
+
* `bounce_category`, `dsn_code`, `meta`.
|
|
77
|
+
*/
|
|
78
|
+
export interface EmailBlock {
|
|
79
|
+
id: string;
|
|
80
|
+
created_at: string;
|
|
81
|
+
reason: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
|
|
82
|
+
/**
|
|
83
|
+
* View-only discriminator.
|
|
84
|
+
*/
|
|
85
|
+
record_type: 'email_block';
|
|
86
|
+
/**
|
|
87
|
+
* Derived server-side from `domain_id`/`from`; never trusted from the caller.
|
|
88
|
+
*/
|
|
89
|
+
scope: 'account' | 'domain' | 'address';
|
|
90
|
+
source: 'feedback' | 'manual' | 'import' | 'system';
|
|
91
|
+
status: 'active' | 'expired' | 'removed';
|
|
92
|
+
/**
|
|
93
|
+
* Normalized recipient. (schema: to_address)
|
|
94
|
+
*/
|
|
95
|
+
to: string;
|
|
96
|
+
updated_at: string;
|
|
97
|
+
/**
|
|
98
|
+
* `null` ⇒ account scope. Stored on the row; exposed here.
|
|
99
|
+
*/
|
|
100
|
+
domain_id?: string | null;
|
|
101
|
+
expires_at?: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* `null` ⇒ not address-scope. (schema: from_address)
|
|
104
|
+
*/
|
|
105
|
+
from?: string | null;
|
|
106
|
+
/**
|
|
107
|
+
* `null` ⇒ global; set ⇒ group-scoped opt-out.
|
|
108
|
+
*/
|
|
109
|
+
group_id?: string | null;
|
|
110
|
+
}
|
|
111
|
+
export interface EmailBlockResponse {
|
|
112
|
+
/**
|
|
113
|
+
* Suppression record. Schema fields hidden by the view: `account_id`,
|
|
114
|
+
* `bounce_category`, `dsn_code`, `meta`.
|
|
115
|
+
*/
|
|
116
|
+
data: EmailBlock;
|
|
117
|
+
}
|
|
118
|
+
export interface OffsetMeta {
|
|
119
|
+
page_number: number;
|
|
120
|
+
page_size: number;
|
|
121
|
+
total_pages: number;
|
|
122
|
+
total_results: number;
|
|
123
|
+
}
|
|
124
|
+
export interface EmailBlockRetrieveEventsResponse {
|
|
125
|
+
data: Array<EmailBlockRetrieveEventsResponse.Data>;
|
|
126
|
+
meta: OffsetMeta;
|
|
127
|
+
}
|
|
128
|
+
export declare namespace EmailBlockRetrieveEventsResponse {
|
|
129
|
+
interface Data {
|
|
130
|
+
id: string;
|
|
131
|
+
/**
|
|
132
|
+
* Free-text (`user_id`/`org_id`/`api_key`/`dev_bypass`/`system`/`manual`).
|
|
133
|
+
*/
|
|
134
|
+
actor: string;
|
|
135
|
+
event_type: 'created' | 'removed' | 'expired' | 'override_used';
|
|
136
|
+
occurred_at: string;
|
|
137
|
+
/**
|
|
138
|
+
* Free-text snapshot of the block's reason at event time.
|
|
139
|
+
*/
|
|
140
|
+
reason: string;
|
|
141
|
+
/**
|
|
142
|
+
* View-only.
|
|
143
|
+
*/
|
|
144
|
+
record_type: 'email_block_event';
|
|
145
|
+
/**
|
|
146
|
+
* Free-text snapshot of the block's source at event time.
|
|
147
|
+
*/
|
|
148
|
+
source: string;
|
|
149
|
+
/**
|
|
150
|
+
* `null` when the schema field is nil (the context usually sets it to `{}`).
|
|
151
|
+
*/
|
|
152
|
+
meta?: {
|
|
153
|
+
[key: string]: unknown;
|
|
154
|
+
} | null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* CSV with header row
|
|
159
|
+
* `id,to,from,reason,source,scope,status,domain_id,created_at,updated_at,expires_at,group_id`.
|
|
160
|
+
*/
|
|
161
|
+
export type EmailBlockRetrieveExportResponse = string;
|
|
162
|
+
export interface EmailBlockListParams extends DefaultFlatPaginationParams {
|
|
163
|
+
/**
|
|
164
|
+
* `created_at > value` (ISO 8601).
|
|
165
|
+
*/
|
|
166
|
+
'filter[created_after]'?: string;
|
|
167
|
+
/**
|
|
168
|
+
* `created_at < value` (ISO 8601).
|
|
169
|
+
*/
|
|
170
|
+
'filter[created_before]'?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Exact-match filter on domain_id (UUID).
|
|
173
|
+
*/
|
|
174
|
+
'filter[domain_id]'?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Exact-match filter on reason.
|
|
177
|
+
*/
|
|
178
|
+
'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
|
|
179
|
+
/**
|
|
180
|
+
* Opaque cursor (`Base.url_encode64` of `{"created_at","id"}`). Cursor mode;
|
|
181
|
+
* mutually exclusive with `page[number]` and `page[before]`.
|
|
182
|
+
*/
|
|
183
|
+
'page[after]'?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Opaque cursor (see `page[after]`). Mutually exclusive with `page[after]` and
|
|
186
|
+
* `page[number]`.
|
|
187
|
+
*/
|
|
188
|
+
'page[before]'?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Sort field. Leading `-` = desc; only `created_at` is sortable. Default
|
|
191
|
+
* `-created_at`. `--` is an error.
|
|
192
|
+
*/
|
|
193
|
+
sort?: 'created_at' | '-created_at';
|
|
194
|
+
}
|
|
195
|
+
export interface EmailBlockCreateParams {
|
|
196
|
+
/**
|
|
197
|
+
* Recipient address (normalized: trim + lower-case).
|
|
198
|
+
*/
|
|
199
|
+
to: string;
|
|
200
|
+
/**
|
|
201
|
+
* `null` ⇒ account scope.
|
|
202
|
+
*/
|
|
203
|
+
domain_id?: string | null;
|
|
204
|
+
expires_at?: string | null;
|
|
205
|
+
/**
|
|
206
|
+
* Sender address (normalized). `null` ⇒ account/domain scope.
|
|
207
|
+
*/
|
|
208
|
+
from?: string | null;
|
|
209
|
+
}
|
|
210
|
+
export interface EmailBlockRetrieveExportParams {
|
|
211
|
+
/**
|
|
212
|
+
* `created_at > value` (ISO 8601).
|
|
213
|
+
*/
|
|
214
|
+
'filter[created_after]'?: string;
|
|
215
|
+
/**
|
|
216
|
+
* `created_at < value` (ISO 8601).
|
|
217
|
+
*/
|
|
218
|
+
'filter[created_before]'?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Exact-match filter on domain_id (UUID).
|
|
221
|
+
*/
|
|
222
|
+
'filter[domain_id]'?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Exact-match filter on reason.
|
|
225
|
+
*/
|
|
226
|
+
'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
|
|
227
|
+
/**
|
|
228
|
+
* Offset page number (≥1, default 1).
|
|
229
|
+
*/
|
|
230
|
+
'page[number]'?: number;
|
|
231
|
+
/**
|
|
232
|
+
* Page size (1–100, default 25).
|
|
233
|
+
*/
|
|
234
|
+
'page[size]'?: number;
|
|
235
|
+
/**
|
|
236
|
+
* Sort field. Leading `-` = desc; only `created_at` is sortable. Default
|
|
237
|
+
* `-created_at`. `--` is an error.
|
|
238
|
+
*/
|
|
239
|
+
sort?: 'created_at' | '-created_at';
|
|
240
|
+
}
|
|
241
|
+
export interface EmailBlockRetrieveEventsParams {
|
|
242
|
+
/**
|
|
243
|
+
* Offset page number (≥1, default 1).
|
|
244
|
+
*/
|
|
245
|
+
'page[number]'?: number;
|
|
246
|
+
/**
|
|
247
|
+
* Page size (default 50, max 100).
|
|
248
|
+
*/
|
|
249
|
+
'page[size]'?: number;
|
|
250
|
+
}
|
|
251
|
+
export declare namespace EmailBlocks {
|
|
252
|
+
export { type EmailBlock as EmailBlock, type EmailBlockResponse as EmailBlockResponse, type OffsetMeta as OffsetMeta, type EmailBlockRetrieveEventsResponse as EmailBlockRetrieveEventsResponse, type EmailBlockRetrieveExportResponse as EmailBlockRetrieveExportResponse, type EmailBlocksDefaultFlatPagination as EmailBlocksDefaultFlatPagination, type EmailBlockListParams as EmailBlockListParams, type EmailBlockCreateParams as EmailBlockCreateParams, type EmailBlockRetrieveExportParams as EmailBlockRetrieveExportParams, type EmailBlockRetrieveEventsParams as EmailBlockRetrieveEventsParams, };
|
|
253
|
+
export { Import as Import, type EmailBlockImportResponse as EmailBlockImportResponse, type ImportCreateParams as ImportCreateParams, };
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=email-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-blocks.d.ts","sourceRoot":"","sources":["../../src/resources/email-blocks/email-blocks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,K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H,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,aAAa,GAAG,gBAAgB,GAAG,aAAa,GAAG,SAAS,GAAG,cAAc,CAAC;IAEjG;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CACrC;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EmailBlocks = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const ImportAPI = tslib_1.__importStar(require("./import.js"));
|
|
8
|
+
const import_1 = require("./import.js");
|
|
9
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
10
|
+
const headers_1 = require("../../internal/headers.js");
|
|
11
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
12
|
+
/**
|
|
13
|
+
* Recipient suppression records (`/v2/email_blocks`).
|
|
14
|
+
*/
|
|
15
|
+
class EmailBlocks extends resource_1.APIResource {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.import = new ImportAPI.Import(this._client);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Account-scoped list. Two mutually exclusive pagination modes:
|
|
22
|
+
*
|
|
23
|
+
* - **Offset**: `page[number]` (default 1) + `page[size]` (default 25, max 100).
|
|
24
|
+
* `meta` contains `total_pages`.
|
|
25
|
+
* - **Cursor**: `page[after]` and/or `page[before]` (opaque `Base.url_encode64` of
|
|
26
|
+
* `{"created_at","id"}`). Cannot combine with `page[number]`; `after`+`before`
|
|
27
|
+
* together is an error. `meta` contains `next_cursor` / `previous_cursor`
|
|
28
|
+
* (omitted when their flag is false).
|
|
29
|
+
*
|
|
30
|
+
* Sort defaults to `-created_at` (desc); only `created_at` is sortable. A `--`
|
|
31
|
+
* prefix is an error. `nil`/empty filter values are silently dropped.
|
|
32
|
+
*/
|
|
33
|
+
list(query = {}, options) {
|
|
34
|
+
return this._client.getAPIList('/email_blocks', (pagination_1.DefaultFlatPagination), { query, ...options });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a suppression with `reason: manual_block` and `source: manual`.
|
|
38
|
+
* Caller-supplied `reason` / `source` are **ignored**; `scope` is **derived**
|
|
39
|
+
* server-side from `domain_id` / `from` and is never trusted. Idempotent: if a
|
|
40
|
+
* matching row already exists (NULL-safe dedupe key: account_id, scope, to,
|
|
41
|
+
* reason, domain_id, from), returns the existing record with `200` (no new audit
|
|
42
|
+
* event).
|
|
43
|
+
*
|
|
44
|
+
* `bounce_category`, `dsn_code`, `meta`, and `group_id` are **not accepted** on
|
|
45
|
+
* the public surface. Use the unsubscribe-group suppression endpoint or the
|
|
46
|
+
* internal create surface for those.
|
|
47
|
+
*/
|
|
48
|
+
create(body, options) {
|
|
49
|
+
return this._client.post('/email_blocks', { body, ...options });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Streams the account's suppressions as a chunked CSV (server-side cursor; never
|
|
53
|
+
* materialized). Content-type `text/csv`, header
|
|
54
|
+
* `Content-Disposition: attachment; filename="email_blocks_export.csv"`.
|
|
55
|
+
*
|
|
56
|
+
* Filters (`filter[reason]`, `filter[domain_id]`, `filter[created_after]`,
|
|
57
|
+
* `filter[created_before]`) are the only params that affect output. `sort` and
|
|
58
|
+
* `page[*]` are **parsed** (bad values still produce `400`) but **ignored** — rows
|
|
59
|
+
* stream `ORDER BY created_at ASC, id ASC` with no pagination.
|
|
60
|
+
*
|
|
61
|
+
* CSV columns:
|
|
62
|
+
* `id,to,from,reason,source,scope,status,domain_id, created_at,updated_at,expires_at,group_id`.
|
|
63
|
+
* The CSV carries the `group_id` column so group-scoped suppressions' group link
|
|
64
|
+
* survives the export (empty for account-scope rows).
|
|
65
|
+
*/
|
|
66
|
+
retrieveExport(query = {}, options) {
|
|
67
|
+
return this._client.get('/email_blocks/export', {
|
|
68
|
+
query,
|
|
69
|
+
...options,
|
|
70
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'text/csv' }, options?.headers]),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Soft-deletes (status → `removed`; tombstone retained). A `removed` audit event
|
|
75
|
+
* is appended unless the block was already `removed` (idempotent — returns the
|
|
76
|
+
* existing row with `200` and no new event). Mutates `updated_at`.
|
|
77
|
+
*/
|
|
78
|
+
delete(id, options) {
|
|
79
|
+
return this._client.delete((0, path_1.path) `/email_blocks/${id}`, options);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Retrieve a suppression
|
|
83
|
+
*/
|
|
84
|
+
retrieve(id, options) {
|
|
85
|
+
return this._client.get((0, path_1.path) `/email_blocks/${id}`, options);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Offset pagination only (`page[number]` default 1, `page[size]` default **50**,
|
|
89
|
+
* max 100). No `sort`, no `filter`, no cursor — ordering is fixed
|
|
90
|
+
* `desc occurred_at, desc id`. Verifies the block belongs to the account first
|
|
91
|
+
* (cross-account → 404).
|
|
92
|
+
*/
|
|
93
|
+
retrieveEvents(id, query = {}, options) {
|
|
94
|
+
return this._client.get((0, path_1.path) `/email_blocks/${id}/events`, { query, ...options });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.EmailBlocks = EmailBlocks;
|
|
98
|
+
EmailBlocks.Import = import_1.Import;
|
|
99
|
+
//# sourceMappingURL=email-blocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-blocks.js","sourceRoot":"","sources":["../../src/resources/email-blocks/email-blocks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,+DAAsC;AACtC,wCAAgF;AAEhF,yDAA6G;AAC7G,uDAAsD;AAEtD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6FhE,CAAC;IA3FC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,kCAAiC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,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