@squiz/job-runner-lib 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/job-runner-lib",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "private": false,
@@ -18,7 +18,7 @@
18
18
  "license": "ISC",
19
19
  "devDependencies": {
20
20
  "@faker-js/faker": "8.0.2",
21
- "@squiz/virus-scanner-lib": "^1.66.1",
21
+ "@squiz/virus-scanner-lib": "^1.67.0",
22
22
  "@types/cli-color": "2.0.6",
23
23
  "@types/fs-extra": "11.0.1",
24
24
  "@types/jest": "28.1.8",
@@ -26,22 +26,18 @@
26
26
  "aws-sdk-client-mock": "^2.2.0",
27
27
  "aws-sdk-client-mock-jest": "^2.2.0",
28
28
  "dotenv": "16.0.3",
29
- "esbuild": "^0.25.6",
30
- "jest": "29.4.1",
31
- "rimraf": "4.1.2",
32
- "ts-jest": "29.0.5",
33
- "typescript": "4.9.4"
29
+ "esbuild": "^0.25.8"
34
30
  },
35
31
  "dependencies": {
36
- "@aws-sdk/client-dynamodb": "3.427.0",
37
- "@aws-sdk/client-ecs": "3.348.0",
38
- "@aws-sdk/client-s3": "^3.332.0",
39
- "@aws-sdk/s3-request-presigner": "^3.332.0",
32
+ "@aws-sdk/client-dynamodb": "3.848.0",
33
+ "@aws-sdk/client-ecs": "3.848.0",
34
+ "@aws-sdk/client-s3": "3.850.0",
35
+ "@aws-sdk/s3-request-presigner": "3.850.0",
40
36
  "@squiz/dx-common-lib": "^1.66.1",
41
37
  "@squiz/dx-json-schema-lib": "1.78.1",
42
38
  "@squiz/dx-logger-lib": "^1.64.0",
43
- "axios": "1.7.4",
44
- "cli-color": "^2.0.2",
39
+ "axios": "1.11.0",
40
+ "cli-color": "^2.0.4",
45
41
  "dotenv": "16.0.3",
46
42
  "fs-extra": "11.1.0",
47
43
  "inversify": "6.0.1",
@@ -8,7 +8,10 @@ import { JobExecution } from '../model/JobExecution';
8
8
 
9
9
  @provideTransient(JobDetailsRepository)
10
10
  export class JobDetailsRepository extends S3RepositoryBase {
11
- constructor(@inject(S3Client) protected s3Client: S3Client, @inject('JobDetailsBucketName') bucketName: string) {
11
+ constructor(
12
+ @inject(S3Client) protected s3Client: S3Client,
13
+ @inject('JobDetailsBucketName') bucketName: string,
14
+ ) {
12
15
  super(s3Client, bucketName);
13
16
  }
14
17
 
@@ -11,7 +11,7 @@ import {
11
11
  HeadObjectCommand,
12
12
  HeadObjectCommandOutput,
13
13
  PutObjectCommand,
14
- PutObjectCommandInputType,
14
+ PutObjectCommandInput,
15
15
  S3Client,
16
16
  } from '@aws-sdk/client-s3';
17
17
  import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
@@ -26,7 +26,10 @@ import 'reflect-metadata';
26
26
  @injectable()
27
27
  export abstract class S3RepositoryBase {
28
28
  protected bucketName: string;
29
- public constructor(@inject(S3Client) protected s3Client: S3Client, bucketName: string) {
29
+ public constructor(
30
+ @inject(S3Client) protected s3Client: S3Client,
31
+ bucketName: string,
32
+ ) {
30
33
  this.bucketName = bucketName;
31
34
  }
32
35
 
@@ -37,7 +40,7 @@ export abstract class S3RepositoryBase {
37
40
  * @return {Promise<void>}
38
41
  * @memberof S3Repository
39
42
  */
40
- async put(key: string, body: PutObjectCommandInputType['Body']): Promise<void> {
43
+ async put(key: string, body: PutObjectCommandInput['Body']): Promise<void> {
41
44
  await this.s3Client.send(
42
45
  new PutObjectCommand({
43
46
  Bucket: this.bucketName,
@@ -24,7 +24,7 @@ describe('PaginationService', (): void => {
24
24
  let mockData;
25
25
  let mockPaginationInfo: PaginationInfo;
26
26
  let mockExclusiveStartKey: Record<string, AttributeValue>;
27
- let mockLastEvaluatedKey: string | null;
27
+ const mockLastEvaluatedKey: string | null = null;
28
28
 
29
29
  beforeEach(() => {
30
30
  jest.resetAllMocks();
@@ -13,7 +13,10 @@ import { ErrorWithHttpStatusCode } from './ErrorWithHttpStatusCode';
13
13
  * @extends {ErrorWithHttpStatusCode}
14
14
  */
15
15
  export class BadRequestError extends ErrorWithHttpStatusCode {
16
- constructor(public details: string, message = ERRORS.badRequest.name) {
16
+ constructor(
17
+ public details: string,
18
+ message = ERRORS.badRequest.name,
19
+ ) {
17
20
  super(ERRORS.badRequest.code, message, details);
18
21
  }
19
22
  }
@@ -10,7 +10,11 @@
10
10
  * @extends {Error}
11
11
  */
12
12
  export class ErrorWithHttpStatusCode extends Error {
13
- constructor(public statusCode: number, public message: string, public details: string) {
13
+ constructor(
14
+ public statusCode: number,
15
+ public message: string,
16
+ public details: string,
17
+ ) {
14
18
  super(message);
15
19
  }
16
20
  }
@@ -13,7 +13,10 @@ import { ErrorWithHttpStatusCode } from './ErrorWithHttpStatusCode';
13
13
  * @extends {ErrorWithHttpStatusCode}
14
14
  */
15
15
  export class InternalServerError extends ErrorWithHttpStatusCode {
16
- constructor(public details: string, message = ERRORS.internalServerError.name) {
16
+ constructor(
17
+ public details: string,
18
+ message = ERRORS.internalServerError.name,
19
+ ) {
17
20
  super(ERRORS.internalServerError.code, message, details);
18
21
  }
19
22
  }
@@ -13,7 +13,10 @@ import { ErrorWithHttpStatusCode } from './ErrorWithHttpStatusCode';
13
13
  * @extends {ErrorWithHttpStatusCode}
14
14
  */
15
15
  export class NotImplementedError extends ErrorWithHttpStatusCode {
16
- constructor(public details: string, message = ERRORS.notImplemented.name) {
16
+ constructor(
17
+ public details: string,
18
+ message = ERRORS.notImplemented.name,
19
+ ) {
17
20
  super(ERRORS.notImplemented.code, message, details);
18
21
  }
19
22
  }
@@ -13,7 +13,10 @@ import { ErrorWithHttpStatusCode } from './ErrorWithHttpStatusCode';
13
13
  * @extends {ErrorWithHttpStatusCode}
14
14
  */
15
15
  export class UnprocessableContentError extends ErrorWithHttpStatusCode {
16
- constructor(public details: string, message = ERRORS.unprocessableContent.name) {
16
+ constructor(
17
+ public details: string,
18
+ message = ERRORS.unprocessableContent.name,
19
+ ) {
17
20
  super(ERRORS.unprocessableContent.code, message, details);
18
21
  }
19
22
  }
@@ -4,7 +4,10 @@ import { MANIFEST_MODELS } from '@squiz/dx-json-schema-lib';
4
4
  import path from 'path';
5
5
 
6
6
  export class JobManifestV1 {
7
- constructor(protected manifest: JobManifestV1Model, protected manifestPath: string) {}
7
+ constructor(
8
+ protected manifest: JobManifestV1Model,
9
+ protected manifestPath: string,
10
+ ) {}
8
11
 
9
12
  public static getJobSchemaVersionRegex(): RegExp {
10
13
  return /\/schemas\/(?<schema>JobV\d+)\.json#?$/;
@@ -3,8 +3,7 @@
3
3
  * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
4
  */
5
5
 
6
- import { ECSClient, LaunchType, ListTasksCommand, RunTaskCommand } from '@aws-sdk/client-ecs';
7
- import { JOB_EXECUTION_STATUS } from '../../constants/JobExecutionStatus.constants';
6
+ import { DesiredStatus, ECSClient, LaunchType, ListTasksCommand, RunTaskCommand } from '@aws-sdk/client-ecs';
8
7
  import { getAwsTags } from '../../utils';
9
8
  import { ListRunningTasksParams, RunJobTaskParams } from './JobExecutionTaskService.defs';
10
9
  import { JobDetailsRepository, S3Repository } from '../../S3Repository';
@@ -26,7 +25,7 @@ export class JobExecutionTaskService {
26
25
  cluster: params.clusterArn,
27
26
  family: params.runtimeTaskFamily,
28
27
  maxResults: params.maxTenantConcurrentTasks + 1,
29
- desiredStatus: JOB_EXECUTION_STATUS.running,
28
+ desiredStatus: DesiredStatus.RUNNING,
30
29
  };
31
30
  const command = new ListTasksCommand(input);
32
31
  const response = await this.ecsClient.send(command);
package/tsconfig.json CHANGED
@@ -1,18 +1,11 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
-
4
3
  "compilerOptions": {
5
4
  "outDir": "lib/",
6
- "resolveJsonModule": true,
7
- "composite": true,
8
5
  "rootDir": "./src",
9
- "sourceMap": true,
10
- "emitDeclarationOnly": true,
11
- "declaration": true
6
+ "emitDeclarationOnly": true
12
7
  },
13
-
14
8
  "references": [],
15
-
16
9
  "include": ["src/**/*.ts", "src/**/*.json"],
17
10
  "exclude": ["jest.config.ts"]
18
11
  }