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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/.eslintrc.js +6 -9
  2. package/CHANGELOG.md +141 -0
  3. package/README.md +39 -1
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/odsp-driver-definitions.api.md +320 -0
  7. package/dist/errors.cjs +110 -0
  8. package/dist/errors.cjs.map +1 -0
  9. package/dist/errors.d.ts +122 -6
  10. package/dist/errors.d.ts.map +1 -1
  11. package/dist/{factory.js → factory.cjs} +1 -1
  12. package/dist/factory.cjs.map +1 -0
  13. package/dist/factory.d.ts +36 -6
  14. package/dist/factory.d.ts.map +1 -1
  15. package/dist/index.cjs +21 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.ts +6 -5
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/odsp-driver-definitions-alpha.d.ts +626 -0
  20. package/dist/odsp-driver-definitions-beta.d.ts +88 -0
  21. package/dist/odsp-driver-definitions-public.d.ts +79 -0
  22. package/dist/odsp-driver-definitions-untrimmed.d.ts +652 -0
  23. package/dist/odspCache.cjs +23 -0
  24. package/dist/odspCache.cjs.map +1 -0
  25. package/dist/odspCache.d.ts +21 -4
  26. package/dist/odspCache.d.ts.map +1 -1
  27. package/dist/resolvedUrl.cjs +37 -0
  28. package/dist/resolvedUrl.cjs.map +1 -0
  29. package/dist/resolvedUrl.d.ts +59 -16
  30. package/dist/resolvedUrl.d.ts.map +1 -1
  31. package/dist/{odspCache.js → sessionProvider.cjs} +1 -6
  32. package/dist/sessionProvider.cjs.map +1 -0
  33. package/dist/sessionProvider.d.ts +48 -0
  34. package/dist/sessionProvider.d.ts.map +1 -0
  35. package/dist/{tokenFetch.js → tokenFetch.cjs} +6 -2
  36. package/dist/tokenFetch.cjs.map +1 -0
  37. package/dist/tokenFetch.d.ts +15 -5
  38. package/dist/tokenFetch.d.ts.map +1 -1
  39. package/dist/tsdoc-metadata.json +11 -0
  40. package/lib/errors.d.mts +153 -0
  41. package/lib/errors.d.mts.map +1 -0
  42. package/lib/errors.mjs +103 -0
  43. package/lib/errors.mjs.map +1 -0
  44. package/lib/{factory.d.ts → factory.d.mts} +36 -6
  45. package/lib/factory.d.mts.map +1 -0
  46. package/lib/{factory.js → factory.mjs} +1 -1
  47. package/lib/factory.mjs.map +1 -0
  48. package/lib/index.d.mts +11 -0
  49. package/lib/index.d.mts.map +1 -0
  50. package/lib/index.mjs +9 -0
  51. package/lib/index.mjs.map +1 -0
  52. package/lib/odsp-driver-definitions-alpha.d.mts +626 -0
  53. package/lib/odsp-driver-definitions-beta.d.mts +88 -0
  54. package/lib/odsp-driver-definitions-public.d.mts +79 -0
  55. package/lib/odsp-driver-definitions-untrimmed.d.mts +652 -0
  56. package/lib/{odspCache.d.ts → odspCache.d.mts} +21 -4
  57. package/lib/odspCache.d.mts.map +1 -0
  58. package/lib/odspCache.mjs +19 -0
  59. package/lib/odspCache.mjs.map +1 -0
  60. package/lib/{resolvedUrl.d.ts → resolvedUrl.d.mts} +59 -16
  61. package/lib/resolvedUrl.d.mts.map +1 -0
  62. package/lib/resolvedUrl.mjs +34 -0
  63. package/lib/resolvedUrl.mjs.map +1 -0
  64. package/lib/sessionProvider.d.mts +48 -0
  65. package/lib/sessionProvider.d.mts.map +1 -0
  66. package/lib/sessionProvider.mjs +6 -0
  67. package/lib/sessionProvider.mjs.map +1 -0
  68. package/lib/{tokenFetch.d.ts → tokenFetch.d.mts} +15 -5
  69. package/lib/tokenFetch.d.mts.map +1 -0
  70. package/lib/{tokenFetch.js → tokenFetch.mjs} +6 -2
  71. package/lib/tokenFetch.mjs.map +1 -0
  72. package/package.json +71 -42
  73. package/prettier.config.cjs +8 -0
  74. package/src/errors.ts +153 -57
  75. package/src/factory.ts +146 -114
  76. package/src/index.ts +47 -5
  77. package/src/odspCache.ts +71 -51
  78. package/src/resolvedUrl.ts +125 -72
  79. package/src/sessionProvider.ts +61 -0
  80. package/src/tokenFetch.ts +56 -39
  81. package/tsc-multi.test.json +4 -0
  82. package/tsconfig.json +11 -13
  83. package/.editorconfig +0 -7
  84. package/dist/errors.js +0 -44
  85. package/dist/errors.js.map +0 -1
  86. package/dist/factory.js.map +0 -1
  87. package/dist/index.js +0 -22
  88. package/dist/index.js.map +0 -1
  89. package/dist/odspCache.js.map +0 -1
  90. package/dist/packageVersion.d.ts +0 -9
  91. package/dist/packageVersion.d.ts.map +0 -1
  92. package/dist/packageVersion.js +0 -12
  93. package/dist/packageVersion.js.map +0 -1
  94. package/dist/resolvedUrl.js +0 -18
  95. package/dist/resolvedUrl.js.map +0 -1
  96. package/dist/tokenFetch.js.map +0 -1
  97. package/lib/errors.d.ts +0 -41
  98. package/lib/errors.d.ts.map +0 -1
  99. package/lib/errors.js +0 -41
  100. package/lib/errors.js.map +0 -1
  101. package/lib/factory.d.ts.map +0 -1
  102. package/lib/factory.js.map +0 -1
  103. package/lib/index.d.ts +0 -10
  104. package/lib/index.d.ts.map +0 -1
  105. package/lib/index.js +0 -10
  106. package/lib/index.js.map +0 -1
  107. package/lib/odspCache.d.ts.map +0 -1
  108. package/lib/odspCache.js +0 -9
  109. package/lib/odspCache.js.map +0 -1
  110. package/lib/packageVersion.d.ts +0 -9
  111. package/lib/packageVersion.d.ts.map +0 -1
  112. package/lib/packageVersion.js +0 -9
  113. package/lib/packageVersion.js.map +0 -1
  114. package/lib/resolvedUrl.d.ts.map +0 -1
  115. package/lib/resolvedUrl.js +0 -15
  116. package/lib/resolvedUrl.js.map +0 -1
  117. package/lib/tokenFetch.d.ts.map +0 -1
  118. package/lib/tokenFetch.js.map +0 -1
  119. package/src/packageVersion.ts +0 -9
  120. package/tsconfig.esnext.json +0 -7
