@peerbit/indexer-tests 1.1.20 → 2.0.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/tests.js CHANGED
@@ -1,129 +1,203 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
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 __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
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, fixedArray, option, serialize, variant, vec, } from "@dao-xyz/borsh";
11
36
  import { randomBytes, sha256Base64Sync } from "@peerbit/crypto";
12
37
  import { And, BoolQuery, ByteMatchQuery, Compare, IntegerCompare, IsNull, Not, Or, Query, Sort, SortDirection, StringMatch, StringMatchMethod, extractFieldValue, getIdProperty, id, toId, } from "@peerbit/indexer-interface";
13
- import {
14
- /* delay, */
15
- delay, waitForResolved, } from "@peerbit/time";
38
+ import { waitForResolved } from "@peerbit/time";
16
39
  import { expect } from "chai";
17
40
  import sodium from "libsodium-wrappers";
18
41
  import { equals } from "uint8arrays";
19
42
  import { v4 as uuid } from "uuid";
20
- let NestedValue = class NestedValue {
21
- number;
22
- constructor(properties) {
23
- this.number = properties.number;
24
- }
25
- };
26
- __decorate([
27
- field({ type: "u32" }),
28
- __metadata("design:type", Number)
29
- ], NestedValue.prototype, "number", void 0);
30
- NestedValue = __decorate([
31
- variant("nested_object"),
32
- __metadata("design:paramtypes", [Object])
33
- ], NestedValue);
43
+ let NestedValue = (() => {
44
+ let _classDecorators = [variant("nested_object")];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ let _number_decorators;
49
+ let _number_initializers = [];
50
+ let _number_extraInitializers = [];
51
+ var NestedValue = class {
52
+ static { _classThis = this; }
53
+ static {
54
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
55
+ _number_decorators = [field({ type: "u32" })];
56
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
57
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
58
+ NestedValue = _classThis = _classDescriptor.value;
59
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
60
+ __runInitializers(_classThis, _classExtraInitializers);
61
+ }
62
+ number = __runInitializers(this, _number_initializers, void 0);
63
+ constructor(properties) {
64
+ __runInitializers(this, _number_extraInitializers);
65
+ this.number = properties.number;
66
+ }
67
+ };
68
+ return NestedValue = _classThis;
69
+ })();
34
70
  class Base {
35
71
  }
36
- let Document = class Document extends Base {
37
- id;
38
- name;
39
- number;
40
- bool;
41
- data;
42
- fixedData;
43
- nested;
44
- tags;
45
- nestedVec;
46
- constructor(opts) {
47
- super();
48
- this.id = opts.id;
49
- this.name = opts.name;
50
- this.number = opts.number;
51
- this.tags = opts.tags || [];
52
- this.bool = opts.bool;
53
- this.data = opts.data;
54
- this.fixedData = opts.fixedData;
55
- this.nested = opts.nested;
56
- this.nestedVec = opts.nestedVec || [];
57
- }
58
- };
59
- __decorate([
60
- field({ type: "string" }),
61
- __metadata("design:type", String)
62
- ], Document.prototype, "id", void 0);
63
- __decorate([
64
- field({ type: option("string") }),
65
- __metadata("design:type", String)
66
- ], Document.prototype, "name", void 0);
67
- __decorate([
68
- field({ type: option("u64") }),
69
- __metadata("design:type", BigInt)
70
- ], Document.prototype, "number", void 0);
71
- __decorate([
72
- field({ type: option("bool") }),
73
- __metadata("design:type", Boolean)
74
- ], Document.prototype, "bool", void 0);
75
- __decorate([
76
- field({ type: option(Uint8Array) }),
77
- __metadata("design:type", Uint8Array)
78
- ], Document.prototype, "data", void 0);
79
- __decorate([
80
- field({ type: option(fixedArray("u8", 32)) }),
81
- __metadata("design:type", Uint8Array)
82
- ], Document.prototype, "fixedData", void 0);
83
- __decorate([
84
- field({ type: option(NestedValue) }),
85
- __metadata("design:type", NestedValue)
86
- ], Document.prototype, "nested", void 0);
87
- __decorate([
88
- field({ type: vec("string") }),
89
- __metadata("design:type", Array)
90
- ], Document.prototype, "tags", void 0);
91
- __decorate([
92
- field({ type: vec(NestedValue) }),
93
- __metadata("design:type", Array)
94
- ], Document.prototype, "nestedVec", void 0);
95
- Document = __decorate([
96
- variant(0),
97
- __metadata("design:paramtypes", [Object])
98
- ], Document);
72
+ let Document = (() => {
73
+ let _classDecorators = [variant(0)];
74
+ let _classDescriptor;
75
+ let _classExtraInitializers = [];
76
+ let _classThis;
77
+ let _classSuper = Base;
78
+ let _id_decorators;
79
+ let _id_initializers = [];
80
+ let _id_extraInitializers = [];
81
+ let _name_decorators;
82
+ let _name_initializers = [];
83
+ let _name_extraInitializers = [];
84
+ let _number_decorators;
85
+ let _number_initializers = [];
86
+ let _number_extraInitializers = [];
87
+ let _bool_decorators;
88
+ let _bool_initializers = [];
89
+ let _bool_extraInitializers = [];
90
+ let _data_decorators;
91
+ let _data_initializers = [];
92
+ let _data_extraInitializers = [];
93
+ let _fixedData_decorators;
94
+ let _fixedData_initializers = [];
95
+ let _fixedData_extraInitializers = [];
96
+ let _nested_decorators;
97
+ let _nested_initializers = [];
98
+ let _nested_extraInitializers = [];
99
+ let _tags_decorators;
100
+ let _tags_initializers = [];
101
+ let _tags_extraInitializers = [];
102
+ let _nestedVec_decorators;
103
+ let _nestedVec_initializers = [];
104
+ let _nestedVec_extraInitializers = [];
105
+ var Document = class extends _classSuper {
106
+ static { _classThis = this; }
107
+ static {
108
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
109
+ _id_decorators = [field({ type: "string" })];
110
+ _name_decorators = [field({ type: option("string") })];
111
+ _number_decorators = [field({ type: option("u64") })];
112
+ _bool_decorators = [field({ type: option("bool") })];
113
+ _data_decorators = [field({ type: option(Uint8Array) })];
114
+ _fixedData_decorators = [field({ type: option(fixedArray("u8", 32)) })];
115
+ _nested_decorators = [field({ type: option(NestedValue) })];
116
+ _tags_decorators = [field({ type: vec("string") })];
117
+ _nestedVec_decorators = [field({ type: vec(NestedValue) })];
118
+ __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);
119
+ __esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
120
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
121
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
122
+ __esDecorate(null, null, _data_decorators, { kind: "field", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
123
+ __esDecorate(null, null, _fixedData_decorators, { kind: "field", name: "fixedData", static: false, private: false, access: { has: obj => "fixedData" in obj, get: obj => obj.fixedData, set: (obj, value) => { obj.fixedData = value; } }, metadata: _metadata }, _fixedData_initializers, _fixedData_extraInitializers);
124
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
125
+ __esDecorate(null, null, _tags_decorators, { kind: "field", name: "tags", static: false, private: false, access: { has: obj => "tags" in obj, get: obj => obj.tags, set: (obj, value) => { obj.tags = value; } }, metadata: _metadata }, _tags_initializers, _tags_extraInitializers);
126
+ __esDecorate(null, null, _nestedVec_decorators, { kind: "field", name: "nestedVec", static: false, private: false, access: { has: obj => "nestedVec" in obj, get: obj => obj.nestedVec, set: (obj, value) => { obj.nestedVec = value; } }, metadata: _metadata }, _nestedVec_initializers, _nestedVec_extraInitializers);
127
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
128
+ Document = _classThis = _classDescriptor.value;
129
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
130
+ __runInitializers(_classThis, _classExtraInitializers);
131
+ }
132
+ id = __runInitializers(this, _id_initializers, void 0);
133
+ name = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _name_initializers, void 0));
134
+ number = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _number_initializers, void 0));
135
+ bool = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _bool_initializers, void 0));
136
+ data = (__runInitializers(this, _bool_extraInitializers), __runInitializers(this, _data_initializers, void 0));
137
+ fixedData = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, _fixedData_initializers, void 0));
138
+ nested = (__runInitializers(this, _fixedData_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
139
+ tags = (__runInitializers(this, _nested_extraInitializers), __runInitializers(this, _tags_initializers, void 0));
140
+ nestedVec = (__runInitializers(this, _tags_extraInitializers), __runInitializers(this, _nestedVec_initializers, void 0));
141
+ constructor(opts) {
142
+ super();
143
+ __runInitializers(this, _nestedVec_extraInitializers);
144
+ this.id = opts.id;
145
+ this.name = opts.name;
146
+ this.number = opts.number;
147
+ this.tags = opts.tags || [];
148
+ this.bool = opts.bool;
149
+ this.data = opts.data;
150
+ this.fixedData = opts.fixedData;
151
+ this.nested = opts.nested;
152
+ this.nestedVec = opts.nestedVec || [];
153
+ }
154
+ };
155
+ return Document = _classThis;
156
+ })();
99
157
  // variant 1 (next version for migration testing)
100
- let DocumentNext = class DocumentNext extends Base {
101
- id;
102
- name;
103
- anotherField;
104
- constructor(opts) {
105
- super();
106
- this.id = opts.id || uuid();
107
- this.name = opts.name || uuid();
108
- this.anotherField = opts.anotherField || uuid();
109
- }
110
- };
111
- __decorate([
112
- field({ type: "string" }),
113
- __metadata("design:type", String)
114
- ], DocumentNext.prototype, "id", void 0);
115
- __decorate([
116
- field({ type: "string" }),
117
- __metadata("design:type", String)
118
- ], DocumentNext.prototype, "name", void 0);
119
- __decorate([
120
- field({ type: "string" }),
121
- __metadata("design:type", String)
122
- ], DocumentNext.prototype, "anotherField", void 0);
123
- DocumentNext = __decorate([
124
- variant(1),
125
- __metadata("design:paramtypes", [Object])
126
- ], DocumentNext);
158
+ let DocumentNext = (() => {
159
+ let _classDecorators = [variant(1)];
160
+ let _classDescriptor;
161
+ let _classExtraInitializers = [];
162
+ let _classThis;
163
+ let _classSuper = Base;
164
+ let _id_decorators;
165
+ let _id_initializers = [];
166
+ let _id_extraInitializers = [];
167
+ let _name_decorators;
168
+ let _name_initializers = [];
169
+ let _name_extraInitializers = [];
170
+ let _anotherField_decorators;
171
+ let _anotherField_initializers = [];
172
+ let _anotherField_extraInitializers = [];
173
+ var DocumentNext = class extends _classSuper {
174
+ static { _classThis = this; }
175
+ static {
176
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
177
+ _id_decorators = [field({ type: "string" })];
178
+ _name_decorators = [field({ type: "string" })];
179
+ _anotherField_decorators = [field({ type: "string" })];
180
+ __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);
181
+ __esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
182
+ __esDecorate(null, null, _anotherField_decorators, { kind: "field", name: "anotherField", static: false, private: false, access: { has: obj => "anotherField" in obj, get: obj => obj.anotherField, set: (obj, value) => { obj.anotherField = value; } }, metadata: _metadata }, _anotherField_initializers, _anotherField_extraInitializers);
183
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
184
+ DocumentNext = _classThis = _classDescriptor.value;
185
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
186
+ __runInitializers(_classThis, _classExtraInitializers);
187
+ }
188
+ id = __runInitializers(this, _id_initializers, void 0);
189
+ name = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _name_initializers, void 0));
190
+ anotherField = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _anotherField_initializers, void 0));
191
+ constructor(opts) {
192
+ super();
193
+ __runInitializers(this, _anotherField_extraInitializers);
194
+ this.id = opts.id || uuid();
195
+ this.name = opts.name || uuid();
196
+ this.anotherField = opts.anotherField || uuid();
197
+ }
198
+ };
199
+ return DocumentNext = _classThis;
200
+ })();
127
201
  const bigIntSort = (a, b) => a > b ? 1 : 0 || -(a < b);
128
202
  const search = (index, query, options) => {
129
203
  // fetch max u32
@@ -287,22 +361,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
287
361
  expect(result).equal(undefined);
288
362
  };
289
363
  describe("string", () => {
290
- class SimpleDocument {
291
- id;
292
- value;
293
- constructor(properties) {
294
- this.id = properties.id;
295
- this.value = properties.value;
296
- }
297
- }
298
- __decorate([
299
- field({ type: "string" }),
300
- __metadata("design:type", String)
301
- ], SimpleDocument.prototype, "id", void 0);
302
- __decorate([
303
- field({ type: "string" }),
304
- __metadata("design:type", String)
305
- ], SimpleDocument.prototype, "value", void 0);
364
+ let SimpleDocument = (() => {
365
+ let _classDecorators = [variant("SimpleDocument")];
366
+ let _classDescriptor;
367
+ let _classExtraInitializers = [];
368
+ let _classThis;
369
+ let _id_decorators;
370
+ let _id_initializers = [];
371
+ let _id_extraInitializers = [];
372
+ let _value_decorators;
373
+ let _value_initializers = [];
374
+ let _value_extraInitializers = [];
375
+ var SimpleDocument = class {
376
+ static { _classThis = this; }
377
+ static {
378
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
379
+ _id_decorators = [field({ type: "string" })];
380
+ _value_decorators = [field({ type: "string" })];
381
+ __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);
382
+ __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);
383
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
384
+ SimpleDocument = _classThis = _classDescriptor.value;
385
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
386
+ __runInitializers(_classThis, _classExtraInitializers);
387
+ }
388
+ id = __runInitializers(this, _id_initializers, void 0);
389
+ value = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _value_initializers, void 0));
390
+ constructor(properties) {
391
+ __runInitializers(this, _value_extraInitializers);
392
+ this.id = properties.id;
393
+ this.value = properties.value;
394
+ }
395
+ };
396
+ return SimpleDocument = _classThis;
397
+ })();
306
398
  it("will throw error if indexBy does not exist in document", async () => {
307
399
  let store;
308
400
  try {
@@ -367,22 +459,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
367
459
  });
368
460
  });
369
461
  describe("bytes", () => {
370
- class DocumentUint8arrayId {
371
- id;
372
- value;
373
- constructor(properties) {
374
- this.id = properties.id;
375
- this.value = properties.value;
376
- }
377
- }
378
- __decorate([
379
- field({ type: Uint8Array }),
380
- __metadata("design:type", Uint8Array)
381
- ], DocumentUint8arrayId.prototype, "id", void 0);
382
- __decorate([
383
- field({ type: "string" }),
384
- __metadata("design:type", String)
385
- ], DocumentUint8arrayId.prototype, "value", void 0);
462
+ let DocumentUint8arrayId = (() => {
463
+ let _classDecorators = [variant("DocumentUint8arrayId")];
464
+ let _classDescriptor;
465
+ let _classExtraInitializers = [];
466
+ let _classThis;
467
+ let _id_decorators;
468
+ let _id_initializers = [];
469
+ let _id_extraInitializers = [];
470
+ let _value_decorators;
471
+ let _value_initializers = [];
472
+ let _value_extraInitializers = [];
473
+ var DocumentUint8arrayId = class {
474
+ static { _classThis = this; }
475
+ static {
476
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
477
+ _id_decorators = [field({ type: Uint8Array })];
478
+ _value_decorators = [field({ type: "string" })];
479
+ __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);
480
+ __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);
481
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
482
+ DocumentUint8arrayId = _classThis = _classDescriptor.value;
483
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
484
+ __runInitializers(_classThis, _classExtraInitializers);
485
+ }
486
+ id = __runInitializers(this, _id_initializers, void 0);
487
+ value = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _value_initializers, void 0));
488
+ constructor(properties) {
489
+ __runInitializers(this, _value_extraInitializers);
490
+ this.id = properties.id;
491
+ this.value = properties.value;
492
+ }
493
+ };
494
+ return DocumentUint8arrayId = _classThis;
495
+ })();
386
496
  it("index as Uint8array", async () => {
387
497
  const { store } = await setup({ schema: DocumentUint8arrayId });
388
498
  const id = new Uint8Array([1, 2, 3]);
@@ -392,22 +502,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
392
502
  });
393
503
  await testIndex(store, doc);
394
504
  });
395
- class DocumentFixedUint8arrayId {
396
- id;
397
- value;
398
- constructor(properties) {
399
- this.id = properties.id;
400
- this.value = properties.value;
401
- }
402
- }
403
- __decorate([
404
- field({ type: fixedArray("u8", 32) }),
405
- __metadata("design:type", Uint8Array)
406
- ], DocumentFixedUint8arrayId.prototype, "id", void 0);
407
- __decorate([
408
- field({ type: "string" }),
409
- __metadata("design:type", String)
410
- ], DocumentFixedUint8arrayId.prototype, "value", void 0);
505
+ let DocumentFixedUint8arrayId = (() => {
506
+ let _classDecorators = [variant("DocumentFixedUint8arrayId")];
507
+ let _classDescriptor;
508
+ let _classExtraInitializers = [];
509
+ let _classThis;
510
+ let _id_decorators;
511
+ let _id_initializers = [];
512
+ let _id_extraInitializers = [];
513
+ let _value_decorators;
514
+ let _value_initializers = [];
515
+ let _value_extraInitializers = [];
516
+ var DocumentFixedUint8arrayId = class {
517
+ static { _classThis = this; }
518
+ static {
519
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
520
+ _id_decorators = [field({ type: fixedArray("u8", 32) })];
521
+ _value_decorators = [field({ type: "string" })];
522
+ __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);
523
+ __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);
524
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
525
+ DocumentFixedUint8arrayId = _classThis = _classDescriptor.value;
526
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
527
+ __runInitializers(_classThis, _classExtraInitializers);
528
+ }
529
+ id = __runInitializers(this, _id_initializers, void 0);
530
+ value = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _value_initializers, void 0));
531
+ constructor(properties) {
532
+ __runInitializers(this, _value_extraInitializers);
533
+ this.id = properties.id;
534
+ this.value = properties.value;
535
+ }
536
+ };
537
+ return DocumentFixedUint8arrayId = _classThis;
538
+ })();
411
539
  it("index as fixed Uint8array", async () => {
412
540
  const { store } = await setup({ schema: DocumentFixedUint8arrayId });
413
541
  const id = new Uint8Array(32).fill(1);
@@ -419,22 +547,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
419
547
  });
