@fluidframework/routerlicious-driver 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.216897

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 (60) hide show
  1. package/api-extractor-lint.json +13 -0
  2. package/api-extractor.json +0 -4
  3. package/api-report/routerlicious-driver.api.md +10 -10
  4. package/dist/defaultTokenProvider.cjs +1 -0
  5. package/dist/defaultTokenProvider.cjs.map +1 -1
  6. package/dist/defaultTokenProvider.d.ts +1 -0
  7. package/dist/defaultTokenProvider.d.ts.map +1 -1
  8. package/dist/documentServiceFactory.cjs +2 -0
  9. package/dist/documentServiceFactory.cjs.map +1 -1
  10. package/dist/documentServiceFactory.d.ts +2 -0
  11. package/dist/documentServiceFactory.d.ts.map +1 -1
  12. package/dist/errorUtils.cjs +2 -0
  13. package/dist/errorUtils.cjs.map +1 -1
  14. package/dist/errorUtils.d.ts +12 -0
  15. package/dist/errorUtils.d.ts.map +1 -1
  16. package/dist/packageVersion.cjs +1 -1
  17. package/dist/packageVersion.cjs.map +1 -1
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/policies.cjs.map +1 -1
  20. package/dist/policies.d.ts +3 -0
  21. package/dist/policies.d.ts.map +1 -1
  22. package/dist/routerlicious-driver-alpha.d.ts +17 -231
  23. package/dist/routerlicious-driver-beta.d.ts +17 -231
  24. package/dist/routerlicious-driver-public.d.ts +17 -231
  25. package/dist/routerlicious-driver-untrimmed.d.ts +23 -0
  26. package/dist/tokens.cjs.map +1 -1
  27. package/dist/tokens.d.ts +5 -0
  28. package/dist/tokens.d.ts.map +1 -1
  29. package/lib/defaultTokenProvider.d.ts +1 -0
  30. package/lib/defaultTokenProvider.d.ts.map +1 -1
  31. package/lib/defaultTokenProvider.mjs +1 -0
  32. package/lib/defaultTokenProvider.mjs.map +1 -1
  33. package/lib/documentServiceFactory.d.ts +2 -0
  34. package/lib/documentServiceFactory.d.ts.map +1 -1
  35. package/lib/documentServiceFactory.mjs +2 -0
  36. package/lib/documentServiceFactory.mjs.map +1 -1
  37. package/lib/errorUtils.d.ts +12 -0
  38. package/lib/errorUtils.d.ts.map +1 -1
  39. package/lib/errorUtils.mjs +2 -0
  40. package/lib/errorUtils.mjs.map +1 -1
  41. package/lib/packageVersion.d.ts +1 -1
  42. package/lib/packageVersion.mjs +1 -1
  43. package/lib/packageVersion.mjs.map +1 -1
  44. package/lib/policies.d.ts +3 -0
  45. package/lib/policies.d.ts.map +1 -1
  46. package/lib/policies.mjs.map +1 -1
  47. package/lib/routerlicious-driver-alpha.d.ts +17 -231
  48. package/lib/routerlicious-driver-beta.d.ts +17 -231
  49. package/lib/routerlicious-driver-public.d.ts +17 -231
  50. package/lib/routerlicious-driver-untrimmed.d.ts +23 -0
  51. package/lib/tokens.d.ts +5 -0
  52. package/lib/tokens.d.ts.map +1 -1
  53. package/lib/tokens.mjs.map +1 -1
  54. package/package.json +11 -10
  55. package/src/defaultTokenProvider.ts +1 -0
  56. package/src/documentServiceFactory.ts +2 -0
  57. package/src/errorUtils.ts +5 -0
  58. package/src/packageVersion.ts +1 -1
  59. package/src/policies.ts +3 -0
  60. package/src/tokens.ts +5 -0
@@ -1,245 +1,31 @@
1
- import { IDocumentService } from '@fluidframework/driver-definitions';
2
- import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
3
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
4
1
  import { ISession } from '@fluidframework/server-services-client';
