You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

@peerbit/document

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peerbit/document - npm Package Compare versions

Comparing version

to
9.3.3-e182140

export * from "@peerbit/indexer-interface";
export * from "@peerbit/document-interface";
export * from "./program.js";
export type { CanRead, CanSearch, DocumentIndex, WithContext, OpenOptions, QueryOptions, RemoteQueryOptions, ResultsIterator, SearchOptions, TransformOptions, TransformerAsConstructor, TransformerAsFunction, } from "./search.js";
export type { CanRead, CanSearch, DocumentIndex, WithContext, OpenOptions, QueryOptions, RemoteQueryOptions, ResultsIterator, SearchOptions, TransformOptions, TransformerAsConstructor, TransformerAsFunction, ValueTypeFromRequest, } from "./search.js";
export * from "./operation.js";

@@ -6,0 +6,0 @@ export { MAX_BATCH_SIZE as MAX_DOCUMENT_SIZE } from "./constants.js";

@@ -99,3 +99,4 @@ import { type AbstractType } from "@dao-xyz/borsh";

}): Promise<void>;
count(properties: {
count(options?: {
query?: indexerTypes.Query | indexerTypes.QueryLike;
approximate: true | {

@@ -102,0 +103,0 @@ eager?: boolean;

@@ -504,10 +504,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

// approximate the amount of documents that exists globally
async count(properties) {
async count(options) {
let isReplicating = await this.log.isReplicating();
if (!isReplicating) {
// fetch a subset of posts
const iterator = this.index.iterate({}, {
const iterator = this.index.iterate({ query: options?.query }, {
remote: {
eager: (typeof properties.approximate === "object" &&
properties.approximate.eager) ||
eager: (typeof options?.approximate === "object" &&
options?.approximate.eager) ||
false,

@@ -525,3 +525,5 @@ },

});
let indexedDocumentsCount = await this.index.index.count();
let indexedDocumentsCount = await this.index.index.count({
query: options?.query,
});
if (totalAssignedHeads == 0) {

@@ -528,0 +530,0 @@ return indexedDocumentsCount; // TODO is this really expected?

@@ -45,3 +45,3 @@ import { type AbstractType } from "@dao-xyz/borsh";

export type CanReadIndexed<I> = (result: I, from: PublicSignKey) => Promise<boolean> | boolean;
type ValueTypeFromRequest<Resolve extends boolean | undefined, T, I> = Resolve extends false ? WithContext<I> : WithContext<T>;
export type ValueTypeFromRequest<Resolve extends boolean | undefined, T, I> = Resolve extends false ? WithContext<I> : WithContext<T>;
export type WithContext<I> = {

@@ -48,0 +48,0 @@ __context: types.Context;

{
"name": "@peerbit/document",
"version": "9.3.2",
"description": "Document store implementation",
"type": "module",
"sideEffects": false,
"types": "./dist/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
],
"src/*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
]
}
},
"files": [
"src",
"dist",
"!dist/e2e",
"!dist/test",
"!**/*.tsbuildinfo"
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
}
},
"eslintConfig": {
"extends": "peerbit",
"parserOptions": {
"project": true,
"sourceType": "module"
},
"ignorePatterns": [
"!.aegir.js",
"test/ts-use",
"*.d.ts"
]
},
"publishConfig": {
"access": "public"
},
"scripts": {
"clean": "aegir clean",
"build": "aegir build --no-bundle",
"test": "aegir test --target node",
"lint": "aegir lint"
},
"author": "dao.xyz",
"license": "MIT",
"dependencies": {
"@dao-xyz/borsh": "^5.2.3",
"@peerbit/program": "5.1.8",
"@peerbit/rpc": "5.0.42",
"@peerbit/shared-log": "10.4.5",
"@peerbit/indexer-interface": "^2.0.7",
"@peerbit/indexer-simple": "^1.1.11",
"@peerbit/indexer-sqlite3": "^1.2.15",
"@peerbit/document-interface": "^2.0.18"
},
"devDependencies": {
"@peerbit/test-utils": "2.1.32",
"@peerbit/time": "2.0.8",
"@types/pidusage": "^2.0.5",
"pidusage": "^3.0.2"
}
"name": "@peerbit/document",
"version": "9.3.3-e182140",
"description": "Document store implementation",
"type": "module",
"sideEffects": false,
"types": "./dist/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
],
"src/*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
]
}
},
"files": [
"src",
"dist",
"!dist/e2e",
"!dist/test",
"!**/*.tsbuildinfo"
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
}
},
"eslintConfig": {
"extends": "peerbit",
"parserOptions": {
"project": true,
"sourceType": "module"
},
"ignorePatterns": [
"!.aegir.js",
"test/ts-use",
"*.d.ts"
]
},
"publishConfig": {
"access": "public"
},
"scripts": {
"clean": "aegir clean",
"build": "aegir build --no-bundle",
"test": "aegir test --target node",
"lint": "aegir lint"
},
"author": "dao.xyz",
"license": "MIT",
"dependencies": {
"@dao-xyz/borsh": "^5.2.3",
"@peerbit/program": "5.1.8-e182140",
"@peerbit/rpc": "5.0.42-e182140",
"@peerbit/shared-log": "10.4.5-e182140",
"@peerbit/indexer-interface": "2.0.7-e182140",
"@peerbit/indexer-simple": "1.1.11-e182140",
"@peerbit/indexer-sqlite3": "1.2.15-e182140",
"@peerbit/document-interface": "2.0.18-e182140"
},
"devDependencies": {
"@peerbit/test-utils": "2.1.32-e182140",
"@peerbit/time": "2.0.8-e182140",
"@types/pidusage": "^2.0.5",
"pidusage": "^3.0.2"
}
}

@@ -17,2 +17,3 @@ export * from "@peerbit/indexer-interface";

TransformerAsFunction,
ValueTypeFromRequest,
} from "./search.js";

@@ -19,0 +20,0 @@ export * from "./operation.js";

@@ -715,3 +715,4 @@ import {

// approximate the amount of documents that exists globally
async count(properties: {
async count(options?: {
query?: indexerTypes.Query | indexerTypes.QueryLike;
approximate: true | { eager?: boolean };

@@ -723,8 +724,8 @@ }): Promise<number> {

const iterator = this.index.iterate(
{},
{ query: options?.query },
{
remote: {
eager:
(typeof properties.approximate === "object" &&
properties.approximate.eager) ||
(typeof options?.approximate === "object" &&
options?.approximate.eager) ||
false,

@@ -745,3 +746,5 @@ },

let indexedDocumentsCount = await this.index.index.count();
let indexedDocumentsCount = await this.index.index.count({
query: options?.query,
});
if (totalAssignedHeads == 0) {

@@ -748,0 +751,0 @@ return indexedDocumentsCount; // TODO is this really expected?

@@ -233,3 +233,3 @@ import { type AbstractType, field, serialize, variant } from "@dao-xyz/borsh";

type ValueTypeFromRequest<
export type ValueTypeFromRequest<
Resolve extends boolean | undefined,

@@ -236,0 +236,0 @@ T,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet