Revert "AAE-30882 Replace superagent (#11134)" (#11210)

* Revert "AAE-30882 Replace superagent (#11134)"

This reverts commit a347b20f20.

* AAE-0000 - Fixed lock for cli and adf
This commit is contained in:
Vito Albano
2025-09-19 12:44:06 +01:00
committed by GitHub
parent ef29bafc75
commit 91d6b80965
57 changed files with 3074 additions and 1051 deletions

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
import nock from 'nock';
import { BaseMock } from '../base.mock';
const fakeReportList = [
@@ -153,56 +154,58 @@ const fakeProcessDefinitionsNoApp: any[] = [
export class ReportsMock extends BaseMock {
get200ResponseCreateDefaultReport(): void {
this.createNockWithCors().post('/activiti-app/app/rest/reporting/default-reports').reply(200);
nock(this.host, { encodedQueryParams: true }).post('/activiti-app/app/rest/reporting/default-reports').reply(200);
}
get200ResponseTasksByProcessDefinitionId(reportId: string, processDefinitionId: string): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.get('/activiti-app/app/rest/reporting/report-params/' + reportId + '/tasks')
.query({ processDefinitionId })
.reply(200, ['Fake Task 1', 'Fake Task 2', 'Fake Task 3']);
}
get200ResponseReportList(): void {
this.createNockWithCors().get('/activiti-app/app/rest/reporting/reports').reply(200, fakeReportList);
nock(this.host, { encodedQueryParams: true }).get('/activiti-app/app/rest/reporting/reports').reply(200, fakeReportList);
}
get200ResponseReportParams(reportId: string): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.get('/activiti-app/app/rest/reporting/report-params/' + reportId)
.reply(200, fakeReportParams);
}
get200ResponseReportsByParams(reportId: string, paramsQuery: { status: string }): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.post('/activiti-app/app/rest/reporting/report-params/' + reportId, paramsQuery)
.reply(200, fakeChartReports);
}
get200ResponseProcessDefinitions(): void {
this.createNockWithCors().get('/activiti-app/app/rest/reporting/process-definitions').reply(200, fakeProcessDefinitionsNoApp);
nock(this.host, { encodedQueryParams: true })
.get('/activiti-app/app/rest/reporting/process-definitions')
.reply(200, fakeProcessDefinitionsNoApp);
}
get200ResponseUpdateReport(reportId: string): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.put('/activiti-app/app/rest/reporting/reports/' + reportId)
.reply(200);
}
get200ResponseExportReport(reportId: string): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.post('/activiti-app/app/rest/reporting/reports/' + reportId + '/export-to-csv')
.reply(200, 'CSV');
}
get200ResponseSaveReport(reportId: string): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.post('/activiti-app/app/rest/reporting/reports/' + reportId)
.reply(200);
}
get200ResponseDeleteReport(reportId: string): void {
this.createNockWithCors()
nock(this.host, { encodedQueryParams: true })
.delete('/activiti-app/app/rest/reporting/reports/' + reportId)
.reply(200);
}