@peerbit/document 1.0.2

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.
@@ -0,0 +1,579 @@
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;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { deserialize, field, fixedArray, variant, vec, } from "@dao-xyz/borsh";
11
+ import { asString } from "./utils.js";
12
+ import { randomBytes, sha256Base64Sync } from "@peerbit/crypto";
13
+ export var Compare;
14
+ (function (Compare) {
15
+ Compare[Compare["Equal"] = 0] = "Equal";
16
+ Compare[Compare["Greater"] = 1] = "Greater";
17
+ Compare[Compare["GreaterOrEqual"] = 2] = "GreaterOrEqual";
18
+ Compare[Compare["Less"] = 3] = "Less";
19
+ Compare[Compare["LessOrEqual"] = 4] = "LessOrEqual";
20
+ })(Compare || (Compare = {}));
21
+ export const compare = (test, compare, value) => {
22
+ switch (compare) {
23
+ case Compare.Equal:
24
+ return test == value; // == because with want bigint == number at some cases
25
+ case Compare.Greater:
26
+ return test > value;
27
+ case Compare.GreaterOrEqual:
28
+ return test >= value;
29
+ case Compare.Less:
30
+ return test < value;
31
+ case Compare.LessOrEqual:
32
+ return test <= value;
33
+ default:
34
+ console.warn("Unexpected compare");
35
+ return false;
36
+ }
37
+ };
38
+ /// ----- QUERY -----
39
+ export class Query {
40
+ }
41
+ export var SortDirection;
42
+ (function (SortDirection) {
43
+ SortDirection[SortDirection["ASC"] = 0] = "ASC";
44
+ SortDirection[SortDirection["DESC"] = 1] = "DESC";
45
+ })(SortDirection || (SortDirection = {}));
46
+ export let Sort = class Sort {
47
+ key;
48
+ direction;
49
+ constructor(properties) {
50
+ this.key = Array.isArray(properties.key)
51
+ ? properties.key
52
+ : [properties.key];
53
+ this.direction = properties.direction || SortDirection.ASC;
54
+ }
55
+ };
56
+ __decorate([
57
+ field({ type: vec("string") }),
58
+ __metadata("design:type", Array)
59
+ ], Sort.prototype, "key", void 0);
60
+ __decorate([
61
+ field({ type: "u8" }),
62
+ __metadata("design:type", Number)
63
+ ], Sort.prototype, "direction", void 0);
64
+ Sort = __decorate([
65
+ variant(0),
66
+ __metadata("design:paramtypes", [Object])
67
+ ], Sort);
68
+ export class AbstractSearchRequest {
69
+ }
70
+ /**
71
+ * Search with query and collect with sort conditionss
72
+ */
73
+ const toArray = (arr) => (arr ? (Array.isArray(arr) ? arr : [arr]) : undefined) || [];
74
+ export let SearchRequest = class SearchRequest extends AbstractSearchRequest {
75
+ id; // Session id
76
+ query;
77
+ sort;
78
+ fetch;
79
+ constructor(props) {
80
+ super();
81
+ this.id = randomBytes(32);
82
+ this.query = toArray(props?.query);
83
+ this.sort = toArray(props?.sort);
84
+ this.fetch = 1;
85
+ }
86
+ _idString;
87
+ get idString() {
88
+ return this._idString || (this._idString = sha256Base64Sync(this.id));
89
+ }
90
+ };
91
+ __decorate([
92
+ field({ type: fixedArray("u8", 32) }),
93
+ __metadata("design:type", Uint8Array)
94
+ ], SearchRequest.prototype, "id", void 0);
95
+ __decorate([
96
+ field({ type: vec(Query) }),
97
+ __metadata("design:type", Array)
98
+ ], SearchRequest.prototype, "query", void 0);
99
+ __decorate([
100
+ field({ type: vec(Sort) }),
101
+ __metadata("design:type", Array)
102
+ ], SearchRequest.prototype, "sort", void 0);
103
+ __decorate([
104
+ field({ type: "u32" }),
105
+ __metadata("design:type", Number)
106
+ ], SearchRequest.prototype, "fetch", void 0);
107
+ SearchRequest = __decorate([
108
+ variant(0),
109
+ __metadata("design:paramtypes", [Object])
110
+ ], SearchRequest);
111
+ /**
112
+ * Collect documents from peers using 'collect' session ids. This is used for distributed sorting internally
113
+ */
114
+ export let CollectNextRequest = class CollectNextRequest extends AbstractSearchRequest {
115
+ id; // collect with id
116
+ amount; // number of documents to ask for
117
+ constructor(properties) {
118
+ super();
119
+ this.id = properties.id;
120
+ this.amount = properties.amount;
121
+ }
122
+ _idString;
123
+ get idString() {
124
+ return this._idString || (this._idString = sha256Base64Sync(this.id));
125
+ }
126
+ };
127
+ __decorate([
128
+ field({ type: fixedArray("u8", 32) }),
129
+ __metadata("design:type", Uint8Array)
130
+ ], CollectNextRequest.prototype, "id", void 0);
131
+ __decorate([
132
+ field({ type: "u32" }),
133
+ __metadata("design:type", Number)
134
+ ], CollectNextRequest.prototype, "amount", void 0);
135
+ CollectNextRequest = __decorate([
136
+ variant(2),
137
+ __metadata("design:paramtypes", [Object])
138
+ ], CollectNextRequest);
139
+ export let CloseIteratorRequest = class CloseIteratorRequest extends AbstractSearchRequest {
140
+ id; // collect with id
141
+ constructor(properties) {
142
+ super();
143
+ this.id = properties.id;
144
+ }
145
+ _idString;
146
+ get idString() {
147
+ return this._idString || (this._idString = sha256Base64Sync(this.id));
148
+ }
149
+ };
150
+ __decorate([
151
+ field({ type: fixedArray("u8", 32) }),
152
+ __metadata("design:type", Uint8Array)
153
+ ], CloseIteratorRequest.prototype, "id", void 0);
154
+ CloseIteratorRequest = __decorate([
155
+ variant(3),
156
+ __metadata("design:paramtypes", [Object])
157
+ ], CloseIteratorRequest);
158
+ export let LogicalQuery = class LogicalQuery extends Query {
159
+ };
160
+ LogicalQuery = __decorate([
161
+ variant(1)
162
+ ], LogicalQuery);
163
+ export let And = class And extends LogicalQuery {
164
+ and;
165
+ constructor(and) {
166
+ super();
167
+ this.and = and;
168
+ }
169
+ };
170
+ __decorate([
171
+ field({ type: vec(Query) }),
172
+ __metadata("design:type", Array)
173
+ ], And.prototype, "and", void 0);
174
+ And = __decorate([
175
+ variant(0),
176
+ __metadata("design:paramtypes", [Array])
177
+ ], And);
178
+ export let Or = class Or extends LogicalQuery {
179
+ or;
180
+ constructor(or) {
181
+ super();
182
+ this.or = or;
183
+ }
184
+ };
185
+ __decorate([
186
+ field({ type: vec(Query) }),
187
+ __metadata("design:type", Array)
188
+ ], Or.prototype, "or", void 0);
189
+ Or = __decorate([
190
+ variant(1),
191
+ __metadata("design:paramtypes", [Array])
192
+ ], Or);
193
+ export let StateQuery = class StateQuery extends Query {
194
+ };
195
+ StateQuery = __decorate([
196
+ variant(2)
197
+ ], StateQuery);
198
+ export let StateFieldQuery = class StateFieldQuery extends StateQuery {
199
+ key;
200
+ constructor(props) {
201
+ super();
202
+ this.key = Array.isArray(props.key) ? props.key : [props.key];
203
+ }
204
+ };
205
+ __decorate([
206
+ field({ type: vec("string") }),
207
+ __metadata("design:type", Array)
208
+ ], StateFieldQuery.prototype, "key", void 0);
209
+ StateFieldQuery = __decorate([
210
+ variant(1),
211
+ __metadata("design:paramtypes", [Object])
212
+ ], StateFieldQuery);
213
+ export class PrimitiveValue {
214
+ }
215
+ export let StringValue = class StringValue extends PrimitiveValue {
216
+ string;
217
+ constructor(string) {
218
+ super();
219
+ this.string = string;
220
+ }
221
+ };
222
+ __decorate([
223
+ field({ type: "string" }),
224
+ __metadata("design:type", String)
225
+ ], StringValue.prototype, "string", void 0);
226
+ StringValue = __decorate([
227
+ variant(0),
228
+ __metadata("design:paramtypes", [String])
229
+ ], StringValue);
230
+ let NumberValue = class NumberValue extends PrimitiveValue {
231
+ };
232
+ NumberValue = __decorate([
233
+ variant(1)
234
+ ], NumberValue);
235
+ let IntegerValue = class IntegerValue extends NumberValue {
236
+ };
237
+ IntegerValue = __decorate([
238
+ variant(0)
239
+ ], IntegerValue);
240
+ export let UnsignedIntegerValue = class UnsignedIntegerValue extends IntegerValue {
241
+ number;
242
+ constructor(number) {
243
+ super();
244
+ if (Number.isInteger(number) === false ||
245
+ number > 4294967295 ||
246
+ number < 0) {
247
+ throw new Error("Number is not u32");
248
+ }
249
+ this.number = number;
250
+ }
251
+ get value() {
252
+ return this.number;
253
+ }
254
+ };
255
+ __decorate([
256
+ field({ type: "u32" }),
257
+ __metadata("design:type", Number)
258
+ ], UnsignedIntegerValue.prototype, "number", void 0);
259
+ UnsignedIntegerValue = __decorate([
260
+ variant(0),
261
+ __metadata("design:paramtypes", [Number])
262
+ ], UnsignedIntegerValue);
263
+ export let BigUnsignedIntegerValue = class BigUnsignedIntegerValue extends IntegerValue {
264
+ number;
265
+ constructor(number) {
266
+ super();
267
+ if (number > 18446744073709551615n || number < 0) {
268
+ throw new Error("Number is not u32");
269
+ }
270
+ this.number = number;
271
+ }
272
+ get value() {
273
+ return this.number;
274
+ }
275
+ };
276
+ __decorate([
277
+ field({ type: "u64" }),
278
+ __metadata("design:type", BigInt)
279
+ ], BigUnsignedIntegerValue.prototype, "number", void 0);
280
+ BigUnsignedIntegerValue = __decorate([
281
+ variant(1),
282
+ __metadata("design:paramtypes", [BigInt])
283
+ ], BigUnsignedIntegerValue);
284
+ export let ByteMatchQuery = class ByteMatchQuery extends StateFieldQuery {
285
+ value;
286
+ _reserved; // Replcate MemoryCompare query with this?
287
+ constructor(props) {
288
+ super(props);
289
+ this.value = props.value;
290
+ this._reserved = 0;
291
+ }
292
+ _valueString;
293
+ /**
294
+ * value `asString`
295
+ */
296
+ get valueString() {
297
+ return this._valueString ?? (this._valueString = asString(this.value));
298
+ }
299
+ };
300
+ __decorate([
301
+ field({ type: Uint8Array }),
302
+ __metadata("design:type", Uint8Array)
303
+ ], ByteMatchQuery.prototype, "value", void 0);
304
+ __decorate([
305
+ field({ type: "u8" }),
306
+ __metadata("design:type", Number)
307
+ ], ByteMatchQuery.prototype, "_reserved", void 0);
308
+ ByteMatchQuery = __decorate([
309
+ variant(1),
310
+ __metadata("design:paramtypes", [Object])
311
+ ], ByteMatchQuery);
312
+ export var StringMatchMethod;
313
+ (function (StringMatchMethod) {
314
+ StringMatchMethod[StringMatchMethod["exact"] = 0] = "exact";
315
+ StringMatchMethod[StringMatchMethod["prefix"] = 1] = "prefix";
316
+ StringMatchMethod[StringMatchMethod["contains"] = 2] = "contains";
317
+ })(StringMatchMethod || (StringMatchMethod = {}));
318
+ export let StringMatch = class StringMatch extends StateFieldQuery {
319
+ value;
320
+ method;
321
+ caseInsensitive;
322
+ constructor(props) {
323
+ super(props);
324
+ this.value = props.value;
325
+ this.method = props.method ?? StringMatchMethod.exact;
326
+ this.caseInsensitive = props.caseInsensitive ?? false;
327
+ }
328
+ };
329
+ __decorate([
330
+ field({ type: "string" }),
331
+ __metadata("design:type", String)
332
+ ], StringMatch.prototype, "value", void 0);
333
+ __decorate([
334
+ field({ type: "u8" }),
335
+ __metadata("design:type", Number)
336
+ ], StringMatch.prototype, "method", void 0);
337
+ __decorate([
338
+ field({ type: "bool" }),
339
+ __metadata("design:type", Boolean)
340
+ ], StringMatch.prototype, "caseInsensitive", void 0);
341
+ StringMatch = __decorate([
342
+ variant(2),
343
+ __metadata("design:paramtypes", [Object])
344
+ ], StringMatch);
345
+ export let IntegerCompare = class IntegerCompare extends StateFieldQuery {
346
+ compare;
347
+ value;
348
+ constructor(props) {
349
+ super(props);
350
+ if (props.value instanceof IntegerValue) {
351
+ this.value = props.value;
352
+ }
353
+ else {
354
+ if (typeof props.value === "bigint") {
355
+ this.value = new BigUnsignedIntegerValue(props.value);
356
+ }
357
+ else {
358
+ this.value = new UnsignedIntegerValue(props.value);
359
+ }
360
+ }
361
+ this.compare = props.compare;
362
+ }
363
+ };
364
+ __decorate([
365
+ field({ type: "u8" }),
366
+ __metadata("design:type", Number)
367
+ ], IntegerCompare.prototype, "compare", void 0);
368
+ __decorate([
369
+ field({ type: IntegerValue }),
370
+ __metadata("design:type", IntegerValue)
371
+ ], IntegerCompare.prototype, "value", void 0);
372
+ IntegerCompare = __decorate([
373
+ variant(3),
374
+ __metadata("design:paramtypes", [Object])
375
+ ], IntegerCompare);
376
+ export let MissingField = class MissingField extends StateFieldQuery {
377
+ constructor(props) {
378
+ super(props);
379
+ }
380
+ };
381
+ MissingField = __decorate([
382
+ variant(4),
383
+ __metadata("design:paramtypes", [Object])
384
+ ], MissingField);
385
+ export let BoolQuery = class BoolQuery extends StateFieldQuery {
386
+ value;
387
+ constructor(props) {
388
+ super(props);
389
+ this.value = props.value;
390
+ }
391
+ };
392
+ __decorate([
393
+ field({ type: "bool" }),
394
+ __metadata("design:type", Boolean)
395
+ ], BoolQuery.prototype, "value", void 0);
396
+ BoolQuery = __decorate([
397
+ variant(5),
398
+ __metadata("design:paramtypes", [Object])
399
+ ], BoolQuery);
400
+ // TODO MemoryCompareQuery can be replaces with ByteMatchQuery? Or Nesteed Queries + ByteMatchQuery?
401
+ /* @variant(0)
402
+ export class MemoryCompare {
403
+ @field({ type: Uint8Array })
404
+ bytes: Uint8Array;
405
+
406
+ @field({ type: "u64" })
407
+ offset: bigint;
408
+
409
+ constructor(opts?: { bytes: Uint8Array; offset: bigint }) {
410
+ if (opts) {
411
+ this.bytes = opts.bytes;
412
+ this.offset = opts.offset;
413
+ }
414
+ }
415
+ }
416
+
417
+ @variant(4)
418
+ export class MemoryCompareQuery extends Query {
419
+ @field({ type: vec(MemoryCompare) })
420
+ compares: MemoryCompare[];
421
+
422
+ constructor(opts?: { compares: MemoryCompare[] }) {
423
+ super();
424
+ if (opts) {
425
+ this.compares = opts.compares;
426
+ }
427
+ }
428
+ } */
429
+ /// ----- RESULTS -----
430
+ export class Result {
431
+ }
432
+ export let Context = class Context {
433
+ created;
434
+ modified;
435
+ head;
436
+ constructor(properties) {
437
+ if (properties) {
438
+ this.created = properties.created;
439
+ this.modified = properties.modified;
440
+ this.head = properties.head;
441
+ }
442
+ }
443
+ };
444
+ __decorate([
445
+ field({ type: "u64" }),
446
+ __metadata("design:type", BigInt)
447
+ ], Context.prototype, "created", void 0);
448
+ __decorate([
449
+ field({ type: "u64" }),
450
+ __metadata("design:type", BigInt)
451
+ ], Context.prototype, "modified", void 0);
452
+ __decorate([
453
+ field({ type: "string" }),
454
+ __metadata("design:type", String)
455
+ ], Context.prototype, "head", void 0);
456
+ Context = __decorate([
457
+ variant(0),
458
+ __metadata("design:paramtypes", [Object])
459
+ ], Context);
460
+ export let ResultWithSource = class ResultWithSource extends Result {
461
+ _source;
462
+ context;
463
+ _type;
464
+ constructor(opts) {
465
+ super();
466
+ this._source = opts.source;
467
+ this.context = opts.context;
468
+ this._value = opts.value;
469
+ }
470
+ init(type) {
471
+ this._type = type;
472
+ }
473
+ _value;
474
+ get value() {
475
+ if (this._value) {
476
+ return this._value;
477
+ }
478
+ if (!this._source) {
479
+ throw new Error("Missing source binary");
480
+ }
481
+ this._value = deserialize(this._source, this._type);
482
+ return this._value;
483
+ }
484
+ };
485
+ __decorate([
486
+ field({ type: Uint8Array }),
487
+ __metadata("design:type", Uint8Array)
488
+ ], ResultWithSource.prototype, "_source", void 0);
489
+ __decorate([
490
+ field({ type: Context }),
491
+ __metadata("design:type", Context)
492
+ ], ResultWithSource.prototype, "context", void 0);
493
+ ResultWithSource = __decorate([
494
+ variant(0),
495
+ __metadata("design:paramtypes", [Object])
496
+ ], ResultWithSource);
497
+ export let Results = class Results {
498
+ results;
499
+ kept; // how many results that were not sent, but can be collected later
500
+ constructor(properties) {
501
+ this.kept = properties.kept;
502
+ this.results = properties.results;
503
+ }
504
+ };
505
+ __decorate([
506
+ field({ type: vec(ResultWithSource) }),
507
+ __metadata("design:type", Array)
508
+ ], Results.prototype, "results", void 0);
509
+ __decorate([
510
+ field({ type: "u64" }),
511
+ __metadata("design:type", BigInt)
512
+ ], Results.prototype, "kept", void 0);
513
+ Results = __decorate([
514
+ variant(0),
515
+ __metadata("design:paramtypes", [Object])
516
+ ], Results);
517
+ /* @variant(5)
518
+ export class LogQuery extends Query { } */
519
+ /**
520
+ * Find logs that can be decrypted by certain keys
521
+ */
522
+ /*
523
+ @variant(0)
524
+ export class EntryEncryptedByQuery
525
+ extends LogQuery
526
+ implements
527
+ EntryEncryptionTemplate<
528
+ X25519PublicKey[],
529
+ X25519PublicKey[],
530
+ X25519PublicKey[],
531
+ X25519PublicKey[]
532
+ >
533
+ {
534
+ @field({ type: vec(X25519PublicKey) })
535
+ metadata: X25519PublicKey[];
536
+
537
+ @field({ type: vec(X25519PublicKey) })
538
+ payload: X25519PublicKey[];
539
+
540
+ @field({ type: vec(X25519PublicKey) })
541
+ next: X25519PublicKey[];
542
+
543
+ @field({ type: vec(X25519PublicKey) })
544
+ signatures: X25519PublicKey[];
545
+
546
+ constructor(properties?: {
547
+ metadata: X25519PublicKey[];
548
+ next: X25519PublicKey[];
549
+ payload: X25519PublicKey[];
550
+ signatures: X25519PublicKey[];
551
+ }) {
552
+ super();
553
+ if (properties) {
554
+ this.metadata = properties.metadata;
555
+ this.payload = properties.payload;
556
+ this.next = properties.next;
557
+ this.signatures = properties.signatures;
558
+ }
559
+ }
560
+ }
561
+
562
+ @variant(1)
563
+ export class SignedByQuery extends LogQuery {
564
+ @field({ type: vec(PublicSignKey) })
565
+ _publicKeys: PublicSignKey[];
566
+
567
+ constructor(properties: { publicKeys: PublicSignKey[] }) {
568
+ super();
569
+ if (properties) {
570
+ this._publicKeys = properties.publicKeys;
571
+ }
572
+ }
573
+
574
+ get publicKeys() {
575
+ return this._publicKeys;
576
+ }
577
+ }
578
+ */
579
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAEN,WAAW,EACX,KAAK,EACL,UAAU,EACV,OAAO,EACP,GAAG,GACH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,CAAN,IAAY,OAMX;AAND,WAAY,OAAO;IAClB,uCAA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AC,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD,CAAA;AA5BA;IADC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;8BACnB,UAAU;iDAAC;AAGpB;IADC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8BAChB,OAAO;iDAAC;AALL,gBAAgB;IAD5B,OAAO,CAAC,CAAC,CAAC;;GACE,gBAAgB,CA8B5B;AAGM,WAAM,OAAO,GAAb,MAAM,OAAO;IAEnB,OAAO,CAAwB;IAG/B,IAAI,CAAS,CAAC,kEAAkE;IAEhF,YAAY,UAA4D;QACvE,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACnC,CAAC;CACD,CAAA;AATA;IADC,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;;wCACR;AAG/B;IADC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qCACV;AALD,OAAO;IADnB,OAAO,CAAC,CAAC,CAAC;;GACE,OAAO,CAWnB;AAED;0CAC0C;AAE1C;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG"}
@@ -0,0 +1,3 @@
1
+ export type Keyable = string | Uint8Array;
2
+ export declare const asString: (obj: Keyable) => string;
3
+ export declare const checkKeyable: (obj: Keyable) => void;
@@ -0,0 +1,12 @@
1
+ import { toBase64 } from "@peerbit/crypto";
2
+ export const asString = (obj) => typeof obj === "string" ? obj : toBase64(obj);
3
+ export const checkKeyable = (obj) => {
4
+ if (obj == null) {
5
+ throw new Error(`The provided key value is null or undefined, expecting string or Uint8array`);
6
+ }
7
+ if (typeof obj === "string" || obj instanceof Uint8Array) {
8
+ return;
9
+ }
10
+ throw new Error("Key is not string or Uint8array, key value: " + typeof obj);
11
+ };
12
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAY,EAAE,EAAE,CACxC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAY,EAAE,EAAE;IAC5C,IAAI,GAAG,IAAI,IAAI,EAAE;QAChB,MAAM,IAAI,KAAK,CACd,6EAA6E,CAC7E,CAAC;KACF;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,YAAY,UAAU,EAAE;QACzD,OAAO;KACP;IAED,MAAM,IAAI,KAAK,CAAC,8CAA8C,GAAG,OAAO,GAAG,CAAC,CAAC;AAC9E,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@peerbit/document",
3
+ "version": "1.0.2",
4
+ "description": "Document Store for orbit-db with binary ser/der",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "module": "lib/esm/index.js",
8
+ "types": "lib/esm/index.d.ts",
9
+ "exports": {
10
+ "import": "./lib/esm/index.js",
11
+ "require": "./lib/cjs/index.js"
12
+ },
13
+ "files": [
14
+ "lib",
15
+ "src",
16
+ "!src/**/__tests__",
17
+ "!lib/**/__tests__",
18
+ "!src/**/__benchmark__",
19
+ "!lib/**/__benchmark__",
20
+ "LICENSE"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "scripts": {
26
+ "clean": "shx rm -rf lib/*",
27
+ "build": "yarn clean && tsc -p tsconfig.json",
28
+ "postbuild": "echo '{\"type\":\"module\"} ' | node ../../../../node_modules/.bin/json > lib/esm/package.json",
29
+ "test": "node ../../../../node_modules/.bin/jest test -c ../../../../jest.config.ts --runInBand --forceExit",
30
+ "test:unit": "node ../../../../node_modules/.bin/jest test -c ../../../../jest.config.unit.ts --runInBand --forceExit",
31
+ "test:integration": "node ../node_modules/.bin/jest test -c ../../../../jest.config.integration.ts --runInBand --forceExit"
32
+ },
33
+ "author": "dao.xyz",
34
+ "license": "MIT",
35
+ "dependencies": {
36
+ "@dao-xyz/borsh": "^5.1.5",
37
+ "@peerbit/program": "1.0.1",
38
+ "@peerbit/rpc": "1.0.2",
39
+ "@peerbit/shared-log": "1.0.2"
40
+ },
41
+ "devDependencies": {
42
+ "@peerbit/test-utils": "1.0.2",
43
+ "@peerbit/time": "1.0.0"
44
+ },
45
+ "gitHead": "595db9f1efebf604393eddfff5f678f5d8f16142"
46
+ }