@fluidframework/azure-client 2.0.0-rc.4.0.6 → 2.0.0-rc.5.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 (70) hide show
  1. package/.eslintrc.cjs +8 -0
  2. package/CHANGELOG.md +12 -0
  3. package/api-extractor/api-extractor-lint-beta.cjs.json +5 -0
  4. package/api-extractor/api-extractor-lint-beta.esm.json +5 -0
  5. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  6. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  7. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  8. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  9. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  10. package/api-extractor.json +1 -1
  11. package/api-report/{azure-client.api.md → azure-client.alpha.api.md} +15 -27
  12. package/api-report/azure-client.beta.api.md +110 -0
  13. package/api-report/azure-client.public.api.md +110 -0
  14. package/biome.jsonc +4 -0
  15. package/dist/AzureAudience.d.ts +2 -2
  16. package/dist/AzureAudience.d.ts.map +1 -1
  17. package/dist/AzureAudience.js.map +1 -1
  18. package/dist/AzureClient.d.ts +8 -5
  19. package/dist/AzureClient.d.ts.map +1 -1
  20. package/dist/AzureClient.js +16 -10
  21. package/dist/AzureClient.js.map +1 -1
  22. package/dist/AzureFunctionTokenProvider.d.ts +2 -2
  23. package/dist/AzureFunctionTokenProvider.d.ts.map +1 -1
  24. package/dist/AzureFunctionTokenProvider.js.map +1 -1
  25. package/dist/AzureUrlResolver.d.ts +1 -1
  26. package/dist/AzureUrlResolver.d.ts.map +1 -1
  27. package/dist/AzureUrlResolver.js.map +1 -1
  28. package/dist/beta.d.ts +1 -1
  29. package/dist/index.d.ts +4 -3
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +2 -2
  32. package/dist/index.js.map +1 -1
  33. package/dist/interfaces.d.ts +10 -9
  34. package/dist/interfaces.d.ts.map +1 -1
  35. package/dist/interfaces.js.map +1 -1
  36. package/dist/legacy.d.ts +2 -1
  37. package/dist/public.d.ts +1 -1
  38. package/lib/AzureAudience.d.ts +2 -2
  39. package/lib/AzureAudience.d.ts.map +1 -1
  40. package/lib/AzureAudience.js.map +1 -1
  41. package/lib/AzureClient.d.ts +8 -5
  42. package/lib/AzureClient.d.ts.map +1 -1
  43. package/lib/AzureClient.js +16 -10
  44. package/lib/AzureClient.js.map +1 -1
  45. package/lib/AzureFunctionTokenProvider.d.ts +2 -2
  46. package/lib/AzureFunctionTokenProvider.d.ts.map +1 -1
  47. package/lib/AzureFunctionTokenProvider.js.map +1 -1
  48. package/lib/AzureUrlResolver.d.ts +1 -1
  49. package/lib/AzureUrlResolver.d.ts.map +1 -1
  50. package/lib/AzureUrlResolver.js.map +1 -1
  51. package/lib/beta.d.ts +1 -1
  52. package/lib/index.d.ts +4 -3
  53. package/lib/index.d.ts.map +1 -1
  54. package/lib/index.js +1 -1
  55. package/lib/index.js.map +1 -1
  56. package/lib/interfaces.d.ts +10 -9
  57. package/lib/interfaces.d.ts.map +1 -1
  58. package/lib/interfaces.js.map +1 -1
  59. package/lib/legacy.d.ts +2 -1
  60. package/lib/public.d.ts +1 -1
  61. package/lib/tsdoc-metadata.json +1 -1
  62. package/package.json +38 -37
  63. package/src/AzureAudience.ts +2 -2
  64. package/src/AzureClient.ts +42 -20
  65. package/src/AzureFunctionTokenProvider.ts +10 -4
  66. package/src/AzureUrlResolver.ts +11 -4
  67. package/src/index.ts +9 -3
  68. package/src/interfaces.ts +12 -11
  69. package/tsconfig.json +1 -0
  70. package/tsdoc.json +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AACpE,6EAIwD;AACxD,wEAAwF;AAExF,kEAA6D;AAK7D,oEAAgF;AAEhF,oEAK+C;AAE/C,4EAAoG;AACpG,uEAA0F;AAE1F,yD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CAmPC","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 { Loader, loadContainerPaused } from \"@fluidframework/container-loader/internal\";\nimport { type FluidObject, type IConfigProviderBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IDocumentServiceFactory,\n\ttype IUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { applyStorageCompression } from \"@fluidframework/driver-utils/internal\";\nimport { type ContainerSchema, type IFluidContainer } from \"@fluidframework/fluid-static\";\nimport {\n\ttype IRootDataObject,\n\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static/internal\";\nimport { type IClient } from \"@fluidframework/protocol-definitions\";\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 {\n\ttype AzureClientProps,\n\ttype AzureConnectionConfig,\n\ttype AzureContainerServices,\n\ttype AzureContainerVersion,\n\ttype AzureGetVersionsOptions,\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 * Feature gates required to support runtime compatibility when V1 and V2 clients are collaborating\n */\nconst azureClientV1CompatFeatureGates = {\n\t// Disable Garbage Collection\n\t\"Fluid.GarbageCollection.RunSweep\": false, // To prevent the GC op\n\t\"Fluid.GarbageCollection.DisableAutoRecovery\": true, // To prevent the GC op\n\t\"Fluid.GarbageCollection.ThrowOnTombstoneLoadOverride\": false, // For a consistent story of \"GC is disabled\"\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\tconst defaults = {\n\t\t...azureClientFeatureGates,\n\t\t...azureClientV1CompatFeatureGates,\n\t};\n\treturn wrapConfigProviderWithDefaults(baseConfigProvider, defaults);\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\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(private readonly properties: AzureClientProps) {\n\t\t// remove trailing slash from URL if any\n\t\tproperties.connection.endpoint = properties.connection.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.properties.connection);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.properties.connection.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 * @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): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loader = this.createLoader(containerSchema);\n\n\t\tconst container = await loader.createDetachedContainer({\n\t\t\tpackage: \"no-dynamic-package\",\n\t\t\tconfig: {},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.properties.connection,\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 * @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): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loader = this.createLoader(containerSchema);\n\t\tconst url = new URL(this.properties.connection.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.properties.connection.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loader.resolve({ url: url.href });\n\t\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\t\tconst fluidContainer = createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t\trootDataObject,\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 * @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): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t}> {\n\t\tconst loader = this.createLoader(containerSchema);\n\t\tconst url = new URL(this.properties.connection.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.properties.connection.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loadContainerPaused(loader, {\n\t\t\turl: url.href,\n\t\t\theaders: { [LoaderHeader.version]: version.id },\n\t\t});\n\t\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\t\tconst fluidContainer = createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t\trootDataObject,\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.properties.connection.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.properties.connection.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\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 createLoader(schema: ContainerSchema): Loader {\n\t\tconst runtimeFactory = createDOProviderContainerRuntimeFactory({ schema });\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 new Loader({\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.properties.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\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- AB#7608\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 = createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t\trootDataObject,\n\t\t});\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\n\tprivate async getContainerEntryPoint(container: IContainer): Promise<IRootDataObject> {\n\t\tconst rootDataObject: FluidObject<IRootDataObject> = await container.getEntryPoint();\n\t\tassert(\n\t\t\trootDataObject.IRootDataObject !== undefined,\n\t\t\t0x90a /* entryPoint must be of type IRootDataObject */,\n\t\t);\n\t\treturn rootDataObject.IRootDataObject;\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,6EAIwD;AACxD,wEAAwF;AAExF,kEAA6D;AAM7D,oEAAgF;AAMhF,oEAK+C;AAC/C,4EAAoG;AACpG,uEAA0F;AAE1F,yDAA+D;AAC/D,+DAAsF;AAQtF,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;;GAEG;AACH,MAAM,+BAA+B,GAAG;IACvC,6BAA6B;IAC7B,kCAAkC,EAAE,KAAK,EAAE,uBAAuB;IAClE,6CAA6C,EAAE,IAAI,EAAE,uBAAuB;IAC5E,sDAAsD,EAAE,KAAK,EAAE,6CAA6C;CAC5G,CAAC;AAEF;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,kBAAwC;IACnE,MAAM,QAAQ,GAAG;QAChB,GAAG,uBAAuB;QAC1B,GAAG,+BAA+B;KAClC,CAAC;IACF,OAAO,IAAA,yCAA8B,EAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAa,WAAW;IAKvB;;;OAGG;IACH,YAAoC,UAA4B;QAA5B,eA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DAAkD,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC;QACF,MAAM,cAAc,GAAG,IAAA,+BAAoB,EAAmB;YAC7D,SAAS;YACT,cAAc;SACd,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAAC,SAAqB;QACzD,MAAM,cAAc,GAAiC,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;QACrF,IAAA,iBAAM,EACL,cAAc,CAAC,eAAe,KAAK,SAAS,EAC5C,KAAK,CAAC,gDAAgD,CACtD,CAAC;QACF,OAAO,cAAc,CAAC,eAAe,CAAC;IACvC,CAAC;CAED;AArQD,kCAqQC","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 { Loader, loadContainerPaused } from \"@fluidframework/container-loader/internal\";\nimport type { FluidObject, IConfigProviderBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\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\ttype IRootDataObject,\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} 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 * Feature gates required to support runtime compatibility when V1 and V2 clients are collaborating\n */\nconst azureClientV1CompatFeatureGates = {\n\t// Disable Garbage Collection\n\t\"Fluid.GarbageCollection.RunSweep\": false, // To prevent the GC op\n\t\"Fluid.GarbageCollection.DisableAutoRecovery\": true, // To prevent the GC op\n\t\"Fluid.GarbageCollection.ThrowOnTombstoneLoadOverride\": false, // For a consistent story of \"GC is disabled\"\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\tconst defaults = {\n\t\t...azureClientFeatureGates,\n\t\t...azureClientV1CompatFeatureGates,\n\t};\n\treturn wrapConfigProviderWithDefaults(baseConfigProvider, defaults);\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\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(private readonly properties: AzureClientProps) {\n\t\t// remove trailing slash from URL if any\n\t\tproperties.connection.endpoint = properties.connection.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.properties.connection);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.properties.connection.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 loader = this.createLoader(containerSchema, compatibilityMode);\n\n\t\tconst container = await loader.createDetachedContainer({\n\t\t\tpackage: \"no-dynamic-package\",\n\t\t\tconfig: {},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.properties.connection,\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 loader = this.createLoader(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.properties.connection.endpoint);\n\t\turl.searchParams.append(\n\t\t\t\"storage\",\n\t\t\tencodeURIComponent(this.properties.connection.endpoint),\n\t\t);\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loader.resolve({ url: url.href });\n\t\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\t\tconst fluidContainer = createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t\trootDataObject,\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 loader = this.createLoader(containerSchema, compatibilityMode);\n\t\tconst url = new URL(this.properties.connection.endpoint);\n\t\turl.searchParams.append(\n\t\t\t\"storage\",\n\t\t\tencodeURIComponent(this.properties.connection.endpoint),\n\t\t);\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\t\tconst container = await loadContainerPaused(loader, {\n\t\t\turl: url.href,\n\t\t\theaders: { [LoaderHeader.version]: version.id },\n\t\t});\n\t\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\t\tconst fluidContainer = createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t\trootDataObject,\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.properties.connection.endpoint);\n\t\turl.searchParams.append(\n\t\t\t\"storage\",\n\t\t\tencodeURIComponent(this.properties.connection.endpoint),\n\t\t);\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\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 createLoader(schema: ContainerSchema, compatibilityMode: CompatibilityMode): Loader {\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 new Loader({\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.properties.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\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison -- AB#7608\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 = createFluidContainer<TContainerSchema>({\n\t\t\tcontainer,\n\t\t\trootDataObject,\n\t\t});\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\n\tprivate async getContainerEntryPoint(container: IContainer): Promise<IRootDataObject> {\n\t\tconst rootDataObject: FluidObject<IRootDataObject> = await container.getEntryPoint();\n\t\tassert(\n\t\t\trootDataObject.IRootDataObject !== undefined,\n\t\t\t0x90a /* entryPoint must be of type IRootDataObject */,\n\t\t);\n\t\treturn rootDataObject.IRootDataObject;\n\t}\n\t// #endregion\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ITokenProvider, type ITokenResponse } from "@fluidframework/routerlicious-driver";
