@punks/backend-entity-manager 0.0.271 → 0.0.272

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/dist/cjs/index.js CHANGED
@@ -33701,7 +33701,7 @@ let JobsSchedulerTask = JobsSchedulerTask_1 = class JobsSchedulerTask {
33701
33701
  }
33702
33702
  async run() {
33703
33703
  this.logger.info(`JobsSchedulerTask -> run start`);
33704
- const jobs = await this.jobDefinitions.all();
33704
+ const jobs = await this.jobDefinitions.getAllDefinitions();
33705
33705
  for (const job of jobs) {
33706
33706
  await this.evaluateJob(job);
33707
33707
  }
@@ -33776,7 +33776,7 @@ let JobsMonitorTask = JobsMonitorTask_1 = class JobsMonitorTask {
33776
33776
  async monitorInstance(instance) {
33777
33777
  try {
33778
33778
  this.logger.info(`JobsMonitorTask -> evaluating job ${instance.id}`);
33779
- const job = await this.jobDefinitions.getByUid(instance.jobUid);
33779
+ const job = await this.jobDefinitions.getDefinitionByUid(instance.jobUid);
33780
33780
  if (!job) {
33781
33781
  throw new Error(`Job definition not found -> ${instance.jobUid}`);
33782
33782
  }
@@ -33918,7 +33918,7 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33918
33918
  const instanceId = backendCore.newUuid();
33919
33919
  try {
33920
33920
  this.logger.info(`JOB DISPATCH -> dispatching started job ${job.uid} -> ${instanceId}`);
33921
- await this.instances.append(job, {
33921
+ await this.instances.appendInstance(job, {
33922
33922
  id: instanceId,
33923
33923
  runType,
33924
33924
  scheduleUid: schedule.uid,
@@ -33929,13 +33929,13 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33929
33929
  schedule,
33930
33930
  instanceId,
33931
33931
  });
33932
- await this.instances.update(instanceId, {
33932
+ await this.instances.updateInstance(instanceId, {
33933
33933
  status: exports.JobStatus.Ready,
33934
33934
  });
33935
33935
  this.logger.info(`JOB DISPATCH -> dispatching completed job ${job.uid} -> ${instanceId}`);
33936
33936
  }
33937
33937
  catch (e) {
33938
- await this.instances.update(instanceId, {
33938
+ await this.instances.updateInstance(instanceId, {
33939
33939
  status: exports.JobStatus.InitializationError,
33940
33940
  error: `${e.message} -> \n\n ${e.stack}`,
33941
33941
  });
@@ -33981,7 +33981,7 @@ let JobStatusMonitorHandler = JobStatusMonitorHandler_1 = class JobStatusMonitor
33981
33981
  const { input: { job, instanceId }, } = command;
33982
33982
  try {
33983
33983
  this.logger.info(`JOB STATUS UPDATE -> dispatching started job ${job.uid} -> ${instanceId}`);
33984
- const current = await this.instances.get(instanceId);
33984
+ const current = await this.instances.getById(instanceId);
33985
33985
  if (!current) {
33986
33986
  throw new Error(`Job instance ${instanceId} not found`);
33987
33987
  }
@@ -33997,7 +33997,7 @@ let JobStatusMonitorHandler = JobStatusMonitorHandler_1 = class JobStatusMonitor
33997
33997
  this.logger.info(`JOB STATUS UPDATE -> status unchanged ${job.uid} -> ${instanceId}`);
33998
33998
  return;
33999
33999
  }
34000
- await this.instances.update(instanceId, {
34000
+ await this.instances.updateInstance(instanceId, {
34001
34001
  status: newStatus,
34002
34002
  endTime: !current.endTime && isJobEnded(newStatus) ? new Date() : undefined,
34003
34003
  startTime: !current.startTime && isJobStarted(newStatus)
@@ -34045,7 +34045,7 @@ let JobDefinitionUpdateHandler = JobDefinitionUpdateHandler_1 = class JobDefinit
34045
34045
  await this.executor.upsertJobDefinition({
34046
34046
  definition: job,
34047
34047
  });
34048
- await this.definitions.ensure(job);
34048
+ await this.definitions.ensureDefinition(job);
34049
34049
  this.logger.info(`JOB DEFINITION UPDATE -> status update completed job ${job.uid}`);
34050
34050
  }
34051
34051
  };