@fluidframework/routerlicious-driver 2.90.0 → 2.92.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.
- package/CHANGELOG.md +8 -0
- package/dist/cache.js +1 -1
- package/dist/cache.js.map +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createNewUtils.d.ts +1 -1
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js.map +1 -1
- package/dist/defaultTokenProvider.d.ts +1 -1
- package/dist/defaultTokenProvider.d.ts.map +1 -1
- package/dist/defaultTokenProvider.js.map +1 -1
- package/dist/definitions.d.ts +1 -1
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js.map +1 -1
- package/dist/deltaStorageService.d.ts +4 -4
- package/dist/deltaStorageService.d.ts.map +1 -1
- package/dist/deltaStorageService.js +1 -1
- package/dist/deltaStorageService.js.map +1 -1
- package/dist/documentDeltaConnection.d.ts +4 -4
- package/dist/documentDeltaConnection.d.ts.map +1 -1
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/documentService.d.ts +10 -9
- package/dist/documentService.d.ts.map +1 -1
- package/dist/documentService.js.map +1 -1
- package/dist/documentServiceFactory.d.ts +6 -6
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/documentServiceFactory.js.map +1 -1
- package/dist/documentStorageService.d.ts +7 -7
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/documentStorageService.js.map +1 -1
- package/dist/errorUtils.d.ts +3 -2
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/errorUtils.js +13 -7
- package/dist/errorUtils.js.map +1 -1
- package/dist/gitManager.d.ts +4 -4
- package/dist/gitManager.d.ts.map +1 -1
- package/dist/gitManager.js.map +1 -1
- package/dist/historian.d.ts +5 -5
- package/dist/historian.d.ts.map +1 -1
- package/dist/historian.js +1 -1
- package/dist/historian.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/mapWithExpiration.js +2 -2
- package/dist/mapWithExpiration.js.map +1 -1
- package/dist/nullBlobStorageService.d.ts +2 -2
- package/dist/nullBlobStorageService.d.ts.map +1 -1
- package/dist/nullBlobStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/r11sSnapshotParser.d.ts +1 -1
- package/dist/r11sSnapshotParser.d.ts.map +1 -1
- package/dist/r11sSnapshotParser.js +2 -2
- package/dist/r11sSnapshotParser.js.map +1 -1
- package/dist/restWrapper.d.ts +4 -4
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapper.js +10 -11
- package/dist/restWrapper.js.map +1 -1
- package/dist/restWrapperBase.d.ts +1 -1
- package/dist/restWrapperBase.d.ts.map +1 -1
- package/dist/restWrapperBase.js.map +1 -1
- package/dist/retriableGitManager.d.ts +5 -5
- package/dist/retriableGitManager.d.ts.map +1 -1
- package/dist/retriableGitManager.js.map +1 -1
- package/dist/sessionInfoManager.d.ts +4 -4
- package/dist/sessionInfoManager.d.ts.map +1 -1
- package/dist/sessionInfoManager.js.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.d.ts +7 -7
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/socketModule.js +1 -1
- package/dist/socketModule.js.map +1 -1
- package/dist/storageContracts.d.ts +4 -4
- package/dist/storageContracts.d.ts.map +1 -1
- package/dist/storageContracts.js.map +1 -1
- package/dist/summaryTreeUploadManager.d.ts +4 -4
- package/dist/summaryTreeUploadManager.d.ts.map +1 -1
- package/dist/summaryTreeUploadManager.js +6 -4
- package/dist/summaryTreeUploadManager.js.map +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/treeUtils.d.ts +4 -3
- package/dist/treeUtils.d.ts.map +1 -1
- package/dist/treeUtils.js.map +1 -1
- package/dist/urlUtils.d.ts +2 -2
- package/dist/urlUtils.d.ts.map +1 -1
- package/dist/urlUtils.js +1 -1
- package/dist/urlUtils.js.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts +7 -7
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +5 -5
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/dist/wholeSummaryUploadManager.d.ts +2 -2
- package/dist/wholeSummaryUploadManager.d.ts.map +1 -1
- package/dist/wholeSummaryUploadManager.js.map +1 -1
- package/eslint.config.mts +18 -5
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/cache.js +1 -1
- package/lib/cache.js.map +1 -1
- package/lib/contracts.d.ts +1 -1
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/createNewUtils.d.ts +1 -1
- package/lib/createNewUtils.d.ts.map +1 -1
- package/lib/createNewUtils.js.map +1 -1
- package/lib/defaultTokenProvider.d.ts +1 -1
- package/lib/defaultTokenProvider.d.ts.map +1 -1
- package/lib/defaultTokenProvider.js.map +1 -1
- package/lib/definitions.d.ts +1 -1
- package/lib/definitions.d.ts.map +1 -1
- package/lib/definitions.js.map +1 -1
- package/lib/deltaStorageService.d.ts +4 -4
- package/lib/deltaStorageService.d.ts.map +1 -1
- package/lib/deltaStorageService.js +2 -2
- package/lib/deltaStorageService.js.map +1 -1
- package/lib/documentDeltaConnection.d.ts +4 -4
- package/lib/documentDeltaConnection.d.ts.map +1 -1
- package/lib/documentDeltaConnection.js +1 -1
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/documentService.d.ts +10 -9
- package/lib/documentService.d.ts.map +1 -1
- package/lib/documentService.js +1 -1
- package/lib/documentService.js.map +1 -1
- package/lib/documentServiceFactory.d.ts +6 -6
- package/lib/documentServiceFactory.d.ts.map +1 -1
- package/lib/documentServiceFactory.js +2 -2
- package/lib/documentServiceFactory.js.map +1 -1
- package/lib/documentStorageService.d.ts +7 -7
- package/lib/documentStorageService.d.ts.map +1 -1
- package/lib/documentStorageService.js +1 -1
- package/lib/documentStorageService.js.map +1 -1
- package/lib/errorUtils.d.ts +3 -2
- package/lib/errorUtils.d.ts.map +1 -1
- package/lib/errorUtils.js +14 -8
- package/lib/errorUtils.js.map +1 -1
- package/lib/gitManager.d.ts +4 -4
- package/lib/gitManager.d.ts.map +1 -1
- package/lib/gitManager.js.map +1 -1
- package/lib/historian.d.ts +5 -5
- package/lib/historian.d.ts.map +1 -1
- package/lib/historian.js +1 -1
- package/lib/historian.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/mapWithExpiration.js +2 -2
- package/lib/mapWithExpiration.js.map +1 -1
- package/lib/nullBlobStorageService.d.ts +2 -2
- package/lib/nullBlobStorageService.d.ts.map +1 -1
- package/lib/nullBlobStorageService.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/r11sSnapshotParser.d.ts +1 -1
- package/lib/r11sSnapshotParser.d.ts.map +1 -1
- package/lib/r11sSnapshotParser.js +2 -2
- package/lib/r11sSnapshotParser.js.map +1 -1
- package/lib/restWrapper.d.ts +4 -4
- package/lib/restWrapper.d.ts.map +1 -1
- package/lib/restWrapper.js +11 -12
- package/lib/restWrapper.js.map +1 -1
- package/lib/restWrapperBase.d.ts +1 -1
- package/lib/restWrapperBase.d.ts.map +1 -1
- package/lib/restWrapperBase.js.map +1 -1
- package/lib/retriableGitManager.d.ts +5 -5
- package/lib/retriableGitManager.d.ts.map +1 -1
- package/lib/retriableGitManager.js.map +1 -1
- package/lib/sessionInfoManager.d.ts +4 -4
- package/lib/sessionInfoManager.d.ts.map +1 -1
- package/lib/sessionInfoManager.js +1 -1
- package/lib/sessionInfoManager.js.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.d.ts +7 -7
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/socketModule.js +1 -1
- package/lib/socketModule.js.map +1 -1
- package/lib/storageContracts.d.ts +4 -4
- package/lib/storageContracts.d.ts.map +1 -1
- package/lib/storageContracts.js.map +1 -1
- package/lib/summaryTreeUploadManager.d.ts +4 -4
- package/lib/summaryTreeUploadManager.d.ts.map +1 -1
- package/lib/summaryTreeUploadManager.js +6 -4
- package/lib/summaryTreeUploadManager.js.map +1 -1
- package/lib/tokens.d.ts +1 -1
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js.map +1 -1
- package/lib/treeUtils.d.ts +4 -3
- package/lib/treeUtils.d.ts.map +1 -1
- package/lib/treeUtils.js.map +1 -1
- package/lib/urlUtils.d.ts +2 -2
- package/lib/urlUtils.d.ts.map +1 -1
- package/lib/urlUtils.js +1 -1
- package/lib/urlUtils.js.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts +7 -7
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +5 -5
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/wholeSummaryUploadManager.d.ts +2 -2
- package/lib/wholeSummaryUploadManager.d.ts.map +1 -1
- package/lib/wholeSummaryUploadManager.js +1 -1
- package/lib/wholeSummaryUploadManager.js.map +1 -1
- package/package.json +16 -19
- package/src/cache.ts +1 -1
- package/src/contracts.ts +1 -1
- package/src/createNewUtils.ts +2 -1
- package/src/defaultTokenProvider.ts +1 -1
- package/src/definitions.ts +1 -1
- package/src/deltaStorageService.ts +7 -9
- package/src/documentDeltaConnection.ts +6 -10
- package/src/documentService.ts +11 -14
- package/src/documentServiceFactory.ts +12 -13
- package/src/documentStorageService.ts +8 -8
- package/src/errorUtils.ts +17 -10
- package/src/gitManager.ts +4 -4
- package/src/historian.ts +6 -6
- package/src/index.ts +2 -2
- package/src/mapWithExpiration.ts +2 -2
- package/src/nullBlobStorageService.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/r11sSnapshotParser.ts +4 -4
- package/src/restWrapper.ts +15 -22
- package/src/restWrapperBase.ts +1 -1
- package/src/retriableGitManager.ts +5 -5
- package/src/sessionInfoManager.ts +6 -8
- package/src/shreddedSummaryDocumentStorageService.ts +11 -8
- package/src/socketModule.ts +1 -1
- package/src/storageContracts.ts +4 -4
- package/src/summaryTreeUploadManager.ts +14 -9
- package/src/tokens.ts +1 -1
- package/src/treeUtils.ts +4 -3
- package/src/urlUtils.ts +3 -3
- package/src/wholeSummaryDocumentStorageService.ts +17 -14
- package/src/wholeSummaryUploadManager.ts +3 -3
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IDocumentStorageServicePolicies, ISnapshotTree, IVersion } from "@fluidframework/driver-definitions/internal";
|
|
5
|
+
import type { IDocumentStorageServicePolicies, ISnapshotTree, IVersion } from "@fluidframework/driver-definitions/internal";
|
|
6
6
|
import { DocumentStorageServiceProxy } from "@fluidframework/driver-utils/internal";
|
|
7
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
-
import { ICache } from "./cache.js";
|
|
9
|
-
import { INormalizedWholeSnapshot } from "./contracts.js";
|
|
10
|
-
import { ISnapshotTreeVersion } from "./definitions.js";
|
|
11
|
-
import { GitManager } from "./gitManager.js";
|
|
12
|
-
import { IRouterliciousDriverPolicies } from "./policies.js";
|
|
7
|
+
import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
+
import type { ICache } from "./cache.js";
|
|
9
|
+
import type { INormalizedWholeSnapshot } from "./contracts.js";
|
|
10
|
+
import type { ISnapshotTreeVersion } from "./definitions.js";
|
|
11
|
+
import type { GitManager } from "./gitManager.js";
|
|
12
|
+
import type { IRouterliciousDriverPolicies } from "./policies.js";
|
|
13
13
|
export declare class DocumentStorageService extends DocumentStorageServiceProxy {
|
|
14
14
|
readonly id: string;
|
|
15
15
|
manager: GitManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentStorageService.d.ts","sourceRoot":"","sources":["../src/documentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"documentStorageService.d.ts","sourceRoot":"","sources":["../src/documentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAEX,+BAA+B,EAC/B,aAAa,EACb,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACN,2BAA2B,EAE3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAIlE,qBAAa,sBAAuB,SAAQ,2BAA2B;aAoDrD,EAAE,EAAE,MAAM;IACnB,OAAO,EAAE,UAAU;IAOnB,iBAAiB,CAAC;IA3D1B,OAAO,CAAC,WAAW,CAAiC;IAEpD,IAAW,UAAU,IAAI,MAAM,GAAG,SAAS,CAE1C;IAED,OAAO,CAAC,MAAM,CAAC,kCAAkC;gBA6ChC,EAAE,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,EAC1B,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,+BAA+B,EACzC,cAAc,CAAC,EAAE,4BAA4B,EAC7C,SAAS,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,EACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC,wBAAwB,CAAC,EACpD,wBAAwB,CAAC,EAAE,MAAM,CAAC,oBAAoB,CAAC,EAChD,iBAAiB,CAAC,wBAAY,EACrC,iBAAiB,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC;IAkBvD,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;CAQ/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentStorageService.js","sourceRoot":"","sources":["../src/documentStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"documentStorageService.js","sourceRoot":"","sources":["../src/documentStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,0EAAkF;AAClF,oEAG+C;AAQ/C,yGAAmG;AACnG,mGAA6F;AAE7F,MAAa,sBAAuB,SAAQ,sCAA2B;IAGtE,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAEO,MAAM,CAAC,kCAAkC,CAChD,EAAU,EACV,OAAmB,EACnB,MAA2B,EAC3B,QAAyC,EACzC,cAA6C,EAC7C,SAAmC,EACnC,iBAAoD,EACpD,wBAAuD,EACvD,iBAA8B,EAC9B,iBAAmE;QAEnE,MAAM,cAAc,GAAG,cAAc,EAAE,wBAAwB;YAC9D,CAAC,CAAC,IAAI,0EAAkC,CACtC,EAAE,EACF,OAAO,EACP,MAAM,EACN,QAAQ,EACR,cAAc,EACd,SAAS,EACT,iBA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I,CAAC;IACb,CAAC;CACD;AAvFD,wDAuFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { LoaderCachingPolicy } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tDocumentStorageServiceProxy,\n\tPrefetchDocumentStorageService,\n} from \"@fluidframework/driver-utils/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ICache } from \"./cache.js\";\nimport type { INormalizedWholeSnapshot } from \"./contracts.js\";\nimport type { ISnapshotTreeVersion } from \"./definitions.js\";\nimport type { GitManager } from \"./gitManager.js\";\nimport type { IRouterliciousDriverPolicies } from \"./policies.js\";\nimport { ShreddedSummaryDocumentStorageService } from \"./shreddedSummaryDocumentStorageService.js\";\nimport { WholeSummaryDocumentStorageService } from \"./wholeSummaryDocumentStorageService.js\";\n\nexport class DocumentStorageService extends DocumentStorageServiceProxy {\n\tprivate _logTailSha: string | undefined = undefined;\n\n\tpublic get logTailSha(): string | undefined {\n\t\treturn this._logTailSha;\n\t}\n\n\tprivate static loadInternalDocumentStorageService(\n\t\tid: string,\n\t\tmanager: GitManager,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tpolicies: IDocumentStorageServicePolicies,\n\t\tdriverPolicies?: IRouterliciousDriverPolicies,\n\t\tblobCache?: ICache<ArrayBufferLike>,\n\t\tsnapshotTreeCache?: ICache<INormalizedWholeSnapshot>,\n\t\tshreddedSummaryTreeCache?: ICache<ISnapshotTreeVersion>,\n\t\tnoCacheGitManager?: GitManager,\n\t\tgetStorageManager?: (disableCache?: boolean) => Promise<GitManager>,\n\t): IDocumentStorageService {\n\t\tconst storageService = driverPolicies?.enableWholeSummaryUpload\n\t\t\t? new WholeSummaryDocumentStorageService(\n\t\t\t\t\tid,\n\t\t\t\t\tmanager,\n\t\t\t\t\tlogger,\n\t\t\t\t\tpolicies,\n\t\t\t\t\tdriverPolicies,\n\t\t\t\t\tblobCache,\n\t\t\t\t\tsnapshotTreeCache,\n\t\t\t\t\tnoCacheGitManager,\n\t\t\t\t\tgetStorageManager,\n\t\t\t\t)\n\t\t\t: new ShreddedSummaryDocumentStorageService(\n\t\t\t\t\tid,\n\t\t\t\t\tmanager,\n\t\t\t\t\tlogger,\n\t\t\t\t\tpolicies,\n\t\t\t\t\tdriverPolicies,\n\t\t\t\t\tblobCache,\n\t\t\t\t\tshreddedSummaryTreeCache,\n\t\t\t\t\tgetStorageManager,\n\t\t\t\t);\n\t\t// TODO: worth prefetching latest summary making version + snapshot call with WholeSummary storage?\n\t\tif (\n\t\t\t!driverPolicies?.enableWholeSummaryUpload &&\n\t\t\tpolicies.caching === LoaderCachingPolicy.Prefetch\n\t\t) {\n\t\t\treturn new PrefetchDocumentStorageService(storageService);\n\t\t}\n\t\treturn storageService;\n\t}\n\n\tconstructor(\n\t\tpublic readonly id: string,\n\t\tpublic manager: GitManager,\n\t\tlogger: ITelemetryLoggerExt,\n\t\tpolicies: IDocumentStorageServicePolicies,\n\t\tdriverPolicies?: IRouterliciousDriverPolicies,\n\t\tblobCache?: ICache<ArrayBufferLike>,\n\t\tsnapshotTreeCache?: ICache<INormalizedWholeSnapshot>,\n\t\tshreddedSummaryTreeCache?: ICache<ISnapshotTreeVersion>,\n\t\tpublic noCacheGitManager?: GitManager,\n\t\tgetStorageManager?: (disableCache?: boolean) => Promise<GitManager>,\n\t) {\n\t\tsuper(\n\t\t\tDocumentStorageService.loadInternalDocumentStorageService(\n\t\t\t\tid,\n\t\t\t\tmanager,\n\t\t\t\tlogger,\n\t\t\t\tpolicies,\n\t\t\t\tdriverPolicies,\n\t\t\t\tblobCache,\n\t\t\t\tsnapshotTreeCache,\n\t\t\t\tshreddedSummaryTreeCache,\n\t\t\t\tnoCacheGitManager,\n\t\t\t\tgetStorageManager,\n\t\t\t),\n\t\t);\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\tconst tree = await this.internalStorageService.getSnapshotTree(version);\n\t\tif (tree !== null) {\n\t\t\tthis._logTailSha =\n\t\t\t\t\".logTail\" in tree.trees ? tree.trees[\".logTail\"].blobs.logTail : undefined;\n\t\t}\n\t\treturn tree;\n\t}\n}\n"]}
|
package/dist/errorUtils.d.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions/internal";
|
|
5
|
+
import type { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions/internal";
|
|
6
6
|
import { type DriverErrorTelemetryProps } from "@fluidframework/driver-utils/internal";
|
|
7
|
-
import { IFluidErrorBase
|
|
7
|
+
import type { IFluidErrorBase } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
+
import { LoggingError } from "@fluidframework/telemetry-utils/internal";
|
|
8
9
|
/**
|
|
9
10
|
* Routerlicious Error types
|
|
10
11
|
* Different error types that may be thrown by the routerlicious driver
|
package/dist/errorUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAKN,KAAK,yBAAyB,EAC9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAA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EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,eAAe,CAAC,EAAE,yBAAyB,GACzC,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACzC,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,MAAM,EACf,eAAe,CAAC,EAAE,yBAAyB,GACzC,SAAS,CAgBX;AAED,kDAAkD;AAClD,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,MAAM,GAAG,SAAS,CAuC1F"}
|
package/dist/errorUtils.js
CHANGED
|
@@ -44,29 +44,35 @@ function createR11sNetworkError(errorMessage, statusCode, retryAfterMs, addition
|
|
|
44
44
|
case 401:
|
|
45
45
|
// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,
|
|
46
46
|
// so we treat repeat 401s the same as 403.
|
|
47
|
-
case 403:
|
|
47
|
+
case 403: {
|
|
48
48
|
error = new internal_2.AuthorizationError(errorMessage, undefined, undefined, props);
|
|
49
49
|
break;
|
|
50
|
-
|
|
50
|
+
}
|
|
51
|
+
case 404: {
|
|
51
52
|
const errorType = exports.RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;
|
|
52
53
|
error = new internal_2.NonRetryableError(errorMessage, errorType, props);
|
|
53
54
|
break;
|
|
54
|
-
|
|
55
|
+
}
|
|
56
|
+
case 429: {
|
|
55
57
|
error = (0, internal_2.createGenericNetworkError)(errorMessage, { canRetry: true, retryAfterMs }, props);
|
|
56
58
|
break;
|
|
59
|
+
}
|
|
57
60
|
case 500:
|
|
58
|
-
case 502:
|
|
61
|
+
case 502: {
|
|
59
62
|
error = new internal_2.GenericNetworkError(errorMessage, true, props);
|
|
60
63
|
break;
|
|
61
|
-
|
|
64
|
+
}
|
|
65
|
+
case 503: {
|
|
62
66
|
if (internalErrorCode === contracts_js_1.R11sServiceClusterDrainingErrorCode) {
|
|
63
|
-
error = new ClusterDrainingError(errorMessage, retryAfterMs
|
|
67
|
+
error = new ClusterDrainingError(errorMessage, retryAfterMs === undefined ? 660 : retryAfterMs / 1000, props);
|
|
64
68
|
break;
|
|
65
69
|
}
|
|
66
|
-
|
|
70
|
+
}
|
|
71
|
+
default: {
|
|
67
72
|
const retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };
|
|
68
73
|
error = (0, internal_2.createGenericNetworkError)(errorMessage, retryInfo, props);
|
|
69
74
|
break;
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
error.addTelemetryProperties({ endpointReached: true });
|
|
72
78
|
return error;
|
package/dist/errorUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAIqD;AACrD,oEAM+C;AAC/C,uEAAyF;AAEzF,iDAAqE;AACrE,2DAAkE;AAElE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG;IACtC,kCAAkC;IAClC,GAAG,2BAAgB;IAEnB;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;;OAGG;IACH,oBAAoB,EAAE,sBAAsB;CACnC,CAAC;AA0CX,MAAa,oBAAqB,SAAQ,uBAAY;IAIrD,YACC,OAAe,EACN,iBAAyB,EAClC,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,sBAAiB,GAAjB,iBAAiB,CAAQ;QAL1B,cAAS,GAAG,+BAAuB,CAAC,oBAAoB,CAAC;QACzD,aAAQ,GAAG,IAAI,CAAC;IAQzB,CAAC;CACD;AAXD,oDAWC;AAQD,SAAgB,sBAAsB,CACrC,YAAoB,EACpB,UAAkB,EAClB,YAAqB,EACrB,eAA2C,EAC3C,iBAAmC;IAEnC,IAAI,KAAkC,CAAC;IACvC,MAAM,KAAK,GAAG,EAAE,GAAG,eAAe,EAAE,UAAU,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AAO;gBACP,QAAQ;gBACR,WAAW;gBACX,SAAS;gBACT,KAAK;gBACL,WAAW;gBACX,QAAQ;gBACR,UAAU;gBACV,SAAS;gBACT,OAAO;gBACP,MAAM;gBACN,aAAa;gBACb,aAAa;aACb,CAAC,QAAQ,CAAC,OAAO,CAAC,EAClB,CAAC;gBACF,aAAa,IAAI,IAAI,OAAO,EAAE,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACP,aAAa,IAAI,WAAW,CAAC;YAC9B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,GAAG,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAC9C,CAAC;AAvCD,gDAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverError,\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tAuthorizationError,\n\tGenericNetworkError,\n\tNonRetryableError,\n\tcreateGenericNetworkError,\n\ttype DriverErrorTelemetryProps,\n} from \"@fluidframework/driver-utils/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { R11sServiceClusterDrainingErrorCode } from \"./contracts.js\";\nimport { pkgVersion as driverVersion } from \"./packageVersion.js\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n * @internal\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n\n\t/**\n\t * Error for when the service drains a cluster to which the socket connection is connected to and it disconnects\n\t * all the clients in that cluster.\n\t */\n\tclusterDrainingError: \"clusterDrainingError\",\n} as const;\n/**\n * @internal\n */\nexport type RouterliciousErrorTypes =\n\t(typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];\n\n/**\n * Interface for error responses for the WebSocket connection\n * Intended to be compatible with output from `NetworkError.toJSON`.\n */\nexport interface IR11sSocketError {\n\t/**\n\t * An error code number for the error that occurred.\n\t * It will be a valid HTTP status code.\n\t */\n\tcode: number;\n\n\t/**\n\t * A message about the error that occurred for debugging / logging purposes.\n\t * This should not be displayed to the user directly.\n\t */\n\tmessage: string;\n\n\t/**\n\t * Optional Retry-After time in seconds.\n\t * The client should wait this many seconds before retrying its request.\n\t */\n\tretryAfter?: number;\n\n\t/**\n\t * Optional Retry-After time in milliseconds.\n\t * The client should wait this many milliseconds before retrying its request.\n\t */\n\tretryAfterMs?: number;\n\n\t/**\n\t * Optional internalErrorCode to specify the specific error code for the error within the main code above.\n\t */\n\tinternalErrorCode?: string | number;\n}\n\nexport class ClusterDrainingError extends LoggingError implements IFluidErrorBase {\n\treadonly errorType = RouterliciousErrorTypes.clusterDrainingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\nexport interface IR11sError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: RouterliciousErrorTypes;\n}\n\nexport type R11sError = DriverError | IR11sError;\n\nexport function createR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n\tadditionalProps?: DriverErrorTelemetryProps,\n\tinternalErrorCode?: string | number,\n): IFluidErrorBase & R11sError {\n\tlet error: IFluidErrorBase & R11sError;\n\tconst props = { ...additionalProps, statusCode, driverVersion };\n\tswitch (statusCode) {\n\t\tcase 401:\n\t\t// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,\n\t\t// so we treat repeat 401s the same as 403.\n\t\tcase 403:\n\t\t\terror = new AuthorizationError(errorMessage, undefined, undefined, props);\n\t\t\tbreak;\n\t\tcase 404:\n\t\t\tconst errorType = RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;\n\t\t\terror = new NonRetryableError(errorMessage, errorType, props);\n\t\t\tbreak;\n\t\tcase 429:\n\t\t\terror = createGenericNetworkError(errorMessage, { canRetry: true, retryAfterMs }, props);\n\t\t\tbreak;\n\t\tcase 500:\n\t\tcase 502:\n\t\t\terror = new GenericNetworkError(errorMessage, true, props);\n\t\t\tbreak;\n\t\tcase 503:\n\t\t\tif (internalErrorCode === R11sServiceClusterDrainingErrorCode) {\n\t\t\t\terror = new ClusterDrainingError(\n\t\t\t\t\terrorMessage,\n\t\t\t\t\tretryAfterMs !== undefined ? retryAfterMs / 1000 : 660,\n\t\t\t\t\tprops,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\tdefault:\n\t\t\tconst retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };\n\t\t\terror = createGenericNetworkError(errorMessage, retryInfo, props);\n\t\t\tbreak;\n\t}\n\terror.addTelemetryProperties({ endpointReached: true });\n\treturn error;\n}\n\nexport function throwR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n\tadditionalProps?: DriverErrorTelemetryProps,\n): never {\n\tthrow createR11sNetworkError(errorMessage, statusCode, retryAfterMs, additionalProps);\n}\n\n/**\n * Returns network error based on error object from R11s socket (IR11sSocketError)\n */\nexport function errorObjectFromSocketError(\n\tsocketError: IR11sSocketError,\n\thandler: string,\n\tadditionalProps?: DriverErrorTelemetryProps,\n): R11sError {\n\t// pre-0.58 error message prefix: R11sSocketError\n\tconst message = `R11s socket error (${handler}): ${socketError.message}`;\n\tconst error = createR11sNetworkError(\n\t\tmessage,\n\t\tsocketError.code,\n\t\tsocketError.retryAfterMs,\n\t\tadditionalProps,\n\t\tsocketError.internalErrorCode,\n\t);\n\terror.addTelemetryProperties({\n\t\trelayServiceError: true,\n\t\tscenarioName: handler,\n\t\tinternalErrorCode: socketError.internalErrorCode,\n\t});\n\treturn error;\n}\n\n/** Simulate the pathname for socket connection */\nexport const socketIoPath = \"socket.io\";\n\n/**\n * Get a stripped version of a URL safe for r11s telemetry\n * @returns undefined if no appropriate hostName is provided\n */\nexport function getUrlForTelemetry(hostName: string, path: string = \"\"): string | undefined {\n\t// Strip off \"http://\" or \"https://\"\n\tconst hostNameMatch = /^(?:https?:\\/\\/)?([^/]+)/.exec(hostName);\n\tif (!hostNameMatch) {\n\t\treturn undefined;\n\t}\n\tconst strippedHostName = hostNameMatch[1];\n\n\tlet extractedPath = \"\";\n\t// Extract portions of the path and explicitly match them to known path names\n\tfor (const portion of path.split(\"/\")) {\n\t\tif (portion !== \"\") {\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (\n\t\t\t\t[\n\t\t\t\t\tsocketIoPath,\n\t\t\t\t\t\"repos\",\n\t\t\t\t\t\"deltas\",\n\t\t\t\t\t\"documents\",\n\t\t\t\t\t\"session\",\n\t\t\t\t\t\"git\",\n\t\t\t\t\t\"summaries\",\n\t\t\t\t\t\"latest\",\n\t\t\t\t\t\"document\",\n\t\t\t\t\t\"commits\",\n\t\t\t\t\t\"blobs\",\n\t\t\t\t\t\"refs\",\n\t\t\t\t\t\"revokeToken\",\n\t\t\t\t\t\"accesstoken\",\n\t\t\t\t].includes(portion)\n\t\t\t) {\n\t\t\t\textractedPath += `/${portion}`;\n\t\t\t} else {\n\t\t\t\textractedPath += \"/REDACTED\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn `${strippedHostName}${extractedPath}`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,0EAA+E;AAC/E,oEAM+C;AAE/C,uEAAwE;AAExE,iDAAqE;AACrE,2DAAkE;AAElE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG;IACtC,kCAAkC;IAClC,GAAG,2BAAgB;IAEnB;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;;OAGG;IACH,oBAAoB,EAAE,sBAAsB;CACnC,CAAC;AA0CX,MAAa,oBAAqB,SA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C,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC;AApBD,gEAoBC;AAED,kDAAkD;AACrC,QAAA,YAAY,GAAG,WAAW,CAAC;AAExC;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,QAAgB,EAAE,OAAe,EAAE;IACrE,oCAAoC;IACpC,MAAM,aAAa,GAAG,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,aAAa,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,gBAAgB,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE1C,IAAI,aAAa,GAAG,EAAE,CAAC;IACvB,6EAA6E;IAC7E,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YACpB,kDAAkD;YAClD,IACC;gBACC,oBAAY;gBACZ,OAAO;gBACP,QAAQ;gBACR,WAAW;gBACX,SAAS;gBACT,KAAK;gBACL,WAAW;gBACX,QAAQ;gBACR,UAAU;gBACV,SAAS;gBACT,OAAO;gBACP,MAAM;gBACN,aAAa;gBACb,aAAa;aACb,CAAC,QAAQ,CAAC,OAAO,CAAC,EAClB,CAAC;gBACF,aAAa,IAAI,IAAI,OAAO,EAAE,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACP,aAAa,IAAI,WAAW,CAAC;YAC9B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,GAAG,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAC9C,CAAC;AAvCD,gDAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tDriverError,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { DriverErrorTypes } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tAuthorizationError,\n\tGenericNetworkError,\n\tNonRetryableError,\n\tcreateGenericNetworkError,\n\ttype DriverErrorTelemetryProps,\n} from \"@fluidframework/driver-utils/internal\";\nimport type { IFluidErrorBase } from \"@fluidframework/telemetry-utils/internal\";\nimport { LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { R11sServiceClusterDrainingErrorCode } from \"./contracts.js\";\nimport { pkgVersion as driverVersion } from \"./packageVersion.js\";\n\n/**\n * Routerlicious Error types\n * Different error types that may be thrown by the routerlicious driver\n * @internal\n */\nexport const RouterliciousErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * SSL Certificate Error.\n\t */\n\tsslCertError: \"sslCertError\",\n\n\t/**\n\t * Error for when the service drains a cluster to which the socket connection is connected to and it disconnects\n\t * all the clients in that cluster.\n\t */\n\tclusterDrainingError: \"clusterDrainingError\",\n} as const;\n/**\n * @internal\n */\nexport type RouterliciousErrorTypes =\n\t(typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];\n\n/**\n * Interface for error responses for the WebSocket connection\n * Intended to be compatible with output from `NetworkError.toJSON`.\n */\nexport interface IR11sSocketError {\n\t/**\n\t * An error code number for the error that occurred.\n\t * It will be a valid HTTP status code.\n\t */\n\tcode: number;\n\n\t/**\n\t * A message about the error that occurred for debugging / logging purposes.\n\t * This should not be displayed to the user directly.\n\t */\n\tmessage: string;\n\n\t/**\n\t * Optional Retry-After time in seconds.\n\t * The client should wait this many seconds before retrying its request.\n\t */\n\tretryAfter?: number;\n\n\t/**\n\t * Optional Retry-After time in milliseconds.\n\t * The client should wait this many milliseconds before retrying its request.\n\t */\n\tretryAfterMs?: number;\n\n\t/**\n\t * Optional internalErrorCode to specify the specific error code for the error within the main code above.\n\t */\n\tinternalErrorCode?: string | number;\n}\n\nexport class ClusterDrainingError extends LoggingError implements IFluidErrorBase {\n\treadonly errorType = RouterliciousErrorTypes.clusterDrainingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\nexport interface IR11sError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: RouterliciousErrorTypes;\n}\n\nexport type R11sError = DriverError | IR11sError;\n\nexport function createR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n\tadditionalProps?: DriverErrorTelemetryProps,\n\tinternalErrorCode?: string | number,\n): IFluidErrorBase & R11sError {\n\tlet error: IFluidErrorBase & R11sError;\n\tconst props = { ...additionalProps, statusCode, driverVersion };\n\tswitch (statusCode) {\n\t\tcase 401:\n\t\t// The first 401 is manually retried in RouterliciousRestWrapper with a refreshed token,\n\t\t// so we treat repeat 401s the same as 403.\n\t\tcase 403: {\n\t\t\terror = new AuthorizationError(errorMessage, undefined, undefined, props);\n\t\t\tbreak;\n\t\t}\n\t\tcase 404: {\n\t\t\tconst errorType = RouterliciousErrorTypes.fileNotFoundOrAccessDeniedError;\n\t\t\terror = new NonRetryableError(errorMessage, errorType, props);\n\t\t\tbreak;\n\t\t}\n\t\tcase 429: {\n\t\t\terror = createGenericNetworkError(errorMessage, { canRetry: true, retryAfterMs }, props);\n\t\t\tbreak;\n\t\t}\n\t\tcase 500:\n\t\tcase 502: {\n\t\t\terror = new GenericNetworkError(errorMessage, true, props);\n\t\t\tbreak;\n\t\t}\n\t\tcase 503: {\n\t\t\tif (internalErrorCode === R11sServiceClusterDrainingErrorCode) {\n\t\t\t\terror = new ClusterDrainingError(\n\t\t\t\t\terrorMessage,\n\t\t\t\t\tretryAfterMs === undefined ? 660 : retryAfterMs / 1000,\n\t\t\t\t\tprops,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdefault: {\n\t\t\tconst retryInfo = { canRetry: retryAfterMs !== undefined, retryAfterMs };\n\t\t\terror = createGenericNetworkError(errorMessage, retryInfo, props);\n\t\t\tbreak;\n\t\t}\n\t}\n\terror.addTelemetryProperties({ endpointReached: true });\n\treturn error;\n}\n\nexport function throwR11sNetworkError(\n\terrorMessage: string,\n\tstatusCode: number,\n\tretryAfterMs?: number,\n\tadditionalProps?: DriverErrorTelemetryProps,\n): never {\n\tthrow createR11sNetworkError(errorMessage, statusCode, retryAfterMs, additionalProps);\n}\n\n/**\n * Returns network error based on error object from R11s socket (IR11sSocketError)\n */\nexport function errorObjectFromSocketError(\n\tsocketError: IR11sSocketError,\n\thandler: string,\n\tadditionalProps?: DriverErrorTelemetryProps,\n): R11sError {\n\t// pre-0.58 error message prefix: R11sSocketError\n\tconst message = `R11s socket error (${handler}): ${socketError.message}`;\n\tconst error = createR11sNetworkError(\n\t\tmessage,\n\t\tsocketError.code,\n\t\tsocketError.retryAfterMs,\n\t\tadditionalProps,\n\t\tsocketError.internalErrorCode,\n\t);\n\terror.addTelemetryProperties({\n\t\trelayServiceError: true,\n\t\tscenarioName: handler,\n\t\tinternalErrorCode: socketError.internalErrorCode,\n\t});\n\treturn error;\n}\n\n/** Simulate the pathname for socket connection */\nexport const socketIoPath = \"socket.io\";\n\n/**\n * Get a stripped version of a URL safe for r11s telemetry\n * @returns undefined if no appropriate hostName is provided\n */\nexport function getUrlForTelemetry(hostName: string, path: string = \"\"): string | undefined {\n\t// Strip off \"http://\" or \"https://\"\n\tconst hostNameMatch = /^(?:https?:\\/\\/)?([^/]+)/.exec(hostName);\n\tif (!hostNameMatch) {\n\t\treturn undefined;\n\t}\n\tconst strippedHostName = hostNameMatch[1];\n\n\tlet extractedPath = \"\";\n\t// Extract portions of the path and explicitly match them to known path names\n\tfor (const portion of path.split(\"/\")) {\n\t\tif (portion !== \"\") {\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (\n\t\t\t\t[\n\t\t\t\t\tsocketIoPath,\n\t\t\t\t\t\"repos\",\n\t\t\t\t\t\"deltas\",\n\t\t\t\t\t\"documents\",\n\t\t\t\t\t\"session\",\n\t\t\t\t\t\"git\",\n\t\t\t\t\t\"summaries\",\n\t\t\t\t\t\"latest\",\n\t\t\t\t\t\"document\",\n\t\t\t\t\t\"commits\",\n\t\t\t\t\t\"blobs\",\n\t\t\t\t\t\"refs\",\n\t\t\t\t\t\"revokeToken\",\n\t\t\t\t\t\"accesstoken\",\n\t\t\t\t].includes(portion)\n\t\t\t) {\n\t\t\t\textractedPath += `/${portion}`;\n\t\t\t} else {\n\t\t\t\textractedPath += \"/REDACTED\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn `${strippedHostName}${extractedPath}`;\n}\n"]}
|
package/dist/gitManager.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IGitBlob, IGitCommitDetails, IGitCreateBlobResponse, IGitCreateTreeParams, IGitTree } from "@fluidframework/driver-definitions/internal";
|
|
6
|
-
import { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
|
|
7
|
-
import { IWholeFlatSnapshot } from "./contracts.js";
|
|
8
|
-
import { IR11sResponse } from "./restWrapper.js";
|
|
9
|
-
import { IGitManager, IHistorian } from "./storageContracts.js";
|
|
6
|
+
import type { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
|
|
7
|
+
import type { IWholeFlatSnapshot } from "./contracts.js";
|
|
8
|
+
import type { IR11sResponse } from "./restWrapper.js";
|
|
9
|
+
import type { IGitManager, IHistorian } from "./storageContracts.js";
|
|
10
10
|
export declare class GitManager implements IGitManager {
|
|
11
11
|
private readonly historian;
|
|
12
12
|
constructor(historian: IHistorian);
|
package/dist/gitManager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitManager.d.ts","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,QAAQ,EACR,iBAAiB,EAEjB,sBAAsB,EACtB,oBAAoB,EAC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,OAAO,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACD;AAlDD,gCAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeParams,\n\tIGitTree,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\n\nimport { IWholeFlatSnapshot } from \"./contracts.js\";\nimport { IR11sResponse } from \"./restWrapper.js\";\nimport { IGitManager, IHistorian } from \"./storageContracts.js\";\n\nexport class GitManager implements IGitManager {\n\tconstructor(private readonly historian: IHistorian) {}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<IGitCommitDetails[]>> {\n\t\treturn this.historian.getCommits(sha, count);\n\t}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getTree(root: string, recursive = true): Promise<IR11sResponse<IGitTree>> {\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<IGitBlob>> {\n\t\treturn this.historian.getBlob(sha);\n\t}\n\n\tpublic async createBlob(\n\t\tcontent: string,\n\t\tencoding: \"utf-8\" | \"base64\",\n\t): Promise<IR11sResponse<IGitCreateBlobResponse>> {\n\t\tconst blob: IGitCreateBlobParams = {\n\t\t\tcontent,\n\t\t\tencoding,\n\t\t};\n\t\treturn this.historian.createBlob(blob);\n\t}\n\n\tpublic async createGitTree(params: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>> {\n\t\tconst treeP = this.historian.createTree(params);\n\t\treturn treeP;\n\t}\n\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial: boolean = false,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.historian.createSummary(summary, initial);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.historian.getSnapshot(sha);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gitManager.js","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBH,MAAa,UAAU;IACtB,YAA6B,SAAqB;QAArB,cAAS,GAAT,SAAS,CAAY;IAAG,CAAC;IAEtD;;OAEG;IACI,KAAK,CAAC,UAAU,CACtB,GAAW,EACX,KAAa;QAEb,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,SAAS,GAAG,IAAI;QAClD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW;QAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,OAAe,EACf,QAA4B;QAE5B,MAAM,IAAI,GAAyB;YAClC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,MAA4B;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,UAAmB,KAAK;QAExB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACD;AAlDD,gCAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeParams,\n\tIGitTree,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\n\nimport type { IWholeFlatSnapshot } from \"./contracts.js\";\nimport type { IR11sResponse } from \"./restWrapper.js\";\nimport type { IGitManager, IHistorian } from \"./storageContracts.js\";\n\nexport class GitManager implements IGitManager {\n\tconstructor(private readonly historian: IHistorian) {}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<IGitCommitDetails[]>> {\n\t\treturn this.historian.getCommits(sha, count);\n\t}\n\n\t/**\n\t * Reads the object with the given ID. We defer to the client implementation to do the actual read.\n\t */\n\tpublic async getTree(root: string, recursive = true): Promise<IR11sResponse<IGitTree>> {\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<IGitBlob>> {\n\t\treturn this.historian.getBlob(sha);\n\t}\n\n\tpublic async createBlob(\n\t\tcontent: string,\n\t\tencoding: \"utf-8\" | \"base64\",\n\t): Promise<IR11sResponse<IGitCreateBlobResponse>> {\n\t\tconst blob: IGitCreateBlobParams = {\n\t\t\tcontent,\n\t\t\tencoding,\n\t\t};\n\t\treturn this.historian.createBlob(blob);\n\t}\n\n\tpublic async createGitTree(params: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>> {\n\t\tconst treeP = this.historian.createTree(params);\n\t\treturn treeP;\n\t}\n\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial: boolean = false,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.historian.createSummary(summary, initial);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.historian.getSnapshot(sha);\n\t}\n}\n"]}
|
package/dist/historian.d.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IGitBlob, IGitCommitDetails, IGitCreateBlobParams, IGitCreateBlobResponse, IGitCreateTreeParams, IGitTree } from "@fluidframework/driver-definitions/internal";
|
|
6
|
-
import { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
|
|
7
|
-
import { IWholeFlatSnapshot } from "./contracts.js";
|
|
8
|
-
import { IR11sResponse } from "./restWrapper.js";
|
|
9
|
-
import { RestWrapper } from "./restWrapperBase.js";
|
|
10
|
-
import { IHistorian } from "./storageContracts.js";
|
|
6
|
+
import type { IWholeSummaryPayload, IWriteSummaryResponse } from "@fluidframework/server-services-client";
|
|
7
|
+
import type { IWholeFlatSnapshot } from "./contracts.js";
|
|
8
|
+
import type { IR11sResponse } from "./restWrapper.js";
|
|
9
|
+
import type { RestWrapper } from "./restWrapperBase.js";
|
|
10
|
+
import type { IHistorian } from "./storageContracts.js";
|
|
11
11
|
export interface ICredentials {
|
|
12
12
|
user: string;
|
|
13
13
|
password: string;
|
package/dist/historian.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,QAAQ,EACR,MAAM,6CAA6C,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,QAAQ,EACR,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACX,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oCAAoC,gBAAiB,YAAY,KAAG,MACN,CAAC;AAE5E;;GAEG;AACH,qBAAa,SAAU,YAAW,UAAU;IAK1C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAuB;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAGlB,YAAY,EAAE,OAAO,EACtC,YAAY,EAAE,OAAO,EACJ,WAAW,EAAE,WAAW;IAU7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAOtD,UAAU,CACtB,IAAI,EAAE,oBAAoB,GACxB,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAQpC,UAAU,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAgBjC,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAIxE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAM1E,aAAa,CACzB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAQnC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAOjF,OAAO,CAAC,cAAc;CAatB"}
|
package/dist/historian.js
CHANGED
|
@@ -50,7 +50,7 @@ class Historian {
|
|
|
50
50
|
return this.restWrapper.get(`/git/trees/${encodeURIComponent(sha)}`, this.getQueryString({ recursive: recursive ? 1 : 0 }));
|
|
51
51
|
}
|
|
52
52
|
async createSummary(summary, initial) {
|
|
53
|
-
return this.restWrapper.post(`/git/summaries`, summary, this.getQueryString(initial
|
|
53
|
+
return this.restWrapper.post(`/git/summaries`, summary, this.getQueryString(initial === undefined ? undefined : { initial }));
|
|
54
54
|
}
|
|
55
55
|
async getSnapshot(sha) {
|
|
56
56
|
return this.restWrapper.get(`/git/summaries/${sha}`, this.getQueryString());
|
package/dist/historian.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historian.js","sourceRoot":"","sources":["../src/historian.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAgE;AAyBzD,MAAM,oCAAoC,GAAG,CAAC,WAAyB,E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I,CAAW,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IACnF,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,SAAkB;QACnD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAC1B,cAAc,kBAAkB,CAAC,GAAG,CAAC,EAAE,EACvC,IAAI,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CACrD,CAAC;IACH,CAAC;IACM,KAAK,CAAC,aAAa,CACzB,OAA6B,EAC7B,OAAiB;QAEjB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAC3B,gBAAgB,EAChB,OAAO,EACP,IAAI,CAAC,cAAc,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CACpE,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAC1B,kBAAkB,GAAG,EAAE,EACvB,IAAI,CAAC,cAAc,EAAE,CACrB,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,WAA6B;QACnD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO;gBACN,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,GAAG,IAAI,CAAC,kBAAkB;gBAC1B,GAAG,WAAW;aACd,CAAC;QACH,CAAC;QACD,OAAO;YACN,GAAG,IAAI,CAAC,kBAAkB;YAC1B,GAAG,WAAW;SACd,CAAC;IACH,CAAC;CACD;AA9FD,8BA8FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fromUtf8ToBase64 } from \"@fluid-internal/client-utils\";\nimport type {\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeParams,\n\tIGitTree,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\n\nimport type { IWholeFlatSnapshot } from \"./contracts.js\";\nimport type { QueryStringType } from \"./queryStringUtils.js\";\nimport type { IR11sResponse } from \"./restWrapper.js\";\nimport type { RestWrapper } from \"./restWrapperBase.js\";\nimport type { IHistorian } from \"./storageContracts.js\";\n\nexport interface ICredentials {\n\tuser: string;\n\tpassword: string;\n}\n\nexport const getAuthorizationTokenFromCredentials = (credentials: ICredentials): string =>\n\t`Basic ${fromUtf8ToBase64(`${credentials.user}:${credentials.password}`)}`;\n\n/**\n * Implementation of the IHistorian interface that calls out to a REST interface\n */\nexport class Historian implements IHistorian {\n\tprivate readonly defaultQueryString: QueryStringType = {};\n\tprivate readonly cacheBust: boolean;\n\n\tconstructor(\n\t\tprivate readonly historianApi: boolean,\n\t\tdisableCache: boolean,\n\t\tprivate readonly restWrapper: RestWrapper,\n\t) {\n\t\tif (disableCache && this.historianApi) {\n\t\t\tthis.defaultQueryString.disableCache = disableCache;\n\t\t\tthis.cacheBust = false;\n\t\t} else {\n\t\t\tthis.cacheBust = disableCache;\n\t\t}\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<IGitBlob>> {\n\t\treturn this.restWrapper.get<IGitBlob>(\n\t\t\t`/git/blobs/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async createBlob(\n\t\tblob: IGitCreateBlobParams,\n\t): Promise<IR11sResponse<IGitCreateBlobResponse>> {\n\t\treturn this.restWrapper.post<IGitCreateBlobResponse>(\n\t\t\t`/git/blobs`,\n\t\t\tblob,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tpublic async getCommits(\n\t\tsha: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<IGitCommitDetails[]>> {\n\t\treturn this.restWrapper\n\t\t\t.get<IGitCommitDetails[]>(`/commits`, this.getQueryString({ count, sha }))\n\t\t\t.catch(async (error) =>\n\t\t\t\terror.statusCode === 400 || error.statusCode === 404\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcontent: [],\n\t\t\t\t\t\t\theaders: new Map(),\n\t\t\t\t\t\t\tpropsToLog: {},\n\t\t\t\t\t\t\trequestUrl: \"\",\n\t\t\t\t\t\t}\n\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n\t\t\t\t\t\tPromise.reject<IR11sResponse<IGitCommitDetails[]>>(error),\n\t\t\t);\n\t}\n\n\tpublic async createTree(tree: IGitCreateTreeParams): Promise<IR11sResponse<IGitTree>> {\n\t\treturn this.restWrapper.post<IGitTree>(`/git/trees`, tree, this.getQueryString());\n\t}\n\n\tpublic async getTree(sha: string, recursive: boolean): Promise<IR11sResponse<IGitTree>> {\n\t\treturn this.restWrapper.get<IGitTree>(\n\t\t\t`/git/trees/${encodeURIComponent(sha)}`,\n\t\t\tthis.getQueryString({ recursive: recursive ? 1 : 0 }),\n\t\t);\n\t}\n\tpublic async createSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial?: boolean,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>> {\n\t\treturn this.restWrapper.post<IWriteSummaryResponse>(\n\t\t\t`/git/summaries`,\n\t\t\tsummary,\n\t\t\tthis.getQueryString(initial === undefined ? undefined : { initial }),\n\t\t);\n\t}\n\n\tpublic async getSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>> {\n\t\treturn this.restWrapper.get<IWholeFlatSnapshot>(\n\t\t\t`/git/summaries/${sha}`,\n\t\t\tthis.getQueryString(),\n\t\t);\n\t}\n\n\tprivate getQueryString(queryString?: QueryStringType): QueryStringType {\n\t\tif (this.cacheBust) {\n\t\t\treturn {\n\t\t\t\tcacheBust: Date.now(),\n\t\t\t\t...this.defaultQueryString,\n\t\t\t\t...queryString,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...this.defaultQueryString,\n\t\t\t...queryString,\n\t\t};\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export type { IRouterliciousResolvedUrl } from "./routerliciousResolvedUrl.js";
|
|
6
6
|
export { DefaultTokenProvider } from "./defaultTokenProvider.js";
|
|
7
|
-
export { ITokenProvider, ITokenResponse, ITokenService } from "./tokens.js";
|
|
7
|
+
export type { ITokenProvider, ITokenResponse, ITokenService } from "./tokens.js";
|
|
8
8
|
export { RouterliciousErrorTypes } from "./errorUtils.js";
|
|
9
9
|
export { createRouterliciousDocumentServiceFactory, DocumentPostCreateError, RouterliciousDocumentServiceFactory, } from "./documentServiceFactory.js";
|
|
10
|
-
export { IRouterliciousDriverPolicies } from "./policies.js";
|
|
10
|
+
export type { IRouterliciousDriverPolicies } from "./policies.js";
|
|
11
11
|
export { r11sDriverCompatDetailsForLoader } from "./r11sLayerCompatState.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EACN,yCAAyC,EACzC,uBAAuB,EACvB,mCAAmC,GACnC,MAAM,6BAA6B,CAAC;AAGrC,YAAY,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAGlE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,SAAS;AACT,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAG7B,SAAS;AACT,iDAA0D;AAAjD,wHAAA,uBAAuB,OAAA;AAEhC,UAAU;AACV,yEAIqC;AAHpC,sJAAA,yCAAyC,OAAA;AACzC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA;AAMpC,uBAAuB;AACvB,qEAA6E;AAApE,2IAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// URL\nexport type { IRouterliciousResolvedUrl } from \"./routerliciousResolvedUrl.js\";\n\n// Tokens\nexport { DefaultTokenProvider } from \"./defaultTokenProvider.js\";\nexport { ITokenProvider, ITokenResponse, ITokenService } from \"./tokens.js\";\n\n// Errors\nexport { RouterliciousErrorTypes } from \"./errorUtils.js\";\n\n// Factory\nexport {\n\tcreateRouterliciousDocumentServiceFactory,\n\tDocumentPostCreateError,\n\tRouterliciousDocumentServiceFactory,\n} from \"./documentServiceFactory.js\";\n\n// Configuration\nexport { IRouterliciousDriverPolicies } from \"./policies.js\";\n\n// Layer Compat details\nexport { r11sDriverCompatDetailsForLoader } from \"./r11sLayerCompatState.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,SAAS;AACT,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAG7B,SAAS;AACT,iDAA0D;AAAjD,wHAAA,uBAAuB,OAAA;AAEhC,UAAU;AACV,yEAIqC;AAHpC,sJAAA,yCAAyC,OAAA;AACzC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA;AAMpC,uBAAuB;AACvB,qEAA6E;AAApE,2IAAA,gCAAgC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// URL\nexport type { IRouterliciousResolvedUrl } from \"./routerliciousResolvedUrl.js\";\n\n// Tokens\nexport { DefaultTokenProvider } from \"./defaultTokenProvider.js\";\nexport type { ITokenProvider, ITokenResponse, ITokenService } from \"./tokens.js\";\n\n// Errors\nexport { RouterliciousErrorTypes } from \"./errorUtils.js\";\n\n// Factory\nexport {\n\tcreateRouterliciousDocumentServiceFactory,\n\tDocumentPostCreateError,\n\tRouterliciousDocumentServiceFactory,\n} from \"./documentServiceFactory.js\";\n\n// Configuration\nexport type { IRouterliciousDriverPolicies } from \"./policies.js\";\n\n// Layer Compat details\nexport { r11sDriverCompatDetailsForLoader } from \"./r11sLayerCompatState.js\";\n"]}
|
package/dist/legacy.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export {
|
|
@@ -18,7 +18,7 @@ class MapWithExpiration extends Map {
|
|
|
18
18
|
this.lastRefreshedTimes = new Map();
|
|
19
19
|
}
|
|
20
20
|
refresh(key) {
|
|
21
|
-
this.lastRefreshedTimes.set(key,
|
|
21
|
+
this.lastRefreshedTimes.set(key, Date.now());
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found
|
|
@@ -30,7 +30,7 @@ class MapWithExpiration extends Map {
|
|
|
30
30
|
if (refreshTime === undefined) {
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
|
-
const expired =
|
|
33
|
+
const expired = Date.now() - refreshTime >= this.expiryMs;
|
|
34
34
|
if (expired && cleanUp) {
|
|
35
35
|
this.delete(key);
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;;GAGG;AACH,MAAa,iBAA4C,SAAQ,GAAiB;IAIjF,YAA6B,QAAgB;QAC5C,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAQ;QAH7C,2EAA2E;QAC1D,uBAAkB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAI9D,CAAC;IAEO,OAAO,CAAC,GAAS;QACxB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;;GAGG;AACH,MAAa,iBAA4C,SAAQ,GAAiB;IAIjF,YAA6B,QAAgB;QAC5C,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAQ;QAH7C,2EAA2E;QAC1D,uBAAkB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAI9D,CAAC;IAEO,OAAO,CAAC,GAAS;QACxB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC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,CAAC,QAAQ,CAAC;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD;AAhHD,8CAgHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * An extension of Map that expires (deletes) entries after a period of inactivity.\n * The policy is based on the last time a key was written to.\n */\nexport class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValue> {\n\t/** Timestamps (as epoch ms numbers) of when each key was last refreshed */\n\tprivate readonly lastRefreshedTimes = new Map<TKey, number>();\n\n\tconstructor(private readonly expiryMs: number) {\n\t\tsuper();\n\t}\n\n\tprivate refresh(key: TKey): void {\n\t\tthis.lastRefreshedTimes.set(key, Date.now());\n\t}\n\n\t/**\n\t * Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found\n\t * If cleanUp is passed as true, then delete any expired entry before returning.\n\t */\n\tprivate checkExpiry(key: TKey, cleanUp: boolean = false): boolean | undefined {\n\t\tconst refreshTime = this.lastRefreshedTimes.get(key);\n\t\tassert(\n\t\t\t(refreshTime !== undefined) === super.has(key),\n\t\t\t0x50c /* freshness map out of sync */,\n\t\t);\n\n\t\tif (refreshTime === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst expired = Date.now() - refreshTime >= this.expiryMs;\n\t\tif (expired && cleanUp) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\treturn expired;\n\t}\n\n\tprivate clearExpiredEntries(): void {\n\t\t// forEach clears out any expired entries\n\t\tthis.forEach(() => {});\n\t}\n\n\tget size(): number {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.size;\n\t}\n\n\thas(key: TKey): boolean {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.has(key);\n\t}\n\n\tget(key: TKey): TValue | undefined {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.get(key);\n\t}\n\n\tset(key: TKey, value: TValue): this {\n\t\t// Sliding window expiration policy (on write)\n\t\tthis.refresh(key);\n\t\treturn super.set(key, value);\n\t}\n\n\tdelete(key: TKey): boolean {\n\t\tthis.lastRefreshedTimes.delete(key);\n\t\treturn super.delete(key);\n\t}\n\n\tclear(): void {\n\t\tthis.lastRefreshedTimes.clear();\n\t\tsuper.clear();\n\t}\n\n\tforEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void,\n\t\tthisArg?: any,\n\t): void {\n\t\tconst expiredKeys: TKey[] = [];\n\t\tsuper.forEach(\n\t\t\t(v, k, m) => {\n\t\t\t\tif (this.checkExpiry(k) === true) {\n\t\t\t\t\texpiredKeys.push(k);\n\t\t\t\t} else {\n\t\t\t\t\tcallbackfn.bind(thisArg)(v, k, m);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// Note we don't pass thisArg here, since we bind it directly to callbackFn and don't need it otherwise\n\t\t);\n\n\t\t// Clean up keys we know are expired now that we're done iterating\n\t\texpiredKeys.forEach((key: TKey) => {\n\t\t\tthis.delete(key);\n\t\t});\n\t}\n\n\tentries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.entries();\n\t}\n\tkeys(): IterableIterator<TKey> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.keys();\n\t}\n\tvalues(): IterableIterator<TValue> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.values();\n\t}\n\t[Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super[Symbol.iterator]();\n\t}\n\n\tvalueOf(): ReturnType<typeof Map.valueOf> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.valueOf();\n\t}\n}\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISummaryTree, ISummaryHandle } from "@fluidframework/driver-definitions";
|
|
6
|
-
import { IDocumentStorageService, ISummaryContext, IVersion, ISnapshotTree, ICreateBlobResponse } from "@fluidframework/driver-definitions/internal";
|
|
5
|
+
import type { ISummaryTree, ISummaryHandle } from "@fluidframework/driver-definitions";
|
|
6
|
+
import type { IDocumentStorageService, ISummaryContext, IVersion, ISnapshotTree, ICreateBlobResponse } from "@fluidframework/driver-definitions/internal";
|
|
7
7
|
/**
|
|
8
8
|
* Document access to underlying storage. It is default implementation of a storage service.
|
|
9
9
|
* Does not read/write anything.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullBlobStorageService.d.ts","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"nullBlobStorageService.d.ts","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EACX,uBAAuB,EACvB,eAAe,EACf,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,MAAM,6CAA6C,CAAC;AAErD;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,uBAAuB;IACxD,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIlE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIzE,wBAAwB,CACpC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAIL,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAI9D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAG/D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAG/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullBlobStorageService.js","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH;;;GAGG;AACH,MAAa,sBAAsB;IAC3B,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC/D,OAAO,EAAE,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACpC,OAAqB,EACrB,OAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAsB;QAClD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC1D,CAAC;IACM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;CACD;AA1BD,wDA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISummaryTree, ISummaryHandle } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n\tIVersion,\n\tISnapshotTree,\n\tICreateBlobResponse,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Document access to underlying storage. It is default implementation of a storage service.\n * Does not read/write anything.\n */\nexport class NullBlobStorageService implements IDocumentStorageService {\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\tthrow new Error(\"Null blob storage can not create blob\");\n\t}\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Null blob storage can not read blob\");\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nullBlobStorageService.js","sourceRoot":"","sources":["../src/nullBlobStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH;;;GAGG;AACH,MAAa,sBAAsB;IAC3B,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,SAAwB,EAAE,KAAa;QAC/D,OAAO,EAAE,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACpC,OAAqB,EACrB,OAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAsB;QAClD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC1D,CAAC;IACM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;CACD;AA1BD,wDA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISummaryTree, ISummaryHandle } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentStorageService,\n\tISummaryContext,\n\tIVersion,\n\tISnapshotTree,\n\tICreateBlobResponse,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Document access to underlying storage. It is default implementation of a storage service.\n * Does not read/write anything.\n */\nexport class NullBlobStorageService implements IDocumentStorageService {\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\treturn version ? Promise.reject(new Error(\"Invalid operation\")) : null;\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\treturn [];\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\tthrow new Error(\"Invalid operation\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\tthrow new Error(\"Null blob storage can not create blob\");\n\t}\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tthrow new Error(\"Null blob storage can not read blob\");\n\t}\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -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/routerlicious-driver";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.92.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -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/routerlicious-driver";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.92.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,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,QAAQ,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/routerlicious-driver\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,QAAQ,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/routerlicious-driver\";\nexport const pkgVersion = \"2.92.0\";\n"]}
|
package/dist/public.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { INormalizedWholeSnapshot, IWholeFlatSnapshot } from "./contracts.js";
|
|
5
|
+
import type { INormalizedWholeSnapshot, IWholeFlatSnapshot } from "./contracts.js";
|
|
6
6
|
/**
|
|
7
7
|
* Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r11sSnapshotParser.d.ts","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"r11sSnapshotParser.d.ts","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACX,wBAAwB,EACxB,kBAAkB,EAElB,MAAM,gBAAgB,CAAC;AAgDxB;;;;;;GAMG;AACH,wBAAgB,8CAA8C,CAC7D,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,GAAE,MAAe,GACjC,wBAAwB,CAiB1B"}
|
|
@@ -56,9 +56,9 @@ function buildHierarchy(flatTree, treePrefixToRemove) {
|
|
|
56
56
|
function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(flatSnapshot, treePrefixToRemove = ".app") {
|
|
57
57
|
const blobs = new Map();
|
|
58
58
|
if (flatSnapshot.blobs) {
|
|
59
|
-
flatSnapshot.blobs
|
|
59
|
+
for (const blob of flatSnapshot.blobs) {
|
|
60
60
|
blobs.set(blob.id, (0, client_utils_1.stringToBuffer)(blob.content, blob.encoding ?? "utf-8"));
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
62
|
}
|
|
63
63
|
const flatSnapshotTree = flatSnapshot.trees?.[0];
|
|
64
64
|
const sequenceNumber = flatSnapshotTree?.sequenceNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r11sSnapshotParser.js","sourceRoot":"","sources":["../src/r11sSnapshotParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAS9D;;;;;;GAMG;AACH,SAAS,cAAc,CACtB,QAAgC,EAChC,kBAA0B;IAE1B,MAAM,MAAM,GAAsC,EAAE,CAAC;IACrD,uEAAuE;IACvE,MAAM,IAAI,GAAkB,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACtE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,8FAA8F;QAC9F,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,kBAAkB,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,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QAC1D,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,8CAA8C,CAC7D,YAAgC,EAChC,qBAA6B,MAAM;IAEnC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC7C,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;YACvC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAA,6BAAc,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC;QAC5E,CAAC;IACF,CAAC;IACD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,gBAAgB,EAAE,cAAc,CAAC;IACxD,MAAM,YAAY,GAAG,cAAc,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAE1E,OAAO;QACN,KAAK;QACL,YAAY;QACZ,cAAc;QACd,EAAE,EAAE,YAAY,CAAC,EAAE;KACnB,CAAC;AACH,CAAC;AApBD,wGAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport type { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\n\nimport type {\n\tINormalizedWholeSnapshot,\n\tIWholeFlatSnapshot,\n\tIWholeFlatSnapshotTree,\n} from \"./contracts.js\";\n\n/**\n * Build a tree hierarchy from a flat tree.\n *\n * @param flatTree - a flat tree\n * @param treePrefixToRemove - tree prefix to strip\n * @returns the heirarchical tree\n */\nfunction buildHierarchy(\n\tflatTree: IWholeFlatSnapshotTree,\n\ttreePrefixToRemove: string,\n): ISnapshotTree {\n\tconst lookup: { [path: string]: ISnapshotTree } = {};\n\t// Root tree id will be used to determine which version was downloaded.\n\tconst root: ISnapshotTree = { id: flatTree.id, blobs: {}, trees: {} };\n\tlookup[\"\"] = root;\n\n\tfor (const entry of flatTree.entries) {\n\t\t// Strip the `treePrefixToRemove` path from tree entries such that they are stored under root.\n\t\tconst entryPath = entry.path.replace(new RegExp(`^${treePrefixToRemove}/`), \"\");\n\t\tconst lastIndex = entryPath.lastIndexOf(\"/\");\n\t\tconst entryPathDir = entryPath.slice(0, Math.max(0, lastIndex));\n\t\tconst entryPathBase = entryPath.slice(lastIndex + 1);\n\n\t\t// The flat output is breadth-first so we can assume we see tree nodes prior to their contents\n\t\tconst node = lookup[entryPathDir];\n\n\t\t// Add in either the blob or tree\n\t\tif (entry.type === \"tree\") {\n\t\t\tconst newTree: ISnapshotTree = {\n\t\t\t\tblobs: {},\n\t\t\t\ttrees: {},\n\t\t\t\tunreferenced: entry.unreferenced,\n\t\t\t\tgroupId: entry.groupId,\n\t\t\t};\n\t\t\tnode.trees[decodeURIComponent(entryPathBase)] = newTree;\n\t\t\tlookup[entryPath] = newTree;\n\t\t} else if (entry.type === \"blob\") {\n\t\t\tnode.blobs[decodeURIComponent(entryPathBase)] = entry.id;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown entry type!!`);\n\t\t}\n\t}\n\n\treturn root;\n}\n\n/**\n * Converts existing IWholeFlatSnapshot to snapshot tree, blob array, and sequence number.\n *\n * @param flatSnapshot - flat snapshot\n * @param treePrefixToRemove - tree prefix to strip. By default we are stripping \".app\" prefix\n * @returns snapshot tree, blob array, and sequence number\n */\nexport function convertWholeFlatSnapshotToSnapshotTreeAndBlobs(\n\tflatSnapshot: IWholeFlatSnapshot,\n\ttreePrefixToRemove: string = \".app\",\n): INormalizedWholeSnapshot {\n\tconst blobs = new Map<string, ArrayBuffer>();\n\tif (flatSnapshot.blobs) {\n\t\tfor (const blob of flatSnapshot.blobs) {\n\t\t\tblobs.set(blob.id, stringToBuffer(blob.content, blob.encoding ?? \"utf-8\"));\n\t\t}\n\t}\n\tconst flatSnapshotTree = flatSnapshot.trees?.[0];\n\tconst sequenceNumber = flatSnapshotTree?.sequenceNumber;\n\tconst snapshotTree = buildHierarchy(flatSnapshotTree, treePrefixToRemove);\n\n\treturn {\n\t\tblobs,\n\t\tsnapshotTree,\n\t\tsequenceNumber,\n\t\tid: flatSnapshot.id,\n\t};\n}\n"]}
|
package/dist/restWrapper.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { RateLimiter } from "@fluidframework/driver-utils/internal";
|
|
7
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
5
|
+
import type { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { RateLimiter } from "@fluidframework/driver-utils/internal";
|
|
7
|
+
import type { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
import { type QueryStringType } from "./queryStringUtils.js";
|
|
9
9
|
import type { RequestConfig } from "./request.cjs";
|
|
10
10
|
import { RestWrapper } from "./restWrapperBase.js";
|
|
11
|
-
import { ITokenProvider, ITokenResponse } from "./tokens.js";
|
|
11
|
+
import type { ITokenProvider, ITokenResponse } from "./tokens.js";
|
|
12
12
|
type AuthorizationHeaderGetter = (token: ITokenResponse) => string;
|
|
13
13
|
export type TokenFetcher = (refresh?: boolean) => Promise<ITokenResponse>;
|
|
14
14
|
export interface IR11sResponse<T> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restWrapper.d.ts","sourceRoot":"","sources":["../src/restWrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EA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