package/.eslintrc.js CHANGED
@@ -4,12 +4,9 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- "extends": [
8
- require.resolve("@fluidframework/eslint-config-fluid")
9
- ],
10
- "parserOptions": {
11
- "project": ["./tsconfig.json", "./src/test/tsconfig.json"]
12
- },
13
- "rules": {
14
- }
15
- }
7
+ extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
8
+ parserOptions: {
9
+ project: ["./tsconfig.json", "./src/test/tsconfig.json"],
10
+ },
11
+ rules: {},
12
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,141 @@
1
+ # @fluidframework/odsp-driver-definitions
2
+
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.0.0-internal.7.4.0
8
+
9
+ Dependency updates only.
10
+
11
+ ## 2.0.0-internal.7.3.0
12
+
13
+ Dependency updates only.
14
+
15
+ ## 2.0.0-internal.7.2.0
16
+
17
+ Dependency updates only.
18
+
19
+ ## 2.0.0-internal.7.1.0
20
+
21
+ Dependency updates only.
22
+
23
+ ## 2.0.0-internal.7.0.0
24
+
25
+ ### Major Changes
26
+
27
+ - odsp-driver: Load container in readonly mode when driver throws DriverErrorType.outOfStorage [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
28
+
29
+ Handle DriverErrorType.outOfStorage error from driver and load the container in readonly mode. Currently there is no
30
+ handling and when the join session throws this error, the container will get closed. With this we use NoDeltaStream
31
+ object as connection and load the container in read mode, so that it loads properly. We also notify the that the
32
+ container is "readonly" through the event on delta manager so that apps can listen to this and show any UX etc. The app
33
+ can listen to the event like this:
34
+
35
+ ```ts
36
+ container.deltaManager.on(
37
+ "readonly",
38
+ (readonly?: boolean, readonlyConnectionReason?: { text: string; error?: IErrorBase }) => {
39
+ // error?.errorType will be equal to DriverErrorType.outOfStorage in this case
40
+ // App logic
41
+ },
42
+ );
43
+ ```
44
+
45
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
46
+
47
+ This included the following changes from the protocol-definitions release:
48
+
49
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
50
+ submitted by clients to the server and the resulting signals sent from the server to clients.
51
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
52
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
53
+ ISignalMessageBase interface that contains common members.
54
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
55
+
56
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
57
+
58
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
59
+
60
+ - @fluidframework/gitresources: 2.0.1
61
+ - @fluidframework/server-kafka-orderer: 2.0.1
62
+ - @fluidframework/server-lambdas: 2.0.1
63
+ - @fluidframework/server-lambdas-driver: 2.0.1
64
+ - @fluidframework/server-local-server: 2.0.1
65
+ - @fluidframework/server-memory-orderer: 2.0.1
66
+ - @fluidframework/protocol-base: 2.0.1
67
+ - @fluidframework/server-routerlicious: 2.0.1
68
+ - @fluidframework/server-routerlicious-base: 2.0.1
69
+ - @fluidframework/server-services: 2.0.1
70
+ - @fluidframework/server-services-client: 2.0.1
71
+ - @fluidframework/server-services-core: 2.0.1
72
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
73
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
74
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
75
+ - @fluidframework/server-services-shared: 2.0.1
76
+ - @fluidframework/server-services-telemetry: 2.0.1
77
+ - @fluidframework/server-services-utils: 2.0.1
78
+ - @fluidframework/server-test-utils: 2.0.1
79
+ - tinylicious: 2.0.1
80
+
81
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
82
+
83
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
84
+
85
+ ## 2.0.0-internal.6.4.0
86
+
87
+ Dependency updates only.
88
+
89
+ ## 2.0.0-internal.6.3.0
90
+
91
+ Dependency updates only.
92
+
93
+ ## 2.0.0-internal.6.2.0
94
+
95
+ Dependency updates only.
96
+
97
+ ## 2.0.0-internal.6.1.0
98
+
99
+ Dependency updates only.
100
+
101
+ ## 2.0.0-internal.6.0.0
102
+
103
+ ### Major Changes
104
+
105
+ - Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
106
+
107
+ Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
108
+
109
+ ## 2.0.0-internal.5.4.0
110
+
111
+ Dependency updates only.
112
+
113
+ ## 2.0.0-internal.5.3.0
114
+
115
+ ### Minor Changes
116
+
117
+ - New interfaces to discover getRelaySessionInfo API ([#16300](https://github.com/microsoft/FluidFramework/issues/16300)) [a25789cd37](https://github.com/microsoft/FluidFramework/commits/a25789cd37bf60ebc4a08e1a9f7eaa8c65f4eae2)
118
+
119
+ There are new interfaces `IRelaySessionAwareDriverFactory` and `IProvideSessionAwareDriverFactory` in
120
+ odsp-driver-definitions that enable using the provider pattern to discover the new API `getRelaySessionInfo` in
121
+ odsp-driver.
122
+
123
+ ## 2.0.0-internal.5.2.0
124
+
125
+ Dependency updates only.
126
+
127
+ ## 2.0.0-internal.5.1.0
128
+
129
+ Dependency updates only.
130
+
131
+ ## 2.0.0-internal.5.0.0
132
+
133
+ Dependency updates only.
134
+
135
+ ## 2.0.0-internal.4.4.0
136
+
137
+ Dependency updates only.
138
+
139
+ ## 2.0.0-internal.4.1.0
140
+
141
+ Dependency updates only.
package/README.md CHANGED
@@ -3,4 +3,42 @@
3
3
  Definitions for @fluidframework/odsp-driver package.
4
4
  Currently it contains all the contracts for driver factory.
5
5
 
6
- Though the host is responsible for implementing the IPersistedCache, snapshot cached entries will be disregarded if they are older than 2 days, which is based on `defaultCacheExpiryTimeoutMs`. The ODSP driver will delete all entries if it interacts with such a file.
6
+ Though the host is responsible for implementing the IPersistedCache, snapshot cached entries will be disregarded if they are older than 5 days, per the maximumCacheDurationMs policy on IDocumentStorageServicePolicies
7
+
8
+ <!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
9
+
10
+ <!-- prettier-ignore-start -->
11
+ <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
12
+
13
+ ## Using Fluid Framework libraries
14
+
15
+ When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
16
+ While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
17
+ library consumers should always prefer `^`.
18
+
19
+ Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
20
+ you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
21
+ Standard `^` and `~` ranges will not work as expected.
22
+ See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
23
+ package for more information including tools to convert between version schemes.
24
+
25
+ <!-- prettier-ignore-end -->
26
+
27
+ <!-- AUTO-GENERATED-CONTENT:END -->
28
+
29
+ <!-- AUTO-GENERATED-CONTENT:START (README_TRADEMARK_SECTION:includeHeading=TRUE) -->
30
+
31
+ <!-- prettier-ignore-start -->
32
+ <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
33
+
34
+ ## Trademark
35
+
36
+ This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
37
+
38
+ Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
39
+
40
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
41
+
42
+ <!-- prettier-ignore-end -->
43
+
44
+ <!-- AUTO-GENERATED-CONTENT:END -->
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json"
4
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-report.json"
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json"
4
4
  }
@@ -0,0 +1,320 @@
1
+ ## API Report File for "@fluidframework/odsp-driver-definitions"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { DriverError } from '@fluidframework/driver-definitions';
8
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
9
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
10
+
11
+ // @alpha (undocumented)
12
+ export type CacheContentType = "snapshot" | "ops";
13
+
14
+ // @internal
15
+ export function getKeyForCacheEntry(entry: ICacheEntry): string;
16
+
17
+ // @alpha (undocumented)
18
+ export interface HostStoragePolicy {
19
+ avoidPrefetchSnapshotCache?: boolean;
20
+ cacheCreateNewSummary?: boolean;
21
+ // (undocumented)
22
+ concurrentOpsBatches?: number;
23
+ concurrentSnapshotFetch?: boolean;
24
+ // @deprecated (undocumented)
25
+ enableRedeemFallback?: boolean;
26
+ // @deprecated (undocumented)
27
+ enableShareLinkWithCreate?: boolean;
28
+ enableSingleRequestForShareLinkWithCreate?: boolean;
29
+ // @deprecated (undocumented)
30
+ fetchBinarySnapshotFormat?: boolean;
31
+ isolateSocketCache?: boolean;
32
+ // (undocumented)
33
+ opsBatchSize?: number;
34
+ opsCaching?: IOpsCachingPolicy;
35
+ sessionOptions?: ICollabSessionOptions;
36
+ // (undocumented)
37
+ snapshotOptions?: ISnapshotOptions;
38
+ }
39
+
40
+ // @alpha
41
+ export interface ICacheEntry extends IEntry {
42
+ file: IFileEntry;
43
+ }
44
+
45
+ // @alpha (undocumented)
46
+ export interface ICollabSessionOptions {
47
+ // @deprecated (undocumented)
48
+ forceAccessTokenViaAuthorizationHeader?: boolean;
49
+ unauthenticatedUserDisplayName?: string;
50
+ }
51
+
52
+ // @alpha
53
+ export type IdentityType = "Consumer" | "Enterprise";
54
+
55
+ // @alpha
56
+ export interface IEntry {
57
+ key: string;
58
+ type: CacheContentType;
59
+ }
60
+
61
+ // @alpha (undocumented)
62
+ export interface IFileEntry {
63
+ docId: string;
64
+ resolvedUrl: IResolvedUrl;
65
+ }
66
+
67
+ // @internal (undocumented)
68
+ export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
69
+
70
+ // @alpha
71
+ export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
72
+ // (undocumented)
73
+ readonly errorType: OdspErrorType;
74
+ }
75
+
76
+ // @alpha (undocumented)
77
+ export interface IOdspErrorAugmentations {
78
+ facetCodes?: string[];
79
+ redirectLocation?: string;
80
+ serverEpoch?: string;
81
+ }
82
+
83
+ // @alpha (undocumented)
84
+ export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
85
+ // (undocumented)
86
+ codeHint?: {
87
+ containerPackageName?: string;
88
+ };
89
+ // (undocumented)
90
+ dataStorePath?: string;
91
+ // (undocumented)
92
+ endpoints: {
93
+ snapshotStorageUrl: string;
94
+ attachmentPOSTStorageUrl: string;
95
+ attachmentGETStorageUrl: string;
96
+ deltaStorageUrl: string;
97
+ };
98
+ // (undocumented)
99
+ fileName: string;
100
+ // (undocumented)
101
+ fileVersion: string | undefined;
102
+ // (undocumented)
103
+ hashedDocumentId: string;
104
+ // (undocumented)
105
+ isClpCompliantApp?: boolean;
106
+ // (undocumented)
107
+ odspResolvedUrl: true;
108
+ shareLinkInfo?: ShareLinkInfoType;
109
+ // (undocumented)
110
+ summarizer: boolean;
111
+ // (undocumented)
112
+ tokens: {};
113
+ // (undocumented)
114
+ type: "fluid";
115
+ // (undocumented)
116
+ url: string;
117
+ }
118
+
119
+ // @alpha (undocumented)
120
+ export interface IOdspUrlParts {
121
+ // (undocumented)
122
+ driveId: string;
123
+ // (undocumented)
124
+ itemId: string;
125
+ // (undocumented)
126
+ siteUrl: string;
127
+ }
128
+
129
+ // @alpha (undocumented)
130
+ export interface IOpsCachingPolicy {
131
+ batchSize?: number;
132
+ timerGranularity?: number;
133
+ totalOpsToCache?: number;
134
+ }
135
+
136
+ // @alpha
137
+ export interface IPersistedCache {
138
+ get(entry: ICacheEntry): Promise<any>;
139
+ put(entry: ICacheEntry, value: any): Promise<void>;
140
+ removeEntries(file: IFileEntry): Promise<void>;
141
+ }
142
+
143
+ // @alpha
144
+ export interface IProvideSessionAwareDriverFactory {
145
+ // (undocumented)
146
+ readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
147
+ }
148
+
149
+ // @alpha
150
+ export interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
151
+ // (undocumented)
152
+ getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
153
+ }
154
+
155
+ // @alpha
156
+ export interface ISharingLink extends ISharingLinkKind {
157
+ // (undocumented)
158
+ webUrl: string;
159
+ }
160
+
161
+ // @alpha
162
+ export interface ISharingLinkKind {
163
+ // (undocumented)
164
+ role?: SharingLinkRole;
165
+ // (undocumented)
166
+ scope: SharingLinkScope;
167
+ }
168
+
169
+ // @alpha (undocumented)
170
+ export interface ISnapshotOptions {
171
+ // (undocumented)
172
+ blobs?: number;
173
+ // (undocumented)
174
+ channels?: number;
175
+ // (undocumented)
176
+ deltas?: number;
177
+ // (undocumented)
178
+ mds?: number;
179
+ // (undocumented)
180
+ timeout?: number;
181
+ }
182
+
183
+ // @alpha
184
+ export interface ISocketStorageDiscovery {
185
+ // (undocumented)
186
+ deltaStorageUrl: string;
187
+ deltaStreamSocketUrl: string;
188
+ // (undocumented)
189
+ id: string;
190
+ refreshSessionDurationSeconds?: number;
191
+ // (undocumented)
192
+ runtimeTenantId?: string;
193
+ // (undocumented)
194
+ snapshotStorageUrl: string;
195
+ socketToken?: string;
196
+ // (undocumented)
197
+ tenantId: string;
198
+ }
199
+
200
+ // @internal
201
+ export const isTokenFromCache: (tokenResponse: string | TokenResponse | null) => boolean | undefined;
202
+
203
+ // @alpha (undocumented)
204
+ export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
205
+
206
+ // @alpha @deprecated
207
+ export enum OdspErrorType {
208
+ blockedIPAddress = "blockedIPAddress",
209
+ cannotCatchUp = "cannotCatchUp",
210
+ fetchTimeout = "fetchTimeout",
211
+ // (undocumented)
212
+ fetchTokenError = "fetchTokenError",
213
+ fluidNotEnabled = "fluidNotEnabled",
214
+ invalidFileNameError = "invalidFileNameError",
215
+ outOfStorageError = "outOfStorageError",
216
+ serviceReadOnly = "serviceReadOnly",
217
+ snapshotTooBig = "snapshotTooBig"
218
+ }
219
+
220
+ // @alpha
221
+ export const OdspErrorTypes: {
222
+ readonly invalidFileNameError: "invalidFileNameError";
223
+ readonly snapshotTooBig: "snapshotTooBig";
224
+ readonly fetchTimeout: "fetchTimeout";
225
+ readonly fluidNotEnabled: "fluidNotEnabled";
226
+ readonly cannotCatchUp: "cannotCatchUp";
227
+ readonly serviceReadOnly: "serviceReadOnly";
228
+ readonly blockedIPAddress: "blockedIPAddress";
229
+ readonly genericNetworkError: "genericNetworkError";
230
+ readonly authorizationError: "authorizationError";
231
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
232
+ readonly offlineError: "offlineError";
233
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
234
+ readonly writeError: "writeError";
235
+ readonly fetchFailure: "fetchFailure";
236
+ readonly fetchTokenError: "fetchTokenError";
237
+ readonly incorrectServerResponse: "incorrectServerResponse";
238
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
239
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
240
+ readonly locationRedirection: "locationRedirection";
241
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
242
+ readonly fileIsLocked: "fileIsLocked";
243
+ readonly outOfStorageError: "outOfStorageError";
244
+ readonly genericError: "genericError";
245
+ readonly throttlingError: "throttlingError";
246
+ readonly usageError: "usageError";
247
+ };
248
+
249
+ // @alpha (undocumented)
250
+ export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
251
+
252
+ // @alpha
253
+ export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
254
+ driveId?: string;
255
+ itemId?: string;
256
+ siteUrl: string;
257
+ }
258
+
259
+ // @alpha
260
+ export interface ShareLinkInfoType {
261
+ createLink?: {
262
+ type?: ShareLinkTypes | ISharingLinkKind;
263
+ link?: string | ISharingLink;
264
+ error?: any;
265
+ shareId?: string;
266
+ };
267
+ sharingLinkToRedeem?: string;
268
+ }
269
+
270
+ // @alpha @deprecated (undocumented)
271
+ export enum ShareLinkTypes {
272
+ // (undocumented)
273
+ csl = "csl"
274
+ }
275
+
276
+ // @alpha
277
+ export enum SharingLinkRole {
278
+ // (undocumented)
279
+ edit = "edit",
280
+ // (undocumented)
281
+ view = "view"
282
+ }
283
+
284
+ // @alpha
285
+ export enum SharingLinkScope {
286
+ // (undocumented)
287
+ anonymous = "anonymous",
288
+ // (undocumented)
289
+ default = "default",
290
+ // (undocumented)
291
+ organization = "organization",
292
+ // (undocumented)
293
+ users = "users"
294
+ }
295
+
296
+ // @internal
297
+ export const snapshotKey = "snapshot";
298
+
299
+ // @alpha
300
+ export type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
301
+
302
+ // @alpha
303
+ export interface TokenFetchOptions {
304
+ claims?: string;
305
+ refresh: boolean;
306
+ tenantId?: string;
307
+ }
308
+
309
+ // @internal
310
+ export const tokenFromResponse: (tokenResponse: string | TokenResponse | null | undefined) => string | null;
311
+
312
+ // @beta
313
+ export interface TokenResponse {
314
+ fromCache?: boolean;
315
+ token: string;
316
+ }
317
+
318
+ // (No @packageDocumentation comment for this package)
319
+
320
+ ```
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OdspErrorType = exports.OdspErrorTypes = void 0;
4
+ /*!
5
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
6
+ * Licensed under the MIT License.
7
+ */
8
+ const driver_definitions_1 = require("@fluidframework/driver-definitions");
9
+ /**
10
+ * ODSP Error types.
11
+ * Different error types that may be thrown by the ODSP driver.
12
+ * @alpha
13
+ */
14
+ exports.OdspErrorTypes = {
15
+ // Inherit base driver error types
16
+ ...driver_definitions_1.DriverErrorTypes,
17
+ /**
18
+ * Invalid file name (at creation of the file)
19
+ */
20
+ invalidFileNameError: "invalidFileNameError",
21
+ /**
22
+ * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
23
+ * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
24
+ * such case.
25
+ */
26
+ snapshotTooBig: "snapshotTooBig",
27
+ /**
28
+ * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
29
+ * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
30
+ * such case.
31
+ */
32
+ fetchTimeout: "fetchTimeout",
33
+ /**
34
+ * SPO admin toggle: fluid service is not enabled.
35
+ */
36
+ fluidNotEnabled: "fluidNotEnabled",
37
+ /**
38
+ * This error will be raised when client is too behind with no way to catch up.
39
+ * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
40
+ * by storage, and thus removing an ability for client to catch up.
41
+ * This condition will result in any local changes being lost (i.e. only way to save state is by user
42
+ * copying it over manually)
43
+ */
44
+ cannotCatchUp: "cannotCatchUp",
45
+ /**
46
+ * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
47
+ * So to preserve integrity of the data, the data becomes readonly.
48
+ */
49
+ serviceReadOnly: "serviceReadOnly",
50
+ /**
51
+ * Due to organizational policies, you can't access server resources from the current network location.
52
+ */
53
+ blockedIPAddress: "blockedIPAddress",
54
+ };
55
+ /**
56
+ * ODSP Error types.
57
+ * Different error types that may be thrown by the ODSP driver.
58
+ *
59
+ * @deprecated Use {@link (OdspErrorTypes:variable)} instead.
60
+ * @alpha
61
+ */
62
+ var OdspErrorType;
63
+ (function (OdspErrorType) {
64
+ /**
65
+ * Storage is out of space
66
+ */
67
+ OdspErrorType["outOfStorageError"] = "outOfStorageError";
68
+ /**
69
+ * Invalid file name (at creation of the file)
70
+ */
71
+ OdspErrorType["invalidFileNameError"] = "invalidFileNameError";
72
+ /**
73
+ * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
74
+ * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
75
+ * such case.
76
+ */
77
+ OdspErrorType["snapshotTooBig"] = "snapshotTooBig";
78
+ /**
79
+ * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
80
+ * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
81
+ * such case.
82
+ */
83
+ OdspErrorType["fetchTimeout"] = "fetchTimeout";
84
+ /**
85
+ * SPO admin toggle: fluid service is not enabled.
86
+ */
87
+ OdspErrorType["fluidNotEnabled"] = "fluidNotEnabled";
88
+ /**
89
+ * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
90
+ */
91
+ OdspErrorType["fetchTokenError"] = "fetchTokenError";
92
+ /**
93
+ * This error will be raised when client is too behind with no way to catch up.
94
+ * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
95
+ * by storage, and thus removing an ability for client to catch up.
96
+ * This condition will result in any local changes being lost (i.e. only way to save state is by user
97
+ * copying it over manually)
98
+ */
99
+ OdspErrorType["cannotCatchUp"] = "cannotCatchUp";
100
+ /**
101
+ * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
102
+ * So to preserve integrity of the data, the data becomes readonly.
103
+ */
104
+ OdspErrorType["serviceReadOnly"] = "serviceReadOnly";
105
+ /**
106
+ * Due to organizational policies, you can't access server resources from the current network location.
107
+ */
108
+ OdspErrorType["blockedIPAddress"] = "blockedIPAddress";
109
+ })(OdspErrorType || (exports.OdspErrorType = OdspErrorType = {}));
110
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.cjs","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2EAI4C;AAE5C;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,qCAAgB;IAEnB;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;OAIG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;;;;;OAMG;IACH,aAAa,EAAE,eAAe;IAE9B;;;OAGG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;CAC3B,CAAC;AAMX;;;;;;GAMG;AACH,IAAY,aAsDX;AAtDD,WAAY,aAAa;IACxB;;OAEG;IACH,wDAAuC,CAAA;IAEvC;;OAEG;IACH,8DAA6C,CAAA;IAE7C;;;;OAIG;IACH,kDAAiC,CAAA;IAEjC;;;;OAIG;IACH,8CAA6B,CAAA;IAE7B;;OAEG;IACH,oDAAmC,CAAA;IAEnC;;OAEG;IACH,oDAAmC,CAAA;IAEnC;;;;;;OAMG;IACH,gDAA+B,CAAA;IAE/B;;;OAGG;IACH,oDAAmC,CAAA;IAEnC;;OAEG;IACH,sDAAqC,CAAA;AACtC,CAAC,EAtDW,aAAa,6BAAb,aAAa,QAsDxB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n * @alpha\n */\nexport const OdspErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError: \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig: \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout: \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled: \"fluidNotEnabled\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp: \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly: \"serviceReadOnly\",\n\n\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress: \"blockedIPAddress\",\n} as const;\n/**\n * @alpha\n */\nexport type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n *\n * @deprecated Use {@link (OdspErrorTypes:variable)} instead.\n * @alpha\n */\nexport enum OdspErrorType {\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError = \"outOfStorageError\",\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError = \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig = \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout = \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled = \"fluidNotEnabled\",\n\n\t/**\n\t * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp = \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly = \"serviceReadOnly\",\n\n\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress = \"blockedIPAddress\",\n}\n\n/**\n * @alpha\n */\nexport interface IOdspErrorAugmentations {\n\t/**\n\t * Server epoch indicates when the file was last modified.\n\t * Used to detect modifications outside Fluid's services\n\t */\n\tserverEpoch?: string;\n\n\t/**\n\t * It is the redirection url at which the network call should have been made. It is due to change\n\t * in site domain of the file on server.\n\t */\n\tredirectLocation?: string;\n\n\t/**\n\t * It is array of error codes included in error response from server.\n\t */\n\tfacetCodes?: string[];\n}\n\n/**\n * Base interface for all errors and warnings\n * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties\n * @alpha\n */\nexport interface IOdspError extends Omit<IDriverErrorBase, \"errorType\">, IOdspErrorAugmentations {\n\treadonly errorType: OdspErrorType;\n}\n\n/**\n * @alpha\n */\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}