levelfour 1.0.0

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 (279) hide show
  1. package/.fernignore +9 -0
  2. package/BaseClient.ts +56 -0
  3. package/Client.ts +90 -0
  4. package/LevelFourClient.ts +50 -0
  5. package/api/errors/UnprocessableEntityError.ts +22 -0
  6. package/api/errors/index.ts +1 -0
  7. package/api/index.ts +3 -0
  8. package/api/resources/apiKeys/client/Client.ts +298 -0
  9. package/api/resources/apiKeys/client/index.ts +1 -0
  10. package/api/resources/apiKeys/client/requests/CreateApiKeyRequest.ts +23 -0
  11. package/api/resources/apiKeys/client/requests/ListApiKeysApiV1ApiKeysGetRequest.ts +11 -0
  12. package/api/resources/apiKeys/client/requests/RevokeApiKeyApiV1ApiKeysKeyIdDeleteRequest.ts +14 -0
  13. package/api/resources/apiKeys/client/requests/RotateApiKeyApiV1ApiKeysKeyIdRotatePostRequest.ts +14 -0
  14. package/api/resources/apiKeys/client/requests/index.ts +4 -0
  15. package/api/resources/apiKeys/exports.ts +4 -0
  16. package/api/resources/apiKeys/index.ts +1 -0
  17. package/api/resources/evaluation/client/Client.ts +71 -0
  18. package/api/resources/evaluation/client/index.ts +1 -0
  19. package/api/resources/evaluation/exports.ts +4 -0
  20. package/api/resources/evaluation/index.ts +1 -0
  21. package/api/resources/health/client/Client.ts +108 -0
  22. package/api/resources/health/client/index.ts +1 -0
  23. package/api/resources/health/exports.ts +4 -0
  24. package/api/resources/health/index.ts +1 -0
  25. package/api/resources/index.ts +24 -0
  26. package/api/resources/prAnalysis/client/Client.ts +100 -0
  27. package/api/resources/prAnalysis/client/index.ts +1 -0
  28. package/api/resources/prAnalysis/client/requests/AnalyzePrRequest.ts +30 -0
  29. package/api/resources/prAnalysis/client/requests/index.ts +1 -0
  30. package/api/resources/prAnalysis/exports.ts +4 -0
  31. package/api/resources/prAnalysis/index.ts +1 -0
  32. package/api/resources/prAnalysisActions/client/Client.ts +418 -0
  33. package/api/resources/prAnalysisActions/client/index.ts +1 -0
  34. package/api/resources/prAnalysisActions/client/requests/DismissSuggestionsApiV1PrAnalysisActionsDismissPostRequest.ts +21 -0
  35. package/api/resources/prAnalysisActions/client/requests/GetIgnoredResourcesApiV1PrAnalysisActionsIgnoreGetRequest.ts +15 -0
  36. package/api/resources/prAnalysisActions/client/requests/GetPrStatusApiV1PrAnalysisActionsStatusGetRequest.ts +15 -0
  37. package/api/resources/prAnalysisActions/client/requests/IgnoreRequest.ts +21 -0
  38. package/api/resources/prAnalysisActions/client/requests/SnoozeSuggestionsApiV1PrAnalysisActionsSnoozePostRequest.ts +21 -0
  39. package/api/resources/prAnalysisActions/client/requests/index.ts +5 -0
  40. package/api/resources/prAnalysisActions/exports.ts +4 -0
  41. package/api/resources/prAnalysisActions/index.ts +1 -0
  42. package/api/resources/prAnalysisInstallations/client/Client.ts +410 -0
  43. package/api/resources/prAnalysisInstallations/client/index.ts +1 -0
  44. package/api/resources/prAnalysisInstallations/client/requests/AddReposRequest.ts +17 -0
  45. package/api/resources/prAnalysisInstallations/client/requests/DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest.ts +15 -0
  46. package/api/resources/prAnalysisInstallations/client/requests/ListInstallationsApiV1PrAnalysisInstallationsGetRequest.ts +13 -0
  47. package/api/resources/prAnalysisInstallations/client/requests/RegisterInstallationRequest.ts +16 -0
  48. package/api/resources/prAnalysisInstallations/client/requests/RemoveReposRequest.ts +17 -0
  49. package/api/resources/prAnalysisInstallations/client/requests/index.ts +5 -0
  50. package/api/resources/prAnalysisInstallations/exports.ts +4 -0
  51. package/api/resources/prAnalysisInstallations/index.ts +1 -0
  52. package/api/resources/prAnalysisQuery/client/Client.ts +169 -0
  53. package/api/resources/prAnalysisQuery/client/index.ts +1 -0
  54. package/api/resources/prAnalysisQuery/client/requests/ExplainRequest.ts +17 -0
  55. package/api/resources/prAnalysisQuery/client/requests/WhatifRequest.ts +21 -0
  56. package/api/resources/prAnalysisQuery/client/requests/index.ts +2 -0
  57. package/api/resources/prAnalysisQuery/exports.ts +4 -0
  58. package/api/resources/prAnalysisQuery/index.ts +1 -0
  59. package/api/resources/providers/client/Client.ts +991 -0
  60. package/api/resources/providers/client/index.ts +1 -0
  61. package/api/resources/providers/client/requests/GetProviderFilterOptionsApiV1ProvidersProviderIdSpendingFilterOptionsGetRequest.ts +17 -0
  62. package/api/resources/providers/client/requests/GetProviderPotentialSavingsBreakdownApiV1ProvidersProviderIdPotentialSavingsBreakdownGetRequest.ts +19 -0
  63. package/api/resources/providers/client/requests/GetProviderPotentialSavingsSummaryApiV1ProvidersProviderIdPotentialSavingsSummaryGetRequest.ts +11 -0
  64. package/api/resources/providers/client/requests/GetProviderRecommendationFilterOptionsApiV1ProvidersProviderIdRecommendationsFilterOptionsGetRequest.ts +11 -0
  65. package/api/resources/providers/client/requests/GetProviderRecommendationsBreakdownApiV1ProvidersProviderIdRecommendationsGetRequest.ts +33 -0
  66. package/api/resources/providers/client/requests/GetProviderRecommendationsOverviewApiV1ProvidersProviderIdRecommendationsOverviewGetRequest.ts +11 -0
  67. package/api/resources/providers/client/requests/GetProviderRecommendationsSummaryApiV1ProvidersProviderIdRecommendationsSummaryGetRequest.ts +11 -0
  68. package/api/resources/providers/client/requests/GetProviderSavedSummaryApiV1ProvidersProviderIdSavingsSummaryGetRequest.ts +11 -0
  69. package/api/resources/providers/client/requests/GetProviderServiceBreakdownApiV1ProvidersProviderIdSpendingBreakdownGetRequest.ts +45 -0
  70. package/api/resources/providers/client/requests/GetProviderSpendingSummaryApiV1ProvidersProviderIdSpendingSummaryGetRequest.ts +11 -0
  71. package/api/resources/providers/client/requests/GetProviderSpendingTimelineApiV1ProvidersProviderIdSpendingTimelineGetRequest.ts +17 -0
  72. package/api/resources/providers/client/requests/GetSavedByProviderBreakdownApiV1ProvidersProviderIdSavingsBreakdownGetRequest.ts +31 -0
  73. package/api/resources/providers/client/requests/index.ts +12 -0
  74. package/api/resources/providers/exports.ts +4 -0
  75. package/api/resources/providers/index.ts +2 -0
  76. package/api/resources/providers/types/GetProviderServiceBreakdownApiV1ProvidersProviderIdSpendingBreakdownGetResponse.ts +8 -0
  77. package/api/resources/providers/types/index.ts +1 -0
  78. package/api/resources/recommendations/client/Client.ts +815 -0
  79. package/api/resources/recommendations/client/index.ts +1 -0
  80. package/api/resources/recommendations/client/requests/AcceptTermsApiV1RecommendationsRecommendationIdAcceptTermsPostRequest.ts +11 -0
  81. package/api/resources/recommendations/client/requests/CompleteWizardApiV1RecommendationsRecommendationIdCompletePostRequest.ts +11 -0
  82. package/api/resources/recommendations/client/requests/GetRecommendationDetailsApiV1RecommendationsRecommendationIdDetailsGetRequest.ts +11 -0
  83. package/api/resources/recommendations/client/requests/GetRecommendationForWizardApiV1RecommendationsRecommendationIdGetRequest.ts +11 -0
  84. package/api/resources/recommendations/client/requests/GetRecommendationsApiV1RecommendationsGetRequest.ts +16 -0
  85. package/api/resources/recommendations/client/requests/ImplementationMethodRequest.ts +14 -0
  86. package/api/resources/recommendations/client/requests/SavingsDecisionRequest.ts +18 -0
  87. package/api/resources/recommendations/client/requests/UpdateTagRequest.ts +13 -0
  88. package/api/resources/recommendations/client/requests/index.ts +8 -0
  89. package/api/resources/recommendations/exports.ts +4 -0
  90. package/api/resources/recommendations/index.ts +1 -0
  91. package/api/resources/savings/client/Client.ts +231 -0
  92. package/api/resources/savings/client/index.ts +1 -0
  93. package/api/resources/savings/client/requests/ExecutionRequestBody.ts +15 -0
  94. package/api/resources/savings/client/requests/GetSavedBreakdownApiV1SavingsBreakdownGetRequest.ts +30 -0
  95. package/api/resources/savings/client/requests/index.ts +2 -0
  96. package/api/resources/savings/exports.ts +4 -0
  97. package/api/resources/savings/index.ts +1 -0
  98. package/api/resources/spending/client/Client.ts +288 -0
  99. package/api/resources/spending/client/index.ts +1 -0
  100. package/api/resources/spending/client/requests/GetCostBreakdownApiV1SpendingBreakdownGetRequest.ts +30 -0
  101. package/api/resources/spending/client/requests/GetDailySpendingBreakdownApiV1SpendingDailyBreakdownGetRequest.ts +12 -0
  102. package/api/resources/spending/client/requests/index.ts +2 -0
  103. package/api/resources/spending/exports.ts +4 -0
  104. package/api/resources/spending/index.ts +2 -0
  105. package/api/resources/spending/types/GetCostBreakdownApiV1SpendingBreakdownGetResponse.ts +9 -0
  106. package/api/resources/spending/types/index.ts +1 -0
  107. package/api/resources/webhooks/client/Client.ts +232 -0
  108. package/api/resources/webhooks/client/index.ts +1 -0
  109. package/api/resources/webhooks/client/requests/DeleteEndpointApiV1WebhooksEndpointsEndpointIdDeleteRequest.ts +14 -0
  110. package/api/resources/webhooks/client/requests/ListEndpointsApiV1WebhooksEndpointsGetRequest.ts +11 -0
  111. package/api/resources/webhooks/client/requests/RegisterEndpointRequest.ts +18 -0
  112. package/api/resources/webhooks/client/requests/index.ts +3 -0
  113. package/api/resources/webhooks/exports.ts +4 -0
  114. package/api/resources/webhooks/index.ts +1 -0
  115. package/api/types/AcceptTermsData.ts +10 -0
  116. package/api/types/AcceptTermsResponse.ts +12 -0
  117. package/api/types/ActionRequest.ts +14 -0
  118. package/api/types/ApiKeyCreatedData.ts +13 -0
  119. package/api/types/ApiKeyData.ts +12 -0
  120. package/api/types/ComparisonItem.ts +10 -0
  121. package/api/types/CompleteWizardData.ts +12 -0
  122. package/api/types/CompleteWizardResponse.ts +12 -0
  123. package/api/types/CostBreakdownData.ts +14 -0
  124. package/api/types/CostBreakdownItem.ts +27 -0
  125. package/api/types/CostBreakdownRawData.ts +15 -0
  126. package/api/types/CostBreakdownRawResponse.ts +12 -0
  127. package/api/types/CostBreakdownResponse.ts +12 -0
  128. package/api/types/CostsBreakdownChartData.ts +19 -0
  129. package/api/types/CostsBreakdownChartResponse.ts +12 -0
  130. package/api/types/CostsBreakdownDataPoint.ts +17 -0
  131. package/api/types/CostsBreakdownGroupedChartData.ts +21 -0
  132. package/api/types/CostsBreakdownGroupedChartResponse.ts +12 -0
  133. package/api/types/CostsBreakdownGroupedDataPoint.ts +13 -0
  134. package/api/types/CostsBreakdownTotals.ts +15 -0
  135. package/api/types/CreateApiKeyResponse.ts +9 -0
  136. package/api/types/DailySpendingBreakdownData.ts +17 -0
  137. package/api/types/DailySpendingBreakdownResponse.ts +12 -0
  138. package/api/types/DailySpendingDataPoint.ts +11 -0
  139. package/api/types/DashboardSummaryData.ts +29 -0
  140. package/api/types/DashboardSummaryResponse.ts +12 -0
  141. package/api/types/DeleteEndpointData.ts +6 -0
  142. package/api/types/DeleteEndpointResponse.ts +9 -0
  143. package/api/types/EndpointData.ts +9 -0
  144. package/api/types/EvaluationStatusData.ts +27 -0
  145. package/api/types/EvaluationStatusResponse.ts +12 -0
  146. package/api/types/ExecutionLogCommand.ts +7 -0
  147. package/api/types/ExecutionLogEntry.ts +10 -0
  148. package/api/types/ExecutionStepSchema.ts +9 -0
  149. package/api/types/HttpValidationError.ts +7 -0
  150. package/api/types/ImplementationMethodData.ts +10 -0
  151. package/api/types/ImplementationMethodResponse.ts +12 -0
  152. package/api/types/ImplementationStep.ts +8 -0
  153. package/api/types/ListApiKeysData.ts +8 -0
  154. package/api/types/ListApiKeysResponse.ts +9 -0
  155. package/api/types/ListEndpointsResponse.ts +9 -0
  156. package/api/types/MetricDataPoint.ts +8 -0
  157. package/api/types/MetricSeries.ts +15 -0
  158. package/api/types/MetricSeriesEntry.ts +9 -0
  159. package/api/types/MonthlySpendingData.ts +11 -0
  160. package/api/types/MonthlySpendingDataPoint.ts +11 -0
  161. package/api/types/MonthlySpendingResponse.ts +12 -0
  162. package/api/types/PaginationMeta.ts +19 -0
  163. package/api/types/ProcessingRecommendationItem.ts +23 -0
  164. package/api/types/ProcessingRecommendationsData.ts +12 -0
  165. package/api/types/ProcessingRecommendationsResponse.ts +12 -0
  166. package/api/types/Provider.ts +17 -0
  167. package/api/types/ProviderBreakdownData.ts +13 -0
  168. package/api/types/ProviderBreakdownItem.ts +31 -0
  169. package/api/types/ProviderBreakdownResponse.ts +12 -0
  170. package/api/types/ProviderFilterOptionsData.ts +19 -0
  171. package/api/types/ProviderFilterOptionsResponse.ts +12 -0
  172. package/api/types/ProviderPotentialSavingsSummaryData.ts +17 -0
  173. package/api/types/ProviderPotentialSavingsSummaryResponse.ts +12 -0
  174. package/api/types/ProviderRecommendationsSummaryData.ts +15 -0
  175. package/api/types/ProviderRecommendationsSummaryResponse.ts +12 -0
  176. package/api/types/ProviderSavedSummaryData.ts +21 -0
  177. package/api/types/ProviderSavedSummaryResponse.ts +12 -0
  178. package/api/types/ProviderServiceBreakdownData.ts +26 -0
  179. package/api/types/ProviderServiceBreakdownItem.ts +29 -0
  180. package/api/types/ProviderServiceBreakdownRawData.ts +25 -0
  181. package/api/types/ProviderServiceBreakdownRawResponse.ts +12 -0
  182. package/api/types/ProviderServiceBreakdownResponse.ts +12 -0
  183. package/api/types/ProviderServiceCostsBreakdownData.ts +25 -0
  184. package/api/types/ProviderServiceCostsBreakdownResponse.ts +12 -0
  185. package/api/types/ProviderServiceCostsDataPoint.ts +13 -0
  186. package/api/types/ProviderSpending.ts +23 -0
  187. package/api/types/ProviderSpendingSummaryData.ts +27 -0
  188. package/api/types/ProviderSpendingSummaryResponse.ts +12 -0
  189. package/api/types/ProviderTimelineData.ts +23 -0
  190. package/api/types/ProviderTimelineResponse.ts +12 -0
  191. package/api/types/ProviderTopService.ts +13 -0
  192. package/api/types/ProvidersSummaryData.ts +10 -0
  193. package/api/types/ProvidersSummaryResponse.ts +12 -0
  194. package/api/types/RecommendationActions.ts +28 -0
  195. package/api/types/RecommendationDetail.ts +22 -0
  196. package/api/types/RecommendationDetailResponse.ts +12 -0
  197. package/api/types/RecommendationFilterOptionsData.ts +15 -0
  198. package/api/types/RecommendationFilterOptionsResponse.ts +12 -0
  199. package/api/types/RecommendationItem.ts +19 -0
  200. package/api/types/RecommendationWizardData.ts +83 -0
  201. package/api/types/RecommendationWizardResponse.ts +12 -0
  202. package/api/types/RecommendationsBreakdownData.ts +11 -0
  203. package/api/types/RecommendationsBreakdownResponse.ts +12 -0
  204. package/api/types/RecommendationsOverviewData.ts +19 -0
  205. package/api/types/RecommendationsOverviewResponse.ts +12 -0
  206. package/api/types/RegisterEndpointResponse.ts +9 -0
  207. package/api/types/ResourceChange.ts +14 -0
  208. package/api/types/ResourceSnapshot.ts +7 -0
  209. package/api/types/RevokeApiKeyData.ts +6 -0
  210. package/api/types/RevokeApiKeyResponse.ts +9 -0
  211. package/api/types/RiskAssessment.ts +11 -0
  212. package/api/types/RiskFactor.ts +8 -0
  213. package/api/types/SavedBreakdownData.ts +13 -0
  214. package/api/types/SavedBreakdownResponse.ts +12 -0
  215. package/api/types/SavedByProviderBreakdownData.ts +13 -0
  216. package/api/types/SavedByProviderBreakdownResponse.ts +12 -0
  217. package/api/types/SavedByProviderItem.ts +29 -0
  218. package/api/types/SavedItem.ts +20 -0
  219. package/api/types/SavedProviderSummary.ts +13 -0
  220. package/api/types/SavedSummaryData.ts +23 -0
  221. package/api/types/SavedSummaryResponse.ts +12 -0
  222. package/api/types/SavingsDecisionData.ts +13 -0
  223. package/api/types/SavingsDecisionResponse.ts +12 -0
  224. package/api/types/SpendingByDateItem.ts +13 -0
  225. package/api/types/TopRecommendation.ts +21 -0
  226. package/api/types/TriggerInfo.ts +8 -0
  227. package/api/types/UpdateTagData.ts +6 -0
  228. package/api/types/UpdateTagResponse.ts +9 -0
  229. package/api/types/ValidationError.ts +17 -0
  230. package/api/types/index.ts +115 -0
  231. package/core/exports.ts +1 -0
  232. package/core/fetcher/APIResponse.ts +23 -0
  233. package/core/fetcher/BinaryResponse.ts +34 -0
  234. package/core/fetcher/EndpointMetadata.ts +13 -0
  235. package/core/fetcher/EndpointSupplier.ts +14 -0
  236. package/core/fetcher/Fetcher.ts +398 -0
  237. package/core/fetcher/Headers.ts +93 -0
  238. package/core/fetcher/HttpResponsePromise.ts +116 -0
  239. package/core/fetcher/RawResponse.ts +61 -0
  240. package/core/fetcher/Supplier.ts +11 -0
  241. package/core/fetcher/createRequestUrl.ts +6 -0
  242. package/core/fetcher/getErrorResponseBody.ts +33 -0
  243. package/core/fetcher/getFetchFn.ts +3 -0
  244. package/core/fetcher/getHeader.ts +8 -0
  245. package/core/fetcher/getRequestBody.ts +20 -0
  246. package/core/fetcher/getResponseBody.ts +58 -0
  247. package/core/fetcher/index.ts +11 -0
  248. package/core/fetcher/makeRequest.ts +70 -0
  249. package/core/fetcher/requestWithRetries.ts +64 -0
  250. package/core/fetcher/signals.ts +26 -0
  251. package/core/headers.ts +33 -0
  252. package/core/index.ts +4 -0
  253. package/core/json.ts +27 -0
  254. package/core/logging/exports.ts +19 -0
  255. package/core/logging/index.ts +1 -0
  256. package/core/logging/logger.ts +203 -0
  257. package/core/runtime/index.ts +1 -0
  258. package/core/runtime/runtime.ts +134 -0
  259. package/core/url/encodePathParam.ts +18 -0
  260. package/core/url/index.ts +3 -0
  261. package/core/url/join.ts +79 -0
  262. package/core/url/qs.ts +74 -0
  263. package/errors/LevelFourError.ts +58 -0
  264. package/errors/LevelFourTimeoutError.ts +13 -0
  265. package/errors/handleNonStatusCodeError.ts +37 -0
  266. package/errors/index.ts +2 -0
  267. package/errors.ts +100 -0
  268. package/exports.ts +1 -0
  269. package/index.ts +22 -0
  270. package/jest.config.js +17 -0
  271. package/package.json +35 -0
  272. package/pagination.ts +54 -0
  273. package/telemetry.ts +64 -0
  274. package/tests/auth.test.ts +64 -0
  275. package/tests/errors.test.ts +92 -0
  276. package/tests/pagination.test.ts +72 -0
  277. package/tests/telemetry.test.ts +110 -0
  278. package/tsconfig.json +22 -0
  279. package/webhooks.ts +77 -0
