@superblocksteam/sdk-api 0.0.6 → 0.0.7
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 +351 -427
- package/dist/api/definition.d.ts +12 -7
- package/dist/api/definition.d.ts.map +1 -1
- package/dist/api/definition.js +19 -12
- package/dist/api/definition.js.map +1 -1
- package/dist/api/definition.test.js +39 -15
- package/dist/api/definition.test.js.map +1 -1
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +0 -2
- package/dist/api/index.js.map +1 -1
- package/dist/errors.d.ts +1 -45
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -33
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +16 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/dist/integrations/anthropic/types.d.ts +3 -22
- package/dist/integrations/anthropic/types.d.ts.map +1 -1
- package/dist/integrations/athena/client.d.ts +1 -1
- package/dist/integrations/athena/client.d.ts.map +1 -1
- package/dist/integrations/athena/client.js.map +1 -1
- package/dist/integrations/athena/types.d.ts +2 -2
- package/dist/integrations/athena/types.d.ts.map +1 -1
- package/dist/integrations/base/graphql-integration-client.d.ts +8 -4
- package/dist/integrations/base/graphql-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/graphql-integration-client.js +18 -5
- package/dist/integrations/base/graphql-integration-client.js.map +1 -1
- package/dist/integrations/base/index.d.ts +3 -2
- package/dist/integrations/base/index.d.ts.map +1 -1
- package/dist/integrations/base/index.js +1 -0
- package/dist/integrations/base/index.js.map +1 -1
- package/dist/integrations/base/rest-api-client-base.d.ts +48 -0
- package/dist/integrations/base/rest-api-client-base.d.ts.map +1 -0
- package/dist/integrations/base/rest-api-client-base.js +98 -0
- package/dist/integrations/base/rest-api-client-base.js.map +1 -0
- package/dist/integrations/base/rest-api-integration-client.d.ts +11 -65
- package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.js +11 -174
- package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
- package/dist/integrations/base/types.d.ts +1 -67
- package/dist/integrations/base/types.d.ts.map +1 -1
- package/dist/integrations/bigquery/client.d.ts +1 -1
- package/dist/integrations/bigquery/client.d.ts.map +1 -1
- package/dist/integrations/bigquery/client.js.map +1 -1
- package/dist/integrations/bigquery/types.d.ts +3 -3
- package/dist/integrations/bigquery/types.d.ts.map +1 -1
- package/dist/integrations/box/types.d.ts +1 -1
- package/dist/integrations/cockroachdb/client.d.ts +1 -1
- package/dist/integrations/cockroachdb/client.d.ts.map +1 -1
- package/dist/integrations/cockroachdb/client.js.map +1 -1
- package/dist/integrations/cockroachdb/types.d.ts.map +1 -1
- package/dist/integrations/cosmosdb/client.d.ts +1 -1
- package/dist/integrations/cosmosdb/client.d.ts.map +1 -1
- package/dist/integrations/cosmosdb/client.js.map +1 -1
- package/dist/integrations/cosmosdb/client.test.js.map +1 -1
- package/dist/integrations/cosmosdb/types.d.ts.map +1 -1
- package/dist/integrations/databricks/client.d.ts +1 -1
- package/dist/integrations/databricks/client.d.ts.map +1 -1
- package/dist/integrations/databricks/client.js.map +1 -1
- package/dist/integrations/databricks/types.d.ts +3 -3
- package/dist/integrations/databricks/types.d.ts.map +1 -1
- package/dist/integrations/declarations.d.ts +36 -104
- package/dist/integrations/declarations.d.ts.map +1 -1
- package/dist/integrations/declarations.js +5 -68
- package/dist/integrations/declarations.js.map +1 -1
- package/dist/integrations/declarations.test.js.map +1 -1
- package/dist/integrations/documentation-resolver.test.d.ts +2 -0
- package/dist/integrations/documentation-resolver.test.d.ts.map +1 -0
- package/dist/integrations/documentation-resolver.test.js +608 -0
- package/dist/integrations/documentation-resolver.test.js.map +1 -0
- package/dist/integrations/documentation.d.ts +8 -0
- package/dist/integrations/documentation.d.ts.map +1 -0
- package/dist/integrations/documentation.js +277 -0
- package/dist/integrations/documentation.js.map +1 -0
- package/dist/integrations/documentation.test.d.ts +2 -0
- package/dist/integrations/documentation.test.d.ts.map +1 -0
- package/dist/integrations/documentation.test.js +81 -0
- package/dist/integrations/documentation.test.js.map +1 -0
- package/dist/integrations/dynamodb/client.d.ts +1 -1
- package/dist/integrations/dynamodb/client.d.ts.map +1 -1
- package/dist/integrations/dynamodb/client.js.map +1 -1
- package/dist/integrations/dynamodb/types.d.ts.map +1 -1
- package/dist/integrations/gcs/client.d.ts +1 -1
- package/dist/integrations/gcs/client.d.ts.map +1 -1
- package/dist/integrations/gcs/client.js.map +1 -1
- package/dist/integrations/gcs/types.d.ts.map +1 -1
- package/dist/integrations/googledrive/types.d.ts +1 -1
- package/dist/integrations/graphql/client.test.d.ts +15 -0
- package/dist/integrations/graphql/client.test.d.ts.map +1 -0
- package/dist/integrations/graphql/client.test.js +148 -0
- package/dist/integrations/graphql/client.test.js.map +1 -0
- package/dist/integrations/graphql/types.d.ts +22 -3
- package/dist/integrations/graphql/types.d.ts.map +1 -1
- package/dist/integrations/gsheets/client.d.ts +1 -1
- package/dist/integrations/gsheets/client.d.ts.map +1 -1
- package/dist/integrations/gsheets/client.js.map +1 -1
- package/dist/integrations/gsheets/types.d.ts.map +1 -1
- package/dist/integrations/index.d.ts +2 -12
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +2 -8
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/lakebase/client.d.ts +1 -1
- package/dist/integrations/lakebase/client.d.ts.map +1 -1
- package/dist/integrations/lakebase/client.js.map +1 -1
- package/dist/integrations/lakebase/types.d.ts +4 -4
- package/dist/integrations/lakebase/types.d.ts.map +1 -1
- package/dist/integrations/mariadb/client.d.ts +1 -1
- package/dist/integrations/mariadb/client.d.ts.map +1 -1
- package/dist/integrations/mariadb/client.js.map +1 -1
- package/dist/integrations/mariadb/types.d.ts +2 -2
- package/dist/integrations/mariadb/types.d.ts.map +1 -1
- package/dist/integrations/mongodb/client.d.ts +1 -1
- package/dist/integrations/mongodb/client.d.ts.map +1 -1
- package/dist/integrations/mongodb/client.js.map +1 -1
- package/dist/integrations/mongodb/types.d.ts.map +1 -1
- package/dist/integrations/mssql/client.d.ts +1 -1
- package/dist/integrations/mssql/client.d.ts.map +1 -1
- package/dist/integrations/mssql/client.js.map +1 -1
- package/dist/integrations/mssql/types.d.ts +2 -2
- package/dist/integrations/mssql/types.d.ts.map +1 -1
- package/dist/integrations/mysql/client.d.ts +1 -1
- package/dist/integrations/mysql/client.d.ts.map +1 -1
- package/dist/integrations/mysql/client.js.map +1 -1
- package/dist/integrations/mysql/types.d.ts +4 -4
- package/dist/integrations/mysql/types.d.ts.map +1 -1
- package/dist/integrations/openai_v2/types.d.ts +4 -22
- package/dist/integrations/openai_v2/types.d.ts.map +1 -1
- package/dist/integrations/oracledb/client.d.ts +1 -1
- package/dist/integrations/oracledb/client.d.ts.map +1 -1
- package/dist/integrations/oracledb/client.js.map +1 -1
- package/dist/integrations/oracledb/types.d.ts +2 -2
- package/dist/integrations/oracledb/types.d.ts.map +1 -1
- package/dist/integrations/postgres/client.d.ts +2 -2
- package/dist/integrations/postgres/client.d.ts.map +1 -1
- package/dist/integrations/postgres/client.js.map +1 -1
- package/dist/integrations/postgres/types.d.ts.map +1 -1
- package/dist/integrations/redshift/client.d.ts +1 -1
- package/dist/integrations/redshift/client.d.ts.map +1 -1
- package/dist/integrations/redshift/client.js.map +1 -1
- package/dist/integrations/redshift/types.d.ts.map +1 -1
- package/dist/integrations/registry.d.ts +6 -27
- package/dist/integrations/registry.d.ts.map +1 -1
- package/dist/integrations/registry.js +64 -88
- package/dist/integrations/registry.js.map +1 -1
- package/dist/integrations/registry.test.js +1 -3
- package/dist/integrations/registry.test.js.map +1 -1
- package/dist/integrations/restapiintegration/types.d.ts +2 -2
- package/dist/integrations/restapiintegration/types.d.ts.map +1 -1
- package/dist/integrations/s3/client.d.ts +1 -1
- package/dist/integrations/s3/client.d.ts.map +1 -1
- package/dist/integrations/s3/client.js.map +1 -1
- package/dist/integrations/s3/types.d.ts +3 -1
- package/dist/integrations/s3/types.d.ts.map +1 -1
- package/dist/integrations/salesforce/client.d.ts +1 -1
- package/dist/integrations/salesforce/client.d.ts.map +1 -1
- package/dist/integrations/salesforce/client.js.map +1 -1
- package/dist/integrations/salesforce/types.d.ts.map +1 -1
- package/dist/integrations/slack/client.d.ts +13 -9
- package/dist/integrations/slack/client.d.ts.map +1 -1
- package/dist/integrations/slack/client.js +60 -8
- package/dist/integrations/slack/client.js.map +1 -1
- package/dist/integrations/slack/client.test.d.ts +11 -0
- package/dist/integrations/slack/client.test.d.ts.map +1 -0
- package/dist/integrations/slack/client.test.js +368 -0
- package/dist/integrations/slack/client.test.js.map +1 -0
- package/dist/integrations/slack/index.d.ts +2 -1
- package/dist/integrations/slack/index.d.ts.map +1 -1
- package/dist/integrations/slack/index.js +1 -0
- package/dist/integrations/slack/index.js.map +1 -1
- package/dist/integrations/slack/types.d.ts +127 -28
- package/dist/integrations/slack/types.d.ts.map +1 -1
- package/dist/integrations/slack/types.js +27 -1
- package/dist/integrations/slack/types.js.map +1 -1
- package/dist/integrations/smtp/client.d.ts +1 -1
- package/dist/integrations/smtp/client.d.ts.map +1 -1
- package/dist/integrations/smtp/client.js.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 +2 -2
- package/dist/integrations/snowflake/client.js.map +1 -1
- package/dist/integrations/snowflake/types.d.ts.map +1 -1
- package/dist/integrations/snowflakecortex/client.d.ts +1 -2
- package/dist/integrations/snowflakecortex/client.d.ts.map +1 -1
- package/dist/integrations/snowflakecortex/client.js +1 -2
- package/dist/integrations/snowflakecortex/client.js.map +1 -1
- package/dist/integrations/snowflakecortex/types.d.ts +3 -4
- package/dist/integrations/snowflakecortex/types.d.ts.map +1 -1
- package/dist/integrations/snowflakepostgres/client.d.ts +1 -1
- package/dist/integrations/snowflakepostgres/client.d.ts.map +1 -1
- package/dist/integrations/snowflakepostgres/client.js.map +1 -1
- package/dist/integrations/snowflakepostgres/types.d.ts.map +1 -1
- package/dist/runtime/context.d.ts +3 -3
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/executor.d.ts +2 -2
- package/dist/runtime/index.d.ts +0 -3
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -6
- package/dist/runtime/index.js.map +1 -1
- package/dist/types.d.ts +15 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/definition.test.ts +41 -15
- package/src/api/definition.ts +20 -13
- package/src/api/index.ts +0 -4
- package/src/errors.ts +1 -49
- package/src/index.ts +20 -61
- package/src/integrations/airtable/docs.manifest.json +5 -0
- package/src/integrations/anthropic/README.md +5 -101
- package/src/integrations/anthropic/docs.manifest.json +5 -0
- package/src/integrations/anthropic/types.ts +3 -29
- package/src/integrations/asana/README.md +12 -12
- package/src/integrations/asana/docs.manifest.json +5 -0
- package/src/integrations/athena/README.md +4 -4
- package/src/integrations/athena/client.ts +5 -3
- package/src/integrations/athena/docs.manifest.json +5 -0
- package/src/integrations/athena/types.ts +3 -2
- package/src/integrations/base/graphql-integration-client.ts +27 -5
- package/src/integrations/base/index.ts +2 -3
- package/src/integrations/base/rest-api-client-base.ts +134 -0
- package/src/integrations/base/rest-api-integration-client.ts +15 -239
- package/src/integrations/base/types.ts +4 -74
- package/src/integrations/bigquery/README.md +28 -3
- package/src/integrations/bigquery/client.ts +5 -3
- package/src/integrations/bigquery/docs.manifest.json +5 -0
- package/src/integrations/bigquery/types.ts +4 -3
- package/src/integrations/bitbucket/README.md +19 -19
- package/src/integrations/bitbucket/docs.manifest.json +5 -0
- package/src/integrations/box/README.md +24 -24
- package/src/integrations/box/docs.manifest.json +5 -0
- package/src/integrations/box/types.ts +1 -1
- package/src/integrations/circleci/README.md +18 -18
- package/src/integrations/circleci/docs.manifest.json +5 -0
- package/src/integrations/cockroachdb/client.ts +5 -3
- package/src/integrations/cockroachdb/docs.manifest.json +5 -0
- package/src/integrations/cockroachdb/types.ts +1 -0
- package/src/integrations/cohere/README.md +11 -11
- package/src/integrations/cohere/docs.manifest.json +5 -0
- package/src/integrations/confluence/docs.manifest.json +5 -0
- package/src/integrations/cosmosdb/client.test.ts +2 -1
- package/src/integrations/cosmosdb/client.ts +5 -3
- package/src/integrations/cosmosdb/docs.manifest.json +5 -0
- package/src/integrations/cosmosdb/types.ts +1 -0
- package/src/integrations/databricks/README.md +29 -4
- package/src/integrations/databricks/client.ts +5 -3
- package/src/integrations/databricks/docs.manifest.json +5 -0
- package/src/integrations/databricks/types.ts +4 -3
- package/src/integrations/datadog/docs.manifest.json +5 -0
- package/src/integrations/declarations.test.ts +1 -0
- package/src/integrations/declarations.ts +36 -136
- package/src/integrations/documentation-resolver.test.ts +704 -0
- package/src/integrations/documentation.test.ts +120 -0
- package/src/integrations/documentation.ts +421 -0
- package/src/integrations/dropbox/docs.manifest.json +5 -0
- package/src/integrations/dynamodb/client.ts +3 -2
- package/src/integrations/dynamodb/docs.manifest.json +5 -0
- package/src/integrations/dynamodb/types.ts +1 -0
- package/src/integrations/elasticsearch/docs.manifest.json +5 -0
- package/src/integrations/fireworks/README.md +43 -17
- package/src/integrations/fireworks/docs.manifest.json +5 -0
- package/src/integrations/front/docs.manifest.json +5 -0
- package/src/integrations/gcs/client.ts +5 -3
- package/src/integrations/gcs/docs.manifest.json +5 -0
- package/src/integrations/gcs/types.ts +1 -0
- package/src/integrations/gemini/docs.manifest.json +5 -0
- package/src/integrations/github/docs.manifest.json +5 -0
- package/src/integrations/googleanalytics/README.md +2 -2
- package/src/integrations/googleanalytics/docs.manifest.json +5 -0
- package/src/integrations/googledrive/README.md +27 -24
- package/src/integrations/googledrive/docs.manifest.json +5 -0
- package/src/integrations/googledrive/types.ts +1 -1
- package/src/integrations/graphql/README.md +2 -2
- package/src/integrations/graphql/client.test.ts +220 -0
- package/src/integrations/graphql/docs.manifest.json +5 -0
- package/src/integrations/graphql/types.ts +23 -1
- package/src/integrations/groq/README.md +49 -42
- package/src/integrations/groq/docs.manifest.json +5 -0
- package/src/integrations/gsheets/README.md +2 -2
- package/src/integrations/gsheets/client.ts +5 -3
- package/src/integrations/gsheets/docs.manifest.json +5 -0
- package/src/integrations/gsheets/types.ts +1 -0
- package/src/integrations/hubspot/docs.manifest.json +5 -0
- package/src/integrations/index.ts +1 -52
- package/src/integrations/intercom/docs.manifest.json +5 -0
- package/src/integrations/jira/docs.manifest.json +5 -0
- package/src/integrations/lakebase/README.md +242 -0
- package/src/integrations/lakebase/client.ts +6 -4
- package/src/integrations/lakebase/docs.manifest.json +5 -0
- package/src/integrations/lakebase/types.ts +5 -4
- package/src/integrations/launchdarkly/README.md +2 -2
- package/src/integrations/launchdarkly/docs.manifest.json +5 -0
- package/src/integrations/mariadb/README.md +3 -3
- package/src/integrations/mariadb/client.ts +5 -3
- package/src/integrations/mariadb/docs.manifest.json +5 -0
- package/src/integrations/mariadb/types.ts +3 -2
- package/src/integrations/mistral/README.md +39 -13
- package/src/integrations/mistral/docs.manifest.json +5 -0
- package/src/integrations/mongodb/README.md +65 -12
- package/src/integrations/mongodb/client.ts +5 -3
- package/src/integrations/mongodb/docs.manifest.json +5 -0
- package/src/integrations/mongodb/types.ts +1 -0
- package/src/integrations/mssql/README.md +3 -3
- package/src/integrations/mssql/client.ts +5 -3
- package/src/integrations/mssql/docs.manifest.json +5 -0
- package/src/integrations/mssql/types.ts +3 -2
- package/src/integrations/mysql/README.md +4 -4
- package/src/integrations/mysql/client.ts +5 -3
- package/src/integrations/mysql/docs.manifest.json +5 -0
- package/src/integrations/mysql/types.ts +5 -4
- package/src/integrations/notion/docs.manifest.json +5 -0
- package/src/integrations/openai_v2/README.md +44 -116
- package/src/integrations/openai_v2/docs.manifest.json +5 -0
- package/src/integrations/openai_v2/types.ts +4 -29
- package/src/integrations/oracledb/README.md +3 -3
- package/src/integrations/oracledb/client.ts +5 -3
- package/src/integrations/oracledb/docs.manifest.json +5 -0
- package/src/integrations/oracledb/types.ts +3 -2
- package/src/integrations/pagerduty/README.md +2 -2
- package/src/integrations/pagerduty/docs.manifest.json +5 -0
- package/src/integrations/perplexity/README.md +39 -47
- package/src/integrations/perplexity/docs.manifest.json +5 -0
- package/src/integrations/postgres/client.ts +6 -4
- package/src/integrations/postgres/docs.manifest.json +5 -0
- package/src/integrations/postgres/types.ts +1 -0
- package/src/integrations/redshift/client.ts +5 -3
- package/src/integrations/redshift/docs.manifest.json +5 -0
- package/src/integrations/redshift/types.ts +1 -0
- package/src/integrations/registry.test.ts +2 -3
- package/src/integrations/registry.ts +69 -188
- package/src/integrations/restapiintegration/README.md +320 -0
- package/src/integrations/restapiintegration/docs.manifest.json +5 -0
- package/src/integrations/restapiintegration/types.ts +2 -8
- package/src/integrations/s3/client.ts +5 -3
- package/src/integrations/s3/docs.manifest.json +5 -0
- package/src/integrations/s3/types.ts +4 -1
- package/src/integrations/salesforce/README.md +11 -9
- package/src/integrations/salesforce/client.ts +3 -2
- package/src/integrations/salesforce/docs.manifest.json +5 -0
- package/src/integrations/salesforce/types.ts +1 -0
- package/src/integrations/segment/docs.manifest.json +5 -0
- package/src/integrations/sendgrid/README.md +2 -2
- package/src/integrations/sendgrid/docs.manifest.json +5 -0
- package/src/integrations/slack/README.md +62 -19
- package/src/integrations/slack/client.test.ts +553 -0
- package/src/integrations/slack/client.ts +92 -12
- package/src/integrations/slack/docs.manifest.json +5 -0
- package/src/integrations/slack/index.ts +6 -1
- package/src/integrations/slack/types.ts +142 -29
- package/src/integrations/smtp/README.md +220 -0
- package/src/integrations/smtp/client.ts +4 -2
- package/src/integrations/smtp/docs.manifest.json +5 -0
- package/src/integrations/snowflake/client.ts +7 -5
- package/src/integrations/snowflake/docs.manifest.json +5 -0
- package/src/integrations/snowflake/types.ts +1 -0
- package/src/integrations/snowflakecortex/README.md +167 -0
- package/src/integrations/snowflakecortex/client.ts +2 -3
- package/src/integrations/snowflakecortex/docs.manifest.json +5 -0
- package/src/integrations/snowflakecortex/types.ts +3 -11
- package/src/integrations/snowflakepostgres/README.md +233 -0
- package/src/integrations/snowflakepostgres/client.ts +1 -1
- package/src/integrations/snowflakepostgres/docs.manifest.json +5 -0
- package/src/integrations/snowflakepostgres/types.ts +1 -0
- package/src/integrations/stabilityai/README.md +2 -2
- package/src/integrations/stabilityai/docs.manifest.json +5 -0
- package/src/integrations/stripe/docs.manifest.json +5 -0
- package/src/integrations/superblocks-ocr/docs.manifest.json +5 -0
- package/src/integrations/twilio/docs.manifest.json +5 -0
- package/src/integrations/zendesk/docs.manifest.json +5 -0
- package/src/integrations/zoom/README.md +15 -15
- package/src/integrations/zoom/docs.manifest.json +5 -0
- package/src/runtime/context.ts +11 -11
- package/src/runtime/executor.ts +2 -2
- package/src/runtime/index.ts +1 -23
- package/src/types.ts +16 -6
- package/dist/api/streaming.d.ts +0 -229
- package/dist/api/streaming.d.ts.map +0 -1
- package/dist/api/streaming.js +0 -107
- package/dist/api/streaming.js.map +0 -1
- package/dist/api/streaming.test.d.ts +0 -5
- package/dist/api/streaming.test.d.ts.map +0 -1
- package/dist/api/streaming.test.js +0 -364
- package/dist/api/streaming.test.js.map +0 -1
- package/dist/integrations/couchbase/client.d.ts +0 -36
- package/dist/integrations/couchbase/client.d.ts.map +0 -1
- package/dist/integrations/couchbase/client.js +0 -148
- package/dist/integrations/couchbase/client.js.map +0 -1
- package/dist/integrations/couchbase/index.d.ts +0 -8
- package/dist/integrations/couchbase/index.d.ts.map +0 -1
- package/dist/integrations/couchbase/index.js +0 -7
- package/dist/integrations/couchbase/index.js.map +0 -1
- package/dist/integrations/couchbase/types.d.ts +0 -100
- package/dist/integrations/couchbase/types.d.ts.map +0 -1
- package/dist/integrations/couchbase/types.js +0 -5
- package/dist/integrations/couchbase/types.js.map +0 -1
- package/dist/integrations/kafka/client.d.ts +0 -25
- package/dist/integrations/kafka/client.d.ts.map +0 -1
- package/dist/integrations/kafka/client.js +0 -124
- package/dist/integrations/kafka/client.js.map +0 -1
- package/dist/integrations/kafka/index.d.ts +0 -8
- package/dist/integrations/kafka/index.d.ts.map +0 -1
- package/dist/integrations/kafka/index.js +0 -7
- package/dist/integrations/kafka/index.js.map +0 -1
- package/dist/integrations/kafka/types.d.ts +0 -113
- package/dist/integrations/kafka/types.d.ts.map +0 -1
- package/dist/integrations/kafka/types.js +0 -5
- package/dist/integrations/kafka/types.js.map +0 -1
- package/dist/integrations/kinesis/client.d.ts +0 -31
- package/dist/integrations/kinesis/client.d.ts.map +0 -1
- package/dist/integrations/kinesis/client.js +0 -101
- package/dist/integrations/kinesis/client.js.map +0 -1
- package/dist/integrations/kinesis/index.d.ts +0 -8
- package/dist/integrations/kinesis/index.d.ts.map +0 -1
- package/dist/integrations/kinesis/index.js +0 -7
- package/dist/integrations/kinesis/index.js.map +0 -1
- package/dist/integrations/kinesis/types.d.ts +0 -97
- package/dist/integrations/kinesis/types.d.ts.map +0 -1
- package/dist/integrations/kinesis/types.js +0 -7
- package/dist/integrations/kinesis/types.js.map +0 -1
- package/dist/integrations/python/client.d.ts +0 -42
- package/dist/integrations/python/client.d.ts.map +0 -1
- package/dist/integrations/python/client.js +0 -89
- package/dist/integrations/python/client.js.map +0 -1
- package/dist/integrations/python/client.test.d.ts +0 -5
- package/dist/integrations/python/client.test.d.ts.map +0 -1
- package/dist/integrations/python/client.test.js +0 -214
- package/dist/integrations/python/client.test.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -6
- package/dist/integrations/python/index.d.ts.map +0 -1
- package/dist/integrations/python/index.js +0 -5
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/python/types.d.ts +0 -85
- package/dist/integrations/python/types.d.ts.map +0 -1
- package/dist/integrations/python/types.js +0 -5
- package/dist/integrations/python/types.js.map +0 -1
- package/dist/integrations/redis/client.d.ts +0 -43
- package/dist/integrations/redis/client.d.ts.map +0 -1
- package/dist/integrations/redis/client.js +0 -142
- package/dist/integrations/redis/client.js.map +0 -1
- package/dist/integrations/redis/index.d.ts +0 -8
- package/dist/integrations/redis/index.d.ts.map +0 -1
- package/dist/integrations/redis/index.js +0 -7
- package/dist/integrations/redis/index.js.map +0 -1
- package/dist/integrations/redis/types.d.ts +0 -137
- package/dist/integrations/redis/types.d.ts.map +0 -1
- package/dist/integrations/redis/types.js +0 -5
- package/dist/integrations/redis/types.js.map +0 -1
- package/dist/runtime/execute.d.ts +0 -128
- package/dist/runtime/execute.d.ts.map +0 -1
- package/dist/runtime/execute.js +0 -84
- package/dist/runtime/execute.js.map +0 -1
- package/dist/runtime/streaming-context.d.ts +0 -49
- package/dist/runtime/streaming-context.d.ts.map +0 -1
- package/dist/runtime/streaming-context.js +0 -71
- package/dist/runtime/streaming-context.js.map +0 -1
- package/dist/runtime/streaming-executor.d.ts +0 -159
- package/dist/runtime/streaming-executor.d.ts.map +0 -1
- package/dist/runtime/streaming-executor.js +0 -229
- package/dist/runtime/streaming-executor.js.map +0 -1
- package/src/api/streaming.test.ts +0 -432
- package/src/api/streaming.ts +0 -302
- package/src/integrations/couchbase/README.md +0 -138
- package/src/integrations/couchbase/client.ts +0 -224
- package/src/integrations/couchbase/index.ts +0 -8
- package/src/integrations/couchbase/types.ts +0 -125
- package/src/integrations/kafka/README.md +0 -144
- package/src/integrations/kafka/client.ts +0 -215
- package/src/integrations/kafka/index.ts +0 -14
- package/src/integrations/kafka/types.ts +0 -127
- package/src/integrations/kinesis/README.md +0 -153
- package/src/integrations/kinesis/client.ts +0 -146
- package/src/integrations/kinesis/index.ts +0 -14
- package/src/integrations/kinesis/types.ts +0 -114
- package/src/integrations/python/README.md +0 -566
- package/src/integrations/python/client.test.ts +0 -340
- package/src/integrations/python/client.ts +0 -134
- package/src/integrations/python/index.ts +0 -6
- package/src/integrations/python/types.ts +0 -91
- package/src/integrations/redis/README.md +0 -200
- package/src/integrations/redis/client.ts +0 -207
- package/src/integrations/redis/index.ts +0 -8
- package/src/integrations/redis/types.ts +0 -166
- package/src/runtime/execute.ts +0 -221
- package/src/runtime/streaming-context.ts +0 -164
- package/src/runtime/streaming-executor.ts +0 -367
|
@@ -3,22 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
6
|
-
import type {
|
|
7
|
-
SupportsApiRequest,
|
|
8
|
-
SupportsStreamingApiRequest,
|
|
9
|
-
} from "../base/index.js";
|
|
6
|
+
import type { SupportsApiRequest } from "../base/index.js";
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Snowflake Cortex client for inference interactions.
|
|
13
10
|
*
|
|
14
|
-
* Provides the generic apiRequest() method for any Snowflake Cortex API endpoint
|
|
15
|
-
* and streamApiRequest() for streaming responses.
|
|
11
|
+
* Provides the generic apiRequest() method for any Snowflake Cortex API endpoint.
|
|
16
12
|
*/
|
|
17
13
|
export interface SnowflakeCortexClient
|
|
18
|
-
extends
|
|
19
|
-
BaseIntegrationClient,
|
|
20
|
-
SupportsApiRequest,
|
|
21
|
-
SupportsStreamingApiRequest {
|
|
14
|
+
extends BaseIntegrationClient, SupportsApiRequest {
|
|
22
15
|
// apiRequest() method inherited from SupportsApiRequest
|
|
23
|
-
// streamApiRequest() method inherited from SupportsStreamingApiRequest
|
|
24
16
|
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Snowflake Postgres Client
|
|
2
|
+
|
|
3
|
+
Execute SQL queries and statements against Snowflake databases using the PostgreSQL wire protocol, with full type safety and runtime validation.
|
|
4
|
+
|
|
5
|
+
Snowflake Postgres uses the same API contract as the PostgreSQL integration. If you are familiar with the Postgres client, this works identically.
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
| Method | Description |
|
|
10
|
+
| ------------------------------------------- | -------------------------------------------------------------------------- |
|
|
11
|
+
| `query<T>(sql, schema, params?, metadata?)` | Execute a SELECT query and return validated, typed results |
|
|
12
|
+
| `execute(sql, params?, metadata?)` | Execute a statement (INSERT, UPDATE, DELETE) and return affected row count |
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
### Basic Query with Schema Validation
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { api, z, snowflakePostgres } from "@superblocksteam/sdk-api";
|
|
20
|
+
|
|
21
|
+
// Integration ID from the integrations panel
|
|
22
|
+
const SNOWFLAKE_PG = "a1b2c3d4-5678-90ab-cdef-111111111111";
|
|
23
|
+
|
|
24
|
+
const SalesSchema = z.object({
|
|
25
|
+
region: z.string(),
|
|
26
|
+
total_revenue: z.string(), // NUMERIC returned as string
|
|
27
|
+
order_count: z.coerce.number(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default api({
|
|
31
|
+
name: "GetSalesByRegion",
|
|
32
|
+
integrations: {
|
|
33
|
+
db: snowflakePostgres(SNOWFLAKE_PG),
|
|
34
|
+
},
|
|
35
|
+
input: z.object({
|
|
36
|
+
region: z.string(),
|
|
37
|
+
}),
|
|
38
|
+
output: z.object({
|
|
39
|
+
sales: z.array(SalesSchema),
|
|
40
|
+
}),
|
|
41
|
+
async run(ctx, { region }) {
|
|
42
|
+
const sales = await ctx.integrations.db.query(
|
|
43
|
+
"SELECT region, total_revenue, order_count FROM sales_summary WHERE region = $1",
|
|
44
|
+
SalesSchema,
|
|
45
|
+
[region],
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return { sales };
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Executing INSERT, UPDATE, DELETE Statements
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { api, z, snowflakePostgres } from "@superblocksteam/sdk-api";
|
|
57
|
+
|
|
58
|
+
const SNOWFLAKE_PG = "a1b2c3d4-5678-90ab-cdef-111111111111";
|
|
59
|
+
|
|
60
|
+
export default api({
|
|
61
|
+
name: "ManageRecords",
|
|
62
|
+
integrations: {
|
|
63
|
+
db: snowflakePostgres(SNOWFLAKE_PG),
|
|
64
|
+
},
|
|
65
|
+
input: z.object({
|
|
66
|
+
name: z.string(),
|
|
67
|
+
email: z.string(),
|
|
68
|
+
}),
|
|
69
|
+
output: z.object({ success: z.boolean() }),
|
|
70
|
+
|
|
71
|
+
async run(ctx, { name, email }) {
|
|
72
|
+
// INSERT
|
|
73
|
+
await ctx.integrations.db.execute(
|
|
74
|
+
"INSERT INTO users (name, email) VALUES ($1, $2)",
|
|
75
|
+
[name, email],
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// UPDATE
|
|
79
|
+
const updateResult = await ctx.integrations.db.execute(
|
|
80
|
+
"UPDATE users SET last_login = CURRENT_TIMESTAMP() WHERE email = $1",
|
|
81
|
+
[email],
|
|
82
|
+
);
|
|
83
|
+
console.log(`Updated ${updateResult.rowCount} rows`);
|
|
84
|
+
|
|
85
|
+
return { success: true };
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Query with JOIN
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
const OrderSchema = z.object({
|
|
94
|
+
order_id: z.string(),
|
|
95
|
+
customer_name: z.string(),
|
|
96
|
+
total: z.string(), // NUMERIC as string
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const orders = await ctx.integrations.db.query(
|
|
100
|
+
`SELECT o.id as order_id, c.name as customer_name, o.total
|
|
101
|
+
FROM orders o
|
|
102
|
+
JOIN customers c ON o.customer_id = c.id
|
|
103
|
+
WHERE o.status = $1`,
|
|
104
|
+
OrderSchema,
|
|
105
|
+
["pending"],
|
|
106
|
+
);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Trace Metadata
|
|
110
|
+
|
|
111
|
+
All methods accept an optional `metadata` parameter as the last argument for diagnostics labeling:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
const users = await ctx.integrations.db.query(
|
|
115
|
+
"SELECT * FROM users WHERE status = $1",
|
|
116
|
+
UserSchema,
|
|
117
|
+
["active"],
|
|
118
|
+
{ label: "Fetch active users" },
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
await ctx.integrations.db.execute(
|
|
122
|
+
"DELETE FROM sessions WHERE expires_at < CURRENT_TIMESTAMP()",
|
|
123
|
+
undefined, // no params
|
|
124
|
+
{ label: "Clean expired sessions" },
|
|
125
|
+
);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
When `includeDiagnostics` is enabled, `label` and `description` appear in the trace view. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
129
|
+
|
|
130
|
+
## Common Pitfalls
|
|
131
|
+
|
|
132
|
+
### Schema Parameter is Required
|
|
133
|
+
|
|
134
|
+
The `query()` method requires a Zod schema for runtime validation:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
// WRONG - Missing schema parameter
|
|
138
|
+
const users = await ctx.integrations.db.query(
|
|
139
|
+
"SELECT * FROM users",
|
|
140
|
+
[
|
|
141
|
+
/* params */
|
|
142
|
+
], // This is wrong - params are 3rd argument
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
// CORRECT - Schema is the second parameter
|
|
146
|
+
const users = await ctx.integrations.db.query(
|
|
147
|
+
"SELECT * FROM users WHERE id = $1",
|
|
148
|
+
UserSchema, // Schema is required
|
|
149
|
+
[userId], // Params are optional, third argument
|
|
150
|
+
);
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Use Parameterized Queries to Prevent SQL Injection
|
|
154
|
+
|
|
155
|
+
Always use `$1, $2, ...` placeholders instead of string interpolation:
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
// WRONG - SQL injection vulnerability
|
|
159
|
+
const users = await ctx.integrations.db.query(
|
|
160
|
+
`SELECT * FROM users WHERE name = '${userName}'`, // DANGEROUS!
|
|
161
|
+
UserSchema,
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
// CORRECT - Use parameterized queries
|
|
165
|
+
const users = await ctx.integrations.db.query(
|
|
166
|
+
"SELECT * FROM users WHERE name = $1",
|
|
167
|
+
UserSchema,
|
|
168
|
+
[userName], // Safe - value is escaped
|
|
169
|
+
);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### NUMERIC/DECIMAL Values Returned as Strings
|
|
173
|
+
|
|
174
|
+
Large `NUMERIC` and `DECIMAL` columns are returned as strings to preserve precision:
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
// WRONG - May lose precision
|
|
178
|
+
const schema = z.object({ price: z.number() });
|
|
179
|
+
|
|
180
|
+
// CORRECT - Keep as string or transform
|
|
181
|
+
const schema = z.object({
|
|
182
|
+
price: z.string().transform((val) => parseFloat(val)),
|
|
183
|
+
});
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Aggregate Functions (COUNT, SUM) Return Strings
|
|
187
|
+
|
|
188
|
+
Use `z.coerce.number()` to convert:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
const StatsSchema = z.object({
|
|
192
|
+
total_orders: z.coerce.number(),
|
|
193
|
+
total_revenue: z.coerce.number(),
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Handling NULL Values
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
// WRONG - Will fail if column contains NULL
|
|
201
|
+
const schema = z.object({ bio: z.string() });
|
|
202
|
+
|
|
203
|
+
// CORRECT - Mark nullable columns
|
|
204
|
+
const schema = z.object({ bio: z.string().nullable() });
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Error Handling
|
|
208
|
+
|
|
209
|
+
### QueryValidationError
|
|
210
|
+
|
|
211
|
+
Thrown when query results fail schema validation:
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { QueryValidationError } from "@superblocksteam/sdk-api";
|
|
215
|
+
|
|
216
|
+
try {
|
|
217
|
+
const users = await ctx.integrations.db.query(
|
|
218
|
+
"SELECT * FROM users",
|
|
219
|
+
UserSchema,
|
|
220
|
+
);
|
|
221
|
+
} catch (error) {
|
|
222
|
+
if (error instanceof QueryValidationError) {
|
|
223
|
+
console.error("Row index:", error.details.rowIndex);
|
|
224
|
+
console.error("Validation errors:", error.details.errors);
|
|
225
|
+
console.error("Actual row data:", error.details.row);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## API Reference
|
|
231
|
+
|
|
232
|
+
- [Snowflake SQL Reference](https://docs.snowflake.com/en/sql-reference)
|
|
233
|
+
- [Snowflake Data Types](https://docs.snowflake.com/en/sql-reference/data-types)
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* implementation.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { SnowflakePostgresClient } from "./types.js";
|
|
10
9
|
import { PostgresClientImpl } from "../postgres/client.js";
|
|
10
|
+
import type { SnowflakePostgresClient } from "./types.js";
|
|
11
11
|
|
|
12
12
|
export class SnowflakePostgresClientImpl
|
|
13
13
|
extends PostgresClientImpl
|
|
@@ -13,7 +13,7 @@ Generate, edit, and upscale images using Stability AI's image generation models.
|
|
|
13
13
|
### Generate an Image (Text-to-Image)
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { api, z,
|
|
16
|
+
import { api, z, stabilityAI } from "@superblocksteam/sdk-api";
|
|
17
17
|
|
|
18
18
|
// Integration ID from the integrations panel
|
|
19
19
|
const PROD_STABILITY = "a1b2c3d4-5678-90ab-cdef-stabilit0001";
|
|
@@ -30,7 +30,7 @@ const GenerationResponseSchema = z.object({
|
|
|
30
30
|
|
|
31
31
|
export default api({
|
|
32
32
|
integrations: {
|
|
33
|
-
stability:
|
|
33
|
+
stability: stabilityAI(PROD_STABILITY),
|
|
34
34
|
},
|
|
35
35
|
name: "StabilityAIExample",
|
|
36
36
|
input: z.object({
|
|
@@ -50,7 +50,7 @@ export default api({
|
|
|
50
50
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
51
51
|
{
|
|
52
52
|
method: "POST",
|
|
53
|
-
path: "/
|
|
53
|
+
path: "/users/me/meetings",
|
|
54
54
|
body: {
|
|
55
55
|
topic: topic,
|
|
56
56
|
type: 2, // Scheduled meeting
|
|
@@ -99,7 +99,7 @@ const ListMeetingsResponseSchema = z.object({
|
|
|
99
99
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
100
100
|
{
|
|
101
101
|
method: "GET",
|
|
102
|
-
path: "/
|
|
102
|
+
path: "/users/me/meetings",
|
|
103
103
|
params: {
|
|
104
104
|
type: "scheduled", // upcoming, live, scheduled
|
|
105
105
|
page_size: 30,
|
|
@@ -137,7 +137,7 @@ const MeetingDetailSchema = z.object({
|
|
|
137
137
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
138
138
|
{
|
|
139
139
|
method: "GET",
|
|
140
|
-
path: `/
|
|
140
|
+
path: `/meetings/${meetingId}`,
|
|
141
141
|
},
|
|
142
142
|
{ response: MeetingDetailSchema },
|
|
143
143
|
);
|
|
@@ -149,7 +149,7 @@ const result = await ctx.integrations.zoom.apiRequest(
|
|
|
149
149
|
await ctx.integrations.zoom.apiRequest(
|
|
150
150
|
{
|
|
151
151
|
method: "PATCH",
|
|
152
|
-
path: `/
|
|
152
|
+
path: `/meetings/${meetingId}`,
|
|
153
153
|
body: {
|
|
154
154
|
topic: "Updated Meeting Topic",
|
|
155
155
|
duration: 60,
|
|
@@ -168,7 +168,7 @@ await ctx.integrations.zoom.apiRequest(
|
|
|
168
168
|
await ctx.integrations.zoom.apiRequest(
|
|
169
169
|
{
|
|
170
170
|
method: "DELETE",
|
|
171
|
-
path: `/
|
|
171
|
+
path: `/meetings/${meetingId}`,
|
|
172
172
|
params: {
|
|
173
173
|
schedule_for_reminder: true,
|
|
174
174
|
},
|
|
@@ -196,7 +196,7 @@ const WebinarSchema = z.object({
|
|
|
196
196
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
197
197
|
{
|
|
198
198
|
method: "POST",
|
|
199
|
-
path: "/
|
|
199
|
+
path: "/users/me/webinars",
|
|
200
200
|
body: {
|
|
201
201
|
topic: "Product Launch Webinar",
|
|
202
202
|
type: 5, // Scheduled webinar
|
|
@@ -234,7 +234,7 @@ const UserSchema = z.object({
|
|
|
234
234
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
235
235
|
{
|
|
236
236
|
method: "GET",
|
|
237
|
-
path: "/
|
|
237
|
+
path: "/users/me",
|
|
238
238
|
},
|
|
239
239
|
{ response: UserSchema },
|
|
240
240
|
);
|
|
@@ -265,7 +265,7 @@ const ListUsersResponseSchema = z.object({
|
|
|
265
265
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
266
266
|
{
|
|
267
267
|
method: "GET",
|
|
268
|
-
path: "/
|
|
268
|
+
path: "/users",
|
|
269
269
|
params: {
|
|
270
270
|
status: "active",
|
|
271
271
|
page_size: 30,
|
|
@@ -289,7 +289,7 @@ const RegistrantSchema = z.object({
|
|
|
289
289
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
290
290
|
{
|
|
291
291
|
method: "POST",
|
|
292
|
-
path: `/
|
|
292
|
+
path: `/meetings/${meetingId}/registrants`,
|
|
293
293
|
body: {
|
|
294
294
|
email: "attendee@example.com",
|
|
295
295
|
first_name: "John",
|
|
@@ -316,7 +316,7 @@ await zoom.listMeetings();
|
|
|
316
316
|
|
|
317
317
|
// CORRECT - Use apiRequest
|
|
318
318
|
await ctx.integrations.zoom.apiRequest(
|
|
319
|
-
{ method: "POST", path: "/
|
|
319
|
+
{ method: "POST", path: "/users/me/meetings", body: { ... } },
|
|
320
320
|
{ response: MeetingSchema }
|
|
321
321
|
);
|
|
322
322
|
```
|
|
@@ -346,10 +346,10 @@ Use "me" for the authenticated user:
|
|
|
346
346
|
|
|
347
347
|
```typescript
|
|
348
348
|
// Current user's meetings
|
|
349
|
-
const path = "/
|
|
349
|
+
const path = "/users/me/meetings";
|
|
350
350
|
|
|
351
351
|
// Specific user's meetings (requires admin scope)
|
|
352
|
-
const path = `/
|
|
352
|
+
const path = `/users/${userId}/meetings`;
|
|
353
353
|
```
|
|
354
354
|
|
|
355
355
|
### Date/Time Format
|
|
@@ -372,7 +372,7 @@ Many operations return empty responses:
|
|
|
372
372
|
```typescript
|
|
373
373
|
// PATCH and DELETE often return 204 No Content
|
|
374
374
|
await ctx.integrations.zoom.apiRequest(
|
|
375
|
-
{ method: "PATCH", path: `/
|
|
375
|
+
{ method: "PATCH", path: `/meetings/${id}`, body: { ... } },
|
|
376
376
|
{ response: z.object({}).optional() } // Handle empty response
|
|
377
377
|
);
|
|
378
378
|
```
|
|
@@ -415,7 +415,7 @@ async function getAllMeetings(zoom: ZoomClient) {
|
|
|
415
415
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
416
416
|
{
|
|
417
417
|
method: "GET",
|
|
418
|
-
path: "/
|
|
418
|
+
path: "/users/me/meetings",
|
|
419
419
|
params: {
|
|
420
420
|
page_size: 300,
|
|
421
421
|
page_number: pageNumber,
|
|
@@ -441,7 +441,7 @@ import { RestApiValidationError } from "@superblocksteam/sdk-api";
|
|
|
441
441
|
|
|
442
442
|
try {
|
|
443
443
|
const result = await ctx.integrations.zoom.apiRequest(
|
|
444
|
-
{ method: "POST", path: "/
|
|
444
|
+
{ method: "POST", path: "/users/me/meetings", body: { ... } },
|
|
445
445
|
{ response: MeetingSchema }
|
|
446
446
|
);
|
|
447
447
|
} catch (error) {
|
package/src/runtime/context.ts
CHANGED
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
* providing access to integrations, logging, and environment.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {
|
|
9
|
-
ApiContext,
|
|
10
|
-
ApiUser,
|
|
11
|
-
Logger,
|
|
12
|
-
AnyIntegrationRef,
|
|
13
|
-
} from "../types.js";
|
|
14
|
-
import type {
|
|
15
|
-
IntegrationConfig,
|
|
16
|
-
IntegrationClientImpl,
|
|
17
|
-
} from "../integrations/types.js";
|
|
18
8
|
import type { IntegrationDeclaration } from "../integrations/declarations.js";
|
|
19
9
|
import {
|
|
20
10
|
createClient,
|
|
21
11
|
type QueryExecutor,
|
|
22
12
|
type TraceMetadata,
|
|
23
13
|
} from "../integrations/registry.js";
|
|
14
|
+
import type {
|
|
15
|
+
IntegrationConfig,
|
|
16
|
+
IntegrationClientImpl,
|
|
17
|
+
} from "../integrations/types.js";
|
|
18
|
+
import type {
|
|
19
|
+
ApiContext,
|
|
20
|
+
ApiUser,
|
|
21
|
+
Logger,
|
|
22
|
+
AnyIntegrationRef,
|
|
23
|
+
} from "../types.js";
|
|
24
24
|
import { createDefaultLogger } from "./logger.js";
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -41,7 +41,7 @@ export interface CreateContextOptions {
|
|
|
41
41
|
/**
|
|
42
42
|
* Function to execute integration operations.
|
|
43
43
|
*
|
|
44
|
-
* For language plugins (
|
|
44
|
+
* For language plugins (JavaScript), pass the bindings parameter
|
|
45
45
|
* to the API execution request as `input` field for binding resolution.
|
|
46
46
|
*/
|
|
47
47
|
executeQuery: (
|
package/src/runtime/executor.ts
CHANGED
|
@@ -46,13 +46,13 @@ export interface ExecuteApiRequest {
|
|
|
46
46
|
* The request object should match the protobuf Plugin schema for the
|
|
47
47
|
* specific integration type (e.g., postgresql.v1.Plugin for Postgres).
|
|
48
48
|
*
|
|
49
|
-
* For language plugins (
|
|
49
|
+
* For language plugins (JavaScript), the bindings parameter should be
|
|
50
50
|
* passed to the API execution request as `input` or `inputs` field for
|
|
51
51
|
* binding resolution.
|
|
52
52
|
*
|
|
53
53
|
* @param integrationId - The integration ID
|
|
54
54
|
* @param request - Plugin-specific request object matching the proto schema
|
|
55
|
-
* @param bindings - Optional bindings data for binding resolution (e.g.,
|
|
55
|
+
* @param bindings - Optional bindings data for binding resolution (e.g., JavaScript bindings)
|
|
56
56
|
* @returns Promise resolving to the operation result
|
|
57
57
|
*/
|
|
58
58
|
executeQuery: (
|
package/src/runtime/index.ts
CHANGED
|
@@ -5,15 +5,7 @@
|
|
|
5
5
|
* including context creation, validation, and error handling.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
//
|
|
9
|
-
export {
|
|
10
|
-
execute,
|
|
11
|
-
isStreamingApi,
|
|
12
|
-
type UnifiedExecuteApiRequest,
|
|
13
|
-
type AnyCompiledApi,
|
|
14
|
-
} from "./execute.js";
|
|
15
|
-
|
|
16
|
-
// Main executor (for non-streaming APIs)
|
|
8
|
+
// Main executor
|
|
17
9
|
export {
|
|
18
10
|
executeApi,
|
|
19
11
|
type ExecuteApiRequest,
|
|
@@ -22,22 +14,8 @@ export {
|
|
|
22
14
|
type ExecuteApiErrorResponse,
|
|
23
15
|
} from "./executor.js";
|
|
24
16
|
|
|
25
|
-
// Streaming executor (for streaming APIs)
|
|
26
|
-
export {
|
|
27
|
-
executeStreamingApi,
|
|
28
|
-
createStreamingApiGenerator,
|
|
29
|
-
type ExecuteStreamingApiRequest,
|
|
30
|
-
type StreamingApiCallbacks,
|
|
31
|
-
type StreamingApiError,
|
|
32
|
-
type ExecuteStreamingApiResult,
|
|
33
|
-
} from "./streaming-executor.js";
|
|
34
|
-
|
|
35
17
|
// Context factories
|
|
36
18
|
export { createApiContext, type CreateContextOptions } from "./context.js";
|
|
37
|
-
export {
|
|
38
|
-
createStreamingApiContext,
|
|
39
|
-
type CreateStreamingContextOptions,
|
|
40
|
-
} from "./streaming-context.js";
|
|
41
19
|
|
|
42
20
|
// Error types
|
|
43
21
|
export {
|
package/src/types.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { z } from "zod";
|
|
8
|
+
|
|
8
9
|
import type {
|
|
9
10
|
IntegrationRef,
|
|
10
11
|
AnyIntegrationRef,
|
|
@@ -43,10 +44,13 @@ import type {
|
|
|
43
44
|
* if (users.length === 0) {
|
|
44
45
|
* throw new Error('User not found');
|
|
45
46
|
* }
|
|
46
|
-
* await ctx.integrations.notifier.
|
|
47
|
-
* channel: '#alerts',
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* const notifyResult = await ctx.integrations.notifier.apiRequest(
|
|
48
|
+
* { method: 'POST', path: '/chat.postMessage', body: { channel: '#alerts', text: `Fetched user ${users[0].name}` } },
|
|
49
|
+
* { response: z.object({ channel: z.string(), ts: z.string() }) }
|
|
50
|
+
* );
|
|
51
|
+
* if (!notifyResult.ok) {
|
|
52
|
+
* throw new Error(`Slack API error: ${notifyResult.error}`);
|
|
53
|
+
* }
|
|
50
54
|
* return { user: users[0] };
|
|
51
55
|
* },
|
|
52
56
|
* });
|
|
@@ -85,7 +89,7 @@ export interface ApiConfig<
|
|
|
85
89
|
* ```typescript
|
|
86
90
|
* integrations: {
|
|
87
91
|
* db: postgres('Production Postgres'),
|
|
88
|
-
* cache:
|
|
92
|
+
* cache: mongodb('Cache MongoDB'),
|
|
89
93
|
* }
|
|
90
94
|
* ```
|
|
91
95
|
*/
|
|
@@ -161,7 +165,13 @@ export interface ApiContext<
|
|
|
161
165
|
* const users = await ctx.integrations.db.query('SELECT * FROM users', UserSchema);
|
|
162
166
|
*
|
|
163
167
|
* // ctx.integrations.notifier is SlackClient
|
|
164
|
-
* await ctx.integrations.notifier.
|
|
168
|
+
* const notifyResult = await ctx.integrations.notifier.apiRequest(
|
|
169
|
+
* { method: 'POST', path: '/chat.postMessage', body: { channel: '#alerts', text: 'Hello!' } },
|
|
170
|
+
* { response: z.object({ channel: z.string(), ts: z.string() }) }
|
|
171
|
+
* );
|
|
172
|
+
* if (!notifyResult.ok) {
|
|
173
|
+
* throw new Error(`Slack API error: ${notifyResult.error}`);
|
|
174
|
+
* }
|
|
165
175
|
* ```
|
|
166
176
|
*/
|
|
167
177
|
readonly integrations: IntegrationsMap<TIntegrations>;
|