@fluidframework/odsp-driver-definitions 2.0.0-internal.3.0.1 → 2.0.0-internal.3.1.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 (59) hide show
  1. package/.eslintrc.js +6 -9
  2. package/api-extractor.json +2 -2
  3. package/dist/errors.d.ts +23 -0
  4. package/dist/errors.d.ts.map +1 -1
  5. package/dist/errors.js +19 -11
  6. package/dist/errors.js.map +1 -1
  7. package/dist/factory.d.ts.map +1 -1
  8. package/dist/factory.js.map +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/odspCache.d.ts +1 -1
  13. package/dist/odspCache.d.ts.map +1 -1
  14. package/dist/odspCache.js.map +1 -1
  15. package/dist/packageVersion.d.ts +1 -1
  16. package/dist/packageVersion.js +1 -1
  17. package/dist/packageVersion.js.map +1 -1
  18. package/dist/resolvedUrl.d.ts +4 -4
  19. package/dist/resolvedUrl.d.ts.map +1 -1
  20. package/dist/resolvedUrl.js +2 -2
  21. package/dist/resolvedUrl.js.map +1 -1
  22. package/dist/tokenFetch.d.ts.map +1 -1
  23. package/dist/tokenFetch.js +3 -1
  24. package/dist/tokenFetch.js.map +1 -1
  25. package/lib/errors.d.ts +23 -0
  26. package/lib/errors.d.ts.map +1 -1
  27. package/lib/errors.js +19 -11
  28. package/lib/errors.js.map +1 -1
  29. package/lib/factory.d.ts.map +1 -1
  30. package/lib/factory.js.map +1 -1
  31. package/lib/index.d.ts +2 -2
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/odspCache.d.ts +1 -1
  36. package/lib/odspCache.d.ts.map +1 -1
  37. package/lib/odspCache.js.map +1 -1
  38. package/lib/packageVersion.d.ts +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/lib/resolvedUrl.d.ts +4 -4
  42. package/lib/resolvedUrl.d.ts.map +1 -1
  43. package/lib/resolvedUrl.js +2 -2
  44. package/lib/resolvedUrl.js.map +1 -1
  45. package/lib/tokenFetch.d.ts.map +1 -1
  46. package/lib/tokenFetch.js +3 -1
  47. package/lib/tokenFetch.js.map +1 -1
  48. package/package.json +69 -64
  49. package/prettier.config.cjs +1 -1
  50. package/src/errors.ts +57 -49
  51. package/src/factory.ts +128 -128
  52. package/src/index.ts +14 -2
  53. package/src/odspCache.ts +50 -50
  54. package/src/packageVersion.ts +1 -1
  55. package/src/resolvedUrl.ts +85 -87
  56. package/src/tokenFetch.ts +44 -37
  57. package/tsconfig.esnext.json +6 -6
  58. package/tsconfig.json +9 -13
  59. package/.editorconfig +0 -7
package/src/factory.ts CHANGED
@@ -4,141 +4,141 @@
4
4
  */
5
5
 
6
6
  export interface ISnapshotOptions {
7
- blobs?: number;
8
- deltas?: number;
9
- channels?: number;
10
- /*
11
- * Maximum Data size (in bytes)
12
- * If specified, SPO will fail snapshot request with 413 error (see OdspErrorType.snapshotTooBig)
13
- * if snapshot is bigger in size than specified limit.
14
- */
15
- mds?: number;
16
-
17
- /*
18
- * Maximum time limit to fetch snapshot (in seconds)
19
- * If specified, client will timeout the fetch request if it exceeds the time limit and
20
- * will try to fetch the snapshot without blobs.
21
- */
22
- timeout?: number;
7
+ blobs?: number;
8
+ deltas?: number;
9
+ channels?: number;
10
+ /*
11
+ * Maximum Data size (in bytes)
12
+ * If specified, SPO will fail snapshot request with 413 error (see OdspErrorType.snapshotTooBig)
13
+ * if snapshot is bigger in size than specified limit.
14
+ */
15
+ mds?: number;
16
+
17
+ /*
18
+ * Maximum time limit to fetch snapshot (in seconds)
19
+ * If specified, client will timeout the fetch request if it exceeds the time limit and
20
+ * will try to fetch the snapshot without blobs.
21
+ */
22
+ timeout?: number;
23
23
  }
