@stack-spot/portal-network 0.178.1-beta.1 → 0.179.0-beta.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.
- package/CHANGELOG.md +78 -0
- package/dist/api/agent-tools.d.ts +6 -14
- package/dist/api/agent-tools.d.ts.map +1 -1
- package/dist/api/agent-tools.js +7 -3
- package/dist/api/agent-tools.js.map +1 -1
- package/dist/api/codeShift.d.ts +47 -3
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +13 -0
- package/dist/api/codeShift.js.map +1 -1
- package/dist/apis-itau.json +58 -58
- package/dist/client/agent-tools.d.ts +5 -1
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +2 -2
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/api-management.d.ts +9 -0
- package/dist/client/api-management.d.ts.map +1 -1
- package/dist/client/api-management.js +11 -2
- package/dist/client/api-management.js.map +1 -1
- package/dist/client/code-shift.d.ts +8 -0
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +10 -1
- package/dist/client/code-shift.js.map +1 -1
- package/dist/error/DefaultAPIError.d.ts.map +1 -1
- package/dist/error/DefaultAPIError.js.map +1 -1
- package/dist/error/StackspotAPIError.d.ts +3 -4
- package/dist/error/StackspotAPIError.d.ts.map +1 -1
- package/dist/error/StackspotAPIError.js +3 -3
- package/dist/error/StackspotAPIError.js.map +1 -1
- package/dist/error/dictionary/cloud-platform.js +1 -1
- package/dist/error/dictionary/cloud-platform.js.map +1 -1
- package/package.json +2 -2
- package/src/api/agent-tools.ts +12 -16
- package/src/api/codeShift.ts +93 -20
- package/src/apis-itau.json +59 -59
- package/src/client/agent-tools.ts +2 -2
- package/src/client/api-management.ts +7 -2
- package/src/client/code-shift.ts +7 -0
- package/src/error/DefaultAPIError.ts +5 -5
- package/src/error/StackspotAPIError.ts +4 -4
- package/src/error/dictionary/cloud-platform.ts +1 -1
package/src/api/agent-tools.ts
CHANGED
|
@@ -336,18 +336,6 @@ export type AgentToolExecutionResponse = {
|
|
|
336
336
|
result: string;
|
|
337
337
|
};
|
|
338
338
|
export type AgentVisibilityLevelEnum = "built_in" | "recently_used";
|
|
339
|
-
export type ListAgentRequest = {
|
|
340
|
-
/** Agent name to filter the list */
|
|
341
|
-
name?: string | null;
|
|
342
|
-
/** Agent slug to filter the list */
|
|
343
|
-
slug?: string | null;
|
|
344
|
-
/** Agent visibility to filter the list */
|
|
345
|
-
visibility?: AgentVisibilityLevelEnum | VisibilityLevelEnum;
|
|
346
|
-
/** Paginated param to configure page size */
|
|
347
|
-
size?: number;
|
|
348
|
-
/** Paginated param to configure which page is being requested */
|
|
349
|
-
page?: number;
|
|
350
|
-
};
|
|
351
339
|
export type KnowledgeSourcesConfig = {
|
|
352
340
|
knowledge_sources: string[];
|
|
353
341
|
max_number_of_kos?: number;
|
|
@@ -1356,9 +1344,13 @@ export function executeToolV1AgentsToolsAgentToolIdExecutePost({ agentToolId, is
|
|
|
1356
1344
|
/**
|
|
1357
1345
|
* List Agents
|
|
1358
1346
|
*/
|
|
1359
|
-
export function listAgentsV1AgentsGet({
|
|
1360
|
-
request: ListAgentRequest;
|
|
1347
|
+
export function listAgentsV1AgentsGet({ isPublic, name, slug, visibility, size, page, xAccountId, xUsername, xUserId, xUserFullName, authorization }: {
|
|
1361
1348
|
isPublic?: boolean;
|
|
1349
|
+
name?: string | null;
|
|
1350
|
+
slug?: string | null;
|
|
1351
|
+
visibility?: AgentVisibilityLevelEnum | VisibilityLevelEnum;
|
|
1352
|
+
size?: number;
|
|
1353
|
+
page?: number;
|
|
1362
1354
|
xAccountId?: string | null;
|
|
1363
1355
|
xUsername?: string | null;
|
|
1364
1356
|
xUserId?: string | null;
|
|
@@ -1374,8 +1366,12 @@ export function listAgentsV1AgentsGet({ request, isPublic, xAccountId, xUsername
|
|
|
1374
1366
|
status: 422;
|
|
1375
1367
|
data: HttpValidationError;
|
|
1376
1368
|
}>(`/v1/agents${QS.query(QS.explode({
|
|
1377
|
-
|
|
1378
|
-
|
|
1369
|
+
is_public: isPublic,
|
|
1370
|
+
name,
|
|
1371
|
+
slug,
|
|
1372
|
+
visibility,
|
|
1373
|
+
size,
|
|
1374
|
+
page
|
|
1379
1375
|
}))}`, {
|
|
1380
1376
|
...opts,
|
|
1381
1377
|
headers: oazapfts.mergeHeaders(opts?.headers, {
|
package/src/api/codeShift.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
5
|
* See https://www.npmjs.com/package/oazapfts
|
|
6
6
|
*/
|
|
7
|
-
import * as Oazapfts from "@oazapfts/runtime"
|
|
8
|
-
import * as QS from "@oazapfts/runtime/query"
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime"
|
|
8
|
+
import * as QS from "@oazapfts/runtime/query"
|
|
9
9
|
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
10
|
headers: {},
|
|
11
11
|
baseUrl: "/",
|
|
@@ -60,7 +60,7 @@ export type CreateModuleRequest = {
|
|
|
60
60
|
} | null;
|
|
61
61
|
gitAction?: GitAction | null;
|
|
62
62
|
};
|
|
63
|
-
export type ExceptionType = "CODE_SHIFT_API_0000_UNEXPECTED_ERROR" | "CODE_SHIFT_API_0001_INVALID_VALUE" | "CODE_SHIFT_API_0002_NOT_IMPLEMENTED" | "CODE_SHIFT_API_0003_NOT_FOUND" | "CODE_SHIFT_API_0004_VALIDATION_ERROR" | "CODE_SHIFT_API_0005_CONFLICT" | "CODE_SHIFT_API_0006_INVALID_REPO_URL" | "CODE_SHIFT_API_0007_FORBIDDEN" | "CODE_SHIFT_API_0008_DEFAULT_BRANCH" | "CODE_SHIFT_API_0009_INVALID_SPREADSHEET" | "CODE_SHIFT_API_0010_PR_LINK_NOT_EXISTS" | "CODE_SHIFT_API_0011_EMPTY_SPREADSHEET" | "CODE_SHIFT_API_0012_REPOSITORY_NOT_EXISTS_IN_SCM" | "CODE_SHIFT_API_0013_SCM_BRANCH_NOT_EXISTS_EXCEPTION" | "CODE_SHIFT_API_0014_ACCOUNT_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0015_INVALID_WORKFLOW_URL_EXCEPTION" | "CODE_SHIFT_API_0016_INVALID_ACTION_YAML_EXCEPTION" | "CODE_SHIFT_API_0017_FAIL_READING_ACTION_INPUTS_EXCEPTION" | "CODE_SHIFT_API_0018_MODULE_DISPATCHER_GENERIC_EXCEPTION" | "CODE_SHIFT_API_0019_GITHUB_DISPATCH_WORKFLOW_UNAUTHORIZED_EXCEPTION" | "CODE_SHIFT_API_0020_GITHUB_SAML_EXCEPTION" | "CODE_SHIFT_API_0021_GITHUB_AUTHORIZATION_ENCODING_EXCEPTION" | "CODE_SHIFT_API_0022_GITHUB_DISPATCH_WORKFLOW_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0023_GENERIC_FAILURE_SEARCHING_REPOSITORY_EXCEPTION" | "CODE_SHIFT_API_0024_COMPONENTS_MAX_SIZE_ALLOWED_EXCEPTION" | "CODE_SHIFT_API_0025_INVALID_SEARCH_REPOSITORY_STATUS_SAVE_EXCEPTION" | "CODE_SHIFT_API_0026_SEARCH_REPO_EMPTY_RESULT_EXCEPTION" | "CODE_SHIFT_API_3000_WORKFLOW_API_DISPATCH_FAILURE" | "CODE_SHIFT_API_3001_WORKFLOW_API_DISPATCH_FORBIDDEN" | "CODE_SHIFT_API_3009_WORKFLOW_API_DISPATCH_PARSE_ERROR" | "CODE_SHIFT_API_3010_AWS_SECRET_MANAGER_GET_SECRET_FAILURE" | "CODE_SHIFT_API_3011_AWS_SECRET_MANAGER_PARSE_SECRET_ERROR" | "CODE_SHIFT_API_3100_SCM_GET_REPOSITORIES_FAILURE" | "CODE_SHIFT_API_3110_SCM_GET_PULL_REQUEST_FAILURE" | "CODE_SHIFT_API_3120_SCM_GET_BRANCHES_FAILURE" | "CODE_SHIFT_API_3130_SCM_GET_SCM_REPOSITORY_FETCH_FAILURE" | "CODE_SHIFT_API_3131_SCM_REPOSITORY_NOT_FOUND" | "CODE_SHIFT_API_3140_SCM_GET_BRANCH_FAILURE" | "CODE_SHIFT_API_3142_SCM_GET_BRANCHES_NOT_FOUND" | "CODE_SHIFT_API_3150_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3151_SCM_GET_REPOSITORY_FILE_NOT_FOUND" | "CODE_SHIFT_API_3160_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3500_CONTENT_API_GET_WORKFLOW_VERSION_FAILURE" | "CODE_SHIFT_API_4000_ACCOUNTS_API_PAT_FAILURE" | "CODE_SHIFT_API_4001_ACCOUNTS_API_PAT_FORBIDDEN" | "CODE_SHIFT_API_4002_ACCOUNTS_API_PAT_NOT_FOUND" | "CODE_SHIFT_API_4009_ACCOUNTS_API_PAT_PARSE_ERROR" | "CODE_SHIFT_API_4010_GET_SCM_CREDENTIALS_FAILURE" | "CODE_SHIFT_API_4011_GET_SCM_CREDENTIALS_FORBIDDEN" | "CODE_SHIFT_API_4012_GET_SCM_CREDENTIALS_NOT_FOUND" | "CODE_SHIFT_API_4019_GET_SCM_CREDENTIALS_PARSE_ERROR" | "CODE_SHIFT_API_6000_IAM_GENERATE_TOKEN_FAILURE" | "CODE_SHIFT_API_6000_IAM_INTROSPECT_TOKEN_FAILURE"
|
|
63
|
+
export type ExceptionType = "CODE_SHIFT_API_0000_UNEXPECTED_ERROR" | "CODE_SHIFT_API_0001_INVALID_VALUE" | "CODE_SHIFT_API_0002_NOT_IMPLEMENTED" | "CODE_SHIFT_API_0003_NOT_FOUND" | "CODE_SHIFT_API_0004_VALIDATION_ERROR" | "CODE_SHIFT_API_0005_CONFLICT" | "CODE_SHIFT_API_0006_INVALID_REPO_URL" | "CODE_SHIFT_API_0007_FORBIDDEN" | "CODE_SHIFT_API_0008_DEFAULT_BRANCH" | "CODE_SHIFT_API_0009_INVALID_SPREADSHEET" | "CODE_SHIFT_API_0010_PR_LINK_NOT_EXISTS" | "CODE_SHIFT_API_0011_EMPTY_SPREADSHEET" | "CODE_SHIFT_API_0012_REPOSITORY_NOT_EXISTS_IN_SCM" | "CODE_SHIFT_API_0013_SCM_BRANCH_NOT_EXISTS_EXCEPTION" | "CODE_SHIFT_API_0014_ACCOUNT_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0015_INVALID_WORKFLOW_URL_EXCEPTION" | "CODE_SHIFT_API_0016_INVALID_ACTION_YAML_EXCEPTION" | "CODE_SHIFT_API_0017_FAIL_READING_ACTION_INPUTS_EXCEPTION" | "CODE_SHIFT_API_0018_MODULE_DISPATCHER_GENERIC_EXCEPTION" | "CODE_SHIFT_API_0019_GITHUB_DISPATCH_WORKFLOW_UNAUTHORIZED_EXCEPTION" | "CODE_SHIFT_API_0020_GITHUB_SAML_EXCEPTION" | "CODE_SHIFT_API_0021_GITHUB_AUTHORIZATION_ENCODING_EXCEPTION" | "CODE_SHIFT_API_0022_GITHUB_DISPATCH_WORKFLOW_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0023_GENERIC_FAILURE_SEARCHING_REPOSITORY_EXCEPTION" | "CODE_SHIFT_API_0024_COMPONENTS_MAX_SIZE_ALLOWED_EXCEPTION" | "CODE_SHIFT_API_0025_INVALID_SEARCH_REPOSITORY_STATUS_SAVE_EXCEPTION" | "CODE_SHIFT_API_0026_SEARCH_REPO_EMPTY_RESULT_EXCEPTION" | "CODE_SHIFT_API_0027_SCORE_OUT_OF_RANGE_EXCEPTION" | "CODE_SHIFT_API_3000_WORKFLOW_API_DISPATCH_FAILURE" | "CODE_SHIFT_API_3001_WORKFLOW_API_DISPATCH_FORBIDDEN" | "CODE_SHIFT_API_3009_WORKFLOW_API_DISPATCH_PARSE_ERROR" | "CODE_SHIFT_API_3010_AWS_SECRET_MANAGER_GET_SECRET_FAILURE" | "CODE_SHIFT_API_3011_AWS_SECRET_MANAGER_PARSE_SECRET_ERROR" | "CODE_SHIFT_API_3100_SCM_GET_REPOSITORIES_FAILURE" | "CODE_SHIFT_API_3110_SCM_GET_PULL_REQUEST_FAILURE" | "CODE_SHIFT_API_3120_SCM_GET_BRANCHES_FAILURE" | "CODE_SHIFT_API_3130_SCM_GET_SCM_REPOSITORY_FETCH_FAILURE" | "CODE_SHIFT_API_3131_SCM_REPOSITORY_NOT_FOUND" | "CODE_SHIFT_API_3140_SCM_GET_BRANCH_FAILURE" | "CODE_SHIFT_API_3142_SCM_GET_BRANCHES_NOT_FOUND" | "CODE_SHIFT_API_3150_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3151_SCM_GET_REPOSITORY_FILE_NOT_FOUND" | "CODE_SHIFT_API_3160_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3500_CONTENT_API_GET_WORKFLOW_VERSION_FAILURE" | "CODE_SHIFT_API_4000_ACCOUNTS_API_PAT_FAILURE" | "CODE_SHIFT_API_4001_ACCOUNTS_API_PAT_FORBIDDEN" | "CODE_SHIFT_API_4002_ACCOUNTS_API_PAT_NOT_FOUND" | "CODE_SHIFT_API_4009_ACCOUNTS_API_PAT_PARSE_ERROR" | "CODE_SHIFT_API_4010_GET_SCM_CREDENTIALS_FAILURE" | "CODE_SHIFT_API_4011_GET_SCM_CREDENTIALS_FORBIDDEN" | "CODE_SHIFT_API_4012_GET_SCM_CREDENTIALS_NOT_FOUND" | "CODE_SHIFT_API_4019_GET_SCM_CREDENTIALS_PARSE_ERROR" | "CODE_SHIFT_API_6000_IAM_GENERATE_TOKEN_FAILURE" | "CODE_SHIFT_API_6000_IAM_INTROSPECT_TOKEN_FAILURE"
|
|
64
64
|
export type BadRequestExceptionTypes = "CODE_SHIFT_API_1001_DECODE_JWT_ERROR" | "CODE_SHIFT_API_2001_BAD_REQUEST_REQUIRED_FIELD" | "CODE_SHIFT_API_2002_BAD_REQUEST_EMPTY_FIELD_NOT_ALLOWED" | "CODE_SHIFT_API_2003_BAD_REQUEST_TYPE_FIELD_NOT_ALLOWED" | "CODE_SHIFT_API_2004_BAD_REQUEST_VALUE_FIELD_NOT_ALLOWED" | "CODE_SHIFT_API_2005_BAD_REQUEST_VALUE_FIELD_MAX_LENGTH" | "CODE_SHIFT_API_2006_BAD_REQUEST_VALUE_FIELD_MIN_LENGTH" | "CODE_SHIFT_API_2007_BAD_REQUEST_VALUE_REGEX_DOESNT_MATCH" | "CODE_SHIFT_API_2008_BAD_REQUEST_VALUE_FIELD_NUMBER_NOT_LT" | "CODE_SHIFT_API_2100_CREATE_BODY_REPO_AND_REPO_CREATE_ACTION" | "CODE_SHIFT_API_2101_CREATE_BODY_NOT_REPO_AND_NOT_REPO_CREATE_ACTION" | "CODE_SHIFT_API_2102_BAD_REQUEST_DATE_MAX_INTERVAL" | "CODE_SHIFT_API_2103_BAD_REQUEST_INVALID_PAGE" | "CODE_SHIFT_API_2104_BAD_REQUEST_DUPLICATED_ALIAS" | "CODE_SHIFT_API_2105_BAD_REQUEST_INVALID_REPO_URL" | "CODE_SHIFT_API_2110_BAD_REQUEST_PUT_STEP_STATUS_COMPLETED_WITHOUT_CONCLUSION" | "CODE_SHIFT_API_2112_BAD_REQUEST_PUT_STEP_STATUS_NOT_COMPLETED_AND_CONCLUSION_DEFINED" | "CODE_SHIFT_API_2113_BAD_REQUEST_PUT_STEP_STATUS_COMPLETED_AND_COMPLETED_AT_NOT_DEFINED" | "CODE_SHIFT_API_2114_BAD_REQUEST_PUT_STEP_STATUS_IN_PROGRESS_AND_STARTED_AT_NOT_DEFINED" | "CODE_SHIFT_API_2115_BAD_REQUEST_PUT_STEP_COMPLETED_AT_DEFINED_AND_STATUS_NOT_COMPLETED" | "CODE_SHIFT_API_2116_BAD_REQUEST_PUT_STEP_STARTED_AT_DEFINED_AND_STATUS_PENDING" | "CODE_SHIFT_API_2117_BAD_REQUEST_PUT_STEP_LOG_DEFINED_AND_CONCLUSION_IS_NOT_FAILURE" | "CODE_SHIFT_API_2120_BAD_REQUEST_MULTIPLE_INTEGRATION" | "CODE_SHIFT_API_2121_BAD_REQUEST_EMPTY_INTEGRATION" | "CODE_SHIFT_API_2121_BAD_REQUEST_EMPTY_TARGET" | "CODE_SHIFT_API_2121_BAD_REQUEST_FILLED_TARGET" | "CODE_SHIFT_API_2999_BAD_REQUEST_UNMAPPED";
|
|
65
65
|
export type InvalidPayloadDetails = {
|
|
66
66
|
code: BadRequestExceptionTypes | ExceptionType;
|
|
@@ -392,10 +392,16 @@ export type GetReportResponseRead = {
|
|
|
392
392
|
inputs?: {
|
|
393
393
|
[key: string]: any;
|
|
394
394
|
} | null;
|
|
395
|
+
customerScore?: number | null
|
|
396
|
+
customerCommentary?: string | null
|
|
395
397
|
};
|
|
396
398
|
export type GetPullRequest = {
|
|
397
399
|
content: string;
|
|
398
400
|
};
|
|
401
|
+
export type PutCustomerRatingReportRequest = {
|
|
402
|
+
score: number
|
|
403
|
+
commentary?: string | null
|
|
404
|
+
}
|
|
399
405
|
export type SearchRepoScmResponse = {
|
|
400
406
|
id: string;
|
|
401
407
|
};
|
|
@@ -797,6 +803,8 @@ export type RepositoryLastReportStatusResponse = {
|
|
|
797
803
|
totalIssues: number | null;
|
|
798
804
|
pullRequestLink: string | null;
|
|
799
805
|
merged: boolean | null;
|
|
806
|
+
customerScore?: number | null
|
|
807
|
+
customerCommentary?: string | null
|
|
800
808
|
};
|
|
801
809
|
export type AnalyticsRepositoryLastReportStatusResponse = {
|
|
802
810
|
totalFiles?: number;
|
|
@@ -819,6 +827,8 @@ export type RepositoryUsageResponse = {
|
|
|
819
827
|
totalFixFailure?: number;
|
|
820
828
|
totalPullRequests?: number;
|
|
821
829
|
mergedPullRequests?: number;
|
|
830
|
+
averageRating?: number
|
|
831
|
+
totalRatings?: number
|
|
822
832
|
};
|
|
823
833
|
export type AnalyticsRepositoryUsageResponse = {
|
|
824
834
|
totalScan?: number;
|
|
@@ -829,6 +839,8 @@ export type AnalyticsRepositoryUsageResponse = {
|
|
|
829
839
|
totalFixFailure?: number;
|
|
830
840
|
totalPullRequests?: number;
|
|
831
841
|
mergedPullRequests?: number;
|
|
842
|
+
overallAverageRating?: number
|
|
843
|
+
totalRatings?: number;
|
|
832
844
|
items: RepositoryUsageResponse[];
|
|
833
845
|
totalItems?: number;
|
|
834
846
|
};
|
|
@@ -838,17 +850,25 @@ export type UserUsageResponse = {
|
|
|
838
850
|
totalScan?: number;
|
|
839
851
|
totalScanSuccess?: number;
|
|
840
852
|
totalScanFailure?: number;
|
|
853
|
+
averageScanRating?: number
|
|
854
|
+
ratedScanCount?: number;
|
|
841
855
|
totalFix?: number;
|
|
842
856
|
totalFixSuccess?: number;
|
|
843
857
|
totalFixFailure?: number;
|
|
858
|
+
averageFixRating?: number
|
|
859
|
+
ratedFixCount?: number
|
|
844
860
|
};
|
|
845
861
|
export type AnalyticsUserUsageResponse = {
|
|
846
862
|
totalScan?: number;
|
|
847
863
|
totalScanSuccess?: number;
|
|
848
864
|
totalScanFailure?: number;
|
|
865
|
+
averageScanRating?: number
|
|
866
|
+
totalRatedScans?: number;
|
|
849
867
|
totalFix?: number;
|
|
850
868
|
totalFixSuccess?: number;
|
|
851
869
|
totalFixFailure?: number;
|
|
870
|
+
averageFixRating?: number
|
|
871
|
+
totalRatedFixes?: number;
|
|
852
872
|
items: UserUsageResponse[];
|
|
853
873
|
totalItems?: number;
|
|
854
874
|
};
|
|
@@ -858,6 +878,8 @@ export type ProgramGroupLastReportStatusResponse = {
|
|
|
858
878
|
mode: string;
|
|
859
879
|
reportCreatedAt: string;
|
|
860
880
|
reportCreatedBy: string;
|
|
881
|
+
customerScore?: number | null
|
|
882
|
+
customerCommentary?: string | null;
|
|
861
883
|
totalFiles?: number;
|
|
862
884
|
totalFilesAnalyzed?: number;
|
|
863
885
|
totalFilesIssues?: number;
|
|
@@ -881,6 +903,8 @@ export type ProgramGroupsUsageResponse = {
|
|
|
881
903
|
totalFix?: number;
|
|
882
904
|
totalFixSuccess?: number;
|
|
883
905
|
totalFixFailure?: number;
|
|
906
|
+
averageRating?: number
|
|
907
|
+
totalRatings?: number
|
|
884
908
|
};
|
|
885
909
|
export type AnalyticsProgramGroupsUsageResponse = {
|
|
886
910
|
totalScan?: number;
|
|
@@ -889,6 +913,8 @@ export type AnalyticsProgramGroupsUsageResponse = {
|
|
|
889
913
|
totalFix?: number;
|
|
890
914
|
totalFixSuccess?: number;
|
|
891
915
|
totalFixFailure?: number;
|
|
916
|
+
overallAverageRating?: number
|
|
917
|
+
totalRatings?: number;
|
|
892
918
|
items: ProgramGroupsUsageResponse[];
|
|
893
919
|
totalItems?: number;
|
|
894
920
|
};
|
|
@@ -913,6 +939,9 @@ export type ProgramGroupsDetailsResponse = {
|
|
|
913
939
|
issuesFilesCount?: number;
|
|
914
940
|
changedFilesCount?: number;
|
|
915
941
|
issuesCount?: number;
|
|
942
|
+
customerScore?: number | null
|
|
943
|
+
customerCommentary?: string | null
|
|
944
|
+
customerRatingCreatedAt?: string | null
|
|
916
945
|
};
|
|
917
946
|
export type AnalyticsProgramGroupsDetailsResponse = {
|
|
918
947
|
programsCount?: number;
|
|
@@ -952,6 +981,9 @@ export type RepositoryDetailedReportItemResponse = {
|
|
|
952
981
|
targetBranch?: string | null;
|
|
953
982
|
totalFilesCount?: number;
|
|
954
983
|
status?: string | null;
|
|
984
|
+
customerScore?: number | null
|
|
985
|
+
customerCommentary?: string | null
|
|
986
|
+
customerRatingCreatedAt?: string | null
|
|
955
987
|
};
|
|
956
988
|
export type AnalyticsRepositoryDetailedReportResponse = {
|
|
957
989
|
reposCount?: number;
|
|
@@ -980,6 +1012,8 @@ export type ProgramGroupsTargetDetailsResponse = {
|
|
|
980
1012
|
customOutputs?: {
|
|
981
1013
|
[key: string]: any;
|
|
982
1014
|
} | null;
|
|
1015
|
+
customerScore?: number | null
|
|
1016
|
+
customerCommentary?: string | null
|
|
983
1017
|
};
|
|
984
1018
|
export type AnalyticsProgramGroupsTargetDetailsResponse = {
|
|
985
1019
|
totalComponents?: number;
|
|
@@ -999,6 +1033,8 @@ export type RepositoryTargetDetailsItemResponse = {
|
|
|
999
1033
|
issuesCount?: number | null;
|
|
1000
1034
|
reportCreatedAt: string | null;
|
|
1001
1035
|
reportId: string | null;
|
|
1036
|
+
customerScore?: number | null
|
|
1037
|
+
customerCommentary?: string | null
|
|
1002
1038
|
};
|
|
1003
1039
|
export type AnalyticsRepositoryTargetDetailsResponse = {
|
|
1004
1040
|
totalFiles?: number;
|
|
@@ -1030,25 +1066,25 @@ export type ImportReposScmWithTagsRequest = {
|
|
|
1030
1066
|
repositories: RepositoryPayload[];
|
|
1031
1067
|
};
|
|
1032
1068
|
export type SearchRepoByIdResponse = {
|
|
1033
|
-
url: string
|
|
1034
|
-
name: string
|
|
1035
|
-
defaultBranch: string
|
|
1036
|
-
lastCommitDate: string
|
|
1037
|
-
archived: boolean
|
|
1038
|
-
visibility?: "public" | "private" | "internal"
|
|
1039
|
-
alreadyCreated?: boolean
|
|
1040
|
-
}
|
|
1069
|
+
url: string
|
|
1070
|
+
name: string
|
|
1071
|
+
defaultBranch: string
|
|
1072
|
+
lastCommitDate: string
|
|
1073
|
+
archived: boolean
|
|
1074
|
+
visibility?: "public" | "private" | "internal" | "unknown"
|
|
1075
|
+
alreadyCreated?: boolean | null
|
|
1076
|
+
}
|
|
1041
1077
|
export type ResponseSearchRepoByIdResponse = {
|
|
1042
|
-
total: number | null
|
|
1043
|
-
status?: string
|
|
1044
|
-
exceptions: HttpErrorResponse[]
|
|
1045
|
-
items?: SearchRepoByIdResponse[]
|
|
1046
|
-
}
|
|
1078
|
+
total: number | null
|
|
1079
|
+
status?: string
|
|
1080
|
+
exceptions: HttpErrorResponse[]
|
|
1081
|
+
items?: SearchRepoByIdResponse[]
|
|
1082
|
+
}
|
|
1047
1083
|
export type ResponseSearchRepoByIdResponseRead = {
|
|
1048
|
-
total: number | null
|
|
1049
|
-
status?: string
|
|
1050
|
-
exceptions: HttpErrorResponseRead[]
|
|
1051
|
-
items?: SearchRepoByIdResponse[]
|
|
1084
|
+
total: number | null
|
|
1085
|
+
status?: string
|
|
1086
|
+
exceptions: HttpErrorResponseRead[]
|
|
1087
|
+
items?: SearchRepoByIdResponse[]
|
|
1052
1088
|
};
|
|
1053
1089
|
/**
|
|
1054
1090
|
* Check Role Route
|
|
@@ -1474,6 +1510,43 @@ export function downloadReportV1ReportsReportIdDownloadGet({ reportId, extension
|
|
|
1474
1510
|
})
|
|
1475
1511
|
}));
|
|
1476
1512
|
}
|
|
1513
|
+
/**
|
|
1514
|
+
* Put Customer Rating Report
|
|
1515
|
+
*/
|
|
1516
|
+
export function putCustomerRatingReportV1ReportsReportIdCustomerRatingPut({ reportId, authorization, putCustomerRatingReportRequest }: {
|
|
1517
|
+
reportId: string
|
|
1518
|
+
authorization: string
|
|
1519
|
+
putCustomerRatingReportRequest: PutCustomerRatingReportRequest
|
|
1520
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
1521
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
1522
|
+
status: 200
|
|
1523
|
+
data: any
|
|
1524
|
+
} | {
|
|
1525
|
+
status: 400
|
|
1526
|
+
data: HttpErrorResponseRead
|
|
1527
|
+
} | {
|
|
1528
|
+
status: 401
|
|
1529
|
+
data: HttpErrorResponseRead
|
|
1530
|
+
} | {
|
|
1531
|
+
status: 404
|
|
1532
|
+
data: HttpErrorResponseRead
|
|
1533
|
+
} | {
|
|
1534
|
+
status: 422
|
|
1535
|
+
} | {
|
|
1536
|
+
status: 500
|
|
1537
|
+
data: HttpErrorResponseRead
|
|
1538
|
+
} | {
|
|
1539
|
+
status: 503
|
|
1540
|
+
data: HttpErrorResponseRead
|
|
1541
|
+
}>(`/v1/reports/${encodeURIComponent(reportId)}/customer-rating`, oazapfts.json({
|
|
1542
|
+
...opts,
|
|
1543
|
+
method: "PUT",
|
|
1544
|
+
body: putCustomerRatingReportRequest,
|
|
1545
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
1546
|
+
authorization
|
|
1547
|
+
})
|
|
1548
|
+
})))
|
|
1549
|
+
}
|
|
1477
1550
|
/**
|
|
1478
1551
|
* Search Repos Scm Service
|
|
1479
1552
|
*/
|
package/src/apis-itau.json
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"agent": {
|
|
19
19
|
"url": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"prd": ""
|
|
20
|
+
"dev": "https://genai-ai-agent-mgmt-api.dev.stackspot.com",
|
|
21
|
+
"stg": "https://genai-ai-agent-mgmt-api.stg.stackspot.com",
|
|
22
|
+
"prd": "https://genai-ai-agent-mgmt-api.stackspot.com"
|
|
23
23
|
},
|
|
24
24
|
"docs": "/q/openapi"
|
|
25
25
|
},
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"workspace": {
|
|
43
43
|
"url": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"prd": ""
|
|
44
|
+
"dev": "https://workspace-workspace-api.dev.stackspot.com",
|
|
45
|
+
"stg": "https://workspace-workspace-api.stg.stackspot.com",
|
|
46
|
+
"prd": "https://workspace.stackspot.com"
|
|
47
47
|
},
|
|
48
48
|
"docs": "/v3/api-docs"
|
|
49
49
|
},
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"content": {
|
|
59
59
|
"url": {
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"prd": ""
|
|
60
|
+
"dev": "https://content-content-api.dev.stackspot.com",
|
|
61
|
+
"stg": "https://content-content-api.stg.stackspot.com",
|
|
62
|
+
"prd": "https://content-api.stackspot.com"
|
|
63
63
|
},
|
|
64
64
|
"docs": "/v3/api-docs"
|
|
65
65
|
},
|
|
@@ -73,73 +73,73 @@
|
|
|
73
73
|
},
|
|
74
74
|
"serviceCatalog": {
|
|
75
75
|
"url": {
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"prd": ""
|
|
76
|
+
"dev": "https://catalog-tech-products-catalog-api.dev.stackspot.com",
|
|
77
|
+
"stg": "https://catalog-tech-products-catalog-api.stg.stackspot.com",
|
|
78
|
+
"prd": "https://catalog-api.stackspot.com"
|
|
79
79
|
},
|
|
80
80
|
"docs": "/v3/api-docs"
|
|
81
81
|
},
|
|
82
82
|
"apiRuntime": {
|
|
83
83
|
"url": {
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"prd": ""
|
|
84
|
+
"dev": "https://runtime-manager.dev.stackspot.com",
|
|
85
|
+
"stg": "https://runtime-manager.stg.stackspot.com",
|
|
86
|
+
"prd": "https://runtime-manager.stackspot.com"
|
|
87
87
|
},
|
|
88
88
|
"docs": "/v3/api-docs"
|
|
89
89
|
},
|
|
90
90
|
"cloudServices": {
|
|
91
91
|
"url": {
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"prd": ""
|
|
92
|
+
"dev": "https://cloud-services-cloud-services-api.dev.stackspot.com",
|
|
93
|
+
"stg": "https://cloud-services-cloud-services-api.stg.stackspot.com",
|
|
94
|
+
"prd": "https://cloud-services-api.stackspot.com"
|
|
95
95
|
},
|
|
96
96
|
"docs": "/v3/api-docs"
|
|
97
97
|
},
|
|
98
98
|
"cloudAccount": {
|
|
99
99
|
"url": {
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
"prd": ""
|
|
100
|
+
"dev": "https://account-account-external-connections-api.dev.stackspot.com",
|
|
101
|
+
"stg": "https://account-account-external-connections-api.stg.stackspot.com",
|
|
102
|
+
"prd": "https://account-external-connections-api.stackspot.com"
|
|
103
103
|
},
|
|
104
104
|
"docs": "/v3/api-docs"
|
|
105
105
|
},
|
|
106
106
|
"dataPlatform": {
|
|
107
107
|
"url": {
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"prd": ""
|
|
108
|
+
"dev": "https://data-platform-metabase.dev.stackspot.com",
|
|
109
|
+
"stg": "https://data-platform-metabase.stg.stackspot.com",
|
|
110
|
+
"prd": "https://data-platform-stackspot-public.stackspot.com"
|
|
111
111
|
},
|
|
112
112
|
"docs": "/v3/api-docs"
|
|
113
113
|
},
|
|
114
114
|
"insights": {
|
|
115
115
|
"url": {
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"prd": ""
|
|
116
|
+
"dev": "https://insights-insights-api.dev.stackspot.com",
|
|
117
|
+
"stg": "https://insights-insights-api.stg.stackspot.com",
|
|
118
|
+
"prd": "https://insights-api.stackspot.com"
|
|
119
119
|
},
|
|
120
120
|
"docs": "/v3/api-docs"
|
|
121
121
|
},
|
|
122
122
|
"workflows": {
|
|
123
123
|
"url": {
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"prd": ""
|
|
124
|
+
"dev": "https://workflow-workflow-api.dev.stackspot.com",
|
|
125
|
+
"stg": "https://workflow-workflow-api.stg.stackspot.com",
|
|
126
|
+
"prd": "https://workflow-api.stackspot.com"
|
|
127
127
|
},
|
|
128
128
|
"docs": "/openapi.json"
|
|
129
129
|
},
|
|
130
130
|
"workspaceManager": {
|
|
131
131
|
"url": {
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"prd": ""
|
|
132
|
+
"dev": "https://workspace-workspace-manager.dev.stackspot.com",
|
|
133
|
+
"stg": "https://workspace-workspace-manager.stg.stackspot.com",
|
|
134
|
+
"prd": "https://workspace-manager.stackspot.com"
|
|
135
135
|
},
|
|
136
136
|
"docs": "/v3/api-docs"
|
|
137
137
|
},
|
|
138
138
|
"workspaceSearchEngine": {
|
|
139
139
|
"url": {
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"prd": ""
|
|
140
|
+
"dev": "https://workspace-search-engine-api.dev.stackspot.com",
|
|
141
|
+
"stg": "https://workspace-search-engine-api.stg.stackspot.com",
|
|
142
|
+
"prd": "https://workspace-search-engine-api.stackspot.com"
|
|
143
143
|
},
|
|
144
144
|
"docs": "/v3/api-docs"
|
|
145
145
|
},
|
|
@@ -152,17 +152,17 @@
|
|
|
152
152
|
},
|
|
153
153
|
"apiManagement": {
|
|
154
154
|
"url": {
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"prd": ""
|
|
155
|
+
"dev": "https://api-management-apigw.dev.stackspot.com/catalog-assets",
|
|
156
|
+
"stg": "https://api-management-apigw.stg.stackspot.com/catalog-assets",
|
|
157
|
+
"prd": "https://api-management-apigw.stackspot.com/catalog-assets"
|
|
158
158
|
},
|
|
159
159
|
"docs": "/v3/api-docs"
|
|
160
160
|
},
|
|
161
161
|
"secrets": {
|
|
162
162
|
"url": {
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"prd": ""
|
|
163
|
+
"dev": "https://workspace-workspace-secrets-api.dev.stackspot.com",
|
|
164
|
+
"stg": "https://workspace-workspace-secrets-api.stg.stackspot.com",
|
|
165
|
+
"prd": "https://secrets-api.stackspot.com"
|
|
166
166
|
},
|
|
167
167
|
"docs": "/v3/api-docs"
|
|
168
168
|
},
|
|
@@ -176,33 +176,33 @@
|
|
|
176
176
|
},
|
|
177
177
|
"cloudPlatform": {
|
|
178
178
|
"url": {
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"prd": ""
|
|
179
|
+
"dev": "https://cloud-cloud-platform-api.dev.stackspot.com",
|
|
180
|
+
"stg": "https://cloud-cloud-platform-api.stg.stackspot.com",
|
|
181
|
+
"prd": "https://cloud-cloud-platform-api.prd.stackspot.com"
|
|
182
182
|
},
|
|
183
183
|
"docs": "/v3/api-docs"
|
|
184
184
|
},
|
|
185
|
-
|
|
185
|
+
"cloudRuntimes": {
|
|
186
186
|
"url": {
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"prd": ""
|
|
187
|
+
"dev": "https://cloud-cloud-runtime-api.dev.stackspot.com",
|
|
188
|
+
"stg": "https://cloud-cloud-runtime-api.stg.stackspot.com",
|
|
189
|
+
"prd": "https://cloud-cloud-runtime-api.prd.stackspot.com"
|
|
190
190
|
},
|
|
191
191
|
"docs": "/v3/api-docs"
|
|
192
192
|
},
|
|
193
193
|
"cloudPlatformHorizon": {
|
|
194
194
|
"url": {
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"prd": ""
|
|
195
|
+
"dev": "https://cloud-platform-horizon.dev.stackspot.com",
|
|
196
|
+
"stg": "https://cloud-platform-horizon.stg.stackspot.com",
|
|
197
|
+
"prd": "https://cloud-platform-horizon.stackspot.com"
|
|
198
198
|
},
|
|
199
199
|
"docs": "/v3/api-docs"
|
|
200
200
|
},
|
|
201
201
|
"codeShift": {
|
|
202
202
|
"url": {
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"prd": ""
|
|
203
|
+
"dev": "https://code-shift-code-shift-api.dev.stackspot.com",
|
|
204
|
+
"stg": "https://code-shift-code-shift-api.stg.stackspot.com",
|
|
205
|
+
"prd": "https://code-shift-api.stackspot.com"
|
|
206
206
|
},
|
|
207
207
|
"docs": "/openapi.json"
|
|
208
208
|
},
|
|
@@ -210,15 +210,15 @@
|
|
|
210
210
|
"url": {
|
|
211
211
|
"stg": "https://genai-inference-app.stackspot.hom.aws.cloud.ihf",
|
|
212
212
|
"dev": "https://genai-inference-app.stackspot.dev.aws.cloud.ihf",
|
|
213
|
-
"prd": "https://genai-inference-app.
|
|
213
|
+
"prd": "https://genai-inference-app.stackspot.prod.aws.cloud.ihf"
|
|
214
214
|
},
|
|
215
215
|
"docs": "/openapi.json"
|
|
216
216
|
},
|
|
217
217
|
"discover": {
|
|
218
218
|
"url": {
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"prd": ""
|
|
219
|
+
"dev": "https://discover-discover-core.dev.stackspot.com",
|
|
220
|
+
"stg": "https://discover-discover-core.stg.stackspot.com",
|
|
221
|
+
"prd": "https://discover-core.stackspot.com"
|
|
222
222
|
},
|
|
223
223
|
"docs": "/v3/api-docs"
|
|
224
224
|
}
|
|
@@ -86,7 +86,7 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
86
86
|
name: 'agentDefault',
|
|
87
87
|
request: async (signal) => {
|
|
88
88
|
const agentDefault = await listAgentsV1AgentsGet(
|
|
89
|
-
{
|
|
89
|
+
{ visibility: 'built_in', slug: this.agentDefaultSlug, authorization: '' }, { signal },
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
const agentId = agentDefault?.find((agent) => agent.slug === this.agentDefaultSlug)?.id
|
|
@@ -114,7 +114,7 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
114
114
|
|
|
115
115
|
const [workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
116
116
|
workspaceAgentsPromise,
|
|
117
|
-
...visibilities.map((visibility) => listAgentsV1AgentsGet({
|
|
117
|
+
...visibilities.map((visibility) => listAgentsV1AgentsGet({ visibility, authorization: '' }, { signal })),
|
|
118
118
|
])
|
|
119
119
|
|
|
120
120
|
const workspaceAgentsWithSpaceName = workspaceAgents.flatMap(({ agents, space_name }) =>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import {
|
|
2
|
+
import { getApiAddresses } from '../api-addresses'
|
|
3
|
+
import { defaults, downloadObjectArtifacts, getEntries, getEntryById, getSubEntries } from '../api/apiManagement'
|
|
3
4
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
4
5
|
import { actionDictionary } from '../error/dictionary/action'
|
|
5
6
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
7
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
-
import { getApiAddresses } from '../api-addresses'
|
|
8
8
|
|
|
9
9
|
class ApiManagementClient extends ReactQueryNetworkClient {
|
|
10
10
|
constructor() {
|
|
@@ -30,6 +30,11 @@ class ApiManagementClient extends ReactQueryNetworkClient {
|
|
|
30
30
|
*/
|
|
31
31
|
getApiVersions = this.query(getSubEntries)
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Gets the openAPI of one version
|
|
35
|
+
*/
|
|
36
|
+
getApiVersionDocs = this.query(downloadObjectArtifacts)
|
|
37
|
+
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
export const apiManagementClient = new ApiManagementClient()
|
package/src/client/code-shift.ts
CHANGED
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
searchReposScmServiceV2ReposSearchScmPost,
|
|
64
64
|
importReposWithTagsScmServiceV2ReposSearchScmSearchIdPost,
|
|
65
65
|
searchReposScmV2V2ReposSearchScmSearchIdGet,
|
|
66
|
+
putCustomerRatingReportV1ReportsReportIdCustomerRatingPut,
|
|
66
67
|
} from '../api/codeShift'
|
|
67
68
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
68
69
|
import { codeShiftDictionary } from '../error/dictionary/code-shift'
|
|
@@ -359,6 +360,12 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
359
360
|
analyticsRepositoryTargetDetailsDownload = this.query(
|
|
360
361
|
removeAuthorizationParam(analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet),
|
|
361
362
|
)
|
|
363
|
+
/**
|
|
364
|
+
* Put Customer Rating Report
|
|
365
|
+
*/
|
|
366
|
+
updateReportRating = this.mutation(
|
|
367
|
+
removeAuthorizationParam(putCustomerRatingReportV1ReportsReportIdCustomerRatingPut),
|
|
368
|
+
)
|
|
362
369
|
}
|
|
363
370
|
|
|
364
371
|
export const codeShiftClient = new CodeShift()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dictionary
|
|
1
|
+
import { Dictionary } from '@stack-spot/portal-translate'
|
|
2
2
|
import { every, isString } from 'lodash'
|
|
3
3
|
import { actionDetails } from './dictionary/action-details'
|
|
4
4
|
import { baseDictionary } from './dictionary/base'
|
|
@@ -24,7 +24,7 @@ const detailsDictionary = {
|
|
|
24
24
|
actionapi: actionDetails,
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function getTitle(status: number, raw: ErrorResponse, dictionary: Dictionary, language:
|
|
27
|
+
function getTitle(status: number, raw: ErrorResponse, dictionary: Dictionary, language: 'pt' | 'en') {
|
|
28
28
|
if (ignoredTitleErrorCodes.includes(raw.code)) return ' '
|
|
29
29
|
if (dictionary[language][raw.code]) return dictionary[language][raw.code]
|
|
30
30
|
if (raw.details && !ignoredDescriptions.includes(raw.details)) return raw.details
|
|
@@ -35,8 +35,8 @@ function getValues(detail: ValidationDetails) {
|
|
|
35
35
|
return detail.values && every(detail.values, isString) ? `\n${detail.values.join('\n')}` : ''
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function getSuggestedMessages(suggestedMessage: ErrorResponse['suggestedMessages'] | null | undefined, language?:
|
|
39
|
-
const parseLanguage: Record<
|
|
38
|
+
function getSuggestedMessages(suggestedMessage: ErrorResponse['suggestedMessages'] | null | undefined, language?: 'pt' | 'en') {
|
|
39
|
+
const parseLanguage: Record<'pt' | 'en', LanguageSuggestedMessageKeys> = { pt: 'ptBr', en: 'enUs' }
|
|
40
40
|
return suggestedMessage?.[parseLanguage?.[language || 'en']]
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -60,7 +60,7 @@ export function interpolateErrors(message: string, values: string[], fieldValues
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
function createMessage(status: number, raw: ErrorResponse, dictionary: Dictionary, language?:
|
|
63
|
+
function createMessage(status: number, raw: ErrorResponse, dictionary: Dictionary, language?: 'pt' | 'en'): ErrorDetailsProperties {
|
|
64
64
|
const title = getTitle(status, raw, dictionary, language || 'en')
|
|
65
65
|
const api = raw.code?.split(/[-_]/)[0]
|
|
66
66
|
const dictDetails = (detailsDictionary[api?.toLowerCase() as keyof typeof detailsDictionary] ?? {})[language || 'en']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getLanguage, ptEn } from '@stack-spot/portal-translate'
|
|
2
2
|
|
|
3
|
-
export type InternationalizedMessage = (language:
|
|
3
|
+
export type InternationalizedMessage = (language: 'pt' | 'en') => string | ErrorDetailsProperties
|
|
4
4
|
|
|
5
5
|
export interface ErrorDetailsProperties {
|
|
6
6
|
/**
|
|
@@ -81,7 +81,7 @@ export class StackspotAPIError extends Error {
|
|
|
81
81
|
* @param language
|
|
82
82
|
* @returns an error message
|
|
83
83
|
*/
|
|
84
|
-
translate(language
|
|
84
|
+
translate(language = getLanguage(ptEn)): string {
|
|
85
85
|
const unknown = language === 'en' ? 'unknown error' : 'erro desconhecido'
|
|
86
86
|
|
|
87
87
|
const error = this.intl?.(language)
|
|
@@ -89,7 +89,7 @@ export class StackspotAPIError extends Error {
|
|
|
89
89
|
return message ?? this.message ?? this.code ?? (this.status === 0 ? unknown : `${this.status}`)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
translateDetails(language
|
|
92
|
+
translateDetails(language = getLanguage(ptEn)): ErrorDetailsProperties {
|
|
93
93
|
const unknown = language === 'en' ? 'unknown error' : 'erro desconhecido'
|
|
94
94
|
const errorMessage = this.intl?.(language)
|
|
95
95
|
if (typeof errorMessage === 'string')
|