@zavudev/sdk 0.31.0 → 0.43.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 +197 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +36 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +36 -6
- package/client.d.ts.map +1 -1
- package/client.js +42 -1
- package/client.js.map +1 -1
- package/client.mjs +42 -1
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +10 -10
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +10 -10
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.mts +1 -0
- package/pagination.d.mts.map +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.mjs +1 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/addresses.d.mts.map +1 -1
- package/resources/addresses.d.ts.map +1 -1
- package/resources/addresses.mjs.map +1 -1
- package/resources/balance.d.mts +33 -0
- package/resources/balance.d.mts.map +1 -0
- package/resources/balance.d.ts +33 -0
- package/resources/balance.d.ts.map +1 -0
- package/resources/balance.js +16 -0
- package/resources/balance.js.map +1 -0
- package/resources/balance.mjs +12 -0
- package/resources/balance.mjs.map +1 -0
- package/resources/broadcasts/broadcasts.d.mts +43 -2
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +43 -2
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +28 -0
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +28 -0
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/broadcasts/contacts.d.mts +9 -1
- package/resources/broadcasts/contacts.d.mts.map +1 -1
- package/resources/broadcasts/contacts.d.ts +9 -1
- package/resources/broadcasts/contacts.d.ts.map +1 -1
- package/resources/broadcasts/contacts.mjs.map +1 -1
- package/resources/broadcasts/index.d.mts +1 -1
- package/resources/broadcasts/index.d.mts.map +1 -1
- package/resources/broadcasts/index.d.ts +1 -1
- package/resources/broadcasts/index.d.ts.map +1 -1
- package/resources/broadcasts/index.js.map +1 -1
- package/resources/broadcasts/index.mjs.map +1 -1
- package/resources/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts.mjs.map +1 -1
- package/resources/contacts/channels.d.mts +127 -0
- package/resources/contacts/channels.d.mts.map +1 -0
- package/resources/contacts/channels.d.ts +127 -0
- package/resources/contacts/channels.d.ts.map +1 -0
- package/resources/contacts/channels.js +76 -0
- package/resources/contacts/channels.js.map +1 -0
- package/resources/contacts/channels.mjs +72 -0
- package/resources/contacts/channels.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +276 -0
- package/resources/contacts/contacts.d.mts.map +1 -0
- package/resources/contacts/contacts.d.ts +276 -0
- package/resources/contacts/contacts.d.ts.map +1 -0
- package/resources/contacts/contacts.js +137 -0
- package/resources/contacts/contacts.js.map +1 -0
- package/resources/contacts/contacts.mjs +132 -0
- package/resources/contacts/contacts.mjs.map +1 -0
- package/resources/contacts/index.d.mts +3 -0
- package/resources/contacts/index.d.mts.map +1 -0
- package/resources/contacts/index.d.ts +3 -0
- package/resources/contacts/index.d.ts.map +1 -0
- package/resources/contacts/index.js +9 -0
- package/resources/contacts/index.js.map +1 -0
- package/resources/contacts/index.mjs +4 -0
- package/resources/contacts/index.mjs.map +1 -0
- package/resources/contacts.d.mts +1 -144
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +1 -144
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +2 -31
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +1 -29
- package/resources/contacts.mjs.map +1 -1
- package/resources/exports.d.mts +101 -0
- package/resources/exports.d.mts.map +1 -0
- package/resources/exports.d.ts +101 -0
- package/resources/exports.d.ts.map +1 -0
- package/resources/exports.js +53 -0
- package/resources/exports.js.map +1 -0
- package/resources/exports.mjs +49 -0
- package/resources/exports.mjs.map +1 -0
- package/resources/functions/functions.d.mts +420 -0
- package/resources/functions/functions.d.mts.map +1 -0
- package/resources/functions/functions.d.ts +420 -0
- package/resources/functions/functions.d.ts.map +1 -0
- package/resources/functions/functions.js +129 -0
- package/resources/functions/functions.js.map +1 -0
- package/resources/functions/functions.mjs +124 -0
- package/resources/functions/functions.mjs.map +1 -0
- package/resources/functions/index.d.mts +3 -0
- package/resources/functions/index.d.mts.map +1 -0
- package/resources/functions/index.d.ts +3 -0
- package/resources/functions/index.d.ts.map +1 -0
- package/resources/functions/index.js +9 -0
- package/resources/functions/index.js.map +1 -0
- package/resources/functions/index.mjs +4 -0
- package/resources/functions/index.mjs.map +1 -0
- package/resources/functions/secrets.d.mts +78 -0
- package/resources/functions/secrets.d.mts.map +1 -0
- package/resources/functions/secrets.d.ts +78 -0
- package/resources/functions/secrets.d.ts.map +1 -0
- package/resources/functions/secrets.js +61 -0
- package/resources/functions/secrets.js.map +1 -0
- package/resources/functions/secrets.mjs +57 -0
- package/resources/functions/secrets.mjs.map +1 -0
- package/resources/functions.d.mts +2 -0
- package/resources/functions.d.mts.map +1 -0
- package/resources/functions.d.ts +2 -0
- package/resources/functions.d.ts.map +1 -0
- package/resources/functions.js +6 -0
- package/resources/functions.js.map +1 -0
- package/resources/functions.mjs +3 -0
- package/resources/functions.mjs.map +1 -0
- package/resources/index.d.mts +13 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +13 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +22 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +11 -1
- package/resources/index.mjs.map +1 -1
- package/resources/introspect.d.mts.map +1 -1
- package/resources/introspect.d.ts.map +1 -1
- package/resources/introspect.mjs.map +1 -1
- package/resources/invitations.d.mts +133 -0
- package/resources/invitations.d.mts.map +1 -0
- package/resources/invitations.d.ts +133 -0
- package/resources/invitations.d.ts.map +1 -0
- package/resources/invitations.js +67 -0
- package/resources/invitations.js.map +1 -0
- package/resources/invitations.mjs +63 -0
- package/resources/invitations.mjs.map +1 -0
- package/resources/me.d.mts +34 -0
- package/resources/me.d.mts.map +1 -0
- package/resources/me.d.ts +34 -0
- package/resources/me.d.ts.map +1 -0
- package/resources/me.js +16 -0
- package/resources/me.js.map +1 -0
- package/resources/me.mjs +12 -0
- package/resources/me.mjs.map +1 -0
- package/resources/messages.d.mts +112 -7
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +112 -7
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +24 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +24 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/number-10dlc/brands.d.mts +258 -0
- package/resources/number-10dlc/brands.d.mts.map +1 -0
- package/resources/number-10dlc/brands.d.ts +258 -0
- package/resources/number-10dlc/brands.d.ts.map +1 -0
- package/resources/number-10dlc/brands.js +132 -0
- package/resources/number-10dlc/brands.js.map +1 -0
- package/resources/number-10dlc/brands.mjs +128 -0
- package/resources/number-10dlc/brands.mjs.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.d.mts +223 -0
- package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.d.ts +223 -0
- package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.js +133 -0
- package/resources/number-10dlc/campaigns/campaigns.js.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.mjs +128 -0
- package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -0
- package/resources/number-10dlc/campaigns/index.d.mts +3 -0
- package/resources/number-10dlc/campaigns/index.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns/index.d.ts +3 -0
- package/resources/number-10dlc/campaigns/index.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns/index.js +9 -0
- package/resources/number-10dlc/campaigns/index.js.map +1 -0
- package/resources/number-10dlc/campaigns/index.mjs +4 -0
- package/resources/number-10dlc/campaigns/index.mjs.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.mts +79 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.ts +79 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.js +59 -0
- package/resources/number-10dlc/campaigns/phone-numbers.js.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.mjs +55 -0
- package/resources/number-10dlc/campaigns/phone-numbers.mjs.map +1 -0
- package/resources/number-10dlc/campaigns.d.mts +2 -0
- package/resources/number-10dlc/campaigns.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns.d.ts +2 -0
- package/resources/number-10dlc/campaigns.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns.js +6 -0
- package/resources/number-10dlc/campaigns.js.map +1 -0
- package/resources/number-10dlc/campaigns.mjs +3 -0
- package/resources/number-10dlc/campaigns.mjs.map +1 -0
- package/resources/number-10dlc/index.d.mts +4 -0
- package/resources/number-10dlc/index.d.mts.map +1 -0
- package/resources/number-10dlc/index.d.ts +4 -0
- package/resources/number-10dlc/index.d.ts.map +1 -0
- package/resources/number-10dlc/index.js +11 -0
- package/resources/number-10dlc/index.js.map +1 -0
- package/resources/number-10dlc/index.mjs +5 -0
- package/resources/number-10dlc/index.mjs.map +1 -0
- package/resources/number-10dlc/number-10dlc.d.mts +14 -0
- package/resources/number-10dlc/number-10dlc.d.mts.map +1 -0
- package/resources/number-10dlc/number-10dlc.d.ts +14 -0
- package/resources/number-10dlc/number-10dlc.d.ts.map +1 -0
- package/resources/number-10dlc/number-10dlc.js +21 -0
- package/resources/number-10dlc/number-10dlc.js.map +1 -0
- package/resources/number-10dlc/number-10dlc.mjs +16 -0
- package/resources/number-10dlc/number-10dlc.mjs.map +1 -0
- package/resources/number-10dlc.d.mts +2 -0
- package/resources/number-10dlc.d.mts.map +1 -0
- package/resources/number-10dlc.d.ts +2 -0
- package/resources/number-10dlc.d.ts.map +1 -0
- package/resources/number-10dlc.js +6 -0
- package/resources/number-10dlc.js.map +1 -0
- package/resources/number-10dlc.mjs +3 -0
- package/resources/number-10dlc.mjs.map +1 -0
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/plan.d.mts +43 -0
- package/resources/plan.d.mts.map +1 -0
- package/resources/plan.d.ts +43 -0
- package/resources/plan.d.ts.map +1 -0
- package/resources/plan.js +16 -0
- package/resources/plan.js.map +1 -0
- package/resources/plan.mjs +12 -0
- package/resources/plan.mjs.map +1 -0
- package/resources/regulatory-documents.d.mts.map +1 -1
- package/resources/regulatory-documents.d.ts.map +1 -1
- package/resources/regulatory-documents.mjs.map +1 -1
- package/resources/senders/agent/agent.d.mts +6 -6
- package/resources/senders/agent/agent.d.mts.map +1 -1
- package/resources/senders/agent/agent.d.ts +6 -6
- package/resources/senders/agent/agent.d.ts.map +1 -1
- package/resources/senders/agent/agent.js.map +1 -1
- package/resources/senders/agent/agent.mjs +1 -1
- package/resources/senders/agent/agent.mjs.map +1 -1
- package/resources/senders/agent/executions.d.mts +22 -1
- package/resources/senders/agent/executions.d.mts.map +1 -1
- package/resources/senders/agent/executions.d.ts +22 -1
- package/resources/senders/agent/executions.d.ts.map +1 -1
- package/resources/senders/agent/executions.js +17 -0
- package/resources/senders/agent/executions.js.map +1 -1
- package/resources/senders/agent/executions.mjs +17 -0
- package/resources/senders/agent/executions.mjs.map +1 -1
- package/resources/senders/agent/flows.d.mts +40 -114
- package/resources/senders/agent/flows.d.mts.map +1 -1
- package/resources/senders/agent/flows.d.ts +40 -114
- package/resources/senders/agent/flows.d.ts.map +1 -1
- package/resources/senders/agent/flows.mjs.map +1 -1
- package/resources/senders/agent/index.d.mts +3 -3
- package/resources/senders/agent/index.d.mts.map +1 -1
- package/resources/senders/agent/index.d.ts +3 -3
- package/resources/senders/agent/index.d.ts.map +1 -1
- package/resources/senders/agent/index.js.map +1 -1
- package/resources/senders/agent/index.mjs +1 -1
- package/resources/senders/agent/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/tools.d.mts +15 -47
- package/resources/senders/agent/tools.d.mts.map +1 -1
- package/resources/senders/agent/tools.d.ts +15 -47
- package/resources/senders/agent/tools.d.ts.map +1 -1
- package/resources/senders/agent/tools.mjs.map +1 -1
- package/resources/senders/agent.d.mts.map +1 -1
- package/resources/senders/agent.d.ts.map +1 -1
- package/resources/senders/agent.mjs.map +1 -1
- package/resources/senders/index.d.mts +1 -0
- package/resources/senders/index.d.mts.map +1 -1
- package/resources/senders/index.d.ts +1 -0
- package/resources/senders/index.d.ts.map +1 -1
- package/resources/senders/index.js +3 -1
- package/resources/senders/index.js.map +1 -1
- package/resources/senders/index.mjs +1 -0
- package/resources/senders/index.mjs.map +1 -1
- package/resources/senders/senders.d.mts +24 -1
- package/resources/senders/senders.d.mts.map +1 -1
- package/resources/senders/senders.d.ts +24 -1
- package/resources/senders/senders.d.ts.map +1 -1
- package/resources/senders/senders.js +4 -0
- package/resources/senders/senders.js.map +1 -1
- package/resources/senders/senders.mjs +4 -0
- package/resources/senders/senders.mjs.map +1 -1
- package/resources/senders/whatsapp-sync.d.mts +134 -0
- package/resources/senders/whatsapp-sync.d.mts.map +1 -0
- package/resources/senders/whatsapp-sync.d.ts +134 -0
- package/resources/senders/whatsapp-sync.d.ts.map +1 -0
- package/resources/senders/whatsapp-sync.js +56 -0
- package/resources/senders/whatsapp-sync.js.map +1 -0
- package/resources/senders/whatsapp-sync.mjs +52 -0
- package/resources/senders/whatsapp-sync.mjs.map +1 -0
- package/resources/senders.d.mts.map +1 -1
- package/resources/senders.d.ts.map +1 -1
- package/resources/senders.mjs.map +1 -1
- package/resources/sub-accounts/api-keys.d.mts +88 -0
- package/resources/sub-accounts/api-keys.d.mts.map +1 -0
- package/resources/sub-accounts/api-keys.d.ts +88 -0
- package/resources/sub-accounts/api-keys.d.ts.map +1 -0
- package/resources/sub-accounts/api-keys.js +56 -0
- package/resources/sub-accounts/api-keys.js.map +1 -0
- package/resources/sub-accounts/api-keys.mjs +52 -0
- package/resources/sub-accounts/api-keys.mjs.map +1 -0
- package/resources/sub-accounts/index.d.mts +3 -0
- package/resources/sub-accounts/index.d.mts.map +1 -0
- package/resources/sub-accounts/index.d.ts +3 -0
- package/resources/sub-accounts/index.d.ts.map +1 -0
- package/resources/sub-accounts/index.js +9 -0
- package/resources/sub-accounts/index.js.map +1 -0
- package/resources/sub-accounts/index.mjs +4 -0
- package/resources/sub-accounts/index.mjs.map +1 -0
- package/resources/sub-accounts/sub-accounts.d.mts +174 -0
- package/resources/sub-accounts/sub-accounts.d.mts.map +1 -0
- package/resources/sub-accounts/sub-accounts.d.ts +174 -0
- package/resources/sub-accounts/sub-accounts.d.ts.map +1 -0
- package/resources/sub-accounts/sub-accounts.js +100 -0
- package/resources/sub-accounts/sub-accounts.js.map +1 -0
- package/resources/sub-accounts/sub-accounts.mjs +95 -0
- package/resources/sub-accounts/sub-accounts.mjs.map +1 -0
- package/resources/sub-accounts.d.mts +2 -0
- package/resources/sub-accounts.d.mts.map +1 -0
- package/resources/sub-accounts.d.ts +2 -0
- package/resources/sub-accounts.d.ts.map +1 -0
- package/resources/sub-accounts.js +6 -0
- package/resources/sub-accounts.js.map +1 -0
- package/resources/sub-accounts.mjs +3 -0
- package/resources/sub-accounts.mjs.map +1 -0
- package/resources/templates.d.mts +58 -2
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +58 -2
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.mjs.map +1 -1
- package/resources/urls.d.mts +88 -0
- package/resources/urls.d.mts.map +1 -0
- package/resources/urls.d.ts +88 -0
- package/resources/urls.d.ts.map +1 -0
- package/resources/urls.js +55 -0
- package/resources/urls.js.map +1 -0
- package/resources/urls.mjs +51 -0
- package/resources/urls.mjs.map +1 -0
- package/resources/usage.d.mts +36 -0
- package/resources/usage.d.mts.map +1 -0
- package/resources/usage.d.ts +36 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +16 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +12 -0
- package/resources/usage.mjs.map +1 -0
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +182 -6
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/balance.ts +43 -0
- package/src/resources/broadcasts/broadcasts.ts +50 -1
- package/src/resources/broadcasts/contacts.ts +8 -1
- package/src/resources/broadcasts/index.ts +2 -0
- package/src/resources/contacts/channels.ts +177 -0
- package/src/resources/contacts/contacts.ts +380 -0
- package/src/resources/contacts/index.ts +22 -0
- package/src/resources/contacts.ts +1 -196
- package/src/resources/exports.ts +141 -0
- package/src/resources/functions/functions.ts +562 -0
- package/src/resources/functions/index.ts +23 -0
- package/src/resources/functions/secrets.ts +112 -0
- package/src/resources/functions.ts +3 -0
- package/src/resources/index.ts +68 -1
- package/src/resources/invitations.ts +188 -0
- package/src/resources/me.ts +49 -0
- package/src/resources/messages.ts +140 -4
- package/src/resources/number-10dlc/brands.ts +377 -0
- package/src/resources/number-10dlc/campaigns/campaigns.ts +349 -0
- package/src/resources/number-10dlc/campaigns/index.ts +23 -0
- package/src/resources/number-10dlc/campaigns/phone-numbers.ts +123 -0
- package/src/resources/number-10dlc/campaigns.ts +3 -0
- package/src/resources/number-10dlc/index.ts +30 -0
- package/src/resources/number-10dlc/number-10dlc.ts +71 -0
- package/src/resources/number-10dlc.ts +3 -0
- package/src/resources/plan.ts +62 -0
- package/src/resources/senders/agent/agent.ts +18 -2
- package/src/resources/senders/agent/executions.ts +36 -1
- package/src/resources/senders/agent/flows.ts +44 -126
- package/src/resources/senders/agent/index.ts +9 -1
- package/src/resources/senders/agent/tools.ts +13 -50
- package/src/resources/senders/index.ts +9 -0
- package/src/resources/senders/senders.ts +47 -1
- package/src/resources/senders/whatsapp-sync.ts +175 -0
- package/src/resources/sub-accounts/api-keys.ts +129 -0
- package/src/resources/sub-accounts/index.ts +22 -0
- package/src/resources/sub-accounts/sub-accounts.ts +252 -0
- package/src/resources/sub-accounts.ts +3 -0
- package/src/resources/templates.ts +69 -2
- package/src/resources/urls.ts +125 -0
- package/src/resources/usage.ts +48 -0
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +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,174 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as APIKeysAPI from "./api-keys.js";
|
|
3
|
+
import { APIKeyCreateParams, APIKeyCreateResponse, APIKeyListResponse, APIKeyRevokeParams, APIKeys } from "./api-keys.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from "../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
export declare class SubAccounts extends APIResource {
|
|
8
|
+
apiKeys: APIKeysAPI.APIKeys;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new sub-account (project) with its own API key. All charges are billed
|
|
11
|
+
* to the parent team's balance. Use creditLimit to set a spending cap. The
|
|
12
|
+
* sub-account's API key is returned only in the creation response. Requires a
|
|
13
|
+
* parent project API key; sub-account API keys receive HTTP 403.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const subAccount = await client.subAccounts.create({
|
|
18
|
+
* name: 'Client ABC',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(body: SubAccountCreateParams, options?: RequestOptions): APIPromise<SubAccountCreateResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Get sub-account. Requires a parent project API key; sub-account API keys receive
|
|
25
|
+
* HTTP 403.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const subAccount = await client.subAccounts.retrieve('id');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<SubAccountRetrieveResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Update sub-account. Requires a parent project API key; sub-account API keys
|
|
35
|
+
* receive HTTP 403.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const subAccount = await client.subAccounts.update('id');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
update(id: string, body: SubAccountUpdateParams, options?: RequestOptions): APIPromise<SubAccountUpdateResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* List sub-accounts for this team. Requires a parent project API key; sub-account
|
|
45
|
+
* API keys receive HTTP 403.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* // Automatically fetches more pages as needed.
|
|
50
|
+
* for await (const subAccount of client.subAccounts.list()) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
list(query?: SubAccountListParams | null | undefined, options?: RequestOptions): PagePromise<SubAccountsCursor, SubAccount>;
|
|
56
|
+
/**
|
|
57
|
+
* Deactivate a sub-account. Remaining balance is returned to the parent team and
|
|
58
|
+
* all API keys are revoked. Requires a parent project API key; sub-account API
|
|
59
|
+
* keys receive HTTP 403.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const response = await client.subAccounts.deactivate('id');
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
deactivate(id: string, options?: RequestOptions): APIPromise<SubAccountDeactivateResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Get spending information for a sub-account. Returns the parent team's balance,
|
|
69
|
+
* the sub-account's total spending, and its credit limit (spending cap). Requires
|
|
70
|
+
* a parent project API key; sub-account API keys receive HTTP 403.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const response = await client.subAccounts.getBalance('id');
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
getBalance(id: string, options?: RequestOptions): APIPromise<SubAccountGetBalanceResponse>;
|
|
78
|
+
}
|
|
79
|
+
export type SubAccountsCursor = Cursor<SubAccount>;
|
|
80
|
+
export interface SubAccount {
|
|
81
|
+
id: string;
|
|
82
|
+
createdAt: string;
|
|
83
|
+
name: string;
|
|
84
|
+
status: 'active' | 'inactive';
|
|
85
|
+
/**
|
|
86
|
+
* Total amount spent by this sub-account in cents.
|
|
87
|
+
*/
|
|
88
|
+
totalSpent: number;
|
|
89
|
+
/**
|
|
90
|
+
* API key for the sub-account. Only returned on creation.
|
|
91
|
+
*/
|
|
92
|
+
apiKey?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Spending cap in cents. When reached, messages from this sub-account will be
|
|
95
|
+
* blocked.
|
|
96
|
+
*/
|
|
97
|
+
creditLimit?: number | null;
|
|
98
|
+
/**
|
|
99
|
+
* External reference ID set by the parent account.
|
|
100
|
+
*/
|
|
101
|
+
externalId?: string | null;
|
|
102
|
+
metadata?: {
|
|
103
|
+
[key: string]: unknown;
|
|
104
|
+
} | null;
|
|
105
|
+
}
|
|
106
|
+
export interface SubAccountCreateResponse {
|
|
107
|
+
subAccount: SubAccount;
|
|
108
|
+
}
|
|
109
|
+
export interface SubAccountRetrieveResponse {
|
|
110
|
+
subAccount: SubAccount;
|
|
111
|
+
}
|
|
112
|
+
export interface SubAccountUpdateResponse {
|
|
113
|
+
subAccount: SubAccount;
|
|
114
|
+
}
|
|
115
|
+
export interface SubAccountDeactivateResponse {
|
|
116
|
+
/**
|
|
117
|
+
* Number of API keys revoked.
|
|
118
|
+
*/
|
|
119
|
+
keysRevoked: number;
|
|
120
|
+
message: string;
|
|
121
|
+
}
|
|
122
|
+
export interface SubAccountGetBalanceResponse {
|
|
123
|
+
/**
|
|
124
|
+
* Team balance in cents. All charges are billed to the parent team.
|
|
125
|
+
*/
|
|
126
|
+
balance: number;
|
|
127
|
+
currency: string;
|
|
128
|
+
/**
|
|
129
|
+
* Spending cap in cents (only for sub-accounts).
|
|
130
|
+
*/
|
|
131
|
+
creditLimit?: number | null;
|
|
132
|
+
/**
|
|
133
|
+
* Whether this API key belongs to a sub-account.
|
|
134
|
+
*/
|
|
135
|
+
isSubAccount?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Total amount spent by this sub-account in cents (only for sub-accounts).
|
|
138
|
+
*/
|
|
139
|
+
totalSpent?: number | null;
|
|
140
|
+
}
|
|
141
|
+
export interface SubAccountCreateParams {
|
|
142
|
+
/**
|
|
143
|
+
* Name of the sub-account.
|
|
144
|
+
*/
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* Spending cap in cents. When reached, messages from this sub-account will be
|
|
148
|
+
* blocked. Omit or set to 0 for no limit.
|
|
149
|
+
*/
|
|
150
|
+
creditLimit?: number;
|
|
151
|
+
/**
|
|
152
|
+
* External reference ID for your own tracking.
|
|
153
|
+
*/
|
|
154
|
+
externalId?: string;
|
|
155
|
+
metadata?: {
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export interface SubAccountUpdateParams {
|
|
160
|
+
creditLimit?: number | null;
|
|
161
|
+
externalId?: string;
|
|
162
|
+
metadata?: {
|
|
163
|
+
[key: string]: unknown;
|
|
164
|
+
};
|
|
165
|
+
name?: string;
|
|
166
|
+
status?: 'active' | 'inactive';
|
|
167
|
+
}
|
|
168
|
+
export interface SubAccountListParams extends CursorParams {
|
|
169
|
+
}
|
|
170
|
+
export declare namespace SubAccounts {
|
|
171
|
+
export { type SubAccount as SubAccount, type SubAccountCreateResponse as SubAccountCreateResponse, type SubAccountRetrieveResponse as SubAccountRetrieveResponse, type SubAccountUpdateResponse as SubAccountUpdateResponse, type SubAccountDeactivateResponse as SubAccountDeactivateResponse, type SubAccountGetBalanceResponse as SubAccountGetBalanceResponse, type SubAccountsCursor as SubAccountsCursor, type SubAccountCreateParams as SubAccountCreateParams, type SubAccountUpdateParams as SubAccountUpdateParams, type SubAccountListParams as SubAccountListParams, };
|
|
172
|
+
export { APIKeys as APIKeys, type APIKeyCreateResponse as APIKeyCreateResponse, type APIKeyListResponse as APIKeyListResponse, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRevokeParams as APIKeyRevokeParams, };
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=sub-accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.d.ts","sourceRoot":"","sources":["../../src/resources/sub-accounts/sub-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,UAAU,sBAAmB;AACzC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EACR,sBAAmB;AACpB,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,iCAA8B;AAC/E,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IAEnE;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAItF;;;;;;;;OAQG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC;IAI7C;;;;;;;;;OASG;IACH,U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AAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,100 @@
|
|
|
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.SubAccounts = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const APIKeysAPI = tslib_1.__importStar(require("./api-keys.js"));
|
|
8
|
+
const api_keys_1 = require("./api-keys.js");
|
|
9
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
10
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
11
|
+
class SubAccounts extends resource_1.APIResource {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.apiKeys = new APIKeysAPI.APIKeys(this._client);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a new sub-account (project) with its own API key. All charges are billed
|
|
18
|
+
* to the parent team's balance. Use creditLimit to set a spending cap. The
|
|
19
|
+
* sub-account's API key is returned only in the creation response. Requires a
|
|
20
|
+
* parent project API key; sub-account API keys receive HTTP 403.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const subAccount = await client.subAccounts.create({
|
|
25
|
+
* name: 'Client ABC',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(body, options) {
|
|
30
|
+
return this._client.post('/v1/sub-accounts', { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get sub-account. Requires a parent project API key; sub-account API keys receive
|
|
34
|
+
* HTTP 403.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const subAccount = await client.subAccounts.retrieve('id');
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
retrieve(id, options) {
|
|
42
|
+
return this._client.get((0, path_1.path) `/v1/sub-accounts/${id}`, options);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update sub-account. Requires a parent project API key; sub-account API keys
|
|
46
|
+
* receive HTTP 403.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const subAccount = await client.subAccounts.update('id');
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
update(id, body, options) {
|
|
54
|
+
return this._client.patch((0, path_1.path) `/v1/sub-accounts/${id}`, { body, ...options });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* List sub-accounts for this team. Requires a parent project API key; sub-account
|
|
58
|
+
* API keys receive HTTP 403.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // Automatically fetches more pages as needed.
|
|
63
|
+
* for await (const subAccount of client.subAccounts.list()) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
list(query = {}, options) {
|
|
69
|
+
return this._client.getAPIList('/v1/sub-accounts', (pagination_1.Cursor), { query, ...options });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Deactivate a sub-account. Remaining balance is returned to the parent team and
|
|
73
|
+
* all API keys are revoked. Requires a parent project API key; sub-account API
|
|
74
|
+
* keys receive HTTP 403.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const response = await client.subAccounts.deactivate('id');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
deactivate(id, options) {
|
|
82
|
+
return this._client.delete((0, path_1.path) `/v1/sub-accounts/${id}`, options);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get spending information for a sub-account. Returns the parent team's balance,
|
|
86
|
+
* the sub-account's total spending, and its credit limit (spending cap). Requires
|
|
87
|
+
* a parent project API key; sub-account API keys receive HTTP 403.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const response = await client.subAccounts.getBalance('id');
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
getBalance(id, options) {
|
|
95
|
+
return this._client.get((0, path_1.path) `/v1/sub-accounts/${id}/balance`, options);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.SubAccounts = SubAccounts;
|
|
99
|
+
SubAccounts.APIKeys = api_keys_1.APIKeys;
|
|
100
|
+
//# sourceMappingURL=sub-accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.js","sourceRoot":"","sources":["../../src/resources/sub-accounts/sub-accounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,kEAAyC;AACzC,4CAMoB;AAEpB,yDAA+E;AAE/E,uDAAiD;AAEjD,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+FrE,CAAC;IA7FC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CACJ,EAAU,EACV,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,mBAAkB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAU,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAU,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;CACF;AAhGD,kCAgGC;AAoHD,WAAW,CAAC,OAAO,GAAG,kBAAO,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as APIKeysAPI from "./api-keys.mjs";
|
|
4
|
+
import { APIKeys, } from "./api-keys.mjs";
|
|
5
|
+
import { Cursor } from "../../core/pagination.mjs";
|
|
6
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
7
|
+
export class SubAccounts extends APIResource {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.apiKeys = new APIKeysAPI.APIKeys(this._client);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create a new sub-account (project) with its own API key. All charges are billed
|
|
14
|
+
* to the parent team's balance. Use creditLimit to set a spending cap. The
|
|
15
|
+
* sub-account's API key is returned only in the creation response. Requires a
|
|
16
|
+
* parent project API key; sub-account API keys receive HTTP 403.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const subAccount = await client.subAccounts.create({
|
|
21
|
+
* name: 'Client ABC',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(body, options) {
|
|
26
|
+
return this._client.post('/v1/sub-accounts', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get sub-account. Requires a parent project API key; sub-account API keys receive
|
|
30
|
+
* HTTP 403.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const subAccount = await client.subAccounts.retrieve('id');
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieve(id, options) {
|
|
38
|
+
return this._client.get(path `/v1/sub-accounts/${id}`, options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Update sub-account. Requires a parent project API key; sub-account API keys
|
|
42
|
+
* receive HTTP 403.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const subAccount = await client.subAccounts.update('id');
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
update(id, body, options) {
|
|
50
|
+
return this._client.patch(path `/v1/sub-accounts/${id}`, { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* List sub-accounts for this team. Requires a parent project API key; sub-account
|
|
54
|
+
* API keys receive HTTP 403.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* // Automatically fetches more pages as needed.
|
|
59
|
+
* for await (const subAccount of client.subAccounts.list()) {
|
|
60
|
+
* // ...
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
list(query = {}, options) {
|
|
65
|
+
return this._client.getAPIList('/v1/sub-accounts', (Cursor), { query, ...options });
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Deactivate a sub-account. Remaining balance is returned to the parent team and
|
|
69
|
+
* all API keys are revoked. Requires a parent project API key; sub-account API
|
|
70
|
+
* keys receive HTTP 403.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const response = await client.subAccounts.deactivate('id');
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
deactivate(id, options) {
|
|
78
|
+
return this._client.delete(path `/v1/sub-accounts/${id}`, options);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get spending information for a sub-account. Returns the parent team's balance,
|
|
82
|
+
* the sub-account's total spending, and its credit limit (spending cap). Requires
|
|
83
|
+
* a parent project API key; sub-account API keys receive HTTP 403.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const response = await client.subAccounts.getBalance('id');
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
getBalance(id, options) {
|
|
91
|
+
return this._client.get(path `/v1/sub-accounts/${id}/balance`, options);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
SubAccounts.APIKeys = APIKeys;
|
|
95
|
+
//# sourceMappingURL=sub-accounts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.mjs","sourceRoot":"","sources":["../../src/resources/sub-accounts/sub-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,UAAU,uBAAmB;AACzC,OAAO,EAKL,OAAO,GACR,uBAAmB;AAEpB,OAAO,EAAE,MAAM,EAAkC,kCAA8B;AAE/E,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;Q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;AAoHD,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.d.mts","sourceRoot":"","sources":["../src/resources/sub-accounts.ts"],"names":[],"mappings":"AAEA,yCAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.d.ts","sourceRoot":"","sources":["../src/resources/sub-accounts.ts"],"names":[],"mappings":"AAEA,wCAAqC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./sub-accounts/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=sub-accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.js","sourceRoot":"","sources":["../src/resources/sub-accounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kEAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-accounts.mjs","sourceRoot":"","sources":["../src/resources/sub-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,yCAAqC"}
|
|
@@ -70,7 +70,8 @@ export type TemplatesCursor = Cursor<Template>;
|
|
|
70
70
|
export interface Template {
|
|
71
71
|
id: string;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Default template body with variables: {{1}}, {{2}}, or named variables like
|
|
74
|
+
* {{contact.first_name}}. Used when no channel-specific body is set.
|
|
74
75
|
*/
|
|
75
76
|
body: string;
|
|
76
77
|
/**
|
|
@@ -82,7 +83,7 @@ export interface Template {
|
|
|
82
83
|
*/
|
|
83
84
|
language: string;
|
|
84
85
|
/**
|
|
85
|
-
* Template name
|
|
86
|
+
* Template name. For WhatsApp, must match the approved template name in Meta.
|
|
86
87
|
*/
|
|
87
88
|
name: string;
|
|
88
89
|
/**
|
|
@@ -110,7 +111,19 @@ export interface Template {
|
|
|
110
111
|
* Type of header (text, image, video, document).
|
|
111
112
|
*/
|
|
112
113
|
headerType?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Channel-specific body for Instagram messages. Falls back to `body` if not set.
|
|
116
|
+
*/
|
|
117
|
+
instagramBody?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Channel-specific body for SMS messages. Falls back to `body` if not set.
|
|
120
|
+
*/
|
|
121
|
+
smsBody?: string;
|
|
113
122
|
status?: 'draft' | 'pending' | 'approved' | 'rejected';
|
|
123
|
+
/**
|
|
124
|
+
* Channel-specific body for Telegram messages. Falls back to `body` if not set.
|
|
125
|
+
*/
|
|
126
|
+
telegramBody?: string;
|
|
114
127
|
updatedAt?: string;
|
|
115
128
|
/**
|
|
116
129
|
* List of variable names for documentation.
|
|
@@ -123,6 +136,11 @@ export interface Template {
|
|
|
123
136
|
}
|
|
124
137
|
export declare namespace Template {
|
|
125
138
|
interface Button {
|
|
139
|
+
/**
|
|
140
|
+
* Sample value used to substitute `{{1}}` in the URL when submitting the template
|
|
141
|
+
* to Meta for review. Only present for dynamic URL buttons.
|
|
142
|
+
*/
|
|
143
|
+
example?: string;
|
|
126
144
|
/**
|
|
127
145
|
* OTP button type. Required when type is 'otp'.
|
|
128
146
|
*/
|
|
@@ -163,6 +181,9 @@ export declare namespace Template {
|
|
|
163
181
|
*/
|
|
164
182
|
export type WhatsappCategory = 'UTILITY' | 'MARKETING' | 'AUTHENTICATION';
|
|
165
183
|
export interface TemplateCreateParams {
|
|
184
|
+
/**
|
|
185
|
+
* Default template body. Used when no channel-specific body is set.
|
|
186
|
+
*/
|
|
166
187
|
body: string;
|
|
167
188
|
language: string;
|
|
168
189
|
name: string;
|
|
@@ -178,6 +199,30 @@ export interface TemplateCreateParams {
|
|
|
178
199
|
* Code expiration time in minutes. Only for AUTHENTICATION templates.
|
|
179
200
|
*/
|
|
180
201
|
codeExpirationMinutes?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Footer text for the template.
|
|
204
|
+
*/
|
|
205
|
+
footer?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Header content (text string or media URL).
|
|
208
|
+
*/
|
|
209
|
+
headerContent?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Type of header for the template.
|
|
212
|
+
*/
|
|
213
|
+
headerType?: 'text' | 'image' | 'video' | 'document';
|
|
214
|
+
/**
|
|
215
|
+
* Channel-specific body for Instagram. Falls back to `body` if not set.
|
|
216
|
+
*/
|
|
217
|
+
instagramBody?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Channel-specific body for SMS. Falls back to `body` if not set.
|
|
220
|
+
*/
|
|
221
|
+
smsBody?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Channel-specific body for Telegram. Falls back to `body` if not set.
|
|
224
|
+
*/
|
|
225
|
+
telegramBody?: string;
|
|
181
226
|
variables?: Array<string>;
|
|
182
227
|
/**
|
|
183
228
|
* WhatsApp template category.
|
|
@@ -188,6 +233,12 @@ export declare namespace TemplateCreateParams {
|
|
|
188
233
|
interface Button {
|
|
189
234
|
text: string;
|
|
190
235
|
type: 'quick_reply' | 'url' | 'phone' | 'otp';
|
|
236
|
+
/**
|
|
237
|
+
* Sample value Meta uses to review templates with a dynamic URL button.
|
|
238
|
+
* Substituted into `{{1}}` of the URL when the template is submitted to Meta. Only
|
|
239
|
+
* meaningful when `url` contains `{{1}}`; ignored for static URLs.
|
|
240
|
+
*/
|
|
241
|
+
example?: string;
|
|
191
242
|
/**
|
|
192
243
|
* Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables
|
|
193
244
|
* Android autofill.
|
|
@@ -202,6 +253,11 @@ export declare namespace TemplateCreateParams {
|
|
|
202
253
|
* Android app signature hash. Required for ONE_TAP buttons.
|
|
203
254
|
*/
|
|
204
255
|
signatureHash?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Button destination. Use `{{1}}` exactly once for a dynamic URL (e.g.
|
|
258
|
+
* `https://example.com/orders/{{1}}`); WhatsApp only accepts the strict `{{1}}`
|
|
259
|
+
* form. Static URLs must not contain any `{{...}}` placeholder.
|
|
260
|
+
*/
|
|
205
261
|
url?: string;
|
|
206
262
|
}
|
|
207
263
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.mts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"templates.d.mts","sourceRoot":"","sources":["../src/resources/templates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,+BAA2B;AAE5E,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAI5E;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,eAAe,EAAE,QAAQ,CAAC;IAIzC;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOtE;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,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AAE,MAAM,CAAC;IAEtB,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC;QAEb,IAAI,EAAE,aAAa,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;QAE9C;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;WAGG;QACH,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;QAElC;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QAEvB;;;;WAIG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,kBAAmB,SAAQ,YAAY;CAAG;AAE3D,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/templates.d.ts
CHANGED
|
@@ -70,7 +70,8 @@ export type TemplatesCursor = Cursor<Template>;
|
|
|
70
70
|
export interface Template {
|
|
71
71
|
id: string;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Default template body with variables: {{1}}, {{2}}, or named variables like
|
|
74
|
+
* {{contact.first_name}}. Used when no channel-specific body is set.
|
|
74
75
|
*/
|
|
75
76
|
body: string;
|
|
76
77
|
/**
|
|
@@ -82,7 +83,7 @@ export interface Template {
|
|
|
82
83
|
*/
|
|
83
84
|
language: string;
|
|
84
85
|
/**
|
|
85
|
-
* Template name
|
|
86
|
+
* Template name. For WhatsApp, must match the approved template name in Meta.
|
|
86
87
|
*/
|
|
87
88
|
name: string;
|
|
88
89
|
/**
|
|
@@ -110,7 +111,19 @@ export interface Template {
|
|
|
110
111
|
* Type of header (text, image, video, document).
|
|
111
112
|
*/
|
|
112
113
|
headerType?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Channel-specific body for Instagram messages. Falls back to `body` if not set.
|
|
116
|
+
*/
|
|
117
|
+
instagramBody?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Channel-specific body for SMS messages. Falls back to `body` if not set.
|
|
120
|
+
*/
|
|
121
|
+
smsBody?: string;
|
|
113
122
|
status?: 'draft' | 'pending' | 'approved' | 'rejected';
|
|
123
|
+
/**
|
|
124
|
+
* Channel-specific body for Telegram messages. Falls back to `body` if not set.
|
|
125
|
+
*/
|
|
126
|
+
telegramBody?: string;
|
|
114
127
|
updatedAt?: string;
|
|
115
128
|
/**
|
|
116
129
|
* List of variable names for documentation.
|
|
@@ -123,6 +136,11 @@ export interface Template {
|
|
|
123
136
|
}
|
|
124
137
|
export declare namespace Template {
|
|
125
138
|
interface Button {
|
|
139
|
+
/**
|
|
140
|
+
* Sample value used to substitute `{{1}}` in the URL when submitting the template
|
|
141
|
+
* to Meta for review. Only present for dynamic URL buttons.
|
|
142
|
+
*/
|
|
143
|
+
example?: string;
|
|
126
144
|
/**
|
|
127
145
|
* OTP button type. Required when type is 'otp'.
|
|
128
146
|
*/
|
|
@@ -163,6 +181,9 @@ export declare namespace Template {
|
|
|
163
181
|
*/
|
|
164
182
|
export type WhatsappCategory = 'UTILITY' | 'MARKETING' | 'AUTHENTICATION';
|
|
165
183
|
export interface TemplateCreateParams {
|
|
184
|
+
/**
|
|
185
|
+
* Default template body. Used when no channel-specific body is set.
|
|
186
|
+
*/
|
|
166
187
|
body: string;
|
|
167
188
|
language: string;
|
|
168
189
|
name: string;
|
|
@@ -178,6 +199,30 @@ export interface TemplateCreateParams {
|
|
|
178
199
|
* Code expiration time in minutes. Only for AUTHENTICATION templates.
|
|
179
200
|
*/
|
|
180
201
|
codeExpirationMinutes?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Footer text for the template.
|
|
204
|
+
*/
|
|
205
|
+
footer?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Header content (text string or media URL).
|
|
208
|
+
*/
|
|
209
|
+
headerContent?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Type of header for the template.
|
|
212
|
+
*/
|
|
213
|
+
headerType?: 'text' | 'image' | 'video' | 'document';
|
|
214
|
+
/**
|
|
215
|
+
* Channel-specific body for Instagram. Falls back to `body` if not set.
|
|
216
|
+
*/
|
|
217
|
+
instagramBody?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Channel-specific body for SMS. Falls back to `body` if not set.
|
|
220
|
+
*/
|
|
221
|
+
smsBody?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Channel-specific body for Telegram. Falls back to `body` if not set.
|
|
224
|
+
*/
|
|
225
|
+
telegramBody?: string;
|
|
181
226
|
variables?: Array<string>;
|
|
182
227
|
/**
|
|
183
228
|
* WhatsApp template category.
|
|
@@ -188,6 +233,12 @@ export declare namespace TemplateCreateParams {
|
|
|
188
233
|
interface Button {
|
|
189
234
|
text: string;
|
|
190
235
|
type: 'quick_reply' | 'url' | 'phone' | 'otp';
|
|
236
|
+
/**
|
|
237
|
+
* Sample value Meta uses to review templates with a dynamic URL button.
|
|
238
|
+
* Substituted into `{{1}}` of the URL when the template is submitted to Meta. Only
|
|
239
|
+
* meaningful when `url` contains `{{1}}`; ignored for static URLs.
|
|
240
|
+
*/
|
|
241
|
+
example?: string;
|
|
191
242
|
/**
|
|
192
243
|
* Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables
|
|
193
244
|
* Android autofill.
|
|
@@ -202,6 +253,11 @@ export declare namespace TemplateCreateParams {
|
|
|
202
253
|
* Android app signature hash. Required for ONE_TAP buttons.
|
|
203
254
|
*/
|
|
204
255
|
signatureHash?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Button destination. Use `{{1}}` exactly once for a dynamic URL (e.g.
|
|
258
|
+
* `https://example.com/orders/{{1}}`); WhatsApp only accepts the strict `{{1}}`
|
|
259
|
+
* form. Static URLs must not contain any `{{...}}` placeholder.
|
|
260
|
+
*/
|
|
205
261
|
url?: string;
|
|
206
262
|
}
|
|
207
263
|
}
|