5
2
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
6
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
7
3
  import { ITokenClaims } from '@fluidframework/protocol-definitions';
8
4
 
9
- /**
10
- * Default token provider in case the host does not provide one. It simply caches the provided jwt and returns it back.
11
- */
12
- export declare class DefaultTokenProvider implements ITokenProvider {
13
- private readonly jwt;
14
- constructor(jwt: string);
15
- fetchOrdererToken(): Promise<ITokenResponse>;
16
- fetchStorageToken(): Promise<ITokenResponse>;
17
- }
5
+ /* Excluded from this release type: DefaultTokenProvider */
18
6
 
19
- /**
20
- * Error returned by {@link RouterliciousDocumentServiceFactory.createContainer} when an error is thrown
21
- * in {@link ITokenProvider.documentPostCreateCallback}.
22
- * It is the consumer's responsibility to ensure that any state related to container creation is appropriately
23
- * cleaned up in the event of failure.
24
- * This includes the document itself, which will have been created by the time this error was thrown.
25
- *
26
- * @remarks TODO: examples of suggested actions for recovery.
27
- * - How would a user delete the created document?
28
- * - What would a retry pattern look like here?
29
- */
30
- export declare class DocumentPostCreateError extends Error {
31
- /**
32
- * Inner error being wrapped.
33
- */
34
- private readonly innerError;
35
- constructor(
36
- /**
37
- * Inner error being wrapped.
38
- */
39
- innerError: Error);
40
- readonly name = "DocumentPostCreateError";
41
- get stack(): string | undefined;
42
- }
7
+ /* Excluded from this release type: DocumentPostCreateError */
43
8
 
44
- export declare interface IRouterliciousDriverPolicies {
45
- /**
46
- * Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.
47
- * Default: true
48
- */
49
- enablePrefetch: boolean;
50
- /**
51
- * Rate limit concurrent storage requests.
52
- * Default: 100
53
- */
54
- maxConcurrentStorageRequests: number;
55
- /**
56
- * Rate limit concurrent orderer requests.
57
- * Default: 100
58
- */
59
- maxConcurrentOrdererRequests: number;
60
- /**
61
- * Enable uploading entire summary tree as a IWholeSummaryPayload to storage.
62
- * Default: false
63
- */
64
- enableWholeSummaryUpload: boolean;
65
- /**
66
- * Enable service endpoint discovery when creating or joining a session.
67
- * Default: false
68
- */
69
- enableDiscovery: boolean;
70
- /**
71
- * Enable using RestLess which avoids CORS preflight requests.
72
- * Default: true
73
- */
74
- enableRestLess: boolean;
75
- /**
76
- * Enable internal cache of summaries/snapshots.
77
- * Reduces Summarizer boot time and reduces server load in E2E tests.
78
- * Default: true
79
- */
80
- enableInternalSummaryCaching: boolean;
81
- /**
82
- * Enable downgrading socket connection to long-polling
83
- * when websocket connection cannot be established.
84
- * Default: true
85
- */
86
- enableLongPollingDowngrade: boolean;
87
- /**
88
- * Indicates that the container is ephemeral.
89
- * Artifacts relates to the container are limited to container lifetime.
90
- * Default: false
91
- */
92
- isEphemeralContainer: boolean;
93
- }
9
+ /* Excluded from this release type: IDocumentService */
94
10
 
