@dxos/echo-query 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/echo-query",
3
- "version": "0.8.4-main.72ec0f3",
3
+ "version": "0.8.4-main.74a063c4e0",
4
4
  "description": "ECHO queries.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "info@dxos.org",
9
13
  "sideEffects": false,
@@ -15,9 +19,9 @@
15
19
  ".": {
16
20
  "source": "./src/index.ts",
17
21
  "types": "./dist/types/src/index.d.ts",
18
- "browser": "./dist/lib/browser/index.mjs",
19
- "node": "./dist/lib/node-esm/index.mjs"
20
- }
22
+ "default": "./dist/lib/neutral/index.mjs"
23
+ },
24
+ "./api.d.ts": "./dist/query-lite/index.d.ts"
21
25
  },
22
26
  "types": "dist/types/src/index.d.ts",
23
27
  "typesVersions": {
@@ -31,21 +35,22 @@
31
35
  "@lezer/common": "^1.2.2",
32
36
  "@lezer/lezer": "^1.1.2",
33
37
  "@lezer/lr": "^1.4.2",
34
- "@orama/orama": "^3.1.7",
35
- "@dxos/debug": "0.8.4-main.72ec0f3",
36
- "@dxos/context": "0.8.4-main.72ec0f3",
37
- "@dxos/echo": "0.8.4-main.72ec0f3",
38
- "@dxos/errors": "0.8.4-main.72ec0f3",
39
- "@dxos/invariant": "0.8.4-main.72ec0f3",
40
- "@dxos/node-std": "0.8.4-main.72ec0f3",
41
- "@dxos/echo-protocol": "0.8.4-main.72ec0f3",
42
- "@dxos/util": "0.8.4-main.72ec0f3",
43
- "@dxos/vendor-quickjs": "0.8.4-main.72ec0f3"
38
+ "@dxos/context": "0.8.4-main.74a063c4e0",
39
+ "@dxos/echo-protocol": "0.8.4-main.74a063c4e0",
40
+ "@dxos/echo": "0.8.4-main.74a063c4e0",
41
+ "@dxos/errors": "0.8.4-main.74a063c4e0",
42
+ "@dxos/invariant": "0.8.4-main.74a063c4e0",
43
+ "@dxos/node-std": "0.8.4-main.74a063c4e0",
44
+ "@dxos/util": "0.8.4-main.74a063c4e0",
45
+ "@dxos/vendor-quickjs": "0.8.4-main.74a063c4e0",
46
+ "@dxos/debug": "0.8.4-main.74a063c4e0"
44
47
  },
45
48
  "devDependencies": {
46
49
  "@lezer/generator": "^1.7.1",
47
- "@dxos/echo-generator": "0.8.4-main.72ec0f3",
48
- "@dxos/random": "0.8.4-main.72ec0f3"
50
+ "tsdown": "^0.16.7",
51
+ "typescript": "^5.9.3",
52
+ "@dxos/echo-generator": "0.8.4-main.74a063c4e0",
53
+ "@dxos/random": "0.8.4-main.74a063c4e0"
49
54
  },
