@stack-spot/portal-network 0.176.2-beta.1 → 0.177.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/CHANGELOG.md +0 -220
- package/dist/api/codeShift.d.ts +10 -105
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +0 -84
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api-addresses.d.ts +5 -14
- package/dist/api-addresses.d.ts.map +1 -1
- package/dist/api-addresses.js +10 -27
- package/dist/api-addresses.js.map +1 -1
- package/dist/client/code-shift.d.ts +4 -61
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +1 -46
- package/dist/client/code-shift.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/network/NetworkClient.d.ts +2 -4
- package/dist/network/NetworkClient.d.ts.map +1 -1
- package/dist/network/NetworkClient.js +3 -5
- package/dist/network/NetworkClient.js.map +1 -1
- package/dist/network/types.d.ts +0 -1
- package/dist/network/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
- package/src/api/account.ts +0 -1
- package/src/api/agent-tools.ts +0 -3
- package/src/api/agent.ts +0 -2
- package/src/api/codeShift.ts +10 -274
- package/src/api/notification.ts +0 -2
- package/src/api-addresses.ts +11 -30
- package/src/client/ai.ts +0 -1
- package/src/client/code-shift.ts +0 -29
- package/src/index.ts +3 -4
- package/src/network/NetworkClient.ts +4 -7
- package/src/network/types.ts +0 -2
- package/dist/apis-itau.json +0 -225
- package/src/apis-itau.json +0 -225
package/src/api/codeShift.ts
CHANGED
|
@@ -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" | "
|
|
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_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_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;
|
|
@@ -264,8 +264,6 @@ export type PutReportRequest = {
|
|
|
264
264
|
customOutputs?: {
|
|
265
265
|
[key: string]: any;
|
|
266
266
|
} | null;
|
|
267
|
-
totalTokenSent?: number | null;
|
|
268
|
-
totalTokenReceived?: number | null;
|
|
269
267
|
};
|
|
270
268
|
export type ModuleResponse2 = {
|
|
271
269
|
id: string;
|
|
@@ -347,8 +345,6 @@ export type GetReportResponse = {
|
|
|
347
345
|
customOutputs?: {
|
|
348
346
|
[key: string]: any;
|
|
349
347
|
} | null;
|
|
350
|
-
totalTokenSent?: number | null;
|
|
351
|
-
totalTokenReceived?: number | null;
|
|
352
348
|
targetFiles: TargetFilesResponse[];
|
|
353
349
|
errorLog?: string | null;
|
|
354
350
|
exceptions: HttpErrorResponse[];
|
|
@@ -382,8 +378,6 @@ export type GetReportResponseRead = {
|
|
|
382
378
|
customOutputs?: {
|
|
383
379
|
[key: string]: any;
|
|
384
380
|
} | null;
|
|
385
|
-
totalTokenSent?: number | null;
|
|
386
|
-
totalTokenReceived?: number | null;
|
|
387
381
|
targetFiles: TargetFilesResponse[];
|
|
388
382
|
errorLog?: string | null;
|
|
389
383
|
exceptions: HttpErrorResponseRead[];
|
|
@@ -966,7 +960,7 @@ export type AnalyticsRepositoryDetailedReportResponse = {
|
|
|
966
960
|
};
|
|
967
961
|
export type ProgramGroupsTargetDetailsResponse = {
|
|
968
962
|
programGroupName: string;
|
|
969
|
-
programGroupTags?: string
|
|
963
|
+
programGroupTags?: string | null;
|
|
970
964
|
mode: string;
|
|
971
965
|
moduleName: string;
|
|
972
966
|
reportCreatedAt: string;
|
|
@@ -977,35 +971,17 @@ export type ProgramGroupsTargetDetailsResponse = {
|
|
|
977
971
|
componentType: string;
|
|
978
972
|
totalIssues?: number;
|
|
979
973
|
changedFilesCount?: number;
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
974
|
+
reportOutputs?: string | null;
|
|
975
|
+
aiAdjusted?: string | null;
|
|
976
|
+
changemanPackage?: string | null;
|
|
983
977
|
};
|
|
984
978
|
export type AnalyticsProgramGroupsTargetDetailsResponse = {
|
|
985
979
|
totalComponents?: number;
|
|
986
980
|
totalIssues?: number;
|
|
987
|
-
|
|
981
|
+
totalChangedFiles?: number;
|
|
988
982
|
totalItems?: number;
|
|
989
983
|
items?: ProgramGroupsTargetDetailsResponse[];
|
|
990
984
|
};
|
|
991
|
-
export type RepositoryTargetDetailsItemResponse = {
|
|
992
|
-
repositoryUrl: string;
|
|
993
|
-
sourceBranch: string | null;
|
|
994
|
-
moduleName: string | null;
|
|
995
|
-
targetName: string | null;
|
|
996
|
-
moduleInputs: string | null;
|
|
997
|
-
targetPath: string | null;
|
|
998
|
-
targetDetails: string | null;
|
|
999
|
-
issuesCount?: number | null;
|
|
1000
|
-
reportCreatedAt: string | null;
|
|
1001
|
-
reportId: string | null;
|
|
1002
|
-
};
|
|
1003
|
-
export type AnalyticsRepositoryTargetDetailsResponse = {
|
|
1004
|
-
totalFiles?: number;
|
|
1005
|
-
totalIssues?: number;
|
|
1006
|
-
totalItems?: number;
|
|
1007
|
-
items?: RepositoryTargetDetailsItemResponse[];
|
|
1008
|
-
};
|
|
1009
985
|
export type UserResponse6 = {
|
|
1010
986
|
id: string;
|
|
1011
987
|
name: string;
|
|
@@ -1015,20 +991,6 @@ export type ListUserResponse = {
|
|
|
1015
991
|
items: UserResponse6[];
|
|
1016
992
|
itemsCount: number;
|
|
1017
993
|
};
|
|
1018
|
-
export type SearchReposInScmRequest = {
|
|
1019
|
-
repositoryName: string;
|
|
1020
|
-
codeTerm?: string | null;
|
|
1021
|
-
};
|
|
1022
|
-
export type SearchReposInScmResponse = {
|
|
1023
|
-
search_id: string;
|
|
1024
|
-
};
|
|
1025
|
-
export type RepositoryPayload = {
|
|
1026
|
-
url: string;
|
|
1027
|
-
tags: string[];
|
|
1028
|
-
};
|
|
1029
|
-
export type ImportReposScmWithTagsRequest = {
|
|
1030
|
-
repositories: RepositoryPayload[];
|
|
1031
|
-
};
|
|
1032
994
|
/**
|
|
1033
995
|
* Check Role Route
|
|
1034
996
|
*/
|
|
@@ -1649,7 +1611,7 @@ export function listRepositoryServiceV1ReposGet({ pageSize, page, lastEvaluatedK
|
|
|
1649
1611
|
createdByEmail?: string | null;
|
|
1650
1612
|
reportByEmail?: string | null;
|
|
1651
1613
|
orderBy?: "repository.url" | "repository.created_at" | "repository.updated_at" | "report.issues_count" | "report.total_files_count" | "report.analyzed_files_count" | "report.issues_files_count" | "report.created_at" | "report.updated_at" | "execution.status";
|
|
1652
|
-
orderDirection?:
|
|
1614
|
+
orderDirection?: string;
|
|
1653
1615
|
tags?: string[] | null;
|
|
1654
1616
|
authorization: string;
|
|
1655
1617
|
}, opts?: Oazapfts.RequestOpts) {
|
|
@@ -1700,7 +1662,7 @@ export function listRepositoryDownloadServiceV1ReposDownloadGet({ filter, module
|
|
|
1700
1662
|
createdByEmail?: string | null;
|
|
1701
1663
|
reportByEmail?: string | null;
|
|
1702
1664
|
orderBy?: "repository.url" | "repository.created_at" | "repository.updated_at" | "report.issues_count" | "report.total_files_count" | "report.analyzed_files_count" | "report.issues_files_count" | "report.created_at" | "report.updated_at" | "execution.status";
|
|
1703
|
-
orderDirection?:
|
|
1665
|
+
orderDirection?: string;
|
|
1704
1666
|
tags?: string[] | null;
|
|
1705
1667
|
extension?: "csv" | "xlsx";
|
|
1706
1668
|
authorization: string;
|
|
@@ -2113,7 +2075,7 @@ export function listProgramGroupServiceV1ProgramGroupsGet({ moduleId, createdByE
|
|
|
2113
2075
|
pageSize?: number;
|
|
2114
2076
|
page?: number;
|
|
2115
2077
|
orderBy?: "program_group.name" | "program_group.created_at" | "program_group.updated_at" | "report.issues_count" | "report.total_files_count" | "report.analyzed_files_count" | "report.issues_files_count" | "report.created_at" | "report.updated_at" | "execution.status";
|
|
2116
|
-
orderDirection?:
|
|
2078
|
+
orderDirection?: string;
|
|
2117
2079
|
integrationId?: string;
|
|
2118
2080
|
authorization: string;
|
|
2119
2081
|
}, opts?: Oazapfts.RequestOpts) {
|
|
@@ -2151,7 +2113,7 @@ export function listProgramGroupDownloadServiceV1ProgramGroupsDownloadGet({ modu
|
|
|
2151
2113
|
tags?: string[] | null;
|
|
2152
2114
|
name?: string | null;
|
|
2153
2115
|
orderBy?: "program_group.name" | "program_group.created_at" | "program_group.updated_at" | "report.issues_count" | "report.total_files_count" | "report.analyzed_files_count" | "report.issues_files_count" | "report.created_at" | "report.updated_at" | "execution.status";
|
|
2154
|
-
orderDirection?:
|
|
2116
|
+
orderDirection?: string;
|
|
2155
2117
|
integrationId?: string;
|
|
2156
2118
|
extension?: "csv" | "xlsx";
|
|
2157
2119
|
authorization: string;
|
|
@@ -3234,120 +3196,6 @@ export function analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGro
|
|
|
3234
3196
|
})
|
|
3235
3197
|
}));
|
|
3236
3198
|
}
|
|
3237
|
-
/**
|
|
3238
|
-
* Analytics Repository Target Details
|
|
3239
|
-
*/
|
|
3240
|
-
export function analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet({ pageSize, page, repositoryUrl, targetName, tags, mode, moduleId, reportCreatedById, startDate, endDate, orderBy, orderDirection, authorization }: {
|
|
3241
|
-
pageSize?: number;
|
|
3242
|
-
page?: number;
|
|
3243
|
-
repositoryUrl?: string | null;
|
|
3244
|
-
targetName?: string | null;
|
|
3245
|
-
tags?: string[] | null;
|
|
3246
|
-
mode?: ("scan" | "fix") | null;
|
|
3247
|
-
moduleId?: string[] | null;
|
|
3248
|
-
reportCreatedById?: string[] | null;
|
|
3249
|
-
startDate?: string;
|
|
3250
|
-
endDate?: string;
|
|
3251
|
-
orderBy?: ("repositoryUrl" | "sourceBranch" | "moduleName" | "targetName" | "targetPath" | "issuesCount" | "reportCreatedAt") | null;
|
|
3252
|
-
orderDirection?: ("ASC" | "DESC") | null;
|
|
3253
|
-
authorization: string;
|
|
3254
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
3255
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
3256
|
-
status: 200;
|
|
3257
|
-
data: AnalyticsRepositoryTargetDetailsResponse;
|
|
3258
|
-
} | {
|
|
3259
|
-
status: 400;
|
|
3260
|
-
data: HttpErrorResponseRead;
|
|
3261
|
-
} | {
|
|
3262
|
-
status: 401;
|
|
3263
|
-
data: HttpErrorResponseRead;
|
|
3264
|
-
} | {
|
|
3265
|
-
status: 404;
|
|
3266
|
-
data: HttpErrorResponseRead;
|
|
3267
|
-
} | {
|
|
3268
|
-
status: 422;
|
|
3269
|
-
} | {
|
|
3270
|
-
status: 500;
|
|
3271
|
-
data: HttpErrorResponseRead;
|
|
3272
|
-
} | {
|
|
3273
|
-
status: 503;
|
|
3274
|
-
data: HttpErrorResponseRead;
|
|
3275
|
-
}>(`/v1/analytics/repositories/target-details${QS.query(QS.explode({
|
|
3276
|
-
pageSize,
|
|
3277
|
-
page,
|
|
3278
|
-
repositoryUrl,
|
|
3279
|
-
targetName,
|
|
3280
|
-
tags,
|
|
3281
|
-
mode,
|
|
3282
|
-
moduleId,
|
|
3283
|
-
reportCreatedById,
|
|
3284
|
-
startDate,
|
|
3285
|
-
endDate,
|
|
3286
|
-
orderBy,
|
|
3287
|
-
orderDirection
|
|
3288
|
-
}))}`, {
|
|
3289
|
-
...opts,
|
|
3290
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
3291
|
-
authorization
|
|
3292
|
-
})
|
|
3293
|
-
}));
|
|
3294
|
-
}
|
|
3295
|
-
/**
|
|
3296
|
-
* Analytics Repository Target Details Download
|
|
3297
|
-
*/
|
|
3298
|
-
export function analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet({ repositoryUrl, targetName, tags, mode, moduleId, reportCreatedById, startDate, endDate, orderBy, orderDirection, extension, authorization }: {
|
|
3299
|
-
repositoryUrl?: string | null;
|
|
3300
|
-
targetName?: string | null;
|
|
3301
|
-
tags?: string[] | null;
|
|
3302
|
-
mode?: ("scan" | "fix") | null;
|
|
3303
|
-
moduleId?: string[] | null;
|
|
3304
|
-
reportCreatedById?: string[] | null;
|
|
3305
|
-
startDate?: string;
|
|
3306
|
-
endDate?: string;
|
|
3307
|
-
orderBy?: ("repositoryUrl" | "sourceBranch" | "moduleName" | "targetName" | "targetPath" | "issuesCount" | "reportCreatedAt") | null;
|
|
3308
|
-
orderDirection?: ("ASC" | "DESC") | null;
|
|
3309
|
-
extension?: "csv" | "xlsx";
|
|
3310
|
-
authorization: string;
|
|
3311
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
3312
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
3313
|
-
status: 200;
|
|
3314
|
-
data: any;
|
|
3315
|
-
} | {
|
|
3316
|
-
status: 400;
|
|
3317
|
-
data: HttpErrorResponseRead;
|
|
3318
|
-
} | {
|
|
3319
|
-
status: 401;
|
|
3320
|
-
data: HttpErrorResponseRead;
|
|
3321
|
-
} | {
|
|
3322
|
-
status: 404;
|
|
3323
|
-
data: HttpErrorResponseRead;
|
|
3324
|
-
} | {
|
|
3325
|
-
status: 422;
|
|
3326
|
-
} | {
|
|
3327
|
-
status: 500;
|
|
3328
|
-
data: HttpErrorResponseRead;
|
|
3329
|
-
} | {
|
|
3330
|
-
status: 503;
|
|
3331
|
-
data: HttpErrorResponseRead;
|
|
3332
|
-
}>(`/v1/analytics/repositories/target-details/download${QS.query(QS.explode({
|
|
3333
|
-
repositoryUrl,
|
|
3334
|
-
targetName,
|
|
3335
|
-
tags,
|
|
3336
|
-
mode,
|
|
3337
|
-
moduleId,
|
|
3338
|
-
reportCreatedById,
|
|
3339
|
-
startDate,
|
|
3340
|
-
endDate,
|
|
3341
|
-
orderBy,
|
|
3342
|
-
orderDirection,
|
|
3343
|
-
extension
|
|
3344
|
-
}))}`, {
|
|
3345
|
-
...opts,
|
|
3346
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
3347
|
-
authorization
|
|
3348
|
-
})
|
|
3349
|
-
}));
|
|
3350
|
-
}
|
|
3351
3199
|
/**
|
|
3352
3200
|
* List User Service
|
|
3353
3201
|
*/
|
|
@@ -3367,115 +3215,3 @@ export function listUserServiceV1UsersGet({ authorization }: {
|
|
|
3367
3215
|
})
|
|
3368
3216
|
}));
|
|
3369
3217
|
}
|
|
3370
|
-
/**
|
|
3371
|
-
* Search Repos Scm Service
|
|
3372
|
-
*/
|
|
3373
|
-
export function searchReposScmServiceV2ReposSearchScmPost({ authorization, searchReposInScmRequest }: {
|
|
3374
|
-
authorization: string;
|
|
3375
|
-
searchReposInScmRequest: SearchReposInScmRequest;
|
|
3376
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
3377
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
3378
|
-
status: 200;
|
|
3379
|
-
} | {
|
|
3380
|
-
status: 201;
|
|
3381
|
-
data: SearchReposInScmResponse;
|
|
3382
|
-
} | {
|
|
3383
|
-
status: 207;
|
|
3384
|
-
data: HttpErrorResponseRead;
|
|
3385
|
-
} | {
|
|
3386
|
-
status: 400;
|
|
3387
|
-
data: HttpErrorResponseRead;
|
|
3388
|
-
} | {
|
|
3389
|
-
status: 401;
|
|
3390
|
-
data: HttpErrorResponseRead;
|
|
3391
|
-
} | {
|
|
3392
|
-
status: 404;
|
|
3393
|
-
data: HttpErrorResponseRead;
|
|
3394
|
-
} | {
|
|
3395
|
-
status: 422;
|
|
3396
|
-
} | {
|
|
3397
|
-
status: 500;
|
|
3398
|
-
data: HttpErrorResponseRead;
|
|
3399
|
-
} | {
|
|
3400
|
-
status: 503;
|
|
3401
|
-
data: HttpErrorResponseRead;
|
|
3402
|
-
}>("/v2/repos/search-scm", oazapfts.json({
|
|
3403
|
-
...opts,
|
|
3404
|
-
method: "POST",
|
|
3405
|
-
body: searchReposInScmRequest,
|
|
3406
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
3407
|
-
authorization
|
|
3408
|
-
})
|
|
3409
|
-
})));
|
|
3410
|
-
}
|
|
3411
|
-
/**
|
|
3412
|
-
* Import Repos With Tags Scm Service
|
|
3413
|
-
*/
|
|
3414
|
-
export function importReposWithTagsScmServiceV2ReposSearchScmSearchIdPost({ searchId, authorization, importReposScmWithTagsRequest }: {
|
|
3415
|
-
searchId: string;
|
|
3416
|
-
authorization: string;
|
|
3417
|
-
importReposScmWithTagsRequest: ImportReposScmWithTagsRequest;
|
|
3418
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
3419
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
3420
|
-
status: 200;
|
|
3421
|
-
data: SearchReposInScmResponse;
|
|
3422
|
-
} | {
|
|
3423
|
-
status: 400;
|
|
3424
|
-
data: HttpErrorResponseRead;
|
|
3425
|
-
} | {
|
|
3426
|
-
status: 401;
|
|
3427
|
-
data: HttpErrorResponseRead;
|
|
3428
|
-
} | {
|
|
3429
|
-
status: 404;
|
|
3430
|
-
data: HttpErrorResponseRead;
|
|
3431
|
-
} | {
|
|
3432
|
-
status: 422;
|
|
3433
|
-
} | {
|
|
3434
|
-
status: 500;
|
|
3435
|
-
data: HttpErrorResponseRead;
|
|
3436
|
-
} | {
|
|
3437
|
-
status: 503;
|
|
3438
|
-
data: HttpErrorResponseRead;
|
|
3439
|
-
}>(`/v2/repos/search-scm/${encodeURIComponent(searchId)}`, oazapfts.json({
|
|
3440
|
-
...opts,
|
|
3441
|
-
method: "POST",
|
|
3442
|
-
body: importReposScmWithTagsRequest,
|
|
3443
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
3444
|
-
authorization
|
|
3445
|
-
})
|
|
3446
|
-
})));
|
|
3447
|
-
}
|
|
3448
|
-
/**
|
|
3449
|
-
* Search Repos Scm V2
|
|
3450
|
-
*/
|
|
3451
|
-
export function searchReposScmV2V2ReposSearchScmSearchIdGet({ searchId, authorization }: {
|
|
3452
|
-
searchId: string;
|
|
3453
|
-
authorization: string;
|
|
3454
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
3455
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
3456
|
-
status: 200;
|
|
3457
|
-
data: any;
|
|
3458
|
-
} | {
|
|
3459
|
-
status: 400;
|
|
3460
|
-
data: HttpErrorResponseRead;
|
|
3461
|
-
} | {
|
|
3462
|
-
status: 401;
|
|
3463
|
-
data: HttpErrorResponseRead;
|
|
3464
|
-
} | {
|
|
3465
|
-
status: 404;
|
|
3466
|
-
data: HttpErrorResponseRead;
|
|
3467
|
-
} | {
|
|
3468
|
-
status: 422;
|
|
3469
|
-
} | {
|
|
3470
|
-
status: 500;
|
|
3471
|
-
data: HttpErrorResponseRead;
|
|
3472
|
-
} | {
|
|
3473
|
-
status: 503;
|
|
3474
|
-
data: HttpErrorResponseRead;
|
|
3475
|
-
}>(`/v2/repos/search-scm/${encodeURIComponent(searchId)}`, {
|
|
3476
|
-
...opts,
|
|
3477
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
3478
|
-
authorization
|
|
3479
|
-
})
|
|
3480
|
-
}));
|
|
3481
|
-
}
|
package/src/api/notification.ts
CHANGED
package/src/api-addresses.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import apisItauJson from './apis-itau.json' assert { type: 'json' }
|
|
2
1
|
import apisJson from './apis.json' assert { type: 'json' }
|
|
3
2
|
import { NetworkClient } from './network/NetworkClient'
|
|
4
|
-
import { Env
|
|
3
|
+
import { Env } from './network/types'
|
|
5
4
|
|
|
6
5
|
type ApisKeys = keyof typeof apisJson;
|
|
7
6
|
|
|
@@ -26,21 +25,6 @@ type ApiAddress = {
|
|
|
26
25
|
let defaultApis: Apis = apisJson;
|
|
27
26
|
let overrideApis: PartialApis = {};
|
|
28
27
|
|
|
29
|
-
const apis: Record<Tenant, Apis> = {
|
|
30
|
-
'stackspot': apisJson,
|
|
31
|
-
'itau': apisItauJson,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Returns the API catalog for the given tenant.
|
|
36
|
-
*
|
|
37
|
-
* @param tenant The current tenant (e.g., 'stackspot', 'itau').
|
|
38
|
-
* @returns Typed catalog containing the URLs per environment.
|
|
39
|
-
*/
|
|
40
|
-
export function getApisByTenant(tenant: Tenant) {
|
|
41
|
-
return apis[tenant]
|
|
42
|
-
}
|
|
43
|
-
|
|
44
28
|
function transformApisToApiAddress(apis: Apis, env: Env): ApiAddress {
|
|
45
29
|
const apiAddress: ApiAddress = {}
|
|
46
30
|
|
|
@@ -70,14 +54,12 @@ function matchesBaseUrl(baseUrl: Record<Env, string>, candidate: Record<Env, str
|
|
|
70
54
|
}
|
|
71
55
|
|
|
72
56
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* @param baseURL the default API base URL.
|
|
57
|
+
* Checks if there is override for the given base URL and target environment.
|
|
58
|
+
* @param baseURL the default API base URL to check for overrides.
|
|
76
59
|
* @param targetEnv the target environment
|
|
77
|
-
* @
|
|
78
|
-
* @returns {string} the base URL for the given environment and tenant, applying any overrides if available.
|
|
60
|
+
* @returns {string} the overriden base URL if found, otherwise the original API baseURL.
|
|
79
61
|
*/
|
|
80
|
-
export const
|
|
62
|
+
export const getBaseUrlWithOverride = (baseUrl: Record<Env, string>, targetEnv: Env = 'prd'): string => {
|
|
81
63
|
let matchesApiName: ApisKeys | null = null;
|
|
82
64
|
|
|
83
65
|
for (const [apiName, config] of Object.entries(defaultApis) as [ApisKeys, ApiConfig][]) {
|
|
@@ -87,15 +69,14 @@ export const getBaseUrlByTenantWithOverride = (baseUrl: Record<Env, string>, tar
|
|
|
87
69
|
}
|
|
88
70
|
}
|
|
89
71
|
|
|
90
|
-
if (
|
|
72
|
+
if (matchesApiName) {
|
|
73
|
+
const overrideUrl = overrideApis[matchesApiName]?.url?.[targetEnv];
|
|
91
74
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
75
|
+
if (overrideUrl) {
|
|
76
|
+
return overrideUrl;
|
|
77
|
+
}
|
|
95
78
|
}
|
|
96
|
-
|
|
97
|
-
const apis = getApisByTenant(tenant)
|
|
98
|
-
return apis[matchesApiName]?.url?.[targetEnv];
|
|
79
|
+
return baseUrl[targetEnv];
|
|
99
80
|
}
|
|
100
81
|
|
|
101
82
|
/**
|
package/src/client/ai.ts
CHANGED
package/src/client/code-shift.ts
CHANGED
|
@@ -58,11 +58,6 @@ import {
|
|
|
58
58
|
getModuleV1ModulesModuleIdGet,
|
|
59
59
|
analyticsProgramGroupsTargetDetailsV1AnalyticsProgramGroupsTargetDetailsGet,
|
|
60
60
|
analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGroupsTargetDetailsDownloadGet,
|
|
61
|
-
analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet,
|
|
62
|
-
analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet,
|
|
63
|
-
searchReposScmServiceV2ReposSearchScmPost,
|
|
64
|
-
importReposWithTagsScmServiceV2ReposSearchScmSearchIdPost,
|
|
65
|
-
searchReposScmV2V2ReposSearchScmSearchIdGet,
|
|
66
61
|
} from '../api/codeShift'
|
|
67
62
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
68
63
|
import { codeShiftDictionary } from '../error/dictionary/code-shift'
|
|
@@ -164,18 +159,6 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
164
159
|
* Downloads file with found repositories
|
|
165
160
|
*/
|
|
166
161
|
downloadSearchRepository = this.mutation(removeAuthorizationParam(downloadSearchReposScmServiceV1ReposSearchScmSearchRepoIdDownloadGet))
|
|
167
|
-
/**
|
|
168
|
-
* Searches for repositories (v2)
|
|
169
|
-
*/
|
|
170
|
-
searchRepositoryV2 = this.mutation(removeAuthorizationParam(searchReposScmServiceV2ReposSearchScmPost))
|
|
171
|
-
/**
|
|
172
|
-
* Imports repositories (v2)
|
|
173
|
-
*/
|
|
174
|
-
importRepositories = this.mutation(removeAuthorizationParam(importReposWithTagsScmServiceV2ReposSearchScmSearchIdPost))
|
|
175
|
-
/**
|
|
176
|
-
* Gets repositories search by id (v2)
|
|
177
|
-
*/
|
|
178
|
-
getRepositoriesBySearchId = this.query(removeAuthorizationParam(searchReposScmV2V2ReposSearchScmSearchIdGet))
|
|
179
162
|
/**
|
|
180
163
|
* Validate if the user has permission.
|
|
181
164
|
* We do not use opa in this api, so this is the fn needed to check permissions.
|
|
@@ -347,18 +330,6 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
347
330
|
analyticsProgramGroupsTargetDetailsDownload = this.query(
|
|
348
331
|
removeAuthorizationParam(analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGroupsTargetDetailsDownloadGet),
|
|
349
332
|
)
|
|
350
|
-
/**
|
|
351
|
-
* Analytics Repository Target Details
|
|
352
|
-
*/
|
|
353
|
-
analyticsRepositoryTargetDetails = this.query(
|
|
354
|
-
removeAuthorizationParam(analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet),
|
|
355
|
-
)
|
|
356
|
-
/**
|
|
357
|
-
* Analytics Repository Target Details Download
|
|
358
|
-
*/
|
|
359
|
-
analyticsRepositoryTargetDetailsDownload = this.query(
|
|
360
|
-
removeAuthorizationParam(analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet),
|
|
361
|
-
)
|
|
362
333
|
}
|
|
363
334
|
|
|
364
335
|
export const codeShiftClient = new CodeShift()
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { CancelledError } from '@tanstack/react-query'
|
|
2
|
-
export { apiAddresses, getApiAddresses,
|
|
2
|
+
export { apiAddresses, getApiAddresses, getBaseUrlWithOverride, setApisOverride } from './api-addresses'
|
|
3
3
|
export { accountClient } from './client/account'
|
|
4
|
+
export * from './client/discover'
|
|
4
5
|
export { agentClient } from './client/agent'
|
|
5
6
|
export { agentToolsClient } from './client/agent-tools'
|
|
6
7
|
export { aiClient } from './client/ai'
|
|
@@ -13,7 +14,6 @@ export { cloudServicesClient } from './client/cloud-services'
|
|
|
13
14
|
export { codeShiftClient } from './client/code-shift'
|
|
14
15
|
export { contentClient } from './client/content'
|
|
15
16
|
export { dataIntegrationClient } from './client/data-integration'
|
|
16
|
-
export * from './client/discover'
|
|
17
17
|
export { discoverClient } from './client/discover'
|
|
18
18
|
export { eventBusClient } from './client/event-bus'
|
|
19
19
|
export { genAiInferenceClient } from './client/gen-ai-inference'
|
|
@@ -35,10 +35,9 @@ export { StreamError } from './error/StreamError'
|
|
|
35
35
|
export { StreamJsonError } from './error/StreamJsonError'
|
|
36
36
|
export { NetworkClient } from './network/NetworkClient'
|
|
37
37
|
export { queryClient } from './network/react-query-client'
|
|
38
|
-
export {
|
|
38
|
+
export { OperationResult, OperationVariables, UseQueryObjectOptions } from './network/types'
|
|
39
39
|
export { StreamingStatus } from './types'
|
|
40
40
|
export { StreamedArray } from './utils/StreamedArray'
|
|
41
41
|
export { StreamedJson } from './utils/StreamedJson'
|
|
42
42
|
export { useExtendedList } from './utils/use-extended-list'
|
|
43
43
|
export { useStreamedArray } from './utils/use-streamed-array'
|
|
44
|
-
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AuthenticationError, SessionExpiredError } from '@stack-spot/auth'
|
|
2
2
|
import { requestPermission } from '@stack-spot/opa'
|
|
3
3
|
import { events } from 'fetch-event-stream'
|
|
4
|
-
import { getBaseUrlByTenantWithOverride } from '../api-addresses'
|
|
5
4
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
|
-
import { Env, FetchEventStream, HTTPMethod, SessionManager
|
|
5
|
+
import { Env, FetchEventStream, HTTPMethod, SessionManager } from './types'
|
|
6
|
+
import { getBaseUrlWithOverride } from '../api-addresses'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A set of methods for performing network requests to an API.
|
|
@@ -21,7 +21,6 @@ export abstract class NetworkClient {
|
|
|
21
21
|
private baseURL: Record<Env, string>
|
|
22
22
|
static readonly sessionManager?: SessionManager
|
|
23
23
|
private static env?: Env
|
|
24
|
-
private static tenant?: Tenant
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* @param baseURL An object with the keys "dev", "stg" and "prd". The values must be the url for each of these environments.
|
|
@@ -34,13 +33,11 @@ export abstract class NetworkClient {
|
|
|
34
33
|
* Sets up all network clients. Must be called before attempting to make any request.
|
|
35
34
|
* @param sessionManager An object with functions capable of checking, retrieving and ending the current session.
|
|
36
35
|
* @param env The environment to send the requests to.
|
|
37
|
-
* @param tenant - {@link Tenant} tenant identifier used to scope requests.
|
|
38
36
|
*/
|
|
39
|
-
static setup(sessionManager: SessionManager, env: Env
|
|
37
|
+
static setup(sessionManager: SessionManager, env: Env) {
|
|
40
38
|
//@ts-ignore This is the only place we would link session manager to be set.
|
|
41
39
|
NetworkClient.sessionManager = sessionManager
|
|
42
40
|
NetworkClient.env = env
|
|
43
|
-
NetworkClient.tenant = tenant
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
/**
|
|
@@ -65,7 +62,7 @@ export abstract class NetworkClient {
|
|
|
65
62
|
* @returns the final baseURL for the current environment, considering overrides if available.
|
|
66
63
|
*/
|
|
67
64
|
protected getBaseURL(): string {
|
|
68
|
-
return
|
|
65
|
+
return getBaseUrlWithOverride(this.baseURL, NetworkClient.env);
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
/**
|
package/src/network/types.ts
CHANGED