420
548
  });
421
549
  describe("number", () => {
422
- class DocumentNumberId {
423
- id;
424
- value;
425
- constructor(properties) {
426
- this.id = properties.id;
427
- this.value = properties.value;
428
- }
429
- }
430
- __decorate([
431
- field({ type: "u32" }),
432
- __metadata("design:type", Number)
433
- ], DocumentNumberId.prototype, "id", void 0);
434
- __decorate([
435
- field({ type: "string" }),
436
- __metadata("design:type", String)
437
- ], DocumentNumberId.prototype, "value", void 0);
550
+ let DocumentNumberId = (() => {
551
+ let _classDecorators = [variant("DocumentNumberId")];
552
+ let _classDescriptor;
553
+ let _classExtraInitializers = [];
554
+ let _classThis;
555
+ let _id_decorators;
556
+ let _id_initializers = [];
557
+ let _id_extraInitializers = [];
558
+ let _value_decorators;
559
+ let _value_initializers = [];
560
+ let _value_extraInitializers = [];
561
+ var DocumentNumberId = class {
562
+ static { _classThis = this; }
563
+ static {
564
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
565
+ _id_decorators = [field({ type: "u32" })];
566
+ _value_decorators = [field({ type: "string" })];
567
+ __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);
568
+ __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);
569
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
570
+ DocumentNumberId = _classThis = _classDescriptor.value;
571
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
572
+ __runInitializers(_classThis, _classExtraInitializers);
573
+ }
574
+ id = __runInitializers(this, _id_initializers, void 0);
575
+ value = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _value_initializers, void 0));
576
+ constructor(properties) {
577
+ __runInitializers(this, _value_extraInitializers);
578
+ this.id = properties.id;
579
+ this.value = properties.value;
580
+ }
581
+ };
582
+ return DocumentNumberId = _classThis;
583
+ })();
438
584
  it("index as number", async () => {
439
585
  const { store } = await setup({ schema: DocumentNumberId });
440
586
  const id = 123456789;
@@ -446,22 +592,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
446
592
  });
447
593
  });
448
594
  describe("bigint", () => {
449
- class DocumentBigintId {
450
- id;
451
- value;
452
- constructor(properties) {
453
- this.id = properties.id;
454
- this.value = properties.value;
455
- }
456
- }
457
- __decorate([
458
- field({ type: "u64" }),
459
- __metadata("design:type", BigInt)
460
- ], DocumentBigintId.prototype, "id", void 0);
461
- __decorate([
462
- field({ type: "u64" }),
463
- __metadata("design:type", BigInt)
464
- ], DocumentBigintId.prototype, "value", void 0);
595
+ let DocumentBigintId = (() => {
596
+ let _classDecorators = [variant("DocumentBigintId")];
597
+ let _classDescriptor;
598
+ let _classExtraInitializers = [];
599
+ let _classThis;
600
+ let _id_decorators;
601
+ let _id_initializers = [];
602
+ let _id_extraInitializers = [];
603
+ let _value_decorators;
604
+ let _value_initializers = [];
605
+ let _value_extraInitializers = [];
606
+ var DocumentBigintId = class {
607
+ static { _classThis = this; }
608
+ static {
609
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
610
+ _id_decorators = [field({ type: "u64" })];
611
+ _value_decorators = [field({ type: "u64" })];
612
+ __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);
613
+ __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);
614
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
615
+ DocumentBigintId = _classThis = _classDescriptor.value;
616
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
617
+ __runInitializers(_classThis, _classExtraInitializers);
618
+ }
619
+ id = __runInitializers(this, _id_initializers, void 0);
620
+ value = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _value_initializers, void 0));
621
+ constructor(properties) {
622
+ __runInitializers(this, _value_extraInitializers);
623
+ this.id = properties.id;
624
+ this.value = properties.value;
625
+ }
626
+ };
627
+ return DocumentBigintId = _classThis;
628
+ })();
465
629
  it("index as bigint", async () => {
466
630
  const { store } = await setup({ schema: DocumentBigintId });
467
631
  // make the id less than 2^53, but greater than u32 max
@@ -474,16 +638,33 @@ export const tests = (createIndicies, type = "transient", properties) => {
474
638
  });
475
639
  });
476
640
  describe("by decorator", () => {
477
- class DocumentWithDecoratedId {
478
- xyz;
479
- constructor(properties) {
480
- this.xyz = properties.xyz;
481
- }
482
- }
483
- __decorate([
484
- id({ type: "string" }),
485
- __metadata("design:type", String)
486
- ], DocumentWithDecoratedId.prototype, "xyz", void 0);
641
+ let DocumentWithDecoratedId = (() => {
642
+ let _classDecorators = [variant("DocumentWithDecoratedId")];
643
+ let _classDescriptor;
644
+ let _classExtraInitializers = [];
645
+ let _classThis;
646
+ let _xyz_decorators;
647
+ let _xyz_initializers = [];
648
+ let _xyz_extraInitializers = [];
649
+ var DocumentWithDecoratedId = class {
650
+ static { _classThis = this; }
651
+ static {
652
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
653
+ _xyz_decorators = [id({ type: "string" })];
654
+ __esDecorate(null, null, _xyz_decorators, { kind: "field", name: "xyz", static: false, private: false, access: { has: obj => "xyz" in obj, get: obj => obj.xyz, set: (obj, value) => { obj.xyz = value; } }, metadata: _metadata }, _xyz_initializers, _xyz_extraInitializers);
655
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
656
+ DocumentWithDecoratedId = _classThis = _classDescriptor.value;
657
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
658
+ __runInitializers(_classThis, _classExtraInitializers);
659
+ }
660
+ xyz = __runInitializers(this, _xyz_initializers, void 0);
661
+ constructor(properties) {
662
+ __runInitializers(this, _xyz_extraInitializers);
663
+ this.xyz = properties.xyz;
664
+ }
665
+ };
666
+ return DocumentWithDecoratedId = _classThis;
667
+ })();
487
668
  it("can index by decorated id", async () => {
488
669
  const { store } = await setup({ schema: DocumentWithDecoratedId });
489
670
  const doc = new DocumentWithDecoratedId({
@@ -794,22 +975,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
794
975
  });
795
976
  describe("array", () => {
796
977
  describe("uint8arrays", () => {
797
- class Uint8arraysVec {
798
- id;
799
- bytesArrays;
800
- constructor(properties) {
801
- this.id = randomBytes(32);
802
- this.bytesArrays = properties?.bytesArrays || [];
803
- }
804
- }
805
- __decorate([
806
- field({ type: Uint8Array }),
807
- __metadata("design:type", Uint8Array)
808
- ], Uint8arraysVec.prototype, "id", void 0);
809
- __decorate([
810
- field({ type: vec(Uint8Array) }),
811
- __metadata("design:type", Array)
812
- ], Uint8arraysVec.prototype, "bytesArrays", void 0);
978
+ let Uint8arraysVec = (() => {
979
+ let _classDecorators = [variant("Uint8arraysVec")];
980
+ let _classDescriptor;
981
+ let _classExtraInitializers = [];
982
+ let _classThis;
983
+ let _id_decorators;
984
+ let _id_initializers = [];
985
+ let _id_extraInitializers = [];
986
+ let _bytesArrays_decorators;
987
+ let _bytesArrays_initializers = [];
988
+ let _bytesArrays_extraInitializers = [];
989
+ var Uint8arraysVec = class {
990
+ static { _classThis = this; }
991
+ static {
992
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
993
+ _id_decorators = [field({ type: Uint8Array })];
994
+ _bytesArrays_decorators = [field({ type: vec(Uint8Array) })];
995
+ __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);
996
+ __esDecorate(null, null, _bytesArrays_decorators, { kind: "field", name: "bytesArrays", static: false, private: false, access: { has: obj => "bytesArrays" in obj, get: obj => obj.bytesArrays, set: (obj, value) => { obj.bytesArrays = value; } }, metadata: _metadata }, _bytesArrays_initializers, _bytesArrays_extraInitializers);
997
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
998
+ Uint8arraysVec = _classThis = _classDescriptor.value;
999
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1000
+ __runInitializers(_classThis, _classExtraInitializers);
1001
+ }
1002
+ id = __runInitializers(this, _id_initializers, void 0);
1003
+ bytesArrays = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _bytesArrays_initializers, void 0));
1004
+ constructor(properties) {
1005
+ __runInitializers(this, _bytesArrays_extraInitializers);
1006
+ this.id = randomBytes(32);
1007
+ this.bytesArrays = properties?.bytesArrays || [];
1008
+ }
1009
+ };
1010
+ return Uint8arraysVec = _classThis;
1011
+ })();
813
1012
  it("uint8array[]", async () => {
814
1013
  const out = await setup({ schema: Uint8arraysVec });
815
1014
  store = out.store;
@@ -832,54 +1031,108 @@ export const tests = (createIndicies, type = "transient", properties) => {
832
1031
  });
833
1032
  });
834
1033
  describe("documents", () => {
835
- class DocumentsVec {
836
- id;
837
- documents;
838
- constructor(properties) {
839
- this.id = randomBytes(32);
840
- this.documents = properties?.documents || [];
841
- }
842
- }
843
- __decorate([
844
- field({ type: Uint8Array }),
845
- __metadata("design:type", Uint8Array)
846
- ], DocumentsVec.prototype, "id", void 0);
847
- __decorate([
848
- field({ type: vec(Document) }),
849
- __metadata("design:type", Array)
850
- ], DocumentsVec.prototype, "documents", void 0);
851
- class DocumentWithProperty {
852
- property;
853
- constructor(property) {
854
- this.property = property;
855
- }
856
- }
857
- __decorate([
858
- field({ type: "string" }),
859
- __metadata("design:type", String)
860
- ], DocumentWithProperty.prototype, "property", void 0);
861
- class DocumentsVecWithPropertyDocument {
862
- id;
863
- property;
864
- documents;
865
- constructor(properties) {
866
- this.id = randomBytes(32);
867
- this.property = properties.property;
868
- this.documents = properties?.documents || [];
869
- }
870
- }
871
- __decorate([
872
- field({ type: Uint8Array }),
873
- __metadata("design:type", Uint8Array)
874
- ], DocumentsVecWithPropertyDocument.prototype, "id", void 0);
875
- __decorate([
876
- field({ type: "string" }),
877
- __metadata("design:type", String)
878
- ], DocumentsVecWithPropertyDocument.prototype, "property", void 0);
879
- __decorate([
880
- field({ type: vec(DocumentWithProperty) }),
881
- __metadata("design:type", Array)
882
- ], DocumentsVecWithPropertyDocument.prototype, "documents", void 0);
1034
+ let DocumentsVec = (() => {
1035
+ let _classDecorators = [variant("DocumentsVec")];
1036
+ let _classDescriptor;
1037
+ let _classExtraInitializers = [];
1038
+ let _classThis;
1039
+ let _id_decorators;
1040
+ let _id_initializers = [];
1041
+ let _id_extraInitializers = [];
1042
+ let _documents_decorators;
1043
+ let _documents_initializers = [];
1044
+ let _documents_extraInitializers = [];
1045
+ var DocumentsVec = class {
1046
+ static { _classThis = this; }
1047
+ static {
1048
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1049
+ _id_decorators = [field({ type: Uint8Array })];
1050
+ _documents_decorators = [field({ type: vec(Document) })];
1051
+ __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);
1052
+ __esDecorate(null, null, _documents_decorators, { kind: "field", name: "documents", static: false, private: false, access: { has: obj => "documents" in obj, get: obj => obj.documents, set: (obj, value) => { obj.documents = value; } }, metadata: _metadata }, _documents_initializers, _documents_extraInitializers);
1053
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1054
+ DocumentsVec = _classThis = _classDescriptor.value;
1055
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1056
+ __runInitializers(_classThis, _classExtraInitializers);
1057
+ }
1058
+ id = __runInitializers(this, _id_initializers, void 0);
1059
+ documents = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _documents_initializers, void 0));
1060
+ constructor(properties) {
1061
+ __runInitializers(this, _documents_extraInitializers);
1062
+ this.id = randomBytes(32);
1063
+ this.documents = properties?.documents || [];
1064
+ }
1065
+ };
1066
+ return DocumentsVec = _classThis;
1067
+ })();
1068
+ let DocumentWithProperty = (() => {
1069
+ let _classDecorators = [variant("DocumentWithProperty")];
1070
+ let _classDescriptor;
1071
+ let _classExtraInitializers = [];
1072
+ let _classThis;
1073
+ let _property_decorators;
1074
+ let _property_initializers = [];
1075
+ let _property_extraInitializers = [];
1076
+ var DocumentWithProperty = class {
1077
+ static { _classThis = this; }
1078
+ static {
1079
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1080
+ _property_decorators = [field({ type: "string" })];
1081
+ __esDecorate(null, null, _property_decorators, { kind: "field", name: "property", static: false, private: false, access: { has: obj => "property" in obj, get: obj => obj.property, set: (obj, value) => { obj.property = value; } }, metadata: _metadata }, _property_initializers, _property_extraInitializers);
1082
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1083
+ DocumentWithProperty = _classThis = _classDescriptor.value;
1084
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1085
+ __runInitializers(_classThis, _classExtraInitializers);
1086
+ }
1087
+ property = __runInitializers(this, _property_initializers, void 0);
1088
+ constructor(property) {
1089
+ __runInitializers(this, _property_extraInitializers);
1090
+ this.property = property;
1091
+ }
1092
+ };
1093
+ return DocumentWithProperty = _classThis;
1094
+ })();
1095
+ let DocumentsVecWithPropertyDocument = (() => {
1096
+ let _classDecorators = [variant("DocumentsVecWithPropertyDocument")];
1097
+ let _classDescriptor;
1098
+ let _classExtraInitializers = [];
1099
+ let _classThis;
1100
+ let _id_decorators;
1101
+ let _id_initializers = [];
1102
+ let _id_extraInitializers = [];
1103
+ let _property_decorators;
1104
+ let _property_initializers = [];
1105
+ let _property_extraInitializers = [];
1106
+ let _documents_decorators;
1107
+ let _documents_initializers = [];
1108
+ let _documents_extraInitializers = [];
1109
+ var DocumentsVecWithPropertyDocument = class {
1110
+ static { _classThis = this; }
1111
+ static {
1112
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1113
+ _id_decorators = [field({ type: Uint8Array })];
1114
+ _property_decorators = [field({ type: "string" })];
1115
+ _documents_decorators = [field({ type: vec(DocumentWithProperty) })];
1116
+ __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);
1117
+ __esDecorate(null, null, _property_decorators, { kind: "field", name: "property", static: false, private: false, access: { has: obj => "property" in obj, get: obj => obj.property, set: (obj, value) => { obj.property = value; } }, metadata: _metadata }, _property_initializers, _property_extraInitializers);
1118
+ __esDecorate(null, null, _documents_decorators, { kind: "field", name: "documents", static: false, private: false, access: { has: obj => "documents" in obj, get: obj => obj.documents, set: (obj, value) => { obj.documents = value; } }, metadata: _metadata }, _documents_initializers, _documents_extraInitializers);
1119
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1120
+ DocumentsVecWithPropertyDocument = _classThis = _classDescriptor.value;
1121
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1122
+ __runInitializers(_classThis, _classExtraInitializers);
1123
+ }
1124
+ id = __runInitializers(this, _id_initializers, void 0);
1125
+ property = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _property_initializers, void 0));
1126
+ documents = (__runInitializers(this, _property_extraInitializers), __runInitializers(this, _documents_initializers, void 0));
1127
+ constructor(properties) {
1128
+ __runInitializers(this, _documents_extraInitializers);
1129
+ this.id = randomBytes(32);
1130
+ this.property = properties.property;
1131
+ this.documents = properties?.documents || [];
1132
+ }
1133
+ };
1134
+ return DocumentsVecWithPropertyDocument = _classThis;
1135
+ })();
883
1136
  describe("search", () => {
884
1137
  let d1;
885
1138
  let d2;
@@ -1137,27 +1390,41 @@ export const tests = (createIndicies, type = "transient", properties) => {
1137
1390
  }),
1138
1391
  })).length).to.equal(0);
1139
1392
  });
