@fluidframework/routerlicious-driver 2.0.0-dev-rc.3.0.0.254513 → 2.0.0-dev-rc.3.0.0.254866

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.
@@ -1,260 +0,0 @@
1
- import { IDocumentService } from '@fluidframework/driver-definitions/internal';
2
- import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
3
- import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
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
-
94
- /**
95
- * Routerlicious extends the resolved url with additional properties to control Routerlicious-specific behaviors.
96
- *
97
- * @privateRemarks
98
- * {@link isRouterliciousResolvedUrl} can be used to detect whether an {@link @fluidframework/driver-definitions#IResolvedUrl}
99
- * is an IRouterliciousResolvedUrl.
100
- *
101
- * @alpha
102
- */
103
- export declare interface IRouterliciousResolvedUrl extends IResolvedUrl {
104
- /**
105
- * A flag to facilitate type narrowing from {@link @fluidframework/driver-definitions#IResolvedUrl} to IRouterliciousResolvedUrl.
106
- */
107
- routerliciousResolvedUrl: true;
108
- /**
109
- * Controls whether a newly created container will be ephemeral, which means the service will not retain it
110
- * after the collaboration session ends. Only affects
111
- * {@link @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer} requests.
112
- *
113
- * @defaultValue If left undefined, treated as `false`
114
- */
115
- createAsEphemeral?: boolean;
116
- }
117
-
118
- /**
119
- * Abstracts the token fetching mechanism for a hosting application.
120
- * The hosting application is responsible for providing an implementation.
121
- * @public
122
- */
123
- export declare interface ITokenProvider {
124
- /**
125
- * Fetches the orderer token from host.
126
- *
127
- * @param tenantId - Tenant ID.
128
- * @param documentId - Optional. Document ID is only required for document-scoped requests.
129
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
130
- * This likely indicates that some previous request failed authorization due to an expired token,
131
- * and so a fresh token is required.
132
- *
133
- * Default: `false`.
134
- *
135
- * NOTE: This parameter will be made required in the future.
136
- */
137
- fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
138
- /**
139
- * Fetches the storage token from host.
140
- *
141
- * @param tenantId - Tenant ID.
142
- * @param documentId - Document ID.
143
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
144
- * This likely indicates that some previous request failed authorization due to an expired token,
145
- * and so a fresh token is required.
146
- *
147
- * Default: `false`.
148
- *
149
- * NOTE: This parameter will be made required in the future.
150
- */
151
- fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
152
- /**
153
- * A callback triggered directly after creating the document. In this callback the client has the opportunity, to
154
- * verify against an authorization service, if the user who claims to create the document is the same user who
155
- * created it.
156
- *
157
- * @remarks Notes:
158
- *
159
- * * Using the callback may have performance impact on the document creation process.
160
- *
161
- * * Any exceptions thrown in the callback would fail the creation workflow.
162
- *
163
- * @param documentId - Document ID.
164
- * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
165
- * and document id. It can be used to validate the identity of the document creator.
166
- */
167
- documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
168
- }
169
-
170
- /**
171
- * @public
172
- */
173
- export declare interface ITokenResponse {
174
- /**
175
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
176
- */
177
- jwt: string;
178
- /**
179
- * A flag indicating whether token was obtained from local cache.
180
- *
181
- * @remarks `undefined` indicates that the source of the token could not be determined.
182
- */
183
- fromCache?: boolean;
184
- }
185
-
186
- /**
187
- * Abstracts the discovery of claims contained within a token.
188
- * @internal
189
- */
190
- export declare interface ITokenService {
191
- /**
192
- * Extracts the {@link @fluidframework/protocol-definitions#ITokenClaims | token claims} from the provided
193
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} string representation.
194
- */
195
- extractClaims(token: string): ITokenClaims;
196
- }
197
-
198
- /**
199
- * Factory for creating the routerlicious document service. Use this if you want to
200
- * use the routerlicious implementation.
201
- * @internal
202
- */
203
- export declare class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
204
- private readonly tokenProvider;
205
- private readonly driverPolicies;
206
- private readonly blobCache;
207
- private readonly wholeSnapshotTreeCache;
208
- private readonly shreddedSummaryTreeCache;
209
- constructor(tokenProvider: ITokenProvider, driverPolicies?: Partial<IRouterliciousDriverPolicies>);
210
- /**
211
- * {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer}
212
- *
213
- * @throws {@link DocumentPostCreateError}
214
- * If an exception is thrown while invoking the provided {@link ITokenProvider.documentPostCreateCallback}.
215
- */
216
- createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
217
- /**
218
- * {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createDocumentService}
219
- *
220
- * @returns Routerlicious document service.
221
- */
222
- createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean, session?: ISession): Promise<IDocumentService>;
223
- }
224
-
225
- /**
226
- * Routerlicious Error types
227
- * Different error types that may be thrown by the routerlicious driver
228
- * @internal
229
- */
230
- export declare const RouterliciousErrorTypes: {
231
- /**
232
- * SSL Certificate Error.
233
- */
234
- readonly sslCertError: "sslCertError";
235
- readonly genericNetworkError: "genericNetworkError";
236
- readonly authorizationError: "authorizationError";
237
- readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
238
- readonly offlineError: "offlineError";
239
- readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
240
- readonly writeError: "writeError";
241
- readonly fetchFailure: "fetchFailure";
242
- readonly fetchTokenError: "fetchTokenError";
243
- readonly incorrectServerResponse: "incorrectServerResponse";
244
- readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
245
- readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
246
- readonly locationRedirection: "locationRedirection";
247
- readonly fluidInvalidSchema: "fluidInvalidSchema";
248
- readonly fileIsLocked: "fileIsLocked";
249
- readonly outOfStorageError: "outOfStorageError";
250
- readonly genericError: "genericError";
251
- readonly throttlingError: "throttlingError";
252
- readonly usageError: "usageError";
253
- };
254
-
255
- /**
256
- * @internal
257
- */
258
- export declare type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
259
-
260
- export { }
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.42.3"
9
- }
10
- ]
11
- }
@@ -1,113 +0,0 @@
1
- import { IDocumentService } from '@fluidframework/driver-definitions/internal';
2
- import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
3
- import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
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
- /* Excluded from this release type: DefaultTokenProvider */
10
-
11
- /* Excluded from this release type: DocumentPostCreateError */
12
-
13
- /* Excluded from this release type: IRouterliciousDriverPolicies */
14
-
15
- /**
16
- * Routerlicious extends the resolved url with additional properties to control Routerlicious-specific behaviors.
17
- *
18
- * @privateRemarks
19
- * {@link isRouterliciousResolvedUrl} can be used to detect whether an {@link @fluidframework/driver-definitions#IResolvedUrl}
20
- * is an IRouterliciousResolvedUrl.
21
- *
22
- * @alpha
23
- */
24
- export declare interface IRouterliciousResolvedUrl extends IResolvedUrl {
25
- /**
26
- * A flag to facilitate type narrowing from {@link @fluidframework/driver-definitions#IResolvedUrl} to IRouterliciousResolvedUrl.
27
- */
28
- routerliciousResolvedUrl: true;
29
- /**
30
- * Controls whether a newly created container will be ephemeral, which means the service will not retain it
31
- * after the collaboration session ends. Only affects
32
- * {@link @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer} requests.
33
- *
34
- * @defaultValue If left undefined, treated as `false`
35
- */
36
- createAsEphemeral?: boolean;
37
- }
38
-
39
- /**
40
- * Abstracts the token fetching mechanism for a hosting application.
41
- * The hosting application is responsible for providing an implementation.
42
- * @public
43
- */
44
- export declare interface ITokenProvider {
45
- /**
46
- * Fetches the orderer token from host.
47
- *
48
- * @param tenantId - Tenant ID.
49
- * @param documentId - Optional. Document ID is only required for document-scoped requests.
50
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
51
- * This likely indicates that some previous request failed authorization due to an expired token,
52
- * and so a fresh token is required.
53
- *
54
- * Default: `false`.
55
- *
56
- * NOTE: This parameter will be made required in the future.
57
- */
58
- fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
59
- /**
60
- * Fetches the storage token from host.
61
- *
62
- * @param tenantId - Tenant ID.
63
- * @param documentId - Document ID.
64
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
65
- * This likely indicates that some previous request failed authorization due to an expired token,
66
- * and so a fresh token is required.
67
- *
68
- * Default: `false`.
69
- *
70
- * NOTE: This parameter will be made required in the future.
71
- */
72
- fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
73
- /**
74
- * A callback triggered directly after creating the document. In this callback the client has the opportunity, to
75
- * verify against an authorization service, if the user who claims to create the document is the same user who
76
- * created it.
77
- *
78
- * @remarks Notes:
79
- *
80
- * * Using the callback may have performance impact on the document creation process.
81
- *
82
- * * Any exceptions thrown in the callback would fail the creation workflow.
83
- *
84
- * @param documentId - Document ID.
85
- * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
86
- * and document id. It can be used to validate the identity of the document creator.
87
- */
88
- documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
89
- }
90
-
91
- /**
92
- * @public
93
- */
94
- export declare interface ITokenResponse {
95
- /**
96
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
97
- */
98
- jwt: string;
99
- /**
100
- * A flag indicating whether token was obtained from local cache.
101
- *
102
- * @remarks `undefined` indicates that the source of the token could not be determined.
103
- */
104
- fromCache?: boolean;
105
- }
106
-
107
- /* Excluded from this release type: ITokenService */
108
-
109
- /* Excluded from this release type: RouterliciousDocumentServiceFactory */
110
-
111
- /* Excluded from this release type: RouterliciousErrorTypes */
112
-
113
- export { }
@@ -1,97 +0,0 @@
1
- import { IDocumentService } from '@fluidframework/driver-definitions/internal';
2
- import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
3
- import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
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
- /* Excluded from this release type: DefaultTokenProvider */
10
-
11
- /* Excluded from this release type: DocumentPostCreateError */
12
-
13
- /* Excluded from this release type: IDocumentService */
14
-
15
- /* Excluded from this release type: IDocumentServiceFactory */
16
-
17
- /* Excluded from this release type: IResolvedUrl */
18
-
19
- /* Excluded from this release type: IRouterliciousDriverPolicies */
20
-
21
- /* Excluded from this release type: IRouterliciousResolvedUrl */
22
-
23
- /**
24
- * Abstracts the token fetching mechanism for a hosting application.
25
- * The hosting application is responsible for providing an implementation.
26
- * @public
27
- */
28
- export declare interface ITokenProvider {
29
- /**
30
- * Fetches the orderer token from host.
31
- *
32
- * @param tenantId - Tenant ID.
33
- * @param documentId - Optional. Document ID is only required for document-scoped requests.
34
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
35
- * This likely indicates that some previous request failed authorization due to an expired token,
36
- * and so a fresh token is required.
37
- *
38
- * Default: `false`.
39
- *
40
- * NOTE: This parameter will be made required in the future.
41
- */
42
- fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
43
- /**
44
- * Fetches the storage token from host.
45
- *
46
- * @param tenantId - Tenant ID.
47
- * @param documentId - Document ID.
48
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
49
- * This likely indicates that some previous request failed authorization due to an expired token,
50
- * and so a fresh token is required.
51
- *
52
- * Default: `false`.
53
- *
54
- * NOTE: This parameter will be made required in the future.
55
- */
56
- fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
57
- /**
58
- * A callback triggered directly after creating the document. In this callback the client has the opportunity, to
59
- * verify against an authorization service, if the user who claims to create the document is the same user who
60
- * created it.
61
- *
62
- * @remarks Notes:
63
- *
64
- * * Using the callback may have performance impact on the document creation process.
65
- *
66
- * * Any exceptions thrown in the callback would fail the creation workflow.
67
- *
68
- * @param documentId - Document ID.
69
- * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
70
- * and document id. It can be used to validate the identity of the document creator.
71
- */
72
- documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
73
- }
74
-
75
- /**
76
- * @public
77
- */
78
- export declare interface ITokenResponse {
79
- /**
80
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
81
- */
82
- jwt: string;
83
- /**
84
- * A flag indicating whether token was obtained from local cache.
85
- *
86
- * @remarks `undefined` indicates that the source of the token could not be determined.
87
- */
88
- fromCache?: boolean;
89
- }
90
-
91
- /* Excluded from this release type: ITokenService */
92
-
93
- /* Excluded from this release type: RouterliciousDocumentServiceFactory */
94
-
95
- /* Excluded from this release type: RouterliciousErrorTypes */
96
-
97
- export { }
@@ -1,97 +0,0 @@
1
- import { IDocumentService } from '@fluidframework/driver-definitions/internal';
2
- import { IDocumentServiceFactory } from '@fluidframework/driver-definitions/internal';
3
- import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
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
- /* Excluded from this release type: DefaultTokenProvider */
10
-
11
- /* Excluded from this release type: DocumentPostCreateError */
12
-
13
- /* Excluded from this release type: IDocumentService */
14
-
15
- /* Excluded from this release type: IDocumentServiceFactory */
16
-
17
- /* Excluded from this release type: IResolvedUrl */
18
-
19
- /* Excluded from this release type: IRouterliciousDriverPolicies */
20
-
21
- /* Excluded from this release type: IRouterliciousResolvedUrl */
22
-
23
- /**
24
- * Abstracts the token fetching mechanism for a hosting application.
25
- * The hosting application is responsible for providing an implementation.
26
- * @public
27
- */
28
- export declare interface ITokenProvider {
29
- /**
30
- * Fetches the orderer token from host.
31
- *
32
- * @param tenantId - Tenant ID.
33
- * @param documentId - Optional. Document ID is only required for document-scoped requests.
34
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
35
- * This likely indicates that some previous request failed authorization due to an expired token,
36
- * and so a fresh token is required.
37
- *
38
- * Default: `false`.
39
- *
40
- * NOTE: This parameter will be made required in the future.
41
- */
42
- fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
43
- /**
44
- * Fetches the storage token from host.
45
- *
46
- * @param tenantId - Tenant ID.
47
- * @param documentId - Document ID.
48
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
49
- * This likely indicates that some previous request failed authorization due to an expired token,
50
- * and so a fresh token is required.
51
- *
52
- * Default: `false`.
53
- *
54
- * NOTE: This parameter will be made required in the future.
55
- */
56
- fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
57
- /**
58
- * A callback triggered directly after creating the document. In this callback the client has the opportunity, to
59
- * verify against an authorization service, if the user who claims to create the document is the same user who
60
- * created it.
61
- *
62
- * @remarks Notes:
63
- *
64
- * * Using the callback may have performance impact on the document creation process.
65
- *
66
- * * Any exceptions thrown in the callback would fail the creation workflow.
67
- *
68
- * @param documentId - Document ID.
69
- * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
70
- * and document id. It can be used to validate the identity of the document creator.
71
- */
72
- documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
73
- }
74
-
75
- /**
76
- * @public
77
- */
78
- export declare interface ITokenResponse {
79
- /**
80
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
81
- */
82
- jwt: string;
83
- /**
84
- * A flag indicating whether token was obtained from local cache.
85
- *
86
- * @remarks `undefined` indicates that the source of the token could not be determined.
87
- */
88
- fromCache?: boolean;
89
- }
90
-
91
- /* Excluded from this release type: ITokenService */
92
-
93
- /* Excluded from this release type: RouterliciousDocumentServiceFactory */
94
-
95
- /* Excluded from this release type: RouterliciousErrorTypes */
96
-
97
- export { }