24
24
 
25
25
  export interface IOpsCachingPolicy {
26
- /**
27
- * Batch size. Controls how many ops are grouped together as single cache entry
28
- * The bigger the number, the more efficient it is (less reads & writes)
29
- * At the same time, big number means we wait for so many ops to accumulate, which
30
- * increases chances and number of trailing ops that would not be flushed to cache
31
- * when user closes tab
32
- * Use any number below 1 to disable caching
33
- * Default: 100
34
- */
35
- batchSize?: number;
36
-
37
- /**
38
- * To reduce the problem of losing trailing ops when using big batch sizes, host
39
- * could specify how often driver should flush ops it has not flushed yet.
40
- * -1 means do not use timer.
41
- * Measured in ms.
42
- * Default: 5000
43
- */
44
- timerGranularity?: number;
45
-
46
- /**
47
- * Total number of ops to cache. When we reach that number, ops caching stops
48
- * Default: 5000
49
- */
50
- totalOpsToCache?: number;
26
+ /**
27
+ * Batch size. Controls how many ops are grouped together as single cache entry
28
+ * The bigger the number, the more efficient it is (less reads & writes)
29
+ * At the same time, big number means we wait for so many ops to accumulate, which
30
+ * increases chances and number of trailing ops that would not be flushed to cache
31
+ * when user closes tab
32
+ * Use any number below 1 to disable caching
33
+ * Default: 100
34
+ */
35
+ batchSize?: number;
36
+
37
+ /**
38
+ * To reduce the problem of losing trailing ops when using big batch sizes, host
39
+ * could specify how often driver should flush ops it has not flushed yet.
40
+ * -1 means do not use timer.
41
+ * Measured in ms.
42
+ * Default: 5000
43
+ */
44
+ timerGranularity?: number;
45
+
46
+ /**
47
+ * Total number of ops to cache. When we reach that number, ops caching stops
48
+ * Default: 5000
49
+ */
50
+ totalOpsToCache?: number;
51
51
  }
52
52
 
53
53
  export interface ICollabSessionOptions {
54
- /**
55
- * Value indicating the display name for session that admits unauthenticated user.
56
- * This name will be used in attribution associated with edits made by such user.
57
- */
58
- unauthenticatedUserDisplayName?: string;
59
- /**
60
- * @deprecated Due to security reasons we will be passing the token via Authorization header only.
61
- * Value indicating session preference to always pass access token via Authorization header.
62
- * Default behavior is to pass access token via query parameter unless overall href string
63
- * length exceeds 2048 characters. Using query param is performance optimization which results
64
- * in ODSP XHR request being treated as 'simple' request which do not require OPTIONS call to
65
- * validate CORS. However, not all ODSP implementations understand this optimization.
66
- * For instance, auth layer on Converged stack will fail request with access token passed via
67
- * query param.
68
- */
69
- forceAccessTokenViaAuthorizationHeader?: boolean;
54
+ /**
55
+ * Value indicating the display name for session that admits unauthenticated user.
56
+ * This name will be used in attribution associated with edits made by such user.
57
+ */
58
+ unauthenticatedUserDisplayName?: string;
59
+ /**
60
+ * @deprecated Due to security reasons we will be passing the token via Authorization header only.
61
+ * Value indicating session preference to always pass access token via Authorization header.
62
+ * Default behavior is to pass access token via query parameter unless overall href string
63
+ * length exceeds 2048 characters. Using query param is performance optimization which results
64
+ * in ODSP XHR request being treated as 'simple' request which do not require OPTIONS call to
65
+ * validate CORS. However, not all ODSP implementations understand this optimization.
66
+ * For instance, auth layer on Converged stack will fail request with access token passed via
67
+ * query param.
68
+ */
69
+ forceAccessTokenViaAuthorizationHeader?: boolean;
70
70
  }
71
71
 
