@fluidframework/driver-web-cache 2.0.0-dev.7.3.0.212138 → 2.0.0-dev.7.4.0.215366
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.
- package/api-extractor.json +12 -1
- package/dist/driver-web-cache-alpha.d.ts +67 -0
- package/dist/driver-web-cache-beta.d.ts +67 -0
- package/dist/driver-web-cache-public.d.ts +67 -0
- package/dist/driver-web-cache-untrimmed.d.ts +67 -0
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/lib/driver-web-cache-alpha.d.ts +67 -0
- package/lib/driver-web-cache-beta.d.ts +67 -0
- package/lib/driver-web-cache-public.d.ts +67 -0
- package/lib/driver-web-cache-untrimmed.d.ts +67 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/package.json +24 -8
- package/src/packageVersion.ts +1 -1
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.json",
|
|
4
|
+
"dtsRollup": {
|
|
5
|
+
"enabled": true
|
|
6
|
+
},
|
|
7
|
+
"messages": {
|
|
8
|
+
"extractorMessageReporting": {
|
|
9
|
+
// TODO: Add missing documentation and remove this rule override
|
|
10
|
+
"ae-undocumented": {
|
|
11
|
+
"logLevel": "none"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
4
15
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
package/dist/packageVersion.cjs
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/driver-web-cache";
|
|
11
|
-
exports.pkgVersion = "2.0.0-dev.7.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev.7.4.0.215366";
|
|
12
12
|
//# sourceMappingURL=packageVersion.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.cjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.0.0-dev.7.
|
|
1
|
+
{"version":3,"file":"packageVersion.cjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.215366\";\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/driver-web-cache";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.7.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.7.4.0.215366";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteDBCallbacks } from 'idb';
|
|
2
|
+
import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
|
|
3
|
+
import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
|
|
4
|
+
import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
|
|
5
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Deletes the indexed DB instance.
|
|
9
|
+
*
|
|
10
|
+
* @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare class FluidCache implements IPersistedCache {
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly partitionKey;
|
|
24
|
+
private readonly maxCacheItemAge;
|
|
25
|
+
private readonly closeDbImmediately;
|
|
26
|
+
private readonly closeDbAfterMs;
|
|
27
|
+
private db;
|
|
28
|
+
private dbCloseTimer;
|
|
29
|
+
private dbReuseCount;
|
|
30
|
+
constructor(config: FluidCacheConfig);
|
|
31
|
+
private openDb;
|
|
32
|
+
private closeDb;
|
|
33
|
+
removeEntries(file: IFileEntry): Promise<void>;
|
|
34
|
+
get(cacheEntry: ICacheEntry): Promise<any>;
|
|
35
|
+
private getItemFromCache;
|
|
36
|
+
put(entry: ICacheEntry, value: any): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare interface FluidCacheConfig {
|
|
43
|
+
/**
|
|
44
|
+
* A string to specify what partition of the cache you wish to use (e.g. a user id).
|
|
45
|
+
* Null can be used to explicity indicate no partitioning, and has been chosen
|
|
46
|
+
* vs undefined so that it is clear this is an intentional choice by the caller.
|
|
47
|
+
* A null value should only be used when the host can ensure that the cache is not able
|
|
48
|
+
* to be shared with multiple users.
|
|
49
|
+
*/
|
|
50
|
+
partitionKey: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* A logger that can be used to get insight into cache performance and errors
|
|
53
|
+
*/
|
|
54
|
+
logger?: ITelemetryBaseLogger;
|
|
55
|
+
/**
|
|
56
|
+
* A value in milliseconds that determines the maximum age of a cache entry to return.
|
|
57
|
+
* If an entry exists in the cache, but is older than this value, the cached value will not be returned.
|
|
58
|
+
*/
|
|
59
|
+
maxCacheItemAge: number;
|
|
60
|
+
/**
|
|
61
|
+
* Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
|
|
62
|
+
* any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
|
|
63
|
+
*/
|
|
64
|
+
closeDbAfterMs?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { }
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/driver-web-cache";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.7.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.7.4.0.215366";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.mjs
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/driver-web-cache";
|
|
8
|
-
export const pkgVersion = "2.0.0-dev.7.
|
|
8
|
+
export const pkgVersion = "2.0.0-dev.7.4.0.215366";
|
|
9
9
|
//# sourceMappingURL=packageVersion.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.0.0-dev.7.
|
|
1
|
+
{"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.215366\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-web-cache",
|
|
3
|
-
"version": "2.0.0-dev.7.
|
|
3
|
+
"version": "2.0.0-dev.7.4.0.215366",
|
|
4
4
|
"description": "Implementation of the driver caching API for a web browser",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"module": "lib/index.mjs",
|
|
28
28
|
"types": "dist/index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@fluidframework/core-interfaces": "2.0.0-dev.7.
|
|
31
|
-
"@fluidframework/core-utils": "2.0.0-dev.7.
|
|
32
|
-
"@fluidframework/odsp-driver-definitions": "2.0.0-dev.7.
|
|
33
|
-
"@fluidframework/telemetry-utils": "2.0.0-dev.7.
|
|
30
|
+
"@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.215366",
|
|
31
|
+
"@fluidframework/core-utils": "2.0.0-dev.7.4.0.215366",
|
|
32
|
+
"@fluidframework/odsp-driver-definitions": "2.0.0-dev.7.4.0.215366",
|
|
33
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.215366",
|
|
34
34
|
"idb": "^6.1.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@microsoft/api-extractor": "^7.38.3",
|
|
43
43
|
"@types/jest": "29.5.3",
|
|
44
44
|
"@types/node": "^16.18.38",
|
|
45
|
+
"copyfiles": "^2.4.1",
|
|
45
46
|
"eslint": "~8.50.0",
|
|
46
47
|
"fake-indexeddb": "3.1.4",
|
|
47
48
|
"jest": "^29.6.2",
|
|
@@ -50,14 +51,29 @@
|
|
|
50
51
|
"tsc-multi": "^1.1.0",
|
|
51
52
|
"typescript": "~5.1.6"
|
|
52
53
|
},
|
|
54
|
+
"fluidBuild": {
|
|
55
|
+
"tasks": {
|
|
56
|
+
"build:docs": {
|
|
57
|
+
"dependsOn": [
|
|
58
|
+
"...",
|
|
59
|
+
"api-extractor:commonjs",
|
|
60
|
+
"api-extractor:esnext"
|
|
61
|
+
],
|
|
62
|
+
"script": false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
53
66
|
"typeValidation": {
|
|
54
67
|
"broken": {}
|
|
55
68
|
},
|
|
56
69
|
"scripts": {
|
|
70
|
+
"api": "fluid-build . --task api",
|
|
71
|
+
"api-extractor:commonjs": "api-extractor run --local",
|
|
72
|
+
"api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
|
|
57
73
|
"build": "fluid-build . --task build",
|
|
58
74
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
59
75
|
"build:compile": "fluid-build . --task compile",
|
|
60
|
-
"build:docs": "
|
|
76
|
+
"build:docs": "fluid-build . --task api",
|
|
61
77
|
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
|
|
62
78
|
"build:genver": "gen-version",
|
|
63
79
|
"build:test": "tsc-multi --config ./tsc-multi.test.json",
|
|
@@ -68,8 +84,8 @@
|
|
|
68
84
|
"format": "npm run prettier:fix",
|
|
69
85
|
"lint": "npm run prettier && npm run eslint",
|
|
70
86
|
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
71
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
72
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
87
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
88
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
73
89
|
"test": "npm run test:jest",
|
|
74
90
|
"test:jest": "jest",
|
|
75
91
|
"tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
|
package/src/packageVersion.ts
CHANGED