@crossworks/content-core 0.400.6 → 0.400.13
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 +2 -2
- package/src/profile-projections.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossworks/content-core",
|
|
3
|
-
"version": "0.400.
|
|
3
|
+
"version": "0.400.13",
|
|
4
4
|
"description": "Browser-safe content logic — markdown, blocks, pages, tables, formulas — shared by the server and any client. Zero server deps by design: nothing here may reach @mantle/db, node-only APIs, or the network (the jackdaw-repo-split P0 boundary).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"./tree": "./src/tree.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@mantle/client-types": "npm:@crossworks/client-types@0.400.
|
|
39
|
+
"@mantle/client-types": "npm:@crossworks/client-types@0.400.13",
|
|
40
40
|
"marked": "^18.1.0",
|
|
41
41
|
"mathjs": "15.2.0"
|
|
42
42
|
},
|
|
@@ -526,6 +526,20 @@ export function projectAppOpens(raw: unknown): Record<string, AppOpenStat> | und
|
|
|
526
526
|
return Object.fromEntries(rows.slice(0, APP_OPENS_MAX));
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
+
/** The content-kind groups granted per agent id (contentKindGroupsGranted),
|
|
530
|
+
* and the delegation items (workspaceDelegationGranted): uuid keys, each a
|
|
531
|
+
* list of non-empty strings; anything else is dropped. */
|
|
532
|
+
export function projectGrantedGroups(raw: unknown): Record<string, string[]> | undefined {
|
|
533
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) return undefined;
|
|
534
|
+
const rows: [string, string[]][] = [];
|
|
535
|
+
for (const [k, v] of Object.entries(raw as Record<string, unknown>)) {
|
|
536
|
+
if (!UUID_RE.test(k) || !Array.isArray(v)) continue;
|
|
537
|
+
const slugs = [...new Set(v.filter((s): s is string => typeof s === 'string' && s !== ''))];
|
|
538
|
+
rows.push([k.toLowerCase(), slugs]);
|
|
539
|
+
}
|
|
540
|
+
return rows.length ? Object.fromEntries(rows) : undefined;
|
|
541
|
+
}
|
|
542
|
+
|
|
529
543
|
/** The house style a NEW brain starts with (Settings, Profile). Seeded only when
|
|
530
544
|
* a profile row is first created, so an owner who edits or clears it keeps
|
|
531
545
|
* their choice. The dash characters are escapes so the source holds none. */
|