@peerbit/indexer-interface 2.0.14 → 2.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.
- package/dist/src/id.js +295 -149
- package/dist/src/id.js.map +1 -1
- package/dist/src/query.d.ts.map +1 -1
- package/dist/src/query.js +468 -261
- package/dist/src/query.js.map +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +37 -4
- package/dist/src/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/query.ts +0 -1
- package/src/utils.ts +62 -4
package/dist/src/query.js
CHANGED
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
6
27
|
};
|
|
7
|
-
var
|
|
8
|
-
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
9
34
|
};
|
|
10
35
|
import { deserialize, field, serialize, variant, vec } from "@dao-xyz/borsh";
|
|
11
36
|
import { toBase64 } from "@peerbit/crypto";
|
|
@@ -49,41 +74,55 @@ export var SortDirection;
|
|
|
49
74
|
SortDirection[SortDirection["ASC"] = 0] = "ASC";
|
|
50
75
|
SortDirection[SortDirection["DESC"] = 1] = "DESC";
|
|
51
76
|
})(SortDirection || (SortDirection = {}));
|
|
52
|
-
let Sort =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
let Sort = (() => {
|
|
78
|
+
let _classDecorators = [variant(0)];
|
|
79
|
+
let _classDescriptor;
|
|
80
|
+
let _classExtraInitializers = [];
|
|
81
|
+
let _classThis;
|
|
82
|
+
let _key_decorators;
|
|
83
|
+
let _key_initializers = [];
|
|
84
|
+
let _key_extraInitializers = [];
|
|
85
|
+
let _direction_decorators;
|
|
86
|
+
let _direction_initializers = [];
|
|
87
|
+
let _direction_extraInitializers = [];
|
|
88
|
+
var Sort = class {
|
|
89
|
+
static { _classThis = this; }
|
|
90
|
+
static {
|
|
91
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
92
|
+
_key_decorators = [field({ type: vec("string") })];
|
|
93
|
+
_direction_decorators = [field({ type: "u8" })];
|
|
94
|
+
__esDecorate(null, null, _key_decorators, { kind: "field", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
95
|
+
__esDecorate(null, null, _direction_decorators, { kind: "field", name: "direction", static: false, private: false, access: { has: obj => "direction" in obj, get: obj => obj.direction, set: (obj, value) => { obj.direction = value; } }, metadata: _metadata }, _direction_initializers, _direction_extraInitializers);
|
|
96
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
97
|
+
Sort = _classThis = _classDescriptor.value;
|
|
98
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
99
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
100
|
+
}
|
|
101
|
+
key = __runInitializers(this, _key_initializers, void 0);
|
|
102
|
+
direction = (__runInitializers(this, _key_extraInitializers), __runInitializers(this, _direction_initializers, void 0));
|
|
103
|
+
constructor(properties) {
|
|
104
|
+
__runInitializers(this, _direction_extraInitializers);
|
|
105
|
+
this.key = Array.isArray(properties.key)
|
|
106
|
+
? properties.key
|
|
107
|
+
: [properties.key];
|
|
108
|
+
if (properties.direction) {
|
|
109
|
+
if (properties.direction === "asc") {
|
|
110
|
+
this.direction = SortDirection.ASC;
|
|
111
|
+
}
|
|
112
|
+
else if (properties.direction === "desc") {
|
|
113
|
+
this.direction = SortDirection.DESC;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.direction = properties.direction;
|
|
117
|
+
}
|
|
65
118
|
}
|
|
66
119
|
else {
|
|
67
|
-
this.direction =
|
|
120
|
+
this.direction = SortDirection.ASC;
|
|
68
121
|
}
|
|
69
122
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
__decorate([
|
|
76
|
-
field({ type: vec("string") }),
|
|
77
|
-
__metadata("design:type", Array)
|
|
78
|
-
], Sort.prototype, "key", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
field({ type: "u8" }),
|
|
81
|
-
__metadata("design:type", Number)
|
|
82
|
-
], Sort.prototype, "direction", void 0);
|
|
83
|
-
Sort = __decorate([
|
|
84
|
-
variant(0),
|
|
85
|
-
__metadata("design:paramtypes", [Object])
|
|
86
|
-
], Sort);
|
|
123
|
+
};
|
|
124
|
+
return Sort = _classThis;
|
|
125
|
+
})();
|
|
87
126
|
export { Sort };
|
|
88
127
|
export const toSort = (sort) => {
|
|
89
128
|
if (!sort) {
|
|
@@ -102,118 +141,212 @@ export const toSort = (sort) => {
|
|
|
102
141
|
}
|
|
103
142
|
return [new Sort({ key: sort.key, direction: sort.direction })];
|
|
104
143
|
};
|
|
105
|
-
let LogicalQuery =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
144
|
+
let LogicalQuery = (() => {
|
|
145
|
+
let _classDecorators = [variant(1)];
|
|
146
|
+
let _classDescriptor;
|
|
147
|
+
let _classExtraInitializers = [];
|
|
148
|
+
let _classThis;
|
|
149
|
+
let _classSuper = Query;
|
|
150
|
+
var LogicalQuery = class extends _classSuper {
|
|
151
|
+
static { _classThis = this; }
|
|
152
|
+
static {
|
|
153
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
154
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
155
|
+
LogicalQuery = _classThis = _classDescriptor.value;
|
|
156
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
157
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
return LogicalQuery = _classThis;
|
|
161
|
+
})();
|
|
110
162
|
export { LogicalQuery };
|
|
111
|
-
let And =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
163
|
+
let And = (() => {
|
|
164
|
+
let _classDecorators = [variant(0)];
|
|
165
|
+
let _classDescriptor;
|
|
166
|
+
let _classExtraInitializers = [];
|
|
167
|
+
let _classThis;
|
|
168
|
+
let _classSuper = LogicalQuery;
|
|
169
|
+
let _and_decorators;
|
|
170
|
+
let _and_initializers = [];
|
|
171
|
+
let _and_extraInitializers = [];
|
|
172
|
+
var And = class extends _classSuper {
|
|
173
|
+
static { _classThis = this; }
|
|
174
|
+
static {
|
|
175
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
176
|
+
_and_decorators = [field({ type: vec(Query) })];
|
|
177
|
+
__esDecorate(null, null, _and_decorators, { kind: "field", name: "and", static: false, private: false, access: { has: obj => "and" in obj, get: obj => obj.and, set: (obj, value) => { obj.and = value; } }, metadata: _metadata }, _and_initializers, _and_extraInitializers);
|
|
178
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
179
|
+
And = _classThis = _classDescriptor.value;
|
|
180
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
181
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
118
182
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
And
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
183
|
+
and = __runInitializers(this, _and_initializers, void 0);
|
|
184
|
+
constructor(and) {
|
|
185
|
+
super();
|
|
186
|
+
__runInitializers(this, _and_extraInitializers);
|
|
187
|
+
this.and = and;
|
|
188
|
+
if (this.and.length === 0) {
|
|
189
|
+
throw new Error("And query must have at least one query");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
return And = _classThis;
|
|
194
|
+
})();
|
|
129
195
|
export { And };
|
|
130
|
-
let Or =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
196
|
+
let Or = (() => {
|
|
197
|
+
let _classDecorators = [variant(1)];
|
|
198
|
+
let _classDescriptor;
|
|
199
|
+
let _classExtraInitializers = [];
|
|
200
|
+
let _classThis;
|
|
201
|
+
let _classSuper = LogicalQuery;
|
|
202
|
+
let _or_decorators;
|
|
203
|
+
let _or_initializers = [];
|
|
204
|
+
let _or_extraInitializers = [];
|
|
205
|
+
var Or = class extends _classSuper {
|
|
206
|
+
static { _classThis = this; }
|
|
207
|
+
static {
|
|
208
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
209
|
+
_or_decorators = [field({ type: vec(Query) })];
|
|
210
|
+
__esDecorate(null, null, _or_decorators, { kind: "field", name: "or", static: false, private: false, access: { has: obj => "or" in obj, get: obj => obj.or, set: (obj, value) => { obj.or = value; } }, metadata: _metadata }, _or_initializers, _or_extraInitializers);
|
|
211
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
212
|
+
Or = _classThis = _classDescriptor.value;
|
|
213
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
214
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
137
215
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Or
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
216
|
+
or = __runInitializers(this, _or_initializers, void 0);
|
|
217
|
+
constructor(or) {
|
|
218
|
+
super();
|
|
219
|
+
__runInitializers(this, _or_extraInitializers);
|
|
220
|
+
this.or = or;
|
|
221
|
+
if (this.or.length === 0) {
|
|
222
|
+
throw new Error("Or query must have at least one query");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
return Or = _classThis;
|
|
227
|
+
})();
|
|
148
228
|
export { Or };
|
|
149
|
-
let Not =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
229
|
+
let Not = (() => {
|
|
230
|
+
let _classDecorators = [variant(2)];
|
|
231
|
+
let _classDescriptor;
|
|
232
|
+
let _classExtraInitializers = [];
|
|
233
|
+
let _classThis;
|
|
234
|
+
let _classSuper = LogicalQuery;
|
|
235
|
+
let _not_decorators;
|
|
236
|
+
let _not_initializers = [];
|
|
237
|
+
let _not_extraInitializers = [];
|
|
238
|
+
var Not = class extends _classSuper {
|
|
239
|
+
static { _classThis = this; }
|
|
240
|
+
static {
|
|
241
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
242
|
+
_not_decorators = [field({ type: Query })];
|
|
243
|
+
__esDecorate(null, null, _not_decorators, { kind: "field", name: "not", static: false, private: false, access: { has: obj => "not" in obj, get: obj => obj.not, set: (obj, value) => { obj.not = value; } }, metadata: _metadata }, _not_initializers, _not_extraInitializers);
|
|
244
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
245
|
+
Not = _classThis = _classDescriptor.value;
|
|
246
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
247
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
248
|
+
}
|
|
249
|
+
not = __runInitializers(this, _not_initializers, void 0);
|
|
250
|
+
constructor(not) {
|
|
251
|
+
super();
|
|
252
|
+
__runInitializers(this, _not_extraInitializers);
|
|
253
|
+
this.not = not;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
return Not = _classThis;
|
|
257
|
+
})();
|
|
164
258
|
export { Not };
|
|
165
|
-
let StateQuery =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
259
|
+
let StateQuery = (() => {
|
|
260
|
+
let _classDecorators = [variant(2)];
|
|
261
|
+
let _classDescriptor;
|
|
262
|
+
let _classExtraInitializers = [];
|
|
263
|
+
let _classThis;
|
|
264
|
+
let _classSuper = Query;
|
|
265
|
+
var StateQuery = class extends _classSuper {
|
|
266
|
+
static { _classThis = this; }
|
|
267
|
+
static {
|
|
268
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
269
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
270
|
+
StateQuery = _classThis = _classDescriptor.value;
|
|
271
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
272
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
return StateQuery = _classThis;
|
|
276
|
+
})();
|
|
170
277
|
export { StateQuery };
|
|
171
|
-
let StateFieldQuery =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
278
|
+
let StateFieldQuery = (() => {
|
|
279
|
+
let _classDecorators = [variant(1)];
|
|
280
|
+
let _classDescriptor;
|
|
281
|
+
let _classExtraInitializers = [];
|
|
282
|
+
let _classThis;
|
|
283
|
+
let _classSuper = StateQuery;
|
|
284
|
+
let _key_decorators;
|
|
285
|
+
let _key_initializers = [];
|
|
286
|
+
let _key_extraInitializers = [];
|
|
287
|
+
var StateFieldQuery = class extends _classSuper {
|
|
288
|
+
static { _classThis = this; }
|
|
289
|
+
static {
|
|
290
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
291
|
+
_key_decorators = [field({ type: vec("string") })];
|
|
292
|
+
__esDecorate(null, null, _key_decorators, { kind: "field", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
293
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
294
|
+
StateFieldQuery = _classThis = _classDescriptor.value;
|
|
295
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
296
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
297
|
+
}
|
|
298
|
+
key = __runInitializers(this, _key_initializers, void 0);
|
|
299
|
+
constructor(props) {
|
|
300
|
+
super();
|
|
301
|
+
__runInitializers(this, _key_extraInitializers);
|
|
302
|
+
this.key = Array.isArray(props.key) ? props.key : [props.key];
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
return StateFieldQuery = _classThis;
|
|
306
|
+
})();
|
|
186
307
|
export { StateFieldQuery };
|
|
187
|
-
let ByteMatchQuery =
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
308
|
+
let ByteMatchQuery = (() => {
|
|
309
|
+
let _classDecorators = [variant(1)];
|
|
310
|
+
let _classDescriptor;
|
|
311
|
+
let _classExtraInitializers = [];
|
|
312
|
+
let _classThis;
|
|
313
|
+
let _classSuper = StateFieldQuery;
|
|
314
|
+
let _value_decorators;
|
|
315
|
+
let _value_initializers = [];
|
|
316
|
+
let _value_extraInitializers = [];
|
|
317
|
+
let __reserved_decorators;
|
|
318
|
+
let __reserved_initializers = [];
|
|
319
|
+
let __reserved_extraInitializers = [];
|
|
320
|
+
var ByteMatchQuery = class extends _classSuper {
|
|
321
|
+
static { _classThis = this; }
|
|
322
|
+
static {
|
|
323
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
324
|
+
_value_decorators = [field({ type: Uint8Array })];
|
|
325
|
+
__reserved_decorators = [field({ type: "u8" })];
|
|
326
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
327
|
+
__esDecorate(null, null, __reserved_decorators, { kind: "field", name: "_reserved", static: false, private: false, access: { has: obj => "_reserved" in obj, get: obj => obj._reserved, set: (obj, value) => { obj._reserved = value; } }, metadata: _metadata }, __reserved_initializers, __reserved_extraInitializers);
|
|
328
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
329
|
+
ByteMatchQuery = _classThis = _classDescriptor.value;
|
|
330
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
331
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
332
|
+
}
|
|
333
|
+
value = __runInitializers(this, _value_initializers, void 0);
|
|
334
|
+
_reserved = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, __reserved_initializers, void 0)); // Replicate MemoryCompare query with this?
|
|
335
|
+
constructor(props) {
|
|
336
|
+
super(props);
|
|
337
|
+
this.value = props.value;
|
|
338
|
+
this._reserved = 0;
|
|
339
|
+
}
|
|
340
|
+
_valueString = __runInitializers(this, __reserved_extraInitializers);
|
|
341
|
+
/**
|
|
342
|
+
* value `asString`
|
|
343
|
+
*/
|
|
344
|
+
get valueString() {
|
|
345
|
+
return this._valueString ?? (this._valueString = toBase64(this.value));
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
return ByteMatchQuery = _classThis;
|
|
349
|
+
})();
|
|
217
350
|
export { ByteMatchQuery };
|
|
218
351
|
export var StringMatchMethod;
|
|
219
352
|
(function (StringMatchMethod) {
|
|
@@ -221,138 +354,212 @@ export var StringMatchMethod;
|
|
|
221
354
|
StringMatchMethod[StringMatchMethod["prefix"] = 1] = "prefix";
|
|
222
355
|
StringMatchMethod[StringMatchMethod["contains"] = 2] = "contains";
|
|
223
356
|
})(StringMatchMethod || (StringMatchMethod = {}));
|
|
224
|
-
let StringMatch =
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
357
|
+
let StringMatch = (() => {
|
|
358
|
+
let _classDecorators = [variant(2)];
|
|
359
|
+
let _classDescriptor;
|
|
360
|
+
let _classExtraInitializers = [];
|
|
361
|
+
let _classThis;
|
|
362
|
+
let _classSuper = StateFieldQuery;
|
|
363
|
+
let _value_decorators;
|
|
364
|
+
let _value_initializers = [];
|
|
365
|
+
let _value_extraInitializers = [];
|
|
366
|
+
let _method_decorators;
|
|
367
|
+
let _method_initializers = [];
|
|
368
|
+
let _method_extraInitializers = [];
|
|
369
|
+
let _caseInsensitive_decorators;
|
|
370
|
+
let _caseInsensitive_initializers = [];
|
|
371
|
+
let _caseInsensitive_extraInitializers = [];
|
|
372
|
+
var StringMatch = class extends _classSuper {
|
|
373
|
+
static { _classThis = this; }
|
|
374
|
+
static {
|
|
375
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
376
|
+
_value_decorators = [field({ type: "string" })];
|
|
377
|
+
_method_decorators = [field({ type: "u8" })];
|
|
378
|
+
_caseInsensitive_decorators = [field({ type: "bool" })];
|
|
379
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
380
|
+
__esDecorate(null, null, _method_decorators, { kind: "field", name: "method", static: false, private: false, access: { has: obj => "method" in obj, get: obj => obj.method, set: (obj, value) => { obj.method = value; } }, metadata: _metadata }, _method_initializers, _method_extraInitializers);
|
|
381
|
+
__esDecorate(null, null, _caseInsensitive_decorators, { kind: "field", name: "caseInsensitive", static: false, private: false, access: { has: obj => "caseInsensitive" in obj, get: obj => obj.caseInsensitive, set: (obj, value) => { obj.caseInsensitive = value; } }, metadata: _metadata }, _caseInsensitive_initializers, _caseInsensitive_extraInitializers);
|
|
382
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
383
|
+
StringMatch = _classThis = _classDescriptor.value;
|
|
384
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
385
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
386
|
+
}
|
|
387
|
+
value = __runInitializers(this, _value_initializers, void 0);
|
|
388
|
+
method = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _method_initializers, void 0));
|
|
389
|
+
caseInsensitive = (__runInitializers(this, _method_extraInitializers), __runInitializers(this, _caseInsensitive_initializers, void 0));
|
|
390
|
+
constructor(props) {
|
|
391
|
+
super(props);
|
|
392
|
+
__runInitializers(this, _caseInsensitive_extraInitializers);
|
|
258
393
|
this.value = props.value;
|
|
394
|
+
this.method = props.method ?? StringMatchMethod.exact;
|
|
395
|
+
this.caseInsensitive = props.caseInsensitive ?? false;
|
|
259
396
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
397
|
+
};
|
|
398
|
+
return StringMatch = _classThis;
|
|
399
|
+
})();
|
|
400
|
+
export { StringMatch };
|
|
401
|
+
let IntegerCompare = (() => {
|
|
402
|
+
let _classDecorators = [variant(3)];
|
|
403
|
+
let _classDescriptor;
|
|
404
|
+
let _classExtraInitializers = [];
|
|
405
|
+
let _classThis;
|
|
406
|
+
let _classSuper = StateFieldQuery;
|
|
407
|
+
let _compare_decorators;
|
|
408
|
+
let _compare_initializers = [];
|
|
409
|
+
let _compare_extraInitializers = [];
|
|
410
|
+
let _value_decorators;
|
|
411
|
+
let _value_initializers = [];
|
|
412
|
+
let _value_extraInitializers = [];
|
|
413
|
+
var IntegerCompare = class extends _classSuper {
|
|
414
|
+
static { _classThis = this; }
|
|
415
|
+
static {
|
|
416
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
417
|
+
_compare_decorators = [field({ type: "u8" })];
|
|
418
|
+
_value_decorators = [field({ type: IntegerValue })];
|
|
419
|
+
__esDecorate(null, null, _compare_decorators, { kind: "field", name: "compare", static: false, private: false, access: { has: obj => "compare" in obj, get: obj => obj.compare, set: (obj, value) => { obj.compare = value; } }, metadata: _metadata }, _compare_initializers, _compare_extraInitializers);
|
|
420
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
421
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
422
|
+
IntegerCompare = _classThis = _classDescriptor.value;
|
|
423
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
424
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
267
425
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
else if (props.compare === "gte") {
|
|
276
|
-
this.compare = Compare.GreaterOrEqual;
|
|
426
|
+
compare = __runInitializers(this, _compare_initializers, void 0);
|
|
427
|
+
value = (__runInitializers(this, _compare_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
428
|
+
constructor(props) {
|
|
429
|
+
super(props);
|
|
430
|
+
__runInitializers(this, _value_extraInitializers);
|
|
431
|
+
if (props.value instanceof IntegerValue) {
|
|
432
|
+
this.value = props.value;
|
|
277
433
|
}
|
|
278
|
-
else
|
|
279
|
-
|
|
434
|
+
else {
|
|
435
|
+
if (typeof props.value === "bigint") {
|
|
436
|
+
this.value = new BigUnsignedIntegerValue(props.value);
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
this.value = new UnsignedIntegerValue(props.value);
|
|
440
|
+
}
|
|
280
441
|
}
|
|
281
|
-
|
|
282
|
-
|
|
442
|
+
if (typeof props.compare === "string") {
|
|
443
|
+
if (props.compare === "eq") {
|
|
444
|
+
this.compare = Compare.Equal;
|
|
445
|
+
}
|
|
446
|
+
else if (props.compare === "gt") {
|
|
447
|
+
this.compare = Compare.Greater;
|
|
448
|
+
}
|
|
449
|
+
else if (props.compare === "gte") {
|
|
450
|
+
this.compare = Compare.GreaterOrEqual;
|
|
451
|
+
}
|
|
452
|
+
else if (props.compare === "lt") {
|
|
453
|
+
this.compare = Compare.Less;
|
|
454
|
+
}
|
|
455
|
+
else if (props.compare === "lte") {
|
|
456
|
+
this.compare = Compare.LessOrEqual;
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
throw new Error("Invalid compare string");
|
|
460
|
+
}
|
|
283
461
|
}
|
|
284
462
|
else {
|
|
285
|
-
|
|
463
|
+
this.compare = props.compare;
|
|
286
464
|
}
|
|
287
465
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
__decorate([
|
|
294
|
-
field({ type: "u8" }),
|
|
295
|
-
__metadata("design:type", Number)
|
|
296
|
-
], IntegerCompare.prototype, "compare", void 0);
|
|
297
|
-
__decorate([
|
|
298
|
-
field({ type: IntegerValue }),
|
|
299
|
-
__metadata("design:type", IntegerValue)
|
|
300
|
-
], IntegerCompare.prototype, "value", void 0);
|
|
301
|
-
IntegerCompare = __decorate([
|
|
302
|
-
variant(3),
|
|
303
|
-
__metadata("design:paramtypes", [Object])
|
|
304
|
-
], IntegerCompare);
|
|
466
|
+
};
|
|
467
|
+
return IntegerCompare = _classThis;
|
|
468
|
+
})();
|
|
305
469
|
export { IntegerCompare };
|
|
306
|
-
let IsNull =
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
470
|
+
let IsNull = (() => {
|
|
471
|
+
let _classDecorators = [variant(4)];
|
|
472
|
+
let _classDescriptor;
|
|
473
|
+
let _classExtraInitializers = [];
|
|
474
|
+
let _classThis;
|
|
475
|
+
let _classSuper = StateFieldQuery;
|
|
476
|
+
var IsNull = class extends _classSuper {
|
|
477
|
+
static { _classThis = this; }
|
|
478
|
+
static {
|
|
479
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
480
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
481
|
+
IsNull = _classThis = _classDescriptor.value;
|
|
482
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
483
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
return IsNull = _classThis;
|
|
487
|
+
})();
|
|
311
488
|
export { IsNull };
|
|
312
|
-
let BoolQuery =
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
489
|
+
let BoolQuery = (() => {
|
|
490
|
+
let _classDecorators = [variant(5)];
|
|
491
|
+
let _classDescriptor;
|
|
492
|
+
let _classExtraInitializers = [];
|
|
493
|
+
let _classThis;
|
|
494
|
+
let _classSuper = StateFieldQuery;
|
|
495
|
+
let _value_decorators;
|
|
496
|
+
let _value_initializers = [];
|
|
497
|
+
let _value_extraInitializers = [];
|
|
498
|
+
var BoolQuery = class extends _classSuper {
|
|
499
|
+
static { _classThis = this; }
|
|
500
|
+
static {
|
|
501
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
502
|
+
_value_decorators = [field({ type: "bool" })];
|
|
503
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
504
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
505
|
+
BoolQuery = _classThis = _classDescriptor.value;
|
|
506
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
507
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
508
|
+
}
|
|
509
|
+
value = __runInitializers(this, _value_initializers, void 0);
|
|
510
|
+
constructor(props) {
|
|
511
|
+
super(props);
|
|
512
|
+
__runInitializers(this, _value_extraInitializers);
|
|
513
|
+
this.value = props.value;
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
return BoolQuery = _classThis;
|
|
517
|
+
})();
|
|
327
518
|
export { BoolQuery };
|
|
328
519
|
// @experimental not supported by all implementations
|
|
329
|
-
let Nested =
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
520
|
+
let Nested = (() => {
|
|
521
|
+
let _classDecorators = [variant(2)];
|
|
522
|
+
let _classDescriptor;
|
|
523
|
+
let _classExtraInitializers = [];
|
|
524
|
+
let _classThis;
|
|
525
|
+
let _classSuper = Query;
|
|
526
|
+
let _id_decorators;
|
|
527
|
+
let _id_initializers = [];
|
|
528
|
+
let _id_extraInitializers = [];
|
|
529
|
+
let _path_decorators;
|
|
530
|
+
let _path_initializers = [];
|
|
531
|
+
let _path_extraInitializers = [];
|
|
532
|
+
let _query_decorators;
|
|
533
|
+
let _query_initializers = [];
|
|
534
|
+
let _query_extraInitializers = [];
|
|
535
|
+
var Nested = class extends _classSuper {
|
|
536
|
+
static { _classThis = this; }
|
|
537
|
+
static {
|
|
538
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
539
|
+
_id_decorators = [field({ type: "string" })];
|
|
540
|
+
_path_decorators = [field({ type: vec("string") })];
|
|
541
|
+
_query_decorators = [field({ type: vec(Query) })];
|
|
542
|
+
__esDecorate(null, null, _id_decorators, { kind: "field", name: "id", static: false, private: false, access: { has: obj => "id" in obj, get: obj => obj.id, set: (obj, value) => { obj.id = value; } }, metadata: _metadata }, _id_initializers, _id_extraInitializers);
|
|
543
|
+
__esDecorate(null, null, _path_decorators, { kind: "field", name: "path", static: false, private: false, access: { has: obj => "path" in obj, get: obj => obj.path, set: (obj, value) => { obj.path = value; } }, metadata: _metadata }, _path_initializers, _path_extraInitializers);
|
|
544
|
+
__esDecorate(null, null, _query_decorators, { kind: "field", name: "query", static: false, private: false, access: { has: obj => "query" in obj, get: obj => obj.query, set: (obj, value) => { obj.query = value; } }, metadata: _metadata }, _query_initializers, _query_extraInitializers);
|
|
545
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
546
|
+
Nested = _classThis = _classDescriptor.value;
|
|
547
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
548
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
549
|
+
}
|
|
550
|
+
id = __runInitializers(this, _id_initializers, void 0);
|
|
551
|
+
path = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _path_initializers, void 0));
|
|
552
|
+
query = (__runInitializers(this, _path_extraInitializers), __runInitializers(this, _query_initializers, void 0));
|
|
553
|
+
constructor(props) {
|
|
554
|
+
super();
|
|
555
|
+
__runInitializers(this, _query_extraInitializers);
|
|
556
|
+
this.path = Array.isArray(props.path) ? props.path : [props.path];
|
|
557
|
+
this.id = props.id ?? uuid();
|
|
558
|
+
this.query = toQuery(props.query);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
return Nested = _classThis;
|
|
562
|
+
})();
|
|
356
563
|
export { Nested };
|
|
357
564
|
export const toQuery = (query) => {
|
|
358
565
|
if (!query) {
|