@xnetjs/data 0.0.2 → 0.1.0
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/README.md +112 -0
- package/dist/account-MWNCH4GJ.js +12 -0
- package/dist/account-ledger-R2GAFJL6.js +38 -0
- package/dist/auth/index.d.ts +420 -0
- package/dist/auth/index.js +102 -0
- package/dist/budget-NN7P35XP.js +12 -0
- package/dist/canvas-6WYBNH53.js +10 -0
- package/dist/channel-AT3LQF4A.js +12 -0
- package/dist/chat-message-DSVO72B3.js +10 -0
- package/dist/chunk-2ZNJWIQG.js +84 -0
- package/dist/chunk-3J3HILXO.js +46 -0
- package/dist/chunk-3RUDVTMH.js +5543 -0
- package/dist/chunk-4EYKGTSQ.js +49 -0
- package/dist/chunk-53F4PRNC.js +32 -0
- package/dist/chunk-5EXHNXPL.js +48 -0
- package/dist/{chunk-BQBPA5HS.js → chunk-5HC5NO57.js} +16 -2
- package/dist/chunk-6KLGA6IR.js +47 -0
- package/dist/chunk-6OMG4I7M.js +41 -0
- package/dist/chunk-7PDRDSFH.js +69 -0
- package/dist/chunk-BQLQSWKZ.js +232 -0
- package/dist/chunk-BY5O6LNC.js +380 -0
- package/dist/chunk-DCTRX6II.js +40 -0
- package/dist/{chunk-VYR5GPJP.js → chunk-DWEXKD6E.js} +9 -3
- package/dist/chunk-EBNMV2VO.js +896 -0
- package/dist/chunk-FVEACSKE.js +102 -0
- package/dist/chunk-GU6THOAB.js +45 -0
- package/dist/chunk-H4GA4BBK.js +75 -0
- package/dist/chunk-IJ44LR7N.js +76 -0
- package/dist/chunk-J4ANIXIV.js +402 -0
- package/dist/chunk-JDFNMFOZ.js +45 -0
- package/dist/chunk-K7DOZWWT.js +1811 -0
- package/dist/chunk-KQAT4XBL.js +49 -0
- package/dist/chunk-KQUALW4O.js +183 -0
- package/dist/chunk-LYSWLCOI.js +47 -0
- package/dist/chunk-MBTUO3ZL.js +65 -0
- package/dist/chunk-NI4FHG2K.js +52 -0
- package/dist/chunk-OCMSAKWV.js +78 -0
- package/dist/chunk-OGJCRNGE.js +57 -0
- package/dist/chunk-OPPHF3TF.js +143 -0
- package/dist/{chunk-IDMBCRUC.js → chunk-OSAWNZVM.js} +1 -1
- package/dist/chunk-PMUQACPY.js +33 -0
- package/dist/chunk-PNESGUH5.js +63 -0
- package/dist/chunk-Q3IEGH4B.js +51 -0
- package/dist/chunk-QJW5LDP4.js +52 -0
- package/dist/chunk-QWFTRZQT.js +142 -0
- package/dist/{chunk-SZC345Z2.js → chunk-RL64OJJ5.js} +1025 -1110
- package/dist/chunk-S5RP5RKY.js +416 -0
- package/dist/chunk-S6U6TCMN.js +722 -0
- package/dist/chunk-SVNGSZZA.js +69 -0
- package/dist/chunk-T5AZAOG5.js +54 -0
- package/dist/chunk-TCTZW4A6.js +42 -0
- package/dist/chunk-U64CW73O.js +109 -0
- package/dist/chunk-UDWKWTAX.js +6526 -0
- package/dist/chunk-UQM3G5A2.js +148 -0
- package/dist/chunk-VQ7JHB67.js +57 -0
- package/dist/chunk-W7EBL7ZU.js +73 -0
- package/dist/chunk-WEPK7SZF.js +65 -0
- package/dist/chunk-XHEA5UER.js +75 -0
- package/dist/chunk-XMSKJ5PV.js +66 -0
- package/dist/chunk-XROI44ZP.js +64 -0
- package/dist/chunk-Y3S5SRVM.js +45 -0
- package/dist/chunk-YEFKQYKA.js +43 -0
- package/dist/chunk-YSUIXD2Y.js +105 -0
- package/dist/chunk-ZCOFZY5M.js +70 -0
- package/dist/chunk-ZLU4Y3O2.js +50 -0
- package/dist/chunk-ZPZ7XDA6.js +54 -0
- package/dist/chunk-ZZ6TWKGS.js +40 -0
- package/dist/clone-C0Jhk2UN.d.ts +2205 -0
- package/dist/comment-QSWYAQVS.js +10 -0
- package/dist/crm-L5RYAAF3.js +68 -0
- package/dist/dashboard-JMKTTRA7.js +10 -0
- package/dist/database/index.d.ts +882 -0
- package/dist/database/index.js +523 -0
- package/dist/database-GIXSPZJW.js +10 -0
- package/dist/database-field-3EPAMZUR.js +10 -0
- package/dist/database-row-6Q6TRVE4.js +10 -0
- package/dist/database-select-option-BBBJFLLH.js +10 -0
- package/dist/database-view-5PLSOBI2.js +10 -0
- package/dist/experiment-DOVOZ34Y.js +10 -0
- package/dist/external-item-P2E5X7BZ.js +14 -0
- package/dist/external-reference-7BSFF6SA.js +8 -0
- package/dist/feed-2IXHHP6O.js +12 -0
- package/dist/feed-item-DPE6LN7I.js +12 -0
- package/dist/folder-6KM3KYD5.js +21 -0
- package/dist/game-5AK5XWBR.js +50 -0
- package/dist/grant-WTQSNT5A.js +8 -0
- package/dist/grant-expiration-cleaner-CY6BcmlR.d.ts +249 -0
- package/dist/import-batch-IXBJLQPJ.js +12 -0
- package/dist/inbox-state-E5NSVOGP.js +12 -0
- package/dist/index.d.ts +224 -4548
- package/dist/index.js +2252 -4754
- package/dist/map-RG5Y3CPC.js +10 -0
- package/dist/media-asset-QTCGLIZA.js +8 -0
- package/dist/memory-PNRTMBZO.js +12 -0
- package/dist/metric-65SVOX5C.js +10 -0
- package/dist/milestone-XEO6ZGDG.js +12 -0
- package/dist/moderation-FFHETMRB.js +30 -0
- package/dist/observation-2Y3QKUXM.js +10 -0
- package/dist/page-2V27JGKJ.js +10 -0
- package/dist/posting-GBOSZCMZ.js +12 -0
- package/dist/profile-BLLDWIDK.js +8 -0
- package/dist/project-CQL5LN26.js +10 -0
- package/dist/query-ast-C3m6kZYv.d.ts +226 -0
- package/dist/reaction-T2DTJBBV.js +10 -0
- package/dist/registry-DunPv__d.d.ts +99 -0
- package/dist/saved-view-4R2DBCL3.js +10 -0
- package/dist/schema/index.d.ts +6489 -0
- package/dist/schema/index.js +677 -0
- package/dist/schema-extension-LNRF2YRD.js +18 -0
- package/dist/space-IJU24PBH.js +42 -0
- package/dist/space-membership-DEUMM7NV.js +14 -0
- package/dist/store/index.d.ts +518 -0
- package/dist/store/index.js +135 -0
- package/dist/store-DtIDjk7c.d.ts +355 -0
- package/dist/sync/awareness.d.ts +69 -0
- package/dist/sync/awareness.js +20 -0
- package/dist/system-ILHCZOVO.js +38 -0
- package/dist/tag-SKCHM3U5.js +16 -0
- package/dist/task-7AOBP7WC.js +16 -0
- package/dist/task-view-NUGKELJP.js +10 -0
- package/dist/transaction-ZDSEGDIR.js +12 -0
- package/dist/transcription-PSCLDAGX.js +12 -0
- package/dist/types-S-BJAKyK.d.ts +1576 -0
- package/dist/updates.d.ts +44 -0
- package/dist/updates.js +16 -0
- package/dist/user-widget-RLY2N46A.js +8 -0
- package/dist/view-types-DSde-uT_.d.ts +316 -0
- package/package.json +32 -9
- package/dist/canvas-HSIKIQFK.js +0 -7
- package/dist/chunk-2L5ZUGG5.js +0 -53
- package/dist/chunk-4MTS5KAQ.js +0 -22
- package/dist/chunk-GZHARFKC.js +0 -25
- package/dist/chunk-WKIKJTI2.js +0 -45
- package/dist/comment-277JD7DV.js +0 -7
- package/dist/database-W3KEHLI3.js +0 -7
- package/dist/database-row-3O2QSNZN.js +0 -7
- package/dist/grant-QVZ454YC.js +0 -7
- package/dist/page-O4WTOIEO.js +0 -7
- package/dist/task-SEKAYJH7.js +0 -7
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compareSortKeys
|
|
3
|
+
} from "./chunk-QWFTRZQT.js";
|
|
4
|
+
import {
|
|
5
|
+
created,
|
|
6
|
+
createdBy,
|
|
7
|
+
defineSchema,
|
|
8
|
+
relation,
|
|
9
|
+
text
|
|
10
|
+
} from "./chunk-EBNMV2VO.js";
|
|
11
|
+
import {
|
|
12
|
+
presets
|
|
13
|
+
} from "./chunk-RL64OJJ5.js";
|
|
14
|
+
|
|
15
|
+
// src/schema/schemas/folder.ts
|
|
16
|
+
var FOLDER_SCHEMA_IRI = "xnet://xnet.fyi/Folder@1.0.0";
|
|
17
|
+
var FolderSchema = defineSchema({
|
|
18
|
+
name: "Folder",
|
|
19
|
+
namespace: "xnet://xnet.fyi/",
|
|
20
|
+
properties: {
|
|
21
|
+
/** Folder display name */
|
|
22
|
+
name: text({ required: true, maxLength: 120 }),
|
|
23
|
+
/** Emoji or icon URL */
|
|
24
|
+
icon: text({ maxLength: 80 }),
|
|
25
|
+
/** Parent folder; empty = top level */
|
|
26
|
+
parent: relation({ target: "xnet://xnet.fyi/Folder@1.0.0" }),
|
|
27
|
+
/** Order among siblings — fractional index, code-unit compare */
|
|
28
|
+
sortKey: text({ maxLength: 500 }),
|
|
29
|
+
createdAt: created(),
|
|
30
|
+
createdBy: createdBy()
|
|
31
|
+
},
|
|
32
|
+
document: void 0,
|
|
33
|
+
// Standalone/personal content: owner-only by default (exploration 0192).
|
|
34
|
+
authorization: presets.private()
|
|
35
|
+
});
|
|
36
|
+
function compareSiblings(a, b) {
|
|
37
|
+
const bySortKey = compareSortKeys(a.sortKey ?? "", b.sortKey ?? "");
|
|
38
|
+
if (bySortKey !== 0) return bySortKey;
|
|
39
|
+
return a.name === b.name ? 0 : (a.name ?? "") < (b.name ?? "") ? -1 : 1;
|
|
40
|
+
}
|
|
41
|
+
function buildFolderTree(folders) {
|
|
42
|
+
const byId = new Map(folders.map((folder) => [folder.id, folder]));
|
|
43
|
+
const childrenOf = /* @__PURE__ */ new Map();
|
|
44
|
+
const roots = [];
|
|
45
|
+
for (const folder of folders) {
|
|
46
|
+
const parentId = folder.parent ?? null;
|
|
47
|
+
if (!parentId || parentId === folder.id || !byId.has(parentId)) {
|
|
48
|
+
roots.push(folder);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const siblings = childrenOf.get(parentId);
|
|
52
|
+
if (siblings) siblings.push(folder);
|
|
53
|
+
else childrenOf.set(parentId, [folder]);
|
|
54
|
+
}
|
|
55
|
+
const attached = /* @__PURE__ */ new Set();
|
|
56
|
+
const toNode = (folder, depth) => {
|
|
57
|
+
attached.add(folder.id);
|
|
58
|
+
const children = (childrenOf.get(folder.id) ?? []).filter((child) => !attached.has(child.id)).sort(compareSiblings).map((child) => toNode(child, depth + 1));
|
|
59
|
+
return { folder, depth, children };
|
|
60
|
+
};
|
|
61
|
+
const tree = roots.sort(compareSiblings).map((folder) => toNode(folder, 0));
|
|
62
|
+
const stranded = folders.filter((folder) => !attached.has(folder.id)).sort(compareSiblings);
|
|
63
|
+
for (const folder of stranded) {
|
|
64
|
+
if (!attached.has(folder.id)) tree.push(toNode(folder, 0));
|
|
65
|
+
}
|
|
66
|
+
return tree;
|
|
67
|
+
}
|
|
68
|
+
function flattenFolderTree(tree, isExpanded = () => true) {
|
|
69
|
+
const rows = [];
|
|
70
|
+
const visit = (node) => {
|
|
71
|
+
rows.push(node);
|
|
72
|
+
if (isExpanded(node.folder.id)) node.children.forEach(visit);
|
|
73
|
+
};
|
|
74
|
+
tree.forEach(visit);
|
|
75
|
+
return rows;
|
|
76
|
+
}
|
|
77
|
+
function folderAncestorIds(folderId, byId) {
|
|
78
|
+
const ancestors = [];
|
|
79
|
+
const seen = /* @__PURE__ */ new Set([folderId]);
|
|
80
|
+
let current = byId.get(folderId)?.parent ?? null;
|
|
81
|
+
while (current && !seen.has(current)) {
|
|
82
|
+
ancestors.push(current);
|
|
83
|
+
seen.add(current);
|
|
84
|
+
current = byId.get(current)?.parent ?? null;
|
|
85
|
+
}
|
|
86
|
+
return ancestors;
|
|
87
|
+
}
|
|
88
|
+
function wouldCreateFolderCycle(folderId, newParentId, byId) {
|
|
89
|
+
if (!newParentId) return false;
|
|
90
|
+
if (newParentId === folderId) return true;
|
|
91
|
+
return folderAncestorIds(newParentId, byId).includes(folderId);
|
|
92
|
+
}
|
|
93
|
+
function folderPathIds(folderId, byId) {
|
|
94
|
+
return [...folderAncestorIds(folderId, byId).reverse(), folderId];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
FOLDER_SCHEMA_IRI,
|
|
99
|
+
FolderSchema,
|
|
100
|
+
buildFolderTree,
|
|
101
|
+
flattenFolderTree,
|
|
102
|
+
folderAncestorIds,
|
|
103
|
+
wouldCreateFolderCycle,
|
|
104
|
+
folderPathIds
|
|
105
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-OCMSAKWV.js";
|
|
4
|
+
import {
|
|
5
|
+
checkbox,
|
|
6
|
+
created,
|
|
7
|
+
createdBy,
|
|
8
|
+
defineSchema,
|
|
9
|
+
person,
|
|
10
|
+
relation,
|
|
11
|
+
select,
|
|
12
|
+
text
|
|
13
|
+
} from "./chunk-EBNMV2VO.js";
|
|
14
|
+
|
|
15
|
+
// src/schema/schemas/channel.ts
|
|
16
|
+
var CHANNEL_KINDS = ["channel", "dm", "voice"];
|
|
17
|
+
var ChannelSchema = defineSchema({
|
|
18
|
+
name: "Channel",
|
|
19
|
+
namespace: "xnet://xnet.fyi/",
|
|
20
|
+
properties: {
|
|
21
|
+
/** Channel display name (DMs may leave this empty and render members) */
|
|
22
|
+
name: text({ maxLength: 120 }),
|
|
23
|
+
/** Conversation kind */
|
|
24
|
+
kind: select({
|
|
25
|
+
options: [
|
|
26
|
+
{ id: "channel", name: "Channel", color: "blue" },
|
|
27
|
+
{ id: "dm", name: "Direct Message", color: "green" },
|
|
28
|
+
{ id: "voice", name: "Voice Room", color: "purple" }
|
|
29
|
+
],
|
|
30
|
+
required: true,
|
|
31
|
+
default: "channel"
|
|
32
|
+
}),
|
|
33
|
+
/** Member DIDs. Empty = open channel (anyone in the workspace). */
|
|
34
|
+
members: person({ multiple: true }),
|
|
35
|
+
/** Optional node this channel is attached to (per-document chat) */
|
|
36
|
+
target: relation({}),
|
|
37
|
+
/** Channel topic / description */
|
|
38
|
+
topic: text({ maxLength: 500 }),
|
|
39
|
+
/** Archived channels are hidden from the default list */
|
|
40
|
+
archived: checkbox({ default: false }),
|
|
41
|
+
/** Canonical home; empty = Unfiled (exploration 0169) */
|
|
42
|
+
folder: relation({ target: "xnet://xnet.fyi/Folder@1.0.0" }),
|
|
43
|
+
/** Order among folder siblings — fractional index */
|
|
44
|
+
sortKey: text({ maxLength: 500 }),
|
|
45
|
+
/** Workspace-wide labels, referenced by id (exploration 0169) */
|
|
46
|
+
tags: relation({ target: "xnet://xnet.fyi/Tag@1.0.0", multiple: true }),
|
|
47
|
+
/** Canonical SECURITY home; empty = personal/private (exploration 0179) */
|
|
48
|
+
space: relation({ target: "xnet://xnet.fyi/Space@1.0.0" }),
|
|
49
|
+
/** Per-node visibility; `inherit` defers to the Space (exploration 0179) */
|
|
50
|
+
visibility: select({
|
|
51
|
+
options: [
|
|
52
|
+
{ id: "inherit", name: "Inherit", color: "gray" },
|
|
53
|
+
{ id: "private", name: "Private", color: "gray" },
|
|
54
|
+
{ id: "unlisted", name: "Unlisted", color: "yellow" },
|
|
55
|
+
{ id: "public", name: "Public", color: "green" }
|
|
56
|
+
],
|
|
57
|
+
default: "inherit"
|
|
58
|
+
}),
|
|
59
|
+
createdAt: created(),
|
|
60
|
+
createdBy: createdBy()
|
|
61
|
+
},
|
|
62
|
+
document: void 0,
|
|
63
|
+
// Inherits access from its home Space (exploration 0181/0192).
|
|
64
|
+
authorization: spaceCascadeAuthorization()
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
CHANNEL_KINDS,
|
|
69
|
+
ChannelSchema
|
|
70
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-OCMSAKWV.js";
|
|
4
|
+
import {
|
|
5
|
+
defineSchema,
|
|
6
|
+
file,
|
|
7
|
+
relation,
|
|
8
|
+
select,
|
|
9
|
+
text
|
|
10
|
+
} from "./chunk-EBNMV2VO.js";
|
|
11
|
+
|
|
12
|
+
// src/schema/schemas/page.ts
|
|
13
|
+
var PageSchema = defineSchema({
|
|
14
|
+
name: "Page",
|
|
15
|
+
namespace: "xnet://xnet.fyi/",
|
|
16
|
+
properties: {
|
|
17
|
+
/** Page title */
|
|
18
|
+
title: text({ required: true, maxLength: 500 }),
|
|
19
|
+
/** Emoji or icon URL */
|
|
20
|
+
icon: text({}),
|
|
21
|
+
/** Cover image */
|
|
22
|
+
cover: file({ accept: ["image/*"] }),
|
|
23
|
+
/** Canonical home; empty = Unfiled (exploration 0169) */
|
|
24
|
+
folder: relation({ target: "xnet://xnet.fyi/Folder@1.0.0" }),
|
|
25
|
+
/** Order among folder siblings — fractional index */
|
|
26
|
+
sortKey: text({ maxLength: 500 }),
|
|
27
|
+
/** Workspace-wide labels, referenced by id (exploration 0169) */
|
|
28
|
+
tags: relation({ target: "xnet://xnet.fyi/Tag@1.0.0", multiple: true }),
|
|
29
|
+
/** Canonical SECURITY home; empty = personal/private (exploration 0179) */
|
|
30
|
+
space: relation({ target: "xnet://xnet.fyi/Space@1.0.0" }),
|
|
31
|
+
/** Per-node visibility; `inherit` defers to the Space (exploration 0179) */
|
|
32
|
+
visibility: select({
|
|
33
|
+
options: [
|
|
34
|
+
{ id: "inherit", name: "Inherit", color: "gray" },
|
|
35
|
+
{ id: "private", name: "Private", color: "gray" },
|
|
36
|
+
{ id: "unlisted", name: "Unlisted", color: "yellow" },
|
|
37
|
+
{ id: "public", name: "Public", color: "green" }
|
|
38
|
+
],
|
|
39
|
+
default: "inherit"
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
document: "yjs",
|
|
43
|
+
// Collaborative Y.Doc for rich text
|
|
44
|
+
// Inherits access from its home Space (exploration 0181/0192).
|
|
45
|
+
authorization: spaceCascadeAuthorization()
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
PageSchema
|
|
50
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-OCMSAKWV.js";
|
|
4
|
+
import {
|
|
5
|
+
defineSchema,
|
|
6
|
+
money,
|
|
7
|
+
relation,
|
|
8
|
+
select,
|
|
9
|
+
text
|
|
10
|
+
} from "./chunk-EBNMV2VO.js";
|
|
11
|
+
|
|
12
|
+
// src/schema/schemas/budget.ts
|
|
13
|
+
var BUDGET_SCHEMA_IRI = "xnet://xnet.fyi/Budget@1.0.0";
|
|
14
|
+
var BudgetSchema = defineSchema({
|
|
15
|
+
name: "Budget",
|
|
16
|
+
namespace: "xnet://xnet.fyi/",
|
|
17
|
+
properties: {
|
|
18
|
+
/** Optional label; defaults to the account name in the UI. */
|
|
19
|
+
name: text({ maxLength: 200 }),
|
|
20
|
+
/** The account this budget caps (usually an expense account). */
|
|
21
|
+
account: relation({ target: "xnet://xnet.fyi/Account@1.0.0", required: true }),
|
|
22
|
+
/** Cap per period, as signed-positive minor units + currency. */
|
|
23
|
+
limit: money({ required: true }),
|
|
24
|
+
/** Recurrence of the cap. */
|
|
25
|
+
period: select({
|
|
26
|
+
options: [
|
|
27
|
+
{ id: "weekly", name: "Weekly" },
|
|
28
|
+
{ id: "monthly", name: "Monthly" },
|
|
29
|
+
{ id: "yearly", name: "Yearly" }
|
|
30
|
+
],
|
|
31
|
+
default: "monthly"
|
|
32
|
+
}),
|
|
33
|
+
/** Optional folder home for uniform filing; empty = Unfiled (0190). */
|
|
34
|
+
folder: relation({ target: "xnet://xnet.fyi/Folder@1.0.0" }),
|
|
35
|
+
/** Canonical SECURITY home; empty = personal/private book (0179/0181). */
|
|
36
|
+
space: relation({ target: "xnet://xnet.fyi/Space@1.0.0" }),
|
|
37
|
+
/** Per-node visibility; defaults to `private` (financial data, 0187). */
|
|
38
|
+
visibility: select({
|
|
39
|
+
options: [
|
|
40
|
+
{ id: "inherit", name: "Inherit", color: "gray" },
|
|
41
|
+
{ id: "private", name: "Private", color: "gray" },
|
|
42
|
+
{ id: "unlisted", name: "Unlisted", color: "yellow" },
|
|
43
|
+
{ id: "public", name: "Public", color: "green" }
|
|
44
|
+
],
|
|
45
|
+
default: "private"
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
authorization: spaceCascadeAuthorization()
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
BUDGET_SCHEMA_IRI,
|
|
53
|
+
BudgetSchema
|
|
54
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-OCMSAKWV.js";
|
|
4
|
+
import {
|
|
5
|
+
defineSchema,
|
|
6
|
+
relation,
|
|
7
|
+
select,
|
|
8
|
+
text
|
|
9
|
+
} from "./chunk-EBNMV2VO.js";
|
|
10
|
+
|
|
11
|
+
// src/schema/schemas/saved-view.ts
|
|
12
|
+
var SavedViewSchema = defineSchema({
|
|
13
|
+
name: "SavedView",
|
|
14
|
+
namespace: "xnet://xnet.fyi/",
|
|
15
|
+
properties: {
|
|
16
|
+
/** Human-readable view title */
|
|
17
|
+
title: text({ required: true, maxLength: 500 }),
|
|
18
|
+
/** Optional user-facing description */
|
|
19
|
+
description: text({ maxLength: 4e3 }),
|
|
20
|
+
/** JSON-serialized SavedViewDescriptor from store/query-ast */
|
|
21
|
+
descriptor: text({ required: true }),
|
|
22
|
+
/** Visibility and ownership boundary for the saved descriptor */
|
|
23
|
+
scope: select({
|
|
24
|
+
options: [
|
|
25
|
+
{ id: "user", name: "User" },
|
|
26
|
+
{ id: "workspace", name: "Workspace" },
|
|
27
|
+
{ id: "database", name: "Database" }
|
|
28
|
+
],
|
|
29
|
+
default: "workspace"
|
|
30
|
+
}),
|
|
31
|
+
/** Optional database that owns database-scoped views */
|
|
32
|
+
database: relation({ target: "xnet://xnet.fyi/Database@2.0.0" })
|
|
33
|
+
},
|
|
34
|
+
// Inherits access from its home Space (exploration 0181/0192).
|
|
35
|
+
authorization: spaceCascadeAuthorization("database")
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
SavedViewSchema
|
|
40
|
+
};
|