95
- /**
96
- * Abstracts the token fetching mechanism for a hosting application.
97
- * The hosting application is responsible for providing an implementation.
98
- */
99
- export declare interface ITokenProvider {
100
- /**
101
- * Fetches the orderer token from host.
102
- *
103
- * @param tenantId - Tenant ID.
104
- * @param documentId - Optional. Document ID is only required for document-scoped requests.
105
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
106
- * This likely indicates that some previous request failed authorization due to an expired token,
107
- * and so a fresh token is required.
108
- *
109
- * Default: `false`.
110
- *
111
- * NOTE: This parameter will be made required in the future.
112
- */
113
- fetchOrdererToken(tenantId: string, documentId?: string, refresh?: boolean): Promise<ITokenResponse>;
114
- /**
115
- * Fetches the storage token from host.
116
- *
117
- * @param tenantId - Tenant ID.
118
- * @param documentId - Document ID.
119
- * @param refresh - Optional flag indicating whether token fetch must bypass local cache.
120
- * This likely indicates that some previous request failed authorization due to an expired token,
121
- * and so a fresh token is required.
122
- *
123
- * Default: `false`.
124
- *
125
- * NOTE: This parameter will be made required in the future.
126
- */
127
- fetchStorageToken(tenantId: string, documentId: string, refresh?: boolean): Promise<ITokenResponse>;
128
- /**
129
- * A callback triggered directly after creating the document. In this callback the client has the opportunity, to
130
- * verify against an authorization service, if the user who claims to create the document is the same user who
131
- * created it.
132
- *
133
- * @remarks Notes:
134
- *
135
- * * Using the callback may have performance impact on the document creation process.
136
- *
137
- * * Any exceptions thrown in the callback would fail the creation workflow
138
- * (see {@link RouterliciousDocumentServiceFactory.createContainer} for more details).
139
- *
140
- * @param documentId - Document ID.
141
- * @param creationToken - A special token that doesn't provide any kind of access, but it has the user's payload
142
- * and document id. It can be used to validate the identity of the document creator.
143
- */
144
- documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
145
- }
11
+ /* Excluded from this release type: IDocumentServiceFactory */
146
12
 
147
- export declare interface ITokenResponse {
148
- /**
149
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
150
- */
151
- jwt: string;
152
- /**
153
- * A flag indicating whether token was obtained from local cache.
154
- *
155
- * @remarks `undefined` indicates that the source of the token could not be determined.
156
- */
157
- fromCache?: boolean;
158
- }
13
+ /* Excluded from this release type: IResolvedUrl */
159
14
 
160
- /**
161
- * Abstracts the discovery of claims contained within a token.
162
- */
163
- export declare interface ITokenService {
164
- /**
165
- * Extracts the {@link @fluidframework/protocol-definitions#ITokenClaims | token claims} from the provided
166
- * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} string representation.
167
- */
168
- extractClaims(token: string): ITokenClaims;
169
- }
15
+ /* Excluded from this release type: IRouterliciousDriverPolicies */
170
16
 
171
- /**
172
- * Factory for creating the routerlicious document service. Use this if you want to
173
- * use the routerlicious implementation.
174
- */
175
- export declare class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
176
- private readonly tokenProvider;
177
- private readonly driverPolicies;
178
- private readonly blobCache;
179
- private readonly wholeSnapshotTreeCache;
180
- private readonly shreddedSummaryTreeCache;
181
- constructor(tokenProvider: ITokenProvider, driverPolicies?: Partial<IRouterliciousDriverPolicies>);
182
- /**
183
- * {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createContainer}
184
- *
185
- * @throws {@link DocumentPostCreateError}
186
- * If an exception is thrown while invoking the provided {@link ITokenProvider.documentPostCreateCallback}.
187
- */
188
- createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
189
- /**
190
- * {@inheritDoc @fluidframework/driver-definitions#IDocumentServiceFactory.createDocumentService}
191
- *
192
- * @returns Routerlicious document service.
193
- */
194
- createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean, session?: ISession): Promise<IDocumentService>;
195
- }
17
+ /* Excluded from this release type: ITelemetryBaseLogger */
196
18
 
197
- /**
198
- * Routerlicious Error types
199
- * Different error types that may be thrown by the routerlicious driver
200
- *
201
- * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
202
- */
203
- export declare enum RouterliciousErrorType {
204
- /**
205
- * File not found, or file deleted during session
206
- */
207
- fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
208
- /**
209
- * SSL Certificate Error.
210
- */
211
- sslCertError = "sslCertError"
212
- }
19
+ /* Excluded from this release type: ITokenProvider */
213
20
 
