@fluidframework/azure-client 1.1.0-74609 → 1.2.0-106934
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/.eslintrc.js +37 -7
- package/CHANGELOG.md +1 -2
- package/README.md +12 -10
- package/api-extractor.json +1 -1
- package/dist/AzureAudience.d.ts +12 -5
- package/dist/AzureAudience.d.ts.map +1 -1
- package/dist/AzureAudience.js +18 -4
- package/dist/AzureAudience.js.map +1 -1
- package/dist/AzureClient.d.ts.map +1 -1
- package/dist/AzureClient.js +35 -17
- package/dist/AzureClient.js.map +1 -1
- package/dist/AzureFunctionTokenProvider.d.ts +0 -4
- package/dist/AzureFunctionTokenProvider.d.ts.map +1 -1
- package/dist/AzureFunctionTokenProvider.js +4 -4
- package/dist/AzureFunctionTokenProvider.js.map +1 -1
- package/dist/AzureUrlResolver.d.ts +7 -0
- package/dist/AzureUrlResolver.d.ts.map +1 -1
- package/dist/AzureUrlResolver.js +11 -13
- package/dist/AzureUrlResolver.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -15
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +34 -4
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js +0 -4
- package/dist/interfaces.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +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 +12 -5
- package/lib/AzureAudience.d.ts.map +1 -1
- package/lib/AzureAudience.js +16 -2
- package/lib/AzureAudience.js.map +1 -1
- package/lib/AzureClient.d.ts.map +1 -1
- package/lib/AzureClient.js +37 -19
- package/lib/AzureClient.js.map +1 -1
- package/lib/AzureFunctionTokenProvider.d.ts +0 -4
- package/lib/AzureFunctionTokenProvider.d.ts.map +1 -1
- package/lib/AzureFunctionTokenProvider.js.map +1 -1
- package/lib/AzureUrlResolver.d.ts +7 -0
- package/lib/AzureUrlResolver.d.ts.map +1 -1
- package/lib/AzureUrlResolver.js +11 -13
- package/lib/AzureUrlResolver.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -4
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +34 -4
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js +0 -4
- package/lib/interfaces.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +40 -28
- package/src/AzureAudience.ts +28 -13
- package/src/AzureClient.ts +57 -72
- package/src/AzureFunctionTokenProvider.ts +4 -3
- package/src/AzureUrlResolver.ts +15 -24
- package/src/index.ts +19 -5
- package/src/interfaces.ts +42 -12
- package/src/packageVersion.ts +1 -1
- package/src/utils.ts +9 -3
- package/tsconfig.esnext.json +5 -5
- package/tsconfig.json +9 -15
package/lib/index.d.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
10
|
+
export { AzureAudience } from "./AzureAudience";
|
|
11
|
+
export { AzureClient } from "./AzureClient";
|
|
12
|
+
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider";
|
|
13
|
+
export { AzureClientProps, AzureConnectionConfig, AzureConnectionConfigType, AzureContainerServices, AzureContainerVersion, AzureGetVersionsOptions, AzureLocalConnectionConfig, AzureMember, AzureRemoteConnectionConfig, AzureUser, IAzureAudience, ITelemetryBaseEvent, ITelemetryBaseLogger, } from "./interfaces";
|
|
14
14
|
export { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
|
|
15
|
-
export {
|
|
15
|
+
export { ITokenClaims, IUser, ScopeType } from "@fluidframework/protocol-definitions";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
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;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,WAAW,EACX,2BAA2B,EAC3B,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export * from "./interfaces";
|
|
10
|
+
export { AzureAudience } from "./AzureAudience";
|
|
11
|
+
export { AzureClient } from "./AzureClient";
|
|
12
|
+
export { AzureFunctionTokenProvider } from "./AzureFunctionTokenProvider";
|
|
14
13
|
export { ScopeType } from "@fluidframework/protocol-definitions";
|
|
15
14
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAkB1E,OAAO,EAAuB,SAAS,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A simple and powerful way to consume collaborative Fluid data with the Azure Fluid Relay.\n *\n * @packageDocumentation\n */\n\nexport { AzureAudience } from \"./AzureAudience\";\nexport { AzureClient } from \"./AzureClient\";\nexport { AzureFunctionTokenProvider } from \"./AzureFunctionTokenProvider\";\nexport {\n AzureClientProps,\n AzureConnectionConfig,\n AzureConnectionConfigType,\n AzureContainerServices,\n AzureContainerVersion,\n AzureGetVersionsOptions,\n AzureLocalConnectionConfig,\n AzureMember,\n AzureRemoteConnectionConfig,\n AzureUser,\n IAzureAudience,\n ITelemetryBaseEvent,\n ITelemetryBaseLogger,\n} from \"./interfaces\";\n\nexport { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nexport { ITokenClaims, IUser, ScopeType } from \"@fluidframework/protocol-definitions\";\n"]}
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
6
6
|
import { IMember, IServiceAudience } from "@fluidframework/fluid-static";
|
|
7
|
+
import { IUser } from "@fluidframework/protocol-definitions";
|
|
7
8
|
import { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
8
|
-
export { ITelemetryBaseEvent, ITelemetryBaseLogger
|
|
9
|
+
export { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
9
10
|
/**
|
|
10
11
|
* Props for initializing a new AzureClient instance
|
|
11
12
|
*/
|
|
@@ -13,7 +14,7 @@ export interface AzureClientProps {
|
|
|
13
14
|
/**
|
|
14
15
|
* Configuration for establishing a connection with the Azure Fluid Relay.
|
|
15
16
|
*/
|
|
16
|
-
readonly connection:
|
|
17
|
+
readonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;
|
|
17
18
|
/**
|
|
18
19
|
* Optional. A logger instance to receive diagnostic messages.
|
|
19
20
|
*/
|
|
@@ -102,11 +103,40 @@ export interface AzureContainerServices {
|
|
|
102
103
|
audience: IAzureAudience;
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
105
|
-
* Since Azure provides user names for all of its members, we extend the
|
|
106
|
-
* this service-specific value.
|
|
106
|
+
* Since Azure provides user names for all of its members, we extend the
|
|
107
|
+
* {@link @fluidframework/protocol-definitions#IUser} interface to include this service-specific value. *
|
|
108
|
+
*
|
|
109
|
+
* @typeParam T - See {@link AzureUser.additionalDetails}.
|
|
110
|
+
* Note: must be JSON-serializable.
|
|
111
|
+
* Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
|
|
112
|
+
*/
|
|
113
|
+
export interface AzureUser<T = any> extends IUser {
|
|
114
|
+
/**
|
|
115
|
+
* The user's name
|
|
116
|
+
*/
|
|
117
|
+
name: string;
|
|
118
|
+
/**
|
|
119
|
+
* Custom, app-specific user information
|
|
120
|
+
*/
|
|
121
|
+
additionalDetails?: T;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Since Azure provides user names for all of its members, we extend the
|
|
125
|
+
* {@link @fluidframework/protocol-definitions#IMember} interface to include this service-specific value.
|
|
126
|
+
* It will be returned for all audience members connected to Azure.
|
|
127
|
+
*
|
|
128
|
+
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
|
129
|
+
* Note: must be JSON-serializable.
|
|
130
|
+
* Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
|
|
107
131
|
*/
|
|
108
132
|
export interface AzureMember<T = any> extends IMember {
|
|
133
|
+
/**
|
|
134
|
+
* {@inheritDoc AzureUser.name}
|
|
135
|
+
*/
|
|
109
136
|
userName: string;
|
|
137
|
+
/**
|
|
138
|
+
* {@inheritDoc AzureUser.additionalDetails}
|
|
139
|
+
*/
|
|
110
140
|
additionalDetails?: T;
|
|
111
141
|
}
|
|
112
142
|
/**
|
package/lib/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,GAAG,0BAA0B,CAAC;IAC9E;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,oBAAY,yBAAyB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,yBAAyB,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,cAAc,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACtE;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACrE;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;OAGG;IACH,QAAQ,EAAE,cAAc,CAAC;CAC5B;AAED;;;;;;;GAOG;AAGH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,KAAK;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC;CACzB;AAED;;;;;;;;GAQG;AAGH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,OAAO;IACjD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC"}
|
package/lib/interfaces.js
CHANGED
package/lib/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"
|
|
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 { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { IMember, IServiceAudience } from \"@fluidframework/fluid-static\";\nimport { IUser } from \"@fluidframework/protocol-definitions\";\nimport { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\n\n// Re-export so developers can build loggers without pulling in common-definitions\nexport { ITelemetryBaseEvent, ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\n\n/**\n * Props for initializing a new AzureClient instance\n */\nexport interface AzureClientProps {\n /**\n * Configuration for establishing a connection with the Azure Fluid Relay.\n */\n readonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;\n /**\n * Optional. A logger instance to receive diagnostic messages.\n */\n readonly logger?: ITelemetryBaseLogger;\n}\n\n/**\n * Container version metadata.\n */\nexport interface AzureContainerVersion {\n /**\n * Version ID\n */\n id: string;\n\n /**\n * Time when version was generated.\n * ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ\n */\n date?: string;\n}\n\n/**\n * Options for \"Get Container Versions\" API.\n */\nexport interface AzureGetVersionsOptions {\n /**\n * Max number of versions\n */\n maxCount: number;\n}\n\n/**\n * The type of connection.\n * - \"local\" for local connections to a Fluid relay instance running on the localhost\n * - \"remote\" for client connections to the Azure Fluid Relay service\n */\nexport type AzureConnectionConfigType = \"local\" | \"remote\";\n\n/**\n * Parameters for establishing a connection with the Azure Fluid Relay.\n */\nexport interface AzureConnectionConfig {\n /**\n * The type of connection. Whether we're connecting to a remote Fluid relay server or a local instance.\n */\n type: AzureConnectionConfigType;\n /**\n * URI to the Azure Fluid Relay service discovery endpoint.\n */\n endpoint: string;\n /**\n * Instance that provides Azure Fluid Relay endpoint tokens.\n */\n tokenProvider: ITokenProvider;\n}\n\n/**\n * Parameters for establishing a remote connection with the Azure Fluid Relay.\n */\nexport interface AzureRemoteConnectionConfig extends AzureConnectionConfig {\n /**\n * The type of connection. Set to a remote connection.\n */\n type: \"remote\";\n /**\n * Unique tenant identifier.\n */\n tenantId: string;\n}\n\n/**\n * Parameters for establishing a local connection with a local instance of the Azure Fluid Relay.\n */\nexport interface AzureLocalConnectionConfig extends AzureConnectionConfig {\n /**\n * The type of connection. Set to a remote connection.\n */\n type: \"local\";\n}\n\n/**\n * AzureContainerServices is returned by the AzureClient alongside a FluidContainer.\n * It 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. Any functionality regarding\n * how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to use,\n * will not be included here but rather on the FluidContainer class itself.\n */\nexport interface AzureContainerServices {\n /**\n * Provides an object that can be used to get the users that are present in this Fluid session and\n * listeners for when the roster has any changes from users joining/leaving the session\n */\n audience: 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 */\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 /**\n * The user's name\n */\n name: string;\n\n /**\n * Custom, app-specific user information\n */\n additionalDetails?: T;\n}\n\n/**\n * Since Azure provides user names for all of its members, we extend the\n * {@link @fluidframework/protocol-definitions#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 */\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 /**\n * {@inheritDoc AzureUser.name}\n */\n userName: string;\n\n /**\n * {@inheritDoc AzureUser.additionalDetails}\n */\n additionalDetails?: T;\n}\n\n/**\n * Audience object for Azure Fluid Relay containers\n */\nexport type IAzureAudience = IServiceAudience<AzureMember>;\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/azure-client";
|
|
8
|
-
export declare const pkgVersion = "1.
|
|
8
|
+
export declare const pkgVersion = "1.2.0-106934";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,iCAAiC,CAAC;AACtD,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/azure-client\";\nexport const pkgVersion = \"1.2.0-106934\";\n"]}
|
package/lib/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 {
|
|
5
|
+
import { AzureConnectionConfig, AzureLocalConnectionConfig, AzureRemoteConnectionConfig } from "./interfaces";
|
|
6
6
|
/**
|
|
7
7
|
* Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)
|
|
8
8
|
*/
|
package/lib/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,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC9B,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,wBAAgB,6BAA6B,CACzC,gBAAgB,EAAE,qBAAqB,GACxC,gBAAgB,IAAI,2BAA2B,CAEjD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CACxC,gBAAgB,EAAE,qBAAqB,GACxC,gBAAgB,IAAI,0BAA0B,CAEhD"}
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,UAAU,6BAA6B,CACzC,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CACxC,gBAAuC;IAEvC,OAAO,gBAAgB,CAAC,IAAI,KAAK,OAAO,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n AzureConnectionConfig,\n AzureLocalConnectionConfig,\n AzureRemoteConnectionConfig,\n} from \"./interfaces\";\n\n/**\n * Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)\n */\nexport function isAzureRemoteConnectionConfig(\n connectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureRemoteConnectionConfig {\n return 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 connectionConfig: AzureConnectionConfig,\n): connectionConfig is AzureLocalConnectionConfig {\n return connectionConfig.type === \"local\";\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/azure-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-106934",
|
|
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": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/microsoft/FluidFramework.git",
|
|
9
|
-
"directory": "packages/
|
|
9
|
+
"directory": "azure/packages/azure-client"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "Microsoft and contributors",
|
|
@@ -28,14 +28,16 @@
|
|
|
28
28
|
"clean": "rimraf dist *.tsbuildinfo *.build.log",
|
|
29
29
|
"eslint": "eslint --format stylish src",
|
|
30
30
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
31
|
-
"
|
|
32
|
-
"lint
|
|
31
|
+
"format": "npm run prettier:fix",
|
|
32
|
+
"lint": "npm run prettier && npm run eslint",
|
|
33
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
33
34
|
"postpack": "cd dist && tar -cvf ../azure-client.test-files.tar ./test",
|
|
35
|
+
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
36
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
34
37
|
"start:tinylicious:test": "npx @fluidframework/azure-local-service > tinylicious.log 2>&1",
|
|
35
38
|
"test:realsvc": "npm run test:realsvc:tinylicious",
|
|
36
|
-
"test:realsvc:
|
|
37
|
-
"test:realsvc:
|
|
38
|
-
"test:realsvc:tinylicious": "start-server-and-test start:tinylicious:test 7070 test:realsvc:azure:run",
|
|
39
|
+
"test:realsvc:local:run": "mocha --unhandled-rejections=strict --recursive dist/test/**/*.spec.js --exit --timeout 10000",
|
|
40
|
+
"test:realsvc:tinylicious": "start-server-and-test start:tinylicious:test 7070 test:realsvc:local:run",
|
|
39
41
|
"tsc": "tsc",
|
|
40
42
|
"tsfmt": "tsfmt --verify",
|
|
41
43
|
"tsfmt:fix": "tsfmt --replace",
|
|
@@ -43,45 +45,55 @@
|
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
46
|
-
"@fluidframework/
|
|
47
|
-
"@fluidframework/container-
|
|
48
|
-
"@fluidframework/
|
|
49
|
-
"@fluidframework/
|
|
50
|
-
"@fluidframework/driver-
|
|
51
|
-
"@fluidframework/
|
|
52
|
-
"@fluidframework/
|
|
53
|
-
"@fluidframework/
|
|
54
|
-
"@fluidframework/
|
|
55
|
-
"@fluidframework/
|
|
56
|
-
"@fluidframework/
|
|
57
|
-
"
|
|
48
|
+
"@fluidframework/common-utils": "^1.0.0",
|
|
49
|
+
"@fluidframework/container-definitions": "^1.3.0",
|
|
50
|
+
"@fluidframework/container-loader": "^1.3.0",
|
|
51
|
+
"@fluidframework/core-interfaces": "^1.3.0",
|
|
52
|
+
"@fluidframework/driver-definitions": "^1.3.0",
|
|
53
|
+
"@fluidframework/driver-utils": "^1.3.0",
|
|
54
|
+
"@fluidframework/fluid-static": "^1.3.0",
|
|
55
|
+
"@fluidframework/map": "^1.3.0",
|
|
56
|
+
"@fluidframework/protocol-definitions": "^1.0.0",
|
|
57
|
+
"@fluidframework/routerlicious-driver": "^1.3.0",
|
|
58
|
+
"@fluidframework/runtime-utils": "^1.3.0",
|
|
59
|
+
"@fluidframework/server-services-client": "^0.1036.5000",
|
|
60
|
+
"axios": "^0.21.2",
|
|
58
61
|
"uuid": "^8.3.1"
|
|
59
62
|
},
|
|
60
63
|
"devDependencies": {
|
|
61
|
-
"@fluidframework/aqueduct": "^1.0
|
|
64
|
+
"@fluidframework/aqueduct": "^1.3.0",
|
|
62
65
|
"@fluidframework/azure-client-previous": "npm:@fluidframework/azure-client@1.0.0-73930",
|
|
63
|
-
"@fluidframework/azure-local-service": "
|
|
64
|
-
"@fluidframework/build-common": "^
|
|
65
|
-
"@fluidframework/build-tools": "^0.
|
|
66
|
-
"@fluidframework/
|
|
67
|
-
"@fluidframework/
|
|
66
|
+
"@fluidframework/azure-local-service": "1.2.0-106934",
|
|
67
|
+
"@fluidframework/build-common": "^1.1.0",
|
|
68
|
+
"@fluidframework/build-tools": "^0.4.4000",
|
|
69
|
+
"@fluidframework/counter": "^1.3.0",
|
|
70
|
+
"@fluidframework/eslint-config-fluid": "^1.1.0",
|
|
71
|
+
"@fluidframework/test-client-utils": "1.4.0-106438",
|
|
72
|
+
"@fluidframework/test-utils": "^1.3.0",
|
|
68
73
|
"@microsoft/api-extractor": "^7.22.2",
|
|
69
74
|
"@rushstack/eslint-config": "^2.5.1",
|
|
70
75
|
"@types/mocha": "^9.1.1",
|
|
71
76
|
"concurrently": "^6.2.0",
|
|
72
|
-
"copyfiles": "^2.1
|
|
77
|
+
"copyfiles": "^2.4.1",
|
|
73
78
|
"cross-env": "^7.0.2",
|
|
74
79
|
"eslint": "~8.6.0",
|
|
80
|
+
"eslint-config-prettier": "~8.5.0",
|
|
81
|
+
"eslint-plugin-jsdoc": "~39.3.0",
|
|
75
82
|
"mocha": "^10.0.0",
|
|
83
|
+
"prettier": "~2.6.2",
|
|
76
84
|
"rimraf": "^2.6.2",
|
|
77
85
|
"start-server-and-test": "^1.11.7",
|
|
78
86
|
"typescript": "~4.5.5"
|
|
79
87
|
},
|
|
80
88
|
"peerDependencies": {
|
|
81
|
-
"fluid-framework": "^1.0
|
|
89
|
+
"fluid-framework": "^1.3.0"
|
|
82
90
|
},
|
|
83
91
|
"typeValidation": {
|
|
84
92
|
"version": "1.1.0",
|
|
85
|
-
"broken": {
|
|
93
|
+
"broken": {
|
|
94
|
+
"InterfaceDeclaration_AzureClientProps": {
|
|
95
|
+
"forwardCompat": false
|
|
96
|
+
}
|
|
97
|
+
}
|
|
86
98
|
}
|
|
87
99
|
}
|
package/src/AzureAudience.ts
CHANGED
|
@@ -2,21 +2,36 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import { assert } from "@fluidframework/common-utils";
|
|
6
6
|
import { ServiceAudience } from "@fluidframework/fluid-static";
|
|
7
7
|
import { IClient } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { IAzureAudience, AzureMember } from "./interfaces";
|
|
9
8
|
|
|
9
|
+
import { AzureMember, AzureUser, IAzureAudience } from "./interfaces";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
|
|
13
|
+
*
|
|
14
|
+
* @remarks Operates in terms of {@link AzureMember}s.
|
|
15
|
+
*/
|
|
10
16
|
export class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Creates a {@link @fluidframework/fluid-static#ServiceAudience} from the provided
|
|
19
|
+
* {@link @fluidframework/protocol-definitions#IClient | audience member}.
|
|
20
|
+
*
|
|
21
|
+
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
|
|
22
|
+
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
protected createServiceMember(audienceMember: IClient): AzureMember {
|
|
27
|
+
const azureUser = audienceMember.user as AzureUser;
|
|
28
|
+
assert(azureUser?.name !== undefined, 'Provided user was not an "AzureUser".');
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
userId: audienceMember.user.id,
|
|
32
|
+
userName: azureUser.name,
|
|
33
|
+
connections: [],
|
|
34
|
+
additionalDetails: azureUser.additionalDetails as unknown,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
22
37
|
}
|
package/src/AzureClient.ts
CHANGED
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { Loader } from "@fluidframework/container-loader";
|
|
6
|
-
import {
|
|
7
|
-
IDocumentServiceFactory,
|
|
8
|
-
IUrlResolver,
|
|
9
|
-
} from "@fluidframework/driver-definitions";
|
|
10
5
|
import {
|
|
11
6
|
AttachState,
|
|
12
7
|
IContainer,
|
|
13
8
|
IFluidModuleWithDetails,
|
|
14
9
|
} from "@fluidframework/container-definitions";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
10
|
+
import { Loader } from "@fluidframework/container-loader";
|
|
11
|
+
import { IDocumentServiceFactory, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
17
12
|
import { ensureFluidResolvedUrl } from "@fluidframework/driver-utils";
|
|
18
13
|
import {
|
|
19
14
|
ContainerSchema,
|
|
@@ -22,11 +17,12 @@ import {
|
|
|
22
17
|
IFluidContainer,
|
|
23
18
|
RootDataObject,
|
|
24
19
|
} from "@fluidframework/fluid-static";
|
|
20
|
+
import { IClient, SummaryType } from "@fluidframework/protocol-definitions";
|
|
21
|
+
import { RouterliciousDocumentServiceFactory } from "@fluidframework/routerlicious-driver";
|
|
22
|
+
import { requestFluidObject } from "@fluidframework/runtime-utils";
|
|
25
23
|
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
} from "@fluidframework/protocol-definitions";
|
|
29
|
-
|
|
24
|
+
import { AzureAudience } from "./AzureAudience";
|
|
25
|
+
import { AzureUrlResolver, createAzureCreateNewRequest } from "./AzureUrlResolver";
|
|
30
26
|
import {
|
|
31
27
|
AzureClientProps,
|
|
32
28
|
AzureConnectionConfig,
|
|
@@ -35,18 +31,15 @@ import {
|
|
|
35
31
|
AzureGetVersionsOptions,
|
|
36
32
|
} from "./interfaces";
|
|
37
33
|
import { isAzureRemoteConnectionConfig } from "./utils";
|
|
38
|
-
import { AzureAudience } from "./AzureAudience";
|
|
39
|
-
import {
|
|
40
|
-
AzureUrlResolver,
|
|
41
|
-
createAzureCreateNewRequest,
|
|
42
|
-
} from "./AzureUrlResolver";
|
|
43
34
|
|
|
44
35
|
/**
|
|
45
36
|
* Strongly typed id for connecting to a local Azure Fluid Relay.
|
|
46
37
|
*/
|
|
47
38
|
const LOCAL_MODE_TENANT_ID = "local";
|
|
48
39
|
const getTenantId = (connectionProps: AzureConnectionConfig): string => {
|
|
49
|
-
return isAzureRemoteConnectionConfig(connectionProps)
|
|
40
|
+
return isAzureRemoteConnectionConfig(connectionProps)
|
|
41
|
+
? connectionProps.tenantId
|
|
42
|
+
: LOCAL_MODE_TENANT_ID;
|
|
50
43
|
};
|
|
51
44
|
|
|
52
45
|
const MAX_VERSION_COUNT = 5;
|
|
@@ -69,10 +62,10 @@ export class AzureClient {
|
|
|
69
62
|
this.urlResolver = new AzureUrlResolver();
|
|
70
63
|
// The local service implementation differs from the Azure Fluid Relay in blob
|
|
71
64
|
// storage format. Azure Fluid Relay supports whole summary upload. Local currently does not.
|
|
72
|
-
const
|
|
65
|
+
const isRemoteConnection = isAzureRemoteConnectionConfig(this.props.connection);
|
|
73
66
|
this.documentServiceFactory = new RouterliciousDocumentServiceFactory(
|
|
74
67
|
this.props.connection.tokenProvider,
|
|
75
|
-
{ enableWholeSummaryUpload, enableDiscovery:
|
|
68
|
+
{ enableWholeSummaryUpload: isRemoteConnection, enableDiscovery: isRemoteConnection },
|
|
76
69
|
);
|
|
77
70
|
}
|
|
78
71
|
|
|
@@ -81,9 +74,7 @@ export class AzureClient {
|
|
|
81
74
|
* @param containerSchema - Container schema for the new container.
|
|
82
75
|
* @returns New detached container instance along with associated services.
|
|
83
76
|
*/
|
|
84
|
-
public async createContainer(
|
|
85
|
-
containerSchema: ContainerSchema,
|
|
86
|
-
): Promise<{
|
|
77
|
+
public async createContainer(containerSchema: ContainerSchema): Promise<{
|
|
87
78
|
container: IFluidContainer;
|
|
88
79
|
services: AzureContainerServices;
|
|
89
80
|
}> {
|
|
@@ -94,10 +85,7 @@ export class AzureClient {
|
|
|
94
85
|
config: {},
|
|
95
86
|
});
|
|
96
87
|
|
|
97
|
-
const fluidContainer = await this.createFluidContainer(
|
|
98
|
-
container,
|
|
99
|
-
this.props.connection,
|
|
100
|
-
);
|
|
88
|
+
const fluidContainer = await this.createFluidContainer(container, this.props.connection);
|
|
101
89
|
const services = this.getContainerServices(container);
|
|
102
90
|
return { container: fluidContainer, services };
|
|
103
91
|
}
|
|
@@ -126,12 +114,12 @@ export class AzureClient {
|
|
|
126
114
|
const sourceContainer = await loader.resolve({ url: url.href });
|
|
127
115
|
|
|
128
116
|
if (sourceContainer.resolvedUrl === undefined) {
|
|
129
|
-
throw new Error(
|
|
130
|
-
"Source container cannot resolve URL.",
|
|
131
|
-
);
|
|
117
|
+
throw new Error("Source container cannot resolve URL.");
|
|
132
118
|
}
|
|
133
119
|
|
|
134
|
-
const documentService = await this.documentServiceFactory.createDocumentService(
|
|
120
|
+
const documentService = await this.documentServiceFactory.createDocumentService(
|
|
121
|
+
sourceContainer.resolvedUrl,
|
|
122
|
+
);
|
|
135
123
|
const storage = await documentService.connectToStorage();
|
|
136
124
|
const handle = {
|
|
137
125
|
type: SummaryType.Handle,
|
|
@@ -140,14 +128,9 @@ export class AzureClient {
|
|
|
140
128
|
};
|
|
141
129
|
const tree = await storage.downloadSummary(handle);
|
|
142
130
|
|
|
143
|
-
const container = await loader.rehydrateDetachedContainerFromSnapshot(
|
|
144
|
-
JSON.stringify(tree),
|
|
145
|
-
);
|
|
131
|
+
const container = await loader.rehydrateDetachedContainerFromSnapshot(JSON.stringify(tree));
|
|
146
132
|
|
|
147
|
-
const fluidContainer = await this.createFluidContainer(
|
|
148
|
-
container,
|
|
149
|
-
this.props.connection,
|
|
150
|
-
);
|
|
133
|
+
const fluidContainer = await this.createFluidContainer(container, this.props.connection);
|
|
151
134
|
const services = this.getContainerServices(container);
|
|
152
135
|
return { container: fluidContainer, services };
|
|
153
136
|
}
|
|
@@ -171,10 +154,7 @@ export class AzureClient {
|
|
|
171
154
|
url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.props.connection)));
|
|
172
155
|
url.searchParams.append("containerId", encodeURIComponent(id));
|
|
173
156
|
const container = await loader.resolve({ url: url.href });
|
|
174
|
-
const rootDataObject = await requestFluidObject<RootDataObject>(
|
|
175
|
-
container,
|
|
176
|
-
"/",
|
|
177
|
-
);
|
|
157
|
+
const rootDataObject = await requestFluidObject<RootDataObject>(container, "/");
|
|
178
158
|
const fluidContainer = new FluidContainer(container, rootDataObject);
|
|
179
159
|
const services = this.getContainerServices(container);
|
|
180
160
|
return { container: fluidContainer, services };
|
|
@@ -192,25 +172,21 @@ export class AzureClient {
|
|
|
192
172
|
options?: AzureGetVersionsOptions,
|
|
193
173
|
): Promise<AzureContainerVersion[]> {
|
|
194
174
|
const url = new URL(this.props.connection.endpoint);
|
|
195
|
-
url.searchParams.append(
|
|
196
|
-
|
|
197
|
-
encodeURIComponent(this.props.connection.endpoint),
|
|
198
|
-
);
|
|
199
|
-
url.searchParams.append(
|
|
200
|
-
"tenantId",
|
|
201
|
-
encodeURIComponent(getTenantId(this.props.connection)),
|
|
202
|
-
);
|
|
175
|
+
url.searchParams.append("storage", encodeURIComponent(this.props.connection.endpoint));
|
|
176
|
+
url.searchParams.append("tenantId", encodeURIComponent(getTenantId(this.props.connection)));
|
|
203
177
|
url.searchParams.append("containerId", encodeURIComponent(id));
|
|
204
178
|
|
|
205
179
|
const resolvedUrl = await this.urlResolver.resolve({ url: url.href });
|
|
206
180
|
if (!resolvedUrl) {
|
|
207
181
|
throw new Error("Unable to resolved URL");
|
|
208
182
|
}
|
|
209
|
-
const documentService =
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
);
|
|
183
|
+
const documentService = await this.documentServiceFactory.createDocumentService(
|
|
184
|
+
resolvedUrl,
|
|
185
|
+
);
|
|
213
186
|
const storage = await documentService.connectToStorage();
|
|
187
|
+
|
|
188
|
+
// External API uses null
|
|
189
|
+
// eslint-disable-next-line unicorn/no-null
|
|
214
190
|
const versions = await storage.getVersions(null, options?.maxCount ?? MAX_VERSION_COUNT);
|
|
215
191
|
|
|
216
192
|
return versions.map((item) => {
|
|
@@ -225,9 +201,7 @@ export class AzureClient {
|
|
|
225
201
|
}
|
|
226
202
|
|
|
227
203
|
private createLoader(containerSchema: ContainerSchema): Loader {
|
|
228
|
-
const runtimeFactory = new DOProviderContainerRuntimeFactory(
|
|
229
|
-
containerSchema,
|
|
230
|
-
);
|
|
204
|
+
const runtimeFactory = new DOProviderContainerRuntimeFactory(containerSchema);
|
|
231
205
|
const load = async (): Promise<IFluidModuleWithDetails> => {
|
|
232
206
|
return {
|
|
233
207
|
module: { fluidExport: runtimeFactory },
|
|
@@ -236,11 +210,22 @@ export class AzureClient {
|
|
|
236
210
|
};
|
|
237
211
|
|
|
238
212
|
const codeLoader = { load };
|
|
213
|
+
const client: IClient = {
|
|
214
|
+
details: {
|
|
215
|
+
capabilities: { interactive: true },
|
|
216
|
+
},
|
|
217
|
+
permission: [],
|
|
218
|
+
scopes: [],
|
|
219
|
+
user: { id: "" },
|
|
220
|
+
mode: "write",
|
|
221
|
+
};
|
|
222
|
+
|
|
239
223
|
return new Loader({
|
|
240
224
|
urlResolver: this.urlResolver,
|
|
241
225
|
documentServiceFactory: this.documentServiceFactory,
|
|
242
226
|
codeLoader,
|
|
243
227
|
logger: this.props.logger,
|
|
228
|
+
options: { client },
|
|
244
229
|
});
|
|
245
230
|
}
|
|
246
231
|
|
|
@@ -253,23 +238,23 @@ export class AzureClient {
|
|
|
253
238
|
getTenantId(connection),
|
|
254
239
|
);
|
|
255
240
|
|
|
256
|
-
const rootDataObject = await requestFluidObject<RootDataObject>(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
"Cannot attach container. Container is not in detached state",
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
await container.attach(createNewRequest);
|
|
268
|
-
const resolved = container.resolvedUrl;
|
|
269
|
-
ensureFluidResolvedUrl(resolved);
|
|
270
|
-
return resolved.id;
|
|
241
|
+
const rootDataObject = await requestFluidObject<RootDataObject>(container, "/");
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* See {@link FluidContainer.attach}
|
|
245
|
+
*/
|
|
246
|
+
const attach = async (): Promise<string> => {
|
|
247
|
+
if (container.attachState !== AttachState.Detached) {
|
|
248
|
+
throw new Error("Cannot attach container. Container is not in detached state");
|
|
271
249
|
}
|
|
272
|
-
|
|
250
|
+
await container.attach(createNewRequest);
|
|
251
|
+
const resolved = container.resolvedUrl;
|
|
252
|
+
ensureFluidResolvedUrl(resolved);
|
|
253
|
+
return resolved.id;
|
|
254
|
+
};
|
|
255
|
+
const fluidContainer = new FluidContainer(container, rootDataObject);
|
|
256
|
+
fluidContainer.attach = attach;
|
|
257
|
+
return fluidContainer;
|
|
273
258
|
}
|
|
274
259
|
// #endregion
|
|
275
260
|
}
|