(input: {
readonly owner: Owner;
readonly name: string;
readonly slug?: string;
})
| 303 | ); |
| 304 | |
| 305 | const create = (input: { |
| 306 | readonly owner: Owner; |
| 307 | readonly name: string; |
| 308 | readonly slug?: string; |
| 309 | }) => |
| 310 | Effect.gen(function* () { |
| 311 | const name = input.name.trim(); |
| 312 | if (!name) return yield* fail("Toolkit name is required."); |
| 313 | const slug = yield* normalizeSlugEffect({ name, slug: input.slug }); |
| 314 | yield* assertSlugAvailable(slug); |
| 315 | const now = Date.now(); |
| 316 | const id = newId("tk"); |
| 317 | const entry = yield* storage.toolkits.put({ |
| 318 | owner: input.owner, |
| 319 | key: id, |
| 320 | data: { id, slug, name, createdAt: now, updatedAt: now }, |
| 321 | }); |
| 322 | return toolkitToResponse(entry); |
| 323 | }); |
| 324 | |
| 325 | const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) => |
| 326 | Effect.gen(function* () { |
nothing calls this directly
no test coverage detected