// This file is auto-generated by @hey-api/openapi-ts import type { Client, Options as Options2, TDataShape } from "./client"; import { client } from "./client.gen"; import type { AcceptWorkspaceInviteData, AcceptWorkspaceInviteErrors, AcceptWorkspaceInviteResponses, CreateAnalyticsEventData, CreateAnalyticsEventErrors, CreateAnalyticsEventResponses, CreateAnalyticsPageViewData, CreateAnalyticsPageViewErrors, CreateAnalyticsPageViewResponses, CreateLegacyEntityRowData, CreateLegacyEntityRowErrors, CreateLegacyEntityRowResponses, CreateLegacyRowRelationshipData, CreateLegacyRowRelationshipErrors, CreateLegacyRowRelationshipResponses, CreateSupportTicketFromInboundEmailData, CreateSupportTicketFromInboundEmailErrors, CreateSupportTicketFromInboundEmailResponses, CreateWorkspaceInviteData, CreateWorkspaceInviteErrors, CreateWorkspaceInviteResponses, DeleteLegacyEntityRowData, DeleteLegacyEntityRowErrors, DeleteLegacyEntityRowResponses, DeleteLegacyRowRelationshipData, DeleteLegacyRowRelationshipErrors, DeleteLegacyRowRelationshipResponses, EnqueueExportArtifactRetentionData, EnqueueExportArtifactRetentionErrors, EnqueueExportArtifactRetentionResponses, GetAccountData, GetAccountErrors, GetAccountResponses, GetAdminAnalyticsOverviewData, GetAdminAnalyticsOverviewErrors, GetAdminAnalyticsOverviewResponses, GetApiDocsData, GetApiDocsResponses, GetApiUsageData, GetApiUsageErrors, GetApiUsageResponses, GetCurrentUserSessionData, GetCurrentUserSessionErrors, GetCurrentUserSessionResponses, GetExportDownloadUrlData, GetExportDownloadUrlErrors, GetExportDownloadUrlResponses, GetExportJobProgressData, GetExportJobProgressErrors, GetExportJobProgressResponses, GetHealthzData, GetHealthzResponses, GetLegacyEntityByNameData, GetLegacyEntityByNameErrors, GetLegacyEntityByNameResponses, GetLegacyEntityRowData, GetLegacyEntityRowErrors, GetLegacyEntityRowResponses, GetLegacyRowRelationshipData, GetLegacyRowRelationshipErrors, GetLegacyRowRelationshipResponses, GetMetricsData, GetMetricsErrors, GetMetricsResponses, GetOpenApiDocumentData, GetOpenApiDocumentResponses, GetPublicAnalyticsOverviewData, GetPublicAnalyticsOverviewErrors, GetPublicAnalyticsOverviewResponses, GetReadyzData, GetReadyzErrors, GetReadyzResponses, GetStatusData, GetStatusErrors, GetStatusResponses, GetV1HealthData, GetV1HealthResponses, ListAccountsData, ListAccountsErrors, ListAccountsResponses, ListLegacyEntityRowsData, ListLegacyEntityRowsErrors, ListLegacyEntityRowsResponses, ListWorkspaceAuthProvidersData, ListWorkspaceAuthProvidersErrors, ListWorkspaceAuthProvidersResponses, ListWorkspaceInvitesData, ListWorkspaceInvitesErrors, ListWorkspaceInvitesResponses, LoginWithPasswordData, LoginWithPasswordErrors, LoginWithPasswordResponses, LogoutApiSessionData, LogoutApiSessionErrors, LogoutApiSessionResponses, PostDeviceRegisterData, PostDeviceRegisterErrors, PostDeviceRegisterResponses, PostDeviceRevokeData, PostDeviceRevokeErrors, PostDeviceRevokeResponses, ReceiveEmailSequenceMailjetWebhookData, ReceiveEmailSequenceMailjetWebhookErrors, ReceiveEmailSequenceMailjetWebhookResponses, ReceiveStripeBillingWebhookData, ReceiveStripeBillingWebhookErrors, ReceiveStripeBillingWebhookResponses, RefreshJwtTokenData, RefreshJwtTokenErrors, RefreshJwtTokenResponses, RetryEventWebhookAttemptData, RetryEventWebhookAttemptErrors, RetryEventWebhookAttemptResponses, RevalidateWorkspaceContextData, RevalidateWorkspaceContextErrors, RevalidateWorkspaceContextResponses, RevokeWorkspaceInviteData, RevokeWorkspaceInviteErrors, RevokeWorkspaceInviteResponses, StreamNotificationsData, StreamNotificationsErrors, StreamNotificationsResponse, StreamNotificationsResponses, UpdateLegacyEntityRowData, UpdateLegacyEntityRowErrors, UpdateLegacyEntityRowResponses, UploadAiFileData, UploadAiFileErrors, UploadAiFileResponses, ValidateApiKeyData, ValidateApiKeyErrors, ValidateApiKeyResponses, } from "./types.gen"; export type Options = Options2< TData, ThrowOnError, TResponse > & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client; /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record; }; export const getHealthz = (options?: Options) => (options?.client ?? client).get({ url: "/healthz", ...options }); export const getV1Health = (options?: Options) => (options?.client ?? client).get({ url: "/v1/health", ...options }); export const getReadyz = (options?: Options) => (options?.client ?? client).get({ url: "/readyz", ...options }); export const getStatus = (options?: Options) => (options?.client ?? client).get({ url: "/status", ...options }); export const getMetrics = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/metrics", ...options, }); export const getCurrentUserSession = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/session/current-user", ...options, }); export const getApiDocs = (options?: Options) => (options?.client ?? client).get({ url: "/v1/docs", ...options }); export const getOpenApiDocument = (options?: Options) => (options?.client ?? client).get({ url: "/v1/openapi.json", ...options }); export const loginWithPassword = (options: Options) => (options.client ?? client).post({ url: "/v1/auth/login", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const refreshJwtToken = (options?: Options) => (options?.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/auth/refresh-token", ...options, }); export const logoutApiSession = (options?: Options) => (options?.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/auth/logout", ...options, }); export const validateApiKey = (options?: Options) => (options?.client ?? client).post({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/api-keys/validate", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); export const uploadAiFile = (options?: Options) => (options?.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/ai/upload", ...options, }); /** * Accepts Mailjet inbound (parse) email webhooks authenticated with HTTP Basic Auth and creates an idempotent support ticket for the matched tenant inbound address. */ export const createSupportTicketFromInboundEmail = ( options: Options ) => (options.client ?? client).post({ security: [{ scheme: "basic", type: "http" }], url: "/v1/support/inbound-email", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const createAnalyticsEvent = (options: Options) => (options.client ?? client).post({ security: [{ name: "x-analytics-token", type: "apiKey" }], url: "/v1/analytics/events", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const createAnalyticsPageView = (options: Options) => (options.client ?? client).post({ security: [{ name: "x-analytics-token", type: "apiKey" }], url: "/v1/analytics/page-views", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const getPublicAnalyticsOverview = (options?: Options) => (options?.client ?? client).get({ security: [{ name: "x-analytics-token", type: "apiKey" }], url: "/v1/analytics/public", ...options, }); /** * Revalidates a workspace context switch for a tenant/user pair using service-token credentials. The response is a request-ID-correlated, redacted context validity envelope and never includes SSO provider secrets or invite/token material. */ export const revalidateWorkspaceContext = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/workspaces/{tenantId}/context/revalidate", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Lists redacted tenant-scoped OIDC/SAML provider metadata for service-token callers. Responses expose provider status and non-secret endpoints only; client secrets, SAML certificates/private keys, token hashes, invite tokens, and raw metadata documents are omitted. */ export const listWorkspaceAuthProviders = (options: Options) => (options.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/workspaces/{tenantId}/auth/providers", ...options, }); /** * Lists tenant-scoped workspace invites for service-token callers. Response envelopes expose lifecycle timestamps, status, and tokenPrefix only while omitting reusable invite token material. */ export const listWorkspaceInvites = (options: Options) => (options.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/workspaces/{tenantId}/invites", ...options, }); /** * Creates a tenant workspace invite. The response includes the one-time invite token only in the top-level token field; invite envelopes expose only tokenPrefix and never reusable token examples. */ export const createWorkspaceInvite = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/workspaces/{tenantId}/invites", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Accepts a workspace invite with a one-time token in the request body. Success and error responses are redacted and never echo the token. */ export const acceptWorkspaceInvite = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/workspaces/{tenantId}/invites/{inviteId}/accept", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Revokes a pending workspace invite by tenant and invite id. Request and error paths do not expose token material. */ export const revokeWorkspaceInvite = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/workspaces/{tenantId}/invites/{inviteId}/revoke", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const getAdminAnalyticsOverview = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/analytics/admin", ...options, }); /** * Streams bounded, tenant/user scoped notification delivery diagnostics as sanitized SSE frames for authenticated service clients. The initial snapshot and reconnect cursor are deterministic for Last-Event-ID resume semantics; the stream does not expose provider payloads, provider message ids, metadata, tokens, request bodies, or raw secrets. */ export const streamNotifications = ( options?: Options ) => (options?.client ?? client).sse.get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/notifications/stream", ...options, }); /** * Lists tenant account metadata and subscription summaries for service-token callers from the canonical API runtime. */ export const listAccounts = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/accounts", ...options, }); /** * Looks up one tenant account by id or slug for service-token callers from the canonical API runtime. */ export const getAccount = (options: Options) => (options.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/accounts/{id}", ...options, }); /** * Canonical API-host entry point for API usage metadata. The API runtime validates the tenant API key and reads usage state through DB package boundaries. */ export const getApiUsage = (options?: Options) => (options?.client ?? client).get({ security: [{ name: "x-api-key", type: "apiKey" }], url: "/v1/usage", ...options, }); /** * Canonical API-host entry point for Stripe billing lifecycle webhooks. The API runtime preserves the raw body and signature headers and applies subscription updates through API-owned billing services. */ export const receiveStripeBillingWebhook = (options: Options) => (options.client ?? client).post({ security: [{ name: "stripe-signature", type: "apiKey" }], url: "/v1/billing/stripe/webhooks", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Accepts Mailjet provider event webhooks for email sequences, authenticated with HTTP Basic Auth. Bounce, blocked, and spam events correlate by provider message id (Message_GUID), mark the sequence delivery bounced, and fail the in-flight run without echoing provider payloads. */ export const receiveEmailSequenceMailjetWebhook = ( options: Options ) => (options.client ?? client).post({ security: [{ scheme: "basic", type: "http" }], url: "/v1/email-sequences/mailjet/webhooks", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const retryEventWebhookAttempt = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "basic", type: "http" }], url: "/v1/events/webhooks/attempts/{id}", ...options, }); /** * Queues the expired export artifact retention cleanup job for operators. Optional Idempotency-Key deduplicates operator retries; x-request-id remains correlation-only. The response does not expose Redis or storage credentials. */ export const enqueueExportArtifactRetention = (options?: Options) => (options?.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/maintenance/export-retention/enqueue", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const listLegacyEntityRows = (options: Options) => (options.client ?? client).get({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/entities/{entity}/rows", ...options, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const createLegacyEntityRow = (options: Options) => (options.client ?? client).post({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/entities/{entity}/rows", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const deleteLegacyEntityRow = (options: Options) => (options.client ?? client).delete({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/entities/{entity}/rows/{rowId}", ...options, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const getLegacyEntityRow = (options: Options) => (options.client ?? client).get({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/entities/{entity}/rows/{rowId}", ...options, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const updateLegacyEntityRow = (options: Options) => (options.client ?? client).patch({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/entities/{entity}/rows/{rowId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const createLegacyRowRelationship = (options: Options) => (options.client ?? client).post({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/relationships", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const deleteLegacyRowRelationship = (options: Options) => (options.client ?? client).delete({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/relationships/{id}", ...options, }); /** * Authorize with either the configured service token bearer credential or a stored API key supplied in x-api-key. Stored API keys are tenant-bound and must include an entity permission for the resolved tenant/entity plus the documented CRUD operation. */ export const getLegacyRowRelationship = (options: Options) => (options.client ?? client).get({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/relationships/{id}", ...options, }); /** * Creates a short-lived signed GET URL for a completed, unexpired export job. Authorize with either the configured service token bearer credential or a tenant-bound stored API key supplied in x-api-key; stored API keys are scoped to their own tenant and this route does not publish CRUD entity-scope claims. Responses never include export artifact bucket/key values, storage credentials, signed URL internals beyond the URL envelope, payload filters, or object bodies. */ export const getExportDownloadUrl = (options: Options) => (options.client ?? client).get({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/exports/{exportJobId}/download-url", ...options, }); /** * Poll a tenant-scoped export job's progress envelope. Authorize with either the configured service-token bearer credential or a tenant-bound stored API key supplied in x-api-key; stored API keys are scoped to their own tenant. Responses contain progress fields only (status, percent, rowCount) — no artifact URLs, no compliance-pause internals, no payload filters. */ export const getExportJobProgress = (options: Options) => (options.client ?? client).get({ security: [ { scheme: "bearer", type: "http" }, { name: "x-api-key", type: "apiKey" }, ], url: "/v1/exports/{exportJobId}/progress", ...options, }); /** * Register or update a mobile push token (APNs / FCM / WebPush) for the authenticated principal. Requires a service-token bearer credential; the body's userId + tenantId are reconciled downstream against the authenticated principal. Tokens are upserted by their globally unique value so cold-start replays are idempotent. */ export const postDeviceRegister = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/devices/register", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); /** * Revoke a mobile push token. Requires a service-token bearer credential; the handler revokes by token hash and never echoes the raw token in the response. */ export const postDeviceRevoke = (options: Options) => (options.client ?? client).post({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/devices/revoke", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); export const getLegacyEntityByName = (options: Options) => (options.client ?? client).get({ security: [{ scheme: "bearer", type: "http" }], url: "/v1/entities/{entity}", ...options, });