@stackframe/stack 2.5.18 → 2.5.19
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 +10 -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 +21 -0
- package/dist/components/elements/sidebar-layout.d.ts +21 -0
- package/dist/components/elements/sidebar-layout.js +125 -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 +35 -5
- package/dist/components/selected-team-switcher.js.map +1 -1
- package/dist/components-page/account-settings.js +47 -49
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/components-page/stack-handler.js +20 -0
- 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/components-page/team-settings.d.mts +8 -0
- package/dist/components-page/team-settings.d.ts +8 -0
- package/dist/components-page/team-settings.js +139 -0
- package/dist/components-page/team-settings.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 +90 -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 +39 -7
- package/dist/esm/components/selected-team-switcher.js.map +1 -1
- package/dist/esm/components-page/account-settings.js +33 -35
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/stack-handler.js +20 -0
- 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/components-page/team-settings.js +115 -0
- package/dist/esm/components-page/team-settings.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 +178 -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 +35 -5
- package/dist/lib/stack-app.d.ts +35 -5
- package/dist/lib/stack-app.js +178 -34
- package/dist/lib/stack-app.js.map +1 -1
- package/package.json +7 -6
package/dist/lib/stack-app.d.mts
CHANGED
|
@@ -34,6 +34,7 @@ type HandlerUrls = {
|
|
|
34
34
|
magicLinkCallback: string;
|
|
35
35
|
accountSettings: string;
|
|
36
36
|
teamInvitation: string;
|
|
37
|
+
teamCreation: string;
|
|
37
38
|
error: string;
|
|
38
39
|
};
|
|
39
40
|
type OAuthScopesOnSignIn = {
|
|
@@ -239,6 +240,9 @@ type UserExtra = {
|
|
|
239
240
|
hasPermission(scope: Team, permissionId: string): Promise<boolean>;
|
|
240
241
|
setSelectedTeam(team: Team | null): Promise<void>;
|
|
241
242
|
createTeam(data: TeamCreateOptions): Promise<Team>;
|
|
243
|
+
leaveTeam(team: Team): Promise<void>;
|
|
244
|
+
getTeamProfile(team: Team): Promise<EditableTeamMemberProfile>;
|
|
245
|
+
useTeamProfile(team: Team): EditableTeamMemberProfile;
|
|
242
246
|
} & AsyncStoreProperty<"team", [id: string], Team | null, false> & AsyncStoreProperty<"teams", [], Team[], true> & AsyncStoreProperty<"permission", [scope: Team, permissionId: string, options?: {
|
|
243
247
|
recursive?: boolean;
|
|
244
248
|
}], TeamPermission | null, false> & AsyncStoreProperty<"permissions", [scope: Team, options?: {
|
|
@@ -318,6 +322,7 @@ type AdminProject = {
|
|
|
318
322
|
readonly isProductionMode: boolean;
|
|
319
323
|
readonly config: AdminProjectConfig;
|
|
320
324
|
update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>;
|
|
325
|
+
delete(this: AdminProject): Promise<void>;
|
|
321
326
|
getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>;
|
|
322
327
|
useProductionModeErrors(this: AdminProject): ProductionModeError[];
|
|
323
328
|
} & Project;
|
|
@@ -337,15 +342,18 @@ type ProjectConfig = {
|
|
|
337
342
|
readonly signUpEnabled: boolean;
|
|
338
343
|
readonly credentialEnabled: boolean;
|
|
339
344
|
readonly magicLinkEnabled: boolean;
|
|
345
|
+
readonly clientTeamCreationEnabled: boolean;
|
|
340
346
|
readonly oauthProviders: OAuthProviderConfig[];
|
|
341
347
|
};
|
|
342
348
|
type OAuthProviderConfig = {
|
|
343
349
|
readonly id: string;
|
|
344
350
|
};
|
|
345
351
|
type AdminProjectConfig = {
|
|
352
|
+
readonly id: string;
|
|
346
353
|
readonly signUpEnabled: boolean;
|
|
347
354
|
readonly credentialEnabled: boolean;
|
|
348
355
|
readonly magicLinkEnabled: boolean;
|
|
356
|
+
readonly clientTeamCreationEnabled: boolean;
|
|
349
357
|
readonly allowLocalhost: boolean;
|
|
350
358
|
readonly oauthProviders: AdminOAuthProviderConfig[];
|
|
351
359
|
readonly emailConfig?: AdminEmailConfig;
|
|
@@ -353,7 +361,7 @@ type AdminProjectConfig = {
|
|
|
353
361
|
readonly createTeamOnSignUp: boolean;
|
|
354
362
|
readonly teamCreatorDefaultPermissions: AdminTeamPermission[];
|
|
355
363
|
readonly teamMemberDefaultPermissions: AdminTeamPermission[];
|
|
356
|
-
}
|
|
364
|
+
};
|
|
357
365
|
type AdminEmailConfig = ({
|
|
358
366
|
type: "standard";
|
|
359
367
|
senderName: string;
|
|
@@ -389,6 +397,7 @@ type AdminProjectConfigUpdateOptions = {
|
|
|
389
397
|
signUpEnabled?: boolean;
|
|
390
398
|
credentialEnabled?: boolean;
|
|
391
399
|
magicLinkEnabled?: boolean;
|
|
400
|
+
clientTeamCreationEnabled?: boolean;
|
|
392
401
|
allowLocalhost?: boolean;
|
|
393
402
|
createTeamOnSignUp?: boolean;
|
|
394
403
|
emailConfig?: AdminEmailConfig;
|
|
@@ -433,6 +442,21 @@ type ApiKeyCreateOptions = {
|
|
|
433
442
|
hasSecretServerKey: boolean;
|
|
434
443
|
hasSuperSecretAdminKey: boolean;
|
|
435
444
|
};
|
|
445
|
+
type TeamMemberProfile = {
|
|
446
|
+
displayName: string | null;
|
|
447
|
+
profileImageUrl: string | null;
|
|
448
|
+
};
|
|
449
|
+
type TeamMemberProfileUpdateOptions = {
|
|
450
|
+
displayName?: string;
|
|
451
|
+
profileImageUrl?: string | null;
|
|
452
|
+
};
|
|
453
|
+
type EditableTeamMemberProfile = TeamMemberProfile & {
|
|
454
|
+
update(update: TeamMemberProfileUpdateOptions): Promise<void>;
|
|
455
|
+
};
|
|
456
|
+
type TeamUser = {
|
|
457
|
+
id: string;
|
|
458
|
+
teamProfile: TeamMemberProfile;
|
|
459
|
+
};
|
|
436
460
|
type Team = {
|
|
437
461
|
id: string;
|
|
438
462
|
displayName: string;
|
|
@@ -440,14 +464,20 @@ type Team = {
|
|
|
440
464
|
inviteUser(options: {
|
|
441
465
|
email: string;
|
|
442
466
|
}): Promise<Result<undefined, KnownErrors["TeamPermissionRequired"]>>;
|
|
467
|
+
listUsers(): Promise<TeamUser[]>;
|
|
468
|
+
useUsers(): TeamUser[];
|
|
443
469
|
};
|
|
444
470
|
type TeamCreateOptions = {
|
|
445
471
|
displayName: string;
|
|
446
472
|
profileImageUrl?: string;
|
|
447
473
|
};
|
|
474
|
+
type ServerTeamMemberProfile = TeamMemberProfile;
|
|
475
|
+
type ServerTeamUser = ServerUser & {
|
|
476
|
+
teamProfile: ServerTeamMemberProfile;
|
|
477
|
+
};
|
|
448
478
|
type ServerTeam = {
|
|
449
479
|
createdAt: Date;
|
|
450
|
-
listUsers(): Promise<
|
|
480
|
+
listUsers(): Promise<ServerTeamUser[]>;
|
|
451
481
|
useUsers(): ServerUser[];
|
|
452
482
|
update(update: ServerTeamUpdateOptions): Promise<void>;
|
|
453
483
|
delete(): Promise<void>;
|
|
@@ -510,7 +540,7 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
510
540
|
signInWithCredential(options: {
|
|
511
541
|
email: string;
|
|
512
542
|
password: string;
|
|
513
|
-
}): Promise<KnownErrors["EmailPasswordMismatch"] | void>;
|
|
543
|
+
}): Promise<KnownErrors["EmailPasswordMismatch"] | KnownErrors["InvalidTotpCode"] | void>;
|
|
514
544
|
signUpWithCredential(options: {
|
|
515
545
|
email: string;
|
|
516
546
|
password: string;
|
|
@@ -529,7 +559,7 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
529
559
|
teamDisplayName: string;
|
|
530
560
|
}, KnownErrors["VerificationCodeError"]>>;
|
|
531
561
|
verifyEmail(code: string): Promise<KnownErrors["VerificationCodeError"] | void>;
|
|
532
|
-
signInWithMagicLink(code: string): Promise<KnownErrors["VerificationCodeError"] | void>;
|
|
562
|
+
signInWithMagicLink(code: string): Promise<KnownErrors["VerificationCodeError"] | KnownErrors["InvalidTotpCode"] | void>;
|
|
533
563
|
redirectToOAuthCallback(): Promise<void>;
|
|
534
564
|
useUser(options: GetUserOptions<HasTokenStore> & {
|
|
535
565
|
or: 'redirect';
|
|
@@ -616,4 +646,4 @@ type AsyncStoreProperty<Name extends string, Args extends any[], Value, IsMultip
|
|
|
616
646
|
[key in `use${Capitalize<Name>}`]: (...args: Args) => Value;
|
|
617
647
|
};
|
|
618
648
|
|
|
619
|
-
export { type AdminDomainConfig, type AdminEmailConfig, type AdminOAuthProviderConfig, type AdminOwnedProject, type AdminProject, type AdminProjectConfig, type AdminProjectConfigUpdateOptions, type AdminProjectCreateOptions, type AdminProjectUpdateOptions, type AdminTeamPermission, type AdminTeamPermissionDefinition, type AdminTeamPermissionDefinitionCreateOptions, type AdminTeamPermissionDefinitionUpdateOptions, type ApiKey, type ApiKeyBase, type ApiKeyBaseCrudRead, type ApiKeyCreateOptions, type ApiKeyFirstView, type Connection, type CurrentInternalServerUser, type CurrentInternalUser, type CurrentServerUser, type CurrentUser, type GetUserOptions, type HandlerUrls, type OAuthConnection, type OAuthProviderConfig, type OAuthScopesOnSignIn, type Project, type ProjectConfig, type ServerTeam, type ServerTeamCreateOptions, type ServerTeamUpdateOptions, type ServerUser, StackAdminApp, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructorOptions, type Team, type TeamCreateOptions, type TeamPermission, type TokenStoreInit, type User, serverTeamPermissionDefinitionCreateOptionsToCrud, serverTeamPermissionDefinitionUpdateOptionsToCrud, stackAppInternalsSymbol };
|
|
649
|
+
export { type AdminDomainConfig, type AdminEmailConfig, type AdminOAuthProviderConfig, type AdminOwnedProject, type AdminProject, type AdminProjectConfig, type AdminProjectConfigUpdateOptions, type AdminProjectCreateOptions, type AdminProjectUpdateOptions, type AdminTeamPermission, type AdminTeamPermissionDefinition, type AdminTeamPermissionDefinitionCreateOptions, type AdminTeamPermissionDefinitionUpdateOptions, type ApiKey, type ApiKeyBase, type ApiKeyBaseCrudRead, type ApiKeyCreateOptions, type ApiKeyFirstView, type Connection, type CurrentInternalServerUser, type CurrentInternalUser, type CurrentServerUser, type CurrentUser, type EditableTeamMemberProfile, type GetUserOptions, type HandlerUrls, type OAuthConnection, type OAuthProviderConfig, type OAuthScopesOnSignIn, type Project, type ProjectConfig, type ServerTeam, type ServerTeamCreateOptions, type ServerTeamMemberProfile, type ServerTeamUpdateOptions, type ServerTeamUser, type ServerUser, StackAdminApp, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructorOptions, type Team, type TeamCreateOptions, type TeamMemberProfile, type TeamPermission, type TeamUser, type TokenStoreInit, type User, serverTeamPermissionDefinitionCreateOptionsToCrud, serverTeamPermissionDefinitionUpdateOptionsToCrud, stackAppInternalsSymbol };
|
package/dist/lib/stack-app.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ type HandlerUrls = {
|
|
|
34
34
|
magicLinkCallback: string;
|
|
35
35
|
accountSettings: string;
|
|
36
36
|
teamInvitation: string;
|
|
37
|
+
teamCreation: string;
|
|
37
38
|
error: string;
|
|
38
39
|
};
|
|
39
40
|
type OAuthScopesOnSignIn = {
|
|
@@ -239,6 +240,9 @@ type UserExtra = {
|
|
|
239
240
|
hasPermission(scope: Team, permissionId: string): Promise<boolean>;
|
|
240
241
|
setSelectedTeam(team: Team | null): Promise<void>;
|
|
241
242
|
createTeam(data: TeamCreateOptions): Promise<Team>;
|
|
243
|
+
leaveTeam(team: Team): Promise<void>;
|
|
244
|
+
getTeamProfile(team: Team): Promise<EditableTeamMemberProfile>;
|
|
245
|
+
useTeamProfile(team: Team): EditableTeamMemberProfile;
|
|
242
246
|
} & AsyncStoreProperty<"team", [id: string], Team | null, false> & AsyncStoreProperty<"teams", [], Team[], true> & AsyncStoreProperty<"permission", [scope: Team, permissionId: string, options?: {
|
|
243
247
|
recursive?: boolean;
|
|
244
248
|
}], TeamPermission | null, false> & AsyncStoreProperty<"permissions", [scope: Team, options?: {
|
|
@@ -318,6 +322,7 @@ type AdminProject = {
|
|
|
318
322
|
readonly isProductionMode: boolean;
|
|
319
323
|
readonly config: AdminProjectConfig;
|
|
320
324
|
update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>;
|
|
325
|
+
delete(this: AdminProject): Promise<void>;
|
|
321
326
|
getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>;
|
|
322
327
|
useProductionModeErrors(this: AdminProject): ProductionModeError[];
|
|
323
328
|
} & Project;
|
|
@@ -337,15 +342,18 @@ type ProjectConfig = {
|
|
|
337
342
|
readonly signUpEnabled: boolean;
|
|
338
343
|
readonly credentialEnabled: boolean;
|
|
339
344
|
readonly magicLinkEnabled: boolean;
|
|
345
|
+
readonly clientTeamCreationEnabled: boolean;
|
|
340
346
|
readonly oauthProviders: OAuthProviderConfig[];
|
|
341
347
|
};
|
|
342
348
|
type OAuthProviderConfig = {
|
|
343
349
|
readonly id: string;
|
|
344
350
|
};
|
|
345
351
|
type AdminProjectConfig = {
|
|
352
|
+
readonly id: string;
|
|
346
353
|
readonly signUpEnabled: boolean;
|
|
347
354
|
readonly credentialEnabled: boolean;
|
|
348
355
|
readonly magicLinkEnabled: boolean;
|
|
356
|
+
readonly clientTeamCreationEnabled: boolean;
|
|
349
357
|
readonly allowLocalhost: boolean;
|
|
350
358
|
readonly oauthProviders: AdminOAuthProviderConfig[];
|
|
351
359
|
readonly emailConfig?: AdminEmailConfig;
|
|
@@ -353,7 +361,7 @@ type AdminProjectConfig = {
|
|
|
353
361
|
readonly createTeamOnSignUp: boolean;
|
|
354
362
|
readonly teamCreatorDefaultPermissions: AdminTeamPermission[];
|
|
355
363
|
readonly teamMemberDefaultPermissions: AdminTeamPermission[];
|
|
356
|
-
}
|
|
364
|
+
};
|
|
357
365
|
type AdminEmailConfig = ({
|
|
358
366
|
type: "standard";
|
|
359
367
|
senderName: string;
|
|
@@ -389,6 +397,7 @@ type AdminProjectConfigUpdateOptions = {
|
|
|
389
397
|
signUpEnabled?: boolean;
|
|
390
398
|
credentialEnabled?: boolean;
|
|
391
399
|
magicLinkEnabled?: boolean;
|
|
400
|
+
clientTeamCreationEnabled?: boolean;
|
|
392
401
|
allowLocalhost?: boolean;
|
|
393
402
|
createTeamOnSignUp?: boolean;
|
|
394
403
|
emailConfig?: AdminEmailConfig;
|
|
@@ -433,6 +442,21 @@ type ApiKeyCreateOptions = {
|
|
|
433
442
|
hasSecretServerKey: boolean;
|
|
434
443
|
hasSuperSecretAdminKey: boolean;
|
|
435
444
|
};
|
|
445
|
+
type TeamMemberProfile = {
|
|
446
|
+
displayName: string | null;
|
|
447
|
+
profileImageUrl: string | null;
|
|
448
|
+
};
|
|
449
|
+
type TeamMemberProfileUpdateOptions = {
|
|
450
|
+
displayName?: string;
|
|
451
|
+
profileImageUrl?: string | null;
|
|
452
|
+
};
|
|
453
|
+
type EditableTeamMemberProfile = TeamMemberProfile & {
|
|
454
|
+
update(update: TeamMemberProfileUpdateOptions): Promise<void>;
|
|
455
|
+
};
|
|
456
|
+
type TeamUser = {
|
|
457
|
+
id: string;
|
|
458
|
+
teamProfile: TeamMemberProfile;
|
|
459
|
+
};
|
|
436
460
|
type Team = {
|
|
437
461
|
id: string;
|
|
438
462
|
displayName: string;
|
|
@@ -440,14 +464,20 @@ type Team = {
|
|
|
440
464
|
inviteUser(options: {
|
|
441
465
|
email: string;
|
|
442
466
|
}): Promise<Result<undefined, KnownErrors["TeamPermissionRequired"]>>;
|
|
467
|
+
listUsers(): Promise<TeamUser[]>;
|
|
468
|
+
useUsers(): TeamUser[];
|
|
443
469
|
};
|
|
444
470
|
type TeamCreateOptions = {
|
|
445
471
|
displayName: string;
|
|
446
472
|
profileImageUrl?: string;
|
|
447
473
|
};
|
|
474
|
+
type ServerTeamMemberProfile = TeamMemberProfile;
|
|
475
|
+
type ServerTeamUser = ServerUser & {
|
|
476
|
+
teamProfile: ServerTeamMemberProfile;
|
|
477
|
+
};
|
|
448
478
|
type ServerTeam = {
|
|
449
479
|
createdAt: Date;
|
|
450
|
-
listUsers(): Promise<
|
|
480
|
+
listUsers(): Promise<ServerTeamUser[]>;
|
|
451
481
|
useUsers(): ServerUser[];
|
|
452
482
|
update(update: ServerTeamUpdateOptions): Promise<void>;
|
|
453
483
|
delete(): Promise<void>;
|
|
@@ -510,7 +540,7 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
510
540
|
signInWithCredential(options: {
|
|
511
541
|
email: string;
|
|
512
542
|
password: string;
|
|
513
|
-
}): Promise<KnownErrors["EmailPasswordMismatch"] | void>;
|
|
543
|
+
}): Promise<KnownErrors["EmailPasswordMismatch"] | KnownErrors["InvalidTotpCode"] | void>;
|
|
514
544
|
signUpWithCredential(options: {
|
|
515
545
|
email: string;
|
|
516
546
|
password: string;
|
|
@@ -529,7 +559,7 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
529
559
|
teamDisplayName: string;
|
|
530
560
|
}, KnownErrors["VerificationCodeError"]>>;
|
|
531
561
|
verifyEmail(code: string): Promise<KnownErrors["VerificationCodeError"] | void>;
|
|
532
|
-
signInWithMagicLink(code: string): Promise<KnownErrors["VerificationCodeError"] | void>;
|
|
562
|
+
signInWithMagicLink(code: string): Promise<KnownErrors["VerificationCodeError"] | KnownErrors["InvalidTotpCode"] | void>;
|
|
533
563
|
redirectToOAuthCallback(): Promise<void>;
|
|
534
564
|
useUser(options: GetUserOptions<HasTokenStore> & {
|
|
535
565
|
or: 'redirect';
|
|
@@ -616,4 +646,4 @@ type AsyncStoreProperty<Name extends string, Args extends any[], Value, IsMultip
|
|
|
616
646
|
[key in `use${Capitalize<Name>}`]: (...args: Args) => Value;
|
|
617
647
|
};
|
|
618
648
|
|
|
619
|
-
export { type AdminDomainConfig, type AdminEmailConfig, type AdminOAuthProviderConfig, type AdminOwnedProject, type AdminProject, type AdminProjectConfig, type AdminProjectConfigUpdateOptions, type AdminProjectCreateOptions, type AdminProjectUpdateOptions, type AdminTeamPermission, type AdminTeamPermissionDefinition, type AdminTeamPermissionDefinitionCreateOptions, type AdminTeamPermissionDefinitionUpdateOptions, type ApiKey, type ApiKeyBase, type ApiKeyBaseCrudRead, type ApiKeyCreateOptions, type ApiKeyFirstView, type Connection, type CurrentInternalServerUser, type CurrentInternalUser, type CurrentServerUser, type CurrentUser, type GetUserOptions, type HandlerUrls, type OAuthConnection, type OAuthProviderConfig, type OAuthScopesOnSignIn, type Project, type ProjectConfig, type ServerTeam, type ServerTeamCreateOptions, type ServerTeamUpdateOptions, type ServerUser, StackAdminApp, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructorOptions, type Team, type TeamCreateOptions, type TeamPermission, type TokenStoreInit, type User, serverTeamPermissionDefinitionCreateOptionsToCrud, serverTeamPermissionDefinitionUpdateOptionsToCrud, stackAppInternalsSymbol };
|
|
649
|
+
export { type AdminDomainConfig, type AdminEmailConfig, type AdminOAuthProviderConfig, type AdminOwnedProject, type AdminProject, type AdminProjectConfig, type AdminProjectConfigUpdateOptions, type AdminProjectCreateOptions, type AdminProjectUpdateOptions, type AdminTeamPermission, type AdminTeamPermissionDefinition, type AdminTeamPermissionDefinitionCreateOptions, type AdminTeamPermissionDefinitionUpdateOptions, type ApiKey, type ApiKeyBase, type ApiKeyBaseCrudRead, type ApiKeyCreateOptions, type ApiKeyFirstView, type Connection, type CurrentInternalServerUser, type CurrentInternalUser, type CurrentServerUser, type CurrentUser, type EditableTeamMemberProfile, type GetUserOptions, type HandlerUrls, type OAuthConnection, type OAuthProviderConfig, type OAuthScopesOnSignIn, type Project, type ProjectConfig, type ServerTeam, type ServerTeamCreateOptions, type ServerTeamMemberProfile, type ServerTeamUpdateOptions, type ServerTeamUser, type ServerUser, StackAdminApp, type StackAdminAppConstructorOptions, StackClientApp, type StackClientAppConstructorOptions, type StackClientAppJson, StackServerApp, type StackServerAppConstructorOptions, type Team, type TeamCreateOptions, type TeamMemberProfile, type TeamPermission, type TeamUser, type TokenStoreInit, type User, serverTeamPermissionDefinitionCreateOptionsToCrud, serverTeamPermissionDefinitionUpdateOptionsToCrud, stackAppInternalsSymbol };
|
package/dist/lib/stack-app.js
CHANGED
|
@@ -63,7 +63,7 @@ var import_url = require("../utils/url");
|
|
|
63
63
|
var import_auth = require("./auth");
|
|
64
64
|
var import_cookie = require("./cookie");
|
|
65
65
|
var NextNavigation = (0, import_compile_time.scrambleDuringCompileTime)(NextNavigationUnscrambled);
|
|
66
|
-
var clientVersion = "js @stackframe/stack@2.5.
|
|
66
|
+
var clientVersion = "js @stackframe/stack@2.5.19";
|
|
67
67
|
function getUrls(partial) {
|
|
68
68
|
const handler = partial.handler ?? "/handler";
|
|
69
69
|
const home = partial.home ?? "/";
|
|
@@ -85,6 +85,7 @@ function getUrls(partial) {
|
|
|
85
85
|
accountSettings: `${handler}/account-settings`,
|
|
86
86
|
error: `${handler}/error`,
|
|
87
87
|
teamInvitation: `${handler}/team-invitation`,
|
|
88
|
+
teamCreation: `${handler}/team-creation`,
|
|
88
89
|
...(0, import_objects.filterUndefined)(partial)
|
|
89
90
|
};
|
|
90
91
|
}
|
|
@@ -216,6 +217,16 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
216
217
|
});
|
|
217
218
|
}
|
|
218
219
|
);
|
|
220
|
+
this._teamMemberProfilesCache = createCacheBySession(
|
|
221
|
+
async (session, [teamId]) => {
|
|
222
|
+
return await this._interface.listTeamMemberProfiles({ teamId }, session);
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
this._currentUserTeamProfileCache = createCacheBySession(
|
|
226
|
+
async (session, [teamId]) => {
|
|
227
|
+
return await this._interface.getTeamMemberProfile({ teamId, userId: "me" }, session);
|
|
228
|
+
}
|
|
229
|
+
);
|
|
219
230
|
this._memoryTokenStore = createEmptyTokenStore();
|
|
220
231
|
this._requestTokenStores = /* @__PURE__ */ new WeakMap();
|
|
221
232
|
this._storedCookieTokenStore = null;
|
|
@@ -497,6 +508,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
497
508
|
return import_react2.default.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
498
509
|
}
|
|
499
510
|
async _signInToAccountWithTokens(tokens) {
|
|
511
|
+
if (!("accessToken" in tokens) || !("refreshToken" in tokens)) {
|
|
512
|
+
throw new import_errors.StackAssertionError("Invalid tokens object; can't sign in with this", { tokens });
|
|
513
|
+
}
|
|
500
514
|
const tokenStore = this._getOrCreateTokenStore();
|
|
501
515
|
tokenStore.set(tokens);
|
|
502
516
|
}
|
|
@@ -524,6 +538,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
524
538
|
signUpEnabled: crud.config.sign_up_enabled,
|
|
525
539
|
credentialEnabled: crud.config.credential_enabled,
|
|
526
540
|
magicLinkEnabled: crud.config.magic_link_enabled,
|
|
541
|
+
clientTeamCreationEnabled: crud.config.client_team_creation_enabled,
|
|
527
542
|
oauthProviders: crud.config.enabled_oauth_providers.map((p) => ({
|
|
528
543
|
id: p.id
|
|
529
544
|
}))
|
|
@@ -535,6 +550,15 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
535
550
|
id: crud.id
|
|
536
551
|
};
|
|
537
552
|
}
|
|
553
|
+
_clientTeamUserFromCrud(crud) {
|
|
554
|
+
return {
|
|
555
|
+
id: crud.user_id,
|
|
556
|
+
teamProfile: {
|
|
557
|
+
displayName: crud.display_name,
|
|
558
|
+
profileImageUrl: crud.profile_image_url
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
538
562
|
_clientTeamFromCrud(crud) {
|
|
539
563
|
const app = this;
|
|
540
564
|
return {
|
|
@@ -548,6 +572,14 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
548
572
|
session: app._getSession(),
|
|
549
573
|
callbackUrl: (0, import_url.constructRedirectUrl)(app.urls.teamInvitation)
|
|
550
574
|
});
|
|
575
|
+
},
|
|
576
|
+
async listUsers() {
|
|
577
|
+
const result = await app._teamMemberProfilesCache.getOrWait([app._getSession(), crud.id], "write-only");
|
|
578
|
+
return result.map((crud2) => app._clientTeamUserFromCrud(crud2));
|
|
579
|
+
},
|
|
580
|
+
useUsers() {
|
|
581
|
+
const result = useAsyncCache(app._teamMemberProfilesCache, [app._getSession(), crud.id], "team.useUsers()");
|
|
582
|
+
return result.map((crud2) => app._clientTeamUserFromCrud(crud2));
|
|
551
583
|
}
|
|
552
584
|
};
|
|
553
585
|
}
|
|
@@ -600,6 +632,24 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
600
632
|
}
|
|
601
633
|
};
|
|
602
634
|
}
|
|
635
|
+
_editableTeamProfileFromCrud(crud) {
|
|
636
|
+
const app = this;
|
|
637
|
+
return {
|
|
638
|
+
displayName: crud.display_name,
|
|
639
|
+
profileImageUrl: crud.profile_image_url,
|
|
640
|
+
async update(update) {
|
|
641
|
+
await app._interface.updateTeamMemberProfile({
|
|
642
|
+
teamId: crud.team_id,
|
|
643
|
+
userId: crud.user_id,
|
|
644
|
+
profile: {
|
|
645
|
+
display_name: update.displayName,
|
|
646
|
+
profile_image_url: update.profileImageUrl
|
|
647
|
+
}
|
|
648
|
+
}, app._getSession());
|
|
649
|
+
await app._currentUserTeamProfileCache.refresh([app._getSession(), crud.team_id]);
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
}
|
|
603
653
|
_createUserExtra(crud, session) {
|
|
604
654
|
const app = this;
|
|
605
655
|
async function getConnectedAccount(id, options) {
|
|
@@ -645,6 +695,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
645
695
|
await app._currentUserTeamsCache.refresh([session]);
|
|
646
696
|
return app._clientTeamFromCrud(crud2);
|
|
647
697
|
},
|
|
698
|
+
async leaveTeam(team) {
|
|
699
|
+
await app._interface.leaveTeam(team.id, session);
|
|
700
|
+
},
|
|
648
701
|
async listPermissions(scope, options) {
|
|
649
702
|
const recursive = options?.recursive ?? true;
|
|
650
703
|
const permissions = await app._currentUserPermissionsCache.getOrWait([session, scope.id, recursive], "write-only");
|
|
@@ -677,6 +730,14 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
677
730
|
},
|
|
678
731
|
async updatePassword(options) {
|
|
679
732
|
return await app._updatePassword(options, session);
|
|
733
|
+
},
|
|
734
|
+
async getTeamProfile(team) {
|
|
735
|
+
const result = await app._currentUserTeamProfileCache.getOrWait([session, team.id], "write-only");
|
|
736
|
+
return app._editableTeamProfileFromCrud(result);
|
|
737
|
+
},
|
|
738
|
+
useTeamProfile(team) {
|
|
739
|
+
const result = useAsyncCache(app._currentUserTeamProfileCache, [session, team.id], "user.useTeamProfile()");
|
|
740
|
+
return app._editableTeamProfileFromCrud(result);
|
|
680
741
|
}
|
|
681
742
|
};
|
|
682
743
|
}
|
|
@@ -813,6 +874,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
813
874
|
async redirectToTeamInvitation(options) {
|
|
814
875
|
return await this._redirectToHandler("teamInvitation", options);
|
|
815
876
|
}
|
|
877
|
+
async redirectToTeamCreation(options) {
|
|
878
|
+
return await this._redirectToHandler("teamCreation", options);
|
|
879
|
+
}
|
|
816
880
|
async sendForgotPasswordEmail(email) {
|
|
817
881
|
const redirectUrl = (0, import_url.constructRedirectUrl)(this.urls.passwordReset);
|
|
818
882
|
const error = await this._interface.sendForgotPasswordEmail(email, redirectUrl);
|
|
@@ -930,33 +994,48 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
930
994
|
}
|
|
931
995
|
);
|
|
932
996
|
}
|
|
997
|
+
/**
|
|
998
|
+
* @deprecated
|
|
999
|
+
* TODO remove
|
|
1000
|
+
*/
|
|
1001
|
+
async _experimentalMfa(error, session) {
|
|
1002
|
+
const otp = prompt("Please enter the six-digit TOTP code from your authenticator app.");
|
|
1003
|
+
if (!otp) {
|
|
1004
|
+
throw new import_stack_shared.KnownErrors.InvalidTotpCode();
|
|
1005
|
+
}
|
|
1006
|
+
return await this._interface.totpMfa(
|
|
1007
|
+
error.details?.attempt_code ?? (0, import_errors.throwErr)("attempt code missing"),
|
|
1008
|
+
otp,
|
|
1009
|
+
session
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* @deprecated
|
|
1014
|
+
* TODO remove
|
|
1015
|
+
*/
|
|
1016
|
+
async _catchMfaRequiredError(callback) {
|
|
1017
|
+
try {
|
|
1018
|
+
return await callback();
|
|
1019
|
+
} catch (e) {
|
|
1020
|
+
if (e instanceof import_stack_shared.KnownErrors.MultiFactorAuthenticationRequired) {
|
|
1021
|
+
return await this._experimentalMfa(e, this._getSession());
|
|
1022
|
+
}
|
|
1023
|
+
throw e;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
933
1026
|
async signInWithCredential(options) {
|
|
934
1027
|
this._ensurePersistentTokenStore();
|
|
935
1028
|
const session = this._getSession();
|
|
936
1029
|
let result;
|
|
937
1030
|
try {
|
|
938
|
-
result = await this.
|
|
1031
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
1032
|
+
return await this._interface.signInWithCredential(options.email, options.password, session);
|
|
1033
|
+
});
|
|
939
1034
|
} catch (e) {
|
|
940
|
-
if (
|
|
941
|
-
|
|
942
|
-
try {
|
|
943
|
-
if (!otp) {
|
|
944
|
-
throw new import_stack_shared.KnownErrors.InvalidTotpCode();
|
|
945
|
-
}
|
|
946
|
-
result = await this._interface.totpMfa(
|
|
947
|
-
e.details?.attempt_code ?? (0, import_errors.throwErr)("attempt code missing"),
|
|
948
|
-
otp,
|
|
949
|
-
session
|
|
950
|
-
);
|
|
951
|
-
} catch (e2) {
|
|
952
|
-
if (e2 instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
|
|
953
|
-
return e2;
|
|
954
|
-
}
|
|
955
|
-
throw e2;
|
|
956
|
-
}
|
|
957
|
-
} else {
|
|
958
|
-
throw e;
|
|
1035
|
+
if (e instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
|
|
1036
|
+
return e;
|
|
959
1037
|
}
|
|
1038
|
+
throw e;
|
|
960
1039
|
}
|
|
961
1040
|
if (!(result instanceof import_stack_shared.KnownError)) {
|
|
962
1041
|
await this._signInToAccountWithTokens(result);
|
|
@@ -982,7 +1061,17 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
982
1061
|
}
|
|
983
1062
|
async signInWithMagicLink(code) {
|
|
984
1063
|
this._ensurePersistentTokenStore();
|
|
985
|
-
|
|
1064
|
+
let result;
|
|
1065
|
+
try {
|
|
1066
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
1067
|
+
return await this._interface.signInWithMagicLink(code);
|
|
1068
|
+
});
|
|
1069
|
+
} catch (e) {
|
|
1070
|
+
if (e instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
|
|
1071
|
+
return e;
|
|
1072
|
+
}
|
|
1073
|
+
throw e;
|
|
1074
|
+
}
|
|
986
1075
|
if (result instanceof import_stack_shared.KnownError) {
|
|
987
1076
|
return result;
|
|
988
1077
|
}
|
|
@@ -995,10 +1084,21 @@ var _StackClientAppImpl = class __StackClientAppImpl {
|
|
|
995
1084
|
}
|
|
996
1085
|
async callOAuthCallback() {
|
|
997
1086
|
this._ensurePersistentTokenStore();
|
|
998
|
-
|
|
1087
|
+
let result;
|
|
1088
|
+
try {
|
|
1089
|
+
result = await this._catchMfaRequiredError(async () => {
|
|
1090
|
+
return await (0, import_auth.callOAuthCallback)(this._interface, this.urls.oauthCallback);
|
|
1091
|
+
});
|
|
1092
|
+
} catch (e) {
|
|
1093
|
+
if (e instanceof import_stack_shared.KnownErrors.InvalidTotpCode) {
|
|
1094
|
+
alert("Invalid TOTP code. Please try signing in again.");
|
|
1095
|
+
}
|
|
1096
|
+
throw e;
|
|
1097
|
+
}
|
|
999
1098
|
if (result) {
|
|
1099
|
+
console.log("OAuth callback result", result);
|
|
1000
1100
|
await this._signInToAccountWithTokens(result);
|
|
1001
|
-
if (result.afterCallbackRedirectUrl) {
|
|
1101
|
+
if ("afterCallbackRedirectUrl" in result && result.afterCallbackRedirectUrl) {
|
|
1002
1102
|
await _redirectTo(result.afterCallbackRedirectUrl, { replace: true });
|
|
1003
1103
|
return true;
|
|
1004
1104
|
} else if (result.newUser) {
|
|
@@ -1152,9 +1252,6 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1152
1252
|
this._serverTeamsCache = createCache(async ([userId]) => {
|
|
1153
1253
|
return await this._interface.listServerTeams({ userId });
|
|
1154
1254
|
});
|
|
1155
|
-
this._serverTeamUsersCache = createCache(async ([teamId]) => {
|
|
1156
|
-
return await this._interface.listServerTeamUsers(teamId);
|
|
1157
|
-
});
|
|
1158
1255
|
this._serverTeamUserPermissionsCache = createCache(async ([teamId, userId, recursive]) => {
|
|
1159
1256
|
return await this._interface.listServerTeamPermissions({ teamId, userId, recursive }, null);
|
|
1160
1257
|
});
|
|
@@ -1184,12 +1281,33 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1184
1281
|
});
|
|
1185
1282
|
}
|
|
1186
1283
|
);
|
|
1284
|
+
this._serverTeamMemberProfilesCache = createCache(
|
|
1285
|
+
async ([teamId]) => {
|
|
1286
|
+
return await this._interface.listServerTeamMemberProfiles({ teamId });
|
|
1287
|
+
}
|
|
1288
|
+
);
|
|
1289
|
+
this._serverUserTeamProfileCache = createCache(
|
|
1290
|
+
async ([teamId, userId]) => {
|
|
1291
|
+
return await this._interface.getServerTeamMemberProfile({ teamId, userId });
|
|
1292
|
+
}
|
|
1293
|
+
);
|
|
1187
1294
|
}
|
|
1188
1295
|
async _updateServerUser(userId, update) {
|
|
1189
1296
|
const result = await this._interface.updateServerUser(userId, serverUserUpdateOptionsToCrud(update));
|
|
1190
1297
|
await this._refreshUsers();
|
|
1191
1298
|
return result;
|
|
1192
1299
|
}
|
|
1300
|
+
_serverEditableTeamProfileFromCrud(crud) {
|
|
1301
|
+
const app = this;
|
|
1302
|
+
const clientProfile = this._editableTeamProfileFromCrud(crud);
|
|
1303
|
+
return {
|
|
1304
|
+
...clientProfile,
|
|
1305
|
+
async update(update) {
|
|
1306
|
+
await clientProfile.update(update);
|
|
1307
|
+
await app._serverUserTeamProfileCache.refresh([crud.team_id, crud.user_id]);
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1193
1311
|
_serverUserFromCrud(crud) {
|
|
1194
1312
|
const app = this;
|
|
1195
1313
|
async function getConnectedAccount(id, options) {
|
|
@@ -1268,6 +1386,9 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1268
1386
|
await app._serverTeamsCache.refresh([void 0]);
|
|
1269
1387
|
return app._serverTeamFromCrud(team);
|
|
1270
1388
|
},
|
|
1389
|
+
leaveTeam: async (team) => {
|
|
1390
|
+
await app._interface.leaveServerTeam({ teamId: team.id, userId: crud.id });
|
|
1391
|
+
},
|
|
1271
1392
|
async listPermissions(scope, options) {
|
|
1272
1393
|
const recursive = options?.recursive ?? true;
|
|
1273
1394
|
const permissions = await app._serverTeamUserPermissionsCache.getOrWait([scope.id, crud.id, recursive], "write-only");
|
|
@@ -1297,6 +1418,23 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1297
1418
|
},
|
|
1298
1419
|
async updatePassword(options) {
|
|
1299
1420
|
return await app._checkFeatureSupport("updatePassword() on ServerUser", {});
|
|
1421
|
+
},
|
|
1422
|
+
async getTeamProfile(team) {
|
|
1423
|
+
const result = await app._serverUserTeamProfileCache.getOrWait([team.id, crud.id], "write-only");
|
|
1424
|
+
return app._serverEditableTeamProfileFromCrud(result);
|
|
1425
|
+
},
|
|
1426
|
+
useTeamProfile(team) {
|
|
1427
|
+
const result = useAsyncCache(app._serverUserTeamProfileCache, [team.id, crud.id], "user.useTeamProfile()");
|
|
1428
|
+
return (0, import_react2.useMemo)(() => app._serverEditableTeamProfileFromCrud(result), [result]);
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
_serverTeamUserFromCrud(crud) {
|
|
1433
|
+
return {
|
|
1434
|
+
...this._serverUserFromCrud(crud.user),
|
|
1435
|
+
teamProfile: {
|
|
1436
|
+
displayName: crud.display_name,
|
|
1437
|
+
profileImageUrl: crud.profile_image_url
|
|
1300
1438
|
}
|
|
1301
1439
|
};
|
|
1302
1440
|
}
|
|
@@ -1317,9 +1455,6 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1317
1455
|
displayName: crud.display_name,
|
|
1318
1456
|
profileImageUrl: crud.profile_image_url,
|
|
1319
1457
|
createdAt: new Date(crud.created_at_millis),
|
|
1320
|
-
async listUsers() {
|
|
1321
|
-
return (await app._interface.listServerTeamUsers(crud.id)).map((u) => app._serverUserFromCrud(u));
|
|
1322
|
-
},
|
|
1323
1458
|
async update(update) {
|
|
1324
1459
|
await app._interface.updateServerTeam(crud.id, serverTeamUpdateOptionsToCrud(update));
|
|
1325
1460
|
await app._serverTeamsCache.refresh([void 0]);
|
|
@@ -1328,23 +1463,27 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
|
|
|
1328
1463
|
await app._interface.deleteServerTeam(crud.id);
|
|
1329
1464
|
await app._serverTeamsCache.refresh([void 0]);
|
|
1330
1465
|
},
|
|
1466
|
+
async listUsers() {
|
|
1467
|
+
const result = await app._serverTeamMemberProfilesCache.getOrWait([crud.id], "write-only");
|
|
1468
|
+
return result.map((u) => app._serverTeamUserFromCrud(u));
|
|
1469
|
+
},
|
|
1331
1470
|
useUsers() {
|
|
1332
|
-
const result = useAsyncCache(app.
|
|
1333
|
-
return (0, import_react2.useMemo)(() => result.map((u) => app.
|
|
1471
|
+
const result = useAsyncCache(app._serverTeamMemberProfilesCache, [crud.id], "team.useUsers()");
|
|
1472
|
+
return (0, import_react2.useMemo)(() => result.map((u) => app._serverTeamUserFromCrud(u)), [result]);
|
|
1334
1473
|
},
|
|
1335
1474
|
async addUser(userId) {
|
|
1336
1475
|
await app._interface.addServerUserToTeam({
|
|
1337
1476
|
teamId: crud.id,
|
|
1338
1477
|
userId
|
|
1339
1478
|
});
|
|
1340
|
-
await app.
|
|
1479
|
+
await app._serverTeamMemberProfilesCache.refresh([crud.id]);
|
|
1341
1480
|
},
|
|
1342
1481
|
async removeUser(userId) {
|
|
1343
1482
|
await app._interface.removeServerUserFromTeam({
|
|
1344
1483
|
teamId: crud.id,
|
|
1345
1484
|
userId
|
|
1346
1485
|
});
|
|
1347
|
-
await app.
|
|
1486
|
+
await app._serverTeamMemberProfilesCache.refresh([crud.id]);
|
|
1348
1487
|
},
|
|
1349
1488
|
async inviteUser(options) {
|
|
1350
1489
|
return await app._interface.sendTeamInvitation({
|
|
@@ -1541,6 +1680,7 @@ var _StackAdminAppImpl = class extends _StackServerAppImpl {
|
|
|
1541
1680
|
signUpEnabled: data.config.sign_up_enabled,
|
|
1542
1681
|
credentialEnabled: data.config.credential_enabled,
|
|
1543
1682
|
magicLinkEnabled: data.config.magic_link_enabled,
|
|
1683
|
+
clientTeamCreationEnabled: data.config.client_team_creation_enabled,
|
|
1544
1684
|
allowLocalhost: data.config.allow_localhost,
|
|
1545
1685
|
oauthProviders: data.config.oauth_providers.map((p) => p.type === "shared" ? {
|
|
1546
1686
|
id: p.id,
|
|
@@ -1577,6 +1717,9 @@ var _StackAdminAppImpl = class extends _StackServerAppImpl {
|
|
|
1577
1717
|
await app._interface.updateProject(adminProjectUpdateOptionsToCrud(update));
|
|
1578
1718
|
await onRefresh();
|
|
1579
1719
|
},
|
|
1720
|
+
async delete() {
|
|
1721
|
+
await app._interface.deleteProject();
|
|
1722
|
+
},
|
|
1580
1723
|
async getProductionModeErrors() {
|
|
1581
1724
|
return (0, import_production_mode.getProductionModeErrors)(data);
|
|
1582
1725
|
},
|
|
@@ -1781,6 +1924,7 @@ function adminProjectUpdateOptionsToCrud(options) {
|
|
|
1781
1924
|
magic_link_enabled: options.config?.magicLinkEnabled,
|
|
1782
1925
|
allow_localhost: options.config?.allowLocalhost,
|
|
1783
1926
|
create_team_on_sign_up: options.config?.createTeamOnSignUp,
|
|
1927
|
+
client_team_creation_enabled: options.config?.clientTeamCreationEnabled,
|
|
1784
1928
|
team_creator_default_permissions: options.config?.teamCreatorDefaultPermissions,
|
|
1785
1929
|
team_member_default_permissions: options.config?.teamMemberDefaultPermissions
|
|
1786
1930
|
}
|