workos 0.19.0 → 0.20.2
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 +4 -646
- package/bin/workos.js +44 -0
- package/package.json +18 -99
- package/LICENSE +0 -47
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -1790
- package/dist/bin.js.map +0 -1
- package/dist/cli.config.d.ts +0 -88
- package/dist/cli.config.js +0 -110
- package/dist/cli.config.js.map +0 -1
- package/dist/commands/api/catalog.d.ts +0 -23
- package/dist/commands/api/catalog.js +0 -97
- package/dist/commands/api/catalog.js.map +0 -1
- package/dist/commands/api/format.d.ts +0 -5
- package/dist/commands/api/format.js +0 -46
- package/dist/commands/api/format.js.map +0 -1
- package/dist/commands/api/index.d.ts +0 -15
- package/dist/commands/api/index.js +0 -213
- package/dist/commands/api/index.js.map +0 -1
- package/dist/commands/api/interactive.d.ts +0 -3
- package/dist/commands/api/interactive.js +0 -133
- package/dist/commands/api/interactive.js.map +0 -1
- package/dist/commands/api/request.d.ts +0 -14
- package/dist/commands/api/request.js +0 -38
- package/dist/commands/api/request.js.map +0 -1
- package/dist/commands/api-key-mgmt.d.ts +0 -16
- package/dist/commands/api-key-mgmt.js +0 -96
- package/dist/commands/api-key-mgmt.js.map +0 -1
- package/dist/commands/audit-log.d.ts +0 -26
- package/dist/commands/audit-log.js +0 -155
- package/dist/commands/audit-log.js.map +0 -1
- package/dist/commands/auth-status.d.ts +0 -1
- package/dist/commands/auth-status.js +0 -57
- package/dist/commands/auth-status.js.map +0 -1
- package/dist/commands/claim.d.ts +0 -11
- package/dist/commands/claim.js +0 -143
- package/dist/commands/claim.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.js +0 -54
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/connection.d.ts +0 -13
- package/dist/commands/connection.js +0 -96
- package/dist/commands/connection.js.map +0 -1
- package/dist/commands/debug-sso.d.ts +0 -1
- package/dist/commands/debug-sso.js +0 -78
- package/dist/commands/debug-sso.js.map +0 -1
- package/dist/commands/debug-sync.d.ts +0 -1
- package/dist/commands/debug-sync.js +0 -102
- package/dist/commands/debug-sync.js.map +0 -1
- package/dist/commands/debug.d.ts +0 -28
- package/dist/commands/debug.js +0 -406
- package/dist/commands/debug.js.map +0 -1
- package/dist/commands/dev.d.ts +0 -22
- package/dist/commands/dev.js +0 -145
- package/dist/commands/dev.js.map +0 -1
- package/dist/commands/directory.d.ts +0 -27
- package/dist/commands/directory.js +0 -176
- package/dist/commands/directory.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -12
- package/dist/commands/doctor.js +0 -41
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/emulate.d.ts +0 -7
- package/dist/commands/emulate.js +0 -69
- package/dist/commands/emulate.js.map +0 -1
- package/dist/commands/env.d.ts +0 -19
- package/dist/commands/env.js +0 -303
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/event.d.ts +0 -9
- package/dist/commands/event.js +0 -43
- package/dist/commands/event.js.map +0 -1
- package/dist/commands/feature-flag.d.ts +0 -12
- package/dist/commands/feature-flag.js +0 -96
- package/dist/commands/feature-flag.js.map +0 -1
- package/dist/commands/install-skill.d.ts +0 -85
- package/dist/commands/install-skill.js +0 -332
- package/dist/commands/install-skill.js.map +0 -1
- package/dist/commands/install.d.ts +0 -6
- package/dist/commands/install.js +0 -51
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/invitation.d.ts +0 -19
- package/dist/commands/invitation.js +0 -94
- package/dist/commands/invitation.js.map +0 -1
- package/dist/commands/list-skills.d.ts +0 -4
- package/dist/commands/list-skills.js +0 -52
- package/dist/commands/list-skills.js.map +0 -1
- package/dist/commands/login.d.ts +0 -32
- package/dist/commands/login.js +0 -239
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.js +0 -17
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -14
- package/dist/commands/mcp.js +0 -99
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/membership.d.ts +0 -20
- package/dist/commands/membership.js +0 -129
- package/dist/commands/membership.js.map +0 -1
- package/dist/commands/migrations.d.ts +0 -2
- package/dist/commands/migrations.js +0 -50
- package/dist/commands/migrations.js.map +0 -1
- package/dist/commands/onboard-user.d.ts +0 -7
- package/dist/commands/onboard-user.js +0 -61
- package/dist/commands/onboard-user.js.map +0 -1
- package/dist/commands/org-domain.d.ts +0 -4
- package/dist/commands/org-domain.js +0 -45
- package/dist/commands/org-domain.js.map +0 -1
- package/dist/commands/organization.d.ts +0 -14
- package/dist/commands/organization.js +0 -103
- package/dist/commands/organization.js.map +0 -1
- package/dist/commands/permission.d.ts +0 -20
- package/dist/commands/permission.js +0 -93
- package/dist/commands/permission.js.map +0 -1
- package/dist/commands/portal.d.ts +0 -7
- package/dist/commands/portal.js +0 -26
- package/dist/commands/portal.js.map +0 -1
- package/dist/commands/role.d.ts +0 -17
- package/dist/commands/role.js +0 -122
- package/dist/commands/role.js.map +0 -1
- package/dist/commands/seed.d.ts +0 -6
- package/dist/commands/seed.js +0 -298
- package/dist/commands/seed.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.js +0 -63
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup-org.d.ts +0 -6
- package/dist/commands/setup-org.js +0 -99
- package/dist/commands/setup-org.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -50
- package/dist/commands/setup.js +0 -237
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/telemetry.d.ts +0 -3
- package/dist/commands/telemetry.js +0 -88
- package/dist/commands/telemetry.js.map +0 -1
- package/dist/commands/uninstall-skill.d.ts +0 -11
- package/dist/commands/uninstall-skill.js +0 -117
- package/dist/commands/uninstall-skill.js.map +0 -1
- package/dist/commands/user.d.ts +0 -19
- package/dist/commands/user.js +0 -92
- package/dist/commands/user.js.map +0 -1
- package/dist/commands/vault-run.d.ts +0 -13
- package/dist/commands/vault-run.js +0 -195
- package/dist/commands/vault-run.js.map +0 -1
- package/dist/commands/vault.d.ts +0 -25
- package/dist/commands/vault.js +0 -153
- package/dist/commands/vault.js.map +0 -1
- package/dist/commands/verify-login.d.ts +0 -25
- package/dist/commands/verify-login.js +0 -158
- package/dist/commands/verify-login.js.map +0 -1
- package/dist/commands/webhook.d.ts +0 -3
- package/dist/commands/webhook.js +0 -92
- package/dist/commands/webhook.js.map +0 -1
- package/dist/craft-pre-release.sh +0 -10
- package/dist/dashboard/components/AnimatedLogo.d.ts +0 -8
- package/dist/dashboard/components/AnimatedLogo.js +0 -16
- package/dist/dashboard/components/AnimatedLogo.js.map +0 -1
- package/dist/dashboard/components/CompletionView.d.ts +0 -13
- package/dist/dashboard/components/CompletionView.js +0 -25
- package/dist/dashboard/components/CompletionView.js.map +0 -1
- package/dist/dashboard/components/ConfirmPrompt.d.ts +0 -9
- package/dist/dashboard/components/ConfirmPrompt.js +0 -25
- package/dist/dashboard/components/ConfirmPrompt.js.map +0 -1
- package/dist/dashboard/components/CredentialsForm.d.ts +0 -10
- package/dist/dashboard/components/CredentialsForm.js +0 -47
- package/dist/dashboard/components/CredentialsForm.js.map +0 -1
- package/dist/dashboard/components/Dashboard.d.ts +0 -3
- package/dist/dashboard/components/Dashboard.js +0 -100
- package/dist/dashboard/components/Dashboard.js.map +0 -1
- package/dist/dashboard/components/DashboardLayout.d.ts +0 -24
- package/dist/dashboard/components/DashboardLayout.js +0 -25
- package/dist/dashboard/components/DashboardLayout.js.map +0 -1
- package/dist/dashboard/components/DiffPanel.d.ts +0 -9
- package/dist/dashboard/components/DiffPanel.js +0 -136
- package/dist/dashboard/components/DiffPanel.js.map +0 -1
- package/dist/dashboard/components/InlinePrompt.d.ts +0 -8
- package/dist/dashboard/components/InlinePrompt.js +0 -19
- package/dist/dashboard/components/InlinePrompt.js.map +0 -1
- package/dist/dashboard/components/OutputPanel.d.ts +0 -10
- package/dist/dashboard/components/OutputPanel.js +0 -100
- package/dist/dashboard/components/OutputPanel.js.map +0 -1
- package/dist/dashboard/components/Panel.d.ts +0 -12
- package/dist/dashboard/components/Panel.js +0 -6
- package/dist/dashboard/components/Panel.js.map +0 -1
- package/dist/dashboard/components/TextInput.d.ts +0 -13
- package/dist/dashboard/components/TextInput.js +0 -57
- package/dist/dashboard/components/TextInput.js.map +0 -1
- package/dist/dashboard/components/WelcomeArt.d.ts +0 -2
- package/dist/dashboard/components/WelcomeArt.js +0 -9
- package/dist/dashboard/components/WelcomeArt.js.map +0 -1
- package/dist/dashboard/hooks/useAnimation.d.ts +0 -7
- package/dist/dashboard/hooks/useAnimation.js +0 -24
- package/dist/dashboard/hooks/useAnimation.js.map +0 -1
- package/dist/dashboard/hooks/useKeyboard.d.ts +0 -8
- package/dist/dashboard/hooks/useKeyboard.js +0 -18
- package/dist/dashboard/hooks/useKeyboard.js.map +0 -1
- package/dist/dashboard/hooks/useTerminalSize.d.ts +0 -8
- package/dist/dashboard/hooks/useTerminalSize.js +0 -23
- package/dist/dashboard/hooks/useTerminalSize.js.map +0 -1
- package/dist/dashboard/index.d.ts +0 -6
- package/dist/dashboard/index.js +0 -36
- package/dist/dashboard/index.js.map +0 -1
- package/dist/dashboard/lib/diff-utils.d.ts +0 -21
- package/dist/dashboard/lib/diff-utils.js +0 -271
- package/dist/dashboard/lib/diff-utils.js.map +0 -1
- package/dist/dashboard/lib/logo-frames.d.ts +0 -20
- package/dist/dashboard/lib/logo-frames.js +0 -109
- package/dist/dashboard/lib/logo-frames.js.map +0 -1
- package/dist/dashboard/lib/welcome-art.d.ts +0 -1
- package/dist/dashboard/lib/welcome-art.js +0 -5
- package/dist/dashboard/lib/welcome-art.js.map +0 -1
- package/dist/dashboard/types.d.ts +0 -5
- package/dist/dashboard/types.js +0 -2
- package/dist/dashboard/types.js.map +0 -1
- package/dist/doctor/agent-prompt.d.ts +0 -10
- package/dist/doctor/agent-prompt.js +0 -190
- package/dist/doctor/agent-prompt.js.map +0 -1
- package/dist/doctor/checks/ai-analysis.d.ts +0 -9
- package/dist/doctor/checks/ai-analysis.js +0 -124
- package/dist/doctor/checks/ai-analysis.js.map +0 -1
- package/dist/doctor/checks/auth-patterns.d.ts +0 -2
- package/dist/doctor/checks/auth-patterns.js +0 -569
- package/dist/doctor/checks/auth-patterns.js.map +0 -1
- package/dist/doctor/checks/connectivity.d.ts +0 -2
- package/dist/doctor/checks/connectivity.js +0 -35
- package/dist/doctor/checks/connectivity.js.map +0 -1
- package/dist/doctor/checks/dashboard.d.ts +0 -3
- package/dist/doctor/checks/dashboard.js +0 -123
- package/dist/doctor/checks/dashboard.js.map +0 -1
- package/dist/doctor/checks/environment.d.ts +0 -2
- package/dist/doctor/checks/environment.js +0 -86
- package/dist/doctor/checks/environment.js.map +0 -1
- package/dist/doctor/checks/framework.d.ts +0 -2
- package/dist/doctor/checks/framework.js +0 -94
- package/dist/doctor/checks/framework.js.map +0 -1
- package/dist/doctor/checks/host-execution.d.ts +0 -2
- package/dist/doctor/checks/host-execution.js +0 -21
- package/dist/doctor/checks/host-execution.js.map +0 -1
- package/dist/doctor/checks/language.d.ts +0 -6
- package/dist/doctor/checks/language.js +0 -104
- package/dist/doctor/checks/language.js.map +0 -1
- package/dist/doctor/checks/mcp.d.ts +0 -15
- package/dist/doctor/checks/mcp.js +0 -34
- package/dist/doctor/checks/mcp.js.map +0 -1
- package/dist/doctor/checks/runtime.d.ts +0 -2
- package/dist/doctor/checks/runtime.js +0 -20
- package/dist/doctor/checks/runtime.js.map +0 -1
- package/dist/doctor/checks/sdk.d.ts +0 -2
- package/dist/doctor/checks/sdk.js +0 -192
- package/dist/doctor/checks/sdk.js.map +0 -1
- package/dist/doctor/checks/skills.d.ts +0 -9
- package/dist/doctor/checks/skills.js +0 -84
- package/dist/doctor/checks/skills.js.map +0 -1
- package/dist/doctor/clipboard.d.ts +0 -1
- package/dist/doctor/clipboard.js +0 -43
- package/dist/doctor/clipboard.js.map +0 -1
- package/dist/doctor/index.d.ts +0 -26
- package/dist/doctor/index.js +0 -182
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/issues.d.ts +0 -63
- package/dist/doctor/issues.js +0 -199
- package/dist/doctor/issues.js.map +0 -1
- package/dist/doctor/json-output.d.ts +0 -2
- package/dist/doctor/json-output.js +0 -4
- package/dist/doctor/json-output.js.map +0 -1
- package/dist/doctor/output.d.ts +0 -7
- package/dist/doctor/output.js +0 -289
- package/dist/doctor/output.js.map +0 -1
- package/dist/doctor/types.d.ts +0 -203
- package/dist/doctor/types.js +0 -2
- package/dist/doctor/types.js.map +0 -1
- package/dist/integrations/dotnet/index.d.ts +0 -8
- package/dist/integrations/dotnet/index.js +0 -170
- package/dist/integrations/dotnet/index.js.map +0 -1
- package/dist/integrations/elixir/index.d.ts +0 -8
- package/dist/integrations/elixir/index.js +0 -146
- package/dist/integrations/elixir/index.js.map +0 -1
- package/dist/integrations/go/index.d.ts +0 -11
- package/dist/integrations/go/index.js +0 -212
- package/dist/integrations/go/index.js.map +0 -1
- package/dist/integrations/kotlin/index.d.ts +0 -4
- package/dist/integrations/kotlin/index.js +0 -78
- package/dist/integrations/kotlin/index.js.map +0 -1
- package/dist/integrations/nextjs/index.d.ts +0 -4
- package/dist/integrations/nextjs/index.js +0 -93
- package/dist/integrations/nextjs/index.js.map +0 -1
- package/dist/integrations/nextjs/utils.d.ts +0 -8
- package/dist/integrations/nextjs/utils.js +0 -68
- package/dist/integrations/nextjs/utils.js.map +0 -1
- package/dist/integrations/node/index.d.ts +0 -4
- package/dist/integrations/node/index.js +0 -52
- package/dist/integrations/node/index.js.map +0 -1
- package/dist/integrations/php/index.d.ts +0 -4
- package/dist/integrations/php/index.js +0 -51
- package/dist/integrations/php/index.js.map +0 -1
- package/dist/integrations/php-laravel/index.d.ts +0 -4
- package/dist/integrations/php-laravel/index.js +0 -51
- package/dist/integrations/php-laravel/index.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -9
- package/dist/integrations/python/index.js +0 -249
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/react/index.d.ts +0 -4
- package/dist/integrations/react/index.js +0 -49
- package/dist/integrations/react/index.js.map +0 -1
- package/dist/integrations/react-router/index.d.ts +0 -4
- package/dist/integrations/react-router/index.js +0 -94
- package/dist/integrations/react-router/index.js.map +0 -1
- package/dist/integrations/react-router/utils.d.ts +0 -10
- package/dist/integrations/react-router/utils.js +0 -162
- package/dist/integrations/react-router/utils.js.map +0 -1
- package/dist/integrations/ruby/index.d.ts +0 -8
- package/dist/integrations/ruby/index.js +0 -137
- package/dist/integrations/ruby/index.js.map +0 -1
- package/dist/integrations/sveltekit/index.d.ts +0 -4
- package/dist/integrations/sveltekit/index.js +0 -50
- package/dist/integrations/sveltekit/index.js.map +0 -1
- package/dist/integrations/tanstack-start/index.d.ts +0 -4
- package/dist/integrations/tanstack-start/index.js +0 -51
- package/dist/integrations/tanstack-start/index.js.map +0 -1
- package/dist/integrations/vanilla-js/index.d.ts +0 -4
- package/dist/integrations/vanilla-js/index.js +0 -49
- package/dist/integrations/vanilla-js/index.js.map +0 -1
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.d.ts +0 -7
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js +0 -12
- package/dist/lib/__test-helpers__/mock-unclaimed-env-api-error.js.map +0 -1
- package/dist/lib/adapters/cli-adapter.d.ts +0 -113
- package/dist/lib/adapters/cli-adapter.js +0 -641
- package/dist/lib/adapters/cli-adapter.js.map +0 -1
- package/dist/lib/adapters/dashboard-adapter.d.ts +0 -34
- package/dist/lib/adapters/dashboard-adapter.js +0 -121
- package/dist/lib/adapters/dashboard-adapter.js.map +0 -1
- package/dist/lib/adapters/headless-adapter.d.ts +0 -80
- package/dist/lib/adapters/headless-adapter.js +0 -347
- package/dist/lib/adapters/headless-adapter.js.map +0 -1
- package/dist/lib/adapters/index.d.ts +0 -4
- package/dist/lib/adapters/index.js +0 -4
- package/dist/lib/adapters/index.js.map +0 -1
- package/dist/lib/adapters/types.d.ts +0 -41
- package/dist/lib/adapters/types.js +0 -2
- package/dist/lib/adapters/types.js.map +0 -1
- package/dist/lib/agent-interface.d.ts +0 -84
- package/dist/lib/agent-interface.js +0 -840
- package/dist/lib/agent-interface.js.map +0 -1
- package/dist/lib/agent-runner.d.ts +0 -9
- package/dist/lib/agent-runner.js +0 -261
- package/dist/lib/agent-runner.js.map +0 -1
- package/dist/lib/ai-content.d.ts +0 -14
- package/dist/lib/ai-content.js +0 -131
- package/dist/lib/ai-content.js.map +0 -1
- package/dist/lib/api-error-handler.d.ts +0 -18
- package/dist/lib/api-error-handler.js +0 -76
- package/dist/lib/api-error-handler.js.map +0 -1
- package/dist/lib/api-key.d.ts +0 -14
- package/dist/lib/api-key.js +0 -37
- package/dist/lib/api-key.js.map +0 -1
- package/dist/lib/api.d.ts +0 -25
- package/dist/lib/api.js +0 -120
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/background-refresh.d.ts +0 -29
- package/dist/lib/background-refresh.js +0 -95
- package/dist/lib/background-refresh.js.map +0 -1
- package/dist/lib/command-aliases.d.ts +0 -8
- package/dist/lib/command-aliases.js +0 -12
- package/dist/lib/command-aliases.js.map +0 -1
- package/dist/lib/completion-data.d.ts +0 -33
- package/dist/lib/completion-data.js +0 -33
- package/dist/lib/completion-data.js.map +0 -1
- package/dist/lib/config-store.d.ts +0 -63
- package/dist/lib/config-store.js +0 -293
- package/dist/lib/config-store.js.map +0 -1
- package/dist/lib/config.d.ts +0 -34
- package/dist/lib/config.js +0 -37
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -51
- package/dist/lib/constants.js +0 -50
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/credential-discovery.d.ts +0 -42
- package/dist/lib/credential-discovery.js +0 -100
- package/dist/lib/credential-discovery.js.map +0 -1
- package/dist/lib/credential-proxy.d.ts +0 -45
- package/dist/lib/credential-proxy.js +0 -364
- package/dist/lib/credential-proxy.js.map +0 -1
- package/dist/lib/credential-store.d.ts +0 -32
- package/dist/lib/credential-store.js +0 -236
- package/dist/lib/credential-store.js.map +0 -1
- package/dist/lib/credentials.d.ts +0 -13
- package/dist/lib/credentials.js +0 -34
- package/dist/lib/credentials.js.map +0 -1
- package/dist/lib/dev-command.d.ts +0 -26
- package/dist/lib/dev-command.js +0 -129
- package/dist/lib/dev-command.js.map +0 -1
- package/dist/lib/device-auth.d.ts +0 -48
- package/dist/lib/device-auth.js +0 -176
- package/dist/lib/device-auth.js.map +0 -1
- package/dist/lib/device-id.d.ts +0 -25
- package/dist/lib/device-id.js +0 -102
- package/dist/lib/device-id.js.map +0 -1
- package/dist/lib/ensure-auth.d.ts +0 -12
- package/dist/lib/ensure-auth.js +0 -111
- package/dist/lib/ensure-auth.js.map +0 -1
- package/dist/lib/env-writer.d.ts +0 -25
- package/dist/lib/env-writer.js +0 -90
- package/dist/lib/env-writer.js.map +0 -1
- package/dist/lib/events.d.ts +0 -248
- package/dist/lib/events.js +0 -19
- package/dist/lib/events.js.map +0 -1
- package/dist/lib/framework-config.d.ts +0 -133
- package/dist/lib/framework-config.js +0 -11
- package/dist/lib/framework-config.js.map +0 -1
- package/dist/lib/helper-functions.d.ts +0 -1
- package/dist/lib/helper-functions.js +0 -2
- package/dist/lib/helper-functions.js.map +0 -1
- package/dist/lib/host-probe.d.ts +0 -28
- package/dist/lib/host-probe.js +0 -154
- package/dist/lib/host-probe.js.map +0 -1
- package/dist/lib/installer-core.d.ts +0 -569
- package/dist/lib/installer-core.js +0 -1134
- package/dist/lib/installer-core.js.map +0 -1
- package/dist/lib/installer-core.types.d.ts +0 -162
- package/dist/lib/installer-core.types.js +0 -2
- package/dist/lib/installer-core.types.js.map +0 -1
- package/dist/lib/mcp-clients.d.ts +0 -45
- package/dist/lib/mcp-clients.js +0 -297
- package/dist/lib/mcp-clients.js.map +0 -1
- package/dist/lib/port-detection.d.ts +0 -7
- package/dist/lib/port-detection.js +0 -244
- package/dist/lib/port-detection.js.map +0 -1
- package/dist/lib/post-install.d.ts +0 -8
- package/dist/lib/post-install.js +0 -51
- package/dist/lib/post-install.js.map +0 -1
- package/dist/lib/preferences.d.ts +0 -143
- package/dist/lib/preferences.js +0 -227
- package/dist/lib/preferences.js.map +0 -1
- package/dist/lib/progress-tracker.d.ts +0 -22
- package/dist/lib/progress-tracker.js +0 -47
- package/dist/lib/progress-tracker.js.map +0 -1
- package/dist/lib/registry.d.ts +0 -42
- package/dist/lib/registry.js +0 -96
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resolve-install-credentials.d.ts +0 -11
- package/dist/lib/resolve-install-credentials.js +0 -53
- package/dist/lib/resolve-install-credentials.js.map +0 -1
- package/dist/lib/run-with-core.d.ts +0 -7
- package/dist/lib/run-with-core.js +0 -559
- package/dist/lib/run-with-core.js.map +0 -1
- package/dist/lib/safe-tools.d.ts +0 -2
- package/dist/lib/safe-tools.js +0 -212
- package/dist/lib/safe-tools.js.map +0 -1
- package/dist/lib/scaffold/index.d.ts +0 -1
- package/dist/lib/scaffold/index.js +0 -2
- package/dist/lib/scaffold/index.js.map +0 -1
- package/dist/lib/scaffold/scaffold.d.ts +0 -66
- package/dist/lib/scaffold/scaffold.js +0 -156
- package/dist/lib/scaffold/scaffold.js.map +0 -1
- package/dist/lib/settings.d.ts +0 -60
- package/dist/lib/settings.js +0 -31
- package/dist/lib/settings.js.map +0 -1
- package/dist/lib/staging-api.d.ts +0 -22
- package/dist/lib/staging-api.js +0 -74
- package/dist/lib/staging-api.js.map +0 -1
- package/dist/lib/startup-notice-gate.d.ts +0 -21
- package/dist/lib/startup-notice-gate.js +0 -29
- package/dist/lib/startup-notice-gate.js.map +0 -1
- package/dist/lib/telemetry-notice.d.ts +0 -25
- package/dist/lib/telemetry-notice.js +0 -58
- package/dist/lib/telemetry-notice.js.map +0 -1
- package/dist/lib/token-refresh-client.d.ts +0 -23
- package/dist/lib/token-refresh-client.js +0 -89
- package/dist/lib/token-refresh-client.js.map +0 -1
- package/dist/lib/token-refresh.d.ts +0 -12
- package/dist/lib/token-refresh.js +0 -27
- package/dist/lib/token-refresh.js.map +0 -1
- package/dist/lib/unclaimed-env-api.d.ts +0 -42
- package/dist/lib/unclaimed-env-api.js +0 -139
- package/dist/lib/unclaimed-env-api.js.map +0 -1
- package/dist/lib/unclaimed-env-provision.d.ts +0 -24
- package/dist/lib/unclaimed-env-provision.js +0 -80
- package/dist/lib/unclaimed-env-provision.js.map +0 -1
- package/dist/lib/unclaimed-warning.d.ts +0 -15
- package/dist/lib/unclaimed-warning.js +0 -78
- package/dist/lib/unclaimed-warning.js.map +0 -1
- package/dist/lib/validation/build-validator.d.ts +0 -21
- package/dist/lib/validation/build-validator.js +0 -153
- package/dist/lib/validation/build-validator.js.map +0 -1
- package/dist/lib/validation/index.d.ts +0 -4
- package/dist/lib/validation/index.js +0 -4
- package/dist/lib/validation/index.js.map +0 -1
- package/dist/lib/validation/quick-checks.d.ts +0 -19
- package/dist/lib/validation/quick-checks.js +0 -192
- package/dist/lib/validation/quick-checks.js.map +0 -1
- package/dist/lib/validation/security-checks.d.ts +0 -35
- package/dist/lib/validation/security-checks.js +0 -106
- package/dist/lib/validation/security-checks.js.map +0 -1
- package/dist/lib/validation/types.d.ts +0 -56
- package/dist/lib/validation/types.js +0 -2
- package/dist/lib/validation/types.js.map +0 -1
- package/dist/lib/validation/validator.d.ts +0 -13
- package/dist/lib/validation/validator.js +0 -711
- package/dist/lib/validation/validator.js.map +0 -1
- package/dist/lib/version-check.d.ts +0 -6
- package/dist/lib/version-check.js +0 -46
- package/dist/lib/version-check.js.map +0 -1
- package/dist/lib/workos-api.d.ts +0 -30
- package/dist/lib/workos-api.js +0 -69
- package/dist/lib/workos-api.js.map +0 -1
- package/dist/lib/workos-client.d.ts +0 -58
- package/dist/lib/workos-client.js +0 -140
- package/dist/lib/workos-client.js.map +0 -1
- package/dist/lib/workos-management.d.ts +0 -32
- package/dist/lib/workos-management.js +0 -149
- package/dist/lib/workos-management.js.map +0 -1
- package/dist/nextjs/nextjs-installer-agent.d.ts +0 -5
- package/dist/nextjs/nextjs-installer-agent.js +0 -6
- package/dist/nextjs/nextjs-installer-agent.js.map +0 -1
- package/dist/nextjs/utils.d.ts +0 -4
- package/dist/nextjs/utils.js +0 -5
- package/dist/nextjs/utils.js.map +0 -1
- package/dist/react/react-installer-agent.d.ts +0 -4
- package/dist/react/react-installer-agent.js +0 -5
- package/dist/react/react-installer-agent.js.map +0 -1
- package/dist/react-router/react-router-installer-agent.d.ts +0 -4
- package/dist/react-router/react-router-installer-agent.js +0 -5
- package/dist/react-router/react-router-installer-agent.js.map +0 -1
- package/dist/react-router/utils.d.ts +0 -4
- package/dist/react-router/utils.js +0 -5
- package/dist/react-router/utils.js.map +0 -1
- package/dist/run.d.ts +0 -33
- package/dist/run.js +0 -58
- package/dist/run.js.map +0 -1
- package/dist/smoke-test.ts +0 -881
- package/dist/steps/add-or-update-environment-variables.d.ts +0 -10
- package/dist/steps/add-or-update-environment-variables.js +0 -155
- package/dist/steps/add-or-update-environment-variables.js.map +0 -1
- package/dist/steps/index.d.ts +0 -3
- package/dist/steps/index.js +0 -4
- package/dist/steps/index.js.map +0 -1
- package/dist/steps/run-prettier.d.ts +0 -5
- package/dist/steps/run-prettier.js +0 -50
- package/dist/steps/run-prettier.js.map +0 -1
- package/dist/steps/upload-environment-variables/EnvironmentProvider.d.ts +0 -8
- package/dist/steps/upload-environment-variables/EnvironmentProvider.js +0 -7
- package/dist/steps/upload-environment-variables/EnvironmentProvider.js.map +0 -1
- package/dist/steps/upload-environment-variables/index.d.ts +0 -6
- package/dist/steps/upload-environment-variables/index.js +0 -69
- package/dist/steps/upload-environment-variables/index.js.map +0 -1
- package/dist/steps/upload-environment-variables/providers/vercel.d.ts +0 -14
- package/dist/steps/upload-environment-variables/providers/vercel.js +0 -107
- package/dist/steps/upload-environment-variables/providers/vercel.js.map +0 -1
- package/dist/tanstack-start/tanstack-start-installer-agent.d.ts +0 -4
- package/dist/tanstack-start/tanstack-start-installer-agent.js +0 -5
- package/dist/tanstack-start/tanstack-start-installer-agent.js.map +0 -1
- package/dist/telemetry.d.ts +0 -2
- package/dist/telemetry.js +0 -29
- package/dist/telemetry.js.map +0 -1
- package/dist/test/force-insecure-storage.d.ts +0 -1
- package/dist/test/force-insecure-storage.js +0 -9
- package/dist/test/force-insecure-storage.js.map +0 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -38
- package/dist/test/setup.js.map +0 -1
- package/dist/utils/analytics.d.ts +0 -66
- package/dist/utils/analytics.js +0 -330
- package/dist/utils/analytics.js.map +0 -1
- package/dist/utils/bash.d.ts +0 -2
- package/dist/utils/bash.js +0 -17
- package/dist/utils/bash.js.map +0 -1
- package/dist/utils/box.d.ts +0 -9
- package/dist/utils/box.js +0 -15
- package/dist/utils/box.js.map +0 -1
- package/dist/utils/cli-exit.d.ts +0 -15
- package/dist/utils/cli-exit.js +0 -11
- package/dist/utils/cli-exit.js.map +0 -1
- package/dist/utils/cli-symbols.d.ts +0 -44
- package/dist/utils/cli-symbols.js +0 -58
- package/dist/utils/cli-symbols.js.map +0 -1
- package/dist/utils/command-invocation.d.ts +0 -10
- package/dist/utils/command-invocation.js +0 -26
- package/dist/utils/command-invocation.js.map +0 -1
- package/dist/utils/command-telemetry.d.ts +0 -17
- package/dist/utils/command-telemetry.js +0 -67
- package/dist/utils/command-telemetry.js.map +0 -1
- package/dist/utils/crash-reporter.d.ts +0 -13
- package/dist/utils/crash-reporter.js +0 -91
- package/dist/utils/crash-reporter.js.map +0 -1
- package/dist/utils/debug.d.ts +0 -9
- package/dist/utils/debug.js +0 -105
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/env-parser.d.ts +0 -5
- package/dist/utils/env-parser.js +0 -18
- package/dist/utils/env-parser.js.map +0 -1
- package/dist/utils/environment.d.ts +0 -10
- package/dist/utils/environment.js +0 -69
- package/dist/utils/environment.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -3
- package/dist/utils/errors.js +0 -7
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exec-file.d.ts +0 -15
- package/dist/utils/exec-file.js +0 -39
- package/dist/utils/exec-file.js.map +0 -1
- package/dist/utils/exit-codes.d.ts +0 -31
- package/dist/utils/exit-codes.js +0 -69
- package/dist/utils/exit-codes.js.map +0 -1
- package/dist/utils/git-utils.d.ts +0 -23
- package/dist/utils/git-utils.js +0 -86
- package/dist/utils/git-utils.js.map +0 -1
- package/dist/utils/help-json.d.ts +0 -58
- package/dist/utils/help-json.js +0 -1577
- package/dist/utils/help-json.js.map +0 -1
- package/dist/utils/interaction-mode.d.ts +0 -25
- package/dist/utils/interaction-mode.js +0 -99
- package/dist/utils/interaction-mode.js.map +0 -1
- package/dist/utils/lock-art.d.ts +0 -4
- package/dist/utils/lock-art.js +0 -73
- package/dist/utils/lock-art.js.map +0 -1
- package/dist/utils/logging.d.ts +0 -9
- package/dist/utils/logging.js +0 -36
- package/dist/utils/logging.js.map +0 -1
- package/dist/utils/ndjson.d.ts +0 -16
- package/dist/utils/ndjson.js +0 -18
- package/dist/utils/ndjson.js.map +0 -1
- package/dist/utils/output.d.ts +0 -60
- package/dist/utils/output.js +0 -124
- package/dist/utils/output.js.map +0 -1
- package/dist/utils/package-json.d.ts +0 -26
- package/dist/utils/package-json.js +0 -32
- package/dist/utils/package-json.js.map +0 -1
- package/dist/utils/package-manager.d.ts +0 -21
- package/dist/utils/package-manager.js +0 -166
- package/dist/utils/package-manager.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -5
- package/dist/utils/paths.js +0 -18
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/platform.d.ts +0 -8
- package/dist/utils/platform.js +0 -7
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/recovery-hints.d.ts +0 -42
- package/dist/utils/recovery-hints.js +0 -92
- package/dist/utils/recovery-hints.js.map +0 -1
- package/dist/utils/redact.d.ts +0 -5
- package/dist/utils/redact.js +0 -29
- package/dist/utils/redact.js.map +0 -1
- package/dist/utils/register-subcommand.d.ts +0 -10
- package/dist/utils/register-subcommand.js +0 -33
- package/dist/utils/register-subcommand.js.map +0 -1
- package/dist/utils/semver.d.ts +0 -10
- package/dist/utils/semver.js +0 -43
- package/dist/utils/semver.js.map +0 -1
- package/dist/utils/string.d.ts +0 -1
- package/dist/utils/string.js +0 -6
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/summary-box.d.ts +0 -25
- package/dist/utils/summary-box.js +0 -211
- package/dist/utils/summary-box.js.map +0 -1
- package/dist/utils/table.d.ts +0 -5
- package/dist/utils/table.js +0 -18
- package/dist/utils/table.js.map +0 -1
- package/dist/utils/telemetry-client.d.ts +0 -43
- package/dist/utils/telemetry-client.js +0 -171
- package/dist/utils/telemetry-client.js.map +0 -1
- package/dist/utils/telemetry-store-forward.d.ts +0 -11
- package/dist/utils/telemetry-store-forward.js +0 -94
- package/dist/utils/telemetry-store-forward.js.map +0 -1
- package/dist/utils/telemetry-types.d.ts +0 -100
- package/dist/utils/telemetry-types.js +0 -6
- package/dist/utils/telemetry-types.js.map +0 -1
- package/dist/utils/types.d.ts +0 -123
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.js.map +0 -1
- package/dist/utils/ui-utils.d.ts +0 -97
- package/dist/utils/ui-utils.js +0 -449
- package/dist/utils/ui-utils.js.map +0 -1
- package/dist/utils/ui.d.ts +0 -148
- package/dist/utils/ui.js +0 -368
- package/dist/utils/ui.js.map +0 -1
- package/dist/utils/urls.d.ts +0 -13
- package/dist/utils/urls.js +0 -14
- package/dist/utils/urls.js.map +0 -1
- package/dist/utils/vendor/is-unicorn-supported.d.ts +0 -1
- package/dist/utils/vendor/is-unicorn-supported.js +0 -21
- package/dist/utils/vendor/is-unicorn-supported.js.map +0 -1
- package/dist/vanilla-js/vanilla-js-installer-agent.d.ts +0 -4
- package/dist/vanilla-js/vanilla-js-installer-agent.js +0 -5
- package/dist/vanilla-js/vanilla-js-installer-agent.js.map +0 -1
package/dist/lib/settings.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get version from package.json
|
|
3
|
-
*/
|
|
4
|
-
export declare function getVersion(): string;
|
|
5
|
-
export interface InstallerConfig {
|
|
6
|
-
model: string;
|
|
7
|
-
doctorModel: string;
|
|
8
|
-
workos: {
|
|
9
|
-
clientId: string;
|
|
10
|
-
authkitDomain: string;
|
|
11
|
-
};
|
|
12
|
-
telemetry: {
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
eventName: string;
|
|
15
|
-
};
|
|
16
|
-
proxy: {
|
|
17
|
-
refreshThresholdMs: number;
|
|
18
|
-
};
|
|
19
|
-
nodeVersion: string;
|
|
20
|
-
logging: {
|
|
21
|
-
debugMode: boolean;
|
|
22
|
-
};
|
|
23
|
-
documentation: {
|
|
24
|
-
workosDocsUrl: string;
|
|
25
|
-
dashboardUrl: string;
|
|
26
|
-
issuesUrl: string;
|
|
27
|
-
};
|
|
28
|
-
frameworks: {
|
|
29
|
-
[key: string]: {
|
|
30
|
-
port: number;
|
|
31
|
-
callbackPath: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
legacy: {
|
|
35
|
-
oauthPort: number;
|
|
36
|
-
};
|
|
37
|
-
branding: {
|
|
38
|
-
showAsciiArt: boolean;
|
|
39
|
-
asciiArt: string;
|
|
40
|
-
compactAsciiArt: string;
|
|
41
|
-
useCompact: boolean;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get config
|
|
46
|
-
*/
|
|
47
|
-
export declare function getConfig(): InstallerConfig;
|
|
48
|
-
/**
|
|
49
|
-
* Get the CLI auth client ID (from config; not env-overridable).
|
|
50
|
-
*/
|
|
51
|
-
export declare function getCliAuthClientId(): string;
|
|
52
|
-
/**
|
|
53
|
-
* Get the AuthKit domain.
|
|
54
|
-
* Env var overrides config default.
|
|
55
|
-
*
|
|
56
|
-
* Note: WorkOS service endpoints (API, dashboard, LLM gateway, telemetry)
|
|
57
|
-
* live in utils/urls.ts. AuthKit's domain stays here because it's config-
|
|
58
|
-
* backed rather than derived from the API host.
|
|
59
|
-
*/
|
|
60
|
-
export declare function getAuthkitDomain(): string;
|
package/dist/lib/settings.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { config, version } from '../cli.config.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get version from package.json
|
|
4
|
-
*/
|
|
5
|
-
export function getVersion() {
|
|
6
|
-
return version;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Get config
|
|
10
|
-
*/
|
|
11
|
-
export function getConfig() {
|
|
12
|
-
return config;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Get the CLI auth client ID (from config; not env-overridable).
|
|
16
|
-
*/
|
|
17
|
-
export function getCliAuthClientId() {
|
|
18
|
-
return config.workos.clientId;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get the AuthKit domain.
|
|
22
|
-
* Env var overrides config default.
|
|
23
|
-
*
|
|
24
|
-
* Note: WorkOS service endpoints (API, dashboard, LLM gateway, telemetry)
|
|
25
|
-
* live in utils/urls.ts. AuthKit's domain stays here because it's config-
|
|
26
|
-
* backed rather than derived from the API host.
|
|
27
|
-
*/
|
|
28
|
-
export function getAuthkitDomain() {
|
|
29
|
-
return process.env.WORKOS_AUTHKIT_DOMAIN || config.workos.authkitDomain;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=settings.js.map
|
package/dist/lib/settings.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,CAAC;AACjB,CAAC;AA0CD;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;AAC1E,CAAC","sourcesContent":["import { config, version } from '../cli.config.js';\n\n/**\n * Get version from package.json\n */\nexport function getVersion(): string {\n return version;\n}\n\nexport interface InstallerConfig {\n model: string;\n doctorModel: string;\n workos: {\n clientId: string;\n authkitDomain: string;\n };\n telemetry: {\n enabled: boolean;\n eventName: string;\n };\n proxy: {\n refreshThresholdMs: number;\n };\n nodeVersion: string;\n logging: {\n debugMode: boolean;\n };\n documentation: {\n workosDocsUrl: string;\n dashboardUrl: string;\n issuesUrl: string;\n };\n frameworks: {\n [key: string]: {\n port: number;\n callbackPath: string;\n };\n };\n legacy: {\n oauthPort: number;\n };\n branding: {\n showAsciiArt: boolean;\n asciiArt: string;\n compactAsciiArt: string;\n useCompact: boolean;\n };\n}\n\n/**\n * Get config\n */\nexport function getConfig(): InstallerConfig {\n return config;\n}\n\n/**\n * Get the CLI auth client ID (from config; not env-overridable).\n */\nexport function getCliAuthClientId(): string {\n return config.workos.clientId;\n}\n\n/**\n * Get the AuthKit domain.\n * Env var overrides config default.\n *\n * Note: WorkOS service endpoints (API, dashboard, LLM gateway, telemetry)\n * live in utils/urls.ts. AuthKit's domain stays here because it's config-\n * backed rather than derived from the API host.\n */\nexport function getAuthkitDomain(): string {\n return process.env.WORKOS_AUTHKIT_DOMAIN || config.workos.authkitDomain;\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Staging Environment Credentials API Client
|
|
3
|
-
*
|
|
4
|
-
* Fetches WorkOS staging credentials (client_id, api_key) from the staging API.
|
|
5
|
-
* Requires an access token with 'staging-environment:credentials:read' scope.
|
|
6
|
-
*/
|
|
7
|
-
export interface StagingCredentials {
|
|
8
|
-
clientId: string;
|
|
9
|
-
apiKey: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class StagingApiError extends Error {
|
|
12
|
-
readonly statusCode?: number | undefined;
|
|
13
|
-
constructor(message: string, statusCode?: number | undefined);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Fetch staging environment credentials from the WorkOS API.
|
|
17
|
-
*
|
|
18
|
-
* @param accessToken - Bearer token with staging-environment:credentials:read scope
|
|
19
|
-
* @returns StagingCredentials containing clientId and apiKey
|
|
20
|
-
* @throws StagingApiError on auth failure, permission denied, or other HTTP errors
|
|
21
|
-
*/
|
|
22
|
-
export declare function fetchStagingCredentials(accessToken: string): Promise<StagingCredentials>;
|
package/dist/lib/staging-api.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Staging Environment Credentials API Client
|
|
3
|
-
*
|
|
4
|
-
* Fetches WorkOS staging credentials (client_id, api_key) from the staging API.
|
|
5
|
-
* Requires an access token with 'staging-environment:credentials:read' scope.
|
|
6
|
-
*/
|
|
7
|
-
import { logInfo, logError } from '../utils/debug.js';
|
|
8
|
-
export class StagingApiError extends Error {
|
|
9
|
-
statusCode;
|
|
10
|
-
constructor(message, statusCode) {
|
|
11
|
-
super(message);
|
|
12
|
-
this.statusCode = statusCode;
|
|
13
|
-
this.name = 'StagingApiError';
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const STAGING_API_URL = 'https://api.workos.com/x/installer/staging-environment/credentials';
|
|
17
|
-
const REQUEST_TIMEOUT_MS = 30_000;
|
|
18
|
-
/**
|
|
19
|
-
* Fetch staging environment credentials from the WorkOS API.
|
|
20
|
-
*
|
|
21
|
-
* @param accessToken - Bearer token with staging-environment:credentials:read scope
|
|
22
|
-
* @returns StagingCredentials containing clientId and apiKey
|
|
23
|
-
* @throws StagingApiError on auth failure, permission denied, or other HTTP errors
|
|
24
|
-
*/
|
|
25
|
-
export async function fetchStagingCredentials(accessToken) {
|
|
26
|
-
const controller = new AbortController();
|
|
27
|
-
const timeoutId = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
28
|
-
logInfo('[staging-api] Fetching credentials from:', STAGING_API_URL);
|
|
29
|
-
try {
|
|
30
|
-
const res = await fetch(STAGING_API_URL, {
|
|
31
|
-
headers: { Authorization: `Bearer ${accessToken}` },
|
|
32
|
-
signal: controller.signal,
|
|
33
|
-
});
|
|
34
|
-
logInfo('[staging-api] Response status:', res.status);
|
|
35
|
-
if (!res.ok) {
|
|
36
|
-
const text = await res.text().catch(() => '');
|
|
37
|
-
logError('[staging-api] Error response:', res.status, text);
|
|
38
|
-
if (res.status === 401) {
|
|
39
|
-
throw new StagingApiError('Authentication expired. Please log in again.', 401);
|
|
40
|
-
}
|
|
41
|
-
if (res.status === 403) {
|
|
42
|
-
throw new StagingApiError('Access denied. Ensure you have the required permissions.', 403);
|
|
43
|
-
}
|
|
44
|
-
if (res.status === 404) {
|
|
45
|
-
throw new StagingApiError('No staging environment found. Create one in the WorkOS dashboard.', 404);
|
|
46
|
-
}
|
|
47
|
-
throw new StagingApiError(`Failed to fetch credentials: ${res.status} ${text}`, res.status);
|
|
48
|
-
}
|
|
49
|
-
const data = (await res.json());
|
|
50
|
-
// Handle both camelCase and snake_case responses
|
|
51
|
-
const clientId = data.clientId || data.client_id;
|
|
52
|
-
const apiKey = data.apiKey || data.api_key;
|
|
53
|
-
if (!clientId || !apiKey) {
|
|
54
|
-
logError('[staging-api] Invalid response: missing credentials');
|
|
55
|
-
throw new StagingApiError('Invalid response: missing clientId or apiKey');
|
|
56
|
-
}
|
|
57
|
-
logInfo('[staging-api] Credentials fetched successfully');
|
|
58
|
-
return { clientId, apiKey };
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
if (error instanceof StagingApiError)
|
|
62
|
-
throw error;
|
|
63
|
-
if (error instanceof Error && error.name === 'AbortError') {
|
|
64
|
-
logError('[staging-api] Request timed out');
|
|
65
|
-
throw new StagingApiError('Request timed out. Check your network connection.');
|
|
66
|
-
}
|
|
67
|
-
logError('[staging-api] Network error:', error instanceof Error ? error.message : 'Unknown');
|
|
68
|
-
throw new StagingApiError(`Network error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
69
|
-
}
|
|
70
|
-
finally {
|
|
71
|
-
clearTimeout(timeoutId);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=staging-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"staging-api.js","sourceRoot":"","sources":["../../src/lib/staging-api.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Staging Environment Credentials API Client\n *\n * Fetches WorkOS staging credentials (client_id, api_key) from the staging API.\n * Requires an access token with 'staging-environment:credentials:read' scope.\n */\n\nimport { logInfo, logError } from '../utils/debug.js';\n\nexport interface StagingCredentials {\n clientId: string;\n apiKey: string;\n}\n\nexport class StagingApiError extends Error {\n constructor(\n message: string,\n public readonly statusCode?: number,\n ) {\n super(message);\n this.name = 'StagingApiError';\n }\n}\n\nconst STAGING_API_URL = 'https://api.workos.com/x/installer/staging-environment/credentials';\nconst REQUEST_TIMEOUT_MS = 30_000;\n\n/**\n * Fetch staging environment credentials from the WorkOS API.\n *\n * @param accessToken - Bearer token with staging-environment:credentials:read scope\n * @returns StagingCredentials containing clientId and apiKey\n * @throws StagingApiError on auth failure, permission denied, or other HTTP errors\n */\nexport async function fetchStagingCredentials(accessToken: string): Promise<StagingCredentials> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);\n\n logInfo('[staging-api] Fetching credentials from:', STAGING_API_URL);\n try {\n const res = await fetch(STAGING_API_URL, {\n headers: { Authorization: `Bearer ${accessToken}` },\n signal: controller.signal,\n });\n\n logInfo('[staging-api] Response status:', res.status);\n if (!res.ok) {\n const text = await res.text().catch(() => '');\n logError('[staging-api] Error response:', res.status, text);\n\n if (res.status === 401) {\n throw new StagingApiError('Authentication expired. Please log in again.', 401);\n }\n if (res.status === 403) {\n throw new StagingApiError('Access denied. Ensure you have the required permissions.', 403);\n }\n if (res.status === 404) {\n throw new StagingApiError('No staging environment found. Create one in the WorkOS dashboard.', 404);\n }\n\n throw new StagingApiError(`Failed to fetch credentials: ${res.status} ${text}`, res.status);\n }\n\n const data = (await res.json()) as { clientId?: string; apiKey?: string; client_id?: string; api_key?: string };\n\n // Handle both camelCase and snake_case responses\n const clientId = data.clientId || data.client_id;\n const apiKey = data.apiKey || data.api_key;\n\n if (!clientId || !apiKey) {\n logError('[staging-api] Invalid response: missing credentials');\n throw new StagingApiError('Invalid response: missing clientId or apiKey');\n }\n\n logInfo('[staging-api] Credentials fetched successfully');\n return { clientId, apiKey };\n } catch (error) {\n if (error instanceof StagingApiError) throw error;\n if (error instanceof Error && error.name === 'AbortError') {\n logError('[staging-api] Request timed out');\n throw new StagingApiError('Request timed out. Check your network connection.');\n }\n logError('[staging-api] Network error:', error instanceof Error ? error.message : 'Unknown');\n throw new StagingApiError(`Network error: ${error instanceof Error ? error.message : 'Unknown error'}`);\n } finally {\n clearTimeout(timeoutId);\n }\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-notice-per-run coordinator for the startup stderr notices.
|
|
3
|
-
*
|
|
4
|
-
* Three middlewares can each want to print a one-line stderr notice at startup:
|
|
5
|
-
* the first-run telemetry notice, the unclaimed-environment warning, and the
|
|
6
|
-
* MCP banner. Stacking two or three boxes on a single command is noise, so this
|
|
7
|
-
* module is the shared latch — whichever fires first calls
|
|
8
|
-
* markStartupNoticeShown(), and the lower-priority MCP banner checks
|
|
9
|
-
* hasStartupNoticeShown() and defers.
|
|
10
|
-
*
|
|
11
|
-
* Ordering IS priority: bin.ts runs the telemetry + unclaimed middlewares before
|
|
12
|
-
* the MCP banner middleware, so those two always win a contested run. In-memory
|
|
13
|
-
* only (a run is a single CLI process); the per-machine "already shown" state is
|
|
14
|
-
* persisted separately by each notice.
|
|
15
|
-
*/
|
|
16
|
-
/** Record that a startup notice has displayed this run. */
|
|
17
|
-
export declare function markStartupNoticeShown(): void;
|
|
18
|
-
/** Whether any startup notice has already displayed this run. */
|
|
19
|
-
export declare function hasStartupNoticeShown(): boolean;
|
|
20
|
-
/** Reset the latch (for testing). */
|
|
21
|
-
export declare function resetStartupNoticeGate(): void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-notice-per-run coordinator for the startup stderr notices.
|
|
3
|
-
*
|
|
4
|
-
* Three middlewares can each want to print a one-line stderr notice at startup:
|
|
5
|
-
* the first-run telemetry notice, the unclaimed-environment warning, and the
|
|
6
|
-
* MCP banner. Stacking two or three boxes on a single command is noise, so this
|
|
7
|
-
* module is the shared latch — whichever fires first calls
|
|
8
|
-
* markStartupNoticeShown(), and the lower-priority MCP banner checks
|
|
9
|
-
* hasStartupNoticeShown() and defers.
|
|
10
|
-
*
|
|
11
|
-
* Ordering IS priority: bin.ts runs the telemetry + unclaimed middlewares before
|
|
12
|
-
* the MCP banner middleware, so those two always win a contested run. In-memory
|
|
13
|
-
* only (a run is a single CLI process); the per-machine "already shown" state is
|
|
14
|
-
* persisted separately by each notice.
|
|
15
|
-
*/
|
|
16
|
-
let shown = false;
|
|
17
|
-
/** Record that a startup notice has displayed this run. */
|
|
18
|
-
export function markStartupNoticeShown() {
|
|
19
|
-
shown = true;
|
|
20
|
-
}
|
|
21
|
-
/** Whether any startup notice has already displayed this run. */
|
|
22
|
-
export function hasStartupNoticeShown() {
|
|
23
|
-
return shown;
|
|
24
|
-
}
|
|
25
|
-
/** Reset the latch (for testing). */
|
|
26
|
-
export function resetStartupNoticeGate() {
|
|
27
|
-
shown = false;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=startup-notice-gate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"startup-notice-gate.js","sourceRoot":"","sources":["../../src/lib/startup-notice-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,IAAI,KAAK,GAAG,KAAK,CAAC;AAElB,2DAA2D;AAC3D,MAAM,UAAU,sBAAsB;IACpC,KAAK,GAAG,IAAI,CAAC;AACf,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,qBAAqB;IACnC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,sBAAsB;IACpC,KAAK,GAAG,KAAK,CAAC;AAChB,CAAC","sourcesContent":["/**\n * One-notice-per-run coordinator for the startup stderr notices.\n *\n * Three middlewares can each want to print a one-line stderr notice at startup:\n * the first-run telemetry notice, the unclaimed-environment warning, and the\n * MCP banner. Stacking two or three boxes on a single command is noise, so this\n * module is the shared latch — whichever fires first calls\n * markStartupNoticeShown(), and the lower-priority MCP banner checks\n * hasStartupNoticeShown() and defers.\n *\n * Ordering IS priority: bin.ts runs the telemetry + unclaimed middlewares before\n * the MCP banner middleware, so those two always win a contested run. In-memory\n * only (a run is a single CLI process); the per-machine \"already shown\" state is\n * persisted separately by each notice.\n */\n\nlet shown = false;\n\n/** Record that a startup notice has displayed this run. */\nexport function markStartupNoticeShown(): void {\n shown = true;\n}\n\n/** Whether any startup notice has already displayed this run. */\nexport function hasStartupNoticeShown(): boolean {\n return shown;\n}\n\n/** Reset the latch (for testing). */\nexport function resetStartupNoticeGate(): void {\n shown = false;\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First-run telemetry notice.
|
|
3
|
-
*
|
|
4
|
-
* Prints a one-time, stderr-only notice telling the user that anonymous CLI
|
|
5
|
-
* usage telemetry is being collected and how to turn it off. Shown at most once
|
|
6
|
-
* ever (backed by the persisted `noticeShownAt` timestamp in preferences.json),
|
|
7
|
-
* only in interactive human mode, and never on the machine-readable path.
|
|
8
|
-
*
|
|
9
|
-
* Mirrors the structural pattern of unclaimed-warning.ts: a per-session guard,
|
|
10
|
-
* a `!isJsonMode()` gate, the shared renderStderrNotice helper, and a never-throws
|
|
11
|
-
* contract so it can never block command execution. The one structural
|
|
12
|
-
* difference is persistence — this notice writes `noticeShownAt` the first time
|
|
13
|
-
* it actually displays so it never re-shows across runs.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Show the first-run telemetry notice if it has never been displayed.
|
|
17
|
-
*
|
|
18
|
-
* Gate order is load-bearing: every suppression check runs BEFORE
|
|
19
|
-
* markNoticeShown(), so a non-human first run (--json / piped / CI) never
|
|
20
|
-
* consumes the one-time display. The flag is set only when the box is actually
|
|
21
|
-
* rendered, so a real human eventually sees it. Never throws.
|
|
22
|
-
*/
|
|
23
|
-
export declare function maybeShowTelemetryNotice(): void;
|
|
24
|
-
/** Reset session state (for testing). */
|
|
25
|
-
export declare function resetTelemetryNoticeState(): void;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First-run telemetry notice.
|
|
3
|
-
*
|
|
4
|
-
* Prints a one-time, stderr-only notice telling the user that anonymous CLI
|
|
5
|
-
* usage telemetry is being collected and how to turn it off. Shown at most once
|
|
6
|
-
* ever (backed by the persisted `noticeShownAt` timestamp in preferences.json),
|
|
7
|
-
* only in interactive human mode, and never on the machine-readable path.
|
|
8
|
-
*
|
|
9
|
-
* Mirrors the structural pattern of unclaimed-warning.ts: a per-session guard,
|
|
10
|
-
* a `!isJsonMode()` gate, the shared renderStderrNotice helper, and a never-throws
|
|
11
|
-
* contract so it can never block command execution. The one structural
|
|
12
|
-
* difference is persistence — this notice writes `noticeShownAt` the first time
|
|
13
|
-
* it actually displays so it never re-shows across runs.
|
|
14
|
-
*/
|
|
15
|
-
import chalk from 'chalk';
|
|
16
|
-
import { isJsonMode } from '../utils/output.js';
|
|
17
|
-
import { renderStderrNotice } from '../utils/box.js';
|
|
18
|
-
import { formatWorkOSCommand } from '../utils/command-invocation.js';
|
|
19
|
-
import { isNoticeShown, markNoticeShown, isTelemetryOptedOut } from './preferences.js';
|
|
20
|
-
import { markStartupNoticeShown } from './startup-notice-gate.js';
|
|
21
|
-
let shownThisSession = false;
|
|
22
|
-
/**
|
|
23
|
-
* Show the first-run telemetry notice if it has never been displayed.
|
|
24
|
-
*
|
|
25
|
-
* Gate order is load-bearing: every suppression check runs BEFORE
|
|
26
|
-
* markNoticeShown(), so a non-human first run (--json / piped / CI) never
|
|
27
|
-
* consumes the one-time display. The flag is set only when the box is actually
|
|
28
|
-
* rendered, so a real human eventually sees it. Never throws.
|
|
29
|
-
*/
|
|
30
|
-
export function maybeShowTelemetryNotice() {
|
|
31
|
-
try {
|
|
32
|
-
if (shownThisSession)
|
|
33
|
-
return;
|
|
34
|
-
if (isJsonMode())
|
|
35
|
-
return; // suppress in --json / non-TTY / CI (output auto-switches to json)
|
|
36
|
-
if (isTelemetryOptedOut())
|
|
37
|
-
return; // already opted out — nothing to inform
|
|
38
|
-
if (isNoticeShown())
|
|
39
|
-
return; // already shown once, ever
|
|
40
|
-
const optOut = chalk.cyan(formatWorkOSCommand('telemetry opt-out'));
|
|
41
|
-
renderStderrNotice(`${chalk.cyan('ℹ')} ${chalk.dim('Anonymous CLI usage telemetry is on.')} ${chalk.dim('Disable:')} ${optOut}`);
|
|
42
|
-
// Set the per-session guard and persist ONLY after a successful render, so a
|
|
43
|
-
// render failure (caught below) lets a later command in this process retry
|
|
44
|
-
// rather than silently suppressing the notice for the rest of the session.
|
|
45
|
-
shownThisSession = true;
|
|
46
|
-
markNoticeShown();
|
|
47
|
-
// Claim the one-notice-per-run slot so the lower-priority MCP banner defers.
|
|
48
|
-
markStartupNoticeShown();
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
// Never block command execution.
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/** Reset session state (for testing). */
|
|
55
|
-
export function resetTelemetryNoticeState() {
|
|
56
|
-
shownThisSession = false;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=telemetry-notice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-notice.js","sourceRoot":"","sources":["../../src/lib/telemetry-notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,IAAI,gBAAgB,GAAG,KAAK,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB;IACtC,IAAI,CAAC;QACH,IAAI,gBAAgB;YAAE,OAAO;QAC7B,IAAI,UAAU,EAAE;YAAE,OAAO,CAAC,mEAAmE;QAC7F,IAAI,mBAAmB,EAAE;YAAE,OAAO,CAAC,wCAAwC;QAC3E,IAAI,aAAa,EAAE;YAAE,OAAO,CAAC,2BAA2B;QAExD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,CAAC;QACpE,kBAAkB,CAChB,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,sCAAsC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,MAAM,EAAE,CAC7G,CAAC;QACF,6EAA6E;QAC7E,2EAA2E;QAC3E,2EAA2E;QAC3E,gBAAgB,GAAG,IAAI,CAAC;QACxB,eAAe,EAAE,CAAC;QAClB,6EAA6E;QAC7E,sBAAsB,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,iCAAiC;IACnC,CAAC;AACH,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,yBAAyB;IACvC,gBAAgB,GAAG,KAAK,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * First-run telemetry notice.\n *\n * Prints a one-time, stderr-only notice telling the user that anonymous CLI\n * usage telemetry is being collected and how to turn it off. Shown at most once\n * ever (backed by the persisted `noticeShownAt` timestamp in preferences.json),\n * only in interactive human mode, and never on the machine-readable path.\n *\n * Mirrors the structural pattern of unclaimed-warning.ts: a per-session guard,\n * a `!isJsonMode()` gate, the shared renderStderrNotice helper, and a never-throws\n * contract so it can never block command execution. The one structural\n * difference is persistence — this notice writes `noticeShownAt` the first time\n * it actually displays so it never re-shows across runs.\n */\n\nimport chalk from 'chalk';\nimport { isJsonMode } from '../utils/output.js';\nimport { renderStderrNotice } from '../utils/box.js';\nimport { formatWorkOSCommand } from '../utils/command-invocation.js';\nimport { isNoticeShown, markNoticeShown, isTelemetryOptedOut } from './preferences.js';\nimport { markStartupNoticeShown } from './startup-notice-gate.js';\n\nlet shownThisSession = false;\n\n/**\n * Show the first-run telemetry notice if it has never been displayed.\n *\n * Gate order is load-bearing: every suppression check runs BEFORE\n * markNoticeShown(), so a non-human first run (--json / piped / CI) never\n * consumes the one-time display. The flag is set only when the box is actually\n * rendered, so a real human eventually sees it. Never throws.\n */\nexport function maybeShowTelemetryNotice(): void {\n try {\n if (shownThisSession) return;\n if (isJsonMode()) return; // suppress in --json / non-TTY / CI (output auto-switches to json)\n if (isTelemetryOptedOut()) return; // already opted out — nothing to inform\n if (isNoticeShown()) return; // already shown once, ever\n\n const optOut = chalk.cyan(formatWorkOSCommand('telemetry opt-out'));\n renderStderrNotice(\n `${chalk.cyan('ℹ')} ${chalk.dim('Anonymous CLI usage telemetry is on.')} ${chalk.dim('Disable:')} ${optOut}`,\n );\n // Set the per-session guard and persist ONLY after a successful render, so a\n // render failure (caught below) lets a later command in this process retry\n // rather than silently suppressing the notice for the rest of the session.\n shownThisSession = true;\n markNoticeShown();\n // Claim the one-notice-per-run slot so the lower-priority MCP banner defers.\n markStartupNoticeShown();\n } catch {\n // Never block command execution.\n }\n}\n\n/** Reset session state (for testing). */\nexport function resetTelemetryNoticeState(): void {\n shownThisSession = false;\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Token refresh client for WorkOS OAuth
|
|
3
|
-
*/
|
|
4
|
-
export interface RefreshResult {
|
|
5
|
-
success: boolean;
|
|
6
|
-
accessToken?: string;
|
|
7
|
-
refreshToken?: string;
|
|
8
|
-
expiresAt?: number;
|
|
9
|
-
error?: string;
|
|
10
|
-
errorType?: 'invalid_grant' | 'network' | 'server' | 'unknown';
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Refresh access token using stored refresh token.
|
|
14
|
-
*
|
|
15
|
-
* @param authkitDomain - The AuthKit domain (e.g., https://auth.workos.com)
|
|
16
|
-
* @param clientId - OAuth client ID
|
|
17
|
-
* @returns RefreshResult with new tokens or error details
|
|
18
|
-
*/
|
|
19
|
-
export declare function refreshAccessToken(authkitDomain: string, clientId: string): Promise<RefreshResult>;
|
|
20
|
-
/**
|
|
21
|
-
* Check if token needs refresh (expires within threshold).
|
|
22
|
-
*/
|
|
23
|
-
export declare function tokenNeedsRefresh(expiresAt: number, thresholdMs?: number): boolean;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Token refresh client for WorkOS OAuth
|
|
3
|
-
*/
|
|
4
|
-
import { logInfo, logError } from '../utils/debug.js';
|
|
5
|
-
import { getCredentials } from './credentials.js';
|
|
6
|
-
import { formatWorkOSCommand } from '../utils/command-invocation.js';
|
|
7
|
-
const REFRESH_TIMEOUT_MS = 30_000;
|
|
8
|
-
/**
|
|
9
|
-
* Refresh access token using stored refresh token.
|
|
10
|
-
*
|
|
11
|
-
* @param authkitDomain - The AuthKit domain (e.g., https://auth.workos.com)
|
|
12
|
-
* @param clientId - OAuth client ID
|
|
13
|
-
* @returns RefreshResult with new tokens or error details
|
|
14
|
-
*/
|
|
15
|
-
export async function refreshAccessToken(authkitDomain, clientId) {
|
|
16
|
-
const creds = getCredentials();
|
|
17
|
-
if (!creds?.refreshToken) {
|
|
18
|
-
return {
|
|
19
|
-
success: false,
|
|
20
|
-
error: 'No refresh token available',
|
|
21
|
-
errorType: 'invalid_grant',
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const tokenUrl = `${authkitDomain}/oauth2/token`;
|
|
25
|
-
logInfo('[token-refresh] Attempting token refresh');
|
|
26
|
-
try {
|
|
27
|
-
const controller = new AbortController();
|
|
28
|
-
const timeout = setTimeout(() => controller.abort(), REFRESH_TIMEOUT_MS);
|
|
29
|
-
const response = await fetch(tokenUrl, {
|
|
30
|
-
method: 'POST',
|
|
31
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
32
|
-
body: new URLSearchParams({
|
|
33
|
-
grant_type: 'refresh_token',
|
|
34
|
-
refresh_token: creds.refreshToken,
|
|
35
|
-
client_id: clientId,
|
|
36
|
-
}),
|
|
37
|
-
signal: controller.signal,
|
|
38
|
-
});
|
|
39
|
-
clearTimeout(timeout);
|
|
40
|
-
if (!response.ok) {
|
|
41
|
-
const errorData = (await response.json());
|
|
42
|
-
logError('[token-refresh] Refresh failed:', errorData.error);
|
|
43
|
-
if (errorData.error === 'invalid_grant') {
|
|
44
|
-
return {
|
|
45
|
-
success: false,
|
|
46
|
-
error: `Session expired. Run \`${formatWorkOSCommand('auth login')}\` to re-authenticate.`,
|
|
47
|
-
errorType: 'invalid_grant',
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
success: false,
|
|
52
|
-
error: errorData.error_description || errorData.error,
|
|
53
|
-
errorType: 'server',
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
const data = (await response.json());
|
|
57
|
-
const expiresAt = Date.now() + data.expires_in * 1000;
|
|
58
|
-
logInfo('[token-refresh] Token refreshed successfully, expires:', new Date(expiresAt).toISOString());
|
|
59
|
-
return {
|
|
60
|
-
success: true,
|
|
61
|
-
accessToken: data.access_token,
|
|
62
|
-
refreshToken: data.refresh_token, // May be rotated
|
|
63
|
-
expiresAt,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
if (error instanceof Error && error.name === 'AbortError') {
|
|
68
|
-
logError('[token-refresh] Refresh timed out');
|
|
69
|
-
return {
|
|
70
|
-
success: false,
|
|
71
|
-
error: 'Token refresh timed out',
|
|
72
|
-
errorType: 'network',
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
logError('[token-refresh] Network error:', error);
|
|
76
|
-
return {
|
|
77
|
-
success: false,
|
|
78
|
-
error: `Network error: ${error.message}`,
|
|
79
|
-
errorType: 'network',
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Check if token needs refresh (expires within threshold).
|
|
85
|
-
*/
|
|
86
|
-
export function tokenNeedsRefresh(expiresAt, thresholdMs = 2 * 60 * 1000) {
|
|
87
|
-
return Date.now() + thresholdMs >= expiresAt;
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=token-refresh-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-refresh-client.js","sourceRoot":"","sources":["../../src/lib/token-refresh-client.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Token refresh client for WorkOS OAuth\n */\n\nimport { logInfo, logError } from '../utils/debug.js';\nimport { getCredentials } from './credentials.js';\nimport { formatWorkOSCommand } from '../utils/command-invocation.js';\n\nexport interface RefreshResult {\n success: boolean;\n accessToken?: string;\n refreshToken?: string;\n expiresAt?: number;\n error?: string;\n errorType?: 'invalid_grant' | 'network' | 'server' | 'unknown';\n}\n\ninterface TokenRefreshResponse {\n access_token: string;\n refresh_token?: string;\n token_type: string;\n expires_in: number;\n}\n\ninterface TokenErrorResponse {\n error: string;\n error_description?: string;\n}\n\nconst REFRESH_TIMEOUT_MS = 30_000;\n\n/**\n * Refresh access token using stored refresh token.\n *\n * @param authkitDomain - The AuthKit domain (e.g., https://auth.workos.com)\n * @param clientId - OAuth client ID\n * @returns RefreshResult with new tokens or error details\n */\nexport async function refreshAccessToken(authkitDomain: string, clientId: string): Promise<RefreshResult> {\n const creds = getCredentials();\n\n if (!creds?.refreshToken) {\n return {\n success: false,\n error: 'No refresh token available',\n errorType: 'invalid_grant',\n };\n }\n\n const tokenUrl = `${authkitDomain}/oauth2/token`;\n logInfo('[token-refresh] Attempting token refresh');\n\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), REFRESH_TIMEOUT_MS);\n\n const response = await fetch(tokenUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: new URLSearchParams({\n grant_type: 'refresh_token',\n refresh_token: creds.refreshToken,\n client_id: clientId,\n }),\n signal: controller.signal,\n });\n\n clearTimeout(timeout);\n\n if (!response.ok) {\n const errorData = (await response.json()) as TokenErrorResponse;\n logError('[token-refresh] Refresh failed:', errorData.error);\n\n if (errorData.error === 'invalid_grant') {\n return {\n success: false,\n error: `Session expired. Run \\`${formatWorkOSCommand('auth login')}\\` to re-authenticate.`,\n errorType: 'invalid_grant',\n };\n }\n\n return {\n success: false,\n error: errorData.error_description || errorData.error,\n errorType: 'server',\n };\n }\n\n const data = (await response.json()) as TokenRefreshResponse;\n const expiresAt = Date.now() + data.expires_in * 1000;\n\n logInfo('[token-refresh] Token refreshed successfully, expires:', new Date(expiresAt).toISOString());\n\n return {\n success: true,\n accessToken: data.access_token,\n refreshToken: data.refresh_token, // May be rotated\n expiresAt,\n };\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n logError('[token-refresh] Refresh timed out');\n return {\n success: false,\n error: 'Token refresh timed out',\n errorType: 'network',\n };\n }\n\n logError('[token-refresh] Network error:', error);\n return {\n success: false,\n error: `Network error: ${(error as Error).message}`,\n errorType: 'network',\n };\n }\n}\n\n/**\n * Check if token needs refresh (expires within threshold).\n */\nexport function tokenNeedsRefresh(expiresAt: number, thresholdMs: number = 2 * 60 * 1000): boolean {\n return Date.now() + thresholdMs >= expiresAt;\n}\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Credentials } from './credentials.js';
|
|
2
|
-
export interface TokenValidationResult {
|
|
3
|
-
success: boolean;
|
|
4
|
-
credentials?: Credentials;
|
|
5
|
-
error?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Check if the current token is valid.
|
|
9
|
-
* If expired, returns an error prompting re-authentication.
|
|
10
|
-
* No refresh is attempted here; callers decide whether to refresh or re-authenticate.
|
|
11
|
-
*/
|
|
12
|
-
export declare function ensureValidToken(): Promise<TokenValidationResult>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getCredentials, isTokenExpired } from './credentials.js';
|
|
2
|
-
import { logInfo } from '../utils/debug.js';
|
|
3
|
-
import { formatWorkOSCommand } from '../utils/command-invocation.js';
|
|
4
|
-
/**
|
|
5
|
-
* Check if the current token is valid.
|
|
6
|
-
* If expired, returns an error prompting re-authentication.
|
|
7
|
-
* No refresh is attempted here; callers decide whether to refresh or re-authenticate.
|
|
8
|
-
*/
|
|
9
|
-
export async function ensureValidToken() {
|
|
10
|
-
const creds = getCredentials();
|
|
11
|
-
if (!creds) {
|
|
12
|
-
logInfo('[ensureValidToken] No credentials found');
|
|
13
|
-
return { success: false, error: 'Not authenticated' };
|
|
14
|
-
}
|
|
15
|
-
logInfo(`[ensureValidToken] Token expiresAt: ${new Date(creds.expiresAt).toISOString()}`);
|
|
16
|
-
logInfo(`[ensureValidToken] Current time: ${new Date().toISOString()}`);
|
|
17
|
-
if (isTokenExpired(creds)) {
|
|
18
|
-
logInfo('[ensureValidToken] Token expired, re-authentication required');
|
|
19
|
-
return {
|
|
20
|
-
success: false,
|
|
21
|
-
error: `Session expired. Run \`${formatWorkOSCommand('auth login')}\` to re-authenticate.`,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
logInfo('[ensureValidToken] Token valid');
|
|
25
|
-
return { success: true, credentials: creds };
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=token-refresh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-refresh.js","sourceRoot":"","sources":["../../src/lib/token-refresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAe,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAQrE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAE/B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,yCAAyC,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACxD,CAAC;IAED,OAAO,CAAC,uCAAuC,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAC1F,OAAO,CAAC,oCAAoC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAExE,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,8DAA8D,CAAC,CAAC;QACxE,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,0BAA0B,mBAAmB,CAAC,YAAY,CAAC,wBAAwB;SAC3F,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["import { getCredentials, isTokenExpired, Credentials } from './credentials.js';\nimport { logInfo } from '../utils/debug.js';\nimport { formatWorkOSCommand } from '../utils/command-invocation.js';\n\nexport interface TokenValidationResult {\n success: boolean;\n credentials?: Credentials;\n error?: string;\n}\n\n/**\n * Check if the current token is valid.\n * If expired, returns an error prompting re-authentication.\n * No refresh is attempted here; callers decide whether to refresh or re-authenticate.\n */\nexport async function ensureValidToken(): Promise<TokenValidationResult> {\n const creds = getCredentials();\n\n if (!creds) {\n logInfo('[ensureValidToken] No credentials found');\n return { success: false, error: 'Not authenticated' };\n }\n\n logInfo(`[ensureValidToken] Token expiresAt: ${new Date(creds.expiresAt).toISOString()}`);\n logInfo(`[ensureValidToken] Current time: ${new Date().toISOString()}`);\n\n if (isTokenExpired(creds)) {\n logInfo('[ensureValidToken] Token expired, re-authentication required');\n return {\n success: false,\n error: `Session expired. Run \\`${formatWorkOSCommand('auth login')}\\` to re-authenticate.`,\n };\n }\n\n logInfo('[ensureValidToken] Token valid');\n return { success: true, credentials: creds };\n}\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unclaimed Environment Provisioning API Client
|
|
3
|
-
*
|
|
4
|
-
* Provisions unauthenticated unclaimed environments and generates claim nonces.
|
|
5
|
-
* No authentication required for provisioning — claim tokens are used for
|
|
6
|
-
* subsequent claim operations.
|
|
7
|
-
*/
|
|
8
|
-
export interface UnclaimedEnvProvisionResult {
|
|
9
|
-
clientId: string;
|
|
10
|
-
apiKey: string;
|
|
11
|
-
claimToken: string;
|
|
12
|
-
authkitDomain: string;
|
|
13
|
-
}
|
|
14
|
-
export interface ClaimNonceResult {
|
|
15
|
-
nonce: string;
|
|
16
|
-
alreadyClaimed: false;
|
|
17
|
-
}
|
|
18
|
-
export interface AlreadyClaimedResult {
|
|
19
|
-
alreadyClaimed: true;
|
|
20
|
-
}
|
|
21
|
-
export type ClaimNonceResponse = ClaimNonceResult | AlreadyClaimedResult;
|
|
22
|
-
export declare class UnclaimedEnvApiError extends Error {
|
|
23
|
-
readonly statusCode?: number | undefined;
|
|
24
|
-
constructor(message: string, statusCode?: number | undefined);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Provision a new unclaimed environment. No authentication required.
|
|
28
|
-
*
|
|
29
|
-
* @returns UnclaimedEnvProvisionResult containing clientId, apiKey, claimToken, and authkitDomain
|
|
30
|
-
* @throws UnclaimedEnvApiError on rate limit, network failure, timeout, or server error
|
|
31
|
-
*/
|
|
32
|
-
export declare function provisionUnclaimedEnvironment(): Promise<UnclaimedEnvProvisionResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Generate a claim nonce from a claim token + client ID.
|
|
35
|
-
* Returns { alreadyClaimed: true } if environment was already claimed.
|
|
36
|
-
*
|
|
37
|
-
* @param clientId - The client ID of the unclaimed environment
|
|
38
|
-
* @param claimToken - The claim token from provisioning
|
|
39
|
-
* @returns ClaimNonceResponse — either a nonce or already-claimed indicator
|
|
40
|
-
* @throws UnclaimedEnvApiError on invalid token, not found, or server error
|
|
41
|
-
*/
|
|
42
|
-
export declare function createClaimNonce(clientId: string, claimToken: string): Promise<ClaimNonceResponse>;
|