@fluidframework/container-definitions 0.43.0-45414 → 0.45.0-49188
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/.eslintrc.js +4 -3
- package/BREAKING.md +6 -0
- package/api-report/container-definitions.api.md +94 -35
- package/dist/deltas.d.ts +1 -19
- package/dist/deltas.d.ts.map +1 -1
- package/dist/deltas.js.map +1 -1
- package/dist/error.d.ts +5 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +4 -0
- package/dist/error.js.map +1 -1
- package/dist/fluidPackage.d.ts +109 -0
- package/dist/fluidPackage.d.ts.map +1 -0
- package/dist/fluidPackage.js +24 -0
- package/dist/fluidPackage.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +34 -16
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/runtime.d.ts +18 -4
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/lib/deltas.d.ts +1 -19
- package/lib/deltas.d.ts.map +1 -1
- package/lib/deltas.js.map +1 -1
- package/lib/error.d.ts +5 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +4 -0
- package/lib/error.js.map +1 -1
- package/lib/fluidPackage.d.ts +109 -0
- package/lib/fluidPackage.d.ts.map +1 -0
- package/lib/fluidPackage.js +19 -0
- package/lib/fluidPackage.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +34 -16
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js.map +1 -1
- package/lib/runtime.d.ts +18 -4
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js.map +1 -1
- package/package.json +242 -24
- package/src/deltas.ts +1 -20
- package/src/error.ts +6 -1
- package/src/fluidPackage.ts +132 -0
- package/src/index.ts +1 -0
- package/src/loader.ts +37 -17
- package/src/runtime.ts +20 -5
package/.eslintrc.js
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
+
"extends": [
|
|
8
|
+
"@fluidframework/eslint-config-fluid"
|
|
9
|
+
],
|
|
7
10
|
"parserOptions": {
|
|
8
11
|
"project": ["./tsconfig.json", "./src/test/types/tsconfig.json"]
|
|
9
12
|
},
|
|
10
|
-
"
|
|
11
|
-
"@fluidframework/eslint-config-fluid/eslint7"
|
|
12
|
-
]
|
|
13
|
+
"rules": {}
|
|
13
14
|
}
|
package/BREAKING.md
CHANGED
|
@@ -12,3 +12,9 @@ but a large number of useful properties off the offending message, via `CreatePr
|
|
|
12
12
|
Use `IContainerContext.taggedLogger` instead if present. If it's missing and you must use `logger`,
|
|
13
13
|
be sure to handle tagged data before sending events to it.
|
|
14
14
|
`logger` won't be removed for a very long time since old loaders could remain in production for quite some time.
|
|
15
|
+
|
|
16
|
+
## 0.45 Breaking changes
|
|
17
|
+
- [ContainerErrorType.clientSessionExpiredError added](#ContainerErrorType.clientSessionExpiredError-added)
|
|
18
|
+
|
|
19
|
+
### ContainerErrorType.clientSessionExpiredError added
|
|
20
|
+
We have session expiry for GC purposes. Once the session has expired, we want to throw this new clientSessionExpiredError to clear out any stale in-memory data that may still be on the container.
|
|
@@ -16,16 +16,16 @@ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
|
16
16
|
import { IErrorEvent } from '@fluidframework/common-definitions';
|
|
17
17
|
import { IEvent } from '@fluidframework/common-definitions';
|
|
18
18
|
import { IEventProvider } from '@fluidframework/common-definitions';
|
|
19
|
-
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
|
|
19
|
+
import { IFluidCodeDetails as IFluidCodeDetails_2 } from '@fluidframework/core-interfaces';
|
|
20
20
|
import { IFluidConfiguration } from '@fluidframework/core-interfaces';
|
|
21
21
|
import { IFluidObject } from '@fluidframework/core-interfaces';
|
|
22
|
-
import { IFluidPackage } from '@fluidframework/core-interfaces';
|
|
23
|
-
import { IFluidPackageEnvironment } from '@fluidframework/core-interfaces';
|
|
22
|
+
import { IFluidPackage as IFluidPackage_2 } from '@fluidframework/core-interfaces';
|
|
23
|
+
import { IFluidPackageEnvironment as IFluidPackageEnvironment_2 } from '@fluidframework/core-interfaces';
|
|
24
24
|
import { IFluidResolvedUrl } from '@fluidframework/driver-definitions';
|
|
25
25
|
import { IFluidRouter } from '@fluidframework/core-interfaces';
|
|
26
26
|
import { IPendingProposal } from '@fluidframework/protocol-definitions';
|
|
27
|
-
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/core-interfaces';
|
|
28
|
-
import {
|
|
27
|
+
import { IProvideFluidCodeDetailsComparer as IProvideFluidCodeDetailsComparer_2 } from '@fluidframework/core-interfaces';
|
|
28
|
+
import { IQuorumClients } from '@fluidframework/protocol-definitions';
|
|
29
29
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
30
30
|
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
31
31
|
import { IResponse } from '@fluidframework/core-interfaces';
|
|
@@ -70,6 +70,7 @@ export type ConnectionState = ConnectionState.Disconnected | ConnectionState.Con
|
|
|
70
70
|
|
|
71
71
|
// @public
|
|
72
72
|
export enum ContainerErrorType {
|
|
73
|
+
clientSessionExpiredError = "clientSessionExpiredError",
|
|
73
74
|
dataCorruptionError = "dataCorruptionError",
|
|
74
75
|
dataProcessingError = "dataProcessingError",
|
|
75
76
|
genericError = "genericError",
|
|
@@ -96,9 +97,14 @@ export interface ICodeAllowList {
|
|
|
96
97
|
testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
// @public
|
|
101
|
+
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer_2> {
|
|
102
|
+
load(source: IFluidCodeDetails_2): Promise<IFluidModuleWithDetails>;
|
|
103
|
+
}
|
|
104
|
+
|
|
99
105
|
// @public @deprecated
|
|
100
|
-
export interface ICodeLoader extends Partial<
|
|
101
|
-
load(source:
|
|
106
|
+
export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer_2> {
|
|
107
|
+
load(source: IFluidCodeDetails_2): Promise<IFluidModule>;
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
// @public
|
|
@@ -112,8 +118,6 @@ export interface IConnectionDetails {
|
|
|
112
118
|
existing: boolean;
|
|
113
119
|
// (undocumented)
|
|
114
120
|
initialClients: ISignalClient[];
|
|
115
|
-
// @deprecated (undocumented)
|
|
116
|
-
maxMessageSize: number;
|
|
117
121
|
// (undocumented)
|
|
118
122
|
mode: ConnectionMode;
|
|
119
123
|
// (undocumented)
|
|
@@ -126,26 +130,24 @@ export interface IConnectionDetails {
|
|
|
126
130
|
export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
|
|
127
131
|
attach(request: IRequest): Promise<void>;
|
|
128
132
|
readonly attachState: AttachState;
|
|
129
|
-
readonly audience
|
|
133
|
+
readonly audience: IAudience;
|
|
130
134
|
// @alpha
|
|
131
135
|
readonly clientId?: string | undefined;
|
|
132
136
|
close(error?: ICriticalContainerError): void;
|
|
133
137
|
closeAndGetPendingLocalState(): string;
|
|
134
138
|
readonly closed: boolean;
|
|
135
|
-
|
|
136
|
-
readonly
|
|
137
|
-
readonly connected?: boolean;
|
|
138
|
-
readonly connectionState?: ConnectionState;
|
|
139
|
+
readonly connected: boolean;
|
|
140
|
+
readonly connectionState: ConnectionState;
|
|
139
141
|
deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
140
142
|
// @alpha
|
|
141
143
|
forceReadonly?(readonly: boolean): any;
|
|
142
144
|
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
143
|
-
getLoadedCodeDetails
|
|
144
|
-
getQuorum():
|
|
145
|
-
getSpecifiedCodeDetails
|
|
145
|
+
getLoadedCodeDetails(): IFluidCodeDetails_2 | undefined;
|
|
146
|
+
getQuorum(): IQuorumClients;
|
|
147
|
+
getSpecifiedCodeDetails(): IFluidCodeDetails_2 | undefined;
|
|
146
148
|
readonly isDirty: boolean;
|
|
147
|
-
proposeCodeDetails(codeDetails:
|
|
148
|
-
readonly readOnlyInfo
|
|
149
|
+
proposeCodeDetails(codeDetails: IFluidCodeDetails_2): Promise<boolean>;
|
|
150
|
+
readonly readOnlyInfo: ReadOnlyInfo;
|
|
149
151
|
request(request: IRequest): Promise<IResponse>;
|
|
150
152
|
resolvedUrl: IResolvedUrl | undefined;
|
|
151
153
|
// @alpha
|
|
@@ -168,8 +170,8 @@ export interface IContainerContext extends IDisposable {
|
|
|
168
170
|
readonly clientId: string | undefined;
|
|
169
171
|
// (undocumented)
|
|
170
172
|
readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
171
|
-
// (undocumented)
|
|
172
|
-
readonly configuration
|
|
173
|
+
// @deprecated (undocumented)
|
|
174
|
+
readonly configuration?: IFluidConfiguration;
|
|
173
175
|
// (undocumented)
|
|
174
176
|
readonly connected: boolean;
|
|
175
177
|
// (undocumented)
|
|
@@ -179,7 +181,9 @@ export interface IContainerContext extends IDisposable {
|
|
|
179
181
|
getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;
|
|
180
182
|
// (undocumented)
|
|
181
183
|
getLoadedFromVersion(): IVersion | undefined;
|
|
182
|
-
// (undocumented)
|
|
184
|
+
// @deprecated (undocumented)
|
|
185
|
+
getSpecifiedCodeDetails?(): IFluidCodeDetails_2 | undefined;
|
|
186
|
+
// @deprecated (undocumented)
|
|
183
187
|
readonly id: string;
|
|
184
188
|
// (undocumented)
|
|
185
189
|
readonly loader: ILoader;
|
|
@@ -190,7 +194,7 @@ export interface IContainerContext extends IDisposable {
|
|
|
190
194
|
// (undocumented)
|
|
191
195
|
pendingLocalState?: unknown;
|
|
192
196
|
// (undocumented)
|
|
193
|
-
readonly quorum:
|
|
197
|
+
readonly quorum: IQuorumClients;
|
|
194
198
|
// (undocumented)
|
|
195
199
|
raiseContainerWarning(warning: ContainerWarning): void;
|
|
196
200
|
readonly scope: IFluidObject & FluidObject;
|
|
@@ -215,9 +219,9 @@ export interface IContainerEvents extends IEvent {
|
|
|
215
219
|
// (undocumented)
|
|
216
220
|
(event: "connected", listener: (clientId: string) => void): any;
|
|
217
221
|
// (undocumented)
|
|
218
|
-
(event: "codeDetailsProposed", listener: (codeDetails:
|
|
222
|
+
(event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails_2, proposal: IPendingProposal) => void): any;
|
|
219
223
|
// (undocumented)
|
|
220
|
-
(event: "contextChanged", listener: (codeDetails:
|
|
224
|
+
(event: "contextChanged", listener: (codeDetails: IFluidCodeDetails_2) => void): any;
|
|
221
225
|
// (undocumented)
|
|
222
226
|
(event: "disconnected" | "attached", listener: () => void): any;
|
|
223
227
|
// (undocumented)
|
|
@@ -251,6 +255,7 @@ export interface IDeltaHandlerStrategy {
|
|
|
251
255
|
export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {
|
|
252
256
|
readonly active: boolean;
|
|
253
257
|
readonly clientDetails: IClientDetails;
|
|
258
|
+
// @deprecated (undocumented)
|
|
254
259
|
close(): void;
|
|
255
260
|
readonly hasCheckpointSequenceNumber: boolean;
|
|
256
261
|
readonly inbound: IDeltaQueue<T>;
|
|
@@ -262,8 +267,6 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
|
|
|
262
267
|
readonly maxMessageSize: number;
|
|
263
268
|
readonly minimumSequenceNumber: number;
|
|
264
269
|
readonly outbound: IDeltaQueue<U[]>;
|
|
265
|
-
// @deprecated
|
|
266
|
-
readonly readonly?: boolean;
|
|
267
270
|
// (undocumented)
|
|
268
271
|
readonly readOnlyInfo: ReadOnlyInfo;
|
|
269
272
|
readonly serviceConfiguration: IClientConfiguration | undefined;
|
|
@@ -329,31 +332,75 @@ export interface IErrorBase extends Partial<Error> {
|
|
|
329
332
|
}
|
|
330
333
|
|
|
331
334
|
// @public
|
|
332
|
-
export interface IFluidBrowserPackage extends
|
|
335
|
+
export interface IFluidBrowserPackage extends IFluidPackage_2 {
|
|
333
336
|
// (undocumented)
|
|
334
337
|
fluid: {
|
|
335
338
|
browser: IFluidBrowserPackageEnvironment;
|
|
336
|
-
[environment: string]:
|
|
339
|
+
[environment: string]: IFluidPackageEnvironment_2;
|
|
337
340
|
};
|
|
338
341
|
}
|
|
339
342
|
|
|
340
343
|
// @public
|
|
341
|
-
export interface IFluidBrowserPackageEnvironment extends
|
|
344
|
+
export interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment_2 {
|
|
342
345
|
umd: {
|
|
343
346
|
files: string[];
|
|
344
347
|
library: string;
|
|
345
348
|
};
|
|
346
349
|
}
|
|
347
350
|
|
|
351
|
+
// @public
|
|
352
|
+
export interface IFluidCodeDetails {
|
|
353
|
+
readonly config?: IFluidCodeDetailsConfig;
|
|
354
|
+
readonly package: string | Readonly<IFluidPackage>;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// @public (undocumented)
|
|
358
|
+
export const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
|
|
359
|
+
|
|
360
|
+
// @public
|
|
361
|
+
export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
|
|
362
|
+
compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
|
|
363
|
+
satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// @public
|
|
367
|
+
export interface IFluidCodeDetailsConfig {
|
|
368
|
+
// (undocumented)
|
|
369
|
+
readonly [key: string]: string;
|
|
370
|
+
}
|
|
371
|
+
|
|
348
372
|
// @public
|
|
349
373
|
export interface IFluidCodeResolver {
|
|
350
|
-
resolveCodeDetails(details:
|
|
374
|
+
resolveCodeDetails(details: IFluidCodeDetails_2): Promise<IResolvedFluidCodeDetails>;
|
|
351
375
|
}
|
|
352
376
|
|
|
353
377
|
// @public (undocumented)
|
|
354
378
|
export interface IFluidModule {
|
|
355
379
|
// (undocumented)
|
|
356
|
-
fluidExport: IFluidObject & FluidObject<IRuntimeFactory &
|
|
380
|
+
fluidExport: IFluidObject & FluidObject<IRuntimeFactory & IProvideFluidCodeDetailsComparer_2>;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// @public
|
|
384
|
+
export interface IFluidModuleWithDetails {
|
|
385
|
+
details: IFluidCodeDetails_2;
|
|
386
|
+
module: IFluidModule;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// @public
|
|
390
|
+
export interface IFluidPackage {
|
|
391
|
+
[key: string]: unknown;
|
|
392
|
+
fluid: {
|
|
393
|
+
[environment: string]: undefined | IFluidPackageEnvironment;
|
|
394
|
+
};
|
|
395
|
+
name: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// @public
|
|
399
|
+
export interface IFluidPackageEnvironment {
|
|
400
|
+
[target: string]: undefined | {
|
|
401
|
+
files: string[];
|
|
402
|
+
[key: string]: unknown;
|
|
403
|
+
};
|
|
357
404
|
}
|
|
358
405
|
|
|
359
406
|
// @public @deprecated (undocumented)
|
|
@@ -377,7 +424,7 @@ export interface IGenericError extends IErrorBase {
|
|
|
377
424
|
|
|
378
425
|
// @public
|
|
379
426
|
export interface IHostLoader extends ILoader {
|
|
380
|
-
createDetachedContainer(codeDetails:
|
|
427
|
+
createDetachedContainer(codeDetails: IFluidCodeDetails_2): Promise<IContainer>;
|
|
381
428
|
rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;
|
|
382
429
|
}
|
|
383
430
|
|
|
@@ -427,6 +474,12 @@ export interface IProvideDeltaSender {
|
|
|
427
474
|
readonly IDeltaSender: IDeltaSender;
|
|
428
475
|
}
|
|
429
476
|
|
|
477
|
+
// @public (undocumented)
|
|
478
|
+
export interface IProvideFluidCodeDetailsComparer {
|
|
479
|
+
// (undocumented)
|
|
480
|
+
readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
|
|
481
|
+
}
|
|
482
|
+
|
|
430
483
|
// @public @deprecated (undocumented)
|
|
431
484
|
export interface IProvideFluidTokenProvider {
|
|
432
485
|
// (undocumented)
|
|
@@ -452,8 +505,8 @@ export interface IProxyLoaderFactory {
|
|
|
452
505
|
}
|
|
453
506
|
|
|
454
507
|
// @public
|
|
455
|
-
export interface IResolvedFluidCodeDetails extends
|
|
456
|
-
readonly resolvedPackage: Readonly<
|
|
508
|
+
export interface IResolvedFluidCodeDetails extends IFluidCodeDetails_2 {
|
|
509
|
+
readonly resolvedPackage: Readonly<IFluidPackage_2>;
|
|
457
510
|
readonly resolvedPackageCacheId: string | undefined;
|
|
458
511
|
}
|
|
459
512
|
|
|
@@ -480,6 +533,12 @@ export interface IRuntimeFactory extends IProvideRuntimeFactory {
|
|
|
480
533
|
// @public
|
|
481
534
|
export const isFluidBrowserPackage: (maybePkg: any) => maybePkg is Readonly<IFluidBrowserPackage>;
|
|
482
535
|
|
|
536
|
+
// @public (undocumented)
|
|
537
|
+
export const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
|
|
538
|
+
|
|
539
|
+
// @public
|
|
540
|
+
export const isFluidPackage: (pkg: any) => pkg is Readonly<IFluidPackage>;
|
|
541
|
+
|
|
483
542
|
// @public
|
|
484
543
|
export interface IThrottlingWarning extends IErrorBase {
|
|
485
544
|
// (undocumented)
|
package/dist/deltas.d.ts
CHANGED
|
@@ -14,10 +14,6 @@ export interface IConnectionDetails {
|
|
|
14
14
|
mode: ConnectionMode;
|
|
15
15
|
version: string;
|
|
16
16
|
initialClients: ISignalClient[];
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated - please use `serviceConfiguration.maxMessageSize`
|
|
19
|
-
*/
|
|
20
|
-
maxMessageSize: number;
|
|
21
17
|
serviceConfiguration: IClientConfiguration;
|
|
22
18
|
/**
|
|
23
19
|
* Last known sequence number to ordering service at the time of connection
|
|
@@ -119,22 +115,8 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
|
|
|
119
115
|
readonly serviceConfiguration: IClientConfiguration | undefined;
|
|
120
116
|
/** Flag to indicate whether the client can write or not. */
|
|
121
117
|
readonly active: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Tells if container is in read-only mode.
|
|
124
|
-
* Data stores should listen for "readonly" notifications and disallow user making changes to data stores.
|
|
125
|
-
* Readonly state can be because of no storage write permission,
|
|
126
|
-
* or due to host forcing readonly mode for container.
|
|
127
|
-
*
|
|
128
|
-
* We do not differentiate here between no write access to storage vs. host disallowing changes to container -
|
|
129
|
-
* in all cases container runtime and data stores should respect readonly state and not allow local changes.
|
|
130
|
-
*
|
|
131
|
-
* It is undefined if we have not yet established websocket connection
|
|
132
|
-
* and do not know if user has write access to a file.
|
|
133
|
-
* @deprecated - use readOnlyInfo
|
|
134
|
-
*/
|
|
135
|
-
readonly readonly?: boolean;
|
|
136
118
|
readonly readOnlyInfo: ReadOnlyInfo;
|
|
137
|
-
/**
|
|
119
|
+
/** @deprecated - Use Container.close() or IContainerContext.closeFn() */
|
|
138
120
|
close(): void;
|
|
139
121
|
/** Submit a signal to the service to be broadcast to other connected clients, but not persisted */
|
|
140
122
|
submitSignal(content: any): void;
|
package/dist/deltas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EACf,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM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,OAAE;IACpD;;;OAGG;IACH,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,OAAE;CACxE;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW;IACrF;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;OAEG;IACH,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,CAAC,EAAE,CAAC;IAEf,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED,oBAAY,YAAY,GAAG;IACvB,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;CACxC,GAAG;IACA,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAC"}
|
package/dist/deltas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;GAEG;AACU,QAAA,YAAY,GAA8B,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n interface IFluidObject {\n /** @deprecated - use `FluidObject<IDeltaSender>` instead */\n readonly IDeltaSender?: IDeltaSender\n }\n}\n\n/**\n * @deprecated - This will be removed in a later release.\n */\nexport const IDeltaSender: keyof IProvideDeltaSender = \"IDeltaSender\";\n\n/**\n * @deprecated - This will be removed in a later release.\n */\nexport interface IProvideDeltaSender {\n /**\n * @deprecated - This will be removed in a later release.\n */\n readonly IDeltaSender: IDeltaSender;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender extends IProvideDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** @deprecated - Use Container.close() or IContainerContext.closeFn() */\n close(): void;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n waitTillProcessingDone(): Promise<void>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
|
package/dist/error.d.ts
CHANGED
|
@@ -26,7 +26,11 @@ export declare enum ContainerErrorType {
|
|
|
26
26
|
/**
|
|
27
27
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
28
28
|
*/
|
|
29
|
-
usageError = "usageError"
|
|
29
|
+
usageError = "usageError",
|
|
30
|
+
/**
|
|
31
|
+
* Error indicating an client session has expired.
|
|
32
|
+
*/
|
|
33
|
+
clientSessionExpiredError = "clientSessionExpiredError"
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* Base interface for all errors and warnings at container level
|
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;GAEG;AACH,oBAAY,kBAAkB;IAC1B;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACF,UAAU,eAAe;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;GAEG;AACH,oBAAY,kBAAkB;IAC1B;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACF,UAAU,eAAe;IAE1B;;OAEG;IACH,yBAAyB,8BAA8B;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,qBAAqB;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,sBAAsB,CAAC,IAAI,oBAAoB,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,oBAAY,uBAAuB,GAAG,UAAU,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC7C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC;IACpD,KAAK,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;GAEG;AACF,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC5C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,UAAU,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IAClD,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,eAAe,CAAC;IACvD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACtC"}
|
package/dist/error.js
CHANGED
|
@@ -30,5 +30,9 @@ var ContainerErrorType;
|
|
|
30
30
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
31
31
|
*/
|
|
32
32
|
ContainerErrorType["usageError"] = "usageError";
|
|
33
|
+
/**
|
|
34
|
+
* Error indicating an client session has expired.
|
|
35
|
+
*/
|
|
36
|
+
ContainerErrorType["clientSessionExpiredError"] = "clientSessionExpiredError";
|
|
33
37
|
})(ContainerErrorType = exports.ContainerErrorType || (exports.ContainerErrorType = {}));
|
|
34
38
|
//# sourceMappingURL=error.js.map
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,kBA8BX;AA9BD,WAAY,kBAAkB;IAC1B;;OAEG;IACH,mDAA6B,CAAA;IAE7B;;OAEG;IACH,yDAAmC,CAAA;IAEnC;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACF,+CAAyB,CAAA;IAE1B;;OAEG;IACH,6EAAuD,CAAA;AAC3D,CAAC,EA9BW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA8B7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\n\n/**\n * Different error types the Container may report out to the Host\n */\nexport enum ContainerErrorType {\n /**\n * Some error, most likely an exception caught by runtime and propagated to container as critical error\n */\n genericError = \"genericError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n */\n dataCorruptionError = \"dataCorruptionError\",\n\n /**\n * Error encountered when processing an operation. May correlate with data corruption.\n */\n dataProcessingError = \"dataProcessingError\",\n\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\n usageError = \"usageError\",\n\n /**\n * Error indicating an client session has expired.\n */\n clientSessionExpiredError = \"clientSessionExpiredError\",\n}\n\n/**\n * Base interface for all errors and warnings at container level\n */\nexport interface IErrorBase extends Partial<Error> {\n /** errorType is a union of error types from\n * - container\n * - runtime\n * - drivers\n */\n readonly errorType: string;\n\n /**\n * See Error.message\n * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n */\n readonly message: string;\n /** See Error.name */\n readonly name?: string;\n /** See Error.stack */\n readonly stack?: string;\n /**\n * Returns all properties of this error object that are either safe to log\n * or explicitly tagged as containing privacy-sensitive data.\n */\n getTelemetryProperties?(): ITelemetryProperties;\n}\n\n/**\n * Represents warnings raised on container.\n */\nexport interface ContainerWarning extends IErrorBase {\n /**\n * Whether this error has already been logged. Used to avoid logging errors twice.\n * Default is false.\n */\n logged?: boolean;\n}\n\n/**\n * Represents errors raised on container.\n */\nexport type ICriticalContainerError = IErrorBase;\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n readonly errorType: ContainerErrorType.genericError;\n error?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\n export interface IUsageError extends IErrorBase {\n readonly errorType: ContainerErrorType.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n readonly errorType: ContainerErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Specifies an environment on Fluid property of a IFluidPackage
|
|
7
|
+
*/
|
|
8
|
+
export interface IFluidPackageEnvironment {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the target. For a browser environment, this could be umd for scripts
|
|
11
|
+
* or css for styles.
|
|
12
|
+
*/
|
|
13
|
+
[target: string]: undefined | {
|
|
14
|
+
/**
|
|
15
|
+
* List of files for the target. These can be relative or absolute.
|
|
16
|
+
* The code loader should resolve relative paths, and validate all
|
|
17
|
+
* full urls.
|
|
18
|
+
*/
|
|
19
|
+
files: string[];
|
|
20
|
+
/**
|
|
21
|
+
* General access for extended fields as specific usages will
|
|
22
|
+
* likely have additional infornamation like a definition
|
|
23
|
+
* of Library, the entrypoint for umd packages
|
|
24
|
+
*/
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Fluid-specific properties expected on a package to be loaded by the code loader.
|
|
30
|
+
* While compatible with the npm package format it is not necessary that that package is an
|
|
31
|
+
* npm package:
|
|
32
|
+
* {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}
|
|
33
|
+
*/
|
|
34
|
+
export interface IFluidPackage {
|
|
35
|
+
/**
|
|
36
|
+
* The name of the package that this code represnets
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* This object represents the Fluid specific properties of the package
|
|
41
|
+
*/
|
|
42
|
+
fluid: {
|
|
43
|
+
/**
|
|
44
|
+
* The name of the of the environment. This should be something like browser, or node
|
|
45
|
+
* and contain the necessary targets for loading this code in that environment.
|
|
46
|
+
*/
|
|
47
|
+
[environment: string]: undefined | IFluidPackageEnvironment;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* General access for extended fields as specific usages will
|
|
51
|
+
* likely have additional infornamation like a definition of
|
|
52
|
+
* compatible versions, or deployment information like rings or rollouts.
|
|
53
|
+
*/
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if the package.json defines a Fluid package
|
|
58
|
+
* @param pkg - the package json data to check if it is a Fluid package.
|
|
59
|
+
*/
|
|
60
|
+
export declare const isFluidPackage: (pkg: any) => pkg is Readonly<IFluidPackage>;
|
|
61
|
+
/**
|
|
62
|
+
* Package manager configuration. Provides a key value mapping of config values
|
|
63
|
+
*/
|
|
64
|
+
export interface IFluidCodeDetailsConfig {
|
|
65
|
+
readonly [key: string]: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Data structure used to describe the code to load on the Fluid document
|
|
69
|
+
*/
|
|
70
|
+
export interface IFluidCodeDetails {
|
|
71
|
+
/**
|
|
72
|
+
* The code package to be used on the Fluid document. This is either the package name which will be loaded
|
|
73
|
+
* from a package manager. Or the expanded Fluid package.
|
|
74
|
+
*/
|
|
75
|
+
readonly package: string | Readonly<IFluidPackage>;
|
|
76
|
+
/**
|
|
77
|
+
* Configuration details. This includes links to the package manager and base CDNs.
|
|
78
|
+
*/
|
|
79
|
+
readonly config?: IFluidCodeDetailsConfig;
|
|
80
|
+
}
|
|
81
|
+
export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
|
|
82
|
+
export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
|
|
83
|
+
export interface IProvideFluidCodeDetailsComparer {
|
|
84
|
+
readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Provides capability to compare Fluid code details.
|
|
88
|
+
*/
|
|
89
|
+
export interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
|
|
90
|
+
/**
|
|
91
|
+
* Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.
|
|
92
|
+
*
|
|
93
|
+
* Similar semantics to:
|
|
94
|
+
* {@link https://github.com/npm/node-semver#usage}
|
|
95
|
+
*/
|
|
96
|
+
satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Return a number representing the ascending sort order of the `a` and `b` code details;
|
|
99
|
+
* `< 0` if `a < b`.
|
|
100
|
+
* `= 0` if `a === b`.
|
|
101
|
+
* `> 0` if `a > b`.
|
|
102
|
+
* `undefined` if `a` is not comparable to `b`.
|
|
103
|
+
*
|
|
104
|
+
* Similar semantics to:
|
|
105
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}
|
|
106
|
+
*/
|
|
107
|
+
compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=fluidPackage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidP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,CAAC,OAAO,CAAC,CAAC;IAGzF;;;;;;;;;OASG;IACH,OAAO,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAEpF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluidPackage = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Check if the package.json defines a Fluid package
|
|
10
|
+
* @param pkg - the package json data to check if it is a Fluid package.
|
|
11
|
+
*/
|
|
12
|
+
const isFluidPackage = (pkg) => typeof pkg === "object"
|
|
13
|
+
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string"
|
|
14
|
+
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
15
|
+
exports.isFluidPackage = isFluidPackage;
|
|
16
|
+
const isFluidCodeDetails = (details) => {
|
|
17
|
+
const maybeCodeDetails = details;
|
|
18
|
+
return typeof maybeCodeDetails === "object"
|
|
19
|
+
&& (typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package) === "string" || exports.isFluidPackage(maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package))
|
|
20
|
+
&& ((maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === undefined || typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === "object");
|
|
21
|
+
};
|
|
22
|
+
exports.isFluidCodeDetails = isFluidCodeDetails;
|
|
23
|
+
exports.IFluidCodeDetailsComparer = "IFluidCodeDetailsComparer";
|
|
24
|
+
//# sourceMappingURL=fluidPackage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CACvE,OAAO,GAAG,KAAK,QAAQ;OACpB,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ;OAC7B,QAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AAHzB,QAAA,cAAc,kBAGW;AAyB/B,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC3F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,OAAO,gBAAgB,KAAK,QAAQ;WACpC,CAAC,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ,IAAI,sBAAc,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;WAC5F,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,QAAO,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CAAC;AACpG,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEW,QAAA,yBAAyB,GAA2C,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n /**\n * Specifies an environment on Fluid property of a IFluidPackage\n */\nexport interface IFluidPackageEnvironment {\n\n /**\n * The name of the target. For a browser environment, this could be umd for scripts\n * or css for styles.\n */\n [target: string]: undefined | {\n /**\n * List of files for the target. These can be relative or absolute.\n * The code loader should resolve relative paths, and validate all\n * full urls.\n */\n files: string[];\n\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition\n * of Library, the entrypoint for umd packages\n */\n [key: string]: unknown;\n }\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n /**\n * The name of the package that this code represnets\n */\n name: string;\n /**\n * This object represents the Fluid specific properties of the package\n */\n fluid: {\n /**\n * The name of the of the environment. This should be something like browser, or node\n * and contain the necessary targets for loading this code in that environment.\n */\n [environment: string]: undefined | IFluidPackageEnvironment;\n };\n /**\n * General access for extended fields as specific usages will\n * likely have additional infornamation like a definition of\n * compatible versions, or deployment information like rings or rollouts.\n */\n [key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n typeof pkg === \"object\"\n && typeof pkg?.name === \"string\"\n && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n readonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n /**\n * The code package to be used on the Fluid document. This is either the package name which will be loaded\n * from a package manager. Or the expanded Fluid package.\n */\n readonly package: string | Readonly<IFluidPackage>;\n\n /**\n * Configuration details. This includes links to the package manager and base CDNs.\n */\n readonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> =>{\n const maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n return typeof maybeCodeDetails === \"object\"\n && (typeof maybeCodeDetails?.package === \"string\" || isFluidPackage(maybeCodeDetails?.package))\n && (maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\");\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer = \"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer ;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\n /**\n * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n *\n * Similar semantics to:\n * {@link https://github.com/npm/node-semver#usage}\n */\n satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n/* eslint-disable max-len */\n /**\n * Return a number representing the ascending sort order of the `a` and `b` code details;\n * `< 0` if `a < b`.\n * `= 0` if `a === b`.\n * `> 0` if `a > b`.\n * `undefined` if `a` is not comparable to `b`.\n *\n * Similar semantics to:\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description | Array.sort}\n */\n compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n/* eslint-enable max-len */\n}\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./deltas"), exports);
|
|
|
22
22
|
__exportStar(require("./error"), exports);
|
|
23
23
|
__exportStar(require("./loader"), exports);
|
|
24
24
|
__exportStar(require("./fluidModule"), exports);
|
|
25
|
+
__exportStar(require("./fluidPackage"), exports);
|
|
25
26
|
__exportStar(require("./proxyLoader"), exports);
|
|
26
27
|
__exportStar(require("./runtime"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;GAGG;AACH,6CAA2B;AAC3B,mDAAiC;AACjC,sDAAsD;AACtD,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,gDAA8B;AAC9B,4CAA0B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nexport * from \"./audience\";\nexport * from \"./browserPackage\";\n// eslint-disable-next-line import/no-internal-modules\nexport * from \"./legacy/chaincode\";\nexport * from \"./deltas\";\nexport * from \"./error\";\nexport * from \"./loader\";\nexport * from \"./fluidModule\";\nexport * from \"./proxyLoader\";\nexport * from \"./runtime\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;GAGG;AACH,6CAA2B;AAC3B,mDAAiC;AACjC,sDAAsD;AACtD,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,4CAA0B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nexport * from \"./audience\";\nexport * from \"./browserPackage\";\n// eslint-disable-next-line import/no-internal-modules\nexport * from \"./legacy/chaincode\";\nexport * from \"./deltas\";\nexport * from \"./error\";\nexport * from \"./loader\";\nexport * from \"./fluidModule\";\nexport * from \"./fluidPackage\";\nexport * from \"./proxyLoader\";\nexport * from \"./runtime\";\n"]}
|