@azure-rest/health-insights-cancerprofiling 1.0.0-alpha.20241125.1 → 1.0.0-alpha.20241127.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/browser/cancerProfilingRest.d.ts +11 -0
  2. package/dist/browser/cancerProfilingRest.d.ts.map +1 -0
  3. package/{dist-esm/src → dist/browser}/cancerProfilingRest.js +1 -1
  4. package/dist/browser/cancerProfilingRest.js.map +1 -0
  5. package/dist/browser/clientDefinitions.d.ts +21 -0
  6. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  7. package/dist/browser/clientDefinitions.js.map +1 -0
  8. package/dist/browser/index.d.ts +11 -0
  9. package/dist/browser/index.d.ts.map +1 -0
  10. package/dist/browser/index.js +14 -0
  11. package/dist/browser/index.js.map +1 -0
  12. package/dist/browser/isUnexpected.d.ts +4 -0
  13. package/dist/browser/isUnexpected.d.ts.map +1 -0
  14. package/dist/browser/isUnexpected.js.map +1 -0
  15. package/dist/browser/logger.d.ts +2 -0
  16. package/dist/browser/logger.d.ts.map +1 -0
  17. package/dist/browser/models.d.ts +92 -0
  18. package/dist/browser/models.d.ts.map +1 -0
  19. package/dist/browser/outputModels.d.ts +109 -0
  20. package/dist/browser/outputModels.d.ts.map +1 -0
  21. package/dist/browser/package.json +3 -0
  22. package/dist/browser/parameters.d.ts +18 -0
  23. package/dist/browser/parameters.d.ts.map +1 -0
  24. package/dist/browser/parameters.js.map +1 -0
  25. package/dist/browser/pollingHelper.d.ts +12 -0
  26. package/dist/browser/pollingHelper.d.ts.map +1 -0
  27. package/dist/browser/pollingHelper.js.map +1 -0
  28. package/dist/browser/responses.d.ts +50 -0
  29. package/dist/browser/responses.d.ts.map +1 -0
  30. package/dist/browser/responses.js.map +1 -0
  31. package/dist/commonjs/cancerProfilingRest.d.ts +11 -0
  32. package/dist/commonjs/cancerProfilingRest.d.ts.map +1 -0
  33. package/dist/commonjs/cancerProfilingRest.js +33 -0
  34. package/dist/commonjs/cancerProfilingRest.js.map +1 -0
  35. package/dist/commonjs/clientDefinitions.d.ts +21 -0
  36. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  37. package/dist/commonjs/clientDefinitions.js +5 -0
  38. package/dist/commonjs/clientDefinitions.js.map +1 -0
  39. package/dist/commonjs/index.d.ts +11 -0
  40. package/dist/commonjs/index.d.ts.map +1 -0
  41. package/dist/commonjs/index.js +17 -0
  42. package/dist/commonjs/index.js.map +1 -0
  43. package/dist/commonjs/isUnexpected.d.ts +4 -0
  44. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  45. package/dist/commonjs/isUnexpected.js +75 -0
  46. package/dist/commonjs/isUnexpected.js.map +1 -0
  47. package/dist/commonjs/logger.d.ts +2 -0
  48. package/dist/commonjs/logger.d.ts.map +1 -0
  49. package/dist/commonjs/logger.js +8 -0
  50. package/dist/commonjs/logger.js.map +1 -0
  51. package/dist/commonjs/models.d.ts +92 -0
  52. package/dist/commonjs/models.d.ts.map +1 -0
  53. package/dist/commonjs/models.js +5 -0
  54. package/dist/commonjs/models.js.map +1 -0
  55. package/dist/commonjs/outputModels.d.ts +109 -0
  56. package/dist/commonjs/outputModels.d.ts.map +1 -0
  57. package/dist/commonjs/outputModels.js +5 -0
  58. package/dist/commonjs/outputModels.js.map +1 -0
  59. package/dist/commonjs/package.json +3 -0
  60. package/dist/commonjs/parameters.d.ts +18 -0
  61. package/dist/commonjs/parameters.d.ts.map +1 -0
  62. package/dist/commonjs/parameters.js +5 -0
  63. package/dist/commonjs/parameters.js.map +1 -0
  64. package/dist/commonjs/pollingHelper.d.ts +12 -0
  65. package/dist/commonjs/pollingHelper.d.ts.map +1 -0
  66. package/dist/commonjs/pollingHelper.js +46 -0
  67. package/dist/commonjs/pollingHelper.js.map +1 -0
  68. package/dist/commonjs/responses.d.ts +50 -0
  69. package/dist/commonjs/responses.d.ts.map +1 -0
  70. package/dist/commonjs/responses.js +5 -0
  71. package/dist/commonjs/responses.js.map +1 -0
  72. package/dist/commonjs/tsdoc-metadata.json +11 -0
  73. package/dist/esm/cancerProfilingRest.d.ts +11 -0
  74. package/dist/esm/cancerProfilingRest.d.ts.map +1 -0
  75. package/dist/esm/cancerProfilingRest.js +30 -0
  76. package/dist/esm/cancerProfilingRest.js.map +1 -0
  77. package/dist/esm/clientDefinitions.d.ts +21 -0
  78. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  79. package/dist/esm/clientDefinitions.js +4 -0
  80. package/dist/esm/clientDefinitions.js.map +1 -0
  81. package/dist/esm/index.d.ts +11 -0
  82. package/dist/esm/index.d.ts.map +1 -0
  83. package/dist/esm/index.js +14 -0
  84. package/dist/esm/index.js.map +1 -0
  85. package/dist/esm/isUnexpected.d.ts +4 -0
  86. package/dist/esm/isUnexpected.d.ts.map +1 -0
  87. package/dist/esm/isUnexpected.js +72 -0
  88. package/dist/esm/isUnexpected.js.map +1 -0
  89. package/dist/esm/logger.d.ts +2 -0
  90. package/dist/esm/logger.d.ts.map +1 -0
  91. package/dist/esm/logger.js +5 -0
  92. package/dist/esm/logger.js.map +1 -0
  93. package/dist/esm/models.d.ts +92 -0
  94. package/dist/esm/models.d.ts.map +1 -0
  95. package/dist/esm/models.js +4 -0
  96. package/dist/esm/models.js.map +1 -0
  97. package/dist/esm/outputModels.d.ts +109 -0
  98. package/dist/esm/outputModels.d.ts.map +1 -0
  99. package/dist/esm/outputModels.js +4 -0
  100. package/dist/esm/outputModels.js.map +1 -0
  101. package/dist/esm/package.json +3 -0
  102. package/dist/esm/parameters.d.ts +18 -0
  103. package/dist/esm/parameters.d.ts.map +1 -0
  104. package/dist/esm/parameters.js +4 -0
  105. package/dist/esm/parameters.js.map +1 -0
  106. package/dist/esm/pollingHelper.d.ts +12 -0
  107. package/dist/esm/pollingHelper.d.ts.map +1 -0
  108. package/dist/esm/pollingHelper.js +43 -0
  109. package/dist/esm/pollingHelper.js.map +1 -0
  110. package/dist/esm/responses.d.ts +50 -0
  111. package/dist/esm/responses.d.ts.map +1 -0
  112. package/dist/esm/responses.js +4 -0
  113. package/dist/esm/responses.js.map +1 -0
  114. package/dist/react-native/cancerProfilingRest.d.ts +11 -0
  115. package/dist/react-native/cancerProfilingRest.d.ts.map +1 -0
  116. package/dist/react-native/cancerProfilingRest.js +30 -0
  117. package/dist/react-native/cancerProfilingRest.js.map +1 -0
  118. package/dist/react-native/clientDefinitions.d.ts +21 -0
  119. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  120. package/dist/react-native/clientDefinitions.js +4 -0
  121. package/dist/react-native/clientDefinitions.js.map +1 -0
  122. package/dist/react-native/index.d.ts +11 -0
  123. package/dist/react-native/index.d.ts.map +1 -0
  124. package/dist/react-native/index.js +14 -0
  125. package/dist/react-native/index.js.map +1 -0
  126. package/dist/react-native/isUnexpected.d.ts +4 -0
  127. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  128. package/dist/react-native/isUnexpected.js +72 -0
  129. package/dist/react-native/isUnexpected.js.map +1 -0
  130. package/dist/react-native/logger.d.ts +2 -0
  131. package/dist/react-native/logger.d.ts.map +1 -0
  132. package/dist/react-native/logger.js +5 -0
  133. package/dist/react-native/logger.js.map +1 -0
  134. package/dist/react-native/models.d.ts +92 -0
  135. package/dist/react-native/models.d.ts.map +1 -0
  136. package/dist/react-native/models.js +4 -0
  137. package/dist/react-native/models.js.map +1 -0
  138. package/dist/react-native/outputModels.d.ts +109 -0
  139. package/dist/react-native/outputModels.d.ts.map +1 -0
  140. package/dist/react-native/outputModels.js +4 -0
  141. package/dist/react-native/outputModels.js.map +1 -0
  142. package/dist/react-native/package.json +3 -0
  143. package/dist/react-native/parameters.d.ts +18 -0
  144. package/dist/react-native/parameters.d.ts.map +1 -0
  145. package/dist/react-native/parameters.js +4 -0
  146. package/dist/react-native/parameters.js.map +1 -0
  147. package/dist/react-native/pollingHelper.d.ts +12 -0
  148. package/dist/react-native/pollingHelper.d.ts.map +1 -0
  149. package/dist/react-native/pollingHelper.js +43 -0
  150. package/dist/react-native/pollingHelper.js.map +1 -0
  151. package/dist/react-native/responses.d.ts +50 -0
  152. package/dist/react-native/responses.d.ts.map +1 -0
  153. package/dist/react-native/responses.js +4 -0
  154. package/dist/react-native/responses.js.map +1 -0
  155. package/package.json +67 -47
  156. package/dist/index.js +0 -161
  157. package/dist/index.js.map +0 -1
  158. package/dist-esm/src/cancerProfilingRest.js.map +0 -1
  159. package/dist-esm/src/clientDefinitions.js.map +0 -1
  160. package/dist-esm/src/index.js +0 -13
  161. package/dist-esm/src/index.js.map +0 -1
  162. package/dist-esm/src/isUnexpected.js.map +0 -1
  163. package/dist-esm/src/parameters.js.map +0 -1
  164. package/dist-esm/src/pollingHelper.js.map +0 -1
  165. package/dist-esm/src/responses.js.map +0 -1
  166. package/review/health-insights-cancerprofiling.api.md +0 -272
  167. /package/{dist-esm/src → dist/browser}/clientDefinitions.js +0 -0
  168. /package/{dist-esm/src → dist/browser}/isUnexpected.js +0 -0
  169. /package/{dist-esm/src → dist/browser}/logger.js +0 -0
  170. /package/{dist-esm/src → dist/browser}/logger.js.map +0 -0
  171. /package/{dist-esm/src → dist/browser}/models.js +0 -0
  172. /package/{dist-esm/src → dist/browser}/models.js.map +0 -0
  173. /package/{dist-esm/src → dist/browser}/outputModels.js +0 -0
  174. /package/{dist-esm/src → dist/browser}/outputModels.js.map +0 -0
  175. /package/{dist-esm/src → dist/browser}/parameters.js +0 -0
  176. /package/{dist-esm/src → dist/browser}/pollingHelper.js +0 -0
  177. /package/{dist-esm/src → dist/browser}/responses.js +0 -0
