@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, 06:00 UTC

main
ts 40 lines 1.22 KB
Raw
1 import * as sns from "@distilled.cloud/aws/sns";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { PlatformApplication } from "./PlatformApplication.ts";
5
6 export interface PublishToEndpointRequest extends Omit<
7 sns.PublishInput,
8 "TopicArn" | "PhoneNumber"
9 > {}
10
11 /**
12 * Runtime binding for `sns:Publish`.
13 *
14 * Runtime binding for `sns:Publish` targeting a mobile-push endpoint of a
15 * {@link PlatformApplication}: pass the device `TargetArn` returned by
16 * `CreatePlatformEndpoint`.
17 * Provide the `PublishToEndpointHttp` layer on the Function to implement the binding.
18 * ### Mobile Push
19 * **Example:** Push to a Device
20 * ```typescript
21 * const publishToEndpoint = yield* SNS.PublishToEndpoint(app);
22 * yield* publishToEndpoint({
23 * TargetArn: endpointArn,
24 * Message: "hello",
25 * });
26 * ```
27 *
28 * @binding
29 */
30 export interface PublishToEndpoint extends Binding.Service<
31 PublishToEndpoint,
32 "AWS.SNS.PublishToEndpoint",
33 (
34 application: PlatformApplication,
35 ) => Effect.Effect<
36 (request: PublishToEndpointRequest) => Effect.Effect<sns.PublishResponse, sns.PublishError>
37 >
38 > {}
39
40 export const PublishToEndpoint = Binding.Service<PublishToEndpoint>("AWS.SNS.PublishToEndpoint");