72
72
  export interface HostStoragePolicy {
73
- snapshotOptions?: ISnapshotOptions;
74
-
75
- /**
76
- * If set to true, tells driver to concurrently fetch snapshot from storage (SPO) and cache
77
- * Container loads from whatever comes first in such case.
78
- * Snapshot fetched from storage is pushed to cache in either case.
79
- * If set to false, driver will first consult with cache. Only on cache miss (cache does not
80
- * return snapshot), driver will fetch snapshot from storage (and push it to cache), otherwise
81
- * it will load from cache and not reach out to storage.
82
- * Passing true results in faster loads and keeping cache more current, but it increases bandwidth consumption.
83
- */
84
- concurrentSnapshotFetch?: boolean;
85
-
86
- // Options overwriting default ops fetching from storage.
87
- opsBatchSize?: number;
88
- concurrentOpsBatches?: number;
89
-
90
- /**
91
- * Policy controlling ops caching (leveraging IPersistedCache passed to driver factory)
92
- */
93
- opsCaching?: IOpsCachingPolicy;
94
-
95
- /**
96
- * Policy controlling how collaboration session is established
97
- */
98
- sessionOptions?: ICollabSessionOptions;
99
-
100
- /**
101
- * @deprecated This field will be always set to true after removal.
102
- * True to have the sharing link redeem fallback in case the Trees Latest/Redeem 1RT call fails with redeem error.
103
- * During fallback it will first redeem the sharing link and then make the Trees latest call.
104
- */
105
- enableRedeemFallback?: boolean;
106
-
107
- /**
108
- * Policy controlling if we will cache initial summary when we create a document
109
- */
110
- cacheCreateNewSummary?: boolean;
111
-
112
- /**
113
- * @deprecated This will be replaced with feature gate snapshotFormatFetchType.
114
- * Policy controlling if we want to fetch binary format snapshot.
115
- */
116
- fetchBinarySnapshotFormat?: boolean;
117
-
118
- /**
119
- * If set to true, socket cache are per OdspDocumentService instead of shared across all instances
120
- */
121
- isolateSocketCache?: boolean;
122
-
123
- /**
124
- * @deprecated Switch to using the new feature gated by enableSingleRequestForShareLinkWithCreate
125
- * with 'createLinkScope' and 'createLinkRole' is requested to the odsp apis instead of 'createLinkType'.
126
- * It enables the creation of sharing link along with the creation of file by setting this value to true.
127
- * If the host provides a 'createLinkType' parameter in the request URL to the container.attach()
128
- * method, we will send the request to ODSP with the same (if the flag is enabled) so
129
- * that a share link can be created with the creation of file to save number for round trips made to ODSP.
130
- * (This flag works independently of enableSingleRequestForShareLinkWithCreate which is used for sharing link
131
- * requests where 'createLinkScope' is requested.)
132
- */
133
- enableShareLinkWithCreate?: boolean;
134
-
135
- /**
136
- * Enable creation of sharing link along with the creation of file by setting this value to true.
137
- * If the host provides a 'createLinkScope' parameter in the request URL to the container.attach()
138
- * method, we will send the request to ODSP with the same (if the flag is enabled) so
139
- * that a share link can be created with the creation of file to save number for round trips made to ODSP.
140
- * (This flag works independently of enableShareLinkWithCreate which was used for old sharing link requests
141
- * where 'createLinkType' was requested.)
142
- */
143
- enableSingleRequestForShareLinkWithCreate?: boolean;
73
+ snapshotOptions?: ISnapshotOptions;
74
+
75
+ /**
76
+ * If set to true, tells driver to concurrently fetch snapshot from storage (SPO) and cache
77
+ * Container loads from whatever comes first in such case.
78
+ * Snapshot fetched from storage is pushed to cache in either case.
79
+ * If set to false, driver will first consult with cache. Only on cache miss (cache does not
80
+ * return snapshot), driver will fetch snapshot from storage (and push it to cache), otherwise
81
+ * it will load from cache and not reach out to storage.
82
+ * Passing true results in faster loads and keeping cache more current, but it increases bandwidth consumption.
83
+ */
84
+ concurrentSnapshotFetch?: boolean;
85
+
86
+ // Options overwriting default ops fetching from storage.
87
+ opsBatchSize?: number;
88
+ concurrentOpsBatches?: number;
89
+
90
+ /**
91
+ * Policy controlling ops caching (leveraging IPersistedCache passed to driver factory)
92
+ */
93
+ opsCaching?: IOpsCachingPolicy;
94
+
95
+ /**
96
+ * Policy controlling how collaboration session is established
97
+ */
98
+ sessionOptions?: ICollabSessionOptions;
99
+
100
+ /**
101
+ * @deprecated This field will be always set to true after removal.
102
+ * True to have the sharing link redeem fallback in case the Trees Latest/Redeem 1RT call fails with redeem error.
103
+ * During fallback it will first redeem the sharing link and then make the Trees latest call.
104
+ */
105
+ enableRedeemFallback?: boolean;
106
+
107
+ /**
108
+ * Policy controlling if we will cache initial summary when we create a document
109
+ */
110
+ cacheCreateNewSummary?: boolean;
111
+
112
+ /**
113
+ * @deprecated This will be replaced with feature gate snapshotFormatFetchType.
114
+ * Policy controlling if we want to fetch binary format snapshot.
115
+ */
116
+ fetchBinarySnapshotFormat?: boolean;
117
+
118
+ /**
119
+ * If set to true, socket cache are per OdspDocumentService instead of shared across all instances
120
+ */
121
+ isolateSocketCache?: boolean;
122
+
123
+ /**
124
+ * @deprecated Switch to using the new feature gated by enableSingleRequestForShareLinkWithCreate
125
+ * with 'createLinkScope' and 'createLinkRole' is requested to the odsp apis instead of 'createLinkType'.
126
+ * It enables the creation of sharing link along with the creation of file by setting this value to true.
127
+ * If the host provides a 'createLinkType' parameter in the request URL to the container.attach()
128
+ * method, we will send the request to ODSP with the same (if the flag is enabled) so
129
+ * that a share link can be created with the creation of file to save number for round trips made to ODSP.
130
+ * (This flag works independently of enableSingleRequestForShareLinkWithCreate which is used for sharing link
131
+ * requests where 'createLinkScope' is requested.)
132
+ */
133
+ enableShareLinkWithCreate?: boolean;
134
+
135
+ /**
136
+ * Enable creation of sharing link along with the creation of file by setting this value to true.
137
+ * If the host provides a 'createLinkScope' parameter in the request URL to the container.attach()
138
+ * method, we will send the request to ODSP with the same (if the flag is enabled) so
139
+ * that a share link can be created with the creation of file to save number for round trips made to ODSP.
140
+ * (This flag works independently of enableShareLinkWithCreate which was used for old sharing link requests
141
+ * where 'createLinkType' was requested.)
142
+ */
143
+ enableSingleRequestForShareLinkWithCreate?: boolean;
144
144
  }
