@xnetjs/data 0.0.3 → 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.
Files changed (151) hide show
  1. package/dist/account-MWNCH4GJ.js +12 -0
  2. package/dist/account-ledger-R2GAFJL6.js +38 -0
  3. package/dist/auth/index.d.ts +11 -4
  4. package/dist/auth/index.js +1 -1
  5. package/dist/budget-NN7P35XP.js +12 -0
  6. package/dist/canvas-6WYBNH53.js +10 -0
  7. package/dist/channel-AT3LQF4A.js +12 -0
  8. package/dist/chat-message-DSVO72B3.js +10 -0
  9. package/dist/{chunk-J6EDPPH4.js → chunk-2ZNJWIQG.js} +2 -2
  10. package/dist/{chunk-5FHJE7RC.js → chunk-3J3HILXO.js} +2 -2
  11. package/dist/{chunk-EZA5UT4Y.js → chunk-3RUDVTMH.js} +6 -6
  12. package/dist/{chunk-YEQ6LLUY.js → chunk-4EYKGTSQ.js} +2 -2
  13. package/dist/{chunk-L66WXPTW.js → chunk-53F4PRNC.js} +2 -2
  14. package/dist/{chunk-LGD72FVD.js → chunk-5EXHNXPL.js} +2 -2
  15. package/dist/{chunk-4U4KBCDN.js → chunk-5HC5NO57.js} +2 -2
  16. package/dist/{chunk-YWN27MLD.js → chunk-6KLGA6IR.js} +2 -2
  17. package/dist/{chunk-37267RSF.js → chunk-6OMG4I7M.js} +2 -2
  18. package/dist/{chunk-DOZJXPQ6.js → chunk-BQLQSWKZ.js} +2 -2
  19. package/dist/{chunk-V6HZ3LF3.js → chunk-BY5O6LNC.js} +1 -1
  20. package/dist/{chunk-64AM6JPM.js → chunk-DCTRX6II.js} +1 -1
  21. package/dist/{chunk-SPFKSTPT.js → chunk-DWEXKD6E.js} +2 -2
  22. package/dist/{chunk-O64EK5FK.js → chunk-EBNMV2VO.js} +11 -2
  23. package/dist/{chunk-J4IVJA5M.js → chunk-FVEACSKE.js} +2 -2
  24. package/dist/{chunk-XWA3CJQ6.js → chunk-GU6THOAB.js} +2 -2
  25. package/dist/{chunk-XTUGZSYQ.js → chunk-H4GA4BBK.js} +2 -2
  26. package/dist/{chunk-GR3NDMBY.js → chunk-IJ44LR7N.js} +2 -2
  27. package/dist/{chunk-E6S557NC.js → chunk-J4ANIXIV.js} +2 -2
  28. package/dist/{chunk-EIQX7INF.js → chunk-JDFNMFOZ.js} +2 -2
  29. package/dist/{chunk-PSUJEKVV.js → chunk-K7DOZWWT.js} +244 -155
  30. package/dist/{chunk-UDUPQKRB.js → chunk-KQAT4XBL.js} +2 -2
  31. package/dist/chunk-KQUALW4O.js +183 -0
  32. package/dist/{chunk-KPVBKKZS.js → chunk-LYSWLCOI.js} +2 -2
  33. package/dist/{chunk-YXZGYLKV.js → chunk-MBTUO3ZL.js} +2 -2
  34. package/dist/{chunk-7GMJOAPF.js → chunk-NI4FHG2K.js} +2 -2
  35. package/dist/{chunk-6OPZJ7MG.js → chunk-OCMSAKWV.js} +2 -2
  36. package/dist/{chunk-IP4BEVVD.js → chunk-OGJCRNGE.js} +2 -2
  37. package/dist/{chunk-6CN53PON.js → chunk-OPPHF3TF.js} +3 -3
  38. package/dist/{chunk-77UDLVQY.js → chunk-OSAWNZVM.js} +1 -1
  39. package/dist/{chunk-GWYVY2K4.js → chunk-PNESGUH5.js} +2 -2
  40. package/dist/{chunk-RSSZXCLL.js → chunk-Q3IEGH4B.js} +2 -2
  41. package/dist/{chunk-2DSDH2ZH.js → chunk-QJW5LDP4.js} +2 -2
  42. package/dist/{chunk-JESSJ5CZ.js → chunk-RL64OJJ5.js} +13 -3
  43. package/dist/{chunk-S4B5OPZU.js → chunk-S5RP5RKY.js} +1 -0
  44. package/dist/{chunk-4UQTURCD.js → chunk-S6U6TCMN.js} +2 -2
  45. package/dist/{chunk-C5IRSEEZ.js → chunk-SVNGSZZA.js} +2 -2
  46. package/dist/{chunk-ZICIXDEE.js → chunk-T5AZAOG5.js} +1 -1
  47. package/dist/{chunk-IJ675GJR.js → chunk-TCTZW4A6.js} +2 -2
  48. package/dist/{chunk-54Y7QRZN.js → chunk-U64CW73O.js} +2 -2
  49. package/dist/{chunk-QVZXXJSP.js → chunk-UDWKWTAX.js} +485 -81
  50. package/dist/{chunk-3RB2FMMO.js → chunk-UQM3G5A2.js} +2 -2
  51. package/dist/{chunk-ENTHVNOC.js → chunk-VQ7JHB67.js} +2 -2
  52. package/dist/{chunk-JO6Y4E5V.js → chunk-W7EBL7ZU.js} +2 -2
  53. package/dist/{chunk-WUR3WWQM.js → chunk-WEPK7SZF.js} +2 -2
  54. package/dist/{chunk-3JKW6TDE.js → chunk-XMSKJ5PV.js} +2 -2
  55. package/dist/{chunk-WMSCEBFH.js → chunk-XROI44ZP.js} +2 -2
  56. package/dist/{chunk-CHZUSBSB.js → chunk-Y3S5SRVM.js} +2 -2
  57. package/dist/{chunk-KTJLFJEQ.js → chunk-YEFKQYKA.js} +2 -2
  58. package/dist/{chunk-DTPSTMUD.js → chunk-YSUIXD2Y.js} +2 -2
  59. package/dist/{chunk-ZMCO3O2Z.js → chunk-ZCOFZY5M.js} +2 -2
  60. package/dist/{chunk-U6CBYDVZ.js → chunk-ZLU4Y3O2.js} +2 -2
  61. package/dist/{chunk-337E3ZOB.js → chunk-ZPZ7XDA6.js} +2 -2
  62. package/dist/{chunk-6GB7PBCR.js → chunk-ZZ6TWKGS.js} +2 -2
  63. package/dist/{clone-DpbVKLUu.d.ts → clone-C0Jhk2UN.d.ts} +2 -2
  64. package/dist/comment-QSWYAQVS.js +10 -0
  65. package/dist/{crm-AAJXYIJY.js → crm-L5RYAAF3.js} +5 -5
  66. package/dist/dashboard-JMKTTRA7.js +10 -0
  67. package/dist/database/index.d.ts +3 -3
  68. package/dist/database/index.js +11 -11
  69. package/dist/database-GIXSPZJW.js +10 -0
  70. package/dist/database-field-3EPAMZUR.js +10 -0
  71. package/dist/database-row-6Q6TRVE4.js +10 -0
  72. package/dist/database-select-option-BBBJFLLH.js +10 -0
  73. package/dist/database-view-5PLSOBI2.js +10 -0
  74. package/dist/experiment-DOVOZ34Y.js +10 -0
  75. package/dist/{external-item-D654PKLI.js → external-item-P2E5X7BZ.js} +5 -5
  76. package/dist/external-reference-7BSFF6SA.js +8 -0
  77. package/dist/feed-2IXHHP6O.js +12 -0
  78. package/dist/feed-item-DPE6LN7I.js +12 -0
  79. package/dist/{folder-ONKSWHUT.js → folder-6KM3KYD5.js} +3 -3
  80. package/dist/{game-BF7DP5JU.js → game-5AK5XWBR.js} +5 -5
  81. package/dist/grant-WTQSNT5A.js +8 -0
  82. package/dist/{grant-expiration-cleaner-DBiNTWbD.d.ts → grant-expiration-cleaner-CY6BcmlR.d.ts} +2 -2
  83. package/dist/import-batch-IXBJLQPJ.js +12 -0
  84. package/dist/{inbox-state-AN6FPCIY.js → inbox-state-E5NSVOGP.js} +3 -3
  85. package/dist/index.d.ts +7 -7
  86. package/dist/index.js +101 -55
  87. package/dist/map-RG5Y3CPC.js +10 -0
  88. package/dist/media-asset-QTCGLIZA.js +8 -0
  89. package/dist/{memory-NV6EVJBE.js → memory-PNRTMBZO.js} +3 -3
  90. package/dist/metric-65SVOX5C.js +10 -0
  91. package/dist/milestone-XEO6ZGDG.js +12 -0
  92. package/dist/{moderation-QSUVBCNS.js → moderation-FFHETMRB.js} +3 -3
  93. package/dist/observation-2Y3QKUXM.js +10 -0
  94. package/dist/page-2V27JGKJ.js +10 -0
  95. package/dist/posting-GBOSZCMZ.js +12 -0
  96. package/dist/profile-BLLDWIDK.js +8 -0
  97. package/dist/project-CQL5LN26.js +10 -0
  98. package/dist/{query-ast-CWo6_30h.d.ts → query-ast-C3m6kZYv.d.ts} +1 -1
  99. package/dist/reaction-T2DTJBBV.js +10 -0
  100. package/dist/{registry-CQoN_p8U.d.ts → registry-DunPv__d.d.ts} +1 -1
  101. package/dist/saved-view-4R2DBCL3.js +10 -0
  102. package/dist/schema/index.d.ts +320 -13
  103. package/dist/schema/index.js +98 -52
  104. package/dist/{schema-extension-5BUXRDPB.js → schema-extension-LNRF2YRD.js} +5 -5
  105. package/dist/{space-PZ737CIS.js → space-IJU24PBH.js} +6 -6
  106. package/dist/{space-membership-N35NRX6F.js → space-membership-DEUMM7NV.js} +3 -3
  107. package/dist/store/index.d.ts +131 -4
  108. package/dist/store/index.js +5 -5
  109. package/dist/{store-CvgiydME.d.ts → store-DtIDjk7c.d.ts} +18 -1
  110. package/dist/{system-Q5I6STDC.js → system-ILHCZOVO.js} +3 -3
  111. package/dist/{tag-C677GKQW.js → tag-SKCHM3U5.js} +3 -3
  112. package/dist/{task-WQLMPN5U.js → task-7AOBP7WC.js} +5 -5
  113. package/dist/task-view-NUGKELJP.js +10 -0
  114. package/dist/transaction-ZDSEGDIR.js +12 -0
  115. package/dist/transcription-PSCLDAGX.js +12 -0
  116. package/dist/{types-Def-5Nka.d.ts → types-S-BJAKyK.d.ts} +53 -2
  117. package/dist/user-widget-RLY2N46A.js +8 -0
  118. package/package.json +7 -7
  119. package/dist/account-BZHETMC4.js +0 -12
  120. package/dist/budget-WR2Q4YH3.js +0 -12
  121. package/dist/canvas-HFMMVQLD.js +0 -10
  122. package/dist/channel-DXDYJ3ZH.js +0 -12
  123. package/dist/chat-message-QUUQGXEW.js +0 -10
  124. package/dist/comment-Y2Y3QYYI.js +0 -10
  125. package/dist/dashboard-3DC6B4BJ.js +0 -10
  126. package/dist/database-DRGL5UYS.js +0 -10
  127. package/dist/database-field-F47FY3XX.js +0 -10
  128. package/dist/database-row-77OXW2NF.js +0 -10
  129. package/dist/database-select-option-6S3TTA7A.js +0 -10
  130. package/dist/database-view-YW7DQG5X.js +0 -10
  131. package/dist/experiment-TJOAL3OH.js +0 -10
  132. package/dist/external-reference-K5SUJIQN.js +0 -8
  133. package/dist/feed-L23XTNDI.js +0 -12
  134. package/dist/feed-item-GSO242J6.js +0 -12
  135. package/dist/grant-NNKMWXPX.js +0 -8
  136. package/dist/import-batch-JMESZ4VI.js +0 -12
  137. package/dist/map-AUV65YS3.js +0 -10
  138. package/dist/media-asset-4I5YPR4R.js +0 -8
  139. package/dist/metric-X7W55DLC.js +0 -10
  140. package/dist/milestone-JJGOGK4R.js +0 -12
  141. package/dist/observation-UZSXXGBC.js +0 -10
  142. package/dist/page-NI7XODS6.js +0 -10
  143. package/dist/posting-FZOYVGH2.js +0 -12
  144. package/dist/profile-42A43GES.js +0 -8
  145. package/dist/project-G2CTLDXY.js +0 -10
  146. package/dist/reaction-VAQBVDUD.js +0 -10
  147. package/dist/saved-view-AOQHGHNM.js +0 -10
  148. package/dist/task-view-T5S32V4L.js +0 -10
  149. package/dist/transaction-U3ITRGJP.js +0 -12
  150. package/dist/transcription-F3T23LLO.js +0 -12
  151. package/dist/user-widget-4SJJFPG5.js +0 -8
