fix(server): use new LocalWorkspace ServerFeature instead (#13091)
keep compatibility close AF-2720 #### PR Dependency Tree * **PR #13091** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Added a new `LocalWorkspace` feature flag to server configuration, enabling more flexible feature management. * **Deprecations** * The `allowGuestDemoWorkspace` flag is now deprecated and will be removed in version 0.25.0. Please use the `features` array for feature checks instead. * **Bug Fixes** * Updated UI and logic throughout the app to rely on the new `LocalWorkspace` feature flag rather than the deprecated boolean flag. * **Chores** * Removed references to `allowGuestDemoWorkspace` from configuration, queries, and type definitions for improved consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> #### PR Dependency Tree * **PR #13091** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -21,3 +21,13 @@ e2e('should comment feature enabled by default', async t => {
|
|||||||
JSON.stringify(serverConfig, null, 2)
|
JSON.stringify(serverConfig, null, 2)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
e2e('should enable local workspace feature by default', async t => {
|
||||||
|
const { serverConfig } = await app.gql({ query: serverConfigQuery });
|
||||||
|
|
||||||
|
t.is(
|
||||||
|
serverConfig.features.includes(ServerFeature.LocalWorkspace),
|
||||||
|
true,
|
||||||
|
JSON.stringify(serverConfig, null, 2)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export class ServerConfigResolver {
|
|||||||
baseUrl: this.url.requestBaseUrl,
|
baseUrl: this.url.requestBaseUrl,
|
||||||
type: env.DEPLOYMENT_TYPE,
|
type: env.DEPLOYMENT_TYPE,
|
||||||
features: this.server.features,
|
features: this.server.features,
|
||||||
|
// TODO(@fengmk2): remove this field after the feature 0.25.0 is released
|
||||||
allowGuestDemoWorkspace: this.config.flags.allowGuestDemoWorkspace,
|
allowGuestDemoWorkspace: this.config.flags.allowGuestDemoWorkspace,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,13 @@ export class ServerService implements OnApplicationBootstrap {
|
|||||||
this.event.emit('config.changed', event);
|
this.event.emit('config.changed', event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnEvent('config.changed')
|
||||||
|
onConfigChanged(event: Events['config.changed']) {
|
||||||
|
if ('flags' in event.updates) {
|
||||||
|
this.onFlagsChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async revalidateConfig() {
|
async revalidateConfig() {
|
||||||
const overrides = await this.loadDbOverrides();
|
const overrides = await this.loadDbOverrides();
|
||||||
this.configFactory.override(overrides);
|
this.configFactory.override(overrides);
|
||||||
@@ -122,6 +129,7 @@ export class ServerService implements OnApplicationBootstrap {
|
|||||||
await this.event.emitAsync('config.init', {
|
await this.event.emitAsync('config.init', {
|
||||||
config: this.configFactory.config,
|
config: this.configFactory.config,
|
||||||
});
|
});
|
||||||
|
this.onFlagsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async loadDbOverrides() {
|
private async loadDbOverrides() {
|
||||||
@@ -134,4 +142,13 @@ export class ServerService implements OnApplicationBootstrap {
|
|||||||
|
|
||||||
return overrides;
|
return overrides;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private onFlagsChanged() {
|
||||||
|
const flags = this.configFactory.config.flags;
|
||||||
|
if (flags.allowGuestDemoWorkspace) {
|
||||||
|
this.enableFeature(ServerFeature.LocalWorkspace);
|
||||||
|
} else {
|
||||||
|
this.disableFeature(ServerFeature.LocalWorkspace);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export enum ServerFeature {
|
|||||||
OAuth = 'oauth',
|
OAuth = 'oauth',
|
||||||
Indexer = 'indexer',
|
Indexer = 'indexer',
|
||||||
Comment = 'comment',
|
Comment = 'comment',
|
||||||
|
LocalWorkspace = 'local_workspace',
|
||||||
}
|
}
|
||||||
|
|
||||||
registerEnumType(ServerFeature, {
|
registerEnumType(ServerFeature, {
|
||||||
@@ -42,6 +43,8 @@ export class ServerConfigType {
|
|||||||
|
|
||||||
@Field(() => Boolean, {
|
@Field(() => Boolean, {
|
||||||
description: 'Whether allow guest users to create demo workspaces.',
|
description: 'Whether allow guest users to create demo workspaces.',
|
||||||
|
deprecationReason:
|
||||||
|
'This field is deprecated, please use `features` instead. Will be removed in 0.25.0',
|
||||||
})
|
})
|
||||||
allowGuestDemoWorkspace!: boolean;
|
allowGuestDemoWorkspace!: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1760,7 +1760,7 @@ enum SearchTable {
|
|||||||
|
|
||||||
type ServerConfigType {
|
type ServerConfigType {
|
||||||
"""Whether allow guest users to create demo workspaces."""
|
"""Whether allow guest users to create demo workspaces."""
|
||||||
allowGuestDemoWorkspace: Boolean!
|
allowGuestDemoWorkspace: Boolean! @deprecated(reason: "This field is deprecated, please use `features` instead. Will be removed in 0.25.0")
|
||||||
|
|
||||||
"""fetch latest available upgradable release of server"""
|
"""fetch latest available upgradable release of server"""
|
||||||
availableUpgrade: ReleaseVersionType
|
availableUpgrade: ReleaseVersionType
|
||||||
@@ -1802,6 +1802,7 @@ enum ServerFeature {
|
|||||||
Copilot
|
Copilot
|
||||||
CopilotEmbedding
|
CopilotEmbedding
|
||||||
Indexer
|
Indexer
|
||||||
|
LocalWorkspace
|
||||||
OAuth
|
OAuth
|
||||||
Payment
|
Payment
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ query adminServerConfig {
|
|||||||
baseUrl
|
baseUrl
|
||||||
name
|
name
|
||||||
features
|
features
|
||||||
allowGuestDemoWorkspace
|
|
||||||
type
|
type
|
||||||
initialized
|
initialized
|
||||||
credentialsRequirement {
|
credentialsRequirement {
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ export const adminServerConfigQuery = {
|
|||||||
baseUrl
|
baseUrl
|
||||||
name
|
name
|
||||||
features
|
features
|
||||||
allowGuestDemoWorkspace
|
|
||||||
type
|
type
|
||||||
initialized
|
initialized
|
||||||
credentialsRequirement {
|
credentialsRequirement {
|
||||||
@@ -2090,7 +2089,6 @@ export const serverConfigQuery = {
|
|||||||
baseUrl
|
baseUrl
|
||||||
name
|
name
|
||||||
features
|
features
|
||||||
allowGuestDemoWorkspace
|
|
||||||
type
|
type
|
||||||
initialized
|
initialized
|
||||||
credentialsRequirement {
|
credentialsRequirement {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ query serverConfig {
|
|||||||
baseUrl
|
baseUrl
|
||||||
name
|
name
|
||||||
features
|
features
|
||||||
allowGuestDemoWorkspace
|
|
||||||
type
|
type
|
||||||
initialized
|
initialized
|
||||||
credentialsRequirement {
|
credentialsRequirement {
|
||||||
|
|||||||
@@ -2349,7 +2349,10 @@ export enum SearchTable {
|
|||||||
|
|
||||||
export interface ServerConfigType {
|
export interface ServerConfigType {
|
||||||
__typename?: 'ServerConfigType';
|
__typename?: 'ServerConfigType';
|
||||||
/** Whether allow guest users to create demo workspaces. */
|
/**
|
||||||
|
* Whether allow guest users to create demo workspaces.
|
||||||
|
* @deprecated This field is deprecated, please use `features` instead. Will be removed in 0.25.0
|
||||||
|
*/
|
||||||
allowGuestDemoWorkspace: Scalars['Boolean']['output'];
|
allowGuestDemoWorkspace: Scalars['Boolean']['output'];
|
||||||
/** fetch latest available upgradable release of server */
|
/** fetch latest available upgradable release of server */
|
||||||
availableUpgrade: Maybe<ReleaseVersionType>;
|
availableUpgrade: Maybe<ReleaseVersionType>;
|
||||||
@@ -2383,6 +2386,7 @@ export enum ServerFeature {
|
|||||||
Copilot = 'Copilot',
|
Copilot = 'Copilot',
|
||||||
CopilotEmbedding = 'CopilotEmbedding',
|
CopilotEmbedding = 'CopilotEmbedding',
|
||||||
Indexer = 'Indexer',
|
Indexer = 'Indexer',
|
||||||
|
LocalWorkspace = 'LocalWorkspace',
|
||||||
OAuth = 'OAuth',
|
OAuth = 'OAuth',
|
||||||
Payment = 'Payment',
|
Payment = 'Payment',
|
||||||
}
|
}
|
||||||
@@ -2964,7 +2968,6 @@ export type AdminServerConfigQuery = {
|
|||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
name: string;
|
name: string;
|
||||||
features: Array<ServerFeature>;
|
features: Array<ServerFeature>;
|
||||||
allowGuestDemoWorkspace: boolean;
|
|
||||||
type: ServerDeploymentType;
|
type: ServerDeploymentType;
|
||||||
initialized: boolean;
|
initialized: boolean;
|
||||||
availableUserFeatures: Array<FeatureType>;
|
availableUserFeatures: Array<FeatureType>;
|
||||||
@@ -5736,7 +5739,6 @@ export type ServerConfigQuery = {
|
|||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
name: string;
|
name: string;
|
||||||
features: Array<ServerFeature>;
|
features: Array<ServerFeature>;
|
||||||
allowGuestDemoWorkspace: boolean;
|
|
||||||
type: ServerDeploymentType;
|
type: ServerDeploymentType;
|
||||||
initialized: boolean;
|
initialized: boolean;
|
||||||
credentialsRequirement: {
|
credentialsRequirement: {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @vitest-environment happy-dom
|
* @vitest-environment happy-dom
|
||||||
*/
|
*/
|
||||||
|
import { ServerFeature } from '@affine/graphql';
|
||||||
import { renderHook, waitFor } from '@testing-library/react';
|
import { renderHook, waitFor } from '@testing-library/react';
|
||||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||||
|
|
||||||
@@ -24,8 +25,10 @@ vi.mock('@toeverything/infra', () => {
|
|||||||
server: {
|
server: {
|
||||||
config$: {
|
config$: {
|
||||||
value: {
|
value: {
|
||||||
get allowGuestDemoWorkspace() {
|
get features() {
|
||||||
return allowGuestDemo;
|
return allowGuestDemo !== false
|
||||||
|
? [ServerFeature.LocalWorkspace]
|
||||||
|
: [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
} from '@affine/component';
|
} from '@affine/component';
|
||||||
import { AuthService, DefaultServerService } from '@affine/core/modules/cloud';
|
import { AuthService, DefaultServerService } from '@affine/core/modules/cloud';
|
||||||
import { UserFriendlyError } from '@affine/error';
|
import { UserFriendlyError } from '@affine/error';
|
||||||
|
import { ServerFeature } from '@affine/graphql';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { useService, useServices } from '@toeverything/infra';
|
import { useService, useServices } from '@toeverything/infra';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
@@ -32,12 +33,15 @@ export const useSignOut = ({
|
|||||||
|
|
||||||
const signOut = useCallback(async () => {
|
const signOut = useCallback(async () => {
|
||||||
onConfirm?.()?.catch(console.error);
|
onConfirm?.()?.catch(console.error);
|
||||||
|
const enableLocalWorkspace =
|
||||||
|
BUILD_CONFIG.isNative ||
|
||||||
|
defaultServerService.server.config$.value.features.includes(
|
||||||
|
ServerFeature.LocalWorkspace
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await authService.signOut();
|
await authService.signOut();
|
||||||
if (
|
if (enableLocalWorkspace) {
|
||||||
defaultServerService.server.config$.value.allowGuestDemoWorkspace !==
|
|
||||||
false
|
|
||||||
) {
|
|
||||||
jumpToIndex();
|
jumpToIndex();
|
||||||
} else {
|
} else {
|
||||||
jumpToSignIn();
|
jumpToSignIn();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { MenuItem } from '@affine/component/ui/menu';
|
import { MenuItem } from '@affine/component/ui/menu';
|
||||||
import { DefaultServerService } from '@affine/core/modules/cloud';
|
import { DefaultServerService } from '@affine/core/modules/cloud';
|
||||||
|
import { ServerFeature } from '@affine/graphql';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { ImportIcon, PlusIcon } from '@blocksuite/icons/rc';
|
import { ImportIcon, PlusIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
@@ -15,10 +16,13 @@ export const AddWorkspace = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const defaultServerService = useService(DefaultServerService);
|
const defaultServerService = useService(DefaultServerService);
|
||||||
const allowGuestDemo = useLiveData(
|
const enableLocalWorkspace = useLiveData(
|
||||||
defaultServerService.server.config$.selector(c => c.allowGuestDemoWorkspace)
|
defaultServerService.server.config$.selector(
|
||||||
|
c =>
|
||||||
|
c.features.includes(ServerFeature.LocalWorkspace) ||
|
||||||
|
BUILD_CONFIG.isNative
|
||||||
|
)
|
||||||
);
|
);
|
||||||
const guestDemoEnabled = allowGuestDemo !== false;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -45,7 +49,7 @@ export const AddWorkspace = ({
|
|||||||
className={styles.ItemContainer}
|
className={styles.ItemContainer}
|
||||||
>
|
>
|
||||||
<div className={styles.ItemText}>
|
<div className={styles.ItemText}>
|
||||||
{guestDemoEnabled
|
{enableLocalWorkspace
|
||||||
? t['com.affine.workspaceList.addWorkspace.create']()
|
? t['com.affine.workspaceList.addWorkspace.create']()
|
||||||
: t['com.affine.workspaceList.addWorkspace.create-cloud']()}
|
: t['com.affine.workspaceList.addWorkspace.create-cloud']()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { MenuItem } from '@affine/component/ui/menu';
|
|||||||
import { AuthService, DefaultServerService } from '@affine/core/modules/cloud';
|
import { AuthService, DefaultServerService } from '@affine/core/modules/cloud';
|
||||||
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
import { GlobalDialogService } from '@affine/core/modules/dialogs';
|
||||||
import { type WorkspaceMetadata } from '@affine/core/modules/workspace';
|
import { type WorkspaceMetadata } from '@affine/core/modules/workspace';
|
||||||
|
import { ServerFeature } from '@affine/graphql';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { track } from '@affine/track';
|
import { track } from '@affine/track';
|
||||||
import { Logo1Icon } from '@blocksuite/icons/rc';
|
import { Logo1Icon } from '@blocksuite/icons/rc';
|
||||||
@@ -74,11 +75,12 @@ export const UserWithWorkspaceList = ({
|
|||||||
}, [globalDialogService]);
|
}, [globalDialogService]);
|
||||||
|
|
||||||
const onNewWorkspace = useCallback(() => {
|
const onNewWorkspace = useCallback(() => {
|
||||||
if (
|
const enableLocalWorkspace =
|
||||||
!isAuthenticated &&
|
BUILD_CONFIG.isNative ||
|
||||||
defaultServerService.server.config$.value.allowGuestDemoWorkspace ===
|
defaultServerService.server.config$.value.features.includes(
|
||||||
false
|
ServerFeature.LocalWorkspace
|
||||||
) {
|
);
|
||||||
|
if (!isAuthenticated && !enableLocalWorkspace) {
|
||||||
return openSignInModal();
|
return openSignInModal();
|
||||||
}
|
}
|
||||||
track.$.navigationPanel.workspaceList.createWorkspace();
|
track.$.navigationPanel.workspaceList.createWorkspace();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
buildShowcaseWorkspace,
|
buildShowcaseWorkspace,
|
||||||
createFirstAppData,
|
createFirstAppData,
|
||||||
} from '@affine/core/utils/first-app-data';
|
} from '@affine/core/utils/first-app-data';
|
||||||
|
import { ServerFeature } from '@affine/graphql';
|
||||||
import {
|
import {
|
||||||
useLiveData,
|
useLiveData,
|
||||||
useService,
|
useService,
|
||||||
@@ -52,10 +53,12 @@ export const Component = ({
|
|||||||
const loggedIn = useLiveData(
|
const loggedIn = useLiveData(
|
||||||
authService.session.status$.map(s => s === 'authenticated')
|
authService.session.status$.map(s => s === 'authenticated')
|
||||||
);
|
);
|
||||||
const allowGuestDemo =
|
const enableLocalWorkspace =
|
||||||
useLiveData(
|
useLiveData(
|
||||||
defaultServerService.server.config$.selector(
|
defaultServerService.server.config$.selector(
|
||||||
c => c.allowGuestDemoWorkspace
|
c =>
|
||||||
|
c.features.includes(ServerFeature.LocalWorkspace) ||
|
||||||
|
BUILD_CONFIG.isNative
|
||||||
)
|
)
|
||||||
) ?? true;
|
) ?? true;
|
||||||
|
|
||||||
@@ -92,7 +95,7 @@ export const Component = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allowGuestDemo && !loggedIn) {
|
if (!enableLocalWorkspace && !loggedIn) {
|
||||||
localStorage.removeItem('last_workspace_id');
|
localStorage.removeItem('last_workspace_id');
|
||||||
jumpToSignIn();
|
jumpToSignIn();
|
||||||
return;
|
return;
|
||||||
@@ -125,7 +128,7 @@ export const Component = ({
|
|||||||
openPage(openWorkspace.id, defaultIndexRoute, RouteLogic.REPLACE);
|
openPage(openWorkspace.id, defaultIndexRoute, RouteLogic.REPLACE);
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
allowGuestDemo,
|
enableLocalWorkspace,
|
||||||
createCloudWorkspace,
|
createCloudWorkspace,
|
||||||
list,
|
list,
|
||||||
openPage,
|
openPage,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
// since we never build desktop app in selfhosted mode, so it's fine
|
// since we never build desktop app in selfhosted mode, so it's fine
|
||||||
config: {
|
config: {
|
||||||
serverName: 'Affine Selfhost',
|
serverName: 'Affine Selfhost',
|
||||||
features: [],
|
features: [ServerFeature.LocalWorkspace],
|
||||||
oauthProviders: [],
|
oauthProviders: [],
|
||||||
type: ServerDeploymentType.Selfhosted,
|
type: ServerDeploymentType.Selfhosted,
|
||||||
credentialsRequirement: {
|
credentialsRequirement: {
|
||||||
@@ -26,7 +26,6 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allowGuestDemoWorkspace: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -45,6 +44,7 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
ServerFeature.CopilotEmbedding,
|
ServerFeature.CopilotEmbedding,
|
||||||
ServerFeature.OAuth,
|
ServerFeature.OAuth,
|
||||||
ServerFeature.Payment,
|
ServerFeature.Payment,
|
||||||
|
ServerFeature.LocalWorkspace,
|
||||||
],
|
],
|
||||||
oauthProviders: [
|
oauthProviders: [
|
||||||
OAuthProviderType.Google,
|
OAuthProviderType.Google,
|
||||||
@@ -57,7 +57,6 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allowGuestDemoWorkspace: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -78,6 +77,7 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
ServerFeature.CopilotEmbedding,
|
ServerFeature.CopilotEmbedding,
|
||||||
ServerFeature.OAuth,
|
ServerFeature.OAuth,
|
||||||
ServerFeature.Payment,
|
ServerFeature.Payment,
|
||||||
|
ServerFeature.LocalWorkspace,
|
||||||
],
|
],
|
||||||
oauthProviders: [
|
oauthProviders: [
|
||||||
OAuthProviderType.Google,
|
OAuthProviderType.Google,
|
||||||
@@ -90,7 +90,6 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allowGuestDemoWorkspace: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -111,6 +110,7 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
ServerFeature.CopilotEmbedding,
|
ServerFeature.CopilotEmbedding,
|
||||||
ServerFeature.OAuth,
|
ServerFeature.OAuth,
|
||||||
ServerFeature.Payment,
|
ServerFeature.Payment,
|
||||||
|
ServerFeature.LocalWorkspace,
|
||||||
],
|
],
|
||||||
oauthProviders: [
|
oauthProviders: [
|
||||||
OAuthProviderType.Google,
|
OAuthProviderType.Google,
|
||||||
@@ -123,7 +123,6 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allowGuestDemoWorkspace: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -140,6 +139,7 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
ServerFeature.CopilotEmbedding,
|
ServerFeature.CopilotEmbedding,
|
||||||
ServerFeature.OAuth,
|
ServerFeature.OAuth,
|
||||||
ServerFeature.Payment,
|
ServerFeature.Payment,
|
||||||
|
ServerFeature.LocalWorkspace,
|
||||||
],
|
],
|
||||||
oauthProviders: [
|
oauthProviders: [
|
||||||
OAuthProviderType.Google,
|
OAuthProviderType.Google,
|
||||||
@@ -152,7 +152,6 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allowGuestDemoWorkspace: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -171,6 +170,7 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
ServerFeature.CopilotEmbedding,
|
ServerFeature.CopilotEmbedding,
|
||||||
ServerFeature.OAuth,
|
ServerFeature.OAuth,
|
||||||
ServerFeature.Payment,
|
ServerFeature.Payment,
|
||||||
|
ServerFeature.LocalWorkspace,
|
||||||
],
|
],
|
||||||
oauthProviders: [
|
oauthProviders: [
|
||||||
OAuthProviderType.Google,
|
OAuthProviderType.Google,
|
||||||
@@ -183,7 +183,6 @@ export const BUILD_IN_SERVERS: (ServerMetadata & { config: ServerConfig })[] =
|
|||||||
maxLength: 32,
|
maxLength: 32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allowGuestDemoWorkspace: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ export class Server extends Entity<{
|
|||||||
credentialsRequirement: config.credentialsRequirement,
|
credentialsRequirement: config.credentialsRequirement,
|
||||||
features: config.features,
|
features: config.features,
|
||||||
oauthProviders: config.oauthProviders,
|
oauthProviders: config.oauthProviders,
|
||||||
allowGuestDemoWorkspace: config.allowGuestDemoWorkspace,
|
|
||||||
serverName: config.name,
|
serverName: config.name,
|
||||||
type: config.type,
|
type: config.type,
|
||||||
version: config.version,
|
version: config.version,
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ export class ServersService extends Service {
|
|||||||
credentialsRequirement: config.credentialsRequirement,
|
credentialsRequirement: config.credentialsRequirement,
|
||||||
features: config.features,
|
features: config.features,
|
||||||
oauthProviders: config.oauthProviders,
|
oauthProviders: config.oauthProviders,
|
||||||
allowGuestDemoWorkspace: config.allowGuestDemoWorkspace,
|
|
||||||
serverName: config.name,
|
serverName: config.name,
|
||||||
type: config.type,
|
type: config.type,
|
||||||
initialized: config.initialized,
|
initialized: config.initialized,
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ export interface ServerMetadata {
|
|||||||
export interface ServerConfig {
|
export interface ServerConfig {
|
||||||
serverName: string;
|
serverName: string;
|
||||||
features: ServerFeature[];
|
features: ServerFeature[];
|
||||||
allowGuestDemoWorkspace: boolean;
|
|
||||||
oauthProviders: OAuthProviderType[];
|
oauthProviders: OAuthProviderType[];
|
||||||
type: ServerDeploymentType;
|
type: ServerDeploymentType;
|
||||||
initialized?: boolean;
|
initialized?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user