mindoodb 0.0.94 → 0.0.96

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 (197) hide show
  1. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +17 -1
  2. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  3. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +63 -4
  4. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  5. package/dist/appendonlystores/network/HttpTransport.d.ts +10 -1
  6. package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -1
  7. package/dist/appendonlystores/network/HttpTransport.js +45 -3
  8. package/dist/appendonlystores/network/HttpTransport.js.map +1 -1
  9. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +22 -0
  10. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  11. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +33 -0
  12. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
  13. package/dist/browser/index.mjs +42 -0
  14. package/dist/core/BaseMindooDB.d.ts +9 -0
  15. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  16. package/dist/core/BaseMindooDB.js +75 -16
  17. package/dist/core/BaseMindooDB.js.map +1 -1
  18. package/dist/core/BaseMindooTenant.d.ts +82 -1
  19. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  20. package/dist/core/BaseMindooTenant.js +263 -7
  21. package/dist/core/BaseMindooTenant.js.map +1 -1
  22. package/dist/core/BaseMindooTenantDirectory.d.ts +182 -2
  23. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  24. package/dist/core/BaseMindooTenantDirectory.js +683 -113
  25. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  26. package/dist/core/BaseMindooTenantFactory.d.ts +30 -0
  27. package/dist/core/BaseMindooTenantFactory.d.ts.map +1 -1
  28. package/dist/core/BaseMindooTenantFactory.js +95 -0
  29. package/dist/core/BaseMindooTenantFactory.js.map +1 -1
  30. package/dist/core/accesscontrol/DirectoryStateNode.d.ts +45 -0
  31. package/dist/core/accesscontrol/DirectoryStateNode.d.ts.map +1 -1
  32. package/dist/core/accesscontrol/DirectoryStateNode.js +58 -0
  33. package/dist/core/accesscontrol/DirectoryStateNode.js.map +1 -1
  34. package/dist/core/accesscontrol/adminKeys.d.ts +130 -0
  35. package/dist/core/accesscontrol/adminKeys.d.ts.map +1 -0
  36. package/dist/core/accesscontrol/adminKeys.js +164 -0
  37. package/dist/core/accesscontrol/adminKeys.js.map +1 -0
  38. package/dist/core/accesscontrol/directoryAdminResolver.d.ts +54 -0
  39. package/dist/core/accesscontrol/directoryAdminResolver.d.ts.map +1 -0
  40. package/dist/core/accesscontrol/directoryAdminResolver.js +217 -0
  41. package/dist/core/accesscontrol/directoryAdminResolver.js.map +1 -0
  42. package/dist/core/accesscontrol/directoryProjection.d.ts.map +1 -1
  43. package/dist/core/accesscontrol/directoryProjection.js +25 -0
  44. package/dist/core/accesscontrol/directoryProjection.js.map +1 -1
  45. package/dist/core/accesscontrol/grantKeys.d.ts +16 -0
  46. package/dist/core/accesscontrol/grantKeys.d.ts.map +1 -1
  47. package/dist/core/accesscontrol/grantKeys.js +37 -0
  48. package/dist/core/accesscontrol/grantKeys.js.map +1 -1
  49. package/dist/core/accesscontrol/types.d.ts +11 -2
  50. package/dist/core/accesscontrol/types.d.ts.map +1 -1
  51. package/dist/core/accesscontrol/types.js +7 -0
  52. package/dist/core/accesscontrol/types.js.map +1 -1
  53. package/dist/core/appendonlystores/network/AuthenticationService.d.ts +7 -0
  54. package/dist/core/appendonlystores/network/AuthenticationService.d.ts.map +1 -1
  55. package/dist/core/appendonlystores/network/AuthenticationService.js +33 -0
  56. package/dist/core/appendonlystores/network/AuthenticationService.js.map +1 -1
  57. package/dist/core/appendonlystores/network/NetworkTransport.d.ts +16 -1
  58. package/dist/core/appendonlystores/network/NetworkTransport.d.ts.map +1 -1
  59. package/dist/core/appendonlystores/network/types.d.ts +13 -0
  60. package/dist/core/appendonlystores/network/types.d.ts.map +1 -1
  61. package/dist/core/appendonlystores/network/types.js.map +1 -1
  62. package/dist/core/builtinDbInvariants.d.ts +18 -2
  63. package/dist/core/builtinDbInvariants.d.ts.map +1 -1
  64. package/dist/core/builtinDbInvariants.js +41 -5
  65. package/dist/core/builtinDbInvariants.js.map +1 -1
  66. package/dist/core/errors.d.ts +23 -0
  67. package/dist/core/errors.d.ts.map +1 -1
  68. package/dist/core/errors.js +34 -1
  69. package/dist/core/errors.js.map +1 -1
  70. package/dist/core/index.d.ts +7 -4
  71. package/dist/core/index.d.ts.map +1 -1
  72. package/dist/core/index.js +31 -5
  73. package/dist/core/index.js.map +1 -1
  74. package/dist/core/indexing/createViewDataProvider.d.ts +10 -1
  75. package/dist/core/indexing/createViewDataProvider.d.ts.map +1 -1
  76. package/dist/core/indexing/createViewDataProvider.js +11 -0
  77. package/dist/core/indexing/createViewDataProvider.js.map +1 -1
  78. package/dist/core/indexing/summary/DocumentSummaryStore.d.ts +13 -0
  79. package/dist/core/indexing/summary/DocumentSummaryStore.d.ts.map +1 -1
  80. package/dist/core/indexing/summary/DocumentSummaryStore.js +46 -5
  81. package/dist/core/indexing/summary/DocumentSummaryStore.js.map +1 -1
  82. package/dist/core/indexing/summary/SummaryVirtualViewDataProvider.d.ts +13 -0
  83. package/dist/core/indexing/summary/SummaryVirtualViewDataProvider.d.ts.map +1 -1
  84. package/dist/core/indexing/summary/SummaryVirtualViewDataProvider.js +21 -0
  85. package/dist/core/indexing/summary/SummaryVirtualViewDataProvider.js.map +1 -1
  86. package/dist/core/indexing/summary/index.d.ts +1 -1
  87. package/dist/core/indexing/summary/index.d.ts.map +1 -1
  88. package/dist/core/indexing/summary/index.js +2 -1
  89. package/dist/core/indexing/summary/index.js.map +1 -1
  90. package/dist/core/indexing/summary/types.d.ts +28 -0
  91. package/dist/core/indexing/summary/types.d.ts.map +1 -1
  92. package/dist/core/indexing/summary/types.js +22 -0
  93. package/dist/core/indexing/summary/types.js.map +1 -1
  94. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts +19 -0
  95. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts.map +1 -1
  96. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js +34 -3
  97. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js.map +1 -1
  98. package/dist/core/indexing/virtualviews/VirtualViewFactory.d.ts +7 -0
  99. package/dist/core/indexing/virtualviews/VirtualViewFactory.d.ts.map +1 -1
  100. package/dist/core/indexing/virtualviews/VirtualViewFactory.js +1 -0
  101. package/dist/core/indexing/virtualviews/VirtualViewFactory.js.map +1 -1
  102. package/dist/core/live/LiveChannel.d.ts +41 -0
  103. package/dist/core/live/LiveChannel.d.ts.map +1 -0
  104. package/dist/core/live/LiveChannel.js +151 -0
  105. package/dist/core/live/LiveChannel.js.map +1 -0
  106. package/dist/core/query/executeQuery.d.ts.map +1 -1
  107. package/dist/core/query/executeQuery.js +30 -17
  108. package/dist/core/query/executeQuery.js.map +1 -1
  109. package/dist/core/query/queryView.d.ts +14 -0
  110. package/dist/core/query/queryView.d.ts.map +1 -1
  111. package/dist/core/query/queryView.js +22 -12
  112. package/dist/core/query/queryView.js.map +1 -1
  113. package/dist/core/query/types.d.ts +9 -0
  114. package/dist/core/query/types.d.ts.map +1 -1
  115. package/dist/core/query/types.js.map +1 -1
  116. package/dist/core/types.d.ts +193 -6
  117. package/dist/core/types.d.ts.map +1 -1
  118. package/dist/core/types.js.map +1 -1
  119. package/dist/core/uri/MindooURI.d.ts +1 -1
  120. package/dist/core/uri/MindooURI.d.ts.map +1 -1
  121. package/dist/core/uri/MindooURI.js +2 -0
  122. package/dist/core/uri/MindooURI.js.map +1 -1
  123. package/dist/core/uri/adminUri.d.ts +52 -0
  124. package/dist/core/uri/adminUri.d.ts.map +1 -0
  125. package/dist/core/uri/adminUri.js +100 -0
  126. package/dist/core/uri/adminUri.js.map +1 -0
  127. package/dist/core/uri/joinRequestUri.d.ts.map +1 -1
  128. package/dist/core/uri/joinRequestUri.js +14 -1
  129. package/dist/core/uri/joinRequestUri.js.map +1 -1
  130. package/dist/core/userid/index.d.ts +9 -0
  131. package/dist/core/userid/index.d.ts.map +1 -1
  132. package/dist/core/userkeys/UserKeyDocument.d.ts +7 -1
  133. package/dist/core/userkeys/UserKeyDocument.d.ts.map +1 -1
  134. package/dist/core/userkeys/UserKeyDocument.js +14 -3
  135. package/dist/core/userkeys/UserKeyDocument.js.map +1 -1
  136. package/dist/core/userkeys/UserKeyManager.d.ts +95 -4
  137. package/dist/core/userkeys/UserKeyManager.d.ts.map +1 -1
  138. package/dist/core/userkeys/UserKeyManager.js +606 -59
  139. package/dist/core/userkeys/UserKeyManager.js.map +1 -1
  140. package/dist/core/userkeys/deviceCertificate.d.ts +46 -0
  141. package/dist/core/userkeys/deviceCertificate.d.ts.map +1 -0
  142. package/dist/core/userkeys/deviceCertificate.js +86 -0
  143. package/dist/core/userkeys/deviceCertificate.js.map +1 -0
  144. package/dist/core/userkeys/generationSignature.d.ts +32 -0
  145. package/dist/core/userkeys/generationSignature.d.ts.map +1 -0
  146. package/dist/core/userkeys/generationSignature.js +136 -0
  147. package/dist/core/userkeys/generationSignature.js.map +1 -0
  148. package/dist/core/userkeys/generationValidity.d.ts +75 -0
  149. package/dist/core/userkeys/generationValidity.d.ts.map +1 -0
  150. package/dist/core/userkeys/generationValidity.js +175 -0
  151. package/dist/core/userkeys/generationValidity.js.map +1 -0
  152. package/dist/core/userkeys/index.d.ts +5 -2
  153. package/dist/core/userkeys/index.d.ts.map +1 -1
  154. package/dist/core/userkeys/index.js +21 -1
  155. package/dist/core/userkeys/index.js.map +1 -1
  156. package/dist/core/userkeys/resolveUserKeyDocument.d.ts +16 -0
  157. package/dist/core/userkeys/resolveUserKeyDocument.d.ts.map +1 -1
  158. package/dist/core/userkeys/resolveUserKeyDocument.js +42 -1
  159. package/dist/core/userkeys/resolveUserKeyDocument.js.map +1 -1
  160. package/dist/core/userkeys/types.d.ts +26 -0
  161. package/dist/core/userkeys/types.d.ts.map +1 -1
  162. package/dist/core/userkeys/types.js +3 -1
  163. package/dist/core/userkeys/types.js.map +1 -1
  164. package/dist/core/userkeys/validateUserKeyDocument.d.ts.map +1 -1
  165. package/dist/core/userkeys/validateUserKeyDocument.js +7 -0
  166. package/dist/core/userkeys/validateUserKeyDocument.js.map +1 -1
  167. package/dist/core/utils/idGeneration.d.ts +15 -0
  168. package/dist/core/utils/idGeneration.d.ts.map +1 -1
  169. package/dist/core/utils/idGeneration.js +45 -0
  170. package/dist/core/utils/idGeneration.js.map +1 -1
  171. package/dist/core/utils/index.d.ts +1 -1
  172. package/dist/core/utils/index.d.ts.map +1 -1
  173. package/dist/core/utils/index.js +3 -1
  174. package/dist/core/utils/index.js.map +1 -1
  175. package/dist/node/server/MindooDBServer.d.ts.map +1 -1
  176. package/dist/node/server/MindooDBServer.js +11 -0
  177. package/dist/node/server/MindooDBServer.js.map +1 -1
  178. package/dist/server/SyncEventBus.d.ts +22 -0
  179. package/dist/server/SyncEventBus.d.ts.map +1 -1
  180. package/dist/server/SyncEventBus.js +21 -0
  181. package/dist/server/SyncEventBus.js.map +1 -1
  182. package/dist/server/TenantManager.d.ts +9 -0
  183. package/dist/server/TenantManager.d.ts.map +1 -1
  184. package/dist/server/TenantManager.js +101 -1
  185. package/dist/server/TenantManager.js.map +1 -1
  186. package/dist/server/http/MindooDBServerCore.d.ts +39 -1
  187. package/dist/server/http/MindooDBServerCore.d.ts.map +1 -1
  188. package/dist/server/http/MindooDBServerCore.js +121 -2
  189. package/dist/server/http/MindooDBServerCore.js.map +1 -1
  190. package/dist/server/http/types.d.ts +10 -1
  191. package/dist/server/http/types.d.ts.map +1 -1
  192. package/dist/server/http/types.js.map +1 -1
  193. package/dist/server/index.d.ts +2 -2
  194. package/dist/server/index.d.ts.map +1 -1
  195. package/dist/server/index.js +2 -1
  196. package/dist/server/index.js.map +1 -1
  197. package/package.json +1 -1
