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.
- package/.fernignore +9 -0
- package/BaseClient.ts +56 -0
- package/Client.ts +90 -0
- package/LevelFourClient.ts +50 -0
- package/api/errors/UnprocessableEntityError.ts +22 -0
- package/api/errors/index.ts +1 -0
- package/api/index.ts +3 -0
- package/api/resources/apiKeys/client/Client.ts +298 -0
- package/api/resources/apiKeys/client/index.ts +1 -0
- package/api/resources/apiKeys/client/requests/CreateApiKeyRequest.ts +23 -0
- package/api/resources/apiKeys/client/requests/ListApiKeysApiV1ApiKeysGetRequest.ts +11 -0
- package/api/resources/apiKeys/client/requests/RevokeApiKeyApiV1ApiKeysKeyIdDeleteRequest.ts +14 -0
- package/api/resources/apiKeys/client/requests/RotateApiKeyApiV1ApiKeysKeyIdRotatePostRequest.ts +14 -0
- package/api/resources/apiKeys/client/requests/index.ts +4 -0
- package/api/resources/apiKeys/exports.ts +4 -0
- package/api/resources/apiKeys/index.ts +1 -0
- package/api/resources/evaluation/client/Client.ts +71 -0
- package/api/resources/evaluation/client/index.ts +1 -0
- package/api/resources/evaluation/exports.ts +4 -0
- package/api/resources/evaluation/index.ts +1 -0
- package/api/resources/health/client/Client.ts +108 -0
- package/api/resources/health/client/index.ts +1 -0
- package/api/resources/health/exports.ts +4 -0
- package/api/resources/health/index.ts +1 -0
- package/api/resources/index.ts +24 -0
- package/api/resources/prAnalysis/client/Client.ts +100 -0
- package/api/resources/prAnalysis/client/index.ts +1 -0
- package/api/resources/prAnalysis/client/requests/AnalyzePrRequest.ts +30 -0
- package/api/resources/prAnalysis/client/requests/index.ts +1 -0
- package/api/resources/prAnalysis/exports.ts +4 -0
- package/api/resources/prAnalysis/index.ts +1 -0
- package/api/resources/prAnalysisActions/client/Client.ts +418 -0
- package/api/resources/prAnalysisActions/client/index.ts +1 -0
- package/api/resources/prAnalysisActions/client/requests/DismissSuggestionsApiV1PrAnalysisActionsDismissPostRequest.ts +21 -0
- package/api/resources/prAnalysisActions/client/requests/GetIgnoredResourcesApiV1PrAnalysisActionsIgnoreGetRequest.ts +15 -0
- package/api/resources/prAnalysisActions/client/requests/GetPrStatusApiV1PrAnalysisActionsStatusGetRequest.ts +15 -0
- package/api/resources/prAnalysisActions/client/requests/IgnoreRequest.ts +21 -0
- package/api/resources/prAnalysisActions/client/requests/SnoozeSuggestionsApiV1PrAnalysisActionsSnoozePostRequest.ts +21 -0
- package/api/resources/prAnalysisActions/client/requests/index.ts +5 -0
- package/api/resources/prAnalysisActions/exports.ts +4 -0
- package/api/resources/prAnalysisActions/index.ts +1 -0
- package/api/resources/prAnalysisInstallations/client/Client.ts +410 -0
- package/api/resources/prAnalysisInstallations/client/index.ts +1 -0
- package/api/resources/prAnalysisInstallations/client/requests/AddReposRequest.ts +17 -0
- package/api/resources/prAnalysisInstallations/client/requests/DeleteInstallationApiV1PrAnalysisInstallationsInstallationIdDeleteRequest.ts +15 -0
- package/api/resources/prAnalysisInstallations/client/requests/ListInstallationsApiV1PrAnalysisInstallationsGetRequest.ts +13 -0
- package/api/resources/prAnalysisInstallations/client/requests/RegisterInstallationRequest.ts +16 -0
- package/api/resources/prAnalysisInstallations/client/requests/RemoveReposRequest.ts +17 -0
- package/api/resources/prAnalysisInstallations/client/requests/index.ts +5 -0
- package/api/resources/prAnalysisInstallations/exports.ts +4 -0
- package/api/resources/prAnalysisInstallations/index.ts +1 -0
- package/api/resources/prAnalysisQuery/client/Client.ts +169 -0
- package/api/resources/prAnalysisQuery/client/index.ts +1 -0
- package/api/resources/prAnalysisQuery/client/requests/ExplainRequest.ts +17 -0
- package/api/resources/prAnalysisQuery/client/requests/WhatifRequest.ts +21 -0
- package/api/resources/prAnalysisQuery/client/requests/index.ts +2 -0
- package/api/resources/prAnalysisQuery/exports.ts +4 -0
- package/api/resources/prAnalysisQuery/index.ts +1 -0
- package/api/resources/providers/client/Client.ts +991 -0
- package/api/resources/providers/client/index.ts +1 -0
- package/api/resources/providers/client/requests/GetProviderFilterOptionsApiV1ProvidersProviderIdSpendingFilterOptionsGetRequest.ts +17 -0
- package/api/resources/providers/client/requests/GetProviderPotentialSavingsBreakdownApiV1ProvidersProviderIdPotentialSavingsBreakdownGetRequest.ts +19 -0
- package/api/resources/providers/client/requests/GetProviderPotentialSavingsSummaryApiV1ProvidersProviderIdPotentialSavingsSummaryGetRequest.ts +11 -0
- package/api/resources/providers/client/requests/GetProviderRecommendationFilterOptionsApiV1ProvidersProviderIdRecommendationsFilterOptionsGetRequest.ts +11 -0
- package/api/resources/providers/client/requests/GetProviderRecommendationsBreakdownApiV1ProvidersProviderIdRecommendationsGetRequest.ts +33 -0
- package/api/resources/providers/client/requests/GetProviderRecommendationsOverviewApiV1ProvidersProviderIdRecommendationsOverviewGetRequest.ts +11 -0
- package/api/resources/providers/client/requests/GetProviderRecommendationsSummaryApiV1ProvidersProviderIdRecommendationsSummaryGetRequest.ts +11 -0
- package/api/resources/providers/client/requests/GetProviderSavedSummaryApiV1ProvidersProviderIdSavingsSummaryGetRequest.ts +11 -0
- package/api/resources/providers/client/requests/GetProviderServiceBreakdownApiV1ProvidersProviderIdSpendingBreakdownGetRequest.ts +45 -0
- package/api/resources/providers/client/requests/GetProviderSpendingSummaryApiV1ProvidersProviderIdSpendingSummaryGetRequest.ts +11 -0
- package/api/resources/providers/client/requests/GetProviderSpendingTimelineApiV1ProvidersProviderIdSpendingTimelineGetRequest.ts +17 -0
- package/api/resources/providers/client/requests/GetSavedByProviderBreakdownApiV1ProvidersProviderIdSavingsBreakdownGetRequest.ts +31 -0
- package/api/resources/providers/client/requests/index.ts +12 -0
- package/api/resources/providers/exports.ts +4 -0
- package/api/resources/providers/index.ts +2 -0
- package/api/resources/providers/types/GetProviderServiceBreakdownApiV1ProvidersProviderIdSpendingBreakdownGetResponse.ts +8 -0
- package/api/resources/providers/types/index.ts +1 -0
- package/api/resources/recommendations/client/Client.ts +815 -0
- package/api/resources/recommendations/client/index.ts +1 -0
- package/api/resources/recommendations/client/requests/AcceptTermsApiV1RecommendationsRecommendationIdAcceptTermsPostRequest.ts +11 -0
- package/api/resources/recommendations/client/requests/CompleteWizardApiV1RecommendationsRecommendationIdCompletePostRequest.ts +11 -0
- package/api/resources/recommendations/client/requests/GetRecommendationDetailsApiV1RecommendationsRecommendationIdDetailsGetRequest.ts +11 -0
- package/api/resources/recommendations/client/requests/GetRecommendationForWizardApiV1RecommendationsRecommendationIdGetRequest.ts +11 -0
- package/api/resources/recommendations/client/requests/GetRecommendationsApiV1RecommendationsGetRequest.ts +16 -0
- package/api/resources/recommendations/client/requests/ImplementationMethodRequest.ts +14 -0
- package/api/resources/recommendations/client/requests/SavingsDecisionRequest.ts +18 -0
- package/api/resources/recommendations/client/requests/UpdateTagRequest.ts +13 -0
- package/api/resources/recommendations/client/requests/index.ts +8 -0
- package/api/resources/recommendations/exports.ts +4 -0
- package/api/resources/recommendations/index.ts +1 -0
- package/api/resources/savings/client/Client.ts +231 -0
- package/api/resources/savings/client/index.ts +1 -0
- package/api/resources/savings/client/requests/ExecutionRequestBody.ts +15 -0
- package/api/resources/savings/client/requests/GetSavedBreakdownApiV1SavingsBreakdownGetRequest.ts +30 -0
- package/api/resources/savings/client/requests/index.ts +2 -0
- package/api/resources/savings/exports.ts +4 -0
- package/api/resources/savings/index.ts +1 -0
- package/api/resources/spending/client/Client.ts +288 -0
- package/api/resources/spending/client/index.ts +1 -0
- package/api/resources/spending/client/requests/GetCostBreakdownApiV1SpendingBreakdownGetRequest.ts +30 -0
- package/api/resources/spending/client/requests/GetDailySpendingBreakdownApiV1SpendingDailyBreakdownGetRequest.ts +12 -0
- package/api/resources/spending/client/requests/index.ts +2 -0
- package/api/resources/spending/exports.ts +4 -0
- package/api/resources/spending/index.ts +2 -0
- package/api/resources/spending/types/GetCostBreakdownApiV1SpendingBreakdownGetResponse.ts +9 -0
- package/api/resources/spending/types/index.ts +1 -0
- package/api/resources/webhooks/client/Client.ts +232 -0
- package/api/resources/webhooks/client/index.ts +1 -0
- package/api/resources/webhooks/client/requests/DeleteEndpointApiV1WebhooksEndpointsEndpointIdDeleteRequest.ts +14 -0
- package/api/resources/webhooks/client/requests/ListEndpointsApiV1WebhooksEndpointsGetRequest.ts +11 -0
- package/api/resources/webhooks/client/requests/RegisterEndpointRequest.ts +18 -0
- package/api/resources/webhooks/client/requests/index.ts +3 -0
- package/api/resources/webhooks/exports.ts +4 -0
- package/api/resources/webhooks/index.ts +1 -0
- package/api/types/AcceptTermsData.ts +10 -0
- package/api/types/AcceptTermsResponse.ts +12 -0
- package/api/types/ActionRequest.ts +14 -0
- package/api/types/ApiKeyCreatedData.ts +13 -0
- package/api/types/ApiKeyData.ts +12 -0
- package/api/types/ComparisonItem.ts +10 -0
- package/api/types/CompleteWizardData.ts +12 -0
- package/api/types/CompleteWizardResponse.ts +12 -0
- package/api/types/CostBreakdownData.ts +14 -0
- package/api/types/CostBreakdownItem.ts +27 -0
- package/api/types/CostBreakdownRawData.ts +15 -0
- package/api/types/CostBreakdownRawResponse.ts +12 -0
- package/api/types/CostBreakdownResponse.ts +12 -0
- package/api/types/CostsBreakdownChartData.ts +19 -0
- package/api/types/CostsBreakdownChartResponse.ts +12 -0
- package/api/types/CostsBreakdownDataPoint.ts +17 -0
- package/api/types/CostsBreakdownGroupedChartData.ts +21 -0
- package/api/types/CostsBreakdownGroupedChartResponse.ts +12 -0
- package/api/types/CostsBreakdownGroupedDataPoint.ts +13 -0
- package/api/types/CostsBreakdownTotals.ts +15 -0
- package/api/types/CreateApiKeyResponse.ts +9 -0
- package/api/types/DailySpendingBreakdownData.ts +17 -0
- package/api/types/DailySpendingBreakdownResponse.ts +12 -0
- package/api/types/DailySpendingDataPoint.ts +11 -0
- package/api/types/DashboardSummaryData.ts +29 -0
- package/api/types/DashboardSummaryResponse.ts +12 -0
- package/api/types/DeleteEndpointData.ts +6 -0
- package/api/types/DeleteEndpointResponse.ts +9 -0
- package/api/types/EndpointData.ts +9 -0
- package/api/types/EvaluationStatusData.ts +27 -0
- package/api/types/EvaluationStatusResponse.ts +12 -0
- package/api/types/ExecutionLogCommand.ts +7 -0
- package/api/types/ExecutionLogEntry.ts +10 -0
- package/api/types/ExecutionStepSchema.ts +9 -0
- package/api/types/HttpValidationError.ts +7 -0
- package/api/types/ImplementationMethodData.ts +10 -0
- package/api/types/ImplementationMethodResponse.ts +12 -0
- package/api/types/ImplementationStep.ts +8 -0
- package/api/types/ListApiKeysData.ts +8 -0
- package/api/types/ListApiKeysResponse.ts +9 -0
- package/api/types/ListEndpointsResponse.ts +9 -0
- package/api/types/MetricDataPoint.ts +8 -0
- package/api/types/MetricSeries.ts +15 -0
- package/api/types/MetricSeriesEntry.ts +9 -0
- package/api/types/MonthlySpendingData.ts +11 -0
- package/api/types/MonthlySpendingDataPoint.ts +11 -0
- package/api/types/MonthlySpendingResponse.ts +12 -0
- package/api/types/PaginationMeta.ts +19 -0
- package/api/types/ProcessingRecommendationItem.ts +23 -0
- package/api/types/ProcessingRecommendationsData.ts +12 -0
- package/api/types/ProcessingRecommendationsResponse.ts +12 -0
- package/api/types/Provider.ts +17 -0
- package/api/types/ProviderBreakdownData.ts +13 -0
- package/api/types/ProviderBreakdownItem.ts +31 -0
- package/api/types/ProviderBreakdownResponse.ts +12 -0
- package/api/types/ProviderFilterOptionsData.ts +19 -0
- package/api/types/ProviderFilterOptionsResponse.ts +12 -0
- package/api/types/ProviderPotentialSavingsSummaryData.ts +17 -0
- package/api/types/ProviderPotentialSavingsSummaryResponse.ts +12 -0
- package/api/types/ProviderRecommendationsSummaryData.ts +15 -0
- package/api/types/ProviderRecommendationsSummaryResponse.ts +12 -0
- package/api/types/ProviderSavedSummaryData.ts +21 -0
- package/api/types/ProviderSavedSummaryResponse.ts +12 -0
- package/api/types/ProviderServiceBreakdownData.ts +26 -0
- package/api/types/ProviderServiceBreakdownItem.ts +29 -0
- package/api/types/ProviderServiceBreakdownRawData.ts +25 -0
- package/api/types/ProviderServiceBreakdownRawResponse.ts +12 -0
- package/api/types/ProviderServiceBreakdownResponse.ts +12 -0
- package/api/types/ProviderServiceCostsBreakdownData.ts +25 -0
- package/api/types/ProviderServiceCostsBreakdownResponse.ts +12 -0
- package/api/types/ProviderServiceCostsDataPoint.ts +13 -0
- package/api/types/ProviderSpending.ts +23 -0
- package/api/types/ProviderSpendingSummaryData.ts +27 -0
- package/api/types/ProviderSpendingSummaryResponse.ts +12 -0
- package/api/types/ProviderTimelineData.ts +23 -0
- package/api/types/ProviderTimelineResponse.ts +12 -0
- package/api/types/ProviderTopService.ts +13 -0
- package/api/types/ProvidersSummaryData.ts +10 -0
- package/api/types/ProvidersSummaryResponse.ts +12 -0
- package/api/types/RecommendationActions.ts +28 -0
- package/api/types/RecommendationDetail.ts +22 -0
- package/api/types/RecommendationDetailResponse.ts +12 -0
- package/api/types/RecommendationFilterOptionsData.ts +15 -0
- package/api/types/RecommendationFilterOptionsResponse.ts +12 -0
- package/api/types/RecommendationItem.ts +19 -0
- package/api/types/RecommendationWizardData.ts +83 -0
- package/api/types/RecommendationWizardResponse.ts +12 -0
- package/api/types/RecommendationsBreakdownData.ts +11 -0
- package/api/types/RecommendationsBreakdownResponse.ts +12 -0
- package/api/types/RecommendationsOverviewData.ts +19 -0
- package/api/types/RecommendationsOverviewResponse.ts +12 -0
- package/api/types/RegisterEndpointResponse.ts +9 -0
- package/api/types/ResourceChange.ts +14 -0
- package/api/types/ResourceSnapshot.ts +7 -0
- package/api/types/RevokeApiKeyData.ts +6 -0
- package/api/types/RevokeApiKeyResponse.ts +9 -0
- package/api/types/RiskAssessment.ts +11 -0
- package/api/types/RiskFactor.ts +8 -0
- package/api/types/SavedBreakdownData.ts +13 -0
- package/api/types/SavedBreakdownResponse.ts +12 -0
- package/api/types/SavedByProviderBreakdownData.ts +13 -0
- package/api/types/SavedByProviderBreakdownResponse.ts +12 -0
- package/api/types/SavedByProviderItem.ts +29 -0
- package/api/types/SavedItem.ts +20 -0
- package/api/types/SavedProviderSummary.ts +13 -0
- package/api/types/SavedSummaryData.ts +23 -0
- package/api/types/SavedSummaryResponse.ts +12 -0
- package/api/types/SavingsDecisionData.ts +13 -0
- package/api/types/SavingsDecisionResponse.ts +12 -0
- package/api/types/SpendingByDateItem.ts +13 -0
- package/api/types/TopRecommendation.ts +21 -0
- package/api/types/TriggerInfo.ts +8 -0
- package/api/types/UpdateTagData.ts +6 -0
- package/api/types/UpdateTagResponse.ts +9 -0
- package/api/types/ValidationError.ts +17 -0
- package/api/types/index.ts +115 -0
- package/core/exports.ts +1 -0
- package/core/fetcher/APIResponse.ts +23 -0
- package/core/fetcher/BinaryResponse.ts +34 -0
- package/core/fetcher/EndpointMetadata.ts +13 -0
- package/core/fetcher/EndpointSupplier.ts +14 -0
- package/core/fetcher/Fetcher.ts +398 -0
- package/core/fetcher/Headers.ts +93 -0
- package/core/fetcher/HttpResponsePromise.ts +116 -0
- package/core/fetcher/RawResponse.ts +61 -0
- package/core/fetcher/Supplier.ts +11 -0
- package/core/fetcher/createRequestUrl.ts +6 -0
- package/core/fetcher/getErrorResponseBody.ts +33 -0
- package/core/fetcher/getFetchFn.ts +3 -0
- package/core/fetcher/getHeader.ts +8 -0
- package/core/fetcher/getRequestBody.ts +20 -0
- package/core/fetcher/getResponseBody.ts +58 -0
- package/core/fetcher/index.ts +11 -0
- package/core/fetcher/makeRequest.ts +70 -0
- package/core/fetcher/requestWithRetries.ts +64 -0
- package/core/fetcher/signals.ts +26 -0
- package/core/headers.ts +33 -0
- package/core/index.ts +4 -0
- package/core/json.ts +27 -0
- package/core/logging/exports.ts +19 -0
- package/core/logging/index.ts +1 -0
- package/core/logging/logger.ts +203 -0
- package/core/runtime/index.ts +1 -0
- package/core/runtime/runtime.ts +134 -0
- package/core/url/encodePathParam.ts +18 -0
- package/core/url/index.ts +3 -0
- package/core/url/join.ts +79 -0
- package/core/url/qs.ts +74 -0
- package/errors/LevelFourError.ts +58 -0
- package/errors/LevelFourTimeoutError.ts +13 -0
- package/errors/handleNonStatusCodeError.ts +37 -0
- package/errors/index.ts +2 -0
- package/errors.ts +100 -0
- package/exports.ts +1 -0
- package/index.ts +22 -0
- package/jest.config.js +17 -0
- package/package.json +35 -0
- package/pagination.ts +54 -0
- package/telemetry.ts +64 -0
- package/tests/auth.test.ts +64 -0
- package/tests/errors.test.ts +92 -0
- package/tests/pagination.test.ts +72 -0
- package/tests/telemetry.test.ts +110 -0
- package/tsconfig.json +22 -0
- package/webhooks.ts +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface AcceptTermsApiV1RecommendationsRecommendationIdAcceptTermsPostRequest {
|
|
10
|
+
recommendation_id: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface CompleteWizardApiV1RecommendationsRecommendationIdCompletePostRequest {
|
|
10
|
+
recommendation_id: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface GetRecommendationDetailsApiV1RecommendationsRecommendationIdDetailsGetRequest {
|
|
10
|
+
recommendation_id: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface GetRecommendationForWizardApiV1RecommendationsRecommendationIdGetRequest {
|
|
10
|
+
recommendation_id: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {}
|
|
6
|
+
*/
|
|
7
|
+
export interface GetRecommendationsApiV1RecommendationsGetRequest {
|
|
8
|
+
/** Page number (1-indexed) */
|
|
9
|
+
page?: number;
|
|
10
|
+
/** Items per page (max 100) */
|
|
11
|
+
page_size?: number;
|
|
12
|
+
/** Field to sort by (recommendation_id, service, environment, monthly_savings, annual_savings, savings_percentage, analysis_period, created_at) */
|
|
13
|
+
sort_by?: string;
|
|
14
|
+
/** Sort order (asc or desc) */
|
|
15
|
+
sort_order?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id",
|
|
7
|
+
* method: "method"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ImplementationMethodRequest {
|
|
11
|
+
recommendation_id: string;
|
|
12
|
+
/** Implementation method: 'one-click', 'iac', 'one-click-plus-iac', 'manual' */
|
|
13
|
+
method: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id",
|
|
7
|
+
* decision: "decision"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface SavingsDecisionRequest {
|
|
11
|
+
recommendation_id: string;
|
|
12
|
+
/** Decision: 'accepted' or 'rejected' */
|
|
13
|
+
decision: string;
|
|
14
|
+
/** Rejection reason: operational, strategy, not_applicable, other (required if rejected) */
|
|
15
|
+
reason?: string | null;
|
|
16
|
+
/** Free text explanation (optional, used when reason is 'other') */
|
|
17
|
+
explanation?: string | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UpdateTagRequest {
|
|
10
|
+
recommendation_id: string;
|
|
11
|
+
/** New tag value. Send null to clear. */
|
|
12
|
+
tag?: string | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { AcceptTermsApiV1RecommendationsRecommendationIdAcceptTermsPostRequest } from "./AcceptTermsApiV1RecommendationsRecommendationIdAcceptTermsPostRequest.js";
|
|
2
|
+
export type { CompleteWizardApiV1RecommendationsRecommendationIdCompletePostRequest } from "./CompleteWizardApiV1RecommendationsRecommendationIdCompletePostRequest.js";
|
|
3
|
+
export type { GetRecommendationDetailsApiV1RecommendationsRecommendationIdDetailsGetRequest } from "./GetRecommendationDetailsApiV1RecommendationsRecommendationIdDetailsGetRequest.js";
|
|
4
|
+
export type { GetRecommendationForWizardApiV1RecommendationsRecommendationIdGetRequest } from "./GetRecommendationForWizardApiV1RecommendationsRecommendationIdGetRequest.js";
|
|
5
|
+
export type { GetRecommendationsApiV1RecommendationsGetRequest } from "./GetRecommendationsApiV1RecommendationsGetRequest.js";
|
|
6
|
+
export type { ImplementationMethodRequest } from "./ImplementationMethodRequest.js";
|
|
7
|
+
export type { SavingsDecisionRequest } from "./SavingsDecisionRequest.js";
|
|
8
|
+
export type { UpdateTagRequest } from "./UpdateTagRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,231 @@
|
|
|
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 } from "../../../../core/headers.js";
|
|
6
|
+
import * as core from "../../../../core/index.js";
|
|
7
|
+
import { toJson } from "../../../../core/json.js";
|
|
8
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
|
|
9
|
+
import * as errors from "../../../../errors/index.js";
|
|
10
|
+
import * as LevelFour from "../../../index.js";
|
|
11
|
+
|
|
12
|
+
export declare namespace SavingsClient {
|
|
13
|
+
export type Options = BaseClientOptions;
|
|
14
|
+
|
|
15
|
+
export interface RequestOptions extends BaseRequestOptions {}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class SavingsClient {
|
|
19
|
+
protected readonly _options: NormalizedClientOptions<SavingsClient.Options>;
|
|
20
|
+
|
|
21
|
+
constructor(options: SavingsClient.Options) {
|
|
22
|
+
this._options = normalizeClientOptions(options);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Returns enhanced BigNumbers data for the Savings Audit page
|
|
27
|
+
*
|
|
28
|
+
* @param {SavingsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.savings.getSavedSummary()
|
|
32
|
+
*/
|
|
33
|
+
public getSavedSummary(
|
|
34
|
+
requestOptions?: SavingsClient.RequestOptions,
|
|
35
|
+
): core.HttpResponsePromise<LevelFour.SavedSummaryResponse> {
|
|
36
|
+
return core.HttpResponsePromise.fromPromise(this.__getSavedSummary(requestOptions));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private async __getSavedSummary(
|
|
40
|
+
requestOptions?: SavingsClient.RequestOptions,
|
|
41
|
+
): Promise<core.WithRawResponse<LevelFour.SavedSummaryResponse>> {
|
|
42
|
+
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
43
|
+
const _response = await core.fetcher({
|
|
44
|
+
url: core.url.join(
|
|
45
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
46
|
+
(await core.Supplier.get(this._options.environment)),
|
|
47
|
+
"api/v1/savings/summary",
|
|
48
|
+
),
|
|
49
|
+
method: "GET",
|
|
50
|
+
headers: _headers,
|
|
51
|
+
queryParameters: requestOptions?.queryParams,
|
|
52
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
53
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
54
|
+
abortSignal: requestOptions?.abortSignal,
|
|
55
|
+
fetchFn: this._options?.fetch,
|
|
56
|
+
logging: this._options.logging,
|
|
57
|
+
});
|
|
58
|
+
if (_response.ok) {
|
|
59
|
+
return { data: _response.body as LevelFour.SavedSummaryResponse, rawResponse: _response.rawResponse };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (_response.error.reason === "status-code") {
|
|
63
|
+
throw new errors.LevelFourError({
|
|
64
|
+
statusCode: _response.error.statusCode,
|
|
65
|
+
body: _response.error.body,
|
|
66
|
+
rawResponse: _response.rawResponse,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/savings/summary");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns paginated list of all implemented savings with filtering
|
|
75
|
+
*
|
|
76
|
+
* @param {LevelFour.GetSavedBreakdownApiV1SavingsBreakdownGetRequest} request
|
|
77
|
+
* @param {SavingsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.savings.getSavedBreakdown()
|
|
83
|
+
*/
|
|
84
|
+
public getSavedBreakdown(
|
|
85
|
+
request: LevelFour.GetSavedBreakdownApiV1SavingsBreakdownGetRequest = {},
|
|
86
|
+
requestOptions?: SavingsClient.RequestOptions,
|
|
87
|
+
): core.HttpResponsePromise<LevelFour.SavedBreakdownResponse> {
|
|
88
|
+
return core.HttpResponsePromise.fromPromise(this.__getSavedBreakdown(request, requestOptions));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private async __getSavedBreakdown(
|
|
92
|
+
request: LevelFour.GetSavedBreakdownApiV1SavingsBreakdownGetRequest = {},
|
|
93
|
+
requestOptions?: SavingsClient.RequestOptions,
|
|
94
|
+
): Promise<core.WithRawResponse<LevelFour.SavedBreakdownResponse>> {
|
|
95
|
+
const {
|
|
96
|
+
page,
|
|
97
|
+
page_size: pageSize,
|
|
98
|
+
sort_by: sortBy,
|
|
99
|
+
sort_order: sortOrder,
|
|
100
|
+
start,
|
|
101
|
+
end,
|
|
102
|
+
preset,
|
|
103
|
+
provider,
|
|
104
|
+
service,
|
|
105
|
+
environment,
|
|
106
|
+
account_id: accountId,
|
|
107
|
+
} = request;
|
|
108
|
+
const _queryParams: Record<string, unknown> = {
|
|
109
|
+
page,
|
|
110
|
+
page_size: pageSize,
|
|
111
|
+
sort_by: sortBy,
|
|
112
|
+
sort_order: sortOrder,
|
|
113
|
+
start,
|
|
114
|
+
end,
|
|
115
|
+
preset,
|
|
116
|
+
provider,
|
|
117
|
+
service: service !== undefined ? toJson(service) : undefined,
|
|
118
|
+
environment: environment !== undefined ? toJson(environment) : undefined,
|
|
119
|
+
account_id: accountId !== undefined ? toJson(accountId) : undefined,
|
|
120
|
+
};
|
|
121
|
+
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
122
|
+
const _response = await core.fetcher({
|
|
123
|
+
url: core.url.join(
|
|
124
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
125
|
+
(await core.Supplier.get(this._options.environment)),
|
|
126
|
+
"api/v1/savings/breakdown",
|
|
127
|
+
),
|
|
128
|
+
method: "GET",
|
|
129
|
+
headers: _headers,
|
|
130
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
131
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
132
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
133
|
+
abortSignal: requestOptions?.abortSignal,
|
|
134
|
+
fetchFn: this._options?.fetch,
|
|
135
|
+
logging: this._options.logging,
|
|
136
|
+
});
|
|
137
|
+
if (_response.ok) {
|
|
138
|
+
return { data: _response.body as LevelFour.SavedBreakdownResponse, rawResponse: _response.rawResponse };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (_response.error.reason === "status-code") {
|
|
142
|
+
switch (_response.error.statusCode) {
|
|
143
|
+
case 422:
|
|
144
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
145
|
+
_response.error.body as LevelFour.HttpValidationError,
|
|
146
|
+
_response.rawResponse,
|
|
147
|
+
);
|
|
148
|
+
default:
|
|
149
|
+
throw new errors.LevelFourError({
|
|
150
|
+
statusCode: _response.error.statusCode,
|
|
151
|
+
body: _response.error.body,
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/v1/savings/breakdown");
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Triggers execution of a savings recommendation by updating its status to processing
|
|
162
|
+
*
|
|
163
|
+
* @param {LevelFour.ExecutionRequestBody} request
|
|
164
|
+
* @param {SavingsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
165
|
+
*
|
|
166
|
+
* @throws {@link LevelFour.UnprocessableEntityError}
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* await client.savings.createExecutionRequest({
|
|
170
|
+
* recommendation_id: "recommendation_id",
|
|
171
|
+
* implementation_method: "implementation_method"
|
|
172
|
+
* })
|
|
173
|
+
*/
|
|
174
|
+
public createExecutionRequest(
|
|
175
|
+
request: LevelFour.ExecutionRequestBody,
|
|
176
|
+
requestOptions?: SavingsClient.RequestOptions,
|
|
177
|
+
): core.HttpResponsePromise<unknown> {
|
|
178
|
+
return core.HttpResponsePromise.fromPromise(this.__createExecutionRequest(request, requestOptions));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
private async __createExecutionRequest(
|
|
182
|
+
request: LevelFour.ExecutionRequestBody,
|
|
183
|
+
requestOptions?: SavingsClient.RequestOptions,
|
|
184
|
+
): Promise<core.WithRawResponse<unknown>> {
|
|
185
|
+
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
186
|
+
const _response = await core.fetcher({
|
|
187
|
+
url: core.url.join(
|
|
188
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
189
|
+
(await core.Supplier.get(this._options.environment)),
|
|
190
|
+
"api/v1/savings/execution-requests",
|
|
191
|
+
),
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers: _headers,
|
|
194
|
+
contentType: "application/json",
|
|
195
|
+
queryParameters: requestOptions?.queryParams,
|
|
196
|
+
requestType: "json",
|
|
197
|
+
body: request,
|
|
198
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
199
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
200
|
+
abortSignal: requestOptions?.abortSignal,
|
|
201
|
+
fetchFn: this._options?.fetch,
|
|
202
|
+
logging: this._options.logging,
|
|
203
|
+
});
|
|
204
|
+
if (_response.ok) {
|
|
205
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (_response.error.reason === "status-code") {
|
|
209
|
+
switch (_response.error.statusCode) {
|
|
210
|
+
case 422:
|
|
211
|
+
throw new LevelFour.UnprocessableEntityError(
|
|
212
|
+
_response.error.body as LevelFour.HttpValidationError,
|
|
213
|
+
_response.rawResponse,
|
|
214
|
+
);
|
|
215
|
+
default:
|
|
216
|
+
throw new errors.LevelFourError({
|
|
217
|
+
statusCode: _response.error.statusCode,
|
|
218
|
+
body: _response.error.body,
|
|
219
|
+
rawResponse: _response.rawResponse,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return handleNonStatusCodeError(
|
|
225
|
+
_response.error,
|
|
226
|
+
_response.rawResponse,
|
|
227
|
+
"POST",
|
|
228
|
+
"/api/v1/savings/execution-requests",
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {
|
|
6
|
+
* recommendation_id: "recommendation_id",
|
|
7
|
+
* implementation_method: "implementation_method"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ExecutionRequestBody {
|
|
11
|
+
/** Recommendation ID to execute */
|
|
12
|
+
recommendation_id: string;
|
|
13
|
+
/** Implementation method: 'one-click', 'iac', or 'one-click-plus-iac' */
|
|
14
|
+
implementation_method: string;
|
|
15
|
+
}
|
package/api/resources/savings/client/requests/GetSavedBreakdownApiV1SavingsBreakdownGetRequest.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* {}
|
|
6
|
+
*/
|
|
7
|
+
export interface GetSavedBreakdownApiV1SavingsBreakdownGetRequest {
|
|
8
|
+
/** Page number (1-indexed) */
|
|
9
|
+
page?: number;
|
|
10
|
+
/** Items per page (max 100) */
|
|
11
|
+
page_size?: number;
|
|
12
|
+
/** Field to sort by (period, account_id, environment, service, usage_type, usage_quantity, usage_unit, pre_optimization_cost, post_optimization_cost, monthly_savings, roi, approved_by) */
|
|
13
|
+
sort_by?: string;
|
|
14
|
+
/** Sort order (asc or desc) */
|
|
15
|
+
sort_order?: string;
|
|
16
|
+
/** Start date filter (YYYY-MM-DD or YYYY-MM format) */
|
|
17
|
+
start?: string | null;
|
|
18
|
+
/** End date filter (YYYY-MM-DD or YYYY-MM format) */
|
|
19
|
+
end?: string | null;
|
|
20
|
+
/** Date preset: '30D', '6M', or '12M' (takes precedence over start/end) */
|
|
21
|
+
preset?: string | null;
|
|
22
|
+
/** Filter by provider ID (aws, gcp, azure, k8s) */
|
|
23
|
+
provider?: string | null;
|
|
24
|
+
/** Filter by service(s) - can be repeated for multiple values */
|
|
25
|
+
service?: string[] | null;
|
|
26
|
+
/** Filter by environment(s) - can be repeated for multiple values */
|
|
27
|
+
environment?: string[] | null;
|
|
28
|
+
/** Filter by account ID(s) - can be repeated for multiple values */
|
|
29
|
+
account_id?: string[] | null;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|