@@ -0,0 +1,12 @@
1
+ import type { Client } from "@azure-rest/core-client";
2
+ import type { CreateHttpPollerOptions, OperationState, SimplePollerLike } from "@azure/core-lro";
3
+ import type { CreateJob200Response, CreateJob202Response, CreateJobDefaultResponse, CreateJobLogicalResponse } from "./responses.js";
4
+ /**
5
+ * Helper function that builds a Poller object to help polling a long running operation.
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 declare function getLongRunningPoller<TResult extends CreateJobLogicalResponse | CreateJobDefaultResponse>(client: Client, initialResponse: CreateJob200Response | CreateJob202Response | CreateJobDefaultResponse, options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;
12
+ //# sourceMappingURL=pollingHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollingHelper.d.ts","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EACV,uBAAuB,EAGvB,cAAc,EACd,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AACxB;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,SAAS,wBAAwB,GAAG,wBAAwB,EAEnE,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,oBAAoB,GAAG,oBAAoB,GAAG,wBAAwB,EACvF,OAAO,CAAC,EAAE,uBAAuB,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,GAClE,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createHttpPoller } from "@azure/core-lro";
4
+ export async function getLongRunningPoller(client, initialResponse, options = {}) {
5
+ var _a;
6
+ const poller = {
7
+ requestMethod: initialResponse.request.method,
8
+ requestPath: initialResponse.request.url,
9
+ sendInitialRequest: async () => {
10
+ // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
11
+ // we are not triggering the initial request here, just extracting the information from the
12
+ // response we were provided.
13
+ return getLroResponse(initialResponse);
14
+ },
15
+ sendPollRequest: async (path) => {
16
+ // This is the callback that is going to be called to poll the service
17
+ // to get the latest status. We use the client provided and the polling path
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
19
+ // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
20
+ const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
21
+ const lroResponse = getLroResponse(response);
22
+ lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
23
+ return lroResponse;
24
+ },
25
+ };
26
+ options.resolveOnUnsuccessful = (_a = options.resolveOnUnsuccessful) !== null && _a !== void 0 ? _a : true;
27
+ return createHttpPoller(poller, options);
28
+ }
29
+ /**
30
+ * Converts a Rest Client response to a response that the LRO implementation understands
31
+ * @param response - a rest client http response
32
+ * @returns - An LRO response that the LRO implementation understands
33
+ */
34
+ function getLroResponse(response) {
35
+ if (Number.isNaN(response.status)) {
36
+ throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
37
+ }
38
+ return {
39
+ flatResponse: response,
40
+ rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
41
+ };
42
+ }
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;AAUlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAqBnD,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,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client\";\nimport type {\n CreateHttpPollerOptions,\n LongRunningOperation,\n LroResponse,\n OperationState,\n SimplePollerLike,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\nimport type {\n CreateJob200Response,\n CreateJob202Response,\n CreateJobDefaultResponse,\n CreateJobLogicalResponse,\n} from \"./responses.js\";\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 CreateJobLogicalResponse | CreateJobDefaultResponse,\n>(\n client: Client,\n initialResponse: CreateJob200Response | CreateJob202Response | CreateJobDefaultResponse,\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,50 @@
1
+ import type { RawHttpHeaders } from "@azure/core-rest-pipeline";
2
+ import type { HttpResponse, ErrorResponse } from "@azure-rest/core-client";
3
+ import type { OncoPhenotypeResultOutput } from "./outputModels.js";
4
+ /** The request has succeeded. */
5
+ export interface GetJob200Response extends HttpResponse {
6
+ status: "200";
7
+ body: OncoPhenotypeResultOutput;
8
+ }
9
+ export interface GetJobDefaultHeaders {
10
+ /** String error code indicating what went wrong. */
11
+ "x-ms-error-code"?: string;
12
+ }
13
+ export interface GetJobDefaultResponse extends HttpResponse {
14
+ status: string;
15
+ body: ErrorResponse;
16
+ headers: RawHttpHeaders & GetJobDefaultHeaders;
17
+ }
18
+ /** The request has succeeded. */
19
+ export interface CreateJob200Response extends HttpResponse {
20
+ status: "200";
21
+ body: OncoPhenotypeResultOutput;
22
+ }
23
+ export interface CreateJob202Headers {
24
+ /** The location for monitoring the operation state. */
25
+ "operation-location": string;
26
+ /** The Retry-After header can indicate how long the client should wait before polling the operation status. */
27
+ "retry-after"?: number;
28
+ /** Indicates whether the repeatable request was accepted or rejected. */
29
+ "repeatability-result"?: "accepted" | "rejected";
30
+ }
31
+ /** The request has been accepted for processing, but processing has not yet completed. */
32
+ export interface CreateJob202Response extends HttpResponse {
33
+ status: "202";
34
+ headers: RawHttpHeaders & CreateJob202Headers;
35
+ }
36
+ export interface CreateJobDefaultHeaders {
37
+ /** String error code indicating what went wrong. */
38
+ "x-ms-error-code"?: string;
39
+ }
40
+ export interface CreateJobDefaultResponse extends HttpResponse {
41
+ status: string;
42
+ body: ErrorResponse;
43
+ headers: RawHttpHeaders & CreateJobDefaultHeaders;
44
+ }
45
+ /** The final response for long-running createJob operation */
46
+ export interface CreateJobLogicalResponse extends HttpResponse {
47
+ status: "200";
48
+ body: OncoPhenotypeResultOutput;
49
+ }
50
+ //# sourceMappingURL=responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,iCAAiC;AACjC,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,yBAAyB,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,cAAc,GAAG,oBAAoB,CAAC;CAChD;AAED,iCAAiC;AACjC,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,yBAAyB,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,sBAAsB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAClD;AAED,0FAA0F;AAC1F,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,MAAM,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,cAAc,GAAG,mBAAmB,CAAC;CAC/C;AAED,MAAM,WAAW,uBAAuB;IACtC,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,cAAc,GAAG,uBAAuB,CAAC;CACnD;AAED,8DAA8D;AAC9D,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,yBAAyB,CAAC;CACjC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=responses.js.map
@@ -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 type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport type { OncoPhenotypeResultOutput } from \"./outputModels.js\";\n\n/** The request has succeeded. */\nexport interface GetJob200Response extends HttpResponse {\n status: \"200\";\n body: OncoPhenotypeResultOutput;\n}\n\nexport interface GetJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetJobDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface CreateJob200Response extends HttpResponse {\n status: \"200\";\n body: OncoPhenotypeResultOutput;\n}\n\nexport interface CreateJob202Headers {\n /** The location for monitoring the operation state. */\n \"operation-location\": string;\n /** The Retry-After header can indicate how long the client should wait before polling the operation status. */\n \"retry-after\"?: number;\n /** Indicates whether the repeatable request was accepted or rejected. */\n \"repeatability-result\"?: \"accepted\" | \"rejected\";\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface CreateJob202Response extends HttpResponse {\n status: \"202\";\n headers: RawHttpHeaders & CreateJob202Headers;\n}\n\nexport interface CreateJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CreateJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CreateJobDefaultHeaders;\n}\n\n/** The final response for long-running createJob operation */\nexport interface CreateJobLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OncoPhenotypeResultOutput;\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure-rest/health-insights-cancerprofiling",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "1.0.0-alpha.20241125.1",
5
+ "version": "1.0.0-alpha.20241127.1",
6
6
  "description": "A generated SDK for Health Insights Cancer Profiling Rest",
