@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
|
@@ -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
|
* Options for CosmosDB SQL queries.
|
|
@@ -64,6 +65,7 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
64
65
|
sql: string,
|
|
65
66
|
schema: z.ZodSchema<T>,
|
|
66
67
|
options?: CosmosDBQueryOptions,
|
|
68
|
+
metadata?: TraceMetadata,
|
|
67
69
|
): Promise<T>;
|
|
68
70
|
|
|
69
71
|
/**
|
|
@@ -73,6 +75,7 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
73
75
|
* @param id - The document ID
|
|
74
76
|
* @param schema - Zod schema for validating the result
|
|
75
77
|
* @param partitionKey - Optional partition key value
|
|
78
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
76
79
|
* @returns The validated document
|
|
77
80
|
*/
|
|
78
81
|
read<T>(
|
|
@@ -80,6 +83,7 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
80
83
|
id: string,
|
|
81
84
|
schema: z.ZodSchema<T>,
|
|
82
85
|
partitionKey?: string,
|
|
86
|
+
metadata?: TraceMetadata,
|
|
83
87
|
): Promise<T>;
|
|
84
88
|
|
|
85
89
|
/**
|
|
@@ -88,12 +92,14 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
88
92
|
* @param containerId - The container to create in
|
|
89
93
|
* @param body - The document to create (will be JSON-serialized)
|
|
90
94
|
* @param partitionKey - Optional partition key value
|
|
95
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
91
96
|
* @returns The raw result from CosmosDB
|
|
92
97
|
*/
|
|
93
98
|
create(
|
|
94
99
|
containerId: string,
|
|
95
100
|
body: unknown,
|
|
96
101
|
partitionKey?: string,
|
|
102
|
+
metadata?: TraceMetadata,
|
|
97
103
|
): Promise<unknown>;
|
|
98
104
|
|
|
99
105
|
/**
|
|
@@ -102,12 +108,14 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
102
108
|
* @param containerId - The container containing the document
|
|
103
109
|
* @param body - The replacement document (will be JSON-serialized)
|
|
104
110
|
* @param partitionKey - Optional partition key value
|
|
111
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
105
112
|
* @returns The raw result from CosmosDB
|
|
106
113
|
*/
|
|
107
114
|
replace(
|
|
108
115
|
containerId: string,
|
|
109
116
|
body: unknown,
|
|
110
117
|
partitionKey?: string,
|
|
118
|
+
metadata?: TraceMetadata,
|
|
111
119
|
): Promise<unknown>;
|
|
112
120
|
|
|
113
121
|
/**
|
|
@@ -116,12 +124,14 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
116
124
|
* @param containerId - The container to upsert into
|
|
117
125
|
* @param body - The document to upsert (will be JSON-serialized)
|
|
118
126
|
* @param partitionKey - Optional partition key value
|
|
127
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
119
128
|
* @returns The raw result from CosmosDB
|
|
120
129
|
*/
|
|
121
130
|
upsert(
|
|
122
131
|
containerId: string,
|
|
123
132
|
body: unknown,
|
|
124
133
|
partitionKey?: string,
|
|
134
|
+
metadata?: TraceMetadata,
|
|
125
135
|
): Promise<unknown>;
|
|
126
136
|
|
|
127
137
|
/**
|
|
@@ -130,11 +140,13 @@ export interface CosmosDBClient extends BaseIntegrationClient {
|
|
|
130
140
|
* @param containerId - The container containing the document
|
|
131
141
|
* @param id - The document ID to delete
|
|
132
142
|
* @param partitionKey - Optional partition key value
|
|
143
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
133
144
|
* @returns The raw result from CosmosDB
|
|
134
145
|
*/
|
|
135
146
|
deleteItem(
|
|
136
147
|
containerId: string,
|
|
137
148
|
id: string,
|
|
138
149
|
partitionKey?: string,
|
|
150
|
+
metadata?: TraceMetadata,
|
|
139
151
|
): Promise<unknown>;
|
|
140
152
|
}
|
|
@@ -4,12 +4,12 @@ Interact with Couchbase databases with full type safety and runtime validation.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `query(bucket, sql, schema, params?)` | Execute a SQL++ query with schema validation |
|
|
10
|
-
| `insert(key, value, identifier)` | Insert a document into a collection |
|
|
11
|
-
| `get(key, schema, identifier)` | Get a document by key with schema validation |
|
|
12
|
-
| `remove(key, identifier)` | Remove a document by key |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ------------------------------------------------ | -------------------------------------------- |
|
|
9
|
+
| `query(bucket, sql, schema, params?, metadata?)` | Execute a SQL++ query with schema validation |
|
|
10
|
+
| `insert(key, value, identifier, metadata?)` | Insert a document into a collection |
|
|
11
|
+
| `get(key, schema, identifier, metadata?)` | Get a document by key with schema validation |
|
|
12
|
+
| `remove(key, identifier, metadata?)` | Remove a document by key |
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
@@ -97,6 +97,10 @@ await ctx.integrations.cb.remove("user::123", {
|
|
|
97
97
|
});
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
## Trace Metadata
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
100
104
|
## Error Handling
|
|
101
105
|
|
|
102
106
|
```typescript
|
|
@@ -10,7 +10,7 @@ import type { z } from "zod";
|
|
|
10
10
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
11
11
|
import type { Plugin as CouchbasePlugin } from "@superblocksteam/types/dist/src/plugins/couchbase/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 { QueryValidationError, RestApiValidationError } from "../../errors.js";
|
|
15
15
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
16
16
|
import { describeType } from "../utils.js";
|
|
@@ -52,6 +52,7 @@ export class CouchbaseClientImpl
|
|
|
52
52
|
sql: string,
|
|
53
53
|
schema: z.ZodSchema<T>,
|
|
54
54
|
params?: unknown[],
|
|
55
|
+
metadata?: TraceMetadata,
|
|
55
56
|
): Promise<T[]> {
|
|
56
57
|
const hasParams = params && params.length > 0;
|
|
57
58
|
const request: CouchbaseRequest = {
|
|
@@ -68,6 +69,8 @@ export class CouchbaseClientImpl
|
|
|
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)) {
|
|
@@ -114,6 +117,7 @@ export class CouchbaseClientImpl
|
|
|
114
117
|
key: string,
|
|
115
118
|
value: unknown,
|
|
116
119
|
identifier: CouchbaseIdentifier,
|
|
120
|
+
metadata?: TraceMetadata,
|
|
117
121
|
): Promise<void> {
|
|
118
122
|
const request: CouchbaseRequest = {
|
|
119
123
|
bucketName: identifier.bucket,
|
|
@@ -131,7 +135,11 @@ export class CouchbaseClientImpl
|
|
|
131
135
|
};
|
|
132
136
|
|
|
133
137
|
try {
|
|
134
|
-
await this.executeQuery(
|
|
138
|
+
await this.executeQuery(
|
|
139
|
+
request as Record<string, unknown>,
|
|
140
|
+
undefined,
|
|
141
|
+
metadata,
|
|
142
|
+
);
|
|
135
143
|
} catch (error) {
|
|
136
144
|
if (error instanceof IntegrationError) {
|
|
137
145
|
throw error;
|
|
@@ -145,6 +153,7 @@ export class CouchbaseClientImpl
|
|
|
145
153
|
key: string,
|
|
146
154
|
schema: z.ZodSchema<T>,
|
|
147
155
|
identifier: CouchbaseIdentifier,
|
|
156
|
+
metadata?: TraceMetadata,
|
|
148
157
|
): Promise<T> {
|
|
149
158
|
const request: CouchbaseRequest = {
|
|
150
159
|
bucketName: identifier.bucket,
|
|
@@ -163,6 +172,8 @@ export class CouchbaseClientImpl
|
|
|
163
172
|
try {
|
|
164
173
|
const result = await this.executeQuery(
|
|
165
174
|
request as Record<string, unknown>,
|
|
175
|
+
undefined,
|
|
176
|
+
metadata,
|
|
166
177
|
);
|
|
167
178
|
|
|
168
179
|
const parseResult = schema.safeParse(result);
|
|
@@ -190,7 +201,11 @@ export class CouchbaseClientImpl
|
|
|
190
201
|
}
|
|
191
202
|
}
|
|
192
203
|
|
|
193
|
-
async remove(
|
|
204
|
+
async remove(
|
|
205
|
+
key: string,
|
|
206
|
+
identifier: CouchbaseIdentifier,
|
|
207
|
+
metadata?: TraceMetadata,
|
|
208
|
+
): Promise<void> {
|
|
194
209
|
const request: CouchbaseRequest = {
|
|
195
210
|
bucketName: identifier.bucket,
|
|
196
211
|
couchbaseAction: {
|
|
@@ -206,7 +221,11 @@ export class CouchbaseClientImpl
|
|
|
206
221
|
};
|
|
207
222
|
|
|
208
223
|
try {
|
|
209
|
-
await this.executeQuery(
|
|
224
|
+
await this.executeQuery(
|
|
225
|
+
request as Record<string, unknown>,
|
|
226
|
+
undefined,
|
|
227
|
+
metadata,
|
|
228
|
+
);
|
|
210
229
|
} catch (error) {
|
|
211
230
|
if (error instanceof IntegrationError) {
|
|
212
231
|
throw error;
|
|
@@ -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
|
* Parameters for identifying a Couchbase document location.
|
|
@@ -75,6 +76,7 @@ export interface CouchbaseClient extends BaseIntegrationClient {
|
|
|
75
76
|
sql: string,
|
|
76
77
|
schema: z.ZodSchema<T>,
|
|
77
78
|
params?: unknown[],
|
|
79
|
+
metadata?: TraceMetadata,
|
|
78
80
|
): Promise<T[]>;
|
|
79
81
|
|
|
80
82
|
/**
|
|
@@ -83,11 +85,13 @@ export interface CouchbaseClient extends BaseIntegrationClient {
|
|
|
83
85
|
* @param key - The document key
|
|
84
86
|
* @param value - The document value (will be JSON-serialized)
|
|
85
87
|
* @param identifier - The bucket, scope, and collection to insert into
|
|
88
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
86
89
|
*/
|
|
87
90
|
insert(
|
|
88
91
|
key: string,
|
|
89
92
|
value: unknown,
|
|
90
93
|
identifier: CouchbaseIdentifier,
|
|
94
|
+
metadata?: TraceMetadata,
|
|
91
95
|
): Promise<void>;
|
|
92
96
|
|
|
93
97
|
/**
|
|
@@ -96,12 +100,14 @@ export interface CouchbaseClient extends BaseIntegrationClient {
|
|
|
96
100
|
* @param key - The document key
|
|
97
101
|
* @param schema - Zod schema for validating the result
|
|
98
102
|
* @param identifier - The bucket, scope, and collection to get from
|
|
103
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
99
104
|
* @returns The validated document
|
|
100
105
|
*/
|
|
101
106
|
get<T>(
|
|
102
107
|
key: string,
|
|
103
108
|
schema: z.ZodSchema<T>,
|
|
104
109
|
identifier: CouchbaseIdentifier,
|
|
110
|
+
metadata?: TraceMetadata,
|
|
105
111
|
): Promise<T>;
|
|
106
112
|
|
|
107
113
|
/**
|
|
@@ -109,6 +115,11 @@ export interface CouchbaseClient extends BaseIntegrationClient {
|
|
|
109
115
|
*
|
|
110
116
|
* @param key - The document key
|
|
111
117
|
* @param identifier - The bucket, scope, and collection to remove from
|
|
118
|
+
* @param metadata - Optional trace metadata for diagnostics
|
|
112
119
|
*/
|
|
113
|
-
remove(
|
|
120
|
+
remove(
|
|
121
|
+
key: string,
|
|
122
|
+
identifier: CouchbaseIdentifier,
|
|
123
|
+
metadata?: TraceMetadata,
|
|
124
|
+
): Promise<void>;
|
|
114
125
|
}
|
|
@@ -4,10 +4,10 @@ Execute SQL queries against Databricks SQL warehouses with full type safety and
|
|
|
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
|
|
|
@@ -94,6 +94,10 @@ const analytics = await ctx.integrations.databricks.query(
|
|
|
94
94
|
);
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
## Trace Metadata
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
97
101
|
## Common Pitfalls
|
|
98
102
|
|
|
99
103
|
### BIGINT/LONG 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 DatabricksPlugin } from "@superblocksteam/types/dist/src/plugins/databricks/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";
|
|
@@ -66,11 +66,12 @@ export class DatabricksClientImpl
|
|
|
66
66
|
sql: string,
|
|
67
67
|
schema: z.ZodSchema<T>,
|
|
68
68
|
params?: unknown[],
|
|
69
|
+
metadata?: TraceMetadata,
|
|
69
70
|
): Promise<T[]> {
|
|
70
71
|
const request = this.buildRequest(sql, params);
|
|
71
72
|
|
|
72
73
|
try {
|
|
73
|
-
const result = await this.executeQuery(request);
|
|
74
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
74
75
|
|
|
75
76
|
if (!Array.isArray(result)) {
|
|
76
77
|
throw new IntegrationError(
|
|
@@ -118,11 +119,12 @@ export class DatabricksClientImpl
|
|
|
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
|
if (
|
|
128
130
|
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 Databricks queries with type-safe validation.
|
|
@@ -45,6 +46,7 @@ export interface DatabricksClient 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 DatabricksClient 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 @@ Query metrics, manage monitors, and interact with Datadog's monitoring and obser
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Datadog API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | --------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Datadog API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -311,6 +311,10 @@ result.data.forEach((log) => {
|
|
|
311
311
|
});
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
+
## Trace Metadata
|
|
315
|
+
|
|
316
|
+
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.
|
|
317
|
+
|
|
314
318
|
## Common Pitfalls
|
|
315
319
|
|
|
316
320
|
### No Specialized Methods
|
|
@@ -4,9 +4,9 @@ Upload, download, and manage files in Dropbox.
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema)` | Make any Dropbox API request with schema validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | --------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Dropbox API request with schema validation |
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -316,6 +316,10 @@ const result = await ctx.integrations.dropbox.apiRequest(
|
|
|
316
316
|
console.log(`Share URL: ${result.url}`);
|
|
317
317
|
```
|
|
318
318
|
|
|
319
|
+
## Trace Metadata
|
|
320
|
+
|
|
321
|
+
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.
|
|
322
|
+
|
|
319
323
|
## Common Pitfalls
|
|
320
324
|
|
|
321
325
|
### No Specialized Methods
|
|
@@ -4,19 +4,19 @@ Execute operations against Amazon DynamoDB with full type safety and runtime val
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `query(statement, schema, params?)` | Execute a PartiQL statement |
|
|
10
|
-
| `getItem(table, key, schema)` | Get an item by key |
|
|
11
|
-
| `putItem(table, item)` | Insert or replace an item |
|
|
12
|
-
| `updateItem(table, key, expr, values, names?)` | Update an existing item |
|
|
13
|
-
| `deleteItem(table, key)` | Delete an item by key |
|
|
14
|
-
| `scan(table, schema, filter?, values?, names?)` | Scan a table |
|
|
15
|
-
| `queryTable(table, keyExpr, values, schema, names?)` | Query by key condition |
|
|
16
|
-
| `batchWriteItem(requestItems)` | Batch write multiple items |
|
|
17
|
-
| `listTables(schema)` | List all tables |
|
|
18
|
-
| `describeTable(table, schema)` | Describe a table's structure |
|
|
19
|
-
| `deleteTable(table)` | Delete a table |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| --------------------------------------------------------------- | ---------------------------- |
|
|
9
|
+
| `query(statement, schema, params?, metadata?)` | Execute a PartiQL statement |
|
|
10
|
+
| `getItem(table, key, schema, metadata?)` | Get an item by key |
|
|
11
|
+
| `putItem(table, item, metadata?)` | Insert or replace an item |
|
|
12
|
+
| `updateItem(table, key, expr, values, names?, metadata?)` | Update an existing item |
|
|
13
|
+
| `deleteItem(table, key, metadata?)` | Delete an item by key |
|
|
14
|
+
| `scan(table, schema, filter?, values?, names?, metadata?)` | Scan a table |
|
|
15
|
+
| `queryTable(table, keyExpr, values, schema, names?, metadata?)` | Query by key condition |
|
|
16
|
+
| `batchWriteItem(requestItems, metadata?)` | Batch write multiple items |
|
|
17
|
+
| `listTables(schema, metadata?)` | List all tables |
|
|
18
|
+
| `describeTable(table, schema, metadata?)` | Describe a table's structure |
|
|
19
|
+
| `deleteTable(table, metadata?)` | Delete a table |
|
|
20
20
|
|
|
21
21
|
## DynamoDB AttributeValue Format
|
|
22
22
|
|
|
@@ -205,6 +205,10 @@ const description = await ctx.integrations.dynamodb.describeTable(
|
|
|
205
205
|
await ctx.integrations.dynamodb.deleteTable("temp-table");
|
|
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
|
### Use Parameterized PartiQL Queries
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import type { z } from "zod";
|
|
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 { DynamoDBClient, DynamoDBAttributeValue } from "./types.js";
|
|
@@ -86,9 +86,10 @@ export class DynamoDBClientImpl
|
|
|
86
86
|
private async executeWithErrorHandling(
|
|
87
87
|
request: Record<string, unknown>,
|
|
88
88
|
operation: string,
|
|
89
|
+
metadata?: TraceMetadata,
|
|
89
90
|
): Promise<unknown> {
|
|
90
91
|
try {
|
|
91
|
-
return await this.executeQuery(request);
|
|
92
|
+
return await this.executeQuery(request, undefined, metadata);
|
|
92
93
|
} catch (error) {
|
|
93
94
|
if (
|
|
94
95
|
error instanceof RestApiValidationError ||
|
|
@@ -105,6 +106,7 @@ export class DynamoDBClientImpl
|
|
|
105
106
|
statement: string,
|
|
106
107
|
schema: z.ZodSchema<T>,
|
|
107
108
|
params?: DynamoDBAttributeValue[],
|
|
109
|
+
metadata?: TraceMetadata,
|
|
108
110
|
): Promise<T> {
|
|
109
111
|
const body: Record<string, unknown> = { Statement: statement };
|
|
110
112
|
|
|
@@ -113,7 +115,11 @@ export class DynamoDBClientImpl
|
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
const request = this.buildRequest("executeStatement", body);
|
|
116
|
-
const result = await this.executeWithErrorHandling(
|
|
118
|
+
const result = await this.executeWithErrorHandling(
|
|
119
|
+
request,
|
|
120
|
+
"query",
|
|
121
|
+
metadata,
|
|
122
|
+
);
|
|
117
123
|
return this.validateResult(result, schema, "query");
|
|
118
124
|
}
|
|
119
125
|
|
|
@@ -121,24 +127,30 @@ export class DynamoDBClientImpl
|
|
|
121
127
|
table: string,
|
|
122
128
|
key: Record<string, DynamoDBAttributeValue>,
|
|
123
129
|
schema: z.ZodSchema<T>,
|
|
130
|
+
metadata?: TraceMetadata,
|
|
124
131
|
): Promise<T> {
|
|
125
132
|
const request = this.buildRequest("getItem", {
|
|
126
133
|
TableName: table,
|
|
127
134
|
Key: key,
|
|
128
135
|
});
|
|
129
|
-
const result = await this.executeWithErrorHandling(
|
|
136
|
+
const result = await this.executeWithErrorHandling(
|
|
137
|
+
request,
|
|
138
|
+
"getItem",
|
|
139
|
+
metadata,
|
|
140
|
+
);
|
|
130
141
|
return this.validateResult(result, schema, "getItem");
|
|
131
142
|
}
|
|
132
143
|
|
|
133
144
|
async putItem(
|
|
134
145
|
table: string,
|
|
135
146
|
item: Record<string, DynamoDBAttributeValue>,
|
|
147
|
+
metadata?: TraceMetadata,
|
|
136
148
|
): Promise<unknown> {
|
|
137
149
|
const request = this.buildRequest("putItem", {
|
|
138
150
|
TableName: table,
|
|
139
151
|
Item: item,
|
|
140
152
|
});
|
|
141
|
-
return this.executeWithErrorHandling(request, "putItem");
|
|
153
|
+
return this.executeWithErrorHandling(request, "putItem", metadata);
|
|
142
154
|
}
|
|
143
155
|
|
|
144
156
|
async updateItem(
|
|
@@ -147,6 +159,7 @@ export class DynamoDBClientImpl
|
|
|
147
159
|
updateExpression: string,
|
|
148
160
|
expressionAttributeValues: Record<string, DynamoDBAttributeValue>,
|
|
149
161
|
expressionAttributeNames?: Record<string, string>,
|
|
162
|
+
metadata?: TraceMetadata,
|
|
150
163
|
): Promise<unknown> {
|
|
151
164
|
const params: Record<string, unknown> = {
|
|
152
165
|
TableName: table,
|
|
@@ -160,18 +173,19 @@ export class DynamoDBClientImpl
|
|
|
160
173
|
}
|
|
161
174
|
|
|
162
175
|
const request = this.buildRequest("updateItem", params);
|
|
163
|
-
return this.executeWithErrorHandling(request, "updateItem");
|
|
176
|
+
return this.executeWithErrorHandling(request, "updateItem", metadata);
|
|
164
177
|
}
|
|
165
178
|
|
|
166
179
|
async deleteItem(
|
|
167
180
|
table: string,
|
|
168
181
|
key: Record<string, DynamoDBAttributeValue>,
|
|
182
|
+
metadata?: TraceMetadata,
|
|
169
183
|
): Promise<unknown> {
|
|
170
184
|
const request = this.buildRequest("deleteItem", {
|
|
171
185
|
TableName: table,
|
|
172
186
|
Key: key,
|
|
173
187
|
});
|
|
174
|
-
return this.executeWithErrorHandling(request, "deleteItem");
|
|
188
|
+
return this.executeWithErrorHandling(request, "deleteItem", metadata);
|
|
175
189
|
}
|
|
176
190
|
|
|
177
191
|
async scan<T>(
|
|
@@ -180,6 +194,7 @@ export class DynamoDBClientImpl
|
|
|
180
194
|
filterExpression?: string,
|
|
181
195
|
expressionAttributeValues?: Record<string, DynamoDBAttributeValue>,
|
|
182
196
|
expressionAttributeNames?: Record<string, string>,
|
|
197
|
+
metadata?: TraceMetadata,
|
|
183
198
|
): Promise<T> {
|
|
184
199
|
const params: Record<string, unknown> = { TableName: table };
|
|
185
200
|
|
|
@@ -196,7 +211,11 @@ export class DynamoDBClientImpl
|
|
|
196
211
|
}
|
|
197
212
|
|
|
198
213
|
const request = this.buildRequest("scan", params);
|
|
199
|
-
const result = await this.executeWithErrorHandling(
|
|
214
|
+
const result = await this.executeWithErrorHandling(
|
|
215
|
+
request,
|
|
216
|
+
"scan",
|
|
217
|
+
metadata,
|
|
218
|
+
);
|
|
200
219
|
return this.validateResult(result, schema, "scan");
|
|
201
220
|
}
|
|
202
221
|
|
|
@@ -206,6 +225,7 @@ export class DynamoDBClientImpl
|
|
|
206
225
|
expressionAttributeValues: Record<string, DynamoDBAttributeValue>,
|
|
207
226
|
schema: z.ZodSchema<T>,
|
|
208
227
|
expressionAttributeNames?: Record<string, string>,
|
|
228
|
+
metadata?: TraceMetadata,
|
|
209
229
|
): Promise<T> {
|
|
210
230
|
const params: Record<string, unknown> = {
|
|
211
231
|
TableName: table,
|
|
@@ -218,40 +238,57 @@ export class DynamoDBClientImpl
|
|
|
218
238
|
}
|
|
219
239
|
|
|
220
240
|
const request = this.buildRequest("query", params);
|
|
221
|
-
const result = await this.executeWithErrorHandling(
|
|
241
|
+
const result = await this.executeWithErrorHandling(
|
|
242
|
+
request,
|
|
243
|
+
"queryTable",
|
|
244
|
+
metadata,
|
|
245
|
+
);
|
|
222
246
|
return this.validateResult(result, schema, "queryTable");
|
|
223
247
|
}
|
|
224
248
|
|
|
225
249
|
async batchWriteItem(
|
|
226
250
|
requestItems: Record<string, Array<Record<string, unknown>>>,
|
|
251
|
+
metadata?: TraceMetadata,
|
|
227
252
|
): Promise<unknown> {
|
|
228
253
|
const request = this.buildRequest("batchWriteItem", {
|
|
229
254
|
RequestItems: requestItems,
|
|
230
255
|
});
|
|
231
|
-
return this.executeWithErrorHandling(request, "batchWriteItem");
|
|
256
|
+
return this.executeWithErrorHandling(request, "batchWriteItem", metadata);
|
|
232
257
|
}
|
|
233
258
|
|
|
234
|
-
async listTables<T>(
|
|
259
|
+
async listTables<T>(
|
|
260
|
+
schema: z.ZodSchema<T>,
|
|
261
|
+
metadata?: TraceMetadata,
|
|
262
|
+
): Promise<T> {
|
|
235
263
|
const request = this.buildRequest("listTables", {});
|
|
236
|
-
const result = await this.executeWithErrorHandling(
|
|
264
|
+
const result = await this.executeWithErrorHandling(
|
|
265
|
+
request,
|
|
266
|
+
"listTables",
|
|
267
|
+
metadata,
|
|
268
|
+
);
|
|
237
269
|
return this.validateResult(result, schema, "listTables");
|
|
238
270
|
}
|
|
239
271
|
|
|
240
|
-
async describeTable<T>(
|
|
272
|
+
async describeTable<T>(
|
|
273
|
+
table: string,
|
|
274
|
+
schema: z.ZodSchema<T>,
|
|
275
|
+
metadata?: TraceMetadata,
|
|
276
|
+
): Promise<T> {
|
|
241
277
|
const request = this.buildRequest("describeTable", {
|
|
242
278
|
TableName: table,
|
|
243
279
|
});
|
|
244
280
|
const result = await this.executeWithErrorHandling(
|
|
245
281
|
request,
|
|
246
282
|
"describeTable",
|
|
283
|
+
metadata,
|
|
247
284
|
);
|
|
248
285
|
return this.validateResult(result, schema, "describeTable");
|
|
249
286
|
}
|
|
250
287
|
|
|
251
|
-
async deleteTable(table: string): Promise<unknown> {
|
|
288
|
+
async deleteTable(table: string, metadata?: TraceMetadata): Promise<unknown> {
|
|
252
289
|
const request = this.buildRequest("deleteTable", {
|
|
253
290
|
TableName: table,
|
|
254
291
|
});
|
|
255
|
-
return this.executeWithErrorHandling(request, "deleteTable");
|
|
292
|
+
return this.executeWithErrorHandling(request, "deleteTable", metadata);
|
|
256
293
|
}
|
|
257
294
|
}
|