package/src/index.ts CHANGED
@@ -4,8 +4,20 @@
4
4
  */
5
5
 
6
6
  export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorType } from "./errors";
7
- export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions } from "./factory";
8
- export { CacheContentType, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey } from "./odspCache";
7
+ export {
8
+ HostStoragePolicy,
9
+ ICollabSessionOptions,
10
+ IOpsCachingPolicy,
11
+ ISnapshotOptions,
12
+ } from "./factory";
13
+ export {
14
+ CacheContentType,
15
+ ICacheEntry,
16
+ IEntry,
17
+ IFileEntry,
18
+ IPersistedCache,
19
+ snapshotKey,
20
+ } from "./odspCache";
9
21
  export {
10
22
  IOdspResolvedUrl,
11
23
  IOdspUrlParts,
package/src/odspCache.ts CHANGED
@@ -17,50 +17,50 @@ export type CacheContentType = "snapshot" | "ops";
17
17
  * to implement storage / identify files.
18
18
  */
19
19
  export interface IFileEntry {
20
- /**
21
- * Unique and stable ID of the document.
22
- * Driver guarantees that docId is stable ID uniquely identifying document.
23
- */
24
- docId: string;
25
- /**
26
- * Resolved URI is provided for additional versatility - host can use it to
27
- * identify file in storage, and (as example) delete all cached entries for
28
- * a file if user requests so.
29
- * This is IOdspResolvedUrl in case of ODSP driver.
30
- */
31
- resolvedUrl: IFluidResolvedUrl;
20
+ /**
21
+ * Unique and stable ID of the document.
22
+ * Driver guarantees that docId is stable ID uniquely identifying document.
23
+ */
24
+ docId: string;
25
+ /**
26
+ * Resolved URI is provided for additional versatility - host can use it to
27
+ * identify file in storage, and (as example) delete all cached entries for
28
+ * a file if user requests so.
29
+ * This is IOdspResolvedUrl in case of ODSP driver.
30
+ */
31
+ resolvedUrl: IFluidResolvedUrl;
32
32
  }
33
33
 
34
34
  /**
35
35
  * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
36
36
  */
37
- export interface IEntry {
38
- /**
39
- * Identifies type of entry for a given file.
40
- * Each file can have multiple types of entries associated with it.
41
- * For example, it can be snapshot, blob, ops, etc.
42
- */
43
- type: CacheContentType;
37
+ export interface IEntry {
38
+ /**
39
+ * Identifies type of entry for a given file.
40
+ * Each file can have multiple types of entries associated with it.
41
+ * For example, it can be snapshot, blob, ops, etc.
42
+ */
43
+ type: CacheContentType;
44
44
 
45
- /**
46
- * Identifies individual entry for a given file and type.
47
- * Each file can have multiple cache entries associated with it.
48
- * This property identifies a particular instance of entry.
49
- * For example, for blobs it will be unique ID of the blob in a file.
50
- * For batch of ops, it can be starting op sequence number.
51
- * For types that have only one entry (like snapshots), it will be empty string.
52
- */
53
- key: string;
45
+ /**
46
+ * Identifies individual entry for a given file and type.
47
+ * Each file can have multiple cache entries associated with it.
48
+ * This property identifies a particular instance of entry.
49
+ * For example, for blobs it will be unique ID of the blob in a file.
50
+ * For batch of ops, it can be starting op sequence number.
51
+ * For types that have only one entry (like snapshots), it will be empty string.
52
+ */
53
+ key: string;
54
54
  }
55
55
 
56
56
  /**
57
57
  * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
58
58
  */
59
59
  export interface ICacheEntry extends IEntry {
60
- /**
61
- * Identifies file in storage this cached entry is for
62
- */
63
- file: IFileEntry;
60
+ /**
61
+ * Identifies file in storage this cached entry is for
62
+ */
63
+ file: IFileEntry;
64
64
  }
65
65
 
66
66
  /**
@@ -71,24 +71,24 @@ export interface ICacheEntry extends IEntry {
71
71
  * information.
72
72
  */
73
73
  export interface IPersistedCache {
74
- /**
75
- * Get the cache value of the key
76
- * @param entry - cache entry, identifies file and particular key for this file.
77
- * @returns Cached value. undefined if nothing is cached.
78
- */
79
- get(entry: ICacheEntry): Promise<any>;
74
+ /**
75
+ * Get the cache value of the key
76
+ * @param entry - cache entry, identifies file and particular key for this file.
77
+ * @returns Cached value. undefined if nothing is cached.
78
+ */
79
+ get(entry: ICacheEntry): Promise<any>;
80
80
 
81
- /**
82
- * Put the value into cache.
83
- * Important - only serializable content is allowed since this cache may be persisted between sessions
84
- * @param entry - cache entry.
85
- * @param value - JSON-serializable content.
86
- */
87
- put(entry: ICacheEntry, value: any): Promise<void>;
81
+ /**
82
+ * Put the value into cache.
83
+ * Important - only serializable content is allowed since this cache may be persisted between sessions
84
+ * @param entry - cache entry.
85
+ * @param value - JSON-serializable content.
86
+ */
87
+ put(entry: ICacheEntry, value: any): Promise<void>;
88
88
 
89
- /**
90
- * Removes the entries from the cache for given parametres.
91
- * @param file - file entry to be deleted.
92
- */
93
- removeEntries(file: IFileEntry): Promise<void>;
89
+ /**
90
+ * Removes the entries from the cache for given parametres.
91
+ * @param file - file entry to be deleted.
92
+ */
93
+ removeEntries(file: IFileEntry): Promise<void>;
94
94
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/odsp-driver-definitions";
9
- export const pkgVersion = "2.0.0-internal.3.0.1";
9
+ export const pkgVersion = "2.0.0-internal.3.1.0";
@@ -6,55 +6,55 @@
6
6
  import { IFluidResolvedUrl } from "@fluidframework/driver-definitions";
7
7
 
8
8
  export interface IOdspUrlParts {
9
- siteUrl: string;
10
- driveId: string;
11
- itemId: string;
9
+ siteUrl: string;
10
+ driveId: string;
11
+ itemId: string;
12
12
  }
13
13
 
14
14
  /**
15
15
  * @deprecated Use ISharingLinkKind type instead.
16
16
  * Type of shareLink requested/created when creating the file for the first time.
17
- */
17
+ */
18
18
  export enum ShareLinkTypes {
19
- csl = "csl",
19
+ csl = "csl",
20
20
  }
21
21
 
22
22
  /**
23
23
  * Sharing scope of the share links created for a file.
24
- */
24
+ */
25
25
  export enum SharingLinkScope {
26
- organization = "organization",
27
- users = "users",
28
- anonymous = "anonymous",
29
- default = "default",
26
+ organization = "organization",
27
+ users = "users",
28
+ anonymous = "anonymous",
29
+ default = "default",
30
30
  }
31
31
 
32
32
  /**
33
33
  * View/edit permission role for a sharing link.
34
34
  */
35
35
  export enum SharingLinkRole {
36
- view = "view",
37
- edit = "edit",
36
+ view = "view",
37
+ edit = "edit",
38
38
  }
39
39
 
40
40
  /**
41
41
  * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
42
42
  * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
43
- */
43
+ */
44
44
  export interface ISharingLinkKind {
45
- scope: SharingLinkScope;
46
- /*
47
- * If this parameter is not provided, the API will default to "edit" links (provided
48
- * a valid createLinkScope setting is given).
49
- */
50
- role?: SharingLinkRole;
45
+ scope: SharingLinkScope;
46
+ /*
47
+ * If this parameter is not provided, the API will default to "edit" links (provided
48
+ * a valid createLinkScope setting is given).
49
+ */
50
+ role?: SharingLinkRole;
51
51
  }
52
52
 
53
53
  /**
54
54
  * Sharing link data received from the /snapshot api response.
55
55
  */
56
56
  export interface ISharingLink extends ISharingLinkKind {
57
- webUrl: string;
57
+ webUrl: string;
58
58
  }
59
59
 
60
60
  /**
@@ -63,84 +63,82 @@ export interface ISharingLink extends ISharingLinkKind {
63
63
  * a redeemable share link created when loading an existing file
64
64
  */
65
65
  export interface ShareLinkInfoType {
66
-
67
- /**
68
- * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to
69
- * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature
70
- * where we can create a share link along with creating a file by passing a query parameter called
71
- * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information
72
- * from the /snapshot api response.
73
- */
74
- createLink?: {
75
- /**
76
- * @deprecated
77
- * Type of shareLink requested/created when creating the file for the first time. The 'type' property here
78
- * represents the type of sharing link requested.
79
- * Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
80
- */
81
- type?: ShareLinkTypes | ISharingLinkKind;
82
-
83
- /**
84
- * Share link created when the file is created for the first time with /snapshot api call.
85
- */
86
- link?: string | ISharingLink;
87
-
88
- /**
89
- * Error message if creation of sharing link fails with /snapshot api call
90
- */
91
- error?: any;
92
-
93
- shareId?: string;
94
-
95
- };
96
-
97
- /**
98
- * This is used to save the network calls while doing trees/latest call as if the client does not have
99
- * permission then this link can be redeemed for the permissions in the same network call.
100
- */
101
- sharingLinkToRedeem?: string;
66
+ /**
67
+ * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to
68
+ * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature
69
+ * where we can create a share link along with creating a file by passing a query parameter called
70
+ * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information
71
+ * from the /snapshot api response.
72
+ */
73
+ createLink?: {
74
+ /**
75
+ * @deprecated
76
+ * Type of shareLink requested/created when creating the file for the first time. The 'type' property here
77
+ * represents the type of sharing link requested.
78
+ * Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
79
+ */
80
+ type?: ShareLinkTypes | ISharingLinkKind;
81
+
82
+ /**
83
+ * Share link created when the file is created for the first time with /snapshot api call.
84
+ */
85
+ link?: string | ISharingLink;
86
+
87
+ /**
88
+ * Error message if creation of sharing link fails with /snapshot api call
89
+ */
90
+ error?: any;
91
+
92
+ shareId?: string;
93
+ };
94
+
95
+ /**
96
+ * This is used to save the network calls while doing trees/latest call as if the client does not have
97
+ * permission then this link can be redeemed for the permissions in the same network call.
98
+ */
99
+ sharingLinkToRedeem?: string;
102
100
  }
103
101
  export interface IOdspResolvedUrl extends IFluidResolvedUrl, IOdspUrlParts {
104
- type: "fluid";
105
- odspResolvedUrl: true;
102
+ type: "fluid";
103
+ odspResolvedUrl: true;
106
104
 
107
- // URL to send to fluid, contains the documentId and the path
108
- url: string;
105
+ // URL to send to fluid, contains the documentId and the path
106
+ url: string;
109
107
 
110
- // A hashed identifier that is unique to this document
111
- hashedDocumentId: string;
108
+ // A hashed identifier that is unique to this document
109
+ hashedDocumentId: string;
112
110
 
113
- endpoints: {
114
- snapshotStorageUrl: string;
115
- attachmentPOSTStorageUrl: string;
116
- attachmentGETStorageUrl: string;
117
- deltaStorageUrl: string;
118
- };
111
+ endpoints: {
112
+ snapshotStorageUrl: string;
113
+ attachmentPOSTStorageUrl: string;
114
+ attachmentGETStorageUrl: string;
115
+ deltaStorageUrl: string;
116
+ };
119
117
 
120
- // Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.
121
- // eslint-disable-next-line @typescript-eslint/ban-types
122
- tokens: {};
118
+ // Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.
119
+ // eslint-disable-next-line @typescript-eslint/ban-types
120
+ tokens: {};
123
121
 
124
- fileName: string;
122
+ fileName: string;
125
123
 
126
- summarizer: boolean;
124
+ summarizer: boolean;
127
125
 
128
- codeHint?: {
129
- // containerPackageName is used for adding the package name to the request headers.
130
- // This may be used for preloading the container package when loading Fluid content.
131
- containerPackageName?: string;
132
- };
126
+ codeHint?: {
127
+ // containerPackageName is used for adding the package name to the request headers.
128
+ // This may be used for preloading the container package when loading Fluid content.
129
+ containerPackageName?: string;
130
+ };
133
131
 
134
- fileVersion: string | undefined;
132
+ fileVersion: string | undefined;
135
133
 
136
- dataStorePath?: string;
134
+ dataStorePath?: string;
137
135
 
138
- /**
139
- * Sharing link data created for the ODSP item.
140
- * Contains information about either sharing link created while creating a new file or
141
- * a redeemable share link created when loading an existing file
142
- */
143
- shareLinkInfo?: ShareLinkInfoType;
136
+ /**
137
+ * Sharing link data created for the ODSP item.
138
+ * Contains information about either sharing link created while creating a new file or
139
+ * a redeemable share link created when loading an existing file
140
+ */
141
+ shareLinkInfo?: ShareLinkInfoType;
144
142
 
145
- isClpCompliantApp?: boolean;
143
+ isClpCompliantApp?: boolean;
146
144
  }