@squadbase/connectors 0.1.2-dev.0 → 0.1.2-dev.2
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/{chunk-Q5TIPE53.js → chunk-HHVJKPCD.js} +207 -36
- package/dist/index.d.ts +291 -118
- package/dist/index.js +3018 -1274
- package/dist/sdk.d.ts +355 -169
- package/dist/sdk.js +431 -237
- package/package.json +1 -1
package/dist/sdk.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parameters,
|
|
3
|
+
parameters10,
|
|
4
|
+
parameters11,
|
|
5
|
+
parameters12,
|
|
6
|
+
parameters13,
|
|
7
|
+
parameters14,
|
|
8
|
+
parameters15,
|
|
9
|
+
parameters16,
|
|
10
|
+
parameters17,
|
|
11
|
+
parameters18,
|
|
3
12
|
parameters2,
|
|
4
13
|
parameters3,
|
|
5
14
|
parameters4,
|
|
@@ -8,18 +17,18 @@ import {
|
|
|
8
17
|
parameters7,
|
|
9
18
|
parameters8,
|
|
10
19
|
parameters9
|
|
11
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HHVJKPCD.js";
|
|
12
21
|
|
|
13
22
|
// src/connectors/kintone/sdk/index.ts
|
|
14
23
|
function createClient(params) {
|
|
15
|
-
const baseUrl = params[
|
|
16
|
-
const username = params[
|
|
17
|
-
const password = params[
|
|
24
|
+
const baseUrl = params[parameters7.baseUrl.slug];
|
|
25
|
+
const username = params[parameters7.username.slug];
|
|
26
|
+
const password = params[parameters7.password.slug];
|
|
18
27
|
if (!baseUrl || !username || !password) {
|
|
19
28
|
const required = [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
parameters7.baseUrl.slug,
|
|
30
|
+
parameters7.username.slug,
|
|
31
|
+
parameters7.password.slug
|
|
23
32
|
];
|
|
24
33
|
const missing = required.filter((s) => !params[s]);
|
|
25
34
|
throw new Error(
|
|
@@ -79,12 +88,33 @@ function createClient(params) {
|
|
|
79
88
|
};
|
|
80
89
|
}
|
|
81
90
|
|
|
82
|
-
// src/connectors/
|
|
91
|
+
// src/connectors/kintone-api-token/sdk/index.ts
|
|
83
92
|
function createClient2(params) {
|
|
84
|
-
const
|
|
93
|
+
const baseUrl = params[parameters8.baseUrl.slug];
|
|
94
|
+
const apiToken = params[parameters8.apiToken.slug];
|
|
95
|
+
if (!baseUrl || !apiToken) {
|
|
96
|
+
const required = [parameters8.baseUrl.slug, parameters8.apiToken.slug];
|
|
97
|
+
const missing = required.filter((s) => !params[s]);
|
|
98
|
+
throw new Error(
|
|
99
|
+
`kintone: missing required parameters: ${missing.join(", ")}`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
request(path, init) {
|
|
104
|
+
const url = `${baseUrl.replace(/\/+$/, "")}${path}`;
|
|
105
|
+
const headers = new Headers(init?.headers);
|
|
106
|
+
headers.set("X-Cybozu-API-Token", apiToken);
|
|
107
|
+
return fetch(url, { ...init, headers });
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/connectors/openai/sdk/index.ts
|
|
113
|
+
function createClient3(params) {
|
|
114
|
+
const apiKey = params[parameters11.apiKey.slug];
|
|
85
115
|
if (!apiKey) {
|
|
86
116
|
throw new Error(
|
|
87
|
-
`openai: missing required parameter: ${
|
|
117
|
+
`openai: missing required parameter: ${parameters11.apiKey.slug}`
|
|
88
118
|
);
|
|
89
119
|
}
|
|
90
120
|
return { apiKey };
|
|
@@ -92,7 +122,7 @@ function createClient2(params) {
|
|
|
92
122
|
|
|
93
123
|
// src/connectors/airtable/sdk/index.ts
|
|
94
124
|
var BASE_URL = "https://api.airtable.com/v0";
|
|
95
|
-
function
|
|
125
|
+
function createClient4(params) {
|
|
96
126
|
const baseId = params[parameters.baseId.slug];
|
|
97
127
|
const apiKey = params[parameters.apiKey.slug];
|
|
98
128
|
if (!baseId || !apiKey) {
|
|
@@ -223,10 +253,84 @@ function createClient3(params) {
|
|
|
223
253
|
};
|
|
224
254
|
}
|
|
225
255
|
|
|
256
|
+
// src/connectors/google-ads-oauth/sdk/index.ts
|
|
257
|
+
var BASE_URL2 = "https://googleads.googleapis.com/v18/";
|
|
258
|
+
function createClient5(params, fetchFn = fetch) {
|
|
259
|
+
const rawCustomerId = params[parameters2.customerId.slug];
|
|
260
|
+
const defaultCustomerId = rawCustomerId?.replace(/-/g, "") ?? "";
|
|
261
|
+
const developerToken = params[parameters2.developerToken.slug];
|
|
262
|
+
if (!developerToken) {
|
|
263
|
+
throw new Error(
|
|
264
|
+
`google-ads: missing required parameter: ${parameters2.developerToken.slug}`
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
function resolveCustomerId(override) {
|
|
268
|
+
const id = override?.replace(/-/g, "") ?? defaultCustomerId;
|
|
269
|
+
if (!id) {
|
|
270
|
+
throw new Error(
|
|
271
|
+
"google-ads: customerId is required. Either configure a default or pass it explicitly."
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
return id;
|
|
275
|
+
}
|
|
276
|
+
function request(path, init) {
|
|
277
|
+
const resolvedPath = defaultCustomerId ? path.replace(/\{customerId\}/g, defaultCustomerId) : path;
|
|
278
|
+
const url = `${BASE_URL2}${resolvedPath}`;
|
|
279
|
+
const headers = new Headers(init?.headers);
|
|
280
|
+
headers.set("developer-token", developerToken);
|
|
281
|
+
if (defaultCustomerId) {
|
|
282
|
+
headers.set("login-customer-id", defaultCustomerId);
|
|
283
|
+
}
|
|
284
|
+
return fetchFn(url, { ...init, headers });
|
|
285
|
+
}
|
|
286
|
+
async function search(query, customerId) {
|
|
287
|
+
const cid = resolveCustomerId(customerId);
|
|
288
|
+
const url = `${BASE_URL2}customers/${cid}/googleAds:searchStream`;
|
|
289
|
+
const headers = new Headers();
|
|
290
|
+
headers.set("Content-Type", "application/json");
|
|
291
|
+
headers.set("developer-token", developerToken);
|
|
292
|
+
headers.set("login-customer-id", cid);
|
|
293
|
+
const response = await fetchFn(url, {
|
|
294
|
+
method: "POST",
|
|
295
|
+
headers,
|
|
296
|
+
body: JSON.stringify({ query })
|
|
297
|
+
});
|
|
298
|
+
if (!response.ok) {
|
|
299
|
+
const body = await response.text();
|
|
300
|
+
throw new Error(
|
|
301
|
+
`google-ads: search failed (${response.status}): ${body}`
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
const data = await response.json();
|
|
305
|
+
return data.flatMap((chunk) => chunk.results ?? []);
|
|
306
|
+
}
|
|
307
|
+
async function listAccessibleCustomers() {
|
|
308
|
+
const url = `${BASE_URL2}customers:listAccessibleCustomers`;
|
|
309
|
+
const headers = new Headers();
|
|
310
|
+
headers.set("developer-token", developerToken);
|
|
311
|
+
const response = await fetchFn(url, { method: "GET", headers });
|
|
312
|
+
if (!response.ok) {
|
|
313
|
+
const body = await response.text();
|
|
314
|
+
throw new Error(
|
|
315
|
+
`google-ads: listAccessibleCustomers failed (${response.status}): ${body}`
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
const data = await response.json();
|
|
319
|
+
return (data.resourceNames ?? []).map(
|
|
320
|
+
(rn) => rn.replace(/^customers\//, "")
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
request,
|
|
325
|
+
search,
|
|
326
|
+
listAccessibleCustomers
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
226
330
|
// src/connectors/google-analytics/sdk/index.ts
|
|
227
331
|
import * as crypto from "crypto";
|
|
228
332
|
var TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
229
|
-
var
|
|
333
|
+
var BASE_URL3 = "https://analyticsdata.googleapis.com/v1beta/";
|
|
230
334
|
var SCOPE = "https://www.googleapis.com/auth/analytics.readonly";
|
|
231
335
|
function base64url(input) {
|
|
232
336
|
const buf = typeof input === "string" ? Buffer.from(input) : input;
|
|
@@ -250,13 +354,13 @@ function buildJwt(clientEmail, privateKey, nowSec) {
|
|
|
250
354
|
const signature = base64url(sign.sign(privateKey));
|
|
251
355
|
return `${signingInput}.${signature}`;
|
|
252
356
|
}
|
|
253
|
-
function
|
|
254
|
-
const serviceAccountKeyJsonBase64 = params[
|
|
255
|
-
const propertyId = params[
|
|
357
|
+
function createClient6(params) {
|
|
358
|
+
const serviceAccountKeyJsonBase64 = params[parameters3.serviceAccountKeyJsonBase64.slug];
|
|
359
|
+
const propertyId = params[parameters3.propertyId.slug];
|
|
256
360
|
if (!serviceAccountKeyJsonBase64 || !propertyId) {
|
|
257
361
|
const required = [
|
|
258
|
-
|
|
259
|
-
|
|
362
|
+
parameters3.serviceAccountKeyJsonBase64.slug,
|
|
363
|
+
parameters3.propertyId.slug
|
|
260
364
|
];
|
|
261
365
|
const missing = required.filter((s) => !params[s]);
|
|
262
366
|
throw new Error(
|
|
@@ -315,7 +419,7 @@ function createClient4(params) {
|
|
|
315
419
|
async request(path, init) {
|
|
316
420
|
const accessToken = await getAccessToken();
|
|
317
421
|
const resolvedPath = path.replace(/\{propertyId\}/g, propertyId);
|
|
318
|
-
const url = `${
|
|
422
|
+
const url = `${BASE_URL3.replace(/\/+$/, "")}/${resolvedPath.replace(/^\/+/, "")}`;
|
|
319
423
|
const headers = new Headers(init?.headers);
|
|
320
424
|
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
321
425
|
return fetch(url, { ...init, headers });
|
|
@@ -378,16 +482,162 @@ function createClient4(params) {
|
|
|
378
482
|
};
|
|
379
483
|
}
|
|
380
484
|
|
|
485
|
+
// src/connectors/google-analytics-oauth/sdk/index.ts
|
|
486
|
+
var BASE_URL4 = "https://analyticsdata.googleapis.com/v1beta/";
|
|
487
|
+
function createClient7(params, fetchFn = fetch) {
|
|
488
|
+
const propertyId = params[parameters4.propertyId.slug];
|
|
489
|
+
function resolvePropertyId() {
|
|
490
|
+
if (!propertyId) {
|
|
491
|
+
throw new Error(
|
|
492
|
+
"google-analytics-oauth: propertyId is required. Configure it via connection parameters."
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
return propertyId;
|
|
496
|
+
}
|
|
497
|
+
return {
|
|
498
|
+
async request(path, init) {
|
|
499
|
+
const pid = propertyId;
|
|
500
|
+
const resolvedPath = pid ? path.replace(/\{propertyId\}/g, pid) : path;
|
|
501
|
+
const url = `${BASE_URL4.replace(/\/+$/, "")}/${resolvedPath.replace(/^\/+/, "")}`;
|
|
502
|
+
return fetchFn(url, init);
|
|
503
|
+
},
|
|
504
|
+
async runReport(request) {
|
|
505
|
+
const pid = resolvePropertyId();
|
|
506
|
+
const response = await this.request(
|
|
507
|
+
`properties/${pid}:runReport`,
|
|
508
|
+
{
|
|
509
|
+
method: "POST",
|
|
510
|
+
headers: { "Content-Type": "application/json" },
|
|
511
|
+
body: JSON.stringify(request)
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
if (!response.ok) {
|
|
515
|
+
const text = await response.text();
|
|
516
|
+
throw new Error(
|
|
517
|
+
`google-analytics-oauth: runReport failed (${response.status}): ${text}`
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
const data = await response.json();
|
|
521
|
+
return {
|
|
522
|
+
rows: data.rows ?? [],
|
|
523
|
+
rowCount: data.rowCount ?? 0
|
|
524
|
+
};
|
|
525
|
+
},
|
|
526
|
+
async getMetadata() {
|
|
527
|
+
const pid = resolvePropertyId();
|
|
528
|
+
const response = await this.request(
|
|
529
|
+
`properties/${pid}/metadata`,
|
|
530
|
+
{ method: "GET" }
|
|
531
|
+
);
|
|
532
|
+
if (!response.ok) {
|
|
533
|
+
const text = await response.text();
|
|
534
|
+
throw new Error(
|
|
535
|
+
`google-analytics-oauth: getMetadata failed (${response.status}): ${text}`
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
return await response.json();
|
|
539
|
+
},
|
|
540
|
+
async runRealtimeReport(request) {
|
|
541
|
+
const pid = resolvePropertyId();
|
|
542
|
+
const response = await this.request(
|
|
543
|
+
`properties/${pid}:runRealtimeReport`,
|
|
544
|
+
{
|
|
545
|
+
method: "POST",
|
|
546
|
+
headers: { "Content-Type": "application/json" },
|
|
547
|
+
body: JSON.stringify(request)
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
if (!response.ok) {
|
|
551
|
+
const text = await response.text();
|
|
552
|
+
throw new Error(
|
|
553
|
+
`google-analytics-oauth: runRealtimeReport failed (${response.status}): ${text}`
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
const data = await response.json();
|
|
557
|
+
return {
|
|
558
|
+
rows: data.rows ?? [],
|
|
559
|
+
rowCount: data.rowCount ?? 0
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// src/connectors/google-sheets-oauth/sdk/index.ts
|
|
566
|
+
var BASE_URL5 = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
567
|
+
function createClient8(params, fetchFn = fetch) {
|
|
568
|
+
const defaultSpreadsheetId = params[parameters5.spreadsheetId.slug];
|
|
569
|
+
function resolveSpreadsheetId(override) {
|
|
570
|
+
const id = override ?? defaultSpreadsheetId;
|
|
571
|
+
if (!id) {
|
|
572
|
+
throw new Error(
|
|
573
|
+
"google-sheets: spreadsheetId is required. Either configure a default or pass it explicitly."
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
return id;
|
|
577
|
+
}
|
|
578
|
+
function request(path, init) {
|
|
579
|
+
const resolvedPath = defaultSpreadsheetId ? path.replace(/\{spreadsheetId\}/g, defaultSpreadsheetId) : path;
|
|
580
|
+
const url = `${BASE_URL5}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
581
|
+
return fetchFn(url, init);
|
|
582
|
+
}
|
|
583
|
+
async function getSpreadsheet(spreadsheetId) {
|
|
584
|
+
const id = resolveSpreadsheetId(spreadsheetId);
|
|
585
|
+
const url = `${BASE_URL5}/${id}?fields=spreadsheetId,properties,sheets.properties`;
|
|
586
|
+
const response = await fetchFn(url);
|
|
587
|
+
if (!response.ok) {
|
|
588
|
+
const body = await response.text();
|
|
589
|
+
throw new Error(
|
|
590
|
+
`google-sheets: getSpreadsheet failed (${response.status}): ${body}`
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
return await response.json();
|
|
594
|
+
}
|
|
595
|
+
async function getValues(range, spreadsheetId) {
|
|
596
|
+
const id = resolveSpreadsheetId(spreadsheetId);
|
|
597
|
+
const url = `${BASE_URL5}/${id}/values/${encodeURIComponent(range)}`;
|
|
598
|
+
const response = await fetchFn(url);
|
|
599
|
+
if (!response.ok) {
|
|
600
|
+
const body = await response.text();
|
|
601
|
+
throw new Error(
|
|
602
|
+
`google-sheets: getValues failed (${response.status}): ${body}`
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
return await response.json();
|
|
606
|
+
}
|
|
607
|
+
async function batchGetValues(ranges, spreadsheetId) {
|
|
608
|
+
const id = resolveSpreadsheetId(spreadsheetId);
|
|
609
|
+
const searchParams = new URLSearchParams();
|
|
610
|
+
for (const range of ranges) {
|
|
611
|
+
searchParams.append("ranges", range);
|
|
612
|
+
}
|
|
613
|
+
const url = `${BASE_URL5}/${id}/values:batchGet?${searchParams.toString()}`;
|
|
614
|
+
const response = await fetchFn(url);
|
|
615
|
+
if (!response.ok) {
|
|
616
|
+
const body = await response.text();
|
|
617
|
+
throw new Error(
|
|
618
|
+
`google-sheets: batchGetValues failed (${response.status}): ${body}`
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
return await response.json();
|
|
622
|
+
}
|
|
623
|
+
return {
|
|
624
|
+
request,
|
|
625
|
+
getSpreadsheet,
|
|
626
|
+
getValues,
|
|
627
|
+
batchGetValues
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
|
|
381
631
|
// src/connectors/wix-store/sdk/index.ts
|
|
382
|
-
function
|
|
383
|
-
const accountId = params[
|
|
384
|
-
const siteId = params[
|
|
385
|
-
const apiKey = params[
|
|
632
|
+
function createClient9(params) {
|
|
633
|
+
const accountId = params[parameters9.accountId.slug];
|
|
634
|
+
const siteId = params[parameters9.siteId.slug];
|
|
635
|
+
const apiKey = params[parameters9.apiKey.slug];
|
|
386
636
|
if (!accountId || !siteId || !apiKey) {
|
|
387
637
|
const required = [
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
638
|
+
parameters9.accountId.slug,
|
|
639
|
+
parameters9.siteId.slug,
|
|
640
|
+
parameters9.apiKey.slug
|
|
391
641
|
];
|
|
392
642
|
const missing = required.filter((s) => !params[s]);
|
|
393
643
|
throw new Error(
|
|
@@ -505,15 +755,15 @@ function createClient5(params) {
|
|
|
505
755
|
}
|
|
506
756
|
|
|
507
757
|
// src/connectors/dbt/sdk/index.ts
|
|
508
|
-
function
|
|
509
|
-
const host = params[
|
|
510
|
-
const prodEnvId = params[
|
|
511
|
-
const token = params[
|
|
758
|
+
function createClient10(params) {
|
|
759
|
+
const host = params[parameters10.host.slug];
|
|
760
|
+
const prodEnvId = params[parameters10.prodEnvId.slug];
|
|
761
|
+
const token = params[parameters10.token.slug];
|
|
512
762
|
if (!host || !prodEnvId || !token) {
|
|
513
763
|
const required = [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
764
|
+
parameters10.host.slug,
|
|
765
|
+
parameters10.prodEnvId.slug,
|
|
766
|
+
parameters10.token.slug
|
|
517
767
|
];
|
|
518
768
|
const missing = required.filter((s) => !params[s]);
|
|
519
769
|
throw new Error(
|
|
@@ -739,233 +989,177 @@ function createClient6(params) {
|
|
|
739
989
|
};
|
|
740
990
|
}
|
|
741
991
|
|
|
742
|
-
// src/connectors/
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
992
|
+
// src/connectors/gemini/sdk/index.ts
|
|
993
|
+
function createClient11(params) {
|
|
994
|
+
const apiKey = params[parameters12.apiKey.slug];
|
|
995
|
+
if (!apiKey) {
|
|
996
|
+
throw new Error(
|
|
997
|
+
`gemini: missing required parameter: ${parameters12.apiKey.slug}`
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
return { apiKey };
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
// src/connectors/anthropic/sdk/index.ts
|
|
1004
|
+
function createClient12(params) {
|
|
1005
|
+
const apiKey = params[parameters13.apiKey.slug];
|
|
1006
|
+
if (!apiKey) {
|
|
1007
|
+
throw new Error(
|
|
1008
|
+
`anthropic: missing required parameter: ${parameters13.apiKey.slug}`
|
|
1009
|
+
);
|
|
754
1010
|
}
|
|
1011
|
+
return { apiKey };
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// src/connectors/hubspot-oauth/sdk/index.ts
|
|
1015
|
+
var BASE_URL6 = "https://api.hubapi.com";
|
|
1016
|
+
function createClient13(_params, fetchFn = fetch) {
|
|
755
1017
|
function request(path, init) {
|
|
756
|
-
const
|
|
757
|
-
const url = `${BASE_URL3}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
1018
|
+
const url = `${BASE_URL6}${path.startsWith("/") ? "" : "/"}${path}`;
|
|
758
1019
|
return fetchFn(url, init);
|
|
759
1020
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
return await response.json();
|
|
1021
|
+
return { request };
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
// src/connectors/stripe-oauth/sdk/index.ts
|
|
1025
|
+
var BASE_URL7 = "https://api.stripe.com";
|
|
1026
|
+
function createClient14(_params, fetchFn = fetch) {
|
|
1027
|
+
function request(path, init) {
|
|
1028
|
+
const url = `${BASE_URL7}${path.startsWith("/") ? "" : "/"}${path}`;
|
|
1029
|
+
return fetchFn(url, init);
|
|
771
1030
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
return
|
|
1031
|
+
return { request };
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
// src/connectors/airtable-oauth/sdk/index.ts
|
|
1035
|
+
var BASE_URL8 = "https://api.airtable.com/v0";
|
|
1036
|
+
function createClient15(params, fetchFn = fetch) {
|
|
1037
|
+
const defaultBaseId = params[parameters6.baseId.slug];
|
|
1038
|
+
function request(path, init) {
|
|
1039
|
+
const resolvedPath = defaultBaseId ? path.replace(/\{baseId\}/g, defaultBaseId) : path;
|
|
1040
|
+
const url = `${BASE_URL8}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
1041
|
+
return fetchFn(url, init);
|
|
783
1042
|
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
`google-sheets: batchGetValues failed (${response.status}): ${body}`
|
|
796
|
-
);
|
|
797
|
-
}
|
|
798
|
-
return await response.json();
|
|
1043
|
+
return { request };
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
// src/connectors/amplitude/sdk/index.ts
|
|
1047
|
+
function createClient16(params) {
|
|
1048
|
+
const apiKey = params[parameters14.apiKey.slug];
|
|
1049
|
+
const secretKey = params[parameters14.secretKey.slug];
|
|
1050
|
+
if (!apiKey) {
|
|
1051
|
+
throw new Error(
|
|
1052
|
+
`amplitude: missing required parameter: ${parameters14.apiKey.slug}`
|
|
1053
|
+
);
|
|
799
1054
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
};
|
|
1055
|
+
if (!secretKey) {
|
|
1056
|
+
throw new Error(
|
|
1057
|
+
`amplitude: missing required parameter: ${parameters14.secretKey.slug}`
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
return { apiKey, secretKey };
|
|
806
1061
|
}
|
|
807
1062
|
|
|
808
|
-
// src/connectors/
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
"google-analytics-oauth: propertyId is required. Configure it via connection parameters."
|
|
816
|
-
);
|
|
817
|
-
}
|
|
818
|
-
return propertyId;
|
|
1063
|
+
// src/connectors/attio/sdk/index.ts
|
|
1064
|
+
function createClient17(params) {
|
|
1065
|
+
const apiKey = params[parameters15.apiKey.slug];
|
|
1066
|
+
if (!apiKey) {
|
|
1067
|
+
throw new Error(
|
|
1068
|
+
`attio: missing required parameter: ${parameters15.apiKey.slug}`
|
|
1069
|
+
);
|
|
819
1070
|
}
|
|
820
|
-
return {
|
|
821
|
-
async request(path, init) {
|
|
822
|
-
const pid = propertyId;
|
|
823
|
-
const resolvedPath = pid ? path.replace(/\{propertyId\}/g, pid) : path;
|
|
824
|
-
const url = `${BASE_URL4.replace(/\/+$/, "")}/${resolvedPath.replace(/^\/+/, "")}`;
|
|
825
|
-
return fetchFn(url, init);
|
|
826
|
-
},
|
|
827
|
-
async runReport(request) {
|
|
828
|
-
const pid = resolvePropertyId();
|
|
829
|
-
const response = await this.request(
|
|
830
|
-
`properties/${pid}:runReport`,
|
|
831
|
-
{
|
|
832
|
-
method: "POST",
|
|
833
|
-
headers: { "Content-Type": "application/json" },
|
|
834
|
-
body: JSON.stringify(request)
|
|
835
|
-
}
|
|
836
|
-
);
|
|
837
|
-
if (!response.ok) {
|
|
838
|
-
const text = await response.text();
|
|
839
|
-
throw new Error(
|
|
840
|
-
`google-analytics-oauth: runReport failed (${response.status}): ${text}`
|
|
841
|
-
);
|
|
842
|
-
}
|
|
843
|
-
const data = await response.json();
|
|
844
|
-
return {
|
|
845
|
-
rows: data.rows ?? [],
|
|
846
|
-
rowCount: data.rowCount ?? 0
|
|
847
|
-
};
|
|
848
|
-
},
|
|
849
|
-
async getMetadata() {
|
|
850
|
-
const pid = resolvePropertyId();
|
|
851
|
-
const response = await this.request(
|
|
852
|
-
`properties/${pid}/metadata`,
|
|
853
|
-
{ method: "GET" }
|
|
854
|
-
);
|
|
855
|
-
if (!response.ok) {
|
|
856
|
-
const text = await response.text();
|
|
857
|
-
throw new Error(
|
|
858
|
-
`google-analytics-oauth: getMetadata failed (${response.status}): ${text}`
|
|
859
|
-
);
|
|
860
|
-
}
|
|
861
|
-
return await response.json();
|
|
862
|
-
},
|
|
863
|
-
async runRealtimeReport(request) {
|
|
864
|
-
const pid = resolvePropertyId();
|
|
865
|
-
const response = await this.request(
|
|
866
|
-
`properties/${pid}:runRealtimeReport`,
|
|
867
|
-
{
|
|
868
|
-
method: "POST",
|
|
869
|
-
headers: { "Content-Type": "application/json" },
|
|
870
|
-
body: JSON.stringify(request)
|
|
871
|
-
}
|
|
872
|
-
);
|
|
873
|
-
if (!response.ok) {
|
|
874
|
-
const text = await response.text();
|
|
875
|
-
throw new Error(
|
|
876
|
-
`google-analytics-oauth: runRealtimeReport failed (${response.status}): ${text}`
|
|
877
|
-
);
|
|
878
|
-
}
|
|
879
|
-
const data = await response.json();
|
|
880
|
-
return {
|
|
881
|
-
rows: data.rows ?? [],
|
|
882
|
-
rowCount: data.rowCount ?? 0
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
};
|
|
1071
|
+
return { apiKey };
|
|
886
1072
|
}
|
|
887
1073
|
|
|
888
|
-
// src/connectors/
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
const developerToken = params[parameters9.developerToken.slug];
|
|
894
|
-
if (!developerToken) {
|
|
1074
|
+
// src/connectors/shopify/sdk/index.ts
|
|
1075
|
+
function createClient18(params) {
|
|
1076
|
+
const accessToken = params[parameters16.accessToken.slug];
|
|
1077
|
+
const storeDomain = params[parameters16.storeDomain.slug];
|
|
1078
|
+
if (!accessToken) {
|
|
895
1079
|
throw new Error(
|
|
896
|
-
`
|
|
1080
|
+
`shopify: missing required parameter: ${parameters16.accessToken.slug}`
|
|
897
1081
|
);
|
|
898
1082
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
"google-ads: customerId is required. Either configure a default or pass it explicitly."
|
|
904
|
-
);
|
|
905
|
-
}
|
|
906
|
-
return id;
|
|
1083
|
+
if (!storeDomain) {
|
|
1084
|
+
throw new Error(
|
|
1085
|
+
`shopify: missing required parameter: ${parameters16.storeDomain.slug}`
|
|
1086
|
+
);
|
|
907
1087
|
}
|
|
1088
|
+
return { accessToken, storeDomain };
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
// src/connectors/slack/sdk/index.ts
|
|
1092
|
+
function createClient19(params) {
|
|
1093
|
+
const botToken = params[parameters17.botToken.slug];
|
|
1094
|
+
if (!botToken) {
|
|
1095
|
+
throw new Error(
|
|
1096
|
+
`slack: missing required parameter: ${parameters17.botToken.slug}`
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
return { botToken };
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
// src/connectors/shopify-oauth/sdk/index.ts
|
|
1103
|
+
function createClient20(_params, fetchFn = fetch) {
|
|
908
1104
|
function request(path, init) {
|
|
909
|
-
|
|
910
|
-
const url = `${BASE_URL5}${resolvedPath}`;
|
|
911
|
-
const headers = new Headers(init?.headers);
|
|
912
|
-
headers.set("developer-token", developerToken);
|
|
913
|
-
if (defaultCustomerId) {
|
|
914
|
-
headers.set("login-customer-id", defaultCustomerId);
|
|
915
|
-
}
|
|
916
|
-
return fetchFn(url, { ...init, headers });
|
|
1105
|
+
return fetchFn(path, init);
|
|
917
1106
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
if (!response.ok) {
|
|
931
|
-
const body = await response.text();
|
|
932
|
-
throw new Error(
|
|
933
|
-
`google-ads: search failed (${response.status}): ${body}`
|
|
934
|
-
);
|
|
935
|
-
}
|
|
936
|
-
const data = await response.json();
|
|
937
|
-
return data.flatMap((chunk) => chunk.results ?? []);
|
|
1107
|
+
return { request };
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// src/connectors/ms-teams/sdk/index.ts
|
|
1111
|
+
function createClient21(params) {
|
|
1112
|
+
const clientId = params[parameters18.clientId.slug];
|
|
1113
|
+
const clientSecret = params[parameters18.clientSecret.slug];
|
|
1114
|
+
const tenantId = params[parameters18.tenantId.slug];
|
|
1115
|
+
if (!clientId) {
|
|
1116
|
+
throw new Error(
|
|
1117
|
+
`ms-teams: missing required parameter: ${parameters18.clientId.slug}`
|
|
1118
|
+
);
|
|
938
1119
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
headers.set("developer-token", developerToken);
|
|
943
|
-
const response = await fetchFn(url, { method: "GET", headers });
|
|
944
|
-
if (!response.ok) {
|
|
945
|
-
const body = await response.text();
|
|
946
|
-
throw new Error(
|
|
947
|
-
`google-ads: listAccessibleCustomers failed (${response.status}): ${body}`
|
|
948
|
-
);
|
|
949
|
-
}
|
|
950
|
-
const data = await response.json();
|
|
951
|
-
return (data.resourceNames ?? []).map(
|
|
952
|
-
(rn) => rn.replace(/^customers\//, "")
|
|
1120
|
+
if (!clientSecret) {
|
|
1121
|
+
throw new Error(
|
|
1122
|
+
`ms-teams: missing required parameter: ${parameters18.clientSecret.slug}`
|
|
953
1123
|
);
|
|
954
1124
|
}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
}
|
|
1125
|
+
if (!tenantId) {
|
|
1126
|
+
throw new Error(
|
|
1127
|
+
`ms-teams: missing required parameter: ${parameters18.tenantId.slug}`
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
return { clientId, clientSecret, tenantId };
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
// src/connectors/ms-teams-oauth/sdk/index.ts
|
|
1134
|
+
var BASE_URL9 = "https://graph.microsoft.com";
|
|
1135
|
+
function createClient22(_params, fetchFn = fetch) {
|
|
1136
|
+
function request(path, init) {
|
|
1137
|
+
const url = `${BASE_URL9}${path.startsWith("/") ? "" : "/"}${path}`;
|
|
1138
|
+
return fetchFn(url, init);
|
|
1139
|
+
}
|
|
1140
|
+
return { request };
|
|
960
1141
|
}
|
|
961
1142
|
export {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1143
|
+
createClient4 as airtable,
|
|
1144
|
+
createClient15 as airtableOauth,
|
|
1145
|
+
createClient16 as amplitude,
|
|
1146
|
+
createClient12 as anthropic,
|
|
1147
|
+
createClient17 as attio,
|
|
1148
|
+
createClient10 as dbt,
|
|
1149
|
+
createClient11 as gemini,
|
|
1150
|
+
createClient5 as googleAds,
|
|
1151
|
+
createClient6 as googleAnalytics,
|
|
1152
|
+
createClient7 as googleAnalyticsOauth,
|
|
1153
|
+
createClient8 as googleSheets,
|
|
1154
|
+
createClient13 as hubspotOauth,
|
|
968
1155
|
createClient as kintone,
|
|
969
|
-
createClient2 as
|
|
970
|
-
|
|
1156
|
+
createClient2 as kintoneApiToken,
|
|
1157
|
+
createClient21 as msTeams,
|
|
1158
|
+
createClient22 as msTeamsOauth,
|
|
1159
|
+
createClient3 as openai,
|
|
1160
|
+
createClient18 as shopify,
|
|
1161
|
+
createClient20 as shopifyOauth,
|
|
1162
|
+
createClient19 as slack,
|
|
1163
|
+
createClient14 as stripeOauth,
|
|
1164
|
+
createClient9 as wixStore
|
|
971
1165
|
};
|