@fluidframework/azure-client 2.0.0-internal.7.2.2 → 2.0.0-internal.7.3.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 (66) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1 -2
  3. package/api-extractor.json +4 -1
  4. package/api-report/azure-client.api.md +6 -6
  5. package/dist/{AzureAudience.js → AzureAudience.cjs} +1 -1
  6. package/dist/AzureAudience.cjs.map +1 -0
  7. package/dist/{AzureClient.js → AzureClient.cjs} +12 -10
  8. package/dist/AzureClient.cjs.map +1 -0
  9. package/dist/AzureClient.d.ts +12 -6
  10. package/dist/AzureClient.d.ts.map +1 -1
  11. package/dist/{AzureFunctionTokenProvider.js → AzureFunctionTokenProvider.cjs} +1 -1
  12. package/dist/AzureFunctionTokenProvider.cjs.map +1 -0
  13. package/dist/{AzureUrlResolver.js → AzureUrlResolver.cjs} +1 -1
  14. package/dist/AzureUrlResolver.cjs.map +1 -0
  15. package/dist/azure-client-alpha.d.ts +318 -0
  16. package/dist/azure-client-beta.d.ts +318 -0
  17. package/dist/azure-client-public.d.ts +318 -0
  18. package/dist/azure-client-untrimmed.d.ts +327 -0
  19. package/dist/{index.js → index.cjs} +4 -4
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/{interfaces.js → interfaces.cjs} +1 -1
  22. package/dist/interfaces.cjs.map +1 -0
  23. package/dist/tsdoc-metadata.json +1 -1
  24. package/dist/{utils.js → utils.cjs} +1 -1
  25. package/dist/utils.cjs.map +1 -0
  26. package/lib/{AzureAudience.js → AzureAudience.mjs} +1 -5
  27. package/lib/AzureAudience.mjs.map +1 -0
  28. package/lib/AzureClient.d.ts +12 -6
  29. package/lib/AzureClient.d.ts.map +1 -1
  30. package/lib/{AzureClient.js → AzureClient.mjs} +12 -14
  31. package/lib/AzureClient.mjs.map +1 -0
  32. package/lib/{AzureFunctionTokenProvider.js → AzureFunctionTokenProvider.mjs} +1 -5
  33. package/lib/AzureFunctionTokenProvider.mjs.map +1 -0
  34. package/lib/{AzureUrlResolver.js → AzureUrlResolver.mjs} +1 -1
  35. package/lib/AzureUrlResolver.mjs.map +1 -0
  36. package/lib/azure-client-alpha.d.ts +318 -0
  37. package/lib/azure-client-beta.d.ts +318 -0
  38. package/lib/azure-client-public.d.ts +318 -0
  39. package/lib/azure-client-untrimmed.d.ts +327 -0
  40. package/lib/index.mjs +9 -0
  41. package/lib/index.mjs.map +1 -0
  42. package/lib/interfaces.mjs +2 -0
  43. package/lib/interfaces.mjs.map +1 -0
  44. package/lib/{utils.js → utils.mjs} +1 -1
  45. package/lib/utils.mjs.map +1 -0
  46. package/package.json +49 -32
  47. package/src/AzureClient.ts +24 -20
  48. package/tsc-multi.test.json +4 -0
  49. package/tsconfig.json +6 -5
  50. package/dist/AzureAudience.js.map +0 -1
  51. package/dist/AzureClient.js.map +0 -1
  52. package/dist/AzureFunctionTokenProvider.js.map +0 -1
  53. package/dist/AzureUrlResolver.js.map +0 -1
  54. package/dist/index.js.map +0 -1
  55. package/dist/interfaces.js.map +0 -1
  56. package/dist/utils.js.map +0 -1
  57. package/lib/AzureAudience.js.map +0 -1
  58. package/lib/AzureClient.js.map +0 -1
  59. package/lib/AzureFunctionTokenProvider.js.map +0 -1
  60. package/lib/AzureUrlResolver.js.map +0 -1
  61. package/lib/index.js +0 -14
  62. package/lib/index.js.map +0 -1
  63. package/lib/interfaces.js +0 -2
  64. package/lib/interfaces.js.map +0 -1
  65. package/lib/utils.js.map +0 -1
  66. package/tsconfig.esnext.json +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/azure-client
