@fluidframework/driver-utils 2.0.0-rc.4.0.6 → 2.0.0-rc.5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  3. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  4. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  5. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  6. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  7. package/api-extractor.json +1 -1
  8. package/api-report/driver-utils.alpha.api.md +78 -0
  9. package/api-report/driver-utils.beta.api.md +65 -0
  10. package/api-report/driver-utils.public.api.md +65 -0
  11. package/biome.jsonc +4 -0
  12. package/dist/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
  13. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
  14. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
  15. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
  16. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +3 -3
  17. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
  18. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +8 -8
  19. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  20. package/dist/adapters/predefinedAdapters.js.map +1 -1
  21. package/dist/blob.d.ts +1 -1
  22. package/dist/blob.d.ts.map +1 -1
  23. package/dist/blob.js +7 -7
  24. package/dist/blob.js.map +1 -1
  25. package/dist/buildSnapshotTree.d.ts +1 -1
  26. package/dist/buildSnapshotTree.d.ts.map +1 -1
  27. package/dist/buildSnapshotTree.js +8 -8
  28. package/dist/buildSnapshotTree.js.map +1 -1
  29. package/dist/documentServiceFactoryProxy.d.ts +1 -1
  30. package/dist/documentServiceFactoryProxy.d.ts.map +1 -1
  31. package/dist/documentServiceFactoryProxy.js.map +1 -1
  32. package/dist/documentServiceProxy.d.ts +1 -1
  33. package/dist/documentServiceProxy.d.ts.map +1 -1
  34. package/dist/documentServiceProxy.js.map +1 -1
  35. package/dist/documentStorageServiceProxy.d.ts +2 -2
  36. package/dist/documentStorageServiceProxy.d.ts.map +1 -1
  37. package/dist/documentStorageServiceProxy.js.map +1 -1
  38. package/dist/error.d.ts.map +1 -1
  39. package/dist/error.js.map +1 -1
  40. package/dist/index.d.ts +2 -1
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +5 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/insecureUrlResolver.d.ts.map +1 -1
  45. package/dist/insecureUrlResolver.js.map +1 -1
  46. package/dist/messageRecognition.d.ts +1 -1
  47. package/dist/messageRecognition.d.ts.map +1 -1
  48. package/dist/messageRecognition.js +3 -3
  49. package/dist/messageRecognition.js.map +1 -1
  50. package/dist/network.d.ts.map +1 -1
  51. package/dist/network.js.map +1 -1
  52. package/dist/networkUtils.js.map +1 -1
  53. package/dist/packageVersion.d.ts +1 -1
  54. package/dist/packageVersion.js +1 -1
  55. package/dist/packageVersion.js.map +1 -1
  56. package/dist/parallelRequests.d.ts +1 -2
  57. package/dist/parallelRequests.d.ts.map +1 -1
  58. package/dist/parallelRequests.js.map +1 -1
  59. package/dist/prefetchDocumentStorageService.d.ts +1 -2
  60. package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
  61. package/dist/prefetchDocumentStorageService.js.map +1 -1
  62. package/dist/protocol/gitHelper.d.ts +33 -0
  63. package/dist/protocol/gitHelper.d.ts.map +1 -0
  64. package/dist/protocol/gitHelper.js +88 -0
  65. package/dist/protocol/gitHelper.js.map +1 -0
  66. package/dist/protocol/index.d.ts +6 -0
  67. package/dist/protocol/index.d.ts.map +1 -0
  68. package/dist/protocol/index.js +12 -0
  69. package/dist/protocol/index.js.map +1 -0
  70. package/dist/rateLimiter.js.map +1 -1
  71. package/dist/runWithRetry.js.map +1 -1
  72. package/dist/storageUtils.d.ts +1 -2
  73. package/dist/storageUtils.d.ts.map +1 -1
  74. package/dist/storageUtils.js.map +1 -1
  75. package/dist/summaryForCreateNew.d.ts +2 -1
  76. package/dist/summaryForCreateNew.d.ts.map +1 -1
  77. package/dist/summaryForCreateNew.js +3 -3
  78. package/dist/summaryForCreateNew.js.map +1 -1
  79. package/dist/treeConversions.d.ts +2 -1
  80. package/dist/treeConversions.d.ts.map +1 -1
  81. package/dist/treeConversions.js +5 -5
  82. package/dist/treeConversions.js.map +1 -1
  83. package/lib/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
  84. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
  85. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
  86. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
  87. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +3 -3
  88. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
  89. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +2 -2
  90. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  91. package/lib/adapters/predefinedAdapters.js.map +1 -1
  92. package/lib/blob.d.ts +1 -1
  93. package/lib/blob.d.ts.map +1 -1
  94. package/lib/blob.js +1 -1
  95. package/lib/blob.js.map +1 -1
  96. package/lib/buildSnapshotTree.d.ts +1 -1
  97. package/lib/buildSnapshotTree.d.ts.map +1 -1
  98. package/lib/buildSnapshotTree.js +2 -2
  99. package/lib/buildSnapshotTree.js.map +1 -1
  100. package/lib/documentServiceFactoryProxy.d.ts +1 -1
  101. package/lib/documentServiceFactoryProxy.d.ts.map +1 -1
  102. package/lib/documentServiceFactoryProxy.js.map +1 -1
  103. package/lib/documentServiceProxy.d.ts +1 -1
  104. package/lib/documentServiceProxy.d.ts.map +1 -1
  105. package/lib/documentServiceProxy.js.map +1 -1
  106. package/lib/documentStorageServiceProxy.d.ts +2 -2
  107. package/lib/documentStorageServiceProxy.d.ts.map +1 -1
  108. package/lib/documentStorageServiceProxy.js.map +1 -1
  109. package/lib/error.d.ts.map +1 -1
  110. package/lib/error.js +1 -1
  111. package/lib/error.js.map +1 -1
  112. package/lib/index.d.ts +2 -1
  113. package/lib/index.d.ts.map +1 -1
  114. package/lib/index.js +2 -1
  115. package/lib/index.js.map +1 -1
  116. package/lib/insecureUrlResolver.d.ts.map +1 -1
  117. package/lib/insecureUrlResolver.js.map +1 -1
  118. package/lib/messageRecognition.d.ts +1 -1
  119. package/lib/messageRecognition.d.ts.map +1 -1
  120. package/lib/messageRecognition.js +1 -1
  121. package/lib/messageRecognition.js.map +1 -1
  122. package/lib/network.d.ts.map +1 -1
  123. package/lib/network.js.map +1 -1
  124. package/lib/networkUtils.js.map +1 -1
  125. package/lib/packageVersion.d.ts +1 -1
  126. package/lib/packageVersion.js +1 -1
  127. package/lib/packageVersion.js.map +1 -1
  128. package/lib/parallelRequests.d.ts +1 -2
  129. package/lib/parallelRequests.d.ts.map +1 -1
  130. package/lib/parallelRequests.js +2 -2
  131. package/lib/parallelRequests.js.map +1 -1
  132. package/lib/prefetchDocumentStorageService.d.ts +1 -2
  133. package/lib/prefetchDocumentStorageService.d.ts.map +1 -1
  134. package/lib/prefetchDocumentStorageService.js +1 -1
  135. package/lib/prefetchDocumentStorageService.js.map +1 -1
  136. package/lib/protocol/gitHelper.d.ts +33 -0
  137. package/lib/protocol/gitHelper.d.ts.map +1 -0
  138. package/lib/protocol/gitHelper.js +82 -0
  139. package/lib/protocol/gitHelper.js.map +1 -0
  140. package/lib/protocol/index.d.ts +6 -0
  141. package/lib/protocol/index.d.ts.map +1 -0
  142. package/lib/protocol/index.js +6 -0
  143. package/lib/protocol/index.js.map +1 -0
  144. package/lib/rateLimiter.js.map +1 -1
  145. package/lib/runWithRetry.js.map +1 -1
  146. package/lib/storageUtils.d.ts +1 -2
  147. package/lib/storageUtils.d.ts.map +1 -1
  148. package/lib/storageUtils.js.map +1 -1
  149. package/lib/summaryForCreateNew.d.ts +2 -1
  150. package/lib/summaryForCreateNew.d.ts.map +1 -1
  151. package/lib/summaryForCreateNew.js +1 -1
  152. package/lib/summaryForCreateNew.js.map +1 -1
  153. package/lib/treeConversions.d.ts +2 -1
  154. package/lib/treeConversions.d.ts.map +1 -1
  155. package/lib/treeConversions.js +1 -1
  156. package/lib/treeConversions.js.map +1 -1
  157. package/lib/tsdoc-metadata.json +1 -1
  158. package/package.json +25 -19
  159. package/src/adapters/compression/documentServiceFactoryCompressionAdapter.ts +5 -6
  160. package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +17 -13
  161. package/src/blob.ts +1 -1
  162. package/src/buildSnapshotTree.ts +10 -8
  163. package/src/documentServiceFactoryProxy.ts +1 -1
  164. package/src/documentServiceProxy.ts +1 -1
  165. package/src/documentStorageServiceProxy.ts +8 -6
  166. package/src/error.ts +4 -1
  167. package/src/index.ts +6 -1
  168. package/src/insecureUrlResolver.ts +4 -1
  169. package/src/messageRecognition.ts +2 -2
  170. package/src/network.ts +12 -3
  171. package/src/packageVersion.ts +1 -1
  172. package/src/parallelRequests.ts +12 -13
  173. package/src/prefetchDocumentStorageService.ts +5 -2
  174. package/src/protocol/README.md +11 -0
  175. package/src/protocol/gitHelper.ts +98 -0
  176. package/src/protocol/index.ts +6 -0
  177. package/src/storageUtils.ts +1 -2
  178. package/src/summaryForCreateNew.ts +2 -4
  179. package/src/treeConversions.ts +3 -2
  180. package/tsconfig.json +2 -0
  181. package/tsdoc.json +4 -0
  182. package/api-report/driver-utils.api.md +0 -408
