@fluidframework/odsp-driver 2.42.0 → 2.43.0

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 (77) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/contractsPublic.d.ts +11 -1
  3. package/dist/contractsPublic.d.ts.map +1 -1
  4. package/dist/contractsPublic.js +9 -2
  5. package/dist/contractsPublic.js.map +1 -1
  6. package/dist/fetchSnapshot.d.ts.map +1 -1
  7. package/dist/fetchSnapshot.js +11 -2
  8. package/dist/fetchSnapshot.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +4 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/localOdspDriver/localOdspDocumentService.d.ts +6 -1
  14. package/dist/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
  15. package/dist/localOdspDriver/localOdspDocumentService.js +8 -0
  16. package/dist/localOdspDriver/localOdspDocumentService.js.map +1 -1
  17. package/dist/localOdspDriver/localOdspLayerCompatState.d.ts +11 -0
  18. package/dist/localOdspDriver/localOdspLayerCompatState.d.ts.map +1 -0
  19. package/dist/localOdspDriver/localOdspLayerCompatState.js +27 -0
  20. package/dist/localOdspDriver/localOdspLayerCompatState.js.map +1 -0
  21. package/dist/odspDocumentService.d.ts +6 -1
  22. package/dist/odspDocumentService.d.ts.map +1 -1
  23. package/dist/odspDocumentService.js +8 -0
  24. package/dist/odspDocumentService.js.map +1 -1
  25. package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  26. package/dist/odspDriverUrlResolverForShareLink.js +2 -0
  27. package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
  28. package/dist/odspLayerCompatState.d.ts +11 -0
  29. package/dist/odspLayerCompatState.d.ts.map +1 -0
  30. package/dist/odspLayerCompatState.js +27 -0
  31. package/dist/odspLayerCompatState.js.map +1 -0
  32. package/dist/packageVersion.d.ts +1 -1
  33. package/dist/packageVersion.js +1 -1
  34. package/dist/packageVersion.js.map +1 -1
  35. package/lib/contractsPublic.d.ts +11 -1
  36. package/lib/contractsPublic.d.ts.map +1 -1
  37. package/lib/contractsPublic.js +9 -2
  38. package/lib/contractsPublic.js.map +1 -1
  39. package/lib/fetchSnapshot.d.ts.map +1 -1
  40. package/lib/fetchSnapshot.js +11 -2
  41. package/lib/fetchSnapshot.js.map +1 -1
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.d.ts.map +1 -1
  44. package/lib/index.js +2 -0
  45. package/lib/index.js.map +1 -1
  46. package/lib/localOdspDriver/localOdspDocumentService.d.ts +6 -1
  47. package/lib/localOdspDriver/localOdspDocumentService.d.ts.map +1 -1
  48. package/lib/localOdspDriver/localOdspDocumentService.js +8 -0
  49. package/lib/localOdspDriver/localOdspDocumentService.js.map +1 -1
  50. package/lib/localOdspDriver/localOdspLayerCompatState.d.ts +11 -0
  51. package/lib/localOdspDriver/localOdspLayerCompatState.d.ts.map +1 -0
  52. package/lib/localOdspDriver/localOdspLayerCompatState.js +24 -0
  53. package/lib/localOdspDriver/localOdspLayerCompatState.js.map +1 -0
  54. package/lib/odspDocumentService.d.ts +6 -1
  55. package/lib/odspDocumentService.d.ts.map +1 -1
  56. package/lib/odspDocumentService.js +8 -0
  57. package/lib/odspDocumentService.js.map +1 -1
  58. package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
  59. package/lib/odspDriverUrlResolverForShareLink.js +2 -0
  60. package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
  61. package/lib/odspLayerCompatState.d.ts +11 -0
  62. package/lib/odspLayerCompatState.d.ts.map +1 -0
  63. package/lib/odspLayerCompatState.js +24 -0
  64. package/lib/odspLayerCompatState.js.map +1 -0
  65. package/lib/packageVersion.d.ts +1 -1
  66. package/lib/packageVersion.js +1 -1
  67. package/lib/packageVersion.js.map +1 -1
  68. package/package.json +14 -14
  69. package/src/contractsPublic.ts +10 -2
  70. package/src/fetchSnapshot.ts +15 -2
  71. package/src/index.ts +3 -0
  72. package/src/localOdspDriver/localOdspDocumentService.ts +10 -1
  73. package/src/localOdspDriver/localOdspLayerCompatState.ts +27 -0
  74. package/src/odspDocumentService.ts +10 -1
  75. package/src/odspDriverUrlResolverForShareLink.ts +3 -0
  76. package/src/odspLayerCompatState.ts +27 -0
  77. package/src/packageVersion.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/odsp-driver
2
2
 
3
+ ## 2.43.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.42.0
4
8
 
5
9
  Dependency updates only.
