@fluidframework/odsp-driver-definitions 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419

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 (120) hide show
  1. package/.eslintrc.js +6 -9
  2. package/CHANGELOG.md +141 -0
  3. package/README.md +39 -1
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/odsp-driver-definitions.api.md +320 -0
  7. package/dist/errors.cjs +110 -0
  8. package/dist/errors.cjs.map +1 -0
  9. package/dist/errors.d.ts +122 -6
  10. package/dist/errors.d.ts.map +1 -1
  11. package/dist/{factory.js → factory.cjs} +1 -1
  12. package/dist/factory.cjs.map +1 -0
  13. package/dist/factory.d.ts +36 -6
  14. package/dist/factory.d.ts.map +1 -1
  15. package/dist/index.cjs +21 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.ts +6 -5
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/odsp-driver-definitions-alpha.d.ts +626 -0
  20. package/dist/odsp-driver-definitions-beta.d.ts +88 -0
  21. package/dist/odsp-driver-definitions-public.d.ts +79 -0
  22. package/dist/odsp-driver-definitions-untrimmed.d.ts +652 -0
  23. package/dist/odspCache.cjs +23 -0
  24. package/dist/odspCache.cjs.map +1 -0
  25. package/dist/odspCache.d.ts +21 -4
  26. package/dist/odspCache.d.ts.map +1 -1
  27. package/dist/resolvedUrl.cjs +37 -0
  28. package/dist/resolvedUrl.cjs.map +1 -0
  29. package/dist/resolvedUrl.d.ts +59 -16
  30. package/dist/resolvedUrl.d.ts.map +1 -1
  31. package/dist/{odspCache.js → sessionProvider.cjs} +1 -6
  32. package/dist/sessionProvider.cjs.map +1 -0
  33. package/dist/sessionProvider.d.ts +48 -0
  34. package/dist/sessionProvider.d.ts.map +1 -0
  35. package/dist/{tokenFetch.js → tokenFetch.cjs} +6 -2
  36. package/dist/tokenFetch.cjs.map +1 -0
  37. package/dist/tokenFetch.d.ts +15 -5
  38. package/dist/tokenFetch.d.ts.map +1 -1
  39. package/dist/tsdoc-metadata.json +11 -0
  40. package/lib/errors.d.mts +153 -0
  41. package/lib/errors.d.mts.map +1 -0
  42. package/lib/errors.mjs +103 -0
  43. package/lib/errors.mjs.map +1 -0
  44. package/lib/{factory.d.ts → factory.d.mts} +36 -6
  45. package/lib/factory.d.mts.map +1 -0
  46. package/lib/{factory.js → factory.mjs} +1 -1
  47. package/lib/factory.mjs.map +1 -0
  48. package/lib/index.d.mts +11 -0
  49. package/lib/index.d.mts.map +1 -0
  50. package/lib/index.mjs +9 -0
  51. package/lib/index.mjs.map +1 -0
  52. package/lib/odsp-driver-definitions-alpha.d.mts +626 -0
  53. package/lib/odsp-driver-definitions-beta.d.mts +88 -0
  54. package/lib/odsp-driver-definitions-public.d.mts +79 -0
  55. package/lib/odsp-driver-definitions-untrimmed.d.mts +652 -0
  56. package/lib/{odspCache.d.ts → odspCache.d.mts} +21 -4
  57. package/lib/odspCache.d.mts.map +1 -0
  58. package/lib/odspCache.mjs +19 -0
  59. package/lib/odspCache.mjs.map +1 -0
  60. package/lib/{resolvedUrl.d.ts → resolvedUrl.d.mts} +59 -16
  61. package/lib/resolvedUrl.d.mts.map +1 -0
  62. package/lib/resolvedUrl.mjs +34 -0
  63. package/lib/resolvedUrl.mjs.map +1 -0
  64. package/lib/sessionProvider.d.mts +48 -0
  65. package/lib/sessionProvider.d.mts.map +1 -0
  66. package/lib/sessionProvider.mjs +6 -0
  67. package/lib/sessionProvider.mjs.map +1 -0
  68. package/lib/{tokenFetch.d.ts → tokenFetch.d.mts} +15 -5
  69. package/lib/tokenFetch.d.mts.map +1 -0
  70. package/lib/{tokenFetch.js → tokenFetch.mjs} +6 -2
  71. package/lib/tokenFetch.mjs.map +1 -0
  72. package/package.json +71 -42
  73. package/prettier.config.cjs +8 -0
  74. package/src/errors.ts +153 -57
  75. package/src/factory.ts +146 -114
  76. package/src/index.ts +47 -5
  77. package/src/odspCache.ts +71 -51
  78. package/src/resolvedUrl.ts +125 -72
  79. package/src/sessionProvider.ts +61 -0
  80. package/src/tokenFetch.ts +56 -39
  81. package/tsc-multi.test.json +4 -0
  82. package/tsconfig.json +11 -13
  83. package/.editorconfig +0 -7
  84. package/dist/errors.js +0 -44
  85. package/dist/errors.js.map +0 -1
  86. package/dist/factory.js.map +0 -1
  87. package/dist/index.js +0 -22
  88. package/dist/index.js.map +0 -1
  89. package/dist/odspCache.js.map +0 -1
  90. package/dist/packageVersion.d.ts +0 -9
  91. package/dist/packageVersion.d.ts.map +0 -1
  92. package/dist/packageVersion.js +0 -12
  93. package/dist/packageVersion.js.map +0 -1
  94. package/dist/resolvedUrl.js +0 -18
  95. package/dist/resolvedUrl.js.map +0 -1
  96. package/dist/tokenFetch.js.map +0 -1
  97. package/lib/errors.d.ts +0 -41
  98. package/lib/errors.d.ts.map +0 -1
  99. package/lib/errors.js +0 -41
  100. package/lib/errors.js.map +0 -1
  101. package/lib/factory.d.ts.map +0 -1
  102. package/lib/factory.js.map +0 -1
  103. package/lib/index.d.ts +0 -10
  104. package/lib/index.d.ts.map +0 -1
  105. package/lib/index.js +0 -10
  106. package/lib/index.js.map +0 -1
  107. package/lib/odspCache.d.ts.map +0 -1
  108. package/lib/odspCache.js +0 -9
  109. package/lib/odspCache.js.map +0 -1
  110. package/lib/packageVersion.d.ts +0 -9
  111. package/lib/packageVersion.d.ts.map +0 -1
  112. package/lib/packageVersion.js +0 -9
  113. package/lib/packageVersion.js.map +0 -1
  114. package/lib/resolvedUrl.d.ts.map +0 -1
  115. package/lib/resolvedUrl.js +0 -15
  116. package/lib/resolvedUrl.js.map +0 -1
  117. package/lib/tokenFetch.d.ts.map +0 -1
  118. package/lib/tokenFetch.js.map +0 -1
  119. package/src/packageVersion.ts +0 -9
  120. package/tsconfig.esnext.json +0 -7
