@fluidframework/odsp-driver-definitions 2.0.0-rc.1.0.3 → 2.0.0-rc.2.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.
Files changed (94) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -1
  2. package/CHANGELOG.md +24 -0
  3. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  4. package/api-extractor.json +1 -1
  5. package/api-report/odsp-driver-definitions.api.md +7 -24
  6. package/dist/errors.d.ts +1 -55
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +1 -56
  9. package/dist/errors.js.map +1 -1
  10. package/dist/factory.d.ts +7 -0
  11. package/dist/factory.d.ts.map +1 -1
  12. package/dist/factory.js.map +1 -1
  13. package/dist/index.d.ts +6 -6
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +13 -14
  16. package/dist/index.js.map +1 -1
  17. package/dist/odsp-driver-definitions-alpha.d.ts +22 -74
  18. package/dist/odsp-driver-definitions-beta.d.ts +9 -5
  19. package/dist/odsp-driver-definitions-public.d.ts +5 -4
  20. package/dist/odsp-driver-definitions-untrimmed.d.ts +28 -72
  21. package/dist/odspCache.d.ts +10 -1
  22. package/dist/odspCache.d.ts.map +1 -1
  23. package/dist/odspCache.js +10 -1
  24. package/dist/odspCache.js.map +1 -1
  25. package/dist/package.json +3 -0
  26. package/dist/resolvedUrl.d.ts +1 -16
  27. package/dist/resolvedUrl.d.ts.map +1 -1
  28. package/dist/resolvedUrl.js +1 -10
  29. package/dist/resolvedUrl.js.map +1 -1
  30. package/dist/sessionProvider.d.ts +6 -0
  31. package/dist/sessionProvider.d.ts.map +1 -1
  32. package/dist/sessionProvider.js.map +1 -1
  33. package/dist/tokenFetch.d.ts +4 -1
  34. package/dist/tokenFetch.d.ts.map +1 -1
  35. package/dist/tokenFetch.js.map +1 -1
  36. package/dist/tsdoc-metadata.json +1 -1
  37. package/lib/{errors.d.mts → errors.d.ts} +6 -56
  38. package/lib/errors.d.ts.map +1 -0
  39. package/lib/errors.js +52 -0
  40. package/lib/errors.js.map +1 -0
  41. package/lib/{factory.d.mts → factory.d.ts} +8 -1
  42. package/lib/factory.d.ts.map +1 -0
  43. package/lib/{factory.mjs → factory.js} +1 -1
  44. package/lib/factory.js.map +1 -0
  45. package/lib/{index.d.mts → index.d.ts} +7 -7
  46. package/lib/index.d.ts.map +1 -0
  47. package/lib/index.js +9 -0
  48. package/lib/index.js.map +1 -0
  49. package/lib/{odsp-driver-definitions-alpha.d.mts → odsp-driver-definitions-alpha.d.ts} +22 -74
  50. package/lib/{odsp-driver-definitions-beta.d.mts → odsp-driver-definitions-beta.d.ts} +9 -5
  51. package/lib/{odsp-driver-definitions-public.d.mts → odsp-driver-definitions-public.d.ts} +5 -4
  52. package/lib/{odsp-driver-definitions-untrimmed.d.mts → odsp-driver-definitions-untrimmed.d.ts} +28 -72
  53. package/lib/{odspCache.d.mts → odspCache.d.ts} +11 -2
  54. package/lib/odspCache.d.ts.map +1 -0
  55. package/lib/{odspCache.mjs → odspCache.js} +10 -1
  56. package/lib/odspCache.js.map +1 -0
  57. package/lib/{resolvedUrl.d.mts → resolvedUrl.d.ts} +2 -17
  58. package/lib/resolvedUrl.d.ts.map +1 -0
  59. package/lib/{resolvedUrl.mjs → resolvedUrl.js} +1 -10
  60. package/lib/resolvedUrl.js.map +1 -0
  61. package/lib/{sessionProvider.d.mts → sessionProvider.d.ts} +7 -1
  62. package/lib/sessionProvider.d.ts.map +1 -0
  63. package/lib/{sessionProvider.mjs → sessionProvider.js} +1 -1
  64. package/lib/sessionProvider.js.map +1 -0
  65. package/lib/{tokenFetch.d.mts → tokenFetch.d.ts} +5 -2
  66. package/lib/tokenFetch.d.ts.map +1 -0
  67. package/lib/{tokenFetch.mjs → tokenFetch.js} +1 -1
  68. package/lib/tokenFetch.js.map +1 -0
  69. package/package.json +42 -32
  70. package/src/errors.ts +1 -64
  71. package/src/factory.ts +5 -2
  72. package/src/index.ts +7 -13
  73. package/src/odspCache.ts +11 -1
  74. package/src/resolvedUrl.ts +1 -18
  75. package/src/sessionProvider.ts +7 -0
  76. package/src/tokenFetch.ts +4 -1
  77. package/tsconfig.cjs.json +7 -0
  78. package/tsconfig.json +2 -5
  79. package/lib/errors.d.mts.map +0 -1
  80. package/lib/errors.mjs +0 -103
  81. package/lib/errors.mjs.map +0 -1
  82. package/lib/factory.d.mts.map +0 -1
  83. package/lib/factory.mjs.map +0 -1
  84. package/lib/index.d.mts.map +0 -1
  85. package/lib/index.mjs +0 -9
  86. package/lib/index.mjs.map +0 -1
  87. package/lib/odspCache.d.mts.map +0 -1
  88. package/lib/odspCache.mjs.map +0 -1
  89. package/lib/resolvedUrl.d.mts.map +0 -1
  90. package/lib/resolvedUrl.mjs.map +0 -1
  91. package/lib/sessionProvider.d.mts.map +0 -1
  92. package/lib/sessionProvider.mjs.map +0 -1
  93. package/lib/tokenFetch.d.mts.map +0 -1
  94. package/lib/tokenFetch.mjs.map +0 -1
