@fluidframework/routerlicious-driver 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.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 (259) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -2
  3. package/api-extractor-lint.json +13 -0
  4. package/api-extractor.json +3 -3
  5. package/api-report/routerlicious-driver.api.md +10 -10
  6. package/dist/{cache.js → cache.cjs} +2 -2
  7. package/dist/cache.cjs.map +1 -0
  8. package/dist/{policies.js → contracts.cjs} +1 -1
  9. package/dist/contracts.cjs.map +1 -0
  10. package/dist/{createNewUtils.js → createNewUtils.cjs} +1 -1
  11. package/dist/createNewUtils.cjs.map +1 -0
  12. package/dist/{defaultTokenProvider.js → defaultTokenProvider.cjs} +2 -1
  13. package/dist/defaultTokenProvider.cjs.map +1 -0
  14. package/dist/defaultTokenProvider.d.ts +1 -0
  15. package/dist/defaultTokenProvider.d.ts.map +1 -1
  16. package/dist/{definitions.js → definitions.cjs} +1 -1
  17. package/dist/definitions.cjs.map +1 -0
  18. package/dist/{deltaStorageService.js → deltaStorageService.cjs} +1 -1
  19. package/dist/deltaStorageService.cjs.map +1 -0
  20. package/dist/{documentDeltaConnection.js → documentDeltaConnection.cjs} +3 -3
  21. package/dist/documentDeltaConnection.cjs.map +1 -0
  22. package/dist/{documentService.js → documentService.cjs} +9 -9
  23. package/dist/documentService.cjs.map +1 -0
  24. package/dist/{documentServiceFactory.js → documentServiceFactory.cjs} +8 -6
  25. package/{lib/documentServiceFactory.js.map → dist/documentServiceFactory.cjs.map} +1 -1
  26. package/dist/documentServiceFactory.d.ts +2 -0
  27. package/dist/documentServiceFactory.d.ts.map +1 -1
  28. package/dist/{documentStorageService.js → documentStorageService.cjs} +3 -3
  29. package/dist/documentStorageService.cjs.map +1 -0
  30. package/dist/{errorUtils.js → errorUtils.cjs} +4 -2
  31. package/dist/errorUtils.cjs.map +1 -0
  32. package/dist/errorUtils.d.ts +12 -0
  33. package/dist/errorUtils.d.ts.map +1 -1
  34. package/dist/{gitManager.js → gitManager.cjs} +1 -1
  35. package/dist/gitManager.cjs.map +1 -0
  36. package/dist/{historian.js → historian.cjs} +1 -1
  37. package/{lib/historian.js.map → dist/historian.cjs.map} +1 -1
  38. package/dist/{index.js → index.cjs} +4 -4
  39. package/dist/index.cjs.map +1 -0
  40. package/dist/{mapWithExpiration.js → mapWithExpiration.cjs} +1 -1
  41. package/dist/mapWithExpiration.cjs.map +1 -0
  42. package/dist/{nullBlobStorageService.js → nullBlobStorageService.cjs} +1 -1
  43. package/dist/nullBlobStorageService.cjs.map +1 -0
  44. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  45. package/dist/packageVersion.cjs.map +1 -0
  46. package/dist/packageVersion.d.ts +1 -1
  47. package/dist/{contracts.js → policies.cjs} +1 -1
  48. package/dist/policies.cjs.map +1 -0
  49. package/dist/policies.d.ts +3 -0
  50. package/dist/policies.d.ts.map +1 -1
  51. package/dist/{r11sSnapshotParser.js → r11sSnapshotParser.cjs} +1 -1
  52. package/dist/r11sSnapshotParser.cjs.map +1 -0
  53. package/dist/{restWrapper.js → restWrapper.cjs} +4 -4
  54. package/dist/restWrapper.cjs.map +1 -0
  55. package/dist/{restWrapperBase.js → restWrapperBase.cjs} +1 -1
  56. package/dist/restWrapperBase.cjs.map +1 -0
  57. package/dist/{retriableGitManager.js → retriableGitManager.cjs} +1 -1
  58. package/dist/retriableGitManager.cjs.map +1 -0
  59. package/dist/routerlicious-driver-alpha.d.ts +92 -0
  60. package/dist/routerlicious-driver-beta.d.ts +35 -0
  61. package/dist/routerlicious-driver-public.d.ts +35 -0
  62. package/dist/routerlicious-driver-untrimmed.d.ts +268 -0
  63. package/dist/{shreddedSummaryDocumentStorageService.js → shreddedSummaryDocumentStorageService.cjs} +4 -4
  64. package/dist/shreddedSummaryDocumentStorageService.cjs.map +1 -0
  65. package/dist/{storageContracts.js → storageContracts.cjs} +1 -1
  66. package/dist/storageContracts.cjs.map +1 -0
  67. package/dist/{summaryTreeUploadManager.js → summaryTreeUploadManager.cjs} +1 -1
  68. package/dist/summaryTreeUploadManager.cjs.map +1 -0
  69. package/dist/{tokens.js → tokens.cjs} +1 -1
  70. package/dist/tokens.cjs.map +1 -0
  71. package/dist/tokens.d.ts +5 -0
  72. package/dist/tokens.d.ts.map +1 -1
  73. package/dist/{treeUtils.js → treeUtils.cjs} +1 -1
  74. package/dist/treeUtils.cjs.map +1 -0
  75. package/dist/tsdoc-metadata.json +1 -1
  76. package/dist/{urlUtils.js → urlUtils.cjs} +1 -1
  77. package/dist/urlUtils.cjs.map +1 -0
  78. package/dist/{wholeSummaryDocumentStorageService.js → wholeSummaryDocumentStorageService.cjs} +5 -5
  79. package/dist/wholeSummaryDocumentStorageService.cjs.map +1 -0
  80. package/dist/{wholeSummaryUploadManager.js → wholeSummaryUploadManager.cjs} +1 -1
  81. package/dist/wholeSummaryUploadManager.cjs.map +1 -0
  82. package/lib/{cache.js → cache.mjs} +2 -2
  83. package/lib/cache.mjs.map +1 -0
  84. package/lib/contracts.d.ts.map +1 -1
  85. package/lib/{policies.js → contracts.mjs} +1 -1
  86. package/{dist/contracts.js.map → lib/contracts.mjs.map} +1 -1
  87. package/lib/createNewUtils.d.ts.map +1 -1
  88. package/lib/{createNewUtils.js → createNewUtils.mjs} +1 -1
  89. package/lib/createNewUtils.mjs.map +1 -0
  90. package/lib/defaultTokenProvider.d.ts +2 -1
  91. package/lib/defaultTokenProvider.d.ts.map +1 -1
  92. package/lib/{defaultTokenProvider.js → defaultTokenProvider.mjs} +2 -1
  93. package/lib/defaultTokenProvider.mjs.map +1 -0
  94. package/lib/definitions.d.ts.map +1 -1
  95. package/lib/{definitions.js → definitions.mjs} +1 -1
  96. package/{dist/definitions.js.map → lib/definitions.mjs.map} +1 -1
  97. package/lib/deltaStorageService.d.ts +2 -2
  98. package/lib/deltaStorageService.d.ts.map +1 -1
  99. package/lib/{deltaStorageService.js → deltaStorageService.mjs} +1 -1
  100. package/lib/deltaStorageService.mjs.map +1 -0
  101. package/lib/documentDeltaConnection.d.ts.map +1 -1
  102. package/lib/{documentDeltaConnection.js → documentDeltaConnection.mjs} +3 -3
  103. package/lib/documentDeltaConnection.mjs.map +1 -0
  104. package/lib/documentService.d.ts +6 -6
  105. package/lib/documentService.d.ts.map +1 -1
  106. package/lib/{documentService.js → documentService.mjs} +9 -9
  107. package/lib/documentService.mjs.map +1 -0
  108. package/lib/documentServiceFactory.d.ts +4 -2
  109. package/lib/documentServiceFactory.d.ts.map +1 -1
  110. package/lib/{documentServiceFactory.js → documentServiceFactory.mjs} +8 -6
  111. package/lib/documentServiceFactory.mjs.map +1 -0
  112. package/lib/documentStorageService.d.ts +5 -5
  113. package/lib/documentStorageService.d.ts.map +1 -1
  114. package/lib/{documentStorageService.js → documentStorageService.mjs} +3 -3
  115. package/lib/documentStorageService.mjs.map +1 -0
  116. package/lib/errorUtils.d.ts +12 -0
  117. package/lib/errorUtils.d.ts.map +1 -1
  118. package/lib/{errorUtils.js → errorUtils.mjs} +4 -2
  119. package/lib/errorUtils.mjs.map +1 -0
  120. package/lib/gitManager.d.ts +3 -3
  121. package/lib/gitManager.d.ts.map +1 -1
  122. package/lib/{gitManager.js → gitManager.mjs} +1 -1
  123. package/lib/gitManager.mjs.map +1 -0
  124. package/lib/historian.d.ts +4 -4
  125. package/lib/historian.d.ts.map +1 -1
  126. package/lib/{historian.js → historian.mjs} +1 -1
  127. package/lib/historian.mjs.map +1 -0
  128. package/lib/index.d.ts +5 -5
  129. package/lib/index.d.ts.map +1 -1
  130. package/lib/{index.js → index.mjs} +4 -7
  131. package/lib/index.mjs.map +1 -0
  132. package/lib/{mapWithExpiration.js → mapWithExpiration.mjs} +1 -1
  133. package/lib/mapWithExpiration.mjs.map +1 -0
  134. package/lib/nullBlobStorageService.d.ts.map +1 -1
  135. package/lib/{nullBlobStorageService.js → nullBlobStorageService.mjs} +1 -1
  136. package/lib/nullBlobStorageService.mjs.map +1 -0
  137. package/lib/packageVersion.d.ts +1 -1
  138. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  139. package/lib/packageVersion.mjs.map +1 -0
  140. package/lib/policies.d.ts +3 -0
  141. package/lib/policies.d.ts.map +1 -1
  142. package/lib/{contracts.js → policies.mjs} +1 -1
  143. package/lib/policies.mjs.map +1 -0
  144. package/lib/r11sSnapshotParser.d.ts +1 -1
  145. package/lib/r11sSnapshotParser.d.ts.map +1 -1
  146. package/lib/{r11sSnapshotParser.js → r11sSnapshotParser.mjs} +1 -1
  147. package/lib/r11sSnapshotParser.mjs.map +1 -0
  148. package/lib/restWrapper.d.ts +2 -2
  149. package/lib/restWrapper.d.ts.map +1 -1
  150. package/lib/{restWrapper.js → restWrapper.mjs} +4 -4
  151. package/lib/restWrapper.mjs.map +1 -0
  152. package/lib/restWrapperBase.d.ts +1 -1
  153. package/lib/restWrapperBase.d.ts.map +1 -1
  154. package/lib/{restWrapperBase.js → restWrapperBase.mjs} +1 -1
  155. package/lib/restWrapperBase.mjs.map +1 -0
  156. package/lib/retriableGitManager.d.ts +3 -3
  157. package/lib/retriableGitManager.d.ts.map +1 -1
  158. package/lib/{retriableGitManager.js → retriableGitManager.mjs} +1 -1
  159. package/lib/retriableGitManager.mjs.map +1 -0
  160. package/lib/routerlicious-driver-alpha.d.ts +92 -0
  161. package/lib/routerlicious-driver-beta.d.ts +35 -0
  162. package/lib/routerlicious-driver-public.d.ts +35 -0
  163. package/lib/routerlicious-driver-untrimmed.d.ts +268 -0
  164. package/lib/shreddedSummaryDocumentStorageService.d.ts +4 -4
  165. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  166. package/lib/{shreddedSummaryDocumentStorageService.js → shreddedSummaryDocumentStorageService.mjs} +4 -4
  167. package/lib/shreddedSummaryDocumentStorageService.mjs.map +1 -0
  168. package/lib/storageContracts.d.ts +2 -2
  169. package/lib/storageContracts.d.ts.map +1 -1
  170. package/lib/{storageContracts.js → storageContracts.mjs} +1 -1
  171. package/{dist/storageContracts.js.map → lib/storageContracts.mjs.map} +1 -1
  172. package/lib/summaryTreeUploadManager.d.ts +1 -1
  173. package/lib/summaryTreeUploadManager.d.ts.map +1 -1
  174. package/lib/{summaryTreeUploadManager.js → summaryTreeUploadManager.mjs} +1 -1
  175. package/lib/summaryTreeUploadManager.mjs.map +1 -0
  176. package/lib/tokens.d.ts +5 -0
  177. package/lib/tokens.d.ts.map +1 -1
  178. package/lib/{tokens.js → tokens.mjs} +1 -1
  179. package/lib/tokens.mjs.map +1 -0
  180. package/lib/treeUtils.d.ts +1 -1
  181. package/lib/treeUtils.d.ts.map +1 -1
  182. package/lib/{treeUtils.js → treeUtils.mjs} +1 -1
  183. package/lib/treeUtils.mjs.map +1 -0
  184. package/lib/urlUtils.d.ts.map +1 -1
  185. package/lib/{urlUtils.js → urlUtils.mjs} +1 -1
  186. package/lib/urlUtils.mjs.map +1 -0
  187. package/lib/wholeSummaryDocumentStorageService.d.ts +4 -4
  188. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  189. package/lib/{wholeSummaryDocumentStorageService.js → wholeSummaryDocumentStorageService.mjs} +5 -5
  190. package/lib/wholeSummaryDocumentStorageService.mjs.map +1 -0
  191. package/lib/wholeSummaryUploadManager.d.ts +1 -1
  192. package/lib/wholeSummaryUploadManager.d.ts.map +1 -1
  193. package/lib/{wholeSummaryUploadManager.js → wholeSummaryUploadManager.mjs} +1 -1
  194. package/lib/wholeSummaryUploadManager.mjs.map +1 -0
  195. package/package.json +46 -26
  196. package/src/defaultTokenProvider.ts +1 -0
  197. package/src/documentServiceFactory.ts +2 -0
  198. package/src/errorUtils.ts +5 -0
  199. package/src/packageVersion.ts +1 -1
  200. package/src/policies.ts +3 -0
  201. package/src/tokens.ts +5 -0
  202. package/tsc-multi.test.json +4 -0
  203. package/tsconfig.json +5 -4
  204. package/dist/cache.js.map +0 -1
  205. package/dist/createNewUtils.js.map +0 -1
  206. package/dist/defaultTokenProvider.js.map +0 -1
  207. package/dist/deltaStorageService.js.map +0 -1
  208. package/dist/documentDeltaConnection.js.map +0 -1
  209. package/dist/documentService.js.map +0 -1
  210. package/dist/documentServiceFactory.js.map +0 -1
  211. package/dist/documentStorageService.js.map +0 -1
  212. package/dist/errorUtils.js.map +0 -1
  213. package/dist/gitManager.js.map +0 -1
  214. package/dist/historian.js.map +0 -1
  215. package/dist/index.js.map +0 -1
  216. package/dist/mapWithExpiration.js.map +0 -1
  217. package/dist/nullBlobStorageService.js.map +0 -1
  218. package/dist/packageVersion.js.map +0 -1
  219. package/dist/policies.js.map +0 -1
  220. package/dist/r11sSnapshotParser.js.map +0 -1
  221. package/dist/restWrapper.js.map +0 -1
  222. package/dist/restWrapperBase.js.map +0 -1
  223. package/dist/retriableGitManager.js.map +0 -1
  224. package/dist/shreddedSummaryDocumentStorageService.js.map +0 -1
  225. package/dist/summaryTreeUploadManager.js.map +0 -1
  226. package/dist/tokens.js.map +0 -1
  227. package/dist/treeUtils.js.map +0 -1
  228. package/dist/urlUtils.js.map +0 -1
  229. package/dist/wholeSummaryDocumentStorageService.js.map +0 -1
  230. package/dist/wholeSummaryUploadManager.js.map +0 -1
  231. package/lib/cache.js.map +0 -1
  232. package/lib/contracts.js.map +0 -1
  233. package/lib/createNewUtils.js.map +0 -1
  234. package/lib/defaultTokenProvider.js.map +0 -1
  235. package/lib/definitions.js.map +0 -1
  236. package/lib/deltaStorageService.js.map +0 -1
  237. package/lib/documentDeltaConnection.js.map +0 -1
  238. package/lib/documentService.js.map +0 -1
  239. package/lib/documentStorageService.js.map +0 -1
  240. package/lib/errorUtils.js.map +0 -1
  241. package/lib/gitManager.js.map +0 -1
  242. package/lib/index.js.map +0 -1
  243. package/lib/mapWithExpiration.js.map +0 -1
  244. package/lib/nullBlobStorageService.js.map +0 -1
  245. package/lib/packageVersion.js.map +0 -1
  246. package/lib/policies.js.map +0 -1
  247. package/lib/r11sSnapshotParser.js.map +0 -1
  248. package/lib/restWrapper.js.map +0 -1
  249. package/lib/restWrapperBase.js.map +0 -1
  250. package/lib/retriableGitManager.js.map +0 -1
  251. package/lib/shreddedSummaryDocumentStorageService.js.map +0 -1
  252. package/lib/storageContracts.js.map +0 -1
  253. package/lib/summaryTreeUploadManager.js.map +0 -1
  254. package/lib/tokens.js.map +0 -1
  255. package/lib/treeUtils.js.map +0 -1
  256. package/lib/urlUtils.js.map +0 -1
  257. package/lib/wholeSummaryDocumentStorageService.js.map +0 -1
  258. package/lib/wholeSummaryUploadManager.js.map +0 -1
  259. package/tsconfig.esnext.json +0 -7