@@ -0,0 +1,410 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
4
+ import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../BaseClient.js";
5
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
6
+ import * as core from "../../../../core/index.js";
7
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
8
+ import * as errors from "../../../../errors/index.js";
9
+ import * as LevelFour from "../../../index.js";
10
+
11
+ export declare namespace PrAnalysisInstallationsClient {
12
+ export type Options = BaseClientOptions;
13
+
14
+ export interface RequestOptions extends BaseRequestOptions {}
15
+ }
16
+
17
+ export class PrAnalysisInstallationsClient {
18
+ protected readonly _options: NormalizedClientOptions<PrAnalysisInstallationsClient.Options>;
19
+
20
+ constructor(options: PrAnalysisInstallationsClient.Options) {
21
+ this._options = normalizeClientOptions(options);
22
+ }
23
+
24
+ /**
25
+ * @param {LevelFour.ListInstallationsApiV1PrAnalysisInstallationsGetRequest} request
26
+ * @param {PrAnalysisInstallationsClient.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link LevelFour.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.prAnalysisInstallations.listInstallations({
32
+ * authorization: "authorization",
33
+ * account: "account"
34
+ * })
35
+ */
36
+ public listInstallations(
37
+ request: LevelFour.ListInstallationsApiV1PrAnalysisInstallationsGetRequest,
38
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
39
+ ): core.HttpResponsePromise<unknown> {
40
+ return core.HttpResponsePromise.fromPromise(this.__listInstallations(request, requestOptions));
41
+ }
42
+
43
+ private async __listInstallations(
44
+ request: LevelFour.ListInstallationsApiV1PrAnalysisInstallationsGetRequest,
45
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
46
+ ): Promise<core.WithRawResponse<unknown>> {
47
+ const { account, authorization } = request;
48
+ const _queryParams: Record<string, unknown> = {
49
+ account,
50
+ };
51
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
52
+ this._options?.headers,
53
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
54
+ requestOptions?.headers,
55
+ );
56
+ const _response = await core.fetcher({
57
+ url: core.url.join(
58
+ (await core.Supplier.get(this._options.baseUrl)) ??
59
+ (await core.Supplier.get(this._options.environment)),
60
+ "api/v1/pr-analysis/installations",
61
+ ),
62
+ method: "GET",
63
+ headers: _headers,
64
+ queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
65
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
66
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
67
+ abortSignal: requestOptions?.abortSignal,
68
+ fetchFn: this._options?.fetch,
69
+ logging: this._options.logging,
70
+ });
71
+ if (_response.ok) {
72
+ return { data: _response.body, rawResponse: _response.rawResponse };
73
+ }
74
+
75
+ if (_response.error.reason === "status-code") {
76
+ switch (_response.error.statusCode) {
77
+ case 422:
78
+ throw new LevelFour.UnprocessableEntityError(
79
+ _response.error.body as LevelFour.HttpValidationError,
80
+ _response.rawResponse,
81
+ );
82
+ default:
83
+ throw new errors.LevelFourError({
84
+ statusCode: _response.error.statusCode,
85
+ body: _response.error.body,
86
+ rawResponse: _response.rawResponse,
87
+ });
88
+ }
89
+ }
90
+
91
+ return handleNonStatusCodeError(
92
+ _response.error,
93
+ _response.rawResponse,
94
+ "GET",
95
+ "/api/v1/pr-analysis/installations",
96
+ );
97
+ }
98
+
99
+ /**
100
+ * @param {LevelFour.RegisterInstallationRequest} request
101
+ * @param {PrAnalysisInstallationsClient.RequestOptions} requestOptions - Request-specific configuration.
102
+ *
103
+ * @throws {@link LevelFour.UnprocessableEntityError}
104
+ *
105
+ * @example
106
+ * await client.prAnalysisInstallations.registerInstallation({
107
+ * authorization: "authorization",
108
+ * installation_id: 1,
109
+ * account: "account"
110
+ * })
111
+ */
112
+ public registerInstallation(
113
+ request: LevelFour.RegisterInstallationRequest,
114
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
115
+ ): core.HttpResponsePromise<unknown> {
116
+ return core.HttpResponsePromise.fromPromise(this.__registerInstallation(request, requestOptions));
117
+ }
118
+
119
+ private async __registerInstallation(
120
+ request: LevelFour.RegisterInstallationRequest,
121
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
122
+ ): Promise<core.WithRawResponse<unknown>> {
123
+ const { authorization, ..._body } = request;
124
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
125
+ this._options?.headers,
126
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
127
+ requestOptions?.headers,
128
+ );
129
+ const _response = await core.fetcher({
130
+ url: core.url.join(
131
+ (await core.Supplier.get(this._options.baseUrl)) ??
132
+ (await core.Supplier.get(this._options.environment)),
133
+ "api/v1/pr-analysis/installations",
134
+ ),
135
+ method: "POST",
136
+ headers: _headers,
137
+ contentType: "application/json",
138
+ queryParameters: requestOptions?.queryParams,
139
+ requestType: "json",
140
+ body: _body,
141
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
142
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
143
+ abortSignal: requestOptions?.abortSignal,
144
+ fetchFn: this._options?.fetch,
145
+ logging: this._options.logging,
146
+ });
147
+ if (_response.ok) {
148
+ return { data: _response.body, rawResponse: _response.rawResponse };
149
+ }
150
+
151
+ if (_response.error.reason === "status-code") {
152
+ switch (_response.error.statusCode) {
153
+ case 422:
154
+ throw new LevelFour.UnprocessableEntityError(
155
+ _response.error.body as LevelFour.HttpValidationError,
156
+ _response.rawResponse,
157
+ );
158
+ default:
159
+ throw new errors.LevelFourError({
160
+ statusCode: _response.error.statusCode,
161
+ body: _response.error.body,
162
+ rawResponse: _response.rawResponse,
163
+ });
164
+ }
165
+ }
166
+
167
+ return handleNonStatusCodeError(
168
+ _response.error,
169
+ _response.rawResponse,
170
+ "POST",
171
+ "/api/v1/pr-analysis/installations",
172
+ );
173
+ }
174
+
175
+ /**
176
+ * @param {LevelFour.DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest} request
177
+ * @param {PrAnalysisInstallationsClient.RequestOptions} requestOptions - Request-specific configuration.
178
+ *
179
+ * @throws {@link LevelFour.UnprocessableEntityError}
180
+ *
181
+ * @example
182
+ * await client.prAnalysisInstallations.deleteInstallation({
183
+ * authorization: "authorization",
184
+ * installation_id: 1,
185
+ * account: "account"
186
+ * })
187
+ */
188
+ public deleteInstallation(
189
+ request: LevelFour.DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest,
190
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
191
+ ): core.HttpResponsePromise<unknown> {
192
+ return core.HttpResponsePromise.fromPromise(this.__deleteInstallation(request, requestOptions));
193
+ }
194
+
195
+ private async __deleteInstallation(
196
+ request: LevelFour.DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest,
197
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
198
+ ): Promise<core.WithRawResponse<unknown>> {
199
+ const { installation_id: installationId, account, authorization } = request;
200
+ const _queryParams: Record<string, unknown> = {
201
+ account,
202
+ };
203
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
204
+ this._options?.headers,
205
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
206
+ requestOptions?.headers,
207
+ );
208
+ const _response = await core.fetcher({
209
+ url: core.url.join(
210
+ (await core.Supplier.get(this._options.baseUrl)) ??
211
+ (await core.Supplier.get(this._options.environment)),
212
+ `api/v1/pr-analysis/installations/${core.url.encodePathParam(installationId)}`,
213
+ ),
214
+ method: "DELETE",
215
+ headers: _headers,
216
+ queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
217
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
218
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
219
+ abortSignal: requestOptions?.abortSignal,
220
+ fetchFn: this._options?.fetch,
221
+ logging: this._options.logging,
222
+ });
223
+ if (_response.ok) {
224
+ return { data: _response.body, rawResponse: _response.rawResponse };
225
+ }
226
+
227
+ if (_response.error.reason === "status-code") {
228
+ switch (_response.error.statusCode) {
229
+ case 422:
230
+ throw new LevelFour.UnprocessableEntityError(
231
+ _response.error.body as LevelFour.HttpValidationError,
232
+ _response.rawResponse,
233
+ );
234
+ default:
235
+ throw new errors.LevelFourError({
236
+ statusCode: _response.error.statusCode,
237
+ body: _response.error.body,
238
+ rawResponse: _response.rawResponse,
239
+ });
240
+ }
241
+ }
242
+
243
+ return handleNonStatusCodeError(
244
+ _response.error,
245
+ _response.rawResponse,
246
+ "DELETE",
247
+ "/api/v1/pr-analysis/installations/{installation_id}",
248
+ );
249
+ }
250
+
251
+ /**
252
+ * @param {LevelFour.AddReposRequest} request
253
+ * @param {PrAnalysisInstallationsClient.RequestOptions} requestOptions - Request-specific configuration.
254
+ *
255
+ * @throws {@link LevelFour.UnprocessableEntityError}
256
+ *
257
+ * @example
258
+ * await client.prAnalysisInstallations.addRepos({
259
+ * authorization: "authorization",
260
+ * installation_id: 1,
261
+ * account: "account",
262
+ * repos: ["repos"]
263
+ * })
264
+ */
265
+ public addRepos(
266
+ request: LevelFour.AddReposRequest,
267
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
268
+ ): core.HttpResponsePromise<unknown> {
269
+ return core.HttpResponsePromise.fromPromise(this.__addRepos(request, requestOptions));
270
+ }
271
+
272
+ private async __addRepos(
273
+ request: LevelFour.AddReposRequest,
274
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
275
+ ): Promise<core.WithRawResponse<unknown>> {
276
+ const { installation_id: installationId, account, authorization, ..._body } = request;
277
+ const _queryParams: Record<string, unknown> = {
278
+ account,
279
+ };
280
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
281
+ this._options?.headers,
282
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
283
+ requestOptions?.headers,
284
+ );
285
+ const _response = await core.fetcher({
286
+ url: core.url.join(
287
+ (await core.Supplier.get(this._options.baseUrl)) ??
288
+ (await core.Supplier.get(this._options.environment)),
289
+ `api/v1/pr-analysis/installations/${core.url.encodePathParam(installationId)}/repos`,
290
+ ),
291
+ method: "POST",
292
+ headers: _headers,
293
+ contentType: "application/json",
294
+ queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
295
+ requestType: "json",
296
+ body: _body,
297
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
298
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
299
+ abortSignal: requestOptions?.abortSignal,
300
+ fetchFn: this._options?.fetch,
301
+ logging: this._options.logging,
302
+ });
303
+ if (_response.ok) {
304
+ return { data: _response.body, rawResponse: _response.rawResponse };
305
+ }
306
+
307
+ if (_response.error.reason === "status-code") {
308
+ switch (_response.error.statusCode) {
309
+ case 422:
310
+ throw new LevelFour.UnprocessableEntityError(
311
+ _response.error.body as LevelFour.HttpValidationError,
312
+ _response.rawResponse,
313
+ );
314
+ default:
315
+ throw new errors.LevelFourError({
316
+ statusCode: _response.error.statusCode,
317
+ body: _response.error.body,
318
+ rawResponse: _response.rawResponse,
319
+ });
320
+ }
321
+ }
322
+
323
+ return handleNonStatusCodeError(
324
+ _response.error,
325
+ _response.rawResponse,
326
+ "POST",
327
+ "/api/v1/pr-analysis/installations/{installation_id}/repos",
328
+ );
329
+ }
330
+
331
+ /**
332
+ * @param {LevelFour.RemoveReposRequest} request
333
+ * @param {PrAnalysisInstallationsClient.RequestOptions} requestOptions - Request-specific configuration.
334
+ *
335
+ * @throws {@link LevelFour.UnprocessableEntityError}
336
+ *
337
+ * @example
338
+ * await client.prAnalysisInstallations.removeRepos({
339
+ * authorization: "authorization",
340
+ * installation_id: 1,
341
+ * account: "account",
342
+ * repos: ["repos"]
343
+ * })
344
+ */
345
+ public removeRepos(
346
+ request: LevelFour.RemoveReposRequest,
347
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
348
+ ): core.HttpResponsePromise<unknown> {
349
+ return core.HttpResponsePromise.fromPromise(this.__removeRepos(request, requestOptions));
350
+ }
351
+
352
+ private async __removeRepos(
353
+ request: LevelFour.RemoveReposRequest,
354
+ requestOptions?: PrAnalysisInstallationsClient.RequestOptions,
355
+ ): Promise<core.WithRawResponse<unknown>> {
356
+ const { installation_id: installationId, account, authorization, ..._body } = request;
357
+ const _queryParams: Record<string, unknown> = {
358
+ account,
359
+ };
360
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
361
+ this._options?.headers,
362
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
363
+ requestOptions?.headers,
364
+ );
365
+ const _response = await core.fetcher({
366
+ url: core.url.join(
367
+ (await core.Supplier.get(this._options.baseUrl)) ??
368
+ (await core.Supplier.get(this._options.environment)),
369
+ `api/v1/pr-analysis/installations/${core.url.encodePathParam(installationId)}/repos`,
370
+ ),
371
+ method: "DELETE",
372
+ headers: _headers,
373
+ contentType: "application/json",
374
+ queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
375
+ requestType: "json",
376
+ body: _body,
377
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
378
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
379
+ abortSignal: requestOptions?.abortSignal,
380
+ fetchFn: this._options?.fetch,
381
+ logging: this._options.logging,
382
+ });
383
+ if (_response.ok) {
384
+ return { data: _response.body, rawResponse: _response.rawResponse };
385
+ }
386
+
387
+ if (_response.error.reason === "status-code") {
388
+ switch (_response.error.statusCode) {
389
+ case 422:
390
+ throw new LevelFour.UnprocessableEntityError(
391
+ _response.error.body as LevelFour.HttpValidationError,
392
+ _response.rawResponse,
393
+ );
394
+ default:
395
+ throw new errors.LevelFourError({
396
+ statusCode: _response.error.statusCode,
397
+ body: _response.error.body,
398
+ rawResponse: _response.rawResponse,
399
+ });
400
+ }
401
+ }
402
+
403
+ return handleNonStatusCodeError(
404
+ _response.error,
405
+ _response.rawResponse,
406
+ "DELETE",
407
+ "/api/v1/pr-analysis/installations/{installation_id}/repos",
408
+ );
409
+ }
410
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ /**
4
+ * @example
5
+ * {
6
+ * authorization: "authorization",
7
+ * installation_id: 1,
8
+ * account: "account",
9
+ * repos: ["repos"]
10
+ * }
11
+ */
12
+ export interface AddReposRequest {
13
+ installation_id: number;
14
+ account: string;
15
+ authorization: string;
16
+ repos: string[];
17
+ }
@@ -0,0 +1,15 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ /**
4
+ * @example
5
+ * {
6
+ * authorization: "authorization",
7
+ * installation_id: 1,
8
+ * account: "account"
9
+ * }
10
+ */
11
+ export interface DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest {
12
+ installation_id: number;
13
+ account: string;
14
+ authorization: string;
15
+ }
@@ -0,0 +1,13 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ /**
4
+ * @example
5
+ * {
6
+ * authorization: "authorization",
7
+ * account: "account"
8
+ * }
9
+ */
10
+ export interface ListInstallationsApiV1PrAnalysisInstallationsGetRequest {
11
+ account: string;
12
+ authorization: string;
13
+ }
@@ -0,0 +1,16 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ /**
4
+ * @example
5
+ * {
6
+ * authorization: "authorization",
7
+ * installation_id: 1,
8
+ * account: "account"
9
+ * }
10
+ */
11
+ export interface RegisterInstallationRequest {
12
+ authorization: string;
13
+ installation_id: number;
14
+ account: string;
15
+ repos?: string[];
16
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ /**
4
+ * @example
5
+ * {
6
+ * authorization: "authorization",
7
+ * installation_id: 1,
8
+ * account: "account",
9
+ * repos: ["repos"]
10
+ * }
11
+ */
12
+ export interface RemoveReposRequest {
13
+ installation_id: number;
14
+ account: string;
15
+ authorization: string;
16
+ repos: string[];
17
+ }
@@ -0,0 +1,5 @@
1
+ export type { AddReposRequest } from "./AddReposRequest.js";
2
+ export type { DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest } from "./DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest.js";
3
+ export type { ListInstallationsApiV1PrAnalysisInstallationsGetRequest } from "./ListInstallationsApiV1PrAnalysisInstallationsGetRequest.js";
4
+ export type { RegisterInstallationRequest } from "./RegisterInstallationRequest.js";
5
+ export type { RemoveReposRequest } from "./RemoveReposRequest.js";
@@ -0,0 +1,4 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export { PrAnalysisInstallationsClient } from "./client/Client.js";
4
+ export * from "./client/index.js";
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,169 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
4
+ import { type NormalizedClientOptions, normalizeClientOptions } from "../../../../BaseClient.js";
5
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
6
+ import * as core from "../../../../core/index.js";
7
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
8
+ import * as errors from "../../../../errors/index.js";
9
+ import * as LevelFour from "../../../index.js";
10
+
11
+ export declare namespace PrAnalysisQueryClient {
12
+ export type Options = BaseClientOptions;
13
+
14
+ export interface RequestOptions extends BaseRequestOptions {}
15
+ }
16
+
17
+ export class PrAnalysisQueryClient {
18
+ protected readonly _options: NormalizedClientOptions<PrAnalysisQueryClient.Options>;
19
+
20
+ constructor(options: PrAnalysisQueryClient.Options) {
21
+ this._options = normalizeClientOptions(options);
22
+ }
23
+
24
+ /**
25
+ * @param {LevelFour.ExplainRequest} request
26
+ * @param {PrAnalysisQueryClient.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link LevelFour.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.prAnalysisQuery.explainResource({
32
+ * authorization: "authorization",
33
+ * repository: "repository",
34
+ * pr_number: 1,
35
+ * resource_key: "resource_key"
36
+ * })
37
+ */
38
+ public explainResource(
39
+ request: LevelFour.ExplainRequest,
40
+ requestOptions?: PrAnalysisQueryClient.RequestOptions,
41
+ ): core.HttpResponsePromise<unknown> {
42
+ return core.HttpResponsePromise.fromPromise(this.__explainResource(request, requestOptions));
43
+ }
44
+
45
+ private async __explainResource(
46
+ request: LevelFour.ExplainRequest,
47
+ requestOptions?: PrAnalysisQueryClient.RequestOptions,
48
+ ): Promise<core.WithRawResponse<unknown>> {
49
+ const { authorization, ..._body } = request;
50
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
51
+ this._options?.headers,
52
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
53
+ requestOptions?.headers,
54
+ );
55
+ const _response = await core.fetcher({
56
+ url: core.url.join(
57
+ (await core.Supplier.get(this._options.baseUrl)) ??
58
+ (await core.Supplier.get(this._options.environment)),
59
+ "api/v1/pr-analysis/explain",
60
+ ),
61
+ method: "POST",
62
+ headers: _headers,
63
+ contentType: "application/json",
64
+ queryParameters: requestOptions?.queryParams,
65
+ requestType: "json",
66
+ body: _body,
67
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
68
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
69
+ abortSignal: requestOptions?.abortSignal,
70
+ fetchFn: this._options?.fetch,
71
+ logging: this._options.logging,
72
+ });
73
+ if (_response.ok) {
74
+ return { data: _response.body, rawResponse: _response.rawResponse };
75
+ }
76
+
77
+ if (_response.error.reason === "status-code") {
78
+ switch (_response.error.statusCode) {
79
+ case 422:
80
+ throw new LevelFour.UnprocessableEntityError(
81
+ _response.error.body as LevelFour.HttpValidationError,
82
+ _response.rawResponse,
83
+ );
84
+ default:
85
+ throw new errors.LevelFourError({
86
+ statusCode: _response.error.statusCode,
87
+ body: _response.error.body,
88
+ rawResponse: _response.rawResponse,
89
+ });
90
+ }
91
+ }
92
+
93
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/v1/pr-analysis/explain");
94
+ }
95
+
96
+ /**
97
+ * @param {LevelFour.WhatifRequest} request
98
+ * @param {PrAnalysisQueryClient.RequestOptions} requestOptions - Request-specific configuration.
99
+ *
100
+ * @throws {@link LevelFour.UnprocessableEntityError}
101
+ *
102
+ * @example
103
+ * await client.prAnalysisQuery.whatifAnalysis({
104
+ * authorization: "authorization",
105
+ * repository: "repository",
106
+ * pr_number: 1,
107
+ * resource_key: "resource_key",
108
+ * attribute: "attribute",
109
+ * hypothetical_value: "hypothetical_value"
110
+ * })
111
+ */
112
+ public whatifAnalysis(
113
+ request: LevelFour.WhatifRequest,
114
+ requestOptions?: PrAnalysisQueryClient.RequestOptions,
115
+ ): core.HttpResponsePromise<unknown> {
116
+ return core.HttpResponsePromise.fromPromise(this.__whatifAnalysis(request, requestOptions));
117
+ }
118
+
119
+ private async __whatifAnalysis(
120
+ request: LevelFour.WhatifRequest,
121
+ requestOptions?: PrAnalysisQueryClient.RequestOptions,
122
+ ): Promise<core.WithRawResponse<unknown>> {
123
+ const { authorization, ..._body } = request;
124
+ const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
125
+ this._options?.headers,
126
+ mergeOnlyDefinedHeaders({ authorization: authorization }),
127
+ requestOptions?.headers,
128
+ );
129
+ const _response = await core.fetcher({
130
+ url: core.url.join(
131
+ (await core.Supplier.get(this._options.baseUrl)) ??
132
+ (await core.Supplier.get(this._options.environment)),
133
+ "api/v1/pr-analysis/whatif",
134
+ ),
135
+ method: "POST",
136
+ headers: _headers,
137
+ contentType: "application/json",
138
+ queryParameters: requestOptions?.queryParams,
139
+ requestType: "json",
140
+ body: _body,
141
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
142
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
143
+ abortSignal: requestOptions?.abortSignal,
144
+ fetchFn: this._options?.fetch,
145
+ logging: this._options.logging,
146
+ });
147
+ if (_response.ok) {
148
+ return { data: _response.body, rawResponse: _response.rawResponse };
149
+ }
150
+
151
+ if (_response.error.reason === "status-code") {
152
+ switch (_response.error.statusCode) {
153
+ case 422:
154
+ throw new LevelFour.UnprocessableEntityError(
155
+ _response.error.body as LevelFour.HttpValidationError,
156
+ _response.rawResponse,
157
+ );
158
+ default:
159
+ throw new errors.LevelFourError({
160
+ statusCode: _response.error.statusCode,
161
+ body: _response.error.body,
162
+ rawResponse: _response.rawResponse,
163
+ });
164
+ }
165
+ }
166
+
167
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/v1/pr-analysis/whatif");
168
+ }
169
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";