@azure/arm-relay 3.0.2-alpha.20220506.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -10
- package/README.md +7 -7
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +14 -14
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/relayAPI.d.ts +2 -0
- package/dist-esm/src/relayAPI.d.ts.map +1 -1
- package/dist-esm/src/relayAPI.js +30 -1
- package/dist-esm/src/relayAPI.js.map +1 -1
- package/dist-esm/test/relay_examples.d.ts.map +1 -1
- package/dist-esm/test/relay_examples.js +19 -21
- package/dist-esm/test/relay_examples.js.map +1 -1
- package/package.json +10 -7
- package/review/arm-relay.api.md +25 -25
- package/src/models/index.ts +15 -14
- package/src/relayAPI.ts +35 -1
- package/types/arm-relay.d.ts +16 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# Release History
|
|
2
|
+
|
|
3
|
+
## 3.1.0 (2022-07-08)
|
|
4
|
+
|
|
5
|
+
**Features**
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Other Changes
|
|
12
|
-
|
|
7
|
+
- Added Interface AuthorizationRule
|
|
8
|
+
- Added Interface HybridConnection
|
|
9
|
+
- Added Interface RelayNamespace
|
|
10
|
+
- Added Interface RelayUpdateParameters
|
|
11
|
+
- Added Interface ResourceNamespacePatch
|
|
12
|
+
- Added Interface TrackedResource
|
|
13
|
+
- Added Interface WcfRelay
|
|
14
|
+
|
|
13
15
|
## 3.0.1 (2022-04-29)
|
|
14
16
|
|
|
15
17
|
**Features**
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Azure
|
|
1
|
+
# Azure RelayApi client library for JavaScript
|
|
2
2
|
|
|
3
|
-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure
|
|
3
|
+
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure RelayApi client.
|
|
4
4
|
|
|
5
5
|
Use these API to manage Azure Relay resources through Azure Resource Manager.
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP
|
|
|
24
24
|
|
|
25
25
|
### Install the `@azure/arm-relay` package
|
|
26
26
|
|
|
27
|
-
Install the Azure
|
|
27
|
+
Install the Azure RelayApi client library for JavaScript with `npm`:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
npm install @azure/arm-relay
|
|
@@ -32,8 +32,8 @@ npm install @azure/arm-relay
|
|
|
32
32
|
|
|
33
33
|
### Create and authenticate a `RelayAPI`
|
|
34
34
|
|
|
35
|
-
To create a client object to access the Azure
|
|
36
|
-
You can find the endpoint for your Azure
|
|
35
|
+
To create a client object to access the Azure RelayApi API, you will need the `endpoint` of your Azure RelayApi resource and a `credential`. The Azure RelayApi client can use Azure Active Directory credentials to authenticate.
|
|
36
|
+
You can find the endpoint for your Azure RelayApi resource in the [Azure Portal][azure_portal].
|
|
37
37
|
|
|
38
38
|
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
|
|
|
43
43
|
npm install @azure/identity
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
You will also need to **register a new AAD application and grant access to Azure
|
|
46
|
+
You will also need to **register a new AAD application and grant access to Azure RelayApi** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
|
|
47
47
|
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
|
|
48
48
|
|
|
49
49
|
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
|
|
@@ -72,7 +72,7 @@ To use this client library in the browser, first you need to use a bundler. For
|
|
|
72
72
|
|
|
73
73
|
### RelayAPI
|
|
74
74
|
|
|
75
|
-
`RelayAPI` is the primary interface for developers using the Azure
|
|
75
|
+
`RelayAPI` is the primary interface for developers using the Azure RelayApi client library. Explore the methods on this client object to understand the different features of the Azure RelayApi service that you can access.
|
|
76
76
|
|
|
77
77
|
## Troubleshooting
|
|
78
78
|
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
5
6
|
var coreClient = require('@azure/core-client');
|
|
6
7
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
|
-
var tslib = require('tslib');
|
|
8
8
|
var coreLro = require('@azure/core-lro');
|
|
9
9
|
|
|
10
10
|
function _interopNamespace(e) {
|
|
@@ -2907,7 +2907,7 @@ class RelayAPI extends coreClient__namespace.ServiceClient {
|
|
|
2907
2907
|
requestContentType: "application/json; charset=utf-8",
|
|
2908
2908
|
credential: credentials
|
|
2909
2909
|
};
|
|
2910
|
-
const packageDetails = `azsdk-js-arm-relay/3.0
|
|
2910
|
+
const packageDetails = `azsdk-js-arm-relay/3.1.0`;
|
|
2911
2911
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
2912
2912
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
2913
2913
|
: `${packageDetails}`;
|
|
@@ -2943,6 +2943,34 @@ class RelayAPI extends coreClient__namespace.ServiceClient {
|
|
|
2943
2943
|
this.namespaces = new NamespacesImpl(this);
|
|
2944
2944
|
this.hybridConnections = new HybridConnectionsImpl(this);
|
|
2945
2945
|
this.wCFRelays = new WCFRelaysImpl(this);
|
|
2946
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
2947
|
+
}
|
|
2948
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
2949
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
2950
|
+
if (!apiVersion) {
|
|
2951
|
+
return;
|
|
2952
|
+
}
|
|
2953
|
+
const apiVersionPolicy = {
|
|
2954
|
+
name: "CustomApiVersionPolicy",
|
|
2955
|
+
sendRequest(request, next) {
|
|
2956
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
2957
|
+
const param = request.url.split("?");
|
|
2958
|
+
if (param.length > 1) {
|
|
2959
|
+
const newParams = param[1].split("&").map((item) => {
|
|
2960
|
+
if (item.indexOf("api-version") > -1) {
|
|
2961
|
+
return "api-version=" + apiVersion;
|
|
2962
|
+
}
|
|
2963
|
+
else {
|
|
2964
|
+
return item;
|
|
2965
|
+
}
|
|
2966
|
+
});
|
|
2967
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
2968
|
+
}
|
|
2969
|
+
return next(request);
|
|
2970
|
+
});
|
|
2971
|
+
}
|
|
2972
|
+
};
|
|
2973
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
2946
2974
|
}
|
|
2947
2975
|
}
|
|
2948
2976
|
|