@automate.ax/api-contract 0.38.0 → 0.40.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.
- package/dist/events/github.d.ts +8 -0
- package/dist/events/github.js +24 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.js +4 -0
- package/dist/events/whatsapp.d.ts +7 -0
- package/dist/events/whatsapp.js +19 -0
- package/dist/index.d.ts +9 -0
- package/package.json +2 -2
- package/src/events/github.ts +28 -0
- package/src/events/index.ts +4 -0
- package/src/events/whatsapp.ts +22 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const githubEventsContract: {
|
|
3
|
+
githubEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
+
installation: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
}, z.core.$loose>>;
|
|
7
|
+
}, z.core.$loose>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const githubEventsContract = {
|
|
4
|
+
githubEvent: oc
|
|
5
|
+
.route({
|
|
6
|
+
method: "POST",
|
|
7
|
+
path: "/events/github",
|
|
8
|
+
operationId: "receiveGitHubEvent",
|
|
9
|
+
summary: "Receive a GitHub event",
|
|
10
|
+
description: "Receives and authenticates callbacks delivered by a GitHub App.",
|
|
11
|
+
tags: ["Events"],
|
|
12
|
+
successStatus: 200,
|
|
13
|
+
})
|
|
14
|
+
.input(z.looseObject({
|
|
15
|
+
/** GitHub App installation that received the event. */
|
|
16
|
+
installation: z
|
|
17
|
+
.looseObject({
|
|
18
|
+
/** Stable GitHub App installation ID. */
|
|
19
|
+
id: z.number().int().positive(),
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
22
|
+
}))
|
|
23
|
+
.output(z.object({})),
|
|
24
|
+
};
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const eventsContract: {
|
|
2
|
+
whatsappEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
3
|
+
entry: import("zod").ZodArray<import("zod").ZodUnknown>;
|
|
4
|
+
object: import("zod").ZodLiteral<"whatsapp_business_account">;
|
|
5
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
2
6
|
trelloEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
3
7
|
sourceId: import("zod").ZodString;
|
|
4
8
|
action: import("zod").ZodObject<{
|
|
@@ -46,6 +50,11 @@ export declare const eventsContract: {
|
|
|
46
50
|
type: import("zod").ZodString;
|
|
47
51
|
webhookTimestamp: import("zod").ZodNumber;
|
|
48
52
|
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
53
|
+
githubEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
54
|
+
installation: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
55
|
+
id: import("zod").ZodNumber;
|
|
56
|
+
}, import("zod/v4/core").$loose>>;
|
|
57
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
49
58
|
gmailPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
50
59
|
message: import("zod").ZodObject<{
|
|
51
60
|
data: import("zod").ZodString;
|
package/dist/events/index.js
CHANGED
|
@@ -4,11 +4,13 @@ import { brevoEventsContract } from "./brevo.js";
|
|
|
4
4
|
import { googleCalendarEventsContract } from "./google-calendar.js";
|
|
5
5
|
import { googleFormsEventsContract } from "./google-forms.js";
|
|
6
6
|
import { gmailEventsContract } from "./gmail.js";
|
|
7
|
+
import { githubEventsContract } from "./github.js";
|
|
7
8
|
import { linearEventsContract } from "./linear.js";
|
|
8
9
|
import { microsoftEventsContract } from "./microsoft.js";
|
|
9
10
|
import { resendEventsContract } from "./resend.js";
|
|
10
11
|
import { slackEventsContract } from "./slack.js";
|
|
11
12
|
import { trelloEventsContract } from "./trello.js";
|
|
13
|
+
import { whatsappEventsContract } from "./whatsapp.js";
|
|
12
14
|
export const eventsContract = {
|
|
13
15
|
...airtableEventsContract,
|
|
14
16
|
...asanaEventsContract,
|
|
@@ -16,9 +18,11 @@ export const eventsContract = {
|
|
|
16
18
|
...googleCalendarEventsContract,
|
|
17
19
|
...googleFormsEventsContract,
|
|
18
20
|
...gmailEventsContract,
|
|
21
|
+
...githubEventsContract,
|
|
19
22
|
...linearEventsContract,
|
|
20
23
|
...microsoftEventsContract,
|
|
21
24
|
...resendEventsContract,
|
|
22
25
|
...slackEventsContract,
|
|
23
26
|
...trelloEventsContract,
|
|
27
|
+
...whatsappEventsContract,
|
|
24
28
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const whatsappEventsContract: {
|
|
3
|
+
whatsappEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
+
entry: z.ZodArray<z.ZodUnknown>;
|
|
5
|
+
object: z.ZodLiteral<"whatsapp_business_account">;
|
|
6
|
+
}, z.core.$loose>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const whatsappEventsContract = {
|
|
4
|
+
whatsappEvent: oc
|
|
5
|
+
.route({
|
|
6
|
+
method: "POST",
|
|
7
|
+
path: "/events/whatsapp",
|
|
8
|
+
operationId: "receiveWhatsAppEvent",
|
|
9
|
+
summary: "Receive a WhatsApp event",
|
|
10
|
+
description: "Receives and authenticates WhatsApp Business webhooks.",
|
|
11
|
+
tags: ["Events"],
|
|
12
|
+
successStatus: 200,
|
|
13
|
+
})
|
|
14
|
+
.input(z.looseObject({
|
|
15
|
+
entry: z.unknown().array(),
|
|
16
|
+
object: z.literal("whatsapp_business_account"),
|
|
17
|
+
}))
|
|
18
|
+
.output(z.object({})),
|
|
19
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -963,6 +963,10 @@ export declare const contract: {
|
|
|
963
963
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
964
964
|
};
|
|
965
965
|
events: {
|
|
966
|
+
whatsappEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
967
|
+
entry: import("zod").ZodArray<import("zod").ZodUnknown>;
|
|
968
|
+
object: import("zod").ZodLiteral<"whatsapp_business_account">;
|
|
969
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
966
970
|
trelloEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
967
971
|
sourceId: import("zod").ZodString;
|
|
968
972
|
action: import("zod").ZodObject<{
|
|
@@ -1010,6 +1014,11 @@ export declare const contract: {
|
|
|
1010
1014
|
type: import("zod").ZodString;
|
|
1011
1015
|
webhookTimestamp: import("zod").ZodNumber;
|
|
1012
1016
|
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
1017
|
+
githubEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
1018
|
+
installation: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1019
|
+
id: import("zod").ZodNumber;
|
|
1020
|
+
}, import("zod/v4/core").$loose>>;
|
|
1021
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodObject<{}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
1013
1022
|
gmailPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
1014
1023
|
message: import("zod").ZodObject<{
|
|
1015
1024
|
data: import("zod").ZodString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@ai-sdk/gateway": "^4.0.46",
|
|
30
|
-
"@automate.ax/codec": "0.
|
|
30
|
+
"@automate.ax/codec": "0.40.0",
|
|
31
31
|
"@orpc/contract": "1.13.14",
|
|
32
32
|
"zod": "^4.3.6"
|
|
33
33
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const githubEventsContract = {
|
|
5
|
+
githubEvent: oc
|
|
6
|
+
.route({
|
|
7
|
+
method: "POST",
|
|
8
|
+
path: "/events/github",
|
|
9
|
+
operationId: "receiveGitHubEvent",
|
|
10
|
+
summary: "Receive a GitHub event",
|
|
11
|
+
description:
|
|
12
|
+
"Receives and authenticates callbacks delivered by a GitHub App.",
|
|
13
|
+
tags: ["Events"],
|
|
14
|
+
successStatus: 200,
|
|
15
|
+
})
|
|
16
|
+
.input(
|
|
17
|
+
z.looseObject({
|
|
18
|
+
/** GitHub App installation that received the event. */
|
|
19
|
+
installation: z
|
|
20
|
+
.looseObject({
|
|
21
|
+
/** Stable GitHub App installation ID. */
|
|
22
|
+
id: z.number().int().positive(),
|
|
23
|
+
})
|
|
24
|
+
.optional(),
|
|
25
|
+
}),
|
|
26
|
+
)
|
|
27
|
+
.output(z.object({})),
|
|
28
|
+
}
|
package/src/events/index.ts
CHANGED
|
@@ -4,11 +4,13 @@ import { brevoEventsContract } from "./brevo"
|
|
|
4
4
|
import { googleCalendarEventsContract } from "./google-calendar"
|
|
5
5
|
import { googleFormsEventsContract } from "./google-forms"
|
|
6
6
|
import { gmailEventsContract } from "./gmail"
|
|
7
|
+
import { githubEventsContract } from "./github"
|
|
7
8
|
import { linearEventsContract } from "./linear"
|
|
8
9
|
import { microsoftEventsContract } from "./microsoft"
|
|
9
10
|
import { resendEventsContract } from "./resend"
|
|
10
11
|
import { slackEventsContract } from "./slack"
|
|
11
12
|
import { trelloEventsContract } from "./trello"
|
|
13
|
+
import { whatsappEventsContract } from "./whatsapp"
|
|
12
14
|
|
|
13
15
|
export const eventsContract = {
|
|
14
16
|
...airtableEventsContract,
|
|
@@ -17,9 +19,11 @@ export const eventsContract = {
|
|
|
17
19
|
...googleCalendarEventsContract,
|
|
18
20
|
...googleFormsEventsContract,
|
|
19
21
|
...gmailEventsContract,
|
|
22
|
+
...githubEventsContract,
|
|
20
23
|
...linearEventsContract,
|
|
21
24
|
...microsoftEventsContract,
|
|
22
25
|
...resendEventsContract,
|
|
23
26
|
...slackEventsContract,
|
|
24
27
|
...trelloEventsContract,
|
|
28
|
+
...whatsappEventsContract,
|
|
25
29
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const whatsappEventsContract = {
|
|
5
|
+
whatsappEvent: oc
|
|
6
|
+
.route({
|
|
7
|
+
method: "POST",
|
|
8
|
+
path: "/events/whatsapp",
|
|
9
|
+
operationId: "receiveWhatsAppEvent",
|
|
10
|
+
summary: "Receive a WhatsApp event",
|
|
11
|
+
description: "Receives and authenticates WhatsApp Business webhooks.",
|
|
12
|
+
tags: ["Events"],
|
|
13
|
+
successStatus: 200,
|
|
14
|
+
})
|
|
15
|
+
.input(
|
|
16
|
+
z.looseObject({
|
|
17
|
+
entry: z.unknown().array(),
|
|
18
|
+
object: z.literal("whatsapp_business_account"),
|
|
19
|
+
}),
|
|
20
|
+
)
|
|
21
|
+
.output(z.object({})),
|
|
22
|
+
}
|