@peerbit/document-interface 3.0.3-48ac6de → 3.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/LICENSE +202 -0
- package/dist/src/query.js +328 -216
- package/dist/src/query.js.map +1 -1
- package/dist/src/request.d.ts +7 -3
- package/dist/src/request.d.ts.map +1 -1
- package/dist/src/request.js +460 -277
- package/dist/src/request.js.map +1 -1
- package/package.json +10 -10
- package/src/query.ts +1 -1
- package/src/request.ts +15 -5
package/dist/src/query.js
CHANGED
|
@@ -1,241 +1,353 @@
|
|
|
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, variant, vec, } from "@dao-xyz/borsh";
|
|
11
36
|
import { Entry } from "@peerbit/log";
|
|
12
37
|
/// ----- RESULTS -----
|
|
13
38
|
export class Result {
|
|
14
39
|
}
|
|
15
|
-
let Context =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
let Context = (() => {
|
|
41
|
+
let _classDecorators = [variant(0)];
|
|
42
|
+
let _classDescriptor;
|
|
43
|
+
let _classExtraInitializers = [];
|
|
44
|
+
let _classThis;
|
|
45
|
+
let _created_decorators;
|
|
46
|
+
let _created_initializers = [];
|
|
47
|
+
let _created_extraInitializers = [];
|
|
48
|
+
let _modified_decorators;
|
|
49
|
+
let _modified_initializers = [];
|
|
50
|
+
let _modified_extraInitializers = [];
|
|
51
|
+
let _head_decorators;
|
|
52
|
+
let _head_initializers = [];
|
|
53
|
+
let _head_extraInitializers = [];
|
|
54
|
+
let _gid_decorators;
|
|
55
|
+
let _gid_initializers = [];
|
|
56
|
+
let _gid_extraInitializers = [];
|
|
57
|
+
let _size_decorators;
|
|
58
|
+
let _size_initializers = [];
|
|
59
|
+
let _size_extraInitializers = [];
|
|
60
|
+
var Context = class {
|
|
61
|
+
static { _classThis = this; }
|
|
62
|
+
static {
|
|
63
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
64
|
+
_created_decorators = [field({ type: "u64" })];
|
|
65
|
+
_modified_decorators = [field({ type: "u64" })];
|
|
66
|
+
_head_decorators = [field({ type: "string" })];
|
|
67
|
+
_gid_decorators = [field({ type: "string" })];
|
|
68
|
+
_size_decorators = [field({ type: "u32" })];
|
|
69
|
+
__esDecorate(null, null, _created_decorators, { kind: "field", name: "created", static: false, private: false, access: { has: obj => "created" in obj, get: obj => obj.created, set: (obj, value) => { obj.created = value; } }, metadata: _metadata }, _created_initializers, _created_extraInitializers);
|
|
70
|
+
__esDecorate(null, null, _modified_decorators, { kind: "field", name: "modified", static: false, private: false, access: { has: obj => "modified" in obj, get: obj => obj.modified, set: (obj, value) => { obj.modified = value; } }, metadata: _metadata }, _modified_initializers, _modified_extraInitializers);
|
|
71
|
+
__esDecorate(null, null, _head_decorators, { kind: "field", name: "head", static: false, private: false, access: { has: obj => "head" in obj, get: obj => obj.head, set: (obj, value) => { obj.head = value; } }, metadata: _metadata }, _head_initializers, _head_extraInitializers);
|
|
72
|
+
__esDecorate(null, null, _gid_decorators, { kind: "field", name: "gid", static: false, private: false, access: { has: obj => "gid" in obj, get: obj => obj.gid, set: (obj, value) => { obj.gid = value; } }, metadata: _metadata }, _gid_initializers, _gid_extraInitializers);
|
|
73
|
+
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
74
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
75
|
+
Context = _classThis = _classDescriptor.value;
|
|
76
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
77
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
78
|
+
}
|
|
79
|
+
created = __runInitializers(this, _created_initializers, void 0);
|
|
80
|
+
modified = (__runInitializers(this, _created_extraInitializers), __runInitializers(this, _modified_initializers, void 0));
|
|
81
|
+
head = (__runInitializers(this, _modified_extraInitializers), __runInitializers(this, _head_initializers, void 0));
|
|
82
|
+
gid = (__runInitializers(this, _head_extraInitializers), __runInitializers(this, _gid_initializers, void 0));
|
|
83
|
+
size = (__runInitializers(this, _gid_extraInitializers), __runInitializers(this, _size_initializers, void 0)); // bytes, we index this so we can query documents and understand their representation sizes
|
|
84
|
+
constructor(properties) {
|
|
85
|
+
__runInitializers(this, _size_extraInitializers);
|
|
86
|
+
this.created = properties.created;
|
|
87
|
+
this.modified = properties.modified;
|
|
88
|
+
this.head = properties.head;
|
|
89
|
+
this.gid = properties.gid;
|
|
90
|
+
this.size = properties.size;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return Context = _classThis;
|
|
94
|
+
})();
|
|
53
95
|
export { Context };
|
|
54
|
-
let ResultValue =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
96
|
+
let ResultValue = (() => {
|
|
97
|
+
let _classDecorators = [variant(0)];
|
|
98
|
+
let _classDescriptor;
|
|
99
|
+
let _classExtraInitializers = [];
|
|
100
|
+
let _classThis;
|
|
101
|
+
let _classSuper = Result;
|
|
102
|
+
let __source_decorators;
|
|
103
|
+
let __source_initializers = [];
|
|
104
|
+
let __source_extraInitializers = [];
|
|
105
|
+
let _context_decorators;
|
|
106
|
+
let _context_initializers = [];
|
|
107
|
+
let _context_extraInitializers = [];
|
|
108
|
+
var ResultValue = class extends _classSuper {
|
|
109
|
+
static { _classThis = this; }
|
|
110
|
+
static {
|
|
111
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
112
|
+
__source_decorators = [field({ type: Uint8Array })];
|
|
113
|
+
_context_decorators = [field({ type: Context })];
|
|
114
|
+
__esDecorate(null, null, __source_decorators, { kind: "field", name: "_source", static: false, private: false, access: { has: obj => "_source" in obj, get: obj => obj._source, set: (obj, value) => { obj._source = value; } }, metadata: _metadata }, __source_initializers, __source_extraInitializers);
|
|
115
|
+
__esDecorate(null, null, _context_decorators, { kind: "field", name: "context", static: false, private: false, access: { has: obj => "context" in obj, get: obj => obj.context, set: (obj, value) => { obj.context = value; } }, metadata: _metadata }, _context_initializers, _context_extraInitializers);
|
|
116
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
117
|
+
ResultValue = _classThis = _classDescriptor.value;
|
|
118
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
119
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
72
120
|
}
|
|
73
|
-
|
|
74
|
-
|
|
121
|
+
_source = __runInitializers(this, __source_initializers, void 0);
|
|
122
|
+
context = (__runInitializers(this, __source_extraInitializers), __runInitializers(this, _context_initializers, void 0));
|
|
123
|
+
_type = __runInitializers(this, _context_extraInitializers);
|
|
124
|
+
constructor(opts) {
|
|
125
|
+
super();
|
|
126
|
+
this._source = opts.source;
|
|
127
|
+
this.context = opts.context;
|
|
128
|
+
this._value = opts.value;
|
|
129
|
+
this.indexed = opts.indexed;
|
|
75
130
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
__metadata("design:type", Context)
|
|
89
|
-
], ResultValue.prototype, "context", void 0);
|
|
90
|
-
ResultValue = __decorate([
|
|
91
|
-
variant(0),
|
|
92
|
-
__metadata("design:paramtypes", [Object])
|
|
93
|
-
], ResultValue);
|
|
94
|
-
export { ResultValue };
|
|
95
|
-
let ResultIndexedValue = class ResultIndexedValue extends Result {
|
|
96
|
-
_source;
|
|
97
|
-
entries;
|
|
98
|
-
context;
|
|
99
|
-
_type;
|
|
100
|
-
constructor(opts) {
|
|
101
|
-
super();
|
|
102
|
-
this._source = opts.source;
|
|
103
|
-
this.context = opts.context;
|
|
104
|
-
this.indexed = opts.indexed;
|
|
105
|
-
this.entries = opts.entries;
|
|
106
|
-
this._value = opts.indexed;
|
|
107
|
-
}
|
|
108
|
-
init(type) {
|
|
109
|
-
this._type = type;
|
|
110
|
-
}
|
|
111
|
-
_value;
|
|
112
|
-
get value() {
|
|
113
|
-
if (this._value) {
|
|
131
|
+
init(type) {
|
|
132
|
+
this._type = type;
|
|
133
|
+
}
|
|
134
|
+
_value;
|
|
135
|
+
get value() {
|
|
136
|
+
if (this._value) {
|
|
137
|
+
return this._value;
|
|
138
|
+
}
|
|
139
|
+
if (!this._source) {
|
|
140
|
+
throw new Error("Missing source binary");
|
|
141
|
+
}
|
|
142
|
+
this._value = deserialize(this._source, this._type);
|
|
114
143
|
return this._value;
|
|
115
144
|
}
|
|
116
|
-
|
|
117
|
-
|
|
145
|
+
// we never send this over the wire since we can always reconstruct it from value
|
|
146
|
+
indexed;
|
|
147
|
+
};
|
|
148
|
+
return ResultValue = _classThis;
|
|
149
|
+
})();
|
|
150
|
+
export { ResultValue };
|
|
151
|
+
let ResultIndexedValue = (() => {
|
|
152
|
+
let _classDecorators = [variant(1)];
|
|
153
|
+
let _classDescriptor;
|
|
154
|
+
let _classExtraInitializers = [];
|
|
155
|
+
let _classThis;
|
|
156
|
+
let _classSuper = Result;
|
|
157
|
+
let __source_decorators;
|
|
158
|
+
let __source_initializers = [];
|
|
159
|
+
let __source_extraInitializers = [];
|
|
160
|
+
let _entries_decorators;
|
|
161
|
+
let _entries_initializers = [];
|
|
162
|
+
let _entries_extraInitializers = [];
|
|
163
|
+
let _context_decorators;
|
|
164
|
+
let _context_initializers = [];
|
|
165
|
+
let _context_extraInitializers = [];
|
|
166
|
+
var ResultIndexedValue = class extends _classSuper {
|
|
167
|
+
static { _classThis = this; }
|
|
168
|
+
static {
|
|
169
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
170
|
+
__source_decorators = [field({ type: Uint8Array })];
|
|
171
|
+
_entries_decorators = [field({ type: vec(Entry) })];
|
|
172
|
+
_context_decorators = [field({ type: Context })];
|
|
173
|
+
__esDecorate(null, null, __source_decorators, { kind: "field", name: "_source", static: false, private: false, access: { has: obj => "_source" in obj, get: obj => obj._source, set: (obj, value) => { obj._source = value; } }, metadata: _metadata }, __source_initializers, __source_extraInitializers);
|
|
174
|
+
__esDecorate(null, null, _entries_decorators, { kind: "field", name: "entries", static: false, private: false, access: { has: obj => "entries" in obj, get: obj => obj.entries, set: (obj, value) => { obj.entries = value; } }, metadata: _metadata }, _entries_initializers, _entries_extraInitializers);
|
|
175
|
+
__esDecorate(null, null, _context_decorators, { kind: "field", name: "context", static: false, private: false, access: { has: obj => "context" in obj, get: obj => obj.context, set: (obj, value) => { obj.context = value; } }, metadata: _metadata }, _context_initializers, _context_extraInitializers);
|
|
176
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
177
|
+
ResultIndexedValue = _classThis = _classDescriptor.value;
|
|
178
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
179
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
118
180
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// not used yet, but
|
|
144
|
-
_sourceValue;
|
|
145
|
-
_sourceIndexed;
|
|
146
|
-
entries;
|
|
147
|
-
context;
|
|
148
|
-
_type;
|
|
149
|
-
_indexedtype;
|
|
150
|
-
constructor(opts) {
|
|
151
|
-
super();
|
|
152
|
-
this._sourceValue = opts.source;
|
|
153
|
-
this._sourceIndexed = opts.sourceIndexed;
|
|
154
|
-
this.context = opts.context;
|
|
155
|
-
this._value = opts.value;
|
|
156
|
-
this.entries = opts.entries;
|
|
157
|
-
this.indexed = opts.indexed;
|
|
158
|
-
}
|
|
159
|
-
init({ type, indexedType, }) {
|
|
160
|
-
this._type = type;
|
|
161
|
-
this._indexedtype = indexedType;
|
|
162
|
-
}
|
|
163
|
-
_value;
|
|
164
|
-
get value() {
|
|
165
|
-
if (this._value) {
|
|
181
|
+
_source = __runInitializers(this, __source_initializers, void 0);
|
|
182
|
+
entries = (__runInitializers(this, __source_extraInitializers), __runInitializers(this, _entries_initializers, void 0));
|
|
183
|
+
context = (__runInitializers(this, _entries_extraInitializers), __runInitializers(this, _context_initializers, void 0));
|
|
184
|
+
_type = __runInitializers(this, _context_extraInitializers);
|
|
185
|
+
constructor(opts) {
|
|
186
|
+
super();
|
|
187
|
+
this._source = opts.source;
|
|
188
|
+
this.context = opts.context;
|
|
189
|
+
this.indexed = opts.indexed;
|
|
190
|
+
this.entries = opts.entries;
|
|
191
|
+
this._value = opts.indexed;
|
|
192
|
+
}
|
|
193
|
+
init(type) {
|
|
194
|
+
this._type = type;
|
|
195
|
+
}
|
|
196
|
+
_value;
|
|
197
|
+
get value() {
|
|
198
|
+
if (this._value) {
|
|
199
|
+
return this._value;
|
|
200
|
+
}
|
|
201
|
+
if (!this._source) {
|
|
202
|
+
throw new Error("Missing source binary");
|
|
203
|
+
}
|
|
204
|
+
this._value = deserialize(this._source, this._type);
|
|
166
205
|
return this._value;
|
|
167
206
|
}
|
|
168
|
-
|
|
169
|
-
|
|
207
|
+
// we never send this over the wire since we can always reconstruct it from value
|
|
208
|
+
indexed;
|
|
209
|
+
};
|
|
210
|
+
return ResultIndexedValue = _classThis;
|
|
211
|
+
})();
|
|
212
|
+
export { ResultIndexedValue };
|
|
213
|
+
let _ResultValueWithIndexedResultValue = (() => {
|
|
214
|
+
let _classDecorators = [variant(2)];
|
|
215
|
+
let _classDescriptor;
|
|
216
|
+
let _classExtraInitializers = [];
|
|
217
|
+
let _classThis;
|
|
218
|
+
let _classSuper = Result;
|
|
219
|
+
let __sourceValue_decorators;
|
|
220
|
+
let __sourceValue_initializers = [];
|
|
221
|
+
let __sourceValue_extraInitializers = [];
|
|
222
|
+
let __sourceIndexed_decorators;
|
|
223
|
+
let __sourceIndexed_initializers = [];
|
|
224
|
+
let __sourceIndexed_extraInitializers = [];
|
|
225
|
+
let _entries_decorators;
|
|
226
|
+
let _entries_initializers = [];
|
|
227
|
+
let _entries_extraInitializers = [];
|
|
228
|
+
let _context_decorators;
|
|
229
|
+
let _context_initializers = [];
|
|
230
|
+
let _context_extraInitializers = [];
|
|
231
|
+
var _ResultValueWithIndexedResultValue = class extends _classSuper {
|
|
232
|
+
static { _classThis = this; }
|
|
233
|
+
static {
|
|
234
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
235
|
+
__sourceValue_decorators = [field({ type: Uint8Array })];
|
|
236
|
+
__sourceIndexed_decorators = [field({ type: Uint8Array })];
|
|
237
|
+
_entries_decorators = [field({ type: vec(Entry) })];
|
|
238
|
+
_context_decorators = [field({ type: Context })];
|
|
239
|
+
__esDecorate(null, null, __sourceValue_decorators, { kind: "field", name: "_sourceValue", static: false, private: false, access: { has: obj => "_sourceValue" in obj, get: obj => obj._sourceValue, set: (obj, value) => { obj._sourceValue = value; } }, metadata: _metadata }, __sourceValue_initializers, __sourceValue_extraInitializers);
|
|
240
|
+
__esDecorate(null, null, __sourceIndexed_decorators, { kind: "field", name: "_sourceIndexed", static: false, private: false, access: { has: obj => "_sourceIndexed" in obj, get: obj => obj._sourceIndexed, set: (obj, value) => { obj._sourceIndexed = value; } }, metadata: _metadata }, __sourceIndexed_initializers, __sourceIndexed_extraInitializers);
|
|
241
|
+
__esDecorate(null, null, _entries_decorators, { kind: "field", name: "entries", static: false, private: false, access: { has: obj => "entries" in obj, get: obj => obj.entries, set: (obj, value) => { obj.entries = value; } }, metadata: _metadata }, _entries_initializers, _entries_extraInitializers);
|
|
242
|
+
__esDecorate(null, null, _context_decorators, { kind: "field", name: "context", static: false, private: false, access: { has: obj => "context" in obj, get: obj => obj.context, set: (obj, value) => { obj.context = value; } }, metadata: _metadata }, _context_initializers, _context_extraInitializers);
|
|
243
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
244
|
+
_ResultValueWithIndexedResultValue = _classThis = _classDescriptor.value;
|
|
245
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
246
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
170
247
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
248
|
+
// not used yet, but
|
|
249
|
+
_sourceValue = __runInitializers(this, __sourceValue_initializers, void 0);
|
|
250
|
+
_sourceIndexed = (__runInitializers(this, __sourceValue_extraInitializers), __runInitializers(this, __sourceIndexed_initializers, void 0));
|
|
251
|
+
entries = (__runInitializers(this, __sourceIndexed_extraInitializers), __runInitializers(this, _entries_initializers, void 0));
|
|
252
|
+
context = (__runInitializers(this, _entries_extraInitializers), __runInitializers(this, _context_initializers, void 0));
|
|
253
|
+
_type = __runInitializers(this, _context_extraInitializers);
|
|
254
|
+
_indexedtype;
|
|
255
|
+
constructor(opts) {
|
|
256
|
+
super();
|
|
257
|
+
this._sourceValue = opts.source;
|
|
258
|
+
this._sourceIndexed = opts.sourceIndexed;
|
|
259
|
+
this.context = opts.context;
|
|
260
|
+
this._value = opts.value;
|
|
261
|
+
this.entries = opts.entries;
|
|
262
|
+
this.indexed = opts.indexed;
|
|
178
263
|
}
|
|
179
|
-
|
|
180
|
-
|
|
264
|
+
init({ type, indexedType, }) {
|
|
265
|
+
this._type = type;
|
|
266
|
+
this._indexedtype = indexedType;
|
|
181
267
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
__metadata("design:paramtypes", [Object])
|
|
208
|
-
], ResultValueWithIndexedResultValue);
|
|
268
|
+
_value;
|
|
269
|
+
get value() {
|
|
270
|
+
if (this._value) {
|
|
271
|
+
return this._value;
|
|
272
|
+
}
|
|
273
|
+
if (!this._sourceValue) {
|
|
274
|
+
throw new Error("Missing source binary");
|
|
275
|
+
}
|
|
276
|
+
this._value = deserialize(this._sourceValue, this._type);
|
|
277
|
+
return this._value;
|
|
278
|
+
}
|
|
279
|
+
indexed;
|
|
280
|
+
get indexedValue() {
|
|
281
|
+
if (this.indexed) {
|
|
282
|
+
return this.indexed;
|
|
283
|
+
}
|
|
284
|
+
if (!this._sourceIndexed) {
|
|
285
|
+
throw new Error("Missing source binary for indexed value");
|
|
286
|
+
}
|
|
287
|
+
this.indexed = deserialize(this._sourceIndexed, this._indexedtype);
|
|
288
|
+
return this.indexed;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
return _ResultValueWithIndexedResultValue = _classThis;
|
|
292
|
+
})();
|
|
209
293
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
210
294
|
export class AbstractSearchResult {
|
|
211
295
|
}
|
|
212
|
-
let Results =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
296
|
+
let Results = (() => {
|
|
297
|
+
let _classDecorators = [variant(0)];
|
|
298
|
+
let _classDescriptor;
|
|
299
|
+
let _classExtraInitializers = [];
|
|
300
|
+
let _classThis;
|
|
301
|
+
let _classSuper = AbstractSearchResult;
|
|
302
|
+
let _results_decorators;
|
|
303
|
+
let _results_initializers = [];
|
|
304
|
+
let _results_extraInitializers = [];
|
|
305
|
+
let _kept_decorators;
|
|
306
|
+
let _kept_initializers = [];
|
|
307
|
+
let _kept_extraInitializers = [];
|
|
308
|
+
var Results = class extends _classSuper {
|
|
309
|
+
static { _classThis = this; }
|
|
310
|
+
static {
|
|
311
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
312
|
+
_results_decorators = [field({ type: vec(Result) })];
|
|
313
|
+
_kept_decorators = [field({ type: "u64" })];
|
|
314
|
+
__esDecorate(null, null, _results_decorators, { kind: "field", name: "results", static: false, private: false, access: { has: obj => "results" in obj, get: obj => obj.results, set: (obj, value) => { obj.results = value; } }, metadata: _metadata }, _results_initializers, _results_extraInitializers);
|
|
315
|
+
__esDecorate(null, null, _kept_decorators, { kind: "field", name: "kept", static: false, private: false, access: { has: obj => "kept" in obj, get: obj => obj.kept, set: (obj, value) => { obj.kept = value; } }, metadata: _metadata }, _kept_initializers, _kept_extraInitializers);
|
|
316
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
317
|
+
Results = _classThis = _classDescriptor.value;
|
|
318
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
319
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
320
|
+
}
|
|
321
|
+
results = __runInitializers(this, _results_initializers, void 0);
|
|
322
|
+
kept = (__runInitializers(this, _results_extraInitializers), __runInitializers(this, _kept_initializers, void 0)); // how many results that were not sent, but can be collected later
|
|
323
|
+
constructor(properties) {
|
|
324
|
+
super();
|
|
325
|
+
__runInitializers(this, _kept_extraInitializers);
|
|
326
|
+
this.kept = properties.kept;
|
|
327
|
+
this.results = properties.results;
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
return Results = _classThis;
|
|
331
|
+
})();
|
|
233
332
|
export { Results };
|
|
234
|
-
let NoAccess =
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
333
|
+
let NoAccess = (() => {
|
|
334
|
+
let _classDecorators = [variant(1)];
|
|
335
|
+
let _classDescriptor;
|
|
336
|
+
let _classExtraInitializers = [];
|
|
337
|
+
let _classThis;
|
|
338
|
+
let _classSuper = AbstractSearchResult;
|
|
339
|
+
var NoAccess = class extends _classSuper {
|
|
340
|
+
static { _classThis = this; }
|
|
341
|
+
static {
|
|
342
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
343
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
344
|
+
NoAccess = _classThis = _classDescriptor.value;
|
|
345
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
346
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
return NoAccess = _classThis;
|
|
350
|
+
})();
|
|
239
351
|
export { NoAccess };
|
|
240
352
|
/* @variant(5)
|
|
241
353
|
export class LogQuery extends Query { } */
|
package/dist/src/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAEN,WAAW,EACX,KAAK,EACL,OAAO,EACP,GAAG,GACH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,uBAAuB;AAEvB,MAAM,OAAgB,MAAM;C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