@azure-rest/arm-servicefabric 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +87 -0
- package/dist/index.js +330 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/src/clientDefinitions.js +4 -0
- package/dist-esm/src/clientDefinitions.js.map +1 -0
- package/dist-esm/src/customizedApiVersionPolicy.js +23 -0
- package/dist-esm/src/customizedApiVersionPolicy.js.map +1 -0
- package/dist-esm/src/index.js +14 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/isUnexpected.js +155 -0
- package/dist-esm/src/isUnexpected.js.map +1 -0
- package/dist-esm/src/models.js +4 -0
- package/dist-esm/src/models.js.map +1 -0
- package/dist-esm/src/outputModels.js +4 -0
- package/dist-esm/src/outputModels.js.map +1 -0
- package/dist-esm/src/paginateHelper.js +70 -0
- package/dist-esm/src/paginateHelper.js.map +1 -0
- package/dist-esm/src/parameters.js +4 -0
- package/dist-esm/src/parameters.js.map +1 -0
- package/dist-esm/src/pollingHelper.js +48 -0
- package/dist-esm/src/pollingHelper.js.map +1 -0
- package/dist-esm/src/responses.js +4 -0
- package/dist-esm/src/responses.js.map +1 -0
- package/dist-esm/src/serviceFabricClient.js +27 -0
- package/dist-esm/src/serviceFabricClient.js.map +1 -0
- package/package.json +127 -0
- package/review/arm-servicefabric.api.md +2071 -0
- package/types/arm-servicefabric.d.ts +2480 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Microsoft
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Azure ServiceFabric client library for JavaScript
|
|
2
|
+
|
|
3
|
+
Service Fabric Client
|
|
4
|
+
|
|
5
|
+
**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**
|
|
6
|
+
|
|
7
|
+
Key links:
|
|
8
|
+
|
|
9
|
+
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabric/arm-servicefabric-rest)
|
|
10
|
+
- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/arm-servicefabric)
|
|
11
|
+
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/arm-servicefabric?view=azure-node-preview)
|
|
12
|
+
- [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
### Currently supported environments
|
|
17
|
+
|
|
18
|
+
- Node.js version 14.x.x or higher
|
|
19
|
+
|
|
20
|
+
### Prerequisites
|
|
21
|
+
|
|
22
|
+
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
|
|
23
|
+
|
|
24
|
+
### Install the `@azure-rest/arm-servicefabric` package
|
|
25
|
+
|
|
26
|
+
Install the Azure ServiceFabric client REST client library for JavaScript with `npm`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @azure-rest/arm-servicefabric
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Create and authenticate a `ServiceFabricClient`
|
|
33
|
+
|
|
34
|
+
To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
|
|
35
|
+
provide an instance of the desired credential type obtained from the
|
|
36
|
+
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
|
|
37
|
+
|
|
38
|
+
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
|
|
39
|
+
|
|
40
|
+
After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
|
|
41
|
+
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
|
|
42
|
+
can be used to authenticate the client.
|
|
43
|
+
|
|
44
|
+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
|
|
45
|
+
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
The following section shows you how to initialize and authenticate your client, then list all of your Clusters.
|
|
51
|
+
|
|
52
|
+
### List All Clusters
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import ServiceFabricManagementClient from "@azure-rest/arm-servicefabric";
|
|
56
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
57
|
+
|
|
58
|
+
async function listClusters() {
|
|
59
|
+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
60
|
+
const credential = new DefaultAzureCredential();
|
|
61
|
+
const client = ServiceFabricManagementClient(credential);
|
|
62
|
+
const result = await client
|
|
63
|
+
.path(
|
|
64
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters",
|
|
65
|
+
subscriptionId
|
|
66
|
+
)
|
|
67
|
+
.get();
|
|
68
|
+
console.log(result);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
listClusters().catch(console.error);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## Troubleshooting
|
|
76
|
+
|
|
77
|
+
### Logging
|
|
78
|
+
|
|
79
|
+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
import { setLogLevel } from "@azure/logger";
|
|
83
|
+
|
|
84
|
+
setLogLevel("info");
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var coreClient = require('@azure-rest/core-client');
|
|
6
|
+
var corePaging = require('@azure/core-paging');
|
|
7
|
+
var coreLro = require('@azure/core-lro');
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
|
10
|
+
// Licensed under the MIT license.
|
|
11
|
+
const apiVersionPolicyName = "CustomizedApiVersionPolicy";
|
|
12
|
+
/**
|
|
13
|
+
* Creates a policy that sets the apiVersion as a query parameter on every request
|
|
14
|
+
* @param options - Client options
|
|
15
|
+
* @returns Pipeline policy that sets the apiVersion as a query parameter on every request
|
|
16
|
+
*/
|
|
17
|
+
function customizedApiVersionPolicy(options) {
|
|
18
|
+
return {
|
|
19
|
+
name: apiVersionPolicyName,
|
|
20
|
+
sendRequest: (req, next) => {
|
|
21
|
+
if (options.apiVersion) {
|
|
22
|
+
const url = new URL(req.url);
|
|
23
|
+
// add or replace the existing api-version with client one
|
|
24
|
+
url.searchParams.set("api-version", options.apiVersion);
|
|
25
|
+
req.url = url.toString();
|
|
26
|
+
}
|
|
27
|
+
return next(req);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Copyright (c) Microsoft Corporation.
|
|
33
|
+
function createClient(credentials, options = {}) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : "https://management.azure.com";
|
|
36
|
+
options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2021-06-01";
|
|
37
|
+
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
38
|
+
scopes: ["https://management.azure.com/.default"],
|
|
39
|
+
} });
|
|
40
|
+
const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.1`;
|
|
41
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
42
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
43
|
+
: `${userAgentInfo}`;
|
|
44
|
+
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
45
|
+
userAgentPrefix,
|
|
46
|
+
} });
|
|
47
|
+
const client = coreClient.getClient(baseUrl, credentials, options);
|
|
48
|
+
// Considering ApiVersionPolicy in core has bugs so we replace with our customized one
|
|
49
|
+
client.pipeline.removePolicy({
|
|
50
|
+
name: "ApiVersionPolicy",
|
|
51
|
+
});
|
|
52
|
+
client.pipeline.addPolicy(customizedApiVersionPolicy(options));
|
|
53
|
+
return client;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Copyright (c) Microsoft Corporation.
|
|
57
|
+
// Licensed under the MIT license.
|
|
58
|
+
const responseMap = {
|
|
59
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
|
|
60
|
+
"200",
|
|
61
|
+
],
|
|
62
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
|
|
63
|
+
"200",
|
|
64
|
+
"202",
|
|
65
|
+
],
|
|
66
|
+
"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
|
|
67
|
+
"200",
|
|
68
|
+
"202",
|
|
69
|
+
],
|
|
70
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
|
|
71
|
+
"200",
|
|
72
|
+
"204",
|
|
73
|
+
],
|
|
74
|
+
"GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters": [
|
|
75
|
+
"200",
|
|
76
|
+
],
|
|
77
|
+
"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": ["200"],
|
|
78
|
+
"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions": [
|
|
79
|
+
"200",
|
|
80
|
+
],
|
|
81
|
+
"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}": [
|
|
82
|
+
"200",
|
|
83
|
+
],
|
|
84
|
+
"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}": [
|
|
85
|
+
"200",
|
|
86
|
+
],
|
|
87
|
+
"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions": [
|
|
88
|
+
"200",
|
|
89
|
+
],
|
|
90
|
+
"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions": [
|
|
91
|
+
"200",
|
|
92
|
+
],
|
|
93
|
+
"GET /providers/Microsoft.ServiceFabric/operations": ["200"],
|
|
94
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
|
|
95
|
+
"200",
|
|
96
|
+
],
|
|
97
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
|
|
98
|
+
"200",
|
|
99
|
+
],
|
|
100
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
|
|
101
|
+
"202",
|
|
102
|
+
"204",
|
|
103
|
+
],
|
|
104
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes": [
|
|
105
|
+
"200",
|
|
106
|
+
],
|
|
107
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
|
|
108
|
+
"200",
|
|
109
|
+
],
|
|
110
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
|
|
111
|
+
"202",
|
|
112
|
+
],
|
|
113
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
|
|
114
|
+
"202",
|
|
115
|
+
"204",
|
|
116
|
+
],
|
|
117
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions": [
|
|
118
|
+
"200",
|
|
119
|
+
],
|
|
120
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
|
|
121
|
+
"200",
|
|
122
|
+
],
|
|
123
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
|
|
124
|
+
"202",
|
|
125
|
+
],
|
|
126
|
+
"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
|
|
127
|
+
"202",
|
|
128
|
+
],
|
|
129
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
|
|
130
|
+
"202",
|
|
131
|
+
"204",
|
|
132
|
+
],
|
|
133
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications": [
|
|
134
|
+
"200",
|
|
135
|
+
],
|
|
136
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
|
|
137
|
+
"200",
|
|
138
|
+
],
|
|
139
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
|
|
140
|
+
"202",
|
|
141
|
+
],
|
|
142
|
+
"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
|
|
143
|
+
"202",
|
|
144
|
+
],
|
|
145
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
|
|
146
|
+
"202",
|
|
147
|
+
"204",
|
|
148
|
+
],
|
|
149
|
+
"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services": [
|
|
150
|
+
"200",
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
function isUnexpected(response) {
|
|
154
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
155
|
+
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
156
|
+
const method = response.request.method;
|
|
157
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
158
|
+
if (!pathDetails) {
|
|
159
|
+
pathDetails = geParametrizedPathSuccess(url.pathname);
|
|
160
|
+
}
|
|
161
|
+
return !pathDetails.includes(response.status);
|
|
162
|
+
}
|
|
163
|
+
function geParametrizedPathSuccess(path) {
|
|
164
|
+
const pathParts = path.split("/");
|
|
165
|
+
// Iterate the responseMap to find a match
|
|
166
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
167
|
+
// Extracting the path from the map key which is in format
|
|
168
|
+
// GET /path/foo
|
|
169
|
+
const candidatePath = getPathFromMapKey(key);
|
|
170
|
+
// Get each part of the url path
|
|
171
|
+
const candidateParts = candidatePath.split("/");
|
|
172
|
+
// If the candidate and actual paths don't match in size
|
|
173
|
+
// we move on to the next candidate path
|
|
174
|
+
if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
|
|
175
|
+
// track if we have found a match to return the values found.
|
|
176
|
+
let found = true;
|
|
177
|
+
for (let i = 0; i < candidateParts.length; i++) {
|
|
178
|
+
if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) {
|
|
179
|
+
// If the current part of the candidate is a "template" part
|
|
180
|
+
// it is a match with the actual path part on hand
|
|
181
|
+
// skip as the parameterized part can match anything
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
// If the candidate part is not a template and
|
|
185
|
+
// the parts don't match mark the candidate as not found
|
|
186
|
+
// to move on with the next candidate path.
|
|
187
|
+
if (candidateParts[i] !== pathParts[i]) {
|
|
188
|
+
found = false;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// We finished evaluating the current candidate parts
|
|
193
|
+
// if all parts matched we return the success values form
|
|
194
|
+
// the path mapping.
|
|
195
|
+
if (found) {
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// No match was found, return an empty array.
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
function hasParametrizedPath(path) {
|
|
204
|
+
return path.includes("/{");
|
|
205
|
+
}
|
|
206
|
+
function getPathFromMapKey(mapKey) {
|
|
207
|
+
const pathStart = mapKey.indexOf("/");
|
|
208
|
+
return mapKey.slice(pathStart);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Copyright (c) Microsoft Corporation.
|
|
212
|
+
/**
|
|
213
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
214
|
+
* @param client - Client to use for sending the next page requests
|
|
215
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
216
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
217
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
218
|
+
*/
|
|
219
|
+
function paginate(client, initialResponse, options = {}) {
|
|
220
|
+
let firstRun = true;
|
|
221
|
+
const itemName = "value";
|
|
222
|
+
const nextLinkName = "nextLink";
|
|
223
|
+
const { customGetPage } = options;
|
|
224
|
+
const pagedResult = {
|
|
225
|
+
firstPageLink: "",
|
|
226
|
+
getPage: typeof customGetPage === "function"
|
|
227
|
+
? customGetPage
|
|
228
|
+
: async (pageLink) => {
|
|
229
|
+
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
|
|
230
|
+
firstRun = false;
|
|
231
|
+
checkPagingRequest(result);
|
|
232
|
+
const nextLink = getNextLink(result.body, nextLinkName);
|
|
233
|
+
const values = getElements(result.body, itemName);
|
|
234
|
+
return {
|
|
235
|
+
page: values,
|
|
236
|
+
nextPageLink: nextLink,
|
|
237
|
+
};
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
return corePaging.getPagedAsyncIterator(pagedResult);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Gets for the value of nextLink in the body
|
|
244
|
+
*/
|
|
245
|
+
function getNextLink(body, nextLinkName) {
|
|
246
|
+
if (!nextLinkName) {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
const nextLink = body[nextLinkName];
|
|
250
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
251
|
+
throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
|
|
252
|
+
}
|
|
253
|
+
return nextLink;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Gets the elements of the current request in the body.
|
|
257
|
+
*/
|
|
258
|
+
function getElements(body, itemName) {
|
|
259
|
+
const value = body[itemName];
|
|
260
|
+
// value has to be an array according to the x-ms-pageable extension.
|
|
261
|
+
// The fact that this must be an array is used above to calculate the
|
|
262
|
+
// type of elements in the page in PaginateReturn
|
|
263
|
+
if (!Array.isArray(value)) {
|
|
264
|
+
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
265
|
+
}
|
|
266
|
+
return value !== null && value !== void 0 ? value : [];
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Checks if a request failed
|
|
270
|
+
*/
|
|
271
|
+
function checkPagingRequest(response) {
|
|
272
|
+
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
|
|
273
|
+
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
274
|
+
throw coreClient.createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Copyright (c) Microsoft Corporation.
|
|
279
|
+
/**
|
|
280
|
+
* Helper function that builds a Poller object to help polling a long running operation.
|
|
281
|
+
* @param client - Client to use for sending the request to get additional pages.
|
|
282
|
+
* @param initialResponse - The initial response.
|
|
283
|
+
* @param options - Options to set a resume state or custom polling interval.
|
|
284
|
+
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
285
|
+
*/
|
|
286
|
+
function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
287
|
+
const poller = {
|
|
288
|
+
requestMethod: initialResponse.request.method,
|
|
289
|
+
requestPath: initialResponse.request.url,
|
|
290
|
+
sendInitialRequest: async () => {
|
|
291
|
+
// In the case of Rest Clients we are building the LRO poller object from a response that's the reason
|
|
292
|
+
// we are not triggering the initial request here, just extracting the information from the
|
|
293
|
+
// response we were provided.
|
|
294
|
+
return getLroResponse(initialResponse);
|
|
295
|
+
},
|
|
296
|
+
sendPollRequest: async (path) => {
|
|
297
|
+
// This is the callback that is going to be called to poll the service
|
|
298
|
+
// to get the latest status. We use the client provided and the polling path
|
|
299
|
+
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
300
|
+
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
301
|
+
const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
|
|
302
|
+
const lroResponse = getLroResponse(response);
|
|
303
|
+
lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
|
|
304
|
+
return lroResponse;
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
return new coreLro.LroEngine(poller, options);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Converts a Rest Client response to a response that the LRO engine knows about
|
|
311
|
+
* @param response - a rest client http response
|
|
312
|
+
* @returns - An LRO response that the LRO engine can work with
|
|
313
|
+
*/
|
|
314
|
+
function getLroResponse(response) {
|
|
315
|
+
if (Number.isNaN(response.status)) {
|
|
316
|
+
throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
flatResponse: response,
|
|
320
|
+
rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Copyright (c) Microsoft Corporation.
|
|
325
|
+
|
|
326
|
+
exports["default"] = createClient;
|
|
327
|
+
exports.getLongRunningPoller = getLongRunningPoller;
|
|
328
|
+
exports.isUnexpected = isUnexpected;
|
|
329
|
+
exports.paginate = paginate;
|
|
330
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/customizedApiVersionPolicy.ts","../src/serviceFabricClient.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/pollingHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport { PipelinePolicy } from \"@azure/core-rest-pipeline\";\n\nexport const apiVersionPolicyName = \"CustomizedApiVersionPolicy\";\n\n/**\n * Creates a policy that sets the apiVersion as a query parameter on every request\n * @param options - Client options\n * @returns Pipeline policy that sets the apiVersion as a query parameter on every request\n */\nexport function customizedApiVersionPolicy(options: ClientOptions): PipelinePolicy {\n return {\n name: apiVersionPolicyName,\n sendRequest: (req, next) => {\n if (options.apiVersion) {\n const url = new URL(req.url);\n // add or replace the existing api-version with client one\n url.searchParams.set(\"api-version\", options.apiVersion);\n req.url = url.toString();\n }\n\n return next(req);\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ServiceFabricClient } from \"./clientDefinitions\";\nimport { customizedApiVersionPolicy } from \"./customizedApiVersionPolicy\";\n\nexport default function createClient(\n credentials: TokenCredential,\n options: ClientOptions = {}\n): ServiceFabricClient {\n const baseUrl = options.baseUrl ?? \"https://management.azure.com\";\n options.apiVersion = options.apiVersion ?? \"2021-06-01\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://management.azure.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as ServiceFabricClient;\n // Considering ApiVersionPolicy in core has bugs so we replace with our customized one\n client.pipeline.removePolicy({\n name: \"ApiVersionPolicy\",\n });\n client.pipeline.addPolicy(customizedApiVersionPolicy(options));\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ApplicationTypeVersionsCreateOrUpdate202Response,\n ApplicationTypeVersionsCreateOrUpdatedefaultResponse,\n ApplicationTypeVersionsDelete202Response,\n ApplicationTypeVersionsDelete204Response,\n ApplicationTypeVersionsDeletedefaultResponse,\n ApplicationTypeVersionsGet200Response,\n ApplicationTypeVersionsGetdefaultResponse,\n ApplicationTypeVersionsList200Response,\n ApplicationTypeVersionsListdefaultResponse,\n ApplicationTypesCreateOrUpdate200Response,\n ApplicationTypesCreateOrUpdatedefaultResponse,\n ApplicationTypesDelete202Response,\n ApplicationTypesDelete204Response,\n ApplicationTypesDeletedefaultResponse,\n ApplicationTypesGet200Response,\n ApplicationTypesGetdefaultResponse,\n ApplicationTypesList200Response,\n ApplicationTypesListdefaultResponse,\n ApplicationsCreateOrUpdate202Response,\n ApplicationsCreateOrUpdatedefaultResponse,\n ApplicationsDelete202Response,\n ApplicationsDelete204Response,\n ApplicationsDeletedefaultResponse,\n ApplicationsGet200Response,\n ApplicationsGetdefaultResponse,\n ApplicationsList200Response,\n ApplicationsListdefaultResponse,\n ApplicationsUpdate202Response,\n ApplicationsUpdatedefaultResponse,\n ClusterVersionsGet200Response,\n ClusterVersionsGetByEnvironment200Response,\n ClusterVersionsGetByEnvironmentdefaultResponse,\n ClusterVersionsGetdefaultResponse,\n ClusterVersionsList200Response,\n ClusterVersionsListByEnvironment200Response,\n ClusterVersionsListByEnvironmentdefaultResponse,\n ClusterVersionsListdefaultResponse,\n ClustersCreateOrUpdate200Response,\n ClustersCreateOrUpdate202Response,\n ClustersCreateOrUpdatedefaultResponse,\n ClustersDelete200Response,\n ClustersDelete204Response,\n ClustersDeletedefaultResponse,\n ClustersGet200Response,\n ClustersGetdefaultResponse,\n ClustersList200Response,\n ClustersListByResourceGroup200Response,\n ClustersListByResourceGroupdefaultResponse,\n ClustersListUpgradableVersions200Response,\n ClustersListUpgradableVersionsdefaultResponse,\n ClustersListdefaultResponse,\n ClustersUpdate200Response,\n ClustersUpdate202Response,\n ClustersUpdatedefaultResponse,\n OperationsList200Response,\n OperationsListdefaultResponse,\n ServicesCreateOrUpdate202Response,\n ServicesCreateOrUpdatedefaultResponse,\n ServicesDelete202Response,\n ServicesDelete204Response,\n ServicesDeletedefaultResponse,\n ServicesGet200Response,\n ServicesGetdefaultResponse,\n ServicesList200Response,\n ServicesListdefaultResponse,\n ServicesUpdate202Response,\n ServicesUpdatedefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n \"202\",\n ],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\": [\n \"200\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters\": [\"200\"],\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions\": [\n \"200\",\n ],\n \"GET /providers/Microsoft.ServiceFabric/operations\": [\"200\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\": [\n \"200\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\": [\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"202\",\n ],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications\": [\n \"200\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"200\",\n ],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"202\",\n ],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"202\",\n ],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\": [\n \"202\",\n \"204\",\n ],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services\": [\n \"200\",\n ],\n};\n\nexport function isUnexpected(\n response: ClustersGet200Response | ClustersGetdefaultResponse\n): response is ClustersGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdatedefaultResponse\n): response is ClustersCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdatedefaultResponse\n): response is ClustersUpdatedefaultResponse;\nexport function isUnexpected(\n response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeletedefaultResponse\n): response is ClustersDeletedefaultResponse;\nexport function isUnexpected(\n response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupdefaultResponse\n): response is ClustersListByResourceGroupdefaultResponse;\nexport function isUnexpected(\n response: ClustersList200Response | ClustersListdefaultResponse\n): response is ClustersListdefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersListUpgradableVersions200Response\n | ClustersListUpgradableVersionsdefaultResponse\n): response is ClustersListUpgradableVersionsdefaultResponse;\nexport function isUnexpected(\n response: ClusterVersionsGet200Response | ClusterVersionsGetdefaultResponse\n): response is ClusterVersionsGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ClusterVersionsGetByEnvironment200Response\n | ClusterVersionsGetByEnvironmentdefaultResponse\n): response is ClusterVersionsGetByEnvironmentdefaultResponse;\nexport function isUnexpected(\n response: ClusterVersionsList200Response | ClusterVersionsListdefaultResponse\n): response is ClusterVersionsListdefaultResponse;\nexport function isUnexpected(\n response:\n | ClusterVersionsListByEnvironment200Response\n | ClusterVersionsListByEnvironmentdefaultResponse\n): response is ClusterVersionsListByEnvironmentdefaultResponse;\nexport function isUnexpected(\n response: OperationsList200Response | OperationsListdefaultResponse\n): response is OperationsListdefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypesGet200Response | ApplicationTypesGetdefaultResponse\n): response is ApplicationTypesGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypesCreateOrUpdate200Response\n | ApplicationTypesCreateOrUpdatedefaultResponse\n): response is ApplicationTypesCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeletedefaultResponse\n): response is ApplicationTypesDeletedefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypesList200Response | ApplicationTypesListdefaultResponse\n): response is ApplicationTypesListdefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetdefaultResponse\n): response is ApplicationTypeVersionsGetdefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n): response is ApplicationTypeVersionsCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeletedefaultResponse\n): response is ApplicationTypeVersionsDeletedefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListdefaultResponse\n): response is ApplicationTypeVersionsListdefaultResponse;\nexport function isUnexpected(\n response: ApplicationsGet200Response | ApplicationsGetdefaultResponse\n): response is ApplicationsGetdefaultResponse;\nexport function isUnexpected(\n response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdatedefaultResponse\n): response is ApplicationsCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response: ApplicationsUpdate202Response | ApplicationsUpdatedefaultResponse\n): response is ApplicationsUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeletedefaultResponse\n): response is ApplicationsDeletedefaultResponse;\nexport function isUnexpected(\n response: ApplicationsList200Response | ApplicationsListdefaultResponse\n): response is ApplicationsListdefaultResponse;\nexport function isUnexpected(\n response: ServicesGet200Response | ServicesGetdefaultResponse\n): response is ServicesGetdefaultResponse;\nexport function isUnexpected(\n response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdatedefaultResponse\n): response is ServicesCreateOrUpdatedefaultResponse;\nexport function isUnexpected(\n response: ServicesUpdate202Response | ServicesUpdatedefaultResponse\n): response is ServicesUpdatedefaultResponse;\nexport function isUnexpected(\n response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeletedefaultResponse\n): response is ServicesDeletedefaultResponse;\nexport function isUnexpected(\n response: ServicesList200Response | ServicesListdefaultResponse\n): response is ServicesListdefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersGet200Response\n | ClustersGetdefaultResponse\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdatedefaultResponse\n | ClustersUpdate200Response\n | ClustersUpdate202Response\n | ClustersUpdatedefaultResponse\n | ClustersDelete200Response\n | ClustersDelete204Response\n | ClustersDeletedefaultResponse\n | ClustersListByResourceGroup200Response\n | ClustersListByResourceGroupdefaultResponse\n | ClustersList200Response\n | ClustersListdefaultResponse\n | ClustersListUpgradableVersions200Response\n | ClustersListUpgradableVersionsdefaultResponse\n | ClusterVersionsGet200Response\n | ClusterVersionsGetdefaultResponse\n | ClusterVersionsGetByEnvironment200Response\n | ClusterVersionsGetByEnvironmentdefaultResponse\n | ClusterVersionsList200Response\n | ClusterVersionsListdefaultResponse\n | ClusterVersionsListByEnvironment200Response\n | ClusterVersionsListByEnvironmentdefaultResponse\n | OperationsList200Response\n | OperationsListdefaultResponse\n | ApplicationTypesGet200Response\n | ApplicationTypesGetdefaultResponse\n | ApplicationTypesCreateOrUpdate200Response\n | ApplicationTypesCreateOrUpdatedefaultResponse\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeletedefaultResponse\n | ApplicationTypesList200Response\n | ApplicationTypesListdefaultResponse\n | ApplicationTypeVersionsGet200Response\n | ApplicationTypeVersionsGetdefaultResponse\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeletedefaultResponse\n | ApplicationTypeVersionsList200Response\n | ApplicationTypeVersionsListdefaultResponse\n | ApplicationsGet200Response\n | ApplicationsGetdefaultResponse\n | ApplicationsCreateOrUpdate202Response\n | ApplicationsCreateOrUpdatedefaultResponse\n | ApplicationsUpdate202Response\n | ApplicationsUpdatedefaultResponse\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeletedefaultResponse\n | ApplicationsList200Response\n | ApplicationsListdefaultResponse\n | ServicesGet200Response\n | ServicesGetdefaultResponse\n | ServicesCreateOrUpdate202Response\n | ServicesCreateOrUpdatedefaultResponse\n | ServicesUpdate202Response\n | ServicesUpdatedefaultResponse\n | ServicesDelete202Response\n | ServicesDelete204Response\n | ServicesDeletedefaultResponse\n | ServicesList200Response\n | ServicesListdefaultResponse\n): response is\n | ClustersGetdefaultResponse\n | ClustersCreateOrUpdatedefaultResponse\n | ClustersUpdatedefaultResponse\n | ClustersDeletedefaultResponse\n | ClustersListByResourceGroupdefaultResponse\n | ClustersListdefaultResponse\n | ClustersListUpgradableVersionsdefaultResponse\n | ClusterVersionsGetdefaultResponse\n | ClusterVersionsGetByEnvironmentdefaultResponse\n | ClusterVersionsListdefaultResponse\n | ClusterVersionsListByEnvironmentdefaultResponse\n | OperationsListdefaultResponse\n | ApplicationTypesGetdefaultResponse\n | ApplicationTypesCreateOrUpdatedefaultResponse\n | ApplicationTypesDeletedefaultResponse\n | ApplicationTypesListdefaultResponse\n | ApplicationTypeVersionsGetdefaultResponse\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n | ApplicationTypeVersionsDeletedefaultResponse\n | ApplicationTypeVersionsListdefaultResponse\n | ApplicationsGetdefaultResponse\n | ApplicationsCreateOrUpdatedefaultResponse\n | ApplicationsUpdatedefaultResponse\n | ApplicationsDeletedefaultResponse\n | ApplicationsListdefaultResponse\n | ServicesGetdefaultResponse\n | ServicesCreateOrUpdatedefaultResponse\n | ServicesUpdatedefaultResponse\n | ServicesDeletedefaultResponse\n | ServicesListdefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (candidateParts[i].startsWith(\"{\") && candidateParts[i].endsWith(\"}\")) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PagedAsyncIterableIterator, PagedResult, getPagedAsyncIterator } from \"@azure/core-paging\";\nimport { Client, PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollOperationState,\n PollerLike,\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport ServiceFabricClient from \"./serviceFabricClient\";\n\nexport * from \"./serviceFabricClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default ServiceFabricClient;\n"],"names":["getClient","getPagedAsyncIterator","createRestError","LroEngine"],"mappings":";;;;;;;;AAAA;AACA;AAKO,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE;;;;AAIG;AACG,SAAU,0BAA0B,CAAC,OAAsB,EAAA;IAC/D,OAAO;AACL,QAAA,IAAI,EAAE,oBAAoB;AAC1B,QAAA,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,KAAI;YACzB,IAAI,OAAO,CAAC,UAAU,EAAE;gBACtB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;;gBAE7B,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AACxD,gBAAA,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,aAAA;AAED,YAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;SAClB;KACF,CAAC;AACJ;;AC3BA;AAQwB,SAAA,YAAY,CAClC,WAA4B,EAC5B,UAAyB,EAAE,EAAA;;I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,CAAC,CAAC,GAAG,EAAE,CAAC;AACvF,YAAA,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;AACxD,YAAA,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;AACnF,YAAA,OAAO,WAAW,CAAC;SACpB;KACF,CAAC;AAEF,IAAA,OAAO,IAAIC,iBAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;;AAIG;AACH,SAAS,cAAc,CAA+B,QAAiB,EAAA;IACrE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,CAAA,oDAAA,EAAuD,QAAQ,CAAC,MAAM,CAAE,CAAA,CAAC,CAAC;AAC/F,KAAA;IAED,OAAO;AACL,QAAA,YAAY,EAAE,QAAQ;AACtB,QAAA,WAAW,kCACN,QAAQ,CAAA,EAAA,EACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,EACpB,CAAA;KACF,CAAC;AACJ;;ACnEA;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ApplicationTypeVersionsCreateOrUpdateParameters,\n ApplicationTypeVersionsDeleteParameters,\n ApplicationTypeVersionsGetParameters,\n ApplicationTypeVersionsListParameters,\n ApplicationTypesCreateOrUpdateParameters,\n ApplicationTypesDeleteParameters,\n ApplicationTypesGetParameters,\n ApplicationTypesListParameters,\n ApplicationsCreateOrUpdateParameters,\n ApplicationsDeleteParameters,\n ApplicationsGetParameters,\n ApplicationsListParameters,\n ApplicationsUpdateParameters,\n ClusterVersionsGetByEnvironmentParameters,\n ClusterVersionsGetParameters,\n ClusterVersionsListByEnvironmentParameters,\n ClusterVersionsListParameters,\n ClustersCreateOrUpdateParameters,\n ClustersDeleteParameters,\n ClustersGetParameters,\n ClustersListByResourceGroupParameters,\n ClustersListParameters,\n ClustersListUpgradableVersionsParameters,\n ClustersUpdateParameters,\n OperationsListParameters,\n ServicesCreateOrUpdateParameters,\n ServicesDeleteParameters,\n ServicesGetParameters,\n ServicesListParameters,\n ServicesUpdateParameters,\n} from \"./parameters\";\nimport {\n ApplicationTypeVersionsCreateOrUpdate202Response,\n ApplicationTypeVersionsCreateOrUpdatedefaultResponse,\n ApplicationTypeVersionsDelete202Response,\n ApplicationTypeVersionsDelete204Response,\n ApplicationTypeVersionsDeletedefaultResponse,\n ApplicationTypeVersionsGet200Response,\n ApplicationTypeVersionsGetdefaultResponse,\n ApplicationTypeVersionsList200Response,\n ApplicationTypeVersionsListdefaultResponse,\n ApplicationTypesCreateOrUpdate200Response,\n ApplicationTypesCreateOrUpdatedefaultResponse,\n ApplicationTypesDelete202Response,\n ApplicationTypesDelete204Response,\n ApplicationTypesDeletedefaultResponse,\n ApplicationTypesGet200Response,\n ApplicationTypesGetdefaultResponse,\n ApplicationTypesList200Response,\n ApplicationTypesListdefaultResponse,\n ApplicationsCreateOrUpdate202Response,\n ApplicationsCreateOrUpdatedefaultResponse,\n ApplicationsDelete202Response,\n ApplicationsDelete204Response,\n ApplicationsDeletedefaultResponse,\n ApplicationsGet200Response,\n ApplicationsGetdefaultResponse,\n ApplicationsList200Response,\n ApplicationsListdefaultResponse,\n ApplicationsUpdate202Response,\n ApplicationsUpdatedefaultResponse,\n ClusterVersionsGet200Response,\n ClusterVersionsGetByEnvironment200Response,\n ClusterVersionsGetByEnvironmentdefaultResponse,\n ClusterVersionsGetdefaultResponse,\n ClusterVersionsList200Response,\n ClusterVersionsListByEnvironment200Response,\n ClusterVersionsListByEnvironmentdefaultResponse,\n ClusterVersionsListdefaultResponse,\n ClustersCreateOrUpdate200Response,\n ClustersCreateOrUpdate202Response,\n ClustersCreateOrUpdatedefaultResponse,\n ClustersDelete200Response,\n ClustersDelete204Response,\n ClustersDeletedefaultResponse,\n ClustersGet200Response,\n ClustersGetdefaultResponse,\n ClustersList200Response,\n ClustersListByResourceGroup200Response,\n ClustersListByResourceGroupdefaultResponse,\n ClustersListUpgradableVersions200Response,\n ClustersListUpgradableVersionsdefaultResponse,\n ClustersListdefaultResponse,\n ClustersUpdate200Response,\n ClustersUpdate202Response,\n ClustersUpdatedefaultResponse,\n OperationsList200Response,\n OperationsListdefaultResponse,\n ServicesCreateOrUpdate202Response,\n ServicesCreateOrUpdatedefaultResponse,\n ServicesDelete202Response,\n ServicesDelete204Response,\n ServicesDeletedefaultResponse,\n ServicesGet200Response,\n ServicesGetdefaultResponse,\n ServicesList200Response,\n ServicesListdefaultResponse,\n ServicesUpdate202Response,\n ServicesUpdatedefaultResponse,\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ClustersGet {\n /** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */\n get(\n options?: ClustersGetParameters\n ): StreamableMethod<ClustersGet200Response | ClustersGetdefaultResponse>;\n /** Create or update a Service Fabric cluster resource with the specified name. */\n put(\n options: ClustersCreateOrUpdateParameters\n ): StreamableMethod<\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdatedefaultResponse\n >;\n /** Update the configuration of a Service Fabric cluster resource with the specified name. */\n patch(\n options: ClustersUpdateParameters\n ): StreamableMethod<\n ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdatedefaultResponse\n >;\n /** Delete a Service Fabric cluster resource with the specified name. */\n delete(\n options?: ClustersDeleteParameters\n ): StreamableMethod<\n ClustersDelete200Response | ClustersDelete204Response | ClustersDeletedefaultResponse\n >;\n}\n\nexport interface ClustersListByResourceGroup {\n /** Gets all Service Fabric cluster resources created or in the process of being created in the resource group. */\n get(\n options?: ClustersListByResourceGroupParameters\n ): StreamableMethod<\n ClustersListByResourceGroup200Response | ClustersListByResourceGroupdefaultResponse\n >;\n}\n\nexport interface ClustersList {\n /** Gets all Service Fabric cluster resources created or in the process of being created in the subscription. */\n get(\n options?: ClustersListParameters\n ): StreamableMethod<ClustersList200Response | ClustersListdefaultResponse>;\n}\n\nexport interface ClustersListUpgradableVersions {\n /** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */\n post(\n options?: ClustersListUpgradableVersionsParameters\n ): StreamableMethod<\n ClustersListUpgradableVersions200Response | ClustersListUpgradableVersionsdefaultResponse\n >;\n}\n\nexport interface ClusterVersionsGet {\n /** Gets information about an available Service Fabric cluster code version. */\n get(\n options?: ClusterVersionsGetParameters\n ): StreamableMethod<ClusterVersionsGet200Response | ClusterVersionsGetdefaultResponse>;\n}\n\nexport interface ClusterVersionsGetByEnvironment {\n /** Gets information about an available Service Fabric cluster code version by environment. */\n get(\n options?: ClusterVersionsGetByEnvironmentParameters\n ): StreamableMethod<\n ClusterVersionsGetByEnvironment200Response | ClusterVersionsGetByEnvironmentdefaultResponse\n >;\n}\n\nexport interface ClusterVersionsList {\n /** Gets all available code versions for Service Fabric cluster resources by location. */\n get(\n options?: ClusterVersionsListParameters\n ): StreamableMethod<ClusterVersionsList200Response | ClusterVersionsListdefaultResponse>;\n}\n\nexport interface ClusterVersionsListByEnvironment {\n /** Gets all available code versions for Service Fabric cluster resources by environment. */\n get(\n options?: ClusterVersionsListByEnvironmentParameters\n ): StreamableMethod<\n ClusterVersionsListByEnvironment200Response | ClusterVersionsListByEnvironmentdefaultResponse\n >;\n}\n\nexport interface OperationsList {\n /** Get the list of available Service Fabric resource provider API operations. */\n get(\n options?: OperationsListParameters\n ): StreamableMethod<OperationsList200Response | OperationsListdefaultResponse>;\n}\n\nexport interface ApplicationTypesGet {\n /** Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. */\n get(\n options?: ApplicationTypesGetParameters\n ): StreamableMethod<ApplicationTypesGet200Response | ApplicationTypesGetdefaultResponse>;\n /** Create or update a Service Fabric application type name resource with the specified name. */\n put(\n options: ApplicationTypesCreateOrUpdateParameters\n ): StreamableMethod<\n ApplicationTypesCreateOrUpdate200Response | ApplicationTypesCreateOrUpdatedefaultResponse\n >;\n /** Delete a Service Fabric application type name resource with the specified name. */\n delete(\n options?: ApplicationTypesDeleteParameters\n ): StreamableMethod<\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeletedefaultResponse\n >;\n}\n\nexport interface ApplicationTypesList {\n /** Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. */\n get(\n options?: ApplicationTypesListParameters\n ): StreamableMethod<ApplicationTypesList200Response | ApplicationTypesListdefaultResponse>;\n}\n\nexport interface ApplicationTypeVersionsGet {\n /** Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. */\n get(\n options?: ApplicationTypeVersionsGetParameters\n ): StreamableMethod<\n ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetdefaultResponse\n >;\n /** Create or update a Service Fabric application type version resource with the specified name. */\n put(\n options: ApplicationTypeVersionsCreateOrUpdateParameters\n ): StreamableMethod<\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdatedefaultResponse\n >;\n /** Delete a Service Fabric application type version resource with the specified name. */\n delete(\n options?: ApplicationTypeVersionsDeleteParameters\n ): StreamableMethod<\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeletedefaultResponse\n >;\n}\n\nexport interface ApplicationTypeVersionsList {\n /** Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. */\n get(\n options?: ApplicationTypeVersionsListParameters\n ): StreamableMethod<\n ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListdefaultResponse\n >;\n}\n\nexport interface ApplicationsGet {\n /** Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. */\n get(\n options?: ApplicationsGetParameters\n ): StreamableMethod<ApplicationsGet200Response | ApplicationsGetdefaultResponse>;\n /** Create or update a Service Fabric application resource with the specified name. */\n put(\n options: ApplicationsCreateOrUpdateParameters\n ): StreamableMethod<\n ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdatedefaultResponse\n >;\n /** Update a Service Fabric application resource with the specified name. */\n patch(\n options: ApplicationsUpdateParameters\n ): StreamableMethod<ApplicationsUpdate202Response | ApplicationsUpdatedefaultResponse>;\n /** Delete a Service Fabric application resource with the specified name. */\n delete(\n options?: ApplicationsDeleteParameters\n ): StreamableMethod<\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeletedefaultResponse\n >;\n}\n\nexport interface ApplicationsList {\n /** Gets all application resources created or in the process of being created in the Service Fabric cluster resource. */\n get(\n options?: ApplicationsListParameters\n ): StreamableMethod<ApplicationsList200Response | ApplicationsListdefaultResponse>;\n}\n\nexport interface ServicesGet {\n /** Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. */\n get(\n options?: ServicesGetParameters\n ): StreamableMethod<ServicesGet200Response | ServicesGetdefaultResponse>;\n /** Create or update a Service Fabric service resource with the specified name. */\n put(\n options: ServicesCreateOrUpdateParameters\n ): StreamableMethod<ServicesCreateOrUpdate202Response | ServicesCreateOrUpdatedefaultResponse>;\n /** Update a Service Fabric service resource with the specified name. */\n patch(\n options: ServicesUpdateParameters\n ): StreamableMethod<ServicesUpdate202Response | ServicesUpdatedefaultResponse>;\n /** Delete a Service Fabric service resource with the specified name. */\n delete(\n options?: ServicesDeleteParameters\n ): StreamableMethod<\n ServicesDelete202Response | ServicesDelete204Response | ServicesDeletedefaultResponse\n >;\n}\n\nexport interface ServicesList {\n /** Gets all service resources created or in the process of being created in the Service Fabric application resource. */\n get(\n options?: ServicesListParameters\n ): StreamableMethod<ServicesList200Response | ServicesListdefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}' has methods for the following verbs: get, put, patch, delete */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string\n ): ClustersGet;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourcegroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters\",\n subscriptionId: string,\n resourceGroupName: string\n ): ClustersListByResourceGroup;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/providers/Microsoft.ServiceFabric/clusters' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters\",\n subscriptionId: string\n ): ClustersList;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/listUpgradableVersions' has methods for the following verbs: post */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string\n ): ClustersListUpgradableVersions;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/providers/Microsoft.ServiceFabric/locations/\\{location\\}/clusterVersions/\\{clusterVersion\\}' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}\",\n subscriptionId: string,\n location: string,\n clusterVersion: string\n ): ClusterVersionsGet;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/providers/Microsoft.ServiceFabric/locations/\\{location\\}/environments/\\{environment\\}/clusterVersions/\\{clusterVersion\\}' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}\",\n subscriptionId: string,\n location: string,\n environment: \"Windows\" | \"Linux\",\n clusterVersion: string\n ): ClusterVersionsGetByEnvironment;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/providers/Microsoft.ServiceFabric/locations/\\{location\\}/clusterVersions' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions\",\n subscriptionId: string,\n location: string\n ): ClusterVersionsList;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/providers/Microsoft.ServiceFabric/locations/\\{location\\}/environments/\\{environment\\}/clusterVersions' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions\",\n subscriptionId: string,\n location: string,\n environment: \"Windows\" | \"Linux\"\n ): ClusterVersionsListByEnvironment;\n /** Resource for '/providers/Microsoft.ServiceFabric/operations' has methods for the following verbs: get */\n (path: \"/providers/Microsoft.ServiceFabric/operations\"): OperationsList;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applicationTypes/\\{applicationTypeName\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string,\n applicationTypeName: string\n ): ApplicationTypesGet;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applicationTypes' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string\n ): ApplicationTypesList;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applicationTypes/\\{applicationTypeName\\}/versions/\\{version\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string,\n applicationTypeName: string,\n version: string\n ): ApplicationTypeVersionsGet;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applicationTypes/\\{applicationTypeName\\}/versions' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string,\n applicationTypeName: string\n ): ApplicationTypeVersionsList;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applications/\\{applicationName\\}' has methods for the following verbs: get, put, patch, delete */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string,\n applicationName: string\n ): ApplicationsGet;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applications' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string\n ): ApplicationsList;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applications/\\{applicationName\\}/services/\\{serviceName\\}' has methods for the following verbs: get, put, patch, delete */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string,\n applicationName: string,\n serviceName: string\n ): ServicesGet;\n /** Resource for '/subscriptions/\\{subscriptionId\\}/resourceGroups/\\{resourceGroupName\\}/providers/Microsoft.ServiceFabric/clusters/\\{clusterName\\}/applications/\\{applicationName\\}/services' has methods for the following verbs: get */\n (\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services\",\n subscriptionId: string,\n resourceGroupName: string,\n clusterName: string,\n applicationName: string\n ): ServicesList;\n}\n\nexport type ServiceFabricClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
export const apiVersionPolicyName = "CustomizedApiVersionPolicy";
|
|
4
|
+
/**
|
|
5
|
+
* Creates a policy that sets the apiVersion as a query parameter on every request
|
|
6
|
+
* @param options - Client options
|
|
7
|
+
* @returns Pipeline policy that sets the apiVersion as a query parameter on every request
|
|
8
|
+
*/
|
|
9
|
+
export function customizedApiVersionPolicy(options) {
|
|
10
|
+
return {
|
|
11
|
+
name: apiVersionPolicyName,
|
|
12
|
+
sendRequest: (req, next) => {
|
|
13
|
+
if (options.apiVersion) {
|
|
14
|
+
const url = new URL(req.url);
|
|
15
|
+
// add or replace the existing api-version with client one
|
|
16
|
+
url.searchParams.set("api-version", options.apiVersion);
|
|
17
|
+
req.url = url.toString();
|
|
18
|
+
}
|
|
19
|
+
return next(req);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=customizedApiVersionPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customizedApiVersionPolicy.js","sourceRoot":"","sources":["../../src/customizedApiVersionPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAsB;IAC/D,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,IAAI,OAAO,CAAC,UAAU,EAAE;gBACtB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC7B,0DAA0D;gBAC1D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;gBACxD,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC1B;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport { PipelinePolicy } from \"@azure/core-rest-pipeline\";\n\nexport const apiVersionPolicyName = \"CustomizedApiVersionPolicy\";\n\n/**\n * Creates a policy that sets the apiVersion as a query parameter on every request\n * @param options - Client options\n * @returns Pipeline policy that sets the apiVersion as a query parameter on every request\n */\nexport function customizedApiVersionPolicy(options: ClientOptions): PipelinePolicy {\n return {\n name: apiVersionPolicyName,\n sendRequest: (req, next) => {\n if (options.apiVersion) {\n const url = new URL(req.url);\n // add or replace the existing api-version with client one\n url.searchParams.set(\"api-version\", options.apiVersion);\n req.url = url.toString();\n }\n\n return next(req);\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
import ServiceFabricClient from "./serviceFabricClient";
|
|
4
|
+
export * from "./serviceFabricClient";
|
|
5
|
+
export * from "./parameters";
|
|
6
|
+
export * from "./responses";
|
|
7
|
+
export * from "./clientDefinitions";
|
|
8
|
+
export * from "./isUnexpected";
|
|
9
|
+
export * from "./models";
|
|
10
|
+
export * from "./outputModels";
|
|
11
|
+
export * from "./paginateHelper";
|
|
12
|
+
export * from "./pollingHelper";
|
|
13
|
+
export default ServiceFabricClient;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|