@@ -0,0 +1,183 @@
1
+ import {
2
+ created,
3
+ createdBy,
4
+ defineSchema,
5
+ json,
6
+ number,
7
+ person,
8
+ select,
9
+ text
10
+ } from "./chunk-EBNMV2VO.js";
11
+
12
+ // src/schema/schemas/account-ledger.ts
13
+ var NS = "xnet://xnet.fyi/";
14
+ var ACCOUNT_RECORD_SCHEMA_IRI = "xnet://xnet.fyi/AccountRecord@1.0.0";
15
+ var DEVICE_RECORD_SCHEMA_IRI = "xnet://xnet.fyi/DeviceRecord@1.0.0";
16
+ var RECOVERY_RECORD_SCHEMA_IRI = "xnet://xnet.fyi/RecoveryRecord@1.0.0";
17
+ var REVOCATION_RECORD_SCHEMA_IRI = "xnet://xnet.fyi/RevocationRecord@1.0.0";
18
+ var ledgerStatus = () => select({
19
+ options: [
20
+ { id: "active", name: "Active", color: "green" },
21
+ { id: "revoked", name: "Revoked", color: "red" }
22
+ ],
23
+ required: true,
24
+ default: "active"
25
+ });
26
+ var AccountRecordSchema = defineSchema({
27
+ name: "AccountRecord",
28
+ namespace: NS,
29
+ properties: {
30
+ /** Stable subject, e.g. `xnet:account:<hash>`. Appears in grants + the cloud binding. */
31
+ accountId: text({ required: true }),
32
+ label: text({}),
33
+ /** Device DIDs allowed to sign ledger changes (admit/revoke). JSON array of DIDs. */
34
+ controllers: json({}),
35
+ /** Monotonic epoch, bumped on every revocation so stale authorizations are detectable. */
36
+ epoch: number({}),
37
+ createdAt: created(),
38
+ createdBy: createdBy()
39
+ },
40
+ document: void 0
41
+ });
42
+ var DeviceRecordSchema = defineSchema({
43
+ name: "DeviceRecord",
44
+ namespace: NS,
45
+ properties: {
46
+ /** The owning account subject (id, for portability across hub mirrors). */
47
+ account: text({ required: true }),
48
+ /** The device's data identity (`did:key`). */
49
+ deviceDid: person({ required: true }),
50
+ label: text({}),
51
+ /** WebAuthn relying-party id the gating passkey is scoped to. */
52
+ rpId: text({}),
53
+ /** Hash of the WebAuthn credential id (never the credential itself). */
54
+ credentialIdHash: text({}),
55
+ /** Capability hints (JSON), e.g. which scopes this device may exercise. */
56
+ capabilities: json({}),
57
+ status: ledgerStatus(),
58
+ /** The controller DID that admitted this device. */
59
+ addedBy: person({}),
60
+ addedAt: number({}),
61
+ lastSeenAt: number({}),
62
+ /** Epoch at which this device was admitted. */
63
+ epoch: number({}),
64
+ createdAt: created(),
65
+ createdBy: createdBy()
66
+ },
67
+ document: void 0
68
+ });
69
+ var RecoveryRecordSchema = defineSchema({
70
+ name: "RecoveryRecord",
71
+ namespace: NS,
72
+ properties: {
73
+ account: text({ required: true }),
74
+ method: select({
75
+ options: [
76
+ { id: "phrase", name: "Recovery phrase", color: "blue" },
77
+ { id: "social", name: "Social recovery", color: "purple" },
78
+ { id: "hardware", name: "Hardware key", color: "gray" },
79
+ { id: "admin", name: "Enterprise admin", color: "yellow" },
80
+ { id: "backup-passkey", name: "Backup passkey", color: "green" }
81
+ ],
82
+ required: true,
83
+ default: "phrase"
84
+ }),
85
+ label: text({}),
86
+ /** Public commitment to the recovery key (e.g. the recovery DID), not the secret. */
87
+ publicKeyHash: text({}),
88
+ status: ledgerStatus(),
89
+ addedBy: person({}),
90
+ addedAt: number({}),
91
+ createdAt: created(),
92
+ createdBy: createdBy()
93
+ },
94
+ document: void 0
95
+ });
96
+ var RevocationRecordSchema = defineSchema({
97
+ name: "RevocationRecord",
98
+ namespace: NS,
99
+ properties: {
100
+ account: text({ required: true }),
101
+ subjectKind: select({
102
+ options: [
103
+ { id: "device", name: "Device", color: "blue" },
104
+ { id: "recovery", name: "Recovery method", color: "purple" }
105
+ ],
106
+ required: true,
107
+ default: "device"
108
+ }),
109
+ /** The revoked subject: a device DID or a recovery record id. */
110
+ subject: text({ required: true }),
111
+ reason: text({}),
112
+ effectiveAt: number({}),
113
+ /** Epoch this revocation takes effect at. */
114
+ epoch: number({}),
115
+ /** The controller DID that signed the revocation. */
116
+ signedBy: person({}),
117
+ createdAt: created(),
118
+ createdBy: createdBy()
119
+ },
120
+ document: void 0
121
+ });
122
+ function accountRecordId(accountId) {
123
+ return `account:${accountId}`;
124
+ }
125
+ function deviceRecordId(accountId, deviceDid) {
126
+ return `device:${accountId}:${deviceDid}`;
127
+ }
128
+ function recoveryRecordId(accountId, recoveryKey) {
129
+ return `recovery:${accountId}:${recoveryKey}`;
130
+ }
131
+ function revocationRecordId(accountId, subject) {
132
+ return `revocation:${accountId}:${subject}`;
133
+ }
134
+ function revokedSubjects(revocations) {
135
+ return new Set(revocations.map((r) => r.subject));
136
+ }
137
+ function resolveActiveDevices(devices, revocations) {
138
+ const revoked = revokedSubjects(revocations);
139
+ return devices.filter((d) => d.status !== "revoked" && !revoked.has(d.deviceDid));
140
+ }
141
+ function isDeviceAuthorized(accountId, deviceDid, devices, revocations) {
142
+ const revoked = revokedSubjects(revocations);
143
+ if (revoked.has(deviceDid)) return false;
144
+ return devices.some(
145
+ (d) => d.account === accountId && d.deviceDid === deviceDid && d.status !== "revoked"
146
+ );
147
+ }
148
+ function deviceRecipientExpander(devices, revocations) {
149
+ const active = resolveActiveDevices(devices, revocations);
150
+ const activeByAccount = /* @__PURE__ */ new Map();
151
+ for (const d of active) {
152
+ const list = activeByAccount.get(d.account);
153
+ if (list) list.push(d.deviceDid);
154
+ else activeByAccount.set(d.account, [d.deviceDid]);
155
+ }
156
+ const accountOf = /* @__PURE__ */ new Map();
157
+ for (const d of devices) accountOf.set(d.deviceDid, d.account);
158
+ return (did) => {
159
+ const account = accountOf.get(did);
160
+ if (!account) return [did];
161
+ const siblings = activeByAccount.get(account);
162
+ return siblings && siblings.length > 0 ? [.../* @__PURE__ */ new Set([did, ...siblings])] : [did];
163
+ };
164
+ }
165
+
166
+ export {
167
+ ACCOUNT_RECORD_SCHEMA_IRI,
168
+ DEVICE_RECORD_SCHEMA_IRI,
169
+ RECOVERY_RECORD_SCHEMA_IRI,
170
+ REVOCATION_RECORD_SCHEMA_IRI,
171
+ AccountRecordSchema,
172
+ DeviceRecordSchema,
173
+ RecoveryRecordSchema,
174
+ RevocationRecordSchema,
175
+ accountRecordId,
176
+ deviceRecordId,
177
+ recoveryRecordId,
178
+ revocationRecordId,
179
+ revokedSubjects,
180
+ resolveActiveDevices,
181
+ isDeviceAuthorized,
182
+ deviceRecipientExpander
183
+ };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  defineSchema,
6
6
  relation,
