@jskit-ai/workspaces-core 0.1.8 → 0.1.10
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/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/workspaces-core",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.10",
|
|
5
5
|
kind: "runtime",
|
|
6
6
|
description: "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
|
|
7
7
|
dependsOn: [
|
|
@@ -110,7 +110,7 @@ export default Object.freeze({
|
|
|
110
110
|
mutations: {
|
|
111
111
|
dependencies: {
|
|
112
112
|
runtime: {
|
|
113
|
-
"@jskit-ai/users-core": "0.1.
|
|
113
|
+
"@jskit-ai/users-core": "0.1.44"
|
|
114
114
|
},
|
|
115
115
|
dev: {}
|
|
116
116
|
},
|
|
@@ -238,7 +238,7 @@ export default Object.freeze({
|
|
|
238
238
|
position: "bottom",
|
|
239
239
|
skipIfContains: "config.workspaceSwitching =",
|
|
240
240
|
value:
|
|
241
|
-
"\nconfig.workspaceSwitching = true;\nconfig.workspaceInvitations = {\n enabled: true,\n allowInPersonalMode: true\n};\
|
|
241
|
+
"\nconfig.workspaceSwitching = true;\nconfig.workspaceInvitations = {\n enabled: true,\n allowInPersonalMode: true\n};\n",
|
|
242
242
|
reason: "Append default workspace feature toggles into app-owned config.",
|
|
243
243
|
category: "workspaces-core",
|
|
244
244
|
id: "users-core-public-config"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/workspaces-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"./server/WorkspacesCoreServiceProvider": "./src/server/WorkspacesCoreServiceProvider.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@jskit-ai/users-core": "0.1.
|
|
12
|
+
"@jskit-ai/users-core": "0.1.44"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -10,10 +10,10 @@ exports.up = async function up(knex) {
|
|
|
10
10
|
const hasWorkspacesTable = await knex.schema.hasTable("workspaces");
|
|
11
11
|
if (!hasWorkspacesTable) {
|
|
12
12
|
await knex.schema.createTable("workspaces", (table) => {
|
|
13
|
-
table.
|
|
13
|
+
table.bigIncrements("id").primary();
|
|
14
14
|
table.string("slug", 120).notNullable().unique();
|
|
15
15
|
table.string("name", 160).notNullable();
|
|
16
|
-
table.
|
|
16
|
+
table.bigInteger("owner_user_id").unsigned().notNullable().references("id").inTable("users").onDelete("CASCADE");
|
|
17
17
|
table.boolean("is_personal").notNullable().defaultTo(true);
|
|
18
18
|
table.string("avatar_url", 512).notNullable().defaultTo("");
|
|
19
19
|
table.timestamp("created_at", { useTz: false }).notNullable().defaultTo(knex.fn.now());
|
|
@@ -25,9 +25,9 @@ exports.up = async function up(knex) {
|
|
|
25
25
|
const hasWorkspaceMembershipsTable = await knex.schema.hasTable("workspace_memberships");
|
|
26
26
|
if (!hasWorkspaceMembershipsTable) {
|
|
27
27
|
await knex.schema.createTable("workspace_memberships", (table) => {
|
|
28
|
-
table.
|
|
29
|
-
table.
|
|
30
|
-
table.
|
|
28
|
+
table.bigIncrements("id").primary();
|
|
29
|
+
table.bigInteger("workspace_id").unsigned().notNullable().references("id").inTable("workspaces").onDelete("CASCADE");
|
|
30
|
+
table.bigInteger("user_id").unsigned().notNullable().references("id").inTable("users").onDelete("CASCADE");
|
|
31
31
|
table.string("role_sid", 64).notNullable().defaultTo("member");
|
|
32
32
|
table.string("status", 32).notNullable().defaultTo("active");
|
|
33
33
|
table.timestamp("created_at", { useTz: false }).notNullable().defaultTo(knex.fn.now());
|
|
@@ -39,7 +39,7 @@ exports.up = async function up(knex) {
|
|
|
39
39
|
const hasWorkspaceSettingsTable = await knex.schema.hasTable("workspace_settings");
|
|
40
40
|
if (!hasWorkspaceSettingsTable) {
|
|
41
41
|
await knex.schema.createTable("workspace_settings", (table) => {
|
|
42
|
-
table.
|
|
42
|
+
table.bigInteger("workspace_id").unsigned().primary().references("id").inTable("workspaces").onDelete("CASCADE");
|
|
43
43
|
table.string("light_primary_color", 7).notNullable().defaultTo("#1867C0");
|
|
44
44
|
table.string("light_secondary_color", 7).notNullable().defaultTo("#48A9A6");
|
|
45
45
|
table.string("light_surface_color", 7).notNullable().defaultTo("#FFFFFF");
|
|
@@ -57,13 +57,13 @@ exports.up = async function up(knex) {
|
|
|
57
57
|
const hasWorkspaceInvitesTable = await knex.schema.hasTable("workspace_invites");
|
|
58
58
|
if (!hasWorkspaceInvitesTable) {
|
|
59
59
|
await knex.schema.createTable("workspace_invites", (table) => {
|
|
60
|
-
table.
|
|
61
|
-
table.
|
|
60
|
+
table.bigIncrements("id").primary();
|
|
61
|
+
table.bigInteger("workspace_id").unsigned().notNullable().references("id").inTable("workspaces").onDelete("CASCADE");
|
|
62
62
|
table.string("email", 255).notNullable();
|
|
63
63
|
table.string("role_sid", 64).notNullable().defaultTo("member");
|
|
64
64
|
table.string("status", 32).notNullable().defaultTo("pending");
|
|
65
65
|
table.string("token_hash", 191).notNullable();
|
|
66
|
-
table.
|
|
66
|
+
table.bigInteger("invited_by_user_id").unsigned().nullable().references("id").inTable("users").onDelete("SET NULL");
|
|
67
67
|
table.timestamp("expires_at", { useTz: false }).nullable();
|
|
68
68
|
table.timestamp("accepted_at", { useTz: false }).nullable();
|
|
69
69
|
table.timestamp("revoked_at", { useTz: false }).nullable();
|
|
@@ -62,7 +62,7 @@ exports.down = async function down(knex) {
|
|
|
62
62
|
const normalizedName = String(workspaceRow?.name || "").trim() || "Workspace";
|
|
63
63
|
const normalizedAvatarUrl = String(workspaceRow?.avatar_url || "").trim();
|
|
64
64
|
await knex(WORKSPACE_SETTINGS_TABLE)
|
|
65
|
-
.where({ workspace_id:
|
|
65
|
+
.where({ workspace_id: workspaceRow.id })
|
|
66
66
|
.update({
|
|
67
67
|
name: normalizedName,
|
|
68
68
|
avatar_url: normalizedAvatarUrl
|
|
@@ -66,8 +66,8 @@ exports.down = async function down(knex) {
|
|
|
66
66
|
);
|
|
67
67
|
|
|
68
68
|
for (const row of workspaceSettingsRows) {
|
|
69
|
-
const workspaceId =
|
|
70
|
-
if (!
|
|
69
|
+
const workspaceId = row?.workspace_id == null ? "" : String(row.workspace_id).trim();
|
|
70
|
+
if (!workspaceId) {
|
|
71
71
|
continue;
|
|
72
72
|
}
|
|
73
73
|
|