7
7
  "keywords": [
8
8
  "node",
@@ -13,31 +13,28 @@
13
13
  "isomorphic"
14
14
  ],
15
15
  "license": "MIT",
16
- "main": "dist/index.js",
17
- "module": "./dist-esm/src/index.js",
18
- "types": "./types/health-insights-cancerprofiling-rest.d.ts",
16
+ "main": "./dist/commonjs/index.js",
17
+ "module": "./dist/esm/index.js",
18
+ "types": "./dist/commonjs/index.d.ts",
19
19
  "repository": "github:Azure/azure-sdk-for-js",
20
20
  "bugs": {
21
21
  "url": "https://github.com/Azure/azure-sdk-for-js/issues"
22
22
  },
23
23
  "files": [
24
24
  "dist/",
25
- "dist-esm/src/",
26
- "types/health-indights-cancerprofiling.d.ts",
27
25
  "README.md",
28
- "LICENSE",
29
- "review/*"
26
+ "LICENSE"
30
27
  ],
31
28
  "engines": {
32
29
  "node": ">=18.0.0"
33
30
  },
34
31
  "scripts": {
35
- "build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
36
- "build:browser": "tsc -p . && dev-tool run bundle",
37
- "build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
38
- "build:node": "tsc -p . && dev-tool run bundle --browser-test false",
32
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
33
+ "build:browser": "dev-tool run build-package && dev-tool run bundle",
34
+ "build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api",
35
+ "build:node": "dev-tool run build-package && dev-tool run bundle --browser-test false",
39
36
  "build:samples": "echo skipped.",
40
- "build:test": "tsc -p . && dev-tool run bundle",
37
+ "build:test": "dev-tool run build-package && dev-tool run bundle",
41
38
  "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
42
39
  "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
43
40
  "execute:samples": "echo skipped",
@@ -45,8 +42,8 @@
45
42
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
46
43
  "generate:client": "echo skipped",
47
44
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
48
- "integration-test:browser": "dev-tool run test:browser",
49
- "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
45
+ "integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
46
+ "integration-test:node": "dev-tool run test:vitest",
50
47
  "lint": "eslint package.json api-extractor.json src test",
51
48
  "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
52
49
  "pack": "npm pack 2>&1",
@@ -54,49 +51,37 @@
54
51
  "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
55
52
  "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
56
53
  "unit-test": "npm run unit-test:node && npm run unit-test:browser",
57
- "unit-test:browser": "dev-tool run test:browser",
58
- "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
54
+ "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
55
+ "unit-test:node": "dev-tool run test:vitest",
59
56
  "update-snippets": "echo skipped"
60
57
  },
