@fluidframework/routerlicious-driver 2.0.0-internal.7.1.0 → 2.0.0-internal.7.2.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/routerlicious-driver
2
2
 
3
+ ## 2.0.0-internal.7.2.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.1.0
4
8
 
5
9
  Dependency updates only.
@@ -9,15 +9,11 @@ import { IR11sResponse } from "./restWrapper";
9
9
  import { IWholeFlatSnapshot } from "./contracts";
10
10
  export declare class GitManager implements IGitManager {
11
11
  private readonly historian;
12
- private readonly blobCache;
13
- private readonly commitCache;
14
- private readonly treeCache;
15
- private readonly refCache;
16
12
  constructor(historian: IHistorian);
17
13
  /**
18
14
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
19
15
  */
20
- getCommits(shaOrRef: string, count: number): Promise<IR11sResponse<resources.ICommitDetails[]>>;
16
+ getCommits(sha: string, count: number): Promise<IR11sResponse<resources.ICommitDetails[]>>;
21
17
  /**
22
18
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
23
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"gitManager.d.ts","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EACN,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAiC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,UAAW,YAAW,WAAW;IAMjC,OAAO,CAAC,QAAQ,CAAC,SAAS;IALtC,OAAO,CAAC,QAAQ,CAAC,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AAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,UAAW,YAAW,WAAW;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,UAAU;IAElD;;OAEG;IACU,UAAU,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC;IAIrD;;OAEG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAIhF,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAI7D,UAAU,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAC1B,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAQ3C,aAAa,CACzB,MAAM,EAAE,SAAS,CAAC,iBAAiB,GACjC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAK7B,aAAa,CACzB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,GAAE,OAAe,GACtB,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAInC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAGjF"}
@@ -5,66 +5,23 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.GitManager = void 0;
8
- const restWrapper_1 = require("./restWrapper");
9
8
  class GitManager {
10
9
  constructor(historian) {
11
10
  this.historian = historian;
12
- this.blobCache = new Map();
13
- this.commitCache = new Map();
14
- this.treeCache = new Map();
15
- this.refCache = new Map();
16
11
  }
17
12
  /**
18
13
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
19
14
  */
20
- async getCommits(shaOrRef, count) {
21
- let sha = shaOrRef;
22
- // See if the sha is really a ref and convert
23
- if (this.refCache.has(shaOrRef)) {
24
- sha = this.refCache.get(shaOrRef);
25
- // Delete refcache after first use
26
- this.refCache.delete(shaOrRef);
27
- // If null is stored for the ref then there are no commits - return an empty array
28
- if (!sha) {
29
- return (0, restWrapper_1.createR11sResponseFromContent)([]);
30
- }
31
- }
32
- // See if the commit sha is hashed and return it if so
33
- const commit = this.commitCache.get(sha);
34
- if (commit !== undefined) {
35
- return (0, restWrapper_1.createR11sResponseFromContent)([
36
- {
37
- commit: {
38
- author: commit.author,
39
- committer: commit.committer,
40
- message: commit.message,
41
- tree: commit.tree,
42
- url: commit.url,
43
- },
44
- parents: commit.parents,
45
- sha: commit.sha,
46
- url: commit.url,
47
- },
48
- ]);
49
- }
50
- // Otherwise fall back to the historian
15
+ async getCommits(sha, count) {
51
16
  return this.historian.getCommits(sha, count);
52
17
  }
53
18
  /**
54
19
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
55
20
  */
56
21
  async getTree(root, recursive = true) {
57
- const tree = this.treeCache.get(root);
58
- if (tree !== undefined) {
59
- return (0, restWrapper_1.createR11sResponseFromContent)(tree);
60
- }
61
22
  return this.historian.getTree(root, recursive);
62
23
  }
63
24
  async getBlob(sha) {
64
- const blob = this.blobCache.get(sha);
65
- if (blob !== undefined) {
66
- return (0, restWrapper_1.createR11sResponseFromContent)(blob);
67
- }
68
25
  return this.historian.getBlob(sha);
69
26
  }
70
27
  async createBlob(content, encoding) {
@@ -1 +1 @@
1
- {"version":3,"file":"gitManager.js","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,+CAA6E;AAG7E,MAAa,UAAU;IAMtB,YAA6B,SAAqB;QAArB,c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,GAAG,CAAC,CAAC;IACxC,CAAC;CACD;AArGD,gCAqGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, IHistorian } from \"./storageContracts\";\nimport { IR11sResponse, createR11sResponseFromContent } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\nexport class GitManager implements IGitManager {\n\tprivate readonly blobCache = new Map<string, resources.IBlob>();\n\tprivate readonly commitCache = new Map<string, resources.ICommit>();\n\tprivate readonly treeCache = new Map<string, resources.ITree>();\n\tprivate readonly refCache = new Map<string, string>();\n\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\tshaOrRef: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<resources.ICommitDetails[]>> {\n\t\tlet sha: string | undefined = shaOrRef;\n\n\t\t// See if the sha is really a ref and convert\n\t\tif (this.refCache.has(shaOrRef)) {\n\t\t\tsha = this.refCache.get(shaOrRef);\n\n\t\t\t// Delete refcache after first use\n\t\t\tthis.refCache.delete(shaOrRef);\n\n\t\t\t// If null is stored for the ref then there are no commits - return an empty array\n\t\t\tif (!sha) {\n\t\t\t\treturn createR11sResponseFromContent([]);\n\t\t\t}\n\t\t}\n\n\t\t// See if the commit sha is hashed and return it if so\n\t\tconst commit = this.commitCache.get(sha);\n\t\tif (commit !== undefined) {\n\t\t\treturn createR11sResponseFromContent([\n\t\t\t\t{\n\t\t\t\t\tcommit: {\n\t\t\t\t\t\tauthor: commit.author,\n\t\t\t\t\t\tcommitter: commit.committer,\n\t\t\t\t\t\tmessage: commit.message,\n\t\t\t\t\t\ttree: commit.tree,\n\t\t\t\t\t\turl: commit.url,\n\t\t\t\t\t},\n\t\t\t\t\tparents: commit.parents,\n\t\t\t\t\tsha: commit.sha,\n\t\t\t\t\turl: commit.url,\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\t// Otherwise fall back to the historian\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<resources.ITree>> {\n\t\tconst tree = this.treeCache.get(root);\n\t\tif (tree !== undefined) {\n\t\t\treturn createR11sResponseFromContent(tree);\n\t\t}\n\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\n\t\tconst blob = this.blobCache.get(sha);\n\t\tif (blob !== undefined) {\n\t\t\treturn createR11sResponseFromContent(blob);\n\t\t}\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<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\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(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\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;;;AAWH,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,GAAgC;YACzC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,MAAmC;QAEnC,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;AApDD,gCAoDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, IHistorian } from \"./storageContracts\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\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<resources.ICommitDetails[]>> {\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<resources.ITree>> {\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\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<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\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(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\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"]}
@@ -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.0.0-internal.7.1.0";
8
+ export declare const pkgVersion = "2.0.0-internal.7.2.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/routerlicious-driver";
11
- exports.pkgVersion = "2.0.0-internal.7.1.0";
11
+ exports.pkgVersion = "2.0.0-internal.7.2.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,sBAAsB,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.0.0-internal.7.1.0\";\n"]}
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,sBAAsB,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.0.0-internal.7.2.0\";\n"]}
@@ -9,15 +9,11 @@ import { IR11sResponse } from "./restWrapper";
9
9
  import { IWholeFlatSnapshot } from "./contracts";