50
55
  "publishConfig": {
51
56
  "access": "public"
package/src/index.ts CHANGED
@@ -3,3 +3,4 @@
3
3
  //
4
4
 
5
5
  export * from './parser';
6
+ export * from './sandbox';
@@ -51,10 +51,10 @@ describe('query', () => {
51
51
  },
52
52
  // Type
53
53
  {
54
- input: 'type:dxos.org/type/Person',
54
+ input: 'type:org.dxos.type.person',
55
55
  expected: [
56
56
  'Query',
57
- // type:dxos.org/type/Person
57
+ // type:org.dxos.type.person
58
58
  'Filter',
59
59
  'TypeFilter',
60
60
  'TypeKeyword',
@@ -111,10 +111,10 @@ describe('query', () => {
111
111
  ],
112
112
  },
113
113
  {
114
- input: 'type:dxos.org/type/Person OR type:dxos.org/type/Organization',
114
+ input: 'type:org.dxos.type.person OR type:org.dxos.type.organization',
115
115
  expected: [
116
116
  'Query',
117
- // type:dxos.org/type/Person
117
+ // type:org.dxos.type.person
118
118
  'Filter',
119
119
  'TypeFilter',
120
120
  'TypeKeyword',
@@ -122,7 +122,7 @@ describe('query', () => {
122
122
  'Identifier',
123
123
  // OR
124
124
  'Or',
125
- // type:dxos.org/type/Organization
125
+ // type:org.dxos.type.organization
126
126
  'Filter',
127
127
  'TypeFilter',
128
128
  'TypeKeyword',
@@ -131,11 +131,11 @@ describe('query', () => {
131
131
  ],
132
132
  },
133
133
  {
134
- input: '(type:dxos.org/type/Person OR type:dxos.org/type/Organization) AND { name: "DXOS" }',
134
+ input: '(type:org.dxos.type.person OR type:org.dxos.type.organization) AND { name: "DXOS" }',
135
135
  expected: [
136
136
  'Query',
137
137
  '(',
138
- // type:dxos.org/type/Person
138
+ // type:org.dxos.type.person
139
139
  'Filter',
140
140
  'TypeFilter',
141
141
  'TypeKeyword',
@@ -143,7 +143,7 @@ describe('query', () => {
143
143
  'Identifier',
144
144
  // OR
145
145
  'Or',
146
- // type:dxos.org/type/Organization
146
+ // type:org.dxos.type.organization
147
147
  'Filter',
148
148
  'TypeFilter',
149
149
  'TypeKeyword',
@@ -164,10 +164,10 @@ describe('query', () => {
164
164
  ],
165
165
  },
166
166
  {
167
- input: 'type:dxos.org/type/Person -> type:dxos.org/type/Organization',
167
+ input: 'type:org.dxos.type.person -> type:org.dxos.type.organization',
168
168
  expected: [
169
169
  'Query',
170
- // type:dxos.org/type/Person
170
+ // type:org.dxos.type.person
171
171
  'Filter',
172
172
  'TypeFilter',
173
173
  'TypeKeyword',
@@ -175,7 +175,7 @@ describe('query', () => {
175
175
  'Identifier',
176
176
  'Relation',
177
177
  'ArrowRight',
178
- // type:dxos.org/type/Organization
178
+ // type:org.dxos.type.organization
179
179
  'Filter',
180
180
  'TypeFilter',
181
181
  'TypeKeyword',
@@ -184,10 +184,10 @@ describe('query', () => {
184
184
  ],
185
185
  },
186
186
  {
187
- input: 'type:dxos.org/type/Organization <- type:dxos.org/type/Person',
187
+ input: 'type:org.dxos.type.organization <- type:org.dxos.type.person',
188
188
  expected: [
189
189
  'Query',
190
- // type:dxos.org/type/Organization
190
+ // type:org.dxos.type.organization
191
191
  'Filter',
192
192
  'TypeFilter',
193
193
  'TypeKeyword',
@@ -195,7 +195,7 @@ describe('query', () => {
195
195
  'Identifier',
196
196
  'Relation',
197
197
  'ArrowLeft',
198
- // type:dxos.org/type/Person
198
+ // type:org.dxos.type.person
199
199
  'Filter',
200
200
  'TypeFilter',
201
201
  'TypeKeyword',
@@ -206,7 +206,7 @@ describe('query', () => {
206
206
  {
207
207
  // Persons for Organizations with name "DXOS"
208
208
  // TODO(burdon): Filter relations.
209
- input: '((type:dxos.org/type/Organization AND { name: "DXOS" }) -> type:dxos.org/type/Person)',
209
+ input: '((type:org.dxos.type.organization AND { name: "DXOS" }) -> type:org.dxos.type.person)',
210
210
  expected: [
211
211
  'Query',
212
212
  '(',
@@ -238,7 +238,7 @@ describe('query', () => {
238
238
  ],
239
239
  },
240
240
  {
241
- input: 'type:dxos.org/type/Person and { name: "DXOS" }',
241
+ input: 'type:org.dxos.type.person and { name: "DXOS" }',
242
242
  expected: [
243
243
  'Query',
244
244
  'Filter',
@@ -259,7 +259,7 @@ describe('query', () => {
259
259
  ],
260
260
  },
261
261
  {
262
- input: 'x = ( type: dxos.org/type/Person )',
262
+ input: 'x = ( type: org.dxos.type.person )',
263
263
  expected: [
264
264
  'Query',
265
265
  'Assignment',
@@ -305,9 +305,9 @@ describe('query', () => {
305
305
  const tests: Test[] = [
306
306
  // Types
307
307
  {
308
- input: 'type:dxos.org/type/Person',
308
+ input: 'type:org.dxos.type.person',
309
309
  expected: {
310
- filter: Filter.typename('dxos.org/type/Person'),
310
+ filter: Filter.typename('org.dxos.type.person'),
311
311
  },
312
312
  },
313
313
  // Tags
@@ -357,32 +357,32 @@ describe('query', () => {
357
357
  },
358
358
  },
359
359
  {
360
- input: 'type:dxos.org/type/Person OR type:dxos.org/type/Organization',
360
+ input: 'type:org.dxos.type.person OR type:org.dxos.type.organization',
361
361
  expected: {
362
- filter: Filter.or(Filter.typename('dxos.org/type/Person'), Filter.typename('dxos.org/type/Organization')),
362
+ filter: Filter.or(Filter.typename('org.dxos.type.person'), Filter.typename('org.dxos.type.organization')),
363
363
  },
364
364
  },
365
365
  {
366
- input: '(type:dxos.org/type/Person OR type:dxos.org/type/Organization) AND { name: "DXOS" }',
366
+ input: '(type:org.dxos.type.person OR type:org.dxos.type.organization) AND { name: "DXOS" }',
367
367
  expected: {
368
368
  filter: Filter.and(
369
- Filter.or(Filter.typename('dxos.org/type/Person'), Filter.typename('dxos.org/type/Organization')),
369
+ Filter.or(Filter.typename('org.dxos.type.person'), Filter.typename('org.dxos.type.organization')),
370
370
  Filter.props({ name: 'DXOS' }),
371
371
  ),
372
372
  },
373
373
  },
374
374
  {
375
- input: 'type:dxos.org/type/Person and { name: "DXOS" }',
375
+ input: 'type:org.dxos.type.person and { name: "DXOS" }',
376
376
  expected: {
377
- filter: Filter.and(Filter.typename('dxos.org/type/Person'), Filter.props({ name: 'DXOS' })),
377
+ filter: Filter.and(Filter.typename('org.dxos.type.person'), Filter.props({ name: 'DXOS' })),
378
378
  },
379
379
  },
380
380
  // Assignment
381
381
  {
382
- input: 'x = ( type:dxos.org/type/Person )',
382
+ input: 'x = ( type:org.dxos.type.person )',
383
383
  expected: {
384
384
  name: 'x',
385
- filter: Filter.typename('dxos.org/type/Person'),
385
+ filter: Filter.typename('org.dxos.type.person'),
386
386
  },
387
387
  },
388
388
  {
@@ -401,9 +401,9 @@ describe('query', () => {
401
401
  //
402
402
  // {
403
403
  // input: '',
404
- // expected: Query.select(Filter.typename('dxos.org/type/Person', { jobTitle: 'investor' }))
404
+ // expected: Query.select(Filter.typename('org.dxos.type.person', { jobTitle: 'investor' }))
405
405
  // .reference('organization')
406
- // .targetOf(Relation.of('dxos.org/relation/HasSubject')) // TODO(burdon): Invert?
406
+ // .targetOf(Relation.of('org.dxos.relation.hasSubject')) // TODO(burdon): Invert?
407
407
  // .source(),
408
408
  // },
409
409
  ];