diff --git a/estela-api/api/views/auth.py b/estela-api/api/views/auth.py index a14b52e6..62cf95de 100644 --- a/estela-api/api/views/auth.py +++ b/estela-api/api/views/auth.py @@ -47,7 +47,9 @@ def retry_send_verification_email(self, user, request): send_verification_email(user, request) @swagger_auto_schema( - methods=["POST"], responses={status.HTTP_200_OK: TokenSerializer()} + methods=["POST"], + responses={status.HTTP_200_OK: TokenSerializer()}, + tags=["auth"], ) @action(methods=["POST"], detail=False) def login(self, request, *args, **kwargs): @@ -70,7 +72,9 @@ def login(self, request, *args, **kwargs): return Response(TokenSerializer(token).data) @swagger_auto_schema( - methods=["POST"], responses={status.HTTP_200_OK: TokenSerializer()} + methods=["POST"], + responses={status.HTTP_200_OK: TokenSerializer()}, + tags=["auth"], ) @action(methods=["POST"], detail=False, serializer_class=UserSerializer) def register(self, request, *args, **kwargs): @@ -149,6 +153,7 @@ def get_queryset(self): @swagger_auto_schema( responses={status.HTTP_200_OK: UserProfileSerializer()}, + tags=["auth", "profile"], ) def retrieve(self, request, *args, **kwargs): user: User = request.user @@ -172,6 +177,7 @@ def retrieve(self, request, *args, **kwargs): @swagger_auto_schema( responses={status.HTTP_200_OK: UserProfileSerializer()}, + tags=["auth", "profile"], ) def update(self, request, *args, **kwargs): username = kwargs.get("username", "") @@ -201,6 +207,7 @@ class ChangePasswordViewSet(viewsets.GenericViewSet): @swagger_auto_schema( request_body=ChangePasswordSerializer, responses={status.HTTP_200_OK: TokenSerializer()}, + tags=["account"], ) @action( methods=["PATCH"], @@ -245,7 +252,9 @@ def get_parameters(self, request): return token, user_id @swagger_auto_schema( - methods=["POST"], responses={status.HTTP_200_OK: TokenSerializer()} + methods=["POST"], + responses={status.HTTP_200_OK: TokenSerializer()}, + tags=["account"], ) @action( methods=["POST"], @@ -288,6 +297,7 @@ def request(self, request, *args, **kwargs): }, ), }, + tags=["account"], ) @action(methods=["GET"], detail=False) def validate(self, request, *args, **kwargs): @@ -318,6 +328,7 @@ def validate(self, request, *args, **kwargs): }, ), }, + tags=["account"], ) @action( methods=["PATCH"], detail=False, serializer_class=ResetPasswordConfirmSerializer diff --git a/estela-api/api/views/cronjob.py b/estela-api/api/views/cronjob.py index 84ad46ae..e7e294f5 100644 --- a/estela-api/api/views/cronjob.py +++ b/estela-api/api/views/cronjob.py @@ -56,6 +56,7 @@ def get_queryset(self): description="Cron job tag.", ), ], + tags=["project", "spider", "cronjob"], ) def list(self, *args, **kwargs): return super(SpiderCronJobViewSet, self).list(*args, **kwargs) @@ -63,6 +64,7 @@ def list(self, *args, **kwargs): @swagger_auto_schema( request_body=SpiderCronJobCreateSerializer, responses={status.HTTP_201_CREATED: SpiderCronJobCreateSerializer()}, + tags=["project", "spider", "cronjob"], ) def create(self, request, *args, **kwargs): spider = get_object_or_404(Spider, sid=self.kwargs["sid"], deleted=False) @@ -101,6 +103,7 @@ def create(self, request, *args, **kwargs): @swagger_auto_schema( request_body=SpiderCronJobUpdateSerializer, responses={status.HTTP_200_OK: SpiderCronJobUpdateSerializer()}, + tags=["project", "spider", "cronjob"], ) def update(self, request, *args, **kwargs): partial = kwargs.pop("partial", False) @@ -118,6 +121,7 @@ def update(self, request, *args, **kwargs): @swagger_auto_schema( responses={status.HTTP_204_NO_CONTENT: "Cronjob deleted"}, + tags=["project", "spider", "cronjob"], ) def destroy(self, request, *args, **kwargs): instance = self.get_object() @@ -131,7 +135,9 @@ def perform_destroy(self, instance): instance.save() @swagger_auto_schema( - methods=["GET"], responses={status.HTTP_200_OK: SpiderCronJobSerializer()} + methods=["GET"], + responses={status.HTTP_200_OK: SpiderCronJobSerializer()}, + tags=["project", "spider", "cronjob"], ) @action(methods=["GET"], detail=True) def run_once(self, request, *args, **kwargs): diff --git a/estela-api/api/views/deploy.py b/estela-api/api/views/deploy.py index 882d09a8..715f5efc 100644 --- a/estela-api/api/views/deploy.py +++ b/estela-api/api/views/deploy.py @@ -40,6 +40,7 @@ def get_queryset(self): @swagger_auto_schema( request_body=DeployCreateSerializer, responses={status.HTTP_201_CREATED: DeployCreateSerializer()}, + tags=["project", "deploy"], ) def create(self, request, *args, **kwargs): project = get_object_or_404(Project, pid=self.kwargs["pid"]) @@ -74,6 +75,7 @@ def create(self, request, *args, **kwargs): @swagger_auto_schema( request_body=DeployUpdateSerializer, responses={status.HTTP_200_OK: DeployUpdateSerializer()}, + tags=["project", "deploy"], ) def update(self, request, *args, **kwargs): if not request.user.is_superuser: diff --git a/estela-api/api/views/job.py b/estela-api/api/views/job.py index 14414d4e..327f2df2 100644 --- a/estela-api/api/views/job.py +++ b/estela-api/api/views/job.py @@ -80,6 +80,7 @@ def get_queryset(self): description="Job tag.", ), ], + tags=["project", "spider", "job"], ) def list(self, *args, **kwargs): return super(SpiderJobViewSet, self).list(*args, **kwargs) @@ -95,6 +96,7 @@ def list(self, *args, **kwargs): ], request_body=SpiderJobCreateSerializer, responses={status.HTTP_201_CREATED: SpiderJobCreateSerializer()}, + tags=["project", "spider", "job"], ) def create(self, request, *args, **kwargs): spider = get_object_or_404(Spider, sid=self.kwargs["sid"], deleted=False) @@ -146,6 +148,7 @@ def create(self, request, *args, **kwargs): @swagger_auto_schema( request_body=SpiderJobUpdateSerializer, responses={status.HTTP_200_OK: SpiderJobUpdateSerializer()}, + tags=["project", "spider", "job"], ) def update(self, request, *args, **kwargs): partial = kwargs.pop("partial", False) diff --git a/estela-api/api/views/job_data.py b/estela-api/api/views/job_data.py index ae57201e..f3f181d4 100644 --- a/estela-api/api/views/job_data.py +++ b/estela-api/api/views/job_data.py @@ -85,6 +85,7 @@ def get_paginated_link(self, page_number): required=False, ), ], + tags=["project", "spider", "job", "job-data"], ) def list(self, request, *args, **kwargs): page, data_type, mode, page_size = self.get_parameters(request) @@ -193,6 +194,7 @@ def list(self, request, *args, **kwargs): required=True, ), ], + tags=["project", "spider", "job", "job-data"], ) @action(methods=["POST"], detail=False) def delete(self, request, *args, **kwargs): diff --git a/estela-api/api/views/project.py b/estela-api/api/views/project.py index c691604a..f2bff0a3 100644 --- a/estela-api/api/views/project.py +++ b/estela-api/api/views/project.py @@ -74,6 +74,7 @@ def perform_create(self, serializer): @swagger_auto_schema( request_body=ProjectUpdateSerializer, responses={status.HTTP_200_OK: ProjectUpdateSerializer()}, + tags=["project"], ) def update(self, request, *args, **kwargs): partial = kwargs.pop("partial", False) @@ -137,6 +138,7 @@ def update(self, request, *args, **kwargs): @swagger_auto_schema( responses={status.HTTP_204_NO_CONTENT: "Project deleted"}, + tags=["project"], ) def destroy(self, request, *args, **kwargs): instance = self.get_object() @@ -166,6 +168,7 @@ def perform_destroy(self, instance): ), ], responses={status.HTTP_200_OK: ProjectJobSerializer()}, + tags=["project"], ) @action(methods=["GET"], detail=True) def jobs(self, request, *args, **kwargs): @@ -205,6 +208,7 @@ def jobs(self, request, *args, **kwargs): ), ], responses={status.HTTP_200_OK: ProjectCronJobSerializer()}, + tags=["project"], ) @action(methods=["GET"], detail=True) def cronjobs(self, request, *args, **kwargs): @@ -227,6 +231,7 @@ def cronjobs(self, request, *args, **kwargs): @swagger_auto_schema( methods=["GET"], responses={status.HTTP_200_OK: ProjectUsageSerializer()}, + tags=["project"], ) @action(methods=["GET"], detail=True) def current_usage(self, request, *args, **kwargs): @@ -258,6 +263,7 @@ def current_usage(self, request, *args, **kwargs): ), ], responses={status.HTTP_200_OK: UsageRecordSerializer(many=True)}, + tags=["project"], ) @action(methods=["GET"], detail=True) def usage(self, request, *args, **kwargs): diff --git a/estela-api/api/views/spider.py b/estela-api/api/views/spider.py index 4479374d..c7503d5b 100644 --- a/estela-api/api/views/spider.py +++ b/estela-api/api/views/spider.py @@ -26,6 +26,7 @@ def get_queryset(self): @swagger_auto_schema( request_body=SpiderUpdateSerializer, responses={status.HTTP_200_OK: SpiderUpdateSerializer()}, + tags=["project", "spider"], ) def update(self, request, *args, **kwargs): partial = kwargs.pop("partial", False) diff --git a/estela-api/docs/api.yaml b/estela-api/docs/api.yaml index cfa2530c..2d11eff9 100644 --- a/estela-api/docs/api.yaml +++ b/estela-api/docs/api.yaml @@ -33,7 +33,7 @@ paths: schema: $ref: '#/definitions/Token' tags: - - api + - account parameters: [] /api/account/resetPassword/confirm: patch: @@ -68,7 +68,7 @@ paths: error: type: string tags: - - api + - account parameters: [] /api/account/resetPassword/request: post: @@ -119,7 +119,7 @@ paths: message: type: string tags: - - api + - account parameters: [] /api/auth/activate: get: @@ -152,7 +152,7 @@ paths: schema: $ref: '#/definitions/Token' tags: - - api + - auth parameters: [] /api/auth/profile: get: @@ -196,7 +196,8 @@ paths: schema: $ref: '#/definitions/UserProfile' tags: - - api + - auth + - profile put: operationId: api_auth_profile_update description: '' @@ -212,7 +213,8 @@ paths: schema: $ref: '#/definitions/UserProfile' tags: - - api + - auth + - profile patch: operationId: api_auth_profile_partial_update description: '' @@ -262,7 +264,7 @@ paths: schema: $ref: '#/definitions/Token' tags: - - api + - auth parameters: [] /api/projects: get: @@ -348,7 +350,7 @@ paths: schema: $ref: '#/definitions/ProjectUpdate' tags: - - api + - project patch: operationId: api_projects_partial_update description: '' @@ -373,7 +375,7 @@ paths: '204': description: Project deleted tags: - - api + - project parameters: - name: pid in: path @@ -402,7 +404,7 @@ paths: schema: $ref: '#/definitions/ProjectCronJob' tags: - - api + - project parameters: - name: pid in: path @@ -421,7 +423,7 @@ paths: schema: $ref: '#/definitions/ProjectUsage' tags: - - api + - project parameters: - name: pid in: path @@ -484,7 +486,8 @@ paths: schema: $ref: '#/definitions/DeployCreate' tags: - - api + - project + - deploy parameters: - name: pid in: path @@ -517,7 +520,8 @@ paths: schema: $ref: '#/definitions/DeployUpdate' tags: - - api + - project + - deploy patch: operationId: api_projects_deploys_partial_update description: '' @@ -574,7 +578,7 @@ paths: schema: $ref: '#/definitions/ProjectJob' tags: - - api + - project parameters: - name: pid in: path @@ -654,7 +658,8 @@ paths: schema: $ref: '#/definitions/SpiderUpdate' tags: - - api + - project + - spider patch: operationId: api_projects_spiders_partial_update description: '' @@ -725,7 +730,9 @@ paths: items: $ref: '#/definitions/SpiderCronJob' tags: - - api + - project + - spider + - cronjob post: operationId: api_projects_spiders_cronjobs_create description: '' @@ -741,7 +748,9 @@ paths: schema: $ref: '#/definitions/SpiderCronJobCreate' tags: - - api + - project + - spider + - cronjob parameters: - name: pid in: path @@ -778,7 +787,9 @@ paths: schema: $ref: '#/definitions/SpiderCronJobUpdate' tags: - - api + - project + - spider + - cronjob patch: operationId: api_projects_spiders_cronjobs_partial_update description: '' @@ -803,7 +814,9 @@ paths: '204': description: Cronjob deleted tags: - - api + - project + - spider + - cronjob parameters: - name: cjid in: path @@ -829,7 +842,9 @@ paths: schema: $ref: '#/definitions/SpiderCronJob' tags: - - api + - project + - spider + - cronjob parameters: - name: cjid in: path @@ -898,7 +913,9 @@ paths: items: $ref: '#/definitions/SpiderJob' tags: - - api + - project + - spider + - job post: operationId: api_projects_spiders_jobs_create description: '' @@ -918,7 +935,9 @@ paths: schema: $ref: '#/definitions/SpiderJobCreate' tags: - - api + - project + - spider + - job parameters: - name: pid in: path @@ -955,7 +974,9 @@ paths: schema: $ref: '#/definitions/SpiderJobUpdate' tags: - - api + - project + - spider + - job patch: operationId: api_projects_spiders_jobs_partial_update description: '' @@ -1034,7 +1055,10 @@ paths: items: type: object tags: - - api + - project + - spider + - job + - job-data parameters: - name: jid in: path @@ -1064,7 +1088,10 @@ paths: schema: $ref: '#/definitions/DeleteJobData' tags: - - api + - project + - spider + - job + - job-data parameters: - name: jid in: path @@ -1101,7 +1128,7 @@ paths: items: $ref: '#/definitions/UsageRecord' tags: - - api + - project parameters: - name: pid in: path diff --git a/estela-web/src/services/api/generated-api/.openapi-generator/FILES b/estela-web/src/services/api/generated-api/.openapi-generator/FILES index 63148c5c..33e03ba4 100644 --- a/estela-web/src/services/api/generated-api/.openapi-generator/FILES +++ b/estela-web/src/services/api/generated-api/.openapi-generator/FILES @@ -1,5 +1,14 @@ .openapi-generator-ignore +apis/AccountApi.ts apis/ApiApi.ts +apis/AuthApi.ts +apis/CronjobApi.ts +apis/DeployApi.ts +apis/JobApi.ts +apis/JobDataApi.ts +apis/ProfileApi.ts +apis/ProjectApi.ts +apis/SpiderApi.ts apis/index.ts index.ts models/AuthToken.ts diff --git a/estela-web/src/services/api/generated-api/apis/AccountApi.ts b/estela-web/src/services/api/generated-api/apis/AccountApi.ts new file mode 100644 index 00000000..62f6dbd4 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/AccountApi.ts @@ -0,0 +1,182 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + ChangePassword, + ChangePasswordFromJSON, + ChangePasswordToJSON, + InlineResponse200, + InlineResponse200FromJSON, + InlineResponse200ToJSON, + InlineResponse401, + InlineResponse401FromJSON, + InlineResponse401ToJSON, + ResetPasswordConfirm, + ResetPasswordConfirmFromJSON, + ResetPasswordConfirmToJSON, + Token, + TokenFromJSON, + TokenToJSON, +} from '../models'; + +export interface ApiAccountChangePasswordChangeRequest { + data: ChangePassword; +} + +export interface ApiAccountResetPasswordConfirmRequest { + token: string; + pair: string; + data: ResetPasswordConfirm; +} + +export interface ApiAccountResetPasswordValidateRequest { + token: string; + pair: string; +} + +/** + * + */ +export class AccountApi extends runtime.BaseAPI { + + /** + */ + async apiAccountChangePasswordChangeRaw(requestParameters: ApiAccountChangePasswordChangeRequest): Promise> { + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAccountChangePasswordChange.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/account/changePassword/change`, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: ChangePasswordToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); + } + + /** + */ + async apiAccountChangePasswordChange(requestParameters: ApiAccountChangePasswordChangeRequest): Promise { + const response = await this.apiAccountChangePasswordChangeRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiAccountResetPasswordConfirmRaw(requestParameters: ApiAccountResetPasswordConfirmRequest): Promise> { + if (requestParameters.token === null || requestParameters.token === undefined) { + throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling apiAccountResetPasswordConfirm.'); + } + + if (requestParameters.pair === null || requestParameters.pair === undefined) { + throw new runtime.RequiredError('pair','Required parameter requestParameters.pair was null or undefined when calling apiAccountResetPasswordConfirm.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAccountResetPasswordConfirm.'); + } + + const queryParameters: any = {}; + + if (requestParameters.token !== undefined) { + queryParameters['token'] = requestParameters.token; + } + + if (requestParameters.pair !== undefined) { + queryParameters['pair'] = requestParameters.pair; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/account/resetPassword/confirm`, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: ResetPasswordConfirmToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); + } + + /** + */ + async apiAccountResetPasswordConfirm(requestParameters: ApiAccountResetPasswordConfirmRequest): Promise { + const response = await this.apiAccountResetPasswordConfirmRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiAccountResetPasswordValidateRaw(requestParameters: ApiAccountResetPasswordValidateRequest): Promise> { + if (requestParameters.token === null || requestParameters.token === undefined) { + throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling apiAccountResetPasswordValidate.'); + } + + if (requestParameters.pair === null || requestParameters.pair === undefined) { + throw new runtime.RequiredError('pair','Required parameter requestParameters.pair was null or undefined when calling apiAccountResetPasswordValidate.'); + } + + const queryParameters: any = {}; + + if (requestParameters.token !== undefined) { + queryParameters['token'] = requestParameters.token; + } + + if (requestParameters.pair !== undefined) { + queryParameters['pair'] = requestParameters.pair; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/account/resetPassword/validate`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse200FromJSON(jsonValue)); + } + + /** + */ + async apiAccountResetPasswordValidate(requestParameters: ApiAccountResetPasswordValidateRequest): Promise { + const response = await this.apiAccountResetPasswordValidateRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/ApiApi.ts b/estela-web/src/services/api/generated-api/apis/ApiApi.ts index c0470f45..d327ed3c 100644 --- a/estela-web/src/services/api/generated-api/apis/ApiApi.ts +++ b/estela-web/src/services/api/generated-api/apis/ApiApi.ts @@ -18,24 +18,9 @@ import { AuthToken, AuthTokenFromJSON, AuthTokenToJSON, - ChangePassword, - ChangePasswordFromJSON, - ChangePasswordToJSON, - DeleteJobData, - DeleteJobDataFromJSON, - DeleteJobDataToJSON, Deploy, DeployFromJSON, DeployToJSON, - DeployCreate, - DeployCreateFromJSON, - DeployCreateToJSON, - DeployUpdate, - DeployUpdateFromJSON, - DeployUpdateToJSON, - InlineResponse200, - InlineResponse200FromJSON, - InlineResponse200ToJSON, InlineResponse2001, InlineResponse2001FromJSON, InlineResponse2001ToJSON, @@ -45,36 +30,9 @@ import { InlineResponse2003, InlineResponse2003FromJSON, InlineResponse2003ToJSON, - InlineResponse2004, - InlineResponse2004FromJSON, - InlineResponse2004ToJSON, - InlineResponse2005, - InlineResponse2005FromJSON, - InlineResponse2005ToJSON, - InlineResponse2006, - InlineResponse2006FromJSON, - InlineResponse2006ToJSON, - InlineResponse401, - InlineResponse401FromJSON, - InlineResponse401ToJSON, Project, ProjectFromJSON, ProjectToJSON, - ProjectCronJob, - ProjectCronJobFromJSON, - ProjectCronJobToJSON, - ProjectJob, - ProjectJobFromJSON, - ProjectJobToJSON, - ProjectUpdate, - ProjectUpdateFromJSON, - ProjectUpdateToJSON, - ProjectUsage, - ProjectUsageFromJSON, - ProjectUsageToJSON, - ResetPasswordConfirm, - ResetPasswordConfirmFromJSON, - ResetPasswordConfirmToJSON, ResetPasswordRequest, ResetPasswordRequestFromJSON, ResetPasswordRequestToJSON, @@ -84,61 +42,18 @@ import { SpiderCronJob, SpiderCronJobFromJSON, SpiderCronJobToJSON, - SpiderCronJobCreate, - SpiderCronJobCreateFromJSON, - SpiderCronJobCreateToJSON, - SpiderCronJobUpdate, - SpiderCronJobUpdateFromJSON, - SpiderCronJobUpdateToJSON, SpiderJob, SpiderJobFromJSON, SpiderJobToJSON, - SpiderJobCreate, - SpiderJobCreateFromJSON, - SpiderJobCreateToJSON, - SpiderJobUpdate, - SpiderJobUpdateFromJSON, - SpiderJobUpdateToJSON, - SpiderUpdate, - SpiderUpdateFromJSON, - SpiderUpdateToJSON, - Token, - TokenFromJSON, - TokenToJSON, - UsageRecord, - UsageRecordFromJSON, - UsageRecordToJSON, - User, - UserFromJSON, - UserToJSON, UserProfile, UserProfileFromJSON, UserProfileToJSON, } from '../models'; -export interface ApiAccountChangePasswordChangeRequest { - data: ChangePassword; -} - -export interface ApiAccountResetPasswordConfirmRequest { - token: string; - pair: string; - data: ResetPasswordConfirm; -} - export interface ApiAccountResetPasswordRequestRequest { data: ResetPasswordRequest; } -export interface ApiAccountResetPasswordValidateRequest { - token: string; - pair: string; -} - -export interface ApiAuthLoginRequest { - data: AuthToken; -} - export interface ApiAuthProfileCreateRequest { data: UserProfile; } @@ -152,42 +67,10 @@ export interface ApiAuthProfilePartialUpdateRequest { data: UserProfile; } -export interface ApiAuthProfileReadRequest { - username: string; -} - -export interface ApiAuthProfileUpdateRequest { - username: string; - data: UserProfile; -} - -export interface ApiAuthRegisterRequest { - data: User; -} - export interface ApiProjectsCreateRequest { data: Project; } -export interface ApiProjectsCronjobsRequest { - pid: string; - page?: number; - pageSize?: number; -} - -export interface ApiProjectsCurrentUsageRequest { - pid: string; -} - -export interface ApiProjectsDeleteRequest { - pid: string; -} - -export interface ApiProjectsDeploysCreateRequest { - pid: string; - data: DeployCreate; -} - export interface ApiProjectsDeploysDeleteRequest { did: number; pid: string; @@ -210,18 +93,6 @@ export interface ApiProjectsDeploysReadRequest { pid: string; } -export interface ApiProjectsDeploysUpdateRequest { - did: number; - pid: string; - data: DeployUpdate; -} - -export interface ApiProjectsJobsRequest { - pid: string; - page?: number; - pageSize?: number; -} - export interface ApiProjectsListRequest { page?: number; pageSize?: number; @@ -236,26 +107,6 @@ export interface ApiProjectsReadRequest { pid: string; } -export interface ApiProjectsSpidersCronjobsCreateRequest { - pid: string; - sid: string; - data: SpiderCronJobCreate; -} - -export interface ApiProjectsSpidersCronjobsDeleteRequest { - cjid: number; - pid: string; - sid: string; -} - -export interface ApiProjectsSpidersCronjobsListRequest { - pid: string; - sid: string; - tag?: string; - page?: number; - pageSize?: number; -} - export interface ApiProjectsSpidersCronjobsPartialUpdateRequest { cjid: number; pid: string; @@ -269,52 +120,6 @@ export interface ApiProjectsSpidersCronjobsReadRequest { sid: string; } -export interface ApiProjectsSpidersCronjobsRunOnceRequest { - cjid: number; - pid: string; - sid: string; -} - -export interface ApiProjectsSpidersCronjobsUpdateRequest { - cjid: number; - pid: string; - sid: string; - data: SpiderCronJobUpdate; -} - -export interface ApiProjectsSpidersJobsCreateRequest { - pid: string; - sid: string; - data: SpiderJobCreate; - async?: boolean; -} - -export interface ApiProjectsSpidersJobsDataDeleteRequest { - jid: string; - pid: string; - sid: string; - type: string; -} - -export interface ApiProjectsSpidersJobsDataListRequest { - jid: string; - pid: string; - sid: string; - page?: number; - pageSize?: number; - type?: string; -} - -export interface ApiProjectsSpidersJobsListRequest { - pid: string; - sid: string; - cronjob?: number; - status?: string; - tag?: string; - page?: number; - pageSize?: number; -} - export interface ApiProjectsSpidersJobsPartialUpdateRequest { jid: number; pid: string; @@ -328,13 +133,6 @@ export interface ApiProjectsSpidersJobsReadRequest { sid: string; } -export interface ApiProjectsSpidersJobsUpdateRequest { - jid: number; - pid: string; - sid: string; - data: SpiderJobUpdate; -} - export interface ApiProjectsSpidersListRequest { pid: string; page?: number; @@ -352,112 +150,11 @@ export interface ApiProjectsSpidersReadRequest { sid: number; } -export interface ApiProjectsSpidersUpdateRequest { - pid: string; - sid: number; - data: SpiderUpdate; -} - -export interface ApiProjectsUpdateRequest { - pid: string; - data: ProjectUpdate; -} - -export interface ApiProjectsUsageRequest { - pid: string; - startDate?: string; - endDate?: string; -} - /** * */ export class ApiApi extends runtime.BaseAPI { - /** - */ - async apiAccountChangePasswordChangeRaw(requestParameters: ApiAccountChangePasswordChangeRequest): Promise> { - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAccountChangePasswordChange.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/account/changePassword/change`, - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: ChangePasswordToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); - } - - /** - */ - async apiAccountChangePasswordChange(requestParameters: ApiAccountChangePasswordChangeRequest): Promise { - const response = await this.apiAccountChangePasswordChangeRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiAccountResetPasswordConfirmRaw(requestParameters: ApiAccountResetPasswordConfirmRequest): Promise> { - if (requestParameters.token === null || requestParameters.token === undefined) { - throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling apiAccountResetPasswordConfirm.'); - } - - if (requestParameters.pair === null || requestParameters.pair === undefined) { - throw new runtime.RequiredError('pair','Required parameter requestParameters.pair was null or undefined when calling apiAccountResetPasswordConfirm.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAccountResetPasswordConfirm.'); - } - - const queryParameters: any = {}; - - if (requestParameters.token !== undefined) { - queryParameters['token'] = requestParameters.token; - } - - if (requestParameters.pair !== undefined) { - queryParameters['pair'] = requestParameters.pair; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/account/resetPassword/confirm`, - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: ResetPasswordConfirmToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); - } - - /** - */ - async apiAccountResetPasswordConfirm(requestParameters: ApiAccountResetPasswordConfirmRequest): Promise { - const response = await this.apiAccountResetPasswordConfirmRaw(requestParameters); - return await response.value(); - } - /** */ async apiAccountResetPasswordRequestRaw(requestParameters: ApiAccountResetPasswordRequestRequest): Promise> { @@ -492,49 +189,6 @@ export class ApiApi extends runtime.BaseAPI { return await response.value(); } - /** - */ - async apiAccountResetPasswordValidateRaw(requestParameters: ApiAccountResetPasswordValidateRequest): Promise> { - if (requestParameters.token === null || requestParameters.token === undefined) { - throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling apiAccountResetPasswordValidate.'); - } - - if (requestParameters.pair === null || requestParameters.pair === undefined) { - throw new runtime.RequiredError('pair','Required parameter requestParameters.pair was null or undefined when calling apiAccountResetPasswordValidate.'); - } - - const queryParameters: any = {}; - - if (requestParameters.token !== undefined) { - queryParameters['token'] = requestParameters.token; - } - - if (requestParameters.pair !== undefined) { - queryParameters['pair'] = requestParameters.pair; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/account/resetPassword/validate`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse200FromJSON(jsonValue)); - } - - /** - */ - async apiAccountResetPasswordValidate(requestParameters: ApiAccountResetPasswordValidateRequest): Promise { - const response = await this.apiAccountResetPasswordValidateRaw(requestParameters); - return await response.value(); - } - /** */ async apiAuthActivateRaw(): Promise>> { @@ -562,40 +216,6 @@ export class ApiApi extends runtime.BaseAPI { return await response.value(); } - /** - */ - async apiAuthLoginRaw(requestParameters: ApiAuthLoginRequest): Promise> { - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthLogin.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/auth/login`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: AuthTokenToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); - } - - /** - */ - async apiAuthLogin(requestParameters: ApiAuthLoginRequest): Promise { - const response = await this.apiAuthLoginRaw(requestParameters); - return await response.value(); - } - /** */ async apiAuthProfileCreateRaw(requestParameters: ApiAuthProfileCreateRequest): Promise> { @@ -727,1080 +347,193 @@ export class ApiApi extends runtime.BaseAPI { /** */ - async apiAuthProfileReadRaw(requestParameters: ApiAuthProfileReadRequest): Promise> { - if (requestParameters.username === null || requestParameters.username === undefined) { - throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiAuthProfileRead.'); + async apiProjectsCreateRaw(requestParameters: ApiProjectsCreateRequest): Promise> { + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsCreate.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; + headerParameters['Content-Type'] = 'application/json'; + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/auth/profile/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), - method: 'GET', + path: `/api/projects`, + method: 'POST', headers: headerParameters, query: queryParameters, + body: ProjectToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue)); } /** */ - async apiAuthProfileRead(requestParameters: ApiAuthProfileReadRequest): Promise { - const response = await this.apiAuthProfileReadRaw(requestParameters); + async apiProjectsCreate(requestParameters: ApiProjectsCreateRequest): Promise { + const response = await this.apiProjectsCreateRaw(requestParameters); return await response.value(); } /** */ - async apiAuthProfileUpdateRaw(requestParameters: ApiAuthProfileUpdateRequest): Promise> { - if (requestParameters.username === null || requestParameters.username === undefined) { - throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiAuthProfileUpdate.'); + async apiProjectsDeploysDeleteRaw(requestParameters: ApiProjectsDeploysDeleteRequest): Promise> { + if (requestParameters.did === null || requestParameters.did === undefined) { + throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysDelete.'); } - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthProfileUpdate.'); + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysDelete.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; - headerParameters['Content-Type'] = 'application/json'; - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/auth/profile/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: UserProfileToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue)); - } - - /** - */ - async apiAuthProfileUpdate(requestParameters: ApiAuthProfileUpdateRequest): Promise { - const response = await this.apiAuthProfileUpdateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiAuthRegisterRaw(requestParameters: ApiAuthRegisterRequest): Promise> { - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthRegister.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/auth/register`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: UserToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); - } - - /** - */ - async apiAuthRegister(requestParameters: ApiAuthRegisterRequest): Promise { - const response = await this.apiAuthRegisterRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsCreateRaw(requestParameters: ApiProjectsCreateRequest): Promise> { - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsCreate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: ProjectToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsCreate(requestParameters: ApiProjectsCreateRequest): Promise { - const response = await this.apiProjectsCreateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsCronjobsRaw(requestParameters: ApiProjectsCronjobsRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsCronjobs.'); - } - - const queryParameters: any = {}; - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectCronJobFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsCronjobs(requestParameters: ApiProjectsCronjobsRequest): Promise { - const response = await this.apiProjectsCronjobsRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsCurrentUsageRaw(requestParameters: ApiProjectsCurrentUsageRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsCurrentUsage.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/current_usage`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectUsageFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsCurrentUsage(requestParameters: ApiProjectsCurrentUsageRequest): Promise { - const response = await this.apiProjectsCurrentUsageRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsDeleteRaw(requestParameters: ApiProjectsDeleteRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDelete.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.VoidApiResponse(response); - } - - /** - */ - async apiProjectsDelete(requestParameters: ApiProjectsDeleteRequest): Promise { - await this.apiProjectsDeleteRaw(requestParameters); - } - - /** - */ - async apiProjectsDeploysCreateRaw(requestParameters: ApiProjectsDeploysCreateRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysCreate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysCreate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/deploys`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: DeployCreateToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => DeployCreateFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsDeploysCreate(requestParameters: ApiProjectsDeploysCreateRequest): Promise { - const response = await this.apiProjectsDeploysCreateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsDeploysDeleteRaw(requestParameters: ApiProjectsDeploysDeleteRequest): Promise> { - if (requestParameters.did === null || requestParameters.did === undefined) { - throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysDelete.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysDelete.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.VoidApiResponse(response); - } - - /** - */ - async apiProjectsDeploysDelete(requestParameters: ApiProjectsDeploysDeleteRequest): Promise { - await this.apiProjectsDeploysDeleteRaw(requestParameters); - } - - /** - */ - async apiProjectsDeploysListRaw(requestParameters: ApiProjectsDeploysListRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysList.'); - } - - const queryParameters: any = {}; - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/deploys`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2002FromJSON(jsonValue)); - } - - /** - */ - async apiProjectsDeploysList(requestParameters: ApiProjectsDeploysListRequest): Promise { - const response = await this.apiProjectsDeploysListRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsDeploysPartialUpdateRaw(requestParameters: ApiProjectsDeploysPartialUpdateRequest): Promise> { - if (requestParameters.did === null || requestParameters.did === undefined) { - throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysPartialUpdate.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysPartialUpdate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysPartialUpdate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: DeployToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => DeployFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsDeploysPartialUpdate(requestParameters: ApiProjectsDeploysPartialUpdateRequest): Promise { - const response = await this.apiProjectsDeploysPartialUpdateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsDeploysReadRaw(requestParameters: ApiProjectsDeploysReadRequest): Promise> { - if (requestParameters.did === null || requestParameters.did === undefined) { - throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysRead.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => DeployFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsDeploysRead(requestParameters: ApiProjectsDeploysReadRequest): Promise { - const response = await this.apiProjectsDeploysReadRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsDeploysUpdateRaw(requestParameters: ApiProjectsDeploysUpdateRequest): Promise> { - if (requestParameters.did === null || requestParameters.did === undefined) { - throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysUpdate.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysUpdate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysUpdate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: DeployUpdateToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => DeployUpdateFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsDeploysUpdate(requestParameters: ApiProjectsDeploysUpdateRequest): Promise { - const response = await this.apiProjectsDeploysUpdateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsJobsRaw(requestParameters: ApiProjectsJobsRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsJobs.'); - } - - const queryParameters: any = {}; - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectJobFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsJobs(requestParameters: ApiProjectsJobsRequest): Promise { - const response = await this.apiProjectsJobsRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsListRaw(requestParameters: ApiProjectsListRequest): Promise> { - const queryParameters: any = {}; - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2001FromJSON(jsonValue)); - } - - /** - */ - async apiProjectsList(requestParameters: ApiProjectsListRequest): Promise { - const response = await this.apiProjectsListRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsPartialUpdateRaw(requestParameters: ApiProjectsPartialUpdateRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsPartialUpdate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsPartialUpdate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: ProjectToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsPartialUpdate(requestParameters: ApiProjectsPartialUpdateRequest): Promise { - const response = await this.apiProjectsPartialUpdateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsReadRaw(requestParameters: ApiProjectsReadRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsRead(requestParameters: ApiProjectsReadRequest): Promise { - const response = await this.apiProjectsReadRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsSpidersCronjobsCreateRaw(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: SpiderCronJobCreateToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobCreateFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsSpidersCronjobsCreate(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise { - const response = await this.apiProjectsSpidersCronjobsCreateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsSpidersCronjobsDeleteRaw(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise> { - if (requestParameters.cjid === null || requestParameters.cjid === undefined) { - throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.VoidApiResponse(response); - } - - /** - */ - async apiProjectsSpidersCronjobsDelete(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise { - await this.apiProjectsSpidersCronjobsDeleteRaw(requestParameters); - } - - /** - */ - async apiProjectsSpidersCronjobsListRaw(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsList.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsList.'); - } - - const queryParameters: any = {}; - - if (requestParameters.tag !== undefined) { - queryParameters['tag'] = requestParameters.tag; - } - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2004FromJSON(jsonValue)); - } - - /** - */ - async apiProjectsSpidersCronjobsList(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise { - const response = await this.apiProjectsSpidersCronjobsListRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsSpidersCronjobsPartialUpdateRaw(requestParameters: ApiProjectsSpidersCronjobsPartialUpdateRequest): Promise> { - if (requestParameters.cjid === null || requestParameters.cjid === undefined) { - throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'PATCH', - headers: headerParameters, - query: queryParameters, - body: SpiderCronJobToJSON(requestParameters.data), - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsSpidersCronjobsPartialUpdate(requestParameters: ApiProjectsSpidersCronjobsPartialUpdateRequest): Promise { - const response = await this.apiProjectsSpidersCronjobsPartialUpdateRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsSpidersCronjobsReadRaw(requestParameters: ApiProjectsSpidersCronjobsReadRequest): Promise> { - if (requestParameters.cjid === null || requestParameters.cjid === undefined) { - throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsRead.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsRead.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsRead.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsSpidersCronjobsRead(requestParameters: ApiProjectsSpidersCronjobsReadRequest): Promise { - const response = await this.apiProjectsSpidersCronjobsReadRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsSpidersCronjobsRunOnceRaw(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise> { - if (requestParameters.cjid === null || requestParameters.cjid === undefined) { - throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}/run_once`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }); - - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); - } - - /** - */ - async apiProjectsSpidersCronjobsRunOnce(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise { - const response = await this.apiProjectsSpidersCronjobsRunOnceRaw(requestParameters); - return await response.value(); - } - - /** - */ - async apiProjectsSpidersCronjobsUpdateRaw(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise> { - if (requestParameters.cjid === null || requestParameters.cjid === undefined) { - throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); - } - - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); - } - - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { - headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); - } - const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'PUT', + path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'DELETE', headers: headerParameters, query: queryParameters, - body: SpiderCronJobUpdateToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobUpdateFromJSON(jsonValue)); + return new runtime.VoidApiResponse(response); } /** */ - async apiProjectsSpidersCronjobsUpdate(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise { - const response = await this.apiProjectsSpidersCronjobsUpdateRaw(requestParameters); - return await response.value(); + async apiProjectsDeploysDelete(requestParameters: ApiProjectsDeploysDeleteRequest): Promise { + await this.apiProjectsDeploysDeleteRaw(requestParameters); } /** */ - async apiProjectsSpidersJobsCreateRaw(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise> { + async apiProjectsDeploysListRaw(requestParameters: ApiProjectsDeploysListRequest): Promise> { if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysList.'); } - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsCreate.'); - } + const queryParameters: any = {}; - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsCreate.'); + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; } - const queryParameters: any = {}; - - if (requestParameters.async !== undefined) { - queryParameters['async'] = requestParameters.async; + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; } const headerParameters: runtime.HTTPHeaders = {}; - headerParameters['Content-Type'] = 'application/json'; - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'POST', + path: `/api/projects/{pid}/deploys`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'GET', headers: headerParameters, query: queryParameters, - body: SpiderJobCreateToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobCreateFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2002FromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsCreate(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise { - const response = await this.apiProjectsSpidersJobsCreateRaw(requestParameters); + async apiProjectsDeploysList(requestParameters: ApiProjectsDeploysListRequest): Promise { + const response = await this.apiProjectsDeploysListRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersJobsDataDeleteRaw(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise> { - if (requestParameters.jid === null || requestParameters.jid === undefined) { - throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + async apiProjectsDeploysPartialUpdateRaw(requestParameters: ApiProjectsDeploysPartialUpdateRequest): Promise> { + if (requestParameters.did === null || requestParameters.did === undefined) { + throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysPartialUpdate.'); } if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysPartialUpdate.'); } - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysPartialUpdate.'); } const queryParameters: any = {}; - if (requestParameters.type !== undefined) { - queryParameters['type'] = requestParameters.type; - } - const headerParameters: runtime.HTTPHeaders = {}; + headerParameters['Content-Type'] = 'application/json'; + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data/delete`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'POST', + path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'PATCH', headers: headerParameters, query: queryParameters, + body: DeployToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => DeleteJobDataFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => DeployFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsDataDelete(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise { - const response = await this.apiProjectsSpidersJobsDataDeleteRaw(requestParameters); + async apiProjectsDeploysPartialUpdate(requestParameters: ApiProjectsDeploysPartialUpdateRequest): Promise { + const response = await this.apiProjectsDeploysPartialUpdateRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersJobsDataListRaw(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise> { - if (requestParameters.jid === null || requestParameters.jid === undefined) { - throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + async apiProjectsDeploysReadRaw(requestParameters: ApiProjectsDeploysReadRequest): Promise> { + if (requestParameters.did === null || requestParameters.did === undefined) { + throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysRead.'); } if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataList.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysRead.'); } const queryParameters: any = {}; - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; - } - - if (requestParameters.type !== undefined) { - queryParameters['type'] = requestParameters.type; - } - const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), method: 'GET', headers: headerParameters, query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2006FromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => DeployFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsDataList(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise { - const response = await this.apiProjectsSpidersJobsDataListRaw(requestParameters); + async apiProjectsDeploysRead(requestParameters: ApiProjectsDeploysReadRequest): Promise { + const response = await this.apiProjectsDeploysReadRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersJobsListRaw(requestParameters: ApiProjectsSpidersJobsListRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsList.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsList.'); - } - + async apiProjectsListRaw(requestParameters: ApiProjectsListRequest): Promise> { const queryParameters: any = {}; - if (requestParameters.cronjob !== undefined) { - queryParameters['cronjob'] = requestParameters.cronjob; - } - - if (requestParameters.status !== undefined) { - queryParameters['status'] = requestParameters.status; - } - - if (requestParameters.tag !== undefined) { - queryParameters['tag'] = requestParameters.tag; - } - if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } @@ -1815,39 +548,31 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + path: `/api/projects`, method: 'GET', headers: headerParameters, query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2005FromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2001FromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsList(requestParameters: ApiProjectsSpidersJobsListRequest): Promise { - const response = await this.apiProjectsSpidersJobsListRaw(requestParameters); + async apiProjectsList(requestParameters: ApiProjectsListRequest): Promise { + const response = await this.apiProjectsListRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersJobsPartialUpdateRaw(requestParameters: ApiProjectsSpidersJobsPartialUpdateRequest): Promise> { - if (requestParameters.jid === null || requestParameters.jid === undefined) { - throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); - } - + async apiProjectsPartialUpdateRaw(requestParameters: ApiProjectsPartialUpdateRequest): Promise> { if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsPartialUpdate.'); } if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsPartialUpdate.'); } const queryParameters: any = {}; @@ -1860,36 +585,28 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), method: 'PATCH', headers: headerParameters, query: queryParameters, - body: SpiderJobToJSON(requestParameters.data), + body: ProjectToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsPartialUpdate(requestParameters: ApiProjectsSpidersJobsPartialUpdateRequest): Promise { - const response = await this.apiProjectsSpidersJobsPartialUpdateRaw(requestParameters); + async apiProjectsPartialUpdate(requestParameters: ApiProjectsPartialUpdateRequest): Promise { + const response = await this.apiProjectsPartialUpdateRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersJobsReadRaw(requestParameters: ApiProjectsSpidersJobsReadRequest): Promise> { - if (requestParameters.jid === null || requestParameters.jid === undefined) { - throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsRead.'); - } - + async apiProjectsReadRaw(requestParameters: ApiProjectsReadRequest): Promise> { if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsRead.'); - } - - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsRead.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsRead.'); } const queryParameters: any = {}; @@ -1900,39 +617,39 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), method: 'GET', headers: headerParameters, query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsRead(requestParameters: ApiProjectsSpidersJobsReadRequest): Promise { - const response = await this.apiProjectsSpidersJobsReadRaw(requestParameters); + async apiProjectsRead(requestParameters: ApiProjectsReadRequest): Promise { + const response = await this.apiProjectsReadRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersJobsUpdateRaw(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise> { - if (requestParameters.jid === null || requestParameters.jid === undefined) { - throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + async apiProjectsSpidersCronjobsPartialUpdateRaw(requestParameters: ApiProjectsSpidersCronjobsPartialUpdateRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); } if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); } if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); } if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsPartialUpdate.'); } const queryParameters: any = {}; @@ -1945,75 +662,79 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'PUT', + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PATCH', headers: headerParameters, query: queryParameters, - body: SpiderJobUpdateToJSON(requestParameters.data), + body: SpiderCronJobToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobUpdateFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersJobsUpdate(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise { - const response = await this.apiProjectsSpidersJobsUpdateRaw(requestParameters); + async apiProjectsSpidersCronjobsPartialUpdate(requestParameters: ApiProjectsSpidersCronjobsPartialUpdateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsPartialUpdateRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersListRaw(requestParameters: ApiProjectsSpidersListRequest): Promise> { - if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersList.'); + async apiProjectsSpidersCronjobsReadRaw(requestParameters: ApiProjectsSpidersCronjobsReadRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsRead.'); } - const queryParameters: any = {}; - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsRead.'); } - if (requestParameters.pageSize !== undefined) { - queryParameters['page_size'] = requestParameters.pageSize; + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsRead.'); } + const queryParameters: any = {}; + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), method: 'GET', headers: headerParameters, query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2003FromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersList(requestParameters: ApiProjectsSpidersListRequest): Promise { - const response = await this.apiProjectsSpidersListRaw(requestParameters); + async apiProjectsSpidersCronjobsRead(requestParameters: ApiProjectsSpidersCronjobsReadRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsReadRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersPartialUpdateRaw(requestParameters: ApiProjectsSpidersPartialUpdateRequest): Promise> { + async apiProjectsSpidersJobsPartialUpdateRaw(requestParameters: ApiProjectsSpidersJobsPartialUpdateRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); + } + if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersPartialUpdate.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); } if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersPartialUpdate.'); + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); } if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersPartialUpdate.'); + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsPartialUpdate.'); } const queryParameters: any = {}; @@ -2026,32 +747,36 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), method: 'PATCH', headers: headerParameters, query: queryParameters, - body: SpiderToJSON(requestParameters.data), + body: SpiderJobToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersPartialUpdate(requestParameters: ApiProjectsSpidersPartialUpdateRequest): Promise { - const response = await this.apiProjectsSpidersPartialUpdateRaw(requestParameters); + async apiProjectsSpidersJobsPartialUpdate(requestParameters: ApiProjectsSpidersJobsPartialUpdateRequest): Promise { + const response = await this.apiProjectsSpidersJobsPartialUpdateRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersReadRaw(requestParameters: ApiProjectsSpidersReadRequest): Promise> { + async apiProjectsSpidersJobsReadRaw(requestParameters: ApiProjectsSpidersJobsReadRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsRead.'); + } + if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersRead.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsRead.'); } if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersRead.'); + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsRead.'); } const queryParameters: any = {}; @@ -2062,73 +787,74 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), method: 'GET', headers: headerParameters, query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobFromJSON(jsonValue)); } /** */ - async apiProjectsSpidersRead(requestParameters: ApiProjectsSpidersReadRequest): Promise { - const response = await this.apiProjectsSpidersReadRaw(requestParameters); + async apiProjectsSpidersJobsRead(requestParameters: ApiProjectsSpidersJobsReadRequest): Promise { + const response = await this.apiProjectsSpidersJobsReadRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsSpidersUpdateRaw(requestParameters: ApiProjectsSpidersUpdateRequest): Promise> { + async apiProjectsSpidersListRaw(requestParameters: ApiProjectsSpidersListRequest): Promise> { if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersUpdate.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersList.'); } - if (requestParameters.sid === null || requestParameters.sid === undefined) { - throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersUpdate.'); - } + const queryParameters: any = {}; - if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersUpdate.'); + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; } - const queryParameters: any = {}; + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } const headerParameters: runtime.HTTPHeaders = {}; - headerParameters['Content-Type'] = 'application/json'; - if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), - method: 'PUT', + path: `/api/projects/{pid}/spiders`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'GET', headers: headerParameters, query: queryParameters, - body: SpiderUpdateToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => SpiderUpdateFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2003FromJSON(jsonValue)); } /** */ - async apiProjectsSpidersUpdate(requestParameters: ApiProjectsSpidersUpdateRequest): Promise { - const response = await this.apiProjectsSpidersUpdateRaw(requestParameters); + async apiProjectsSpidersList(requestParameters: ApiProjectsSpidersListRequest): Promise { + const response = await this.apiProjectsSpidersListRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsUpdateRaw(requestParameters: ApiProjectsUpdateRequest): Promise> { + async apiProjectsSpidersPartialUpdateRaw(requestParameters: ApiProjectsSpidersPartialUpdateRequest): Promise> { if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsUpdate.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersPartialUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersPartialUpdate.'); } if (requestParameters.data === null || requestParameters.data === undefined) { - throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsUpdate.'); + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersPartialUpdate.'); } const queryParameters: any = {}; @@ -2141,39 +867,35 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), - method: 'PUT', + path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PATCH', headers: headerParameters, query: queryParameters, - body: ProjectUpdateToJSON(requestParameters.data), + body: SpiderToJSON(requestParameters.data), }); - return new runtime.JSONApiResponse(response, (jsonValue) => ProjectUpdateFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderFromJSON(jsonValue)); } /** */ - async apiProjectsUpdate(requestParameters: ApiProjectsUpdateRequest): Promise { - const response = await this.apiProjectsUpdateRaw(requestParameters); + async apiProjectsSpidersPartialUpdate(requestParameters: ApiProjectsSpidersPartialUpdateRequest): Promise { + const response = await this.apiProjectsSpidersPartialUpdateRaw(requestParameters); return await response.value(); } /** */ - async apiProjectsUsageRaw(requestParameters: ApiProjectsUsageRequest): Promise>> { + async apiProjectsSpidersReadRaw(requestParameters: ApiProjectsSpidersReadRequest): Promise> { if (requestParameters.pid === null || requestParameters.pid === undefined) { - throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsUsage.'); + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersRead.'); } - const queryParameters: any = {}; - - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersRead.'); } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; - } + const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -2181,19 +903,19 @@ export class ApiApi extends runtime.BaseAPI { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } const response = await this.request({ - path: `/api/projects/{pid}/usage`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), method: 'GET', headers: headerParameters, query: queryParameters, }); - return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UsageRecordFromJSON)); + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderFromJSON(jsonValue)); } /** */ - async apiProjectsUsage(requestParameters: ApiProjectsUsageRequest): Promise> { - const response = await this.apiProjectsUsageRaw(requestParameters); + async apiProjectsSpidersRead(requestParameters: ApiProjectsSpidersReadRequest): Promise { + const response = await this.apiProjectsSpidersReadRaw(requestParameters); return await response.value(); } diff --git a/estela-web/src/services/api/generated-api/apis/AuthApi.ts b/estela-web/src/services/api/generated-api/apis/AuthApi.ts new file mode 100644 index 00000000..23726d33 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/AuthApi.ts @@ -0,0 +1,191 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + AuthToken, + AuthTokenFromJSON, + AuthTokenToJSON, + Token, + TokenFromJSON, + TokenToJSON, + User, + UserFromJSON, + UserToJSON, + UserProfile, + UserProfileFromJSON, + UserProfileToJSON, +} from '../models'; + +export interface ApiAuthLoginRequest { + data: AuthToken; +} + +export interface ApiAuthProfileReadRequest { + username: string; +} + +export interface ApiAuthProfileUpdateRequest { + username: string; + data: UserProfile; +} + +export interface ApiAuthRegisterRequest { + data: User; +} + +/** + * + */ +export class AuthApi extends runtime.BaseAPI { + + /** + */ + async apiAuthLoginRaw(requestParameters: ApiAuthLoginRequest): Promise> { + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthLogin.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/auth/login`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AuthTokenToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); + } + + /** + */ + async apiAuthLogin(requestParameters: ApiAuthLoginRequest): Promise { + const response = await this.apiAuthLoginRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiAuthProfileReadRaw(requestParameters: ApiAuthProfileReadRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiAuthProfileRead.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/auth/profile/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue)); + } + + /** + */ + async apiAuthProfileRead(requestParameters: ApiAuthProfileReadRequest): Promise { + const response = await this.apiAuthProfileReadRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiAuthProfileUpdateRaw(requestParameters: ApiAuthProfileUpdateRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiAuthProfileUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthProfileUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/auth/profile/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserProfileToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue)); + } + + /** + */ + async apiAuthProfileUpdate(requestParameters: ApiAuthProfileUpdateRequest): Promise { + const response = await this.apiAuthProfileUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiAuthRegisterRaw(requestParameters: ApiAuthRegisterRequest): Promise> { + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthRegister.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/auth/register`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenFromJSON(jsonValue)); + } + + /** + */ + async apiAuthRegister(requestParameters: ApiAuthRegisterRequest): Promise { + const response = await this.apiAuthRegisterRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/CronjobApi.ts b/estela-web/src/services/api/generated-api/apis/CronjobApi.ts new file mode 100644 index 00000000..120570a2 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/CronjobApi.ts @@ -0,0 +1,282 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + InlineResponse2004, + InlineResponse2004FromJSON, + InlineResponse2004ToJSON, + SpiderCronJob, + SpiderCronJobFromJSON, + SpiderCronJobToJSON, + SpiderCronJobCreate, + SpiderCronJobCreateFromJSON, + SpiderCronJobCreateToJSON, + SpiderCronJobUpdate, + SpiderCronJobUpdateFromJSON, + SpiderCronJobUpdateToJSON, +} from '../models'; + +export interface ApiProjectsSpidersCronjobsCreateRequest { + pid: string; + sid: string; + data: SpiderCronJobCreate; +} + +export interface ApiProjectsSpidersCronjobsDeleteRequest { + cjid: number; + pid: string; + sid: string; +} + +export interface ApiProjectsSpidersCronjobsListRequest { + pid: string; + sid: string; + tag?: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersCronjobsRunOnceRequest { + cjid: number; + pid: string; + sid: string; +} + +export interface ApiProjectsSpidersCronjobsUpdateRequest { + cjid: number; + pid: string; + sid: string; + data: SpiderCronJobUpdate; +} + +/** + * + */ +export class CronjobApi extends runtime.BaseAPI { + + /** + */ + async apiProjectsSpidersCronjobsCreateRaw(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SpiderCronJobCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsCreate(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsDeleteRaw(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async apiProjectsSpidersCronjobsDelete(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise { + await this.apiProjectsSpidersCronjobsDeleteRaw(requestParameters); + } + + /** + */ + async apiProjectsSpidersCronjobsListRaw(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.tag !== undefined) { + queryParameters['tag'] = requestParameters.tag; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2004FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsList(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsRunOnceRaw(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}/run_once`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsRunOnce(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsRunOnceRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsUpdateRaw(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderCronJobUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsUpdate(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsUpdateRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/DeployApi.ts b/estela-web/src/services/api/generated-api/apis/DeployApi.ts new file mode 100644 index 00000000..3d789366 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/DeployApi.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + DeployCreate, + DeployCreateFromJSON, + DeployCreateToJSON, + DeployUpdate, + DeployUpdateFromJSON, + DeployUpdateToJSON, +} from '../models'; + +export interface ApiProjectsDeploysCreateRequest { + pid: string; + data: DeployCreate; +} + +export interface ApiProjectsDeploysUpdateRequest { + did: number; + pid: string; + data: DeployUpdate; +} + +/** + * + */ +export class DeployApi extends runtime.BaseAPI { + + /** + */ + async apiProjectsDeploysCreateRaw(requestParameters: ApiProjectsDeploysCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/deploys`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeployCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeployCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsDeploysCreate(requestParameters: ApiProjectsDeploysCreateRequest): Promise { + const response = await this.apiProjectsDeploysCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsDeploysUpdateRaw(requestParameters: ApiProjectsDeploysUpdateRequest): Promise> { + if (requestParameters.did === null || requestParameters.did === undefined) { + throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: DeployUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeployUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsDeploysUpdate(requestParameters: ApiProjectsDeploysUpdateRequest): Promise { + const response = await this.apiProjectsDeploysUpdateRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/JobApi.ts b/estela-web/src/services/api/generated-api/apis/JobApi.ts new file mode 100644 index 00000000..75320141 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/JobApi.ts @@ -0,0 +1,325 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + DeleteJobData, + DeleteJobDataFromJSON, + DeleteJobDataToJSON, + InlineResponse2005, + InlineResponse2005FromJSON, + InlineResponse2005ToJSON, + InlineResponse2006, + InlineResponse2006FromJSON, + InlineResponse2006ToJSON, + SpiderJobCreate, + SpiderJobCreateFromJSON, + SpiderJobCreateToJSON, + SpiderJobUpdate, + SpiderJobUpdateFromJSON, + SpiderJobUpdateToJSON, +} from '../models'; + +export interface ApiProjectsSpidersJobsCreateRequest { + pid: string; + sid: string; + data: SpiderJobCreate; + async?: boolean; +} + +export interface ApiProjectsSpidersJobsDataDeleteRequest { + jid: string; + pid: string; + sid: string; + type: string; +} + +export interface ApiProjectsSpidersJobsDataListRequest { + jid: string; + pid: string; + sid: string; + page?: number; + pageSize?: number; + type?: string; +} + +export interface ApiProjectsSpidersJobsListRequest { + pid: string; + sid: string; + cronjob?: number; + status?: string; + tag?: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersJobsUpdateRequest { + jid: number; + pid: string; + sid: string; + data: SpiderJobUpdate; +} + +/** + * + */ +export class JobApi extends runtime.BaseAPI { + + /** + */ + async apiProjectsSpidersJobsCreateRaw(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + const queryParameters: any = {}; + + if (requestParameters.async !== undefined) { + queryParameters['async'] = requestParameters.async; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SpiderJobCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsCreate(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise { + const response = await this.apiProjectsSpidersJobsCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataDeleteRaw(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data/delete`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteJobDataFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataDelete(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataDeleteRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataListRaw(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2006FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataList(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsListRaw(requestParameters: ApiProjectsSpidersJobsListRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.cronjob !== undefined) { + queryParameters['cronjob'] = requestParameters.cronjob; + } + + if (requestParameters.status !== undefined) { + queryParameters['status'] = requestParameters.status; + } + + if (requestParameters.tag !== undefined) { + queryParameters['tag'] = requestParameters.tag; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2005FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsList(requestParameters: ApiProjectsSpidersJobsListRequest): Promise { + const response = await this.apiProjectsSpidersJobsListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsUpdateRaw(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderJobUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsUpdate(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise { + const response = await this.apiProjectsSpidersJobsUpdateRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/JobDataApi.ts b/estela-web/src/services/api/generated-api/apis/JobDataApi.ts new file mode 100644 index 00000000..59e91ed7 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/JobDataApi.ts @@ -0,0 +1,145 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + DeleteJobData, + DeleteJobDataFromJSON, + DeleteJobDataToJSON, + InlineResponse2006, + InlineResponse2006FromJSON, + InlineResponse2006ToJSON, +} from '../models'; + +export interface ApiProjectsSpidersJobsDataDeleteRequest { + jid: string; + pid: string; + sid: string; + type: string; +} + +export interface ApiProjectsSpidersJobsDataListRequest { + jid: string; + pid: string; + sid: string; + page?: number; + pageSize?: number; + type?: string; +} + +/** + * + */ +export class JobDataApi extends runtime.BaseAPI { + + /** + */ + async apiProjectsSpidersJobsDataDeleteRaw(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data/delete`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteJobDataFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataDelete(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataDeleteRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataListRaw(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2006FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataList(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataListRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/ProfileApi.ts b/estela-web/src/services/api/generated-api/apis/ProfileApi.ts new file mode 100644 index 00000000..1d939530 --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/ProfileApi.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + UserProfile, + UserProfileFromJSON, + UserProfileToJSON, +} from '../models'; + +export interface ApiAuthProfileReadRequest { + username: string; +} + +export interface ApiAuthProfileUpdateRequest { + username: string; + data: UserProfile; +} + +/** + * + */ +export class ProfileApi extends runtime.BaseAPI { + + /** + */ + async apiAuthProfileReadRaw(requestParameters: ApiAuthProfileReadRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiAuthProfileRead.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/auth/profile/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue)); + } + + /** + */ + async apiAuthProfileRead(requestParameters: ApiAuthProfileReadRequest): Promise { + const response = await this.apiAuthProfileReadRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiAuthProfileUpdateRaw(requestParameters: ApiAuthProfileUpdateRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiAuthProfileUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiAuthProfileUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/auth/profile/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserProfileToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue)); + } + + /** + */ + async apiAuthProfileUpdate(requestParameters: ApiAuthProfileUpdateRequest): Promise { + const response = await this.apiAuthProfileUpdateRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/ProjectApi.ts b/estela-web/src/services/api/generated-api/apis/ProjectApi.ts new file mode 100644 index 00000000..9de37e8e --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/ProjectApi.ts @@ -0,0 +1,992 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + DeleteJobData, + DeleteJobDataFromJSON, + DeleteJobDataToJSON, + DeployCreate, + DeployCreateFromJSON, + DeployCreateToJSON, + DeployUpdate, + DeployUpdateFromJSON, + DeployUpdateToJSON, + InlineResponse2004, + InlineResponse2004FromJSON, + InlineResponse2004ToJSON, + InlineResponse2005, + InlineResponse2005FromJSON, + InlineResponse2005ToJSON, + InlineResponse2006, + InlineResponse2006FromJSON, + InlineResponse2006ToJSON, + ProjectCronJob, + ProjectCronJobFromJSON, + ProjectCronJobToJSON, + ProjectJob, + ProjectJobFromJSON, + ProjectJobToJSON, + ProjectUpdate, + ProjectUpdateFromJSON, + ProjectUpdateToJSON, + ProjectUsage, + ProjectUsageFromJSON, + ProjectUsageToJSON, + SpiderCronJob, + SpiderCronJobFromJSON, + SpiderCronJobToJSON, + SpiderCronJobCreate, + SpiderCronJobCreateFromJSON, + SpiderCronJobCreateToJSON, + SpiderCronJobUpdate, + SpiderCronJobUpdateFromJSON, + SpiderCronJobUpdateToJSON, + SpiderJobCreate, + SpiderJobCreateFromJSON, + SpiderJobCreateToJSON, + SpiderJobUpdate, + SpiderJobUpdateFromJSON, + SpiderJobUpdateToJSON, + SpiderUpdate, + SpiderUpdateFromJSON, + SpiderUpdateToJSON, + UsageRecord, + UsageRecordFromJSON, + UsageRecordToJSON, +} from '../models'; + +export interface ApiProjectsCronjobsRequest { + pid: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsCurrentUsageRequest { + pid: string; +} + +export interface ApiProjectsDeleteRequest { + pid: string; +} + +export interface ApiProjectsDeploysCreateRequest { + pid: string; + data: DeployCreate; +} + +export interface ApiProjectsDeploysUpdateRequest { + did: number; + pid: string; + data: DeployUpdate; +} + +export interface ApiProjectsJobsRequest { + pid: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersCronjobsCreateRequest { + pid: string; + sid: string; + data: SpiderCronJobCreate; +} + +export interface ApiProjectsSpidersCronjobsDeleteRequest { + cjid: number; + pid: string; + sid: string; +} + +export interface ApiProjectsSpidersCronjobsListRequest { + pid: string; + sid: string; + tag?: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersCronjobsRunOnceRequest { + cjid: number; + pid: string; + sid: string; +} + +export interface ApiProjectsSpidersCronjobsUpdateRequest { + cjid: number; + pid: string; + sid: string; + data: SpiderCronJobUpdate; +} + +export interface ApiProjectsSpidersJobsCreateRequest { + pid: string; + sid: string; + data: SpiderJobCreate; + async?: boolean; +} + +export interface ApiProjectsSpidersJobsDataDeleteRequest { + jid: string; + pid: string; + sid: string; + type: string; +} + +export interface ApiProjectsSpidersJobsDataListRequest { + jid: string; + pid: string; + sid: string; + page?: number; + pageSize?: number; + type?: string; +} + +export interface ApiProjectsSpidersJobsListRequest { + pid: string; + sid: string; + cronjob?: number; + status?: string; + tag?: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersJobsUpdateRequest { + jid: number; + pid: string; + sid: string; + data: SpiderJobUpdate; +} + +export interface ApiProjectsSpidersUpdateRequest { + pid: string; + sid: number; + data: SpiderUpdate; +} + +export interface ApiProjectsUpdateRequest { + pid: string; + data: ProjectUpdate; +} + +export interface ApiProjectsUsageRequest { + pid: string; + startDate?: string; + endDate?: string; +} + +/** + * + */ +export class ProjectApi extends runtime.BaseAPI { + + /** + */ + async apiProjectsCronjobsRaw(requestParameters: ApiProjectsCronjobsRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsCronjobs.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectCronJobFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsCronjobs(requestParameters: ApiProjectsCronjobsRequest): Promise { + const response = await this.apiProjectsCronjobsRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsCurrentUsageRaw(requestParameters: ApiProjectsCurrentUsageRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsCurrentUsage.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/current_usage`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectUsageFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsCurrentUsage(requestParameters: ApiProjectsCurrentUsageRequest): Promise { + const response = await this.apiProjectsCurrentUsageRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsDeleteRaw(requestParameters: ApiProjectsDeleteRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDelete.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async apiProjectsDelete(requestParameters: ApiProjectsDeleteRequest): Promise { + await this.apiProjectsDeleteRaw(requestParameters); + } + + /** + */ + async apiProjectsDeploysCreateRaw(requestParameters: ApiProjectsDeploysCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/deploys`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DeployCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeployCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsDeploysCreate(requestParameters: ApiProjectsDeploysCreateRequest): Promise { + const response = await this.apiProjectsDeploysCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsDeploysUpdateRaw(requestParameters: ApiProjectsDeploysUpdateRequest): Promise> { + if (requestParameters.did === null || requestParameters.did === undefined) { + throw new runtime.RequiredError('did','Required parameter requestParameters.did was null or undefined when calling apiProjectsDeploysUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsDeploysUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsDeploysUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/deploys/{did}`.replace(`{${"did"}}`, encodeURIComponent(String(requestParameters.did))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: DeployUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeployUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsDeploysUpdate(requestParameters: ApiProjectsDeploysUpdateRequest): Promise { + const response = await this.apiProjectsDeploysUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsJobsRaw(requestParameters: ApiProjectsJobsRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsJobs.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectJobFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsJobs(requestParameters: ApiProjectsJobsRequest): Promise { + const response = await this.apiProjectsJobsRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsCreateRaw(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SpiderCronJobCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsCreate(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsDeleteRaw(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async apiProjectsSpidersCronjobsDelete(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise { + await this.apiProjectsSpidersCronjobsDeleteRaw(requestParameters); + } + + /** + */ + async apiProjectsSpidersCronjobsListRaw(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.tag !== undefined) { + queryParameters['tag'] = requestParameters.tag; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2004FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsList(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsRunOnceRaw(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}/run_once`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsRunOnce(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsRunOnceRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsUpdateRaw(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderCronJobUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsUpdate(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsCreateRaw(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + const queryParameters: any = {}; + + if (requestParameters.async !== undefined) { + queryParameters['async'] = requestParameters.async; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SpiderJobCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsCreate(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise { + const response = await this.apiProjectsSpidersJobsCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataDeleteRaw(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data/delete`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteJobDataFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataDelete(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataDeleteRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataListRaw(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2006FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataList(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsListRaw(requestParameters: ApiProjectsSpidersJobsListRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.cronjob !== undefined) { + queryParameters['cronjob'] = requestParameters.cronjob; + } + + if (requestParameters.status !== undefined) { + queryParameters['status'] = requestParameters.status; + } + + if (requestParameters.tag !== undefined) { + queryParameters['tag'] = requestParameters.tag; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2005FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsList(requestParameters: ApiProjectsSpidersJobsListRequest): Promise { + const response = await this.apiProjectsSpidersJobsListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsUpdateRaw(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderJobUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsUpdate(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise { + const response = await this.apiProjectsSpidersJobsUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersUpdateRaw(requestParameters: ApiProjectsSpidersUpdateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersUpdate(requestParameters: ApiProjectsSpidersUpdateRequest): Promise { + const response = await this.apiProjectsSpidersUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsUpdateRaw(requestParameters: ApiProjectsUpdateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: ProjectUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProjectUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsUpdate(requestParameters: ApiProjectsUpdateRequest): Promise { + const response = await this.apiProjectsUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsUsageRaw(requestParameters: ApiProjectsUsageRequest): Promise>> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsUsage.'); + } + + const queryParameters: any = {}; + + if (requestParameters.startDate !== undefined) { + queryParameters['start_date'] = requestParameters.startDate; + } + + if (requestParameters.endDate !== undefined) { + queryParameters['end_date'] = requestParameters.endDate; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/usage`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UsageRecordFromJSON)); + } + + /** + */ + async apiProjectsUsage(requestParameters: ApiProjectsUsageRequest): Promise> { + const response = await this.apiProjectsUsageRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/SpiderApi.ts b/estela-web/src/services/api/generated-api/apis/SpiderApi.ts new file mode 100644 index 00000000..ecae74ff --- /dev/null +++ b/estela-web/src/services/api/generated-api/apis/SpiderApi.ts @@ -0,0 +1,633 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * estela API v1.0 Documentation + * estela API Swagger Specification + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + DeleteJobData, + DeleteJobDataFromJSON, + DeleteJobDataToJSON, + InlineResponse2004, + InlineResponse2004FromJSON, + InlineResponse2004ToJSON, + InlineResponse2005, + InlineResponse2005FromJSON, + InlineResponse2005ToJSON, + InlineResponse2006, + InlineResponse2006FromJSON, + InlineResponse2006ToJSON, + SpiderCronJob, + SpiderCronJobFromJSON, + SpiderCronJobToJSON, + SpiderCronJobCreate, + SpiderCronJobCreateFromJSON, + SpiderCronJobCreateToJSON, + SpiderCronJobUpdate, + SpiderCronJobUpdateFromJSON, + SpiderCronJobUpdateToJSON, + SpiderJobCreate, + SpiderJobCreateFromJSON, + SpiderJobCreateToJSON, + SpiderJobUpdate, + SpiderJobUpdateFromJSON, + SpiderJobUpdateToJSON, + SpiderUpdate, + SpiderUpdateFromJSON, + SpiderUpdateToJSON, +} from '../models'; + +export interface ApiProjectsSpidersCronjobsCreateRequest { + pid: string; + sid: string; + data: SpiderCronJobCreate; +} + +export interface ApiProjectsSpidersCronjobsDeleteRequest { + cjid: number; + pid: string; + sid: string; +} + +export interface ApiProjectsSpidersCronjobsListRequest { + pid: string; + sid: string; + tag?: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersCronjobsRunOnceRequest { + cjid: number; + pid: string; + sid: string; +} + +export interface ApiProjectsSpidersCronjobsUpdateRequest { + cjid: number; + pid: string; + sid: string; + data: SpiderCronJobUpdate; +} + +export interface ApiProjectsSpidersJobsCreateRequest { + pid: string; + sid: string; + data: SpiderJobCreate; + async?: boolean; +} + +export interface ApiProjectsSpidersJobsDataDeleteRequest { + jid: string; + pid: string; + sid: string; + type: string; +} + +export interface ApiProjectsSpidersJobsDataListRequest { + jid: string; + pid: string; + sid: string; + page?: number; + pageSize?: number; + type?: string; +} + +export interface ApiProjectsSpidersJobsListRequest { + pid: string; + sid: string; + cronjob?: number; + status?: string; + tag?: string; + page?: number; + pageSize?: number; +} + +export interface ApiProjectsSpidersJobsUpdateRequest { + jid: number; + pid: string; + sid: string; + data: SpiderJobUpdate; +} + +export interface ApiProjectsSpidersUpdateRequest { + pid: string; + sid: number; + data: SpiderUpdate; +} + +/** + * + */ +export class SpiderApi extends runtime.BaseAPI { + + /** + */ + async apiProjectsSpidersCronjobsCreateRaw(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SpiderCronJobCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsCreate(requestParameters: ApiProjectsSpidersCronjobsCreateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsDeleteRaw(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsDelete.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async apiProjectsSpidersCronjobsDelete(requestParameters: ApiProjectsSpidersCronjobsDeleteRequest): Promise { + await this.apiProjectsSpidersCronjobsDeleteRaw(requestParameters); + } + + /** + */ + async apiProjectsSpidersCronjobsListRaw(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.tag !== undefined) { + queryParameters['tag'] = requestParameters.tag; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2004FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsList(requestParameters: ApiProjectsSpidersCronjobsListRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsRunOnceRaw(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsRunOnce.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}/run_once`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsRunOnce(requestParameters: ApiProjectsSpidersCronjobsRunOnceRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsRunOnceRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersCronjobsUpdateRaw(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise> { + if (requestParameters.cjid === null || requestParameters.cjid === undefined) { + throw new runtime.RequiredError('cjid','Required parameter requestParameters.cjid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersCronjobsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/cronjobs/{cjid}`.replace(`{${"cjid"}}`, encodeURIComponent(String(requestParameters.cjid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderCronJobUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderCronJobUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersCronjobsUpdate(requestParameters: ApiProjectsSpidersCronjobsUpdateRequest): Promise { + const response = await this.apiProjectsSpidersCronjobsUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsCreateRaw(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsCreate.'); + } + + const queryParameters: any = {}; + + if (requestParameters.async !== undefined) { + queryParameters['async'] = requestParameters.async; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SpiderJobCreateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobCreateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsCreate(requestParameters: ApiProjectsSpidersJobsCreateRequest): Promise { + const response = await this.apiProjectsSpidersJobsCreateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataDeleteRaw(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling apiProjectsSpidersJobsDataDelete.'); + } + + const queryParameters: any = {}; + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data/delete`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => DeleteJobDataFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataDelete(requestParameters: ApiProjectsSpidersJobsDataDeleteRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataDeleteRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsDataListRaw(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsDataList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + if (requestParameters.type !== undefined) { + queryParameters['type'] = requestParameters.type; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}/data`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2006FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsDataList(requestParameters: ApiProjectsSpidersJobsDataListRequest): Promise { + const response = await this.apiProjectsSpidersJobsDataListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsListRaw(requestParameters: ApiProjectsSpidersJobsListRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsList.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.cronjob !== undefined) { + queryParameters['cronjob'] = requestParameters.cronjob; + } + + if (requestParameters.status !== undefined) { + queryParameters['status'] = requestParameters.status; + } + + if (requestParameters.tag !== undefined) { + queryParameters['tag'] = requestParameters.tag; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.pageSize !== undefined) { + queryParameters['page_size'] = requestParameters.pageSize; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2005FromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsList(requestParameters: ApiProjectsSpidersJobsListRequest): Promise { + const response = await this.apiProjectsSpidersJobsListRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersJobsUpdateRaw(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise> { + if (requestParameters.jid === null || requestParameters.jid === undefined) { + throw new runtime.RequiredError('jid','Required parameter requestParameters.jid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersJobsUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}/jobs/{jid}`.replace(`{${"jid"}}`, encodeURIComponent(String(requestParameters.jid))).replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderJobUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderJobUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersJobsUpdate(requestParameters: ApiProjectsSpidersJobsUpdateRequest): Promise { + const response = await this.apiProjectsSpidersJobsUpdateRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiProjectsSpidersUpdateRaw(requestParameters: ApiProjectsSpidersUpdateRequest): Promise> { + if (requestParameters.pid === null || requestParameters.pid === undefined) { + throw new runtime.RequiredError('pid','Required parameter requestParameters.pid was null or undefined when calling apiProjectsSpidersUpdate.'); + } + + if (requestParameters.sid === null || requestParameters.sid === undefined) { + throw new runtime.RequiredError('sid','Required parameter requestParameters.sid was null or undefined when calling apiProjectsSpidersUpdate.'); + } + + if (requestParameters.data === null || requestParameters.data === undefined) { + throw new runtime.RequiredError('data','Required parameter requestParameters.data was null or undefined when calling apiProjectsSpidersUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const response = await this.request({ + path: `/api/projects/{pid}/spiders/{sid}`.replace(`{${"pid"}}`, encodeURIComponent(String(requestParameters.pid))).replace(`{${"sid"}}`, encodeURIComponent(String(requestParameters.sid))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SpiderUpdateToJSON(requestParameters.data), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SpiderUpdateFromJSON(jsonValue)); + } + + /** + */ + async apiProjectsSpidersUpdate(requestParameters: ApiProjectsSpidersUpdateRequest): Promise { + const response = await this.apiProjectsSpidersUpdateRaw(requestParameters); + return await response.value(); + } + +} diff --git a/estela-web/src/services/api/generated-api/apis/index.ts b/estela-web/src/services/api/generated-api/apis/index.ts index ebde4695..bb25ee8f 100644 --- a/estela-web/src/services/api/generated-api/apis/index.ts +++ b/estela-web/src/services/api/generated-api/apis/index.ts @@ -1 +1,10 @@ +export * from './AccountApi'; export * from './ApiApi'; +export * from './AuthApi'; +export * from './CronjobApi'; +export * from './DeployApi'; +export * from './JobApi'; +export * from './JobDataApi'; +export * from './ProfileApi'; +export * from './ProjectApi'; +export * from './SpiderApi';