@fluidframework/routerlicious-driver 2.0.0-internal.3.0.1 → 2.0.0-internal.3.1.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 (138) 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.map +1 -1
  6. package/dist/cache.js +2 -5
  7. package/dist/cache.js.map +1 -1
  8. package/dist/createNewUtils.d.ts.map +1 -1
  9. package/dist/createNewUtils.js +4 -2
  10. package/dist/createNewUtils.js.map +1 -1
  11. package/dist/defaultTokenProvider.d.ts.map +1 -1
  12. package/dist/defaultTokenProvider.js.map +1 -1
  13. package/dist/definitions.d.ts.map +1 -1
  14. package/dist/definitions.js.map +1 -1
  15. package/dist/deltaStorageService.d.ts.map +1 -1
  16. package/dist/deltaStorageService.js +4 -1
  17. package/dist/deltaStorageService.js.map +1 -1
  18. package/dist/documentDeltaConnection.d.ts.map +1 -1
  19. package/dist/documentDeltaConnection.js.map +1 -1
  20. package/dist/documentService.d.ts.map +1 -1
  21. package/dist/documentService.js +13 -5
  22. package/dist/documentService.js.map +1 -1
  23. package/dist/documentServiceFactory.d.ts.map +1 -1
  24. package/dist/documentServiceFactory.js +7 -4
  25. package/dist/documentServiceFactory.js.map +1 -1
  26. package/dist/documentStorageService.d.ts.map +1 -1
  27. package/dist/documentStorageService.js +7 -5
  28. package/dist/documentStorageService.js.map +1 -1
  29. package/dist/errorUtils.d.ts +9 -2
  30. package/dist/errorUtils.d.ts.map +1 -1
  31. package/dist/errorUtils.js +15 -8
  32. package/dist/errorUtils.js.map +1 -1
  33. package/dist/index.d.ts +2 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +4 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/nullBlobStorageService.d.ts.map +1 -1
  38. package/dist/nullBlobStorageService.js.map +1 -1
  39. package/dist/packageVersion.d.ts +1 -1
  40. package/dist/packageVersion.js +1 -1
  41. package/dist/packageVersion.js.map +1 -1
  42. package/dist/policies.d.ts.map +1 -1
  43. package/dist/policies.js.map +1 -1
  44. package/dist/restWrapper.d.ts.map +1 -1
  45. package/dist/restWrapper.js +5 -6
  46. package/dist/restWrapper.js.map +1 -1
  47. package/dist/retriableGitManager.d.ts.map +1 -1
  48. package/dist/retriableGitManager.js.map +1 -1
  49. package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  50. package/dist/shreddedSummaryDocumentStorageService.js +8 -4
  51. package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
  52. package/dist/tokens.d.ts +24 -7
  53. package/dist/tokens.d.ts.map +1 -1
  54. package/dist/tokens.js.map +1 -1
  55. package/dist/urlUtils.d.ts.map +1 -1
  56. package/dist/urlUtils.js.map +1 -1
  57. package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  58. package/dist/wholeSummaryDocumentStorageService.js +25 -11
  59. package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
  60. package/lib/cache.d.ts.map +1 -1
  61. package/lib/cache.js +2 -5
  62. package/lib/cache.js.map +1 -1
  63. package/lib/createNewUtils.d.ts.map +1 -1
  64. package/lib/createNewUtils.js +4 -2
  65. package/lib/createNewUtils.js.map +1 -1
  66. package/lib/defaultTokenProvider.d.ts.map +1 -1
  67. package/lib/defaultTokenProvider.js.map +1 -1
  68. package/lib/definitions.d.ts.map +1 -1
  69. package/lib/definitions.js.map +1 -1
  70. package/lib/deltaStorageService.d.ts.map +1 -1
  71. package/lib/deltaStorageService.js +4 -1
  72. package/lib/deltaStorageService.js.map +1 -1
  73. package/lib/documentDeltaConnection.d.ts.map +1 -1
  74. package/lib/documentDeltaConnection.js.map +1 -1
  75. package/lib/documentService.d.ts.map +1 -1
  76. package/lib/documentService.js +15 -7
  77. package/lib/documentService.js.map +1 -1
  78. package/lib/documentServiceFactory.d.ts.map +1 -1
  79. package/lib/documentServiceFactory.js +7 -4
  80. package/lib/documentServiceFactory.js.map +1 -1
  81. package/lib/documentStorageService.d.ts.map +1 -1
  82. package/lib/documentStorageService.js +8 -6
  83. package/lib/documentStorageService.js.map +1 -1
  84. package/lib/errorUtils.d.ts +9 -2
  85. package/lib/errorUtils.d.ts.map +1 -1
  86. package/lib/errorUtils.js +14 -7
  87. package/lib/errorUtils.js.map +1 -1
  88. package/lib/index.d.ts +2 -1
  89. package/lib/index.d.ts.map +1 -1
  90. package/lib/index.js +3 -1
  91. package/lib/index.js.map +1 -1
  92. package/lib/nullBlobStorageService.d.ts.map +1 -1
  93. package/lib/nullBlobStorageService.js.map +1 -1
  94. package/lib/packageVersion.d.ts +1 -1
  95. package/lib/packageVersion.js +1 -1
  96. package/lib/packageVersion.js.map +1 -1
  97. package/lib/policies.d.ts.map +1 -1
  98. package/lib/policies.js.map +1 -1
  99. package/lib/restWrapper.d.ts.map +1 -1
  100. package/lib/restWrapper.js +5 -6
  101. package/lib/restWrapper.js.map +1 -1
  102. package/lib/retriableGitManager.d.ts.map +1 -1
  103. package/lib/retriableGitManager.js.map +1 -1
  104. package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
  105. package/lib/shreddedSummaryDocumentStorageService.js +9 -5
  106. package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
  107. package/lib/tokens.d.ts +24 -7
  108. package/lib/tokens.d.ts.map +1 -1
  109. package/lib/tokens.js.map +1 -1
  110. package/lib/urlUtils.d.ts.map +1 -1
  111. package/lib/urlUtils.js.map +1 -1
  112. package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
  113. package/lib/wholeSummaryDocumentStorageService.js +27 -13
  114. package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
  115. package/package.json +115 -114
  116. package/prettier.config.cjs +1 -1
  117. package/src/cache.ts +16 -19
  118. package/src/createNewUtils.ts +24 -22
  119. package/src/defaultTokenProvider.ts +13 -15
  120. package/src/definitions.ts +2 -2
  121. package/src/deltaStorageService.ts +99 -95
  122. package/src/documentDeltaConnection.ts +53 -47
  123. package/src/documentService.ts +260 -239
  124. package/src/documentServiceFactory.ts +263 -250
  125. package/src/documentStorageService.ts +87 -83
  126. package/src/errorUtils.ts +91 -81
  127. package/src/index.ts +7 -1
  128. package/src/nullBlobStorageService.ts +24 -21
  129. package/src/packageVersion.ts +1 -1
  130. package/src/policies.ts +44 -44
  131. package/src/restWrapper.ts +266 -216
  132. package/src/retriableGitManager.ts +152 -151
  133. package/src/shreddedSummaryDocumentStorageService.ts +202 -194
  134. package/src/tokens.ts +69 -44
  135. package/src/urlUtils.ts +26 -23
  136. package/src/wholeSummaryDocumentStorageService.ts +246 -228
  137. package/tsconfig.esnext.json +6 -6
  138. 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
  }