1140
- let ArrayDoc = class ArrayDoc {
1141
- id;
1142
- // This vec will be normalized into a child table with FK -> root(id)
1143
- values;
1144
- constructor(id, values) {
1145
- this.id = id;
1146
- this.values = values;
1147
- }
1148
- };
1149
- __decorate([
1150
- id({ type: "u64" }),
1151
- __metadata("design:type", BigInt)
1152
- ], ArrayDoc.prototype, "id", void 0);
1153
- __decorate([
1154
- field({ type: vec("u64") }),
1155
- __metadata("design:type", Array)
1156
- ], ArrayDoc.prototype, "values", void 0);
1157
- ArrayDoc = __decorate([
1158
- variant(0),
1159
- __metadata("design:paramtypes", [BigInt, Array])
1160
- ], ArrayDoc);
1393
+ let ArrayDoc = (() => {
1394
+ let _classDecorators = [variant(0)];
1395
+ let _classDescriptor;
1396
+ let _classExtraInitializers = [];
1397
+ let _classThis;
1398
+ let _id_decorators;
1399
+ let _id_initializers = [];
1400
+ let _id_extraInitializers = [];
1401
+ let _values_decorators;
1402
+ let _values_initializers = [];
1403
+ let _values_extraInitializers = [];
1404
+ var ArrayDoc = class {
1405
+ static { _classThis = this; }
1406
+ static {
1407
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1408
+ _id_decorators = [id({ type: "u64" })];
1409
+ _values_decorators = [field({ type: vec("u64") })];
1410
+ __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);
1411
+ __esDecorate(null, null, _values_decorators, { kind: "field", name: "values", static: false, private: false, access: { has: obj => "values" in obj, get: obj => obj.values, set: (obj, value) => { obj.values = value; } }, metadata: _metadata }, _values_initializers, _values_extraInitializers);
1412
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1413
+ ArrayDoc = _classThis = _classDescriptor.value;
1414
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1415
+ __runInitializers(_classThis, _classExtraInitializers);
1416
+ }
1417
+ id = __runInitializers(this, _id_initializers, void 0);
1418
+ // This vec will be normalized into a child table with FK -> root(id)
1419
+ values = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _values_initializers, void 0));
1420
+ constructor(id, values) {
1421
+ __runInitializers(this, _values_extraInitializers);
1422
+ this.id = id;
1423
+ this.values = values;
1424
+ }
1425
+ };
1426
+ return ArrayDoc = _classThis;
1427
+ })();
1161
1428
  it("can add and concurrent delete", async () => {
1162
1429
  const out = await setup({ schema: ArrayDoc });
1163
1430
  store = out.store;
@@ -1221,22 +1488,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
1221
1488
  });
1222
1489
  });
1223
1490
  describe("simple value", () => {
1224
- class ArrayDocument {
1225
- id;
1226
- array;
1227
- constructor(properties) {
1228
- this.id = properties.id || randomBytes(32);
1229
- this.array = properties?.array || [];
1230
- }
1231
- }
1232
- __decorate([
1233
- field({ type: Uint8Array }),
1234
- __metadata("design:type", Uint8Array)
1235
- ], ArrayDocument.prototype, "id", void 0);
1236
- __decorate([
1237
- field({ type: vec("u32") }),
1238
- __metadata("design:type", Array)
1239
- ], ArrayDocument.prototype, "array", void 0);
1491
+ let ArrayDocument = (() => {
1492
+ let _classDecorators = [variant("ArrayDocument")];
1493
+ let _classDescriptor;
1494
+ let _classExtraInitializers = [];
1495
+ let _classThis;
1496
+ let _id_decorators;
1497
+ let _id_initializers = [];
1498
+ let _id_extraInitializers = [];
1499
+ let _array_decorators;
1500
+ let _array_initializers = [];
1501
+ let _array_extraInitializers = [];
1502
+ var ArrayDocument = class {
1503
+ static { _classThis = this; }
1504
+ static {
1505
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1506
+ _id_decorators = [field({ type: Uint8Array })];
1507
+ _array_decorators = [field({ type: vec("u32") })];
1508
+ __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);
1509
+ __esDecorate(null, null, _array_decorators, { kind: "field", name: "array", static: false, private: false, access: { has: obj => "array" in obj, get: obj => obj.array, set: (obj, value) => { obj.array = value; } }, metadata: _metadata }, _array_initializers, _array_extraInitializers);
1510
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1511
+ ArrayDocument = _classThis = _classDescriptor.value;
1512
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1513
+ __runInitializers(_classThis, _classExtraInitializers);
1514
+ }
1515
+ id = __runInitializers(this, _id_initializers, void 0);
1516
+ array = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _array_initializers, void 0));
1517
+ constructor(properties) {
1518
+ __runInitializers(this, _array_extraInitializers);
1519
+ this.id = properties.id || randomBytes(32);
1520
+ this.array = properties?.array || [];
1521
+ }
1522
+ };
1523
+ return ArrayDocument = _classThis;
1524
+ })();
1240
1525
  describe("search", () => {
1241
1526
  let d1;
1242
1527
  let d2;
@@ -1650,26 +1935,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
1650
1935
  });
1651
1936
  });
1652
1937
  describe("bigint", () => {
1653
- let BigInt = class BigInt {
1654
- id;
1655
- bigint;
1656
- constructor(id, bigint) {
1657
- this.id = id;
1658
- this.bigint = bigint;
1659
- }
1660
- };
1661
- __decorate([
1662
- id({ type: "string" }),
1663
- __metadata("design:type", String)
1664
- ], BigInt.prototype, "id", void 0);
1665
- __decorate([
1666
- field({ type: "u64" }),
1667
- __metadata("design:type", BigInt)
1668
- ], BigInt.prototype, "bigint", void 0);
1669
- BigInt = __decorate([
1670
- variant(0),
1671
- __metadata("design:paramtypes", [String, BigInt])
1672
- ], BigInt);
1938
+ let BigInt = (() => {
1939
+ let _classDecorators = [variant(0)];
1940
+ let _classDescriptor;
1941
+ let _classExtraInitializers = [];
1942
+ let _classThis;
1943
+ let _id_decorators;
1944
+ let _id_initializers = [];
1945
+ let _id_extraInitializers = [];
1946
+ let _bigint_decorators;
1947
+ let _bigint_initializers = [];
1948
+ let _bigint_extraInitializers = [];
1949
+ var BigInt = class {
1950
+ static { _classThis = this; }
1951
+ static {
1952
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1953
+ _id_decorators = [id({ type: "string" })];
1954
+ _bigint_decorators = [field({ type: "u64" })];
1955
+ __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);
1956
+ __esDecorate(null, null, _bigint_decorators, { kind: "field", name: "bigint", static: false, private: false, access: { has: obj => "bigint" in obj, get: obj => obj.bigint, set: (obj, value) => { obj.bigint = value; } }, metadata: _metadata }, _bigint_initializers, _bigint_extraInitializers);
1957
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1958
+ BigInt = _classThis = _classDescriptor.value;
1959
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1960
+ __runInitializers(_classThis, _classExtraInitializers);
1961
+ }
1962
+ id = __runInitializers(this, _id_initializers, void 0);
1963
+ bigint = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _bigint_initializers, void 0));
1964
+ constructor(id, bigint) {
1965
+ __runInitializers(this, _bigint_extraInitializers);
1966
+ this.id = id;
1967
+ this.bigint = bigint;
1968
+ }
1969
+ };
1970
+ return BigInt = _classThis;
1971
+ })();
1673
1972
  let first = 1720600661484958580n;
1674
1973
  let second = first + 1n;
1675
1974
  let third = first + 2n;
@@ -1765,42 +2064,74 @@ export const tests = (createIndicies, type = "transient", properties) => {
1765
2064
  });
1766
2065
  describe("nested", () => {
1767
2066
  describe("one level", () => {
1768
- class Nested {
1769
- number;
1770
- bool;
1771
- constructor(opts) {
1772
- this.number = opts.number;
1773
- this.bool = opts.bool;
1774
- }
1775
- }
1776
- __decorate([
1777
- field({ type: "u64" }),
1778
- __metadata("design:type", BigInt)
1779
- ], Nested.prototype, "number", void 0);
1780
- __decorate([
1781
- field({ type: "bool" }),
1782
- __metadata("design:type", Boolean)
1783
- ], Nested.prototype, "bool", void 0);
1784
- let DocumentWithNesting = class DocumentWithNesting {
1785
- id;
1786
- nested;
1787
- constructor(opts) {
1788
- this.id = opts.id;
1789
- this.nested = opts.nested;
1790
- }
1791
- };
1792
- __decorate([
1793
- id({ type: "string" }),
1794
- __metadata("design:type", String)
1795
- ], DocumentWithNesting.prototype, "id", void 0);
1796
- __decorate([
1797
- field({ type: option(Nested) }),
1798
- __metadata("design:type", Nested)
1799
- ], DocumentWithNesting.prototype, "nested", void 0);
1800
- DocumentWithNesting = __decorate([
1801
- variant(0),
1802
- __metadata("design:paramtypes", [DocumentWithNesting])
1803
- ], DocumentWithNesting);
2067
+ let Nested = (() => {
2068
+ let _classDecorators = [variant("NestedOneLevel")];
2069
+ let _classDescriptor;
2070
+ let _classExtraInitializers = [];
2071
+ let _classThis;
2072
+ let _number_decorators;
2073
+ let _number_initializers = [];
2074
+ let _number_extraInitializers = [];
2075
+ let _bool_decorators;
2076
+ let _bool_initializers = [];
2077
+ let _bool_extraInitializers = [];
2078
+ var Nested = class {
2079
+ static { _classThis = this; }
2080
+ static {
2081
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2082
+ _number_decorators = [field({ type: "u64" })];
2083
+ _bool_decorators = [field({ type: "bool" })];
2084
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2085
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
2086
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2087
+ Nested = _classThis = _classDescriptor.value;
2088
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2089
+ __runInitializers(_classThis, _classExtraInitializers);
2090
+ }
2091
+ number = __runInitializers(this, _number_initializers, void 0);
2092
+ bool = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _bool_initializers, void 0));
2093
+ constructor(opts) {
2094
+ __runInitializers(this, _bool_extraInitializers);
2095
+ this.number = opts.number;
2096
+ this.bool = opts.bool;
2097
+ }
2098
+ };
2099
+ return Nested = _classThis;
2100
+ })();
2101
+ let DocumentWithNesting = (() => {
2102
+ let _classDecorators = [variant(0)];
2103
+ let _classDescriptor;
2104
+ let _classExtraInitializers = [];
2105
+ let _classThis;
2106
+ let _id_decorators;
2107
+ let _id_initializers = [];
2108
+ let _id_extraInitializers = [];
2109
+ let _nested_decorators;
2110
+ let _nested_initializers = [];
2111
+ let _nested_extraInitializers = [];
2112
+ var DocumentWithNesting = class {
2113
+ static { _classThis = this; }
2114
+ static {
2115
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2116
+ _id_decorators = [id({ type: "string" })];
2117
+ _nested_decorators = [field({ type: option(Nested) })];
2118
+ __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);
2119
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2120
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2121
+ DocumentWithNesting = _classThis = _classDescriptor.value;
2122
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2123
+ __runInitializers(_classThis, _classExtraInitializers);
2124
+ }
2125
+ id = __runInitializers(this, _id_initializers, void 0);
2126
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2127
+ constructor(opts) {
2128
+ __runInitializers(this, _nested_extraInitializers);
2129
+ this.id = opts.id;
2130
+ this.nested = opts.nested;
2131
+ }
2132
+ };
2133
+ return DocumentWithNesting = _classThis;
2134
+ })();
1804
2135
  beforeEach(async () => {
1805
2136
  await setup({ schema: DocumentWithNesting });
1806
2137
  });
@@ -1881,36 +2212,67 @@ export const tests = (createIndicies, type = "transient", properties) => {
1881
2212
  });
1882
2213
  });
1883
2214
  describe("one level flat constructor", () => {
1884
- class Nested {
1885
- bool;
1886
- constructor(bool) {
1887
- this.bool = bool;
1888
- }
1889
- }
1890
- __decorate([
1891
- field({ type: "bool" }),
1892
- __metadata("design:type", Boolean)
1893
- ], Nested.prototype, "bool", void 0);
1894
- let DocumentWithNesting = class DocumentWithNesting {
1895
- id;
1896
- nested;
1897
- constructor(opts) {
1898
- this.id = opts.id;
1899
- this.nested = opts.nested;
1900
- }
1901
- };
1902
- __decorate([
1903
- id({ type: "string" }),
1904
- __metadata("design:type", String)
1905
- ], DocumentWithNesting.prototype, "id", void 0);
1906
- __decorate([
1907
- field({ type: option(Nested) }),
1908
- __metadata("design:type", Nested)
1909
- ], DocumentWithNesting.prototype, "nested", void 0);
1910
- DocumentWithNesting = __decorate([
1911
- variant(0),
1912
- __metadata("design:paramtypes", [DocumentWithNesting])
1913
- ], DocumentWithNesting);
2215
+ let Nested = (() => {
2216
+ let _classDecorators = [variant("NestedOneLevelFlatConstructor")];
2217
+ let _classDescriptor;
2218
+ let _classExtraInitializers = [];
2219
+ let _classThis;
2220
+ let _bool_decorators;
2221
+ let _bool_initializers = [];
2222
+ let _bool_extraInitializers = [];
2223
+ var Nested = class {
2224
+ static { _classThis = this; }
2225
+ static {
2226
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2227
+ _bool_decorators = [field({ type: "bool" })];
2228
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
2229
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2230
+ Nested = _classThis = _classDescriptor.value;
2231
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2232
+ __runInitializers(_classThis, _classExtraInitializers);
2233
+ }
2234
+ bool = __runInitializers(this, _bool_initializers, void 0);
2235
+ constructor(bool) {
2236
+ __runInitializers(this, _bool_extraInitializers);
2237
+ this.bool = bool;
2238
+ }
2239
+ };
2240
+ return Nested = _classThis;
2241
+ })();
2242
+ let DocumentWithNesting = (() => {
2243
+ let _classDecorators = [variant(0)];
2244
+ let _classDescriptor;
2245
+ let _classExtraInitializers = [];
2246
+ let _classThis;
2247
+ let _id_decorators;
2248
+ let _id_initializers = [];
2249
+ let _id_extraInitializers = [];
2250
+ let _nested_decorators;
2251
+ let _nested_initializers = [];
2252
+ let _nested_extraInitializers = [];
2253
+ var DocumentWithNesting = class {
2254
+ static { _classThis = this; }
2255
+ static {
2256
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2257
+ _id_decorators = [id({ type: "string" })];
2258
+ _nested_decorators = [field({ type: option(Nested) })];
2259
+ __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);
2260
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2261
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2262
+ DocumentWithNesting = _classThis = _classDescriptor.value;
2263
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2264
+ __runInitializers(_classThis, _classExtraInitializers);
2265
+ }
2266
+ id = __runInitializers(this, _id_initializers, void 0);
2267
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2268
+ constructor(opts) {
2269
+ __runInitializers(this, _nested_extraInitializers);
2270
+ this.id = opts.id;
2271
+ this.nested = opts.nested;
2272
+ }
2273
+ };
2274
+ return DocumentWithNesting = _classThis;
2275
+ })();
1914
2276
  beforeEach(async () => {
1915
2277
  await setup({ schema: DocumentWithNesting });
1916
2278
  });
@@ -1950,46 +2312,94 @@ export const tests = (createIndicies, type = "transient", properties) => {
1950
2312
  });
1951
2313
  });
