Skip to content

Commit

Permalink
Merge pull request #827 from balena-io/task-model-typings
Browse files Browse the repository at this point in the history
Use task model typings for tasks Worker.client
  • Loading branch information
Page- authored Oct 22, 2024
2 parents 61ac49a + d145bca commit b2ff309
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"generate-types": "node ./bin/sbvr-compiler.js generate-types ./src/sbvr-api/user.sbvr ./src/sbvr-api/user.ts && node ./bin/sbvr-compiler.js generate-types ./src/migrator/migrations.sbvr ./src/migrator/migrations.ts && node ./bin/sbvr-compiler.js generate-types ./src/sbvr-api/dev.sbvr ./src/sbvr-api/dev.ts && node ./bin/sbvr-compiler.js generate-types ./src/tasks/tasks.sbvr ./src/tasks/tasks.ts && balena-lint -t tsconfig.dev.json --fix ./src/sbvr-api/user.ts ./src/migrator/migrations.ts ./src/sbvr-api/dev.ts"
},
"dependencies": {
"@balena/abstract-sql-compiler": "^10.0.0",
"@balena/abstract-sql-to-typescript": "^5.0.0",
"@balena/abstract-sql-compiler": "^10.0.1",
"@balena/abstract-sql-to-typescript": "^5.0.1",
"@balena/env-parsing": "^1.2.0",
"@balena/lf-to-abstract-sql": "^5.0.2",
"@balena/odata-parser": "^3.1.0",
"@balena/odata-parser": "^3.1.2",
"@balena/odata-to-abstract-sql": "^7.0.0",
"@balena/sbvr-parser": "^1.4.6",
"@balena/sbvr-types": "^9.0.2",
Expand All @@ -41,12 +41,12 @@
"@types/deep-freeze": "^0.1.5",
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/lodash": "^4.17.10",
"@types/lodash": "^4.17.12",
"@types/memoizee": "^0.4.11",
"@types/method-override": "^0.0.35",
"@types/multer": "^1.4.12",
"@types/mysql": "^2.15.26",
"@types/node": "^20.16.10",
"@types/node": "^20.16.14",
"@types/passport": "^1.0.16",
"@types/passport-local": "^1.0.38",
"@types/passport-strategy": "^0.2.38",
Expand All @@ -59,7 +59,7 @@
"cron-parser": "^4.9.0",
"deep-freeze": "^0.0.1",
"eventemitter3": "^5.0.1",
"express-session": "^1.18.0",
"express-session": "^1.18.1",
"lodash": "^4.17.21",
"memoizee": "^0.4.17",
"pinejs-client-core": "^8.1.1",
Expand All @@ -72,7 +72,7 @@
"@types/busboy": "^1.5.4",
"@types/chai": "^4.3.20",
"@types/grunt": "^0.4.31",
"@types/mocha": "^10.0.8",
"@types/mocha": "^10.0.9",
"@types/on-finished": "^2.3.4",
"@types/request": "^2.48.12",
"@types/supertest": "^6.0.2",
Expand Down Expand Up @@ -104,19 +104,19 @@
"terser-webpack-plugin": "^5.3.10",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"webpack": "^5.95.0",
"webpack-dev-server": "^4.15.2"
},
"optionalDependencies": {
"@aws-sdk/client-s3": "^3.664.0",
"@aws-sdk/lib-storage": "^3.664.0",
"@aws-sdk/s3-request-presigner": "^3.664.0",
"@aws-sdk/client-s3": "^3.676.0",
"@aws-sdk/lib-storage": "^3.676.0",
"@aws-sdk/s3-request-presigner": "^3.676.0",
"bcrypt": "^5.1.1",
"body-parser": "^1.20.3",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"express": "^4.21.0",
"cookie-parser": "^1.4.7",
"express": "^4.21.1",
"method-override": "^3.0.0",
"mysql": "^2.18.1",
"passport": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/migrator/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// These types were generated by @balena/abstract-sql-to-typescript v5.0.0
// These types were generated by @balena/abstract-sql-to-typescript v5.0.1

import type { Types } from '@balena/abstract-sql-to-typescript';

Expand Down
2 changes: 1 addition & 1 deletion src/sbvr-api/dev.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// These types were generated by @balena/abstract-sql-to-typescript v5.0.0
// These types were generated by @balena/abstract-sql-to-typescript v5.0.1

import type { Types } from '@balena/abstract-sql-to-typescript';

Expand Down
2 changes: 1 addition & 1 deletion src/sbvr-api/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// These types were generated by @balena/abstract-sql-to-typescript v5.0.0
// These types were generated by @balena/abstract-sql-to-typescript v5.0.1

import type { Types } from '@balena/abstract-sql-to-typescript';

Expand Down
2 changes: 1 addition & 1 deletion src/tasks/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// These types were generated by @balena/abstract-sql-to-typescript v5.0.0
// These types were generated by @balena/abstract-sql-to-typescript v5.0.1

import type { Types } from '@balena/abstract-sql-to-typescript';

Expand Down
3 changes: 2 additions & 1 deletion src/tasks/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { PinejsClient } from '../sbvr-api/sbvr-utils';
import { sbvrUtils } from '../server-glue/module';
import { ajv } from './common';
import type { Task } from './tasks';
import type TasksModel from './tasks';

interface TaskArgs {
api: PinejsClient;
Expand Down Expand Up @@ -59,7 +60,7 @@ export class Worker {
private running = false;
private executing = 0;

constructor(private readonly client: PinejsClient) {
constructor(private readonly client: PinejsClient<TasksModel>) {
this.concurrency = tasksEnv.queueConcurrency;
this.interval = tasksEnv.queueIntervalMS;
}
Expand Down

0 comments on commit b2ff309

Please sign in to comment.