2
2
 
3
+ ## 2.0.0-internal.7.3.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.2.0
4
8
 
5
9
  Dependency updates only.
package/README.md CHANGED
@@ -245,8 +245,7 @@ Thank you!
245
245
 
246
246
  This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
247
247
 
248
- Use of these trademarks or logos must follow Microsoft's [Trademark & Brand
249
- Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
248
+ Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
250
249
 
251
250
  Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
252
251
 
@@ -1,4 +1,7 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-base.json"
3
+ "extends": "@fluidframework/build-common/api-extractor-base.json",
4
+ "dtsRollup": {
5
+ "enabled": true
6
+ }
4
7
  }
@@ -29,16 +29,16 @@ export class AzureAudience extends ServiceAudience<AzureMember> implements IAzur
29
29
  // @public
30
30
  export class AzureClient {
31
31
  constructor(properties: AzureClientProps);
32
- copyContainer(id: string, containerSchema: ContainerSchema, version?: AzureContainerVersion): Promise<{
33
- container: IFluidContainer;
32
+ copyContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version?: AzureContainerVersion): Promise<{
33
+ container: IFluidContainer<TContainerSchema>;
34
34
  services: AzureContainerServices;
35
35
  }>;
36
- createContainer(containerSchema: ContainerSchema): Promise<{
37
- container: IFluidContainer;
36
+ createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
37
+ container: IFluidContainer<TContainerSchema>;
38
38
  services: AzureContainerServices;
39
39
  }>;
40
- getContainer(id: string, containerSchema: ContainerSchema): Promise<{
41
- container: IFluidContainer;
40
+ getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema): Promise<{
41
+ container: IFluidContainer<TContainerSchema>;
42
42
  services: AzureContainerServices;
43
43
  }>;
44
44
  getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
@@ -36,4 +36,4 @@ class AzureAudience extends fluid_static_1.ServiceAudience {
36
36
  }
37
37
  }
38
38
  exports.AzureAudience = AzureAudience;
39
- //# sourceMappingURL=AzureAudience.js.map
39
+ //# sourceMappingURL=AzureAudience.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AzureAudience.cjs","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAoD;AACpD,+DAA+D;AAK/D;;;;;;GAMG;AACH,MAAa,aAAc,SAAQ,8BAA4B;IAC9D;;;;;;;;OAQG;IACO,mBAAmB,CAAC,cAAuB;QACpD,MAAM,SAAS,GAAG,cAAc,CAAC,IAAiB,CAAC;QACnD,IAAA,mBAAM,EAAC,SAAS,EAAE,IAAI,KAAK,SAAS,EAAE,uCAAuC,CAAC,CAAC;QAE/E,OAAO;YACN,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE;YAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;YACxB,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,SAAS,CAAC,iBAA4B;SACzD,CAAC;IACH,CAAC;CACD;AArBD,sCAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ServiceAudience } from \"@fluidframework/fluid-static\";\nimport { type IClient } from \"@fluidframework/protocol-definitions\";\n\nimport { type AzureMember, type AzureUser, type IAzureAudience } from \"./interfaces\";\n\n/**\n * Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.\n *\n * @remarks Operates in terms of {@link AzureMember}s.\n *\n * @public\n */\nexport class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {\n\t/**\n\t * Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided\n\t * {@link @fluidframework/protocol-definitions#IClient | audience member}.\n\t *\n\t * @param audienceMember - Audience member for which the `ServiceAudience` will be generated.\n\t * Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.\n\t *\n\t * @internal\n\t */\n\tprotected createServiceMember(audienceMember: IClient): AzureMember {\n\t\tconst azureUser = audienceMember.user as AzureUser;\n\t\tassert(azureUser?.name !== undefined, 'Provided user was not an \"AzureUser\".');\n\n\t\treturn {\n\t\t\tuserId: audienceMember.user.id,\n\t\t\tuserName: azureUser.name,\n\t\t\tconnections: [],\n\t\t\tadditionalDetails: azureUser.additionalDetails as unknown,\n\t\t};\n\t}\n}\n"]}
@@ -11,11 +11,9 @@ const driver_utils_1 = require("@fluidframework/driver-utils");
11
11
  const fluid_static_1 = require("@fluidframework/fluid-static");
