(input: {
readonly owner: Owner;
readonly name: string;
readonly slug?: string;
})
| 349 | ); |
| 350 | |
| 351 | const create = (input: { |
| 352 | readonly owner: Owner; |
| 353 | readonly name: string; |
| 354 | readonly slug?: string; |
| 355 | }) => |
| 356 | Effect.gen(function* () { |
| 357 | const name = input.name.trim(); |
| 358 | if (!name) return yield* fail("Toolkit name is required."); |
| 359 | const slug = yield* normalizeSlugEffect({ name, slug: input.slug }); |
| 360 | yield* assertSlugAvailable(slug); |
| 361 | const now = Date.now(); |
| 362 | const id = newId("tk"); |
| 363 | const entry = yield* storage.toolkits.put({ |
| 364 | owner: input.owner, |
| 365 | key: id, |
| 366 | data: { id, slug, name, createdAt: now, updatedAt: now }, |
| 367 | }); |
| 368 | return toolkitToResponse(entry); |
| 369 | }); |
| 370 | |
| 371 | const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) => |
| 372 | Effect.gen(function* () { |
nothing calls this directly
no test coverage detected