@fluidframework/azure-client 2.101.1 → 2.103.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 +15 -0
- package/README.md +4 -4
- package/api-report/azure-client.beta.api.md +15 -1
- package/api-report/azure-client.legacy.beta.api.md +15 -1
- package/api-report/azure-client.legacy.public.api.md +15 -1
- package/api-report/azure-client.public.api.md +15 -1
- package/dist/AzureClient.d.ts +51 -3
- package/dist/AzureClient.d.ts.map +1 -1
- package/dist/AzureClient.js +15 -33
- package/dist/AzureClient.js.map +1 -1
- package/dist/interfaces.d.ts +4 -3
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/lib/AzureClient.d.ts +51 -3
- package/lib/AzureClient.d.ts.map +1 -1
- package/lib/AzureClient.js +16 -34
- package/lib/AzureClient.js.map +1 -1
- package/lib/interfaces.d.ts +4 -3
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/package.json +16 -15
- package/src/AzureClient.ts +102 -8
- package/src/interfaces.ts +4 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @fluidframework/azure-client
|
|
2
2
|
|
|
3
|
+
## 2.103.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.102.0
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Service client createContainer/getContainer overloads taking CompatibilityMode are deprecated ([#27212](https://github.com/microsoft/FluidFramework/pull/27212)) [3e951b4abf](https://github.com/microsoft/FluidFramework/commit/3e951b4abfc61ea78a3e3e4a891e34e374c76efb)
|
|
12
|
+
|
|
13
|
+
The `createContainer` and `getContainer` overloads on `AzureClient`, `OdspClient`, and `TinyliciousClient` (plus `AzureClient.viewContainerVersion`) that accept a [`CompatibilityMode`](https://fluidframework.com/docs/api/fluid-static/compatibilitymode-typealias) (`"1"` / `"2"`) argument are now deprecated.
|
|
14
|
+
Pass a [`MinimumVersionForCollab`](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias) SemVer string instead — it specifies the minimum collaborating client version directly.
|
|
15
|
+
|
|
16
|
+
See [issue #23289](https://github.com/microsoft/FluidFramework/issues/23289) for migration details and removal tracking.
|
|
17
|
+
|
|
3
18
|
## 2.101.0
|
|
4
19
|
|
|
5
20
|
Dependency updates only.
|
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ const schema = {
|
|
|
129
129
|
],
|
|
130
130
|
};
|
|
131
131
|
const azureClient = new AzureClient(props);
|
|
132
|
-
const { container, services } = await azureClient.createContainer(schema, "2" /*
|
|
132
|
+
const { container, services } = await azureClient.createContainer(schema, "2.100.0" /* minVersionForCollab */);
|
|
133
133
|
|
|
134
134
|
// Set any default data on the container's `initialObjects` before attaching
|
|
135
135
|
// Returned ID can be used to fetch the container via `getContainer` below
|
|
@@ -144,7 +144,7 @@ Using the `AzureClient` object the developer can create and get Fluid containers
|
|
|
144
144
|
import { AzureClient } from "@fluidframework/azure-client";
|
|
145
145
|
|
|
146
146
|
const azureClient = new AzureClient(props);
|
|
147
|
-
const { container, services } = await azureClient.getContainer("_unique-id_", schema, "2" /*
|
|
147
|
+
const { container, services } = await azureClient.getContainer("_unique-id_", schema, "2.100.0" /* minVersionForCollab */);
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
**Note:** When using the `AzureClient` with `tenantId` set to `"local"`, all containers that have been created will be deleted when the instance of the local Azure Fluid Relay service (not client) that was run from the terminal window is closed. However, any containers created when running against a remote Azure Fluid Relay service will be persisted. Container IDs **cannot** be reused between local and remote Azure Fluid Relay services to fetch back the same container.
|
|
@@ -166,7 +166,7 @@ const schema = {
|
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
// Fetch back the container that had been created earlier with the same ID and schema
|
|
169
|
-
const { container, services } = await azureClient.getContainer("_unique-id_", schema, "2" /*
|
|
169
|
+
const { container, services } = await azureClient.getContainer("_unique-id_", schema, "2.100.0" /* minVersionForCollab */);
|
|
170
170
|
|
|
171
171
|
// Get our list of initial objects that we had defined in the schema. initialObjects here will have the same signature
|
|
172
172
|
const initialObjects = container.initialObjects;
|
|
@@ -191,7 +191,7 @@ const schema = {
|
|
|
191
191
|
dynamicObjectTypes: [SharedString],
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
-
const { container, services } = await azureClient.getContainer("_unique-id_", schema, "2" /*
|
|
194
|
+
const { container, services } = await azureClient.getContainer("_unique-id_", schema, "2.100.0" /* minVersionForCollab */);
|
|
195
195
|
const map1 = container.initialObjects.map1;
|
|
196
196
|
|
|
197
197
|
const text1 = await container.create(SharedString);
|
|
@@ -7,15 +7,29 @@
|
|
|
7
7
|
// @public
|
|
8
8
|
export class AzureClient {
|
|
9
9
|
constructor(properties: AzureClientProps);
|
|
10
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
11
|
+
container: IFluidContainer<TContainerSchema>;
|
|
12
|
+
services: AzureContainerServices;
|
|
13
|
+
}>;
|
|
14
|
+
// @deprecated
|
|
10
15
|
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
11
16
|
container: IFluidContainer<TContainerSchema>;
|
|
12
17
|
services: AzureContainerServices;
|
|
13
18
|
}>;
|
|
19
|
+
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
20
|
+
container: IFluidContainer<TContainerSchema>;
|
|
21
|
+
services: AzureContainerServices;
|
|
22
|
+
}>;
|
|
23
|
+
// @deprecated
|
|
14
24
|
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
15
25
|
container: IFluidContainer<TContainerSchema>;
|
|
16
26
|
services: AzureContainerServices;
|
|
17
27
|
}>;
|
|
18
28
|
getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
|
|
29
|
+
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
30
|
+
container: IFluidContainer<TContainerSchema>;
|
|
31
|
+
}>;
|
|
32
|
+
// @deprecated
|
|
19
33
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
20
34
|
container: IFluidContainer<TContainerSchema>;
|
|
21
35
|
}>;
|
|
@@ -73,7 +87,7 @@ export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
|
|
|
73
87
|
type: "remote";
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
// @public
|
|
90
|
+
// @public @deprecated
|
|
77
91
|
export type CompatibilityMode = "1" | "2";
|
|
78
92
|
|
|
79
93
|
// @public
|
|
@@ -7,15 +7,29 @@
|
|
|
7
7
|
// @public
|
|
8
8
|
export class AzureClient {
|
|
9
9
|
constructor(properties: AzureClientProps);
|
|
10
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
11
|
+
container: IFluidContainer<TContainerSchema>;
|
|
12
|
+
services: AzureContainerServices;
|
|
13
|
+
}>;
|
|
14
|
+
// @deprecated
|
|
10
15
|
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
11
16
|
container: IFluidContainer<TContainerSchema>;
|
|
12
17
|
services: AzureContainerServices;
|
|
13
18
|
}>;
|
|
19
|
+
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
20
|
+
container: IFluidContainer<TContainerSchema>;
|
|
21
|
+
services: AzureContainerServices;
|
|
22
|
+
}>;
|
|
23
|
+
// @deprecated
|
|
14
24
|
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
15
25
|
container: IFluidContainer<TContainerSchema>;
|
|
16
26
|
services: AzureContainerServices;
|
|
17
27
|
}>;
|
|
18
28
|
getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
|
|
29
|
+
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
30
|
+
container: IFluidContainer<TContainerSchema>;
|
|
31
|
+
}>;
|
|
32
|
+
// @deprecated
|
|
19
33
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
20
34
|
container: IFluidContainer<TContainerSchema>;
|
|
21
35
|
}>;
|
|
@@ -73,7 +87,7 @@ export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
|
|
|
73
87
|
type: "remote";
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
// @public
|
|
90
|
+
// @public @deprecated
|
|
77
91
|
export type CompatibilityMode = "1" | "2";
|
|
78
92
|
|
|
79
93
|
// @public
|
|
@@ -7,15 +7,29 @@
|
|
|
7
7
|
// @public
|
|
8
8
|
export class AzureClient {
|
|
9
9
|
constructor(properties: AzureClientProps);
|
|
10
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
11
|
+
container: IFluidContainer<TContainerSchema>;
|
|
12
|
+
services: AzureContainerServices;
|
|
13
|
+
}>;
|
|
14
|
+
// @deprecated
|
|
10
15
|
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
11
16
|
container: IFluidContainer<TContainerSchema>;
|
|
12
17
|
services: AzureContainerServices;
|
|
13
18
|
}>;
|
|
19
|
+
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
20
|
+
container: IFluidContainer<TContainerSchema>;
|
|
21
|
+
services: AzureContainerServices;
|
|
22
|
+
}>;
|
|
23
|
+
// @deprecated
|
|
14
24
|
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
15
25
|
container: IFluidContainer<TContainerSchema>;
|
|
16
26
|
services: AzureContainerServices;
|
|
17
27
|
}>;
|
|
18
28
|
getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
|
|
29
|
+
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
30
|
+
container: IFluidContainer<TContainerSchema>;
|
|
31
|
+
}>;
|
|
32
|
+
// @deprecated
|
|
19
33
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
20
34
|
container: IFluidContainer<TContainerSchema>;
|
|
21
35
|
}>;
|
|
@@ -73,7 +87,7 @@ export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
|
|
|
73
87
|
type: "remote";
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
// @public
|
|
90
|
+
// @public @deprecated
|
|
77
91
|
export type CompatibilityMode = "1" | "2";
|
|
78
92
|
|
|
79
93
|
// @public
|
|
@@ -7,15 +7,29 @@
|
|
|
7
7
|
// @public
|
|
8
8
|
export class AzureClient {
|
|
9
9
|
constructor(properties: AzureClientProps);
|
|
10
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
11
|
+
container: IFluidContainer<TContainerSchema>;
|
|
12
|
+
services: AzureContainerServices;
|
|
13
|
+
}>;
|
|
14
|
+
// @deprecated
|
|
10
15
|
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
11
16
|
container: IFluidContainer<TContainerSchema>;
|
|
12
17
|
services: AzureContainerServices;
|
|
13
18
|
}>;
|
|
19
|
+
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
20
|
+
container: IFluidContainer<TContainerSchema>;
|
|
21
|
+
services: AzureContainerServices;
|
|
22
|
+
}>;
|
|
23
|
+
// @deprecated
|
|
14
24
|
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
15
25
|
container: IFluidContainer<TContainerSchema>;
|
|
16
26
|
services: AzureContainerServices;
|
|
17
27
|
}>;
|
|
18
28
|
getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
|
|
29
|
+
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
30
|
+
container: IFluidContainer<TContainerSchema>;
|
|
31
|
+
}>;
|
|
32
|
+
// @deprecated
|
|
19
33
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
20
34
|
container: IFluidContainer<TContainerSchema>;
|
|
21
35
|
}>;
|
|
@@ -73,7 +87,7 @@ export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
|
|
|
73
87
|
type: "remote";
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
// @public
|
|
90
|
+
// @public @deprecated
|
|
77
91
|
export type CompatibilityMode = "1" | "2";
|
|
78
92
|
|
|
79
93
|
// @public
|
package/dist/AzureClient.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { ContainerSchema, IFluidContainer, CompatibilityMode } from "@fluidframework/fluid-static";
|
|
6
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions";
|
|
6
7
|
import type { AzureClientProps, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions } from "./interfaces.js";
|
|
7
8
|
/**
|
|
8
9
|
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
|
|
@@ -26,9 +27,24 @@ export declare class AzureClient {
|
|
|
26
27
|
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
27
28
|
* (normally not explicitly specified.)
|
|
28
29
|
* @param containerSchema - Container schema for the new container.
|
|
29
|
-
* @param
|
|
30
|
+
* @param minVersionForCollab - Minimum Fluid Framework version required for collaboration, as a
|
|
31
|
+
* SemVer string (e.g. `"1.0.0"`, `"2.100.0"`). Prefer the current Fluid Framework version so the container opts into the latest defaults.
|
|
30
32
|
* @returns New detached container instance along with associated services.
|
|
31
33
|
*/
|
|
34
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
35
|
+
container: IFluidContainer<TContainerSchema>;
|
|
36
|
+
services: AzureContainerServices;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new detached container instance in the Azure Fluid Relay.
|
|
40
|
+
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
41
|
+
* This does not normally need to be specified explicitly.
|
|
42
|
+
* @param containerSchema - Container schema for the new container.
|
|
43
|
+
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
44
|
+
* @returns New detached container instance along with associated services.
|
|
45
|
+
* @deprecated Pass a `MinimumVersionForCollab` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
46
|
+
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
47
|
+
*/
|
|
32
48
|
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
33
49
|
container: IFluidContainer<TContainerSchema>;
|
|
34
50
|
services: AzureContainerServices;
|
|
@@ -39,9 +55,25 @@ export declare class AzureClient {
|
|
|
39
55
|
* (normally not explicitly specified.)
|
|
40
56
|
* @param id - Unique ID of the container in Azure Fluid Relay.
|
|
41
57
|
* @param containerSchema - Container schema used to access data objects in the container.
|
|
42
|
-
* @param
|
|
58
|
+
* @param minVersionForCollab - Minimum framework version required for collaboration, as a
|
|
59
|
+
* SemVer string (e.g. `"1.0.0"`, `"2.100.0"`). Prefer the current Fluid Framework version so the container opts into the latest defaults.
|
|
43
60
|
* @returns Existing container instance along with associated services.
|
|
44
61
|
*/
|
|
62
|
+
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
63
|
+
container: IFluidContainer<TContainerSchema>;
|
|
64
|
+
services: AzureContainerServices;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Accesses the existing container given its unique ID in the Azure Fluid Relay.
|
|
68
|
+
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
69
|
+
* (normally not explicitly specified.)
|
|
70
|
+
* @param id - Unique ID of the container in Azure Fluid Relay.
|
|
71
|
+
* @param containerSchema - Container schema used to access data objects in the container.
|
|
72
|
+
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
73
|
+
* @returns Existing container instance along with associated services.
|
|
74
|
+
* @deprecated Pass a `MinimumVersionForCollab` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
75
|
+
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
76
|
+
*/
|
|
45
77
|
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
46
78
|
container: IFluidContainer<TContainerSchema>;
|
|
47
79
|
services: AzureContainerServices;
|
|
@@ -53,8 +85,24 @@ export declare class AzureClient {
|
|
|
53
85
|
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
|
54
86
|
* @param containerSchema - Container schema used to access data objects in the container.
|
|
55
87
|
* @param version - Unique version of the source container in Azure Fluid Relay.
|
|
56
|
-
* @param
|
|
88
|
+
* @param minVersionForCollab - Minimum framework version required for collaboration, as a
|
|
89
|
+
* SemVer string (e.g. `"1.0.0"`, `"2.100.0"`). Prefer the current Fluid Framework version so the container opts into the latest defaults.
|
|
90
|
+
* @returns Loaded container instance at the specified version.
|
|
91
|
+
*/
|
|
92
|
+
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, minVersionForCollab: MinimumVersionForCollab): Promise<{
|
|
93
|
+
container: IFluidContainer<TContainerSchema>;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Load a specific version of a container for viewing only.
|
|
97
|
+
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
98
|
+
* (normally not explicitly specified.)
|
|
99
|
+
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
|
100
|
+
* @param containerSchema - Container schema used to access data objects in the container.
|
|
101
|
+
* @param version - Unique version of the source container in Azure Fluid Relay.
|
|
102
|
+
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
57
103
|
* @returns Loaded container instance at the specified version.
|
|
104
|
+
* @deprecated Pass a `MinimumVersionForCollab` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
105
|
+
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
58
106
|
*/
|
|
59
107
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
60
108
|
container: IFluidContainer<TContainerSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,EACX,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EAEf,iBAAiB,EACjB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAKnF,OAAO,KAAK,EACX,gBAAgB,EAGhB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EAGvB,MAAM,iBAAiB,CAAC;AAiCzB;;;;GAIG;AACH,qBAAa,WAAW;IACvB,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA0B;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkC;IACjE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2D;IAC5F,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAE1D,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAMzB;IAEtB;;;OAGG;gBACgB,UAAU,EAAE,gBAAgB;IA0B/C;;;;;;;;OAQG;IACU,eAAe,CAAC,KAAK,CAAC,gBAAgB,SAAS,eAAe,EAC1E,eAAe,EAAE,gBAAgB,EACjC,mBAAmB,EAAE,uBAAuB,GAC1C,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,C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AC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;KAC7C,CAAC;IA4BF;;;;;;OAMG;IACU,oBAAoB,CAChC,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA0BnC,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,cAAc;YA6CR,oBAAoB;CA6BlC"}
|
package/dist/AzureClient.js
CHANGED
|
@@ -68,15 +68,9 @@ class AzureClient {
|
|
|
68
68
|
this.configProvider = wrapConfigProvider(properties.configProvider);
|
|
69
69
|
this.createContainerRuntimeFactory = properties.createContainerRuntimeFactory;
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* (normally not explicitly specified.)
|
|
75
|
-
* @param containerSchema - Container schema for the new container.
|
|
76
|
-
* @param compatibilityMode - Compatibility mode the container should run in.
|
|
77
|
-
* @returns New detached container instance along with associated services.
|
|
78
|
-
*/
|
|
79
|
-
async createContainer(containerSchema, compatibilityMode) {
|
|
71
|
+
async createContainer(containerSchema,
|
|
72
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
73
|
+
compatibilityMode) {
|
|
80
74
|
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
81
75
|
const container = await (0, internal_2.createDetachedContainer)({
|
|
82
76
|
...loaderProps,
|
|
@@ -89,16 +83,9 @@ class AzureClient {
|
|
|
89
83
|
const services = this.getContainerServices(container);
|
|
90
84
|
return { container: fluidContainer, services };
|
|
91
85
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* (normally not explicitly specified.)
|
|
96
|
-
* @param id - Unique ID of the container in Azure Fluid Relay.
|
|
97
|
-
* @param containerSchema - Container schema used to access data objects in the container.
|
|
98
|
-
* @param compatibilityMode - Compatibility mode the container should run in.
|
|
99
|
-
* @returns Existing container instance along with associated services.
|
|
100
|
-
*/
|
|
101
|
-
async getContainer(id, containerSchema, compatibilityMode) {
|
|
86
|
+
async getContainer(id, containerSchema,
|
|
87
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
88
|
+
compatibilityMode) {
|
|
102
89
|
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
103
90
|
const url = new URL(this.connectionConfig.endpoint);
|
|
104
91
|
url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
|
|
@@ -114,17 +101,9 @@ class AzureClient {
|
|
|
114
101
|
const services = this.getContainerServices(container);
|
|
115
102
|
return { container: fluidContainer, services };
|
|
116
103
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
* (normally not explicitly specified.)
|
|
121
|
-
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
|
122
|
-
* @param containerSchema - Container schema used to access data objects in the container.
|
|
123
|
-
* @param version - Unique version of the source container in Azure Fluid Relay.
|
|
124
|
-
* @param compatibilityMode - Compatibility mode the container should run in.
|
|
125
|
-
* @returns Loaded container instance at the specified version.
|
|
126
|
-
*/
|
|
127
|
-
async viewContainerVersion(id, containerSchema, version, compatibilityMode) {
|
|
104
|
+
async viewContainerVersion(id, containerSchema, version,
|
|
105
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
106
|
+
compatibilityMode) {
|
|
128
107
|
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
129
108
|
const url = new URL(this.connectionConfig.endpoint);
|
|
130
109
|
url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
|
|
@@ -172,15 +151,18 @@ class AzureClient {
|
|
|
172
151
|
}),
|
|
173
152
|
};
|
|
174
153
|
}
|
|
175
|
-
getLoaderProps(schema,
|
|
154
|
+
getLoaderProps(schema,
|
|
155
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
156
|
+
compatibilityMode) {
|
|
157
|
+
const minVersionForCollaboration = (0, internal_4.resolveCompatibilityModeToMinVersionForCollab)(compatibilityMode);
|
|
176
158
|
const runtimeFactory = this.createContainerRuntimeFactory
|
|
177
159
|
? this.createContainerRuntimeFactory({
|
|
178
160
|
schema,
|
|
179
|
-
|
|
161
|
+
minVersionForCollaboration,
|
|
180
162
|
})
|
|
181
163
|
: (0, internal_4.createDOProviderContainerRuntimeFactory)({
|
|
182
164
|
schema,
|
|
183
|
-
|
|
165
|
+
minVersionForCollaboration,
|
|
184
166
|
});
|
|
185
167
|
const load = async () => {
|
|
186
168
|
return {
|
package/dist/AzureClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AACpE,6EAKwD;AACxD,wEAKmD;AAUnD,oEAAgF;AAMhF,oEAI+C;AAC/C,4EAAoG;AACpG,uEAA0F;AAE1F,yDAA+D;AAC/D,+DAAsF;AAWtF,yCAA2D;AAE3D;;GAEG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,WAAW,GAAG,CAAC,oBAA2C,EAAU,EAAE;IAC3E,OAAO,IAAA,wCAA6B,EAAC,oBAAoB,CAAC;QACzD,CAAC,CAAC,oBAAoB,CAAC,QAAQ;QAC/B,CAAC,CAAC,oBAAoB,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;GAGG;AACH,MAAM,uBAAuB,GAAG;IAC/B,sDAAsD;IACtD,sCAAsC,EAAE,IAAI;CAC5C,CAAC;AAEF;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,kBAAwC;IACnE,OAAO,IAAA,yCAA8B,EAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;AACpF,CAAC;AAED;;;;GAIG;AACH,MAAa,WAAW;IAevB;;;OAGG;IACH,YAAmB,UAA4B;QAC9C,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,UAAU,CAAC;QAC9C,IAAI,CAAC,M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AAA,+BAAoB,EAAmB;YACnE,SAAS;SACT,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;CAED;AA3QD,kCA2QC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\ttype IContainer,\n\ttype IFluidModuleWithDetails,\n\ttype IRuntimeFactory,\n\tLoaderHeader,\n} from \"@fluidframework/container-definitions/internal\";\nimport {\n\tcreateDetachedContainer,\n\tloadContainerPaused,\n\tloadExistingContainer,\n\ttype ILoaderProps,\n} from \"@fluidframework/container-loader/internal\";\nimport type {\n\tIConfigProviderBase,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IClient } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentServiceFactory,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { applyStorageCompression } from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tContainerSchema,\n\tIFluidContainer,\n\tCompatibilityMode,\n} from \"@fluidframework/fluid-static\";\nimport {\n\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static/internal\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver/internal\";\nimport { wrapConfigProviderWithDefaults } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { createAzureAudienceMember } from \"./AzureAudience.js\";\nimport { AzureUrlResolver, createAzureCreateNewRequest } from \"./AzureUrlResolver.js\";\nimport type {\n\tAzureClientProps,\n\tAzureClientPropsInternal,\n\tAzureConnectionConfig,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces.js\";\nimport { isAzureRemoteConnectionConfig } from \"./utils.js\";\n\n/**\n * Strongly typed id for connecting to a local Azure Fluid Relay.\n */\nconst LOCAL_MODE_TENANT_ID = \"local\";\nconst getTenantId = (connectionProperties: AzureConnectionConfig): string => {\n\treturn isAzureRemoteConnectionConfig(connectionProperties)\n\t\t? connectionProperties.tenantId\n\t\t: LOCAL_MODE_TENANT_ID;\n};\n\nconst MAX_VERSION_COUNT = 5;\n\n/**\n * Default feature gates.\n * These values will only be used if the feature gate is not already set by the supplied config provider.\n */\nconst azureClientFeatureGates = {\n\t// Azure client requires a write connection by default\n\t\"Fluid.Container.ForceWriteConnection\": true,\n};\n\n/**\n * Wrap the config provider to fall back on the appropriate defaults for Azure Client.\n * @param baseConfigProvider - The base config provider to wrap\n * @returns A new config provider with the appropriate defaults applied underneath the given provider\n */\nfunction wrapConfigProvider(baseConfigProvider?: IConfigProviderBase): IConfigProviderBase {\n\treturn wrapConfigProviderWithDefaults(baseConfigProvider, azureClientFeatureGates);\n}\n\n/**\n * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,\n * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.\n * @public\n */\nexport class AzureClient {\n\tprivate readonly documentServiceFactory: IDocumentServiceFactory;\n\tprivate readonly urlResolver: IUrlResolver;\n\tprivate readonly configProvider: IConfigProviderBase | undefined;\n\tprivate readonly connectionConfig: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\tprivate readonly logger: ITelemetryBaseLogger | undefined;\n\n\tprivate readonly createContainerRuntimeFactory?: ({\n\t\tschema,\n\t\tcompatibilityMode,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tcompatibilityMode: CompatibilityMode;\n\t}) => IRuntimeFactory;\n\n\t/**\n\t * Creates a new client instance using configuration parameters.\n\t * @param properties - Properties for initializing a new AzureClient instance\n\t */\n\tpublic constructor(properties: AzureClientProps) {\n\t\tthis.connectionConfig = properties.connection;\n\t\tthis.logger = properties.logger;\n\t\t// remove trailing slash from URL if any\n\t\tthis.connectionConfig.endpoint = this.connectionConfig.endpoint.replace(/\\/$/, \"\");\n\t\tthis.urlResolver = new AzureUrlResolver();\n\t\t// The local service implementation differs from the Azure Fluid Relay in blob\n\t\t// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.\n\t\tconst isRemoteConnection = isAzureRemoteConnectionConfig(this.connectionConfig);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.connectionConfig.tokenProvider, {\n\t\t\t\tenableWholeSummaryUpload: isRemoteConnection,\n\t\t\t\tenableDiscovery: isRemoteConnection,\n\t\t\t});\n\n\t\tthis.documentServiceFactory = applyStorageCompression(\n\t\t\torigDocumentServiceFactory,\n\t\t\tproperties.summaryCompression,\n\t\t);\n\t\tthis.configProvider = wrapConfigProvider(properties.configProvider);\n\n\t\tthis.createContainerRuntimeFactory = (\n\t\t\tproperties as Partial<AzureClientPropsInternal>\n\t\t).createContainerRuntimeFactory;\n\t}\n\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param containerSchema - Container schema for the new container.\n\t * @param compatibilityMode - Compatibility mode the container should run in.\n\t * @returns New detached container instance along with associated services.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\n\t\tconst container = await createDetachedContainer({\n\t\t\t...loaderProps,\n\t\t\tcodeDetails: {\n\t\t\t\tpackage: \"no-dynamic-package\",\n\t\t\t\tconfig: {},\n\t\t\t},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.connectionConfig,\n\t\t);\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Accesses the existing container given its unique ID in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param compatibilityMode - Compatibility mode the container should run in.\n\t * @returns Existing container instance along with associated services.\n\t */\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst container = await loadExistingContainer({\n\t\t\t...loaderProps,\n\t\t\trequest: { url: url.href },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Load a specific version of a container for viewing only.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param version - Unique version of the source container in Azure Fluid Relay.\n\t * @param compatibilityMode - Compatibility mode the container should run in.\n\t * @returns Loaded container instance at the specified version.\n\t */\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loadContainerPaused(loaderProps, {\n\t\t\turl: url.href,\n\t\t\theaders: { [LoaderHeader.version]: version.id },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\treturn { container: fluidContainer };\n\t}\n\n\t/**\n\t * Get the list of versions for specific container.\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param options - \"Get\" options. If options are not provided, API\n\t * will assume maxCount of versions to retrieve to be 5.\n\t * @returns Array of available container versions.\n\t */\n\tpublic async getContainerVersions(\n\t\tid: string,\n\t\toptions?: AzureGetVersionsOptions,\n\t): Promise<AzureContainerVersion[]> {\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst resolvedUrl = await this.urlResolver.resolve({ url: url.href });\n\t\tif (!resolvedUrl) {\n\t\t\tthrow new Error(\"Unable to resolved URL\");\n\t\t}\n\t\tconst documentService =\n\t\t\tawait this.documentServiceFactory.createDocumentService(resolvedUrl);\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\t// External API uses null\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tconst versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);\n\n\t\treturn versions.map((item) => {\n\t\t\treturn { id: item.id, date: item.date };\n\t\t});\n\t}\n\n\tprivate getContainerServices(container: IContainer): AzureContainerServices {\n\t\treturn {\n\t\t\taudience: createServiceAudience({\n\t\t\t\tcontainer,\n\t\t\t\tcreateServiceMember: createAzureAudienceMember,\n\t\t\t}),\n\t\t};\n\t}\n\n\tprivate getLoaderProps(\n\t\tschema: ContainerSchema,\n\t\tcompatibilityMode: CompatibilityMode,\n\t): ILoaderProps {\n\t\tconst runtimeFactory = this.createContainerRuntimeFactory\n\t\t\t? this.createContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tcompatibilityMode,\n\t\t\t\t})\n\t\t\t: createDOProviderContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tcompatibilityMode,\n\t\t\t\t});\n\n\t\tconst load = async (): Promise<IFluidModuleWithDetails> => {\n\t\t\treturn {\n\t\t\t\tmodule: { fluidExport: runtimeFactory },\n\t\t\t\tdetails: { package: \"no-dynamic-package\", config: {} },\n\t\t\t};\n\t\t};\n\n\t\tconst codeLoader = { load };\n\t\tconst client: IClient = {\n\t\t\tdetails: {\n\t\t\t\tcapabilities: { interactive: true },\n\t\t\t},\n\t\t\tpermission: [],\n\t\t\tscopes: [],\n\t\t\tuser: { id: \"\" },\n\t\t\tmode: \"write\",\n\t\t};\n\n\t\treturn {\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.logger,\n\t\t\toptions: { client },\n\t\t\tconfigProvider: this.configProvider,\n\t\t};\n\t}\n\n\tprivate async createFluidContainer<TContainerSchema extends ContainerSchema>(\n\t\tcontainer: IContainer,\n\t\tconnection: AzureConnectionConfig,\n\t): Promise<IFluidContainer<TContainerSchema>> {\n\t\tconst createNewRequest = createAzureCreateNewRequest(\n\t\t\tconnection.endpoint,\n\t\t\tgetTenantId(connection),\n\t\t);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\tif (container.attachState !== AttachState.Detached) {\n\t\t\t\tthrow new Error(\"Cannot attach container. Container is not in detached state\");\n\t\t\t}\n\t\t\tawait container.attach(createNewRequest);\n\t\t\tif (container.resolvedUrl === undefined) {\n\t\t\t\tthrow new Error(\"Resolved Url not available on attached container\");\n\t\t\t}\n\t\t\treturn container.resolvedUrl.id;\n\t\t};\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\t// #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AACpE,6EAKwD;AACxD,wEAKmD;AAUnD,oEAAgF;AAOhF,oEAK+C;AAC/C,4EAAoG;AAEpG,uEAA0F;AAE1F,yDAA+D;AAC/D,+DAAsF;AAWtF,yCAA2D;AAE3D;;GAEG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,WAAW,GAAG,CAAC,oBAA2C,EAAU,EAAE;IAC3E,OAAO,IAAA,wCAA6B,EAAC,oBAAoB,CAAC;QACzD,CAAC,CAAC,oBAAoB,CAAC,QAAQ;QAC/B,CAAC,CAAC,oBAAoB,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;GAGG;AACH,MAAM,uBAAuB,GAAG;IAC/B,sDAAsD;IACtD,sCAAsC,EAAE,IAAI;CAC5C,CAAC;AAEF;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,kBAAwC;IACnE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A6D,CAAC,CAAC;YAChF,CAAC;YACD,MAAM,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YACzC,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC;QACF,MAAM,cAAc,GAAG,MAAM,IAAA,+BAAoB,EAAmB;YACnE,SAAS;SACT,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;CAED;AAtWD,kCAsWC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\ttype IContainer,\n\ttype IFluidModuleWithDetails,\n\ttype IRuntimeFactory,\n\tLoaderHeader,\n} from \"@fluidframework/container-definitions/internal\";\nimport {\n\tcreateDetachedContainer,\n\tloadContainerPaused,\n\tloadExistingContainer,\n\ttype ILoaderProps,\n} from \"@fluidframework/container-loader/internal\";\nimport type {\n\tIConfigProviderBase,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IClient } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentServiceFactory,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { applyStorageCompression } from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tContainerSchema,\n\tIFluidContainer,\n\t// eslint-disable-next-line import-x/no-deprecated\n\tCompatibilityMode,\n} from \"@fluidframework/fluid-static\";\nimport {\n\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\tcreateServiceAudience,\n\tresolveCompatibilityModeToMinVersionForCollab,\n} from \"@fluidframework/fluid-static/internal\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions\";\nimport { wrapConfigProviderWithDefaults } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { createAzureAudienceMember } from \"./AzureAudience.js\";\nimport { AzureUrlResolver, createAzureCreateNewRequest } from \"./AzureUrlResolver.js\";\nimport type {\n\tAzureClientProps,\n\tAzureClientPropsInternal,\n\tAzureConnectionConfig,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces.js\";\nimport { isAzureRemoteConnectionConfig } from \"./utils.js\";\n\n/**\n * Strongly typed id for connecting to a local Azure Fluid Relay.\n */\nconst LOCAL_MODE_TENANT_ID = \"local\";\nconst getTenantId = (connectionProperties: AzureConnectionConfig): string => {\n\treturn isAzureRemoteConnectionConfig(connectionProperties)\n\t\t? connectionProperties.tenantId\n\t\t: LOCAL_MODE_TENANT_ID;\n};\n\nconst MAX_VERSION_COUNT = 5;\n\n/**\n * Default feature gates.\n * These values will only be used if the feature gate is not already set by the supplied config provider.\n */\nconst azureClientFeatureGates = {\n\t// Azure client requires a write connection by default\n\t\"Fluid.Container.ForceWriteConnection\": true,\n};\n\n/**\n * Wrap the config provider to fall back on the appropriate defaults for Azure Client.\n * @param baseConfigProvider - The base config provider to wrap\n * @returns A new config provider with the appropriate defaults applied underneath the given provider\n */\nfunction wrapConfigProvider(baseConfigProvider?: IConfigProviderBase): IConfigProviderBase {\n\treturn wrapConfigProviderWithDefaults(baseConfigProvider, azureClientFeatureGates);\n}\n\n/**\n * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,\n * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.\n * @public\n */\nexport class AzureClient {\n\tprivate readonly documentServiceFactory: IDocumentServiceFactory;\n\tprivate readonly urlResolver: IUrlResolver;\n\tprivate readonly configProvider: IConfigProviderBase | undefined;\n\tprivate readonly connectionConfig: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\tprivate readonly logger: ITelemetryBaseLogger | undefined;\n\n\tprivate readonly createContainerRuntimeFactory?: ({\n\t\tschema,\n\t\tminVersionForCollaboration,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tminVersionForCollaboration: MinimumVersionForCollab;\n\t}) => IRuntimeFactory;\n\n\t/**\n\t * Creates a new client instance using configuration parameters.\n\t * @param properties - Properties for initializing a new AzureClient instance\n\t */\n\tpublic constructor(properties: AzureClientProps) {\n\t\tthis.connectionConfig = properties.connection;\n\t\tthis.logger = properties.logger;\n\t\t// remove trailing slash from URL if any\n\t\tthis.connectionConfig.endpoint = this.connectionConfig.endpoint.replace(/\\/$/, \"\");\n\t\tthis.urlResolver = new AzureUrlResolver();\n\t\t// The local service implementation differs from the Azure Fluid Relay in blob\n\t\t// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.\n\t\tconst isRemoteConnection = isAzureRemoteConnectionConfig(this.connectionConfig);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.connectionConfig.tokenProvider, {\n\t\t\t\tenableWholeSummaryUpload: isRemoteConnection,\n\t\t\t\tenableDiscovery: isRemoteConnection,\n\t\t\t});\n\n\t\tthis.documentServiceFactory = applyStorageCompression(\n\t\t\torigDocumentServiceFactory,\n\t\t\tproperties.summaryCompression,\n\t\t);\n\t\tthis.configProvider = wrapConfigProvider(properties.configProvider);\n\n\t\tthis.createContainerRuntimeFactory = (\n\t\t\tproperties as Partial<AzureClientPropsInternal>\n\t\t).createContainerRuntimeFactory;\n\t}\n\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param containerSchema - Container schema for the new container.\n\t * @param minVersionForCollab - Minimum Fluid Framework version required for collaboration, as a\n\t * SemVer string (e.g. `\"1.0.0\"`, `\"2.100.0\"`). Prefer the current Fluid Framework version so the container opts into the latest defaults.\n\t * @returns New detached container instance along with associated services.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * This does not normally need to be specified explicitly.\n\t * @param containerSchema - Container schema for the new container.\n\t * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.\n\t * @returns New detached container instance along with associated services.\n\t * @deprecated Pass a `MinimumVersionForCollab` SemVer string (e.g. `\"2.0.0\"`) instead. The legacy\n\t * values `\"1\"` and `\"2\"` correspond to `\"1.0.0\"` and `\"2.0.0\"` respectively.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: MinimumVersionForCollab | CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\n\t\tconst container = await createDetachedContainer({\n\t\t\t...loaderProps,\n\t\t\tcodeDetails: {\n\t\t\t\tpackage: \"no-dynamic-package\",\n\t\t\t\tconfig: {},\n\t\t\t},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.connectionConfig,\n\t\t);\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Accesses the existing container given its unique ID in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param minVersionForCollab - Minimum framework version required for collaboration, as a\n\t * SemVer string (e.g. `\"1.0.0\"`, `\"2.100.0\"`). Prefer the current Fluid Framework version so the container opts into the latest defaults.\n\t * @returns Existing container instance along with associated services.\n\t */\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\t/**\n\t * Accesses the existing container given its unique ID in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.\n\t * @returns Existing container instance along with associated services.\n\t * @deprecated Pass a `MinimumVersionForCollab` SemVer string (e.g. `\"2.0.0\"`) instead. The legacy\n\t * values `\"1\"` and `\"2\"` correspond to `\"1.0.0\"` and `\"2.0.0\"` respectively.\n\t */\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: MinimumVersionForCollab | CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst container = await loadExistingContainer({\n\t\t\t...loaderProps,\n\t\t\trequest: { url: url.href },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Load a specific version of a container for viewing only.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param version - Unique version of the source container in Azure Fluid Relay.\n\t * @param minVersionForCollab - Minimum framework version required for collaboration, as a\n\t * SemVer string (e.g. `\"1.0.0\"`, `\"2.100.0\"`). Prefer the current Fluid Framework version so the container opts into the latest defaults.\n\t * @returns Loaded container instance at the specified version.\n\t */\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}>;\n\t/**\n\t * Load a specific version of a container for viewing only.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param version - Unique version of the source container in Azure Fluid Relay.\n\t * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.\n\t * @returns Loaded container instance at the specified version.\n\t * @deprecated Pass a `MinimumVersionForCollab` SemVer string (e.g. `\"2.0.0\"`) instead. The legacy\n\t * values `\"1\"` and `\"2\"` correspond to `\"1.0.0\"` and `\"2.0.0\"` respectively.\n\t */\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}>;\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: MinimumVersionForCollab | CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loadContainerPaused(loaderProps, {\n\t\t\turl: url.href,\n\t\t\theaders: { [LoaderHeader.version]: version.id },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\treturn { container: fluidContainer };\n\t}\n\n\t/**\n\t * Get the list of versions for specific container.\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param options - \"Get\" options. If options are not provided, API\n\t * will assume maxCount of versions to retrieve to be 5.\n\t * @returns Array of available container versions.\n\t */\n\tpublic async getContainerVersions(\n\t\tid: string,\n\t\toptions?: AzureGetVersionsOptions,\n\t): Promise<AzureContainerVersion[]> {\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst resolvedUrl = await this.urlResolver.resolve({ url: url.href });\n\t\tif (!resolvedUrl) {\n\t\t\tthrow new Error(\"Unable to resolved URL\");\n\t\t}\n\t\tconst documentService =\n\t\t\tawait this.documentServiceFactory.createDocumentService(resolvedUrl);\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\t// External API uses null\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tconst versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);\n\n\t\treturn versions.map((item) => {\n\t\t\treturn { id: item.id, date: item.date };\n\t\t});\n\t}\n\n\tprivate getContainerServices(container: IContainer): AzureContainerServices {\n\t\treturn {\n\t\t\taudience: createServiceAudience({\n\t\t\t\tcontainer,\n\t\t\t\tcreateServiceMember: createAzureAudienceMember,\n\t\t\t}),\n\t\t};\n\t}\n\n\tprivate getLoaderProps(\n\t\tschema: ContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: MinimumVersionForCollab | CompatibilityMode,\n\t): ILoaderProps {\n\t\tconst minVersionForCollaboration =\n\t\t\tresolveCompatibilityModeToMinVersionForCollab(compatibilityMode);\n\t\tconst runtimeFactory = this.createContainerRuntimeFactory\n\t\t\t? this.createContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration,\n\t\t\t\t})\n\t\t\t: createDOProviderContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration,\n\t\t\t\t});\n\n\t\tconst load = async (): Promise<IFluidModuleWithDetails> => {\n\t\t\treturn {\n\t\t\t\tmodule: { fluidExport: runtimeFactory },\n\t\t\t\tdetails: { package: \"no-dynamic-package\", config: {} },\n\t\t\t};\n\t\t};\n\n\t\tconst codeLoader = { load };\n\t\tconst client: IClient = {\n\t\t\tdetails: {\n\t\t\t\tcapabilities: { interactive: true },\n\t\t\t},\n\t\t\tpermission: [],\n\t\t\tscopes: [],\n\t\t\tuser: { id: \"\" },\n\t\t\tmode: \"write\",\n\t\t};\n\n\t\treturn {\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.logger,\n\t\t\toptions: { client },\n\t\t\tconfigProvider: this.configProvider,\n\t\t};\n\t}\n\n\tprivate async createFluidContainer<TContainerSchema extends ContainerSchema>(\n\t\tcontainer: IContainer,\n\t\tconnection: AzureConnectionConfig,\n\t): Promise<IFluidContainer<TContainerSchema>> {\n\t\tconst createNewRequest = createAzureCreateNewRequest(\n\t\t\tconnection.endpoint,\n\t\t\tgetTenantId(connection),\n\t\t);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\tif (container.attachState !== AttachState.Detached) {\n\t\t\t\tthrow new Error(\"Cannot attach container. Container is not in detached state\");\n\t\t\t}\n\t\t\tawait container.attach(createNewRequest);\n\t\t\tif (container.resolvedUrl === undefined) {\n\t\t\t\tthrow new Error(\"Resolved Url not available on attached container\");\n\t\t\t}\n\t\t\treturn container.resolvedUrl.id;\n\t\t};\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\t// #endregion\n}\n"]}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ import type { IRuntimeFactory } from "@fluidframework/container-definitions/inte
|
|
|
6
6
|
import type { IConfigProviderBase, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import type { IUser } from "@fluidframework/driver-definitions";
|
|
8
8
|
import type { ICompressionStorageConfig } from "@fluidframework/driver-utils";
|
|
9
|
-
import type {
|
|
9
|
+
import type { ContainerSchema, IMember, IServiceAudience } from "@fluidframework/fluid-static";
|
|
10
10
|
import type { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
11
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions";
|
|
11
12
|
/**
|
|
12
13
|
* Props for initializing a new AzureClient instance
|
|
13
14
|
* @public
|
|
@@ -35,9 +36,9 @@ export interface AzureClientPropsInternal extends AzureClientProps {
|
|
|
35
36
|
/**
|
|
36
37
|
* Optional override for the container runtime factory used by the client.
|
|
37
38
|
*/
|
|
38
|
-
readonly createContainerRuntimeFactory?: ({ schema,
|
|
39
|
+
readonly createContainerRuntimeFactory?: ({ schema, minVersionForCollaboration, }: {
|
|
39
40
|
schema: ContainerSchema;
|
|
40
|
-
|
|
41
|
+
minVersionForCollaboration: MinimumVersionForCollab;
|
|
41
42
|
}) => IRuntimeFactory;
|
|
42
43
|
}
|
|
43
44
|
/**
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAo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;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.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 type { IRuntimeFactory } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tIConfigProviderBase,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IUser } from \"@fluidframework/driver-definitions\";\nimport type { ICompressionStorageConfig } from \"@fluidframework/driver-utils\";\nimport type {
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.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 type { IRuntimeFactory } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tIConfigProviderBase,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { IUser } from \"@fluidframework/driver-definitions\";\nimport type { ICompressionStorageConfig } from \"@fluidframework/driver-utils\";\nimport type { ContainerSchema, IMember, IServiceAudience } from \"@fluidframework/fluid-static\";\nimport type { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions\";\n\n/**\n * Props for initializing a new AzureClient instance\n * @public\n */\nexport interface AzureClientProps {\n\t/**\n\t * Configuration for establishing a connection with the Azure Fluid Relay.\n\t */\n\treadonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n\n\treadonly summaryCompression?: boolean | ICompressionStorageConfig;\n}\n\n/**\n * Internal only {@link AzureClientProps}.\n * @internal\n */\nexport interface AzureClientPropsInternal extends AzureClientProps {\n\t/**\n\t * Optional override for the container runtime factory used by the client.\n\t */\n\treadonly createContainerRuntimeFactory?: ({\n\t\tschema,\n\t\tminVersionForCollaboration,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tminVersionForCollaboration: MinimumVersionForCollab;\n\t}) => IRuntimeFactory;\n}\n\n/**\n * Container version metadata.\n * @public\n */\nexport interface AzureContainerVersion {\n\t/**\n\t * Version ID\n\t */\n\tid: string;\n\n\t/**\n\t * Time when version was generated.\n\t * ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ\n\t */\n\tdate?: string;\n}\n\n/**\n * Options for \"Get Container Versions\" API.\n * @public\n */\nexport interface AzureGetVersionsOptions {\n\t/**\n\t * Max number of versions\n\t */\n\tmaxCount: number;\n}\n\n/**\n * The type of connection.\n *\n * - \"local\" for local connections to a Fluid relay instance running on the localhost\n *\n * - \"remote\" for client connections to the Azure Fluid Relay service\n * @public\n */\nexport type AzureConnectionConfigType = \"local\" | \"remote\";\n\n/**\n * Parameters for establishing a connection with the Azure Fluid Relay.\n * @public\n */\nexport interface AzureConnectionConfig {\n\t/**\n\t * The type of connection. Whether we're connecting to a remote Fluid relay server or a local instance.\n\t */\n\ttype: AzureConnectionConfigType;\n\t/**\n\t * URI to the Azure Fluid Relay service discovery endpoint.\n\t */\n\tendpoint: string;\n\t/**\n\t * Instance that provides Azure Fluid Relay endpoint tokens.\n\t */\n\ttokenProvider: ITokenProvider;\n}\n\n/**\n * Parameters for establishing a remote connection with the Azure Fluid Relay.\n * @public\n */\nexport interface AzureRemoteConnectionConfig extends AzureConnectionConfig {\n\t/**\n\t * The type of connection. Set to a remote connection.\n\t */\n\ttype: \"remote\";\n\t/**\n\t * Unique tenant identifier.\n\t */\n\ttenantId: string;\n}\n\n/**\n * Parameters for establishing a local connection with a local instance of the Azure Fluid Relay.\n * @public\n */\nexport interface AzureLocalConnectionConfig extends AzureConnectionConfig {\n\t/**\n\t * The type of connection. Set to a remote connection.\n\t */\n\ttype: \"local\";\n}\n\n/**\n * Holds the functionality specifically tied to the Azure Fluid Relay, and how the data stored in\n * the FluidContainer is persisted in the backend and consumed by users.\n *\n * @remarks\n *\n * Returned by the {@link AzureClient} alongside a {@link @fluidframework/fluid-static#FluidContainer}.\n *\n * Any functionality regarding how the data is handled within the FluidContainer itself, i.e. which data objects\n * or DDSes to use, will not be included here but rather on the FluidContainer class itself.\n * @public\n */\nexport interface AzureContainerServices {\n\t/**\n\t * Provides an object that can be used to get the users that are present in this Fluid session and\n\t * listeners for when the roster has any changes from users joining/leaving the session\n\t */\n\taudience: IAzureAudience;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/protocol-definitions#IUser} interface to include this service-specific value.\n *\n * @typeParam T - See {@link AzureUser.additionalDetails}.\n * Note: must be JSON-serializable.\n * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.\n * @internal\n */\n// TODO: this should be updated to use something other than `any` (unknown)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AzureUser<T = any> extends IUser {\n\t/**\n\t * {@inheritDoc AzureMember.name}\n\t *\n\t */\n\tname: string;\n\n\t/**\n\t * {@inheritDoc AzureMember.additionalDetails}\n\t */\n\tadditionalDetails?: T;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.\n * It will be returned for all audience members connected to Azure.\n *\n * @typeParam T - See {@link AzureMember.additionalDetails}.\n * Note: must be JSON-serializable.\n * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.\n * @public\n */\n// TODO: this should be updated to use something other than `any` (unknown)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AzureMember<T = any> extends IMember {\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\n\t/**\n\t * Custom, app-specific user information\n\t */\n\tadditionalDetails?: T;\n}\n\n/**\n * Audience object for Azure Fluid Relay containers\n * @public\n */\nexport type IAzureAudience = IServiceAudience<AzureMember>;\n"]}
|