12
12
  const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
13
13
  const routerlicious_driver_1 = require("@fluidframework/routerlicious-driver");
14
- // eslint-disable-next-line import/no-deprecated
15
- const runtime_utils_1 = require("@fluidframework/runtime-utils");
16
- const AzureAudience_1 = require("./AzureAudience");
17
- const AzureUrlResolver_1 = require("./AzureUrlResolver");
18
- const utils_1 = require("./utils");
14
+ const AzureAudience_1 = require("./AzureAudience.cjs");
15
+ const AzureUrlResolver_1 = require("./AzureUrlResolver.cjs");
16
+ const utils_1 = require("./utils.cjs");
19
17
  /**
20
18
  * Strongly typed id for connecting to a local Azure Fluid Relay.
21
19
  */
@@ -54,6 +52,8 @@ class AzureClient {
54
52
  }
55
53
  /**
56
54
  * Creates a new detached container instance in the Azure Fluid Relay.
55
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
56
+ * (normally not explicitly specified.)
57
57
  * @param containerSchema - Container schema for the new container.
58
58
  * @returns New detached container instance along with associated services.
59
59
  */
@@ -69,6 +69,8 @@ class AzureClient {
69
69
  }
70
70
  /**
71
71
  * Creates new detached container out of specific version of another container.
72
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
73
+ * (normally not explicitly specified.)
72
74
  * @param id - Unique ID of the source container in Azure Fluid Relay.
73
75
  * @param containerSchema - Container schema used to access data objects in the container.
74
76
  * @param version - Unique version of the source container in Azure Fluid Relay.
@@ -100,6 +102,8 @@ class AzureClient {
100
102
  }
101
103
  /**
102
104
  * Accesses the existing container given its unique ID in the Azure Fluid Relay.
105
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
106
+ * (normally not explicitly specified.)
103
107
  * @param id - Unique ID of the container in Azure Fluid Relay.
104
108
  * @param containerSchema - Container schema used to access data objects in the container.
105
109
  * @returns Existing container instance along with associated services.
@@ -111,8 +115,7 @@ class AzureClient {
111
115
  url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.properties.connection)));
112
116
  url.searchParams.append("containerId", encodeURIComponent(id));
113
117
  const container = await loader.resolve({ url: url.href });
114
- // eslint-disable-next-line import/no-deprecated
115
- const rootDataObject = await (0, runtime_utils_1.requestFluidObject)(container, "/");
118
+ const rootDataObject = (await container.getEntryPoint());
116
119
  const fluidContainer = new fluid_static_1.FluidContainer(container, rootDataObject);
117
120
  const services = this.getContainerServices(container);
118
121
  return { container: fluidContainer, services };
@@ -176,8 +179,7 @@ class AzureClient {
176
179
  }
177
180
  async createFluidContainer(container, connection) {
178
181
  const createNewRequest = (0, AzureUrlResolver_1.createAzureCreateNewRequest)(connection.endpoint, getTenantId(connection));
179
- // eslint-disable-next-line import/no-deprecated
180
- const rootDataObject = await (0, runtime_utils_1.requestFluidObject)(container, "/");
182
+ const rootDataObject = (await container.getEntryPoint());
181
183
  /**
182
184
  * See {@link FluidContainer.attach}
183
185
  */
@@ -197,4 +199,4 @@ class AzureClient {
197
199
  }
198
200
  }
199
201
  exports.AzureClient = AzureClient;
