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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/.eslintrc.js +6 -9
  2. package/CHANGELOG.md +141 -0
  3. package/README.md +39 -1
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/odsp-driver-definitions.api.md +320 -0
  7. package/dist/errors.cjs +110 -0
  8. package/dist/errors.cjs.map +1 -0
  9. package/dist/errors.d.ts +122 -6
  10. package/dist/errors.d.ts.map +1 -1
  11. package/dist/{factory.js → factory.cjs} +1 -1
  12. package/dist/factory.cjs.map +1 -0
  13. package/dist/factory.d.ts +36 -6
  14. package/dist/factory.d.ts.map +1 -1
  15. package/dist/index.cjs +21 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.ts +6 -5
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/odsp-driver-definitions-alpha.d.ts +626 -0
  20. package/dist/odsp-driver-definitions-beta.d.ts +88 -0
  21. package/dist/odsp-driver-definitions-public.d.ts +79 -0
  22. package/dist/odsp-driver-definitions-untrimmed.d.ts +652 -0
  23. package/dist/odspCache.cjs +23 -0
  24. package/dist/odspCache.cjs.map +1 -0
  25. package/dist/odspCache.d.ts +21 -4
  26. package/dist/odspCache.d.ts.map +1 -1
  27. package/dist/resolvedUrl.cjs +37 -0
  28. package/dist/resolvedUrl.cjs.map +1 -0
  29. package/dist/resolvedUrl.d.ts +59 -16
  30. package/dist/resolvedUrl.d.ts.map +1 -1
  31. package/dist/{odspCache.js → sessionProvider.cjs} +1 -6
  32. package/dist/sessionProvider.cjs.map +1 -0
  33. package/dist/sessionProvider.d.ts +48 -0
  34. package/dist/sessionProvider.d.ts.map +1 -0
  35. package/dist/{tokenFetch.js → tokenFetch.cjs} +6 -2
  36. package/dist/tokenFetch.cjs.map +1 -0
  37. package/dist/tokenFetch.d.ts +15 -5
  38. package/dist/tokenFetch.d.ts.map +1 -1
  39. package/dist/tsdoc-metadata.json +11 -0
  40. package/lib/errors.d.mts +153 -0
  41. package/lib/errors.d.mts.map +1 -0
  42. package/lib/errors.mjs +103 -0
  43. package/lib/errors.mjs.map +1 -0
  44. package/lib/{factory.d.ts → factory.d.mts} +36 -6
  45. package/lib/factory.d.mts.map +1 -0
  46. package/lib/{factory.js → factory.mjs} +1 -1
  47. package/lib/factory.mjs.map +1 -0
  48. package/lib/index.d.mts +11 -0
  49. package/lib/index.d.mts.map +1 -0
  50. package/lib/index.mjs +9 -0
  51. package/lib/index.mjs.map +1 -0
  52. package/lib/odsp-driver-definitions-alpha.d.mts +626 -0
  53. package/lib/odsp-driver-definitions-beta.d.mts +88 -0
  54. package/lib/odsp-driver-definitions-public.d.mts +79 -0
  55. package/lib/odsp-driver-definitions-untrimmed.d.mts +652 -0
  56. package/lib/{odspCache.d.ts → odspCache.d.mts} +21 -4
  57. package/lib/odspCache.d.mts.map +1 -0
  58. package/lib/odspCache.mjs +19 -0
  59. package/lib/odspCache.mjs.map +1 -0
  60. package/lib/{resolvedUrl.d.ts → resolvedUrl.d.mts} +59 -16
  61. package/lib/resolvedUrl.d.mts.map +1 -0
  62. package/lib/resolvedUrl.mjs +34 -0
  63. package/lib/resolvedUrl.mjs.map +1 -0
  64. package/lib/sessionProvider.d.mts +48 -0
  65. package/lib/sessionProvider.d.mts.map +1 -0
  66. package/lib/sessionProvider.mjs +6 -0
  67. package/lib/sessionProvider.mjs.map +1 -0
  68. package/lib/{tokenFetch.d.ts → tokenFetch.d.mts} +15 -5
  69. package/lib/tokenFetch.d.mts.map +1 -0
  70. package/lib/{tokenFetch.js → tokenFetch.mjs} +6 -2
  71. package/lib/tokenFetch.mjs.map +1 -0
  72. package/package.json +71 -42
  73. package/prettier.config.cjs +8 -0
  74. package/src/errors.ts +153 -57
  75. package/src/factory.ts +146 -114
  76. package/src/index.ts +47 -5
  77. package/src/odspCache.ts +71 -51
  78. package/src/resolvedUrl.ts +125 -72
  79. package/src/sessionProvider.ts +61 -0
  80. package/src/tokenFetch.ts +56 -39
  81. package/tsc-multi.test.json +4 -0
  82. package/tsconfig.json +11 -13
  83. package/.editorconfig +0 -7
  84. package/dist/errors.js +0 -44
  85. package/dist/errors.js.map +0 -1
  86. package/dist/factory.js.map +0 -1
  87. package/dist/index.js +0 -22
  88. package/dist/index.js.map +0 -1
  89. package/dist/odspCache.js.map +0 -1
  90. package/dist/packageVersion.d.ts +0 -9
  91. package/dist/packageVersion.d.ts.map +0 -1
  92. package/dist/packageVersion.js +0 -12
  93. package/dist/packageVersion.js.map +0 -1
  94. package/dist/resolvedUrl.js +0 -18
  95. package/dist/resolvedUrl.js.map +0 -1
  96. package/dist/tokenFetch.js.map +0 -1
  97. package/lib/errors.d.ts +0 -41
  98. package/lib/errors.d.ts.map +0 -1
  99. package/lib/errors.js +0 -41
  100. package/lib/errors.js.map +0 -1
  101. package/lib/factory.d.ts.map +0 -1
  102. package/lib/factory.js.map +0 -1
  103. package/lib/index.d.ts +0 -10
  104. package/lib/index.d.ts.map +0 -1
  105. package/lib/index.js +0 -10
  106. package/lib/index.js.map +0 -1
  107. package/lib/odspCache.d.ts.map +0 -1
  108. package/lib/odspCache.js +0 -9
  109. package/lib/odspCache.js.map +0 -1
  110. package/lib/packageVersion.d.ts +0 -9
  111. package/lib/packageVersion.d.ts.map +0 -1
  112. package/lib/packageVersion.js +0 -9
  113. package/lib/packageVersion.js.map +0 -1
  114. package/lib/resolvedUrl.d.ts.map +0 -1
  115. package/lib/resolvedUrl.js +0 -15
  116. package/lib/resolvedUrl.js.map +0 -1
  117. package/lib/tokenFetch.d.ts.map +0 -1
  118. package/lib/tokenFetch.js.map +0 -1
  119. package/src/packageVersion.ts +0 -9
  120. package/tsconfig.esnext.json +0 -7
