@azure-rest/defender-easm 1.0.0-beta.1 → 1.0.0-beta.3
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 +20 -0
- package/LICENSE +21 -0
- package/README.md +5 -9
- package/dist/browser/clientDefinitions.d.ts +141 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/easmClient.d.ts +16 -0
- package/dist/browser/easmClient.d.ts.map +1 -0
- package/dist/browser/easmClient.js +45 -0
- package/dist/browser/easmClient.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +13 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +28 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/isUnexpected.js +5 -6
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/logger.js +1 -1
- package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
- package/dist/browser/models.d.ts +144 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +1046 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/paginateHelper.js +70 -3
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +141 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/responses.d.ts +365 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +141 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/easmClient.d.ts +16 -0
- package/dist/commonjs/easmClient.d.ts.map +1 -0
- package/dist/commonjs/easmClient.js +48 -0
- package/dist/commonjs/easmClient.js.map +1 -0
- package/dist/commonjs/index.d.ts +11 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +28 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +97 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +144 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +1046 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +140 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +141 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/responses.d.ts +365 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/clientDefinitions.d.ts +141 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/easmClient.d.ts +16 -0
- package/dist/esm/easmClient.d.ts.map +1 -0
- package/dist/esm/easmClient.js +45 -0
- package/dist/esm/easmClient.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +28 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +94 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +144 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +1046 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +137 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +141 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/responses.d.ts +365 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +141 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/easmClient.d.ts +16 -0
- package/dist/react-native/easmClient.d.ts.map +1 -0
- package/dist/react-native/easmClient.js +45 -0
- package/dist/react-native/easmClient.js.map +1 -0
- package/dist/react-native/index.d.ts +11 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +13 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +28 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +94 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +144 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +1046 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +137 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +141 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/responses.d.ts +365 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +100 -97
- package/review/{defender-easm.api.md → defender-easm-node.api.md} +151 -61
- package/dist/index.js +0 -213
- package/dist/index.js.map +0 -1
- package/dist-esm/src/clientDefinitions.js +0 -4
- package/dist-esm/src/clientDefinitions.js.map +0 -1
- package/dist-esm/src/easm.js +0 -33
- package/dist-esm/src/easm.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/isUnexpected.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/src/outputModels.js +0 -4
- package/dist-esm/src/outputModels.js.map +0 -1
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/types/defender-easm.d.ts +0 -2105
package/dist/index.js
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var coreClient = require('@azure-rest/core-client');
|
|
6
|
-
var logger$1 = require('@azure/logger');
|
|
7
|
-
var corePaging = require('@azure/core-paging');
|
|
8
|
-
|
|
9
|
-
// Copyright (c) Microsoft Corporation.
|
|
10
|
-
// Licensed under the MIT license.
|
|
11
|
-
const logger = logger$1.createClientLogger("defender-easm");
|
|
12
|
-
|
|
13
|
-
// Copyright (c) Microsoft Corporation.
|
|
14
|
-
// Licensed under the MIT license.
|
|
15
|
-
/**
|
|
16
|
-
* Initialize a new instance of `EasmClient`
|
|
17
|
-
* @param endpoint - The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com
|
|
18
|
-
* @param subscriptionId - The ID of the target subscription.
|
|
19
|
-
* @param resourceGroupName - The name of the Resource Group.
|
|
20
|
-
* @param workspaceName - The name of the Workspace.
|
|
21
|
-
* @param credentials - uniquely identify client credential
|
|
22
|
-
* @param options - the parameter for all optional parameters
|
|
23
|
-
*/
|
|
24
|
-
function createClient(endpoint, subscriptionId, resourceGroupName, workspaceName, credentials, options = {}) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f;
|
|
26
|
-
const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/workspaces/${workspaceName}`;
|
|
27
|
-
options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2023-03-01-preview";
|
|
28
|
-
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
29
|
-
scopes: (_d = (_c = options.credentials) === null || _c === void 0 ? void 0 : _c.scopes) !== null && _d !== void 0 ? _d : ["https://easm.defender.microsoft.com/.default"],
|
|
30
|
-
} });
|
|
31
|
-
const userAgentInfo = `azsdk-js-defender-easm-rest/1.0.0-beta.1`;
|
|
32
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
33
|
-
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
34
|
-
: `${userAgentInfo}`;
|
|
35
|
-
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
36
|
-
userAgentPrefix,
|
|
37
|
-
}, loggingOptions: {
|
|
38
|
-
logger: (_f = (_e = options.loggingOptions) === null || _e === void 0 ? void 0 : _e.logger) !== null && _f !== void 0 ? _f : logger.info,
|
|
39
|
-
} });
|
|
40
|
-
const client = coreClient.getClient(baseUrl, credentials, options);
|
|
41
|
-
return client;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Copyright (c) Microsoft Corporation.
|
|
45
|
-
// Licensed under the MIT license.
|
|
46
|
-
const responseMap = {
|
|
47
|
-
"GET /assets": ["200"],
|
|
48
|
-
"POST /assets": ["200"],
|
|
49
|
-
"GET /assets/{assetId}": ["200"],
|
|
50
|
-
"GET /dataConnections": ["200"],
|
|
51
|
-
"POST /dataConnections:validate": ["200"],
|
|
52
|
-
"GET /dataConnections/{dataConnectionName}": ["200"],
|
|
53
|
-
"PUT /dataConnections/{dataConnectionName}": ["200"],
|
|
54
|
-
"DELETE /dataConnections/{dataConnectionName}": ["204"],
|
|
55
|
-
"GET /discoGroups": ["200"],
|
|
56
|
-
"POST /discoGroups:validate": ["200"],
|
|
57
|
-
"GET /discoGroups/{groupName}": ["200"],
|
|
58
|
-
"PUT /discoGroups/{groupName}": ["200"],
|
|
59
|
-
"POST /discoGroups/{groupName}:run": ["204"],
|
|
60
|
-
"GET /discoGroups/{groupName}/runs": ["200"],
|
|
61
|
-
"GET /discoTemplates": ["200"],
|
|
62
|
-
"GET /discoTemplates/{templateId}": ["200"],
|
|
63
|
-
"POST /reports/assets:getBillable": ["200"],
|
|
64
|
-
"POST /reports/assets:getSnapshot": ["200"],
|
|
65
|
-
"POST /reports/assets:getSummary": ["200"],
|
|
66
|
-
"GET /savedFilters": ["200"],
|
|
67
|
-
"GET /savedFilters/{filterName}": ["200"],
|
|
68
|
-
"PUT /savedFilters/{filterName}": ["200"],
|
|
69
|
-
"DELETE /savedFilters/{filterName}": ["204"],
|
|
70
|
-
"GET /tasks": ["200"],
|
|
71
|
-
"GET /tasks/{taskId}": ["200"],
|
|
72
|
-
"POST /tasks/{taskId}:cancel": ["200"],
|
|
73
|
-
};
|
|
74
|
-
function isUnexpected(response) {
|
|
75
|
-
const lroOriginal = response.headers["x-ms-original-url"];
|
|
76
|
-
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
77
|
-
const method = response.request.method;
|
|
78
|
-
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
79
|
-
if (!pathDetails) {
|
|
80
|
-
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
81
|
-
}
|
|
82
|
-
return !pathDetails.includes(response.status);
|
|
83
|
-
}
|
|
84
|
-
function getParametrizedPathSuccess(method, path) {
|
|
85
|
-
var _a, _b, _c, _d;
|
|
86
|
-
const pathParts = path.split("/");
|
|
87
|
-
// Traverse list to match the longest candidate
|
|
88
|
-
// matchedLen: the length of candidate path
|
|
89
|
-
// matchedValue: the matched status code array
|
|
90
|
-
let matchedLen = -1, matchedValue = [];
|
|
91
|
-
// Iterate the responseMap to find a match
|
|
92
|
-
for (const [key, value] of Object.entries(responseMap)) {
|
|
93
|
-
// Extracting the path from the map key which is in format
|
|
94
|
-
// GET /path/foo
|
|
95
|
-
if (!key.startsWith(method)) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const candidatePath = getPathFromMapKey(key);
|
|
99
|
-
// Get each part of the url path
|
|
100
|
-
const candidateParts = candidatePath.split("/");
|
|
101
|
-
// track if we have found a match to return the values found.
|
|
102
|
-
let found = true;
|
|
103
|
-
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
104
|
-
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
105
|
-
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
106
|
-
// If the current part of the candidate is a "template" part
|
|
107
|
-
// Try to use the suffix of pattern to match the path
|
|
108
|
-
// {guid} ==> $
|
|
109
|
-
// {guid}:export ==> :export$
|
|
110
|
-
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
111
|
-
if (!isMatched) {
|
|
112
|
-
found = false;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
// If the candidate part is not a template and
|
|
118
|
-
// the parts don't match mark the candidate as not found
|
|
119
|
-
// to move on with the next candidate path.
|
|
120
|
-
if (candidateParts[i] !== pathParts[j]) {
|
|
121
|
-
found = false;
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// We finished evaluating the current candidate parts
|
|
126
|
-
// Update the matched value if and only if we found the longer pattern
|
|
127
|
-
if (found && candidatePath.length > matchedLen) {
|
|
128
|
-
matchedLen = candidatePath.length;
|
|
129
|
-
matchedValue = value;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return matchedValue;
|
|
133
|
-
}
|
|
134
|
-
function getPathFromMapKey(mapKey) {
|
|
135
|
-
const pathStart = mapKey.indexOf("/");
|
|
136
|
-
return mapKey.slice(pathStart);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Copyright (c) Microsoft Corporation.
|
|
140
|
-
// Licensed under the MIT license.
|
|
141
|
-
/**
|
|
142
|
-
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
143
|
-
* @param client - Client to use for sending the next page requests
|
|
144
|
-
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
145
|
-
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
146
|
-
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
147
|
-
*/
|
|
148
|
-
function paginate(client, initialResponse, options = {}) {
|
|
149
|
-
let firstRun = true;
|
|
150
|
-
const itemName = "value";
|
|
151
|
-
const nextLinkName = "nextLink";
|
|
152
|
-
const { customGetPage } = options;
|
|
153
|
-
const pagedResult = {
|
|
154
|
-
firstPageLink: "",
|
|
155
|
-
getPage: typeof customGetPage === "function"
|
|
156
|
-
? customGetPage
|
|
157
|
-
: async (pageLink) => {
|
|
158
|
-
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
|
|
159
|
-
firstRun = false;
|
|
160
|
-
checkPagingRequest(result);
|
|
161
|
-
const nextLink = getNextLink(result.body, nextLinkName);
|
|
162
|
-
const values = getElements(result.body, itemName);
|
|
163
|
-
return {
|
|
164
|
-
page: values,
|
|
165
|
-
nextPageLink: nextLink,
|
|
166
|
-
};
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
return corePaging.getPagedAsyncIterator(pagedResult);
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Gets for the value of nextLink in the body
|
|
173
|
-
*/
|
|
174
|
-
function getNextLink(body, nextLinkName) {
|
|
175
|
-
if (!nextLinkName) {
|
|
176
|
-
return undefined;
|
|
177
|
-
}
|
|
178
|
-
const nextLink = body[nextLinkName];
|
|
179
|
-
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
180
|
-
throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
|
|
181
|
-
}
|
|
182
|
-
return nextLink;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Gets the elements of the current request in the body.
|
|
186
|
-
*/
|
|
187
|
-
function getElements(body, itemName) {
|
|
188
|
-
const value = body[itemName];
|
|
189
|
-
// value has to be an array according to the x-ms-pageable extension.
|
|
190
|
-
// The fact that this must be an array is used above to calculate the
|
|
191
|
-
// type of elements in the page in PaginateReturn
|
|
192
|
-
if (!Array.isArray(value)) {
|
|
193
|
-
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
194
|
-
}
|
|
195
|
-
return value !== null && value !== void 0 ? value : [];
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Checks if a request failed
|
|
199
|
-
*/
|
|
200
|
-
function checkPagingRequest(response) {
|
|
201
|
-
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
|
|
202
|
-
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
203
|
-
throw coreClient.createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Copyright (c) Microsoft Corporation.
|
|
208
|
-
// Licensed under the MIT license.
|
|
209
|
-
|
|
210
|
-
exports.default = createClient;
|
|
211
|
-
exports.isUnexpected = isUnexpected;
|
|
212
|
-
exports.paginate = paginate;
|
|
213
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/logger.ts","../src/easm.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"defender-easm\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { EasmClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `EasmClient`\n * @param endpoint - The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com\n * @param subscriptionId - The ID of the target subscription.\n * @param resourceGroupName - The name of the Resource Group.\n * @param workspaceName - The name of the Workspace.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n subscriptionId: string,\n resourceGroupName: string,\n workspaceName: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): EasmClient {\n const baseUrl =\n options.baseUrl ??\n `${endpoint}/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/workspaces/${workspaceName}`;\n options.apiVersion = options.apiVersion ?? \"2023-03-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://easm.defender.microsoft.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-defender-easm-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 loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as EasmClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ListAssetResource200Response,\n ListAssetResourceDefaultResponse,\n UpdateAssets200Response,\n UpdateAssetsDefaultResponse,\n GetAssetResource200Response,\n GetAssetResourceDefaultResponse,\n ListDataConnection200Response,\n ListDataConnectionDefaultResponse,\n ValidateDataConnection200Response,\n ValidateDataConnectionDefaultResponse,\n GetDataConnection200Response,\n GetDataConnectionDefaultResponse,\n CreateOrReplaceDataConnection200Response,\n CreateOrReplaceDataConnectionDefaultResponse,\n DeleteDataConnection204Response,\n DeleteDataConnectionDefaultResponse,\n ListDiscoGroup200Response,\n ListDiscoGroupDefaultResponse,\n ValidateDiscoGroup200Response,\n ValidateDiscoGroupDefaultResponse,\n GetDiscoGroup200Response,\n GetDiscoGroupDefaultResponse,\n CreateOrReplaceDiscoGroup200Response,\n CreateOrReplaceDiscoGroupDefaultResponse,\n RunDiscoGroup204Response,\n RunDiscoGroupDefaultResponse,\n ListRuns200Response,\n ListRunsDefaultResponse,\n ListDiscoTemplate200Response,\n ListDiscoTemplateDefaultResponse,\n GetDiscoTemplate200Response,\n GetDiscoTemplateDefaultResponse,\n GetBillable200Response,\n GetBillableDefaultResponse,\n GetSnapshot200Response,\n GetSnapshotDefaultResponse,\n GetSummary200Response,\n GetSummaryDefaultResponse,\n ListSavedFilter200Response,\n ListSavedFilterDefaultResponse,\n GetSavedFilter200Response,\n GetSavedFilterDefaultResponse,\n CreateOrReplaceSavedFilter200Response,\n CreateOrReplaceSavedFilterDefaultResponse,\n DeleteSavedFilter204Response,\n DeleteSavedFilterDefaultResponse,\n ListTask200Response,\n ListTaskDefaultResponse,\n GetTask200Response,\n GetTaskDefaultResponse,\n CancelTask200Response,\n CancelTaskDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /assets\": [\"200\"],\n \"POST /assets\": [\"200\"],\n \"GET /assets/{assetId}\": [\"200\"],\n \"GET /dataConnections\": [\"200\"],\n \"POST /dataConnections:validate\": [\"200\"],\n \"GET /dataConnections/{dataConnectionName}\": [\"200\"],\n \"PUT /dataConnections/{dataConnectionName}\": [\"200\"],\n \"DELETE /dataConnections/{dataConnectionName}\": [\"204\"],\n \"GET /discoGroups\": [\"200\"],\n \"POST /discoGroups:validate\": [\"200\"],\n \"GET /discoGroups/{groupName}\": [\"200\"],\n \"PUT /discoGroups/{groupName}\": [\"200\"],\n \"POST /discoGroups/{groupName}:run\": [\"204\"],\n \"GET /discoGroups/{groupName}/runs\": [\"200\"],\n \"GET /discoTemplates\": [\"200\"],\n \"GET /discoTemplates/{templateId}\": [\"200\"],\n \"POST /reports/assets:getBillable\": [\"200\"],\n \"POST /reports/assets:getSnapshot\": [\"200\"],\n \"POST /reports/assets:getSummary\": [\"200\"],\n \"GET /savedFilters\": [\"200\"],\n \"GET /savedFilters/{filterName}\": [\"200\"],\n \"PUT /savedFilters/{filterName}\": [\"200\"],\n \"DELETE /savedFilters/{filterName}\": [\"204\"],\n \"GET /tasks\": [\"200\"],\n \"GET /tasks/{taskId}\": [\"200\"],\n \"POST /tasks/{taskId}:cancel\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListAssetResource200Response | ListAssetResourceDefaultResponse\n): response is ListAssetResourceDefaultResponse;\nexport function isUnexpected(\n response: UpdateAssets200Response | UpdateAssetsDefaultResponse\n): response is UpdateAssetsDefaultResponse;\nexport function isUnexpected(\n response: GetAssetResource200Response | GetAssetResourceDefaultResponse\n): response is GetAssetResourceDefaultResponse;\nexport function isUnexpected(\n response: ListDataConnection200Response | ListDataConnectionDefaultResponse\n): response is ListDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: ValidateDataConnection200Response | ValidateDataConnectionDefaultResponse\n): response is ValidateDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: GetDataConnection200Response | GetDataConnectionDefaultResponse\n): response is GetDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceDataConnection200Response | CreateOrReplaceDataConnectionDefaultResponse\n): response is CreateOrReplaceDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: DeleteDataConnection204Response | DeleteDataConnectionDefaultResponse\n): response is DeleteDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: ListDiscoGroup200Response | ListDiscoGroupDefaultResponse\n): response is ListDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: ValidateDiscoGroup200Response | ValidateDiscoGroupDefaultResponse\n): response is ValidateDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: GetDiscoGroup200Response | GetDiscoGroupDefaultResponse\n): response is GetDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceDiscoGroup200Response | CreateOrReplaceDiscoGroupDefaultResponse\n): response is CreateOrReplaceDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: RunDiscoGroup204Response | RunDiscoGroupDefaultResponse\n): response is RunDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: ListRuns200Response | ListRunsDefaultResponse\n): response is ListRunsDefaultResponse;\nexport function isUnexpected(\n response: ListDiscoTemplate200Response | ListDiscoTemplateDefaultResponse\n): response is ListDiscoTemplateDefaultResponse;\nexport function isUnexpected(\n response: GetDiscoTemplate200Response | GetDiscoTemplateDefaultResponse\n): response is GetDiscoTemplateDefaultResponse;\nexport function isUnexpected(\n response: GetBillable200Response | GetBillableDefaultResponse\n): response is GetBillableDefaultResponse;\nexport function isUnexpected(\n response: GetSnapshot200Response | GetSnapshotDefaultResponse\n): response is GetSnapshotDefaultResponse;\nexport function isUnexpected(\n response: GetSummary200Response | GetSummaryDefaultResponse\n): response is GetSummaryDefaultResponse;\nexport function isUnexpected(\n response: ListSavedFilter200Response | ListSavedFilterDefaultResponse\n): response is ListSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: GetSavedFilter200Response | GetSavedFilterDefaultResponse\n): response is GetSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceSavedFilter200Response | CreateOrReplaceSavedFilterDefaultResponse\n): response is CreateOrReplaceSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: DeleteSavedFilter204Response | DeleteSavedFilterDefaultResponse\n): response is DeleteSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: ListTask200Response | ListTaskDefaultResponse\n): response is ListTaskDefaultResponse;\nexport function isUnexpected(\n response: GetTask200Response | GetTaskDefaultResponse\n): response is GetTaskDefaultResponse;\nexport function isUnexpected(\n response: CancelTask200Response | CancelTaskDefaultResponse\n): response is CancelTaskDefaultResponse;\nexport function isUnexpected(\n response:\n | ListAssetResource200Response\n | ListAssetResourceDefaultResponse\n | UpdateAssets200Response\n | UpdateAssetsDefaultResponse\n | GetAssetResource200Response\n | GetAssetResourceDefaultResponse\n | ListDataConnection200Response\n | ListDataConnectionDefaultResponse\n | ValidateDataConnection200Response\n | ValidateDataConnectionDefaultResponse\n | GetDataConnection200Response\n | GetDataConnectionDefaultResponse\n | CreateOrReplaceDataConnection200Response\n | CreateOrReplaceDataConnectionDefaultResponse\n | DeleteDataConnection204Response\n | DeleteDataConnectionDefaultResponse\n | ListDiscoGroup200Response\n | ListDiscoGroupDefaultResponse\n | ValidateDiscoGroup200Response\n | ValidateDiscoGroupDefaultResponse\n | GetDiscoGroup200Response\n | GetDiscoGroupDefaultResponse\n | CreateOrReplaceDiscoGroup200Response\n | CreateOrReplaceDiscoGroupDefaultResponse\n | RunDiscoGroup204Response\n | RunDiscoGroupDefaultResponse\n | ListRuns200Response\n | ListRunsDefaultResponse\n | ListDiscoTemplate200Response\n | ListDiscoTemplateDefaultResponse\n | GetDiscoTemplate200Response\n | GetDiscoTemplateDefaultResponse\n | GetBillable200Response\n | GetBillableDefaultResponse\n | GetSnapshot200Response\n | GetSnapshotDefaultResponse\n | GetSummary200Response\n | GetSummaryDefaultResponse\n | ListSavedFilter200Response\n | ListSavedFilterDefaultResponse\n | GetSavedFilter200Response\n | GetSavedFilterDefaultResponse\n | CreateOrReplaceSavedFilter200Response\n | CreateOrReplaceSavedFilterDefaultResponse\n | DeleteSavedFilter204Response\n | DeleteSavedFilterDefaultResponse\n | ListTask200Response\n | ListTaskDefaultResponse\n | GetTask200Response\n | GetTaskDefaultResponse\n | CancelTask200Response\n | CancelTaskDefaultResponse\n): response is\n | ListAssetResourceDefaultResponse\n | UpdateAssetsDefaultResponse\n | GetAssetResourceDefaultResponse\n | ListDataConnectionDefaultResponse\n | ValidateDataConnectionDefaultResponse\n | GetDataConnectionDefaultResponse\n | CreateOrReplaceDataConnectionDefaultResponse\n | DeleteDataConnectionDefaultResponse\n | ListDiscoGroupDefaultResponse\n | ValidateDiscoGroupDefaultResponse\n | GetDiscoGroupDefaultResponse\n | CreateOrReplaceDiscoGroupDefaultResponse\n | RunDiscoGroupDefaultResponse\n | ListRunsDefaultResponse\n | ListDiscoTemplateDefaultResponse\n | GetDiscoTemplateDefaultResponse\n | GetBillableDefaultResponse\n | GetSnapshotDefaultResponse\n | GetSummaryDefaultResponse\n | ListSavedFilterDefaultResponse\n | GetSavedFilterDefaultResponse\n | CreateOrReplaceSavedFilterDefaultResponse\n | DeleteSavedFilterDefaultResponse\n | ListTaskDefaultResponse\n | GetTaskDefaultResponse\n | CancelTaskDefaultResponse {\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 = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\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 if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\"\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\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[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\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 { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } 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 Easm from \"./easm\";\n\nexport * from \"./easm\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default Easm;\n"],"names":["createClientLogger","getClient","getPagedAsyncIterator","createRestError"],"mappings":";;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,eAAe,CAAC;;ACJzD;AACA;AAOA;;;;;;;;AAQG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,cAAsB,EACtB,iBAAyB,EACzB,aAAqB,EACrB,WAA4B,EAC5B,UAAyB,EAAE,EAAA;;AAE3B,IAAA,MAAM,OAAO,GACX,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MACf,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,QAAQ,CAAA,eAAA,EAAkB,cAAc,CAAmB,gBAAA,EAAA,iBAAiB,CAAe,YAAA,EAAA,aAAa,EAAE,CAAC;IAChH,OAAO,CAAC,UAAU,GAAG,C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QAAQ,CACT,CAAC;AACH,KAAA;AACH;;AClIA;AACA;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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 ListAssetResourceParameters,\n UpdateAssetsParameters,\n GetAssetResourceParameters,\n ListDataConnectionParameters,\n ValidateDataConnectionParameters,\n GetDataConnectionParameters,\n CreateOrReplaceDataConnectionParameters,\n DeleteDataConnectionParameters,\n ListDiscoGroupParameters,\n ValidateDiscoGroupParameters,\n GetDiscoGroupParameters,\n CreateOrReplaceDiscoGroupParameters,\n RunDiscoGroupParameters,\n ListRunsParameters,\n ListDiscoTemplateParameters,\n GetDiscoTemplateParameters,\n GetBillableParameters,\n GetSnapshotParameters,\n GetSummaryParameters,\n ListSavedFilterParameters,\n GetSavedFilterParameters,\n CreateOrReplaceSavedFilterParameters,\n DeleteSavedFilterParameters,\n ListTaskParameters,\n GetTaskParameters,\n CancelTaskParameters,\n} from \"./parameters\";\nimport {\n ListAssetResource200Response,\n ListAssetResourceDefaultResponse,\n UpdateAssets200Response,\n UpdateAssetsDefaultResponse,\n GetAssetResource200Response,\n GetAssetResourceDefaultResponse,\n ListDataConnection200Response,\n ListDataConnectionDefaultResponse,\n ValidateDataConnection200Response,\n ValidateDataConnectionDefaultResponse,\n GetDataConnection200Response,\n GetDataConnectionDefaultResponse,\n CreateOrReplaceDataConnection200Response,\n CreateOrReplaceDataConnectionDefaultResponse,\n DeleteDataConnection204Response,\n DeleteDataConnectionDefaultResponse,\n ListDiscoGroup200Response,\n ListDiscoGroupDefaultResponse,\n ValidateDiscoGroup200Response,\n ValidateDiscoGroupDefaultResponse,\n GetDiscoGroup200Response,\n GetDiscoGroupDefaultResponse,\n CreateOrReplaceDiscoGroup200Response,\n CreateOrReplaceDiscoGroupDefaultResponse,\n RunDiscoGroup204Response,\n RunDiscoGroupDefaultResponse,\n ListRuns200Response,\n ListRunsDefaultResponse,\n ListDiscoTemplate200Response,\n ListDiscoTemplateDefaultResponse,\n GetDiscoTemplate200Response,\n GetDiscoTemplateDefaultResponse,\n GetBillable200Response,\n GetBillableDefaultResponse,\n GetSnapshot200Response,\n GetSnapshotDefaultResponse,\n GetSummary200Response,\n GetSummaryDefaultResponse,\n ListSavedFilter200Response,\n ListSavedFilterDefaultResponse,\n GetSavedFilter200Response,\n GetSavedFilterDefaultResponse,\n CreateOrReplaceSavedFilter200Response,\n CreateOrReplaceSavedFilterDefaultResponse,\n DeleteSavedFilter204Response,\n DeleteSavedFilterDefaultResponse,\n ListTask200Response,\n ListTaskDefaultResponse,\n GetTask200Response,\n GetTaskDefaultResponse,\n CancelTask200Response,\n CancelTaskDefaultResponse,\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ListAssetResource {\n /** Retrieve a list of assets for the provided search parameters. */\n get(\n options?: ListAssetResourceParameters\n ): StreamableMethod<ListAssetResource200Response | ListAssetResourceDefaultResponse>;\n /** Update labels on assets matching the provided filter. */\n post(\n options: UpdateAssetsParameters\n ): StreamableMethod<UpdateAssets200Response | UpdateAssetsDefaultResponse>;\n}\n\nexport interface GetAssetResource {\n /** Retrieve an asset by assetId. */\n get(\n options?: GetAssetResourceParameters\n ): StreamableMethod<GetAssetResource200Response | GetAssetResourceDefaultResponse>;\n}\n\nexport interface ListDataConnection {\n /** Retrieve a list of data connections. */\n get(\n options?: ListDataConnectionParameters\n ): StreamableMethod<ListDataConnection200Response | ListDataConnectionDefaultResponse>;\n}\n\nexport interface ValidateDataConnection {\n /** Validate a data connection with a given dataConnectionName. */\n post(\n options?: ValidateDataConnectionParameters\n ): StreamableMethod<ValidateDataConnection200Response | ValidateDataConnectionDefaultResponse>;\n}\n\nexport interface GetDataConnection {\n /** Retrieve a data connection with a given dataConnectionName. */\n get(\n options?: GetDataConnectionParameters\n ): StreamableMethod<GetDataConnection200Response | GetDataConnectionDefaultResponse>;\n /** Create or replace a data connection with a given dataConnectionName. */\n put(\n options?: CreateOrReplaceDataConnectionParameters\n ): StreamableMethod<\n CreateOrReplaceDataConnection200Response | CreateOrReplaceDataConnectionDefaultResponse\n >;\n /** Delete a data connection with a given dataConnectionName. */\n delete(\n options?: DeleteDataConnectionParameters\n ): StreamableMethod<DeleteDataConnection204Response | DeleteDataConnectionDefaultResponse>;\n}\n\nexport interface ListDiscoGroup {\n /** Retrieve a list of discovery group for the provided search parameters. */\n get(\n options?: ListDiscoGroupParameters\n ): StreamableMethod<ListDiscoGroup200Response | ListDiscoGroupDefaultResponse>;\n}\n\nexport interface ValidateDiscoGroup {\n /** Validate a discovery group with a given groupName. */\n post(\n options?: ValidateDiscoGroupParameters\n ): StreamableMethod<ValidateDiscoGroup200Response | ValidateDiscoGroupDefaultResponse>;\n}\n\nexport interface GetDiscoGroup {\n /** Retrieve a discovery group with a given groupName. */\n get(\n options?: GetDiscoGroupParameters\n ): StreamableMethod<GetDiscoGroup200Response | GetDiscoGroupDefaultResponse>;\n /** Create a discovery group with a given groupName. */\n put(\n options?: CreateOrReplaceDiscoGroupParameters\n ): StreamableMethod<\n CreateOrReplaceDiscoGroup200Response | CreateOrReplaceDiscoGroupDefaultResponse\n >;\n}\n\nexport interface RunDiscoGroup {\n /** Run a discovery group with a given groupName. */\n post(\n options?: RunDiscoGroupParameters\n ): StreamableMethod<RunDiscoGroup204Response | RunDiscoGroupDefaultResponse>;\n}\n\nexport interface ListRuns {\n /** Retrieve a collection of discovery run results for a discovery group with a given groupName. */\n get(\n options?: ListRunsParameters\n ): StreamableMethod<ListRuns200Response | ListRunsDefaultResponse>;\n}\n\nexport interface ListDiscoTemplate {\n /** Retrieve a list of disco templates for the provided search parameters. */\n get(\n options?: ListDiscoTemplateParameters\n ): StreamableMethod<ListDiscoTemplate200Response | ListDiscoTemplateDefaultResponse>;\n}\n\nexport interface GetDiscoTemplate {\n /** Retrieve a disco template with a given templateId. */\n get(\n options?: GetDiscoTemplateParameters\n ): StreamableMethod<GetDiscoTemplate200Response | GetDiscoTemplateDefaultResponse>;\n}\n\nexport interface GetBillable {\n /** Get billable assets summary for the workspace. */\n post(\n options?: GetBillableParameters\n ): StreamableMethod<GetBillable200Response | GetBillableDefaultResponse>;\n}\n\nexport interface GetSnapshot {\n /** Get the most recent snapshot of asset summary values for the snapshot request. */\n post(\n options?: GetSnapshotParameters\n ): StreamableMethod<GetSnapshot200Response | GetSnapshotDefaultResponse>;\n}\n\nexport interface GetSummary {\n /** Get asset summary details for the summary request. */\n post(\n options?: GetSummaryParameters\n ): StreamableMethod<GetSummary200Response | GetSummaryDefaultResponse>;\n}\n\nexport interface ListSavedFilter {\n /** Retrieve a list of saved filters for the provided search parameters. */\n get(\n options?: ListSavedFilterParameters\n ): StreamableMethod<ListSavedFilter200Response | ListSavedFilterDefaultResponse>;\n}\n\nexport interface GetSavedFilter {\n /** Retrieve a saved filter by filterName. */\n get(\n options?: GetSavedFilterParameters\n ): StreamableMethod<GetSavedFilter200Response | GetSavedFilterDefaultResponse>;\n /** Create or replace a saved filter with a given filterName. */\n put(\n options?: CreateOrReplaceSavedFilterParameters\n ): StreamableMethod<\n CreateOrReplaceSavedFilter200Response | CreateOrReplaceSavedFilterDefaultResponse\n >;\n /** Delete a saved filter with a given filterName. */\n delete(\n options?: DeleteSavedFilterParameters\n ): StreamableMethod<DeleteSavedFilter204Response | DeleteSavedFilterDefaultResponse>;\n}\n\nexport interface ListTask {\n /** Retrieve a list of tasks for the provided search parameters. */\n get(\n options?: ListTaskParameters\n ): StreamableMethod<ListTask200Response | ListTaskDefaultResponse>;\n}\n\nexport interface GetTask {\n /** Retrieve a task by taskId. */\n get(options?: GetTaskParameters): StreamableMethod<GetTask200Response | GetTaskDefaultResponse>;\n}\n\nexport interface CancelTask {\n /** Cancel a task by taskId. */\n post(\n options?: CancelTaskParameters\n ): StreamableMethod<CancelTask200Response | CancelTaskDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/assets' has methods for the following verbs: get, post */\n (path: \"/assets\"): ListAssetResource;\n /** Resource for '/assets/\\{assetId\\}' has methods for the following verbs: get */\n (path: \"/assets/{assetId}\", assetId: string): GetAssetResource;\n /** Resource for '/dataConnections' has methods for the following verbs: get */\n (path: \"/dataConnections\"): ListDataConnection;\n /** Resource for '/dataConnections:validate' has methods for the following verbs: post */\n (path: \"/dataConnections:validate\"): ValidateDataConnection;\n /** Resource for '/dataConnections/\\{dataConnectionName\\}' has methods for the following verbs: get, put, delete */\n (path: \"/dataConnections/{dataConnectionName}\", dataConnectionName: string): GetDataConnection;\n /** Resource for '/discoGroups' has methods for the following verbs: get */\n (path: \"/discoGroups\"): ListDiscoGroup;\n /** Resource for '/discoGroups:validate' has methods for the following verbs: post */\n (path: \"/discoGroups:validate\"): ValidateDiscoGroup;\n /** Resource for '/discoGroups/\\{groupName\\}' has methods for the following verbs: get, put */\n (path: \"/discoGroups/{groupName}\", groupName: string): GetDiscoGroup;\n /** Resource for '/discoGroups/\\{groupName\\}:run' has methods for the following verbs: post */\n (path: \"/discoGroups/{groupName}:run\", groupName: string): RunDiscoGroup;\n /** Resource for '/discoGroups/\\{groupName\\}/runs' has methods for the following verbs: get */\n (path: \"/discoGroups/{groupName}/runs\", groupName: string): ListRuns;\n /** Resource for '/discoTemplates' has methods for the following verbs: get */\n (path: \"/discoTemplates\"): ListDiscoTemplate;\n /** Resource for '/discoTemplates/\\{templateId\\}' has methods for the following verbs: get */\n (path: \"/discoTemplates/{templateId}\", templateId: string): GetDiscoTemplate;\n /** Resource for '/reports/assets:getBillable' has methods for the following verbs: post */\n (path: \"/reports/assets:getBillable\"): GetBillable;\n /** Resource for '/reports/assets:getSnapshot' has methods for the following verbs: post */\n (path: \"/reports/assets:getSnapshot\"): GetSnapshot;\n /** Resource for '/reports/assets:getSummary' has methods for the following verbs: post */\n (path: \"/reports/assets:getSummary\"): GetSummary;\n /** Resource for '/savedFilters' has methods for the following verbs: get */\n (path: \"/savedFilters\"): ListSavedFilter;\n /** Resource for '/savedFilters/\\{filterName\\}' has methods for the following verbs: get, put, delete */\n (path: \"/savedFilters/{filterName}\", filterName: string): GetSavedFilter;\n /** Resource for '/tasks' has methods for the following verbs: get */\n (path: \"/tasks\"): ListTask;\n /** Resource for '/tasks/\\{taskId\\}' has methods for the following verbs: get */\n (path: \"/tasks/{taskId}\", taskId: string): GetTask;\n /** Resource for '/tasks/\\{taskId\\}:cancel' has methods for the following verbs: post */\n (path: \"/tasks/{taskId}:cancel\", taskId: string): CancelTask;\n}\n\nexport type EasmClient = Client & {\n path: Routes;\n};\n"]}
|
package/dist-esm/src/easm.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { getClient } from "@azure-rest/core-client";
|
|
4
|
-
import { logger } from "./logger";
|
|
5
|
-
/**
|
|
6
|
-
* Initialize a new instance of `EasmClient`
|
|
7
|
-
* @param endpoint - The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com
|
|
8
|
-
* @param subscriptionId - The ID of the target subscription.
|
|
9
|
-
* @param resourceGroupName - The name of the Resource Group.
|
|
10
|
-
* @param workspaceName - The name of the Workspace.
|
|
11
|
-
* @param credentials - uniquely identify client credential
|
|
12
|
-
* @param options - the parameter for all optional parameters
|
|
13
|
-
*/
|
|
14
|
-
export default function createClient(endpoint, subscriptionId, resourceGroupName, workspaceName, credentials, options = {}) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f;
|
|
16
|
-
const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/workspaces/${workspaceName}`;
|
|
17
|
-
options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2023-03-01-preview";
|
|
18
|
-
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
19
|
-
scopes: (_d = (_c = options.credentials) === null || _c === void 0 ? void 0 : _c.scopes) !== null && _d !== void 0 ? _d : ["https://easm.defender.microsoft.com/.default"],
|
|
20
|
-
} });
|
|
21
|
-
const userAgentInfo = `azsdk-js-defender-easm-rest/1.0.0-beta.1`;
|
|
22
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
23
|
-
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
24
|
-
: `${userAgentInfo}`;
|
|
25
|
-
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
26
|
-
userAgentPrefix,
|
|
27
|
-
}, loggingOptions: {
|
|
28
|
-
logger: (_f = (_e = options.loggingOptions) === null || _e === void 0 ? void 0 : _e.logger) !== null && _f !== void 0 ? _f : logger.info,
|
|
29
|
-
} });
|
|
30
|
-
const client = getClient(baseUrl, credentials, options);
|
|
31
|
-
return client;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=easm.js.map
|
package/dist-esm/src/easm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"easm.js","sourceRoot":"","sources":["../../src/easm.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,cAAsB,EACtB,iBAAyB,EACzB,aAAqB,EACrB,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCACf,GAAG,QAAQ,kBAAkB,cAAc,mBAAmB,iBAAiB,eAAe,aAAa,EAAE,CAAC;IAChH,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,oBAAoB,CAAC;IAChE,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,8CAA8C,CAAC;SACxF,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,0CAA0C,CAAC;IACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAe,CAAC;IAEtE,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { EasmClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `EasmClient`\n * @param endpoint - The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com\n * @param subscriptionId - The ID of the target subscription.\n * @param resourceGroupName - The name of the Resource Group.\n * @param workspaceName - The name of the Workspace.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n subscriptionId: string,\n resourceGroupName: string,\n workspaceName: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): EasmClient {\n const baseUrl =\n options.baseUrl ??\n `${endpoint}/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/workspaces/${workspaceName}`;\n options.apiVersion = options.apiVersion ?? \"2023-03-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://easm.defender.microsoft.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-defender-easm-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 loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as EasmClient;\n\n return client;\n}\n"]}
|
package/dist-esm/src/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import Easm from "./easm";
|
|
4
|
-
export * from "./easm";
|
|
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 default Easm;
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,eAAe,IAAI,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport Easm from \"./easm\";\n\nexport * from \"./easm\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default Easm;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyDlC,MAAM,WAAW,GAA6B;IAC5C,aAAa,EAAE,CAAC,KAAK,CAAC;IACtB,cAAc,EAAE,CAAC,KAAK,CAAC;IACvB,uBAAuB,EAAE,CAAC,KAAK,CAAC;IAChC,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,gCAAgC,EAAE,CAAC,KAAK,CAAC;IACzC,2CAA2C,EAAE,CAAC,KAAK,CAAC;IACpD,2CAA2C,EAAE,CAAC,KAAK,CAAC;IACpD,8CAA8C,EAAE,CAAC,KAAK,CAAC;IACvD,kBAAkB,EAAE,CAAC,KAAK,CAAC;IAC3B,4BAA4B,EAAE,CAAC,KAAK,CAAC;IACrC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,mCAAmC,EAAE,CAAC,KAAK,CAAC;IAC5C,mCAAmC,EAAE,CAAC,KAAK,CAAC;IAC5C,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC9B,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,iCAAiC,EAAE,CAAC,KAAK,CAAC;IAC1C,mBAAmB,EAAE,CAAC,KAAK,CAAC;IAC5B,gCAAgC,EAAE,CAAC,KAAK,CAAC;IACzC,gCAAgC,EA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AM;aACP;SACF;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;YAC9C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;SACtB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ListAssetResource200Response,\n ListAssetResourceDefaultResponse,\n UpdateAssets200Response,\n UpdateAssetsDefaultResponse,\n GetAssetResource200Response,\n GetAssetResourceDefaultResponse,\n ListDataConnection200Response,\n ListDataConnectionDefaultResponse,\n ValidateDataConnection200Response,\n ValidateDataConnectionDefaultResponse,\n GetDataConnection200Response,\n GetDataConnectionDefaultResponse,\n CreateOrReplaceDataConnection200Response,\n CreateOrReplaceDataConnectionDefaultResponse,\n DeleteDataConnection204Response,\n DeleteDataConnectionDefaultResponse,\n ListDiscoGroup200Response,\n ListDiscoGroupDefaultResponse,\n ValidateDiscoGroup200Response,\n ValidateDiscoGroupDefaultResponse,\n GetDiscoGroup200Response,\n GetDiscoGroupDefaultResponse,\n CreateOrReplaceDiscoGroup200Response,\n CreateOrReplaceDiscoGroupDefaultResponse,\n RunDiscoGroup204Response,\n RunDiscoGroupDefaultResponse,\n ListRuns200Response,\n ListRunsDefaultResponse,\n ListDiscoTemplate200Response,\n ListDiscoTemplateDefaultResponse,\n GetDiscoTemplate200Response,\n GetDiscoTemplateDefaultResponse,\n GetBillable200Response,\n GetBillableDefaultResponse,\n GetSnapshot200Response,\n GetSnapshotDefaultResponse,\n GetSummary200Response,\n GetSummaryDefaultResponse,\n ListSavedFilter200Response,\n ListSavedFilterDefaultResponse,\n GetSavedFilter200Response,\n GetSavedFilterDefaultResponse,\n CreateOrReplaceSavedFilter200Response,\n CreateOrReplaceSavedFilterDefaultResponse,\n DeleteSavedFilter204Response,\n DeleteSavedFilterDefaultResponse,\n ListTask200Response,\n ListTaskDefaultResponse,\n GetTask200Response,\n GetTaskDefaultResponse,\n CancelTask200Response,\n CancelTaskDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /assets\": [\"200\"],\n \"POST /assets\": [\"200\"],\n \"GET /assets/{assetId}\": [\"200\"],\n \"GET /dataConnections\": [\"200\"],\n \"POST /dataConnections:validate\": [\"200\"],\n \"GET /dataConnections/{dataConnectionName}\": [\"200\"],\n \"PUT /dataConnections/{dataConnectionName}\": [\"200\"],\n \"DELETE /dataConnections/{dataConnectionName}\": [\"204\"],\n \"GET /discoGroups\": [\"200\"],\n \"POST /discoGroups:validate\": [\"200\"],\n \"GET /discoGroups/{groupName}\": [\"200\"],\n \"PUT /discoGroups/{groupName}\": [\"200\"],\n \"POST /discoGroups/{groupName}:run\": [\"204\"],\n \"GET /discoGroups/{groupName}/runs\": [\"200\"],\n \"GET /discoTemplates\": [\"200\"],\n \"GET /discoTemplates/{templateId}\": [\"200\"],\n \"POST /reports/assets:getBillable\": [\"200\"],\n \"POST /reports/assets:getSnapshot\": [\"200\"],\n \"POST /reports/assets:getSummary\": [\"200\"],\n \"GET /savedFilters\": [\"200\"],\n \"GET /savedFilters/{filterName}\": [\"200\"],\n \"PUT /savedFilters/{filterName}\": [\"200\"],\n \"DELETE /savedFilters/{filterName}\": [\"204\"],\n \"GET /tasks\": [\"200\"],\n \"GET /tasks/{taskId}\": [\"200\"],\n \"POST /tasks/{taskId}:cancel\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListAssetResource200Response | ListAssetResourceDefaultResponse\n): response is ListAssetResourceDefaultResponse;\nexport function isUnexpected(\n response: UpdateAssets200Response | UpdateAssetsDefaultResponse\n): response is UpdateAssetsDefaultResponse;\nexport function isUnexpected(\n response: GetAssetResource200Response | GetAssetResourceDefaultResponse\n): response is GetAssetResourceDefaultResponse;\nexport function isUnexpected(\n response: ListDataConnection200Response | ListDataConnectionDefaultResponse\n): response is ListDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: ValidateDataConnection200Response | ValidateDataConnectionDefaultResponse\n): response is ValidateDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: GetDataConnection200Response | GetDataConnectionDefaultResponse\n): response is GetDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceDataConnection200Response | CreateOrReplaceDataConnectionDefaultResponse\n): response is CreateOrReplaceDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: DeleteDataConnection204Response | DeleteDataConnectionDefaultResponse\n): response is DeleteDataConnectionDefaultResponse;\nexport function isUnexpected(\n response: ListDiscoGroup200Response | ListDiscoGroupDefaultResponse\n): response is ListDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: ValidateDiscoGroup200Response | ValidateDiscoGroupDefaultResponse\n): response is ValidateDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: GetDiscoGroup200Response | GetDiscoGroupDefaultResponse\n): response is GetDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceDiscoGroup200Response | CreateOrReplaceDiscoGroupDefaultResponse\n): response is CreateOrReplaceDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: RunDiscoGroup204Response | RunDiscoGroupDefaultResponse\n): response is RunDiscoGroupDefaultResponse;\nexport function isUnexpected(\n response: ListRuns200Response | ListRunsDefaultResponse\n): response is ListRunsDefaultResponse;\nexport function isUnexpected(\n response: ListDiscoTemplate200Response | ListDiscoTemplateDefaultResponse\n): response is ListDiscoTemplateDefaultResponse;\nexport function isUnexpected(\n response: GetDiscoTemplate200Response | GetDiscoTemplateDefaultResponse\n): response is GetDiscoTemplateDefaultResponse;\nexport function isUnexpected(\n response: GetBillable200Response | GetBillableDefaultResponse\n): response is GetBillableDefaultResponse;\nexport function isUnexpected(\n response: GetSnapshot200Response | GetSnapshotDefaultResponse\n): response is GetSnapshotDefaultResponse;\nexport function isUnexpected(\n response: GetSummary200Response | GetSummaryDefaultResponse\n): response is GetSummaryDefaultResponse;\nexport function isUnexpected(\n response: ListSavedFilter200Response | ListSavedFilterDefaultResponse\n): response is ListSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: GetSavedFilter200Response | GetSavedFilterDefaultResponse\n): response is GetSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceSavedFilter200Response | CreateOrReplaceSavedFilterDefaultResponse\n): response is CreateOrReplaceSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: DeleteSavedFilter204Response | DeleteSavedFilterDefaultResponse\n): response is DeleteSavedFilterDefaultResponse;\nexport function isUnexpected(\n response: ListTask200Response | ListTaskDefaultResponse\n): response is ListTaskDefaultResponse;\nexport function isUnexpected(\n response: GetTask200Response | GetTaskDefaultResponse\n): response is GetTaskDefaultResponse;\nexport function isUnexpected(\n response: CancelTask200Response | CancelTaskDefaultResponse\n): response is CancelTaskDefaultResponse;\nexport function isUnexpected(\n response:\n | ListAssetResource200Response\n | ListAssetResourceDefaultResponse\n | UpdateAssets200Response\n | UpdateAssetsDefaultResponse\n | GetAssetResource200Response\n | GetAssetResourceDefaultResponse\n | ListDataConnection200Response\n | ListDataConnectionDefaultResponse\n | ValidateDataConnection200Response\n | ValidateDataConnectionDefaultResponse\n | GetDataConnection200Response\n | GetDataConnectionDefaultResponse\n | CreateOrReplaceDataConnection200Response\n | CreateOrReplaceDataConnectionDefaultResponse\n | DeleteDataConnection204Response\n | DeleteDataConnectionDefaultResponse\n | ListDiscoGroup200Response\n | ListDiscoGroupDefaultResponse\n | ValidateDiscoGroup200Response\n | ValidateDiscoGroupDefaultResponse\n | GetDiscoGroup200Response\n | GetDiscoGroupDefaultResponse\n | CreateOrReplaceDiscoGroup200Response\n | CreateOrReplaceDiscoGroupDefaultResponse\n | RunDiscoGroup204Response\n | RunDiscoGroupDefaultResponse\n | ListRuns200Response\n | ListRunsDefaultResponse\n | ListDiscoTemplate200Response\n | ListDiscoTemplateDefaultResponse\n | GetDiscoTemplate200Response\n | GetDiscoTemplateDefaultResponse\n | GetBillable200Response\n | GetBillableDefaultResponse\n | GetSnapshot200Response\n | GetSnapshotDefaultResponse\n | GetSummary200Response\n | GetSummaryDefaultResponse\n | ListSavedFilter200Response\n | ListSavedFilterDefaultResponse\n | GetSavedFilter200Response\n | GetSavedFilterDefaultResponse\n | CreateOrReplaceSavedFilter200Response\n | CreateOrReplaceSavedFilterDefaultResponse\n | DeleteSavedFilter204Response\n | DeleteSavedFilterDefaultResponse\n | ListTask200Response\n | ListTaskDefaultResponse\n | GetTask200Response\n | GetTaskDefaultResponse\n | CancelTask200Response\n | CancelTaskDefaultResponse\n): response is\n | ListAssetResourceDefaultResponse\n | UpdateAssetsDefaultResponse\n | GetAssetResourceDefaultResponse\n | ListDataConnectionDefaultResponse\n | ValidateDataConnectionDefaultResponse\n | GetDataConnectionDefaultResponse\n | CreateOrReplaceDataConnectionDefaultResponse\n | DeleteDataConnectionDefaultResponse\n | ListDiscoGroupDefaultResponse\n | ValidateDiscoGroupDefaultResponse\n | GetDiscoGroupDefaultResponse\n | CreateOrReplaceDiscoGroupDefaultResponse\n | RunDiscoGroupDefaultResponse\n | ListRunsDefaultResponse\n | ListDiscoTemplateDefaultResponse\n | GetDiscoTemplateDefaultResponse\n | GetBillableDefaultResponse\n | GetSnapshotDefaultResponse\n | GetSummaryDefaultResponse\n | ListSavedFilterDefaultResponse\n | GetSavedFilterDefaultResponse\n | CreateOrReplaceSavedFilterDefaultResponse\n | DeleteSavedFilterDefaultResponse\n | ListTaskDefaultResponse\n | GetTaskDefaultResponse\n | CancelTaskDefaultResponse {\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 = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\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 if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\"\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\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[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
package/dist-esm/src/models.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** A request body used to update an asset. */\nexport interface AssetUpdateData {\n /**\n * The state to update the asset to.\n *\n * Possible values: candidate, confirmed, dismissed, candidateInvestigate, associatedPartner, associatedThirdparty\n */\n state?: string;\n /** A string which can be used to identify the asset in external systems. */\n externalId?: string;\n /** Any Labels to update the asset with. */\n labels?: Record<string, boolean>;\n /**\n * A list of asset types to cascade the updates to.\n *\n * Possible values: as, contact, domain, host, ipAddress, ipBlock, page, sslCert\n */\n transfers?: string;\n}\n\nexport interface DataConnectionDataParent {\n /** The name of data connection */\n name?: string;\n /**\n * The type of data the data connection will transfer.\n *\n * Possible values: assets, attackSurfaceInsights\n */\n content?: string;\n /**\n * The rate at which the data connection will receive updates.\n *\n * Possible values: daily, weekly, monthly\n */\n frequency?: string;\n /** The day to update the data connection on. (1-7 for weekly, 1-31 for monthly) */\n frequencyOffset?: number;\n kind: string;\n}\n\n/** Source entity used to drive discovery. */\nexport interface DiscoSource {\n /**\n * The kind of disco source.\n *\n * Possible values: as, attribute, contact, domain, host, ipBlock\n */\n kind?: string;\n /** The name for the disco source. */\n name?: string;\n}\n\n/** A request body used to create a discovery group. */\nexport interface DiscoGroupData {\n /** The name for a disco group. */\n name?: string;\n /** The description for a disco group. */\n description?: string;\n /** The tier for the disco group which will affect the algorithm used for the disco runs in this group. */\n tier?: string;\n /** The frequency at which the disco group is supposed to be rerun in milliseconds. */\n frequencyMilliseconds?: number;\n /** The list of seeds used for the disco group runs. */\n seeds?: Array<DiscoSource>;\n /** The list of names used for the disco group runs. */\n names?: string[];\n /** The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. */\n excludes?: Array<DiscoSource>;\n /** The unique identifier for the disco template used for the disco group creation. */\n templateId?: string;\n}\n\n/** A request body used to retrieve an asset report snapshot. */\nexport interface ReportAssetSnapshotRequest {\n /** The metric to retrieve a snapshot for. */\n metric?: string;\n /** The name of the label to retrieve a snapshot for. */\n labelName?: string;\n /** The number of assets per page. */\n size?: number;\n /** The page to retrieve. */\n page?: number;\n}\n\n/** A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be provided: filters, metrics, or metricCategories. */\nexport interface ReportAssetSummaryRequest {\n /** Categories to retrieve risk reporting data for. */\n metricCategories?: string[];\n /** Metrics to retrieve risk reporting data for. */\n metrics?: string[];\n /** Query filters to apply to the asset summary. */\n filters?: string[];\n /** A parameter to group the assets by (first level facet field), only used when the chosen summary identifier is filters. */\n groupBy?: string;\n /** A parameter to segment the assets by (second level facet field), only used when the chosen summary identifier is filters. */\n segmentBy?: string;\n /** Currently unused. */\n labelName?: string;\n}\n\n/** A request body used to create a saved filter. */\nexport interface SavedFilterData {\n /** An expression on the resource type that selects the resources to be returned. */\n filter: string;\n /** A human readable description of the saved filter. */\n description: string;\n}\n\nexport type DataConnectionData =\n | LogAnalyticsDataConnectionData\n | AzureDataExplorerDataConnectionData;\n\nexport interface LogAnalyticsDataConnectionData extends DataConnectionDataParent {\n kind: \"logAnalytics\";\n properties: LogAnalyticsDataConnectionProperties;\n}\n\nexport interface AzureDataExplorerDataConnectionData extends DataConnectionDataParent {\n kind: \"azureDataExplorer\";\n properties: AzureDataExplorerDataConnectionProperties;\n}\n\n/** LogAnalyticsDataConnectionProperties */\nexport interface LogAnalyticsDataConnectionProperties extends DataConnectionProperties {\n /** log analytics api key */\n apiKey?: string;\n /** log analytics workspace id */\n workspaceId?: string;\n}\n\n/** DataConnectionProperties */\nexport interface DataConnectionProperties {}\n\n/** AzureDataExplorerDataConnectionProperties */\nexport interface AzureDataExplorerDataConnectionProperties extends DataConnectionProperties {\n /** The azure data explorer cluster name */\n clusterName?: string;\n /** The azure data explorer region */\n region?: string;\n /** The azure data explorer database name */\n databaseName?: string;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Paged } from \"@azure/core-paging\";\n\n/** The items in the current page of results. */\nexport interface AssetResourceOutputParent {\n /** The system generated unique id for the resource. */\n readonly id: string;\n /** The caller provided unique name for the resource. */\n name?: string;\n /** The name that can be used for display purposes. */\n displayName?: string;\n /** Global UUID for the asset. */\n uuid?: string;\n /** The date this asset was first added to this workspace. */\n createdDate?: string;\n /** The date this asset was last updated for this workspace. */\n updatedDate?: string;\n /** Possible values: candidate, confirmed, dismissed, candidateInvestigate, associatedPartner, associatedThirdparty, archived */\n state?: string;\n /** An optional customer provided identifier for this asset. */\n externalId?: string;\n /** Customer labels assigned to this asset. */\n labels?: string[];\n /** An indicator of whether this asset represents a wildcard rollup of assets on this domain. */\n wildcard?: boolean;\n /** The name of the DiscoGroup that brought added this asset to the workspace. */\n discoGroupName?: string;\n /** The history of how this asset was pulled into the workspace through the discovery process. */\n auditTrail?: Array<AuditTrailItemOutput>;\n reason?: string;\n kind: string;\n}\n\n/** The history of how this asset was pulled into the workspace through the discovery process. */\nexport interface AuditTrailItemOutput {\n /** The system generated unique id for the resource. */\n id?: string;\n /** The caller provided unique name for the resource. */\n name?: string;\n /** The name that can be used for display purposes. */\n displayName?: string;\n /**\n * The kind of asset.\n *\n * Possible values: as, contact, domain, host, ipAddress, ipBlock, page, sslCert\n */\n kind?: string;\n /** An explanation of why this audit trail node was discovered from the previous node. */\n reason?: string;\n}\n\nexport interface AsAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"as\";\n /** asset */\n asset: AsAssetOutput;\n}\n\nexport interface AsAssetOutput extends InventoryAssetOutput {\n asn?: number;\n asNames?: Array<ObservedStringOutput>;\n orgNames?: Array<ObservedStringOutput>;\n orgIds?: Array<ObservedStringOutput>;\n countries?: Array<ObservedStringOutput>;\n registries?: Array<ObservedStringOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n registrarCreatedAt?: Array<ObservedLongOutput>;\n registrarUpdatedAt?: Array<ObservedLongOutput>;\n registrantContacts?: Array<ObservedStringOutput>;\n adminContacts?: Array<ObservedStringOutput>;\n technicalContacts?: Array<ObservedStringOutput>;\n registrarNames?: Array<ObservedStringOutput>;\n registrantNames?: Array<ObservedStringOutput>;\n adminNames?: Array<ObservedStringOutput>;\n technicalNames?: Array<ObservedStringOutput>;\n adminOrgs?: Array<ObservedStringOutput>;\n technicalOrgs?: Array<ObservedStringOutput>;\n registrantPhones?: Array<ObservedStringOutput>;\n adminPhones?: Array<ObservedStringOutput>;\n technicalPhones?: Array<ObservedStringOutput>;\n detailedFromWhoisAt?: string;\n}\n\nexport interface ObservedStringOutput extends ObservedValueOutput {\n value?: string;\n sources?: Array<SourceOutput>;\n}\n\nexport interface SourceOutput {\n source?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n reason?: string;\n}\n\n/** Template model for observed values */\nexport interface ObservedValueOutput {\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n}\n\nexport interface ObservedLongOutput extends ObservedValueOutput {\n value?: number;\n sources?: Array<SourceOutput>;\n}\n\nexport interface ObservedIntegerOutput extends ObservedValueOutput {\n value?: number;\n sources?: Array<SourceOutput>;\n}\n\nexport interface ObservedBooleanOutput extends ObservedValueOutput {\n value?: boolean;\n sources?: Array<SourceOutput>;\n}\n\nexport interface ObservedHeaderOutput extends ObservedValueOutput {\n headerName?: string;\n headerValue?: string;\n}\n\nexport interface ObservedPortStateOutput extends ObservedValueOutput {\n /** Possible values: open, closed, filtered */\n value?: string;\n port?: number;\n}\n\nexport interface ObservedLocationOutput extends ObservedValueOutput {\n value?: LocationOutput;\n sources?: Array<SourceOutput>;\n}\n\nexport interface LocationOutput {\n countryCode?: string;\n countryName?: string;\n region?: string;\n regionName?: string;\n city?: string;\n areaCode?: number;\n postalCode?: string;\n latitude?: number;\n longitude?: number;\n dmaCode?: number;\n metroCodeId?: number;\n}\n\nexport interface ObservedIntegersOutput extends ObservedValueOutput {\n values?: number[];\n sources?: Array<SourceOutput>;\n}\n\nexport interface InventoryAssetOutput {}\n\nexport interface ContactAssetOutput extends InventoryAssetOutput {\n email?: string;\n names?: Array<ObservedStringOutput>;\n organizations?: Array<ObservedStringOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n}\n\nexport interface DomainAssetOutput extends InventoryAssetOutput {\n domain?: string;\n whoisId?: number;\n registrarIanaIds?: Array<ObservedIntegerOutput>;\n registrantContacts?: Array<ObservedStringOutput>;\n registrantOrgs?: Array<ObservedStringOutput>;\n adminContacts?: Array<ObservedStringOutput>;\n technicalContacts?: Array<ObservedStringOutput>;\n alexaInfos?: Array<AlexaInfoOutput>;\n nameServers?: Array<ObservedStringOutput>;\n mailServers?: Array<ObservedStringOutput>;\n whoisServers?: Array<ObservedStringOutput>;\n domainStatuses?: Array<ObservedStringOutput>;\n registrarCreatedAt?: Array<ObservedLongOutput>;\n registrarUpdatedAt?: Array<ObservedLongOutput>;\n registrarExpiresAt?: Array<ObservedLongOutput>;\n soaRecords?: Array<SoaRecordOutput>;\n detailedFromWhoisAt?: string;\n registrarNames?: Array<ObservedStringOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n parkedDomain?: Array<ObservedBooleanOutput>;\n registrantNames?: Array<ObservedStringOutput>;\n adminNames?: Array<ObservedStringOutput>;\n technicalNames?: Array<ObservedStringOutput>;\n adminOrgs?: Array<ObservedStringOutput>;\n technicalOrgs?: Array<ObservedStringOutput>;\n registrantPhones?: Array<ObservedStringOutput>;\n adminPhones?: Array<ObservedStringOutput>;\n technicalPhones?: Array<ObservedStringOutput>;\n}\n\nexport interface AlexaInfoOutput {\n alexaRank?: number;\n category?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n}\n\nexport interface SoaRecordOutput {\n nameServer?: string;\n email?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n serialNumber?: number;\n recent?: boolean;\n}\n\nexport interface HostAssetOutput extends InventoryAssetOutput {\n host?: string;\n domain?: string;\n ipAddresses?: Array<ObservedStringOutput>;\n webComponents?: Array<WebComponentOutput>;\n headers?: Array<ObservedHeaderOutput>;\n attributes?: Array<AttributeOutput>;\n cookies?: Array<CookieOutput>;\n sslCerts?: Array<SslCertAssetOutput>;\n parentHosts?: Array<ObservedStringOutput>;\n childHosts?: Array<ObservedStringOutput>;\n hostCore?: HostCoreOutput;\n services?: Array<ServiceOutput>;\n cnames?: Array<ObservedStringOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n resourceUrls?: Array<ResourceUrlOutput>;\n scanMetadata?: Array<ScanMetadataOutput>;\n asns?: Array<ObservedLongOutput>;\n ipBlocks?: Array<IpBlockOutput>;\n responseBodies?: Array<ObservedStringOutput>;\n domainAsset?: DomainAssetOutput;\n nsRecord?: Array<ObservedBooleanOutput>;\n mxRecord?: Array<ObservedBooleanOutput>;\n webserver?: Array<ObservedBooleanOutput>;\n location?: Array<ObservedLocationOutput>;\n nxdomain?: Array<ObservedBooleanOutput>;\n sslServerConfig?: Array<SslServerConfigOutput>;\n isWildcard?: Array<ObservedBooleanOutput>;\n banners?: Array<BannerOutput>;\n ipv4?: Array<ObservedBooleanOutput>;\n ipv6?: Array<ObservedBooleanOutput>;\n}\n\nexport interface WebComponentOutput {\n name?: string;\n type?: string;\n version?: string;\n ruleId?: string[];\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n cve?: Array<CveOutput>;\n endOfLife?: number;\n recent?: boolean;\n ports?: Array<PortOutput>;\n sources?: Array<SourceOutput>;\n service?: string;\n}\n\nexport interface CveOutput {\n name?: string;\n cweId?: string;\n cvssScore?: number;\n cvss3Summary?: Cvss3SummaryOutput;\n}\n\nexport interface Cvss3SummaryOutput {\n version?: string;\n vectorString?: string;\n attackVector?: string;\n attackComplexity?: string;\n privilegesRequired?: string;\n userInteraction?: string;\n scope?: string;\n confidentialityImpact?: string;\n integrityImpact?: string;\n availabilityImpact?: string;\n baseScore?: number;\n baseSeverity?: string;\n exploitCodeMaturity?: string;\n remediationLevel?: string;\n reportConfidence?: string;\n exploitabilityScore?: number;\n impactScore?: number;\n}\n\nexport interface PortOutput {\n port?: number;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n}\n\nexport interface AttributeOutput {\n attributeType?: string;\n attributeValue?: string;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n}\n\nexport interface CookieOutput {\n cookieName?: string;\n cookieDomain?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n cookieExpiryDate?: string;\n}\n\nexport interface SslCertAssetOutput extends InventoryAssetOutput {\n sha1?: string;\n subjectCommonNames?: string[];\n organizations?: string[];\n organizationalUnits?: string[];\n issuerCommonNames?: string[];\n sigAlgName?: string;\n invalidAfter?: string;\n serialNumber?: string;\n subjectAlternativeNames?: string[];\n issuerAlternativeNames?: string[];\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n invalidBefore?: string;\n keySize?: number;\n keyAlgorithm?: string;\n subjectLocality?: string[];\n subjectState?: string[];\n subjectCountry?: string[];\n issuerLocality?: string[];\n issuerState?: string[];\n issuerCountry?: string[];\n subjectOrganizations?: string[];\n subjectOrganizationalUnits?: string[];\n issuerOrganizations?: string[];\n issuerOrganizationalUnits?: string[];\n version?: number;\n certificateAuthority?: boolean;\n selfSigned?: boolean;\n sigAlgOid?: string;\n recent?: boolean;\n /** Possible values: domainValidation, organizationValidation, extendedValidation */\n validationType?: string;\n}\n\nexport interface HostCoreOutput {\n host?: string;\n domain?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n blacklistCauseFirstSeen?: string;\n blacklistCauseLastSeen?: string;\n blacklistCauseCount?: number;\n blacklistResourceFirstSeen?: string;\n blacklistResourceLastSeen?: string;\n blacklistResourceCount?: number;\n blacklistSequenceFirstSeen?: string;\n blacklistSequenceLastSeen?: string;\n blacklistSequenceCount?: number;\n phishCauseCount?: number;\n malwareCauseCount?: number;\n spamCauseCount?: number;\n scamCauseCount?: number;\n phishResourceCount?: number;\n malwareResourceCount?: number;\n spamResourceCount?: number;\n scamResourceCount?: number;\n phishSequenceCount?: number;\n malwareSequenceCount?: number;\n spamSequenceCount?: number;\n scamSequenceCount?: number;\n alexaRank?: number;\n hostReputationScore?: number;\n hostPhishReputationScore?: number;\n hostMalwareReputationScore?: number;\n hostSpamReputationScore?: number;\n hostScamReputationScore?: number;\n domainReputationScore?: number;\n domainPhishReputationScore?: number;\n domainMalwareReputationScore?: number;\n domainSpamReputationScore?: number;\n domainScamReputationScore?: number;\n uuid?: string;\n}\n\nexport interface ServiceOutput {\n scheme?: string;\n port?: number;\n webComponents?: Array<WebComponentOutput>;\n sslCerts?: Array<SslCertAssetOutput>;\n exceptions?: Array<ObservedStringOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n portStates?: Array<ObservedPortStateOutput>;\n}\n\nexport interface ResourceUrlOutput {\n url?: string;\n resources?: Array<DependentResourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n}\n\nexport interface DependentResourceOutput {\n md5?: string;\n responseBodySize?: number;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n firstSeenCrawlGuid?: string;\n firstSeenPageGuid?: string;\n firstSeenResourceGuid?: string;\n lastSeenCrawlGuid?: string;\n lastSeenPageGuid?: string;\n lastSeenResourceGuid?: string;\n responseBodyMinhash?: number[];\n contentType?: string;\n sha256?: string;\n sha384?: string;\n sha512?: string;\n url?: string;\n cached?: boolean;\n sriChecks?: Array<SubResourceIntegrityCheckOutput>;\n host?: string;\n lastObservedViolation?: string;\n lastObservedValidation?: string;\n lastObservedActualSriHash?: string;\n lastObservedExpectedSriHash?: string;\n}\n\nexport interface SubResourceIntegrityCheckOutput {\n violation?: boolean;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n causePageUrl?: string;\n crawlGuid?: string;\n pageGuid?: string;\n resourceGuid?: string;\n expectedHash?: string;\n}\n\nexport interface ScanMetadataOutput {\n port?: number;\n bannerMetadata?: string;\n startScan?: string;\n endScan?: string;\n}\n\nexport interface IpBlockOutput {\n ipBlock?: string;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n}\n\nexport interface SslServerConfigOutput {\n tlsVersions?: string[];\n cipherSuites?: string[];\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n sources?: Array<SourceOutput>;\n}\n\nexport interface BannerOutput {\n port?: number;\n banner?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n scanType?: string;\n bannerMetadata?: string;\n recent?: boolean;\n sha256?: string;\n sources?: Array<SourceOutput>;\n}\n\nexport interface IpAddressAssetOutput extends InventoryAssetOutput {\n ipAddress?: string;\n asns?: Array<ObservedLongOutput>;\n reputations?: Array<ReputationOutput>;\n webComponents?: Array<WebComponentOutput>;\n netRanges?: Array<ObservedStringOutput>;\n headers?: Array<ObservedHeaderOutput>;\n attributes?: Array<AttributeOutput>;\n cookies?: Array<CookieOutput>;\n sslCerts?: Array<SslCertAssetOutput>;\n services?: Array<ServiceOutput>;\n ipBlocks?: Array<IpBlockOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n banners?: Array<BannerOutput>;\n scanMetadata?: Array<ScanMetadataOutput>;\n nsRecord?: Array<ObservedBooleanOutput>;\n mxRecord?: Array<ObservedBooleanOutput>;\n location?: Array<ObservedLocationOutput>;\n hosts?: Array<ObservedStringOutput>;\n nxdomain?: Array<ObservedBooleanOutput>;\n sslServerConfig?: Array<SslServerConfigOutput>;\n ipv4?: boolean;\n ipv6?: boolean;\n}\n\nexport interface ReputationOutput {\n listName?: string;\n threatType?: string;\n trusted?: boolean;\n cidr?: string;\n firstSeen?: string;\n lastSeen?: string;\n listUpdatedAt?: string;\n recent?: boolean;\n}\n\nexport interface IpBlockAssetOutput extends InventoryAssetOutput {\n ipBlock?: string;\n asns?: Array<ObservedLongOutput>;\n bgpPrefixes?: Array<ObservedStringOutput>;\n netNames?: Array<ObservedStringOutput>;\n registrantContacts?: Array<ObservedStringOutput>;\n registrantOrgs?: Array<ObservedStringOutput>;\n adminContacts?: Array<ObservedStringOutput>;\n technicalContacts?: Array<ObservedStringOutput>;\n registrarCreatedAt?: Array<ObservedLongOutput>;\n registrarUpdatedAt?: Array<ObservedLongOutput>;\n netRanges?: Array<ObservedStringOutput>;\n startIp?: string;\n endIp?: string;\n reputations?: Array<ReputationOutput>;\n detailedFromWhoisAt?: string;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n location?: Array<ObservedLocationOutput>;\n registrarExpiresAt?: Array<ObservedLongOutput>;\n registrantNames?: Array<ObservedStringOutput>;\n adminNames?: Array<ObservedStringOutput>;\n technicalNames?: Array<ObservedStringOutput>;\n adminOrgs?: Array<ObservedStringOutput>;\n technicalOrgs?: Array<ObservedStringOutput>;\n registrantPhones?: Array<ObservedStringOutput>;\n adminPhones?: Array<ObservedStringOutput>;\n technicalPhones?: Array<ObservedStringOutput>;\n ipv4?: boolean;\n ipv6?: boolean;\n}\n\nexport interface PageAssetOutput extends InventoryAssetOutput {\n url?: string;\n httpMethod?: string;\n service?: string;\n ipAddresses?: Array<ObservedStringOutput>;\n successful?: Array<ObservedBooleanOutput>;\n httpResponseCodes?: Array<ObservedIntegerOutput>;\n httpResponseMessages?: Array<ObservedStringOutput>;\n responseTimes?: Array<ObservedLongOutput>;\n frames?: Array<ObservedBooleanOutput>;\n windows?: Array<ObservedBooleanOutput>;\n nonHtmlFrames?: Array<ObservedBooleanOutput>;\n undirectedContent?: Array<ObservedBooleanOutput>;\n contentTypes?: Array<ObservedStringOutput>;\n contentLengths?: Array<ObservedLongOutput>;\n windowNames?: Array<ObservedStringOutput>;\n charsets?: Array<ObservedStringOutput>;\n titles?: Array<ObservedStringOutput>;\n languages?: Array<ObservedStringOutput>;\n responseHeaders?: Array<ObservedHeaderOutput>;\n cookies?: Array<CookieOutput>;\n webComponents?: Array<WebComponentOutput>;\n attributes?: Array<AttributeOutput>;\n assetSecurityPolicies?: Array<AssetSecurityPolicyOutput>;\n responseBodyMinhashSignatures?: Array<ObservedIntegersOutput>;\n fullDomMinhashSignatures?: Array<ObservedIntegersOutput>;\n responseBodyHashSignatures?: Array<ObservedStringOutput>;\n errors?: Array<ObservedStringOutput>;\n sslCerts?: Array<SslCertAssetOutput>;\n sources?: Array<SourceOutput>;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n cause?: PageCauseOutput;\n referrer?: string;\n redirectUrls?: Array<ObservedStringOutput>;\n /** Possible values: httpHeader, metaRefresh, javascript, final */\n redirectType?: string;\n finalUrls?: Array<ObservedStringOutput>;\n finalResponseCodes?: Array<ObservedIntegerOutput>;\n parkedPage?: Array<ObservedBooleanOutput>;\n resourceUrls?: Array<ResourceUrlOutput>;\n guids?: Array<GuidPairOutput>;\n finalIpAddresses?: Array<ObservedStringOutput>;\n asns?: Array<ObservedLongOutput>;\n ipBlocks?: Array<IpBlockOutput>;\n finalAsns?: Array<ObservedLongOutput>;\n finalIpBlocks?: Array<IpBlockOutput>;\n responseBodies?: Array<ObservedStringOutput>;\n domainAsset?: DomainAssetOutput;\n rootUrl?: ObservedBooleanOutput;\n isRootUrl?: boolean;\n location?: Array<ObservedLocationOutput>;\n services?: Array<ServiceOutput>;\n siteStatus?: string;\n cnames?: Array<ObservedStringOutput>;\n cdns?: Array<ObservedStringOutput>;\n host?: string;\n domain?: string;\n sslServerConfig?: Array<SslServerConfigOutput>;\n gdprAssetSecurityPolicies?: Array<AssetSecurityPolicyOutput>;\n ipv4?: Array<ObservedBooleanOutput>;\n ipv6?: Array<ObservedBooleanOutput>;\n}\n\nexport interface AssetSecurityPolicyOutput {\n policyName?: string;\n isAffected?: boolean;\n description?: string;\n firstSeen?: string;\n lastSeen?: string;\n count?: number;\n recent?: boolean;\n sources?: Array<SourceOutput>;\n}\n\nexport interface PageCauseOutput {\n cause?: string;\n causeElementXPath?: string;\n location?: string;\n possibleMatches?: number;\n loopDetected?: boolean;\n version?: number;\n domChangeIndex?: number;\n}\n\nexport interface GuidPairOutput {\n pageGuid?: string;\n crawlStateGuid?: string;\n loadDate?: string;\n recent?: boolean;\n}\n\nexport interface ContactAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"contact\";\n /** asset */\n asset: ContactAssetOutput;\n}\n\nexport interface DomainAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"domain\";\n /** asset */\n asset: DomainAssetOutput;\n}\n\nexport interface HostAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"host\";\n /** asset */\n asset: HostAssetOutput;\n}\n\nexport interface IpAddressAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"ipAddress\";\n /** asset */\n asset: IpAddressAssetOutput;\n}\n\nexport interface IpBlockAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"ipBlock\";\n /** asset */\n asset: IpBlockAssetOutput;\n}\n\nexport interface PageAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"page\";\n /** asset */\n asset: PageAssetOutput;\n}\n\nexport interface SslCertAssetResourceOutput extends AssetResourceOutputParent {\n /** The kind of AssetResource */\n kind: \"sslCert\";\n /** asset */\n asset: SslCertAssetOutput;\n}\n\nexport interface TaskOutput {\n /** The unique identifier of the task. */\n readonly id: string;\n /** The time the task started. */\n startedAt?: string;\n /** The time the task completed. */\n completedAt?: string;\n /** The last time the status of the task was updated. */\n lastPolledAt?: string;\n /**\n * The state the task is in.\n *\n * Possible values: pending, running, paused, complete, incomplete, failed, warning\n */\n state?: string;\n /**\n * The phase the task is in.\n *\n * Possible values: running, polling, complete\n */\n phase?: string;\n /** The reason the task was moved into its current state, if the task wasn't completed. */\n reason?: string;\n /** Attributes unique to the task. This differs by task type. */\n metadata?: Record<string, any>;\n}\n\nexport interface DataConnectionOutputParent {\n /** The system generated unique id for the resource. */\n id?: string;\n /** The caller provided unique name for the resource. */\n readonly name: string;\n /** The name that can be used for display purposes. */\n displayName?: string;\n /**\n * The type of data the data connection will transfer\n *\n * Possible values: assets, attackSurfaceInsights\n */\n content?: string;\n /** The date the data connection was created. */\n readonly createdDate?: string;\n /**\n * The rate at which the data connection will receive updates.\n *\n * Possible values: daily, weekly, monthly\n */\n frequency?: string;\n /** The day to update the data connection on. */\n frequencyOffset?: number;\n /** The date the data connection was last updated. */\n readonly updatedDate?: string;\n /** The date the data connection was last updated by user. */\n readonly userUpdatedAt?: string;\n /** An indicator of whether the data connection is active. */\n active?: boolean;\n /** A message that specifies details about data connection if inactive. */\n readonly inactiveMessage?: string;\n kind: string;\n}\n\nexport interface LogAnalyticsDataConnectionOutput extends DataConnectionOutputParent {\n /** The kind of DataConnection */\n kind: \"logAnalytics\";\n /** properties */\n properties: LogAnalyticsDataConnectionPropertiesOutput;\n}\n\nexport interface LogAnalyticsDataConnectionPropertiesOutput extends DataConnectionPropertiesOutput {\n /** log analytics api key */\n apiKey?: string;\n /** log analytics workspace id */\n workspaceId?: string;\n}\n\n/** The properties required to establish connection to a particular service */\nexport interface DataConnectionPropertiesOutput {}\n\nexport interface AzureDataExplorerDataConnectionPropertiesOutput\n extends DataConnectionPropertiesOutput {\n /** The azure data explorer cluster name */\n clusterName?: string;\n /** The azure data explorer region */\n region?: string;\n /** The azure data explorer database name */\n databaseName?: string;\n}\n\nexport interface AzureDataExplorerDataConnectionOutput extends DataConnectionOutputParent {\n /** The kind of DataConnection */\n kind: \"azureDataExplorer\";\n /** properties */\n properties: AzureDataExplorerDataConnectionPropertiesOutput;\n}\n\nexport interface ValidateResultOutput {\n /** This is the top-level error object whose code matches the x-ms-error-code response header. */\n error?: ErrorDetailOutput;\n}\n\n/** This is the top-level error object whose code matches the x-ms-error-code response header. */\nexport interface ErrorDetailOutput {\n /** This is one of a server-defined set of error codes. */\n code: string;\n /** This is a human-readable representation of the error. */\n message: string;\n /** This is the error target. */\n target?: string;\n /** This is an array of details about specific errors that led to this reported error. */\n details?: Array<ErrorDetailOutput>;\n /** This is an object containing more specific information than the current object about the error. */\n innererror?: InnerErrorOutput;\n}\n\n/** This is an object containing more specific information than the current object about the error. */\nexport interface InnerErrorOutput {\n /** This is a more specific error code than was provided by the containing error. */\n code?: string;\n /** This is an additional field representing the value that caused the error to help with debugging. */\n value?: any;\n}\n\nexport interface DiscoGroupOutput {\n /** The system generated unique id for the resource. */\n id?: string;\n /** The caller provided unique name for the resource. */\n readonly name: string;\n /** The name that can be used for display purposes. */\n displayName?: string;\n /** The description for a disco group. */\n description?: string;\n /** The tier for the disco group which will affect the algorithm used for the disco runs in this group. */\n tier?: string;\n /** The frequency at which the disco group is supposed to be rerun in milliseconds. */\n frequencyMilliseconds?: number;\n /** The list of seeds used for the disco group runs. */\n seeds?: Array<DiscoSourceOutput>;\n /** The list of names used for the disco group runs. */\n names?: string[];\n /** The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. */\n excludes?: Array<DiscoSourceOutput>;\n /** The latest run of this disco group with some limited information, null if the group has never been run. */\n latestRun?: DiscoRunResultOutput;\n /** The date for the disco group was created. */\n createdDate?: string;\n /** The unique identifier for the disco template used for the disco group creation. */\n templateId?: string;\n}\n\n/** Source entity used to drive discovery. */\nexport interface DiscoSourceOutput {\n /**\n * The kind of disco source.\n *\n * Possible values: as, attribute, contact, domain, host, ipBlock\n */\n kind?: string;\n /** The name for the disco source. */\n name?: string;\n}\n\n/** The latest run of this disco group with some limited information, null if the group has never been run. */\nexport interface DiscoRunResultOutput {\n /** The date for when the disco run was created in the system. */\n submittedDate?: string;\n /** The date for when the disco run was actually started by the system. */\n startedDate?: string;\n /** The date for when the disco run was completed by the system. */\n completedDate?: string;\n /** The tier which will affect the algorithm used for the disco run. */\n tier?: string;\n /**\n * The State of the disco run.\n *\n * Possible values: pending, running, completed, failed\n */\n state?: string;\n /** The total count of assets that were found this disco run. */\n totalAssetsFoundCount?: number;\n /** The list of seeds used for the disco run. */\n seeds?: Array<DiscoSourceOutput>;\n /** The list of excludes used for the disco run, aka assets to exclude from the discovery algorithm. */\n excludes?: Array<DiscoSourceOutput>;\n /** The list of names used for the disco run. */\n names?: string[];\n}\n\nexport interface DiscoRunPageResultOutput {\n /** The total number of items available in the full result set. */\n totalElements?: number;\n /** The link to access the next page of results. Not set if at the end of the result set. */\n nextLink?: string;\n /** The items in the current page of results. */\n value?: Array<DiscoRunResultOutput>;\n}\n\n/** The items in the current page of results. */\nexport interface DiscoTemplateOutput {\n /** The system generated unique id for the resource. */\n readonly id: string;\n /** The caller provided unique name for the resource. */\n name?: string;\n /** The name that can be used for display purposes. */\n displayName?: string;\n /** The name of the industry. */\n industry?: string;\n /** The name of the region. */\n region?: string;\n /** The country code. */\n countryCode?: string;\n /** The state code. */\n stateCode?: string;\n /** The name of the city. */\n city?: string;\n /** The list of disco template seeds. */\n seeds?: Array<DiscoSourceOutput>;\n /** The list of disco template names. */\n names?: string[];\n}\n\nexport interface ReportBillableAssetSummaryResultOutput {\n assetSummaries?: Array<ReportBillableAssetSnapshotResultOutput>;\n}\n\nexport interface ReportBillableAssetSnapshotResultOutput {\n /** The date these assets were billed on. */\n date?: string;\n /** The total number of billable assets for this date. */\n total?: number;\n /** The breakdown of billable asset counts for each asset type. */\n assetBreakdown?: Array<ReportBillableAssetBreakdownOutput>;\n}\n\n/** The breakdown of billable asset counts for each asset type. */\nexport interface ReportBillableAssetBreakdownOutput {\n /**\n * The kind of billable asset.\n *\n * Possible values: domain, host, ipAddress\n */\n kind?: string;\n /** The number of assets of this type. */\n count?: number;\n}\n\n/** A snapshot of assets captured daily for the provided metric. Asset details only contain primary properties. Detailed asset data can be retrieved from the asset endpoints. */\nexport interface ReportAssetSnapshotResultOutput {\n /** The name of the metric. */\n displayName?: string;\n /** The unique metric name. */\n metric?: string;\n /** The customer label that was filtered on, if one was provided. */\n labelName?: string;\n /** The last time this asset data was updated on this metric. */\n updatedAt?: string;\n /** A description of what the metric represents. */\n description?: string;\n /** The page of assets that match the provided metric. */\n assets?: AssetPageResultOutput;\n}\n\n/** The page of assets that match the provided metric. */\nexport interface AssetPageResultOutput {\n /** The total number of items available in the full result set. */\n totalElements?: number;\n /** The cursor mark to be used on the next request. Not set if using paging. */\n mark?: string;\n /** The link to access the next page of results. Not set if at the end of the result set. */\n nextLink?: string;\n /** The items in the current page of results. */\n value?: Array<AssetResourceOutput>;\n}\n\nexport interface ReportAssetSummaryResultOutput {\n /** The collection of asset summaries. */\n assetSummaries?: Array<AssetSummaryResultOutput>;\n}\n\n/** The collection of asset summaries. */\nexport interface AssetSummaryResultOutput {\n /** The name of the summary response. Depending on the request time this will either be the asset filter, risk category, or risk metric. */\n displayName?: string;\n /** The description of the summary response. Filters don't have a description. */\n description?: string;\n /** The last time risk categories or risk metrics were captured. Set to the current time for asset filter requests, which always pull the live asset data. */\n updatedAt?: string;\n /** If the request is for a metric category, this will contain the requested unique category name. */\n metricCategory?: string;\n /** If the request is for a metric, this will contain the requested unique metric name. */\n metric?: string;\n /** If the request is for an asset filter, this will contain the corresponding filter. */\n filter?: string;\n /** An optional label used to filter requests results. */\n labelName?: string;\n /** The count of assets matching the request parameters. */\n count?: number;\n /** The link to the corresponding asset details. */\n link?: string;\n /** The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy and segmentBy this will contain facets. */\n children?: Array<AssetSummaryResultOutput>;\n}\n\nexport interface SavedFilterOutput {\n /** The system generated unique id for the resource. */\n id?: string;\n /** The caller provided unique name for the resource. */\n readonly name: string;\n /** The name that can be used for display purposes. */\n displayName?: string;\n filter?: string;\n description?: string;\n}\n\n/** The items in the current page of results. */\nexport type AssetResourceOutput =\n | AsAssetResourceOutput\n | ContactAssetResourceOutput\n | DomainAssetResourceOutput\n | HostAssetResourceOutput\n | IpAddressAssetResourceOutput\n | IpBlockAssetResourceOutput\n | PageAssetResourceOutput\n | SslCertAssetResourceOutput;\nexport type DataConnectionOutput =\n | LogAnalyticsDataConnectionOutput\n | AzureDataExplorerDataConnectionOutput;\n/** Paged collection of AssetResource items */\nexport type PagedAssetResourceOutput = Paged<AssetResourceOutput>;\n/** Paged collection of DataConnection items */\nexport type PagedDataConnectionOutput = Paged<DataConnectionOutput>;\n/** Paged collection of DiscoGroup items */\nexport type PagedDiscoGroupOutput = Paged<DiscoGroupOutput>;\n/** Paged collection of DiscoTemplate items */\nexport type PagedDiscoTemplateOutput = Paged<DiscoTemplateOutput>;\n/** Paged collection of SavedFilter items */\nexport type PagedSavedFilterOutput = Paged<SavedFilterOutput>;\n/** Paged collection of Task items */\nexport type PagedTaskOutput = Paged<TaskOutput>;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AAyCzF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,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AK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } 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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport {\n AssetUpdateData,\n DataConnectionData,\n DiscoGroupData,\n ReportAssetSnapshotRequest,\n ReportAssetSummaryRequest,\n SavedFilterData,\n} from \"./models\";\n\nexport interface ListAssetResourceQueryParamProperties {\n /** Filter the result list using the given expression. */\n filter?: string;\n /** A list of expressions that specify the order of the returned resources. */\n orderby?: string;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n /** Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. */\n mark?: string;\n}\n\nexport interface ListAssetResourceQueryParam {\n queryParameters?: ListAssetResourceQueryParamProperties;\n}\n\nexport type ListAssetResourceParameters = ListAssetResourceQueryParam & RequestParameters;\n\nexport interface UpdateAssetsBodyParam {\n body?: AssetUpdateData;\n}\n\nexport interface UpdateAssetsQueryParamProperties {\n /** An expression on the resource type that selects the resources to be returned. */\n filter: string;\n}\n\nexport interface UpdateAssetsQueryParam {\n queryParameters: UpdateAssetsQueryParamProperties;\n}\n\nexport type UpdateAssetsParameters = UpdateAssetsQueryParam &\n UpdateAssetsBodyParam &\n RequestParameters;\nexport type GetAssetResourceParameters = RequestParameters;\n\nexport interface ListDataConnectionQueryParamProperties {\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListDataConnectionQueryParam {\n queryParameters?: ListDataConnectionQueryParamProperties;\n}\n\nexport type ListDataConnectionParameters = ListDataConnectionQueryParam & RequestParameters;\n\nexport interface ValidateDataConnectionBodyParam {\n body?: DataConnectionData;\n}\n\nexport type ValidateDataConnectionParameters = ValidateDataConnectionBodyParam & RequestParameters;\nexport type GetDataConnectionParameters = RequestParameters;\n\nexport interface CreateOrReplaceDataConnectionBodyParam {\n body?: DataConnectionData;\n}\n\nexport type CreateOrReplaceDataConnectionParameters = CreateOrReplaceDataConnectionBodyParam &\n RequestParameters;\nexport type DeleteDataConnectionParameters = RequestParameters;\n\nexport interface ListDiscoGroupQueryParamProperties {\n /** Filter the result list using the given expression. */\n filter?: string;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListDiscoGroupQueryParam {\n queryParameters?: ListDiscoGroupQueryParamProperties;\n}\n\nexport type ListDiscoGroupParameters = ListDiscoGroupQueryParam & RequestParameters;\n\nexport interface ValidateDiscoGroupBodyParam {\n body?: DiscoGroupData;\n}\n\nexport type ValidateDiscoGroupParameters = ValidateDiscoGroupBodyParam & RequestParameters;\nexport type GetDiscoGroupParameters = RequestParameters;\n\nexport interface CreateOrReplaceDiscoGroupBodyParam {\n body?: DiscoGroupData;\n}\n\nexport type CreateOrReplaceDiscoGroupParameters = CreateOrReplaceDiscoGroupBodyParam &\n RequestParameters;\nexport type RunDiscoGroupParameters = RequestParameters;\n\nexport interface ListRunsQueryParamProperties {\n /** Filter the result list using the given expression. */\n filter?: string;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListRunsQueryParam {\n queryParameters?: ListRunsQueryParamProperties;\n}\n\nexport type ListRunsParameters = ListRunsQueryParam & RequestParameters;\n\nexport interface ListDiscoTemplateQueryParamProperties {\n /** Filter the result list using the given expression. */\n filter?: string;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListDiscoTemplateQueryParam {\n queryParameters?: ListDiscoTemplateQueryParamProperties;\n}\n\nexport type ListDiscoTemplateParameters = ListDiscoTemplateQueryParam & RequestParameters;\nexport type GetDiscoTemplateParameters = RequestParameters;\nexport type GetBillableParameters = RequestParameters;\n\nexport interface GetSnapshotBodyParam {\n body?: ReportAssetSnapshotRequest;\n}\n\nexport type GetSnapshotParameters = GetSnapshotBodyParam & RequestParameters;\n\nexport interface GetSummaryBodyParam {\n body?: ReportAssetSummaryRequest;\n}\n\nexport type GetSummaryParameters = GetSummaryBodyParam & RequestParameters;\n\nexport interface ListSavedFilterQueryParamProperties {\n /** Filter the result list using the given expression. */\n filter?: string;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListSavedFilterQueryParam {\n queryParameters?: ListSavedFilterQueryParamProperties;\n}\n\nexport type ListSavedFilterParameters = ListSavedFilterQueryParam & RequestParameters;\nexport type GetSavedFilterParameters = RequestParameters;\n\nexport interface CreateOrReplaceSavedFilterBodyParam {\n body?: SavedFilterData;\n}\n\nexport type CreateOrReplaceSavedFilterParameters = CreateOrReplaceSavedFilterBodyParam &\n RequestParameters;\nexport type DeleteSavedFilterParameters = RequestParameters;\n\nexport interface ListTaskQueryParamProperties {\n /** Filter the result list using the given expression. */\n filter?: string;\n /** A list of expressions that specify the order of the returned resources. */\n orderby?: string;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListTaskQueryParam {\n queryParameters?: ListTaskQueryParamProperties;\n}\n\nexport type ListTaskParameters = ListTaskQueryParam & RequestParameters;\nexport type GetTaskParameters = RequestParameters;\nexport type CancelTaskParameters = RequestParameters;\n"]}
|