@automate.ax/integration-contracts 0.107.0 → 0.109.1
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.js +6 -4
- package/dist/airtable/index.d.ts +997 -19
- package/dist/airtable/index.js +30 -2
- package/dist/airtable/schemas.d.ts +2034 -44
- package/dist/airtable/schemas.js +231 -47
- package/dist/brevo/api.d.ts +41 -0
- package/dist/brevo/api.js +74 -4
- package/dist/linear/schemas.d.ts +3 -5
- package/dist/linear/schemas.js +0 -2
- package/dist/notion/schemas.d.ts +4 -4
- package/package.json +2 -2
- package/src/airtable/api.ts +7 -4
- package/src/airtable/index.ts +36 -1
- package/src/airtable/schemas.ts +294 -63
- package/src/brevo/api.ts +103 -8
- package/src/linear/schemas.ts +0 -3
package/dist/airtable/api.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
export const AIRTABLE_API_ORIGIN = "https://api.airtable.com/v0/";
|
|
3
|
-
const AIRTABLE_SECRET_SCHEMA = z.
|
|
4
|
-
accessToken: z.string().min(1),
|
|
5
|
-
})
|
|
3
|
+
const AIRTABLE_SECRET_SCHEMA = z.union([
|
|
4
|
+
z.object({ accessToken: z.string().min(1) }),
|
|
5
|
+
z.object({ apiKey: z.string().min(1) }),
|
|
6
|
+
]);
|
|
6
7
|
const AIRTABLE_ERROR_SCHEMA = z.object({
|
|
7
8
|
error: z.union([
|
|
8
9
|
z.string(),
|
|
@@ -18,7 +19,8 @@ const AIRTABLE_ERROR_SCHEMA = z.object({
|
|
|
18
19
|
* @param secret - Refreshed Airtable integration secret.
|
|
19
20
|
*/
|
|
20
21
|
export function getAirtableApi(secret) {
|
|
21
|
-
const
|
|
22
|
+
const credential = AIRTABLE_SECRET_SCHEMA.parse(secret);
|
|
23
|
+
const accessToken = "accessToken" in credential ? credential.accessToken : credential.apiKey;
|
|
22
24
|
return {
|
|
23
25
|
request: async (path, init) => {
|
|
24
26
|
const headers = new Headers(init?.headers);
|