@stackframe/stack 2.5.18 → 2.5.20
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/CHANGELOG.md +20 -0
- package/dist/components/credential-sign-in.js +1 -3
- package/dist/components/credential-sign-in.js.map +1 -1
- package/dist/components/elements/sidebar-layout.d.mts +20 -0
- package/dist/components/elements/sidebar-layout.d.ts +20 -0
- package/dist/components/elements/sidebar-layout.js +111 -0
- package/dist/components/elements/sidebar-layout.js.map +1 -0
- package/dist/components/elements/user-avatar.d.mts +5 -12
- package/dist/components/elements/user-avatar.d.ts +5 -12
- package/dist/components/elements/user-avatar.js.map +1 -1
- package/dist/components/selected-team-switcher.js +36 -23
- package/dist/components/selected-team-switcher.js.map +1 -1
- package/dist/components/team-icon.d.mts +18 -0
- package/dist/components/team-icon.d.ts +18 -0
- package/dist/components/team-icon.js +50 -0
- package/dist/components/team-icon.js.map +1 -0
- package/dist/components-page/account-settings.d.mts +2 -1
- package/dist/components-page/account-settings.d.ts +2 -1
- package/dist/components-page/account-settings.js +405 -220
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/components-page/stack-handler.js +3 -5
- package/dist/components-page/stack-handler.js.map +1 -1
- package/dist/components-page/team-creation.d.mts +7 -0
- package/dist/components-page/team-creation.d.ts +7 -0
- package/dist/components-page/team-creation.js +92 -0
- package/dist/components-page/team-creation.js.map +1 -0
- package/dist/esm/components/credential-sign-in.js +1 -3
- package/dist/esm/components/credential-sign-in.js.map +1 -1
- package/dist/esm/components/elements/sidebar-layout.js +87 -0
- package/dist/esm/components/elements/sidebar-layout.js.map +1 -0
- package/dist/esm/components/elements/user-avatar.js.map +1 -1
- package/dist/esm/components/selected-team-switcher.js +40 -15
- package/dist/esm/components/selected-team-switcher.js.map +1 -1
- package/dist/esm/components/team-icon.js +15 -0
- package/dist/esm/components/team-icon.js.map +1 -0
- package/dist/esm/components-page/account-settings.js +399 -215
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/stack-handler.js +3 -5
- package/dist/esm/components-page/stack-handler.js.map +1 -1
- package/dist/esm/components-page/team-creation.js +68 -0
- package/dist/esm/components-page/team-creation.js.map +1 -0
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/lib/auth.js +4 -0
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/stack-app.js +184 -34
- package/dist/esm/lib/stack-app.js.map +1 -1
- package/dist/generated/global-css.d.mts +1 -1
- package/dist/generated/global-css.d.ts +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/auth.js +4 -0
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/stack-app.d.mts +39 -5
- package/dist/lib/stack-app.d.ts +39 -5
- package/dist/lib/stack-app.js +184 -34
- package/dist/lib/stack-app.js.map +1 -1
- package/package.json +7 -6
|
@@ -24,7 +24,7 @@ import { constructRedirectUrl } from "../utils/url";
|
|
|
24
24
|
import { addNewOAuthProviderOrScope, callOAuthCallback, signInWithOAuth } from "./auth";
|
|
25
25
|
import { deleteCookie, getCookie, setOrDeleteCookie } from "./cookie";
|
|
26
26
|
var NextNavigation = scrambleDuringCompileTime(NextNavigationUnscrambled);
|
|
27
|
-
var clientVersion = "js @stackframe/stack@2.5.
|
|
27
|
+
var clientVersion = "js @stackframe/stack@2.5.20";
|
|
28
28
|
function getUrls(partial) {
|
|
29
29
|
const handler = partial.handler ?? "/handler";
|
|
30
30
|
const home = partial.home ?? "/";
|
|
@@ -177,6 +177,16 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
);
|
|
180
|
+
this._teamMemberProfilesCache = createCacheBySession(
|
|
181
|
+
async (session, [teamId]) => {
|
|
182
|
+
return await this._interface.listTeamMemberProfiles({ teamId }, session);
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
this._currentUserTeamProfileCache = createCacheBySession(
|
|
186
|
+
async (session, [teamId]) => {
|
|
187
|
+
return await this._interface.getTeamMemberProfile({ teamId, userId: "me" }, session);
|
|
188
|
+
}
|
|
189
|
+
);
|
|
180
190
|
this._memoryTokenStore = createEmptyTokenStore();
|
|
181
191
|
this._requestTokenStores = /* @__PURE__ */ new WeakMap();
|
|
182
192
|
this._storedCookieTokenStore = null;
|
|
@@ -458,6 +468,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
458
468
|
return React.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
459
469
|
}
|
|
460
470
|
async _signInToAccountWithTokens(tokens) {
|
|
471
|
+
if (!("accessToken" in tokens) || !("refreshToken" in tokens)) {
|
|
472
|
+
throw new StackAssertionError("Invalid tokens object; can't sign in with this", { tokens });
|
|
473
|
+
}
|
|
461
474
|
const tokenStore = this._getOrCreateTokenStore();
|
|
462
475
|
tokenStore.set(tokens);
|
|
463
476
|
}
|
|
@@ -485,6 +498,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
485
498
|
signUpEnabled: crud.config.sign_up_enabled,
|
|
486
499
|
credentialEnabled: crud.config.credential_enabled,
|
|
487
500
|
magicLinkEnabled: crud.config.magic_link_enabled,
|
|
501
|
+
clientTeamCreationEnabled: crud.config.client_team_creation_enabled,
|
|
488
502
|
oauthProviders: crud.config.enabled_oauth_providers.map((p) => ({
|
|
489
503
|
id: p.id
|
|
490
504
|
}))
|
|
@@ -496,6 +510,15 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
496
510
|
id: crud.id
|
|
497
511
|
};
|
|
498
512
|
}
|
|
513
|
+
_clientTeamUserFromCrud(crud) {
|
|
514
|
+
return {
|
|
515
|
+
id: crud.user_id,
|
|
516
|
+
teamProfile: {
|
|
517
|
+
displayName: crud.display_name,
|
|
518
|
+
profileImageUrl: crud.profile_image_url
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
499
522
|
_clientTeamFromCrud(crud) {
|
|
500
523
|
const app = this;
|
|
501
524
|
return {
|
|
@@ -509,6 +532,18 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
509
532
|
session: app._getSession(),
|
|
510
533
|
callbackUrl: constructRedirectUrl(app.urls.teamInvitation)
|
|
511
534
|
});
|
|
535
|
+
},
|
|
536
|
+
async listUsers() {
|
|
537
|
+
const result = await app._teamMemberProfilesCache.getOrWait([app._getSession(), crud.id], "write-only");
|
|
538
|
+
return result.map((crud2) => app._clientTeamUserFromCrud(crud2));
|
|
539
|
+
},
|
|
540
|
+
useUsers() {
|
|
541
|
+
const result = useAsyncCache(app._teamMemberProfilesCache, [app._getSession(), crud.id], "team.useUsers()");
|
|
542
|
+
return result.map((crud2) => app._clientTeamUserFromCrud(crud2));
|
|
543
|
+
},
|
|
544
|
+
async update(data) {
|
|
545
|
+
await app._interface.updateTeam({ data: teamUpdateOptionsToCrud(data), teamId: crud.id }, app._getSession());
|
|
546
|
+
await app._currentUserTeamsCache.refresh([app._getSession()]);
|
|
512
547
|
}
|
|
513
548
|
};
|
|
514
549
|
}
|
|
@@ -561,6 +596,24 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
561
596
|
}
|
|
562
597
|
};
|
|
563
598
|
}
|
|
599
|
+
_editableTeamProfileFromCrud(crud) {
|
|
600
|
+
const app = this;
|
|
601
|
+
return {
|
|
602
|
+
displayName: crud.display_name,
|
|
603
|
+
profileImageUrl: crud.profile_image_url,
|
|
604
|
+
async update(update) {
|
|
605
|
+
await app._interface.updateTeamMemberProfile({
|
|
606
|
+
teamId: crud.team_id,
|
|
607
|
+
userId: crud.user_id,
|
|
608
|
+
profile: {
|
|
609
|
+
display_name: update.displayName,
|
|
610
|
+
profile_image_url: update.profileImageUrl
|
|
611
|
+
}
|
|
612
|
+
}, app._getSession());
|
|
613
|
+
await app._currentUserTeamProfileCache.refresh([app._getSession(), crud.team_id]);
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
}
|
|
564
617
|
_createUserExtra(crud, session) {
|
|
565
618
|
const app = this;
|
|
566
619
|
async function getConnectedAccount(id, options) {
|
|
@@ -606,6 +659,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
606
659
|
await app._currentUserTeamsCache.refresh([session]);
|
|
607
660
|
return app._clientTeamFromCrud(crud2);
|
|
608
661
|
},
|
|
662
|
+
async leaveTeam(team) {
|
|
663
|
+
await app._interface.leaveTeam(team.id, session);
|
|
664
|
+
},
|
|
609
665
|
async listPermissions(scope, options) {
|
|
610
666
|
const recursive = options?.recursive ?? true;
|
|
611
667
|
const permissions = await app._currentUserPermissionsCache.getOrWait([session, scope.id, recursive], "write-only");
|
|
@@ -638,6 +694,14 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
638
694
|
},
|
|
639
695
|
async updatePassword(options) {
|
|
640
696
|
return await app._updatePassword(options, session);
|
|
697
|
+
},
|
|
698
|
+
async getTeamProfile(team) {
|
|
699
|
+
const result = await app._currentUserTeamProfileCache.getOrWait([session, team.id], "write-only");
|
|
700
|
+
return app._editableTeamProfileFromCrud(result);
|
|
701
|
+
},
|
|
702
|
+
useTeamProfile(team) {
|
|
703
|
+
const result = useAsyncCache(app._currentUserTeamProfileCache, [session, team.id], "user.useTeamProfile()");
|
|
704
|
+
return app._editableTeamProfileFromCrud(result);
|
|
641
705
|
}
|
|
642
706
|
};
|
|
643
707
|
}
|
|
@@ -891,33 +955,48 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
891
955
|
}
|
|
892
956
|
);
|
|
893
957
|
}
|
|
958
|
+
/**
|
|
959
|
+
* @deprecated
|
|
960
|
+
* TODO remove
|
|
961
|
+
*/
|
|
962
|
+
async _experimentalMfa(error, session) {
|
|
963
|
+
const otp = prompt("Please enter the six-digit TOTP code from your authenticator app.");
|
|
964
|
+
if (!otp) {
|
|
965
|
+
throw new KnownErrors.InvalidTotpCode();
|
|
966
|
+
}
|
|
967
|
+
return await this._interface.totpMfa(
|
|
968
|
+
error.details?.attempt_code ?? throwErr("attempt code missing"),
|
|
969
|
+
otp,
|
|
970
|
+
session
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* @deprecated
|
|
975
|
+
* TODO remove
|
|
976
|
+
*/
|
|
977
|
+
async _catchMfaRequiredError(callback) {
|
|
978
|
+
try {
|
|
979
|
+
return await callback();
|
|
980
|
+
} catch (e) {
|
|
981
|
+
if (e instanceof KnownErrors.MultiFactorAuthenticationRequired) {
|
|
982
|
+
return await this._experimentalMfa(e, this._getSession());
|
|
983
|
+
}
|
|
984
|
+
throw e;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
894
987
|
async signInWithCredential(options) {
|
|
895
988
|
this._ensurePersistentTokenStore();
|
|
896
989
|
const session = this._getSession();
|
|
897
990
|
let result;
|
|
898
991
|
try {
|
|
899
|
-
result = await this.
|
|
992
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
993
|
+
return await this._interface.signInWithCredential(options.email, options.password, session);
|
|
994
|
+
});
|
|
900
995
|
} catch (e) {
|
|
901
|
-
if (
|
|
902
|
-
|
|
903
|
-
try {
|
|
904
|
-
if (!otp) {
|
|
905
|
-
throw new KnownErrors.InvalidTotpCode();
|
|
906
|
-
}
|
|
907
|
-
result = await this._interface.totpMfa(
|
|
908
|
-
e.details?.attempt_code ?? throwErr("attempt code missing"),
|
|
909
|
-
otp,
|
|
910
|
-
session
|
|
911
|
-
);
|
|
912
|
-
} catch (e2) {
|
|
913
|
-
if (e2 instanceof KnownErrors.InvalidTotpCode) {
|
|
914
|
-
return e2;
|
|
915
|
-
}
|
|
916
|
-
throw e2;
|
|
917
|
-
}
|
|
918
|
-
} else {
|
|
919
|
-
throw e;
|
|
996
|
+
if (e instanceof KnownErrors.InvalidTotpCode) {
|
|
997
|
+
return e;
|
|
920
998
|
}
|
|
999
|
+
throw e;
|
|
921
1000
|
}
|
|
922
1001
|
if (!(result instanceof KnownError)) {
|
|
923
1002
|
await this._signInToAccountWithTokens(result);
|
|
@@ -943,7 +1022,17 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
943
1022
|
}
|
|
944
1023
|
async signInWithMagicLink(code) {
|
|
945
1024
|
this._ensurePersistentTokenStore();
|
|
946
|
-
|
|
1025
|
+
let result;
|
|
1026
|
+
try {
|
|
1027
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
1028
|
+
return await this._interface.signInWithMagicLink(code);
|
|
1029
|
+
});
|
|
1030
|
+
} catch (e) {
|
|
1031
|
+
if (e instanceof KnownErrors.InvalidTotpCode) {
|
|
1032
|
+
return e;
|
|
1033
|
+
}
|
|
1034
|
+
throw e;
|
|
1035
|
+
}
|
|
947
1036
|
if (result instanceof KnownError) {
|
|
948
1037
|
return result;
|
|
949
1038
|
}
|
|
@@ -956,10 +1045,21 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
956
1045
|
}
|
|
957
1046
|
async callOAuthCallback() {
|
|
958
1047
|
this._ensurePersistentTokenStore();
|
|
959
|
-
|
|
1048
|
+
let result;
|
|
1049
|
+
try {
|
|
1050
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
1051
|
+
return await callOAuthCallback(this._interface, this.urls.oauthCallback);
|
|
1052
|
+
});
|
|
1053
|
+
} catch (e) {
|
|
1054
|
+
if (e instanceof KnownErrors.InvalidTotpCode) {
|
|
1055
|
+
alert("Invalid TOTP code. Please try signing in again.");
|
|
1056
|
+
}
|
|
1057
|
+
throw e;
|
|
1058
|
+
}
|
|
960
1059
|
if (result) {
|
|
1060
|
+
console.log("OAuth callback result", result);
|
|
961
1061
|
await this._signInToAccountWithTokens(result);
|
|
962
|
-
if (result.afterCallbackRedirectUrl) {
|
|
1062
|
+
if ("afterCallbackRedirectUrl" in result && result.afterCallbackRedirectUrl) {
|
|
963
1063
|
await _redirectTo(result.afterCallbackRedirectUrl, { replace: true });
|
|
964
1064
|
return true;
|
|
965
1065
|
} else if (result.newUser) {
|
|
@@ -1113,9 +1213,6 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1113
1213
|
this._serverTeamsCache = createCache(async ([userId]) => {
|
|
1114
1214
|
return await this._interface.listServerTeams({ userId });
|
|
1115
1215
|
});
|
|
1116
|
-
this._serverTeamUsersCache = createCache(async ([teamId]) => {
|
|
1117
|
-
return await this._interface.listServerTeamUsers(teamId);
|
|
1118
|
-
});
|
|
1119
1216
|
this._serverTeamUserPermissionsCache = createCache(async ([teamId, userId, recursive]) => {
|
|
1120
1217
|
return await this._interface.listServerTeamPermissions({ teamId, userId, recursive }, null);
|
|
1121
1218
|
});
|
|
@@ -1145,12 +1242,33 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1145
1242
|
});
|
|
1146
1243
|
}
|
|
1147
1244
|
);
|
|
1245
|
+
this._serverTeamMemberProfilesCache = createCache(
|
|
1246
|
+
async ([teamId]) => {
|
|
1247
|
+
return await this._interface.listServerTeamMemberProfiles({ teamId });
|
|
1248
|
+
}
|
|
1249
|
+
);
|
|
1250
|
+
this._serverUserTeamProfileCache = createCache(
|
|
1251
|
+
async ([teamId, userId]) => {
|
|
1252
|
+
return await this._interface.getServerTeamMemberProfile({ teamId, userId });
|
|
1253
|
+
}
|
|
1254
|
+
);
|
|
1148
1255
|
}
|
|
1149
1256
|
async _updateServerUser(userId, update) {
|
|
1150
1257
|
const result = await this._interface.updateServerUser(userId, serverUserUpdateOptionsToCrud(update));
|
|
1151
1258
|
await this._refreshUsers();
|
|
1152
1259
|
return result;
|
|
1153
1260
|
}
|
|
1261
|
+
_serverEditableTeamProfileFromCrud(crud) {
|
|
1262
|
+
const app = this;
|
|
1263
|
+
const clientProfile = this._editableTeamProfileFromCrud(crud);
|
|
1264
|
+
return {
|
|
1265
|
+
...clientProfile,
|
|
1266
|
+
async update(update) {
|
|
1267
|
+
await clientProfile.update(update);
|
|
1268
|
+
await app._serverUserTeamProfileCache.refresh([crud.team_id, crud.user_id]);
|
|
1269
|
+
}
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1154
1272
|
_serverUserFromCrud(crud) {
|
|
1155
1273
|
const app = this;
|
|
1156
1274
|
async function getConnectedAccount(id, options) {
|
|
@@ -1229,6 +1347,9 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1229
1347
|
await app._serverTeamsCache.refresh([void 0]);
|
|
1230
1348
|
return app._serverTeamFromCrud(team);
|
|
1231
1349
|
},
|
|
1350
|
+
leaveTeam: async (team) => {
|
|
1351
|
+
await app._interface.leaveServerTeam({ teamId: team.id, userId: crud.id });
|
|
1352
|
+
},
|
|
1232
1353
|
async listPermissions(scope, options) {
|
|
1233
1354
|
const recursive = options?.recursive ?? true;
|
|
1234
1355
|
const permissions = await app._serverTeamUserPermissionsCache.getOrWait([scope.id, crud.id, recursive], "write-only");
|
|
@@ -1258,6 +1379,23 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1258
1379
|
},
|
|
1259
1380
|
async updatePassword(options) {
|
|
1260
1381
|
return await app._checkFeatureSupport("updatePassword() on ServerUser", {});
|
|
1382
|
+
},
|
|
1383
|
+
async getTeamProfile(team) {
|
|
1384
|
+
const result = await app._serverUserTeamProfileCache.getOrWait([team.id, crud.id], "write-only");
|
|
1385
|
+
return app._serverEditableTeamProfileFromCrud(result);
|
|
1386
|
+
},
|
|
1387
|
+
useTeamProfile(team) {
|
|
1388
|
+
const result = useAsyncCache(app._serverUserTeamProfileCache, [team.id, crud.id], "user.useTeamProfile()");
|
|
1389
|
+
return useMemo(() => app._serverEditableTeamProfileFromCrud(result), [result]);
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
_serverTeamUserFromCrud(crud) {
|
|
1394
|
+
return {
|
|
1395
|
+
...this._serverUserFromCrud(crud.user),
|
|
1396
|
+
teamProfile: {
|
|
1397
|
+
displayName: crud.display_name,
|
|
1398
|
+
profileImageUrl: crud.profile_image_url
|
|
1261
1399
|
}
|
|
1262
1400
|
};
|
|
1263
1401
|
}
|
|
@@ -1278,9 +1416,6 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1278
1416
|
displayName: crud.display_name,
|
|
1279
1417
|
profileImageUrl: crud.profile_image_url,
|
|
1280
1418
|
createdAt: new Date(crud.created_at_millis),
|
|
1281
|
-
async listUsers() {
|
|
1282
|
-
return (await app._interface.listServerTeamUsers(crud.id)).map((u) => app._serverUserFromCrud(u));
|
|
1283
|
-
},
|
|
1284
1419
|
async update(update) {
|
|
1285
1420
|
await app._interface.updateServerTeam(crud.id, serverTeamUpdateOptionsToCrud(update));
|
|
1286
1421
|
await app._serverTeamsCache.refresh([void 0]);
|
|
@@ -1289,23 +1424,27 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1289
1424
|
await app._interface.deleteServerTeam(crud.id);
|
|
1290
1425
|
await app._serverTeamsCache.refresh([void 0]);
|
|
1291
1426
|
},
|
|
1427
|
+
async listUsers() {
|
|
1428
|
+
const result = await app._serverTeamMemberProfilesCache.getOrWait([crud.id], "write-only");
|
|
1429
|
+
return result.map((u) => app._serverTeamUserFromCrud(u));
|
|
1430
|
+
},
|
|
1292
1431
|
useUsers() {
|
|
1293
|
-
const result = useAsyncCache(app.
|
|
1294
|
-
return useMemo(() => result.map((u) => app.
|
|
1432
|
+
const result = useAsyncCache(app._serverTeamMemberProfilesCache, [crud.id], "team.useUsers()");
|
|
1433
|
+
return useMemo(() => result.map((u) => app._serverTeamUserFromCrud(u)), [result]);
|
|
1295
1434
|
},
|
|
1296
1435
|
async addUser(userId) {
|
|
1297
1436
|
await app._interface.addServerUserToTeam({
|
|
1298
1437
|
teamId: crud.id,
|
|
1299
1438
|
userId
|
|
1300
1439
|
});
|
|
1301
|
-
await app.
|
|
1440
|
+
await app._serverTeamMemberProfilesCache.refresh([crud.id]);
|
|
1302
1441
|
},
|
|
1303
1442
|
async removeUser(userId) {
|
|
1304
1443
|
await app._interface.removeServerUserFromTeam({
|
|
1305
1444
|
teamId: crud.id,
|
|
1306
1445
|
userId
|
|
1307
1446
|
});
|
|
1308
|
-
await app.
|
|
1447
|
+
await app._serverTeamMemberProfilesCache.refresh([crud.id]);
|
|
1309
1448
|
},
|
|
1310
1449
|
async inviteUser(options) {
|
|
1311
1450
|
return await app._interface.sendTeamInvitation({
|
|
@@ -1502,6 +1641,7 @@ var _StackAdminAppImpl = class extends _StackServerAppImpl {
|
|
|
1502
1641
|
signUpEnabled: data.config.sign_up_enabled,
|
|
1503
1642
|
credentialEnabled: data.config.credential_enabled,
|
|
1504
1643
|
magicLinkEnabled: data.config.magic_link_enabled,
|
|
1644
|
+
clientTeamCreationEnabled: data.config.client_team_creation_enabled,
|
|
1505
1645
|
allowLocalhost: data.config.allow_localhost,
|
|
1506
1646
|
oauthProviders: data.config.oauth_providers.map((p) => p.type === "shared" ? {
|
|
1507
1647
|
id: p.id,
|
|
@@ -1538,6 +1678,9 @@ var _StackAdminAppImpl = class extends _StackServerAppImpl {
|
|
|
1538
1678
|
await app._interface.updateProject(adminProjectUpdateOptionsToCrud(update));
|
|
1539
1679
|
await onRefresh();
|
|
1540
1680
|
},
|
|
1681
|
+
async delete() {
|
|
1682
|
+
await app._interface.deleteProject();
|
|
1683
|
+
},
|
|
1541
1684
|
async getProductionModeErrors() {
|
|
1542
1685
|
return getProductionModeErrors(data);
|
|
1543
1686
|
},
|
|
@@ -1742,6 +1885,7 @@ function adminProjectUpdateOptionsToCrud(options) {
|
|
|
1742
1885
|
magic_link_enabled: options.config?.magicLinkEnabled,
|
|
1743
1886
|
allow_localhost: options.config?.allowLocalhost,
|
|
1744
1887
|
create_team_on_sign_up: options.config?.createTeamOnSignUp,
|
|
1888
|
+
client_team_creation_enabled: options.config?.clientTeamCreationEnabled,
|
|
1745
1889
|
team_creator_default_permissions: options.config?.teamCreatorDefaultPermissions,
|
|
1746
1890
|
team_member_default_permissions: options.config?.teamMemberDefaultPermissions
|
|
1747
1891
|
}
|
|
@@ -1762,6 +1906,12 @@ function apiKeyCreateOptionsToCrud(options) {
|
|
|
1762
1906
|
has_super_secret_admin_key: options.hasSuperSecretAdminKey
|
|
1763
1907
|
};
|
|
1764
1908
|
}
|
|
1909
|
+
function teamUpdateOptionsToCrud(options) {
|
|
1910
|
+
return {
|
|
1911
|
+
display_name: options.displayName,
|
|
1912
|
+
profile_image_url: options.profileImageUrl
|
|
1913
|
+
};
|
|
1914
|
+
}
|
|
1765
1915
|
function teamCreateOptionsToCrud(options) {
|
|
1766
1916
|
return {
|
|
1767
1917
|
display_name: options.displayName,
|