@fluidframework/routerlicious-driver 2.0.0-dev.2.2.0.111723 → 2.0.0-dev.3.1.0.125672

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 (147) hide show
  1. package/.eslintrc.js +10 -12
  2. package/.mocharc.js +2 -2
  3. package/README.md +1 -1
  4. package/api-extractor.json +2 -2
  5. package/dist/cache.d.ts +3 -0
  6. package/dist/cache.d.ts.map +1 -1
  7. package/dist/cache.js +6 -4
  8. package/dist/cache.js.map +1 -1
  9. package/dist/createNewUtils.d.ts.map +1 -1
  10. package/dist/createNewUtils.js +4 -2
  11. package/dist/createNewUtils.js.map +1 -1
  12. package/dist/defaultTokenProvider.d.ts.map +1 -1
  13. package/dist/defaultTokenProvider.js.map +1 -1
  14. package/dist/definitions.d.ts.map +1 -1
  15. package/dist/definitions.js.map +1 -1
  16. package/dist/deltaStorageService.d.ts.map +1 -1
  17. package/dist/deltaStorageService.js +4 -1
  18. package/dist/deltaStorageService.js.map +1 -1
  19. package/dist/documentDeltaConnection.d.ts.map +1 -1
  20. package/dist/documentDeltaConnection.js.map +1 -1
  21. package/dist/documentService.d.ts +4 -2
  22. package/dist/documentService.d.ts.map +1 -1
  23. package/dist/documentService.js +22 -41
  24. package/dist/documentService.js.map +1 -1
  25. package/dist/documentServiceFactory.d.ts.map +1 -1
  26. package/dist/documentServiceFactory.js +23 -9
  27. package/dist/documentServiceFactory.js.map +1 -1
  28. package/dist/documentStorageService.d.ts +1 -1
  29. package/dist/documentStorageService.d.ts.map +1 -1
  30. package/dist/documentStorageService.js +8 -6
  31. package/dist/documentStorageService.js.map +1 -1
  32. package/dist/errorUtils.d.ts +2 -1
  33. package/dist/errorUtils.d.ts.map +1 -1
  34. package/dist/errorUtils.js +6 -0
  35. package/dist/errorUtils.js.map +1 -1
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/nullBlobStorageService.d.ts.map +1 -1
  40. package/dist/nullBlobStorageService.js.map +1 -1
  41. package/dist/packageVersion.d.ts +1 -1
  42. package/dist/packageVersion.js +1 -1
  43. package/dist/packageVersion.js.map +1 -1
  44. package/dist/policies.d.ts.map +1 -1
  45. package/dist/policies.js.map +1 -1
  46. package/dist/restWrapper.d.ts +10 -7
  47. package/dist/restWrapper.d.ts.map +1 -1
  48. package/dist/restWrapper.js +42 -44
  49. package/dist/restWrapper.js.map +1 -1
  50. package/dist/retriableGitManager.d.ts.map +1 -1
  51. package/dist/retriableGitManager.js.map +1 -1
  52. package/dist/shreddedSummaryDocumentStorageService.d.ts +1 -1
  53. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  54. package/dist/shreddedSummaryDocumentStorageService.js +9 -5
  55. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  56. package/dist/tokens.d.ts.map +1 -1
  57. package/dist/tokens.js.map +1 -1
  58. package/dist/urlUtils.d.ts.map +1 -1
  59. package/dist/urlUtils.js.map +1 -1
  60. package/dist/wholeSummaryDocumentStorageService.d.ts +1 -1
  61. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  62. package/dist/wholeSummaryDocumentStorageService.js +25 -11
  63. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  64. package/lib/cache.d.ts +3 -0
  65. package/lib/cache.d.ts.map +1 -1
  66. package/lib/cache.js +6 -4
  67. package/lib/cache.js.map +1 -1
  68. package/lib/createNewUtils.d.ts.map +1 -1
  69. package/lib/createNewUtils.js +4 -2
  70. package/lib/createNewUtils.js.map +1 -1
  71. package/lib/defaultTokenProvider.d.ts.map +1 -1
  72. package/lib/defaultTokenProvider.js.map +1 -1
  73. package/lib/definitions.d.ts.map +1 -1
  74. package/lib/definitions.js.map +1 -1
  75. package/lib/deltaStorageService.d.ts.map +1 -1
  76. package/lib/deltaStorageService.js +4 -1
  77. package/lib/deltaStorageService.js.map +1 -1
  78. package/lib/documentDeltaConnection.d.ts.map +1 -1
  79. package/lib/documentDeltaConnection.js.map +1 -1
  80. package/lib/documentService.d.ts +4 -2
  81. package/lib/documentService.d.ts.map +1 -1
  82. package/lib/documentService.js +22 -22
  83. package/lib/documentService.js.map +1 -1
  84. package/lib/documentServiceFactory.d.ts.map +1 -1
  85. package/lib/documentServiceFactory.js +23 -9
  86. package/lib/documentServiceFactory.js.map +1 -1
  87. package/lib/documentStorageService.d.ts +1 -1
  88. package/lib/documentStorageService.d.ts.map +1 -1
  89. package/lib/documentStorageService.js +9 -7
  90. package/lib/documentStorageService.js.map +1 -1
  91. package/lib/errorUtils.d.ts +2 -1
  92. package/lib/errorUtils.d.ts.map +1 -1
  93. package/lib/errorUtils.js +6 -0
  94. package/lib/errorUtils.js.map +1 -1
  95. package/lib/index.d.ts +1 -1
  96. package/lib/index.d.ts.map +1 -1
  97. package/lib/index.js +1 -1
  98. package/lib/index.js.map +1 -1
  99. package/lib/nullBlobStorageService.d.ts.map +1 -1
  100. package/lib/nullBlobStorageService.js.map +1 -1
  101. package/lib/packageVersion.d.ts +1 -1
  102. package/lib/packageVersion.js +1 -1
  103. package/lib/packageVersion.js.map +1 -1
  104. package/lib/policies.d.ts.map +1 -1
  105. package/lib/policies.js.map +1 -1
  106. package/lib/restWrapper.d.ts +10 -7
  107. package/lib/restWrapper.d.ts.map +1 -1
  108. package/lib/restWrapper.js +42 -44
  109. package/lib/restWrapper.js.map +1 -1
  110. package/lib/retriableGitManager.d.ts.map +1 -1
  111. package/lib/retriableGitManager.js.map +1 -1
  112. package/lib/shreddedSummaryDocumentStorageService.d.ts +1 -1
  113. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  114. package/lib/shreddedSummaryDocumentStorageService.js +10 -6
  115. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
  116. package/lib/tokens.d.ts.map +1 -1
  117. package/lib/tokens.js.map +1 -1
  118. package/lib/urlUtils.d.ts.map +1 -1
  119. package/lib/urlUtils.js.map +1 -1
  120. package/lib/wholeSummaryDocumentStorageService.d.ts +1 -1
  121. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  122. package/lib/wholeSummaryDocumentStorageService.js +27 -13
  123. package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
  124. package/package.json +19 -15
  125. package/prettier.config.cjs +1 -1
  126. package/src/cache.ts +21 -14
  127. package/src/createNewUtils.ts +24 -22
  128. package/src/defaultTokenProvider.ts +13 -15
  129. package/src/definitions.ts +2 -2
  130. package/src/deltaStorageService.ts +99 -95
  131. package/src/documentDeltaConnection.ts +53 -47
  132. package/src/documentService.ts +243 -239
  133. package/src/documentServiceFactory.ts +267 -237
  134. package/src/documentStorageService.ts +87 -83
  135. package/src/errorUtils.ts +78 -75
  136. package/src/index.ts +4 -1
  137. package/src/nullBlobStorageService.ts +24 -21
  138. package/src/packageVersion.ts +1 -1
  139. package/src/policies.ts +44 -44
  140. package/src/restWrapper.ts +275 -209
  141. package/src/retriableGitManager.ts +152 -151
  142. package/src/shreddedSummaryDocumentStorageService.ts +202 -194
  143. package/src/tokens.ts +51 -43
  144. package/src/urlUtils.ts +26 -23
  145. package/src/wholeSummaryDocumentStorageService.ts +246 -228
  146. package/tsconfig.esnext.json +6 -6
  147. package/tsconfig.json +9 -13