@@ -28,6 +28,12 @@ export interface ISocketStorageDiscovery {
28
28
  * This is the time within which client has to refresh the session on (ODSP) relay service.
29
29
  */
30
30
  refreshSessionDurationSeconds?: number;
31
+ /**
32
+ * Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
33
+ * response will contain empty labels when the file has no labels, so this field will be there
34
+ * even if file has no labels when the service will implement this contract.
35
+ */
36
+ sensitivityLabelsInfo?: string;
31
37
  }
32
38
  /**
33
39
  * An interface that allows a concrete instance of a driver factory to interrogate itself
@@ -45,4 +51,4 @@ export interface IProvideSessionAwareDriverFactory {
45
51
  export interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
46
52
  getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
47
53
  }
48
- //# sourceMappingURL=sessionProvider.d.mts.map
54
+ //# sourceMappingURL=sessionProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionProvider.d.ts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEvC,EAAE,EAAE,MAAM,CAAC;IAIX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAEvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IACjD,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;CAC1E;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iCAAiC;IACzF,0BAA0B,CACzB,WAAW,EAAE,YAAY,GACvB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;CAChD"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=sessionProvider.mjs.map
6
+ //# sourceMappingURL=sessionProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionProvider.js","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * Socket storage discovery api response\n * @alpha\n */\nexport interface ISocketStorageDiscovery {\n\t// The id of the web socket\n\tid: string;\n\n\t// SPO gives us runtimeTenantId, we remap it to tenantId\n\t// See getSocketStorageDiscovery\n\truntimeTenantId?: string;\n\ttenantId: string;\n\n\tsnapshotStorageUrl: string;\n\tdeltaStorageUrl: string;\n\n\t/**\n\t * PUSH URL\n\t */\n\tdeltaStreamSocketUrl: string;\n\n\t/**\n\t * The access token for PushChannel. Optionally returned, depending on implementation.\n\t * OneDrive for Consumer implementation returns it and OneDrive for Business implementation\n\t * does not return it and instead expects token to be returned via `getWebsocketToken` callback\n\t * passed as a parameter to `OdspDocumentService.create()` factory.\n\t */\n\tsocketToken?: string;\n\n\t/**\n\t * This is the time within which client has to refresh the session on (ODSP) relay service.\n\t */\n\trefreshSessionDurationSeconds?: number;\n\n\t/**\n\t * Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The\n\t * response will contain empty labels when the file has no labels, so this field will be there\n\t * even if file has no labels when the service will implement this contract.\n\t */\n\tsensitivityLabelsInfo?: string;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to interrogate itself\n * to find out if it is session aware.\n * @alpha\n */\nexport interface IProvideSessionAwareDriverFactory {\n\treadonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`\n * function if it session aware.\n * @alpha\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
@@ -9,7 +9,10 @@
9
9
  export interface TokenResponse {
10
10
  /** Token value */
11
11
  token: string;
12
- /** Flag indicating whether token was obtained from local cache */
12
+ /**
13
+ * Whether or not the token was obtained from local cache.
14
+ * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
15
+ */
13
16
  fromCache?: boolean;
14
17
  }
15
18
  /**
@@ -81,4 +84,4 @@ export type IdentityType = "Consumer" | "Enterprise";
81
84
  * @internal
82
85
  */
83
86
  export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
84
- //# sourceMappingURL=tokenFetch.d.mts.map
87
+ //# sourceMappingURL=tokenFetch.d.ts.map
@@ -0,0 +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;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACd,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,KACtD,MAAM,GAAG,IAKW,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,kBACb,MAAM,GAAG,aAAa,GAAG,IAAI,KAC1C,OAAO,GAAG,SAGc,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
@@ -23,4 +23,4 @@ export const tokenFromResponse = (tokenResponse) => tokenResponse === null || ty
23
23
  export const isTokenFromCache = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
24
24
  ? undefined
25
25
  : tokenResponse.fromCache;
26
- //# sourceMappingURL=tokenFetch.mjs.map
26
+ //# sourceMappingURL=tokenFetch.js.map
@@ -0,0 +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 | null>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver-definitions",
3
- "version": "2.0.0-rc.1.0.3",
3
+ "version": "2.0.0-rc.2.0.0",
4
4
  "description": "Socket storage implementation for SPO and ODC",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,79 +11,78 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
+ "type": "module",
14
15
  "exports": {
15
16
  ".": {
16
17
  "import": {
17
- "types": "./lib/index.d.mts",
18
- "default": "./lib/index.mjs"
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
19
20
  },
20
21
  "require": {
21
22
  "types": "./dist/index.d.ts",
22
23
  "default": "./dist/index.js"
23
24
  }
24
25
  },
25
- "./alpha": {
26
+ "./public": {
26
27
  "import": {
27
- "types": "./lib/odsp-driver-definitions-alpha.d.mts",
28
- "default": "./lib/index.mjs"
28
+ "types": "./lib/odsp-driver-definitions-public.d.ts",
29
+ "default": "./lib/index.js"
29
30
  },
30
31
  "require": {
31
- "types": "./dist/odsp-driver-definitions-alpha.d.ts",
32
+ "types": "./dist/odsp-driver-definitions-public.d.ts",
32
33
  "default": "./dist/index.js"
33
34
  }
34
35
  },
35
36
  "./beta": {
36
37
  "import": {
37
- "types": "./lib/odsp-driver-definitions-beta.d.mts",
38
- "default": "./lib/index.mjs"
38
+ "types": "./lib/odsp-driver-definitions-beta.d.ts",
39
+ "default": "./lib/index.js"
39
40
  },
40
41
  "require": {
41
42
  "types": "./dist/odsp-driver-definitions-beta.d.ts",
42
43
  "default": "./dist/index.js"
43
44
  }
44
45
  },
45
- "./internal": {
46
+ "./alpha": {
46
47
  "import": {
47
- "types": "./lib/index.d.mts",
48
- "default": "./lib/index.mjs"
48
+ "types": "./lib/odsp-driver-definitions-alpha.d.ts",
49
+ "default": "./lib/index.js"
49
50
  },
50
51
  "require": {
51
- "types": "./dist/index.d.ts",
52
+ "types": "./dist/odsp-driver-definitions-alpha.d.ts",
52
53
  "default": "./dist/index.js"
53
54
  }
54
55
  },
55
- "./public": {
56
+ "./internal": {
56
57
  "import": {
57
- "types": "./lib/odsp-driver-definitions-public.d.mts",
58
- "default": "./lib/index.mjs"
58
+ "types": "./lib/index.d.ts",
59
+ "default": "./lib/index.js"
59
60
  },
60
61
  "require": {
61
- "types": "./dist/odsp-driver-definitions-public.d.ts",
62
+ "types": "./dist/index.d.ts",
62
63
  "default": "./dist/index.js"
63
64
  }
64
65
  }
65
66
  },
66
67
  "main": "dist/index.js",
67
- "module": "lib/index.mjs",
68
68
  "types": "dist/index.d.ts",
69
69
  "dependencies": {
70
- "@fluidframework/driver-definitions": ">=2.0.0-rc.1.0.3 <2.0.0-rc.1.1.0"
70
+ "@fluidframework/driver-definitions": ">=2.0.0-rc.2.0.0 <2.0.0-rc.2.1.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@arethetypeswrong/cli": "^0.13.3",
74
- "@fluid-tools/build-cli": "^0.29.0",
74
+ "@fluid-tools/build-cli": "^0.34.0",
75
75
  "@fluidframework/build-common": "^2.0.3",
76
- "@fluidframework/build-tools": "^0.29.0",
77
- "@fluidframework/eslint-config-fluid": "^3.2.0",
76
+ "@fluidframework/build-tools": "^0.34.0",
77
+ "@fluidframework/eslint-config-fluid": "^4.0.0",
78
78
  "@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-internal.8.0.0",
79
- "@fluidframework/protocol-definitions": "^3.1.0",
80
- "@microsoft/api-extractor": "^7.38.3",
79
+ "@fluidframework/protocol-definitions": "^3.2.0",
80
+ "@microsoft/api-extractor": "^7.42.3",
81
81
  "copyfiles": "^2.4.1",
82
82
  "cross-env": "^7.0.3",
83
- "eslint": "~8.50.0",
83
+ "eslint": "~8.55.0",
84
84
  "prettier": "~3.0.3",
85
85
  "rimraf": "^4.4.0",
86
- "tsc-multi": "^1.1.0",
87
86
  "typescript": "~5.1.6"
88
87
  },
89
88
  "fluidBuild": {
@@ -99,18 +98,29 @@
99
98
  }
100
99
  },
101
100
  "typeValidation": {
102
- "broken": {}
101
+ "broken": {
102
+ "RemovedEnumDeclaration_OdspErrorType": {
103
+ "forwardCompat": false,
104
+ "backCompat": false
105
+ },
106
+ "RemovedEnumDeclaration_ShareLinkTypes": {
107
+ "backCompat": false,
108
+ "forwardCompat": false
109
+ }
110
+ }
103
111
  },
104
112
  "scripts": {
105
113
  "api": "fluid-build . --task api",
106
- "api-extractor:commonjs": "api-extractor run --local",
107
- "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
114
+ "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
115
+ "api-extractor:esnext": "api-extractor run --local",
108
116
  "build": "fluid-build . --task build",
109
117
  "build:commonjs": "fluid-build . --task commonjs",
110
118
  "build:compile": "fluid-build . --task compile",
111
119
  "build:docs": "fluid-build . --task api",
112
- "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
113
- "build:test": "tsc --project ./src/test/tsconfig.json",
120
+ "build:esnext": "tsc --project ./tsconfig.json",
121
+ "build:test": "npm run build:test:cjs && npm run build:test:esm",
122
+ "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
123
+ "build:test:esm": "tsc --project ./src/test/tsconfig.json",
114
124
  "check:are-the-types-wrong": "attw --pack . --entrypoints .",
115
125
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
116
126
  "ci:build:docs": "api-extractor run",
@@ -122,7 +132,7 @@
122
132
  "lint:fix": "npm run prettier:fix && npm run eslint:fix",
123
133
  "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
124
134
  "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
125
- "tsc": "tsc",
135
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
126
136
  "typetests:gen": "fluid-type-test-generator",
127
137
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
128
138
  }
package/src/errors.ts CHANGED
@@ -66,69 +66,6 @@ export const OdspErrorTypes = {
66
66
  */
67
67
  export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
68
68
 
69
- /**
70
- * ODSP Error types.
71
- * Different error types that may be thrown by the ODSP driver.
72
- *
73
- * @deprecated Use {@link (OdspErrorTypes:variable)} instead.
74
- * @alpha
75
- */
76
- export enum OdspErrorType {
77
- /**
78
- * Storage is out of space
79
- */
80
- outOfStorageError = "outOfStorageError",
81
-
82
- /**
83
- * Invalid file name (at creation of the file)
84
- */
85
- invalidFileNameError = "invalidFileNameError",
86
-
87
- /**
88
- * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
89
- * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
90
- * such case.
91
- */
92
- snapshotTooBig = "snapshotTooBig",
93
-
94
- /**
95
- * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
96
- * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
97
- * such case.
98
- */
99
- fetchTimeout = "fetchTimeout",
100
-
101
- /**
102
- * SPO admin toggle: fluid service is not enabled.
103
- */
104
- fluidNotEnabled = "fluidNotEnabled",
105
-
106
- /**
107
- * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
108
- */
109
- fetchTokenError = "fetchTokenError",
110
-
111
- /**
112
- * This error will be raised when client is too behind with no way to catch up.
113
- * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
114
- * by storage, and thus removing an ability for client to catch up.
115
- * This condition will result in any local changes being lost (i.e. only way to save state is by user
116
- * copying it over manually)
117
- */
118
- cannotCatchUp = "cannotCatchUp",
119
-
120
- /**
121
- * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
122
- * So to preserve integrity of the data, the data becomes readonly.
123
- */
124
- serviceReadOnly = "serviceReadOnly",
125
-
126
- /**
127
- * Due to organizational policies, you can't access server resources from the current network location.
128
- */
129
- blockedIPAddress = "blockedIPAddress",
130
- }
131
-
132
69
  /**
133
70
  * @alpha
134
71
  */
@@ -157,7 +94,7 @@ export interface IOdspErrorAugmentations {
157
94
  * @alpha
158
95
  */
159
96
  export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
160
- readonly errorType: OdspErrorType;
97
+ readonly errorType: OdspErrorTypes;
161
98
  }
162
99
 
163
100
  /**
package/src/factory.ts CHANGED
@@ -10,9 +10,12 @@ export interface ISnapshotOptions {
10
10
  blobs?: number;
11
11
  deltas?: number;
12
12
  channels?: number;
13
- /*
13
+
14
+ /**
14
15
  * Maximum Data size (in bytes)
15
- * If specified, SPO will fail snapshot request with 413 error (see OdspErrorType.snapshotTooBig)
16
+ *
17
+ * @remarks
18
+ * If specified, SPO will fail snapshot request with 413 error (see {@link @fluidframework/odsp-driver-definitions#(OdspErrorTypes:variable).snapshotTooBig})
16
19
  * if snapshot is bigger in size than specified limit.
17
20
  */
18
21
  mds?: number;
package/src/index.ts CHANGED
@@ -3,38 +3,32 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export {
7
- IOdspError,
8
- IOdspErrorAugmentations,
9
- OdspError,
10
- OdspErrorType,
11
- OdspErrorTypes,
12
- } from "./errors";
6
+ export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorTypes } from "./errors.js";
13
7
  export {
14
8
  HostStoragePolicy,
15
9
  ICollabSessionOptions,
16
10
  IOpsCachingPolicy,
17
11
  ISnapshotOptions,
18
- } from "./factory";
12
+ } from "./factory.js";
19
13
  export {
20
14
  CacheContentType,
15
+ maximumCacheDurationMs,
21
16
  getKeyForCacheEntry,
22
17
  ICacheEntry,
23
18
  IEntry,
24
19
  IFileEntry,
25
20
  IPersistedCache,
26
21
  snapshotKey,
27
- } from "./odspCache";
22
+ } from "./odspCache.js";
28
23
  export {
29
24
  IOdspResolvedUrl,
30
25
  IOdspUrlParts,
31
26
  ISharingLink,
32
27
  ISharingLinkKind,
33
28
  ShareLinkInfoType,
34
- ShareLinkTypes,
35
29
  SharingLinkRole,
36
30
  SharingLinkScope,
37
- } from "./resolvedUrl";
31
+ } from "./resolvedUrl.js";
38
32
  export {
39
33
  IdentityType,
40
34
  InstrumentedStorageTokenFetcher,
@@ -44,9 +38,9 @@ export {
44
38
  TokenFetchOptions,
45
39
  tokenFromResponse,
46
40
  TokenResponse,
47
- } from "./tokenFetch";
41
+ } from "./tokenFetch.js";
48
42
  export {
49
43
  IProvideSessionAwareDriverFactory,
50
44
  IRelaySessionAwareDriverFactory,
51
45
  ISocketStorageDiscovery,
52
- } from "./sessionProvider";
46
+ } from "./sessionProvider.js";
package/src/odspCache.ts CHANGED
@@ -3,7 +3,17 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IResolvedUrl } from "@fluidframework/driver-definitions";
6
+ import { IResolvedUrl, type FiveDaysMs } from "@fluidframework/driver-definitions";
7
+
8
+ /**
9
+ * Must be less than IDocumentStorageServicePolicies.maximumCacheDurationMs policy of 5 days.
10
+ * That policy is the outward expression and this value is the implementation - using a larger value
11
+ * would violate that statement of the driver's behavior.
12
+ * Other parts of the system (such as Garbage Collection) depend on that policy being properly implemented.
13
+ *
14
+ * @internal
15
+ */
16
+ export const maximumCacheDurationMs: FiveDaysMs = 432_000_000; // 5 days in ms
7
17
 