1952
2314
  describe("2-level-variants", () => {
1953
- class L1 {
1954
- number;
1955
- constructor(opts) {
1956
- this.number = opts.number;
1957
- }
1958
- }
1959
- __decorate([
1960
- field({ type: option("u64") }),
1961
- __metadata("design:type", BigInt)
1962
- ], L1.prototype, "number", void 0);
1963
- class L0 {
1964
- nestedAgain;
1965
- constructor(opts) {
1966
- this.nestedAgain = opts.nestedAgain;
1967
- }
1968
- }
1969
- __decorate([
1970
- field({ type: option(L1) }),
1971
- __metadata("design:type", L1)
1972
- ], L0.prototype, "nestedAgain", void 0);
1973
- let DocumentWithNestedNesting = class DocumentWithNestedNesting {
1974
- id;
1975
- nested;
1976
- constructor(opts) {
1977
- this.id = opts.id;
1978
- this.nested = opts.nested;
1979
- }
1980
- };
1981
- __decorate([
1982
- id({ type: "string" }),
1983
- __metadata("design:type", String)
1984
- ], DocumentWithNestedNesting.prototype, "id", void 0);
1985
- __decorate([
1986
- field({ type: option(L0) }),
1987
- __metadata("design:type", L0)
1988
- ], DocumentWithNestedNesting.prototype, "nested", void 0);
1989
- DocumentWithNestedNesting = __decorate([
1990
- variant("DocumentWithNestedNesting"),
1991
- __metadata("design:paramtypes", [DocumentWithNestedNesting])
1992
- ], DocumentWithNestedNesting);
2315
+ let L1 = (() => {
2316
+ let _classDecorators = [variant("L1_2Level")];
2317
+ let _classDescriptor;
2318
+ let _classExtraInitializers = [];
2319
+ let _classThis;
2320
+ let _number_decorators;
2321
+ let _number_initializers = [];
2322
+ let _number_extraInitializers = [];
2323
+ var L1 = class {
2324
+ static { _classThis = this; }
2325
+ static {
2326
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2327
+ _number_decorators = [field({ type: option("u64") })];
2328
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2329
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2330
+ L1 = _classThis = _classDescriptor.value;
2331
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2332
+ __runInitializers(_classThis, _classExtraInitializers);
2333
+ }
2334
+ number = __runInitializers(this, _number_initializers, void 0);
2335
+ constructor(opts) {
2336
+ __runInitializers(this, _number_extraInitializers);
2337
+ this.number = opts.number;
2338
+ }
2339
+ };
2340
+ return L1 = _classThis;
2341
+ })();
2342
+ let L0 = (() => {
2343
+ let _classDecorators = [variant("L0_2Level")];
2344
+ let _classDescriptor;
2345
+ let _classExtraInitializers = [];
2346
+ let _classThis;
2347
+ let _nestedAgain_decorators;
2348
+ let _nestedAgain_initializers = [];
2349
+ let _nestedAgain_extraInitializers = [];
2350
+ var L0 = class {
2351
+ static { _classThis = this; }
2352
+ static {
2353
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2354
+ _nestedAgain_decorators = [field({ type: option(L1) })];
2355
+ __esDecorate(null, null, _nestedAgain_decorators, { kind: "field", name: "nestedAgain", static: false, private: false, access: { has: obj => "nestedAgain" in obj, get: obj => obj.nestedAgain, set: (obj, value) => { obj.nestedAgain = value; } }, metadata: _metadata }, _nestedAgain_initializers, _nestedAgain_extraInitializers);
2356
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2357
+ L0 = _classThis = _classDescriptor.value;
2358
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2359
+ __runInitializers(_classThis, _classExtraInitializers);
2360
+ }
2361
+ nestedAgain = __runInitializers(this, _nestedAgain_initializers, void 0);
2362
+ constructor(opts) {
2363
+ __runInitializers(this, _nestedAgain_extraInitializers);
2364
+ this.nestedAgain = opts.nestedAgain;
2365
+ }
2366
+ };
2367
+ return L0 = _classThis;
2368
+ })();
2369
+ let DocumentWithNestedNesting = (() => {
2370
+ let _classDecorators = [variant("DocumentWithNestedNesting")];
2371
+ let _classDescriptor;
2372
+ let _classExtraInitializers = [];
2373
+ let _classThis;
2374
+ let _id_decorators;
2375
+ let _id_initializers = [];
2376
+ let _id_extraInitializers = [];
2377
+ let _nested_decorators;
2378
+ let _nested_initializers = [];
2379
+ let _nested_extraInitializers = [];
2380
+ var DocumentWithNestedNesting = class {
2381
+ static { _classThis = this; }
2382
+ static {
2383
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2384
+ _id_decorators = [id({ type: "string" })];
2385
+ _nested_decorators = [field({ type: option(L0) })];
2386
+ __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);
2387
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2388
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2389
+ DocumentWithNestedNesting = _classThis = _classDescriptor.value;
2390
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2391
+ __runInitializers(_classThis, _classExtraInitializers);
2392
+ }
2393
+ id = __runInitializers(this, _id_initializers, void 0);
2394
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2395
+ constructor(opts) {
2396
+ __runInitializers(this, _nested_extraInitializers);
2397
+ this.id = opts.id;
2398
+ this.nested = opts.nested;
2399
+ }
2400
+ };
2401
+ return DocumentWithNestedNesting = _classThis;
2402
+ })();
1993
2403
  beforeEach(async () => {
1994
2404
  await setup({ schema: DocumentWithNestedNesting });
1995
2405
  });
@@ -2022,56 +2432,121 @@ export const tests = (createIndicies, type = "transient", properties) => {
2022
2432
  });
2023
2433
  });
2024
2434
  describe("3-level-variants", () => {
2025
- class L2 {
2026
- number;
2027
- constructor(opts) {
2028
- this.number = opts.number;
2029
- }
2030
- }
2031
- __decorate([
2032
- field({ type: option("u64") }),
2033
- __metadata("design:type", BigInt)
2034
- ], L2.prototype, "number", void 0);
2035
- class L1 {
2036
- nestedAgainAgain;
2037
- constructor(opts) {
2038
- this.nestedAgainAgain = opts.nestedAgainAgain;
2039
- }
2040
- }
2041
- __decorate([
2042
- field({ type: option(L2) }),
2043
- __metadata("design:type", L2)
2044
- ], L1.prototype, "nestedAgainAgain", void 0);
2045
- class L0 {
2046
- nestedAgain;
2047
- constructor(opts) {
2048
- this.nestedAgain = opts.nestedAgain;
2049
- }
2050
- }
2051
- __decorate([
2052
- field({ type: option(L1) }),
2053
- __metadata("design:type", L1)
2054
- ], L0.prototype, "nestedAgain", void 0);
2055
- let DocumentWithNestedNesting = class DocumentWithNestedNesting {
2056
- id;
2057
- nested;
2058
- constructor(opts) {
2059
- this.id = opts.id;
2060
- this.nested = opts.nested;
2061
- }
2062
- };
2063
- __decorate([
2064
- id({ type: "string" }),
2065
- __metadata("design:type", String)
2066
- ], DocumentWithNestedNesting.prototype, "id", void 0);
2067
- __decorate([
2068
- field({ type: option(L0) }),
2069
- __metadata("design:type", L0)
2070
- ], DocumentWithNestedNesting.prototype, "nested", void 0);
2071
- DocumentWithNestedNesting = __decorate([
2072
- variant("DocumentWithNestedNesting"),
2073
- __metadata("design:paramtypes", [DocumentWithNestedNesting])
2074
- ], DocumentWithNestedNesting);
2435
+ let L2 = (() => {
2436
+ let _classDecorators = [variant("L2_3Level")];
2437
+ let _classDescriptor;
2438
+ let _classExtraInitializers = [];
2439
+ let _classThis;
2440
+ let _number_decorators;
2441
+ let _number_initializers = [];
2442
+ let _number_extraInitializers = [];
2443
+ var L2 = class {
2444
+ static { _classThis = this; }
2445
+ static {
2446
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2447
+ _number_decorators = [field({ type: option("u64") })];
2448
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2449
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2450
+ L2 = _classThis = _classDescriptor.value;
2451
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2452
+ __runInitializers(_classThis, _classExtraInitializers);
2453
+ }
2454
+ number = __runInitializers(this, _number_initializers, void 0);
2455
+ constructor(opts) {
2456
+ __runInitializers(this, _number_extraInitializers);
2457
+ this.number = opts.number;
2458
+ }
2459
+ };
2460
+ return L2 = _classThis;
2461
+ })();
2462
+ let L1 = (() => {
2463
+ let _classDecorators = [variant("L1_3Level")];
2464
+ let _classDescriptor;
2465
+ let _classExtraInitializers = [];
2466
+ let _classThis;
2467
+ let _nestedAgainAgain_decorators;
2468
+ let _nestedAgainAgain_initializers = [];
2469
+ let _nestedAgainAgain_extraInitializers = [];
2470
+ var L1 = class {
2471
+ static { _classThis = this; }
2472
+ static {
2473
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2474
+ _nestedAgainAgain_decorators = [field({ type: option(L2) })];
2475
+ __esDecorate(null, null, _nestedAgainAgain_decorators, { kind: "field", name: "nestedAgainAgain", static: false, private: false, access: { has: obj => "nestedAgainAgain" in obj, get: obj => obj.nestedAgainAgain, set: (obj, value) => { obj.nestedAgainAgain = value; } }, metadata: _metadata }, _nestedAgainAgain_initializers, _nestedAgainAgain_extraInitializers);
2476
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2477
+ L1 = _classThis = _classDescriptor.value;
2478
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2479
+ __runInitializers(_classThis, _classExtraInitializers);
2480
+ }
2481
+ nestedAgainAgain = __runInitializers(this, _nestedAgainAgain_initializers, void 0);
2482
+ constructor(opts) {
2483
+ __runInitializers(this, _nestedAgainAgain_extraInitializers);
2484
+ this.nestedAgainAgain = opts.nestedAgainAgain;
2485
+ }
2486
+ };
2487
+ return L1 = _classThis;
2488
+ })();
2489
+ let L0 = (() => {
2490
+ let _classDecorators = [variant("L0_3Level")];
2491
+ let _classDescriptor;
2492
+ let _classExtraInitializers = [];
2493
+ let _classThis;
2494
+ let _nestedAgain_decorators;
2495
+ let _nestedAgain_initializers = [];
2496
+ let _nestedAgain_extraInitializers = [];
2497
+ var L0 = class {
2498
+ static { _classThis = this; }
2499
+ static {
2500
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2501
+ _nestedAgain_decorators = [field({ type: option(L1) })];
2502
+ __esDecorate(null, null, _nestedAgain_decorators, { kind: "field", name: "nestedAgain", static: false, private: false, access: { has: obj => "nestedAgain" in obj, get: obj => obj.nestedAgain, set: (obj, value) => { obj.nestedAgain = value; } }, metadata: _metadata }, _nestedAgain_initializers, _nestedAgain_extraInitializers);
2503
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2504
+ L0 = _classThis = _classDescriptor.value;
2505
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2506
+ __runInitializers(_classThis, _classExtraInitializers);
2507
+ }
2508
+ nestedAgain = __runInitializers(this, _nestedAgain_initializers, void 0);
2509
+ constructor(opts) {
2510
+ __runInitializers(this, _nestedAgain_extraInitializers);
2511
+ this.nestedAgain = opts.nestedAgain;
2512
+ }
2513
+ };
2514
+ return L0 = _classThis;
2515
+ })();
2516
+ let DocumentWithNestedNesting = (() => {
2517
+ let _classDecorators = [variant("DocumentWithNestedNesting")];
2518
+ let _classDescriptor;
2519
+ let _classExtraInitializers = [];
2520
+ let _classThis;
2521
+ let _id_decorators;
2522
+ let _id_initializers = [];
2523
+ let _id_extraInitializers = [];
2524
+ let _nested_decorators;
2525
+ let _nested_initializers = [];
2526
+ let _nested_extraInitializers = [];
2527
+ var DocumentWithNestedNesting = class {
2528
+ static { _classThis = this; }
2529
+ static {
2530
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2531
+ _id_decorators = [id({ type: "string" })];
2532
+ _nested_decorators = [field({ type: option(L0) })];
2533
+ __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);
2534
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2535
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2536
+ DocumentWithNestedNesting = _classThis = _classDescriptor.value;
2537
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2538
+ __runInitializers(_classThis, _classExtraInitializers);
2539
+ }
2540
+ id = __runInitializers(this, _id_initializers, void 0);
2541
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2542
+ constructor(opts) {
2543
+ __runInitializers(this, _nested_extraInitializers);
2544
+ this.id = opts.id;
2545
+ this.nested = opts.nested;
2546
+ }
2547
+ };
2548
+ return DocumentWithNestedNesting = _classThis;
2549
+ })();
2075
2550
  beforeEach(async () => {
2076
2551
  await setup({ schema: DocumentWithNestedNesting });
2077
2552
  });
@@ -2116,56 +2591,98 @@ export const tests = (createIndicies, type = "transient", properties) => {
2116
2591
  describe("non-array", () => {
2117
2592
  class Base {
2118
2593
  }
2119
- let V0 = class V0 extends Base {
2120
- number;
2121
- constructor(opts) {
2122
- super();
2123
- this.number = opts.number;
2124
- }
2125
- };
2126
- __decorate([
2127
- field({ type: option("u64") }),
2128
- __metadata("design:type", BigInt)
2129
- ], V0.prototype, "number", void 0);
2130
- V0 = __decorate([
2131
- variant("v0"),
2132
- __metadata("design:paramtypes", [V0])
2133
- ], V0);
2134
- let V1 = class V1 extends Base {
2135
- string;
2136
- constructor(opts) {
2137
- super();
2138
- this.string = opts.string;
2139
- }
2140
- };
2141
- __decorate([
2142
- field({ type: option("string") }),
2143
- __metadata("design:type", String)
2144
- ], V1.prototype, "string", void 0);
2145
- V1 = __decorate([
2146
- variant("v1"),
2147
- __metadata("design:paramtypes", [V1])
2148
- ], V1);
2149
- let PolymorphDocument = class PolymorphDocument {
2150
- id;
2151
- nested;
2152
- constructor(opts) {
2153
- this.id = opts.id;
2154
- this.nested = opts.nested;
2155
- }
2156
- };
2157
- __decorate([
2158
- id({ type: "string" }),
2159
- __metadata("design:type", String)
2160
- ], PolymorphDocument.prototype, "id", void 0);
2161
- __decorate([
2162
- field({ type: option(Base) }),
2163
- __metadata("design:type", Base)
2164
- ], PolymorphDocument.prototype, "nested", void 0);
2165
- PolymorphDocument = __decorate([
2166
- variant("PolymorphDocument"),
2167
- __metadata("design:paramtypes", [PolymorphDocument])
2168
- ], PolymorphDocument);
2594
+ let V0 = (() => {
2595
+ let _classDecorators = [variant("v0")];
2596
+ let _classDescriptor;
2597
+ let _classExtraInitializers = [];
2598
+ let _classThis;
2599
+ let _classSuper = Base;
2600
+ let _number_decorators;
2601
+ let _number_initializers = [];
2602
+ let _number_extraInitializers = [];
2603
+ var V0 = class extends _classSuper {
2604
+ static { _classThis = this; }
2605
+ static {
2606
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2607
+ _number_decorators = [field({ type: option("u64") })];
2608
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2609
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2610
+ V0 = _classThis = _classDescriptor.value;
2611
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2612
+ __runInitializers(_classThis, _classExtraInitializers);
2613
+ }
2614
+ number = __runInitializers(this, _number_initializers, void 0);
2615
+ constructor(opts) {
2616
+ super();
2617
+ __runInitializers(this, _number_extraInitializers);
2618
+ this.number = opts.number;
2619
+ }
2620
+ };
2621
+ return V0 = _classThis;
2622
+ })();
2623
+ let V1 = (() => {
2624
+ let _classDecorators = [variant("v1")];
2625
+ let _classDescriptor;
2626
+ let _classExtraInitializers = [];
2627
+ let _classThis;
2628
+ let _classSuper = Base;
2629
+ let _string_decorators;
2630
+ let _string_initializers = [];
2631
+ let _string_extraInitializers = [];
2632
+ var V1 = class extends _classSuper {
2633
+ static { _classThis = this; }
2634
+ static {
2635
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2636
+ _string_decorators = [field({ type: option("string") })];
2637
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
2638
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2639
+ V1 = _classThis = _classDescriptor.value;
2640
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2641
+ __runInitializers(_classThis, _classExtraInitializers);
2642
+ }
2643
+ string = __runInitializers(this, _string_initializers, void 0);
2644
+ constructor(opts) {
2645
+ super();
2646
+ __runInitializers(this, _string_extraInitializers);
2647
+ this.string = opts.string;
2648
+ }
2649
+ };
2650
+ return V1 = _classThis;
2651
+ })();
2652
+ let PolymorphDocument = (() => {
2653
+ let _classDecorators = [variant("PolymorphDocument")];
2654
+ let _classDescriptor;
2655
+ let _classExtraInitializers = [];
2656
+ let _classThis;
2657
+ let _id_decorators;
2658
+ let _id_initializers = [];
2659
+ let _id_extraInitializers = [];
2660
+ let _nested_decorators;
2661
+ let _nested_initializers = [];
2662
+ let _nested_extraInitializers = [];
2663
+ var PolymorphDocument = class {
2664
+ static { _classThis = this; }
2665
+ static {
2666
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2667
+ _id_decorators = [id({ type: "string" })];
2668
+ _nested_decorators = [field({ type: option(Base) })];
2669
+ __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);
2670
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2671
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2672
+ PolymorphDocument = _classThis = _classDescriptor.value;
2673
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2674
+ __runInitializers(_classThis, _classExtraInitializers);
2675
+ }
2676
+ id = __runInitializers(this, _id_initializers, void 0);
2677
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2678
+ constructor(opts) {
2679
+ __runInitializers(this, _nested_extraInitializers);
2680
+ this.id = opts.id;
2681
+ this.nested = opts.nested;
2682
+ }
2683
+ };
2684
+ return PolymorphDocument = _classThis;
2685
+ })();
2169
2686
  beforeEach(async () => {
2170
2687
  await setup({ schema: PolymorphDocument });
2171
2688
  });
@@ -2197,78 +2714,134 @@ export const tests = (createIndicies, type = "transient", properties) => {
2197
2714
  });
2198
2715
  });
