@fluidframework/azure-client 1.0.2 → 1.1.0-101037
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 +5 -7
- package/CHANGELOG.md +1 -2
- package/README.md +12 -10
- package/api-extractor.json +2 -1
- package/dist/AzureAudience.d.ts +7 -5
- package/dist/AzureAudience.d.ts.map +1 -1
- package/dist/AzureAudience.js +13 -4
- package/dist/AzureAudience.js.map +1 -1
- package/dist/AzureClient.d.ts.map +1 -1
- package/dist/AzureClient.js +23 -15
- 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 +7 -5
- package/lib/AzureAudience.d.ts.map +1 -1
- package/lib/AzureAudience.js +11 -2
- package/lib/AzureAudience.js.map +1 -1
- package/lib/AzureClient.d.ts.map +1 -1
- package/lib/AzureClient.js +25 -17
- 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 +36 -43
- package/src/AzureAudience.ts +23 -13
- package/src/AzureClient.ts +44 -70
- 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/src/interfaces.ts
CHANGED
|
@@ -2,19 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
IServiceAudience,
|
|
10
|
-
} from "@fluidframework/fluid-static";
|
|
6
|
+
import { IMember, IServiceAudience } from "@fluidframework/fluid-static";
|
|
7
|
+
import { IUser } from "@fluidframework/protocol-definitions";
|
|
11
8
|
import { ITokenProvider } from "@fluidframework/routerlicious-driver";
|
|
12
9
|
|
|
13
10
|
// Re-export so developers can build loggers without pulling in common-definitions
|
|
14
|
-
export {
|
|
15
|
-
ITelemetryBaseEvent,
|
|
16
|
-
ITelemetryBaseLogger,
|
|
17
|
-
} from "@fluidframework/common-definitions";
|
|
11
|
+
export { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
18
12
|
|
|
19
13
|
/**
|
|
20
14
|
* Props for initializing a new AzureClient instance
|
|
@@ -23,7 +17,7 @@ export interface AzureClientProps {
|
|
|
23
17
|
/**
|
|
24
18
|
* Configuration for establishing a connection with the Azure Fluid Relay.
|
|
25
19
|
*/
|
|
26
|
-
readonly connection:
|
|
20
|
+
readonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;
|
|
27
21
|
/**
|
|
28
22
|
* Optional. A logger instance to receive diagnostic messages.
|
|
29
23
|
*/
|
|
@@ -121,11 +115,47 @@ export interface AzureContainerServices {
|
|
|
121
115
|
}
|
|
122
116
|
|
|
123
117
|
/**
|
|
124
|
-
* Since Azure provides user names for all of its members, we extend the
|
|
125
|
-
* this service-specific value.
|
|
118
|
+
* Since Azure provides user names for all of its members, we extend the
|
|
119
|
+
* {@link @fluidframework/protocol-definitions#IUser} interface to include this service-specific value. *
|
|
120
|
+
*
|
|
121
|
+
* @typeParam T - See {@link AzureUser.additionalDetails}.
|
|
122
|
+
* Note: must be JSON-serializable.
|
|
123
|
+
* Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
|
|
124
|
+
*/
|
|
125
|
+
// TODO: this should be updated to use something other than `any` (unknown)
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
|
+
export interface AzureUser<T = any> extends IUser {
|
|
128
|
+
/**
|
|
129
|
+
* The user's name
|
|
130
|
+
*/
|
|
131
|
+
name: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Custom, app-specific user information
|
|
135
|
+
*/
|
|
136
|
+
additionalDetails?: T;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Since Azure provides user names for all of its members, we extend the
|
|
141
|
+
* {@link @fluidframework/protocol-definitions#IMember} interface to include this service-specific value.
|
|
142
|
+
* It will be returned for all audience members connected to Azure.
|
|
143
|
+
*
|
|
144
|
+
* @typeParam T - See {@link AzureMember.additionalDetails}.
|
|
145
|
+
* Note: must be JSON-serializable.
|
|
146
|
+
* Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
|
|
126
147
|
*/
|
|
148
|
+
// TODO: this should be updated to use something other than `any` (unknown)
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
150
|
export interface AzureMember<T = any> extends IMember {
|
|
151
|
+
/**
|
|
152
|
+
* {@inheritDoc AzureUser.name}
|
|
153
|
+
*/
|
|
128
154
|
userName: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* {@inheritDoc AzureUser.additionalDetails}
|
|
158
|
+
*/
|
|
129
159
|
additionalDetails?: T;
|
|
130
160
|
}
|
|
131
161
|
|
package/src/packageVersion.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
AzureConnectionConfig,
|
|
7
|
+
AzureLocalConnectionConfig,
|
|
8
|
+
AzureRemoteConnectionConfig,
|
|
9
|
+
} from "./interfaces";
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* Type guard for validating a given AzureConnectionConfig is a remote connection type (AzureRemoteConnectionConfig)
|
|
9
13
|
*/
|
|
10
14
|
export function isAzureRemoteConnectionConfig(
|
|
11
|
-
connectionConfig: AzureConnectionConfig
|
|
15
|
+
connectionConfig: AzureConnectionConfig,
|
|
16
|
+
): connectionConfig is AzureRemoteConnectionConfig {
|
|
12
17
|
return connectionConfig.type === "remote";
|
|
13
18
|
}
|
|
14
19
|
|
|
@@ -16,6 +21,7 @@ export function isAzureRemoteConnectionConfig(
|
|
|
16
21
|
* Type guard for validating a given AzureConnectionConfig is a local connection type (AzureLocalConnectionConfig)
|
|
17
22
|
*/
|
|
18
23
|
export function isAzureLocalConnectionConfig(
|
|
19
|
-
connectionConfig: AzureConnectionConfig
|
|
24
|
+
connectionConfig: AzureConnectionConfig,
|
|
25
|
+
): connectionConfig is AzureLocalConnectionConfig {
|
|
20
26
|
return connectionConfig.type === "local";
|
|
21
27
|
}
|
package/tsconfig.esnext.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"include": [
|
|
12
|
-
"src/**/*"
|
|
13
|
-
],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"src/test/**/*"
|
|
16
|
-
]
|
|
2
|
+
"extends": "@fluidframework/build-common/ts-common-config.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "./src",
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
},
|
|
9
|
+
"include": ["src/**/*"],
|
|
10
|
+
"exclude": ["src/test/**/*"],
|
|
17
11
|
}
|