package/dist/blob.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = void 0;
8
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
8
+ const internal_1 = require("@fluidframework/driver-definitions/internal");
9
9
  /**
10
10
  * Basic implementation of a blob ITreeEntry
11
11
  * @internal
@@ -19,8 +19,8 @@ class BlobTreeEntry {
19
19
  */
20
20
  constructor(path, contents, encoding = "utf-8") {
21
21
  this.path = path;
22
- this.mode = protocol_definitions_1.FileMode.File;
23
- this.type = protocol_definitions_1.TreeEntry.Blob;
22
+ this.mode = internal_1.FileMode.File;
23
+ this.type = internal_1.TreeEntry.Blob;
24
24
  this.value = { contents, encoding };
25
25
  }
26
26
  }
@@ -38,8 +38,8 @@ class TreeTreeEntry {
38
38
  constructor(path, value) {
39
39
  this.path = path;
40
40
  this.value = value;
41
- this.mode = protocol_definitions_1.FileMode.Directory;
42
- this.type = protocol_definitions_1.TreeEntry.Tree;
41
+ this.mode = internal_1.FileMode.Directory;
42
+ this.type = internal_1.TreeEntry.Tree;
43
43
  }
44
44
  }
45
45
  exports.TreeTreeEntry = TreeTreeEntry;
@@ -56,8 +56,8 @@ class AttachmentTreeEntry {
56
56
  constructor(path, id) {
57
57
  this.path = path;
58
58
  this.id = id;
59
- this.mode = protocol_definitions_1.FileMode.File;
60
- this.type = protocol_definitions_1.TreeEntry.Attachment;
59
+ this.mode = internal_1.FileMode.File;
60
+ this.type = internal_1.TreeEntry.Attachment;
61
61
  this.value = { id };
62
62
  }
63
63
  }
package/dist/blob.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"blob.js","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+EAM8C;AAE9C;;;GAGG;AACH,MAAa,aAAa;IAKzB;;;;;OAKG;IACH,YACiB,IAAY,EAC5B,QAAgB,EAChB,WAA+B,OAAO;QAFtB,SAAI,GAAJ,IAAI,CAAQ;QAXb,SAAI,GAAG,+BAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,gCAAS,CAAC,IAAI,CAAC;QAcrC,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;CACD;AAlBD,sCAkBC;AAED;;;GAGG;AACH,MAAa,aAAa;IAIzB;;;;OAIG;IACH,YACiB,IAAY,EACZ,KAAY;QADZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAO;QAVb,SAAI,GAAG,+BAAQ,CAAC,SAAS,CAAC;QAC1B,SAAI,GAAG,gCAAS,CAAC,IAAI,CAAC;IAUnC,CAAC;CACJ;AAbD,sCAaC;AAED;;;GAGG;AACH,MAAa,mBAAmB;IAK/B;;;;OAIG;IACH,YACiB,IAAY,EACZ,EAAU;QADV,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QAXX,SAAI,GAAG,+BAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,gCAAS,CAAC,UAAU,CAAC;QAY3C,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;IACrB,CAAC;CACD;AAhBD,kDAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFileMode,\n\tIAttachment,\n\tIBlob,\n\tITree,\n\tTreeEntry,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Basic implementation of a blob ITreeEntry\n * @internal\n */\nexport class BlobTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Blob;\n\tpublic readonly value: IBlob;\n\n\t/**\n\t * Creates a blob ITreeEntry\n\t * @param path - path of entry\n\t * @param contents - blob contents\n\t * @param encoding - encoding of contents; defaults to utf-8\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tcontents: string,\n\t\tencoding: \"utf-8\" | \"base64\" = \"utf-8\",\n\t) {\n\t\tthis.value = { contents, encoding };\n\t}\n}\n\n/**\n * Basic implementation of a tree ITreeEntry\n * @internal\n */\nexport class TreeTreeEntry {\n\tpublic readonly mode = FileMode.Directory;\n\tpublic readonly type = TreeEntry.Tree;\n\n\t/**\n\t * Creates a tree ITreeEntry\n\t * @param path - path of entry\n\t * @param value - subtree\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly value: ITree,\n\t) {}\n}\n\n/**\n * Basic implementation of an attachment ITreeEntry\n * @internal\n */\nexport class AttachmentTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Attachment;\n\tpublic readonly value: IAttachment;\n\n\t/**\n\t * Creates an attachment ITreeEntry\n\t * @param path - path of entry\n\t * @param id - id of external blob attachment\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly id: string,\n\t) {\n\t\tthis.value = { id };\n\t}\n}\n"]}
1
+ {"version":3,"file":"blob.js","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAMqD;AAErD;;;GAGG;AACH,MAAa,aAAa;IAKzB;;;;;OAKG;IACH,YACiB,IAAY,EAC5B,QAAgB,EAChB,WAA+B,OAAO;QAFtB,SAAI,GAAJ,IAAI,CAAQ;QAXb,SAAI,GAAG,mBAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,oBAAS,CAAC,IAAI,CAAC;QAcrC,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;CACD;AAlBD,sCAkBC;AAED;;;GAGG;AACH,MAAa,aAAa;IAIzB;;;;OAIG;IACH,YACiB,IAAY,EACZ,KAAY;QADZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAO;QAVb,SAAI,GAAG,mBAAQ,CAAC,SAAS,CAAC;QAC1B,SAAI,GAAG,oBAAS,CAAC,IAAI,CAAC;IAUnC,CAAC;CACJ;AAbD,sCAaC;AAED;;;GAGG;AACH,MAAa,mBAAmB;IAK/B;;;;OAIG;IACH,YACiB,IAAY,EACZ,EAAU;QADV,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QAXX,SAAI,GAAG,mBAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,oBAAS,CAAC,UAAU,CAAC;QAY3C,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;IACrB,CAAC;CACD;AAhBD,kDAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFileMode,\n\tIAttachment,\n\tIBlob,\n\tITree,\n\tTreeEntry,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Basic implementation of a blob ITreeEntry\n * @internal\n */\nexport class BlobTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Blob;\n\tpublic readonly value: IBlob;\n\n\t/**\n\t * Creates a blob ITreeEntry\n\t * @param path - path of entry\n\t * @param contents - blob contents\n\t * @param encoding - encoding of contents; defaults to utf-8\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tcontents: string,\n\t\tencoding: \"utf-8\" | \"base64\" = \"utf-8\",\n\t) {\n\t\tthis.value = { contents, encoding };\n\t}\n}\n\n/**\n * Basic implementation of a tree ITreeEntry\n * @internal\n */\nexport class TreeTreeEntry {\n\tpublic readonly mode = FileMode.Directory;\n\tpublic readonly type = TreeEntry.Tree;\n\n\t/**\n\t * Creates a tree ITreeEntry\n\t * @param path - path of entry\n\t * @param value - subtree\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly value: ITree,\n\t) {}\n}\n\n/**\n * Basic implementation of an attachment ITreeEntry\n * @internal\n */\nexport class AttachmentTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Attachment;\n\tpublic readonly value: IAttachment;\n\n\t/**\n\t * Creates an attachment ITreeEntry\n\t * @param path - path of entry\n\t * @param id - id of external blob attachment\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tpublic readonly id: string,\n\t) {\n\t\tthis.value = { id };\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ISnapshotTree, ITreeEntry } from "@fluidframework/protocol-definitions";
5
+ import { ISnapshotTree, ITreeEntry } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * Build a tree hierarchy base on an array of ITreeEntry
8
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"buildSnapshotTree.d.ts","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAEN,aAAa,EACb,UAAU,EAEV,MAAM,sCAAsC,CAAC;AAmE9C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GACnC,aAAa,CAGf"}
1
+ {"version":3,"file":"buildSnapshotTree.d.ts","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,aAAa,EACb,UAAU,EAEV,MAAM,6CAA6C,CAAC;AAqErD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GACnC,aAAa,CAGf"}
@@ -7,20 +7,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.buildSnapshotTree = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const internal_1 = require("@fluidframework/core-utils/internal");
10
- const protocol_base_1 = require("@fluidframework/protocol-base");
11
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
10
+ const internal_2 = require("@fluidframework/driver-definitions/internal");
12
11
  const uuid_1 = require("uuid");