2199
2716
  it("field poly-morph but nested not", () => {
2200
- let NestedSimple = class NestedSimple {
2201
- number;
2202
- constructor(number) {
2203
- this.number = number;
2204
- }
2205
- };
2206
- __decorate([
2207
- field({ type: "u32" }),
2208
- __metadata("design:type", Number)
2209
- ], NestedSimple.prototype, "number", void 0);
2210
- NestedSimple = __decorate([
2211
- variant(0),
2212
- __metadata("design:paramtypes", [Number])
2213
- ], NestedSimple);
2717
+ let NestedSimple = (() => {
2718
+ let _classDecorators = [variant(0)];
2719
+ let _classDescriptor;
2720
+ let _classExtraInitializers = [];
2721
+ let _classThis;
2722
+ let _number_decorators;
2723
+ let _number_initializers = [];
2724
+ let _number_extraInitializers = [];
2725
+ var NestedSimple = class {
2726
+ static { _classThis = this; }
2727
+ static {
2728
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2729
+ _number_decorators = [field({ type: "u32" })];
2730
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2731
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2732
+ NestedSimple = _classThis = _classDescriptor.value;
2733
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2734
+ __runInitializers(_classThis, _classExtraInitializers);
2735
+ }
2736
+ number = __runInitializers(this, _number_initializers, void 0);
2737
+ constructor(number) {
2738
+ __runInitializers(this, _number_extraInitializers);
2739
+ this.number = number;
2740
+ }
2741
+ };
2742
+ return NestedSimple = _classThis;
2743
+ })();
2214
2744
  class Base {
2215
2745
  }
2216
- let V0 = class V0 extends Base {
2217
- number;
2218
- nested;
2219
- constructor(opts) {
2220
- super();
2221
- this.number = opts.number;
2222
- this.nested = opts.nested;
2223
- }
2224
- };
2225
- __decorate([
2226
- field({ type: option("u64") }),
2227
- __metadata("design:type", BigInt)
2228
- ], V0.prototype, "number", void 0);
2229
- __decorate([
2230
- field({ type: NestedSimple }),
2231
- __metadata("design:type", NestedSimple)
2232
- ], V0.prototype, "nested", void 0);
2233
- V0 = __decorate([
2234
- variant("v0"),
2235
- __metadata("design:paramtypes", [V0])
2236
- ], V0);
2237
- let V1 = class V1 extends Base {
2238
- string;
2239
- constructor(opts) {
2240
- super();
2241
- this.string = opts.string;
2242
- }
2243
- };
2244
- __decorate([
2245
- field({ type: option("string") }),
2246
- __metadata("design:type", String)
2247
- ], V1.prototype, "string", void 0);
2248
- V1 = __decorate([
2249
- variant("v1"),
2250
- __metadata("design:paramtypes", [V1])
2251
- ], V1);
2252
- let PolymorphDocument = class PolymorphDocument {
2253
- id;
2254
- nested;
2255
- constructor(opts) {
2256
- this.id = opts.id;
2257
- this.nested = opts.nested;
2258
- }
2259
- };
2260
- __decorate([
2261
- id({ type: "string" }),
2262
- __metadata("design:type", String)
2263
- ], PolymorphDocument.prototype, "id", void 0);
2264
- __decorate([
2265
- field({ type: option(Base) }),
2266
- __metadata("design:type", Base)
2267
- ], PolymorphDocument.prototype, "nested", void 0);
2268
- PolymorphDocument = __decorate([
2269
- variant("PolymorphDocument"),
2270
- __metadata("design:paramtypes", [PolymorphDocument])
2271
- ], PolymorphDocument);
2746
+ let V0 = (() => {
2747
+ let _classDecorators = [variant("v0")];
2748
+ let _classDescriptor;
2749
+ let _classExtraInitializers = [];
2750
+ let _classThis;
2751
+ let _classSuper = Base;
2752
+ let _number_decorators;
2753
+ let _number_initializers = [];
2754
+ let _number_extraInitializers = [];
2755
+ let _nested_decorators;
2756
+ let _nested_initializers = [];
2757
+ let _nested_extraInitializers = [];
2758
+ var V0 = class extends _classSuper {
2759
+ static { _classThis = this; }
2760
+ static {
2761
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2762
+ _number_decorators = [field({ type: option("u64") })];
2763
+ _nested_decorators = [field({ type: NestedSimple })];
2764
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2765
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2766
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2767
+ V0 = _classThis = _classDescriptor.value;
2768
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2769
+ __runInitializers(_classThis, _classExtraInitializers);
2770
+ }
2771
+ number = __runInitializers(this, _number_initializers, void 0);
2772
+ nested = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2773
+ constructor(opts) {
2774
+ super();
2775
+ __runInitializers(this, _nested_extraInitializers);
2776
+ this.number = opts.number;
2777
+ this.nested = opts.nested;
2778
+ }
2779
+ };
2780
+ return V0 = _classThis;
2781
+ })();
2782
+ let V1 = (() => {
2783
+ let _classDecorators = [variant("v1")];
2784
+ let _classDescriptor;
2785
+ let _classExtraInitializers = [];
2786
+ let _classThis;
2787
+ let _classSuper = Base;
2788
+ let _string_decorators;
2789
+ let _string_initializers = [];
2790
+ let _string_extraInitializers = [];
2791
+ var V1 = class extends _classSuper {
2792
+ static { _classThis = this; }
2793
+ static {
2794
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2795
+ _string_decorators = [field({ type: option("string") })];
2796
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
2797
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2798
+ V1 = _classThis = _classDescriptor.value;
2799
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2800
+ __runInitializers(_classThis, _classExtraInitializers);
2801
+ }
2802
+ string = __runInitializers(this, _string_initializers, void 0);
2803
+ constructor(opts) {
2804
+ super();
2805
+ __runInitializers(this, _string_extraInitializers);
2806
+ this.string = opts.string;
2807
+ }
2808
+ };
2809
+ return V1 = _classThis;
2810
+ })();
2811
+ let PolymorphDocument = (() => {
2812
+ let _classDecorators = [variant("PolymorphDocument")];
2813
+ let _classDescriptor;
2814
+ let _classExtraInitializers = [];
2815
+ let _classThis;
2816
+ let _id_decorators;
2817
+ let _id_initializers = [];
2818
+ let _id_extraInitializers = [];
2819
+ let _nested_decorators;
2820
+ let _nested_initializers = [];
2821
+ let _nested_extraInitializers = [];
2822
+ var PolymorphDocument = class {
2823
+ static { _classThis = this; }
2824
+ static {
2825
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2826
+ _id_decorators = [id({ type: "string" })];
2827
+ _nested_decorators = [field({ type: option(Base) })];
2828
+ __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);
2829
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2830
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2831
+ PolymorphDocument = _classThis = _classDescriptor.value;
2832
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2833
+ __runInitializers(_classThis, _classExtraInitializers);
2834
+ }
2835
+ id = __runInitializers(this, _id_initializers, void 0);
2836
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2837
+ constructor(opts) {
2838
+ __runInitializers(this, _nested_extraInitializers);
2839
+ this.id = opts.id;
2840
+ this.nested = opts.nested;
2841
+ }
2842
+ };
2843
+ return PolymorphDocument = _classThis;
2844
+ })();
2272
2845
  beforeEach(async () => {
2273
2846
  await setup({ schema: PolymorphDocument });
2274
2847
  });
@@ -2303,66 +2876,125 @@ export const tests = (createIndicies, type = "transient", properties) => {
2303
2876
  describe("non-array-nested", () => {
2304
2877
  class Base {
2305
2878
  }
2306
- let V0 = class V0 extends Base {
2307
- number;
2308
- constructor(opts) {
2309
- super();
2310
- this.number = opts.number;
2311
- }
2312
- };
2313
- __decorate([
2314
- field({ type: option("u64") }),
2315
- __metadata("design:type", BigInt)
2316
- ], V0.prototype, "number", void 0);
2317
- V0 = __decorate([
2318
- variant("v0"),
2319
- __metadata("design:paramtypes", [V0])
2320
- ], V0);
2321
- let V1 = class V1 extends Base {
2322
- string;
2323
- constructor(opts) {
2324
- super();
2325
- this.string = opts.string;
2326
- }
2327
- };
2328
- __decorate([
2329
- field({ type: option("string") }),
2330
- __metadata("design:type", String)
2331
- ], V1.prototype, "string", void 0);
2332
- V1 = __decorate([
2333
- variant("v1"),
2334
- __metadata("design:paramtypes", [V1])
2335
- ], V1);
2336
- class Nested {
2337
- nestedAgain;
2338
- constructor(opts) {
2339
- this.nestedAgain = opts.nestedAgain;
2340
- }
2341
- }
2342
- __decorate([
2343
- field({ type: option(Base) }),
2344
- __metadata("design:type", Base)
2345
- ], Nested.prototype, "nestedAgain", void 0);
2346
- let PolymorphDocument = class PolymorphDocument {
2347
- id;
2348
- nested;
2349
- constructor(opts) {
2350
- this.id = opts.id;
2351
- this.nested = opts.nested;
2352
- }
2353
- };
2354
- __decorate([
2355
- id({ type: "string" }),
2356
- __metadata("design:type", String)
2357
- ], PolymorphDocument.prototype, "id", void 0);
2358
- __decorate([
2359
- field({ type: Nested }),
2360
- __metadata("design:type", Nested)
2361
- ], PolymorphDocument.prototype, "nested", void 0);
2362
- PolymorphDocument = __decorate([
2363
- variant("PolymorphDocument"),
2364
- __metadata("design:paramtypes", [PolymorphDocument])
2365
- ], PolymorphDocument);
2879
+ let V0 = (() => {
2880
+ let _classDecorators = [variant("v0")];
2881
+ let _classDescriptor;
2882
+ let _classExtraInitializers = [];
2883
+ let _classThis;
2884
+ let _classSuper = Base;
2885
+ let _number_decorators;
2886
+ let _number_initializers = [];
2887
+ let _number_extraInitializers = [];
2888
+ var V0 = class extends _classSuper {
2889
+ static { _classThis = this; }
2890
+ static {
2891
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2892
+ _number_decorators = [field({ type: option("u64") })];
2893
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
2894
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2895
+ V0 = _classThis = _classDescriptor.value;
2896
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2897
+ __runInitializers(_classThis, _classExtraInitializers);
2898
+ }
2899
+ number = __runInitializers(this, _number_initializers, void 0);
2900
+ constructor(opts) {
2901
+ super();
2902
+ __runInitializers(this, _number_extraInitializers);
2903
+ this.number = opts.number;
2904
+ }
2905
+ };
2906
+ return V0 = _classThis;
2907
+ })();
2908
+ let V1 = (() => {
2909
+ let _classDecorators = [variant("v1")];
2910
+ let _classDescriptor;
2911
+ let _classExtraInitializers = [];
2912
+ let _classThis;
2913
+ let _classSuper = Base;
2914
+ let _string_decorators;
2915
+ let _string_initializers = [];
2916
+ let _string_extraInitializers = [];
2917
+ var V1 = class extends _classSuper {
2918
+ static { _classThis = this; }
2919
+ static {
2920
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2921
+ _string_decorators = [field({ type: option("string") })];
2922
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
2923
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2924
+ V1 = _classThis = _classDescriptor.value;
2925
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2926
+ __runInitializers(_classThis, _classExtraInitializers);
2927
+ }
2928
+ string = __runInitializers(this, _string_initializers, void 0);
2929
+ constructor(opts) {
2930
+ super();
2931
+ __runInitializers(this, _string_extraInitializers);
2932
+ this.string = opts.string;
2933
+ }
2934
+ };
2935
+ return V1 = _classThis;
2936
+ })();
2937
+ let Nested = (() => {
2938
+ let _classDecorators = [variant("NestedNonArray")];
2939
+ let _classDescriptor;
2940
+ let _classExtraInitializers = [];
2941
+ let _classThis;
2942
+ let _nestedAgain_decorators;
2943
+ let _nestedAgain_initializers = [];
2944
+ let _nestedAgain_extraInitializers = [];
2945
+ var Nested = class {
2946
+ static { _classThis = this; }
2947
+ static {
2948
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2949
+ _nestedAgain_decorators = [field({ type: option(Base) })];
2950
+ __esDecorate(null, null, _nestedAgain_decorators, { kind: "field", name: "nestedAgain", static: false, private: false, access: { has: obj => "nestedAgain" in obj, get: obj => obj.nestedAgain, set: (obj, value) => { obj.nestedAgain = value; } }, metadata: _metadata }, _nestedAgain_initializers, _nestedAgain_extraInitializers);
2951
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2952
+ Nested = _classThis = _classDescriptor.value;
2953
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2954
+ __runInitializers(_classThis, _classExtraInitializers);
2955
+ }
2956
+ nestedAgain = __runInitializers(this, _nestedAgain_initializers, void 0);
2957
+ constructor(opts) {
2958
+ __runInitializers(this, _nestedAgain_extraInitializers);
2959
+ this.nestedAgain = opts.nestedAgain;
2960
+ }
2961
+ };
2962
+ return Nested = _classThis;
2963
+ })();
2964
+ let PolymorphDocument = (() => {
2965
+ let _classDecorators = [variant("PolymorphDocument")];
2966
+ let _classDescriptor;
2967
+ let _classExtraInitializers = [];
2968
+ let _classThis;
2969
+ let _id_decorators;
2970
+ let _id_initializers = [];
2971
+ let _id_extraInitializers = [];
2972
+ let _nested_decorators;
2973
+ let _nested_initializers = [];
2974
+ let _nested_extraInitializers = [];
2975
+ var PolymorphDocument = class {
2976
+ static { _classThis = this; }
2977
+ static {
2978
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2979
+ _id_decorators = [id({ type: "string" })];
2980
+ _nested_decorators = [field({ type: Nested })];
2981
+ __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);
2982
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
2983
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2984
+ PolymorphDocument = _classThis = _classDescriptor.value;
2985
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2986
+ __runInitializers(_classThis, _classExtraInitializers);
2987
+ }
2988
+ id = __runInitializers(this, _id_initializers, void 0);
2989
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
2990
+ constructor(opts) {
2991
+ __runInitializers(this, _nested_extraInitializers);
2992
+ this.id = opts.id;
2993
+ this.nested = opts.nested;
2994
+ }
2995
+ };
2996
+ return PolymorphDocument = _classThis;
2997
+ })();
2366
2998
  beforeEach(async () => {
2367
2999
  await setup({ schema: PolymorphDocument });
2368
3000
  });
@@ -2401,56 +3033,98 @@ export const tests = (createIndicies, type = "transient", properties) => {
2401
3033
  describe("polymorphism-simple-base", () => {
2402
3034
  class Base {
2403
3035
  }
2404
- let AV0 = class AV0 extends Base {
2405
- number;
2406
- constructor(opts) {
2407
- super();
2408
- this.number = opts.number;
2409
- }
2410
- };
2411
- __decorate([
2412
- field({ type: option("u64") }),
2413
- __metadata("design:type", BigInt)
2414
- ], AV0.prototype, "number", void 0);
2415
- AV0 = __decorate([
2416
- variant("av0"),
2417
- __metadata("design:paramtypes", [AV0])
2418
- ], AV0);
2419
- let AV1 = class AV1 extends Base {
2420
- string;
2421
- constructor(opts) {
2422
- super();
2423
- this.string = opts.string;
2424
- }
2425
- };
2426
- __decorate([
2427
- field({ type: option("string") }),
2428
- __metadata("design:type", String)
2429
- ], AV1.prototype, "string", void 0);
2430
- AV1 = __decorate([
2431
- variant("av1"),
2432
- __metadata("design:paramtypes", [AV1])
2433
- ], AV1);
2434
- let PolymorpArrayDocument = class PolymorpArrayDocument {
2435
- id;
2436
- array;
2437
- constructor(opts) {
2438
- this.id = opts.id;
2439
- this.array = opts.array;
2440
- }
2441
- };
2442
- __decorate([
2443
- id({ type: "string" }),
2444
- __metadata("design:type", String)
2445
- ], PolymorpArrayDocument.prototype, "id", void 0);
2446
- __decorate([
2447
- field({ type: vec(Base) }),
2448
- __metadata("design:type", Array)
2449
- ], PolymorpArrayDocument.prototype, "array", void 0);
2450
- PolymorpArrayDocument = __decorate([
2451
- variant("PolymorpArrayDocument"),
2452
- __metadata("design:paramtypes", [PolymorpArrayDocument])
2453
- ], PolymorpArrayDocument);
3036
+ let AV0 = (() => {
3037
+ let _classDecorators = [variant("av0")];
3038
+ let _classDescriptor;
3039
+ let _classExtraInitializers = [];
3040
+ let _classThis;
3041
+ let _classSuper = Base;
3042
+ let _number_decorators;
3043
+ let _number_initializers = [];
3044
+ let _number_extraInitializers = [];
3045
+ var AV0 = class extends _classSuper {
3046
+ static { _classThis = this; }
3047
+ static {
3048
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
3049
+ _number_decorators = [field({ type: option("u64") })];
3050
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
3051
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3052
+ AV0 = _classThis = _classDescriptor.value;
3053
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3054
+ __runInitializers(_classThis, _classExtraInitializers);
3055
+ }
3056
+ number = __runInitializers(this, _number_initializers, void 0);
3057
+ constructor(opts) {
3058
+ super();
3059
+ __runInitializers(this, _number_extraInitializers);
3060
+ this.number = opts.number;
3061
+ }
3062
+ };
3063
+ return AV0 = _classThis;
3064
+ })();
3065
+ let AV1 = (() => {
3066
+ let _classDecorators = [variant("av1")];
3067
+ let _classDescriptor;
3068
+ let _classExtraInitializers = [];
3069
+ let _classThis;
3070
+ let _classSuper = Base;
3071
+ let _string_decorators;
3072
+ let _string_initializers = [];
3073
+ let _string_extraInitializers = [];
3074
+ var AV1 = class extends _classSuper {
3075
+ static { _classThis = this; }
3076
+ static {
3077
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
3078
+ _string_decorators = [field({ type: option("string") })];
3079
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
3080
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3081
+ AV1 = _classThis = _classDescriptor.value;
3082
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3083
+ __runInitializers(_classThis, _classExtraInitializers);
3084
+ }
3085
+ string = __runInitializers(this, _string_initializers, void 0);
3086
+ constructor(opts) {
3087
+ super();
3088
+ __runInitializers(this, _string_extraInitializers);
3089
+ this.string = opts.string;
3090
+ }
3091
+ };
3092
+ return AV1 = _classThis;
3093
+ })();
3094
+ let PolymorpArrayDocument = (() => {
3095
+ let _classDecorators = [variant("PolymorpArrayDocument")];
3096
+ let _classDescriptor;
3097
+ let _classExtraInitializers = [];
3098
+ let _classThis;
3099
+ let _id_decorators;
3100
+ let _id_initializers = [];
3101
+ let _id_extraInitializers = [];
3102
+ let _array_decorators;
3103
+ let _array_initializers = [];
3104
+ let _array_extraInitializers = [];
3105
+ var PolymorpArrayDocument = class {
3106
+ static { _classThis = this; }
3107
+ static {
3108
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3109
+ _id_decorators = [id({ type: "string" })];
3110
+ _array_decorators = [field({ type: vec(Base) })];
3111
+ __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);
3112
+ __esDecorate(null, null, _array_decorators, { kind: "field", name: "array", static: false, private: false, access: { has: obj => "array" in obj, get: obj => obj.array, set: (obj, value) => { obj.array = value; } }, metadata: _metadata }, _array_initializers, _array_extraInitializers);
3113
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3114
+ PolymorpArrayDocument = _classThis = _classDescriptor.value;
3115
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3116
+ __runInitializers(_classThis, _classExtraInitializers);
3117
+ }
3118
+ id = __runInitializers(this, _id_initializers, void 0);
3119
+ array = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _array_initializers, void 0));
3120
+ constructor(opts) {
3121
+ __runInitializers(this, _array_extraInitializers);
3122
+ this.id = opts.id;
3123
+ this.array = opts.array;
3124
+ }
3125
+ };
3126
+ return PolymorpArrayDocument = _classThis;
3127
+ })();
2454
3128
  beforeEach(async () => {
2455
3129
  await setup({ schema: PolymorpArrayDocument });
2456
3130
  });
@@ -2492,61 +3166,115 @@ export const tests = (createIndicies, type = "transient", properties) => {
2492
3166
  });
2493
3167
  });
