@fluidframework/azure-client 2.0.0-internal.7.4.0 → 2.0.0-internal.8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/api-report/azure-client.api.md +0 -7
- package/azure-client.test-files.tar +0 -0
- package/dist/AzureAudience.cjs +1 -22
- package/dist/AzureAudience.cjs.map +1 -1
- package/dist/AzureAudience.d.ts +1 -19
- package/dist/AzureAudience.d.ts.map +1 -1
- package/dist/AzureClient.cjs +1 -5
- package/dist/AzureClient.cjs.map +1 -1
- package/dist/AzureClient.d.ts.map +1 -1
- package/dist/azure-client-alpha.d.ts +0 -6
- package/dist/azure-client-beta.d.ts +0 -6
- package/dist/azure-client-public.d.ts +0 -6
- package/dist/azure-client-untrimmed.d.ts +0 -20
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/lib/AzureAudience.d.ts +1 -19
- package/lib/AzureAudience.d.ts.map +1 -1
- package/lib/AzureAudience.mjs +0 -20
- package/lib/AzureAudience.mjs.map +1 -1
- package/lib/AzureClient.d.ts.map +1 -1
- package/lib/AzureClient.mjs +1 -5
- package/lib/AzureClient.mjs.map +1 -1
- package/lib/azure-client-alpha.d.ts +0 -6
- package/lib/azure-client-beta.d.ts +0 -6
- package/lib/azure-client-public.d.ts +0 -6
- package/lib/azure-client-untrimmed.d.ts +0 -20
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.mjs +0 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +24 -19
- package/src/AzureAudience.ts +1 -22
- package/src/AzureClient.ts +5 -7
- package/src/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @fluidframework/azure-client
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- azure-client: Removed deprecated FluidStatic classes [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
8
|
+
|
|
9
|
+
Several FluidStatic classes were unnecessarily exposed and were deprecated in an earlier release. They have been replaced with creation functions. This helps us
|
|
10
|
+
keep implementations decoupled from usage which is easier to maintain and extend. It has very minimal impact on the
|
|
11
|
+
public surface area of downstream packages. The removed classes are as follows:
|
|
12
|
+
|
|
13
|
+
- `AzureAudience` (use `IAzureAudience` instead)
|
|
14
|
+
- `TinyliciousAudience` (use `ITinyliciousAudience` instead)
|
|
15
|
+
- `DOProviderContainerRuntimeFactory`
|
|
16
|
+
- `FluidContainer`
|
|
17
|
+
- `ServiceAudience`
|
|
18
|
+
|
|
3
19
|
## 2.0.0-internal.7.4.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,12 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
// @internal @deprecated
|
|
24
|
-
export class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
25
|
-
protected createServiceMember(audienceMember: IClient): AzureMember;
|
|
26
|
-
}
|
|
27
20
|
|
|
28
21
|
// @alpha
|
|
29
22
|
export class AzureClient {
|
|
Binary file
|
package/dist/AzureAudience.cjs
CHANGED
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAzureAudienceMember =
|
|
3
|
+
exports.createAzureAudienceMember = void 0;
|
|
4
4
|
/*!
|
|
5
5
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
6
6
|
* Licensed under the MIT License.
|
|
7
7
|
*/
|
|
8
8
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
|
-
const fluid_static_1 = require("@fluidframework/fluid-static");
|
|
10
|
-
/**
|
|
11
|
-
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
|
|
12
|
-
*
|
|
13
|
-
* @remarks Operates in terms of {@link AzureMember}s.
|
|
14
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
class AzureAudience extends fluid_static_1.ServiceAudience {
|
|
18
|
-
/**
|
|
19
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
20
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
21
|
-
*
|
|
22
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
23
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
24
|
-
*/
|
|
25
|
-
createServiceMember(audienceMember) {
|
|
26
|
-
return createAzureAudienceMember(audienceMember);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.AzureAudience = AzureAudience;
|
|
30
9
|
/**
|
|
31
10
|
* Creates Azure-specific audience member
|
|
32
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureAudience.cjs","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAoD;
|
|
1
|
+
{"version":3,"file":"AzureAudience.cjs","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2DAAoD;AAKpD;;GAEG;AACH,SAAgB,yBAAyB,CAAC,cAAuB;IAChE,MAAM,SAAS,GAAG,cAAc,CAAC,IAAiB,CAAC;IACnD,IAAA,mBAAM,EAAC,SAAS,EAAE,IAAI,KAAK,SAAS,EAAE,uCAAuC,CAAC,CAAC;IAE/E,OAAO;QACN,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE;QAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;QACxB,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,SAAS,CAAC,iBAA4B;KACzD,CAAC;AACH,CAAC;AAVD,8DAUC","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 { type IClient } from \"@fluidframework/protocol-definitions\";\n\nimport { type AzureMember, type AzureUser } from \"./interfaces\";\n\n/**\n * Creates Azure-specific audience member\n */\nexport function createAzureAudienceMember(audienceMember: IClient): AzureMember {\n\tconst azureUser = audienceMember.user as AzureUser;\n\tassert(azureUser?.name !== undefined, 'Provided user was not an \"AzureUser\".');\n\n\treturn {\n\t\tuserId: audienceMember.user.id,\n\t\tuserName: azureUser.name,\n\t\tconnections: [],\n\t\tadditionalDetails: azureUser.additionalDetails as unknown,\n\t};\n}\n"]}
|
package/dist/AzureAudience.d.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
import { ServiceAudience } from "@fluidframework/fluid-static";
|
|
2
1
|
import { type IClient } from "@fluidframework/protocol-definitions";
|
|
3
|
-
import { type AzureMember
|
|
4
|
-
/**
|
|
5
|
-
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
|
|
6
|
-
*
|
|
7
|
-
* @remarks Operates in terms of {@link AzureMember}s.
|
|
8
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
12
|
-
/**
|
|
13
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
14
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
15
|
-
*
|
|
16
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
17
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
18
|
-
*/
|
|
19
|
-
protected createServiceMember(audienceMember: IClient): AzureMember;
|
|
20
|
-
}
|
|
2
|
+
import { type AzureMember } from "./interfaces";
|
|
21
3
|
/**
|
|
22
4
|
* Creates Azure-specific audience member
|
|
23
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,cAAc,CAAC;AAEhE;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAU9E"}
|
package/dist/AzureClient.cjs
CHANGED
|
@@ -208,11 +208,7 @@ class AzureClient {
|
|
|
208
208
|
}
|
|
209
209
|
async getContainerEntryPoint(container) {
|
|
210
210
|
const rootDataObject = await container.getEntryPoint();
|
|
211
|
-
(0, core_utils_1.assert)(rootDataObject !== undefined, "entryPoint must
|
|
212
|
-
// ! This "if" is needed for back-compat (older instances of IRootDataObject may not have the IRootDataObject property)
|
|
213
|
-
if (rootDataObject.IRootDataObject === undefined) {
|
|
214
|
-
return rootDataObject;
|
|
215
|
-
}
|
|
211
|
+
(0, core_utils_1.assert)(rootDataObject.IRootDataObject !== undefined, "entryPoint must be of type IRootDataObject");
|
|
216
212
|
return rootDataObject.IRootDataObject;
|
|
217
213
|
}
|
|
218
214
|
}
|
package/dist/AzureClient.cjs.map
CHANGED
|
@@ -1 +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,+DAOsC;AACtC,+EAAiF;AACjF,+EAA2F;AAG3F,2DAAoD;AACpD,uDAA4D;AAC5D,6DAAmF;AAQnF,uCAAwD;AAExD;;GAEG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,WAAW,GAAG,CAAC,oBAA2C,EAAU,EAAE;IAC3E,OAAO,IAAA,qCAA6B,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;;;;GAIG;AACH,MAAa,WAAW;IAKvB;;;OAGG;IACH,YAAoC,UAA4B;QAA5B,eAAU,GAAV,UAAU,CAAkB;QAC/D,wCAAwC;QACxC,UAAU,CAAC,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,WAAW,GAAG,IAAI,mCAAgB,EAAE,CAAC;QAC1C,8EAA8E;QAC9E,6FAA6F;QAC7F,MAAM,kBAAkB,GAAG,IAAA,qCAA6B,EAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrF,MAAM,0BAA0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M,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;aACpE;YACD,OAAO,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC;QACF,MAAM,cAAc,GAAG,IAAA,mCAAoB,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,GACnB,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;QACjC,IAAA,mBAAM,EAAC,cAAc,KAAK,SAAS,EAAE,uBAAuB,CAAC,CAAC;QAC9D,uHAAuH;QACvH,IAAI,cAAc,CAAC,eAAe,KAAK,SAAS,EAAE;YACjD,OAAO,cAAiC,CAAC;SACzC;QACD,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 */\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\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\ttype IFluidContainer,\n\ttype IRootDataObject,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static\";\nimport { type IClient, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver\";\n\nimport { type IConfigProviderBase, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { createAzureAudienceMember } 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 * @alpha\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 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 * 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: 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\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> | undefined =\n\t\t\tawait container.getEntryPoint();\n\t\tassert(rootDataObject !== undefined, \"entryPoint must exist\");\n\t\t// ! This \"if\" is needed for back-compat (older instances of IRootDataObject may not have the IRootDataObject property)\n\t\tif (rootDataObject.IRootDataObject === undefined) {\n\t\t\treturn rootDataObject as IRootDataObject;\n\t\t}\n\t\treturn rootDataObject.IRootDataObject;\n\t}\n\t// #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AzureClient.cjs","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,iFAI+C;AAC/C,uEAA0D;AAK1D,+DAAuE;AACvE,+DAOsC;AACtC,+EAAiF;AACjF,+EAA2F;AAG3F,2DAAoD;AACpD,uDAA4D;AAC5D,6DAAmF;AAQnF,uCAAwD;AAExD;;GAEG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,WAAW,GAAG,CAAC,oBAA2C,EAAU,EAAE;IAC3E,OAAO,IAAA,qCAA6B,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;;;;GAIG;AACH,MAAa,WAAW;IAKvB;;;OAGG;IACH,YAAoC,UAA4B;QAA5B,eAAU,GAAV,UAAU,CAAkB;QAC/D,wCAAwC;QACxC,UAAU,CAAC,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,WAAW,GAAG,IAAI,mCAAgB,EAAE,CAAC;QAC1C,8EAA8E;QAC9E,6FAA6F;QAC7F,MAAM,kBAAkB,GAAG,IAAA,qCAA6B,EAAC,IAAI,CAAC,UAAU,CAAC,UA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AAW,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,IAAA,mCAAoB,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,mBAAM,EACL,cAAc,CAAC,eAAe,KAAK,SAAS,EAC5C,4CAA4C,CAC5C,CAAC;QACF,OAAO,cAAc,CAAC,eAAe,CAAC;IACvC,CAAC;CAED;AAnQD,kCAmQC","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\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\ttype IFluidContainer,\n\ttype IRootDataObject,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static\";\nimport { type IClient, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver\";\n\nimport { type IConfigProviderBase, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { createAzureAudienceMember } 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 * @alpha\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 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 * 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: 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\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\t\"entryPoint must be of type IRootDataObject\",\n\t\t);\n\t\treturn rootDataObject.IRootDataObject;\n\t}\n\t// #endregion\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"AAeA,OAAO,EACN,KAAK,eAAe,EAGpB,KAAK,eAAe,EAGpB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,MAAM,cAAc,CAAC;AAetB;;;;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,CAAC,QAAQ,CAAC,cAAc,CAAkC;IAEjE;;;OAGG;gBACiC,UAAU,EAAE,gBAAgB;IAoBhE;;;;;;OAMG;IACU,eAAe,CAAC,gBAAgB,SAAS,eAAe,EACpE,eAAe,EAAE,gBAAgB,GAC/B,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAgBF;;;;;;;;;OASG;IACU,aAAa,CAAC,gBAAgB,SAAS,eAAe,EAClE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAoCF;;;;;;;OAOG;IACU,YAAY,CAAC,gBAAgB,SAAS,eAAe,EACjE,E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AE,qBAAqB,GAC7B,OAAO,CAAC;QACV,SAAS,EAAE,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;IAmBF;;;;;;OAMG;IACU,oBAAoB,CAChC,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA0BnC,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,YAAY;YA8BN,oBAAoB;YAgCpB,sBAAsB;CASpC"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,9 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
/* Excluded from this release type: AzureAudience */
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
|
|
@@ -255,6 +251,4 @@ export { IUser }
|
|
|
255
251
|
|
|
256
252
|
export { ScopeType }
|
|
257
253
|
|
|
258
|
-
/* Excluded from this release type: ServiceAudience */
|
|
259
|
-
|
|
260
254
|
export { }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,9 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
/* Excluded from this release type: AzureAudience */
|
|
24
20
|
|
|
25
21
|
/* Excluded from this release type: AzureClient */
|
|
26
22
|
|
|
@@ -72,6 +68,4 @@ export { IUser }
|
|
|
72
68
|
|
|
73
69
|
export { ScopeType }
|
|
74
70
|
|
|
75
|
-
/* Excluded from this release type: ServiceAudience */
|
|
76
|
-
|
|
77
71
|
export { }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,9 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
/* Excluded from this release type: AzureAudience */
|
|
24
20
|
|
|
25
21
|
/* Excluded from this release type: AzureClient */
|
|
26
22
|
|
|
@@ -72,6 +68,4 @@ export { IUser }
|
|
|
72
68
|
|
|
73
69
|
export { ScopeType }
|
|
74
70
|
|
|
75
|
-
/* Excluded from this release type: ServiceAudience */
|
|
76
|
-
|
|
77
71
|
export { }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,25 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
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
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export declare class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
31
|
-
/**
|
|
32
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
33
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
34
|
-
*
|
|
35
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
36
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
37
|
-
*/
|
|
38
|
-
protected createServiceMember(audienceMember: IClient): AzureMember;
|
|
39
|
-
}
|
|
40
20
|
|
|
41
21
|
/**
|
|
42
22
|
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
|
package/dist/index.cjs
CHANGED
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ScopeType = exports.AzureFunctionTokenProvider = exports.AzureClient =
|
|
7
|
+
exports.ScopeType = exports.AzureFunctionTokenProvider = exports.AzureClient = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* A simple and powerful way to consume collaborative Fluid data with the Azure Fluid Relay.
|
|
10
10
|
*
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
|
-
var AzureAudience_1 = require("./AzureAudience.cjs");
|
|
14
|
-
Object.defineProperty(exports, "AzureAudience", { enumerable: true, get: function () { return AzureAudience_1.AzureAudience; } });
|
|
15
13
|
var AzureClient_1 = require("./AzureClient.cjs");
|
|
16
14
|
Object.defineProperty(exports, "AzureClient", { enumerable: true, get: function () { return AzureClient_1.AzureClient; } });
|
|
17
15
|
var AzureFunctionTokenProvider_1 = require("./AzureFunctionTokenProvider.cjs");
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,iDAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,+EAA0E;AAAjE,wIAAA,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\";\nexport { AzureFunctionTokenProvider } from \"./AzureFunctionTokenProvider\";\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\";\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"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export { AzureAudience } from "./AzureAudience";
|
|
11
10
|
export { AzureClient } from "./AzureClient";
|
|
12
11
|
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider";
|
|
13
12
|
export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,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,cAAc,CAAC;AAEtB,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"}
|
package/lib/AzureAudience.d.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
import { ServiceAudience } from "@fluidframework/fluid-static";
|
|
2
1
|
import { type IClient } from "@fluidframework/protocol-definitions";
|
|
3
|
-
import { type AzureMember
|
|
4
|
-
/**
|
|
5
|
-
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
|
|
6
|
-
*
|
|
7
|
-
* @remarks Operates in terms of {@link AzureMember}s.
|
|
8
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
12
|
-
/**
|
|
13
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
14
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
15
|
-
*
|
|
16
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
17
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
18
|
-
*/
|
|
19
|
-
protected createServiceMember(audienceMember: IClient): AzureMember;
|
|
20
|
-
}
|
|
2
|
+
import { type AzureMember } from "./interfaces.mjs";
|
|
21
3
|
/**
|
|
22
4
|
* Creates Azure-specific audience member
|
|
23
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"OAKO,EAAE,
|
|
1
|
+
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"OAKO,EAAE,KAAK,OAAO,EAAE,MAAM,sCAAsC;OAE5D,EAAE,KAAK,WAAW,EAAkB;AAE3C;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAU9E"}
|
package/lib/AzureAudience.mjs
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
import { assert } from "@fluidframework/core-utils";
|
|
2
|
-
import { ServiceAudience } from "@fluidframework/fluid-static";
|
|
3
|
-
/**
|
|
4
|
-
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
|
|
5
|
-
*
|
|
6
|
-
* @remarks Operates in terms of {@link AzureMember}s.
|
|
7
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export class AzureAudience extends ServiceAudience {
|
|
11
|
-
/**
|
|
12
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
13
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
14
|
-
*
|
|
15
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
16
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
17
|
-
*/
|
|
18
|
-
createServiceMember(audienceMember) {
|
|
19
|
-
return createAzureAudienceMember(audienceMember);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
2
|
/**
|
|
23
3
|
* Creates Azure-specific audience member
|
|
24
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureAudience.mjs","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"OAIO,EAAE,MAAM,EAAE,MAAM,4BAA4B;
|
|
1
|
+
{"version":3,"file":"AzureAudience.mjs","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"OAIO,EAAE,MAAM,EAAE,MAAM,4BAA4B;AAKnD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,cAAuB;IAChE,MAAM,SAAS,GAAG,cAAc,CAAC,IAAiB,CAAC;IACnD,MAAM,CAAC,SAAS,EAAE,IAAI,KAAK,SAAS,EAAE,uCAAuC,CAAC,CAAC;IAE/E,OAAO;QACN,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE;QAC9B,QAAQ,EAAE,SAAS,CAAC,IAAI;QACxB,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,SAAS,CAAC,iBAA4B;KACzD,CAAC;AACH,CAAC","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 { type IClient } from \"@fluidframework/protocol-definitions\";\n\nimport { type AzureMember, type AzureUser } from \"./interfaces\";\n\n/**\n * Creates Azure-specific audience member\n */\nexport function createAzureAudienceMember(audienceMember: IClient): AzureMember {\n\tconst azureUser = audienceMember.user as AzureUser;\n\tassert(azureUser?.name !== undefined, 'Provided user was not an \"AzureUser\".');\n\n\treturn {\n\t\tuserId: audienceMember.user.id,\n\t\tuserName: azureUser.name,\n\t\tconnections: [],\n\t\tadditionalDetails: azureUser.additionalDetails as unknown,\n\t};\n}\n"]}
|
package/lib/AzureClient.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.d.ts","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"OAeO,EACN,KAAK,eAAe,EAGpB,KAAK,eAAe,EAGpB,MAAM,8BAA8B;OAQ9B,EACN,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B;AAeD;;;;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,CAAC,QAAQ,CAAC,cAAc,CAAkC;IAEjE;;;OAGG;gBACiC,UAAU,EAAE,gBAAgB;IAoBhE;;;;;;OAMG;IACU,eAAe,CAAC,gBAAgB,SAAS,eAAe,EACpE,eAAe,EAAE,gBAAgB,GAC/B,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAgBF;;;;;;;;;OASG;IACU,aAAa,CAAC,gBAAgB,SAAS,eAAe,EAClE,EAAE,EAAE,MAAM,EACV,eAAe,EAAE,gBAAgB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC;QACV,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7C,QAAQ,EAAE,sBAAsB,CAAC;KACjC,CAAC;IAoCF;;;;;;;OAOG;IACU,YAAY,CAAC,gBAA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GAC7B,OAAO,CAAC;QACV,SAAS,EAAE,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;IAmBF;;;;;;OAMG;IACU,oBAAoB,CAChC,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA0BnC,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,YAAY;YA8BN,oBAAoB;YAgCpB,sBAAsB;CASpC"}
|
package/lib/AzureClient.mjs
CHANGED
|
@@ -201,11 +201,7 @@ export class AzureClient {
|
|
|
201
201
|
}
|
|
202
202
|
async getContainerEntryPoint(container) {
|
|
203
203
|
const rootDataObject = await container.getEntryPoint();
|
|
204
|
-
assert(rootDataObject !== undefined, "entryPoint must
|
|
205
|
-
// ! This "if" is needed for back-compat (older instances of IRootDataObject may not have the IRootDataObject property)
|
|
206
|
-
if (rootDataObject.IRootDataObject === undefined) {
|
|
207
|
-
return rootDataObject;
|
|
208
|
-
}
|
|
204
|
+
assert(rootDataObject.IRootDataObject !== undefined, "entryPoint must be of type IRootDataObject");
|
|
209
205
|
return rootDataObject.IRootDataObject;
|
|
210
206
|
}
|
|
211
207
|
}
|
package/lib/AzureClient.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.mjs","sourceRoot":"","sources":["../src/AzureClient.ts"],"names":[],"mappings":"OAIO,EACN,WAAW,GAGX,MAAM,uCAAuC;OACvC,EAAE,MAAM,EAAE,MAAM,kCAAkC;OAKlD,EAAE,uBAAu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,cAAc,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAAC,SAAqB;QACzD,MAAM,cAAc,GACnB,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC;QACjC,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE,uBAAuB,CAAC,CAAC;QAC9D,uHAAuH;QACvH,IAAI,cAAc,CAAC,eAAe,KAAK,SAAS,EAAE;YACjD,OAAO,cAAiC,CAAC;SACzC;QACD,OAAO,cAAc,CAAC,eAAe,CAAC;IACvC,CAAC;CAED","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\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\ttype IFluidContainer,\n\ttype IRootDataObject,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static\";\nimport { type IClient, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver\";\n\nimport { type IConfigProviderBase, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { createAzureAudienceMember } 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 * @alpha\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 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 * 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: 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\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> | undefined =\n\t\t\tawait container.getEntryPoint();\n\t\tassert(rootDataObject !== undefined, \"entryPoint must exist\");\n\t\t// ! This \"if\" is needed for back-compat (older instances of IRootDataObject may not have the IRootDataObject property)\n\t\tif (rootDataObject.IRootDataObject === undefined) {\n\t\t\treturn rootDataObject as IRootDataObject;\n\t\t}\n\t\treturn rootDataObject.IRootD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AAC;aACpE;YACD,OAAO,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC;QACF,MAAM,cAAc,GAAG,oBAAoB,CAAmB;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,MAAM,CACL,cAAc,CAAC,eAAe,KAAK,SAAS,EAC5C,4CAA4C,CAC5C,CAAC;QACF,OAAO,cAAc,CAAC,eAAe,CAAC;IACvC,CAAC;CAED","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\tcreateDOProviderContainerRuntimeFactory,\n\tcreateFluidContainer,\n\ttype IFluidContainer,\n\ttype IRootDataObject,\n\tcreateServiceAudience,\n} from \"@fluidframework/fluid-static\";\nimport { type IClient, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { RouterliciousDocumentServiceFactory } from \"@fluidframework/routerlicious-driver\";\n\nimport { type IConfigProviderBase, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { createAzureAudienceMember } 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 * @alpha\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 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 * 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: 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\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\t\"entryPoint must be of type IRootDataObject\",\n\t\t);\n\t\treturn rootDataObject.IRootDataObject;\n\t}\n\t// #endregion\n}\n"]}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,9 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
/* Excluded from this release type: AzureAudience */
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
|
|
@@ -255,6 +251,4 @@ export { IUser }
|
|
|
255
251
|
|
|
256
252
|
export { ScopeType }
|
|
257
253
|
|
|
258
|
-
/* Excluded from this release type: ServiceAudience */
|
|
259
|
-
|
|
260
254
|
export { }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,9 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
/* Excluded from this release type: AzureAudience */
|
|
24
20
|
|
|
25
21
|
/* Excluded from this release type: AzureClient */
|
|
26
22
|
|
|
@@ -72,6 +68,4 @@ export { IUser }
|
|
|
72
68
|
|
|
73
69
|
export { ScopeType }
|
|
74
70
|
|
|
75
|
-
/* Excluded from this release type: ServiceAudience */
|
|
76
|
-
|
|
77
71
|
export { }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,9 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
import { ScopeType } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ServiceAudience } from '@fluidframework/fluid-static';
|
|
22
|
-
|
|
23
|
-
/* Excluded from this release type: AzureAudience */
|
|
24
20
|
|
|
25
21
|
/* Excluded from this release type: AzureClient */
|
|
26
22
|
|
|
@@ -72,6 +68,4 @@ export { IUser }
|
|
|
72
68
|
|
|
73
69
|
export { ScopeType }
|
|
74
70
|
|
|
75
|
-
/* Excluded from this release type: ServiceAudience */
|
|
76
|
-
|
|
77
71
|
export { }
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { ContainerSchema } from '@fluidframework/fluid-static';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
8
|
import { ICompressionStorageConfig } from '@fluidframework/driver-utils';
|
|
10
9
|
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
11
10
|
import { IFluidContainer } from '@fluidframework/fluid-static';
|
|
@@ -18,25 +17,6 @@ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
|
|
|
18
17
|
import { ITokenResponse } from '@fluidframework/routerlicious-driver';
|
|
19
18
|
import { IUser } from '@fluidframework/protocol-definitions';
|
|
20
19
|
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
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export declare class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
31
|
-
/**
|
|
32
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
33
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
34
|
-
*
|
|
35
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
36
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
37
|
-
*/
|
|
38
|
-
protected createServiceMember(audienceMember: IClient): AzureMember;
|
|
39
|
-
}
|
|
40
20
|
|
|
41
21
|
/**
|
|
42
22
|
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { AzureAudience } from "./AzureAudience.mjs";
|
|
6
5
|
export { AzureClient } from "./AzureClient.mjs";
|
|
7
6
|
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider.mjs";
|
|
8
7
|
export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.mjs";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EAAE,WAAW,EAAE;OACf,EAAE,0BAA0B,EAAE;YACzB,EACX,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,cAAc,GACd;YAEW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC;YAC9E,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sCAAsC;OACxE,EAAE,SAAS,EAAE,MAAM,sCAAsC;YAGpD,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC"}
|
package/lib/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { AzureAudience } from "./AzureAudience.mjs";
|
|
6
5
|
export { AzureClient } from "./AzureClient.mjs";
|
|
7
6
|
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider.mjs";
|
|
8
7
|
export { ScopeType } from "@fluidframework/protocol-definitions";
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EAAE,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAQI,EAAE,WAAW,EAAE;OACf,EAAE,0BAA0B,EAAE;OAiB9B,EAAE,SAAS,EAAE,MAAM,sCAAsC","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\";\nexport { AzureFunctionTokenProvider } from \"./AzureFunctionTokenProvider\";\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\";\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/azure-client",
|
|
3
|
-
"version": "2.0.0-internal.
|
|
3
|
+
"version": "2.0.0-internal.8.0.0",
|
|
4
4
|
"description": "A tool to enable creation and loading of Fluid containers using the Azure Fluid Relay service",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -27,34 +27,34 @@
|
|
|
27
27
|
"module": "lib/index.mjs",
|
|
28
28
|
"types": "dist/index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.
|
|
31
|
-
"@fluidframework/container-loader": ">=2.0.0-internal.
|
|
32
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.
|
|
33
|
-
"@fluidframework/core-utils": ">=2.0.0-internal.
|
|
34
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.
|
|
35
|
-
"@fluidframework/driver-utils": ">=2.0.0-internal.
|
|
36
|
-
"@fluidframework/fluid-static": ">=2.0.0-internal.
|
|
37
|
-
"@fluidframework/map": ">=2.0.0-internal.
|
|
30
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
31
|
+
"@fluidframework/container-loader": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
32
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
33
|
+
"@fluidframework/core-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
34
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
35
|
+
"@fluidframework/driver-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
36
|
+
"@fluidframework/fluid-static": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
37
|
+
"@fluidframework/map": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
38
38
|
"@fluidframework/protocol-definitions": "^3.0.0",
|
|
39
|
-
"@fluidframework/routerlicious-driver": ">=2.0.0-internal.
|
|
40
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.
|
|
39
|
+
"@fluidframework/routerlicious-driver": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
40
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
41
41
|
"@fluidframework/server-services-client": "^2.0.1",
|
|
42
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.
|
|
42
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
43
43
|
"axios": "^0.26.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@arethetypeswrong/cli": "^0.13.3",
|
|
47
|
-
"@fluid-experimental/tree2": ">=2.0.0-internal.
|
|
47
|
+
"@fluid-experimental/tree2": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
48
48
|
"@fluid-tools/build-cli": "^0.28.0",
|
|
49
|
-
"@fluidframework/aqueduct": ">=2.0.0-internal.
|
|
49
|
+
"@fluidframework/aqueduct": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
50
50
|
"@fluidframework/azure-client-previous": "npm:@fluidframework/azure-client@2.0.0-internal.7.2.0",
|
|
51
|
-
"@fluidframework/azure-local-service": ">=2.0.0-internal.
|
|
51
|
+
"@fluidframework/azure-local-service": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
52
52
|
"@fluidframework/build-common": "^2.0.3",
|
|
53
53
|
"@fluidframework/build-tools": "^0.28.0",
|
|
54
|
-
"@fluidframework/counter": ">=2.0.0-internal.
|
|
54
|
+
"@fluidframework/counter": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
55
55
|
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
56
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.
|
|
57
|
-
"@fluidframework/test-utils": ">=2.0.0-internal.
|
|
56
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
57
|
+
"@fluidframework/test-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
|
|
58
58
|
"@microsoft/api-extractor": "^7.38.3",
|
|
59
59
|
"@types/mocha": "^9.1.1",
|
|
60
60
|
"@types/node": "^18.19.0",
|
|
@@ -84,7 +84,12 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"typeValidation": {
|
|
87
|
-
"broken": {
|
|
87
|
+
"broken": {
|
|
88
|
+
"RemovedClassDeclaration_AzureAudience": {
|
|
89
|
+
"forwardCompat": false,
|
|
90
|
+
"backCompat": false
|
|
91
|
+
}
|
|
92
|
+
}
|
|
88
93
|
},
|
|
89
94
|
"scripts": {
|
|
90
95
|
"api": "fluid-build . --task api",
|
package/src/AzureAudience.ts
CHANGED
|
@@ -3,30 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { assert } from "@fluidframework/core-utils";
|
|
6
|
-
import { ServiceAudience } from "@fluidframework/fluid-static";
|
|
7
6
|
import { type IClient } from "@fluidframework/protocol-definitions";
|
|
8
7
|
|
|
9
|
-
import { type AzureMember, type AzureUser
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
|
|
13
|
-
*
|
|
14
|
-
* @remarks Operates in terms of {@link AzureMember}s.
|
|
15
|
-
* @deprecated This class will be removed. use {@link IAzureAudience} instead
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
19
|
-
/**
|
|
20
|
-
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
21
|
-
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
22
|
-
*
|
|
23
|
-
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
24
|
-
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
25
|
-
*/
|
|
26
|
-
protected createServiceMember(audienceMember: IClient): AzureMember {
|
|
27
|
-
return createAzureAudienceMember(audienceMember);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
8
|
+
import { type AzureMember, type AzureUser } from "./interfaces";
|
|
30
9
|
|
|
31
10
|
/**
|
|
32
11
|
* Creates Azure-specific audience member
|
package/src/AzureClient.ts
CHANGED
|
@@ -305,13 +305,11 @@ export class AzureClient {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
private async getContainerEntryPoint(container: IContainer): Promise<IRootDataObject> {
|
|
308
|
-
const rootDataObject: FluidObject<IRootDataObject>
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return rootDataObject as IRootDataObject;
|
|
314
|
-
}
|
|
308
|
+
const rootDataObject: FluidObject<IRootDataObject> = await container.getEntryPoint();
|
|
309
|
+
assert(
|
|
310
|
+
rootDataObject.IRootDataObject !== undefined,
|
|
311
|
+
"entryPoint must be of type IRootDataObject",
|
|
312
|
+
);
|
|
315
313
|
return rootDataObject.IRootDataObject;
|
|
316
314
|
}
|
|
317
315
|
// #endregion
|