@squadbase/connectors 0.0.10 → 0.0.12
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-5YEHPSNW.js → chunk-E5AVUXWJ.js} +15 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +186 -140
- package/dist/sdk.d.ts +12 -2
- package/dist/sdk.js +16 -3
- package/package.json +1 -1
|
@@ -73,7 +73,21 @@ var parameters = {
|
|
|
73
73
|
})
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
// src/connectors/openai/parameters.ts
|
|
77
|
+
var parameters2 = {
|
|
78
|
+
apiKey: new ParameterDefinition({
|
|
79
|
+
slug: "api-key",
|
|
80
|
+
name: "OpenAI API Key",
|
|
81
|
+
description: "The OpenAI API key for authentication (starts with sk-).",
|
|
82
|
+
envVarBaseKey: "OPENAI_API_KEY",
|
|
83
|
+
type: "text",
|
|
84
|
+
secret: true,
|
|
85
|
+
required: true
|
|
86
|
+
})
|
|
87
|
+
};
|
|
88
|
+
|
|
76
89
|
export {
|
|
77
90
|
ParameterDefinition,
|
|
78
|
-
parameters
|
|
91
|
+
parameters,
|
|
92
|
+
parameters2
|
|
79
93
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -161,6 +161,7 @@ declare const connectors: {
|
|
|
161
161
|
role: ParameterDefinition;
|
|
162
162
|
warehouse: ParameterDefinition;
|
|
163
163
|
privateKeyBase64: ParameterDefinition;
|
|
164
|
+
privateKeyPassphrase: ParameterDefinition;
|
|
164
165
|
}, {
|
|
165
166
|
executeQuery: ConnectorTool<{
|
|
166
167
|
connectionId: string;
|
|
@@ -470,6 +471,9 @@ declare const connectors: {
|
|
|
470
471
|
error: string;
|
|
471
472
|
}>;
|
|
472
473
|
}>;
|
|
474
|
+
openai: ConnectorPlugin<{
|
|
475
|
+
apiKey: ParameterDefinition;
|
|
476
|
+
}, {}>;
|
|
473
477
|
};
|
|
474
478
|
|
|
475
479
|
declare const snowflakeConnector: ConnectorPlugin<{
|
|
@@ -478,6 +482,7 @@ declare const snowflakeConnector: ConnectorPlugin<{
|
|
|
478
482
|
role: ParameterDefinition;
|
|
479
483
|
warehouse: ParameterDefinition;
|
|
480
484
|
privateKeyBase64: ParameterDefinition;
|
|
485
|
+
privateKeyPassphrase: ParameterDefinition;
|
|
481
486
|
}, {
|
|
482
487
|
executeQuery: ConnectorTool<{
|
|
483
488
|
connectionId: string;
|
|
@@ -802,4 +807,8 @@ declare const squadbaseDbConnector: ConnectorPlugin<{
|
|
|
802
807
|
}>;
|
|
803
808
|
}>;
|
|
804
809
|
|
|
805
|
-
|
|
810
|
+
declare const openaiConnector: ConnectorPlugin<{
|
|
811
|
+
apiKey: ParameterDefinition;
|
|
812
|
+
}, {}>;
|
|
813
|
+
|
|
814
|
+
export { AUTH_TYPES, type ConnectionCheckResult, ConnectorPlugin, ConnectorSetup, ConnectorTool, type ConnectorToolsConfig, ParameterDefinition, type ProxyPolicy, type ProxyPolicyRule, type ReleaseFlag, type SetupLanguage, airtableConnector, awsAthenaConnector, bigqueryConnector, bigqueryOauthConnector, connectors, databricksConnector, dbtConnector, googleAnalyticsConnector, kintoneConnector, mysqlConnector, openaiConnector, postgresqlConnector, redshiftConnector, snowflakeConnector, snowflakePatConnector, squadbaseDbConnector, wixStoreConnector };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ParameterDefinition,
|
|
3
|
-
parameters
|
|
4
|
-
|
|
3
|
+
parameters,
|
|
4
|
+
parameters2
|
|
5
|
+
} from "./chunk-E5AVUXWJ.js";
|
|
5
6
|
|
|
6
7
|
// src/connector-setup.ts
|
|
7
8
|
var ConnectorSetup = class {
|
|
@@ -225,7 +226,7 @@ Follow these steps to set up the Snowflake connection.
|
|
|
225
226
|
});
|
|
226
227
|
|
|
227
228
|
// src/connectors/snowflake/parameters.ts
|
|
228
|
-
var
|
|
229
|
+
var parameters3 = {
|
|
229
230
|
account: new ParameterDefinition({
|
|
230
231
|
slug: "account",
|
|
231
232
|
name: "Snowflake Account",
|
|
@@ -270,6 +271,15 @@ var parameters2 = {
|
|
|
270
271
|
type: "base64EncodedText",
|
|
271
272
|
secret: true,
|
|
272
273
|
required: true
|
|
274
|
+
}),
|
|
275
|
+
privateKeyPassphrase: new ParameterDefinition({
|
|
276
|
+
slug: "private-key-passphrase",
|
|
277
|
+
name: "Snowflake Private Key Passphrase",
|
|
278
|
+
description: "The passphrase for decrypting an encrypted private key. Leave empty if the key is not encrypted.",
|
|
279
|
+
envVarBaseKey: "SNOWFLAKE_PRIVATE_KEY_PASSPHRASE",
|
|
280
|
+
type: "text",
|
|
281
|
+
secret: true,
|
|
282
|
+
required: false
|
|
273
283
|
})
|
|
274
284
|
};
|
|
275
285
|
|
|
@@ -319,21 +329,23 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
319
329
|
try {
|
|
320
330
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
321
331
|
snowflake.configure({ logLevel: "ERROR" });
|
|
322
|
-
const account =
|
|
323
|
-
const user =
|
|
324
|
-
const role =
|
|
325
|
-
const warehouse =
|
|
326
|
-
const privateKeyBase64 =
|
|
332
|
+
const account = parameters3.account.getValue(connection);
|
|
333
|
+
const user = parameters3.user.getValue(connection);
|
|
334
|
+
const role = parameters3.role.getValue(connection);
|
|
335
|
+
const warehouse = parameters3.warehouse.getValue(connection);
|
|
336
|
+
const privateKeyBase64 = parameters3.privateKeyBase64.getValue(connection);
|
|
327
337
|
const privateKey = Buffer.from(privateKeyBase64, "base64").toString(
|
|
328
338
|
"utf-8"
|
|
329
339
|
);
|
|
340
|
+
const privateKeyPass = parameters3.privateKeyPassphrase.tryGetValue(connection);
|
|
330
341
|
const conn = snowflake.createConnection({
|
|
331
342
|
account,
|
|
332
343
|
username: user,
|
|
333
344
|
role,
|
|
334
345
|
warehouse,
|
|
335
346
|
authenticator: "SNOWFLAKE_JWT",
|
|
336
|
-
privateKey
|
|
347
|
+
privateKey,
|
|
348
|
+
...privateKeyPass ? { privateKeyPass } : {}
|
|
337
349
|
});
|
|
338
350
|
await new Promise((resolve, reject) => {
|
|
339
351
|
conn.connect((err) => {
|
|
@@ -390,7 +402,7 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
390
402
|
name: "Snowflake",
|
|
391
403
|
description: "Connect to Snowflake for cloud data warehousing and analytics.",
|
|
392
404
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oyVtAcP3pMlXaOrts9unk/b7a9dc25d15c388b66e983041b855447/snowflake.svg",
|
|
393
|
-
parameters:
|
|
405
|
+
parameters: parameters3,
|
|
394
406
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
395
407
|
setup: snowflakeSetup,
|
|
396
408
|
systemPrompt: `## Snowflake SQL Notes
|
|
@@ -407,16 +419,18 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
407
419
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
408
420
|
snowflake.configure({ logLevel: "ERROR" });
|
|
409
421
|
const privateKey = Buffer.from(
|
|
410
|
-
params[
|
|
422
|
+
params[parameters3.privateKeyBase64.slug],
|
|
411
423
|
"base64"
|
|
412
424
|
).toString("utf-8");
|
|
425
|
+
const privateKeyPass = params[parameters3.privateKeyPassphrase.slug] || void 0;
|
|
413
426
|
const conn = snowflake.createConnection({
|
|
414
|
-
account: params[
|
|
415
|
-
username: params[
|
|
416
|
-
role: params[
|
|
417
|
-
warehouse: params[
|
|
427
|
+
account: params[parameters3.account.slug],
|
|
428
|
+
username: params[parameters3.user.slug],
|
|
429
|
+
role: params[parameters3.role.slug],
|
|
430
|
+
warehouse: params[parameters3.warehouse.slug],
|
|
418
431
|
authenticator: "SNOWFLAKE_JWT",
|
|
419
|
-
privateKey
|
|
432
|
+
privateKey,
|
|
433
|
+
...privateKeyPass ? { privateKeyPass } : {}
|
|
420
434
|
});
|
|
421
435
|
await new Promise((resolve, reject) => {
|
|
422
436
|
conn.connect((err) => {
|
|
@@ -446,16 +460,18 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
446
460
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
447
461
|
snowflake.configure({ logLevel: "ERROR" });
|
|
448
462
|
const privateKey = Buffer.from(
|
|
449
|
-
params[
|
|
463
|
+
params[parameters3.privateKeyBase64.slug],
|
|
450
464
|
"base64"
|
|
451
465
|
).toString("utf-8");
|
|
466
|
+
const privateKeyPass = params[parameters3.privateKeyPassphrase.slug] || void 0;
|
|
452
467
|
const conn = snowflake.createConnection({
|
|
453
|
-
account: params[
|
|
454
|
-
username: params[
|
|
455
|
-
role: params[
|
|
456
|
-
warehouse: params[
|
|
468
|
+
account: params[parameters3.account.slug],
|
|
469
|
+
username: params[parameters3.user.slug],
|
|
470
|
+
role: params[parameters3.role.slug],
|
|
471
|
+
warehouse: params[parameters3.warehouse.slug],
|
|
457
472
|
authenticator: "SNOWFLAKE_JWT",
|
|
458
|
-
privateKey
|
|
473
|
+
privateKey,
|
|
474
|
+
...privateKeyPass ? { privateKeyPass } : {}
|
|
459
475
|
});
|
|
460
476
|
await new Promise((resolve, reject) => {
|
|
461
477
|
conn.connect((err) => {
|
|
@@ -482,7 +498,7 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
482
498
|
});
|
|
483
499
|
|
|
484
500
|
// src/connectors/snowflake-pat/parameters.ts
|
|
485
|
-
var
|
|
501
|
+
var parameters4 = {
|
|
486
502
|
account: new ParameterDefinition({
|
|
487
503
|
slug: "account",
|
|
488
504
|
name: "Snowflake Account",
|
|
@@ -576,11 +592,11 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
576
592
|
try {
|
|
577
593
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
578
594
|
snowflake.configure({ logLevel: "ERROR" });
|
|
579
|
-
const account =
|
|
580
|
-
const user =
|
|
581
|
-
const role =
|
|
582
|
-
const warehouse =
|
|
583
|
-
const password =
|
|
595
|
+
const account = parameters4.account.getValue(connection);
|
|
596
|
+
const user = parameters4.user.getValue(connection);
|
|
597
|
+
const role = parameters4.role.getValue(connection);
|
|
598
|
+
const warehouse = parameters4.warehouse.getValue(connection);
|
|
599
|
+
const password = parameters4.pat.getValue(connection);
|
|
584
600
|
const conn = snowflake.createConnection({
|
|
585
601
|
account,
|
|
586
602
|
username: user,
|
|
@@ -643,7 +659,7 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
643
659
|
name: "Snowflake (PAT)",
|
|
644
660
|
description: "Connect to Snowflake using a Personal Access Token (PAT).",
|
|
645
661
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oyVtAcP3pMlXaOrts9unk/b7a9dc25d15c388b66e983041b855447/snowflake.svg",
|
|
646
|
-
parameters:
|
|
662
|
+
parameters: parameters4,
|
|
647
663
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
648
664
|
setup: snowflakeSetup,
|
|
649
665
|
systemPrompt: `## Snowflake SQL Notes
|
|
@@ -660,11 +676,11 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
660
676
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
661
677
|
snowflake.configure({ logLevel: "ERROR" });
|
|
662
678
|
const conn = snowflake.createConnection({
|
|
663
|
-
account: params[
|
|
664
|
-
username: params[
|
|
665
|
-
role: params[
|
|
666
|
-
warehouse: params[
|
|
667
|
-
password: params[
|
|
679
|
+
account: params[parameters4.account.slug],
|
|
680
|
+
username: params[parameters4.user.slug],
|
|
681
|
+
role: params[parameters4.role.slug],
|
|
682
|
+
warehouse: params[parameters4.warehouse.slug],
|
|
683
|
+
password: params[parameters4.pat.slug]
|
|
668
684
|
});
|
|
669
685
|
await new Promise((resolve, reject) => {
|
|
670
686
|
conn.connect((err) => {
|
|
@@ -699,11 +715,11 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
699
715
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
700
716
|
snowflake.configure({ logLevel: "ERROR" });
|
|
701
717
|
const conn = snowflake.createConnection({
|
|
702
|
-
account: params[
|
|
703
|
-
username: params[
|
|
704
|
-
role: params[
|
|
705
|
-
warehouse: params[
|
|
706
|
-
password: params[
|
|
718
|
+
account: params[parameters4.account.slug],
|
|
719
|
+
username: params[parameters4.user.slug],
|
|
720
|
+
role: params[parameters4.role.slug],
|
|
721
|
+
warehouse: params[parameters4.warehouse.slug],
|
|
722
|
+
password: params[parameters4.pat.slug]
|
|
707
723
|
});
|
|
708
724
|
await new Promise((resolve, reject) => {
|
|
709
725
|
conn.connect((err) => {
|
|
@@ -735,7 +751,7 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
735
751
|
});
|
|
736
752
|
|
|
737
753
|
// src/connectors/postgresql/parameters.ts
|
|
738
|
-
var
|
|
754
|
+
var parameters5 = {
|
|
739
755
|
connectionUrl: new ParameterDefinition({
|
|
740
756
|
slug: "connection-url",
|
|
741
757
|
name: "PostgreSQL Connection URL",
|
|
@@ -792,7 +808,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
792
808
|
let connectionUrl;
|
|
793
809
|
try {
|
|
794
810
|
const { Pool } = await import("pg");
|
|
795
|
-
connectionUrl =
|
|
811
|
+
connectionUrl = parameters5.connectionUrl.getValue(connection);
|
|
796
812
|
const pool = new Pool({
|
|
797
813
|
connectionString: connectionUrl,
|
|
798
814
|
ssl: { rejectUnauthorized: false },
|
|
@@ -830,7 +846,7 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
830
846
|
name: "PostgreSQL",
|
|
831
847
|
description: "Connect to PostgreSQL databases for relational data storage and querying.",
|
|
832
848
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/42AHi2uqteUn65MyqdN6V7/a0f68f12af6aac96bbcda5980f43de07/elephant.png",
|
|
833
|
-
parameters:
|
|
849
|
+
parameters: parameters5,
|
|
834
850
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
835
851
|
systemPrompt: `## PostgreSQL SQL Notes
|
|
836
852
|
- Schema exploration:
|
|
@@ -841,7 +857,7 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
841
857
|
async checkConnection(params, _config) {
|
|
842
858
|
const { Pool } = await import("pg");
|
|
843
859
|
const pool = new Pool({
|
|
844
|
-
connectionString: params[
|
|
860
|
+
connectionString: params[parameters5.connectionUrl.slug],
|
|
845
861
|
ssl: { rejectUnauthorized: false },
|
|
846
862
|
connectionTimeoutMillis: 1e4
|
|
847
863
|
});
|
|
@@ -858,7 +874,7 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
858
874
|
const { Pool } = await import("pg");
|
|
859
875
|
const { text, values } = buildPositionalParams(sql, namedParams);
|
|
860
876
|
const pool = new Pool({
|
|
861
|
-
connectionString: params[
|
|
877
|
+
connectionString: params[parameters5.connectionUrl.slug],
|
|
862
878
|
ssl: { rejectUnauthorized: false },
|
|
863
879
|
connectionTimeoutMillis: 1e4,
|
|
864
880
|
statement_timeout: 6e4
|
|
@@ -873,7 +889,7 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
873
889
|
});
|
|
874
890
|
|
|
875
891
|
// src/connectors/mysql/parameters.ts
|
|
876
|
-
var
|
|
892
|
+
var parameters6 = {
|
|
877
893
|
connectionUrl: new ParameterDefinition({
|
|
878
894
|
slug: "connection-url",
|
|
879
895
|
name: "MySQL Connection URL",
|
|
@@ -930,7 +946,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
930
946
|
let connectionUrl;
|
|
931
947
|
try {
|
|
932
948
|
const mysql = await import("mysql2/promise");
|
|
933
|
-
connectionUrl =
|
|
949
|
+
connectionUrl = parameters6.connectionUrl.getValue(connection);
|
|
934
950
|
const pool = mysql.createPool({
|
|
935
951
|
uri: connectionUrl,
|
|
936
952
|
connectTimeout: CONNECT_TIMEOUT_MS2
|
|
@@ -970,7 +986,7 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
970
986
|
name: "MySQL",
|
|
971
987
|
description: "Connect to MySQL databases for relational data storage and querying.",
|
|
972
988
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6ghPFeGgl7uBs5NHH1a4L/512c9433beec5b595caa41f04921c1f9/logo-mysql-170x115.png",
|
|
973
|
-
parameters:
|
|
989
|
+
parameters: parameters6,
|
|
974
990
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
975
991
|
systemPrompt: `## MySQL SQL Notes
|
|
976
992
|
- Schema exploration:
|
|
@@ -981,7 +997,7 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
981
997
|
async checkConnection(params, _config) {
|
|
982
998
|
const mysql = await import("mysql2/promise");
|
|
983
999
|
const pool = mysql.createPool({
|
|
984
|
-
uri: params[
|
|
1000
|
+
uri: params[parameters6.connectionUrl.slug],
|
|
985
1001
|
connectTimeout: 1e4
|
|
986
1002
|
});
|
|
987
1003
|
try {
|
|
@@ -997,7 +1013,7 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
997
1013
|
const mysql = await import("mysql2/promise");
|
|
998
1014
|
const { text, values } = buildQuestionmarkParams(sql, namedParams);
|
|
999
1015
|
const pool = mysql.createPool({
|
|
1000
|
-
uri: params[
|
|
1016
|
+
uri: params[parameters6.connectionUrl.slug],
|
|
1001
1017
|
connectTimeout: 1e4
|
|
1002
1018
|
});
|
|
1003
1019
|
try {
|
|
@@ -1018,7 +1034,7 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
1018
1034
|
import { z as z5 } from "zod";
|
|
1019
1035
|
|
|
1020
1036
|
// src/connectors/bigquery/parameters.ts
|
|
1021
|
-
var
|
|
1037
|
+
var parameters7 = {
|
|
1022
1038
|
serviceAccountKeyJsonBase64: new ParameterDefinition({
|
|
1023
1039
|
slug: "service-account-key-json-base64",
|
|
1024
1040
|
name: "Google Cloud Service Account JSON",
|
|
@@ -1075,7 +1091,7 @@ var listProjectsTool = new ConnectorTool({
|
|
|
1075
1091
|
};
|
|
1076
1092
|
}
|
|
1077
1093
|
try {
|
|
1078
|
-
const serviceAccountJsonBase64 =
|
|
1094
|
+
const serviceAccountJsonBase64 = parameters7.serviceAccountKeyJsonBase64.getValue(connection);
|
|
1079
1095
|
const credentials = JSON.parse(
|
|
1080
1096
|
Buffer.from(serviceAccountJsonBase64, "base64").toString("utf-8")
|
|
1081
1097
|
);
|
|
@@ -1223,8 +1239,8 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1223
1239
|
);
|
|
1224
1240
|
try {
|
|
1225
1241
|
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
1226
|
-
const projectId =
|
|
1227
|
-
const serviceAccountJsonBase64 =
|
|
1242
|
+
const projectId = parameters7.projectId.getValue(connection);
|
|
1243
|
+
const serviceAccountJsonBase64 = parameters7.serviceAccountKeyJsonBase64.getValue(connection);
|
|
1228
1244
|
const credentials = JSON.parse(
|
|
1229
1245
|
Buffer.from(serviceAccountJsonBase64, "base64").toString("utf-8")
|
|
1230
1246
|
);
|
|
@@ -1254,7 +1270,7 @@ var bigqueryConnector = new ConnectorPlugin({
|
|
|
1254
1270
|
name: "BigQuery",
|
|
1255
1271
|
description: "Connect to Google BigQuery for data warehouse and analytics.",
|
|
1256
1272
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6nlehQyOmdbktG5hOYkYMr/6ca559140d5ddc7dadc5eac88858a563/bigquery.svg",
|
|
1257
|
-
parameters:
|
|
1273
|
+
parameters: parameters7,
|
|
1258
1274
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
1259
1275
|
setup: bigquerySetup,
|
|
1260
1276
|
systemPrompt: `## BigQuery SQL Notes
|
|
@@ -1268,10 +1284,10 @@ var bigqueryConnector = new ConnectorPlugin({
|
|
|
1268
1284
|
async checkConnection(params, _config) {
|
|
1269
1285
|
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
1270
1286
|
const credentials = JSON.parse(
|
|
1271
|
-
Buffer.from(params[
|
|
1287
|
+
Buffer.from(params[parameters7.serviceAccountKeyJsonBase64.slug], "base64").toString("utf-8")
|
|
1272
1288
|
);
|
|
1273
1289
|
const bq = new BigQuery({
|
|
1274
|
-
projectId: params[
|
|
1290
|
+
projectId: params[parameters7.projectId.slug],
|
|
1275
1291
|
credentials
|
|
1276
1292
|
});
|
|
1277
1293
|
try {
|
|
@@ -1286,10 +1302,10 @@ var bigqueryConnector = new ConnectorPlugin({
|
|
|
1286
1302
|
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
1287
1303
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
1288
1304
|
const credentials = JSON.parse(
|
|
1289
|
-
Buffer.from(params[
|
|
1305
|
+
Buffer.from(params[parameters7.serviceAccountKeyJsonBase64.slug], "base64").toString("utf-8")
|
|
1290
1306
|
);
|
|
1291
1307
|
const bq = new BigQuery({
|
|
1292
|
-
projectId: params[
|
|
1308
|
+
projectId: params[parameters7.projectId.slug],
|
|
1293
1309
|
credentials
|
|
1294
1310
|
});
|
|
1295
1311
|
const [job] = await bq.createQueryJob({ query: resolvedSql });
|
|
@@ -1485,7 +1501,7 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1485
1501
|
});
|
|
1486
1502
|
|
|
1487
1503
|
// src/connectors/bigquery-oauth/parameters.ts
|
|
1488
|
-
var
|
|
1504
|
+
var parameters8 = {
|
|
1489
1505
|
projectId: new ParameterDefinition({
|
|
1490
1506
|
slug: "project-id",
|
|
1491
1507
|
name: "Google Cloud Project ID",
|
|
@@ -1579,7 +1595,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1579
1595
|
error: `Connection ${connectionId} not found`
|
|
1580
1596
|
};
|
|
1581
1597
|
}
|
|
1582
|
-
const gcpProjectId =
|
|
1598
|
+
const gcpProjectId = parameters8.projectId.getValue(connection);
|
|
1583
1599
|
console.log(
|
|
1584
1600
|
`[connector-query] bigquery-oauth/${connection.name}: ${sql}`
|
|
1585
1601
|
);
|
|
@@ -1646,7 +1662,7 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
1646
1662
|
name: "BigQuery (OAuth)",
|
|
1647
1663
|
description: "Connect to Google BigQuery for data warehouse and analytics using OAuth.",
|
|
1648
1664
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6nlehQyOmdbktG5hOYkYMr/6ca559140d5ddc7dadc5eac88858a563/bigquery.svg",
|
|
1649
|
-
parameters:
|
|
1665
|
+
parameters: parameters8,
|
|
1650
1666
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
1651
1667
|
setup: bigquerySetup2,
|
|
1652
1668
|
proxyPolicy: {
|
|
@@ -1665,7 +1681,7 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
1665
1681
|
tools: tools6,
|
|
1666
1682
|
async checkConnection(params, config) {
|
|
1667
1683
|
const { proxyFetch } = config;
|
|
1668
|
-
const projectId = params[
|
|
1684
|
+
const projectId = params[parameters8.projectId.slug];
|
|
1669
1685
|
const url = `https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/queries`;
|
|
1670
1686
|
try {
|
|
1671
1687
|
const res = await proxyFetch(url, {
|
|
@@ -1684,7 +1700,7 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
1684
1700
|
},
|
|
1685
1701
|
async query(params, sql, namedParams, context) {
|
|
1686
1702
|
const { proxyFetch } = context;
|
|
1687
|
-
const projectId = params[
|
|
1703
|
+
const projectId = params[parameters8.projectId.slug];
|
|
1688
1704
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
1689
1705
|
const url = `https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/queries`;
|
|
1690
1706
|
const res = await proxyFetch(url, {
|
|
@@ -1702,7 +1718,7 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
1702
1718
|
});
|
|
1703
1719
|
|
|
1704
1720
|
// src/connectors/aws-athena/parameters.ts
|
|
1705
|
-
var
|
|
1721
|
+
var parameters9 = {
|
|
1706
1722
|
awsAccessKeyId: new ParameterDefinition({
|
|
1707
1723
|
slug: "aws-access-key-id",
|
|
1708
1724
|
name: "AWS Access Key ID",
|
|
@@ -1799,8 +1815,8 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1799
1815
|
GetQueryExecutionCommand,
|
|
1800
1816
|
GetQueryResultsCommand
|
|
1801
1817
|
} = await import("@aws-sdk/client-athena");
|
|
1802
|
-
const workgroup =
|
|
1803
|
-
const outputLocation =
|
|
1818
|
+
const workgroup = parameters9.workgroup.tryGetValue(connection);
|
|
1819
|
+
const outputLocation = parameters9.outputLocation.tryGetValue(connection);
|
|
1804
1820
|
if (!workgroup && !outputLocation) {
|
|
1805
1821
|
return {
|
|
1806
1822
|
success: false,
|
|
@@ -1808,10 +1824,10 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1808
1824
|
};
|
|
1809
1825
|
}
|
|
1810
1826
|
const client = new AthenaClient({
|
|
1811
|
-
region:
|
|
1827
|
+
region: parameters9.awsRegion.getValue(connection),
|
|
1812
1828
|
credentials: {
|
|
1813
|
-
accessKeyId:
|
|
1814
|
-
secretAccessKey:
|
|
1829
|
+
accessKeyId: parameters9.awsAccessKeyId.getValue(connection),
|
|
1830
|
+
secretAccessKey: parameters9.awsSecretAccessKey.getValue(connection)
|
|
1815
1831
|
}
|
|
1816
1832
|
});
|
|
1817
1833
|
const startParams = { QueryString: sql };
|
|
@@ -1875,7 +1891,7 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
1875
1891
|
name: "AWS Athena",
|
|
1876
1892
|
description: "Connect to AWS Athena for serverless SQL queries on S3 data.",
|
|
1877
1893
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5x0vIHtUHfJJMZUv4RFOYZ/5059bac389f0169542f39cdb4b387d2c/Athena.svg",
|
|
1878
|
-
parameters:
|
|
1894
|
+
parameters: parameters9,
|
|
1879
1895
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
1880
1896
|
systemPrompt: `## AWS Athena SQL Notes
|
|
1881
1897
|
- Uses Presto/Trino based SQL syntax
|
|
@@ -1893,8 +1909,8 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
1893
1909
|
StartQueryExecutionCommand,
|
|
1894
1910
|
GetQueryExecutionCommand
|
|
1895
1911
|
} = await import("@aws-sdk/client-athena");
|
|
1896
|
-
const workgroup = params[
|
|
1897
|
-
const outputLocation = params[
|
|
1912
|
+
const workgroup = params[parameters9.workgroup.slug];
|
|
1913
|
+
const outputLocation = params[parameters9.outputLocation.slug];
|
|
1898
1914
|
if (!workgroup && !outputLocation) {
|
|
1899
1915
|
return {
|
|
1900
1916
|
success: false,
|
|
@@ -1902,10 +1918,10 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
1902
1918
|
};
|
|
1903
1919
|
}
|
|
1904
1920
|
const client = new AthenaClient({
|
|
1905
|
-
region: params[
|
|
1921
|
+
region: params[parameters9.awsRegion.slug],
|
|
1906
1922
|
credentials: {
|
|
1907
|
-
accessKeyId: params[
|
|
1908
|
-
secretAccessKey: params[
|
|
1923
|
+
accessKeyId: params[parameters9.awsAccessKeyId.slug],
|
|
1924
|
+
secretAccessKey: params[parameters9.awsSecretAccessKey.slug]
|
|
1909
1925
|
}
|
|
1910
1926
|
});
|
|
1911
1927
|
const startParams = { QueryString: "SELECT 1" };
|
|
@@ -1950,16 +1966,16 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
1950
1966
|
GetQueryResultsCommand
|
|
1951
1967
|
} = await import("@aws-sdk/client-athena");
|
|
1952
1968
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
1953
|
-
const workgroup = params[
|
|
1954
|
-
const outputLocation = params[
|
|
1969
|
+
const workgroup = params[parameters9.workgroup.slug];
|
|
1970
|
+
const outputLocation = params[parameters9.outputLocation.slug];
|
|
1955
1971
|
if (!workgroup && !outputLocation) {
|
|
1956
1972
|
throw new Error("Either workgroup or output-location is required");
|
|
1957
1973
|
}
|
|
1958
1974
|
const client = new AthenaClient({
|
|
1959
|
-
region: params[
|
|
1975
|
+
region: params[parameters9.awsRegion.slug],
|
|
1960
1976
|
credentials: {
|
|
1961
|
-
accessKeyId: params[
|
|
1962
|
-
secretAccessKey: params[
|
|
1977
|
+
accessKeyId: params[parameters9.awsAccessKeyId.slug],
|
|
1978
|
+
secretAccessKey: params[parameters9.awsSecretAccessKey.slug]
|
|
1963
1979
|
}
|
|
1964
1980
|
});
|
|
1965
1981
|
const startParams = { QueryString: resolvedSql };
|
|
@@ -2004,7 +2020,7 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
2004
2020
|
});
|
|
2005
2021
|
|
|
2006
2022
|
// src/connectors/redshift/parameters.ts
|
|
2007
|
-
var
|
|
2023
|
+
var parameters10 = {
|
|
2008
2024
|
awsAccessKeyId: new ParameterDefinition({
|
|
2009
2025
|
slug: "aws-access-key-id",
|
|
2010
2026
|
name: "AWS Access Key ID",
|
|
@@ -2130,14 +2146,14 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
2130
2146
|
DescribeStatementCommand,
|
|
2131
2147
|
GetStatementResultCommand
|
|
2132
2148
|
} = await import("@aws-sdk/client-redshift-data");
|
|
2133
|
-
const awsAccessKeyId =
|
|
2134
|
-
const awsSecretAccessKey =
|
|
2135
|
-
const awsRegion =
|
|
2136
|
-
const database =
|
|
2137
|
-
const clusterIdentifier =
|
|
2138
|
-
const workgroupName =
|
|
2139
|
-
const secretArn =
|
|
2140
|
-
const dbUser =
|
|
2149
|
+
const awsAccessKeyId = parameters10.awsAccessKeyId.getValue(connection);
|
|
2150
|
+
const awsSecretAccessKey = parameters10.awsSecretAccessKey.getValue(connection);
|
|
2151
|
+
const awsRegion = parameters10.awsRegion.getValue(connection);
|
|
2152
|
+
const database = parameters10.database.getValue(connection);
|
|
2153
|
+
const clusterIdentifier = parameters10.clusterIdentifier.tryGetValue(connection);
|
|
2154
|
+
const workgroupName = parameters10.workgroupName.tryGetValue(connection);
|
|
2155
|
+
const secretArn = parameters10.secretArn.tryGetValue(connection);
|
|
2156
|
+
const dbUser = parameters10.dbUser.tryGetValue(connection);
|
|
2141
2157
|
if (!clusterIdentifier && !workgroupName) {
|
|
2142
2158
|
return {
|
|
2143
2159
|
success: false,
|
|
@@ -2208,7 +2224,7 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
2208
2224
|
name: "Redshift",
|
|
2209
2225
|
description: "Connect to Amazon Redshift for data warehouse analytics.",
|
|
2210
2226
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/AEwW2psmrnZ7htTVsgA9t/a637e31707c5d760be73ce1d8ec75580/aws-redshift-logo.svg",
|
|
2211
|
-
parameters:
|
|
2227
|
+
parameters: parameters10,
|
|
2212
2228
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
2213
2229
|
systemPrompt: `## Redshift SQL Notes
|
|
2214
2230
|
- Uses PostgreSQL based SQL syntax
|
|
@@ -2226,10 +2242,10 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
2226
2242
|
ExecuteStatementCommand,
|
|
2227
2243
|
DescribeStatementCommand
|
|
2228
2244
|
} = await import("@aws-sdk/client-redshift-data");
|
|
2229
|
-
const clusterIdentifier = params[
|
|
2230
|
-
const workgroupName = params[
|
|
2231
|
-
const secretArn = params[
|
|
2232
|
-
const dbUser = params[
|
|
2245
|
+
const clusterIdentifier = params[parameters10.clusterIdentifier.slug];
|
|
2246
|
+
const workgroupName = params[parameters10.workgroupName.slug];
|
|
2247
|
+
const secretArn = params[parameters10.secretArn.slug];
|
|
2248
|
+
const dbUser = params[parameters10.dbUser.slug];
|
|
2233
2249
|
if (!clusterIdentifier && !workgroupName) {
|
|
2234
2250
|
return {
|
|
2235
2251
|
success: false,
|
|
@@ -2237,15 +2253,15 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
2237
2253
|
};
|
|
2238
2254
|
}
|
|
2239
2255
|
const client = new RedshiftDataClient({
|
|
2240
|
-
region: params[
|
|
2256
|
+
region: params[parameters10.awsRegion.slug],
|
|
2241
2257
|
credentials: {
|
|
2242
|
-
accessKeyId: params[
|
|
2243
|
-
secretAccessKey: params[
|
|
2258
|
+
accessKeyId: params[parameters10.awsAccessKeyId.slug],
|
|
2259
|
+
secretAccessKey: params[parameters10.awsSecretAccessKey.slug]
|
|
2244
2260
|
}
|
|
2245
2261
|
});
|
|
2246
2262
|
const { Id: statementId } = await client.send(
|
|
2247
2263
|
new ExecuteStatementCommand({
|
|
2248
|
-
Database: params[
|
|
2264
|
+
Database: params[parameters10.database.slug],
|
|
2249
2265
|
Sql: "SELECT 1",
|
|
2250
2266
|
...clusterIdentifier && { ClusterIdentifier: clusterIdentifier },
|
|
2251
2267
|
...workgroupName && { WorkgroupName: workgroupName },
|
|
@@ -2286,23 +2302,23 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
2286
2302
|
GetStatementResultCommand
|
|
2287
2303
|
} = await import("@aws-sdk/client-redshift-data");
|
|
2288
2304
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
2289
|
-
const clusterIdentifier = params[
|
|
2290
|
-
const workgroupName = params[
|
|
2291
|
-
const secretArn = params[
|
|
2292
|
-
const dbUser = params[
|
|
2305
|
+
const clusterIdentifier = params[parameters10.clusterIdentifier.slug];
|
|
2306
|
+
const workgroupName = params[parameters10.workgroupName.slug];
|
|
2307
|
+
const secretArn = params[parameters10.secretArn.slug];
|
|
2308
|
+
const dbUser = params[parameters10.dbUser.slug];
|
|
2293
2309
|
if (!clusterIdentifier && !workgroupName) {
|
|
2294
2310
|
throw new Error("Either cluster-identifier or workgroup-name is required");
|
|
2295
2311
|
}
|
|
2296
2312
|
const client = new RedshiftDataClient({
|
|
2297
|
-
region: params[
|
|
2313
|
+
region: params[parameters10.awsRegion.slug],
|
|
2298
2314
|
credentials: {
|
|
2299
|
-
accessKeyId: params[
|
|
2300
|
-
secretAccessKey: params[
|
|
2315
|
+
accessKeyId: params[parameters10.awsAccessKeyId.slug],
|
|
2316
|
+
secretAccessKey: params[parameters10.awsSecretAccessKey.slug]
|
|
2301
2317
|
}
|
|
2302
2318
|
});
|
|
2303
2319
|
const { Id: statementId } = await client.send(
|
|
2304
2320
|
new ExecuteStatementCommand({
|
|
2305
|
-
Database: params[
|
|
2321
|
+
Database: params[parameters10.database.slug],
|
|
2306
2322
|
Sql: resolvedSql,
|
|
2307
2323
|
...clusterIdentifier && { ClusterIdentifier: clusterIdentifier },
|
|
2308
2324
|
...workgroupName && { WorkgroupName: workgroupName },
|
|
@@ -2340,7 +2356,7 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
2340
2356
|
});
|
|
2341
2357
|
|
|
2342
2358
|
// src/connectors/databricks/parameters.ts
|
|
2343
|
-
var
|
|
2359
|
+
var parameters11 = {
|
|
2344
2360
|
host: new ParameterDefinition({
|
|
2345
2361
|
slug: "host",
|
|
2346
2362
|
name: "Databricks Workspace Host",
|
|
@@ -2412,9 +2428,9 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
2412
2428
|
);
|
|
2413
2429
|
try {
|
|
2414
2430
|
const { DBSQLClient } = await import("@databricks/sql");
|
|
2415
|
-
const host =
|
|
2416
|
-
const token =
|
|
2417
|
-
const httpPath =
|
|
2431
|
+
const host = parameters11.host.getValue(connection);
|
|
2432
|
+
const token = parameters11.token.getValue(connection);
|
|
2433
|
+
const httpPath = parameters11.httpPath.getValue(connection);
|
|
2418
2434
|
const client = new DBSQLClient();
|
|
2419
2435
|
await client.connect({ host, path: httpPath, token });
|
|
2420
2436
|
let session;
|
|
@@ -2455,7 +2471,7 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
2455
2471
|
name: "Databricks",
|
|
2456
2472
|
description: "Connect to Databricks for data lakehouse and SQL analytics.",
|
|
2457
2473
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6QgcrfpQOKg18P7DdgKerd/af55bf0d871339049824dd167b97a29f/databricks-icon.svg",
|
|
2458
|
-
parameters:
|
|
2474
|
+
parameters: parameters11,
|
|
2459
2475
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
2460
2476
|
systemPrompt: `## Databricks SQL Notes
|
|
2461
2477
|
- Uses Spark SQL / Databricks SQL syntax
|
|
@@ -2470,9 +2486,9 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
2470
2486
|
const { DBSQLClient } = await import("@databricks/sql");
|
|
2471
2487
|
const client = new DBSQLClient();
|
|
2472
2488
|
await client.connect({
|
|
2473
|
-
host: params[
|
|
2474
|
-
path: params[
|
|
2475
|
-
token: params[
|
|
2489
|
+
host: params[parameters11.host.slug],
|
|
2490
|
+
path: params[parameters11.httpPath.slug],
|
|
2491
|
+
token: params[parameters11.token.slug]
|
|
2476
2492
|
});
|
|
2477
2493
|
let session;
|
|
2478
2494
|
let operation;
|
|
@@ -2499,9 +2515,9 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
2499
2515
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
2500
2516
|
const client = new DBSQLClient();
|
|
2501
2517
|
await client.connect({
|
|
2502
|
-
host: params[
|
|
2503
|
-
path: params[
|
|
2504
|
-
token: params[
|
|
2518
|
+
host: params[parameters11.host.slug],
|
|
2519
|
+
path: params[parameters11.httpPath.slug],
|
|
2520
|
+
token: params[parameters11.token.slug]
|
|
2505
2521
|
});
|
|
2506
2522
|
let session;
|
|
2507
2523
|
let operation;
|
|
@@ -2524,7 +2540,7 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
2524
2540
|
});
|
|
2525
2541
|
|
|
2526
2542
|
// src/connectors/airtable/parameters.ts
|
|
2527
|
-
var
|
|
2543
|
+
var parameters12 = {
|
|
2528
2544
|
baseId: new ParameterDefinition({
|
|
2529
2545
|
slug: "base-id",
|
|
2530
2546
|
name: "Airtable Base ID",
|
|
@@ -2581,8 +2597,8 @@ Authentication is handled automatically using the API Key.
|
|
|
2581
2597
|
}
|
|
2582
2598
|
console.log(`[connector-request] airtable/${connection.name}: ${method} ${path}`);
|
|
2583
2599
|
try {
|
|
2584
|
-
const apiKey =
|
|
2585
|
-
const baseId =
|
|
2600
|
+
const apiKey = parameters12.apiKey.getValue(connection);
|
|
2601
|
+
const baseId = parameters12.baseId.getValue(connection);
|
|
2586
2602
|
const resolvedPath = path.replace(/\{baseId\}/g, baseId);
|
|
2587
2603
|
const url = `${BASE_URL}${resolvedPath}`;
|
|
2588
2604
|
const controller = new AbortController();
|
|
@@ -2624,7 +2640,7 @@ var airtableConnector = new ConnectorPlugin({
|
|
|
2624
2640
|
name: "Airtable",
|
|
2625
2641
|
description: "Connect to Airtable for spreadsheet-database hybrid data management.",
|
|
2626
2642
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/19JUphfOZjyjTK6Zg4NGCf/8c56227b088cada52d3a2d9385a3be97/airtable.svg",
|
|
2627
|
-
parameters:
|
|
2643
|
+
parameters: parameters12,
|
|
2628
2644
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
2629
2645
|
systemPrompt: `## Airtable API
|
|
2630
2646
|
- Call the Airtable REST API using the authenticated request tool
|
|
@@ -2648,7 +2664,7 @@ var airtableConnector = new ConnectorPlugin({
|
|
|
2648
2664
|
});
|
|
2649
2665
|
|
|
2650
2666
|
// src/connectors/google-analytics/parameters.ts
|
|
2651
|
-
var
|
|
2667
|
+
var parameters13 = {
|
|
2652
2668
|
serviceAccountKeyJsonBase64: new ParameterDefinition({
|
|
2653
2669
|
slug: "service-account-key-json-base64",
|
|
2654
2670
|
name: "Google Cloud Service Account JSON",
|
|
@@ -2706,8 +2722,8 @@ Authentication is handled automatically using a service account.
|
|
|
2706
2722
|
console.log(`[connector-request] google-analytics/${connection.name}: ${method} ${path}`);
|
|
2707
2723
|
try {
|
|
2708
2724
|
const { GoogleAuth } = await import("google-auth-library");
|
|
2709
|
-
const keyJsonBase64 =
|
|
2710
|
-
const propertyId =
|
|
2725
|
+
const keyJsonBase64 = parameters13.serviceAccountKeyJsonBase64.getValue(connection);
|
|
2726
|
+
const propertyId = parameters13.propertyId.getValue(connection);
|
|
2711
2727
|
const credentials = JSON.parse(
|
|
2712
2728
|
Buffer.from(keyJsonBase64, "base64").toString("utf-8")
|
|
2713
2729
|
);
|
|
@@ -2760,7 +2776,7 @@ var googleAnalyticsConnector = new ConnectorPlugin({
|
|
|
2760
2776
|
name: "Google Analytics",
|
|
2761
2777
|
description: "Connect to Google Analytics for web analytics and reporting.",
|
|
2762
2778
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7fs0ipzxuD9mACDzBATtxX/3c53ed90d15c96483e4f78cb29dab5e9/google-analytics.svg",
|
|
2763
|
-
parameters:
|
|
2779
|
+
parameters: parameters13,
|
|
2764
2780
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
2765
2781
|
systemPrompt: `## Google Analytics Data API
|
|
2766
2782
|
- Call the GA4 Data API using the authenticated request tool
|
|
@@ -2930,7 +2946,7 @@ const { apps } = await kintone.listApps();
|
|
|
2930
2946
|
});
|
|
2931
2947
|
|
|
2932
2948
|
// src/connectors/wix-store/parameters.ts
|
|
2933
|
-
var
|
|
2949
|
+
var parameters14 = {
|
|
2934
2950
|
accountId: new ParameterDefinition({
|
|
2935
2951
|
slug: "account-id",
|
|
2936
2952
|
name: "Account ID",
|
|
@@ -2995,8 +3011,8 @@ Authentication is handled automatically using the API Key and Site ID.`,
|
|
|
2995
3011
|
}
|
|
2996
3012
|
console.log(`[connector-request] wix-store/${connection.name}: ${method} ${path}`);
|
|
2997
3013
|
try {
|
|
2998
|
-
const apiKey =
|
|
2999
|
-
const siteId =
|
|
3014
|
+
const apiKey = parameters14.apiKey.getValue(connection);
|
|
3015
|
+
const siteId = parameters14.siteId.getValue(connection);
|
|
3000
3016
|
const url = `${BASE_URL3}${path}`;
|
|
3001
3017
|
const controller = new AbortController();
|
|
3002
3018
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS6);
|
|
@@ -3038,7 +3054,7 @@ var wixStoreConnector = new ConnectorPlugin({
|
|
|
3038
3054
|
name: "Wix Store",
|
|
3039
3055
|
description: "Connect to Wix Store.",
|
|
3040
3056
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/YyFxclQFzROIYpFam6vRK/e7e75d3feac49a1cc5e433c147216d23/Wix_logo_black.svg",
|
|
3041
|
-
parameters:
|
|
3057
|
+
parameters: parameters14,
|
|
3042
3058
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
3043
3059
|
systemPrompt: `## Wix Store API
|
|
3044
3060
|
- Call the Wix Store REST API using the authenticated request tool
|
|
@@ -3064,7 +3080,7 @@ var wixStoreConnector = new ConnectorPlugin({
|
|
|
3064
3080
|
});
|
|
3065
3081
|
|
|
3066
3082
|
// src/connectors/dbt/parameters.ts
|
|
3067
|
-
var
|
|
3083
|
+
var parameters15 = {
|
|
3068
3084
|
host: new ParameterDefinition({
|
|
3069
3085
|
slug: "host",
|
|
3070
3086
|
name: "dbt Cloud Host",
|
|
@@ -3141,9 +3157,9 @@ Authentication is handled automatically using the API token.
|
|
|
3141
3157
|
}
|
|
3142
3158
|
console.log(`[connector-request] dbt/${connection.name}: GraphQL query`);
|
|
3143
3159
|
try {
|
|
3144
|
-
const host =
|
|
3145
|
-
const token =
|
|
3146
|
-
const environmentId =
|
|
3160
|
+
const host = parameters15.host.getValue(connection);
|
|
3161
|
+
const token = parameters15.token.getValue(connection);
|
|
3162
|
+
const environmentId = parameters15.prodEnvId.getValue(connection);
|
|
3147
3163
|
const resolvedVariables = variables ? JSON.parse(
|
|
3148
3164
|
JSON.stringify(variables).replace(/\{environmentId\}/g, environmentId)
|
|
3149
3165
|
) : void 0;
|
|
@@ -3193,7 +3209,7 @@ var dbtConnector = new ConnectorPlugin({
|
|
|
3193
3209
|
name: "dbt",
|
|
3194
3210
|
description: "Connect to dbt Cloud for data transformation and analytics engineering.",
|
|
3195
3211
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4iT6ncXtdtHdkXexU0WgfZ/0367a38d245f2568eab5eb511f9ee692/dbt.png",
|
|
3196
|
-
parameters:
|
|
3212
|
+
parameters: parameters15,
|
|
3197
3213
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
3198
3214
|
systemPrompt: `## dbt Cloud Discovery API (GraphQL)
|
|
3199
3215
|
- Call the dbt Cloud Discovery API using the authenticated request tool
|
|
@@ -3250,7 +3266,7 @@ query:
|
|
|
3250
3266
|
});
|
|
3251
3267
|
|
|
3252
3268
|
// src/connectors/squadbase-db/parameters.ts
|
|
3253
|
-
var
|
|
3269
|
+
var parameters16 = {
|
|
3254
3270
|
connectionUrl: new ParameterDefinition({
|
|
3255
3271
|
slug: "connection-url",
|
|
3256
3272
|
name: "Connection URL",
|
|
@@ -3307,7 +3323,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
3307
3323
|
let connectionUrl;
|
|
3308
3324
|
try {
|
|
3309
3325
|
const { Pool } = await import("pg");
|
|
3310
|
-
connectionUrl =
|
|
3326
|
+
connectionUrl = parameters16.connectionUrl.getValue(connection);
|
|
3311
3327
|
const pool = new Pool({
|
|
3312
3328
|
connectionString: connectionUrl,
|
|
3313
3329
|
ssl: { rejectUnauthorized: false },
|
|
@@ -3345,7 +3361,7 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
3345
3361
|
name: "Squadbase DB",
|
|
3346
3362
|
description: "Connect to Squadbase DB (PostgreSQL).",
|
|
3347
3363
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/25y0XqMxIufeD3egWH3bEl/659b4ade405890654cfaf91c03a4b458/icon.svg",
|
|
3348
|
-
parameters:
|
|
3364
|
+
parameters: parameters16,
|
|
3349
3365
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
3350
3366
|
systemPrompt: `## Squadbase DB SQL Notes
|
|
3351
3367
|
- Uses PostgreSQL based SQL syntax
|
|
@@ -3357,7 +3373,7 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
3357
3373
|
async checkConnection(params, _config) {
|
|
3358
3374
|
const { Pool } = await import("pg");
|
|
3359
3375
|
const pool = new Pool({
|
|
3360
|
-
connectionString: params[
|
|
3376
|
+
connectionString: params[parameters16.connectionUrl.slug],
|
|
3361
3377
|
ssl: { rejectUnauthorized: false },
|
|
3362
3378
|
connectionTimeoutMillis: 1e4
|
|
3363
3379
|
});
|
|
@@ -3374,7 +3390,7 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
3374
3390
|
const { Pool } = await import("pg");
|
|
3375
3391
|
const { text, values } = buildPositionalParams(sql, namedParams);
|
|
3376
3392
|
const pool = new Pool({
|
|
3377
|
-
connectionString: params[
|
|
3393
|
+
connectionString: params[parameters16.connectionUrl.slug],
|
|
3378
3394
|
ssl: { rejectUnauthorized: false },
|
|
3379
3395
|
connectionTimeoutMillis: 1e4,
|
|
3380
3396
|
statement_timeout: 6e4
|
|
@@ -3388,6 +3404,34 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
3388
3404
|
}
|
|
3389
3405
|
});
|
|
3390
3406
|
|
|
3407
|
+
// src/connectors/openai/index.ts
|
|
3408
|
+
var tools16 = {};
|
|
3409
|
+
var openaiConnector = new ConnectorPlugin({
|
|
3410
|
+
slug: "openai",
|
|
3411
|
+
authType: null,
|
|
3412
|
+
name: "OpenAI",
|
|
3413
|
+
description: "Connect to OpenAI for AI model inference, embeddings, and image generation.",
|
|
3414
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/53XJtCgUlW10x6i1X8xpxM/0bfd634069f1d74241296543cb20427a/openai.svg",
|
|
3415
|
+
parameters: parameters2,
|
|
3416
|
+
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
3417
|
+
systemPrompt: `## OpenAI SDK (TypeScript handler)
|
|
3418
|
+
Use the OpenAI connector via the SDK in TypeScript handlers:
|
|
3419
|
+
|
|
3420
|
+
\`\`\`ts
|
|
3421
|
+
import { connection } from "@squadbase/vite-server/connectors/openai";
|
|
3422
|
+
import OpenAI from "openai";
|
|
3423
|
+
|
|
3424
|
+
const { apiKey } = connection("<connectionId>");
|
|
3425
|
+
const client = new OpenAI({ apiKey });
|
|
3426
|
+
|
|
3427
|
+
const response = await client.chat.completions.create({
|
|
3428
|
+
model: "gpt-4o",
|
|
3429
|
+
messages: [{ role: "user", content: "Hello" }],
|
|
3430
|
+
});
|
|
3431
|
+
\`\`\``,
|
|
3432
|
+
tools: tools16
|
|
3433
|
+
});
|
|
3434
|
+
|
|
3391
3435
|
// src/connectors/registry.ts
|
|
3392
3436
|
var plugins = {
|
|
3393
3437
|
snowflake: snowflakeConnector,
|
|
@@ -3404,7 +3448,8 @@ var plugins = {
|
|
|
3404
3448
|
airtable: airtableConnector,
|
|
3405
3449
|
squadbaseDb: squadbaseDbConnector,
|
|
3406
3450
|
kintone: kintoneConnector,
|
|
3407
|
-
wixStore: wixStoreConnector
|
|
3451
|
+
wixStore: wixStoreConnector,
|
|
3452
|
+
openai: openaiConnector
|
|
3408
3453
|
};
|
|
3409
3454
|
var connectors = {
|
|
3410
3455
|
...plugins,
|
|
@@ -3443,6 +3488,7 @@ export {
|
|
|
3443
3488
|
googleAnalyticsConnector,
|
|
3444
3489
|
kintoneConnector,
|
|
3445
3490
|
mysqlConnector,
|
|
3491
|
+
openaiConnector,
|
|
3446
3492
|
postgresqlConnector,
|
|
3447
3493
|
redshiftConnector,
|
|
3448
3494
|
snowflakeConnector,
|
package/dist/sdk.d.ts
CHANGED
|
@@ -34,6 +34,16 @@ interface KintoneConnectorSdk {
|
|
|
34
34
|
* @param params - Resolved parameter values keyed by parameter slug
|
|
35
35
|
* ("base-url", "username", "password")
|
|
36
36
|
*/
|
|
37
|
-
declare function createClient(params: Record<string, string>): KintoneConnectorSdk;
|
|
37
|
+
declare function createClient$1(params: Record<string, string>): KintoneConnectorSdk;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
interface OpenAIConnectorSdk {
|
|
40
|
+
apiKey: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create an OpenAI client from resolved connection parameters.
|
|
44
|
+
*
|
|
45
|
+
* @param params - Resolved parameter values keyed by parameter slug ("api-key")
|
|
46
|
+
*/
|
|
47
|
+
declare function createClient(params: Record<string, string>): OpenAIConnectorSdk;
|
|
48
|
+
|
|
49
|
+
export { type KintoneConnectorSdk, type OpenAIConnectorSdk, createClient$1 as kintone, createClient as openai };
|
package/dist/sdk.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
parameters
|
|
3
|
-
|
|
2
|
+
parameters,
|
|
3
|
+
parameters2
|
|
4
|
+
} from "./chunk-E5AVUXWJ.js";
|
|
4
5
|
|
|
5
6
|
// src/connectors/kintone/sdk/index.ts
|
|
6
7
|
function createClient(params) {
|
|
@@ -70,6 +71,18 @@ function createClient(params) {
|
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
// src/connectors/openai/sdk/index.ts
|
|
76
|
+
function createClient2(params) {
|
|
77
|
+
const apiKey = params[parameters2.apiKey.slug];
|
|
78
|
+
if (!apiKey) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
`openai: missing required parameter: ${parameters2.apiKey.slug}`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return { apiKey };
|
|
84
|
+
}
|
|
73
85
|
export {
|
|
74
|
-
createClient as kintone
|
|
86
|
+
createClient as kintone,
|
|
87
|
+
createClient2 as openai
|
|
75
88
|
};
|