@happyvertical/smrt-ingestion 0.57.9 → 0.57.11

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.
@@ -6848,7 +6848,7 @@ var IntakeExecutionService = class {
6848
6848
  if (!Array.isArray(references)) throw new Error("Feedback lineage unavailable");
6849
6849
  if (references.length === 0) return;
6850
6850
  if (!this.options.feedback) throw new Error("Feedback configuration unavailable");
6851
- const { IntakeFeedbackService } = await import("./feedback-DmuvGO2o.js").then((n) => n.r);
6851
+ const { IntakeFeedbackService } = await import("./feedback-CJB900iG.js").then((n) => n.r);
6852
6852
  await new IntakeFeedbackService(this.options, this).assertActionLineage(String(bound.action.id), db, String(bound.proposal.id));
6853
6853
  }
6854
6854
  async getAction(actionId) {
@@ -7592,7 +7592,8 @@ var IntakeExecutionService = class {
7592
7592
  })
7593
7593
  });
7594
7594
  await db.query("UPDATE intake_actions SET state='executing',execution_attempt=?,fence=? WHERE id=? AND tenant_id=? AND confidential_scope_id=?", attemptNumber, fence, actionId, this.scope.tenantId, this.scope.confidentialScopeId);
7595
- if (bound2.handler.execution.kind === "external") {
7595
+ const domainExecution = bound2.handler.execution;
7596
+ if (domainExecution.kind === "external") {
7596
7597
  reserved = {
7597
7598
  bound: bound2,
7598
7599
  execution: execution2,
@@ -7603,20 +7604,17 @@ var IntakeExecutionService = class {
7603
7604
  actionId
7604
7605
  };
7605
7606
  }
7606
- await db.query("SAVEPOINT ingestion_domain_effect");
7607
7607
  try {
7608
- const effect = await bound2.handler.execution.apply(args, context);
7609
- this.validate(bound2.handler.resultSchema, effect, context.policy.maxBytes);
7610
- for (const [field, model] of Object.entries(bound2.handler.resultModels)) {
7611
- id(effect[field]);
7612
- await context.assertTarget(model, effect[field]);
7613
- }
7614
- const completed = await this.finish(db, bound2, execution2, effect);
7615
- await db.query("RELEASE SAVEPOINT ingestion_domain_effect");
7616
- return completed;
7608
+ return await withEmbeddedWriteTransaction(db, isEmbeddedDatabase(db), async (effectDb) => this.principal(effectDb, bound2.item, bound2.handler, "execute", async (effectContext) => {
7609
+ const effect = await domainExecution.apply(args, effectContext);
7610
+ this.validate(bound2.handler.resultSchema, effect, effectContext.policy.maxBytes);
7611
+ for (const [field, model] of Object.entries(bound2.handler.resultModels)) {
7612
+ id(effect[field]);
7613
+ await effectContext.assertTarget(model, effect[field]);
7614
+ }
7615
+ return this.finish(effectDb, bound2, execution2, effect);
7616
+ }));
7617
7617
  } catch {
7618
- await db.query("ROLLBACK TO SAVEPOINT ingestion_domain_effect");
7619
- await db.query("RELEASE SAVEPOINT ingestion_domain_effect");
7620
7618
  const deadline = this.retentionIntents.getStore()?.get(String(bound2.item.id));
7621
7619
  if (deadline !== void 0) Object.assign(bound2.item, await this.restoreRetention(db, String(bound2.item.id), deadline));
7622
7620
  if (!this.retained(bound2.item)) await this.redactExecution(db, bound2.item);
@@ -8028,4 +8026,4 @@ async function continueIntakeReview(service, actionId, task) {
8028
8026
  //#endregion
8029
8027
  export { feedbackActionTransaction as a, __exportAll as c, resolveIntakePolicy as i, __toESM as l, continueIntakeReview as n, feedbackDiscoveryContext as o, intakeBindingDigest as r, require_ajv as s, IntakeExecutionService as t };
8030
8028
 
8031
- //# sourceMappingURL=execution-TWeIv0o-.js.map
8029
+ //# sourceMappingURL=execution-NoDh3pjs.js.map