proto.io 0.0.172 → 0.0.174
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/dist/adapters/file/database.d.ts +2 -2
- package/dist/adapters/file/database.js +2 -2
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/filesystem.d.ts +2 -2
- package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
- package/dist/adapters/storage/progres.d.ts +9 -2
- package/dist/adapters/storage/progres.js +58 -5
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +58 -5
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/client.mjs +3 -3
- package/dist/index.d.ts +75 -3
- package/dist/index.js +242 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +243 -13
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{index-BYbMU-Ao.mjs → index--ifyu-GL.mjs} +139 -1
- package/dist/internals/index--ifyu-GL.mjs.map +1 -0
- package/dist/internals/{index-B1wqSio6.mjs → index-C3fbOqmn.mjs} +2 -2
- package/dist/internals/{index-B1wqSio6.mjs.map → index-C3fbOqmn.mjs.map} +1 -1
- package/dist/internals/index-CE5tdYK8.d.ts +1816 -0
- package/dist/internals/index-CE5tdYK8.d.ts.map +1 -0
- package/dist/internals/{index-K0jhERvZ.d.ts → index-CGX3qcjQ.d.ts} +2 -2
- package/dist/internals/index-CGX3qcjQ.d.ts.map +1 -0
- package/dist/internals/{index-CVutVPmd.js → index-DXuW8UiB.js} +139 -1
- package/dist/internals/index-DXuW8UiB.js.map +1 -0
- package/dist/internals/{index-CzfsyXvb.js → index-Dc3V_Bzw.js} +2 -2
- package/dist/internals/{index-CzfsyXvb.js.map → index-Dc3V_Bzw.js.map} +1 -1
- package/dist/internals/{index-D0hHgn2P.mjs → index-R0gbIGc-.mjs} +289 -2
- package/dist/internals/index-R0gbIGc-.mjs.map +1 -0
- package/dist/internals/{index-BJP46VGq.js → index-S_gTMQBh.js} +289 -2
- package/dist/internals/index-S_gTMQBh.js.map +1 -0
- package/dist/internals/{index-DchUjNEf.d.ts → index-uwXdnxqN.d.ts} +2 -2
- package/dist/internals/index-uwXdnxqN.d.ts.map +1 -0
- package/dist/internals/{random-BCpwYpyw.mjs → random-DPRG8oW6.mjs} +3 -3
- package/dist/internals/{random-BCpwYpyw.mjs.map → random-DPRG8oW6.mjs.map} +1 -1
- package/dist/internals/{random-Dytum6Nh.js → random-DVOUDDGg.js} +3 -3
- package/dist/internals/{random-Dytum6Nh.js.map → random-DVOUDDGg.js.map} +1 -1
- package/package.json +1 -1
- package/dist/internals/index-BJP46VGq.js.map +0 -1
- package/dist/internals/index-BYbMU-Ao.mjs.map +0 -1
- package/dist/internals/index-BhWRmBiq.d.ts +0 -726
- package/dist/internals/index-BhWRmBiq.d.ts.map +0 -1
- package/dist/internals/index-CVutVPmd.js.map +0 -1
- package/dist/internals/index-D0hHgn2P.mjs.map +0 -1
- package/dist/internals/index-DchUjNEf.d.ts.map +0 -1
- package/dist/internals/index-K0jhERvZ.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CE5tdYK8.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as TFileStorage, T as TSchema, P as ProtoService, B as TFileInfo } from './index-
|
|
1
|
+
import { c as TFileStorage, T as TSchema, P as ProtoService, B as TFileInfo } from './index-CE5tdYK8.js';
|
|
2
2
|
import { BinaryData } from '@o2ter/utils-js';
|
|
3
3
|
|
|
4
4
|
type FileStorageOptions = {
|
|
@@ -23,4 +23,4 @@ declare abstract class FileStorageBase implements TFileStorage {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { FileStorageBase as F, type FileStorageOptions as a };
|
|
26
|
-
//# sourceMappingURL=index-
|
|
26
|
+
//# sourceMappingURL=index-CGX3qcjQ.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CGX3qcjQ.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -130,6 +130,9 @@ const decodeUpdateOp = (update) => {
|
|
|
130
130
|
throw Error('Invalid update operation');
|
|
131
131
|
return pairs[0];
|
|
132
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Class representing a object.
|
|
135
|
+
*/
|
|
133
136
|
class TObject {
|
|
134
137
|
static defaultReadonlyKeys = defaultObjectReadonlyKeys;
|
|
135
138
|
static defaultKeys = defaultObjectKeys;
|
|
@@ -144,52 +147,104 @@ class TObject {
|
|
|
144
147
|
extra: {},
|
|
145
148
|
};
|
|
146
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Gets the class name of the object.
|
|
152
|
+
*/
|
|
147
153
|
get className() {
|
|
148
154
|
return this[_private.PVK].className;
|
|
149
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Gets the attributes of the object.
|
|
158
|
+
*/
|
|
150
159
|
get attributes() {
|
|
151
160
|
return cloneValue(this[_private.PVK].attributes);
|
|
152
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Gets the object ID.
|
|
164
|
+
*/
|
|
153
165
|
get objectId() {
|
|
154
166
|
return this[_private.PVK].attributes._id;
|
|
155
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Gets the creation date of the object.
|
|
170
|
+
*/
|
|
156
171
|
get createdAt() {
|
|
157
172
|
return this[_private.PVK].attributes._created_at;
|
|
158
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Gets the last updated date of the object.
|
|
176
|
+
*/
|
|
159
177
|
get updatedAt() {
|
|
160
178
|
return this[_private.PVK].attributes._updated_at;
|
|
161
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets the version number of the object.
|
|
182
|
+
*/
|
|
162
183
|
get __v() {
|
|
163
184
|
return this[_private.PVK].attributes.__v;
|
|
164
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Gets the sequence number of the object.
|
|
188
|
+
*/
|
|
165
189
|
get __i() {
|
|
166
190
|
return this[_private.PVK].attributes.__i;
|
|
167
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Gets the expiration date of the object.
|
|
194
|
+
*/
|
|
168
195
|
get expiredAt() {
|
|
169
196
|
return this.get('_expired_at');
|
|
170
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Sets the expiration date of the object.
|
|
200
|
+
* @param value - The expiration date.
|
|
201
|
+
*/
|
|
171
202
|
set expiredAt(value) {
|
|
172
203
|
this.set('_expired_at', value);
|
|
173
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Gets the access control list (ACL) of the object.
|
|
207
|
+
* @returns The ACL of the object.
|
|
208
|
+
*/
|
|
174
209
|
acl() {
|
|
175
210
|
return {
|
|
176
211
|
read: this.get('_rperm') ?? ['*'],
|
|
177
212
|
update: this.get('_wperm') ?? ['*'],
|
|
178
213
|
};
|
|
179
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Sets the access control list (ACL) of the object.
|
|
217
|
+
* @param value - The ACL to set.
|
|
218
|
+
*/
|
|
180
219
|
setAcl(value) {
|
|
181
220
|
this.set('_rperm', value.read ?? ['*']);
|
|
182
221
|
this.set('_wperm', value.update ?? ['*']);
|
|
183
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Sets the read access control list (ACL) of the object.
|
|
225
|
+
* @param value - The read ACL to set.
|
|
226
|
+
*/
|
|
184
227
|
setReadAcl(value) {
|
|
185
228
|
this.set('_rperm', value);
|
|
186
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Sets the write access control list (ACL) of the object.
|
|
232
|
+
* @param value - The write ACL to set.
|
|
233
|
+
*/
|
|
187
234
|
setWriteAcl(value) {
|
|
188
235
|
this.set('_wperm', value);
|
|
189
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Gets the keys of the object's attributes and mutated attributes.
|
|
239
|
+
* @returns An array of keys.
|
|
240
|
+
*/
|
|
190
241
|
keys() {
|
|
191
242
|
return _.uniq([..._.keys(this[_private.PVK].attributes), ..._.compact(_.map(_.keys(this[_private.PVK].mutated), x => _.first(_.toPath(x))))]);
|
|
192
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Gets an iterator for the entries of the object's attributes.
|
|
246
|
+
* @returns An iterator for the entries.
|
|
247
|
+
*/
|
|
193
248
|
*entries() {
|
|
194
249
|
for (const key of this.keys()) {
|
|
195
250
|
yield [key, this.get(key)];
|
|
@@ -204,6 +259,10 @@ class TObject {
|
|
|
204
259
|
}
|
|
205
260
|
}
|
|
206
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Converts the object to a plain object.
|
|
264
|
+
* @returns The plain object representation of the object.
|
|
265
|
+
*/
|
|
207
266
|
toObject() {
|
|
208
267
|
const toObject = (value) => {
|
|
209
268
|
if (isPrimitiveValue(value))
|
|
@@ -230,6 +289,11 @@ class TObject {
|
|
|
230
289
|
}
|
|
231
290
|
return cloneValue(value);
|
|
232
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Get the value of the attribute.
|
|
294
|
+
* @param key - The key of the attribute.
|
|
295
|
+
* @returns The value of the attribute.
|
|
296
|
+
*/
|
|
233
297
|
get(key) {
|
|
234
298
|
if (_.isEmpty(key))
|
|
235
299
|
throw Error('Invalid key');
|
|
@@ -238,6 +302,11 @@ class TObject {
|
|
|
238
302
|
const [op, value] = decodeUpdateOp(this[_private.PVK].mutated[key]);
|
|
239
303
|
return op === '$set' ? value : this._value(key);
|
|
240
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Set the value of the attribute.
|
|
307
|
+
* @param key - The key of the attribute.
|
|
308
|
+
* @param value - The value to set.
|
|
309
|
+
*/
|
|
241
310
|
set(key, value) {
|
|
242
311
|
if (_.isEmpty(key))
|
|
243
312
|
throw Error('Invalid key');
|
|
@@ -245,9 +314,17 @@ class TObject {
|
|
|
245
314
|
return;
|
|
246
315
|
this[_private.PVK].mutated[key] = { $set: value ?? null };
|
|
247
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* Is the object dirty.
|
|
319
|
+
*/
|
|
248
320
|
get isDirty() {
|
|
249
321
|
return !_.isEmpty(this[_private.PVK].mutated);
|
|
250
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Increment the value of the attribute.
|
|
325
|
+
* @param key - The key to increment.
|
|
326
|
+
* @param value - The value to increment by.
|
|
327
|
+
*/
|
|
251
328
|
increment(key, value) {
|
|
252
329
|
if (_.isEmpty(key))
|
|
253
330
|
throw Error('Invalid key');
|
|
@@ -255,6 +332,11 @@ class TObject {
|
|
|
255
332
|
return;
|
|
256
333
|
this[_private.PVK].mutated[key] = { $inc: value };
|
|
257
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Decrement the value of the attribute.
|
|
337
|
+
* @param key - The key to decrement.
|
|
338
|
+
* @param value - The value to decrement by.
|
|
339
|
+
*/
|
|
258
340
|
decrement(key, value) {
|
|
259
341
|
if (_.isEmpty(key))
|
|
260
342
|
throw Error('Invalid key');
|
|
@@ -262,6 +344,11 @@ class TObject {
|
|
|
262
344
|
return;
|
|
263
345
|
this[_private.PVK].mutated[key] = { $dec: value };
|
|
264
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Multiplies the value of the specified attribute.
|
|
349
|
+
* @param key - The key of the attribute to multiply.
|
|
350
|
+
* @param value - The multiplier value.
|
|
351
|
+
*/
|
|
265
352
|
multiply(key, value) {
|
|
266
353
|
if (_.isEmpty(key))
|
|
267
354
|
throw Error('Invalid key');
|
|
@@ -269,6 +356,11 @@ class TObject {
|
|
|
269
356
|
return;
|
|
270
357
|
this[_private.PVK].mutated[key] = { $mul: value };
|
|
271
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Divides the value of the specified attribute.
|
|
361
|
+
* @param key - The key of the attribute to divide.
|
|
362
|
+
* @param value - The divisor value.
|
|
363
|
+
*/
|
|
272
364
|
divide(key, value) {
|
|
273
365
|
if (_.isEmpty(key))
|
|
274
366
|
throw Error('Invalid key');
|
|
@@ -276,6 +368,11 @@ class TObject {
|
|
|
276
368
|
return;
|
|
277
369
|
this[_private.PVK].mutated[key] = { $div: value };
|
|
278
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Sets the value of the specified attribute to the maximum of the current value and the provided value.
|
|
373
|
+
* @param key - The key of the attribute to compare.
|
|
374
|
+
* @param value - The value to compare against.
|
|
375
|
+
*/
|
|
279
376
|
max(key, value) {
|
|
280
377
|
if (_.isEmpty(key))
|
|
281
378
|
throw Error('Invalid key');
|
|
@@ -283,6 +380,11 @@ class TObject {
|
|
|
283
380
|
return;
|
|
284
381
|
this[_private.PVK].mutated[key] = { $max: value };
|
|
285
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Sets the value of the specified attribute to the minimum of the current value and the provided value.
|
|
385
|
+
* @param key - The key of the attribute to compare.
|
|
386
|
+
* @param value - The value to compare against.
|
|
387
|
+
*/
|
|
286
388
|
min(key, value) {
|
|
287
389
|
if (_.isEmpty(key))
|
|
288
390
|
throw Error('Invalid key');
|
|
@@ -290,6 +392,11 @@ class TObject {
|
|
|
290
392
|
return;
|
|
291
393
|
this[_private.PVK].mutated[key] = { $min: value };
|
|
292
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* Adds the specified values to the set of the specified attribute.
|
|
397
|
+
* @param key - The key of the attribute.
|
|
398
|
+
* @param values - The values to add to the set.
|
|
399
|
+
*/
|
|
293
400
|
addToSet(key, values) {
|
|
294
401
|
if (_.isEmpty(key))
|
|
295
402
|
throw Error('Invalid key');
|
|
@@ -297,6 +404,11 @@ class TObject {
|
|
|
297
404
|
return;
|
|
298
405
|
this[_private.PVK].mutated[key] = { $addToSet: values };
|
|
299
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* Adds the values to the array of the attribute.
|
|
409
|
+
* @param key - The key of the attribute.
|
|
410
|
+
* @param values - The values to add.
|
|
411
|
+
*/
|
|
300
412
|
push(key, values) {
|
|
301
413
|
if (_.isEmpty(key))
|
|
302
414
|
throw Error('Invalid key');
|
|
@@ -304,6 +416,11 @@ class TObject {
|
|
|
304
416
|
return;
|
|
305
417
|
this[_private.PVK].mutated[key] = { $push: values };
|
|
306
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Removes the values from the array of the attribute.
|
|
421
|
+
* @param key - The key of the attribute.
|
|
422
|
+
* @param values - The values to remove.
|
|
423
|
+
*/
|
|
307
424
|
removeAll(key, values) {
|
|
308
425
|
if (_.isEmpty(key))
|
|
309
426
|
throw Error('Invalid key');
|
|
@@ -311,6 +428,11 @@ class TObject {
|
|
|
311
428
|
return;
|
|
312
429
|
this[_private.PVK].mutated[key] = { $removeAll: values };
|
|
313
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
* Removes the first elements from the array of the attribute.
|
|
433
|
+
* @param key - The key of the attribute.
|
|
434
|
+
* @param count - The number of elements to remove. Defaults to 1.
|
|
435
|
+
*/
|
|
314
436
|
popFirst(key, count = 1) {
|
|
315
437
|
if (_.isEmpty(key))
|
|
316
438
|
throw Error('Invalid key');
|
|
@@ -318,6 +440,11 @@ class TObject {
|
|
|
318
440
|
return;
|
|
319
441
|
this[_private.PVK].mutated[key] = { $popFirst: count };
|
|
320
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* Removes the last elements from the array of the attribute.
|
|
445
|
+
* @param key - The key of the attribute.
|
|
446
|
+
* @param count - The number of elements to remove. Defaults to 1.
|
|
447
|
+
*/
|
|
321
448
|
popLast(key, count = 1) {
|
|
322
449
|
if (_.isEmpty(key))
|
|
323
450
|
throw Error('Invalid key');
|
|
@@ -325,9 +452,20 @@ class TObject {
|
|
|
325
452
|
return;
|
|
326
453
|
this[_private.PVK].mutated[key] = { $popLast: count };
|
|
327
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Fetches the object data.
|
|
457
|
+
* @param options - Additional options for the fetch operation.
|
|
458
|
+
* @returns A promise that resolves to the fetched object.
|
|
459
|
+
*/
|
|
328
460
|
async fetch(options) {
|
|
329
461
|
return this.fetchWithInclude(_.keys(this[_private.PVK].attributes), options);
|
|
330
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* Fetches the object data if needed.
|
|
465
|
+
* @param keys - The keys of the attributes to fetch.
|
|
466
|
+
* @param options - Additional options for the fetch operation.
|
|
467
|
+
* @returns A promise that resolves to the fetched object.
|
|
468
|
+
*/
|
|
331
469
|
async fetchIfNeeded(keys, options) {
|
|
332
470
|
const current = _.keys(this[_private.PVK].attributes);
|
|
333
471
|
if (_.every(keys, k => _.includes(current, k)))
|
|
@@ -351,4 +489,4 @@ exports.isShape = isShape;
|
|
|
351
489
|
exports.isValue = isValue;
|
|
352
490
|
exports.isVector = isVector;
|
|
353
491
|
exports.shapePaths = shapePaths;
|
|
354
|
-
//# sourceMappingURL=index-
|
|
492
|
+
//# sourceMappingURL=index-DXuW8UiB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DXuW8UiB.js","sources":["../../../src/internals/schema.ts","../../../src/internals/object/index.ts"],"sourcesContent":["//\n// schema.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { _TValue } from './types';\n\nexport namespace TSchema {\n /**\n * Access Control List represented as an array of strings.\n */\n export type ACL = string[];\n\n /**\n * Access Control Lists for read and update operations.\n */\n export type ACLs = { \n /**\n * ACL for read operation.\n */\n read: TSchema.ACL; \n\n /**\n * ACL for update operation.\n */\n update: TSchema.ACL; \n };\n\n /**\n * Primitive data types.\n */\n export type Primitive = 'boolean' | 'number' | 'decimal' | 'string' | 'date' | 'object' | 'array';\n\n /**\n * Primitive type with an optional default value.\n */\n export type PrimitiveType = Primitive | { \n /**\n * The type of the primitive.\n */\n type: Primitive; \n\n /**\n * Optional default value.\n */\n default?: _TValue; \n };\n\n /**\n * Vector type with a specified dimension and an optional default value.\n */\n export type VectorType = { \n /**\n * The type of the vector.\n */\n type: 'vector'; \n\n /**\n * The dimension of the vector.\n */\n dimension: number; \n\n /**\n * Optional default value.\n */\n default?: number[]; \n };\n\n /**\n * Shape type with a specified shape.\n */\n export type ShapeType = { \n /**\n * The type of the shape.\n */\n type: 'shape'; \n\n /**\n * The shape definition.\n */\n shape: Record<string, DataType>; \n };\n\n /**\n * Pointer type with a target.\n */\n export type PointerType = { \n /**\n * The type of the pointer.\n */\n type: 'pointer'; \n\n /**\n * The target class of the pointer.\n */\n target: string; \n };\n\n /**\n * Relation type with a target and an optional foreign field.\n */\n export type RelationType = { \n /**\n * The type of the relation.\n */\n type: 'relation'; \n\n /**\n * The target class of the relation.\n */\n target: string; \n\n /**\n * Optional foreign field.\n */\n foreignField?: string; \n };\n\n /**\n * Data type which can be a primitive, vector, shape, pointer, or relation type.\n */\n export type DataType = PrimitiveType | VectorType | ShapeType | PointerType | RelationType;\n\n /**\n * Class Level Permissions.\n */\n export type CLPs = {\n /**\n * ACL for get operation.\n */\n get?: TSchema.ACL;\n\n /**\n * ACL for find operation.\n */\n find?: TSchema.ACL;\n\n /**\n * ACL for count operation.\n */\n count?: TSchema.ACL;\n\n /**\n * ACL for create operation.\n */\n create?: TSchema.ACL;\n\n /**\n * ACL for update operation.\n */\n update?: TSchema.ACL;\n\n /**\n * ACL for delete operation.\n */\n delete?: TSchema.ACL;\n };\n\n /**\n * Field Level Permissions.\n */\n export type FLPs = {\n /**\n * ACL for read operation.\n */\n read?: TSchema.ACL;\n\n /**\n * ACL for create operation.\n */\n create?: TSchema.ACL;\n\n /**\n * ACL for update operation.\n */\n update?: TSchema.ACL;\n };\n\n /**\n * Indexes for the schema.\n */\n export type Indexes = {\n /**\n * Type of the index, default is 'basic'.\n */\n type?: 'basic';\n\n /**\n * Keys for the index.\n */\n keys: Record<string, 1 | -1>;\n\n /**\n * Whether the index is unique.\n */\n unique?: boolean;\n } | {\n /**\n * Type of the index, must be 'vector'.\n */\n type: 'vector';\n\n /**\n * Keys for the vector index.\n */\n keys: string | string[];\n\n /**\n * Method for the vector index.\n */\n method?: 'hnsw' | 'ivfflat';\n };\n}\n\nexport const isPrimitive = (x: TSchema.DataType): x is TSchema.PrimitiveType => _.isString(x) || (x.type !== 'pointer' && x.type !== 'relation' && x.type !== 'shape');\nexport const isVector = (x: TSchema.DataType): x is TSchema.VectorType => !_.isString(x) && x.type === 'vector';\nexport const dimensionOf = (x: TSchema.DataType) => isVector(x) ? x.dimension : 0;\nexport const isShape = (x: TSchema.DataType): x is TSchema.ShapeType => !_.isString(x) && x.type === 'shape';\nexport const isPointer = (x: TSchema.DataType): x is TSchema.PointerType => !_.isString(x) && x.type === 'pointer';\nexport const isRelation = (x: TSchema.DataType): x is TSchema.RelationType => !_.isString(x) && x.type === 'relation';\nexport const _typeof = (x: TSchema.DataType) => _.isString(x) ? x : x.type !== 'pointer' && x.type !== 'relation' ? x.type : x.target;\n\nexport const shapePaths = (x: TSchema.ShapeType): {\n path: string,\n type: Exclude<TSchema.DataType, TSchema.ShapeType>,\n}[] => _.flatMap(x.shape, (v, k) => (\n isShape(v) ? _.map(shapePaths(v), x => ({ path: `${k}.${x.path}`, type: x.type })) : { path: k, type: v }\n));\n\nexport interface TSchema {\n /**\n * Fields of the schema, where each field is a data type.\n */\n fields: Record<string, TSchema.DataType>;\n\n /**\n * Class level permissions for the schema.\n */\n classLevelPermissions?: TSchema.CLPs;\n\n /**\n * Additional object permissions for the schema.\n */\n additionalObjectPermissions?: TSchema.ACLs;\n\n /**\n * Field level permissions for the schema, where each field can have its own permissions.\n */\n fieldLevelPermissions?: Record<string, TSchema.FLPs>;\n\n /**\n * Secure fields in the schema.\n */\n secureFields?: string[];\n\n /**\n * Indexes for the schema.\n */\n indexes?: TSchema.Indexes[];\n}\n\nexport const defaultObjectKeyTypes: Record<string, TSchema.DataType> = {\n _id: 'string',\n __v: 'number',\n __i: 'number',\n _created_at: 'date',\n _updated_at: 'date',\n _expired_at: 'date',\n _rperm: 'array',\n _wperm: 'array',\n};\n\nexport const defaultObjectReadonlyKeys = ['_id', '__v', '__i', '_created_at', '_updated_at'];\nexport const defaultObjectKeys = [...defaultObjectReadonlyKeys, '_expired_at', '_rperm', '_wperm'];\n","//\n// object.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { PVK } from '../private';\nimport { ExtraOptions } from '../options';\nimport { Decimal } from 'decimal.js';\nimport { TPrimitiveValue, TValue, _TValue } from '../types';\nimport { TSchema, defaultObjectKeys, defaultObjectReadonlyKeys } from '../schema';\nimport { PathName } from '../query/types';\nimport { TUpdateOp, TUpdateOpKeys } from './types';\nimport { ProtoType } from '../proto';\nimport { TQuery } from '../query';\n\nexport const isPrimitiveValue = (x: any): x is TPrimitiveValue => {\n if (_.isNil(x) || _.isNumber(x) || _.isBoolean(x) || _.isString(x) || _.isDate(x)) return true;\n if (x instanceof Decimal) return true;\n return false;\n}\n\nexport const isValue = (x: any): x is TValue => {\n if (isPrimitiveValue(x) || x instanceof TObject) return true;\n if (_.isArray(x)) return _.every(x, v => isValue(v));\n if (_.isPlainObject(x)) return _.every(x, v => isValue(v));\n return false;\n}\n\nexport const cloneValue = <T extends TValue>(x: T): T => {\n if (isPrimitiveValue(x) || x instanceof TObject) return x;\n if (_.isArray(x)) return x.map(v => cloneValue(v)) as T;\n return _.mapValues(x, v => cloneValue(v)) as T;\n}\n\nexport const _decodeValue = (value: _TValue): _TValue => {\n if (isPrimitiveValue(value)) return value;\n if (_.isArray(value)) return _.map(value, x => _decodeValue(x));\n if (_.isString(value.$date)) return new Date(value.$date);\n if (_.isString(value.$decimal)) return new Decimal(value.$decimal);\n return _.transform(value, (r, v, k) => {\n r[k.startsWith('$') ? k.substring(1) : k] = _decodeValue(v);\n }, {} as any);\n};\n\nexport const _encodeValue = (value: TValue): _TValue => {\n if (value instanceof TObject) throw Error('Invalid data type');\n if (_.isDate(value)) return { $date: value.toISOString() };\n if (value instanceof Decimal) return { $decimal: value.toString() };\n if (isPrimitiveValue(value)) return value;\n if (_.isArray(value)) return _.map(value, x => _encodeValue(x));\n return _.transform(value, (r, v, k) => {\n r[k.startsWith('$') ? `$${k}` : k] = _encodeValue(v);\n }, {} as any);\n};\n\nexport const decodeUpdateOp = (update: TUpdateOp) => {\n const pairs = _.toPairs(update);\n if (pairs.length !== 1) throw Error('Invalid update operation');\n return pairs[0] as [typeof TUpdateOpKeys[number], TValue];\n}\n\n/**\n * Interface representing a object.\n */\nexport interface TObject {\n /**\n * Clones the object.\n * @returns A clone of the object.\n */\n clone(): TObject;\n\n /**\n * Gets a relation query for the specified key.\n * @param key - The key of the relation.\n * @returns A query object for the relation.\n */\n relation<T extends string>(key: PathName<T>): TQuery<string, any, boolean>;\n\n /**\n * Fetches the object with the specified keys included.\n * @param keys - The keys to include.\n * @param options - Additional options for the fetch operation.\n * @returns A promise that resolves to the fetched object.\n */\n fetchWithInclude(keys: string[], options?: ExtraOptions<boolean>): PromiseLike<this>;\n\n /**\n * Saves the object.\n * @param options - Additional options for the save operation.\n * @returns A promise that resolves to the saved object.\n */\n save(options?: ExtraOptions<boolean> & { cascadeSave?: boolean }): PromiseLike<this>;\n\n /**\n * Destroys the object.\n * @param options - Additional options for the destroy operation.\n * @returns A promise that resolves to the destroyed object.\n */\n destroy(options?: ExtraOptions<boolean>): PromiseLike<this>;\n}\n\n/**\n * Class representing a object.\n */\nexport class TObject {\n\n static defaultReadonlyKeys = defaultObjectReadonlyKeys;\n static defaultKeys = defaultObjectKeys;\n\n /** @internal */\n [PVK]: {\n className: string;\n attributes: Record<string, TValue>;\n mutated: Record<string, TUpdateOp>;\n extra: Record<string, any>;\n };\n\n constructor(\n className: string,\n attributes?: Record<string, TValue> | ((self: TObject) => Record<string, TValue>),\n ) {\n const _attributes = _.isFunction(attributes) ? attributes(this) : attributes ?? {};\n this[PVK] = {\n className,\n attributes: cloneValue(_attributes),\n mutated: {},\n extra: {},\n }\n }\n\n /**\n * Gets the class name of the object.\n */\n get className(): string {\n return this[PVK].className;\n }\n\n /**\n * Gets the attributes of the object.\n */\n get attributes(): Record<string, TValue> {\n return cloneValue(this[PVK].attributes);\n }\n\n /**\n * Gets the object ID.\n */\n get objectId(): string | undefined {\n return this[PVK].attributes._id as string;\n }\n\n /**\n * Gets the creation date of the object.\n */\n get createdAt(): Date | undefined {\n return this[PVK].attributes._created_at as Date;\n }\n\n /**\n * Gets the last updated date of the object.\n */\n get updatedAt(): Date | undefined {\n return this[PVK].attributes._updated_at as Date;\n }\n\n /**\n * Gets the version number of the object.\n */\n get __v(): number {\n return this[PVK].attributes.__v as number;\n }\n\n /**\n * Gets the sequence number of the object.\n */\n get __i(): number {\n return this[PVK].attributes.__i as number;\n }\n\n /**\n * Gets the expiration date of the object.\n */\n get expiredAt(): Date | undefined {\n return this.get('_expired_at');\n }\n\n /**\n * Sets the expiration date of the object.\n * @param value - The expiration date.\n */\n set expiredAt(value: Date | undefined) {\n this.set('_expired_at', value);\n }\n\n /**\n * Gets the access control list (ACL) of the object.\n * @returns The ACL of the object.\n */\n acl(): TSchema.ACLs {\n return {\n read: this.get('_rperm') ?? ['*'],\n update: this.get('_wperm') ?? ['*'],\n };\n }\n\n /**\n * Sets the access control list (ACL) of the object.\n * @param value - The ACL to set.\n */\n setAcl(value: Partial<TSchema.ACLs>) {\n this.set('_rperm', value.read ?? ['*']);\n this.set('_wperm', value.update ?? ['*']);\n }\n\n /**\n * Sets the read access control list (ACL) of the object.\n * @param value - The read ACL to set.\n */\n setReadAcl(value: TSchema.ACL) {\n this.set('_rperm', value);\n }\n\n /**\n * Sets the write access control list (ACL) of the object.\n * @param value - The write ACL to set.\n */\n setWriteAcl(value: TSchema.ACL) {\n this.set('_wperm', value);\n }\n\n /**\n * Gets the keys of the object's attributes and mutated attributes.\n * @returns An array of keys.\n */\n keys(): string[] {\n return _.uniq([..._.keys(this[PVK].attributes), ..._.compact(_.map(_.keys(this[PVK].mutated), x => _.first(_.toPath(x))))]);\n }\n\n /**\n * Gets an iterator for the entries of the object's attributes.\n * @returns An iterator for the entries.\n */\n *entries() {\n for (const key of this.keys()) {\n yield [key, this.get(key)] as [string, any];\n }\n }\n\n /** @internal */\n *_set_entries() {\n for (const [key, op] of _.entries(this[PVK].mutated)) {\n for (const [_op, value] of _.entries(op)) {\n if (_op === '$set') yield [key, value] as [string, any];\n }\n }\n }\n\n /**\n * Converts the object to a plain object.\n * @returns The plain object representation of the object.\n */\n toObject() {\n const toObject = (value: TValue): _TValue => {\n if (isPrimitiveValue(value)) return value;\n if (value instanceof TObject) return value.toObject();\n if (_.isArray(value)) return _.map(value, toObject);\n return _.mapValues(value, toObject);\n }\n return _.fromPairs(_.map(this.keys(), k => [k, toObject(this.get(k))]));\n }\n\n private _value(key: string): TValue {\n let value: TValue = this[PVK].attributes;\n for (const k of _.toPath(key)) {\n if (isPrimitiveValue(value)) return null;\n if (value instanceof TObject) {\n value = value.get(k);\n } else {\n value = _.get(value, k);\n }\n }\n return cloneValue(value);\n }\n\n /**\n * Get the value of the attribute.\n * @param key - The key of the attribute.\n * @returns The value of the attribute.\n */\n get<T extends string>(key: PathName<T>): any {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (_.isNil(this[PVK].mutated[key])) return this._value(key);\n const [op, value] = decodeUpdateOp(this[PVK].mutated[key]);\n return op === '$set' ? value : this._value(key);\n }\n\n /**\n * Set the value of the attribute.\n * @param key - The key of the attribute.\n * @param value - The value to set.\n */\n set<T extends string>(key: PathName<T>, value: TValue | undefined) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $set: value ?? null };\n }\n\n /**\n * Is the object dirty.\n */\n get isDirty(): boolean {\n return !_.isEmpty(this[PVK].mutated);\n }\n\n /**\n * Increment the value of the attribute.\n * @param key - The key to increment.\n * @param value - The value to increment by.\n */\n increment<T extends string>(key: PathName<T>, value: number) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $inc: value };\n }\n\n /**\n * Decrement the value of the attribute.\n * @param key - The key to decrement.\n * @param value - The value to decrement by.\n */\n decrement<T extends string>(key: PathName<T>, value: number) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $dec: value };\n }\n\n /**\n * Multiplies the value of the specified attribute.\n * @param key - The key of the attribute to multiply.\n * @param value - The multiplier value.\n */\n multiply<T extends string>(key: PathName<T>, value: number) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $mul: value };\n }\n\n /**\n * Divides the value of the specified attribute.\n * @param key - The key of the attribute to divide.\n * @param value - The divisor value.\n */\n divide<T extends string>(key: PathName<T>, value: number) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $div: value };\n }\n\n /**\n * Sets the value of the specified attribute to the maximum of the current value and the provided value.\n * @param key - The key of the attribute to compare.\n * @param value - The value to compare against.\n */\n max<T extends string>(key: PathName<T>, value: TValue) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $max: value };\n }\n\n /**\n * Sets the value of the specified attribute to the minimum of the current value and the provided value.\n * @param key - The key of the attribute to compare.\n * @param value - The value to compare against.\n */\n min<T extends string>(key: PathName<T>, value: TValue) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $min: value };\n }\n\n /**\n * Adds the specified values to the set of the specified attribute.\n * @param key - The key of the attribute.\n * @param values - The values to add to the set.\n */\n addToSet<T extends string>(key: PathName<T>, values: TValue[]) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $addToSet: values };\n }\n\n /**\n * Adds the values to the array of the attribute.\n * @param key - The key of the attribute.\n * @param values - The values to add.\n */\n push<T extends string>(key: PathName<T>, values: TValue[]) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $push: values };\n }\n\n /**\n * Removes the values from the array of the attribute.\n * @param key - The key of the attribute.\n * @param values - The values to remove.\n */\n removeAll<T extends string>(key: PathName<T>, values: TValue[]) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $removeAll: values };\n }\n\n /**\n * Removes the first elements from the array of the attribute.\n * @param key - The key of the attribute.\n * @param count - The number of elements to remove. Defaults to 1.\n */\n popFirst<T extends string>(key: PathName<T>, count = 1) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $popFirst: count };\n }\n\n /**\n * Removes the last elements from the array of the attribute.\n * @param key - The key of the attribute.\n * @param count - The number of elements to remove. Defaults to 1.\n */\n popLast<T extends string>(key: PathName<T>, count = 1) {\n if (_.isEmpty(key)) throw Error('Invalid key');\n if (TObject.defaultReadonlyKeys.includes(_.first(_.toPath(key))!)) return;\n this[PVK].mutated[key] = { $popLast: count };\n }\n\n /**\n * Fetches the object data.\n * @param options - Additional options for the fetch operation.\n * @returns A promise that resolves to the fetched object.\n */\n async fetch(options?: ExtraOptions<boolean>) {\n return this.fetchWithInclude(_.keys(this[PVK].attributes), options);\n }\n\n /**\n * Fetches the object data if needed.\n * @param keys - The keys of the attributes to fetch.\n * @param options - Additional options for the fetch operation.\n * @returns A promise that resolves to the fetched object.\n */\n async fetchIfNeeded(keys: string[], options?: ExtraOptions<boolean>) {\n const current = _.keys(this[PVK].attributes);\n if (_.every(keys, k => _.includes(current, k))) return this;\n return this.fetchWithInclude(_.uniq([...current, ...keys]), options);\n }\n\n}\n"],"names":["Decimal","PVK"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoNO,MAAM,WAAW,GAAG,CAAC,CAAmB,KAAiC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;MACxJ,QAAQ,GAAG,CAAC,CAAmB,KAA8B,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK;MAC1F,WAAW,GAAG,CAAC,CAAmB,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,GAAG;MACnE,OAAO,GAAG,CAAC,CAAmB,KAA6B,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK;MACxF,SAAS,GAAG,CAAC,CAAmB,KAA+B,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK;MAC5F,UAAU,GAAG,CAAC,CAAmB,KAAgC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK;MAC9F,OAAO,GAAG,CAAC,CAAmB,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,GA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,QAAA,IAAI,CAACA,YAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;;AAG9C;;;;AAIG;IACH,MAAM,KAAK,CAAC,OAA+B,EAAA;AACzC,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAACA,YAAG,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;;AAGrE;;;;;AAKG;AACH,IAAA,MAAM,aAAa,CAAC,IAAc,EAAE,OAA+B,EAAA;AACjE,QAAA,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAACA,YAAG,CAAC,CAAC,UAAU,CAAC;AAC5C,QAAA,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,IAAI;AAC3D,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _ = require('lodash');
|
|
4
|
-
var index = require('./index-
|
|
4
|
+
var index = require('./index-DXuW8UiB.js');
|
|
5
5
|
|
|
6
6
|
//
|
|
7
7
|
// keys.ts
|
|
@@ -501,4 +501,4 @@ exports.QueryKeyExpression = QueryKeyExpression;
|
|
|
501
501
|
exports.QueryNotExpression = QueryNotExpression;
|
|
502
502
|
exports.QuerySelector = QuerySelector;
|
|
503
503
|
exports.QueryValueExpression = QueryValueExpression;
|
|
504
|
-
//# sourceMappingURL=index-
|
|
504
|
+
//# sourceMappingURL=index-Dc3V_Bzw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-CzfsyXvb.js","sources":["../../../src/internals/query/types/keys.ts","../../../src/server/query/dispatcher/parser/expressions.ts","../../../src/internals/query/types/selectors.ts","../../../src/server/query/dispatcher/parser/index.ts"],"sourcesContent":["//\n// keys.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nexport const TComparisonKeys = [\n '$eq',\n '$gt',\n '$gte',\n '$lt',\n '$lte',\n '$ne',\n] as const;\n\nexport const TValueListKeys = [\n '$in',\n '$nin',\n] as const;\n\nexport const TValueSetKeys = [\n '$subset',\n '$superset',\n '$intersect',\n] as const;\n\nexport const TConditionalKeys = [\n '$and',\n '$nor',\n '$or',\n] as const;\n\nexport const TDistanceKeys = [\n '$distance',\n '$innerProduct',\n '$negInnerProduct',\n '$cosineDistance',\n '$rectilinearDistance',\n] as const;\n","//\n// expressions.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { TExpression } from '../../../../internals/query/types/expressions';\nimport { TComparisonKeys, TConditionalKeys, TDistanceKeys } from '../../../../internals/query/types/keys';\nimport { isValue } from '../../../../internals/object';\nimport { TValue } from '../../../../internals/types';\n\nexport class QueryExpression {\n\n static decode(expr: _.Many<TExpression>, dollerSign: boolean): QueryExpression {\n const exprs: QueryExpression[] = [];\n for (const selector of _.castArray(expr)) {\n for (const [key, query] of _.toPairs(selector)) {\n if (_.includes(TConditionalKeys, key) && _.isArray(query)) {\n exprs.push(new QueryCoditionalExpression(key as any, _.map(query, x => QueryExpression.decode(x as any, dollerSign))));\n } else if (_.includes(TComparisonKeys, key) && _.isArray(query) && query.length === 2) {\n const [left, right] = query;\n exprs.push(new QueryComparisonExpression(key as any, QueryExpression.decode(left as any, dollerSign), QueryExpression.decode(right as any, dollerSign)));\n } else if (_.includes(TDistanceKeys, key) && _.isArray(query) && query.length === 2) {\n const [left, right] = query;\n const _left = _.isArray(left) ? _.map(left, x => QueryExpression.decode(x as any, dollerSign)) : QueryExpression.decode(left as any, dollerSign);\n const _right = _.isArray(right) ? _.map(right, x => QueryExpression.decode(x as any, dollerSign)) : QueryExpression.decode(right as any, dollerSign);\n exprs.push(new QueryDistanceExpression(key as any, _.castArray(_left), _.castArray(_right)));\n } else if (key === '$not') {\n exprs.push(new QueryNotExpression(QueryExpression.decode(query as any, dollerSign)));\n } else if (key === '$array' && _.isArray(query)) {\n exprs.push(new QueryArrayExpression(_.map(query, x => QueryExpression.decode(x as any, dollerSign))));\n } else if (key === '$key' && _.isString(query)) {\n if (dollerSign && query === '$') {\n exprs.push(new QueryKeyExpression(query));\n } else if (!query.startsWith('$')) {\n exprs.push(new QueryKeyExpression(query));\n } else {\n throw Error('Invalid expression');\n }\n } else if (key === '$value' && isValue(query)) {\n exprs.push(new QueryValueExpression(query));\n } else {\n throw Error('Invalid expression');\n }\n }\n }\n if (_.isEmpty(exprs)) return new QueryExpression;\n return (exprs.length === 1 ? exprs[0] : new QueryCoditionalExpression('$and', exprs)).simplify();\n }\n\n simplify(): QueryExpression {\n return this;\n }\n\n keyPaths(): string[] {\n return [];\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return this;\n }\n}\n\nexport class QueryCoditionalExpression extends QueryExpression {\n\n type: typeof TConditionalKeys[number];\n exprs: QueryExpression[];\n\n constructor(type: typeof TConditionalKeys[number], exprs: QueryExpression[]) {\n super();\n this.type = type;\n this.exprs = exprs;\n }\n\n simplify() {\n if (_.isEmpty(this.exprs)) return new QueryExpression;\n if (this.exprs.length === 1 && this.type !== '$nor') return this.exprs[0];\n switch (this.type) {\n case '$and':\n return new QueryCoditionalExpression(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalExpression && x.type === '$and' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QueryExpression;\n case '$nor':\n case '$or':\n return new QueryCoditionalExpression(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalExpression && x.type === '$or' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QueryExpression;\n }\n }\n\n keyPaths(): string[] {\n return _.uniq(_.flatMap(this.exprs, x => x.keyPaths()));\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryCoditionalExpression(this.type, _.map(this.exprs, x => x.mapKey(callback)));\n }\n}\n\nexport class QueryComparisonExpression extends QueryExpression {\n\n type: typeof TComparisonKeys[number];\n left: QueryExpression;\n right: QueryExpression;\n\n constructor(type: typeof TComparisonKeys[number], left: QueryExpression, right: QueryExpression) {\n super();\n this.type = type;\n this.left = left;\n this.right = right;\n }\n\n simplify() {\n return new QueryComparisonExpression(this.type, this.left.simplify(), this.right.simplify());\n }\n\n keyPaths(): string[] {\n return _.uniq([\n ...this.left.keyPaths(),\n ...this.right.keyPaths(),\n ]);\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryComparisonExpression(this.type, this.left.mapKey(callback), this.right.mapKey(callback));\n }\n}\n\nexport class QueryNotExpression extends QueryExpression {\n\n expr: QueryExpression;\n\n constructor(expr: QueryExpression) {\n super();\n this.expr = expr;\n }\n\n simplify() {\n return new QueryNotExpression(this.expr.simplify());\n }\n\n keyPaths(): string[] {\n return this.expr.keyPaths();\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryNotExpression(this.expr.mapKey(callback));\n }\n}\n\nexport class QueryArrayExpression extends QueryExpression {\n\n exprs: QueryExpression[];\n\n constructor(exprs: QueryExpression[]) {\n super();\n this.exprs = exprs;\n }\n\n simplify() {\n return new QueryArrayExpression(_.map(this.exprs, x => x.simplify())) as QueryExpression;\n }\n\n keyPaths(): string[] {\n return _.uniq(_.flatMap(this.exprs, x => x.keyPaths()));\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryArrayExpression(_.map(this.exprs, x => x.mapKey(callback)));\n }\n}\n\nexport class QueryDistanceExpression extends QueryExpression {\n\n type: typeof TDistanceKeys[number];\n left: QueryExpression[];\n right: QueryExpression[];\n\n constructor(type: typeof TDistanceKeys[number], left: QueryExpression[], right: QueryExpression[]) {\n super();\n this.type = type;\n this.left = left;\n this.right = right;\n }\n\n simplify() {\n return new QueryDistanceExpression(this.type, _.map(this.left, x => x.simplify()), _.map(this.right, x => x.simplify()));\n }\n\n keyPaths(): string[] {\n return _.uniq([\n ..._.flatMap(this.left, x => x.keyPaths()),\n ..._.flatMap(this.right, x => x.keyPaths()),\n ]);\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryDistanceExpression(this.type, _.map(this.left, x => x.mapKey(callback)), _.map(this.right, x => x.mapKey(callback)));\n }\n}\n\nexport class QueryKeyExpression extends QueryExpression {\n\n key: string;\n\n constructor(key: string) {\n super();\n this.key = key;\n }\n\n keyPaths(): string[] {\n return this.key === '$' ? [] : [this.key];\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryKeyExpression(callback(this.key));\n }\n}\n\nexport class QueryValueExpression extends QueryExpression {\n\n value: TValue;\n\n constructor(value: TValue) {\n super();\n this.value = value;\n }\n}\n","//\n// selectors.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { TValue } from '../../types';\nimport { TBooleanExpression } from './expressions';\nimport { TConditionalKeys, TValueListKeys, TValueSetKeys, TComparisonKeys } from './keys';\n\nexport const allFieldQueryKeys = [\n '$not', '$pattern', '$starts', '$ends', '$size', '$empty', '$every', '$some',\n ...TConditionalKeys,\n ...TValueListKeys,\n ...TValueSetKeys\n];\n\ntype TThisQuerySelector = { $?: TFieldQuerySelector; };\n\nexport type TFieldQuerySelector = {\n $not?: TFieldQuerySelector;\n $starts?: string;\n $ends?: string;\n $pattern?: RegExp | string;\n $size?: number;\n $empty?: boolean;\n $every?: TQuerySelector | TThisQuerySelector;\n $some?: TQuerySelector | TThisQuerySelector;\n} & {\n [x in (typeof TComparisonKeys)[number]]?: TValue;\n } & {\n [x in (typeof TValueListKeys)[number]]?: TValue[];\n } & {\n [x in (typeof TValueSetKeys)[number]]?: TValue[];\n };\n\nexport type TCoditionalQuerySelector = {\n [x in (typeof TConditionalKeys)[number]]?: TQuerySelector[];\n};\n\nexport type TQuerySelector = TCoditionalQuerySelector & {\n $expr?: TBooleanExpression\n} | {\n [x: string]: TFieldQuerySelector;\n};\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { QueryExpression } from './expressions';\nimport { TFieldQuerySelector, TQuerySelector, allFieldQueryKeys } from '../../../../internals/query/types/selectors';\nimport { TComparisonKeys, TConditionalKeys, TValueListKeys, TValueSetKeys } from '../../../../internals/query/types/keys';\nimport { isValue } from '../../../../internals/object';\nimport { TValue } from '../../../../internals/types';\n\nexport class QuerySelector {\n\n static decode(selectors: _.Many<TQuerySelector>, dollerSign: boolean = false): QuerySelector {\n const exprs: QuerySelector[] = [];\n for (const selector of _.castArray(selectors)) {\n for (const [key, query] of _.toPairs(selector)) {\n if (_.includes(TConditionalKeys, key) && _.isArray(query)) {\n exprs.push(new QueryCoditionalSelector(key as any, _.map(query, x => QuerySelector.decode(x, dollerSign))));\n } else if (key === '$expr') {\n exprs.push(new QueryExpressionSelector(QueryExpression.decode(query as any, dollerSign)));\n } else if (dollerSign && key === '$' && !_.isArray(query)) {\n exprs.push(new QueryFieldSelector(key, FieldSelectorExpression.decode(query)));\n } else if (!key.startsWith('$') && !_.isArray(query)) {\n exprs.push(new QueryFieldSelector(key, FieldSelectorExpression.decode(query)));\n } else {\n throw Error('Invalid expression');\n }\n }\n }\n if (_.isEmpty(exprs)) return new QuerySelector;\n return (exprs.length === 1 ? exprs[0] : new QueryCoditionalSelector('$and', exprs)).simplify();\n }\n\n simplify(): QuerySelector {\n return this;\n }\n\n keyPaths(): string[] {\n return [];\n }\n}\n\nexport class QueryCoditionalSelector extends QuerySelector {\n\n type: typeof TConditionalKeys[number];\n exprs: QuerySelector[];\n\n constructor(type: typeof TConditionalKeys[number], exprs: QuerySelector[]) {\n super();\n this.type = type;\n this.exprs = exprs;\n }\n\n simplify() {\n if (_.isEmpty(this.exprs)) return new QuerySelector;\n if (this.exprs.length === 1 && this.type !== '$nor') return this.exprs[0];\n switch (this.type) {\n case '$and':\n return new QueryCoditionalSelector(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalSelector && x.type === '$and' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QuerySelector;\n case '$nor':\n case '$or':\n return new QueryCoditionalSelector(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalSelector && x.type === '$or' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QuerySelector;\n }\n }\n\n keyPaths(): string[] {\n return _.uniq(_.flatMap(this.exprs, x => x.keyPaths()));\n }\n}\n\nexport class FieldSelectorExpression {\n\n type: keyof TFieldQuerySelector;\n value: QuerySelector | FieldSelectorExpression | RegExp | TValue;\n\n constructor(type: keyof TFieldQuerySelector, value: QuerySelector | FieldSelectorExpression | RegExp | TValue) {\n this.type = type;\n this.value = value;\n }\n\n static decode(selector: TFieldQuerySelector): FieldSelectorExpression {\n for (const [type, expr] of _.toPairs(selector)) {\n if (_.includes(TComparisonKeys, type)) {\n if (!isValue(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type as any, expr);\n } else if (_.includes(TValueListKeys, type) || _.includes(TValueSetKeys, type)) {\n if (!isValue(expr) || !_.isArray(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type as any, expr);\n } else {\n switch (type) {\n case '$not':\n {\n const _expr = expr ? { ...expr as any } : {};\n const keys = _.keys(_expr);\n if (keys.length !== 1 && !allFieldQueryKeys.includes(keys[0])) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, FieldSelectorExpression.decode(_expr));\n }\n case '$pattern':\n if (!_.isString(expr) && !_.isRegExp(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$starts':\n case '$ends':\n if (!_.isString(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$size':\n if (!_.isNumber(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$empty':\n if (!_.isBoolean(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$every':\n case '$some':\n return new FieldSelectorExpression(type, QuerySelector.decode(expr ? { ...expr as any } : {}, true));\n default: throw Error('Invalid expression');\n }\n }\n }\n throw Error('Invalid expression');\n }\n\n simplify(): FieldSelectorExpression {\n if (this.value instanceof QuerySelector) {\n return new FieldSelectorExpression(this.type, this.value.simplify());\n }\n if (this.value instanceof FieldSelectorExpression) {\n return new FieldSelectorExpression(this.type, this.value.simplify());\n }\n return this;\n }\n\n keyPaths(field?: string): string[] {\n let result: string[] = [];\n if (this.value instanceof QuerySelector) {\n result = this.value.keyPaths();\n } else if (this.value instanceof FieldSelectorExpression) {\n switch (this.type) {\n case '$every':\n case '$some':\n result = this.value.keyPaths();\n default:\n result = this.value.keyPaths();\n }\n }\n return field ? result.map(x => `${field}.${x}`) : result;\n }\n}\n\nexport class QueryFieldSelector extends QuerySelector {\n\n field: string;\n expr: FieldSelectorExpression;\n\n constructor(field: string, expr: FieldSelectorExpression) {\n super();\n this.field = field;\n this.expr = expr;\n }\n\n simplify() {\n return new QueryFieldSelector(this.field, this.expr.simplify());\n }\n\n keyPaths(): string[] {\n return this.field === '$' ? this.expr.keyPaths() : [this.field, ...this.expr.keyPaths(this.field)];\n }\n}\n\nexport class QueryExpressionSelector extends QuerySelector {\n\n expr: QueryExpression;\n\n constructor(expr: QueryExpression) {\n super();\n this.expr = expr;\n }\n\n simplify() {\n return new QueryExpressionSelector(this.expr.simplify());\n }\n\n keyPaths(): string[] {\n return this.expr.keyPaths();\n }\n}\n"],"names":["isValue"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,GAAG,CAAC,CAAC,IAAI,CAAG,EAAA,KAAK,IAAI,CAAC,CAAA,CAAE,CAAC,GAAG,MAAM;;AAE3D;AAEK,MAAO,kBAAmB,SAAQ,aAAa,CAAA;AAEnD,IAAA,KAAK;AACL,IAAA,IAAI;IAEJ,WAAY,CAAA,KAAa,EAAE,IAA6B,EAAA;AACtD,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;IAGlB,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;;IAGjE,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,KAAK,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;AAErG;AAEK,MAAO,uBAAwB,SAAQ,aAAa,CAAA;AAExD,IAAA,IAAI;AAEJ,IAAA,WAAA,CAAY,IAAqB,EAAA;AAC/B,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;IAGlB,QAAQ,GAAA;QACN,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;;IAG1D,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;;AAE9B;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index-Dc3V_Bzw.js","sources":["../../../src/internals/query/types/keys.ts","../../../src/server/query/dispatcher/parser/expressions.ts","../../../src/internals/query/types/selectors.ts","../../../src/server/query/dispatcher/parser/index.ts"],"sourcesContent":["//\n// keys.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nexport const TComparisonKeys = [\n '$eq',\n '$gt',\n '$gte',\n '$lt',\n '$lte',\n '$ne',\n] as const;\n\nexport const TValueListKeys = [\n '$in',\n '$nin',\n] as const;\n\nexport const TValueSetKeys = [\n '$subset',\n '$superset',\n '$intersect',\n] as const;\n\nexport const TConditionalKeys = [\n '$and',\n '$nor',\n '$or',\n] as const;\n\nexport const TDistanceKeys = [\n '$distance',\n '$innerProduct',\n '$negInnerProduct',\n '$cosineDistance',\n '$rectilinearDistance',\n] as const;\n","//\n// expressions.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { TExpression } from '../../../../internals/query/types/expressions';\nimport { TComparisonKeys, TConditionalKeys, TDistanceKeys } from '../../../../internals/query/types/keys';\nimport { isValue } from '../../../../internals/object';\nimport { TValue } from '../../../../internals/types';\n\nexport class QueryExpression {\n\n static decode(expr: _.Many<TExpression>, dollerSign: boolean): QueryExpression {\n const exprs: QueryExpression[] = [];\n for (const selector of _.castArray(expr)) {\n for (const [key, query] of _.toPairs(selector)) {\n if (_.includes(TConditionalKeys, key) && _.isArray(query)) {\n exprs.push(new QueryCoditionalExpression(key as any, _.map(query, x => QueryExpression.decode(x as any, dollerSign))));\n } else if (_.includes(TComparisonKeys, key) && _.isArray(query) && query.length === 2) {\n const [left, right] = query;\n exprs.push(new QueryComparisonExpression(key as any, QueryExpression.decode(left as any, dollerSign), QueryExpression.decode(right as any, dollerSign)));\n } else if (_.includes(TDistanceKeys, key) && _.isArray(query) && query.length === 2) {\n const [left, right] = query;\n const _left = _.isArray(left) ? _.map(left, x => QueryExpression.decode(x as any, dollerSign)) : QueryExpression.decode(left as any, dollerSign);\n const _right = _.isArray(right) ? _.map(right, x => QueryExpression.decode(x as any, dollerSign)) : QueryExpression.decode(right as any, dollerSign);\n exprs.push(new QueryDistanceExpression(key as any, _.castArray(_left), _.castArray(_right)));\n } else if (key === '$not') {\n exprs.push(new QueryNotExpression(QueryExpression.decode(query as any, dollerSign)));\n } else if (key === '$array' && _.isArray(query)) {\n exprs.push(new QueryArrayExpression(_.map(query, x => QueryExpression.decode(x as any, dollerSign))));\n } else if (key === '$key' && _.isString(query)) {\n if (dollerSign && query === '$') {\n exprs.push(new QueryKeyExpression(query));\n } else if (!query.startsWith('$')) {\n exprs.push(new QueryKeyExpression(query));\n } else {\n throw Error('Invalid expression');\n }\n } else if (key === '$value' && isValue(query)) {\n exprs.push(new QueryValueExpression(query));\n } else {\n throw Error('Invalid expression');\n }\n }\n }\n if (_.isEmpty(exprs)) return new QueryExpression;\n return (exprs.length === 1 ? exprs[0] : new QueryCoditionalExpression('$and', exprs)).simplify();\n }\n\n simplify(): QueryExpression {\n return this;\n }\n\n keyPaths(): string[] {\n return [];\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return this;\n }\n}\n\nexport class QueryCoditionalExpression extends QueryExpression {\n\n type: typeof TConditionalKeys[number];\n exprs: QueryExpression[];\n\n constructor(type: typeof TConditionalKeys[number], exprs: QueryExpression[]) {\n super();\n this.type = type;\n this.exprs = exprs;\n }\n\n simplify() {\n if (_.isEmpty(this.exprs)) return new QueryExpression;\n if (this.exprs.length === 1 && this.type !== '$nor') return this.exprs[0];\n switch (this.type) {\n case '$and':\n return new QueryCoditionalExpression(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalExpression && x.type === '$and' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QueryExpression;\n case '$nor':\n case '$or':\n return new QueryCoditionalExpression(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalExpression && x.type === '$or' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QueryExpression;\n }\n }\n\n keyPaths(): string[] {\n return _.uniq(_.flatMap(this.exprs, x => x.keyPaths()));\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryCoditionalExpression(this.type, _.map(this.exprs, x => x.mapKey(callback)));\n }\n}\n\nexport class QueryComparisonExpression extends QueryExpression {\n\n type: typeof TComparisonKeys[number];\n left: QueryExpression;\n right: QueryExpression;\n\n constructor(type: typeof TComparisonKeys[number], left: QueryExpression, right: QueryExpression) {\n super();\n this.type = type;\n this.left = left;\n this.right = right;\n }\n\n simplify() {\n return new QueryComparisonExpression(this.type, this.left.simplify(), this.right.simplify());\n }\n\n keyPaths(): string[] {\n return _.uniq([\n ...this.left.keyPaths(),\n ...this.right.keyPaths(),\n ]);\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryComparisonExpression(this.type, this.left.mapKey(callback), this.right.mapKey(callback));\n }\n}\n\nexport class QueryNotExpression extends QueryExpression {\n\n expr: QueryExpression;\n\n constructor(expr: QueryExpression) {\n super();\n this.expr = expr;\n }\n\n simplify() {\n return new QueryNotExpression(this.expr.simplify());\n }\n\n keyPaths(): string[] {\n return this.expr.keyPaths();\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryNotExpression(this.expr.mapKey(callback));\n }\n}\n\nexport class QueryArrayExpression extends QueryExpression {\n\n exprs: QueryExpression[];\n\n constructor(exprs: QueryExpression[]) {\n super();\n this.exprs = exprs;\n }\n\n simplify() {\n return new QueryArrayExpression(_.map(this.exprs, x => x.simplify())) as QueryExpression;\n }\n\n keyPaths(): string[] {\n return _.uniq(_.flatMap(this.exprs, x => x.keyPaths()));\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryArrayExpression(_.map(this.exprs, x => x.mapKey(callback)));\n }\n}\n\nexport class QueryDistanceExpression extends QueryExpression {\n\n type: typeof TDistanceKeys[number];\n left: QueryExpression[];\n right: QueryExpression[];\n\n constructor(type: typeof TDistanceKeys[number], left: QueryExpression[], right: QueryExpression[]) {\n super();\n this.type = type;\n this.left = left;\n this.right = right;\n }\n\n simplify() {\n return new QueryDistanceExpression(this.type, _.map(this.left, x => x.simplify()), _.map(this.right, x => x.simplify()));\n }\n\n keyPaths(): string[] {\n return _.uniq([\n ..._.flatMap(this.left, x => x.keyPaths()),\n ..._.flatMap(this.right, x => x.keyPaths()),\n ]);\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryDistanceExpression(this.type, _.map(this.left, x => x.mapKey(callback)), _.map(this.right, x => x.mapKey(callback)));\n }\n}\n\nexport class QueryKeyExpression extends QueryExpression {\n\n key: string;\n\n constructor(key: string) {\n super();\n this.key = key;\n }\n\n keyPaths(): string[] {\n return this.key === '$' ? [] : [this.key];\n }\n\n mapKey(callback: (key: string) => string): QueryExpression {\n return new QueryKeyExpression(callback(this.key));\n }\n}\n\nexport class QueryValueExpression extends QueryExpression {\n\n value: TValue;\n\n constructor(value: TValue) {\n super();\n this.value = value;\n }\n}\n","//\n// selectors.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { TValue } from '../../types';\nimport { TBooleanExpression } from './expressions';\nimport { TConditionalKeys, TValueListKeys, TValueSetKeys, TComparisonKeys } from './keys';\n\nexport const allFieldQueryKeys = [\n '$not', '$pattern', '$starts', '$ends', '$size', '$empty', '$every', '$some',\n ...TConditionalKeys,\n ...TValueListKeys,\n ...TValueSetKeys\n];\n\ntype TThisQuerySelector = { $?: TFieldQuerySelector; };\n\nexport type TFieldQuerySelector = {\n $not?: TFieldQuerySelector;\n $starts?: string;\n $ends?: string;\n $pattern?: RegExp | string;\n $size?: number;\n $empty?: boolean;\n $every?: TQuerySelector | TThisQuerySelector;\n $some?: TQuerySelector | TThisQuerySelector;\n} & {\n [x in (typeof TComparisonKeys)[number]]?: TValue;\n } & {\n [x in (typeof TValueListKeys)[number]]?: TValue[];\n } & {\n [x in (typeof TValueSetKeys)[number]]?: TValue[];\n };\n\nexport type TCoditionalQuerySelector = {\n [x in (typeof TConditionalKeys)[number]]?: TQuerySelector[];\n};\n\nexport type TQuerySelector = TCoditionalQuerySelector & {\n $expr?: TBooleanExpression\n} | {\n [x: string]: TFieldQuerySelector;\n};\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2024 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { QueryExpression } from './expressions';\nimport { TFieldQuerySelector, TQuerySelector, allFieldQueryKeys } from '../../../../internals/query/types/selectors';\nimport { TComparisonKeys, TConditionalKeys, TValueListKeys, TValueSetKeys } from '../../../../internals/query/types/keys';\nimport { isValue } from '../../../../internals/object';\nimport { TValue } from '../../../../internals/types';\n\nexport class QuerySelector {\n\n static decode(selectors: _.Many<TQuerySelector>, dollerSign: boolean = false): QuerySelector {\n const exprs: QuerySelector[] = [];\n for (const selector of _.castArray(selectors)) {\n for (const [key, query] of _.toPairs(selector)) {\n if (_.includes(TConditionalKeys, key) && _.isArray(query)) {\n exprs.push(new QueryCoditionalSelector(key as any, _.map(query, x => QuerySelector.decode(x, dollerSign))));\n } else if (key === '$expr') {\n exprs.push(new QueryExpressionSelector(QueryExpression.decode(query as any, dollerSign)));\n } else if (dollerSign && key === '$' && !_.isArray(query)) {\n exprs.push(new QueryFieldSelector(key, FieldSelectorExpression.decode(query)));\n } else if (!key.startsWith('$') && !_.isArray(query)) {\n exprs.push(new QueryFieldSelector(key, FieldSelectorExpression.decode(query)));\n } else {\n throw Error('Invalid expression');\n }\n }\n }\n if (_.isEmpty(exprs)) return new QuerySelector;\n return (exprs.length === 1 ? exprs[0] : new QueryCoditionalSelector('$and', exprs)).simplify();\n }\n\n simplify(): QuerySelector {\n return this;\n }\n\n keyPaths(): string[] {\n return [];\n }\n}\n\nexport class QueryCoditionalSelector extends QuerySelector {\n\n type: typeof TConditionalKeys[number];\n exprs: QuerySelector[];\n\n constructor(type: typeof TConditionalKeys[number], exprs: QuerySelector[]) {\n super();\n this.type = type;\n this.exprs = exprs;\n }\n\n simplify() {\n if (_.isEmpty(this.exprs)) return new QuerySelector;\n if (this.exprs.length === 1 && this.type !== '$nor') return this.exprs[0];\n switch (this.type) {\n case '$and':\n return new QueryCoditionalSelector(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalSelector && x.type === '$and' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QuerySelector;\n case '$nor':\n case '$or':\n return new QueryCoditionalSelector(this.type, _.flatMap(\n this.exprs, x => x instanceof QueryCoditionalSelector && x.type === '$or' ? _.map(x.exprs, y => y.simplify()) : [x.simplify()]\n )) as QuerySelector;\n }\n }\n\n keyPaths(): string[] {\n return _.uniq(_.flatMap(this.exprs, x => x.keyPaths()));\n }\n}\n\nexport class FieldSelectorExpression {\n\n type: keyof TFieldQuerySelector;\n value: QuerySelector | FieldSelectorExpression | RegExp | TValue;\n\n constructor(type: keyof TFieldQuerySelector, value: QuerySelector | FieldSelectorExpression | RegExp | TValue) {\n this.type = type;\n this.value = value;\n }\n\n static decode(selector: TFieldQuerySelector): FieldSelectorExpression {\n for (const [type, expr] of _.toPairs(selector)) {\n if (_.includes(TComparisonKeys, type)) {\n if (!isValue(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type as any, expr);\n } else if (_.includes(TValueListKeys, type) || _.includes(TValueSetKeys, type)) {\n if (!isValue(expr) || !_.isArray(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type as any, expr);\n } else {\n switch (type) {\n case '$not':\n {\n const _expr = expr ? { ...expr as any } : {};\n const keys = _.keys(_expr);\n if (keys.length !== 1 && !allFieldQueryKeys.includes(keys[0])) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, FieldSelectorExpression.decode(_expr));\n }\n case '$pattern':\n if (!_.isString(expr) && !_.isRegExp(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$starts':\n case '$ends':\n if (!_.isString(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$size':\n if (!_.isNumber(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$empty':\n if (!_.isBoolean(expr)) throw Error('Invalid expression');\n return new FieldSelectorExpression(type, expr);\n case '$every':\n case '$some':\n return new FieldSelectorExpression(type, QuerySelector.decode(expr ? { ...expr as any } : {}, true));\n default: throw Error('Invalid expression');\n }\n }\n }\n throw Error('Invalid expression');\n }\n\n simplify(): FieldSelectorExpression {\n if (this.value instanceof QuerySelector) {\n return new FieldSelectorExpression(this.type, this.value.simplify());\n }\n if (this.value instanceof FieldSelectorExpression) {\n return new FieldSelectorExpression(this.type, this.value.simplify());\n }\n return this;\n }\n\n keyPaths(field?: string): string[] {\n let result: string[] = [];\n if (this.value instanceof QuerySelector) {\n result = this.value.keyPaths();\n } else if (this.value instanceof FieldSelectorExpression) {\n switch (this.type) {\n case '$every':\n case '$some':\n result = this.value.keyPaths();\n default:\n result = this.value.keyPaths();\n }\n }\n return field ? result.map(x => `${field}.${x}`) : result;\n }\n}\n\nexport class QueryFieldSelector extends QuerySelector {\n\n field: string;\n expr: FieldSelectorExpression;\n\n constructor(field: string, expr: FieldSelectorExpression) {\n super();\n this.field = field;\n this.expr = expr;\n }\n\n simplify() {\n return new QueryFieldSelector(this.field, this.expr.simplify());\n }\n\n keyPaths(): string[] {\n return this.field === '$' ? this.expr.keyPaths() : [this.field, ...this.expr.keyPaths(this.field)];\n }\n}\n\nexport class QueryExpressionSelector extends QuerySelector {\n\n expr: QueryExpression;\n\n constructor(expr: QueryExpression) {\n super();\n this.expr = expr;\n }\n\n simplify() {\n return new QueryExpressionSelector(this.expr.simplify());\n }\n\n keyPaths(): string[] {\n return this.expr.keyPaths();\n }\n}\n"],"names":["isValue"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAM,eAAe,GAAG;IAC7B,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;CACG;AA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