@fluidframework/azure-client 2.0.0-rc.1.0.6 → 2.0.0-rc.2.0.1
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 +4 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/azure-client.api.md +2 -2
- package/dist/AzureAudience.d.ts +9 -2
- package/dist/AzureAudience.d.ts.map +1 -1
- package/dist/AzureAudience.js +25 -9
- package/dist/AzureAudience.js.map +1 -1
- package/dist/AzureClient.d.ts +2 -2
- package/dist/AzureClient.d.ts.map +1 -1
- package/dist/AzureClient.js +8 -8
- package/dist/AzureClient.js.map +1 -1
- package/dist/AzureFunctionTokenProvider.d.ts +2 -2
- package/dist/AzureFunctionTokenProvider.d.ts.map +1 -1
- package/dist/AzureFunctionTokenProvider.js.map +1 -1
- package/dist/azure-client-alpha.d.ts +2 -2
- package/dist/azure-client-beta.d.ts +2 -2
- package/dist/azure-client-public.d.ts +2 -2
- package/dist/azure-client-untrimmed.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/lib/AzureAudience.d.ts +14 -0
- package/lib/AzureAudience.d.ts.map +1 -0
- package/lib/AzureAudience.js +35 -0
- package/lib/AzureAudience.js.map +1 -0
- package/lib/{AzureClient.d.mts → AzureClient.d.ts} +3 -3
- package/lib/AzureClient.d.ts.map +1 -0
- package/lib/{AzureClient.mjs → AzureClient.js} +8 -4
- package/lib/AzureClient.js.map +1 -0
- package/lib/{AzureFunctionTokenProvider.d.mts → AzureFunctionTokenProvider.d.ts} +3 -3
- package/lib/AzureFunctionTokenProvider.d.ts.map +1 -0
- package/lib/{AzureFunctionTokenProvider.mjs → AzureFunctionTokenProvider.js} +5 -1
- package/lib/AzureFunctionTokenProvider.js.map +1 -0
- package/lib/{AzureUrlResolver.d.mts → AzureUrlResolver.d.ts} +5 -1
- package/lib/AzureUrlResolver.d.ts.map +1 -0
- package/lib/{AzureUrlResolver.mjs → AzureUrlResolver.js} +1 -1
- package/lib/AzureUrlResolver.js.map +1 -0
- package/lib/{azure-client-alpha.d.mts → azure-client-alpha.d.ts} +8 -2
- package/lib/{azure-client-beta.d.mts → azure-client-beta.d.ts} +8 -2
- package/lib/{azure-client-public.d.mts → azure-client-public.d.ts} +8 -2
- package/lib/{azure-client-untrimmed.d.mts → azure-client-untrimmed.d.ts} +9 -3
- package/lib/{index.d.mts → index.d.ts} +9 -4
- package/lib/index.d.ts.map +1 -0
- package/lib/{index.mjs → index.js} +8 -3
- package/lib/index.js.map +1 -0
- package/lib/{interfaces.d.mts → interfaces.d.ts} +6 -2
- package/lib/interfaces.d.ts.map +1 -0
- package/lib/interfaces.js +2 -0
- package/lib/interfaces.js.map +1 -0
- package/lib/test/AzureClient.spec.js +212 -0
- package/lib/test/AzureClient.spec.js.map +1 -0
- package/lib/test/types/validateAzureClientPrevious.generated.js +42 -0
- package/lib/test/types/validateAzureClientPrevious.generated.js.map +1 -0
- package/lib/{utils.d.mts → utils.d.ts} +6 -2
- package/lib/utils.d.ts.map +1 -0
- package/lib/{utils.mjs → utils.js} +1 -1
- package/lib/utils.js.map +1 -0
- package/package.json +49 -49
- package/src/AzureAudience.ts +26 -9
- package/src/AzureClient.ts +5 -5
- package/src/AzureFunctionTokenProvider.ts +1 -1
- package/src/index.ts +3 -3
- package/src/interfaces.ts +1 -1
- package/src/utils.ts +1 -1
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/AzureAudience.d.mts +0 -7
- package/lib/AzureAudience.d.mts.map +0 -1
- package/lib/AzureAudience.mjs +0 -15
- package/lib/AzureAudience.mjs.map +0 -1
- package/lib/AzureClient.d.mts.map +0 -1
- package/lib/AzureClient.mjs.map +0 -1
- package/lib/AzureFunctionTokenProvider.d.mts.map +0 -1
- package/lib/AzureFunctionTokenProvider.mjs.map +0 -1
- package/lib/AzureUrlResolver.d.mts.map +0 -1
- package/lib/AzureUrlResolver.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/interfaces.d.mts.map +0 -1
- package/lib/interfaces.mjs +0 -2
- package/lib/interfaces.mjs.map +0 -1
- package/lib/utils.d.mts.map +0 -1
- package/lib/utils.mjs.map +0 -1
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
|
|
4
|
+
// CJS is actually secondary; so, no report.
|
|
5
|
+
"apiReport": {
|
|
6
|
+
"enabled": false
|
|
7
|
+
}
|
|
4
8
|
}
|
package/api-extractor-lint.json
CHANGED
package/api-extractor.json
CHANGED
|
@@ -25,7 +25,7 @@ export class AzureClient {
|
|
|
25
25
|
container: IFluidContainer<TContainerSchema>;
|
|
26
26
|
services: AzureContainerServices;
|
|
27
27
|
}>;
|
|
28
|
-
createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
28
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
29
29
|
container: IFluidContainer<TContainerSchema>;
|
|
30
30
|
services: AzureContainerServices;
|
|
31
31
|
}>;
|
|
@@ -68,7 +68,7 @@ export interface AzureContainerVersion {
|
|
|
68
68
|
|
|
69
69
|
// @internal @deprecated
|
|
70
70
|
export class AzureFunctionTokenProvider implements ITokenProvider {
|
|
71
|
-
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "
|
|
71
|
+
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "additionalDetails" | "userId" | "userName"> | undefined);
|
|
72
72
|
// (undocumented)
|
|
73
73
|
fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
|
|
74
74
|
// (undocumented)
|
package/dist/AzureAudience.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
1
5
|
import { type IClient } from "@fluidframework/protocol-definitions";
|
|
2
|
-
import { type AzureMember } from "./interfaces";
|
|
6
|
+
import { type AzureMember } from "./interfaces.js";
|
|
3
7
|
/**
|
|
4
|
-
* Creates Azure-specific audience member
|
|
8
|
+
* Creates Azure-specific audience member.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The provided `audienceMember`'s {@link @fluidframework/protocol-definitions#IClient.user} must be an {@link AzureUser}.
|
|
5
12
|
*/
|
|
6
13
|
export declare function createAzureAudienceMember(audienceMember: IClient): AzureMember;
|
|
7
14
|
//# sourceMappingURL=AzureAudience.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAU9E"}
|
package/dist/AzureAudience.js
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAzureAudienceMember = void 0;
|
|
4
2
|
/*!
|
|
5
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
6
4
|
* Licensed under the MIT License.
|
|
7
5
|
*/
|
|
8
|
-
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createAzureAudienceMember = void 0;
|
|
9
8
|
/**
|
|
10
|
-
* Creates Azure-specific audience member
|
|
9
|
+
* Creates Azure-specific audience member.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* The provided `audienceMember`'s {@link @fluidframework/protocol-definitions#IClient.user} must be an {@link AzureUser}.
|
|
11
13
|
*/
|
|
12
14
|
function createAzureAudienceMember(audienceMember) {
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
+
const user = audienceMember.user;
|
|
16
|
+
assertIsAzureUser(user);
|
|
15
17
|
return {
|
|
16
|
-
userId:
|
|
17
|
-
userName:
|
|
18
|
+
userId: user.id,
|
|
19
|
+
userName: user.name,
|
|
18
20
|
connections: [],
|
|
19
|
-
additionalDetails:
|
|
21
|
+
additionalDetails: user.additionalDetails,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
exports.createAzureAudienceMember = createAzureAudienceMember;
|
|
25
|
+
/**
|
|
26
|
+
* Asserts that the provided {@link @fluidframework/protocol-definitions#IUser} is an {@link AzureUser}.
|
|
27
|
+
*/
|
|
28
|
+
function assertIsAzureUser(user) {
|
|
29
|
+
const maybeAzureUser = user;
|
|
30
|
+
const baseMessage = 'Provided user data was not an "AzureUser".';
|
|
31
|
+
if (maybeAzureUser.id === undefined) {
|
|
32
|
+
throw new TypeError(`${baseMessage} Missing required "id" property.`);
|
|
33
|
+
}
|
|
34
|
+
// AB#7448 to reenable this check. Disabling to mitigate a bug that the name may be missing.
|
|
35
|
+
// if (maybeAzureUser.name === undefined) {
|
|
36
|
+
// throw new TypeError(`${baseMessage} Missing required "name" property.`);
|
|
37
|
+
// }
|
|
38
|
+
}
|
|
23
39
|
//# sourceMappingURL=AzureAudience.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureAudience.js","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AzureAudience.js","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,cAAuB;IAChE,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IACjC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAExB,OAAO;QACN,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,QAAQ,EAAE,IAAI,CAAC,IAAI;QACnB,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KACzC,CAAC;AACH,CAAC;AAVD,8DAUC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAAW;IACrC,MAAM,cAAc,GAAG,IAA0B,CAAC;IAClD,MAAM,WAAW,GAAG,4CAA4C,CAAC;IACjE,IAAI,cAAc,CAAC,EAAE,KAAK,SAAS,EAAE;QACpC,MAAM,IAAI,SAAS,CAAC,GAAG,WAAW,kCAAkC,CAAC,CAAC;KACtE;IACD,6FAA6F;IAC7F,2CAA2C;IAC3C,4EAA4E;IAC5E,IAAI;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IClient, type IUser } from \"@fluidframework/protocol-definitions\";\nimport { type AzureMember, type AzureUser } from \"./interfaces.js\";\n\n/**\n * Creates Azure-specific audience member.\n *\n * @remarks\n * The provided `audienceMember`'s {@link @fluidframework/protocol-definitions#IClient.user} must be an {@link AzureUser}.\n */\nexport function createAzureAudienceMember(audienceMember: IClient): AzureMember {\n\tconst user = audienceMember.user;\n\tassertIsAzureUser(user);\n\n\treturn {\n\t\tuserId: user.id,\n\t\tuserName: user.name,\n\t\tconnections: [],\n\t\tadditionalDetails: user.additionalDetails,\n\t};\n}\n\n/**\n * Asserts that the provided {@link @fluidframework/protocol-definitions#IUser} is an {@link AzureUser}.\n */\nfunction assertIsAzureUser(user: IUser): asserts user is AzureUser<unknown> {\n\tconst maybeAzureUser = user as Partial<AzureUser>;\n\tconst baseMessage = 'Provided user data was not an \"AzureUser\".';\n\tif (maybeAzureUser.id === undefined) {\n\t\tthrow new TypeError(`${baseMessage} Missing required \"id\" property.`);\n\t}\n\t// AB#7448 to reenable this check. Disabling to mitigate a bug that the name may be missing.\n\t// if (maybeAzureUser.name === undefined) {\n\t// \tthrow new TypeError(`${baseMessage} Missing required \"name\" property.`);\n\t// }\n}\n"]}
|
package/dist/AzureClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ContainerSchema, type IFluidContainer } from "@fluidframework/fluid-static";
|
|
2
|
-
import { type AzureClientProps, type AzureContainerServices, type AzureContainerVersion, type AzureGetVersionsOptions } from "./interfaces";
|
|
2
|
+
import { type AzureClientProps, type AzureContainerServices, type AzureContainerVersion, type AzureGetVersionsOptions } from "./interfaces.js";
|
|
3
3
|
/**
|
|
4
4
|
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
|
|
5
5
|
* when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.
|
|
@@ -22,7 +22,7 @@ export declare class AzureClient {
|
|
|
22
22
|
* @param containerSchema - Container schema for the new container.
|
|
23
23
|
* @returns New detached container instance along with associated services.
|
|
24
24
|
*/
|
|
25
|
-
createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
25
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
26
26
|
container: IFluidContainer<TContainerSchema>;
|
|
27
27
|
services: AzureContainerServices;
|
|
28
28
|
}>;
|
|
@@ -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;AAStC,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,MAAM,
|
|
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;AAStC,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,MAAM,iBAAiB,CAAC;AAwBzB;;;;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;IAuBhE;;;;;;OAMG;IACU,eAAe,CAAC,KAAK,CAAC,gBAAgB,SAAS,eAAe,EAC1E,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,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/dist/AzureClient.js
CHANGED
|
@@ -13,15 +13,15 @@ const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
|
13
13
|
const routerlicious_driver_1 = require("@fluidframework/routerlicious-driver");
|
|
14
14
|
const core_utils_1 = require("@fluidframework/core-utils");
|
|
15
15
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
16
|
+
const AzureAudience_js_1 = require("./AzureAudience.js");
|
|
17
|
+
const AzureUrlResolver_js_1 = require("./AzureUrlResolver.js");
|
|
18
|
+
const utils_js_1 = require("./utils.js");
|
|
19
19
|
/**
|
|
20
20
|
* Strongly typed id for connecting to a local Azure Fluid Relay.
|
|
21
21
|
*/
|
|
22
22
|
const LOCAL_MODE_TENANT_ID = "local";
|
|
23
23
|
const getTenantId = (connectionProperties) => {
|
|
24
|
-
return (0,
|
|
24
|
+
return (0, utils_js_1.isAzureRemoteConnectionConfig)(connectionProperties)
|
|
25
25
|
? connectionProperties.tenantId
|
|
26
26
|
: LOCAL_MODE_TENANT_ID;
|
|
27
27
|
};
|
|
@@ -48,10 +48,10 @@ class AzureClient {
|
|
|
48
48
|
this.properties = properties;
|
|
49
49
|
// remove trailing slash from URL if any
|
|
50
50
|
properties.connection.endpoint = properties.connection.endpoint.replace(/\/$/, "");
|
|
51
|
-
this.urlResolver = new
|
|
51
|
+
this.urlResolver = new AzureUrlResolver_js_1.AzureUrlResolver();
|
|
52
52
|
// The local service implementation differs from the Azure Fluid Relay in blob
|
|
53
53
|
// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.
|
|
54
|
-
const isRemoteConnection = (0,
|
|
54
|
+
const isRemoteConnection = (0, utils_js_1.isAzureRemoteConnectionConfig)(this.properties.connection);
|
|
55
55
|
const origDocumentServiceFactory = new routerlicious_driver_1.RouterliciousDocumentServiceFactory(this.properties.connection.tokenProvider, {
|
|
56
56
|
enableWholeSummaryUpload: isRemoteConnection,
|
|
57
57
|
enableDiscovery: isRemoteConnection,
|
|
@@ -161,7 +161,7 @@ class AzureClient {
|
|
|
161
161
|
return {
|
|
162
162
|
audience: (0, fluid_static_1.createServiceAudience)({
|
|
163
163
|
container,
|
|
164
|
-
createServiceMember:
|
|
164
|
+
createServiceMember: AzureAudience_js_1.createAzureAudienceMember,
|
|
165
165
|
}),
|
|
166
166
|
};
|
|
167
167
|
}
|
|
@@ -193,7 +193,7 @@ class AzureClient {
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
async createFluidContainer(container, connection) {
|
|
196
|
-
const createNewRequest = (0,
|
|
196
|
+
const createNewRequest = (0, AzureUrlResolver_js_1.createAzureCreateNewRequest)(connection.endpoint, getTenantId(connection));
|
|
197
197
|
const rootDataObject = await this.getContainerEntryPoint(container);
|
|
198
198
|
/**
|
|
199
199
|
* See {@link FluidContainer.attach}
|
package/dist/AzureClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClient.js","sourceRoot":"","sources":["../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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;AAtQD,kCAsQC","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 FluidObject, type IConfigProviderBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { wrapConfigProviderWithDefaults } from \"@fluidframework/telemetry-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 * Default feature gates.\n * These values will only be used if the feature gate is not already set by the supplied config provider.\n */\nconst azureClientFeatureGates = {\n\t// Azure client requires a write connection by default\n\t\"Fluid.Container.ForceWriteConnection\": true,\n};\n\n/**\n * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,\n * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.\n * @public\n */\nexport class AzureClient {\n\tprivate readonly documentServiceFactory: IDocumentServiceFactory;\n\tprivate readonly urlResolver: IUrlResolver;\n\tprivate readonly configProvider: IConfigProviderBase | undefined;\n\n\t/**\n\t * Creates a new client instance using configuration parameters.\n\t * @param properties - Properties for initializing a new AzureClient instance\n\t */\n\tpublic constructor(private readonly properties: AzureClientProps) {\n\t\t// remove trailing slash from URL if any\n\t\tproperties.connection.endpoint = properties.connection.endpoint.replace(/\\/$/, \"\");\n\t\tthis.urlResolver = new AzureUrlResolver();\n\t\t// The local service implementation differs from the Azure Fluid Relay in blob\n\t\t// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.\n\t\tconst isRemoteConnection = isAzureRemoteConnectionConfig(this.properties.connection);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.properties.connection.tokenProvider, {\n\t\t\t\tenableWholeSummaryUpload: isRemoteConnection,\n\t\t\t\tenableDiscovery: isRemoteConnection,\n\t\t\t});\n\n\t\tthis.documentServiceFactory = applyStorageCompression(\n\t\t\torigDocumentServiceFactory,\n\t\t\tproperties.summaryCompression,\n\t\t);\n\t\tthis.configProvider = wrapConfigProviderWithDefaults(\n\t\t\tproperties.configProvider,\n\t\t\tazureClientFeatureGates,\n\t\t);\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 retrieve to be 5.\n\t * @returns Array of available container versions.\n\t */\n\tpublic async getContainerVersions(\n\t\tid: string,\n\t\toptions?: AzureGetVersionsOptions,\n\t): Promise<AzureContainerVersion[]> {\n\t\tconst url = new URL(this.properties.connection.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.properties.connection.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst resolvedUrl = await this.urlResolver.resolve({ url: url.href });\n\t\tif (!resolvedUrl) {\n\t\t\tthrow new Error(\"Unable to resolved URL\");\n\t\t}\n\t\tconst documentService =\n\t\t\tawait this.documentServiceFactory.createDocumentService(resolvedUrl);\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\t// External API uses null\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tconst versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);\n\n\t\treturn versions.map((item) => {\n\t\t\treturn { id: item.id, date: item.date };\n\t\t});\n\t}\n\n\tprivate getContainerServices(container: IContainer): AzureContainerServices {\n\t\treturn {\n\t\t\taudience: createServiceAudience({\n\t\t\t\tcontainer,\n\t\t\t\tcreateServiceMember: createAzureAudienceMember,\n\t\t\t}),\n\t\t};\n\t}\n\n\tprivate createLoader(schema: ContainerSchema): Loader {\n\t\tconst runtimeFactory = createDOProviderContainerRuntimeFactory({ schema });\n\t\tconst load = async (): Promise<IFluidModuleWithDetails> => {\n\t\t\treturn {\n\t\t\t\tmodule: { fluidExport: runtimeFactory },\n\t\t\t\tdetails: { package: \"no-dynamic-package\", config: {} },\n\t\t\t};\n\t\t};\n\n\t\tconst codeLoader = { load };\n\t\tconst client: IClient = {\n\t\t\tdetails: {\n\t\t\t\tcapabilities: { interactive: true },\n\t\t\t},\n\t\t\tpermission: [],\n\t\t\tscopes: [],\n\t\t\tuser: { id: \"\" },\n\t\t\tmode: \"write\",\n\t\t};\n\n\t\treturn new Loader({\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.properties.logger,\n\t\t\toptions: { client },\n\t\t\tconfigProvider: this.configProvider,\n\t\t});\n\t}\n\n\tprivate async createFluidContainer<TContainerSchema extends ContainerSchema>(\n\t\tcontainer: IContainer,\n\t\tconnection: AzureConnectionConfig,\n\t): Promise<IFluidContainer<TContainerSchema>> {\n\t\tconst createNewRequest = createAzureCreateNewRequest(\n\t\t\tconnection.endpoint,\n\t\t\tgetTenantId(connection),\n\t\t);\n\n\t\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\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
|
+
{"version":3,"file":"AzureClient.js","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,qEAAiF;AACjF,yDAA+D;AAC/D,+DAAsF;AAQtF,yCAA2D;AAE3D;;GAEG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,WAAW,GAAG,CAAC,oBAA2C,EAAU,EAAE;IAC3E,OAAO,IAAA,wCAA6B,EAAC,oBAAoB,CAAC;QACzD,CAAC,CAAC,oBAAoB,CAAC,QAAQ;QAC/B,CAAC,CAAC,oBAAoB,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;GAGG;AACH,MAAM,uBAAuB,GAAG;IAC/B,sDAAsD;IACtD,sCAAsC,EAAE,IAAI;CAC5C,CAAC;AAEF;;;;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,sCAAgB,EAAE,CAAC;QAC1C,8EAA8E;QAC9E,6FAA6F;QAC7F,MAAM,kBAAkB,GAAG,IAAA,wCAA6B,EAAC,IAAI,CAAC,UAAU,CAAC,UAAU,C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AC,CAAC;YACzC,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;aACpE;YACD,OAAO,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC;QACF,MAAM,cAAc,GAAG,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;AAtQD,kCAsQC","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 FluidObject, type IConfigProviderBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { wrapConfigProviderWithDefaults } from \"@fluidframework/telemetry-utils\";\nimport { createAzureAudienceMember } from \"./AzureAudience.js\";\nimport { AzureUrlResolver, createAzureCreateNewRequest } from \"./AzureUrlResolver.js\";\nimport {\n\ttype AzureClientProps,\n\ttype AzureConnectionConfig,\n\ttype AzureContainerServices,\n\ttype AzureContainerVersion,\n\ttype AzureGetVersionsOptions,\n} from \"./interfaces.js\";\nimport { isAzureRemoteConnectionConfig } from \"./utils.js\";\n\n/**\n * Strongly typed id for connecting to a local Azure Fluid Relay.\n */\nconst LOCAL_MODE_TENANT_ID = \"local\";\nconst getTenantId = (connectionProperties: AzureConnectionConfig): string => {\n\treturn isAzureRemoteConnectionConfig(connectionProperties)\n\t\t? connectionProperties.tenantId\n\t\t: LOCAL_MODE_TENANT_ID;\n};\n\nconst MAX_VERSION_COUNT = 5;\n\n/**\n * Default feature gates.\n * These values will only be used if the feature gate is not already set by the supplied config provider.\n */\nconst azureClientFeatureGates = {\n\t// Azure client requires a write connection by default\n\t\"Fluid.Container.ForceWriteConnection\": true,\n};\n\n/**\n * AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,\n * when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.\n * @public\n */\nexport class AzureClient {\n\tprivate readonly documentServiceFactory: IDocumentServiceFactory;\n\tprivate readonly urlResolver: IUrlResolver;\n\tprivate readonly configProvider: IConfigProviderBase | undefined;\n\n\t/**\n\t * Creates a new client instance using configuration parameters.\n\t * @param properties - Properties for initializing a new AzureClient instance\n\t */\n\tpublic constructor(private readonly properties: AzureClientProps) {\n\t\t// remove trailing slash from URL if any\n\t\tproperties.connection.endpoint = properties.connection.endpoint.replace(/\\/$/, \"\");\n\t\tthis.urlResolver = new AzureUrlResolver();\n\t\t// The local service implementation differs from the Azure Fluid Relay in blob\n\t\t// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.\n\t\tconst isRemoteConnection = isAzureRemoteConnectionConfig(this.properties.connection);\n\t\tconst origDocumentServiceFactory: IDocumentServiceFactory =\n\t\t\tnew RouterliciousDocumentServiceFactory(this.properties.connection.tokenProvider, {\n\t\t\t\tenableWholeSummaryUpload: isRemoteConnection,\n\t\t\t\tenableDiscovery: isRemoteConnection,\n\t\t\t});\n\n\t\tthis.documentServiceFactory = applyStorageCompression(\n\t\t\torigDocumentServiceFactory,\n\t\t\tproperties.summaryCompression,\n\t\t);\n\t\tthis.configProvider = wrapConfigProviderWithDefaults(\n\t\t\tproperties.configProvider,\n\t\t\tazureClientFeatureGates,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new detached container instance in the Azure Fluid Relay.\n\t * @typeparam TContainerSchema - Used to infer the the type of 'initialObjects' in the returned container.\n\t * (normally not explicitly specified.)\n\t * @param containerSchema - Container schema for the new container.\n\t * @returns New detached container instance along with associated services.\n\t */\n\tpublic async createContainer<const TContainerSchema extends ContainerSchema>(\n\t\tcontainerSchema: TContainerSchema,\n\t): Promise<{\n\t\tcontainer: IFluidContainer<TContainerSchema>;\n\t\tservices: AzureContainerServices;\n\t}> {\n\t\tconst loader = this.createLoader(containerSchema);\n\n\t\tconst container = await loader.createDetachedContainer({\n\t\t\tpackage: \"no-dynamic-package\",\n\t\t\tconfig: {},\n\t\t});\n\n\t\tconst fluidContainer = await this.createFluidContainer<TContainerSchema>(\n\t\t\tcontainer,\n\t\t\tthis.properties.connection,\n\t\t);\n\t\tconst services = this.getContainerServices(container);\n\t\treturn { container: fluidContainer, services };\n\t}\n\n\t/**\n\t * 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 retrieve to be 5.\n\t * @returns Array of available container versions.\n\t */\n\tpublic async getContainerVersions(\n\t\tid: string,\n\t\toptions?: AzureGetVersionsOptions,\n\t): Promise<AzureContainerVersion[]> {\n\t\tconst url = new URL(this.properties.connection.endpoint);\n\t\turl.searchParams.append(\"storage\", encodeURIComponent(this.properties.connection.endpoint));\n\t\turl.searchParams.append(\n\t\t\t\"tenantId\",\n\t\t\tencodeURIComponent(getTenantId(this.properties.connection)),\n\t\t);\n\t\turl.searchParams.append(\"containerId\", encodeURIComponent(id));\n\n\t\tconst resolvedUrl = await this.urlResolver.resolve({ url: url.href });\n\t\tif (!resolvedUrl) {\n\t\t\tthrow new Error(\"Unable to resolved URL\");\n\t\t}\n\t\tconst documentService =\n\t\t\tawait this.documentServiceFactory.createDocumentService(resolvedUrl);\n\t\tconst storage = await documentService.connectToStorage();\n\n\t\t// External API uses null\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tconst versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);\n\n\t\treturn versions.map((item) => {\n\t\t\treturn { id: item.id, date: item.date };\n\t\t});\n\t}\n\n\tprivate getContainerServices(container: IContainer): AzureContainerServices {\n\t\treturn {\n\t\t\taudience: createServiceAudience({\n\t\t\t\tcontainer,\n\t\t\t\tcreateServiceMember: createAzureAudienceMember,\n\t\t\t}),\n\t\t};\n\t}\n\n\tprivate createLoader(schema: ContainerSchema): Loader {\n\t\tconst runtimeFactory = createDOProviderContainerRuntimeFactory({ schema });\n\t\tconst load = async (): Promise<IFluidModuleWithDetails> => {\n\t\t\treturn {\n\t\t\t\tmodule: { fluidExport: runtimeFactory },\n\t\t\t\tdetails: { package: \"no-dynamic-package\", config: {} },\n\t\t\t};\n\t\t};\n\n\t\tconst codeLoader = { load };\n\t\tconst client: IClient = {\n\t\t\tdetails: {\n\t\t\t\tcapabilities: { interactive: true },\n\t\t\t},\n\t\t\tpermission: [],\n\t\t\tscopes: [],\n\t\t\tuser: { id: \"\" },\n\t\t\tmode: \"write\",\n\t\t};\n\n\t\treturn new Loader({\n\t\t\turlResolver: this.urlResolver,\n\t\t\tdocumentServiceFactory: this.documentServiceFactory,\n\t\t\tcodeLoader,\n\t\t\tlogger: this.properties.logger,\n\t\t\toptions: { client },\n\t\t\tconfigProvider: this.configProvider,\n\t\t});\n\t}\n\n\tprivate async createFluidContainer<TContainerSchema extends ContainerSchema>(\n\t\tcontainer: IContainer,\n\t\tconnection: AzureConnectionConfig,\n\t): Promise<IFluidContainer<TContainerSchema>> {\n\t\tconst createNewRequest = createAzureCreateNewRequest(\n\t\t\tconnection.endpoint,\n\t\t\tgetTenantId(connection),\n\t\t);\n\n\t\tconst rootDataObject = await this.getContainerEntryPoint(container);\n\n\t\t/**\n\t\t * See {@link FluidContainer.attach}\n\t\t */\n\t\tconst attach = async (): Promise<string> => {\n\t\t\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,5 +1,5 @@
|
|
|
1
1
|
import { type ITokenProvider, type ITokenResponse } from "@fluidframework/routerlicious-driver";
|
|
2
|
-
import { type AzureMember } from "./interfaces";
|
|
2
|
+
import { type AzureMember } from "./interfaces.js";
|
|
3
3
|
/**
|
|
4
4
|
* Token Provider implementation for connecting to an Azure Function endpoint for
|
|
5
5
|
* Azure Fluid Relay token resolution.
|
|
@@ -17,7 +17,7 @@ export declare class AzureFunctionTokenProvider implements ITokenProvider {
|
|
|
17
17
|
* @param azFunctionUrl - URL to Azure Function endpoint
|
|
18
18
|
* @param user - User object
|
|
19
19
|
*/
|
|
20
|
-
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "
|
|
20
|
+
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "additionalDetails" | "userId" | "userName"> | undefined);
|
|
21
21
|
fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
|
|
22
22
|
fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
|
|
23
23
|
private getToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureFunctionTokenProvider.d.ts","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEhG,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AzureFunctionTokenProvider.d.ts","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEhG,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,YAAW,cAAc;IAO/D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAPvB;;;;OAIG;gBAEe,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,iFAAgE;IAG1E,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMjF,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;YAM/E,QAAQ;CAYtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureFunctionTokenProvider.js","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":";;;;;;AAAA;;;GAGG;AACH,kDAA0B;AAM1B;;;;;;;;GAQG;AACH,MAAa,0BAA0B;IACtC;;;;OAIG;IACH,YACkB,aAAqB,EACrB,IAAqE;QADrE,kBAAa,GAAb,aAAa,CAAQ;QACrB,SAAI,GAAJ,IAAI,CAAiE;IACpF,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;QACnE,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAkB;QAClE,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,UAAmB;QAC3D,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE;YACpD,MAAM,EAAE;gBACP,QAAQ;gBACR,UAAU;gBACV,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM;gBACzB,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ;gBAC7B,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,iBAA4B;aAC1D;SACD,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAc,CAAC;IAChC,CAAC;CACD;AAnCD,gEAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport axios from \"axios\";\n\nimport { type ITokenProvider, type ITokenResponse } from \"@fluidframework/routerlicious-driver\";\n\nimport { type AzureMember } from \"./interfaces\";\n\n/**\n * Token Provider implementation for connecting to an Azure Function endpoint for\n * Azure Fluid Relay token resolution.\n *\n * @deprecated 1.2.0, This API will be removed in 2.0.0\n * No replacement since it is not expected anyone will use this token provider as is\n * See https://github.com/microsoft/FluidFramework/issues/13693 for context\n * @internal\n */\nexport class AzureFunctionTokenProvider implements ITokenProvider {\n\t/**\n\t * Creates a new instance using configuration parameters.\n\t * @param azFunctionUrl - URL to Azure Function endpoint\n\t * @param user - User object\n\t */\n\tpublic constructor(\n\t\tprivate readonly azFunctionUrl: string,\n\t\tprivate readonly user?: Pick<AzureMember, \"userId\" | \"userName\" | \"additionalDetails\">,\n\t) {}\n\n\tpublic async fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tpublic async fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tprivate async getToken(tenantId: string, documentId?: string): Promise<string> {\n\t\tconst response = await axios.get(this.azFunctionUrl, {\n\t\t\tparams: {\n\t\t\t\ttenantId,\n\t\t\t\tdocumentId,\n\t\t\t\tuserId: this.user?.userId,\n\t\t\t\tuserName: this.user?.userName,\n\t\t\t\tadditionalDetails: this.user?.additionalDetails as unknown,\n\t\t\t},\n\t\t});\n\t\treturn response.data as string;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AzureFunctionTokenProvider.js","sourceRoot":"","sources":["../src/AzureFunctionTokenProvider.ts"],"names":[],"mappings":";;;;;;AAAA;;;GAGG;AACH,kDAA0B;AAM1B;;;;;;;;GAQG;AACH,MAAa,0BAA0B;IACtC;;;;OAIG;IACH,YACkB,aAAqB,EACrB,IAAqE;QADrE,kBAAa,GAAb,aAAa,CAAQ;QACrB,SAAI,GAAJ,IAAI,CAAiE;IACpF,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;QACnE,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAkB;QAClE,OAAO;YACN,GAAG,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,UAAmB;QAC3D,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE;YACpD,MAAM,EAAE;gBACP,QAAQ;gBACR,UAAU;gBACV,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM;gBACzB,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ;gBAC7B,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,iBAA4B;aAC1D;SACD,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAc,CAAC;IAChC,CAAC;CACD;AAnCD,gEAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport axios from \"axios\";\n\nimport { type ITokenProvider, type ITokenResponse } from \"@fluidframework/routerlicious-driver\";\n\nimport { type AzureMember } from \"./interfaces.js\";\n\n/**\n * Token Provider implementation for connecting to an Azure Function endpoint for\n * Azure Fluid Relay token resolution.\n *\n * @deprecated 1.2.0, This API will be removed in 2.0.0\n * No replacement since it is not expected anyone will use this token provider as is\n * See https://github.com/microsoft/FluidFramework/issues/13693 for context\n * @internal\n */\nexport class AzureFunctionTokenProvider implements ITokenProvider {\n\t/**\n\t * Creates a new instance using configuration parameters.\n\t * @param azFunctionUrl - URL to Azure Function endpoint\n\t * @param user - User object\n\t */\n\tpublic constructor(\n\t\tprivate readonly azFunctionUrl: string,\n\t\tprivate readonly user?: Pick<AzureMember, \"userId\" | \"userName\" | \"additionalDetails\">,\n\t) {}\n\n\tpublic async fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tpublic async fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tjwt: await this.getToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tprivate async getToken(tenantId: string, documentId?: string): Promise<string> {\n\t\tconst response = await axios.get(this.azFunctionUrl, {\n\t\t\tparams: {\n\t\t\t\ttenantId,\n\t\t\t\tdocumentId,\n\t\t\t\tuserId: this.user?.userId,\n\t\t\t\tuserName: this.user?.userName,\n\t\t\t\tadditionalDetails: this.user?.additionalDetails as unknown,\n\t\t\t},\n\t\t});\n\t\treturn response.data as string;\n\t}\n}\n"]}
|
|
@@ -40,7 +40,7 @@ export declare class AzureClient {
|
|
|
40
40
|
* @param containerSchema - Container schema for the new container.
|
|
41
41
|
* @returns New detached container instance along with associated services.
|
|
42
42
|
*/
|
|
43
|
-
createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
43
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
44
44
|
container: IFluidContainer<TContainerSchema>;
|
|
45
45
|
services: AzureContainerServices;
|
|
46
46
|
}>;
|
|
@@ -195,7 +195,7 @@ export declare interface AzureLocalConnectionConfig extends AzureConnectionConfi
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Since Azure provides user names for all of its members, we extend the
|
|
198
|
-
* {@link @fluidframework/
|
|
198
|
+
* {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.
|
|
199
199
|
* It will be returned for all audience members connected to Azure.
|
|
200
200
|
*
|
|
201
201
|
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
|
@@ -40,7 +40,7 @@ export declare class AzureClient {
|
|
|
40
40
|
* @param containerSchema - Container schema for the new container.
|
|
41
41
|
* @returns New detached container instance along with associated services.
|
|
42
42
|
*/
|
|
43
|
-
createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
43
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
44
44
|
container: IFluidContainer<TContainerSchema>;
|
|
45
45
|
services: AzureContainerServices;
|
|
46
46
|
}>;
|
|
@@ -195,7 +195,7 @@ export declare interface AzureLocalConnectionConfig extends AzureConnectionConfi
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Since Azure provides user names for all of its members, we extend the
|
|
198
|
-
* {@link @fluidframework/
|
|
198
|
+
* {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.
|
|
199
199
|
* It will be returned for all audience members connected to Azure.
|
|
200
200
|
*
|
|
201
201
|
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
|
@@ -40,7 +40,7 @@ export declare class AzureClient {
|
|
|
40
40
|
* @param containerSchema - Container schema for the new container.
|
|
41
41
|
* @returns New detached container instance along with associated services.
|
|
42
42
|
*/
|
|
43
|
-
createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
43
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
44
44
|
container: IFluidContainer<TContainerSchema>;
|
|
45
45
|
services: AzureContainerServices;
|
|
46
46
|
}>;
|
|
@@ -195,7 +195,7 @@ export declare interface AzureLocalConnectionConfig extends AzureConnectionConfi
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Since Azure provides user names for all of its members, we extend the
|
|
198
|
-
* {@link @fluidframework/
|
|
198
|
+
* {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.
|
|
199
199
|
* It will be returned for all audience members connected to Azure.
|
|
200
200
|
*
|
|
201
201
|
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
|
@@ -40,7 +40,7 @@ export declare class AzureClient {
|
|
|
40
40
|
* @param containerSchema - Container schema for the new container.
|
|
41
41
|
* @returns New detached container instance along with associated services.
|
|
42
42
|
*/
|
|
43
|
-
createContainer<TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
43
|
+
createContainer<const TContainerSchema extends ContainerSchema>(containerSchema: TContainerSchema): Promise<{
|
|
44
44
|
container: IFluidContainer<TContainerSchema>;
|
|
45
45
|
services: AzureContainerServices;
|
|
46
46
|
}>;
|
|
@@ -186,7 +186,7 @@ export declare class AzureFunctionTokenProvider implements ITokenProvider {
|
|
|
186
186
|
* @param azFunctionUrl - URL to Azure Function endpoint
|
|
187
187
|
* @param user - User object
|
|
188
188
|
*/
|
|
189
|
-
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "
|
|
189
|
+
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "additionalDetails" | "userId" | "userName"> | undefined);
|
|
190
190
|
fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
|
|
191
191
|
fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
|
|
192
192
|
private getToken;
|
|
@@ -216,7 +216,7 @@ export declare interface AzureLocalConnectionConfig extends AzureConnectionConfi
|
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* Since Azure provides user names for all of its members, we extend the
|
|
219
|
-
* {@link @fluidframework/
|
|
219
|
+
* {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.
|
|
220
220
|
* It will be returned for all audience members connected to Azure.
|
|
221
221
|
*
|
|
222
222
|
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export { AzureClient } from "./AzureClient";
|
|
11
|
-
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider";
|
|
12
|
-
export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces";
|
|
10
|
+
export { AzureClient } from "./AzureClient.js";
|
|
11
|
+
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider.js";
|
|
12
|
+
export type { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, } from "./interfaces.js";
|
|
13
13
|
export type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
|
|
14
14
|
export type { ITokenClaims, IUser } from "@fluidframework/protocol-definitions";
|
|
15
15
|
export { ScopeType } from "@fluidframework/protocol-definitions";
|
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,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,YAAY,EACX,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,cAAc,GACd,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3F,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,10 +10,10 @@ exports.ScopeType = exports.AzureFunctionTokenProvider = exports.AzureClient = v
|
|
|
10
10
|
*
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "AzureClient", { enumerable: true, get: function () { return
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(exports, "AzureFunctionTokenProvider", { enumerable: true, get: function () { return
|
|
13
|
+
var AzureClient_js_1 = require("./AzureClient.js");
|
|
14
|
+
Object.defineProperty(exports, "AzureClient", { enumerable: true, get: function () { return AzureClient_js_1.AzureClient; } });
|
|
15
|
+
var AzureFunctionTokenProvider_js_1 = require("./AzureFunctionTokenProvider.js");
|
|
16
|
+
Object.defineProperty(exports, "AzureFunctionTokenProvider", { enumerable: true, get: function () { return AzureFunctionTokenProvider_js_1.AzureFunctionTokenProvider; } });
|
|
17
17
|
var protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
18
18
|
Object.defineProperty(exports, "ScopeType", { enumerable: true, get: function () { return protocol_definitions_1.ScopeType; } });
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AAiBnC,6EAAiE;AAAxD,iHAAA,SAAS,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A simple and powerful way to consume collaborative Fluid data with the Azure Fluid Relay.\n *\n * @packageDocumentation\n */\n\nexport { AzureClient } from \"./AzureClient.js\";\nexport { AzureFunctionTokenProvider } from \"./AzureFunctionTokenProvider.js\";\nexport type {\n\tAzureClientProps,\n\tAzureConnectionConfig,\n\tAzureConnectionConfigType,\n\tAzureContainerServices,\n\tAzureContainerVersion,\n\tAzureGetVersionsOptions,\n\tAzureLocalConnectionConfig,\n\tAzureMember,\n\tAzureRemoteConnectionConfig,\n\tAzureUser,\n\tIAzureAudience,\n} from \"./interfaces.js\";\n\nexport type { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nexport type { ITokenClaims, IUser } from \"@fluidframework/protocol-definitions\";\nexport { ScopeType } from \"@fluidframework/protocol-definitions\";\n\n// Re-export so developers can build loggers without pulling in core-interfaces\nexport type { ITelemetryBaseEvent, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\n"]}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -142,7 +142,7 @@ export interface AzureUser<T = any> extends IUser {
|
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Since Azure provides user names for all of its members, we extend the
|
|
145
|
-
* {@link @fluidframework/
|
|
145
|
+
* {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.
|
|
146
146
|
* It will be returned for all audience members connected to Azure.
|
|
147
147
|
*
|
|
148
148
|
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
package/dist/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\ttype IConfigProviderBase,\n\ttype ITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { type IMember, type IServiceAudience } from \"@fluidframework/fluid-static\";\nimport { type IUser } from \"@fluidframework/protocol-definitions\";\nimport { type ITokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { type ICompressionStorageConfig } from \"@fluidframework/driver-utils\";\n\n/**\n * Props for initializing a new AzureClient instance\n * @public\n */\nexport interface AzureClientProps {\n\t/**\n\t * Configuration for establishing a connection with the Azure Fluid Relay.\n\t */\n\treadonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n\n\treadonly summaryCompression?: boolean | ICompressionStorageConfig;\n}\n\n/**\n * Container version metadata.\n * @public\n */\nexport interface AzureContainerVersion {\n\t/**\n\t * Version ID\n\t */\n\tid: string;\n\n\t/**\n\t * Time when version was generated.\n\t * ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ\n\t */\n\tdate?: string;\n}\n\n/**\n * Options for \"Get Container Versions\" API.\n * @public\n */\nexport interface AzureGetVersionsOptions {\n\t/**\n\t * Max number of versions\n\t */\n\tmaxCount: number;\n}\n\n/**\n * The type of connection.\n *\n * - \"local\" for local connections to a Fluid relay instance running on the localhost\n *\n * - \"remote\" for client connections to the Azure Fluid Relay service\n * @public\n */\nexport type AzureConnectionConfigType = \"local\" | \"remote\";\n\n/**\n * Parameters for establishing a connection with the Azure Fluid Relay.\n * @public\n */\nexport interface AzureConnectionConfig {\n\t/**\n\t * The type of connection. Whether we're connecting to a remote Fluid relay server or a local instance.\n\t */\n\ttype: AzureConnectionConfigType;\n\t/**\n\t * URI to the Azure Fluid Relay service discovery endpoint.\n\t */\n\tendpoint: string;\n\t/**\n\t * Instance that provides Azure Fluid Relay endpoint tokens.\n\t */\n\ttokenProvider: ITokenProvider;\n}\n\n/**\n * Parameters for establishing a remote connection with the Azure Fluid Relay.\n * @public\n */\nexport interface AzureRemoteConnectionConfig extends AzureConnectionConfig {\n\t/**\n\t * The type of connection. Set to a remote connection.\n\t */\n\ttype: \"remote\";\n\t/**\n\t * Unique tenant identifier.\n\t */\n\ttenantId: string;\n}\n\n/**\n * Parameters for establishing a local connection with a local instance of the Azure Fluid Relay.\n * @public\n */\nexport interface AzureLocalConnectionConfig extends AzureConnectionConfig {\n\t/**\n\t * The type of connection. Set to a remote connection.\n\t */\n\ttype: \"local\";\n}\n\n/**\n * Holds the functionality specifically tied to the Azure Fluid Relay, and how the data stored in\n * the FluidContainer is persisted in the backend and consumed by users.\n *\n * @remarks\n *\n * Returned by the {@link AzureClient} alongside a {@link @fluidframework/fluid-static#FluidContainer}.\n *\n * Any functionality regarding how the data is handled within the FluidContainer itself, i.e. which data objects\n * or DDSes to use, will not be included here but rather on the FluidContainer class itself.\n * @public\n */\nexport interface AzureContainerServices {\n\t/**\n\t * Provides an object that can be used to get the users that are present in this Fluid session and\n\t * listeners for when the roster has any changes from users joining/leaving the session\n\t */\n\taudience: IAzureAudience;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/protocol-definitions#IUser} interface to include this service-specific value.\n *\n * @typeParam T - See {@link AzureUser.additionalDetails}.\n * Note: must be JSON-serializable.\n * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.\n * @internal\n */\n// TODO: this should be updated to use something other than `any` (unknown)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AzureUser<T = any> extends IUser {\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\n\t/**\n\t * Custom, app-specific user information\n\t */\n\tadditionalDetails?: T;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\ttype IConfigProviderBase,\n\ttype ITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { type IMember, type IServiceAudience } from \"@fluidframework/fluid-static\";\nimport { type IUser } from \"@fluidframework/protocol-definitions\";\nimport { type ITokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { type ICompressionStorageConfig } from \"@fluidframework/driver-utils\";\n\n/**\n * Props for initializing a new AzureClient instance\n * @public\n */\nexport interface AzureClientProps {\n\t/**\n\t * Configuration for establishing a connection with the Azure Fluid Relay.\n\t */\n\treadonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n\n\treadonly summaryCompression?: boolean | ICompressionStorageConfig;\n}\n\n/**\n * Container version metadata.\n * @public\n */\nexport interface AzureContainerVersion {\n\t/**\n\t * Version ID\n\t */\n\tid: string;\n\n\t/**\n\t * Time when version was generated.\n\t * ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ\n\t */\n\tdate?: string;\n}\n\n/**\n * Options for \"Get Container Versions\" API.\n * @public\n */\nexport interface AzureGetVersionsOptions {\n\t/**\n\t * Max number of versions\n\t */\n\tmaxCount: number;\n}\n\n/**\n * The type of connection.\n *\n * - \"local\" for local connections to a Fluid relay instance running on the localhost\n *\n * - \"remote\" for client connections to the Azure Fluid Relay service\n * @public\n */\nexport type AzureConnectionConfigType = \"local\" | \"remote\";\n\n/**\n * Parameters for establishing a connection with the Azure Fluid Relay.\n * @public\n */\nexport interface AzureConnectionConfig {\n\t/**\n\t * The type of connection. Whether we're connecting to a remote Fluid relay server or a local instance.\n\t */\n\ttype: AzureConnectionConfigType;\n\t/**\n\t * URI to the Azure Fluid Relay service discovery endpoint.\n\t */\n\tendpoint: string;\n\t/**\n\t * Instance that provides Azure Fluid Relay endpoint tokens.\n\t */\n\ttokenProvider: ITokenProvider;\n}\n\n/**\n * Parameters for establishing a remote connection with the Azure Fluid Relay.\n * @public\n */\nexport interface AzureRemoteConnectionConfig extends AzureConnectionConfig {\n\t/**\n\t * The type of connection. Set to a remote connection.\n\t */\n\ttype: \"remote\";\n\t/**\n\t * Unique tenant identifier.\n\t */\n\ttenantId: string;\n}\n\n/**\n * Parameters for establishing a local connection with a local instance of the Azure Fluid Relay.\n * @public\n */\nexport interface AzureLocalConnectionConfig extends AzureConnectionConfig {\n\t/**\n\t * The type of connection. Set to a remote connection.\n\t */\n\ttype: \"local\";\n}\n\n/**\n * Holds the functionality specifically tied to the Azure Fluid Relay, and how the data stored in\n * the FluidContainer is persisted in the backend and consumed by users.\n *\n * @remarks\n *\n * Returned by the {@link AzureClient} alongside a {@link @fluidframework/fluid-static#FluidContainer}.\n *\n * Any functionality regarding how the data is handled within the FluidContainer itself, i.e. which data objects\n * or DDSes to use, will not be included here but rather on the FluidContainer class itself.\n * @public\n */\nexport interface AzureContainerServices {\n\t/**\n\t * Provides an object that can be used to get the users that are present in this Fluid session and\n\t * listeners for when the roster has any changes from users joining/leaving the session\n\t */\n\taudience: IAzureAudience;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/protocol-definitions#IUser} interface to include this service-specific value.\n *\n * @typeParam T - See {@link AzureUser.additionalDetails}.\n * Note: must be JSON-serializable.\n * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.\n * @internal\n */\n// TODO: this should be updated to use something other than `any` (unknown)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AzureUser<T = any> extends IUser {\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\n\t/**\n\t * Custom, app-specific user information\n\t */\n\tadditionalDetails?: T;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.\n * It will be returned for all audience members connected to Azure.\n *\n * @typeParam T - See {@link AzureMember.additionalDetails}.\n * Note: must be JSON-serializable.\n * Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.\n * @public\n */\n// TODO: this should be updated to use something other than `any` (unknown)\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AzureMember<T = any> extends IMember {\n\t/**\n\t * {@inheritDoc AzureUser.name}\n\t */\n\tuserName: string;\n\n\t/**\n\t * {@inheritDoc AzureUser.additionalDetails}\n\t */\n\tadditionalDetails?: T;\n}\n\n/**\n * Audience object for Azure Fluid Relay containers\n * @public\n */\nexport type IAzureAudience = IServiceAudience<AzureMember>;\n"]}
|
package/dist/tsdoc-metadata.json
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { AzureConnectionConfig, AzureLocalConnectionConfig, AzureRemoteConnectionConfig } from "./interfaces";
|
|
5
|
+
import type { AzureConnectionConfig, AzureLocalConnectionConfig, AzureRemoteConnectionConfig } from "./interfaces.js";
|
|
6
6
|
/**
|
|
7
7
|
* Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)
|
|
8
8
|
*/
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,wBAAgB,6BAA6B,CAC5C,gBAAgB,EAAE,qBAAqB,GACrC,gBAAgB,IAAI,2BAA2B,CAEjD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC3C,gBAAgB,EAAE,qBAAqB,GACrC,gBAAgB,IAAI,0BAA0B,CAEhD"}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAUA;;GAEG;AACH,SAAgB,6BAA6B,CAC5C,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3C,CAAC;AAJD,sEAIC;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,OAAO,CAAC;AAC1C,CAAC;AAJD,oEAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport type {\n\tAzureConnectionConfig,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces\";\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)\n */\nexport function isAzureRemoteConnectionConfig(\n\tconnectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureRemoteConnectionConfig {\n\treturn connectionConfig.type === \"remote\";\n}\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a local connection type (AzureLocalConnectionConfig)\n */\nexport function isAzureLocalConnectionConfig(\n\tconnectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureLocalConnectionConfig {\n\treturn connectionConfig.type === \"local\";\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAUA;;GAEG;AACH,SAAgB,6BAA6B,CAC5C,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3C,CAAC;AAJD,sEAIC;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,OAAO,CAAC;AAC1C,CAAC;AAJD,oEAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport type {\n\tAzureConnectionConfig,\n\tAzureLocalConnectionConfig,\n\tAzureRemoteConnectionConfig,\n} from \"./interfaces.js\";\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)\n */\nexport function isAzureRemoteConnectionConfig(\n\tconnectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureRemoteConnectionConfig {\n\treturn connectionConfig.type === \"remote\";\n}\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a local connection type (AzureLocalConnectionConfig)\n */\nexport function isAzureLocalConnectionConfig(\n\tconnectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureLocalConnectionConfig {\n\treturn connectionConfig.type === \"local\";\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type IClient } from "@fluidframework/protocol-definitions";
|
|
6
|
+
import { type AzureMember } from "./interfaces.js";
|
|
7
|
+
/**
|
|
8
|
+
* Creates Azure-specific audience member.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The provided `audienceMember`'s {@link @fluidframework/protocol-definitions#IClient.user} must be an {@link AzureUser}.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createAzureAudienceMember(audienceMember: IClient): AzureMember;
|
|
14
|
+
//# sourceMappingURL=AzureAudience.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureAudience.d.ts","sourceRoot":"","sources":["../src/AzureAudience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAU9E"}
|