12
+ const index_js_1 = require("./protocol/index.js");
13
13
  function flattenCore(path, treeEntries, blobMap) {
14
14
  const entries = [];
15
15
  for (const treeEntry of treeEntries) {
16
16
  const subPath = `${path}${treeEntry.path}`;
17
- if (treeEntry.type === protocol_definitions_1.TreeEntry.Blob) {
17
+ if (treeEntry.type === internal_2.TreeEntry.Blob) {
18
18
  const blob = treeEntry.value;
19
19
  const buffer = (0, client_utils_1.stringToBuffer)(blob.contents, blob.encoding);
20
20
  const id = (0, uuid_1.v4)();
21
21
  blobMap.set(id, buffer);
22
22
  const entry = {
23
- mode: protocol_definitions_1.FileMode[treeEntry.mode],
23
+ mode: internal_2.FileMode[treeEntry.mode],
24
24
  path: subPath,
25
25
  sha: id,
26
26
  size: 0,
@@ -29,11 +29,11 @@ function flattenCore(path, treeEntries, blobMap) {
29
29
  };
30
30
  entries.push(entry);
31
31
  }
32
- else if (treeEntry.type === protocol_definitions_1.TreeEntry.Tree) {
33
- (0, internal_1.assert)(treeEntry.type === protocol_definitions_1.TreeEntry.Tree, 0x101 /* "Unexpected tree entry type on flatten!" */);
32
+ else if (treeEntry.type === internal_2.TreeEntry.Tree) {
33
+ (0, internal_1.assert)(treeEntry.type === internal_2.TreeEntry.Tree, 0x101 /* "Unexpected tree entry type on flatten!" */);
34
34
  const t = treeEntry.value;
35
35
  const entry = {
36
- mode: protocol_definitions_1.FileMode[treeEntry.mode],
36
+ mode: internal_2.FileMode[treeEntry.mode],
37
37
  path: subPath,
38
38
  sha: "",
39
39
  size: -1,
@@ -73,7 +73,7 @@ function flatten(tree, blobMap) {
73
73
  */
74
74
  function buildSnapshotTree(entries, blobMap) {
75
75
  const flattened = flatten(entries, blobMap);
76
- return (0, protocol_base_1.buildGitTreeHierarchy)(flattened);
76
+ return (0, index_js_1.buildGitTreeHierarchy)(flattened);
77
77
  }
78
78
  exports.buildSnapshotTree = buildSnapshotTree;
79
79
  //# sourceMappingURL=buildSnapshotTree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildSnapshotTree.js","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAE7D,iEAAsE;AACtE,+EAK8C;AAC9C,+BAAkC;AAElC,SAAS,WAAW,CACnB,IAAY,EACZ,WAAyB,EACzB,OAAqC;IAErC,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE;QACpC,MAAM,OAAO,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QAE3C,IAAI,SAAS,CAAC,IAAI,KAAK,gCAAS,CAAC,IAAI,EAAE;YACtC,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAA,6BAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5D,MAAM,EAAE,GAAG,IAAA,SAAI,GAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAExB,MAAM,KAAK,GAAmB;gBAC7B,IAAI,EAAE,+BAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC9B,IAAI,EAAE,OAAO;gBACb,GAAG,EAAE,EAAE;gBACP,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,EAAE;aACP,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpB;aAAM,IAAI,SAAS,CAAC,IAAI,KAAK,gCAAS,CAAC,IAAI,EAAE;YAC7C,IAAA,iBAAM,EACL,SAAS,CAAC,IAAI,KAAK,gCAAS,CAAC,IAAI,EACjC,KAAK,CAAC,8CAA8C,CACpD,CAAC;YACF,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;YAC1B,MAAM,KAAK,GAAmB;gBAC7B,IAAI,EAAE,+BAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC9B,IAAI,EAAE,OAAO;gBACb,GAAG,EAAE,EAAE;gBACP,IAAI,EAAE,CAAC,CAAC;gBACR,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,EAAE;aACP,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAEpB,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;SAChC;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,IAAkB,EAAE,OAAqC;IACzE,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,OAAO;QACN,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,EAAE;KACP,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAChC,OAAqB,EACrB,OAAqC;IAErC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAA,qCAAqB,EAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAND,8CAMC","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 { assert } from \"@fluidframework/core-utils/internal\";\nimport * as git from \"@fluidframework/gitresources\";\nimport { buildGitTreeHierarchy } from \"@fluidframework/protocol-base\";\nimport {\n\tFileMode,\n\tISnapshotTree,\n\tITreeEntry,\n\tTreeEntry,\n} from \"@fluidframework/protocol-definitions\";\nimport { v4 as uuid } from \"uuid\";\n\nfunction flattenCore(\n\tpath: string,\n\ttreeEntries: ITreeEntry[],\n\tblobMap: Map<string, ArrayBufferLike>,\n): git.ITreeEntry[] {\n\tconst entries: git.ITreeEntry[] = [];\n\tfor (const treeEntry of treeEntries) {\n\t\tconst subPath = `${path}${treeEntry.path}`;\n\n\t\tif (treeEntry.type === TreeEntry.Blob) {\n\t\t\tconst blob = treeEntry.value;\n\t\t\tconst buffer = stringToBuffer(blob.contents, blob.encoding);\n\t\t\tconst id = uuid();\n\t\t\tblobMap.set(id, buffer);\n\n\t\t\tconst entry: git.ITreeEntry = {\n\t\t\t\tmode: FileMode[treeEntry.mode],\n\t\t\t\tpath: subPath,\n\t\t\t\tsha: id,\n\t\t\t\tsize: 0,\n\t\t\t\ttype: \"blob\",\n\t\t\t\turl: \"\",\n\t\t\t};\n\t\t\tentries.push(entry);\n\t\t} else if (treeEntry.type === TreeEntry.Tree) {\n\t\t\tassert(\n\t\t\t\ttreeEntry.type === TreeEntry.Tree,\n\t\t\t\t0x101 /* \"Unexpected tree entry type on flatten!\" */,\n\t\t\t);\n\t\t\tconst t = treeEntry.value;\n\t\t\tconst entry: git.ITreeEntry = {\n\t\t\t\tmode: FileMode[treeEntry.mode],\n\t\t\t\tpath: subPath,\n\t\t\t\tsha: \"\",\n\t\t\t\tsize: -1,\n\t\t\t\ttype: \"tree\",\n\t\t\t\turl: \"\",\n\t\t\t};\n\t\t\tentries.push(entry);\n\n\t\t\tconst subTreeEntries = flattenCore(`${subPath}/`, t.entries, blobMap);\n\t\t\tentries.push(...subTreeEntries);\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Create a flatten view of an array of ITreeEntry\n *\n * @param tree - an array of ITreeEntry to flatten\n * @param blobMap - a map of blob's sha1 to content\n * @returns A flatten with of the ITreeEntry\n */\nfunction flatten(tree: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): git.ITree {\n\tconst entries = flattenCore(\"\", tree, blobMap);\n\treturn {\n\t\tsha: \"\",\n\t\ttree: entries,\n\t\turl: \"\",\n\t};\n}\n\n/**\n * Build a tree hierarchy base on an array of ITreeEntry\n *\n * @param entries - an array of ITreeEntry to flatten\n * @param blobMap - a map of blob's sha1 to content that gets filled with content from entries\n * NOTE: blobMap's validity is contingent on the returned promise's resolution\n * @returns the hierarchical tree\n * @internal\n */\nexport function buildSnapshotTree(\n\tentries: ITreeEntry[],\n\tblobMap: Map<string, ArrayBufferLike>,\n): ISnapshotTree {\n\tconst flattened = flatten(entries, blobMap);\n\treturn buildGitTreeHierarchy(flattened);\n}\n"]}
1
+ {"version":3,"file":"buildSnapshotTree.js","sourceRoot":"","sources":["../src/buildSnapshotTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAC7D,0EAOqD;AACrD,+BAAkC;AAElC,kDAA4D;AAE5D,SAAS,WAAW,CACnB,IAAY,EACZ,WAAyB,EACzB,OAAqC;IAErC,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QAE3C,IAAI,SAAS,CAAC,IAAI,KAAK,oBAAS,CAAC,IAAI,EAAE,CAAC;YACvC,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAA,6BAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5D,MAAM,EAAE,GAAG,IAAA,SAAI,GAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAExB,MAAM,KAAK,GAAkB;gBAC5B,IAAI,EAAE,mBAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC9B,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,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAA,gCAAqB,EAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAND,8CAMC","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 { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFileMode,\n\tIGitTree,\n\tIGitTreeEntry,\n\tISnapshotTree,\n\tITreeEntry,\n\tTreeEntry,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport { buildGitTreeHierarchy } from \"./protocol/index.js\";\n\nfunction flattenCore(\n\tpath: string,\n\ttreeEntries: ITreeEntry[],\n\tblobMap: Map<string, ArrayBufferLike>,\n): IGitTreeEntry[] {\n\tconst entries: IGitTreeEntry[] = [];\n\tfor (const treeEntry of treeEntries) {\n\t\tconst subPath = `${path}${treeEntry.path}`;\n\n\t\tif (treeEntry.type === TreeEntry.Blob) {\n\t\t\tconst blob = treeEntry.value;\n\t\t\tconst buffer = stringToBuffer(blob.contents, blob.encoding);\n\t\t\tconst id = uuid();\n\t\t\tblobMap.set(id, buffer);\n\n\t\t\tconst entry: IGitTreeEntry = {\n\t\t\t\tmode: FileMode[treeEntry.mode],\n\t\t\t\tpath: subPath,\n\t\t\t\tsha: id,\n\t\t\t\tsize: 0,\n\t\t\t\ttype: \"blob\",\n\t\t\t\turl: \"\",\n\t\t\t};\n\t\t\tentries.push(entry);\n\t\t} else if (treeEntry.type === TreeEntry.Tree) {\n\t\t\tassert(\n\t\t\t\ttreeEntry.type === TreeEntry.Tree,\n\t\t\t\t0x101 /* \"Unexpected tree entry type on flatten!\" */,\n\t\t\t);\n\t\t\tconst t = treeEntry.value;\n\t\t\tconst entry: IGitTreeEntry = {\n\t\t\t\tmode: FileMode[treeEntry.mode],\n\t\t\t\tpath: subPath,\n\t\t\t\tsha: \"\",\n\t\t\t\tsize: -1,\n\t\t\t\ttype: \"tree\",\n\t\t\t\turl: \"\",\n\t\t\t};\n\t\t\tentries.push(entry);\n\n\t\t\tconst subTreeEntries = flattenCore(`${subPath}/`, t.entries, blobMap);\n\t\t\tentries.push(...subTreeEntries);\n\t\t}\n\t}\n\n\treturn entries;\n}\n\n/**\n * Create a flatten view of an array of ITreeEntry\n *\n * @param tree - an array of ITreeEntry to flatten\n * @param blobMap - a map of blob's sha1 to content\n * @returns A flatten with of the ITreeEntry\n */\nfunction flatten(tree: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): IGitTree {\n\tconst entries = flattenCore(\"\", tree, blobMap);\n\treturn {\n\t\tsha: \"\",\n\t\ttree: entries,\n\t\turl: \"\",\n\t};\n}\n\n/**\n * Build a tree hierarchy base on an array of ITreeEntry\n *\n * @param entries - an array of ITreeEntry to flatten\n * @param blobMap - a map of blob's sha1 to content that gets filled with content from entries\n * NOTE: blobMap's validity is contingent on the returned promise's resolution\n * @returns the hierarchical tree\n * @internal\n */\nexport function buildSnapshotTree(\n\tentries: ITreeEntry[],\n\tblobMap: Map<string, ArrayBufferLike>,\n): ISnapshotTree {\n\tconst flattened = flatten(entries, blobMap);\n\treturn buildGitTreeHierarchy(flattened);\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
+ import { ISummaryTree } from "@fluidframework/driver-definitions";
6
7
  import { IDocumentService, IDocumentServiceFactory, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
7
- import { ISummaryTree } from "@fluidframework/protocol-definitions";
8
8
  /**
9
9
  * This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.
10
10
  * It delegates all calls to IDocumentServiceFactory implementation passed to constructor.
@@ -1 +1 @@
1
- {"version":3,"file":"documentServiceFactoryProxy.d.ts","sourceRoot":"","sources":["../src/documentServiceFactoryProxy.ts"],"names":[],"mappings":"AAAA;;;G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,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IASf,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAG5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"documentServiceFactoryProxy.js","sourceRoot":"","sources":["../src/documentServiceFactoryProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH;;;GAGG;AAEH,MAAsB,2BAA2B;IAChD,YAA6B,eAAwC;QAAxC,oBAAe,GAAf,eAAe,CAAyB;IAAG,CAAC;IAEzE,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CACzC,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC3F,CAAC;CACD;AA5BD,kEA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\n\n/**\n * This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.\n * It delegates all calls to IDocumentServiceFactory implementation passed to constructor.\n */\n\nexport abstract class DocumentServiceFactoryProxy implements IDocumentServiceFactory {\n\tconstructor(private readonly _serviceFactory: IDocumentServiceFactory) {}\n\n\tpublic get serviceFactory(): IDocumentServiceFactory {\n\t\treturn this._serviceFactory;\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.serviceFactory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.serviceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n}\n"]}
1
+ {"version":3,"file":"documentServiceFactoryProxy.js","sourceRoot":"","sources":["../src/documentServiceFactoryProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH;;;GAGG;AAEH,MAAsB,2BAA2B;IAChD,YAA6B,eAAwC;QAAxC,oBAAe,GAAf,eAAe,CAAyB;IAAG,CAAC;IAEzE,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,oBAAkC,EAClC,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CACzC,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,qBAAqB,CACjC,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC3F,CAAC;CACD;AA5BD,kEA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.\n * It delegates all calls to IDocumentServiceFactory implementation passed to constructor.\n */\n\nexport abstract class DocumentServiceFactoryProxy implements IDocumentServiceFactory {\n\tconstructor(private readonly _serviceFactory: IDocumentServiceFactory) {}\n\n\tpublic get serviceFactory(): IDocumentServiceFactory {\n\t\treturn this._serviceFactory;\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.serviceFactory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\treturn this.serviceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
+ import { IClient } from "@fluidframework/driver-definitions";
6
7
  import { IDocumentDeltaConnection, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentStorageService, IResolvedUrl } from "@fluidframework/driver-definitions/internal";
7
- import { IClient } from "@fluidframework/protocol-definitions";
8
8
  /**
9
9
  * This abstract class implements IDocumentService interface. It uses delegation pattern.
10
10
  * It delegates all calls to IDocumentService implementation passed to constructor.
@@ -1 +1 @@
1
- {"version":3,"file":"documentServiceProxy.d.ts","sourceRoot":"","sources":["../src/documentServiceProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;;GAGG;AAEH,8BAAsB,oBACrB,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;IAEf,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,gBAAgB;IAIvD,IAAW,OAAO,IAAI,gBAAgB,CAErC;IAEY,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIpD,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAI9D,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI9E,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI;IAIjC,IAAW,WAAW,IAAI,YAAY,CAErC;CACD"}
1
+ {"version":3,"file":"documentServiceProxy.d.ts","sourceRoot":"","sources":["../src/documentServiceProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,YA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CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IAClC,CAAC;CACD;AA/BD,oDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * This abstract class implements IDocumentService interface. It uses delegation pattern.\n * It delegates all calls to IDocumentService implementation passed to constructor.\n */\n\nexport abstract class DocumentServiceProxy\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tconstructor(private readonly _service: IDocumentService) {\n\t\tsuper();\n\t}\n\n\tpublic get service(): IDocumentService {\n\t\treturn this._service;\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this._service.connectToStorage();\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn this._service.connectToDeltaStorage();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this._service.connectToDeltaStream(client);\n\t}\n\n\tpublic dispose(error?: any): void {\n\t\tthis._service.dispose(error);\n\t}\n\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\treturn this._service.resolvedUrl;\n\t}\n}\n"]}
1
+ {"version":3,"file":"documentServiceProxy.js","sourceRoot":"","sources":["../src/documentServiceProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAWjE;;;GAGG;AAEH,MAAsB,oBACrB,SAAQ,gCAAyC;IAGjD,YAA6B,QAA0B;QACtD,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAkB;IAEvD,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,qBAAqB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;IAC9C,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,MAAe;QAChD,OAAO,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAEM,OAAO,CAAC,KAAW;QACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IAClC,CAAC;CACD;AA/BD,oDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClient } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * This abstract class implements IDocumentService interface. It uses delegation pattern.\n * It delegates all calls to IDocumentService implementation passed to constructor.\n */\n\nexport abstract class DocumentServiceProxy\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\tconstructor(private readonly _service: IDocumentService) {\n\t\tsuper();\n\t}\n\n\tpublic get service(): IDocumentService {\n\t\treturn this._service;\n\t}\n\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn this._service.connectToStorage();\n\t}\n\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\treturn this._service.connectToDeltaStorage();\n\t}\n\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\treturn this._service.connectToDeltaStream(client);\n\t}\n\n\tpublic dispose(error?: any): void {\n\t\tthis._service.dispose(error);\n\t}\n\n\tpublic get resolvedUrl(): IResolvedUrl {\n\t\treturn this._service.resolvedUrl;\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 { FetchSource, IDocumentStorageService, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, ISummaryContext } from "@fluidframework/driver-definitions/internal";
6
- import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
5
+ import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
6
+ import { FetchSource, IDocumentStorageService, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, ISummaryContext, ICreateBlobResponse, ISnapshotTree, IVersion } from "@fluidframework/driver-definitions/internal";
7
7
  /**
8
8
  * @internal
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"documentStorageServiceProxy.d.ts","sourceRoot":"","sources":["../src/documentStorageServiceProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,qBAAa,2BAA4B,YAAW,uBAAuB;IAW9D,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,uBAAuB;IAV9E,OAAO,CAAC,SAAS,CAA8C;IAE/D,IAAW,QAAQ,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2BAAsB,GAAtB,sBAAsB,CAAyB;IAAG,CAAC;IAE3E,KAAK,CAAC,eAAe,CAC3B,OAAkB,EAClB,YAAqB;QAErB,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC3E,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,oBAA4C;QACpE,IAAI,IAAI,CAAC,sBAAsB,CAAC,WAAW,KAAK,SAAS,EAAE;YAC1D,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;SACrE;QACD,MAAM,IAAI,qBAAU,CACnB,uFAAuF,CACvF,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CACvB,SAAwB,EACxB,KAAa,EACb,YAAqB,EACrB,WAAyB;QAEzB,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC7F,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACpC,OAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAsB;QAClD,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACD;AAxDD,kEAwDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFetchSource,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport class DocumentStorageServiceProxy implements IDocumentStorageService {\n\tprivate _policies: IDocumentStorageServicePolicies | undefined;\n\n\tpublic set policies(policies: IDocumentStorageServicePolicies | undefined) {\n\t\tthis._policies = policies;\n\t}\n\n\tpublic get policies() {\n\t\treturn this._policies ?? this.internalStorageService.policies;\n\t}\n\n\tconstructor(protected readonly internalStorageService: IDocumentStorageService) {}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this.internalStorageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tif (this.internalStorageService.getSnapshot !== undefined) {\n\t\t\treturn this.internalStorageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\t\tthrow new UsageError(\n\t\t\t\"getSnapshot api should exist on internal storage in documentStorageServiceProxy class\",\n\t\t);\n\t}\n\n\tpublic async getVersions(\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this.internalStorageService.getVersions(versionId, count, scenarioName, fetchSource);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this.internalStorageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this.internalStorageService.downloadSummary(handle);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.internalStorageService.createBlob(file);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.internalStorageService.readBlob(blobId);\n\t}\n}\n"]}
1
+ {"version":3,"file":"documentStorageServiceProxy.js","sourceRoot":"","sources":["../src/documentStorageServiceProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,uEAAsE;AAEtE;;GAEG;AACH,MAAa,2BAA2B;IAGvC,IAAW,QAAQ,CAAC,QAAqD;QACxE,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAC/D,CAAC;IAED,YAA+B,sBAA+C;QAA/C,2BAAsB,GAAtB,sBAAsB,CAAyB;IAAG,CAAC;IAE3E,KAAK,CAAC,eAAe,CAC3B,OAAkB,EAClB,YAAqB;QAErB,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC3E,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,oBAA4C;QACpE,IAAI,IAAI,CAAC,sBAAsB,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,IAAI,qBAAU,CACnB,uFAAuF,CACvF,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CACvB,SAAwB,EACxB,KAAa,EACb,YAAqB,EACrB,WAAyB;QAEzB,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAC7C,SAAS,EACT,KAAK,EACL,YAAY,EACZ,WAAW,CACX,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACpC,OAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAsB;QAClD,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACD;AA7DD,kEA6DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tFetchSource,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport class DocumentStorageServiceProxy implements IDocumentStorageService {\n\tprivate _policies: IDocumentStorageServicePolicies | undefined;\n\n\tpublic set policies(policies: IDocumentStorageServicePolicies | undefined) {\n\t\tthis._policies = policies;\n\t}\n\n\tpublic get policies() {\n\t\treturn this._policies ?? this.internalStorageService.policies;\n\t}\n\n\tconstructor(protected readonly internalStorageService: IDocumentStorageService) {}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this.internalStorageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tif (this.internalStorageService.getSnapshot !== undefined) {\n\t\t\treturn this.internalStorageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\t\tthrow new UsageError(\n\t\t\t\"getSnapshot api should exist on internal storage in documentStorageServiceProxy class\",\n\t\t);\n\t}\n\n\tpublic async getVersions(\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this.internalStorageService.getVersions(\n\t\t\tversionId,\n\t\t\tcount,\n\t\t\tscenarioName,\n\t\t\tfetchSource,\n\t\t);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this.internalStorageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this.internalStorageService.downloadSummary(handle);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.internalStorageService.createBlob(file);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.internalStorageService.readBlob(blobId);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAoB,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAEzF;;;GAGG;AACH,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IACxF,QAAQ,CAAC,SAAS,eAA+B;IACjD,QAAQ,CAAC,QAAQ,SAAS;gBAEd,OAAO,EAAE,MAAM;CAG3B"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAEzF;;;GAGG;AACH,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IACxF,QAAQ,CAAC,SAAS,eAA+B;IACjD,QAAQ,CAAC,QAAQ,SAAS;gBAEd,OAAO,EAAE,MAAM;CAG3B"}
package/dist/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAAiG;AACjG,uEAAyF;AAEzF;;;GAGG;AACH,MAAa,UAAW,SAAQ,uBAAY;IAI3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAJ7B,cAAS,GAAG,2BAAgB,CAAC,UAAU,CAAC;QACxC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD;AAPD,gCAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DriverErrorTypes, IDriverErrorBase } from \"@fluidframework/driver-definitions/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * @internal\n */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\treadonly errorType = DriverErrorTypes.usageError;\n\treadonly canRetry = false;\n\n\tconstructor(message: string) {\n\t\tsuper(message, { usageError: true });\n\t}\n}\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAGqD;AACrD,uEAAyF;AAEzF;;;GAGG;AACH,MAAa,UAAW,SAAQ,uBAAY;IAI3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAJ7B,cAAS,GAAG,2BAAgB,CAAC,UAAU,CAAC;QACxC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD;AAPD,gCAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * @internal\n */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\treadonly errorType = DriverErrorTypes.usageError;\n\treadonly canRetry = false;\n\n\tconstructor(message: string) {\n\t\tsuper(message, { usageError: true });\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from "./blob.js";
7
7
  export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy.js";
8
8
  export { UsageError } from "./error.js";
9
9
  export { InsecureUrlResolver } from "./insecureUrlResolver.js";
10
- export { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from "./messageRecognition.js";
10
+ export { canBeCoalescedByService, isRuntimeMessage, MessageType2, } from "./messageRecognition.js";
11
11
  export { AuthorizationError, canRetryOnError, createGenericNetworkError, createWriteError, DeltaStreamConnectionForbiddenError, DriverErrorTelemetryProps, FluidInvalidSchemaError, GenericNetworkError, getRetryDelayFromError, getRetryDelaySecondsFromError, isOnline, LocationRedirectionError, NetworkErrorBasic, NonRetryableError, OnlineStatus, RetryableError, ThrottlingError, } from "./network.js";
12
12
  export { logNetworkFailure } from "./networkUtils.js";
13
13
  export { emptyMessageStream, ParallelRequests, Queue, requestOps, streamFromMessages, streamObserver, } from "./parallelRequests.js";
@@ -19,4 +19,5 @@ export { CombinedAppAndProtocolSummary, getDocAttributesFromProtocolSummary, get
19
19
  export { convertSummaryTreeToSnapshotITree } from "./treeConversions.js";
20
20
  export { applyStorageCompression, ICompressionStorageConfig, SummaryCompressionAlgorithm, blobHeadersBlobName, } from "./adapters/index.js";
21
21
  export { getSnapshotTree, isInstanceOfISnapshot } from "./storageUtils.js";
22
+ export { buildGitTreeHierarchy, getGitMode, getGitType } from "./protocol/index.js";
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EACnC,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EAC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B,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EACN,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACN,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isInstanceOfISnapshot = exports.getSnapshotTree = exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
7
+ exports.getGitType = exports.getGitMode = exports.buildGitTreeHierarchy = exports.isInstanceOfISnapshot = exports.getSnapshotTree = exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
8
8
  var buildSnapshotTree_js_1 = require("./buildSnapshotTree.js");
9
9
  Object.defineProperty(exports, "buildSnapshotTree", { enumerable: true, get: function () { return buildSnapshotTree_js_1.buildSnapshotTree; } });
10
10
  var blob_js_1 = require("./blob.js");
@@ -69,4 +69,8 @@ Object.defineProperty(exports, "blobHeadersBlobName", { enumerable: true, get: f
69
69
  var storageUtils_js_1 = require("./storageUtils.js");
70
70
  Object.defineProperty(exports, "getSnapshotTree", { enumerable: true, get: function () { return storageUtils_js_1.getSnapshotTree; } });
71
71
  Object.defineProperty(exports, "isInstanceOfISnapshot", { enumerable: true, get: function () { return storageUtils_js_1.isInstanceOfISnapshot; } });
72
+ var index_js_2 = require("./protocol/index.js");
73
+ Object.defineProperty(exports, "buildGitTreeHierarchy", { enumerable: true, get: function () { return index_js_2.buildGitTreeHierarchy; } });
74
+ Object.defineProperty(exports, "getGitMode", { enumerable: true, get: function () { return index_js_2.getGitMode; } });
75
+ Object.defineProperty(exports, "getGitType", { enumerable: true, get: function () { return index_js_2.getGitType; } });
72
76
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,qCAA8E;AAArE,wGAAA,aAAa,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAC1D,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,uCAAwC;AAA/B,sGAAA,UAAU,OAAA;AACnB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,iEAAkG;AAAzF,gIAAA,uBAAuB,OAAA;AAAE,yHAAA,gBAAgB,OAAA;AAAE,qHAAA,YAAY,OAAA;AAChE,2CAkBsB;AAjBrB,gHAAA,kBAAkB,OAAA;AAClB,6GAAA,eAAe,OAAA;AACf,uHAAA,yBAAyB,OAAA;AACzB,8GAAA,gBAAgB,OAAA;AAChB,iIAAA,mCAAmC,OAAA;AAEnC,qHAAA,uBAAuB,OAAA;AACvB,iHAAA,mBAAmB,OAAA;AACnB,oHAAA,sBAAsB,OAAA;AACtB,2HAAA,6BAA6B,OAAA;AAC7B,sGAAA,QAAQ,OAAA;AACR,sHAAA,wBAAwB,OAAA;AACxB,+GAAA,iBAAiB,OAAA;AACjB,+GAAA,iBAAiB,OAAA;AACjB,0GAAA,YAAY,OAAA;AACZ,4GAAA,cAAc,OAAA;AACd,6GAAA,eAAe,OAAA;AAEhB,qDAAsD;AAA7C,oHAAA,iBAAiB,OAAA;AAC1B,6DAO+B;AAN9B,yHAAA,kBAAkB,OAAA;AAClB,uHAAA,gBAAgB,OAAA;AAChB,4GAAA,KAAK,OAAA;AACL,iHAAA,UAAU,OAAA;AACV,yHAAA,kBAAkB,OAAA;AAClB,qHAAA,cAAc,OAAA;AAEf,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AACvC,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AACrB,qDAAkF;AAAzE,uHAAA,oBAAoB,OAAA;AAAa,+GAAA,YAAY,OAAA;AACtD,mEAKkC;AAHjC,6IAAA,mCAAmC,OAAA;AACnC,4IAAA,kCAAkC,OAAA;AAClC,yIAAA,+BAA+B,OAAA;AAEhC,2DAAyE;AAAhE,uIAAA,iCAAiC,OAAA;AAC1C,gDAK6B;AAJ5B,mHAAA,uBAAuB,OAAA;AAEvB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,qDAA2E;AAAlE,kHAAA,eAAe,OAAA;AAAE,wHAAA,qBAAqB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree.js\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob.js\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy.js\";\nexport { UsageError } from \"./error.js\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver.js\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition.js\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network.js\";\nexport { logNetworkFailure } from \"./networkUtils.js\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests.js\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService.js\";\nexport { RateLimiter } from \"./rateLimiter.js\";\nexport { readAndParse } from \"./readAndParse.js\";\nexport { calculateMaxWaitTime, IProgress, runWithRetry } from \"./runWithRetry.js\";\nexport {\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew.js\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions.js\";\nexport {\n\tapplyStorageCompression,\n\tICompressionStorageConfig,\n\tSummaryCompressionAlgorithm,\n\tblobHeadersBlobName,\n} from \"./adapters/index.js\";\nexport { getSnapshotTree, isInstanceOfISnapshot } from \"./storageUtils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":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GAAA,YAAY,OAAA;AACtD,mEAKkC;AAHjC,6IAAA,mCAAmC,OAAA;AACnC,4IAAA,kCAAkC,OAAA;AAClC,yIAAA,+BAA+B,OAAA;AAEhC,2DAAyE;AAAhE,uIAAA,iCAAiC,OAAA;AAC1C,gDAK6B;AAJ5B,mHAAA,uBAAuB,OAAA;AAEvB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA;AAEpB,qDAA2E;AAAlE,kHAAA,eAAe,OAAA;AAAE,wHAAA,qBAAqB,OAAA;AAC/C,gDAAoF;AAA3E,iHAAA,qBAAqB,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,sGAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree.js\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob.js\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy.js\";\nexport { UsageError } from \"./error.js\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver.js\";\nexport {\n\tcanBeCoalescedByService,\n\tisRuntimeMessage,\n\tMessageType2,\n} from \"./messageRecognition.js\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network.js\";\nexport { logNetworkFailure } from \"./networkUtils.js\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests.js\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService.js\";\nexport { RateLimiter } from \"./rateLimiter.js\";\nexport { readAndParse } from \"./readAndParse.js\";\nexport { calculateMaxWaitTime, IProgress, runWithRetry } from \"./runWithRetry.js\";\nexport {\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew.js\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions.js\";\nexport {\n\tapplyStorageCompression,\n\tICompressionStorageConfig,\n\tSummaryCompressionAlgorithm,\n\tblobHeadersBlobName,\n} from \"./adapters/index.js\";\nexport { getSnapshotTree, isInstanceOfISnapshot } from \"./storageUtils.js\";\nexport { buildGitTreeHierarchy, getGitMode, getGitType } from \"./protocol/index.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"insecureUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAEN,YAAY,EACZ,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IAItD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAT/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4C;gBAGhD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,M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AAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AAzID,kDAyIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * https://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @internal\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly deltaStreamUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/apis/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `https://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `https://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst parsedUrl = new URL(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
1
+ {"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,kEAA6D;AAC7D,0EAIqD;AACrD,kDAA0B;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAa,mBAAmB;IAG/B,YACkB,OAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,cAAsB,EACtB,QAAgB,EAChB,MAAc,EACd,gBAAyB,KAAK;QAN9B,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAiB;QAT/B,UAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;IAU/D,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,yEAAyE;QACzE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/C,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG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G,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAChF,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AA5ID,kDA4IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * https://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @internal\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly deltaStreamUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/apis/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `https://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `https://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(\n\t\tresolvedUrl: IResolvedUrl,\n\t\trelativeUrl: string,\n\t): Promise<string> {\n\t\tconst parsedUrl = new URL(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
5
+ import { ISequencedDocumentMessage, IDocumentMessage } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * Tells if message was sent by container runtime
8
8
  * @privateRemarks ADO #1385: To be moved to container-definitions
@@ -1 +1 @@
1
- {"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACvB,MAAM,WAAW;CACjB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,yBAAyB,GAAG,gBAAgB,GACnD,OAAO,CAIT"}
1
+ {"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,gBAAgB,EAEhB,MAAM,6CAA6C,CAAC;AAErD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACvB,MAAM,WAAW;CACjB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,yBAAyB,GAAG,gBAAgB,GACnD,OAAO,CAIT"}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.canBeCoalescedByService = exports.MessageType2 = exports.isRuntimeMessage = void 0;
8
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
8
+ const internal_1 = require("@fluidframework/driver-definitions/internal");
9
9
  /**
10
10
  * Tells if message was sent by container runtime
11
11
  * @privateRemarks ADO #1385: To be moved to container-definitions
@@ -13,7 +13,7 @@ const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
13
13
  * @internal
14
14
  */
15
15
  function isRuntimeMessage(message) {
16
- return message.type === protocol_definitions_1.MessageType.Operation;
16
+ return message.type === internal_1.MessageType.Operation;
17
17
  }
18
18
  exports.isRuntimeMessage = isRuntimeMessage;
19
19
  /**
@@ -32,7 +32,7 @@ var MessageType2;
32
32
  function canBeCoalescedByService(message) {
33
33
  // This assumes that in the future relay service may implement coalescing of accept messages,
34
34
  // same way it was doing coalescing of immediate noops in the past.
35
- return message.type === protocol_definitions_1.MessageType.NoOp || message.type === MessageType2.Accept;
35
+ return message.type === internal_1.MessageType.NoOp || message.type === MessageType2.Accept;
36
36
  }
37
37
  exports.canBeCoalescedByService = canBeCoalescedByService;
38
38
  //# sourceMappingURL=messageRecognition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+EAI8C;AAE9C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED;;;;GAIG;AACH,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC;AAND,0DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @internal\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: staging code changes across layers.\n * Eventually to be replaced by MessageType.accept\n * @internal\n */\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @internal\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
1
+ {"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAIqD;AAErD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED;;;;GAIG;AACH,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC;AAND,0DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tISequencedDocumentMessage,\n\tIDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @internal\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: staging code changes across layers.\n * Eventually to be replaced by MessageType.accept\n * @internal\n */\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @internal\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,kBAAkB,EAElB,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAEzF;;GAEG;AACH,oBAAY,YAAY;IACvB,OAAO,IAAA;IACP,MAAM,IAAA;IACN,OAAO,IAAA;CACP;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,YAAY,CASvC;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG;IAClE,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IAQhG,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAP3B;;OAEG;IACH,QAAQ,CAAC,SAAS,wBAAwC;gBAGzD,OAAO,EAAE,MAAM,EACN,QAAQ,EAAE,OAAO,EAC1B,KAAK,EAAE,yBAAyB;CAIjC;AAED;;;GAGG;AACH,qBAAa,uBACZ,SAAQ,YACR,YAAW,gBAAgB,EAAE,eAAe;IAE5C,QAAQ,CAAC,SAAS,uBAAuC;IACzD,QAAQ,CA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AAApE,QAAA,eAAe,mBAAqD;AAEjF;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC/E,KAAK,EAAE,iBAAuC,CAAC;AADnC,QAAA,6BAA6B,iCACM;AAEhD;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAsB,EAAE,CACxE,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADxE,QAAA,sBAAsB,0BACkD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tIAuthorizationError,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tIThrottlingWarning,\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @internal\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @internal\n */\nexport type DriverErrorTelemetryProps = ITelemetryBaseProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @internal\n */\nexport class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\t/**\n\t * {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}\n\t */\n\treadonly errorType = DriverErrorTypes.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @internal\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\tstatic readonly errorType = DriverErrorTypes.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.authorizationError;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly claims: string | undefined,\n\t\treadonly tenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @internal\n */\nexport class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {\n\treadonly errorType = DriverErrorTypes.throttlingError;\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\n/**\n * @internal\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @internal\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @internal\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @internal\n */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @internal\n */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
1
+ {"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAOqD;AACrD,uEAAyF;AAEzF;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED;;;;;GAKG;AACH,SAAgB,QAAQ;IACvB,IACC,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EACpC,CAAC;QACF,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC;IACtE,CAAC;IACD,OAAO,YAAY,CAAC,OAAO,CAAC;AAC7B,CAAC;AATD,4BASC;AAUD;;;GAGG;AACH,MAAa,mBACZ,SAAQ,uBAAY;IAQpB,YACC,OAAe,EACN,QAAiB,EAC1B,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,aAAQ,GAAR,QAAQ,CAAS;QAP3B;;WAEG;QAC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GAAG,CAAC,OAAe,EAAE,KAAgC,EAAE,EAAE,CACrF,IAAI,iBAAiB,CAAC,OAAO,EAAE,2BAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AADvD,QAAA,gBAAgB,oBACuC;AAEpE;;GAEG;AACH,SAAgB,yBAAyB,CACxC,OAAe,EACf,SAAuD,EACvD,KAAgC;IAEhC,IAAI,SAAS,CAAC,YAAY,KAAK,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QAChE,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpE,CAAC;AATD,8DASC;AAED;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;AAApE,QAAA,eAAe,mBAAqD;AAEjF;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC/E,KAAK,EAAE,iBAAuC,CAAC;AADnC,QAAA,6BAA6B,iCACM;AAEhD;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAsB,EAAE,CACxE,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADxE,QAAA,sBAAsB,0BACkD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tIAuthorizationError,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tIThrottlingWarning,\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @internal\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @internal\n */\nexport type DriverErrorTelemetryProps = ITelemetryBaseProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @internal\n */\nexport class GenericNetworkError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t/**\n\t * {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}\n\t */\n\treadonly errorType = DriverErrorTypes.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @internal\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\tstatic readonly errorType = DriverErrorTypes.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.authorizationError;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly claims: string | undefined,\n\t\treadonly tenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class NetworkErrorBasic<T extends string>\n\textends LoggingError\n\timplements IFluidErrorBase\n{\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @internal\n */\nexport class ThrottlingError\n\textends LoggingError\n\timplements IThrottlingWarning, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.throttlingError;\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\n/**\n * @internal\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @internal\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @internal\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @internal\n */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @internal\n */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"networkUtils.js","sourceRoot":"","sources":["../src/networkUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,6CAAuE;AAEvE;;GAEG;AACH,SAAgB,iBAAiB,CAChC,MAA2B,EAC3B,KAA8B,EAC9B,KAAW;IAEX,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,KAAK,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM;QACd,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,yBAAY,CAAC,IAAA,qBAAQ,GAAE,CAAC,CAAC;IAElF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE;QACxD,MAAM,GAAG,GAAG,SAAgB,CAAC;QAC7B,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC;QAC/E,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAC1D,QAAQ,CAAC,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;SAC1C;KACD;IAED,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,GAAG,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAtBD,8CAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryErrorEventExt } from \"@fluidframework/telemetry-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { OnlineStatus, canRetryOnError, isOnline } from \"./network.js\";\n\n/**\n * @internal\n */\nexport function logNetworkFailure(\n\tlogger: ITelemetryLoggerExt,\n\tevent: ITelemetryErrorEventExt,\n\terror?: any,\n) {\n\tconst newEvent = { ...event };\n\n\tconst errorOnlineProp = error?.online;\n\tnewEvent.online =\n\t\ttypeof errorOnlineProp === \"string\" ? errorOnlineProp : OnlineStatus[isOnline()];\n\n\tif (typeof navigator === \"object\" && navigator !== null) {\n\t\tconst nav = navigator as any;\n\t\tconst connection = nav.connection ?? nav.mozConnection ?? nav.webkitConnection;\n\t\tif (connection !== null && typeof connection === \"object\") {\n\t\t\tnewEvent.connectionType = connection.type;\n\t\t}\n\t}\n\n\t// non-retryable errors are fatal and should be logged as errors\n\tnewEvent.category = canRetryOnError(error) ? \"generic\" : \"error\";\n\tlogger.sendTelemetryEvent(newEvent, error);\n}\n"]}
1
+ {"version":3,"file":"networkUtils.js","sourceRoot":"","sources":["../src/networkUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,6CAAuE;AAEvE;;GAEG;AACH,SAAgB,iBAAiB,CAChC,MAA2B,EAC3B,KAA8B,EAC9B,KAAW;IAEX,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,KAAK,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM;QACd,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,yBAAY,CAAC,IAAA,qBAAQ,GAAE,CAAC,CAAC;IAElF,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACzD,MAAM,GAAG,GAAG,SAAgB,CAAC;QAC7B,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC;QAC/E,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YAC3D,QAAQ,CAAC,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;QAC3C,CAAC;IACF,CAAC;IAED,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,GAAG,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAtBD,8CAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryErrorEventExt } from \"@fluidframework/telemetry-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { OnlineStatus, canRetryOnError, isOnline } from \"./network.js\";\n\n/**\n * @internal\n */\nexport function logNetworkFailure(\n\tlogger: ITelemetryLoggerExt,\n\tevent: ITelemetryErrorEventExt,\n\terror?: any,\n) {\n\tconst newEvent = { ...event };\n\n\tconst errorOnlineProp = error?.online;\n\tnewEvent.online =\n\t\ttypeof errorOnlineProp === \"string\" ? errorOnlineProp : OnlineStatus[isOnline()];\n\n\tif (typeof navigator === \"object\" && navigator !== null) {\n\t\tconst nav = navigator as any;\n\t\tconst connection = nav.connection ?? nav.mozConnection ?? nav.webkitConnection;\n\t\tif (connection !== null && typeof connection === \"object\") {\n\t\t\tnewEvent.connectionType = connection.type;\n\t\t}\n\t}\n\n\t// non-retryable errors are fatal and should be logged as errors\n\tnewEvent.category = canRetryOnError(error) ? \"generic\" : \"error\";\n\tlogger.sendTelemetryEvent(newEvent, error);\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/driver-utils";
8
- export declare const pkgVersion = "2.0.0-rc.4.0.6";
8
+ export declare const pkgVersion = "2.0.0-rc.5.0.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/driver-utils";
11
- exports.pkgVersion = "2.0.0-rc.4.0.6";
11
+ exports.pkgVersion = "2.0.0-rc.5.0.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,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,gBAAgB,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-rc.4.0.6\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,gBAAgB,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-rc.5.0.0\";\n"]}