@peerbit/string 4.1.26 → 5.0.0-55cebfe
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/{lib/esm → dist/src}/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{lib/esm → dist/src}/query.d.ts +4 -3
- package/dist/src/query.d.ts.map +1 -0
- package/{lib/esm → dist/src}/query.js +4 -9
- package/dist/src/query.js.map +1 -0
- package/{lib/esm → dist/src}/range.d.ts +1 -0
- package/dist/src/range.d.ts.map +1 -0
- package/{lib/esm → dist/src}/string-index.d.ts +2 -1
- package/dist/src/string-index.d.ts.map +1 -0
- package/{lib/esm → dist/src}/string-index.js +4 -3
- package/dist/src/string-index.js.map +1 -0
- package/{lib/esm → dist/src}/string-store.d.ts +8 -7
- package/dist/src/string-store.d.ts.map +1 -0
- package/{lib/esm → dist/src}/string-store.js +25 -23
- package/dist/src/string-store.js.map +1 -0
- package/package.json +69 -42
- package/src/query.ts +7 -12
- package/src/string-index.ts +5 -5
- package/src/string-store.ts +38 -38
- package/LICENSE +0 -202
- package/lib/esm/query.js.map +0 -1
- package/lib/esm/string-index.js.map +0 -1
- package/lib/esm/string-store.js.map +0 -1
- /package/{lib/esm → dist/src}/index.js +0 -0
- /package/{lib/esm → dist/src}/index.js.map +0 -0
- /package/{lib/esm → dist/src}/range.js +0 -0
- /package/{lib/esm → dist/src}/range.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -8,14 +8,14 @@ export declare class RangeMetadata {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class RangeMetadatas {
|
|
10
10
|
metadatas: RangeMetadata[];
|
|
11
|
-
constructor(opts
|
|
11
|
+
constructor(opts: {
|
|
12
12
|
metadatas: RangeMetadata[];
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
export declare class StringMatch {
|
|
16
16
|
value: string;
|
|
17
17
|
exactMatch: boolean;
|
|
18
|
-
constructor(properties
|
|
18
|
+
constructor(properties: {
|
|
19
19
|
value: string;
|
|
20
20
|
exactMatch: boolean;
|
|
21
21
|
});
|
|
@@ -23,7 +23,7 @@ export declare class StringMatch {
|
|
|
23
23
|
}
|
|
24
24
|
export declare class SearchRequest {
|
|
25
25
|
query: StringMatch[];
|
|
26
|
-
constructor(properties
|
|
26
|
+
constructor(properties: {
|
|
27
27
|
query: StringMatch[];
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -39,3 +39,4 @@ export declare class StringResult extends AbstractSearchResult {
|
|
|
39
39
|
}
|
|
40
40
|
export declare class NoAccess extends AbstractSearchResult {
|
|
41
41
|
}
|
|
42
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":"AAEA,qBACa,aAAa;IAEzB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;gBAEH,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAKrD;AAED,qBACa,cAAc;IAE1B,SAAS,EAAE,aAAa,EAAE,CAAC;gBAEf,IAAI,EAAE;QAAE,SAAS,EAAE,aAAa,EAAE,CAAA;KAAE;CAGhD;AAID,qBACa,WAAW;IAEvB,KAAK,EAAE,MAAM,CAAC;IAGd,UAAU,EAAE,OAAO,CAAC;gBAER,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE;IAI9D,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAMlC;AAED,qBACa,aAAa;IAEzB,KAAK,EAAG,WAAW,EAAE,CAAC;gBAEV,UAAU,EAAE;QAAE,KAAK,EAAE,WAAW,EAAE,CAAA;KAAE;CAGhD;AAGD,8BAAsB,oBAAoB;CAAG;AAE7C,qBACa,YAAa,SAAQ,oBAAoB;IAErD,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,cAAc,CAAC;gBAEf,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,cAAc,CAAA;KAAE;CAKtE;AAED,qBACa,QAAS,SAAQ,oBAAoB;CAAG"}
|
|
@@ -33,9 +33,7 @@ export { RangeMetadata };
|
|
|
33
33
|
let RangeMetadatas = class RangeMetadatas {
|
|
34
34
|
metadatas;
|
|
35
35
|
constructor(opts) {
|
|
36
|
-
|
|
37
|
-
this.metadatas = opts.metadatas;
|
|
38
|
-
}
|
|
36
|
+
this.metadatas = opts.metadatas;
|
|
39
37
|
}
|
|
40
38
|
};
|
|
41
39
|
__decorate([
|
|
@@ -52,9 +50,8 @@ let StringMatch = class StringMatch {
|
|
|
52
50
|
value;
|
|
53
51
|
exactMatch;
|
|
54
52
|
constructor(properties) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
53
|
+
this.value = properties.value;
|
|
54
|
+
this.exactMatch = properties.exactMatch;
|
|
58
55
|
}
|
|
59
56
|
preprocess(string) {
|
|
60
57
|
if (this.exactMatch) {
|
|
@@ -79,9 +76,7 @@ export { StringMatch };
|
|
|
79
76
|
let SearchRequest = class SearchRequest {
|
|
80
77
|
query;
|
|
81
78
|
constructor(properties) {
|
|
82
|
-
|
|
83
|
-
this.query = properties.query;
|
|
84
|
-
}
|
|
79
|
+
this.query = properties.query;
|
|
85
80
|
}
|
|
86
81
|
};
|
|
87
82
|
__decorate([
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":";;;;;;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"mappings":"AAEA,qBACa,KAAK;IAEjB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;gBAEH,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;CAQxE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Change, Log } from "@peerbit/log";
|
|
1
|
+
import { type Change, Log } from "@peerbit/log";
|
|
2
2
|
import { Entry } from "@peerbit/log";
|
|
3
3
|
import { Program } from "@peerbit/program";
|
|
4
4
|
import { Range } from "./range.js";
|
|
@@ -22,3 +22,4 @@ export declare class StringIndex extends Program {
|
|
|
22
22
|
}
|
|
23
23
|
export declare const applyOperations: (string: string, operations: Entry<StringOperation>[]) => Promise<string>;
|
|
24
24
|
export declare const applyOperation: (s: string, operation: StringOperation) => string;
|
|
25
|
+
//# sourceMappingURL=string-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-index.d.ts","sourceRoot":"","sources":["../../src/string-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBACa,eAAe;IAE3B,KAAK,EAAE,KAAK,CAAC;IAGb,KAAK,CAAC,EAAE,MAAM,CAAC;gBAEH,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;CAMpD;AACD,eAAO,MAAM,QAAQ,kDAAkC,CAAC;AAExD,qBACa,WAAY,SAAQ,OAAO;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;;IAM3B,IAAI,MAAM,IAAI,MAAM,CAEnB;IACK,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,eAAe,CAAC;IAItC,KAAK,CAAC,MAAM,EAAE,GAAG;IAMX,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC;CAGlD;AAED,eAAO,MAAM,eAAe,WACnB,MAAM,cACF,KAAK,CAAC,eAAe,CAAC,EAAE,KAClC,OAAO,CAAC,MAAM,CAYhB,CAAC;AACF,eAAO,MAAM,cAAc,MACvB,MAAM,aACE,eAAe,KACxB,MAcF,CAAC"}
|
|
@@ -8,7 +8,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { field, option, variant } from "@dao-xyz/borsh";
|
|
11
|
-
import { BORSH_ENCODING } from "@peerbit/log";
|
|
11
|
+
import { BORSH_ENCODING, Log } from "@peerbit/log";
|
|
12
|
+
import { Entry } from "@peerbit/log";
|
|
12
13
|
import { Program } from "@peerbit/program";
|
|
13
14
|
import { Range } from "./range.js";
|
|
14
15
|
let StringOperation = class StringOperation {
|
|
@@ -54,7 +55,7 @@ let StringIndex = class StringIndex extends Program {
|
|
|
54
55
|
return super.close(parent);
|
|
55
56
|
}
|
|
56
57
|
async updateIndex(_change) {
|
|
57
|
-
this._string = await applyOperations("", await this._log.
|
|
58
|
+
this._string = await applyOperations("", await this._log.toArray()); // TODO improve performance
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
StringIndex = __decorate([
|
|
@@ -76,7 +77,7 @@ export const applyOperations = async (string, operations) => {
|
|
|
76
77
|
export const applyOperation = (s, operation) => {
|
|
77
78
|
// TODO check bounds number
|
|
78
79
|
const to = Number(operation.index.offset) + Number(operation.index.length);
|
|
79
|
-
if (operation.value
|
|
80
|
+
if (operation.value !== undefined) {
|
|
80
81
|
s = s.padEnd(to);
|
|
81
82
|
s =
|
|
82
83
|
s.slice(0, Number(operation.index.offset)) +
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-index.js","sourceRoot":"","sources":["../../src/string-index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAe,GAAG,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAG5B,IAAM,eAAe,GAArB,MAAM,eAAe;IAE3B,KAAK,CAAQ;IAGb,KAAK,CAAU;IAEf,YAAY,KAAwC;QACnD,IAAI,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,CAAC;IACF,CAAC;CACD,CAAA;AAXA;IADC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8BAChB,KAAK;8CAAC;AAGb;IADC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;;8CACnB;AALH,eAAe;IAD3B,OAAO,CAAC,CAAC,CAAC;;GACE,eAAe,CAa3B;;AACD,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAGjD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,OAAO;IACvC,OAAO,CAAS;IAChB,IAAI,CAAuB;IAC3B;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,IAAI,MAAM;QACT,OAAO,IAAI,CA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,CAAS,EACT,SAA0B,EACjB,EAAE;IACX,2BAA2B;IAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3E,IAAI,SAAS,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACnC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;YACA,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC1C,SAAS,CAAC,KAAK;gBACf,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACV,CAAC;SAAM,CAAC;QACP,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AppendOptions, Change, Entry } from "@peerbit/log";
|
|
2
|
-
import { SharedLog, SharedLogOptions } from "@peerbit/shared-log";
|
|
3
1
|
import { PublicSignKey } from "@peerbit/crypto";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { type AppendOptions, type Change, Entry } from "@peerbit/log";
|
|
3
|
+
import { Program, type ProgramEvents } from "@peerbit/program";
|
|
4
|
+
import { RPC, type RPCRequestOptions, type RequestContext } from "@peerbit/rpc";
|
|
5
|
+
import { SharedLog, type SharedLogOptions } from "@peerbit/shared-log";
|
|
7
6
|
import { AbstractSearchResult, SearchRequest } from "./query.js";
|
|
8
7
|
import { Range } from "./range.js";
|
|
8
|
+
import { StringIndex, StringOperation } from "./string-index.js";
|
|
9
9
|
export declare const STRING_STORE_TYPE = "string_store";
|
|
10
10
|
export type CanRead = (key?: PublicSignKey) => Promise<boolean> | boolean;
|
|
11
11
|
export interface StringEvents {
|
|
@@ -33,11 +33,11 @@ export declare class DString extends Program<Args, StringEvents & ProgramEvents>
|
|
|
33
33
|
private _canPerform;
|
|
34
34
|
add(value: string, index: Range, options?: AppendOptions<StringOperation>): Promise<{
|
|
35
35
|
entry: Entry<StringOperation>;
|
|
36
|
-
removed:
|
|
36
|
+
removed: import("@peerbit/log").ShallowOrFullEntry<StringOperation>[];
|
|
37
37
|
}>;
|
|
38
38
|
del(index: Range, options?: AppendOptions<StringOperation>): Promise<{
|
|
39
39
|
entry: Entry<StringOperation>;
|
|
40
|
-
removed:
|
|
40
|
+
removed: import("@peerbit/log").ShallowOrFullEntry<StringOperation>[];
|
|
41
41
|
}>;
|
|
42
42
|
queryHandler(query: SearchRequest, ctx: RequestContext): Promise<AbstractSearchResult | undefined>;
|
|
43
43
|
getValue(options?: {
|
|
@@ -47,3 +47,4 @@ export declare class DString extends Program<Args, StringEvents & ProgramEvents>
|
|
|
47
47
|
};
|
|
48
48
|
}): Promise<string | undefined>;
|
|
49
49
|
}
|
|
50
|
+
//# sourceMappingURL=string-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-store.d.ts","sourceRoot":"","sources":["../../src/string-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAoB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,KAAK,gBA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ACjD;IAOK,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI;YAyCX,WAAW;IAgBnB,GAAG,CACR,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC;;;;IAcnC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC;;;;IAI1D,YAAY,CACjB,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,cAAc,GACjB,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAkDtC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACxB,MAAM,EAAE;YACP,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC;YAClC,YAAY,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;SACtD,CAAC;KACF,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAqC/B"}
|
|
@@ -8,15 +8,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { field, variant } from "@dao-xyz/borsh";
|
|
11
|
-
import {
|
|
12
|
-
import { sha256Base64Sync } from "@peerbit/crypto";
|
|
11
|
+
import { CustomEvent } from "@libp2p/interface";
|
|
12
|
+
import { PublicSignKey, sha256Base64Sync } from "@peerbit/crypto";
|
|
13
|
+
import { Entry } from "@peerbit/log";
|
|
14
|
+
import { logger as loggerFn } from "@peerbit/logger";
|
|
13
15
|
import { Program } from "@peerbit/program";
|
|
14
16
|
import { RPC } from "@peerbit/rpc";
|
|
15
|
-
import {
|
|
16
|
-
import { StringOperation, StringIndex, encoding } from "./string-index.js";
|
|
17
|
-
import { NoAccess, RangeMetadata, RangeMetadatas, StringMatch, SearchRequest, StringResult } from "./query.js";
|
|
18
|
-
import { CustomEvent } from "@libp2p/interface";
|
|
17
|
+
import { SharedLog } from "@peerbit/shared-log";
|
|
19
18
|
import { concat, fromString } from "uint8arrays";
|
|
19
|
+
import { AbstractSearchResult, NoAccess, RangeMetadata, RangeMetadatas, SearchRequest, StringMatch, StringResult, } from "./query.js";
|
|
20
|
+
import { Range } from "./range.js";
|
|
21
|
+
import { StringIndex, StringOperation, encoding } from "./string-index.js";
|
|
20
22
|
const logger = loggerFn({ module: "string" });
|
|
21
23
|
export const STRING_STORE_TYPE = "string_store";
|
|
22
24
|
const findAllOccurrences = (str, substr) => {
|
|
@@ -45,7 +47,7 @@ let DString = class DString extends Program {
|
|
|
45
47
|
await this._log.open({
|
|
46
48
|
encoding,
|
|
47
49
|
replicas: {
|
|
48
|
-
min: 0xffffffff // assume a document can not be sharded?
|
|
50
|
+
min: 0xffffffff, // assume a document can not be sharded?
|
|
49
51
|
},
|
|
50
52
|
canAppend: async (entry) => {
|
|
51
53
|
const operation = await entry.getPayloadValue();
|
|
@@ -59,17 +61,18 @@ let DString = class DString extends Program {
|
|
|
59
61
|
onChange: async (change) => {
|
|
60
62
|
await this._index.updateIndex(change);
|
|
61
63
|
this.events.dispatchEvent(new CustomEvent("change", {
|
|
62
|
-
detail: change
|
|
64
|
+
detail: change,
|
|
63
65
|
}));
|
|
64
|
-
}
|
|
66
|
+
},
|
|
65
67
|
});
|
|
66
68
|
await this.query.open({
|
|
67
69
|
...options,
|
|
68
70
|
topic: sha256Base64Sync(concat([this._log.log.id, fromString("/dstring")])),
|
|
69
71
|
responseHandler: this.queryHandler.bind(this),
|
|
70
72
|
queryType: SearchRequest,
|
|
71
|
-
responseType: StringResult
|
|
73
|
+
responseType: StringResult,
|
|
72
74
|
});
|
|
75
|
+
await this._log.reload(); // TODO make it so that it does not reload the whole log (i.e. persist the generated string in some way)
|
|
73
76
|
}
|
|
74
77
|
async _canPerform(operation, context) {
|
|
75
78
|
if (this._log.log.length === 0 || context.entry.next.length === 0) {
|
|
@@ -77,7 +80,7 @@ let DString = class DString extends Program {
|
|
|
77
80
|
}
|
|
78
81
|
else {
|
|
79
82
|
for (const next of context.entry.next) {
|
|
80
|
-
if (this._log.log.has(next)) {
|
|
83
|
+
if (await this._log.log.has(next)) {
|
|
81
84
|
return true;
|
|
82
85
|
}
|
|
83
86
|
}
|
|
@@ -87,10 +90,10 @@ let DString = class DString extends Program {
|
|
|
87
90
|
async add(value, index, options) {
|
|
88
91
|
return this._log.append(new StringOperation({
|
|
89
92
|
index,
|
|
90
|
-
value
|
|
93
|
+
value,
|
|
91
94
|
}), {
|
|
92
95
|
...options,
|
|
93
|
-
meta: { ...options?.meta, next: await this._log.log.getHeads() }
|
|
96
|
+
meta: { ...options?.meta, next: await this._log.log.getHeads().all() }, // TODO: optimize
|
|
94
97
|
});
|
|
95
98
|
}
|
|
96
99
|
async del(index, options) {
|
|
@@ -98,7 +101,7 @@ let DString = class DString extends Program {
|
|
|
98
101
|
}
|
|
99
102
|
async queryHandler(query, ctx) {
|
|
100
103
|
logger.debug("Recieved query");
|
|
101
|
-
if (query instanceof SearchRequest
|
|
104
|
+
if (query instanceof SearchRequest === false) {
|
|
102
105
|
logger.debug("Recieved query which is not a StringQueryRequest");
|
|
103
106
|
return;
|
|
104
107
|
}
|
|
@@ -108,10 +111,10 @@ let DString = class DString extends Program {
|
|
|
108
111
|
}
|
|
109
112
|
const content = this._index.string;
|
|
110
113
|
const relaventQueries = stringQuery.query.filter((x) => x instanceof StringMatch);
|
|
111
|
-
if (relaventQueries.length
|
|
114
|
+
if (relaventQueries.length === 0) {
|
|
112
115
|
logger.debug("Responding with all");
|
|
113
116
|
return new StringResult({
|
|
114
|
-
string: content
|
|
117
|
+
string: content,
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
120
|
const ranges = relaventQueries
|
|
@@ -120,27 +123,27 @@ let DString = class DString extends Program {
|
|
|
120
123
|
return occurances.map((ix) => {
|
|
121
124
|
return new RangeMetadata({
|
|
122
125
|
offset: BigInt(ix),
|
|
123
|
-
length: BigInt(query.value.length)
|
|
126
|
+
length: BigInt(query.value.length),
|
|
124
127
|
});
|
|
125
128
|
});
|
|
126
129
|
})
|
|
127
130
|
.flat(1);
|
|
128
|
-
if (ranges.length
|
|
131
|
+
if (ranges.length === 0) {
|
|
129
132
|
logger.debug("Could not find any matches");
|
|
130
133
|
return;
|
|
131
134
|
}
|
|
132
135
|
return new StringResult({
|
|
133
136
|
string: content,
|
|
134
137
|
metadatas: new RangeMetadatas({
|
|
135
|
-
metadatas: ranges
|
|
136
|
-
})
|
|
138
|
+
metadatas: ranges,
|
|
139
|
+
}),
|
|
137
140
|
});
|
|
138
141
|
}
|
|
139
142
|
async getValue(options) {
|
|
140
143
|
if (options?.remote) {
|
|
141
144
|
const counter = new Map();
|
|
142
145
|
const responses = await this.query.request(new SearchRequest({
|
|
143
|
-
query: []
|
|
146
|
+
query: [],
|
|
144
147
|
}), options.remote.queryOptions);
|
|
145
148
|
for (const response of responses) {
|
|
146
149
|
if (response.response instanceof NoAccess) {
|
|
@@ -148,8 +151,7 @@ let DString = class DString extends Program {
|
|
|
148
151
|
continue;
|
|
149
152
|
}
|
|
150
153
|
else if (response.response instanceof StringResult) {
|
|
151
|
-
options?.remote.callback
|
|
152
|
-
options?.remote.callback(response.response.string);
|
|
154
|
+
options?.remote.callback?.(response.response.string);
|
|
153
155
|
counter.set(response.response.string, (counter.get(response.response.string) || 0) + 1);
|
|
154
156
|
}
|
|
155
157
|
else {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-store.js","sourceRoot":"","sources":["../../src/string-store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAmC,KAAK,EAAE,MAAM,cAAc,CAAC;AACtE,O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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "@peerbit/string",
|
|
3
|
+
"version": "5.0.0-55cebfe",
|
|
4
|
+
"description": "String store",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "./dist/src/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
"*": {
|
|
10
|
+
"*": [
|
|
11
|
+
"*",
|
|
12
|
+
"dist/*",
|
|
13
|
+
"dist/src/*",
|
|
14
|
+
"dist/src/*/index"
|
|
15
|
+
],
|
|
16
|
+
"src/*": [
|
|
17
|
+
"*",
|
|
18
|
+
"dist/*",
|
|
19
|
+
"dist/src/*",
|
|
20
|
+
"dist/src/*/index"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"src",
|
|
26
|
+
"dist",
|
|
27
|
+
"!dist/e2e",
|
|
28
|
+
"!dist/test",
|
|
29
|
+
"!**/*.tsbuildinfo"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/src/index.d.ts",
|
|
34
|
+
"import": "./dist/src/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"eslintConfig": {
|
|
38
|
+
"extends": "peerbit",
|
|
39
|
+
"parserOptions": {
|
|
40
|
+
"project": true,
|
|
41
|
+
"sourceType": "module"
|
|
42
|
+
},
|
|
43
|
+
"ignorePatterns": [
|
|
44
|
+
"!.aegir.js",
|
|
45
|
+
"test/ts-use",
|
|
46
|
+
"*.d.ts"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"clean": "aegir clean",
|
|
54
|
+
"build": "aegir build --no-bundle",
|
|
55
|
+
"test": "aegir test -t node",
|
|
56
|
+
"lint": "aegir lint"
|
|
57
|
+
},
|
|
58
|
+
"author": "dao.xyz",
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@dao-xyz/borsh": "^5.2.3",
|
|
62
|
+
"@peerbit/logger": "1.0.3-55cebfe",
|
|
63
|
+
"@peerbit/program": "5.0.0-55cebfe",
|
|
64
|
+
"@peerbit/shared-log": "9.0.0-55cebfe",
|
|
65
|
+
"@peerbit/rpc": "5.0.0-55cebfe",
|
|
66
|
+
"@peerbit/time": "2.0.7-55cebfe"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@peerbit/test-utils": "2.0.34-55cebfe"
|
|
70
|
+
}
|
|
44
71
|
}
|
package/src/query.ts
CHANGED
|
@@ -20,10 +20,8 @@ export class RangeMetadatas {
|
|
|
20
20
|
@field({ type: vec(RangeMetadata) })
|
|
21
21
|
metadatas: RangeMetadata[];
|
|
22
22
|
|
|
23
|
-
constructor(opts
|
|
24
|
-
|
|
25
|
-
this.metadatas = opts.metadatas;
|
|
26
|
-
}
|
|
23
|
+
constructor(opts: { metadatas: RangeMetadata[] }) {
|
|
24
|
+
this.metadatas = opts.metadatas;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
|
|
@@ -37,10 +35,9 @@ export class StringMatch {
|
|
|
37
35
|
@field({ type: "u8" })
|
|
38
36
|
exactMatch: boolean;
|
|
39
37
|
|
|
40
|
-
constructor(properties
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
38
|
+
constructor(properties: { value: string; exactMatch: boolean }) {
|
|
39
|
+
this.value = properties.value;
|
|
40
|
+
this.exactMatch = properties.exactMatch;
|
|
44
41
|
}
|
|
45
42
|
preprocess(string: string): string {
|
|
46
43
|
if (this.exactMatch) {
|
|
@@ -55,10 +52,8 @@ export class SearchRequest {
|
|
|
55
52
|
@field({ type: vec(StringMatch) })
|
|
56
53
|
query!: StringMatch[];
|
|
57
54
|
|
|
58
|
-
constructor(properties
|
|
59
|
-
|
|
60
|
-
this.query = properties.query;
|
|
61
|
-
}
|
|
55
|
+
constructor(properties: { query: StringMatch[] }) {
|
|
56
|
+
this.query = properties.query;
|
|
62
57
|
}
|
|
63
58
|
}
|
|
64
59
|
|
package/src/string-index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { field, option, variant } from "@dao-xyz/borsh";
|
|
2
|
-
import { BORSH_ENCODING, Change, Log } from "@peerbit/log";
|
|
2
|
+
import { BORSH_ENCODING, type Change, Log } from "@peerbit/log";
|
|
3
3
|
import { Entry } from "@peerbit/log";
|
|
4
4
|
import { Program } from "@peerbit/program";
|
|
5
5
|
import { Range } from "./range.js";
|
|
@@ -44,13 +44,13 @@ export class StringIndex extends Program {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
async updateIndex(_change: Change<StringOperation>) {
|
|
47
|
-
this._string = await applyOperations("", await this._log.
|
|
47
|
+
this._string = await applyOperations("", await this._log.toArray()); // TODO improve performance
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export const applyOperations = async (
|
|
52
52
|
string: string,
|
|
53
|
-
operations: Entry<StringOperation>[]
|
|
53
|
+
operations: Entry<StringOperation>[],
|
|
54
54
|
): Promise<string> => {
|
|
55
55
|
await Promise.all(operations.map((operation) => operation.getPayload()));
|
|
56
56
|
|
|
@@ -66,11 +66,11 @@ export const applyOperations = async (
|
|
|
66
66
|
};
|
|
67
67
|
export const applyOperation = (
|
|
68
68
|
s: string,
|
|
69
|
-
operation: StringOperation
|
|
69
|
+
operation: StringOperation,
|
|
70
70
|
): string => {
|
|
71
71
|
// TODO check bounds number
|
|
72
72
|
const to = Number(operation.index.offset) + Number(operation.index.length);
|
|
73
|
-
if (operation.value
|
|
73
|
+
if (operation.value !== undefined) {
|
|
74
74
|
s = s.padEnd(to);
|
|
75
75
|
s =
|
|
76
76
|
s.slice(0, Number(operation.index.offset)) +
|
package/src/string-store.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { field, variant } from "@dao-xyz/borsh";
|
|
2
|
-
import {
|
|
3
|
-
import { SharedLog, SharedLogOptions } from "@peerbit/shared-log";
|
|
2
|
+
import { CustomEvent } from "@libp2p/interface";
|
|
4
3
|
import { PublicSignKey, sha256Base64Sync } from "@peerbit/crypto";
|
|
5
|
-
import {
|
|
6
|
-
import { RPCRequestOptions, RPC, RequestContext } from "@peerbit/rpc";
|
|
4
|
+
import { type AppendOptions, type Change, Entry } from "@peerbit/log";
|
|
7
5
|
import { logger as loggerFn } from "@peerbit/logger";
|
|
8
|
-
import {
|
|
6
|
+
import { Program, type ProgramEvents } from "@peerbit/program";
|
|
7
|
+
import { RPC, type RPCRequestOptions, type RequestContext } from "@peerbit/rpc";
|
|
8
|
+
import { SharedLog, type SharedLogOptions } from "@peerbit/shared-log";
|
|
9
|
+
import { concat, fromString } from "uint8arrays";
|
|
9
10
|
import {
|
|
10
11
|
AbstractSearchResult,
|
|
11
12
|
NoAccess,
|
|
12
13
|
RangeMetadata,
|
|
13
14
|
RangeMetadatas,
|
|
14
|
-
StringMatch,
|
|
15
15
|
SearchRequest,
|
|
16
|
-
|
|
16
|
+
StringMatch,
|
|
17
|
+
StringResult,
|
|
17
18
|
} from "./query.js";
|
|
18
|
-
import { CustomEvent } from "@libp2p/interface";
|
|
19
|
-
import { concat, fromString } from "uint8arrays";
|
|
20
|
-
|
|
21
19
|
import { Range } from "./range.js";
|
|
20
|
+
import { StringIndex, StringOperation, encoding } from "./string-index.js";
|
|
22
21
|
|
|
23
22
|
const logger = loggerFn({ module: "string" });
|
|
24
23
|
|
|
@@ -45,7 +44,7 @@ export interface StringEvents {
|
|
|
45
44
|
|
|
46
45
|
export type CanPerform = (
|
|
47
46
|
operation: StringOperation,
|
|
48
|
-
context: TransactionContext
|
|
47
|
+
context: TransactionContext,
|
|
49
48
|
) => Promise<boolean> | boolean;
|
|
50
49
|
|
|
51
50
|
export type Args = {
|
|
@@ -86,7 +85,7 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
86
85
|
await this._log.open({
|
|
87
86
|
encoding,
|
|
88
87
|
replicas: {
|
|
89
|
-
min: 0xffffffff // assume a document can not be sharded?
|
|
88
|
+
min: 0xffffffff, // assume a document can not be sharded?
|
|
90
89
|
},
|
|
91
90
|
canAppend: async (entry) => {
|
|
92
91
|
const operation = await entry.getPayloadValue();
|
|
@@ -102,32 +101,34 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
102
101
|
await this._index.updateIndex(change);
|
|
103
102
|
this.events.dispatchEvent(
|
|
104
103
|
new CustomEvent("change", {
|
|
105
|
-
detail: change
|
|
106
|
-
})
|
|
104
|
+
detail: change,
|
|
105
|
+
}),
|
|
107
106
|
);
|
|
108
|
-
}
|
|
107
|
+
},
|
|
109
108
|
});
|
|
110
109
|
|
|
111
110
|
await this.query.open({
|
|
112
111
|
...options,
|
|
113
112
|
topic: sha256Base64Sync(
|
|
114
|
-
concat([this._log.log.id, fromString("/dstring")])
|
|
113
|
+
concat([this._log.log.id, fromString("/dstring")]),
|
|
115
114
|
),
|
|
116
115
|
responseHandler: this.queryHandler.bind(this),
|
|
117
116
|
queryType: SearchRequest,
|
|
118
|
-
responseType: StringResult
|
|
117
|
+
responseType: StringResult,
|
|
119
118
|
});
|
|
119
|
+
|
|
120
|
+
await this._log.reload(); // TODO make it so that it does not reload the whole log (i.e. persist the generated string in some way)
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
private async _canPerform(
|
|
123
124
|
operation: StringOperation,
|
|
124
|
-
context: TransactionContext
|
|
125
|
+
context: TransactionContext,
|
|
125
126
|
): Promise<boolean> {
|
|
126
127
|
if (this._log.log.length === 0 || context.entry.next.length === 0) {
|
|
127
128
|
return true;
|
|
128
129
|
} else {
|
|
129
130
|
for (const next of context.entry.next) {
|
|
130
|
-
if (this._log.log.has(next)) {
|
|
131
|
+
if (await this._log.log.has(next)) {
|
|
131
132
|
return true;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
@@ -138,17 +139,17 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
138
139
|
async add(
|
|
139
140
|
value: string,
|
|
140
141
|
index: Range,
|
|
141
|
-
options?: AppendOptions<StringOperation
|
|
142
|
+
options?: AppendOptions<StringOperation>,
|
|
142
143
|
) {
|
|
143
144
|
return this._log.append(
|
|
144
145
|
new StringOperation({
|
|
145
146
|
index,
|
|
146
|
-
value
|
|
147
|
+
value,
|
|
147
148
|
}),
|
|
148
149
|
{
|
|
149
150
|
...options,
|
|
150
|
-
meta: { ...options?.meta, next: await this._log.log.getHeads() }
|
|
151
|
-
}
|
|
151
|
+
meta: { ...options?.meta, next: await this._log.log.getHeads().all() }, // TODO: optimize
|
|
152
|
+
},
|
|
152
153
|
);
|
|
153
154
|
}
|
|
154
155
|
|
|
@@ -158,10 +159,10 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
158
159
|
|
|
159
160
|
async queryHandler(
|
|
160
161
|
query: SearchRequest,
|
|
161
|
-
ctx: RequestContext
|
|
162
|
+
ctx: RequestContext,
|
|
162
163
|
): Promise<AbstractSearchResult | undefined> {
|
|
163
164
|
logger.debug("Recieved query");
|
|
164
|
-
if (query instanceof SearchRequest
|
|
165
|
+
if (query instanceof SearchRequest === false) {
|
|
165
166
|
logger.debug("Recieved query which is not a StringQueryRequest");
|
|
166
167
|
return;
|
|
167
168
|
}
|
|
@@ -173,30 +174,30 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
173
174
|
|
|
174
175
|
const content = this._index.string;
|
|
175
176
|
const relaventQueries = stringQuery.query.filter(
|
|
176
|
-
(x) => x instanceof StringMatch
|
|
177
|
+
(x) => x instanceof StringMatch,
|
|
177
178
|
) as StringMatch[];
|
|
178
|
-
if (relaventQueries.length
|
|
179
|
+
if (relaventQueries.length === 0) {
|
|
179
180
|
logger.debug("Responding with all");
|
|
180
181
|
return new StringResult({
|
|
181
|
-
string: content
|
|
182
|
+
string: content,
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
185
|
const ranges = relaventQueries
|
|
185
186
|
.map((query) => {
|
|
186
187
|
const occurances = findAllOccurrences(
|
|
187
188
|
query.preprocess(content),
|
|
188
|
-
query.preprocess(query.value)
|
|
189
|
+
query.preprocess(query.value),
|
|
189
190
|
);
|
|
190
191
|
return occurances.map((ix) => {
|
|
191
192
|
return new RangeMetadata({
|
|
192
193
|
offset: BigInt(ix),
|
|
193
|
-
length: BigInt(query.value.length)
|
|
194
|
+
length: BigInt(query.value.length),
|
|
194
195
|
});
|
|
195
196
|
});
|
|
196
197
|
})
|
|
197
198
|
.flat(1);
|
|
198
199
|
|
|
199
|
-
if (ranges.length
|
|
200
|
+
if (ranges.length === 0) {
|
|
200
201
|
logger.debug("Could not find any matches");
|
|
201
202
|
return;
|
|
202
203
|
}
|
|
@@ -204,8 +205,8 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
204
205
|
return new StringResult({
|
|
205
206
|
string: content,
|
|
206
207
|
metadatas: new RangeMetadatas({
|
|
207
|
-
metadatas: ranges
|
|
208
|
-
})
|
|
208
|
+
metadatas: ranges,
|
|
209
|
+
}),
|
|
209
210
|
});
|
|
210
211
|
}
|
|
211
212
|
|
|
@@ -219,20 +220,19 @@ export class DString extends Program<Args, StringEvents & ProgramEvents> {
|
|
|
219
220
|
const counter: Map<string, number> = new Map();
|
|
220
221
|
const responses = await this.query.request(
|
|
221
222
|
new SearchRequest({
|
|
222
|
-
query: []
|
|
223
|
+
query: [],
|
|
223
224
|
}),
|
|
224
|
-
options.remote.queryOptions
|
|
225
|
+
options.remote.queryOptions,
|
|
225
226
|
);
|
|
226
227
|
for (const response of responses) {
|
|
227
228
|
if (response.response instanceof NoAccess) {
|
|
228
229
|
logger.error("Missing access");
|
|
229
230
|
continue;
|
|
230
231
|
} else if (response.response instanceof StringResult) {
|
|
231
|
-
options?.remote.callback
|
|
232
|
-
options?.remote.callback(response.response.string);
|
|
232
|
+
options?.remote.callback?.(response.response.string);
|
|
233
233
|
counter.set(
|
|
234
234
|
response.response.string,
|
|
235
|
-
(counter.get(response.response.string) || 0) + 1
|
|
235
|
+
(counter.get(response.response.string) || 0) + 1,
|
|
236
236
|
);
|
|
237
237
|
} else {
|
|
238
238
|
throw new Error("Unsupported type: " + response?.constructor?.name);
|
package/LICENSE
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Apache License
|
|
3
|
-
Version 2.0, January 2004
|
|
4
|
-
http://www.apache.org/licenses/
|
|
5
|
-
|
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
-
|
|
8
|
-
1. Definitions.
|
|
9
|
-
|
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
-
|
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
-
the copyright owner that is granting the License.
|
|
15
|
-
|
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
-
other entities that control, are controlled by, or are under common
|
|
18
|
-
control with that entity. For the purposes of this definition,
|
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
-
direction or management of such entity, whether by contract or
|
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
-
exercising permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
-
including but not limited to software source code, documentation
|
|
29
|
-
source, and configuration files.
|
|
30
|
-
|
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
|
32
|
-
transformation or translation of a Source form, including but
|
|
33
|
-
not limited to compiled object code, generated documentation,
|
|
34
|
-
and conversions to other media types.
|
|
35
|
-
|
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
-
Object form, made available under the License, as indicated by a
|
|
38
|
-
copyright notice that is included in or attached to the work
|
|
39
|
-
(an example is provided in the Appendix below).
|
|
40
|
-
|
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
-
the Work and Derivative Works thereof.
|
|
48
|
-
|
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
|
50
|
-
the original version of the Work and any modifications or additions
|
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
-
|
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
-
subsequently incorporated within the Work.
|
|
66
|
-
|
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
|
73
|
-
|
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
-
where such license applies only to those patent claims licensable
|
|
80
|
-
by such Contributor that are necessarily infringed by their
|
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
-
institute patent litigation against any entity (including a
|
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
-
or contributory patent infringement, then any patent licenses
|
|
87
|
-
granted to You under this License for that Work shall terminate
|
|
88
|
-
as of the date such litigation is filed.
|
|
89
|
-
|
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
-
modifications, and in Source or Object form, provided that You
|
|
93
|
-
meet the following conditions:
|
|
94
|
-
|
|
95
|
-
(a) You must give any other recipients of the Work or
|
|
96
|
-
Derivative Works a copy of this License; and
|
|
97
|
-
|
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
|
99
|
-
stating that You changed the files; and
|
|
100
|
-
|
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
|
103
|
-
attribution notices from the Source form of the Work,
|
|
104
|
-
excluding those notices that do not pertain to any part of
|
|
105
|
-
the Derivative Works; and
|
|
106
|
-
|
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
|
109
|
-
include a readable copy of the attribution notices contained
|
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
|
112
|
-
of the following places: within a NOTICE text file distributed
|
|
113
|
-
as part of the Derivative Works; within the Source form or
|
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
|
115
|
-
within a display generated by the Derivative Works, if and
|
|
116
|
-
wherever such third-party notices normally appear. The contents
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
-
|
|
181
|
-
To apply the Apache License to your work, attach the following
|
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
-
replaced with your own identifying information. (Don't include
|
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format. We also recommend that a
|
|
186
|
-
file or class name and description of purpose be included on the
|
|
187
|
-
same "printed page" as the copyright notice for easier
|
|
188
|
-
identification within third-party archives.
|
|
189
|
-
|
|
190
|
-
Copyright 2022 dao.xyz
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
package/lib/esm/query.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGtD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAEzB,MAAM,CAAS;IAGf,MAAM,CAAS;IAEf,YAAY,IAAyC;QACpD,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;CACD,CAAA;AAVA;I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