7
7
  select,
8
8
  text
9
- } from "./chunk-O64EK5FK.js";
9
+ } from "./chunk-EBNMV2VO.js";
10
10
 
11
11
  // src/schema/schemas/canvas.ts
12
12
  var CanvasSchema = defineSchema({
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  date,
6
6
  defineSchema,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-O64EK5FK.js";
10
+ } from "./chunk-EBNMV2VO.js";
11
11
 
12
12
  // src/schema/schemas/transaction.ts
13
13
  var TRANSACTION_SCHEMA_IRI = "xnet://xnet.fyi/Transaction@1.0.0";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  defineSchema,
6
6
  json,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-O64EK5FK.js";
10
+ } from "./chunk-EBNMV2VO.js";
11
11
 
12
12
  // src/schema/schemas/map.ts
13
13
  var MapSchema = defineSchema({
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  SPACE_MEMBERSHIP_SCHEMA_IRI
3
- } from "./chunk-ZICIXDEE.js";
3
+ } from "./chunk-T5AZAOG5.js";
4
4
  import {
5
5
  allow,
6
6
  role
7
- } from "./chunk-JESSJ5CZ.js";
7
+ } from "./chunk-RL64OJJ5.js";
8
8
 
9
9
  // src/schema/schemas/space-authorization.ts
