@fluidframework/odsp-driver 2.71.0 → 2.73.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 (72) hide show
  1. package/CHANGELOG.md +8 -7
  2. package/dist/contracts.js.map +1 -1
  3. package/dist/createFile/createNewUtils.d.ts.map +1 -1
  4. package/dist/createFile/createNewUtils.js.map +1 -1
  5. package/dist/epochTracker.d.ts.map +1 -1
  6. package/dist/epochTracker.js.map +1 -1
  7. package/dist/fetchSnapshot.d.ts.map +1 -1
  8. package/dist/fetchSnapshot.js.map +1 -1
  9. package/dist/odspDelayLoadedDeltaStream.d.ts.map +1 -1
  10. package/dist/odspDelayLoadedDeltaStream.js.map +1 -1
  11. package/dist/odspDeltaStorageService.d.ts.map +1 -1
  12. package/dist/odspDeltaStorageService.js.map +1 -1
  13. package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
  14. package/dist/odspDocumentDeltaConnection.js.map +1 -1
  15. package/dist/odspDocumentServiceFactory.js +1 -1
  16. package/dist/odspDocumentServiceFactory.js.map +1 -1
  17. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  18. package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
  19. package/dist/odspDocumentStorageManager.js +1 -1
  20. package/dist/odspDocumentStorageManager.js.map +1 -1
  21. package/dist/odspLayerCompatState.js +1 -1
  22. package/dist/odspLayerCompatState.js.map +1 -1
  23. package/dist/odspUtils.js +1 -1
  24. package/dist/odspUtils.js.map +1 -1
  25. package/dist/packageVersion.d.ts +1 -1
  26. package/dist/packageVersion.js +1 -1
  27. package/dist/packageVersion.js.map +1 -1
  28. package/dist/vroom.d.ts.map +1 -1
  29. package/dist/vroom.js.map +1 -1
  30. package/lib/contracts.js.map +1 -1
  31. package/lib/createFile/createNewUtils.d.ts.map +1 -1
  32. package/lib/createFile/createNewUtils.js.map +1 -1
  33. package/lib/epochTracker.d.ts.map +1 -1
  34. package/lib/epochTracker.js.map +1 -1
  35. package/lib/fetchSnapshot.d.ts.map +1 -1
  36. package/lib/fetchSnapshot.js.map +1 -1
  37. package/lib/odspDelayLoadedDeltaStream.d.ts.map +1 -1
  38. package/lib/odspDelayLoadedDeltaStream.js.map +1 -1
  39. package/lib/odspDeltaStorageService.d.ts.map +1 -1
  40. package/lib/odspDeltaStorageService.js.map +1 -1
  41. package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
  42. package/lib/odspDocumentDeltaConnection.js.map +1 -1
  43. package/lib/odspDocumentServiceFactory.js +1 -1
  44. package/lib/odspDocumentServiceFactory.js.map +1 -1
  45. package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  46. package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
  47. package/lib/odspDocumentStorageManager.js +1 -1
  48. package/lib/odspDocumentStorageManager.js.map +1 -1
  49. package/lib/odspLayerCompatState.js +1 -1
  50. package/lib/odspLayerCompatState.js.map +1 -1
  51. package/lib/odspUtils.js +1 -1
  52. package/lib/odspUtils.js.map +1 -1
  53. package/lib/packageVersion.d.ts +1 -1
  54. package/lib/packageVersion.js +1 -1
  55. package/lib/packageVersion.js.map +1 -1
  56. package/lib/vroom.d.ts.map +1 -1
  57. package/lib/vroom.js.map +1 -1
  58. package/package.json +15 -15
  59. package/src/contracts.ts +2 -2
  60. package/src/createFile/createNewUtils.ts +1 -0
  61. package/src/epochTracker.ts +1 -0
  62. package/src/fetchSnapshot.ts +1 -0
  63. package/src/odspDelayLoadedDeltaStream.ts +1 -0
  64. package/src/odspDeltaStorageService.ts +1 -0
  65. package/src/odspDocumentDeltaConnection.ts +1 -0
  66. package/src/odspDocumentServiceFactory.ts +1 -1
  67. package/src/odspDocumentServiceFactoryCore.ts +1 -0
  68. package/src/odspDocumentStorageManager.ts +2 -2
  69. package/src/odspLayerCompatState.ts +1 -1
  70. package/src/odspUtils.ts +2 -2
  71. package/src/packageVersion.ts +1 -1
  72. package/src/vroom.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"vroom.d.ts","sourceRoot":"","sources":["../src/vroom.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,aAAa,EACb,uBAAuB,EACvB,+BAA+B,EAC/B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQ1D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,6CAEjB,aAAa,QACjB,MAAM,UACJ,KAAK,GAAG,MAAM,UACd,mBAAmB,iBACZ,+BAA+B,gBAChC,YAAY,sBACN,OAAO,WAClB,mBAAmB,6BACD,OAAO,GAAG,SAAS,6BACnB,OAAO,GAAG,SAAS,2BACrB,OAAO,eACnB,MAAM,GAAG,SAAS,KAC7B,QAAQ,uBAAuB,CAAC,CAwFnC,CAAC"}
