From 312a390f6024aac8ed64734cc0c3fb6a5d1aeba8 Mon Sep 17 00:00:00 2001 From: lprovost Date: Tue, 10 Oct 2023 17:13:50 -0400 Subject: [PATCH] refactor(pipelines): removing deprecated endpoint BREAKING CHANGE: Removal of /rest/search/v2/admin/pipelines/ml/version due to deprecation --- src/resources/Pipelines/Pipelines.ts | 24 ++++++------------- .../Pipelines/PipelinesInterfaces.ts | 5 ---- .../Pipelines/tests/Pipelines.spec.ts | 8 ------- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/src/resources/Pipelines/Pipelines.ts b/src/resources/Pipelines/Pipelines.ts index 5d82ba8f3..df94a9b82 100644 --- a/src/resources/Pipelines/Pipelines.ts +++ b/src/resources/Pipelines/Pipelines.ts @@ -8,7 +8,6 @@ import { ListPipelinesOptions, ListPipelinesReturnVariant, NewPipelineModel, - PipelineBackendVersion, PipelineModel, UpdatePipelineModel, } from './PipelinesInterfaces.js'; @@ -27,10 +26,7 @@ export default class Pipelines extends Resource { groups: StatementGroups; facetRules: FacetStateRules; - constructor( - protected api: API, - protected serverlessApi: API, - ) { + constructor(protected api: API, protected serverlessApi: API) { super(api, serverlessApi); this.associations = new MLAssociations(api, serverlessApi); @@ -41,15 +37,9 @@ export default class Pipelines extends Resource { this.facetRules = new FacetStateRules(api, serverlessApi); } - getMLVersion() { - return this.api.get( - this.buildPath(`${Pipelines.searchUrlVersion2}/ml/version`, {organizationId: this.api.organizationId}), - ); - } - list(options?: ListPipelinesVariant) { return this.api.get>( - this.buildPath(Pipelines.searchUrlVersion1, {organizationId: this.api.organizationId, ...options}), + this.buildPath(Pipelines.searchUrlVersion1, {organizationId: this.api.organizationId, ...options}) ); } @@ -57,7 +47,7 @@ export default class Pipelines extends Resource { return this.api.get( this.buildPath(`${Pipelines.searchUrlVersion1}/${pipelineId}`, { organizationId: this.api.organizationId, - }), + }) ); } @@ -65,7 +55,7 @@ export default class Pipelines extends Resource { return this.api.delete( this.buildPath(`${Pipelines.searchUrlVersion1}/${pipelineId}`, { organizationId: this.api.organizationId, - }), + }) ); } @@ -74,7 +64,7 @@ export default class Pipelines extends Resource { this.buildPath(`${Pipelines.searchUrlVersion1}/${pipeline.id}`, { organizationId: this.api.organizationId, }), - pipeline, + pipeline ); } @@ -83,7 +73,7 @@ export default class Pipelines extends Resource { this.buildPath(`${Pipelines.searchUrlVersion1}/${pipelineId}/duplicate`, { organizationId: this.api.organizationId, }), - granularResource, + granularResource ); } @@ -92,7 +82,7 @@ export default class Pipelines extends Resource { this.buildPath(Pipelines.searchUrlVersion1, { organizationId: this.api.organizationId, }), - pipeline, + pipeline ); } } diff --git a/src/resources/Pipelines/PipelinesInterfaces.ts b/src/resources/Pipelines/PipelinesInterfaces.ts index d4be4c6a9..e3ac6d711 100644 --- a/src/resources/Pipelines/PipelinesInterfaces.ts +++ b/src/resources/Pipelines/PipelinesInterfaces.ts @@ -1,10 +1,5 @@ import {GranularResource, PageModel, Paginated} from '../BaseInterfaces.js'; import {ConditionModel} from './Conditions/index.js'; - -export interface PipelineBackendVersion { - version: '1' | '2'; -} - interface PipelineInterfaceUrl { /** * Url of the pages affected by this query pipeline. diff --git a/src/resources/Pipelines/tests/Pipelines.spec.ts b/src/resources/Pipelines/tests/Pipelines.spec.ts index 947531ad2..c77df62b2 100644 --- a/src/resources/Pipelines/tests/Pipelines.spec.ts +++ b/src/resources/Pipelines/tests/Pipelines.spec.ts @@ -24,14 +24,6 @@ describe('Pipelines', () => { }); }); - describe('getBackendVersion', () => { - it('should make a GET call to the specific Pipelines url', () => { - pipelines.getMLVersion(); - expect(api.get).toHaveBeenCalledTimes(1); - expect(api.get).toHaveBeenCalledWith(`${Pipelines.searchUrlVersion2}/ml/version`); - }); - }); - describe('get', () => { it('should make a GET call to /rest/search/v1/admin/pipelines/:id', () => { pipelines.get('🔥');