package/dist/errors.d.ts CHANGED
@@ -3,6 +3,79 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions";
6
+ /**
7
+ * ODSP Error types.
8
+ * Different error types that may be thrown by the ODSP driver.
9
+ * @alpha
10
+ */
11
+ export declare const OdspErrorTypes: {
12
+ /**
13
+ * Invalid file name (at creation of the file)
14
+ */
15
+ readonly invalidFileNameError: "invalidFileNameError";
16
+ /**
17
+ * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
18
+ * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
19
+ * such case.
20
+ */
21
+ readonly snapshotTooBig: "snapshotTooBig";
22
+ /**
23
+ * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
24
+ * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
25
+ * such case.
26
+ */
27
+ readonly fetchTimeout: "fetchTimeout";
28
+ /**
29
+ * SPO admin toggle: fluid service is not enabled.
30
+ */
31
+ readonly fluidNotEnabled: "fluidNotEnabled";
32
+ /**
33
+ * This error will be raised when client is too behind with no way to catch up.
34
+ * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
35
+ * by storage, and thus removing an ability for client to catch up.
36
+ * This condition will result in any local changes being lost (i.e. only way to save state is by user
37
+ * copying it over manually)
38
+ */
39
+ readonly cannotCatchUp: "cannotCatchUp";
40
+ /**
41
+ * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
42
+ * So to preserve integrity of the data, the data becomes readonly.
43
+ */
44
+ readonly serviceReadOnly: "serviceReadOnly";
45
+ /**
46
+ * Due to organizational policies, you can't access server resources from the current network location.
47
+ */
48
+ readonly blockedIPAddress: "blockedIPAddress";
49
+ readonly genericNetworkError: "genericNetworkError";
50
+ readonly authorizationError: "authorizationError";
51
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
52
+ readonly offlineError: "offlineError";
53
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
54
+ readonly writeError: "writeError";
55
+ readonly fetchFailure: "fetchFailure";
56
+ readonly fetchTokenError: "fetchTokenError";
57
+ readonly incorrectServerResponse: "incorrectServerResponse";
58
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
59
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
60
+ readonly locationRedirection: "locationRedirection";
61
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
62
+ readonly fileIsLocked: "fileIsLocked";
63
+ readonly outOfStorageError: "outOfStorageError";
64
+ readonly genericError: "genericError";
65
+ readonly throttlingError: "throttlingError";
66
+ readonly usageError: "usageError";
67
+ };
68
+ /**
69
+ * @alpha
70
+ */
71
+ export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
72
+ /**
73
+ * ODSP Error types.
74
+ * Different error types that may be thrown by the ODSP driver.
75
+ *
76
+ * @deprecated Use {@link (OdspErrorTypes:variable)} instead.
77
+ * @alpha
78
+ */
6
79
  export declare enum OdspErrorType {
7
80
  /**
8
81
  * Storage is out of space
@@ -18,24 +91,67 @@ export declare enum OdspErrorType {
18
91
  * such case.
19
92
  */
20
93
  snapshotTooBig = "snapshotTooBig",
94
+ /**
95
+ * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
96
+ * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
97
+ * such case.
98
+ */
21
99
  fetchTimeout = "fetchTimeout",
100
+ /**
101
+ * SPO admin toggle: fluid service is not enabled.
102
+ */
22
103
  fluidNotEnabled = "fluidNotEnabled",
104
+ /**
105
+ * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
106
+ */
23
107
  fetchTokenError = "fetchTokenError",
108
+ /**
109
+ * This error will be raised when client is too behind with no way to catch up.
110
+ * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
111
+ * by storage, and thus removing an ability for client to catch up.
112
+ * This condition will result in any local changes being lost (i.e. only way to save state is by user
113
+ * copying it over manually)
114
+ */
24
115
  cannotCatchUp = "cannotCatchUp",
116
+ /**
117
+ * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
118
+ * So to preserve integrity of the data, the data becomes readonly.
119
+ */
25
120
  serviceReadOnly = "serviceReadOnly",
26
- locationRedirection = "locationRedirection"
121
+ /**
122
+ * Due to organizational policies, you can't access server resources from the current network location.
123
+ */
124
+ blockedIPAddress = "blockedIPAddress"
27
125
  }