1
+ {"version":3,"file":"vroom.d.ts","sourceRoot":"","sources":["../src/vroom.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,aAAa,EACb,uBAAuB,EACvB,+BAA+B,EAC/B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQ1D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,6CAEjB,aAAa,QACjB,MAAM,UACJ,KAAK,GAAG,MAAM,UACd,mBAAmB,iBACZ,+BAA+B,gBAChC,YAAY,sBACN,OAAO,WAClB,mBAAmB,6BACD,OAAO,GAAG,SAAS,6BACnB,OAAO,GAAG,SAAS,2BACrB,OAAO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,IAAI,CAAC;QACtC,MAAM,OAAO,GAAgC;YAC5C,cAAc,EAAE,gCAAgC,YAAY,EAAE;SAC9D,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,YAAY,CAClC,KAAK,IAAI,EAAE,CACV,YAAY,CAAC,mBAAmB,CAC/B,GAAG,EACH,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EACnC,aAAa,EACb,IAAI,CACJ,EACF,aAAa,EACb,MAAM,CACN,CAAC;QAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACxD,kEAAkE;QAClE,MAAM,iBAAiB,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAElD,8BAA8B;QAC9B,KAAK,CAAC,GAAG,CAAC;YACT,GAAG,QAAQ,CAAC,UAAU;YACtB,2CAA2C;YAC3C,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;YACnC,iBAAiB;YACjB,6BAA6B,EAAE,QAAQ,CAAC,OAAO,CAAC,6BAA6B;SAC7E,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACpE,QAAQ,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC;QAC9D,CAAC;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC;IACzB,CAAC,CACD,CAAC;AACH,CAAC,CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIOdspUrlParts,\n\tISocketStorageDiscovery,\n\tInstrumentedStorageTokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tPerformanceEvent,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { EpochTracker } from \"./epochTracker.js\";\nimport { mockify } from \"./mockify.js\";\nimport { getApiRoot } from \"./odspUrlHelper.js\";\nimport type { TokenFetchOptionsEx } from \"./odspUtils.js\";\nimport { runWithRetry } from \"./retryUtils.js\";\n\ninterface IJoinSessionBody {\n\trequestSocketToken?: boolean;\n\tdisplayName?: string;\n}\n\n/**\n * Makes join session call on SPO to get information about the web socket for a document\n * @param urlParts - The SPO drive id, itemId, siteUrl that this request should be made against\n * @param path - The API path that is relevant to this request\n * @param method - The type of request, such as GET or POST\n * @param logger - A logger to use for this request\n * @param getAuthHeader - A function that is able to provide the access token for this request\n * @param epochTracker - fetch wrapper which incorporates epoch logic around joinSession call\n * @param requestSocketToken - flag indicating whether joinSession is expected to return access token\n * which is used when establishing websocket connection with collab session backend service.\n * @param options - Options to fetch the token.\n * @param disableJoinSessionRefresh - Whether the caller wants to disable refreshing join session periodically.\n * @param setSensitivityLabelHeader - Whether the caller wants to set the Return-Sensitivity-Labels Prefer header in the join session request.\n * @param isRefreshingJoinSession - whether call is to refresh the session before expiry.\n * @param displayName - display name used to identify client joining a session.\n * This is optional and used only when collab session is being joined by client acting in app-only mode (i.e. without user context).\n * If not specified client display name is extracted from the access token that is used to join session.\n */\nexport const fetchJoinSession = mockify(\n\tasync (\n\t\turlParts: IOdspUrlParts,\n\t\tpath: string,\n\t\tmethod: \"GET\" | \"POST\",\n\t\tlogger: ITelemetryLoggerExt,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\tepochTracker: EpochTracker,\n\t\trequestSocketToken: boolean,\n\t\toptions: TokenFetchOptionsEx,\n\t\tdisableJoinSessionRefresh: boolean | undefined,\n\t\tsetSensitivityLabelHeader: boolean | undefined,\n\t\tisRefreshingJoinSession: boolean,\n\t\tdisplayName: string | undefined,\n\t): Promise<ISocketStorageDiscovery> => {\n\t\tconst apiRoot = getApiRoot(new URL(urlParts.siteUrl));\n\t\tconst url = `${apiRoot}/drives/${urlParts.driveId}/items/${urlParts.itemId}/${path}?ump=1`;\n\t\tconst authHeader = await getAuthHeader(\n\t\t\t{ ...options, request: { url, method } },\n\t\t\t\"JoinSession\",\n\t\t);\n\n\t\tconst tokenRefreshProps = options.refresh\n\t\t\t? { hasClaims: !!options.claims, hasTenantId: !!options.tenantId }\n\t\t\t: {};\n\t\tconst details: ITelemetryBaseProperties = {\n\t\t\trefreshedToken: options.refresh,\n\t\t\trequestSocketToken,\n\t\t\t...tokenRefreshProps,\n\t\t\trefreshingSession: isRefreshingJoinSession,\n\t\t};\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{\n\t\t\t\teventName: \"JoinSession\",\n\t\t\t\tattempts: options.refresh ? 2 : 1,\n\t\t\t\tdetails: JSON.stringify(details),\n\t\t\t\t...tokenRefreshProps,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst formBoundary = uuid();\n\t\t\t\tlet postBody = `--${formBoundary}\\r\\n`;\n\t\t\t\tpostBody += `Authorization: ${authHeader}\\r\\n`;\n\t\t\t\tpostBody += `X-HTTP-Method-Override: POST\\r\\n`;\n\t\t\t\tpostBody += `Content-Type: application/json\\r\\n`;\n\t\t\t\tif (!disableJoinSessionRefresh) {\n\t\t\t\t\tpostBody += `Prefer: FluidRemoveCheckAccess\\r\\n`;\n\t\t\t\t}\n\t\t\t\tif (setSensitivityLabelHeader) {\n\t\t\t\t\tpostBody += `Prefer: Return-Sensitivity-Labels\\r\\n`;\n\t\t\t\t}\n\t\t\t\tpostBody += `_post: 1\\r\\n`;\n\n\t\t\t\tlet requestBody: IJoinSessionBody | undefined;\n\t\t\t\tif (requestSocketToken) {\n\t\t\t\t\trequestBody = { ...requestBody, requestSocketToken: true };\n\t\t\t\t}\n\t\t\t\tif (displayName) {\n\t\t\t\t\trequestBody = { ...requestBody, displayName };\n\t\t\t\t}\n\t\t\t\tif (requestBody) {\n\t\t\t\t\tpostBody += `\\r\\n${JSON.stringify(requestBody)}\\r\\n`;\n\t\t\t\t}\n\t\t\t\tpostBody += `\\r\\n--${formBoundary}--`;\n\t\t\t\tconst headers: { [index: string]: string } = {\n\t\t\t\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t\t\t\t};\n\n\t\t\t\tconst response = await runWithRetry(\n\t\t\t\t\tasync () =>\n\t\t\t\t\t\tepochTracker.fetchAndParseAsJSON<ISocketStorageDiscovery>(\n\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t{ method, headers, body: postBody },\n\t\t\t\t\t\t\t\"joinSession\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t),\n\t\t\t\t\t\"joinSession\",\n\t\t\t\t\tlogger,\n\t\t\t\t);\n\n\t\t\t\tconst socketUrl = response.content.deltaStreamSocketUrl;\n\t\t\t\t// expecting socketUrl to be something like https://{hostName}/...\n\t\t\t\tconst webSocketHostName = socketUrl.split(\"/\")[2];\n\n\t\t\t\t// TODO SPO-specific telemetry\n\t\t\t\tevent.end({\n\t\t\t\t\t...response.propsToLog,\n\t\t\t\t\t// pushV2 websocket urls will contain pushf\n\t\t\t\t\tpushv2: socketUrl.includes(\"pushf\"),\n\t\t\t\t\twebSocketHostName,\n\t\t\t\t\trefreshSessionDurationSeconds: response.content.refreshSessionDurationSeconds,\n\t\t\t\t});\n\n\t\t\t\tif (response.content.runtimeTenantId && !response.content.tenantId) {\n\t\t\t\t\tresponse.content.tenantId = response.content.runtimeTenantId;\n\t\t\t\t}\n\n\t\t\t\treturn response.content;\n\t\t\t},\n\t\t);\n\t},\n);\n"]}
1
+ {"version":3,"file":"vroom.js","sourceRoot":"","sources":["../src/vroom.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAEN,gBAAgB,GAChB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAA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AAM,CACN,CAAC;QAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACxD,kEAAkE;QAClE,MAAM,iBAAiB,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAElD,8BAA8B;QAC9B,KAAK,CAAC,GAAG,CAAC;YACT,GAAG,QAAQ,CAAC,UAAU;YACtB,2CAA2C;YAC3C,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;YACnC,iBAAiB;YACjB,6BAA6B,EAAE,QAAQ,CAAC,OAAO,CAAC,6BAA6B;SAC7E,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACpE,QAAQ,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC;QAC9D,CAAC;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC;IACzB,CAAC,CACD,CAAC;AACH,CAAC,CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIOdspUrlParts,\n\tISocketStorageDiscovery,\n\tInstrumentedStorageTokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tPerformanceEvent,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { v4 as uuid } from \"uuid\";\n\nimport type { EpochTracker } from \"./epochTracker.js\";\nimport { mockify } from \"./mockify.js\";\nimport { getApiRoot } from \"./odspUrlHelper.js\";\nimport type { TokenFetchOptionsEx } from \"./odspUtils.js\";\nimport { runWithRetry } from \"./retryUtils.js\";\n\ninterface IJoinSessionBody {\n\trequestSocketToken?: boolean;\n\tdisplayName?: string;\n}\n\n/**\n * Makes join session call on SPO to get information about the web socket for a document\n * @param urlParts - The SPO drive id, itemId, siteUrl that this request should be made against\n * @param path - The API path that is relevant to this request\n * @param method - The type of request, such as GET or POST\n * @param logger - A logger to use for this request\n * @param getAuthHeader - A function that is able to provide the access token for this request\n * @param epochTracker - fetch wrapper which incorporates epoch logic around joinSession call\n * @param requestSocketToken - flag indicating whether joinSession is expected to return access token\n * which is used when establishing websocket connection with collab session backend service.\n * @param options - Options to fetch the token.\n * @param disableJoinSessionRefresh - Whether the caller wants to disable refreshing join session periodically.\n * @param setSensitivityLabelHeader - Whether the caller wants to set the Return-Sensitivity-Labels Prefer header in the join session request.\n * @param isRefreshingJoinSession - whether call is to refresh the session before expiry.\n * @param displayName - display name used to identify client joining a session.\n * This is optional and used only when collab session is being joined by client acting in app-only mode (i.e. without user context).\n * If not specified client display name is extracted from the access token that is used to join session.\n */\nexport const fetchJoinSession = mockify(\n\tasync (\n\t\turlParts: IOdspUrlParts,\n\t\tpath: string,\n\t\tmethod: \"GET\" | \"POST\",\n\t\tlogger: ITelemetryLoggerExt,\n\t\tgetAuthHeader: InstrumentedStorageTokenFetcher,\n\t\tepochTracker: EpochTracker,\n\t\trequestSocketToken: boolean,\n\t\toptions: TokenFetchOptionsEx,\n\t\tdisableJoinSessionRefresh: boolean | undefined,\n\t\tsetSensitivityLabelHeader: boolean | undefined,\n\t\tisRefreshingJoinSession: boolean,\n\t\tdisplayName: string | undefined,\n\t): Promise<ISocketStorageDiscovery> => {\n\t\tconst apiRoot = getApiRoot(new URL(urlParts.siteUrl));\n\t\tconst url = `${apiRoot}/drives/${urlParts.driveId}/items/${urlParts.itemId}/${path}?ump=1`;\n\t\tconst authHeader = await getAuthHeader(\n\t\t\t{ ...options, request: { url, method } },\n\t\t\t\"JoinSession\",\n\t\t);\n\n\t\tconst tokenRefreshProps = options.refresh\n\t\t\t? { hasClaims: !!options.claims, hasTenantId: !!options.tenantId }\n\t\t\t: {};\n\t\tconst details: ITelemetryBaseProperties = {\n\t\t\trefreshedToken: options.refresh,\n\t\t\trequestSocketToken,\n\t\t\t...tokenRefreshProps,\n\t\t\trefreshingSession: isRefreshingJoinSession,\n\t\t};\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tlogger,\n\t\t\t{\n\t\t\t\teventName: \"JoinSession\",\n\t\t\t\tattempts: options.refresh ? 2 : 1,\n\t\t\t\tdetails: JSON.stringify(details),\n\t\t\t\t...tokenRefreshProps,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst formBoundary = uuid();\n\t\t\t\tlet postBody = `--${formBoundary}\\r\\n`;\n\t\t\t\tpostBody += `Authorization: ${authHeader}\\r\\n`;\n\t\t\t\tpostBody += `X-HTTP-Method-Override: POST\\r\\n`;\n\t\t\t\tpostBody += `Content-Type: application/json\\r\\n`;\n\t\t\t\tif (!disableJoinSessionRefresh) {\n\t\t\t\t\tpostBody += `Prefer: FluidRemoveCheckAccess\\r\\n`;\n\t\t\t\t}\n\t\t\t\tif (setSensitivityLabelHeader) {\n\t\t\t\t\tpostBody += `Prefer: Return-Sensitivity-Labels\\r\\n`;\n\t\t\t\t}\n\t\t\t\tpostBody += `_post: 1\\r\\n`;\n\n\t\t\t\tlet requestBody: IJoinSessionBody | undefined;\n\t\t\t\tif (requestSocketToken) {\n\t\t\t\t\trequestBody = { ...requestBody, requestSocketToken: true };\n\t\t\t\t}\n\t\t\t\tif (displayName) {\n\t\t\t\t\trequestBody = { ...requestBody, displayName };\n\t\t\t\t}\n\t\t\t\tif (requestBody) {\n\t\t\t\t\tpostBody += `\\r\\n${JSON.stringify(requestBody)}\\r\\n`;\n\t\t\t\t}\n\t\t\t\tpostBody += `\\r\\n--${formBoundary}--`;\n\t\t\t\tconst headers: { [index: string]: string } = {\n\t\t\t\t\t\"Content-Type\": `multipart/form-data;boundary=${formBoundary}`,\n\t\t\t\t};\n\n\t\t\t\tconst response = await runWithRetry(\n\t\t\t\t\tasync () =>\n\t\t\t\t\t\tepochTracker.fetchAndParseAsJSON<ISocketStorageDiscovery>(\n\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t{ method, headers, body: postBody },\n\t\t\t\t\t\t\t\"joinSession\",\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t),\n\t\t\t\t\t\"joinSession\",\n\t\t\t\t\tlogger,\n\t\t\t\t);\n\n\t\t\t\tconst socketUrl = response.content.deltaStreamSocketUrl;\n\t\t\t\t// expecting socketUrl to be something like https://{hostName}/...\n\t\t\t\tconst webSocketHostName = socketUrl.split(\"/\")[2];\n\n\t\t\t\t// TODO SPO-specific telemetry\n\t\t\t\tevent.end({\n\t\t\t\t\t...response.propsToLog,\n\t\t\t\t\t// pushV2 websocket urls will contain pushf\n\t\t\t\t\tpushv2: socketUrl.includes(\"pushf\"),\n\t\t\t\t\twebSocketHostName,\n\t\t\t\t\trefreshSessionDurationSeconds: response.content.refreshSessionDurationSeconds,\n\t\t\t\t});\n\n\t\t\t\tif (response.content.runtimeTenantId && !response.content.tenantId) {\n\t\t\t\t\tresponse.content.tenantId = response.content.runtimeTenantId;\n\t\t\t\t}\n\n\t\t\t\treturn response.content;\n\t\t\t},\n\t\t);\n\t},\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver",
3
- "version": "2.71.0",
3
+ "version": "2.73.0",
4
4
  "description": "Socket storage implementation for SPO and ODC",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,27 +69,27 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "~2.71.0",
73
- "@fluidframework/core-interfaces": "~2.71.0",
74
- "@fluidframework/core-utils": "~2.71.0",
75
- "@fluidframework/driver-base": "~2.71.0",
76
- "@fluidframework/driver-definitions": "~2.71.0",
77
- "@fluidframework/driver-utils": "~2.71.0",
78
- "@fluidframework/odsp-doclib-utils": "~2.71.0",
79
- "@fluidframework/odsp-driver-definitions": "~2.71.0",
80
- "@fluidframework/telemetry-utils": "~2.71.0",
72
+ "@fluid-internal/client-utils": "~2.73.0",
73
+ "@fluidframework/core-interfaces": "~2.73.0",
74
+ "@fluidframework/core-utils": "~2.73.0",
75
+ "@fluidframework/driver-base": "~2.73.0",
76
+ "@fluidframework/driver-definitions": "~2.73.0",
77
+ "@fluidframework/driver-utils": "~2.73.0",
78
+ "@fluidframework/odsp-doclib-utils": "~2.73.0",
79
+ "@fluidframework/odsp-driver-definitions": "~2.73.0",
80
+ "@fluidframework/telemetry-utils": "~2.73.0",
81
81
  "socket.io-client": "~4.7.5",
82
82
  "uuid": "^11.1.0"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@arethetypeswrong/cli": "^0.17.1",
86
86
  "@biomejs/biome": "~1.9.3",
87
- "@fluid-internal/mocha-test-setup": "~2.71.0",
88
- "@fluid-tools/build-cli": "^0.58.3",
87
+ "@fluid-internal/mocha-test-setup": "~2.73.0",
88
+ "@fluid-tools/build-cli": "^0.60.0",
89
89
  "@fluidframework/build-common": "^2.0.3",
90
- "@fluidframework/build-tools": "^0.58.3",
91
- "@fluidframework/eslint-config-fluid": "^7.0.0",
92
- "@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.70.0",
90
+ "@fluidframework/build-tools": "^0.60.0",
91
+ "@fluidframework/eslint-config-fluid": "~2.73.0",
92
+ "@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.71.0",
93
93
  "@microsoft/api-extractor": "7.52.11",
94
94
  "@types/mocha": "^10.0.10",
95
95
  "@types/node": "^18.19.0",
package/src/contracts.ts CHANGED
@@ -9,7 +9,7 @@ import type {
9
9
  } from "@fluidframework/driver-definitions/internal";
10
10
  import type { HostStoragePolicy } from "@fluidframework/odsp-driver-definitions/internal";
11
11
 
12
- // eslint-disable-next-line import/no-deprecated
12
+ // eslint-disable-next-line import-x/no-deprecated
13
13
  import type { ISnapshotContents } from "./odspPublicUtils.js";
14
14
 
15
15
  /**
@@ -234,7 +234,7 @@ export interface IFlushOpsResponse {
234
234
  * @deprecated This will be replaced with ISnapshotCachedEntry2 which wraps the new ISnapshot interface.
235
235
  * For now, to support back compat from cache, we need to keep it for now.
236
236
  */
237
- // eslint-disable-next-line import/no-deprecated
237
+ // eslint-disable-next-line import-x/no-deprecated
238
238
  export interface ISnapshotCachedEntry extends ISnapshotContents {
239
239
  cacheEntryTime: number;
240
240
  }
@@ -22,6 +22,7 @@ import {
22
22
  type ITelemetryLoggerExt,
23
23
  PerformanceEvent,
24
24
  } from "@fluidframework/telemetry-utils/internal";
25
+
25
26
  import { v4 as uuid } from "uuid";
26
27
 
27
28
  import type {
@@ -33,6 +33,7 @@ import {
33
33
  normalizeError,
34
34
  wrapError,
35
35
  } from "@fluidframework/telemetry-utils/internal";
36
+
36
37
  import { v4 as uuid } from "uuid";
37
38
 
38
39
  import { type IVersionedValueWithEpoch, persistedCacheValueVersion } from "./contracts.js";
@@ -29,6 +29,7 @@ import {
29
29
  isFluidError,
30
30
  wrapError,
31
31
  } from "@fluidframework/telemetry-utils/internal";
32
+
32
33
  import { v4 as uuid } from "uuid";
33
34
 
34
35
  import {
@@ -35,6 +35,7 @@ import {
35
35
  type MonitoringContext,
36
36
  normalizeError,
37
37
  } from "@fluidframework/telemetry-utils/internal";
38
+
38
39
  import { v4 as uuid } from "uuid";
39
40
 
40
41
  import { policyLabelsUpdatesSignalType } from "./contracts.js";
@@ -18,6 +18,7 @@ import {
18
18
  type ITelemetryLoggerExt,
19
19
  PerformanceEvent,
20
20
  } from "@fluidframework/telemetry-utils/internal";
21
+
21
22
  import { v4 as uuid } from "uuid";
22
23
 
23
24
  import type { IDeltaStorageGetResponse, ISequencedDeltaOpMessage } from "./contracts.js";
@@ -24,6 +24,7 @@ import {
24
24
  type ITelemetryLoggerExt,
25
25
  loggerToMonitoringContext,
26
26
  } from "@fluidframework/telemetry-utils/internal";
27
+
27
28
  import type { Socket } from "socket.io-client";
28
29
  import { v4 as uuid } from "uuid";
29
30
 
@@ -13,7 +13,7 @@ import type {
13
13
  TokenFetcher,
14
14
  } from "@fluidframework/odsp-driver-definitions/internal";
15
15
 
16
- // eslint-disable-next-line import/no-internal-modules
16
+ // eslint-disable-next-line import-x/no-internal-modules
17
17
  import { LocalOdspDocumentServiceFactory } from "./localOdspDriver/localOdspDocumentServiceFactory.js";
18
18
  import { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
19
19
 
@@ -30,6 +30,7 @@ import {
30
30
  type TokenFetcher,
31
31
  } from "@fluidframework/odsp-driver-definitions/internal";
32
32
  import { PerformanceEvent, createChildLogger } from "@fluidframework/telemetry-utils/internal";
33
+
33
34
  import { v4 as uuid } from "uuid";
34
35
 
35
36
  import { useCreateNewModule } from "./createFile/index.js";
@@ -41,7 +41,7 @@ import {
41
41
  import type {
42
42
  HostStoragePolicyInternal,
43
43
  IDocumentStorageGetVersionsResponse,
44
- // eslint-disable-next-line import/no-deprecated
44
+ // eslint-disable-next-line import-x/no-deprecated
45
45
  ISnapshotCachedEntry,
46
46
  ISnapshotCachedEntry2,
47
47
  IVersionedValueWithEpoch,
@@ -298,7 +298,7 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
298
298
  )
299
299
  .then(
300
300
  async (
301
- // eslint-disable-next-line import/no-deprecated
301
+ // eslint-disable-next-line import-x/no-deprecated
302
302
  snapshotCachedEntry: ISnapshotCachedEntry | ISnapshotCachedEntry2,
303
303
  ) => {
304
304
  if (snapshotCachedEntry !== undefined) {
@@ -19,7 +19,7 @@ export const odspDriverCompatDetailsForLoader: ILayerCompatDetails = {
19
19
  /**
20
20
  * The current generation of the ODSP Driver layer.
21
21
  */
22
- generation: 1,
22
+ generation: 2,
23
23
  /**
24
24
  * The features supported by the ODSP Driver layer across the Driver / Loader boundary.
25
25
  */
package/src/odspUtils.ts CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  } from "@fluidframework/telemetry-utils/internal";
56
56
 
57
57
  import { storeLocatorInOdspUrl } from "./odspFluidFileLink.js";
58
- // eslint-disable-next-line import/no-deprecated
58
+ // eslint-disable-next-line import-x/no-deprecated
59
59
  import type { ISnapshotContents } from "./odspPublicUtils.js";
60
60
  import { pkgVersion as driverVersion } from "./packageVersion.js";
61
61
 
@@ -532,7 +532,7 @@ export function getJoinSessionCacheKey(odspResolvedUrl: IOdspResolvedUrl): strin
532
532
  * @param obj - obj whose type needs to be identified.
533
533
  */
534
534
  export function isInstanceOfISnapshot(
535
- // eslint-disable-next-line import/no-deprecated
535
+ // eslint-disable-next-line import-x/no-deprecated
536
536
  obj: ISnapshotContents | ISnapshot | undefined,
537
537
  ): obj is ISnapshot {
538
538
  return obj !== undefined && "snapshotFormatV" in obj && obj.snapshotFormatV === 1;
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/odsp-driver";
9
- export const pkgVersion = "2.71.0";
9
+ export const pkgVersion = "2.73.0";
package/src/vroom.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  type ITelemetryLoggerExt,
14
14
  PerformanceEvent,
15
15
  } from "@fluidframework/telemetry-utils/internal";
16
+
16
17
  import { v4 as uuid } from "uuid";
17
18
 
18
19
  import type { EpochTracker } from "./epochTracker.js";