@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.
Files changed (139) hide show
  1. package/README.md +112 -0
  2. package/dist/account-MWNCH4GJ.js +12 -0
  3. package/dist/account-ledger-R2GAFJL6.js +38 -0
  4. package/dist/auth/index.d.ts +420 -0
  5. package/dist/auth/index.js +102 -0
  6. package/dist/budget-NN7P35XP.js +12 -0
  7. package/dist/canvas-6WYBNH53.js +10 -0
  8. package/dist/channel-AT3LQF4A.js +12 -0
  9. package/dist/chat-message-DSVO72B3.js +10 -0
  10. package/dist/chunk-2ZNJWIQG.js +84 -0
  11. package/dist/chunk-3J3HILXO.js +46 -0
  12. package/dist/chunk-3RUDVTMH.js +5543 -0
  13. package/dist/chunk-4EYKGTSQ.js +49 -0
  14. package/dist/chunk-53F4PRNC.js +32 -0
  15. package/dist/chunk-5EXHNXPL.js +48 -0
  16. package/dist/{chunk-BQBPA5HS.js → chunk-5HC5NO57.js} +16 -2
  17. package/dist/chunk-6KLGA6IR.js +47 -0
  18. package/dist/chunk-6OMG4I7M.js +41 -0
  19. package/dist/chunk-7PDRDSFH.js +69 -0
  20. package/dist/chunk-BQLQSWKZ.js +232 -0
  21. package/dist/chunk-BY5O6LNC.js +380 -0
  22. package/dist/chunk-DCTRX6II.js +40 -0
  23. package/dist/{chunk-VYR5GPJP.js → chunk-DWEXKD6E.js} +9 -3
  24. package/dist/chunk-EBNMV2VO.js +896 -0
  25. package/dist/chunk-FVEACSKE.js +102 -0
  26. package/dist/chunk-GU6THOAB.js +45 -0
  27. package/dist/chunk-H4GA4BBK.js +75 -0
  28. package/dist/chunk-IJ44LR7N.js +76 -0
  29. package/dist/chunk-J4ANIXIV.js +402 -0
  30. package/dist/chunk-JDFNMFOZ.js +45 -0
  31. package/dist/chunk-K7DOZWWT.js +1811 -0
  32. package/dist/chunk-KQAT4XBL.js +49 -0
  33. package/dist/chunk-KQUALW4O.js +183 -0
  34. package/dist/chunk-LYSWLCOI.js +47 -0
  35. package/dist/chunk-MBTUO3ZL.js +65 -0
  36. package/dist/chunk-NI4FHG2K.js +52 -0
  37. package/dist/chunk-OCMSAKWV.js +78 -0
  38. package/dist/chunk-OGJCRNGE.js +57 -0
  39. package/dist/chunk-OPPHF3TF.js +143 -0
  40. package/dist/{chunk-IDMBCRUC.js → chunk-OSAWNZVM.js} +1 -1
  41. package/dist/chunk-PMUQACPY.js +33 -0
  42. package/dist/chunk-PNESGUH5.js +63 -0
  43. package/dist/chunk-Q3IEGH4B.js +51 -0
  44. package/dist/chunk-QJW5LDP4.js +52 -0
  45. package/dist/chunk-QWFTRZQT.js +142 -0
  46. package/dist/{chunk-SZC345Z2.js → chunk-RL64OJJ5.js} +1025 -1110
  47. package/dist/chunk-S5RP5RKY.js +416 -0
  48. package/dist/chunk-S6U6TCMN.js +722 -0
  49. package/dist/chunk-SVNGSZZA.js +69 -0
  50. package/dist/chunk-T5AZAOG5.js +54 -0
  51. package/dist/chunk-TCTZW4A6.js +42 -0
  52. package/dist/chunk-U64CW73O.js +109 -0
  53. package/dist/chunk-UDWKWTAX.js +6526 -0
  54. package/dist/chunk-UQM3G5A2.js +148 -0
  55. package/dist/chunk-VQ7JHB67.js +57 -0
  56. package/dist/chunk-W7EBL7ZU.js +73 -0
  57. package/dist/chunk-WEPK7SZF.js +65 -0
  58. package/dist/chunk-XHEA5UER.js +75 -0
  59. package/dist/chunk-XMSKJ5PV.js +66 -0
  60. package/dist/chunk-XROI44ZP.js +64 -0
  61. package/dist/chunk-Y3S5SRVM.js +45 -0
  62. package/dist/chunk-YEFKQYKA.js +43 -0
  63. package/dist/chunk-YSUIXD2Y.js +105 -0
  64. package/dist/chunk-ZCOFZY5M.js +70 -0
  65. package/dist/chunk-ZLU4Y3O2.js +50 -0
  66. package/dist/chunk-ZPZ7XDA6.js +54 -0
  67. package/dist/chunk-ZZ6TWKGS.js +40 -0
  68. package/dist/clone-C0Jhk2UN.d.ts +2205 -0
  69. package/dist/comment-QSWYAQVS.js +10 -0
  70. package/dist/crm-L5RYAAF3.js +68 -0
  71. package/dist/dashboard-JMKTTRA7.js +10 -0
  72. package/dist/database/index.d.ts +882 -0
  73. package/dist/database/index.js +523 -0
  74. package/dist/database-GIXSPZJW.js +10 -0
  75. package/dist/database-field-3EPAMZUR.js +10 -0
  76. package/dist/database-row-6Q6TRVE4.js +10 -0
  77. package/dist/database-select-option-BBBJFLLH.js +10 -0
  78. package/dist/database-view-5PLSOBI2.js +10 -0
  79. package/dist/experiment-DOVOZ34Y.js +10 -0
  80. package/dist/external-item-P2E5X7BZ.js +14 -0
  81. package/dist/external-reference-7BSFF6SA.js +8 -0
  82. package/dist/feed-2IXHHP6O.js +12 -0
  83. package/dist/feed-item-DPE6LN7I.js +12 -0
  84. package/dist/folder-6KM3KYD5.js +21 -0
  85. package/dist/game-5AK5XWBR.js +50 -0
  86. package/dist/grant-WTQSNT5A.js +8 -0
  87. package/dist/grant-expiration-cleaner-CY6BcmlR.d.ts +249 -0
  88. package/dist/import-batch-IXBJLQPJ.js +12 -0
  89. package/dist/inbox-state-E5NSVOGP.js +12 -0
  90. package/dist/index.d.ts +224 -4548
  91. package/dist/index.js +2252 -4754
  92. package/dist/map-RG5Y3CPC.js +10 -0
  93. package/dist/media-asset-QTCGLIZA.js +8 -0
  94. package/dist/memory-PNRTMBZO.js +12 -0
  95. package/dist/metric-65SVOX5C.js +10 -0
  96. package/dist/milestone-XEO6ZGDG.js +12 -0
  97. package/dist/moderation-FFHETMRB.js +30 -0
  98. package/dist/observation-2Y3QKUXM.js +10 -0
  99. package/dist/page-2V27JGKJ.js +10 -0
  100. package/dist/posting-GBOSZCMZ.js +12 -0
  101. package/dist/profile-BLLDWIDK.js +8 -0
  102. package/dist/project-CQL5LN26.js +10 -0
  103. package/dist/query-ast-C3m6kZYv.d.ts +226 -0
  104. package/dist/reaction-T2DTJBBV.js +10 -0
  105. package/dist/registry-DunPv__d.d.ts +99 -0
  106. package/dist/saved-view-4R2DBCL3.js +10 -0
  107. package/dist/schema/index.d.ts +6489 -0
  108. package/dist/schema/index.js +677 -0
  109. package/dist/schema-extension-LNRF2YRD.js +18 -0
  110. package/dist/space-IJU24PBH.js +42 -0
  111. package/dist/space-membership-DEUMM7NV.js +14 -0
  112. package/dist/store/index.d.ts +518 -0
  113. package/dist/store/index.js +135 -0
  114. package/dist/store-DtIDjk7c.d.ts +355 -0
  115. package/dist/sync/awareness.d.ts +69 -0
  116. package/dist/sync/awareness.js +20 -0
  117. package/dist/system-ILHCZOVO.js +38 -0
  118. package/dist/tag-SKCHM3U5.js +16 -0
  119. package/dist/task-7AOBP7WC.js +16 -0
  120. package/dist/task-view-NUGKELJP.js +10 -0
  121. package/dist/transaction-ZDSEGDIR.js +12 -0
  122. package/dist/transcription-PSCLDAGX.js +12 -0
  123. package/dist/types-S-BJAKyK.d.ts +1576 -0
  124. package/dist/updates.d.ts +44 -0
  125. package/dist/updates.js +16 -0
  126. package/dist/user-widget-RLY2N46A.js +8 -0
  127. package/dist/view-types-DSde-uT_.d.ts +316 -0
  128. package/package.json +32 -9
  129. package/dist/canvas-HSIKIQFK.js +0 -7
  130. package/dist/chunk-2L5ZUGG5.js +0 -53
  131. package/dist/chunk-4MTS5KAQ.js +0 -22
  132. package/dist/chunk-GZHARFKC.js +0 -25
  133. package/dist/chunk-WKIKJTI2.js +0 -45
  134. package/dist/comment-277JD7DV.js +0 -7
  135. package/dist/database-W3KEHLI3.js +0 -7
  136. package/dist/database-row-3O2QSNZN.js +0 -7
  137. package/dist/grant-QVZ454YC.js +0 -7
  138. package/dist/page-O4WTOIEO.js +0 -7
  139. package/dist/task-SEKAYJH7.js +0 -7
