@kortix/sdk 0.13.47 → 0.13.48
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/README.md +49 -31
- package/dist/browser/session-sync/visibility.d.ts +0 -12
- package/dist/browser/session-sync/visibility.d.ts.map +1 -1
- package/dist/browser/session-sync/visibility.js +23 -2
- package/dist/browser/session-sync/visibility.js.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.d.ts +8 -0
- package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.js +14 -0
- package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +79 -60
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/agents/composer-agents.d.ts +7 -5
- package/dist/core/agents/composer-agents.d.ts.map +1 -1
- package/dist/core/agents/composer-agents.js +3 -3
- package/dist/core/agents/composer-agents.js.map +1 -1
- package/dist/core/client/binding-types.d.ts +2 -0
- package/dist/core/client/binding-types.d.ts.map +1 -0
- package/dist/core/client/binding-types.js +2 -0
- package/dist/core/client/binding-types.js.map +1 -0
- package/dist/core/client/facade-accounts.d.ts +57 -0
- package/dist/core/client/facade-accounts.d.ts.map +1 -0
- package/dist/core/client/facade-accounts.js +59 -0
- package/dist/core/client/facade-accounts.js.map +1 -0
- package/dist/core/client/facade-catalog.d.ts +58 -0
- package/dist/core/client/facade-catalog.d.ts.map +1 -0
- package/dist/core/client/facade-catalog.js +70 -0
- package/dist/core/client/facade-catalog.js.map +1 -0
- package/dist/core/client/facade-commerce.d.ts +45 -0
- package/dist/core/client/facade-commerce.d.ts.map +1 -0
- package/dist/core/client/facade-commerce.js +53 -0
- package/dist/core/client/facade-commerce.js.map +1 -0
- package/dist/core/client/facade-iam.d.ts +54 -0
- package/dist/core/client/facade-iam.d.ts.map +1 -0
- package/dist/core/client/facade-iam.js +62 -0
- package/dist/core/client/facade-iam.js.map +1 -0
- package/dist/core/client/facade-identity.d.ts +104 -0
- package/dist/core/client/facade-identity.d.ts.map +1 -0
- package/dist/core/client/facade-identity.js +36 -0
- package/dist/core/client/facade-identity.js.map +1 -0
- package/dist/core/client/facade-preview.d.ts +4 -0
- package/dist/core/client/facade-preview.d.ts.map +1 -0
- package/dist/core/client/facade-preview.js +61 -0
- package/dist/core/client/facade-preview.js.map +1 -0
- package/dist/core/client/kortix.d.ts +657 -1038
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +29 -1205
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/client/project-access-resources.d.ts +38 -0
- package/dist/core/client/project-access-resources.d.ts.map +1 -0
- package/dist/core/client/project-access-resources.js +37 -0
- package/dist/core/client/project-access-resources.js.map +1 -0
- package/dist/core/client/project-access-security.d.ts +117 -0
- package/dist/core/client/project-access-security.d.ts.map +1 -0
- package/dist/core/client/project-access-security.js +41 -0
- package/dist/core/client/project-access-security.js.map +1 -0
- package/dist/core/client/project-connections.d.ts +34 -0
- package/dist/core/client/project-connections.d.ts.map +1 -0
- package/dist/core/client/project-connections.js +20 -0
- package/dist/core/client/project-connections.js.map +1 -0
- package/dist/core/client/project-connectors.d.ts +21 -0
- package/dist/core/client/project-connectors.d.ts.map +1 -0
- package/dist/core/client/project-connectors.js +20 -0
- package/dist/core/client/project-connectors.js.map +1 -0
- package/dist/core/client/project-core.d.ts +72 -0
- package/dist/core/client/project-core.d.ts.map +1 -0
- package/dist/core/client/project-core.js +24 -0
- package/dist/core/client/project-core.js.map +1 -0
- package/dist/core/client/project-membership.d.ts +64 -0
- package/dist/core/client/project-membership.d.ts.map +1 -0
- package/dist/core/client/project-membership.js +26 -0
- package/dist/core/client/project-membership.js.map +1 -0
- package/dist/core/client/project-operations-admin.d.ts +112 -0
- package/dist/core/client/project-operations-admin.d.ts.map +1 -0
- package/dist/core/client/project-operations-admin.js +24 -0
- package/dist/core/client/project-operations-admin.js.map +1 -0
- package/dist/core/client/project-operations-review.d.ts +44 -0
- package/dist/core/client/project-operations-review.d.ts.map +1 -0
- package/dist/core/client/project-operations-review.js +34 -0
- package/dist/core/client/project-operations-review.js.map +1 -0
- package/dist/core/client/project-operations-workspace.d.ts +91 -0
- package/dist/core/client/project-operations-workspace.d.ts.map +1 -0
- package/dist/core/client/project-operations-workspace.js +36 -0
- package/dist/core/client/project-operations-workspace.js.map +1 -0
- package/dist/core/client/project-operations.d.ts +225 -0
- package/dist/core/client/project-operations.d.ts.map +1 -0
- package/dist/core/client/project-operations.js +47 -0
- package/dist/core/client/project-operations.js.map +1 -0
- package/dist/core/client/project-platform-resources.d.ts +36 -0
- package/dist/core/client/project-platform-resources.d.ts.map +1 -0
- package/dist/core/client/project-platform-resources.js +29 -0
- package/dist/core/client/project-platform-resources.js.map +1 -0
- package/dist/core/client/project-platform-security.d.ts +83 -0
- package/dist/core/client/project-platform-security.d.ts.map +1 -0
- package/dist/core/client/project-platform-security.js +39 -0
- package/dist/core/client/project-platform-security.js.map +1 -0
- package/dist/core/client/project-platform-settings.d.ts +58 -0
- package/dist/core/client/project-platform-settings.d.ts.map +1 -0
- package/dist/core/client/project-platform-settings.js +28 -0
- package/dist/core/client/project-platform-settings.js.map +1 -0
- package/dist/core/client/session-actions-resources.d.ts +18 -0
- package/dist/core/client/session-actions-resources.d.ts.map +1 -0
- package/dist/core/client/session-actions-resources.js +31 -0
- package/dist/core/client/session-actions-resources.js.map +1 -0
- package/dist/core/client/session-actions-security.d.ts +31 -0
- package/dist/core/client/session-actions-security.d.ts.map +1 -0
- package/dist/core/client/session-actions-security.js +51 -0
- package/dist/core/client/session-actions-security.js.map +1 -0
- package/dist/core/client/session-actions-services.d.ts +64 -0
- package/dist/core/client/session-actions-services.d.ts.map +1 -0
- package/dist/core/client/session-actions-services.js +59 -0
- package/dist/core/client/session-actions-services.js.map +1 -0
- package/dist/core/client/session-context.d.ts +22 -0
- package/dist/core/client/session-context.d.ts.map +1 -0
- package/dist/core/client/session-context.js +2 -0
- package/dist/core/client/session-context.js.map +1 -0
- package/dist/core/client/session-defaults.d.ts +9 -0
- package/dist/core/client/session-defaults.d.ts.map +1 -0
- package/dist/core/client/session-defaults.js +45 -0
- package/dist/core/client/session-defaults.js.map +1 -0
- package/dist/core/client/session-files.d.ts +26 -0
- package/dist/core/client/session-files.d.ts.map +1 -0
- package/dist/core/client/session-files.js +24 -0
- package/dist/core/client/session-files.js.map +1 -0
- package/dist/core/client/session-handle.d.ts +186 -0
- package/dist/core/client/session-handle.d.ts.map +1 -0
- package/dist/core/client/session-handle.js +68 -0
- package/dist/core/client/session-handle.js.map +1 -0
- package/dist/core/client/session-lifecycle-resources.d.ts +67 -0
- package/dist/core/client/session-lifecycle-resources.d.ts.map +1 -0
- package/dist/core/client/session-lifecycle-resources.js +56 -0
- package/dist/core/client/session-lifecycle-resources.js.map +1 -0
- package/dist/core/client/session-lifecycle-security.d.ts +65 -0
- package/dist/core/client/session-lifecycle-security.d.ts.map +1 -0
- package/dist/core/client/session-lifecycle-security.js +54 -0
- package/dist/core/client/session-lifecycle-security.js.map +1 -0
- package/dist/core/client/session-preview.d.ts +26 -0
- package/dist/core/client/session-preview.d.ts.map +1 -0
- package/dist/core/client/session-preview.js +31 -0
- package/dist/core/client/session-preview.js.map +1 -0
- package/dist/core/client/session-readiness.d.ts +11 -0
- package/dist/core/client/session-readiness.d.ts.map +1 -0
- package/dist/core/client/session-readiness.js +77 -0
- package/dist/core/client/session-readiness.js.map +1 -0
- package/dist/core/client/session-runtime.d.ts +35 -0
- package/dist/core/client/session-runtime.d.ts.map +1 -0
- package/dist/core/client/session-runtime.js +30 -0
- package/dist/core/client/session-runtime.js.map +1 -0
- package/dist/core/client/session-shared.d.ts +46 -0
- package/dist/core/client/session-shared.d.ts.map +1 -0
- package/dist/core/client/session-shared.js +48 -0
- package/dist/core/client/session-shared.js.map +1 -0
- package/dist/core/client/session-start.d.ts +3 -0
- package/dist/core/client/session-start.d.ts.map +1 -0
- package/dist/core/client/session-start.js +60 -0
- package/dist/core/client/session-start.js.map +1 -0
- package/dist/core/files/client.d.ts.map +1 -1
- package/dist/core/files/client.js +29 -3
- package/dist/core/files/client.js.map +1 -1
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +2 -419
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/http/config.d.ts +15 -0
- package/dist/core/http/config.d.ts.map +1 -1
- package/dist/core/http/config.js.map +1 -1
- package/dist/core/http/request.d.ts +3 -0
- package/dist/core/http/request.d.ts.map +1 -0
- package/dist/core/http/request.js +215 -0
- package/dist/core/http/request.js.map +1 -0
- package/dist/core/http/response-error.d.ts +3 -0
- package/dist/core/http/response-error.d.ts.map +1 -0
- package/dist/core/http/response-error.js +113 -0
- package/dist/core/http/response-error.js.map +1 -0
- package/dist/core/http/runtime-errors.d.ts +23 -0
- package/dist/core/http/runtime-errors.d.ts.map +1 -1
- package/dist/core/http/runtime-errors.js +39 -1
- package/dist/core/http/runtime-errors.js.map +1 -1
- package/dist/core/http/transport.d.ts +13 -1
- package/dist/core/http/transport.d.ts.map +1 -1
- package/dist/core/http/transport.js +25 -4
- package/dist/core/http/transport.js.map +1 -1
- package/dist/core/rest/projects-client/admin-providers.d.ts +64 -3
- package/dist/core/rest/projects-client/admin-providers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/admin-providers.js.map +1 -1
- package/dist/core/rest/projects-client/apps.d.ts +30 -0
- package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
- package/dist/core/rest/projects-client/apps.js +10 -0
- package/dist/core/rest/projects-client/apps.js.map +1 -1
- package/dist/core/rest/projects-client/audit.d.ts +4 -0
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +19 -0
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +3 -1
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +0 -1
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +44 -0
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js +52 -0
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +6 -0
- package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +45 -23
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +33 -4
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/runtime/client.d.ts +1 -1
- package/dist/core/runtime/client.d.ts.map +1 -1
- package/dist/core/runtime/client.js +29 -3
- package/dist/core/runtime/client.js.map +1 -1
- package/dist/core/runtime/runtime-rest-client.d.ts +26 -0
- package/dist/core/runtime/runtime-rest-client.d.ts.map +1 -1
- package/dist/core/runtime/runtime-rest-client.js +67 -49
- package/dist/core/runtime/runtime-rest-client.js.map +1 -1
- package/dist/core/session/host-signals.d.ts +16 -0
- package/dist/core/session/host-signals.d.ts.map +1 -0
- package/dist/core/session/host-signals.js +20 -0
- package/dist/core/session/host-signals.js.map +1 -0
- package/dist/core/session/index.d.ts +1 -0
- package/dist/core/session/index.d.ts.map +1 -1
- package/dist/core/session/index.js +1 -0
- package/dist/core/session/index.js.map +1 -1
- package/dist/core/session/open-bundle.d.ts +16 -0
- package/dist/core/session/open-bundle.d.ts.map +1 -1
- package/dist/core/session/open-bundle.js +31 -0
- package/dist/core/session/open-bundle.js.map +1 -1
- package/dist/core/session/wake-escalation.d.ts +1 -1
- package/dist/core/session/wake-escalation.js +1 -1
- package/dist/core/session/working-evidence.d.ts +15 -0
- package/dist/core/session/working-evidence.d.ts.map +1 -0
- package/dist/core/session/working-evidence.js +27 -0
- package/dist/core/session/working-evidence.js.map +1 -0
- package/dist/core/session/working-project.d.ts +3 -0
- package/dist/core/session/working-project.d.ts.map +1 -0
- package/dist/core/session/working-project.js +187 -0
- package/dist/core/session/working-project.js.map +1 -0
- package/dist/core/session/working-runtime.d.ts +33 -0
- package/dist/core/session/working-runtime.d.ts.map +1 -0
- package/dist/core/session/working-runtime.js +46 -0
- package/dist/core/session/working-runtime.js.map +1 -0
- package/dist/core/session/working-time.d.ts +2 -0
- package/dist/core/session/working-time.d.ts.map +1 -0
- package/dist/core/session/working-time.js +7 -0
- package/dist/core/session/working-time.js.map +1 -0
- package/dist/core/session/working.d.ts.map +1 -1
- package/dist/core/session/working.js +2 -316
- package/dist/core/session/working.js.map +1 -1
- package/dist/core/stream/event-stream.d.ts +15 -1
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +59 -9
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/parts.d.ts +4 -0
- package/dist/core/turns/parts.d.ts.map +1 -1
- package/dist/core/turns/parts.js +4 -0
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/segments/turn-busy-visibility.d.ts +1 -1
- package/dist/core/turns/segments/turn-busy-visibility.js +1 -1
- package/dist/core/turns/segments/working-turn.js +1 -1
- package/dist/core/turns/segments/working-turn.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +44 -44
- package/dist/kortix.global.js +44 -44
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/prefetch-session-open.d.ts +13 -0
- package/dist/react/prefetch-session-open.d.ts.map +1 -1
- package/dist/react/prefetch-session-open.js +22 -1
- package/dist/react/prefetch-session-open.js.map +1 -1
- package/dist/react/query-keys.d.ts +3 -2
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +4 -4
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/use-admin-providers.d.ts +18 -0
- package/dist/react/use-admin-providers.d.ts.map +1 -0
- package/dist/react/use-admin-providers.js +36 -0
- package/dist/react/use-admin-providers.js.map +1 -0
- package/dist/react/use-opencode-events/index.d.ts +1 -0
- package/dist/react/use-opencode-events/index.d.ts.map +1 -1
- package/dist/react/use-opencode-events/index.js +15 -0
- package/dist/react/use-opencode-events/index.js.map +1 -1
- package/dist/react/use-opencode-events/runtime-stream-signals.d.ts +45 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.d.ts.map +1 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.js +32 -0
- package/dist/react/use-opencode-events/runtime-stream-signals.js.map +1 -0
- package/dist/react/use-opencode-events/stream-revival.d.ts +0 -21
- package/dist/react/use-opencode-events/stream-revival.d.ts.map +1 -1
- package/dist/react/use-opencode-events/stream-revival.js +33 -2
- package/dist/react/use-opencode-events/stream-revival.js.map +1 -1
- package/dist/react/use-opencode-sessions/files.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/files.js +8 -33
- package/dist/react/use-opencode-sessions/files.js.map +1 -1
- package/dist/react/use-opencode-sessions/keys.d.ts +11 -0
- package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/keys.js +10 -0
- package/dist/react/use-opencode-sessions/keys.js.map +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.js +12 -2
- package/dist/react/use-opencode-sessions/providers.js.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts +5 -0
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.js +9 -2
- package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
- package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/shared.js +6 -1
- package/dist/react/use-opencode-sessions/shared.js.map +1 -1
- package/dist/react/use-project-apps.d.ts +6 -0
- package/dist/react/use-project-apps.d.ts.map +1 -1
- package/dist/react/use-project-sessions.d.ts +1 -1
- package/dist/react/use-project-sessions.d.ts.map +1 -1
- package/dist/react/use-project-sessions.js +2 -3
- package/dist/react/use-project-sessions.js.map +1 -1
- package/dist/react/use-session-messages.d.ts +4 -2
- package/dist/react/use-session-messages.d.ts.map +1 -1
- package/dist/react/use-session-messages.js +1 -1
- package/dist/react/use-session-messages.js.map +1 -1
- package/dist/react/use-session-participants.d.ts +10 -0
- package/dist/react/use-session-participants.d.ts.map +1 -0
- package/dist/react/use-session-participants.js +19 -0
- package/dist/react/use-session-participants.js.map +1 -0
- package/dist/react/use-session-prompts.d.ts +6 -0
- package/dist/react/use-session-prompts.d.ts.map +1 -1
- package/dist/react/use-session-prompts.js +17 -1
- package/dist/react/use-session-prompts.js.map +1 -1
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +4 -1
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-transcript-history.d.ts.map +1 -1
- package/dist/react/use-session-transcript-history.js +14 -5
- package/dist/react/use-session-transcript-history.js.map +1 -1
- package/dist/react/use-session.d.ts +3 -1
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +8 -6
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-tunnel.d.ts +9 -0
- package/dist/react/use-tunnel.d.ts.map +1 -1
- package/dist/react/use-tunnel.js +9 -3
- package/dist/react/use-tunnel.js.map +1 -1
- package/dist/workspace-search/core.d.ts +2 -2
- package/dist/workspace-search/core.d.ts.map +1 -1
- package/dist/workspace-search/core.js +35 -2
- package/dist/workspace-search/core.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { syntheticUnauthenticatedResponse } from '../../platform/auth-core.js';
|
|
2
|
-
import { ApiError, AuthError
|
|
2
|
+
import { ApiError, AuthError } from './api/errors.js';
|
|
3
3
|
import { platformConfig } from './config.js';
|
|
4
|
-
import {
|
|
4
|
+
import { makeRequest } from './request.js';
|
|
5
5
|
import { send } from './transport.js';
|
|
6
6
|
export { isAdminBypassEnabled, setAdminBypass } from './transport.js';
|
|
7
7
|
const getApiUrl = () => platformConfig().backendUrl || '';
|
|
@@ -85,423 +85,6 @@ export const ANALYTICS_UNAVAILABLE_CODE = 'analytics_unavailable';
|
|
|
85
85
|
* apps/api/src/admin/index.ts. Mirrors `ANALYTICS_UNAVAILABLE_CODE`.
|
|
86
86
|
*/
|
|
87
87
|
export const ACCOUNTS_LIST_UNAVAILABLE_CODE = 'accounts_list_unavailable';
|
|
88
|
-
const REQUEST_DEADLINE_CODE = 'request_deadline';
|
|
89
|
-
const LEGACY_REQUEST_DEADLINE_MESSAGE = /^Request exceeded the \d+s server processing deadline$/;
|
|
90
|
-
const isRequestDeadlineResponse = (status, errorData, message) => {
|
|
91
|
-
if (status !== 503)
|
|
92
|
-
return false;
|
|
93
|
-
const code = typeof errorData === 'object' && errorData !== null && 'code' in errorData
|
|
94
|
-
? errorData.code
|
|
95
|
-
: undefined;
|
|
96
|
-
return code === REQUEST_DEADLINE_CODE || LEGACY_REQUEST_DEADLINE_MESSAGE.test(message);
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Stable error code the platform API returns (HTTP 503) when a project's git
|
|
100
|
-
* mirror cold-clone/fetch fails for a TRANSIENT, retryable upstream reason
|
|
101
|
-
* (GitHub edge blip, a momentarily unusable private-mirror credential, a
|
|
102
|
-
* mid-transfer timeout). The API already classifies the cause out of its OWN
|
|
103
|
-
* Sentry (`apps/api/src/projects/git/mirror.ts`'s `isTransientGitMirrorError`)
|
|
104
|
-
* and answers a clean 503 + `Retry-After`; this is the frontend mirror.
|
|
105
|
-
*
|
|
106
|
-
* The 503 RESPONSE crosses the boundary: `makeRequest` extracts the message
|
|
107
|
-
* and calls `onError` → the web host's `handleApiError`, which captures every
|
|
108
|
-
* 5xx to the FRONTEND Sentry (app 2346967 — a SEPARATE app from the API's
|
|
109
|
-
* 2346961). That is exactly how Better Stack frontend pattern `b4d05df2…`
|
|
110
|
-
* (`ApiError: git mirror is temporarily unavailable`, on a session start that
|
|
111
|
-
* cold-clones the project mirror) reached the frontend telemetry. Treat it as
|
|
112
|
-
* SILENT here — skip the global `onError` (Sentry) capture — but still return
|
|
113
|
-
* the `ApiError` so callers can branch on `.code`. A genuine 503 with another
|
|
114
|
-
* message/code still reports.
|
|
115
|
-
*
|
|
116
|
-
* Must stay in sync with `GIT_MIRROR_UNAVAILABLE_CODE` in
|
|
117
|
-
* `apps/api/src/projects/git/mirror.ts`. `LEGACY_GIT_MIRROR_UNAVAILABLE_MESSAGE`
|
|
118
|
-
* covers a response from an API deployed before the typed code (the same
|
|
119
|
-
* rollout shim as `LEGACY_REQUEST_DEADLINE_MESSAGE`).
|
|
120
|
-
*/
|
|
121
|
-
const GIT_MIRROR_UNAVAILABLE_CODE = 'git_mirror_unavailable';
|
|
122
|
-
const LEGACY_GIT_MIRROR_UNAVAILABLE_MESSAGE = /^git mirror is temporarily unavailable$/;
|
|
123
|
-
const isGitMirrorUnavailableResponse = (status, errorData, message) => {
|
|
124
|
-
if (status !== 503)
|
|
125
|
-
return false;
|
|
126
|
-
const code = typeof errorData === 'object' && errorData !== null && 'code' in errorData
|
|
127
|
-
? errorData.code
|
|
128
|
-
: undefined;
|
|
129
|
-
return code === GIT_MIRROR_UNAVAILABLE_CODE || LEGACY_GIT_MIRROR_UNAVAILABLE_MESSAGE.test(message);
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* HTTP statuses that represent a transient gateway / overload condition rather
|
|
133
|
-
* than a deterministic server-side failure: 502 (Bad Gateway), 503 (Service
|
|
134
|
-
* Unavailable), 504 (Gateway Timeout). These are produced by the load balancer
|
|
135
|
-
* / reverse proxy / the API's request-deadline net under momentary saturation,
|
|
136
|
-
* typically resolve within a few hundred ms, and are safe to retry on
|
|
137
|
-
* idempotent reads. A real 500 is NOT here — it's a deterministic bug and must
|
|
138
|
-
* surface on the first response.
|
|
139
|
-
*/
|
|
140
|
-
const TRANSIENT_GATEWAY_STATUSES = new Set([502, 503, 504]);
|
|
141
|
-
const isTransientGatewayStatus = (status) => TRANSIENT_GATEWAY_STATUSES.has(status);
|
|
142
|
-
/** Idempotent HTTP methods that are safe to transparently retry. GET/HEAD only
|
|
143
|
-
* — POST/PUT/PATCH/DELETE mutate state and must not be replayed by the client. */
|
|
144
|
-
const isIdempotentMethod = (method) => {
|
|
145
|
-
const m = (method ?? 'GET').toUpperCase();
|
|
146
|
-
return m === 'GET' || m === 'HEAD';
|
|
147
|
-
};
|
|
148
|
-
/** A DELETE that fails at the TRANSPORT layer (fetch throws, no HTTP response)
|
|
149
|
-
* never reached the server as a completed request, so replaying it is safe —
|
|
150
|
-
* the server never confirmed it applied the delete. Kortix DELETEs are
|
|
151
|
-
* idempotent by design (a soft-tombstone stamp, then 404 for an already-absent
|
|
152
|
-
* row), so a replay re-tombstones (a no-op) or 404s. This is retried ONLY on a
|
|
153
|
-
* transport failure, NEVER on a received response status, where the server may
|
|
154
|
-
* already have applied the delete. Regression: incident-20260922T210537Z (a
|
|
155
|
-
* `sessions rm` DELETE stalled once, got zero retries, and blew past the
|
|
156
|
-
* heartbeat runner's 120s wall; a fresh retry deleted the session in ~1.1s). */
|
|
157
|
-
const isRetryableOnTransportFailure = (method) => isIdempotentMethod(method) || (method ?? 'GET').toUpperCase() === 'DELETE';
|
|
158
|
-
const TRANSIENT_READ_RETRIES = 2;
|
|
159
|
-
const isAbortError = (error) => error?.name === 'AbortError' ||
|
|
160
|
-
error?.name === 'AbortSignal' ||
|
|
161
|
-
(error instanceof Error && error.message.includes('aborted'));
|
|
162
|
-
async function makeRequest(url, options = {}) {
|
|
163
|
-
const { showErrors = true, errorContext, timeout = 30000, deadlineCoversBody = false, ...fetchOptions } = options;
|
|
164
|
-
const controller = new AbortController();
|
|
165
|
-
let activeController = controller;
|
|
166
|
-
const abortFromCaller = () => activeController.abort();
|
|
167
|
-
fetchOptions.signal?.addEventListener('abort', abortFromCaller, { once: true });
|
|
168
|
-
let timeoutId = null;
|
|
169
|
-
let isAborted = false;
|
|
170
|
-
// Tracks whether *our* timer fired the abort, vs. an external abort
|
|
171
|
-
// (client navigation, tab close, dropped connection). Only the former is a
|
|
172
|
-
// real timeout; the latter must not be surfaced as one.
|
|
173
|
-
let didTimeout = false;
|
|
174
|
-
try {
|
|
175
|
-
if (fetchOptions.signal?.aborted)
|
|
176
|
-
throw createAbortError();
|
|
177
|
-
timeoutId = setTimeout(() => {
|
|
178
|
-
if (!isAborted && !controller.signal.aborted) {
|
|
179
|
-
isAborted = true;
|
|
180
|
-
didTimeout = true;
|
|
181
|
-
controller.abort();
|
|
182
|
-
}
|
|
183
|
-
}, timeout);
|
|
184
|
-
// Don't set Content-Type for FormData - browser will set it automatically
|
|
185
|
-
// with boundary. `send` resolves the token on every attempt and adds the
|
|
186
|
-
// bearer, client surface, admin bypass and act-as headers after these.
|
|
187
|
-
const headers = {
|
|
188
|
-
...(fetchOptions.body instanceof FormData ? {} : { 'Content-Type': 'application/json' }),
|
|
189
|
-
...fetchOptions.headers,
|
|
190
|
-
};
|
|
191
|
-
const retryableRead = isIdempotentMethod(fetchOptions.method);
|
|
192
|
-
// A DELETE is retried on a TRANSPORT failure only (see the predicate). It is
|
|
193
|
-
// NOT retried on a received response status, so `retryableRead` still gates
|
|
194
|
-
// the transient-gateway (502/503/504) response path below.
|
|
195
|
-
const retryableTransport = isRetryableOnTransportFailure(fetchOptions.method);
|
|
196
|
-
const maxAttempts = retryableTransport ? TRANSIENT_READ_RETRIES + 1 : 1;
|
|
197
|
-
let response;
|
|
198
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
199
|
-
if (attempt > 0) {
|
|
200
|
-
await abortableDelay(250 * 2 ** (attempt - 1), fetchOptions.signal ?? undefined);
|
|
201
|
-
}
|
|
202
|
-
const attemptController = attempt === 0 ? controller : new AbortController();
|
|
203
|
-
activeController = attemptController;
|
|
204
|
-
if (fetchOptions.signal?.aborted)
|
|
205
|
-
attemptController.abort();
|
|
206
|
-
if (attempt > 0) {
|
|
207
|
-
timeoutId = setTimeout(() => {
|
|
208
|
-
didTimeout = true;
|
|
209
|
-
attemptController.abort();
|
|
210
|
-
}, timeout);
|
|
211
|
-
}
|
|
212
|
-
try {
|
|
213
|
-
// The attempt deadline above is the only deadline (`timeoutMs: null`).
|
|
214
|
-
response = await abortable(send(url, {
|
|
215
|
-
...fetchOptions,
|
|
216
|
-
headers,
|
|
217
|
-
signal: attemptController.signal,
|
|
218
|
-
credentials: fetchOptions.credentials ?? 'omit',
|
|
219
|
-
}, { timeoutMs: null }), attemptController.signal);
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
if (timeoutId) {
|
|
223
|
-
clearTimeout(timeoutId);
|
|
224
|
-
timeoutId = null;
|
|
225
|
-
}
|
|
226
|
-
// No token: the host has no session yet (Supabase has not hydrated
|
|
227
|
-
// from cookies). `send` sent nothing. A silent failure, never retried:
|
|
228
|
-
// callers gated by `enabled: !!user` should not reach this path.
|
|
229
|
-
if (error instanceof AuthError) {
|
|
230
|
-
return { error: new AuthError(), success: false };
|
|
231
|
-
}
|
|
232
|
-
// A self-timeout (OUR deadline fired, the caller did not abort) means
|
|
233
|
-
// this attempt got no response, so replaying it is safe for a
|
|
234
|
-
// retryable-transport method — the exact recovery the manual retry of a
|
|
235
|
-
// stalled `sessions rm` performed. Reset the flag so the next attempt
|
|
236
|
-
// classifies its own outcome, and re-arm a fresh attempt controller
|
|
237
|
-
// (the current one is aborted). An EXTERNAL abort stays terminal.
|
|
238
|
-
const selfTimedOut = didTimeout && isAbortError(error) && !fetchOptions.signal?.aborted;
|
|
239
|
-
if (selfTimedOut && retryableTransport && attempt < maxAttempts - 1) {
|
|
240
|
-
didTimeout = false;
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
if (isAbortError(error) || attempt === maxAttempts - 1) {
|
|
244
|
-
throw error;
|
|
245
|
-
}
|
|
246
|
-
continue;
|
|
247
|
-
}
|
|
248
|
-
const retryableResponse = retryableRead && isTransientGatewayStatus(response.status) && attempt < maxAttempts - 1;
|
|
249
|
-
if (!retryableResponse) {
|
|
250
|
-
// By default the deadline covers the wait for headers only, so a large
|
|
251
|
-
// body is never cut off. `deadlineCoversBody` keeps it running through
|
|
252
|
-
// final response parsing; the outer finally clears it.
|
|
253
|
-
if (!deadlineCoversBody && timeoutId) {
|
|
254
|
-
clearTimeout(timeoutId);
|
|
255
|
-
timeoutId = null;
|
|
256
|
-
}
|
|
257
|
-
break;
|
|
258
|
-
}
|
|
259
|
-
try {
|
|
260
|
-
await abortable(response.arrayBuffer(), attemptController.signal);
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
if (isAbortError(error))
|
|
264
|
-
throw error;
|
|
265
|
-
}
|
|
266
|
-
finally {
|
|
267
|
-
// A retry gets a fresh attempt deadline after its backoff. The body
|
|
268
|
-
// being discarded remains bounded by the current attempt until now.
|
|
269
|
-
if (timeoutId) {
|
|
270
|
-
clearTimeout(timeoutId);
|
|
271
|
-
timeoutId = null;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if (!response.ok) {
|
|
276
|
-
let errorMessage = `HTTP ${response.status}: ${response.statusText}`;
|
|
277
|
-
let errorData = null;
|
|
278
|
-
try {
|
|
279
|
-
errorData = await abortable(response.json(), activeController.signal);
|
|
280
|
-
// ORDER MATTERS, and `reason` is LAST on purpose.
|
|
281
|
-
//
|
|
282
|
-
// A Kortix error body pairs a machine slug with the sentence written for
|
|
283
|
-
// the user, e.g. the 409 from `POST /sessions/:id/restart`:
|
|
284
|
-
// { error: "The original sandbox is unavailable. …",
|
|
285
|
-
// code: "SESSION_RUNTIME_IDENTITY_UNAVAILABLE",
|
|
286
|
-
// reason: "runtime_identity_unavailable" }
|
|
287
|
-
// `reason` used to be read first, so that customer saw the bare slug
|
|
288
|
-
// `runtime_identity_unavailable` as the card detail AND the toast.
|
|
289
|
-
// Not one `reason` value in the API is a sentence — they are all
|
|
290
|
-
// snake_case slugs — so preferring it could only ever downgrade the
|
|
291
|
-
// message. Branch on `code` (kept below); render the human field.
|
|
292
|
-
if (typeof errorData.message === 'string') {
|
|
293
|
-
errorMessage = errorData.message;
|
|
294
|
-
}
|
|
295
|
-
else if (errorData.error && typeof errorData.error === 'string') {
|
|
296
|
-
errorMessage = errorData.error;
|
|
297
|
-
}
|
|
298
|
-
else if (typeof errorData.detail === 'string') {
|
|
299
|
-
// FastAPI returns {"detail": "error message"}
|
|
300
|
-
errorMessage = errorData.detail;
|
|
301
|
-
}
|
|
302
|
-
else if (typeof errorData.detail?.message === 'string') {
|
|
303
|
-
errorMessage = errorData.detail.message;
|
|
304
|
-
}
|
|
305
|
-
else if (typeof errorData.reason === 'string') {
|
|
306
|
-
// Last resort: a body with no prose at all still says something more
|
|
307
|
-
// useful than `HTTP 409: Conflict`.
|
|
308
|
-
errorMessage = errorData.reason;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
catch { }
|
|
312
|
-
if (activeController.signal.aborted)
|
|
313
|
-
throw createAbortError();
|
|
314
|
-
const isRequestDeadline = isRequestDeadlineResponse(response.status, errorData, errorMessage);
|
|
315
|
-
// Expected, retryable transient git-mirror 503 — classified silent like
|
|
316
|
-
// the request deadline above (see `isGitMirrorUnavailableResponse`).
|
|
317
|
-
const isGitMirrorUnavailable = isGitMirrorUnavailableResponse(response.status, errorData, errorMessage);
|
|
318
|
-
let error = new ApiError(errorMessage, {
|
|
319
|
-
status: response.status,
|
|
320
|
-
response: response,
|
|
321
|
-
details: errorData || undefined,
|
|
322
|
-
data: errorData,
|
|
323
|
-
detail: errorData?.detail,
|
|
324
|
-
code: isRequestDeadline
|
|
325
|
-
? REQUEST_DEADLINE_CODE
|
|
326
|
-
: errorData?.code ||
|
|
327
|
-
errorData?.error_code ||
|
|
328
|
-
errorData?.detail?.error_code ||
|
|
329
|
-
response.status.toString(),
|
|
330
|
-
});
|
|
331
|
-
if (response.status === 402) {
|
|
332
|
-
error = parseBillingError(error);
|
|
333
|
-
}
|
|
334
|
-
// Account-wide MFA gate (403 + code account_mfa_required): the one
|
|
335
|
-
// actionable authz denial — the user can complete an MFA challenge and
|
|
336
|
-
// retry. Surface it as a browser event so the app's step-up dialog opens
|
|
337
|
-
// no matter which call site tripped the gate. No-op outside the browser.
|
|
338
|
-
if (response.status === 403 &&
|
|
339
|
-
errorData?.code === 'account_mfa_required' &&
|
|
340
|
-
typeof window !== 'undefined' &&
|
|
341
|
-
typeof window.dispatchEvent === 'function') {
|
|
342
|
-
try {
|
|
343
|
-
window.dispatchEvent(new CustomEvent('kortix:mfa-required'));
|
|
344
|
-
}
|
|
345
|
-
catch {
|
|
346
|
-
// Never let telemetry-grade signaling break the error path.
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
// Handle HTTP 431 - Request Header Fields Too Large
|
|
350
|
-
// This typically happens when uploading many files at once
|
|
351
|
-
if (response.status === 431) {
|
|
352
|
-
error = new RequestTooLargeError(431, {
|
|
353
|
-
message: 'Request is too large to process',
|
|
354
|
-
suggestion: 'Try uploading files one at a time, or reduce the number of files attached to your message.',
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
// Expected "feature not enabled on this deployment" state — the backend
|
|
358
|
-
// returns a TYPED 501 with `code: 'feature_not_supported'` (see the
|
|
359
|
-
// connector router's `featureNotSupportedResponse`) when an OPTIONAL
|
|
360
|
-
// capability isn't wired on this deployment (e.g. connector
|
|
361
|
-
// auth-discovery, Pipedream). The dashboard already surfaces these as a
|
|
362
|
-
// graceful "unavailable" UI state (e.g. the connector-auth-discovery
|
|
363
|
-
// InfoBanner), so they must NEVER page Better Stack — a bare 501
|
|
364
|
-
// "not supported" previously leaked as an opaque `ApiError` in Sentry
|
|
365
|
-
// (pattern `1f3c4d96…`). Treat it as SILENT here: skip the global
|
|
366
|
-
// `onError` (Sentry) capture, but still return the `ApiError` so callers
|
|
367
|
-
// (React Query `onError` / the UI) can branch on `.code ===
|
|
368
|
-
// 'feature_not_supported'`. A genuine 501 server bug carries no such
|
|
369
|
-
// code and still reports normally. Mirrors the expected-state
|
|
370
|
-
// classification used for billing-gate 402s and the no-compaction-model
|
|
371
|
-
// sentinel (PR #5183): a typed code distinguishes "deployment doesn't
|
|
372
|
-
// offer this" from a real defect.
|
|
373
|
-
const isFeatureNotSupported = response.status === 501 && errorData?.code === FEATURE_NOT_SUPPORTED_CODE;
|
|
374
|
-
// Expected "this model isn't available for this account" state — the
|
|
375
|
-
// backend returns a TYPED 409 with `code: 'model_not_servable'` (from
|
|
376
|
-
// `isModelServableForAccount` in `apps/api/src/projects/routes/models.ts` and
|
|
377
|
-
// `channel-bindings.ts`) when a user picks a model their account can't
|
|
378
|
-
// use (free-tier managed model, disconnected BYOK provider). This is a UI
|
|
379
|
-
// validation error, not a server defect, so it must NEVER page Better
|
|
380
|
-
// Stack — a bare `ApiError: Model "…" is not available for this account`
|
|
381
|
-
// previously leaked to Sentry as an unhandled-looking rejection (pattern
|
|
382
|
-
// `ed07f6c5…`) because the model-defaults `useMutation` had no `onError`
|
|
383
|
-
// and the call sites fire-and-forget the promise. Treat it as SILENT
|
|
384
|
-
// here: skip `onError` (Sentry), but still return the `ApiError` so the
|
|
385
|
-
// `useModelDefaults` `setMutation` `onError` can branch on `.code ===
|
|
386
|
-
// 'model_not_servable'` and show a user-facing toast. A genuine 409 (no
|
|
387
|
-
// typed code) still reports. Same shape as `isFeatureNotSupported`.
|
|
388
|
-
const isModelNotServable = response.status === 409 && errorData?.code === MODEL_NOT_SERVABLE_CODE;
|
|
389
|
-
// Expected "a concurrent attempt with this key is still running" state —
|
|
390
|
-
// same shape as `isModelNotServable`, see `PROVISION_IN_FLIGHT_CODE`. The
|
|
391
|
-
// caller retries with the same key; the user must not see a toast (let
|
|
392
|
-
// alone one naming `idempotency_key`) for a race that resolves itself.
|
|
393
|
-
const isProvisionInFlight = response.status === 409 && errorData?.code === PROVISION_IN_FLIGHT_CODE;
|
|
394
|
-
// Expected "the analytics aggregate couldn't finish in its DB budget"
|
|
395
|
-
// state — same shape as `isProvisionInFlight`, see
|
|
396
|
-
// `ANALYTICS_UNAVAILABLE_CODE`. A typed 503 must never page Sentry: the
|
|
397
|
-
// route was previously returning a 500 whose body was the raw Postgres
|
|
398
|
-
// `Failed query: select …` text, which surfaced as an opaque `ApiError`
|
|
399
|
-
// (pattern `0e4ee10d…`). The `ApiError` is still returned so the dashboard
|
|
400
|
-
// renders its own unavailable state.
|
|
401
|
-
const isAnalyticsUnavailable = response.status === 503 && errorData?.code === ANALYTICS_UNAVAILABLE_CODE;
|
|
402
|
-
// Expected "the accounts-list join couldn't finish in its DB budget"
|
|
403
|
-
// state — same shape as `isAnalyticsUnavailable`, see
|
|
404
|
-
// `ACCOUNTS_LIST_UNAVAILABLE_CODE`.
|
|
405
|
-
const isAccountsListUnavailable = response.status === 503 && errorData?.code === ACCOUNTS_LIST_UNAVAILABLE_CODE;
|
|
406
|
-
if (showErrors &&
|
|
407
|
-
!isFeatureNotSupported &&
|
|
408
|
-
!isModelNotServable &&
|
|
409
|
-
!isProvisionInFlight &&
|
|
410
|
-
!isAnalyticsUnavailable &&
|
|
411
|
-
!isAccountsListUnavailable &&
|
|
412
|
-
!isGitMirrorUnavailable &&
|
|
413
|
-
!isRequestDeadline) {
|
|
414
|
-
platformConfig().onError?.(error, errorContext);
|
|
415
|
-
}
|
|
416
|
-
return {
|
|
417
|
-
error,
|
|
418
|
-
success: false,
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
let data;
|
|
422
|
-
const contentType = response.headers.get('content-type');
|
|
423
|
-
if (contentType?.includes('application/json')) {
|
|
424
|
-
data = await abortable(response.json(), activeController.signal);
|
|
425
|
-
}
|
|
426
|
-
else if (contentType?.includes('text/')) {
|
|
427
|
-
data = (await abortable(response.text(), activeController.signal));
|
|
428
|
-
}
|
|
429
|
-
else {
|
|
430
|
-
data = (await abortable(response.blob(), activeController.signal));
|
|
431
|
-
}
|
|
432
|
-
return {
|
|
433
|
-
data,
|
|
434
|
-
success: true,
|
|
435
|
-
headers: response.headers,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
catch (error) {
|
|
439
|
-
// Always clear timeout on error
|
|
440
|
-
if (timeoutId) {
|
|
441
|
-
clearTimeout(timeoutId);
|
|
442
|
-
timeoutId = null;
|
|
443
|
-
}
|
|
444
|
-
// Check if this is an abort error (timeout or manual abort)
|
|
445
|
-
const requestWasAborted = isAbortError(error);
|
|
446
|
-
// If it was aborted, mark it so we don't try to abort again
|
|
447
|
-
if (requestWasAborted) {
|
|
448
|
-
isAborted = true;
|
|
449
|
-
}
|
|
450
|
-
let apiError;
|
|
451
|
-
if (requestWasAborted) {
|
|
452
|
-
// An external abort (Next.js client navigation, tab close, React Query
|
|
453
|
-
// cancelling an in-flight request, a dropped connection) is NOT a
|
|
454
|
-
// timeout — surfacing it as one produced the mysterious, URL-less
|
|
455
|
-
// "Request timeout" toasts/Sentry events. Swallow it silently.
|
|
456
|
-
if (!didTimeout) {
|
|
457
|
-
return {
|
|
458
|
-
error: new ApiError('Request aborted', {
|
|
459
|
-
name: 'AbortError',
|
|
460
|
-
code: 'ABORTED',
|
|
461
|
-
}),
|
|
462
|
-
success: false,
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
// Genuine timeout — our timer fired. Attach the endpoint so it's clear
|
|
466
|
-
// *what* timed out (the previous error carried no URL).
|
|
467
|
-
const endpoint = url.replace(getApiUrl(), '') || url;
|
|
468
|
-
apiError = new ApiError(`Request timed out after ${Math.round(timeout / 1000)}s: ${endpoint}`, {
|
|
469
|
-
code: 'TIMEOUT',
|
|
470
|
-
url,
|
|
471
|
-
endpoint,
|
|
472
|
-
timeout,
|
|
473
|
-
});
|
|
474
|
-
// A request deadline is transport state, not an actionable user error.
|
|
475
|
-
// Return the typed error to the caller, but never invoke the host's global
|
|
476
|
-
// error handler. Explicit callers can still render local recovery UI.
|
|
477
|
-
}
|
|
478
|
-
else if (error instanceof Error) {
|
|
479
|
-
// A browser TypeError has no HTTP response (CORS, DNS, or edge failure).
|
|
480
|
-
// Include only the route, never the request body or credential.
|
|
481
|
-
apiError = new ApiError(fetchOptions.method === 'POST' && error instanceof TypeError && error.message === 'Failed to fetch'
|
|
482
|
-
? `Failed to fetch: POST ${url.replace(getApiUrl(), '') || url}`
|
|
483
|
-
: error.message, { name: error.name || 'ApiError', stack: error.stack });
|
|
484
|
-
if (showErrors) {
|
|
485
|
-
platformConfig().onError?.(apiError, errorContext);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
489
|
-
apiError = new ApiError(String(error));
|
|
490
|
-
if (showErrors) {
|
|
491
|
-
platformConfig().onError?.(apiError, errorContext);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
return {
|
|
495
|
-
error: apiError,
|
|
496
|
-
success: false,
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
finally {
|
|
500
|
-
if (timeoutId)
|
|
501
|
-
clearTimeout(timeoutId);
|
|
502
|
-
fetchOptions.signal?.removeEventListener('abort', abortFromCaller);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
88
|
export const supabaseClient = {
|
|
506
89
|
async execute(queryFn, errorContext) {
|
|
507
90
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../../src/core/http/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,SAAS,E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iE,EACjE,EAAE;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAClD,MAAM,aAAa,GAAG,EAAE,GAAI,OAAkC,EAAE,CAAC;QACjE,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC;QAErC,OAAO,WAAW,CAAI,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,EAAE;YACjD,GAAG,WAAW;YACd,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,aAAa;SACvB,CAAC,CAAC;IACL,CAAC;IAED,UAAU;CACX,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RuntimeEventTransport } from '../runtime/runtime-rest-client.js';
|
|
1
2
|
/**
|
|
2
3
|
* Per-flag overrides for `@kortix/sdk/feature-flags`. A host that isn't Next.js
|
|
3
4
|
* (no `NEXT_PUBLIC_*` build-time env, e.g. React Native, a bare browser bundle,
|
|
@@ -36,10 +37,24 @@ export interface KortixPlatformConfig {
|
|
|
36
37
|
* Any fetch-shaped function is accepted (the global `fetch` type also carries
|
|
37
38
|
* runtime extras such as Bun's `preconnect`, which no adapter needs to provide). */
|
|
38
39
|
fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
40
|
+
/**
|
|
41
|
+
* How the live event stream's bytes arrive, for a host whose `fetch` cannot
|
|
42
|
+
* stream a response body (React Native without `expo/fetch`). The SDK calls it
|
|
43
|
+
* once per connection with the request's URL, headers (auth included) and
|
|
44
|
+
* abort signal, and keeps reconnect, resume, heartbeat and coalescing itself.
|
|
45
|
+
* Default: the configured `fetch`, read as a stream.
|
|
46
|
+
*/
|
|
47
|
+
eventStreamTransport?: RuntimeEventTransport;
|
|
39
48
|
/** @deprecated Inert. The SDK no longer sends `X-Kortix-Client`: the audit
|
|
40
49
|
* trail records the authenticated credential (`credential_kind`), not a
|
|
41
50
|
* self-reported surface. Accepted so existing hosts keep compiling. */
|
|
42
51
|
clientSource?: 'api' | 'cli' | 'mobile' | 'tui' | 'web';
|
|
52
|
+
/** The host's surface and release version as `<surface>/<version>` (e.g.
|
|
53
|
+
* `cli/0.13.42`), sent as `X-Kortix-Client-Version`. The API writes it to
|
|
54
|
+
* its request log only, to see which client versions still call a route
|
|
55
|
+
* before the route is retired. It is self-reported telemetry: it never
|
|
56
|
+
* reaches the audit trail and grants nothing. Omitted when unset or blank. */
|
|
57
|
+
clientVersion?: string;
|
|
43
58
|
/** Optional UI error sink (toast/log). No-op by default. */
|
|
44
59
|
onError?: (error: unknown, context?: unknown) => void;
|
|
45
60
|
/** Default sandbox id for local/single-sandbox hosts (was `getEnv().SANDBOX_ID`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/core/http/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/core/http/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E;;;;;;;GAOG;AAEH,MAAM,WAAW,0BAA0B;IACzC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IAC5F;;yFAEqF;IACrF,KAAK,CAAC,EAAE,CAAC,KAAK,EA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B,GAAG,SAAS,CAAC,GAAG,IAAI,CAErF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAG/F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAErD;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/core/http/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/core/http/config.ts"],"names":[],"mappings":"AA0EA;;;;GAIG;AACH,MAAM,OAAO,GAAyB;IACpC,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;CAC3B,CAAC;AAEF,IAAI,OAAO,GAAgC,IAAI,CAAC;AAEhD;;;;;;;GAOG;AACH,IAAI,cAAc,GAAoD,IAAI,CAAC;AAE3E,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB,CAAC,EAAmD;IACrF,cAAc,GAAG,EAAE,CAAC;AACtB,CAAC;AAED;;;;0DAI0D;AAC1D,MAAM,UAAU,mBAAmB;IACjC,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,MAA4B,EAAE,IAA2B;IACvF,IAAI,IAAI,EAAE,MAAM,KAAK,KAAK;QAAE,OAAO;IACnC,OAAO,GAAG,MAAM,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,EAAE,EAAE,IAAI,OAAO,IAAI,OAAO,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,OAAO,KAAK,IAAI,IAAI,cAAc,EAAE,EAAE,KAAK,SAAS,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/core/http/request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA+ClE,wBAAsB,WAAW,CAAC,CAAC,GAAG,GAAG,EACvC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,WAAW,GAAG,gBAAqB,GAC3C,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA+BzB"}
|