@azure/arm-storageimportexport 2.0.1-alpha.20220505.1 → 2.0.2
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 +7 -1
- package/README.md +7 -7
- package/dist/index.js +46 -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 +16 -0
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +16 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/storageImportExport.d.ts +2 -0
- package/dist-esm/src/storageImportExport.d.ts.map +1 -1
- package/dist-esm/src/storageImportExport.js +30 -1
- package/dist-esm/src/storageImportExport.js.map +1 -1
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +10 -7
- package/review/arm-storageimportexport.api.md +0 -16
- package/src/models/index.ts +16 -0
- package/src/storageImportExport.ts +35 -1
- package/types/arm-storageimportexport.d.ts +18 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Azure
|
|
1
|
+
# Azure StorageImportExport 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 StorageImportExport client.
|
|
4
4
|
|
|
5
5
|
The Storage Import/Export Resource Provider API.
|
|
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-storageimportexport` package
|
|
26
26
|
|
|
27
|
-
Install the Azure
|
|
27
|
+
Install the Azure StorageImportExport client library for JavaScript with `npm`:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
npm install @azure/arm-storageimportexport
|
|
@@ -32,8 +32,8 @@ npm install @azure/arm-storageimportexport
|
|
|
32
32
|
|
|
33
33
|
### Create and authenticate a `StorageImportExport`
|
|
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 StorageImportExport API, you will need the `endpoint` of your Azure StorageImportExport resource and a `credential`. The Azure StorageImportExport client can use Azure Active Directory credentials to authenticate.
|
|
36
|
+
You can find the endpoint for your Azure StorageImportExport 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 StorageImportExport** 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
|
### StorageImportExport
|
|
74
74
|
|
|
75
|
-
`StorageImportExport` is the primary interface for developers using the Azure
|
|
75
|
+
`StorageImportExport` is the primary interface for developers using the Azure StorageImportExport client library. Explore the methods on this client object to understand the different features of the Azure StorageImportExport 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
|
|
|
9
9
|
function _interopNamespace(e) {
|
|
10
10
|
if (e && e.__esModule) return e;
|
|
@@ -37,33 +37,49 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
|
|
|
37
37
|
/** Known values of {@link CreatedByType} that the service accepts. */
|
|
38
38
|
exports.KnownCreatedByType = void 0;
|
|
39
39
|
(function (KnownCreatedByType) {
|
|
40
|
+
/** User */
|
|
40
41
|
KnownCreatedByType["User"] = "User";
|
|
42
|
+
/** Application */
|
|
41
43
|
KnownCreatedByType["Application"] = "Application";
|
|
44
|
+
/** ManagedIdentity */
|
|
42
45
|
KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
|
|
46
|
+
/** Key */
|
|
43
47
|
KnownCreatedByType["Key"] = "Key";
|
|
44
48
|
})(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
|
|
45
49
|
/** Known values of {@link DriveState} that the service accepts. */
|
|
46
50
|
exports.KnownDriveState = void 0;
|
|
47
51
|
(function (KnownDriveState) {
|
|
52
|
+
/** Specified */
|
|
48
53
|
KnownDriveState["Specified"] = "Specified";
|
|
54
|
+
/** Received */
|
|
49
55
|
KnownDriveState["Received"] = "Received";
|
|
56
|
+
/** NeverReceived */
|
|
50
57
|
KnownDriveState["NeverReceived"] = "NeverReceived";
|
|
58
|
+
/** Transferring */
|
|
51
59
|
KnownDriveState["Transferring"] = "Transferring";
|
|
60
|
+
/** Completed */
|
|
52
61
|
KnownDriveState["Completed"] = "Completed";
|
|
62
|
+
/** CompletedMoreInfo */
|
|
53
63
|
KnownDriveState["CompletedMoreInfo"] = "CompletedMoreInfo";
|
|
64
|
+
/** ShippedBack */
|
|
54
65
|
KnownDriveState["ShippedBack"] = "ShippedBack";
|
|
55
66
|
})(exports.KnownDriveState || (exports.KnownDriveState = {}));
|
|
56
67
|
/** Known values of {@link EncryptionKekType} that the service accepts. */
|
|
57
68
|
exports.KnownEncryptionKekType = void 0;
|
|
58
69
|
(function (KnownEncryptionKekType) {
|
|
70
|
+
/** MicrosoftManaged */
|
|
59
71
|
KnownEncryptionKekType["MicrosoftManaged"] = "MicrosoftManaged";
|
|
72
|
+
/** CustomerManaged */
|
|
60
73
|
KnownEncryptionKekType["CustomerManaged"] = "CustomerManaged";
|
|
61
74
|
})(exports.KnownEncryptionKekType || (exports.KnownEncryptionKekType = {}));
|
|
62
75
|
/** Known values of {@link IdentityType} that the service accepts. */
|
|
63
76
|
exports.KnownIdentityType = void 0;
|
|
64
77
|
(function (KnownIdentityType) {
|
|
78
|
+
/** None */
|
|
65
79
|
KnownIdentityType["None"] = "None";
|
|
80
|
+
/** SystemAssigned */
|
|
66
81
|
KnownIdentityType["SystemAssigned"] = "SystemAssigned";
|
|
82
|
+
/** UserAssigned */
|
|
67
83
|
KnownIdentityType["UserAssigned"] = "UserAssigned";
|
|
68
84
|
})(exports.KnownIdentityType || (exports.KnownIdentityType = {}));
|
|
69
85
|
|
|
@@ -2003,7 +2019,7 @@ class StorageImportExport extends coreClient__namespace.ServiceClient {
|
|
|
2003
2019
|
requestContentType: "application/json; charset=utf-8",
|
|
2004
2020
|
credential: credentials
|
|
2005
2021
|
};
|
|
2006
|
-
const packageDetails = `azsdk-js-arm-storageimportexport/2.0.
|
|
2022
|
+
const packageDetails = `azsdk-js-arm-storageimportexport/2.0.2`;
|
|
2007
2023
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
2008
2024
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
2009
2025
|
: `${packageDetails}`;
|
|
@@ -2039,6 +2055,34 @@ class StorageImportExport extends coreClient__namespace.ServiceClient {
|
|
|
2039
2055
|
this.jobs = new JobsImpl(this);
|
|
2040
2056
|
this.bitLockerKeys = new BitLockerKeysImpl(this);
|
|
2041
2057
|
this.operations = new OperationsImpl(this);
|
|
2058
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
2059
|
+
}
|
|
2060
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
2061
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
2062
|
+
if (!apiVersion) {
|
|
2063
|
+
return;
|
|
2064
|
+
}
|
|
2065
|
+
const apiVersionPolicy = {
|
|
2066
|
+
name: "CustomApiVersionPolicy",
|
|
2067
|
+
sendRequest(request, next) {
|
|
2068
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
2069
|
+
const param = request.url.split("?");
|
|
2070
|
+
if (param.length > 1) {
|
|
2071
|
+
const newParams = param[1].split("&").map((item) => {
|
|
2072
|
+
if (item.indexOf("api-version") > -1) {
|
|
2073
|
+
return "api-version=" + apiVersion;
|
|
2074
|
+
}
|
|
2075
|
+
else {
|
|
2076
|
+
return item;
|
|
2077
|
+
}
|
|
2078
|
+
});
|
|
2079
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
2080
|
+
}
|
|
2081
|
+
return next(request);
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
2042
2086
|
}
|
|
2043
2087
|
}
|
|
2044
2088
|
|