@@ -0,0 +1,268 @@
1
+ import { IDocumentService } from '@fluidframework/driver-definitions';
2
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
3
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
4
+ import { ISession } from '@fluidframework/server-services-client';
5
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
6
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
7
+ import { ITokenClaims } from '@fluidframework/protocol-definitions';
8
+
9
+ /**
10
+ * Default token provider in case the host does not provide one. It simply caches the provided jwt and returns it back.
11
+ * @internal
12
+ */
13
+ export declare class DefaultTokenProvider implements ITokenProvider {
14
+ private readonly jwt;
15
+ constructor(jwt: string);
16
+ fetchOrdererToken(): Promise<ITokenResponse>;
17
+ fetchStorageToken(): Promise<ITokenResponse>;
18
+ }
19
+
20
+ /**
21
+ * Error returned by {@link RouterliciousDocumentServiceFactory.createContainer} when an error is thrown
22
+ * in {@link ITokenProvider.documentPostCreateCallback}.
23
+ * It is the consumer's responsibility to ensure that any state related to container creation is appropriately
24
+ * cleaned up in the event of failure.
25
+ * This includes the document itself, which will have been created by the time this error was thrown.
26
+ *
27
+ * @remarks TODO: examples of suggested actions for recovery.
28
+ * - How would a user delete the created document?
29
+ * - What would a retry pattern look like here?
30
+ * @internal
31
+ */
32
+ export declare class DocumentPostCreateError extends Error {
33
+ /**
34
+ * Inner error being wrapped.
35
+ */
36
+ private readonly innerError;
37
+ constructor(
38
+ /**
39
+ * Inner error being wrapped.
40
+ */
41
+ innerError: Error);
42
+ readonly name = "DocumentPostCreateError";
43
+ get stack(): string | undefined;
44
+ }
45
+
46
+ /**
47
+ * @internal
48
+ */
49
+ export declare interface IRouterliciousDriverPolicies {
50
+ /**
51
+ * Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.
52
+ * Default: true
53
+ */
54
+ enablePrefetch: boolean;
55
+ /**
56
+ * Rate limit concurrent storage requests.
57
+ * Default: 100
58
+ */
59
+ maxConcurrentStorageRequests: number;
60
+ /**
61
+ * Rate limit concurrent orderer requests.
62
+ * Default: 100
63
+ */
64
+ maxConcurrentOrdererRequests: number;
65
+ /**
66
+ * Enable uploading entire summary tree as a IWholeSummaryPayload to storage.
67
+ * Default: false
68
+ */
69
+ enableWholeSummaryUpload: boolean;
70
+ /**
71
+ * Enable service endpoint discovery when creating or joining a session.
72
+ * Default: false
73
+ */
74
+ enableDiscovery: boolean;
75
+ /**
76
+ * Enable using RestLess which avoids CORS preflight requests.
77
+ * Default: true
78
+ */
79
+ enableRestLess: boolean;
80
+ /**
81
+ * Enable internal cache of summaries/snapshots.
82
+ * Reduces Summarizer boot time and reduces server load in E2E tests.
83
+ * Default: true
84
+ */
85
+ enableInternalSummaryCaching: boolean;
86
+ /**
87
+ * Enable downgrading socket connection to long-polling
88
+ * when websocket connection cannot be established.
89
+ * Default: true
90
+ */
91
+ enableLongPollingDowngrade: boolean;
92
+ /**
93
+ * Indicates that the container is ephemeral.
94
+ * Artifacts relates to the container are limited to container lifetime.
95
+ * Default: false
96
+ */
97
+ isEphemeralContainer: boolean;
98
+ }
99
+
100
+ /**
101
+ * Abstracts the token fetching mechanism for a hosting application.
102
+ * The hosting application is responsible for providing an implementation.
103
+ * @alpha
104
+ */
105
+ export declare interface ITokenProvider {
106
+ /**
107
+ * Fetches the orderer token from host.
108
+ *
109
+ * @param tenantId - Tenant ID.
110
+ * @param documentId - Optional. Document ID is only required for document-scoped requests.
111
+ * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
112
+ * This likely indicates that some previous request failed authorization due to an expired token,
113
+ * and so a fresh token is required.
114
+ *
115
+ * Default: `false`.
116
+ *
117
+ * NOTE: This parameter will be made required in the future.
118
+ */
119
+ fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
120
+ /**
121
+ * Fetches the storage token from host.
122
+ *
123
+ * @param tenantId - Tenant ID.
124
+ * @param documentId - Document ID.
125
+ * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
126
+ * This likely indicates that some previous request failed authorization due to an expired token,
127
+ * and so a fresh token is required.
128
+ *
129
+ * Default: `false`.
130
+ *
131
+ * NOTE: This parameter will be made required in the future.
132
+ */
133
+ fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
134
+ /**
135
+ * A callback triggered directly after creating the document. In this callback the client has the opportunity, to
136
+ * verify against an authorization service, if the user who claims to create the document is the same user who
137
+ * created it.
138
+ *
139
+ * @remarks Notes:
140
+ *
141
+ * * Using the callback may have performance impact on the document creation process.
142
+ *
143
+ * * Any exceptions thrown in the callback would fail the creation workflow
144
+ * (see {@link RouterliciousDocumentServiceFactory.createContainer} for more details).
145
+ *
146
+ * @param documentId - Document ID.
147
+ * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
148
+ * and document id. It can be used to validate the identity of the document creator.
149
+ */
150
+ documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
151
+ }
152
+
153
+ /**
154
+ * @alpha
155
+ */
156
+ export declare interface ITokenResponse {
157
+ /**
158
+ * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
159
+ */
160
+ jwt: string;
161
+ /**
162
+ * A flag indicating whether token was obtained from local cache.
163
+ *
164
+ * @remarks `undefined` indicates that the source of the token could not be determined.
165
+ */
166
+ fromCache?: boolean;
167
+ }
168
+
169
+ /**
170
+ * Abstracts the discovery of claims contained within a token.
171
+ * @internal
172
+ */
173
+ export declare interface ITokenService {
174
+ /**
175
+ * Extracts the {@link @fluidframework/protocol-definitions#ITokenClaims | token claims} from the provided
176
+ * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} string representation.
177
+ */
178
+ extractClaims(token: string): ITokenClaims;
179
+ }
180
+
181
+ /**
182
+ * Factory for creating the routerlicious document service. Use this if you want to
183
+ * use the routerlicious implementation.
184
+ * @internal
185
+ */
186
+ export declare class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
187
+ private readonly tokenProvider;
188
+ private readonly driverPolicies;
189
+ private readonly blobCache;
190
+ private readonly wholeSnapshotTreeCache;
191
+ private readonly shreddedSummaryTreeCache;
192
+ constructor(tokenProvider: ITokenProvider, driverPolicies?: Partial<IRouterliciousDriverPolicies>);
193
+ /**
194
+ * {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer}
195
+ *
196
+ * @throws {@link DocumentPostCreateError}
197
+ * If an exception is thrown while invoking the provided {@link ITokenProvider.documentPostCreateCallback}.
198
+ */
199
+ createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
200
+ /**
201
+ * {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createDocumentService}
202
+ *
203
+ * @returns Routerlicious document service.
204
+ */
205
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean, session?: ISession): Promise<IDocumentService>;
206
+ }
207
+
208
+ /**
209
+ * Routerlicious Error types
210
+ * Different error types that may be thrown by the routerlicious driver
211
+ *
212
+ * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
213
+ * @internal
214
+ */
215
+ export declare enum RouterliciousErrorType {
216
+ /**
217
+ * File not found, or file deleted during session
218
+ */
219
+ fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
220
+ /**
221
+ * SSL Certificate Error.
222
+ */
223
+ sslCertError = "sslCertError"
224
+ }
225
+
226
+ /**
227
+ * Routerlicious Error types
228
+ * Different error types that may be thrown by the routerlicious driver
229
+ * @internal
230
+ */
231
+ export declare const RouterliciousErrorTypes: {
232
+ /**
233
+ * SSL Certificate Error.
234
+ */
235
+ readonly sslCertError: "sslCertError";
236
+ readonly genericNetworkError: "genericNetworkError";
237
+ readonly authorizationError: "authorizationError";
238
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
239
+ readonly offlineError: "offlineError";
240
+ /**
241
+ * Routerlicious Error types
242
+ * Different error types that may be thrown by the routerlicious driver
243
+ *
244
+ * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
245
+ * @internal
246
+ */
247
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
248
+ readonly writeError: "writeError";
249
+ readonly fetchFailure: "fetchFailure";
250
+ readonly fetchTokenError: "fetchTokenError";
251
+ readonly incorrectServerResponse: "incorrectServerResponse";
252
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
253
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
254
+ readonly locationRedirection: "locationRedirection";
255
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
256
+ readonly fileIsLocked: "fileIsLocked";
257
+ readonly outOfStorageError: "outOfStorageError";
258
+ readonly genericError: "genericError";
259
+ readonly throttlingError: "throttlingError";
260
+ readonly usageError: "usageError";
261
+ };
262
+
263
+ /**
264
+ * @internal
265
+ */
266
+ export declare type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
267
+
268
+ export { }
@@ -8,9 +8,9 @@ exports.ShreddedSummaryDocumentStorageService = void 0;
8
8
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
9
9
  const client_utils_1 = require("@fluid-internal/client-utils");
