Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Add visibility attribute for spaces

Hakan Shehu81583cf0545f
diff --git a/apps/desktop/src/main/mutations/spaces/space-create.ts b/apps/desktop/src/main/mutations/spaces/space-create.ts
index 93fd6b56..fcc98189 100644
--- a/apps/desktop/src/main/mutations/spaces/space-create.ts
+++ b/apps/desktop/src/main/mutations/spaces/space-create.ts
@@ -45,6 +45,7 @@ export class SpaceCreateMutationHandler
const spaceAttributes: SpaceAttributes = {
type: 'space',
name: input.name,
+ visibility: 'private',
collaborators: {
[input.userId]: 'admin',
},
diff --git a/apps/server/src/services/workspace-service.ts b/apps/server/src/services/workspace-service.ts
index 096df16f..5bcf7aed 100644
--- a/apps/server/src/services/workspace-service.ts
+++ b/apps/server/src/services/workspace-service.ts
@@ -72,6 +72,7 @@ class WorkspaceService {
type: 'space',
name: 'Home',
description: 'This is your home space.',
+ visibility: 'private',
collaborators: {
[userId]: 'admin',
},
diff --git a/packages/core/src/registry/space.ts b/packages/core/src/registry/space.ts
index b4aa8d8c..2c18d09a 100644
--- a/packages/core/src/registry/space.ts
+++ b/packages/core/src/registry/space.ts
@@ -8,6 +8,7 @@ export const spaceAttributesSchema = z.object({
description: z.string().nullable().optional(),
avatar: z.string().nullable().optional(),
collaborators: z.record(z.string(), entryRoleEnum),
+ visibility: z.enum(['public', 'private']).default('private'),
});
export type SpaceAttributes = z.infer<typeof spaceAttributesSchema>;
diff --git a/scripts/src/seed/node-generator.ts b/scripts/src/seed/node-generator.ts
index 97e55f73..a2499780 100644
--- a/scripts/src/seed/node-generator.ts
+++ b/scripts/src/seed/node-generator.ts
@@ -114,6 +114,7 @@ export class NodeGenerator {
description,
collaborators,
avatar,
+ visibility: 'private',
};
const user = this.getMainUser();