@squiz/job-runner-lib 2.9.0 → 2.10.1
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/CHANGELOG.md +12 -0
- package/lib/domains/job/constants/RuntimeImage.constants.d.ts +3 -4
- package/lib/domains/job/constants/RuntimeImage.constants.spec.d.ts +5 -0
- package/lib/domains/job/errors/ConflictError.d.ts +14 -0
- package/lib/domains/job/errors/Error.constants.d.ts +4 -0
- package/lib/domains/job/errors/index.d.ts +1 -0
- package/lib/domains/job/model/Base/Base.d.ts +5 -0
- package/lib/domains/job/model/JobExecution/JobExecution.d.ts +15 -3
- package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.d.ts +3 -6
- package/lib/domains/job/utils/ResolveRuntimeImageTaskDefinitionArn/ResolveRuntimeImageTaskDefinitionArn.d.ts +1 -1
- package/lib/domains/job/utils/ResolveRuntimeImageTaskDefinitionArn/ResolveRuntimeImageTaskDefinitionArn.spec.d.ts +5 -0
- package/lib/domains/job/utils/ResolveRuntimeImageTaskDefinitionArn/ResolveRuntimeImageTaskDefinitionArn.types.d.ts +1 -1
- package/lib/index.js +11 -11
- package/lib/index.js.map +4 -4
- package/package.json +4 -3
- package/src/domains/job/constants/RuntimeImage.constants.spec.ts +26 -0
- package/src/domains/job/constants/RuntimeImage.constants.ts +5 -8
- package/src/domains/job/errors/ConflictError.ts +19 -0
- package/src/domains/job/errors/Error.constants.ts +4 -0
- package/src/domains/job/errors/index.ts +1 -0
- package/src/domains/job/manifest/mocks/JobManifest.mock.ts +2 -2
- package/src/domains/job/manifest/mocks/JobManifestDto.mock.ts +2 -2
- package/src/domains/job/manifest/mocks/JobManifestRecord.mock.ts +2 -2
- package/src/domains/job/manifest/mocks/JobManifestRequest.mock.ts +2 -2
- package/src/domains/job/model/Base/Base.ts +6 -0
- package/src/domains/job/model/JobExecution/JobExecution.ts +17 -3
- package/src/domains/job/model/JobExecution/mocks/JobExecution.mock.ts +1 -0
- package/src/domains/job/model/JobExecution/mocks/JobExecutionDto.mock.ts +3 -0
- package/src/domains/job/model/JobExecution/mocks/JobExecutionRecord.mock.ts +1 -0
- package/src/domains/job/repository/JobExecutionRepository/JobExecutionRepository.spec.ts +77 -16
- package/src/domains/job/repository/JobExecutionRepository/JobExecutionRepository.ts +19 -15
- package/src/domains/job/repository/JobExecutionRepository/utils/convertDynamoDbItemToJobExecution/convertDynamoDbItemToJobExecution.ts +1 -0
- package/src/domains/job/repository/JobManifestRepository/JobManifestRepository.spec.ts +24 -3
- package/src/domains/job/repository/JobRepository/JobRepository.spec.ts +24 -3
- package/src/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.spec.ts +5 -6
- package/src/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.ts +1 -1
- package/src/domains/job/utils/ResolveRuntimeImageTaskDefinitionArn/ResolveRuntimeImageTaskDefinitionArn.spec.ts +64 -0
- package/src/domains/job/utils/ResolveRuntimeImageTaskDefinitionArn/ResolveRuntimeImageTaskDefinitionArn.ts +2 -5
- package/src/domains/job/utils/ResolveRuntimeImageTaskDefinitionArn/ResolveRuntimeImageTaskDefinitionArn.types.ts +1 -1
- package/src/domains/manifest/utils/validateRuntimeImage.ts +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
4
4
|
*/
|
|
5
|
-
export declare const SUPPORTED_RUNTIME_IMAGES: readonly ["node:
|
|
6
|
-
export declare const LEGACY_RUNTIME_IMAGE = "node:20";
|
|
5
|
+
export declare const SUPPORTED_RUNTIME_IMAGES: readonly ["node:24"];
|
|
7
6
|
export declare const RECOMMENDED_RUNTIME_IMAGE = "node:24";
|
|
8
7
|
export declare const DEPRECATED_RUNTIME_IMAGES: readonly string[];
|
|
8
|
+
export declare const isDeprecatedRuntimeImage: (image: string) => boolean;
|
|
9
9
|
export declare const getRuntimeImageOrDefault: (image: string | null | undefined) => string;
|
|
10
10
|
export declare const isSupportedRuntimeImage: (image: string) => boolean;
|
|
11
|
-
export declare const isDeprecatedRuntimeImage: (image: string) => boolean;
|
|
12
11
|
export declare const getRuntimeImagesMetadata: () => {
|
|
13
|
-
supportedRuntimeImages:
|
|
12
|
+
supportedRuntimeImages: "node:24"[];
|
|
14
13
|
deprecatedRuntimeImages: string[];
|
|
15
14
|
recommendedRuntimeImage: string;
|
|
16
15
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { ErrorWithHttpStatusCode } from './ErrorWithHttpStatusCode';
|
|
6
|
+
/**
|
|
7
|
+
* Conflict error (409).
|
|
8
|
+
* @export
|
|
9
|
+
* @class ConflictError
|
|
10
|
+
* @extends {ErrorWithHttpStatusCode}
|
|
11
|
+
*/
|
|
12
|
+
export declare class ConflictError extends ErrorWithHttpStatusCode {
|
|
13
|
+
constructor(details: string, message?: string);
|
|
14
|
+
}
|
|
@@ -43,3 +43,8 @@ export type ListParameters<TFilters> = {
|
|
|
43
43
|
consistentRead?: boolean;
|
|
44
44
|
limit?: number;
|
|
45
45
|
};
|
|
46
|
+
export type UpdateOptions = {
|
|
47
|
+
conditionExpression?: string;
|
|
48
|
+
expressionAttributeValues?: Record<string, unknown>;
|
|
49
|
+
expressionAttributeNames?: Record<string, string>;
|
|
50
|
+
};
|
|
@@ -53,6 +53,12 @@ export interface JobExecution {
|
|
|
53
53
|
* @memberof JobExecution
|
|
54
54
|
*/
|
|
55
55
|
ecsTaskId: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The last version of the ECS task event which was handled.
|
|
58
|
+
* @type {(number | null)}
|
|
59
|
+
* @memberof JobExecution
|
|
60
|
+
*/
|
|
61
|
+
lastEcsTaskEventVersion: number | null;
|
|
56
62
|
/**
|
|
57
63
|
* The time the job run was started.
|
|
58
64
|
* @type {(string | null)}
|
|
@@ -159,19 +165,25 @@ export interface JobExecutionRecord {
|
|
|
159
165
|
status: JobExecutionStatus;
|
|
160
166
|
/**
|
|
161
167
|
* The version of the job script to execute.
|
|
162
|
-
* @type
|
|
168
|
+
* @type {(string)}
|
|
163
169
|
* @memberof JobExecutionRecord
|
|
164
170
|
*/
|
|
165
171
|
version: string;
|
|
166
172
|
/**
|
|
167
173
|
* The ECS task ID of the job run.
|
|
168
|
-
* @type
|
|
174
|
+
* @type {(string | null)}
|
|
169
175
|
* @memberof JobExecutionRecord
|
|
170
176
|
*/
|
|
171
177
|
ecsTaskId: string | null;
|
|
178
|
+
/**
|
|
179
|
+
* The last version of the ECS task event which was handled.
|
|
180
|
+
* @type {(number | null)}
|
|
181
|
+
* @memberof JobExecution
|
|
182
|
+
*/
|
|
183
|
+
lastEcsTaskEventVersion: number | null;
|
|
172
184
|
/**
|
|
173
185
|
* The time the job run was started.
|
|
174
|
-
* @type
|
|
186
|
+
* @type {(string | null)}
|
|
175
187
|
* @memberof JobExecutionRecord
|
|
176
188
|
*/
|
|
177
189
|
timeStarted: string | null;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
6
6
|
import { PaginationInfo, PaginationQueryResponse } from '../../core/pagination';
|
|
7
7
|
import { CreateJobExecutionRequest, JobExecution, JobExecutionDto, JobExecutionSk, ListJobExecutionParameters, UpdateJobExecutionParameters } from '../../model/JobExecution';
|
|
8
8
|
import { Repository } from '../AbstractRepository';
|
|
9
|
+
import { UpdateOptions } from '../../model/Base';
|
|
9
10
|
export declare class JobExecutionRepository extends Repository<JobExecution, JobExecutionDto, JobExecutionSk> {
|
|
10
11
|
constructor(dynamoDbClient: DynamoDBClient, tableName: string, tenant?: string);
|
|
11
12
|
begin(createParams: CreateJobExecutionRequest): Promise<JobExecution>;
|
|
@@ -46,11 +47,7 @@ export declare class JobExecutionRepository extends Repository<JobExecution, Job
|
|
|
46
47
|
* @returns {Promise<JobExecution | null>} The updated record.
|
|
47
48
|
* @memberof JobExecutionRepository
|
|
48
49
|
*/
|
|
49
|
-
update(sk: JobExecutionSk, input: UpdateJobExecutionParameters, options?:
|
|
50
|
-
ConditionExpression?: string;
|
|
51
|
-
ExpressionAttributeValues?: Record<string, AttributeValue>;
|
|
52
|
-
ExpressionAttributeNames?: Record<string, string>;
|
|
53
|
-
}): Promise<JobExecution>;
|
|
50
|
+
update(sk: JobExecutionSk, input: UpdateJobExecutionParameters, options?: UpdateOptions): Promise<JobExecution>;
|
|
54
51
|
buildSk(sk: JobExecutionSk): string;
|
|
55
52
|
convertToDynamoDbItem(item: JobExecution): JobExecutionDto;
|
|
56
53
|
convertToItem(dbItem: JobExecutionDto): JobExecution;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { ResolveRuntimeImageTaskDefinitionArnParams } from './ResolveRuntimeImageTaskDefinitionArn.types';
|
|
6
|
-
export declare const resolveRuntimeImageTaskDefinitionArn: ({ image, taskDefinitionArnsByRuntimeImage,
|
|
6
|
+
export declare const resolveRuntimeImageTaskDefinitionArn: ({ image, taskDefinitionArnsByRuntimeImage, defaultTaskDefinitionArn, }: ResolveRuntimeImageTaskDefinitionArnParams) => string;
|