10
10
  const protocol_base_1 = require("@fluidframework/protocol-base");
11
- const cache_1 = require("./cache");
12
- const retriableGitManager_1 = require("./retriableGitManager");
13
- const summaryTreeUploadManager_1 = require("./summaryTreeUploadManager");
11
+ const cache_1 = require("./cache.cjs");
12
+ const retriableGitManager_1 = require("./retriableGitManager.cjs");
13
+ const summaryTreeUploadManager_1 = require("./summaryTreeUploadManager.cjs");
14
14
  const isNode = typeof window === "undefined";
15
15
  /**
16
16
  * Document access to underlying storage for routerlicious driver.
@@ -155,4 +155,4 @@ class ShreddedSummaryDocumentStorageService {
155
155
  }
156
156
  }
157
157
  exports.ShreddedSummaryDocumentStorageService = ShreddedSummaryDocumentStorageService;
158
- //# sourceMappingURL=shreddedSummaryDocumentStorageService.js.map
158
+ //# sourceMappingURL=shreddedSummaryDocumentStorageService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shreddedSummaryDocumentStorageService.cjs","sourceRoot":"","sources":["../src/shreddedSummaryDocumentStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAKyC;AACzC,+DAAkF;AAMlF,iEAAsE;AAStE,uCAAgD;AAChD,mEAA4D;AAI5D,6EAAsE;AAEtE,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AAE7C;;;;GAIG;AACH,MAAa,qCAAqC;IAUzC,KAAK,CAAC,uBAAuB;QACpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC/C,OAAO,IAAI,mDAAwB,CAClC,IAAI,yCAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAC7C,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CACvC,CAAC;IACH,CAAC;IAED,YACoB,EAAU,EACV,OAAmB,EACnB,MAA2B,EAC9B,QAAyC,EACzD,cAA6C,EAC7C,SAAmC,EACnC,iBAAgD,EAC/B,oBAEU,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO;QAThC,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAY;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EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC3D,KAAK,CAAC,GAAG,CAAC;gBACT,MAAM,EAAE,QAAQ,CAAC,EAAE;aACnB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QACjB,CAAC,CACD,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,uBAAuB,CACpC,YAAoB;QAEpB,OAAO,YAAY;YAClB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;gBAC1D,mEAAmE;gBACnE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;gBAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,CAAC,CAAC;YACJ,CAAC,CAAC,SAAS,CAAC;IACd,CAAC;IAEO,WAAW,CAAC,MAAc;QACjC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;IAC/B,CAAC;CACD;AArMD,sFAqMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n} from \"@fluidframework/telemetry-utils\";\nimport { stringToBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n\tIDocumentStorageServicePolicies,\n} from \"@fluidframework/driver-definitions\";\nimport { buildGitTreeHierarchy } from \"@fluidframework/protocol-base\";\nimport {\n\tICreateBlobResponse,\n\tISnapshotTreeEx,\n\tISummaryHandle,\n\tISummaryTree,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IRouterliciousDriverPolicies } from \"./policies\";\nimport { ICache, InMemoryCache } from \"./cache\";\nimport { RetriableGitManager } from \"./retriableGitManager\";\nimport { ISnapshotTreeVersion } from \"./definitions\";\nimport { GitManager } from \"./gitManager\";\nimport { ISummaryUploadManager } from \"./storageContracts\";\nimport { SummaryTreeUploadManager } from \"./summaryTreeUploadManager\";\n\nconst isNode = typeof window === \"undefined\";\n\n/**\n * Document access to underlying storage for routerlicious driver.\n * Uploads summaries piece-by-piece traversing the tree recursively.\n * Downloads summaries piece-by-piece on-demand, or up-front when prefetch is enabled.\n */\nexport class ShreddedSummaryDocumentStorageService implements IDocumentStorageService {\n\tprivate readonly mc: MonitoringContext;\n\t// The values of this cache is useless. We only need the keys. So we are always putting\n\t// empty strings as values.\n\tprotected readonly blobsShaCache = new Map<string, string>();\n\tprivate readonly blobCache: ICache<ArrayBufferLike> | undefined;\n\tprivate readonly snapshotTreeCache: ICache<ISnapshotTreeVersion> | undefined;\n\n\tpublic readonly repositoryUrl = \"\";\n\n\tprivate async getSummaryUploadManager(): Promise<ISummaryUploadManager> {\n\t\tconst manager = await this.getStorageManager();\n\t\treturn new SummaryTreeUploadManager(\n\t\t\tnew RetriableGitManager(manager, this.logger),\n\t\t\tthis.blobsShaCache,\n\t\t\tthis.getPreviousFullSnapshot.bind(this),\n\t\t);\n\t}\n\n\tconstructor(\n\t\tprotected readonly id: string,\n\t\tprotected readonly manager: GitManager,\n\t\tprotected readonly logger: ITelemetryLoggerExt,\n\t\tpublic readonly policies: IDocumentStorageServicePolicies,\n\t\tdriverPolicies?: IRouterliciousDriverPolicies,\n\t\tblobCache?: ICache<ArrayBufferLike>,\n\t\tsnapshotTreeCache?: ICache<ISnapshotTreeVersion>,\n\t\tprivate readonly getStorageManager: (\n\t\t\tdisableCache?: boolean,\n\t\t) => Promise<GitManager> = async () => this.manager,\n\t) {\n\t\tif (driverPolicies?.enableRestLess === true || isNode) {\n\t\t\tthis.blobCache = blobCache ?? new InMemoryCache();\n\t\t\tthis.snapshotTreeCache = snapshotTreeCache ?? new InMemoryCache();\n\t\t}\n\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger,\n\t\t});\n\t}\n\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tconst id = versionId ? versionId : this.id;\n\t\tconst commits = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getVersions\",\n\t\t\t\tversionId: id,\n\t\t\t\tcount,\n\t\t\t},\n\t\t\tasync () => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\treturn (await manager.getCommits(id, count)).content;\n\t\t\t},\n\t\t);\n\t\treturn commits.map((commit) => ({\n\t\t\tdate: commit.commit.author.date,\n\t\t\tid: commit.sha,\n\t\t\ttreeId: commit.commit.tree.sha,\n\t\t}));\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null> {\n\t\tlet requestVersion = version;\n\t\tif (!requestVersion) {\n\t\t\tconst versions = await this.getVersions(this.id, 1);\n\t\t\tif (versions.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\trequestVersion = versions[0];\n\t\t}\n\n\t\tconst cachedSnapshotTree = await this.snapshotTreeCache?.get(\n\t\t\tthis.getCacheKey(requestVersion.treeId),\n\t\t);\n\t\tif (cachedSnapshotTree) {\n\t\t\treturn cachedSnapshotTree.snapshotTree as ISnapshotTreeEx;\n\t\t}\n\n\t\tconst rawTree = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getSnapshotTree\",\n\t\t\t\ttreeId: requestVersion.treeId,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = (await manager.getTree(requestVersion!.treeId)).content;\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.tree.length,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t);\n\t\tconst tree = buildGitTreeHierarchy(rawTree, this.blobsShaCache, true);\n\t\tawait this.snapshotTreeCache?.put(this.getCacheKey(tree.id), {\n\t\t\tid: requestVersion.id,\n\t\t\tsnapshotTree: tree,\n\t\t});\n\t\treturn tree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst cachedBlob = await this.blobCache?.get(this.getCacheKey(blobId));\n\t\tif (cachedBlob) {\n\t\t\treturn cachedBlob;\n\t\t}\n\n\t\tconst value = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"readBlob\",\n\t\t\t\tblobId,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = (await manager.getBlob(blobId)).content;\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.size,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t\tundefined, // workers\n\t\t\tundefined, // recordHeapSize\n\t\t\tthis.mc.config.getNumber(\"Fluid.Driver.ReadBlobTelemetrySampling\"),\n\t\t);\n\t\tthis.blobsShaCache.set(value.sha, \"\");\n\t\tconst bufferContent = stringToBuffer(value.content, value.encoding);\n\t\tawait this.blobCache?.put(this.getCacheKey(value.sha), bufferContent);\n\t\treturn bufferContent;\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tconst summaryHandle = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"uploadSummaryWithContext\",\n\t\t\t\tproposalHandle: context.proposalHandle,\n\t\t\t\tackHandle: context.ackHandle,\n\t\t\t\treferenceSequenceNumber: context.referenceSequenceNumber,\n\t\t\t},\n\t\t\tasync () => {\n\t\t\t\tconst summaryUploadManager = await this.getSummaryUploadManager();\n\t\t\t\treturn summaryUploadManager.writeSummaryTree(\n\t\t\t\t\tsummary,\n\t\t\t\t\tcontext.ackHandle ?? \"\",\n\t\t\t\t\t\"channel\",\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\t\treturn summaryHandle;\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\tthrow new Error(\"NOT IMPLEMENTED!\");\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\tconst uint8ArrayFile = new Uint8Array(file);\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"createBlob\",\n\t\t\t\tsize: uint8ArrayFile.length,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = await manager\n\t\t\t\t\t.createBlob(Uint8ArrayToString(uint8ArrayFile, \"base64\"), \"base64\")\n\t\t\t\t\t.then((r) => ({ id: r.content.sha, url: r.content.url }));\n\t\t\t\tevent.end({\n\t\t\t\t\tblobId: response.id,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate async getPreviousFullSnapshot(\n\t\tparentHandle: string,\n\t): Promise<ISnapshotTreeEx | null | undefined> {\n\t\treturn parentHandle\n\t\t\t? this.getVersions(parentHandle, 1).then(async (versions) => {\n\t\t\t\t\t// Clear the cache as the getSnapshotTree call will fill the cache.\n\t\t\t\t\tthis.blobsShaCache.clear();\n\t\t\t\t\treturn this.getSnapshotTree(versions[0]);\n\t\t\t })\n\t\t\t: undefined;\n\t}\n\n\tprivate getCacheKey(blobId: string): string {\n\t\treturn `${this.id}:${blobId}`;\n\t}\n}\n"]}
@@ -4,4 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=storageContracts.js.map
7
+ //# sourceMappingURL=storageContracts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storageContracts.cjs","sourceRoot":"","sources":["../src/storageContracts.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as git from \"@fluidframework/gitresources\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport {\n\tIWholeSummaryPayload,\n\tIWholeSummaryPayloadType,\n\tIWriteSummaryResponse,\n} from \"@fluidframework/server-services-client\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { IWholeFlatSnapshot } from \"./contracts\";\n\n/**\n * Interface to a generic Git provider\n */\nexport interface IHistorian {\n\tgetBlob(sha: string): Promise<IR11sResponse<git.IBlob>>;\n\tcreateBlob(blob: git.ICreateBlobParams): Promise<IR11sResponse<git.ICreateBlobResponse>>;\n\tgetCommits(sha: string, count: number): Promise<IR11sResponse<git.ICommitDetails[]>>;\n\tcreateTree(tree: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>>;\n\tgetTree(sha: string, recursive: boolean): Promise<IR11sResponse<git.ITree>>;\n\tcreateSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial?: boolean,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>>;\n\tgetSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>>;\n}\n\nexport interface IGitManager {\n\tgetCommits(sha: string, count: number): Promise<IR11sResponse<git.ICommitDetails[]>>;\n\tgetTree(root: string, recursive: boolean): Promise<IR11sResponse<git.ITree>>;\n\tgetBlob(sha: string): Promise<IR11sResponse<git.IBlob>>;\n\tcreateBlob(content: string, encoding: string): Promise<IR11sResponse<git.ICreateBlobResponse>>;\n\tcreateGitTree(params: git.ICreateTreeParams): Promise<IR11sResponse<git.ITree>>;\n\tcreateSummary(\n\t\tsummary: IWholeSummaryPayload,\n\t\tinitial?: boolean,\n\t): Promise<IR11sResponse<IWriteSummaryResponse>>;\n\tgetSnapshot(sha: string): Promise<IR11sResponse<IWholeFlatSnapshot>>;\n}\n\n/**\n * Uploads a summary to storage.\n */\nexport interface ISummaryUploadManager {\n\t/**\n\t * Writes summary tree to storage.\n\t * @param summaryTree - Summary tree to write to storage\n\t * @param parentHandle - Parent summary acked handle (if available from summary ack)\n\t * @param summaryType - type of summary being uploaded\n\t * @param sequenceNumber - optional reference sequence number of the summary\n\t * @returns Id of created tree as a string.\n\t */\n\twriteSummaryTree(\n\t\tsummaryTree: api.ISummaryTree,\n\t\tparentHandle: string,\n\t\tsummaryType: IWholeSummaryPayloadType,\n\t\tsequenceNumber?: number,\n\t): Promise<string>;\n}\n"]}
@@ -107,4 +107,4 @@ class SummaryTreeUploadManager {
107
107
  }
108
108
  }