2494
3168
  describe("polymorphism-variant-base", () => {
2495
- let Base = class Base {
2496
- };
2497
- Base = __decorate([
2498
- variant(0)
2499
- ], Base);
2500
- let V0 = class V0 extends Base {
2501
- number;
2502
- constructor(opts) {
2503
- super();
2504
- this.number = opts.number;
2505
- }
2506
- };
2507
- __decorate([
2508
- field({ type: option("u64") }),
2509
- __metadata("design:type", BigInt)
2510
- ], V0.prototype, "number", void 0);
2511
- V0 = __decorate([
2512
- variant("bv0"),
2513
- __metadata("design:paramtypes", [V0])
2514
- ], V0);
2515
- let V1 = class V1 extends Base {
2516
- string;
2517
- constructor(opts) {
2518
- super();
2519
- this.string = opts.string;
2520
- }
2521
- };
2522
- __decorate([
2523
- field({ type: option("string") }),
2524
- __metadata("design:type", String)
2525
- ], V1.prototype, "string", void 0);
2526
- V1 = __decorate([
2527
- variant("bv1"),
2528
- __metadata("design:paramtypes", [V1])
2529
- ], V1);
2530
- let PolymorpDocument = class PolymorpDocument {
2531
- id;
2532
- base;
2533
- constructor(opts) {
2534
- this.id = opts.id;
2535
- this.base = opts.base;
2536
- }
2537
- };
2538
- __decorate([
2539
- id({ type: "string" }),
2540
- __metadata("design:type", String)
2541
- ], PolymorpDocument.prototype, "id", void 0);
2542
- __decorate([
2543
- field({ type: Base }),
2544
- __metadata("design:type", Base)
2545
- ], PolymorpDocument.prototype, "base", void 0);
2546
- PolymorpDocument = __decorate([
2547
- variant("PolymorpArrayDocument"),
2548
- __metadata("design:paramtypes", [PolymorpDocument])
2549
- ], PolymorpDocument);
3169
+ let Base = (() => {
3170
+ let _classDecorators = [variant(0)];
3171
+ let _classDescriptor;
3172
+ let _classExtraInitializers = [];
3173
+ let _classThis;
3174
+ var Base = class {
3175
+ static { _classThis = this; }
3176
+ static {
3177
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3178
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3179
+ Base = _classThis = _classDescriptor.value;
3180
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3181
+ __runInitializers(_classThis, _classExtraInitializers);
3182
+ }
3183
+ };
3184
+ return Base = _classThis;
3185
+ })();
3186
+ let V0 = (() => {
3187
+ let _classDecorators = [variant("bv0")];
3188
+ let _classDescriptor;
3189
+ let _classExtraInitializers = [];
3190
+ let _classThis;
3191
+ let _classSuper = Base;
3192
+ let _number_decorators;
3193
+ let _number_initializers = [];
3194
+ let _number_extraInitializers = [];
3195
+ var V0 = class extends _classSuper {
3196
+ static { _classThis = this; }
3197
+ static {
3198
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
3199
+ _number_decorators = [field({ type: option("u64") })];
3200
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
3201
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3202
+ V0 = _classThis = _classDescriptor.value;
3203
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3204
+ __runInitializers(_classThis, _classExtraInitializers);
3205
+ }
3206
+ number = __runInitializers(this, _number_initializers, void 0);
3207
+ constructor(opts) {
3208
+ super();
3209
+ __runInitializers(this, _number_extraInitializers);
3210
+ this.number = opts.number;
3211
+ }
3212
+ };
3213
+ return V0 = _classThis;
3214
+ })();
3215
+ let V1 = (() => {
3216
+ let _classDecorators = [variant("bv1")];
3217
+ let _classDescriptor;
3218
+ let _classExtraInitializers = [];
3219
+ let _classThis;
3220
+ let _classSuper = Base;
3221
+ let _string_decorators;
3222
+ let _string_initializers = [];
3223
+ let _string_extraInitializers = [];
3224
+ var V1 = class extends _classSuper {
3225
+ static { _classThis = this; }
3226
+ static {
3227
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
3228
+ _string_decorators = [field({ type: option("string") })];
3229
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
3230
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3231
+ V1 = _classThis = _classDescriptor.value;
3232
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3233
+ __runInitializers(_classThis, _classExtraInitializers);
3234
+ }
3235
+ string = __runInitializers(this, _string_initializers, void 0);
3236
+ constructor(opts) {
3237
+ super();
3238
+ __runInitializers(this, _string_extraInitializers);
3239
+ this.string = opts.string;
3240
+ }
3241
+ };
3242
+ return V1 = _classThis;
3243
+ })();
3244
+ let PolymorpDocument = (() => {
3245
+ let _classDecorators = [variant("PolymorpArrayDocument")];
3246
+ let _classDescriptor;
3247
+ let _classExtraInitializers = [];
3248
+ let _classThis;
3249
+ let _id_decorators;
3250
+ let _id_initializers = [];
3251
+ let _id_extraInitializers = [];
3252
+ let _base_decorators;
3253
+ let _base_initializers = [];
3254
+ let _base_extraInitializers = [];
3255
+ var PolymorpDocument = class {
3256
+ static { _classThis = this; }
3257
+ static {
3258
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3259
+ _id_decorators = [id({ type: "string" })];
3260
+ _base_decorators = [field({ type: Base })];
3261
+ __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);
3262
+ __esDecorate(null, null, _base_decorators, { kind: "field", name: "base", static: false, private: false, access: { has: obj => "base" in obj, get: obj => obj.base, set: (obj, value) => { obj.base = value; } }, metadata: _metadata }, _base_initializers, _base_extraInitializers);
3263
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3264
+ PolymorpDocument = _classThis = _classDescriptor.value;
3265
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3266
+ __runInitializers(_classThis, _classExtraInitializers);
3267
+ }
3268
+ id = __runInitializers(this, _id_initializers, void 0);
3269
+ base = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _base_initializers, void 0));
3270
+ constructor(opts) {
3271
+ __runInitializers(this, _base_extraInitializers);
3272
+ this.id = opts.id;
3273
+ this.base = opts.base;
3274
+ }
3275
+ };
3276
+ return PolymorpDocument = _classThis;
3277
+ })();
2550
3278
  beforeEach(async () => {
2551
3279
  await setup({ schema: PolymorpDocument });
2552
3280
  });
@@ -2578,36 +3306,67 @@ export const tests = (createIndicies, type = "transient", properties) => {
2578
3306
  });
2579
3307
  });
2580
3308
  describe("nested-string-array", () => {
2581
- class Nested {
2582
- arr;
2583
- constructor(opts) {
2584
- this.arr = opts.arr;
2585
- }
2586
- }
2587
- __decorate([
2588
- field({ type: vec("string") }),
2589
- __metadata("design:type", Array)
2590
- ], Nested.prototype, "arr", void 0);
2591
- let NestedArrayDocument = class NestedArrayDocument {
2592
- id;
2593
- nested;
2594
- constructor(opts) {
2595
- this.id = opts.id;
2596
- this.nested = opts.nested;
2597
- }
2598
- };
2599
- __decorate([
2600
- id({ type: "string" }),
2601
- __metadata("design:type", String)
2602
- ], NestedArrayDocument.prototype, "id", void 0);
2603
- __decorate([
2604
- field({ type: Nested }),
2605
- __metadata("design:type", Nested)
2606
- ], NestedArrayDocument.prototype, "nested", void 0);
2607
- NestedArrayDocument = __decorate([
2608
- variant("NestedArrayDocument"),
2609
- __metadata("design:paramtypes", [NestedArrayDocument])
2610
- ], NestedArrayDocument);
3309
+ let Nested = (() => {
3310
+ let _classDecorators = [variant("NestedStringArray")];
3311
+ let _classDescriptor;
3312
+ let _classExtraInitializers = [];
3313
+ let _classThis;
3314
+ let _arr_decorators;
3315
+ let _arr_initializers = [];
3316
+ let _arr_extraInitializers = [];
3317
+ var Nested = class {
3318
+ static { _classThis = this; }
3319
+ static {
3320
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3321
+ _arr_decorators = [field({ type: vec("string") })];
3322
+ __esDecorate(null, null, _arr_decorators, { kind: "field", name: "arr", static: false, private: false, access: { has: obj => "arr" in obj, get: obj => obj.arr, set: (obj, value) => { obj.arr = value; } }, metadata: _metadata }, _arr_initializers, _arr_extraInitializers);
3323
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3324
+ Nested = _classThis = _classDescriptor.value;
3325
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3326
+ __runInitializers(_classThis, _classExtraInitializers);
3327
+ }
3328
+ arr = __runInitializers(this, _arr_initializers, void 0);
3329
+ constructor(opts) {
3330
+ __runInitializers(this, _arr_extraInitializers);
3331
+ this.arr = opts.arr;
3332
+ }
3333
+ };
3334
+ return Nested = _classThis;
3335
+ })();
3336
+ let NestedArrayDocument = (() => {
3337
+ let _classDecorators = [variant("NestedArrayDocument")];
3338
+ let _classDescriptor;
3339
+ let _classExtraInitializers = [];
3340
+ let _classThis;
3341
+ let _id_decorators;
3342
+ let _id_initializers = [];
3343
+ let _id_extraInitializers = [];
3344
+ let _nested_decorators;
3345
+ let _nested_initializers = [];
3346
+ let _nested_extraInitializers = [];
3347
+ var NestedArrayDocument = class {
3348
+ static { _classThis = this; }
3349
+ static {
3350
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3351
+ _id_decorators = [id({ type: "string" })];
3352
+ _nested_decorators = [field({ type: Nested })];
3353
+ __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);
3354
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
3355
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3356
+ NestedArrayDocument = _classThis = _classDescriptor.value;
3357
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3358
+ __runInitializers(_classThis, _classExtraInitializers);
3359
+ }
3360
+ id = __runInitializers(this, _id_initializers, void 0);
3361
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
3362
+ constructor(opts) {
3363
+ __runInitializers(this, _nested_extraInitializers);
3364
+ this.id = opts.id;
3365
+ this.nested = opts.nested;
3366
+ }
3367
+ };
3368
+ return NestedArrayDocument = _classThis;
3369
+ })();
2611
3370
  beforeEach(async () => {
2612
3371
  await setup({ schema: NestedArrayDocument });
2613
3372
  });
@@ -2641,42 +3400,74 @@ export const tests = (createIndicies, type = "transient", properties) => {
2641
3400
  });
2642
3401
  });
2643
3402
  describe("nested multiple fields", () => {
2644
- class NestedMultipleFieldsDocument {
2645
- a;
2646
- b;
2647
- constructor(opts) {
2648
- this.a = opts.a;
2649
- this.b = opts.b;
2650
- }
2651
- }
2652
- __decorate([
2653
- field({ type: "string" }),
2654
- __metadata("design:type", String)
2655
- ], NestedMultipleFieldsDocument.prototype, "a", void 0);
2656
- __decorate([
2657
- field({ type: "string" }),
2658
- __metadata("design:type", String)
2659
- ], NestedMultipleFieldsDocument.prototype, "b", void 0);
2660
- let NestedMultipleFieldsArrayDocument = class NestedMultipleFieldsArrayDocument {
2661
- id;
2662
- array;
2663
- constructor(opts) {
2664
- this.id = opts.id;
2665
- this.array = opts.array;
2666
- }
2667
- };
2668
- __decorate([
2669
- id({ type: "string" }),
2670
- __metadata("design:type", String)
2671
- ], NestedMultipleFieldsArrayDocument.prototype, "id", void 0);
2672
- __decorate([
2673
- field({ type: vec(NestedMultipleFieldsDocument) }),
2674
- __metadata("design:type", Array)
2675
- ], NestedMultipleFieldsArrayDocument.prototype, "array", void 0);
2676
- NestedMultipleFieldsArrayDocument = __decorate([
2677
- variant("NestedMultipleFieldsArrayDocument"),
2678
- __metadata("design:paramtypes", [NestedMultipleFieldsArrayDocument])
2679
- ], NestedMultipleFieldsArrayDocument);
3403
+ let NestedMultipleFieldsDocument = (() => {
3404
+ let _classDecorators = [variant("NestedMultipleFieldsDocument")];
3405
+ let _classDescriptor;
3406
+ let _classExtraInitializers = [];
3407
+ let _classThis;
3408
+ let _a_decorators;
3409
+ let _a_initializers = [];
3410
+ let _a_extraInitializers = [];
3411
+ let _b_decorators;
3412
+ let _b_initializers = [];
3413
+ let _b_extraInitializers = [];
3414
+ var NestedMultipleFieldsDocument = class {
3415
+ static { _classThis = this; }
3416
+ static {
3417
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3418
+ _a_decorators = [field({ type: "string" })];
3419
+ _b_decorators = [field({ type: "string" })];
3420
+ __esDecorate(null, null, _a_decorators, { kind: "field", name: "a", static: false, private: false, access: { has: obj => "a" in obj, get: obj => obj.a, set: (obj, value) => { obj.a = value; } }, metadata: _metadata }, _a_initializers, _a_extraInitializers);
3421
+ __esDecorate(null, null, _b_decorators, { kind: "field", name: "b", static: false, private: false, access: { has: obj => "b" in obj, get: obj => obj.b, set: (obj, value) => { obj.b = value; } }, metadata: _metadata }, _b_initializers, _b_extraInitializers);
3422
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3423
+ NestedMultipleFieldsDocument = _classThis = _classDescriptor.value;
3424
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3425
+ __runInitializers(_classThis, _classExtraInitializers);
3426
+ }
3427
+ a = __runInitializers(this, _a_initializers, void 0);
3428
+ b = (__runInitializers(this, _a_extraInitializers), __runInitializers(this, _b_initializers, void 0));
3429
+ constructor(opts) {
3430
+ __runInitializers(this, _b_extraInitializers);
3431
+ this.a = opts.a;
3432
+ this.b = opts.b;
3433
+ }
3434
+ };
3435
+ return NestedMultipleFieldsDocument = _classThis;
3436
+ })();
3437
+ let NestedMultipleFieldsArrayDocument = (() => {
3438
+ let _classDecorators = [variant("NestedMultipleFieldsArrayDocument")];
3439
+ let _classDescriptor;
3440
+ let _classExtraInitializers = [];
3441
+ let _classThis;
3442
+ let _id_decorators;
3443
+ let _id_initializers = [];
3444
+ let _id_extraInitializers = [];
3445
+ let _array_decorators;
3446
+ let _array_initializers = [];
3447
+ let _array_extraInitializers = [];
3448
+ var NestedMultipleFieldsArrayDocument = class {
3449
+ static { _classThis = this; }
3450
+ static {
3451
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3452
+ _id_decorators = [id({ type: "string" })];
3453
+ _array_decorators = [field({ type: vec(NestedMultipleFieldsDocument) })];
3454
+ __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);
3455
+ __esDecorate(null, null, _array_decorators, { kind: "field", name: "array", static: false, private: false, access: { has: obj => "array" in obj, get: obj => obj.array, set: (obj, value) => { obj.array = value; } }, metadata: _metadata }, _array_initializers, _array_extraInitializers);
3456
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3457
+ NestedMultipleFieldsArrayDocument = _classThis = _classDescriptor.value;
3458
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3459
+ __runInitializers(_classThis, _classExtraInitializers);
3460
+ }
3461
+ id = __runInitializers(this, _id_initializers, void 0);
3462
+ array = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _array_initializers, void 0));
3463
+ constructor(opts) {
3464
+ __runInitializers(this, _array_extraInitializers);
3465
+ this.id = opts.id;
3466
+ this.array = opts.array;
3467
+ }
3468
+ };
3469
+ return NestedMultipleFieldsArrayDocument = _classThis;
3470
+ })();
2680
3471
  beforeEach(async () => {
2681
3472
  await setup({ schema: NestedMultipleFieldsArrayDocument });
2682
3473
  });
@@ -2862,44 +3653,81 @@ export const tests = (createIndicies, type = "transient", properties) => {
2862
3653
  });
2863
3654
  });
