@hexclave/js 1.0.67 → 1.0.69
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/README.md +21 -21
- package/dist/{admin-app-impl-C051fyaH.d.ts → admin-app-impl-BK_PtwWB.d.ts} +15 -10
- package/dist/admin-app-impl-BK_PtwWB.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-o8N3XCYe.d.ts → client-app-DBcv6rRn.d.ts} +13 -6
- package/dist/client-app-DBcv6rRn.d.ts.map +1 -0
- package/dist/dev-tool/dev-tool-core.d.ts +1 -1
- package/dist/dev-tool/index.d.ts +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 +9 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +22 -5
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.js +97 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -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/teams/index.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/teams/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/teams/index.js.map +1 -1
- package/dist/esm/lib/hexclave-app/users/index.d.ts +10 -4
- 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/index.d.ts +1 -1
- 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.js +22 -5
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.js +96 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -4
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js.map +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/index.d.ts +1 -1
- 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/teams/index.js.map +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/pushed-config-error-overlay/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/integrations/convex/component/README.md +4 -4
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.sign-in-cache-warmup.test.ts +94 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +33 -8
- package/src/lib/hexclave-app/apps/implementations/server-app-impl.ts +1 -10
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +1 -1
- package/src/lib/hexclave-app/teams/index.ts +1 -0
- package/src/lib/hexclave-app/users/index.ts +9 -4
- package/dist/admin-app-impl-C051fyaH.d.ts.map +0 -1
- package/dist/client-app-o8N3XCYe.d.ts.map +0 -1
|
@@ -356,6 +356,7 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
356
356
|
this._storedBrowserCookieTokenStore = null;
|
|
357
357
|
this._mostRecentQueuedCookieRefreshIndex = 0;
|
|
358
358
|
this._sessionsByTokenStoreAndSessionKey = /* @__PURE__ */ new WeakMap();
|
|
359
|
+
this._signInAttemptCounter = 0;
|
|
359
360
|
const resolvedOptions = resolveConstructorOptions(options);
|
|
360
361
|
if (!_HexclaveClientAppImplIncomplete.LazyStackAdminAppImpl.value) throw new HexclaveAssertionError("Admin app implementation not initialized. Did you import the _HexclaveClientApp from hexclave-app/apps/implementations/index.ts? You can't import it directly from ./apps/implementations/client-app-impl.ts as that causes a circular dependency (see the comment at _LazyHexclaveAdminAppImpl for more details).");
|
|
361
362
|
this._options = resolvedOptions;
|
|
@@ -949,8 +950,12 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
949
950
|
throw new Error(`Invalid token store ${tokenStoreInit}`);
|
|
950
951
|
}
|
|
951
952
|
}
|
|
952
|
-
|
|
953
|
-
|
|
953
|
+
/**
|
|
954
|
+
* @param overrideTokenObj The tokens to build the session for, if they haven't been written to the token store yet
|
|
955
|
+
* (so we can warm a sign-in's session before the token store publishes it).
|
|
956
|
+
*/
|
|
957
|
+
_getSessionFromTokenStore(tokenStore, overrideTokenObj) {
|
|
958
|
+
const tokenObj = overrideTokenObj ?? tokenStore.get();
|
|
954
959
|
const sessionKey = InternalSession.calculateSessionKey(tokenObj);
|
|
955
960
|
const existing = sessionKey ? this._sessionsByTokenStoreAndSessionKey.get(tokenStore)?.get(sessionKey) : null;
|
|
956
961
|
if (existing) return existing;
|
|
@@ -983,11 +988,13 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
983
988
|
}
|
|
984
989
|
async _signInToAccountWithTokens(tokens) {
|
|
985
990
|
if (!("accessToken" in tokens) || !("refreshToken" in tokens)) throw new HexclaveAssertionError("Invalid tokens object; can't sign in with this", { tokens });
|
|
991
|
+
const attemptId = ++this._signInAttemptCounter;
|
|
986
992
|
const tokenStore = this._getOrCreateTokenStore(await this._createCookieHelper());
|
|
987
|
-
|
|
988
|
-
const session = this._getSessionFromTokenStore(tokenStore);
|
|
993
|
+
const session = this._getSessionFromTokenStore(tokenStore, tokens);
|
|
989
994
|
session.updateAccessToken(tokens);
|
|
990
|
-
|
|
995
|
+
await Result.fromPromise(this._currentUserCache.getOrWait([session], "write-only"));
|
|
996
|
+
if (attemptId !== this._signInAttemptCounter) return;
|
|
997
|
+
tokenStore.set(tokens);
|
|
991
998
|
}
|
|
992
999
|
_getTokenStoreInitForFreshTokens(tokens) {
|
|
993
1000
|
if (tokens.accessToken == null) return;
|
|
@@ -1128,6 +1135,12 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
1128
1135
|
async listUsers() {
|
|
1129
1136
|
return Result.orThrow(await app._teamMemberProfilesCache.getOrWait([session, crud.id], "write-only")).map((crud) => app._clientTeamUserFromCrud(crud));
|
|
1130
1137
|
},
|
|
1138
|
+
async removeUser(userId) {
|
|
1139
|
+
await app._interface.removeUserFromTeam(crud.id, userId, session);
|
|
1140
|
+
await app._teamMemberProfilesCache.refresh([session, crud.id]);
|
|
1141
|
+
await app._currentUserTeamsCache.refresh([session]);
|
|
1142
|
+
await app._currentUserCache.refresh([session]);
|
|
1143
|
+
},
|
|
1131
1144
|
async listInvitations() {
|
|
1132
1145
|
return Result.orThrow(await app._teamInvitationsCache.getOrWait([session, crud.id], "write-only")).map((crud) => app._clientSentTeamInvitationFromCrud(session, crud));
|
|
1133
1146
|
},
|
|
@@ -1328,6 +1341,8 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
1328
1341
|
isAnonymous: crud.is_anonymous,
|
|
1329
1342
|
isRestricted: crud.is_restricted,
|
|
1330
1343
|
restrictedReason: crud.restricted_reason,
|
|
1344
|
+
restrictedByAdmin: crud.restricted_by_admin,
|
|
1345
|
+
restrictedByAdminReason: crud.restricted_by_admin_reason,
|
|
1331
1346
|
toClientJson() {
|
|
1332
1347
|
return crud;
|
|
1333
1348
|
}
|
|
@@ -1401,6 +1416,8 @@ var _HexclaveClientAppImplIncomplete = class _HexclaveClientAppImplIncomplete {
|
|
|
1401
1416
|
},
|
|
1402
1417
|
async leaveTeam(team) {
|
|
1403
1418
|
await app._interface.leaveTeam(team.id, session);
|
|
1419
|
+
await app._currentUserTeamsCache.refresh([session]);
|
|
1420
|
+
await app._currentUserCache.refresh([session]);
|
|
1404
1421
|
},
|
|
1405
1422
|
async listTeamInvitations() {
|
|
1406
1423
|
return Result.orThrow(await app._currentUserTeamInvitationsCache.getOrWait([session], "write-only")).map((crud) => app._clientReceivedTeamInvitationFromCrud(session, crud));
|