@fluidframework/container-loader 2.62.0-356644 → 2.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/api-extractor/api-extractor-lint-legacyAlpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacyAlpha.esm.json +5 -0
- package/api-extractor/api-extractor.legacy.json +5 -1
- package/api-report/container-loader.legacy.alpha.api.md +212 -0
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +8 -72
- package/dist/connectionManager.js.map +1 -1
- package/dist/container.d.ts +9 -4
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +9 -1
- package/dist/container.js.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +48 -0
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.js +14 -1
- package/dist/createAndLoadContainerUtils.js.map +1 -1
- package/dist/frozenServices.d.ts +44 -0
- package/dist/frozenServices.d.ts.map +1 -0
- package/dist/frozenServices.js +126 -0
- package/dist/frozenServices.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacyAlpha.d.ts +48 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/legacy/alpha.d.ts +11 -0
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +10 -74
- package/lib/connectionManager.js.map +1 -1
- package/lib/container.d.ts +9 -4
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +7 -0
- package/lib/container.js.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +48 -0
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.js +12 -0
- package/lib/createAndLoadContainerUtils.js.map +1 -1
- package/lib/frozenServices.d.ts +44 -0
- package/lib/frozenServices.d.ts.map +1 -0
- package/lib/frozenServices.js +120 -0
- package/lib/frozenServices.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacyAlpha.d.ts +48 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +26 -14
- package/src/connectionManager.ts +10 -92
- package/src/container.ts +12 -4
- package/src/createAndLoadContainerUtils.ts +66 -0
- package/src/frozenServices.ts +162 -0
- package/src/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/legacyAlpha.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/legacyAlpha.d.ts"
|
|
5
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json"
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/legacyAlpha.d.ts",
|
|
5
|
+
"apiReport": {
|
|
6
|
+
"reportVariants": ["public", "beta", "alpha"]
|
|
7
|
+
}
|
|
4
8
|
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
## Alpha API Report File for "@fluidframework/container-loader"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @alpha @legacy
|
|
8
|
+
export function asLegacyAlpha(base: IContainer): ContainerAlpha;
|
|
9
|
+
|
|
10
|
+
// @public
|
|
11
|
+
export enum ConnectionState {
|
|
12
|
+
CatchingUp = 1,
|
|
13
|
+
Connected = 2,
|
|
14
|
+
Disconnected = 0,
|
|
15
|
+
EstablishingConnection = 3
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// @alpha @sealed @legacy
|
|
19
|
+
export interface ContainerAlpha extends IContainer {
|
|
20
|
+
getPendingLocalState(): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// @beta @legacy
|
|
24
|
+
export function createDetachedContainer(createDetachedContainerProps: ICreateDetachedContainerProps): Promise<IContainer>;
|
|
25
|
+
|
|
26
|
+
// @beta @legacy (undocumented)
|
|
27
|
+
export interface IBaseProtocolHandler {
|
|
28
|
+
// (undocumented)
|
|
29
|
+
readonly attributes: IDocumentAttributes;
|
|
30
|
+
// (undocumented)
|
|
31
|
+
close(): void;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
getProtocolState(): IScribeProtocolState;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
processMessage(message: ISequencedDocumentMessage, local: boolean): IProcessMessageResult;
|
|
36
|
+
// (undocumented)
|
|
37
|
+
readonly quorum: IQuorum;
|
|
38
|
+
// (undocumented)
|
|
39
|
+
setConnectionState(connected: boolean, clientId: string | undefined): any;
|
|
40
|
+
// (undocumented)
|
|
41
|
+
snapshot(): IQuorumSnapshot;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// @beta @deprecated @legacy (undocumented)
|
|
45
|
+
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
|
|
46
|
+
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// @beta @legacy
|
|
50
|
+
export interface ICreateAndLoadContainerProps {
|
|
51
|
+
readonly allowReconnect?: boolean | undefined;
|
|
52
|
+
readonly clientDetailsOverride?: IClientDetails | undefined;
|
|
53
|
+
readonly codeLoader: ICodeDetailsLoader_2;
|
|
54
|
+
readonly configProvider?: IConfigProviderBase | undefined;
|
|
55
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
56
|
+
readonly logger?: ITelemetryBaseLogger | undefined;
|
|
57
|
+
readonly options?: IContainerPolicies | undefined;
|
|
58
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;
|
|
59
|
+
readonly scope?: FluidObject | undefined;
|
|
60
|
+
readonly urlResolver: IUrlResolver;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// @beta @legacy
|
|
64
|
+
export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {
|
|
65
|
+
readonly codeDetails: IFluidCodeDetails;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// @beta @deprecated @legacy (undocumented)
|
|
69
|
+
export interface IFluidModuleWithDetails {
|
|
70
|
+
details: IFluidCodeDetails;
|
|
71
|
+
module: IFluidModule;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// @beta @legacy
|
|
75
|
+
export interface ILoaderProps {
|
|
76
|
+
readonly codeLoader: ICodeDetailsLoader;
|
|
77
|
+
readonly configProvider?: IConfigProviderBase;
|
|
78
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
79
|
+
readonly logger?: ITelemetryBaseLogger;
|
|
80
|
+
readonly options?: ILoaderOptions;
|
|
81
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
82
|
+
readonly scope?: FluidObject;
|
|
83
|
+
readonly urlResolver: IUrlResolver;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// @beta @legacy
|
|
87
|
+
export interface ILoaderServices {
|
|
88
|
+
readonly codeLoader: ICodeDetailsLoader;
|
|
89
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
90
|
+
readonly options: ILoaderOptions;
|
|
91
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
|
92
|
+
readonly scope: FluidObject;
|
|
93
|
+
readonly subLogger: ITelemetryLoggerExt;
|
|
94
|
+
readonly urlResolver: IUrlResolver;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// @beta @legacy
|
|
98
|
+
export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {
|
|
99
|
+
readonly pendingLocalState?: string | undefined;
|
|
100
|
+
readonly request: IRequest;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// @alpha @legacy
|
|
104
|
+
export interface ILoadFrozenContainerFromPendingStateProps {
|
|
105
|
+
readonly clientDetailsOverride?: IClientDetails | undefined;
|
|
106
|
+
readonly codeLoader: ICodeDetailsLoader_2;
|
|
107
|
+
readonly configProvider?: IConfigProviderBase | undefined;
|
|
108
|
+
readonly logger?: ITelemetryBaseLogger | undefined;
|
|
109
|
+
readonly options?: IContainerPolicies | undefined;
|
|
110
|
+
readonly pendingLocalState: string;
|
|
111
|
+
readonly request: IRequest;
|
|
112
|
+
readonly scope?: FluidObject | undefined;
|
|
113
|
+
readonly urlResolver: IUrlResolver;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// @beta @legacy
|
|
117
|
+
export interface IParsedUrl {
|
|
118
|
+
id: string;
|
|
119
|
+
path: string;
|
|
120
|
+
query: string;
|
|
121
|
+
version: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// @beta @legacy (undocumented)
|
|
125
|
+
export interface IProtocolHandler extends IBaseProtocolHandler {
|
|
126
|
+
// (undocumented)
|
|
127
|
+
readonly audience: IAudienceOwner;
|
|
128
|
+
// (undocumented)
|
|
129
|
+
processSignal(message: ISignalMessage): any;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// @beta @legacy
|
|
133
|
+
export interface IQuorumSnapshot {
|
|
134
|
+
// (undocumented)
|
|
135
|
+
members: QuorumClientsSnapshot;
|
|
136
|
+
// (undocumented)
|
|
137
|
+
proposals: QuorumProposalsSnapshot["proposals"];
|
|
138
|
+
// (undocumented)
|
|
139
|
+
values: QuorumProposalsSnapshot["values"];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// @beta @legacy
|
|
143
|
+
export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {
|
|
144
|
+
readonly serializedState: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// @beta @legacy (undocumented)
|
|
148
|
+
export interface IScribeProtocolState {
|
|
149
|
+
// (undocumented)
|
|
150
|
+
members: [string, ISequencedClient][];
|
|
151
|
+
// (undocumented)
|
|
152
|
+
minimumSequenceNumber: number;
|
|
153
|
+
// (undocumented)
|
|
154
|
+
proposals: [number, ISequencedProposal, string[]][];
|
|
155
|
+
// (undocumented)
|
|
156
|
+
sequenceNumber: number;
|
|
157
|
+
// (undocumented)
|
|
158
|
+
values: [string, ICommittedProposal][];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// @beta @legacy
|
|
162
|
+
export class Loader implements IHostLoader {
|
|
163
|
+
constructor(loaderProps: ILoaderProps);
|
|
164
|
+
// (undocumented)
|
|
165
|
+
createDetachedContainer(codeDetails: IFluidCodeDetails, createDetachedProps?: {
|
|
166
|
+
canReconnect?: boolean;
|
|
167
|
+
clientDetailsOverride?: IClientDetails;
|
|
168
|
+
}): Promise<IContainer>;
|
|
169
|
+
// (undocumented)
|
|
170
|
+
rehydrateDetachedContainerFromSnapshot(snapshot: string, createDetachedProps?: {
|
|
171
|
+
canReconnect?: boolean;
|
|
172
|
+
clientDetailsOverride?: IClientDetails;
|
|
173
|
+
}): Promise<IContainer>;
|
|
174
|
+
// (undocumented)
|
|
175
|
+
resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
|
|
176
|
+
// (undocumented)
|
|
177
|
+
readonly services: ILoaderServices;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// @beta @legacy
|
|
181
|
+
export function loadExistingContainer(loadExistingContainerProps: ILoadExistingContainerProps): Promise<IContainer>;
|
|
182
|
+
|
|
183
|
+
// @alpha @legacy
|
|
184
|
+
export function loadFrozenContainerFromPendingState(props: ILoadFrozenContainerFromPendingStateProps): Promise<IContainer>;
|
|
185
|
+
|
|
186
|
+
// @beta @legacy
|
|
187
|
+
export type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;
|
|
188
|
+
|
|
189
|
+
// @beta @legacy
|
|
190
|
+
export type QuorumClientsSnapshot = [string, ISequencedClient][];
|
|
191
|
+
|
|
192
|
+
// @beta @legacy
|
|
193
|
+
export type QuorumProposalsSnapshot = {
|
|
194
|
+
proposals: [number, ISequencedProposal, string[]][];
|
|
195
|
+
values: [string, ICommittedProposal][];
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// @beta @legacy
|
|
199
|
+
export function rehydrateDetachedContainer(rehydrateDetachedContainerProps: IRehydrateDetachedContainerProps): Promise<IContainer>;
|
|
200
|
+
|
|
201
|
+
// @beta @legacy
|
|
202
|
+
export function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
|
|
203
|
+
|
|
204
|
+
// @beta @legacy
|
|
205
|
+
export function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefined;
|
|
206
|
+
|
|
207
|
+
// @beta @legacy
|
|
208
|
+
export function waitContainerToCatchUp(container: IContainer): Promise<boolean>;
|
|
209
|
+
|
|
210
|
+
// (No @packageDocumentation comment for this package)
|
|
211
|
+
|
|
212
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionManager.d.ts","sourceRoot":"","sources":["../src/connectionManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"connectionManager.d.ts","sourceRoot":"","sources":["../src/connectionManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,wBAAwB,EAAY,MAAM,iCAAiC,CAAC;AAE1F,OAAO,KAAK,EACX,cAAc,EACd,OAAO,EACP,cAAc,EACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEN,KAAK,gBAAgB,EAGrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAOrB,KAAK,yBAAyB,EAE9B,MAAM,6CAA6C,CAAC;AAYrD,OAAO,EACN,KAAK,mBAAmB,EAOxB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,aAAa,EACb,MAAM,gBAAgB,CAAC;AAsDxB;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAmN1D,OAAO,CAAC,QAAQ,CAAC,eAAe;aAChB,cAAc,EAAE,MAAM,OAAO;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB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AS;IA8DhB,oBAAoB,CAC1B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GACrD,gBAAgB,GAAG,SAAS;IAuCxB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ5D,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI;IA+BhD,0BAA0B,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAgD3E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAMxB;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAG5B;IAGF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAkB1B;IAGF,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAIxC;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAE3B;CACF"}
|
|
@@ -13,6 +13,7 @@ const internal_3 = require("@fluidframework/driver-utils/internal");
|
|
|
13
13
|
const internal_4 = require("@fluidframework/telemetry-utils/internal");
|
|
14
14
|
const contracts_js_1 = require("./contracts.js");
|
|
15
15
|
const deltaQueue_js_1 = require("./deltaQueue.js");
|
|
16
|
+
const frozenServices_js_1 = require("./frozenServices.js");
|
|
16
17
|
const protocol_js_1 = require("./protocol.js");
|
|
17
18
|
const utils_js_1 = require("./utils.js");
|
|
18
19
|
// We double this value in first try in when we calculate time to wait for in "calculateMaxWaitTime" function.
|
|
@@ -25,73 +26,6 @@ function getNackReconnectInfo(nackContent) {
|
|
|
25
26
|
const retryAfterMs = nackContent.retryAfter === undefined ? undefined : nackContent.retryAfter * 1000;
|
|
26
27
|
return (0, internal_3.createGenericNetworkError)(message, { canRetry, retryAfterMs }, { statusCode: nackContent.code, driverVersion: undefined });
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Implementation of IDocumentDeltaConnection that does not support submitting
|
|
30
|
-
* or receiving ops. Used in storage-only mode.
|
|
31
|
-
*/
|
|
32
|
-
const clientNoDeltaStream = {
|
|
33
|
-
mode: "read",
|
|
34
|
-
details: { capabilities: { interactive: true } },
|
|
35
|
-
permission: [],
|
|
36
|
-
user: { id: "storage-only client" }, // we need some "fake" ID here.
|
|
37
|
-
scopes: [],
|
|
38
|
-
};
|
|
39
|
-
const clientIdNoDeltaStream = "storage-only client";
|
|
40
|
-
class NoDeltaStream extends client_utils_1.TypedEventEmitter {
|
|
41
|
-
/**
|
|
42
|
-
* Connection which is not connected to socket.
|
|
43
|
-
* @param storageOnlyReason - Reason on why the connection to delta stream is not allowed.
|
|
44
|
-
* @param readonlyConnectionReason - reason/error if any which lead to using NoDeltaStream.
|
|
45
|
-
*/
|
|
46
|
-
constructor(storageOnlyReason, readonlyConnectionReason) {
|
|
47
|
-
super();
|
|
48
|
-
this.storageOnlyReason = storageOnlyReason;
|
|
49
|
-
this.readonlyConnectionReason = readonlyConnectionReason;
|
|
50
|
-
this.clientId = clientIdNoDeltaStream;
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
52
|
-
this.claims = {
|
|
53
|
-
scopes: [internal_2.ScopeType.DocRead],
|
|
54
|
-
};
|
|
55
|
-
this.mode = "read";
|
|
56
|
-
this.existing = true;
|
|
57
|
-
this.maxMessageSize = 0;
|
|
58
|
-
this.version = "";
|
|
59
|
-
this.initialMessages = [];
|
|
60
|
-
this.initialSignals = [];
|
|
61
|
-
this.initialClients = [
|
|
62
|
-
{ client: clientNoDeltaStream, clientId: clientIdNoDeltaStream },
|
|
63
|
-
];
|
|
64
|
-
this.serviceConfiguration = {
|
|
65
|
-
maxMessageSize: 0,
|
|
66
|
-
blockSize: 0,
|
|
67
|
-
};
|
|
68
|
-
this.checkpointSequenceNumber = undefined;
|
|
69
|
-
this._disposed = false;
|
|
70
|
-
}
|
|
71
|
-
submit(messages) {
|
|
72
|
-
this.emit("nack", this.clientId, messages.map((operation) => {
|
|
73
|
-
return {
|
|
74
|
-
operation,
|
|
75
|
-
content: { message: "Cannot submit with storage-only connection", code: 403 },
|
|
76
|
-
};
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
submitSignal(message) {
|
|
80
|
-
this.emit("nack", this.clientId, {
|
|
81
|
-
operation: message,
|
|
82
|
-
content: { message: "Cannot submit signal with storage-only connection", code: 403 },
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
get disposed() {
|
|
86
|
-
return this._disposed;
|
|
87
|
-
}
|
|
88
|
-
dispose() {
|
|
89
|
-
this._disposed = true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function isNoDeltaStreamConnection(connection) {
|
|
93
|
-
return connection instanceof NoDeltaStream;
|
|
94
|
-
}
|
|
95
29
|
const waitForOnline = async () => {
|
|
96
30
|
// Only wait if we have a strong signal that we're offline - otherwise assume we're online.
|
|
97
31
|
if (globalThis.navigator?.onLine === false && globalThis.addEventListener !== undefined) {
|
|
@@ -200,7 +134,7 @@ class ConnectionManager {
|
|
|
200
134
|
get readOnlyInfo() {
|
|
201
135
|
let storageOnly = false;
|
|
202
136
|
let storageOnlyReason;
|
|
203
|
-
if (
|
|
137
|
+
if ((0, frozenServices_js_1.isFrozenDeltaStreamConnection)(this.connection)) {
|
|
204
138
|
storageOnly = true;
|
|
205
139
|
storageOnlyReason = this.connection.storageOnlyReason;
|
|
206
140
|
}
|
|
@@ -419,7 +353,7 @@ class ConnectionManager {
|
|
|
419
353
|
this.props.establishConnectionHandler(reason);
|
|
420
354
|
let connection;
|
|
421
355
|
if (docService.policies?.storageOnly === true) {
|
|
422
|
-
connection = new
|
|
356
|
+
connection = new frozenServices_js_1.FrozenDeltaStream();
|
|
423
357
|
this.setupNewSuccessfulConnection(connection, "read", reason);
|
|
424
358
|
(0, internal_1.assert)(this.pendingConnection === undefined, 0x2b3 /* "logic error" */);
|
|
425
359
|
return;
|
|
@@ -477,7 +411,7 @@ class ConnectionManager {
|
|
|
477
411
|
connected: connection !== undefined && connection.disposed === false,
|
|
478
412
|
}, undefined, core_interfaces_1.LogLevel.verbose);
|
|
479
413
|
if ((0, utils_js_1.isDeltaStreamConnectionForbiddenError)(origError)) {
|
|
480
|
-
connection = new
|
|
414
|
+
connection = new frozenServices_js_1.FrozenDeltaStream(origError.storageOnlyReason, {
|
|
481
415
|
text: origError.message,
|
|
482
416
|
error: origError,
|
|
483
417
|
});
|
|
@@ -488,7 +422,7 @@ class ConnectionManager {
|
|
|
488
422
|
origError.errorType === internal_2.DriverErrorTypes.outOfStorageError) {
|
|
489
423
|
// If we get out of storage error from calling joinsession, then use the NoDeltaStream object so
|
|
490
424
|
// that user can at least load the container.
|
|
491
|
-
connection = new
|
|
425
|
+
connection = new frozenServices_js_1.FrozenDeltaStream(undefined, {
|
|
492
426
|
text: origError.message,
|
|
493
427
|
error: origError,
|
|
494
428
|
});
|
|
@@ -680,7 +614,9 @@ class ConnectionManager {
|
|
|
680
614
|
});
|
|
681
615
|
}
|
|
682
616
|
(0, internal_1.assert)(!readonlyPermission || this.connectionMode === "read", 0x0e8 /* "readonly perf with write connection" */);
|
|
683
|
-
this.set_readonlyPermissions(readonlyPermission, oldReadonlyValue,
|
|
617
|
+
this.set_readonlyPermissions(readonlyPermission, oldReadonlyValue, (0, frozenServices_js_1.isFrozenDeltaStreamConnection)(connection)
|
|
618
|
+
? connection.readonlyConnectionReason
|
|
619
|
+
: undefined);
|
|
684
620
|
if (this._disposed) {
|
|
685
621
|
// Raise proper events, Log telemetry event and close connection.
|
|
686
622
|
this.disconnectFromDeltaStream({ text: "ConnectionManager already closed" });
|