2864
3655
  describe("nested", () => {
2865
- class MultifieldNested {
2866
- bool;
2867
- number;
2868
- string;
2869
- constructor(bool, number, string) {
2870
- this.bool = bool;
2871
- this.number = number;
2872
- this.string = string;
2873
- }
2874
- }
2875
- __decorate([
2876
- field({ type: "bool" }),
2877
- __metadata("design:type", Boolean)
2878
- ], MultifieldNested.prototype, "bool", void 0);
2879
- __decorate([
2880
- field({ type: "u32" }),
2881
- __metadata("design:type", Number)
2882
- ], MultifieldNested.prototype, "number", void 0);
2883
- __decorate([
2884
- field({ type: vec("string") }),
2885
- __metadata("design:type", Array)
2886
- ], MultifieldNested.prototype, "string", void 0);
2887
- class NestedBoolQueryDocument {
2888
- id;
2889
- nested;
2890
- constructor(id, nested) {
2891
- this.id = id;
2892
- this.nested = nested;
2893
- }
2894
- }
2895
- __decorate([
2896
- id({ type: "string" }),
2897
- __metadata("design:type", String)
2898
- ], NestedBoolQueryDocument.prototype, "id", void 0);
2899
- __decorate([
2900
- field({ type: MultifieldNested }),
2901
- __metadata("design:type", MultifieldNested)
2902
- ], NestedBoolQueryDocument.prototype, "nested", void 0);
3656
+ let MultifieldNested = (() => {
3657
+ let _classDecorators = [variant("MultifieldNested_ShapeNested")];
3658
+ let _classDescriptor;
3659
+ let _classExtraInitializers = [];
3660
+ let _classThis;
3661
+ let _bool_decorators;
3662
+ let _bool_initializers = [];
3663
+ let _bool_extraInitializers = [];
3664
+ let _number_decorators;
3665
+ let _number_initializers = [];
3666
+ let _number_extraInitializers = [];
3667
+ let _string_decorators;
3668
+ let _string_initializers = [];
3669
+ let _string_extraInitializers = [];
3670
+ var MultifieldNested = class {
3671
+ static { _classThis = this; }
3672
+ static {
3673
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3674
+ _bool_decorators = [field({ type: "bool" })];
3675
+ _number_decorators = [field({ type: "u32" })];
3676
+ _string_decorators = [field({ type: vec("string") })];
3677
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
3678
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
3679
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
3680
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3681
+ MultifieldNested = _classThis = _classDescriptor.value;
3682
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3683
+ __runInitializers(_classThis, _classExtraInitializers);
3684
+ }
3685
+ bool = __runInitializers(this, _bool_initializers, void 0);
3686
+ number = (__runInitializers(this, _bool_extraInitializers), __runInitializers(this, _number_initializers, void 0));
3687
+ string = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _string_initializers, void 0));
3688
+ constructor(bool, number, string) {
3689
+ __runInitializers(this, _string_extraInitializers);
3690
+ this.bool = bool;
3691
+ this.number = number;
3692
+ this.string = string;
3693
+ }
3694
+ };
3695
+ return MultifieldNested = _classThis;
3696
+ })();
3697
+ let NestedBoolQueryDocument = (() => {
3698
+ let _classDecorators = [variant("NestedBoolQueryDocument_ShapeNested")];
3699
+ let _classDescriptor;
3700
+ let _classExtraInitializers = [];
3701
+ let _classThis;
3702
+ let _id_decorators;
3703
+ let _id_initializers = [];
3704
+ let _id_extraInitializers = [];
3705
+ let _nested_decorators;
3706
+ let _nested_initializers = [];
3707
+ let _nested_extraInitializers = [];
3708
+ var NestedBoolQueryDocument = class {
3709
+ static { _classThis = this; }
3710
+ static {
3711
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3712
+ _id_decorators = [id({ type: "string" })];
3713
+ _nested_decorators = [field({ type: MultifieldNested })];
3714
+ __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);
3715
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
3716
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3717
+ NestedBoolQueryDocument = _classThis = _classDescriptor.value;
3718
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3719
+ __runInitializers(_classThis, _classExtraInitializers);
3720
+ }
3721
+ id = __runInitializers(this, _id_initializers, void 0);
3722
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
3723
+ constructor(id, nested) {
3724
+ __runInitializers(this, _nested_extraInitializers);
3725
+ this.id = id;
3726
+ this.nested = nested;
3727
+ }
3728
+ };
3729
+ return NestedBoolQueryDocument = _classThis;
3730
+ })();
2903
3731
  let index;
2904
3732
  afterEach(async () => {
2905
3733
  await index.store.stop();
@@ -2967,76 +3795,126 @@ export const tests = (createIndicies, type = "transient", properties) => {
2967
3795
  describe("nested-poly", () => {
2968
3796
  class Base {
2969
3797
  }
2970
- let MultifieldNested = class MultifieldNested extends Base {
2971
- bool;
2972
- number;
2973
- string;
2974
- constructor(bool, number, string) {
2975
- super();
2976
- this.bool = bool;
2977
- this.number = number;
2978
- this.string = string;
2979
- }
2980
- };
2981
- __decorate([
2982
- field({ type: "bool" }),
2983
- __metadata("design:type", Boolean)
2984
- ], MultifieldNested.prototype, "bool", void 0);
2985
- __decorate([
2986
- field({ type: "u32" }),
2987
- __metadata("design:type", Number)
2988
- ], MultifieldNested.prototype, "number", void 0);
2989
- __decorate([
2990
- field({ type: vec("string") }),
2991
- __metadata("design:type", Array)
2992
- ], MultifieldNested.prototype, "string", void 0);
2993
- MultifieldNested = __decorate([
2994
- variant(0),
2995
- __metadata("design:paramtypes", [Boolean, Number, Array])
2996
- ], MultifieldNested);
2997
- let _AnotherMultifieldNested = class _AnotherMultifieldNested extends Base {
2998
- bool;
2999
- number;
3000
- string;
3001
- constructor(bool, number, string) {
3002
- super();
3003
- this.bool = bool;
3004
- this.number = number;
3005
- this.string = string;
3006
- }
3007
- };
3008
- __decorate([
3009
- field({ type: "bool" }),
3010
- __metadata("design:type", Boolean)
3011
- ], _AnotherMultifieldNested.prototype, "bool", void 0);
3012
- __decorate([
3013
- field({ type: "u32" }),
3014
- __metadata("design:type", Number)
3015
- ], _AnotherMultifieldNested.prototype, "number", void 0);
3016
- __decorate([
3017
- field({ type: vec("string") }),
3018
- __metadata("design:type", Array)
3019
- ], _AnotherMultifieldNested.prototype, "string", void 0);
3020
- _AnotherMultifieldNested = __decorate([
3021
- variant(1),
3022
- __metadata("design:paramtypes", [Boolean, Number, Array])
3023
- ], _AnotherMultifieldNested);
3024
- class NestedBoolQueryDocument {
3025
- id;
3026
- nested;
3027
- constructor(id, nested) {
3028
- this.id = id;
3029
- this.nested = nested;
3030
- }
3031
- }
3032
- __decorate([
3033
- id({ type: "string" }),
3034
- __metadata("design:type", String)
3035
- ], NestedBoolQueryDocument.prototype, "id", void 0);
3036
- __decorate([
3037
- field({ type: Base }),
3038
- __metadata("design:type", Base)
3039
- ], NestedBoolQueryDocument.prototype, "nested", void 0);
3798
+ let MultifieldNested = (() => {
3799
+ let _classDecorators = [variant(0)];
3800
+ let _classDescriptor;
3801
+ let _classExtraInitializers = [];
3802
+ let _classThis;
3803
+ let _classSuper = Base;
3804
+ let _bool_decorators;
3805
+ let _bool_initializers = [];
3806
+ let _bool_extraInitializers = [];
3807
+ let _number_decorators;
3808
+ let _number_initializers = [];
3809
+ let _number_extraInitializers = [];
3810
+ let _string_decorators;
3811
+ let _string_initializers = [];
3812
+ let _string_extraInitializers = [];
3813
+ var MultifieldNested = class extends _classSuper {
3814
+ static { _classThis = this; }
3815
+ static {
3816
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
3817
+ _bool_decorators = [field({ type: "bool" })];
3818
+ _number_decorators = [field({ type: "u32" })];
3819
+ _string_decorators = [field({ type: vec("string") })];
3820
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
3821
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
3822
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
3823
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3824
+ MultifieldNested = _classThis = _classDescriptor.value;
3825
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3826
+ __runInitializers(_classThis, _classExtraInitializers);
3827
+ }
3828
+ bool = __runInitializers(this, _bool_initializers, void 0);
3829
+ number = (__runInitializers(this, _bool_extraInitializers), __runInitializers(this, _number_initializers, void 0));
3830
+ string = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _string_initializers, void 0));
3831
+ constructor(bool, number, string) {
3832
+ super();
3833
+ __runInitializers(this, _string_extraInitializers);
3834
+ this.bool = bool;
3835
+ this.number = number;
3836
+ this.string = string;
3837
+ }
3838
+ };
3839
+ return MultifieldNested = _classThis;
3840
+ })();
3841
+ let _AnotherMultifieldNested = (() => {
3842
+ let _classDecorators = [variant(1)];
3843
+ let _classDescriptor;
3844
+ let _classExtraInitializers = [];
3845
+ let _classThis;
3846
+ let _classSuper = Base;
3847
+ let _bool_decorators;
3848
+ let _bool_initializers = [];
3849
+ let _bool_extraInitializers = [];
3850
+ let _number_decorators;
3851
+ let _number_initializers = [];
3852
+ let _number_extraInitializers = [];
3853
+ let _string_decorators;
3854
+ let _string_initializers = [];
3855
+ let _string_extraInitializers = [];
3856
+ var _AnotherMultifieldNested = class extends _classSuper {
3857
+ static { _classThis = this; }
3858
+ static {
3859
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
3860
+ _bool_decorators = [field({ type: "bool" })];
3861
+ _number_decorators = [field({ type: "u32" })];
3862
+ _string_decorators = [field({ type: vec("string") })];
3863
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
3864
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
3865
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
3866
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3867
+ _AnotherMultifieldNested = _classThis = _classDescriptor.value;
3868
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3869
+ __runInitializers(_classThis, _classExtraInitializers);
3870
+ }
3871
+ bool = __runInitializers(this, _bool_initializers, void 0);
3872
+ number = (__runInitializers(this, _bool_extraInitializers), __runInitializers(this, _number_initializers, void 0));
3873
+ string = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _string_initializers, void 0));
3874
+ constructor(bool, number, string) {
3875
+ super();
3876
+ __runInitializers(this, _string_extraInitializers);
3877
+ this.bool = bool;
3878
+ this.number = number;
3879
+ this.string = string;
3880
+ }
3881
+ };
3882
+ return _AnotherMultifieldNested = _classThis;
3883
+ })();
3884
+ let NestedBoolQueryDocument = (() => {
3885
+ let _classDecorators = [variant("NestedBoolQueryDocument_ShapeNestedPoly")];
3886
+ let _classDescriptor;
3887
+ let _classExtraInitializers = [];
3888
+ let _classThis;
3889
+ let _id_decorators;
3890
+ let _id_initializers = [];
3891
+ let _id_extraInitializers = [];
3892
+ let _nested_decorators;
3893
+ let _nested_initializers = [];
3894
+ let _nested_extraInitializers = [];
3895
+ var NestedBoolQueryDocument = class {
3896
+ static { _classThis = this; }
3897
+ static {
3898
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
3899
+ _id_decorators = [id({ type: "string" })];
3900
+ _nested_decorators = [field({ type: Base })];
3901
+ __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);
3902
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
3903
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
3904
+ NestedBoolQueryDocument = _classThis = _classDescriptor.value;
3905
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
3906
+ __runInitializers(_classThis, _classExtraInitializers);
3907
+ }
3908
+ id = __runInitializers(this, _id_initializers, void 0);
3909
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
3910
+ constructor(id, nested) {
3911
+ __runInitializers(this, _nested_extraInitializers);
3912
+ this.id = id;
3913
+ this.nested = nested;
3914
+ }
3915
+ };
3916
+ return NestedBoolQueryDocument = _classThis;
3917
+ })();
3040
3918
  let index;
3041
3919
  afterEach(async () => {
3042
3920
  await index.store.stop();
@@ -3102,44 +3980,81 @@ export const tests = (createIndicies, type = "transient", properties) => {
3102
3980
  });
3103
3981
  });
3104
3982
  describe("nested-array", () => {
3105
- class MultifieldNested {
3106
- bool;
3107
- number;
3108
- string;
3109
- constructor(bool, number, string) {
3110
- this.bool = bool;
3111
- this.number = number;
3112
- this.string = string;
3113
- }
3114
- }
3115
- __decorate([
3116
- field({ type: "bool" }),
3117
- __metadata("design:type", Boolean)
3118
- ], MultifieldNested.prototype, "bool", void 0);
3119
- __decorate([
3120
- field({ type: "u32" }),
3121
- __metadata("design:type", Number)
3122
- ], MultifieldNested.prototype, "number", void 0);
3123
- __decorate([
3124
- field({ type: vec("string") }),
3125
- __metadata("design:type", Array)
3126
- ], MultifieldNested.prototype, "string", void 0);
3127
- class NestedBoolQueryDocument {
3128
- id;
3129
- nested;
3130
- constructor(id, nested) {
3131
- this.id = id;
3132
- this.nested = [nested];
3133
- }
3134
- }
3135
- __decorate([
3136
- id({ type: "string" }),
3137
- __metadata("design:type", String)
3138
- ], NestedBoolQueryDocument.prototype, "id", void 0);
3139
- __decorate([
3140
- field({ type: vec(MultifieldNested) }),
3141
- __metadata("design:type", Array)
3142
- ], NestedBoolQueryDocument.prototype, "nested", void 0);
3983
+ let MultifieldNested = (() => {
3984
+ let _classDecorators = [variant("MultifieldNested_ShapeNestedArray")];
3985
+ let _classDescriptor;
3986
+ let _classExtraInitializers = [];
3987
+ let _classThis;
3988
+ let _bool_decorators;
3989
+ let _bool_initializers = [];
3990
+ let _bool_extraInitializers = [];
3991
+ let _number_decorators;
3992
+ let _number_initializers = [];
3993
+ let _number_extraInitializers = [];
3994
+ let _string_decorators;
3995
+ let _string_initializers = [];
3996
+ let _string_extraInitializers = [];
3997
+ var MultifieldNested = class {
3998
+ static { _classThis = this; }
3999
+ static {
4000
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4001
+ _bool_decorators = [field({ type: "bool" })];
4002
+ _number_decorators = [field({ type: "u32" })];
4003
+ _string_decorators = [field({ type: vec("string") })];
4004
+ __esDecorate(null, null, _bool_decorators, { kind: "field", name: "bool", static: false, private: false, access: { has: obj => "bool" in obj, get: obj => obj.bool, set: (obj, value) => { obj.bool = value; } }, metadata: _metadata }, _bool_initializers, _bool_extraInitializers);
4005
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
4006
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
4007
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4008
+ MultifieldNested = _classThis = _classDescriptor.value;
4009
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4010
+ __runInitializers(_classThis, _classExtraInitializers);
4011
+ }
4012
+ bool = __runInitializers(this, _bool_initializers, void 0);
4013
+ number = (__runInitializers(this, _bool_extraInitializers), __runInitializers(this, _number_initializers, void 0));
4014
+ string = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _string_initializers, void 0));
4015
+ constructor(bool, number, string) {
4016
+ __runInitializers(this, _string_extraInitializers);
4017
+ this.bool = bool;
4018
+ this.number = number;
4019
+ this.string = string;
4020
+ }
4021
+ };
4022
+ return MultifieldNested = _classThis;
4023
+ })();
4024
+ let NestedBoolQueryDocument = (() => {
4025
+ let _classDecorators = [variant("NestedBoolQueryDocument_ShapeNestedArray")];
4026
+ let _classDescriptor;
4027
+ let _classExtraInitializers = [];
4028
+ let _classThis;
4029
+ let _id_decorators;
4030
+ let _id_initializers = [];
4031
+ let _id_extraInitializers = [];
4032
+ let _nested_decorators;
4033
+ let _nested_initializers = [];
4034
+ let _nested_extraInitializers = [];
4035
+ var NestedBoolQueryDocument = class {
4036
+ static { _classThis = this; }
4037
+ static {
4038
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4039
+ _id_decorators = [id({ type: "string" })];
4040
+ _nested_decorators = [field({ type: vec(MultifieldNested) })];
4041
+ __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);
4042
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
4043
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4044
+ NestedBoolQueryDocument = _classThis = _classDescriptor.value;
4045
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4046
+ __runInitializers(_classThis, _classExtraInitializers);
4047
+ }
4048
+ id = __runInitializers(this, _id_initializers, void 0);
4049
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
4050
+ constructor(id, nested) {
4051
+ __runInitializers(this, _nested_extraInitializers);
4052
+ this.id = id;
4053
+ this.nested = [nested];
4054
+ }
4055
+ };
4056
+ return NestedBoolQueryDocument = _classThis;
4057
+ })();
3143
4058
  let index;
