@superblocksteam/sdk-api 2.0.105 → 2.0.106-next.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/README.md +439 -89
- package/dist/api/definition.d.ts +11 -6
- package/dist/api/definition.d.ts.map +1 -1
- package/dist/api/definition.js +19 -12
- package/dist/api/definition.js.map +1 -1
- package/dist/api/definition.test.js +39 -15
- package/dist/api/definition.test.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/integrations/base/index.d.ts +2 -1
- package/dist/integrations/base/index.d.ts.map +1 -1
- package/dist/integrations/base/index.js +1 -0
- package/dist/integrations/base/index.js.map +1 -1
- package/dist/integrations/base/rest-api-client-base.d.ts +48 -0
- package/dist/integrations/base/rest-api-client-base.d.ts.map +1 -0
- package/dist/integrations/base/rest-api-client-base.js +98 -0
- package/dist/integrations/base/rest-api-client-base.js.map +1 -0
- package/dist/integrations/base/rest-api-integration-client.d.ts +10 -20
- package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.js +10 -65
- package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
- package/dist/integrations/box/types.d.ts +1 -1
- package/dist/integrations/declarations.d.ts +5 -73
- package/dist/integrations/declarations.d.ts.map +1 -1
- package/dist/integrations/declarations.js +5 -68
- package/dist/integrations/declarations.js.map +1 -1
- package/dist/integrations/documentation.test.js +0 -2
- package/dist/integrations/documentation.test.js.map +1 -1
- package/dist/integrations/googledrive/types.d.ts +1 -1
- package/dist/integrations/index.d.ts +1 -11
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +1 -7
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/registry.d.ts +1 -11
- package/dist/integrations/registry.d.ts.map +1 -1
- package/dist/integrations/registry.js +0 -29
- package/dist/integrations/registry.js.map +1 -1
- package/dist/integrations/slack/client.d.ts +13 -9
- package/dist/integrations/slack/client.d.ts.map +1 -1
- package/dist/integrations/slack/client.js +60 -8
- package/dist/integrations/slack/client.js.map +1 -1
- package/dist/integrations/slack/client.test.d.ts +11 -0
- package/dist/integrations/slack/client.test.d.ts.map +1 -0
- package/dist/integrations/slack/client.test.js +368 -0
- package/dist/integrations/slack/client.test.js.map +1 -0
- package/dist/integrations/slack/index.d.ts +2 -1
- package/dist/integrations/slack/index.d.ts.map +1 -1
- package/dist/integrations/slack/index.js +1 -0
- package/dist/integrations/slack/index.js.map +1 -1
- package/dist/integrations/slack/types.d.ts +127 -28
- package/dist/integrations/slack/types.d.ts.map +1 -1
- package/dist/integrations/slack/types.js +27 -1
- package/dist/integrations/slack/types.js.map +1 -1
- package/dist/integrations/snowflake/client.d.ts +2 -2
- package/dist/integrations/snowflake/client.js +2 -2
- package/dist/runtime/context.d.ts +1 -1
- package/dist/runtime/executor.d.ts +2 -2
- package/dist/types.d.ts +15 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/definition.test.ts +40 -15
- package/src/api/definition.ts +19 -12
- package/src/errors.ts +1 -1
- package/src/index.ts +13 -33
- package/src/integrations/asana/README.md +12 -12
- package/src/integrations/base/index.ts +2 -1
- package/src/integrations/base/rest-api-client-base.ts +134 -0
- package/src/integrations/base/rest-api-integration-client.ts +12 -89
- package/src/integrations/bitbucket/README.md +19 -19
- package/src/integrations/box/README.md +24 -24
- package/src/integrations/box/types.ts +1 -1
- package/src/integrations/circleci/README.md +18 -18
- package/src/integrations/declarations.ts +5 -105
- package/src/integrations/documentation.test.ts +0 -2
- package/src/integrations/googledrive/README.md +25 -22
- package/src/integrations/googledrive/types.ts +1 -1
- package/src/integrations/graphql/README.md +2 -2
- package/src/integrations/groq/README.md +8 -8
- package/src/integrations/index.ts +0 -51
- package/src/integrations/perplexity/README.md +39 -48
- package/src/integrations/registry.ts +1 -39
- package/src/integrations/salesforce/README.md +11 -9
- package/src/integrations/slack/README.md +62 -19
- package/src/integrations/slack/client.test.ts +553 -0
- package/src/integrations/slack/client.ts +92 -12
- package/src/integrations/slack/index.ts +6 -1
- package/src/integrations/slack/types.ts +142 -29
- package/src/integrations/snowflake/client.ts +2 -2
- package/src/integrations/zoom/README.md +15 -15
- package/src/runtime/context.ts +1 -1
- package/src/runtime/executor.ts +2 -2
- package/src/types.ts +15 -6
- package/dist/integrations/couchbase/client.d.ts +0 -36
- package/dist/integrations/couchbase/client.d.ts.map +0 -1
- package/dist/integrations/couchbase/client.js +0 -148
- package/dist/integrations/couchbase/client.js.map +0 -1
- package/dist/integrations/couchbase/index.d.ts +0 -8
- package/dist/integrations/couchbase/index.d.ts.map +0 -1
- package/dist/integrations/couchbase/index.js +0 -7
- package/dist/integrations/couchbase/index.js.map +0 -1
- package/dist/integrations/couchbase/types.d.ts +0 -100
- package/dist/integrations/couchbase/types.d.ts.map +0 -1
- package/dist/integrations/couchbase/types.js +0 -5
- package/dist/integrations/couchbase/types.js.map +0 -1
- package/dist/integrations/kafka/client.d.ts +0 -25
- package/dist/integrations/kafka/client.d.ts.map +0 -1
- package/dist/integrations/kafka/client.js +0 -124
- package/dist/integrations/kafka/client.js.map +0 -1
- package/dist/integrations/kafka/index.d.ts +0 -8
- package/dist/integrations/kafka/index.d.ts.map +0 -1
- package/dist/integrations/kafka/index.js +0 -7
- package/dist/integrations/kafka/index.js.map +0 -1
- package/dist/integrations/kafka/types.d.ts +0 -113
- package/dist/integrations/kafka/types.d.ts.map +0 -1
- package/dist/integrations/kafka/types.js +0 -5
- package/dist/integrations/kafka/types.js.map +0 -1
- package/dist/integrations/kinesis/client.d.ts +0 -31
- package/dist/integrations/kinesis/client.d.ts.map +0 -1
- package/dist/integrations/kinesis/client.js +0 -101
- package/dist/integrations/kinesis/client.js.map +0 -1
- package/dist/integrations/kinesis/index.d.ts +0 -8
- package/dist/integrations/kinesis/index.d.ts.map +0 -1
- package/dist/integrations/kinesis/index.js +0 -7
- package/dist/integrations/kinesis/index.js.map +0 -1
- package/dist/integrations/kinesis/types.d.ts +0 -97
- package/dist/integrations/kinesis/types.d.ts.map +0 -1
- package/dist/integrations/kinesis/types.js +0 -7
- package/dist/integrations/kinesis/types.js.map +0 -1
- package/dist/integrations/python/client.d.ts +0 -42
- package/dist/integrations/python/client.d.ts.map +0 -1
- package/dist/integrations/python/client.js +0 -89
- package/dist/integrations/python/client.js.map +0 -1
- package/dist/integrations/python/client.test.d.ts +0 -5
- package/dist/integrations/python/client.test.d.ts.map +0 -1
- package/dist/integrations/python/client.test.js +0 -214
- package/dist/integrations/python/client.test.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -6
- package/dist/integrations/python/index.d.ts.map +0 -1
- package/dist/integrations/python/index.js +0 -5
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/python/types.d.ts +0 -85
- package/dist/integrations/python/types.d.ts.map +0 -1
- package/dist/integrations/python/types.js +0 -5
- package/dist/integrations/python/types.js.map +0 -1
- package/dist/integrations/redis/client.d.ts +0 -43
- package/dist/integrations/redis/client.d.ts.map +0 -1
- package/dist/integrations/redis/client.js +0 -142
- package/dist/integrations/redis/client.js.map +0 -1
- package/dist/integrations/redis/index.d.ts +0 -8
- package/dist/integrations/redis/index.d.ts.map +0 -1
- package/dist/integrations/redis/index.js +0 -7
- package/dist/integrations/redis/index.js.map +0 -1
- package/dist/integrations/redis/types.d.ts +0 -137
- package/dist/integrations/redis/types.d.ts.map +0 -1
- package/dist/integrations/redis/types.js +0 -5
- package/dist/integrations/redis/types.js.map +0 -1
- package/src/integrations/couchbase/README.md +0 -138
- package/src/integrations/couchbase/client.ts +0 -225
- package/src/integrations/couchbase/index.ts +0 -8
- package/src/integrations/couchbase/types.ts +0 -126
- package/src/integrations/kafka/README.md +0 -144
- package/src/integrations/kafka/client.ts +0 -216
- package/src/integrations/kafka/index.ts +0 -14
- package/src/integrations/kafka/types.ts +0 -128
- package/src/integrations/kinesis/README.md +0 -153
- package/src/integrations/kinesis/client.ts +0 -146
- package/src/integrations/kinesis/index.ts +0 -14
- package/src/integrations/kinesis/types.ts +0 -114
- package/src/integrations/python/README.md +0 -566
- package/src/integrations/python/client.test.ts +0 -341
- package/src/integrations/python/client.ts +0 -136
- package/src/integrations/python/index.ts +0 -6
- package/src/integrations/python/types.ts +0 -92
- package/src/integrations/redis/README.md +0 -200
- package/src/integrations/redis/client.ts +0 -208
- package/src/integrations/redis/index.ts +0 -8
- package/src/integrations/redis/types.ts +0 -167
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* output: z.object({ name: z.string() }),
|
|
25
25
|
* async run(ctx) {
|
|
26
26
|
* const users = await ctx.integrations.pg.query(...);
|
|
27
|
-
* await ctx.integrations.notifier.
|
|
27
|
+
* await ctx.integrations.notifier.apiRequest(...);
|
|
28
28
|
* return { name: users[0].name };
|
|
29
29
|
* },
|
|
30
30
|
* });
|
|
@@ -43,7 +43,6 @@ import type { CockroachDBClient } from "./cockroachdb/index.js";
|
|
|
43
43
|
import type { CohereClient } from "./cohere/index.js";
|
|
44
44
|
import type { ConfluenceClient } from "./confluence/index.js";
|
|
45
45
|
import type { CosmosDBClient } from "./cosmosdb/index.js";
|
|
46
|
-
import type { CouchbaseClient } from "./couchbase/index.js";
|
|
47
46
|
import type { DatabricksClient } from "./databricks/index.js";
|
|
48
47
|
import type { DatadogClient } from "./datadog/index.js";
|
|
49
48
|
import type { DropboxClient } from "./dropbox/index.js";
|
|
@@ -62,8 +61,6 @@ import type { GoogleSheetsClient } from "./gsheets/index.js";
|
|
|
62
61
|
import type { HubSpotClient } from "./hubspot/index.js";
|
|
63
62
|
import type { IntercomClient } from "./intercom/index.js";
|
|
64
63
|
import type { JiraClient } from "./jira/index.js";
|
|
65
|
-
import type { KafkaClient } from "./kafka/index.js";
|
|
66
|
-
import type { KinesisClient } from "./kinesis/index.js";
|
|
67
64
|
import type { LakebaseClient } from "./lakebase/index.js";
|
|
68
65
|
import type { LaunchDarklyClient } from "./launchdarkly/index.js";
|
|
69
66
|
import type { MariaDBClient } from "./mariadb/index.js";
|
|
@@ -77,8 +74,6 @@ import type { OracleDBClient } from "./oracledb/index.js";
|
|
|
77
74
|
import type { PagerDutyClient } from "./pagerduty/index.js";
|
|
78
75
|
import type { PerplexityClient } from "./perplexity/index.js";
|
|
79
76
|
import type { PostgresClient } from "./postgres/index.js";
|
|
80
|
-
import type { PythonClient } from "./python/index.js";
|
|
81
|
-
import type { RedisClient } from "./redis/index.js";
|
|
82
77
|
import type { RedshiftClient } from "./redshift/index.js";
|
|
83
78
|
import type { RestApiIntegrationPluginClient } from "./restapiintegration/index.js";
|
|
84
79
|
import type { S3Client } from "./s3/index.js";
|
|
@@ -313,9 +308,6 @@ export type DynamoDBRef = IntegrationRef<"dynamodb", DynamoDBClient>;
|
|
|
313
308
|
/** Reference to a CosmosDB integration */
|
|
314
309
|
export type CosmosDBRef = IntegrationRef<"cosmosdb", CosmosDBClient>;
|
|
315
310
|
|
|
316
|
-
/** Reference to a Couchbase integration */
|
|
317
|
-
export type CouchbaseRef = IntegrationRef<"couchbase", CouchbaseClient>;
|
|
318
|
-
|
|
319
311
|
/** Reference to an S3 integration */
|
|
320
312
|
export type S3Ref = IntegrationRef<"s3", S3Client>;
|
|
321
313
|
|
|
@@ -325,33 +317,15 @@ export type GCSRef = IntegrationRef<"gcs", GCSClient>;
|
|
|
325
317
|
/** Reference to a Google Sheets integration */
|
|
326
318
|
export type GoogleSheetsRef = IntegrationRef<"gsheets", GoogleSheetsClient>;
|
|
327
319
|
|
|
328
|
-
/** Reference to a Kafka integration */
|
|
329
|
-
export type KafkaRef = IntegrationRef<"kafka", KafkaClient>;
|
|
330
|
-
|
|
331
|
-
/** Reference to a Kinesis integration */
|
|
332
|
-
export type KinesisRef = IntegrationRef<"kinesis", KinesisClient>;
|
|
333
|
-
|
|
334
320
|
/** Reference to a Salesforce integration */
|
|
335
321
|
export type SalesforceRef = IntegrationRef<"salesforce", SalesforceClient>;
|
|
336
322
|
|
|
337
|
-
/** Reference to a Redis integration */
|
|
338
|
-
export type RedisRef = IntegrationRef<"redis", RedisClient>;
|
|
339
|
-
|
|
340
323
|
/** Reference to a Superblocks OCR integration */
|
|
341
324
|
export type SuperblocksOCRRef = IntegrationRef<
|
|
342
325
|
"superblocks-ocr",
|
|
343
326
|
SuperblocksOCRClient
|
|
344
327
|
>;
|
|
345
328
|
|
|
346
|
-
/** Reference to a Python integration */
|
|
347
|
-
export type PythonRef = IntegrationRef<"python", PythonClient>;
|
|
348
|
-
|
|
349
|
-
/** Reference to a Confluent integration (Kafka-compatible) */
|
|
350
|
-
export type ConfluentRef = IntegrationRef<"confluent", KafkaClient>;
|
|
351
|
-
|
|
352
|
-
/** Reference to a Redpanda integration (Kafka-compatible) */
|
|
353
|
-
export type RedpandaRef = IntegrationRef<"redpanda", KafkaClient>;
|
|
354
|
-
|
|
355
329
|
/** Reference to a Lakebase integration */
|
|
356
330
|
export type LakebaseRef = IntegrationRef<"lakebase", LakebaseClient>;
|
|
357
331
|
|
|
@@ -426,10 +400,10 @@ export function postgres<T extends string>(id: LiteralString<T>): PostgresRef {
|
|
|
426
400
|
* input: z.object({ message: z.string() }),
|
|
427
401
|
* output: z.object({ sent: z.boolean() }),
|
|
428
402
|
* async run(ctx, { message }) {
|
|
429
|
-
* await ctx.integrations.notifier.
|
|
430
|
-
* channel: '#alerts',
|
|
431
|
-
*
|
|
432
|
-
*
|
|
403
|
+
* await ctx.integrations.notifier.apiRequest(
|
|
404
|
+
* { method: 'POST', path: '/chat.postMessage', body: { channel: '#alerts', text: message } },
|
|
405
|
+
* { response: z.object({ ok: z.boolean() }) }
|
|
406
|
+
* );
|
|
433
407
|
* return { sent: true };
|
|
434
408
|
* },
|
|
435
409
|
* });
|
|
@@ -971,18 +945,6 @@ export function cosmosdb<T extends string>(id: LiteralString<T>): CosmosDBRef {
|
|
|
971
945
|
return createRef<"cosmosdb", CosmosDBClient, T>("cosmosdb", id);
|
|
972
946
|
}
|
|
973
947
|
|
|
974
|
-
/**
|
|
975
|
-
* Declare a Couchbase integration.
|
|
976
|
-
*
|
|
977
|
-
* @param id - The integration ID (UUID)
|
|
978
|
-
* @returns An integration reference for use in the API config
|
|
979
|
-
*/
|
|
980
|
-
export function couchbase<T extends string>(
|
|
981
|
-
id: LiteralString<T>,
|
|
982
|
-
): CouchbaseRef {
|
|
983
|
-
return createRef<"couchbase", CouchbaseClient, T>("couchbase", id);
|
|
984
|
-
}
|
|
985
|
-
|
|
986
948
|
/**
|
|
987
949
|
* Declare an S3 integration.
|
|
988
950
|
*
|
|
@@ -1015,26 +977,6 @@ export function googleSheets<T extends string>(
|
|
|
1015
977
|
return createRef<"gsheets", GoogleSheetsClient, T>("gsheets", id);
|
|
1016
978
|
}
|
|
1017
979
|
|
|
1018
|
-
/**
|
|
1019
|
-
* Declare a Kafka integration.
|
|
1020
|
-
*
|
|
1021
|
-
* @param id - The integration ID (UUID)
|
|
1022
|
-
* @returns An integration reference for use in the API config
|
|
1023
|
-
*/
|
|
1024
|
-
export function kafka<T extends string>(id: LiteralString<T>): KafkaRef {
|
|
1025
|
-
return createRef<"kafka", KafkaClient, T>("kafka", id);
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
/**
|
|
1029
|
-
* Declare a Kinesis integration.
|
|
1030
|
-
*
|
|
1031
|
-
* @param id - The integration ID (UUID)
|
|
1032
|
-
* @returns An integration reference for use in the API config
|
|
1033
|
-
*/
|
|
1034
|
-
export function kinesis<T extends string>(id: LiteralString<T>): KinesisRef {
|
|
1035
|
-
return createRef<"kinesis", KinesisClient, T>("kinesis", id);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
980
|
/**
|
|
1039
981
|
* Declare a Salesforce integration.
|
|
1040
982
|
*
|
|
@@ -1047,16 +989,6 @@ export function salesforce<T extends string>(
|
|
|
1047
989
|
return createRef<"salesforce", SalesforceClient, T>("salesforce", id);
|
|
1048
990
|
}
|
|
1049
991
|
|
|
1050
|
-
/**
|
|
1051
|
-
* Declare a Redis integration.
|
|
1052
|
-
*
|
|
1053
|
-
* @param id - The integration ID (UUID)
|
|
1054
|
-
* @returns An integration reference for use in the API config
|
|
1055
|
-
*/
|
|
1056
|
-
export function redis<T extends string>(id: LiteralString<T>): RedisRef {
|
|
1057
|
-
return createRef<"redis", RedisClient, T>("redis", id);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
992
|
/**
|
|
1061
993
|
* Declare a Superblocks OCR integration.
|
|
1062
994
|
*
|
|
@@ -1072,38 +1004,6 @@ export function superblocksOcr<T extends string>(
|
|
|
1072
1004
|
);
|
|
1073
1005
|
}
|
|
1074
1006
|
|
|
1075
|
-
/**
|
|
1076
|
-
* Declare a Python integration.
|
|
1077
|
-
*
|
|
1078
|
-
* @param id - The integration ID (UUID)
|
|
1079
|
-
* @returns An integration reference for use in the API config
|
|
1080
|
-
*/
|
|
1081
|
-
export function python<T extends string>(id: LiteralString<T>): PythonRef {
|
|
1082
|
-
return createRef<"python", PythonClient, T>("python", id);
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
* Declare a Confluent integration (Kafka-compatible).
|
|
1087
|
-
*
|
|
1088
|
-
* @param id - The integration ID (UUID)
|
|
1089
|
-
* @returns An integration reference for use in the API config
|
|
1090
|
-
*/
|
|
1091
|
-
export function confluent<T extends string>(
|
|
1092
|
-
id: LiteralString<T>,
|
|
1093
|
-
): ConfluentRef {
|
|
1094
|
-
return createRef<"confluent", KafkaClient, T>("confluent", id);
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
/**
|
|
1098
|
-
* Declare a Redpanda integration (Kafka-compatible).
|
|
1099
|
-
*
|
|
1100
|
-
* @param id - The integration ID (UUID)
|
|
1101
|
-
* @returns An integration reference for use in the API config
|
|
1102
|
-
*/
|
|
1103
|
-
export function redpanda<T extends string>(id: LiteralString<T>): RedpandaRef {
|
|
1104
|
-
return createRef<"redpanda", KafkaClient, T>("redpanda", id);
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
1007
|
/**
|
|
1108
1008
|
* Declare a Lakebase integration.
|
|
1109
1009
|
*
|
|
@@ -71,7 +71,7 @@ export default api({
|
|
|
71
71
|
const result = await ctx.integrations.drive.apiRequest(
|
|
72
72
|
{
|
|
73
73
|
method: "GET",
|
|
74
|
-
path: "/
|
|
74
|
+
path: "/files",
|
|
75
75
|
params: {
|
|
76
76
|
q: query,
|
|
77
77
|
pageSize: pageSize,
|
|
@@ -99,7 +99,7 @@ export default api({
|
|
|
99
99
|
const file = await ctx.integrations.drive.apiRequest(
|
|
100
100
|
{
|
|
101
101
|
method: "GET",
|
|
102
|
-
path: `/
|
|
102
|
+
path: `/files/${fileId}`,
|
|
103
103
|
params: {
|
|
104
104
|
fields:
|
|
105
105
|
"id,name,mimeType,size,createdTime,modifiedTime,parents,webViewLink,webContentLink,owners",
|
|
@@ -120,7 +120,7 @@ const DownloadResponseSchema = z.string(); // Raw content
|
|
|
120
120
|
const content = await ctx.integrations.drive.apiRequest(
|
|
121
121
|
{
|
|
122
122
|
method: "GET",
|
|
123
|
-
path: `/
|
|
123
|
+
path: `/files/${fileId}`,
|
|
124
124
|
params: {
|
|
125
125
|
alt: "media",
|
|
126
126
|
},
|
|
@@ -134,7 +134,7 @@ const ExportResponseSchema = z.string();
|
|
|
134
134
|
const docContent = await ctx.integrations.drive.apiRequest(
|
|
135
135
|
{
|
|
136
136
|
method: "GET",
|
|
137
|
-
path: `/
|
|
137
|
+
path: `/files/${fileId}/export`,
|
|
138
138
|
params: {
|
|
139
139
|
mimeType: "text/plain", // or application/pdf, text/html, etc.
|
|
140
140
|
},
|
|
@@ -149,7 +149,7 @@ const docContent = await ctx.integrations.drive.apiRequest(
|
|
|
149
149
|
const folder = await ctx.integrations.drive.apiRequest(
|
|
150
150
|
{
|
|
151
151
|
method: "POST",
|
|
152
|
-
path: "/
|
|
152
|
+
path: "/files",
|
|
153
153
|
body: {
|
|
154
154
|
name: "New Folder",
|
|
155
155
|
mimeType: "application/vnd.google-apps.folder",
|
|
@@ -194,7 +194,7 @@ const uploadedFile = await ctx.integrations.drive.apiRequest(
|
|
|
194
194
|
const updatedFile = await ctx.integrations.drive.apiRequest(
|
|
195
195
|
{
|
|
196
196
|
method: "PATCH",
|
|
197
|
-
path: `/
|
|
197
|
+
path: `/files/${fileId}`,
|
|
198
198
|
body: {
|
|
199
199
|
name: "Renamed File.txt",
|
|
200
200
|
description: "Updated description",
|
|
@@ -210,7 +210,7 @@ const updatedFile = await ctx.integrations.drive.apiRequest(
|
|
|
210
210
|
const movedFile = await ctx.integrations.drive.apiRequest(
|
|
211
211
|
{
|
|
212
212
|
method: "PATCH",
|
|
213
|
-
path: `/
|
|
213
|
+
path: `/files/${fileId}`,
|
|
214
214
|
params: {
|
|
215
215
|
addParents: newFolderId,
|
|
216
216
|
removeParents: oldFolderId,
|
|
@@ -226,7 +226,7 @@ const movedFile = await ctx.integrations.drive.apiRequest(
|
|
|
226
226
|
const result = await ctx.integrations.drive.apiRequest(
|
|
227
227
|
{
|
|
228
228
|
method: "GET",
|
|
229
|
-
path: "/
|
|
229
|
+
path: "/files",
|
|
230
230
|
params: {
|
|
231
231
|
q: "name contains 'report' and mimeType = 'application/pdf' and trashed = false",
|
|
232
232
|
pageSize: 25,
|
|
@@ -250,7 +250,7 @@ const PermissionSchema = z.object({
|
|
|
250
250
|
const permission = await ctx.integrations.drive.apiRequest(
|
|
251
251
|
{
|
|
252
252
|
method: "POST",
|
|
253
|
-
path: `/
|
|
253
|
+
path: `/files/${fileId}/permissions`,
|
|
254
254
|
body: {
|
|
255
255
|
type: "user", // user, group, domain, anyone
|
|
256
256
|
role: "reader", // reader, writer, commenter, owner
|
|
@@ -271,7 +271,7 @@ const permission = await ctx.integrations.drive.apiRequest(
|
|
|
271
271
|
await ctx.integrations.drive.apiRequest(
|
|
272
272
|
{
|
|
273
273
|
method: "PATCH",
|
|
274
|
-
path: `/
|
|
274
|
+
path: `/files/${fileId}`,
|
|
275
275
|
body: {
|
|
276
276
|
trashed: true,
|
|
277
277
|
},
|
|
@@ -283,7 +283,7 @@ await ctx.integrations.drive.apiRequest(
|
|
|
283
283
|
await ctx.integrations.drive.apiRequest(
|
|
284
284
|
{
|
|
285
285
|
method: "DELETE",
|
|
286
|
-
path: `/
|
|
286
|
+
path: `/files/${fileId}`,
|
|
287
287
|
},
|
|
288
288
|
{ response: z.void() },
|
|
289
289
|
);
|
|
@@ -304,7 +304,7 @@ await drive.uploadFile({ ... });
|
|
|
304
304
|
|
|
305
305
|
// CORRECT - Use apiRequest
|
|
306
306
|
await ctx.integrations.drive.apiRequest(
|
|
307
|
-
{ method: "GET", path: "/
|
|
307
|
+
{ method: "GET", path: "/files", params: { ... } },
|
|
308
308
|
{ response: ListFilesResponseSchema }
|
|
309
309
|
);
|
|
310
310
|
```
|
|
@@ -316,7 +316,7 @@ By default, only basic fields are returned. Use the `fields` parameter:
|
|
|
316
316
|
```typescript
|
|
317
317
|
// WRONG - Missing fields, gets minimal data
|
|
318
318
|
const file = await ctx.integrations.drive.apiRequest(
|
|
319
|
-
{ method: "GET", path: `/
|
|
319
|
+
{ method: "GET", path: `/files/${fileId}` },
|
|
320
320
|
{ response: FileSchema },
|
|
321
321
|
);
|
|
322
322
|
// file.size, file.owners, etc. will be undefined
|
|
@@ -325,7 +325,7 @@ const file = await ctx.integrations.drive.apiRequest(
|
|
|
325
325
|
const file = await ctx.integrations.drive.apiRequest(
|
|
326
326
|
{
|
|
327
327
|
method: "GET",
|
|
328
|
-
path: `/
|
|
328
|
+
path: `/files/${fileId}`,
|
|
329
329
|
params: {
|
|
330
330
|
fields: "id,name,mimeType,size,createdTime,modifiedTime,owners",
|
|
331
331
|
},
|
|
@@ -367,10 +367,10 @@ Google Docs, Sheets, etc. must be exported, not downloaded directly:
|
|
|
367
367
|
|
|
368
368
|
```typescript
|
|
369
369
|
// Regular files - use alt=media
|
|
370
|
-
const path = `/
|
|
370
|
+
const path = `/files/${fileId}?alt=media`;
|
|
371
371
|
|
|
372
372
|
// Google Docs - use export endpoint
|
|
373
|
-
const path = `/
|
|
373
|
+
const path = `/files/${fileId}/export?mimeType=text/plain`;
|
|
374
374
|
|
|
375
375
|
// Export formats for Google Docs
|
|
376
376
|
// Documents: text/plain, text/html, application/pdf, application/vnd.oasis.opendocument.text
|
|
@@ -396,14 +396,17 @@ const sizeMB = sizeBytes / (1024 * 1024);
|
|
|
396
396
|
|
|
397
397
|
### Upload Path vs Regular Path
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
The base URL already includes `/drive/v3`, so regular API paths omit this prefix. However, uploads use a different URL root (`/upload/drive/v3/...` instead of `/drive/v3/...`) and require the full path:
|
|
400
400
|
|
|
401
401
|
```typescript
|
|
402
|
-
// Regular API calls
|
|
403
|
-
const path = "/
|
|
402
|
+
// Regular API calls (base URL already has /drive/v3)
|
|
403
|
+
const path = "/files";
|
|
404
404
|
|
|
405
|
-
// Upload calls
|
|
405
|
+
// Upload calls use a different URL root — include the full path
|
|
406
406
|
const path = "/upload/drive/v3/files";
|
|
407
|
+
|
|
408
|
+
// WRONG - Duplicates base URL prefix for regular calls
|
|
409
|
+
const path = "/drive/v3/files";
|
|
407
410
|
```
|
|
408
411
|
|
|
409
412
|
### Folder MIME Type
|
|
@@ -436,7 +439,7 @@ async function getAllFiles(drive: GoogleDriveClient, folderId: string) {
|
|
|
436
439
|
const result = await ctx.integrations.drive.apiRequest(
|
|
437
440
|
{
|
|
438
441
|
method: "GET",
|
|
439
|
-
path: "/
|
|
442
|
+
path: "/files",
|
|
440
443
|
params: {
|
|
441
444
|
q: `'${folderId}' in parents and trashed = false`,
|
|
442
445
|
pageSize: 100,
|
|
@@ -463,7 +466,7 @@ import { RestApiValidationError } from "@superblocksteam/sdk-api";
|
|
|
463
466
|
|
|
464
467
|
try {
|
|
465
468
|
const result = await ctx.integrations.drive.apiRequest(
|
|
466
|
-
{ method: "GET", path: "/
|
|
469
|
+
{ method: "GET", path: "/files", params: { ... } },
|
|
467
470
|
{ response: ListFilesResponseSchema }
|
|
468
471
|
);
|
|
469
472
|
} catch (error) {
|
|
@@ -112,7 +112,7 @@ const CreateUserResponseSchema = z.object({
|
|
|
112
112
|
}),
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
-
const result = await graphql.mutation(
|
|
115
|
+
const result = await ctx.integrations.graphql.mutation(
|
|
116
116
|
`mutation CreateUser($input: CreateUserInput!) {
|
|
117
117
|
createUser(input: $input) {
|
|
118
118
|
id
|
|
@@ -150,7 +150,7 @@ const UpdateOrderResponseSchema = z.object({
|
|
|
150
150
|
}),
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
const result = await graphql.mutation(
|
|
153
|
+
const result = await ctx.integrations.graphql.mutation(
|
|
154
154
|
`mutation UpdateOrder($id: ID!, $input: UpdateOrderInput!) {
|
|
155
155
|
updateOrder(id: $id, input: $input) {
|
|
156
156
|
id
|
|
@@ -87,7 +87,7 @@ export default api({
|
|
|
87
87
|
method: "POST",
|
|
88
88
|
path: "/v1/chat/completions",
|
|
89
89
|
body: {
|
|
90
|
-
model: "llama-3.
|
|
90
|
+
model: "llama-3.3-70b-versatile",
|
|
91
91
|
messages: [
|
|
92
92
|
{ role: "system", content: "You are a helpful assistant." },
|
|
93
93
|
{ role: "user", content: prompt },
|
|
@@ -105,13 +105,13 @@ export default api({
|
|
|
105
105
|
### Using Different Models
|
|
106
106
|
|
|
107
107
|
```typescript
|
|
108
|
-
// Llama 3.
|
|
108
|
+
// Llama 3.3 70B - Best balance of speed and quality
|
|
109
109
|
const llama70b = await ctx.integrations.groq.apiRequest(
|
|
110
110
|
{
|
|
111
111
|
method: "POST",
|
|
112
112
|
path: "/v1/chat/completions",
|
|
113
113
|
body: {
|
|
114
|
-
model: "llama-3.
|
|
114
|
+
model: "llama-3.3-70b-versatile",
|
|
115
115
|
messages: [{ role: "user", content: "Hello" }],
|
|
116
116
|
},
|
|
117
117
|
},
|
|
@@ -131,13 +131,13 @@ const llama8b = await ctx.integrations.groq.apiRequest(
|
|
|
131
131
|
{ response: ChatCompletionResponseSchema },
|
|
132
132
|
);
|
|
133
133
|
|
|
134
|
-
//
|
|
135
|
-
const
|
|
134
|
+
// GPT-OSS 120B - Good for code and reasoning
|
|
135
|
+
const gptOss = await ctx.integrations.groq.apiRequest(
|
|
136
136
|
{
|
|
137
137
|
method: "POST",
|
|
138
138
|
path: "/v1/chat/completions",
|
|
139
139
|
body: {
|
|
140
|
-
model: "
|
|
140
|
+
model: "openai/gpt-oss-120b",
|
|
141
141
|
messages: [{ role: "user", content: "Hello" }],
|
|
142
142
|
},
|
|
143
143
|
},
|
|
@@ -178,7 +178,7 @@ const result = await ctx.integrations.groq.apiRequest(
|
|
|
178
178
|
method: "POST",
|
|
179
179
|
path: "/v1/chat/completions",
|
|
180
180
|
body: {
|
|
181
|
-
model: "llama-3.
|
|
181
|
+
model: "llama-3.3-70b-versatile",
|
|
182
182
|
messages: [{ role: "user", content: "What's the weather in Tokyo?" }],
|
|
183
183
|
tools: [
|
|
184
184
|
{
|
|
@@ -228,7 +228,7 @@ const result = await ctx.integrations.groq.apiRequest(
|
|
|
228
228
|
method: "POST",
|
|
229
229
|
path: "/v1/chat/completions",
|
|
230
230
|
body: {
|
|
231
|
-
model: "llama-3.
|
|
231
|
+
model: "llama-3.3-70b-versatile",
|
|
232
232
|
messages: [
|
|
233
233
|
{
|
|
234
234
|
role: "user",
|
|
@@ -66,18 +66,11 @@ export {
|
|
|
66
66
|
mongodb,
|
|
67
67
|
dynamodb,
|
|
68
68
|
cosmosdb,
|
|
69
|
-
couchbase,
|
|
70
69
|
s3,
|
|
71
70
|
gcs,
|
|
72
71
|
googleSheets,
|
|
73
|
-
kafka,
|
|
74
|
-
kinesis,
|
|
75
72
|
salesforce,
|
|
76
|
-
redis,
|
|
77
73
|
superblocksOcr,
|
|
78
|
-
python,
|
|
79
|
-
confluent,
|
|
80
|
-
redpanda,
|
|
81
74
|
lakebase,
|
|
82
75
|
snowflakePostgres,
|
|
83
76
|
smtp,
|
|
@@ -143,18 +136,11 @@ export {
|
|
|
143
136
|
type MongoDBRef,
|
|
144
137
|
type DynamoDBRef,
|
|
145
138
|
type CosmosDBRef,
|
|
146
|
-
type CouchbaseRef,
|
|
147
139
|
type S3Ref,
|
|
148
140
|
type GCSRef,
|
|
149
141
|
type GoogleSheetsRef,
|
|
150
|
-
type KafkaRef,
|
|
151
|
-
type KinesisRef,
|
|
152
142
|
type SalesforceRef,
|
|
153
|
-
type RedisRef,
|
|
154
143
|
type SuperblocksOCRRef,
|
|
155
|
-
type PythonRef,
|
|
156
|
-
type ConfluentRef,
|
|
157
|
-
type RedpandaRef,
|
|
158
144
|
type LakebaseRef,
|
|
159
145
|
type SnowflakePostgresRef,
|
|
160
146
|
type SmtpRef,
|
|
@@ -383,13 +369,6 @@ export { DynamoDBClientImpl } from "./dynamodb/index.js";
|
|
|
383
369
|
export type { CosmosDBClient, CosmosDBQueryOptions } from "./cosmosdb/index.js";
|
|
384
370
|
export { CosmosDBClientImpl } from "./cosmosdb/index.js";
|
|
385
371
|
|
|
386
|
-
// Couchbase client
|
|
387
|
-
export type {
|
|
388
|
-
CouchbaseClient,
|
|
389
|
-
CouchbaseIdentifier,
|
|
390
|
-
} from "./couchbase/index.js";
|
|
391
|
-
export { CouchbaseClientImpl } from "./couchbase/index.js";
|
|
392
|
-
|
|
393
372
|
// S3 client
|
|
394
373
|
export type {
|
|
395
374
|
S3Client,
|
|
@@ -416,26 +395,6 @@ export type {
|
|
|
416
395
|
} from "./gsheets/index.js";
|
|
417
396
|
export { GoogleSheetsClientImpl } from "./gsheets/index.js";
|
|
418
397
|
|
|
419
|
-
// Kafka client
|
|
420
|
-
export type {
|
|
421
|
-
KafkaClient,
|
|
422
|
-
KafkaOperation,
|
|
423
|
-
KafkaSeek,
|
|
424
|
-
KafkaConsumeParams,
|
|
425
|
-
KafkaProduceParams,
|
|
426
|
-
} from "./kafka/index.js";
|
|
427
|
-
export { KafkaClientImpl } from "./kafka/index.js";
|
|
428
|
-
|
|
429
|
-
// Kinesis client
|
|
430
|
-
export type {
|
|
431
|
-
KinesisClient,
|
|
432
|
-
KinesisPutParams,
|
|
433
|
-
KinesisGetParams,
|
|
434
|
-
KinesisStreamIdentifier,
|
|
435
|
-
KinesisShardIteratorType,
|
|
436
|
-
} from "./kinesis/index.js";
|
|
437
|
-
export { KinesisClientImpl } from "./kinesis/index.js";
|
|
438
|
-
|
|
439
398
|
// Salesforce client
|
|
440
399
|
export type {
|
|
441
400
|
SalesforceClient,
|
|
@@ -444,18 +403,10 @@ export type {
|
|
|
444
403
|
} from "./salesforce/index.js";
|
|
445
404
|
export { SalesforceClientImpl } from "./salesforce/index.js";
|
|
446
405
|
|
|
447
|
-
// Redis client
|
|
448
|
-
export type { RedisClient } from "./redis/index.js";
|
|
449
|
-
export { RedisClientImpl } from "./redis/index.js";
|
|
450
|
-
|
|
451
406
|
// Superblocks OCR client
|
|
452
407
|
export type { SuperblocksOCRClient } from "./superblocks-ocr/index.js";
|
|
453
408
|
export { SuperblocksOCRClientImpl } from "./superblocks-ocr/index.js";
|
|
454
409
|
|
|
455
|
-
// Python client
|
|
456
|
-
export type { PythonClient } from "./python/index.js";
|
|
457
|
-
export { PythonClientImpl } from "./python/index.js";
|
|
458
|
-
|
|
459
410
|
// Lakebase client
|
|
460
411
|
export type { LakebaseClient } from "./lakebase/index.js";
|
|
461
412
|
export { LakebaseClientImpl } from "./lakebase/index.js";
|
|
@@ -471,5 +422,3 @@ export { SmtpClientImpl } from "./smtp/index.js";
|
|
|
471
422
|
// REST API Integration client
|
|
472
423
|
export type { RestApiIntegrationPluginClient } from "./restapiintegration/index.js";
|
|
473
424
|
export { RestApiIntegrationPluginClientImpl } from "./restapiintegration/index.js";
|
|
474
|
-
|
|
475
|
-
// Confluent and Redpanda reuse the Kafka client (same proto)
|