200
- //# sourceMappingURL=AzureClient.js.map
202
+ //# sourceMappingURL=AzureClient.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AzureClient.cjs","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,iFAI+C;AAC/C,uEAA0D;AAK1D,+DAAuE;AACvE,+DAMsC;AACt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AAE,IAAI,CAAC,sBAAsB;YACnD,UAAU;YACV,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;YAC9B,OAAO,EAAE,EAAE,MAAM,EAAE;YACnB,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,oBAAoB,CACjC,SAAqB,EACrB,UAAiC;QAEjC,MAAM,gBAAgB,GAAG,IAAA,8CAA2B,EACnD,UAAU,CAAC,QAAQ,EACnB,WAAW,CAAC,UAAU,CAAC,CACvB,CAAC;QAEF,MAAM,cAAc,GAAG,CAAC,MAAM,SAAS,CAAC,aAAa,EAAE,CAAoB,CAAC;QAE5E;;WAEG;QACH,MAAM,MAAM,GAAG,KAAK,IAAqB,EAAE;YAC1C,IAAI,SAAS,CAAC,WAAW,KAAK,mCAAW,CAAC,QAAQ,EAAE;gBACnD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;aAC/E;YACD,MAAM,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YACzC,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;aACpE;YACD,OAAO,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC;QACF,MAAM,cAAc,GAAG,IAAI,6BAAc,CAAmB,SAAS,EAAE,cAAc,CAAC,CAAC;QACvF,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC;IACvB,CAAC;CAED;AAjPD,kCAiPC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tAttachState,\n\ttype IContainer,\n\ttype IFluidModuleWithDetails,\n} from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport {\n\ttype IDocumentServiceFactory,\n\ttype IUrlResolver,\n} from \"@fluidframework/driver-definitions\";\nimport { applyStorageCompression } from \"@fluidframework/driver-utils\";\nimport {\n\ttype ContainerSchema,\n\tDOProviderContainerRuntimeFactory,\n\tFluidContainer,\n\ttype IFluidContainer,\n\ttype IRootDataObject,\n} from \"@fluidframework/fluid-static\";\nimport { type IClient, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver\";\n\nimport { type IConfigProviderBase } from \"@fluidframework/telemetry-utils\";\nimport { AzureAudience } from \"./AzureAudience\";\nimport { AzureUrlResolver, createAzureCreateNewRequest } from \"./AzureUrlResolver\";\nimport {\n\ttype AzureClientProps,\n\ttype AzureConnectionConfig,\n\ttype AzureContainerServices,\n\ttype AzureContainerVersion,\n\ttype AzureGetVersionsOptions,\n} from \"./interfaces\";\nimport { isAzureRemoteConnectionConfig } from \"./utils\";\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 * 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 *\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 = 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<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 * Creates new detached container out of specific version of another container.\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 * It defaults to latest version if parameter not provided.\n\t * @returns New detached container instance along with associated services.\n\t */\n\tpublic async copyContainer<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\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 sourceContainer = await loader.resolve({ url: url.href });\n\n\t\tif (sourceContainer.resolvedUrl === undefined) {\n\t\t\tthrow new Error(\"Source container cannot resolve URL.\");\n\t\t}\n\n\t\tconst documentService = await this.documentServiceFactory.createDocumentService(\n\t\t\tsourceContainer.resolvedUrl,\n\t\t);\n\t\tconst storage = await documentService.connectToStorage();\n\t\tconst handle = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType: SummaryType.Tree,\n\t\t\thandle: version?.id ?? \"latest\",\n\t\t};\n\t\tconst tree = await storage.downloadSummary(handle);\n\n\t\tconst container = await loader.rehydrateDetachedContainerFromSnapshot(JSON.stringify(tree));\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 container.getEntryPoint()) as IRootDataObject;\n\t\tconst fluidContainer = new FluidContainer<TContainerSchema>(container, rootDataObject);\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\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 retreive 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: new AzureAudience(container),\n\t\t};\n\t}\n\n\tprivate createLoader(containerSchema: ContainerSchema): Loader {\n\t\tconst runtimeFactory = new DOProviderContainerRuntimeFactory(containerSchema);\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<FluidContainer<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 container.getEntryPoint()) as IRootDataObject;\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 = new FluidContainer<TContainerSchema>(container, rootDataObject);\n\t\tfluidContainer.attach = attach;\n\t\treturn fluidContainer;\n\t}\n\t// #endregion\n}\n"]}
@@ -18,33 +18,39 @@ export declare class AzureClient {
18
18
  constructor(properties: AzureClientProps);
19
19
  /**
20
20
  * Creates a new detached container instance in the Azure Fluid Relay.
21
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
22
+ * (normally not explicitly specified.)
21
23
  * @param containerSchema - Container schema for the new container.
22
24
  * @returns New detached container instance along with associated services.
23
25
  */
24
- createContainer(containerSchema: ContainerSchema): Promise<{
25
- container: IFluidContainer;
26
+ createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
27
+ container: IFluidContainer<TContainerSchema>;
26
28
  services: AzureContainerServices;
27
29
  }>;
28
30
  /**
29
31
  * Creates new detached container out of specific version of another container.
32
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
33
+ * (normally not explicitly specified.)
30
34
  * @param id - Unique ID of the source container in Azure Fluid Relay.
31
35
  * @param containerSchema - Container schema used to access data objects in the container.
32
36
  * @param version - Unique version of the source container in Azure Fluid Relay.
33
37
  * It defaults to latest version if parameter not provided.
34
38
  * @returns New detached container instance along with associated services.
35
39
  */
36
- copyContainer(id: string, containerSchema: ContainerSchema, version?: AzureContainerVersion): Promise<{
37
- container: IFluidContainer;
40
+ copyContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version?: AzureContainerVersion): Promise<{
41
+ container: IFluidContainer<TContainerSchema>;
38
42
  services: AzureContainerServices;
39
43
  }>;
40
44
  /**
41
45
  * Accesses the existing container given its unique ID in the Azure Fluid Relay.
46
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
47
+ * (normally not explicitly specified.)
42
48
  * @param id - Unique ID of the container in Azure Fluid Relay.
43
49
  * @param containerSchema - Container schema used to access data objects in the container.
44
50
  * @returns Existing container instance along with associated services.
45
51
  */
46
- getContainer(id: string, containerSchema: ContainerSchema): Promise<{
47
- container: IFluidContainer;
52
+ getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema): Promise<{
53
+ container: IFluidContainer<TContainerSchema>;
48
54
  services: AzureContainerServices;
49
55
  }>;
50
56
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAeA,OAAO,EACN,KAAK,eAAe,EAGpB,KAAK,eAAe,EAEpB,MAAM,8BAA8B,CAAC;AAStC,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,MAAM,cAAc,CAAC;AAetB;;;;;GAKG;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,CAAC,QAAQ,CAAC,cAAc,CAAkC;IAEjE;;;OAGG;gBACiC,UAAU,EAAE,gBAAgB;IAoBhE;;;;OAIG;IACU,eAAe,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC;QACvE,SAAS,EAAE,eAAe,CAAC;QAC3B,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAgBF;;;;;;;OAOG;IACU,aAAa,CACzB,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,eAAe,EAChC,OAAO,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC;QAC3B,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAoCF;;;;;OAKG;IACU,YAAY,CACxB,EAAE,EA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AAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAoCF;;;;;;;OAOG;IACU,YAAY,CAAC,gBAAgB,SAAS,eAAe,EACjE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,GAC/B,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAgBF;;;;;;OAMG;IACU,oBAAoB,CAChC,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA0BnC,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,YAAY;YA8BN,oBAAoB;CA6BlC"}
@@ -53,4 +53,4 @@ class AzureFunctionTokenProvider {
53
53
  }
54
54
  }
