openai 7.18.0 → 7.20.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 +28 -0
- package/README.md +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +13 -7
- package/client.js.map +1 -1
- package/client.mjs +13 -7
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +11 -7
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +11 -7
- package/internal/parse.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 +1 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -0
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/admin/organization/admin-api-keys.d.mts +13 -2
- package/resources/admin/organization/admin-api-keys.d.mts.map +1 -1
- package/resources/admin/organization/admin-api-keys.d.ts +13 -2
- package/resources/admin/organization/admin-api-keys.d.ts.map +1 -1
- package/resources/admin/organization/admin-api-keys.js +58 -11
- package/resources/admin/organization/admin-api-keys.js.map +1 -1
- package/resources/admin/organization/admin-api-keys.mjs +58 -11
- package/resources/admin/organization/admin-api-keys.mjs.map +1 -1
- package/resources/admin/organization/audit-logs.d.mts +56 -3
- package/resources/admin/organization/audit-logs.d.mts.map +1 -1
- package/resources/admin/organization/audit-logs.d.ts +56 -3
- package/resources/admin/organization/audit-logs.d.ts.map +1 -1
- package/resources/admin/organization/audit-logs.js +69 -11
- package/resources/admin/organization/audit-logs.js.map +1 -1
- package/resources/admin/organization/audit-logs.mjs +69 -11
- package/resources/admin/organization/audit-logs.mjs.map +1 -1
- package/resources/admin/organization/certificates.d.mts +16 -2
- package/resources/admin/organization/certificates.d.mts.map +1 -1
- package/resources/admin/organization/certificates.d.ts +16 -2
- package/resources/admin/organization/certificates.d.ts.map +1 -1
- package/resources/admin/organization/certificates.js +64 -24
- package/resources/admin/organization/certificates.js.map +1 -1
- package/resources/admin/organization/certificates.mjs +64 -24
- package/resources/admin/organization/certificates.mjs.map +1 -1
- package/resources/admin/organization/external-storage.d.mts +141 -0
- package/resources/admin/organization/external-storage.d.mts.map +1 -0
- package/resources/admin/organization/external-storage.d.ts +141 -0
- package/resources/admin/organization/external-storage.d.ts.map +1 -0
- package/resources/admin/organization/external-storage.js +146 -0
- package/resources/admin/organization/external-storage.js.map +1 -0
- package/resources/admin/organization/external-storage.mjs +142 -0
- package/resources/admin/organization/external-storage.mjs.map +1 -0
- package/resources/admin/organization/groups/groups.d.mts +8 -1
- package/resources/admin/organization/groups/groups.d.mts.map +1 -1
- package/resources/admin/organization/groups/groups.d.ts +8 -1
- package/resources/admin/organization/groups/groups.d.ts.map +1 -1
- package/resources/admin/organization/groups/groups.js +58 -11
- package/resources/admin/organization/groups/groups.js.map +1 -1
- package/resources/admin/organization/groups/groups.mjs +58 -11
- package/resources/admin/organization/groups/groups.mjs.map +1 -1
- package/resources/admin/organization/groups/roles.d.mts +8 -1
- package/resources/admin/organization/groups/roles.d.mts.map +1 -1
- package/resources/admin/organization/groups/roles.d.ts +8 -1
- package/resources/admin/organization/groups/roles.d.ts.map +1 -1
- package/resources/admin/organization/groups/roles.js +58 -13
- package/resources/admin/organization/groups/roles.js.map +1 -1
- package/resources/admin/organization/groups/roles.mjs +58 -13
- package/resources/admin/organization/groups/roles.mjs.map +1 -1
- package/resources/admin/organization/groups/users.d.mts +8 -1
- package/resources/admin/organization/groups/users.d.mts.map +1 -1
- package/resources/admin/organization/groups/users.d.ts +8 -1
- package/resources/admin/organization/groups/users.d.ts.map +1 -1
- package/resources/admin/organization/groups/users.js +58 -13
- package/resources/admin/organization/groups/users.js.map +1 -1
- package/resources/admin/organization/groups/users.mjs +58 -13
- package/resources/admin/organization/groups/users.mjs.map +1 -1
- package/resources/admin/organization/index.d.mts +1 -0
- package/resources/admin/organization/index.d.mts.map +1 -1
- package/resources/admin/organization/index.d.ts +1 -0
- package/resources/admin/organization/index.d.ts.map +1 -1
- package/resources/admin/organization/index.js +3 -1
- package/resources/admin/organization/index.js.map +1 -1
- package/resources/admin/organization/index.mjs +1 -0
- package/resources/admin/organization/index.mjs.map +1 -1
- package/resources/admin/organization/invites.d.mts +8 -1
- package/resources/admin/organization/invites.d.mts.map +1 -1
- package/resources/admin/organization/invites.d.ts +8 -1
- package/resources/admin/organization/invites.d.ts.map +1 -1
- package/resources/admin/organization/invites.js +58 -11
- package/resources/admin/organization/invites.js.map +1 -1
- package/resources/admin/organization/invites.mjs +58 -11
- package/resources/admin/organization/invites.mjs.map +1 -1
- package/resources/admin/organization/organization.d.mts +4 -0
- package/resources/admin/organization/organization.d.mts.map +1 -1
- package/resources/admin/organization/organization.d.ts +4 -0
- package/resources/admin/organization/organization.d.ts.map +1 -1
- package/resources/admin/organization/organization.js +4 -0
- package/resources/admin/organization/organization.js.map +1 -1
- package/resources/admin/organization/organization.mjs +4 -0
- package/resources/admin/organization/organization.mjs.map +1 -1
- package/resources/admin/organization/projects/api-keys.d.mts +8 -1
- package/resources/admin/organization/projects/api-keys.d.mts.map +1 -1
- package/resources/admin/organization/projects/api-keys.d.ts +8 -1
- package/resources/admin/organization/projects/api-keys.d.ts.map +1 -1
- package/resources/admin/organization/projects/api-keys.js +58 -13
- package/resources/admin/organization/projects/api-keys.js.map +1 -1
- package/resources/admin/organization/projects/api-keys.mjs +58 -13
- package/resources/admin/organization/projects/api-keys.mjs.map +1 -1
- package/resources/admin/organization/projects/certificates.d.mts +8 -1
- package/resources/admin/organization/projects/certificates.d.mts.map +1 -1
- package/resources/admin/organization/projects/certificates.d.ts +8 -1
- package/resources/admin/organization/projects/certificates.d.ts.map +1 -1
- package/resources/admin/organization/projects/certificates.js +58 -13
- package/resources/admin/organization/projects/certificates.js.map +1 -1
- package/resources/admin/organization/projects/certificates.mjs +58 -13
- package/resources/admin/organization/projects/certificates.mjs.map +1 -1
- package/resources/admin/organization/projects/groups/groups.d.mts +8 -1
- package/resources/admin/organization/projects/groups/groups.d.mts.map +1 -1
- package/resources/admin/organization/projects/groups/groups.d.ts +8 -1
- package/resources/admin/organization/projects/groups/groups.d.ts.map +1 -1
- package/resources/admin/organization/projects/groups/groups.js +58 -13
- package/resources/admin/organization/projects/groups/groups.js.map +1 -1
- package/resources/admin/organization/projects/groups/groups.mjs +58 -13
- package/resources/admin/organization/projects/groups/groups.mjs.map +1 -1
- package/resources/admin/organization/projects/projects.d.mts +8 -1
- package/resources/admin/organization/projects/projects.d.mts.map +1 -1
- package/resources/admin/organization/projects/projects.d.ts +8 -1
- package/resources/admin/organization/projects/projects.d.ts.map +1 -1
- package/resources/admin/organization/projects/projects.js +58 -11
- package/resources/admin/organization/projects/projects.js.map +1 -1
- package/resources/admin/organization/projects/projects.mjs +58 -11
- package/resources/admin/organization/projects/projects.mjs.map +1 -1
- package/resources/admin/organization/projects/rate-limits.d.mts +8 -1
- package/resources/admin/organization/projects/rate-limits.d.mts.map +1 -1
- package/resources/admin/organization/projects/rate-limits.d.ts +8 -1
- package/resources/admin/organization/projects/rate-limits.d.ts.map +1 -1
- package/resources/admin/organization/projects/rate-limits.js +58 -13
- package/resources/admin/organization/projects/rate-limits.js.map +1 -1
- package/resources/admin/organization/projects/rate-limits.mjs +58 -13
- package/resources/admin/organization/projects/rate-limits.mjs.map +1 -1
- package/resources/admin/organization/projects/roles.d.mts +8 -1
- package/resources/admin/organization/projects/roles.d.mts.map +1 -1
- package/resources/admin/organization/projects/roles.d.ts +8 -1
- package/resources/admin/organization/projects/roles.d.ts.map +1 -1
- package/resources/admin/organization/projects/roles.js +58 -13
- package/resources/admin/organization/projects/roles.js.map +1 -1
- package/resources/admin/organization/projects/roles.mjs +58 -13
- package/resources/admin/organization/projects/roles.mjs.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts +8 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts +8 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.js +58 -13
- package/resources/admin/organization/projects/service-accounts/service-accounts.js.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.mjs +58 -13
- package/resources/admin/organization/projects/service-accounts/service-accounts.mjs.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.d.mts +8 -1
- package/resources/admin/organization/projects/spend-alerts.d.mts.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.d.ts +8 -1
- package/resources/admin/organization/projects/spend-alerts.d.ts.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.js +58 -13
- package/resources/admin/organization/projects/spend-alerts.js.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.mjs +58 -13
- package/resources/admin/organization/projects/spend-alerts.mjs.map +1 -1
- package/resources/admin/organization/projects/users/users.d.mts +8 -1
- package/resources/admin/organization/projects/users/users.d.mts.map +1 -1
- package/resources/admin/organization/projects/users/users.d.ts +8 -1
- package/resources/admin/organization/projects/users/users.d.ts.map +1 -1
- package/resources/admin/organization/projects/users/users.js +58 -13
- package/resources/admin/organization/projects/users/users.js.map +1 -1
- package/resources/admin/organization/projects/users/users.mjs +58 -13
- package/resources/admin/organization/projects/users/users.mjs.map +1 -1
- package/resources/admin/organization/roles.d.mts +8 -1
- package/resources/admin/organization/roles.d.mts.map +1 -1
- package/resources/admin/organization/roles.d.ts +8 -1
- package/resources/admin/organization/roles.d.ts.map +1 -1
- package/resources/admin/organization/roles.js +58 -11
- package/resources/admin/organization/roles.js.map +1 -1
- package/resources/admin/organization/roles.mjs +58 -11
- package/resources/admin/organization/roles.mjs.map +1 -1
- package/resources/admin/organization/spend-alerts.d.mts +8 -1
- package/resources/admin/organization/spend-alerts.d.mts.map +1 -1
- package/resources/admin/organization/spend-alerts.d.ts +8 -1
- package/resources/admin/organization/spend-alerts.d.ts.map +1 -1
- package/resources/admin/organization/spend-alerts.js +58 -11
- package/resources/admin/organization/spend-alerts.js.map +1 -1
- package/resources/admin/organization/spend-alerts.mjs +58 -11
- package/resources/admin/organization/spend-alerts.mjs.map +1 -1
- package/resources/admin/organization/users/roles.d.mts +8 -1
- package/resources/admin/organization/users/roles.d.mts.map +1 -1
- package/resources/admin/organization/users/roles.d.ts +8 -1
- package/resources/admin/organization/users/roles.d.ts.map +1 -1
- package/resources/admin/organization/users/roles.js +58 -13
- package/resources/admin/organization/users/roles.js.map +1 -1
- package/resources/admin/organization/users/roles.mjs +58 -13
- package/resources/admin/organization/users/roles.mjs.map +1 -1
- package/resources/admin/organization/users/users.d.mts +8 -1
- package/resources/admin/organization/users/users.d.mts.map +1 -1
- package/resources/admin/organization/users/users.d.ts +8 -1
- package/resources/admin/organization/users/users.d.ts.map +1 -1
- package/resources/admin/organization/users/users.js +58 -11
- package/resources/admin/organization/users/users.js.map +1 -1
- package/resources/admin/organization/users/users.mjs +58 -11
- package/resources/admin/organization/users/users.mjs.map +1 -1
- package/resources/batches.d.mts +8 -1
- package/resources/batches.d.mts.map +1 -1
- package/resources/batches.d.ts +8 -1
- package/resources/batches.d.ts.map +1 -1
- package/resources/batches.js +58 -3
- package/resources/batches.js.map +1 -1
- package/resources/batches.mjs +58 -3
- package/resources/batches.mjs.map +1 -1
- package/resources/beta/agents/agents.d.mts +67 -46
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +67 -46
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js +58 -12
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs +58 -12
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/environments/files.d.mts +5 -1
- package/resources/beta/agents/environments/files.d.mts.map +1 -1
- package/resources/beta/agents/environments/files.d.ts +5 -1
- package/resources/beta/agents/environments/files.d.ts.map +1 -1
- package/resources/beta/agents/environments/templates.d.mts +24 -13
- package/resources/beta/agents/environments/templates.d.mts.map +1 -1
- package/resources/beta/agents/environments/templates.d.ts +24 -13
- package/resources/beta/agents/environments/templates.d.ts.map +1 -1
- package/resources/beta/agents/environments/templates.js +58 -12
- package/resources/beta/agents/environments/templates.js.map +1 -1
- package/resources/beta/agents/environments/templates.mjs +58 -12
- package/resources/beta/agents/environments/templates.mjs.map +1 -1
- package/resources/beta/agents/sessions/artifacts.d.mts +17 -2
- package/resources/beta/agents/sessions/artifacts.d.mts.map +1 -1
- package/resources/beta/agents/sessions/artifacts.d.ts +17 -2
- package/resources/beta/agents/sessions/artifacts.d.ts.map +1 -1
- package/resources/beta/agents/sessions/artifacts.js +58 -14
- package/resources/beta/agents/sessions/artifacts.js.map +1 -1
- package/resources/beta/agents/sessions/artifacts.mjs +58 -14
- package/resources/beta/agents/sessions/artifacts.mjs.map +1 -1
- package/resources/beta/agents/sessions/events.d.mts +4 -1
- package/resources/beta/agents/sessions/events.d.mts.map +1 -1
- package/resources/beta/agents/sessions/events.d.ts +4 -1
- package/resources/beta/agents/sessions/events.d.ts.map +1 -1
- package/resources/beta/agents/sessions/events.js +4 -1
- package/resources/beta/agents/sessions/events.js.map +1 -1
- package/resources/beta/agents/sessions/events.mjs +4 -1
- package/resources/beta/agents/sessions/events.mjs.map +1 -1
- package/resources/beta/agents/sessions/items.d.mts +8 -1
- package/resources/beta/agents/sessions/items.d.mts.map +1 -1
- package/resources/beta/agents/sessions/items.d.ts +8 -1
- package/resources/beta/agents/sessions/items.d.ts.map +1 -1
- package/resources/beta/agents/sessions/items.js +58 -15
- package/resources/beta/agents/sessions/items.js.map +1 -1
- package/resources/beta/agents/sessions/items.mjs +58 -15
- package/resources/beta/agents/sessions/items.mjs.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.mts +25 -8
- package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.ts +25 -8
- package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/agents/sessions/sessions.js +61 -14
- package/resources/beta/agents/sessions/sessions.js.map +1 -1
- package/resources/beta/agents/sessions/sessions.mjs +61 -14
- package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.mts +8 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.mts.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.ts +8 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.ts.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.js +58 -14
- package/resources/beta/agents/sessions/subagents/subagents.js.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.mjs +58 -14
- package/resources/beta/agents/sessions/subagents/subagents.mjs.map +1 -1
- package/resources/beta/agents/sessions/turns.d.mts +11 -3
- package/resources/beta/agents/sessions/turns.d.mts.map +1 -1
- package/resources/beta/agents/sessions/turns.d.ts +11 -3
- package/resources/beta/agents/sessions/turns.d.ts.map +1 -1
- package/resources/beta/agents/sessions/turns.js +58 -15
- package/resources/beta/agents/sessions/turns.js.map +1 -1
- package/resources/beta/agents/sessions/turns.mjs +58 -15
- package/resources/beta/agents/sessions/turns.mjs.map +1 -1
- package/resources/beta/agents/vaults/credentials.d.mts +169 -24
- package/resources/beta/agents/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/agents/vaults/credentials.d.ts +169 -24
- package/resources/beta/agents/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/agents/vaults/credentials.js +58 -15
- package/resources/beta/agents/vaults/credentials.js.map +1 -1
- package/resources/beta/agents/vaults/credentials.mjs +58 -15
- package/resources/beta/agents/vaults/credentials.mjs.map +1 -1
- package/resources/beta/agents/vaults/index.d.mts +1 -1
- package/resources/beta/agents/vaults/index.d.mts.map +1 -1
- package/resources/beta/agents/vaults/index.d.ts +1 -1
- package/resources/beta/agents/vaults/index.d.ts.map +1 -1
- package/resources/beta/agents/vaults/index.js.map +1 -1
- package/resources/beta/agents/vaults/index.mjs.map +1 -1
- package/resources/beta/agents/vaults/vaults.d.mts +17 -6
- package/resources/beta/agents/vaults/vaults.d.mts.map +1 -1
- package/resources/beta/agents/vaults/vaults.d.ts +17 -6
- package/resources/beta/agents/vaults/vaults.d.ts.map +1 -1
- package/resources/beta/agents/vaults/vaults.js +58 -12
- package/resources/beta/agents/vaults/vaults.js.map +1 -1
- package/resources/beta/agents/vaults/vaults.mjs +58 -12
- package/resources/beta/agents/vaults/vaults.mjs.map +1 -1
- package/resources/beta/assistants.d.mts +8 -1
- package/resources/beta/assistants.d.mts.map +1 -1
- package/resources/beta/assistants.d.ts +8 -1
- package/resources/beta/assistants.d.ts.map +1 -1
- package/resources/beta/assistants.js +58 -5
- package/resources/beta/assistants.js.map +1 -1
- package/resources/beta/assistants.mjs +58 -5
- package/resources/beta/assistants.mjs.map +1 -1
- package/resources/beta/chatkit/threads.d.mts +16 -2
- package/resources/beta/chatkit/threads.d.mts.map +1 -1
- package/resources/beta/chatkit/threads.d.ts +16 -2
- package/resources/beta/chatkit/threads.d.ts.map +1 -1
- package/resources/beta/chatkit/threads.js +64 -24
- package/resources/beta/chatkit/threads.js.map +1 -1
- package/resources/beta/chatkit/threads.mjs +64 -24
- package/resources/beta/chatkit/threads.mjs.map +1 -1
- package/resources/beta/responses/responses.d.mts +15 -12
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +15 -12
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/beta/threads/messages.d.mts +8 -1
- package/resources/beta/threads/messages.d.mts.map +1 -1
- package/resources/beta/threads/messages.d.ts +8 -1
- package/resources/beta/threads/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages.js +58 -5
- package/resources/beta/threads/messages.js.map +1 -1
- package/resources/beta/threads/messages.mjs +58 -5
- package/resources/beta/threads/messages.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.mts +8 -1
- package/resources/beta/threads/runs/runs.d.mts.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +8 -1
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js +58 -5
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs +58 -5
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +13 -3
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +13 -3
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/chat/completions/completions.js +58 -12
- package/resources/chat/completions/completions.js.map +1 -1
- package/resources/chat/completions/completions.mjs +58 -12
- package/resources/chat/completions/completions.mjs.map +1 -1
- package/resources/chat/completions/messages.d.mts +8 -1
- package/resources/chat/completions/messages.d.mts.map +1 -1
- package/resources/chat/completions/messages.d.ts +8 -1
- package/resources/chat/completions/messages.d.ts.map +1 -1
- package/resources/chat/completions/messages.js +58 -14
- package/resources/chat/completions/messages.js.map +1 -1
- package/resources/chat/completions/messages.mjs +58 -14
- package/resources/chat/completions/messages.mjs.map +1 -1
- package/resources/containers/containers.d.mts +8 -1
- package/resources/containers/containers.d.mts.map +1 -1
- package/resources/containers/containers.d.ts +8 -1
- package/resources/containers/containers.d.ts.map +1 -1
- package/resources/containers/containers.js +58 -3
- package/resources/containers/containers.js.map +1 -1
- package/resources/containers/containers.mjs +58 -3
- package/resources/containers/containers.mjs.map +1 -1
- package/resources/containers/files/files.d.mts +8 -1
- package/resources/containers/files/files.d.mts.map +1 -1
- package/resources/containers/files/files.d.ts +8 -1
- package/resources/containers/files/files.d.ts.map +1 -1
- package/resources/containers/files/files.js +58 -3
- package/resources/containers/files/files.js.map +1 -1
- package/resources/containers/files/files.mjs +58 -3
- package/resources/containers/files/files.mjs.map +1 -1
- package/resources/conversations/conversations.d.mts +3 -4
- package/resources/conversations/conversations.d.mts.map +1 -1
- package/resources/conversations/conversations.d.ts +3 -4
- package/resources/conversations/conversations.d.ts.map +1 -1
- package/resources/conversations/conversations.js.map +1 -1
- package/resources/conversations/conversations.mjs.map +1 -1
- package/resources/conversations/items.d.mts +8 -1
- package/resources/conversations/items.d.mts.map +1 -1
- package/resources/conversations/items.d.ts +8 -1
- package/resources/conversations/items.d.ts.map +1 -1
- package/resources/conversations/items.js +58 -3
- package/resources/conversations/items.js.map +1 -1
- package/resources/conversations/items.mjs +58 -3
- package/resources/conversations/items.mjs.map +1 -1
- package/resources/evals/evals.d.mts +8 -1
- package/resources/evals/evals.d.mts.map +1 -1
- package/resources/evals/evals.d.ts +8 -1
- package/resources/evals/evals.d.ts.map +1 -1
- package/resources/evals/evals.js +58 -3
- package/resources/evals/evals.js.map +1 -1
- package/resources/evals/evals.mjs +58 -3
- package/resources/evals/evals.mjs.map +1 -1
- package/resources/evals/runs/runs.d.mts +8 -1
- package/resources/evals/runs/runs.d.mts.map +1 -1
- package/resources/evals/runs/runs.d.ts +8 -1
- package/resources/evals/runs/runs.d.ts.map +1 -1
- package/resources/evals/runs/runs.js +58 -3
- package/resources/evals/runs/runs.js.map +1 -1
- package/resources/evals/runs/runs.mjs +58 -3
- package/resources/evals/runs/runs.mjs.map +1 -1
- package/resources/files.d.mts +8 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +8 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +58 -3
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +58 -3
- package/resources/files.mjs.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.d.mts +16 -2
- package/resources/fine-tuning/checkpoints/permissions.d.mts.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.d.ts +16 -2
- package/resources/fine-tuning/checkpoints/permissions.d.ts.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.js +64 -26
- package/resources/fine-tuning/checkpoints/permissions.js.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.mjs +64 -26
- package/resources/fine-tuning/checkpoints/permissions.mjs.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.d.mts +8 -1
- package/resources/fine-tuning/jobs/checkpoints.d.mts.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.d.ts +8 -1
- package/resources/fine-tuning/jobs/checkpoints.d.ts.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.js +58 -13
- package/resources/fine-tuning/jobs/checkpoints.js.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.mjs +58 -13
- package/resources/fine-tuning/jobs/checkpoints.mjs.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.mts +16 -2
- package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.ts +16 -2
- package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
- package/resources/fine-tuning/jobs/jobs.js +64 -24
- package/resources/fine-tuning/jobs/jobs.js.map +1 -1
- package/resources/fine-tuning/jobs/jobs.mjs +64 -24
- package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
- package/resources/images.d.mts +3 -4
- package/resources/images.d.mts.map +1 -1
- package/resources/images.d.ts +3 -4
- package/resources/images.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/realtime/client-secrets.d.mts +7 -3
- package/resources/realtime/client-secrets.d.mts.map +1 -1
- package/resources/realtime/client-secrets.d.ts +7 -3
- package/resources/realtime/client-secrets.d.ts.map +1 -1
- package/resources/realtime/realtime.d.mts +17 -8
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +17 -8
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/responses/input-items.d.mts +8 -1
- package/resources/responses/input-items.d.mts.map +1 -1
- package/resources/responses/input-items.d.ts +8 -1
- package/resources/responses/input-items.d.ts.map +1 -1
- package/resources/responses/input-items.js +58 -13
- package/resources/responses/input-items.js.map +1 -1
- package/resources/responses/input-items.mjs +58 -13
- package/resources/responses/input-items.mjs.map +1 -1
- package/resources/responses/responses.d.mts +26 -12
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +26 -12
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +58 -0
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +58 -0
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/safety/cases.d.mts +26 -0
- package/resources/safety/cases.d.mts.map +1 -0
- package/resources/safety/cases.d.ts +26 -0
- package/resources/safety/cases.d.ts.map +1 -0
- package/resources/safety/cases.js +16 -0
- package/resources/safety/cases.js.map +1 -0
- package/resources/safety/cases.mjs +12 -0
- package/resources/safety/cases.mjs.map +1 -0
- package/resources/safety/index.d.mts +1 -0
- package/resources/safety/index.d.mts.map +1 -1
- package/resources/safety/index.d.ts +1 -0
- package/resources/safety/index.d.ts.map +1 -1
- package/resources/safety/index.js +3 -1
- package/resources/safety/index.js.map +1 -1
- package/resources/safety/index.mjs +1 -0
- package/resources/safety/index.mjs.map +1 -1
- package/resources/safety/safety.d.mts +4 -0
- package/resources/safety/safety.d.mts.map +1 -1
- package/resources/safety/safety.d.ts +4 -0
- package/resources/safety/safety.d.ts.map +1 -1
- package/resources/safety/safety.js +4 -0
- package/resources/safety/safety.js.map +1 -1
- package/resources/safety/safety.mjs +4 -0
- package/resources/safety/safety.mjs.map +1 -1
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/skills/skills.d.mts +8 -1
- package/resources/skills/skills.d.mts.map +1 -1
- package/resources/skills/skills.d.ts +8 -1
- package/resources/skills/skills.d.ts.map +1 -1
- package/resources/skills/skills.js +58 -3
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +58 -3
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/skills/versions/versions.d.mts +8 -1
- package/resources/skills/versions/versions.d.mts.map +1 -1
- package/resources/skills/versions/versions.d.ts +8 -1
- package/resources/skills/versions/versions.d.ts.map +1 -1
- package/resources/skills/versions/versions.js +58 -3
- package/resources/skills/versions/versions.js.map +1 -1
- package/resources/skills/versions/versions.mjs +58 -3
- package/resources/skills/versions/versions.mjs.map +1 -1
- package/resources/vector-stores/files.d.mts +8 -1
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +8 -1
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +58 -3
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +58 -3
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +8 -1
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +8 -1
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +58 -3
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +58 -3
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/videos.d.mts +16 -2
- package/resources/videos.d.mts.map +1 -1
- package/resources/videos.d.ts +16 -2
- package/resources/videos.d.ts.map +1 -1
- package/resources/videos.js +64 -12
- package/resources/videos.js.map +1 -1
- package/resources/videos.mjs +64 -12
- package/resources/videos.mjs.map +1 -1
- package/resources/webhooks/event-types.d.mts +17 -0
- package/resources/webhooks/event-types.d.mts.map +1 -0
- package/resources/webhooks/event-types.d.ts +17 -0
- package/resources/webhooks/event-types.d.ts.map +1 -0
- package/resources/webhooks/event-types.js +21 -0
- package/resources/webhooks/event-types.js.map +1 -0
- package/resources/webhooks/event-types.mjs +17 -0
- package/resources/webhooks/event-types.mjs.map +1 -0
- package/resources/webhooks/index.d.mts +1 -0
- package/resources/webhooks/index.d.mts.map +1 -1
- package/resources/webhooks/index.d.ts +1 -0
- package/resources/webhooks/index.d.ts.map +1 -1
- package/resources/webhooks/index.js +3 -0
- package/resources/webhooks/index.js.map +1 -1
- package/resources/webhooks/index.mjs +1 -0
- package/resources/webhooks/index.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts +368 -2
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +368 -2
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js +168 -0
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs +168 -0
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/src/client.ts +16 -10
- package/src/internal/parse.ts +14 -10
- package/src/internal/utils/log.ts +1 -0
- package/src/resources/admin/organization/admin-api-keys.ts +206 -2
- package/src/resources/admin/organization/audit-logs.ts +270 -1
- package/src/resources/admin/organization/certificates.ts +295 -2
- package/src/resources/admin/organization/external-storage.ts +420 -0
- package/src/resources/admin/organization/groups/groups.ts +200 -1
- package/src/resources/admin/organization/groups/roles.ts +202 -1
- package/src/resources/admin/organization/groups/users.ts +202 -1
- package/src/resources/admin/organization/index.ts +10 -0
- package/src/resources/admin/organization/invites.ts +200 -1
- package/src/resources/admin/organization/organization.ts +24 -0
- package/src/resources/admin/organization/projects/api-keys.ts +202 -1
- package/src/resources/admin/organization/projects/certificates.ts +202 -1
- package/src/resources/admin/organization/projects/groups/groups.ts +202 -1
- package/src/resources/admin/organization/projects/projects.ts +200 -1
- package/src/resources/admin/organization/projects/rate-limits.ts +202 -1
- package/src/resources/admin/organization/projects/roles.ts +202 -1
- package/src/resources/admin/organization/projects/service-accounts/service-accounts.ts +202 -1
- package/src/resources/admin/organization/projects/spend-alerts.ts +202 -1
- package/src/resources/admin/organization/projects/users/users.ts +202 -1
- package/src/resources/admin/organization/roles.ts +200 -1
- package/src/resources/admin/organization/spend-alerts.ts +200 -1
- package/src/resources/admin/organization/users/roles.ts +202 -1
- package/src/resources/admin/organization/users/users.ts +200 -1
- package/src/resources/batches.ts +200 -1
- package/src/resources/beta/agents/agents.ts +260 -46
- package/src/resources/beta/agents/environments/files.ts +6 -1
- package/src/resources/beta/agents/environments/templates.ts +216 -13
- package/src/resources/beta/agents/sessions/artifacts.ts +213 -2
- package/src/resources/beta/agents/sessions/events.ts +4 -1
- package/src/resources/beta/agents/sessions/items.ts +202 -1
- package/src/resources/beta/agents/sessions/sessions.ts +218 -8
- package/src/resources/beta/agents/sessions/subagents/subagents.ts +202 -1
- package/src/resources/beta/agents/sessions/turns.ts +205 -3
- package/src/resources/beta/agents/vaults/credentials.ts +389 -23
- package/src/resources/beta/agents/vaults/index.ts +2 -0
- package/src/resources/beta/agents/vaults/vaults.ts +212 -4
- package/src/resources/beta/assistants.ts +200 -1
- package/src/resources/beta/chatkit/threads.ts +311 -2
- package/src/resources/beta/responses/responses.ts +15 -12
- package/src/resources/beta/threads/messages.ts +202 -1
- package/src/resources/beta/threads/runs/runs.ts +202 -1
- package/src/resources/chat/completions/completions.ts +205 -3
- package/src/resources/chat/completions/messages.ts +202 -1
- package/src/resources/containers/containers.ts +200 -1
- package/src/resources/containers/files/files.ts +202 -1
- package/src/resources/conversations/conversations.ts +3 -4
- package/src/resources/conversations/items.ts +202 -1
- package/src/resources/evals/evals.ts +200 -1
- package/src/resources/evals/runs/runs.ts +202 -1
- package/src/resources/files.ts +200 -1
- package/src/resources/fine-tuning/checkpoints/permissions.ts +297 -2
- package/src/resources/fine-tuning/jobs/checkpoints.ts +202 -1
- package/src/resources/fine-tuning/jobs/jobs.ts +295 -2
- package/src/resources/images.ts +3 -4
- package/src/resources/index.ts +1 -1
- package/src/resources/realtime/client-secrets.ts +7 -3
- package/src/resources/realtime/realtime.ts +17 -8
- package/src/resources/responses/input-items.ts +202 -1
- package/src/resources/responses/responses.ts +263 -13
- package/src/resources/safety/cases.ts +39 -0
- package/src/resources/safety/index.ts +1 -0
- package/src/resources/safety/safety.ts +6 -0
- package/src/resources/shared.ts +2 -2
- package/src/resources/skills/skills.ts +200 -1
- package/src/resources/skills/versions/versions.ts +202 -1
- package/src/resources/vector-stores/files.ts +202 -1
- package/src/resources/vector-stores/vector-stores.ts +200 -1
- package/src/resources/videos.ts +295 -2
- package/src/resources/webhooks/api.md +42 -21
- package/src/resources/webhooks/event-types.ts +21 -0
- package/src/resources/webhooks/index.ts +1 -0
- package/src/resources/webhooks/webhooks.ts +752 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/resources/webhooks/webhooks.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;;;AAErF,qDAAkD;AAClD,uDAAmE;AACnE,sEAAsG;AAEtG,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;;
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/resources/webhooks/webhooks.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;;;AAErF,qDAAkD;AAClD,uDAAmE;AACnE,sEAAsG;AAEtG,wEAA+C;AAC/C,kDAA2C;AAE3C,yDAAuF;AAEvF,uDAAiD;AAEjD,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAAC;IAClD,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,QAAQ;IACR,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,uBAAuB;CACxB,CAAC,CAAC;AAEH,SAAS,+BA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,EAAoB,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAC3E,MAAM,SAAS,GAAG,+BAAA,IAAI,wDAAmB,MAAvB,IAAI,EAAoB,UAAU,EAAE,YAAY,CAAC,CAAC;QAEpE,IAAI,IAAA,mDAA+B,EAAC,eAAe,CAAC,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACjG,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QAED,OAAO,MAAM,IAAA,0CAAsB,EAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACzG,CAAC;CAuBF;AAjTD,4BAiTC;kGArBiB,MAAiC;IAC/C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,mKAAmK,CACpK,CAAC;IACJ,CAAC;AACH,CAAC,qEAEkB,OAAgB,EAAE,IAAY;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEhC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AA2wCH,QAAQ,CAAC,UAAU,GAAG,wBAAU,CAAC"}
|
|
@@ -4,10 +4,177 @@ import { __classPrivateFieldGet } from "../../internal/tslib.mjs";
|
|
|
4
4
|
import { APIResource } from "../../core/resource.mjs";
|
|
5
5
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
6
6
|
import { verifyWebhookSignature, webhookSignatureRequiresSigning } from "../../lib/webhook-signature.mjs";
|
|
7
|
+
import * as EventTypesAPI from "./event-types.mjs";
|
|
8
|
+
import { EventTypes } from "./event-types.mjs";
|
|
9
|
+
import { CursorPage } from "../../core/pagination.mjs";
|
|
10
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
11
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
12
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
13
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
14
|
+
'method',
|
|
15
|
+
'path',
|
|
16
|
+
'query',
|
|
17
|
+
'body',
|
|
18
|
+
'headers',
|
|
19
|
+
'maxRetries',
|
|
20
|
+
'stream',
|
|
21
|
+
'timeout',
|
|
22
|
+
'httpAgent',
|
|
23
|
+
'fetchOptions',
|
|
24
|
+
'signal',
|
|
25
|
+
'idempotencyKey',
|
|
26
|
+
'defaultBaseURL',
|
|
27
|
+
'__metadata',
|
|
28
|
+
'__binaryRequest',
|
|
29
|
+
'__binaryResponse',
|
|
30
|
+
'__streamClass',
|
|
31
|
+
'__security',
|
|
32
|
+
'__synthesizeEventData',
|
|
33
|
+
]);
|
|
34
|
+
function normalizeRequestOptionsForQuery(value, queryKeys, options) {
|
|
35
|
+
if (typeof value !== 'object' || value === null)
|
|
36
|
+
return undefined;
|
|
37
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
38
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
39
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined));
|
|
40
|
+
const keys = entries.map(([key]) => key);
|
|
41
|
+
const requestOnly = keys.some((key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key));
|
|
42
|
+
if (!requestOnly)
|
|
43
|
+
return undefined;
|
|
44
|
+
// Declared query fields, including stream, must use the query argument.
|
|
45
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
46
|
+
if (options !== undefined ||
|
|
47
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))) {
|
|
48
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
49
|
+
}
|
|
50
|
+
// The query position must not gain authority to change the request destination
|
|
51
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
52
|
+
if (keys.some((key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key))) {
|
|
53
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
54
|
+
}
|
|
55
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
56
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
57
|
+
return Object.fromEntries(entries.map(([key, descriptor]) => {
|
|
58
|
+
if ('value' in descriptor)
|
|
59
|
+
return [key, descriptor.value];
|
|
60
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
7
63
|
export class Webhooks extends APIResource {
|
|
8
64
|
constructor() {
|
|
9
65
|
super(...arguments);
|
|
10
66
|
_Webhooks_instances.add(this);
|
|
67
|
+
this.eventTypes = new EventTypesAPI.EventTypes(this._client);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a webhook endpoint for the authenticated project.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const webhookEndpointWithSecret =
|
|
75
|
+
* await client.webhooks.create({
|
|
76
|
+
* event_types: ['batch.completed'],
|
|
77
|
+
* name: 'x',
|
|
78
|
+
* url: 'https://',
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
create(body, options) {
|
|
83
|
+
return this._client.post('/webhook_endpoints', { body, ...options, __security: { bearerAuth: true } });
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves a webhook endpoint for the authenticated project.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const webhookEndpoint = await client.webhooks.retrieve(
|
|
91
|
+
* 'whe_123',
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
retrieve(webhookEndpointID, options) {
|
|
96
|
+
return this._client.get(path `/webhook_endpoints/${webhookEndpointID}`, {
|
|
97
|
+
...options,
|
|
98
|
+
__security: { bearerAuth: true },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Updates a webhook endpoint for the authenticated project.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const webhookEndpoint = await client.webhooks.update('whe_123');
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
update(webhookEndpointID, body = {}, options) {
|
|
110
|
+
return this._client.post(path `/webhook_endpoints/${webhookEndpointID}`, {
|
|
111
|
+
body,
|
|
112
|
+
...options,
|
|
113
|
+
__security: { bearerAuth: true },
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
list(query = {}, options) {
|
|
117
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(query, ['after', 'limit'], options);
|
|
118
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
119
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
120
|
+
query = {};
|
|
121
|
+
}
|
|
122
|
+
query = query;
|
|
123
|
+
return this._client.getAPIList('/webhook_endpoints', (CursorPage), {
|
|
124
|
+
query,
|
|
125
|
+
...options,
|
|
126
|
+
__security: { bearerAuth: true },
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Deletes a webhook endpoint for the authenticated project.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* const deletedWebhookEndpoint = await client.webhooks.delete(
|
|
135
|
+
* 'whe_123',
|
|
136
|
+
* );
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
delete(webhookEndpointID, options) {
|
|
140
|
+
return this._client.delete(path `/webhook_endpoints/${webhookEndpointID}`, {
|
|
141
|
+
...options,
|
|
142
|
+
__security: { bearerAuth: true },
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Rotates the signing secret for a webhook endpoint in the authenticated project.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const webhookEndpointWithSecret =
|
|
151
|
+
* await client.webhooks.rotateSecret('whe_123');
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
rotateSecret(webhookEndpointID, body = {}, options) {
|
|
155
|
+
return this._client.post(path `/webhook_endpoints/${webhookEndpointID}/rotate_secret`, {
|
|
156
|
+
body,
|
|
157
|
+
...options,
|
|
158
|
+
__security: { bearerAuth: true },
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Sends a sample event to a webhook endpoint for the authenticated project.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* const webhookEndpointTestResult =
|
|
167
|
+
* await client.webhooks.test('whe_123', {
|
|
168
|
+
* event_type: 'batch.completed',
|
|
169
|
+
* });
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
test(webhookEndpointID, body, options) {
|
|
173
|
+
return this._client.post(path `/webhook_endpoints/${webhookEndpointID}/test`, {
|
|
174
|
+
body,
|
|
175
|
+
...options,
|
|
176
|
+
__security: { bearerAuth: true },
|
|
177
|
+
});
|
|
11
178
|
}
|
|
12
179
|
/**
|
|
13
180
|
* Validates that the given payload was sent by OpenAI and parses the payload.
|
|
@@ -57,4 +224,5 @@ _Webhooks_instances = new WeakSet(), _Webhooks_validateSecret = function _Webhoo
|
|
|
57
224
|
}
|
|
58
225
|
return value;
|
|
59
226
|
};
|
|
227
|
+
Webhooks.EventTypes = EventTypes;
|
|
60
228
|
//# sourceMappingURL=webhooks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../../src/resources/webhooks/webhooks.ts"],"names":[],"mappings":"AAAA,qFAAqF;;;AAErF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,YAAY,EAAe,mCAA+B;AACnE,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,wCAAoC;AAEtG,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;;
|
|
1
|
+
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../../src/resources/webhooks/webhooks.ts"],"names":[],"mappings":"AAAA,qFAAqF;;;AAErF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,YAAY,EAAe,mCAA+B;AACnE,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,wCAAoC;AAEtG,OAAO,KAAK,aAAa,0BAAsB;AAC/C,OAAO,EAAE,UAAU,EAAE,0BAAsB;AAE3C,OAAO,EAAE,UAAU,EAAsC,kCAA8B;AAEvF,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAAC;IAClD,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,QAAQ;IACR,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,uBAAuB;CACxB,CAAC,CAAC;AAEH,SAAS,+BAA+B,CACtC,KAAc,EACd,SAAgC,EAChC,OAAmC;IAuBnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CA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CAAC,eAAe,CAAC,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACjG,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QAED,OAAO,MAAM,sBAAsB,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACzG,CAAC;CAuBF;kGArBiB,MAAiC;IAC/C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,mKAAmK,CACpK,CAAC;IACJ,CAAC;AACH,CAAC,qEAEkB,OAAgB,EAAE,IAAY;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEhC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AA2wCH,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -1278,16 +1278,22 @@ export class OpenAI {
|
|
|
1278
1278
|
const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;
|
|
1279
1279
|
const startTime = x509Authentication?.requestStartedAt(options) ?? Date.now();
|
|
1280
1280
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1281
|
+
if (this.logLevel === 'debug') {
|
|
1282
|
+
// Summarize serialized strings without reparsing or re-running caller serialization hooks.
|
|
1283
|
+
const body = typeof req.body === 'string' ? { type: 'string', length: req.body.length } : req.body;
|
|
1284
|
+
loggerFor(this).debug(
|
|
1285
|
+
`[${requestLogID}] sending request`,
|
|
1286
|
+
formatRequestDetails({
|
|
1287
|
+
retryOfRequestLogID,
|
|
1288
|
+
method: options.method,
|
|
1289
|
+
url,
|
|
1290
|
+
options: x509Authentication
|
|
1291
|
+
? { body, ...x509Authentication.requestSnapshot() }
|
|
1292
|
+
: { ...options, body },
|
|
1293
|
+
headers: req.headers,
|
|
1294
|
+
}),
|
|
1295
|
+
);
|
|
1296
|
+
}
|
|
1291
1297
|
|
|
1292
1298
|
const callerSignal = x509Authentication ? x509Authentication.requestSnapshot().signal : options.signal;
|
|
1293
1299
|
if (callerSignal?.aborted || req.signal?.aborted) {
|
package/src/internal/parse.ts
CHANGED
|
@@ -20,6 +20,7 @@ export async function defaultParseResponse<T>(
|
|
|
20
20
|
props: APIResponseProps,
|
|
21
21
|
): Promise<WithRequestID<T>> {
|
|
22
22
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
23
|
+
let jsonBodyLength: number | undefined;
|
|
23
24
|
const body = await (async () => {
|
|
24
25
|
if (props.options.stream) {
|
|
25
26
|
loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);
|
|
@@ -73,6 +74,7 @@ export async function defaultParseResponse<T>(
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
const json = JSON.parse(bodyText);
|
|
77
|
+
jsonBodyLength = bodyText.length;
|
|
76
78
|
return addRequestID(json as T, response);
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -81,16 +83,18 @@ export async function defaultParseResponse<T>(
|
|
|
81
83
|
})().catch((error: unknown) => {
|
|
82
84
|
throw asAbortError(error, props.controller.signal);
|
|
83
85
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
if (client.logLevel === 'debug') {
|
|
87
|
+
loggerFor(client).debug(
|
|
88
|
+
`[${requestLogID}] response parsed`,
|
|
89
|
+
formatRequestDetails({
|
|
90
|
+
retryOfRequestLogID,
|
|
91
|
+
url: response.url,
|
|
92
|
+
status: response.status,
|
|
93
|
+
body: jsonBodyLength === undefined ? body : { type: 'json', length: jsonBodyLength },
|
|
94
|
+
durationMs: Date.now() - startTime,
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
94
98
|
return body;
|
|
95
99
|
}
|
|
96
100
|
|
|
@@ -6,6 +6,113 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pa
|
|
|
6
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
7
7
|
import { path } from '../../../internal/utils/path';
|
|
8
8
|
|
|
9
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
10
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
11
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
12
|
+
'method',
|
|
13
|
+
'path',
|
|
14
|
+
'query',
|
|
15
|
+
'body',
|
|
16
|
+
'headers',
|
|
17
|
+
'maxRetries',
|
|
18
|
+
'stream',
|
|
19
|
+
'timeout',
|
|
20
|
+
'httpAgent',
|
|
21
|
+
'fetchOptions',
|
|
22
|
+
'signal',
|
|
23
|
+
'idempotencyKey',
|
|
24
|
+
'defaultBaseURL',
|
|
25
|
+
'__metadata',
|
|
26
|
+
'__binaryRequest',
|
|
27
|
+
'__binaryResponse',
|
|
28
|
+
'__streamClass',
|
|
29
|
+
'__security',
|
|
30
|
+
'__synthesizeEventData',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
function normalizeRequestOptionsForQuery(
|
|
34
|
+
value: unknown,
|
|
35
|
+
queryKeys: ReadonlyArray<string>,
|
|
36
|
+
options: RequestOptions | undefined,
|
|
37
|
+
):
|
|
38
|
+
| ({
|
|
39
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
40
|
+
} & {
|
|
41
|
+
[
|
|
42
|
+
K in
|
|
43
|
+
| 'method'
|
|
44
|
+
| 'path'
|
|
45
|
+
| 'body'
|
|
46
|
+
| 'stream'
|
|
47
|
+
| 'httpAgent'
|
|
48
|
+
| 'fetchOptions'
|
|
49
|
+
| 'defaultBaseURL'
|
|
50
|
+
| '__metadata'
|
|
51
|
+
| '__binaryRequest'
|
|
52
|
+
| '__binaryResponse'
|
|
53
|
+
| '__streamClass'
|
|
54
|
+
| '__security'
|
|
55
|
+
| '__synthesizeEventData'
|
|
56
|
+
]?: never;
|
|
57
|
+
})
|
|
58
|
+
| undefined {
|
|
59
|
+
if (typeof value !== 'object' || value === null) return undefined;
|
|
60
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
61
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
62
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(
|
|
63
|
+
([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined),
|
|
64
|
+
);
|
|
65
|
+
const keys = entries.map(([key]) => key);
|
|
66
|
+
const requestOnly = keys.some(
|
|
67
|
+
(key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key),
|
|
68
|
+
);
|
|
69
|
+
if (!requestOnly) return undefined;
|
|
70
|
+
// Declared query fields, including stream, must use the query argument.
|
|
71
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
72
|
+
if (
|
|
73
|
+
options !== undefined ||
|
|
74
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))
|
|
75
|
+
) {
|
|
76
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
77
|
+
}
|
|
78
|
+
// The query position must not gain authority to change the request destination
|
|
79
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
80
|
+
if (
|
|
81
|
+
keys.some(
|
|
82
|
+
(key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key),
|
|
83
|
+
)
|
|
84
|
+
) {
|
|
85
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
86
|
+
}
|
|
87
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
88
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
89
|
+
return Object.fromEntries(
|
|
90
|
+
entries.map(([key, descriptor]) => {
|
|
91
|
+
if ('value' in descriptor) return [key, descriptor.value];
|
|
92
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
93
|
+
}),
|
|
94
|
+
) as {
|
|
95
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
96
|
+
} & {
|
|
97
|
+
[
|
|
98
|
+
K in
|
|
99
|
+
| 'method'
|
|
100
|
+
| 'path'
|
|
101
|
+
| 'body'
|
|
102
|
+
| 'stream'
|
|
103
|
+
| 'httpAgent'
|
|
104
|
+
| 'fetchOptions'
|
|
105
|
+
| 'defaultBaseURL'
|
|
106
|
+
| '__metadata'
|
|
107
|
+
| '__binaryRequest'
|
|
108
|
+
| '__binaryResponse'
|
|
109
|
+
| '__streamClass'
|
|
110
|
+
| '__security'
|
|
111
|
+
| '__synthesizeEventData'
|
|
112
|
+
]?: never;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
9
116
|
export class AdminAPIKeys extends APIResource {
|
|
10
117
|
/**
|
|
11
118
|
* Create an organization admin API key
|
|
@@ -56,9 +163,101 @@ export class AdminAPIKeys extends APIResource {
|
|
|
56
163
|
* ```
|
|
57
164
|
*/
|
|
58
165
|
list(
|
|
59
|
-
query
|
|
166
|
+
query?:
|
|
167
|
+
| (AdminAPIKeyListParams &
|
|
168
|
+
(
|
|
169
|
+
| {
|
|
170
|
+
[
|
|
171
|
+
K in
|
|
172
|
+
| 'method'
|
|
173
|
+
| 'path'
|
|
174
|
+
| 'query'
|
|
175
|
+
| 'body'
|
|
176
|
+
| 'headers'
|
|
177
|
+
| 'maxRetries'
|
|
178
|
+
| 'stream'
|
|
179
|
+
| 'timeout'
|
|
180
|
+
| 'httpAgent'
|
|
181
|
+
| 'fetchOptions'
|
|
182
|
+
| 'signal'
|
|
183
|
+
| 'idempotencyKey'
|
|
184
|
+
| 'defaultBaseURL'
|
|
185
|
+
| '__metadata'
|
|
186
|
+
| '__binaryRequest'
|
|
187
|
+
| '__binaryResponse'
|
|
188
|
+
| '__streamClass'
|
|
189
|
+
| '__security'
|
|
190
|
+
| '__synthesizeEventData'
|
|
191
|
+
]?: never;
|
|
192
|
+
}
|
|
193
|
+
| null
|
|
194
|
+
| undefined
|
|
195
|
+
))
|
|
196
|
+
| null
|
|
197
|
+
| undefined,
|
|
198
|
+
options?: RequestOptions,
|
|
199
|
+
): PagePromise<AdminAPIKeysPage, AdminAPIKey>;
|
|
200
|
+
list(
|
|
201
|
+
options?: {
|
|
202
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
203
|
+
} & {
|
|
204
|
+
[
|
|
205
|
+
K in
|
|
206
|
+
| 'method'
|
|
207
|
+
| 'path'
|
|
208
|
+
| 'body'
|
|
209
|
+
| 'stream'
|
|
210
|
+
| 'httpAgent'
|
|
211
|
+
| 'fetchOptions'
|
|
212
|
+
| 'defaultBaseURL'
|
|
213
|
+
| '__metadata'
|
|
214
|
+
| '__binaryRequest'
|
|
215
|
+
| '__binaryResponse'
|
|
216
|
+
| '__streamClass'
|
|
217
|
+
| '__security'
|
|
218
|
+
| '__synthesizeEventData'
|
|
219
|
+
]?: never;
|
|
220
|
+
},
|
|
221
|
+
): PagePromise<AdminAPIKeysPage, AdminAPIKey>;
|
|
222
|
+
list(
|
|
223
|
+
query:
|
|
224
|
+
| AdminAPIKeyListParams
|
|
225
|
+
| ({
|
|
226
|
+
[
|
|
227
|
+
K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query'
|
|
228
|
+
]?: RequestOptions[K];
|
|
229
|
+
} & {
|
|
230
|
+
[
|
|
231
|
+
K in
|
|
232
|
+
| 'method'
|
|
233
|
+
| 'path'
|
|
234
|
+
| 'body'
|
|
235
|
+
| 'stream'
|
|
236
|
+
| 'httpAgent'
|
|
237
|
+
| 'fetchOptions'
|
|
238
|
+
| 'defaultBaseURL'
|
|
239
|
+
| '__metadata'
|
|
240
|
+
| '__binaryRequest'
|
|
241
|
+
| '__binaryResponse'
|
|
242
|
+
| '__streamClass'
|
|
243
|
+
| '__security'
|
|
244
|
+
| '__synthesizeEventData'
|
|
245
|
+
]?: never;
|
|
246
|
+
})
|
|
247
|
+
| null
|
|
248
|
+
| undefined = {},
|
|
60
249
|
options?: RequestOptions,
|
|
61
250
|
): PagePromise<AdminAPIKeysPage, AdminAPIKey> {
|
|
251
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(
|
|
252
|
+
query,
|
|
253
|
+
['after', 'limit', 'order'],
|
|
254
|
+
options,
|
|
255
|
+
);
|
|
256
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
257
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
258
|
+
query = {};
|
|
259
|
+
}
|
|
260
|
+
query = query as AdminAPIKeyListParams | null | undefined;
|
|
62
261
|
return this._client.getAPIList('/organization/admin_api_keys', CursorPage<AdminAPIKey>, {
|
|
63
262
|
query,
|
|
64
263
|
...options,
|
|
@@ -191,7 +390,12 @@ export interface AdminAPIKeyCreateParams {
|
|
|
191
390
|
expires_in_seconds?: number;
|
|
192
391
|
}
|
|
193
392
|
|
|
194
|
-
export interface AdminAPIKeyListParams extends CursorPageParams {
|
|
393
|
+
export interface AdminAPIKeyListParams extends Omit<CursorPageParams, 'after'> {
|
|
394
|
+
/**
|
|
395
|
+
* Return keys with IDs that come after this ID in the pagination order.
|
|
396
|
+
*/
|
|
397
|
+
after?: string | null;
|
|
398
|
+
|
|
195
399
|
/**
|
|
196
400
|
* Order results by creation time, ascending or descending.
|
|
197
401
|
*/
|