109
109
  exports.SummaryTreeUploadManager = SummaryTreeUploadManager;
110
- //# sourceMappingURL=summaryTreeUploadManager.js.map
110
+ //# sourceMappingURL=summaryTreeUploadManager.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summaryTreeUploadManager.cjs","sourceRoot":"","sources":["../src/summaryTreeUploadManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA0F;AAC1F,2DAAqE;AAErE,iEAAuE;AACvE,+EAK8C;AAI9C;;GAEG;AACH,MAAa,wBAAwB;IACpC,YACkB,OAAoB,EACpB,aAAkC,EAClC,uBAE+B;QAJ/B,YAAO,GAAP,OAAO,CAAa;QACpB,kBAAa,GAAb,aAAa,CAAqB;QAClC,4BAAuB,GAAvB,uBAAuB,CAEQ;IAC9C,CAAC;IAEG,KAAK,CAAC,gBAAgB,CAC5B,WAAyB,EACzB,YAAoB,EACpB,WAAqC,EACrC,cAAuB,EACvB,OAAiB;QAEjB,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE,oBAAoB,IAAI,SAAS,CAAC,CAAC;IAClF,CAAC;IAEO,KAAK,CAAC,oBAAoB,CACjC,WAAyB,EACzB,oBAAiD;QAEjD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG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AAC,KAAK,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACvF,CAAC;CACD;AArID,4DAqIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { gitHashFile, IsoBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { ICreateTreeEntry } from \"@fluidframework/gitresources\";\nimport { getGitMode, getGitType } from \"@fluidframework/protocol-base\";\nimport {\n\tISnapshotTreeEx,\n\tISummaryTree,\n\tSummaryObject,\n\tSummaryType,\n} from \"@fluidframework/protocol-definitions\";\nimport { IWholeSummaryPayloadType } from \"@fluidframework/server-services-client\";\nimport { IGitManager, ISummaryUploadManager } from \"./storageContracts\";\n\n/**\n * Recursively writes summary tree as individual summary blobs.\n */\nexport class SummaryTreeUploadManager implements ISummaryUploadManager {\n\tconstructor(\n\t\tprivate readonly manager: IGitManager,\n\t\tprivate readonly blobsShaCache: Map<string, string>,\n\t\tprivate readonly getPreviousFullSnapshot: (\n\t\t\tparentHandle: string,\n\t\t) => Promise<ISnapshotTreeEx | null | undefined>,\n\t) {}\n\n\tpublic async writeSummaryTree(\n\t\tsummaryTree: ISummaryTree,\n\t\tparentHandle: string,\n\t\tsummaryType: IWholeSummaryPayloadType,\n\t\tsequenceNumber?: number,\n\t\tinitial?: boolean,\n\t): Promise<string> {\n\t\tconst previousFullSnapshot = await this.getPreviousFullSnapshot(parentHandle);\n\t\treturn this.writeSummaryTreeCore(summaryTree, previousFullSnapshot ?? undefined);\n\t}\n\n\tprivate async writeSummaryTreeCore(\n\t\tsummaryTree: ISummaryTree,\n\t\tpreviousFullSnapshot: ISnapshotTreeEx | undefined,\n\t): Promise<string> {\n\t\tconst entries = await Promise.all(\n\t\t\tObject.keys(summaryTree.tree).map(async (key) => {\n\t\t\t\tconst entry = summaryTree.tree[key];\n\t\t\t\tconst pathHandle = await this.writeSummaryTreeObject(entry, previousFullSnapshot);\n\t\t\t\tconst treeEntry: ICreateTreeEntry = {\n\t\t\t\t\tmode: getGitMode(entry),\n\t\t\t\t\tpath: encodeURIComponent(key),\n\t\t\t\t\tsha: pathHandle,\n\t\t\t\t\ttype: getGitType(entry),\n\t\t\t\t};\n\t\t\t\treturn treeEntry;\n\t\t\t}),\n\t\t);\n\n\t\tconst treeHandle = (await this.manager.createGitTree({ tree: entries })).content;\n\t\treturn treeHandle.sha;\n\t}\n\n\tprivate async writeSummaryTreeObject(\n\t\tobject: SummaryObject,\n\t\tpreviousFullSnapshot: ISnapshotTreeEx | undefined,\n\t): Promise<string> {\n\t\tswitch (object.type) {\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\treturn this.writeSummaryBlob(object.content);\n\t\t\t}\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tif (previousFullSnapshot === undefined) {\n\t\t\t\t\tthrow Error(\"Parent summary does not exist to reference by handle.\");\n\t\t\t\t}\n\t\t\t\treturn this.getIdFromPath(object.handleType, object.handle, previousFullSnapshot);\n\t\t\t}\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\treturn this.writeSummaryTreeCore(object, previousFullSnapshot);\n\t\t\t}\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\treturn object.id;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(object, `Unknown type: ${(object as any).type}`);\n\t\t}\n\t}\n\n\tprivate async writeSummaryBlob(content: string | Uint8Array): Promise<string> {\n\t\tconst { parsedContent, encoding } =\n\t\t\ttypeof content === \"string\"\n\t\t\t\t? { parsedContent: content, encoding: \"utf-8\" }\n\t\t\t\t: { parsedContent: Uint8ArrayToString(content, \"base64\"), encoding: \"base64\" };\n\n\t\t// The gitHashFile would return the same hash as returned by the server as blob.sha\n\t\tconst hash = await gitHashFile(IsoBuffer.from(parsedContent, encoding));\n\t\tif (!this.blobsShaCache.has(hash)) {\n\t\t\tthis.blobsShaCache.set(hash, \"\");\n\t\t\tconst blob = (await this.manager.createBlob(parsedContent, encoding)).content;\n\t\t\tassert(hash === blob.sha, 0x0b6 /* \"Blob.sha and hash do not match!!\" */);\n\t\t}\n\t\treturn hash;\n\t}\n\n\tprivate getIdFromPath(\n\t\thandleType: SummaryType,\n\t\thandlePath: string,\n\t\tpreviousFullSnapshot: ISnapshotTreeEx,\n\t): string {\n\t\tconst path = handlePath.split(\"/\").map((part) => decodeURIComponent(part));\n\t\tif (path[0] === \"\") {\n\t\t\t// root of tree should be unnamed\n\t\t\tpath.shift();\n\t\t}\n\t\tif (path.length === 0) {\n\t\t\treturn previousFullSnapshot.id;\n\t\t}\n\n\t\treturn this.getIdFromPathCore(handleType, path, previousFullSnapshot);\n\t}\n\n\tprivate getIdFromPathCore(\n\t\thandleType: SummaryType,\n\t\tpath: string[],\n\t\t/** Previous snapshot, subtree relative to this path part */\n\t\tpreviousSnapshot: ISnapshotTreeEx,\n\t): string {\n\t\tassert(path.length > 0, 0x0b3 /* \"Expected at least 1 path part\" */);\n\t\tconst key = path[0];\n\t\tif (path.length === 1) {\n\t\t\tswitch (handleType) {\n\t\t\t\tcase SummaryType.Blob: {\n\t\t\t\t\tconst tryId = previousSnapshot.blobs[key];\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!tryId,\n\t\t\t\t\t\t0x0b4 /* \"Parent summary does not have blob handle for specified path.\" */,\n\t\t\t\t\t);\n\t\t\t\t\treturn tryId;\n\t\t\t\t}\n\t\t\t\tcase SummaryType.Tree: {\n\t\t\t\t\tconst tryId = previousSnapshot.trees[key]?.id;\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!tryId,\n\t\t\t\t\t\t0x0b5 /* \"Parent summary does not have tree handle for specified path.\" */,\n\t\t\t\t\t);\n\t\t\t\t\treturn tryId;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrow Error(`Unexpected handle summary object type: \"${handleType}\".`);\n\t\t\t}\n\t\t}\n\t\treturn this.getIdFromPathCore(handleType, path.slice(1), previousSnapshot.trees[key]);\n\t}\n}\n"]}
@@ -4,4 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=tokens.js.map
7
+ //# sourceMappingURL=tokens.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.cjs","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITokenClaims } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Abstracts the discovery of claims contained within a token.\n * @internal\n */\nexport interface ITokenService {\n\t/**\n\t * Extracts the {@link @fluidframework/protocol-definitions#ITokenClaims | token claims} from the provided\n\t * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} string representation.\n\t */\n\textractClaims(token: string): ITokenClaims;\n}\n\n/**\n * @alpha\n */\nexport interface ITokenResponse {\n\t/**\n\t * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.\n\t */\n\tjwt: string;\n\n\t/**\n\t * A flag indicating whether token was obtained from local cache.\n\t *\n\t * @remarks `undefined` indicates that the source of the token could not be determined.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Abstracts the token fetching mechanism for a hosting application.\n * The hosting application is responsible for providing an implementation.\n * @alpha\n */\nexport interface ITokenProvider {\n\t/**\n\t * Fetches the orderer token from host.\n\t *\n\t * @param tenantId - Tenant ID.\n\t * @param documentId - Optional. Document ID is only required for document-scoped requests.\n\t * @param refresh - Optional flag indicating whether token fetch must bypass local cache.\n\t * This likely indicates that some previous request failed authorization due to an expired token,\n\t * and so a fresh token is required.\n\t *\n\t * Default: `false`.\n\t *\n\t * NOTE: This parameter will be made required in the future.\n\t */\n\tfetchOrdererToken(\n\t\ttenantId: string,\n\t\tdocumentId?: string,\n\t\trefresh?: boolean,\n\t): Promise<ITokenResponse>;\n\n\t/**\n\t * Fetches the storage token from host.\n\t *\n\t * @param tenantId - Tenant ID.\n\t * @param documentId - Document ID.\n\t * @param refresh - Optional flag indicating whether token fetch must bypass local cache.\n\t * This likely indicates that some previous request failed authorization due to an expired token,\n\t * and so a fresh token is required.\n\t *\n\t * Default: `false`.\n\t *\n\t * NOTE: This parameter will be made required in the future.\n\t */\n\tfetchStorageToken(\n\t\ttenantId: string,\n\t\tdocumentId: string,\n\t\trefresh?: boolean,\n\t): Promise<ITokenResponse>;\n\n\t/**\n\t * A callback triggered directly after creating the document. In this callback the client has the opportunity, to\n\t * verify against an authorization service, if the user who claims to create the document is the same user who\n\t * created it.\n\t *\n\t * @remarks Notes:\n\t *\n\t * * Using the callback may have performance impact on the document creation process.\n\t *\n\t * * Any exceptions thrown in the callback would fail the creation workflow\n\t * (see {@link RouterliciousDocumentServiceFactory.createContainer} for more details).\n\t *\n\t * @param documentId - Document ID.\n\t * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload\n\t * and document id. It can be used to validate the identity of the document creator.\n\t */\n\tdocumentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;\n}\n"]}
package/dist/tokens.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  import { ITokenClaims } from "@fluidframework/protocol-definitions";
6
6
  /**
7
7
  * Abstracts the discovery of claims contained within a token.
8
+ * @internal
8
9
  */
