@frigear-nu/crew 0.1.4 → 0.1.5
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/dist/module.d.mts
CHANGED
|
@@ -20,8 +20,10 @@ type CrewStatusEmail = {
|
|
|
20
20
|
type CrewStatusEmails = Partial<Record<CrewStatus, CrewStatusEmail>>;
|
|
21
21
|
/** A role mapping preset: everyone matching `match` (a global role, or an active subscription to a plan) holds `teamRole`. */
|
|
22
22
|
type CrewRolePreset = {
|
|
23
|
+
/** A global role (`except` leaves out the holders of other roles, inheritance included) or a subscription plan. */
|
|
23
24
|
match: {
|
|
24
25
|
role: string;
|
|
26
|
+
except?: string[];
|
|
25
27
|
} | {
|
|
26
28
|
plan: string;
|
|
27
29
|
};
|
package/dist/module.json
CHANGED
|
@@ -46,10 +46,10 @@ export async function crewEnsurePresets(event, operationId) {
|
|
|
46
46
|
const presets = useRuntimeConfig(event).crew?.rolePresets ?? [];
|
|
47
47
|
const owner = { ownerType: "operation", ownerId: operationId };
|
|
48
48
|
const existing = await db.select().from(schema.teamRoleMappings).where(and(eq(schema.teamRoleMappings.ownerType, owner.ownerType), eq(schema.teamRoleMappings.ownerId, operationId), isNull(schema.teamRoleMappings.teamId)));
|
|
49
|
-
const
|
|
49
|
+
const key = (match) => "role" in match ? `role:${match.role}` : `plan:${match.plan}`;
|
|
50
50
|
for (const preset of presets) {
|
|
51
51
|
const match = normalizeTeamRoleMatch(preset.match);
|
|
52
|
-
if (existing.some((row) =>
|
|
52
|
+
if (existing.some((row) => key(row.match) === key(match))) continue;
|
|
53
53
|
try {
|
|
54
54
|
await assertTeamMappingTarget(event, { ...owner, teamId: null, teamRole: preset.teamRole });
|
|
55
55
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frigear-nu/crew",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Crew for the frigear ecosystem: applications, approvals and invites that turn people into an operation's crew, built on teams.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frigear-module",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"playground"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@frigear-nu/auth": "^0.6.
|
|
42
|
+
"@frigear-nu/auth": "^0.6.10",
|
|
43
43
|
"@frigear-nu/dashboard": "^0.1.4",
|
|
44
|
-
"@frigear-nu/forms": "^0.5.
|
|
44
|
+
"@frigear-nu/forms": "^0.5.7",
|
|
45
45
|
"@frigear-nu/module-kit": "^1.3.13",
|
|
46
|
-
"@frigear-nu/notify": "^0.3.
|
|
47
|
-
"@frigear-nu/operations": "^0.1.
|
|
48
|
-
"@frigear-nu/teams": "^0.1.
|
|
46
|
+
"@frigear-nu/notify": "^0.3.3",
|
|
47
|
+
"@frigear-nu/operations": "^0.1.4",
|
|
48
|
+
"@frigear-nu/teams": "^0.1.5",
|
|
49
49
|
"@frigear-nu/ui": "^0.2.12",
|
|
50
50
|
"@frigear-nu/users": "^3.1.6",
|
|
51
51
|
"@libsql/client": "^0.18.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@frigear-nu/admin": "^0.5.3",
|
|
61
61
|
"@frigear-nu/email-templates": "^0.1.6",
|
|
62
62
|
"@frigear-nu/menu": "^0.4.2",
|
|
63
|
-
"@frigear-nu/mobile": "^0.6.
|
|
63
|
+
"@frigear-nu/mobile": "^0.6.6",
|
|
64
64
|
"@frigear-nu/widget": "^0.4.4",
|
|
65
65
|
"@nuxt/ui": "^4.12.0",
|
|
66
66
|
"@nuxthub/core": "^0.10.12"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@frigear-nu/admin": "^0.5.3",
|
|
87
87
|
"@frigear-nu/email-templates": "^0.1.6",
|
|
88
88
|
"@frigear-nu/menu": "^0.4.2",
|
|
89
|
-
"@frigear-nu/mobile": "^0.6.
|
|
89
|
+
"@frigear-nu/mobile": "^0.6.6",
|
|
90
90
|
"@frigear-nu/widget": "^0.4.4",
|
|
91
91
|
"@nuxt/devtools": "^4.2.0",
|
|
92
92
|
"@nuxt/eslint-config": "^1.17.0",
|