@automate.ax/api-contract 0.37.0 → 0.39.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/airtable.d.ts +13 -0
- package/dist/events/airtable.js +21 -0
- package/dist/events/index.d.ts +14 -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 +14 -0
- package/package.json +2 -2
- package/src/events/airtable.ts +25 -0
- package/src/events/index.ts +4 -0
- package/src/events/whatsapp.ts +22 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const airtableEventsContract: {
|
|
3
|
+
airtableEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
+
base: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$loose>;
|
|
7
|
+
sourceId: z.ZodString;
|
|
8
|
+
timestamp: z.ZodISODateTime;
|
|
9
|
+
webhook: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
}, z.core.$loose>;
|
|
12
|
+
}, z.core.$loose>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const airtableEventsContract = {
|
|
4
|
+
airtableEvent: oc
|
|
5
|
+
.route({
|
|
6
|
+
method: "POST",
|
|
7
|
+
path: "/events/airtable/{sourceId}",
|
|
8
|
+
operationId: "receiveAirtableEvent",
|
|
9
|
+
summary: "Receive an Airtable webhook notification",
|
|
10
|
+
description: "Authenticates Airtable webhook pings and schedules payload retrieval.",
|
|
11
|
+
tags: ["Events"],
|
|
12
|
+
successStatus: 204,
|
|
13
|
+
})
|
|
14
|
+
.input(z.looseObject({
|
|
15
|
+
base: z.looseObject({ id: z.string() }),
|
|
16
|
+
sourceId: z.string(),
|
|
17
|
+
timestamp: z.iso.datetime({ offset: true }),
|
|
18
|
+
webhook: z.looseObject({ id: z.string() }),
|
|
19
|
+
}))
|
|
20
|
+
.output(z.void()),
|
|
21
|
+
};
|
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<{
|
|
@@ -79,4 +83,14 @@ export declare const eventsContract: {
|
|
|
79
83
|
events: import("zod").ZodPrefault<import("zod").ZodArray<import("zod").ZodJSONSchema>>;
|
|
80
84
|
sourceId: import("zod").ZodString;
|
|
81
85
|
}, import("zod/v4/core").$loose>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
86
|
+
airtableEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
87
|
+
base: import("zod").ZodObject<{
|
|
88
|
+
id: import("zod").ZodString;
|
|
89
|
+
}, import("zod/v4/core").$loose>;
|
|
90
|
+
sourceId: import("zod").ZodString;
|
|
91
|
+
timestamp: import("zod").ZodISODateTime;
|
|
92
|
+
webhook: import("zod").ZodObject<{
|
|
93
|
+
id: import("zod").ZodString;
|
|
94
|
+
}, import("zod/v4/core").$loose>;
|
|
95
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
82
96
|
};
|
package/dist/events/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { airtableEventsContract } from "./airtable.js";
|
|
1
2
|
import { asanaEventsContract } from "./asana.js";
|
|
2
3
|
import { brevoEventsContract } from "./brevo.js";
|
|
3
4
|
import { googleCalendarEventsContract } from "./google-calendar.js";
|
|
@@ -8,7 +9,9 @@ import { microsoftEventsContract } from "./microsoft.js";
|
|
|
8
9
|
import { resendEventsContract } from "./resend.js";
|
|
9
10
|
import { slackEventsContract } from "./slack.js";
|
|
10
11
|
import { trelloEventsContract } from "./trello.js";
|
|
12
|
+
import { whatsappEventsContract } from "./whatsapp.js";
|
|
11
13
|
export const eventsContract = {
|
|
14
|
+
...airtableEventsContract,
|
|
12
15
|
...asanaEventsContract,
|
|
13
16
|
...brevoEventsContract,
|
|
14
17
|
...googleCalendarEventsContract,
|
|
@@ -19,4 +22,5 @@ export const eventsContract = {
|
|
|
19
22
|
...resendEventsContract,
|
|
20
23
|
...slackEventsContract,
|
|
21
24
|
...trelloEventsContract,
|
|
25
|
+
...whatsappEventsContract,
|
|
22
26
|
};
|
|
@@ -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<{
|
|
@@ -1043,6 +1047,16 @@ export declare const contract: {
|
|
|
1043
1047
|
events: import("zod").ZodPrefault<import("zod").ZodArray<import("zod").ZodJSONSchema>>;
|
|
1044
1048
|
sourceId: import("zod").ZodString;
|
|
1045
1049
|
}, import("zod/v4/core").$loose>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
1050
|
+
airtableEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
1051
|
+
base: import("zod").ZodObject<{
|
|
1052
|
+
id: import("zod").ZodString;
|
|
1053
|
+
}, import("zod/v4/core").$loose>;
|
|
1054
|
+
sourceId: import("zod").ZodString;
|
|
1055
|
+
timestamp: import("zod").ZodISODateTime;
|
|
1056
|
+
webhook: import("zod").ZodObject<{
|
|
1057
|
+
id: import("zod").ZodString;
|
|
1058
|
+
}, import("zod/v4/core").$loose>;
|
|
1059
|
+
}, import("zod/v4/core").$loose>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
1046
1060
|
};
|
|
1047
1061
|
runtime: {
|
|
1048
1062
|
commit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.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.39.0",
|
|
31
31
|
"@orpc/contract": "1.13.14",
|
|
32
32
|
"zod": "^4.3.6"
|
|
33
33
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const airtableEventsContract = {
|
|
5
|
+
airtableEvent: oc
|
|
6
|
+
.route({
|
|
7
|
+
method: "POST",
|
|
8
|
+
path: "/events/airtable/{sourceId}",
|
|
9
|
+
operationId: "receiveAirtableEvent",
|
|
10
|
+
summary: "Receive an Airtable webhook notification",
|
|
11
|
+
description:
|
|
12
|
+
"Authenticates Airtable webhook pings and schedules payload retrieval.",
|
|
13
|
+
tags: ["Events"],
|
|
14
|
+
successStatus: 204,
|
|
15
|
+
})
|
|
16
|
+
.input(
|
|
17
|
+
z.looseObject({
|
|
18
|
+
base: z.looseObject({ id: z.string() }),
|
|
19
|
+
sourceId: z.string(),
|
|
20
|
+
timestamp: z.iso.datetime({ offset: true }),
|
|
21
|
+
webhook: z.looseObject({ id: z.string() }),
|
|
22
|
+
}),
|
|
23
|
+
)
|
|
24
|
+
.output(z.void()),
|
|
25
|
+
}
|
package/src/events/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { airtableEventsContract } from "./airtable"
|
|
1
2
|
import { asanaEventsContract } from "./asana"
|
|
2
3
|
import { brevoEventsContract } from "./brevo"
|
|
3
4
|
import { googleCalendarEventsContract } from "./google-calendar"
|
|
@@ -8,8 +9,10 @@ import { microsoftEventsContract } from "./microsoft"
|
|
|
8
9
|
import { resendEventsContract } from "./resend"
|
|
9
10
|
import { slackEventsContract } from "./slack"
|
|
10
11
|
import { trelloEventsContract } from "./trello"
|
|
12
|
+
import { whatsappEventsContract } from "./whatsapp"
|
|
11
13
|
|
|
12
14
|
export const eventsContract = {
|
|
15
|
+
...airtableEventsContract,
|
|
13
16
|
...asanaEventsContract,
|
|
14
17
|
...brevoEventsContract,
|
|
15
18
|
...googleCalendarEventsContract,
|
|
@@ -20,4 +23,5 @@ export const eventsContract = {
|
|
|
20
23
|
...resendEventsContract,
|
|
21
24
|
...slackEventsContract,
|
|
22
25
|
...trelloEventsContract,
|
|
26
|
+
...whatsappEventsContract,
|
|
23
27
|
}
|
|
@@ -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
|
+
}
|