@fluidframework/odsp-driver 2.116.1 → 2.118.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 (75) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/api-extractor/api-extractor-lint-pointInTime.cjs.json +5 -0
  3. package/api-extractor/api-extractor-lint-pointInTime.esm.json +5 -0
  4. package/api-extractor/api-extractor-report.pointInTime.json +9 -0
  5. package/api-report/odsp-driver.legacy.alpha.api.md +28 -1
  6. package/api-report/odsp-driver.legacy.beta.api.md +28 -1
  7. package/api-report/odsp-driver.point-in-time.legacy.beta.api.md +117 -0
  8. package/dist/index.d.ts +2 -3
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +3 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/legacy.d.ts +4 -0
  13. package/dist/legacyAlpha.d.ts +4 -0
  14. package/dist/odspDocumentServiceFactory.d.ts +46 -1
  15. package/dist/odspDocumentServiceFactory.d.ts.map +1 -1
  16. package/dist/odspDocumentServiceFactory.js +60 -1
  17. package/dist/odspDocumentServiceFactory.js.map +1 -1
  18. package/dist/odspDocumentServiceFactoryCore.d.ts +74 -3
  19. package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  20. package/dist/odspDocumentServiceFactoryCore.js +0 -3
  21. package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
  22. package/dist/packageVersion.d.ts +1 -1
  23. package/dist/packageVersion.js +1 -1
  24. package/dist/packageVersion.js.map +1 -1
  25. package/dist/pointInTime.d.ts +15 -0
  26. package/dist/pointInTime.d.ts.map +1 -0
  27. package/dist/pointInTime.js +16 -0
  28. package/dist/pointInTime.js.map +1 -0
  29. package/dist/pointInTimeDriver/createPointInTimeDocumentService.d.ts +34 -0
  30. package/dist/pointInTimeDriver/createPointInTimeDocumentService.d.ts.map +1 -0
  31. package/dist/pointInTimeDriver/createPointInTimeDocumentService.js +90 -0
  32. package/dist/pointInTimeDriver/createPointInTimeDocumentService.js.map +1 -0
  33. package/legacy/point-in-time.d.ts +6 -0
  34. package/lib/index.d.ts +2 -3
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/index.js +2 -5
  37. package/lib/index.js.map +1 -1
  38. package/lib/legacy.d.ts +4 -0
  39. package/lib/legacyAlpha.d.ts +4 -0
  40. package/lib/odspDocumentServiceFactory.d.ts +46 -1
  41. package/lib/odspDocumentServiceFactory.d.ts.map +1 -1
  42. package/lib/odspDocumentServiceFactory.js +58 -1
  43. package/lib/odspDocumentServiceFactory.js.map +1 -1
  44. package/lib/odspDocumentServiceFactoryCore.d.ts +74 -3
  45. package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
  46. package/lib/odspDocumentServiceFactoryCore.js +0 -3
  47. package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
  48. package/lib/packageVersion.d.ts +1 -1
  49. package/lib/packageVersion.js +1 -1
  50. package/lib/packageVersion.js.map +1 -1
  51. package/lib/pointInTime.d.ts +15 -0
  52. package/lib/pointInTime.d.ts.map +1 -0
  53. package/lib/pointInTime.js +12 -0
  54. package/lib/pointInTime.js.map +1 -0
  55. package/lib/pointInTimeDriver/createPointInTimeDocumentService.d.ts +34 -0
  56. package/lib/pointInTimeDriver/createPointInTimeDocumentService.d.ts.map +1 -0
  57. package/lib/pointInTimeDriver/createPointInTimeDocumentService.js +87 -0
  58. package/lib/pointInTimeDriver/createPointInTimeDocumentService.js.map +1 -0
  59. package/package.json +25 -11
  60. package/src/index.ts +7 -5
  61. package/src/odspDocumentServiceFactory.ts +103 -1
  62. package/src/odspDocumentServiceFactoryCore.ts +90 -3
  63. package/src/odspVersionManager/DEV.md +9 -8
  64. package/src/packageVersion.ts +1 -1
  65. package/src/pointInTime.ts +30 -0
  66. package/src/pointInTimeDriver/createPointInTimeDocumentService.ts +180 -0
  67. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts +0 -41
  68. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts.map +0 -1
  69. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js +0 -132
  70. package/dist/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js.map +0 -1
  71. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts +0 -41
  72. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.d.ts.map +0 -1
  73. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js +0 -128
  74. package/lib/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js.map +0 -1
  75. package/src/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.ts +0 -260