@@ -6,160 +6,161 @@
6
6
  import type * as git from "@fluidframework/gitresources";
7
7
  import type * as protocol from "@fluidframework/protocol-definitions";
8
8
  import {
9
- IGitManager,
10
- IWholeFlatSummary,
11
- IWholeSummaryPayload,
12
- IWriteSummaryResponse,
9
+ IGitManager,
10
+ IWholeFlatSummary,
11
+ IWholeSummaryPayload,
12
+ IWriteSummaryResponse,
13
13
  } from "@fluidframework/server-services-client";
14
14
  import { runWithRetry } from "@fluidframework/driver-utils";
15
15
  import { ITelemetryLogger } from "@fluidframework/common-definitions";
16
16
 
17
17
  export class RetriableGitManager implements IGitManager {
18
- constructor(
19
- private readonly internalGitManager: IGitManager,
20
- private readonly logger: ITelemetryLogger,
21
- ) {
22
- }
23
-
24
- public async getHeader(id: string, sha: string): Promise<protocol.ISnapshotTree> {
25
- return this.runWithRetry(
26
- async () => this.internalGitManager.getHeader(id, sha),
27
- "gitManager_getHeader",
28
- );
29
- }
30
-
31
- public async getFullTree(sha: string): Promise<any> {
32
- return this.runWithRetry(
33
- async () => this.internalGitManager.getFullTree(sha),
34
- "gitManager_getFullTree",
35
- );
36
- }
37
-
38
- public async getCommit(sha: string): Promise<git.ICommit> {
39
- return this.runWithRetry(
40
- async () => this.internalGitManager.getCommit(sha),
41
- "gitManager_getCommit",
42
- );
43
- }
44
-
45
- public async getCommits(sha: string, count: number): Promise<git.ICommitDetails[]> {
46
- return this.runWithRetry(
47
- async () => this.internalGitManager.getCommits(sha, count),
48
- "gitManager_getCommits",
49
- );
50
- }
51
-
52
- public async getTree(root: string, recursive: boolean): Promise<git.ITree> {
53
- return this.runWithRetry(
54
- async () => this.internalGitManager.getTree(root, recursive),
55
- "gitManager_getTree",
56
- );
57
- }
58
-
59
- public async getBlob(sha: string): Promise<git.IBlob> {
60
- return this.runWithRetry(
61
- async () => this.internalGitManager.getBlob(sha),
62
- "gitManager_getBlob",
63
- );
64
- }
65
-
66
- public getRawUrl(sha: string): string {
67
- return this.internalGitManager.getRawUrl(sha);
68
- }
69
-
70
- public async getContent(commit: string, path: string): Promise<git.IBlob> {
71
- return this.runWithRetry(
72
- async () => this.internalGitManager.getContent(commit, path),
73
- "gitManager_getContent",
74
- );
75
- }
76
-
77
- public async createBlob(content: string, encoding: string): Promise<git.ICreateBlobResponse> {
78
- return this.runWithRetry(
79
- async () => this.internalGitManager.createBlob(content, encoding),
80
- "gitManager_createBlob",
81
- );
82
- }
83
-
84
- public async createGitTree(params: git.ICreateTreeParams): Promise<git.ITree> {
85
- return this.runWithRetry(
86
- async () => this.internalGitManager.createGitTree(params),
87
- "gitManager_createGitTree",
88
- );
89
- }
90
-
91
- public async createTree(files: protocol.ITree): Promise<git.ITree> {
92
- return this.runWithRetry(
93
- async () => this.internalGitManager.createTree(files),
94
- "gitManager_createTree",
95
- );
96
- }
97
-
98
- public async createCommit(commit: git.ICreateCommitParams): Promise<git.ICommit> {
99
- return this.runWithRetry(
100
- async () => this.internalGitManager.createCommit(commit),
101
- "gitManager_createCommit",
102
- );
103
- }
104
-
105
- public async getRef(ref: string): Promise<git.IRef> {
106
- return this.runWithRetry(
107
- async () => this.internalGitManager.getRef(ref),
108
- "gitManager_getRef",
109
- );
110
- }
111
-
112
- public async createRef(branch: string, sha: string): Promise<git.IRef> {
113
- return this.runWithRetry(
114
- async () => this.internalGitManager.createRef(branch, sha),
115
- "gitManager_createRef",
116
- );
117
- }
118
-
119
- public async upsertRef(branch: string, commitSha: string): Promise<git.IRef> {
120
- return this.runWithRetry(
121
- async () => this.internalGitManager.upsertRef(branch, commitSha),
122
- "gitManager_upsertRef",
123
- );
124
- }
125
-
126
- public async write(branch: string,
127
- inputTree: protocol.ITree,
128
- parents: string[],
129
- message: string): Promise<git.ICommit> {
130
- return this.runWithRetry(
131
- async () => this.internalGitManager.write(branch, inputTree, parents, message),
132
- "gitManager_write",
133
- );
134
- }
135
-
136
- public async createSummary(summary: IWholeSummaryPayload): Promise<IWriteSummaryResponse> {
137
- return this.runWithRetry(
138
- async () => this.internalGitManager.createSummary(summary),
139
- "gitManager_createSummary",
140
- );
141
- }
142
-
143
- public async deleteSummary(softDelete: boolean): Promise<void> {
144
- return this.runWithRetry(
145
- async () => this.internalGitManager.deleteSummary(softDelete),
146
- "gitManager_deleteSummary",
147
- );
148
- }
149
-
150
- public async getSummary(sha: string): Promise<IWholeFlatSummary> {
151
- return this.runWithRetry(
152
- async () => this.internalGitManager.getSummary(sha),
153
- "gitManager_getSummary",
154
- );
155
- }
156
-
157
- private async runWithRetry<T>(api: () => Promise<T>, callName: string): Promise<T> {
158
- return runWithRetry(
159
- api,
160
- callName,
161
- this.logger,
162
- {}, // progress
163
- );
164
- }
18
+ constructor(
19
+ private readonly internalGitManager: IGitManager,
20
+ private readonly logger: ITelemetryLogger,
21
+ ) {}
22
+
23
+ public async getHeader(id: string, sha: string): Promise<protocol.ISnapshotTree> {
24
+ return this.runWithRetry(
25
+ async () => this.internalGitManager.getHeader(id, sha),
26
+ "gitManager_getHeader",
27
+ );
28
+ }
29
+
30
+ public async getFullTree(sha: string): Promise<any> {
31
+ return this.runWithRetry(
32
+ async () => this.internalGitManager.getFullTree(sha),
33
+ "gitManager_getFullTree",
34
+ );
35
+ }
36
+
37
+ public async getCommit(sha: string): Promise<git.ICommit> {
38
+ return this.runWithRetry(
39
+ async () => this.internalGitManager.getCommit(sha),
40
+ "gitManager_getCommit",
41
+ );
42
+ }
43
+
44
+ public async getCommits(sha: string, count: number): Promise<git.ICommitDetails[]> {
45
+ return this.runWithRetry(
46
+ async () => this.internalGitManager.getCommits(sha, count),
47
+ "gitManager_getCommits",
48
+ );
49
+ }
50
+
51
+ public async getTree(root: string, recursive: boolean): Promise<git.ITree> {
52
+ return this.runWithRetry(
53
+ async () => this.internalGitManager.getTree(root, recursive),
54
+ "gitManager_getTree",
55
+ );
56
+ }
57
+
58
+ public async getBlob(sha: string): Promise<git.IBlob> {
59
+ return this.runWithRetry(
60
+ async () => this.internalGitManager.getBlob(sha),
61
+ "gitManager_getBlob",
62
+ );
63
+ }
64
+
65
+ public getRawUrl(sha: string): string {
66
+ return this.internalGitManager.getRawUrl(sha);
67
+ }
68
+
69
+ public async getContent(commit: string, path: string): Promise<git.IBlob> {
70
+ return this.runWithRetry(
71
+ async () => this.internalGitManager.getContent(commit, path),
72
+ "gitManager_getContent",
73
+ );
74
+ }
75
+
76
+ public async createBlob(content: string, encoding: string): Promise<git.ICreateBlobResponse> {
77
+ return this.runWithRetry(
78
+ async () => this.internalGitManager.createBlob(content, encoding),
79
+ "gitManager_createBlob",
80
+ );
81
+ }
82
+
83
+ public async createGitTree(params: git.ICreateTreeParams): Promise<git.ITree> {
84
+ return this.runWithRetry(
85
+ async () => this.internalGitManager.createGitTree(params),
86
+ "gitManager_createGitTree",
87
+ );
88
+ }
89
+
90
+ public async createTree(files: protocol.ITree): Promise<git.ITree> {
91
+ return this.runWithRetry(
92
+ async () => this.internalGitManager.createTree(files),
93
+ "gitManager_createTree",
94
+ );
95
+ }
96
+
97
+ public async createCommit(commit: git.ICreateCommitParams): Promise<git.ICommit> {
98
+ return this.runWithRetry(
99
+ async () => this.internalGitManager.createCommit(commit),
100
+ "gitManager_createCommit",
101
+ );
102
+ }
103
+
104
+ public async getRef(ref: string): Promise<git.IRef> {
105
+ return this.runWithRetry(
106
+ async () => this.internalGitManager.getRef(ref),
107
+ "gitManager_getRef",
108
+ );
109
+ }
110
+
111
+ public async createRef(branch: string, sha: string): Promise<git.IRef> {
112
+ return this.runWithRetry(
113
+ async () => this.internalGitManager.createRef(branch, sha),
114
+ "gitManager_createRef",
115
+ );
116
+ }
117
+
118
+ public async upsertRef(branch: string, commitSha: string): Promise<git.IRef> {
119
+ return this.runWithRetry(
120
+ async () => this.internalGitManager.upsertRef(branch, commitSha),
121
+ "gitManager_upsertRef",
122
+ );
123
+ }
124
+
125
+ public async write(
126
+ branch: string,
127
+ inputTree: protocol.ITree,
128
+ parents: string[],
129
+ message: string,
130
+ ): Promise<git.ICommit> {
131
+ return this.runWithRetry(
132
+ async () => this.internalGitManager.write(branch, inputTree, parents, message),
133
+ "gitManager_write",
134
+ );
135
+ }
136
+
137
+ public async createSummary(summary: IWholeSummaryPayload): Promise<IWriteSummaryResponse> {
138
+ return this.runWithRetry(
139
+ async () => this.internalGitManager.createSummary(summary),
140
+ "gitManager_createSummary",
141
+ );
142
+ }
143
+
144
+ public async deleteSummary(softDelete: boolean): Promise<void> {
145
+ return this.runWithRetry(
146
+ async () => this.internalGitManager.deleteSummary(softDelete),
147
+ "gitManager_deleteSummary",
148
+ );
149
+ }
150
+
151
+ public async getSummary(sha: string): Promise<IWholeFlatSummary> {
152
+ return this.runWithRetry(
153
+ async () => this.internalGitManager.getSummary(sha),
154
+ "gitManager_getSummary",
155
+ );
156
+ }
157
+
158
+ private async runWithRetry<T>(api: () => Promise<T>, callName: string): Promise<T> {
159
+ return runWithRetry(
160
+ api,
161
+ callName,
162
+ this.logger,
163
+ {}, // progress
164
+ );
165
+ }
165
166
  }