@fluidframework/odsp-driver-definitions 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.1

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/odsp-driver-definitions.api.md +7 -4
  3. package/beta.d.ts +11 -0
  4. package/dist/beta.d.ts +14 -0
  5. package/dist/errors.d.ts +2 -1
  6. package/dist/errors.d.ts.map +1 -1
  7. package/dist/errors.js +2 -2
  8. package/dist/errors.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/legacy.d.ts +43 -0
  13. package/dist/odspCache.d.ts +1 -1
  14. package/dist/odspCache.d.ts.map +1 -1
  15. package/dist/odspCache.js.map +1 -1
  16. package/dist/public.d.ts +12 -0
  17. package/dist/resolvedUrl.d.ts +1 -1
  18. package/dist/resolvedUrl.d.ts.map +1 -1
  19. package/dist/resolvedUrl.js.map +1 -1
  20. package/dist/sessionProvider.d.ts +1 -1
  21. package/dist/sessionProvider.d.ts.map +1 -1
  22. package/dist/sessionProvider.js.map +1 -1
  23. package/dist/tokenFetch.d.ts +5 -1
  24. package/dist/tokenFetch.d.ts.map +1 -1
  25. package/dist/tokenFetch.js.map +1 -1
  26. package/internal.d.ts +11 -0
  27. package/legacy.d.ts +11 -0
  28. package/lib/beta.d.ts +14 -0
  29. package/lib/errors.d.ts +2 -1
  30. package/lib/errors.d.ts.map +1 -1
  31. package/lib/errors.js +1 -1
  32. package/lib/errors.js.map +1 -1
  33. package/lib/index.d.ts +1 -1
  34. package/lib/index.d.ts.map +1 -1
  35. package/lib/index.js.map +1 -1
  36. package/lib/legacy.d.ts +43 -0
  37. package/lib/odspCache.d.ts +1 -1
  38. package/lib/odspCache.d.ts.map +1 -1
  39. package/lib/odspCache.js.map +1 -1
  40. package/lib/public.d.ts +12 -0
  41. package/lib/resolvedUrl.d.ts +1 -1
  42. package/lib/resolvedUrl.d.ts.map +1 -1
  43. package/lib/resolvedUrl.js.map +1 -1
  44. package/lib/sessionProvider.d.ts +1 -1
  45. package/lib/sessionProvider.d.ts.map +1 -1
  46. package/lib/sessionProvider.js.map +1 -1
  47. package/lib/tokenFetch.d.ts +5 -1
  48. package/lib/tokenFetch.d.ts.map +1 -1
  49. package/lib/tokenFetch.js.map +1 -1
  50. package/package.json +27 -48
  51. package/src/errors.ts +3 -5
  52. package/src/index.ts +1 -0
  53. package/src/odspCache.ts +1 -1
  54. package/src/resolvedUrl.ts +1 -1
  55. package/src/sessionProvider.ts +1 -1
  56. package/src/tokenFetch.ts +9 -0
  57. package/api-extractor-cjs.json +0 -8
  58. package/dist/odsp-driver-definitions-alpha.d.ts +0 -574
  59. package/dist/odsp-driver-definitions-beta.d.ts +0 -92
  60. package/dist/odsp-driver-definitions-public.d.ts +0 -80
  61. package/dist/odsp-driver-definitions-untrimmed.d.ts +0 -608
  62. package/lib/odsp-driver-definitions-alpha.d.ts +0 -574
  63. package/lib/odsp-driver-definitions-beta.d.ts +0 -92
  64. package/lib/odsp-driver-definitions-public.d.ts +0 -80
  65. package/lib/odsp-driver-definitions-untrimmed.d.ts +0 -608
  66. /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @fluidframework/odsp-driver-definitions
2
2
 