61
58
  "sideEffects": false,
62
59
  "autoPublish": false,
63
60
  "dependencies": {
64
- "@azure-rest/core-client": "^1.1.3",
65
- "@azure/abort-controller": "^1.0.0",
66
- "@azure/core-auth": "^1.3.0",
67
- "@azure/core-lro": "^2.5.3",
68
- "@azure/core-rest-pipeline": "^1.8.0",
69
- "@azure/logger": "^1.0.0",
70
- "tslib": "^2.2.0"
61
+ "@azure-rest/core-client": "^2.3.1",
62
+ "@azure/abort-controller": "^2.1.2",
63
+ "@azure/core-auth": "^1.9.0",
64
+ "@azure/core-lro": "^2.7.2",
65
+ "@azure/core-rest-pipeline": "^1.18.0",
66
+ "@azure/logger": "^1.1.4",
67
+ "tslib": "^2.8.1"
71
68
  },
72
69
  "devDependencies": {
73
- "@azure-tools/test-credential": "^1.0.0",
74
- "@azure-tools/test-recorder": "^3.0.0",
70
+ "@azure-tools/test-credential": "^2.0.0",
71
+ "@azure-tools/test-recorder": ">=4.1.0-alpha <4.1.0-alphb",
72
+ "@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
75
73
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
76
74
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
77
75
  "@azure/identity": "^4.0.1",
78
- "@types/chai": "^4.2.8",
79
- "@types/mocha": "^10.0.0",
80
76
  "@types/node": "^18.0.0",
77
+ "@vitest/browser": "^2.1.5",
78
+ "@vitest/coverage-istanbul": "^2.1.5",
81
79
  "autorest": "latest",
82
- "chai": "^4.2.0",
83
80
  "dotenv": "^16.0.0",
84
81
  "eslint": "^9.9.0",
85
- "karma": "^6.2.0",
86
- "karma-chrome-launcher": "^3.0.0",
87
- "karma-coverage": "^2.0.0",
88
- "karma-env-preprocessor": "^0.1.1",
89
- "karma-firefox-launcher": "^1.1.0",
90
- "karma-junit-reporter": "^2.0.1",
91
- "karma-mocha": "^2.0.1",
92
- "karma-mocha-reporter": "^2.2.5",
93
- "karma-source-map-support": "~1.4.0",
94
- "karma-sourcemap-loader": "^0.3.8",
95
- "mocha": "^10.0.0",
96
- "nyc": "^17.0.0",
97
- "source-map-support": "^0.5.9",
98
- "ts-node": "^10.0.0",
99
- "typescript": "~5.6.2"
82
+ "playwright": "^1.49.0",
83
+ "typescript": "~5.6.2",
84
+ "vitest": "^2.1.5"
100
85
  },
