@punks/backend-entity-manager 0.0.311 → 0.0.313

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.
@@ -4,6 +4,7 @@ export interface JobDispatchCommandInput {
4
4
  schedule?: JobSchedule<unknown>;
5
5
  runType: JobRunType;
6
6
  payload?: unknown;
7
+ commandPlaceholders?: Record<string, string>;
7
8
  }
8
9
  export declare class JobDispatchCommand {
9
10
  readonly input: JobDispatchCommandInput;
@@ -2,4 +2,5 @@ export type JobTriggerInput = {
2
2
  jobUid: string;
3
3
  scheduleUid?: string;
4
4
  payload?: any;
5
+ commandPlaceholders?: Record<string, string>;
5
6
  };
package/dist/esm/index.js CHANGED
@@ -33863,6 +33863,7 @@ let JobsService = class JobsService {
33863
33863
  schedule,
33864
33864
  runType: JobRunType.OnDemand,
33865
33865
  payload: input.payload,
33866
+ commandPlaceholders: input.commandPlaceholders,
33866
33867
  }));
33867
33868
  };
33868
33869
  this.updateJob = async (input) => {
@@ -33963,7 +33964,7 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33963
33964
  return result.result;
33964
33965
  }
33965
33966
  async dispatchJob(command) {
33966
- const { input: { job, schedule, runType, payload }, } = command;
33967
+ const { input: { job, schedule, runType, payload, commandPlaceholders }, } = command;
33967
33968
  const instanceId = newUuid$1();
33968
33969
  try {
33969
33970
  this.logger.info(`JOB DISPATCH -> dispatching started job ${job.uid} -> ${instanceId}`);
@@ -33978,6 +33979,7 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33978
33979
  schedule,
33979
33980
  instanceId,
33980
33981
  payload,
33982
+ commandPlaceholders,
33981
33983
  });
33982
33984
  await this.instances.updateInstance(instanceId, {
33983
33985
  status: JobStatus.Ready,
@@ -40034,7 +40036,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
40034
40036
  return result.jobSummaryList?.[0];
40035
40037
  }
40036
40038
  async submitJob(input) {
40037
- this.logger.info(`AWS JOB -> submitting job`, {
40039
+ this.logger.info(`AWS JOB -> submitting job triggered`, {
40038
40040
  input,
40039
40041
  });
40040
40042
  const queue = await this.ensureQueue(this.awsSettings.defaultQueueName);
@@ -40054,7 +40056,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
40054
40056
  }
40055
40057
  : {}),
40056
40058
  };
40057
- this.logger.info(`AWS JOB -> submitting job ${jobName} ${queue.jobQueueArn}`, {
40059
+ this.logger.info(`AWS JOB -> invoking job ${jobName} ${queue.jobQueueArn}`, {
40058
40060
  request: submitJobRequest,
40059
40061
  });
40060
40062
  const result = await this.client().send(new SubmitJobCommand(submitJobRequest));
@@ -40142,7 +40144,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
40142
40144
  async ensureJobLogDriver(jobName, definition) {
40143
40145
  const logGroup = definition.infrastructureParams.logGroupName
40144
40146
  ? {
40145
- name: `/aws/batch/job-${definition.infrastructureParams.logGroupName}`,
40147
+ name: `/aws/batch/${awsBatchSettings.value.batchResourcesPrefix}-job-${definition.infrastructureParams.logGroupName}`,
40146
40148
  }
40147
40149
  : undefined;
40148
40150
  if (!logGroup) {
@@ -40239,12 +40241,13 @@ let AwsJobsProvider = class AwsJobsProvider {
40239
40241
  }
40240
40242
  async dispatch(input) {
40241
40243
  const { definition, schedule, instanceId, payload, commandPlaceholders } = input;
40242
- const awsInvocationParams = schedule?.invocationOverrides;
40244
+ const awsInvocationParams = schedule?.invocationOverrides ??
40245
+ definition.invocationParams;
40243
40246
  await this.awsBatchService.submitJob({
40244
40247
  instanceId,
40245
40248
  jobUid: definition.uid,
40246
40249
  overrides: {
40247
- command: awsInvocationParams?.startCommand?.map((x) => replacePlaceholders(replacePayload(x, payload), commandPlaceholders)),
40250
+ command: awsInvocationParams.startCommand?.map((x) => replacePlaceholders(replacePayload(x, payload), commandPlaceholders)),
40248
40251
  },
40249
40252
  });
40250
40253
  }