@hexclave/tanstack-start 1.0.25 → 1.0.26
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/components-page/hexclave-handler-client.js +6 -5
- package/dist/components-page/hexclave-handler-client.js.map +1 -1
- package/dist/dev-tool/dev-tool-core.js +1 -1
- package/dist/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/components-page/hexclave-handler-client.js +6 -5
- package/dist/esm/components-page/hexclave-handler-client.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.js +1 -1
- package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/generated/quetzal-translations.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +7 -0
- 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 +33 -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.d.ts +1 -0
- 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 +9 -8
- 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 +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts +2 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -0
- 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/index.d.ts +2 -1
- package/dist/esm/lib/hexclave-app/plan-usage/index.d.ts +27 -0
- package/dist/esm/lib/hexclave-app/plan-usage/index.d.ts.map +1 -0
- package/dist/esm/lib/hexclave-app/plan-usage/index.js +1 -0
- package/dist/esm/lib/hexclave-app/projects/index.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/projects/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.js.map +1 -1
- package/dist/generated/quetzal-translations.d.ts +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +7 -0
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js +33 -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.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +9 -8
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts +2 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/hexclave-app/index.d.ts +2 -1
- package/dist/lib/hexclave-app/plan-usage/index.d.ts +27 -0
- package/dist/lib/hexclave-app/plan-usage/index.d.ts.map +1 -0
- package/dist/lib/hexclave-app/plan-usage/index.js +0 -0
- package/dist/lib/hexclave-app/projects/index.d.ts +1 -0
- package/dist/lib/hexclave-app/projects/index.d.ts.map +1 -1
- package/dist/lib/hexclave-app/projects/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components-page/hexclave-handler-client.tsx +6 -5
- package/src/dev-tool/dev-tool-core.ts +1 -1
- package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +38 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +9 -8
- package/src/lib/hexclave-app/apps/interfaces/admin-app.ts +2 -0
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +1 -0
- package/src/lib/hexclave-app/index.ts +8 -0
- package/src/lib/hexclave-app/plan-usage/index.ts +29 -0
- package/src/lib/hexclave-app/projects/index.ts +1 -0
|
@@ -357,7 +357,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
357
357
|
{
|
|
358
358
|
provider,
|
|
359
359
|
redirectUrl: this._getOAuthCallbackRedirectUri(),
|
|
360
|
-
errorRedirectUrl: this.
|
|
360
|
+
errorRedirectUrl: this._getUrls().error,
|
|
361
361
|
providerScope: mergeScopeStrings(scopeString, (this._oauthScopesOnSignIn[provider as ProviderType] ?? []).join(" ")),
|
|
362
362
|
},
|
|
363
363
|
session,
|
|
@@ -560,7 +560,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
560
560
|
{
|
|
561
561
|
provider: options.providerId,
|
|
562
562
|
redirectUrl: this._getOAuthCallbackRedirectUri(),
|
|
563
|
-
errorRedirectUrl: this.
|
|
563
|
+
errorRedirectUrl: this._getUrls().error,
|
|
564
564
|
providerScope: mergeScopeStrings(options.scope || "", (this._oauthScopesOnSignIn[options.providerId] ?? []).join(" ")),
|
|
565
565
|
},
|
|
566
566
|
options.session,
|
|
@@ -865,7 +865,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
865
865
|
|
|
866
866
|
protected _getOAuthCallbackRedirectUri(): string {
|
|
867
867
|
if (!this._isOAuthCallbackUrlHosted()) {
|
|
868
|
-
return this.
|
|
868
|
+
return this._getUrls().oauthCallback;
|
|
869
869
|
}
|
|
870
870
|
if (typeof window === "undefined") {
|
|
871
871
|
throw new HexclaveAssertionError("Hosted OAuth callback URLs require a browser environment to use the current URL as the redirect URI");
|
|
@@ -3038,13 +3038,13 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3038
3038
|
async redirectToMfa(options?: RedirectToOptions) { return await this._redirectToHandler("mfa", options); }
|
|
3039
3039
|
|
|
3040
3040
|
async sendForgotPasswordEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<undefined, KnownErrors["UserNotFound"]>> {
|
|
3041
|
-
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this.
|
|
3041
|
+
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this._getUrls().passwordReset, "callbackUrl"));
|
|
3042
3042
|
}
|
|
3043
3043
|
|
|
3044
3044
|
async sendMagicLinkEmail(email: string, options?: {
|
|
3045
3045
|
callbackUrl?: string,
|
|
3046
3046
|
}): Promise<Result<{ nonce: string }, KnownErrors["RedirectUrlNotWhitelisted"] | KnownErrors["BotChallengeFailed"]>> {
|
|
3047
|
-
const callbackUrl = options?.callbackUrl ?? constructRedirectUrl(this.
|
|
3047
|
+
const callbackUrl = options?.callbackUrl ?? constructRedirectUrl(this._getUrls().magicLinkCallback, "callbackUrl");
|
|
3048
3048
|
return await this._executeResultWithBotChallengeFlow({
|
|
3049
3049
|
action: "send_magic_link_email",
|
|
3050
3050
|
execute: async (challenge) => {
|
|
@@ -3333,7 +3333,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3333
3333
|
return await this._interface.authorizeOAuth({
|
|
3334
3334
|
provider,
|
|
3335
3335
|
redirectUrl: constructRedirectUrl(this._getOAuthCallbackRedirectUri(), "redirectUrl"),
|
|
3336
|
-
errorRedirectUrl: constructRedirectUrl(this.
|
|
3336
|
+
errorRedirectUrl: constructRedirectUrl(this._getUrls().error, "errorRedirectUrl"),
|
|
3337
3337
|
afterCallbackRedirectUrl,
|
|
3338
3338
|
type: "authenticate",
|
|
3339
3339
|
providerScope: this._oauthScopesOnSignIn[provider]?.join(" "),
|
|
@@ -3453,7 +3453,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3453
3453
|
}
|
|
3454
3454
|
this._ensurePersistentTokenStore();
|
|
3455
3455
|
const session = await this._getSession();
|
|
3456
|
-
const emailVerificationRedirectUrl = options.noVerificationCallback ? undefined : options.verificationCallbackUrl ?? constructRedirectUrl(this.
|
|
3456
|
+
const emailVerificationRedirectUrl = options.noVerificationCallback ? undefined : options.verificationCallbackUrl ?? constructRedirectUrl(this._getUrls().emailVerification, "verificationCallbackUrl");
|
|
3457
3457
|
|
|
3458
3458
|
const executeSignUp = async (challenge: { token?: string, phase?: "invisible" | "visible", unavailable?: true }) => {
|
|
3459
3459
|
let result = await this._interface.signUpWithCredential(
|
|
@@ -3616,7 +3616,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3616
3616
|
|
|
3617
3617
|
// Step 2: Open the browser for the user to authenticate and display the verification code
|
|
3618
3618
|
const url = buildCliAuthConfirmUrl({
|
|
3619
|
-
cliAuthConfirmUrl: this.
|
|
3619
|
+
cliAuthConfirmUrl: this._getUrls().cliAuthConfirm,
|
|
3620
3620
|
appUrl: options.appUrl,
|
|
3621
3621
|
loginCode,
|
|
3622
3622
|
});
|
|
@@ -4054,6 +4054,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
4054
4054
|
) => {
|
|
4055
4055
|
return await this._interface.sendClientRequest(path, requestOptions, await this._getSession(), requestType);
|
|
4056
4056
|
},
|
|
4057
|
+
getUrls: () => this._getUrls(),
|
|
4057
4058
|
getRedirectMethod: () => this._redirectMethod ?? throwErr("Redirect method should have been initialized in the Stack client app constructor"),
|
|
4058
4059
|
redirectToUrl: async (url: string | URL, options?: { replace?: boolean }) => {
|
|
4059
4060
|
await this._redirectTo({ url, ...options });
|
|
@@ -13,6 +13,7 @@ import { AsyncStoreProperty, EmailConfig } from "../../common";
|
|
|
13
13
|
import { AdminEmailOutbox, AdminSentEmail } from "../../email";
|
|
14
14
|
import { InternalApiKey, InternalApiKeyCreateOptions, InternalApiKeyFirstView } from "../../internal-api-keys";
|
|
15
15
|
import { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions } from "../../permissions";
|
|
16
|
+
import type { PlanUsage } from "../../plan-usage";
|
|
16
17
|
import { AdminProject } from "../../projects";
|
|
17
18
|
import { _HexclaveAdminAppImpl } from "../implementations";
|
|
18
19
|
import { StackServerApp, StackServerAppConstructorOptions } from "./server-app";
|
|
@@ -75,6 +76,7 @@ export type StackAdminAppConstructorOptions<HasTokenStore extends boolean, Proje
|
|
|
75
76
|
/** @deprecated Use `HexclaveAdminApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */
|
|
76
77
|
export type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (
|
|
77
78
|
& AsyncStoreProperty<"project", [], AdminProject, false>
|
|
79
|
+
& AsyncStoreProperty<"planUsage", [], PlanUsage, false>
|
|
78
80
|
& AsyncStoreProperty<"internalApiKeys", [], InternalApiKey[], true>
|
|
79
81
|
& AsyncStoreProperty<"teamPermissionDefinitions", [], AdminTeamPermissionDefinition[], true>
|
|
80
82
|
& AsyncStoreProperty<"projectPermissionDefinitions", [], AdminProjectPermissionDefinition[], true>
|
|
@@ -131,6 +131,7 @@ export type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId ex
|
|
|
131
131
|
sendAnalyticsEventBatch(body: string, options: { keepalive: boolean }): Promise<Result<Response, Error>>,
|
|
132
132
|
addRequestListener(listener: RequestListener): () => void,
|
|
133
133
|
sendRequest(path: string, requestOptions: RequestInit, requestType?: "client" | "server" | "admin"): Promise<Response>,
|
|
134
|
+
getUrls(): Readonly<ResolvedHandlerUrls>,
|
|
134
135
|
getRedirectMethod(): RedirectMethod,
|
|
135
136
|
redirectToUrl(url: string | URL, options?: { replace?: boolean }): Promise<void>,
|
|
136
137
|
redirectToHandler(handlerName: keyof HandlerUrls, options?: RedirectToOptions): Promise<void>,
|
|
@@ -118,6 +118,14 @@ export type {
|
|
|
118
118
|
PushedConfigSource
|
|
119
119
|
} from "./projects";
|
|
120
120
|
|
|
121
|
+
export type {
|
|
122
|
+
PlanUsage,
|
|
123
|
+
PlanUsageKind,
|
|
124
|
+
PlanUsageNextPlanId,
|
|
125
|
+
PlanUsagePlanId,
|
|
126
|
+
PlanUsageRow,
|
|
127
|
+
} from "./plan-usage";
|
|
128
|
+
|
|
121
129
|
export type {
|
|
122
130
|
EditableTeamMemberProfile, ReceivedTeamInvitation,
|
|
123
131
|
SentTeamInvitation, ServerListUsersOptions,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
//===========================================
|
|
3
|
+
// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template
|
|
4
|
+
//===========================================
|
|
5
|
+
export type PlanUsageKind = "current" | "metered" | "capability";
|
|
6
|
+
export type PlanUsagePlanId = "free" | "team" | "growth";
|
|
7
|
+
export type PlanUsageNextPlanId = "team" | "growth";
|
|
8
|
+
|
|
9
|
+
export type PlanUsageRow = {
|
|
10
|
+
itemId: string,
|
|
11
|
+
displayName: string,
|
|
12
|
+
kind: PlanUsageKind,
|
|
13
|
+
used: number | null,
|
|
14
|
+
limit: number | null,
|
|
15
|
+
remaining: number | null,
|
|
16
|
+
overage: number | null,
|
|
17
|
+
isUnlimited: boolean,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type PlanUsage = {
|
|
21
|
+
ownerTeamId: string,
|
|
22
|
+
ownerTeamDisplayName: string,
|
|
23
|
+
planId: PlanUsagePlanId,
|
|
24
|
+
planDisplayName: string,
|
|
25
|
+
periodStart: Date,
|
|
26
|
+
periodEnd: Date,
|
|
27
|
+
nextPlanId: PlanUsageNextPlanId | null,
|
|
28
|
+
rows: PlanUsageRow[],
|
|
29
|
+
};
|
|
@@ -44,6 +44,7 @@ export type AdminProject = {
|
|
|
44
44
|
readonly isDevelopmentEnvironment: boolean,
|
|
45
45
|
readonly ownerTeamId: string | null,
|
|
46
46
|
readonly onboardingStatus: ProjectOnboardingStatus,
|
|
47
|
+
readonly onboardingState: NonNullable<ProjectsCrud["Admin"]["Read"]["onboarding_state"]> | null,
|
|
47
48
|
readonly logoUrl: string | null | undefined,
|
|
48
49
|
readonly logoFullUrl: string | null | undefined,
|
|
49
50
|
readonly logoDarkModeUrl: string | null | undefined,
|