@xnetjs/data 0.0.2 → 0.0.3
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-BZHETMC4.js +12 -0
- package/dist/auth/index.d.ts +413 -0
- package/dist/auth/index.js +102 -0
- package/dist/budget-WR2Q4YH3.js +12 -0
- package/dist/canvas-HFMMVQLD.js +10 -0
- package/dist/channel-DXDYJ3ZH.js +12 -0
- package/dist/chat-message-QUUQGXEW.js +10 -0
- package/dist/chunk-2DSDH2ZH.js +52 -0
- package/dist/chunk-337E3ZOB.js +54 -0
- package/dist/chunk-37267RSF.js +41 -0
- package/dist/chunk-3JKW6TDE.js +66 -0
- package/dist/chunk-3RB2FMMO.js +148 -0
- package/dist/{chunk-BQBPA5HS.js → chunk-4U4KBCDN.js} +16 -2
- package/dist/chunk-4UQTURCD.js +722 -0
- package/dist/chunk-54Y7QRZN.js +109 -0
- package/dist/chunk-5FHJE7RC.js +46 -0
- package/dist/chunk-64AM6JPM.js +40 -0
- package/dist/chunk-6CN53PON.js +143 -0
- package/dist/chunk-6GB7PBCR.js +40 -0
- package/dist/chunk-6OPZJ7MG.js +78 -0
- package/dist/{chunk-IDMBCRUC.js → chunk-77UDLVQY.js} +1 -1
- package/dist/chunk-7GMJOAPF.js +52 -0
- package/dist/chunk-7PDRDSFH.js +69 -0
- package/dist/chunk-C5IRSEEZ.js +69 -0
- package/dist/chunk-CHZUSBSB.js +45 -0
- package/dist/chunk-DOZJXPQ6.js +232 -0
- package/dist/chunk-DTPSTMUD.js +105 -0
- package/dist/chunk-E6S557NC.js +402 -0
- package/dist/chunk-EIQX7INF.js +45 -0
- package/dist/chunk-ENTHVNOC.js +57 -0
- package/dist/chunk-EZA5UT4Y.js +5543 -0
- package/dist/chunk-GR3NDMBY.js +76 -0
- package/dist/chunk-GWYVY2K4.js +63 -0
- package/dist/chunk-IJ675GJR.js +42 -0
- package/dist/chunk-IP4BEVVD.js +57 -0
- package/dist/chunk-J4IVJA5M.js +102 -0
- package/dist/chunk-J6EDPPH4.js +84 -0
- package/dist/{chunk-SZC345Z2.js → chunk-JESSJ5CZ.js} +1015 -1110
- package/dist/chunk-JO6Y4E5V.js +73 -0
- package/dist/chunk-KPVBKKZS.js +47 -0
- package/dist/chunk-KTJLFJEQ.js +43 -0
- package/dist/chunk-L66WXPTW.js +32 -0
- package/dist/chunk-LGD72FVD.js +48 -0
- package/dist/chunk-O64EK5FK.js +887 -0
- package/dist/chunk-PMUQACPY.js +33 -0
- package/dist/chunk-PSUJEKVV.js +1722 -0
- package/dist/chunk-QVZXXJSP.js +6122 -0
- package/dist/chunk-QWFTRZQT.js +142 -0
- package/dist/chunk-RSSZXCLL.js +51 -0
- package/dist/chunk-S4B5OPZU.js +415 -0
- package/dist/{chunk-VYR5GPJP.js → chunk-SPFKSTPT.js} +9 -3
- package/dist/chunk-U6CBYDVZ.js +50 -0
- package/dist/chunk-UDUPQKRB.js +49 -0
- package/dist/chunk-V6HZ3LF3.js +380 -0
- package/dist/chunk-WMSCEBFH.js +64 -0
- package/dist/chunk-WUR3WWQM.js +65 -0
- package/dist/chunk-XHEA5UER.js +75 -0
- package/dist/chunk-XTUGZSYQ.js +75 -0
- package/dist/chunk-XWA3CJQ6.js +45 -0
- package/dist/chunk-YEQ6LLUY.js +49 -0
- package/dist/chunk-YWN27MLD.js +47 -0
- package/dist/chunk-YXZGYLKV.js +65 -0
- package/dist/chunk-ZICIXDEE.js +54 -0
- package/dist/chunk-ZMCO3O2Z.js +70 -0
- package/dist/clone-DpbVKLUu.d.ts +2205 -0
- package/dist/comment-Y2Y3QYYI.js +10 -0
- package/dist/crm-AAJXYIJY.js +68 -0
- package/dist/dashboard-3DC6B4BJ.js +10 -0
- package/dist/database/index.d.ts +882 -0
- package/dist/database/index.js +523 -0
- package/dist/database-DRGL5UYS.js +10 -0
- package/dist/database-field-F47FY3XX.js +10 -0
- package/dist/database-row-77OXW2NF.js +10 -0
- package/dist/database-select-option-6S3TTA7A.js +10 -0
- package/dist/database-view-YW7DQG5X.js +10 -0
- package/dist/experiment-TJOAL3OH.js +10 -0
- package/dist/external-item-D654PKLI.js +14 -0
- package/dist/external-reference-K5SUJIQN.js +8 -0
- package/dist/feed-L23XTNDI.js +12 -0
- package/dist/feed-item-GSO242J6.js +12 -0
- package/dist/folder-ONKSWHUT.js +21 -0
- package/dist/game-BF7DP5JU.js +50 -0
- package/dist/grant-NNKMWXPX.js +8 -0
- package/dist/grant-expiration-cleaner-DBiNTWbD.d.ts +249 -0
- package/dist/import-batch-JMESZ4VI.js +12 -0
- package/dist/inbox-state-AN6FPCIY.js +12 -0
- package/dist/index.d.ts +224 -4548
- package/dist/index.js +2206 -4754
- package/dist/map-AUV65YS3.js +10 -0
- package/dist/media-asset-4I5YPR4R.js +8 -0
- package/dist/memory-NV6EVJBE.js +12 -0
- package/dist/metric-X7W55DLC.js +10 -0
- package/dist/milestone-JJGOGK4R.js +12 -0
- package/dist/moderation-QSUVBCNS.js +30 -0
- package/dist/observation-UZSXXGBC.js +10 -0
- package/dist/page-NI7XODS6.js +10 -0
- package/dist/posting-FZOYVGH2.js +12 -0
- package/dist/profile-42A43GES.js +8 -0
- package/dist/project-G2CTLDXY.js +10 -0
- package/dist/query-ast-CWo6_30h.d.ts +226 -0
- package/dist/reaction-VAQBVDUD.js +10 -0
- package/dist/registry-CQoN_p8U.d.ts +99 -0
- package/dist/saved-view-AOQHGHNM.js +10 -0
- package/dist/schema/index.d.ts +6182 -0
- package/dist/schema/index.js +631 -0
- package/dist/schema-extension-5BUXRDPB.js +18 -0
- package/dist/space-PZ737CIS.js +42 -0
- package/dist/space-membership-N35NRX6F.js +14 -0
- package/dist/store/index.d.ts +391 -0
- package/dist/store/index.js +135 -0
- package/dist/store-CvgiydME.d.ts +338 -0
- package/dist/sync/awareness.d.ts +69 -0
- package/dist/sync/awareness.js +20 -0
- package/dist/system-Q5I6STDC.js +38 -0
- package/dist/tag-C677GKQW.js +16 -0
- package/dist/task-WQLMPN5U.js +16 -0
- package/dist/task-view-T5S32V4L.js +10 -0
- package/dist/transaction-U3ITRGJP.js +12 -0
- package/dist/transcription-F3T23LLO.js +12 -0
- package/dist/types-Def-5Nka.d.ts +1525 -0
- package/dist/updates.d.ts +44 -0
- package/dist/updates.js +16 -0
- package/dist/user-widget-4SJJFPG5.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,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-6OPZJ7MG.js";
|
|
4
|
+
import {
|
|
5
|
+
defineSchema,
|
|
6
|
+
json,
|
|
7
|
+
relation,
|
|
8
|
+
select,
|
|
9
|
+
text
|
|
10
|
+
} from "./chunk-O64EK5FK.js";
|
|
11
|
+
|
|
12
|
+
// src/schema/schemas/database-view.ts
|
|
13
|
+
var DatabaseViewSchema = defineSchema({
|
|
14
|
+
name: "DatabaseView",
|
|
15
|
+
namespace: "xnet://xnet.fyi/",
|
|
16
|
+
properties: {
|
|
17
|
+
/** Parent database */
|
|
18
|
+
database: relation({
|
|
19
|
+
target: "xnet://xnet.fyi/Database@2.0.0",
|
|
20
|
+
required: true
|
|
21
|
+
}),
|
|
22
|
+
/** Display name */
|
|
23
|
+
name: text({ required: true, maxLength: 200 }),
|
|
24
|
+
/** View type */
|
|
25
|
+
type: select({
|
|
26
|
+
options: [
|
|
27
|
+
{ id: "table", name: "Table" },
|
|
28
|
+
{ id: "board", name: "Board" },
|
|
29
|
+
{ id: "list", name: "List" },
|
|
30
|
+
{ id: "gallery", name: "Gallery" },
|
|
31
|
+
{ id: "calendar", name: "Calendar" },
|
|
32
|
+
{ id: "timeline", name: "Timeline" }
|
|
33
|
+
],
|
|
34
|
+
default: "table"
|
|
35
|
+
}),
|
|
36
|
+
/** Filter tree (FilterGroup) — whole-tree LWW */
|
|
37
|
+
filters: json({}),
|
|
38
|
+
/** Sort list (SortConfig[]) — whole-list LWW */
|
|
39
|
+
sorts: json({}),
|
|
40
|
+
/** Group-by field ID */
|
|
41
|
+
groupBy: text({ maxLength: 100 }),
|
|
42
|
+
/** Group sort direction ('asc' | 'desc') */
|
|
43
|
+
groupSort: text({ maxLength: 4 }),
|
|
44
|
+
/** Collapsed group keys */
|
|
45
|
+
collapsedGroups: json({}),
|
|
46
|
+
/** Per-view field order: fieldId -> fractional sortKey override */
|
|
47
|
+
fieldOrder: json({}),
|
|
48
|
+
/** Per-view field widths: fieldId -> pixels */
|
|
49
|
+
fieldWidths: json({}),
|
|
50
|
+
/** Per-view hidden field IDs */
|
|
51
|
+
hiddenFields: json({}),
|
|
52
|
+
/** Row-height density tier (RowHeight: short | medium | tall | extraTall) */
|
|
53
|
+
rowHeight: text({ maxLength: 12 }),
|
|
54
|
+
/** Per-column footer summary functions: fieldId -> SummaryFunction */
|
|
55
|
+
columnSummaries: json({}),
|
|
56
|
+
/** Fractional index for view tab ordering */
|
|
57
|
+
sortKey: text({ required: true }),
|
|
58
|
+
// Gallery/Board specific
|
|
59
|
+
/** Cover image field ID */
|
|
60
|
+
coverField: text({ maxLength: 100 }),
|
|
61
|
+
/** Card size ('small' | 'medium' | 'large') */
|
|
62
|
+
cardSize: text({ maxLength: 10 }),
|
|
63
|
+
// Calendar/Timeline specific
|
|
64
|
+
/** Start date field ID */
|
|
65
|
+
dateField: text({ maxLength: 100 }),
|
|
66
|
+
/** End date field ID */
|
|
67
|
+
endDateField: text({ maxLength: 100 })
|
|
68
|
+
},
|
|
69
|
+
// Inherits access from its home Space (exploration 0181/0192).
|
|
70
|
+
authorization: spaceCascadeAuthorization("database")
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
DatabaseViewSchema
|
|
75
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
date,
|
|
3
|
+
defineSchema,
|
|
4
|
+
number,
|
|
5
|
+
relation,
|
|
6
|
+
select,
|
|
7
|
+
text
|
|
8
|
+
} from "./chunk-O64EK5FK.js";
|
|
9
|
+
import {
|
|
10
|
+
presets
|
|
11
|
+
} from "./chunk-JESSJ5CZ.js";
|
|
12
|
+
|
|
13
|
+
// src/schema/schemas/memory.ts
|
|
14
|
+
var MEMORY_ITEM_SCHEMA_IRI = "xnet://xnet.fyi/MemoryItem@1.0.0";
|
|
15
|
+
var MEMORY_KINDS = [
|
|
16
|
+
{ id: "fact", name: "Fact", color: "blue" },
|
|
17
|
+
{ id: "preference", name: "Preference", color: "purple" },
|
|
18
|
+
{ id: "episode", name: "Episode", color: "green" }
|
|
19
|
+
];
|
|
20
|
+
var MemoryItemSchema = defineSchema({
|
|
21
|
+
name: "MemoryItem",
|
|
22
|
+
namespace: "xnet://xnet.fyi/",
|
|
23
|
+
properties: {
|
|
24
|
+
/** Fact / preference / episode. */
|
|
25
|
+
kind: select({ options: MEMORY_KINDS, default: "fact" }),
|
|
26
|
+
/** The remembered statement, in natural language. */
|
|
27
|
+
text: text({ required: true, maxLength: 4e3 }),
|
|
28
|
+
/** Ranking weight in [0, 1]. Higher = more important to surface. */
|
|
29
|
+
salience: number({ min: 0, max: 1 }),
|
|
30
|
+
/** When this memory was last used or confirmed (epoch ms). */
|
|
31
|
+
lastUsedAt: date(),
|
|
32
|
+
/** Decay factor in [0, 1] applied during consolidation. */
|
|
33
|
+
decay: number({ min: 0, max: 1 }),
|
|
34
|
+
/** The source nodes this memory was distilled from (auditable provenance). */
|
|
35
|
+
evidence: relation({ multiple: true })
|
|
36
|
+
},
|
|
37
|
+
document: void 0,
|
|
38
|
+
authorization: presets.private()
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
MEMORY_ITEM_SCHEMA_IRI,
|
|
43
|
+
MEMORY_KINDS,
|
|
44
|
+
MemoryItemSchema
|
|
45
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-6OPZJ7MG.js";
|
|
4
|
+
import {
|
|
5
|
+
defineSchema,
|
|
6
|
+
json,
|
|
7
|
+
relation,
|
|
8
|
+
select,
|
|
9
|
+
text
|
|
10
|
+
} from "./chunk-O64EK5FK.js";
|
|
11
|
+
|
|
12
|
+
// src/schema/schemas/task-view.ts
|
|
13
|
+
var TaskViewSchema = defineSchema({
|
|
14
|
+
name: "TaskView",
|
|
15
|
+
namespace: "xnet://xnet.fyi/",
|
|
16
|
+
properties: {
|
|
17
|
+
/** Display name */
|
|
18
|
+
name: text({ required: true, maxLength: 200 }),
|
|
19
|
+
/** View type */
|
|
20
|
+
type: select({
|
|
21
|
+
options: [
|
|
22
|
+
{ id: "list", name: "List" },
|
|
23
|
+
{ id: "board", name: "Board" },
|
|
24
|
+
{ id: "triage", name: "Triage" },
|
|
25
|
+
{ id: "calendar", name: "Calendar" },
|
|
26
|
+
{ id: "timeline", name: "Timeline" }
|
|
27
|
+
],
|
|
28
|
+
default: "list"
|
|
29
|
+
}),
|
|
30
|
+
/** Filter tree (FilterGroup over Task properties) — whole-tree LWW */
|
|
31
|
+
filters: json({}),
|
|
32
|
+
/** Sort list (SortConfig[]) — whole-list LWW */
|
|
33
|
+
sorts: json({}),
|
|
34
|
+
/** Group-by task property (e.g. 'status' | 'assignee' | 'priority') */
|
|
35
|
+
groupBy: text({ maxLength: 100 }),
|
|
36
|
+
/** Collapsed group keys */
|
|
37
|
+
collapsedGroups: json({}),
|
|
38
|
+
/** Scope the view to a project (absent = workspace-wide) */
|
|
39
|
+
project: relation({ target: "xnet://xnet.fyi/Project@1.0.0" }),
|
|
40
|
+
/** Fractional index for view tab ordering */
|
|
41
|
+
sortKey: text({ required: true })
|
|
42
|
+
},
|
|
43
|
+
// Inherits access from its home Space (exploration 0181/0192).
|
|
44
|
+
authorization: spaceCascadeAuthorization("project")
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
TaskViewSchema
|
|
49
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkbox,
|
|
3
|
+
created,
|
|
4
|
+
createdBy,
|
|
5
|
+
defineSchema,
|
|
6
|
+
text
|
|
7
|
+
} from "./chunk-O64EK5FK.js";
|
|
8
|
+
import {
|
|
9
|
+
presets
|
|
10
|
+
} from "./chunk-JESSJ5CZ.js";
|
|
11
|
+
|
|
12
|
+
// src/schema/schemas/tag.ts
|
|
13
|
+
var TAG_SCHEMA_IRI = "xnet://xnet.fyi/Tag@1.0.0";
|
|
14
|
+
var MAX_TAG_NAME_LENGTH = 80;
|
|
15
|
+
var TagSchema = defineSchema({
|
|
16
|
+
name: "Tag",
|
|
17
|
+
namespace: "xnet://xnet.fyi/",
|
|
18
|
+
properties: {
|
|
19
|
+
/** Normalized lowercase name, no leading '#' (see normalizeTagName) */
|
|
20
|
+
name: text({ required: true, maxLength: MAX_TAG_NAME_LENGTH }),
|
|
21
|
+
/** Pill/badge color token */
|
|
22
|
+
color: text({ maxLength: 30 }),
|
|
23
|
+
/** Optional description shown on the tag page */
|
|
24
|
+
description: text({ maxLength: 500 }),
|
|
25
|
+
/** Archived tags are hidden from pickers but references keep working */
|
|
26
|
+
archived: checkbox({ default: false }),
|
|
27
|
+
createdAt: created(),
|
|
28
|
+
createdBy: createdBy()
|
|
29
|
+
},
|
|
30
|
+
document: void 0,
|
|
31
|
+
// Standalone/personal content: owner-only by default (exploration 0192).
|
|
32
|
+
authorization: presets.private()
|
|
33
|
+
});
|
|
34
|
+
function normalizeTagName(raw) {
|
|
35
|
+
return raw.replace(/^#+/, "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\-_./]/gu, "").replace(/-{2,}/g, "-").slice(0, MAX_TAG_NAME_LENGTH);
|
|
36
|
+
}
|
|
37
|
+
function isValidTagName(name) {
|
|
38
|
+
return name.length > 0 && name === normalizeTagName(name);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
TAG_SCHEMA_IRI,
|
|
43
|
+
MAX_TAG_NAME_LENGTH,
|
|
44
|
+
TagSchema,
|
|
45
|
+
normalizeTagName,
|
|
46
|
+
isValidTagName
|
|
47
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-6OPZJ7MG.js";
|
|
4
|
+
import {
|
|
5
|
+
date,
|
|
6
|
+
defineSchema,
|
|
7
|
+
relation,
|
|
8
|
+
select,
|
|
9
|
+
text
|
|
10
|
+
} from "./chunk-O64EK5FK.js";
|
|
11
|
+
|
|
12
|
+
// src/schema/schemas/transaction.ts
|
|
13
|
+
var TRANSACTION_SCHEMA_IRI = "xnet://xnet.fyi/Transaction@1.0.0";
|
|
14
|
+
var TransactionSchema = defineSchema({
|
|
15
|
+
name: "Transaction",
|
|
16
|
+
namespace: "xnet://xnet.fyi/",
|
|
17
|
+
properties: {
|
|
18
|
+
/** When the transaction posted (Unix ms). */
|
|
19
|
+
date: date({ required: true }),
|
|
20
|
+
/** Who was paid / who paid (free text). */
|
|
21
|
+
payee: text({ maxLength: 200 }),
|
|
22
|
+
/** Note / description. */
|
|
23
|
+
memo: text({ maxLength: 2e3 }),
|
|
24
|
+
/**
|
|
25
|
+
* Counterparty in the person/contact graph (AR/AP). Untyped so it can point
|
|
26
|
+
* at a Profile, a ConnectableProfile (CRM), or any contact node.
|
|
27
|
+
*/
|
|
28
|
+
counterparty: relation({}),
|
|
29
|
+
/** Reconciliation state. */
|
|
30
|
+
status: select({
|
|
31
|
+
options: [
|
|
32
|
+
{ id: "pending", name: "Pending", color: "gray" },
|
|
33
|
+
{ id: "cleared", name: "Cleared", color: "blue" },
|
|
34
|
+
{ id: "reconciled", name: "Reconciled", color: "green" }
|
|
35
|
+
],
|
|
36
|
+
default: "pending"
|
|
37
|
+
}),
|
|
38
|
+
/** The import batch that produced this transaction, if any. */
|
|
39
|
+
importBatch: relation({ target: "xnet://xnet.fyi/ImportBatch@1.0.0" }),
|
|
40
|
+
/** Stable provider/file id for de-duplication on re-import. */
|
|
41
|
+
externalId: text({ maxLength: 200 }),
|
|
42
|
+
/** Optional folder home for uniform filing; empty = Unfiled (0190). */
|
|
43
|
+
folder: relation({ target: "xnet://xnet.fyi/Folder@1.0.0" }),
|
|
44
|
+
/** Optional CRM deal this transaction realizes (quote-to-cash, 0190). */
|
|
45
|
+
deal: relation({ target: "xnet://xnet.fyi/Deal@1.0.0" }),
|
|
46
|
+
/** Canonical SECURITY home; empty = personal/private book (0179/0181). */
|
|
47
|
+
space: relation({ target: "xnet://xnet.fyi/Space@1.0.0" }),
|
|
48
|
+
/** Per-node visibility; defaults to `private` (financial data, 0187). */
|
|
49
|
+
visibility: select({
|
|
50
|
+
options: [
|
|
51
|
+
{ id: "inherit", name: "Inherit", color: "gray" },
|
|
52
|
+
{ id: "private", name: "Private", color: "gray" },
|
|
53
|
+
{ id: "unlisted", name: "Unlisted", color: "yellow" },
|
|
54
|
+
{ id: "public", name: "Public", color: "green" }
|
|
55
|
+
],
|
|
56
|
+
default: "private"
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
authorization: spaceCascadeAuthorization()
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
TRANSACTION_SCHEMA_IRI,
|
|
64
|
+
TransactionSchema
|
|
65
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
created,
|
|
3
|
+
createdBy,
|
|
4
|
+
defineSchema,
|
|
5
|
+
number,
|
|
6
|
+
person,
|
|
7
|
+
relation,
|
|
8
|
+
select
|
|
9
|
+
} from "./chunk-O64EK5FK.js";
|
|
10
|
+
|
|
11
|
+
// src/schema/schemas/space-membership.ts
|
|
12
|
+
var SPACE_MEMBERSHIP_SCHEMA_IRI = "xnet://xnet.fyi/SpaceMembership@1.0.0";
|
|
13
|
+
var SpaceMembershipSchema = defineSchema({
|
|
14
|
+
name: "SpaceMembership",
|
|
15
|
+
namespace: "xnet://xnet.fyi/",
|
|
16
|
+
properties: {
|
|
17
|
+
/** The space this membership belongs to */
|
|
18
|
+
space: relation({ target: "xnet://xnet.fyi/Space@1.0.0", required: true }),
|
|
19
|
+
/** The member DID */
|
|
20
|
+
member: person({ required: true }),
|
|
21
|
+
/** Role within the space */
|
|
22
|
+
role: select({
|
|
23
|
+
options: [
|
|
24
|
+
{ id: "viewer", name: "Viewer", color: "gray" },
|
|
25
|
+
{ id: "commenter", name: "Commenter", color: "yellow" },
|
|
26
|
+
{ id: "member", name: "Member", color: "blue" },
|
|
27
|
+
{ id: "admin", name: "Admin", color: "purple" },
|
|
28
|
+
{ id: "owner", name: "Owner", color: "red" }
|
|
29
|
+
],
|
|
30
|
+
required: true,
|
|
31
|
+
default: "member"
|
|
32
|
+
}),
|
|
33
|
+
/** Who added this member (DID) */
|
|
34
|
+
addedBy: person({}),
|
|
35
|
+
/** When the member was added (ms since epoch) */
|
|
36
|
+
addedAt: number({}),
|
|
37
|
+
createdAt: created(),
|
|
38
|
+
createdBy: createdBy()
|
|
39
|
+
},
|
|
40
|
+
document: void 0
|
|
41
|
+
});
|
|
42
|
+
function spaceMembershipId(spaceId, memberDid) {
|
|
43
|
+
return `spacemember:${spaceId}:${memberDid}`;
|
|
44
|
+
}
|
|
45
|
+
function isSpaceRole(value) {
|
|
46
|
+
return value === "viewer" || value === "commenter" || value === "member" || value === "admin" || value === "owner";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
SPACE_MEMBERSHIP_SCHEMA_IRI,
|
|
51
|
+
SpaceMembershipSchema,
|
|
52
|
+
spaceMembershipId,
|
|
53
|
+
isSpaceRole
|
|
54
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spaceCascadeAuthorization
|
|
3
|
+
} from "./chunk-6OPZJ7MG.js";
|
|
4
|
+
import {
|
|
5
|
+
checkbox,
|
|
6
|
+
created,
|
|
7
|
+
createdBy,
|
|
8
|
+
defineSchema,
|
|
9
|
+
person,
|
|
10
|
+
relation,
|
|
11
|
+
select,
|
|
12
|
+
text
|
|
13
|
+
} from "./chunk-O64EK5FK.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
|
+
};
|