9
10
  export interface ITokenService {
10
11
  /**
@@ -13,6 +14,9 @@ export interface ITokenService {
13
14
  */
14
15
  extractClaims(token: string): ITokenClaims;
15
16
  }
17
+ /**
18
+ * @alpha
19
+ */
16
20
  export interface ITokenResponse {
17
21
  /**
18
22
  * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
@@ -28,6 +32,7 @@ export interface ITokenResponse {
28
32
  /**
29
33
  * Abstracts the token fetching mechanism for a hosting application.
30
34
  * The hosting application is responsible for providing an implementation.
35
+ * @alpha
31
36
  */
32
37
  export interface ITokenProvider {
33
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC;CAC3C;AAED,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;;;;;;;;;;;OAeG;IACH,0BAA0B,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF"}
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;;;;;;;;;;;OAeG;IACH,0BAA0B,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF"}
@@ -104,4 +104,4 @@ function countTreesInSnapshotTree(snapshotTree) {
104
104
  }
105
105
  return numTrees;
106
106
  }
107
- //# sourceMappingURL=treeUtils.js.map
107
+ //# sourceMappingURL=treeUtils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtils.cjs","sourceRoot":"","sources":["../src/treeUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyD;AACzD,2DAAoD;AACpD,+EAK8C;AAa9C;;GAEG;AACH,MAAa,oBAAoB;IAIhC,YAA6B,KAAkC;QAAlC,UAAK,GAAL,KAAK,CAA6B;QAHvD,sBAAiB,GAAW,CAAC,CAAC;QACrB,gBAAW,GAAsC,EAAE,CAAC;IAEH,CAAC;IAEnE;;OAEG;IACH,IAAW,OAAO;QACjB,OAAO;YACN,IAAI,EAAE,kCAAW,CAAC,IAAI;YACtB,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;YAC7B,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY;SACtC,CAAC;IACH,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,GAAW,EAAE,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*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tSummaryType,\n\tISnapshotTree,\n\tISummaryTree,\n\tSummaryObject,\n} from \"@fluidframework/protocol-definitions\";\nimport { INormalizedWholeSnapshot } from \"./contracts\";\n\n/**\n * Summary tree assembler props\n */\nexport interface ISummaryTreeAssemblerProps {\n\t/**\n\t * Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.\n\t */\n\tunreferenced?: true;\n}\n\n/**\n * Summary tree assembler (without stats collection).\n */\nexport class SummaryTreeAssembler {\n\tprivate attachmentCounter: number = 0;\n\tprivate readonly summaryTree: { [path: string]: SummaryObject } = {};\n\n\tconstructor(private readonly props?: ISummaryTreeAssemblerProps) {}\n\n\t/**\n\t * Get final summary\n\t */\n\tpublic get summary(): ISummaryTree {\n\t\treturn {\n\t\t\ttype: SummaryType.Tree,\n\t\t\ttree: { ...this.summaryTree },\n\t\t\tunreferenced: this.props?.unreferenced,\n\t\t};\n\t}\n\n\t/**\n\t * Add blob to summary\n\t */\n\tpublic addBlob(key: string, content: string | Uint8Array): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Blob,\n\t\t\tcontent,\n\t\t};\n\t}\n\n\t/**\n\t * Add handle to summary\n\t */\n\tpublic addHandle(\n\t\tkey: string,\n\t\thandleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment,\n\t\thandle: string,\n\t): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType,\n\t\t\thandle,\n\t\t};\n\t}\n\n\t/**\n\t * Add tree to summary\n\t */\n\tpublic addTree(key: string, summary: ISummaryTree): void {\n\t\tthis.summaryTree[key] = summary;\n\t}\n\n\t/**\n\t * Add attachment to summary\n\t */\n\tpublic addAttachment(id: string) {\n\t\tthis.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };\n\t}\n}\n\n/**\n * Helper function that converts ISnapshotTree and blobs to ISummaryTree\n * @param snapshot - Source snapshot tree\n * @param blobs - Blobs cache\n * @returns Converted snapshot in ISummaryTree format\n */\nexport function convertSnapshotAndBlobsToSummaryTree(\n\tsnapshot: ISnapshotTree,\n\tblobs: Map<string, ArrayBuffer>,\n): ISummaryTree {\n\tconst assembler = new SummaryTreeAssembler({\n\t\tunreferenced: snapshot.unreferenced,\n\t});\n\tfor (const [path, id] of Object.entries(snapshot.blobs)) {\n\t\tconst blob = blobs.get(id);\n\t\tassert(blob !== undefined, 0x2dd /* \"Cannot find blob for a given id\" */);\n\t\tassembler.addBlob(path, IsoBuffer.from(blob).toString(\"utf-8\"));\n\t}\n\tfor (const [key, tree] of Object.entries(snapshot.trees)) {\n\t\tconst subtree = convertSnapshotAndBlobsToSummaryTree(tree, blobs);\n\t\tassembler.addTree(key, subtree);\n\t}\n\treturn assembler.summary;\n}\n\nexport function evalBlobsAndTrees(snapshot: INormalizedWholeSnapshot) {\n\tconst trees = countTreesInSnapshotTree(snapshot.snapshotTree);\n\tconst numBlobs = snapshot.blobs.size;\n\tlet encodedBlobsSize = 0;\n\tfor (const [_, blobContent] of snapshot.blobs) {\n\t\tencodedBlobsSize += blobContent.byteLength;\n\t}\n\treturn { trees, numBlobs, encodedBlobsSize };\n}\n\nexport function validateBlobsAndTrees(snapshot: ISnapshotTree) {\n\tassert(\n\t\tsnapshot.trees !== undefined,\n\t\t0x5d0 /* Returned r11s snapshot is malformed. No trees! */,\n\t);\n\tassert(\n\t\tsnapshot.blobs !== undefined,\n\t\t0x5d1 /* Returned r11s snapshot is malformed. No blobs! */,\n\t);\n}\n\nfunction countTreesInSnapshotTree(snapshotTree: ISnapshotTree): number {\n\tlet numTrees = 0;\n\tfor (const [_, tree] of Object.entries(snapshotTree.trees)) {\n\t\tnumTrees += 1 + countTreesInSnapshotTree(tree);\n\t}\n\treturn numTrees;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.38.0"
8
+ "packageVersion": "7.38.3"
9
9
  }
