@automate.ax/api-contract 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,9 @@
1
1
  export declare const eventsContract: {
2
+ slackEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3
+ type: import("zod").ZodString;
4
+ }, import("zod/v4/core").$loose>, import("zod").ZodObject<{
5
+ challenge: import("zod").ZodOptional<import("zod").ZodString>;
6
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
2
7
  gmailPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3
8
  message: import("zod").ZodObject<{
4
9
  data: import("zod").ZodString;
@@ -1,8 +1,10 @@
1
1
  import { googleCalendarEventsContract } from "./google-calendar.js";
2
2
  import { googleFormsEventsContract } from "./google-forms.js";
3
3
  import { gmailEventsContract } from "./gmail.js";
4
+ import { slackEventsContract } from "./slack.js";
4
5
  export const eventsContract = {
5
6
  ...googleCalendarEventsContract,
6
7
  ...googleFormsEventsContract,
7
8
  ...gmailEventsContract,
9
+ ...slackEventsContract,
8
10
  };
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export declare const slackEventsContract: {
3
+ slackEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
4
+ type: z.ZodString;
5
+ }, z.core.$loose>, z.ZodObject<{
6
+ challenge: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
8
+ };
@@ -0,0 +1,22 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { z } from "zod";
3
+ export const slackEventsContract = {
4
+ slackEvent: oc
5
+ .route({
6
+ method: "POST",
7
+ path: "/events/slack",
8
+ operationId: "receiveSlackEvent",
9
+ summary: "Receive a Slack event",
10
+ description: "Receives and authenticates callbacks delivered by the Slack Events API.",
11
+ tags: ["Events"],
12
+ successStatus: 200,
13
+ })
14
+ .input(z.looseObject({
15
+ /** Slack callback category. */
16
+ type: z.string(),
17
+ }))
18
+ .output(z.object({
19
+ /** Request URL verification challenge, when Slack is configuring it. */
20
+ challenge: z.string().optional(),
21
+ })),
22
+ };
package/dist/index.d.ts CHANGED
@@ -742,6 +742,11 @@ export declare const contract: {
742
742
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
743
743
  };
744
744
  events: {
745
+ slackEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
746
+ type: import("zod").ZodString;
747
+ }, import("zod/v4/core").$loose>, import("zod").ZodObject<{
748
+ challenge: import("zod").ZodOptional<import("zod").ZodString>;
749
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
745
750
  gmailPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
746
751
  message: import("zod").ZodObject<{
747
752
  data: import("zod").ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Public oRPC contract for the Automate.ax API.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@automate.ax/codec": "0.12.0",
29
+ "@automate.ax/codec": "0.13.0",
30
30
  "@orpc/contract": "1.13.14",
31
31
  "zod": "^4.3.6"
32
32
  },
@@ -1,9 +1,11 @@
1
1
  import { googleCalendarEventsContract } from "./google-calendar"
2
2
  import { googleFormsEventsContract } from "./google-forms"
3
3
  import { gmailEventsContract } from "./gmail"
4
+ import { slackEventsContract } from "./slack"
4
5
 
5
6
  export const eventsContract = {
6
7
  ...googleCalendarEventsContract,
7
8
  ...googleFormsEventsContract,
8
9
  ...gmailEventsContract,
10
+ ...slackEventsContract,
9
11
  }
@@ -0,0 +1,28 @@
1
+ import { oc } from "@orpc/contract"
2
+ import { z } from "zod"
3
+
4
+ export const slackEventsContract = {
5
+ slackEvent: oc
6
+ .route({
7
+ method: "POST",
8
+ path: "/events/slack",
9
+ operationId: "receiveSlackEvent",
10
+ summary: "Receive a Slack event",
11
+ description:
12
+ "Receives and authenticates callbacks delivered by the Slack Events API.",
13
+ tags: ["Events"],
14
+ successStatus: 200,
15
+ })
16
+ .input(
17
+ z.looseObject({
18
+ /** Slack callback category. */
19
+ type: z.string(),
20
+ }),
21
+ )
22
+ .output(
23
+ z.object({
24
+ /** Request URL verification challenge, when Slack is configuring it. */
25
+ challenge: z.string().optional(),
26
+ }),
27
+ ),
28
+ }