@fluidframework/odsp-driver-definitions 2.0.3 → 2.0.5

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.
@@ -10,7 +10,7 @@ import { IDriverErrorBase } from '@fluidframework/driver-definitions/internal';
10
10
  import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
11
11
 
12
12
  // @alpha (undocumented)
13
- export type CacheContentType = "snapshot" | "ops";
13
+ export type CacheContentType = "snapshot" | "ops" | "snapshotWithLoadingGroupId";
14
14
 
15
15
  // @alpha (undocumented)
16
16
  export interface HostStoragePolicy {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from "./errors.js";
6
6
  export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory.js";
7
- export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache.js";
7
+ export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, snapshotWithLoadingGroupIdKey, } from "./odspCache.js";
8
8
  export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl.js";
9
9
  export { IdentityType, InstrumentedStorageTokenFetcher, InstrumentedTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, authHeaderFromTokenResponse, tokenFromResponse, TokenResponse, } from "./tokenFetch.js";
10
10
  export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,6BAA6B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -4,13 +4,14 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.tokenFromResponse = exports.authHeaderFromTokenResponse = exports.isTokenFromCache = exports.SharingLinkScope = exports.SharingLinkRole = exports.snapshotKey = exports.getKeyForCacheEntry = exports.maximumCacheDurationMs = exports.OdspErrorTypes = void 0;
7
+ exports.tokenFromResponse = exports.authHeaderFromTokenResponse = exports.isTokenFromCache = exports.SharingLinkScope = exports.SharingLinkRole = exports.snapshotWithLoadingGroupIdKey = exports.snapshotKey = exports.getKeyForCacheEntry = exports.maximumCacheDurationMs = exports.OdspErrorTypes = void 0;
8
8
  var errors_js_1 = require("./errors.js");
9
9
  Object.defineProperty(exports, "OdspErrorTypes", { enumerable: true, get: function () { return errors_js_1.OdspErrorTypes; } });
10
10
  var odspCache_js_1 = require("./odspCache.js");
11
11
  Object.defineProperty(exports, "maximumCacheDurationMs", { enumerable: true, get: function () { return odspCache_js_1.maximumCacheDurationMs; } });
12
12
  Object.defineProperty(exports, "getKeyForCacheEntry", { enumerable: true, get: function () { return odspCache_js_1.getKeyForCacheEntry; } });
13
13
  Object.defineProperty(exports, "snapshotKey", { enumerable: true, get: function () { return odspCache_js_1.snapshotKey; } });
14
+ Object.defineProperty(exports, "snapshotWithLoadingGroupIdKey", { enumerable: true, get: function () { return odspCache_js_1.snapshotWithLoadingGroupIdKey; } });
14
15
  var resolvedUrl_js_1 = require("./resolvedUrl.js");
15
16
  Object.defineProperty(exports, "SharingLinkRole", { enumerable: true, get: function () { return resolvedUrl_js_1.SharingLinkRole; } });