@@ -32,6 +32,14 @@ export interface MindooQueryViewDefinition {
32
32
  * `_textScoreRaw` (engine-specific raw score).
33
33
  */
34
34
  text?: MindooQueryTextClause;
35
+ /**
36
+ * Restrict the view to documents whose id matches this prefix or one of
37
+ * these prefixes (boundary-aware: `"m_r3"` matches `m_r3` and `m_r3_…`).
38
+ * Applies to every source unless a source provides its own `idPrefix`.
39
+ * When a source's summary is scoped (`SummaryConfig.idPrefixes`), the
40
+ * prefixes must lie inside that scope.
41
+ */
42
+ idPrefix?: string | string[];
35
43
  /** View columns (categories/sorting/totals work as in persistent views). */
36
44
  columns: Array<VirtualViewColumn | VirtualViewColumnOptions>;
37
45
  categorizationStyle?: CategorizationStyle;
@@ -55,6 +63,11 @@ export interface EphemeralViewSource {
55
63
  * definition-level `text` clause for this source.
56
64
  */
57
65
  text?: MindooQueryTextClause;
66
+ /**
67
+ * Per-source id-prefix filter. When set it replaces the definition-level
68
+ * `idPrefix` for this source.
69
+ */
70
+ idPrefix?: string | string[];
58
71
  /**
59
72
  * Origin identifier for entries of this source. Must be unique within
60
73
  * the view. Defaults to `<tenantId>/<storeId>#ephemeral`, which is
@@ -69,6 +82,7 @@ interface ResolvedViewSource {
69
82
  origin: string;
70
83
  filter?: MindooDBAppBooleanExpression;
71
84
  text?: MindooQueryTextClause;
85
+ idPrefix?: string | string[];
72
86
  }
73
87
  /**
74
88
  * An ephemeral VirtualView over one or more document summary buffers,
@@ -1 +1 @@
1
- {"version":3,"file":"queryView.d.ts","sourceRoot":"","sources":["../../../src/core/query/queryView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,4BAA4B,EAAyB,MAAM,sBAAsB,CAAC;AAOhG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OA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AAE,yBAAyB,EACrC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,oBAAoB,CAAC,CAM/B"}
@@ -3,27 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EphemeralSummaryView = void 0;
4
4
  exports.createEphemeralSummaryView = createEphemeralSummaryView;
5
5
  exports.queryViewAcross = queryViewAcross;
6
+ const idGeneration_1 = require("../utils/idGeneration");
7
+ const types_1 = require("../indexing/summary/types");
6
8
  const expressions_1 = require("../expressions");
7
9
  const SummaryVirtualViewDataProvider_1 = require("../indexing/summary/SummaryVirtualViewDataProvider");
8
10
  const VirtualView_1 = require("../indexing/virtualviews/VirtualView");
9
11
  const VirtualViewColumn_1 = require("../indexing/virtualviews/VirtualViewColumn");
10
- const types_1 = require("./types");
12
+ const types_2 = require("./types");
11
13
  function defaultEphemeralOrigin(db) {
12
14
  return `${db.getTenant().getId()}/${db.getStore().getId()}#ephemeral`;
13
15
  }
14
16
  function resolveSources(sources) {
15
17
  if (sources.length === 0) {
16
- throw new types_1.MindooQueryError("An ephemeral view needs at least one source database.");
18
+ throw new types_2.MindooQueryError("An ephemeral view needs at least one source database.");
17
19
  }
18
20
  const resolved = [];
19
21
  const seenOrigins = new Set();
20
22
  for (const source of sources) {
21
23
  if (!source.db.getSummaryStore) {
22
- throw new types_1.MindooQueryError("A source database does not support summary stores.");
24
+ throw new types_2.MindooQueryError("A source database does not support summary stores.");
23
25
  }
24
26
  const origin = source.origin ?? defaultEphemeralOrigin(source.db);
25
27
  if (seenOrigins.has(origin)) {
26
- throw new types_1.MindooQueryError(`Duplicate view source origin "${origin}" — pass distinct 'origin' values when combining the same database twice.`);
28
+ throw new types_2.MindooQueryError(`Duplicate view source origin "${origin}" — pass distinct 'origin' values when combining the same database twice.`);
27
29
  }
28
30
  seenOrigins.add(origin);
29
31
  resolved.push({
@@ -32,6 +34,7 @@ function resolveSources(sources) {
32
34
  origin,
33
35
  filter: source.filter,
34
36
  text: source.text,
37
+ idPrefix: source.idPrefix,
35
38
  });
36
39
  }
37
40
  return resolved;
@@ -69,15 +72,22 @@ class EphemeralSummaryView {
69
72
  let text;
70
73
  if (textClause) {
71
74
  if (!source.db.getFullTextIndex) {
72
- throw new types_1.MindooQueryError(`View source "${source.origin}" does not support full-text search.`, "fulltext-not-enabled");
75
+ throw new types_2.MindooQueryError(`View source "${source.origin}" does not support full-text search.`, "fulltext-not-enabled");
73
76
  }
74
77
  text = { index: source.db.getFullTextIndex(), clause: textClause };
75
78
  }
79
+ const idPrefix = source.idPrefix ?? definition.idPrefix;
80
+ const scope = source.summary.getIdPrefixScope?.() ?? null;
81
+ if (!(0, types_1.isIdPrefixFilterCoveredByScope)((0, idGeneration_1.normalizeDocIdPrefixes)(idPrefix), scope)) {
82
+ throw new types_2.MindooQueryError(`View source "${source.origin}": its summary only covers documents with id prefix ` +
83
+ `${scope.map((p) => `"${p}"`).join(", ")}; pass an idPrefix inside that scope.`);
84
+ }
76
85
  const provider = new SummaryVirtualViewDataProvider_1.SummaryVirtualViewDataProvider({
77
86
  origin: source.origin,
78
87
  summary: source.summary,
79
88
  filter: source.filter ?? definition.filter,
80
89
  text,
90
+ idPrefix,
81
91
  });
82
92
  provider.init(view);
83
93
  view.addDataProvider(provider);
@@ -183,12 +193,12 @@ const TEXT_SCORE_FIELDS = new Set(["_textScore", "_textScoreRaw"]);
183
193
  function assertKnownExpression(expression, role) {
184
194
  const unknown = (0, expressions_1.findUnknownExpressionNode)(expression);
185
195
  if (unknown !== null) {
186
- throw new types_1.MindooQueryError(`View ${role} contains ${unknown}, which the expression language does not define ` +
196
+ throw new types_2.MindooQueryError(`View ${role} contains ${unknown}, which the expression language does not define ` +
187
197
  `(build it with createViewLanguage(), or parse formula text with ` +
188
198
  `parseMindooDBFormulaBooleanExpression()).`);
189
199
  }
190
200
  if ((0, expressions_1.analyzeExpressionRequirements)(expression).filingStores.length > 0) {
191
- throw new types_1.MindooQueryError(`View ${role} cannot use folders() / inFolder(); they need a view that joins the filing store (VirtualViewBuilder.withFilingStore); ` +
201
+ throw new types_2.MindooQueryError(`View ${role} cannot use folders() / inFolder(); they need a view that joins the filing store (VirtualViewBuilder.withFilingStore); ` +
192
202
  `ad-hoc queries and ephemeral query views cannot evaluate them.`);
193
203
  }
194
204
  }
@@ -209,7 +219,7 @@ function validateViewDefinition(sources, definition) {
209
219
  assertKnownExpression(expression, "column");
210
220
  const requirements = (0, expressions_1.analyzeExpressionRequirements)(expression);
211
221
  if (requirements.needsDecryption) {
212
- throw new types_1.MindooQueryError("View columns cannot use decrypt expressions: encrypted fields are not stored in the summary buffer.");
222
+ throw new types_2.MindooQueryError("View columns cannot use decrypt expressions: encrypted fields are not stored in the summary buffer.");
213
223
  }
214
224
  for (const path of (0, expressions_1.getReferencedFields)(expression)) {
215
225
  columnPaths.add(path);
@@ -222,10 +232,10 @@ function validateViewDefinition(sources, definition) {
222
232
  assertKnownExpression(filter, "filter");
223
233
  const requirements = (0, expressions_1.analyzeExpressionRequirements)(filter);
224
234
  if (requirements.needsViewContext) {
225
- throw new types_1.MindooQueryError(`View filters cannot use view-tree operations (${requirements.viewContextOperations.join(", ")}).`);
235
+ throw new types_2.MindooQueryError(`View filters cannot use view-tree operations (${requirements.viewContextOperations.join(", ")}).`);
226
236
  }
227
237
  if (requirements.needsDecryption) {
228
- throw new types_1.MindooQueryError("View filters cannot use decrypt expressions: encrypted fields are not stored in the summary buffer.");
238
+ throw new types_2.MindooQueryError("View filters cannot use decrypt expressions: encrypted fields are not stored in the summary buffer.");
229
239
  }
230
240
  for (const path of (0, expressions_1.getReferencedFields)(filter)) {
231
241
  referencedPaths.add(path);
@@ -235,13 +245,13 @@ function validateViewDefinition(sources, definition) {
235
245
  for (const path of referencedPaths) {
236
246
  if (TEXT_SCORE_FIELDS.has(path)) {
237
247
  if (!hasTextClause) {
238
- throw new types_1.MindooQueryError(`Expression references "${path}", but source "${source.origin}" has no 'text' clause — ` +
248
+ throw new types_2.MindooQueryError(`Expression references "${path}", but source "${source.origin}" has no 'text' clause — ` +
239
249
  `text scores only exist for full-text pre-filtered views.`);
240
250
  }
241
251
  continue;
242
252
  }
243
253
  if (!source.summary.isFieldCovered(path)) {
244
- throw new types_1.MindooQueryError(`Field "${path}" is not covered by the summary configuration of source "${source.origin}" ` +
254
+ throw new types_2.MindooQueryError(`Field "${path}" is not covered by the summary configuration of source "${source.origin}" ` +
245
255
  `(check include/exclude in SummaryConfig).`);
246
256
  }
247
257
  }
@@ -1 +1 @@
1
- {"version":3,"file":"queryView.js","sourceRoot":"","sources":["../../../src/core/query/queryView.ts"],"names":[],"mappings":";;;AAuXA,gEAcC;AA2BD,0CAUC;AAvaD,gDAIwB;AAExB,uGAAoG;AACpG,sEAAmE;AACnE,kFAA8G;AAG9G,mCAAuE;AAwEvE,SAAS,sBAAsB,CAAC,EAAY;IAC1C,OAAO,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC;AACxE,CAAC;AAED,SAAS,cAAc,CAAC,OAA8B;IACpD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,wBAAgB,CAAC,uDAAuD,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IACtC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC;YAC/B,MAAM,IAAI,wBAAgB,CAAC,oDAAoD,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClE,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI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CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,eAAe,CACnC,OAA8B,EAC9B,UAAqC,EACrC,OAAkC;IAElC,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC;IACnF,MAAM,IAAI,GAAG,IAAI,oBAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC5D,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -128,6 +128,15 @@ export interface MindooQuery {
128
128
  * explicit `sortBy`, results are ordered best score first.
129
129
  */
130
130
  text?: MindooQueryTextClause;
131
+ /**
132
+ * Restrict the query to documents whose id matches this prefix or one of
133
+ * these prefixes (boundary-aware: `"m_r3"` matches `m_r3` and `m_r3_…`;
134
+ * list several for e.g. a range of months). With `allowFullScan`
135
+ * non-matching documents are skipped before they are loaded or
136
+ * decrypted. When the summary is scoped (`SummaryConfig.idPrefixes`),
137
+ * summary-backed queries must pass prefixes inside that scope.
138
+ */
139
+ idPrefix?: string | string[];
131
140
  sortBy?: MindooQuerySortKey[];
132
141
  limit?: number;
133
142
  offset?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/query/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mDAA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C;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,WAAW,CAAC;AAEhE,MAAM,WAAW,iBAAiB,CAAC,SAAS,SAAS,uBAAuB,GAAG,uBAAuB;IACpG,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;IAClC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;gBAEzB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB;CAKzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/query/types.ts"],"names":[],"mappings":";;;AAyDA;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,GAAG,CAAC;AAEzC;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,CAAC,CAAC;AA2KnC;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IAIzC,YAAY,OAAe,EAAE,IAA2B;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AATD,4CASC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/query/types.ts"],"names":[],"mappings":";;;AAyDA;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,GAAG,CAAC;AAEzC;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAoLnC;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IAIzC,YAAY,OAAe,EAAE,IAA2B;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AATD,4CASC"}
@@ -1,3 +1,4 @@
1
+ import type { AdminKeyInfo } from "./accesscontrol/adminKeys";
1
2
  import type { KeyBag } from "./keys/KeyBag";
2
3
  import type { KeyType } from "./keys/KeyContext";
3
4
  import type { PublicUserId, PrivateUserId } from "./userid";
@@ -229,6 +230,12 @@ interface CreateTenantPasswords {
229
230
  * (legacy behavior: v1 entries remain acceptable).
230
231
  */
231
232
  requireV2Entries?: boolean;
233
+ /**
234
+ * Name the founding app user's device self-grant key in their grant, so
235
+ * they may add their own devices (docs/userkeys.md §9.4). Defaults to
236
+ * `true`; ignored when the identity has no self-grant key.
237
+ */
238
+ allowDeviceSelfGrantForAppUser?: boolean;
232
239
  /**
233
240
  * Optional human-readable tenant label stored in the directory document
234
241
  * `tenantsetup` (doc under `$publicinfos`; label field-encrypted under
@@ -324,6 +331,12 @@ export interface JoinRequest {
324
331
  * first device.
325
332
  */
326
333
  userPublicKey?: string;
334
+ /**
335
+ * Public half of the person's device self-grant key (Ed25519 PEM,
336
+ * docs/userkeys.md §9). The admin may name it in the grant with
337
+ * {@link ApproveJoinRequestOptions.allowDeviceSelfGrant}.
338
+ */
339
+ deviceSelfGrantPublicKey?: string;
327
340
  /**
328
341
  * Hint for the approving admin: which document keys this device is asking
329
342
  * for. Not a grant — the admin remains the authority. `$publicinfos` is
@@ -333,6 +346,18 @@ export interface JoinRequest {
333
346
  */
334
347
  requestedDocKeyIds?: string[];
335
348
  }
349
+ /**
350
+ * Admin-signed delegation on a person's grant (`grantaccess.deviceSelfGrant`,
351
+ * docs/userkeys.md §9): the person may certify their own devices with the
352
+ * named Ed25519 key. Revoking keeps the key and sets `revokedAt`; certificates
353
+ * and generations signed before that trusted time stay valid.
354
+ */
355
+ export interface DeviceSelfGrant {
356
+ /** Ed25519 public key (PEM) of the person's device self-grant key. */
357
+ signingPublicKey: string;
358
+ grantedAt: number;
359
+ revokedAt?: number;
360
+ }
336
361
  /**
337
362
  * Options for {@link MindooTenantFactory.createJoinRequest}.
338
363
  */
@@ -384,6 +409,13 @@ export interface ApproveJoinRequestOptions {
384
409
  * its grant (`accessPrefixes`), admin-signed. Omit for ordinary members.
385
410
  */
386
411
  accessPrefixes?: string[];
412
+ /**
413
+ * Name the person's device self-grant key from the request
414
+ * ({@link JoinRequest.deviceSelfGrantPublicKey}) in their grant, so they may
415
+ * certify further devices themselves (docs/userkeys.md §9). Ignored when the
416
+ * request carries no such key.
417
+ */
418
+ allowDeviceSelfGrant?: boolean;
387
419
  /**
388
420
  * Human-readable label for the joining device's key pair. When set,
389
421
  * it overrides any label the joining user suggested in the join request and
@@ -425,6 +457,23 @@ export interface JoinResponseEncryptedDocKeyVersion {
425
457
  */
426
458
  wrappedKey?: string;
427
459
  }
460
+ /** Options of {@link MindooTenant.approveAdminRequest} (docs/accesscontrol.md §6.13). */
461
+ export interface ApproveAdminRequestOptions {
462
+ /** The ROOT administration private key. */
463
+ adminSigningKey: EncryptedPrivateKey;
464
+ /** Password of {@link adminSigningKey}. */
465
+ adminPassword: string;
466
+ /** The admin's name; defaults to the name suggested in the request. */
467
+ name?: string;
468
+ /** Device label; defaults to the label suggested in the request. */
469
+ label?: string;
470
+ /** Witness time (ms) the admin key becomes effective, if later than the approval. */
471
+ validFrom?: number;
472
+ serverUrl?: string;
473
+ tenantLabel?: string;
474
+ /** "uri" returns a mdb://admin-response/... string. */
475
+ format?: "object" | "uri";
476
+ }
428
477
  export interface JoinResponseEncryptedDocKey {
429
478
  /** Logical document key id within the tenant, e.g. "$publicinfos", "default", or a named key. */
430
479
  keyId: string;
@@ -740,6 +789,11 @@ export interface MindooTenantFactory {
740
789
  * the identity so paper backup includes it.
741
790
  */
742
791
  ensureUserKeyPair?(user: PrivateUserId, password: string): Promise<EncryptionKeyPair>;
792
+ /**
793
+ * Generate the person's device self-grant key (Ed25519) on `user` if absent
794
+ * (docs/userkeys.md §9). Password-encrypted with salt `"deviceselfgrant"`.
795
+ */
796
+ ensureDeviceSelfGrantKeyPair?(user: PrivateUserId, password: string): Promise<SigningKeyPair>;
743
797
  /**
744
798
  * Join a tenant using a join response from an admin.
745
799
  * This orchestrates:
@@ -1082,6 +1136,17 @@ export interface MindooTenant {
1082
1136
  format: "uri";
1083
1137
  }): Promise<string>;
1084
1138
  approveJoinRequest(joinRequest: JoinRequest | string, options: ApproveJoinRequestOptions): Promise<JoinResponse>;
1139
+ /**
1140
+ * Approve a delegated-admin request (docs/accesscontrol.md §6.13). Root admin
1141
+ * key only. Writes the `acl_adminkey_<fingerprint>` document and the
1142
+ * `tenantsetup` entry, and returns an admin response that wraps the tenant
1143
+ * `default` and `$publicinfos` keys to the new admin key.
1144
+ *
1145
+ * @param request An AdminRequest object or a mdb://admin-request/... URI string.
1146
+ * @param options The ROOT admin key and password, the admin's name (overrides the suggested one) and optional label, server URL and tenant label.
1147
+ * @returns The AdminResponse, or a mdb://admin-response/... URI string when `format` is "uri".
1148
+ */
1149
+ approveAdminRequest?(request: import("./uri/adminUri").AdminRequest | string, options: ApproveAdminRequestOptions): Promise<import("./uri/adminUri").AdminResponse | string>;
1085
1150
  /** Devices on this person's grant that still need a User-Key wrap. */
1086
1151
  listPendingUserKeyDevices?(): Promise<import("./userkeys/types").PendingUserKeyDevice[]>;
1087
1152
  listUserKeyDevices?(): Promise<import("./userkeys/types").UserKeyDeviceRow[]>;
@@ -1089,6 +1154,31 @@ export interface MindooTenant {
1089
1154
  declineUserKeyDevice?(fingerprint: string): Promise<void>;
1090
1155
  undoDeclineUserKeyDevice?(fingerprint: string): Promise<void>;
1091
1156
  rotateUserKey?(): Promise<void>;
1157
+ /**
1158
+ * Public half of this person's device self-grant key as held by this device
1159
+ * (docs/userkeys.md §9), for the admin to name in the grant. `null` while
1160
+ * this device holds none.
1161
+ */
1162
+ getDeviceSelfGrantPublicKey?(): Promise<string | null>;
1163
+ /**
1164
+ * Certify another device of this person with their device self-grant key
1165
+ * (docs/userkeys.md §9.6) and wrap the User-Key to it. Requires
1166
+ * `deviceSelfGrant` on the person's grant.
1167
+ */
1168
+ issueDeviceCertificate?(device: {
1169
+ signingPublicKey: string;
1170
+ encryptionPublicKey: string;
1171
+ }, label?: string): Promise<{
1172
+ docId: string;
1173
+ certificate: import("./userkeys/deviceCertificate").DeviceCertificatePayload;
1174
+ }>;
1175
+ /** Withdraw an own device certificate by device fingerprint or document id. */
1176
+ revokeOwnDeviceCertificate?(fingerprint: string): Promise<number>;
1177
+ listOwnDeviceCertificates?(): Promise<Array<{
1178
+ docId: string;
1179
+ fingerprint: string;
1180
+ certificate: import("./userkeys/deviceCertificate").DeviceCertificatePayload;
1181
+ }>>;
1092
1182
  reconcileUserKeys?(options?: {
1093
1183
  allowSelfCreate?: boolean;
1094
1184
  }): Promise<import("./userkeys/types").UserKeyEnrollmentStatus>;
@@ -1923,9 +2013,11 @@ export interface ListDocumentIdsOptions {
1923
2013
  * boundary-aware: an id matches when it equals `idPrefix` exactly or begins
1924
2014
  * with `<idPrefix>_`, mirroring the `<prefix>_<objectId>` id scheme produced by
1925
2015
  * `createDocument({ idPrefix })`. So `"cls"` matches `cls_…` documents but not
1926
- * an unrelated `classroom_…` id. Omit (or pass an empty string) for no filter.
2016
+ * an unrelated `classroom_…` id. Pass a list to match any of several
2017
+ * prefixes (e.g. `["m_r3_202610", "m_r3_202611"]`). Omit (or pass an empty
2018
+ * string / empty list) for no filter.
1927
2019
  */
1928
- idPrefix?: string;
2020
+ idPrefix?: string | readonly string[];
1929
2021
  }
1930
2022
  /**
1931
2023
  * Which lifecycle states a listing returns, mirroring the split between
@@ -1975,10 +2067,10 @@ export interface IterateChangesOptions {
1975
2067
  * For {@link MindooDB.iterateChangesSince} this skips non-matching documents
1976
2068
  * *before* their body is loaded or decrypted, so filtering by content-type
1977
2069
  * prefix avoids materializing unrelated documents — and, across the app-SDK
1978
- * bridge, avoids shipping them to the client. Omit (or pass an empty string)
1979
- * for no filter.
2070
+ * bridge, avoids shipping them to the client. A list matches any of its
2071
+ * prefixes. Omit (or pass an empty string / empty list) for no filter.
1980
2072
  */
1981
- idPrefix?: string;
2073
+ idPrefix?: string | readonly string[];
1982
2074
  /**
1983
2075
  * Whether documents this iteration has to materialize are kept in the
1984
2076
  * persistent document cache (L2) like regular reads (default `true`).
@@ -3170,6 +3262,29 @@ export interface MindooTenantDirectory {
3170
3262
  * time `T`, or `null` when the key was not an active grant member then.
3171
3263
  */
3172
3264
  resolveUsernameHashForSigningKey?(signingKey: string, trustedTime: number): Promise<string | null>;
3265
+ /**
3266
+ * The person's admin-granted device self-grant delegation
3267
+ * (docs/userkeys.md §9), read from the grant(s) with `usernameHash`, or
3268
+ * `null` when the admin never granted it.
3269
+ */
3270
+ getDeviceSelfGrantForUsernameHash?(usernameHash: string): Promise<DeviceSelfGrant | null>;
3271
+ /**
3272
+ * The person a signing key acts for at trusted time `T`: a device on their
3273
+ * grant, or a device with a valid certificate (docs/userkeys.md §9.6).
3274
+ * `null` when neither.
3275
+ */
3276
+ resolveSignerToGrant?(signingKey: string, trustedTime: number): Promise<{
3277
+ grant: {
3278
+ usernameHash: string;
3279
+ };
3280
+ via: "grant" | "certificate";
3281
+ } | null>;
3282
+ /**
3283
+ * The tenant-wide trusted-time cutoff from which a new User-Key generation
3284
+ * must be signed to count (`requireUserKeyGenerationSignatureSince` in the
3285
+ * default policy, docs/userkeys.md §9.3), or `undefined` when none is set.
3286
+ */
3287
+ getRequireUserKeyGenerationSignatureSince?(): Promise<number | undefined>;
3173
3288
  /**
3174
3289
  * Whether a Tier 2 (`withfields`) content rule exists for `op` on `dbid` at
3175
3290
  * the current head state. Lets callers skip materializing before/after
@@ -3197,6 +3312,63 @@ export interface MindooTenantDirectory {
3197
3312
  * @returns The set of trusted witness Ed25519 signing public keys (PEM) in effect at `T`.
3198
3313
  */
3199
3314
  getTrustedWitnessKeysAt?(T: number): Promise<Set<string>>;
3315
+ /**
3316
+ * Whether `signingKey` is a tenant admin at trusted time `T`
3317
+ * (docs/accesscontrol.md §6.13): the root admin key (`administrationPublicKey`)
3318
+ * always; a delegated admin key while its admin-key document's window
3319
+ * (`validFrom ≤ T < validUntil`, witness time) covers `T`.
3320
+ *
3321
+ * @param signingKey Ed25519 signing public key (PEM).
3322
+ * @param T Trusted time (ms epoch); `Number.MAX_SAFE_INTEGER` means the directory head judged now.
3323
+ * @returns True when the key may act as an administrator at `T`.
3324
+ */
3325
+ isAdminAt?(signingKey: string, T: number): Promise<boolean>;
3326
+ /**
3327
+ * The delegated admin keys at the directory head, with window, name and
3328
+ * status at "now" (§6.13). The root admin key is not listed.
3329
+ *
3330
+ * @returns One entry per delegated admin key, oldest first.
3331
+ */
3332
+ listAdminKeys?(): Promise<AdminKeyInfo[]>;
3333
+ /**
3334
+ * The delegated admin keys as the directory knew them at trusted time `T` (§6.13).
3335
+ *
3336
+ * @param T Trusted time (ms epoch).
3337
+ * @returns One entry per delegated admin key known at `T`, status judged at `T`.
3338
+ */
3339
+ getAdminKeysAt?(T: number): Promise<AdminKeyInfo[]>;
3340
+ /**
3341
+ * Make a signing key a delegated administrator (§6.13). Root admin key only.
3342
+ * Writes `acl_adminkey_<fingerprint>` and records the admin in
3343
+ * `tenantsetup.administrators`. Re-adding a deactivated key reactivates it
3344
+ * from the witness time of this write on.
3345
+ *
3346
+ * @param admin The admin device: its public keys, the admin's name, an optional device label and an optional later start.
3347
+ * @param administrationPrivateKey The ROOT administration private key.
3348
+ * @param administrationPrivateKeyPassword Its password.
3349
+ */
3350
+ addAdminKey?(admin: {
3351
+ signingPublicKey: string;
3352
+ encryptionPublicKey: string;
3353
+ name: string;
3354
+ label?: string;
3355
+ validFrom?: number;
3356
+ }, administrationPrivateKey: EncryptedPrivateKey, administrationPrivateKeyPassword: string): Promise<void>;
3357
+ /**
3358
+ * Set or clear the window of a delegated admin key (§6.13). Root admin key
3359
+ * only. `validUntil` in the future schedules the end; a value before this
3360
+ * write's witness time is raised to it (no retroactive deactivation).
3361
+ * `validUntil: null` on an ended key reactivates it from now on.
3362
+ *
3363
+ * @param signingPublicKey The delegated admin's signing public key (PEM).
3364
+ * @param validity New `validFrom` / `validUntil` (ms, witness time); `null` clears a bound.
3365
+ * @param administrationPrivateKey The ROOT administration private key.
3366
+ * @param administrationPrivateKeyPassword Its password.
3367
+ */
3368
+ setAdminKeyValidity?(signingPublicKey: string, validity: {
3369
+ validFrom?: number | null;
3370
+ validUntil?: number | null;
3371
+ }, administrationPrivateKey: EncryptedPrivateKey, administrationPrivateKeyPassword: string): Promise<void>;
3200
3372
  /**
3201
3373
  * The canonical write-time hash for `username` (the value stored in a
3202
3374
  * distribution's `pushto`/`pullfrom` hash lists). Used to build `pullfrom`
@@ -3421,11 +3593,14 @@ export interface MindooTenantDirectory {
3421
3593
  * independent. Optional: directories without remote-wipe support omit it.
3422
3594
  *
3423
3595
  * @param username The user whose signing-key universe to resolve (format: "CN=<username>/O=<tenantId>").
3424
- * @returns The `active` (currently-granted) and `wipeRequested` (remote-wipe-targeted) signing public keys.
3596
+ * @returns The `active` (currently-granted) and `wipeRequested` (remote-wipe-targeted) signing public keys,
3597
+ * and optionally the `revoked` keys (kept on a grant as revoked pairs and not active anywhere), so a
3598
+ * server can tell a revoked device why it is refused.
3425
3599
  */
3426
3600
  getUserSigningKeyUniverse?(username: string): Promise<{
3427
3601
  active: string[];
3428
3602
  wipeRequested: string[];
3603
+ revoked?: string[];
3429
3604
  }>;
3430
3605
  /**
3431
3606
  * If `signingKey` is the target of an admin-requested remote wipe (§6.5),
@@ -5536,5 +5711,17 @@ export interface BuiltinIngestEntry {
5536
5711
  docId?: string;
5537
5712
  encryptedData?: Uint8Array;
5538
5713
  decryptionKeyId?: string;
5714
+ /**
5715
+ * Witness receipt and the metadata it signs. An entry of a delegated admin
5716
+ * (docs/accesscontrol.md §6.13) only passes with a valid receipt of a trusted
5717
+ * witness; a full {@link StoreEntry} carries all of these.
5718
+ */
5719
+ id?: string;
5720
+ contentHash?: string;
5721
+ createdAt?: number;
5722
+ receivedAt?: number;
5723
+ receivedByPublicKey?: string;
5724
+ receivedDateSignature?: Uint8Array;
5725
+ receiptScheme?: string;
5539
5726
  }
5540
5727
  //# sourceMappingURL=types.d.ts.map