101
86
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthinsights/health-insights-cancerprofiling-rest/README.md",
102
87
  "//metadata": {
@@ -107,9 +92,7 @@
107
92
  }
108
93
  ]
109
94
  },
110
- "browser": {
111
- "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
112
- },
95
+ "browser": "./dist/browser/index.js",
113
96
  "//sampleConfiguration": {
114
97
  "productName": "HealthInsightsCancerprifiling",
115
98
  "productSlugs": [
@@ -117,5 +100,42 @@
117
100
  ],
118
101
  "disableDocsMs": true,
119
102
  "apiRefLink": "https://docs.microsoft.com/javascript/api"
103
+ },
104
+ "type": "module",
105
+ "tshy": {
106
+ "exports": {
107
+ "./package.json": "./package.json",
108
+ ".": "./src/index.ts"
109
+ },
110
+ "dialects": [
111
+ "esm",
112
+ "commonjs"
113
+ ],
114
+ "esmDialects": [
115
+ "browser",
116
+ "react-native"
117
+ ],
118
+ "selfLink": false
119
+ },
120
+ "exports": {
121
+ "./package.json": "./package.json",
122
+ ".": {
123
+ "browser": {
124
+ "types": "./dist/browser/index.d.ts",
125
+ "default": "./dist/browser/index.js"
126
+ },
127
+ "react-native": {
128
+ "types": "./dist/react-native/index.d.ts",
129
+ "default": "./dist/react-native/index.js"
130
+ },
131
+ "import": {
132
+ "types": "./dist/esm/index.d.ts",
133
+ "default": "./dist/esm/index.js"
134
+ },
135
+ "require": {
136
+ "types": "./dist/commonjs/index.d.ts",
137
+ "default": "./dist/commonjs/index.js"
138
+ }
139
+ }
120
140
  }