@@ -9,12 +9,68 @@ import type { IDocumentService, IDocumentServiceFactory, IPersistedCache, IResol
9
9
  import { type HostStoragePolicy, type IRelaySessionAwareDriverFactory, type ISocketStorageDiscovery, type OdspResourceTokenFetchOptions, type TokenFetcher } from "@fluidframework/odsp-driver-definitions/internal";
10
10
  import { type ICacheAndTracker } from "./epochTracker.js";
11
11
  import { type IPrefetchSnapshotContents } from "./odspCache.js";
12
+ /**
13
+ * An ODSP document service factory that supports point-in-time (sequence-number-based) loading.
14
+ *
15
+ * @remarks
16
+ * The loader detects this capability structurally, so hosts can pass this factory directly to
17
+ * {@link @fluidframework/container-loader#loadContainerToSequenceNumber}.
18
+ *
19
+ * @legacy @beta
20
+ */
21
+ export interface IPointInTimeDocumentServiceFactory extends IDocumentServiceFactory {
22
+ /**
23
+ * Creates a document service that materializes the document at the requested sequence number.
24
+ *
25
+ * @param resolvedUrl - The resolved ODSP {@link @fluidframework/driver-definitions#IResolvedUrl}.
26
+ * @param targetSequenceNumber - The sequence number at which to materialize the document. See
27
+ * {@link @fluidframework/container-loader#ILoadContainerToSequenceNumberProps.loadToSequenceNumber}.
28
+ * @param logger - Optional {@link @fluidframework/core-interfaces#ITelemetryBaseLogger}.
29
+ * @param clientIsSummarizer - Whether to apply summarizer policies and telemetry to the
30
+ * underlying document services. Defaults to `false`.
31
+ * @returns A read-only {@link @fluidframework/driver-definitions#IDocumentService} materialized
32
+ * at the requested sequence number.
33
+ */
34
+ createPointInTimeDocumentService(resolvedUrl: IResolvedUrl, targetSequenceNumber: number, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
35
+ }
36
+ /**
37
+ * Inputs supplied by the ODSP document service factory to an injected point-in-time implementation.
38
+ *
39
+ * @legacy @beta
40
+ */
41
+ export interface IOdspPointInTimeDocumentServiceImplementationProps {
42
+ /** The resolved ODSP URL for the document to materialize. */
43
+ readonly resolvedUrl: IResolvedUrl;
44
+ /** The sequence number at which to materialize the document. */
45
+ readonly targetSequenceNumber: number;
46
+ /** Optional telemetry logger for the point-in-time load. */
47
+ readonly logger?: ITelemetryBaseLogger;
48
+ /** Whether to apply summarizer policies and telemetry. Defaults to `false`. */
49
+ readonly clientIsSummarizer?: boolean;
50
+ /** The persisted ODSP cache supplied to the document service factory. */
51
+ readonly persistedCache: IPersistedCache;
52
+ /** Fetches storage access tokens for ODSP requests. */
53
+ readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;
54
+ /**
55
+ * Creates an ODSP document service for a resolved URL.
56
+ *
57
+ * @param resolvedUrl - The resolved URL for the document or file version to load.
58
+ * @param logger - The telemetry logger for the document service.
59
+ * @param cacheAndTracker - The cache and epoch tracker shared by the point-in-time load.
60
+ * @param clientIsSummarizer - Whether to apply summarizer policies and telemetry.
61
+ * @returns The document service for the resolved URL.
62
+ */
63
+ readonly createDocumentService: (resolvedUrl: IResolvedUrl, logger: ITelemetryBaseLogger, cacheAndTracker: ICacheAndTracker, clientIsSummarizer?: boolean) => Promise<IDocumentService>;
64
+ }
65
+ /**
66
+ * Consumer-provided implementation of ODSP point-in-time loading.
67
+ *
68
+ * @legacy @beta
69
+ */
70
+ export type OdspPointInTimeDocumentServiceImplementation = (props: IOdspPointInTimeDocumentServiceImplementationProps) => Promise<IDocumentService>;
12
71
  /**
13
72
  * Factory for creating the sharepoint document service. Use this if you want to
14
73
  * use the sharepoint implementation.
15
- *
16
- * This constructor should be used by environments that support dynamic imports and that wish
17
- * to leverage code splitting as a means to keep bundles as small as possible.
18
74
  * @legacy
19
75
  * @beta
20
76
  */
@@ -54,6 +110,21 @@ export declare class OdspDocumentServiceFactoryCore implements IDocumentServiceF
54
110
  */
55
111
  readonly ILayerCompatDetails?: unknown;
56
112
  createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
113
+ /**
114
+ * Creates a document service that reads its snapshot from the closest file version at or before
115
+ * the target and its deltas from the live document, materializing a requested sequence number
116
+ * through replay.
117
+ *
118
+ * @param resolvedUrl - The resolved ODSP {@link @fluidframework/driver-definitions#IResolvedUrl}.
119
+ * @param targetSequenceNumber - The sequence number at which to materialize the document. See
120
+ * {@link @fluidframework/container-loader#ILoadContainerToSequenceNumberProps.loadToSequenceNumber}.
121
+ * @param logger - Optional {@link @fluidframework/core-interfaces#ITelemetryBaseLogger}.
122
+ * @param clientIsSummarizer - Whether to apply summarizer policies and telemetry to the
123
+ * underlying document services. Defaults to `false`.
124
+ * @returns A read-only {@link @fluidframework/driver-definitions#IDocumentService} materialized
125
+ * at the requested sequence number.
126
+ */
127
+ readonly createPointInTimeDocumentService?: IPointInTimeDocumentServiceFactory["createPointInTimeDocumentService"];
57
128
  protected createDocumentServiceCore(resolvedUrl: IResolvedUrl, odspLogger: ITelemetryBaseLogger, cacheAndTrackerArg?: ICacheAndTracker, clientIsSummarizer?: boolean): Promise<IDocumentService>;
58
129
  }
59
130
  //# sourceMappingURL=odspDocumentServiceFactoryCore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"odspDocumentServiceFactoryCore.d.ts","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryCore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EAAE,Y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AwB,CAAC,CAAS;IAEnD,IAAW,2BAA2B,IAAI,YAAY,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAExF;IAGD,IAAW,+BAA+B,IAAI,IAAI,CAEjD;IAED;;;;;OAKG;IACU,0BAA0B,CACtC,WAAW,EAAE,YAAY,GACvB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC;IAQlC,eAAe,CAC3B,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAwH5B;;;;;;;;OAQG;gBAEe,eAAe,EAAE,YAAY,CAAC,6BAA6B,CAAC,EAC5D,iBAAiB,EAC/B,YAAY,CAAC,6BAA6B,CAAC,GAC3C,SAAS,EACF,cAAc,GAAE,eAA4C,EACrD,UAAU,GAAE,iBAAsB;IAcpD;;;;;;OAMG;IACH,SAAgB,mBAAmB,CAAC,EAAE,OAAO,CAAoC;IAEpE,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAS5B;;;;;;;;;;;;;OAaG;IACH,SAAgB,gCAAgC,CAAC,EAAE,kCAAkC,CAAC,kCAAkC,CAAC,CAAC;cAE1G,yBAAyB,CACxC,WAAW,EAAE,YAAY,EACzB,UAAU,EAAE,oBAAoB,EAChC,kBAAkB,CAAC,EAAE,gBAAgB,EACrC,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAsD5B"}
@@ -18,9 +18,6 @@ const odspUtils_js_1 = require("./odspUtils.js");
18
18
  /**
19
19
  * Factory for creating the sharepoint document service. Use this if you want to
20
20
  * use the sharepoint implementation.
21
- *
22
- * This constructor should be used by environments that support dynamic imports and that wish
23
- * to leverage code splitting as a means to keep bundles as small as possible.
24
21
  * @legacy
25
22
  * @beta
26
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"odspDocumentServiceFactoryCore.js","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryCore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,oEAG+C;AAC/C,+EAW0D;AAC1D,uEAA+F;AAC/F,+BAAkC;AAElC,oDAA2D;AAC3D,uDAAqF;AACrF,iDAKwB;AACxB,qEAA+D;AAC/D,uEAA6E;AAC7E,iDASwB;AAExB;;;;;;;;GAQG;AACH,MAAa,8BAA8B;IAM1C,IAAW,2BAA2B;QACrC,OAAO,IAAI,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;IAC5D,CAAC;IAED,qFAAqF;IACrF,IAAW,+BAA+B;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,0BAA0B,CACtC,WAAyB;QAEzB,MAAM,eAAe,GAAG,IAAA,iCAAkB,EAAC,WAAW,CAAC,CAAC;QACxD,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,CAC7E,IAAA,qCAAsB,EAAC,eAAe,CAAC,CACvC,CAAC;QACF,OAAO,mBAAmB,EAAE,mBAAmB,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,eAAe,GAAG,IAAA,iCAAkB,EAAC,oBAAoB,CAAC,CAAC;QACjE,MAAM,eAAe,GAAkB;YACtC,OAAO,EAAE,eAAe,CAAC,OAAO;YAChC,OAAO,EAAE,eAAe,CAAC,OAAO;YAChC,MAAM,EAAE,eAAe,CAAC,MAAM;SAC9B,CAAC;QAEF,IAAI,QAA0C,CAAC;QAC/C,IAAI,oBAAkD,CAAC;QACvD,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;YAC5B,QAAQ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,CAAC,sBAAsB,CAC3B,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;QAEpC,OAAO,4CAAmB,CAAC,MAAM,CAChC,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,SAAS,EACT,eAAe,CAAC,KAAK,EACrB,IAAI,CAAC,UAAU,EACf,eAAe,CAAC,YAAY,EAC5B,IAAI,CAAC,wBAAwB,EAC7B,kBAAkB,CAClB,CAAC;IACH,CAAC;CACD;AA1QD,wEA0QC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAC5B,UAA6B,EAC7B,YAA6B;IAE7B,kGAAkG;IAClG,IAAI,oBAAkD,CAAC;IACvD,IAAI,UAAU,CAAC,yCAAyC,EAAE,CAAC;QAC1D,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC5D,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,eAAe,IAAI,2BAAgB,CAAC,eAAe,CAAC,EAAE,CAAC;YAC1D,oBAAoB,GAAG;gBACtB,mEAAmE;gBACnE,KAAK,EAAE,2BAAgB,CAAC,eAAe,CAAC;gBACxC,GAAG,CAAC,cAAc,IAAI,0BAAe,CAAC,cAAc,CAAC;oBACpD,CAAC,CAAC,mEAAmE;wBACpE,EAAE,IAAI,EAAE,0BAAe,CAAC,cAAc,CAAC,EAAE;oBAC1C,CAAC,CAAC,EAAE,CAAC;aACN,CAAC;QACH,CAAC;IACF,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport type { PromiseCache } from \"@fluidframework/core-utils/internal\";\nimport type { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIFileEntry,\n\tIPersistedCache,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tgetDocAttributesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\ttype HostStoragePolicy,\n\ttype IOdspUrlParts,\n\ttype IRelaySessionAwareDriverFactory,\n\ttype ISharingLinkKind,\n\ttype ISocketStorageDiscovery,\n\ttype OdspResourceTokenFetchOptions,\n\tSharingLinkRole,\n\tSharingLinkScope,\n\ttype TokenFetchOptions,\n\ttype TokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport { PerformanceEvent, createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { useCreateNewModule } from \"./createFile/index.js\";\nimport { type ICacheAndTracker, createOdspCacheAndTracker } from \"./epochTracker.js\";\nimport {\n\ttype INonPersistentCache,\n\ttype IPrefetchSnapshotContents,\n\tLocalPersistentCache,\n\tNonPersistentCache,\n} from \"./odspCache.js\";\nimport { OdspDocumentService } from \"./odspDocumentService.js\";\nimport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\nimport {\n\ttype IExistingFileInfo,\n\ttype INewFileInfo,\n\tcreateOdspLogger,\n\tgetJoinSessionCacheKey,\n\tgetOdspResolvedUrl,\n\tisNewFileInfo,\n\ttoInstrumentedOdspStorageTokenFetcher,\n\ttoInstrumentedOdspTokenFetcher,\n} from \"./odspUtils.js\";\n\n/**\n * Factory for creating the sharepoint document service. Use this if you want to\n * use the sharepoint implementation.\n *\n * This constructor should be used by environments that support dynamic imports and that wish\n * to leverage code splitting as a means to keep bundles as small as possible.\n * @legacy\n * @beta\n */\nexport class OdspDocumentServiceFactoryCore\n\timplements IDocumentServiceFactory, IRelaySessionAwareDriverFactory\n{\n\tprivate readonly nonPersistentCache: INonPersistentCache = new NonPersistentCache();\n\tprivate readonly socketReferenceKeyPrefix?: string;\n\n\tpublic get snapshotPrefetchResultCache(): PromiseCache<string, IPrefetchSnapshotContents> {\n\t\treturn this.nonPersistentCache.snapshotPrefetchResultCache;\n\t}\n\n\t// TODO: return `IRelaySessionAwareDriverFactory` instead of `this` (breaking change)\n\tpublic get IRelaySessionAwareDriverFactory(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * This function would return info about relay service session only if this factory established (or attempted to\n\t * establish) connection very recently. Otherwise, it will return undefined.\n\t * @param resolvedUrl - resolved url for container\n\t * @returns The current join session response stored in cache. `undefined` if not present.\n\t */\n\tpublic async getRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst joinSessionResponse = await this.nonPersistentCache.sessionJoinCache.get(\n\t\t\tgetJoinSessionCacheKey(odspResolvedUrl),\n\t\t);\n\t\treturn joinSessionResponse?.joinSessionResponse;\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(createNewResolvedUrl);\n\t\tconst resolvedUrlData: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\n\t\tlet fileInfo: INewFileInfo | IExistingFileInfo;\n\t\tlet createShareLinkParam: ISharingLinkKind | undefined;\n\t\tif (odspResolvedUrl.itemId) {\n\t\t\tfileInfo = {\n\t\t\t\ttype: \"Existing\",\n\t\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\t\titemId: odspResolvedUrl.itemId,\n\t\t\t};\n\t\t} else if (odspResolvedUrl.fileName) {\n\t\t\tconst [, queryString] = odspResolvedUrl.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst filePath = searchParams.get(\"path\");\n\t\t\tif (filePath === undefined || filePath === null) {\n\t\t\t\tthrow new Error(\"File path should be provided!!\");\n\t\t\t}\n\t\t\tcreateShareLinkParam = getSharingLinkParams(this.hostPolicy, searchParams);\n\t\t\tfileInfo = {\n\t\t\t\ttype: \"New\",\n\t\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\t\tfilePath,\n\t\t\t\tfilename: odspResolvedUrl.fileName,\n\t\t\t\tcreateLinkType: createShareLinkParam,\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new Error(\"A new or existing file must be specified to create container!\");\n\t\t}\n\n\t\tif (isCombinedAppAndProtocolSummary(createNewSummary)) {\n\t\t\tconst documentAttributes = getDocAttributesFromProtocolSummary(\n\t\t\t\tcreateNewSummary.tree[\".protocol\"],\n\t\t\t);\n\t\t\tif (documentAttributes?.sequenceNumber !== 0) {\n\t\t\t\tthrow new Error(\"Seq number in detached ODSP container should be 0\");\n\t\t\t}\n\t\t}\n\n\t\tconst odspLogger = createOdspLogger(logger);\n\n\t\tconst fileEntry: IFileEntry = {\n\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\tfileVersion: undefined,\n\t\t};\n\t\tconst cacheAndTracker = createOdspCacheAndTracker(\n\t\t\tthis.persistedCache,\n\t\t\tthis.nonPersistentCache,\n\t\t\tfileEntry,\n\t\t\todspLogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\todspLogger,\n\t\t\t{\n\t\t\t\teventName: \"CreateNew\",\n\t\t\t\tisWithSummaryUpload: true,\n\t\t\t\tcreateShareLinkParam: createShareLinkParam\n\t\t\t\t\t? JSON.stringify(createShareLinkParam)\n\t\t\t\t\t: undefined,\n\t\t\t\tenableSingleRequestForShareLinkWithCreate:\n\t\t\t\t\tthis.hostPolicy.enableSingleRequestForShareLinkWithCreate,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst getAuthHeader = toInstrumentedOdspStorageTokenFetcher(\n\t\t\t\t\todspLogger,\n\t\t\t\t\tresolvedUrlData,\n\t\t\t\t\tthis.getStorageToken,\n\t\t\t\t);\n\t\t\t\tconst _odspResolvedUrl = await useCreateNewModule(odspLogger, async (module) => {\n\t\t\t\t\treturn isNewFileInfo(fileInfo)\n\t\t\t\t\t\t? module.createNewFluidFile(\n\t\t\t\t\t\t\t\tgetAuthHeader,\n\t\t\t\t\t\t\t\tfileInfo,\n\t\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\t\tcreateNewSummary,\n\t\t\t\t\t\t\t\tcacheAndTracker.epochTracker,\n\t\t\t\t\t\t\t\tfileEntry,\n\t\t\t\t\t\t\t\tthis.hostPolicy.cacheCreateNewSummary ?? true,\n\t\t\t\t\t\t\t\t!!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t\t\t\todspResolvedUrl.isClpCompliantApp,\n\t\t\t\t\t\t\t\tthis.hostPolicy.enableSingleRequestForShareLinkWithCreate,\n\t\t\t\t\t\t\t\todspResolvedUrl,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: module.createNewContainerOnExistingFile(\n\t\t\t\t\t\t\t\tgetAuthHeader,\n\t\t\t\t\t\t\t\tfileInfo,\n\t\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\t\tcreateNewSummary,\n\t\t\t\t\t\t\t\tcacheAndTracker.epochTracker,\n\t\t\t\t\t\t\t\tfileEntry,\n\t\t\t\t\t\t\t\tthis.hostPolicy.cacheCreateNewSummary ?? true,\n\t\t\t\t\t\t\t\t!!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t\t\t\todspResolvedUrl.isClpCompliantApp,\n\t\t\t\t\t\t\t\todspResolvedUrl.fileMetadata?.eTag,\n\t\t\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tconst docService = this.createDocumentServiceCore(\n\t\t\t\t\t_odspResolvedUrl,\n\t\t\t\t\todspLogger,\n\t\t\t\t\tcacheAndTracker,\n\t\t\t\t\tclientIsSummarizer,\n\t\t\t\t);\n\t\t\t\tevent.end({\n\t\t\t\t\tdocId: _odspResolvedUrl.hashedDocumentId,\n\t\t\t\t});\n\t\t\t\treturn docService;\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @param getStorageToken - function that can provide the storage token for a given site. This is\n\t * is also referred to as the \"Vroom\" token in SPO.\n\t * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also\n\t * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n\t * response payload.\n\t * @param persistedCache - PersistedCache provided by host for use in this session.\n\t * @param hostPolicy - Policy for storage provided by host.\n\t */\n\tconstructor(\n\t\tprivate readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\t\tprivate readonly getWebsocketToken:\n\t\t\t| TokenFetcher<OdspResourceTokenFetchOptions>\n\t\t\t| undefined,\n\t\tprotected persistedCache: IPersistedCache = new LocalPersistentCache(),\n\t\tprivate readonly hostPolicy: HostStoragePolicy = {},\n\t) {\n\t\tif (this.hostPolicy.isolateSocketCache === true) {\n\t\t\t// create the key to separate the socket reuse cache\n\t\t\tthis.socketReferenceKeyPrefix = uuid();\n\t\t}\n\t\t// Set enableRedeemFallback by default as true.\n\t\tthis.hostPolicy.enableRedeemFallback = this.hostPolicy.enableRedeemFallback ?? true;\n\t\tthis.hostPolicy.sessionOptions = {\n\t\t\tforceAccessTokenViaAuthorizationHeader: true,\n\t\t\t...this.hostPolicy.sessionOptions,\n\t\t};\n\t}\n\n\t/**\n\t * The compatibility details of the ODSP Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t * @remarks This is for internal use only.\n\t * The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class\n\t * is currently marked as legacy alpha. So, using unknown here.\n\t */\n\tpublic readonly ILayerCompatDetails?: unknown = odspDriverCompatDetailsForLoader;\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.createDocumentServiceCore(\n\t\t\tresolvedUrl,\n\t\t\tcreateOdspLogger(logger),\n\t\t\tundefined,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\tprotected async createDocumentServiceCore(\n\t\tresolvedUrl: IResolvedUrl,\n\t\todspLogger: ITelemetryBaseLogger,\n\t\tcacheAndTrackerArg?: ICacheAndTracker,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst extLogger = createChildLogger({ logger: odspLogger });\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst resolvedUrlData: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\n\t\tconst cacheAndTracker =\n\t\t\tcacheAndTrackerArg ??\n\t\t\tcreateOdspCacheAndTracker(\n\t\t\t\tthis.persistedCache,\n\t\t\t\tthis.nonPersistentCache,\n\t\t\t\t{\n\t\t\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\t\t\tfileVersion: odspResolvedUrl.fileVersion,\n\t\t\t\t},\n\t\t\t\textLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t);\n\n\t\tconst storageTokenFetcher = toInstrumentedOdspStorageTokenFetcher(\n\t\t\textLogger,\n\t\t\tresolvedUrlData,\n\t\t\tthis.getStorageToken,\n\t\t);\n\n\t\tconst webSocketTokenFetcher =\n\t\t\tthis.getWebsocketToken === undefined\n\t\t\t\t? undefined\n\t\t\t\t: async (options: TokenFetchOptions): Promise<string | null> =>\n\t\t\t\t\t\t// websocket expects a plain token\n\t\t\t\t\t\ttoInstrumentedOdspTokenFetcher(\n\t\t\t\t\t\t\textLogger,\n\t\t\t\t\t\t\tresolvedUrlData,\n\t\t\t\t\t\t\tthis.getWebsocketToken!,\n\t\t\t\t\t\t\tfalse /* throwOnNullToken */,\n\t\t\t\t\t\t\ttrue /* returnPlainToken */,\n\t\t\t\t\t\t)(options, \"GetWebsocketToken\");\n\n\t\treturn OdspDocumentService.create(\n\t\t\tresolvedUrl,\n\t\t\tstorageTokenFetcher,\n\t\t\twebSocketTokenFetcher,\n\t\t\textLogger,\n\t\t\tcacheAndTracker.cache,\n\t\t\tthis.hostPolicy,\n\t\t\tcacheAndTracker.epochTracker,\n\t\t\tthis.socketReferenceKeyPrefix,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n}\n\n/**\n * Extract the sharing link kind from the resolved URL's query paramerters\n */\nfunction getSharingLinkParams(\n\thostPolicy: HostStoragePolicy,\n\tsearchParams: URLSearchParams,\n): ISharingLinkKind | undefined {\n\t// extract request parameters for creation of sharing link (if provided) if the feature is enabled\n\tlet createShareLinkParam: ISharingLinkKind | undefined;\n\tif (hostPolicy.enableSingleRequestForShareLinkWithCreate) {\n\t\tconst createLinkScope = searchParams.get(\"createLinkScope\");\n\t\tconst createLinkRole = searchParams.get(\"createLinkRole\");\n\t\tif (createLinkScope && SharingLinkScope[createLinkScope]) {\n\t\t\tcreateShareLinkParam = {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tscope: SharingLinkScope[createLinkScope],\n\t\t\t\t...(createLinkRole && SharingLinkRole[createLinkRole]\n\t\t\t\t\t? // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\t\t{ role: SharingLinkRole[createLinkRole] }\n\t\t\t\t\t: {}),\n\t\t\t};\n\t\t}\n\t}\n\treturn createShareLinkParam;\n}\n"]}
1
+ {"version":3,"file":"odspDocumentServiceFactoryCore.js","sourceRoot":"","sources":["../src/odspDocumentServiceFactoryCore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,oEAG+C;AAC/C,+EAW0D;AAC1D,uEAA+F;AAC/F,+BAAkC;AAElC,oDAA2D;AAC3D,uDAAqF;AACrF,iDAKwB;AACxB,qEAA+D;AAC/D,uEAA6E;AAC7E,iDASwB;AA4ExB;;;;;GAKG;AACH,MAAa,8BAA8B;IAM1C,IAAW,2BAA2B;QACrC,OAAO,IAAI,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;IAC5D,CAAC;IAED,qFAAqF;IACrF,IAAW,+BAA+B;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,0BAA0B,CACtC,WAAyB;QAEzB,MAAM,eAAe,GAAG,IAAA,iCAAkB,EAAC,WAAW,CAAC,CAAC;QACxD,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,CAC7E,IAAA,qCAAsB,EAAC,eAAe,CAAC,CACvC,CAAC;QACF,OAAO,mBAAmB,EAAE,mBAAmB,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,MAAM,eAAe,GAAG,IAAA,iCAAkB,EAAC,oBAAoB,CAAC,CAAC;QACjE,MAAM,eAAe,GAAkB;YACtC,OAAO,EAAE,eAAe,CAAC,OAAO;YAChC,OAAO,EAAE,eAAe,CAAC,OAAO;YAChC,MAAM,EAAE,eAAe,CAAC,MAAM;SAC9B,CAAC;QAEF,IAAI,QAA0C,CAAC;QAC/C,IAAI,oBAAkD,CAAC;QACvD,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;YAC5B,QAAQ,GAAG;gBACV,IAAI,EA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3B,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;QAEpC,OAAO,4CAAmB,CAAC,MAAM,CAChC,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,SAAS,EACT,eAAe,CAAC,KAAK,EACrB,IAAI,CAAC,UAAU,EACf,eAAe,CAAC,YAAY,EAC5B,IAAI,CAAC,wBAAwB,EAC7B,kBAAkB,CAClB,CAAC;IACH,CAAC;CACD;AA1RD,wEA0RC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAC5B,UAA6B,EAC7B,YAA6B;IAE7B,kGAAkG;IAClG,IAAI,oBAAkD,CAAC;IACvD,IAAI,UAAU,CAAC,yCAAyC,EAAE,CAAC;QAC1D,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC5D,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,eAAe,IAAI,2BAAgB,CAAC,eAAe,CAAC,EAAE,CAAC;YAC1D,oBAAoB,GAAG;gBACtB,mEAAmE;gBACnE,KAAK,EAAE,2BAAgB,CAAC,eAAe,CAAC;gBACxC,GAAG,CAAC,cAAc,IAAI,0BAAe,CAAC,cAAc,CAAC;oBACpD,CAAC,CAAC,mEAAmE;wBACpE,EAAE,IAAI,EAAE,0BAAe,CAAC,cAAc,CAAC,EAAE;oBAC1C,CAAC,CAAC,EAAE,CAAC;aACN,CAAC;QACH,CAAC;IACF,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport type { PromiseCache } from \"@fluidframework/core-utils/internal\";\nimport type { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIFileEntry,\n\tIPersistedCache,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tgetDocAttributesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"@fluidframework/driver-utils/internal\";\nimport {\n\ttype HostStoragePolicy,\n\ttype IOdspUrlParts,\n\ttype IRelaySessionAwareDriverFactory,\n\ttype ISharingLinkKind,\n\ttype ISocketStorageDiscovery,\n\ttype OdspResourceTokenFetchOptions,\n\tSharingLinkRole,\n\tSharingLinkScope,\n\ttype TokenFetchOptions,\n\ttype TokenFetcher,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport { PerformanceEvent, createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { useCreateNewModule } from \"./createFile/index.js\";\nimport { type ICacheAndTracker, createOdspCacheAndTracker } from \"./epochTracker.js\";\nimport {\n\ttype INonPersistentCache,\n\ttype IPrefetchSnapshotContents,\n\tLocalPersistentCache,\n\tNonPersistentCache,\n} from \"./odspCache.js\";\nimport { OdspDocumentService } from \"./odspDocumentService.js\";\nimport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\nimport {\n\ttype IExistingFileInfo,\n\ttype INewFileInfo,\n\tcreateOdspLogger,\n\tgetJoinSessionCacheKey,\n\tgetOdspResolvedUrl,\n\tisNewFileInfo,\n\ttoInstrumentedOdspStorageTokenFetcher,\n\ttoInstrumentedOdspTokenFetcher,\n} from \"./odspUtils.js\";\n\n/**\n * An ODSP document service factory that supports point-in-time (sequence-number-based) loading.\n *\n * @remarks\n * The loader detects this capability structurally, so hosts can pass this factory directly to\n * {@link @fluidframework/container-loader#loadContainerToSequenceNumber}.\n *\n * @legacy @beta\n */\nexport interface IPointInTimeDocumentServiceFactory extends IDocumentServiceFactory {\n\t/**\n\t * Creates a document service that materializes the document at the requested sequence number.\n\t *\n\t * @param resolvedUrl - The resolved ODSP {@link @fluidframework/driver-definitions#IResolvedUrl}.\n\t * @param targetSequenceNumber - The sequence number at which to materialize the document. See\n\t * {@link @fluidframework/container-loader#ILoadContainerToSequenceNumberProps.loadToSequenceNumber}.\n\t * @param logger - Optional {@link @fluidframework/core-interfaces#ITelemetryBaseLogger}.\n\t * @param clientIsSummarizer - Whether to apply summarizer policies and telemetry to the\n\t * underlying document services. Defaults to `false`.\n\t * @returns A read-only {@link @fluidframework/driver-definitions#IDocumentService} materialized\n\t * at the requested sequence number.\n\t */\n\tcreatePointInTimeDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\ttargetSequenceNumber: number,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Inputs supplied by the ODSP document service factory to an injected point-in-time implementation.\n *\n * @legacy @beta\n */\nexport interface IOdspPointInTimeDocumentServiceImplementationProps {\n\t/** The resolved ODSP URL for the document to materialize. */\n\treadonly resolvedUrl: IResolvedUrl;\n\t/** The sequence number at which to materialize the document. */\n\treadonly targetSequenceNumber: number;\n\t/** Optional telemetry logger for the point-in-time load. */\n\treadonly logger?: ITelemetryBaseLogger;\n\t/** Whether to apply summarizer policies and telemetry. Defaults to `false`. */\n\treadonly clientIsSummarizer?: boolean;\n\t/** The persisted ODSP cache supplied to the document service factory. */\n\treadonly persistedCache: IPersistedCache;\n\t/** Fetches storage access tokens for ODSP requests. */\n\treadonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>;\n\t/**\n\t * Creates an ODSP document service for a resolved URL.\n\t *\n\t * @param resolvedUrl - The resolved URL for the document or file version to load.\n\t * @param logger - The telemetry logger for the document service.\n\t * @param cacheAndTracker - The cache and epoch tracker shared by the point-in-time load.\n\t * @param clientIsSummarizer - Whether to apply summarizer policies and telemetry.\n\t * @returns The document service for the resolved URL.\n\t */\n\treadonly createDocumentService: (\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger: ITelemetryBaseLogger,\n\t\tcacheAndTracker: ICacheAndTracker,\n\t\tclientIsSummarizer?: boolean,\n\t) => Promise<IDocumentService>;\n}\n\n/**\n * Consumer-provided implementation of ODSP point-in-time loading.\n *\n * @legacy @beta\n */\nexport type OdspPointInTimeDocumentServiceImplementation = (\n\tprops: IOdspPointInTimeDocumentServiceImplementationProps,\n) => Promise<IDocumentService>;\n\n/**\n * Factory for creating the sharepoint document service. Use this if you want to\n * use the sharepoint implementation.\n * @legacy\n * @beta\n */\nexport class OdspDocumentServiceFactoryCore\n\timplements IDocumentServiceFactory, IRelaySessionAwareDriverFactory\n{\n\tprivate readonly nonPersistentCache: INonPersistentCache = new NonPersistentCache();\n\tprivate readonly socketReferenceKeyPrefix?: string;\n\n\tpublic get snapshotPrefetchResultCache(): PromiseCache<string, IPrefetchSnapshotContents> {\n\t\treturn this.nonPersistentCache.snapshotPrefetchResultCache;\n\t}\n\n\t// TODO: return `IRelaySessionAwareDriverFactory` instead of `this` (breaking change)\n\tpublic get IRelaySessionAwareDriverFactory(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * This function would return info about relay service session only if this factory established (or attempted to\n\t * establish) connection very recently. Otherwise, it will return undefined.\n\t * @param resolvedUrl - resolved url for container\n\t * @returns The current join session response stored in cache. `undefined` if not present.\n\t */\n\tpublic async getRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst joinSessionResponse = await this.nonPersistentCache.sessionJoinCache.get(\n\t\t\tgetJoinSessionCacheKey(odspResolvedUrl),\n\t\t);\n\t\treturn joinSessionResponse?.joinSessionResponse;\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(createNewResolvedUrl);\n\t\tconst resolvedUrlData: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\n\t\tlet fileInfo: INewFileInfo | IExistingFileInfo;\n\t\tlet createShareLinkParam: ISharingLinkKind | undefined;\n\t\tif (odspResolvedUrl.itemId) {\n\t\t\tfileInfo = {\n\t\t\t\ttype: \"Existing\",\n\t\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\t\titemId: odspResolvedUrl.itemId,\n\t\t\t};\n\t\t} else if (odspResolvedUrl.fileName) {\n\t\t\tconst [, queryString] = odspResolvedUrl.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst filePath = searchParams.get(\"path\");\n\t\t\tif (filePath === undefined || filePath === null) {\n\t\t\t\tthrow new Error(\"File path should be provided!!\");\n\t\t\t}\n\t\t\tcreateShareLinkParam = getSharingLinkParams(this.hostPolicy, searchParams);\n\t\t\tfileInfo = {\n\t\t\t\ttype: \"New\",\n\t\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\t\tfilePath,\n\t\t\t\tfilename: odspResolvedUrl.fileName,\n\t\t\t\tcreateLinkType: createShareLinkParam,\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new Error(\"A new or existing file must be specified to create container!\");\n\t\t}\n\n\t\tif (isCombinedAppAndProtocolSummary(createNewSummary)) {\n\t\t\tconst documentAttributes = getDocAttributesFromProtocolSummary(\n\t\t\t\tcreateNewSummary.tree[\".protocol\"],\n\t\t\t);\n\t\t\tif (documentAttributes?.sequenceNumber !== 0) {\n\t\t\t\tthrow new Error(\"Seq number in detached ODSP container should be 0\");\n\t\t\t}\n\t\t}\n\n\t\tconst odspLogger = createOdspLogger(logger);\n\n\t\tconst fileEntry: IFileEntry = {\n\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\tfileVersion: undefined,\n\t\t};\n\t\tconst cacheAndTracker = createOdspCacheAndTracker(\n\t\t\tthis.persistedCache,\n\t\t\tthis.nonPersistentCache,\n\t\t\tfileEntry,\n\t\t\todspLogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\todspLogger,\n\t\t\t{\n\t\t\t\teventName: \"CreateNew\",\n\t\t\t\tisWithSummaryUpload: true,\n\t\t\t\tcreateShareLinkParam: createShareLinkParam\n\t\t\t\t\t? JSON.stringify(createShareLinkParam)\n\t\t\t\t\t: undefined,\n\t\t\t\tenableSingleRequestForShareLinkWithCreate:\n\t\t\t\t\tthis.hostPolicy.enableSingleRequestForShareLinkWithCreate,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst getAuthHeader = toInstrumentedOdspStorageTokenFetcher(\n\t\t\t\t\todspLogger,\n\t\t\t\t\tresolvedUrlData,\n\t\t\t\t\tthis.getStorageToken,\n\t\t\t\t);\n\t\t\t\tconst _odspResolvedUrl = await useCreateNewModule(odspLogger, async (module) => {\n\t\t\t\t\treturn isNewFileInfo(fileInfo)\n\t\t\t\t\t\t? module.createNewFluidFile(\n\t\t\t\t\t\t\t\tgetAuthHeader,\n\t\t\t\t\t\t\t\tfileInfo,\n\t\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\t\tcreateNewSummary,\n\t\t\t\t\t\t\t\tcacheAndTracker.epochTracker,\n\t\t\t\t\t\t\t\tfileEntry,\n\t\t\t\t\t\t\t\tthis.hostPolicy.cacheCreateNewSummary ?? true,\n\t\t\t\t\t\t\t\t!!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t\t\t\todspResolvedUrl.isClpCompliantApp,\n\t\t\t\t\t\t\t\tthis.hostPolicy.enableSingleRequestForShareLinkWithCreate,\n\t\t\t\t\t\t\t\todspResolvedUrl,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: module.createNewContainerOnExistingFile(\n\t\t\t\t\t\t\t\tgetAuthHeader,\n\t\t\t\t\t\t\t\tfileInfo,\n\t\t\t\t\t\t\t\todspLogger,\n\t\t\t\t\t\t\t\tcreateNewSummary,\n\t\t\t\t\t\t\t\tcacheAndTracker.epochTracker,\n\t\t\t\t\t\t\t\tfileEntry,\n\t\t\t\t\t\t\t\tthis.hostPolicy.cacheCreateNewSummary ?? true,\n\t\t\t\t\t\t\t\t!!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader,\n\t\t\t\t\t\t\t\todspResolvedUrl.isClpCompliantApp,\n\t\t\t\t\t\t\t\todspResolvedUrl.fileMetadata?.eTag,\n\t\t\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tconst docService = this.createDocumentServiceCore(\n\t\t\t\t\t_odspResolvedUrl,\n\t\t\t\t\todspLogger,\n\t\t\t\t\tcacheAndTracker,\n\t\t\t\t\tclientIsSummarizer,\n\t\t\t\t);\n\t\t\t\tevent.end({\n\t\t\t\t\tdocId: _odspResolvedUrl.hashedDocumentId,\n\t\t\t\t});\n\t\t\t\treturn docService;\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @param getStorageToken - function that can provide the storage token for a given site. This is\n\t * is also referred to as the \"Vroom\" token in SPO.\n\t * @param getWebsocketToken - function that can provide a token for accessing the web socket. This is also\n\t * to as the \"Push\" token in SPO. If undefined then websocket token is expected to be returned with joinSession\n\t * response payload.\n\t * @param persistedCache - PersistedCache provided by host for use in this session.\n\t * @param hostPolicy - Policy for storage provided by host.\n\t */\n\tconstructor(\n\t\tprivate readonly getStorageToken: TokenFetcher<OdspResourceTokenFetchOptions>,\n\t\tprivate readonly getWebsocketToken:\n\t\t\t| TokenFetcher<OdspResourceTokenFetchOptions>\n\t\t\t| undefined,\n\t\tprotected persistedCache: IPersistedCache = new LocalPersistentCache(),\n\t\tprivate readonly hostPolicy: HostStoragePolicy = {},\n\t) {\n\t\tif (this.hostPolicy.isolateSocketCache === true) {\n\t\t\t// create the key to separate the socket reuse cache\n\t\t\tthis.socketReferenceKeyPrefix = uuid();\n\t\t}\n\t\t// Set enableRedeemFallback by default as true.\n\t\tthis.hostPolicy.enableRedeemFallback = this.hostPolicy.enableRedeemFallback ?? true;\n\t\tthis.hostPolicy.sessionOptions = {\n\t\t\tforceAccessTokenViaAuthorizationHeader: true,\n\t\t\t...this.hostPolicy.sessionOptions,\n\t\t};\n\t}\n\n\t/**\n\t * The compatibility details of the ODSP Driver layer that is exposed to the Loader layer\n\t * for validating Loader-Driver compatibility.\n\t * @remarks This is for internal use only.\n\t * The type of this should be ILayerCompatDetails. However, ILayerCompatDetails is internal and this class\n\t * is currently marked as legacy alpha. So, using unknown here.\n\t */\n\tpublic readonly ILayerCompatDetails?: unknown = odspDriverCompatDetailsForLoader;\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.createDocumentServiceCore(\n\t\t\tresolvedUrl,\n\t\t\tcreateOdspLogger(logger),\n\t\t\tundefined,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a document service that reads its snapshot from the closest file version at or before\n\t * the target and its deltas from the live document, materializing a requested sequence number\n\t * through replay.\n\t *\n\t * @param resolvedUrl - The resolved ODSP {@link @fluidframework/driver-definitions#IResolvedUrl}.\n\t * @param targetSequenceNumber - The sequence number at which to materialize the document. See\n\t * {@link @fluidframework/container-loader#ILoadContainerToSequenceNumberProps.loadToSequenceNumber}.\n\t * @param logger - Optional {@link @fluidframework/core-interfaces#ITelemetryBaseLogger}.\n\t * @param clientIsSummarizer - Whether to apply summarizer policies and telemetry to the\n\t * underlying document services. Defaults to `false`.\n\t * @returns A read-only {@link @fluidframework/driver-definitions#IDocumentService} materialized\n\t * at the requested sequence number.\n\t */\n\tpublic readonly createPointInTimeDocumentService?: IPointInTimeDocumentServiceFactory[\"createPointInTimeDocumentService\"];\n\n\tprotected async createDocumentServiceCore(\n\t\tresolvedUrl: IResolvedUrl,\n\t\todspLogger: ITelemetryBaseLogger,\n\t\tcacheAndTrackerArg?: ICacheAndTracker,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst extLogger = createChildLogger({ logger: odspLogger });\n\t\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\t\tconst resolvedUrlData: IOdspUrlParts = {\n\t\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\t\tdriveId: odspResolvedUrl.driveId,\n\t\t\titemId: odspResolvedUrl.itemId,\n\t\t};\n\n\t\tconst cacheAndTracker =\n\t\t\tcacheAndTrackerArg ??\n\t\t\tcreateOdspCacheAndTracker(\n\t\t\t\tthis.persistedCache,\n\t\t\t\tthis.nonPersistentCache,\n\t\t\t\t{\n\t\t\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\t\t\tfileVersion: odspResolvedUrl.fileVersion,\n\t\t\t\t},\n\t\t\t\textLogger,\n\t\t\t\tclientIsSummarizer,\n\t\t\t);\n\n\t\tconst storageTokenFetcher = toInstrumentedOdspStorageTokenFetcher(\n\t\t\textLogger,\n\t\t\tresolvedUrlData,\n\t\t\tthis.getStorageToken,\n\t\t);\n\n\t\tconst webSocketTokenFetcher =\n\t\t\tthis.getWebsocketToken === undefined\n\t\t\t\t? undefined\n\t\t\t\t: async (options: TokenFetchOptions): Promise<string | null> =>\n\t\t\t\t\t\t// websocket expects a plain token\n\t\t\t\t\t\ttoInstrumentedOdspTokenFetcher(\n\t\t\t\t\t\t\textLogger,\n\t\t\t\t\t\t\tresolvedUrlData,\n\t\t\t\t\t\t\tthis.getWebsocketToken!,\n\t\t\t\t\t\t\tfalse /* throwOnNullToken */,\n\t\t\t\t\t\t\ttrue /* returnPlainToken */,\n\t\t\t\t\t\t)(options, \"GetWebsocketToken\");\n\n\t\treturn OdspDocumentService.create(\n\t\t\tresolvedUrl,\n\t\t\tstorageTokenFetcher,\n\t\t\twebSocketTokenFetcher,\n\t\t\textLogger,\n\t\t\tcacheAndTracker.cache,\n\t\t\tthis.hostPolicy,\n\t\t\tcacheAndTracker.epochTracker,\n\t\t\tthis.socketReferenceKeyPrefix,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n}\n\n/**\n * Extract the sharing link kind from the resolved URL's query paramerters\n */\nfunction getSharingLinkParams(\n\thostPolicy: HostStoragePolicy,\n\tsearchParams: URLSearchParams,\n): ISharingLinkKind | undefined {\n\t// extract request parameters for creation of sharing link (if provided) if the feature is enabled\n\tlet createShareLinkParam: ISharingLinkKind | undefined;\n\tif (hostPolicy.enableSingleRequestForShareLinkWithCreate) {\n\t\tconst createLinkScope = searchParams.get(\"createLinkScope\");\n\t\tconst createLinkRole = searchParams.get(\"createLinkRole\");\n\t\tif (createLinkScope && SharingLinkScope[createLinkScope]) {\n\t\t\tcreateShareLinkParam = {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tscope: SharingLinkScope[createLinkScope],\n\t\t\t\t...(createLinkRole && SharingLinkRole[createLinkRole]\n\t\t\t\t\t? // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\t\t{ role: SharingLinkRole[createLinkRole] }\n\t\t\t\t\t: {}),\n\t\t\t};\n\t\t}\n\t}\n\treturn createShareLinkParam;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/odsp-driver";
8
- export declare const pkgVersion = "2.116.1";
8
+ export declare const pkgVersion = "2.118.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/odsp-driver";
11
- exports.pkgVersion = "2.116.1";
11
+ exports.pkgVersion = "2.118.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/odsp-driver\";\nexport const pkgVersion = \"2.116.1\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/odsp-driver\";\nexport const pkgVersion = \"2.118.0\";\n"]}
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Optional ODSP point-in-time loading implementation for consumer injection.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ export { createPointInTimeDocumentService } from "./pointInTimeDriver/createPointInTimeDocumentService.js";
11
+ export type { IOdspPointInTimeDocumentServiceImplementationProps, OdspPointInTimeDocumentServiceImplementation, } from "./odspDocumentServiceFactoryCore.js";
12
+ export type { EpochTracker, FetchType, FetchTypeInternal, ICacheAndTracker, } from "./epochTracker.js";
13
+ export type { INonPersistentCache, IOdspCache, IPersistedFileCache, IPrefetchSnapshotContents, } from "./odspCache.js";
14
+ export type { IOdspResponse } from "./odspUtils.js";
15
+ //# sourceMappingURL=pointInTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointInTime.d.ts","sourceRoot":"","sources":["../src/pointInTime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAGH,OAAO,EAAE,gCAAgC,EAAE,MAAM,yDAAyD,CAAC;AAC3G,YAAY,EACX,kDAAkD,EAClD,4CAA4C,GAC5C,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACX,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,16 @@
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.createPointInTimeDocumentService = void 0;
8
+ /**
9
+ * Optional ODSP point-in-time loading implementation for consumer injection.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ // eslint-disable-next-line import-x/no-internal-modules -- Dedicated entrypoint for the optional point-in-time implementation.
14
+ var createPointInTimeDocumentService_js_1 = require("./pointInTimeDriver/createPointInTimeDocumentService.js");
15
+ Object.defineProperty(exports, "createPointInTimeDocumentService", { enumerable: true, get: function () { return createPointInTimeDocumentService_js_1.createPointInTimeDocumentService; } });
16
+ //# sourceMappingURL=pointInTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointInTime.js","sourceRoot":"","sources":["../src/pointInTime.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,+HAA+H;AAC/H,+GAA2G;AAAlG,uJAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Optional ODSP point-in-time loading implementation for consumer injection.\n *\n * @packageDocumentation\n */\n\n// eslint-disable-next-line import-x/no-internal-modules -- Dedicated entrypoint for the optional point-in-time implementation.\nexport { createPointInTimeDocumentService } from \"./pointInTimeDriver/createPointInTimeDocumentService.js\";\nexport type {\n\tIOdspPointInTimeDocumentServiceImplementationProps,\n\tOdspPointInTimeDocumentServiceImplementation,\n} from \"./odspDocumentServiceFactoryCore.js\";\nexport type {\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n\tICacheAndTracker,\n} from \"./epochTracker.js\";\nexport type {\n\tINonPersistentCache,\n\tIOdspCache,\n\tIPersistedFileCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type { IOdspResponse } from \"./odspUtils.js\";\n"]}
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IDocumentService, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
6
+ import type { IOdspResolvedUrl } from "@fluidframework/odsp-driver-definitions/internal";
7
+ import { type TelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
8
+ import { type EpochTracker } from "../epochTracker.js";
9
+ import type { IOdspPointInTimeDocumentServiceImplementationProps } from "../odspDocumentServiceFactoryCore.js";
10
+ import { type IOdspVersionManager } from "../odspVersionManager/odspVersionManager.js";
11
+ import { OdspPointInTimeDocumentService } from "./odspPointInTimeDocumentService.js";
12
+ interface IPointInTimeDocumentServiceDependencies {
13
+ readonly createVersionManager?: (odspResolvedUrl: IOdspResolvedUrl, logger: TelemetryLoggerExt, epochTracker: EpochTracker) => IOdspVersionManager | Promise<IOdspVersionManager>;
14
+ readonly resolveFileVersion?: (resolvedUrl: IResolvedUrl, fileVersion: string) => IResolvedUrl | Promise<IResolvedUrl>;
15
+ }
16
+ /**
17
+ * ODSP's point-in-time document service implementation.
18
+ *
19
+ * @remarks Import this function from the dedicated point-in-time entrypoint and inject it through
20
+ * {@link IOdspDocumentServiceFactoryOptions.pointInTimeDocumentServiceImplementation}.
21
+ *
22
+ * @param props - ODSP service dependencies and point-in-time load parameters supplied by the factory.
23
+ * @returns A read-only ODSP document service materialized at the requested sequence number.
24
+ *
25
+ * @legacy @beta
26
+ */
27
+ export declare function createPointInTimeDocumentService(props: IOdspPointInTimeDocumentServiceImplementationProps): Promise<IDocumentService>;
28
+ /**
29
+ * Creates the point-in-time service with replaceable dependencies for testing.
30
+ * @internal
31
+ */
32
+ export declare function createPointInTimeDocumentServiceCore({ resolvedUrl, targetSequenceNumber, logger, clientIsSummarizer, persistedCache, getStorageToken, createDocumentService, }: IOdspPointInTimeDocumentServiceImplementationProps, dependencies?: IPointInTimeDocumentServiceDependencies): Promise<OdspPointInTimeDocumentService>;
33
+ export {};
34
+ //# sourceMappingURL=createPointInTimeDocumentService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPointInTimeDocumentService.d.ts","sourceRoot":"","sources":["../../src/pointInTimeDriver/createPointInTimeDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EACX,gBAAgB,EAEhB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAEN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlF,OAAO,KAAK,EAAE,kDAAkD,EAAE,MAAM,sCAAsC,CAAC;AAM/G,OAAO,EAEN,KAAK,mBAAmB,EAExB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,UAAU,uCAAuC;IAChD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAC/B,eAAe,EAAE,gBAAgB,EACjC,MAAM,EAAE,kBAAkB,EAC1B,YAAY,EAAE,YAAY,KACtB,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACxD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAC7B,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,KACf,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1C;AA+CD;;;;;;;;;;GAUG;AACH,wBAAsB,gCAAgC,CACrD,KAAK,EAAE,kDAAkD,GACvD,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED;;;GAGG;AACH,wBAAsB,oCAAoC,CACzD,EACC,WAAW,EACX,oBAAoB,EACpB,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,qBAAqB,GACrB,EAAE,kDAAkD,EACrD,YAAY,GAAE,uCAA4C,GACxD,OAAO,CAAC,8BAA8B,CAAC,CAsDzC"}
@@ -0,0 +1,90 @@
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.createPointInTimeDocumentServiceCore = exports.createPointInTimeDocumentService = void 0;
8
+ const internal_1 = require("@fluidframework/driver-utils/internal");
9
+ const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
+ const epochTracker_js_1 = require("../epochTracker.js");
11
+ const odspCache_js_1 = require("../odspCache.js");
12
+ const odspDriverUrlResolver_js_1 = require("../odspDriverUrlResolver.js");
13
+ const odspUtils_js_1 = require("../odspUtils.js");
14
+ const odspVersionManager_js_1 = require("../odspVersionManager/odspVersionManager.js");
15
+ const odspPointInTimeDocumentService_js_1 = require("./odspPointInTimeDocumentService.js");
16
+ async function createVersionManager(odspResolvedUrl, logger, epochTracker, getStorageToken) {
17
+ const urlParts = {
18
+ siteUrl: odspResolvedUrl.siteUrl,
19
+ driveId: odspResolvedUrl.driveId,
20
+ itemId: odspResolvedUrl.itemId,
21
+ };
22
+ const getAuthHeader = (0, odspUtils_js_1.toInstrumentedOdspStorageTokenFetcher)(logger, urlParts, getStorageToken);
23
+ return (0, odspVersionManager_js_1.createOdspVersionManager)({
24
+ urlParts,
25
+ getAuthHeader,
26
+ epochTracker,
27
+ logger,
28
+ });
29
+ }
30
+ async function resolveFileVersion(resolvedUrl, fileVersion) {
31
+ const odspResolvedUrl = (0, odspUtils_js_1.getOdspResolvedUrl)(resolvedUrl);
32
+ const query = new URLSearchParams({
33
+ driveId: odspResolvedUrl.driveId,
34
+ itemId: odspResolvedUrl.itemId,
35
+ fileVersion,
36
+ });
37
+ if (odspResolvedUrl.dataStorePath !== undefined) {
38
+ query.set("path", odspResolvedUrl.dataStorePath);
39
+ }
40
+ if (odspResolvedUrl.codeHint?.containerPackageName !== undefined) {
41
+ query.set("containerPackageName", odspResolvedUrl.codeHint.containerPackageName);
42
+ }
43
+ return new odspDriverUrlResolver_js_1.OdspDriverUrlResolver().resolve({
44
+ url: `${odspResolvedUrl.siteUrl}?${query.toString()}`,
45
+ });
46
+ }
47
+ /**
48
+ * ODSP's point-in-time document service implementation.
49
+ *
50
+ * @remarks Import this function from the dedicated point-in-time entrypoint and inject it through
51
+ * {@link IOdspDocumentServiceFactoryOptions.pointInTimeDocumentServiceImplementation}.
52
+ *
53
+ * @param props - ODSP service dependencies and point-in-time load parameters supplied by the factory.
54
+ * @returns A read-only ODSP document service materialized at the requested sequence number.
55
+ *
56
+ * @legacy @beta
57
+ */
58
+ async function createPointInTimeDocumentService(props) {
59
+ return createPointInTimeDocumentServiceCore(props);
60
+ }
61
+ exports.createPointInTimeDocumentService = createPointInTimeDocumentService;
62
+ /**
63
+ * Creates the point-in-time service with replaceable dependencies for testing.
64
+ * @internal
65
+ */
66
+ async function createPointInTimeDocumentServiceCore({ resolvedUrl, targetSequenceNumber, logger, clientIsSummarizer, persistedCache, getStorageToken, createDocumentService, }, dependencies = {}) {
67
+ const odspLogger = (0, odspUtils_js_1.createOdspLogger)(logger);
68
+ const extLogger = (0, internal_2.createChildLogger)({ logger: odspLogger });
69
+ const odspResolvedUrl = (0, odspUtils_js_1.getOdspResolvedUrl)(resolvedUrl);
70
+ const cacheAndTracker = (0, epochTracker_js_1.createOdspCacheAndTracker)(persistedCache, new odspCache_js_1.NonPersistentCache(), {
71
+ resolvedUrl: odspResolvedUrl,
72
+ docId: odspResolvedUrl.hashedDocumentId,
73
+ fileVersion: odspResolvedUrl.fileVersion,
74
+ }, extLogger, clientIsSummarizer);
75
+ const versionManager = await (dependencies.createVersionManager ??
76
+ (async (url, versionLogger, epochTracker) => createVersionManager(url, versionLogger, epochTracker, getStorageToken)))(odspResolvedUrl, extLogger, cacheAndTracker.epochTracker);
77
+ const baseResult = await versionManager.findBaseForSeq(targetSequenceNumber);
78
+ if (baseResult.kind === "noBaseVersion") {
79
+ const oldestResolvedSequenceDetail = baseResult.oldestResolvedSeq === undefined
80
+ ? ""
81
+ : ` The oldest resolved file version is at sequence number ${baseResult.oldestResolvedSeq}.`;
82
+ throw new internal_1.UsageError(`No ODSP file version is available at or before sequence number ${targetSequenceNumber}.${oldestResolvedSequenceDetail}`);
83
+ }
84
+ const recoverableResolvedUrl = await (dependencies.resolveFileVersion ?? resolveFileVersion)(resolvedUrl, baseResult.base.versionId);
85
+ const recoverableDocumentService = await createDocumentService(recoverableResolvedUrl, odspLogger, cacheAndTracker, clientIsSummarizer);
86
+ const liveDocumentService = await createDocumentService(resolvedUrl, odspLogger, cacheAndTracker, clientIsSummarizer);
87
+ return new odspPointInTimeDocumentService_js_1.OdspPointInTimeDocumentService(recoverableResolvedUrl, recoverableDocumentService, liveDocumentService, targetSequenceNumber);
88
+ }
89
+ exports.createPointInTimeDocumentServiceCore = createPointInTimeDocumentServiceCore;
90
+ //# sourceMappingURL=createPointInTimeDocumentService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPointInTimeDocumentService.js","sourceRoot":"","sources":["../../src/pointInTimeDriver/createPointInTimeDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,oEAAmE;AAKnE,uEAGkD;AAElD,wDAAkF;AAClF,kDAAqD;AACrD,0EAAoE;AAEpE,kDAIyB;AACzB,uFAIqD;AAErD,2FAAqF;AAcrF,KAAK,UAAU,oBAAoB,CAClC,eAAiC,EACjC,MAA0B,EAC1B,YAA0B,EAC1B,eAAsF;IAEtF,MAAM,QAAQ,GAAkB;QAC/B,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,MAAM,EAAE,eAAe,CAAC,MAAM;KAC9B,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,oDAAqC,EAC1D,MAAM,EACN,QAAQ,EACR,eAAe,CACf,CAAC;IACF,OAAO,IAAA,gDAAwB,EAAC;QAC/B,QAAQ;QACR,aAAa;QACb,YAAY;QACZ,MAAM;KACN,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,kBAAkB,CAChC,WAAyB,EACzB,WAAmB;IAEnB,MAAM,eAAe,GAAG,IAAA,iCAAkB,EAAC,WAAW,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC;QACjC,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,MAAM,EAAE,eAAe,CAAC,MAAM;QAC9B,WAAW;KACX,CAAC,CAAC;IACH,IAAI,eAAe,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACjD,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,eAAe,CAAC,QAAQ,EAAE,oBAAoB,KAAK,SAAS,EAAE,CAAC;QAClE,KAAK,CAAC,GAAG,CAAC,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AAM,UAAU,GAAG,MAAM,cAAc,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAC7E,IAAI,UAAU,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACzC,MAAM,4BAA4B,GACjC,UAAU,CAAC,iBAAiB,KAAK,SAAS;YACzC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,2DAA2D,UAAU,CAAC,iBAAiB,GAAG,CAAC;QAC/F,MAAM,IAAI,qBAAU,CACnB,kEAAkE,oBAAoB,IAAI,4BAA4B,EAAE,CACxH,CAAC;IACH,CAAC;IAED,MAAM,sBAAsB,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,CAC3F,WAAW,EACX,UAAU,CAAC,IAAI,CAAC,SAAS,CACzB,CAAC;IACF,MAAM,0BAA0B,GAAG,MAAM,qBAAqB,CAC7D,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,kBAAkB,CAClB,CAAC;IACF,MAAM,mBAAmB,GAAG,MAAM,qBAAqB,CACtD,WAAW,EACX,UAAU,EACV,eAAe,EACf,kBAAkB,CAClB,CAAC;IACF,OAAO,IAAI,kEAA8B,CACxC,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,CACpB,CAAC;AACH,CAAC;AAjED,oFAiEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDocumentService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n} from \"@fluidframework/odsp-driver-definitions/internal\";\nimport {\n\tcreateChildLogger,\n\ttype TelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { createOdspCacheAndTracker, type EpochTracker } from \"../epochTracker.js\";\nimport { NonPersistentCache } from \"../odspCache.js\";\nimport { OdspDriverUrlResolver } from \"../odspDriverUrlResolver.js\";\nimport type { IOdspPointInTimeDocumentServiceImplementationProps } from \"../odspDocumentServiceFactoryCore.js\";\nimport {\n\tcreateOdspLogger,\n\tgetOdspResolvedUrl,\n\ttoInstrumentedOdspStorageTokenFetcher,\n} from \"../odspUtils.js\";\nimport {\n\tcreateOdspVersionManager,\n\ttype IOdspVersionManager,\n\t// eslint-disable-next-line import-x/no-internal-modules -- the feature implementation owns version selection\n} from \"../odspVersionManager/odspVersionManager.js\";\n\nimport { OdspPointInTimeDocumentService } from \"./odspPointInTimeDocumentService.js\";\n\ninterface IPointInTimeDocumentServiceDependencies {\n\treadonly createVersionManager?: (\n\t\todspResolvedUrl: IOdspResolvedUrl,\n\t\tlogger: TelemetryLoggerExt,\n\t\tepochTracker: EpochTracker,\n\t) => IOdspVersionManager | Promise<IOdspVersionManager>;\n\treadonly resolveFileVersion?: (\n\t\tresolvedUrl: IResolvedUrl,\n\t\tfileVersion: string,\n\t) => IResolvedUrl | Promise<IResolvedUrl>;\n}\n\nasync function createVersionManager(\n\todspResolvedUrl: IOdspResolvedUrl,\n\tlogger: TelemetryLoggerExt,\n\tepochTracker: EpochTracker,\n\tgetStorageToken: IOdspPointInTimeDocumentServiceImplementationProps[\"getStorageToken\"],\n): Promise<IOdspVersionManager> {\n\tconst urlParts: IOdspUrlParts = {\n\t\tsiteUrl: odspResolvedUrl.siteUrl,\n\t\tdriveId: odspResolvedUrl.driveId,\n\t\titemId: odspResolvedUrl.itemId,\n\t};\n\tconst getAuthHeader = toInstrumentedOdspStorageTokenFetcher(\n\t\tlogger,\n\t\turlParts,\n\t\tgetStorageToken,\n\t);\n\treturn createOdspVersionManager({\n\t\turlParts,\n\t\tgetAuthHeader,\n\t\tepochTracker,\n\t\tlogger,\n\t});\n}\n\nasync function resolveFileVersion(\n\tresolvedUrl: IResolvedUrl,\n\tfileVersion: string,\n): Promise<IResolvedUrl> {\n\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\tconst query = new URLSearchParams({\n\t\tdriveId: odspResolvedUrl.driveId,\n\t\titemId: odspResolvedUrl.itemId,\n\t\tfileVersion,\n\t});\n\tif (odspResolvedUrl.dataStorePath !== undefined) {\n\t\tquery.set(\"path\", odspResolvedUrl.dataStorePath);\n\t}\n\tif (odspResolvedUrl.codeHint?.containerPackageName !== undefined) {\n\t\tquery.set(\"containerPackageName\", odspResolvedUrl.codeHint.containerPackageName);\n\t}\n\treturn new OdspDriverUrlResolver().resolve({\n\t\turl: `${odspResolvedUrl.siteUrl}?${query.toString()}`,\n\t});\n}\n\n/**\n * ODSP's point-in-time document service implementation.\n *\n * @remarks Import this function from the dedicated point-in-time entrypoint and inject it through\n * {@link IOdspDocumentServiceFactoryOptions.pointInTimeDocumentServiceImplementation}.\n *\n * @param props - ODSP service dependencies and point-in-time load parameters supplied by the factory.\n * @returns A read-only ODSP document service materialized at the requested sequence number.\n *\n * @legacy @beta\n */\nexport async function createPointInTimeDocumentService(\n\tprops: IOdspPointInTimeDocumentServiceImplementationProps,\n): Promise<IDocumentService> {\n\treturn createPointInTimeDocumentServiceCore(props);\n}\n\n/**\n * Creates the point-in-time service with replaceable dependencies for testing.\n * @internal\n */\nexport async function createPointInTimeDocumentServiceCore(\n\t{\n\t\tresolvedUrl,\n\t\ttargetSequenceNumber,\n\t\tlogger,\n\t\tclientIsSummarizer,\n\t\tpersistedCache,\n\t\tgetStorageToken,\n\t\tcreateDocumentService,\n\t}: IOdspPointInTimeDocumentServiceImplementationProps,\n\tdependencies: IPointInTimeDocumentServiceDependencies = {},\n): Promise<OdspPointInTimeDocumentService> {\n\tconst odspLogger = createOdspLogger(logger);\n\tconst extLogger = createChildLogger({ logger: odspLogger });\n\tconst odspResolvedUrl = getOdspResolvedUrl(resolvedUrl);\n\tconst cacheAndTracker = createOdspCacheAndTracker(\n\t\tpersistedCache,\n\t\tnew NonPersistentCache(),\n\t\t{\n\t\t\tresolvedUrl: odspResolvedUrl,\n\t\t\tdocId: odspResolvedUrl.hashedDocumentId,\n\t\t\tfileVersion: odspResolvedUrl.fileVersion,\n\t\t},\n\t\textLogger,\n\t\tclientIsSummarizer,\n\t);\n\n\tconst versionManager = await (\n\t\tdependencies.createVersionManager ??\n\t\t(async (url, versionLogger, epochTracker) =>\n\t\t\tcreateVersionManager(url, versionLogger, epochTracker, getStorageToken))\n\t)(odspResolvedUrl, extLogger, cacheAndTracker.epochTracker);\n\tconst baseResult = await versionManager.findBaseForSeq(targetSequenceNumber);\n\tif (baseResult.kind === \"noBaseVersion\") {\n\t\tconst oldestResolvedSequenceDetail =\n\t\t\tbaseResult.oldestResolvedSeq === undefined\n\t\t\t\t? \"\"\n\t\t\t\t: ` The oldest resolved file version is at sequence number ${baseResult.oldestResolvedSeq}.`;\n\t\tthrow new UsageError(\n\t\t\t`No ODSP file version is available at or before sequence number ${targetSequenceNumber}.${oldestResolvedSequenceDetail}`,\n\t\t);\n\t}\n\n\tconst recoverableResolvedUrl = await (dependencies.resolveFileVersion ?? resolveFileVersion)(\n\t\tresolvedUrl,\n\t\tbaseResult.base.versionId,\n\t);\n\tconst recoverableDocumentService = await createDocumentService(\n\t\trecoverableResolvedUrl,\n\t\todspLogger,\n\t\tcacheAndTracker,\n\t\tclientIsSummarizer,\n\t);\n\tconst liveDocumentService = await createDocumentService(\n\t\tresolvedUrl,\n\t\todspLogger,\n\t\tcacheAndTracker,\n\t\tclientIsSummarizer,\n\t);\n\treturn new OdspPointInTimeDocumentService(\n\t\trecoverableResolvedUrl,\n\t\trecoverableDocumentService,\n\t\tliveDocumentService,\n\t\ttargetSequenceNumber,\n\t);\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ export * from "../lib/pointInTime.js";
package/lib/index.d.ts CHANGED
@@ -10,9 +10,8 @@ export { getHashedDocumentId, type ISnapshotContents } from "./odspPublicUtils.j
10
10
  export { getApiRoot, getOdspUrlParts, isOdcUrl, isSpoUrl } from "./odspUrlHelper.js";
11
11
  export { getHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
12
12
  export { prefetchLatestSnapshot } from "./prefetchLatestSnapshot.js";
13
- export { createLocalOdspDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
14
- export { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
15
- export { getOdspPointInTimeDocumentServiceFactory, type IPointInTimeDocumentServiceFactory, } from "./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js";
13
+ export { createLocalOdspDocumentServiceFactory, createOdspDocumentServiceFactory, getOdspPointInTimeDocumentServiceFactory, type IOdspDocumentServiceFactoryOptions, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
14
+ export { type IOdspPointInTimeDocumentServiceImplementationProps, type IPointInTimeDocumentServiceFactory, type OdspPointInTimeDocumentServiceImplementation, OdspDocumentServiceFactoryCore, } from "./odspDocumentServiceFactoryCore.js";
16
15
  export { createOdspCreateContainerRequest } from "./createOdspCreateContainerRequest.js";
17
16
  export { OdspDriverUrlResolver } from "./odspDriverUrlResolver.js";
18
17
  export { OdspDriverUrlResolverForShareLink, type ShareLinkFetcherProps, } from "./odspDriverUrlResolverForShareLink.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACN,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,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jB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACN,KAAK,0BAA0B,EAC/B,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC"}
package/lib/index.js CHANGED
@@ -14,11 +14,8 @@ export { getHeadersWithAuth } from "./getUrlAndHeadersWithAuth.js";
14
14
  // prefetch latest snapshot before container load
15
15
  export { prefetchLatestSnapshot } from "./prefetchLatestSnapshot.js";
16
16
  // Factory
17
- export { createLocalOdspDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
18
- export { OdspDocumentServiceFactoryCore } from "./odspDocumentServiceFactoryCore.js";
19
- /* eslint-disable import-x/no-internal-modules */
20
- export { getOdspPointInTimeDocumentServiceFactory, } from "./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js";
21
- /* eslint-enable import-x/no-internal-modules */
17
+ export { createLocalOdspDocumentServiceFactory, createOdspDocumentServiceFactory, getOdspPointInTimeDocumentServiceFactory, OdspDocumentServiceFactory, } from "./odspDocumentServiceFactory.js";
18
+ export { OdspDocumentServiceFactoryCore, } from "./odspDocumentServiceFactoryCore.js";
22
19
  // File creation
23
20
  export { createOdspCreateContainerRequest } from "./createOdspCreateContainerRequest.js";
24
21
  // URI Resolver functionality, URI management
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACN,qBAAqB,EAIrB,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,eAAe;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAA0B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,iDAAiD;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,UAAU;AACV,OAAO,EACN,qCAAqC,EACrC,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,iDAAiD;AACjD,OAAO,EACN,wCAAwC,GAExC,MAAM,8DAA8D,CAAC;AACtE,gDAAgD;AAEhD,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,6CAA6C;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,iCAAiC,GAEjC,MAAM,wCAAwC,CAAC;AAEhD,oEAAoE;AACpE,OAAO,EACN,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAsB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAEN,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,uBAAuB;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC","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\ttype IClpCompliantAppHeader,\n\ttype ISharingLinkHeader,\n\ttype OdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, type ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getApiRoot, getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\nexport { getHeadersWithAuth } from \"./getUrlAndHeadersWithAuth.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/* eslint-disable import-x/no-internal-modules */\nexport {\n\tgetOdspPointInTimeDocumentServiceFactory,\n\ttype IPointInTimeDocumentServiceFactory,\n} from \"./pointInTimeDriver/odspPointInTimeDocumentServiceFactory.js\";\n/* eslint-enable import-x/no-internal-modules */\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\ttype ShareLinkFetcherProps,\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 type {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type {\n\tICacheAndTracker,\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { type IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\ttype ISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACN,qBAAqB,EAIrB,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,eAAe;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAA0B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,iDAAiD;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,UAAU;AACV,OAAO,EACN,qCAAqC,EACrC,gCAAgC,EAChC,wCAAwC,EAExC,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAIN,8BAA8B,GAC9B,MAAM,qCAAqC,CAAC;AAE7C,gBAAgB;AAChB,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,6CAA6C;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,iCAAiC,GAEjC,MAAM,wCAAwC,CAAC;AAEhD,oEAAoE;AACpE,OAAO,EACN,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAsB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAEN,4BAA4B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,uBAAuB;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC","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\ttype IClpCompliantAppHeader,\n\ttype ISharingLinkHeader,\n\ttype OdspFluidDataStoreLocator,\n\tSharingLinkHeader,\n} from \"./contractsPublic.js\";\n\n// public utils\nexport { checkUrl } from \"./checkUrl.js\";\nexport { createOdspUrl } from \"./createOdspUrl.js\";\nexport { getHashedDocumentId, type ISnapshotContents } from \"./odspPublicUtils.js\";\nexport { getApiRoot, getOdspUrlParts, isOdcUrl, isSpoUrl } from \"./odspUrlHelper.js\";\nexport { getHeadersWithAuth } from \"./getUrlAndHeadersWithAuth.js\";\n\n// prefetch latest snapshot before container load\nexport { prefetchLatestSnapshot } from \"./prefetchLatestSnapshot.js\";\n\n// Factory\nexport {\n\tcreateLocalOdspDocumentServiceFactory,\n\tcreateOdspDocumentServiceFactory,\n\tgetOdspPointInTimeDocumentServiceFactory,\n\ttype IOdspDocumentServiceFactoryOptions,\n\tOdspDocumentServiceFactory,\n} from \"./odspDocumentServiceFactory.js\";\nexport {\n\ttype IOdspPointInTimeDocumentServiceImplementationProps,\n\ttype IPointInTimeDocumentServiceFactory,\n\ttype OdspPointInTimeDocumentServiceImplementation,\n\tOdspDocumentServiceFactoryCore,\n} 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\ttype ShareLinkFetcherProps,\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 type {\n\tIOdspCache,\n\tIPersistedFileCache,\n\tINonPersistentCache,\n\tIPrefetchSnapshotContents,\n} from \"./odspCache.js\";\nexport type {\n\tICacheAndTracker,\n\tEpochTracker,\n\tFetchType,\n\tFetchTypeInternal,\n} from \"./epochTracker.js\";\nexport { type IOdspResponse, isOdspResolvedUrl } from \"./odspUtils.js\";\nexport { SnapshotFormatSupportType } from \"./fetchSnapshot.js\";\nexport {\n\ttype ISnapshotContentsWithProps,\n\tparseCompactSnapshotResponse,\n} from \"./compactSnapshotParser.js\";\n\n// Layer Compat details\nexport { odspDriverCompatDetailsForLoader } from \"./odspLayerCompatState.js\";\n"]}
package/lib/legacy.d.ts CHANGED
@@ -16,6 +16,8 @@ export {
16
16
  ICacheAndTracker,
17
17
  INonPersistentCache,
18
18
  IOdspCache,
19
+ IOdspDocumentServiceFactoryOptions,
20
+ IOdspPointInTimeDocumentServiceImplementationProps,
19
21
  IOdspResponse,
20
22
  IPersistedFileCache,
21
23
  IPointInTimeDocumentServiceFactory,
@@ -28,11 +30,13 @@ export {
28
30
  OdspDriverUrlResolver,
29
31
  OdspDriverUrlResolverForShareLink,
30
32
  OdspFluidDataStoreLocator,
33
+ OdspPointInTimeDocumentServiceImplementation,
31
34
  ShareLinkFetcherProps,
32
35
  SnapshotFormatSupportType,
33
36
  checkUrl,
34
37
  createLocalOdspDocumentServiceFactory,
35
38
  createOdspCreateContainerRequest,
39
+ createOdspDocumentServiceFactory,
36
40
  createOdspUrl,
37
41
  encodeOdspFluidDataStoreLocator,
38
42
  getHashedDocumentId,
@@ -16,6 +16,8 @@ export {
16
16
  ICacheAndTracker,
17
17
  INonPersistentCache,
18
18
  IOdspCache,
19
+ IOdspDocumentServiceFactoryOptions,
20
+ IOdspPointInTimeDocumentServiceImplementationProps,
19
21
  IOdspResponse,
20
22
  IPersistedFileCache,
21
23
  IPointInTimeDocumentServiceFactory,
@@ -28,11 +30,13 @@ export {
28
30
  OdspDriverUrlResolver,
29
31
  OdspDriverUrlResolverForShareLink,
30
32
  OdspFluidDataStoreLocator,
33
+ OdspPointInTimeDocumentServiceImplementation,
31
34
  ShareLinkFetcherProps,
32
35
  SnapshotFormatSupportType,
33
36
  checkUrl,
34
37
  createLocalOdspDocumentServiceFactory,
35
38
  createOdspCreateContainerRequest,
39
+ createOdspDocumentServiceFactory,
36
40
  createOdspUrl,
37
41
  encodeOdspFluidDataStoreLocator,
38
42
  getHashedDocumentId,