16
17
  Object.defineProperty(exports, "SharingLinkScope", { enumerable: true, get: function () { return resolvedUrl_js_1.SharingLinkScope; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAA6F;AAApC,2GAAA,cAAc,OAAA;AAOvE,+CASwB;AAPvB,sHAAA,sBAAsB,OAAA;AACtB,mHAAA,mBAAmB,OAAA;AAKnB,2GAAA,WAAW,OAAA;AAEZ,mDAQ0B;AAFzB,iHAAA,eAAe,OAAA;AACf,kHAAA,gBAAgB,OAAA;AAEjB,iDAWyB;AAPxB,iHAAA,gBAAgB,OAAA;AAIhB,4HAAA,2BAA2B,OAAA;AAC3B,kHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from \"./errors.js\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory.js\";\nexport {\n\tCacheContentType,\n\tmaximumCacheDurationMs,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n} from \"./odspCache.js\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl.js\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tInstrumentedTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\tauthHeaderFromTokenResponse,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAA6F;AAApC,2GAAA,cAAc,OAAA;AAOvE,+CAUwB;AARvB,sHAAA,sBAAsB,OAAA;AACtB,mHAAA,mBAAmB,OAAA;AAKnB,2GAAA,WAAW,OAAA;AACX,6HAAA,6BAA6B,OAAA;AAE9B,mDAQ0B;AAFzB,iHAAA,eAAe,OAAA;AACf,kHAAA,gBAAgB,OAAA;AAEjB,iDAWyB;AAPxB,iHAAA,gBAAgB,OAAA;AAIhB,4HAAA,2BAA2B,OAAA;AAC3B,kHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from \"./errors.js\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory.js\";\nexport {\n\tCacheContentType,\n\tmaximumCacheDurationMs,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n\tsnapshotWithLoadingGroupIdKey,\n} from \"./odspCache.js\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl.js\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tInstrumentedTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\tauthHeaderFromTokenResponse,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
@@ -17,10 +17,15 @@ export declare const maximumCacheDurationMs: FiveDaysMs;
17
17
  * @internal
18
18
  */
19
19
  export declare const snapshotKey = "snapshot";
20
+ /**
21
+ * Describes key for partial snapshot with loading GroupId in cache entry.
22
+ * @internal
23
+ */
24
+ export declare const snapshotWithLoadingGroupIdKey = "snapshotWithLoadingGroupId";
20
25
  /**
21
26
  * @alpha
22
27
  */
23
- export type CacheContentType = "snapshot" | "ops";
28
+ export type CacheContentType = "snapshot" | "ops" | "snapshotWithLoadingGroupId";
24
29
  /**
25
30
  * @alpha
26
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAwB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
1
+ {"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAwB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,GAAG,4BAA4B,CAAC;AAOjF;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
package/dist/odspCache.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getKeyForCacheEntry = exports.snapshotKey = exports.maximumCacheDurationMs = void 0;
7
+ exports.getKeyForCacheEntry = exports.snapshotWithLoadingGroupIdKey = exports.snapshotKey = exports.maximumCacheDurationMs = void 0;
8
8
  /**
9
9
  * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
10
10
  * That policy is the outward expression and this value is the implementation - using a larger value
@@ -19,6 +19,11 @@ exports.maximumCacheDurationMs = 432000000; // 5 days in ms
19
19
  * @internal
20
20
  */
21
21
  exports.snapshotKey = "snapshot";
22
+ /**
23
+ * Describes key for partial snapshot with loading GroupId in cache entry.
24
+ * @internal
25
+ */
26
+ exports.snapshotWithLoadingGroupIdKey = "snapshotWithLoadingGroupId";
22
27
  /**
23
28
  * Api to generate a cache key from cache entry.
24
29
  * @param entry - cache entry from which a cache key is generated
@@ -1 +1 @@
1
- {"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;;;GAOG;AACU,QAAA,sBAAsB,GAAe,SAAW,CAAC,CAAC,eAAe;AAE9E;;;GAGG;AACU,QAAA,WAAW,GAAG,UAAU,CAAC;AA8FtC;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAFD,kDAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type FiveDaysMs, IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.\n * That policy is the outward expression and this value is the implementation - using a larger value\n * would violate that statement of the driver's behavior.\n * Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.\n *\n * @internal\n */\nexport const maximumCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms\n\n/**\n * Describes what kind of content is stored in cache entry.\n * @internal\n */\nexport const snapshotKey = \"snapshot\";\n/**\n * @alpha\n */\nexport type CacheContentType = \"snapshot\" | \"ops\";\n\n/*\n * File / container identifier.\n * There is overlapping information here - host can use all of it or parts\n * to implement storage / identify files.\n */\n/**\n * @alpha\n */\nexport interface IFileEntry {\n\t/**\n\t * Unique and stable ID of the document.\n\t * Driver guarantees that docId is stable ID uniquely identifying document.\n\t */\n\tdocId: string;\n\t/**\n\t * Resolved URI is provided for additional versatility - host can use it to\n\t * identify file in storage, and (as example) delete all cached entries for\n\t * a file if user requests so.\n\t * This is IOdspResolvedUrl in case of ODSP driver.\n\t */\n\tresolvedUrl: IResolvedUrl;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface IEntry {\n\t/**\n\t * Identifies type of entry for a given file.\n\t * Each file can have multiple types of entries associated with it.\n\t * For example, it can be snapshot, blob, ops, etc.\n\t */\n\ttype: CacheContentType;\n\n\t/**\n\t * Identifies individual entry for a given file and type.\n\t * Each file can have multiple cache entries associated with it.\n\t * This property identifies a particular instance of entry.\n\t * For example, for blobs it will be unique ID of the blob in a file.\n\t * For batch of ops, it can be starting op sequence number.\n\t * For types that have only one entry (like snapshots), it will be empty string.\n\t */\n\tkey: string;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface ICacheEntry extends IEntry {\n\t/**\n\t * Identifies file in storage this cached entry is for\n\t */\n\tfile: IFileEntry;\n}\n\n/**\n * Persistent cache. This interface can be implemented by the host to provide durable caching\n * across sessions. If not provided at driver factory construction, factory will use in-memory\n * cache implementation that does not survive across sessions. Snapshot entires stored in the\n * IPersistedCache will be considered stale and removed after 2 days. Read the README for more\n * information.\n * @alpha\n */\nexport interface IPersistedCache {\n\t/**\n\t * Get the cache value of the key\n\t * @param entry - cache entry, identifies file and particular key for this file.\n\t * @returns Cached value. undefined if nothing is cached.\n\t */\n\tget(entry: ICacheEntry): Promise<any>;\n\n\t/**\n\t * Put the value into cache.\n\t * Important - only serializable content is allowed since this cache may be persisted between sessions\n\t * @param entry - cache entry.\n\t * @param value - JSON-serializable content.\n\t */\n\tput(entry: ICacheEntry, value: any): Promise<void>;\n\n\t/**\n\t * Removes the entries from the cache for given parametres.\n\t * @param file - file entry to be deleted.\n\t */\n\tremoveEntries(file: IFileEntry): Promise<void>;\n}\n\n/**\n * Api to generate a cache key from cache entry.\n * @param entry - cache entry from which a cache key is generated\n * @returns The key for cache.\n * @internal\n */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
1
+ {"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;;;;GAOG;AACU,QAAA,sBAAsB,GAAe,SAAW,CAAC,CAAC,eAAe;AAE9E;;;GAGG;AACU,QAAA,WAAW,GAAG,UAAU,CAAC;AAEtC;;;GAGG;AACU,QAAA,6BAA6B,GAAG,4BAA4B,CAAC;AA+F1E;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAFD,kDAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type FiveDaysMs, IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.\n * That policy is the outward expression and this value is the implementation - using a larger value\n * would violate that statement of the driver's behavior.\n * Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.\n *\n * @internal\n */\nexport const maximumCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms\n\n/**\n * Describes what kind of content is stored in cache entry.\n * @internal\n */\nexport const snapshotKey = \"snapshot\";\n\n/**\n * Describes key for partial snapshot with loading GroupId in cache entry.\n * @internal\n */\nexport const snapshotWithLoadingGroupIdKey = \"snapshotWithLoadingGroupId\";\n\n/**\n * @alpha\n */\nexport type CacheContentType = \"snapshot\" | \"ops\" | \"snapshotWithLoadingGroupId\";\n\n/*\n * File / container identifier.\n * There is overlapping information here - host can use all of it or parts\n * to implement storage / identify files.\n */\n/**\n * @alpha\n */\nexport interface IFileEntry {\n\t/**\n\t * Unique and stable ID of the document.\n\t * Driver guarantees that docId is stable ID uniquely identifying document.\n\t */\n\tdocId: string;\n\t/**\n\t * Resolved URI is provided for additional versatility - host can use it to\n\t * identify file in storage, and (as example) delete all cached entries for\n\t * a file if user requests so.\n\t * This is IOdspResolvedUrl in case of ODSP driver.\n\t */\n\tresolvedUrl: IResolvedUrl;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface IEntry {\n\t/**\n\t * Identifies type of entry for a given file.\n\t * Each file can have multiple types of entries associated with it.\n\t * For example, it can be snapshot, blob, ops, etc.\n\t */\n\ttype: CacheContentType;\n\n\t/**\n\t * Identifies individual entry for a given file and type.\n\t * Each file can have multiple cache entries associated with it.\n\t * This property identifies a particular instance of entry.\n\t * For example, for blobs it will be unique ID of the blob in a file.\n\t * For batch of ops, it can be starting op sequence number.\n\t * For types that have only one entry (like snapshots), it will be empty string.\n\t */\n\tkey: string;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface ICacheEntry extends IEntry {\n\t/**\n\t * Identifies file in storage this cached entry is for\n\t */\n\tfile: IFileEntry;\n}\n\n/**\n * Persistent cache. This interface can be implemented by the host to provide durable caching\n * across sessions. If not provided at driver factory construction, factory will use in-memory\n * cache implementation that does not survive across sessions. Snapshot entires stored in the\n * IPersistedCache will be considered stale and removed after 2 days. Read the README for more\n * information.\n * @alpha\n */\nexport interface IPersistedCache {\n\t/**\n\t * Get the cache value of the key\n\t * @param entry - cache entry, identifies file and particular key for this file.\n\t * @returns Cached value. undefined if nothing is cached.\n\t */\n\tget(entry: ICacheEntry): Promise<any>;\n\n\t/**\n\t * Put the value into cache.\n\t * Important - only serializable content is allowed since this cache may be persisted between sessions\n\t * @param entry - cache entry.\n\t * @param value - JSON-serializable content.\n\t */\n\tput(entry: ICacheEntry, value: any): Promise<void>;\n\n\t/**\n\t * Removes the entries from the cache for given parametres.\n\t * @param file - file entry to be deleted.\n\t */\n\tremoveEntries(file: IFileEntry): Promise<void>;\n}\n\n/**\n * Api to generate a cache key from cache entry.\n * @param entry - cache entry from which a cache key is generated\n * @returns The key for cache.\n * @internal\n */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from "./errors.js";
6
6
  export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory.js";
7
- export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache.js";
7
+ export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, snapshotWithLoadingGroupIdKey, } from "./odspCache.js";
8
8
  export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl.js";
9
9
  export { IdentityType, InstrumentedStorageTokenFetcher, InstrumentedTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, authHeaderFromTokenResponse, tokenFromResponse, TokenResponse, } from "./tokenFetch.js";
10
10
  export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,6BAA6B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { OdspErrorTypes } from "./errors.js";
6
- export { maximumCacheDurationMs, getKeyForCacheEntry, snapshotKey, } from "./odspCache.js";
6
+ export { maximumCacheDurationMs, getKeyForCacheEntry, snapshotKey, snapshotWithLoadingGroupIdKey, } from "./odspCache.js";
7
7
  export { SharingLinkRole, SharingLinkScope, } from "./resolvedUrl.js";
8
8
  export { isTokenFromCache, authHeaderFromTokenResponse, tokenFromResponse, } from "./tokenFetch.js";
9
9
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAkD,cAAc,EAAE,MAAM,aAAa,CAAC;AAO7F,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EAKnB,WAAW,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAMN,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIN,gBAAgB,EAIhB,2BAA2B,EAC3B,iBAAiB,GAEjB,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from \"./errors.js\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory.js\";\nexport {\n\tCacheContentType,\n\tmaximumCacheDurationMs,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n} from \"./odspCache.js\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl.js\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tInstrumentedTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\tauthHeaderFromTokenResponse,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAkD,cAAc,EAAE,MAAM,aAAa,CAAC;AAO7F,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EAKnB,WAAW,EACX,6BAA6B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAMN,eAAe,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIN,gBAAgB,EAIhB,2BAA2B,EAC3B,iBAAiB,GAEjB,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from \"./errors.js\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory.js\";\nexport {\n\tCacheContentType,\n\tmaximumCacheDurationMs,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n\tsnapshotWithLoadingGroupIdKey,\n} from \"./odspCache.js\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl.js\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tInstrumentedTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\tauthHeaderFromTokenResponse,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
@@ -17,10 +17,15 @@ export declare const maximumCacheDurationMs: FiveDaysMs;
17
17
  * @internal
18
18
  */
19
19
  export declare const snapshotKey = "snapshot";
20
+ /**
21
+ * Describes key for partial snapshot with loading GroupId in cache entry.
22
+ * @internal
23
+ */
24
+ export declare const snapshotWithLoadingGroupIdKey = "snapshotWithLoadingGroupId";
20
25
  /**
21
26
  * @alpha
22
27
  */
23
- export type CacheContentType = "snapshot" | "ops";
28
+ export type CacheContentType = "snapshot" | "ops" | "snapshotWithLoadingGroupId";
24
29
  /**
25
30
  * @alpha
26
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAwB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
1
+ {"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,UAAwB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,GAAG,4BAA4B,CAAC;AAOjF;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
package/lib/odspCache.js CHANGED
@@ -16,6 +16,11 @@ export const maximumCacheDurationMs = 432000000; // 5 days in ms
16
16
  * @internal
17
17
  */
18
18
  export const snapshotKey = "snapshot";
19
+ /**
20
+ * Describes key for partial snapshot with loading GroupId in cache entry.
21
+ * @internal
22
+ */
23
+ export const snapshotWithLoadingGroupIdKey = "snapshotWithLoadingGroupId";
19
24
  /**
20
25
  * Api to generate a cache key from cache entry.
21
26
  * @param entry - cache entry from which a cache key is generated
@@ -1 +1 @@
1
- {"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAe,SAAW,CAAC,CAAC,eAAe;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AA8FtC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type FiveDaysMs, IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.\n * That policy is the outward expression and this value is the implementation - using a larger value\n * would violate that statement of the driver's behavior.\n * Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.\n *\n * @internal\n */\nexport const maximumCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms\n\n/**\n * Describes what kind of content is stored in cache entry.\n * @internal\n */\nexport const snapshotKey = \"snapshot\";\n/**\n * @alpha\n */\nexport type CacheContentType = \"snapshot\" | \"ops\";\n\n/*\n * File / container identifier.\n * There is overlapping information here - host can use all of it or parts\n * to implement storage / identify files.\n */\n/**\n * @alpha\n */\nexport interface IFileEntry {\n\t/**\n\t * Unique and stable ID of the document.\n\t * Driver guarantees that docId is stable ID uniquely identifying document.\n\t */\n\tdocId: string;\n\t/**\n\t * Resolved URI is provided for additional versatility - host can use it to\n\t * identify file in storage, and (as example) delete all cached entries for\n\t * a file if user requests so.\n\t * This is IOdspResolvedUrl in case of ODSP driver.\n\t */\n\tresolvedUrl: IResolvedUrl;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface IEntry {\n\t/**\n\t * Identifies type of entry for a given file.\n\t * Each file can have multiple types of entries associated with it.\n\t * For example, it can be snapshot, blob, ops, etc.\n\t */\n\ttype: CacheContentType;\n\n\t/**\n\t * Identifies individual entry for a given file and type.\n\t * Each file can have multiple cache entries associated with it.\n\t * This property identifies a particular instance of entry.\n\t * For example, for blobs it will be unique ID of the blob in a file.\n\t * For batch of ops, it can be starting op sequence number.\n\t * For types that have only one entry (like snapshots), it will be empty string.\n\t */\n\tkey: string;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface ICacheEntry extends IEntry {\n\t/**\n\t * Identifies file in storage this cached entry is for\n\t */\n\tfile: IFileEntry;\n}\n\n/**\n * Persistent cache. This interface can be implemented by the host to provide durable caching\n * across sessions. If not provided at driver factory construction, factory will use in-memory\n * cache implementation that does not survive across sessions. Snapshot entires stored in the\n * IPersistedCache will be considered stale and removed after 2 days. Read the README for more\n * information.\n * @alpha\n */\nexport interface IPersistedCache {\n\t/**\n\t * Get the cache value of the key\n\t * @param entry - cache entry, identifies file and particular key for this file.\n\t * @returns Cached value. undefined if nothing is cached.\n\t */\n\tget(entry: ICacheEntry): Promise<any>;\n\n\t/**\n\t * Put the value into cache.\n\t * Important - only serializable content is allowed since this cache may be persisted between sessions\n\t * @param entry - cache entry.\n\t * @param value - JSON-serializable content.\n\t */\n\tput(entry: ICacheEntry, value: any): Promise<void>;\n\n\t/**\n\t * Removes the entries from the cache for given parametres.\n\t * @param file - file entry to be deleted.\n\t */\n\tremoveEntries(file: IFileEntry): Promise<void>;\n}\n\n/**\n * Api to generate a cache key from cache entry.\n * @param entry - cache entry from which a cache key is generated\n * @returns The key for cache.\n * @internal\n */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
1
+ {"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAe,SAAW,CAAC,CAAC,eAAe;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AA+F1E;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type FiveDaysMs, IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.\n * That policy is the outward expression and this value is the implementation - using a larger value\n * would violate that statement of the driver's behavior.\n * Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.\n *\n * @internal\n */\nexport const maximumCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms\n\n/**\n * Describes what kind of content is stored in cache entry.\n * @internal\n */\nexport const snapshotKey = \"snapshot\";\n\n/**\n * Describes key for partial snapshot with loading GroupId in cache entry.\n * @internal\n */\nexport const snapshotWithLoadingGroupIdKey = \"snapshotWithLoadingGroupId\";\n\n/**\n * @alpha\n */\nexport type CacheContentType = \"snapshot\" | \"ops\" | \"snapshotWithLoadingGroupId\";\n\n/*\n * File / container identifier.\n * There is overlapping information here - host can use all of it or parts\n * to implement storage / identify files.\n */\n/**\n * @alpha\n */\nexport interface IFileEntry {\n\t/**\n\t * Unique and stable ID of the document.\n\t * Driver guarantees that docId is stable ID uniquely identifying document.\n\t */\n\tdocId: string;\n\t/**\n\t * Resolved URI is provided for additional versatility - host can use it to\n\t * identify file in storage, and (as example) delete all cached entries for\n\t * a file if user requests so.\n\t * This is IOdspResolvedUrl in case of ODSP driver.\n\t */\n\tresolvedUrl: IResolvedUrl;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface IEntry {\n\t/**\n\t * Identifies type of entry for a given file.\n\t * Each file can have multiple types of entries associated with it.\n\t * For example, it can be snapshot, blob, ops, etc.\n\t */\n\ttype: CacheContentType;\n\n\t/**\n\t * Identifies individual entry for a given file and type.\n\t * Each file can have multiple cache entries associated with it.\n\t * This property identifies a particular instance of entry.\n\t * For example, for blobs it will be unique ID of the blob in a file.\n\t * For batch of ops, it can be starting op sequence number.\n\t * For types that have only one entry (like snapshots), it will be empty string.\n\t */\n\tkey: string;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface ICacheEntry extends IEntry {\n\t/**\n\t * Identifies file in storage this cached entry is for\n\t */\n\tfile: IFileEntry;\n}\n\n/**\n * Persistent cache. This interface can be implemented by the host to provide durable caching\n * across sessions. If not provided at driver factory construction, factory will use in-memory\n * cache implementation that does not survive across sessions. Snapshot entires stored in the\n * IPersistedCache will be considered stale and removed after 2 days. Read the README for more\n * information.\n * @alpha\n */\nexport interface IPersistedCache {\n\t/**\n\t * Get the cache value of the key\n\t * @param entry - cache entry, identifies file and particular key for this file.\n\t * @returns Cached value. undefined if nothing is cached.\n\t */\n\tget(entry: ICacheEntry): Promise<any>;\n\n\t/**\n\t * Put the value into cache.\n\t * Important - only serializable content is allowed since this cache may be persisted between sessions\n\t * @param entry - cache entry.\n\t * @param value - JSON-serializable content.\n\t */\n\tput(entry: ICacheEntry, value: any): Promise<void>;\n\n\t/**\n\t * Removes the entries from the cache for given parametres.\n\t * @param file - file entry to be deleted.\n\t */\n\tremoveEntries(file: IFileEntry): Promise<void>;\n}\n\n/**\n * Api to generate a cache key from cache entry.\n * @param entry - cache entry from which a cache key is generated\n * @returns The key for cache.\n * @internal\n */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver-definitions",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Socket storage implementation for SPO and ODC",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,7 +57,7 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/driver-definitions": "~2.0.3"
60
+ "@fluidframework/driver-definitions": "~2.0.5"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@arethetypeswrong/cli": "^0.15.2",
@@ -77,7 +77,17 @@
77
77
  "typescript": "~5.4.5"
78
78
  },
79
79
  "typeValidation": {
80
- "broken": {}
80
+ "broken": {
81
+ "TypeAliasDeclaration_CacheContentType": {
82
+ "backCompat": false
83
+ },
84
+ "InterfaceDeclaration_ICacheEntry": {
85
+ "backCompat": false
86
+ },
87
+ "InterfaceDeclaration_IEntry": {
88
+ "backCompat": false
89
+ }
90
+ }
81
91
  },
82
92
  "scripts": {
83
93
  "api": "fluid-build . --task api",
package/src/index.ts CHANGED
@@ -19,6 +19,7 @@ export {
19
19
  IFileEntry,
20
20
  IPersistedCache,
21
21
  snapshotKey,
22
+ snapshotWithLoadingGroupIdKey,
22
23
  } from "./odspCache.js";
23
24
  export {
24
25
  IOdspResolvedUrl,
package/src/odspCache.ts CHANGED
@@ -20,10 +20,17 @@ export const maximumCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms
20
20
  * @internal
21
21
  */
22
22
  export const snapshotKey = "snapshot";
23
+
24
+ /**
25
+ * Describes key for partial snapshot with loading GroupId in cache entry.
26
+ * @internal
27
+ */
28
+ export const snapshotWithLoadingGroupIdKey = "snapshotWithLoadingGroupId";
29
+
23
30
  /**
24
31
  * @alpha
25
32
  */
26
- export type CacheContentType = "snapshot" | "ops";
33
+ export type CacheContentType = "snapshot" | "ops" | "snapshotWithLoadingGroupId";
27
34
 
28
35
  /*
29
36
  * File / container identifier.