121
141
  }
package/dist/index.js DELETED
@@ -1,161 +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 coreLro = require('@azure/core-lro');
8
-
9
- // Copyright (c) Microsoft Corporation.
10
- // Licensed under the MIT License.
11
- const logger = logger$1.createClientLogger("health-insights-cancerprofiling");
12
-
13
- // Copyright (c) Microsoft Corporation.
14
- // Licensed under the MIT License.
15
- /**
16
- * Initialize a new instance of `CancerProfilingRestClient`
17
- * @param endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).
18
- * @param credentials - uniquely identify client credential
19
- * @param options - the parameter for all optional parameters
20
- */
21
- function createClient(endpoint, credentials, options = {}) {
22
- var _a, _b, _c, _d, _e, _f;
23
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}/healthinsights`;
24
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2023-03-01-preview";
25
- options = Object.assign(Object.assign({}, options), { credentials: {
26
- apiKeyHeaderName: (_d = (_c = options.credentials) === null || _c === void 0 ? void 0 : _c.apiKeyHeaderName) !== null && _d !== void 0 ? _d : "Ocp-Apim-Subscription-Key",
27
- } });
28
- const userAgentInfo = `azsdk-js-health-insights-cancerprofiling-rest/1.0.0-beta.1`;
29
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
30
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
31
- : `${userAgentInfo}`;
32
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
33
- userAgentPrefix,
34
- }, loggingOptions: {
35
- logger: (_f = (_e = options.loggingOptions) === null || _e === void 0 ? void 0 : _e.logger) !== null && _f !== void 0 ? _f : logger.info,
36
- } });
37
- const client = coreClient.getClient(baseUrl, credentials, options);
38
- return client;
39
- }
40
-
41
- // Copyright (c) Microsoft Corporation.
42
- // Licensed under the MIT License.
43
- const responseMap = {
44
- "GET /oncophenotype/jobs/{jobId}": ["200"],
45
- "POST /oncophenotype/jobs": ["200", "202"],
46
- "GET /oncophenotype/jobs": ["200", "202"],
47
- };
48
- function isUnexpected(response) {
49
- const lroOriginal = response.headers["x-ms-original-url"];
50
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
51
- const method = response.request.method;
52
- let pathDetails = responseMap[`${method} ${url.pathname}`];
53
- if (!pathDetails) {
54
- pathDetails = getParametrizedPathSuccess(method, url.pathname);
55
- }
56
- return !pathDetails.includes(response.status);
57
- }
58
- function getParametrizedPathSuccess(method, path) {
59
- var _a, _b, _c, _d;
60
- const pathParts = path.split("/");
61
- // Traverse list to match the longest candidate
62
- // matchedLen: the length of candidate path
63
- // matchedValue: the matched status code array
64
- let matchedLen = -1, matchedValue = [];
65
- // Iterate the responseMap to find a match
66
- for (const [key, value] of Object.entries(responseMap)) {
67
- // Extracting the path from the map key which is in format
68
- // GET /path/foo
69
- if (!key.startsWith(method)) {
70
- continue;
71
- }
72
- const candidatePath = getPathFromMapKey(key);
73
- // Get each part of the url path
74
- const candidateParts = candidatePath.split("/");
75
- // track if we have found a match to return the values found.
76
- let found = true;
77
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
78
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
79
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
80
- // If the current part of the candidate is a "template" part
81
- // Try to use the suffix of pattern to match the path
82
- // {guid} ==> $
83
- // {guid}:export ==> :export$
84
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
85
- if (!isMatched) {
86
- found = false;
87
- break;
88
- }
89
- continue;
90
- }
91
- // If the candidate part is not a template and
92
- // the parts don't match mark the candidate as not found
93
- // to move on with the next candidate path.
94
- if (candidateParts[i] !== pathParts[j]) {
95
- found = false;
96
- break;
97
- }
98
- }
99
- // We finished evaluating the current candidate parts
100
- // Update the matched value if and only if we found the longer pattern
101
- if (found && candidatePath.length > matchedLen) {
102
- matchedLen = candidatePath.length;
103
- matchedValue = value;
104
- }
105
- }
106
- return matchedValue;
107
- }
108
- function getPathFromMapKey(mapKey) {
109
- const pathStart = mapKey.indexOf("/");
110
- return mapKey.slice(pathStart);
111
- }
112
-
113
- // Copyright (c) Microsoft Corporation.
114
- // Licensed under the MIT License.
115
- async function getLongRunningPoller(client, initialResponse, options = {}) {
116
- var _a;
117
- const poller = {
118
- requestMethod: initialResponse.request.method,
119
- requestPath: initialResponse.request.url,
120
- sendInitialRequest: async () => {
121
- // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
122
- // we are not triggering the initial request here, just extracting the information from the
123
- // response we were provided.
124
- return getLroResponse(initialResponse);
125
- },
126
- sendPollRequest: async (path) => {
127
- // This is the callback that is going to be called to poll the service
128
- // to get the latest status. We use the client provided and the polling path
129
- // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
130
- // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
131
- const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
132
- const lroResponse = getLroResponse(response);
133
- lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
134
- return lroResponse;
135
- },
136
- };
137
- options.resolveOnUnsuccessful = (_a = options.resolveOnUnsuccessful) !== null && _a !== void 0 ? _a : true;
138
- return coreLro.createHttpPoller(poller, options);
139
- }
140
- /**
141
- * Converts a Rest Client response to a response that the LRO implementation understands
142
- * @param response - a rest client http response
143
- * @returns - An LRO response that the LRO implementation understands
144
- */
145
- function getLroResponse(response) {
146
- if (Number.isNaN(response.status)) {
147
- throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
148
- }
149
- return {
150
- flatResponse: response,
151
- rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
152
- };
153
- }
154
-
155
- // Copyright (c) Microsoft Corporation.
156
- // Licensed under the MIT License.
157
-
158
- exports.default = createClient;
159
- exports.getLongRunningPoller = getLongRunningPoller;
160
- exports.isUnexpected = isUnexpected;
161
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/logger.ts","../src/cancerProfilingRest.ts","../src/isUnexpected.ts","../src/pollingHelper.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(\"health-insights-cancerprofiling\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport type { CancerProfilingRestClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `CancerProfilingRestClient`\n * @param endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).\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 credentials: KeyCredential,\n options: ClientOptions = {},\n): CancerProfilingRestClient {\n const baseUrl = options.baseUrl ?? `${endpoint}/healthinsights`;\n options.apiVersion = options.apiVersion ?? \"2023-03-01-preview\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n\n const userAgentInfo = `azsdk-js-health-insights-cancerprofiling-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 CancerProfilingRestClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n CreateJob200Response,\n CreateJob202Response,\n CreateJobLogicalResponse,\n CreateJobDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /oncophenotype/jobs/{jobId}\": [\"200\"],\n \"POST /oncophenotype/jobs\": [\"200\", \"202\"],\n \"GET /oncophenotype/jobs\": [\"200\", \"202\"],\n};\n\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response:\n | CreateJob200Response\n | CreateJob202Response\n | CreateJobLogicalResponse\n | CreateJobDefaultResponse,\n): response is CreateJobDefaultResponse;\nexport function isUnexpected(\n response:\n | GetJob200Response\n | GetJobDefaultResponse\n | CreateJob200Response\n | CreateJob202Response\n | CreateJobLogicalResponse\n | CreateJobDefaultResponse,\n): response is GetJobDefaultResponse | CreateJobDefaultResponse {\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 type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n CreateHttpPollerOptions,\n LongRunningOperation,\n LroResponse,\n OperationState,\n SimplePollerLike,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\nimport type {\n CreateJob200Response,\n CreateJob202Response,\n CreateJobDefaultResponse,\n CreateJobLogicalResponse,\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 CreateJobLogicalResponse | CreateJobDefaultResponse,\n>(\n client: Client,\n initialResponse: CreateJob200Response | CreateJob202Response | CreateJobDefaultResponse,\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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport CancerProfilingRest from \"./cancerProfilingRest\";\n\nexport * from \"./cancerProfilingRest\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./pollingHelper\";\n\nexport default CancerProfilingRest;\n"],"names":["createClientLogger","getClient","createHttpPoller"],"mappings":";;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,iCAAiC,CAAC;;ACJ3E;AACA;AAQA;;;;;AAKG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA0B,EAC1B,OAAA,GAAyB,EAAE,EAAA;;IAE3B,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,QAAQ,CAAA,eAAA,CAAiB;IAC/D,OAAO,CAAC,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,oBAAoB;AAC/D,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,WAAW,EAAE;YACX,gBAAgB,EAAE,MAAA,CAAA,EAAA,GAAA,OAAO,CAAC,WAAW,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,gB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C,IAAI;SACtD,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA8B,CAAC;IAErF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport type { CancerProfilingRestClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `CancerProfilingRestClient`\n * @param endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).\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 credentials: KeyCredential,\n options: ClientOptions = {},\n): CancerProfilingRestClient {\n const baseUrl = options.baseUrl ?? `${endpoint}/healthinsights`;\n options.apiVersion = options.apiVersion ?? \"2023-03-01-preview\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n\n const userAgentInfo = `azsdk-js-health-insights-cancerprofiling-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 CancerProfilingRestClient;\n\n return client;\n}\n"]}
@@ -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 type { GetJobParameters, CreateJobParameters } from \"./parameters\";\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n CreateJob200Response,\n CreateJob202Response,\n CreateJobDefaultResponse,\n} from \"./responses\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetJob {\n /** Gets the status and details of the Onco Phenotype job. */\n get(options?: GetJobParameters): StreamableMethod<GetJob200Response | GetJobDefaultResponse>;\n}\n\nexport interface CreateJob {\n /** Creates an Onco Phenotype job with the given request body. */\n post(\n options?: CreateJobParameters,\n ): StreamableMethod<CreateJob200Response | CreateJob202Response | CreateJobDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/oncophenotype/jobs/\\{jobId\\}' has methods for the following verbs: get */\n (path: \"/oncophenotype/jobs/{jobId}\", jobId: string): GetJob;\n /** Resource for '/oncophenotype/jobs' has methods for the following verbs: post */\n (path: \"/oncophenotype/jobs\"): CreateJob;\n}\n\nexport type CancerProfilingRestClient = Client & {\n path: Routes;\n};\n"]}
@@ -1,13 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import CancerProfilingRest from "./cancerProfilingRest";
4
- export * from "./cancerProfilingRest";
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 "./pollingHelper";
12
- export default CancerProfilingRest;
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,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc,uBAAuB,CAAC;AACtC,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,iBAAiB,CAAC;AAEhC,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport CancerProfilingRest from \"./cancerProfilingRest\";\n\nexport * from \"./cancerProfilingRest\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./pollingHelper\";\n\nexport default CancerProfilingRest;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,MAAM,WAAW,GAA6B;IAC5C,iCAAiC,EAAE,CAAC,KAAK,CAAC;IAC1C,0BAA0B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC1C,yBAAyB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;CAC1C,CAAC;AAYF,MAAM,UAAU,YAAY,CAC1B,QAM4B;IAE5B,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAA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AAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;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 type {\n GetJob200Response,\n GetJobDefaultResponse,\n CreateJob200Response,\n CreateJob202Response,\n CreateJobLogicalResponse,\n CreateJobDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /oncophenotype/jobs/{jobId}\": [\"200\"],\n \"POST /oncophenotype/jobs\": [\"200\", \"202\"],\n \"GET /oncophenotype/jobs\": [\"200\", \"202\"],\n};\n\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response:\n | CreateJob200Response\n | CreateJob202Response\n | CreateJobLogicalResponse\n | CreateJobDefaultResponse,\n): response is CreateJobDefaultResponse;\nexport function isUnexpected(\n response:\n | GetJob200Response\n | GetJobDefaultResponse\n | CreateJob200Response\n | CreateJob202Response\n | CreateJobLogicalResponse\n | CreateJobDefaultResponse,\n): response is GetJobDefaultResponse | CreateJobDefaultResponse {\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"]}
@@ -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 type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { OncoPhenotypeData } from \"./models\";\n\nexport type GetJobParameters = RequestParameters;\n\nexport interface CreateJobHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"Repeatability-Request-ID\"?: string;\n /** Specifies the date and time at which the request was first created. */\n \"Repeatability-First-Sent\"?: string;\n}\n\nexport interface CreateJobBodyParam {\n body?: OncoPhenotypeData;\n}\n\nexport interface CreateJobHeaderParam {\n headers?: RawHttpHeadersInput & CreateJobHeaders;\n}\n\nexport type CreateJobParameters = CreateJobHeaderParam & CreateJobBodyParam & RequestParameters;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAqBnD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,eAAwB,EACxB,UAAqE,EAAE;;IAEvE,MAAM,MAAM,GAAkC;QAC5C,aAAa,EAAE,eAAe,CAAC,OA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yright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n CreateHttpPollerOptions,\n LongRunningOperation,\n LroResponse,\n OperationState,\n SimplePollerLike,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\nimport type {\n CreateJob200Response,\n CreateJob202Response,\n CreateJobDefaultResponse,\n CreateJobLogicalResponse,\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 CreateJobLogicalResponse | CreateJobDefaultResponse,\n>(\n client: Client,\n initialResponse: CreateJob200Response | CreateJob202Response | CreateJobDefaultResponse,\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"]}
@@ -1 +0,0 @@
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 type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport type { OncoPhenotypeResultOutput } from \"./outputModels\";\n\n/** The request has succeeded. */\nexport interface GetJob200Response extends HttpResponse {\n status: \"200\";\n body: OncoPhenotypeResultOutput;\n}\n\nexport interface GetJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetJobDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface CreateJob200Response extends HttpResponse {\n status: \"200\";\n body: OncoPhenotypeResultOutput;\n}\n\nexport interface CreateJob202Headers {\n /** The location for monitoring the operation state. */\n \"operation-location\": string;\n /** The Retry-After header can indicate how long the client should wait before polling the operation status. */\n \"retry-after\"?: number;\n /** Indicates whether the repeatable request was accepted or rejected. */\n \"repeatability-result\"?: \"accepted\" | \"rejected\";\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface CreateJob202Response extends HttpResponse {\n status: \"202\";\n headers: RawHttpHeaders & CreateJob202Headers;\n}\n\nexport interface CreateJobDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CreateJobDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CreateJobDefaultHeaders;\n}\n\n/** The final response for long-running createJob operation */\nexport interface CreateJobLogicalResponse extends HttpResponse {\n status: \"200\";\n body: OncoPhenotypeResultOutput;\n}\n"]}