@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,243 @@
|
|
|
1
|
+
import { type forms_v1 } from "@googleapis/forms";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { EMAIL_COLLECTION_TYPE_SCHEMA, FORM_ITEM_INPUT_SCHEMA } from "./schemas.js";
|
|
4
|
+
export interface QuestionMetadata {
|
|
5
|
+
questionId: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates the official Forms client from a resolved Google integration secret.
|
|
10
|
+
*
|
|
11
|
+
* @param secret - Refreshed Google integration secret.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getGoogleFormsApi(secret: Record<string, unknown>): forms_v1.Forms;
|
|
14
|
+
/**
|
|
15
|
+
* Accepts either a raw form ID or a standard Google Forms URL.
|
|
16
|
+
*
|
|
17
|
+
* @param form - Form ID or URL.
|
|
18
|
+
* @throws When a URL is not a recognizable Google Forms URL.
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeFormId(form: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Converts a code-first item definition to the provider request shape.
|
|
23
|
+
*
|
|
24
|
+
* @param input - Code-first form item.
|
|
25
|
+
*/
|
|
26
|
+
export declare function toGoogleFormItem(input: z.infer<typeof FORM_ITEM_INPUT_SCHEMA>): forms_v1.Schema$Item;
|
|
27
|
+
/**
|
|
28
|
+
* Normalizes a provider form and all nested items.
|
|
29
|
+
*
|
|
30
|
+
* @param form - Google Forms resource.
|
|
31
|
+
* @throws When required provider identifiers are absent.
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeForm(form: forms_v1.Schema$Form): {
|
|
34
|
+
editUrl: string;
|
|
35
|
+
formId: string;
|
|
36
|
+
items: {
|
|
37
|
+
index: number;
|
|
38
|
+
itemId: string;
|
|
39
|
+
questions: {
|
|
40
|
+
choices: string[];
|
|
41
|
+
questionId: string;
|
|
42
|
+
required: boolean;
|
|
43
|
+
type: "unknown" | "date" | "shortText" | "paragraph" | "multipleChoice" | "checkbox" | "dropdown" | "scale" | "time" | "duration" | "rating" | "fileUpload" | "gridRow";
|
|
44
|
+
date?: {
|
|
45
|
+
includeTime: boolean;
|
|
46
|
+
includeYear: boolean;
|
|
47
|
+
} | undefined;
|
|
48
|
+
fileUpload?: {
|
|
49
|
+
types: string[];
|
|
50
|
+
folderId?: string | undefined;
|
|
51
|
+
maxFileSizeBytes?: string | undefined;
|
|
52
|
+
maxFiles?: number | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
grading?: {
|
|
55
|
+
correctAnswers: string[];
|
|
56
|
+
correct?: boolean | undefined;
|
|
57
|
+
feedback?: string | undefined;
|
|
58
|
+
points?: number | undefined;
|
|
59
|
+
score?: number | undefined;
|
|
60
|
+
whenWrong?: string | undefined;
|
|
61
|
+
whenRight?: string | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
rating?: {
|
|
64
|
+
icon: string;
|
|
65
|
+
levels: number;
|
|
66
|
+
} | undefined;
|
|
67
|
+
rowTitle?: string | undefined;
|
|
68
|
+
scale?: {
|
|
69
|
+
high: number;
|
|
70
|
+
low: number;
|
|
71
|
+
highLabel?: string | undefined;
|
|
72
|
+
lowLabel?: string | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
}[];
|
|
75
|
+
title: string;
|
|
76
|
+
type: "unknown" | "text" | "question" | "grid" | "pageBreak" | "image" | "video";
|
|
77
|
+
description?: string | undefined;
|
|
78
|
+
}[];
|
|
79
|
+
settings: {
|
|
80
|
+
emailCollection: "none" | "verified" | "respondentInput";
|
|
81
|
+
isQuiz: boolean;
|
|
82
|
+
};
|
|
83
|
+
title: string;
|
|
84
|
+
linkedSheetId?: string | undefined;
|
|
85
|
+
publishSettings?: {
|
|
86
|
+
isAcceptingResponses: boolean;
|
|
87
|
+
isPublished: boolean;
|
|
88
|
+
} | undefined;
|
|
89
|
+
responderUrl?: string | undefined;
|
|
90
|
+
revisionId?: string | undefined;
|
|
91
|
+
description?: string | undefined;
|
|
92
|
+
documentTitle?: string | undefined;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Normalizes a provider item at its display position.
|
|
96
|
+
*
|
|
97
|
+
* @param item - Google Forms item.
|
|
98
|
+
* @param index - Zero-based display position.
|
|
99
|
+
*/
|
|
100
|
+
export declare function normalizeFormItem(item: forms_v1.Schema$Item, index: number): {
|
|
101
|
+
index: number;
|
|
102
|
+
itemId: string;
|
|
103
|
+
questions: {
|
|
104
|
+
choices: string[];
|
|
105
|
+
questionId: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
type: "unknown" | "date" | "shortText" | "paragraph" | "multipleChoice" | "checkbox" | "dropdown" | "scale" | "time" | "duration" | "rating" | "fileUpload" | "gridRow";
|
|
108
|
+
date?: {
|
|
109
|
+
includeTime: boolean;
|
|
110
|
+
includeYear: boolean;
|
|
111
|
+
} | undefined;
|
|
112
|
+
fileUpload?: {
|
|
113
|
+
types: string[];
|
|
114
|
+
folderId?: string | undefined;
|
|
115
|
+
maxFileSizeBytes?: string | undefined;
|
|
116
|
+
maxFiles?: number | undefined;
|
|
117
|
+
} | undefined;
|
|
118
|
+
grading?: {
|
|
119
|
+
correctAnswers: string[];
|
|
120
|
+
correct?: boolean | undefined;
|
|
121
|
+
feedback?: string | undefined;
|
|
122
|
+
points?: number | undefined;
|
|
123
|
+
score?: number | undefined;
|
|
124
|
+
whenWrong?: string | undefined;
|
|
125
|
+
whenRight?: string | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
rating?: {
|
|
128
|
+
icon: string;
|
|
129
|
+
levels: number;
|
|
130
|
+
} | undefined;
|
|
131
|
+
rowTitle?: string | undefined;
|
|
132
|
+
scale?: {
|
|
133
|
+
high: number;
|
|
134
|
+
low: number;
|
|
135
|
+
highLabel?: string | undefined;
|
|
136
|
+
lowLabel?: string | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
}[];
|
|
139
|
+
title: string;
|
|
140
|
+
type: "unknown" | "text" | "question" | "grid" | "pageBreak" | "image" | "video";
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Collects question titles in form display order.
|
|
145
|
+
*
|
|
146
|
+
* @param form - Google Forms resource.
|
|
147
|
+
*/
|
|
148
|
+
export declare function getQuestionMetadata(form: forms_v1.Schema$Form): QuestionMetadata[];
|
|
149
|
+
/**
|
|
150
|
+
* Normalizes a submitted response and sorts answers in form display order.
|
|
151
|
+
*
|
|
152
|
+
* @param response - Google Forms response.
|
|
153
|
+
* @param formId - Form ID used when list responses omit it.
|
|
154
|
+
* @param questions - Optional form question metadata.
|
|
155
|
+
* @throws When the provider response omits its response ID.
|
|
156
|
+
*/
|
|
157
|
+
export declare function normalizeFormResponse(response: forms_v1.Schema$FormResponse, formId: string, questions?: QuestionMetadata[]): {
|
|
158
|
+
answers: {
|
|
159
|
+
files: {
|
|
160
|
+
fileId: string;
|
|
161
|
+
fileName: string;
|
|
162
|
+
mimeType: string;
|
|
163
|
+
}[];
|
|
164
|
+
questionId: string;
|
|
165
|
+
values: string[];
|
|
166
|
+
grade?: {
|
|
167
|
+
correctAnswers: string[];
|
|
168
|
+
correct?: boolean | undefined;
|
|
169
|
+
feedback?: string | undefined;
|
|
170
|
+
points?: number | undefined;
|
|
171
|
+
score?: number | undefined;
|
|
172
|
+
whenWrong?: string | undefined;
|
|
173
|
+
whenRight?: string | undefined;
|
|
174
|
+
} | undefined;
|
|
175
|
+
questionTitle?: string | undefined;
|
|
176
|
+
}[];
|
|
177
|
+
formId: string;
|
|
178
|
+
responseId: string;
|
|
179
|
+
createTime?: string | undefined;
|
|
180
|
+
lastSubmittedTime?: string | undefined;
|
|
181
|
+
respondentEmail?: string | undefined;
|
|
182
|
+
totalScore?: number | undefined;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Resolves a one-based item position or immutable item ID to a zero-based
|
|
186
|
+
* index.
|
|
187
|
+
*
|
|
188
|
+
* @param formsApi - Authenticated Forms client.
|
|
189
|
+
* @param formId - Immutable form ID.
|
|
190
|
+
* @param reference - One-based position or item ID.
|
|
191
|
+
* @throws When the referenced item does not exist.
|
|
192
|
+
*/
|
|
193
|
+
export declare function resolveItemIndex(formsApi: forms_v1.Forms, formId: string, reference: string | number): Promise<number>;
|
|
194
|
+
/**
|
|
195
|
+
* Resolves a one-based item position or immutable item ID with its form.
|
|
196
|
+
*
|
|
197
|
+
* @param formsApi - Authenticated Forms client.
|
|
198
|
+
* @param formId - Immutable form ID.
|
|
199
|
+
* @param reference - One-based position or item ID.
|
|
200
|
+
* @throws When the referenced item does not exist.
|
|
201
|
+
*/
|
|
202
|
+
export declare function resolveFormItem(formsApi: forms_v1.Forms, formId: string, reference: string | number): Promise<{
|
|
203
|
+
form: forms_v1.Schema$Form;
|
|
204
|
+
index: number;
|
|
205
|
+
item: forms_v1.Schema$Item;
|
|
206
|
+
}>;
|
|
207
|
+
/**
|
|
208
|
+
* Preserves provider-generated item and question IDs during full replacement.
|
|
209
|
+
*
|
|
210
|
+
* @param next - Replacement item.
|
|
211
|
+
* @param current - Existing provider item.
|
|
212
|
+
*/
|
|
213
|
+
export declare function preserveItemIds(next: forms_v1.Schema$Item, current: forms_v1.Schema$Item): forms_v1.Schema$Item;
|
|
214
|
+
/**
|
|
215
|
+
* Resolves an optional one-based insertion position, defaulting to the end.
|
|
216
|
+
*
|
|
217
|
+
* @param formsApi - Authenticated Forms client.
|
|
218
|
+
* @param formId - Immutable form ID.
|
|
219
|
+
* @param position - Optional one-based insertion position.
|
|
220
|
+
*/
|
|
221
|
+
export declare function resolveInsertionIndex(formsApi: forms_v1.Forms, formId: string, position?: number): Promise<number>;
|
|
222
|
+
/**
|
|
223
|
+
* Converts public settings into Google Forms settings.
|
|
224
|
+
*
|
|
225
|
+
* @param settings - Code-first form settings.
|
|
226
|
+
* @param settings.emailCollection - Email collection behavior.
|
|
227
|
+
* @param settings.isQuiz - Whether the form is a quiz.
|
|
228
|
+
*/
|
|
229
|
+
export declare function toGoogleFormSettings(settings: {
|
|
230
|
+
emailCollection?: z.infer<typeof EMAIL_COLLECTION_TYPE_SCHEMA>;
|
|
231
|
+
isQuiz?: boolean;
|
|
232
|
+
}): forms_v1.Schema$FormSettings;
|
|
233
|
+
/**
|
|
234
|
+
* Builds a comma-separated settings update mask.
|
|
235
|
+
*
|
|
236
|
+
* @param settings - Code-first form settings.
|
|
237
|
+
* @param settings.emailCollection - Email collection behavior.
|
|
238
|
+
* @param settings.isQuiz - Whether the form is a quiz.
|
|
239
|
+
*/
|
|
240
|
+
export declare function getSettingsUpdateMask(settings: {
|
|
241
|
+
emailCollection?: z.infer<typeof EMAIL_COLLECTION_TYPE_SCHEMA>;
|
|
242
|
+
isQuiz?: boolean;
|
|
243
|
+
}): string;
|