@fluidframework/azure-client 2.50.0 → 2.51.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/azure-client
2
2
 
3
+ ## 2.51.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.50.0
4
8
 
5
9
  Dependency updates only.
@@ -15,6 +15,7 @@ export declare class AzureClient {
15
15
  private readonly configProvider;
16
16
  private readonly connectionConfig;
17
17
  private readonly logger;
18
+ private readonly createContainerRuntimeFactory?;
18
19
  /**
19
20
  * Creates a new client instance using configuration parameters.
20
21
  * @param properties - Properties for initializing a new AzureClient instance
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,KAAK,EACX,gBAAgB,EAEhB,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;;;OAGG;gBACgB,UAAU,EAAE,gBAAgB;IAsB/C;;;;;;;OAOG;IACU,eAAe,CAAC,KAAK,CAAC,gBAAgB,SAAS,eAAe,EAC1E,eAAe,EAAE,gBAAgB,EACjC,iBAAiB,EAAE,iBAAiB,GAClC,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAA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,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;;;;;;;OAOG;IACU,eAAe,CAAC,KAAK,CAAC,gBAAgB,SAAS,eAAe,EAC1E,eAAe,EAAE,gBAAgB,EACjC,iBAAiB,EAAE,iBAAiB,GAClC,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAmBF;;;;;;;;OAQG;IACU,YAAY,CAAC,gBAAgB,SAAS,eAAe,EACjE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,EACjC,iBAAiB,EAAE,iBAAiB,GAClC,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAqBF;;;;;;;;;OASG;IACU,oBAAoB,CAAC,gBAAgB,SAAS,eAAe,EACzE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,EACjC,OAAO,EAAE,qBAAqB,EAC9B,iBAAiB,EAAE,iBAAiB,GAClC,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;KAC7C,CAAC;IAmBF;;;;;;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"}
@@ -66,6 +66,7 @@ class AzureClient {
66
66
  });
67
67
  this.documentServiceFactory = (0, internal_3.applyStorageCompression)(origDocumentServiceFactory, properties.summaryCompression);
68
68
  this.configProvider = wrapConfigProvider(properties.configProvider);
69
+ this.createContainerRuntimeFactory = properties.createContainerRuntimeFactory;
69
70
  }
70
71
  /**
71
72
  * Creates a new detached container instance in the Azure Fluid Relay.
@@ -172,10 +173,15 @@ class AzureClient {
172
173
  };
173
174
  }
174
175
  getLoaderProps(schema, compatibilityMode) {
175
- const runtimeFactory = (0, internal_4.createDOProviderContainerRuntimeFactory)({
176
- schema,
177
- compatibilityMode,
178
- });
176
+ const runtimeFactory = this.createContainerRuntimeFactory
177
+ ? this.createContainerRuntimeFactory({
178
+ schema,
179
+ compatibilityMode,
180
+ })
181
+ : (0, internal_4.createDOProviderContainerRuntimeFactory)({
182
+ schema,
183
+ compatibilityMode,
184
+ });
179
185
  const load = async () => {
180
186
  return {
181
187
  module: { fluidExport: runtimeFactory },
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AACpE,6EAIwD;AACxD,wEAKmD;AAUnD,oEAAgF;AAMhF,oEAI+C;AAC/C,4EAAoG;AACpG,uEAA0F;AAE1F,yDAA+D;AAC/D,+DAAsF;AAUtF,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,C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AmB;YACnE,SAAS;SACT,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;CAED;AAzPD,kCAyPC","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\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\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\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\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 = createDOProviderContainerRuntimeFactory({\n\t\t\tschema,\n\t\t\tcompatibilityMode,\n\t\t});\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;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,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,wCAAwC;QACxC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,WAAW,GA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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"]}
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * @packageDocumentation
9
9
  */
10
10
  export { AzureClient } from "./AzureClient.js";
11
- export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.js";
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
14
  export type { ITelemetryBaseEvent, ITelemetryBaseLogger, } from "@fluidframework/core-interfaces";
@@ -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,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,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
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,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,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\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 build loggers without pulling in core-interfaces\nexport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\n// Re-export so developers have access to parameter types for createContainer/getContainer without pulling in fluid-static\nexport type { CompatibilityMode } from \"@fluidframework/fluid-static\";\n"]}
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 build loggers without pulling in core-interfaces\nexport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\n// Re-export so developers have access to parameter types for createContainer/getContainer without pulling in fluid-static\nexport type { CompatibilityMode } from \"@fluidframework/fluid-static\";\n"]}
@@ -2,10 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import type { IRuntimeFactory } from "@fluidframework/container-definitions/internal";
5
6
  import type { IConfigProviderBase, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
7
  import type { IUser } from "@fluidframework/driver-definitions";
7
8
  import type { ICompressionStorageConfig } from "@fluidframework/driver-utils";
8
- import type { IMember, IServiceAudience } from "@fluidframework/fluid-static";
9
+ import type { CompatibilityMode, ContainerSchema, IMember, IServiceAudience } from "@fluidframework/fluid-static";
9
10
  import type { ITokenProvider } from "@fluidframework/routerlicious-driver";
10
11
  /**
11
12
  * Props for initializing a new AzureClient instance
@@ -26,6 +27,19 @@ export interface AzureClientProps {
26
27
  readonly configProvider?: IConfigProviderBase;
27
28
  readonly summaryCompression?: boolean | ICompressionStorageConfig;
28
29
  }
30
+ /**
31
+ * Internal only {@link AzureClientProps}.
32
+ * @internal
33
+ */
34
+ export interface AzureClientPropsInternal extends AzureClientProps {
35
+ /**
36
+ * Optional override for the container runtime factory used by the client.
37
+ */
38
+ readonly createContainerRuntimeFactory?: ({ schema, compatibilityMode, }: {
39
+ schema: ContainerSchema;
40
+ compatibilityMode: CompatibilityMode;
41
+ }) => IRuntimeFactory;
42
+ }
29
43
  /**
30
44
  * Container version metadata.
31
45
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EAAE,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IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC;CACtB;AAED;;;;;;;;;GASG;AAGH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,OAAO;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC"}
@@ -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 {\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 { IMember, IServiceAudience } from \"@fluidframework/fluid-static\";\nimport type { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\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 * 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"]}
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 {\n\tCompatibilityMode,\n\tContainerSchema,\n\tIMember,\n\tIServiceAudience,\n} from \"@fluidframework/fluid-static\";\nimport type { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\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\tcompatibilityMode,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tcompatibilityMode: CompatibilityMode;\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"]}
@@ -15,6 +15,7 @@ export declare class AzureClient {
15
15
  private readonly configProvider;
16
16
  private readonly connectionConfig;
17
17
  private readonly logger;
18
+ private readonly createContainerRuntimeFactory?;
18
19
  /**
19
20
  * Creates a new client instance using configuration parameters.
20
21
  * @param properties - Properties for initializing a new AzureClient instance
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,KAAK,EACX,gBAAgB,EAEhB,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,MAA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uB,GAC/B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA0BnC,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,cAAc;YA0CR,oBAAoB;CA6BlC"}
@@ -63,6 +63,7 @@ export class AzureClient {
63
63
  });
64
64
  this.documentServiceFactory = applyStorageCompression(origDocumentServiceFactory, properties.summaryCompression);
65
65
  this.configProvider = wrapConfigProvider(properties.configProvider);
66
+ this.createContainerRuntimeFactory = properties.createContainerRuntimeFactory;
66
67
  }
67
68
  /**
68
69
  * Creates a new detached container instance in the Azure Fluid Relay.
@@ -169,10 +170,15 @@ export class AzureClient {
169
170
  };
170
171
  }
171
172
  getLoaderProps(schema, compatibilityMode) {
172
- const runtimeFactory = createDOProviderContainerRuntimeFactory({
173
- schema,
174
- compatibilityMode,
175
- });
173
+ const runtimeFactory = this.createContainerRuntimeFactory
174
+ ? this.createContainerRuntimeFactory({
175
+ schema,
176
+ compatibilityMode,
177
+ })
178
+ : createDOProviderContainerRuntimeFactory({
179
+ schema,
180
+ compatibilityMode,
181
+ });
176
182
  const load = async () => {
177
183
  return {
178
184
  module: { fluidExport: runtimeFactory },
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAGN,YAAY,GACZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,GAErB,MAAM,2CAA2C,CAAC;AAUnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAMhF,OAAO,EACN,uCAAuC,EACvC,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mCAAmC,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AA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rB,UAAiC;QAEjC,MAAM,gBAAgB,GAAG,2BAA2B,CACnD,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,WAAW,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,oBAAoB,CAAmB;YACnE,SAAS;SACT,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;CAED","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\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\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\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\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 = createDOProviderContainerRuntimeFactory({\n\t\t\tschema,\n\t\t\tcompatibilityMode,\n\t\t});\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,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAIN,YAAY,GACZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,GAErB,MAAM,2CAA2C,CAAC;AAUnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAMhF,OAAO,EACN,uCAAuC,EACvC,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mCAAmC,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAE1F,OAAO,EAA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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,2BAA2B,CACnD,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,WAAW,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,oBAAoB,CAAmB;YACnE,SAAS;SACT,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;CAED","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"]}
package/lib/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * @packageDocumentation
9
9
  */
10
10
  export { AzureClient } from "./AzureClient.js";
11
- export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.js";
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
14
  export type { ITelemetryBaseEvent, ITelemetryBaseLogger, } from "@fluidframework/core-interfaces";
@@ -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,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,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
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,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","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\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 build loggers without pulling in core-interfaces\nexport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\n// Re-export so developers have access to parameter types for createContainer/getContainer without pulling in fluid-static\nexport type { CompatibilityMode } from \"@fluidframework/fluid-static\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","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 build loggers without pulling in core-interfaces\nexport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\n// Re-export so developers have access to parameter types for createContainer/getContainer without pulling in fluid-static\nexport type { CompatibilityMode } from \"@fluidframework/fluid-static\";\n"]}
@@ -2,10 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import type { IRuntimeFactory } from "@fluidframework/container-definitions/internal";
5
6
  import type { IConfigProviderBase, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
7
  import type { IUser } from "@fluidframework/driver-definitions";
7
8
  import type { ICompressionStorageConfig } from "@fluidframework/driver-utils";
8
- import type { IMember, IServiceAudience } from "@fluidframework/fluid-static";
9
+ import type { CompatibilityMode, ContainerSchema, IMember, IServiceAudience } from "@fluidframework/fluid-static";
9
10
  import type { ITokenProvider } from "@fluidframework/routerlicious-driver";
10
11
  /**
11
12
  * Props for initializing a new AzureClient instance
@@ -26,6 +27,19 @@ export interface AzureClientProps {
26
27
  readonly configProvider?: IConfigProviderBase;
27
28
  readonly summaryCompression?: boolean | ICompressionStorageConfig;
28
29
  }
30
+ /**
31
+ * Internal only {@link AzureClientProps}.
32
+ * @internal
33
+ */
34
+ export interface AzureClientPropsInternal extends AzureClientProps {
35
+ /**
36
+ * Optional override for the container runtime factory used by the client.
37
+ */
38
+ readonly createContainerRuntimeFactory?: ({ schema, compatibilityMode, }: {
39
+ schema: ContainerSchema;
40
+ compatibilityMode: CompatibilityMode;
41
+ }) => IRuntimeFactory;
42
+ }
29
43
  /**
30
44
  * Container version metadata.
31
45
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,GAAG,0BAA0B,CAAC;IAC9E;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;OAEG;I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AAC"}
@@ -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 {\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 { IMember, IServiceAudience } from \"@fluidframework/fluid-static\";\nimport type { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\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 * 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"]}
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 {\n\tCompatibilityMode,\n\tContainerSchema,\n\tIMember,\n\tIServiceAudience,\n} from \"@fluidframework/fluid-static\";\nimport type { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\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\tcompatibilityMode,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tcompatibilityMode: CompatibilityMode;\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/azure-client",
3
- "version": "2.50.0",
3
+ "version": "2.51.0",
4
4
  "description": "A tool to enable creation and loading of Fluid containers using the Azure Fluid Relay service",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,42 +47,41 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/public.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/container-definitions": "~2.50.0",
51
- "@fluidframework/container-loader": "~2.50.0",
52
- "@fluidframework/core-interfaces": "~2.50.0",
53
- "@fluidframework/driver-definitions": "~2.50.0",
54
- "@fluidframework/driver-utils": "~2.50.0",
55
- "@fluidframework/fluid-static": "~2.50.0",
56
- "@fluidframework/routerlicious-driver": "~2.50.0",
57
- "@fluidframework/telemetry-utils": "~2.50.0"
50
+ "@fluidframework/container-definitions": "~2.51.0",
51
+ "@fluidframework/container-loader": "~2.51.0",
52
+ "@fluidframework/core-interfaces": "~2.51.0",
53
+ "@fluidframework/driver-definitions": "~2.51.0",
54
+ "@fluidframework/driver-utils": "~2.51.0",
55
+ "@fluidframework/fluid-static": "~2.51.0",
56
+ "@fluidframework/routerlicious-driver": "~2.51.0",
57
+ "@fluidframework/telemetry-utils": "~2.51.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@arethetypeswrong/cli": "^0.17.1",
61
61
  "@biomejs/biome": "~1.9.3",
62
62
  "@fluid-tools/build-cli": "^0.56.0",
63
- "@fluidframework/azure-client-previous": "npm:@fluidframework/azure-client@2.43.0",
64
- "@fluidframework/azure-local-service": "~2.50.0",
63
+ "@fluidframework/azure-client-previous": "npm:@fluidframework/azure-client@2.50.0",
64
+ "@fluidframework/azure-local-service": "~2.51.0",
65
65
  "@fluidframework/build-common": "^2.0.3",
66
66
  "@fluidframework/build-tools": "^0.56.0",
67
- "@fluidframework/container-runtime": "~2.50.0",
67
+ "@fluidframework/container-runtime": "~2.51.0",
68
68
  "@fluidframework/eslint-config-fluid": "^5.7.4",
69
- "@fluidframework/test-runtime-utils": "~2.50.0",
70
- "@fluidframework/test-utils": "~2.50.0",
69
+ "@fluidframework/test-runtime-utils": "~2.51.0",
70
+ "@fluidframework/test-utils": "~2.51.0",
71
71
  "@microsoft/api-extractor": "7.52.8",
72
72
  "@types/mocha": "^10.0.10",
73
73
  "@types/node": "^18.19.0",
74
- "@types/uuid": "^9.0.2",
75
74
  "concurrently": "^8.2.1",
76
75
  "copyfiles": "^2.4.1",
77
76
  "cross-env": "^7.0.3",
78
77
  "eslint": "~8.55.0",
79
78
  "eslint-config-prettier": "~9.0.0",
80
- "fluid-framework": "~2.50.0",
79
+ "fluid-framework": "~2.51.0",
81
80
  "mocha": "^10.8.2",
82
81
  "rimraf": "^4.4.0",
83
82
  "start-server-and-test": "^2.0.3",
84
83
  "typescript": "~5.4.5",
85
- "uuid": "^9.0.0"
84
+ "uuid": "^11.1.0"
86
85
  },
87
86
  "typeValidation": {
88
87
  "broken": {},
@@ -7,6 +7,7 @@ import { AttachState } from "@fluidframework/container-definitions";
7
7
  import {
8
8
  type IContainer,
9
9
  type IFluidModuleWithDetails,
10
+ type IRuntimeFactory,
10
11
  LoaderHeader,
11
12
  } from "@fluidframework/container-definitions/internal";
12
13
  import {
@@ -42,6 +43,7 @@ import { createAzureAudienceMember } from "./AzureAudience.js";
42
43
  import { AzureUrlResolver, createAzureCreateNewRequest } from "./AzureUrlResolver.js";
43
44
  import type {
44
45
  AzureClientProps,
46
+ AzureClientPropsInternal,
45
47
  AzureConnectionConfig,
46
48
  AzureContainerServices,
47
49
  AzureContainerVersion,
@@ -93,6 +95,14 @@ export class AzureClient {
93
95
  private readonly connectionConfig: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;
94
96
  private readonly logger: ITelemetryBaseLogger | undefined;
95
97
 
98
+ private readonly createContainerRuntimeFactory?: ({
99
+ schema,
100
+ compatibilityMode,
101
+ }: {
102
+ schema: ContainerSchema;
103
+ compatibilityMode: CompatibilityMode;
104
+ }) => IRuntimeFactory;
105
+
96
106
  /**
97
107
  * Creates a new client instance using configuration parameters.
98
108
  * @param properties - Properties for initializing a new AzureClient instance
@@ -117,6 +127,10 @@ export class AzureClient {
117
127
  properties.summaryCompression,
118
128
  );
119
129
  this.configProvider = wrapConfigProvider(properties.configProvider);
130
+
131
+ this.createContainerRuntimeFactory = (
132
+ properties as Partial<AzureClientPropsInternal>
133
+ ).createContainerRuntimeFactory;
120
134
  }
121
135
 
122
136
  /**
@@ -274,10 +288,16 @@ export class AzureClient {
274
288
  schema: ContainerSchema,
275
289
  compatibilityMode: CompatibilityMode,
276
290
  ): ILoaderProps {
277
- const runtimeFactory = createDOProviderContainerRuntimeFactory({
278
- schema,
279
- compatibilityMode,
280
- });
291
+ const runtimeFactory = this.createContainerRuntimeFactory
292
+ ? this.createContainerRuntimeFactory({
293
+ schema,
294
+ compatibilityMode,
295
+ })
296
+ : createDOProviderContainerRuntimeFactory({
297
+ schema,
298
+ compatibilityMode,
299
+ });
300
+
281
301
  const load = async (): Promise<IFluidModuleWithDetails> => {
282
302
  return {
283
303
  module: { fluidExport: runtimeFactory },
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@
12
12
  export { AzureClient } from "./AzureClient.js";
13
13
  export type {
14
14
  AzureClientProps,
15
+ AzureClientPropsInternal,
15
16
  AzureConnectionConfig,
16
17
  AzureConnectionConfigType,
17
18
  AzureContainerServices,
package/src/interfaces.ts CHANGED
@@ -3,13 +3,19 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import type { IRuntimeFactory } from "@fluidframework/container-definitions/internal";
6
7
  import type {
7
8
  IConfigProviderBase,
8
9
  ITelemetryBaseLogger,
9
10
  } from "@fluidframework/core-interfaces";
10
11
  import type { IUser } from "@fluidframework/driver-definitions";
11
12
  import type { ICompressionStorageConfig } from "@fluidframework/driver-utils";
12
- import type { IMember, IServiceAudience } from "@fluidframework/fluid-static";
13
+ import type {
14
+ CompatibilityMode,
15
+ ContainerSchema,
16
+ IMember,
17
+ IServiceAudience,
18
+ } from "@fluidframework/fluid-static";
13
19
  import type { ITokenProvider } from "@fluidframework/routerlicious-driver";
14
20
 
15
21
  /**
@@ -34,6 +40,23 @@ export interface AzureClientProps {
34
40
  readonly summaryCompression?: boolean | ICompressionStorageConfig;
35
41
  }
36
42
 
43
+ /**
44
+ * Internal only {@link AzureClientProps}.
45
+ * @internal
46
+ */
47
+ export interface AzureClientPropsInternal extends AzureClientProps {
48
+ /**
49
+ * Optional override for the container runtime factory used by the client.
50
+ */
51
+ readonly createContainerRuntimeFactory?: ({
52
+ schema,
53
+ compatibilityMode,
54
+ }: {
55
+ schema: ContainerSchema;
56
+ compatibilityMode: CompatibilityMode;
57
+ }) => IRuntimeFactory;
58
+ }
59
+
37
60
  /**
38
61
  * Container version metadata.
39
62
  * @public