10
10
  ]
11
11
  }
@@ -44,4 +44,4 @@ const getDiscoveredFluidResolvedUrl = (resolvedUrl, session) => {
44
44
  return discoveredResolvedUrl;
45
45
  };
46
46
  exports.getDiscoveredFluidResolvedUrl = getDiscoveredFluidResolvedUrl;
47
- //# sourceMappingURL=urlUtils.js.map
47
+ //# sourceMappingURL=urlUtils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlUtils.cjs","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,0DAAiC;AAG1B,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAY,EAAE;IAC3D,OAAO,IAAI,mBAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEF;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAU,EAAE,CACtF,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AADnD,QAAA,uBAAuB,2BAC4B;AAEzD,MAAM,6BAA6B,GAAG,CAC5C,WAAyB,EACzB,OAAiB,EACF,EAAE;IACjB,MAAM,oBAAoB,GAAG,IAAI,mBAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,IAAI,mBAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAC5E,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,oBAAoB,GAAG,IAAI,mBAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,IAAI,mBAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClE,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAElD,MAAM,SAAS,GAAG,IAAA,qBAAa,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,qBAAqB,GAAiB;QAC3C,SAAS,EAAE;YACV,eAAe,EAAE,eAAe,CAAC,QAAQ,EAAE;YAC3C,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE;SACjC;QACD,EAAE,EAAE,WAAW,CAAC,EAAE;QAClB,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,GAAG,EAAE,IAAI,mBAAQ,CAAC,WAAW,oBAAoB,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE;KACzF,CAAC;IACF,OAAO,qBAAqB,CAAC;AAC9B,CAAC,CAAC;AA1BW,QAAA,6BAA6B,iCA0BxC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport URLParse from \"url-parse\";\nimport { ISession } from \"@fluidframework/server-services-client\";\n\nexport const parseFluidUrl = (fluidUrl: string): URLParse => {\n\treturn new URLParse(fluidUrl, true);\n};\n\n/**\n * Assume documentId is at end of url path.\n * This is true for Routerlicious' and Tinylicious' documentUrl and deltaStorageUrl.\n * Routerlicious and Tinylicious do not use documentId in storageUrl nor ordererUrl.\n * TODO: Ideally we would be able to regenerate the resolvedUrl, rather than patching the current one.\n */\nexport const replaceDocumentIdInPath = (urlPath: string, documentId: string): string =>\n\turlPath.split(\"/\").slice(0, -1).concat([documentId]).join(\"/\");\n\nexport const getDiscoveredFluidResolvedUrl = (\n\tresolvedUrl: IResolvedUrl,\n\tsession: ISession,\n): IResolvedUrl => {\n\tconst discoveredOrdererUrl = new URLParse(session.ordererUrl);\n\tconst deltaStorageUrl = new URLParse(resolvedUrl.endpoints.deltaStorageUrl);\n\tdeltaStorageUrl.set(\"host\", discoveredOrdererUrl.host);\n\n\tconst discoveredStorageUrl = new URLParse(session.historianUrl);\n\tconst storageUrl = new URLParse(resolvedUrl.endpoints.storageUrl);\n\tstorageUrl.set(\"host\", discoveredStorageUrl.host);\n\n\tconst parsedUrl = parseFluidUrl(resolvedUrl.url);\n\tconst discoveredResolvedUrl: IResolvedUrl = {\n\t\tendpoints: {\n\t\t\tdeltaStorageUrl: deltaStorageUrl.toString(),\n\t\t\tordererUrl: session.ordererUrl,\n\t\t\tdeltaStreamUrl: session.deltaStreamUrl,\n\t\t\tstorageUrl: storageUrl.toString(),\n\t\t},\n\t\tid: resolvedUrl.id,\n\t\ttokens: resolvedUrl.tokens,\n\t\ttype: resolvedUrl.type,\n\t\turl: new URLParse(`fluid://${discoveredOrdererUrl.host}${parsedUrl.pathname}`).toString(),\n\t};\n\treturn discoveredResolvedUrl;\n};\n"]}
@@ -9,10 +9,10 @@ const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
9
9
  const client_utils_1 = require("@fluid-internal/client-utils");
10
10
  const core_utils_1 = require("@fluidframework/core-utils");
11
11
  const driver_base_1 = require("@fluidframework/driver-base");
12
- const cache_1 = require("./cache");
13
- const treeUtils_1 = require("./treeUtils");
14
- const wholeSummaryUploadManager_1 = require("./wholeSummaryUploadManager");
15
- const r11sSnapshotParser_1 = require("./r11sSnapshotParser");
12
+ const cache_1 = require("./cache.cjs");
13
+ const treeUtils_1 = require("./treeUtils.cjs");
14
+ const wholeSummaryUploadManager_1 = require("./wholeSummaryUploadManager.cjs");
15
+ const r11sSnapshotParser_1 = require("./r11sSnapshotParser.cjs");
16
16
  const latestSnapshotId = "latest";
