@jskit-ai/workspaces-core 0.1.113 → 0.1.114
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.114",
|
|
5
5
|
kind: "runtime",
|
|
6
6
|
description: "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
|
|
7
7
|
dependsOn: [
|
|
@@ -150,7 +150,7 @@ export default Object.freeze({
|
|
|
150
150
|
"@jskit-ai/json-rest-api-core": "0.1.79",
|
|
151
151
|
"@jskit-ai/resource-core": "0.1.78",
|
|
152
152
|
"@jskit-ai/resource-crud-core": "0.1.78",
|
|
153
|
-
"@jskit-ai/users-core": "0.1.
|
|
153
|
+
"@jskit-ai/users-core": "0.1.147"
|
|
154
154
|
},
|
|
155
155
|
dev: {}
|
|
156
156
|
},
|
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.114",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@jskit-ai/kernel": "0.1.135",
|
|
25
25
|
"@jskit-ai/resource-crud-core": "0.1.78",
|
|
26
26
|
"@jskit-ai/resource-core": "0.1.78",
|
|
27
|
-
"@jskit-ai/users-core": "0.1.
|
|
27
|
+
"@jskit-ai/users-core": "0.1.147",
|
|
28
28
|
"json-rest-schema": "1.x.x"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -338,6 +338,37 @@ test("workspaceService.createWorkspaceForAuthenticatedUser creates non-personal
|
|
|
338
338
|
assert.equal(workspace.slug, "ops-team");
|
|
339
339
|
assert.equal(calls.insert, 1);
|
|
340
340
|
assert.equal(calls.ensureOwnerMembership, 1);
|
|
341
|
+
assert.equal(calls.ensureWorkspaceSettings, 1);
|
|
342
|
+
assert.equal(insertedPayloads[0].isPersonal, false);
|
|
343
|
+
assert.equal(insertedPayloads[0].ownerUserId, "7");
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
test("workspaceService.createWorkspaceForAuthenticatedUser generates an omitted slug and provisions ownership", async () => {
|
|
347
|
+
const { service, calls, insertedPayloads } = createWorkspaceServiceFixture({
|
|
348
|
+
tenancyMode: "workspaces",
|
|
349
|
+
tenancyPolicy: {
|
|
350
|
+
workspace: {
|
|
351
|
+
allowSelfCreate: true
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const workspace = await service.createWorkspaceForAuthenticatedUser(
|
|
357
|
+
{
|
|
358
|
+
id: "7",
|
|
359
|
+
email: "chiaramobily@gmail.com",
|
|
360
|
+
displayName: "Chiara"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
name: "Operations Team"
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
|
|
367
|
+
assert.equal(workspace.slug, "operations-team");
|
|
368
|
+
assert.equal(calls.insert, 1);
|
|
369
|
+
assert.equal(calls.ensureOwnerMembership, 1);
|
|
370
|
+
assert.equal(calls.ensureWorkspaceSettings, 1);
|
|
371
|
+
assert.equal(insertedPayloads[0].slug, "operations-team");
|
|
341
372
|
assert.equal(insertedPayloads[0].isPersonal, false);
|
|
342
373
|
assert.equal(insertedPayloads[0].ownerUserId, "7");
|
|
343
374
|
});
|
|
@@ -340,6 +340,34 @@ test("workspaces-core boot skips invitation redeem/list routes when workspace in
|
|
|
340
340
|
assert.equal(findRoute(routes, { method: "DELETE", path: "/api/w/:workspaceSlug/invites/:inviteId" }), null);
|
|
341
341
|
});
|
|
342
342
|
|
|
343
|
+
test("workspace create handler preserves an omitted optional slug", async () => {
|
|
344
|
+
const routes = await registerRoutes();
|
|
345
|
+
const workspaceCreate = findRoute(routes, {
|
|
346
|
+
method: "POST",
|
|
347
|
+
path: "/api/workspaces"
|
|
348
|
+
});
|
|
349
|
+
const calls = [];
|
|
350
|
+
|
|
351
|
+
await workspaceCreate.handler(
|
|
352
|
+
createActionRequest({
|
|
353
|
+
input: {
|
|
354
|
+
body: { name: "Operations Team" }
|
|
355
|
+
},
|
|
356
|
+
executeAction: async (payload) => {
|
|
357
|
+
calls.push(payload);
|
|
358
|
+
return {};
|
|
359
|
+
}
|
|
360
|
+
}),
|
|
361
|
+
createReplyDouble()
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
assert.deepEqual(calls, [{
|
|
365
|
+
actionId: "workspace.workspaces.create",
|
|
366
|
+
input: { name: "Operations Team" }
|
|
367
|
+
}]);
|
|
368
|
+
assert.equal(Object.hasOwn(calls[0].input, "slug"), false);
|
|
369
|
+
});
|
|
370
|
+
|
|
343
371
|
test("workspace invite and member handlers build action input from request.input", async () => {
|
|
344
372
|
const routes = await registerRoutes();
|
|
345
373
|
const workspaceCreate = findRoute(routes, {
|