6
- import { type AzureMember } from "./interfaces.js";
5
+ import type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
6
+ import type { AzureMember } from "./interfaces.js";
7
7
  /**
8
8
  * Token Provider implementation for connecting to an Azure Function endpoint for
9
9
  * Azure Fluid Relay token resolution.
@@ -1 +1 @@
1
- {"version":3,"file":"AzureFunctionTokenProvider.d.ts","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGhG,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,YAAW,cAAc;IAO/D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAPvB;;;;OAIG;gBAEe,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,yEAAwD;IAGlE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMjF,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;YAM/E,QAAQ;CAYtB"}
1
+ {"version":3,"file":"AzureFunctionTokenProvider.d.ts","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAG3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,YAAW,cAAc;IAO/D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAPvB;;;;OAIG;gBAEe,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,yEAAwD;IAGlE,iBAA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,CAAC;CACD;AAnCD,gEAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ITokenProvider, type ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nimport axios from \"axios\";\n\nimport { type AzureMember } from \"./interfaces.js\";\n\n/**\n * Token Provider implementation for connecting to an Azure Function endpoint for\n * Azure Fluid Relay token resolution.\n *\n * @deprecated 1.2.0, This API will be removed in 2.0.0\n * No replacement since it is not expected anyone will use this token provider as is\n * See https://github.com/microsoft/FluidFramework/issues/13693 for context\n * @internal\n */\nexport class AzureFunctionTokenProvider implements ITokenProvider {\n\t/**\n\t * Creates a new instance using configuration parameters.\n\t * @param azFunctionUrl - URL to Azure Function endpoint\n\t * @param user - User object\n\t */\n\tpublic constructor(\n\t\tprivate readonly azFunctionUrl: string,\n\t\tprivate readonly user?: Pick<AzureMember, \"id\" | \"name\" | \"additionalDetails\">,\n\t) {}\n\n\tpublic async fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tpublic async fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tprivate async getToken(tenantId: string, documentId?: string): Promise<string> {\n\t\tconst response = await axios.get(this.azFunctionUrl, {\n\t\t\tparams: {\n\t\t\t\ttenantId,\n\t\t\t\tdocumentId,\n\t\t\t\tid: this.user?.id,\n\t\t\t\tname: this.user?.name,\n\t\t\t\tadditionalDetails: this.user?.additionalDetails as unknown,\n\t\t\t},\n\t\t});\n\t\treturn response.data as string;\n\t}\n}\n"]}
1
+ {"version":3,"file":"AzureFunctionTokenProvider.js","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,kDAA0B;AAI1B;;;;;;;;GAQG;AACH,MAAa,0BAA0B;IACtC;;;;OAIG;IACH,YACkB,aAAqB,EACrB,IAA6D;QAD7D,kBAAa,GAAb,aAAa,CAAQ;QACrB,SAAI,GAAJ,IAAI,CAAyD;IAC5E,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAC7B,QAAgB,EAChB,UAAmB;QAEnB,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC7B,QAAgB,EAChB,UAAkB;QAElB,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,UAAmB;QAC3D,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE;YACpD,MAAM,EAAE;gBACP,QAAQ;gBACR,UAAU;gBACV,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI;gBACrB,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,iBAA4B;aAC1D;SACD,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAc,CAAC;IAChC,CAAC;CACD;AAzCD,gEAyCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nimport axios from \"axios\";\n\nimport type { AzureMember } from \"./interfaces.js\";\n\n/**\n * Token Provider implementation for connecting to an Azure Function endpoint for\n * Azure Fluid Relay token resolution.\n *\n * @deprecated 1.2.0, This API will be removed in 2.0.0\n * No replacement since it is not expected anyone will use this token provider as is\n * See https://github.com/microsoft/FluidFramework/issues/13693 for context\n * @internal\n */\nexport class AzureFunctionTokenProvider implements ITokenProvider {\n\t/**\n\t * Creates a new instance using configuration parameters.\n\t * @param azFunctionUrl - URL to Azure Function endpoint\n\t * @param user - User object\n\t */\n\tpublic constructor(\n\t\tprivate readonly azFunctionUrl: string,\n\t\tprivate readonly user?: Pick<AzureMember, \"id\" | \"name\" | \"additionalDetails\">,\n\t) {}\n\n\tpublic async fetchOrdererToken(\n\t\ttenantId: string,\n\t\tdocumentId?: string,\n\t): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tpublic async fetchStorageToken(\n\t\ttenantId: string,\n\t\tdocumentId: string,\n\t): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tprivate async getToken(tenantId: string, documentId?: string): Promise<string> {\n\t\tconst response = await axios.get(this.azFunctionUrl, {\n\t\t\tparams: {\n\t\t\t\ttenantId,\n\t\t\t\tdocumentId,\n\t\t\t\tid: this.user?.id,\n\t\t\t\tname: this.user?.name,\n\t\t\t\tadditionalDetails: this.user?.additionalDetails as unknown,\n\t\t\t},\n\t\t});\n\t\treturn response.data as string;\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type IRequest } from "@fluidframework/core-interfaces";
5
+ import type { IRequest } from "@fluidframework/core-interfaces";
6
6
  import { type IResolvedUrl, type IUrlResolver } from "@fluidframework/driver-definitions/internal";
7
7
  /**
8
8
  * Implementation of {@link @fluidframework/driver-definitions#IUrlResolver} to resolve documents stored using the
@@ -1 +1 @@
1
- {"version":3,"file":"AzureUrlResolver.d.ts","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,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;IAoCjD,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAM5F;AA+BD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,gBAAiB,MAAM,YAAY,MAAM,KAAG,QAUnF,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;IAoCjD,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 +1 @@
1
- {"version":3,"file":"AzureUrlResolver.js","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAIqD;AAErD;;;;;;GAMG;AACH,MAAa,gBAAgB;IAC5B,gBAAsB,CAAC;IAEhB,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,cAAc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AAO;QACN,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,OAAO,EAAE;YACR,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,IAAI;SAC9B;KACD,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,2BAA2B,+BAUtC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tDriverHeader,\n\ttype IResolvedUrl,\n\ttype IUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Implementation of {@link @fluidframework/driver-definitions#IUrlResolver} to resolve documents stored using the\n * Azure Fluid Relay based off of the orderer and storage URLs provide.\n *\n * @remarks The token provider here can be an `InsecureTokenProvider` for basic scenarios or more robust, secure\n * providers that fulfill the {@link @fluidframework/routerlicious-driver#ITokenProvider} interface.\n */\nexport class AzureUrlResolver implements IUrlResolver {\n\tpublic constructor() {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl> {\n\t\tconst { ordererUrl, storageUrl, tenantId, containerId } = decodeAzureUrl(request.url);\n\t\t// determine whether the request is for creating of a new container.\n\t\t// such request has the `createNew` header set to true and doesn't have a container ID.\n\t\tif (request.headers && request.headers[DriverHeader.createNew] === true) {\n\t\t\treturn {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${ordererUrl}/deltas/${tenantId}/new`,\n\t\t\t\t\tordererUrl,\n\t\t\t\t\tstorageUrl: `${storageUrl}/repos/${tenantId}`,\n\t\t\t\t},\n\t\t\t\t// id is a mandatory attribute, but it's ignored by the driver for new container requests.\n\t\t\t\tid: \"\",\n\t\t\t\t// tokens attribute is redundant as all tokens are generated via ITokenProvider\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `${ordererUrl}/${tenantId}/new`,\n\t\t\t};\n\t\t}\n\t\tif (containerId === undefined) {\n\t\t\tthrow new Error(\"Azure URL did not contain containerId\");\n\t\t}\n\t\tconst documentUrl = `${ordererUrl}/${tenantId}/${containerId}`;\n\t\treturn {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl: `${ordererUrl}/deltas/${tenantId}/${containerId}`,\n\t\t\t\tordererUrl,\n\t\t\t\tstorageUrl: `${storageUrl}/repos/${tenantId}`,\n\t\t\t},\n\t\t\tid: containerId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tif (resolvedUrl.type !== \"fluid\") {\n\t\t\tthrow new Error(\"Invalid Resolved Url\");\n\t\t}\n\t\treturn `${resolvedUrl.url}/${relativeUrl}`;\n\t}\n}\n\nfunction decodeAzureUrl(urlString: string): {\n\tordererUrl: string;\n\tstorageUrl: string;\n\ttenantId: string;\n\tcontainerId?: string;\n} {\n\tconst url = new URL(urlString);\n\tconst ordererUrl = url.origin;\n\tconst searchParameters = url.searchParams;\n\tconst storageUrl = searchParameters.get(\"storage\");\n\tif (storageUrl === null) {\n\t\tthrow new Error(\"Azure URL did not contain a storage URL\");\n\t}\n\tconst tenantId = searchParameters.get(\"tenantId\");\n\tif (tenantId === null) {\n\t\tthrow new Error(\"Azure URL did not contain a tenant ID\");\n\t}\n\tconst storageUrlDecoded = decodeURIComponent(storageUrl);\n\tconst tenantIdDecoded = decodeURIComponent(tenantId);\n\tconst containerId = searchParameters.get(\"containerId\");\n\tconst containerIdDecoded = containerId === null ? undefined : decodeURIComponent(containerId);\n\treturn {\n\t\tordererUrl,\n\t\tstorageUrl: storageUrlDecoded,\n\t\ttenantId: tenantIdDecoded,\n\t\tcontainerId: containerIdDecoded,\n\t};\n}\n\n/**\n * Creates a request object that can be passed to {@link @fluidframework/fluid-static#IFluidContainer.attach} to\n * request creation of a new Fluid Container on the Azure service.\n *\n * @param endpointUrl - URI to the Azure Fluid Relay service discovery endpoint.\n * @param tenantId - Unique tenant identifier.\n */\nexport const createAzureCreateNewRequest = (endpointUrl: string, tenantId: string): IRequest => {\n\tconst url = new URL(endpointUrl);\n\turl.searchParams.append(\"storage\", encodeURIComponent(endpointUrl));\n\turl.searchParams.append(\"tenantId\", encodeURIComponent(tenantId));\n\treturn {\n\t\turl: url.href,\n\t\theaders: {\n\t\t\t[DriverHeader.createNew]: true,\n\t\t},\n\t};\n};\n"]}
1
+ {"version":3,"file":"AzureUrlResolver.js","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAIqD;AAErD;;;;;;GAMG;AACH,MAAa,gBAAgB;IAC5B,gBAAsB,CAAC;IAEhB,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtF,oEAAoE;QACpE,uFAAuF;QACvF,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,uBAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;YACzE,OAAO;gBACN,SAAS,EAAE;oBACV,eAAe,EAAE,GAAG,UAAU,WAAW,QAAQ,MAAM;oBACvD,UAAU;oBACV,UAAU,EAAE,GAAG,UAAU,UAAU,QAAQ,EAAE;iBAC7C;gBACD,0FAA0F;gBAC1F,EAAE,EAAE,EAAE;gBACN,+EAA+E;gBAC/E,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,GAAG,EAAE,GAAG,UAAU,IAAI,QAAQ,MAAM;aACpC,CAAC;QACH,CAAC;QACD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,WAAW,GAAG,GAAG,UAAU,IAAI,QAAQ,IAAI,W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GAAG,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACxD,MAAM,kBAAkB,GACvB,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACpE,OAAO;QACN,UAAU;QACV,UAAU,EAAE,iBAAiB;QAC7B,QAAQ,EAAE,eAAe;QACzB,WAAW,EAAE,kBAAkB;KAC/B,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACI,MAAM,2BAA2B,GAAG,CAC1C,WAAmB,EACnB,QAAgB,EACL,EAAE;IACb,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACjC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;IACpE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,OAAO;QACN,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,OAAO,EAAE;YACR,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,IAAI;SAC9B;KACD,CAAC;AACH,CAAC,CAAC;AAbW,QAAA,2BAA2B,+BAatC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tDriverHeader,\n\ttype IResolvedUrl,\n\ttype IUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Implementation of {@link @fluidframework/driver-definitions#IUrlResolver} to resolve documents stored using the\n * Azure Fluid Relay based off of the orderer and storage URLs provide.\n *\n * @remarks The token provider here can be an `InsecureTokenProvider` for basic scenarios or more robust, secure\n * providers that fulfill the {@link @fluidframework/routerlicious-driver#ITokenProvider} interface.\n */\nexport class AzureUrlResolver implements IUrlResolver {\n\tpublic constructor() {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl> {\n\t\tconst { ordererUrl, storageUrl, tenantId, containerId } = decodeAzureUrl(request.url);\n\t\t// determine whether the request is for creating of a new container.\n\t\t// such request has the `createNew` header set to true and doesn't have a container ID.\n\t\tif (request.headers && request.headers[DriverHeader.createNew] === true) {\n\t\t\treturn {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${ordererUrl}/deltas/${tenantId}/new`,\n\t\t\t\t\tordererUrl,\n\t\t\t\t\tstorageUrl: `${storageUrl}/repos/${tenantId}`,\n\t\t\t\t},\n\t\t\t\t// id is a mandatory attribute, but it's ignored by the driver for new container requests.\n\t\t\t\tid: \"\",\n\t\t\t\t// tokens attribute is redundant as all tokens are generated via ITokenProvider\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `${ordererUrl}/${tenantId}/new`,\n\t\t\t};\n\t\t}\n\t\tif (containerId === undefined) {\n\t\t\tthrow new Error(\"Azure URL did not contain containerId\");\n\t\t}\n\t\tconst documentUrl = `${ordererUrl}/${tenantId}/${containerId}`;\n\t\treturn {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl: `${ordererUrl}/deltas/${tenantId}/${containerId}`,\n\t\t\t\tordererUrl,\n\t\t\t\tstorageUrl: `${storageUrl}/repos/${tenantId}`,\n\t\t\t},\n\t\t\tid: containerId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t}\n\n\tpublic async getAbsoluteUrl(\n\t\tresolvedUrl: IResolvedUrl,\n\t\trelativeUrl: string,\n\t): Promise<string> {\n\t\tif (resolvedUrl.type !== \"fluid\") {\n\t\t\tthrow new Error(\"Invalid Resolved Url\");\n\t\t}\n\t\treturn `${resolvedUrl.url}/${relativeUrl}`;\n\t}\n}\n\nfunction decodeAzureUrl(urlString: string): {\n\tordererUrl: string;\n\tstorageUrl: string;\n\ttenantId: string;\n\tcontainerId?: string;\n} {\n\tconst url = new URL(urlString);\n\tconst ordererUrl = url.origin;\n\tconst searchParameters = url.searchParams;\n\tconst storageUrl = searchParameters.get(\"storage\");\n\tif (storageUrl === null) {\n\t\tthrow new Error(\"Azure URL did not contain a storage URL\");\n\t}\n\tconst tenantId = searchParameters.get(\"tenantId\");\n\tif (tenantId === null) {\n\t\tthrow new Error(\"Azure URL did not contain a tenant ID\");\n\t}\n\tconst storageUrlDecoded = decodeURIComponent(storageUrl);\n\tconst tenantIdDecoded = decodeURIComponent(tenantId);\n\tconst containerId = searchParameters.get(\"containerId\");\n\tconst containerIdDecoded =\n\t\tcontainerId === null ? undefined : decodeURIComponent(containerId);\n\treturn {\n\t\tordererUrl,\n\t\tstorageUrl: storageUrlDecoded,\n\t\ttenantId: tenantIdDecoded,\n\t\tcontainerId: containerIdDecoded,\n\t};\n}\n\n/**\n * Creates a request object that can be passed to {@link @fluidframework/fluid-static#IFluidContainer.attach} to\n * request creation of a new Fluid Container on the Azure service.\n *\n * @param endpointUrl - URI to the Azure Fluid Relay service discovery endpoint.\n * @param tenantId - Unique tenant identifier.\n */\nexport const createAzureCreateNewRequest = (\n\tendpointUrl: string,\n\ttenantId: string,\n): IRequest => {\n\tconst url = new URL(endpointUrl);\n\turl.searchParams.append(\"storage\", encodeURIComponent(endpointUrl));\n\turl.searchParams.append(\"tenantId\", encodeURIComponent(tenantId));\n\treturn {\n\t\turl: url.href,\n\t\theaders: {\n\t\t\t[DriverHeader.createNew]: true,\n\t\t},\n\t};\n};\n"]}
package/dist/beta.d.ts CHANGED
@@ -20,10 +20,10 @@ export {
20
20
  AzureLocalConnectionConfig,
21
21
  AzureMember,
22
22
  AzureRemoteConnectionConfig,
23
+ CompatibilityMode,
23
24
  IAzureAudience,
24
25
  ITelemetryBaseEvent,
25
26
  ITelemetryBaseLogger,
26
- ITokenClaims,
27
27
  ITokenProvider,
28
28
  ITokenResponse,
29
29
  IUser
package/dist/index.d.ts CHANGED
@@ -11,7 +11,8 @@ export { AzureClient } from "./AzureClient.js";
11
11
  export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider.js";
12
12
  export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.js";
13
13
  export type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
14
- export type { ITokenClaims, IUser } from "@fluidframework/protocol-definitions";
15
- export { ScopeType } from "@fluidframework/protocol-definitions";
16
- export type { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
14
+ export type { IUser } from "@fluidframework/driver-definitions";
15
+ export { type ITokenClaims, ScopeType } from "@fluidframework/driver-definitions/internal";
16
+ export type { ITelemetryBaseEvent, ITelemetryBaseLogger, } from "@fluidframework/core-interfaces";
17
+ export type { CompatibilityMode } from "@fluidframework/fluid-static";
17
18
  //# 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,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,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,YAAY,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,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,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,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;AAChE,OAAO,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAG3F,YAAY,EACX,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,6 @@ var AzureClient_js_1 = require("./AzureClient.js");
14
14
  Object.defineProperty(exports, "AzureClient", { enumerable: true, get: function () { return AzureClient_js_1.AzureClient; } });
15
15
  var AzureFunctionTokenProvider_js_1 = require("./AzureFunctionTokenProvider.js");
16
16
  Object.defineProperty(exports, "AzureFunctionTokenProvider", { enumerable: true, get: function () { return AzureFunctionTokenProvider_js_1.AzureFunctionTokenProvider; } });
17
- var protocol_definitions_1 = require("@fluidframework/protocol-definitions");
18
- Object.defineProperty(exports, "ScopeType", { enumerable: true, get: function () { return protocol_definitions_1.ScopeType; } });
17
+ var internal_1 = require("@fluidframework/driver-definitions/internal");
18
+ Object.defineProperty(exports, "ScopeType", { enumerable: true, get: function () { return internal_1.ScopeType; } });
19
19
  //# sourceMappingURL=index.js.map
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;AACpB,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AAiBnC,6EAAiE;AAAxD,iHAAA,SAAS,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 { AzureFunctionTokenProvider } from \"./AzureFunctionTokenProvider.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 { ITokenClaims, IUser } from \"@fluidframework/protocol-definitions\";\nexport { ScopeType } from \"@fluidframework/protocol-definitions\";\n\n// Re-export so developers can build loggers without pulling in core-interfaces\nexport type { ITelemetryBaseEvent, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\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;AACpB,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AAiBnC,wEAA2F;AAA/D,qGAAA,SAAS,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 { AzureFunctionTokenProvider } from \"./AzureFunctionTokenProvider.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\";\nexport { type ITokenClaims, ScopeType } from \"@fluidframework/driver-definitions/internal\";\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,11 +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 IConfigProviderBase, type ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
- import { type ICompressionStorageConfig } from "@fluidframework/driver-utils";
7
- import { type IMember, type IServiceAudience } from "@fluidframework/fluid-static";
8
- import { type IUser } from "@fluidframework/protocol-definitions";
9
- import { type ITokenProvider } from "@fluidframework/routerlicious-driver";
5
+ import type { IConfigProviderBase, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
+ import type { IUser } from "@fluidframework/driver-definitions";
7
+ import type { ICompressionStorageConfig } from "@fluidframework/driver-utils";
8
+ import type { IMember, IServiceAudience } from "@fluidframework/fluid-static";
9
+ import type { ITokenProvider } from "@fluidframework/routerlicious-driver";
10
10
  /**
11
11
  * Props for initializing a new AzureClient instance
12
12
  * @public
@@ -132,11 +132,12 @@ export interface AzureContainerServices {
132
132
  */
133
133
  export interface AzureUser<T = any> extends IUser {
134
134
  /**
135
- * The user's name
135
+ * {@inheritDoc AzureMember.name}
136
+ *
136
137
  */
137
138
  name: string;
138
139
  /**
139
- * Custom, app-specific user information
140
+ * {@inheritDoc AzureMember.additionalDetails}
140
141
  */
141
142
  additionalDetails?: T;
142
143
  }
@@ -152,11 +153,11 @@ export interface AzureUser<T = any> extends IUser {
152
153
  */
153
154
  export interface AzureMember<T = any> extends IMember {
154
155
  /**
155
- * {@inheritDoc AzureUser.name}
156
+ * The user's name
156
157
  */
157
158
  name: string;
158
159
  /**
159
- * {@inheritDoc AzureUser.additionalDetails}
160
+ * Custom, app-specific user information
160
161
  */
161
162
  additionalDetails?: T;
162
163
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,KAAK,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;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAE9C,QAAQ,CAAC,k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C;IACjB;;OAEG;IACH,aAAa,EAAE,cAAc,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACzE;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACxE;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,QAAQ,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;GAQG;AAGH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,KAAK;IAChD;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;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 {\n\ttype IConfigProviderBase,\n\ttype ITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { type ICompressionStorageConfig } from \"@fluidframework/driver-utils\";\nimport { type IMember, type IServiceAudience } from \"@fluidframework/fluid-static\";\nimport { type IUser } from \"@fluidframework/protocol-definitions\";\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 * 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 * 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 * {@inheritDoc AzureUser.name}\n\t */\n\tname: string;\n\n\t/**\n\t * {@inheritDoc AzureUser.additionalDetails}\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 {\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"]}
package/dist/legacy.d.ts CHANGED
@@ -20,14 +20,15 @@ export {
20
20
  AzureLocalConnectionConfig,
21
21
  AzureMember,
22
22
  AzureRemoteConnectionConfig,
23
+ CompatibilityMode,
23
24
  IAzureAudience,
24
25
  ITelemetryBaseEvent,
25
26
  ITelemetryBaseLogger,
26
- ITokenClaims,
27
27
  ITokenProvider,
28
28
  ITokenResponse,
29
29
  IUser,
30
30
 
31
31
  // @alpha APIs
32
+ ITokenClaims,
32
33
  ScopeType
33
34
  } from "./index.js";
package/dist/public.d.ts CHANGED
@@ -20,10 +20,10 @@ export {
20
20
  AzureLocalConnectionConfig,
21
21
  AzureMember,
22
22
  AzureRemoteConnectionConfig,
23
+ CompatibilityMode,
23
24
  IAzureAudience,
24
25
  ITelemetryBaseEvent,
25
26
  ITelemetryBaseLogger,
26
- ITokenClaims,
27
27
  ITokenProvider,
28
28
  ITokenResponse,
29
29
  IUser
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type IClient } from "@fluidframework/protocol-definitions";
6
- import { type AzureMember } from "./interfaces.js";
5
+ import type { IClient } from "@fluidframework/driver-definitions";
6
+ import type { AzureMember } from "./interfaces.js";
7
7
  /**
8
8
  * Creates Azure-specific audience member.
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAU9E"}
1
+ {"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAS,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,iBAAiB,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAU9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureAudience.js","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,cAAuB;IAChE,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IACjC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAExB,OAAO;QACN,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KACzC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAAW;IACrC,MAAM,cAAc,GAAG,IAA0B,CAAC;IAClD,MAAM,WAAW,GAAG,4CAA4C,CAAC;IACjE,IAAI,cAAc,CAAC,EAAE,KAAK,SAAS,EAAE;QACpC,MAAM,IAAI,SAAS,CAAC,GAAG,WAAW,kCAAkC,CAAC,CAAC;KACtE;IACD,IAAI,cAAc,CAAC,IAAI,KAAK,SAAS,EAAE;QACtC,MAAM,IAAI,SAAS,CAAC,GAAG,WAAW,oCAAoC,CAAC,CAAC;KACxE;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IClient, type IUser } from \"@fluidframework/protocol-definitions\";\n\nimport { type AzureMember, type AzureUser } from \"./interfaces.js\";\n\n/**\n * Creates Azure-specific audience member.\n *\n * @remarks\n * The provided `audienceMember`'s {@link @fluidframework/protocol-definitions#IClient.user} must be an {@link AzureUser}.\n */\nexport function createAzureAudienceMember(audienceMember: IClient): AzureMember {\n\tconst user = audienceMember.user;\n\tassertIsAzureUser(user);\n\n\treturn {\n\t\tid: user.id,\n\t\tname: user.name,\n\t\tconnections: [],\n\t\tadditionalDetails: user.additionalDetails,\n\t};\n}\n\n/**\n * Asserts that the provided {@link @fluidframework/protocol-definitions#IUser} is an {@link AzureUser}.\n */\nfunction assertIsAzureUser(user: IUser): asserts user is AzureUser<unknown> {\n\tconst maybeAzureUser = user as Partial<AzureUser>;\n\tconst baseMessage = 'Provided user data was not an \"AzureUser\".';\n\tif (maybeAzureUser.id === undefined) {\n\t\tthrow new TypeError(`${baseMessage} Missing required \"id\" property.`);\n\t}\n\tif (maybeAzureUser.name === undefined) {\n\t\tthrow new TypeError(`${baseMessage} Missing required \"name\" property.`);\n\t}\n}\n"]}
1
+ {"version":3,"file":"AzureAudience.js","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,cAAuB;IAChE,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IACjC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAExB,OAAO;QACN,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KACzC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAAW;IACrC,MAAM,cAAc,GAAG,IAA0B,CAAC;IAClD,MAAM,WAAW,GAAG,4CAA4C,CAAC;IACjE,IAAI,cAAc,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CAAC,GAAG,WAAW,kCAAkC,CAAC,CAAC;IACvE,CAAC;IACD,IAAI,cAAc,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,IAAI,SAAS,CAAC,GAAG,WAAW,oCAAoC,CAAC,CAAC;IACzE,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IClient, IUser } from \"@fluidframework/driver-definitions\";\n\nimport type { AzureMember, AzureUser } from \"./interfaces.js\";\n\n/**\n * Creates Azure-specific audience member.\n *\n * @remarks\n * The provided `audienceMember`'s {@link @fluidframework/protocol-definitions#IClient.user} must be an {@link AzureUser}.\n */\nexport function createAzureAudienceMember(audienceMember: IClient): AzureMember {\n\tconst user = audienceMember.user;\n\tassertIsAzureUser(user);\n\n\treturn {\n\t\tid: user.id,\n\t\tname: user.name,\n\t\tconnections: [],\n\t\tadditionalDetails: user.additionalDetails,\n\t};\n}\n\n/**\n * Asserts that the provided {@link @fluidframework/protocol-definitions#IUser} is an {@link AzureUser}.\n */\nfunction assertIsAzureUser(user: IUser): asserts user is AzureUser<unknown> {\n\tconst maybeAzureUser = user as Partial<AzureUser>;\n\tconst baseMessage = 'Provided user data was not an \"AzureUser\".';\n\tif (maybeAzureUser.id === undefined) {\n\t\tthrow new TypeError(`${baseMessage} Missing required \"id\" property.`);\n\t}\n\tif (maybeAzureUser.name === undefined) {\n\t\tthrow new TypeError(`${baseMessage} Missing required \"name\" property.`);\n\t}\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ContainerSchema, type IFluidContainer } from "@fluidframework/fluid-static";
6
- import { type AzureClientProps, type AzureContainerServices, type AzureContainerVersion, type AzureGetVersionsOptions } from "./interfaces.js";
5
+ import type { ContainerSchema, IFluidContainer, CompatibilityMode } from "@fluidframework/fluid-static";
6
+ import type { AzureClientProps, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions } from "./interfaces.js";
7
7
  /**
8
8
  * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
9
9
  * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.
@@ -24,9 +24,10 @@ export declare class AzureClient {
24
24
  * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
25
25
  * (normally not explicitly specified.)
26
26
  * @param containerSchema - Container schema for the new container.
27
+ * @param compatibilityMode - Compatibility mode the container should run in.
27
28
  * @returns New detached container instance along with associated services.
28
29
  */
29
- createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
30
+ createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
30
31
  container: IFluidContainer<TContainerSchema>;
31
32
  services: AzureContainerServices;
32
33
  }>;
@@ -36,9 +37,10 @@ export declare class AzureClient {
36
37
  * (normally not explicitly specified.)
37
38
  * @param id - Unique ID of the container in Azure Fluid Relay.
38
39
  * @param containerSchema - Container schema used to access data objects in the container.
40
+ * @param compatibilityMode - Compatibility mode the container should run in.
39
41
  * @returns Existing container instance along with associated services.
40
42
  */
41
- getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema): Promise<{
43
+ getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, compatibilityMode: CompatibilityMode): Promise<{
42
44
  container: IFluidContainer<TContainerSchema>;
43
45
  services: AzureContainerServices;
44
46
  }>;
@@ -49,9 +51,10 @@ export declare class AzureClient {
49
51
  * @param id - Unique ID of the source container in Azure Fluid Relay.
50
52
  * @param containerSchema - Container schema used to access data objects in the container.
51
53
  * @param version - Unique version of the source container in Azure Fluid Relay.
54
+ * @param compatibilityMode - Compatibility mode the container should run in.
52
55
  * @returns Loaded container instance at the specified version.
53
56
  */
54
- viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion): Promise<{
57
+ viewContainerVersion<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version: AzureContainerVersion, compatibilityMode: CompatibilityMode): Promise<{
55
58
  container: IFluidContainer<TContainerSchema>;
56
59
  }>;
57
60
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAa1F,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,MAAM,iBAAiB,CAAC;AA+CzB;;;;GAIG;AACH,qBAAa,WAAW;IASJ,OAAO,CAAC,QAAQ,CAAC,UAAU;IAR9C,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA0B;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,C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ureClientFeatureGates = {
36
36
  */
37
37
  const azureClientV1CompatFeatureGates = {
38
38
  // Disable Garbage Collection
39
- "Fluid.GarbageCollection.RunSweep": false,
40
- "Fluid.GarbageCollection.DisableAutoRecovery": true,
39
+ "Fluid.GarbageCollection.RunSweep": false, // To prevent the GC op
40
+ "Fluid.GarbageCollection.DisableAutoRecovery": true, // To prevent the GC op
41
41
  "Fluid.GarbageCollection.ThrowOnTombstoneLoadOverride": false, // For a consistent story of "GC is disabled"
42
42
  };
43
43
  /**
@@ -82,10 +82,11 @@ export class AzureClient {
82
82
  * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
83
83
  * (normally not explicitly specified.)
84
84
  * @param containerSchema - Container schema for the new container.
85
+ * @param compatibilityMode - Compatibility mode the container should run in.
85
86
  * @returns New detached container instance along with associated services.
86
87
  */
87
- async createContainer(containerSchema) {
88
- const loader = this.createLoader(containerSchema);
88
+ async createContainer(containerSchema, compatibilityMode) {
89
+ const loader = this.createLoader(containerSchema, compatibilityMode);
89
90
  const container = await loader.createDetachedContainer({
90
91
  package: "no-dynamic-package",
91
92
  config: {},
@@ -100,10 +101,11 @@ export class AzureClient {
100
101
  * (normally not explicitly specified.)
101
102
  * @param id - Unique ID of the container in Azure Fluid Relay.
102
103
  * @param containerSchema - Container schema used to access data objects in the container.
104
+ * @param compatibilityMode - Compatibility mode the container should run in.
103
105
  * @returns Existing container instance along with associated services.
104
106
  */
105
- async getContainer(id, containerSchema) {
106
- const loader = this.createLoader(containerSchema);
107
+ async getContainer(id, containerSchema, compatibilityMode) {
108
+ const loader = this.createLoader(containerSchema, compatibilityMode);
107
109
  const url = new URL(this.properties.connection.endpoint);
108
110
  url.searchParams.append("storage", encodeURIComponent(this.properties.connection.endpoint));
109
111
  url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.properties.connection)));
@@ -124,10 +126,11 @@ export class AzureClient {
124
126
  * @param id - Unique ID of the source container in Azure Fluid Relay.
125
127
  * @param containerSchema - Container schema used to access data objects in the container.
126
128
  * @param version - Unique version of the source container in Azure Fluid Relay.
129
+ * @param compatibilityMode - Compatibility mode the container should run in.
127
130
  * @returns Loaded container instance at the specified version.
128
131
  */
129
- async viewContainerVersion(id, containerSchema, version) {
130
- const loader = this.createLoader(containerSchema);
132
+ async viewContainerVersion(id, containerSchema, version, compatibilityMode) {
133
+ const loader = this.createLoader(containerSchema, compatibilityMode);
131
134
  const url = new URL(this.properties.connection.endpoint);
132
135
  url.searchParams.append("storage", encodeURIComponent(this.properties.connection.endpoint));
133
136
  url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.properties.connection)));
@@ -176,8 +179,11 @@ export class AzureClient {
176
179
  }),
177
180
  };
178
181
  }
179
- createLoader(schema) {
180
- const runtimeFactory = createDOProviderContainerRuntimeFactory({ schema });
182
+ createLoader(schema, compatibilityMode) {
183
+ const runtimeFactory = createDOProviderContainerRuntimeFactory({
184
+ schema,
185
+ compatibilityMode,
186
+ });
181
187
  const load = async () => {
182
188
  return {
183
189
  module: { fluidExport: runtimeFactory },