@@ -18,13 +18,23 @@ export interface OdspFluidDataStoreLocator extends IOdspUrlParts {
18
18
  * @internal
19
19
  */
20
20
  export declare enum SharingLinkHeader {
21
- isSharingLinkToRedeem = "isSharingLinkToRedeem"
21
+ /**
22
+ * Can be used in request made to resolver, to tell the resolver that the passed in URL is a sharing link
23
+ * which can be redeemed at server to get permissions.
24
+ */
25
+ isSharingLinkToRedeem = "isSharingLinkToRedeem",
26
+ /**
27
+ * When isSharingLinkToRedeem is true, this header can be used to tell the server that the redemption of the sharing link
28
+ * is meant to be non-durable.
29
+ */
30
+ isRedemptionNonDurable = "isRedemptionNonDurable"
22
31
  }
23
32
  /**
24
33
  * @internal
25
34
  */
26
35
  export interface ISharingLinkHeader {
27
36
  [SharingLinkHeader.isSharingLinkToRedeem]: boolean;
37
+ [SharingLinkHeader.isRedemptionNonDurable]: boolean;
28
38
  }
29
39
  /**
30
40
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"contractsPublic.d.ts","sourceRoot":"","sources":["../src/contractsPublic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAA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ACH,oBAAY,qBAAqB;IAGhC,iBAAiB,wBAAwB;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACnD;AAED,OAAO,QAAQ,iCAAiC,CAAC;IAChD,UAAiB,cAChB,SAAQ,OAAO,CAAC,kBAAkB,CAAC,EAClC,OAAO,CAAC,sBAAsB,CAAC;KAAG;CACpC"}
@@ -10,9 +10,16 @@ exports.ClpCompliantAppHeader = exports.SharingLinkHeader = void 0;
10
10
  */
11
11
  var SharingLinkHeader;
12
12
  (function (SharingLinkHeader) {
13
- // Can be used in request made to resolver, to tell the resolver that the passed in URL is a sharing link
14
- // which can be redeemed at server to get permissions.
13
+ /**
14
+ * Can be used in request made to resolver, to tell the resolver that the passed in URL is a sharing link
15
+ * which can be redeemed at server to get permissions.
16
+ */
15
17
  SharingLinkHeader["isSharingLinkToRedeem"] = "isSharingLinkToRedeem";
18
+ /**
19
+ * When isSharingLinkToRedeem is true, this header can be used to tell the server that the redemption of the sharing link
20
+ * is meant to be non-durable.
21
+ */
22
+ SharingLinkHeader["isRedemptionNonDurable"] = "isRedemptionNonDurable";
16
23
  })(SharingLinkHeader || (exports.SharingLinkHeader = SharingLinkHeader = {}));
17
24
  /**
18
25
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"contractsPublic.js","sourceRoot":"","sources":["../src/contractsPublic.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgBH;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC5B,yGAAyG;IACzG,sDAAsD;IACtD,oEAA+C,CAAA;AAChD,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAQD;;GAEG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAChC,oGAAoG;IACpG,wGAAwG;IACxG,kEAAyC,CAAA;AAC1C,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IOdspUrlParts } from \"@fluidframework/odsp-driver-definitions/internal\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface OdspFluidDataStoreLocator extends IOdspUrlParts {\n\tdataStorePath: string;\n\tappName?: string;\n\tcontainerPackageName?: string;\n\tfileVersion?: string;\n\tcontext?: string;\n}\n\n/**\n * @internal\n */\nexport enum SharingLinkHeader {\n\t// Can be used in request made to resolver, to tell the resolver that the passed in URL is a sharing link\n\t// which can be redeemed at server to get permissions.\n\tisSharingLinkToRedeem = \"isSharingLinkToRedeem\",\n}\n\n/**\n * @internal\n */\nexport interface ISharingLinkHeader {\n\t[SharingLinkHeader.isSharingLinkToRedeem]: boolean;\n}\n/**\n * @internal\n */\nexport enum ClpCompliantAppHeader {\n\t// Can be used in request made to resolver, to tell the resolver that the host app is CLP compliant.\n\t// Odsp will not return Classified, labeled, or protected documents if the host app cannot support them.\n\tisClpCompliantApp = \"X-CLP-Compliant-App\",\n}\n\n/**\n * @internal\n */\nexport interface IClpCompliantAppHeader {\n\t[ClpCompliantAppHeader.isClpCompliantApp]: boolean;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n\texport interface IRequestHeader\n\t\textends Partial<ISharingLinkHeader>,\n\t\t\tPartial<IClpCompliantAppHeader> {}\n}\n"]}
1
+ {"version":3,"file":"contractsPublic.js","sourceRoot":"","sources":["../src/contractsPublic.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgBH;;GAEG;AACH,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC5B;;;OAGG;IACH,oEAA+C,CAAA;IAC/C;;;OAGG;IACH,sEAAiD,CAAA;AAClD,CAAC,EAXW,iBAAiB,iCAAjB,iBAAiB,QAW5B;AASD;;GAEG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAChC,oGAAoG;IACpG,wGAAwG;IACxG,kEAAyC,CAAA;AAC1C,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IOdspUrlParts } from \"@fluidframework/odsp-driver-definitions/internal\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface OdspFluidDataStoreLocator extends IOdspUrlParts {\n\tdataStorePath: string;\n\tappName?: string;\n\tcontainerPackageName?: string;\n\tfileVersion?: string;\n\tcontext?: string;\n}\n\n/**\n * @internal\n */\nexport enum SharingLinkHeader {\n\t/**\n\t * Can be used in request made to resolver, to tell the resolver that the passed in URL is a sharing link\n\t * which can be redeemed at server to get permissions.\n\t */\n\tisSharingLinkToRedeem = \"isSharingLinkToRedeem\",\n\t/**\n\t * When isSharingLinkToRedeem is true, this header can be used to tell the server that the redemption of the sharing link\n\t * is meant to be non-durable.\n\t */\n\tisRedemptionNonDurable = \"isRedemptionNonDurable\",\n}\n\n/**\n * @internal\n */\nexport interface ISharingLinkHeader {\n\t[SharingLinkHeader.isSharingLinkToRedeem]: boolean;\n\t[SharingLinkHeader.isRedemptionNonDurable]: boolean;\n}\n/**\n * @internal\n */\nexport enum ClpCompliantAppHeader {\n\t// Can be used in request made to resolver, to tell the resolver that the host app is CLP compliant.\n\t// Odsp will not return Classified, labeled, or protected documents if the host app cannot support them.\n\tisClpCompliantApp = \"X-CLP-Compliant-App\",\n}\n\n/**\n * @internal\n */\nexport interface IClpCompliantAppHeader {\n\t[ClpCompliantAppHeader.isClpCompliantApp]: boolean;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n\texport interface IRequestHeader\n\t\textends Partial<ISharingLinkHeader>,\n\t\t\tPartial<IClpCompliantAppHeader> {}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fetchSnapshot.d.ts","sourceRoot":"","sources":["../src/fetchSnapshot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,SAAS,EAAiB,MAAM,6CA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AE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC5C;AAsCD,UAAU,UAAU;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG;IAAE,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAY3F;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CASnE;AAiBD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,oDAEV,gBAAgB,iBAClB,+BAA+B,qBAC3B,mBAAmB,mBACrB,MAAM,EAAE,GAAG,SAAS,mBACpB,gBAAgB,GAAG,SAAS,4BACnB,yBAAyB,eACtC,eAAe,iBACb,YAAY,iBACZ,MAAM,KACnB,QAAQ,kCAAkC,CAAC,CA+E9C,CAAC"}
@@ -114,6 +114,7 @@ async function redeemSharingLink(odspResolvedUrl, getAuthHeader, logger) {
114
114
  }, async (event) => {
115
115
  (0, internal_1.assert)(!!odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem, 0x1ed /* "Share link should be present" */);
116
116
  const encodedShareUrl = getEncodedShareUrl(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem);
117
+ const isRedemptionNonDurable = odspResolvedUrl.shareLinkInfo?.isRedemptionNonDurable === true;
117
118
  let redeemUrl;
118
119
  async function callSharesAPI(baseUrl) {
119
120
  await (0, odspUtils_js_1.getWithRetryForTokenRefresh)(async (tokenFetchOptions) => {
@@ -127,7 +128,7 @@ async function redeemSharingLink(odspResolvedUrl, getAuthHeader, logger) {
127
128
  const method = "GET";
128
129
  const authHeader = await getAuthHeader({ ...tokenFetchOptions, request: { url, method } }, "RedeemShareLink");
129
130
  const headers = (0, getUrlAndHeadersWithAuth_js_1.getHeadersWithAuth)(authHeader);
130
- headers.prefer = "redeemSharingLink";
131
+ headers.prefer = isRedemptionNonDurable ? "nonDurableRedeem" : "redeemSharingLink";
131
132
  await (0, odspUtils_js_1.fetchAndParseAsJSONHelper)(url, { headers, method });
132
133
  });
133
134
  }
@@ -137,6 +138,7 @@ async function redeemSharingLink(odspResolvedUrl, getAuthHeader, logger) {
137
138
  queryParamsLength: new URL(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem).search
138
139
  .length,
139
140
  useHeaders: true,
141
+ isRedemptionNonDurable,
140
142
  });
141
143
  // There is an issue where if we use the siteUrl in /shares, then the allowed length of url is just a few hundred characters(300-400)
142
144
  // and we fail to do the redeem. But if we use the tenant domain in the url, then the allowed length becomes 2048. So,
@@ -156,6 +158,7 @@ async function fetchLatestSnapshotCore(odspResolvedUrl, getAuthHeader, snapshotO
156
158
  const fetchSnapshotForLoadingGroup = (0, odspUtils_js_1.isSnapshotFetchForLoadingGroup)(loadingGroupIds);
157
159
  const eventName = fetchSnapshotForLoadingGroup ? "TreesLatestForGroup" : "TreesLatest";
158
160
  const internalFarmType = (0, odspUrlHelper_js_1.checkForKnownServerFarmType)(odspResolvedUrl.siteUrl);
161
+ const isRedemptionNonDurable = odspResolvedUrl.shareLinkInfo?.isRedemptionNonDurable === true;
159
162
  const perfEvent = {
160
163
  eventName,
161
164
  attempts: tokenFetchOptions.refresh ? 2 : 1,
@@ -164,6 +167,8 @@ async function fetchLatestSnapshotCore(odspResolvedUrl, getAuthHeader, snapshotO
164
167
  redeemFallbackEnabled: enableRedeemFallback,
165
168
  details: {
166
169
  internalFarmType,
170
+ // Whether the redemption used is non-durable or not.
171
+ isRedemptionNonDurable,
167
172
  },
168
173
  };
169
174
  if (snapshotOptions !== undefined) {
@@ -474,11 +479,15 @@ exports.downloadSnapshot = (0, mockify_js_1.mockify)(async (odspResolvedUrl, get
474
479
  const queryString = (0, getQueryString_js_1.getQueryString)(queryParams);
475
480
  const url = `${snapshotUrl}/trees/latest${queryString}`;
476
481
  const method = "POST";
482
+ const isRedemptionNonDurable = odspResolvedUrl.shareLinkInfo?.isRedemptionNonDurable === true;
477
483
  // The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.
478
484
  // Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.
479
485
  // This error thrown by server will contain the new redirect location. Look at the 404 error parsing
480
486
  // for further reference here: \packages\utils\odsp-doclib-utils\src\odspErrorUtils.ts
481
- const header = { prefer: "manualredirect" };
487
+ // If the share link is non-durable, we will add the nonDurableRedeem header to the header.prefer.
488
+ const header = isRedemptionNonDurable
489
+ ? { prefer: "manualredirect, nonDurableRedeem" }
490
+ : { prefer: "manualredirect" };
482
491
  const authHeader = await getAuthHeader({ ...tokenFetchOptions, request: { url, method } }, "downloadSnapshot");
483
492
  (0, internal_1.assert)(authHeader !== null, 0x1e5 /* "Storage token should not be null" */);
484
493
  const { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, authHeader, header);
@@ -1 +1 @@
1
- {"version":3,"file":"fetchSnapshot.js","sourceRoot":"","sources":["../src/fetchSnapshot.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAgE;AAChE,kEAA6D;AAC7D,mEAAkE;AAElE,oEAI+C;AAC/C,yEAGoD;AACpD,+EAM0D;AAC1D,uEAKkD;AAClD,+BAAkC;AAElC,yEAIoC;AACpC,iDAKwB;AAExB,2DAAqD;AACrD,+EAAmE;AACnE,6CAAuC;AACvC,mEAAoF;AACpF,yDAAiE;AACjE,iDAWwB;AACxB,2DAAiD;AAEjD;;;;GAIG;AACH,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACpC,yEAAQ,CAAA;IACR,6EAAU,CAAA;IACV,2FAAiB,CAAA;AAClB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CAClC,WAAmB,EACnB,SAAiB,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;YACrE,OAAO,CAAC,MAAM,GAAG,6CAA6C,6CAAkB,EAAE,CAAC;QACpF,CAAC;IACF,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,KAAK,CAC9C,GAAG,EACH,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,YAAY,CACZ,IAAI,IAAA,0BAAW,EAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;IAErC,OAAO;QACN,YAAY;QACZ,cAAc,EAAE,OAAO;QACvB,UAAU,EAAE,GAAG;KACf,CAAC;AACH,CAAC,CACD,CAAC;AAEF,SAAS,wBAAwB,CAChC,eAAiC,EACjC,KAA0B;IAE1B,IACC,eAAe,CAAC,aAAa,EAAE,mBAAmB,KAAK,SAAS;QAChE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,KAAK,CAAC,SAAS,KAAK,yBAAc,CAAC,kBAAkB;YACrD,KAAK,CAAC,SAAS,KAAK,yBAAc,CAAC,+BAA+B,CAAC,EACnE,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAW;IACtC;;;OAGG;IACH,IAAI,UAAU,GAAG,IAAA,+BAAgB,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpF,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { getW3CData } from \"@fluidframework/driver-base/internal\";\nimport { ISnapshot, ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tDriverErrorTelemetryProps,\n\tNonRetryableError,\n\tisRuntimeMessage,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\tfetchIncorrectResponse,\n\tthrowOdspNetworkError,\n} from \"@fluidframework/odsp-doclib-utils/internal\";\nimport {\n\ttype IOdspError,\n\tIOdspResolvedUrl,\n\tISnapshotOptions,\n\tInstrumentedStorageTokenFetcher,\n\tOdspErrorTypes,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tPerformanceEvent,\n\tisFluidError,\n\twrapError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tISnapshotContentsWithProps,\n\tcurrentReadVersion,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\nimport {\n\tIOdspSnapshot,\n\tISnapshotCachedEntry2,\n\tIVersionedValueWithEpoch,\n\tpersistedCacheValueVersion,\n} from \"./contracts.js\";\nimport { EpochTracker } from \"./epochTracker.js\";\nimport { getQueryString } from \"./getQueryString.js\";\nimport { getHeadersWithAuth } from \"./getUrlAndHeadersWithAuth.js\";\nimport { mockify } from \"./mockify.js\";\nimport { convertOdspSnapshotToSnapshotTreeAndBlobs } from \"./odspSnapshotParser.js\";\nimport { checkForKnownServerFarmType } from \"./odspUrlHelper.js\";\nimport {\n\tIOdspResponse,\n\tfetchAndParseAsJSONHelper,\n\tfetchHelper,\n\tgetWithRetryForTokenRefresh,\n\tgetWithRetryForTokenRefreshRepeat,\n\tisSnapshotFetchForLoadingGroup,\n\tmeasure,\n\tmeasureP,\n\tuseLegacyFlowWithoutGroupsForSnapshotFetch,\n\ttype TokenFetchOptionsEx,\n} from \"./odspUtils.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Enum to support different types of snapshot formats.\n * @legacy\n * @alpha\n */\nexport enum SnapshotFormatSupportType {\n\tJson = 0,\n\tBinary = 1,\n\tJsonAndBinary = 2,\n}\n\n/**\n * Fetches a snapshot from the server with a given version id.\n * @param snapshotUrl - snapshot url from where the odsp snapshot will be fetched\n * @param versionId - id of specific snapshot to be fetched\n * @param fetchFullSnapshot - whether we want to fetch full snapshot(with blobs)\n * @param forceAccessTokenViaAuthorizationHeader - Deprecated and not used, true value always used instead. Whether to force passing given token via authorization header\n * @param snapshotDownloader - Implementation of the get/post methods used to fetch the snapshot. snapshotDownloader is responsible for generating the appropriate headers (including Authorization header) as well as handling any token refreshes before retrying.\n * @returns A promise of the snapshot and the status code of the response\n */\nexport async function fetchSnapshot(\n\tsnapshotUrl: string,\n\tversionId: string,\n\tfetchFullSnapshot: boolean,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (url: string) => Promise<IOdspResponse<unknown>>,\n): Promise<ISnapshot> {\n\tconst path = `/trees/${versionId}`;\n\tlet queryParams: ISnapshotOptions = {};\n\n\tif (fetchFullSnapshot) {\n\t\tqueryParams = versionId === \"latest\" ? { deltas: 1, blobs: 2 } : { blobs: 2 };\n\t}\n\n\tconst queryString = getQueryString(queryParams);\n\tconst url = `${snapshotUrl}${path}${queryString}`;\n\tconst response = (await PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{\n\t\t\teventName: \"fetchSnapshot\",\n\t\t},\n\t\tasync () => snapshotDownloader(url),\n\t)) as IOdspResponse<IOdspSnapshot>;\n\treturn convertOdspSnapshotToSnapshotTreeAndBlobs(response.content);\n}\n\nexport async function fetchSnapshotWithRedeem(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageTokenFetcher: InstrumentedStorageTokenFetcher,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\tfinalOdspResolvedUrl: IOdspResolvedUrl,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\ttokenFetchOptions: TokenFetchOptionsEx,\n\t\tloadingGroupIds: string[] | undefined,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tcontroller?: AbortController,\n\t) => Promise<ISnapshotRequestAndResponseOptions>,\n\tputInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>,\n\tremoveEntries: () => Promise<void>,\n\tloadingGroupIds: string[] | undefined,\n\tenableRedeemFallback?: boolean,\n): Promise<ISnapshot> {\n\t// back-compat: This block to be removed with #8784 when we only consume/consider odsp resolvers that are >= 0.51\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n\tconst sharingLinkToRedeem = (odspResolvedUrl as any).sharingLinkToRedeem;\n\tif (sharingLinkToRedeem) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\todspResolvedUrl.shareLinkInfo = { ...odspResolvedUrl.shareLinkInfo, sharingLinkToRedeem };\n\t}\n\n\treturn fetchLatestSnapshotCore(\n\t\todspResolvedUrl,\n\t\tstorageTokenFetcher,\n\t\tsnapshotOptions,\n\t\tlogger,\n\t\tsnapshotDownloader,\n\t\tputInCache,\n\t\tloadingGroupIds,\n\t\tenableRedeemFallback,\n\t)\n\t\t.catch(async (error) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tif (enableRedeemFallback && isRedeemSharingLinkError(odspResolvedUrl, error)) {\n\t\t\t\t// Execute the redeem fallback\n\t\t\t\tawait redeemSharingLink(odspResolvedUrl, storageTokenFetcher, logger);\n\n\t\t\t\tconst odspResolvedUrlWithoutShareLink: IOdspResolvedUrl = {\n\t\t\t\t\t...odspResolvedUrl,\n\t\t\t\t\tshareLinkInfo: {\n\t\t\t\t\t\t...odspResolvedUrl.shareLinkInfo,\n\t\t\t\t\t\tsharingLinkToRedeem: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\t// Log initial failure only if redeem succeeded - it points out to some bug somewhere\n\t\t\t\t// If redeem failed, that most likely means user has no permissions to access a file,\n\t\t\t\t// and thus it's not worth it logging extra errors - same error will be logged by end-to-end\n\t\t\t\t// flow (container open) based on a failure above.\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"RedeemFallback\",\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\t\terrorType: error.errorType,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn fetchLatestSnapshotCore(\n\t\t\t\t\todspResolvedUrlWithoutShareLink,\n\t\t\t\t\tstorageTokenFetcher,\n\t\t\t\t\tsnapshotOptions,\n\t\t\t\t\tlogger,\n\t\t\t\t\tsnapshotDownloader,\n\t\t\t\t\tputInCache,\n\t\t\t\t\tloadingGroupIds,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})\n\t\t.catch(async (error) => {\n\t\t\t// Clear the cache on 401/403/404 on snapshot fetch from network because this means either the user doesn't\n\t\t\t// have permissions for the file or it was deleted. So, if we do not clear cache, we will continue fetching\n\t\t\t// snapshot from cache in the future.\n\t\t\tif (\n\t\t\t\t(typeof error === \"object\" &&\n\t\t\t\t\terror !== null &&\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\terror.errorType === OdspErrorTypes.authorizationError) ||\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\terror.errorType === OdspErrorTypes.fileNotFoundOrAccessDeniedError\n\t\t\t) {\n\t\t\t\tawait removeEntries();\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n}\n\nasync function redeemSharingLink(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\tlogger: ITelemetryLoggerExt,\n): Promise<void> {\n\tawait PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{\n\t\t\teventName: \"RedeemShareLink\",\n\t\t},\n\t\tasync (event) => {\n\t\t\tassert(\n\t\t\t\t!!odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,\n\t\t\t\t0x1ed /* \"Share link should be present\" */,\n\t\t\t);\n\n\t\t\tconst encodedShareUrl = getEncodedShareUrl(\n\t\t\t\todspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,\n\t\t\t);\n\n\t\t\tlet redeemUrl: string | undefined;\n\t\t\tasync function callSharesAPI(baseUrl: string): Promise<void> {\n\t\t\t\tawait getWithRetryForTokenRefresh(async (tokenFetchOptions) => {\n\t\t\t\t\t// IMPORTANT: Note that redeemUrl has '/driveItem' in it. Technically it is not required for executing redeem operation.\n\t\t\t\t\t// However, we have other cases that use '/shares' API and do require to specify '/driveItem' in order to get specific\n\t\t\t\t\t// drive item properties. The reason this matters is when caller of this API must possess logical permissions to call\n\t\t\t\t\t// this API (for instance, this will be the case when call is made with app-only token) then two separate logical\n\t\t\t\t\t// permissions are needed for the '/shares' call with and without '/driveItem'.\n\t\t\t\t\tredeemUrl = `${baseUrl}/_api/v2.0/shares/${encodedShareUrl}/driveItem`;\n\t\t\t\t\tconst url = redeemUrl;\n\t\t\t\t\tconst method = \"GET\";\n\t\t\t\t\tconst authHeader = await getAuthHeader(\n\t\t\t\t\t\t{ ...tokenFetchOptions, request: { url, method } },\n\t\t\t\t\t\t\"RedeemShareLink\",\n\t\t\t\t\t);\n\t\t\t\t\tconst headers = getHeadersWithAuth(authHeader);\n\t\t\t\t\theaders.prefer = \"redeemSharingLink\";\n\t\t\t\t\tawait fetchAndParseAsJSONHelper(url, { headers, method });\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst details = JSON.stringify({\n\t\t\t\tlength: redeemUrl?.length,\n\t\t\t\tshareLinkUrlLength: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem.length,\n\t\t\t\tqueryParamsLength: new URL(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem).search\n\t\t\t\t\t.length,\n\t\t\t\tuseHeaders: true,\n\t\t\t});\n\t\t\t// There is an issue where if we use the siteUrl in /shares, then the allowed length of url is just a few hundred characters(300-400)\n\t\t\t// and we fail to do the redeem. But if we use the tenant domain in the url, then the allowed length becomes 2048. So,\n\t\t\t// construct the url for /shares using tenant domain. We get tenant domain by getting origin of the siteUrl.\n\t\t\ttry {\n\t\t\t\tawait callSharesAPI(new URL(odspResolvedUrl.siteUrl).origin);\n\t\t\t\tevent.end({ details });\n\t\t\t} catch (error) {\n\t\t\t\tevent.cancel({ details }, error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t);\n}\n\nasync function fetchLatestSnapshotCore(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\tfinalOdspResolvedUrl: IOdspResolvedUrl,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\ttokenFetchOptions: TokenFetchOptionsEx,\n\t\tloadingGroupIds: string[] | undefined,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tcontroller?: AbortController,\n\t) => Promise<ISnapshotRequestAndResponseOptions>,\n\tputInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>,\n\tloadingGroupIds: string[] | undefined,\n\tenableRedeemFallback?: boolean,\n): Promise<ISnapshot> {\n\treturn getWithRetryForTokenRefresh(async (tokenFetchOptions) => {\n\t\tconst fetchSnapshotForLoadingGroup = isSnapshotFetchForLoadingGroup(loadingGroupIds);\n\t\tconst eventName = fetchSnapshotForLoadingGroup ? \"TreesLatestForGroup\" : \"TreesLatest\";\n\t\tconst internalFarmType = checkForKnownServerFarmType(odspResolvedUrl.siteUrl);\n\n\t\tconst perfEvent = {\n\t\t\teventName,\n\t\t\tattempts: tokenFetchOptions.refresh ? 2 : 1,\n\t\t\tshareLinkPresent: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem !== undefined,\n\t\t\tisSummarizer: odspResolvedUrl.summarizer,\n\t\t\tredeemFallbackEnabled: enableRedeemFallback,\n\t\t\tdetails: {\n\t\t\t\tinternalFarmType,\n\t\t\t},\n\t\t};\n\t\tif (snapshotOptions !== undefined) {\n\t\t\tfor (const [key, value] of Object.entries(snapshotOptions)) {\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tperfEvent[`snapshotOption_${key}`] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// This event measures only successful cases of getLatest call (no tokens, no retries).\n\t\treturn PerformanceEvent.timedExecAsync(logger, perfEvent, async (event) => {\n\t\t\tlet controller: AbortController | undefined;\n\t\t\tlet fetchTimeout: ReturnType<typeof setTimeout> | undefined;\n\t\t\tif (snapshotOptions?.timeout !== undefined) {\n\t\t\t\tcontroller = new AbortController();\n\t\t\t\tfetchTimeout = setTimeout(() => controller!.abort(), snapshotOptions.timeout);\n\t\t\t}\n\n\t\t\tconst [response, fetchTime] = await measureP(async () =>\n\t\t\t\tsnapshotDownloader(\n\t\t\t\t\todspResolvedUrl,\n\t\t\t\t\tgetAuthHeader,\n\t\t\t\t\ttokenFetchOptions,\n\t\t\t\t\tloadingGroupIds,\n\t\t\t\t\tsnapshotOptions,\n\t\t\t\t\tcontroller,\n\t\t\t\t),\n\t\t\t).finally(() => {\n\t\t\t\t// Clear the fetchTimeout once the response is fetched.\n\t\t\t\tif (fetchTimeout !== undefined) {\n\t\t\t\t\tclearTimeout(fetchTimeout);\n\t\t\t\t\tfetchTimeout = undefined;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst odspResponse = response.odspResponse;\n\t\t\tconst contentType = odspResponse.headers.get(\"content-type\");\n\n\t\t\tconst propsToLog: DriverErrorTelemetryProps = {\n\t\t\t\t...odspResponse.propsToLog,\n\t\t\t\tcontentType,\n\t\t\t\taccept: response.requestHeaders.accept,\n\t\t\t\tdriverVersion: pkgVersion,\n\t\t\t};\n\n\t\t\tlet parsedSnapshotContents: IOdspResponse<ISnapshotContentsWithProps> | undefined;\n\t\t\tlet contentTypeToRead: string | undefined;\n\t\t\tif (contentType?.includes(\"application/ms-fluid\")) {\n\t\t\t\tcontentTypeToRead = \"application/ms-fluid\";\n\t\t\t} else if (contentType?.includes(\"application/json\")) {\n\t\t\t\tcontentTypeToRead = \"application/json\";\n\t\t\t}\n\n\t\t\tlet parseTime: number;\n\t\t\tlet receiveContentTime: number;\n\t\t\ttry {\n\t\t\t\tswitch (contentTypeToRead) {\n\t\t\t\t\tcase \"application/json\": {\n\t\t\t\t\t\tlet text: string;\n\t\t\t\t\t\t[text, receiveContentTime] = await measureP(async () =>\n\t\t\t\t\t\t\todspResponse.content\n\t\t\t\t\t\t\t\t.text()\n\t\t\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\t\t\tif (res.length === 0) {\n\t\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\t\"Response from browser is empty\",\n\t\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.catch((error) =>\n\t\t\t\t\t\t\t\t\t// Parsing can fail and message could contain full request URI, including\n\t\t\t\t\t\t\t\t\t// tokens, etc. So do not log error object itself.\n\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\"Error while parsing fetch response\",\n\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpropsToLog.bodySize = text.length;\n\t\t\t\t\t\tlet content: IOdspSnapshot;\n\t\t\t\t\t\t[content, parseTime] = measure(() => JSON.parse(text) as IOdspSnapshot);\n\t\t\t\t\t\tvalidateBlobsAndTrees(content);\n\t\t\t\t\t\tconst snapshotContents: ISnapshot =\n\t\t\t\t\t\t\tconvertOdspSnapshotToSnapshotTreeAndBlobs(content);\n\t\t\t\t\t\tparsedSnapshotContents = {\n\t\t\t\t\t\t\t...odspResponse,\n\t\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t\t...snapshotContents,\n\t\t\t\t\t\t\t\ttelemetryProps: {},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"application/ms-fluid\": {\n\t\t\t\t\t\tlet content: ArrayBuffer;\n\t\t\t\t\t\t[content, receiveContentTime] = await measureP(async () =>\n\t\t\t\t\t\t\todspResponse.content\n\t\t\t\t\t\t\t\t.arrayBuffer()\n\t\t\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\t\t\tif (res.byteLength === 0) {\n\t\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\t\"Response from browser is empty\",\n\t\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.catch((error) =>\n\t\t\t\t\t\t\t\t\t// Parsing can fail and message could contain full request URI, including\n\t\t\t\t\t\t\t\t\t// tokens, etc. So do not log error object itself.\n\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\"Error while parsing fetch response\",\n\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpropsToLog.bodySize = content.byteLength;\n\t\t\t\t\t\tlet snapshotContents: ISnapshotContentsWithProps;\n\t\t\t\t\t\t[snapshotContents, parseTime] = measure(() =>\n\t\t\t\t\t\t\tparseCompactSnapshotResponse(new Uint8Array(content), logger),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsnapshotContents.snapshotTree.trees === undefined ||\n\t\t\t\t\t\t\tsnapshotContents.snapshotTree.blobs === undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\t\t\"Returned odsp snapshot is malformed. No trees or blobs!\",\n\t\t\t\t\t\t\t\tOdspErrorTypes.incorrectServerResponse,\n\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst props = snapshotContents.telemetryProps;\n\t\t\t\t\t\tconst slowTreeParseCodePaths = props.slowTreeStructureCount ?? 0;\n\t\t\t\t\t\tconst slowBlobParseCodePaths = props.slowBlobStructureCount ?? 0;\n\t\t\t\t\t\tconst treeStructureCountWithGroupId = props.treeStructureCountWithGroupId ?? 0;\n\t\t\t\t\t\t// As trees with groupId go through normal parsing, so exclude them.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tslowTreeParseCodePaths - treeStructureCountWithGroupId > 10 ||\n\t\t\t\t\t\t\tslowBlobParseCodePaths > 10\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\t\t\t\teventName: \"SlowSnapshotParseCodePaths\",\n\t\t\t\t\t\t\t\tslowTreeStructureCount: slowTreeParseCodePaths,\n\t\t\t\t\t\t\t\tslowBlobStructureCount: slowBlobParseCodePaths,\n\t\t\t\t\t\t\t\ttreeStructureCountWithGroupId,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparsedSnapshotContents = { ...odspResponse, content: snapshotContents };\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\t\"Unknown snapshot content type\",\n\t\t\t\t\t\t\tOdspErrorTypes.incorrectServerResponse,\n\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (isFluidError(error)) {\n\t\t\t\t\terror.addTelemetryProperties(propsToLog);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tconst enhancedError = wrapError(\n\t\t\t\t\terror,\n\t\t\t\t\t(errorMessage) =>\n\t\t\t\t\t\tnew NonRetryableError(\n\t\t\t\t\t\t\t`Error parsing snapshot response: ${errorMessage}`,\n\t\t\t\t\t\t\tOdspErrorTypes.genericError,\n\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tthrow enhancedError;\n\t\t\t}\n\n\t\t\tassert(parsedSnapshotContents !== undefined, 0x312 /* snapshot should be parsed */);\n\t\t\tconst snapshot = parsedSnapshotContents.content;\n\n\t\t\t// There are some scenarios in ODSP where we cannot cache, trees/latest will explicitly tell us when we\n\t\t\t// cannot cache using an HTTP response header. Only cache snapshot if it is not for a loading group.\n\t\t\tconst canCache =\n\t\t\t\todspResponse.headers.get(\"disablebrowsercachingofusercontent\") !== \"true\" &&\n\t\t\t\t!fetchSnapshotForLoadingGroup;\n\t\t\tconst sequenceNumber: number = snapshot.sequenceNumber ?? 0;\n\t\t\tconst seqNumberFromOps =\n\t\t\t\tsnapshot.ops && snapshot.ops.length > 0\n\t\t\t\t\t? snapshot.ops[0].sequenceNumber - 1\n\t\t\t\t\t: undefined;\n\n\t\t\tif (\n\t\t\t\t!Number.isInteger(sequenceNumber) ||\n\t\t\t\t(seqNumberFromOps !== undefined && seqNumberFromOps !== sequenceNumber)\n\t\t\t) {\n\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\teventName: \"fetchSnapshotError\",\n\t\t\t\t\tsequenceNumber,\n\t\t\t\t\tseqNumberFromOps,\n\t\t\t\t});\n\t\t\t\tsnapshot.sequenceNumber = undefined;\n\t\t\t} else if (canCache) {\n\t\t\t\tconst fluidEpoch = odspResponse.headers.get(\"x-fluid-epoch\");\n\t\t\t\tassert(fluidEpoch !== undefined, 0x1e6 /* \"Epoch should be present in response\" */);\n\t\t\t\tconst value: ISnapshotCachedEntry2 = {\n\t\t\t\t\t...snapshot,\n\t\t\t\t\tcacheEntryTime: Date.now(),\n\t\t\t\t};\n\t\t\t\tconst valueWithEpoch: IVersionedValueWithEpoch = {\n\t\t\t\t\tvalue,\n\t\t\t\t\tfluidEpoch,\n\t\t\t\t\tversion: persistedCacheValueVersion,\n\t\t\t\t};\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tputInCache(valueWithEpoch);\n\t\t\t}\n\n\t\t\tevent.end({\n\t\t\t\t// trees, leafTrees, blobNodes, encodedBlobsSize,\n\t\t\t\t// blobNodes - blobs tells us (roughly) how many blobs are deduped by service.\n\t\t\t\t...getTreeStats(snapshot),\n\t\t\t\tblobs: snapshot.blobContents?.size ?? 0,\n\t\t\t\tsequenceNumber,\n\t\t\t\tops: snapshot.ops?.length ?? 0,\n\t\t\t\tfetchSnapshotForLoadingGroup,\n\t\t\t\tuseLegacyFlowWithoutGroups:\n\t\t\t\t\tuseLegacyFlowWithoutGroupsForSnapshotFetch(loadingGroupIds),\n\t\t\t\tuserOps: snapshot.ops?.filter((op) => isRuntimeMessage(op)).length ?? 0,\n\t\t\t\t// Measures time to make fetch call. Should be similar to\n\t\t\t\t// fetchStartToResponseEndTime - receiveContentTime, i.e. it looks like it's time till first byte /\n\t\t\t\t// end of response headers\n\t\t\t\tfetchTime,\n\t\t\t\t// time it takes client to parse payload. Same payload as in \"SnapshotParse\" event, here for\n\t\t\t\t// easier analyzes.\n\t\t\t\tparseTime,\n\t\t\t\t// Time it takes to receive content (text of buffer) from Response object.\n\t\t\t\t// This time likely is very closely correlated with networkTime, i.e. time it takes to receive\n\t\t\t\t// actual content (starting measuring from first bite / end of response header)\n\t\t\t\treceiveContentTime,\n\t\t\t\t...getW3CData(response.requestUrl, \"fetch\"),\n\t\t\t\t// Sharing link telemetry regarding sharing link redeem status and performance. Ex: FRL; dur=100,\n\t\t\t\t// Azure Fluid Relay service; desc=S, FRP; desc=False. Here, FRL is the duration taken for redeem,\n\t\t\t\t// Azure Fluid Relay service is the redeem status (S means success), and FRP is a flag to indicate\n\t\t\t\t// if the permission has changed.\n\t\t\t\tsltelemetry: odspResponse.headers.get(\"x-fluid-sltelemetry\"),\n\t\t\t\t// All other props\n\t\t\t\t...propsToLog,\n\t\t\t\t// Various perf counters and measures collected by binary parsing code:\n\t\t\t\t// slowTreeStructureCount, slowBlobStructureCount, durationStructure, durationStrings,\n\t\t\t\t// durationSnapshotTree, durationBlobs, etc.\n\t\t\t\t...parsedSnapshotContents.content.telemetryProps,\n\t\t\t});\n\t\t\treturn snapshot;\n\t\t}).catch((error) => {\n\t\t\t// We hit these errors in stress tests, under load\n\t\t\t// It's useful to try one more time in such case.\n\t\t\tif (\n\t\t\t\ttypeof error === \"object\" &&\n\t\t\t\terror !== null &&\n\t\t\t\t((error as Partial<IOdspError>).errorType === OdspErrorTypes.fetchFailure ||\n\t\t\t\t\t(error as Partial<IOdspError>).errorType === OdspErrorTypes.fetchTimeout)\n\t\t\t) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\terror[getWithRetryForTokenRefreshRepeat] = true;\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n\t});\n}\n\nexport interface ISnapshotRequestAndResponseOptions {\n\todspResponse: IOdspResponse<Response>;\n\trequestUrl: string;\n\trequestHeaders: { [index: string]: string };\n}\n\nfunction getFormBodyAndHeaders(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tauthHeader: string,\n\theaders?: { [index: string]: string },\n): {\n\tbody: string;\n\theaders: {\n\t\t[index: string]: string;\n\t};\n} {\n\tconst formBoundary = uuid();\n\tconst formParams: string[] = [];\n\tformParams.push(\n\t\t`--${formBoundary}`,\n\t\t`Authorization: ${authHeader}`,\n\t\t`X-HTTP-Method-Override: GET`,\n\t);\n\n\tif (headers !== undefined) {\n\t\tfor (const [key, value] of Object.entries(headers)) {\n\t\t\tif (value !== undefined) {\n\t\t\t\tformParams.push(`${key}: ${value}`);\n\t\t\t}\n\t\t}\n\t}\n\tif (odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem) {\n\t\tformParams.push(`sl: ${odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem}`);\n\t}\n\tformParams.push(`_post: 1`, `\\r\\n--${formBoundary}--`);\n\tconst postBody = formParams.join(\"\\r\\n\");\n\tconst header: { [index: string]: string } = {\n\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t};\n\treturn { body: postBody, headers: header };\n}\n\ninterface ITreeStats {\n\ttrees: number;\n\tleafTrees: number;\n\tblobNodes: number;\n}\n\nexport function getTreeStats(snapshot: ISnapshot): ITreeStats & { encodedBlobsSize: number } {\n\tconst stats: ITreeStats = {\n\t\ttrees: 0,\n\t\tleafTrees: 0,\n\t\tblobNodes: 0,\n\t};\n\tgetTreeStatsCore(snapshot.snapshotTree, stats);\n\tlet encodedBlobsSize = 0;\n\tfor (const [_, blobContent] of snapshot.blobContents) {\n\t\tencodedBlobsSize += blobContent.byteLength;\n\t}\n\treturn { ...stats, encodedBlobsSize };\n}\n\nexport function validateBlobsAndTrees(snapshot: IOdspSnapshot): void {\n\tassert(\n\t\tsnapshot.trees !== undefined,\n\t\t0x200 /* \"Returned odsp snapshot is malformed. No trees!\" */,\n\t);\n\tassert(\n\t\tsnapshot.blobs !== undefined,\n\t\t0x201 /* \"Returned odsp snapshot is malformed. No blobs!\" */,\n\t);\n}\n\nfunction getTreeStatsCore(snapshotTree: ISnapshotTree, stats: ITreeStats): void {\n\tstats.blobNodes += Object.entries(snapshotTree.blobs).length;\n\tstats.trees++;\n\n\tconst entries = Object.entries(snapshotTree.trees);\n\tif (entries.length === 0) {\n\t\tstats.leafTrees++;\n\t} else {\n\t\tfor (const [_, tree] of entries) {\n\t\t\tstats.trees++;\n\t\t\tgetTreeStatsCore(tree, stats);\n\t\t}\n\t}\n}\n\n/**\n * This function fetches the snapshot and parse it according to what is mentioned in response headers.\n * @param odspResolvedUrl - resolved odsp url.\n * @param storageToken - token to do the auth for network request.\n * @param snapshotOptions - Options used to specify how and what to fetch in the snapshot.\n * @param loadingGroupIds - loadingGroupIds for which snapshot needs to be downloaded. Note:\n * 1.) If undefined, then legacy trees latest call will be used where no groupId query param would be specified.\n * 2.) If [] is passed, then snapshot with all ungrouped data will be fetched.\n * 3.) If any groupId is specified like [\"g1\"], then snapshot for g1 group will be fetched.\n * @param snapshotFormatFetchType - Snapshot format to fetch.\n * @param controller - abort controller if caller needs to abort the network call.\n * @param epochTracker - epoch tracker used to add/validate epoch in the network call.\n * @returns fetched snapshot.\n */\nexport const downloadSnapshot = mockify(\n\tasync (\n\t\todspResolvedUrl: IOdspResolvedUrl,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\ttokenFetchOptions: TokenFetchOptionsEx,\n\t\tloadingGroupIds: string[] | undefined,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tsnapshotFormatFetchType?: SnapshotFormatSupportType,\n\t\tcontroller?: AbortController,\n\t\tepochTracker?: EpochTracker,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotRequestAndResponseOptions> => {\n\t\t// back-compat: This block to be removed with #8784 when we only consume/consider odsp resolvers that are >= 0.51\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n\t\tconst sharingLinkToRedeem = (odspResolvedUrl as any).sharingLinkToRedeem;\n\t\tif (sharingLinkToRedeem) {\n\t\t\todspResolvedUrl.shareLinkInfo = {\n\t\t\t\t...odspResolvedUrl.shareLinkInfo,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tsharingLinkToRedeem,\n\t\t\t};\n\t\t}\n\n\t\tconst snapshotUrl = odspResolvedUrl.endpoints.snapshotStorageUrl;\n\n\t\tconst queryParams: Record<string, unknown> = { ump: 1 };\n\t\tif (snapshotOptions !== undefined) {\n\t\t\tfor (const [key, value] of Object.entries(snapshotOptions)) {\n\t\t\t\t// Exclude \"timeout\" from query string\n\t\t\t\tif (value !== undefined && key !== \"timeout\") {\n\t\t\t\t\tqueryParams[key] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (loadingGroupIds !== undefined) {\n\t\t\tqueryParams.groupId = loadingGroupIds.join(\",\");\n\t\t}\n\n\t\tconst queryString = getQueryString(queryParams);\n\t\tconst url = `${snapshotUrl}/trees/latest${queryString}`;\n\t\tconst method = \"POST\";\n\t\t// The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.\n\t\t// Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.\n\t\t// This error thrown by server will contain the new redirect location. Look at the 404 error parsing\n\t\t// for further reference here: \\packages\\utils\\odsp-doclib-utils\\src\\odspErrorUtils.ts\n\t\tconst header = { prefer: \"manualredirect\" };\n\t\tconst authHeader = await getAuthHeader(\n\t\t\t{ ...tokenFetchOptions, request: { url, method } },\n\t\t\t\"downloadSnapshot\",\n\t\t);\n\t\tassert(authHeader !== null, 0x1e5 /* \"Storage token should not be null\" */);\n\t\tconst { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, authHeader, header);\n\t\tconst fetchOptions = {\n\t\t\tbody,\n\t\t\theaders,\n\t\t\tsignal: controller?.signal,\n\t\t\tmethod,\n\t\t};\n\t\t// Decide what snapshot format to fetch as per the feature gate.\n\t\tswitch (snapshotFormatFetchType) {\n\t\t\tcase SnapshotFormatSupportType.Binary: {\n\t\t\t\theaders.accept = `application/ms-fluid; v=${currentReadVersion}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// By default ask both versions and let the server decide the format.\n\t\t\t\theaders.accept = `application/json, application/ms-fluid; v=${currentReadVersion}`;\n\t\t\t}\n\t\t}\n\n\t\tconst odspResponse = await (epochTracker?.fetch(\n\t\t\turl,\n\t\t\tfetchOptions,\n\t\t\t\"treesLatest\",\n\t\t\ttrue,\n\t\t\tscenarioName,\n\t\t) ?? fetchHelper(url, fetchOptions));\n\n\t\treturn {\n\t\t\todspResponse,\n\t\t\trequestHeaders: headers,\n\t\t\trequestUrl: url,\n\t\t};\n\t},\n);\n\nfunction isRedeemSharingLinkError(\n\todspResolvedUrl: IOdspResolvedUrl,\n\terror: Partial<IOdspError>,\n): boolean {\n\tif (\n\t\todspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem !== undefined &&\n\t\ttypeof error === \"object\" &&\n\t\terror !== null &&\n\t\t(error.errorType === OdspErrorTypes.authorizationError ||\n\t\t\terror.errorType === OdspErrorTypes.fileNotFoundOrAccessDeniedError)\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction getEncodedShareUrl(url: string): string {\n\t/**\n\t * Encode the url to accepted format by Sharepoint\n\t * https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/shares_get\n\t */\n\tlet encodedUrl = fromUtf8ToBase64(encodeURI(url));\n\tencodedUrl = encodedUrl.replace(/=+$/g, \"\").replace(/\\//g, \"_\").replace(/\\+/g, \"-\");\n\tencodedUrl = \"u!\".concat(encodedUrl);\n\treturn encodedUrl;\n}\n"]}
1
+ {"version":3,"file":"fetchSnapshot.js","sourceRoot":"","sources":["../src/fetchSnapshot.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAgE;AAChE,kEAA6D;AAC7D,mEAAkE;AAElE,oEAI+C;AAC/C,yEAGoD;AACpD,+EAM0D;AAC1D,uEAKkD;AAClD,+BAAkC;AAElC,yEAIoC;AACpC,iDAKwB;AAExB,2DAAqD;AACrD,+EAAmE;AACnE,6CAAuC;AACvC,mEAAoF;AACpF,yDAAiE;AACjE,iDAWwB;AACxB,2DAAiD;AAEjD;;;;GAIG;AACH,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACpC,yEAAQ,CAAA;IACR,6EAAU,CAAA;IACV,2FAAiB,CAAA;AAClB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CAClC,WAAmB,EACnB,SAAiB,EACjB,iBAA0B,EAC1B,sCAA+C,EAC/C,MAA2B,EAC3B,kBAAoE;IAEpE,MAAM,IAAI,GAAG,UAAU,SAAS,EAAE,CAAC;IACnC,IAAI,WAAW,GAAqB,EAAE,CAAC;IAEvC,IAAI,iBAAiB,EAAE,CAAC;QACvB,WAAW,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC/E,CAAC;IAED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;YACjE,MAAM;QACP,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,qEAAqE;YACrE,OAAO,CAAC,MAAM,GAAG,6CAA6C,6CAAkB,EAAE,CAAC;QACpF,CAAC;IACF,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,KAAK,CAC9C,GAAG,EACH,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,YAAY,CACZ,IAAI,IAAA,0BAAW,EAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;IAErC,OAAO;QACN,YAAY;QACZ,cAAc,EAAE,OAAO;QACvB,UAAU,EAAE,GAAG;KACf,CAAC;AACH,CAAC,CACD,CAAC;AAEF,SAAS,wBAAwB,CAChC,eAAiC,EACjC,KAA0B;IAE1B,IACC,eAAe,CAAC,aAAa,EAAE,mBAAmB,KAAK,SAAS;QAChE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,KAAK,CAAC,SAAS,KAAK,yBAAc,CAAC,kBAAkB;YACrD,KAAK,CAAC,SAAS,KAAK,yBAAc,CAAC,+BAA+B,CAAC,EACnE,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAW;IACtC;;;OAGG;IACH,IAAI,UAAU,GAAG,IAAA,+BAAgB,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpF,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { getW3CData } from \"@fluidframework/driver-base/internal\";\nimport { ISnapshot, ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tDriverErrorTelemetryProps,\n\tNonRetryableError,\n\tisRuntimeMessage,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\tfetchIncorrectResponse,\n\tthrowOdspNetworkError,\n} from \"@fluidframework/odsp-doclib-utils/internal\";\nimport {\n\ttype IOdspError,\n\tIOdspResolvedUrl,\n\tISnapshotOptions,\n\tInstrumentedStorageTokenFetcher,\n\tOdspErrorTypes,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tPerformanceEvent,\n\tisFluidError,\n\twrapError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tISnapshotContentsWithProps,\n\tcurrentReadVersion,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\nimport {\n\tIOdspSnapshot,\n\tISnapshotCachedEntry2,\n\tIVersionedValueWithEpoch,\n\tpersistedCacheValueVersion,\n} from \"./contracts.js\";\nimport { EpochTracker } from \"./epochTracker.js\";\nimport { getQueryString } from \"./getQueryString.js\";\nimport { getHeadersWithAuth } from \"./getUrlAndHeadersWithAuth.js\";\nimport { mockify } from \"./mockify.js\";\nimport { convertOdspSnapshotToSnapshotTreeAndBlobs } from \"./odspSnapshotParser.js\";\nimport { checkForKnownServerFarmType } from \"./odspUrlHelper.js\";\nimport {\n\tIOdspResponse,\n\tfetchAndParseAsJSONHelper,\n\tfetchHelper,\n\tgetWithRetryForTokenRefresh,\n\tgetWithRetryForTokenRefreshRepeat,\n\tisSnapshotFetchForLoadingGroup,\n\tmeasure,\n\tmeasureP,\n\tuseLegacyFlowWithoutGroupsForSnapshotFetch,\n\ttype TokenFetchOptionsEx,\n} from \"./odspUtils.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Enum to support different types of snapshot formats.\n * @legacy\n * @alpha\n */\nexport enum SnapshotFormatSupportType {\n\tJson = 0,\n\tBinary = 1,\n\tJsonAndBinary = 2,\n}\n\n/**\n * Fetches a snapshot from the server with a given version id.\n * @param snapshotUrl - snapshot url from where the odsp snapshot will be fetched\n * @param versionId - id of specific snapshot to be fetched\n * @param fetchFullSnapshot - whether we want to fetch full snapshot(with blobs)\n * @param forceAccessTokenViaAuthorizationHeader - Deprecated and not used, true value always used instead. Whether to force passing given token via authorization header\n * @param snapshotDownloader - Implementation of the get/post methods used to fetch the snapshot. snapshotDownloader is responsible for generating the appropriate headers (including Authorization header) as well as handling any token refreshes before retrying.\n * @returns A promise of the snapshot and the status code of the response\n */\nexport async function fetchSnapshot(\n\tsnapshotUrl: string,\n\tversionId: string,\n\tfetchFullSnapshot: boolean,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (url: string) => Promise<IOdspResponse<unknown>>,\n): Promise<ISnapshot> {\n\tconst path = `/trees/${versionId}`;\n\tlet queryParams: ISnapshotOptions = {};\n\n\tif (fetchFullSnapshot) {\n\t\tqueryParams = versionId === \"latest\" ? { deltas: 1, blobs: 2 } : { blobs: 2 };\n\t}\n\n\tconst queryString = getQueryString(queryParams);\n\tconst url = `${snapshotUrl}${path}${queryString}`;\n\tconst response = (await PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{\n\t\t\teventName: \"fetchSnapshot\",\n\t\t},\n\t\tasync () => snapshotDownloader(url),\n\t)) as IOdspResponse<IOdspSnapshot>;\n\treturn convertOdspSnapshotToSnapshotTreeAndBlobs(response.content);\n}\n\nexport async function fetchSnapshotWithRedeem(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tstorageTokenFetcher: InstrumentedStorageTokenFetcher,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tforceAccessTokenViaAuthorizationHeader: boolean,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\tfinalOdspResolvedUrl: IOdspResolvedUrl,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\ttokenFetchOptions: TokenFetchOptionsEx,\n\t\tloadingGroupIds: string[] | undefined,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tcontroller?: AbortController,\n\t) => Promise<ISnapshotRequestAndResponseOptions>,\n\tputInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>,\n\tremoveEntries: () => Promise<void>,\n\tloadingGroupIds: string[] | undefined,\n\tenableRedeemFallback?: boolean,\n): Promise<ISnapshot> {\n\t// back-compat: This block to be removed with #8784 when we only consume/consider odsp resolvers that are >= 0.51\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n\tconst sharingLinkToRedeem = (odspResolvedUrl as any).sharingLinkToRedeem;\n\tif (sharingLinkToRedeem) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\todspResolvedUrl.shareLinkInfo = { ...odspResolvedUrl.shareLinkInfo, sharingLinkToRedeem };\n\t}\n\n\treturn fetchLatestSnapshotCore(\n\t\todspResolvedUrl,\n\t\tstorageTokenFetcher,\n\t\tsnapshotOptions,\n\t\tlogger,\n\t\tsnapshotDownloader,\n\t\tputInCache,\n\t\tloadingGroupIds,\n\t\tenableRedeemFallback,\n\t)\n\t\t.catch(async (error) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tif (enableRedeemFallback && isRedeemSharingLinkError(odspResolvedUrl, error)) {\n\t\t\t\t// Execute the redeem fallback\n\t\t\t\tawait redeemSharingLink(odspResolvedUrl, storageTokenFetcher, logger);\n\n\t\t\t\tconst odspResolvedUrlWithoutShareLink: IOdspResolvedUrl = {\n\t\t\t\t\t...odspResolvedUrl,\n\t\t\t\t\tshareLinkInfo: {\n\t\t\t\t\t\t...odspResolvedUrl.shareLinkInfo,\n\t\t\t\t\t\tsharingLinkToRedeem: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\t// Log initial failure only if redeem succeeded - it points out to some bug somewhere\n\t\t\t\t// If redeem failed, that most likely means user has no permissions to access a file,\n\t\t\t\t// and thus it's not worth it logging extra errors - same error will be logged by end-to-end\n\t\t\t\t// flow (container open) based on a failure above.\n\t\t\t\tlogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"RedeemFallback\",\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\t\terrorType: error.errorType,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn fetchLatestSnapshotCore(\n\t\t\t\t\todspResolvedUrlWithoutShareLink,\n\t\t\t\t\tstorageTokenFetcher,\n\t\t\t\t\tsnapshotOptions,\n\t\t\t\t\tlogger,\n\t\t\t\t\tsnapshotDownloader,\n\t\t\t\t\tputInCache,\n\t\t\t\t\tloadingGroupIds,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})\n\t\t.catch(async (error) => {\n\t\t\t// Clear the cache on 401/403/404 on snapshot fetch from network because this means either the user doesn't\n\t\t\t// have permissions for the file or it was deleted. So, if we do not clear cache, we will continue fetching\n\t\t\t// snapshot from cache in the future.\n\t\t\tif (\n\t\t\t\t(typeof error === \"object\" &&\n\t\t\t\t\terror !== null &&\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\terror.errorType === OdspErrorTypes.authorizationError) ||\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\terror.errorType === OdspErrorTypes.fileNotFoundOrAccessDeniedError\n\t\t\t) {\n\t\t\t\tawait removeEntries();\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n}\n\nasync function redeemSharingLink(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\tlogger: ITelemetryLoggerExt,\n): Promise<void> {\n\tawait PerformanceEvent.timedExecAsync(\n\t\tlogger,\n\t\t{\n\t\t\teventName: \"RedeemShareLink\",\n\t\t},\n\t\tasync (event) => {\n\t\t\tassert(\n\t\t\t\t!!odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,\n\t\t\t\t0x1ed /* \"Share link should be present\" */,\n\t\t\t);\n\n\t\t\tconst encodedShareUrl = getEncodedShareUrl(\n\t\t\t\todspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,\n\t\t\t);\n\n\t\t\tconst isRedemptionNonDurable: boolean =\n\t\t\t\todspResolvedUrl.shareLinkInfo?.isRedemptionNonDurable === true;\n\n\t\t\tlet redeemUrl: string | undefined;\n\t\t\tasync function callSharesAPI(baseUrl: string): Promise<void> {\n\t\t\t\tawait getWithRetryForTokenRefresh(async (tokenFetchOptions) => {\n\t\t\t\t\t// IMPORTANT: Note that redeemUrl has '/driveItem' in it. Technically it is not required for executing redeem operation.\n\t\t\t\t\t// However, we have other cases that use '/shares' API and do require to specify '/driveItem' in order to get specific\n\t\t\t\t\t// drive item properties. The reason this matters is when caller of this API must possess logical permissions to call\n\t\t\t\t\t// this API (for instance, this will be the case when call is made with app-only token) then two separate logical\n\t\t\t\t\t// permissions are needed for the '/shares' call with and without '/driveItem'.\n\t\t\t\t\tredeemUrl = `${baseUrl}/_api/v2.0/shares/${encodedShareUrl}/driveItem`;\n\t\t\t\t\tconst url = redeemUrl;\n\t\t\t\t\tconst method = \"GET\";\n\t\t\t\t\tconst authHeader = await getAuthHeader(\n\t\t\t\t\t\t{ ...tokenFetchOptions, request: { url, method } },\n\t\t\t\t\t\t\"RedeemShareLink\",\n\t\t\t\t\t);\n\t\t\t\t\tconst headers = getHeadersWithAuth(authHeader);\n\t\t\t\t\theaders.prefer = isRedemptionNonDurable ? \"nonDurableRedeem\" : \"redeemSharingLink\";\n\t\t\t\t\tawait fetchAndParseAsJSONHelper(url, { headers, method });\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst details = JSON.stringify({\n\t\t\t\tlength: redeemUrl?.length,\n\t\t\t\tshareLinkUrlLength: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem.length,\n\t\t\t\tqueryParamsLength: new URL(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem).search\n\t\t\t\t\t.length,\n\t\t\t\tuseHeaders: true,\n\t\t\t\tisRedemptionNonDurable,\n\t\t\t});\n\t\t\t// There is an issue where if we use the siteUrl in /shares, then the allowed length of url is just a few hundred characters(300-400)\n\t\t\t// and we fail to do the redeem. But if we use the tenant domain in the url, then the allowed length becomes 2048. So,\n\t\t\t// construct the url for /shares using tenant domain. We get tenant domain by getting origin of the siteUrl.\n\t\t\ttry {\n\t\t\t\tawait callSharesAPI(new URL(odspResolvedUrl.siteUrl).origin);\n\t\t\t\tevent.end({ details });\n\t\t\t} catch (error) {\n\t\t\t\tevent.cancel({ details }, error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t);\n}\n\nasync function fetchLatestSnapshotCore(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\tsnapshotOptions: ISnapshotOptions | undefined,\n\tlogger: ITelemetryLoggerExt,\n\tsnapshotDownloader: (\n\t\tfinalOdspResolvedUrl: IOdspResolvedUrl,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\ttokenFetchOptions: TokenFetchOptionsEx,\n\t\tloadingGroupIds: string[] | undefined,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tcontroller?: AbortController,\n\t) => Promise<ISnapshotRequestAndResponseOptions>,\n\tputInCache: (valueWithEpoch: IVersionedValueWithEpoch) => Promise<void>,\n\tloadingGroupIds: string[] | undefined,\n\tenableRedeemFallback?: boolean,\n): Promise<ISnapshot> {\n\treturn getWithRetryForTokenRefresh(async (tokenFetchOptions) => {\n\t\tconst fetchSnapshotForLoadingGroup = isSnapshotFetchForLoadingGroup(loadingGroupIds);\n\t\tconst eventName = fetchSnapshotForLoadingGroup ? \"TreesLatestForGroup\" : \"TreesLatest\";\n\t\tconst internalFarmType = checkForKnownServerFarmType(odspResolvedUrl.siteUrl);\n\t\tconst isRedemptionNonDurable: boolean =\n\t\t\todspResolvedUrl.shareLinkInfo?.isRedemptionNonDurable === true;\n\n\t\tconst perfEvent = {\n\t\t\teventName,\n\t\t\tattempts: tokenFetchOptions.refresh ? 2 : 1,\n\t\t\tshareLinkPresent: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem !== undefined,\n\t\t\tisSummarizer: odspResolvedUrl.summarizer,\n\t\t\tredeemFallbackEnabled: enableRedeemFallback,\n\t\t\tdetails: {\n\t\t\t\tinternalFarmType,\n\t\t\t\t// Whether the redemption used is non-durable or not.\n\t\t\t\tisRedemptionNonDurable,\n\t\t\t},\n\t\t};\n\t\tif (snapshotOptions !== undefined) {\n\t\t\tfor (const [key, value] of Object.entries(snapshotOptions)) {\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tperfEvent[`snapshotOption_${key}`] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// This event measures only successful cases of getLatest call (no tokens, no retries).\n\t\treturn PerformanceEvent.timedExecAsync(logger, perfEvent, async (event) => {\n\t\t\tlet controller: AbortController | undefined;\n\t\t\tlet fetchTimeout: ReturnType<typeof setTimeout> | undefined;\n\t\t\tif (snapshotOptions?.timeout !== undefined) {\n\t\t\t\tcontroller = new AbortController();\n\t\t\t\tfetchTimeout = setTimeout(() => controller!.abort(), snapshotOptions.timeout);\n\t\t\t}\n\n\t\t\tconst [response, fetchTime] = await measureP(async () =>\n\t\t\t\tsnapshotDownloader(\n\t\t\t\t\todspResolvedUrl,\n\t\t\t\t\tgetAuthHeader,\n\t\t\t\t\ttokenFetchOptions,\n\t\t\t\t\tloadingGroupIds,\n\t\t\t\t\tsnapshotOptions,\n\t\t\t\t\tcontroller,\n\t\t\t\t),\n\t\t\t).finally(() => {\n\t\t\t\t// Clear the fetchTimeout once the response is fetched.\n\t\t\t\tif (fetchTimeout !== undefined) {\n\t\t\t\t\tclearTimeout(fetchTimeout);\n\t\t\t\t\tfetchTimeout = undefined;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst odspResponse = response.odspResponse;\n\t\t\tconst contentType = odspResponse.headers.get(\"content-type\");\n\n\t\t\tconst propsToLog: DriverErrorTelemetryProps = {\n\t\t\t\t...odspResponse.propsToLog,\n\t\t\t\tcontentType,\n\t\t\t\taccept: response.requestHeaders.accept,\n\t\t\t\tdriverVersion: pkgVersion,\n\t\t\t};\n\n\t\t\tlet parsedSnapshotContents: IOdspResponse<ISnapshotContentsWithProps> | undefined;\n\t\t\tlet contentTypeToRead: string | undefined;\n\t\t\tif (contentType?.includes(\"application/ms-fluid\")) {\n\t\t\t\tcontentTypeToRead = \"application/ms-fluid\";\n\t\t\t} else if (contentType?.includes(\"application/json\")) {\n\t\t\t\tcontentTypeToRead = \"application/json\";\n\t\t\t}\n\n\t\t\tlet parseTime: number;\n\t\t\tlet receiveContentTime: number;\n\t\t\ttry {\n\t\t\t\tswitch (contentTypeToRead) {\n\t\t\t\t\tcase \"application/json\": {\n\t\t\t\t\t\tlet text: string;\n\t\t\t\t\t\t[text, receiveContentTime] = await measureP(async () =>\n\t\t\t\t\t\t\todspResponse.content\n\t\t\t\t\t\t\t\t.text()\n\t\t\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\t\t\tif (res.length === 0) {\n\t\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\t\"Response from browser is empty\",\n\t\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.catch((error) =>\n\t\t\t\t\t\t\t\t\t// Parsing can fail and message could contain full request URI, including\n\t\t\t\t\t\t\t\t\t// tokens, etc. So do not log error object itself.\n\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\"Error while parsing fetch response\",\n\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpropsToLog.bodySize = text.length;\n\t\t\t\t\t\tlet content: IOdspSnapshot;\n\t\t\t\t\t\t[content, parseTime] = measure(() => JSON.parse(text) as IOdspSnapshot);\n\t\t\t\t\t\tvalidateBlobsAndTrees(content);\n\t\t\t\t\t\tconst snapshotContents: ISnapshot =\n\t\t\t\t\t\t\tconvertOdspSnapshotToSnapshotTreeAndBlobs(content);\n\t\t\t\t\t\tparsedSnapshotContents = {\n\t\t\t\t\t\t\t...odspResponse,\n\t\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t\t...snapshotContents,\n\t\t\t\t\t\t\t\ttelemetryProps: {},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"application/ms-fluid\": {\n\t\t\t\t\t\tlet content: ArrayBuffer;\n\t\t\t\t\t\t[content, receiveContentTime] = await measureP(async () =>\n\t\t\t\t\t\t\todspResponse.content\n\t\t\t\t\t\t\t\t.arrayBuffer()\n\t\t\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\t\t\tif (res.byteLength === 0) {\n\t\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\t\"Response from browser is empty\",\n\t\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.catch((error) =>\n\t\t\t\t\t\t\t\t\t// Parsing can fail and message could contain full request URI, including\n\t\t\t\t\t\t\t\t\t// tokens, etc. So do not log error object itself.\n\t\t\t\t\t\t\t\t\tthrowOdspNetworkError(\n\t\t\t\t\t\t\t\t\t\t\"Error while parsing fetch response\",\n\t\t\t\t\t\t\t\t\t\tfetchIncorrectResponse,\n\t\t\t\t\t\t\t\t\t\todspResponse.content, // response\n\t\t\t\t\t\t\t\t\t\tundefined, // response text\n\t\t\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tpropsToLog.bodySize = content.byteLength;\n\t\t\t\t\t\tlet snapshotContents: ISnapshotContentsWithProps;\n\t\t\t\t\t\t[snapshotContents, parseTime] = measure(() =>\n\t\t\t\t\t\t\tparseCompactSnapshotResponse(new Uint8Array(content), logger),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsnapshotContents.snapshotTree.trees === undefined ||\n\t\t\t\t\t\t\tsnapshotContents.snapshotTree.blobs === undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\t\t\"Returned odsp snapshot is malformed. No trees or blobs!\",\n\t\t\t\t\t\t\t\tOdspErrorTypes.incorrectServerResponse,\n\t\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst props = snapshotContents.telemetryProps;\n\t\t\t\t\t\tconst slowTreeParseCodePaths = props.slowTreeStructureCount ?? 0;\n\t\t\t\t\t\tconst slowBlobParseCodePaths = props.slowBlobStructureCount ?? 0;\n\t\t\t\t\t\tconst treeStructureCountWithGroupId = props.treeStructureCountWithGroupId ?? 0;\n\t\t\t\t\t\t// As trees with groupId go through normal parsing, so exclude them.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tslowTreeParseCodePaths - treeStructureCountWithGroupId > 10 ||\n\t\t\t\t\t\t\tslowBlobParseCodePaths > 10\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\t\t\t\teventName: \"SlowSnapshotParseCodePaths\",\n\t\t\t\t\t\t\t\tslowTreeStructureCount: slowTreeParseCodePaths,\n\t\t\t\t\t\t\t\tslowBlobStructureCount: slowBlobParseCodePaths,\n\t\t\t\t\t\t\t\ttreeStructureCountWithGroupId,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparsedSnapshotContents = { ...odspResponse, content: snapshotContents };\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new NonRetryableError(\n\t\t\t\t\t\t\t\"Unknown snapshot content type\",\n\t\t\t\t\t\t\tOdspErrorTypes.incorrectServerResponse,\n\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (isFluidError(error)) {\n\t\t\t\t\terror.addTelemetryProperties(propsToLog);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tconst enhancedError = wrapError(\n\t\t\t\t\terror,\n\t\t\t\t\t(errorMessage) =>\n\t\t\t\t\t\tnew NonRetryableError(\n\t\t\t\t\t\t\t`Error parsing snapshot response: ${errorMessage}`,\n\t\t\t\t\t\t\tOdspErrorTypes.genericError,\n\t\t\t\t\t\t\tpropsToLog,\n\t\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tthrow enhancedError;\n\t\t\t}\n\n\t\t\tassert(parsedSnapshotContents !== undefined, 0x312 /* snapshot should be parsed */);\n\t\t\tconst snapshot = parsedSnapshotContents.content;\n\n\t\t\t// There are some scenarios in ODSP where we cannot cache, trees/latest will explicitly tell us when we\n\t\t\t// cannot cache using an HTTP response header. Only cache snapshot if it is not for a loading group.\n\t\t\tconst canCache =\n\t\t\t\todspResponse.headers.get(\"disablebrowsercachingofusercontent\") !== \"true\" &&\n\t\t\t\t!fetchSnapshotForLoadingGroup;\n\t\t\tconst sequenceNumber: number = snapshot.sequenceNumber ?? 0;\n\t\t\tconst seqNumberFromOps =\n\t\t\t\tsnapshot.ops && snapshot.ops.length > 0\n\t\t\t\t\t? snapshot.ops[0].sequenceNumber - 1\n\t\t\t\t\t: undefined;\n\n\t\t\tif (\n\t\t\t\t!Number.isInteger(sequenceNumber) ||\n\t\t\t\t(seqNumberFromOps !== undefined && seqNumberFromOps !== sequenceNumber)\n\t\t\t) {\n\t\t\t\tlogger.sendErrorEvent({\n\t\t\t\t\teventName: \"fetchSnapshotError\",\n\t\t\t\t\tsequenceNumber,\n\t\t\t\t\tseqNumberFromOps,\n\t\t\t\t});\n\t\t\t\tsnapshot.sequenceNumber = undefined;\n\t\t\t} else if (canCache) {\n\t\t\t\tconst fluidEpoch = odspResponse.headers.get(\"x-fluid-epoch\");\n\t\t\t\tassert(fluidEpoch !== undefined, 0x1e6 /* \"Epoch should be present in response\" */);\n\t\t\t\tconst value: ISnapshotCachedEntry2 = {\n\t\t\t\t\t...snapshot,\n\t\t\t\t\tcacheEntryTime: Date.now(),\n\t\t\t\t};\n\t\t\t\tconst valueWithEpoch: IVersionedValueWithEpoch = {\n\t\t\t\t\tvalue,\n\t\t\t\t\tfluidEpoch,\n\t\t\t\t\tversion: persistedCacheValueVersion,\n\t\t\t\t};\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tputInCache(valueWithEpoch);\n\t\t\t}\n\n\t\t\tevent.end({\n\t\t\t\t// trees, leafTrees, blobNodes, encodedBlobsSize,\n\t\t\t\t// blobNodes - blobs tells us (roughly) how many blobs are deduped by service.\n\t\t\t\t...getTreeStats(snapshot),\n\t\t\t\tblobs: snapshot.blobContents?.size ?? 0,\n\t\t\t\tsequenceNumber,\n\t\t\t\tops: snapshot.ops?.length ?? 0,\n\t\t\t\tfetchSnapshotForLoadingGroup,\n\t\t\t\tuseLegacyFlowWithoutGroups:\n\t\t\t\t\tuseLegacyFlowWithoutGroupsForSnapshotFetch(loadingGroupIds),\n\t\t\t\tuserOps: snapshot.ops?.filter((op) => isRuntimeMessage(op)).length ?? 0,\n\t\t\t\t// Measures time to make fetch call. Should be similar to\n\t\t\t\t// fetchStartToResponseEndTime - receiveContentTime, i.e. it looks like it's time till first byte /\n\t\t\t\t// end of response headers\n\t\t\t\tfetchTime,\n\t\t\t\t// time it takes client to parse payload. Same payload as in \"SnapshotParse\" event, here for\n\t\t\t\t// easier analyzes.\n\t\t\t\tparseTime,\n\t\t\t\t// Time it takes to receive content (text of buffer) from Response object.\n\t\t\t\t// This time likely is very closely correlated with networkTime, i.e. time it takes to receive\n\t\t\t\t// actual content (starting measuring from first bite / end of response header)\n\t\t\t\treceiveContentTime,\n\t\t\t\t...getW3CData(response.requestUrl, \"fetch\"),\n\t\t\t\t// Sharing link telemetry regarding sharing link redeem status and performance. Ex: FRL; dur=100,\n\t\t\t\t// Azure Fluid Relay service; desc=S, FRP; desc=False. Here, FRL is the duration taken for redeem,\n\t\t\t\t// Azure Fluid Relay service is the redeem status (S means success), and FRP is a flag to indicate\n\t\t\t\t// if the permission has changed.\n\t\t\t\tsltelemetry: odspResponse.headers.get(\"x-fluid-sltelemetry\"),\n\t\t\t\t// All other props\n\t\t\t\t...propsToLog,\n\t\t\t\t// Various perf counters and measures collected by binary parsing code:\n\t\t\t\t// slowTreeStructureCount, slowBlobStructureCount, durationStructure, durationStrings,\n\t\t\t\t// durationSnapshotTree, durationBlobs, etc.\n\t\t\t\t...parsedSnapshotContents.content.telemetryProps,\n\t\t\t});\n\t\t\treturn snapshot;\n\t\t}).catch((error) => {\n\t\t\t// We hit these errors in stress tests, under load\n\t\t\t// It's useful to try one more time in such case.\n\t\t\tif (\n\t\t\t\ttypeof error === \"object\" &&\n\t\t\t\terror !== null &&\n\t\t\t\t((error as Partial<IOdspError>).errorType === OdspErrorTypes.fetchFailure ||\n\t\t\t\t\t(error as Partial<IOdspError>).errorType === OdspErrorTypes.fetchTimeout)\n\t\t\t) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\terror[getWithRetryForTokenRefreshRepeat] = true;\n\t\t\t}\n\t\t\tthrow error;\n\t\t});\n\t});\n}\n\nexport interface ISnapshotRequestAndResponseOptions {\n\todspResponse: IOdspResponse<Response>;\n\trequestUrl: string;\n\trequestHeaders: { [index: string]: string };\n}\n\nfunction getFormBodyAndHeaders(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tauthHeader: string,\n\theaders?: { [index: string]: string },\n): {\n\tbody: string;\n\theaders: {\n\t\t[index: string]: string;\n\t};\n} {\n\tconst formBoundary = uuid();\n\tconst formParams: string[] = [];\n\tformParams.push(\n\t\t`--${formBoundary}`,\n\t\t`Authorization: ${authHeader}`,\n\t\t`X-HTTP-Method-Override: GET`,\n\t);\n\n\tif (headers !== undefined) {\n\t\tfor (const [key, value] of Object.entries(headers)) {\n\t\t\tif (value !== undefined) {\n\t\t\t\tformParams.push(`${key}: ${value}`);\n\t\t\t}\n\t\t}\n\t}\n\tif (odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem) {\n\t\tformParams.push(`sl: ${odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem}`);\n\t}\n\tformParams.push(`_post: 1`, `\\r\\n--${formBoundary}--`);\n\tconst postBody = formParams.join(\"\\r\\n\");\n\tconst header: { [index: string]: string } = {\n\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t};\n\treturn { body: postBody, headers: header };\n}\n\ninterface ITreeStats {\n\ttrees: number;\n\tleafTrees: number;\n\tblobNodes: number;\n}\n\nexport function getTreeStats(snapshot: ISnapshot): ITreeStats & { encodedBlobsSize: number } {\n\tconst stats: ITreeStats = {\n\t\ttrees: 0,\n\t\tleafTrees: 0,\n\t\tblobNodes: 0,\n\t};\n\tgetTreeStatsCore(snapshot.snapshotTree, stats);\n\tlet encodedBlobsSize = 0;\n\tfor (const [_, blobContent] of snapshot.blobContents) {\n\t\tencodedBlobsSize += blobContent.byteLength;\n\t}\n\treturn { ...stats, encodedBlobsSize };\n}\n\nexport function validateBlobsAndTrees(snapshot: IOdspSnapshot): void {\n\tassert(\n\t\tsnapshot.trees !== undefined,\n\t\t0x200 /* \"Returned odsp snapshot is malformed. No trees!\" */,\n\t);\n\tassert(\n\t\tsnapshot.blobs !== undefined,\n\t\t0x201 /* \"Returned odsp snapshot is malformed. No blobs!\" */,\n\t);\n}\n\nfunction getTreeStatsCore(snapshotTree: ISnapshotTree, stats: ITreeStats): void {\n\tstats.blobNodes += Object.entries(snapshotTree.blobs).length;\n\tstats.trees++;\n\n\tconst entries = Object.entries(snapshotTree.trees);\n\tif (entries.length === 0) {\n\t\tstats.leafTrees++;\n\t} else {\n\t\tfor (const [_, tree] of entries) {\n\t\t\tstats.trees++;\n\t\t\tgetTreeStatsCore(tree, stats);\n\t\t}\n\t}\n}\n\n/**\n * This function fetches the snapshot and parse it according to what is mentioned in response headers.\n * @param odspResolvedUrl - resolved odsp url.\n * @param storageToken - token to do the auth for network request.\n * @param snapshotOptions - Options used to specify how and what to fetch in the snapshot.\n * @param loadingGroupIds - loadingGroupIds for which snapshot needs to be downloaded. Note:\n * 1.) If undefined, then legacy trees latest call will be used where no groupId query param would be specified.\n * 2.) If [] is passed, then snapshot with all ungrouped data will be fetched.\n * 3.) If any groupId is specified like [\"g1\"], then snapshot for g1 group will be fetched.\n * @param snapshotFormatFetchType - Snapshot format to fetch.\n * @param controller - abort controller if caller needs to abort the network call.\n * @param epochTracker - epoch tracker used to add/validate epoch in the network call.\n * @returns fetched snapshot.\n */\nexport const downloadSnapshot = mockify(\n\tasync (\n\t\todspResolvedUrl: IOdspResolvedUrl,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\ttokenFetchOptions: TokenFetchOptionsEx,\n\t\tloadingGroupIds: string[] | undefined,\n\t\tsnapshotOptions: ISnapshotOptions | undefined,\n\t\tsnapshotFormatFetchType?: SnapshotFormatSupportType,\n\t\tcontroller?: AbortController,\n\t\tepochTracker?: EpochTracker,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotRequestAndResponseOptions> => {\n\t\t// back-compat: This block to be removed with #8784 when we only consume/consider odsp resolvers that are >= 0.51\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n\t\tconst sharingLinkToRedeem = (odspResolvedUrl as any).sharingLinkToRedeem;\n\t\tif (sharingLinkToRedeem) {\n\t\t\todspResolvedUrl.shareLinkInfo = {\n\t\t\t\t...odspResolvedUrl.shareLinkInfo,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tsharingLinkToRedeem,\n\t\t\t};\n\t\t}\n\n\t\tconst snapshotUrl = odspResolvedUrl.endpoints.snapshotStorageUrl;\n\n\t\tconst queryParams: Record<string, unknown> = { ump: 1 };\n\t\tif (snapshotOptions !== undefined) {\n\t\t\tfor (const [key, value] of Object.entries(snapshotOptions)) {\n\t\t\t\t// Exclude \"timeout\" from query string\n\t\t\t\tif (value !== undefined && key !== \"timeout\") {\n\t\t\t\t\tqueryParams[key] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (loadingGroupIds !== undefined) {\n\t\t\tqueryParams.groupId = loadingGroupIds.join(\",\");\n\t\t}\n\n\t\tconst queryString = getQueryString(queryParams);\n\t\tconst url = `${snapshotUrl}/trees/latest${queryString}`;\n\t\tconst method = \"POST\";\n\t\tconst isRedemptionNonDurable: boolean =\n\t\t\todspResolvedUrl.shareLinkInfo?.isRedemptionNonDurable === true;\n\t\t// The location of file can move on Spo in which case server returns 308(Permanent Redirect) error.\n\t\t// Adding below header will make VROOM API return 404 instead of 308 and browser can intercept it.\n\t\t// This error thrown by server will contain the new redirect location. Look at the 404 error parsing\n\t\t// for further reference here: \\packages\\utils\\odsp-doclib-utils\\src\\odspErrorUtils.ts\n\t\t// If the share link is non-durable, we will add the nonDurableRedeem header to the header.prefer.\n\t\tconst header = isRedemptionNonDurable\n\t\t\t? { prefer: \"manualredirect, nonDurableRedeem\" }\n\t\t\t: { prefer: \"manualredirect\" };\n\t\tconst authHeader = await getAuthHeader(\n\t\t\t{ ...tokenFetchOptions, request: { url, method } },\n\t\t\t\"downloadSnapshot\",\n\t\t);\n\t\tassert(authHeader !== null, 0x1e5 /* \"Storage token should not be null\" */);\n\t\tconst { body, headers } = getFormBodyAndHeaders(odspResolvedUrl, authHeader, header);\n\t\tconst fetchOptions = {\n\t\t\tbody,\n\t\t\theaders,\n\t\t\tsignal: controller?.signal,\n\t\t\tmethod,\n\t\t};\n\t\t// Decide what snapshot format to fetch as per the feature gate.\n\t\tswitch (snapshotFormatFetchType) {\n\t\t\tcase SnapshotFormatSupportType.Binary: {\n\t\t\t\theaders.accept = `application/ms-fluid; v=${currentReadVersion}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// By default ask both versions and let the server decide the format.\n\t\t\t\theaders.accept = `application/json, application/ms-fluid; v=${currentReadVersion}`;\n\t\t\t}\n\t\t}\n\n\t\tconst odspResponse = await (epochTracker?.fetch(\n\t\t\turl,\n\t\t\tfetchOptions,\n\t\t\t\"treesLatest\",\n\t\t\ttrue,\n\t\t\tscenarioName,\n\t\t) ?? fetchHelper(url, fetchOptions));\n\n\t\treturn {\n\t\t\todspResponse,\n\t\t\trequestHeaders: headers,\n\t\t\trequestUrl: url,\n\t\t};\n\t},\n);\n\nfunction isRedeemSharingLinkError(\n\todspResolvedUrl: IOdspResolvedUrl,\n\terror: Partial<IOdspError>,\n): boolean {\n\tif (\n\t\todspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem !== undefined &&\n\t\ttypeof error === \"object\" &&\n\t\terror !== null &&\n\t\t(error.errorType === OdspErrorTypes.authorizationError ||\n\t\t\terror.errorType === OdspErrorTypes.fileNotFoundOrAccessDeniedError)\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction getEncodedShareUrl(url: string): string {\n\t/**\n\t * Encode the url to accepted format by Sharepoint\n\t * https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/shares_get\n\t */\n\tlet encodedUrl = fromUtf8ToBase64(encodeURI(url));\n\tencodedUrl = encodedUrl.replace(/=+$/g, \"\").replace(/\\//g, \"_\").replace(/\\+/g, \"-\");\n\tencodedUrl = \"u!\".concat(encodedUrl);\n\treturn encodedUrl;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -20,4 +20,5 @@ export { ICacheAndTracker, type EpochTracker, FetchType, FetchTypeInternal, } fr
20
20
  export { IOdspResponse, isOdspResolvedUrl } from "./odspUtils.js";
21
21
  export { SnapshotFormatSupportType } from "./fetchSnapshot.js";
22
22
  export { ISnapshotContentsWithProps, parseCompactSnapshotResponse, } from "./compactSnapshotParser.js";
23
+ export { odspDriverCompatDetailsForLoader } from "./odspLayerCompatState.js";
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;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ClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.parseCompactSnapshotResponse = exports.SnapshotFormatSupportType = exports.isOdspResolvedUrl = exports.storeLocatorInOdspUrl = exports.locatorQueryParamName = exports.getLocatorFromOdspUrl = exports.encodeOdspFluidDataStoreLocator = exports.OdspDriverUrlResolverForShareLink = exports.OdspDriverUrlResolver = exports.createOdspCreateContainerRequest = exports.OdspDocumentServiceFactoryCore = exports.OdspDocumentServiceFactory = exports.createLocalOdspDocumentServiceFactory = exports.prefetchLatestSnapshot = exports.isSpoUrl = exports.isOdcUrl = exports.getOdspUrlParts = exports.getHashedDocumentId = exports.createOdspUrl = exports.checkUrl = exports.SharingLinkHeader = exports.ClpCompliantAppHeader = exports.OdcFileSiteOrigin = exports.OdcApiSiteOrigin = void 0;
7
+ exports.odspDriverCompatDetailsForLoader = exports.parseCompactSnapshotResponse = exports.SnapshotFormatSupportType = exports.isOdspResolvedUrl = exports.storeLocatorInOdspUrl = exports.locatorQueryParamName = exports.getLocatorFromOdspUrl = exports.encodeOdspFluidDataStoreLocator = exports.OdspDriverUrlResolverForShareLink = exports.OdspDriverUrlResolver = exports.createOdspCreateContainerRequest = exports.OdspDocumentServiceFactoryCore = exports.OdspDocumentServiceFactory = exports.createLocalOdspDocumentServiceFactory = exports.prefetchLatestSnapshot = exports.isSpoUrl = exports.isOdcUrl = exports.getOdspUrlParts = exports.getHashedDocumentId = exports.createOdspUrl = exports.checkUrl = exports.SharingLinkHeader = exports.ClpCompliantAppHeader = exports.OdcFileSiteOrigin = exports.OdcApiSiteOrigin = void 0;
8
8
  // Constants
9
9
  var constants_js_1 = require("./constants.js");
10
10
  Object.defineProperty(exports, "OdcApiSiteOrigin", { enumerable: true, get: function () { return constants_js_1.OdcApiSiteOrigin; } });
@@ -52,4 +52,7 @@ var fetchSnapshot_js_1 = require("./fetchSnapshot.js");
52
52
  Object.defineProperty(exports, "SnapshotFormatSupportType", { enumerable: true, get: function () { return fetchSnapshot_js_1.SnapshotFormatSupportType; } });
53
53
  var compactSnapshotParser_js_1 = require("./compactSnapshotParser.js");
54
54
  Object.defineProperty(exports, "parseCompactSnapshotResponse", { enumerable: true, get: function () { return compactSnapshotParser_js_1.parseCompactSnapshotResponse; } });
55
+ // Layer Compat details
56
+ var odspLayerCompatState_js_1 = require("./odspLayerCompatState.js");
57
+ Object.defineProperty(exports, "odspDriverCompatDetailsForLoader", { enumerable: true, get: function () { return odspLayerCompatState_js_1.odspDriverCompatDetailsForLoader; } });
55
58
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,YAAY;AACZ,+CAAqE;AAA5D,gHAAA,gBAAgB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAE5C,2DAM8B;AAL7B,2HAAA,qBAAqB,OAAA;AAIrB,uHAAA,iBAAiB,OAAA;AAGlB,eAAe;AACf,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAA8E;AAArE,yHAAA,mBAAmB,OAAA;AAC5B,uDAAyE;AAAhE,mHAAA,eAAe,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAE5C,iDAAiD;AACjD,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAE/B,UAAU;AACV,iFAGyC;AAFxC,sJAAA,qCAAqC,OAAA;AACrC,2IAAA,0BAA0B,OAAA;AAE3B,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AAEvC,gBAAgB;AAChB,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AAEzC,6CAA6C;AAC7C,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,+FAGgD;AAF/C,yJAAA,iCAAiC,OAAA;AAIlC,oEAAoE;AACpE,+DAKgC;AAJ/B,uIAAA,+BAA+B,OAAA;AAC/B,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AAetB,+CAAkE;AAA1C,iHAAA,iBAAiB,OAAA;AACzC,uDAA+D;AAAtD,6HAAA,yBAAyB,OAAA;AAClC,uEAGoC;AADnC,wIAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants.js\";\n\nexport {\n\tClpCompliantAppHeader,\n\tIClpCompliantAppHeader,\n\tISharingLinkHeader,\n\tOdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest.js\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver.js\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\tShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink.js\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink.js\";\n\nexport {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport {\n\tICacheAndTracker,\n\ttype EpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\tISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,YAAY;AACZ,+CAAqE;AAA5D,gHAAA,gBAAgB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAE5C,2DAM8B;AAL7B,2HAAA,qBAAqB,OAAA;AAIrB,uHAAA,iBAAiB,OAAA;AAGlB,eAAe;AACf,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAA8E;AAArE,yHAAA,mBAAmB,OAAA;AAC5B,uDAAyE;AAAhE,mHAAA,eAAe,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAAE,4GAAA,QAAQ,OAAA;AAE5C,iDAAiD;AACjD,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAE/B,UAAU;AACV,iFAGyC;AAFxC,sJAAA,qCAAqC,OAAA;AACrC,2IAAA,0BAA0B,OAAA;AAE3B,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AAEvC,gBAAgB;AAChB,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AAEzC,6CAA6C;AAC7C,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,+FAGgD;AAF/C,yJAAA,iCAAiC,OAAA;AAIlC,oEAAoE;AACpE,+DAKgC;AAJ/B,uIAAA,+BAA+B,OAAA;AAC/B,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AACrB,6HAAA,qBAAqB,OAAA;AAetB,+CAAkE;AAA1C,iHAAA,iBAAiB,OAAA;AACzC,uDAA+D;AAAtD,6HAAA,yBAAyB,OAAA;AAClC,uEAGoC;AADnC,wIAAA,4BAA4B,OAAA;AAG7B,uBAAuB;AACvB,qEAA6E;AAApE,2IAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Constants\nexport { OdcApiSiteOrigin, OdcFileSiteOrigin } from \"./constants.js\";\n\nexport {\n\tClpCompliantAppHeader,\n\tIClpCompliantAppHeader,\n\tISharingLinkHeader,\n\tOdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport { OdspDocumentServiceFactoryCore } from \"./odspDocumentServiceFactoryCore.js\";\n\n// File creation\nexport { createOdspCreateContainerRequest } from \"./createOdspCreateContainerRequest.js\";\n\n// URI Resolver functionality, URI management\nexport { OdspDriverUrlResolver } from \"./odspDriverUrlResolver.js\";\nexport {\n\tOdspDriverUrlResolverForShareLink,\n\tShareLinkFetcherProps,\n} from \"./odspDriverUrlResolverForShareLink.js\";\n\n// It's used by URL resolve code, but also has some public functions\nexport {\n\tencodeOdspFluidDataStoreLocator,\n\tgetLocatorFromOdspUrl,\n\tlocatorQueryParamName,\n\tstoreLocatorInOdspUrl,\n} from \"./odspFluidFileLink.js\";\n\nexport {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport {\n\tICacheAndTracker,\n\ttype EpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\tISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\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 { TypedEventEmitter } from "@fluid-internal/client-utils";
5
+ import { TypedEventEmitter, type ILayerCompatDetails } from "@fluid-internal/client-utils";
6
6
  import { IClient } from "@fluidframework/driver-definitions";
7
7
  import { IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
8
8
  import { IOdspResolvedUrl } from "@fluidframework/odsp-driver-definitions/internal";
@@ -19,6 +19,11 @@ export declare class LocalOdspDocumentService extends TypedEventEmitter<IDocumen
19
19
  };
20
20
  private storageManager?;
21
21
  constructor(odspResolvedUrl: IOdspResolvedUrl, logger: ITelemetryLoggerExt, localSnapshot: Uint8Array | string);
22
+ /**
23
+ * The compatibility details of the Local ODSP Driver layer that is exposed to the Loader layer
24
+ * for validating Loader-Driver compatibility.
25
+ */
26
+ get ILayerCompatDetails(): ILayerCompatDetails;
22
27
  get resolvedUrl(): IResolvedUrl;
23
28
  connectToStorage(): Promise<IDocumentStorageService>;
24
29
  connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
@@ -1 +1 @@
1
- {"version":3,"file":"localOdspDocumentService.d.ts","sourceRoot":"","sources":["../../src/localOdspDriver/localOdspDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACN,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAK/E;;GAEG;AACH,qBAAa,wBACZ,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;IAM1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IANxB,QAAQ;;MAAyB;IACxC,OAAO,CAAC,cAAc,CAAC,CAAkC;gBAGvC,eAAe,EAAE,gBAAgB,EACjC,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,UAAU,GAAG,MAAM;IAKpD,IAAW,WAAW,IAAI,YAAY,CAErC;IAEY,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAKpD,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAIpE,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK;IAQ7C,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CAGrC"}
1
+ {"version":3,"file":"localOdspDocumentService.d.ts","sourceRoot":"","sources":["../../src/localOdspDriver/localOdspDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACN,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAM/E;;GAEG;AACH,qBAAa,wBACZ,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;IAM1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IANxB,QAAQ;;MAAyB;IACxC,OAAO,CAAC,cAAc,CAAC,CAAkC;gBAGvC,eAAe,EAAE,gBAAgB,EACjC,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,UAAU,GAAG,MAAM;IAKpD;;;OAGG;IACH,IAAW,mBAAmB,IAAI,mBAAmB,CAEpD;IAED,IAAW,WAAW,IAAI,YAAY,CAErC;IAEY,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAKpD,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAIpE,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK;IAQ7C,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CAGrC"}
@@ -9,6 +9,7 @@ const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const internal_1 = require("@fluidframework/driver-utils/internal");
10
10
  const localOdspDeltaStorageService_js_1 = require("./localOdspDeltaStorageService.js");
11
11
  const localOdspDocumentStorageManager_js_1 = require("./localOdspDocumentStorageManager.js");
12
+ const localOdspLayerCompatState_js_1 = require("./localOdspLayerCompatState.js");
12
13
  /**
13
14
  * IDocumentService implementation that provides explicit snapshot to the document storage service.
14
15
  */
@@ -20,6 +21,13 @@ class LocalOdspDocumentService extends client_utils_1.TypedEventEmitter {
20
21
  this.localSnapshot = localSnapshot;
21
22
  this.policies = { storageOnly: true };
22
23
  }
24
+ /**
25
+ * The compatibility details of the Local ODSP Driver layer that is exposed to the Loader layer
26
+ * for validating Loader-Driver compatibility.
27
+ */
28
+ get ILayerCompatDetails() {
29
+ return localOdspLayerCompatState_js_1.localOdspDriverCompatDetailsForLoader;
30
+ }
23
31
  get resolvedUrl() {
24
32
  return this.odspResolvedUrl;
25
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"localOdspDocumentService.js","sourceRoot":"","sources":["../../src/localOdspDriver/localOdspDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AASjE,oEAAmE;AAInE,uFAAiF;AACjF,6FAAuF;AAEvF;;GAEG;AACH,MAAa,wBACZ,SAAQ,gCAAyC;IAMjD,YACkB,eAAiC,EACjC,MAA2B,EAC3B,aAAkC;QAEnD,KAAK,EAAE,CAAC;QAJS,oBAAe,GAAf,eAAe,CAAkB;QACjC,WAAM,GAAN,MAAM,CAAqB;QAC3B,kBAAa,GAAb,aAAa,CAAqB;QAN7C,aAAQ,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IASxC,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC5B,IAAI,CAAC,cAAc,GAAG,IAAI,oEAA+B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3F,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,8DAA4B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACtF,CAAC;IAEM,oBAAoB,CAAC,OAAgB;QAC3C,MAAM,OAAO,GAAG,IAAI,qBAAU,CAC7B,qEAAqE,CACrE,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAAE,OAAO,CAAC,CAAC;QACvE,MAAM,OAAO,CAAC;IACf,CAAC;IAEM,OAAO,CAAC,KAAe;QAC7B,aAAa;IACd,CAAC;CACD;AAvCD,4DAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { IOdspResolvedUrl } from \"@fluidframework/odsp-driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { LocalOdspDeltaStorageService } from \"./localOdspDeltaStorageService.js\";\nimport { LocalOdspDocumentStorageService } from \"./localOdspDocumentStorageManager.js\";\n\n/**\n * IDocumentService implementation that provides explicit snapshot to the document storage service.\n */\nexport class LocalOdspDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic policies = { storageOnly: true };\n\tprivate storageManager?: LocalOdspDocumentStorageService;\n\n\tconstructor(\n\t\tprivate readonly odspResolvedUrl: IOdspResolvedUrl,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly localSnapshot: Uint8Array | string,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\treturn this.odspResolvedUrl;\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\tthis.storageManager = new LocalOdspDocumentStorageService(this.logger, this.localSnapshot);\n\t\treturn this.storageManager;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new LocalOdspDeltaStorageService(this.logger, this.storageManager?.ops ?? []);\n\t}\n\n\tpublic connectToDeltaStream(_client: IClient): never {\n\t\tconst toThrow = new UsageError(\n\t\t\t'\"connectToDeltaStream\" is not supported by LocalOdspDocumentService',\n\t\t);\n\t\tthis.logger.sendErrorEvent({ eventName: \"UnsupportedUsage\" }, toThrow);\n\t\tthrow toThrow;\n\t}\n\n\tpublic dispose(error?: unknown): void {\n\t\t// Do nothing\n\t}\n}\n"]}
1
+ {"version":3,"file":"localOdspDocumentService.js","sourceRoot":"","sources":["../../src/localOdspDriver/localOdspDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2F;AAS3F,oEAAmE;AAInE,uFAAiF;AACjF,6FAAuF;AACvF,iFAAuF;AAEvF;;GAEG;AACH,MAAa,wBACZ,SAAQ,gCAAyC;IAMjD,YACkB,eAAiC,EACjC,MAA2B,EAC3B,aAAkC;QAEnD,KAAK,EAAE,CAAC;QAJS,oBAAe,GAAf,eAAe,CAAkB;QACjC,WAAM,GAAN,MAAM,CAAqB;QAC3B,kBAAa,GAAb,aAAa,CAAqB;QAN7C,aAAQ,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IASxC,CAAC;IAED;;;OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAO,oEAAqC,CAAC;IAC9C,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC5B,IAAI,CAAC,cAAc,GAAG,IAAI,oEAA+B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3F,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,8DAA4B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACtF,CAAC;IAEM,oBAAoB,CAAC,OAAgB;QAC3C,MAAM,OAAO,GAAG,IAAI,qBAAU,CAC7B,qEAAqE,CACrE,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAAE,OAAO,CAAC,CAAC;QACvE,MAAM,OAAO,CAAC;IACf,CAAC;IAEM,OAAO,CAAC,KAAe;QAC7B,aAAa;IACd,CAAC;CACD;AA/CD,4DA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter, type ILayerCompatDetails } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\nimport { IOdspResolvedUrl } from \"@fluidframework/odsp-driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { LocalOdspDeltaStorageService } from \"./localOdspDeltaStorageService.js\";\nimport { LocalOdspDocumentStorageService } from \"./localOdspDocumentStorageManager.js\";\nimport { localOdspDriverCompatDetailsForLoader } from \"./localOdspLayerCompatState.js\";\n\n/**\n * IDocumentService implementation that provides explicit snapshot to the document storage service.\n */\nexport class LocalOdspDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tpublic policies = { storageOnly: true };\n\tprivate storageManager?: LocalOdspDocumentStorageService;\n\n\tconstructor(\n\t\tprivate readonly odspResolvedUrl: IOdspResolvedUrl,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly localSnapshot: Uint8Array | string,\n\t) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * The compatibility details of the Local ODSP Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn localOdspDriverCompatDetailsForLoader;\n\t}\n\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\treturn this.odspResolvedUrl;\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\tthis.storageManager = new LocalOdspDocumentStorageService(this.logger, this.localSnapshot);\n\t\treturn this.storageManager;\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn new LocalOdspDeltaStorageService(this.logger, this.storageManager?.ops ?? []);\n\t}\n\n\tpublic connectToDeltaStream(_client: IClient): never {\n\t\tconst toThrow = new UsageError(\n\t\t\t'\"connectToDeltaStream\" is not supported by LocalOdspDocumentService',\n\t\t);\n\t\tthis.logger.sendErrorEvent({ eventName: \"UnsupportedUsage\" }, toThrow);\n\t\tthrow toThrow;\n\t}\n\n\tpublic dispose(error?: unknown): void {\n\t\t// Do nothing\n\t}\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type ILayerCompatDetails } from "@fluid-internal/client-utils";
6
+ /**
7
+ * Local ODSP Driver's compatibility details that is exposed to the Loader layer.
8
+ * @internal
9
+ */
10
+ export declare const localOdspDriverCompatDetailsForLoader: ILayerCompatDetails;
11
+ //# sourceMappingURL=localOdspLayerCompatState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localOdspLayerCompatState.d.ts","sourceRoot":"","sources":["../../src/localOdspDriver/localOdspLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAIxE;;;GAGG;AACH,eAAO,MAAM,qCAAqC,EAAE,mBAanD,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.localOdspDriverCompatDetailsForLoader = void 0;
8
+ const packageVersion_js_1 = require("../packageVersion.js");
9
+ /**
10
+ * Local ODSP Driver's compatibility details that is exposed to the Loader layer.
11
+ * @internal
12
+ */
13
+ exports.localOdspDriverCompatDetailsForLoader = {
14
+ /**
15
+ * The package version of the Local ODSP Driver layer.
16
+ */
17
+ pkgVersion: packageVersion_js_1.pkgVersion,
18
+ /**
19
+ * The current generation of the Local ODSP Driver layer.
20
+ */
21
+ generation: 1,
22
+ /**
23
+ * The features supported by the Local ODSP Driver layer across the Driver / Loader boundary.
24
+ */
25
+ supportedFeatures: new Set(),
26
+ };
27
+ //# sourceMappingURL=localOdspLayerCompatState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localOdspLayerCompatState.js","sourceRoot":"","sources":["../../src/localOdspDriver/localOdspLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,4DAAkD;AAElD;;;GAGG;AACU,QAAA,qCAAqC,GAAwB;IACzE;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;IACb;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ILayerCompatDetails } from \"@fluid-internal/client-utils\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\n/**\n * Local ODSP Driver's compatibility details that is exposed to the Loader layer.\n * @internal\n */\nexport const localOdspDriverCompatDetailsForLoader: ILayerCompatDetails = {\n\t/**\n\t * The package version of the Local ODSP Driver layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Local ODSP Driver layer.\n\t */\n\tgeneration: 1,\n\t/**\n\t * The features supported by the Local ODSP Driver layer across the Driver / Loader boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\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 { TypedEventEmitter } from "@fluid-internal/client-utils";
5
+ import { TypedEventEmitter, type ILayerCompatDetails } from "@fluid-internal/client-utils";
6
6
  import { IClient } from "@fluidframework/driver-definitions";
7
7
  import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentServicePolicies, IDocumentStorageService, IResolvedUrl, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
8
8
  import { HostStoragePolicy, IOdspResolvedUrl, InstrumentedStorageTokenFetcher, TokenFetchOptions } from "@fluidframework/odsp-driver-definitions/internal";
@@ -42,6 +42,11 @@ export declare class OdspDocumentService extends TypedEventEmitter<IDocumentServ
42
42
  * @param socketReferenceKeyPrefix - (optional) prefix to isolate socket reuse cache
43
43
  */
44
44
  static create(resolvedUrl: IResolvedUrl, getAuthHeader: InstrumentedStorageTokenFetcher, getWebsocketToken: ((options: TokenFetchOptions) => Promise<string | null>) | undefined, logger: ITelemetryLoggerExt, cache: IOdspCache, hostPolicy: HostStoragePolicy, epochTracker: EpochTracker, socketReferenceKeyPrefix?: string, clientIsSummarizer?: boolean): Promise<IDocumentService>;
45
+ /**
46
+ * The compatibility details of the ODSP Driver layer that is exposed to the Loader layer
47
+ * for validating Loader-Driver compatibility.
48
+ */
49
+ get ILayerCompatDetails(): ILayerCompatDetails;
45
50
  private storageManager?;
46
51
  private readonly mc;
47
52
  private readonly hostPolicy;