@salesforce/lds-aura-storage 1.124.1 → 1.124.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,45 +14,45 @@
14
14
  /* proxy-compat-disable */
15
15
  import auraStorage from 'aura-storage';
16
16
 
17
- // The VERSION environment variable is replaced by rollup during the bundling and replaces it with
18
- // the commit hash. This avoid having a cache hit on data that has been stored by a previous
19
- // version of LDS.
20
- const STORAGE_VERSION = "b9e603b9e";
21
- // AuraStorage treats `secure` as a must-have whereas `persistent` is a nice-to-have. Secure and
22
- // persistent storage is only possible with CryptoAdapter. Availability of that adapter is
23
- // controlled by the application.
24
- const STORAGE_CONFIG = {
25
- persistent: true,
26
- secure: true,
27
- maxSize: 5 * 1024 * 1024,
28
- clearOnInit: false,
29
- debugLogging: false,
30
- version: STORAGE_VERSION,
31
- };
32
- const STORAGE_INSTANCES = [];
33
- function createStorage(config) {
34
- if (auraStorage.initStorage === undefined) {
35
- return null;
36
- }
37
- const storageConfig = {
38
- ...STORAGE_CONFIG,
39
- ...config,
40
- };
41
- const storage = auraStorage.initStorage(storageConfig);
42
- if (!storage.isPersistent()) {
43
- if (auraStorage.deleteStorage !== undefined) {
44
- auraStorage.deleteStorage(storageConfig.name).catch(() => { }); // intentional noop on error
45
- }
46
- return null;
47
- }
48
- STORAGE_INSTANCES.push(storage);
49
- return storage;
50
- }
51
- function clearStorages() {
52
- return Promise.all(STORAGE_INSTANCES.map((storage) => {
53
- return storage.clear().catch(() => { }); // intentional noop on error
54
- }));
17
+ // The VERSION environment variable is replaced by rollup during the bundling and replaces it with
18
+ // the commit hash. This avoid having a cache hit on data that has been stored by a previous
19
+ // version of LDS.
20
+ const STORAGE_VERSION = "cf2dbb2fa";
21
+ // AuraStorage treats `secure` as a must-have whereas `persistent` is a nice-to-have. Secure and
22
+ // persistent storage is only possible with CryptoAdapter. Availability of that adapter is
23
+ // controlled by the application.
24
+ const STORAGE_CONFIG = {
25
+ persistent: true,
26
+ secure: true,
27
+ maxSize: 5 * 1024 * 1024,
28
+ clearOnInit: false,
29
+ debugLogging: false,
30
+ version: STORAGE_VERSION,
31
+ };
32
+ const STORAGE_INSTANCES = [];
33
+ function createStorage(config) {
34
+ if (auraStorage.initStorage === undefined) {
35
+ return null;
36
+ }
37
+ const storageConfig = {
38
+ ...STORAGE_CONFIG,
39
+ ...config,
40
+ };
41
+ const storage = auraStorage.initStorage(storageConfig);
42
+ if (!storage.isPersistent()) {
43
+ if (auraStorage.deleteStorage !== undefined) {
44
+ auraStorage.deleteStorage(storageConfig.name).catch(() => { }); // intentional noop on error
45
+ }
46
+ return null;
47
+ }
48
+ STORAGE_INSTANCES.push(storage);
49
+ return storage;
50
+ }
51
+ function clearStorages() {
52
+ return Promise.all(STORAGE_INSTANCES.map((storage) => {
53
+ return storage.clear().catch(() => { }); // intentional noop on error
54
+ }));
55
55
  }
56
56
 
57
57
  export { clearStorages, createStorage };
58
- // version: 1.124.1-b9e603b9e
58
+ // version: 1.124.3-cf2dbb2fa
@@ -1,19 +1,19 @@
1
- declare class Storage {
2
- _entries: {
3
- [key: string]: any;
4
- };
5
- get(key: string): Promise<any>;
6
- set(key: string, value: any): Promise<void>;
7
- clear(): Promise<void>;
8
- getSize(): Promise<number>;
9
- isPersistent(): boolean;
10
- }
11
- declare const _default: {
12
- initStorage({ name }: {
13
- name: string;
14
- }): Storage;
15
- getStorage(name: string): Storage;
16
- deleteStorage(name: string): void;
17
- __reset(): Promise<void>;
18
- };
19
- export default _default;
1
+ declare class Storage {
2
+ _entries: {
3
+ [key: string]: any;
4
+ };
5
+ get(key: string): Promise<any>;
6
+ set(key: string, value: any): Promise<void>;
7
+ clear(): Promise<void>;
8
+ getSize(): Promise<number>;
9
+ isPersistent(): boolean;
10
+ }
11
+ declare const _default: {
12
+ initStorage({ name }: {
13
+ name: string;
14
+ }): Storage;
15
+ getStorage(name: string): Storage;
16
+ deleteStorage(name: string): void;
17
+ __reset(): Promise<void>;
18
+ };
19
+ export default _default;
@@ -1,3 +1,3 @@
1
- import type { AuraStorage, AuraStorageConfig } from 'aura-storage';
2
- export declare function createStorage(config: AuraStorageConfig): AuraStorage | null;
3
- export declare function clearStorages(): Promise<void[]>;
1
+ import type { AuraStorage, AuraStorageConfig } from 'aura-storage';
2
+ export declare function createStorage(config: AuraStorageConfig): AuraStorage | null;
3
+ export declare function clearStorages(): Promise<void[]>;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@salesforce/lds-aura-storage",
3
- "version": "1.124.1",
3
+ "version": "1.124.3",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS Network Adapter for Aura Runtime",
6
6
  "main": "dist/ldsStorage.js",
7
7
  "module": "dist/ldsStorage.js",
8
- "types": "dist/main.d.ts",
8
+ "types": "dist/types/main.d.ts",
9
9
  "sfdc": {
10
10
  "path": "forcelds/ldsStorage/",
11
11
  "publishedFileName": "ldsStorage.js",
package/rollup.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import resolve from '@rollup/plugin-node-resolve';
2
- import typescript from 'rollup-plugin-typescript2';
2
+ import typescript from '@rollup/plugin-typescript';
3
3
  import replace from '@rollup/plugin-replace';
4
4
 
5
5
  import * as packageJson from './package.json';
@@ -30,7 +30,7 @@ const ldsStorage = {
30
30
  copyrightHeaderPlugin,
31
31
  resolve(),
32
32
  typescript({
33
- clean: true,
33
+ declarationDir: 'types',
34
34
  }),
35
35
  replace({
36
36
  'process.env.VERSION': JSON.stringify(hash),