214
- /**
215
- * Routerlicious Error types
216
- * Different error types that may be thrown by the routerlicious driver
217
- */
218
- export declare const RouterliciousErrorTypes: {
219
- /**
220
- * SSL Certificate Error.
221
- */
222
- readonly sslCertError: "sslCertError";
223
- readonly genericNetworkError: "genericNetworkError";
224
- readonly authorizationError: "authorizationError";
225
- readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
226
- readonly offlineError: "offlineError";
227
- readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
228
- readonly writeError: "writeError";
229
- readonly fetchFailure: "fetchFailure";
230
- readonly fetchTokenError: "fetchTokenError";
231
- readonly incorrectServerResponse: "incorrectServerResponse";
232
- readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
233
- readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
234
- readonly locationRedirection: "locationRedirection";
235
- readonly fluidInvalidSchema: "fluidInvalidSchema";
236
- readonly fileIsLocked: "fileIsLocked";
237
- readonly outOfStorageError: "outOfStorageError";
238
- readonly genericError: "genericError";
239
- readonly throttlingError: "throttlingError";
240
- readonly usageError: "usageError";
241
- };
21
+ /* Excluded from this release type: ITokenResponse */
242
22
 
243
- export declare type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
23
+ /* Excluded from this release type: ITokenService */
244
24
 
245
- export { }
25
+ /* Excluded from this release type: RouterliciousDocumentServiceFactory */
26
+
27
+ /* Excluded from this release type: RouterliciousErrorType */
28
+
29
+ /* Excluded from this release type: RouterliciousErrorTypes */
30
+
31
+ export { }
@@ -8,6 +8,7 @@ import { ITokenClaims } from '@fluidframework/protocol-definitions';
8
8
 
9
9
  /**
10
10
  * Default token provider in case the host does not provide one. It simply caches the provided jwt and returns it back.
11
+ * @internal
11
12
  */
