@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 04:45 UTC

main
ts 59 lines 1.97 KB
Raw
1 import type * as smsvoice from "@distilled.cloud/aws/pinpoint-sms-voice-v2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { PhoneNumber } from "./PhoneNumber.ts";
5
6 /**
7 * The `OriginationIdentity` is injected by the binding from the bound
8 * phone number; the caller supplies the destination and message body.
9 */
10 export interface SendTextMessageRequest extends Omit<
11 smsvoice.SendTextMessageRequest,
12 "OriginationIdentity"
13 > {}
14
15 /**
16 * Runtime binding for `sms-voice:SendTextMessage`.
17 *
18 * Sends an SMS message from the bound origination phone number to one
19 * recipient — the effectful call made from a deployed Lambda or Task. The
20 * deploy-time half grants `sms-voice:SendTextMessage` on the number and
21 * the runtime half injects its ARN as the request's `OriginationIdentity`.
22 * Provide the implementation with
23 * `Effect.provide(AWS.PinpointSMSVoiceV2.SendTextMessageHttp)`.
24 * ### Sending Text Messages
25 * **Example:** Send an SMS from a Lambda
26 * ```typescript
27 * // init — lease a number and bind the send operation
28 * const number = yield* AWS.PinpointSMSVoiceV2.PhoneNumber("Sender", {
29 * isoCountryCode: "US",
30 * messageType: "TRANSACTIONAL",
31 * numberCapabilities: ["SMS"],
32 * numberType: "TOLL_FREE",
33 * });
34 * const sendText = yield* AWS.PinpointSMSVoiceV2.SendTextMessage(number);
35 *
36 * // runtime
37 * const { MessageId } = yield* sendText({
38 * DestinationPhoneNumber: "+12065550100",
39 * MessageBody: "Your code is 123456",
40 * MessageType: "TRANSACTIONAL",
41 * });
42 * ```
43 *
44 * @binding
45 */
46 export interface SendTextMessage extends Binding.Service<
47 SendTextMessage,
48 "AWS.PinpointSMSVoiceV2.SendTextMessage",
49 (
50 phoneNumber: PhoneNumber,
51 ) => Effect.Effect<
52 (
53 request: SendTextMessageRequest,
54 ) => Effect.Effect<smsvoice.SendTextMessageResult, smsvoice.SendTextMessageError>
55 >
56 > {}
57 export const SendTextMessage = Binding.Service<SendTextMessage>(
58 "AWS.PinpointSMSVoiceV2.SendTextMessage",
59 );