8
18
  /**
9
19
  * Describes what kind of content is stored in cache entry.
@@ -14,15 +14,6 @@ export interface IOdspUrlParts {
14
14
  itemId: string;
15
15
  }
16
16
 
17
- /**
18
- * @deprecated Use ISharingLinkKind type instead.
19
- * Type of shareLink requested/created when creating the file for the first time.
20
- * @alpha
21
- */
22
- export enum ShareLinkTypes {
23
- csl = "csl",
24
- }
25
-
26
17
  /**
27
18
  * Sharing scope of the share links created for a file.
28
19
  * @alpha
@@ -80,18 +71,10 @@ export interface ShareLinkInfoType {
80
71
  * from the /snapshot api response.
81
72
  */
82
73
  createLink?: {
83
- /**
84
- * @deprecated
85
- * Type of shareLink requested/created when creating the file for the first time. The 'type' property here
86
- * represents the type of sharing link requested.
87
- * Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
88
- */
89
- type?: ShareLinkTypes | ISharingLinkKind;
90
-
91
74
  /**
92
75
  * Share link created when the file is created for the first time with /snapshot api call.
93
76
  */
94
- link?: string | ISharingLink;
77
+ link?: ISharingLink;
95
78
 
96
79
  /**
97
80
  * Error message if creation of sharing link fails with /snapshot api call
@@ -38,6 +38,13 @@ export interface ISocketStorageDiscovery {
38
38
  * This is the time within which client has to refresh the session on (ODSP) relay service.
39
39
  */
40
40
  refreshSessionDurationSeconds?: number;
41
+
42
+ /**
43
+ * Represent the sensitivity labels info for the file. Keeping it optional for back-compat. The
44
+ * response will contain empty labels when the file has no labels, so this field will be there
45
+ * even if file has no labels when the service will implement this contract.
46
+ */
47
+ sensitivityLabelsInfo?: string;
41
48
  }
