New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@peerbit/indexer-interface

Package Overview
Dependencies
Maintainers
0
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peerbit/indexer-interface - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1-01f2c90

4

dist/src/index-engine.d.ts

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

export type ReturnTypeFromShape<T, S> = S extends Shape ? ShapeReturnType<S> : T;
export type IndexIterator<T, S extends Shape | undefined> = {
export type IndexIterator<T extends Record<string, any>, S extends Shape | undefined> = {
next: (amount: number) => MaybePromise<IndexedResults<ReturnTypeFromShape<T, S>>>;

@@ -74,3 +74,3 @@ all: () => MaybePromise<IndexedResults<ReturnTypeFromShape<T, S>>>;

}
export declare const iteratorInSeries: <T, S extends Shape | undefined>(...iterators: IndexIterator<T, S>[]) => IndexIterator<T, S>;
export declare const iteratorInSeries: <T extends Record<string, any>, S extends Shape | undefined>(...iterators: IndexIterator<T, S>[]) => IndexIterator<T, S>;
export interface Indices {

@@ -77,0 +77,0 @@ init<T extends Record<string, any>, NestedType>(properties: IndexEngineInitProperties<T, NestedType>): MaybePromise<Index<T, NestedType>>;

import {} from "./id.js";
/*
export type IndexIterator<T> = ReturnType<typeof iterate<T>>;
export const iterate = <T>(index: Index<T, any>, query: SearchRequest) => {
let isDone = false;
let fetchedOnce = false;
const next = async (count: number, options?: { shape?: Shape }) => {
let res: IndexedResults<T>;
if (!fetchedOnce) {
fetchedOnce = true;
query.fetch = count;
res = await index.query(query, options);
} else {
res = await index.next(
new CollectNextRequest({ id: query.id, amount: count }),
options,
);
}
isDone = res.kept === 0;
return res;
};
const done = () => isDone;
const close = () => {
return index.close(new CloseIteratorRequest({ id: query.id }));
};
return {
next,
done,
close,
all: async (options?: { shape: Shape }) => {
const results: IndexedResult<T>[] = [];
while (!done()) {
for (const element of (await next(100, options)).results) {
results.push(element);
}
}
await close();
return results;
},
};
};
export type ResultsIterator<T> = ReturnType<typeof iterate<T>>; */
export const iteratorInSeries = (...iterators) => {

@@ -45,0 +3,0 @@ let i = 0;

{
"name": "@peerbit/indexer-interface",
"version": "1.1.0",
"description": "Indexer store interface",
"sideEffects": false,
"type": "module",
"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",
"lint": "aegir lint"
},
"author": "dao.xyz",
"license": "MIT",
"dependencies": {
"uuid": "^10.0.0",
"@dao-xyz/borsh": "^5.2.3",
"@peerbit/crypto": "^2.3.2"
}
"name": "@peerbit/indexer-interface",
"version": "1.1.1-01f2c90",
"description": "Indexer store interface",
"sideEffects": false,
"type": "module",
"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",
"lint": "aegir lint"
},
"author": "dao.xyz",
"license": "MIT",
"dependencies": {
"uuid": "^10.0.0",
"@dao-xyz/borsh": "^5.2.3",
"@peerbit/crypto": "2.3.2-01f2c90"
}
}

@@ -96,3 +96,3 @@ import { field, variant } from "@dao-xyz/borsh";

private _keyString: string;
private _keyString!: string;
get primitive(): string {

@@ -99,0 +99,0 @@ return this._keyString || (this._keyString = toBase64(this.key));

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

export type IndexIterator<T, S extends Shape | undefined> = {
export type IndexIterator<
T extends Record<string, any>,
S extends Shape | undefined,
> = {
next: (

@@ -109,17 +112,3 @@ amount: number,

): IndexIterator<T, S>;
/* query<O extends { shape?: Shape } | undefined>(
query: SearchRequest,
options?: O & { reference?: boolean },
): MaybePromise<IndexedResults<O extends { shape: infer S extends Shape } ? ShapeReturnType<S> : T>>;
next<O extends { shape?: Shape } | undefined>(
query: CollectNextRequest,
options?: O
): MaybePromise<IndexedResults<O extends { shape: infer S extends Shape } ? ShapeReturnType<S> : T>>
close(query: CloseIteratorRequest): MaybePromise<void>;; */
/*
query<O extends QueryOptions>(query: SearchRequest, options?: O): MaybePromise<IndexedResults<ReturnTypeFromQueryOptions<T, O>>>;
next<O extends QueryOptions>(query: CollectNextRequest, options?: O): MaybePromise<IndexedResults<ReturnTypeFromQueryOptions<T, O>>>;
*/
getSize(): MaybePromise<number>;

@@ -129,46 +118,7 @@ start(): MaybePromise<void>;

}
/*
export type IndexIterator<T> = ReturnType<typeof iterate<T>>;
export const iterate = <T>(index: Index<T, any>, query: SearchRequest) => {
let isDone = false;
let fetchedOnce = false;
const next = async (count: number, options?: { shape?: Shape }) => {
let res: IndexedResults<T>;
if (!fetchedOnce) {
fetchedOnce = true;
query.fetch = count;
res = await index.query(query, options);
} else {
res = await index.next(
new CollectNextRequest({ id: query.id, amount: count }),
options,
);
}
isDone = res.kept === 0;
return res;
};
const done = () => isDone;
const close = () => {
return index.close(new CloseIteratorRequest({ id: query.id }));
};
return {
next,
done,
close,
all: async (options?: { shape: Shape }) => {
const results: IndexedResult<T>[] = [];
while (!done()) {
for (const element of (await next(100, options)).results) {
results.push(element);
}
}
await close();
return results;
},
};
};
export type ResultsIterator<T> = ReturnType<typeof iterate<T>>; */
export const iteratorInSeries = <T, S extends Shape | undefined>(
export const iteratorInSeries = <
T extends Record<string, any>,
S extends Shape | undefined,
>(
...iterators: IndexIterator<T, S>[]

@@ -175,0 +125,0 @@ ): IndexIterator<T, S> => {

@@ -156,3 +156,3 @@ import { deserialize, field, serialize, variant, vec } from "@dao-xyz/borsh";

_valueString: string;
_valueString!: string;
/**

@@ -159,0 +159,0 @@ * value `asString`

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc