@fluidframework/odsp-driver-definitions 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.1.0.0.232845
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/api-report/odsp-driver-definitions.api.md +3 -24
- package/dist/errors.d.ts +1 -55
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -56
- package/dist/errors.js.map +1 -1
- package/dist/factory.d.ts +7 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/odsp-driver-definitions-alpha.d.ts +19 -74
- package/dist/odsp-driver-definitions-beta.d.ts +4 -5
- package/dist/odsp-driver-definitions-public.d.ts +0 -4
- package/dist/odsp-driver-definitions-untrimmed.d.ts +19 -74
- package/dist/resolvedUrl.d.ts +1 -16
- package/dist/resolvedUrl.d.ts.map +1 -1
- package/dist/resolvedUrl.js +1 -10
- package/dist/resolvedUrl.js.map +1 -1
- package/dist/sessionProvider.d.ts +6 -0
- package/dist/sessionProvider.d.ts.map +1 -1
- package/dist/sessionProvider.js.map +1 -1
- package/dist/tokenFetch.d.ts +4 -1
- package/dist/tokenFetch.d.ts.map +1 -1
- package/dist/tokenFetch.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/errors.d.mts +1 -55
- package/lib/errors.d.mts.map +1 -1
- package/lib/errors.mjs +0 -55
- package/lib/errors.mjs.map +1 -1
- package/lib/factory.d.mts +7 -0
- package/lib/factory.d.mts.map +1 -1
- package/lib/factory.mjs.map +1 -1
- package/lib/index.d.mts +2 -2
- package/lib/index.d.mts.map +1 -1
- package/lib/index.mjs +2 -2
- package/lib/index.mjs.map +1 -1
- package/lib/odsp-driver-definitions-alpha.d.mts +19 -74
- package/lib/odsp-driver-definitions-beta.d.mts +4 -5
- package/lib/odsp-driver-definitions-public.d.mts +0 -4
- package/lib/odsp-driver-definitions-untrimmed.d.mts +19 -74
- package/lib/resolvedUrl.d.mts +1 -16
- package/lib/resolvedUrl.d.mts.map +1 -1
- package/lib/resolvedUrl.mjs +0 -9
- package/lib/resolvedUrl.mjs.map +1 -1
- package/lib/sessionProvider.d.mts +6 -0
- package/lib/sessionProvider.d.mts.map +1 -1
- package/lib/sessionProvider.mjs.map +1 -1
- package/lib/tokenFetch.d.mts +4 -1
- package/lib/tokenFetch.d.mts.map +1 -1
- package/lib/tokenFetch.mjs.map +1 -1
- package/package.json +15 -6
- package/src/errors.ts +1 -64
- package/src/factory.ts +5 -2
- package/src/index.ts +1 -8
- package/src/resolvedUrl.ts +1 -18
- package/src/sessionProvider.ts +7 -0
- package/src/tokenFetch.ts +4 -1
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -169,7 +169,7 @@ export declare interface IFileEntry {
|
|
|
169
169
|
* @alpha
|
|
170
170
|
*/
|
|
171
171
|
export declare interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
172
|
-
readonly errorType:
|
|
172
|
+
readonly errorType: OdspErrorTypes;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/**
|
|
@@ -333,6 +333,13 @@ export declare interface ISnapshotOptions {
|
|
|
333
333
|
blobs?: number;
|
|
334
334
|
deltas?: number;
|
|
335
335
|
channels?: number;
|
|
336
|
+
/**
|
|
337
|
+
* Maximum Data size (in bytes)
|
|
338
|
+
*
|
|
339
|
+
* @remarks
|
|
340
|
+
* If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
|
|
341
|
+
* if snapshot is bigger in size than specified limit.
|
|
342
|
+
*/
|
|
336
343
|
mds?: number;
|
|
337
344
|
timeout?: number;
|
|
338
345
|
}
|
|
@@ -362,6 +369,12 @@ export declare interface ISocketStorageDiscovery {
|
|
|
362
369
|
* This is the time within which client has to refresh the session on (ODSP) relay service.
|
|
363
370
|
*/
|
|
364
371
|
refreshSessionDurationSeconds?: number;
|
|
372
|
+
/**
|
|
373
|
+
* Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
|
|
374
|
+
* response will contain empty labels when the file has no labels, so this field will be there
|
|
375
|
+
* even if file has no labels when the service will implement this contract.
|
|
376
|
+
*/
|
|
377
|
+
sensitivityLabelsInfo?: string;
|
|
365
378
|
}
|
|
366
379
|
|
|
367
380
|
/* Excluded from this release type: isTokenFromCache */
|
|
@@ -371,61 +384,6 @@ export declare interface ISocketStorageDiscovery {
|
|
|
371
384
|
*/
|
|
372
385
|
export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
373
386
|
|
|
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
387
|
/**
|
|
430
388
|
* ODSP Error types.
|
|
431
389
|
* Different error types that may be thrown by the ODSP driver.
|
|
@@ -522,17 +480,10 @@ export declare interface ShareLinkInfoType {
|
|
|
522
480
|
* from the /snapshot api response.
|
|
523
481
|
*/
|
|
524
482
|
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
483
|
/**
|
|
533
484
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
534
485
|
*/
|
|
535
|
-
link?:
|
|
486
|
+
link?: ISharingLink;
|
|
536
487
|
/**
|
|
537
488
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
538
489
|
*/
|
|
@@ -546,15 +497,6 @@ export declare interface ShareLinkInfoType {
|
|
|
546
497
|
sharingLinkToRedeem?: string;
|
|
547
498
|
}
|
|
548
499
|
|
|
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
500
|
/**
|
|
559
501
|
* View/edit permission role for a sharing link.
|
|
560
502
|
* @alpha
|
|
@@ -619,7 +561,10 @@ export declare interface TokenFetchOptions {
|
|
|
619
561
|
export declare interface TokenResponse {
|
|
620
562
|
/** Token value */
|
|
621
563
|
token: string;
|
|
622
|
-
/**
|
|
564
|
+
/**
|
|
565
|
+
* Whether or not the token was obtained from local cache.
|
|
566
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
567
|
+
*/
|
|
623
568
|
fromCache?: boolean;
|
|
624
569
|
}
|
|
625
570
|
|
|
@@ -52,16 +52,12 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
52
52
|
|
|
53
53
|
/* Excluded from this release type: OdspError */
|
|
54
54
|
|
|
55
|
-
/* Excluded from this release type: OdspErrorType */
|
|
56
|
-
|
|
57
55
|
/* Excluded from this release type: OdspErrorTypes */
|
|
58
56
|
|
|
59
57
|
/* Excluded from this release type: OdspResourceTokenFetchOptions */
|
|
60
58
|
|
|
61
59
|
/* Excluded from this release type: ShareLinkInfoType */
|
|
62
60
|
|
|
63
|
-
/* Excluded from this release type: ShareLinkTypes */
|
|
64
|
-
|
|
65
61
|
/* Excluded from this release type: SharingLinkRole */
|
|
66
62
|
|
|
67
63
|
/* Excluded from this release type: SharingLinkScope */
|
|
@@ -81,7 +77,10 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
81
77
|
export declare interface TokenResponse {
|
|
82
78
|
/** Token value */
|
|
83
79
|
token: string;
|
|
84
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Whether or not the token was obtained from local cache.
|
|
82
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
83
|
+
*/
|
|
85
84
|
fromCache?: boolean;
|
|
86
85
|
}
|
|
87
86
|
|
|
@@ -52,16 +52,12 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
|
52
52
|
|
|
53
53
|
/* Excluded from this release type: OdspError */
|
|
54
54
|
|
|
55
|
-
/* Excluded from this release type: OdspErrorType */
|
|
56
|
-
|
|
57
55
|
/* Excluded from this release type: OdspErrorTypes */
|
|
58
56
|
|
|
59
57
|
/* Excluded from this release type: OdspResourceTokenFetchOptions */
|
|
60
58
|
|
|
61
59
|
/* Excluded from this release type: ShareLinkInfoType */
|
|
62
60
|
|
|
63
|
-
/* Excluded from this release type: ShareLinkTypes */
|
|
64
|
-
|
|
65
61
|
/* Excluded from this release type: SharingLinkRole */
|
|
66
62
|
|
|
67
63
|
/* Excluded from this release type: SharingLinkScope */
|
|
@@ -178,7 +178,7 @@ export declare type InstrumentedStorageTokenFetcher = (options: TokenFetchOption
|
|
|
178
178
|
* @alpha
|
|
179
179
|
*/
|
|
180
180
|
export declare interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
181
|
-
readonly errorType:
|
|
181
|
+
readonly errorType: OdspErrorTypes;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/**
|
|
@@ -342,6 +342,13 @@ export declare interface ISnapshotOptions {
|
|
|
342
342
|
blobs?: number;
|
|
343
343
|
deltas?: number;
|
|
344
344
|
channels?: number;
|
|
345
|
+
/**
|
|
346
|
+
* Maximum Data size (in bytes)
|
|
347
|
+
*
|
|
348
|
+
* @remarks
|
|
349
|
+
* If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
|
|
350
|
+
* if snapshot is bigger in size than specified limit.
|
|
351
|
+
*/
|
|
345
352
|
mds?: number;
|
|
346
353
|
timeout?: number;
|
|
347
354
|
}
|
|
@@ -371,6 +378,12 @@ export declare interface ISocketStorageDiscovery {
|
|
|
371
378
|
* This is the time within which client has to refresh the session on (ODSP) relay service.
|
|
372
379
|
*/
|
|
373
380
|
refreshSessionDurationSeconds?: number;
|
|
381
|
+
/**
|
|
382
|
+
* Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
|
|
383
|
+
* response will contain empty labels when the file has no labels, so this field will be there
|
|
384
|
+
* even if file has no labels when the service will implement this contract.
|
|
385
|
+
*/
|
|
386
|
+
sensitivityLabelsInfo?: string;
|
|
374
387
|
}
|
|
375
388
|
|
|
376
389
|
/**
|
|
@@ -387,61 +400,6 @@ export declare const isTokenFromCache: (tokenResponse: string | TokenResponse |
|
|
|
387
400
|
*/
|
|
388
401
|
export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
389
402
|
|
|
390
|
-
/**
|
|
391
|
-
* ODSP Error types.
|
|
392
|
-
* Different error types that may be thrown by the ODSP driver.
|
|
393
|
-
*
|
|
394
|
-
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
395
|
-
* @alpha
|
|
396
|
-
*/
|
|
397
|
-
export declare enum OdspErrorType {
|
|
398
|
-
/**
|
|
399
|
-
* Storage is out of space
|
|
400
|
-
*/
|
|
401
|
-
outOfStorageError = "outOfStorageError",
|
|
402
|
-
/**
|
|
403
|
-
* Invalid file name (at creation of the file)
|
|
404
|
-
*/
|
|
405
|
-
invalidFileNameError = "invalidFileNameError",
|
|
406
|
-
/**
|
|
407
|
-
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
408
|
-
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
409
|
-
* such case.
|
|
410
|
-
*/
|
|
411
|
-
snapshotTooBig = "snapshotTooBig",
|
|
412
|
-
/**
|
|
413
|
-
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
414
|
-
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
415
|
-
* such case.
|
|
416
|
-
*/
|
|
417
|
-
fetchTimeout = "fetchTimeout",
|
|
418
|
-
/**
|
|
419
|
-
* SPO admin toggle: fluid service is not enabled.
|
|
420
|
-
*/
|
|
421
|
-
fluidNotEnabled = "fluidNotEnabled",
|
|
422
|
-
/**
|
|
423
|
-
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
424
|
-
*/
|
|
425
|
-
fetchTokenError = "fetchTokenError",
|
|
426
|
-
/**
|
|
427
|
-
* This error will be raised when client is too behind with no way to catch up.
|
|
428
|
-
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
429
|
-
* by storage, and thus removing an ability for client to catch up.
|
|
430
|
-
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
431
|
-
* copying it over manually)
|
|
432
|
-
*/
|
|
433
|
-
cannotCatchUp = "cannotCatchUp",
|
|
434
|
-
/**
|
|
435
|
-
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
436
|
-
* So to preserve integrity of the data, the data becomes readonly.
|
|
437
|
-
*/
|
|
438
|
-
serviceReadOnly = "serviceReadOnly",
|
|
439
|
-
/**
|
|
440
|
-
* Due to organizational policies, you can't access server resources from the current network location.
|
|
441
|
-
*/
|
|
442
|
-
blockedIPAddress = "blockedIPAddress"
|
|
443
|
-
}
|
|
444
|
-
|
|
445
403
|
/**
|
|
446
404
|
* ODSP Error types.
|
|
447
405
|
* Different error types that may be thrown by the ODSP driver.
|
|
@@ -538,17 +496,10 @@ export declare interface ShareLinkInfoType {
|
|
|
538
496
|
* from the /snapshot api response.
|
|
539
497
|
*/
|
|
540
498
|
createLink?: {
|
|
541
|
-
/**
|
|
542
|
-
* @deprecated
|
|
543
|
-
* Type of shareLink requested/created when creating the file for the first time. The 'type' property here
|
|
544
|
-
* represents the type of sharing link requested.
|
|
545
|
-
* Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
|
|
546
|
-
*/
|
|
547
|
-
type?: ShareLinkTypes | ISharingLinkKind;
|
|
548
499
|
/**
|
|
549
500
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
550
501
|
*/
|
|
551
|
-
link?:
|
|
502
|
+
link?: ISharingLink;
|
|
552
503
|
/**
|
|
553
504
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
554
505
|
*/
|
|
@@ -562,15 +513,6 @@ export declare interface ShareLinkInfoType {
|
|
|
562
513
|
sharingLinkToRedeem?: string;
|
|
563
514
|
}
|
|
564
515
|
|
|
565
|
-
/**
|
|
566
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
567
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
568
|
-
* @alpha
|
|
569
|
-
*/
|
|
570
|
-
export declare enum ShareLinkTypes {
|
|
571
|
-
csl = "csl"
|
|
572
|
-
}
|
|
573
|
-
|
|
574
516
|
/**
|
|
575
517
|
* View/edit permission role for a sharing link.
|
|
576
518
|
* @alpha
|
|
@@ -645,7 +587,10 @@ export declare const tokenFromResponse: (tokenResponse: string | TokenResponse |
|
|
|
645
587
|
export declare interface TokenResponse {
|
|
646
588
|
/** Token value */
|
|
647
589
|
token: string;
|
|
648
|
-
/**
|
|
590
|
+
/**
|
|
591
|
+
* Whether or not the token was obtained from local cache.
|
|
592
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
593
|
+
*/
|
|
649
594
|
fromCache?: boolean;
|
|
650
595
|
}
|
|
651
596
|
|
package/lib/resolvedUrl.d.mts
CHANGED
|
@@ -11,14 +11,6 @@ export interface IOdspUrlParts {
|
|
|
11
11
|
driveId: string;
|
|
12
12
|
itemId: string;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
16
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
17
|
-
* @alpha
|
|
18
|
-
*/
|
|
19
|
-
export declare enum ShareLinkTypes {
|
|
20
|
-
csl = "csl"
|
|
21
|
-
}
|
|
22
14
|
/**
|
|
23
15
|
* Sharing scope of the share links created for a file.
|
|
24
16
|
* @alpha
|
|
@@ -68,17 +60,10 @@ export interface ShareLinkInfoType {
|
|
|
68
60
|
* from the /snapshot api response.
|
|
69
61
|
*/
|
|
70
62
|
createLink?: {
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated
|
|
73
|
-
* Type of shareLink requested/created when creating the file for the first time. The 'type' property here
|
|
74
|
-
* represents the type of sharing link requested.
|
|
75
|
-
* Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
|
|
76
|
-
*/
|
|
77
|
-
type?: ShareLinkTypes | ISharingLinkKind;
|
|
78
63
|
/**
|
|
79
64
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
80
65
|
*/
|
|
81
|
-
link?:
|
|
66
|
+
link?: ISharingLink;
|
|
82
67
|
/**
|
|
83
68
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
84
69
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.d.mts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAEjE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED
|
|
1
|
+
{"version":3,"file":"resolvedUrl.d.mts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAEjE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACnB;AAED;;;GAGG;AACH,oBAAY,eAAe;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IAKxB,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QACZ;;WAEG;QACH,IAAI,CAAC,EAAE,YAAY,CAAC;QAEpB;;WAEG;QACH,KAAK,CAAC,EAAE,GAAG,CAAC;QAEZ,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AACD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY,EAAE,aAAa;IACpE,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,IAAI,CAAC;IAGtB,GAAG,EAAE,MAAM,CAAC;IAGZ,gBAAgB,EAAE,MAAM,CAAC;IAEzB,SAAS,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,wBAAwB,EAAE,MAAM,CAAC;QACjC,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;IAIF,MAAM,EAAE,EAAE,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE;QAGV,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IAEF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
package/lib/resolvedUrl.mjs
CHANGED
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use ISharingLinkKind type instead.
|
|
7
|
-
* Type of shareLink requested/created when creating the file for the first time.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export var ShareLinkTypes;
|
|
11
|
-
(function (ShareLinkTypes) {
|
|
12
|
-
ShareLinkTypes["csl"] = "csl";
|
|
13
|
-
})(ShareLinkTypes || (ShareLinkTypes = {}));
|
|
14
5
|
/**
|
|
15
6
|
* Sharing scope of the share links created for a file.
|
|
16
7
|
* @alpha
|
package/lib/resolvedUrl.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.mjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH
|
|
1
|
+
{"version":3,"file":"resolvedUrl.mjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * @alpha\n */\nexport interface IOdspUrlParts {\n\tsiteUrl: string;\n\tdriveId: string;\n\titemId: string;\n}\n\n/**\n * Sharing scope of the share links created for a file.\n * @alpha\n */\nexport enum SharingLinkScope {\n\torganization = \"organization\",\n\tusers = \"users\",\n\tanonymous = \"anonymous\",\n\tdefault = \"default\",\n}\n\n/**\n * View/edit permission role for a sharing link.\n * @alpha\n */\nexport enum SharingLinkRole {\n\tview = \"view\",\n\tedit = \"edit\",\n}\n\n/**\n * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.\n * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.\n * @alpha\n */\nexport interface ISharingLinkKind {\n\tscope: SharingLinkScope;\n\t/*\n\t * If this parameter is not provided, the API will default to \"edit\" links (provided\n\t * a valid createLinkScope setting is given).\n\t */\n\trole?: SharingLinkRole;\n}\n\n/**\n * Sharing link data received from the /snapshot api response.\n * @alpha\n */\nexport interface ISharingLink extends ISharingLinkKind {\n\twebUrl: string;\n}\n\n/**\n * Sharing link data created for the ODSP item.\n * Contains information about either sharing link created while creating a new file or\n * a redeemable share link created when loading an existing file\n * @alpha\n */\nexport interface ShareLinkInfoType {\n\t/**\n\t * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to\n\t * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature\n\t * where we can create a share link along with creating a file by passing a query parameter called\n\t * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information\n\t * from the /snapshot api response.\n\t */\n\tcreateLink?: {\n\t\t/**\n\t\t * Share link created when the file is created for the first time with /snapshot api call.\n\t\t */\n\t\tlink?: ISharingLink;\n\n\t\t/**\n\t\t * Error message if creation of sharing link fails with /snapshot api call\n\t\t */\n\t\terror?: any;\n\n\t\tshareId?: string;\n\t};\n\n\t/**\n\t * This is used to save the network calls while doing trees/latest call as if the client does not have\n\t * permission then this link can be redeemed for the permissions in the same network call.\n\t */\n\tsharingLinkToRedeem?: string;\n}\n/**\n * @alpha\n */\nexport interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {\n\ttype: \"fluid\";\n\todspResolvedUrl: true;\n\n\t// URL to send to fluid, contains the documentId and the path\n\turl: string;\n\n\t// A hashed identifier that is unique to this document\n\thashedDocumentId: string;\n\n\tendpoints: {\n\t\tsnapshotStorageUrl: string;\n\t\tattachmentPOSTStorageUrl: string;\n\t\tattachmentGETStorageUrl: string;\n\t\tdeltaStorageUrl: string;\n\t};\n\n\t// Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n\ttokens: {};\n\n\tfileName: string;\n\n\tsummarizer: boolean;\n\n\tcodeHint?: {\n\t\t// containerPackageName is used for adding the package name to the request headers.\n\t\t// This may be used for preloading the container package when loading Fluid content.\n\t\tcontainerPackageName?: string;\n\t};\n\n\tfileVersion: string | undefined;\n\n\tdataStorePath?: string;\n\n\t/**\n\t * Sharing link data created for the ODSP item.\n\t * Contains information about either sharing link created while creating a new file or\n\t * a redeemable share link created when loading an existing file\n\t */\n\tshareLinkInfo?: ShareLinkInfoType;\n\n\tisClpCompliantApp?: boolean;\n}\n"]}
|
|
@@ -28,6 +28,12 @@ export interface ISocketStorageDiscovery {
|
|
|
28
28
|
* This is the time within which client has to refresh the session on (ODSP) relay service.
|
|
29
29
|
*/
|
|
30
30
|
refreshSessionDurationSeconds?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
|
|
33
|
+
* response will contain empty labels when the file has no labels, so this field will be there
|
|
34
|
+
* even if file has no labels when the service will implement this contract.
|
|
35
|
+
*/
|
|
36
|
+
sensitivityLabelsInfo?: string;
|
|
31
37
|
}
|
|
32
38
|
/**
|
|
33
39
|
* An interface that allows a concrete instance of a driver factory to interrogate itself
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionProvider.d.mts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAEjE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEvC,EAAE,EAAE,MAAM,CAAC;IAIX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sessionProvider.d.mts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAEjE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEvC,EAAE,EAAE,MAAM,CAAC;IAIX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAEvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IACjD,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;CAC1E;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iCAAiC;IACzF,0BAA0B,CACzB,WAAW,EAAE,YAAY,GACvB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionProvider.mjs","sourceRoot":"","sources":["../src/sessionProvider.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 { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * Socket storage discovery api response\n * @alpha\n */\nexport interface ISocketStorageDiscovery {\n\t// The id of the web socket\n\tid: string;\n\n\t// SPO gives us runtimeTenantId, we remap it to tenantId\n\t// See getSocketStorageDiscovery\n\truntimeTenantId?: string;\n\ttenantId: string;\n\n\tsnapshotStorageUrl: string;\n\tdeltaStorageUrl: string;\n\n\t/**\n\t * PUSH URL\n\t */\n\tdeltaStreamSocketUrl: string;\n\n\t/**\n\t * The access token for PushChannel. Optionally returned, depending on implementation.\n\t * OneDrive for Consumer implementation returns it and OneDrive for Business implementation\n\t * does not return it and instead expects token to be returned via `getWebsocketToken` callback\n\t * passed as a parameter to `OdspDocumentService.create()` factory.\n\t */\n\tsocketToken?: string;\n\n\t/**\n\t * This is the time within which client has to refresh the session on (ODSP) relay service.\n\t */\n\trefreshSessionDurationSeconds?: number;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to interrogate itself\n * to find out if it is session aware.\n * @alpha\n */\nexport interface IProvideSessionAwareDriverFactory {\n\treadonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`\n * function if it session aware.\n * @alpha\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sessionProvider.mjs","sourceRoot":"","sources":["../src/sessionProvider.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 { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * Socket storage discovery api response\n * @alpha\n */\nexport interface ISocketStorageDiscovery {\n\t// The id of the web socket\n\tid: string;\n\n\t// SPO gives us runtimeTenantId, we remap it to tenantId\n\t// See getSocketStorageDiscovery\n\truntimeTenantId?: string;\n\ttenantId: string;\n\n\tsnapshotStorageUrl: string;\n\tdeltaStorageUrl: string;\n\n\t/**\n\t * PUSH URL\n\t */\n\tdeltaStreamSocketUrl: string;\n\n\t/**\n\t * The access token for PushChannel. Optionally returned, depending on implementation.\n\t * OneDrive for Consumer implementation returns it and OneDrive for Business implementation\n\t * does not return it and instead expects token to be returned via `getWebsocketToken` callback\n\t * passed as a parameter to `OdspDocumentService.create()` factory.\n\t */\n\tsocketToken?: string;\n\n\t/**\n\t * This is the time within which client has to refresh the session on (ODSP) relay service.\n\t */\n\trefreshSessionDurationSeconds?: number;\n\n\t/**\n\t * Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The\n\t * response will contain empty labels when the file has no labels, so this field will be there\n\t * even if file has no labels when the service will implement this contract.\n\t */\n\tsensitivityLabelsInfo?: string;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to interrogate itself\n * to find out if it is session aware.\n * @alpha\n */\nexport interface IProvideSessionAwareDriverFactory {\n\treadonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`\n * function if it session aware.\n * @alpha\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
|
package/lib/tokenFetch.d.mts
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
export interface TokenResponse {
|
|
10
10
|
/** Token value */
|
|
11
11
|
token: string;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Whether or not the token was obtained from local cache.
|
|
14
|
+
* @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
|
|
15
|
+
*/
|
|
13
16
|
fromCache?: boolean;
|
|
14
17
|
}
|
|
15
18
|
/**
|
package/lib/tokenFetch.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.d.mts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd
|
|
1
|
+
{"version":3,"file":"tokenFetch.d.mts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACd,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,KACtD,MAAM,GAAG,IAKW,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,kBACb,MAAM,GAAG,aAAa,GAAG,IAAI,KAC1C,OAAO,GAAG,SAGc,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
|
package/lib/tokenFetch.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.mjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"tokenFetch.mjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC7B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t? null\n\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver-definitions",
|
|
3
|
-
"version": "2.0.0-dev-rc.1.0.0.
|
|
3
|
+
"version": "2.0.0-dev-rc.1.0.0.232845",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"module": "lib/index.mjs",
|
|
68
68
|
"types": "dist/index.d.ts",
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluidframework/driver-definitions": "2.0.0-dev-rc.1.0.0.
|
|
70
|
+
"@fluidframework/driver-definitions": "2.0.0-dev-rc.1.0.0.232845"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@arethetypeswrong/cli": "^0.13.3",
|
|
74
74
|
"@fluid-tools/build-cli": "^0.29.0",
|
|
75
75
|
"@fluidframework/build-common": "^2.0.3",
|
|
76
76
|
"@fluidframework/build-tools": "^0.29.0",
|
|
77
|
-
"@fluidframework/eslint-config-fluid": "^3.
|
|
77
|
+
"@fluidframework/eslint-config-fluid": "^3.3.0",
|
|
78
78
|
"@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-internal.8.0.0",
|
|
79
|
-
"@fluidframework/protocol-definitions": "^3.
|
|
80
|
-
"@microsoft/api-extractor": "^7.
|
|
79
|
+
"@fluidframework/protocol-definitions": "^3.2.0-231454",
|
|
80
|
+
"@microsoft/api-extractor": "^7.39.1",
|
|
81
81
|
"copyfiles": "^2.4.1",
|
|
82
82
|
"cross-env": "^7.0.3",
|
|
83
83
|
"eslint": "~8.50.0",
|
|
@@ -99,7 +99,16 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"typeValidation": {
|
|
102
|
-
"broken": {
|
|
102
|
+
"broken": {
|
|
103
|
+
"RemovedEnumDeclaration_OdspErrorType": {
|
|
104
|
+
"forwardCompat": false,
|
|
105
|
+
"backCompat": false
|
|
106
|
+
},
|
|
107
|
+
"RemovedEnumDeclaration_ShareLinkTypes": {
|
|
108
|
+
"backCompat": false,
|
|
109
|
+
"forwardCompat": false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
103
112
|
},
|
|
104
113
|
"scripts": {
|
|
105
114
|
"api": "fluid-build . --task api",
|
package/src/errors.ts
CHANGED
|
@@ -66,69 +66,6 @@ export const OdspErrorTypes = {
|
|
|
66
66
|
*/
|
|
67
67
|
export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
* ODSP Error types.
|
|
71
|
-
* Different error types that may be thrown by the ODSP driver.
|
|
72
|
-
*
|
|
73
|
-
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
74
|
-
* @alpha
|
|
75
|
-
*/
|
|
76
|
-
export enum OdspErrorType {
|
|
77
|
-
/**
|
|
78
|
-
* Storage is out of space
|
|
79
|
-
*/
|
|
80
|
-
outOfStorageError = "outOfStorageError",
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Invalid file name (at creation of the file)
|
|
84
|
-
*/
|
|
85
|
-
invalidFileNameError = "invalidFileNameError",
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
89
|
-
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
90
|
-
* such case.
|
|
91
|
-
*/
|
|
92
|
-
snapshotTooBig = "snapshotTooBig",
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
96
|
-
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
97
|
-
* such case.
|
|
98
|
-
*/
|
|
99
|
-
fetchTimeout = "fetchTimeout",
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* SPO admin toggle: fluid service is not enabled.
|
|
103
|
-
*/
|
|
104
|
-
fluidNotEnabled = "fluidNotEnabled",
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
108
|
-
*/
|
|
109
|
-
fetchTokenError = "fetchTokenError",
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* This error will be raised when client is too behind with no way to catch up.
|
|
113
|
-
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
114
|
-
* by storage, and thus removing an ability for client to catch up.
|
|
115
|
-
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
116
|
-
* copying it over manually)
|
|
117
|
-
*/
|
|
118
|
-
cannotCatchUp = "cannotCatchUp",
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
122
|
-
* So to preserve integrity of the data, the data becomes readonly.
|
|
123
|
-
*/
|
|
124
|
-
serviceReadOnly = "serviceReadOnly",
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Due to organizational policies, you can't access server resources from the current network location.
|
|
128
|
-
*/
|
|
129
|
-
blockedIPAddress = "blockedIPAddress",
|
|
130
|
-
}
|
|
131
|
-
|
|
132
69
|
/**
|
|
133
70
|
* @alpha
|
|
134
71
|
*/
|
|
@@ -157,7 +94,7 @@ export interface IOdspErrorAugmentations {
|
|
|
157
94
|
* @alpha
|
|
158
95
|
*/
|
|
159
96
|
export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
160
|
-
readonly errorType:
|
|
97
|
+
readonly errorType: OdspErrorTypes;
|
|
161
98
|
}
|
|
162
99
|
|
|
163
100
|
/**
|
package/src/factory.ts
CHANGED
|
@@ -10,9 +10,12 @@ export interface ISnapshotOptions {
|
|
|
10
10
|
blobs?: number;
|
|
11
11
|
deltas?: number;
|
|
12
12
|
channels?: number;
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
/**
|
|
14
15
|
* Maximum Data size (in bytes)
|
|
15
|
-
*
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
|
|
16
19
|
* if snapshot is bigger in size than specified limit.
|
|
17
20
|
*/
|
|
18
21
|
mds?: number;
|