55
55
  exports.AzureFunctionTokenProvider = AzureFunctionTokenProvider;
56
- //# sourceMappingURL=AzureFunctionTokenProvider.js.map
56
+ //# sourceMappingURL=AzureFunctionTokenProvider.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AzureFunctionTokenProvider.cjs","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":";;;;;;AAAA;;;GAGG;AACH,kDAA0B;AAM1B;;;;;;;;;GASG;AACH,MAAa,0BAA0B;IACtC;;;;OAIG;IACH,YACkB,aAAqB,EACrB,IAAqE;QADrE,kBAAa,GAAb,aAAa,CAAQ;QACrB,SAAI,GAAJ,IAAI,CAAiE;IACpF,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;QACnE,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAkB;QAClE,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,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM;gBACzB,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ;gBAC7B,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,iBAA4B;aAC1D;SACD,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAc,CAAC;IAChC,CAAC;CACD;AAnCD,gEAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport axios from \"axios\";\n\nimport { type ITokenProvider, type ITokenResponse } from \"@fluidframework/routerlicious-driver\";\n\nimport { type AzureMember } from \"./interfaces\";\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 *\n * @public\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, \"userId\" | \"userName\" | \"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\tuserId: this.user?.userId,\n\t\t\t\tuserName: this.user?.userName,\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"]}
@@ -96,4 +96,4 @@ const createAzureCreateNewRequest = (endpointUrl, tenantId) => {
96
96
  };
