@automate.ax/integration-contracts 0.55.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/airtable/api.d.ts +19 -0
- package/dist/airtable/api.js +44 -0
- package/dist/airtable/index.d.ts +353 -0
- package/dist/airtable/index.js +32 -0
- package/dist/airtable/schemas.d.ts +716 -0
- package/dist/airtable/schemas.js +184 -0
- package/dist/asana/api.d.ts +70 -0
- package/dist/asana/api.js +119 -0
- package/dist/asana/index.d.ts +384 -0
- package/dist/asana/index.js +38 -0
- package/dist/asana/schemas.d.ts +1060 -0
- package/dist/asana/schemas.js +512 -0
- package/dist/brevo/api.d.ts +31 -0
- package/dist/brevo/api.js +64 -0
- package/dist/brevo/index.d.ts +822 -0
- package/dist/brevo/index.js +51 -0
- package/dist/brevo/schemas.d.ts +1217 -0
- package/dist/brevo/schemas.js +332 -0
- package/dist/github/index.d.ts +37 -0
- package/dist/github/index.js +106 -0
- package/dist/github/schemas.d.ts +8014 -0
- package/dist/github/schemas.js +113 -0
- package/dist/gmail/gmail.d.ts +172 -0
- package/dist/gmail/gmail.js +405 -0
- package/dist/gmail/index.d.ts +262 -0
- package/dist/gmail/index.js +23 -0
- package/dist/gmail/schemas.d.ts +444 -0
- package/dist/gmail/schemas.js +242 -0
- package/dist/google-calendar/event-schemas.d.ts +117 -0
- package/dist/google-calendar/event-schemas.js +13 -0
- package/dist/google-calendar/google-calendar.d.ts +147 -0
- package/dist/google-calendar/google-calendar.js +583 -0
- package/dist/google-calendar/index.d.ts +365 -0
- package/dist/google-calendar/index.js +24 -0
- package/dist/google-calendar/schemas.d.ts +592 -0
- package/dist/google-calendar/schemas.js +379 -0
- package/dist/google-forms/event-schemas.d.ts +105 -0
- package/dist/google-forms/event-schemas.js +20 -0
- package/dist/google-forms/google-forms.d.ts +243 -0
- package/dist/google-forms/google-forms.js +581 -0
- package/dist/google-forms/index.d.ts +141 -0
- package/dist/google-forms/index.js +20 -0
- package/dist/google-forms/schemas.d.ts +618 -0
- package/dist/google-forms/schemas.js +383 -0
- package/dist/linear/api.d.ts +63 -0
- package/dist/linear/api.js +88 -0
- package/dist/linear/index.d.ts +1338 -0
- package/dist/linear/index.js +55 -0
- package/dist/linear/schemas.d.ts +1795 -0
- package/dist/linear/schemas.js +760 -0
- package/dist/outlook/graph.d.ts +34 -0
- package/dist/outlook/graph.js +98 -0
- package/dist/outlook/index.d.ts +115 -0
- package/dist/outlook/index.js +11 -0
- package/dist/outlook/schemas.d.ts +529 -0
- package/dist/outlook/schemas.js +312 -0
- package/dist/resend/index.d.ts +707 -0
- package/dist/resend/index.js +54 -0
- package/dist/resend/schemas.d.ts +1033 -0
- package/dist/resend/schemas.js +377 -0
- package/dist/slack/index.d.ts +151 -0
- package/dist/slack/index.js +22 -0
- package/dist/slack/schemas.d.ts +641 -0
- package/dist/slack/schemas.js +581 -0
- package/dist/teams/graph.d.ts +33 -0
- package/dist/teams/graph.js +95 -0
- package/dist/teams/index.d.ts +164 -0
- package/dist/teams/index.js +21 -0
- package/dist/teams/schemas.d.ts +675 -0
- package/dist/teams/schemas.js +365 -0
- package/dist/trello/api.d.ts +69 -0
- package/dist/trello/api.js +140 -0
- package/dist/trello/event-schemas.d.ts +1101 -0
- package/dist/trello/event-schemas.js +233 -0
- package/dist/trello/index.d.ts +721 -0
- package/dist/trello/index.js +35 -0
- package/dist/trello/schemas.d.ts +283 -0
- package/dist/trello/schemas.js +401 -0
- package/dist/triggers.d.ts +26 -0
- package/dist/triggers.js +33 -0
- package/dist/vercel/index.d.ts +1065 -0
- package/dist/vercel/index.js +114 -0
- package/dist/vercel/schemas.d.ts +1518 -0
- package/dist/vercel/schemas.js +335 -0
- package/dist/whatsapp/api.d.ts +62 -0
- package/dist/whatsapp/api.js +121 -0
- package/dist/whatsapp/index.d.ts +614 -0
- package/dist/whatsapp/index.js +35 -0
- package/dist/whatsapp/schemas.d.ts +926 -0
- package/dist/whatsapp/schemas.js +326 -0
- package/package.json +169 -0
- package/src/airtable/api.ts +66 -0
- package/src/airtable/index.ts +41 -0
- package/src/airtable/schemas.ts +231 -0
- package/src/asana/api.ts +171 -0
- package/src/asana/index.ts +49 -0
- package/src/asana/schemas.ts +655 -0
- package/src/brevo/api.ts +89 -0
- package/src/brevo/index.ts +66 -0
- package/src/brevo/schemas.ts +449 -0
- package/src/github/index.ts +217 -0
- package/src/github/schemas.ts +435 -0
- package/src/gmail/gmail.ts +577 -0
- package/src/gmail/index.ts +26 -0
- package/src/gmail/schemas.ts +327 -0
- package/src/google-calendar/event-schemas.ts +16 -0
- package/src/google-calendar/google-calendar.ts +727 -0
- package/src/google-calendar/index.ts +27 -0
- package/src/google-calendar/schemas.ts +529 -0
- package/src/google-forms/event-schemas.ts +26 -0
- package/src/google-forms/google-forms.ts +683 -0
- package/src/google-forms/index.ts +23 -0
- package/src/google-forms/schemas.ts +499 -0
- package/src/linear/api.ts +141 -0
- package/src/linear/index.ts +71 -0
- package/src/linear/schemas.ts +1060 -0
- package/src/outlook/graph.ts +132 -0
- package/src/outlook/index.ts +14 -0
- package/src/outlook/schemas.ts +388 -0
- package/src/resend/index.ts +70 -0
- package/src/resend/schemas.ts +462 -0
- package/src/slack/index.ts +29 -0
- package/src/slack/schemas.ts +737 -0
- package/src/teams/graph.ts +130 -0
- package/src/teams/index.ts +27 -0
- package/src/teams/schemas.ts +463 -0
- package/src/trello/api.ts +190 -0
- package/src/trello/event-schemas.ts +290 -0
- package/src/trello/index.ts +45 -0
- package/src/trello/schemas.ts +507 -0
- package/src/triggers.ts +68 -0
- package/src/vercel/index.ts +147 -0
- package/src/vercel/schemas.ts +594 -0
- package/src/whatsapp/api.ts +171 -0
- package/src/whatsapp/index.ts +46 -0
- package/src/whatsapp/schemas.ts +341 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const GRAPH_BASE_URL = "https://graph.microsoft.com/v1.0/";
|
|
3
|
+
const MICROSOFT_SECRET_SCHEMA = z.object({
|
|
4
|
+
accessToken: z.string().min(1),
|
|
5
|
+
});
|
|
6
|
+
const GRAPH_ERROR_SCHEMA = z.looseObject({
|
|
7
|
+
error: z
|
|
8
|
+
.looseObject({
|
|
9
|
+
code: z.string().optional(),
|
|
10
|
+
message: z.string().optional(),
|
|
11
|
+
})
|
|
12
|
+
.optional(),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Creates a small authenticated Microsoft Graph client for Teams APIs.
|
|
16
|
+
*
|
|
17
|
+
* The raw `fetch` method is an escape hatch for Graph operations not yet
|
|
18
|
+
* represented by a built-in action.
|
|
19
|
+
*
|
|
20
|
+
* @param secret - Refreshed Microsoft OAuth integration secret.
|
|
21
|
+
*/
|
|
22
|
+
export function getTeamsGraphApi(secret) {
|
|
23
|
+
const { accessToken } = MICROSOFT_SECRET_SCHEMA.parse(secret);
|
|
24
|
+
/**
|
|
25
|
+
* Performs one authenticated Graph request.
|
|
26
|
+
*
|
|
27
|
+
* @param path - Relative or absolute Microsoft Graph URL.
|
|
28
|
+
* @param init - Standard fetch request options.
|
|
29
|
+
*/
|
|
30
|
+
async function graphFetch(path, init) {
|
|
31
|
+
const headers = new Headers(init?.headers);
|
|
32
|
+
headers.set("Accept", "application/json");
|
|
33
|
+
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
34
|
+
return fetch(new URL(path.replace(/^\//, ""), GRAPH_BASE_URL), {
|
|
35
|
+
...init,
|
|
36
|
+
headers,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Performs one authenticated Graph JSON request.
|
|
41
|
+
*
|
|
42
|
+
* @param path - Relative or absolute Microsoft Graph URL.
|
|
43
|
+
* @param options - HTTP method, body, and headers.
|
|
44
|
+
*/
|
|
45
|
+
async function request(path, options = {}) {
|
|
46
|
+
const headers = new Headers(options.headers);
|
|
47
|
+
if (options.body !== undefined) {
|
|
48
|
+
headers.set("Content-Type", "application/json");
|
|
49
|
+
}
|
|
50
|
+
const response = await graphFetch(path, {
|
|
51
|
+
body: options.body === undefined ? undefined : JSON.stringify(options.body),
|
|
52
|
+
headers,
|
|
53
|
+
method: options.method,
|
|
54
|
+
});
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
const payload = GRAPH_ERROR_SCHEMA.safeParse(await response.json().catch(() => undefined));
|
|
57
|
+
const graphError = payload.success ? payload.data.error : undefined;
|
|
58
|
+
const detail = [graphError?.code, graphError?.message]
|
|
59
|
+
.filter(Boolean)
|
|
60
|
+
.join(": ");
|
|
61
|
+
throw new Error(`Microsoft Graph request failed with ${response.status} ${response.statusText}${detail ? `: ${detail}` : ""}.`);
|
|
62
|
+
}
|
|
63
|
+
if (response.status === 202 || response.status === 204)
|
|
64
|
+
return undefined;
|
|
65
|
+
return response.json();
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
/** Performs an authenticated request and returns the raw Response. */
|
|
69
|
+
fetch: graphFetch,
|
|
70
|
+
/** Performs an authenticated request and returns its untrusted JSON value. */
|
|
71
|
+
request,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Reads Graph collection pages until the requested limit is reached.
|
|
76
|
+
*
|
|
77
|
+
* @param request - Authenticated Graph JSON request function.
|
|
78
|
+
* @param path - Initial relative Graph path.
|
|
79
|
+
* @param itemSchema - Schema for one collection item.
|
|
80
|
+
* @param limit - Maximum total items.
|
|
81
|
+
*/
|
|
82
|
+
export async function listTeamsGraphCollection(request, path, itemSchema, limit) {
|
|
83
|
+
const pageSchema = z.object({
|
|
84
|
+
"@odata.nextLink": z.string().optional(),
|
|
85
|
+
value: itemSchema.array(),
|
|
86
|
+
});
|
|
87
|
+
const items = [];
|
|
88
|
+
let nextPath = path;
|
|
89
|
+
while (nextPath && items.length < limit) {
|
|
90
|
+
const page = pageSchema.parse(await request(nextPath));
|
|
91
|
+
items.push(...page.value);
|
|
92
|
+
nextPath = page["@odata.nextLink"];
|
|
93
|
+
}
|
|
94
|
+
return items.slice(0, limit);
|
|
95
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export * from "./graph.js";
|
|
3
|
+
export * from "./schemas.js";
|
|
4
|
+
export declare const TEAMS_CHANNEL_TRIGGER_CONFIG_SCHEMA: z.ZodObject<{
|
|
5
|
+
channel: z.ZodString;
|
|
6
|
+
team: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const TEAMS_CHAT_TRIGGER_CONFIG_SCHEMA: z.ZodObject<{
|
|
9
|
+
chatId: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const teamsTriggerContracts: {
|
|
12
|
+
readonly "teams.channel.message.posted": {
|
|
13
|
+
readonly configSchema: z.ZodObject<{
|
|
14
|
+
channel: z.ZodString;
|
|
15
|
+
team: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
readonly eventSchema: z.ZodObject<{
|
|
18
|
+
attachments: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
19
|
+
attachmentId: z.ZodString;
|
|
20
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
21
|
+
contentType: z.ZodString;
|
|
22
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
23
|
+
contentUrl: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
24
|
+
}, z.core.$strip>>>;
|
|
25
|
+
body: z.ZodObject<{
|
|
26
|
+
content: z.ZodString;
|
|
27
|
+
contentType: z.ZodEnum<{
|
|
28
|
+
text: "text";
|
|
29
|
+
html: "html";
|
|
30
|
+
}>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
createdAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
33
|
+
deletedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
34
|
+
etag: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
35
|
+
from: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
36
|
+
applicationId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
37
|
+
deviceId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
38
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
39
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
40
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
41
|
+
applicationId: string | undefined;
|
|
42
|
+
deviceId: string | undefined;
|
|
43
|
+
displayName: string | undefined;
|
|
44
|
+
userId: string | undefined;
|
|
45
|
+
} | undefined, {
|
|
46
|
+
applicationId: string | undefined;
|
|
47
|
+
deviceId: string | undefined;
|
|
48
|
+
displayName: string | undefined;
|
|
49
|
+
userId: string | undefined;
|
|
50
|
+
} | null | undefined>>;
|
|
51
|
+
importance: z.ZodPrefault<z.ZodEnum<{
|
|
52
|
+
high: "high";
|
|
53
|
+
normal: "normal";
|
|
54
|
+
unknownFutureValue: "unknownFutureValue";
|
|
55
|
+
urgent: "urgent";
|
|
56
|
+
}>>;
|
|
57
|
+
locale: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
58
|
+
messageId: z.ZodString;
|
|
59
|
+
messageType: z.ZodString;
|
|
60
|
+
mentions: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
61
|
+
mentionId: z.ZodNumber;
|
|
62
|
+
mentionText: z.ZodString;
|
|
63
|
+
mentioned: z.ZodObject<{
|
|
64
|
+
applicationId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
65
|
+
deviceId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
66
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
67
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
reactions: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
71
|
+
reactionType: z.ZodString;
|
|
72
|
+
createdAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
73
|
+
user: z.ZodObject<{
|
|
74
|
+
applicationId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
75
|
+
deviceId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
76
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
77
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
replyToId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
81
|
+
subject: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
82
|
+
summary: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
83
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
84
|
+
webUrl: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
85
|
+
channelId: z.ZodString;
|
|
86
|
+
teamId: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
};
|
|
89
|
+
readonly "teams.chat.message.posted": {
|
|
90
|
+
readonly configSchema: z.ZodObject<{
|
|
91
|
+
chatId: z.ZodString;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
readonly eventSchema: z.ZodObject<{
|
|
94
|
+
attachments: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
95
|
+
attachmentId: z.ZodString;
|
|
96
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
97
|
+
contentType: z.ZodString;
|
|
98
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
99
|
+
contentUrl: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
100
|
+
}, z.core.$strip>>>;
|
|
101
|
+
body: z.ZodObject<{
|
|
102
|
+
content: z.ZodString;
|
|
103
|
+
contentType: z.ZodEnum<{
|
|
104
|
+
text: "text";
|
|
105
|
+
html: "html";
|
|
106
|
+
}>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
createdAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
109
|
+
deletedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
110
|
+
etag: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
111
|
+
from: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
112
|
+
applicationId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
113
|
+
deviceId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
114
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
115
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
116
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
117
|
+
applicationId: string | undefined;
|
|
118
|
+
deviceId: string | undefined;
|
|
119
|
+
displayName: string | undefined;
|
|
120
|
+
userId: string | undefined;
|
|
121
|
+
} | undefined, {
|
|
122
|
+
applicationId: string | undefined;
|
|
123
|
+
deviceId: string | undefined;
|
|
124
|
+
displayName: string | undefined;
|
|
125
|
+
userId: string | undefined;
|
|
126
|
+
} | null | undefined>>;
|
|
127
|
+
importance: z.ZodPrefault<z.ZodEnum<{
|
|
128
|
+
high: "high";
|
|
129
|
+
normal: "normal";
|
|
130
|
+
unknownFutureValue: "unknownFutureValue";
|
|
131
|
+
urgent: "urgent";
|
|
132
|
+
}>>;
|
|
133
|
+
locale: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
134
|
+
messageId: z.ZodString;
|
|
135
|
+
messageType: z.ZodString;
|
|
136
|
+
mentions: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
137
|
+
mentionId: z.ZodNumber;
|
|
138
|
+
mentionText: z.ZodString;
|
|
139
|
+
mentioned: z.ZodObject<{
|
|
140
|
+
applicationId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
141
|
+
deviceId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
142
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
143
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
}, z.core.$strip>>>;
|
|
146
|
+
reactions: z.ZodPrefault<z.ZodArray<z.ZodObject<{
|
|
147
|
+
reactionType: z.ZodString;
|
|
148
|
+
createdAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
149
|
+
user: z.ZodObject<{
|
|
150
|
+
applicationId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
151
|
+
deviceId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
152
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
153
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
}, z.core.$strip>>>;
|
|
156
|
+
replyToId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
157
|
+
subject: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
158
|
+
summary: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
159
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>]>>>, z.ZodTransform<Date | undefined, Date | null | undefined>>;
|
|
160
|
+
webUrl: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
|
|
161
|
+
chatId: z.ZodString;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TEAMS_CHANNEL_MESSAGE_POSTED_EVENT_SCHEMA, TEAMS_CHAT_MESSAGE_POSTED_EVENT_SCHEMA, } from "./schemas.js";
|
|
3
|
+
export * from "./graph.js";
|
|
4
|
+
export * from "./schemas.js";
|
|
5
|
+
export const TEAMS_CHANNEL_TRIGGER_CONFIG_SCHEMA = z.object({
|
|
6
|
+
channel: z.string().trim().min(1),
|
|
7
|
+
team: z.string().trim().min(1),
|
|
8
|
+
});
|
|
9
|
+
export const TEAMS_CHAT_TRIGGER_CONFIG_SCHEMA = z.object({
|
|
10
|
+
chatId: z.string().min(1),
|
|
11
|
+
});
|
|
12
|
+
export const teamsTriggerContracts = {
|
|
13
|
+
"teams.channel.message.posted": {
|
|
14
|
+
configSchema: TEAMS_CHANNEL_TRIGGER_CONFIG_SCHEMA,
|
|
15
|
+
eventSchema: TEAMS_CHANNEL_MESSAGE_POSTED_EVENT_SCHEMA,
|
|
16
|
+
},
|
|
17
|
+
"teams.chat.message.posted": {
|
|
18
|
+
configSchema: TEAMS_CHAT_TRIGGER_CONFIG_SCHEMA,
|
|
19
|
+
eventSchema: TEAMS_CHAT_MESSAGE_POSTED_EVENT_SCHEMA,
|
|
20
|
+
},
|
|
21
|
+
};
|