@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
|
@@ -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 { z } from "zod";
|
|
11
11
|
import { RestApiValidationError } from "../../errors.js";
|
|
12
12
|
|
|
@@ -38,14 +38,16 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
38
38
|
* @param query - GraphQL query string
|
|
39
39
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
40
40
|
* @param variables - Optional variables for the query
|
|
41
|
+
* @param metadata - Optional trace metadata for observability
|
|
41
42
|
* @returns Validated query result
|
|
42
43
|
*/
|
|
43
44
|
async query<TResponse>(
|
|
44
45
|
query: string,
|
|
45
46
|
schema: { response: z.ZodSchema<TResponse> },
|
|
46
47
|
variables?: Record<string, unknown>,
|
|
48
|
+
metadata?: TraceMetadata,
|
|
47
49
|
): Promise<TResponse> {
|
|
48
|
-
return this.executeGraphQL(query, schema, variables);
|
|
50
|
+
return this.executeGraphQL(query, schema, variables, metadata);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/**
|
|
@@ -54,14 +56,16 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
54
56
|
* @param mutation - GraphQL mutation string
|
|
55
57
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
56
58
|
* @param variables - Optional variables for the mutation
|
|
59
|
+
* @param metadata - Optional trace metadata for observability
|
|
57
60
|
* @returns Validated mutation result
|
|
58
61
|
*/
|
|
59
62
|
async mutation<TResponse>(
|
|
60
63
|
mutation: string,
|
|
61
64
|
schema: { response: z.ZodSchema<TResponse> },
|
|
62
65
|
variables?: Record<string, unknown>,
|
|
66
|
+
metadata?: TraceMetadata,
|
|
63
67
|
): Promise<TResponse> {
|
|
64
|
-
return this.executeGraphQL(mutation, schema, variables);
|
|
68
|
+
return this.executeGraphQL(mutation, schema, variables, metadata);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
/**
|
|
@@ -74,6 +78,7 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
74
78
|
queryString: string,
|
|
75
79
|
schema: { response: z.ZodSchema<TResponse> },
|
|
76
80
|
variables?: Record<string, unknown>,
|
|
81
|
+
metadata?: TraceMetadata,
|
|
77
82
|
): Promise<TResponse> {
|
|
78
83
|
// Build graphql.v1.Plugin proto message
|
|
79
84
|
const request = {
|
|
@@ -91,7 +96,7 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
91
96
|
};
|
|
92
97
|
|
|
93
98
|
// Execute query through orchestrator
|
|
94
|
-
const response = await this.executeQuery(request);
|
|
99
|
+
const response = await this.executeQuery(request, undefined, metadata);
|
|
95
100
|
|
|
96
101
|
// Return full GraphQL response without unwrapping
|
|
97
102
|
// Users should access result.data themselves
|
|
@@ -8,7 +8,11 @@ import type { PartialMessage } from "@bufbuild/protobuf";
|
|
|
8
8
|
import type { Plugin as RestApiIntegrationPlugin } from "@superblocksteam/types/dist/src/plugins/restapiintegration/v1/plugin_pb";
|
|
9
9
|
import type { Property } from "@superblocksteam/types/dist/src/common/v1/plugin_pb";
|
|
10
10
|
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
QueryExecutor,
|
|
13
|
+
StreamingQueryExecutor,
|
|
14
|
+
TraceMetadata,
|
|
15
|
+
} from "../registry.js";
|
|
12
16
|
import type {
|
|
13
17
|
ApiRequestOptions,
|
|
14
18
|
ApiRequestSchema,
|
|
@@ -71,6 +75,7 @@ export abstract class RestApiIntegrationClient
|
|
|
71
75
|
schema: ApiRequestSchema<TBody, TResponse> & {
|
|
72
76
|
response: z.ZodSchema<TResponse>;
|
|
73
77
|
},
|
|
78
|
+
metadata?: TraceMetadata,
|
|
74
79
|
): Promise<TResponse> {
|
|
75
80
|
// Validate that body schema is provided if body is present
|
|
76
81
|
if (options.body !== undefined) {
|
|
@@ -139,7 +144,11 @@ export abstract class RestApiIntegrationClient
|
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
// Execute the request
|
|
142
|
-
const result = await this.executeQuery(
|
|
147
|
+
const result = await this.executeQuery(
|
|
148
|
+
request as Record<string, unknown>,
|
|
149
|
+
undefined,
|
|
150
|
+
metadata,
|
|
151
|
+
);
|
|
143
152
|
|
|
144
153
|
// Response schema is REQUIRED - always validate
|
|
145
154
|
const responseParseResult = schema.response.safeParse(result);
|
|
@@ -165,6 +174,7 @@ export abstract class RestApiIntegrationClient
|
|
|
165
174
|
*
|
|
166
175
|
* @param options - Request configuration including method, path, params, and body
|
|
167
176
|
* @param schema - Zod schemas for request body and chunk validation
|
|
177
|
+
* @param metadata - Optional trace metadata for observability (label, description)
|
|
168
178
|
* @returns AsyncIterable yielding validated chunks
|
|
169
179
|
*
|
|
170
180
|
* @example
|
|
@@ -188,7 +198,8 @@ export abstract class RestApiIntegrationClient
|
|
|
188
198
|
* messages: [{ role: 'user', content: 'Hello!' }],
|
|
189
199
|
* },
|
|
190
200
|
* },
|
|
191
|
-
* { chunk: ChunkSchema }
|
|
201
|
+
* { chunk: ChunkSchema },
|
|
202
|
+
* { label: 'openai.chatCompletions', description: 'Stream chat completion' }
|
|
192
203
|
* );
|
|
193
204
|
*
|
|
194
205
|
* for await (const chunk of stream) {
|
|
@@ -199,6 +210,7 @@ export abstract class RestApiIntegrationClient
|
|
|
199
210
|
async *streamApiRequest<TBody, TChunk>(
|
|
200
211
|
options: ApiRequestOptions<TBody>,
|
|
201
212
|
schema: StreamApiRequestSchema<TBody, TChunk>,
|
|
213
|
+
metadata?: TraceMetadata,
|
|
202
214
|
): AsyncIterable<TChunk> {
|
|
203
215
|
// Validate that streaming is supported
|
|
204
216
|
if (!this.executeStreamingQuery) {
|
|
@@ -278,6 +290,7 @@ export abstract class RestApiIntegrationClient
|
|
|
278
290
|
// Execute the streaming request
|
|
279
291
|
const stream = this.executeStreamingQuery(
|
|
280
292
|
request as Record<string, unknown>,
|
|
293
|
+
metadata,
|
|
281
294
|
);
|
|
282
295
|
|
|
283
296
|
// Validate and yield each chunk
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { z } from "zod";
|
|
6
|
+
import type { TraceMetadata } from "../registry.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Options for making a generic REST API request.
|
|
@@ -63,6 +64,7 @@ export interface SupportsApiRequest {
|
|
|
63
64
|
*
|
|
64
65
|
* @param options - Request configuration including method, path, params, and body
|
|
65
66
|
* @param schema - Zod schemas for request body and response validation (response schema REQUIRED)
|
|
67
|
+
* @param metadata - Optional trace metadata for observability (label, description)
|
|
66
68
|
* @returns Validated response data
|
|
67
69
|
*
|
|
68
70
|
* @example
|
|
@@ -84,7 +86,8 @@ export interface SupportsApiRequest {
|
|
|
84
86
|
* text: z.string(),
|
|
85
87
|
* }),
|
|
86
88
|
* response: ResponseSchema,
|
|
87
|
-
* }
|
|
89
|
+
* },
|
|
90
|
+
* { label: 'slack.postMessage', description: 'Post a message to #alerts' }
|
|
88
91
|
* );
|
|
89
92
|
* // result is typed as { ts: string; channel: string }
|
|
90
93
|
* ```
|
|
@@ -94,6 +97,7 @@ export interface SupportsApiRequest {
|
|
|
94
97
|
schema: ApiRequestSchema<TBody, TResponse> & {
|
|
95
98
|
response: z.ZodSchema<TResponse>;
|
|
96
99
|
},
|
|
100
|
+
metadata?: TraceMetadata,
|
|
97
101
|
): Promise<TResponse>;
|
|
98
102
|
}
|
|
99
103
|
|
|
@@ -131,6 +135,7 @@ export interface SupportsStreamingApiRequest {
|
|
|
131
135
|
*
|
|
132
136
|
* @param options - Request configuration including method, path, params, and body
|
|
133
137
|
* @param schema - Zod schemas for request body and chunk validation (chunk schema REQUIRED)
|
|
138
|
+
* @param metadata - Optional trace metadata for observability (label, description)
|
|
134
139
|
* @returns AsyncIterable yielding validated chunks
|
|
135
140
|
*
|
|
136
141
|
* @example
|
|
@@ -154,7 +159,8 @@ export interface SupportsStreamingApiRequest {
|
|
|
154
159
|
* messages: [{ role: 'user', content: 'Hello!' }],
|
|
155
160
|
* },
|
|
156
161
|
* },
|
|
157
|
-
* { chunk: ChunkSchema }
|
|
162
|
+
* { chunk: ChunkSchema },
|
|
163
|
+
* { label: 'openai.chatCompletions', description: 'Stream chat completion' }
|
|
158
164
|
* );
|
|
159
165
|
*
|
|
160
166
|
* for await (const chunk of stream) {
|
|
@@ -165,5 +171,6 @@ export interface SupportsStreamingApiRequest {
|
|
|
165
171
|
streamApiRequest<TBody, TChunk>(
|
|
166
172
|
options: ApiRequestOptions<TBody>,
|
|
167
173
|
schema: StreamApiRequestSchema<TBody, TChunk>,
|
|
174
|
+
metadata?: TraceMetadata,
|
|
168
175
|
): AsyncIterable<TChunk>;
|
|
169
176
|
}
|
|
@@ -4,10 +4,10 @@ Execute SQL queries against Google BigQuery with full type safety and runtime va
|
|
|
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 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 and return affected row count |
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -110,6 +110,10 @@ const activity = await ctx.integrations.bigquery.query(
|
|
|
110
110
|
);
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
+
## Trace Metadata
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
113
117
|
## Common Pitfalls
|
|
114
118
|
|
|
115
119
|
### Backtick Table References
|
|
@@ -9,7 +9,7 @@ import type { z } from "zod";
|
|
|
9
9
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
10
10
|
import type { Plugin as BigQueryPlugin } from "@superblocksteam/types/dist/src/plugins/bigquery/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 BigQueryClientImpl
|
|
|
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
|
if (!Array.isArray(result)) {
|
|
74
75
|
throw new IntegrationError(
|
|
@@ -116,11 +117,12 @@ export class BigQueryClientImpl
|
|
|
116
117
|
async execute(
|
|
117
118
|
sql: string,
|
|
118
119
|
params?: unknown[],
|
|
120
|
+
metadata?: TraceMetadata,
|
|
119
121
|
): Promise<{ rowCount: number }> {
|
|
120
122
|
const request = this.buildRequest(sql, params);
|
|
121
123
|
|
|
122
124
|
try {
|
|
123
|
-
const result = await this.executeQuery(request);
|
|
125
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
124
126
|
|
|
125
127
|
if (
|
|
126
128
|
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 BigQuery queries with type-safe validation.
|
|
@@ -45,6 +46,7 @@ export interface BigQueryClient 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 BigQueryClient 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 @@ Manage repositories, pull requests, and interact with Bitbucket's APIs.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Bitbucket API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ----------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Bitbucket API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -285,6 +285,10 @@ const comment = await ctx.integrations.bitbucket.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,9 +4,9 @@ Upload, download, and manage files in Box.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Box API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ----------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Box API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -385,6 +385,10 @@ const comment = await ctx.integrations.box.apiRequest(
|
|
|
385
385
|
);
|
|
386
386
|
```
|
|
387
387
|
|
|
388
|
+
## Trace Metadata
|
|
389
|
+
|
|
390
|
+
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.
|
|
391
|
+
|
|
388
392
|
## Common Pitfalls
|
|
389
393
|
|
|
390
394
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Trigger pipelines, manage jobs, and interact with CircleCI's CI/CD platform.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any CircleCI API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ---------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any CircleCI API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -280,6 +280,10 @@ result.items.forEach((artifact) => {
|
|
|
280
280
|
});
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
+
## Trace Metadata
|
|
284
|
+
|
|
285
|
+
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.
|
|
286
|
+
|
|
283
287
|
## Common Pitfalls
|
|
284
288
|
|
|
285
289
|
### No Specialized Methods
|
|
@@ -4,10 +4,10 @@ Execute SQL queries and statements against CockroachDB databases with full type
|
|
|
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
|
|
|
@@ -84,6 +84,10 @@ const items = await ctx.integrations.db.query(
|
|
|
84
84
|
);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
## Trace Metadata
|
|
88
|
+
|
|
89
|
+
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.
|
|
90
|
+
|
|
87
91
|
## Common Pitfalls
|
|
88
92
|
|
|
89
93
|
### UUID Primary Keys
|
|
@@ -9,7 +9,7 @@ import type { z } from "zod";
|
|
|
9
9
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
10
10
|
import type { Plugin as CockroachDBPlugin } from "@superblocksteam/types/dist/src/plugins/cockroachdb/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 CockroachDBClientImpl
|
|
|
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
|
if (!Array.isArray(result)) {
|
|
74
75
|
throw new IntegrationError(
|
|
@@ -116,11 +117,12 @@ export class CockroachDBClientImpl
|
|
|
116
117
|
async execute(
|
|
117
118
|
sql: string,
|
|
118
119
|
params?: unknown[],
|
|
120
|
+
metadata?: TraceMetadata,
|
|
119
121
|
): Promise<{ rowCount: number }> {
|
|
120
122
|
const request = this.buildRequest(sql, params);
|
|
121
123
|
|
|
122
124
|
try {
|
|
123
|
-
const result = await this.executeQuery(request);
|
|
125
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
124
126
|
|
|
125
127
|
if (
|
|
126
128
|
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 CockroachDB queries with type-safe validation.
|
|
@@ -45,6 +46,7 @@ export interface CockroachDBClient 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 CockroachDBClient 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 Cohere's APIs for text generation, embeddings, classification, and
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Cohere API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | -------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Cohere API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -205,6 +205,10 @@ const result = await ctx.integrations.cohere.apiRequest(
|
|
|
205
205
|
);
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
+
## Trace Metadata
|
|
209
|
+
|
|
210
|
+
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.
|
|
211
|
+
|
|
208
212
|
## Common Pitfalls
|
|
209
213
|
|
|
210
214
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Create pages, manage content, and search in Confluence spaces.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Confluence API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ------------------------------------------------------ |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Confluence API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -292,6 +292,10 @@ const result = await ctx.integrations.confluence.apiRequest(
|
|
|
292
292
|
);
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
+
## Trace Metadata
|
|
296
|
+
|
|
297
|
+
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.
|
|
298
|
+
|
|
295
299
|
## Common Pitfalls
|
|
296
300
|
|
|
297
301
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Interact with Azure CosmosDB with full type safety and runtime validation.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any CosmosDB API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ---------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any CosmosDB API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -158,6 +158,10 @@ await ctx.integrations.cosmosdb.apiRequest(
|
|
|
158
158
|
);
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
+
## Trace Metadata
|
|
162
|
+
|
|
163
|
+
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.
|
|
164
|
+
|
|
161
165
|
## Common Pitfalls
|
|
162
166
|
|
|
163
167
|
### Partition Key Header
|
|
@@ -10,7 +10,7 @@ import type { z } from "zod";
|
|
|
10
10
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
11
11
|
import type { Plugin as CosmosDBPlugin } from "@superblocksteam/types/dist/src/plugins/cosmosdb/v1/plugin_pb";
|
|
12
12
|
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
13
|
-
import type { QueryExecutor } from "../registry.js";
|
|
13
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
14
14
|
import { RestApiValidationError } from "../../errors.js";
|
|
15
15
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
16
16
|
import type { CosmosDBClient, CosmosDBQueryOptions } from "./types.js";
|
|
@@ -51,9 +51,14 @@ export class CosmosDBClientImpl
|
|
|
51
51
|
private async exec(
|
|
52
52
|
request: CosmosDBRequest,
|
|
53
53
|
operation: string,
|
|
54
|
+
metadata?: TraceMetadata,
|
|
54
55
|
): Promise<unknown> {
|
|
55
56
|
try {
|
|
56
|
-
return await this.executeQuery(
|
|
57
|
+
return await this.executeQuery(
|
|
58
|
+
request as Record<string, unknown>,
|
|
59
|
+
undefined,
|
|
60
|
+
metadata,
|
|
61
|
+
);
|
|
57
62
|
} catch (error) {
|
|
58
63
|
if (
|
|
59
64
|
error instanceof RestApiValidationError ||
|
|
@@ -90,6 +95,7 @@ export class CosmosDBClientImpl
|
|
|
90
95
|
sql: string,
|
|
91
96
|
schema: z.ZodSchema<T>,
|
|
92
97
|
options?: CosmosDBQueryOptions,
|
|
98
|
+
metadata?: TraceMetadata,
|
|
93
99
|
): Promise<T> {
|
|
94
100
|
const request: CosmosDBRequest = {
|
|
95
101
|
cosmosdbAction: {
|
|
@@ -108,7 +114,7 @@ export class CosmosDBClientImpl
|
|
|
108
114
|
},
|
|
109
115
|
};
|
|
110
116
|
|
|
111
|
-
const result = await this.exec(request, "query");
|
|
117
|
+
const result = await this.exec(request, "query", metadata);
|
|
112
118
|
return this.validate(result, schema);
|
|
113
119
|
}
|
|
114
120
|
|
|
@@ -117,6 +123,7 @@ export class CosmosDBClientImpl
|
|
|
117
123
|
id: string,
|
|
118
124
|
schema: z.ZodSchema<T>,
|
|
119
125
|
partitionKey?: string,
|
|
126
|
+
metadata?: TraceMetadata,
|
|
120
127
|
): Promise<T> {
|
|
121
128
|
const request: CosmosDBRequest = {
|
|
122
129
|
cosmosdbAction: {
|
|
@@ -131,7 +138,7 @@ export class CosmosDBClientImpl
|
|
|
131
138
|
},
|
|
132
139
|
};
|
|
133
140
|
|
|
134
|
-
const result = await this.exec(request, "read");
|
|
141
|
+
const result = await this.exec(request, "read", metadata);
|
|
135
142
|
return this.validate(result, schema);
|
|
136
143
|
}
|
|
137
144
|
|
|
@@ -139,6 +146,7 @@ export class CosmosDBClientImpl
|
|
|
139
146
|
containerId: string,
|
|
140
147
|
body: unknown,
|
|
141
148
|
partitionKey?: string,
|
|
149
|
+
metadata?: TraceMetadata,
|
|
142
150
|
): Promise<unknown> {
|
|
143
151
|
const request: CosmosDBRequest = {
|
|
144
152
|
cosmosdbAction: {
|
|
@@ -156,13 +164,14 @@ export class CosmosDBClientImpl
|
|
|
156
164
|
},
|
|
157
165
|
};
|
|
158
166
|
|
|
159
|
-
return this.exec(request, "create");
|
|
167
|
+
return this.exec(request, "create", metadata);
|
|
160
168
|
}
|
|
161
169
|
|
|
162
170
|
async replace(
|
|
163
171
|
containerId: string,
|
|
164
172
|
body: unknown,
|
|
165
173
|
partitionKey?: string,
|
|
174
|
+
metadata?: TraceMetadata,
|
|
166
175
|
): Promise<unknown> {
|
|
167
176
|
const request: CosmosDBRequest = {
|
|
168
177
|
cosmosdbAction: {
|
|
@@ -180,13 +189,14 @@ export class CosmosDBClientImpl
|
|
|
180
189
|
},
|
|
181
190
|
};
|
|
182
191
|
|
|
183
|
-
return this.exec(request, "replace");
|
|
192
|
+
return this.exec(request, "replace", metadata);
|
|
184
193
|
}
|
|
185
194
|
|
|
186
195
|
async upsert(
|
|
187
196
|
containerId: string,
|
|
188
197
|
body: unknown,
|
|
189
198
|
partitionKey?: string,
|
|
199
|
+
metadata?: TraceMetadata,
|
|
190
200
|
): Promise<unknown> {
|
|
191
201
|
const request: CosmosDBRequest = {
|
|
192
202
|
cosmosdbAction: {
|
|
@@ -204,13 +214,14 @@ export class CosmosDBClientImpl
|
|
|
204
214
|
},
|
|
205
215
|
};
|
|
206
216
|
|
|
207
|
-
return this.exec(request, "upsert");
|
|
217
|
+
return this.exec(request, "upsert", metadata);
|
|
208
218
|
}
|
|
209
219
|
|
|
210
220
|
async deleteItem(
|
|
211
221
|
containerId: string,
|
|
212
222
|
id: string,
|
|
213
223
|
partitionKey?: string,
|
|
224
|
+
metadata?: TraceMetadata,
|
|
214
225
|
): Promise<unknown> {
|
|
215
226
|
const request: CosmosDBRequest = {
|
|
216
227
|
cosmosdbAction: {
|
|
@@ -225,6 +236,6 @@ export class CosmosDBClientImpl
|
|
|
225
236
|
},
|
|
226
237
|
};
|
|
227
238
|
|
|
228
|
-
return this.exec(request, "delete");
|
|
239
|
+
return this.exec(request, "delete", metadata);
|
|
229
240
|
}
|
|
230
241
|
}
|