12
13
  export declare class DefaultTokenProvider implements ITokenProvider {
13
14
  private readonly jwt;
@@ -26,6 +27,7 @@ export declare class DefaultTokenProvider implements ITokenProvider {
26
27
  * @remarks TODO: examples of suggested actions for recovery.
27
28
  * - How would a user delete the created document?
28
29
  * - What would a retry pattern look like here?
30
+ * @internal
29
31
  */
30
32
  export declare class DocumentPostCreateError extends Error {
31
33
  /**
@@ -41,6 +43,9 @@ export declare class DocumentPostCreateError extends Error {
41
43
  get stack(): string | undefined;
42
44
  }
43
45
 
46
+ /**
47
+ * @internal
48
+ */
44
49
  export declare interface IRouterliciousDriverPolicies {
45
50
  /**
46
51
  * Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.
@@ -95,6 +100,7 @@ export declare interface IRouterliciousDriverPolicies {
95
100
  /**
96
101
  * Abstracts the token fetching mechanism for a hosting application.
97
102
  * The hosting application is responsible for providing an implementation.
103
+ * @internal
98
104
  */
99
105
  export declare interface ITokenProvider {
100
106
  /**
@@ -144,6 +150,9 @@ export declare interface ITokenProvider {
144
150
  documentPostCreateCallback?(documentId: string, creationToken: string): Promise<void>;
145
151
  }
146
152
 
153
+ /**
154
+ * @internal
155
+ */
147
156
  export declare interface ITokenResponse {
148
157
  /**
149
158
  * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
@@ -159,6 +168,7 @@ export declare interface ITokenResponse {
159
168
 
160
169
  /**
161
170
  * Abstracts the discovery of claims contained within a token.
171
+ * @internal
162
172
  */
163
173
  export declare interface ITokenService {
164
174
  /**
@@ -171,6 +181,7 @@ export declare interface ITokenService {
171
181
  /**
172
182
  * Factory for creating the routerlicious document service. Use this if you want to
173
183
  * use the routerlicious implementation.
184
+ * @internal
174
185
  */
175
186
  export declare class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
176
187
  private readonly tokenProvider;
@@ -199,6 +210,7 @@ export declare class RouterliciousDocumentServiceFactory implements IDocumentSer
199
210
  * Different error types that may be thrown by the routerlicious driver
200
211
  *
201
212
  * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
213
+ * @internal
202
214
  */
203
215
  export declare enum RouterliciousErrorType {
204
216
  /**
@@ -214,6 +226,7 @@ export declare class RouterliciousDocumentServiceFactory implements IDocumentSer
214
226
  /**
215
227
  * Routerlicious Error types
216
228
  * Different error types that may be thrown by the routerlicious driver
229
+ * @internal
217
230
  */
218
231
  export declare const RouterliciousErrorTypes: {
219
232
  /**
@@ -224,6 +237,13 @@ export declare class RouterliciousDocumentServiceFactory implements IDocumentSer
224
237
  readonly authorizationError: "authorizationError";
225
238
  readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
226
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
+ */
227
247
  readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
228
248
  readonly writeError: "writeError";
229
249
  readonly fetchFailure: "fetchFailure";
@@ -240,6 +260,9 @@ export declare class RouterliciousDocumentServiceFactory implements IDocumentSer
240
260
  readonly usageError: "usageError";
241
261
  };
242
262
 
263
+ /**
264
+ * @internal
265
+ */
243
266
  export declare type RouterliciousErrorTypes = (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
244
267
 
245
268
  export { }
package/lib/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
+ * @internal
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
+ * @internal
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.mjs","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 */\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\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 */\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"]}
1
+ {"version":3,"file":"tokens.mjs","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 * @internal\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 * @internal\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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/routerlicious-driver",
3
- "version": "2.0.0-dev.7.4.0.215930",
3
+ "version": "2.0.0-dev.7.4.0.216897",
4
4
  "description": "Socket.IO + Git implementation of Fluid service API",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,17 +47,17 @@
47
47
  "temp-directory": "nyc/.nyc_output"
48
48
  },
49
49
  "dependencies": {
50
- "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.215930",
51
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.215930",
52
- "@fluidframework/core-utils": "2.0.0-dev.7.4.0.215930",
53
- "@fluidframework/driver-base": "2.0.0-dev.7.4.0.215930",
54
- "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.215930",
55
- "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.215930",
50
+ "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.216897",
51
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.216897",
52
+ "@fluidframework/core-utils": "2.0.0-dev.7.4.0.216897",
53
+ "@fluidframework/driver-base": "2.0.0-dev.7.4.0.216897",
54
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.216897",
55
+ "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.216897",
56
56
  "@fluidframework/gitresources": "^2.0.1",
57
57
  "@fluidframework/protocol-base": "^2.0.1",
58
58
  "@fluidframework/protocol-definitions": "^3.0.0",
59
59
  "@fluidframework/server-services-client": "^2.0.1",
60
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.215930",
60
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.216897",
61
61
  "cross-fetch": "^3.1.5",
62
62
  "json-stringify-safe": "5.0.1",
63
63
  "socket.io-client": "^4.6.1",
@@ -69,7 +69,7 @@
69
69
  "@fluidframework/build-common": "^2.0.3",
70
70
  "@fluidframework/build-tools": "^0.28.0",
71
71
  "@fluidframework/eslint-config-fluid": "^3.1.0",
72
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.215930",
72
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.216897",
73
73
  "@fluidframework/routerlicious-driver-previous": "npm:@fluidframework/routerlicious-driver@2.0.0-internal.7.2.0",
74
74
  "@microsoft/api-extractor": "^7.38.3",
75
75
  "@types/mocha": "^9.1.1",
@@ -120,12 +120,13 @@
120
120
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
121
121
  "build:genver": "gen-version",
122
122
  "build:test": "tsc-multi --config ./tsc-multi.test.json",
123
+ "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
123
124
  "ci:build:docs": "api-extractor run",
124
125
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
125
126
  "eslint": "eslint --format stylish src",
126
127
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
127
128
  "format": "npm run prettier:fix",
128
- "lint": "npm run prettier && npm run eslint",
129
+ "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
129
130
  "lint:fix": "npm run prettier:fix && npm run eslint:fix",
130
131
  "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
131
132
  "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
@@ -7,6 +7,7 @@ import { ITokenProvider, ITokenResponse } from "./tokens";
7
7
 
8
8
  /**
9
9
  * Default token provider in case the host does not provide one. It simply caches the provided jwt and returns it back.
10
+ * @internal
10
11
  */
11
12
 
12
13
  export class DefaultTokenProvider implements ITokenProvider {
@@ -58,6 +58,7 @@ const defaultRouterliciousDriverPolicies: IRouterliciousDriverPolicies = {
58
58
  /**
59
59
  * Factory for creating the routerlicious document service. Use this if you want to
60
60
  * use the routerlicious implementation.
61
+ * @internal
61
62
  */
62
63
  export class RouterliciousDocumentServiceFactory implements IDocumentServiceFactory {
63
64
  private readonly driverPolicies: IRouterliciousDriverPolicies;
@@ -376,6 +377,7 @@ export class RouterliciousDocumentServiceFactory implements IDocumentServiceFact
376
377
  * @remarks TODO: examples of suggested actions for recovery.
377
378
  * - How would a user delete the created document?
378
379
  * - What would a retry pattern look like here?
380
+ * @internal
379
381
  */
380
382
  export class DocumentPostCreateError extends Error {
381
383
  public constructor(
package/src/errorUtils.ts CHANGED
@@ -20,6 +20,7 @@ import { pkgVersion as driverVersion } from "./packageVersion";
20
20
  /**
21
21
  * Routerlicious Error types
22
22
  * Different error types that may be thrown by the routerlicious driver
23
+ * @internal
23
24
  */
24
25
  export const RouterliciousErrorTypes = {
25
26
  // Inherit base driver error types
@@ -30,6 +31,9 @@ export const RouterliciousErrorTypes = {
30
31
  */
31
32
  sslCertError: "sslCertError",
32
33
  } as const;
34
+ /**
35
+ * @internal
36
+ */
33
37
  export type RouterliciousErrorTypes =
34
38
  (typeof RouterliciousErrorTypes)[keyof typeof RouterliciousErrorTypes];
35
39
 
@@ -38,6 +42,7 @@ export type RouterliciousErrorTypes =
38
42
  * Different error types that may be thrown by the routerlicious driver
39
43
  *
40
44
  * @deprecated Use {@link (RouterliciousErrorTypes:variable)} instead.
45
+ * @internal
41
46
  */
42
47
  export enum RouterliciousErrorType {
43
48
  /**
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/routerlicious-driver";
9
- export const pkgVersion = "2.0.0-dev.7.4.0.215930";
9
+ export const pkgVersion = "2.0.0-dev.7.4.0.216897";
package/src/policies.ts CHANGED
@@ -3,6 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ /**
7
+ * @internal
8
+ */
6
9
  export interface IRouterliciousDriverPolicies {
7
10
  /**
8
11
  * Enable prefetching entire snapshot tree into memory before it is loaded by the runtime.
package/src/tokens.ts CHANGED
@@ -7,6 +7,7 @@ import { ITokenClaims } from "@fluidframework/protocol-definitions";
7
7
 
8
8
  /**
9
9
  * Abstracts the discovery of claims contained within a token.
10
+ * @internal
10
11
  */
11
12
  export interface ITokenService {
12
13
  /**
@@ -16,6 +17,9 @@ export interface ITokenService {
16
17
  extractClaims(token: string): ITokenClaims;
17
18
  }
18
19
 
20
+ /**
21
+ * @internal
22
+ */
19
23
  export interface ITokenResponse {
20
24
  /**
21
25
  * {@link https://jwt.io/introduction/ | JSON Web Token (JWT)} value.
@@ -33,6 +37,7 @@ export interface ITokenResponse {
33
37
  /**
34
38
  * Abstracts the token fetching mechanism for a hosting application.
35
39
  * The hosting application is responsible for providing an implementation.
40
+ * @internal
36
41
  */
37
42
  export interface ITokenProvider {
38
43
  /**