@hexclave/js 1.0.24 → 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/dev-tool/dev-tool-core.d.ts.map +1 -1
- package/dist/dev-tool/dev-tool-core.js +4 -68
- package/dist/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.d.ts.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.js +4 -68
- package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +6 -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 +31 -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 +18 -11
- 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/implementations/event-tracker.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js +2 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js +26 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.d.ts +7 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js +11 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.test.js +43 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.test.js.map +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 +7 -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/esm/pushed-config-error-overlay/index.d.ts +7 -0
- package/dist/esm/pushed-config-error-overlay/index.d.ts.map +1 -0
- package/dist/esm/pushed-config-error-overlay/index.js +464 -0
- package/dist/esm/pushed-config-error-overlay/index.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +6 -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 +31 -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 +18 -11
- 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/implementations/event-tracker.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.js +1 -0
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js +26 -0
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.d.ts +7 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.js +11 -0
- package/dist/lib/hexclave-app/apps/implementations/session-replay.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.test.js +43 -0
- package/dist/lib/hexclave-app/apps/implementations/session-replay.test.js.map +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 +7 -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/dist/pushed-config-error-overlay/index.d.ts +7 -0
- package/dist/pushed-config-error-overlay/index.d.ts.map +1 -0
- package/dist/pushed-config-error-overlay/index.js +466 -0
- package/dist/pushed-config-error-overlay/index.js.map +1 -0
- package/package.json +2 -2
- package/src/dev-tool/dev-tool-core.ts +5 -59
- package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +40 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +20 -11
- package/src/lib/hexclave-app/apps/implementations/event-tracker.test.ts +33 -0
- package/src/lib/hexclave-app/apps/implementations/event-tracker.ts +6 -1
- package/src/lib/hexclave-app/apps/implementations/session-replay.test.ts +52 -0
- package/src/lib/hexclave-app/apps/implementations/session-replay.ts +20 -0
- 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 +3 -0
- package/src/pushed-config-error-overlay/index.ts +548 -0
|
@@ -13,16 +13,16 @@ import { hexclaveAppInternalsSymbol } from "../../common.js";
|
|
|
13
13
|
import { adminProjectCreateOptionsToCrud } from "../../projects/index.js";
|
|
14
14
|
import { InternalSession } from "@hexclave/shared/dist/sessions";
|
|
15
15
|
import { Store, storeLock } from "@hexclave/shared/dist/utils/stores";
|
|
16
|
-
import { WebAuthnError, startAuthentication, startRegistration } from "@simplewebauthn/browser";
|
|
17
16
|
import { parseJson } from "@hexclave/shared/dist/utils/json";
|
|
18
17
|
import { DependenciesMap } from "@hexclave/shared/dist/utils/maps";
|
|
19
18
|
import { BotChallengeExecutionFailedError, BotChallengeUserCancelledError, withBotChallengeFlow } from "@hexclave/shared/dist/utils/turnstile-flow";
|
|
20
19
|
import { generateUuid } from "@hexclave/shared/dist/utils/uuids";
|
|
20
|
+
import { WebAuthnError, startAuthentication, startRegistration } from "@simplewebauthn/browser";
|
|
21
21
|
import * as cookie from "cookie";
|
|
22
|
+
import { envVars } from "../../../../generated/env.js";
|
|
22
23
|
import { constructRedirectUrl } from "../../../../utils/url.js";
|
|
23
24
|
import { callOAuthCallback, getNewOAuthProviderOrScopeUrl } from "../../../auth.js";
|
|
24
25
|
import { createCookieHelper, createPlaceholderCookieHelper, deleteCookie, deleteCookieClient, getCookieClient, isSecure, saveVerifierAndState, setOrDeleteCookie, setOrDeleteCookieClient } from "../../../cookie.js";
|
|
25
|
-
import { envVars } from "../../../../generated/env.js";
|
|
26
26
|
import { apiKeyCreationOptionsToCrud } from "../../api-keys/index.js";
|
|
27
27
|
import { contactChannelCreateOptionsToCrud, contactChannelUpdateOptionsToCrud } from "../../contact-channels/index.js";
|
|
28
28
|
import { teamCreateOptionsToCrud, teamUpdateOptionsToCrud } from "../../teams/index.js";
|
|
@@ -33,6 +33,7 @@ import { crossDomainAuthQueryParams, getCrossDomainHandoffParamsFromCurrentUrl,
|
|
|
33
33
|
import { SessionRecorder, analyticsOptionsFromJson, analyticsOptionsToJson, getSessionReplayOptions } from "./session-replay.js";
|
|
34
34
|
import { mountClickmapOverlay } from "../../../../clickmap/index.js";
|
|
35
35
|
import { mountDevTool } from "../../../../dev-tool/index.js";
|
|
36
|
+
import { mountPushedConfigErrorOverlay } from "../../../../pushed-config-error-overlay/index.js";
|
|
36
37
|
|
|
37
38
|
//#region src/lib/hexclave-app/apps/implementations/client-app-impl.ts
|
|
38
39
|
const prefetchedCrossDomainHandoffTtlMs = 3300 * 1e3;
|
|
@@ -133,7 +134,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
133
134
|
const location = await getNewOAuthProviderOrScopeUrl(this._interface, {
|
|
134
135
|
provider: options.providerId,
|
|
135
136
|
redirectUrl: this._getOAuthCallbackRedirectUri(),
|
|
136
|
-
errorRedirectUrl: this.
|
|
137
|
+
errorRedirectUrl: this._getUrls().error,
|
|
137
138
|
providerScope: mergeScopeStrings(options.scope || "", (this._oauthScopesOnSignIn[options.providerId] ?? []).join(" "))
|
|
138
139
|
}, options.session);
|
|
139
140
|
await this._redirectTo({ url: location });
|
|
@@ -244,7 +245,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
244
245
|
const location = await getNewOAuthProviderOrScopeUrl(this._interface, {
|
|
245
246
|
provider,
|
|
246
247
|
redirectUrl: this._getOAuthCallbackRedirectUri(),
|
|
247
|
-
errorRedirectUrl: this.
|
|
248
|
+
errorRedirectUrl: this._getUrls().error,
|
|
248
249
|
providerScope: mergeScopeStrings(scopeString, (this._oauthScopesOnSignIn[provider] ?? []).join(" "))
|
|
249
250
|
}, session);
|
|
250
251
|
await this._redirectTo({ url: location });
|
|
@@ -427,7 +428,10 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
427
428
|
});
|
|
428
429
|
}
|
|
429
430
|
if (isBrowserLike() && resolvedOptions.devTool !== false) mountDevTool(this, resolvedOptions.devTool);
|
|
430
|
-
if (isBrowserLike())
|
|
431
|
+
if (isBrowserLike()) {
|
|
432
|
+
mountClickmapOverlay(this);
|
|
433
|
+
mountPushedConfigErrorOverlay(this);
|
|
434
|
+
}
|
|
431
435
|
}
|
|
432
436
|
_initUniqueIdentifier() {
|
|
433
437
|
if (!this._uniqueIdentifier) throw new HexclaveAssertionError("Unique identifier not initialized");
|
|
@@ -484,7 +488,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
484
488
|
return currentUrl.searchParams.has("code") && currentUrl.searchParams.has("state") && currentUrl.searchParams.has(nestedCrossDomainAuthQueryParams.refreshTokenId);
|
|
485
489
|
}
|
|
486
490
|
_getOAuthCallbackRedirectUri() {
|
|
487
|
-
if (!this._isOAuthCallbackUrlHosted()) return this.
|
|
491
|
+
if (!this._isOAuthCallbackUrlHosted()) return this._getUrls().oauthCallback;
|
|
488
492
|
if (typeof window === "undefined") throw new HexclaveAssertionError("Hosted OAuth callback URLs require a browser environment to use the current URL as the redirect URI");
|
|
489
493
|
const currentUrl = new URL(window.location.href);
|
|
490
494
|
for (const param of oauthCallbackResponseQueryParams) currentUrl.searchParams.delete(param);
|
|
@@ -1004,6 +1008,8 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
1004
1008
|
return {
|
|
1005
1009
|
id: crud.id,
|
|
1006
1010
|
displayName: crud.display_name,
|
|
1011
|
+
pushedConfigError: crud.pushed_config_error == null ? null : { message: crud.pushed_config_error.message },
|
|
1012
|
+
configWarnings: crud.config_warnings.map((warning) => ({ message: warning.message })),
|
|
1007
1013
|
config: {
|
|
1008
1014
|
signUpEnabled: crud.config.sign_up_enabled,
|
|
1009
1015
|
credentialEnabled: crud.config.credential_enabled,
|
|
@@ -1988,10 +1994,10 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
1988
1994
|
return await this._redirectToHandler("mfa", options);
|
|
1989
1995
|
}
|
|
1990
1996
|
async sendForgotPasswordEmail(email, options) {
|
|
1991
|
-
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this.
|
|
1997
|
+
return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this._getUrls().passwordReset, "callbackUrl"));
|
|
1992
1998
|
}
|
|
1993
1999
|
async sendMagicLinkEmail(email, options) {
|
|
1994
|
-
const callbackUrl = options?.callbackUrl ?? constructRedirectUrl(this.
|
|
2000
|
+
const callbackUrl = options?.callbackUrl ?? constructRedirectUrl(this._getUrls().magicLinkCallback, "callbackUrl");
|
|
1995
2001
|
return await this._executeResultWithBotChallengeFlow({
|
|
1996
2002
|
action: "send_magic_link_email",
|
|
1997
2003
|
execute: async (challenge) => {
|
|
@@ -2131,7 +2137,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2131
2137
|
return await this._interface.authorizeOAuth({
|
|
2132
2138
|
provider,
|
|
2133
2139
|
redirectUrl: constructRedirectUrl(this._getOAuthCallbackRedirectUri(), "redirectUrl"),
|
|
2134
|
-
errorRedirectUrl: constructRedirectUrl(this.
|
|
2140
|
+
errorRedirectUrl: constructRedirectUrl(this._getUrls().error, "errorRedirectUrl"),
|
|
2135
2141
|
afterCallbackRedirectUrl,
|
|
2136
2142
|
type: "authenticate",
|
|
2137
2143
|
providerScope: this._oauthScopesOnSignIn[provider]?.join(" "),
|
|
@@ -2204,7 +2210,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2204
2210
|
if (options.noVerificationCallback && options.verificationCallbackUrl) throw new HexclaveAssertionError("verificationCallbackUrl is not allowed when noVerificationCallback is true");
|
|
2205
2211
|
this._ensurePersistentTokenStore();
|
|
2206
2212
|
const session = await this._getSession();
|
|
2207
|
-
const emailVerificationRedirectUrl = options.noVerificationCallback ? void 0 : options.verificationCallbackUrl ?? constructRedirectUrl(this.
|
|
2213
|
+
const emailVerificationRedirectUrl = options.noVerificationCallback ? void 0 : options.verificationCallbackUrl ?? constructRedirectUrl(this._getUrls().emailVerification, "verificationCallbackUrl");
|
|
2208
2214
|
const executeSignUp = async (challenge) => {
|
|
2209
2215
|
let result = await this._interface.signUpWithCredential(options.email, options.password, emailVerificationRedirectUrl, session, this._toInterfaceBotChallengeInput(challenge));
|
|
2210
2216
|
if (result.status === "error" && result.error instanceof KnownErrors.RedirectUrlNotWhitelisted && emailVerificationRedirectUrl !== void 0) {
|
|
@@ -2298,7 +2304,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2298
2304
|
const pollingCode = initResult.polling_code;
|
|
2299
2305
|
const loginCode = initResult.login_code;
|
|
2300
2306
|
const url = buildCliAuthConfirmUrl({
|
|
2301
|
-
cliAuthConfirmUrl: this.
|
|
2307
|
+
cliAuthConfirmUrl: this._getUrls().cliAuthConfirm,
|
|
2302
2308
|
appUrl: options.appUrl,
|
|
2303
2309
|
loginCode
|
|
2304
2310
|
});
|
|
@@ -2567,6 +2573,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
2567
2573
|
sendRequest: async (path, requestOptions, requestType = "client") => {
|
|
2568
2574
|
return await this._interface.sendClientRequest(path, requestOptions, await this._getSession(), requestType);
|
|
2569
2575
|
},
|
|
2576
|
+
getUrls: () => this._getUrls(),
|
|
2570
2577
|
getRedirectMethod: () => this._redirectMethod ?? throwErr("Redirect method should have been initialized in the Stack client app constructor"),
|
|
2571
2578
|
redirectToUrl: async (url, options) => {
|
|
2572
2579
|
await this._redirectTo({
|