10
10
  export declare class GitManager implements IGitManager {
11
11
  private readonly historian;
12
- private readonly blobCache;
13
- private readonly commitCache;
14
- private readonly treeCache;
15
- private readonly refCache;
16
12
  constructor(historian: IHistorian);
17
13
  /**
18
14
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
19
15
  */
20
- getCommits(shaOrRef: string, count: number): Promise<IR11sResponse<resources.ICommitDetails[]>>;
16
+ getCommits(sha: string, count: number): Promise<IR11sResponse<resources.ICommitDetails[]>>;
21
17
  /**
22
18
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
23
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"gitManager.d.ts","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EACN,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAiC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,qBAAa,UAAW,YAAW,WAAW;IAMjC,OAAO,CAAC,QAAQ,CAAC,SAAS;IALtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAChE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwC;IACpE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;gBAEzB,SAAS,EAAE,UAAU;IAElD;;OAEG;IACU,UAAU,CACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC;IAuCrD;;OAEG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,OAAO,CAAC,aA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AAE,MAAM,EAAE,SAAS,UAAO,GAAG,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAIhF,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAI7D,UAAU,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAC1B,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAQ3C,aAAa,CACzB,MAAM,EAAE,SAAS,CAAC,iBAAiB,GACjC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAK7B,aAAa,CACzB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,GAAE,OAAe,GACtB,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAInC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAGjF"}
package/lib/gitManager.js CHANGED
@@ -2,66 +2,23 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { createR11sResponseFromContent } from "./restWrapper";
6
5
  export class GitManager {
7
6
  constructor(historian) {
8
7
  this.historian = historian;
9
- this.blobCache = new Map();
10
- this.commitCache = new Map();
11
- this.treeCache = new Map();
12
- this.refCache = new Map();
13
8
  }
14
9
  /**
15
10
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
16
11
  */
17
- async getCommits(shaOrRef, count) {
18
- let sha = shaOrRef;
19
- // See if the sha is really a ref and convert
20
- if (this.refCache.has(shaOrRef)) {
21
- sha = this.refCache.get(shaOrRef);
22
- // Delete refcache after first use
23
- this.refCache.delete(shaOrRef);
24
- // If null is stored for the ref then there are no commits - return an empty array
25
- if (!sha) {
26
- return createR11sResponseFromContent([]);
27
- }
28
- }
29
- // See if the commit sha is hashed and return it if so
30
- const commit = this.commitCache.get(sha);
31
- if (commit !== undefined) {
32
- return createR11sResponseFromContent([
33
- {
34
- commit: {
35
- author: commit.author,
36
- committer: commit.committer,
37
- message: commit.message,
38
- tree: commit.tree,
39
- url: commit.url,
40
- },
41
- parents: commit.parents,
42
- sha: commit.sha,
43
- url: commit.url,
44
- },
45
- ]);
46
- }
47
- // Otherwise fall back to the historian
12
+ async getCommits(sha, count) {
48
13
  return this.historian.getCommits(sha, count);
49
14
  }
50
15
  /**
51
16
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
52
17
  */
53
18
  async getTree(root, recursive = true) {
54
- const tree = this.treeCache.get(root);
55
- if (tree !== undefined) {
56
- return createR11sResponseFromContent(tree);
57
- }
58
19
  return this.historian.getTree(root, recursive);
59
20
  }
60
21
  async getBlob(sha) {
61
- const blob = this.blobCache.get(sha);
62
- if (blob !== undefined) {
63
- return createR11sResponseFromContent(blob);
64
- }
65
22
  return this.historian.getBlob(sha);
66
23
  }
67
24
  async createBlob(content, encoding) {
@@ -1 +1 @@
1
- {"version":3,"file":"gitManager.js","sourceRoot":"","sources":["../src/gitManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAiB,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAG7E,MAAM,OAAO,UAAU;IAMtB,YAA6B,SAAqB;QAArB,cAAS,GAAT,SAAS,CAAY;QALjC,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC/C,gBAAW,GAAG,IAAI,GAAG,EAA6B,CAAC;QACnD,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC/C,aAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAED,CAAC;IAEtD;;OAEG;IACI,KAAK,CAAC,UAAU,CACtB,QAAgB,EAChB,KAAa;QAEb,IAAI,GAAG,GAAuB,QAAQ,CAAC;QAEvC,6CAA6C;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ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AC,GAAW;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,SAAS,EAAE;YACvB,OAAO,6BAA6B,CAAC,IAAI,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,UAAU,CACtB,OAAe,EACf,QAA4B;QAE5B,MAAM,IAAI,GAAgC;YACzC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,MAAmC;QAEnC,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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, IHistorian } from \"./storageContracts\";\nimport { IR11sResponse, createR11sResponseFromContent } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\nexport class GitManager implements IGitManager {\n\tprivate readonly blobCache = new Map<string, resources.IBlob>();\n\tprivate readonly commitCache = new Map<string, resources.ICommit>();\n\tprivate readonly treeCache = new Map<string, resources.ITree>();\n\tprivate readonly refCache = new Map<string, string>();\n\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\tshaOrRef: string,\n\t\tcount: number,\n\t): Promise<IR11sResponse<resources.ICommitDetails[]>> {\n\t\tlet sha: string | undefined = shaOrRef;\n\n\t\t// See if the sha is really a ref and convert\n\t\tif (this.refCache.has(shaOrRef)) {\n\t\t\tsha = this.refCache.get(shaOrRef);\n\n\t\t\t// Delete refcache after first use\n\t\t\tthis.refCache.delete(shaOrRef);\n\n\t\t\t// If null is stored for the ref then there are no commits - return an empty array\n\t\t\tif (!sha) {\n\t\t\t\treturn createR11sResponseFromContent([]);\n\t\t\t}\n\t\t}\n\n\t\t// See if the commit sha is hashed and return it if so\n\t\tconst commit = this.commitCache.get(sha);\n\t\tif (commit !== undefined) {\n\t\t\treturn createR11sResponseFromContent([\n\t\t\t\t{\n\t\t\t\t\tcommit: {\n\t\t\t\t\t\tauthor: commit.author,\n\t\t\t\t\t\tcommitter: commit.committer,\n\t\t\t\t\t\tmessage: commit.message,\n\t\t\t\t\t\ttree: commit.tree,\n\t\t\t\t\t\turl: commit.url,\n\t\t\t\t\t},\n\t\t\t\t\tparents: commit.parents,\n\t\t\t\t\tsha: commit.sha,\n\t\t\t\t\turl: commit.url,\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\t// Otherwise fall back to the historian\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<resources.ITree>> {\n\t\tconst tree = this.treeCache.get(root);\n\t\tif (tree !== undefined) {\n\t\t\treturn createR11sResponseFromContent(tree);\n\t\t}\n\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\n\t\tconst blob = this.blobCache.get(sha);\n\t\tif (blob !== undefined) {\n\t\t\treturn createR11sResponseFromContent(blob);\n\t\t}\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<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\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(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\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;AAWH,MAAM,OAAO,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,GAAgC;YACzC,OAAO;YACP,QAAQ;SACR,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,MAAmC;QAEnC,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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as resources from \"@fluidframework/gitresources\";\nimport {\n\tIWholeSummaryPayload,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, IHistorian } from \"./storageContracts\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\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<resources.ICommitDetails[]>> {\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<resources.ITree>> {\n\t\treturn this.historian.getTree(root, recursive);\n\t}\n\n\tpublic async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {\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<resources.ICreateBlobResponse>> {\n\t\tconst blob: resources.ICreateBlobParams = {\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(\n\t\tparams: resources.ICreateTreeParams,\n\t): Promise<IR11sResponse<resources.ITree>> {\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"]}
@@ -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.0.0-internal.7.1.0";
8
+ export declare const pkgVersion = "2.0.0-internal.7.2.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/routerlicious-driver";
8
- export const pkgVersion = "2.0.0-internal.7.1.0";
8
+ export const pkgVersion = "2.0.0-internal.7.2.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,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.0.0-internal.7.1.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,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.0.0-internal.7.2.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/routerlicious-driver",
3
- "version": "2.0.0-internal.7.1.0",
3
+ "version": "2.0.0-internal.7.2.0",
4
4
  "description": "Socket.IO + Git implementation of Fluid service API",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,17 +35,17 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
39
- "@fluidframework/core-interfaces": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
40
- "@fluidframework/core-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
41
- "@fluidframework/driver-base": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
42
- "@fluidframework/driver-definitions": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
43
- "@fluidframework/driver-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
38
+ "@fluid-internal/client-utils": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
39
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
40
+ "@fluidframework/core-utils": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
41
+ "@fluidframework/driver-base": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
42
+ "@fluidframework/driver-definitions": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
43
+ "@fluidframework/driver-utils": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
44
44
  "@fluidframework/gitresources": "^2.0.1",
45
45
  "@fluidframework/protocol-base": "^2.0.1",
46
46
  "@fluidframework/protocol-definitions": "^3.0.0",
47
47
  "@fluidframework/server-services-client": "^2.0.1",
48
- "@fluidframework/telemetry-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
48
+ "@fluidframework/telemetry-utils": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
49
49
  "cross-fetch": "^3.1.5",
50
50
  "json-stringify-safe": "5.0.1",
51
51
  "socket.io-client": "^4.6.1",
@@ -53,12 +53,12 @@
53
53
  "uuid": "^9.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@fluid-tools/build-cli": "^0.25.0",
57
- "@fluidframework/build-common": "^2.0.1",
58
- "@fluidframework/build-tools": "^0.25.0",
56
+ "@fluid-tools/build-cli": "^0.26.1",
57
+ "@fluidframework/build-common": "^2.0.3",
58
+ "@fluidframework/build-tools": "^0.26.1",
59
59
  "@fluidframework/eslint-config-fluid": "^3.0.0",
60
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
61
- "@fluidframework/routerlicious-driver-previous": "npm:@fluidframework/routerlicious-driver@2.0.0-internal.7.0.0",
60
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.2.0 <2.0.0-internal.7.3.0",
61
+ "@fluidframework/routerlicious-driver-previous": "npm:@fluidframework/routerlicious-driver@2.0.0-internal.7.1.0",
62
62
  "@microsoft/api-extractor": "^7.37.0",
63
63
  "@types/mocha": "^9.1.1",
64
64
  "@types/nock": "^9.3.0",
@@ -68,7 +68,6 @@
68
68
  "@types/uuid": "^9.0.2",
69
69
  "axios": "^0.26.0",
70
70
  "c8": "^7.7.1",
71
- "copyfiles": "^2.4.1",
72
71
  "cross-env": "^7.0.3",
73
72
  "eslint": "~8.50.0",
74
73
  "mocha": "^10.2.0",
@@ -93,7 +92,7 @@
93
92
  "build:genver": "gen-version",
94
93
  "build:test": "tsc --project ./src/test/tsconfig.json",
95
94
  "ci:build:docs": "api-extractor run",
96
- "clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp' 'nyc'",
95
+ "clean": "rimraf --glob dist lib \"*.tsbuildinfo\" \"*.build.log\" _api-extractor-temp nyc",
97
96
  "eslint": "eslint --format stylish src",
98
97
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
99
98
  "format": "npm run prettier:fix",
package/src/gitManager.ts CHANGED
@@ -9,59 +9,19 @@ import {
9
9
  IWriteSummaryResponse,
10
10
  } from "@fluidframework/server-services-client";
11
11
  import { IGitManager, IHistorian } from "./storageContracts";
12
- import { IR11sResponse, createR11sResponseFromContent } from "./restWrapper";
12
+ import { IR11sResponse } from "./restWrapper";
13
13
  import { IWholeFlatSnapshot } from "./contracts";
14
14
 
15
15
  export class GitManager implements IGitManager {
16
- private readonly blobCache = new Map<string, resources.IBlob>();
17
- private readonly commitCache = new Map<string, resources.ICommit>();
18
- private readonly treeCache = new Map<string, resources.ITree>();
19
- private readonly refCache = new Map<string, string>();
20
-
21
16
  constructor(private readonly historian: IHistorian) {}
22
17
 
23
18
  /**
24
19
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
25
20
  */
26
21
  public async getCommits(
27
- shaOrRef: string,
22
+ sha: string,
28
23
  count: number,
29
24
  ): Promise<IR11sResponse<resources.ICommitDetails[]>> {
30
- let sha: string | undefined = shaOrRef;
31
-
32
- // See if the sha is really a ref and convert
33
- if (this.refCache.has(shaOrRef)) {
34
- sha = this.refCache.get(shaOrRef);
35
-
36
- // Delete refcache after first use
37
- this.refCache.delete(shaOrRef);
38
-
39
- // If null is stored for the ref then there are no commits - return an empty array
40
- if (!sha) {
41
- return createR11sResponseFromContent([]);
42
- }
43
- }
44
-
45
- // See if the commit sha is hashed and return it if so
46
- const commit = this.commitCache.get(sha);
47
- if (commit !== undefined) {
48
- return createR11sResponseFromContent([
49
- {
50
- commit: {
51
- author: commit.author,
52
- committer: commit.committer,
53
- message: commit.message,
54
- tree: commit.tree,
55
- url: commit.url,
56
- },
57
- parents: commit.parents,
58
- sha: commit.sha,
59
- url: commit.url,
60
- },
61
- ]);
62
- }
63
-
64
- // Otherwise fall back to the historian
65
25
  return this.historian.getCommits(sha, count);
66
26
  }
67
27
 
@@ -69,19 +29,10 @@ export class GitManager implements IGitManager {
69
29
  * Reads the object with the given ID. We defer to the client implementation to do the actual read.
70
30
  */
71
31
  public async getTree(root: string, recursive = true): Promise<IR11sResponse<resources.ITree>> {
72
- const tree = this.treeCache.get(root);
73
- if (tree !== undefined) {
74
- return createR11sResponseFromContent(tree);
75
- }
76
-
77
32
  return this.historian.getTree(root, recursive);
78
33
  }
79
34
 
80
35
  public async getBlob(sha: string): Promise<IR11sResponse<resources.IBlob>> {
81
- const blob = this.blobCache.get(sha);
82
- if (blob !== undefined) {
83
- return createR11sResponseFromContent(blob);
84
- }
85
36
  return this.historian.getBlob(sha);
86
37
  }
87
38
 
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/routerlicious-driver";
9
- export const pkgVersion = "2.0.0-internal.7.1.0";
9
+ export const pkgVersion = "2.0.0-internal.7.2.0";