42
49
 
43
50
  /**
package/src/tokenFetch.ts CHANGED
@@ -11,7 +11,10 @@ export interface TokenResponse {
11
11
  /** Token value */
12
12
  token: string;
13
13
 
14
- /** Flag indicating whether token was obtained from local cache */
14
+ /**
15
+ * Whether or not the token was obtained from local cache.
16
+ * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.
17
+ */
15
18
  fromCache?: boolean;
16
19
  }
17
20
 
@@ -0,0 +1,7 @@
1
+ {
2
+ // This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.)
3
+ "extends": "./tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "./dist",
6
+ },
7
+ }
package/tsconfig.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
- "extends": [
3
- "../../../common/build/build-common/tsconfig.base.json",
4
- "../../../common/build/build-common/tsconfig.cjs.json",
5
- ],
2
+ "extends": "../../../common/build/build-common/tsconfig.node16.json",
6
3
  "include": ["src/**/*"],
7
4
  "exclude": ["src/test/**/*"],
8
5
  "compilerOptions": {
9
6
  "rootDir": "./src",
10
- "outDir": "./dist",
7
+ "outDir": "./lib",
11
8
  },
12
9
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"OAIO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,oBAAY,aAAa;IACxB;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;;;OAIG;IACH,cAAc,mBAAmB;IAEjC;;;;OAIG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;;;;;OAMG;IACH,aAAa,kBAAkB;IAE/B;;;OAGG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,gBAAgB,qBAAqB;CACrC;AAED;;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,aAAa,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
package/lib/errors.mjs DELETED
@@ -1,103 +0,0 @@
1
- import { DriverErrorTypes, } from "@fluidframework/driver-definitions";
2
- /**
3
- * ODSP Error types.
4
- * Different error types that may be thrown by the ODSP driver.
5
- * @alpha
6
- */
7
- export const OdspErrorTypes = {
8
- // Inherit base driver error types
9
- ...DriverErrorTypes,
10
- /**
11
- * Invalid file name (at creation of the file)
12
- */
13
- invalidFileNameError: "invalidFileNameError",
14
- /**
15
- * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
16
- * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
17
- * such case.
18
- */
19
- snapshotTooBig: "snapshotTooBig",
20
- /**
21
- * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
22
- * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
23
- * such case.
24
- */
25
- fetchTimeout: "fetchTimeout",
26
- /**
27
- * SPO admin toggle: fluid service is not enabled.
28
- */
29
- fluidNotEnabled: "fluidNotEnabled",
30
- /**
31
- * This error will be raised when client is too behind with no way to catch up.
32
- * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
33
- * by storage, and thus removing an ability for client to catch up.
34
- * This condition will result in any local changes being lost (i.e. only way to save state is by user
35
- * copying it over manually)
36
- */
37
- cannotCatchUp: "cannotCatchUp",
38
- /**
39
- * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
40
- * So to preserve integrity of the data, the data becomes readonly.
41
- */
42
- serviceReadOnly: "serviceReadOnly",
43
- /**
44
- * Due to organizational policies, you can't access server resources from the current network location.
45
- */
46
- blockedIPAddress: "blockedIPAddress",
47
- };
48
- /**
49
- * ODSP Error types.
50
- * Different error types that may be thrown by the ODSP driver.
51
- *
52
- * @deprecated Use {@link (OdspErrorTypes:variable)} instead.
53
- * @alpha
54
- */
55
- export var OdspErrorType;
56
- (function (OdspErrorType) {
57
- /**
58
- * Storage is out of space
59
- */
60
- OdspErrorType["outOfStorageError"] = "outOfStorageError";
61
- /**
62
- * Invalid file name (at creation of the file)
63
- */
64
- OdspErrorType["invalidFileNameError"] = "invalidFileNameError";
65
- /**
66
- * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
67
- * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
68
- * such case.
69
- */
70
- OdspErrorType["snapshotTooBig"] = "snapshotTooBig";
71
- /**
72
- * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
73
- * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
74
- * such case.
75
- */
76
- OdspErrorType["fetchTimeout"] = "fetchTimeout";
77
- /**
78
- * SPO admin toggle: fluid service is not enabled.
79
- */
80
- OdspErrorType["fluidNotEnabled"] = "fluidNotEnabled";
81
- /**
82
- * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
83
- */
84
- OdspErrorType["fetchTokenError"] = "fetchTokenError";
85
- /**
86
- * This error will be raised when client is too behind with no way to catch up.
87
- * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
88
- * by storage, and thus removing an ability for client to catch up.
89
- * This condition will result in any local changes being lost (i.e. only way to save state is by user
90
- * copying it over manually)
91
- */
92
- OdspErrorType["cannotCatchUp"] = "cannotCatchUp";
93
- /**
94
- * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
95
- * So to preserve integrity of the data, the data becomes readonly.
96
- */
97
- OdspErrorType["serviceReadOnly"] = "serviceReadOnly";
98
- /**
99
- * Due to organizational policies, you can't access server resources from the current network location.
100
- */
101
- OdspErrorType["blockedIPAddress"] = "blockedIPAddress";
102
- })(OdspErrorType || (OdspErrorType = {}));
103
- //# sourceMappingURL=errors.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.mjs","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"OAIO,EAGN,gBAAgB,GAChB,MAAM,oCAAoC;AAE3C;;;;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;AAMX;;;;;;GAMG;AACH,MAAM,CAAN,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,KAAb,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"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.mts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,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;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC;;;;;;;;;OASG;IACH,sCAAsC,CAAC,EAAE,OAAO,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,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;;;;;;;;;OASG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;;;;OAOG;IACH,yCAAyC,CAAC,EAAE,OAAO,CAAC;IAEpD;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACrC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.mjs","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"]}