@fluidframework/odsp-driver-definitions 2.0.0-dev.7.4.0.215747 → 2.0.0-dev.7.4.0.216897
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/api-extractor-lint.json +13 -0
- package/api-extractor.json +0 -4
- package/api-report/odsp-driver-definitions.api.md +36 -36
- package/dist/errors.cjs +2 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/factory.cjs.map +1 -1
- package/dist/factory.d.ts +12 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/odsp-driver-definitions-alpha.d.ts +75 -590
- package/dist/odsp-driver-definitions-beta.d.ts +75 -590
- package/dist/odsp-driver-definitions-public.d.ts +75 -590
- package/dist/odsp-driver-definitions-untrimmed.d.ts +60 -0
- package/dist/odspCache.cjs +2 -0
- package/dist/odspCache.cjs.map +1 -1
- package/dist/odspCache.d.ts +11 -0
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/resolvedUrl.cjs +3 -0
- package/dist/resolvedUrl.cjs.map +1 -1
- package/dist/resolvedUrl.d.ts +12 -0
- package/dist/resolvedUrl.d.ts.map +1 -1
- package/dist/sessionProvider.cjs.map +1 -1
- package/dist/sessionProvider.d.ts +3 -0
- package/dist/sessionProvider.d.ts.map +1 -1
- package/dist/tokenFetch.cjs +2 -0
- package/dist/tokenFetch.cjs.map +1 -1
- package/dist/tokenFetch.d.ts +10 -0
- package/dist/tokenFetch.d.ts.map +1 -1
- package/lib/errors.d.ts +12 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.mjs +2 -0
- package/lib/errors.mjs.map +1 -1
- package/lib/factory.d.ts +12 -0
- package/lib/factory.d.ts.map +1 -1
- package/lib/factory.mjs.map +1 -1
- package/lib/odsp-driver-definitions-alpha.d.ts +75 -590
- package/lib/odsp-driver-definitions-beta.d.ts +75 -590
- package/lib/odsp-driver-definitions-public.d.ts +75 -590
- package/lib/odsp-driver-definitions-untrimmed.d.ts +60 -0
- package/lib/odspCache.d.ts +11 -0
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.mjs +2 -0
- package/lib/odspCache.mjs.map +1 -1
- package/lib/resolvedUrl.d.ts +12 -0
- package/lib/resolvedUrl.d.ts.map +1 -1
- package/lib/resolvedUrl.mjs +3 -0
- package/lib/resolvedUrl.mjs.map +1 -1
- package/lib/sessionProvider.d.ts +3 -0
- package/lib/sessionProvider.d.ts.map +1 -1
- package/lib/sessionProvider.mjs.map +1 -1
- package/lib/tokenFetch.d.ts +10 -0
- package/lib/tokenFetch.d.ts.map +1 -1
- package/lib/tokenFetch.mjs +2 -0
- package/lib/tokenFetch.mjs.map +1 -1
- package/package.json +4 -3
- package/src/errors.ts +12 -0
- package/src/factory.ts +12 -0
- package/src/odspCache.ts +11 -0
- package/src/resolvedUrl.ts +12 -0
- package/src/sessionProvider.ts +3 -0
- package/src/tokenFetch.ts +10 -0
|
@@ -2,15 +2,22 @@ import { DriverError } from '@fluidframework/driver-definitions';
|
|
|
2
2
|
import { IDriverErrorBase } from '@fluidframework/driver-definitions';
|
|
3
3
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
5
8
|
export declare type CacheContentType = "snapshot" | "ops";
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Api to generate a cache key from cache entry.
|
|
9
12
|
* @param entry - cache entry from which a cache key is generated
|
|
10
13
|
* @returns The key for cache.
|
|
14
|
+
* @internal
|
|
11
15
|
*/
|
|
12
16
|
export declare function getKeyForCacheEntry(entry: ICacheEntry): string;
|
|
13
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
14
21
|
export declare interface HostStoragePolicy {
|
|
15
22
|
snapshotOptions?: ISnapshotOptions;
|
|
16
23
|
/**
|
|
@@ -81,6 +88,7 @@ export declare interface HostStoragePolicy {
|
|
|
81
88
|
|
|
82
89
|
/**
|
|
83
90
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
91
|
+
* @internal
|
|
84
92
|
*/
|
|
85
93
|
export declare interface ICacheEntry extends IEntry {
|
|
86
94
|
/**
|
|
@@ -89,6 +97,9 @@ export declare interface ICacheEntry extends IEntry {
|
|
|
89
97
|
file: IFileEntry;
|
|
90
98
|
}
|
|
91
99
|
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
92
103
|
export declare interface ICollabSessionOptions {
|
|
93
104
|
/**
|
|
94
105
|
* Value indicating the display name for session that admits unauthenticated user.
|
|
@@ -112,11 +123,13 @@ export declare interface ICollabSessionOptions {
|
|
|
112
123
|
* Identity types supported by ODSP driver.
|
|
113
124
|
* `Consumer` represents user authenticated with Microsoft Account (MSA).
|
|
114
125
|
* `Enterprise` represents user authenticated with M365 tenant account.
|
|
126
|
+
* @internal
|
|
115
127
|
*/
|
|
116
128
|
export declare type IdentityType = "Consumer" | "Enterprise";
|
|
117
129
|
|
|
118
130
|
/**
|
|
119
131
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
132
|
+
* @internal
|
|
120
133
|
*/
|
|
121
134
|
export declare interface IEntry {
|
|
122
135
|
/**
|
|
@@ -136,6 +149,9 @@ export declare interface IEntry {
|
|
|
136
149
|
key: string;
|
|
137
150
|
}
|
|
138
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
139
155
|
export declare interface IFileEntry {
|
|
140
156
|
/**
|
|
141
157
|
* Unique and stable ID of the document.
|
|
@@ -151,16 +167,23 @@ export declare interface IFileEntry {
|
|
|
151
167
|
resolvedUrl: IResolvedUrl;
|
|
152
168
|
}
|
|
153
169
|
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
154
173
|
export declare type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
|
|
155
174
|
|
|
156
175
|
/**
|
|
157
176
|
* Base interface for all errors and warnings
|
|
158
177
|
* Superset of IDriverErrorBase, but with Odsp-specific errorType and properties
|
|
178
|
+
* @internal
|
|
159
179
|
*/
|
|
160
180
|
export declare interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
161
181
|
readonly errorType: OdspErrorType;
|
|
162
182
|
}
|
|
163
183
|
|
|
184
|
+
/**
|
|
185
|
+
* @internal
|
|
186
|
+
*/
|
|
164
187
|
export declare interface IOdspErrorAugmentations {
|
|
165
188
|
/**
|
|
166
189
|
* Server epoch indicates when the file was last modified.
|
|
@@ -178,6 +201,9 @@ export declare interface IOdspErrorAugmentations {
|
|
|
178
201
|
facetCodes?: string[];
|
|
179
202
|
}
|
|
180
203
|
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
181
207
|
export declare interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
182
208
|
type: "fluid";
|
|
183
209
|
odspResolvedUrl: true;
|
|
@@ -206,12 +232,18 @@ export declare interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
|
206
232
|
isClpCompliantApp?: boolean;
|
|
207
233
|
}
|
|
208
234
|
|
|
235
|
+
/**
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
209
238
|
export declare interface IOdspUrlParts {
|
|
210
239
|
siteUrl: string;
|
|
211
240
|
driveId: string;
|
|
212
241
|
itemId: string;
|
|
213
242
|
}
|
|
214
243
|
|
|
244
|
+
/**
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
215
247
|
export declare interface IOpsCachingPolicy {
|
|
216
248
|
/**
|
|
217
249
|
* Batch size. Controls how many ops are grouped together as single cache entry
|
|
@@ -244,6 +276,7 @@ export declare interface IOpsCachingPolicy {
|
|
|
244
276
|
* cache implementation that does not survive across sessions. Snapshot entires stored in the
|
|
245
277
|
* IPersistedCache will be considered stale and removed after 2 days. Read the README for more
|
|
246
278
|
* information.
|
|
279
|
+
* @internal
|
|
247
280
|
*/
|
|
248
281
|
export declare interface IPersistedCache {
|
|
249
282
|
/**
|
|
@@ -269,6 +302,7 @@ export declare interface IPersistedCache {
|
|
|
269
302
|
/**
|
|
270
303
|
* An interface that allows a concrete instance of a driver factory to interrogate itself
|
|
271
304
|
* to find out if it is session aware.
|
|
305
|
+
* @internal
|
|
272
306
|
*/
|
|
273
307
|
export declare interface IProvideSessionAwareDriverFactory {
|
|
274
308
|
readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
|
|
@@ -277,6 +311,7 @@ export declare interface IProvideSessionAwareDriverFactory {
|
|
|
277
311
|
/**
|
|
278
312
|
* An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`
|
|
279
313
|
* function if it session aware.
|
|
314
|
+
* @internal
|
|
280
315
|
*/
|
|
281
316
|
export declare interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
|
|
282
317
|
getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
|
|
@@ -284,6 +319,7 @@ export declare interface IRelaySessionAwareDriverFactory extends IProvideSession
|
|
|
284
319
|
|
|
285
320
|
/**
|
|
286
321
|
* Sharing link data received from the /snapshot api response.
|
|
322
|
+
* @internal
|
|
287
323
|
*/
|
|
288
324
|
export declare interface ISharingLink extends ISharingLinkKind {
|
|
289
325
|
webUrl: string;
|
|
@@ -292,12 +328,16 @@ export declare interface ISharingLink extends ISharingLinkKind {
|
|
|
292
328
|
/**
|
|
293
329
|
* Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
|
|
294
330
|
* Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
|
|
331
|
+
* @internal
|
|
295
332
|
*/
|
|
296
333
|
export declare interface ISharingLinkKind {
|
|
297
334
|
scope: SharingLinkScope;
|
|
298
335
|
role?: SharingLinkRole;
|
|
299
336
|
}
|
|
300
337
|
|
|
338
|
+
/**
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
301
341
|
export declare interface ISnapshotOptions {
|
|
302
342
|
blobs?: number;
|
|
303
343
|
deltas?: number;
|
|
@@ -308,6 +348,7 @@ export declare interface ISnapshotOptions {
|
|
|
308
348
|
|
|
309
349
|
/**
|
|
310
350
|
* Socket storage discovery api response
|
|
351
|
+
* @internal
|
|
311
352
|
*/
|
|
312
353
|
export declare interface ISocketStorageDiscovery {
|
|
313
354
|
id: string;
|
|
@@ -337,9 +378,13 @@ export declare interface ISocketStorageDiscovery {
|
|
|
337
378
|
* @param tokenResponse - return value for TokenFetcher method
|
|
338
379
|
* @returns Value indicating whether response came from cache.
|
|
339
380
|
* Undefined is returned when we could not determine the source of token.
|
|
381
|
+
* @internal
|
|
340
382
|
*/
|
|
341
383
|
export declare const isTokenFromCache: (tokenResponse: string | TokenResponse | null) => boolean | undefined;
|
|
342
384
|
|
|
385
|
+
/**
|
|
386
|
+
* @internal
|
|
387
|
+
*/
|
|
343
388
|
export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
344
389
|
|
|
345
390
|
/**
|
|
@@ -347,6 +392,7 @@ export declare type OdspError = IOdspError | (DriverError & IOdspErrorAugmentati
|
|
|
347
392
|
* Different error types that may be thrown by the ODSP driver.
|
|
348
393
|
*
|
|
349
394
|
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
395
|
+
* @internal
|
|
350
396
|
*/
|
|
351
397
|
export declare enum OdspErrorType {
|
|
352
398
|
/**
|
|
@@ -399,6 +445,7 @@ export declare enum OdspErrorType {
|
|
|
399
445
|
/**
|
|
400
446
|
* ODSP Error types.
|
|
401
447
|
* Different error types that may be thrown by the ODSP driver.
|
|
448
|
+
* @internal
|
|
402
449
|
*/
|
|
403
450
|
export declare const OdspErrorTypes: {
|
|
404
451
|
/**
|
|
@@ -458,10 +505,14 @@ export declare const OdspErrorTypes: {
|
|
|
458
505
|
readonly usageError: "usageError";
|
|
459
506
|
};
|
|
460
507
|
|
|
508
|
+
/**
|
|
509
|
+
* @internal
|
|
510
|
+
*/
|
|
461
511
|
export declare type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
|
|
462
512
|
|
|
463
513
|
/**
|
|
464
514
|
* Represents access token fetch options for ODSP resource
|
|
515
|
+
* @internal
|
|
465
516
|
*/
|
|
466
517
|
export declare interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
467
518
|
/** Site url representing ODSP resource location */
|
|
@@ -476,6 +527,7 @@ export declare interface OdspResourceTokenFetchOptions extends TokenFetchOptions
|
|
|
476
527
|
* Sharing link data created for the ODSP item.
|
|
477
528
|
* Contains information about either sharing link created while creating a new file or
|
|
478
529
|
* a redeemable share link created when loading an existing file
|
|
530
|
+
* @internal
|
|
479
531
|
*/
|
|
480
532
|
export declare interface ShareLinkInfoType {
|
|
481
533
|
/**
|
|
@@ -513,6 +565,7 @@ export declare interface ShareLinkInfoType {
|
|
|
513
565
|
/**
|
|
514
566
|
* @deprecated Use ISharingLinkKind type instead.
|
|
515
567
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
568
|
+
* @internal
|
|
516
569
|
*/
|
|
517
570
|
export declare enum ShareLinkTypes {
|
|
518
571
|
csl = "csl"
|
|
@@ -520,6 +573,7 @@ export declare enum ShareLinkTypes {
|
|
|
520
573
|
|
|
521
574
|
/**
|
|
522
575
|
* View/edit permission role for a sharing link.
|
|
576
|
+
* @internal
|
|
523
577
|
*/
|
|
524
578
|
export declare enum SharingLinkRole {
|
|
525
579
|
view = "view",
|
|
@@ -528,6 +582,7 @@ export declare enum SharingLinkRole {
|
|
|
528
582
|
|
|
529
583
|
/**
|
|
530
584
|
* Sharing scope of the share links created for a file.
|
|
585
|
+
* @internal
|
|
531
586
|
*/
|
|
532
587
|
export declare enum SharingLinkScope {
|
|
533
588
|
organization = "organization",
|
|
@@ -538,6 +593,7 @@ export declare enum SharingLinkScope {
|
|
|
538
593
|
|
|
539
594
|
/**
|
|
540
595
|
* Describes what kind of content is stored in cache entry.
|
|
596
|
+
* @internal
|
|
541
597
|
*/
|
|
542
598
|
export declare const snapshotKey = "snapshot";
|
|
543
599
|
|
|
@@ -547,11 +603,13 @@ export declare const snapshotKey = "snapshot";
|
|
|
547
603
|
* @returns If successful, TokenResponse object representing token value along with flag indicating
|
|
548
604
|
* whether token came from cache. Legacy implementation may return a string for token value;
|
|
549
605
|
* in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.
|
|
606
|
+
* @internal
|
|
550
607
|
*/
|
|
551
608
|
export declare type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
|
|
552
609
|
|
|
553
610
|
/**
|
|
554
611
|
* Represents access token fetch options
|
|
612
|
+
* @internal
|
|
555
613
|
*/
|
|
556
614
|
export declare interface TokenFetchOptions {
|
|
557
615
|
/**
|
|
@@ -576,11 +634,13 @@ export declare interface TokenFetchOptions {
|
|
|
576
634
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
577
635
|
* @param tokenResponse - return value for TokenFetcher method
|
|
578
636
|
* @returns Token value
|
|
637
|
+
* @internal
|
|
579
638
|
*/
|
|
580
639
|
export declare const tokenFromResponse: (tokenResponse: string | TokenResponse | null | undefined) => string | null;
|
|
581
640
|
|
|
582
641
|
/**
|
|
583
642
|
* Represents token response
|
|
643
|
+
* @internal
|
|
584
644
|
*/
|
|
585
645
|
export declare interface TokenResponse {
|
|
586
646
|
/** Token value */
|
package/dist/odspCache.cjs
CHANGED
|
@@ -7,12 +7,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.getKeyForCacheEntry = exports.snapshotKey = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* Describes what kind of content is stored in cache entry.
|
|
10
|
+
* @internal
|
|
10
11
|
*/
|
|
11
12
|
exports.snapshotKey = "snapshot";
|
|
12
13
|
/**
|
|
13
14
|
* Api to generate a cache key from cache entry.
|
|
14
15
|
* @param entry - cache entry from which a cache key is generated
|
|
15
16
|
* @returns The key for cache.
|
|
17
|
+
* @internal
|
|
16
18
|
*/
|
|
17
19
|
function getKeyForCacheEntry(entry) {
|
|
18
20
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
package/dist/odspCache.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspCache.cjs","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH
|
|
1
|
+
{"version":3,"file":"odspCache.cjs","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACU,QAAA,WAAW,GAAG,UAAU,CAAC;AA8FtC;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAFD,kDAEC","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 * Describes what kind of content is stored in cache entry.\n * @internal\n */\nexport const snapshotKey = \"snapshot\";\n/**\n * @internal\n */\nexport type CacheContentType = \"snapshot\" | \"ops\";\n\n/*\n * File / container identifier.\n * There is overlapping information here - host can use all of it or parts\n * to implement storage / identify files.\n */\n/**\n * @internal\n */\nexport interface IFileEntry {\n\t/**\n\t * Unique and stable ID of the document.\n\t * Driver guarantees that docId is stable ID uniquely identifying document.\n\t */\n\tdocId: string;\n\t/**\n\t * Resolved URI is provided for additional versatility - host can use it to\n\t * identify file in storage, and (as example) delete all cached entries for\n\t * a file if user requests so.\n\t * This is IOdspResolvedUrl in case of ODSP driver.\n\t */\n\tresolvedUrl: IResolvedUrl;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @internal\n */\nexport interface IEntry {\n\t/**\n\t * Identifies type of entry for a given file.\n\t * Each file can have multiple types of entries associated with it.\n\t * For example, it can be snapshot, blob, ops, etc.\n\t */\n\ttype: CacheContentType;\n\n\t/**\n\t * Identifies individual entry for a given file and type.\n\t * Each file can have multiple cache entries associated with it.\n\t * This property identifies a particular instance of entry.\n\t * For example, for blobs it will be unique ID of the blob in a file.\n\t * For batch of ops, it can be starting op sequence number.\n\t * For types that have only one entry (like snapshots), it will be empty string.\n\t */\n\tkey: string;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @internal\n */\nexport interface ICacheEntry extends IEntry {\n\t/**\n\t * Identifies file in storage this cached entry is for\n\t */\n\tfile: IFileEntry;\n}\n\n/**\n * Persistent cache. This interface can be implemented by the host to provide durable caching\n * across sessions. If not provided at driver factory construction, factory will use in-memory\n * cache implementation that does not survive across sessions. Snapshot entires stored in the\n * IPersistedCache will be considered stale and removed after 2 days. Read the README for more\n * information.\n * @internal\n */\nexport interface IPersistedCache {\n\t/**\n\t * Get the cache value of the key\n\t * @param entry - cache entry, identifies file and particular key for this file.\n\t * @returns Cached value. undefined if nothing is cached.\n\t */\n\tget(entry: ICacheEntry): Promise<any>;\n\n\t/**\n\t * Put the value into cache.\n\t * Important - only serializable content is allowed since this cache may be persisted between sessions\n\t * @param entry - cache entry.\n\t * @param value - JSON-serializable content.\n\t */\n\tput(entry: ICacheEntry, value: any): Promise<void>;\n\n\t/**\n\t * Removes the entries from the cache for given parametres.\n\t * @param file - file entry to be deleted.\n\t */\n\tremoveEntries(file: IFileEntry): Promise<void>;\n}\n\n/**\n * Api to generate a cache key from cache entry.\n * @param entry - cache entry from which a cache key is generated\n * @returns The key for cache.\n * @internal\n */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
|
package/dist/odspCache.d.ts
CHANGED
|
@@ -5,9 +5,16 @@
|
|
|
5
5
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
/**
|
|
7
7
|
* Describes what kind of content is stored in cache entry.
|
|
8
|
+
* @internal
|
|
8
9
|
*/
|
|
9
10
|
export declare const snapshotKey = "snapshot";
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
10
14
|
export type CacheContentType = "snapshot" | "ops";
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
11
18
|
export interface IFileEntry {
|
|
12
19
|
/**
|
|
13
20
|
* Unique and stable ID of the document.
|
|
@@ -24,6 +31,7 @@ export interface IFileEntry {
|
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
34
|
+
* @internal
|
|
27
35
|
*/
|
|
28
36
|
export interface IEntry {
|
|
29
37
|
/**
|
|
@@ -44,6 +52,7 @@ export interface IEntry {
|
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
54
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
55
|
+
* @internal
|
|
47
56
|
*/
|
|
48
57
|
export interface ICacheEntry extends IEntry {
|
|
49
58
|
/**
|
|
@@ -57,6 +66,7 @@ export interface ICacheEntry extends IEntry {
|
|
|
57
66
|
* cache implementation that does not survive across sessions. Snapshot entires stored in the
|
|
58
67
|
* IPersistedCache will be considered stale and removed after 2 days. Read the README for more
|
|
59
68
|
* information.
|
|
69
|
+
* @internal
|
|
60
70
|
*/
|
|
61
71
|
export interface IPersistedCache {
|
|
62
72
|
/**
|
|
@@ -82,6 +92,7 @@ export interface IPersistedCache {
|
|
|
82
92
|
* Api to generate a cache key from cache entry.
|
|
83
93
|
* @param entry - cache entry from which a cache key is generated
|
|
84
94
|
* @returns The key for cache.
|
|
95
|
+
* @internal
|
|
85
96
|
*/
|
|
86
97
|
export declare function getKeyForCacheEntry(entry: ICacheEntry): string;
|
|
87
98
|
//# sourceMappingURL=odspCache.d.ts.map
|
package/dist/odspCache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
|
package/dist/resolvedUrl.cjs
CHANGED
|
@@ -8,6 +8,7 @@ exports.SharingLinkRole = exports.SharingLinkScope = exports.ShareLinkTypes = vo
|
|
|
8
8
|
/**
|
|
9
9
|
* @deprecated Use ISharingLinkKind type instead.
|
|
10
10
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
11
|
+
* @internal
|
|
11
12
|
*/
|
|
12
13
|
var ShareLinkTypes;
|
|
13
14
|
(function (ShareLinkTypes) {
|
|
@@ -15,6 +16,7 @@ var ShareLinkTypes;
|
|
|
15
16
|
})(ShareLinkTypes || (exports.ShareLinkTypes = ShareLinkTypes = {}));
|
|
16
17
|
/**
|
|
17
18
|
* Sharing scope of the share links created for a file.
|
|
19
|
+
* @internal
|
|
18
20
|
*/
|
|
19
21
|
var SharingLinkScope;
|
|
20
22
|
(function (SharingLinkScope) {
|
|
@@ -25,6 +27,7 @@ var SharingLinkScope;
|
|
|
25
27
|
})(SharingLinkScope || (exports.SharingLinkScope = SharingLinkScope = {}));
|
|
26
28
|
/**
|
|
27
29
|
* View/edit permission role for a sharing link.
|
|
30
|
+
* @internal
|
|
28
31
|
*/
|
|
29
32
|
var SharingLinkRole;
|
|
30
33
|
(function (SharingLinkRole) {
|
package/dist/resolvedUrl.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.cjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"resolvedUrl.cjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;;;GAIG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","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 * @internal\n */\nexport interface IOdspUrlParts {\n\tsiteUrl: string;\n\tdriveId: string;\n\titemId: string;\n}\n\n/**\n * @deprecated Use ISharingLinkKind type instead.\n * Type of shareLink requested/created when creating the file for the first time.\n * @internal\n */\nexport enum ShareLinkTypes {\n\tcsl = \"csl\",\n}\n\n/**\n * Sharing scope of the share links created for a file.\n * @internal\n */\nexport enum SharingLinkScope {\n\torganization = \"organization\",\n\tusers = \"users\",\n\tanonymous = \"anonymous\",\n\tdefault = \"default\",\n}\n\n/**\n * View/edit permission role for a sharing link.\n * @internal\n */\nexport enum SharingLinkRole {\n\tview = \"view\",\n\tedit = \"edit\",\n}\n\n/**\n * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.\n * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.\n * @internal\n */\nexport interface ISharingLinkKind {\n\tscope: SharingLinkScope;\n\t/*\n\t * If this parameter is not provided, the API will default to \"edit\" links (provided\n\t * a valid createLinkScope setting is given).\n\t */\n\trole?: SharingLinkRole;\n}\n\n/**\n * Sharing link data received from the /snapshot api response.\n * @internal\n */\nexport interface ISharingLink extends ISharingLinkKind {\n\twebUrl: string;\n}\n\n/**\n * Sharing link data created for the ODSP item.\n * Contains information about either sharing link created while creating a new file or\n * a redeemable share link created when loading an existing file\n * @internal\n */\nexport interface ShareLinkInfoType {\n\t/**\n\t * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to\n\t * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature\n\t * where we can create a share link along with creating a file by passing a query parameter called\n\t * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information\n\t * from the /snapshot api response.\n\t */\n\tcreateLink?: {\n\t\t/**\n\t\t * @deprecated\n\t\t * Type of shareLink requested/created when creating the file for the first time. The 'type' property here\n\t\t * represents the type of sharing link requested.\n\t\t * Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.\n\t\t */\n\t\ttype?: ShareLinkTypes | ISharingLinkKind;\n\n\t\t/**\n\t\t * Share link created when the file is created for the first time with /snapshot api call.\n\t\t */\n\t\tlink?: string | ISharingLink;\n\n\t\t/**\n\t\t * Error message if creation of sharing link fails with /snapshot api call\n\t\t */\n\t\terror?: any;\n\n\t\tshareId?: string;\n\t};\n\n\t/**\n\t * This is used to save the network calls while doing trees/latest call as if the client does not have\n\t * permission then this link can be redeemed for the permissions in the same network call.\n\t */\n\tsharingLinkToRedeem?: string;\n}\n/**\n * @internal\n */\nexport interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {\n\ttype: \"fluid\";\n\todspResolvedUrl: true;\n\n\t// URL to send to fluid, contains the documentId and the path\n\turl: string;\n\n\t// A hashed identifier that is unique to this document\n\thashedDocumentId: string;\n\n\tendpoints: {\n\t\tsnapshotStorageUrl: string;\n\t\tattachmentPOSTStorageUrl: string;\n\t\tattachmentGETStorageUrl: string;\n\t\tdeltaStorageUrl: string;\n\t};\n\n\t// Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n\ttokens: {};\n\n\tfileName: string;\n\n\tsummarizer: boolean;\n\n\tcodeHint?: {\n\t\t// containerPackageName is used for adding the package name to the request headers.\n\t\t// This may be used for preloading the container package when loading Fluid content.\n\t\tcontainerPackageName?: string;\n\t};\n\n\tfileVersion: string | undefined;\n\n\tdataStorePath?: string;\n\n\t/**\n\t * Sharing link data created for the ODSP item.\n\t * Contains information about either sharing link created while creating a new file or\n\t * a redeemable share link created when loading an existing file\n\t */\n\tshareLinkInfo?: ShareLinkInfoType;\n\n\tisClpCompliantApp?: boolean;\n}\n"]}
|
package/dist/resolvedUrl.d.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
6
9
|
export interface IOdspUrlParts {
|
|
7
10
|
siteUrl: string;
|
|
8
11
|
driveId: string;
|
|
@@ -11,12 +14,14 @@ export interface IOdspUrlParts {
|
|
|
11
14
|
/**
|
|
12
15
|
* @deprecated Use ISharingLinkKind type instead.
|
|
13
16
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
17
|
+
* @internal
|
|
14
18
|
*/
|
|
15
19
|
export declare enum ShareLinkTypes {
|
|
16
20
|
csl = "csl"
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Sharing scope of the share links created for a file.
|
|
24
|
+
* @internal
|
|
20
25
|
*/
|
|
21
26
|
export declare enum SharingLinkScope {
|
|
22
27
|
organization = "organization",
|
|
@@ -26,6 +31,7 @@ export declare enum SharingLinkScope {
|
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* View/edit permission role for a sharing link.
|
|
34
|
+
* @internal
|
|
29
35
|
*/
|
|
30
36
|
export declare enum SharingLinkRole {
|
|
31
37
|
view = "view",
|
|
@@ -34,6 +40,7 @@ export declare enum SharingLinkRole {
|
|
|
34
40
|
/**
|
|
35
41
|
* Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
|
|
36
42
|
* Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
|
|
43
|
+
* @internal
|
|
37
44
|
*/
|
|
38
45
|
export interface ISharingLinkKind {
|
|
39
46
|
scope: SharingLinkScope;
|
|
@@ -41,6 +48,7 @@ export interface ISharingLinkKind {
|
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
43
50
|
* Sharing link data received from the /snapshot api response.
|
|
51
|
+
* @internal
|
|
44
52
|
*/
|
|
45
53
|
export interface ISharingLink extends ISharingLinkKind {
|
|
46
54
|
webUrl: string;
|
|
@@ -49,6 +57,7 @@ export interface ISharingLink extends ISharingLinkKind {
|
|
|
49
57
|
* Sharing link data created for the ODSP item.
|
|
50
58
|
* Contains information about either sharing link created while creating a new file or
|
|
51
59
|
* a redeemable share link created when loading an existing file
|
|
60
|
+
* @internal
|
|
52
61
|
*/
|
|
53
62
|
export interface ShareLinkInfoType {
|
|
54
63
|
/**
|
|
@@ -82,6 +91,9 @@ export interface ShareLinkInfoType {
|
|
|
82
91
|
*/
|
|
83
92
|
sharingLinkToRedeem?: string;
|
|
84
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
85
97
|
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
86
98
|
type: "fluid";
|
|
87
99
|
odspResolvedUrl: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED
|
|
1
|
+
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,oBAAY,cAAc;IACzB,GAAG,QAAQ;CACX;AAED;;;GAGG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACnB;AAED;;;GAGG;AACH,oBAAY,eAAe;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IAKxB,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QACZ;;;;;WAKG;QACH,IAAI,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC;QAEzC;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;QAE7B;;WAEG;QACH,KAAK,CAAC,EAAE,GAAG,CAAC;QAEZ,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AACD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY,EAAE,aAAa;IACpE,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,IAAI,CAAC;IAGtB,GAAG,EAAE,MAAM,CAAC;IAGZ,gBAAgB,EAAE,MAAM,CAAC;IAEzB,SAAS,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,wBAAwB,EAAE,MAAM,CAAC;QACjC,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;IAIF,MAAM,EAAE,EAAE,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE;QAGV,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IAEF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionProvider.cjs","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 */\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\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 */\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 */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sessionProvider.cjs","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 * @internal\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\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 * @internal\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 * @internal\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
/**
|
|
7
7
|
* Socket storage discovery api response
|
|
8
|
+
* @internal
|
|
8
9
|
*/
|
|
9
10
|
export interface ISocketStorageDiscovery {
|
|
10
11
|
id: string;
|
|
@@ -31,6 +32,7 @@ export interface ISocketStorageDiscovery {
|
|
|
31
32
|
/**
|
|
32
33
|
* An interface that allows a concrete instance of a driver factory to interrogate itself
|
|
33
34
|
* to find out if it is session aware.
|
|
35
|
+
* @internal
|
|
34
36
|
*/
|
|
35
37
|
export interface IProvideSessionAwareDriverFactory {
|
|
36
38
|
readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
|
|
@@ -38,6 +40,7 @@ export interface IProvideSessionAwareDriverFactory {
|
|
|
38
40
|
/**
|
|
39
41
|
* An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`
|
|
40
42
|
* function if it session aware.
|
|
43
|
+
* @internal
|
|
41
44
|
*/
|
|
42
45
|
export interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
|
|
43
46
|
getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
|
|
@@ -1 +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
|
|
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;CACvC;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"}
|
package/dist/tokenFetch.cjs
CHANGED
|
@@ -9,6 +9,7 @@ exports.isTokenFromCache = exports.tokenFromResponse = void 0;
|
|
|
9
9
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
10
10
|
* @param tokenResponse - return value for TokenFetcher method
|
|
11
11
|
* @returns Token value
|
|
12
|
+
* @internal
|
|
12
13
|
*/
|
|
13
14
|
const tokenFromResponse = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
|
|
14
15
|
? tokenResponse
|
|
@@ -21,6 +22,7 @@ exports.tokenFromResponse = tokenFromResponse;
|
|
|
21
22
|
* @param tokenResponse - return value for TokenFetcher method
|
|
22
23
|
* @returns Value indicating whether response came from cache.
|
|
23
24
|
* Undefined is returned when we could not determine the source of token.
|
|
25
|
+
* @internal
|
|
24
26
|
*/
|
|
25
27
|
const isTokenFromCache = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
|
|
26
28
|
? undefined
|
package/dist/tokenFetch.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.cjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"tokenFetch.cjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgEH;;;;;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 * @internal\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/** Flag indicating whether token was obtained from local cache */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @internal\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 * @internal\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 * @internal\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 * @internal\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/dist/tokenFetch.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Represents token response
|
|
7
|
+
* @internal
|
|
7
8
|
*/
|
|
8
9
|
export interface TokenResponse {
|
|
9
10
|
/** Token value */
|
|
@@ -13,6 +14,7 @@ export interface TokenResponse {
|
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Represents access token fetch options
|
|
17
|
+
* @internal
|
|
16
18
|
*/
|
|
17
19
|
export interface TokenFetchOptions {
|
|
18
20
|
/**
|
|
@@ -34,6 +36,7 @@ export interface TokenFetchOptions {
|
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Represents access token fetch options for ODSP resource
|
|
39
|
+
* @internal
|
|
37
40
|
*/
|
|
38
41
|
export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
39
42
|
/** Site url representing ODSP resource location */
|
|
@@ -49,12 +52,14 @@ export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
|
49
52
|
* @returns If successful, TokenResponse object representing token value along with flag indicating
|
|
50
53
|
* whether token came from cache. Legacy implementation may return a string for token value;
|
|
51
54
|
* in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.
|
|
55
|
+
* @internal
|
|
52
56
|
*/
|
|
53
57
|
export type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
|
|
54
58
|
/**
|
|
55
59
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
56
60
|
* @param tokenResponse - return value for TokenFetcher method
|
|
57
61
|
* @returns Token value
|
|
62
|
+
* @internal
|
|
58
63
|
*/
|
|
59
64
|
export declare const tokenFromResponse: (tokenResponse: string | TokenResponse | null | undefined) => string | null;
|
|
60
65
|
/**
|
|
@@ -62,13 +67,18 @@ export declare const tokenFromResponse: (tokenResponse: string | TokenResponse |
|
|
|
62
67
|
* @param tokenResponse - return value for TokenFetcher method
|
|
63
68
|
* @returns Value indicating whether response came from cache.
|
|
64
69
|
* Undefined is returned when we could not determine the source of token.
|
|
70
|
+
* @internal
|
|
65
71
|
*/
|
|
66
72
|
export declare const isTokenFromCache: (tokenResponse: string | TokenResponse | null) => boolean | undefined;
|
|
67
73
|
/**
|
|
68
74
|
* Identity types supported by ODSP driver.
|
|
69
75
|
* `Consumer` represents user authenticated with Microsoft Account (MSA).
|
|
70
76
|
* `Enterprise` represents user authenticated with M365 tenant account.
|
|
77
|
+
* @internal
|
|
71
78
|
*/
|
|
72
79
|
export type IdentityType = "Consumer" | "Enterprise";
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
73
83
|
export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
|
|
74
84
|
//# sourceMappingURL=tokenFetch.d.ts.map
|
package/dist/tokenFetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
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,kEAAkE;IAClE,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"}
|