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

Function artifactsRename

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

Source from the content-addressed store, hash-verified

6212 });
6213
6214 const artifactsRename = (
6215 input: RenameArtifactInput,
6216 ): Effect.Effect<Artifact, ArtifactNotFoundError | StorageFailure> =>
6217 Effect.gen(function* () {
6218 const where = artifactById(input.id);
6219 const existing = yield* core.findFirst("artifact", { where });
6220 if (!existing) {
6221 return yield* new ArtifactNotFoundError({
6222 id: ArtifactId.make(input.id),
6223 });
6224 }
6225 const set = { title: input.title, updated_at: new Date() };
6226 yield* core.updateMany("artifact", { where, set });
6227 return rowToArtifact({ ...existing, ...set });
6228 });
6229
6230 // Hard delete: an artifact is not a connection, so there is no disabled or
6231 // 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