17
17
  class WholeSummaryDocumentStorageService {
18
18
  async getSummaryUploadManager() {
@@ -250,4 +250,4 @@ class WholeSummaryDocumentStorageService {
250
250
  }
251
251
  }
252
252
  exports.WholeSummaryDocumentStorageService = WholeSummaryDocumentStorageService;
253
- //# sourceMappingURL=wholeSummaryDocumentStorageService.js.map
253
+ //# sourceMappingURL=wholeSummaryDocumentStorageService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryDocumentStorageService.cjs","sourceRoot":"","sources":["../src/wholeSummaryDocumentStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAKyC;AACzC,+DAA+F;AAC/F,2DAAoD;AACpD,6DAAgF;AAahF,uCAAgD;AAEhD,+CAIqB;AAErB,+EAAwE;AAIxE,iEAAsF;AAEtF,MAAM,gBAAgB,GAAW,QAAQ,CAAC;AAE1C,MAAa,kCAAkC;IAMtC,KAAK,CAAC,uBAAuB;QACpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC/C,OAAO,IAAI,qDAAyB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,YACoB,EAAU,EACV,OAAmB,EACnB,MAA2B,EAC9B,QAAyC,EACxC,cAA6C,EAC7C,YAAqC,IAAI,qBAAa,EAAE,EACxD,oBAAsD,IAAI,qBAAa,EAAE,EACzE,iBAA8B,EAC9B,oBAEU,KAAK,EAAE,YAAY,EAAE,EAAE,CACjD,YAAY,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS;QACnD,CAAC,CAAC,IAAI,CAAC,iBAAiB;QACxB,CAAC,CAAC,IAAI,CAAC,OAAO;QAbG,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAY;QACnB,WAAM,GAAN,MAAM,CAAqB;QAC9B,aAAQ,GAAR,QAAQ,CAAiC;QACxC,mB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AAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;YAChF,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,KAAK,CAAC;SACnD,CAAC;QAEF,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE3B,OAAO,UAAU,CAAC;IACnB,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,KAA+B;QAC7D,MAAM,cAAc,GAAoB,EAAE,CAAC;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;YAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACtC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC;IAEO,WAAW,CAAC,MAAc;QACjC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;IAC/B,CAAC;CACD;AAtUD,gFAsUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\tPerformanceEvent,\n\tcreateChildMonitoringContext,\n} from \"@fluidframework/telemetry-utils\";\nimport { performance, stringToBuffer, Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { getW3CData, promiseRaceWithWinner } from \"@fluidframework/driver-base\";\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n\tIDocumentStorageServicePolicies,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { ICache, InMemoryCache } from \"./cache\";\nimport { IRouterliciousDriverPolicies } from \"./policies\";\nimport {\n\tconvertSnapshotAndBlobsToSummaryTree,\n\tevalBlobsAndTrees,\n\tvalidateBlobsAndTrees,\n} from \"./treeUtils\";\nimport { GitManager } from \"./gitManager\";\nimport { WholeSummaryUploadManager } from \"./wholeSummaryUploadManager\";\nimport { ISummaryUploadManager } from \"./storageContracts\";\nimport { IR11sResponse } from \"./restWrapper\";\nimport { INormalizedWholeSnapshot, IWholeFlatSnapshot } from \"./contracts\";\nimport { convertWholeFlatSnapshotToSnapshotTreeAndBlobs } from \"./r11sSnapshotParser\";\n\nconst latestSnapshotId: string = \"latest\";\n\nexport class WholeSummaryDocumentStorageService implements IDocumentStorageService {\n\tprivate readonly mc: MonitoringContext;\n\tprivate firstVersionsCall: boolean = true;\n\n\tpublic readonly repositoryUrl = \"\";\n\n\tprivate async getSummaryUploadManager(): Promise<ISummaryUploadManager> {\n\t\tconst manager = await this.getStorageManager();\n\t\treturn new WholeSummaryUploadManager(manager);\n\t}\n\n\tconstructor(\n\t\tprotected readonly id: string,\n\t\tprotected readonly manager: GitManager,\n\t\tprotected readonly logger: ITelemetryLoggerExt,\n\t\tpublic readonly policies: IDocumentStorageServicePolicies,\n\t\tprivate readonly driverPolicies?: IRouterliciousDriverPolicies,\n\t\tprivate readonly blobCache: ICache<ArrayBufferLike> = new InMemoryCache(),\n\t\tprivate readonly snapshotTreeCache: ICache<INormalizedWholeSnapshot> = new InMemoryCache(),\n\t\tprivate readonly noCacheGitManager?: GitManager,\n\t\tprivate readonly getStorageManager: (\n\t\t\tdisableCache?: boolean,\n\t\t) => Promise<GitManager> = async (disableCache) =>\n\t\t\tdisableCache && this.noCacheGitManager !== undefined\n\t\t\t\t? this.noCacheGitManager\n\t\t\t\t: this.manager,\n\t) {\n\t\tthis.mc = createChildMonitoringContext({\n\t\t\tlogger,\n\t\t});\n\t}\n\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n\t\tif (versionId !== this.id && versionId !== null) {\n\t\t\t// Blobs/Trees in this scenario will never have multiple versions, so return versionId as is\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: versionId,\n\t\t\t\t\ttreeId: undefined!,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\t// If this is the first versions call for the document, we know we will want the latest summary.\n\t\t// Fetch latest summary, cache it, and return its id.\n\t\tif (this.firstVersionsCall && count === 1) {\n\t\t\tconst normalizedSnapshotContents = await PerformanceEvent.timedExecAsync(\n\t\t\t\tthis.logger,\n\t\t\t\t{\n\t\t\t\t\teventName: \"ObtainSnapshot\",\n\t\t\t\t\tversionId: versionId ?? undefined,\n\t\t\t\t\tcount,\n\t\t\t\t\tenableDiscovery: this.driverPolicies?.enableDiscovery,\n\t\t\t\t},\n\t\t\t\tasync (event) => {\n\t\t\t\t\tlet method: string;\n\t\t\t\t\tconst cachedSnapshotP = this.snapshotTreeCache.get(\n\t\t\t\t\t\tthis.getCacheKey(latestSnapshotId),\n\t\t\t\t\t);\n\n\t\t\t\t\tconst networkSnapshotP = !this.driverPolicies?.enableDiscovery\n\t\t\t\t\t\t? this.fetchSnapshotTree(latestSnapshotId, false, \"getVersions\")\n\t\t\t\t\t\t: this.fetchSnapshotTree(latestSnapshotId, true, \"getVersions\");\n\n\t\t\t\t\tconst promiseRaceWinner = await promiseRaceWithWinner([\n\t\t\t\t\t\tcachedSnapshotP.catch(() => undefined),\n\t\t\t\t\t\tnetworkSnapshotP.catch(() => undefined),\n\t\t\t\t\t]);\n\n\t\t\t\t\tlet retrievedSnapshot = promiseRaceWinner.value;\n\t\t\t\t\tmethod = promiseRaceWinner.index === 0 ? \"cache\" : \"network\";\n\n\t\t\t\t\tif (retrievedSnapshot === undefined) {\n\t\t\t\t\t\t// if network failed -> wait for cache ( then return network failure)\n\t\t\t\t\t\t// If cache returned empty or failed -> wait for network (success of failure)\n\t\t\t\t\t\tif (promiseRaceWinner.index === 1) {\n\t\t\t\t\t\t\tretrievedSnapshot = await cachedSnapshotP;\n\t\t\t\t\t\t\tmethod = \"cache\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (retrievedSnapshot === undefined) {\n\t\t\t\t\t\t\tretrievedSnapshot = await networkSnapshotP;\n\t\t\t\t\t\t\tmethod = \"network\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevent.end({\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t});\n\t\t\t\t\treturn retrievedSnapshot;\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tconst _id = await this.initializeFromSnapshot(normalizedSnapshotContents);\n\t\t\tthis.firstVersionsCall = false;\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: _id,\n\t\t\t\t\ttreeId: normalizedSnapshotContents.snapshotTree.id!,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\t// Otherwise, get the latest version of the document as normal.\n\t\tconst id = versionId ? versionId : this.id;\n\t\tconst commits = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getVersions\",\n\t\t\t\tversionId: id,\n\t\t\t\tcount,\n\t\t\t},\n\t\t\tasync () => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\treturn (await manager.getCommits(id, count)).content;\n\t\t\t},\n\t\t);\n\t\treturn commits.map((commit) => ({\n\t\t\tdate: commit.commit.author.date,\n\t\t\tid: commit.sha,\n\t\t\ttreeId: commit.commit.tree.sha,\n\t\t}));\n\t}\n\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\tlet requestVersion = version;\n\t\tif (!requestVersion) {\n\t\t\tconst versions = await this.getVersions(this.id, 1);\n\t\t\tif (versions.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\trequestVersion = versions[0];\n\t\t}\n\n\t\tlet normalizedWholeSnapshot = await this.snapshotTreeCache.get(\n\t\t\tthis.getCacheKey(requestVersion.id),\n\t\t);\n\t\tif (normalizedWholeSnapshot !== undefined) {\n\t\t\treturn normalizedWholeSnapshot.snapshotTree;\n\t\t}\n\n\t\tnormalizedWholeSnapshot = await this.fetchSnapshotTree(\n\t\t\trequestVersion.id,\n\t\t\tundefined,\n\t\t\t\"getSnapshotTree\",\n\t\t);\n\n\t\t// Currently retrieving blobs from network is not supported by AFR for WholeSummaryDocumentStorageService\n\t\t// Blobs are expected to be put in the cache\n\t\tawait this.updateBlobsCache(normalizedWholeSnapshot.blobs);\n\n\t\treturn normalizedWholeSnapshot.snapshotTree;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\tconst cachedBlob = await this.blobCache.get(this.getCacheKey(blobId));\n\t\tif (cachedBlob !== undefined) {\n\t\t\treturn cachedBlob;\n\t\t}\n\n\t\t// Note: AFR does not support readBlobs, but potentially other r11s like servers do\n\t\tconst blob = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"readBlob\",\n\t\t\t\tblobId,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = (await manager.getBlob(blobId)).content;\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.size,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t\tundefined, // workers\n\t\t\tundefined, // recordHeapSize\n\t\t\tthis.mc.config.getNumber(\"Fluid.Driver.ReadBlobTelemetrySampling\"),\n\t\t);\n\t\tconst bufferValue = stringToBuffer(blob.content, blob.encoding);\n\n\t\tawait this.blobCache.put(this.getCacheKey(blob.sha), bufferValue);\n\n\t\treturn bufferValue;\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tconst summaryHandle = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"uploadSummaryWithContext\",\n\t\t\t\tproposalHandle: context.proposalHandle,\n\t\t\t\tackHandle: context.ackHandle,\n\t\t\t\treferenceSequenceNumber: context.referenceSequenceNumber,\n\t\t\t},\n\t\t\tasync () => {\n\t\t\t\tconst summaryUploadManager = await this.getSummaryUploadManager();\n\t\t\t\treturn summaryUploadManager.writeSummaryTree(\n\t\t\t\t\tsummary,\n\t\t\t\t\tcontext.ackHandle ?? \"\",\n\t\t\t\t\t\"channel\",\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\t\treturn summaryHandle;\n\t}\n\n\tpublic async downloadSummary(summaryHandle: ISummaryHandle): Promise<ISummaryTree> {\n\t\tconst wholeFlatSnapshot = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getWholeFlatSummary\",\n\t\t\t\ttreeId: summaryHandle.handle,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = await manager.getSnapshot(summaryHandle.handle);\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.content.trees[0]?.entries.length,\n\t\t\t\t});\n\t\t\t\treturn response.content;\n\t\t\t},\n\t\t);\n\n\t\tconst { blobs, snapshotTree } = convertWholeFlatSnapshotToSnapshotTreeAndBlobs(\n\t\t\twholeFlatSnapshot,\n\t\t\t\"\",\n\t\t);\n\t\treturn convertSnapshotAndBlobsToSummaryTree(snapshotTree, blobs);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\tconst uint8ArrayFile = new Uint8Array(file);\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"createBlob\",\n\t\t\t\tsize: uint8ArrayFile.length,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager();\n\t\t\t\tconst response = await manager\n\t\t\t\t\t.createBlob(Uint8ArrayToString(uint8ArrayFile, \"base64\"), \"base64\")\n\t\t\t\t\t.then((r) => ({ id: r.content.sha, url: r.content.url }));\n\t\t\t\tevent.end({\n\t\t\t\t\tblobId: response.id,\n\t\t\t\t});\n\t\t\t\treturn response;\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate async fetchSnapshotTree(\n\t\tversionId: string,\n\t\tdisableCache?: boolean,\n\t\tscenarioName?: string,\n\t): Promise<INormalizedWholeSnapshot> {\n\t\tconst normalizedWholeSummary = await PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"getWholeFlatSummary\",\n\t\t\t\ttreeId: versionId,\n\t\t\t\tscenarioName,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\tconst manager = await this.getStorageManager(disableCache);\n\t\t\t\tconst response: IR11sResponse<IWholeFlatSnapshot> =\n\t\t\t\t\tawait manager.getSnapshot(versionId);\n\t\t\t\tconst start = performance.now();\n\t\t\t\tconst snapshot: INormalizedWholeSnapshot =\n\t\t\t\t\tconvertWholeFlatSnapshotToSnapshotTreeAndBlobs(response.content);\n\t\t\t\tconst snapshotConversionTime = performance.now() - start;\n\t\t\t\tvalidateBlobsAndTrees(snapshot.snapshotTree);\n\t\t\t\tconst { trees, numBlobs, encodedBlobsSize } = evalBlobsAndTrees(snapshot);\n\n\t\t\t\tevent.end({\n\t\t\t\t\tsize: response.content.trees[0]?.entries.length,\n\t\t\t\t\ttrees,\n\t\t\t\t\tblobs: numBlobs,\n\t\t\t\t\tencodedBlobsSize,\n\t\t\t\t\tsequenceNumber: snapshot.sequenceNumber,\n\t\t\t\t\t...response.propsToLog,\n\t\t\t\t\tsnapshotConversionTime,\n\t\t\t\t\t...getW3CData(response.requestUrl, \"xmlhttprequest\"),\n\t\t\t\t});\n\t\t\t\treturn snapshot;\n\t\t\t},\n\t\t);\n\n\t\t// Also add the result into the cache.\n\t\tawait this.snapshotTreeCache\n\t\t\t.put(this.getCacheKey(versionId), normalizedWholeSummary)\n\t\t\t.catch(() => undefined);\n\t\treturn normalizedWholeSummary;\n\t}\n\n\tprivate async initializeFromSnapshot(\n\t\tnormalizedWholeSummary: INormalizedWholeSnapshot,\n\t): Promise<string> {\n\t\tconst snapshotId = normalizedWholeSummary.id;\n\t\tassert(snapshotId !== undefined, 0x275 /* \"Root tree should contain the id\" */);\n\t\tconst cachePs: Promise<any>[] = [\n\t\t\tthis.snapshotTreeCache.put(this.getCacheKey(snapshotId), normalizedWholeSummary),\n\t\t\tthis.updateBlobsCache(normalizedWholeSummary.blobs),\n\t\t];\n\n\t\tawait Promise.all(cachePs);\n\n\t\treturn snapshotId;\n\t}\n\n\tprivate async updateBlobsCache(blobs: Map<string, ArrayBuffer>): Promise<void> {\n\t\tconst blobCachePutPs: Promise<void>[] = [];\n\t\tblobs.forEach((value, id) => {\n\t\t\tconst cacheKey = this.getCacheKey(id);\n\t\t\tblobCachePutPs.push(this.blobCache.put(cacheKey, value));\n\t\t});\n\t\tawait Promise.all(blobCachePutPs);\n\t}\n\n\tprivate getCacheKey(blobId: string): string {\n\t\treturn `${this.id}:${blobId}`;\n\t}\n}\n"]}
@@ -34,4 +34,4 @@ class WholeSummaryUploadManager {
34
34
  }
35
35
  }
