@fluidframework/odsp-driver-definitions 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554
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/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/CHANGELOG.md +24 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor.json +1 -1
- package/api-report/odsp-driver-definitions.api.md +8 -24
- package/dist/errors.d.ts +1 -55
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -56
- package/dist/errors.js.map +1 -1
- package/dist/factory.d.ts +11 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/odsp-driver-definitions-alpha.d.ts +26 -74
- package/dist/odsp-driver-definitions-beta.d.ts +9 -5
- package/dist/odsp-driver-definitions-public.d.ts +5 -4
- package/dist/odsp-driver-definitions-untrimmed.d.ts +32 -72
- package/dist/odspCache.d.ts +10 -1
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js +10 -1
- package/dist/odspCache.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/resolvedUrl.d.ts +1 -16
- package/dist/resolvedUrl.d.ts.map +1 -1
- package/dist/resolvedUrl.js +1 -10
- package/dist/resolvedUrl.js.map +1 -1
- package/dist/sessionProvider.d.ts +6 -0
- package/dist/sessionProvider.d.ts.map +1 -1
- package/dist/sessionProvider.js.map +1 -1
- package/dist/tokenFetch.d.ts +4 -1
- package/dist/tokenFetch.d.ts.map +1 -1
- package/dist/tokenFetch.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{errors.d.mts → errors.d.ts} +6 -56
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +52 -0
- package/lib/errors.js.map +1 -0
- package/lib/{factory.d.mts → factory.d.ts} +12 -1
- package/lib/factory.d.ts.map +1 -0
- package/lib/{factory.mjs → factory.js} +1 -1
- package/lib/factory.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +7 -7
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/{odsp-driver-definitions-alpha.d.mts → odsp-driver-definitions-alpha.d.ts} +26 -74
- package/lib/{odsp-driver-definitions-beta.d.mts → odsp-driver-definitions-beta.d.ts} +9 -5
- package/lib/{odsp-driver-definitions-public.d.mts → odsp-driver-definitions-public.d.ts} +5 -4
- package/lib/{odsp-driver-definitions-untrimmed.d.mts → odsp-driver-definitions-untrimmed.d.ts} +32 -72
- package/lib/{odspCache.d.mts → odspCache.d.ts} +11 -2
- package/lib/odspCache.d.ts.map +1 -0
- package/lib/{odspCache.mjs → odspCache.js} +10 -1
- package/lib/odspCache.js.map +1 -0
- package/lib/{resolvedUrl.d.mts → resolvedUrl.d.ts} +2 -17
- package/lib/resolvedUrl.d.ts.map +1 -0
- package/lib/{resolvedUrl.mjs → resolvedUrl.js} +1 -10
- package/lib/resolvedUrl.js.map +1 -0
- package/lib/{sessionProvider.d.mts → sessionProvider.d.ts} +7 -1
- package/lib/sessionProvider.d.ts.map +1 -0
- package/lib/{sessionProvider.mjs → sessionProvider.js} +1 -1
- package/lib/sessionProvider.js.map +1 -0
- package/lib/{tokenFetch.d.mts → tokenFetch.d.ts} +5 -2
- package/lib/tokenFetch.d.ts.map +1 -0
- package/lib/{tokenFetch.mjs → tokenFetch.js} +1 -1
- package/lib/tokenFetch.js.map +1 -0
- package/package.json +42 -32
- package/src/errors.ts +1 -64
- package/src/factory.ts +10 -2
- package/src/index.ts +7 -13
- package/src/odspCache.ts +11 -1
- package/src/resolvedUrl.ts +1 -18
- package/src/sessionProvider.ts +7 -0
- package/src/tokenFetch.ts +4 -1
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/errors.d.mts.map +0 -1
- package/lib/errors.mjs +0 -103
- package/lib/errors.mjs.map +0 -1
- package/lib/factory.d.mts.map +0 -1
- package/lib/factory.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -9
- package/lib/index.mjs.map +0 -1
- package/lib/odspCache.d.mts.map +0 -1
- package/lib/odspCache.mjs.map +0 -1
- package/lib/resolvedUrl.d.mts.map +0 -1
- package/lib/resolvedUrl.mjs.map +0 -1
- package/lib/sessionProvider.d.mts.map +0 -1
- package/lib/sessionProvider.mjs.map +0 -1
- package/lib/tokenFetch.d.mts.map +0 -1
- package/lib/tokenFetch.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,gBAAgB,GAChB,MAAM,oCAAoC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,gBAAgB;IAEnB;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;OAIG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;;;;;OAMG;IACH,aAAa,EAAE,eAAe;IAE9B;;;OAGG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;CAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n * @alpha\n */\nexport const OdspErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError: \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig: \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout: \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled: \"fluidNotEnabled\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp: \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly: \"serviceReadOnly\",\n\n\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress: \"blockedIPAddress\",\n} as const;\n/**\n * @alpha\n */\nexport type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];\n\n/**\n * @alpha\n */\nexport interface IOdspErrorAugmentations {\n\t/**\n\t * Server epoch indicates when the file was last modified.\n\t * Used to detect modifications outside Fluid's services\n\t */\n\tserverEpoch?: string;\n\n\t/**\n\t * It is the redirection url at which the network call should have been made. It is due to change\n\t * in site domain of the file on server.\n\t */\n\tredirectLocation?: string;\n\n\t/**\n\t * It is array of error codes included in error response from server.\n\t */\n\tfacetCodes?: string[];\n}\n\n/**\n * Base interface for all errors and warnings\n * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties\n * @alpha\n */\nexport interface IOdspError extends Omit<IDriverErrorBase, \"errorType\">, IOdspErrorAugmentations {\n\treadonly errorType: OdspErrorTypes;\n}\n\n/**\n * @alpha\n */\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
|
|
@@ -9,6 +9,13 @@ export interface ISnapshotOptions {
|
|
|
9
9
|
blobs?: number;
|
|
10
10
|
deltas?: number;
|
|
11
11
|
channels?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum Data size (in bytes)
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
|
|
17
|
+
* if snapshot is bigger in size than specified limit.
|
|
18
|
+
*/
|
|
12
19
|
mds?: number;
|
|
13
20
|
timeout?: number;
|
|
14
21
|
}
|
|
@@ -130,5 +137,9 @@ export interface HostStoragePolicy {
|
|
|
130
137
|
* as false. This is if the host wants to do some A/B testing.
|
|
131
138
|
*/
|
|
132
139
|
avoidPrefetchSnapshotCache?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* True if host does not want the storage service to perform retries when throttling errors occur in the service.
|
|
142
|
+
*/
|
|
143
|
+
disableRetriesOnStorageThrottlingError?: boolean;
|
|
133
144
|
}
|
|
134
|
-
//# sourceMappingURL=factory.d.
|
|
145
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAOb,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC;;;;;;;;;OASG;IACH,sCAAsC,CAAC,EAAE,OAAO,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAGlC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B;;OAEG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;;;OAOG;IACH,yCAAyC,CAAC,EAAE,OAAO,CAAC;IAEpD;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;OAEG;IACH,sCAAsC,CAAC,EAAE,OAAO,CAAC;CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @alpha\n */\nexport interface ISnapshotOptions {\n\tblobs?: number;\n\tdeltas?: number;\n\tchannels?: number;\n\n\t/**\n\t * Maximum Data size (in bytes)\n\t *\n\t * @remarks\n\t * If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})\n\t * if snapshot is bigger in size than specified limit.\n\t */\n\tmds?: number;\n\n\t/*\n\t * Maximum time limit to fetch snapshot (in seconds)\n\t * If specified, client will timeout the fetch request if it exceeds the time limit and\n\t * will try to fetch the snapshot without blobs.\n\t */\n\ttimeout?: number;\n}\n\n/**\n * @alpha\n */\nexport interface IOpsCachingPolicy {\n\t/**\n\t * Batch size. Controls how many ops are grouped together as single cache entry\n\t * The bigger the number, the more efficient it is (less reads & writes)\n\t * At the same time, big number means we wait for so many ops to accumulate, which\n\t * increases chances and number of trailing ops that would not be flushed to cache\n\t * when user closes tab\n\t * Use any number below 1 to disable caching\n\t * Default: 100\n\t */\n\tbatchSize?: number;\n\n\t/**\n\t * To reduce the problem of losing trailing ops when using big batch sizes, host\n\t * could specify how often driver should flush ops it has not flushed yet.\n\t * -1 means do not use timer.\n\t * Measured in ms.\n\t * Default: 5000\n\t */\n\ttimerGranularity?: number;\n\n\t/**\n\t * Total number of ops to cache. When we reach that number, ops caching stops\n\t * Default: 5000\n\t */\n\ttotalOpsToCache?: number;\n}\n\n/**\n * @alpha\n */\nexport interface ICollabSessionOptions {\n\t/**\n\t * Value indicating the display name for session that admits unauthenticated user.\n\t * This name will be used in attribution associated with edits made by such user.\n\t */\n\tunauthenticatedUserDisplayName?: string;\n\t/**\n\t * @deprecated Due to security reasons we will be passing the token via Authorization header only.\n\t * Value indicating session preference to always pass access token via Authorization header.\n\t * Default behavior is to pass access token via query parameter unless overall href string\n\t * length exceeds 2048 characters. Using query param is performance optimization which results\n\t * in ODSP XHR request being treated as 'simple' request which do not require OPTIONS call to\n\t * validate CORS. However, not all ODSP implementations understand this optimization.\n\t * For instance, auth layer on Converged stack will fail request with access token passed via\n\t * query param.\n\t */\n\tforceAccessTokenViaAuthorizationHeader?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface HostStoragePolicy {\n\tsnapshotOptions?: ISnapshotOptions;\n\n\t/**\n\t * If set to true, tells driver to concurrently fetch snapshot from storage (SPO) and cache\n\t * Container loads from whatever comes first in such case.\n\t * Snapshot fetched from storage is pushed to cache in either case.\n\t * If set to false, driver will first consult with cache. Only on cache miss (cache does not\n\t * return snapshot), driver will fetch snapshot from storage (and push it to cache), otherwise\n\t * it will load from cache and not reach out to storage.\n\t * Passing true results in faster loads and keeping cache more current, but it increases bandwidth consumption.\n\t */\n\tconcurrentSnapshotFetch?: boolean;\n\n\t// Options overwriting default ops fetching from storage.\n\topsBatchSize?: number;\n\tconcurrentOpsBatches?: number;\n\n\t/**\n\t * Policy controlling ops caching (leveraging IPersistedCache passed to driver factory)\n\t */\n\topsCaching?: IOpsCachingPolicy;\n\n\t/**\n\t * Policy controlling how collaboration session is established\n\t */\n\tsessionOptions?: ICollabSessionOptions;\n\n\t/**\n\t * @deprecated This field will be always set to true after removal.\n\t * True to have the sharing link redeem fallback in case the Trees Latest/Redeem 1RT call fails with redeem error.\n\t * During fallback it will first redeem the sharing link and then make the Trees latest call.\n\t */\n\tenableRedeemFallback?: boolean;\n\n\t/**\n\t * Policy controlling if we will cache initial summary when we create a document\n\t */\n\tcacheCreateNewSummary?: boolean;\n\n\t/**\n\t * @deprecated This will be replaced with feature gate snapshotFormatFetchType.\n\t * Policy controlling if we want to fetch binary format snapshot.\n\t */\n\tfetchBinarySnapshotFormat?: boolean;\n\n\t/**\n\t * If set to true, socket cache are per OdspDocumentService instead of shared across all instances\n\t */\n\tisolateSocketCache?: boolean;\n\n\t/**\n\t * @deprecated Switch to using the new feature gated by enableSingleRequestForShareLinkWithCreate\n\t * with 'createLinkScope' and 'createLinkRole' is requested to the odsp apis instead of 'createLinkType'.\n\t * It enables the creation of sharing link along with the creation of file by setting this value to true.\n\t * If the host provides a 'createLinkType' parameter in the request URL to the container.attach()\n\t * method, we will send the request to ODSP with the same (if the flag is enabled) so\n\t * that a share link can be created with the creation of file to save number for round trips made to ODSP.\n\t * (This flag works independently of enableSingleRequestForShareLinkWithCreate which is used for sharing link\n\t * requests where 'createLinkScope' is requested.)\n\t */\n\tenableShareLinkWithCreate?: boolean;\n\n\t/**\n\t * Enable creation of sharing link along with the creation of file by setting this value to true.\n\t * If the host provides a 'createLinkScope' parameter in the request URL to the container.attach()\n\t * method, we will send the request to ODSP with the same (if the flag is enabled) so\n\t * that a share link can be created with the creation of file to save number for round trips made to ODSP.\n\t * (This flag works independently of enableShareLinkWithCreate which was used for old sharing link requests\n\t * where 'createLinkType' was requested.)\n\t */\n\tenableSingleRequestForShareLinkWithCreate?: boolean;\n\n\t/**\n\t * True if host does not want the storage service to use the prefetch cache to get the snapshot. Undefined will be treated\n\t * as false. This is if the host wants to do some A/B testing.\n\t */\n\tavoidPrefetchSnapshotCache?: boolean;\n\n\t/**\n\t * True if host does not want the storage service to perform retries when throttling errors occur in the service.\n\t */\n\tdisableRetriesOnStorageThrottlingError?: boolean;\n}\n"]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { IOdspError, IOdspErrorAugmentations, OdspError,
|
|
6
|
-
export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory.
|
|
7
|
-
export { CacheContentType, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache.
|
|
8
|
-
export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType,
|
|
9
|
-
export { IdentityType, InstrumentedStorageTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, tokenFromResponse, TokenResponse, } from "./tokenFetch.
|
|
10
|
-
export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider.
|
|
11
|
-
//# sourceMappingURL=index.d.
|
|
5
|
+
export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from "./errors.js";
|
|
6
|
+
export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory.js";
|
|
7
|
+
export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache.js";
|
|
8
|
+
export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl.js";
|
|
9
|
+
export { IdentityType, InstrumentedStorageTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, tokenFromResponse, TokenResponse, } from "./tokenFetch.js";
|
|
10
|
+
export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,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
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { OdspErrorTypes } from "./errors.js";
|
|
6
|
+
export { maximumCacheDurationMs, getKeyForCacheEntry, snapshotKey, } from "./odspCache.js";
|
|
7
|
+
export { SharingLinkRole, SharingLinkScope, } from "./resolvedUrl.js";
|
|
8
|
+
export { isTokenFromCache, tokenFromResponse, } from "./tokenFetch.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +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,EAGN,gBAAgB,EAIhB,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\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DriverError } from '@fluidframework/driver-definitions';
|
|
2
|
+
import { FiveDaysMs } from '@fluidframework/driver-definitions';
|
|
2
3
|
import { IDriverErrorBase } from '@fluidframework/driver-definitions';
|
|
3
4
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
4
5
|
|
|
@@ -78,6 +79,10 @@ export declare interface HostStoragePolicy {
|
|
|
78
79
|
* as false. This is if the host wants to do some A/B testing.
|
|
79
80
|
*/
|
|
80
81
|
avoidPrefetchSnapshotCache?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* True if host does not want the storage service to perform retries when throttling errors occur in the service.
|
|
84
|
+
*/
|
|
85
|
+
disableRetriesOnStorageThrottlingError?: boolean;
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
/**
|
|
@@ -169,7 +174,7 @@ export declare interface IFileEntry {
|
|
|
169
174
|
* @alpha
|
|
170
175
|
*/
|
|
171
176
|
export declare interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
172
|
-
readonly errorType:
|
|
177
|
+
readonly errorType: OdspErrorTypes;
|
|
173
178
|
}
|
|
174
179
|
|
|
175
180
|
/**
|
|
@@ -333,6 +338,13 @@ export declare interface ISnapshotOptions {
|
|
|
333
338
|
blobs?: number;
|
|
334
339
|
deltas?: number;
|
|
335
340
|
channels?: number;
|
|
341
|
+
/**
|
|
342
|
+
* Maximum Data size (in bytes)
|
|
343
|
+
*
|
|
344
|
+
* @remarks
|
|
345
|
+
* If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
|
|
346
|
+
* if snapshot is bigger in size than specified limit.
|
|
347
|
+
*/
|
|
336
348
|
mds?: number;
|
|
337
349
|
timeout?: number;
|
|
338
350
|
}
|
|
@@ -362,69 +374,22 @@ export declare interface ISocketStorageDiscovery {
|
|
|
362
374
|
* This is the time within which client has to refresh the session on (ODSP) relay service.
|
|
363
375
|
*/
|
|
364
376
|
refreshSessionDurationSeconds?: number;
|
|
377
|
+
/**
|
|
378
|
+
* Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
|
|
379
|
+
* response will contain empty labels when the file has no labels, so this field will be there
|
|
380
|
+
* even if file has no labels when the service will implement this contract.
|
|
381
|
+
*/
|
|
382
|
+
sensitivityLabelsInfo?: string;
|
|
365
383
|
}
|
|
366
384
|
|
|
367
385
|
/* Excluded from this release type: isTokenFromCache */
|
|
368
386
|
|
|
369
|
-
|
|
370
|
-
* @alpha
|
|
371
|
-
*/
|
|
372
|
-
export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
387
|
+
/* Excluded from this release type: maximumCacheDurationMs */
|
|
373
388
|
|
|
374
389
|
/**
|
|
375
|
-
* ODSP Error types.
|
|
376
|
-
* Different error types that may be thrown by the ODSP driver.
|
|
377
|
-
*
|
|
378
|
-
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
379
390
|
* @alpha
|
|
380
391
|
*/
|
|
381
|
-
export declare
|
|
382
|
-
/**
|
|
383
|
-
* Storage is out of space
|
|
384
|
-
*/
|
|
385
|
-
outOfStorageError = "outOfStorageError",
|
|
386
|
-
/**
|
|
387
|
-
* Invalid file name (at creation of the file)
|
|
388
|
-
*/
|
|
389
|
-
invalidFileNameError = "invalidFileNameError",
|
|
390
|
-
/**
|
|
391
|
-
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
392
|
-
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
393
|
-
* such case.
|
|
394
|
-
*/
|
|
395
|
-
snapshotTooBig = "snapshotTooBig",
|
|
396
|
-
/**
|
|
397
|
-
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
398
|
-
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
399
|
-
* such case.
|
|
400
|
-
*/
|
|
401
|
-
fetchTimeout = "fetchTimeout",
|
|
402
|
-
/**
|
|
403
|
-
* SPO admin toggle: fluid service is not enabled.
|
|
404
|
-
*/
|
|
405
|
-
fluidNotEnabled = "fluidNotEnabled",
|
|
406
|
-
/**
|
|
407
|
-
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
408
|
-
*/
|
|
409
|
-
fetchTokenError = "fetchTokenError",
|
|
410
|
-
/**
|
|
411
|
-
* This error will be raised when client is too behind with no way to catch up.
|
|
412
|
-
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
413
|
-
* by storage, and thus removing an ability for client to catch up.
|
|
414
|
-
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
415
|
-
* copying it over manually)
|
|
416
|
-
*/
|
|
417
|
-
cannotCatchUp = "cannotCatchUp",
|
|
418
|
-
/**
|
|
419
|
-
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
420
|
-
* So to preserve integrity of the data, the data becomes readonly.
|
|
421
|
-
*/
|
|
422
|
-
serviceReadOnly = "serviceReadOnly",
|
|
423
|
-
/**
|
|
424
|
-
* Due to organizational policies, you can't access server resources from the current network location.
|
|
425
|
-
*/
|
|
426
|
-
blockedIPAddress = "blockedIPAddress"
|
|
427
|
-
}
|
|
392
|
+
export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
428
393
|
|
|
429
394
|
/**
|
|
430
395
|
* ODSP Error types.
|
|
@@ -522,17 +487,10 @@ export declare interface ShareLinkInfoType {
|
|
|
522
487
|
* from the /snapshot api response.
|
|
523
488
|
*/
|
|
524
489
|
createLink?: {
|
|
525
|
-
/**
|
|
526
|
-
* @deprecated
|
|
527
|
-
* Type of shareLink requested/created when creating the file for the first time. The 'type' property here
|
|
528
|
-
* represents the type of sharing link requested.
|
|
529
|
-
* Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
|
|
530
|
-
*/
|
|
531
|
-
type?: ShareLinkTypes | ISharingLinkKind;
|
|
532
490
|
/**
|
|
533
491
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
534
492
|
*/
|
|
535
|
-
link?:
|
|
493
|
+
link?: ISharingLink;
|
|
536
494
|
/**
|
|
537
495
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
538
496
|
*/
|
|
@@ -546,15 +504,6 @@ export declare interface ShareLinkInfoType {
|
|
|
546
504
|
sharingLinkToRedeem?: string;
|
|
547
505
|
}
|
|
548
506
|
|
|
549
|
-
/**
|
|
550
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
551
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
552
|
-
* @alpha
|
|
553
|
-
*/
|
|
554
|
-
export declare enum ShareLinkTypes {
|
|
555
|
-
csl = "csl"
|
|
556
|
-
}
|
|
557
|
-
|
|
558
507
|
/**
|
|
559
508
|
* View/edit permission role for a sharing link.
|
|
560
509
|
* @alpha
|
|
@@ -619,7 +568,10 @@ export declare interface TokenFetchOptions {
|
|
|
619
568
|
export declare interface TokenResponse {
|
|
620
569
|
/** Token value */
|
|
621
570
|
token: string;
|
|
622
|
-
/**
|
|
571
|
+
/**
|
|
572
|
+
* Whether or not the token was obtained from local cache.
|
|
573
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
574
|
+
*/
|
|
623
575
|
fromCache?: boolean;
|
|
624
576
|
}
|
|
625
577
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DriverError } from '@fluidframework/driver-definitions';
|
|
2
|
+
import { FiveDaysMs } from '@fluidframework/driver-definitions';
|
|
2
3
|
import { IDriverErrorBase } from '@fluidframework/driver-definitions';
|
|
3
4
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
4
5
|
|
|
@@ -6,6 +7,8 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
6
7
|
|
|
7
8
|
/* Excluded from this release type: DriverError */
|
|
8
9
|
|
|
10
|
+
/* Excluded from this release type: FiveDaysMs */
|
|
11
|
+
|
|
9
12
|
/* Excluded from this release type: getKeyForCacheEntry */
|
|
10
13
|
|
|
11
14
|
/* Excluded from this release type: HostStoragePolicy */
|
|
@@ -50,9 +53,9 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
50
53
|
|
|
51
54
|
/* Excluded from this release type: isTokenFromCache */
|
|
52
55
|
|
|
53
|
-
/* Excluded from this release type:
|
|
56
|
+
/* Excluded from this release type: maximumCacheDurationMs */
|
|
54
57
|
|
|
55
|
-
/* Excluded from this release type:
|
|
58
|
+
/* Excluded from this release type: OdspError */
|
|
56
59
|
|
|
57
60
|
/* Excluded from this release type: OdspErrorTypes */
|
|
58
61
|
|
|
@@ -60,8 +63,6 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
60
63
|
|
|
61
64
|
/* Excluded from this release type: ShareLinkInfoType */
|
|
62
65
|
|
|
63
|
-
/* Excluded from this release type: ShareLinkTypes */
|
|
64
|
-
|
|
65
66
|
/* Excluded from this release type: SharingLinkRole */
|
|
66
67
|
|
|
67
68
|
/* Excluded from this release type: SharingLinkScope */
|
|
@@ -81,7 +82,10 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
81
82
|
export declare interface TokenResponse {
|
|
82
83
|
/** Token value */
|
|
83
84
|
token: string;
|
|
84
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Whether or not the token was obtained from local cache.
|
|
87
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
88
|
+
*/
|
|
85
89
|
fromCache?: boolean;
|
|
86
90
|
}
|
|
87
91
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DriverError } from '@fluidframework/driver-definitions';
|
|
2
|
+
import { FiveDaysMs } from '@fluidframework/driver-definitions';
|
|
2
3
|
import { IDriverErrorBase } from '@fluidframework/driver-definitions';
|
|
3
4
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
4
5
|
|
|
@@ -6,6 +7,8 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
6
7
|
|
|
7
8
|
/* Excluded from this release type: DriverError */
|
|
8
9
|
|
|
10
|
+
/* Excluded from this release type: FiveDaysMs */
|
|
11
|
+
|
|
9
12
|
/* Excluded from this release type: getKeyForCacheEntry */
|
|
10
13
|
|
|
11
14
|
/* Excluded from this release type: HostStoragePolicy */
|
|
@@ -50,9 +53,9 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
50
53
|
|
|
51
54
|
/* Excluded from this release type: isTokenFromCache */
|
|
52
55
|
|
|
53
|
-
/* Excluded from this release type:
|
|
56
|
+
/* Excluded from this release type: maximumCacheDurationMs */
|
|
54
57
|
|
|
55
|
-
/* Excluded from this release type:
|
|
58
|
+
/* Excluded from this release type: OdspError */
|
|
56
59
|
|
|
57
60
|
/* Excluded from this release type: OdspErrorTypes */
|
|
58
61
|
|
|
@@ -60,8 +63,6 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
60
63
|
|
|
61
64
|
/* Excluded from this release type: ShareLinkInfoType */
|
|
62
65
|
|
|
63
|
-
/* Excluded from this release type: ShareLinkTypes */
|
|
64
|
-
|
|
65
66
|
/* Excluded from this release type: SharingLinkRole */
|
|
66
67
|
|
|
67
68
|
/* Excluded from this release type: SharingLinkScope */
|
package/lib/{odsp-driver-definitions-untrimmed.d.mts → odsp-driver-definitions-untrimmed.d.ts}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DriverError } from '@fluidframework/driver-definitions';
|
|
2
|
+
import { FiveDaysMs } from '@fluidframework/driver-definitions';
|
|
2
3
|
import { IDriverErrorBase } from '@fluidframework/driver-definitions';
|
|
3
4
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
4
5
|
|
|
@@ -84,6 +85,10 @@ export declare interface HostStoragePolicy {
|
|
|
84
85
|
* as false. This is if the host wants to do some A/B testing.
|
|
85
86
|
*/
|
|
86
87
|
avoidPrefetchSnapshotCache?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* True if host does not want the storage service to perform retries when throttling errors occur in the service.
|
|
90
|
+
*/
|
|
91
|
+
disableRetriesOnStorageThrottlingError?: boolean;
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
/**
|
|
@@ -178,7 +183,7 @@ export declare type InstrumentedStorageTokenFetcher = (options: TokenFetchOption
|
|
|
178
183
|
* @alpha
|
|
179
184
|
*/
|
|
180
185
|
export declare interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
181
|
-
readonly errorType:
|
|
186
|
+
readonly errorType: OdspErrorTypes;
|
|
182
187
|
}
|
|
183
188
|
|
|
184
189
|
/**
|
|
@@ -342,6 +347,13 @@ export declare interface ISnapshotOptions {
|
|
|
342
347
|
blobs?: number;
|
|
343
348
|
deltas?: number;
|
|
344
349
|
channels?: number;
|
|
350
|
+
/**
|
|
351
|
+
* Maximum Data size (in bytes)
|
|
352
|
+
*
|
|
353
|
+
* @remarks
|
|
354
|
+
* If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
|
|
355
|
+
* if snapshot is bigger in size than specified limit.
|
|
356
|
+
*/
|
|
345
357
|
mds?: number;
|
|
346
358
|
timeout?: number;
|
|
347
359
|
}
|
|
@@ -371,6 +383,12 @@ export declare interface ISocketStorageDiscovery {
|
|
|
371
383
|
* This is the time within which client has to refresh the session on (ODSP) relay service.
|
|
372
384
|
*/
|
|
373
385
|
refreshSessionDurationSeconds?: number;
|
|
386
|
+
/**
|
|
387
|
+
* Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
|
|
388
|
+
* response will contain empty labels when the file has no labels, so this field will be there
|
|
389
|
+
* even if file has no labels when the service will implement this contract.
|
|
390
|
+
*/
|
|
391
|
+
sensitivityLabelsInfo?: string;
|
|
374
392
|
}
|
|
375
393
|
|
|
376
394
|
/**
|
|
@@ -383,64 +401,19 @@ export declare interface ISocketStorageDiscovery {
|
|
|
383
401
|
export declare const isTokenFromCache: (tokenResponse: string | TokenResponse | null) => boolean | undefined;
|
|
384
402
|
|
|
385
403
|
/**
|
|
386
|
-
*
|
|
404
|
+
* Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
|
|
405
|
+
* That policy is the outward expression and this value is the implementation - using a larger value
|
|
406
|
+
* would violate that statement of the driver's behavior.
|
|
407
|
+
* Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.
|
|
408
|
+
*
|
|
409
|
+
* @internal
|
|
387
410
|
*/
|
|
388
|
-
export declare
|
|
411
|
+
export declare const maximumCacheDurationMs: FiveDaysMs;
|
|
389
412
|
|
|
390
413
|
/**
|
|
391
|
-
* ODSP Error types.
|
|
392
|
-
* Different error types that may be thrown by the ODSP driver.
|
|
393
|
-
*
|
|
394
|
-
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
395
414
|
* @alpha
|
|
396
415
|
*/
|
|
397
|
-
export declare
|
|
398
|
-
/**
|
|
399
|
-
* Storage is out of space
|
|
400
|
-
*/
|
|
401
|
-
outOfStorageError = "outOfStorageError",
|
|
402
|
-
/**
|
|
403
|
-
* Invalid file name (at creation of the file)
|
|
404
|
-
*/
|
|
405
|
-
invalidFileNameError = "invalidFileNameError",
|
|
406
|
-
/**
|
|
407
|
-
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
408
|
-
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
409
|
-
* such case.
|
|
410
|
-
*/
|
|
411
|
-
snapshotTooBig = "snapshotTooBig",
|
|
412
|
-
/**
|
|
413
|
-
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
414
|
-
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
415
|
-
* such case.
|
|
416
|
-
*/
|
|
417
|
-
fetchTimeout = "fetchTimeout",
|
|
418
|
-
/**
|
|
419
|
-
* SPO admin toggle: fluid service is not enabled.
|
|
420
|
-
*/
|
|
421
|
-
fluidNotEnabled = "fluidNotEnabled",
|
|
422
|
-
/**
|
|
423
|
-
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
424
|
-
*/
|
|
425
|
-
fetchTokenError = "fetchTokenError",
|
|
426
|
-
/**
|
|
427
|
-
* This error will be raised when client is too behind with no way to catch up.
|
|
428
|
-
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
429
|
-
* by storage, and thus removing an ability for client to catch up.
|
|
430
|
-
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
431
|
-
* copying it over manually)
|
|
432
|
-
*/
|
|
433
|
-
cannotCatchUp = "cannotCatchUp",
|
|
434
|
-
/**
|
|
435
|
-
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
436
|
-
* So to preserve integrity of the data, the data becomes readonly.
|
|
437
|
-
*/
|
|
438
|
-
serviceReadOnly = "serviceReadOnly",
|
|
439
|
-
/**
|
|
440
|
-
* Due to organizational policies, you can't access server resources from the current network location.
|
|
441
|
-
*/
|
|
442
|
-
blockedIPAddress = "blockedIPAddress"
|
|
443
|
-
}
|
|
416
|
+
export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
444
417
|
|
|
445
418
|
/**
|
|
446
419
|
* ODSP Error types.
|
|
@@ -538,17 +511,10 @@ export declare interface ShareLinkInfoType {
|
|
|
538
511
|
* from the /snapshot api response.
|
|
539
512
|
*/
|
|
540
513
|
createLink?: {
|
|
541
|
-
/**
|
|
542
|
-
* @deprecated
|
|
543
|
-
* Type of shareLink requested/created when creating the file for the first time. The 'type' property here
|
|
544
|
-
* represents the type of sharing link requested.
|
|
545
|
-
* Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
|
|
546
|
-
*/
|
|
547
|
-
type?: ShareLinkTypes | ISharingLinkKind;
|
|
548
514
|
/**
|
|
549
515
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
550
516
|
*/
|
|
551
|
-
link?:
|
|
517
|
+
link?: ISharingLink;
|
|
552
518
|
/**
|
|
553
519
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
554
520
|
*/
|
|
@@ -562,15 +528,6 @@ export declare interface ShareLinkInfoType {
|
|
|
562
528
|
sharingLinkToRedeem?: string;
|
|
563
529
|
}
|
|
564
530
|
|
|
565
|
-
/**
|
|
566
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
567
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
568
|
-
* @alpha
|
|
569
|
-
*/
|
|
570
|
-
export declare enum ShareLinkTypes {
|
|
571
|
-
csl = "csl"
|
|
572
|
-
}
|
|
573
|
-
|
|
574
531
|
/**
|
|
575
532
|
* View/edit permission role for a sharing link.
|
|
576
533
|
* @alpha
|
|
@@ -645,7 +602,10 @@ export declare const tokenFromResponse: (tokenResponse: string | TokenResponse |
|
|
|
645
602
|
export declare interface TokenResponse {
|
|
646
603
|
/** Token value */
|
|
647
604
|
token: string;
|
|
648
|
-
/**
|
|
605
|
+
/**
|
|
606
|
+
* Whether or not the token was obtained from local cache.
|
|
607
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
608
|
+
*/
|
|
649
609
|
fromCache?: boolean;
|
|
650
610
|
}
|
|
651
611
|
|
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
5
|
+
import { IResolvedUrl, type FiveDaysMs } from "@fluidframework/driver-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
|
|
8
|
+
* That policy is the outward expression and this value is the implementation - using a larger value
|
|
9
|
+
* would violate that statement of the driver's behavior.
|
|
10
|
+
* Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const maximumCacheDurationMs: FiveDaysMs;
|
|
6
15
|
/**
|
|
7
16
|
* Describes what kind of content is stored in cache entry.
|
|
8
17
|
* @internal
|
|
@@ -95,4 +104,4 @@ export interface IPersistedCache {
|
|
|
95
104
|
* @internal
|
|
96
105
|
*/
|
|
97
106
|
export declare function getKeyForCacheEntry(entry: ICacheEntry): string;
|
|
98
|
-
//# sourceMappingURL=odspCache.d.
|
|
107
|
+
//# sourceMappingURL=odspCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;;;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"}
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
|
|
7
|
+
* That policy is the outward expression and this value is the implementation - using a larger value
|
|
8
|
+
* would violate that statement of the driver's behavior.
|
|
9
|
+
* Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export const maximumCacheDurationMs = 432000000; // 5 days in ms
|
|
5
14
|
/**
|
|
6
15
|
* Describes what kind of content is stored in cache entry.
|
|
7
16
|
* @internal
|
|
@@ -16,4 +25,4 @@ export const snapshotKey = "snapshot";
|
|
|
16
25
|
export function getKeyForCacheEntry(entry) {
|
|
17
26
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
|
18
27
|
}
|
|
19
|
-
//# sourceMappingURL=odspCache.
|
|
28
|
+
//# sourceMappingURL=odspCache.js.map
|
|
@@ -0,0 +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 { IResolvedUrl, type FiveDaysMs } from \"@fluidframework/driver-definitions\";\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"]}
|
|
@@ -11,14 +11,6 @@ export interface IOdspUrlParts {
|
|
|
11
11
|
driveId: string;
|
|
12
12
|
itemId: string;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
16
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
17
|
-
* @alpha
|
|
18
|
-
*/
|
|
19
|
-
export declare enum ShareLinkTypes {
|
|
20
|
-
csl = "csl"
|
|
21
|
-
}
|
|
22
14
|
/**
|
|
23
15
|
* Sharing scope of the share links created for a file.
|
|
24
16
|
* @alpha
|
|
@@ -68,17 +60,10 @@ export interface ShareLinkInfoType {
|
|
|
68
60
|
* from the /snapshot api response.
|
|
69
61
|
*/
|
|
70
62
|
createLink?: {
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated
|
|
73
|
-
* Type of shareLink requested/created when creating the file for the first time. The 'type' property here
|
|
74
|
-
* represents the type of sharing link requested.
|
|
75
|
-
* Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
|
|
76
|
-
*/
|
|
77
|
-
type?: ShareLinkTypes | ISharingLinkKind;
|
|
78
63
|
/**
|
|
79
64
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
80
65
|
*/
|
|
81
|
-
link?:
|
|
66
|
+
link?: ISharingLink;
|
|
82
67
|
/**
|
|
83
68
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
84
69
|
*/
|
|
@@ -121,4 +106,4 @@ export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
|
121
106
|
shareLinkInfo?: ShareLinkInfoType;
|
|
122
107
|
isClpCompliantApp?: boolean;
|
|
123
108
|
}
|
|
124
|
-
//# sourceMappingURL=resolvedUrl.d.
|
|
109
|
+
//# sourceMappingURL=resolvedUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACnB;AAED;;;GAGG;AACH,oBAAY,eAAe;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IAKxB,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QACZ;;WAEG;QACH,IAAI,CAAC,EAAE,YAAY,CAAC;QAEpB;;WAEG;QACH,KAAK,CAAC,EAAE,GAAG,CAAC;QAEZ,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AACD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY,EAAE,aAAa;IACpE,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,IAAI,CAAC;IAGtB,GAAG,EAAE,MAAM,CAAC;IAGZ,gBAAgB,EAAE,MAAM,CAAC;IAEzB,SAAS,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,wBAAwB,EAAE,MAAM,CAAC;QACjC,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;IAIF,MAAM,EAAE,EAAE,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE;QAGV,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IAEF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
7
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export var ShareLinkTypes;
|
|
11
|
-
(function (ShareLinkTypes) {
|
|
12
|
-
ShareLinkTypes["csl"] = "csl";
|
|
13
|
-
})(ShareLinkTypes || (ShareLinkTypes = {}));
|
|
14
5
|
/**
|
|
15
6
|
* Sharing scope of the share links created for a file.
|
|
16
7
|
* @alpha
|
|
@@ -31,4 +22,4 @@ export var SharingLinkRole;
|
|
|
31
22
|
SharingLinkRole["view"] = "view";
|
|
32
23
|
SharingLinkRole["edit"] = "edit";
|
|
33
24
|
})(SharingLinkRole || (SharingLinkRole = {}));
|
|
34
|
-
//# sourceMappingURL=resolvedUrl.
|
|
25
|
+
//# sourceMappingURL=resolvedUrl.js.map
|