10
10
  var ROLE_ORDER = ["viewer", "commenter", "member", "admin", "owner"];
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  date,
6
6
  defineSchema,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-O64EK5FK.js";
10
+ } from "./chunk-EBNMV2VO.js";
11
11
 
12
12
  // src/schema/schemas/milestone.ts
13
13
  var MILESTONE_SCHEMA_IRI = "xnet://xnet.fyi/Milestone@1.0.0";
@@ -4,10 +4,10 @@ import {
4
4
  folderAncestorIds,
5
5
  folderPathIds,
6
6
  wouldCreateFolderCycle
7
- } from "./chunk-DTPSTMUD.js";
7
+ } from "./chunk-YSUIXD2Y.js";
8
8
  import {
9
9
  spaceOwnAuthorization
10
- } from "./chunk-6OPZJ7MG.js";
10
+ } from "./chunk-OCMSAKWV.js";
11
11
  import {
12
12
  checkbox,
13
13
  created,
@@ -17,7 +17,7 @@ import {
17
17
  relation,
18
18
  select,
19
19
  text
20
- } from "./chunk-O64EK5FK.js";
20
+ } from "./chunk-EBNMV2VO.js";
21
21
 
22
22
  // src/schema/schemas/space.ts
23
23
  var SPACE_SCHEMA_IRI = "xnet://xnet.fyi/Space@1.0.0";
