MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / artifactsRename

Function artifactsRename

packages/core/sdk/src/executor.ts:5596–5608  ·  view source on GitHub ↗
(
      input: RenameArtifactInput,
    )

Source from the content-addressed store, hash-verified

5594 });
5595
5596 const artifactsRename = (
5597 input: RenameArtifactInput,
5598 ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> =>
5599 Effect.gen(function* () {
5600 const where = artifactById(input.id);
5601 const existing = yield* core.findFirst("artifact", { where });
5602 if (!existing) {
5603 return yield* new ArtifactNotFoundError({ id: ArtifactId.make(input.id) });
5604 }
5605 const set = { title: input.title, updated_at: new Date() };
5606 yield* core.updateMany("artifact", { where, set });
5607 return rowToArtifact({ ...existing, ...set });
5608 });
5609
5610 // Hard delete: an artifact is not a connection, so there is no disabled or
5611 // archived state to fall back to.

Callers

nothing calls this directly

Calls 2

rowToArtifactFunction · 0.90
artifactByIdFunction · 0.85

Tested by

no test coverage detected