@azure-rest/developer-devcenter 1.0.0-beta.2 → 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/README.md +11 -10
- package/dist/index.js +96 -150
- package/dist/index.js.map +1 -1
- package/dist-esm/src/{generated/azureDevCenter.js → azureDeveloperDevCenter.js} +13 -10
- package/dist-esm/src/azureDeveloperDevCenter.js.map +1 -0
- package/dist-esm/src/clientDefinitions.js.map +1 -0
- package/dist-esm/src/index.js +11 -11
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/isUnexpected.js +111 -0
- package/dist-esm/src/isUnexpected.js.map +1 -0
- package/dist-esm/src/logger.js +5 -0
- package/dist-esm/src/logger.js.map +1 -0
- package/dist-esm/src/models.js.map +1 -0
- package/dist-esm/src/outputModels.js.map +1 -0
- package/dist-esm/src/{generated/paginateHelper.js → paginateHelper.js} +4 -17
- package/dist-esm/src/paginateHelper.js.map +1 -0
- package/dist-esm/src/parameters.js.map +1 -0
- package/dist-esm/src/{generated/pollingHelper.js → pollingHelper.js} +11 -19
- package/dist-esm/src/pollingHelper.js.map +1 -0
- package/dist-esm/src/responses.js.map +1 -0
- package/package.json +35 -33
- package/review/developer-devcenter.api.md +930 -935
- package/types/developer-devcenter.d.ts +1138 -1177
- package/dist-esm/src/generated/azureDevCenter.js.map +0 -1
- package/dist-esm/src/generated/clientDefinitions.js.map +0 -1
- package/dist-esm/src/generated/index.js +0 -14
- package/dist-esm/src/generated/index.js.map +0 -1
- package/dist-esm/src/generated/isUnexpected.js +0 -155
- package/dist-esm/src/generated/isUnexpected.js.map +0 -1
- package/dist-esm/src/generated/models.js.map +0 -1
- package/dist-esm/src/generated/outputModels.js.map +0 -1
- package/dist-esm/src/generated/paginateHelper.js.map +0 -1
- package/dist-esm/src/generated/parameters.js.map +0 -1
- package/dist-esm/src/generated/pollingHelper.js.map +0 -1
- package/dist-esm/src/generated/responses.js.map +0 -1
- /package/dist-esm/src/{generated/clientDefinitions.js → clientDefinitions.js} +0 -0
- /package/dist-esm/src/{generated/models.js → models.js} +0 -0
- /package/dist-esm/src/{generated/outputModels.js → outputModels.js} +0 -0
- /package/dist-esm/src/{generated/parameters.js → parameters.js} +0 -0
- /package/dist-esm/src/{generated/responses.js → responses.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
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,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC;gBACjB,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,WAAW,CAAW,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC5D,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,YAAY,EAAE,QAAQ;iBACvB,CAAC;YACJ,CAAC;KACR,CAAC;IAEF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnE,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,kCAAkC,CAAC,CAAC;KAClF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;KACH;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,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"]}
|
|
@@ -0,0 +1 @@
|
|
|
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 { DevBox, Environment } from \"./models\";\n\nexport interface ListProjectsQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListProjectsQueryParam {\n queryParameters?: ListProjectsQueryParamProperties;\n}\n\nexport type ListProjectsParameters = ListProjectsQueryParam & RequestParameters;\nexport type GetProjectParameters = RequestParameters;\nexport type GetProjectOperationStatusParameters = RequestParameters;\n\nexport interface ListPoolsQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListPoolsQueryParam {\n queryParameters?: ListPoolsQueryParamProperties;\n}\n\nexport type ListPoolsParameters = ListPoolsQueryParam & RequestParameters;\nexport type GetPoolParameters = RequestParameters;\n\nexport interface ListSchedulesQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListSchedulesQueryParam {\n queryParameters?: ListSchedulesQueryParamProperties;\n}\n\nexport type ListSchedulesParameters = ListSchedulesQueryParam & RequestParameters;\nexport type GetScheduleParameters = RequestParameters;\n\nexport interface ListDevBoxesQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListDevBoxesQueryParam {\n queryParameters?: ListDevBoxesQueryParamProperties;\n}\n\nexport type ListDevBoxesParameters = ListDevBoxesQueryParam & RequestParameters;\nexport type GetDevBoxParameters = RequestParameters;\n\nexport interface CreateDevBoxBodyParam {\n /** Represents a environment. */\n body: DevBox;\n}\n\nexport type CreateDevBoxParameters = CreateDevBoxBodyParam & RequestParameters;\nexport type DeleteDevBoxParameters = RequestParameters;\nexport type StartDevBoxParameters = RequestParameters;\n\nexport interface StopDevBoxQueryParamProperties {\n /** Optional parameter to hibernate the dev box. */\n hibernate?: boolean;\n}\n\nexport interface StopDevBoxQueryParam {\n queryParameters?: StopDevBoxQueryParamProperties;\n}\n\nexport type StopDevBoxParameters = StopDevBoxQueryParam & RequestParameters;\nexport type RestartDevBoxParameters = RequestParameters;\nexport type GetRemoteConnectionParameters = RequestParameters;\nexport type ListDevBoxActionsParameters = RequestParameters;\nexport type GetDevBoxActionParameters = RequestParameters;\nexport type SkipActionParameters = RequestParameters;\n\nexport interface DelayActionQueryParamProperties {\n /** The time to delay the Dev Box action or actions until. */\n until: Date | string;\n}\n\nexport interface DelayActionQueryParam {\n queryParameters: DelayActionQueryParamProperties;\n}\n\nexport type DelayActionParameters = DelayActionQueryParam & RequestParameters;\n\nexport interface DelayAllActionsQueryParamProperties {\n /** The time to delay the Dev Box action or actions until. */\n until: Date | string;\n}\n\nexport interface DelayAllActionsQueryParam {\n queryParameters: DelayAllActionsQueryParamProperties;\n}\n\nexport type DelayAllActionsParameters = DelayAllActionsQueryParam & RequestParameters;\n\nexport interface ListAllDevBoxesQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListAllDevBoxesQueryParam {\n queryParameters?: ListAllDevBoxesQueryParamProperties;\n}\n\nexport type ListAllDevBoxesParameters = ListAllDevBoxesQueryParam & RequestParameters;\n\nexport interface ListAllDevBoxesByUserQueryParamProperties {\n /** An OData filter clause to apply to the operation. */\n filter?: string;\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListAllDevBoxesByUserQueryParam {\n queryParameters?: ListAllDevBoxesByUserQueryParamProperties;\n}\n\nexport type ListAllDevBoxesByUserParameters = ListAllDevBoxesByUserQueryParam & RequestParameters;\n\nexport interface ListAllEnvironmentsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListAllEnvironmentsQueryParam {\n queryParameters?: ListAllEnvironmentsQueryParamProperties;\n}\n\nexport type ListAllEnvironmentsParameters = ListAllEnvironmentsQueryParam & RequestParameters;\n\nexport interface ListEnvironmentsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListEnvironmentsQueryParam {\n queryParameters?: ListEnvironmentsQueryParamProperties;\n}\n\nexport type ListEnvironmentsParameters = ListEnvironmentsQueryParam & RequestParameters;\nexport type GetEnvironmentParameters = RequestParameters;\n\nexport interface CreateOrUpdateEnvironmentBodyParam {\n /** Represents an environment. */\n body: Environment;\n}\n\nexport type CreateOrUpdateEnvironmentParameters = CreateOrUpdateEnvironmentBodyParam &\n RequestParameters;\nexport type DeleteEnvironmentParameters = RequestParameters;\n\nexport interface ListCatalogsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListCatalogsQueryParam {\n queryParameters?: ListCatalogsQueryParamProperties;\n}\n\nexport type ListCatalogsParameters = ListCatalogsQueryParam & RequestParameters;\nexport type GetCatalogParameters = RequestParameters;\n\nexport interface ListEnvironmentDefinitionsQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListEnvironmentDefinitionsQueryParam {\n queryParameters?: ListEnvironmentDefinitionsQueryParamProperties;\n}\n\nexport type ListEnvironmentDefinitionsParameters = ListEnvironmentDefinitionsQueryParam &\n RequestParameters;\n\nexport interface ListEnvironmentDefinitionsByCatalogQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListEnvironmentDefinitionsByCatalogQueryParam {\n queryParameters?: ListEnvironmentDefinitionsByCatalogQueryParamProperties;\n}\n\nexport type ListEnvironmentDefinitionsByCatalogParameters =\n ListEnvironmentDefinitionsByCatalogQueryParam & RequestParameters;\nexport type GetEnvironmentDefinitionParameters = RequestParameters;\n\nexport interface ListEnvironmentTypesQueryParamProperties {\n /** The maximum number of resources to return from the operation. Example: 'top=10'. */\n top?: number;\n}\n\nexport interface ListEnvironmentTypesQueryParam {\n queryParameters?: ListEnvironmentTypesQueryParamProperties;\n}\n\nexport type ListEnvironmentTypesParameters = ListEnvironmentTypesQueryParam & RequestParameters;\n"]}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param client - Client to use for sending the request to get additional pages.
|
|
7
|
-
* @param initialResponse - The initial response.
|
|
8
|
-
* @param options - Options to set a resume state or custom polling interval.
|
|
9
|
-
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
10
|
-
*/
|
|
11
|
-
export function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
3
|
+
import { createHttpPoller, } from "@azure/core-lro";
|
|
4
|
+
export async function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
5
|
+
var _a;
|
|
12
6
|
const poller = {
|
|
13
7
|
requestMethod: initialResponse.request.method,
|
|
14
8
|
requestPath: initialResponse.request.url,
|
|
@@ -23,21 +17,19 @@ export function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
|
23
17
|
// to get the latest status. We use the client provided and the polling path
|
|
24
18
|
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
25
19
|
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
26
|
-
const response = await client
|
|
27
|
-
.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url)
|
|
28
|
-
.get();
|
|
20
|
+
const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
|
|
29
21
|
const lroResponse = getLroResponse(response);
|
|
30
|
-
lroResponse.rawResponse.headers["x-ms-original-url"] =
|
|
31
|
-
initialResponse.request.url;
|
|
22
|
+
lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
|
|
32
23
|
return lroResponse;
|
|
33
|
-
}
|
|
24
|
+
},
|
|
34
25
|
};
|
|
35
|
-
|
|
26
|
+
options.resolveOnUnsuccessful = (_a = options.resolveOnUnsuccessful) !== null && _a !== void 0 ? _a : true;
|
|
27
|
+
return createHttpPoller(poller, options);
|
|
36
28
|
}
|
|
37
29
|
/**
|
|
38
|
-
* Converts a Rest Client response to a response that the LRO
|
|
30
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
39
31
|
* @param response - a rest client http response
|
|
40
|
-
* @returns - An LRO response that the LRO
|
|
32
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
41
33
|
*/
|
|
42
34
|
function getLroResponse(response) {
|
|
43
35
|
if (Number.isNaN(response.status)) {
|
|
@@ -45,7 +37,7 @@ function getLroResponse(response) {
|
|
|
45
37
|
}
|
|
46
38
|
return {
|
|
47
39
|
flatResponse: response,
|
|
48
|
-
rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body })
|
|
40
|
+
rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
|
|
49
41
|
};
|
|
50
42
|
}
|
|
51
43
|
//# sourceMappingURL=pollingHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAML,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAwFzB,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,eAAwB,EACxB,UAAqE,EAAE;;IAEvE,MAAM,MAAM,GAAkC;QAC5C,aAAa,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM;QAC7C,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG;QACxC,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,sGAAsG;YACtG,2FAA2F;YAC3F,6BAA6B;YAC7B,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAC9B,sEAAsE;YACtE,4EAA4E;YAC5E,0JAA0J;YAC1J,+GAA+G;YAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YACvF,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;YACxD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;YACnF,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,OAAO,CAAC,qBAAqB,GAAG,MAAA,OAAO,CAAC,qBAAqB,mCAAI,IAAI,CAAC;IACtE,OAAO,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAA+B,QAAiB;IACrE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,uDAAuD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;KAC/F;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,kCACN,QAAQ,KACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n CreateHttpPollerOptions,\n LongRunningOperation,\n LroResponse,\n OperationState,\n SimplePollerLike,\n createHttpPoller,\n} from \"@azure/core-lro\";\nimport {\n CreateDevBox200Response,\n CreateDevBox201Response,\n CreateDevBoxDefaultResponse,\n CreateDevBoxLogicalResponse,\n DeleteDevBox202Response,\n DeleteDevBox204Response,\n DeleteDevBoxDefaultResponse,\n DeleteDevBoxLogicalResponse,\n StartDevBox202Response,\n StartDevBoxDefaultResponse,\n StartDevBoxLogicalResponse,\n StopDevBox202Response,\n StopDevBoxDefaultResponse,\n StopDevBoxLogicalResponse,\n RestartDevBox202Response,\n RestartDevBoxDefaultResponse,\n RestartDevBoxLogicalResponse,\n CreateOrUpdateEnvironment201Response,\n CreateOrUpdateEnvironmentDefaultResponse,\n CreateOrUpdateEnvironmentLogicalResponse,\n DeleteEnvironment202Response,\n DeleteEnvironment204Response,\n DeleteEnvironmentDefaultResponse,\n DeleteEnvironmentLogicalResponse,\n} from \"./responses\";\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport async function getLongRunningPoller<\n TResult extends CreateDevBoxLogicalResponse | CreateDevBoxDefaultResponse\n>(\n client: Client,\n initialResponse: CreateDevBox200Response | CreateDevBox201Response | CreateDevBoxDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends DeleteDevBoxLogicalResponse | DeleteDevBoxDefaultResponse\n>(\n client: Client,\n initialResponse: DeleteDevBox202Response | DeleteDevBox204Response | DeleteDevBoxDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends StartDevBoxLogicalResponse | StartDevBoxDefaultResponse\n>(\n client: Client,\n initialResponse: StartDevBox202Response | StartDevBoxDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends StopDevBoxLogicalResponse | StopDevBoxDefaultResponse\n>(\n client: Client,\n initialResponse: StopDevBox202Response | StopDevBoxDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends RestartDevBoxLogicalResponse | RestartDevBoxDefaultResponse\n>(\n client: Client,\n initialResponse: RestartDevBox202Response | RestartDevBoxDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends\n | CreateOrUpdateEnvironmentLogicalResponse\n | CreateOrUpdateEnvironmentDefaultResponse\n>(\n client: Client,\n initialResponse: CreateOrUpdateEnvironment201Response | CreateOrUpdateEnvironmentDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends DeleteEnvironmentLogicalResponse | DeleteEnvironmentDefaultResponse\n>(\n client: Client,\n initialResponse:\n | DeleteEnvironment202Response\n | DeleteEnvironment204Response\n | DeleteEnvironmentDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;\n return createHttpPoller(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport {\n PagedProjectOutput,\n ProjectOutput,\n OperationStatusOutput,\n PagedPoolOutput,\n PoolOutput,\n PagedScheduleOutput,\n ScheduleOutput,\n PagedDevBoxOutput,\n DevBoxOutput,\n RemoteConnectionOutput,\n PagedDevBoxActionOutput,\n DevBoxActionOutput,\n PagedDevBoxActionDelayResultOutput,\n PagedEnvironmentOutput,\n EnvironmentOutput,\n PagedCatalogOutput,\n CatalogOutput,\n PagedEnvironmentDefinitionOutput,\n EnvironmentDefinitionOutput,\n PagedEnvironmentTypeOutput,\n} from \"./outputModels\";\n\n/** The request has succeeded. */\nexport interface ListProjects200Response extends HttpResponse {\n status: \"200\";\n body: PagedProjectOutput;\n}\n\nexport interface ListProjectsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListProjectsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListProjectsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetProject200Response extends HttpResponse {\n status: \"200\";\n body: ProjectOutput;\n}\n\nexport interface GetProjectDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetProjectDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetProjectDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetProjectOperationStatus200Response extends HttpResponse {\n status: \"200\";\n body: OperationStatusOutput;\n}\n\nexport interface GetProjectOperationStatusDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetProjectOperationStatusDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetProjectOperationStatusDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListPools200Response extends HttpResponse {\n status: \"200\";\n body: PagedPoolOutput;\n}\n\nexport interface ListPoolsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListPoolsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListPoolsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetPool200Response extends HttpResponse {\n status: \"200\";\n body: PoolOutput;\n}\n\nexport interface GetPoolDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetPoolDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetPoolDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListSchedules200Response extends HttpResponse {\n status: \"200\";\n body: PagedScheduleOutput;\n}\n\nexport interface ListSchedulesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListSchedulesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListSchedulesDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetSchedule200Response extends HttpResponse {\n status: \"200\";\n body: ScheduleOutput;\n}\n\nexport interface GetScheduleDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetScheduleDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetScheduleDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListDevBoxes200Response extends HttpResponse {\n status: \"200\";\n body: PagedDevBoxOutput;\n}\n\nexport interface ListDevBoxesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListDevBoxesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListDevBoxesDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetDevBox200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface GetDevBoxDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetDevBoxDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface CreateDevBox200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface CreateDevBox201Headers {\n location: string;\n \"operation-location\": string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface CreateDevBox201Response extends HttpResponse {\n status: \"201\";\n body: DevBoxOutput;\n headers: RawHttpHeaders & CreateDevBox201Headers;\n}\n\nexport interface CreateDevBoxDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CreateDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CreateDevBoxDefaultHeaders;\n}\n\n/** The final response for long-running CreateDevBox operation */\nexport interface CreateDevBoxLogicalResponse extends HttpResponse {\n status: \"200\";\n body: DevBoxOutput;\n}\n\nexport interface DeleteDevBox202Headers {\n location: string;\n \"operation-location\": string;\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface DeleteDevBox202Response extends HttpResponse {\n status: \"202\";\n body: OperationStatusOutput;\n headers: RawHttpHeaders & DeleteDevBox202Headers;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteDevBox204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteDevBoxDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteDevBoxDefaultHeaders;\n}\n\n/** The final response for long-running DeleteDevBox operation */\nexport interface DeleteDevBoxLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OperationStatusOutput;\n}\n\nexport interface StartDevBox202Headers {\n /** The location for monitoring the operation state. */\n \"operation-location\": string;\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface StartDevBox202Response extends HttpResponse {\n status: \"202\";\n body: OperationStatusOutput;\n headers: RawHttpHeaders & StartDevBox202Headers;\n}\n\nexport interface StartDevBoxDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface StartDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & StartDevBoxDefaultHeaders;\n}\n\n/** The final response for long-running StartDevBox operation */\nexport interface StartDevBoxLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OperationStatusOutput;\n}\n\nexport interface StopDevBox202Headers {\n /** The location for monitoring the operation state. */\n \"operation-location\": string;\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface StopDevBox202Response extends HttpResponse {\n status: \"202\";\n body: OperationStatusOutput;\n headers: RawHttpHeaders & StopDevBox202Headers;\n}\n\nexport interface StopDevBoxDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface StopDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & StopDevBoxDefaultHeaders;\n}\n\n/** The final response for long-running StopDevBox operation */\nexport interface StopDevBoxLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OperationStatusOutput;\n}\n\nexport interface RestartDevBox202Headers {\n /** The location for monitoring the operation state. */\n \"operation-location\": string;\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface RestartDevBox202Response extends HttpResponse {\n status: \"202\";\n body: OperationStatusOutput;\n headers: RawHttpHeaders & RestartDevBox202Headers;\n}\n\nexport interface RestartDevBoxDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface RestartDevBoxDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & RestartDevBoxDefaultHeaders;\n}\n\n/** The final response for long-running RestartDevBox operation */\nexport interface RestartDevBoxLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OperationStatusOutput;\n}\n\n/** The request has succeeded. */\nexport interface GetRemoteConnection200Response extends HttpResponse {\n status: \"200\";\n body: RemoteConnectionOutput;\n}\n\nexport interface GetRemoteConnectionDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetRemoteConnectionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetRemoteConnectionDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListDevBoxActions200Response extends HttpResponse {\n status: \"200\";\n body: PagedDevBoxActionOutput;\n}\n\nexport interface ListDevBoxActionsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListDevBoxActionsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListDevBoxActionsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetDevBoxAction200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxActionOutput;\n}\n\nexport interface GetDevBoxActionDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetDevBoxActionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetDevBoxActionDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface SkipAction204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface SkipActionDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface SkipActionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & SkipActionDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface DelayAction200Response extends HttpResponse {\n status: \"200\";\n body: DevBoxActionOutput;\n}\n\nexport interface DelayActionDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DelayActionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DelayActionDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface DelayAllActions200Response extends HttpResponse {\n status: \"200\";\n body: PagedDevBoxActionDelayResultOutput;\n}\n\nexport interface DelayAllActionsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DelayAllActionsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DelayAllActionsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListAllDevBoxes200Response extends HttpResponse {\n status: \"200\";\n body: PagedDevBoxOutput;\n}\n\nexport interface ListAllDevBoxesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListAllDevBoxesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListAllDevBoxesDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListAllDevBoxesByUser200Response extends HttpResponse {\n status: \"200\";\n body: PagedDevBoxOutput;\n}\n\nexport interface ListAllDevBoxesByUserDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListAllDevBoxesByUserDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListAllDevBoxesByUserDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListAllEnvironments200Response extends HttpResponse {\n status: \"200\";\n body: PagedEnvironmentOutput;\n}\n\nexport interface ListAllEnvironmentsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListAllEnvironmentsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListAllEnvironmentsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListEnvironments200Response extends HttpResponse {\n status: \"200\";\n body: PagedEnvironmentOutput;\n}\n\nexport interface ListEnvironmentsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListEnvironmentsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListEnvironmentsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentOutput;\n}\n\nexport interface GetEnvironmentDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetEnvironmentDefaultHeaders;\n}\n\nexport interface CreateOrUpdateEnvironment201Headers {\n \"operation-location\": string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface CreateOrUpdateEnvironment201Response extends HttpResponse {\n status: \"201\";\n body: EnvironmentOutput;\n headers: RawHttpHeaders & CreateOrUpdateEnvironment201Headers;\n}\n\nexport interface CreateOrUpdateEnvironmentDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CreateOrUpdateEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CreateOrUpdateEnvironmentDefaultHeaders;\n}\n\n/** The final response for long-running CreateOrUpdateEnvironment operation */\nexport interface CreateOrUpdateEnvironmentLogicalResponse extends HttpResponse {\n status: \"200\";\n body: EnvironmentOutput;\n}\n\nexport interface DeleteEnvironment202Headers {\n location: string;\n \"operation-location\": string;\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface DeleteEnvironment202Response extends HttpResponse {\n status: \"202\";\n body: OperationStatusOutput;\n headers: RawHttpHeaders & DeleteEnvironment202Headers;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteEnvironment204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteEnvironmentDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteEnvironmentDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteEnvironmentDefaultHeaders;\n}\n\n/** The final response for long-running DeleteEnvironment operation */\nexport interface DeleteEnvironmentLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OperationStatusOutput;\n}\n\n/** The request has succeeded. */\nexport interface ListCatalogs200Response extends HttpResponse {\n status: \"200\";\n body: PagedCatalogOutput;\n}\n\nexport interface ListCatalogsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListCatalogsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListCatalogsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetCatalog200Response extends HttpResponse {\n status: \"200\";\n body: CatalogOutput;\n}\n\nexport interface GetCatalogDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetCatalogDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetCatalogDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListEnvironmentDefinitions200Response extends HttpResponse {\n status: \"200\";\n body: PagedEnvironmentDefinitionOutput;\n}\n\nexport interface ListEnvironmentDefinitionsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListEnvironmentDefinitionsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListEnvironmentDefinitionsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListEnvironmentDefinitionsByCatalog200Response extends HttpResponse {\n status: \"200\";\n body: PagedEnvironmentDefinitionOutput;\n}\n\nexport interface ListEnvironmentDefinitionsByCatalogDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListEnvironmentDefinitionsByCatalogDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListEnvironmentDefinitionsByCatalogDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetEnvironmentDefinition200Response extends HttpResponse {\n status: \"200\";\n body: EnvironmentDefinitionOutput;\n}\n\nexport interface GetEnvironmentDefinitionDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetEnvironmentDefinitionDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetEnvironmentDefinitionDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListEnvironmentTypes200Response extends HttpResponse {\n status: \"200\";\n body: PagedEnvironmentTypeOutput;\n}\n\nexport interface ListEnvironmentTypesDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListEnvironmentTypesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListEnvironmentTypesDefaultHeaders;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"name": "@azure-rest/developer-devcenter",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-beta.
|
|
6
|
-
"description": "",
|
|
5
|
+
"version": "1.0.0-beta.3",
|
|
6
|
+
"description": "Azure Developer DevCenter Client",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
9
9
|
"azure",
|
|
@@ -29,14 +29,6 @@
|
|
|
29
29
|
"LICENSE",
|
|
30
30
|
"review/*"
|
|
31
31
|
],
|
|
32
|
-
"//metadata": {
|
|
33
|
-
"constantPaths": [
|
|
34
|
-
{
|
|
35
|
-
"path": "swagger/README.md",
|
|
36
|
-
"prefix": "package-version"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
32
|
"//sampleConfiguration": {
|
|
41
33
|
"productName": "Azure DevCenter",
|
|
42
34
|
"productSlugs": [
|
|
@@ -46,7 +38,7 @@
|
|
|
46
38
|
"apiRefLink": "https://learn.microsoft.com/azure/dev-box/"
|
|
47
39
|
},
|
|
48
40
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
41
|
+
"node": ">=18.0.0"
|
|
50
42
|
},
|
|
51
43
|
"scripts": {
|
|
52
44
|
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
|
@@ -55,12 +47,12 @@
|
|
|
55
47
|
"build:samples": "echo skipped.",
|
|
56
48
|
"build:test": "tsc -p . && dev-tool run bundle",
|
|
57
49
|
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
|
|
58
|
-
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"
|
|
59
|
-
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
50
|
+
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
|
|
51
|
+
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
60
52
|
"execute:samples": "echo skipped",
|
|
61
53
|
"extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
|
|
62
|
-
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"
|
|
63
|
-
"generate:client": "
|
|
54
|
+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
|
|
55
|
+
"generate:client": "echo skipped",
|
|
64
56
|
"integration-test:browser": "dev-tool run test:browser",
|
|
65
57
|
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
|
|
66
58
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
@@ -71,7 +63,7 @@
|
|
|
71
63
|
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
|
|
72
64
|
"test": "npm run clean && npm run build:test && npm run unit-test",
|
|
73
65
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
74
|
-
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout
|
|
66
|
+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
75
67
|
"unit-test:browser": "echo skipped",
|
|
76
68
|
"build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local"
|
|
77
69
|
},
|
|
@@ -79,47 +71,57 @@
|
|
|
79
71
|
"autoPublish": false,
|
|
80
72
|
"dependencies": {
|
|
81
73
|
"@azure/core-auth": "^1.3.0",
|
|
82
|
-
"@azure-rest/core-client": "1.
|
|
83
|
-
"@azure/core-rest-pipeline": "^1.
|
|
74
|
+
"@azure-rest/core-client": "^1.1.4",
|
|
75
|
+
"@azure/core-rest-pipeline": "^1.12.0",
|
|
84
76
|
"@azure/logger": "^1.0.0",
|
|
85
77
|
"tslib": "^2.2.0",
|
|
86
|
-
"@azure/core-paging": "^1.
|
|
87
|
-
"@azure/core-lro": "^2.
|
|
78
|
+
"@azure/core-paging": "^1.5.0",
|
|
79
|
+
"@azure/core-lro": "^2.5.4",
|
|
80
|
+
"@azure/abort-controller": "^1.0.0"
|
|
88
81
|
},
|
|
89
82
|
"devDependencies": {
|
|
90
83
|
"@microsoft/api-extractor": "^7.31.1",
|
|
91
84
|
"autorest": "latest",
|
|
92
|
-
"@types/node": "^
|
|
85
|
+
"@types/node": "^18.0.0",
|
|
93
86
|
"dotenv": "^16.0.0",
|
|
94
|
-
"eslint": "^
|
|
95
|
-
"mkdirp": "^1.
|
|
87
|
+
"eslint": "^8.0.0",
|
|
88
|
+
"mkdirp": "^2.1.2",
|
|
96
89
|
"prettier": "^2.5.1",
|
|
97
|
-
"rimraf": "^
|
|
90
|
+
"rimraf": "^5.0.0",
|
|
98
91
|
"source-map-support": "^0.5.9",
|
|
99
|
-
"typescript": "~
|
|
92
|
+
"typescript": "~5.2.0",
|
|
100
93
|
"@azure/dev-tool": "^1.0.0",
|
|
101
94
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
102
95
|
"@azure-tools/test-credential": "^1.0.0",
|
|
103
|
-
"@azure/identity": "^
|
|
104
|
-
"@azure-tools/test-recorder": "^
|
|
105
|
-
"mocha": "^
|
|
96
|
+
"@azure/identity": "^3.3.0",
|
|
97
|
+
"@azure-tools/test-recorder": "^3.0.0",
|
|
98
|
+
"mocha": "^10.0.0",
|
|
99
|
+
"esm": "^3.2.18",
|
|
100
|
+
"@types/mocha": "^10.0.0",
|
|
106
101
|
"mocha-junit-reporter": "^1.18.0",
|
|
107
102
|
"cross-env": "^7.0.2",
|
|
108
103
|
"@types/chai": "^4.2.8",
|
|
109
104
|
"chai": "^4.2.0",
|
|
110
105
|
"karma-chrome-launcher": "^3.0.0",
|
|
111
106
|
"karma-coverage": "^2.0.0",
|
|
112
|
-
"karma-edge-launcher": "^0.4.2",
|
|
113
107
|
"karma-env-preprocessor": "^0.1.1",
|
|
114
|
-
"karma-firefox-launcher": "^
|
|
115
|
-
"karma-ie-launcher": "^1.0.0",
|
|
108
|
+
"karma-firefox-launcher": "^2.1.2",
|
|
116
109
|
"karma-junit-reporter": "^2.0.1",
|
|
117
110
|
"karma-mocha-reporter": "^2.2.5",
|
|
118
111
|
"karma-mocha": "^2.0.1",
|
|
119
112
|
"karma-source-map-support": "~1.4.0",
|
|
120
|
-
"karma-sourcemap-loader": "^0.
|
|
113
|
+
"karma-sourcemap-loader": "^0.4.0",
|
|
121
114
|
"karma": "^6.2.0",
|
|
122
|
-
"
|
|
115
|
+
"c8": "^8.0.0",
|
|
116
|
+
"ts-node": "^10.0.0"
|
|
117
|
+
},
|
|
118
|
+
"//metadata": {
|
|
119
|
+
"constantPaths": [
|
|
120
|
+
{
|
|
121
|
+
"path": "src/azureDeveloperDevCenter.ts",
|
|
122
|
+
"prefix": "userAgentInfo"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
123
125
|
},
|
|
124
126
|
"browser": {
|
|
125
127
|
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
|