@fluidframework/odsp-driver-definitions 2.0.0-rc.4.0.6 → 2.0.0-rc.5.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluidframework/odsp-driver-definitions
2
2
 
3
+ ## 2.0.0-rc.5.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Update to TypeScript 5.4 ([#21214](https://github.com/microsoft/FluidFramework/pull/21214)) [0e6256c722](https://github.com/microsoft/FluidFramework/commit/0e6256c722d8bf024f4325bf02547daeeb18bfa6)
8
+
9
+ Update package implementations to use TypeScript 5.4.5.
10
+
3
11
  ## 2.0.0-rc.4.0.0
4
12
 
5
13
  Dependency updates only.
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/dist/beta.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/beta.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/dist/legacy.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/legacy.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
5
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.esm.primary.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.esm.current.json"
4
4
  }
@@ -1,4 +1,4 @@
1
- ## API Report File for "@fluidframework/odsp-driver-definitions"
1
+ ## Alpha API Report File for "@fluidframework/odsp-driver-definitions"
2
2
 
3
3
  > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
4
 
@@ -12,9 +12,6 @@ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
12
12
  // @alpha (undocumented)
13
13
  export type CacheContentType = "snapshot" | "ops";
14
14
 
15
- // @internal
16
- export function getKeyForCacheEntry(entry: ICacheEntry): string;
17
-
18
15
  // @alpha (undocumented)
19
16
  export interface HostStoragePolicy {
20
17
  avoidPrefetchSnapshotCache?: boolean;
@@ -65,12 +62,6 @@ export interface IFileEntry {
65
62
  resolvedUrl: IResolvedUrl;
66
63
  }
67
64
 
68
- // @internal (undocumented)
69
- export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string>;
70
-
71
- // @internal (undocumented)
72
- export type InstrumentedTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
73
-
74
65
  // @alpha
75
66
  export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
76
67
  // (undocumented)
@@ -201,12 +192,6 @@ export interface ISocketStorageDiscovery {
201
192
  tenantId: string;
202
193
  }
203
194
 
204
- // @internal
205
- export const isTokenFromCache: (tokenResponse: string | TokenResponse | null) => boolean | undefined;
206
-
207
- // @internal
208
- export const maximumCacheDurationMs: FiveDaysMs;
209
-
210
195
  // @alpha (undocumented)
211
196
  export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
212
197
 
@@ -279,9 +264,6 @@ export enum SharingLinkScope {
279
264
  users = "users"
280
265
  }
281
266
 
282
- // @internal
283
- export const snapshotKey = "snapshot";
284
-
285
267
  // @alpha
286
268
  export type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
287
269
 
@@ -292,10 +274,7 @@ export interface TokenFetchOptions {
292
274
  tenantId?: string;
293
275
  }
294
276
 
295
- // @internal
296
- export const tokenFromResponse: (tokenResponse: string | TokenResponse | null | undefined) => string | null;
297
-
298
- // @beta
277
+ // @alpha
299
278
  export interface TokenResponse {
300
279
  fromCache?: boolean;
301
280
  token: string;
@@ -0,0 +1,14 @@
1
+ ## Beta 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/internal';
8
+ import { FiveDaysMs } from '@fluidframework/driver-definitions/internal';
9
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions/internal';
10
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
11
+
12
+ // (No @packageDocumentation comment for this package)
13
+
14
+ ```
@@ -0,0 +1,14 @@
1
+ ## Public 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/internal';
8
+ import { FiveDaysMs } from '@fluidframework/driver-definitions/internal';
9
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions/internal';
10
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
11
+
12
+ // (No @packageDocumentation comment for this package)
13
+
14
+ ```
package/biome.jsonc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
+ "extends": ["../../../biome.jsonc"]
4
+ }
package/dist/beta.d.ts CHANGED
@@ -8,7 +8,5 @@
8
8
  * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
9
  */
10
10
 
11
- export {
12
- // @beta APIs
13
- TokenResponse
14
- } from "./index.js";
11
+ export {}
12
+
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,gBAAgB,EAChB,WAAW,EACX,MAAM,6CAA6C,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;IAGJ;;OAEG;;;;;;;;;;CAHO,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAA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AW,GAAG,uBAAuB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAIqD;AAErD;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,2BAAgB;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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n\tDriverError,\n} from \"@fluidframework/driver-definitions/internal\";\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 * @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: OdspErrorTypes;\n}\n\n/**\n * @alpha\n */\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAIqD;AAErD;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,2BAAgB;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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n\tDriverError,\n} from \"@fluidframework/driver-definitions/internal\";\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 * @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\n\textends Omit<IDriverErrorBase, \"errorType\">,\n\t\tIOdspErrorAugmentations {\n\treadonly errorType: OdspErrorTypes;\n}\n\n/**\n * @alpha\n */\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
package/dist/legacy.d.ts CHANGED
@@ -9,9 +9,6 @@
9
9
  */