3144
4059
  afterEach(async () => {
3145
4060
  await index.store.stop();
@@ -3448,42 +4363,94 @@ export const tests = (createIndicies, type = "transient", properties) => {
3448
4363
  await assertIteratorIsDone(iterator);
3449
4364
  });
3450
4365
  describe("nested-nested-invariant", () => {
3451
- class V0 {
3452
- number;
3453
- constructor(number) {
3454
- this.number = number;
3455
- }
3456
- }
3457
- __decorate([
3458
- field({ type: "u64" }),
3459
- __metadata("design:type", BigInt)
3460
- ], V0.prototype, "number", void 0);
3461
- class NestedValue {
3462
- v0;
3463
- constructor(v0) {
3464
- this.v0 = v0;
3465
- }
3466
- }
3467
- __decorate([
3468
- field({ type: V0 }),
3469
- __metadata("design:type", V0)
3470
- ], NestedValue.prototype, "v0", void 0);
3471
- class Document {
3472
- id;
3473
- nested;
3474
- constructor(id, nested) {
3475
- this.id = id;
3476
- this.nested = nested;
3477
- }
3478
- }
3479
- __decorate([
3480
- id({ type: "string" }),
3481
- __metadata("design:type", String)
3482
- ], Document.prototype, "id", void 0);
3483
- __decorate([
3484
- field({ type: NestedValue }),
3485
- __metadata("design:type", NestedValue)
3486
- ], Document.prototype, "nested", void 0);
4366
+ let V0 = (() => {
4367
+ let _classDecorators = [variant("V0_nested_nested_invariant")];
4368
+ let _classDescriptor;
4369
+ let _classExtraInitializers = [];
4370
+ let _classThis;
4371
+ let _number_decorators;
4372
+ let _number_initializers = [];
4373
+ let _number_extraInitializers = [];
4374
+ var V0 = class {
4375
+ static { _classThis = this; }
4376
+ static {
4377
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4378
+ _number_decorators = [field({ type: "u64" })];
4379
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
4380
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4381
+ V0 = _classThis = _classDescriptor.value;
4382
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4383
+ __runInitializers(_classThis, _classExtraInitializers);
4384
+ }
4385
+ number = __runInitializers(this, _number_initializers, void 0);
4386
+ constructor(number) {
4387
+ __runInitializers(this, _number_extraInitializers);
4388
+ this.number = number;
4389
+ }
4390
+ };
4391
+ return V0 = _classThis;
4392
+ })();
4393
+ let NestedValue = (() => {
4394
+ let _classDecorators = [variant("NestedValue_nested_nested_invariant")];
4395
+ let _classDescriptor;
4396
+ let _classExtraInitializers = [];
4397
+ let _classThis;
4398
+ let _v0_decorators;
4399
+ let _v0_initializers = [];
4400
+ let _v0_extraInitializers = [];
4401
+ var NestedValue = class {
4402
+ static { _classThis = this; }
4403
+ static {
4404
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4405
+ _v0_decorators = [field({ type: V0 })];
4406
+ __esDecorate(null, null, _v0_decorators, { kind: "field", name: "v0", static: false, private: false, access: { has: obj => "v0" in obj, get: obj => obj.v0, set: (obj, value) => { obj.v0 = value; } }, metadata: _metadata }, _v0_initializers, _v0_extraInitializers);
4407
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4408
+ NestedValue = _classThis = _classDescriptor.value;
4409
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4410
+ __runInitializers(_classThis, _classExtraInitializers);
4411
+ }
4412
+ v0 = __runInitializers(this, _v0_initializers, void 0);
4413
+ constructor(v0) {
4414
+ __runInitializers(this, _v0_extraInitializers);
4415
+ this.v0 = v0;
4416
+ }
4417
+ };
4418
+ return NestedValue = _classThis;
4419
+ })();
4420
+ let Document = (() => {
4421
+ let _classDecorators = [variant("Document_nested_nested_invariant")];
4422
+ let _classDescriptor;
4423
+ let _classExtraInitializers = [];
4424
+ let _classThis;
4425
+ let _id_decorators;
4426
+ let _id_initializers = [];
4427
+ let _id_extraInitializers = [];
4428
+ let _nested_decorators;
4429
+ let _nested_initializers = [];
4430
+ let _nested_extraInitializers = [];
4431
+ var Document = class {
4432
+ static { _classThis = this; }
4433
+ static {
4434
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4435
+ _id_decorators = [id({ type: "string" })];
4436
+ _nested_decorators = [field({ type: NestedValue })];
4437
+ __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);
4438
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
4439
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4440
+ Document = _classThis = _classDescriptor.value;
4441
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4442
+ __runInitializers(_classThis, _classExtraInitializers);
4443
+ }
4444
+ id = __runInitializers(this, _id_initializers, void 0);
4445
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
4446
+ constructor(id, nested) {
4447
+ __runInitializers(this, _nested_extraInitializers);
4448
+ this.id = id;
4449
+ this.nested = nested;
4450
+ }
4451
+ };
4452
+ return Document = _classThis;
4453
+ })();
3487
4454
  const doc1 = new Document("1", new NestedValue(new V0(1n)));
3488
4455
  const doc2 = new Document("2", new NestedValue(new V0(2n)));
3489
4456
  beforeEach(async () => {
@@ -3507,46 +4474,94 @@ export const tests = (createIndicies, type = "transient", properties) => {
3507
4474
  });
3508
4475
  });
3509
4476
  describe("variant-nested-invariant", () => {
3510
- class V0 {
3511
- number;
3512
- constructor(number) {
3513
- this.number = number;
3514
- }
3515
- }
3516
- __decorate([
3517
- field({ type: "u64" }),
3518
- __metadata("design:type", BigInt)
3519
- ], V0.prototype, "number", void 0);
3520
- class NestedValue {
3521
- v0;
3522
- constructor(v0) {
3523
- this.v0 = v0;
3524
- }
3525
- }
3526
- __decorate([
3527
- field({ type: V0 }),
3528
- __metadata("design:type", V0)
3529
- ], NestedValue.prototype, "v0", void 0);
3530
- let DocumentV0 = class DocumentV0 {
3531
- id;
3532
- nested;
3533
- constructor(id, nested) {
3534
- this.id = id;
3535
- this.nested = nested;
3536
- }
3537
- };
3538
- __decorate([
3539
- id({ type: "string" }),
3540
- __metadata("design:type", String)
3541
- ], DocumentV0.prototype, "id", void 0);
3542
- __decorate([
3543
- field({ type: NestedValue }),
3544
- __metadata("design:type", NestedValue)
3545
- ], DocumentV0.prototype, "nested", void 0);
3546
- DocumentV0 = __decorate([
3547
- variant(0),
3548
- __metadata("design:paramtypes", [String, NestedValue])
3549
- ], DocumentV0);
4477
+ let V0 = (() => {
4478
+ let _classDecorators = [variant("V0_variant_nested_invariant")];
4479
+ let _classDescriptor;
4480
+ let _classExtraInitializers = [];
4481
+ let _classThis;
4482
+ let _number_decorators;
4483
+ let _number_initializers = [];
4484
+ let _number_extraInitializers = [];
4485
+ var V0 = class {
4486
+ static { _classThis = this; }
4487
+ static {
4488
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4489
+ _number_decorators = [field({ type: "u64" })];
4490
+ __esDecorate(null, null, _number_decorators, { kind: "field", name: "number", static: false, private: false, access: { has: obj => "number" in obj, get: obj => obj.number, set: (obj, value) => { obj.number = value; } }, metadata: _metadata }, _number_initializers, _number_extraInitializers);
4491
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4492
+ V0 = _classThis = _classDescriptor.value;
4493
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4494
+ __runInitializers(_classThis, _classExtraInitializers);
4495
+ }
4496
+ number = __runInitializers(this, _number_initializers, void 0);
4497
+ constructor(number) {
4498
+ __runInitializers(this, _number_extraInitializers);
4499
+ this.number = number;
4500
+ }
4501
+ };
4502
+ return V0 = _classThis;
4503
+ })();
4504
+ let NestedValue = (() => {
4505
+ let _classDecorators = [variant("NestedValue_variant_nested_invariant")];
4506
+ let _classDescriptor;
4507
+ let _classExtraInitializers = [];
4508
+ let _classThis;
4509
+ let _v0_decorators;
4510
+ let _v0_initializers = [];
4511
+ let _v0_extraInitializers = [];
4512
+ var NestedValue = class {
4513
+ static { _classThis = this; }
4514
+ static {
4515
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4516
+ _v0_decorators = [field({ type: V0 })];
4517
+ __esDecorate(null, null, _v0_decorators, { kind: "field", name: "v0", static: false, private: false, access: { has: obj => "v0" in obj, get: obj => obj.v0, set: (obj, value) => { obj.v0 = value; } }, metadata: _metadata }, _v0_initializers, _v0_extraInitializers);
4518
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4519
+ NestedValue = _classThis = _classDescriptor.value;
4520
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4521
+ __runInitializers(_classThis, _classExtraInitializers);
4522
+ }
4523
+ v0 = __runInitializers(this, _v0_initializers, void 0);
4524
+ constructor(v0) {
4525
+ __runInitializers(this, _v0_extraInitializers);
4526
+ this.v0 = v0;
4527
+ }
4528
+ };
4529
+ return NestedValue = _classThis;
4530
+ })();
4531
+ let DocumentV0 = (() => {
4532
+ let _classDecorators = [variant(0)];
4533
+ let _classDescriptor;
4534
+ let _classExtraInitializers = [];
4535
+ let _classThis;
4536
+ let _id_decorators;
4537
+ let _id_initializers = [];
4538
+ let _id_extraInitializers = [];
4539
+ let _nested_decorators;
4540
+ let _nested_initializers = [];
4541
+ let _nested_extraInitializers = [];
4542
+ var DocumentV0 = class {
4543
+ static { _classThis = this; }
4544
+ static {
4545
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4546
+ _id_decorators = [id({ type: "string" })];
4547
+ _nested_decorators = [field({ type: NestedValue })];
4548
+ __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);
4549
+ __esDecorate(null, null, _nested_decorators, { kind: "field", name: "nested", static: false, private: false, access: { has: obj => "nested" in obj, get: obj => obj.nested, set: (obj, value) => { obj.nested = value; } }, metadata: _metadata }, _nested_initializers, _nested_extraInitializers);
4550
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4551
+ DocumentV0 = _classThis = _classDescriptor.value;
4552
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4553
+ __runInitializers(_classThis, _classExtraInitializers);
4554
+ }
4555
+ id = __runInitializers(this, _id_initializers, void 0);
4556
+ nested = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _nested_initializers, void 0));
4557
+ constructor(id, nested) {
4558
+ __runInitializers(this, _nested_extraInitializers);
4559
+ this.id = id;
4560
+ this.nested = nested;
4561
+ }
4562
+ };
4563
+ return DocumentV0 = _classThis;
4564
+ })();
3550
4565
  const doc1 = new DocumentV0("1", new NestedValue(new V0(1n)));
3551
4566
  const doc2 = new DocumentV0("2", new NestedValue(new V0(2n)));
3552
4567
  beforeEach(async () => {
@@ -3744,22 +4759,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
3744
4759
  // TODO session timeouts?
3745
4760
  });
3746
4761
  describe("sum", () => {
3747
- class SummableDocument {
3748
- id;
3749
- value;
3750
- constructor(opts) {
3751
- this.id = opts.id;
3752
- this.value = opts.value;
3753
- }
3754
- }
3755
- __decorate([
3756
- field({ type: "string" }),
3757
- __metadata("design:type", String)
3758
- ], SummableDocument.prototype, "id", void 0);
3759
- __decorate([
3760
- field({ type: option("u32") }),
3761
- __metadata("design:type", Number)
3762
- ], SummableDocument.prototype, "value", void 0);
4762
+ let SummableDocument = (() => {
4763
+ let _classDecorators = [variant("SummableDocument")];
4764
+ let _classDescriptor;
4765
+ let _classExtraInitializers = [];
4766
+ let _classThis;
4767
+ let _id_decorators;
4768
+ let _id_initializers = [];
4769
+ let _id_extraInitializers = [];
4770
+ let _value_decorators;
4771
+ let _value_initializers = [];
4772
+ let _value_extraInitializers = [];
4773
+ var SummableDocument = class {
4774
+ static { _classThis = this; }
4775
+ static {
4776
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4777
+ _id_decorators = [field({ type: "string" })];
4778
+ _value_decorators = [field({ type: option("u32") })];
4779
+ __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);
4780
+ __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);
4781
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4782
+ SummableDocument = _classThis = _classDescriptor.value;
4783
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4784
+ __runInitializers(_classThis, _classExtraInitializers);
4785
+ }
4786
+ id = __runInitializers(this, _id_initializers, void 0);
4787
+ value = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _value_initializers, void 0));
4788
+ constructor(opts) {
4789
+ __runInitializers(this, _value_extraInitializers);
4790
+ this.id = opts.id;
4791
+ this.value = opts.value;
4792
+ }
4793
+ };
4794
+ return SummableDocument = _classThis;
4795
+ })();
3763
4796
  it("it returns sum", async () => {
3764
4797
  await setup({ schema: SummableDocument });
3765
4798
  await store.put(new SummableDocument({
@@ -3833,22 +4866,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
3833
4866
  });
3834
4867
  });
3835
4868
  describe("count", () => {
3836
- class NumberArrayDocument {
3837
- id;
3838
- numberArray;
3839
- constructor(opts) {
3840
- this.id = opts.id;
3841
- this.numberArray = opts.numberArray;
3842
- }
3843
- }
3844
- __decorate([
3845
- field({ type: "string" }),
3846
- __metadata("design:type", String)
3847
- ], NumberArrayDocument.prototype, "id", void 0);
3848
- __decorate([
3849
- field({ type: vec("u32") }),
3850
- __metadata("design:type", Array)
3851
- ], NumberArrayDocument.prototype, "numberArray", void 0);
4869
+ let NumberArrayDocument = (() => {
4870
+ let _classDecorators = [variant("NumberArrayDocument")];
4871
+ let _classDescriptor;
4872
+ let _classExtraInitializers = [];
4873
+ let _classThis;
4874
+ let _id_decorators;
4875
+ let _id_initializers = [];
4876
+ let _id_extraInitializers = [];
4877
+ let _numberArray_decorators;
4878
+ let _numberArray_initializers = [];
4879
+ let _numberArray_extraInitializers = [];
4880
+ var NumberArrayDocument = class {
4881
+ static { _classThis = this; }
4882
+ static {
4883
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
4884
+ _id_decorators = [field({ type: "string" })];
4885
+ _numberArray_decorators = [field({ type: vec("u32") })];
4886
+ __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);
4887
+ __esDecorate(null, null, _numberArray_decorators, { kind: "field", name: "numberArray", static: false, private: false, access: { has: obj => "numberArray" in obj, get: obj => obj.numberArray, set: (obj, value) => { obj.numberArray = value; } }, metadata: _metadata }, _numberArray_initializers, _numberArray_extraInitializers);
4888
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
4889
+ NumberArrayDocument = _classThis = _classDescriptor.value;
4890
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
4891
+ __runInitializers(_classThis, _classExtraInitializers);
4892
+ }
4893
+ id = __runInitializers(this, _id_initializers, void 0);
4894
+ numberArray = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _numberArray_initializers, void 0));
4895
+ constructor(opts) {
4896
+ __runInitializers(this, _numberArray_extraInitializers);
4897
+ this.id = opts.id;
4898
+ this.numberArray = opts.numberArray;
4899
+ }
4900
+ };
4901
+ return NumberArrayDocument = _classThis;
4902
+ })();
3852
4903
  it("it returns count", async () => {
3853
4904
  await setupDefault();
3854
4905
  const sum = await store.count();
@@ -4086,22 +5137,40 @@ export const tests = (createIndicies, type = "transient", properties) => {
4086
5137
  await subIndex.put(new Document({ id: "1", name: "hello", number: 1n, tags: [] }));
4087
5138
  });
4088
5139
  it("multi-scope insertion", async () => {
4089
- class AnotherDocument {
4090
- id;
4091
- string;
4092
- constructor(string) {
4093
- this.id = string;
4094
- this.string = string;
4095
- }
4096
- }
4097
- __decorate([
4098
- id({ type: "string" }),
4099
- __metadata("design:type", String)
4100
- ], AnotherDocument.prototype, "id", void 0);
4101
- __decorate([
4102
- field({ type: "string" }),
4103
- __metadata("design:type", String)
4104
- ], AnotherDocument.prototype, "string", void 0);
5140
+ let AnotherDocument = (() => {
5141
+ let _classDecorators = [variant("AnotherDocument")];
5142
+ let _classDescriptor;
5143
+ let _classExtraInitializers = [];
5144
+ let _classThis;
5145
+ let _id_decorators;
5146
+ let _id_initializers = [];
5147
+ let _id_extraInitializers = [];
5148
+ let _string_decorators;
5149
+ let _string_initializers = [];
5150
+ let _string_extraInitializers = [];
5151
+ var AnotherDocument = class {
5152
+ static { _classThis = this; }
5153
+ static {
5154
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
5155
+ _id_decorators = [id({ type: "string" })];
5156
+ _string_decorators = [field({ type: "string" })];
5157
+ __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);
5158
+ __esDecorate(null, null, _string_decorators, { kind: "field", name: "string", static: false, private: false, access: { has: obj => "string" in obj, get: obj => obj.string, set: (obj, value) => { obj.string = value; } }, metadata: _metadata }, _string_initializers, _string_extraInitializers);
5159
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
5160
+ AnotherDocument = _classThis = _classDescriptor.value;
5161
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
5162
+ __runInitializers(_classThis, _classExtraInitializers);
5163
+ }
5164
+ id = __runInitializers(this, _id_initializers, void 0);
5165
+ string = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _string_initializers, void 0));
5166
+ constructor(string) {
5167
+ __runInitializers(this, _string_extraInitializers);
5168
+ this.id = string;
5169
+ this.string = string;
5170
+ }
5171
+ };
5172
+ return AnotherDocument = _classThis;
5173
+ })();
4105
5174
  const scope = await createIndicies();
4106
5175
  await scope.start();
4107
5176
  const a = await scope.scope("a");