36
36
  exports.WholeSummaryUploadManager = WholeSummaryUploadManager;
37
- //# sourceMappingURL=wholeSummaryUploadManager.js.map
37
+ //# sourceMappingURL=wholeSummaryUploadManager.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wholeSummaryUploadManager.cjs","sourceRoot":"","sources":["../src/wholeSummaryUploadManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mFAKgD;AAGhD;;GAEG;AACH,MAAa,yBAAyB;IACrC,YAA6B,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IAAG,CAAC;IAE9C,KAAK,CAAC,gBAAgB,CAC5B,WAAyB,EACzB,YAAgC,EAChC,WAAqC,EACrC,iBAAyB,CAAC,EAC1B,UAAmB,KAAK;QAExB,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,oBAAoB,CACzC,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACd,OAAO,CACP,CAAC;QACF,IAAI,CAAC,EAAE,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SAChD;QACD,OAAO,EAAE,CAAC;IACX,CAAC;IAEO,KAAK,CAAC,oBAAoB,CACjC,YAAgC,EAChC,IAAkB,EAClB,IAA8B,EAC9B,cAAsB,EACtB,OAAgB;QAEhB,MAAM,YAAY,GAAG,IAAA,6DAAoC,EACxD,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAChC,CAAC;QACF,MAAM,eAAe,GAAyB;YAC7C,OAAO,EAAE,YAAY,CAAC,OAAO,IAAI,EAAE;YACnC,OAAO,EAAE,EAAE;YACX,cAAc;YACd,IAAI;SACJ,CAAC;QAEF,OAAO,IAAI,CAAC,OAAO;aACjB,aAAa,CAAC,eAAe,EAAE,OAAO,CAAC;aACvC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACD;AA/CD,8DA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tISummaryTree,\n\tIWholeSummaryPayload,\n\tIWholeSummaryPayloadType,\n\tconvertSummaryTreeToWholeSummaryTree,\n} from \"@fluidframework/server-services-client\";\nimport { IGitManager, ISummaryUploadManager } from \"./storageContracts\";\n\n/**\n * Converts summary to snapshot tree and uploads with single snaphot tree payload.\n */\nexport class WholeSummaryUploadManager implements ISummaryUploadManager {\n\tconstructor(private readonly manager: IGitManager) {}\n\n\tpublic async writeSummaryTree(\n\t\tsummaryTree: ISummaryTree,\n\t\tparentHandle: string | undefined,\n\t\tsummaryType: IWholeSummaryPayloadType,\n\t\tsequenceNumber: number = 0,\n\t\tinitial: boolean = false,\n\t): Promise<string> {\n\t\tconst id = await this.writeSummaryTreeCore(\n\t\t\tparentHandle,\n\t\t\tsummaryTree,\n\t\t\tsummaryType,\n\t\t\tsequenceNumber,\n\t\t\tinitial,\n\t\t);\n\t\tif (!id) {\n\t\t\tthrow new Error(`Failed to write summary tree`);\n\t\t}\n\t\treturn id;\n\t}\n\n\tprivate async writeSummaryTreeCore(\n\t\tparentHandle: string | undefined,\n\t\ttree: ISummaryTree,\n\t\ttype: IWholeSummaryPayloadType,\n\t\tsequenceNumber: number,\n\t\tinitial: boolean,\n\t): Promise<string> {\n\t\tconst snapshotTree = convertSummaryTreeToWholeSummaryTree(\n\t\t\tparentHandle,\n\t\t\ttree,\n\t\t\t\"\",\n\t\t\ttype === \"channel\" ? \".app\" : \"\",\n\t\t);\n\t\tconst snapshotPayload: IWholeSummaryPayload = {\n\t\t\tentries: snapshotTree.entries ?? [],\n\t\t\tmessage: \"\",\n\t\t\tsequenceNumber,\n\t\t\ttype,\n\t\t};\n\n\t\treturn this.manager\n\t\t\t.createSummary(snapshotPayload, initial)\n\t\t\t.then((response) => response.content.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 { MapWithExpiration } from "./mapWithExpiration";
5
+ import { MapWithExpiration } from "./mapWithExpiration.mjs";
6
6
  /** A basic in-memory cache that optionally supports expiring entries after a period of inactivity */
7
7
  export class InMemoryCache {
8
8
  constructor(expirationMs) {
@@ -22,4 +22,4 @@ export class NullCache {
22
22
  }
23
23
  async put(key, value) { }
24
24
  }
25
- //# sourceMappingURL=cache.js.map
25
+ //# sourceMappingURL=cache.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.mjs","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,iBAAiB,EAAE;AAO5B,qGAAqG;AACrG,MAAM,OAAO,aAAa;IAGzB,YAAY,YAAqB;QAChC,IAAI,CAAC,KAAK,GAAG,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IAC3F,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAW;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAQ;QACrC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CACD;AAED,yEAAyE;AACzE,MAAM,OAAO,SAAS;IACd,KAAK,CAAC,GAAG,CAAC,GAAW;QAC3B,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAQ,IAAkB,CAAC;CACzD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { MapWithExpiration } from \"./mapWithExpiration\";\n\nexport interface ICache<T> {\n\tget(key: string): Promise<T | undefined>;\n\tput(key: string, value: T): Promise<void>;\n}\n\n/** A basic in-memory cache that optionally supports expiring entries after a period of inactivity */\nexport class InMemoryCache<T> implements ICache<T> {\n\tprivate readonly cache: Map<string, T>;\n\n\tconstructor(expirationMs?: number) {\n\t\tthis.cache = expirationMs !== undefined ? new MapWithExpiration(expirationMs) : new Map();\n\t}\n\n\tpublic async get(key: string): Promise<T | undefined> {\n\t\treturn this.cache.get(key);\n\t}\n\n\tpublic async put(key: string, value: T): Promise<void> {\n\t\tthis.cache.set(key, value);\n\t}\n}\n\n/** This \"cache\" does nothing on put, and get always returns undefined */\nexport class NullCache<T> implements ICache<T> {\n\tpublic async get(key: string): Promise<T | undefined> {\n\t\treturn undefined;\n\t}\n\n\tpublic async put(key: string, value: T): Promise<void> {}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAQrE,MAAM,WAAW,+BAA+B;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IAEb,YAAY,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,+BAA+B;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,2BAA2B,GACpC,+BAA+B,GAC/B,+BAA+B,CAAC;AAEnC,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IAElC,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAChC,YAAY,EAAE,aAAa,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;CACX"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,aAAa,EAAE,MAAM,sCAAsC;AAQpE,MAAM,WAAW,+BAA+B;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IAEb,YAAY,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,+BAA+B;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,2BAA2B,GACpC,+BAA+B,GAC/B,+BAA+B,CAAC;AAEnC,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IAElC,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAChC,YAAY,EAAE,aAAa,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;CACX"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=policies.js.map
6
+ //# sourceMappingURL=contracts.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\n\n/*\n *\n * Whole Snapshot Download Data Structures\n *\n */\n\nexport interface IWholeFlatSnapshotTreeEntryTree {\n\tpath: string;\n\ttype: \"tree\";\n\t// Indicates that this tree entry is unreferenced. If this is not present, the tree entry is considered referenced.\n\tunreferenced?: true;\n}\n\nexport interface IWholeFlatSnapshotTreeEntryBlob {\n\tid: string;\n\tpath: string;\n\ttype: \"blob\";\n}\n\nexport type IWholeFlatSnapshotTreeEntry =\n\t| IWholeFlatSnapshotTreeEntryTree\n\t| IWholeFlatSnapshotTreeEntryBlob;\n\nexport interface IWholeFlatSnapshotTree {\n\tentries: IWholeFlatSnapshotTreeEntry[];\n\tid: string;\n\tsequenceNumber: number;\n}\n\nexport interface IWholeFlatSnapshotBlob {\n\tcontent: string;\n\tencoding: \"base64\" | \"utf-8\";\n\tid: string;\n\tsize: number;\n}\n\nexport interface IWholeFlatSnapshot {\n\t// The same as the id of the first snapshot tree in the trees array.\n\tid: string;\n\t// Receive an array of snapshot trees for future-proofing, however, always length 1 for now.\n\ttrees: IWholeFlatSnapshotTree[];\n\tblobs?: IWholeFlatSnapshotBlob[];\n}\n\n/**\n * Normalized Whole Summary with decoded blobs and unflattened snapshot tree.\n */\nexport interface INormalizedWholeSnapshot {\n\tblobs: Map<string, ArrayBuffer>;\n\tsnapshotTree: ISnapshotTree;\n\tsequenceNumber: number | undefined;\n\tid: string;\n}\n"]}
1
+ {"version":3,"file":"contracts.mjs","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\n\n/*\n *\n * Whole Snapshot Download Data Structures\n *\n */\n\nexport interface IWholeFlatSnapshotTreeEntryTree {\n\tpath: string;\n\ttype: \"tree\";\n\t// Indicates that this tree entry is unreferenced. If this is not present, the tree entry is considered referenced.\n\tunreferenced?: true;\n}\n\nexport interface IWholeFlatSnapshotTreeEntryBlob {\n\tid: string;\n\tpath: string;\n\ttype: \"blob\";\n}\n\nexport type IWholeFlatSnapshotTreeEntry =\n\t| IWholeFlatSnapshotTreeEntryTree\n\t| IWholeFlatSnapshotTreeEntryBlob;\n\nexport interface IWholeFlatSnapshotTree {\n\tentries: IWholeFlatSnapshotTreeEntry[];\n\tid: string;\n\tsequenceNumber: number;\n}\n\nexport interface IWholeFlatSnapshotBlob {\n\tcontent: string;\n\tencoding: \"base64\" | \"utf-8\";\n\tid: string;\n\tsize: number;\n}\n\nexport interface IWholeFlatSnapshot {\n\t// The same as the id of the first snapshot tree in the trees array.\n\tid: string;\n\t// Receive an array of snapshot trees for future-proofing, however, always length 1 for now.\n\ttrees: IWholeFlatSnapshotTree[];\n\tblobs?: IWholeFlatSnapshotBlob[];\n}\n\n/**\n * Normalized Whole Summary with decoded blobs and unflattened snapshot tree.\n */\nexport interface INormalizedWholeSnapshot {\n\tblobs: Map<string, ArrayBuffer>;\n\tsnapshotTree: ISnapshotTree;\n\tsequenceNumber: number | undefined;\n\tid: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createNewUtils.d.ts","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAe,MAAM,sCAAsC,CAAC;AAEjF;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CA2BpF"}
1
+ {"version":3,"file":"createNewUtils.d.ts","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,YAAY,EAAe,MAAM,sCAAsC;AAEhF;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CA2BpF"}
@@ -35,4 +35,4 @@ export function convertSummaryToCreateNewSummary(summary) {
35
35
  }
36
36
  return summary;
37
37
  }
38
- //# sourceMappingURL=createNewUtils.js.map
38
+ //# sourceMappingURL=createNewUtils.mjs.map