@hexclave/next 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 +5 -4
- 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 +5 -4
- 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 +4 -4
- package/src/components-page/hexclave-handler-client.tsx +5 -4
- 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
|
@@ -355,7 +355,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
355
355
|
{
|
|
356
356
|
provider,
|
|
357
357
|
redirectUrl: this._getOAuthCallbackRedirectUri(),
|
|
358
|
-
errorRedirectUrl: this.
|
|
358
|
+
errorRedirectUrl: this._getUrls().error,
|
|
359
359
|
providerScope: mergeScopeStrings(scopeString, (this._oauthScopesOnSignIn[provider as ProviderType] ?? []).join(" ")),
|
|
360
360
|
},
|
|
361
361
|
session,
|
|
@@ -558,7 +558,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
558
558
|
{
|
|
559
559
|
provider: options.providerId,
|
|
560
560
|
redirectUrl: this._getOAuthCallbackRedirectUri(),
|
|
561
|
-
errorRedirectUrl: this.
|
|
561
|
+
errorRedirectUrl: this._getUrls().error,
|
|
562
562
|
providerScope: mergeScopeStrings(options.scope || "", (this._oauthScopesOnSignIn[options.providerId] ?? []).join(" ")),
|
|
563
563
|
},
|
|
564
564
|
options.session,
|
|
@@ -864,7 +864,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
864
864
|
|
|
865
865
|
protected _getOAuthCallbackRedirectUri(): string {
|
|
866
866
|
if (!this._isOAuthCallbackUrlHosted()) {
|
|
867
|
-
return this.
|
|
867
|
+
return this._getUrls().oauthCallback;
|
|
868
868
|
}
|
|
869
869
|
if (typeof window === "undefined") {
|
|
870
870
|
throw new HexclaveAssertionError("Hosted OAuth callback URLs require a browser environment to use the current URL as the redirect URI");
|
|
@@ -3024,13 +3024,13 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3024
3024
|
async redirectToMfa(options?: RedirectToOptions) { return await this._redirectToHandler("mfa", options); }
|
|
3025
3025
|
|
|
3026
3026
|
async sendForgotPasswordEmail(email: string, options?: { callbackUrl?: string }): Promise<Result<undefined, KnownErrors["UserNotFound"]>> {
|
|
3027
|
-
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this.
|
|
3027
|
+
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this._getUrls().passwordReset, "callbackUrl"));
|
|
3028
3028
|
}
|
|
3029
3029
|
|
|
3030
3030
|
async sendMagicLinkEmail(email: string, options?: {
|
|
3031
3031
|
callbackUrl?: string,
|
|
3032
3032
|
}): Promise<Result<{ nonce: string }, KnownErrors["RedirectUrlNotWhitelisted"] | KnownErrors["BotChallengeFailed"]>> {
|
|
3033
|
-
const callbackUrl = options?.callbackUrl ?? constructRedirectUrl(this.
|
|
3033
|
+
const callbackUrl = options?.callbackUrl ?? constructRedirectUrl(this._getUrls().magicLinkCallback, "callbackUrl");
|
|
3034
3034
|
return await this._executeResultWithBotChallengeFlow({
|
|
3035
3035
|
action: "send_magic_link_email",
|
|
3036
3036
|
execute: async (challenge) => {
|
|
@@ -3319,7 +3319,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3319
3319
|
return await this._interface.authorizeOAuth({
|
|
3320
3320
|
provider,
|
|
3321
3321
|
redirectUrl: constructRedirectUrl(this._getOAuthCallbackRedirectUri(), "redirectUrl"),
|
|
3322
|
-
errorRedirectUrl: constructRedirectUrl(this.
|
|
3322
|
+
errorRedirectUrl: constructRedirectUrl(this._getUrls().error, "errorRedirectUrl"),
|
|
3323
3323
|
afterCallbackRedirectUrl,
|
|
3324
3324
|
type: "authenticate",
|
|
3325
3325
|
providerScope: this._oauthScopesOnSignIn[provider]?.join(" "),
|
|
@@ -3439,7 +3439,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3439
3439
|
}
|
|
3440
3440
|
this._ensurePersistentTokenStore();
|
|
3441
3441
|
const session = await this._getSession();
|
|
3442
|
-
const emailVerificationRedirectUrl = options.noVerificationCallback ? undefined : options.verificationCallbackUrl ?? constructRedirectUrl(this.
|
|
3442
|
+
const emailVerificationRedirectUrl = options.noVerificationCallback ? undefined : options.verificationCallbackUrl ?? constructRedirectUrl(this._getUrls().emailVerification, "verificationCallbackUrl");
|
|
3443
3443
|
|
|
3444
3444
|
const executeSignUp = async (challenge: { token?: string, phase?: "invisible" | "visible", unavailable?: true }) => {
|
|
3445
3445
|
let result = await this._interface.signUpWithCredential(
|
|
@@ -3602,7 +3602,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
3602
3602
|
|
|
3603
3603
|
// Step 2: Open the browser for the user to authenticate and display the verification code
|
|
3604
3604
|
const url = buildCliAuthConfirmUrl({
|
|
3605
|
-
cliAuthConfirmUrl: this.
|
|
3605
|
+
cliAuthConfirmUrl: this._getUrls().cliAuthConfirm,
|
|
3606
3606
|
appUrl: options.appUrl,
|
|
3607
3607
|
loginCode,
|
|
3608
3608
|
});
|
|
@@ -4040,6 +4040,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
4040
4040
|
) => {
|
|
4041
4041
|
return await this._interface.sendClientRequest(path, requestOptions, await this._getSession(), requestType);
|
|
4042
4042
|
},
|
|
4043
|
+
getUrls: () => this._getUrls(),
|
|
4043
4044
|
getRedirectMethod: () => this._redirectMethod ?? throwErr("Redirect method should have been initialized in the Stack client app constructor"),
|
|
4044
4045
|
redirectToUrl: async (url: string | URL, options?: { replace?: boolean }) => {
|
|
4045
4046
|
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,
|