v1.2.2 - Fix network error on background, auto-retry streaming with reconnect
This commit is contained in:
19
node_modules/@kvs/node-localstorage/LICENSE
generated
vendored
Normal file
19
node_modules/@kvs/node-localstorage/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2020 azu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
48
node_modules/@kvs/node-localstorage/README.md
generated
vendored
Normal file
48
node_modules/@kvs/node-localstorage/README.md
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# @kvs/node-localstorage
|
||||
|
||||
Node.js localstorage for [KVS](https://github.com/azu/kvs).
|
||||
|
||||
## Dependencies
|
||||
|
||||
- [lmaccherone/node-localstorage: A drop-in substitute for the browser native localStorage API that runs on node.js.](https://github.com/lmaccherone/node-localstorage)
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
npm install @kvs/node-localstorage
|
||||
|
||||
## Usage
|
||||
|
||||
See <https://github.com/azu/kvs#usage>
|
||||
|
||||
## Changelog
|
||||
|
||||
See [Releases page](https://github.com/azu/kvs/releases).
|
||||
|
||||
## Running tests
|
||||
|
||||
Install devDependencies and Run `npm test`:
|
||||
|
||||
npm test
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome.
|
||||
|
||||
For bugs and feature requests, [please create an issue](https://github.com/azu/kvs/issues).
|
||||
|
||||
1. Fork it!
|
||||
2. Create your feature branch: `git checkout -b my-new-feature`
|
||||
3. Commit your changes: `git commit -am 'Add some feature'`
|
||||
4. Push to the branch: `git push origin my-new-feature`
|
||||
5. Submit a pull request :D
|
||||
|
||||
## Author
|
||||
|
||||
- [github/azu](https://github.com/azu)
|
||||
- [twitter/azu_re](https://twitter.com/azu_re)
|
||||
|
||||
## License
|
||||
|
||||
MIT © azu
|
||||
12
node_modules/@kvs/node-localstorage/lib/index.d.ts
generated
vendored
Normal file
12
node_modules/@kvs/node-localstorage/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { JsonValue, KvsStorage } from "@kvs/storage";
|
||||
import { KVS, KVSOptions } from "@kvs/types";
|
||||
export type KvsLocalStorageSchema = {
|
||||
[index: string]: JsonValue;
|
||||
};
|
||||
export type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<Schema>;
|
||||
export type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
|
||||
kvsVersionKey?: string;
|
||||
storeFilePath?: string;
|
||||
storeQuota?: number;
|
||||
};
|
||||
export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KvsStorage<Schema>>;
|
||||
31
node_modules/@kvs/node-localstorage/lib/index.js
generated
vendored
Normal file
31
node_modules/@kvs/node-localstorage/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.kvsLocalStorage = void 0;
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const storage_1 = require("@kvs/storage");
|
||||
const promises_1 = __importDefault(require("node:fs/promises"));
|
||||
// @ts-ignore
|
||||
const node_localstorage_1 = require("node-localstorage");
|
||||
// @ts-ignore
|
||||
const app_root_path_1 = __importDefault(require("app-root-path"));
|
||||
const kvsLocalStorage = async (options) => {
|
||||
const defaultCacheDir = path_1.default.join(app_root_path_1.default.toString(), ".cache");
|
||||
if (!options.storeFilePath) {
|
||||
await promises_1.default.mkdir(defaultCacheDir, {
|
||||
recursive: true
|
||||
});
|
||||
}
|
||||
const saveFilePath = options.storeFilePath
|
||||
? options.storeFilePath
|
||||
: path_1.default.join(defaultCacheDir, "kvs-node-localstorage");
|
||||
const storeQuota = options.storeQuota ? options.storeQuota : 5 * 1024 * 1024;
|
||||
return (0, storage_1.kvsStorage)({
|
||||
...options,
|
||||
storage: new node_localstorage_1.LocalStorage(saveFilePath, storeQuota)
|
||||
});
|
||||
};
|
||||
exports.kvsLocalStorage = kvsLocalStorage;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@kvs/node-localstorage/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@kvs/node-localstorage/lib/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,0CAAiE;AAEjE,gEAAkC;AAClC,aAAa;AACb,yDAAiD;AACjD,aAAa;AACb,kEAAoC;AAW7B,MAAM,eAAe,GAAG,KAAK,EAChC,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,kBAAE,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5B,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;IACP,CAAC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7E,OAAO,IAAA,oBAAU,EAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,IAAI,gCAAY,CAAC,YAAY,EAAE,UAAU,CAAC;KACtD,CAAC,CAAC;AACP,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B"}
|
||||
12
node_modules/@kvs/node-localstorage/module/index.d.ts
generated
vendored
Normal file
12
node_modules/@kvs/node-localstorage/module/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { JsonValue, KvsStorage } from "@kvs/storage";
|
||||
import { KVS, KVSOptions } from "@kvs/types";
|
||||
export type KvsLocalStorageSchema = {
|
||||
[index: string]: JsonValue;
|
||||
};
|
||||
export type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<Schema>;
|
||||
export type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
|
||||
kvsVersionKey?: string;
|
||||
storeFilePath?: string;
|
||||
storeQuota?: number;
|
||||
};
|
||||
export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KvsStorage<Schema>>;
|
||||
24
node_modules/@kvs/node-localstorage/module/index.js
generated
vendored
Normal file
24
node_modules/@kvs/node-localstorage/module/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import path from "path";
|
||||
import { kvsStorage } from "@kvs/storage";
|
||||
import fs from "node:fs/promises";
|
||||
// @ts-ignore
|
||||
import { LocalStorage } from "node-localstorage";
|
||||
// @ts-ignore
|
||||
import appRoot from "app-root-path";
|
||||
export const kvsLocalStorage = async (options) => {
|
||||
const defaultCacheDir = path.join(appRoot.toString(), ".cache");
|
||||
if (!options.storeFilePath) {
|
||||
await fs.mkdir(defaultCacheDir, {
|
||||
recursive: true
|
||||
});
|
||||
}
|
||||
const saveFilePath = options.storeFilePath
|
||||
? options.storeFilePath
|
||||
: path.join(defaultCacheDir, "kvs-node-localstorage");
|
||||
const storeQuota = options.storeQuota ? options.storeQuota : 5 * 1024 * 1024;
|
||||
return kvsStorage({
|
||||
...options,
|
||||
storage: new LocalStorage(saveFilePath, storeQuota)
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@kvs/node-localstorage/module/index.js.map
generated
vendored
Normal file
1
node_modules/@kvs/node-localstorage/module/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAyB,UAAU,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,eAAe,CAAC;AAWpC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAChC,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5B,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;IACP,CAAC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7E,OAAO,UAAU,CAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,IAAI,YAAY,CAAC,YAAY,EAAE,UAAU,CAAC;KACtD,CAAC,CAAC;AACP,CAAC,CAAC"}
|
||||
67
node_modules/@kvs/node-localstorage/package.json
generated
vendored
Normal file
67
node_modules/@kvs/node-localstorage/package.json
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "@kvs/node-localstorage",
|
||||
"version": "2.2.2",
|
||||
"description": "Node.js localstorage for KVS.",
|
||||
"keywords": [
|
||||
"kvs",
|
||||
"browser",
|
||||
"localstorage"
|
||||
],
|
||||
"homepage": "https://github.com/azu/kvs/tree/master/packages/node-localstorage/",
|
||||
"bugs": {
|
||||
"url": "https://github.com/azu/kvs/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/azu/kvs.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "azu",
|
||||
"sideEffects": false,
|
||||
"main": "lib/index.js",
|
||||
"module": "module/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "test"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"lib/",
|
||||
"module"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc -p . && tsc --project ./tsconfig.module.json",
|
||||
"clean": "rimraf lib/ module/",
|
||||
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
|
||||
"prepublishOnly": "npm run clean && npm run build",
|
||||
"test": "mocha \"test/**/*.ts\"",
|
||||
"watch": "tsc -p . --watch"
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 120,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "none"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kvs/storage": "^2.2.2",
|
||||
"@kvs/types": "^2.2.2",
|
||||
"app-root-path": "^3.1.0",
|
||||
"node-localstorage": "^2.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kvs/common-test-case": "^2.2.2",
|
||||
"@types/mocha": "^10.0.1",
|
||||
"@types/node": "^20.4.2",
|
||||
"mocha": "^10.2.0",
|
||||
"prettier": "^3.0.0",
|
||||
"rimraf": "^5.0.1",
|
||||
"ts-loader": "^9.4.4",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "d8a7098f37e551532dbcc8c411fe26ec493cd898"
|
||||
}
|
||||
Reference in New Issue
Block a user