diff --git a/package-lock.json b/package-lock.json index d743257..1b02419 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@nestjs/common": "^10.0.2", "@nestjs/core": "^10.0.2", "@nestjs/platform-express": "^10.0.2", - "@omotes/proto": "^0.1.14", + "@omotes/proto": "^1.2.0", "amqplib": "^0.10.3", "axios": "^1.6.0", "express": "^4.18.1", @@ -7828,10 +7828,9 @@ } }, "node_modules/@omotes/proto": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@omotes/proto/-/proto-0.1.14.tgz", - "integrity": "sha512-grBVZJP0MoyfTABkpFhr2rzrYDZ0GGc8rDkXVFw+C6CzCtxIH0W+vl513PXmeLbx+0H2vAsew0Xge4eVQI7p3A==", - "license": "ISC", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@omotes/proto/-/proto-1.2.0.tgz", + "integrity": "sha512-BCy3WxrmWFMBUz9ngU61XD4tU//3AoASMFeJ3gBLX5Av7aZWw34BUOF77e6J1uGsQkcF+H4BqZTabBXgHUhCkg==", "dependencies": { "google-protobuf": "^3.21.2" } diff --git a/package.json b/package.json index c9bc135..889717d 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "@nestjs/common": "^10.0.2", "@nestjs/core": "^10.0.2", "@nestjs/platform-express": "^10.0.2", - "@omotes/proto": "^0.1.14", + "@omotes/proto": "^1.2.0", "amqplib": "^0.10.3", "axios": "^1.6.0", "express": "^4.18.1", diff --git a/sdk/package.json b/sdk/package.json index 6864742..b9d0593 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -11,7 +11,7 @@ "amqplib": "0.10.3", "uuidv7": "0.6.3", "tslib": "2.6.2", - "@omotes/proto": "^0.1.14", + "@omotes/proto": "^1.2.0", "google-protobuf": "^3.21.2", "influx": "^5.9.3" }, diff --git a/sdk/src/lib/Job.spec.ts b/sdk/src/lib/Job.spec.ts index 05dc1dc..eac425f 100644 --- a/sdk/src/lib/Job.spec.ts +++ b/sdk/src/lib/Job.spec.ts @@ -1,4 +1,4 @@ -import { JobCancel, JobSubmission } from '@omotes/proto'; +import { JobDelete, JobSubmission } from '@omotes/proto'; import { Channel, Connection } from 'amqplib'; import { MockChannel, MockConnection } from '../util/MockChannel.spec'; import { Job } from './Job'; @@ -32,10 +32,10 @@ describe('Job', () => { describe('#cancel', () => { it('should send job cancel', () => { - job.cancel(); - expect(channel.sendToQueue).toHaveBeenCalledWith('job_cancellations', expect.any(Buffer), { persistent: true }); + job.delete(); + expect(channel.sendToQueue).toHaveBeenCalledWith('job_deletions', expect.any(Buffer), { persistent: true }); const submission = channel.sendToQueue.mock.calls[0][1]; - const message = JobCancel.deserializeBinary(submission); + const message = JobDelete.deserializeBinary(submission); expect(message.toObject()).toEqual(expect.objectContaining({ uuid: job.uuid })); diff --git a/sdk/src/lib/Job.ts b/sdk/src/lib/Job.ts index 2be66e8..df95e7e 100644 --- a/sdk/src/lib/Job.ts +++ b/sdk/src/lib/Job.ts @@ -1,4 +1,4 @@ -import { JobCancel, JobSubmission, Workflow } from '@omotes/proto'; +import { JobDelete, JobSubmission, Workflow } from '@omotes/proto'; import { Channel, Connection } from 'amqplib'; import { JavaScriptValue, Struct } from 'google-protobuf/google/protobuf/struct_pb'; import { from } from 'rxjs'; @@ -33,10 +33,10 @@ export class Job { return this; } - public cancel() { - const cancel = new JobCancel(); - cancel.setUuid(this.uuid); - this.channel.sendToQueue(getCancellationsQueue(), this.toBuffer(cancel), { persistent: true }); + public delete() { + const jobDelete = new JobDelete(); + jobDelete.setUuid(this.uuid); + this.channel.sendToQueue(getCancellationsQueue(), this.toBuffer(jobDelete), { persistent: true }); return this; } @@ -72,7 +72,7 @@ export class Job { return channel; } - private toBuffer(message: JobSubmission | JobCancel) { + private toBuffer(message: JobSubmission | JobDelete) { return Buffer.from(message.serializeBinary()); } diff --git a/sdk/src/lib/queue.spec.ts b/sdk/src/lib/queue.spec.ts index 8669e4f..2854d52 100644 --- a/sdk/src/lib/queue.spec.ts +++ b/sdk/src/lib/queue.spec.ts @@ -26,6 +26,6 @@ describe('Queue functions', () => { it('getCancelQueue returns correct queue name', () => { const result = getCancellationsQueue(); - expect(result).toEqual(`job_cancellations`); + expect(result).toEqual(`job_deletions`); }); }); \ No newline at end of file diff --git a/sdk/src/lib/queue.ts b/sdk/src/lib/queue.ts index 9faf97e..f5d0084 100644 --- a/sdk/src/lib/queue.ts +++ b/sdk/src/lib/queue.ts @@ -17,5 +17,5 @@ export function getStatusQueue(job: Job) { } export function getCancellationsQueue() { - return `job_cancellations`; + return `job_deletions`; }