interface-store
Advanced tools
| { | ||
| "version": 3, | ||
| "sources": ["../src/index.ts", "../src/errors.ts"], | ||
| "sourcesContent": ["/**\n * @packageDocumentation\n *\n * An abstraction of the Datastore/Blockstore codebases.\n */\n\n/**\n * An iterable or async iterable of values\n */\nexport type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>\n\n/**\n * A value or a promise of a value\n */\nexport type Await<T> = Promise<T> | T\n\n/**\n * Options for async operations.\n */\nexport interface AbortOptions {\n signal?: AbortSignal\n}\n\nexport interface Store<Key, Value, Pair, HasOptionsExtension = {},\n PutOptionsExtension = {}, PutManyOptionsExtension = {},\n GetOptionsExtension = {}, GetManyOptionsExtension = {},\n DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> {\n /**\n * Check for the existence of a value for the passed key\n *\n * @example\n * ```js\n *const exists = await store.has(new Key('awesome'))\n *\n *if (exists) {\n * console.log('it is there')\n *} else {\n * console.log('it is not there')\n *}\n *```\n */\n has(key: Key, options?: AbortOptions & HasOptionsExtension): Await<boolean>\n\n /**\n * Store the passed value under the passed key\n *\n * @example\n *\n * ```js\n * await store.put([{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }])\n * ```\n */\n put(key: Key, val: Value, options?: AbortOptions & PutOptionsExtension): Await<Key>\n\n /**\n * Store the given key/value pairs\n *\n * @example\n * ```js\n * const source = [{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }]\n *\n * for await (const { key, value } of store.putMany(source)) {\n * console.info(`put content for key ${key}`)\n * }\n * ```\n */\n putMany(\n source: AwaitIterable<Pair>,\n options?: AbortOptions & PutManyOptionsExtension\n ): AwaitIterable<Key>\n\n /**\n * Retrieve the value stored under the given key\n *\n * @example\n * ```js\n * const value = await store.get(new Key('awesome'))\n * console.log('got content: %s', value.toString('utf8'))\n * // => got content: datastore\n * ```\n */\n get(key: Key, options?: AbortOptions & GetOptionsExtension): Await<Value>\n\n /**\n * Retrieve values for the passed keys\n *\n * @example\n * ```js\n * for await (const { key, value } of store.getMany([new Key('awesome')])) {\n * console.log(`got \"${key}\" = \"${new TextDecoder('utf8').decode(value)}\"`')\n * // => got \"/awesome\" = \"datastore\"\n * }\n * ```\n */\n getMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & GetManyOptionsExtension\n ): AwaitIterable<Pair>\n\n /**\n * Remove the record for the passed key\n *\n * @example\n *\n * ```js\n * await store.delete(new Key('awesome'))\n * console.log('deleted awesome content :(')\n * ```\n */\n delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): Await<void>\n\n /**\n * Remove values for the passed keys\n *\n * @example\n *\n * ```js\n * const source = [new Key('awesome')]\n *\n * for await (const key of store.deleteMany(source)) {\n * console.log(`deleted content with key ${key}`)\n * }\n * ```\n */\n deleteMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & DeleteManyOptionsExtension\n ): AwaitIterable<Key>\n}\n\nexport * from './errors.js'\n", "export class OpenFailedError extends Error {\n static name = 'OpenFailedError'\n static code = 'ERR_OPEN_FAILED'\n name = OpenFailedError.name\n code = OpenFailedError.code\n\n constructor (message = 'Open failed') {\n super(message)\n }\n}\n\nexport class CloseFailedError extends Error {\n static name = 'CloseFailedError'\n static code = 'ERR_CLOSE_FAILED'\n name = CloseFailedError.name\n code = CloseFailedError.code\n\n constructor (message = 'Close failed') {\n super(message)\n }\n}\n\nexport class PutFailedError extends Error {\n static name = 'PutFailedError'\n static code = 'ERR_PUT_FAILED'\n name = PutFailedError.name\n code = PutFailedError.code\n\n constructor (message = 'Put failed') {\n super(message)\n }\n}\n\nexport class GetFailedError extends Error {\n static name = 'GetFailedError'\n static code = 'ERR_GET_FAILED'\n name = GetFailedError.name\n code = GetFailedError.code\n\n constructor (message = 'Get failed') {\n super(message)\n }\n}\n\nexport class DeleteFailedError extends Error {\n static name = 'DeleteFailedError'\n static code = 'ERR_DELETE_FAILED'\n name = DeleteFailedError.name\n code = DeleteFailedError.code\n\n constructor (message = 'Delete failed') {\n super(message)\n }\n}\n\nexport class HasFailedError extends Error {\n static name = 'HasFailedError'\n static code = 'ERR_HAS_FAILED'\n name = HasFailedError.name\n code = HasFailedError.code\n\n constructor (message = 'Has failed') {\n super(message)\n }\n}\n\nexport class NotFoundError extends Error {\n static name = 'NotFoundError'\n static code = 'ERR_NOT_FOUND'\n name = NotFoundError.name\n code = NotFoundError.code\n\n constructor (message = 'Not Found') {\n super(message)\n }\n}\n\nexport class AbortError extends Error {\n static name = 'AbortError'\n static code = 'ERR_ABORTED'\n name = AbortError.name\n code = AbortError.code\n\n constructor (message = 'Aborted') {\n super(message)\n }\n}\n"], | ||
| "sourcesContent": ["/**\n * @packageDocumentation\n *\n * An abstraction of the Datastore/Blockstore codebases.\n */\n\n/**\n * An iterable or async iterable of values\n */\nexport type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>\n\n/**\n * A generator or async generator of values\n */\nexport type AwaitGenerator<T, TReturn = any, TNext = any> = Generator<T, TReturn, TNext> | AsyncGenerator<T, TReturn, TNext>\n\n/**\n * A value or a promise of a value\n */\nexport type Await<T> = Promise<T> | T\n\n/**\n * Options for async operations.\n */\nexport interface AbortOptions {\n signal?: AbortSignal\n}\n\nexport interface Store<Key, Input, Output, InputPair, OutputPair,\n HasOptionsExtension = {}, PutOptionsExtension = {},\n PutManyOptionsExtension = {}, GetOptionsExtension = {},\n GetManyOptionsExtension = {}, DeleteOptionsExtension = {},\n DeleteManyOptionsExtension = {}> {\n /**\n * Check for the existence of a value for the passed key\n *\n * @example\n * ```js\n *const exists = await store.has(new Key('awesome'))\n *\n *if (exists) {\n * console.log('it is there')\n *} else {\n * console.log('it is not there')\n *}\n *```\n */\n has(key: Key, options?: AbortOptions & HasOptionsExtension): Await<boolean>\n\n /**\n * Store the passed value under the passed key\n *\n * @example\n *\n * ```js\n * await store.put([{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }])\n * ```\n */\n put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Await<Key>\n\n /**\n * Store the given key/value pairs\n *\n * @example\n * ```js\n * const source = [{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }]\n *\n * for await (const { key, value } of store.putMany(source)) {\n * console.info(`put content for key ${key}`)\n * }\n * ```\n */\n putMany(\n source: AwaitIterable<InputPair>,\n options?: AbortOptions & PutManyOptionsExtension\n ): AwaitIterable<Key>\n\n /**\n * Retrieve the value stored under the given key\n *\n * @example\n * ```js\n * const value = await store.get(new Key('awesome'))\n * console.log('got content: %s', value.toString('utf8'))\n * // => got content: datastore\n * ```\n */\n get(key: Key, options?: AbortOptions & GetOptionsExtension): Output\n\n /**\n * Retrieve values for the passed keys\n *\n * @example\n * ```js\n * for await (const { key, value } of store.getMany([new Key('awesome')])) {\n * console.log(`got \"${key}\" = \"${new TextDecoder('utf8').decode(value)}\"`')\n * // => got \"/awesome\" = \"datastore\"\n * }\n * ```\n */\n getMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & GetManyOptionsExtension\n ): AwaitIterable<OutputPair>\n\n /**\n * Remove the record for the passed key\n *\n * @example\n *\n * ```js\n * await store.delete(new Key('awesome'))\n * console.log('deleted awesome content :(')\n * ```\n */\n delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): Await<void>\n\n /**\n * Remove values for the passed keys\n *\n * @example\n *\n * ```js\n * const source = [new Key('awesome')]\n *\n * for await (const key of store.deleteMany(source)) {\n * console.log(`deleted content with key ${key}`)\n * }\n * ```\n */\n deleteMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & DeleteManyOptionsExtension\n ): AwaitIterable<Key>\n}\n\nexport * from './errors.js'\n", "export class OpenFailedError extends Error {\n static name = 'OpenFailedError'\n static code = 'ERR_OPEN_FAILED'\n name = OpenFailedError.name\n code = OpenFailedError.code\n\n constructor (message = 'Open failed') {\n super(message)\n }\n}\n\nexport class CloseFailedError extends Error {\n static name = 'CloseFailedError'\n static code = 'ERR_CLOSE_FAILED'\n name = CloseFailedError.name\n code = CloseFailedError.code\n\n constructor (message = 'Close failed') {\n super(message)\n }\n}\n\nexport class PutFailedError extends Error {\n static name = 'PutFailedError'\n static code = 'ERR_PUT_FAILED'\n name = PutFailedError.name\n code = PutFailedError.code\n\n constructor (message = 'Put failed') {\n super(message)\n }\n}\n\nexport class GetFailedError extends Error {\n static name = 'GetFailedError'\n static code = 'ERR_GET_FAILED'\n name = GetFailedError.name\n code = GetFailedError.code\n\n constructor (message = 'Get failed') {\n super(message)\n }\n}\n\nexport class DeleteFailedError extends Error {\n static name = 'DeleteFailedError'\n static code = 'ERR_DELETE_FAILED'\n name = DeleteFailedError.name\n code = DeleteFailedError.code\n\n constructor (message = 'Delete failed') {\n super(message)\n }\n}\n\nexport class HasFailedError extends Error {\n static name = 'HasFailedError'\n static code = 'ERR_HAS_FAILED'\n name = HasFailedError.name\n code = HasFailedError.code\n\n constructor (message = 'Has failed') {\n super(message)\n }\n}\n\nexport class NotFoundError extends Error {\n static name = 'NotFoundError'\n static code = 'ERR_NOT_FOUND'\n name = NotFoundError.name\n code = NotFoundError.code\n\n constructor (message = 'Not Found') {\n super(message)\n }\n}\n\nexport class AbortError extends Error {\n static name = 'AbortError'\n static code = 'ERR_ABORTED'\n name = AbortError.name\n code = AbortError.code\n\n constructor (message = 'Aborted') {\n super(message)\n }\n}\n"], | ||
| "mappings": ";kcAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,qBAAAC,EAAA,sBAAAC,EAAA,mBAAAC,EAAA,mBAAAC,EAAA,kBAAAC,EAAA,oBAAAC,EAAA,mBAAAC,ICAM,IAAOC,EAAP,MAAOC,UAAwB,KAAK,CACxC,OAAO,KAAO,kBACd,OAAO,KAAO,kBACd,KAAOA,EAAgB,KACvB,KAAOA,EAAgB,KAEvB,YAAaC,EAAU,cAAa,CAClC,MAAMA,CAAO,CACf,GAGWC,EAAP,MAAOC,UAAyB,KAAK,CACzC,OAAO,KAAO,mBACd,OAAO,KAAO,mBACd,KAAOA,EAAiB,KACxB,KAAOA,EAAiB,KAExB,YAAaF,EAAU,eAAc,CACnC,MAAMA,CAAO,CACf,GAGWG,EAAP,MAAOC,UAAuB,KAAK,CACvC,OAAO,KAAO,iBACd,OAAO,KAAO,iBACd,KAAOA,EAAe,KACtB,KAAOA,EAAe,KAEtB,YAAaJ,EAAU,aAAY,CACjC,MAAMA,CAAO,CACf,GAGWK,EAAP,MAAOC,UAAuB,KAAK,CACvC,OAAO,KAAO,iBACd,OAAO,KAAO,iBACd,KAAOA,EAAe,KACtB,KAAOA,EAAe,KAEtB,YAAaN,EAAU,aAAY,CACjC,MAAMA,CAAO,CACf,GAGWO,EAAP,MAAOC,UAA0B,KAAK,CAC1C,OAAO,KAAO,oBACd,OAAO,KAAO,oBACd,KAAOA,EAAkB,KACzB,KAAOA,EAAkB,KAEzB,YAAaR,EAAU,gBAAe,CACpC,MAAMA,CAAO,CACf,GAGWS,EAAP,MAAOC,UAAuB,KAAK,CACvC,OAAO,KAAO,iBACd,OAAO,KAAO,iBACd,KAAOA,EAAe,KACtB,KAAOA,EAAe,KAEtB,YAAaV,EAAU,aAAY,CACjC,MAAMA,CAAO,CACf,GAGWW,EAAP,MAAOC,UAAsB,KAAK,CACtC,OAAO,KAAO,gBACd,OAAO,KAAO,gBACd,KAAOA,EAAc,KACrB,KAAOA,EAAc,KAErB,YAAaZ,EAAU,YAAW,CAChC,MAAMA,CAAO,CACf,GAGWa,EAAP,MAAOC,UAAmB,KAAK,CACnC,OAAO,KAAO,aACd,OAAO,KAAO,cACd,KAAOA,EAAW,KAClB,KAAOA,EAAW,KAElB,YAAad,EAAU,UAAS,CAC9B,MAAMA,CAAO,CACf", | ||
| "names": ["index_exports", "__export", "AbortError", "CloseFailedError", "DeleteFailedError", "GetFailedError", "HasFailedError", "NotFoundError", "OpenFailedError", "PutFailedError", "OpenFailedError", "_OpenFailedError", "message", "CloseFailedError", "_CloseFailedError", "PutFailedError", "_PutFailedError", "GetFailedError", "_GetFailedError", "DeleteFailedError", "_DeleteFailedError", "HasFailedError", "_HasFailedError", "NotFoundError", "_NotFoundError", "AbortError", "_AbortError"] | ||
| } |
@@ -11,2 +11,6 @@ /** | ||
| /** | ||
| * A generator or async generator of values | ||
| */ | ||
| export type AwaitGenerator<T, TReturn = any, TNext = any> = Generator<T, TReturn, TNext> | AsyncGenerator<T, TReturn, TNext>; | ||
| /** | ||
| * A value or a promise of a value | ||
@@ -21,3 +25,3 @@ */ | ||
| } | ||
| export interface Store<Key, Value, Pair, HasOptionsExtension = {}, PutOptionsExtension = {}, PutManyOptionsExtension = {}, GetOptionsExtension = {}, GetManyOptionsExtension = {}, DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> { | ||
| export interface Store<Key, Input, Output, InputPair, OutputPair, HasOptionsExtension = {}, PutOptionsExtension = {}, PutManyOptionsExtension = {}, GetOptionsExtension = {}, GetManyOptionsExtension = {}, DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> { | ||
| /** | ||
@@ -47,3 +51,3 @@ * Check for the existence of a value for the passed key | ||
| */ | ||
| put(key: Key, val: Value, options?: AbortOptions & PutOptionsExtension): Await<Key>; | ||
| put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Await<Key>; | ||
| /** | ||
@@ -61,3 +65,3 @@ * Store the given key/value pairs | ||
| */ | ||
| putMany(source: AwaitIterable<Pair>, options?: AbortOptions & PutManyOptionsExtension): AwaitIterable<Key>; | ||
| putMany(source: AwaitIterable<InputPair>, options?: AbortOptions & PutManyOptionsExtension): AwaitIterable<Key>; | ||
| /** | ||
@@ -73,3 +77,3 @@ * Retrieve the value stored under the given key | ||
| */ | ||
| get(key: Key, options?: AbortOptions & GetOptionsExtension): Await<Value>; | ||
| get(key: Key, options?: AbortOptions & GetOptionsExtension): Output; | ||
| /** | ||
@@ -86,3 +90,3 @@ * Retrieve values for the passed keys | ||
| */ | ||
| getMany(source: AwaitIterable<Key>, options?: AbortOptions & GetManyOptionsExtension): AwaitIterable<Pair>; | ||
| getMany(source: AwaitIterable<Key>, options?: AbortOptions & GetManyOptionsExtension): AwaitIterable<OutputPair>; | ||
| /** | ||
@@ -89,0 +93,0 @@ * Remove the record for the passed key |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;AAE7D;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,MAAM,WAAW,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,GAAG,EAAE,EAC/D,mBAAmB,GAAG,EAAE,EAAE,uBAAuB,GAAG,EAAE,EACtD,mBAAmB,GAAG,EAAE,EAAE,uBAAuB,GAAG,EAAE,EACtD,sBAAsB,GAAG,EAAE,EAAE,0BAA0B,GAAG,EAAE;IAC5D;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,CAAA;IAE3E;;;;;;;;OAQG;IACH,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;IAEnF;;;;;;;;;;;OAWG;IACH,OAAO,CACL,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,EAC3B,OAAO,CAAC,EAAE,YAAY,GAAG,uBAAuB,GAC/C,aAAa,CAAC,GAAG,CAAC,CAAA;IAErB;;;;;;;;;OASG;IACH,GAAG,CAAC,GAAG,EAAE,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A;CACtB;AAED,cAAc,aAAa,CAAA"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8HH,cAAc,aAAa,CAAA"} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoIH,cAAc,aAAa,CAAA"} |
@@ -16,4 +16,6 @@ { | ||
| ".:Await": "https://ipfs.github.io/js-stores/types/interface-store.Await.html", | ||
| "AwaitGenerator": "https://ipfs.github.io/js-stores/types/interface-store.AwaitGenerator.html", | ||
| ".:AwaitGenerator": "https://ipfs.github.io/js-stores/types/interface-store.AwaitGenerator.html", | ||
| "AwaitIterable": "https://ipfs.github.io/js-stores/types/interface-store.AwaitIterable.html", | ||
| ".:AwaitIterable": "https://ipfs.github.io/js-stores/types/interface-store.AwaitIterable.html" | ||
| } |
+1
-1
| { | ||
| "name": "interface-store", | ||
| "version": "6.0.3", | ||
| "version": "7.0.0", | ||
| "description": "A generic interface for storing and retrieving data", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
+14
-8
@@ -13,2 +13,7 @@ /** | ||
| /** | ||
| * A generator or async generator of values | ||
| */ | ||
| export type AwaitGenerator<T, TReturn = any, TNext = any> = Generator<T, TReturn, TNext> | AsyncGenerator<T, TReturn, TNext> | ||
| /** | ||
| * A value or a promise of a value | ||
@@ -25,6 +30,7 @@ */ | ||
| export interface Store<Key, Value, Pair, HasOptionsExtension = {}, | ||
| PutOptionsExtension = {}, PutManyOptionsExtension = {}, | ||
| GetOptionsExtension = {}, GetManyOptionsExtension = {}, | ||
| DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> { | ||
| export interface Store<Key, Input, Output, InputPair, OutputPair, | ||
| HasOptionsExtension = {}, PutOptionsExtension = {}, | ||
| PutManyOptionsExtension = {}, GetOptionsExtension = {}, | ||
| GetManyOptionsExtension = {}, DeleteOptionsExtension = {}, | ||
| DeleteManyOptionsExtension = {}> { | ||
| /** | ||
@@ -55,3 +61,3 @@ * Check for the existence of a value for the passed key | ||
| */ | ||
| put(key: Key, val: Value, options?: AbortOptions & PutOptionsExtension): Await<Key> | ||
| put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Await<Key> | ||
@@ -71,3 +77,3 @@ /** | ||
| putMany( | ||
| source: AwaitIterable<Pair>, | ||
| source: AwaitIterable<InputPair>, | ||
| options?: AbortOptions & PutManyOptionsExtension | ||
@@ -86,3 +92,3 @@ ): AwaitIterable<Key> | ||
| */ | ||
| get(key: Key, options?: AbortOptions & GetOptionsExtension): Await<Value> | ||
| get(key: Key, options?: AbortOptions & GetOptionsExtension): Output | ||
@@ -103,3 +109,3 @@ /** | ||
| options?: AbortOptions & GetManyOptionsExtension | ||
| ): AwaitIterable<Pair> | ||
| ): AwaitIterable<OutputPair> | ||
@@ -106,0 +112,0 @@ /** |
34158
3.06%472
2.39%