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

Function artifactsRename

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

Source from the content-addressed store, hash-verified

6093 });
6094
6095 const artifactsRename = (
6096 input: RenameArtifactInput,
6097 ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> =>
6098 Effect.gen(function* () {
6099 const where = artifactById(input.id);
6100 const existing = yield* core.findFirst("artifact", { where });
6101 if (!existing) {
6102 return yield* new ArtifactNotFoundError({
6103 id: ArtifactId.make(input.id),
6104 });
6105 }
6106 const set = { title: input.title, updated_at: new Date() };
6107 yield* core.updateMany("artifact", { where, set });
6108 return rowToArtifact({ ...existing, ...set });
6109 });
6110
6111 // Hard delete: an artifact is not a connection, so there is no disabled or
6112 // 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