3
+ ## 2.0.0-rc.3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Packages now use package.json "exports" and require modern module resolution [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
8
+
9
+ Fluid Framework packages have been updated to use the [package.json "exports"
10
+ field](https://nodejs.org/docs/latest-v18.x/api/packages.html#exports) to define explicit entry points for both
11
+ TypeScript types and implementation code.
12
+
13
+ This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
14
+
15
+ - `"moduleResolution": "Node16"` with `"module": "Node16"`
16
+ - `"moduleResolution": "Bundler"` with `"module": "ESNext"`
17
+
18
+ We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable
19
+ for use with modern versions of Node.js _and_ Bundlers.
20
+ [See the TypeScript documentation](https://www.typescriptlang.org/tsconfig#moduleResolution) for more information
21
+ regarding the module and moduleResolution options.
22
+
23
+ **Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used
24
+ to distinguish stable APIs from those that are in development.**
25
+
3
26
  ## 2.0.0-rc.2.0.0
4
27
 
5
28
  ### Minor Changes
@@ -4,10 +4,10 @@
4
4
 
5
5
  ```ts
6
6
 
7
- import { DriverError } from '@fluidframework/driver-definitions';
8
- import { FiveDaysMs } from '@fluidframework/driver-definitions';
7
+ import { DriverError } from '@fluidframework/driver-definitions/internal';
8
+ import { FiveDaysMs } from '@fluidframework/driver-definitions/internal';
9
9
  import { IDriverErrorBase } from '@fluidframework/driver-definitions';
10
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
10
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
11
11
 
12
12
  // @alpha (undocumented)
13
13
  export type CacheContentType = "snapshot" | "ops";
@@ -66,7 +66,10 @@ export interface IFileEntry {
66
66
  }
67
67
 
68
68
  // @internal (undocumented)
69
- export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
69
+ export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string>;
70
+
71
+ // @internal (undocumented)
72
+ export type InstrumentedTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
70
73
 
71
74
  // @alpha
72
75
  export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
package/beta.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export * from "./lib/beta.js";
package/dist/beta.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // beta APIs
13
+ TokenResponse
14
+ } from "./index.js";
package/dist/errors.d.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions";
5
+ import { IDriverErrorBase } from "@fluidframework/driver-definitions";
6
+ import { DriverError } from "@fluidframework/driver-definitions/internal";
6
7
  /**
7
8
  * ODSP Error types.
8
9
  * Different error types that may be thrown by the ODSP driver.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAA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CAAC,SAAS,EAAE,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
package/dist/errors.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OdspErrorTypes = void 0;
4
2
  /*!
5
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
6
4
  * Licensed under the MIT License.
7
5
  */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.OdspErrorTypes = void 0;
8
8
  const driver_definitions_1 = require("@fluidframework/driver-definitions");
9
9
  /**
10
10
  * ODSP Error types.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2EAI4C;AAE5C;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,qCAAgB;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"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2EAAwF;AAGxF;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,qCAAgB;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 */\n\nimport { DriverErrorTypes, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { DriverError } from \"@fluidframework/driver-definitions/internal\";\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"]}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,6 @@ export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from "
6
6
  export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory.js";
7
7
  export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache.js";
8
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";
9
+ export { IdentityType, InstrumentedStorageTokenFetcher, InstrumentedTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, tokenFromResponse, TokenResponse, } from "./tokenFetch.js";
10
10
  export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -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,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"}
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,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.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,iDASyB;AANxB,iHAAA,gBAAgB,OAAA;AAIhB,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\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
+ {"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,iDAUyB;AANxB,iHAAA,gBAAgB,OAAA;AAIhB,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\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // beta APIs
13
+ TokenResponse,
14
+
15
+ // alpha APIs
16
+ CacheContentType,
17
+ HostStoragePolicy,
18
+ ICacheEntry,
19
+ ICollabSessionOptions,
20
+ IEntry,
21
+ IFileEntry,
22
+ IOdspError,
23
+ IOdspErrorAugmentations,
24
+ IOdspResolvedUrl,
25
+ IOdspUrlParts,
26
+ IOpsCachingPolicy,
27
+ IPersistedCache,
28
+ IProvideSessionAwareDriverFactory,
29
+ IRelaySessionAwareDriverFactory,
30
+ ISharingLink,
31
+ ISharingLinkKind,
32
+ ISnapshotOptions,
33
+ ISocketStorageDiscovery,
34
+ IdentityType,
35
+ OdspError,
36
+ OdspErrorTypes,
37
+ OdspResourceTokenFetchOptions,
38
+ ShareLinkInfoType,
39
+ SharingLinkRole,
40
+ SharingLinkScope,
41
+ TokenFetchOptions,
42
+ TokenFetcher
43
+ } from "./index.js";
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IResolvedUrl, type FiveDaysMs } from "@fluidframework/driver-definitions";
5
+ import { type FiveDaysMs, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
8
8
  * That policy is the outward expression and this value is the implementation - using a larger value
@@ -1 +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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H,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 +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 { 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"]}
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"]}
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {}
12
+
@@ -2,7 +2,7 @@
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 } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * @alpha
8
8
  */
@@ -1 +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;IA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AAM,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolvedUrl.js","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * @alpha\n */\nexport interface IOdspUrlParts {\n\tsiteUrl: string;\n\tdriveId: string;\n\titemId: string;\n}\n\n/**\n * Sharing scope of the share links created for a file.\n * @alpha\n */\nexport enum SharingLinkScope {\n\torganization = \"organization\",\n\tusers = \"users\",\n\tanonymous = \"anonymous\",\n\tdefault = \"default\",\n}\n\n/**\n * View/edit permission role for a sharing link.\n * @alpha\n */\nexport enum SharingLinkRole {\n\tview = \"view\",\n\tedit = \"edit\",\n}\n\n/**\n * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.\n * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.\n * @alpha\n */\nexport interface ISharingLinkKind {\n\tscope: SharingLinkScope;\n\t/*\n\t * If this parameter is not provided, the API will default to \"edit\" links (provided\n\t * a valid createLinkScope setting is given).\n\t */\n\trole?: SharingLinkRole;\n}\n\n/**\n * Sharing link data received from the /snapshot api response.\n * @alpha\n */\nexport interface ISharingLink extends ISharingLinkKind {\n\twebUrl: string;\n}\n\n/**\n * Sharing link data created for the ODSP item.\n * Contains information about either sharing link created while creating a new file or\n * a redeemable share link created when loading an existing file\n * @alpha\n */\nexport interface ShareLinkInfoType {\n\t/**\n\t * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to\n\t * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature\n\t * where we can create a share link along with creating a file by passing a query parameter called\n\t * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information\n\t * from the /snapshot api response.\n\t */\n\tcreateLink?: {\n\t\t/**\n\t\t * Share link created when the file is created for the first time with /snapshot api call.\n\t\t */\n\t\tlink?: ISharingLink;\n\n\t\t/**\n\t\t * Error message if creation of sharing link fails with /snapshot api call\n\t\t */\n\t\terror?: any;\n\n\t\tshareId?: string;\n\t};\n\n\t/**\n\t * This is used to save the network calls while doing trees/latest call as if the client does not have\n\t * permission then this link can be redeemed for the permissions in the same network call.\n\t */\n\tsharingLinkToRedeem?: string;\n}\n/**\n * @alpha\n */\nexport interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {\n\ttype: \"fluid\";\n\todspResolvedUrl: true;\n\n\t// URL to send to fluid, contains the documentId and the path\n\turl: string;\n\n\t// A hashed identifier that is unique to this document\n\thashedDocumentId: string;\n\n\tendpoints: {\n\t\tsnapshotStorageUrl: string;\n\t\tattachmentPOSTStorageUrl: string;\n\t\tattachmentGETStorageUrl: string;\n\t\tdeltaStorageUrl: string;\n\t};\n\n\t// Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n\ttokens: {};\n\n\tfileName: string;\n\n\tsummarizer: boolean;\n\n\tcodeHint?: {\n\t\t// containerPackageName is used for adding the package name to the request headers.\n\t\t// This may be used for preloading the container package when loading Fluid content.\n\t\tcontainerPackageName?: string;\n\t};\n\n\tfileVersion: string | undefined;\n\n\tdataStorePath?: string;\n\n\t/**\n\t * Sharing link data created for the ODSP item.\n\t * Contains information about either sharing link created while creating a new file or\n\t * a redeemable share link created when loading an existing file\n\t */\n\tshareLinkInfo?: ShareLinkInfoType;\n\n\tisClpCompliantApp?: boolean;\n}\n"]}
1
+ {"version":3,"file":"resolvedUrl.js","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * @alpha\n */\nexport interface IOdspUrlParts {\n\tsiteUrl: string;\n\tdriveId: string;\n\titemId: string;\n}\n\n/**\n * Sharing scope of the share links created for a file.\n * @alpha\n */\nexport enum SharingLinkScope {\n\torganization = \"organization\",\n\tusers = \"users\",\n\tanonymous = \"anonymous\",\n\tdefault = \"default\",\n}\n\n/**\n * View/edit permission role for a sharing link.\n * @alpha\n */\nexport enum SharingLinkRole {\n\tview = \"view\",\n\tedit = \"edit\",\n}\n\n/**\n * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.\n * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.\n * @alpha\n */\nexport interface ISharingLinkKind {\n\tscope: SharingLinkScope;\n\t/*\n\t * If this parameter is not provided, the API will default to \"edit\" links (provided\n\t * a valid createLinkScope setting is given).\n\t */\n\trole?: SharingLinkRole;\n}\n\n/**\n * Sharing link data received from the /snapshot api response.\n * @alpha\n */\nexport interface ISharingLink extends ISharingLinkKind {\n\twebUrl: string;\n}\n\n/**\n * Sharing link data created for the ODSP item.\n * Contains information about either sharing link created while creating a new file or\n * a redeemable share link created when loading an existing file\n * @alpha\n */\nexport interface ShareLinkInfoType {\n\t/**\n\t * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to\n\t * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature\n\t * where we can create a share link along with creating a file by passing a query parameter called\n\t * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information\n\t * from the /snapshot api response.\n\t */\n\tcreateLink?: {\n\t\t/**\n\t\t * Share link created when the file is created for the first time with /snapshot api call.\n\t\t */\n\t\tlink?: ISharingLink;\n\n\t\t/**\n\t\t * Error message if creation of sharing link fails with /snapshot api call\n\t\t */\n\t\terror?: any;\n\n\t\tshareId?: string;\n\t};\n\n\t/**\n\t * This is used to save the network calls while doing trees/latest call as if the client does not have\n\t * permission then this link can be redeemed for the permissions in the same network call.\n\t */\n\tsharingLinkToRedeem?: string;\n}\n/**\n * @alpha\n */\nexport interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {\n\ttype: \"fluid\";\n\todspResolvedUrl: true;\n\n\t// URL to send to fluid, contains the documentId and the path\n\turl: string;\n\n\t// A hashed identifier that is unique to this document\n\thashedDocumentId: string;\n\n\tendpoints: {\n\t\tsnapshotStorageUrl: string;\n\t\tattachmentPOSTStorageUrl: string;\n\t\tattachmentGETStorageUrl: string;\n\t\tdeltaStorageUrl: string;\n\t};\n\n\t// Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n\ttokens: {};\n\n\tfileName: string;\n\n\tsummarizer: boolean;\n\n\tcodeHint?: {\n\t\t// containerPackageName is used for adding the package name to the request headers.\n\t\t// This may be used for preloading the container package when loading Fluid content.\n\t\tcontainerPackageName?: string;\n\t};\n\n\tfileVersion: string | undefined;\n\n\tdataStorePath?: string;\n\n\t/**\n\t * Sharing link data created for the ODSP item.\n\t * Contains information about either sharing link created while creating a new file or\n\t * a redeemable share link created when loading an existing file\n\t */\n\tshareLinkInfo?: ShareLinkInfoType;\n\n\tisClpCompliantApp?: boolean;\n}\n"]}
@@ -2,7 +2,7 @@
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 } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * Socket storage discovery api response
8
8
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"sessionProvider.d.ts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEvC,EAAE,EAAE,MAAM,CAAC;IAIX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAEvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IACjD,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;CAC1E;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iCAAiC;IACzF,0BAA0B,CACzB,WAAW,EAAE,YAAY,GACvB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;CAChD"}
1
+ {"version":3,"file":"sessionProvider.d.ts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEvC,EAAE,EAAE,MAAM,CAAC;IAIX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAEvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IACjD,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;CAC1E;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iCAAiC;IACzF,0BAA0B,CACzB,WAAW,EAAE,YAAY,GACvB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;CAChD"}
@@ -1 +1 @@
1
- {"version":3,"file":"sessionProvider.js","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * Socket storage discovery api response\n * @alpha\n */\nexport interface ISocketStorageDiscovery {\n\t// The id of the web socket\n\tid: string;\n\n\t// SPO gives us runtimeTenantId, we remap it to tenantId\n\t// See getSocketStorageDiscovery\n\truntimeTenantId?: string;\n\ttenantId: string;\n\n\tsnapshotStorageUrl: string;\n\tdeltaStorageUrl: string;\n\n\t/**\n\t * PUSH URL\n\t */\n\tdeltaStreamSocketUrl: string;\n\n\t/**\n\t * The access token for PushChannel. Optionally returned, depending on implementation.\n\t * OneDrive for Consumer implementation returns it and OneDrive for Business implementation\n\t * does not return it and instead expects token to be returned via `getWebsocketToken` callback\n\t * passed as a parameter to `OdspDocumentService.create()` factory.\n\t */\n\tsocketToken?: string;\n\n\t/**\n\t * This is the time within which client has to refresh the session on (ODSP) relay service.\n\t */\n\trefreshSessionDurationSeconds?: number;\n\n\t/**\n\t * Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The\n\t * response will contain empty labels when the file has no labels, so this field will be there\n\t * even if file has no labels when the service will implement this contract.\n\t */\n\tsensitivityLabelsInfo?: string;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to interrogate itself\n * to find out if it is session aware.\n * @alpha\n */\nexport interface IProvideSessionAwareDriverFactory {\n\treadonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`\n * function if it session aware.\n * @alpha\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
1
+ {"version":3,"file":"sessionProvider.js","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Socket storage discovery api response\n * @alpha\n */\nexport interface ISocketStorageDiscovery {\n\t// The id of the web socket\n\tid: string;\n\n\t// SPO gives us runtimeTenantId, we remap it to tenantId\n\t// See getSocketStorageDiscovery\n\truntimeTenantId?: string;\n\ttenantId: string;\n\n\tsnapshotStorageUrl: string;\n\tdeltaStorageUrl: string;\n\n\t/**\n\t * PUSH URL\n\t */\n\tdeltaStreamSocketUrl: string;\n\n\t/**\n\t * The access token for PushChannel. Optionally returned, depending on implementation.\n\t * OneDrive for Consumer implementation returns it and OneDrive for Business implementation\n\t * does not return it and instead expects token to be returned via `getWebsocketToken` callback\n\t * passed as a parameter to `OdspDocumentService.create()` factory.\n\t */\n\tsocketToken?: string;\n\n\t/**\n\t * This is the time within which client has to refresh the session on (ODSP) relay service.\n\t */\n\trefreshSessionDurationSeconds?: number;\n\n\t/**\n\t * Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The\n\t * response will contain empty labels when the file has no labels, so this field will be there\n\t * even if file has no labels when the service will implement this contract.\n\t */\n\tsensitivityLabelsInfo?: string;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to interrogate itself\n * to find out if it is session aware.\n * @alpha\n */\nexport interface IProvideSessionAwareDriverFactory {\n\treadonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`\n * function if it session aware.\n * @alpha\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
@@ -83,5 +83,9 @@ export type IdentityType = "Consumer" | "Enterprise";
83
83
  /**
84
84
  * @internal
85
85
  */
86
- export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
86
+ export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string>;
87
+ /**
88
+ * @internal
89
+ */
90
+ export type InstrumentedTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
87
91
  //# sourceMappingURL=tokenFetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACd,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,KACtD,MAAM,GAAG,IAKW,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,kBACb,MAAM,GAAG,aAAa,GAAG,IAAI,KAC1C,OAAO,GAAG,SAGc,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;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AAU,GAAG,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokenFetch.js","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmEH;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC7B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAPX,QAAA,iBAAiB,qBAON;AAExB;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;AALf,QAAA,gBAAgB,oBAKD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t? null\n\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
1
+ {"version":3,"file":"tokenFetch.js","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmEH;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC7B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAPX,QAAA,iBAAiB,qBAON;AAExB;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;AALf,QAAA,gBAAgB,oBAKD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t? null\n\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string>;\n\n/**\n * @internal\n */\nexport type InstrumentedTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
package/internal.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export * from "./lib/index.js";
package/legacy.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export * from "./lib/legacy.js";
package/lib/beta.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // beta APIs
13
+ TokenResponse
14
+ } from "./index.js";
package/lib/errors.d.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions";
5
+ import { IDriverErrorBase } from "@fluidframework/driver-definitions";
6
+ import { DriverError } from "@fluidframework/driver-definitions/internal";
6
7
  /**
7
8
  * ODSP Error types.
8
9
  * Different error types that may be thrown by the ODSP driver.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,uBAAuB;IAC/F,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,uBAAuB;IAC/F,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
package/lib/errors.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { DriverErrorTypes, } from "@fluidframework/driver-definitions";
5
+ import { DriverErrorTypes } from "@fluidframework/driver-definitions";
6
6
  /**
7
7
  * ODSP Error types.
8
8
  * Different error types that may be thrown by the ODSP driver.
package/lib/errors.js.map CHANGED
@@ -1 +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"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAoB,MAAM,oCAAoC,CAAC;AAGxF;;;;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 */\n\nimport { DriverErrorTypes, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { DriverError } from \"@fluidframework/driver-definitions/internal\";\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"]}
package/lib/index.d.ts CHANGED
@@ -6,6 +6,6 @@ export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from "
6
6
  export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory.js";
7
7
  export { CacheContentType, maximumCacheDurationMs, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache.js";
8
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";
9
+ export { IdentityType, InstrumentedStorageTokenFetcher, InstrumentedTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, tokenFromResponse, TokenResponse, } from "./tokenFetch.js";
10
10
  export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -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,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"}
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,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.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,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
+ {"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,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\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch.js\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider.js\";\n"]}
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {
12
+ // beta APIs
13
+ TokenResponse,
14
+
15
+ // alpha APIs
16
+ CacheContentType,
17
+ HostStoragePolicy,
18
+ ICacheEntry,
19
+ ICollabSessionOptions,
20
+ IEntry,
21
+ IFileEntry,
22
+ IOdspError,
23
+ IOdspErrorAugmentations,
24
+ IOdspResolvedUrl,
25
+ IOdspUrlParts,
26
+ IOpsCachingPolicy,
27
+ IPersistedCache,
28
+ IProvideSessionAwareDriverFactory,
29
+ IRelaySessionAwareDriverFactory,
30
+ ISharingLink,
31
+ ISharingLinkKind,
32
+ ISnapshotOptions,
33
+ ISocketStorageDiscovery,
34
+ IdentityType,
35
+ OdspError,
36
+ OdspErrorTypes,
37
+ OdspResourceTokenFetchOptions,
38
+ ShareLinkInfoType,
39
+ SharingLinkRole,
40
+ SharingLinkScope,
41
+ TokenFetchOptions,
42
+ TokenFetcher
43
+ } from "./index.js";
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IResolvedUrl, type FiveDaysMs } from "@fluidframework/driver-definitions";
5
+ import { type FiveDaysMs, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
8
8
  * That policy is the outward expression and this value is the implementation - using a larger value
@@ -1 +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"}
1
+ {"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAA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AM,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"]}
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"]}