@fluidframework/azure-client 2.118.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +128 -4
  2. package/README.md +57 -54
  3. package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
  4. package/api-report/azure-client.beta.api.md +5 -19
  5. package/api-report/azure-client.legacy.beta.api.md +5 -19
  6. package/api-report/azure-client.legacy.public.api.md +5 -19
  7. package/api-report/azure-client.public.api.md +5 -19
  8. package/dist/AzureAudience.js +1 -2
  9. package/dist/AzureAudience.js.map +1 -1
  10. package/dist/AzureClient.d.ts +1 -45
  11. package/dist/AzureClient.d.ts.map +1 -1
  12. package/dist/AzureClient.js +15 -18
  13. package/dist/AzureClient.js.map +1 -1
  14. package/dist/AzureUrlResolver.d.ts.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/legacy.d.ts +2 -2
  19. package/dist/public.d.ts +2 -2
  20. package/dist/utils.js +2 -3
  21. package/dist/utils.js.map +1 -1
  22. package/lib/AzureClient.d.ts +1 -45
  23. package/lib/AzureClient.d.ts.map +1 -1
  24. package/lib/AzureClient.js +16 -19
  25. package/lib/AzureClient.js.map +1 -1
  26. package/lib/AzureUrlResolver.d.ts.map +1 -1
  27. package/lib/index.d.ts +1 -1
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js.map +1 -1
  30. package/lib/legacy.d.ts +3 -3
  31. package/lib/public.d.ts +3 -3
  32. package/package.json +43 -52
  33. package/src/AzureClient.ts +10 -81
  34. package/src/index.ts +3 -3
  35. package/tsconfig.json +1 -1
  36. package/internal.d.ts +0 -11
  37. package/legacy.d.ts +0 -11
  38. /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
  39. /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
