@hexclave/next 1.0.72 → 1.0.74
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/dist/{admin-app-impl-DLqm4Zqy.d.ts → admin-app-impl-FZdANO62.d.ts} +15 -9
- package/dist/admin-app-impl-FZdANO62.d.ts.map +1 -0
- package/dist/clickmap/clickmap-core.d.ts +1 -1
- package/dist/clickmap/index.d.ts +1 -1
- package/dist/{client-app-DlKeB4SB.d.ts → client-app-BCT5p_70.d.ts} +12 -4
- package/dist/{client-app-DlKeB4SB.d.ts.map → client-app-BCT5p_70.d.ts.map} +1 -1
- package/dist/components/selected-team-switcher.d.ts +1 -1
- package/dist/components/team-icon.d.ts +1 -1
- package/dist/components/team-switcher.d.ts +1 -1
- package/dist/components-page/account-settings/payments/payments-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/leave-team-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-api-keys-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-display-name-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-invitation-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-list-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-image-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-user-section.d.ts +1 -1
- package/dist/components-page/hexclave-handler-client.d.ts +1 -1
- package/dist/components-page/hexclave-handler.d.ts +1 -1
- package/dist/components-page/oauth-callback.js +3 -18
- package/dist/components-page/oauth-callback.js.map +1 -1
- package/dist/dev-tool/dev-tool-core.d.ts +1 -1
- package/dist/dev-tool/index.d.ts +1 -1
- package/dist/esm/components-page/oauth-callback.d.ts.map +1 -1
- package/dist/esm/components-page/oauth-callback.js +4 -19
- package/dist/esm/components-page/oauth-callback.js.map +1 -1
- package/dist/esm/lib/auth.d.ts.map +1 -1
- package/dist/esm/lib/auth.js +1 -1
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/auth.test.js +2 -2
- package/dist/esm/lib/auth.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +6 -3
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js +4 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js +102 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +57 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +7 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +44 -12
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts +13 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.js +15 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.test.js +25 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-back-state.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.js +67 -12
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js +87 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +9 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/lib/hexclave-app/project-configs/index.d.ts +4 -1
- package/dist/esm/lib/hexclave-app/project-configs/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.js +3 -0
- package/dist/esm/lib/hexclave-app/projects/index.js.map +1 -1
- package/dist/esm/utils/url.js +10 -2
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/esm/utils/url.test.d.ts +1 -0
- package/dist/esm/utils/url.test.js +28 -0
- package/dist/esm/utils/url.test.js.map +1 -0
- package/dist/{hexclave-provider-B_KtSfuf.d.ts → hexclave-provider-BKxi3Vy-.d.ts} +2 -2
- package/dist/{hexclave-provider-B_KtSfuf.d.ts.map → hexclave-provider-BKxi3Vy-.d.ts.map} +1 -1
- package/dist/{hooks-nHRIrxA9.d.ts → hooks-CUe5bc3s.d.ts} +2 -2
- package/dist/{hooks-nHRIrxA9.d.ts.map → hooks-CUe5bc3s.d.ts.map} +1 -1
- package/dist/{index-Dq4xsW7_.d.ts → index-B-MazpM_.d.ts} +5 -2
- package/dist/{index-Dq4xsW7_.d.ts.map → index-B-MazpM_.d.ts.map} +1 -1
- package/dist/{index-CsExJ_pK.d.ts → index-CvB7XacB.d.ts} +2 -2
- package/dist/{index-CsExJ_pK.d.ts.map → index-CvB7XacB.d.ts.map} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +1 -1
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/auth.test.js +2 -2
- package/dist/lib/auth.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js +4 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js +101 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +57 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +43 -11
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts +13 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.js +15 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.test.js +24 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-back-state.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.js +67 -12
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js +86 -0
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/server-app.d.ts +1 -1
- package/dist/lib/hexclave-app/index.d.ts +2 -2
- package/dist/lib/hexclave-app/project-configs/index.d.ts +1 -1
- package/dist/lib/hexclave-app/projects/index.d.ts +1 -1
- package/dist/lib/hexclave-app/projects/index.js +3 -0
- package/dist/lib/hexclave-app/projects/index.js.map +1 -1
- package/dist/lib/hexclave-app/teams/index.d.ts +1 -1
- package/dist/lib/hexclave-app/users/index.d.ts +1 -1
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/oauth-callback-tCVTRbF2.d.ts.map +1 -1
- package/dist/providers/hexclave-context.d.ts +1 -1
- package/dist/providers/hexclave-provider-client.d.ts +1 -1
- package/dist/providers/hexclave-provider.d.ts +1 -1
- package/dist/pushed-config-error-overlay/index.d.ts +1 -1
- package/dist/{redirect-page-urls-NUHUchgR.d.ts → redirect-page-urls-BEWG0AtP.d.ts} +2 -1
- package/dist/redirect-page-urls-BEWG0AtP.d.ts.map +1 -0
- package/dist/utils/url.js +10 -2
- package/dist/utils/url.js.map +1 -1
- package/dist/utils/url.test.d.ts +1 -0
- package/dist/utils/url.test.js +27 -0
- package/dist/utils/url.test.js.map +1 -0
- package/package.json +4 -4
- package/src/components-page/oauth-callback.tsx +0 -16
- package/src/lib/auth.test.ts +2 -2
- package/src/lib/auth.ts +3 -1
- package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +4 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.automatic-side-effects.test.ts +126 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts +75 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +73 -16
- package/src/lib/hexclave-app/apps/implementations/redirect-back-state.test.ts +29 -1
- package/src/lib/hexclave-app/apps/implementations/redirect-back-state.ts +17 -0
- package/src/lib/hexclave-app/apps/implementations/redirect-page-urls.test.ts +119 -0
- package/src/lib/hexclave-app/apps/implementations/redirect-page-urls.ts +104 -12
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +12 -2
- package/src/lib/hexclave-app/project-configs/index.ts +4 -1
- package/src/lib/hexclave-app/projects/index.ts +3 -0
- package/src/utils/url.test.ts +54 -0
- package/src/utils/url.ts +12 -3
- package/dist/admin-app-impl-DLqm4Zqy.d.ts.map +0 -1
- package/dist/redirect-page-urls-NUHUchgR.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _HexclaveServerAppImplIncomplete } from "../../../../admin-app-impl-
|
|
1
|
+
import { n as _HexclaveServerAppImplIncomplete } from "../../../../admin-app-impl-FZdANO62.js";
|
|
2
2
|
export { _HexclaveServerAppImplIncomplete };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as StackServerAppConstructor, D as HexclaveAdminApp, F as StackAdminAppConstructorOptions, I as HexclaveServerApp, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, k as HexclaveAdminAppConstructorOptions, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, z as StackServerApp } from "../../../client-app-
|
|
1
|
+
import { B as StackServerAppConstructor, D as HexclaveAdminApp, F as StackAdminAppConstructorOptions, I as HexclaveServerApp, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, k as HexclaveAdminAppConstructorOptions, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, z as StackServerApp } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { HexclaveAdminApp, type HexclaveAdminAppConstructor, type HexclaveAdminAppConstructorOptions, HexclaveClientApp, type HexclaveClientAppConstructor, type HexclaveClientAppConstructorOptions, type HexclaveClientAppJson, HexclaveServerApp, type HexclaveServerAppConstructor, type HexclaveServerAppConstructorOptions, StackAdminApp, type StackAdminAppConstructor, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructor, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructor, type StackServerAppConstructorOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as AdminWorkflowRunState, c as AdminWorkflowStepAttempt, d as AdminWorkflowUpgradeResult, f as AdminWorkflowVersion, i as AdminWorkflowRunDetails, l as AdminWorkflowSyncResult, n as AdminWorkflowDivergenceDiagnostic, o as AdminWorkflowRunsFilter, r as AdminWorkflowRun, s as AdminWorkflowStep, t as AdminWorkflow, u as AdminWorkflowTrigger } from "../../../../workflows-DEb7pIuQ.js";
|
|
2
|
-
import { A as ManagedEmailProviderListItem, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, M as ManagedEmailProviderStatus, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, T as EmailOutboxListResult, j as ManagedEmailProviderSetupResult, k as HexclaveAdminAppConstructorOptions, w as EmailOutboxListOptions } from "../../../../client-app-
|
|
2
|
+
import { A as ManagedEmailProviderListItem, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, M as ManagedEmailProviderStatus, N as StackAdminApp, O as HexclaveAdminAppConstructor, P as StackAdminAppConstructor, T as EmailOutboxListResult, j as ManagedEmailProviderSetupResult, k as HexclaveAdminAppConstructorOptions, w as EmailOutboxListOptions } from "../../../../client-app-BCT5p_70.js";
|
|
3
3
|
import { a as ListSessionReplaysOptions, i as ListSessionReplayChunksResult, n as AdminSessionReplayChunk, o as ListSessionReplaysResult, r as ListSessionReplayChunksOptions, s as SessionReplayAllEventsResult, t as AdminSessionReplay } from "../../../../index-hYjsGKNc.js";
|
|
4
4
|
export { type AdminSessionReplay, type AdminSessionReplayChunk, type AdminWorkflow, type AdminWorkflowDivergenceDiagnostic, type AdminWorkflowRun, type AdminWorkflowRunDetails, type AdminWorkflowRunState, type AdminWorkflowRunsFilter, type AdminWorkflowStep, type AdminWorkflowStepAttempt, type AdminWorkflowSyncResult, type AdminWorkflowTrigger, type AdminWorkflowUpgradeResult, type AdminWorkflowVersion, EmailOutboxListOptions, EmailOutboxListResult, EmailOutboxUpdateOptions, HexclaveAdminApp, HexclaveAdminAppConstructor, HexclaveAdminAppConstructorOptions, type ListSessionReplayChunksOptions, type ListSessionReplayChunksResult, type ListSessionReplaysOptions, type ListSessionReplaysResult, ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, type SessionReplayAllEventsResult, StackAdminApp, StackAdminAppConstructor, StackAdminAppConstructorOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp } from "../../../../client-app-
|
|
1
|
+
import { a as StackClientApp, c as StackClientAppJson, i as HexclaveClientAppJson, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, r as HexclaveClientAppConstructorOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp } from "../../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { HexclaveClientApp, HexclaveClientAppConstructor, HexclaveClientAppConstructorOptions, HexclaveClientAppJson, StackClientApp, StackClientAppConstructor, StackClientAppConstructorOptions, StackClientAppJson };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app.js","names":["_HexclaveClientAppImpl"],"sources":["../../../../../src/lib/hexclave-app/apps/interfaces/client-app.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownErrors } from \"@hexclave/shared\";\nimport { CurrentUserCrud } from \"@hexclave/shared/dist/interface/crud/current-user\";\nimport { Result } from \"@hexclave/shared/dist/utils/results\";\nimport { AsyncStoreProperty, AuthLike, GetCurrentPartialUserOptions, GetCurrentUserOptions, HandlerUrlOptions, HandlerUrls, OAuthScopesOnSignIn, RedirectMethod, RedirectToOptions, ResolvedHandlerUrls, hexclaveAppInternalsSymbol, TokenStoreInit } from \"../../common\";\nimport type { RequestListener } from \"@hexclave/shared/dist/interface/client-interface\";\nimport { CustomerInvoicesList, CustomerInvoicesRequestOptions, CustomerProductsList, CustomerProductsRequestOptions, Item } from \"../../customers\";\nimport { Project } from \"../../projects\";\nimport { ProjectCurrentUser, SyncedPartialUser, TokenPartialUser } from \"../../users\";\nimport { _HexclaveClientAppImpl } from \"../implementations\";\nimport { AnalyticsOptions } from \"../implementations/session-replay\";\n\n/** @deprecated Use `HexclaveClientAppConstructorOptions` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = {\n baseUrl?: string | { browser: string, server: string },\n extraRequestHeaders?: Record<string, string>,\n projectId?: ProjectId,\n publishableClientKey?: string,\n urls?: HandlerUrlOptions,\n oauthScopesOnSignIn?: Partial<OAuthScopesOnSignIn>,\n tokenStore?: TokenStoreInit<HasTokenStore>,\n redirectMethod?: RedirectMethod,\n inheritsFrom?: StackClientApp<any, any>,\n\n /**\n * Whether to show the Hexclave dev tool indicator in browser-like environments.\n *\n * - `true`: always show\n * - `false`: never show\n * - `\"auto\"` (default): show based on NODE_ENV or origin heuristics\n */\n devTool?: boolean | \"auto\",\n\n /**\n * By default, the Stack app will automatically prefetch some data from Stack's server when this app is first\n * constructed. This improves the performance of your app, but will create network requests that are unnecessary if\n * the app is never used or disposed of immediately. To disable this behavior, set this option to true.\n */\n noAutomaticPrefetch?: boolean,\n\n /**\n * Options for analytics and session recording. Replays are enabled by default;\n * set `{ replays: { enabled: false } }` to opt out.\n */\n analytics?: AnalyticsOptions,\n} & (\n { tokenStore: TokenStoreInit<HasTokenStore> } | { tokenStore?: undefined, inheritsFrom: StackClientApp<HasTokenStore, any> }\n) & (\n string extends ProjectId ? unknown : ({ projectId: ProjectId } | { inheritsFrom: StackClientApp<any, ProjectId> })\n);\n\n\n/** @deprecated Use `HexclaveClientAppJson` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined } & {\n uniqueIdentifier: string,\n // note: if you add more fields here, make sure to ensure the checkString in the constructor has/doesn't have them\n};\n\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & {\n readonly projectId: ProjectId,\n\n /**\n * The version of the Hexclave SDK.\n */\n readonly version: string,\n\n /**\n * @deprecated Do not use `app.urls` for navigation. It is static and does not include runtime redirect-back,\n * cross-domain auth, or sign-out state. Use the matching `redirectToXyz()` method instead, for example\n * `redirectToSignIn()`, `redirectToSignUp()`, `redirectToSignOut()`, or `redirectToAccountSettings()`.\n */\n readonly urls: Readonly<ResolvedHandlerUrls>,\n\n signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise<void>,\n signInWithCredential(options: { email: string, password: string, noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"EmailPasswordMismatch\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signUpWithCredential(options: {\n email: string,\n password: string,\n noRedirect?: boolean,\n } & ({ noVerificationCallback: true } | { noVerificationCallback?: false, verificationCallbackUrl?: string })): Promise<Result<undefined, KnownErrors[\"UserWithEmailAlreadyExists\"] | KnownErrors[\"ContactChannelAlreadyUsedForAuthBySomeoneElse\"] | KnownErrors[\"PasswordRequirementsNotMet\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n signInWithPasskey(): Promise<Result<undefined, KnownErrors[\"PasskeyAuthenticationFailed\"] | KnownErrors[\"InvalidTotpCode\"] | KnownErrors[\"PasskeyWebAuthnError\"]>>,\n callOAuthCallback(): Promise<boolean>,\n promptCliLogin(options: { appUrl: string, expiresInMillis?: number, anonRefreshToken?: string, promptLink?: (url: string, loginCode: string) => void }): Promise<Result<string, KnownErrors[\"CliAuthError\"] | KnownErrors[\"CliAuthExpiredError\"] | KnownErrors[\"CliAuthUsedError\"]>>,\n sendForgotPasswordEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<undefined, KnownErrors[\"UserNotFound\"]>>,\n sendMagicLinkEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<{ nonce: string }, KnownErrors[\"RedirectUrlNotWhitelisted\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n resetPassword(options: { code: string, password: string }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyPasswordResetCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyTeamInvitationCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n acceptTeamInvitation(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n getTeamInvitationDetails(code: string): Promise<Result<{ teamDisplayName: string }, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n verifyEmail(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n signInWithMagicLink(code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signInWithMfa(otp: string, code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n\n redirectToOAuthCallback(): Promise<void>,\n\n getConvexClientAuth(options: HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }): (args: { forceRefreshToken: boolean }) => Promise<string | null>,\n getConvexHttpClientAuth(options: { tokenStore: TokenStoreInit }): Promise<string>,\n\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): ProjectCurrentUser<ProjectId>,\n useUser(options?: GetCurrentUserOptions<HasTokenStore>): ProjectCurrentUser<ProjectId> | null,\n\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options?: GetCurrentUserOptions<HasTokenStore>): Promise<ProjectCurrentUser<ProjectId> | null>,\n\n cancelSubscription(options: { productId: string, subscriptionId?: string } | { productId: string, subscriptionId?: string, teamId: string }): Promise<void>,\n\n // note: we don't special-case 'anonymous' here to return non-null, see GetPartialUserOptions for more details\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): Promise<SyncedPartialUser | TokenPartialUser | null>,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): SyncedPartialUser | TokenPartialUser | null,\n useNavigate(): (to: string) => void, // THIS_LINE_PLATFORM react-like\n\n [hexclaveAppInternalsSymbol]: {\n toClientJson(): StackClientAppJson<HasTokenStore, ProjectId>,\n setCurrentUser(userJsonPromise: Promise<CurrentUserCrud['Client']['Read'] | null>): void,\n getConstructorOptions(): StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined },\n sendSessionReplayBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n sendAnalyticsEventBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n addRequestListener(listener: RequestListener): () => void,\n sendRequest(path: string, requestOptions: RequestInit, requestType?: \"client\" | \"server\" | \"admin\"): Promise<Response>,\n getUrls(): Readonly<ResolvedHandlerUrls>,\n getRedirectMethod(): RedirectMethod,\n redirectToUrl(url: string | URL, options?: { replace?: boolean }): Promise<void>,\n getRedirectToHandlerUrl(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<string>,\n redirectToHandler(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<void>,\n signInWithTokens(tokens: { accessToken: string, refreshToken: string }): Promise<void>,\n awaitPendingAuthResolutions(): Promise<void>,\n isTrustedRedirectUrl(url: string): Promise<boolean>,\n },\n }\n & AsyncStoreProperty<\"project\", [], Project, false>\n & AsyncStoreProperty<\n \"item\",\n [{ itemId: string, userId: string } | { itemId: string, teamId: string } | { itemId: string, customCustomerId: string }],\n Item,\n false\n >\n & AsyncStoreProperty<\n \"products\",\n [options: CustomerProductsRequestOptions],\n CustomerProductsList,\n true\n >\n & AsyncStoreProperty<\n \"invoices\",\n [options: CustomerInvoicesRequestOptions],\n CustomerInvoicesList,\n true\n >\n & { [K in `redirectTo${Capitalize<keyof Omit<HandlerUrls, 'handler' | 'oauthCallback'>>}`]: (options?: RedirectToOptions) => Promise<void> }\n & AuthLike<HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }>\n);\n/** @deprecated Use `HexclaveClientAppConstructor` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructor = {\n new <\n TokenStoreType extends string,\n HasTokenStore extends (TokenStoreType extends {} ? true : boolean),\n ProjectId extends string\n >(options: StackClientAppConstructorOptions<HasTokenStore, ProjectId>): StackClientApp<HasTokenStore, ProjectId>,\n new(options: StackClientAppConstructorOptions<boolean, string>): StackClientApp<boolean, string>,\n\n [hexclaveAppInternalsSymbol]: {\n fromClientJson<HasTokenStore extends boolean, ProjectId extends string>(\n json: StackClientAppJson<HasTokenStore, ProjectId>\n ): StackClientApp<HasTokenStore, ProjectId>,\n },\n};\nexport type HexclaveClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppJson<HasTokenStore, ProjectId>;\nexport type HexclaveClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = StackClientApp<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppConstructor = StackClientAppConstructor;\nexport const HexclaveClientApp: HexclaveClientAppConstructor = _HexclaveClientAppImpl;\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport const StackClientApp: StackClientAppConstructor = HexclaveClientApp;\n"],"mappings":";;AAwLA,MAAa,yDAAkDA,CAAAA,CAAAA;;AAE/D,MAAa,iBAA4C"}
|
|
1
|
+
{"version":3,"file":"client-app.js","names":["_HexclaveClientAppImpl"],"sources":["../../../../../src/lib/hexclave-app/apps/interfaces/client-app.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownErrors } from \"@hexclave/shared\";\nimport type { RequestListener } from \"@hexclave/shared/dist/interface/client-interface\";\nimport { CurrentUserCrud } from \"@hexclave/shared/dist/interface/crud/current-user\";\nimport { Result } from \"@hexclave/shared/dist/utils/results\";\nimport { AsyncStoreProperty, AuthLike, GetCurrentPartialUserOptions, GetCurrentUserOptions, HandlerUrlOptions, HandlerUrls, hexclaveAppInternalsSymbol, OAuthScopesOnSignIn, RedirectMethod, RedirectToOptions, ResolvedHandlerUrls, TokenStoreInit } from \"../../common\";\nimport { CustomerInvoicesList, CustomerInvoicesRequestOptions, CustomerProductsList, CustomerProductsRequestOptions, Item } from \"../../customers\";\nimport { Project } from \"../../projects\";\nimport { ProjectCurrentUser, SyncedPartialUser, TokenPartialUser } from \"../../users\";\nimport { _HexclaveClientAppImpl } from \"../implementations\";\nimport { AnalyticsOptions } from \"../implementations/session-replay\";\n\n/** @deprecated Use `HexclaveClientAppConstructorOptions` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = {\n baseUrl?: string | { browser: string, server: string },\n extraRequestHeaders?: Record<string, string>,\n projectId?: ProjectId,\n publishableClientKey?: string,\n urls?: HandlerUrlOptions,\n oauthScopesOnSignIn?: Partial<OAuthScopesOnSignIn>,\n tokenStore?: TokenStoreInit<HasTokenStore>,\n redirectMethod?: RedirectMethod,\n inheritsFrom?: StackClientApp<any, any>,\n\n /**\n * Whether to show the Hexclave dev tool indicator in browser-like environments.\n *\n * - `true`: always show\n * - `false`: never show\n * - `\"auto\"` (default): show based on NODE_ENV or origin heuristics\n */\n devTool?: boolean | \"auto\",\n\n /**\n * By default, the Stack app will automatically prefetch some data from Stack's server when this app is first\n * constructed. This improves the performance of your app, but will create network requests that are unnecessary if\n * the app is never used or disposed of immediately. To disable this behavior, set this option to true.\n */\n noAutomaticPrefetch?: boolean,\n\n /**\n * Whether the constructor starts browser integrations and other automatic side effects. Defaults to `true`.\n *\n * Set this to `false` when the app is instantiated inside a custom dashboard. Explicit method calls remain\n * available and can still perform their documented side effects.\n */\n automaticSideEffects?: boolean,\n\n /**\n * Options for analytics and session recording. Replays are enabled by default;\n * set `{ replays: { enabled: false } }` to opt out.\n */\n analytics?: AnalyticsOptions,\n} & (\n { tokenStore: TokenStoreInit<HasTokenStore> } | { tokenStore?: undefined, inheritsFrom: StackClientApp<HasTokenStore, any> }\n) & (\n string extends ProjectId ? unknown : ({ projectId: ProjectId } | { inheritsFrom: StackClientApp<any, ProjectId> })\n);\n\n\n/** @deprecated Use `HexclaveClientAppJson` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined } & {\n uniqueIdentifier: string,\n // note: if you add more fields here, make sure to ensure the checkString in the constructor has/doesn't have them\n};\n\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & {\n readonly projectId: ProjectId,\n\n /**\n * The version of the Hexclave SDK.\n */\n readonly version: string,\n\n /**\n * @deprecated Do not use `app.urls` for navigation. It is static and does not include runtime redirect-back,\n * cross-domain auth, or sign-out state. Use the matching `redirectToXyz()` method instead, for example\n * `redirectToSignIn()`, `redirectToSignUp()`, `redirectToSignOut()`, or `redirectToAccountSettings()`.\n */\n readonly urls: Readonly<ResolvedHandlerUrls>,\n\n signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise<void>,\n signInWithCredential(options: { email: string, password: string, noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"EmailPasswordMismatch\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signUpWithCredential(options: {\n email: string,\n password: string,\n noRedirect?: boolean,\n } & ({ noVerificationCallback: true } | { noVerificationCallback?: false, verificationCallbackUrl?: string })): Promise<Result<undefined, KnownErrors[\"UserWithEmailAlreadyExists\"] | KnownErrors[\"ContactChannelAlreadyUsedForAuthBySomeoneElse\"] | KnownErrors[\"PasswordRequirementsNotMet\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n signInWithPasskey(): Promise<Result<undefined, KnownErrors[\"PasskeyAuthenticationFailed\"] | KnownErrors[\"InvalidTotpCode\"] | KnownErrors[\"PasskeyWebAuthnError\"]>>,\n callOAuthCallback(): Promise<boolean>,\n promptCliLogin(options: { appUrl: string, expiresInMillis?: number, anonRefreshToken?: string, promptLink?: (url: string, loginCode: string) => void }): Promise<Result<string, KnownErrors[\"CliAuthError\"] | KnownErrors[\"CliAuthExpiredError\"] | KnownErrors[\"CliAuthUsedError\"]>>,\n sendForgotPasswordEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<undefined, KnownErrors[\"UserNotFound\"]>>,\n sendMagicLinkEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<{ nonce: string }, KnownErrors[\"RedirectUrlNotWhitelisted\"] | KnownErrors[\"BotChallengeFailed\"]>>,\n resetPassword(options: { code: string, password: string }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyPasswordResetCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n verifyTeamInvitationCode(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n acceptTeamInvitation(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n getTeamInvitationDetails(code: string): Promise<Result<{ teamDisplayName: string }, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"TeamInvitationEmailMismatch\"]>>,\n verifyEmail(code: string): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"]>>,\n signInWithMagicLink(code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n signInWithMfa(otp: string, code: string, options?: { noRedirect?: boolean }): Promise<Result<undefined, KnownErrors[\"VerificationCodeError\"] | KnownErrors[\"InvalidTotpCode\"]>>,\n\n redirectToOAuthCallback(): Promise<void>,\n\n getConvexClientAuth(options: HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }): (args: { forceRefreshToken: boolean }) => Promise<string | null>,\n getConvexHttpClientAuth(options: { tokenStore: TokenStoreInit }): Promise<string>,\n\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): ProjectCurrentUser<ProjectId>,\n useUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): ProjectCurrentUser<ProjectId>,\n useUser(options?: GetCurrentUserOptions<HasTokenStore>): ProjectCurrentUser<ProjectId> | null,\n\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentUser<ProjectId>>,\n getUser(options?: GetCurrentUserOptions<HasTokenStore>): Promise<ProjectCurrentUser<ProjectId> | null>,\n\n cancelSubscription(options: { productId: string, subscriptionId?: string } | { productId: string, subscriptionId?: string, teamId: string }): Promise<void>,\n\n // note: we don't special-case 'anonymous' here to return non-null, see GetPartialUserOptions for more details\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): Promise<SyncedPartialUser | TokenPartialUser | null>,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): TokenPartialUser | null,\n usePartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): SyncedPartialUser | TokenPartialUser | null,\n useNavigate(): (to: string) => void, // THIS_LINE_PLATFORM react-like\n\n [hexclaveAppInternalsSymbol]: {\n toClientJson(): StackClientAppJson<HasTokenStore, ProjectId>,\n setCurrentUser(userJsonPromise: Promise<CurrentUserCrud['Client']['Read'] | null>): void,\n getConstructorOptions(): StackClientAppConstructorOptions<HasTokenStore, ProjectId> & { inheritsFrom?: undefined },\n sendSessionReplayBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n sendAnalyticsEventBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,\n addRequestListener(listener: RequestListener): () => void,\n sendRequest(path: string, requestOptions: RequestInit, requestType?: \"client\" | \"server\" | \"admin\"): Promise<Response>,\n getUrls(): Readonly<ResolvedHandlerUrls>,\n getRedirectMethod(): RedirectMethod,\n redirectToUrl(url: string | URL, options?: { replace?: boolean }): Promise<void>,\n getRedirectToHandlerUrl(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<string>,\n redirectToHandler(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<void>,\n /** Raw flow metadata only. Never navigate to this value without normal redirect validation. */\n getRawAfterAuthReturnTo(): string | null,\n signInWithTokens(tokens: { accessToken: string, refreshToken: string }): Promise<void>,\n awaitPendingAuthResolutions(): Promise<void>,\n isTrustedRedirectUrl(url: string): Promise<boolean>,\n },\n }\n & AsyncStoreProperty<\"project\", [], Project, false>\n & AsyncStoreProperty<\n \"item\",\n [{ itemId: string, userId: string } | { itemId: string, teamId: string } | { itemId: string, customCustomerId: string }],\n Item,\n false\n >\n & AsyncStoreProperty<\n \"products\",\n [options: CustomerProductsRequestOptions],\n CustomerProductsList,\n true\n >\n & AsyncStoreProperty<\n \"invoices\",\n [options: CustomerInvoicesRequestOptions],\n CustomerInvoicesList,\n true\n >\n & { [K in `redirectTo${Capitalize<keyof Omit<HandlerUrls, 'handler' | 'oauthCallback'>>}`]: (options?: RedirectToOptions) => Promise<void> }\n & AuthLike<HasTokenStore extends false ? { tokenStore: TokenStoreInit } : { tokenStore?: TokenStoreInit }>\n);\n/** @deprecated Use `HexclaveClientAppConstructor` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport type StackClientAppConstructor = {\n new <\n TokenStoreType extends string,\n HasTokenStore extends (TokenStoreType extends {} ? true : boolean),\n ProjectId extends string\n >(options: StackClientAppConstructorOptions<HasTokenStore, ProjectId>): StackClientApp<HasTokenStore, ProjectId>,\n new(options: StackClientAppConstructorOptions<boolean, string>): StackClientApp<boolean, string>,\n\n [hexclaveAppInternalsSymbol]: {\n fromClientJson<HasTokenStore extends boolean, ProjectId extends string>(\n json: StackClientAppJson<HasTokenStore, ProjectId>\n ): StackClientApp<HasTokenStore, ProjectId>,\n },\n};\nexport type HexclaveClientAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppJson<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppJson<HasTokenStore, ProjectId>;\nexport type HexclaveClientApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = StackClientApp<HasTokenStore, ProjectId>;\nexport type HexclaveClientAppConstructor = StackClientAppConstructor;\nexport const HexclaveClientApp: HexclaveClientAppConstructor = _HexclaveClientAppImpl;\n/** @deprecated Use `HexclaveClientApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */\nexport const StackClientApp: StackClientAppConstructor = HexclaveClientApp;\n"],"mappings":";;AAkMA,MAAa,yDAAkDA,CAAAA,CAAAA;;AAE/D,MAAa,iBAA4C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as StackServerAppConstructor, I as HexclaveServerApp, L as HexclaveServerAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, z as StackServerApp } from "../../../../client-app-
|
|
1
|
+
import { B as StackServerAppConstructor, I as HexclaveServerApp, L as HexclaveServerAppConstructor, R as HexclaveServerAppConstructorOptions, V as StackServerAppConstructorOptions, z as StackServerApp } from "../../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { HexclaveServerApp, HexclaveServerAppConstructor, HexclaveServerAppConstructorOptions, StackServerApp, StackServerAppConstructor, StackServerAppConstructorOptions };
|
|
@@ -6,7 +6,7 @@ import { a as PlanUsageRow, i as PlanUsagePlanId, n as PlanUsageKind, r as PlanU
|
|
|
6
6
|
import { a as AdminWorkflowRunState, c as AdminWorkflowStepAttempt, d as AdminWorkflowUpgradeResult, f as AdminWorkflowVersion, i as AdminWorkflowRunDetails, l as AdminWorkflowSyncResult, n as AdminWorkflowDivergenceDiagnostic, o as AdminWorkflowRunsFilter, r as AdminWorkflowRun, s as AdminWorkflowStep, t as AdminWorkflow, u as AdminWorkflowTrigger } from "../../workflows-DEb7pIuQ.js";
|
|
7
7
|
import { r as OAuthConnection, t as Connection } from "../../index-C_kxyHao.js";
|
|
8
8
|
import { i as ServerContactChannel, t as ContactChannel } from "../../index-DN04TjLM.js";
|
|
9
|
-
import { $ as TeamCreateOptions, B as StackServerAppConstructor, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, H as EditableTeamMemberProfile, I as HexclaveServerApp, J as ServerTeamCreateOptions, K as ServerListUsersOptions, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, Ot as User, P as StackAdminAppConstructor, Q as Team, R as HexclaveServerAppConstructorOptions, St as ServerUser, T as EmailOutboxListResult, U as ReceivedTeamInvitation, V as StackServerAppConstructorOptions, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, _ as AdminProjectCreateOptions, _t as OAuthProvider, a as StackClientApp, c as StackClientAppJson, d as AdminDeploymentEnvVarOptions, et as TeamInvitation, f as AdminDeploymentRunJson, ft as CurrentInternalServerUser, g as AdminProject, h as AdminOwnedProject, ht as CurrentUser, i as HexclaveClientAppJson, it as TeamUser, k as HexclaveAdminAppConstructorOptions, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, mt as CurrentServerUser, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, p as AdminDeploymentServiceBuildOptions, pt as CurrentInternalUser, q as ServerTeam, r as HexclaveClientAppConstructorOptions, rt as TeamUpdateOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, tt as TeamMemberProfile, u as AdminDeploymentEnvVarJson, ut as Auth, v as AdminProjectUpdateOptions, w as EmailOutboxListOptions, x as PushedConfigSource, xt as ServerOAuthProvider, y as Project, z as StackServerApp } from "../../client-app-
|
|
10
|
-
import { a as AdminProjectConfigUpdateOptions, i as AdminProjectConfig, n as AdminEmailConfig, o as OAuthProviderConfig, r as AdminOAuthProviderConfig, s as ProjectConfig, t as AdminDomainConfig } from "../../index-
|
|
9
|
+
import { $ as TeamCreateOptions, B as StackServerAppConstructor, D as HexclaveAdminApp, E as EmailOutboxUpdateOptions, F as StackAdminAppConstructorOptions, H as EditableTeamMemberProfile, I as HexclaveServerApp, J as ServerTeamCreateOptions, K as ServerListUsersOptions, L as HexclaveServerAppConstructor, N as StackAdminApp, O as HexclaveAdminAppConstructor, Ot as User, P as StackAdminAppConstructor, Q as Team, R as HexclaveServerAppConstructorOptions, St as ServerUser, T as EmailOutboxListResult, U as ReceivedTeamInvitation, V as StackServerAppConstructorOptions, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, _ as AdminProjectCreateOptions, _t as OAuthProvider, a as StackClientApp, c as StackClientAppJson, d as AdminDeploymentEnvVarOptions, et as TeamInvitation, f as AdminDeploymentRunJson, ft as CurrentInternalServerUser, g as AdminProject, h as AdminOwnedProject, ht as CurrentUser, i as HexclaveClientAppJson, it as TeamUser, k as HexclaveAdminAppConstructorOptions, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, mt as CurrentServerUser, n as HexclaveClientAppConstructor, o as StackClientAppConstructor, p as AdminDeploymentServiceBuildOptions, pt as CurrentInternalUser, q as ServerTeam, r as HexclaveClientAppConstructorOptions, rt as TeamUpdateOptions, s as StackClientAppConstructorOptions, t as HexclaveClientApp, tt as TeamMemberProfile, u as AdminDeploymentEnvVarJson, ut as Auth, v as AdminProjectUpdateOptions, w as EmailOutboxListOptions, x as PushedConfigSource, xt as ServerOAuthProvider, y as Project, z as StackServerApp } from "../../client-app-BCT5p_70.js";
|
|
10
|
+
import { a as AdminProjectConfigUpdateOptions, i as AdminProjectConfig, n as AdminEmailConfig, o as OAuthProviderConfig, r as AdminOAuthProviderConfig, s as ProjectConfig, t as AdminDomainConfig } from "../../index-B-MazpM_.js";
|
|
11
11
|
import { r as getPagePrompt } from "../../url-targets-CWO0mjTr.js";
|
|
12
12
|
export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentEnvVarOptions, type AdminDeploymentRunJson, type AdminDeploymentServiceBuildOptions, type AdminDeploymentServiceJson, type AdminDomainConfig, type AdminEmailConfig, type AdminEmailOutbox, type AdminEmailOutboxRecipient, type AdminEmailOutboxSimpleStatus, type AdminEmailOutboxStatus, type AdminOAuthProviderConfig, type AdminOwnedProject, type AdminProject, type AdminProjectConfig, type AdminProjectConfigUpdateOptions, type AdminProjectCreateOptions, type AdminProjectPermission, type AdminProjectPermissionDefinition, type AdminProjectPermissionDefinitionCreateOptions, type AdminProjectPermissionDefinitionUpdateOptions, type AdminProjectUpdateOptions, type AdminSendAttemptError, type AdminSentEmail, type AdminTeamPermission, type AdminTeamPermissionDefinition, type AdminTeamPermissionDefinitionCreateOptions, type AdminTeamPermissionDefinitionUpdateOptions, type AdminWorkflow, type AdminWorkflowDivergenceDiagnostic, type AdminWorkflowRun, type AdminWorkflowRunDetails, type AdminWorkflowRunState, type AdminWorkflowRunsFilter, type AdminWorkflowStep, type AdminWorkflowStepAttempt, type AdminWorkflowSyncResult, type AdminWorkflowTrigger, type AdminWorkflowUpgradeResult, type AdminWorkflowVersion, type Auth, type Connection, type ContactChannel, type CurrentInternalServerUser, type CurrentInternalUser, type CurrentServerUser, type CurrentUser, type EditableTeamMemberProfile, type EmailOutboxListOptions, type EmailOutboxListResult, type EmailOutboxUpdateOptions, type GetCurrentUserOptions, type GetCurrentUserOptions as GetUserOptions, type HandlerUrlOptions, type HandlerUrls, HexclaveAdminApp, type HexclaveAdminAppConstructor, type HexclaveAdminAppConstructorOptions, HexclaveClientApp, type HexclaveClientAppConstructor, type HexclaveClientAppConstructorOptions, type HexclaveClientAppJson, HexclaveServerApp, type HexclaveServerAppConstructor, type HexclaveServerAppConstructorOptions, type InternalApiKey, type InternalApiKeyBase, type InternalApiKeyBaseCrudRead, type InternalApiKeyCreateOptions, type InternalApiKeyFirstView, type OAuthConnection, type OAuthProvider, type OAuthProviderConfig, type OAuthScopesOnSignIn, type PlanUsage, type PlanUsageKind, type PlanUsageNextPlanId, type PlanUsagePlanId, type PlanUsageRow, type Project, type ProjectConfig, type PushedConfigSource, type ReceivedTeamInvitation, type ResolvedHandlerUrls, type SentTeamInvitation, type ServerContactChannel, type ServerListUsersOptions, type ServerOAuthProvider, type ServerTeam, type ServerTeamCreateOptions, type ServerTeamMemberProfile, type ServerTeamUpdateOptions, type ServerTeamUser, type ServerUser, StackAdminApp, type StackAdminAppConstructor, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructor, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructor, type StackServerAppConstructorOptions, type Team, type TeamCreateOptions, type TeamInvitation, type TeamMemberProfile, type TeamUpdateOptions, type TeamUser, type User, getPagePrompt, hexclaveAppInternalsSymbol };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as AdminProjectConfigUpdateOptions, i as AdminProjectConfig, n as AdminEmailConfig, o as OAuthProviderConfig, r as AdminOAuthProviderConfig, s as ProjectConfig, t as AdminDomainConfig } from "../../../index-
|
|
1
|
+
import { a as AdminProjectConfigUpdateOptions, i as AdminProjectConfig, n as AdminEmailConfig, o as OAuthProviderConfig, r as AdminOAuthProviderConfig, s as ProjectConfig, t as AdminDomainConfig } from "../../../index-B-MazpM_.js";
|
|
2
2
|
export { AdminDomainConfig, AdminEmailConfig, AdminOAuthProviderConfig, AdminProjectConfig, AdminProjectConfigUpdateOptions, OAuthProviderConfig, ProjectConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as adminProjectUpdateOptionsToCrud, S as adminProjectCreateOptionsToCrud, _ as AdminProjectCreateOptions, b as PushConfigOptions, d as AdminDeploymentEnvVarOptions, f as AdminDeploymentRunJson, g as AdminProject, h as AdminOwnedProject, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, p as AdminDeploymentServiceBuildOptions, u as AdminDeploymentEnvVarJson, v as AdminProjectUpdateOptions, x as PushedConfigSource, y as Project } from "../../../client-app-
|
|
1
|
+
import { C as adminProjectUpdateOptionsToCrud, S as adminProjectCreateOptionsToCrud, _ as AdminProjectCreateOptions, b as PushConfigOptions, d as AdminDeploymentEnvVarOptions, f as AdminDeploymentRunJson, g as AdminProject, h as AdminOwnedProject, l as AdminDeploymentDomainJson, m as AdminDeploymentServiceJson, p as AdminDeploymentServiceBuildOptions, u as AdminDeploymentEnvVarJson, v as AdminProjectUpdateOptions, x as PushedConfigSource, y as Project } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentEnvVarOptions, type AdminDeploymentRunJson, type AdminDeploymentServiceBuildOptions, type AdminDeploymentServiceJson, AdminOwnedProject, AdminProject, AdminProjectCreateOptions, AdminProjectUpdateOptions, Project, PushConfigOptions, PushedConfigSource, adminProjectCreateOptionsToCrud, adminProjectUpdateOptionsToCrud };
|
|
@@ -27,6 +27,9 @@ function adminProjectUpdateOptionsToCrud(options) {
|
|
|
27
27
|
client_secret: p.clientSecret,
|
|
28
28
|
facebook_config_id: p.facebookConfigId,
|
|
29
29
|
microsoft_tenant_id: p.microsoftTenantId,
|
|
30
|
+
apple_team_id: p.appleTeamId,
|
|
31
|
+
apple_key_id: p.appleKeyId,
|
|
32
|
+
apple_private_key: p.applePrivateKey,
|
|
30
33
|
apple_bundle_ids: p.appleBundleIds
|
|
31
34
|
}
|
|
32
35
|
})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/lib/hexclave-app/projects/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { ProductionModeError } from \"@hexclave/shared/dist/helpers/production-mode\";\nimport { AdminUserProjectsCrud, ProjectsCrud } from \"@hexclave/shared/dist/interface/crud/projects\";\nimport { ProjectOnboardingStatus } from \"@hexclave/shared/dist/schema-fields\";\n\nimport { CompleteConfig, EnvironmentConfigNormalizedOverride, EnvironmentConfigOverrideOverride } from \"@hexclave/shared/dist/config/schema\";\nimport type { AdminDeploymentDomainJson, AdminDeploymentEnvVarOptions, AdminDeploymentRunJson, AdminDeploymentServiceBuildOptions, AdminDeploymentServiceJson } from \"@hexclave/shared/dist/interface/admin-interface\";\nimport { StackAdminApp } from \"../apps/interfaces/admin-app\";\nimport { AdminProjectConfig, AdminProjectConfigUpdateOptions, ProjectConfig } from \"../project-configs\";\n\nexport type { AdminDeploymentDomainJson, AdminDeploymentEnvVarJson, AdminDeploymentEnvVarOptions, AdminDeploymentRunJson, AdminDeploymentServiceBuildOptions, AdminDeploymentServiceJson } from \"@hexclave/shared/dist/interface/admin-interface\";\n\n/**\n * SDK type for pushed config source (camelCase for SDK).\n * Represents where the branch config was pushed from.\n */\nexport type PushedConfigSource =\n | { type: \"pushed-from-github\", owner: string, repo: string, branch: string, commitHash: string, configFilePath: string, workflowPath?: string }\n | { type: \"pushed-from-unknown\" }\n | { type: \"unlinked\" };\n\nexport type PushConfigOptions = {\n /**\n * The source of this config push.\n */\n source: PushedConfigSource,\n};\n\n\nexport type Project = {\n readonly id: string,\n readonly displayName: string,\n readonly isDevelopmentEnvironment: boolean,\n readonly pushedConfigError: { message: string } | null,\n readonly configWarnings: { message: string }[],\n readonly config: ProjectConfig,\n};\n\nexport type AdminProject = {\n readonly id: string,\n readonly displayName: string,\n readonly description: string | null,\n readonly createdAt: Date,\n readonly isProductionMode: boolean,\n readonly isDevelopmentEnvironment: boolean,\n readonly ownerTeamId: string | null,\n readonly onboardingStatus: ProjectOnboardingStatus,\n readonly onboardingState: NonNullable<ProjectsCrud[\"Admin\"][\"Read\"][\"onboarding_state\"]> | null,\n readonly logoUrl: string | null | undefined,\n readonly logoFullUrl: string | null | undefined,\n readonly logoDarkModeUrl: string | null | undefined,\n readonly logoFullDarkModeUrl: string | null | undefined,\n\n readonly config: AdminProjectConfig,\n\n update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>,\n delete(this: AdminProject): Promise<void>,\n\n getConfig(this: AdminProject): Promise<CompleteConfig>,\n useConfig(this: AdminProject): CompleteConfig,\n\n /**\n * Updates the environment's config by merging the provided config into the existing config.\n *\n * Changes made with `updateConfig` always take precedence over those made with `pushConfig`, even if the `pushConfig`\n * config was pushed after the changes were made with `updateConfig`. This is best for environment-specific\n * configuration like secrets, API keys, and other values that you wouldn't push into a source repository.\n */\n // We have some strict types here in order to prevent accidental overwriting of a top-level property of a config object\n updateConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride,\n ): Promise<void>,\n\n /**\n * Pushes a config, replacing any previous config pushed with `pushConfig`.\n *\n * **Note:** This function does **not** replace any changes made with `updateConfig`. Changes made with\n * `updateConfig` always take precedence over those made with `pushConfig`, even if the `pushConfig`\n * config was pushed after the changes were made with `updateConfig`.\n *\n * This is useful for programmatically deploying configuration. More often than not, you'll want to use\n * `updateConfig` instead.\n */\n pushConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride,\n options: PushConfigOptions,\n ): Promise<void>,\n\n /**\n * Updates the pushed config by merging the provided config into the existing pushed config.\n *\n * **Warning:** This is almost always **not** the function you want to call. Changes made with\n * `updatePushedConfig` will be replaced entirely the next time `pushConfig` is called. Consider using\n * `pushConfig` to set the full pushed config, or `updateConfig` for environment-specific values that\n * should persist across pushes.\n *\n * This function is useful for making temporary modifications to the pushed config before the next push.\n */\n updatePushedConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride\n ): Promise<void>,\n\n /**\n * Gets the source metadata for the pushed config, indicating where it was pushed from.\n *\n * The source can be:\n * - `pushed-from-github`: Config was pushed from a GitHub repository\n * - `pushed-from-unknown`: Config was pushed via CLI but source details unknown\n * - `unlinked`: Config can be edited directly on the dashboard\n */\n getPushedConfigSource(this: AdminProject): Promise<PushedConfigSource>,\n\n /**\n * Unlinks the pushed config source, setting it to \"unlinked\".\n * This allows the config to be edited directly on the dashboard without external push restrictions.\n */\n unlinkPushedConfigSource(this: AdminProject): Promise<void>,\n\n /**\n * Resets (removes) specific keys from the config override at the specified level.\n * Uses the same nested key logic as the override algorithm: resetting key \"a.b\" also resets \"a.b.c\".\n *\n * This is useful when updating the pushed config (branch level) and wanting to remove the same keys\n * from the environment config override so that the branch config values take precedence.\n */\n resetConfigOverrideKeys(this: AdminProject, level: \"branch\" | \"environment\", keys: string[]): Promise<void>,\n\n /**\n * Gets the raw config override at the specified level (before merging/defaults).\n * Useful for inspecting exactly what's been set at each level.\n */\n getConfigOverride(this: AdminProject, level: \"branch\" | \"environment\"): Promise<Record<string, unknown>>,\n\n /**\n * Replaces the entire config override at the specified level.\n * For branch level, preserves the existing source metadata.\n */\n replaceConfigOverride(this: AdminProject, level: \"branch\" | \"environment\", config: Record<string, unknown>): Promise<void>,\n\n getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>,\n useProductionModeErrors(this: AdminProject): ProductionModeError[],\n\n /**\n * Lists the project's deployment services (definitions from the config,\n * merged with their operational state: deploy status, env vars, domains).\n */\n listDeploymentServices(this: AdminProject): Promise<AdminDeploymentServiceJson[]>,\n\n /**\n * Creates a new deployment service definition. Only available when the\n * project's config source is the dashboard (`unlinked`).\n */\n createDeploymentService(this: AdminProject, id: string, build: AdminDeploymentServiceBuildOptions): Promise<AdminDeploymentServiceJson>,\n\n /**\n * Updates a deployment service definition. Env vars are part of the\n * definition, so like the build fields they require the config source to be\n * the dashboard (`unlinked`); `env` replaces the service's whole env var\n * set. Secret env var VALUES are never set here — they are supplied at\n * deploy time via `hexclave deploy --secret <key>=<value>`.\n */\n updateDeploymentService(this: AdminProject, serviceId: string, update: AdminDeploymentServiceBuildOptions & {\n env?: Record<string, AdminDeploymentEnvVarOptions>,\n }): Promise<AdminDeploymentServiceJson>,\n\n /**\n * Deletes a deployment service, including its provisioned deployment target.\n * Only available when the project's config source is the dashboard.\n */\n deleteDeploymentService(this: AdminProject, serviceId: string): Promise<void>,\n\n /**\n * Lists the most recent deployment runs of a service, newest first.\n */\n listDeploymentRuns(this: AdminProject, serviceId: string, options?: { limit?: number }): Promise<AdminDeploymentRunJson[]>,\n\n /**\n * Returns the build logs of a deployment run collected so far (the server\n * follows a running build for a while before returning).\n */\n getDeploymentRunLogs(this: AdminProject, runId: string, options?: { signal?: AbortSignal }): Promise<string>,\n\n /**\n * Adds a custom domain to a deployment service.\n */\n addDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string, options?: { isPrimary?: boolean }): Promise<void>,\n\n /**\n * Returns a domain's verification state and the DNS records the user must\n * create. Poll this until `verified` is true.\n */\n getDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string): Promise<AdminDeploymentDomainJson>,\n\n /**\n * Removes a custom domain from a deployment service.\n */\n deleteDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string): Promise<void>,\n} & Project;\n\nexport type AdminOwnedProject = {\n readonly app: StackAdminApp<false>,\n} & AdminProject;\n\nexport type AdminProjectUpdateOptions = {\n displayName?: string,\n description?: string,\n isProductionMode?: boolean,\n onboardingStatus?: ProjectOnboardingStatus,\n /**\n * Updates `project.requirePublishableClientKey` in the project-level config override.\n */\n requirePublishableClientKey?: boolean,\n logoUrl?: string | null,\n logoFullUrl?: string | null,\n logoDarkModeUrl?: string | null,\n logoFullDarkModeUrl?: string | null,\n config?: AdminProjectConfigUpdateOptions,\n};\nexport function adminProjectUpdateOptionsToCrud(options: AdminProjectUpdateOptions): ProjectsCrud[\"Admin\"][\"Update\"] {\n return {\n display_name: options.displayName,\n description: options.description,\n is_production_mode: options.isProductionMode,\n onboarding_status: options.onboardingStatus,\n logo_url: options.logoUrl,\n logo_full_url: options.logoFullUrl,\n logo_dark_mode_url: options.logoDarkModeUrl,\n logo_full_dark_mode_url: options.logoFullDarkModeUrl,\n /**\n * NOTE: Do not update this config anymore. It's been superseded by the new config in schema.ts.\n * @deprecated\n */\n config: {\n domains: options.config?.domains?.map((d) => ({\n domain: d.domain,\n handler_path: d.handlerPath\n })),\n oauth_providers: options.config?.oauthProviders\n ?.filter((p): p is Exclude<typeof p, { type: 'custom_oidc' }> => p.type !== 'custom_oidc')\n .map((p) => ({\n id: p.id as any,\n type: p.type,\n ...(p.type === 'standard' && {\n client_id: p.clientId,\n client_secret: p.clientSecret,\n facebook_config_id: p.facebookConfigId,\n microsoft_tenant_id: p.microsoftTenantId,\n apple_bundle_ids: p.appleBundleIds,\n }),\n })),\n email_config: options.config?.emailConfig && (\n options.config.emailConfig.type === 'shared' ? {\n type: 'shared',\n } : {\n type: 'standard',\n host: options.config.emailConfig.host,\n port: options.config.emailConfig.port,\n username: options.config.emailConfig.username,\n password: options.config.emailConfig.password,\n sender_name: options.config.emailConfig.senderName,\n sender_email: options.config.emailConfig.senderEmail,\n }\n ),\n email_theme: options.config?.emailTheme,\n sign_up_enabled: options.config?.signUpEnabled,\n credential_enabled: options.config?.credentialEnabled,\n magic_link_enabled: options.config?.magicLinkEnabled,\n passkey_enabled: options.config?.passkeyEnabled,\n allow_localhost: options.config?.allowLocalhost,\n create_team_on_sign_up: options.config?.createTeamOnSignUp,\n client_team_creation_enabled: options.config?.clientTeamCreationEnabled,\n client_user_deletion_enabled: options.config?.clientUserDeletionEnabled,\n team_creator_default_permissions: options.config?.teamCreatorDefaultPermissions,\n team_member_default_permissions: options.config?.teamMemberDefaultPermissions,\n user_default_permissions: options.config?.userDefaultPermissions,\n oauth_account_merge_strategy: options.config?.oauthAccountMergeStrategy,\n allow_user_api_keys: options.config?.allowUserApiKeys,\n allow_team_api_keys: options.config?.allowTeamApiKeys,\n },\n };\n}\n\nexport type AdminProjectCreateOptions = Omit<AdminProjectUpdateOptions, 'displayName'> & {\n displayName: string,\n teamId: string,\n isDevelopmentEnvironment?: boolean,\n};\nexport function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud[\"Server\"][\"Create\"] {\n return {\n ...adminProjectUpdateOptionsToCrud(options),\n display_name: options.displayName,\n is_development_environment: options.isDevelopmentEnvironment,\n owner_team_id: options.teamId,\n };\n}\n"],"mappings":";;AAgOA,SAAgB,gCAAgC,SAAqE;CACnH,OAAO;EACL,cAAc,QAAQ;EACtB,aAAa,QAAQ;EACrB,oBAAoB,QAAQ;EAC5B,mBAAmB,QAAQ;EAC3B,UAAU,QAAQ;EAClB,eAAe,QAAQ;EACvB,oBAAoB,QAAQ;EAC5B,yBAAyB,QAAQ;;;;;EAKjC,QAAQ;GACN,SAAS,QAAQ,QAAQ,SAAS,KAAK,OAAO;IAC5C,QAAQ,EAAE;IACV,cAAc,EAAE;GAClB,EAAE;GACF,iBAAiB,QAAQ,QAAQ,gBAC7B,QAAQ,MAAuD,EAAE,SAAS,aAAa,CAAC,CACzF,KAAK,OAAO;IACX,IAAI,EAAE;IACN,MAAM,EAAE;IACR,GAAI,EAAE,SAAS,cAAc;KAC3B,WAAW,EAAE;KACb,eAAe,EAAE;KACjB,oBAAoB,EAAE;KACtB,qBAAqB,EAAE;KACvB,kBAAkB,EAAE;IACtB;GACF,EAAE;GACJ,cAAc,QAAQ,QAAQ,gBAC5B,QAAQ,OAAO,YAAY,SAAS,WAAW,EAC7C,MAAM,SACR,IAAI;IACF,MAAM;IACN,MAAM,QAAQ,OAAO,YAAY;IACjC,MAAM,QAAQ,OAAO,YAAY;IACjC,UAAU,QAAQ,OAAO,YAAY;IACrC,UAAU,QAAQ,OAAO,YAAY;IACrC,aAAa,QAAQ,OAAO,YAAY;IACxC,cAAc,QAAQ,OAAO,YAAY;GAC3C;GAEF,aAAa,QAAQ,QAAQ;GAC7B,iBAAiB,QAAQ,QAAQ;GACjC,oBAAoB,QAAQ,QAAQ;GACpC,oBAAoB,QAAQ,QAAQ;GACpC,iBAAiB,QAAQ,QAAQ;GACjC,iBAAiB,QAAQ,QAAQ;GACjC,wBAAwB,QAAQ,QAAQ;GACxC,8BAA8B,QAAQ,QAAQ;GAC9C,8BAA8B,QAAQ,QAAQ;GAC9C,kCAAkC,QAAQ,QAAQ;GAClD,iCAAiC,QAAQ,QAAQ;GACjD,0BAA0B,QAAQ,QAAQ;GAC1C,8BAA8B,QAAQ,QAAQ;GAC9C,qBAAqB,QAAQ,QAAQ;GACrC,qBAAqB,QAAQ,QAAQ;EACvC;CACF;AACF;AAOA,SAAgB,gCAAgC,SAA+E;CAC7H,OAAO;EACL,GAAG,gCAAgC,OAAO;EAC1C,cAAc,QAAQ;EACtB,4BAA4B,QAAQ;EACpC,eAAe,QAAQ;CACzB;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/lib/hexclave-app/projects/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { ProductionModeError } from \"@hexclave/shared/dist/helpers/production-mode\";\nimport { AdminUserProjectsCrud, ProjectsCrud } from \"@hexclave/shared/dist/interface/crud/projects\";\nimport { ProjectOnboardingStatus } from \"@hexclave/shared/dist/schema-fields\";\n\nimport { CompleteConfig, EnvironmentConfigNormalizedOverride, EnvironmentConfigOverrideOverride } from \"@hexclave/shared/dist/config/schema\";\nimport type { AdminDeploymentDomainJson, AdminDeploymentEnvVarOptions, AdminDeploymentRunJson, AdminDeploymentServiceBuildOptions, AdminDeploymentServiceJson } from \"@hexclave/shared/dist/interface/admin-interface\";\nimport { StackAdminApp } from \"../apps/interfaces/admin-app\";\nimport { AdminProjectConfig, AdminProjectConfigUpdateOptions, ProjectConfig } from \"../project-configs\";\n\nexport type { AdminDeploymentDomainJson, AdminDeploymentEnvVarJson, AdminDeploymentEnvVarOptions, AdminDeploymentRunJson, AdminDeploymentServiceBuildOptions, AdminDeploymentServiceJson } from \"@hexclave/shared/dist/interface/admin-interface\";\n\n/**\n * SDK type for pushed config source (camelCase for SDK).\n * Represents where the branch config was pushed from.\n */\nexport type PushedConfigSource =\n | { type: \"pushed-from-github\", owner: string, repo: string, branch: string, commitHash: string, configFilePath: string, workflowPath?: string }\n | { type: \"pushed-from-unknown\" }\n | { type: \"unlinked\" };\n\nexport type PushConfigOptions = {\n /**\n * The source of this config push.\n */\n source: PushedConfigSource,\n};\n\n\nexport type Project = {\n readonly id: string,\n readonly displayName: string,\n readonly isDevelopmentEnvironment: boolean,\n readonly pushedConfigError: { message: string } | null,\n readonly configWarnings: { message: string }[],\n readonly config: ProjectConfig,\n};\n\nexport type AdminProject = {\n readonly id: string,\n readonly displayName: string,\n readonly description: string | null,\n readonly createdAt: Date,\n readonly isProductionMode: boolean,\n readonly isDevelopmentEnvironment: boolean,\n readonly ownerTeamId: string | null,\n readonly onboardingStatus: ProjectOnboardingStatus,\n readonly onboardingState: NonNullable<ProjectsCrud[\"Admin\"][\"Read\"][\"onboarding_state\"]> | null,\n readonly logoUrl: string | null | undefined,\n readonly logoFullUrl: string | null | undefined,\n readonly logoDarkModeUrl: string | null | undefined,\n readonly logoFullDarkModeUrl: string | null | undefined,\n\n readonly config: AdminProjectConfig,\n\n update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>,\n delete(this: AdminProject): Promise<void>,\n\n getConfig(this: AdminProject): Promise<CompleteConfig>,\n useConfig(this: AdminProject): CompleteConfig,\n\n /**\n * Updates the environment's config by merging the provided config into the existing config.\n *\n * Changes made with `updateConfig` always take precedence over those made with `pushConfig`, even if the `pushConfig`\n * config was pushed after the changes were made with `updateConfig`. This is best for environment-specific\n * configuration like secrets, API keys, and other values that you wouldn't push into a source repository.\n */\n // We have some strict types here in order to prevent accidental overwriting of a top-level property of a config object\n updateConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride,\n ): Promise<void>,\n\n /**\n * Pushes a config, replacing any previous config pushed with `pushConfig`.\n *\n * **Note:** This function does **not** replace any changes made with `updateConfig`. Changes made with\n * `updateConfig` always take precedence over those made with `pushConfig`, even if the `pushConfig`\n * config was pushed after the changes were made with `updateConfig`.\n *\n * This is useful for programmatically deploying configuration. More often than not, you'll want to use\n * `updateConfig` instead.\n */\n pushConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride,\n options: PushConfigOptions,\n ): Promise<void>,\n\n /**\n * Updates the pushed config by merging the provided config into the existing pushed config.\n *\n * **Warning:** This is almost always **not** the function you want to call. Changes made with\n * `updatePushedConfig` will be replaced entirely the next time `pushConfig` is called. Consider using\n * `pushConfig` to set the full pushed config, or `updateConfig` for environment-specific values that\n * should persist across pushes.\n *\n * This function is useful for making temporary modifications to the pushed config before the next push.\n */\n updatePushedConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride\n ): Promise<void>,\n\n /**\n * Gets the source metadata for the pushed config, indicating where it was pushed from.\n *\n * The source can be:\n * - `pushed-from-github`: Config was pushed from a GitHub repository\n * - `pushed-from-unknown`: Config was pushed via CLI but source details unknown\n * - `unlinked`: Config can be edited directly on the dashboard\n */\n getPushedConfigSource(this: AdminProject): Promise<PushedConfigSource>,\n\n /**\n * Unlinks the pushed config source, setting it to \"unlinked\".\n * This allows the config to be edited directly on the dashboard without external push restrictions.\n */\n unlinkPushedConfigSource(this: AdminProject): Promise<void>,\n\n /**\n * Resets (removes) specific keys from the config override at the specified level.\n * Uses the same nested key logic as the override algorithm: resetting key \"a.b\" also resets \"a.b.c\".\n *\n * This is useful when updating the pushed config (branch level) and wanting to remove the same keys\n * from the environment config override so that the branch config values take precedence.\n */\n resetConfigOverrideKeys(this: AdminProject, level: \"branch\" | \"environment\", keys: string[]): Promise<void>,\n\n /**\n * Gets the raw config override at the specified level (before merging/defaults).\n * Useful for inspecting exactly what's been set at each level.\n */\n getConfigOverride(this: AdminProject, level: \"branch\" | \"environment\"): Promise<Record<string, unknown>>,\n\n /**\n * Replaces the entire config override at the specified level.\n * For branch level, preserves the existing source metadata.\n */\n replaceConfigOverride(this: AdminProject, level: \"branch\" | \"environment\", config: Record<string, unknown>): Promise<void>,\n\n getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>,\n useProductionModeErrors(this: AdminProject): ProductionModeError[],\n\n /**\n * Lists the project's deployment services (definitions from the config,\n * merged with their operational state: deploy status, env vars, domains).\n */\n listDeploymentServices(this: AdminProject): Promise<AdminDeploymentServiceJson[]>,\n\n /**\n * Creates a new deployment service definition. Only available when the\n * project's config source is the dashboard (`unlinked`).\n */\n createDeploymentService(this: AdminProject, id: string, build: AdminDeploymentServiceBuildOptions): Promise<AdminDeploymentServiceJson>,\n\n /**\n * Updates a deployment service definition. Env vars are part of the\n * definition, so like the build fields they require the config source to be\n * the dashboard (`unlinked`); `env` replaces the service's whole env var\n * set. Secret env var VALUES are never set here — they are supplied at\n * deploy time via `hexclave deploy --secret <key>=<value>`.\n */\n updateDeploymentService(this: AdminProject, serviceId: string, update: AdminDeploymentServiceBuildOptions & {\n env?: Record<string, AdminDeploymentEnvVarOptions>,\n }): Promise<AdminDeploymentServiceJson>,\n\n /**\n * Deletes a deployment service, including its provisioned deployment target.\n * Only available when the project's config source is the dashboard.\n */\n deleteDeploymentService(this: AdminProject, serviceId: string): Promise<void>,\n\n /**\n * Lists the most recent deployment runs of a service, newest first.\n */\n listDeploymentRuns(this: AdminProject, serviceId: string, options?: { limit?: number }): Promise<AdminDeploymentRunJson[]>,\n\n /**\n * Returns the build logs of a deployment run collected so far (the server\n * follows a running build for a while before returning).\n */\n getDeploymentRunLogs(this: AdminProject, runId: string, options?: { signal?: AbortSignal }): Promise<string>,\n\n /**\n * Adds a custom domain to a deployment service.\n */\n addDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string, options?: { isPrimary?: boolean }): Promise<void>,\n\n /**\n * Returns a domain's verification state and the DNS records the user must\n * create. Poll this until `verified` is true.\n */\n getDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string): Promise<AdminDeploymentDomainJson>,\n\n /**\n * Removes a custom domain from a deployment service.\n */\n deleteDeploymentServiceDomain(this: AdminProject, serviceId: string, hostname: string): Promise<void>,\n} & Project;\n\nexport type AdminOwnedProject = {\n readonly app: StackAdminApp<false>,\n} & AdminProject;\n\nexport type AdminProjectUpdateOptions = {\n displayName?: string,\n description?: string,\n isProductionMode?: boolean,\n onboardingStatus?: ProjectOnboardingStatus,\n /**\n * Updates `project.requirePublishableClientKey` in the project-level config override.\n */\n requirePublishableClientKey?: boolean,\n logoUrl?: string | null,\n logoFullUrl?: string | null,\n logoDarkModeUrl?: string | null,\n logoFullDarkModeUrl?: string | null,\n config?: AdminProjectConfigUpdateOptions,\n};\nexport function adminProjectUpdateOptionsToCrud(options: AdminProjectUpdateOptions): ProjectsCrud[\"Admin\"][\"Update\"] {\n return {\n display_name: options.displayName,\n description: options.description,\n is_production_mode: options.isProductionMode,\n onboarding_status: options.onboardingStatus,\n logo_url: options.logoUrl,\n logo_full_url: options.logoFullUrl,\n logo_dark_mode_url: options.logoDarkModeUrl,\n logo_full_dark_mode_url: options.logoFullDarkModeUrl,\n /**\n * NOTE: Do not update this config anymore. It's been superseded by the new config in schema.ts.\n * @deprecated\n */\n config: {\n domains: options.config?.domains?.map((d) => ({\n domain: d.domain,\n handler_path: d.handlerPath\n })),\n oauth_providers: options.config?.oauthProviders\n ?.filter((p): p is Exclude<typeof p, { type: 'custom_oidc' }> => p.type !== 'custom_oidc')\n .map((p) => ({\n id: p.id as any,\n type: p.type,\n ...(p.type === 'standard' && {\n client_id: p.clientId,\n client_secret: p.clientSecret,\n facebook_config_id: p.facebookConfigId,\n microsoft_tenant_id: p.microsoftTenantId,\n apple_team_id: p.appleTeamId,\n apple_key_id: p.appleKeyId,\n apple_private_key: p.applePrivateKey,\n apple_bundle_ids: p.appleBundleIds,\n }),\n })),\n email_config: options.config?.emailConfig && (\n options.config.emailConfig.type === 'shared' ? {\n type: 'shared',\n } : {\n type: 'standard',\n host: options.config.emailConfig.host,\n port: options.config.emailConfig.port,\n username: options.config.emailConfig.username,\n password: options.config.emailConfig.password,\n sender_name: options.config.emailConfig.senderName,\n sender_email: options.config.emailConfig.senderEmail,\n }\n ),\n email_theme: options.config?.emailTheme,\n sign_up_enabled: options.config?.signUpEnabled,\n credential_enabled: options.config?.credentialEnabled,\n magic_link_enabled: options.config?.magicLinkEnabled,\n passkey_enabled: options.config?.passkeyEnabled,\n allow_localhost: options.config?.allowLocalhost,\n create_team_on_sign_up: options.config?.createTeamOnSignUp,\n client_team_creation_enabled: options.config?.clientTeamCreationEnabled,\n client_user_deletion_enabled: options.config?.clientUserDeletionEnabled,\n team_creator_default_permissions: options.config?.teamCreatorDefaultPermissions,\n team_member_default_permissions: options.config?.teamMemberDefaultPermissions,\n user_default_permissions: options.config?.userDefaultPermissions,\n oauth_account_merge_strategy: options.config?.oauthAccountMergeStrategy,\n allow_user_api_keys: options.config?.allowUserApiKeys,\n allow_team_api_keys: options.config?.allowTeamApiKeys,\n },\n };\n}\n\nexport type AdminProjectCreateOptions = Omit<AdminProjectUpdateOptions, 'displayName'> & {\n displayName: string,\n teamId: string,\n isDevelopmentEnvironment?: boolean,\n};\nexport function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud[\"Server\"][\"Create\"] {\n return {\n ...adminProjectUpdateOptionsToCrud(options),\n display_name: options.displayName,\n is_development_environment: options.isDevelopmentEnvironment,\n owner_team_id: options.teamId,\n };\n}\n"],"mappings":";;AAgOA,SAAgB,gCAAgC,SAAqE;CACnH,OAAO;EACL,cAAc,QAAQ;EACtB,aAAa,QAAQ;EACrB,oBAAoB,QAAQ;EAC5B,mBAAmB,QAAQ;EAC3B,UAAU,QAAQ;EAClB,eAAe,QAAQ;EACvB,oBAAoB,QAAQ;EAC5B,yBAAyB,QAAQ;;;;;EAKjC,QAAQ;GACN,SAAS,QAAQ,QAAQ,SAAS,KAAK,OAAO;IAC5C,QAAQ,EAAE;IACV,cAAc,EAAE;GAClB,EAAE;GACF,iBAAiB,QAAQ,QAAQ,gBAC7B,QAAQ,MAAuD,EAAE,SAAS,aAAa,CAAC,CACzF,KAAK,OAAO;IACX,IAAI,EAAE;IACN,MAAM,EAAE;IACR,GAAI,EAAE,SAAS,cAAc;KAC3B,WAAW,EAAE;KACb,eAAe,EAAE;KACjB,oBAAoB,EAAE;KACtB,qBAAqB,EAAE;KACvB,eAAe,EAAE;KACjB,cAAc,EAAE;KAChB,mBAAmB,EAAE;KACrB,kBAAkB,EAAE;IACtB;GACF,EAAE;GACJ,cAAc,QAAQ,QAAQ,gBAC5B,QAAQ,OAAO,YAAY,SAAS,WAAW,EAC7C,MAAM,SACR,IAAI;IACF,MAAM;IACN,MAAM,QAAQ,OAAO,YAAY;IACjC,MAAM,QAAQ,OAAO,YAAY;IACjC,UAAU,QAAQ,OAAO,YAAY;IACrC,UAAU,QAAQ,OAAO,YAAY;IACrC,aAAa,QAAQ,OAAO,YAAY;IACxC,cAAc,QAAQ,OAAO,YAAY;GAC3C;GAEF,aAAa,QAAQ,QAAQ;GAC7B,iBAAiB,QAAQ,QAAQ;GACjC,oBAAoB,QAAQ,QAAQ;GACpC,oBAAoB,QAAQ,QAAQ;GACpC,iBAAiB,QAAQ,QAAQ;GACjC,iBAAiB,QAAQ,QAAQ;GACjC,wBAAwB,QAAQ,QAAQ;GACxC,8BAA8B,QAAQ,QAAQ;GAC9C,8BAA8B,QAAQ,QAAQ;GAC9C,kCAAkC,QAAQ,QAAQ;GAClD,iCAAiC,QAAQ,QAAQ;GACjD,0BAA0B,QAAQ,QAAQ;GAC1C,8BAA8B,QAAQ,QAAQ;GAC9C,qBAAqB,QAAQ,QAAQ;GACrC,qBAAqB,QAAQ,QAAQ;EACvC;CACF;AACF;AAOA,SAAgB,gCAAgC,SAA+E;CAC7H,OAAO;EACL,GAAG,gCAAgC,OAAO;EAC1C,cAAc,QAAQ;EACtB,4BAA4B,QAAQ;EACpC,eAAe,QAAQ;CACzB;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as TeamCreateOptions, G as ServerListTeamsOptions, H as EditableTeamMemberProfile, J as ServerTeamCreateOptions, K as ServerListUsersOptions, Q as Team, U as ReceivedTeamInvitation, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, at as serverTeamCreateOptionsToCrud, ct as teamUpdateOptionsToCrud, et as TeamInvitation, it as TeamUser, nt as TeamMemberProfileUpdateOptions, ot as serverTeamUpdateOptionsToCrud, q as ServerTeam, rt as TeamUpdateOptions, st as teamCreateOptionsToCrud, tt as TeamMemberProfile } from "../../../client-app-
|
|
1
|
+
import { $ as TeamCreateOptions, G as ServerListTeamsOptions, H as EditableTeamMemberProfile, J as ServerTeamCreateOptions, K as ServerListUsersOptions, Q as Team, U as ReceivedTeamInvitation, W as SentTeamInvitation, X as ServerTeamUpdateOptions, Y as ServerTeamMemberProfile, Z as ServerTeamUser, at as serverTeamCreateOptionsToCrud, ct as teamUpdateOptionsToCrud, et as TeamInvitation, it as TeamUser, nt as TeamMemberProfileUpdateOptions, ot as serverTeamUpdateOptionsToCrud, q as ServerTeam, rt as TeamUpdateOptions, st as teamCreateOptionsToCrud, tt as TeamMemberProfile } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { EditableTeamMemberProfile, ReceivedTeamInvitation, SentTeamInvitation, ServerListTeamsOptions, ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions, ServerTeamMemberProfile, ServerTeamUpdateOptions, ServerTeamUser, Team, TeamCreateOptions, TeamInvitation, TeamMemberProfile, TeamMemberProfileUpdateOptions, TeamUpdateOptions, TeamUser, serverTeamCreateOptionsToCrud, serverTeamUpdateOptionsToCrud, teamCreateOptionsToCrud, teamUpdateOptionsToCrud };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as UserUpdateOptions, Ct as ServerUserCreateOptions, Dt as TokenPartialUser, Et as SyncedPartialUser, Mt as serverUserUpdateOptionsToCrud, Nt as userUpdateOptionsToCrud, Ot as User, Pt as withUserDestructureGuard, St as ServerUser, Tt as SyncedPartialServerUser, _t as OAuthProvider, bt as ServerBaseUser, dt as BaseUser, ft as CurrentInternalServerUser, gt as InternalUserExtra, ht as CurrentUser, jt as serverUserCreateOptionsToCrud, kt as UserExtra, lt as ActiveSession, mt as CurrentServerUser, pt as CurrentInternalUser, ut as Auth, vt as ProjectCurrentServerUser, wt as ServerUserUpdateOptions, xt as ServerOAuthProvider, yt as ProjectCurrentUser } from "../../../client-app-
|
|
1
|
+
import { At as UserUpdateOptions, Ct as ServerUserCreateOptions, Dt as TokenPartialUser, Et as SyncedPartialUser, Mt as serverUserUpdateOptionsToCrud, Nt as userUpdateOptionsToCrud, Ot as User, Pt as withUserDestructureGuard, St as ServerUser, Tt as SyncedPartialServerUser, _t as OAuthProvider, bt as ServerBaseUser, dt as BaseUser, ft as CurrentInternalServerUser, gt as InternalUserExtra, ht as CurrentUser, jt as serverUserCreateOptionsToCrud, kt as UserExtra, lt as ActiveSession, mt as CurrentServerUser, pt as CurrentInternalUser, ut as Auth, vt as ProjectCurrentServerUser, wt as ServerUserUpdateOptions, xt as ServerOAuthProvider, yt as ProjectCurrentUser } from "../../../client-app-BCT5p_70.js";
|
|
2
2
|
export { ActiveSession, Auth, BaseUser, CurrentInternalServerUser, CurrentInternalUser, CurrentServerUser, CurrentUser, InternalUserExtra, OAuthProvider, ProjectCurrentServerUser, ProjectCurrentUser, ServerBaseUser, ServerOAuthProvider, ServerUser, ServerUserCreateOptions, ServerUserUpdateOptions, SyncedPartialServerUser, SyncedPartialUser, TokenPartialUser, User, UserExtra, UserUpdateOptions, serverUserCreateOptionsToCrud, serverUserUpdateOptionsToCrud, userUpdateOptionsToCrud, withUserDestructureGuard };
|
package/dist/lib/hooks.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useStackApp, r as useUser, t as useHexclaveApp } from "../hooks-
|
|
1
|
+
import { n as useStackApp, r as useUser, t as useHexclaveApp } from "../hooks-CUe5bc3s.js";
|
|
2
2
|
export { useHexclaveApp, useStackApp, useUser };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-callback-tCVTRbF2.d.ts","names":[],"sources":["../src/components-page/oauth-callback.tsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"oauth-callback-tCVTRbF2.d.ts","names":[],"sources":["../src/components-page/oauth-callback.tsx"],"mappings":";iBAiBgB,aAAA;EAAgB;AAAA;EAAc,QAAA;AAAA,gCAAoB,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StackClientApp, c as StackClientAppJson } from "../client-app-
|
|
1
|
+
import { a as StackClientApp, c as StackClientAppJson } from "../client-app-BCT5p_70.js";
|
|
2
2
|
import { CurrentUserCrud } from "@hexclave/shared/dist/interface/crud/current-user";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as HexclaveProvider, r as StackProvider, t as ActiveProvider } from "../hexclave-provider-
|
|
1
|
+
import { n as HexclaveProvider, r as StackProvider, t as ActiveProvider } from "../hexclave-provider-BKxi3Vy-.js";
|
|
2
2
|
export { HexclaveProvider, StackProvider, ActiveProvider as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StackClientApp } from "../client-app-
|
|
1
|
+
import { a as StackClientApp } from "../client-app-BCT5p_70.js";
|
|
2
2
|
//#region src/pushed-config-error-overlay/index.d.ts
|
|
3
3
|
declare function mountPushedConfigErrorOverlay(app: StackClientApp<true>): () => void;
|
|
4
4
|
//#endregion
|
|
@@ -28,8 +28,9 @@ declare function planRedirectToHandler(options: {
|
|
|
28
28
|
noRedirectBack: boolean;
|
|
29
29
|
currentUrl: URL | null;
|
|
30
30
|
localOAuthCallbackUrl: string;
|
|
31
|
+
rawHomeUrl: string;
|
|
31
32
|
getCrossDomainHandoffParams: (currentUrl: URL) => Promise<CrossDomainHandoffParams>;
|
|
32
33
|
}): Promise<RedirectToHandlerPlan>;
|
|
33
34
|
//#endregion
|
|
34
35
|
export { planRedirectToHandler as i, crossDomainAuthQueryParams as n, getCrossDomainHandoffParamsFromCurrentUrl as r, CrossDomainHandoffParams as t };
|
|
35
|
-
//# sourceMappingURL=redirect-page-urls-
|
|
36
|
+
//# sourceMappingURL=redirect-page-urls-BEWG0AtP.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redirect-page-urls-BEWG0AtP.d.ts","names":[],"sources":["../src/lib/hexclave-app/apps/implementations/redirect-page-urls.ts"],"mappings":";;;cAQa,0BAAA;EAAA;;;;;KAqBD,wBAAA;EACV,KAAA;EACA,aAAa;AAAA;AAAA,iBAGC,yCAAA,CAA0C,UAAA,EAAY,GAAA,GAAM,wBAAwB;AAAA,KA0K/F,qBAAA;EACC,IAAA;EAAkB,GAAA;AAAA;EAEpB,IAAA;EACA,WAAA;EACA,KAAA;EACA,aAAA;EACA,wBAAA;AAAA;AAAA,iBA4CkB,qBAAA,CAAsB,OAAA;EAC1C,WAAA,QAAmB,WAAA;EACnB,aAAA;EACA,cAAA;EACA,UAAA,EAAY,GAAA;EACZ,qBAAA;EACA,UAAA;EACA,2BAAA,GAA8B,UAAA,EAAY,GAAA,KAAQ,OAAA,CAAQ,wBAAA;AAAA,IACxD,OAAA,CAAQ,qBAAA"}
|
package/dist/utils/url.js
CHANGED
|
@@ -3,10 +3,18 @@ let _hexclave_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/er
|
|
|
3
3
|
//#region src/utils/url.ts
|
|
4
4
|
function constructRedirectUrl(redirectUrl, callbackUrlName) {
|
|
5
5
|
if (typeof window === "undefined" || !window.location) throw new _hexclave_shared_dist_utils_errors.HexclaveAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });
|
|
6
|
-
const retainedQueryParams = [
|
|
6
|
+
const retainedQueryParams = [
|
|
7
|
+
"after_auth_return_to",
|
|
8
|
+
"hexclave_cross_domain_state",
|
|
9
|
+
"hexclave_cross_domain_code_challenge",
|
|
10
|
+
"hexclave_cross_domain_after_callback_redirect_url"
|
|
11
|
+
];
|
|
7
12
|
const currentUrl = new URL(window.location.href);
|
|
8
13
|
const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);
|
|
9
|
-
for (const param of retainedQueryParams)
|
|
14
|
+
for (const param of retainedQueryParams) {
|
|
15
|
+
const value = currentUrl.searchParams.get(param);
|
|
16
|
+
if (value != null) url.searchParams.set(param, value);
|
|
17
|
+
}
|
|
10
18
|
url.hash = "";
|
|
11
19
|
return url.toString();
|
|
12
20
|
}
|
package/dist/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","names":["HexclaveAssertionError"],"sources":["../../src/utils/url.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\n\n\nexport function constructRedirectUrl(redirectUrl: URL | string | undefined, callbackUrlName: string) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window === 'undefined' || !window.location) {\n throw new HexclaveAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });\n }\n\n const retainedQueryParams = [\"after_auth_return_to\"];\n const currentUrl = new URL(window.location.href);\n const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);\n for (const param of retainedQueryParams) {\n
|
|
1
|
+
{"version":3,"file":"url.js","names":["HexclaveAssertionError"],"sources":["../../src/utils/url.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\n\n\nexport function constructRedirectUrl(redirectUrl: URL | string | undefined, callbackUrlName: string) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window === 'undefined' || !window.location) {\n throw new HexclaveAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });\n }\n\n // These parameters form one continuation. Keeping only after_auth_return_to can return to the\n // callback URL but cannot complete its cross-domain PKCE handoff after an email opens in a new\n // tab.\n const retainedQueryParams = [\n \"after_auth_return_to\",\n \"hexclave_cross_domain_state\",\n \"hexclave_cross_domain_code_challenge\",\n \"hexclave_cross_domain_after_callback_redirect_url\",\n ];\n const currentUrl = new URL(window.location.href);\n const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);\n for (const param of retainedQueryParams) {\n const value = currentUrl.searchParams.get(param);\n if (value != null) {\n url.searchParams.set(param, value);\n }\n }\n url.hash = \"\";\n return url.toString();\n}\n"],"mappings":";;;AAOA,SAAgB,qBAAqB,aAAuC,iBAAyB;CAEnG,IAAI,OAAO,WAAW,eAAe,CAAC,OAAO,UAC3C,MAAM,IAAIA,mCAAAA,uBAAuB,GAAG,gBAAgB,oDAAoD,EAAE,YAAY,CAAC;CAMzH,MAAM,sBAAsB;EAC1B;EACA;EACA;EACA;CACF;CACA,MAAM,aAAa,IAAI,IAAI,OAAO,SAAS,IAAI;CAC/C,MAAM,MAAM,cAAc,IAAI,IAAI,aAAa,OAAO,SAAS,IAAI,IAAI,IAAI,IAAI,OAAO,SAAS,IAAI;CACnG,KAAK,MAAM,SAAS,qBAAqB;EACvC,MAAM,QAAQ,WAAW,aAAa,IAAI,KAAK;EAC/C,IAAI,SAAS,MACX,IAAI,aAAa,IAAI,OAAO,KAAK;CAErC;CACA,IAAI,OAAO;CACX,OAAO,IAAI,SAAS;AACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
let vitest = require("vitest");
|
|
2
|
+
let __url_js = require("./url.js");
|
|
3
|
+
//#region src/utils/url.test.ts
|
|
4
|
+
const previousWindow = Reflect.get(globalThis, "window");
|
|
5
|
+
const hadPreviousWindow = Reflect.has(globalThis, "window");
|
|
6
|
+
(0, vitest.afterEach)(() => {
|
|
7
|
+
if (hadPreviousWindow) Reflect.set(globalThis, "window", previousWindow);
|
|
8
|
+
else Reflect.deleteProperty(globalThis, "window");
|
|
9
|
+
});
|
|
10
|
+
(0, vitest.describe)("constructRedirectUrl", () => {
|
|
11
|
+
(0, vitest.it)("transports the complete cross-domain return state to an email callback", () => {
|
|
12
|
+
const currentUrl = new URL("https://hosted.example.test/handler/forgot-password");
|
|
13
|
+
currentUrl.searchParams.set("after_auth_return_to", "https://customer.example.test/handler/oauth-callback?hexclave_cross_domain_auth=1");
|
|
14
|
+
currentUrl.searchParams.set("hexclave_cross_domain_state", "outer-state");
|
|
15
|
+
currentUrl.searchParams.set("hexclave_cross_domain_code_challenge", "outer-challenge");
|
|
16
|
+
currentUrl.searchParams.set("hexclave_cross_domain_after_callback_redirect_url", "https://customer.example.test/dashboard");
|
|
17
|
+
Reflect.set(globalThis, "window", { location: { href: currentUrl.toString() } });
|
|
18
|
+
(0, vitest.expect)(new URL((0, __url_js.constructRedirectUrl)("/handler/password-reset#discarded", "callbackUrl")).toString()).toBe("https://hosted.example.test/handler/password-reset?after_auth_return_to=https%3A%2F%2Fcustomer.example.test%2Fhandler%2Foauth-callback%3Fhexclave_cross_domain_auth%3D1&hexclave_cross_domain_state=outer-state&hexclave_cross_domain_code_challenge=outer-challenge&hexclave_cross_domain_after_callback_redirect_url=https%3A%2F%2Fcustomer.example.test%2Fdashboard");
|
|
19
|
+
});
|
|
20
|
+
(0, vitest.it)("does not synthesize the forgot-password page as a return target", () => {
|
|
21
|
+
Reflect.set(globalThis, "window", { location: { href: "https://hosted.example.test/handler/forgot-password" } });
|
|
22
|
+
(0, vitest.expect)((0, __url_js.constructRedirectUrl)("/handler/password-reset", "callbackUrl")).toBe("https://hosted.example.test/handler/password-reset");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=url.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.test.js","names":[],"sources":["../../src/utils/url.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { afterEach, describe, expect, it } from \"vitest\";\nimport { constructRedirectUrl } from \"./url\";\n\nconst previousWindow = Reflect.get(globalThis, \"window\");\nconst hadPreviousWindow = Reflect.has(globalThis, \"window\");\n\nafterEach(() => {\n if (hadPreviousWindow) {\n Reflect.set(globalThis, \"window\", previousWindow);\n } else {\n Reflect.deleteProperty(globalThis, \"window\");\n }\n});\n\ndescribe(\"constructRedirectUrl\", () => {\n it(\"transports the complete cross-domain return state to an email callback\", () => {\n const currentUrl = new URL(\"https://hosted.example.test/handler/forgot-password\");\n currentUrl.searchParams.set(\"after_auth_return_to\", \"https://customer.example.test/handler/oauth-callback?hexclave_cross_domain_auth=1\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_state\", \"outer-state\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_code_challenge\", \"outer-challenge\");\n currentUrl.searchParams.set(\"hexclave_cross_domain_after_callback_redirect_url\", \"https://customer.example.test/dashboard\");\n Reflect.set(globalThis, \"window\", {\n location: {\n href: currentUrl.toString(),\n },\n });\n\n const callbackUrl = new URL(constructRedirectUrl(\"/handler/password-reset#discarded\", \"callbackUrl\"));\n\n expect(callbackUrl.toString()).toBe(\n \"https://hosted.example.test/handler/password-reset\"\n + \"?after_auth_return_to=https%3A%2F%2Fcustomer.example.test%2Fhandler%2Foauth-callback%3Fhexclave_cross_domain_auth%3D1\"\n + \"&hexclave_cross_domain_state=outer-state\"\n + \"&hexclave_cross_domain_code_challenge=outer-challenge\"\n + \"&hexclave_cross_domain_after_callback_redirect_url=https%3A%2F%2Fcustomer.example.test%2Fdashboard\",\n );\n });\n\n it(\"does not synthesize the forgot-password page as a return target\", () => {\n Reflect.set(globalThis, \"window\", {\n location: {\n href: \"https://hosted.example.test/handler/forgot-password\",\n },\n });\n\n expect(constructRedirectUrl(\"/handler/password-reset\", \"callbackUrl\")).toBe(\n \"https://hosted.example.test/handler/password-reset\",\n );\n });\n});\n"],"mappings":";;;AAOA,MAAM,iBAAiB,QAAQ,IAAI,YAAY,QAAQ;AACvD,MAAM,oBAAoB,QAAQ,IAAI,YAAY,QAAQ;4BAE1C;CACd,IAAI,mBACF,QAAQ,IAAI,YAAY,UAAU,cAAc;MAEhD,QAAQ,eAAe,YAAY,QAAQ;AAE/C,CAAC;qBAEQ,8BAA8B;CACrC,CAAA,GAAA,OAAA,GAAA,CAAG,gFAAgF;EACjF,MAAM,aAAa,IAAI,IAAI,qDAAqD;EAChF,WAAW,aAAa,IAAI,wBAAwB,mFAAmF;EACvI,WAAW,aAAa,IAAI,+BAA+B,aAAa;EACxE,WAAW,aAAa,IAAI,wCAAwC,iBAAiB;EACrF,WAAW,aAAa,IAAI,qDAAqD,yCAAyC;EAC1H,QAAQ,IAAI,YAAY,UAAU,EAChC,UAAU,EACR,MAAM,WAAW,SAAS,EAC5B,EACF,CAAC;EAID,CAAA,GAAA,OAAA,OAAA,CAAO,IAFiB,KAAA,GAAA,SAAA,qBAAA,CAAyB,qCAAqC,aAAa,CAElF,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAC7B,wWAKF;CACF,CAAC;CAED,CAAA,GAAA,OAAA,GAAA,CAAG,yEAAyE;EAC1E,QAAQ,IAAI,YAAY,UAAU,EAChC,UAAU,EACR,MAAM,sDACR,EACF,CAAC;EAED,CAAA,GAAA,OAAA,OAAA,EAAA,GAAA,SAAA,qBAAA,CAA4B,2BAA2B,aAAa,CAAC,CAAC,CAAC,KACrE,oDACF;CACF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template (FOR package.json FILES, PLEASE EDIT package-template.json)",
|
|
3
3
|
"name": "@hexclave/next",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.74",
|
|
5
5
|
"repository": "https://github.com/hexclave/hexclave",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"tailwindcss-animate": "^1.0.7",
|
|
75
75
|
"rrweb": "^1.1.3",
|
|
76
76
|
"yup": "^1.7.1",
|
|
77
|
-
"@hexclave/sc": "1.0.
|
|
78
|
-
"@hexclave/shared": "1.0.
|
|
79
|
-
"@hexclave/ui": "1.0.
|
|
77
|
+
"@hexclave/sc": "1.0.74",
|
|
78
|
+
"@hexclave/shared": "1.0.74",
|
|
79
|
+
"@hexclave/ui": "1.0.74"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@types/react": ">=18.0.0",
|
|
@@ -12,16 +12,12 @@ import { Spinner, cn } from "@hexclave/ui";
|
|
|
12
12
|
import { useEffect, useRef, useState } from "react";
|
|
13
13
|
import { useStackApp } from "..";
|
|
14
14
|
import { MaybeFullPage } from "../components/elements/maybe-full-page";
|
|
15
|
-
import { StyledLink } from "../components/link";
|
|
16
15
|
import { hexclaveAppInternalsSymbol } from "../lib/hexclave-app/common";
|
|
17
|
-
import { useTranslation } from "../lib/translations";
|
|
18
16
|
import { ErrorPage } from "./error-page";
|
|
19
17
|
|
|
20
18
|
export function OAuthCallback({ fullPage }: { fullPage?: boolean }) {
|
|
21
|
-
const { t } = useTranslation();
|
|
22
19
|
const app = useStackApp();
|
|
23
20
|
const called = useRef(false);
|
|
24
|
-
const [showRedirectLink, setShowRedirectLink] = useState(false);
|
|
25
21
|
const [errorSearchParams, setErrorSearchParams] = useState<Record<string, string> | null>(null);
|
|
26
22
|
|
|
27
23
|
useEffect(() => runAsynchronously(async () => {
|
|
@@ -51,10 +47,6 @@ export function OAuthCallback({ fullPage }: { fullPage?: boolean }) {
|
|
|
51
47
|
}
|
|
52
48
|
}), [app]);
|
|
53
49
|
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
setTimeout(() => setShowRedirectLink(true), 3000);
|
|
56
|
-
}, []);
|
|
57
|
-
|
|
58
50
|
if (errorSearchParams != null) {
|
|
59
51
|
return <ErrorPage searchParams={errorSearchParams} fullPage={fullPage} />;
|
|
60
52
|
}
|
|
@@ -73,14 +65,6 @@ export function OAuthCallback({ fullPage }: { fullPage?: boolean }) {
|
|
|
73
65
|
<div className="flex flex-col justify-center items-center gap-4">
|
|
74
66
|
<Spinner size={20} />
|
|
75
67
|
</div>
|
|
76
|
-
{showRedirectLink ? <p>{t('If you are not redirected automatically, ')}<StyledLink
|
|
77
|
-
className="whitespace-nowrap"
|
|
78
|
-
href="#"
|
|
79
|
-
onClick={(e) => {
|
|
80
|
-
e.preventDefault();
|
|
81
|
-
runAsynchronously(app.redirectToHome());
|
|
82
|
-
}}
|
|
83
|
-
>{t("click here")}</StyledLink></p> : null}
|
|
84
68
|
</div>
|
|
85
69
|
</MaybeFullPage>
|
|
86
70
|
);
|
package/src/lib/auth.test.ts
CHANGED
|
@@ -32,7 +32,7 @@ function createTestInterface() {
|
|
|
32
32
|
|
|
33
33
|
describe("getNewOAuthProviderOrScopeUrl", () => {
|
|
34
34
|
it("returns the OAuth URL without performing navigation", async () => {
|
|
35
|
-
window.history.replaceState({}, "", "/account?after_auth_return_to=%2Fsettings");
|
|
35
|
+
window.history.replaceState({}, "", "/account?after_auth_return_to=%2Fsettings#connected-accounts");
|
|
36
36
|
|
|
37
37
|
const iface = createTestInterface();
|
|
38
38
|
const session = iface.createSession({ refreshToken: null, accessToken: null });
|
|
@@ -52,7 +52,7 @@ describe("getNewOAuthProviderOrScopeUrl", () => {
|
|
|
52
52
|
expect(`${url.origin}${url.pathname}`).toBe("https://api.example.com/api/v1/auth/oauth/authorize/github");
|
|
53
53
|
expect(Object.fromEntries(url.searchParams.entries())).toMatchInlineSnapshot(`
|
|
54
54
|
{
|
|
55
|
-
"after_callback_redirect_url": "http://localhost:3000/account?after_auth_return_to=%2Fsettings",
|
|
55
|
+
"after_callback_redirect_url": "http://localhost:3000/account?after_auth_return_to=%2Fsettings#connected-accounts",
|
|
56
56
|
"client_id": "00000000-0000-4000-8000-000000000000",
|
|
57
57
|
"client_secret": "pck_test",
|
|
58
58
|
"code_challenge": "<stripped code challenge>",
|
package/src/lib/auth.ts
CHANGED
|
@@ -24,7 +24,9 @@ export async function getNewOAuthProviderOrScopeUrl(
|
|
|
24
24
|
provider: options.provider,
|
|
25
25
|
redirectUrl: constructRedirectUrl(options.redirectUrl, "redirectUrl"),
|
|
26
26
|
errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, "errorRedirectUrl"),
|
|
27
|
-
|
|
27
|
+
// Unlike callback URLs, this is the final user-facing location and may legitimately use a
|
|
28
|
+
// fragment for an account-settings tab. Preserve it exactly.
|
|
29
|
+
afterCallbackRedirectUrl: window.location.href,
|
|
28
30
|
codeChallenge,
|
|
29
31
|
state,
|
|
30
32
|
type: "link",
|
|
@@ -233,9 +233,12 @@ export class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, Proj
|
|
|
233
233
|
id: p.id,
|
|
234
234
|
type: 'standard',
|
|
235
235
|
clientId: p.client_id ?? throwErr("Client ID is missing"),
|
|
236
|
-
clientSecret: p.client_secret ?? throwErr("Client secret is missing"),
|
|
236
|
+
clientSecret: p.id === "apple" ? p.client_secret : p.client_secret ?? throwErr("Client secret is missing"),
|
|
237
237
|
facebookConfigId: p.facebook_config_id,
|
|
238
238
|
microsoftTenantId: p.microsoft_tenant_id,
|
|
239
|
+
appleTeamId: p.apple_team_id,
|
|
240
|
+
appleKeyId: p.apple_key_id,
|
|
241
|
+
applePrivateKey: p.apple_private_key,
|
|
239
242
|
appleBundleIds: p.apple_bundle_ids,
|
|
240
243
|
} as const))),
|
|
241
244
|
emailConfig: data.config.email_config.type === 'shared' ? {
|