@@ -3,7 +3,7 @@ import {
3
3
  number,
4
4
  person,
5
5
  text
6
- } from "./chunk-O64EK5FK.js";
6
+ } from "./chunk-EBNMV2VO.js";
7
7
 
8
8
  // src/schema/schemas/grant.ts
9
9
  var GrantSchema = defineSchema({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -11,7 +11,7 @@ import {
11
11
  select,
12
12
  text,
13
13
  url
14
- } from "./chunk-O64EK5FK.js";
14
+ } from "./chunk-EBNMV2VO.js";
15
15
 
16
16
  // src/schema/schemas/external-item.ts
17
17
  var EXTERNAL_ITEM_SCHEMA_IRI = "xnet://xnet.fyi/ExternalItem@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  checkbox,
6
6
  created,
@@ -11,7 +11,7 @@ import {
11
11
  json,
12
12
  relation,
13
13
  text
14
- } from "./chunk-O64EK5FK.js";
14
+ } from "./chunk-EBNMV2VO.js";
15
15
 
16
16
  // src/schema/schemas/chat-message.ts
17
17
  var ChatMessageSchema = defineSchema({
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  defineSchema,
6
6
  json,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-O64EK5FK.js";
10
+ } from "./chunk-EBNMV2VO.js";
11
11
 
12
12
  // src/schema/schemas/dashboard.ts
13
13
  var DashboardSchema = defineSchema({
@@ -618,6 +618,16 @@ function hubActionsForSpaceRole(schema, spaceRole) {
618
618
  var PUBLIC_CONTENT_KEY = new Uint8Array(32);
619
619
  var PUBLIC_RECIPIENT = "PUBLIC";
620
620
  var MAX_CONTAINER_DEPTH = 32;
621
+ function finalizeRecipients(recipients, dependencies) {
622
+ const expand = dependencies.expandDeviceRecipients;
623
+ if (!expand) return [...recipients];
624
+ const out = new Set(recipients);
625
+ for (const recipient of recipients) {
626
+ if (recipient === PUBLIC_RECIPIENT) continue;
627
+ for (const did of expand(recipient)) out.add(did);
628
+ }
629
+ return [...out];
630
+ }
621
631
  async function computeRecipients(schema, node, dependencies) {
622
632
  const recipients = /* @__PURE__ */ new Set();
623
633
  recipients.add(node.createdBy);
@@ -635,13 +645,13 @@ async function computeRecipients(schema, node, dependencies) {
635
645
  };
636
646
  if (!schema.authorization) {
637
647
  addGrantRecipients();
638
- return [...recipients];
648
+ return finalizeRecipients(recipients, dependencies);
639
649
  }
640
650
  const auth = deserializeAuthorization(schema.authorization);
641
651
  const readExpr = auth.actions.read;
642
652
  if (!readExpr) {
643
653
  addGrantRecipients();
644
- return [...recipients];
654
+ return finalizeRecipients(recipients, dependencies);
645
655
  }
646
656
  if (hasPublicAccess(readExpr)) {
647
657
  return [PUBLIC_RECIPIENT];
@@ -656,7 +666,7 @@ async function computeRecipients(schema, node, dependencies) {
656
666
  }
657
667
  }
658
668
  addGrantRecipients();
659
- return [...recipients];
669
+ return finalizeRecipients(recipients, dependencies);
660
670
  }
661
671
  async function resolveRoleMembers(resolver, node, _schema, dependencies, depth) {
662
672
  if (depth > (dependencies.maxDepth ?? 3)) {
@@ -395,6 +395,7 @@ function withoutNodeQueryPagination(descriptor) {
395
395
  function withoutNodeQueryMaterializedView(descriptor) {
396
396
  const next = { ...descriptor };
397
397
  delete next.materializedView;
398
+ delete next.authFingerprint;
398
399
  return next;
399
400
  }
400
401
 
@@ -12,11 +12,11 @@ import {
12
12
  text,
13
13
  updated,
14
14
  url
15
- } from "./chunk-O64EK5FK.js";
15
+ } from "./chunk-EBNMV2VO.js";
16
16
  import {
17
17
  allow,
18
18
  role
19
- } from "./chunk-JESSJ5CZ.js";
19
+ } from "./chunk-RL64OJJ5.js";
20
20
 
21
21
  // src/schema/schemas/moderation.ts
22
22
  var withOperators = (roles = []) => [
@@ -3,10 +3,10 @@ import {
3
3
  select,
4
4
  text,
5
5
  url
6
- } from "./chunk-O64EK5FK.js";
6
+ } from "./chunk-EBNMV2VO.js";
7
7
  import {
8
8
  presets
9
- } from "./chunk-JESSJ5CZ.js";
9
+ } from "./chunk-RL64OJJ5.js";
10
10
 
11
11
  // src/schema/schemas/external-reference.ts
12
12
  var ExternalReferenceSchema = defineSchema({
@@ -6,7 +6,7 @@ import {
6
6
  person,
7
7
  relation,
8
8
  select
9
- } from "./chunk-O64EK5FK.js";
9
+ } from "./chunk-EBNMV2VO.js";
10
10
 
11
11
  // src/schema/schemas/space-membership.ts
12
12
  var SPACE_MEMBERSHIP_SCHEMA_IRI = "xnet://xnet.fyi/SpaceMembership@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -9,7 +9,7 @@ import {
9
9
  relation,
10
10
  text,
11
11
  url
12
- } from "./chunk-O64EK5FK.js";
12
+ } from "./chunk-EBNMV2VO.js";
13
13
 
14
14
  // src/schema/schemas/feed.ts
15
15
  var FEED_SCHEMA_IRI = "xnet://xnet.fyi/Feed@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-6OPZJ7MG.js";
3
+ } from "./chunk-OCMSAKWV.js";
4
4
  import {
5
5
  defineSchema,
6
6
  json,
@@ -8,7 +8,7 @@ import {
8
8
  relation,
9
9
  select,
10
10
  text
11
- } from "./chunk-O64EK5FK.js";
11
+ } from "./chunk-EBNMV2VO.js";
12
12
 
13
13
  // src/schema/schemas/metric.ts
14
14
  var MetricSchema = defineSchema({