10
10
 
11
11
  export {
12
- // @beta APIs
13
- TokenResponse,
14
-
15
12
  // @alpha APIs
16
13
  CacheContentType,
17
14
  HostStoragePolicy,
@@ -39,5 +36,6 @@ export {
39
36
  SharingLinkRole,
40
37
  SharingLinkScope,
41
38
  TokenFetchOptions,
42
- TokenFetcher
39
+ TokenFetcher,
40
+ TokenResponse
43
41
  } from "./index.js";
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * Represents token response
7
- * @beta
7
+ * @alpha
8
8
  */
9
9
  export interface TokenResponse {
10
10
  /** Token value */
@@ -1 +1 @@
1
- {"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd;;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AM,CAAC,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokenFetch.js","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmEH;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC7B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAPX,QAAA,iBAAiB,qBAON;AAExB;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;AALf,QAAA,gBAAgB,oBAKD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t? null\n\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string>;\n\n/**\n * @internal\n */\nexport type InstrumentedTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
1
+ {"version":3,"file":"tokenFetch.js","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmEH;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC5B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAPZ,QAAA,iBAAiB,qBAOL;AAEzB;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;AALf,QAAA,gBAAgB,oBAKD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @alpha\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t\t? null\n\t\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string>;\n\n/**\n * @internal\n */\nexport type InstrumentedTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
package/lib/beta.d.ts CHANGED
@@ -8,7 +8,5 @@
8
8
  * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
9
  */
10
10
 
11
- export {
12
- // @beta APIs
13
- TokenResponse
14
- } from "./index.js";
11
+ export {}
12
+
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,gBAAgB,EAChB,WAAW,EACX,MAAM,6CAA6C,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;IAGJ;;OAEG;;;;;;;;;;CAHO,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;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,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,gBAAgB,EAChB,WAAW,EACX,MAAM,6CAA6C,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;IAGJ;;OAEG;;;;;;;;;;CAHO,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAChB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAC1C,uBAAuB;IACxB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
package/lib/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,GAGhB,MAAM,6CAA6C,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,gBAAgB;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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n\tDriverError,\n} from \"@fluidframework/driver-definitions/internal\";\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 * @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: OdspErrorTypes;\n}\n\n/**\n * @alpha\n */\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,GAGhB,MAAM,6CAA6C,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,gBAAgB;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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n\tDriverError,\n} from \"@fluidframework/driver-definitions/internal\";\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 * @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\n\textends Omit<IDriverErrorBase, \"errorType\">,\n\t\tIOdspErrorAugmentations {\n\treadonly errorType: OdspErrorTypes;\n}\n\n/**\n * @alpha\n */\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
package/lib/legacy.d.ts CHANGED
@@ -9,9 +9,6 @@
9
9
  */
10
10
 
11
11
  export {
12
- // @beta APIs
13
- TokenResponse,
14
-
15
12
  // @alpha APIs
16
13
  CacheContentType,
17
14
  HostStoragePolicy,
@@ -39,5 +36,6 @@ export {
39
36
  SharingLinkRole,
40
37
  SharingLinkScope,
41
38
  TokenFetchOptions,
42
- TokenFetcher
39
+ TokenFetcher,
40
+ TokenResponse
43
41
  } from "./index.js";
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * Represents token response
7
- * @beta
7
+ * @alpha
8
8
  */
9
9
  export interface TokenResponse {
10
10
  /** Token value */
@@ -1 +1 @@
1
- {"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB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E,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokenFetch.js","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC7B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t? null\n\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string>;\n\n/**\n * @internal\n */\nexport type InstrumentedTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
1
+ {"version":3,"file":"tokenFetch.js","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC5B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @alpha\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t\t? null\n\t\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string>;\n\n/**\n * @internal\n */\nexport type InstrumentedTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.43.1"
8
+ "packageVersion": "7.45.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver-definitions",
3
- "version": "2.0.0-rc.4.0.6",
3
+ "version": "2.0.0-rc.5.0.0",
4
4
  "description": "Socket storage implementation for SPO and ODC",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,24 +57,24 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/driver-definitions": ">=2.0.0-rc.4.0.6 <2.0.0-rc.4.1.0"
60
+ "@fluidframework/driver-definitions": ">=2.0.0-rc.5.0.0 <2.0.0-rc.5.1.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@arethetypeswrong/cli": "^0.15.2",
64
- "@biomejs/biome": "^1.6.2",
65
- "@fluid-tools/build-cli": "^0.38.0",
64
+ "@biomejs/biome": "^1.7.3",
65
+ "@fluid-tools/build-cli": "^0.39.0",
66
66
  "@fluidframework/build-common": "^2.0.3",
67
- "@fluidframework/build-tools": "^0.38.0",
68
- "@fluidframework/eslint-config-fluid": "^5.1.0",
69
- "@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-rc.3.0.0",
70
- "@fluidframework/protocol-definitions": "^3.2.0",
71
- "@microsoft/api-extractor": "^7.43.1",
67
+ "@fluidframework/build-tools": "^0.39.0",
68
+ "@fluidframework/eslint-config-fluid": "^5.3.0",
69
+ "@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-rc.4.0.0",
70
+ "@microsoft/api-extractor": "^7.45.1",
71
+ "concurrently": "^8.2.1",
72
72
  "copyfiles": "^2.4.1",
73
73
  "cross-env": "^7.0.3",
74
74
  "eslint": "~8.55.0",
75
75
  "prettier": "~3.0.3",
76
76
  "rimraf": "^4.4.0",
77
- "typescript": "~5.1.6"
77
+ "typescript": "~5.4.5"
78
78
  },
79
79
  "typeValidation": {
80
80
  "broken": {}
@@ -92,13 +92,23 @@
92
92
  "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
93
93
  "build:test:esm": "tsc --project ./src/test/tsconfig.json",
94
94
  "check:are-the-types-wrong": "attw --pack .",
95
+ "check:biome": "biome check . --formatter-enabled=true",
96
+ "check:exports": "concurrently \"npm:check:exports:*\"",
97
+ "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
98
+ "check:exports:cjs:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.cjs.json",
99
+ "check:exports:cjs:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.cjs.json",
100
+ "check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
101
+ "check:exports:esm:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.esm.json",
102
+ "check:exports:esm:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.esm.json",
103
+ "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
104
+ "check:format": "npm run check:biome",
95
105
  "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
96
- "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
97
106
  "ci:build:docs": "api-extractor run",
98
107
  "clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
99
108
  "eslint": "eslint --format stylish src",
100
109
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
101
- "format": "fluid-build --task format .",
110
+ "format": "npm run format:biome",
111
+ "format:biome": "biome check . --formatter-enabled=true --apply",
102
112
  "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
103
113
  "lint": "fluid-build . --task lint",
104
114
  "lint:fix": "fluid-build . --task eslint:fix --task format",
package/src/errors.ts CHANGED
@@ -94,7 +94,9 @@ export interface IOdspErrorAugmentations {
94
94
  * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties
95
95
  * @alpha
96
96
  */
97
- export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
97
+ export interface IOdspError
98
+ extends Omit<IDriverErrorBase, "errorType">,
99
+ IOdspErrorAugmentations {
98
100
  readonly errorType: OdspErrorTypes;
99
101
  }
100
102
 
package/src/tokenFetch.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /**
7
7
  * Represents token response
8
- * @beta
8
+ * @alpha
9
9
  */
10
10
  export interface TokenResponse {
11
11
  /** Token value */
@@ -80,8 +80,8 @@ export const tokenFromResponse = (
80
80
  tokenResponse === null || typeof tokenResponse === "string"
81
81
  ? tokenResponse
82
82
  : tokenResponse === undefined
83
- ? null
84
- : tokenResponse.token;
83
+ ? null
84
+ : tokenResponse.token;
85
85
 
86
86
  /**
87
87
  * Helper method which returns flag indicating whether token response comes from local cache
package/tsdoc.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3
+ "extends": ["../../../common/build/build-common/tsdoc-base.json"]
4
+ }