@ngx-pwa/local-storage
Advanced tools
Comparing version 13.0.6 to 14.0.0
@@ -30,11 +30,4 @@ import { Observable, ReplaySubject } from 'rxjs'; | ||
protected readonly wrapIndex = "value"; | ||
constructor(); | ||
/** | ||
* Constructor params are provided by Angular (but can also be passed manually in tests) | ||
* @param dbName `indexedDB` database name | ||
* @param storeName `indexedDB` store name | ||
* @param dbVersion `indexedDB` database version | ||
* @param noWrap Flag to not wrap `indexedDB` values for interoperability or to wrap for backward compatibility | ||
*/ | ||
constructor(dbName?: string, storeName?: string, dbVersion?: number, noWrap?: boolean); | ||
/** | ||
* Information about `indexedDB` connection. *Only useful for interoperability.* | ||
@@ -41,0 +34,0 @@ * @returns `indexedDB` database name, store name and database version |
@@ -5,9 +5,5 @@ import { Observable } from 'rxjs'; | ||
* Factory to create a storage according to browser support | ||
* @param platformId Context about the platform (`browser`, `server`...) | ||
* @param LSPrefix Prefix for `localStorage` keys to avoid collision for multiple apps on the same subdomain | ||
* @param IDBDBName `indexedDB` database name | ||
* @param IDBstoreName `indexedDB` storeName name | ||
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/BROWSERS_SUPPORT.md} | ||
*/ | ||
export declare function localDatabaseFactory(platformId: string, LSPrefix: string, IDBDBName: string, IDBStoreName: string, IDBDBVersion: number, IDBNoWrap: boolean): LocalDatabase; | ||
export declare function localDatabaseFactory(): LocalDatabase; | ||
export declare abstract class LocalDatabase { | ||
@@ -14,0 +10,0 @@ abstract readonly size: Observable<number>; |
@@ -9,6 +9,2 @@ import { Observable } from 'rxjs'; | ||
readonly prefix: string; | ||
/** | ||
* Constructor params are provided by Angular (but can also be passed manually in tests) | ||
* @param prefix Prefix option to avoid collision for multiple apps on the same subdomain or for interoperability | ||
*/ | ||
constructor(prefix?: string); | ||
@@ -15,0 +11,0 @@ /** |
@@ -9,3 +9,3 @@ import { Observable, OperatorFunction, ReplaySubject } from 'rxjs'; | ||
protected jsonValidator: JSONValidator; | ||
protected LSPrefix: string; | ||
protected readonly LSPrefix: string; | ||
protected notifiers: Map<string, ReplaySubject<unknown>>; | ||
@@ -12,0 +12,0 @@ /** |
@@ -46,25 +46,15 @@ import { InjectionToken } from '@angular/core'; | ||
/** | ||
* Allows to add a prefix before `localStorage` keys. | ||
* *Use only* for interoperability with other APIs or to avoid collision for multiple apps on the same subdomain. | ||
* **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.** | ||
* @deprecated Use `provideLocalStoragePrefix()` method instead | ||
*/ | ||
LSPrefix?: string; | ||
/** | ||
* Allows to change the name used for `indexedDB` database. | ||
* *Use only* for interoperability with other APIs or to avoid collision for multiple apps on the same subdomain. | ||
* **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.** | ||
* @deprecated Use `provideIndexedDBDataBaseName()` method instead | ||
*/ | ||
IDBDBName?: string; | ||
/** | ||
* Allows to change the name used for `indexedDB` object store. | ||
* *Use only* for interoperability with other APIs. | ||
* **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.** | ||
* @deprecated Use `provideIndexedDBStoreName()` method instead | ||
*/ | ||
IDBStoreName?: string; | ||
/** | ||
* Allows to change the database version used for `indexedDB` database. | ||
* Must be an unsigned **integer**. | ||
* **Use with caution as the creation of the store depends on the version.** | ||
* *Use only* for interoperability with other APIs or to avoid collision for multiple apps on the same subdomain. | ||
* **WARNING: do not change this option in an app already deployed in production, as previously stored data would be lost.** | ||
* @deprecated Use `provideIndexedDBDataBaseVersion()` method instead | ||
*/ | ||
@@ -71,0 +61,0 @@ IDBDBVersion?: number; |
{ | ||
"name": "@ngx-pwa/local-storage", | ||
"version": "13.0.6", | ||
"version": "14.0.0", | ||
"funding": { | ||
@@ -23,5 +23,5 @@ "type": "github", | ||
"peerDependencies": { | ||
"@angular/common": "^13.0.0 || ^14.0.0", | ||
"@angular/core": "^13.0.0 || ^14.0.0", | ||
"rxjs": "^6.5.3 || ^7.4.0" | ||
"@angular/common": "^15.0.0", | ||
"@angular/core": "^15.0.0", | ||
"rxjs": "^7.4.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "schematics": "./schematics/collection.json", | ||
"fesm2015": "fesm2015/ngx-pwa-local-storage.mjs", | ||
"typings": "ngx-pwa-local-storage.d.ts", | ||
"typings": "index.d.ts", | ||
"exports": { | ||
@@ -44,3 +44,3 @@ "./package.json": { | ||
".": { | ||
"types": "./ngx-pwa-local-storage.d.ts", | ||
"types": "./index.d.ts", | ||
"esm2020": "./esm2020/ngx-pwa-local-storage.mjs", | ||
@@ -47,0 +47,0 @@ "es2020": "./fesm2020/ngx-pwa-local-storage.mjs", |
@@ -10,1 +10,2 @@ export { JSONSchema, JSONSchemaBoolean, JSONSchemaInteger, JSONSchemaNumber, JSONSchemaString, JSONSchemaArray, JSONSchemaArrayOf, JSONSchemaObject } from './lib/validation/json-schema'; | ||
export { StorageModule } from './lib/storage.module'; | ||
export { provideIndexedDBDataBaseName, provideIndexedDBDataBaseVersion, provideIndexedDBStoreName, provideLocalStoragePrefix } from './lib/providers'; |
@@ -18,4 +18,9 @@ { | ||
"factory": "./ng-update/index#updateToV13" | ||
}, | ||
"migration-v15": { | ||
"version": "15", | ||
"description": "Updates @ngx-pwa/local-storage to v15", | ||
"factory": "./ng-update/index#updateToV15" | ||
} | ||
} | ||
} |
@@ -11,12 +11,17 @@ "use strict"; | ||
if (!angularMajorVersion) { | ||
context.logger.warn(`Not able to detect @angular/core version. Be aware that Angular versions <= 10 are no longer supported.`); | ||
context.logger.warn(`Not able to detect @angular/core version. Be aware that Angular versions <= 12 are no longer supported.`); | ||
} | ||
if (angularMajorVersion && (angularMajorVersion <= 10)) { | ||
throw new schematics_1.SchematicsException('Angular versions <= 10 are no longer supported.'); | ||
if (angularMajorVersion && (angularMajorVersion <= 12)) { | ||
throw new schematics_1.SchematicsException('Angular versions <= 12 are no longer supported.'); | ||
} | ||
const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)('rxjs', host); | ||
if (!rxjsMajorVersion) { | ||
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for Angular >= 13.`); | ||
// eslint-disable-next-line max-len | ||
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is recommended for Angular 13 & 14 and required for Angular >= 15.`); | ||
} | ||
if (angularMajorVersion && rxjsMajorVersion | ||
&& (angularMajorVersion >= 15) && (rxjsMajorVersion < 7)) { | ||
throw new schematics_1.SchematicsException('rxjs >= 7.4 is required for this lib, rxjs 6 is not supported.'); | ||
} | ||
if (angularMajorVersion && rxjsMajorVersion | ||
&& (angularMajorVersion >= 13) && (rxjsMajorVersion < 7)) { | ||
@@ -23,0 +28,0 @@ context.logger.warn(`rxjs should be updated to version >= 7.4. Support for rxjs version 6 is not guaranteed.`); |
@@ -5,1 +5,2 @@ import { Rule } from '@angular-devkit/schematics'; | ||
export declare function updateToV13(): Rule; | ||
export declare function updateToV15(): Rule; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateToV13 = exports.updateToV9 = exports.updateToV8 = void 0; | ||
exports.updateToV15 = exports.updateToV13 = exports.updateToV9 = exports.updateToV8 = void 0; | ||
const schematics_1 = require("@angular-devkit/schematics"); | ||
@@ -48,2 +48,16 @@ const config_1 = require("../utility/config"); | ||
exports.updateToV13 = updateToV13; | ||
function updateToV15() { | ||
return (host, context) => { | ||
const rxjsMajorVersion = (0, config_1.getDependencyMajorVersion)('rxjs', host); | ||
if (!rxjsMajorVersion) { | ||
// eslint-disable-next-line max-len | ||
context.logger.warn(`Not able to detect rxjs version. Be aware that rxjs version >= 7.4 is required for version 15 of this lib, rxjs 6 is not supported.`); | ||
} | ||
if (rxjsMajorVersion && (rxjsMajorVersion < 7)) { | ||
throw new schematics_1.SchematicsException('rxjs >= 7.4 is required for this lib, rxjs 6 is not supported.'); | ||
} | ||
return host; | ||
}; | ||
} | ||
exports.updateToV15 = updateToV15; | ||
//# sourceMappingURL=index.js.map |
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
560920
52
5653
1