@fluidframework/routerlicious-driver 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +10 -12
- package/.mocharc.js +2 -2
- package/README.md +1 -1
- package/api-extractor.json +2 -2
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +2 -5
- package/dist/cache.js.map +1 -1
- package/dist/createNewUtils.d.ts.map +1 -1
- package/dist/createNewUtils.js +4 -2
- package/dist/createNewUtils.js.map +1 -1
- package/dist/defaultTokenProvider.d.ts.map +1 -1
- package/dist/defaultTokenProvider.js.map +1 -1
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js.map +1 -1
- package/dist/deltaStorageService.d.ts.map +1 -1
- package/dist/deltaStorageService.js +4 -1
- package/dist/deltaStorageService.js.map +1 -1
- package/dist/documentDeltaConnection.d.ts.map +1 -1
- package/dist/documentDeltaConnection.js.map +1 -1
- package/dist/documentService.d.ts.map +1 -1
- package/dist/documentService.js +13 -5
- package/dist/documentService.js.map +1 -1
- package/dist/documentServiceFactory.d.ts.map +1 -1
- package/dist/documentServiceFactory.js +7 -4
- package/dist/documentServiceFactory.js.map +1 -1
- package/dist/documentStorageService.d.ts.map +1 -1
- package/dist/documentStorageService.js +7 -5
- package/dist/documentStorageService.js.map +1 -1
- package/dist/errorUtils.d.ts +9 -2
- package/dist/errorUtils.d.ts.map +1 -1
- package/dist/errorUtils.js +15 -8
- package/dist/errorUtils.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/nullBlobStorageService.d.ts.map +1 -1
- package/dist/nullBlobStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/policies.d.ts.map +1 -1
- package/dist/policies.js.map +1 -1
- package/dist/restWrapper.d.ts.map +1 -1
- package/dist/restWrapper.js +5 -6
- package/dist/restWrapper.js.map +1 -1
- package/dist/retriableGitManager.d.ts.map +1 -1
- package/dist/retriableGitManager.js.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/shreddedSummaryDocumentStorageService.js +8 -4
- package/dist/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/dist/tokens.d.ts +24 -7
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/urlUtils.d.ts.map +1 -1
- package/dist/urlUtils.js.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/dist/wholeSummaryDocumentStorageService.js +25 -11
- package/dist/wholeSummaryDocumentStorageService.js.map +1 -1
- package/lib/cache.d.ts.map +1 -1
- package/lib/cache.js +2 -5
- package/lib/cache.js.map +1 -1
- package/lib/createNewUtils.d.ts.map +1 -1
- package/lib/createNewUtils.js +4 -2
- package/lib/createNewUtils.js.map +1 -1
- package/lib/defaultTokenProvider.d.ts.map +1 -1
- package/lib/defaultTokenProvider.js.map +1 -1
- package/lib/definitions.d.ts.map +1 -1
- package/lib/definitions.js.map +1 -1
- package/lib/deltaStorageService.d.ts.map +1 -1
- package/lib/deltaStorageService.js +4 -1
- package/lib/deltaStorageService.js.map +1 -1
- package/lib/documentDeltaConnection.d.ts.map +1 -1
- package/lib/documentDeltaConnection.js.map +1 -1
- package/lib/documentService.d.ts.map +1 -1
- package/lib/documentService.js +15 -7
- package/lib/documentService.js.map +1 -1
- package/lib/documentServiceFactory.d.ts.map +1 -1
- package/lib/documentServiceFactory.js +7 -4
- package/lib/documentServiceFactory.js.map +1 -1
- package/lib/documentStorageService.d.ts.map +1 -1
- package/lib/documentStorageService.js +8 -6
- package/lib/documentStorageService.js.map +1 -1
- package/lib/errorUtils.d.ts +9 -2
- package/lib/errorUtils.d.ts.map +1 -1
- package/lib/errorUtils.js +14 -7
- package/lib/errorUtils.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/nullBlobStorageService.d.ts.map +1 -1
- package/lib/nullBlobStorageService.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/policies.d.ts.map +1 -1
- package/lib/policies.js.map +1 -1
- package/lib/restWrapper.d.ts.map +1 -1
- package/lib/restWrapper.js +5 -6
- package/lib/restWrapper.js.map +1 -1
- package/lib/retriableGitManager.d.ts.map +1 -1
- package/lib/retriableGitManager.js.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/shreddedSummaryDocumentStorageService.js +9 -5
- package/lib/shreddedSummaryDocumentStorageService.js.map +1 -1
- package/lib/tokens.d.ts +24 -7
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js.map +1 -1
- package/lib/urlUtils.d.ts.map +1 -1
- package/lib/urlUtils.js.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.d.ts.map +1 -1
- package/lib/wholeSummaryDocumentStorageService.js +27 -13
- package/lib/wholeSummaryDocumentStorageService.js.map +1 -1
- package/package.json +115 -114
- package/prettier.config.cjs +1 -1
- package/src/cache.ts +16 -19
- package/src/createNewUtils.ts +24 -22
- package/src/defaultTokenProvider.ts +13 -15
- package/src/definitions.ts +2 -2
- package/src/deltaStorageService.ts +99 -95
- package/src/documentDeltaConnection.ts +53 -47
- package/src/documentService.ts +260 -239
- package/src/documentServiceFactory.ts +263 -250
- package/src/documentStorageService.ts +87 -83
- package/src/errorUtils.ts +91 -81
- package/src/index.ts +7 -1
- package/src/nullBlobStorageService.ts +24 -21
- package/src/packageVersion.ts +1 -1
- package/src/policies.ts +44 -44
- package/src/restWrapper.ts +266 -216
- package/src/retriableGitManager.ts +152 -151
- package/src/shreddedSummaryDocumentStorageService.ts +202 -194
- package/src/tokens.ts +69 -44
- package/src/urlUtils.ts +26 -23
- package/src/wholeSummaryDocumentStorageService.ts +246 -228
- package/tsconfig.esnext.json +6 -6
- 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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
}
|