The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import type * as personalizeevents from "@distilled.cloud/aws/personalize-events"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Dataset } from "./Dataset.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `PutItems` request with `datasetArn` injected from the bound dataset. |
| 8 | */ |
| 9 | export interface PutItemsRequest extends Omit<personalizeevents.PutItemsRequest, "datasetArn"> {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `personalize:PutItems`, scoped to one {@link Dataset} — |
| 13 | * Adds or updates items incrementally in the bound Items {@link Dataset} |
| 14 | * — the streaming alternative to a bulk dataset import job for keeping |
| 15 | * the catalog fresh. |
| 16 | * Provide the implementation with |
| 17 | * `Effect.provide(AWS.Personalize.PutItemsHttp)`. |
| 18 | * |
| 19 | * ### Incremental Imports |
| 20 | * **Example:** Upsert an Item |
| 21 | * ```typescript |
| 22 | * // init |
| 23 | * const putItems = yield* Personalize.PutItems(itemsDataset); |
| 24 | * |
| 25 | * yield* putItems({ |
| 26 | * items: [{ |
| 27 | * itemId: "item-42", |
| 28 | * properties: JSON.stringify({ category: "books" }), |
| 29 | * }], |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface PutItems extends Binding.Service< |
| 36 | PutItems, |
| 37 | "AWS.Personalize.PutItems", |
| 38 | ( |
| 39 | dataset: Dataset, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: PutItemsRequest, |
| 43 | ) => Effect.Effect<personalizeevents.PutItemsResponse, personalizeevents.PutItemsError> |
| 44 | > |
| 45 | > {} |
| 46 | export const PutItems = Binding.Service<PutItems>("AWS.Personalize.PutItems"); |