@jskit-ai/workspaces-core 0.2.53 → 0.2.55
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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/workspaces-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jskit test"
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"./locales/en.json": "./locales/en.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jskit-ai/resource-core": "0.1.
|
|
28
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
29
|
-
"@jskit-ai/users-core": "0.2.
|
|
27
|
+
"@jskit-ai/resource-core": "0.1.219",
|
|
28
|
+
"@jskit-ai/resource-crud-core": "0.1.221",
|
|
29
|
+
"@jskit-ai/users-core": "0.2.55",
|
|
30
30
|
"json-rest-schema": "^1.0.20"
|
|
31
31
|
},
|
|
32
32
|
"description": "Workspace tenancy runtime plus HTTP routes, role catalog, and workspace config scaffolding.",
|
|
@@ -216,10 +216,10 @@
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
"peerDependencies": {
|
|
219
|
-
"@jskit-ai/auth-core": "0.2.
|
|
220
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
221
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
222
|
-
"@jskit-ai/kernel": "0.2.
|
|
223
|
-
"@jskit-ai/resource-runtime": "0.2.
|
|
219
|
+
"@jskit-ai/auth-core": "0.2.32",
|
|
220
|
+
"@jskit-ai/database-runtime": "0.1.277",
|
|
221
|
+
"@jskit-ai/http-runtime": "0.2.28",
|
|
222
|
+
"@jskit-ai/kernel": "0.2.28",
|
|
223
|
+
"@jskit-ai/resource-runtime": "0.2.41"
|
|
224
224
|
}
|
|
225
225
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isStagingOrProduction } from "@jskit-ai/kernel/shared/support/appEnvironment";
|
|
2
2
|
import { defineProvider } from "@jskit-ai/kernel/shared/capabilities";
|
|
3
3
|
import {
|
|
4
4
|
collectRequiredPermissions,
|
|
@@ -47,7 +47,7 @@ const WorkspaceRoleGrantsProvider = defineProvider({
|
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
const message = describeUnknownRoleGrants(findings);
|
|
50
|
-
if (
|
|
50
|
+
if (isStagingOrProduction(env)) {
|
|
51
51
|
logger.warn({ unknownRoleGrants: findings.map(({ roleId, grant }) => ({ roleId, grant })) }, message);
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
@@ -8,7 +8,7 @@ const INVITE = Object.freeze({
|
|
|
8
8
|
inviteUrl: "https://app.example.test/invite?token=abc",
|
|
9
9
|
message: Object.freeze({ subject: "You're invited to Books", text: "Join us", html: "<p>Join us</p>" })
|
|
10
10
|
});
|
|
11
|
-
const
|
|
11
|
+
const SERVER_NODE_ENV = Object.freeze({ NODE_ENV: "production" });
|
|
12
12
|
|
|
13
13
|
function mailerIn(env) {
|
|
14
14
|
const logs = [];
|
|
@@ -47,7 +47,7 @@ test("development and test log each invitation, send none and report it simulate
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
test("staging sends an invitation for someone else only to STAGING_EMAIL_TO, saying whom it was for", async () => {
|
|
50
|
-
const { logs, sent, mailer } = mailerIn({ ...
|
|
50
|
+
const { logs, sent, mailer } = mailerIn({ ...SERVER_NODE_ENV, APP_ENV: "staging", STAGING_EMAIL_TO: "qa@example.test" });
|
|
51
51
|
const options = { trx: null };
|
|
52
52
|
assert.deepEqual(await mailer.sendWorkspaceInvite(INVITE, options), { status: "sent", providerMessageId: "m-1" });
|
|
53
53
|
assert.equal(sent.length, 1);
|
|
@@ -66,12 +66,12 @@ test("staging sends an invitation for someone else only to STAGING_EMAIL_TO, say
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
test("staging without STAGING_EMAIL_TO logs each invitation, and production sends it to its address unmarked", async () => {
|
|
69
|
-
const staging = mailerIn({ ...
|
|
69
|
+
const staging = mailerIn({ ...SERVER_NODE_ENV, APP_ENV: "staging" });
|
|
70
70
|
assert.equal((await staging.mailer.sendWorkspaceInvite(INVITE, {})).status, "simulated");
|
|
71
71
|
assert.equal(staging.sent.length, 0);
|
|
72
72
|
assert.match(staging.logs[0].message, /was logged, not sent: STAGING_EMAIL_TO is not set\.$/u);
|
|
73
73
|
|
|
74
|
-
const production = mailerIn({ ...
|
|
74
|
+
const production = mailerIn({ ...SERVER_NODE_ENV, APP_ENV: "production", STAGING_EMAIL_TO: "qa@example.test" });
|
|
75
75
|
assert.equal((await production.mailer.sendWorkspaceInvite(INVITE, {})).status, "sent");
|
|
76
76
|
assert.deepEqual(production.sent[0].invite, INVITE);
|
|
77
77
|
});
|