@superblocksteam/sdk-api 2.0.96 → 2.0.97-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
6
|
+
import type { TraceMetadata } from "../registry.js";
|
|
6
7
|
import type { z } from "zod";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -68,7 +69,10 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
68
69
|
*
|
|
69
70
|
* @param query - GraphQL query string
|
|
70
71
|
* @param schema - Zod schema for response validation (REQUIRED)
|
|
71
|
-
* @param variables - Optional variables for the query
|
|
72
|
+
* @param variables - Optional variables for the query. **Note:** since both `variables` and
|
|
73
|
+
* `metadata` accept plain objects, pass `undefined` for variables when you only need metadata:
|
|
74
|
+
* `query(q, schema, undefined, { label: "..." })`
|
|
75
|
+
* @param metadata - Optional trace metadata for observability
|
|
72
76
|
* @returns Validated query result
|
|
73
77
|
*
|
|
74
78
|
* @example
|
|
@@ -89,6 +93,7 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
89
93
|
query: string,
|
|
90
94
|
schema: { response: z.ZodSchema<TResponse> },
|
|
91
95
|
variables?: Record<string, unknown>,
|
|
96
|
+
metadata?: TraceMetadata,
|
|
92
97
|
): Promise<TResponse>;
|
|
93
98
|
|
|
94
99
|
/**
|
|
@@ -96,7 +101,10 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
96
101
|
*
|
|
97
102
|
* @param mutation - GraphQL mutation string
|
|
98
103
|
* @param schema - Zod schema for response validation (REQUIRED)
|
|
99
|
-
* @param variables - Optional variables for the mutation
|
|
104
|
+
* @param variables - Optional variables for the mutation. **Note:** since both `variables` and
|
|
105
|
+
* `metadata` accept plain objects, pass `undefined` for variables when you only need metadata:
|
|
106
|
+
* `mutation(m, schema, undefined, { label: "..." })`
|
|
107
|
+
* @param metadata - Optional trace metadata for observability
|
|
100
108
|
* @returns Validated mutation result
|
|
101
109
|
*
|
|
102
110
|
* @example
|
|
@@ -118,5 +126,6 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
118
126
|
mutation: string,
|
|
119
127
|
schema: { response: z.ZodSchema<TResponse> },
|
|
120
128
|
variables?: Record<string, unknown>,
|
|
129
|
+
metadata?: TraceMetadata,
|
|
121
130
|
): Promise<TResponse>;
|
|
122
131
|
}
|
|
@@ -4,9 +4,9 @@ Interact with Groq's ultra-fast inference API for LLM chat completions with low
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Groq API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ------------------------------------------------ |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Groq API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -219,6 +219,10 @@ const result = await ctx.integrations.groq.apiRequest(
|
|
|
219
219
|
const data = JSON.parse(result.choices[0]?.message.content ?? "{}");
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
+
## Trace Metadata
|
|
223
|
+
|
|
224
|
+
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.
|
|
225
|
+
|
|
222
226
|
## Common Pitfalls
|
|
223
227
|
|
|
224
228
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Interact with Google Sheets with full type safety and runtime validation.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `run(action, schema, params)` | Execute a Google Sheets operation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | --------------------------------- |
|
|
9
|
+
| `run(action, schema, params, metadata?)` | Execute a Google Sheets operation |
|
|
10
10
|
|
|
11
11
|
## Actions
|
|
12
12
|
|
|
@@ -129,6 +129,10 @@ await ctx.integrations.sheets.run("CREATE_WORKSHEET", z.any(), {
|
|
|
129
129
|
| `rowNumber` | `string` | Row number for single row operations |
|
|
130
130
|
| `addSheet` | `object` | Config for CREATE_WORKSHEET action |
|
|
131
131
|
|
|
132
|
+
## Trace Metadata
|
|
133
|
+
|
|
134
|
+
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.
|
|
135
|
+
|
|
132
136
|
## Common Pitfalls
|
|
133
137
|
|
|
134
138
|
### Use extractFirstRowHeader for Objects
|
|
@@ -8,7 +8,7 @@ import type { z } from "zod";
|
|
|
8
8
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
9
9
|
import type { Plugin as GSheetsPlugin } from "@superblocksteam/types/dist/src/plugins/gsheets/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 { RestApiValidationError } from "../../errors.js";
|
|
13
13
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
14
14
|
import type {
|
|
@@ -96,12 +96,15 @@ export class GoogleSheetsClientImpl
|
|
|
96
96
|
action: GoogleSheetsAction,
|
|
97
97
|
schema: z.ZodSchema<T>,
|
|
98
98
|
params: GoogleSheetsParams,
|
|
99
|
+
metadata?: TraceMetadata,
|
|
99
100
|
): Promise<T> {
|
|
100
101
|
const request = this.buildRequest(action, params);
|
|
101
102
|
|
|
102
103
|
try {
|
|
103
104
|
const result = await this.executeQuery(
|
|
104
105
|
request as Record<string, unknown>,
|
|
106
|
+
undefined,
|
|
107
|
+
metadata,
|
|
105
108
|
);
|
|
106
109
|
|
|
107
110
|
// Validate result against schema
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type { z } from "zod";
|
|
6
6
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
7
|
+
import type { TraceMetadata } from "../registry.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Google Sheets action types.
|
|
@@ -96,5 +97,6 @@ export interface GoogleSheetsClient extends BaseIntegrationClient {
|
|
|
96
97
|
action: GoogleSheetsAction,
|
|
97
98
|
schema: z.ZodSchema<T>,
|
|
98
99
|
params: GoogleSheetsParams,
|
|
100
|
+
metadata?: TraceMetadata,
|
|
99
101
|
): Promise<T>;
|
|
100
102
|
}
|
|
@@ -4,9 +4,9 @@ Manage contacts, deals, companies, and interact with HubSpot's CRM platform.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any HubSpot API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | --------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any HubSpot API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -281,6 +281,10 @@ const engagements = await ctx.integrations.hubspot.apiRequest(
|
|
|
281
281
|
);
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
+
## Trace Metadata
|
|
285
|
+
|
|
286
|
+
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.
|
|
287
|
+
|
|
284
288
|
## Common Pitfalls
|
|
285
289
|
|
|
286
290
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Manage customer conversations, contacts, and support workflows with Intercom.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Intercom API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ---------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Intercom API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -239,6 +239,10 @@ const result = await ctx.integrations.intercom.apiRequest(
|
|
|
239
239
|
);
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
+
## Trace Metadata
|
|
243
|
+
|
|
244
|
+
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.
|
|
245
|
+
|
|
242
246
|
## Common Pitfalls
|
|
243
247
|
|
|
244
248
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Create issues, search projects, and manage work in Jira.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Jira API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ------------------------------------------------ |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Jira API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -285,6 +285,10 @@ const result = await ctx.integrations.jira.apiRequest(
|
|
|
285
285
|
);
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
+
## Trace Metadata
|
|
289
|
+
|
|
290
|
+
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.
|
|
291
|
+
|
|
288
292
|
## Common Pitfalls
|
|
289
293
|
|
|
290
294
|
### No Specialized Methods
|
|
@@ -4,10 +4,10 @@ Interact with Apache Kafka with full type safety and runtime validation.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `consume(schema, params)` | Consume messages from a Kafka topic |
|
|
10
|
-
| `produce(schema, params)` | Produce messages to Kafka topics |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ------------------------------------ | ----------------------------------- |
|
|
9
|
+
| `consume(schema, params, metadata?)` | Consume messages from a Kafka topic |
|
|
10
|
+
| `produce(schema, params, metadata?)` | Produce messages to Kafka topics |
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -112,6 +112,10 @@ const result = await ctx.integrations.kafka.produce(ProduceResultSchema, {
|
|
|
112
112
|
| `clientId` | `string` | Client ID |
|
|
113
113
|
| `timeout` | `number` | Timeout in milliseconds |
|
|
114
114
|
|
|
115
|
+
## Trace Metadata
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
115
119
|
## Error Handling
|
|
116
120
|
|
|
117
121
|
```typescript
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import type { z } from "zod";
|
|
8
8
|
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
9
|
-
import type { QueryExecutor } from "../registry.js";
|
|
9
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
10
10
|
import { RestApiValidationError } from "../../errors.js";
|
|
11
11
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
12
12
|
import type {
|
|
@@ -161,10 +161,13 @@ export class KafkaClientImpl implements KafkaClient, IntegrationClientImpl {
|
|
|
161
161
|
request: KafkaRequest,
|
|
162
162
|
schema: z.ZodSchema<T>,
|
|
163
163
|
operation: string,
|
|
164
|
+
metadata?: TraceMetadata,
|
|
164
165
|
): Promise<T> {
|
|
165
166
|
try {
|
|
166
167
|
const result = await this.executeQuery(
|
|
167
168
|
request as unknown as Record<string, unknown>,
|
|
169
|
+
undefined,
|
|
170
|
+
metadata,
|
|
168
171
|
);
|
|
169
172
|
|
|
170
173
|
const parseResult = schema.safeParse(result);
|
|
@@ -195,16 +198,18 @@ export class KafkaClientImpl implements KafkaClient, IntegrationClientImpl {
|
|
|
195
198
|
async consume<T>(
|
|
196
199
|
schema: z.ZodSchema<T>,
|
|
197
200
|
params: KafkaConsumeParams,
|
|
201
|
+
metadata?: TraceMetadata,
|
|
198
202
|
): Promise<T> {
|
|
199
203
|
const request = this.buildConsumeRequest(params);
|
|
200
|
-
return this.executeAndValidate(request, schema, "consume");
|
|
204
|
+
return this.executeAndValidate(request, schema, "consume", metadata);
|
|
201
205
|
}
|
|
202
206
|
|
|
203
207
|
async produce<T>(
|
|
204
208
|
schema: z.ZodSchema<T>,
|
|
205
209
|
params: KafkaProduceParams,
|
|
210
|
+
metadata?: TraceMetadata,
|
|
206
211
|
): Promise<T> {
|
|
207
212
|
const request = this.buildProduceRequest(params);
|
|
208
|
-
return this.executeAndValidate(request, schema, "produce");
|
|
213
|
+
return this.executeAndValidate(request, schema, "produce", metadata);
|
|
209
214
|
}
|
|
210
215
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type { z } from "zod";
|
|
6
6
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
7
|
+
import type { TraceMetadata } from "../registry.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Kafka operation types.
|
|
@@ -104,14 +105,23 @@ export interface KafkaClient extends BaseIntegrationClient {
|
|
|
104
105
|
* @param params - Consume parameters
|
|
105
106
|
* @returns The validated result
|
|
106
107
|
*/
|
|
107
|
-
consume<T>(
|
|
108
|
+
consume<T>(
|
|
109
|
+
schema: z.ZodSchema<T>,
|
|
110
|
+
params: KafkaConsumeParams,
|
|
111
|
+
metadata?: TraceMetadata,
|
|
112
|
+
): Promise<T>;
|
|
108
113
|
|
|
109
114
|
/**
|
|
110
115
|
* Produce messages to Kafka.
|
|
111
116
|
*
|
|
112
117
|
* @param schema - Zod schema for validating the result
|
|
113
118
|
* @param params - Produce parameters
|
|
119
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
114
120
|
* @returns The validated result
|
|
115
121
|
*/
|
|
116
|
-
produce<T>(
|
|
122
|
+
produce<T>(
|
|
123
|
+
schema: z.ZodSchema<T>,
|
|
124
|
+
params: KafkaProduceParams,
|
|
125
|
+
metadata?: TraceMetadata,
|
|
126
|
+
): Promise<T>;
|
|
117
127
|
}
|
|
@@ -4,10 +4,10 @@ Write records to and read records from Amazon Kinesis Data Streams.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `putRecord(params)` | Write a single record to a Kinesis stream |
|
|
10
|
-
| `getRecords(params)` | Read records from a Kinesis stream shard |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ------------------------------- | ----------------------------------------- |
|
|
9
|
+
| `putRecord(params, metadata?)` | Write a single record to a Kinesis stream |
|
|
10
|
+
| `getRecords(params, metadata?)` | Read records from a Kinesis stream shard |
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -124,6 +124,10 @@ const records = await kinesis.getRecords({
|
|
|
124
124
|
| `TRIM_HORIZON` | Start at the oldest record in the shard |
|
|
125
125
|
| `LATEST` | Start at the most recent record |
|
|
126
126
|
|
|
127
|
+
## Trace Metadata
|
|
128
|
+
|
|
129
|
+
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.
|
|
130
|
+
|
|
127
131
|
## Error Handling
|
|
128
132
|
|
|
129
133
|
```typescript
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
9
|
-
import type { QueryExecutor } from "../registry.js";
|
|
9
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
10
10
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
11
11
|
import type {
|
|
12
12
|
KinesisClient,
|
|
@@ -53,9 +53,10 @@ export class KinesisClientImpl implements KinesisClient, IntegrationClientImpl {
|
|
|
53
53
|
private async exec(
|
|
54
54
|
request: Record<string, unknown>,
|
|
55
55
|
operation: string,
|
|
56
|
+
metadata?: TraceMetadata,
|
|
56
57
|
): Promise<unknown> {
|
|
57
58
|
try {
|
|
58
|
-
return await this.executeQuery(request);
|
|
59
|
+
return await this.executeQuery(request, undefined, metadata);
|
|
59
60
|
} catch (error) {
|
|
60
61
|
if (error instanceof IntegrationError) {
|
|
61
62
|
throw error;
|
|
@@ -65,7 +66,10 @@ export class KinesisClientImpl implements KinesisClient, IntegrationClientImpl {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
async putRecord(
|
|
69
|
+
async putRecord(
|
|
70
|
+
params: KinesisPutParams,
|
|
71
|
+
metadata?: TraceMetadata,
|
|
72
|
+
): Promise<unknown> {
|
|
69
73
|
const put: Record<string, unknown> = {
|
|
70
74
|
data: params.data,
|
|
71
75
|
partitionKey: params.partitionKey,
|
|
@@ -89,10 +93,14 @@ export class KinesisClientImpl implements KinesisClient, IntegrationClientImpl {
|
|
|
89
93
|
put,
|
|
90
94
|
},
|
|
91
95
|
"putRecord",
|
|
96
|
+
metadata,
|
|
92
97
|
);
|
|
93
98
|
}
|
|
94
99
|
|
|
95
|
-
async getRecords(
|
|
100
|
+
async getRecords(
|
|
101
|
+
params: KinesisGetParams,
|
|
102
|
+
metadata?: TraceMetadata,
|
|
103
|
+
): Promise<unknown> {
|
|
96
104
|
const get: Record<string, unknown> = {
|
|
97
105
|
shardId: params.shardId,
|
|
98
106
|
shardIteratorType: params.shardIteratorType,
|
|
@@ -132,6 +140,7 @@ export class KinesisClientImpl implements KinesisClient, IntegrationClientImpl {
|
|
|
132
140
|
get,
|
|
133
141
|
},
|
|
134
142
|
"getRecords",
|
|
143
|
+
metadata,
|
|
135
144
|
);
|
|
136
145
|
}
|
|
137
146
|
}
|
|
@@ -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
|
* Stream identifier type for Kinesis operations.
|
|
@@ -94,13 +95,20 @@ export interface KinesisClient extends BaseIntegrationClient {
|
|
|
94
95
|
* @param params - PUT operation parameters
|
|
95
96
|
* @returns The raw result from Kinesis (includes ShardId and SequenceNumber)
|
|
96
97
|
*/
|
|
97
|
-
putRecord(
|
|
98
|
+
putRecord(
|
|
99
|
+
params: KinesisPutParams,
|
|
100
|
+
metadata?: TraceMetadata,
|
|
101
|
+
): Promise<unknown>;
|
|
98
102
|
|
|
99
103
|
/**
|
|
100
104
|
* Get records from a Kinesis stream shard.
|
|
101
105
|
*
|
|
102
106
|
* @param params - GET operation parameters
|
|
107
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
103
108
|
* @returns The raw result from Kinesis (includes Records array)
|
|
104
109
|
*/
|
|
105
|
-
getRecords(
|
|
110
|
+
getRecords(
|
|
111
|
+
params: KinesisGetParams,
|
|
112
|
+
metadata?: TraceMetadata,
|
|
113
|
+
): Promise<unknown>;
|
|
106
114
|
}
|
|
@@ -9,7 +9,7 @@ import type { z } from "zod";
|
|
|
9
9
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
10
10
|
import type { Plugin as LakebasePlugin } from "@superblocksteam/types/dist/src/plugins/lakebase/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 type { LakebaseClient } from "./types.js";
|
|
14
14
|
import { QueryValidationError } from "../../errors.js";
|
|
15
15
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
@@ -62,12 +62,15 @@ export class LakebaseClientImpl
|
|
|
62
62
|
sql: string,
|
|
63
63
|
schema: z.ZodSchema<T>,
|
|
64
64
|
params?: unknown[],
|
|
65
|
+
metadata?: TraceMetadata,
|
|
65
66
|
): Promise<T[]> {
|
|
66
67
|
const request = this.buildRequest(sql, params);
|
|
67
68
|
|
|
68
69
|
try {
|
|
69
70
|
const result = await this.executeQuery(
|
|
70
71
|
request as Record<string, unknown>,
|
|
72
|
+
undefined,
|
|
73
|
+
metadata,
|
|
71
74
|
);
|
|
72
75
|
|
|
73
76
|
if (!Array.isArray(result)) {
|
|
@@ -113,12 +116,15 @@ export class LakebaseClientImpl
|
|
|
113
116
|
async execute(
|
|
114
117
|
sql: string,
|
|
115
118
|
params?: unknown[],
|
|
119
|
+
metadata?: TraceMetadata,
|
|
116
120
|
): Promise<{ rowCount: number }> {
|
|
117
121
|
const request = this.buildRequest(sql, params);
|
|
118
122
|
|
|
119
123
|
try {
|
|
120
124
|
const result = await this.executeQuery(
|
|
121
125
|
request as Record<string, unknown>,
|
|
126
|
+
undefined,
|
|
127
|
+
metadata,
|
|
122
128
|
);
|
|
123
129
|
|
|
124
130
|
if (
|
|
@@ -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
|
* Lakebase client for SQL query and execute operations.
|
|
@@ -42,6 +43,7 @@ export interface LakebaseClient 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 LakebaseClient 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 @@ Manage feature flags, get flag evaluations, and interact with LaunchDarkly's fea
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any LaunchDarkly API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | -------------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any LaunchDarkly API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -296,6 +296,10 @@ const result = await ctx.integrations.launchdarkly.apiRequest(
|
|
|
296
296
|
);
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
+
## Trace Metadata
|
|
300
|
+
|
|
301
|
+
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.
|
|
302
|
+
|
|
299
303
|
## Common Pitfalls
|
|
300
304
|
|
|
301
305
|
### No Specialized Methods
|
|
@@ -4,10 +4,10 @@ Execute SQL queries and statements against MariaDB databases with full type safe
|
|
|
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
|
|
|
@@ -72,6 +72,10 @@ const deleteResult = await ctx.integrations.mariadb.execute(
|
|
|
72
72
|
console.log(`Deleted ${deleteResult.rowCount} expired sessions`);
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
## Trace Metadata
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
75
79
|
## Common Pitfalls
|
|
76
80
|
|
|
77
81
|
### BIGINT Values Returned as Strings
|
|
@@ -9,7 +9,7 @@ import type { z } from "zod";
|
|
|
9
9
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
10
10
|
import type { Plugin as MariaDBPlugin } from "@superblocksteam/types/dist/src/plugins/mariadb/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";
|
|
@@ -62,11 +62,12 @@ export class MariaDBClientImpl implements MariaDBClient, IntegrationClientImpl {
|
|
|
62
62
|
sql: string,
|
|
63
63
|
schema: z.ZodSchema<T>,
|
|
64
64
|
params?: unknown[],
|
|
65
|
+
metadata?: TraceMetadata,
|
|
65
66
|
): Promise<T[]> {
|
|
66
67
|
const request = this.buildRequest(sql, params);
|
|
67
68
|
|
|
68
69
|
try {
|
|
69
|
-
const result = await this.executeQuery(request);
|
|
70
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
70
71
|
|
|
71
72
|
if (!Array.isArray(result)) {
|
|
72
73
|
throw new IntegrationError(
|
|
@@ -114,11 +115,12 @@ export class MariaDBClientImpl implements MariaDBClient, IntegrationClientImpl {
|
|
|
114
115
|
async execute(
|
|
115
116
|
sql: string,
|
|
116
117
|
params?: unknown[],
|
|
118
|
+
metadata?: TraceMetadata,
|
|
117
119
|
): Promise<{ rowCount: number }> {
|
|
118
120
|
const request = this.buildRequest(sql, params);
|
|
119
121
|
|
|
120
122
|
try {
|
|
121
|
-
const result = await this.executeQuery(request);
|
|
123
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
122
124
|
|
|
123
125
|
if (
|
|
124
126
|
typeof result === "object" &&
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import type { z } from "zod";
|
|
8
8
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
9
|
+
import type { TraceMetadata } from "../registry.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Client for executing MariaDB queries with type-safe validation.
|
|
@@ -45,6 +46,7 @@ export interface MariaDBClient extends BaseIntegrationClient {
|
|
|
45
46
|
sql: string,
|
|
46
47
|
schema: z.ZodSchema<T>,
|
|
47
48
|
params?: unknown[],
|
|
49
|
+
metadata?: TraceMetadata,
|
|
48
50
|
): Promise<T[]>;
|
|
49
51
|
|
|
50
52
|
/**
|
|
@@ -54,5 +56,9 @@ export interface MariaDBClient extends BaseIntegrationClient {
|
|
|
54
56
|
* @param params - Optional parameters for prepared statements
|
|
55
57
|
* @returns Promise resolving to execution result with row count
|
|
56
58
|
*/
|
|
57
|
-
execute(
|
|
59
|
+
execute(
|
|
60
|
+
sql: string,
|
|
61
|
+
params?: unknown[],
|
|
62
|
+
metadata?: TraceMetadata,
|
|
63
|
+
): Promise<{ rowCount: number }>;
|
|
58
64
|
}
|
|
@@ -4,9 +4,9 @@ Interact with Mistral AI's APIs for chat completions, embeddings, and code gener
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Mistral API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | --------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Mistral API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -245,6 +245,10 @@ const result = await ctx.integrations.mistral.apiRequest(
|
|
|
245
245
|
const data = JSON.parse(result.choices[0]?.message.content ?? "{}");
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
+
## Trace Metadata
|
|
249
|
+
|
|
250
|
+
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.
|
|
251
|
+
|
|
248
252
|
## Common Pitfalls
|
|
249
253
|
|
|
250
254
|
### No Specialized Methods
|