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

Function artifactsSetPreview

packages/core/sdk/src/executor.ts:6078–6093  ·  view source on GitHub ↗
(
      input: SetArtifactPreviewInput,
    )

Source from the content-addressed store, hash-verified

6076 * looked at is not an edit.
6077 */
6078 const artifactsSetPreview = (
6079 input: SetArtifactPreviewInput,
6080 ): Effect.Effect<void, ArtifactNotFoundError | StorageFailure> =>
6081 Effect.gen(function* () {
6082 const where = artifactById(input.id);
6083 const existing = yield* core.findFirst("artifact", { where });
6084 if (!existing) {
6085 return yield* new ArtifactNotFoundError({
6086 id: ArtifactId.make(input.id),
6087 });
6088 }
6089 yield* core.updateMany("artifact", {
6090 where,
6091 set: { preview: input.preview },
6092 });
6093 });
6094
6095 const artifactsRename = (
6096 input: RenameArtifactInput,

Callers

nothing calls this directly

Calls 1

artifactByIdFunction · 0.85

Tested by

no test coverage detected