@fluidframework/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/driver-definitions.api.md +36 -30
- package/dist/driver-definitions-alpha.d.ts +77 -99
- package/dist/driver-definitions-beta.d.ts +11 -93
- package/dist/driver-definitions-public.d.ts +11 -93
- package/dist/driver-definitions-untrimmed.d.ts +77 -99
- package/dist/driverError.d.ts +9 -97
- package/dist/driverError.d.ts.map +1 -1
- package/dist/driverError.js +1 -95
- package/dist/driverError.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/storage.d.ts +65 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/driver-definitions-alpha.d.mts +77 -99
- package/lib/driver-definitions-beta.d.mts +11 -93
- package/lib/driver-definitions-public.d.mts +11 -93
- package/lib/driver-definitions-untrimmed.d.mts +77 -99
- package/lib/driverError.d.mts +9 -97
- package/lib/driverError.d.mts.map +1 -1
- package/lib/driverError.mjs +0 -94
- package/lib/driverError.mjs.map +1 -1
- package/lib/index.d.mts +2 -2
- package/lib/index.d.mts.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/storage.d.mts +65 -2
- package/lib/storage.d.mts.map +1 -1
- package/lib/storage.mjs.map +1 -1
- package/lib/test/types/validateDriverDefinitionsPrevious.generated.mjs +3 -3
- package/lib/test/types/validateDriverDefinitionsPrevious.generated.mjs.map +1 -1
- package/package.json +14 -6
- package/src/driverError.ts +21 -130
- package/src/index.ts +3 -1
- package/src/storage.ts +74 -1
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -5,6 +5,7 @@ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
|
5
5
|
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
6
6
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
7
7
|
import { IErrorEvent } from '@fluidframework/core-interfaces';
|
|
8
|
+
import { IEvent } from '@fluidframework/core-interfaces';
|
|
8
9
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
9
10
|
import { INack } from '@fluidframework/protocol-definitions';
|
|
10
11
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
@@ -23,97 +24,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
|
|
|
23
24
|
*/
|
|
24
25
|
export declare type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
|
|
25
26
|
|
|
26
|
-
/**
|
|
27
|
-
* Driver Error types
|
|
28
|
-
* Lists types that are likely to be used by all drivers
|
|
29
|
-
*
|
|
30
|
-
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
31
|
-
* @public
|
|
32
|
-
*/
|
|
33
|
-
export declare enum DriverErrorType {
|
|
34
|
-
/**
|
|
35
|
-
* A fatal error with no specific interpretation covered by other DriverErrorType values
|
|
36
|
-
*/
|
|
37
|
-
genericError = "genericError",
|
|
38
|
-
/**
|
|
39
|
-
* Some non-categorized (below) networking error
|
|
40
|
-
* Include errors like fatal server error (usually 500).
|
|
41
|
-
*/
|
|
42
|
-
genericNetworkError = "genericNetworkError",
|
|
43
|
-
/**
|
|
44
|
-
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
45
|
-
*/
|
|
46
|
-
authorizationError = "authorizationError",
|
|
47
|
-
/**
|
|
48
|
-
* File not found, or file deleted during session
|
|
49
|
-
*/
|
|
50
|
-
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
51
|
-
/**
|
|
52
|
-
* Throttling error from server. Server is busy and is asking not to reconnect for some time
|
|
53
|
-
*/
|
|
54
|
-
throttlingError = "throttlingError",
|
|
55
|
-
/**
|
|
56
|
-
* We can not reach server due to computer being offline.
|
|
57
|
-
*/
|
|
58
|
-
offlineError = "offlineError",
|
|
59
|
-
unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
|
|
60
|
-
/**
|
|
61
|
-
* User does not have write permissions to a file, but is changing content of a file.
|
|
62
|
-
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
63
|
-
*/
|
|
64
|
-
writeError = "writeError",
|
|
65
|
-
/**
|
|
66
|
-
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
67
|
-
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
68
|
-
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
69
|
-
* CSP violation, etc.
|
|
70
|
-
*/
|
|
71
|
-
fetchFailure = "fetchFailure",
|
|
72
|
-
/**
|
|
73
|
-
* This error occurs when token provider fails to fetch orderer token
|
|
74
|
-
*/
|
|
75
|
-
fetchTokenError = "fetchTokenError",
|
|
76
|
-
/**
|
|
77
|
-
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
78
|
-
*/
|
|
79
|
-
incorrectServerResponse = "incorrectServerResponse",
|
|
80
|
-
/**
|
|
81
|
-
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
82
|
-
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
83
|
-
* and storage / driver / loader detects such mismatch.
|
|
84
|
-
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
85
|
-
*/
|
|
86
|
-
fileOverwrittenInStorage = "fileOverwrittenInStorage",
|
|
87
|
-
/**
|
|
88
|
-
* The document is read-only and delta stream connection is forbidden.
|
|
89
|
-
*/
|
|
90
|
-
deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
|
|
91
|
-
/**
|
|
92
|
-
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
93
|
-
* location, then this error is thrown to let the client know about the new location info.
|
|
94
|
-
*/
|
|
95
|
-
locationRedirection = "locationRedirection",
|
|
96
|
-
/**
|
|
97
|
-
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
98
|
-
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
99
|
-
* "fluidInvalidSchema"
|
|
100
|
-
*/
|
|
101
|
-
fluidInvalidSchema = "fluidInvalidSchema",
|
|
102
|
-
/**
|
|
103
|
-
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
104
|
-
* ! Should match the value of ContainerErrorType.usageError
|
|
105
|
-
*/
|
|
106
|
-
usageError = "usageError",
|
|
107
|
-
/**
|
|
108
|
-
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
109
|
-
*/
|
|
110
|
-
fileIsLocked = "fileIsLocked",
|
|
111
|
-
/**
|
|
112
|
-
* Storage is out of space
|
|
113
|
-
*/
|
|
114
|
-
outOfStorageError = "outOfStorageError"
|
|
115
|
-
}
|
|
116
|
-
|
|
117
27
|
/**
|
|
118
28
|
* Different error types the Driver may report out to the Host.
|
|
119
29
|
* @public
|
|
@@ -238,11 +148,13 @@ export declare type FiveDaysMs = 432000000;
|
|
|
238
148
|
|
|
239
149
|
/**
|
|
240
150
|
* Interface describing errors and warnings raised by any driver code.
|
|
151
|
+
*
|
|
152
|
+
* @remarks
|
|
241
153
|
* Not expected to be implemented by a class or an object literal, but rather used in place of
|
|
242
154
|
* any or unknown in various function signatures that pass errors around.
|
|
243
155
|
*
|
|
244
156
|
* "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
|
|
245
|
-
* It will be either
|
|
157
|
+
* It will be either {@link @fluidframework/driver-definitions#(DriverErrorTypes:variable)} or the specific driver's specialized error type enum,
|
|
246
158
|
* but we can't reference a specific driver's error type enum in this code.
|
|
247
159
|
* @public
|
|
248
160
|
*/
|
|
@@ -254,7 +166,7 @@ export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorTy
|
|
|
254
166
|
* @alpha
|
|
255
167
|
*/
|
|
256
168
|
export declare interface IAuthorizationError extends IDriverErrorBase {
|
|
257
|
-
readonly errorType:
|
|
169
|
+
readonly errorType: typeof DriverErrorTypes.authorizationError;
|
|
258
170
|
readonly claims?: string;
|
|
259
171
|
readonly tenantId?: string;
|
|
260
172
|
}
|
|
@@ -405,7 +317,7 @@ export declare interface IDocumentDeltaStorageService {
|
|
|
405
317
|
/**
|
|
406
318
|
* @alpha
|
|
407
319
|
*/
|
|
408
|
-
export declare interface IDocumentService {
|
|
320
|
+
export declare interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {
|
|
409
321
|
resolvedUrl: IResolvedUrl;
|
|
410
322
|
/**
|
|
411
323
|
* Policies implemented/instructed by driver.
|
|
@@ -436,6 +348,18 @@ export declare interface IDocumentService {
|
|
|
436
348
|
dispose(error?: any): void;
|
|
437
349
|
}
|
|
438
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Events emitted by {@link IDocumentService}.
|
|
353
|
+
* @alpha
|
|
354
|
+
*/
|
|
355
|
+
export declare interface IDocumentServiceEvents extends IEvent {
|
|
356
|
+
/**
|
|
357
|
+
* This event is used to communicate any metadata related to the container. We might have received metadata from the service.
|
|
358
|
+
* Read more info on this event from here `IContainer.containerMetadata`.
|
|
359
|
+
*/
|
|
360
|
+
(event: "metadataUpdate", listener: (metadata: Record<string, string>) => void): any;
|
|
361
|
+
}
|
|
362
|
+
|
|
439
363
|
/**
|
|
440
364
|
* @alpha
|
|
441
365
|
*/
|
|
@@ -478,6 +402,12 @@ export declare interface IDocumentServicePolicies {
|
|
|
478
402
|
* Summarizer uploads the protocol tree too when summarizing.
|
|
479
403
|
*/
|
|
480
404
|
readonly summarizeProtocolTree?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* Whether the driver supports the new getSnapshot api which returns snapshot which
|
|
407
|
+
* contains all contents along with the snapshot tree. Enable this by default when the
|
|
408
|
+
* driver can fully support the api.
|
|
409
|
+
*/
|
|
410
|
+
readonly supportGetSnapshotApi?: boolean;
|
|
481
411
|
}
|
|
482
412
|
|
|
483
413
|
/**
|
|
@@ -497,6 +427,13 @@ export declare interface IDocumentStorageService extends Partial<IDisposable> {
|
|
|
497
427
|
* in debugging purposes to see why this call was made.
|
|
498
428
|
*/
|
|
499
429
|
getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
|
|
430
|
+
/**
|
|
431
|
+
* Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from
|
|
432
|
+
* `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.
|
|
433
|
+
* @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the
|
|
434
|
+
* driver when fetching the snapshot.
|
|
435
|
+
*/
|
|
436
|
+
getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
|
|
500
437
|
/**
|
|
501
438
|
* Retrieves all versions of the document starting at the specified versionId - or null if from the head
|
|
502
439
|
* @param versionId - Version id of the requested version.
|
|
@@ -558,7 +495,7 @@ export declare interface IDocumentStorageServicePolicies {
|
|
|
558
495
|
* @alpha
|
|
559
496
|
*/
|
|
560
497
|
export declare interface IDriverBasicError extends IDriverErrorBase {
|
|
561
|
-
readonly errorType:
|
|
498
|
+
readonly errorType: typeof DriverErrorTypes.genericError | typeof DriverErrorTypes.fileNotFoundOrAccessDeniedError | typeof DriverErrorTypes.offlineError | typeof DriverErrorTypes.unsupportedClientProtocolVersion | typeof DriverErrorTypes.writeError | typeof DriverErrorTypes.fetchFailure | typeof DriverErrorTypes.fetchTokenError | typeof DriverErrorTypes.incorrectServerResponse | typeof DriverErrorTypes.fileOverwrittenInStorage | typeof DriverErrorTypes.fluidInvalidSchema | typeof DriverErrorTypes.usageError | typeof DriverErrorTypes.fileIsLocked | typeof DriverErrorTypes.outOfStorageError;
|
|
562
499
|
readonly statusCode?: number;
|
|
563
500
|
}
|
|
564
501
|
|
|
@@ -572,7 +509,7 @@ export declare interface IDriverErrorBase {
|
|
|
572
509
|
*
|
|
573
510
|
* @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
|
|
574
511
|
*/
|
|
575
|
-
readonly errorType:
|
|
512
|
+
readonly errorType: DriverErrorTypes;
|
|
576
513
|
/**
|
|
577
514
|
* Free-form error message
|
|
578
515
|
*/
|
|
@@ -604,7 +541,7 @@ export declare interface IDriverHeader {
|
|
|
604
541
|
* @alpha
|
|
605
542
|
*/
|
|
606
543
|
export declare interface IGenericNetworkError extends IDriverErrorBase {
|
|
607
|
-
readonly errorType:
|
|
544
|
+
readonly errorType: typeof DriverErrorTypes.genericNetworkError;
|
|
608
545
|
readonly statusCode?: number;
|
|
609
546
|
}
|
|
610
547
|
|
|
@@ -612,7 +549,7 @@ export declare interface IGenericNetworkError extends IDriverErrorBase {
|
|
|
612
549
|
* @alpha
|
|
613
550
|
*/
|
|
614
551
|
export declare interface ILocationRedirectionError extends IDriverErrorBase {
|
|
615
|
-
readonly errorType:
|
|
552
|
+
readonly errorType: typeof DriverErrorTypes.locationRedirection;
|
|
616
553
|
readonly redirectUrl: IResolvedUrl;
|
|
617
554
|
}
|
|
618
555
|
|
|
@@ -634,6 +571,47 @@ export declare interface IResolvedUrl {
|
|
|
634
571
|
};
|
|
635
572
|
}
|
|
636
573
|
|
|
574
|
+
/**
|
|
575
|
+
* @alpha
|
|
576
|
+
*/
|
|
577
|
+
export declare interface ISnapshot {
|
|
578
|
+
snapshotTree: ISnapshotTree;
|
|
579
|
+
blobContents: Map<string, ArrayBuffer>;
|
|
580
|
+
ops: ISequencedDocumentMessage[];
|
|
581
|
+
/**
|
|
582
|
+
* Sequence number of the snapshot
|
|
583
|
+
*/
|
|
584
|
+
sequenceNumber: number | undefined;
|
|
585
|
+
/**
|
|
586
|
+
* Sequence number for the latest op/snapshot for the file in ODSP
|
|
587
|
+
*/
|
|
588
|
+
latestSequenceNumber: number | undefined;
|
|
589
|
+
snapshotFormatV: 1;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Snapshot fetch options which are used to communicate different things to the driver
|
|
594
|
+
* when fetching the snapshot.
|
|
595
|
+
* @alpha
|
|
596
|
+
*/
|
|
597
|
+
export declare interface ISnapshotFetchOptions {
|
|
598
|
+
/**
|
|
599
|
+
* Indicates scenario in which the snapshot is fetched. It is a free form string mostly
|
|
600
|
+
* used for telemetry purposes.
|
|
601
|
+
*/
|
|
602
|
+
scenarioName?: string;
|
|
603
|
+
/**
|
|
604
|
+
* Tell driver to cache the fetched snapshot. Driver is supposed to cache the fetched snapshot if this is
|
|
605
|
+
* set to true. If undefined, then it is upto the driver, to cache it or not.
|
|
606
|
+
*/
|
|
607
|
+
cacheSnapshot?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Version of the snapshot to be fetched. Certain storage services just keep 1 snapshot for the
|
|
610
|
+
* container, so specifying version is not necessary for storage services.
|
|
611
|
+
*/
|
|
612
|
+
versionId?: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
637
615
|
/**
|
|
638
616
|
* Read interface for the Queue
|
|
639
617
|
* @alpha
|
|
@@ -673,7 +651,7 @@ export declare interface ISummaryContext {
|
|
|
673
651
|
* @alpha
|
|
674
652
|
*/
|
|
675
653
|
export declare interface IThrottlingWarning extends IDriverErrorBase {
|
|
676
|
-
readonly errorType:
|
|
654
|
+
readonly errorType: typeof DriverErrorTypes.throttlingError;
|
|
677
655
|
readonly retryAfterSeconds: number;
|
|
678
656
|
}
|
|
679
657
|
|
package/lib/driverError.d.mts
CHANGED
|
@@ -84,103 +84,15 @@ export declare const DriverErrorTypes: {
|
|
|
84
84
|
* @public
|
|
85
85
|
*/
|
|
86
86
|
export type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];
|
|
87
|
-
/**
|
|
88
|
-
* Driver Error types
|
|
89
|
-
* Lists types that are likely to be used by all drivers
|
|
90
|
-
*
|
|
91
|
-
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export declare enum DriverErrorType {
|
|
95
|
-
/**
|
|
96
|
-
* A fatal error with no specific interpretation covered by other DriverErrorType values
|
|
97
|
-
*/
|
|
98
|
-
genericError = "genericError",
|
|
99
|
-
/**
|
|
100
|
-
* Some non-categorized (below) networking error
|
|
101
|
-
* Include errors like fatal server error (usually 500).
|
|
102
|
-
*/
|
|
103
|
-
genericNetworkError = "genericNetworkError",
|
|
104
|
-
/**
|
|
105
|
-
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
106
|
-
*/
|
|
107
|
-
authorizationError = "authorizationError",
|
|
108
|
-
/**
|
|
109
|
-
* File not found, or file deleted during session
|
|
110
|
-
*/
|
|
111
|
-
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
112
|
-
/**
|
|
113
|
-
* Throttling error from server. Server is busy and is asking not to reconnect for some time
|
|
114
|
-
*/
|
|
115
|
-
throttlingError = "throttlingError",
|
|
116
|
-
/**
|
|
117
|
-
* We can not reach server due to computer being offline.
|
|
118
|
-
*/
|
|
119
|
-
offlineError = "offlineError",
|
|
120
|
-
unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
|
|
121
|
-
/**
|
|
122
|
-
* User does not have write permissions to a file, but is changing content of a file.
|
|
123
|
-
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
124
|
-
*/
|
|
125
|
-
writeError = "writeError",
|
|
126
|
-
/**
|
|
127
|
-
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
128
|
-
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
129
|
-
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
130
|
-
* CSP violation, etc.
|
|
131
|
-
*/
|
|
132
|
-
fetchFailure = "fetchFailure",
|
|
133
|
-
/**
|
|
134
|
-
* This error occurs when token provider fails to fetch orderer token
|
|
135
|
-
*/
|
|
136
|
-
fetchTokenError = "fetchTokenError",
|
|
137
|
-
/**
|
|
138
|
-
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
139
|
-
*/
|
|
140
|
-
incorrectServerResponse = "incorrectServerResponse",
|
|
141
|
-
/**
|
|
142
|
-
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
143
|
-
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
144
|
-
* and storage / driver / loader detects such mismatch.
|
|
145
|
-
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
146
|
-
*/
|
|
147
|
-
fileOverwrittenInStorage = "fileOverwrittenInStorage",
|
|
148
|
-
/**
|
|
149
|
-
* The document is read-only and delta stream connection is forbidden.
|
|
150
|
-
*/
|
|
151
|
-
deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
|
|
152
|
-
/**
|
|
153
|
-
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
154
|
-
* location, then this error is thrown to let the client know about the new location info.
|
|
155
|
-
*/
|
|
156
|
-
locationRedirection = "locationRedirection",
|
|
157
|
-
/**
|
|
158
|
-
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
159
|
-
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
160
|
-
* "fluidInvalidSchema"
|
|
161
|
-
*/
|
|
162
|
-
fluidInvalidSchema = "fluidInvalidSchema",
|
|
163
|
-
/**
|
|
164
|
-
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
165
|
-
* ! Should match the value of ContainerErrorType.usageError
|
|
166
|
-
*/
|
|
167
|
-
usageError = "usageError",
|
|
168
|
-
/**
|
|
169
|
-
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
170
|
-
*/
|
|
171
|
-
fileIsLocked = "fileIsLocked",
|
|
172
|
-
/**
|
|
173
|
-
* Storage is out of space
|
|
174
|
-
*/
|
|
175
|
-
outOfStorageError = "outOfStorageError"
|
|
176
|
-
}
|
|
177
87
|
/**
|
|
178
88
|
* Interface describing errors and warnings raised by any driver code.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
179
91
|
* Not expected to be implemented by a class or an object literal, but rather used in place of
|
|
180
92
|
* any or unknown in various function signatures that pass errors around.
|
|
181
93
|
*
|
|
182
94
|
* "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
|
|
183
|
-
* It will be either
|
|
95
|
+
* It will be either {@link @fluidframework/driver-definitions#(DriverErrorTypes:variable)} or the specific driver's specialized error type enum,
|
|
184
96
|
* but we can't reference a specific driver's error type enum in this code.
|
|
185
97
|
* @public
|
|
186
98
|
*/
|
|
@@ -197,7 +109,7 @@ export interface IDriverErrorBase {
|
|
|
197
109
|
*
|
|
198
110
|
* @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
|
|
199
111
|
*/
|
|
200
|
-
readonly errorType:
|
|
112
|
+
readonly errorType: DriverErrorTypes;
|
|
201
113
|
/**
|
|
202
114
|
* Free-form error message
|
|
203
115
|
*/
|
|
@@ -220,21 +132,21 @@ export interface IDriverErrorBase {
|
|
|
220
132
|
* @alpha
|
|
221
133
|
*/
|
|
222
134
|
export interface IThrottlingWarning extends IDriverErrorBase {
|
|
223
|
-
readonly errorType:
|
|
135
|
+
readonly errorType: typeof DriverErrorTypes.throttlingError;
|
|
224
136
|
readonly retryAfterSeconds: number;
|
|
225
137
|
}
|
|
226
138
|
/**
|
|
227
139
|
* @alpha
|
|
228
140
|
*/
|
|
229
141
|
export interface IGenericNetworkError extends IDriverErrorBase {
|
|
230
|
-
readonly errorType:
|
|
142
|
+
readonly errorType: typeof DriverErrorTypes.genericNetworkError;
|
|
231
143
|
readonly statusCode?: number;
|
|
232
144
|
}
|
|
233
145
|
/**
|
|
234
146
|
* @alpha
|
|
235
147
|
*/
|
|
236
148
|
export interface IAuthorizationError extends IDriverErrorBase {
|
|
237
|
-
readonly errorType:
|
|
149
|
+
readonly errorType: typeof DriverErrorTypes.authorizationError;
|
|
238
150
|
readonly claims?: string;
|
|
239
151
|
readonly tenantId?: string;
|
|
240
152
|
}
|
|
@@ -242,7 +154,7 @@ export interface IAuthorizationError extends IDriverErrorBase {
|
|
|
242
154
|
* @alpha
|
|
243
155
|
*/
|
|
244
156
|
export interface ILocationRedirectionError extends IDriverErrorBase {
|
|
245
|
-
readonly errorType:
|
|
157
|
+
readonly errorType: typeof DriverErrorTypes.locationRedirection;
|
|
246
158
|
readonly redirectUrl: IResolvedUrl;
|
|
247
159
|
}
|
|
248
160
|
/**
|
|
@@ -251,7 +163,7 @@ export interface ILocationRedirectionError extends IDriverErrorBase {
|
|
|
251
163
|
* @alpha
|
|
252
164
|
*/
|
|
253
165
|
export interface IDriverBasicError extends IDriverErrorBase {
|
|
254
|
-
readonly errorType:
|
|
166
|
+
readonly errorType: typeof DriverErrorTypes.genericError | typeof DriverErrorTypes.fileNotFoundOrAccessDeniedError | typeof DriverErrorTypes.offlineError | typeof DriverErrorTypes.unsupportedClientProtocolVersion | typeof DriverErrorTypes.writeError | typeof DriverErrorTypes.fetchFailure | typeof DriverErrorTypes.fetchTokenError | typeof DriverErrorTypes.incorrectServerResponse | typeof DriverErrorTypes.fileOverwrittenInStorage | typeof DriverErrorTypes.fluidInvalidSchema | typeof DriverErrorTypes.usageError | typeof DriverErrorTypes.fileIsLocked | typeof DriverErrorTypes.outOfStorageError;
|
|
255
167
|
readonly statusCode?: number;
|
|
256
168
|
}
|
|
257
169
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.d.mts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,YAAY,EAAE;AAMvB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAI5B;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;IAQH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"driverError.d.mts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,YAAY,EAAE;AAMvB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAI5B;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;IAQH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAC3E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,gBAAgB,CAAC,eAAe,CAAC;IAC5D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC7D,QAAQ,CAAC,SAAS,EAAE,OAAO,gBAAgB,CAAC,mBAAmB,CAAC;IAChE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC5D,QAAQ,CAAC,SAAS,EAAE,OAAO,gBAAgB,CAAC,kBAAkB,CAAC;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAClE,QAAQ,CAAC,SAAS,EAAE,OAAO,gBAAgB,CAAC,mBAAmB,CAAC;IAChE,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IAC1D,QAAQ,CAAC,SAAS,EACf,OAAO,gBAAgB,CAAC,YAAY,GACpC,OAAO,gBAAgB,CAAC,+BAA+B,GACvD,OAAO,gBAAgB,CAAC,YAAY,GACpC,OAAO,gBAAgB,CAAC,gCAAgC,GACxD,OAAO,gBAAgB,CAAC,UAAU,GAClC,OAAO,gBAAgB,CAAC,YAAY,GACpC,OAAO,gBAAgB,CAAC,eAAe,GACvC,OAAO,gBAAgB,CAAC,uBAAuB,GAC/C,OAAO,gBAAgB,CAAC,wBAAwB,GAChD,OAAO,gBAAgB,CAAC,kBAAkB,GAC1C,OAAO,gBAAgB,CAAC,UAAU,GAClC,OAAO,gBAAgB,CAAC,YAAY,GACpC,OAAO,gBAAgB,CAAC,iBAAiB,CAAC;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,CAAC"}
|
package/lib/driverError.mjs
CHANGED
|
@@ -84,98 +84,4 @@ export const DriverErrorTypes = {
|
|
|
84
84
|
*/
|
|
85
85
|
outOfStorageError: "outOfStorageError",
|
|
86
86
|
};
|
|
87
|
-
/**
|
|
88
|
-
* Driver Error types
|
|
89
|
-
* Lists types that are likely to be used by all drivers
|
|
90
|
-
*
|
|
91
|
-
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export var DriverErrorType;
|
|
95
|
-
(function (DriverErrorType) {
|
|
96
|
-
/**
|
|
97
|
-
* A fatal error with no specific interpretation covered by other DriverErrorType values
|
|
98
|
-
*/
|
|
99
|
-
DriverErrorType["genericError"] = "genericError";
|
|
100
|
-
/**
|
|
101
|
-
* Some non-categorized (below) networking error
|
|
102
|
-
* Include errors like fatal server error (usually 500).
|
|
103
|
-
*/
|
|
104
|
-
DriverErrorType["genericNetworkError"] = "genericNetworkError";
|
|
105
|
-
/**
|
|
106
|
-
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
107
|
-
*/
|
|
108
|
-
DriverErrorType["authorizationError"] = "authorizationError";
|
|
109
|
-
/**
|
|
110
|
-
* File not found, or file deleted during session
|
|
111
|
-
*/
|
|
112
|
-
DriverErrorType["fileNotFoundOrAccessDeniedError"] = "fileNotFoundOrAccessDeniedError";
|
|
113
|
-
/**
|
|
114
|
-
* Throttling error from server. Server is busy and is asking not to reconnect for some time
|
|
115
|
-
*/
|
|
116
|
-
DriverErrorType["throttlingError"] = "throttlingError";
|
|
117
|
-
/**
|
|
118
|
-
* We can not reach server due to computer being offline.
|
|
119
|
-
*/
|
|
120
|
-
DriverErrorType["offlineError"] = "offlineError";
|
|
121
|
-
/*
|
|
122
|
-
* Unsupported client protocol
|
|
123
|
-
*/
|
|
124
|
-
DriverErrorType["unsupportedClientProtocolVersion"] = "unsupportedClientProtocolVersion";
|
|
125
|
-
/**
|
|
126
|
-
* User does not have write permissions to a file, but is changing content of a file.
|
|
127
|
-
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
128
|
-
*/
|
|
129
|
-
DriverErrorType["writeError"] = "writeError";
|
|
130
|
-
/**
|
|
131
|
-
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
132
|
-
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
133
|
-
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
134
|
-
* CSP violation, etc.
|
|
135
|
-
*/
|
|
136
|
-
DriverErrorType["fetchFailure"] = "fetchFailure";
|
|
137
|
-
/**
|
|
138
|
-
* This error occurs when token provider fails to fetch orderer token
|
|
139
|
-
*/
|
|
140
|
-
DriverErrorType["fetchTokenError"] = "fetchTokenError";
|
|
141
|
-
/**
|
|
142
|
-
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
143
|
-
*/
|
|
144
|
-
DriverErrorType["incorrectServerResponse"] = "incorrectServerResponse";
|
|
145
|
-
/**
|
|
146
|
-
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
147
|
-
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
148
|
-
* and storage / driver / loader detects such mismatch.
|
|
149
|
-
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
150
|
-
*/
|
|
151
|
-
DriverErrorType["fileOverwrittenInStorage"] = "fileOverwrittenInStorage";
|
|
152
|
-
/**
|
|
153
|
-
* The document is read-only and delta stream connection is forbidden.
|
|
154
|
-
*/
|
|
155
|
-
DriverErrorType["deltaStreamConnectionForbidden"] = "deltaStreamConnectionForbidden";
|
|
156
|
-
/**
|
|
157
|
-
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
158
|
-
* location, then this error is thrown to let the client know about the new location info.
|
|
159
|
-
*/
|
|
160
|
-
DriverErrorType["locationRedirection"] = "locationRedirection";
|
|
161
|
-
/**
|
|
162
|
-
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
163
|
-
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
164
|
-
* "fluidInvalidSchema"
|
|
165
|
-
*/
|
|
166
|
-
DriverErrorType["fluidInvalidSchema"] = "fluidInvalidSchema";
|
|
167
|
-
/**
|
|
168
|
-
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
169
|
-
* ! Should match the value of ContainerErrorType.usageError
|
|
170
|
-
*/
|
|
171
|
-
DriverErrorType["usageError"] = "usageError";
|
|
172
|
-
/**
|
|
173
|
-
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
174
|
-
*/
|
|
175
|
-
DriverErrorType["fileIsLocked"] = "fileIsLocked";
|
|
176
|
-
/**
|
|
177
|
-
* Storage is out of space
|
|
178
|
-
*/
|
|
179
|
-
DriverErrorType["outOfStorageError"] = "outOfStorageError";
|
|
180
|
-
})(DriverErrorType || (DriverErrorType = {}));
|
|
181
87
|
//# sourceMappingURL=driverError.mjs.map
|
package/lib/driverError.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.mjs","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,eAAe,EAAE,MAAM,iCAAiC;AAIjE,8GAA8G;AAC9G,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,8BAA8B,EAAE,GACpF,eAAe,CAAC;AAEjB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,2BAA2B;IAC3B,GAAG,8BAA8B;IAEjC;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,+BAA+B,EAAE,iCAAiC;IAElE;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,gCAAgC,EAAE,kCAAkC;IAEpE;;;OAGG;IACH,UAAU,EAAE,YAAY;IAExB;;;;;OAKG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,uBAAuB,EAAE,yBAAyB;IAElD;;;;;OAKG;IACH,wBAAwB,EAAE,0BAA0B;IAEpD;;OAEG;IACH,8BAA8B,EAAE,gCAAgC;IAEhE;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;;;OAIG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;CAC7B,CAAC;AAMX;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,eAsGX;AAtGD,WAAY,eAAe;IAC1B;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,0DAAuC,CAAA;AACxC,CAAC,EAtGW,eAAe,KAAf,eAAe,QAsG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidErrorTypes } from \"@fluidframework/core-interfaces\";\n\nimport { IResolvedUrl } from \"./urlResolver\";\n\n// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes\nconst { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } =\n\tFluidErrorTypes;\n\n/**\n * Different error types the Driver may report out to the Host.\n * @public\n */\nexport const DriverErrorTypes = {\n\t// Inherit base error types\n\t...FluidErrorTypesExceptDataTypes,\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError: \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError: \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError: \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError: \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion: \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError: \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure: \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError: \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse: \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage: \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden: \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection: \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema: \"fluidInvalidSchema\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked: \"fileIsLocked\",\n\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError: \"outOfStorageError\",\n} as const;\n/**\n * @public\n */\nexport type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n *\n * @deprecated Use {@link (DriverErrorTypes:type)} instead.\n * @public\n */\nexport enum DriverErrorType {\n\t/**\n\t * A fatal error with no specific interpretation covered by other DriverErrorType values\n\t */\n\tgenericError = \"genericError\",\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError = \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError = \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError = \"throttlingError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError = \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError = \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure = \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse = \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection = \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema = \"fluidInvalidSchema\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t * ! Should match the value of ContainerErrorType.usageError\n\t */\n\tusageError = \"usageError\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked = \"fileIsLocked\",\n\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError = \"outOfStorageError\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n * @public\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n * @public\n */\nexport interface IDriverErrorBase {\n\t/**\n\t * Classification of what type of error this is, used programmatically by consumers to interpret the error.\n\t *\n\t * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).\n\t */\n\treadonly errorType: DriverErrorType;\n\n\t/**\n\t * Free-form error message\n\t */\n\treadonly message: string;\n\n\t/**\n\t * True indicates the caller may retry the failed action. False indicates it's a fatal error\n\t */\n\tcanRetry: boolean;\n\n\t/**\n\t * Best guess as to network conditions (online/offline) when the error arose.\n\t * See OnlineStatus enum in driver-utils package for expected values.\n\t */\n\tonline?: string;\n\n\t/**\n\t * Whether service was reachable and we got some response from service.\n\t */\n\tendpointReached?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface IThrottlingWarning extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n\n/**\n * @alpha\n */\nexport interface IGenericNetworkError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.genericNetworkError;\n\treadonly statusCode?: number;\n}\n\n/**\n * @alpha\n */\nexport interface IAuthorizationError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n}\n\n/**\n * @alpha\n */\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.locationRedirection;\n\treadonly redirectUrl: IResolvedUrl;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n * @alpha\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n\treadonly errorType:\n\t\t| DriverErrorType.genericError\n\t\t| DriverErrorType.fileNotFoundOrAccessDeniedError\n\t\t| DriverErrorType.offlineError\n\t\t| DriverErrorType.unsupportedClientProtocolVersion\n\t\t| DriverErrorType.writeError\n\t\t| DriverErrorType.fetchFailure\n\t\t| DriverErrorType.fetchTokenError\n\t\t| DriverErrorType.incorrectServerResponse\n\t\t| DriverErrorType.fileOverwrittenInStorage\n\t\t| DriverErrorType.fluidInvalidSchema\n\t\t| DriverErrorType.usageError\n\t\t| DriverErrorType.fileIsLocked\n\t\t| DriverErrorType.outOfStorageError;\n\treadonly statusCode?: number;\n}\n\n/**\n * @alpha\n */\nexport type DriverError =\n\t| IThrottlingWarning\n\t| IGenericNetworkError\n\t| IAuthorizationError\n\t| ILocationRedirectionError\n\t| IDriverBasicError;\n"]}
|
|
1
|
+
{"version":3,"file":"driverError.mjs","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,eAAe,EAAE,MAAM,iCAAiC;AAIjE,8GAA8G;AAC9G,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,8BAA8B,EAAE,GACpF,eAAe,CAAC;AAEjB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,2BAA2B;IAC3B,GAAG,8BAA8B;IAEjC;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,+BAA+B,EAAE,iCAAiC;IAElE;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,gCAAgC,EAAE,kCAAkC;IAEpE;;;OAGG;IACH,UAAU,EAAE,YAAY;IAExB;;;;;OAKG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,uBAAuB,EAAE,yBAAyB;IAElD;;;;;OAKG;IACH,wBAAwB,EAAE,0BAA0B;IAEpD;;OAEG;IACH,8BAA8B,EAAE,gCAAgC;IAEhE;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;;;OAIG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;CAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidErrorTypes } from \"@fluidframework/core-interfaces\";\n\nimport { IResolvedUrl } from \"./urlResolver\";\n\n// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes\nconst { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } =\n\tFluidErrorTypes;\n\n/**\n * Different error types the Driver may report out to the Host.\n * @public\n */\nexport const DriverErrorTypes = {\n\t// Inherit base error types\n\t...FluidErrorTypesExceptDataTypes,\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError: \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError: \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError: \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError: \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion: \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError: \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure: \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError: \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse: \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage: \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden: \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection: \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema: \"fluidInvalidSchema\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked: \"fileIsLocked\",\n\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError: \"outOfStorageError\",\n} as const;\n/**\n * @public\n */\nexport type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n *\n * @remarks\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either {@link @fluidframework/driver-definitions#(DriverErrorTypes:variable)} or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n * @public\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n * @public\n */\nexport interface IDriverErrorBase {\n\t/**\n\t * Classification of what type of error this is, used programmatically by consumers to interpret the error.\n\t *\n\t * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).\n\t */\n\treadonly errorType: DriverErrorTypes;\n\n\t/**\n\t * Free-form error message\n\t */\n\treadonly message: string;\n\n\t/**\n\t * True indicates the caller may retry the failed action. False indicates it's a fatal error\n\t */\n\tcanRetry: boolean;\n\n\t/**\n\t * Best guess as to network conditions (online/offline) when the error arose.\n\t * See OnlineStatus enum in driver-utils package for expected values.\n\t */\n\tonline?: string;\n\n\t/**\n\t * Whether service was reachable and we got some response from service.\n\t */\n\tendpointReached?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface IThrottlingWarning extends IDriverErrorBase {\n\treadonly errorType: typeof DriverErrorTypes.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n\n/**\n * @alpha\n */\nexport interface IGenericNetworkError extends IDriverErrorBase {\n\treadonly errorType: typeof DriverErrorTypes.genericNetworkError;\n\treadonly statusCode?: number;\n}\n\n/**\n * @alpha\n */\nexport interface IAuthorizationError extends IDriverErrorBase {\n\treadonly errorType: typeof DriverErrorTypes.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n}\n\n/**\n * @alpha\n */\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n\treadonly errorType: typeof DriverErrorTypes.locationRedirection;\n\treadonly redirectUrl: IResolvedUrl;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n * @alpha\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n\treadonly errorType:\n\t\t| typeof DriverErrorTypes.genericError\n\t\t| typeof DriverErrorTypes.fileNotFoundOrAccessDeniedError\n\t\t| typeof DriverErrorTypes.offlineError\n\t\t| typeof DriverErrorTypes.unsupportedClientProtocolVersion\n\t\t| typeof DriverErrorTypes.writeError\n\t\t| typeof DriverErrorTypes.fetchFailure\n\t\t| typeof DriverErrorTypes.fetchTokenError\n\t\t| typeof DriverErrorTypes.incorrectServerResponse\n\t\t| typeof DriverErrorTypes.fileOverwrittenInStorage\n\t\t| typeof DriverErrorTypes.fluidInvalidSchema\n\t\t| typeof DriverErrorTypes.usageError\n\t\t| typeof DriverErrorTypes.fileIsLocked\n\t\t| typeof DriverErrorTypes.outOfStorageError;\n\treadonly statusCode?: number;\n}\n\n/**\n * @alpha\n */\nexport type DriverError =\n\t| IThrottlingWarning\n\t| IGenericNetworkError\n\t| IAuthorizationError\n\t| ILocationRedirectionError\n\t| IDriverBasicError;\n"]}
|
package/lib/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { DriverError,
|
|
6
|
-
export { FetchSource, FiveDaysMs, IDeltasFetchResult, IDeltaStorageService, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceFactory, IDocumentServicePolicies, IDocumentStorageService, IDocumentStorageServicePolicies, IStream, IStreamResult, ISummaryContext, LoaderCachingPolicy, } from "./storage.mjs";
|
|
5
|
+
export { DriverError, DriverErrorTypes, IAnyDriverError, IAuthorizationError, IDriverErrorBase, IDriverBasicError, IGenericNetworkError, ILocationRedirectionError, IThrottlingWarning, } from "./driverError.mjs";
|
|
6
|
+
export { FetchSource, FiveDaysMs, IDeltasFetchResult, IDeltaStorageService, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceEvents, IDocumentServiceFactory, IDocumentServicePolicies, IDocumentStorageService, IDocumentStorageServicePolicies, ISnapshot, ISnapshotFetchOptions, IStream, IStreamResult, ISummaryContext, LoaderCachingPolicy, } from "./storage.mjs";
|
|
7
7
|
export { DriverPreCheckInfo, DriverHeader, IContainerPackageInfo, IDriverHeader, IResolvedUrl, IUrlResolver, } from "./urlResolver.mjs";
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
package/lib/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB;OACM,EACN,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,aAAa,EACb,eAAe,EACf,mBAAmB,GACnB;OACM,EACN,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ"}
|
package/lib/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
5
|
+
export { DriverErrorTypes, } from "./driverError.mjs";
|
|
6
6
|
export { FetchSource, LoaderCachingPolicy, } from "./storage.mjs";
|
|
7
7
|
export { DriverHeader, } from "./urlResolver.mjs";
|
|
8
8
|
//# sourceMappingURL=index.mjs.map
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAEN,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAEN,gBAAgB,GAQhB;OACM,EACN,WAAW,EAkBX,mBAAmB,GACnB;OACM,EAEN,YAAY,GAKZ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tDriverError,\n\tDriverErrorTypes,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError\";\nexport {\n\tFetchSource,\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n\tLoaderCachingPolicy,\n} from \"./storage\";\nexport {\n\tDriverPreCheckInfo,\n\tDriverHeader,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver\";\n"]}
|