28
126
  /**
29
- * Base interface for all errors and warnings
30
- * Superset of IDriverErrorBase, but with Odsp-specific errorType
127
+ * @alpha
31
128
  */
32
- export interface IOdspError extends Omit<IDriverErrorBase, "errorType"> {
33
- readonly errorType: OdspErrorType;
129
+ export interface IOdspErrorAugmentations {
34
130
  /**
35
131
  * Server epoch indicates when the file was last modified.
36
132
  * Used to detect modifications outside Fluid's services
37
133
  */
38
134
  serverEpoch?: string;
135
+ /**
136
+ * It is the redirection url at which the network call should have been made. It is due to change
137
+ * in site domain of the file on server.
138
+ */
139
+ redirectLocation?: string;
140
+ /**
141
+ * It is array of error codes included in error response from server.
142
+ */
143
+ facetCodes?: string[];
144
+ }
145
+ /**
146
+ * Base interface for all errors and warnings
147
+ * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties
148
+ * @alpha
149
+ */
150
+ export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
151
+ readonly errorType: OdspErrorType;
39
152
  }
40
- export declare type OdspError = DriverError | IOdspError;
153
+ /**
154
+ * @alpha
155
+ */
156
+ export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
41
157
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEnF,oBAAY,aAAa;IACrB;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;;;OAIG;IACH,cAAc,mBAAmB;IAOjC,YAA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AAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,uBAAuB;IAC/F,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
@@ -4,4 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=factory.js.map
7
+ //# sourceMappingURL=factory.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.cjs","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @alpha\n */\nexport interface ISnapshotOptions {\n\tblobs?: number;\n\tdeltas?: number;\n\tchannels?: number;\n\t/*\n\t * Maximum Data size (in bytes)\n\t * If specified, SPO will fail snapshot request with 413 error (see OdspErrorType.snapshotTooBig)\n\t * if snapshot is bigger in size than specified limit.\n\t */\n\tmds?: number;\n\n\t/*\n\t * Maximum time limit to fetch snapshot (in seconds)\n\t * If specified, client will timeout the fetch request if it exceeds the time limit and\n\t * will try to fetch the snapshot without blobs.\n\t */\n\ttimeout?: number;\n}\n\n/**\n * @alpha\n */\nexport interface IOpsCachingPolicy {\n\t/**\n\t * Batch size. Controls how many ops are grouped together as single cache entry\n\t * The bigger the number, the more efficient it is (less reads & writes)\n\t * At the same time, big number means we wait for so many ops to accumulate, which\n\t * increases chances and number of trailing ops that would not be flushed to cache\n\t * when user closes tab\n\t * Use any number below 1 to disable caching\n\t * Default: 100\n\t */\n\tbatchSize?: number;\n\n\t/**\n\t * To reduce the problem of losing trailing ops when using big batch sizes, host\n\t * could specify how often driver should flush ops it has not flushed yet.\n\t * -1 means do not use timer.\n\t * Measured in ms.\n\t * Default: 5000\n\t */\n\ttimerGranularity?: number;\n\n\t/**\n\t * Total number of ops to cache. When we reach that number, ops caching stops\n\t * Default: 5000\n\t */\n\ttotalOpsToCache?: number;\n}\n\n/**\n * @alpha\n */\nexport interface ICollabSessionOptions {\n\t/**\n\t * Value indicating the display name for session that admits unauthenticated user.\n\t * This name will be used in attribution associated with edits made by such user.\n\t */\n\tunauthenticatedUserDisplayName?: string;\n\t/**\n\t * @deprecated Due to security reasons we will be passing the token via Authorization header only.\n\t * Value indicating session preference to always pass access token via Authorization header.\n\t * Default behavior is to pass access token via query parameter unless overall href string\n\t * length exceeds 2048 characters. Using query param is performance optimization which results\n\t * in ODSP XHR request being treated as 'simple' request which do not require OPTIONS call to\n\t * validate CORS. However, not all ODSP implementations understand this optimization.\n\t * For instance, auth layer on Converged stack will fail request with access token passed via\n\t * query param.\n\t */\n\tforceAccessTokenViaAuthorizationHeader?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface HostStoragePolicy {\n\tsnapshotOptions?: ISnapshotOptions;\n\n\t/**\n\t * If set to true, tells driver to concurrently fetch snapshot from storage (SPO) and cache\n\t * Container loads from whatever comes first in such case.\n\t * Snapshot fetched from storage is pushed to cache in either case.\n\t * If set to false, driver will first consult with cache. Only on cache miss (cache does not\n\t * return snapshot), driver will fetch snapshot from storage (and push it to cache), otherwise\n\t * it will load from cache and not reach out to storage.\n\t * Passing true results in faster loads and keeping cache more current, but it increases bandwidth consumption.\n\t */\n\tconcurrentSnapshotFetch?: boolean;\n\n\t// Options overwriting default ops fetching from storage.\n\topsBatchSize?: number;\n\tconcurrentOpsBatches?: number;\n\n\t/**\n\t * Policy controlling ops caching (leveraging IPersistedCache passed to driver factory)\n\t */\n\topsCaching?: IOpsCachingPolicy;\n\n\t/**\n\t * Policy controlling how collaboration session is established\n\t */\n\tsessionOptions?: ICollabSessionOptions;\n\n\t/**\n\t * @deprecated This field will be always set to true after removal.\n\t * True to have the sharing link redeem fallback in case the Trees Latest/Redeem 1RT call fails with redeem error.\n\t * During fallback it will first redeem the sharing link and then make the Trees latest call.\n\t */\n\tenableRedeemFallback?: boolean;\n\n\t/**\n\t * Policy controlling if we will cache initial summary when we create a document\n\t */\n\tcacheCreateNewSummary?: boolean;\n\n\t/**\n\t * @deprecated This will be replaced with feature gate snapshotFormatFetchType.\n\t * Policy controlling if we want to fetch binary format snapshot.\n\t */\n\tfetchBinarySnapshotFormat?: boolean;\n\n\t/**\n\t * If set to true, socket cache are per OdspDocumentService instead of shared across all instances\n\t */\n\tisolateSocketCache?: boolean;\n\n\t/**\n\t * @deprecated Switch to using the new feature gated by enableSingleRequestForShareLinkWithCreate\n\t * with 'createLinkScope' and 'createLinkRole' is requested to the odsp apis instead of 'createLinkType'.\n\t * It enables the creation of sharing link along with the creation of file by setting this value to true.\n\t * If the host provides a 'createLinkType' parameter in the request URL to the container.attach()\n\t * method, we will send the request to ODSP with the same (if the flag is enabled) so\n\t * that a share link can be created with the creation of file to save number for round trips made to ODSP.\n\t * (This flag works independently of enableSingleRequestForShareLinkWithCreate which is used for sharing link\n\t * requests where 'createLinkScope' is requested.)\n\t */\n\tenableShareLinkWithCreate?: boolean;\n\n\t/**\n\t * Enable creation of sharing link along with the creation of file by setting this value to true.\n\t * If the host provides a 'createLinkScope' parameter in the request URL to the container.attach()\n\t * method, we will send the request to ODSP with the same (if the flag is enabled) so\n\t * that a share link can be created with the creation of file to save number for round trips made to ODSP.\n\t * (This flag works independently of enableShareLinkWithCreate which was used for old sharing link requests\n\t * where 'createLinkType' was requested.)\n\t */\n\tenableSingleRequestForShareLinkWithCreate?: boolean;\n\n\t/**\n\t * True if host does not want the storage service to use the prefetch cache to get the snapshot. Undefined will be treated\n\t * as false. This is if the host wants to do some A/B testing.\n\t */\n\tavoidPrefetchSnapshotCache?: boolean;\n}\n"]}
package/dist/factory.d.ts CHANGED
@@ -2,6 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ /**
6
+ * @alpha
7
+ */
5
8
  export interface ISnapshotOptions {
6
9
  blobs?: number;
7
10
  deltas?: number;
@@ -9,6 +12,9 @@ export interface ISnapshotOptions {
9
12
  mds?: number;
10
13
  timeout?: number;
11
14
  }
15
+ /**
16
+ * @alpha
17
+ */
12
18
  export interface IOpsCachingPolicy {
13
19
  /**
14
20
  * Batch size. Controls how many ops are grouped together as single cache entry
@@ -34,6 +40,9 @@ export interface IOpsCachingPolicy {
34
40
  */
35
41
  totalOpsToCache?: number;
36
42
  }
43
+ /**
44
+ * @alpha
45
+ */
37
46
  export interface ICollabSessionOptions {
38
47
  /**
39
48
  * Value indicating the display name for session that admits unauthenticated user.
@@ -41,7 +50,7 @@ export interface ICollabSessionOptions {
41
50
  */
42
51
  unauthenticatedUserDisplayName?: string;
43
52
  /**
44
- * @deprecated - Due to security reasons we will passing the token via Authorization header only.
53
+ * @deprecated Due to security reasons we will be passing the token via Authorization header only.
45
54
  * Value indicating session preference to always pass access token via Authorization header.
46
55
  * Default behavior is to pass access token via query parameter unless overall href string
47
56
  * length exceeds 2048 characters. Using query param is performance optimization which results
@@ -52,6 +61,9 @@ export interface ICollabSessionOptions {
52
61
  */
53
62
  forceAccessTokenViaAuthorizationHeader?: boolean;
54
63
  }
64
+ /**
65
+ * @alpha
66
+ */
55
67
  export interface HostStoragePolicy {
56
68
  snapshotOptions?: ISnapshotOptions;
57
69
  /**
@@ -75,7 +87,7 @@ export interface HostStoragePolicy {
75
87
  */
76
88
  sessionOptions?: ICollabSessionOptions;
77
89
  /**
78
- * @deprecated - This field will be always set to true after removal.
90
+ * @deprecated This field will be always set to true after removal.
79
91
  * True to have the sharing link redeem fallback in case the Trees Latest/Redeem 1RT call fails with redeem error.
80
92
  * During fallback it will first redeem the sharing link and then make the Trees latest call.
81
93
  */
@@ -85,7 +97,7 @@ export interface HostStoragePolicy {
85
97
  */
86
98
  cacheCreateNewSummary?: boolean;
87
99
  /**
88
- * @deprecated - This will be replaced with feature gate snapshotFormatFetchType.
100
+ * @deprecated This will be replaced with feature gate snapshotFormatFetchType.
89
101
  * Policy controlling if we want to fetch binary format snapshot.
90
102
  */
91
103
  fetchBinarySnapshotFormat?: boolean;
@@ -94,11 +106,29 @@ export interface HostStoragePolicy {
94
106
  */
95
107
  isolateSocketCache?: boolean;
96
108
  /**
97
- * Enable creation of sharing link along with the creation of file by setting this value to true.
109
+ * @deprecated Switch to using the new feature gated by enableSingleRequestForShareLinkWithCreate
110
+ * with 'createLinkScope' and 'createLinkRole' is requested to the odsp apis instead of 'createLinkType'.
111
+ * It enables the creation of sharing link along with the creation of file by setting this value to true.
98
112
  * If the host provides a 'createLinkType' parameter in the request URL to the container.attach()
99
- * method, we will request for send the request to ODSP with the same (if the flag is enabled) so
100
- * that a sharing can be created with the creation of file to save number for round trips made to ODSP.
113
+ * method, we will send the request to ODSP with the same (if the flag is enabled) so
114
+ * that a share link can be created with the creation of file to save number for round trips made to ODSP.
115
+ * (This flag works independently of enableSingleRequestForShareLinkWithCreate which is used for sharing link
116
+ * requests where 'createLinkScope' is requested.)
101
117
  */
102
118
  enableShareLinkWithCreate?: boolean;
119
+ /**
120
+ * Enable creation of sharing link along with the creation of file by setting this value to true.
121
+ * If the host provides a 'createLinkScope' parameter in the request URL to the container.attach()
122
+ * method, we will send the request to ODSP with the same (if the flag is enabled) so
123
+ * that a share link can be created with the creation of file to save number for round trips made to ODSP.
124
+ * (This flag works independently of enableShareLinkWithCreate which was used for old sharing link requests
125
+ * where 'createLinkType' was requested.)
126
+ */
127
+ enableSingleRequestForShareLinkWithCreate?: boolean;
128
+ /**
129
+ * True if host does not want the storage service to use the prefetch cache to get the snapshot. Undefined will be treated
130
+ * as false. This is if the host wants to do some A/B testing.
131
+ */
132
+ avoidPrefetchSnapshotCache?: boolean;
103
133
  }
104
134
  //# sourceMappingURL=factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,GAAG,CAAC,EAAE,MAAM,CAAC;IAOb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IAClC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC;;;;;;;;;OASG;IACH,sCAAsC,CAAC,EAAE,OAAO,CAAC;CACpD;AAED,MAAM,WAAW,iBAAiB;IAC9B,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAGlC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B;;OAEG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IAEvC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;OAKG;IACF,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IAE7B;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;;;OAOG;IACH,yCAAyC,CAAC,EAAE,OAAO,CAAC;IAEpD;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACrC"}
package/dist/index.cjs ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.tokenFromResponse = exports.isTokenFromCache = exports.SharingLinkScope = exports.SharingLinkRole = exports.ShareLinkTypes = exports.snapshotKey = exports.getKeyForCacheEntry = exports.OdspErrorTypes = exports.OdspErrorType = void 0;
8
+ var errors_1 = require("./errors.cjs");
9
+ Object.defineProperty(exports, "OdspErrorType", { enumerable: true, get: function () { return errors_1.OdspErrorType; } });
10
+ Object.defineProperty(exports, "OdspErrorTypes", { enumerable: true, get: function () { return errors_1.OdspErrorTypes; } });
11
+ var odspCache_1 = require("./odspCache.cjs");
12
+ Object.defineProperty(exports, "getKeyForCacheEntry", { enumerable: true, get: function () { return odspCache_1.getKeyForCacheEntry; } });
13
+ Object.defineProperty(exports, "snapshotKey", { enumerable: true, get: function () { return odspCache_1.snapshotKey; } });
14
+ var resolvedUrl_1 = require("./resolvedUrl.cjs");
15
+ Object.defineProperty(exports, "ShareLinkTypes", { enumerable: true, get: function () { return resolvedUrl_1.ShareLinkTypes; } });
16
+ Object.defineProperty(exports, "SharingLinkRole", { enumerable: true, get: function () { return resolvedUrl_1.SharingLinkRole; } });
17
+ Object.defineProperty(exports, "SharingLinkScope", { enumerable: true, get: function () { return resolvedUrl_1.SharingLinkScope; } });
18
+ var tokenFetch_1 = require("./tokenFetch.cjs");
19
+ Object.defineProperty(exports, "isTokenFromCache", { enumerable: true, get: function () { return tokenFetch_1.isTokenFromCache; } });
20
+ Object.defineProperty(exports, "tokenFromResponse", { enumerable: true, get: function () { return tokenFetch_1.tokenFromResponse; } });
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAMkB;AAFjB,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AAQf,6CAQqB;AANpB,gHAAA,mBAAmB,OAAA;AAKnB,wGAAA,WAAW,OAAA;AAEZ,iDASuB;AAHtB,6GAAA,cAAc,OAAA;AACd,8GAAA,eAAe,OAAA;AACf,+GAAA,gBAAgB,OAAA;AAEjB,+CASsB;AANrB,8GAAA,gBAAgB,OAAA;AAIhB,+GAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIOdspError,\n\tIOdspErrorAugmentations,\n\tOdspError,\n\tOdspErrorType,\n\tOdspErrorTypes,\n} from \"./errors\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory\";\nexport {\n\tCacheContentType,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n} from \"./odspCache\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tShareLinkTypes,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider\";\n"]}
package/dist/index.d.ts CHANGED
@@ -2,9 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export * from "./resolvedUrl";
6
- export * from "./tokenFetch";
7
- export * from "./odspCache";
8
- export * from "./factory";
9
- export * from "./errors";
5
+ export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorType, OdspErrorTypes, } from "./errors";
6
+ export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory";
7
+ export { CacheContentType, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache";
8
+ export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType, ShareLinkTypes, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl";
9
+ export { IdentityType, InstrumentedStorageTokenFetcher, isTokenFromCache, OdspResourceTokenFetchOptions, TokenFetcher, TokenFetchOptions, tokenFromResponse, TokenResponse, } from "./tokenFetch";
10
+ export { IProvideSessionAwareDriverFactory, IRelaySessionAwareDriverFactory, ISocketStorageDiscovery, } from "./sessionProvider";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,cAAc,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,mBAAmB,CAAC"}