@@ -0,0 +1,10 @@
1
+ import {
2
+ MapSchema
3
+ } from "./chunk-NI4FHG2K.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ MapSchema
10
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ MediaAssetSchema
3
+ } from "./chunk-3J3HILXO.js";
4
+ import "./chunk-EBNMV2VO.js";
5
+ import "./chunk-RL64OJJ5.js";
6
+ export {
7
+ MediaAssetSchema
8
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ MEMORY_ITEM_SCHEMA_IRI,
3
+ MEMORY_KINDS,
4
+ MemoryItemSchema
5
+ } from "./chunk-GU6THOAB.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ MEMORY_ITEM_SCHEMA_IRI,
10
+ MEMORY_KINDS,
11
+ MemoryItemSchema
12
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ MetricSchema
3
+ } from "./chunk-U64CW73O.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ MetricSchema
10
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ MILESTONE_SCHEMA_IRI,
3
+ MilestoneSchema
4
+ } from "./chunk-OGJCRNGE.js";
5
+ import "./chunk-OCMSAKWV.js";
6
+ import "./chunk-T5AZAOG5.js";
7
+ import "./chunk-EBNMV2VO.js";
8
+ import "./chunk-RL64OJJ5.js";
9
+ export {
10
+ MILESTONE_SCHEMA_IRI,
11
+ MilestoneSchema
12
+ };
@@ -0,0 +1,30 @@
1
+ import {
2
+ AbuseReportSchema,
3
+ AppealSchema,
4
+ CommunityNoteSchema,
5
+ ContentProvenanceSchema,
6
+ MessageRequestSchema,
7
+ ModerationLabelSchema,
8
+ NoteRatingSchema,
9
+ PolicyListSchema,
10
+ PolicySubscriptionSchema,
11
+ PublicInteractionPolicySchema,
12
+ QualitySignalSchema,
13
+ ReviewTaskSchema
14
+ } from "./chunk-S6U6TCMN.js";
15
+ import "./chunk-EBNMV2VO.js";
16
+ import "./chunk-RL64OJJ5.js";
17
+ export {
18
+ AbuseReportSchema,
19
+ AppealSchema,
20
+ CommunityNoteSchema,
21
+ ContentProvenanceSchema,
22
+ MessageRequestSchema,
23
+ ModerationLabelSchema,
24
+ NoteRatingSchema,
25
+ PolicyListSchema,
26
+ PolicySubscriptionSchema,
27
+ PublicInteractionPolicySchema,
28
+ QualitySignalSchema,
29
+ ReviewTaskSchema
30
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ ObservationSchema
3
+ } from "./chunk-W7EBL7ZU.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ ObservationSchema
10
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ PageSchema
3
+ } from "./chunk-ZLU4Y3O2.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ PageSchema
10
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ POSTING_SCHEMA_IRI,
3
+ PostingSchema
4
+ } from "./chunk-JDFNMFOZ.js";
5
+ import "./chunk-OCMSAKWV.js";
6
+ import "./chunk-T5AZAOG5.js";
7
+ import "./chunk-EBNMV2VO.js";
8
+ import "./chunk-RL64OJJ5.js";
9
+ export {
10
+ POSTING_SCHEMA_IRI,
11
+ PostingSchema
12
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ ProfileSchema
3
+ } from "./chunk-DCTRX6II.js";
4
+ import "./chunk-EBNMV2VO.js";
5
+ import "./chunk-RL64OJJ5.js";
6
+ export {
7
+ ProfileSchema
8
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ ProjectSchema
3
+ } from "./chunk-XROI44ZP.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ ProjectSchema
10
+ };
@@ -0,0 +1,226 @@
1
+ import { S as SchemaIRI, c as SortDirection, N as NodeQueryPageCountMode, P as PropertyBuilder, I as InferCreateProps, D as DefinedSchema, d as SystemOrderField } from './types-S-BJAKyK.js';
2
+
3
+ /**
4
+ * Canonical query AST for advanced Node reads.
5
+ *
6
+ * This module is intentionally storage-agnostic. It provides serializable query
7
+ * shapes, typed helper constructors, and validation/planning metadata for the
8
+ * future relation, aggregate, query-set, and pattern-query surfaces.
9
+ */
10
+
11
+ declare const QUERY_AST_VERSION: 1;
12
+ type QueryASTVersion = typeof QUERY_AST_VERSION;
13
+ type QueryASTField<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>> = Extract<keyof InferCreateProps<P>, string>;
14
+ type QueryASTSchemaInput<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>> = SchemaIRI | DefinedSchema<P>;
15
+ type QueryASTOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'in' | 'contains' | 'startsWith' | 'isNull' | 'isNotNull';
16
+ type QueryASTComparisonPredicate = {
17
+ kind: 'comparison';
18
+ field: string;
19
+ op: QueryASTOperator;
20
+ value?: unknown;
21
+ values?: unknown[];
22
+ };
23
+ type QueryASTCompoundPredicate = {
24
+ kind: 'and' | 'or';
25
+ predicates: QueryASTPredicate[];
26
+ };
27
+ type QueryASTNotPredicate = {
28
+ kind: 'not';
29
+ predicate: QueryASTPredicate;
30
+ };
31
+ type QueryASTPredicate = QueryASTComparisonPredicate | QueryASTCompoundPredicate | QueryASTNotPredicate;
32
+ type QueryASTOrderBy = {
33
+ field: string;
34
+ direction: SortDirection;
35
+ };
36
+ type QueryASTPage = {
37
+ first?: number;
38
+ after?: string;
39
+ offset?: number;
40
+ count?: NodeQueryPageCountMode;
41
+ };
42
+ type QueryASTRelationDirection = 'outbound' | 'inbound';
43
+ type QueryASTRelationInclude = {
44
+ kind: 'relation-include';
45
+ direction: QueryASTRelationDirection;
46
+ field: string;
47
+ targetSchemaId: SchemaIRI;
48
+ query: QueryASTNodeQuery;
49
+ cardinality: 'one' | 'many';
50
+ required?: boolean;
51
+ };
52
+ type QueryASTIncludes = Record<string, QueryASTRelationInclude>;
53
+ type QueryASTAggregateFunction = 'count' | 'countDistinct' | 'sum' | 'avg' | 'min' | 'max';
54
+ type QueryASTAggregate = {
55
+ kind: 'aggregate';
56
+ alias: string;
57
+ function: QueryASTAggregateFunction;
58
+ field?: string;
59
+ groupBy?: string[];
60
+ having?: QueryASTPredicate;
61
+ };
62
+ type QueryASTQuerySetAggregate = {
63
+ kind: 'query-set-aggregate';
64
+ alias: string;
65
+ query: string;
66
+ function: QueryASTAggregateFunction;
67
+ field?: string;
68
+ };
69
+ type QueryASTNodeQuery = {
70
+ version: QueryASTVersion;
71
+ kind: 'node';
72
+ schemaId: SchemaIRI;
73
+ predicate?: QueryASTPredicate;
74
+ orderBy?: QueryASTOrderBy[];
75
+ page?: QueryASTPage;
76
+ include?: QueryASTIncludes;
77
+ aggregates?: QueryASTAggregate[];
78
+ };
79
+ type QueryASTQuerySet = {
80
+ version: QueryASTVersion;
81
+ kind: 'query-set';
82
+ mode: 'batch' | 'dashboard';
83
+ queries: Record<string, QueryASTNodeQuery>;
84
+ aggregates?: QueryASTQuerySetAggregate[];
85
+ };
86
+ type QueryAST = QueryASTNodeQuery | QueryASTQuerySet;
87
+ type QueryASTNodeQueryOptions<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>> = {
88
+ where?: QueryASTPredicate | QueryASTPredicate[];
89
+ orderBy?: Partial<Record<QueryASTField<P> | SystemOrderField, SortDirection>>;
90
+ page?: QueryASTPage;
91
+ include?: QueryASTIncludes;
92
+ aggregates?: QueryASTAggregate[];
93
+ };
94
+ type QueryASTRelationIncludeOptions<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>> = QueryASTNodeQueryOptions<P> & {
95
+ cardinality?: 'one' | 'many';
96
+ required?: boolean;
97
+ };
98
+ type QueryASTValidationError = {
99
+ path: string;
100
+ code: string;
101
+ message: string;
102
+ value?: unknown;
103
+ };
104
+ type QueryASTValidationResult = {
105
+ valid: boolean;
106
+ errors: QueryASTValidationError[];
107
+ };
108
+ type QueryASTRelationIndexRequirement = {
109
+ schemaId: SchemaIRI;
110
+ property: string;
111
+ direction: QueryASTRelationDirection;
112
+ targetSchemaId: SchemaIRI;
113
+ reason: 'include';
114
+ };
115
+ type QueryASTAggregatePlan = {
116
+ path: string;
117
+ alias: string;
118
+ function: QueryASTAggregateFunction;
119
+ strategy: 'node-count' | 'scalar-scan' | 'distinct-scan';
120
+ requiredFields: string[];
121
+ groupBy: string[];
122
+ canUseScalarIndex: boolean;
123
+ };
124
+ type QueryASTAggregateGroup = {
125
+ key: Record<string, unknown>;
126
+ rowCount: number;
127
+ value: unknown;
128
+ };
129
+ type QueryASTAggregateResult = {
130
+ alias: string;
131
+ function: QueryASTAggregateFunction;
132
+ field?: string;
133
+ groupBy: string[];
134
+ rowCount: number;
135
+ value: unknown;
136
+ groups?: QueryASTAggregateGroup[];
137
+ };
138
+ type QueryASTAggregateExecution = {
139
+ scope: 'loaded-snapshot';
140
+ rowCount: number;
141
+ results: Record<string, QueryASTAggregateResult>;
142
+ };
143
+ type QueryASTPlannerGate = {
144
+ validation: QueryASTValidationResult;
145
+ relationIndexRequirements: QueryASTRelationIndexRequirement[];
146
+ aggregatePlans: QueryASTAggregatePlan[];
147
+ useFindReady: boolean;
148
+ blockers: string[];
149
+ };
150
+ type SavedViewFeedLayout = 'list' | 'grid';
151
+ type SavedViewFeedDensity = 'compact' | 'cozy' | 'comfortable';
152
+ type SavedViewPresentationHintMode = 'table' | 'cards' | 'timeline' | 'canvas' | 'graph' | 'feed';
153
+ /**
154
+ * Optional rendering hint persisted with a saved view so specialized views
155
+ * (for example media feeds) can open in their intended presentation.
156
+ */
157
+ type SavedViewPresentationHint = {
158
+ mode?: SavedViewPresentationHintMode;
159
+ feedLayout?: SavedViewFeedLayout;
160
+ feedDensity?: SavedViewFeedDensity;
161
+ };
162
+ type SavedViewDescriptor = {
163
+ version: QueryASTVersion;
164
+ title: string;
165
+ query: QueryAST;
166
+ description?: string;
167
+ scope?: 'user' | 'workspace' | 'database';
168
+ presentation?: SavedViewPresentationHint;
169
+ };
170
+ declare function eq<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]): QueryASTPredicate;
171
+ declare function neq<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]): QueryASTPredicate;
172
+ declare function gt<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]): QueryASTPredicate;
173
+ declare function gte<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]): QueryASTPredicate;
174
+ declare function lt<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]): QueryASTPredicate;
175
+ declare function lte<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]): QueryASTPredicate;
176
+ declare function between<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, from: InferCreateProps<P>[K], to: InferCreateProps<P>[K]): QueryASTPredicate;
177
+ declare function includesAny<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, values: InferCreateProps<P>[K][]): QueryASTPredicate;
178
+ declare function contains<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: string): QueryASTPredicate;
179
+ declare function startsWith<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K, value: string): QueryASTPredicate;
180
+ declare function isNull<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K): QueryASTPredicate;
181
+ declare function isNotNull<P extends Record<string, PropertyBuilder>, K extends QueryASTField<P> = QueryASTField<P>>(field: K): QueryASTPredicate;
182
+ declare function and(...predicates: QueryASTPredicate[]): QueryASTPredicate;
183
+ declare function or(...predicates: QueryASTPredicate[]): QueryASTPredicate;
184
+ declare function not(predicate: QueryASTPredicate): QueryASTPredicate;
185
+ declare function queryOperators<P extends Record<string, PropertyBuilder>>(): {
186
+ eq: <K extends QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]) => QueryASTPredicate;
187
+ neq: <K extends QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]) => QueryASTPredicate;
188
+ gt: <K extends QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]) => QueryASTPredicate;
189
+ gte: <K extends QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]) => QueryASTPredicate;
190
+ lt: <K extends QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]) => QueryASTPredicate;
191
+ lte: <K extends QueryASTField<P>>(field: K, value: InferCreateProps<P>[K]) => QueryASTPredicate;
192
+ between: <K extends QueryASTField<P>>(field: K, from: InferCreateProps<P>[K], to: InferCreateProps<P>[K]) => QueryASTPredicate;
193
+ includesAny: <K extends QueryASTField<P>>(field: K, values: InferCreateProps<P>[K][]) => QueryASTPredicate;
194
+ contains: <K extends QueryASTField<P>>(field: K, value: string) => QueryASTPredicate;
195
+ startsWith: <K extends QueryASTField<P>>(field: K, value: string) => QueryASTPredicate;
196
+ isNull: <K extends QueryASTField<P>>(field: K) => QueryASTPredicate;
197
+ isNotNull: <K extends QueryASTField<P>>(field: K) => QueryASTPredicate;
198
+ };
199
+ declare function defineNodeQueryAST<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>>(schema: QueryASTSchemaInput<P>, options?: QueryASTNodeQueryOptions<P>): QueryASTNodeQuery;
200
+ declare function follow<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>>(schema: QueryASTSchemaInput<P>, field: QueryASTField<P>, options?: QueryASTRelationIncludeOptions<P>): QueryASTRelationInclude;
201
+ declare function from<P extends Record<string, PropertyBuilder> = Record<string, PropertyBuilder>>(schema: QueryASTSchemaInput<P>, field: QueryASTField<P>, options?: QueryASTRelationIncludeOptions<P>): QueryASTRelationInclude;
202
+ declare function count(alias?: string): QueryASTAggregate;
203
+ declare function countDistinct(field: string, alias?: string): QueryASTAggregate;
204
+ declare function sum(field: string, alias?: string): QueryASTAggregate;
205
+ declare function avg(field: string, alias?: string): QueryASTAggregate;
206
+ declare function min(field: string, alias?: string): QueryASTAggregate;
207
+ declare function max(field: string, alias?: string): QueryASTAggregate;
208
+ declare function groupBy(aggregate: QueryASTAggregate, ...fields: string[]): QueryASTAggregate;
209
+ declare function having(aggregate: QueryASTAggregate, predicate: QueryASTPredicate): QueryASTAggregate;
210
+ declare function defineQuerySetAST(queries: Record<string, QueryASTNodeQuery>, options?: {
211
+ mode?: QueryASTQuerySet['mode'];
212
+ aggregates?: QueryASTQuerySetAggregate[];
213
+ }): QueryASTQuerySet;
214
+ declare function dashboardQuerySet(queries: Record<string, QueryASTNodeQuery>, aggregates?: QueryASTQuerySetAggregate[]): QueryASTQuerySet;
215
+ declare function querySetCount(query: string, alias?: string): QueryASTQuerySetAggregate;
216
+ declare function defineSavedViewDescriptor(descriptor: Omit<SavedViewDescriptor, 'version'>): SavedViewDescriptor;
217
+ declare function matchesQueryASTLoadedRow(row: unknown, predicate: QueryASTPredicate): boolean;
218
+ declare function filterQueryASTLoadedRows<T>(rows: readonly T[], predicate: QueryASTPredicate | undefined): T[];
219
+ declare function executeQueryASTLoadedAggregates(query: QueryASTNodeQuery, rows: readonly unknown[]): QueryASTAggregateExecution;
220
+ declare function validateQueryAST(value: unknown): QueryASTValidationResult;
221
+ declare function validateSavedViewDescriptor(value: unknown): QueryASTValidationResult;
222
+ declare function planQueryASTAggregates(ast: QueryAST): QueryASTAggregatePlan[];
223
+ declare function getQueryASTRelationIndexRequirements(ast: QueryAST): QueryASTRelationIndexRequirement[];
224
+ declare function evaluateQueryASTPlannerGate(value: unknown): QueryASTPlannerGate;
225
+
226
+ export { from as $, type QueryASTAggregateExecution as A, type QueryASTPlannerGate as B, type SavedViewPresentationHint as C, type SavedViewPresentationHintMode as D, type SavedViewFeedLayout as E, type SavedViewFeedDensity as F, QUERY_AST_VERSION as G, eq as H, neq as I, gt as J, gte as K, lt as L, lte as M, between as N, includesAny as O, contains as P, type QueryASTVersion as Q, startsWith as R, type SavedViewDescriptor as S, isNull as T, isNotNull as U, and as V, or as W, not as X, queryOperators as Y, defineNodeQueryAST as Z, follow as _, type QueryASTField as a, count as a0, countDistinct as a1, sum as a2, avg as a3, min as a4, max as a5, groupBy as a6, having as a7, defineQuerySetAST as a8, dashboardQuerySet as a9, querySetCount as aa, defineSavedViewDescriptor as ab, validateQueryAST as ac, validateSavedViewDescriptor as ad, planQueryASTAggregates as ae, executeQueryASTLoadedAggregates as af, filterQueryASTLoadedRows as ag, getQueryASTRelationIndexRequirements as ah, matchesQueryASTLoadedRow as ai, evaluateQueryASTPlannerGate as aj, type QueryASTSchemaInput as b, type QueryASTOperator as c, type QueryASTComparisonPredicate as d, type QueryASTCompoundPredicate as e, type QueryASTNotPredicate as f, type QueryASTPredicate as g, type QueryASTOrderBy as h, type QueryASTPage as i, type QueryASTRelationDirection as j, type QueryASTRelationInclude as k, type QueryASTIncludes as l, type QueryASTAggregateFunction as m, type QueryASTAggregate as n, type QueryASTQuerySetAggregate as o, type QueryASTNodeQuery as p, type QueryASTQuerySet as q, type QueryAST as r, type QueryASTNodeQueryOptions as s, type QueryASTRelationIncludeOptions as t, type QueryASTValidationError as u, type QueryASTValidationResult as v, type QueryASTRelationIndexRequirement as w, type QueryASTAggregatePlan as x, type QueryASTAggregateGroup as y, type QueryASTAggregateResult as z };
@@ -0,0 +1,10 @@
1
+ import {
2
+ ReactionSchema
3
+ } from "./chunk-Y3S5SRVM.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ ReactionSchema
10
+ };
@@ -0,0 +1,99 @@
1
+ import { P as PropertyBuilder, D as DefinedSchema, S as SchemaIRI, a as Schema, b as ParsedSchemaIRI } from './types-S-BJAKyK.js';
2
+
3
+ /**
4
+ * Schema Registry - Runtime lookup for schema definitions.
5
+ *
6
+ * The registry provides:
7
+ * - Registration of custom schemas
8
+ * - Lookup by schema IRI
9
+ * - Lazy loading of built-in schemas
10
+ * - Validation that a node matches its schema
11
+ */
12
+
13
+ /**
14
+ * Schema Registry for runtime schema lookup.
15
+ */
16
+ declare class SchemaRegistry {
17
+ private schemas;
18
+ private loadingPromises;
19
+ private remoteResolver;
20
+ /**
21
+ * Register a custom schema.
22
+ *
23
+ * @param schema - The defined schema to register
24
+ * @throws If a schema with this IRI is already registered
25
+ */
26
+ register<P extends Record<string, PropertyBuilder>>(schema: DefinedSchema<P>): void;
27
+ /**
28
+ * Get a schema by IRI.
29
+ * For built-in schemas, this will lazy-load them on first access.
30
+ *
31
+ * @param iri - The schema IRI
32
+ * @returns The schema, or undefined if not found
33
+ */
34
+ get(iri: SchemaIRI): Promise<DefinedSchema | undefined>;
35
+ /**
36
+ * Get a schema synchronously (only works for already-loaded schemas).
37
+ *
38
+ * @param iri - The schema IRI
39
+ * @returns The schema, or undefined if not loaded
40
+ */
41
+ getSync(iri: SchemaIRI): DefinedSchema | undefined;
42
+ /**
43
+ * Check if a schema is registered (either loaded or built-in).
44
+ */
45
+ has(iri: SchemaIRI): boolean;
46
+ /**
47
+ * Check if a schema is a built-in schema.
48
+ */
49
+ isBuiltIn(iri: SchemaIRI): boolean;
50
+ /**
51
+ * Get all registered schema IRIs (including built-in).
52
+ */
53
+ getAllIRIs(): SchemaIRI[];
54
+ /**
55
+ * Unregister a custom schema.
56
+ * Built-in schemas cannot be unregistered.
57
+ *
58
+ * @param iri - The schema IRI to unregister
59
+ * @returns true if the schema was unregistered
60
+ */
61
+ unregister(iri: SchemaIRI): boolean;
62
+ /**
63
+ * Clear all custom schemas (keeps built-in schemas).
64
+ */
65
+ clear(): void;
66
+ /**
67
+ * Set a remote resolver for fetching schemas by IRI.
68
+ * When a schema is not found locally, the resolver is queried.
69
+ */
70
+ setRemoteResolver(resolver: (iri: SchemaIRI) => Promise<Schema | null>): void;
71
+ /**
72
+ * Get the version of a registered schema.
73
+ *
74
+ * @param iri - The schema IRI (versioned or unversioned)
75
+ * @returns The version string, or undefined if not found
76
+ */
77
+ getVersion(iri: SchemaIRI): string | undefined;
78
+ /**
79
+ * Get all versions of a schema by its base name.
80
+ *
81
+ * @param baseIRI - The unversioned base IRI (e.g., 'xnet://xnet.fyi/Task')
82
+ * @returns Array of versioned schemas, sorted by version
83
+ */
84
+ getAllVersions(baseIRI: SchemaIRI): Array<{
85
+ iri: SchemaIRI;
86
+ version: string;
87
+ schema: DefinedSchema;
88
+ }>;
89
+ /**
90
+ * Parse a schema IRI into its components.
91
+ */
92
+ parseIRI(iri: SchemaIRI): ParsedSchemaIRI;
93
+ }
94
+ /**
95
+ * Default global schema registry instance.
96
+ */
97
+ declare const schemaRegistry: SchemaRegistry;
98
+
99
+ export { SchemaRegistry as S, schemaRegistry as s };
@@ -0,0 +1,10 @@
1
+ import {
2
+ SavedViewSchema
3
+ } from "./chunk-ZZ6TWKGS.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ SavedViewSchema
10
+ };