@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.
Files changed (95) hide show
  1. package/dist/dev-tool/dev-tool-core.d.ts.map +1 -1
  2. package/dist/dev-tool/dev-tool-core.js +4 -68
  3. package/dist/dev-tool/dev-tool-core.js.map +1 -1
  4. package/dist/esm/dev-tool/dev-tool-core.d.ts.map +1 -1
  5. package/dist/esm/dev-tool/dev-tool-core.js +4 -68
  6. package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
  7. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +6 -0
  8. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  9. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js +31 -1
  10. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
  11. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -0
  12. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
  13. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +18 -11
  14. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
  15. package/dist/esm/lib/hexclave-app/apps/implementations/common.js +1 -1
  16. package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.d.ts.map +1 -1
  17. package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js +2 -1
  18. package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -1
  19. package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js +26 -0
  20. package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -1
  21. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.d.ts +7 -1
  22. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.d.ts.map +1 -1
  23. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js +11 -1
  24. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js.map +1 -1
  25. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.test.js +43 -0
  26. package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.test.js.map +1 -1
  27. package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts +2 -1
  28. package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -1
  29. package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -1
  30. package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -0
  31. package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
  32. package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
  33. package/dist/esm/lib/hexclave-app/index.d.ts +2 -1
  34. package/dist/esm/lib/hexclave-app/plan-usage/index.d.ts +27 -0
  35. package/dist/esm/lib/hexclave-app/plan-usage/index.d.ts.map +1 -0
  36. package/dist/esm/lib/hexclave-app/plan-usage/index.js +1 -0
  37. package/dist/esm/lib/hexclave-app/projects/index.d.ts +7 -0
  38. package/dist/esm/lib/hexclave-app/projects/index.d.ts.map +1 -1
  39. package/dist/esm/lib/hexclave-app/projects/index.js.map +1 -1
  40. package/dist/esm/pushed-config-error-overlay/index.d.ts +7 -0
  41. package/dist/esm/pushed-config-error-overlay/index.d.ts.map +1 -0
  42. package/dist/esm/pushed-config-error-overlay/index.js +464 -0
  43. package/dist/esm/pushed-config-error-overlay/index.js.map +1 -0
  44. package/dist/index.d.ts +2 -1
  45. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +6 -0
  46. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  47. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js +31 -1
  48. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
  49. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -0
  50. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
  51. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +18 -11
  52. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
  53. package/dist/lib/hexclave-app/apps/implementations/common.js +1 -1
  54. package/dist/lib/hexclave-app/apps/implementations/event-tracker.d.ts.map +1 -1
  55. package/dist/lib/hexclave-app/apps/implementations/event-tracker.js +1 -0
  56. package/dist/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -1
  57. package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js +26 -0
  58. package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -1
  59. package/dist/lib/hexclave-app/apps/implementations/session-replay.d.ts +7 -1
  60. package/dist/lib/hexclave-app/apps/implementations/session-replay.d.ts.map +1 -1
  61. package/dist/lib/hexclave-app/apps/implementations/session-replay.js +11 -0
  62. package/dist/lib/hexclave-app/apps/implementations/session-replay.js.map +1 -1
  63. package/dist/lib/hexclave-app/apps/implementations/session-replay.test.js +43 -0
  64. package/dist/lib/hexclave-app/apps/implementations/session-replay.test.js.map +1 -1
  65. package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts +2 -1
  66. package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -1
  67. package/dist/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -1
  68. package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -0
  69. package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
  70. package/dist/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
  71. package/dist/lib/hexclave-app/index.d.ts +2 -1
  72. package/dist/lib/hexclave-app/plan-usage/index.d.ts +27 -0
  73. package/dist/lib/hexclave-app/plan-usage/index.d.ts.map +1 -0
  74. package/dist/lib/hexclave-app/plan-usage/index.js +0 -0
  75. package/dist/lib/hexclave-app/projects/index.d.ts +7 -0
  76. package/dist/lib/hexclave-app/projects/index.d.ts.map +1 -1
  77. package/dist/lib/hexclave-app/projects/index.js.map +1 -1
  78. package/dist/pushed-config-error-overlay/index.d.ts +7 -0
  79. package/dist/pushed-config-error-overlay/index.d.ts.map +1 -0
  80. package/dist/pushed-config-error-overlay/index.js +466 -0
  81. package/dist/pushed-config-error-overlay/index.js.map +1 -0
  82. package/package.json +2 -2
  83. package/src/dev-tool/dev-tool-core.ts +5 -59
  84. package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +40 -1
  85. package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +20 -11
  86. package/src/lib/hexclave-app/apps/implementations/event-tracker.test.ts +33 -0
  87. package/src/lib/hexclave-app/apps/implementations/event-tracker.ts +6 -1
  88. package/src/lib/hexclave-app/apps/implementations/session-replay.test.ts +52 -0
  89. package/src/lib/hexclave-app/apps/implementations/session-replay.ts +20 -0
  90. package/src/lib/hexclave-app/apps/interfaces/admin-app.ts +2 -0
  91. package/src/lib/hexclave-app/apps/interfaces/client-app.ts +1 -0
  92. package/src/lib/hexclave-app/index.ts +8 -0
  93. package/src/lib/hexclave-app/plan-usage/index.ts +29 -0
  94. package/src/lib/hexclave-app/projects/index.ts +3 -0
  95. 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.urls.error,
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.urls.error,
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()) mountClickmapOverlay(this);
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.urls.oauthCallback;
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.urls.passwordReset, "callbackUrl"));
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.urls.magicLinkCallback, "callbackUrl");
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.urls.error, "errorRedirectUrl"),
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.urls.emailVerification, "verificationCallbackUrl");
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.urls.cliAuthConfirm,
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({