@peerbit/document 6.0.6 → 6.0.7-218a5bb
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/README.md +2 -2
- package/dist/benchmark/index.d.ts +2 -0
- package/dist/benchmark/index.d.ts.map +1 -0
- package/dist/benchmark/index.js +126 -0
- package/dist/benchmark/index.js.map +1 -0
- package/dist/benchmark/replication.d.ts +2 -0
- package/dist/benchmark/replication.d.ts.map +1 -0
- package/dist/benchmark/replication.js +174 -0
- package/dist/benchmark/replication.js.map +1 -0
- package/dist/src/constants.d.ts +2 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +2 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/program.d.ts +90 -0
- package/dist/src/program.d.ts.map +1 -0
- package/{lib/esm/document-store.js → dist/src/program.js} +141 -109
- package/dist/src/program.js.map +1 -0
- package/dist/src/search.d.ts +118 -0
- package/dist/src/search.d.ts.map +1 -0
- package/{lib/esm/document-index.js → dist/src/search.js} +246 -446
- package/dist/src/search.js.map +1 -0
- package/package.json +69 -43
- package/src/constants.ts +1 -0
- package/src/index.ts +4 -3
- package/src/{document-store.ts → program.ts} +216 -183
- package/src/search.ts +997 -0
- package/LICENSE +0 -202
- package/lib/esm/document-index.d.ts +0 -147
- package/lib/esm/document-index.js.map +0 -1
- package/lib/esm/document-store.d.ts +0 -72
- package/lib/esm/document-store.js.map +0 -1
- package/lib/esm/index.d.ts +0 -3
- package/lib/esm/index.js +0 -4
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/query.d.ts +0 -191
- package/lib/esm/query.js +0 -615
- package/lib/esm/query.js.map +0 -1
- package/lib/esm/utils.d.ts +0 -3
- package/lib/esm/utils.js +0 -12
- package/lib/esm/utils.js.map +0 -1
- package/src/document-index.ts +0 -1268
- package/src/query.ts +0 -525
- package/src/utils.ts +0 -17
package/lib/esm/query.d.ts
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { AbstractType } from "@dao-xyz/borsh";
|
|
2
|
-
export declare enum Compare {
|
|
3
|
-
Equal = 0,
|
|
4
|
-
Greater = 1,
|
|
5
|
-
GreaterOrEqual = 2,
|
|
6
|
-
Less = 3,
|
|
7
|
-
LessOrEqual = 4
|
|
8
|
-
}
|
|
9
|
-
export declare const compare: (test: bigint | number, compare: Compare, value: bigint | number) => boolean;
|
|
10
|
-
export declare abstract class Query {
|
|
11
|
-
clone(): this;
|
|
12
|
-
}
|
|
13
|
-
export declare enum SortDirection {
|
|
14
|
-
ASC = 0,
|
|
15
|
-
DESC = 1
|
|
16
|
-
}
|
|
17
|
-
export declare class Sort {
|
|
18
|
-
key: string[];
|
|
19
|
-
direction: SortDirection;
|
|
20
|
-
constructor(properties: {
|
|
21
|
-
key: string[] | string;
|
|
22
|
-
direction?: SortDirection;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export declare abstract class AbstractSearchRequest {
|
|
26
|
-
}
|
|
27
|
-
export declare class SearchRequest extends AbstractSearchRequest {
|
|
28
|
-
id: Uint8Array;
|
|
29
|
-
query: Query[];
|
|
30
|
-
sort: Sort[];
|
|
31
|
-
fetch: number;
|
|
32
|
-
constructor(props?: {
|
|
33
|
-
query?: Query[] | Query;
|
|
34
|
-
sort?: Sort[] | Sort;
|
|
35
|
-
});
|
|
36
|
-
private _idString;
|
|
37
|
-
get idString(): string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Collect documents from peers using 'collect' session ids. This is used for distributed sorting internally
|
|
41
|
-
*/
|
|
42
|
-
export declare class CollectNextRequest extends AbstractSearchRequest {
|
|
43
|
-
id: Uint8Array;
|
|
44
|
-
amount: number;
|
|
45
|
-
constructor(properties: {
|
|
46
|
-
id: Uint8Array;
|
|
47
|
-
amount: number;
|
|
48
|
-
});
|
|
49
|
-
private _idString;
|
|
50
|
-
get idString(): string;
|
|
51
|
-
}
|
|
52
|
-
export declare class CloseIteratorRequest extends AbstractSearchRequest {
|
|
53
|
-
id: Uint8Array;
|
|
54
|
-
constructor(properties: {
|
|
55
|
-
id: Uint8Array;
|
|
56
|
-
});
|
|
57
|
-
private _idString;
|
|
58
|
-
get idString(): string;
|
|
59
|
-
}
|
|
60
|
-
export declare abstract class LogicalQuery extends Query {
|
|
61
|
-
}
|
|
62
|
-
export declare class And extends LogicalQuery {
|
|
63
|
-
and: Query[];
|
|
64
|
-
constructor(and: Query[]);
|
|
65
|
-
}
|
|
66
|
-
export declare class Or extends LogicalQuery {
|
|
67
|
-
or: Query[];
|
|
68
|
-
constructor(or: Query[]);
|
|
69
|
-
}
|
|
70
|
-
export declare abstract class StateQuery extends Query {
|
|
71
|
-
}
|
|
72
|
-
export declare class StateFieldQuery extends StateQuery {
|
|
73
|
-
key: string[];
|
|
74
|
-
constructor(props: {
|
|
75
|
-
key: string[] | string;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
export declare abstract class PrimitiveValue {
|
|
79
|
-
}
|
|
80
|
-
export declare class StringValue extends PrimitiveValue {
|
|
81
|
-
string: string;
|
|
82
|
-
constructor(string: string);
|
|
83
|
-
}
|
|
84
|
-
declare abstract class NumberValue extends PrimitiveValue {
|
|
85
|
-
abstract get value(): number | bigint;
|
|
86
|
-
}
|
|
87
|
-
declare abstract class IntegerValue extends NumberValue {
|
|
88
|
-
}
|
|
89
|
-
export declare class UnsignedIntegerValue extends IntegerValue {
|
|
90
|
-
number: number;
|
|
91
|
-
constructor(number: number);
|
|
92
|
-
get value(): number;
|
|
93
|
-
}
|
|
94
|
-
export declare class BigUnsignedIntegerValue extends IntegerValue {
|
|
95
|
-
number: bigint;
|
|
96
|
-
constructor(number: bigint);
|
|
97
|
-
get value(): bigint;
|
|
98
|
-
}
|
|
99
|
-
export declare class ByteMatchQuery extends StateFieldQuery {
|
|
100
|
-
value: Uint8Array;
|
|
101
|
-
private _reserved;
|
|
102
|
-
constructor(props: {
|
|
103
|
-
key: string[] | string;
|
|
104
|
-
value: Uint8Array;
|
|
105
|
-
});
|
|
106
|
-
_valueString: string;
|
|
107
|
-
/**
|
|
108
|
-
* value `asString`
|
|
109
|
-
*/
|
|
110
|
-
get valueString(): string;
|
|
111
|
-
}
|
|
112
|
-
export declare enum StringMatchMethod {
|
|
113
|
-
"exact" = 0,
|
|
114
|
-
"prefix" = 1,
|
|
115
|
-
"contains" = 2
|
|
116
|
-
}
|
|
117
|
-
export declare class StringMatch extends StateFieldQuery {
|
|
118
|
-
value: string;
|
|
119
|
-
method: StringMatchMethod;
|
|
120
|
-
caseInsensitive: boolean;
|
|
121
|
-
constructor(props: {
|
|
122
|
-
key: string[] | string;
|
|
123
|
-
value: string;
|
|
124
|
-
method?: StringMatchMethod;
|
|
125
|
-
caseInsensitive?: boolean;
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
export declare class IntegerCompare extends StateFieldQuery {
|
|
129
|
-
compare: Compare;
|
|
130
|
-
value: IntegerValue;
|
|
131
|
-
constructor(props: {
|
|
132
|
-
key: string[] | string;
|
|
133
|
-
value: bigint | number | IntegerValue;
|
|
134
|
-
compare: Compare;
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
export declare class MissingField extends StateFieldQuery {
|
|
138
|
-
constructor(props: {
|
|
139
|
-
key: string[] | string;
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
export declare class BoolQuery extends StateFieldQuery {
|
|
143
|
-
value: boolean;
|
|
144
|
-
constructor(props: {
|
|
145
|
-
key: string[] | string;
|
|
146
|
-
value: boolean;
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
export declare abstract class Result {
|
|
150
|
-
}
|
|
151
|
-
export declare class Context {
|
|
152
|
-
created: bigint;
|
|
153
|
-
modified: bigint;
|
|
154
|
-
head: string;
|
|
155
|
-
gid: string;
|
|
156
|
-
constructor(properties: {
|
|
157
|
-
created: bigint;
|
|
158
|
-
modified: bigint;
|
|
159
|
-
head: string;
|
|
160
|
-
gid: string;
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
export declare class ResultWithSource<T> extends Result {
|
|
164
|
-
_source: Uint8Array;
|
|
165
|
-
context: Context;
|
|
166
|
-
_type: AbstractType<T>;
|
|
167
|
-
constructor(opts: {
|
|
168
|
-
source: Uint8Array;
|
|
169
|
-
context: Context;
|
|
170
|
-
value?: T;
|
|
171
|
-
});
|
|
172
|
-
init(type: AbstractType<T>): void;
|
|
173
|
-
_value?: T;
|
|
174
|
-
get value(): T;
|
|
175
|
-
}
|
|
176
|
-
export declare abstract class AbstractSearchResult<T> {
|
|
177
|
-
}
|
|
178
|
-
export declare class Results<T> extends AbstractSearchResult<T> {
|
|
179
|
-
results: ResultWithSource<T>[];
|
|
180
|
-
kept: bigint;
|
|
181
|
-
constructor(properties: {
|
|
182
|
-
results: ResultWithSource<T>[];
|
|
183
|
-
kept: bigint;
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
export declare class NoAccess extends AbstractSearchResult<any> {
|
|
187
|
-
}
|
|
188
|
-
export {};
|
|
189
|
-
/**
|
|
190
|
-
* Find logs that can be decrypted by certain keys
|
|
191
|
-
*/
|