@superblocksteam/sdk-api 2.0.96 → 2.0.97-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 +68 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/athena/client.d.ts +3 -3
- package/dist/integrations/athena/client.d.ts.map +1 -1
- package/dist/integrations/athena/client.js +4 -4
- package/dist/integrations/athena/client.js.map +1 -1
- package/dist/integrations/athena/types.d.ts +3 -2
- package/dist/integrations/athena/types.d.ts.map +1 -1
- package/dist/integrations/base/graphql-integration-client.d.ts +5 -3
- package/dist/integrations/base/graphql-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/graphql-integration-client.js +8 -6
- package/dist/integrations/base/graphql-integration-client.js.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.d.ts +6 -4
- package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.js +7 -5
- package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
- package/dist/integrations/base/types.d.ts +9 -4
- package/dist/integrations/base/types.d.ts.map +1 -1
- package/dist/integrations/bigquery/client.d.ts +3 -3
- package/dist/integrations/bigquery/client.d.ts.map +1 -1
- package/dist/integrations/bigquery/client.js +4 -4
- package/dist/integrations/bigquery/client.js.map +1 -1
- package/dist/integrations/bigquery/types.d.ts +3 -2
- package/dist/integrations/bigquery/types.d.ts.map +1 -1
- package/dist/integrations/cockroachdb/client.d.ts +3 -3
- package/dist/integrations/cockroachdb/client.d.ts.map +1 -1
- package/dist/integrations/cockroachdb/client.js +4 -4
- package/dist/integrations/cockroachdb/client.js.map +1 -1
- package/dist/integrations/cockroachdb/types.d.ts +3 -2
- package/dist/integrations/cockroachdb/types.d.ts.map +1 -1
- package/dist/integrations/cosmosdb/client.d.ts +7 -7
- package/dist/integrations/cosmosdb/client.d.ts.map +1 -1
- package/dist/integrations/cosmosdb/client.js +14 -14
- package/dist/integrations/cosmosdb/client.js.map +1 -1
- package/dist/integrations/cosmosdb/types.d.ts +12 -6
- package/dist/integrations/cosmosdb/types.d.ts.map +1 -1
- package/dist/integrations/couchbase/client.d.ts +5 -5
- package/dist/integrations/couchbase/client.d.ts.map +1 -1
- package/dist/integrations/couchbase/client.js +8 -8
- package/dist/integrations/couchbase/client.js.map +1 -1
- package/dist/integrations/couchbase/types.d.ts +8 -4
- package/dist/integrations/couchbase/types.d.ts.map +1 -1
- package/dist/integrations/databricks/client.d.ts +3 -3
- package/dist/integrations/databricks/client.d.ts.map +1 -1
- package/dist/integrations/databricks/client.js +4 -4
- package/dist/integrations/databricks/client.js.map +1 -1
- package/dist/integrations/databricks/types.d.ts +3 -2
- package/dist/integrations/databricks/types.d.ts.map +1 -1
- package/dist/integrations/dynamodb/client.d.ts +12 -12
- package/dist/integrations/dynamodb/client.d.ts.map +1 -1
- package/dist/integrations/dynamodb/client.js +24 -24
- package/dist/integrations/dynamodb/client.js.map +1 -1
- package/dist/integrations/dynamodb/types.d.ts +28 -14
- package/dist/integrations/dynamodb/types.d.ts.map +1 -1
- package/dist/integrations/gcs/client.d.ts +8 -8
- package/dist/integrations/gcs/client.d.ts.map +1 -1
- package/dist/integrations/gcs/client.js +16 -16
- package/dist/integrations/gcs/client.js.map +1 -1
- package/dist/integrations/gcs/types.d.ts +14 -7
- package/dist/integrations/gcs/types.d.ts.map +1 -1
- package/dist/integrations/graphql/types.d.ts +11 -4
- package/dist/integrations/graphql/types.d.ts.map +1 -1
- package/dist/integrations/gsheets/client.d.ts +2 -2
- package/dist/integrations/gsheets/client.d.ts.map +1 -1
- package/dist/integrations/gsheets/client.js +2 -2
- package/dist/integrations/gsheets/client.js.map +1 -1
- package/dist/integrations/gsheets/types.d.ts +2 -1
- package/dist/integrations/gsheets/types.d.ts.map +1 -1
- package/dist/integrations/index.d.ts +1 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/kafka/client.d.ts +3 -3
- package/dist/integrations/kafka/client.d.ts.map +1 -1
- package/dist/integrations/kafka/client.js +6 -6
- package/dist/integrations/kafka/client.js.map +1 -1
- package/dist/integrations/kafka/types.d.ts +4 -2
- package/dist/integrations/kafka/types.d.ts.map +1 -1
- package/dist/integrations/kinesis/client.d.ts +3 -3
- package/dist/integrations/kinesis/client.d.ts.map +1 -1
- package/dist/integrations/kinesis/client.js +6 -6
- package/dist/integrations/kinesis/client.js.map +1 -1
- package/dist/integrations/kinesis/types.d.ts +4 -2
- package/dist/integrations/kinesis/types.d.ts.map +1 -1
- package/dist/integrations/lakebase/client.d.ts +3 -3
- package/dist/integrations/lakebase/client.d.ts.map +1 -1
- package/dist/integrations/lakebase/client.js +4 -4
- package/dist/integrations/lakebase/client.js.map +1 -1
- package/dist/integrations/lakebase/types.d.ts +3 -2
- package/dist/integrations/lakebase/types.d.ts.map +1 -1
- package/dist/integrations/mariadb/client.d.ts +3 -3
- package/dist/integrations/mariadb/client.d.ts.map +1 -1
- package/dist/integrations/mariadb/client.js +4 -4
- package/dist/integrations/mariadb/client.js.map +1 -1
- package/dist/integrations/mariadb/types.d.ts +3 -2
- package/dist/integrations/mariadb/types.d.ts.map +1 -1
- package/dist/integrations/mongodb/client.d.ts +2 -2
- package/dist/integrations/mongodb/client.d.ts.map +1 -1
- package/dist/integrations/mongodb/client.js +2 -2
- package/dist/integrations/mongodb/client.js.map +1 -1
- package/dist/integrations/mongodb/types.d.ts +2 -1
- package/dist/integrations/mongodb/types.d.ts.map +1 -1
- package/dist/integrations/mssql/client.d.ts +3 -3
- package/dist/integrations/mssql/client.d.ts.map +1 -1
- package/dist/integrations/mssql/client.js +4 -4
- package/dist/integrations/mssql/client.js.map +1 -1
- package/dist/integrations/mssql/types.d.ts +3 -2
- package/dist/integrations/mssql/types.d.ts.map +1 -1
- package/dist/integrations/mysql/client.d.ts +3 -3
- package/dist/integrations/mysql/client.d.ts.map +1 -1
- package/dist/integrations/mysql/client.js +4 -4
- package/dist/integrations/mysql/client.js.map +1 -1
- package/dist/integrations/mysql/types.d.ts +3 -2
- package/dist/integrations/mysql/types.d.ts.map +1 -1
- package/dist/integrations/oracledb/client.d.ts +3 -3
- package/dist/integrations/oracledb/client.d.ts.map +1 -1
- package/dist/integrations/oracledb/client.js +4 -4
- package/dist/integrations/oracledb/client.js.map +1 -1
- package/dist/integrations/oracledb/types.d.ts +3 -2
- package/dist/integrations/oracledb/types.d.ts.map +1 -1
- package/dist/integrations/postgres/client.d.ts +3 -3
- package/dist/integrations/postgres/client.d.ts.map +1 -1
- package/dist/integrations/postgres/client.js +4 -4
- package/dist/integrations/postgres/client.js.map +1 -1
- package/dist/integrations/postgres/types.d.ts +3 -2
- package/dist/integrations/postgres/types.d.ts.map +1 -1
- package/dist/integrations/python/client.d.ts +2 -2
- package/dist/integrations/python/client.d.ts.map +1 -1
- package/dist/integrations/python/client.js +2 -2
- package/dist/integrations/python/client.js.map +1 -1
- package/dist/integrations/python/types.d.ts +19 -2
- package/dist/integrations/python/types.d.ts.map +1 -1
- package/dist/integrations/redis/client.d.ts +12 -12
- package/dist/integrations/redis/client.d.ts.map +1 -1
- package/dist/integrations/redis/client.js +24 -24
- package/dist/integrations/redis/client.js.map +1 -1
- package/dist/integrations/redis/types.d.ts +22 -11
- package/dist/integrations/redis/types.d.ts.map +1 -1
- package/dist/integrations/redshift/client.d.ts +3 -3
- package/dist/integrations/redshift/client.d.ts.map +1 -1
- package/dist/integrations/redshift/client.js +4 -4
- package/dist/integrations/redshift/client.js.map +1 -1
- package/dist/integrations/redshift/types.d.ts +3 -2
- package/dist/integrations/redshift/types.d.ts.map +1 -1
- package/dist/integrations/registry.d.ts +21 -2
- package/dist/integrations/registry.d.ts.map +1 -1
- package/dist/integrations/registry.js.map +1 -1
- package/dist/integrations/s3/client.d.ts +8 -8
- package/dist/integrations/s3/client.d.ts.map +1 -1
- package/dist/integrations/s3/client.js +16 -16
- package/dist/integrations/s3/client.js.map +1 -1
- package/dist/integrations/s3/types.d.ts +14 -7
- package/dist/integrations/s3/types.d.ts.map +1 -1
- package/dist/integrations/salesforce/client.d.ts +10 -10
- package/dist/integrations/salesforce/client.d.ts.map +1 -1
- package/dist/integrations/salesforce/client.js +20 -20
- package/dist/integrations/salesforce/client.js.map +1 -1
- package/dist/integrations/salesforce/types.d.ts +18 -9
- package/dist/integrations/salesforce/types.d.ts.map +1 -1
- package/dist/integrations/smtp/client.d.ts +2 -2
- package/dist/integrations/smtp/client.d.ts.map +1 -1
- package/dist/integrations/smtp/client.js +2 -2
- package/dist/integrations/smtp/client.js.map +1 -1
- package/dist/integrations/smtp/types.d.ts +2 -1
- package/dist/integrations/smtp/types.d.ts.map +1 -1
- package/dist/integrations/snowflake/client.d.ts +3 -3
- package/dist/integrations/snowflake/client.d.ts.map +1 -1
- package/dist/integrations/snowflake/client.js +4 -4
- package/dist/integrations/snowflake/client.js.map +1 -1
- package/dist/integrations/snowflake/types.d.ts +3 -2
- package/dist/integrations/snowflake/types.d.ts.map +1 -1
- package/dist/integrations/snowflakepostgres/types.d.ts +3 -2
- package/dist/integrations/snowflakepostgres/types.d.ts.map +1 -1
- package/dist/runtime/context.d.ts +2 -1
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js +2 -2
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/execute.d.ts +4 -2
- package/dist/runtime/execute.d.ts.map +1 -1
- package/dist/runtime/execute.js.map +1 -1
- package/dist/runtime/executor.d.ts +2 -1
- package/dist/runtime/executor.d.ts.map +1 -1
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/streaming-context.d.ts +3 -2
- package/dist/runtime/streaming-context.d.ts.map +1 -1
- package/dist/runtime/streaming-context.js +2 -2
- package/dist/runtime/streaming-context.js.map +1 -1
- package/dist/runtime/streaming-executor.d.ts +4 -2
- package/dist/runtime/streaming-executor.d.ts.map +1 -1
- package/dist/runtime/streaming-executor.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/integrations/airtable/README.md +7 -3
- package/src/integrations/anthropic/README.md +8 -4
- package/src/integrations/asana/README.md +7 -3
- package/src/integrations/athena/README.md +8 -4
- package/src/integrations/athena/client.ts +5 -3
- package/src/integrations/athena/types.ts +7 -1
- package/src/integrations/base/graphql-integration-client.ts +9 -4
- package/src/integrations/base/rest-api-integration-client.ts +16 -3
- package/src/integrations/base/types.ts +9 -2
- package/src/integrations/bigquery/README.md +8 -4
- package/src/integrations/bigquery/client.ts +5 -3
- package/src/integrations/bigquery/types.ts +7 -1
- package/src/integrations/bitbucket/README.md +7 -3
- package/src/integrations/box/README.md +7 -3
- package/src/integrations/circleci/README.md +7 -3
- package/src/integrations/cockroachdb/README.md +8 -4
- package/src/integrations/cockroachdb/client.ts +5 -3
- package/src/integrations/cockroachdb/types.ts +7 -1
- package/src/integrations/cohere/README.md +7 -3
- package/src/integrations/confluence/README.md +7 -3
- package/src/integrations/cosmosdb/README.md +7 -3
- package/src/integrations/cosmosdb/client.ts +19 -8
- package/src/integrations/cosmosdb/types.ts +12 -0
- package/src/integrations/couchbase/README.md +10 -6
- package/src/integrations/couchbase/client.ts +23 -4
- package/src/integrations/couchbase/types.ts +12 -1
- package/src/integrations/databricks/README.md +8 -4
- package/src/integrations/databricks/client.ts +5 -3
- package/src/integrations/databricks/types.ts +7 -1
- package/src/integrations/datadog/README.md +7 -3
- package/src/integrations/dropbox/README.md +7 -3
- package/src/integrations/dynamodb/README.md +17 -13
- package/src/integrations/dynamodb/client.ts +52 -15
- package/src/integrations/dynamodb/types.ts +32 -6
- package/src/integrations/elasticsearch/README.md +7 -3
- package/src/integrations/fireworks/README.md +7 -3
- package/src/integrations/front/README.md +7 -3
- package/src/integrations/gcs/README.md +13 -9
- package/src/integrations/gcs/client.ts +61 -24
- package/src/integrations/gcs/types.ts +27 -4
- package/src/integrations/gemini/README.md +7 -3
- package/src/integrations/github/README.md +7 -3
- package/src/integrations/googleanalytics/README.md +7 -3
- package/src/integrations/googledrive/README.md +7 -3
- package/src/integrations/graphql/README.md +8 -4
- package/src/integrations/graphql/types.ts +11 -2
- package/src/integrations/groq/README.md +7 -3
- package/src/integrations/gsheets/README.md +7 -3
- package/src/integrations/gsheets/client.ts +4 -1
- package/src/integrations/gsheets/types.ts +2 -0
- package/src/integrations/hubspot/README.md +7 -3
- package/src/integrations/index.ts +1 -0
- package/src/integrations/intercom/README.md +7 -3
- package/src/integrations/jira/README.md +7 -3
- package/src/integrations/kafka/README.md +8 -4
- package/src/integrations/kafka/client.ts +8 -3
- package/src/integrations/kafka/types.ts +12 -2
- package/src/integrations/kinesis/README.md +8 -4
- package/src/integrations/kinesis/client.ts +13 -4
- package/src/integrations/kinesis/types.ts +10 -2
- package/src/integrations/lakebase/client.ts +7 -1
- package/src/integrations/lakebase/types.ts +7 -1
- package/src/integrations/launchdarkly/README.md +7 -3
- package/src/integrations/mariadb/README.md +8 -4
- package/src/integrations/mariadb/client.ts +5 -3
- package/src/integrations/mariadb/types.ts +7 -1
- package/src/integrations/mistral/README.md +7 -3
- package/src/integrations/mongodb/README.md +7 -3
- package/src/integrations/mongodb/client.ts +4 -1
- package/src/integrations/mongodb/types.ts +2 -0
- package/src/integrations/mssql/README.md +8 -4
- package/src/integrations/mssql/client.ts +5 -3
- package/src/integrations/mssql/types.ts +7 -1
- package/src/integrations/mysql/README.md +8 -4
- package/src/integrations/mysql/client.ts +5 -3
- package/src/integrations/mysql/types.ts +7 -1
- package/src/integrations/notion/README.md +7 -3
- package/src/integrations/openai_v2/README.md +8 -4
- package/src/integrations/oracledb/README.md +8 -4
- package/src/integrations/oracledb/client.ts +5 -3
- package/src/integrations/oracledb/types.ts +7 -1
- package/src/integrations/pagerduty/README.md +7 -3
- package/src/integrations/perplexity/README.md +7 -3
- package/src/integrations/postgres/README.md +28 -4
- package/src/integrations/postgres/client.ts +5 -3
- package/src/integrations/postgres/types.ts +7 -1
- package/src/integrations/python/README.md +20 -5
- package/src/integrations/python/client.ts +4 -1
- package/src/integrations/python/types.ts +19 -1
- package/src/integrations/redis/README.md +7 -3
- package/src/integrations/redis/client.ts +46 -23
- package/src/integrations/redis/types.ts +40 -11
- package/src/integrations/redshift/README.md +8 -4
- package/src/integrations/redshift/client.ts +5 -3
- package/src/integrations/redshift/types.ts +7 -1
- package/src/integrations/registry.ts +22 -0
- package/src/integrations/s3/README.md +13 -9
- package/src/integrations/s3/client.ts +61 -24
- package/src/integrations/s3/types.ts +27 -4
- package/src/integrations/salesforce/README.md +15 -11
- package/src/integrations/salesforce/client.ts +29 -12
- package/src/integrations/salesforce/types.ts +30 -3
- package/src/integrations/segment/README.md +7 -3
- package/src/integrations/sendgrid/README.md +7 -3
- package/src/integrations/slack/README.md +7 -3
- package/src/integrations/smtp/client.ts +10 -3
- package/src/integrations/smtp/types.ts +2 -1
- package/src/integrations/snowflake/README.md +8 -4
- package/src/integrations/snowflake/client.ts +5 -3
- package/src/integrations/snowflake/types.ts +7 -1
- package/src/integrations/snowflakepostgres/types.ts +7 -1
- package/src/integrations/stabilityai/README.md +7 -3
- package/src/integrations/stripe/README.md +7 -3
- package/src/integrations/superblocks-ocr/README.md +7 -3
- package/src/integrations/twilio/README.md +7 -3
- package/src/integrations/zendesk/README.md +7 -3
- package/src/integrations/zoom/README.md +7 -3
- package/src/runtime/context.ts +8 -2
- package/src/runtime/execute.ts +4 -0
- package/src/runtime/executor.ts +2 -0
- package/src/runtime/streaming-context.ts +7 -3
- package/src/runtime/streaming-executor.ts +4 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
9
9
|
import type { Plugin as SmtpPlugin } from "@superblocksteam/types/dist/src/plugins/smtp/v1/plugin_pb";
|
|
10
10
|
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
11
|
-
import type { QueryExecutor } from "../registry.js";
|
|
11
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
12
12
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
13
13
|
import type { SmtpClient, SmtpSendOptions } from "./types.js";
|
|
14
14
|
|
|
@@ -40,7 +40,10 @@ export class SmtpClientImpl implements SmtpClient, IntegrationClientImpl {
|
|
|
40
40
|
return this.config.pluginId;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async send(
|
|
43
|
+
async send(
|
|
44
|
+
options: SmtpSendOptions,
|
|
45
|
+
metadata?: TraceMetadata,
|
|
46
|
+
): Promise<unknown> {
|
|
44
47
|
const request: SmtpRequest = {
|
|
45
48
|
from: options.from,
|
|
46
49
|
to: options.to,
|
|
@@ -53,7 +56,11 @@ export class SmtpClientImpl implements SmtpClient, IntegrationClientImpl {
|
|
|
53
56
|
};
|
|
54
57
|
|
|
55
58
|
try {
|
|
56
|
-
return await this.executeQuery(
|
|
59
|
+
return await this.executeQuery(
|
|
60
|
+
request as Record<string, unknown>,
|
|
61
|
+
undefined,
|
|
62
|
+
metadata,
|
|
63
|
+
);
|
|
57
64
|
} catch (error) {
|
|
58
65
|
if (error instanceof IntegrationError) {
|
|
59
66
|
throw error;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
8
|
+
import type { TraceMetadata } from "../registry.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Options for sending an email via SMTP.
|
|
@@ -60,5 +61,5 @@ export interface SmtpClient extends BaseIntegrationClient {
|
|
|
60
61
|
* @param options - Email send options
|
|
61
62
|
* @returns The raw result from the SMTP plugin
|
|
62
63
|
*/
|
|
63
|
-
send(options: SmtpSendOptions): Promise<unknown>;
|
|
64
|
+
send(options: SmtpSendOptions, metadata?: TraceMetadata): Promise<unknown>;
|
|
64
65
|
}
|
|
@@ -4,10 +4,10 @@ Execute SQL queries and statements against Snowflake data warehouses with full t
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `query<T>(sql, schema, params?)` | Execute a SELECT query and return validated, typed results |
|
|
10
|
-
| `execute(sql, params?)` | Execute a statement (INSERT, UPDATE, DELETE) and return affected row count |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ------------------------------------------- | -------------------------------------------------------------------------- |
|
|
9
|
+
| `query<T>(sql, schema, params?, metadata?)` | Execute a SELECT query and return validated, typed results |
|
|
10
|
+
| `execute(sql, params?, metadata?)` | Execute a statement (INSERT, UPDATE, DELETE) and return affected row count |
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -143,6 +143,10 @@ const events = await ctx.integrations.snowflake.query(
|
|
|
143
143
|
);
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
## Trace Metadata
|
|
147
|
+
|
|
148
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
149
|
+
|
|
146
150
|
## Common Pitfalls
|
|
147
151
|
|
|
148
152
|
### Uppercase Column Names by Default
|
|
@@ -9,7 +9,7 @@ import type { z } from "zod";
|
|
|
9
9
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
10
10
|
import type { Plugin as SnowflakePlugin } from "@superblocksteam/types/dist/src/plugins/snowflake/v1/plugin_pb";
|
|
11
11
|
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
12
|
-
import type { QueryExecutor } from "../registry.js";
|
|
12
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
13
13
|
import { QueryValidationError } from "../../errors.js";
|
|
14
14
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
15
15
|
import { describeType } from "../utils.js";
|
|
@@ -64,11 +64,12 @@ export class SnowflakeClientImpl
|
|
|
64
64
|
sql: string,
|
|
65
65
|
schema: z.ZodSchema<T>,
|
|
66
66
|
params?: unknown[],
|
|
67
|
+
metadata?: TraceMetadata,
|
|
67
68
|
): Promise<T[]> {
|
|
68
69
|
const request = this.buildRequest(sql, params);
|
|
69
70
|
|
|
70
71
|
try {
|
|
71
|
-
const result = await this.executeQuery(request);
|
|
72
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
72
73
|
|
|
73
74
|
// Validate result structure
|
|
74
75
|
if (!Array.isArray(result)) {
|
|
@@ -118,11 +119,12 @@ export class SnowflakeClientImpl
|
|
|
118
119
|
async execute(
|
|
119
120
|
sql: string,
|
|
120
121
|
params?: unknown[],
|
|
122
|
+
metadata?: TraceMetadata,
|
|
121
123
|
): Promise<{ rowCount: number }> {
|
|
122
124
|
const request = this.buildRequest(sql, params);
|
|
123
125
|
|
|
124
126
|
try {
|
|
125
|
-
const result = await this.executeQuery(request);
|
|
127
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
126
128
|
|
|
127
129
|
// Extract row count from result
|
|
128
130
|
// Snowflake returns execution metadata in the result
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import type { z } from "zod";
|
|
8
8
|
import type { BaseIntegrationClient } from "../../types";
|
|
9
|
+
import type { TraceMetadata } from "../registry.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Client for executing Snowflake queries with type-safe validation.
|
|
@@ -60,6 +61,7 @@ export interface SnowflakeClient extends BaseIntegrationClient {
|
|
|
60
61
|
sql: string,
|
|
61
62
|
schema: z.ZodSchema<T>,
|
|
62
63
|
params?: unknown[],
|
|
64
|
+
metadata?: TraceMetadata,
|
|
63
65
|
): Promise<T[]>;
|
|
64
66
|
|
|
65
67
|
/**
|
|
@@ -78,5 +80,9 @@ export interface SnowflakeClient extends BaseIntegrationClient {
|
|
|
78
80
|
* console.log(`Updated ${result.rowCount} rows`);
|
|
79
81
|
* ```
|
|
80
82
|
*/
|
|
81
|
-
execute(
|
|
83
|
+
execute(
|
|
84
|
+
sql: string,
|
|
85
|
+
params?: unknown[],
|
|
86
|
+
metadata?: TraceMetadata,
|
|
87
|
+
): Promise<{ rowCount: number }>;
|
|
82
88
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { z } from "zod";
|
|
9
9
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
10
|
+
import type { TraceMetadata } from "../registry.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Snowflake Postgres client for SQL query and execute operations.
|
|
@@ -42,6 +43,7 @@ export interface SnowflakePostgresClient extends BaseIntegrationClient {
|
|
|
42
43
|
sql: string,
|
|
43
44
|
schema: z.ZodSchema<T>,
|
|
44
45
|
params?: unknown[],
|
|
46
|
+
metadata?: TraceMetadata,
|
|
45
47
|
): Promise<T[]>;
|
|
46
48
|
|
|
47
49
|
/**
|
|
@@ -51,5 +53,9 @@ export interface SnowflakePostgresClient extends BaseIntegrationClient {
|
|
|
51
53
|
* @param params - Optional query parameters for server-side binding
|
|
52
54
|
* @returns The affected row count
|
|
53
55
|
*/
|
|
54
|
-
execute(
|
|
56
|
+
execute(
|
|
57
|
+
sql: string,
|
|
58
|
+
params?: unknown[],
|
|
59
|
+
metadata?: TraceMetadata,
|
|
60
|
+
): Promise<{ rowCount: number }>;
|
|
55
61
|
}
|
|
@@ -4,9 +4,9 @@ Generate, edit, and upscale images using Stability AI's image generation models.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Stability AI API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | -------------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Stability AI API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -228,6 +228,10 @@ result.engines.forEach((engine) => {
|
|
|
228
228
|
});
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
+
## Trace Metadata
|
|
232
|
+
|
|
233
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
234
|
+
|
|
231
235
|
## Common Pitfalls
|
|
232
236
|
|
|
233
237
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Process payments, manage customers, and interact with Stripe's payment platform.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Stripe API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | -------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Stripe API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -295,6 +295,10 @@ await ctx.integrations.stripe.apiRequest(
|
|
|
295
295
|
);
|
|
296
296
|
```
|
|
297
297
|
|
|
298
|
+
## Trace Metadata
|
|
299
|
+
|
|
300
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
301
|
+
|
|
298
302
|
## Common Pitfalls
|
|
299
303
|
|
|
300
304
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Extract text from images using the Superblocks OCR service with full type safety
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any OCR API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ----------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any OCR API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -133,6 +133,10 @@ const result = await ctx.integrations.ocr.apiRequest(
|
|
|
133
133
|
);
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
## Trace Metadata
|
|
137
|
+
|
|
138
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
139
|
+
|
|
136
140
|
## Common Pitfalls
|
|
137
141
|
|
|
138
142
|
### Image Format
|
|
@@ -4,9 +4,9 @@ Send SMS messages, make calls, and interact with Twilio's communication APIs.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Twilio API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | -------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Twilio API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -207,6 +207,10 @@ console.log(`Message status: ${result.status}`);
|
|
|
207
207
|
// Statuses: queued, sending, sent, delivered, undelivered, failed
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
+
## Trace Metadata
|
|
211
|
+
|
|
212
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
213
|
+
|
|
210
214
|
## Common Pitfalls
|
|
211
215
|
|
|
212
216
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Create tickets, manage users, and interact with Zendesk's customer support platf
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Zendesk API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | --------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Zendesk API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -275,6 +275,10 @@ const result = await ctx.integrations.zendesk.apiRequest(
|
|
|
275
275
|
);
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
+
## Trace Metadata
|
|
279
|
+
|
|
280
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
281
|
+
|
|
278
282
|
## Common Pitfalls
|
|
279
283
|
|
|
280
284
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Create meetings, manage users, and interact with Zoom's video conferencing platf
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Zoom API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ------------------------------------------------ |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Zoom API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -301,6 +301,10 @@ const result = await ctx.integrations.zoom.apiRequest(
|
|
|
301
301
|
);
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
+
## Trace Metadata
|
|
305
|
+
|
|
306
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
307
|
+
|
|
304
308
|
## Common Pitfalls
|
|
305
309
|
|
|
306
310
|
### No Specialized Methods
|
package/src/runtime/context.ts
CHANGED
|
@@ -16,7 +16,11 @@ import type {
|
|
|
16
16
|
IntegrationClientImpl,
|
|
17
17
|
} from "../integrations/types.js";
|
|
18
18
|
import type { IntegrationDeclaration } from "../integrations/declarations.js";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
createClient,
|
|
21
|
+
type QueryExecutor,
|
|
22
|
+
type TraceMetadata,
|
|
23
|
+
} from "../integrations/registry.js";
|
|
20
24
|
import { createDefaultLogger } from "./logger.js";
|
|
21
25
|
|
|
22
26
|
/**
|
|
@@ -44,6 +48,7 @@ export interface CreateContextOptions {
|
|
|
44
48
|
integrationId: string,
|
|
45
49
|
request: Record<string, unknown>,
|
|
46
50
|
bindings?: Record<string, unknown>,
|
|
51
|
+
metadata?: TraceMetadata,
|
|
47
52
|
) => Promise<unknown>;
|
|
48
53
|
|
|
49
54
|
/** Execution ID for logging correlation */
|
|
@@ -127,7 +132,8 @@ export function createApiContext(
|
|
|
127
132
|
const boundExecutor: QueryExecutor = (
|
|
128
133
|
request: Record<string, unknown>,
|
|
129
134
|
bindings?: Record<string, unknown>,
|
|
130
|
-
|
|
135
|
+
metadata?: TraceMetadata,
|
|
136
|
+
) => executeQuery(id, request, bindings, metadata);
|
|
131
137
|
|
|
132
138
|
// Create config for client - use pre-loaded config or create synthetic one
|
|
133
139
|
const clientConfig: IntegrationConfig = config ?? {
|
package/src/runtime/execute.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { CompiledApi } from "../api/definition.js";
|
|
9
9
|
import { isStreamingApi, type CompiledStreamingApi } from "../api/streaming.js";
|
|
10
|
+
import type { TraceMetadata } from "../integrations/registry.js";
|
|
10
11
|
import type { IntegrationConfig } from "../integrations/types.js";
|
|
11
12
|
import type { ApiUser } from "../types.js";
|
|
12
13
|
import { executeApi, type ExecuteApiResponse } from "./executor.js";
|
|
@@ -48,6 +49,7 @@ export interface UnifiedExecuteApiRequest {
|
|
|
48
49
|
integrationId: string,
|
|
49
50
|
request: Record<string, unknown>,
|
|
50
51
|
bindings?: Record<string, unknown>,
|
|
52
|
+
metadata?: TraceMetadata,
|
|
51
53
|
) => Promise<unknown>;
|
|
52
54
|
|
|
53
55
|
/**
|
|
@@ -56,11 +58,13 @@ export interface UnifiedExecuteApiRequest {
|
|
|
56
58
|
*
|
|
57
59
|
* @param integrationId - The integration ID
|
|
58
60
|
* @param request - Plugin-specific request object
|
|
61
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
59
62
|
* @returns AsyncIterable yielding raw chunks
|
|
60
63
|
*/
|
|
61
64
|
executeStreamingQuery?: (
|
|
62
65
|
integrationId: string,
|
|
63
66
|
request: Record<string, unknown>,
|
|
67
|
+
metadata?: TraceMetadata,
|
|
64
68
|
) => AsyncIterable<unknown>;
|
|
65
69
|
}
|
|
66
70
|
|
package/src/runtime/executor.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { CompiledApi } from "../api/definition.js";
|
|
9
9
|
import { getIntegrationDeclarations } from "../integrations/declarations.js";
|
|
10
|
+
import type { TraceMetadata } from "../integrations/registry.js";
|
|
10
11
|
import type { IntegrationConfig } from "../integrations/types.js";
|
|
11
12
|
import type { ApiUser } from "../types.js";
|
|
12
13
|
import { createApiContext } from "./context.js";
|
|
@@ -58,6 +59,7 @@ export interface ExecuteApiRequest {
|
|
|
58
59
|
integrationId: string,
|
|
59
60
|
request: Record<string, unknown>,
|
|
60
61
|
bindings?: Record<string, unknown>,
|
|
62
|
+
metadata?: TraceMetadata,
|
|
61
63
|
) => Promise<unknown>;
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
createClient,
|
|
21
21
|
type QueryExecutor,
|
|
22
22
|
type StreamingQueryExecutor,
|
|
23
|
+
type TraceMetadata,
|
|
23
24
|
} from "../integrations/registry.js";
|
|
24
25
|
import { createDefaultLogger } from "./logger.js";
|
|
25
26
|
|
|
@@ -42,6 +43,7 @@ export interface CreateStreamingContextOptions {
|
|
|
42
43
|
integrationId: string,
|
|
43
44
|
request: Record<string, unknown>,
|
|
44
45
|
bindings?: Record<string, unknown>,
|
|
46
|
+
metadata?: TraceMetadata,
|
|
45
47
|
) => Promise<unknown>;
|
|
46
48
|
|
|
47
49
|
/**
|
|
@@ -51,6 +53,7 @@ export interface CreateStreamingContextOptions {
|
|
|
51
53
|
executeStreamingQuery?: (
|
|
52
54
|
integrationId: string,
|
|
53
55
|
request: Record<string, unknown>,
|
|
56
|
+
metadata?: TraceMetadata,
|
|
54
57
|
) => AsyncIterable<unknown>;
|
|
55
58
|
|
|
56
59
|
/** Execution ID for logging correlation */
|
|
@@ -111,13 +114,14 @@ export function createStreamingApiContext(
|
|
|
111
114
|
const boundExecutor: QueryExecutor = (
|
|
112
115
|
request: Record<string, unknown>,
|
|
113
116
|
bindings?: Record<string, unknown>,
|
|
114
|
-
|
|
117
|
+
metadata?: TraceMetadata,
|
|
118
|
+
) => executeQuery(id, request, bindings, metadata);
|
|
115
119
|
|
|
116
120
|
// Create streaming executor if provided
|
|
117
121
|
const boundStreamingExecutor: StreamingQueryExecutor | undefined =
|
|
118
122
|
executeStreamingQuery
|
|
119
|
-
? (request: Record<string, unknown
|
|
120
|
-
executeStreamingQuery(id, request)
|
|
123
|
+
? (request: Record<string, unknown>, metadata?: TraceMetadata) =>
|
|
124
|
+
executeStreamingQuery(id, request, metadata)
|
|
121
125
|
: undefined;
|
|
122
126
|
|
|
123
127
|
const clientConfig: IntegrationConfig = config ?? {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { CompiledStreamingApi } from "../api/streaming.js";
|
|
9
9
|
import { getIntegrationDeclarations } from "../integrations/declarations.js";
|
|
10
|
+
import type { TraceMetadata } from "../integrations/registry.js";
|
|
10
11
|
import type { IntegrationConfig } from "../integrations/types.js";
|
|
11
12
|
import type { ApiUser } from "../types.js";
|
|
12
13
|
import {
|
|
@@ -52,6 +53,7 @@ export interface ExecuteStreamingApiRequest {
|
|
|
52
53
|
integrationId: string,
|
|
53
54
|
request: Record<string, unknown>,
|
|
54
55
|
bindings?: Record<string, unknown>,
|
|
56
|
+
metadata?: TraceMetadata,
|
|
55
57
|
) => Promise<unknown>;
|
|
56
58
|
|
|
57
59
|
/**
|
|
@@ -59,11 +61,13 @@ export interface ExecuteStreamingApiRequest {
|
|
|
59
61
|
*
|
|
60
62
|
* @param integrationId - The integration ID
|
|
61
63
|
* @param request - Plugin-specific request object
|
|
64
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
62
65
|
* @returns AsyncIterable yielding raw chunks
|
|
63
66
|
*/
|
|
64
67
|
executeStreamingQuery?: (
|
|
65
68
|
integrationId: string,
|
|
66
69
|
request: Record<string, unknown>,
|
|
70
|
+
metadata?: TraceMetadata,
|
|
67
71
|
) => AsyncIterable<unknown>;
|
|
68
72
|
}
|
|
69
73
|
|