@hexclave/next 1.0.125 → 1.0.126
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-Bxad6t8m.d.ts → admin-app-impl-CjDjJ3PS.d.ts} +29 -13
- package/dist/admin-app-impl-CjDjJ3PS.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-B0cTytS5.d.ts → client-app-jAjrgwSh.d.ts} +34 -6
- package/dist/client-app-jAjrgwSh.d.ts.map +1 -0
- package/dist/{common-B2gkWlXX.d.ts → common-BjAI7WW6.d.ts} +15 -3
- package/dist/common-BjAI7WW6.d.ts.map +1 -0
- package/dist/{common-BK_sydxF.d.ts → common-DWfeER0s.d.ts} +2 -2
- package/dist/{common-BK_sydxF.d.ts.map → common-DWfeER0s.d.ts.map} +1 -1
- package/dist/components/message-cards/predefined-message-card.js +4 -2
- package/dist/components/message-cards/predefined-message-card.js.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/user-button.js +9 -9
- package/dist/components/user-button.js.map +1 -1
- package/dist/components/user-button.test.d.ts +1 -0
- package/dist/components/user-button.test.js +71 -0
- package/dist/components/user-button.test.js.map +1 -0
- package/dist/components-page/account-settings/payments/payments-page.d.ts +1 -1
- package/dist/components-page/account-settings/payments/payments-panel.d.ts +1 -1
- package/dist/components-page/account-settings/settings/sign-out-section.d.ts +1 -1
- package/dist/components-page/account-settings/settings/sign-out-section.d.ts.map +1 -1
- package/dist/components-page/account-settings/settings/sign-out-section.js +4 -1
- package/dist/components-page/account-settings/settings/sign-out-section.js.map +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/onboarding.js +15 -13
- package/dist/components-page/onboarding.js.map +1 -1
- package/dist/components-page/onboarding.test.js +2 -1
- package/dist/components-page/onboarding.test.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/message-cards/predefined-message-card.js +4 -2
- package/dist/esm/components/message-cards/predefined-message-card.js.map +1 -1
- package/dist/esm/components/user-button.js +9 -9
- package/dist/esm/components/user-button.js.map +1 -1
- package/dist/esm/components/user-button.test.d.ts +1 -0
- package/dist/esm/components/user-button.test.js +70 -0
- package/dist/esm/components/user-button.test.js.map +1 -0
- package/dist/esm/components-page/account-settings/settings/sign-out-section.d.ts +1 -1
- package/dist/esm/components-page/account-settings/settings/sign-out-section.d.ts.map +1 -1
- package/dist/esm/components-page/account-settings/settings/sign-out-section.js +4 -1
- package/dist/esm/components-page/account-settings/settings/sign-out-section.js.map +1 -1
- package/dist/esm/components-page/onboarding.js +15 -13
- package/dist/esm/components-page/onboarding.js.map +1 -1
- package/dist/esm/components-page/onboarding.test.js +2 -1
- package/dist/esm/components-page/onboarding.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +4 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +18 -2
- 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.external-token-store.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.external-token-store.test.js +382 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.external-token-store.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.js +66 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +66 -14
- 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/external-token-store-session-adapter.d.ts +31 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.d.ts.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.js +115 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +16 -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/common.d.ts +14 -2
- package/dist/esm/lib/hexclave-app/common.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/common.js +17 -1
- package/dist/esm/lib/hexclave-app/common.js.map +1 -1
- package/dist/esm/lib/hexclave-app/index.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/index.js +2 -2
- package/dist/esm/lib/hexclave-app/users/index.d.ts +14 -1
- package/dist/esm/lib/hexclave-app/users/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/users/index.js.map +1 -1
- package/dist/{hexclave-provider-w8nX8KDv.d.ts → hexclave-provider-Br8j6WHN.d.ts} +2 -2
- package/dist/{hexclave-provider-w8nX8KDv.d.ts.map → hexclave-provider-Br8j6WHN.d.ts.map} +1 -1
- package/dist/{hooks-nqzRtl9S.d.ts → hooks-DyC8t1Sh.d.ts} +3 -3
- package/dist/{hooks-nqzRtl9S.d.ts.map → hooks-DyC8t1Sh.d.ts.map} +1 -1
- package/dist/{index-DbiyXho6.d.ts → index-CQ4kC6Cu.d.ts} +2 -2
- package/dist/{index-DbiyXho6.d.ts.map → index-CQ4kC6Cu.d.ts.map} +1 -1
- package/dist/{index-BDzsJvkD.d.ts → index-CWaynElx.d.ts} +3 -3
- package/dist/{index-BDzsJvkD.d.ts.map → index-CWaynElx.d.ts.map} +1 -1
- package/dist/{index-BSr2pd22.d.ts → index-FsS-NA9c.d.ts} +2 -2
- package/dist/{index-BSr2pd22.d.ts.map → index-FsS-NA9c.d.ts.map} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +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.external-token-store.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.external-token-store.test.js +381 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.external-token-store.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.js +65 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +65 -13
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.d.ts +31 -0
- package/dist/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.d.ts.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.js +117 -0
- package/dist/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts +1 -1
- 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/common.d.ts +2 -2
- package/dist/lib/hexclave-app/common.js +19 -0
- package/dist/lib/hexclave-app/common.js.map +1 -1
- package/dist/lib/hexclave-app/customers/index.d.ts +1 -1
- package/dist/lib/hexclave-app/data-vault/index.d.ts +1 -1
- package/dist/lib/hexclave-app/index.d.ts +4 -4
- package/dist/lib/hexclave-app/index.js +18 -0
- package/dist/lib/hexclave-app/projects/index.d.ts +1 -1
- package/dist/lib/hexclave-app/teams/index.d.ts +1 -1
- package/dist/lib/hexclave-app/url-targets.d.ts +1 -1
- package/dist/lib/hexclave-app/users/index.d.ts +1 -1
- package/dist/lib/hexclave-app/users/index.js.map +1 -1
- package/dist/lib/hooks.d.ts +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-ofcg3AYr.d.ts → redirect-page-urls-CnGvn0UJ.d.ts} +2 -2
- package/dist/{redirect-page-urls-ofcg3AYr.d.ts.map → redirect-page-urls-CnGvn0UJ.d.ts.map} +1 -1
- package/dist/tanstack-start-server-context.d.ts.map +1 -1
- package/dist/{url-targets-CWO0mjTr.d.ts → url-targets-DbhzuQtY.d.ts} +2 -2
- package/dist/{url-targets-CWO0mjTr.d.ts.map → url-targets-DbhzuQtY.d.ts.map} +1 -1
- package/package.json +4 -4
- package/src/components/message-cards/predefined-message-card.tsx +4 -2
- package/src/components/user-button.test.tsx +87 -0
- package/src/components/user-button.tsx +9 -9
- package/src/components-page/account-settings/settings/sign-out-section.tsx +9 -1
- package/src/components-page/onboarding.test.tsx +1 -0
- package/src/components-page/onboarding.tsx +16 -13
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.external-token-store.test.ts +425 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.init-analytics.test.ts +79 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +124 -13
- package/src/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.ts +190 -0
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +17 -0
- package/src/lib/hexclave-app/common.ts +33 -0
- package/src/lib/hexclave-app/index.ts +4 -0
- package/src/lib/hexclave-app/users/index.ts +13 -1
- package/dist/admin-app-impl-Bxad6t8m.d.ts.map +0 -1
- package/dist/client-app-B0cTytS5.d.ts.map +0 -1
- package/dist/common-B2gkWlXX.d.ts.map +0 -1
|
@@ -15,8 +15,8 @@ import { envVars } from "../../../../generated/env.js";
|
|
|
15
15
|
import { suspendIfSsr } from "../../../../utils/react.js";
|
|
16
16
|
import { resolveHandlerUrls } from "../../url-targets.js";
|
|
17
17
|
//#region src/lib/hexclave-app/apps/implementations/common.ts
|
|
18
|
-
const clientVersion = "js @hexclave/next@1.0.
|
|
19
|
-
if ("js @hexclave/next@1.0.
|
|
18
|
+
const clientVersion = "js @hexclave/next@1.0.126";
|
|
19
|
+
if ("js @hexclave/next@1.0.126".startsWith("STACK_COMPILE_TIME"));
|
|
20
20
|
const replaceHexclavePortPrefix = (input) => {
|
|
21
21
|
if (!input) return input;
|
|
22
22
|
const prefix = envVars.HEXCLAVE_PORT_PREFIX;
|
package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TokenObject } from "./common.js";
|
|
2
|
+
import { ExternalTokenStore } from "../../common.js";
|
|
3
|
+
import { AccessToken, InternalSession } from "@hexclave/shared/dist/sessions";
|
|
4
|
+
import { Store } from "@hexclave/shared/dist/utils/stores";
|
|
5
|
+
import { ExternalAuthProviderId } from "@hexclave/shared/dist/interface/external-auth";
|
|
6
|
+
|
|
7
|
+
//#region src/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.d.ts
|
|
8
|
+
type SessionOptions = {
|
|
9
|
+
refreshToken: string | null;
|
|
10
|
+
accessToken?: string | null;
|
|
11
|
+
sessionKey?: string;
|
|
12
|
+
refreshAccessTokenWithoutRefreshTokenCallback?: () => Promise<AccessToken | null>;
|
|
13
|
+
};
|
|
14
|
+
declare function isExternalTokenStore(value: object): value is ExternalTokenStore;
|
|
15
|
+
declare class ExternalTokenStoreSessionAdapter {
|
|
16
|
+
private readonly createSession;
|
|
17
|
+
private readonly exchangeToken;
|
|
18
|
+
private readonly storesByExternalTokenStore;
|
|
19
|
+
private readonly externalTokenStoresByStore;
|
|
20
|
+
private readonly externalTokenStoresBySession;
|
|
21
|
+
private readonly states;
|
|
22
|
+
constructor(createSession: (options: SessionOptions) => InternalSession, exchangeToken: (providerId: ExternalAuthProviderId, token: string) => Promise<string>);
|
|
23
|
+
getOrCreateTokenStore(externalTokenStore: ExternalTokenStore, onProviderChange: (store: Store<TokenObject>, previousSessionKey: string) => void): Store<TokenObject>;
|
|
24
|
+
getSessionKey(tokenStore: Store<TokenObject>, tokenObject: TokenObject): string;
|
|
25
|
+
private buildSessionKey;
|
|
26
|
+
createSessionForTokenStore(tokenStore: Store<TokenObject>, tokenObject: TokenObject, sessionKey: string): InternalSession;
|
|
27
|
+
getExternalTokenStoreForSession(session: InternalSession): ExternalTokenStore | undefined;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ExternalTokenStoreSessionAdapter, isExternalTokenStore };
|
|
31
|
+
//# sourceMappingURL=external-token-store-session-adapter.d.ts.map
|
package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-token-store-session-adapter.d.ts","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.ts"],"mappings":";;;;;;;KAiBK,cAAA;EACH,YAAA;EACA,WAAA;EACA,UAAA;EACA,6CAAA,SAAsD,OAAO,CAAC,WAAA;AAAA;AAAA,iBAGhD,oBAAA,CAAqB,KAAA,WAAgB,KAAA,IAAS,kBAAkB;AAAA,cAInE,gCAAA;EAAA,iBAOQ,aAAA;EAAA,iBACA,aAAA;EAAA,iBAPF,0BAAA;EAAA,iBACA,0BAAA;EAAA,iBACA,4BAAA;EAAA,iBACA,MAAA;cAGE,aAAA,GAAgB,OAAA,EAAS,cAAA,KAAmB,eAAA,EAC5C,aAAA,GAAgB,UAAA,EAAY,sBAAA,EAAwB,KAAA,aAAkB,OAAA;EAGzF,qBAAA,CACE,kBAAA,EAAoB,kBAAA,EACpB,gBAAA,GAAmB,KAAA,EAAO,KAAA,CAAM,WAAA,GAAc,kBAAA,oBAC7C,KAAA,CAAM,WAAA;EA8BT,aAAA,CAAc,UAAA,EAAY,KAAA,CAAM,WAAA,GAAc,WAAA,EAAa,WAAA;EAAA,QAenD,eAAA;EASR,0BAAA,CACE,UAAA,EAAY,KAAA,CAAM,WAAA,GAClB,WAAA,EAAa,WAAA,EACb,UAAA,WACC,eAAA;EAsFH,+BAAA,CAAgC,OAAA,EAAS,eAAA,GAAkB,kBAAA;AAAA"}
|
package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { throwErr } from "@hexclave/shared/dist/utils/errors";
|
|
2
|
+
import { KnownErrors } from "@hexclave/shared";
|
|
3
|
+
import { createEmptyTokenStore } from "./common.js";
|
|
4
|
+
import { AccessToken, InternalSession } from "@hexclave/shared/dist/sessions";
|
|
5
|
+
//#region src/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.ts
|
|
6
|
+
function isExternalTokenStore(value) {
|
|
7
|
+
return "type" in value && value.type === "external";
|
|
8
|
+
}
|
|
9
|
+
var ExternalTokenStoreSessionAdapter = class {
|
|
10
|
+
constructor(createSession, exchangeToken) {
|
|
11
|
+
this.createSession = createSession;
|
|
12
|
+
this.exchangeToken = exchangeToken;
|
|
13
|
+
this.storesByExternalTokenStore = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
this.externalTokenStoresByStore = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
this.externalTokenStoresBySession = /* @__PURE__ */ new WeakMap();
|
|
16
|
+
this.states = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
}
|
|
18
|
+
getOrCreateTokenStore(externalTokenStore, onProviderChange) {
|
|
19
|
+
const existing = this.storesByExternalTokenStore.get(externalTokenStore);
|
|
20
|
+
if (existing != null) return existing;
|
|
21
|
+
const store = createEmptyTokenStore();
|
|
22
|
+
this.storesByExternalTokenStore.set(externalTokenStore, store);
|
|
23
|
+
this.externalTokenStoresByStore.set(store, externalTokenStore);
|
|
24
|
+
this.states.set(externalTokenStore, {
|
|
25
|
+
generation: 0,
|
|
26
|
+
providerSessionId: externalTokenStore.getSessionId?.()
|
|
27
|
+
});
|
|
28
|
+
externalTokenStore.subscribe?.(() => {
|
|
29
|
+
const state = this.states.get(externalTokenStore) ?? throwErr("External token store state was not initialized");
|
|
30
|
+
const previousSessionKey = this.buildSessionKey(externalTokenStore, state);
|
|
31
|
+
const providerSessionId = externalTokenStore.getSessionId?.();
|
|
32
|
+
if (externalTokenStore.getSessionId == null || providerSessionId !== state.providerSessionId) {
|
|
33
|
+
state.generation += 1;
|
|
34
|
+
state.providerSessionId = providerSessionId;
|
|
35
|
+
}
|
|
36
|
+
onProviderChange(store, previousSessionKey);
|
|
37
|
+
store.set({
|
|
38
|
+
accessToken: null,
|
|
39
|
+
refreshToken: null
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
return store;
|
|
43
|
+
}
|
|
44
|
+
getSessionKey(tokenStore, tokenObject) {
|
|
45
|
+
const externalTokenStore = this.externalTokenStoresByStore.get(tokenStore);
|
|
46
|
+
if (externalTokenStore == null) return InternalSession.calculateSessionKey(tokenObject);
|
|
47
|
+
const state = this.states.get(externalTokenStore) ?? throwErr("External token store state was not initialized");
|
|
48
|
+
return this.buildSessionKey(externalTokenStore, {
|
|
49
|
+
generation: state.generation,
|
|
50
|
+
providerSessionId: externalTokenStore.getSessionId?.()
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
buildSessionKey(externalTokenStore, state) {
|
|
54
|
+
if (externalTokenStore.getSessionId == null) return `external-${externalTokenStore.providerId}-${state.generation}`;
|
|
55
|
+
return state.providerSessionId == null ? "not-logged-in" : `external-${externalTokenStore.providerId}-${state.providerSessionId}`;
|
|
56
|
+
}
|
|
57
|
+
createSessionForTokenStore(tokenStore, tokenObject, sessionKey) {
|
|
58
|
+
const externalTokenStore = this.externalTokenStoresByStore.get(tokenStore);
|
|
59
|
+
let session;
|
|
60
|
+
if (externalTokenStore == null) session = this.createSession({
|
|
61
|
+
refreshToken: tokenObject.refreshToken,
|
|
62
|
+
accessToken: tokenObject.accessToken
|
|
63
|
+
});
|
|
64
|
+
else if (sessionKey === "not-logged-in") session = this.createSession({
|
|
65
|
+
refreshToken: null,
|
|
66
|
+
accessToken: null,
|
|
67
|
+
sessionKey
|
|
68
|
+
});
|
|
69
|
+
else session = this.createSession({
|
|
70
|
+
refreshToken: null,
|
|
71
|
+
accessToken: tokenObject.accessToken,
|
|
72
|
+
sessionKey,
|
|
73
|
+
refreshAccessTokenWithoutRefreshTokenCallback: async () => {
|
|
74
|
+
const state = this.states.get(externalTokenStore) ?? throwErr("External token store state was not initialized");
|
|
75
|
+
const expectedGeneration = state.generation;
|
|
76
|
+
const assertSessionIdentityUnchanged = () => {
|
|
77
|
+
const liveSessionKey = this.buildSessionKey(externalTokenStore, {
|
|
78
|
+
generation: state.generation,
|
|
79
|
+
providerSessionId: externalTokenStore.getSessionId?.()
|
|
80
|
+
});
|
|
81
|
+
if (state.generation !== expectedGeneration || liveSessionKey !== sessionKey) throw new Error("The external provider session changed while exchanging a token; retrying with the current provider session.");
|
|
82
|
+
};
|
|
83
|
+
const attemptExchange = async (isRetry) => {
|
|
84
|
+
assertSessionIdentityUnchanged();
|
|
85
|
+
const externalToken = await externalTokenStore.getToken();
|
|
86
|
+
assertSessionIdentityUnchanged();
|
|
87
|
+
if (externalToken == null) {
|
|
88
|
+
if (externalTokenStore.getSessionId?.() != null) throw new Error("The external token store returned no token even though it reports an active provider session. This is usually transient (eg. the provider SDK is still initializing) and the exchange will be retried on the next request.");
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const accessToken = await this.exchangeToken(externalTokenStore.providerId, externalToken);
|
|
93
|
+
const validatedAccessToken = AccessToken.createIfValid(accessToken) ?? throwErr("External authentication exchange returned an invalid Hexclave access token");
|
|
94
|
+
assertSessionIdentityUnchanged();
|
|
95
|
+
return validatedAccessToken;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
if (!KnownErrors.InvalidExternalAuthToken.isInstance(error)) throw error;
|
|
98
|
+
if (isRetry) throw error;
|
|
99
|
+
return await attemptExchange(true);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return await attemptExchange(false);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (externalTokenStore != null) this.externalTokenStoresBySession.set(session, externalTokenStore);
|
|
106
|
+
return session;
|
|
107
|
+
}
|
|
108
|
+
getExternalTokenStoreForSession(session) {
|
|
109
|
+
return this.externalTokenStoresBySession.get(session);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { ExternalTokenStoreSessionAdapter, isExternalTokenStore };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=external-token-store-session-adapter.js.map
|
package/dist/esm/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-token-store-session-adapter.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/external-token-store-session-adapter.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 { ExternalAuthProviderId } from \"@hexclave/shared/dist/interface/external-auth\";\nimport { AccessToken, InternalSession } from \"@hexclave/shared/dist/sessions\";\nimport { throwErr } from \"@hexclave/shared/dist/utils/errors\";\nimport { Store } from \"@hexclave/shared/dist/utils/stores\";\nimport type { ExternalTokenStore } from \"../../common\";\nimport { createEmptyTokenStore, type TokenObject } from \"./common\";\n\ntype ExternalTokenStoreState = {\n generation: number,\n providerSessionId: string | null | undefined,\n};\n\ntype SessionOptions = {\n refreshToken: string | null,\n accessToken?: string | null,\n sessionKey?: string,\n refreshAccessTokenWithoutRefreshTokenCallback?: () => Promise<AccessToken | null>,\n};\n\nexport function isExternalTokenStore(value: object): value is ExternalTokenStore {\n return \"type\" in value && value.type === \"external\";\n}\n\nexport class ExternalTokenStoreSessionAdapter {\n private readonly storesByExternalTokenStore = new WeakMap<ExternalTokenStore, Store<TokenObject>>();\n private readonly externalTokenStoresByStore = new WeakMap<Store<TokenObject>, ExternalTokenStore>();\n private readonly externalTokenStoresBySession = new WeakMap<InternalSession, ExternalTokenStore>();\n private readonly states = new WeakMap<ExternalTokenStore, ExternalTokenStoreState>();\n\n constructor(\n private readonly createSession: (options: SessionOptions) => InternalSession,\n private readonly exchangeToken: (providerId: ExternalAuthProviderId, token: string) => Promise<string>,\n ) {}\n\n getOrCreateTokenStore(\n externalTokenStore: ExternalTokenStore,\n onProviderChange: (store: Store<TokenObject>, previousSessionKey: string) => void,\n ): Store<TokenObject> {\n const existing = this.storesByExternalTokenStore.get(externalTokenStore);\n if (existing != null) {\n return existing;\n }\n\n const store = createEmptyTokenStore();\n this.storesByExternalTokenStore.set(externalTokenStore, store);\n this.externalTokenStoresByStore.set(store, externalTokenStore);\n this.states.set(externalTokenStore, {\n generation: 0,\n providerSessionId: externalTokenStore.getSessionId?.(),\n });\n externalTokenStore.subscribe?.(() => {\n const state = this.states.get(externalTokenStore) ?? throwErr(\"External token store state was not initialized\");\n // Derive the previous session's key from the recorded state, not from a live getSessionId()\n // read: by the time this notification fires, the provider has already switched sessions, so a\n // live read would compute the *new* key and the expiry hint would target the wrong session.\n const previousSessionKey = this.buildSessionKey(externalTokenStore, state);\n const providerSessionId = externalTokenStore.getSessionId?.();\n if (externalTokenStore.getSessionId == null || providerSessionId !== state.providerSessionId) {\n state.generation += 1;\n state.providerSessionId = providerSessionId;\n }\n onProviderChange(store, previousSessionKey);\n store.set({ accessToken: null, refreshToken: null });\n });\n return store;\n }\n\n getSessionKey(tokenStore: Store<TokenObject>, tokenObject: TokenObject): string {\n const externalTokenStore = this.externalTokenStoresByStore.get(tokenStore);\n if (externalTokenStore == null) {\n return InternalSession.calculateSessionKey(tokenObject);\n }\n\n const state = this.states.get(externalTokenStore) ?? throwErr(\"External token store state was not initialized\");\n // Read the provider session id live (instead of from state) so a session switch is reflected\n // immediately, even before the store's subscribe notification has fired.\n return this.buildSessionKey(externalTokenStore, {\n generation: state.generation,\n providerSessionId: externalTokenStore.getSessionId?.(),\n });\n }\n\n private buildSessionKey(externalTokenStore: ExternalTokenStore, state: ExternalTokenStoreState): string {\n if (externalTokenStore.getSessionId == null) {\n return `external-${externalTokenStore.providerId}-${state.generation}`;\n }\n return state.providerSessionId == null\n ? \"not-logged-in\"\n : `external-${externalTokenStore.providerId}-${state.providerSessionId}`;\n }\n\n createSessionForTokenStore(\n tokenStore: Store<TokenObject>,\n tokenObject: TokenObject,\n sessionKey: string,\n ): InternalSession {\n const externalTokenStore = this.externalTokenStoresByStore.get(tokenStore);\n let session: InternalSession;\n if (externalTokenStore == null) {\n session = this.createSession({\n refreshToken: tokenObject.refreshToken,\n accessToken: tokenObject.accessToken,\n });\n } else if (sessionKey === \"not-logged-in\") {\n // A provider can clear its session before its token store notification arrives; never let\n // that transiently expose the previous provider session's cached Hexclave token.\n session = this.createSession({\n refreshToken: null,\n accessToken: null,\n sessionKey,\n });\n } else {\n session = this.createSession({\n refreshToken: null,\n accessToken: tokenObject.accessToken,\n sessionKey,\n refreshAccessTokenWithoutRefreshTokenCallback: async () => {\n const state = this.states.get(externalTokenStore) ?? throwErr(\"External token store state was not initialized\");\n const expectedGeneration = state.generation;\n const assertSessionIdentityUnchanged = () => {\n const liveSessionKey = this.buildSessionKey(externalTokenStore, {\n generation: state.generation,\n providerSessionId: externalTokenStore.getSessionId?.(),\n });\n if (state.generation !== expectedGeneration || liveSessionKey !== sessionKey) {\n throw new Error(\"The external provider session changed while exchanging a token; retrying with the current provider session.\");\n }\n };\n // Returning null from this callback permanently invalidates the cached InternalSession, so\n // we must only do it when the provider session is definitively gone — for transient states\n // we throw instead, which surfaces the failure to the current caller but lets the next\n // request retry the exchange.\n const attemptExchange = async (isRetry: boolean): Promise<AccessToken | null> => {\n assertSessionIdentityUnchanged();\n const externalToken = await externalTokenStore.getToken();\n assertSessionIdentityUnchanged();\n if (externalToken == null) {\n if (externalTokenStore.getSessionId?.() != null) {\n // The provider reports an active session but handed out no token; this is usually a\n // transient state (eg. its SDK is still initializing), so don't treat it as signed out.\n throw new Error(\"The external token store returned no token even though it reports an active provider session. This is usually transient (eg. the provider SDK is still initializing) and the exchange will be retried on the next request.\");\n }\n return null;\n }\n try {\n const accessToken = await this.exchangeToken(externalTokenStore.providerId, externalToken);\n const validatedAccessToken = AccessToken.createIfValid(accessToken)\n ?? throwErr(\"External authentication exchange returned an invalid Hexclave access token\");\n // An explicit session key bypasses InternalSession's identity check. Refuse to install\n // a token if the provider switched accounts while the exchange was in flight instead\n // of returning null, which would permanently invalidate the reusable session.\n assertSessionIdentityUnchanged();\n return validatedAccessToken;\n } catch (error) {\n if (!KnownErrors.InvalidExternalAuthToken.isInstance(error)) {\n throw error;\n }\n // The server rejects provider tokens that expired in flight with the same error as\n // genuinely bad ones, so retry once with a freshly fetched provider token: the provider\n // SDK replaces an expired token. If the fresh token is rejected too, the cause is not\n // transient (eg. an issuer or client-ID misconfiguration), and it does not mean the\n // provider session ended either: the backend re-establishes a Hexclave session for any\n // valid provider token, so a rejection never signals revocation. Propagate the error\n // instead of returning null, which would permanently invalidate this session and make\n // a misconfiguration look like a silent sign-out.\n if (isRetry) {\n throw error;\n }\n return await attemptExchange(true);\n }\n };\n return await attemptExchange(false);\n },\n });\n }\n if (externalTokenStore != null) {\n this.externalTokenStoresBySession.set(session, externalTokenStore);\n }\n return session;\n }\n\n getExternalTokenStoreForSession(session: InternalSession): ExternalTokenStore | undefined {\n return this.externalTokenStoresBySession.get(session);\n }\n}\n"],"mappings":";;;;;AAwBA,SAAgB,qBAAqB,OAA4C;CAC/E,OAAO,UAAU,SAAS,MAAM,SAAS;AAC3C;AAEA,IAAa,mCAAb,MAA8C;CAM5C,YACE,eACA,eACA;EAFiB,KAAA,gBAAA;EACA,KAAA,gBAAA;oDAP2B,IAAI,QAAgD;oDACpD,IAAI,QAAgD;sDAClD,IAAI,QAA6C;gCACvE,IAAI,QAAqD;CAKhF;CAEH,sBACE,oBACA,kBACoB;EACpB,MAAM,WAAW,KAAK,2BAA2B,IAAI,kBAAkB;EACvE,IAAI,YAAY,MACd,OAAO;EAGT,MAAM,QAAQ,sBAAsB;EACpC,KAAK,2BAA2B,IAAI,oBAAoB,KAAK;EAC7D,KAAK,2BAA2B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ACb;EACF,CAAC;OAED,UAAU,KAAK,cAAc;GAC3B,cAAc;GACd,aAAa,YAAY;GACzB;GACA,+CAA+C,YAAY;IACzD,MAAM,QAAQ,KAAK,OAAO,IAAI,kBAAkB,KAAK,SAAS,gDAAgD;IAC9G,MAAM,qBAAqB,MAAM;IACjC,MAAM,uCAAuC;KAC3C,MAAM,iBAAiB,KAAK,gBAAgB,oBAAoB;MAC9D,YAAY,MAAM;MAClB,mBAAmB,mBAAmB,eAAe;KACvD,CAAC;KACD,IAAI,MAAM,eAAe,sBAAsB,mBAAmB,YAChE,MAAM,IAAI,MAAM,6GAA6G;IAEjI;IAKA,MAAM,kBAAkB,OAAO,YAAkD;KAC/E,+BAA+B;KAC/B,MAAM,gBAAgB,MAAM,mBAAmB,SAAS;KACxD,+BAA+B;KAC/B,IAAI,iBAAiB,MAAM;MACzB,IAAI,mBAAmB,eAAe,KAAK,MAGzC,MAAM,IAAI,MAAM,4NAA4N;MAE9O,OAAO;KACT;KACA,IAAI;MACF,MAAM,cAAc,MAAM,KAAK,cAAc,mBAAmB,YAAY,aAAa;MACzF,MAAM,uBAAuB,YAAY,cAAc,WAAW,KAC7D,SAAS,4EAA4E;MAI1F,+BAA+B;MAC/B,OAAO;KACT,SAAS,OAAO;MACd,IAAI,CAAC,YAAY,yBAAyB,WAAW,KAAK,GACxD,MAAM;MAUR,IAAI,SACF,MAAM;MAER,OAAO,MAAM,gBAAgB,IAAI;KACnC;IACF;IACA,OAAO,MAAM,gBAAgB,KAAK;GACpC;EACF,CAAC;EAEH,IAAI,sBAAsB,MACxB,KAAK,6BAA6B,IAAI,SAAS,kBAAkB;EAEnE,OAAO;CACT;CAEA,gCAAgC,SAA0D;EACxF,OAAO,KAAK,6BAA6B,IAAI,OAAO;CACtD;AACF"}
|
|
@@ -77,7 +77,22 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
77
77
|
* cross-domain auth, or sign-out state. Use the matching `redirectToXyz()` method instead, for example
|
|
78
78
|
* `redirectToSignIn()`, `redirectToSignUp()`, `redirectToSignOut()`, or `redirectToAccountSettings()`.
|
|
79
79
|
*/
|
|
80
|
-
readonly urls: Readonly<ResolvedHandlerUrls>;
|
|
80
|
+
readonly urls: Readonly<ResolvedHandlerUrls>; /** Whether this app delegates authentication to an external provider token store. */
|
|
81
|
+
isExternalAuthApp(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Marks the current page as one that should record analytics (page views, clicks, session replays, and clickmaps).
|
|
84
|
+
*
|
|
85
|
+
* Analytics capture starts automatically when the client app is constructed in the browser, so this function doesn't
|
|
86
|
+
* start anything itself. Call it at the top level of a client-side module that is loaded on every page you want to
|
|
87
|
+
* track (for example, your app's root layout or entry file); the call guarantees that the module creating the client
|
|
88
|
+
* app is actually imported, and therefore constructed, on that page.
|
|
89
|
+
*
|
|
90
|
+
* Throws if this app will never record analytics because of its constructor options (`analytics.enabled: false`,
|
|
91
|
+
* `automaticSideEffects: false`, or a `null` token store). If the Analytics app turns out to be disabled on the
|
|
92
|
+
* project, an error is reported as soon as the backend rejects the first upload. Outside the browser (eg. during
|
|
93
|
+
* server-side rendering), it doesn't throw for that reason alone.
|
|
94
|
+
*/
|
|
95
|
+
initAnalytics(): void;
|
|
81
96
|
signInWithOAuth(provider: string, options?: {
|
|
82
97
|
returnTo?: string;
|
|
83
98
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app.d.ts","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/interfaces/client-app.ts"],"mappings":";;;;;;;;;;;;KAgBY,gCAAA;EACV,OAAA;IAAqB,OAAA;IAAiB,MAAA;EAAA;EACtC,mBAAA,GAAsB,MAAA;EACtB,SAAA,GAAY,SAAA;EACZ,oBAAA;EACA,IAAA,GAAO,iBAAA;EACP,mBAAA,GAAsB,OAAA,CAAQ,mBAAA;EAC9B,UAAA,GAAa,cAAA,CAAe,aAAA;EAC5B,cAAA,GAAiB,cAAA;EACjB,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cAEC,OAAA,EAAS,8BAAA,GACV,oBAAA,+BAGqB,UAAA,OAAiB,IAAA,CAAK,WAAA,qCAAgD,OAAA,GAAU,iBAAA,KAAsB,OAAA,WAC3H,QAAA,CAAS,aAAA;EAAgC,UAAA,EAAY,cAAA;AAAA;EAAqB,UAAA,GAAa,cAAA;AAAA;;KAG/E,yBAAA;EAAA,2DAGe,cAAA,yDAEvB,OAAA,EAAS,gCAAA,CAAiC,aAAA,EAAe,SAAA,IAAa,cAAA,CAAe,aAAA,EAAe,SAAA;EAAA,KAClG,OAAA,EAAS,gCAAA,oBAAoD,cAAA;EAAA,CAEhE,0BAAA;IACC,cAAA,0DACE,IAAA,EAAM,kBAAA,CAAmB,aAAA,EAAe,SAAA,IACvC,cAAA,CAAe,aAAA,EAAe,SAAA;EAAA;AAAA;AAAA,KAGzB,mCAAA,4DAA+F,gCAAA,CAAiC,aAAA,EAAe,SAAA;AAAA,KAC/I,qBAAA,4DAAiF,kBAAA,CAAmB,aAAA,EAAe,SAAA;AAAA,KACnH,iBAAA,+EAAgG,cAAA,CAAe,aAAA,EAAe,SAAA;AAAA,KAC9H,4BAAA,GAA+B,yBAAyB;AAAA,cACvD,iBAAA,EAAmB,4BAAqD;;cAExE,cAAA,EAAgB,yBAA6C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-app.js","names":[],"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 /**\n * @deprecated Whether an app object has server permissions does not determine whether this\n * call runs in a browser, so an async read should not implicitly choose a navigation strategy.\n * In React, use useUser({ or: \"redirect\" }). Otherwise, call getUser() and explicitly invoke\n * redirectToSignIn() from browser code when it returns 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":";;AAwMA,MAAa,oBAAkD;;AAE/D,MAAa,iBAA4C"}
|
|
1
|
+
{"version":3,"file":"client-app.js","names":[],"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 /** Whether this app delegates authentication to an external provider token store. */\n isExternalAuthApp(): boolean,\n\n /**\n * Marks the current page as one that should record analytics (page views, clicks, session replays, and clickmaps).\n *\n * Analytics capture starts automatically when the client app is constructed in the browser, so this function doesn't\n * start anything itself. Call it at the top level of a client-side module that is loaded on every page you want to\n * track (for example, your app's root layout or entry file); the call guarantees that the module creating the client\n * app is actually imported, and therefore constructed, on that page.\n *\n * Throws if this app will never record analytics because of its constructor options (`analytics.enabled: false`,\n * `automaticSideEffects: false`, or a `null` token store). If the Analytics app turns out to be disabled on the\n * project, an error is reported as soon as the backend rejects the first upload. Outside the browser (eg. during\n * server-side rendering), it doesn't throw for that reason alone.\n */\n initAnalytics(): void,\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 /**\n * @deprecated Whether an app object has server permissions does not determine whether this\n * call runs in a browser, so an async read should not implicitly choose a navigation strategy.\n * In React, use useUser({ or: \"redirect\" }). Otherwise, call getUser() and explicitly invoke\n * redirectToSignIn() from browser code when it returns 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":";;AAyNA,MAAa,oBAAkD;;AAE/D,MAAa,iBAA4C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DefaultHandlerUrlTarget, HandlerPageUrls, HandlerRedirectUrls, HandlerUrlOptions, HandlerUrlTarget, HandlerUrls, ResolvedHandlerUrls } from "@hexclave/shared/dist/interface/handler-urls";
|
|
2
2
|
import { GenericQueryCtx, UserIdentity } from "convex/server";
|
|
3
3
|
import { ProviderType } from "@hexclave/shared/dist/utils/oauth";
|
|
4
|
+
import { ExternalAuthProviderId } from "@hexclave/shared/dist/interface/external-auth";
|
|
4
5
|
|
|
5
6
|
//#region src/lib/hexclave-app/common.d.ts
|
|
6
7
|
type RedirectToOptions = {
|
|
@@ -56,10 +57,21 @@ type RequestLike = {
|
|
|
56
57
|
get: (name: string) => string | null;
|
|
57
58
|
} | Record<string, string | null>;
|
|
58
59
|
};
|
|
60
|
+
type ExternalTokenStore = {
|
|
61
|
+
readonly type: "external";
|
|
62
|
+
readonly providerId: ExternalAuthProviderId;
|
|
63
|
+
getSessionId?(): string | null;
|
|
64
|
+
getToken(): Promise<string | null>; /** The adapter retains this subscription for its own lifetime and does not unsubscribe it. */
|
|
65
|
+
subscribe?(callback: () => void): () => void;
|
|
66
|
+
};
|
|
67
|
+
type ExternalTokenStoreOptions = Omit<ExternalTokenStore, "type" | "providerId">;
|
|
68
|
+
declare function clerkTokenStore(options: ExternalTokenStoreOptions): ExternalTokenStore;
|
|
69
|
+
declare function betterAuthTokenStore(options: ExternalTokenStoreOptions): ExternalTokenStore;
|
|
70
|
+
declare function workosTokenStore(options: ExternalTokenStoreOptions): ExternalTokenStore;
|
|
59
71
|
type TokenStoreInit<HasTokenStore extends boolean = boolean> = HasTokenStore extends true ? ("cookie" | "nextjs-cookie" | "memory" | RequestLike | {
|
|
60
72
|
accessToken: string;
|
|
61
73
|
refreshToken: string;
|
|
62
|
-
}) : HasTokenStore extends false ? null : TokenStoreInit<true> | TokenStoreInit<false>;
|
|
74
|
+
} | ExternalTokenStore) : HasTokenStore extends false ? null : TokenStoreInit<true> | TokenStoreInit<false>;
|
|
63
75
|
type OAuthScopesOnSignIn = { [key in ProviderType]: string[] };
|
|
64
76
|
/**
|
|
65
77
|
* Contains the authentication methods without session-related fields.
|
|
@@ -179,5 +191,5 @@ type AuthLike<ExtraOptions = {}> = {
|
|
|
179
191
|
/** @internal */
|
|
180
192
|
declare const hexclaveAppInternalsSymbol: unique symbol;
|
|
181
193
|
//#endregion
|
|
182
|
-
export { AsyncStoreProperty, AuthLike, ConvexCtx, type DefaultHandlerUrlTarget, EmailConfig, GetCurrentPartialUserOptions, GetCurrentUserOptions, type HandlerPageUrls, type HandlerRedirectUrls, type HandlerUrlOptions, type HandlerUrlTarget, type HandlerUrls, OAuthScopesOnSignIn, RedirectMethod, RedirectToOptions, RequestLike, type ResolvedHandlerUrls, TokenStoreInit, hexclaveAppInternalsSymbol };
|
|
194
|
+
export { AsyncStoreProperty, AuthLike, ConvexCtx, type DefaultHandlerUrlTarget, EmailConfig, ExternalTokenStore, GetCurrentPartialUserOptions, GetCurrentUserOptions, type HandlerPageUrls, type HandlerRedirectUrls, type HandlerUrlOptions, type HandlerUrlTarget, type HandlerUrls, OAuthScopesOnSignIn, RedirectMethod, RedirectToOptions, RequestLike, type ResolvedHandlerUrls, TokenStoreInit, betterAuthTokenStore, clerkTokenStore, hexclaveAppInternalsSymbol, workosTokenStore };
|
|
183
195
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","names":[],"sources":["../../../../src/lib/hexclave-app/common.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","names":[],"sources":["../../../../src/lib/hexclave-app/common.ts"],"mappings":";;;;;;KAiBY,iBAAA;EACV,OAAA;EACA,cAAc;AAAA;AAAA,KAGJ,kBAAA,4FACK,UAAA,iCAA2C,UAAA,CAAW,IAAA,UAAc,IAAA,EAAM,IAAA,KAAS,OAAA,CAAQ,KAAA,sBACxF,UAAA,CAAW,IAAA,UAAc,IAAA,EAAM,IAAA,KAAS,KAAA;AAAA,KAEhD,WAAA;EACV,IAAA;EACA,IAAA;EACA,QAAA;EACA,QAAA;EACA,WAAA;EACA,UAAA;AAAA;AAAA,KAGU,cAAA;EAIR,WAAA,SAAoB,EAAA;EACpB,QAAA,IAAY,EAAA;AAAA;AAAA,KAIJ,qBAAA;EAER,EAAA,wDAxB2B;EAAqB;;;;;;;;EAiChD,iBAAA;EACA,UAAA,GAAa,cAAA;AAAA,KAEZ,aAAA;EACD,UAAA,EAAY,cAAA;AAAA;AAAA,KAGJ,SAAA,GACV,eAAA;EACE,IAAA;IAAQ,eAAA,QAAuB,OAAA,CAAQ,YAAA;EAAA;AAAA;AAAA,KAE/B,4BAAA;EAER,EAAA;EACA,UAAA,GAAa,cAAA;AAAA;EAIX,IAAA;AAAA;EAGA,IAAA;EACA,GAAA,EAAK,SAAA;AAAA,MAGN,aAA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,OAAA,QAAe,YAAA,GAAe,OAAA;IAAU,cAAA;EAAA,IArGhB;EAuGvC,cAAA,CAAe,OAAA,QAAe,YAAA;IAAiB,cAAA;EAAA;EAvGsC;AAIvF;;;;;;;;AAA4F;AAI5F;;;;;;;;AAAwF;AAIxF;;;;;;;;EAwHE,WAAA,CAAY,OAAA,QAAe,YAAA,GAAe,OAAA;IAAU,WAAA;IAA4B,YAAA;EAAA;EAChF,WAAA,CAAY,OAAA,QAAe,YAAA;IAAiB,WAAA;IAA4B,YAAA;EAAA;AAAA;;cAI7D,0BAAA"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
//#region src/lib/hexclave-app/common.ts
|
|
2
|
+
function createExternalTokenStore(providerId, options) {
|
|
3
|
+
return {
|
|
4
|
+
...options,
|
|
5
|
+
type: "external",
|
|
6
|
+
providerId
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function clerkTokenStore(options) {
|
|
10
|
+
return createExternalTokenStore("clerk-integration", options);
|
|
11
|
+
}
|
|
12
|
+
function betterAuthTokenStore(options) {
|
|
13
|
+
return createExternalTokenStore("better-auth-integration", options);
|
|
14
|
+
}
|
|
15
|
+
function workosTokenStore(options) {
|
|
16
|
+
return createExternalTokenStore("workos-integration", options);
|
|
17
|
+
}
|
|
2
18
|
/** @internal */
|
|
3
19
|
const hexclaveAppInternalsSymbol = Symbol.for("StackAuth--DO-NOT-USE-OR-YOU-WILL-BE-FIRED--StackAppInternals");
|
|
4
20
|
//#endregion
|
|
5
|
-
export { hexclaveAppInternalsSymbol };
|
|
21
|
+
export { betterAuthTokenStore, clerkTokenStore, hexclaveAppInternalsSymbol, workosTokenStore };
|
|
6
22
|
|
|
7
23
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":[],"sources":["../../../../src/lib/hexclave-app/common.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 { ProviderType } from \"@hexclave/shared/dist/utils/oauth\";\nimport type { GenericQueryCtx, UserIdentity } from \"convex/server\";\nexport type {\n DefaultHandlerUrlTarget,\n HandlerPageUrls,\n HandlerRedirectUrls,\n HandlerUrlOptions,\n HandlerUrlTarget,\n HandlerUrls,\n ResolvedHandlerUrls,\n} from \"@hexclave/shared/dist/interface/handler-urls\";\n\nexport type RedirectToOptions = {\n replace?: boolean,\n noRedirectBack?: boolean,\n};\n\nexport type AsyncStoreProperty<Name extends string, Args extends any[], Value, IsMultiple extends boolean> =\n & { [key in `${IsMultiple extends true ? \"list\" : \"get\"}${Capitalize<Name>}`]: (...args: Args) => Promise<Value> }\n & { [key in `use${Capitalize<Name>}`]: (...args: Args) => Value } // THIS_LINE_PLATFORM react-like\n\nexport type EmailConfig = {\n host: string,\n port: number,\n username: string,\n password: string,\n senderEmail: string,\n senderName: string,\n}\n\nexport type RedirectMethod = \"window\"\n | \"nextjs\" // THIS_LINE_PLATFORM next\n | \"none\"\n | {\n useNavigate: () => (to: string) => void,\n navigate?: (to: string) => void,\n }\n\n\nexport type GetCurrentUserOptions<HasTokenStore> =\n & {\n or?: 'redirect' | 'throw' | 'return-null' | 'anonymous' | /** @deprecated */ 'anonymous-if-exists[deprecated]',\n /**\n * Whether to include restricted users (users who haven't completed onboarding requirements like email verification).\n * By default, restricted users are filtered out (treated similar to anonymous users).\n *\n * Note: This option cannot be set to false when `or: 'anonymous'` is used, as all anonymous users are also restricted.\n *\n * @default false\n */\n includeRestricted?: boolean,\n tokenStore?: TokenStoreInit,\n }\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type ConvexCtx =\n| GenericQueryCtx<any>\n| { auth: { getUserIdentity: () => Promise<UserIdentity | null> } };\n\nexport type GetCurrentPartialUserOptions<HasTokenStore> =\n & {\n or?: 'return-null' | 'anonymous-if-exists', // note: unlike normal getUser, 'anonymous' still returns null sometimes (eg. if no token is present)\n tokenStore?: TokenStoreInit,\n }\n & (\n | {\n from: 'token',\n }\n | {\n from: 'convex',\n ctx: ConvexCtx,\n }\n )\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type RequestLike = {\n headers:\n | {\n get: (name: string) => string | null,\n }\n | Record<string, string | null>,\n};\n\nexport type TokenStoreInit<HasTokenStore extends boolean = boolean> =\n HasTokenStore extends true ? (\n | \"cookie\"\n | \"nextjs-cookie\"\n | \"memory\"\n | RequestLike\n | { accessToken: string, refreshToken: string }\n )\n : HasTokenStore extends false ? null\n : TokenStoreInit<true> | TokenStoreInit<false>;\n\nexport type OAuthScopesOnSignIn = {\n [key in ProviderType]: string[];\n};\n\n/**\n * Contains the authentication methods without session-related fields.\n * Used for apps that have token storage capabilities.\n */\nexport type AuthLike<ExtraOptions = {}> = {\n signOut(options?: { redirectUrl?: URL | string } & ExtraOptions): Promise<void>,\n signOut(options?: { redirectUrl?: URL | string }): Promise<void>,\n\n /**\n * Returns the current access token, or null if the user is not signed in.\n *\n * The access token is a short-lived JWT that can be used to authenticate requests to external servers.\n * It will be automatically refreshed when it expires.\n */\n getAccessToken(options?: {} & ExtraOptions): Promise<string | null>,\n useAccessToken(options?: {} & ExtraOptions): string | null, // THIS_LINE_PLATFORM react-like\n\n /**\n * Returns the current refresh token, or null if the user is not signed in.\n *\n * The refresh token is a long-lived token that can be used to obtain new access tokens.\n * It should be kept secret and never exposed to the client.\n */\n getRefreshToken(options?: {} & ExtraOptions): Promise<string | null>,\n useRefreshToken(options?: {} & ExtraOptions): string | null, // THIS_LINE_PLATFORM react-like\n\n /**\n * Returns the value for the HTTP `Authorization` header for authenticated requests to external servers.\n * Most commonly used in cross-origin requests. Similar to `getAuthJson`, but specifically for HTTP requests.\n *\n * If you are using `tokenStore: \"cookie\"`, you don't need this for same-origin requests. However, most\n * browsers now disable third-party cookies by default, so we must pass authentication tokens by header instead\n * if the client and server are on different origins.\n *\n * This function returns the header value in this format:\n * `Bearer stackauth_<base64(getAuthJson())>`, or `null` if the user is not signed in.\n * You can use this with `fetch` or other HTTP request libraries to send authenticated requests.\n *\n * On the server, you can then pass in the `Request` object to the `tokenStore` option\n * of your Stack app. Please note that CORS does not allow most headers by default, so you\n * must include `authorization` in the [`Access-Control-Allow-Headers` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers)\n * of the CORS preflight response.\n *\n * If you are not using HTTP (and hence cannot set headers), use `getAuthJson()` instead.\n *\n * Example:\n *\n * ```ts\n * // client\n * const authorizationHeader = await hexclaveApp.getAuthorizationHeader();\n * const res = await fetch(\"https://api.example.com\", {\n * headers: {\n * ...(authorizationHeader ? { Authorization: authorizationHeader } : {})\n * // you can also add your own headers here\n * },\n * });\n *\n * // server\n * function handleRequest(req: Request) {\n * const user = await hexclaveServerApp.getUser({ tokenStore: req });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthorizationHeader(options?: {} & ExtraOptions): Promise<string | null>,\n useAuthorizationHeader(options?: {} & ExtraOptions): string | null, // THIS_LINE_PLATFORM react-like\n\n /**\n * @deprecated Use `getAuthorizationHeader()` instead.\n *\n * Returns the legacy `x-stack-auth` headers for authenticated HTTP requests. This remains for backwards\n * compatibility with existing integrations.\n */\n getAuthHeaders(options?: {} & ExtraOptions): Promise<{ \"x-stack-auth\": string }>,\n /** @deprecated Use `useAuthorizationHeader()` instead. */\n useAuthHeaders(options?: {} & ExtraOptions): { \"x-stack-auth\": string }, // THIS_LINE_PLATFORM react-like\n\n /**\n * Creates a JSON-serializable object containing the information to authenticate a user on an external server.\n * Similar to `getAuthorizationHeader`, but returns an object that can be sent over any protocol instead of just\n * HTTP headers.\n *\n * While `getAuthorizationHeader` is the recommended way to send authentication tokens over HTTP, your app may use\n * a different protocol, for example WebSockets or gRPC. This function returns a token object that can be JSON-serialized and sent to the server in any way you like.\n *\n * On the server, you can pass in this token object into the `tokenStore` option to fetch user details.\n *\n * Example:\n *\n * ```ts\n * // client\n * const res = await rpcCall(rpcEndpoint, {\n * data: {\n * auth: await hexclaveApp.getAuthJson(),\n * },\n * });\n *\n * // server\n * function handleRequest(data) {\n * const user = await hexclaveServerApp.getUser({ tokenStore: data.auth });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthJson(options?: {} & ExtraOptions): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n useAuthJson(options?: {} & ExtraOptions): { accessToken: string | null, refreshToken: string | null }, // THIS_LINE_PLATFORM react-like\n};\n\n/** @internal */\nexport const hexclaveAppInternalsSymbol = Symbol.for(\"StackAuth--DO-NOT-USE-OR-YOU-WILL-BE-FIRED--StackAppInternals\");\n"],"mappings":";;AAuNA,MAAa,6BAA6B,OAAO,IAAI,+DAA+D"}
|
|
1
|
+
{"version":3,"file":"common.js","names":[],"sources":["../../../../src/lib/hexclave-app/common.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 { ProviderType } from \"@hexclave/shared/dist/utils/oauth\";\nimport type { ExternalAuthProviderId } from \"@hexclave/shared/dist/interface/external-auth\";\nimport type { GenericQueryCtx, UserIdentity } from \"convex/server\";\nexport type {\n DefaultHandlerUrlTarget,\n HandlerPageUrls,\n HandlerRedirectUrls,\n HandlerUrlOptions,\n HandlerUrlTarget,\n HandlerUrls,\n ResolvedHandlerUrls,\n} from \"@hexclave/shared/dist/interface/handler-urls\";\n\nexport type RedirectToOptions = {\n replace?: boolean,\n noRedirectBack?: boolean,\n};\n\nexport type AsyncStoreProperty<Name extends string, Args extends any[], Value, IsMultiple extends boolean> =\n & { [key in `${IsMultiple extends true ? \"list\" : \"get\"}${Capitalize<Name>}`]: (...args: Args) => Promise<Value> }\n & { [key in `use${Capitalize<Name>}`]: (...args: Args) => Value } // THIS_LINE_PLATFORM react-like\n\nexport type EmailConfig = {\n host: string,\n port: number,\n username: string,\n password: string,\n senderEmail: string,\n senderName: string,\n}\n\nexport type RedirectMethod = \"window\"\n | \"nextjs\" // THIS_LINE_PLATFORM next\n | \"none\"\n | {\n useNavigate: () => (to: string) => void,\n navigate?: (to: string) => void,\n }\n\n\nexport type GetCurrentUserOptions<HasTokenStore> =\n & {\n or?: 'redirect' | 'throw' | 'return-null' | 'anonymous' | /** @deprecated */ 'anonymous-if-exists[deprecated]',\n /**\n * Whether to include restricted users (users who haven't completed onboarding requirements like email verification).\n * By default, restricted users are filtered out (treated similar to anonymous users).\n *\n * Note: This option cannot be set to false when `or: 'anonymous'` is used, as all anonymous users are also restricted.\n *\n * @default false\n */\n includeRestricted?: boolean,\n tokenStore?: TokenStoreInit,\n }\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type ConvexCtx =\n| GenericQueryCtx<any>\n| { auth: { getUserIdentity: () => Promise<UserIdentity | null> } };\n\nexport type GetCurrentPartialUserOptions<HasTokenStore> =\n & {\n or?: 'return-null' | 'anonymous-if-exists', // note: unlike normal getUser, 'anonymous' still returns null sometimes (eg. if no token is present)\n tokenStore?: TokenStoreInit,\n }\n & (\n | {\n from: 'token',\n }\n | {\n from: 'convex',\n ctx: ConvexCtx,\n }\n )\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type RequestLike = {\n headers:\n | {\n get: (name: string) => string | null,\n }\n | Record<string, string | null>,\n};\n\nexport type ExternalTokenStore = {\n readonly type: \"external\",\n readonly providerId: ExternalAuthProviderId,\n getSessionId?(): string | null,\n getToken(): Promise<string | null>,\n /** The adapter retains this subscription for its own lifetime and does not unsubscribe it. */\n subscribe?(callback: () => void): () => void,\n};\n\ntype ExternalTokenStoreOptions = Omit<ExternalTokenStore, \"type\" | \"providerId\">;\n\nfunction createExternalTokenStore(providerId: ExternalAuthProviderId, options: ExternalTokenStoreOptions): ExternalTokenStore {\n return {\n ...options,\n type: \"external\",\n providerId,\n };\n}\n\nexport function clerkTokenStore(options: ExternalTokenStoreOptions): ExternalTokenStore {\n return createExternalTokenStore(\"clerk-integration\", options);\n}\n\nexport function betterAuthTokenStore(options: ExternalTokenStoreOptions): ExternalTokenStore {\n return createExternalTokenStore(\"better-auth-integration\", options);\n}\n\nexport function workosTokenStore(options: ExternalTokenStoreOptions): ExternalTokenStore {\n return createExternalTokenStore(\"workos-integration\", options);\n}\n\nexport type TokenStoreInit<HasTokenStore extends boolean = boolean> =\n HasTokenStore extends true ? (\n | \"cookie\"\n | \"nextjs-cookie\"\n | \"memory\"\n | RequestLike\n | { accessToken: string, refreshToken: string }\n | ExternalTokenStore\n )\n : HasTokenStore extends false ? null\n : TokenStoreInit<true> | TokenStoreInit<false>;\n\nexport type OAuthScopesOnSignIn = {\n [key in ProviderType]: string[];\n};\n\n/**\n * Contains the authentication methods without session-related fields.\n * Used for apps that have token storage capabilities.\n */\nexport type AuthLike<ExtraOptions = {}> = {\n signOut(options?: { redirectUrl?: URL | string } & ExtraOptions): Promise<void>,\n signOut(options?: { redirectUrl?: URL | string }): Promise<void>,\n\n /**\n * Returns the current access token, or null if the user is not signed in.\n *\n * The access token is a short-lived JWT that can be used to authenticate requests to external servers.\n * It will be automatically refreshed when it expires.\n */\n getAccessToken(options?: {} & ExtraOptions): Promise<string | null>,\n useAccessToken(options?: {} & ExtraOptions): string | null, // THIS_LINE_PLATFORM react-like\n\n /**\n * Returns the current refresh token, or null if the user is not signed in.\n *\n * The refresh token is a long-lived token that can be used to obtain new access tokens.\n * It should be kept secret and never exposed to the client.\n */\n getRefreshToken(options?: {} & ExtraOptions): Promise<string | null>,\n useRefreshToken(options?: {} & ExtraOptions): string | null, // THIS_LINE_PLATFORM react-like\n\n /**\n * Returns the value for the HTTP `Authorization` header for authenticated requests to external servers.\n * Most commonly used in cross-origin requests. Similar to `getAuthJson`, but specifically for HTTP requests.\n *\n * If you are using `tokenStore: \"cookie\"`, you don't need this for same-origin requests. However, most\n * browsers now disable third-party cookies by default, so we must pass authentication tokens by header instead\n * if the client and server are on different origins.\n *\n * This function returns the header value in this format:\n * `Bearer stackauth_<base64(getAuthJson())>`, or `null` if the user is not signed in.\n * You can use this with `fetch` or other HTTP request libraries to send authenticated requests.\n *\n * On the server, you can then pass in the `Request` object to the `tokenStore` option\n * of your Stack app. Please note that CORS does not allow most headers by default, so you\n * must include `authorization` in the [`Access-Control-Allow-Headers` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers)\n * of the CORS preflight response.\n *\n * If you are not using HTTP (and hence cannot set headers), use `getAuthJson()` instead.\n *\n * Example:\n *\n * ```ts\n * // client\n * const authorizationHeader = await hexclaveApp.getAuthorizationHeader();\n * const res = await fetch(\"https://api.example.com\", {\n * headers: {\n * ...(authorizationHeader ? { Authorization: authorizationHeader } : {})\n * // you can also add your own headers here\n * },\n * });\n *\n * // server\n * function handleRequest(req: Request) {\n * const user = await hexclaveServerApp.getUser({ tokenStore: req });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthorizationHeader(options?: {} & ExtraOptions): Promise<string | null>,\n useAuthorizationHeader(options?: {} & ExtraOptions): string | null, // THIS_LINE_PLATFORM react-like\n\n /**\n * @deprecated Use `getAuthorizationHeader()` instead.\n *\n * Returns the legacy `x-stack-auth` headers for authenticated HTTP requests. This remains for backwards\n * compatibility with existing integrations.\n */\n getAuthHeaders(options?: {} & ExtraOptions): Promise<{ \"x-stack-auth\": string }>,\n /** @deprecated Use `useAuthorizationHeader()` instead. */\n useAuthHeaders(options?: {} & ExtraOptions): { \"x-stack-auth\": string }, // THIS_LINE_PLATFORM react-like\n\n /**\n * Creates a JSON-serializable object containing the information to authenticate a user on an external server.\n * Similar to `getAuthorizationHeader`, but returns an object that can be sent over any protocol instead of just\n * HTTP headers.\n *\n * While `getAuthorizationHeader` is the recommended way to send authentication tokens over HTTP, your app may use\n * a different protocol, for example WebSockets or gRPC. This function returns a token object that can be JSON-serialized and sent to the server in any way you like.\n *\n * On the server, you can pass in this token object into the `tokenStore` option to fetch user details.\n *\n * Example:\n *\n * ```ts\n * // client\n * const res = await rpcCall(rpcEndpoint, {\n * data: {\n * auth: await hexclaveApp.getAuthJson(),\n * },\n * });\n *\n * // server\n * function handleRequest(data) {\n * const user = await hexclaveServerApp.getUser({ tokenStore: data.auth });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthJson(options?: {} & ExtraOptions): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n useAuthJson(options?: {} & ExtraOptions): { accessToken: string | null, refreshToken: string | null }, // THIS_LINE_PLATFORM react-like\n};\n\n/** @internal */\nexport const hexclaveAppInternalsSymbol = Symbol.for(\"StackAuth--DO-NOT-USE-OR-YOU-WILL-BE-FIRED--StackAppInternals\");\n"],"mappings":";AAuGA,SAAS,yBAAyB,YAAoC,SAAwD;CAC5H,OAAO;EACL,GAAG;EACH,MAAM;EACN;CACF;AACF;AAEA,SAAgB,gBAAgB,SAAwD;CACtF,OAAO,yBAAyB,qBAAqB,OAAO;AAC9D;AAEA,SAAgB,qBAAqB,SAAwD;CAC3F,OAAO,yBAAyB,2BAA2B,OAAO;AACpE;AAEA,SAAgB,iBAAiB,SAAwD;CACvF,OAAO,yBAAyB,sBAAsB,OAAO;AAC/D;;AA+HA,MAAa,6BAA6B,OAAO,IAAI,+DAA+D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HexclaveAdminApp, HexclaveAdminAppConstructor, HexclaveAdminAppConstructorOptions, HexclaveClientApp, HexclaveClientAppConstructor, HexclaveClientAppConstructorOptions, HexclaveClientAppJson, HexclaveServerApp, HexclaveServerAppConstructor, HexclaveServerAppConstructorOptions, StackAdminApp, StackAdminAppConstructor, StackAdminAppConstructorOptions, StackClientApp, StackClientAppConstructor, StackClientAppConstructorOptions, StackClientAppJson, StackServerApp, StackServerAppConstructor, StackServerAppConstructorOptions } from "./apps/index.js";
|
|
2
|
-
import { GetCurrentUserOptions, GetCurrentUserOptions as GetUserOptions, HandlerUrlOptions, HandlerUrls, OAuthScopesOnSignIn, ResolvedHandlerUrls, hexclaveAppInternalsSymbol } from "./common.js";
|
|
2
|
+
import { ExternalTokenStore, GetCurrentUserOptions, GetCurrentUserOptions as GetUserOptions, HandlerUrlOptions, HandlerUrls, OAuthScopesOnSignIn, ResolvedHandlerUrls, betterAuthTokenStore, clerkTokenStore, hexclaveAppInternalsSymbol, workosTokenStore } from "./common.js";
|
|
3
3
|
import { getPagePrompt } from "./url-targets.js";
|
|
4
4
|
import { AdminWorkflow, AdminWorkflowDivergenceDiagnostic, AdminWorkflowRun, AdminWorkflowRunDetails, AdminWorkflowRunState, AdminWorkflowRunsFilter, AdminWorkflowStep, AdminWorkflowStepAttempt, AdminWorkflowSyncResult, AdminWorkflowTrigger, AdminWorkflowUpgradeResult, AdminWorkflowVersion } from "./workflows.js";
|
|
5
5
|
import { EmailOutboxListOptions, EmailOutboxListResult, EmailOutboxUpdateOptions } from "./apps/interfaces/admin-app.js";
|
|
@@ -14,4 +14,4 @@ import { AdminDeploymentDomainJson, AdminDeploymentEnvVarJson, AdminDeploymentJs
|
|
|
14
14
|
import { PlanUsage, PlanUsageKind, PlanUsageNextPlanId, PlanUsagePlanId, PlanUsageRow } from "./plan-usage/index.js";
|
|
15
15
|
import { EditableTeamMemberProfile, ReceivedTeamInvitation, SentTeamInvitation, ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions, ServerTeamMemberProfile, ServerTeamUpdateOptions, ServerTeamUser, Team, TeamCreateOptions, TeamInvitation, TeamMemberProfile, TeamUpdateOptions, TeamUser } from "./teams/index.js";
|
|
16
16
|
import { Auth, CurrentInternalServerUser, CurrentInternalUser, CurrentServerUser, CurrentUser, OAuthProvider, ServerOAuthProvider, ServerUser, User } from "./users/index.js";
|
|
17
|
-
export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentJson, type AdminDeploymentServiceJson, type AdminDeploymentServiceLogLineJson, type AdminDeploymentServiceOutcomeJson, 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 AdminProjectSecretJson, type AdminProjectUpdateOptions, type AdminSendAttemptError, type AdminSentEmail, type AdminSessionReplay, type AdminSessionReplayChunk, 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 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 ListSessionReplayChunksOptions, type ListSessionReplayChunksResult, type ListSessionReplaysOptions, type ListSessionReplaysResult, 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, type SessionReplayAllEventsResult, 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 };
|
|
17
|
+
export { type AdminDeploymentDomainJson, type AdminDeploymentEnvVarJson, type AdminDeploymentJson, type AdminDeploymentServiceJson, type AdminDeploymentServiceLogLineJson, type AdminDeploymentServiceOutcomeJson, 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 AdminProjectSecretJson, type AdminProjectUpdateOptions, type AdminSendAttemptError, type AdminSentEmail, type AdminSessionReplay, type AdminSessionReplayChunk, 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 ExternalTokenStore, type GetCurrentUserOptions, type 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 ListSessionReplayChunksOptions, type ListSessionReplayChunksResult, type ListSessionReplaysOptions, type ListSessionReplaysResult, 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, type SessionReplayAllEventsResult, 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, betterAuthTokenStore, clerkTokenStore, getPagePrompt, hexclaveAppInternalsSymbol, workosTokenStore };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HexclaveAdminApp, HexclaveClientApp, HexclaveServerApp, StackAdminApp, StackClientApp, StackServerApp } from "./apps/index.js";
|
|
2
|
-
import { hexclaveAppInternalsSymbol } from "./common.js";
|
|
2
|
+
import { betterAuthTokenStore, clerkTokenStore, hexclaveAppInternalsSymbol, workosTokenStore } from "./common.js";
|
|
3
3
|
import { getPagePrompt } from "./url-targets.js";
|
|
4
|
-
export { HexclaveAdminApp, HexclaveClientApp, HexclaveServerApp, StackAdminApp, StackClientApp, StackServerApp, getPagePrompt, hexclaveAppInternalsSymbol };
|
|
4
|
+
export { HexclaveAdminApp, HexclaveClientApp, HexclaveServerApp, StackAdminApp, StackClientApp, StackServerApp, betterAuthTokenStore, clerkTokenStore, getPagePrompt, hexclaveAppInternalsSymbol, workosTokenStore };
|
|
@@ -138,6 +138,9 @@ type BaseUser = {
|
|
|
138
138
|
readonly oauthProviders: readonly {
|
|
139
139
|
id: string;
|
|
140
140
|
}[];
|
|
141
|
+
readonly externalAuthProviders: readonly {
|
|
142
|
+
id: string;
|
|
143
|
+
}[];
|
|
141
144
|
};
|
|
142
145
|
type UserExtra = {
|
|
143
146
|
setDisplayName(displayName: string | null): Promise<void>; /** @deprecated Use contact channel's sendVerificationEmail instead */
|
|
@@ -266,7 +269,12 @@ type User = BaseUser;
|
|
|
266
269
|
type CurrentUser = BaseUser & Auth & UserExtra & Customer;
|
|
267
270
|
type CurrentInternalUser = CurrentUser & InternalUserExtra;
|
|
268
271
|
type ProjectCurrentUser<ProjectId> = ProjectId extends "internal" ? CurrentInternalUser : CurrentUser;
|
|
269
|
-
type TokenPartialUser = Pick<User, "id" | "displayName" | "primaryEmail" | "primaryEmailVerified" | "isAnonymous" | "isMultiFactorRequired" | "isRestricted" | "restrictedReason"
|
|
272
|
+
type TokenPartialUser = Pick<User, "id" | "displayName" | "primaryEmail" | "primaryEmailVerified" | "isAnonymous" | "isMultiFactorRequired" | "isRestricted" | "restrictedReason"> & {
|
|
273
|
+
/**
|
|
274
|
+
* The ID of the user's selected team, read from the `selected_team_id` claim of the access token or Convex identity.
|
|
275
|
+
*/
|
|
276
|
+
readonly selectedTeamId: string | null;
|
|
277
|
+
};
|
|
270
278
|
type SyncedPartialUser = TokenPartialUser & Pick<User, "id" | "displayName" | "primaryEmail" | "primaryEmailVerified" | "profileImageUrl" | "signedUpAt" | "clientMetadata" | "clientReadOnlyMetadata" | "isAnonymous" | "hasPassword" | "isRestricted" | "restrictedReason">;
|
|
271
279
|
type ActiveSession = {
|
|
272
280
|
id: string;
|
|
@@ -289,6 +297,11 @@ type UserUpdateOptions = {
|
|
|
289
297
|
};
|
|
290
298
|
declare function userUpdateOptionsToCrud(options: UserUpdateOptions): CurrentUserCrud["Client"]["Update"];
|
|
291
299
|
type ServerBaseUser = {
|
|
300
|
+
/**
|
|
301
|
+
* The selected team is a `ServerTeam` when non-null, so `listUsers()` returns full member details
|
|
302
|
+
* without fetching the team again.
|
|
303
|
+
*/
|
|
304
|
+
readonly selectedTeam: ServerTeam | null;
|
|
292
305
|
setPrimaryEmail(email: string | null, options?: {
|
|
293
306
|
verified?: boolean | undefined;
|
|
294
307
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/lib/hexclave-app/users/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;iBA0BgB,wBAAA,mBAA2C,MAAA,EAAQ,CAAA,GAAI,CAAC;AAAA,KAgB5D,aAAA;EAAA,SACD,EAAA;EAAA,SACA,IAAA;EAAA,SACA,MAAA;EAAA,SACA,SAAA;EAAA,SACA,KAAA;EAAA,SACA,WAAA;EAAA,SACA,sBAAA;EACT,MAAA,CAAO,IAAA;IAAQ,WAAA;IAAuB,sBAAA;EAAA,IAAqC,OAAA,CAAQ,MAAA,OACjF,YAAA,QAAoB,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