97
97
  };
98
98
  exports.createAzureCreateNewRequest = createAzureCreateNewRequest;
99
- //# sourceMappingURL=AzureUrlResolver.js.map
99
+ //# sourceMappingURL=AzureUrlResolver.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AzureUrlResolver.cjs","sourceRoot":"","sources":["../src/AzureUrlResolver.ts"],"names":[],"mappings":";;;AAKA,2EAI4C;AAE5C;;;;;;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,iCAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;YACxE,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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Q,KAAK,IAAI,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KACzD;IACD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC9F,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,CAAC,WAAmB,EAAE,QAAgB,EAAY,EAAE;IAC9F,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,iCAAY,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 */\nimport { type IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tDriverHeader,\n\ttype IResolvedUrl,\n\ttype IUrlResolver,\n} from \"@fluidframework/driver-definitions\";\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"]}
@@ -0,0 +1,318 @@
1
+ /**
2
+ * A simple and powerful way to consume collaborative Fluid data with the Azure Fluid Relay.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+
7
+ import { ContainerSchema } from '@fluidframework/fluid-static';
8
+ import { IClient } from '@fluidframework/protocol-definitions';
9
+ import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
10
+ import { IConfigProviderBase } from '@fluidframework/telemetry-utils';
11
+ import { IFluidContainer } from '@fluidframework/fluid-static';
12
+ import { IMember } from '@fluidframework/fluid-static';
13
+ import { IServiceAudience } from '@fluidframework/fluid-static';
14
+ import { ITelemetryBaseEvent } from '@fluidframework/core-interfaces';
15
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
16
+ import { ITokenClaims } from '@fluidframework/protocol-definitions';
17
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
18
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
19
+ import { IUser } from '@fluidframework/protocol-definitions';
20
+ import { ScopeType } from '@fluidframework/protocol-definitions';
21
+ import { ServiceAudience } from '@fluidframework/fluid-static';
22
+
23
+ /**
24
+ * Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
25
+ *
26
+ * @remarks Operates in terms of {@link AzureMember}s.
27
+ *
28
+ * @public
29
+ */
30
+ export declare class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
31
+ /* Excluded from this release type: createServiceMember */
32
+ }
33
+
34
+ /**
35
+ * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
36
+ * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.
37
+ *
38
+ * @public
39
+ */
40
+ export declare class AzureClient {
41
+ private readonly properties;
42
+ private readonly documentServiceFactory;
43
+ private readonly urlResolver;
44
+ private readonly configProvider;
45
+ /**
46
+ * Creates a new client instance using configuration parameters.
47
+ * @param properties - Properties for initializing a new AzureClient instance
48
+ */
49
+ constructor(properties: AzureClientProps);
50
+ /**
51
+ * Creates a new detached container instance in the Azure Fluid Relay.
52
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
53
+ * (normally not explicitly specified.)
54
+ * @param containerSchema - Container schema for the new container.
55
+ * @returns New detached container instance along with associated services.
56
+ */
57
+ createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
58
+ container: IFluidContainer<TContainerSchema>;
59
+ services: AzureContainerServices;
60
+ }>;
61
+ /**
62
+ * Creates new detached container out of specific version of another container.
63
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
64
+ * (normally not explicitly specified.)
65
+ * @param id - Unique ID of the source container in Azure Fluid Relay.
66
+ * @param containerSchema - Container schema used to access data objects in the container.
67
+ * @param version - Unique version of the source container in Azure Fluid Relay.
68
+ * It defaults to latest version if parameter not provided.
69
+ * @returns New detached container instance along with associated services.
70
+ */
71
+ copyContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version?: AzureContainerVersion): Promise<{
72
+ container: IFluidContainer<TContainerSchema>;
73
+ services: AzureContainerServices;
74
+ }>;
75
+ /**
76
+ * Accesses the existing container given its unique ID in the Azure Fluid Relay.
77
+ * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.
78
+ * (normally not explicitly specified.)
79
+ * @param id - Unique ID of the container in Azure Fluid Relay.
80
+ * @param containerSchema - Container schema used to access data objects in the container.
81
+ * @returns Existing container instance along with associated services.
82
+ */
83
+ getContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema): Promise<{
84
+ container: IFluidContainer<TContainerSchema>;
85
+ services: AzureContainerServices;
86
+ }>;
87
+ /**
88
+ * Get the list of versions for specific container.
89
+ * @param id - Unique ID of the source container in Azure Fluid Relay.
90
+ * @param options - "Get" options. If options are not provided, API
91
+ * will assume maxCount of versions to retreive to be 5.
92
+ * @returns Array of available container versions.
93
+ */
94
+ getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
95
+ private getContainerServices;
96
+ private createLoader;
97
+ private createFluidContainer;
98
+ }
99
+
100
+ /**
101
+ * Props for initializing a new AzureClient instance
102
+ *
103
+ * @public
104
+ */
105
+ export declare interface AzureClientProps {
106
+ /**
107
+ * Configuration for establishing a connection with the Azure Fluid Relay.
108
+ */
109
+ readonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;
110
+ /**
111
+ * Optional. A logger instance to receive diagnostic messages.
112
+ */
113
+ readonly logger?: ITelemetryBaseLogger;
114
+ /**
115
+ * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.
116
+ */
117
+ readonly configProvider?: IConfigProviderBase;
118
+ readonly summaryCompression?: boolean | ICompressionStorageConfig;
119
+ }
120
+
121
+ /**
122
+ * Parameters for establishing a connection with the Azure Fluid Relay.
123
+ *
124
+ * @public
125
+ */
126
+ export declare interface AzureConnectionConfig {
127
+ /**
128
+ * The type of connection. Whether we're connecting to a remote Fluid relay server or a local instance.
129
+ */
130
+ type: AzureConnectionConfigType;
131
+ /**
132
+ * URI to the Azure Fluid Relay service discovery endpoint.
133
+ */
134
+ endpoint: string;
135
+ /**
136
+ * Instance that provides Azure Fluid Relay endpoint tokens.
137
+ */
138
+ tokenProvider: ITokenProvider;
139
+ }
140
+
141
+ /**
142
+ * The type of connection.
143
+ *
144
+ * - "local" for local connections to a Fluid relay instance running on the localhost
145
+ *
146
+ * - "remote" for client connections to the Azure Fluid Relay service
147
+ *
148
+ * @public
149
+ */
150
+ export declare type AzureConnectionConfigType = "local" | "remote";
151
+
152
+ /**
153
+ * Holds the functionality specifically tied to the Azure Fluid Relay, and how the data stored in
154
+ * the FluidContainer is persisted in the backend and consumed by users.
155
+ *
156
+ * @remarks
157
+ *
158
+ * Returned by the {@link AzureClient} alongside a {@link @fluidframework/fluid-static#FluidContainer}.
159
+ *
160
+ * Any functionality regarding how the data is handled within the FluidContainer itself, i.e. which data objects
161
+ * or DDSes to use, will not be included here but rather on the FluidContainer class itself.
162
+ *
163
+ * @public
164
+ */
165
+ export declare interface AzureContainerServices {
166
+ /**
167
+ * Provides an object that can be used to get the users that are present in this Fluid session and
168
+ * listeners for when the roster has any changes from users joining/leaving the session
169
+ */
170
+ audience: IAzureAudience;
171
+ }
172
+
173
+ /**
174
+ * Container version metadata.
175
+ *
176
+ * @public
177
+ */
178
+ export declare interface AzureContainerVersion {
179
+ /**
180
+ * Version ID
181
+ */
182
+ id: string;
183
+ /**
184
+ * Time when version was generated.
185
+ * ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
186
+ */
187
+ date?: string;
188
+ }
189
+
190
+ /**
191
+ * Token Provider implementation for connecting to an Azure Function endpoint for
192
+ * Azure Fluid Relay token resolution.
193
+ *
194
+ * @deprecated 1.2.0, This API will be removed in 2.0.0
195
+ * No replacement since it is not expected anyone will use this token provider as is
196
+ * See https://github.com/microsoft/FluidFramework/issues/13693 for context
197
+ *
198
+ * @public
199
+ */
200
+ export declare class AzureFunctionTokenProvider implements ITokenProvider {
201
+ private readonly azFunctionUrl;
202
+ private readonly user?;
203
+ /**
204
+ * Creates a new instance using configuration parameters.
205
+ * @param azFunctionUrl - URL to Azure Function endpoint
206
+ * @param user - User object
207
+ */
208
+ constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "userId" | "userName" | "additionalDetails"> | undefined);
209
+ fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
210
+ fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
211
+ private getToken;
212
+ }
213
+
214
+ /**
215
+ * Options for "Get Container Versions" API.
216
+ *
217
+ * @public
218
+ */
219
+ export declare interface AzureGetVersionsOptions {
220
+ /**
221
+ * Max number of versions
222
+ */
223
+ maxCount: number;
224
+ }
225
+
226
+ /**
227
+ * Parameters for establishing a local connection with a local instance of the Azure Fluid Relay.
228
+ *
229
+ * @public
230
+ */
231
+ export declare interface AzureLocalConnectionConfig extends AzureConnectionConfig {
232
+ /**
233
+ * The type of connection. Set to a remote connection.
234
+ */
235
+ type: "local";
236
+ }
237
+
238
+ /**
239
+ * Since Azure provides user names for all of its members, we extend the
240
+ * {@link @fluidframework/protocol-definitions#IMember} interface to include this service-specific value.
241
+ * It will be returned for all audience members connected to Azure.
242
+ *
243
+ * @typeParam T - See {@link AzureMember.additionalDetails}.
244
+ * Note: must be JSON-serializable.
245
+ * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
246
+ *
247
+ * @public
248
+ */
249
+ export declare interface AzureMember<T = any> extends IMember {
250
+ /**
251
+ * {@inheritDoc AzureUser.name}
252
+ */
253
+ userName: string;
254
+ /**
255
+ * {@inheritDoc AzureUser.additionalDetails}
256
+ */
257
+ additionalDetails?: T;
258
+ }
259
+
260
+ /**
261
+ * Parameters for establishing a remote connection with the Azure Fluid Relay.
262
+ *
263
+ * @public
264
+ */
265
+ export declare interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
266
+ /**
267
+ * The type of connection. Set to a remote connection.
268
+ */
269
+ type: "remote";
270
+ /**
271
+ * Unique tenant identifier.
272
+ */
273
+ tenantId: string;
274
+ }
275
+
276
+ /**
277
+ * Since Azure provides user names for all of its members, we extend the
278
+ * {@link @fluidframework/protocol-definitions#IUser} interface to include this service-specific value.
279
+ *
280
+ * @typeParam T - See {@link AzureUser.additionalDetails}.
281
+ * Note: must be JSON-serializable.
282
+ * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
283
+ *
284
+ * @public
285
+ */
286
+ export declare interface AzureUser<T = any> extends IUser {
287
+ /**
288
+ * The user's name
289
+ */
290
+ name: string;
291
+ /**
292
+ * Custom, app-specific user information
293
+ */
294
+ additionalDetails?: T;
295
+ }
296
+
297
+ /**
298
+ * Audience object for Azure Fluid Relay containers
299
+ *
300
+ * @public
301
+ */
302
+ export declare type IAzureAudience = IServiceAudience<AzureMember>;
303
+
304
+ export { ITelemetryBaseEvent }
305
+
306
+ export { ITelemetryBaseLogger }
307
+
308
+ export { ITokenClaims }
309
+
310
+ export { ITokenProvider }
311
+
312
+ export { ITokenResponse }
313
+
314
+ export { IUser }
315
+
316
+ export { ScopeType }
317
+
318
+ export { }