@@ -0,0 +1,626 @@
1
+ import { DriverError } from '@fluidframework/driver-definitions';
2
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
3
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
4
+
5
+ /**
6
+ * @alpha
7
+ */
8
+ export declare type CacheContentType = "snapshot" | "ops";
9
+
10
+ /* Excluded from this release type: getKeyForCacheEntry */
11
+
12
+ /**
13
+ * @alpha
14
+ */
15
+ export declare interface HostStoragePolicy {
16
+ snapshotOptions?: ISnapshotOptions;
17
+ /**
18
+ * If set to true, tells driver to concurrently fetch snapshot from storage (SPO) and cache
19
+ * Container loads from whatever comes first in such case.
20
+ * Snapshot fetched from storage is pushed to cache in either case.
21
+ * If set to false, driver will first consult with cache. Only on cache miss (cache does not
22
+ * return snapshot), driver will fetch snapshot from storage (and push it to cache), otherwise
23
+ * it will load from cache and not reach out to storage.
24
+ * Passing true results in faster loads and keeping cache more current, but it increases bandwidth consumption.
25
+ */
26
+ concurrentSnapshotFetch?: boolean;
27
+ opsBatchSize?: number;
28
+ concurrentOpsBatches?: number;
29
+ /**
30
+ * Policy controlling ops caching (leveraging IPersistedCache passed to driver factory)
31
+ */
32
+ opsCaching?: IOpsCachingPolicy;
33
+ /**
34
+ * Policy controlling how collaboration session is established
35
+ */
36
+ sessionOptions?: ICollabSessionOptions;
37
+ /**
38
+ * @deprecated This field will be always set to true after removal.
39
+ * True to have the sharing link redeem fallback in case the Trees Latest/Redeem 1RT call fails with redeem error.
40
+ * During fallback it will first redeem the sharing link and then make the Trees latest call.
41
+ */
42
+ enableRedeemFallback?: boolean;
43
+ /**
44
+ * Policy controlling if we will cache initial summary when we create a document
45
+ */
46
+ cacheCreateNewSummary?: boolean;
47
+ /**
48
+ * @deprecated This will be replaced with feature gate snapshotFormatFetchType.
49
+ * Policy controlling if we want to fetch binary format snapshot.
50
+ */
51
+ fetchBinarySnapshotFormat?: boolean;
52
+ /**
53
+ * If set to true, socket cache are per OdspDocumentService instead of shared across all instances
54
+ */
55
+ isolateSocketCache?: boolean;
56
+ /**
57
+ * @deprecated Switch to using the new feature gated by enableSingleRequestForShareLinkWithCreate
58
+ * with 'createLinkScope' and 'createLinkRole' is requested to the odsp apis instead of 'createLinkType'.
59
+ * It enables the creation of sharing link along with the creation of file by setting this value to true.
60
+ * If the host provides a 'createLinkType' parameter in the request URL to the container.attach()
61
+ * method, we will send the request to ODSP with the same (if the flag is enabled) so
62
+ * that a share link can be created with the creation of file to save number for round trips made to ODSP.
63
+ * (This flag works independently of enableSingleRequestForShareLinkWithCreate which is used for sharing link
64
+ * requests where 'createLinkScope' is requested.)
65
+ */
66
+ enableShareLinkWithCreate?: boolean;
67
+ /**
68
+ * Enable creation of sharing link along with the creation of file by setting this value to true.
69
+ * If the host provides a 'createLinkScope' parameter in the request URL to the container.attach()
70
+ * method, we will send the request to ODSP with the same (if the flag is enabled) so
71
+ * that a share link can be created with the creation of file to save number for round trips made to ODSP.
72
+ * (This flag works independently of enableShareLinkWithCreate which was used for old sharing link requests
73
+ * where 'createLinkType' was requested.)
74
+ */
75
+ enableSingleRequestForShareLinkWithCreate?: boolean;
76
+ /**
77
+ * True if host does not want the storage service to use the prefetch cache to get the snapshot. Undefined will be treated
78
+ * as false. This is if the host wants to do some A/B testing.
79
+ */
80
+ avoidPrefetchSnapshotCache?: boolean;
81
+ }
82
+
83
+ /**
84
+ * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
85
+ * @alpha
86
+ */
87
+ export declare interface ICacheEntry extends IEntry {
88
+ /**
89
+ * Identifies file in storage this cached entry is for
90
+ */
91
+ file: IFileEntry;
92
+ }
93
+
94
+ /**
95
+ * @alpha
96
+ */
97
+ export declare interface ICollabSessionOptions {
98
+ /**
99
+ * Value indicating the display name for session that admits unauthenticated user.
100
+ * This name will be used in attribution associated with edits made by such user.
101
+ */
102
+ unauthenticatedUserDisplayName?: string;
103
+ /**
104
+ * @deprecated Due to security reasons we will be passing the token via Authorization header only.
105
+ * Value indicating session preference to always pass access token via Authorization header.
106
+ * Default behavior is to pass access token via query parameter unless overall href string
107
+ * length exceeds 2048 characters. Using query param is performance optimization which results
108
+ * in ODSP XHR request being treated as 'simple' request which do not require OPTIONS call to
109
+ * validate CORS. However, not all ODSP implementations understand this optimization.
110
+ * For instance, auth layer on Converged stack will fail request with access token passed via
111
+ * query param.
112
+ */
113
+ forceAccessTokenViaAuthorizationHeader?: boolean;
114
+ }
115
+
116
+ /**
117
+ * Identity types supported by ODSP driver.
118
+ * `Consumer` represents user authenticated with Microsoft Account (MSA).
119
+ * `Enterprise` represents user authenticated with M365 tenant account.
120
+ * @alpha
121
+ */
122
+ export declare type IdentityType = "Consumer" | "Enterprise";
123
+
124
+ /**
125
+ * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
126
+ * @alpha
127
+ */
128
+ export declare interface IEntry {
129
+ /**
130
+ * Identifies type of entry for a given file.
131
+ * Each file can have multiple types of entries associated with it.
132
+ * For example, it can be snapshot, blob, ops, etc.
133
+ */
134
+ type: CacheContentType;
135
+ /**
136
+ * Identifies individual entry for a given file and type.
137
+ * Each file can have multiple cache entries associated with it.
138
+ * This property identifies a particular instance of entry.
139
+ * For example, for blobs it will be unique ID of the blob in a file.
140
+ * For batch of ops, it can be starting op sequence number.
141
+ * For types that have only one entry (like snapshots), it will be empty string.
142
+ */
143
+ key: string;
144
+ }
145
+
146
+ /**
147
+ * @alpha
148
+ */
149
+ export declare interface IFileEntry {
150
+ /**
151
+ * Unique and stable ID of the document.
152
+ * Driver guarantees that docId is stable ID uniquely identifying document.
153
+ */
154
+ docId: string;
155
+ /**
156
+ * Resolved URI is provided for additional versatility - host can use it to
157
+ * identify file in storage, and (as example) delete all cached entries for
158
+ * a file if user requests so.
159
+ * This is IOdspResolvedUrl in case of ODSP driver.
160
+ */
161
+ resolvedUrl: IResolvedUrl;
162
+ }
163
+
164
+ /* Excluded from this release type: InstrumentedStorageTokenFetcher */
165
+
166
+ /**
167
+ * Base interface for all errors and warnings
168
+ * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties
169
+ * @alpha
170
+ */
171
+ export declare interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
172
+ readonly errorType: OdspErrorType;
173
+ }
174
+
175
+ /**
176
+ * @alpha
177
+ */
178
+ export declare interface IOdspErrorAugmentations {
179
+ /**
180
+ * Server epoch indicates when the file was last modified.
181
+ * Used to detect modifications outside Fluid's services
182
+ */
183
+ serverEpoch?: string;
184
+ /**
185
+ * It is the redirection url at which the network call should have been made. It is due to change
186
+ * in site domain of the file on server.
187
+ */
188
+ redirectLocation?: string;
189
+ /**
190
+ * It is array of error codes included in error response from server.
191
+ */
192
+ facetCodes?: string[];
193
+ }
194
+
195
+ /**
196
+ * @alpha
197
+ */
198
+ export declare interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
199
+ type: "fluid";
200
+ odspResolvedUrl: true;
201
+ url: string;
202
+ hashedDocumentId: string;
203
+ endpoints: {
204
+ snapshotStorageUrl: string;
205
+ attachmentPOSTStorageUrl: string;
206
+ attachmentGETStorageUrl: string;
207
+ deltaStorageUrl: string;
208
+ };
209
+ tokens: {};
210
+ fileName: string;
211
+ summarizer: boolean;
212
+ codeHint?: {
213
+ containerPackageName?: string;
214
+ };
215
+ fileVersion: string | undefined;
216
+ dataStorePath?: string;
217
+ /**
218
+ * Sharing link data created for the ODSP item.
219
+ * Contains information about either sharing link created while creating a new file or
220
+ * a redeemable share link created when loading an existing file
221
+ */
222
+ shareLinkInfo?: ShareLinkInfoType;
223
+ isClpCompliantApp?: boolean;
224
+ }
225
+
226
+ /**
227
+ * @alpha
228
+ */
229
+ export declare interface IOdspUrlParts {
230
+ siteUrl: string;
231
+ driveId: string;
232
+ itemId: string;
233
+ }
234
+
235
+ /**
236
+ * @alpha
237
+ */
238
+ export declare interface IOpsCachingPolicy {
239
+ /**
240
+ * Batch size. Controls how many ops are grouped together as single cache entry
241
+ * The bigger the number, the more efficient it is (less reads & writes)
242
+ * At the same time, big number means we wait for so many ops to accumulate, which
243
+ * increases chances and number of trailing ops that would not be flushed to cache
244
+ * when user closes tab
245
+ * Use any number below 1 to disable caching
246
+ * Default: 100
247
+ */
248
+ batchSize?: number;
249
+ /**
250
+ * To reduce the problem of losing trailing ops when using big batch sizes, host
251
+ * could specify how often driver should flush ops it has not flushed yet.
252
+ * -1 means do not use timer.
253
+ * Measured in ms.
254
+ * Default: 5000
255
+ */
256
+ timerGranularity?: number;
257
+ /**
258
+ * Total number of ops to cache. When we reach that number, ops caching stops
259
+ * Default: 5000
260
+ */
261
+ totalOpsToCache?: number;
262
+ }
263
+
264
+ /**
265
+ * Persistent cache. This interface can be implemented by the host to provide durable caching
266
+ * across sessions. If not provided at driver factory construction, factory will use in-memory
267
+ * cache implementation that does not survive across sessions. Snapshot entires stored in the
268
+ * IPersistedCache will be considered stale and removed after 2 days. Read the README for more
269
+ * information.
270
+ * @alpha
271
+ */
272
+ export declare interface IPersistedCache {
273
+ /**
274
+ * Get the cache value of the key
275
+ * @param entry - cache entry, identifies file and particular key for this file.
276
+ * @returns Cached value. undefined if nothing is cached.
277
+ */
278
+ get(entry: ICacheEntry): Promise<any>;
279
+ /**
280
+ * Put the value into cache.
281
+ * Important - only serializable content is allowed since this cache may be persisted between sessions
282
+ * @param entry - cache entry.
283
+ * @param value - JSON-serializable content.
284
+ */
285
+ put(entry: ICacheEntry, value: any): Promise<void>;
286
+ /**
287
+ * Removes the entries from the cache for given parametres.
288
+ * @param file - file entry to be deleted.
289
+ */
290
+ removeEntries(file: IFileEntry): Promise<void>;
291
+ }
292
+
293
+ /**
294
+ * An interface that allows a concrete instance of a driver factory to interrogate itself
295
+ * to find out if it is session aware.
296
+ * @alpha
297
+ */
298
+ export declare interface IProvideSessionAwareDriverFactory {
299
+ readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
300
+ }
301
+
302
+ /**
303
+ * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`
304
+ * function if it session aware.
305
+ * @alpha
306
+ */
307
+ export declare interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
308
+ getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
309
+ }
310
+
311
+ /**
312
+ * Sharing link data received from the /snapshot api response.
313
+ * @alpha
314
+ */
315
+ export declare interface ISharingLink extends ISharingLinkKind {
316
+ webUrl: string;
317
+ }
318
+
319
+ /**
320
+ * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
321
+ * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
322
+ * @alpha
323
+ */
324
+ export declare interface ISharingLinkKind {
325
+ scope: SharingLinkScope;
326
+ role?: SharingLinkRole;
327
+ }
328
+
329
+ /**
330
+ * @alpha
331
+ */
332
+ export declare interface ISnapshotOptions {
333
+ blobs?: number;
334
+ deltas?: number;
335
+ channels?: number;
336
+ mds?: number;
337
+ timeout?: number;
338
+ }
339
+
340
+ /**
341
+ * Socket storage discovery api response
342
+ * @alpha
343
+ */
344
+ export declare interface ISocketStorageDiscovery {
345
+ id: string;
346
+ runtimeTenantId?: string;
347
+ tenantId: string;
348
+ snapshotStorageUrl: string;
349
+ deltaStorageUrl: string;
350
+ /**
351
+ * PUSH URL
352
+ */
353
+ deltaStreamSocketUrl: string;
354
+ /**
355
+ * The access token for PushChannel. Optionally returned, depending on implementation.
356
+ * OneDrive for Consumer implementation returns it and OneDrive for Business implementation
357
+ * does not return it and instead expects token to be returned via `getWebsocketToken` callback
358
+ * passed as a parameter to `OdspDocumentService.create()` factory.
359
+ */
360
+ socketToken?: string;
361
+ /**
362
+ * This is the time within which client has to refresh the session on (ODSP) relay service.
363
+ */
364
+ refreshSessionDurationSeconds?: number;
365
+ }
366
+
367
+ /* Excluded from this release type: isTokenFromCache */
368
+
369
+ /**
370
+ * @alpha
371
+ */
372
+ export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
373
+
374
+ /**
375
+ * ODSP Error types.
376
+ * Different error types that may be thrown by the ODSP driver.
377
+ *
378
+ * @deprecated Use {@link (OdspErrorTypes:variable)} instead.
379
+ * @alpha
380
+ */
381
+ export declare enum OdspErrorType {
382
+ /**
383
+ * Storage is out of space
384
+ */
385
+ outOfStorageError = "outOfStorageError",
386
+ /**
387
+ * Invalid file name (at creation of the file)
388
+ */
389
+ invalidFileNameError = "invalidFileNameError",
390
+ /**
391
+ * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
392
+ * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
393
+ * such case.
394
+ */
395
+ snapshotTooBig = "snapshotTooBig",
396
+ /**
397
+ * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
398
+ * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
399
+ * such case.
400
+ */
401
+ fetchTimeout = "fetchTimeout",
402
+ /**
403
+ * SPO admin toggle: fluid service is not enabled.
404
+ */
405
+ fluidNotEnabled = "fluidNotEnabled",
406
+ /**
407
+ * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
408
+ */
409
+ fetchTokenError = "fetchTokenError",
410
+ /**
411
+ * This error will be raised when client is too behind with no way to catch up.
412
+ * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
413
+ * by storage, and thus removing an ability for client to catch up.
414
+ * This condition will result in any local changes being lost (i.e. only way to save state is by user
415
+ * copying it over manually)
416
+ */
417
+ cannotCatchUp = "cannotCatchUp",
418
+ /**
419
+ * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
420
+ * So to preserve integrity of the data, the data becomes readonly.
421
+ */
422
+ serviceReadOnly = "serviceReadOnly",
423
+ /**
424
+ * Due to organizational policies, you can't access server resources from the current network location.
425
+ */
426
+ blockedIPAddress = "blockedIPAddress"
427
+ }
428
+
429
+ /**
430
+ * ODSP Error types.
431
+ * Different error types that may be thrown by the ODSP driver.
432
+ * @alpha
433
+ */
434
+ export declare const OdspErrorTypes: {
435
+ /**
436
+ * Invalid file name (at creation of the file)
437
+ */
438
+ readonly invalidFileNameError: "invalidFileNameError";
439
+ /**
440
+ * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
441
+ * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
442
+ * such case.
443
+ */
444
+ readonly snapshotTooBig: "snapshotTooBig";
445
+ /**
446
+ * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
447
+ * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
448
+ * such case.
449
+ */
450
+ readonly fetchTimeout: "fetchTimeout";
451
+ /**
452
+ * SPO admin toggle: fluid service is not enabled.
453
+ */
454
+ readonly fluidNotEnabled: "fluidNotEnabled";
455
+ /**
456
+ * This error will be raised when client is too behind with no way to catch up.
457
+ * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
458
+ * by storage, and thus removing an ability for client to catch up.
459
+ * This condition will result in any local changes being lost (i.e. only way to save state is by user
460
+ * copying it over manually)
461
+ */
462
+ readonly cannotCatchUp: "cannotCatchUp";
463
+ /**
464
+ * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
465
+ * So to preserve integrity of the data, the data becomes readonly.
466
+ */
467
+ readonly serviceReadOnly: "serviceReadOnly";
468
+ /**
469
+ * Due to organizational policies, you can't access server resources from the current network location.
470
+ */
471
+ readonly blockedIPAddress: "blockedIPAddress";
472
+ readonly genericNetworkError: "genericNetworkError";
473
+ readonly authorizationError: "authorizationError";
474
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
475
+ readonly offlineError: "offlineError";
476
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
477
+ readonly writeError: "writeError";
478
+ readonly fetchFailure: "fetchFailure";
479
+ readonly fetchTokenError: "fetchTokenError";
480
+ readonly incorrectServerResponse: "incorrectServerResponse";
481
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
482
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
483
+ readonly locationRedirection: "locationRedirection";
484
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
485
+ readonly fileIsLocked: "fileIsLocked";
486
+ readonly outOfStorageError: "outOfStorageError";
487
+ readonly genericError: "genericError";
488
+ readonly throttlingError: "throttlingError";
489
+ readonly usageError: "usageError";
490
+ };
491
+
492
+ /**
493
+ * @alpha
494
+ */
495
+ export declare type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
496
+
497
+ /**
498
+ * Represents access token fetch options for ODSP resource
499
+ * @alpha
500
+ */
501
+ export declare interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
502
+ /** Site url representing ODSP resource location */
503
+ siteUrl: string;
504
+ /** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */
505
+ driveId?: string;
506
+ /** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */
507
+ itemId?: string;
508
+ }
509
+
510
+ /**
511
+ * Sharing link data created for the ODSP item.
512
+ * Contains information about either sharing link created while creating a new file or
513
+ * a redeemable share link created when loading an existing file
514
+ * @alpha
515
+ */
516
+ export declare interface ShareLinkInfoType {
517
+ /**
518
+ * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to
519
+ * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature
520
+ * where we can create a share link along with creating a file by passing a query parameter called
521
+ * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information
522
+ * from the /snapshot api response.
523
+ */
524
+ createLink?: {
525
+ /**
526
+ * @deprecated
527
+ * Type of shareLink requested/created when creating the file for the first time. The 'type' property here
528
+ * represents the type of sharing link requested.
529
+ * Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
530
+ */
531
+ type?: ShareLinkTypes | ISharingLinkKind;
532
+ /**
533
+ * Share link created when the file is created for the first time with /snapshot api call.
534
+ */
535
+ link?: string | ISharingLink;
536
+ /**
537
+ * Error message if creation of sharing link fails with /snapshot api call
538
+ */
539
+ error?: any;
540
+ shareId?: string;
541
+ };
542
+ /**
543
+ * This is used to save the network calls while doing trees/latest call as if the client does not have
544
+ * permission then this link can be redeemed for the permissions in the same network call.
545
+ */
546
+ sharingLinkToRedeem?: string;
547
+ }
548
+
549
+ /**
550
+ * @deprecated Use ISharingLinkKind type instead.
551
+ * Type of shareLink requested/created when creating the file for the first time.
552
+ * @alpha
553
+ */
554
+ export declare enum ShareLinkTypes {
555
+ csl = "csl"
556
+ }
557
+
558
+ /**
559
+ * View/edit permission role for a sharing link.
560
+ * @alpha
561
+ */
562
+ export declare enum SharingLinkRole {
563
+ view = "view",
564
+ edit = "edit"
565
+ }
566
+
567
+ /**
568
+ * Sharing scope of the share links created for a file.
569
+ * @alpha
570
+ */
571
+ export declare enum SharingLinkScope {
572
+ organization = "organization",
573
+ users = "users",
574
+ anonymous = "anonymous",
575
+ default = "default"
576
+ }
577
+
578
+ /* Excluded from this release type: snapshotKey */
579
+
580
+ /**
581
+ * Method signature for callback method used to fetch access token
582
+ * @param options - token fetch options
583
+ * @returns If successful, TokenResponse object representing token value along with flag indicating
584
+ * whether token came from cache. Legacy implementation may return a string for token value;
585
+ * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.
586
+ * @alpha
587
+ */
588
+ export declare type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
589
+
590
+ /**
591
+ * Represents access token fetch options
592
+ * @alpha
593
+ */
594
+ export declare interface TokenFetchOptions {
595
+ /**
596
+ * Value indicating whether fresh token has to be returned.
597
+ * If false then it is okay to return cached unexpired token if available.
598
+ */
599
+ refresh: boolean;
600
+ /**
601
+ * Claims that have to be passed with token fetch request.
602
+ * These can be used to specify additional information that must be passed to token authority.
603
+ */
604
+ claims?: string;
605
+ /**
606
+ * Tenant id of authority that must be handling token fetch.
607
+ * If it is not specified then it is up to token fetching logic to determine which tenant authority
608
+ * to use to issue access token.
609
+ */
610
+ tenantId?: string;
611
+ }
612
+
613
+ /* Excluded from this release type: tokenFromResponse */
614
+
615
+ /**
616
+ * Represents token response
617
+ * @beta
618
+ */
619
+ export declare interface TokenResponse {
620
+ /** Token value */
621
+ token: string;
622
+ /** Flag indicating whether token was obtained from local cache */
623
+ fromCache?: boolean;
624
+ }
625
+
626
+ export { }