@fluidframework/azure-client 2.117.0 → 3.0.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 +130 -2
- package/README.md +57 -54
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/azure-client.beta.api.md +5 -19
- package/api-report/azure-client.legacy.beta.api.md +5 -19
- package/api-report/azure-client.legacy.public.api.md +5 -19
- package/api-report/azure-client.public.api.md +5 -19
- package/dist/AzureAudience.js +1 -2
- package/dist/AzureAudience.js.map +1 -1
- package/dist/AzureClient.d.ts +1 -45
- package/dist/AzureClient.d.ts.map +1 -1
- package/dist/AzureClient.js +15 -18
- package/dist/AzureClient.js.map +1 -1
- package/dist/AzureUrlResolver.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -2
- package/dist/public.d.ts +2 -2
- package/dist/utils.js +2 -3
- package/dist/utils.js.map +1 -1
- package/lib/AzureClient.d.ts +1 -45
- package/lib/AzureClient.d.ts.map +1 -1
- package/lib/AzureClient.js +16 -19
- package/lib/AzureClient.js.map +1 -1
- package/lib/AzureUrlResolver.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +3 -3
- package/lib/public.d.ts +3 -3
- package/package.json +43 -52
- package/src/AzureClient.ts +10 -81
- package/src/index.ts +3 -3
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
package/dist/AzureClient.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { ContainerSchema, IFluidContainer
|
|
5
|
+
import type { ContainerSchema, IFluidContainer } from "@fluidframework/fluid-static";
|
|
6
6
|
import type { OldestSupportedClientVersion } from "@fluidframework/runtime-definitions";
|
|
7
7
|
import type { AzureClientProps, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions } from "./interfaces.js";
|
|
8
8
|
/**
|
|
@@ -37,20 +37,6 @@ export declare class AzureClient {
|
|
|
37
37
|
container: IFluidContainer<TContainerSchema>;
|
|
38
38
|
services: AzureContainerServices;
|
|
39
39
|
}>;
|
|
40
|
-
/**
|
|
41
|
-
* Creates a new detached container instance in the Azure Fluid Relay.
|
|
42
|
-
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
43
|
-
* This does not normally need to be specified explicitly.
|
|
44
|
-
* @param containerSchema - Container schema for the new container.
|
|
45
|
-
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
46
|
-
* @returns New detached container instance along with associated services.
|
|
47
|
-
* @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
48
|
-
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
49
|
-
*/
|
|
50
|
-
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
51
|
-
container: IFluidContainer<TContainerSchema>;
|
|
52
|
-
services: AzureContainerServices;
|
|
53
|
-
}>;
|
|
54
40
|
/**
|
|
55
41
|
* Accesses the existing container given its unique ID in the Azure Fluid Relay.
|
|
56
42
|
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
@@ -67,21 +53,6 @@ export declare class AzureClient {
|
|
|
67
53
|
container: IFluidContainer<TContainerSchema>;
|
|
68
54
|
services: AzureContainerServices;
|
|
69
55
|
}>;
|
|
70
|
-
/**
|
|
71
|
-
* Accesses the existing container given its unique ID in the Azure Fluid Relay.
|
|
72
|
-
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
73
|
-
* (normally not explicitly specified.)
|
|
74
|
-
* @param id - Unique ID of the container in Azure Fluid Relay.
|
|
75
|
-
* @param containerSchema - Container schema used to access data objects in the container.
|
|
76
|
-
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
77
|
-
* @returns Existing container instance along with associated services.
|
|
78
|
-
* @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
79
|
-
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
80
|
-
*/
|
|
81
|
-
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
82
|
-
container: IFluidContainer<TContainerSchema>;
|
|
83
|
-
services: AzureContainerServices;
|
|
84
|
-
}>;
|
|
85
56
|
/**
|
|
86
57
|
* Load a specific version of a container for viewing only.
|
|
87
58
|
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
@@ -98,21 +69,6 @@ export declare class AzureClient {
|
|
|
98
69
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, oldestSupportedClient: OldestSupportedClientVersion): Promise<{
|
|
99
70
|
container: IFluidContainer<TContainerSchema>;
|
|
100
71
|
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Load a specific version of a container for viewing only.
|
|
103
|
-
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
104
|
-
* (normally not explicitly specified.)
|
|
105
|
-
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
|
106
|
-
* @param containerSchema - Container schema used to access data objects in the container.
|
|
107
|
-
* @param version - Unique version of the source container in Azure Fluid Relay.
|
|
108
|
-
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
109
|
-
* @returns Loaded container instance at the specified version.
|
|
110
|
-
* @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
111
|
-
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
112
|
-
*/
|
|
113
|
-
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
114
|
-
container: IFluidContainer<TContainerSchema>;
|
|
115
|
-
}>;
|
|
116
72
|
/**
|
|
117
73
|
* Get the list of versions for specific container.
|
|
118
74
|
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAOrF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAKxF,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;;;;;;;;;;OAUG;IACU,eAAe,CAAC,KAAK,CAAC,gBAAgB,SAAS,eAAe,EAC1E,eAAe,EAAE,gBAAgB,EACjC,qBAAqB,EAAE,4BAA4B,GACjD,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IA0BF;;;;;;;;;;;OAWG;IACU,YAAY,CAAC,gBAAgB,SAAS,eAAe,EACjE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,EACjC,qBAAqB,EAAE,4BAA4B,GACjD,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IA6BF;;;;;;;;;;;;OAYG;IACU,oBAAoB,CAAC,gBAAgB,SAAS,eAAe,EACzE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,EACjC,OAAO,EAAE,qBAAqB,EAC9B,qBAAqB,EAAE,4BAA4B,GACjD,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;KAC7C,CAAC;IA2BF;;;;;;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;YA0CR,oBAAoB;CA6BlC"}
|
package/dist/AzureClient.js
CHANGED
|
@@ -47,6 +47,12 @@ function wrapConfigProvider(baseConfigProvider) {
|
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
49
|
class AzureClient {
|
|
50
|
+
documentServiceFactory;
|
|
51
|
+
urlResolver;
|
|
52
|
+
configProvider;
|
|
53
|
+
connectionConfig;
|
|
54
|
+
logger;
|
|
55
|
+
createContainerRuntimeFactory;
|
|
50
56
|
/**
|
|
51
57
|
* Creates a new client instance using configuration parameters.
|
|
52
58
|
* @param properties - Properties for initializing a new AzureClient instance
|
|
@@ -68,10 +74,8 @@ class AzureClient {
|
|
|
68
74
|
this.configProvider = wrapConfigProvider(properties.configProvider);
|
|
69
75
|
this.createContainerRuntimeFactory = properties.createContainerRuntimeFactory;
|
|
70
76
|
}
|
|
71
|
-
async createContainer(containerSchema,
|
|
72
|
-
|
|
73
|
-
compatibilityMode) {
|
|
74
|
-
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
77
|
+
async createContainer(containerSchema, oldestSupportedClient) {
|
|
78
|
+
const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
|
|
75
79
|
const container = await (0, internal_2.createDetachedContainer)({
|
|
76
80
|
...loaderProps,
|
|
77
81
|
codeDetails: {
|
|
@@ -83,10 +87,8 @@ class AzureClient {
|
|
|
83
87
|
const services = this.getContainerServices(container);
|
|
84
88
|
return { container: fluidContainer, services };
|
|
85
89
|
}
|
|
86
|
-
async getContainer(id, containerSchema,
|
|
87
|
-
|
|
88
|
-
compatibilityMode) {
|
|
89
|
-
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
90
|
+
async getContainer(id, containerSchema, oldestSupportedClient) {
|
|
91
|
+
const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
|
|
90
92
|
const url = new URL(this.connectionConfig.endpoint);
|
|
91
93
|
url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
|
|
92
94
|
url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.connectionConfig)));
|
|
@@ -101,10 +103,8 @@ class AzureClient {
|
|
|
101
103
|
const services = this.getContainerServices(container);
|
|
102
104
|
return { container: fluidContainer, services };
|
|
103
105
|
}
|
|
104
|
-
async viewContainerVersion(id, containerSchema, version,
|
|
105
|
-
|
|
106
|
-
compatibilityMode) {
|
|
107
|
-
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
106
|
+
async viewContainerVersion(id, containerSchema, version, oldestSupportedClient) {
|
|
107
|
+
const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
|
|
108
108
|
const url = new URL(this.connectionConfig.endpoint);
|
|
109
109
|
url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
|
|
110
110
|
url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.connectionConfig)));
|
|
@@ -151,18 +151,15 @@ class AzureClient {
|
|
|
151
151
|
}),
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
getLoaderProps(schema,
|
|
155
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
156
|
-
compatibilityMode) {
|
|
157
|
-
const minVersionForCollaboration = (0, internal_4.resolveCompatibilityModeToMinVersionForCollab)(compatibilityMode);
|
|
154
|
+
getLoaderProps(schema, oldestSupportedClient) {
|
|
158
155
|
const runtimeFactory = this.createContainerRuntimeFactory
|
|
159
156
|
? this.createContainerRuntimeFactory({
|
|
160
157
|
schema,
|
|
161
|
-
minVersionForCollaboration,
|
|
158
|
+
minVersionForCollaboration: oldestSupportedClient,
|
|
162
159
|
})
|
|
163
160
|
: (0, internal_4.createDOProviderContainerRuntimeFactory)({
|
|
164
161
|
schema,
|
|
165
|
-
minVersionForCollaboration,
|
|
162
|
+
minVersionForCollaboration: oldestSupportedClient,
|
|
166
163
|
});
|
|
167
164
|
const load = async () => {
|
|
168
165
|
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;AAOhF,oEAK+C;AAC/C,4EAAoG;AAEpG,uEAA0F;AAE1F,yDAA+D;AAC/D,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;YACV,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,EAAE,MAAM,EAAE;YACnB,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,oBAAoB,CACjC,SAAqB,EACrB,UAAiC;QAEjC,MAAM,gBAAgB,GAAG,IAAA,iDAA2B,EACnD,UAAU,CAAC,QAAQ,EACnB,WAAW,CAAC,UAAU,CAAC,CACvB,CAAC;QAEF;;WAEG;QACH,MAAM,MAAM,GAAG,KAAK,IAAqB,EAAE;YAC1C,IAAI,SAAS,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,6DAA6D,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;AA5WD,kCA4WC","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 { OldestSupportedClientVersion } 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: OldestSupportedClientVersion;\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 oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * 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\toldestSupportedClient: OldestSupportedClientVersion,\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 an `OldestSupportedClientVersion` 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: OldestSupportedClientVersion | 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 oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * 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\toldestSupportedClient: OldestSupportedClientVersion,\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 an `OldestSupportedClientVersion` 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: OldestSupportedClientVersion | 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 oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * 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\toldestSupportedClient: OldestSupportedClientVersion,\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 an `OldestSupportedClientVersion` 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: OldestSupportedClientVersion | 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: OldestSupportedClientVersion | 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"]}
|
|
1
|
+
{"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AACpE,6EAKwD;AACxD,wEAKmD;AAUnD,oEAAgF;AAEhF,oEAI+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,EAA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IAAI,SAAS,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,6DAA6D,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;AA3SD,kCA2SC","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 { ContainerSchema, IFluidContainer } 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 type { OldestSupportedClientVersion } 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: OldestSupportedClientVersion;\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 oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * 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\toldestSupportedClient: OldestSupportedClientVersion,\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\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);\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 oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * 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\toldestSupportedClient: OldestSupportedClientVersion,\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\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);\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 oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * 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\toldestSupportedClient: OldestSupportedClientVersion,\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\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);\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\toldestSupportedClient: OldestSupportedClientVersion,\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\tminVersionForCollaboration: oldestSupportedClient,\n\t\t\t\t})\n\t\t\t: createDOProviderContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration: oldestSupportedClient,\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureUrlResolver.d.ts","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,YAAY;;IAGvC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCjD,cAAc,CAC1B,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;CAMlB;AAgCD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"AzureUrlResolver.d.ts","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,YAAY;;IAGvC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCjD,cAAc,CAC1B,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;CAMlB;AAgCD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACvC,aAAa,MAAM,EACnB,UAAU,MAAM,KACd,QAUF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export { AzureClient } from "./AzureClient.js";
|
|
|
11
11
|
export type { AzureClientProps, AzureClientPropsInternal, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.js";
|
|
12
12
|
export type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
|
|
13
13
|
export type { IUser } from "@fluidframework/driver-definitions";
|
|
14
|
+
export type { OldestSupportedClientVersion } from "@fluidframework/runtime-definitions";
|
|
14
15
|
export type { ITelemetryBaseEvent, ITelemetryBaseLogger, } from "@fluidframework/core-interfaces";
|
|
15
|
-
export type { CompatibilityMode } from "@fluidframework/fluid-static";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
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;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACX,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,cAAc,GACd,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3F,YAAY,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAGhE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACX,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,cAAc,GACd,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3F,YAAY,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAGhE,YAAY,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGxF,YAAY,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A simple and powerful way to consume collaborative Fluid data with the Azure Fluid Relay.\n *\n * @packageDocumentation\n */\n\nexport { AzureClient } from \"./AzureClient.js\";\nexport type {\n\tAzureClientProps,\n\tAzureClientPropsInternal,\n\tAzureConnectionConfig,\n\tAzureConnectionConfigType,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureMember,\n\tAzureRemoteConnectionConfig,\n\tAzureUser,\n\tIAzureAudience,\n} from \"./interfaces.js\";\n\nexport type { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nexport type { IUser } from \"@fluidframework/driver-definitions\";\n\n// Re-export so developers can
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A simple and powerful way to consume collaborative Fluid data with the Azure Fluid Relay.\n *\n * @packageDocumentation\n */\n\nexport { AzureClient } from \"./AzureClient.js\";\nexport type {\n\tAzureClientProps,\n\tAzureClientPropsInternal,\n\tAzureConnectionConfig,\n\tAzureConnectionConfigType,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureMember,\n\tAzureRemoteConnectionConfig,\n\tAzureUser,\n\tIAzureAudience,\n} from \"./interfaces.js\";\n\nexport type { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nexport type { IUser } from \"@fluidframework/driver-definitions\";\n\n// Re-export so developers can use parameter types without pulling in runtime-definitions.\nexport type { OldestSupportedClientVersion } from \"@fluidframework/runtime-definitions\";\n\n// Re-export so developers can build loggers without pulling in core-interfaces\nexport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n"]}
|
package/dist/legacy.d.ts
CHANGED
|
@@ -26,12 +26,12 @@ export {
|
|
|
26
26
|
AzureLocalConnectionConfig,
|
|
27
27
|
AzureMember,
|
|
28
28
|
AzureRemoteConnectionConfig,
|
|
29
|
-
CompatibilityMode,
|
|
30
29
|
IAzureAudience,
|
|
31
30
|
ITelemetryBaseEvent,
|
|
32
31
|
ITelemetryBaseLogger,
|
|
33
32
|
ITokenProvider,
|
|
34
33
|
ITokenResponse,
|
|
35
|
-
IUser
|
|
34
|
+
IUser,
|
|
35
|
+
OldestSupportedClientVersion
|
|
36
36
|
// #endregion
|
|
37
37
|
} from "./index.js";
|
package/dist/public.d.ts
CHANGED
|
@@ -26,12 +26,12 @@ export {
|
|
|
26
26
|
AzureLocalConnectionConfig,
|
|
27
27
|
AzureMember,
|
|
28
28
|
AzureRemoteConnectionConfig,
|
|
29
|
-
CompatibilityMode,
|
|
30
29
|
IAzureAudience,
|
|
31
30
|
ITelemetryBaseEvent,
|
|
32
31
|
ITelemetryBaseLogger,
|
|
33
32
|
ITokenProvider,
|
|
34
33
|
ITokenResponse,
|
|
35
|
-
IUser
|
|
34
|
+
IUser,
|
|
35
|
+
OldestSupportedClientVersion
|
|
36
36
|
// #endregion
|
|
37
37
|
} from "./index.js";
|
package/dist/utils.js
CHANGED
|
@@ -4,19 +4,18 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.isAzureRemoteConnectionConfig = isAzureRemoteConnectionConfig;
|
|
8
|
+
exports.isAzureLocalConnectionConfig = isAzureLocalConnectionConfig;
|
|
8
9
|
/**
|
|
9
10
|
* Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)
|
|
10
11
|
*/
|
|
11
12
|
function isAzureRemoteConnectionConfig(connectionConfig) {
|
|
12
13
|
return connectionConfig.type === "remote";
|
|
13
14
|
}
|
|
14
|
-
exports.isAzureRemoteConnectionConfig = isAzureRemoteConnectionConfig;
|
|
15
15
|
/**
|
|
16
16
|
* Type guard for validating a given AzureConnectionConfig is a local connection type (AzureLocalConnectionConfig)
|
|
17
17
|
*/
|
|
18
18
|
function isAzureLocalConnectionConfig(connectionConfig) {
|
|
19
19
|
return connectionConfig.type === "local";
|
|
20
20
|
}
|
|
21
|
-
exports.isAzureLocalConnectionConfig = isAzureLocalConnectionConfig;
|
|
22
21
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAWH,sEAIC;AAKD,oEAIC;AAhBD;;GAEG;AACH,SAAgB,6BAA6B,CAC5C,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,OAAO,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tAzureConnectionConfig,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces.js\";\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)\n */\nexport function isAzureRemoteConnectionConfig(\n\tconnectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureRemoteConnectionConfig {\n\treturn connectionConfig.type === \"remote\";\n}\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a local connection type (AzureLocalConnectionConfig)\n */\nexport function isAzureLocalConnectionConfig(\n\tconnectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureLocalConnectionConfig {\n\treturn connectionConfig.type === \"local\";\n}\n"]}
|
package/lib/AzureClient.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { ContainerSchema, IFluidContainer
|
|
5
|
+
import type { ContainerSchema, IFluidContainer } from "@fluidframework/fluid-static";
|
|
6
6
|
import type { OldestSupportedClientVersion } from "@fluidframework/runtime-definitions";
|
|
7
7
|
import type { AzureClientProps, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions } from "./interfaces.js";
|
|
8
8
|
/**
|
|
@@ -37,20 +37,6 @@ export declare class AzureClient {
|
|
|
37
37
|
container: IFluidContainer<TContainerSchema>;
|
|
38
38
|
services: AzureContainerServices;
|
|
39
39
|
}>;
|
|
40
|
-
/**
|
|
41
|
-
* Creates a new detached container instance in the Azure Fluid Relay.
|
|
42
|
-
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
43
|
-
* This does not normally need to be specified explicitly.
|
|
44
|
-
* @param containerSchema - Container schema for the new container.
|
|
45
|
-
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
46
|
-
* @returns New detached container instance along with associated services.
|
|
47
|
-
* @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
48
|
-
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
49
|
-
*/
|
|
50
|
-
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
51
|
-
container: IFluidContainer<TContainerSchema>;
|
|
52
|
-
services: AzureContainerServices;
|
|
53
|
-
}>;
|
|
54
40
|
/**
|
|
55
41
|
* Accesses the existing container given its unique ID in the Azure Fluid Relay.
|
|
56
42
|
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
@@ -67,21 +53,6 @@ export declare class AzureClient {
|
|
|
67
53
|
container: IFluidContainer<TContainerSchema>;
|
|
68
54
|
services: AzureContainerServices;
|
|
69
55
|
}>;
|
|
70
|
-
/**
|
|
71
|
-
* Accesses the existing container given its unique ID in the Azure Fluid Relay.
|
|
72
|
-
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
73
|
-
* (normally not explicitly specified.)
|
|
74
|
-
* @param id - Unique ID of the container in Azure Fluid Relay.
|
|
75
|
-
* @param containerSchema - Container schema used to access data objects in the container.
|
|
76
|
-
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
77
|
-
* @returns Existing container instance along with associated services.
|
|
78
|
-
* @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
79
|
-
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
80
|
-
*/
|
|
81
|
-
getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
|
|
82
|
-
container: IFluidContainer<TContainerSchema>;
|
|
83
|
-
services: AzureContainerServices;
|
|
84
|
-
}>;
|
|
85
56
|
/**
|
|
86
57
|
* Load a specific version of a container for viewing only.
|
|
87
58
|
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
@@ -98,21 +69,6 @@ export declare class AzureClient {
|
|
|
98
69
|
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, oldestSupportedClient: OldestSupportedClientVersion): Promise<{
|
|
99
70
|
container: IFluidContainer<TContainerSchema>;
|
|
100
71
|
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Load a specific version of a container for viewing only.
|
|
103
|
-
* @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
|
|
104
|
-
* (normally not explicitly specified.)
|
|
105
|
-
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
|
106
|
-
* @param containerSchema - Container schema used to access data objects in the container.
|
|
107
|
-
* @param version - Unique version of the source container in Azure Fluid Relay.
|
|
108
|
-
* @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
|
|
109
|
-
* @returns Loaded container instance at the specified version.
|
|
110
|
-
* @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
|
|
111
|
-
* values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
|
|
112
|
-
*/
|
|
113
|
-
viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
|
|
114
|
-
container: IFluidContainer<TContainerSchema>;
|
|
115
|
-
}>;
|
|
116
72
|
/**
|
|
117
73
|
* Get the list of versions for specific container.
|
|
118
74
|
* @param id - Unique ID of the source container in Azure Fluid Relay.
|
package/lib/AzureClient.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAOrF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAKxF,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,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}
|
package/lib/AzureClient.js
CHANGED
|
@@ -6,7 +6,7 @@ import { AttachState } from "@fluidframework/container-definitions";
|
|
|
6
6
|
import { LoaderHeader, } from "@fluidframework/container-definitions/internal";
|
|
7
7
|
import { createDetachedContainer, loadContainerPaused, loadExistingContainer, } from "@fluidframework/container-loader/internal";
|
|
8
8
|
import { applyStorageCompression } from "@fluidframework/driver-utils/internal";
|
|
9
|
-
import { createDOProviderContainerRuntimeFactory, createFluidContainer, createServiceAudience,
|
|
9
|
+
import { createDOProviderContainerRuntimeFactory, createFluidContainer, createServiceAudience, } from "@fluidframework/fluid-static/internal";
|
|
10
10
|
import { RouterliciousDocumentServiceFactory } from "@fluidframework/routerlicious-driver/internal";
|
|
11
11
|
import { wrapConfigProviderWithDefaults } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
import { createAzureAudienceMember } from "./AzureAudience.js";
|
|
@@ -44,6 +44,12 @@ function wrapConfigProvider(baseConfigProvider) {
|
|
|
44
44
|
* @public
|
|
45
45
|
*/
|
|
46
46
|
export class AzureClient {
|
|
47
|
+
documentServiceFactory;
|
|
48
|
+
urlResolver;
|
|
49
|
+
configProvider;
|
|
50
|
+
connectionConfig;
|
|
51
|
+
logger;
|
|
52
|
+
createContainerRuntimeFactory;
|
|
47
53
|
/**
|
|
48
54
|
* Creates a new client instance using configuration parameters.
|
|
49
55
|
* @param properties - Properties for initializing a new AzureClient instance
|
|
@@ -65,10 +71,8 @@ export class AzureClient {
|
|
|
65
71
|
this.configProvider = wrapConfigProvider(properties.configProvider);
|
|
66
72
|
this.createContainerRuntimeFactory = properties.createContainerRuntimeFactory;
|
|
67
73
|
}
|
|
68
|
-
async createContainer(containerSchema,
|
|
69
|
-
|
|
70
|
-
compatibilityMode) {
|
|
71
|
-
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
74
|
+
async createContainer(containerSchema, oldestSupportedClient) {
|
|
75
|
+
const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
|
|
72
76
|
const container = await createDetachedContainer({
|
|
73
77
|
...loaderProps,
|
|
74
78
|
codeDetails: {
|
|
@@ -80,10 +84,8 @@ export class AzureClient {
|
|
|
80
84
|
const services = this.getContainerServices(container);
|
|
81
85
|
return { container: fluidContainer, services };
|
|
82
86
|
}
|
|
83
|
-
async getContainer(id, containerSchema,
|
|
84
|
-
|
|
85
|
-
compatibilityMode) {
|
|
86
|
-
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
87
|
+
async getContainer(id, containerSchema, oldestSupportedClient) {
|
|
88
|
+
const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
|
|
87
89
|
const url = new URL(this.connectionConfig.endpoint);
|
|
88
90
|
url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
|
|
89
91
|
url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.connectionConfig)));
|
|
@@ -98,10 +100,8 @@ export class AzureClient {
|
|
|
98
100
|
const services = this.getContainerServices(container);
|
|
99
101
|
return { container: fluidContainer, services };
|
|
100
102
|
}
|
|
101
|
-
async viewContainerVersion(id, containerSchema, version,
|
|
102
|
-
|
|
103
|
-
compatibilityMode) {
|
|
104
|
-
const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
|
|
103
|
+
async viewContainerVersion(id, containerSchema, version, oldestSupportedClient) {
|
|
104
|
+
const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
|
|
105
105
|
const url = new URL(this.connectionConfig.endpoint);
|
|
106
106
|
url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
|
|
107
107
|
url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.connectionConfig)));
|
|
@@ -148,18 +148,15 @@ export class AzureClient {
|
|
|
148
148
|
}),
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
getLoaderProps(schema,
|
|
152
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
153
|
-
compatibilityMode) {
|
|
154
|
-
const minVersionForCollaboration = resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
|
|
151
|
+
getLoaderProps(schema, oldestSupportedClient) {
|
|
155
152
|
const runtimeFactory = this.createContainerRuntimeFactory
|
|
156
153
|
? this.createContainerRuntimeFactory({
|
|
157
154
|
schema,
|
|
158
|
-
minVersionForCollaboration,
|
|
155
|
+
minVersionForCollaboration: oldestSupportedClient,
|
|
159
156
|
})
|
|
160
157
|
: createDOProviderContainerRuntimeFactory({
|
|
161
158
|
schema,
|
|
162
|
-
minVersionForCollaboration,
|
|
159
|
+
minVersionForCollaboration: oldestSupportedClient,
|
|
163
160
|
});
|
|
164
161
|
const load = async () => {
|
|
165
162
|
return {
|