@@ -1 +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DAAkD,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\t// eslint-disable-next-line import-x/no-deprecated\n\tCompatibilityMode,\n} from \"@fluidframework/fluid-static\";\nimport {\n\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\tcreateServiceAudience,\n\tresolveCompatibilityModeToMinVersionForCollab,\n} from \"@fluidframework/fluid-static/internal\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver/internal\";\nimport type { OldestSupportedClientVersion } from \"@fluidframework/runtime-definitions\";\nimport { wrapConfigProviderWithDefaults } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { createAzureAudienceMember } from \"./AzureAudience.js\";\nimport { AzureUrlResolver, createAzureCreateNewRequest } from \"./AzureUrlResolver.js\";\nimport type {\n\tAzureClientProps,\n\tAzureClientPropsInternal,\n\tAzureConnectionConfig,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces.js\";\nimport { isAzureRemoteConnectionConfig } from \"./utils.js\";\n\n/**\n * Strongly typed id for connecting to a local Azure Fluid Relay.\n */\nconst LOCAL_MODE_TENANT_ID = \"local\";\nconst getTenantId = (connectionProperties: AzureConnectionConfig): string => {\n\treturn isAzureRemoteConnectionConfig(connectionProperties)\n\t\t? connectionProperties.tenantId\n\t\t: LOCAL_MODE_TENANT_ID;\n};\n\nconst MAX_VERSION_COUNT = 5;\n\n/**\n * Default feature gates.\n * These values will only be used if the feature gate is not already set by the supplied config provider.\n */\nconst azureClientFeatureGates = {\n\t// Azure client requires a write connection by default\n\t\"Fluid.Container.ForceWriteConnection\": true,\n};\n\n/**\n * Wrap the config provider to fall back on the appropriate defaults for Azure Client.\n * @param baseConfigProvider - The base config provider to wrap\n * @returns A new config provider with the appropriate defaults applied underneath the given provider\n */\nfunction wrapConfigProvider(baseConfigProvider?: IConfigProviderBase): IConfigProviderBase {\n\treturn wrapConfigProviderWithDefaults(baseConfigProvider, azureClientFeatureGates);\n}\n\n/**\n * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,\n * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.\n * @public\n */\nexport class AzureClient {\n\tprivate readonly documentServiceFactory: IDocumentServiceFactory;\n\tprivate readonly urlResolver: IUrlResolver;\n\tprivate readonly configProvider: IConfigProviderBase | undefined;\n\tprivate readonly connectionConfig: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\tprivate readonly logger: ITelemetryBaseLogger | undefined;\n\n\tprivate readonly createContainerRuntimeFactory?: ({\n\t\tschema,\n\t\tminVersionForCollaboration,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tminVersionForCollaboration: OldestSupportedClientVersion;\n\t}) => IRuntimeFactory;\n\n\t/**\n\t * Creates a new client instance using configuration parameters.\n\t * @param properties - Properties for initializing a new AzureClient instance\n\t */\n\tpublic constructor(properties: AzureClientProps) {\n\t\tthis.connectionConfig = properties.connection;\n\t\tthis.logger = properties.logger;\n\t\t// remove trailing slash from URL if any\n\t\tthis.connectionConfig.endpoint = this.connectionConfig.endpoint.replace(/\\/$/, \"\");\n\t\tthis.urlResolver = new AzureUrlResolver();\n\t\t// The local service implementation differs from the Azure Fluid Relay in blob\n\t\t// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.\n\t\tconst isRemoteConnection = isAzureRemoteConnectionConfig(this.connectionConfig);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.connectionConfig.tokenProvider, {\n\t\t\t\tenableWholeSummaryUpload: isRemoteConnection,\n\t\t\t\tenableDiscovery: isRemoteConnection,\n\t\t\t});\n\n\t\tthis.documentServiceFactory = applyStorageCompression(\n\t\t\torigDocumentServiceFactory,\n\t\t\tproperties.summaryCompression,\n\t\t);\n\t\tthis.configProvider = wrapConfigProvider(properties.configProvider);\n\n\t\tthis.createContainerRuntimeFactory = (\n\t\t\tproperties as Partial<AzureClientPropsInternal>\n\t\t).createContainerRuntimeFactory;\n\t}\n\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param containerSchema - Container schema for the new container.\n\t * @param oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * container opts into the latest defaults.\n\t * @returns New detached container instance along with associated services.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * This does not normally need to be specified explicitly.\n\t * @param containerSchema - Container schema for the new container.\n\t * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.\n\t * @returns New detached container instance along with associated services.\n\t * @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `\"2.0.0\"`) instead. The legacy\n\t * values `\"1\"` and `\"2\"` correspond to `\"1.0.0\"` and `\"2.0.0\"` respectively.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: OldestSupportedClientVersion | CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\n\t\tconst container = await createDetachedContainer({\n\t\t\t...loaderProps,\n\t\t\tcodeDetails: {\n\t\t\t\tpackage: \"no-dynamic-package\",\n\t\t\t\tconfig: {},\n\t\t\t},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.connectionConfig,\n\t\t);\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Accesses the existing container given its unique ID in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * container opts into the latest defaults.\n\t * @returns Existing container instance along with associated services.\n\t */\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\t/**\n\t * Accesses the existing container given its unique ID in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.\n\t * @returns Existing container instance along with associated services.\n\t * @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `\"2.0.0\"`) instead. The legacy\n\t * values `\"1\"` and `\"2\"` correspond to `\"1.0.0\"` and `\"2.0.0\"` respectively.\n\t */\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: OldestSupportedClientVersion | CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst container = await loadExistingContainer({\n\t\t\t...loaderProps,\n\t\t\trequest: { url: url.href },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Load a specific version of a container for viewing only.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param version - Unique version of the source container in Azure Fluid Relay.\n\t * @param oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * container opts into the latest defaults.\n\t * @returns Loaded container instance at the specified version.\n\t */\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}>;\n\t/**\n\t * Load a specific version of a container for viewing only.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param version - Unique version of the source container in Azure Fluid Relay.\n\t * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.\n\t * @returns Loaded container instance at the specified version.\n\t * @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `\"2.0.0\"`) instead. The legacy\n\t * values `\"1\"` and `\"2\"` correspond to `\"1.0.0\"` and `\"2.0.0\"` respectively.\n\t */\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}>;\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: OldestSupportedClientVersion | CompatibilityMode,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loadContainerPaused(loaderProps, {\n\t\t\turl: url.href,\n\t\t\theaders: { [LoaderHeader.version]: version.id },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\treturn { container: fluidContainer };\n\t}\n\n\t/**\n\t * Get the list of versions for specific container.\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param options - \"Get\" options. If options are not provided, API\n\t * will assume maxCount of versions to retrieve to be 5.\n\t * @returns Array of available container versions.\n\t */\n\tpublic async getContainerVersions(\n\t\tid: string,\n\t\toptions?: AzureGetVersionsOptions,\n\t): Promise<AzureContainerVersion[]> {\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst resolvedUrl = await this.urlResolver.resolve({ url: url.href });\n\t\tif (!resolvedUrl) {\n\t\t\tthrow new Error(\"Unable to resolved URL\");\n\t\t}\n\t\tconst documentService =\n\t\t\tawait this.documentServiceFactory.createDocumentService(resolvedUrl);\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\t// External API uses null\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tconst versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);\n\n\t\treturn versions.map((item) => {\n\t\t\treturn { id: item.id, date: item.date };\n\t\t});\n\t}\n\n\tprivate getContainerServices(container: IContainer): AzureContainerServices {\n\t\treturn {\n\t\t\taudience: createServiceAudience({\n\t\t\t\tcontainer,\n\t\t\t\tcreateServiceMember: createAzureAudienceMember,\n\t\t\t}),\n\t\t};\n\t}\n\n\tprivate getLoaderProps(\n\t\tschema: ContainerSchema,\n\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\tcompatibilityMode: OldestSupportedClientVersion | CompatibilityMode,\n\t): ILoaderProps {\n\t\tconst minVersionForCollaboration =\n\t\t\tresolveCompatibilityModeToMinVersionForCollab(compatibilityMode);\n\t\tconst runtimeFactory = this.createContainerRuntimeFactory\n\t\t\t? this.createContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration,\n\t\t\t\t})\n\t\t\t: createDOProviderContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration,\n\t\t\t\t});\n\n\t\tconst load = async (): Promise<IFluidModuleWithDetails> => {\n\t\t\treturn {\n\t\t\t\tmodule: { fluidExport: runtimeFactory },\n\t\t\t\tdetails: { package: \"no-dynamic-package\", config: {} },\n\t\t\t};\n\t\t};\n\n\t\tconst codeLoader = { load };\n\t\tconst client: IClient = {\n\t\t\tdetails: {\n\t\t\t\tcapabilities: { interactive: true },\n\t\t\t},\n\t\t\tpermission: [],\n\t\t\tscopes: [],\n\t\t\tuser: { id: \"\" },\n\t\t\tmode: \"write\",\n\t\t};\n\n\t\treturn {\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.logger,\n\t\t\toptions: { client },\n\t\t\tconfigProvider: this.configProvider,\n\t\t};\n\t}\n\n\tprivate async createFluidContainer<TContainerSchema extends ContainerSchema>(\n\t\tcontainer: IContainer,\n\t\tconnection: AzureConnectionConfig,\n\t): Promise<IFluidContainer<TContainerSchema>> {\n\t\tconst createNewRequest = createAzureCreateNewRequest(\n\t\t\tconnection.endpoint,\n\t\t\tgetTenantId(connection),\n\t\t);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\tif (container.attachState !== AttachState.Detached) {\n\t\t\t\tthrow new Error(\"Cannot attach container. Container is not in detached state\");\n\t\t\t}\n\t\t\tawait container.attach(createNewRequest);\n\t\t\tif (container.resolvedUrl === undefined) {\n\t\t\t\tthrow new Error(\"Resolved Url not available on attached container\");\n\t\t\t}\n\t\t\treturn container.resolvedUrl.id;\n\t\t};\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\t// #endregion\n}\n"]}
1
+ {"version":3,"file":"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AAC,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 { ContainerSchema, IFluidContainer } from \"@fluidframework/fluid-static\";\nimport {\n\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static/internal\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver/internal\";\nimport type { OldestSupportedClientVersion } from \"@fluidframework/runtime-definitions\";\nimport { wrapConfigProviderWithDefaults } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { createAzureAudienceMember } from \"./AzureAudience.js\";\nimport { AzureUrlResolver, createAzureCreateNewRequest } from \"./AzureUrlResolver.js\";\nimport type {\n\tAzureClientProps,\n\tAzureClientPropsInternal,\n\tAzureConnectionConfig,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces.js\";\nimport { isAzureRemoteConnectionConfig } from \"./utils.js\";\n\n/**\n * Strongly typed id for connecting to a local Azure Fluid Relay.\n */\nconst LOCAL_MODE_TENANT_ID = \"local\";\nconst getTenantId = (connectionProperties: AzureConnectionConfig): string => {\n\treturn isAzureRemoteConnectionConfig(connectionProperties)\n\t\t? connectionProperties.tenantId\n\t\t: LOCAL_MODE_TENANT_ID;\n};\n\nconst MAX_VERSION_COUNT = 5;\n\n/**\n * Default feature gates.\n * These values will only be used if the feature gate is not already set by the supplied config provider.\n */\nconst azureClientFeatureGates = {\n\t// Azure client requires a write connection by default\n\t\"Fluid.Container.ForceWriteConnection\": true,\n};\n\n/**\n * Wrap the config provider to fall back on the appropriate defaults for Azure Client.\n * @param baseConfigProvider - The base config provider to wrap\n * @returns A new config provider with the appropriate defaults applied underneath the given provider\n */\nfunction wrapConfigProvider(baseConfigProvider?: IConfigProviderBase): IConfigProviderBase {\n\treturn wrapConfigProviderWithDefaults(baseConfigProvider, azureClientFeatureGates);\n}\n\n/**\n * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,\n * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.\n * @public\n */\nexport class AzureClient {\n\tprivate readonly documentServiceFactory: IDocumentServiceFactory;\n\tprivate readonly urlResolver: IUrlResolver;\n\tprivate readonly configProvider: IConfigProviderBase | undefined;\n\tprivate readonly connectionConfig: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\tprivate readonly logger: ITelemetryBaseLogger | undefined;\n\n\tprivate readonly createContainerRuntimeFactory?: ({\n\t\tschema,\n\t\tminVersionForCollaboration,\n\t}: {\n\t\tschema: ContainerSchema;\n\t\tminVersionForCollaboration: OldestSupportedClientVersion;\n\t}) => IRuntimeFactory;\n\n\t/**\n\t * Creates a new client instance using configuration parameters.\n\t * @param properties - Properties for initializing a new AzureClient instance\n\t */\n\tpublic constructor(properties: AzureClientProps) {\n\t\tthis.connectionConfig = properties.connection;\n\t\tthis.logger = properties.logger;\n\t\t// remove trailing slash from URL if any\n\t\tthis.connectionConfig.endpoint = this.connectionConfig.endpoint.replace(/\\/$/, \"\");\n\t\tthis.urlResolver = new AzureUrlResolver();\n\t\t// The local service implementation differs from the Azure Fluid Relay in blob\n\t\t// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.\n\t\tconst isRemoteConnection = isAzureRemoteConnectionConfig(this.connectionConfig);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.connectionConfig.tokenProvider, {\n\t\t\t\tenableWholeSummaryUpload: isRemoteConnection,\n\t\t\t\tenableDiscovery: isRemoteConnection,\n\t\t\t});\n\n\t\tthis.documentServiceFactory = applyStorageCompression(\n\t\t\torigDocumentServiceFactory,\n\t\t\tproperties.summaryCompression,\n\t\t);\n\t\tthis.configProvider = wrapConfigProvider(properties.configProvider);\n\n\t\tthis.createContainerRuntimeFactory = (\n\t\t\tproperties as Partial<AzureClientPropsInternal>\n\t\t).createContainerRuntimeFactory;\n\t}\n\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param containerSchema - Container schema for the new container.\n\t * @param oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * container opts into the latest defaults.\n\t * @returns New detached container instance along with associated services.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);\n\n\t\tconst container = await createDetachedContainer({\n\t\t\t...loaderProps,\n\t\t\tcodeDetails: {\n\t\t\t\tpackage: \"no-dynamic-package\",\n\t\t\t\tconfig: {},\n\t\t\t},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.connectionConfig,\n\t\t);\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Accesses the existing container given its unique ID in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * container opts into the latest defaults.\n\t * @returns Existing container instance along with associated services.\n\t */\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}>;\n\tpublic async getContainer<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst container = await loadExistingContainer({\n\t\t\t...loaderProps,\n\t\t\trequest: { url: url.href },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * Load a specific version of a container for viewing only.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param containerSchema - Container schema used to access data objects in the container.\n\t * @param version - Unique version of the source container in Azure Fluid Relay.\n\t * @param oldestSupportedClient - Oldest Fluid Framework client version that must be able to\n\t * open and process documents written by this client. Choosing an older version may limit\n\t * available features and write formats. Prefer the current Fluid Framework version so the\n\t * container opts into the latest defaults.\n\t * @returns Loaded container instance at the specified version.\n\t */\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}>;\n\tpublic async viewContainerVersion<TContainerSchema extends ContainerSchema>(\n\t\tid: string,\n\t\tcontainerSchema: TContainerSchema,\n\t\tversion: AzureContainerVersion,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}> {\n\t\tconst loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loadContainerPaused(loaderProps, {\n\t\t\turl: url.href,\n\t\t\theaders: { [LoaderHeader.version]: version.id },\n\t\t});\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\treturn { container: fluidContainer };\n\t}\n\n\t/**\n\t * Get the list of versions for specific container.\n\t * @param id - Unique ID of the source container in Azure Fluid Relay.\n\t * @param options - \"Get\" options. If options are not provided, API\n\t * will assume maxCount of versions to retrieve to be 5.\n\t * @returns Array of available container versions.\n\t */\n\tpublic async getContainerVersions(\n\t\tid: string,\n\t\toptions?: AzureGetVersionsOptions,\n\t): Promise<AzureContainerVersion[]> {\n\t\tconst url = new URL(this.connectionConfig.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.connectionConfig.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.connectionConfig)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst resolvedUrl = await this.urlResolver.resolve({ url: url.href });\n\t\tif (!resolvedUrl) {\n\t\t\tthrow new Error(\"Unable to resolved URL\");\n\t\t}\n\t\tconst documentService =\n\t\t\tawait this.documentServiceFactory.createDocumentService(resolvedUrl);\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\t// External API uses null\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tconst versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);\n\n\t\treturn versions.map((item) => {\n\t\t\treturn { id: item.id, date: item.date };\n\t\t});\n\t}\n\n\tprivate getContainerServices(container: IContainer): AzureContainerServices {\n\t\treturn {\n\t\t\taudience: createServiceAudience({\n\t\t\t\tcontainer,\n\t\t\t\tcreateServiceMember: createAzureAudienceMember,\n\t\t\t}),\n\t\t};\n\t}\n\n\tprivate getLoaderProps(\n\t\tschema: ContainerSchema,\n\t\toldestSupportedClient: OldestSupportedClientVersion,\n\t): ILoaderProps {\n\t\tconst runtimeFactory = this.createContainerRuntimeFactory\n\t\t\t? this.createContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration: oldestSupportedClient,\n\t\t\t\t})\n\t\t\t: createDOProviderContainerRuntimeFactory({\n\t\t\t\t\tschema,\n\t\t\t\t\tminVersionForCollaboration: oldestSupportedClient,\n\t\t\t\t});\n\n\t\tconst load = async (): Promise<IFluidModuleWithDetails> => {\n\t\t\treturn {\n\t\t\t\tmodule: { fluidExport: runtimeFactory },\n\t\t\t\tdetails: { package: \"no-dynamic-package\", config: {} },\n\t\t\t};\n\t\t};\n\n\t\tconst codeLoader = { load };\n\t\tconst client: IClient = {\n\t\t\tdetails: {\n\t\t\t\tcapabilities: { interactive: true },\n\t\t\t},\n\t\t\tpermission: [],\n\t\t\tscopes: [],\n\t\t\tuser: { id: \"\" },\n\t\t\tmode: \"write\",\n\t\t};\n\n\t\treturn {\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.logger,\n\t\t\toptions: { client },\n\t\t\tconfigProvider: this.configProvider,\n\t\t};\n\t}\n\n\tprivate async createFluidContainer<TContainerSchema extends ContainerSchema>(\n\t\tcontainer: IContainer,\n\t\tconnection: AzureConnectionConfig,\n\t): Promise<IFluidContainer<TContainerSchema>> {\n\t\tconst createNewRequest = createAzureCreateNewRequest(\n\t\t\tconnection.endpoint,\n\t\t\tgetTenantId(connection),\n\t\t);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\tif (container.attachState !== AttachState.Detached) {\n\t\t\t\tthrow new Error(\"Cannot attach container. Container is not in detached state\");\n\t\t\t}\n\t\t\tawait container.attach(createNewRequest);\n\t\t\tif (container.resolvedUrl === undefined) {\n\t\t\t\tthrow new Error(\"Resolved Url not available on attached container\");\n\t\t\t}\n\t\t\treturn container.resolvedUrl.id;\n\t\t};\n\t\tconst fluidContainer = await createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t});\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\t// #endregion\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureUrlResolver.d.ts","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,YAAY;;IAGvC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCjD,cAAc,CAC1B,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;CAMlB;AAgCD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,gBAC1B,MAAM,YACT,MAAM,KACd,QAUF,CAAC"}
1
+ {"version":3,"file":"AzureUrlResolver.d.ts","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,YAAY;;IAGvC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCjD,cAAc,CAC1B,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;CAMlB;AAgCD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACvC,aAAa,MAAM,EACnB,UAAU,MAAM,KACd,QAUF,CAAC"}
package/lib/index.d.ts CHANGED
@@ -11,6 +11,6 @@ export { AzureClient } from "./AzureClient.js";
11
11
  export type { AzureClientProps, AzureClientPropsInternal, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.js";
12
12
  export type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
13
13
  export type { IUser } from "@fluidframework/driver-definitions";
14
+ export type { OldestSupportedClientVersion } from "@fluidframework/runtime-definitions";
14
15
  export type { ITelemetryBaseEvent, ITelemetryBaseLogger, } from "@fluidframework/core-interfaces";
15
- export type { CompatibilityMode } from "@fluidframework/fluid-static";
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACX,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,cAAc,GACd,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3F,YAAY,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAGhE,YAAY,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,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGxF,YAAY,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,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\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"]}
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 use parameter types without pulling in runtime-definitions.\nexport type { OldestSupportedClientVersion } from \"@fluidframework/runtime-definitions\";\n\n// Re-export so developers can build loggers without pulling in core-interfaces\nexport type {\n\tITelemetryBaseEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n"]}
package/lib/legacy.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
8
+ * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  /**
@@ -26,12 +26,12 @@ export {
26
26
  AzureLocalConnectionConfig,
27
27
  AzureMember,
28
28
  AzureRemoteConnectionConfig,
29
- CompatibilityMode,
30
29
  IAzureAudience,
31
30
  ITelemetryBaseEvent,
32
31
  ITelemetryBaseLogger,
33
32
  ITokenProvider,
34
33
  ITokenResponse,
35
- IUser
34
+ IUser,
35
+ OldestSupportedClientVersion
36
36
  // #endregion
37
37
  } from "./index.js";
package/lib/public.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
8
+ * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  /**
@@ -26,12 +26,12 @@ export {
26
26
  AzureLocalConnectionConfig,
27
27
  AzureMember,
28
28
  AzureRemoteConnectionConfig,
29
- CompatibilityMode,
30
29
  IAzureAudience,
31
30
  ITelemetryBaseEvent,
32
31
  ITelemetryBaseLogger,
33
32
  ITokenProvider,
34
33
  ITokenResponse,
35
- IUser
34
+ IUser,
35
+ OldestSupportedClientVersion
36
36
  // #endregion
37
37
  } from "./index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/azure-client",
3
- "version": "2.118.0",
3
+ "version": "3.0.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": {
@@ -14,62 +14,48 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
17
- "import": {
18
- "types": "./lib/public.d.ts",
19
- "default": "./lib/index.js"
20
- },
21
- "require": {
22
- "types": "./dist/public.d.ts",
23
- "default": "./dist/index.js"
17
+ "types": "./lib/public.d.ts",
18
+ "default": "./lib/index.js",
19
+ "internal-entrypoint-generation": {
20
+ "types": "./dist/public.d.ts"
24
21
  }
25
22
  },
26
23
  "./legacy": {
27
- "import": {
28
- "types": "./lib/legacy.d.ts",
29
- "default": "./lib/index.js"
30
- },
31
- "require": {
32
- "types": "./dist/legacy.d.ts",
33
- "default": "./dist/index.js"
24
+ "types": "./lib/legacy.d.ts",
25
+ "default": "./lib/index.js",
26
+ "internal-entrypoint-generation": {
27
+ "types": "./dist/legacy.d.ts"
34
28
  }
35
29
  },
36
30
  "./internal": {
37
- "import": {
38
- "types": "./lib/index.d.ts",
39
- "default": "./lib/index.js"
40
- },
41
- "require": {
42
- "types": "./dist/index.d.ts",
43
- "default": "./dist/index.js"
44
- }
31
+ "types": "./lib/index.d.ts",
32
+ "default": "./lib/index.js"
45
33
  }
46
34
  },
47
- "main": "lib/index.js",
48
- "types": "lib/public.d.ts",
49
35
  "dependencies": {
50
- "@fluidframework/container-definitions": "~2.118.0",
51
- "@fluidframework/container-loader": "~2.118.0",
52
- "@fluidframework/core-interfaces": "~2.118.0",
53
- "@fluidframework/driver-definitions": "~2.118.0",
54
- "@fluidframework/driver-utils": "~2.118.0",
55
- "@fluidframework/fluid-static": "~2.118.0",
56
- "@fluidframework/routerlicious-driver": "~2.118.0",
57
- "@fluidframework/runtime-definitions": "~2.118.0",
58
- "@fluidframework/telemetry-utils": "~2.118.0"
36
+ "@fluidframework/container-definitions": "~3.0.0",
37
+ "@fluidframework/container-loader": "~3.0.0",
38
+ "@fluidframework/core-interfaces": "~3.0.0",
39
+ "@fluidframework/driver-definitions": "~3.0.0",
40
+ "@fluidframework/driver-utils": "~3.0.0",
41
+ "@fluidframework/fluid-static": "~3.0.0",
42
+ "@fluidframework/routerlicious-driver": "~3.0.0",
43
+ "@fluidframework/runtime-definitions": "~3.0.0",
44
+ "@fluidframework/telemetry-utils": "~3.0.0"
59
45
  },
60
46
  "devDependencies": {
61
47
  "@arethetypeswrong/cli": "^0.18.5",
62
48
  "@biomejs/biome": "~2.4.5",
63
- "@fluid-internal/mocha-test-setup": "~2.118.0",
49
+ "@fluid-internal/mocha-test-setup": "~3.0.0",
64
50
  "@fluid-tools/build-cli": "^0.67.0",
65
51
  "@fluidframework/azure-client-previous": "npm:@fluidframework/azure-client@2.116.0",
66
- "@fluidframework/azure-local-service": "~2.118.0",
52
+ "@fluidframework/azure-local-service": "~3.0.0",
67
53
  "@fluidframework/build-common": "^2.0.3",
68
54
  "@fluidframework/build-tools": "^0.67.0",
69
- "@fluidframework/container-runtime": "~2.118.0",
55
+ "@fluidframework/container-runtime": "~3.0.0",
70
56
  "@fluidframework/eslint-config-fluid": "^14.0.0",
71
- "@fluidframework/test-runtime-utils": "~2.118.0",
72
- "@fluidframework/test-utils": "~2.118.0",
57
+ "@fluidframework/test-runtime-utils": "~3.0.0",
58
+ "@fluidframework/test-utils": "~3.0.0",
73
59
  "@microsoft/api-extractor": "7.58.1",
74
60
  "@types/mocha": "^10.0.10",
75
61
  "@types/node": "~22.19.17",
@@ -78,34 +64,40 @@
78
64
  "cross-env": "^10.1.0",
79
65
  "eslint": "~9.39.1",
80
66
  "eslint-config-prettier": "~10.1.8",
81
- "fluid-framework": "~2.118.0",
67
+ "fluid-framework": "~3.0.0",
82
68
  "jiti": "^2.6.1",
83
69
  "mocha": "^11.7.5",
84
70
  "rimraf": "^6.1.3",
85
71
  "start-server-and-test": "^2.0.3",
86
- "typescript": "~5.4.5",
72
+ "typescript": "~6.0.3",
87
73
  "uuid": "^11.1.0"
88
74
  },
89
75
  "typeValidation": {
90
- "broken": {},
76
+ "broken": {
77
+ "TypeAlias_CompatibilityMode": {
78
+ "forwardCompat": false,
79
+ "backCompat": false
80
+ }
81
+ },
91
82
  "entrypoint": "legacy"
92
83
  },
93
84
  "scripts": {
94
85
  "build": "fluid-build . --task build",
95
86
  "build:api-reports": "concurrently \"npm:build:api-reports:*\"",
96
- "build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
97
- "build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
87
+ "build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor-report.current.json",
88
+ "build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor-report.legacy.json",
89
+ "build:cjs": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
98
90
  "build:commonjs": "fluid-build . --task commonjs",
99
91
  "build:compile": "fluid-build . --task compile",
100
- "build:docs": "api-extractor run --local",
92
+ "build:docs": "api-extractor run --local --config api-extractor/api-extractor-model.json",
101
93
  "build:entrypoints": "fluid-build . --task build:entrypoints",
102
94
  "build:entrypoints:cjs": "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist",
103
- "build:entrypoints:esm": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat",
104
- "build:esnext": "tsc --project ./tsconfig.json",
95
+ "build:entrypoints:esm": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib",
96
+ "build:esm": "tsc --project ./tsconfig.json",
105
97
  "build:test": "concurrently npm:build:test:esm npm:build:test:cjs",
106
98
  "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
107
99
  "build:test:esm": "tsc --project ./src/test/tsconfig.json",
108
- "check:are-the-types-wrong": "attw --pack .",
100
+ "check:are-the-types-wrong": "attw --pack . --profile esm-only",
109
101
  "check:biome": "biome check .",
110
102
  "check:exports": "concurrently \"npm:check:exports:*\"",
111
103
  "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
@@ -115,9 +107,9 @@
115
107
  "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
116
108
  "check:format": "npm run check:biome",
117
109
  "ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
118
- "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
119
- "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
120
- "ci:build:docs": "api-extractor run",
110
+ "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor-report.current.json",
111
+ "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor-report.legacy.json",
112
+ "ci:build:docs": "api-extractor run --config api-extractor/api-extractor-model.json",
121
113
  "clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
122
114
  "eslint": "eslint --quiet --format stylish src",
123
115
  "eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
@@ -132,7 +124,6 @@
132
124
  "test:realsvc:local:run": "mocha --recursive lib/test --timeout 10000",
133
125
  "test:realsvc:tinylicious": "start-server-and-test start:tinylicious:test 7073 test:realsvc:local:run",
134
126
  "test:realsvc:tinylicious:report": "npm run test:realsvc:tinylicious",
135
- "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
136
127
  "typetests:gen": "flub generate typetests --dir . -v"
137
128
  }
138
129
  }
@@ -26,17 +26,11 @@ import type {
26
26
  IUrlResolver,
27
27
  } from "@fluidframework/driver-definitions/internal";
28
28
  import { applyStorageCompression } from "@fluidframework/driver-utils/internal";
29
- import type {
30
- ContainerSchema,
31
- IFluidContainer,
32
- // eslint-disable-next-line import-x/no-deprecated
33
- CompatibilityMode,
34
- } from "@fluidframework/fluid-static";
29
+ import type { ContainerSchema, IFluidContainer } from "@fluidframework/fluid-static";
35
30
  import {
36
31
  createDOProviderContainerRuntimeFactory,
37
32
  createFluidContainer,
38
33
  createServiceAudience,
39
- resolveCompatibilityModeToMinVersionForCollab,
40
34
  } from "@fluidframework/fluid-static/internal";
41
35
  import { RouterliciousDocumentServiceFactory } from "@fluidframework/routerlicious-driver/internal";
42
36
  import type { OldestSupportedClientVersion } from "@fluidframework/runtime-definitions";
@@ -154,33 +148,14 @@ export class AzureClient {
154
148
  container: IFluidContainer<TContainerSchema>;
155
149
  services: AzureContainerServices;
156
150
  }>;
157
- /**
158
- * Creates a new detached container instance in the Azure Fluid Relay.
159
- * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
160
- * This does not normally need to be specified explicitly.
161
- * @param containerSchema - Container schema for the new container.
162
- * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
163
- * @returns New detached container instance along with associated services.
164
- * @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
165
- * values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
166
- */
167
- public async createContainer<const TContainerSchema extends ContainerSchema>(
168
- containerSchema: TContainerSchema,
169
- // eslint-disable-next-line import-x/no-deprecated
170
- compatibilityMode: CompatibilityMode,
171
- ): Promise<{
172
- container: IFluidContainer<TContainerSchema>;
173
- services: AzureContainerServices;
174
- }>;
175
151
  public async createContainer<const TContainerSchema extends ContainerSchema>(
176
152
  containerSchema: TContainerSchema,
177
- // eslint-disable-next-line import-x/no-deprecated
178
- compatibilityMode: OldestSupportedClientVersion | CompatibilityMode,
153
+ oldestSupportedClient: OldestSupportedClientVersion,
179
154
  ): Promise<{
180
155
  container: IFluidContainer<TContainerSchema>;
181
156
  services: AzureContainerServices;
182
157
  }> {
183
- const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
158
+ const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
184
159
 
185
160
  const container = await createDetachedContainer({
186
161
  ...loaderProps,
@@ -218,36 +193,15 @@ export class AzureClient {
218
193
  container: IFluidContainer<TContainerSchema>;
219
194
  services: AzureContainerServices;
220
195
  }>;
221
- /**
222
- * Accesses the existing container given its unique ID in the Azure Fluid Relay.
223
- * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
224
- * (normally not explicitly specified.)
225
- * @param id - Unique ID of the container in Azure Fluid Relay.
226
- * @param containerSchema - Container schema used to access data objects in the container.
227
- * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
228
- * @returns Existing container instance along with associated services.
229
- * @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
230
- * values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
231
- */
232
- public async getContainer<TContainerSchema extends ContainerSchema>(
233
- id: string,
234
- containerSchema: TContainerSchema,
235
- // eslint-disable-next-line import-x/no-deprecated
236
- compatibilityMode: CompatibilityMode,
237
- ): Promise<{
238
- container: IFluidContainer<TContainerSchema>;
239
- services: AzureContainerServices;
240
- }>;
241
196
  public async getContainer<TContainerSchema extends ContainerSchema>(
242
197
  id: string,
243
198
  containerSchema: TContainerSchema,
244
- // eslint-disable-next-line import-x/no-deprecated
245
- compatibilityMode: OldestSupportedClientVersion | CompatibilityMode,
199
+ oldestSupportedClient: OldestSupportedClientVersion,
246
200
  ): Promise<{
247
201
  container: IFluidContainer<TContainerSchema>;
248
202
  services: AzureContainerServices;
249
203
  }> {
250
- const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
204
+ const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
251
205
  const url = new URL(this.connectionConfig.endpoint);
252
206
  url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
253
207
  url.searchParams.append(
@@ -288,37 +242,15 @@ export class AzureClient {
288
242
  ): Promise<{
289
243
  container: IFluidContainer<TContainerSchema>;
290
244
  }>;
291
- /**
292
- * Load a specific version of a container for viewing only.
293
- * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
294
- * (normally not explicitly specified.)
295
- * @param id - Unique ID of the source container in Azure Fluid Relay.
296
- * @param containerSchema - Container schema used to access data objects in the container.
297
- * @param version - Unique version of the source container in Azure Fluid Relay.
298
- * @param compatibilityMode - Legacy {@link @fluidframework/fluid-static#CompatibilityMode} value.
299
- * @returns Loaded container instance at the specified version.
300
- * @deprecated Pass an `OldestSupportedClientVersion` SemVer string (e.g. `"2.0.0"`) instead. The legacy
301
- * values `"1"` and `"2"` correspond to `"1.0.0"` and `"2.0.0"` respectively.
302
- */
303
- public async viewContainerVersion<TContainerSchema extends ContainerSchema>(
304
- id: string,
305
- containerSchema: TContainerSchema,
306
- version: AzureContainerVersion,
307
- // eslint-disable-next-line import-x/no-deprecated
308
- compatibilityMode: CompatibilityMode,
309
- ): Promise<{
310
- container: IFluidContainer<TContainerSchema>;
311
- }>;
312
245
  public async viewContainerVersion<TContainerSchema extends ContainerSchema>(
313
246
  id: string,
314
247
  containerSchema: TContainerSchema,
315
248
  version: AzureContainerVersion,
316
- // eslint-disable-next-line import-x/no-deprecated
317
- compatibilityMode: OldestSupportedClientVersion | CompatibilityMode,
249
+ oldestSupportedClient: OldestSupportedClientVersion,
318
250
  ): Promise<{
319
251
  container: IFluidContainer<TContainerSchema>;
320
252
  }> {
321
- const loaderProps = this.getLoaderProps(containerSchema, compatibilityMode);
253
+ const loaderProps = this.getLoaderProps(containerSchema, oldestSupportedClient);
322
254
  const url = new URL(this.connectionConfig.endpoint);
323
255
  url.searchParams.append("storage", encodeURIComponent(this.connectionConfig.endpoint));
324
256
  url.searchParams.append(
@@ -383,19 +315,16 @@ export class AzureClient {
383
315
 
384
316
  private getLoaderProps(
385
317
  schema: ContainerSchema,
386
- // eslint-disable-next-line import-x/no-deprecated
387
- compatibilityMode: OldestSupportedClientVersion | CompatibilityMode,
318
+ oldestSupportedClient: OldestSupportedClientVersion,
388
319
  ): ILoaderProps {
389
- const minVersionForCollaboration =
390
- resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
391
320
  const runtimeFactory = this.createContainerRuntimeFactory
392
321
  ? this.createContainerRuntimeFactory({
393
322
  schema,
394
- minVersionForCollaboration,
323
+ minVersionForCollaboration: oldestSupportedClient,
395
324
  })
396
325
  : createDOProviderContainerRuntimeFactory({
397
326
  schema,
398
- minVersionForCollaboration,
327
+ minVersionForCollaboration: oldestSupportedClient,
399
328
  });
400
329
 
401
330
  const load = async (): Promise<IFluidModuleWithDetails> => {
package/src/index.ts CHANGED
@@ -28,11 +28,11 @@ export type {
28
28
  export type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
29
29
  export type { IUser } from "@fluidframework/driver-definitions";
30
30
 
31
+ // Re-export so developers can use parameter types without pulling in runtime-definitions.
32
+ export type { OldestSupportedClientVersion } from "@fluidframework/runtime-definitions";
33
+
31
34
  // Re-export so developers can build loggers without pulling in core-interfaces
32
35
  export type {
33
36
  ITelemetryBaseEvent,
34
37
  ITelemetryBaseLogger,
35
38
  } from "@fluidframework/core-interfaces";
36
-
37
- // Re-export so developers have access to parameter types for createContainer/getContainer without pulling in fluid-static
38
- export type { CompatibilityMode } from "@fluidframework/fluid-static";
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../common/build/build-common/tsconfig.node16.json",
2
+ "extends": "../../../common/build/build-common/tsconfig.node20.json",
3
3
  "include": ["src/**/*"],
4
4
  "exclude": ["src/test/**/*"],
5
5
  "compilerOptions": {
package/internal.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- /*
7
- * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
9
- */
10
-
11
- export * from "./lib/index.js";
package/legacy.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- /*
7
- * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
9
- */
10
-
11
- export * from "./lib/legacy.js";