@superblocksteam/sdk-api 0.0.6 → 0.0.8
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 +118 -0
- package/dist/integrations/base/rest-api-client-base.js.map +1 -0
- package/dist/integrations/base/rest-api-integration-client.d.ts +18 -66
- package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.js +38 -173
- package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
- package/dist/integrations/base/types.d.ts +59 -59
- package/dist/integrations/base/types.d.ts.map +1 -1
- package/dist/integrations/base/types.js +23 -1
- package/dist/integrations/base/types.js.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 +774 -0
- package/dist/integrations/documentation-resolver.test.js.map +1 -0
- package/dist/integrations/documentation.d.ts +9 -0
- package/dist/integrations/documentation.d.ts.map +1 -0
- package/dist/integrations/documentation.js +300 -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 +1 -8
- 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/client.test.d.ts +12 -0
- package/dist/integrations/restapiintegration/client.test.d.ts.map +1 -0
- package/dist/integrations/restapiintegration/client.test.js +236 -0
- package/dist/integrations/restapiintegration/client.test.js.map +1 -0
- 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 +7 -7
- 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 +3 -3
- package/src/integrations/base/rest-api-client-base.ts +158 -0
- package/src/integrations/base/rest-api-integration-client.ts +62 -237
- package/src/integrations/base/types.ts +68 -64
- 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 +893 -0
- package/src/integrations/documentation.test.ts +120 -0
- package/src/integrations/documentation.ts +473 -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 +10 -0
- package/src/integrations/graphql/overlays/dynamic-headers.md +34 -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 +7 -5
- 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/client.test.ts +359 -0
- package/src/integrations/restapiintegration/docs.manifest.json +14 -0
- package/src/integrations/restapiintegration/overlays/response-types-unsupported.md +5 -0
- package/src/integrations/restapiintegration/overlays/response-types.md +26 -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
package/src/index.ts
CHANGED
|
@@ -38,10 +38,14 @@
|
|
|
38
38
|
* throw new Error('User not found');
|
|
39
39
|
* }
|
|
40
40
|
*
|
|
41
|
-
* await ctx.integrations.notifier.
|
|
42
|
-
* channel: '#user-lookups',
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* const notifyResult = await ctx.integrations.notifier.apiRequest(
|
|
42
|
+
* { method: 'POST', path: '/chat.postMessage', body: { channel: '#user-lookups', text: `Fetched user ${user.name}` } },
|
|
43
|
+
* { response: z.object({ channel: z.string(), ts: z.string() }) }
|
|
44
|
+
* );
|
|
45
|
+
*
|
|
46
|
+
* if (!notifyResult.ok) {
|
|
47
|
+
* throw new Error(`Slack API error: ${notifyResult.error}`);
|
|
48
|
+
* }
|
|
45
49
|
*
|
|
46
50
|
* return { user };
|
|
47
51
|
* },
|
|
@@ -59,16 +63,7 @@ export { fileRefSchema, readableFileSchema } from "./files.js";
|
|
|
59
63
|
export type { FileRef, ReadableFile } from "./files.js";
|
|
60
64
|
|
|
61
65
|
// API definition and registry
|
|
62
|
-
export {
|
|
63
|
-
api,
|
|
64
|
-
__setEntryPoint,
|
|
65
|
-
type CompiledApi,
|
|
66
|
-
// Streaming API support
|
|
67
|
-
streamingApi,
|
|
68
|
-
isStreamingApi,
|
|
69
|
-
type StreamingApiConfig,
|
|
70
|
-
type CompiledStreamingApi,
|
|
71
|
-
} from "./api/index.js";
|
|
66
|
+
export { api, __setEntryPoint, type CompiledApi } from "./api/index.js";
|
|
72
67
|
|
|
73
68
|
// Type extraction utilities
|
|
74
69
|
export type { ExtractApiInput, ExtractApiOutput } from "./api/definition.js";
|
|
@@ -138,20 +133,13 @@ export {
|
|
|
138
133
|
mongodb,
|
|
139
134
|
dynamodb,
|
|
140
135
|
cosmosdb,
|
|
141
|
-
couchbase,
|
|
142
136
|
s3,
|
|
143
137
|
gcs,
|
|
144
138
|
googleSheets,
|
|
145
|
-
kafka,
|
|
146
|
-
kinesis,
|
|
147
139
|
salesforce,
|
|
148
|
-
redis,
|
|
149
140
|
superblocksOcr,
|
|
150
|
-
python,
|
|
151
141
|
restApiIntegration,
|
|
152
142
|
getIntegrationDeclarations,
|
|
153
|
-
confluent,
|
|
154
|
-
redpanda,
|
|
155
143
|
lakebase,
|
|
156
144
|
snowflakePostgres,
|
|
157
145
|
smtp,
|
|
@@ -208,19 +196,12 @@ export {
|
|
|
208
196
|
type MongoDBRef,
|
|
209
197
|
type DynamoDBRef,
|
|
210
198
|
type CosmosDBRef,
|
|
211
|
-
type CouchbaseRef,
|
|
212
199
|
type S3Ref,
|
|
213
200
|
type GCSRef,
|
|
214
201
|
type GoogleSheetsRef,
|
|
215
|
-
type KafkaRef,
|
|
216
|
-
type KinesisRef,
|
|
217
202
|
type SalesforceRef,
|
|
218
|
-
type RedisRef,
|
|
219
203
|
type SuperblocksOCRRef,
|
|
220
|
-
type PythonRef,
|
|
221
204
|
type RestApiIntegrationRef,
|
|
222
|
-
type ConfluentRef,
|
|
223
|
-
type RedpandaRef,
|
|
224
205
|
type LakebaseRef,
|
|
225
206
|
type SnowflakePostgresRef,
|
|
226
207
|
type SmtpRef,
|
|
@@ -228,7 +209,11 @@ export {
|
|
|
228
209
|
|
|
229
210
|
// Integration client types (for advanced use cases)
|
|
230
211
|
export type { PostgresClient } from "./integrations/postgres/index.js";
|
|
231
|
-
export type {
|
|
212
|
+
export type {
|
|
213
|
+
SlackClient,
|
|
214
|
+
SlackResponse,
|
|
215
|
+
SlackErrorResponse,
|
|
216
|
+
} from "./integrations/slack/index.js";
|
|
232
217
|
export type { SnowflakeClient } from "./integrations/snowflake/index.js";
|
|
233
218
|
export type { SnowflakeCortexClient } from "./integrations/snowflakecortex/index.js";
|
|
234
219
|
export type { AirtableClient } from "./integrations/airtable/index.js";
|
|
@@ -268,29 +253,15 @@ export type {
|
|
|
268
253
|
DynamoDBAttributeValue,
|
|
269
254
|
} from "./integrations/dynamodb/index.js";
|
|
270
255
|
export type { CosmosDBClient } from "./integrations/cosmosdb/index.js";
|
|
271
|
-
export type {
|
|
272
|
-
CouchbaseClient,
|
|
273
|
-
CouchbaseIdentifier,
|
|
274
|
-
} from "./integrations/couchbase/index.js";
|
|
275
|
-
export type {
|
|
276
|
-
KinesisClient,
|
|
277
|
-
KinesisPutParams,
|
|
278
|
-
KinesisGetParams,
|
|
279
|
-
KinesisStreamIdentifier,
|
|
280
|
-
KinesisShardIteratorType,
|
|
281
|
-
} from "./integrations/kinesis/index.js";
|
|
282
256
|
export type {
|
|
283
257
|
SalesforceClient,
|
|
284
258
|
SalesforceCrudAction,
|
|
285
259
|
SalesforceBulkAction,
|
|
286
260
|
} from "./integrations/salesforce/index.js";
|
|
287
|
-
export type { RedisClient } from "./integrations/redis/index.js";
|
|
288
|
-
export type { KafkaClient } from "./integrations/kafka/index.js";
|
|
289
261
|
export type { S3Client } from "./integrations/s3/index.js";
|
|
290
262
|
export type { GCSClient } from "./integrations/gcs/index.js";
|
|
291
263
|
export type { GoogleSheetsClient } from "./integrations/gsheets/index.js";
|
|
292
264
|
export type { SuperblocksOCRClient } from "./integrations/superblocks-ocr/index.js";
|
|
293
|
-
export type { PythonClient } from "./integrations/python/index.js";
|
|
294
265
|
export type { RestApiIntegrationPluginClient } from "./integrations/restapiintegration/index.js";
|
|
295
266
|
export type { LakebaseClient } from "./integrations/lakebase/index.js";
|
|
296
267
|
export type { SnowflakePostgresClient } from "./integrations/snowflakepostgres/index.js";
|
|
@@ -298,15 +269,10 @@ export type { SmtpClient, SmtpSendOptions } from "./integrations/smtp/index.js";
|
|
|
298
269
|
|
|
299
270
|
// Runtime (for orchestrator use)
|
|
300
271
|
export {
|
|
301
|
-
//
|
|
302
|
-
execute,
|
|
303
|
-
// Legacy executors (still available for specific use cases)
|
|
272
|
+
// Executor
|
|
304
273
|
executeApi,
|
|
305
|
-
executeStreamingApi,
|
|
306
|
-
createStreamingApiGenerator,
|
|
307
274
|
// Context factories
|
|
308
275
|
createApiContext,
|
|
309
|
-
createStreamingApiContext,
|
|
310
276
|
// Error types
|
|
311
277
|
SdkError,
|
|
312
278
|
InputValidationError,
|
|
@@ -318,21 +284,12 @@ export {
|
|
|
318
284
|
} from "./runtime/index.js";
|
|
319
285
|
|
|
320
286
|
export type {
|
|
321
|
-
// Unified types (recommended)
|
|
322
|
-
UnifiedExecuteApiRequest,
|
|
323
|
-
AnyCompiledApi,
|
|
324
|
-
// Legacy types (still available)
|
|
325
287
|
ExecuteApiRequest,
|
|
326
288
|
ExecuteApiResponse,
|
|
327
289
|
ExecuteApiSuccessResponse,
|
|
328
290
|
ExecuteApiErrorResponse,
|
|
329
|
-
ExecuteStreamingApiRequest,
|
|
330
|
-
StreamingApiCallbacks,
|
|
331
|
-
StreamingApiError,
|
|
332
|
-
ExecuteStreamingApiResult,
|
|
333
291
|
// Context types
|
|
334
292
|
CreateContextOptions,
|
|
335
|
-
CreateStreamingContextOptions,
|
|
336
293
|
ErrorCodeType,
|
|
337
294
|
} from "./runtime/index.js";
|
|
338
295
|
|
|
@@ -341,6 +298,7 @@ export {
|
|
|
341
298
|
createClient,
|
|
342
299
|
isPluginSupported,
|
|
343
300
|
SUPPORTED_PLUGINS,
|
|
301
|
+
SUPPORTED_PLUGIN_IDS,
|
|
344
302
|
} from "./integrations/index.js";
|
|
345
303
|
|
|
346
304
|
export type {
|
|
@@ -348,16 +306,17 @@ export type {
|
|
|
348
306
|
IntegrationClientImpl,
|
|
349
307
|
SupportedPluginId,
|
|
350
308
|
QueryExecutor,
|
|
351
|
-
StreamingQueryExecutor,
|
|
352
309
|
TraceMetadata,
|
|
353
310
|
CreateClientOptions,
|
|
354
311
|
} from "./integrations/index.js";
|
|
355
312
|
|
|
313
|
+
// resolveIntegrationDocumentation is intentionally NOT re-exported here.
|
|
314
|
+
// It uses node:fs which is incompatible with browser bundles (Vite dev server).
|
|
315
|
+
// Import directly from "@superblocksteam/sdk-api/dist/integrations/documentation.js" instead.
|
|
316
|
+
|
|
356
317
|
// SDK-level error types
|
|
357
318
|
export {
|
|
358
319
|
RestApiValidationError,
|
|
359
320
|
QueryValidationError,
|
|
360
321
|
CodeExecutionError,
|
|
361
|
-
StreamChunkValidationError,
|
|
362
|
-
StreamError,
|
|
363
322
|
} from "./errors.js";
|
|
@@ -4,10 +4,9 @@ Interact with Anthropic's Claude API for powerful AI conversations and text gene
|
|
|
4
4
|
|
|
5
5
|
## Methods
|
|
6
6
|
|
|
7
|
-
| Method
|
|
8
|
-
|
|
|
9
|
-
| `apiRequest(options, schema, metadata?)`
|
|
10
|
-
| `streamApiRequest(options, schema, metadata?)` | Stream responses with real-time chunk validation |
|
|
7
|
+
| Method | Description |
|
|
8
|
+
| ---------------------------------------- | ----------------------------------------------------- |
|
|
9
|
+
| `apiRequest(options, schema, metadata?)` | Make any Anthropic API request with schema validation |
|
|
11
10
|
|
|
12
11
|
## Usage
|
|
13
12
|
|
|
@@ -242,89 +241,6 @@ const result = await ctx.integrations.ai.apiRequest(
|
|
|
242
241
|
);
|
|
243
242
|
```
|
|
244
243
|
|
|
245
|
-
### Streaming Messages
|
|
246
|
-
|
|
247
|
-
For real-time token streaming, use `streamApiRequest()` with `stream: true`:
|
|
248
|
-
|
|
249
|
-
```typescript
|
|
250
|
-
import { streamingApi, z, anthropic } from "@superblocksteam/sdk-api";
|
|
251
|
-
|
|
252
|
-
// Integration ID from the integrations panel
|
|
253
|
-
const PROD_ANTHROPIC = "a1b2c3d4-5678-90ab-cdef-444444444444";
|
|
254
|
-
|
|
255
|
-
// Schema for Anthropic's streaming SSE events
|
|
256
|
-
const AnthropicStreamEventSchema = z.discriminatedUnion("type", [
|
|
257
|
-
z.object({
|
|
258
|
-
type: z.literal("content_block_delta"),
|
|
259
|
-
index: z.number(),
|
|
260
|
-
delta: z.object({
|
|
261
|
-
type: z.literal("text_delta"),
|
|
262
|
-
text: z.string(),
|
|
263
|
-
}),
|
|
264
|
-
}),
|
|
265
|
-
z.object({ type: z.literal("message_start"), message: z.any() }),
|
|
266
|
-
z.object({
|
|
267
|
-
type: z.literal("content_block_start"),
|
|
268
|
-
index: z.number(),
|
|
269
|
-
content_block: z.any(),
|
|
270
|
-
}),
|
|
271
|
-
z.object({ type: z.literal("content_block_stop"), index: z.number() }),
|
|
272
|
-
z.object({
|
|
273
|
-
type: z.literal("message_delta"),
|
|
274
|
-
delta: z.any(),
|
|
275
|
-
usage: z.any(),
|
|
276
|
-
}),
|
|
277
|
-
z.object({ type: z.literal("message_stop") }),
|
|
278
|
-
z.object({ type: z.literal("ping") }),
|
|
279
|
-
]);
|
|
280
|
-
|
|
281
|
-
export default streamingApi({
|
|
282
|
-
integrations: {
|
|
283
|
-
ai: anthropic(PROD_ANTHROPIC),
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
input: z.object({ prompt: z.string() }),
|
|
287
|
-
chunk: z.object({ type: z.literal("text"), text: z.string() }),
|
|
288
|
-
|
|
289
|
-
async *run(ctx, { prompt }) {
|
|
290
|
-
const stream = ctx.integrations.ai.streamApiRequest(
|
|
291
|
-
{
|
|
292
|
-
method: "POST",
|
|
293
|
-
path: "/v1/messages",
|
|
294
|
-
body: {
|
|
295
|
-
model: "claude-3-5-sonnet-20241022",
|
|
296
|
-
max_tokens: 1024,
|
|
297
|
-
stream: true, // Enable streaming
|
|
298
|
-
messages: [{ role: "user", content: prompt }],
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
{ chunk: AnthropicStreamEventSchema },
|
|
302
|
-
);
|
|
303
|
-
|
|
304
|
-
// Yield text chunks as they arrive
|
|
305
|
-
for await (const event of stream) {
|
|
306
|
-
if (event.type === "content_block_delta") {
|
|
307
|
-
yield { type: "text" as const, text: event.delta.text };
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
});
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
#### Streaming Event Types
|
|
315
|
-
|
|
316
|
-
Claude's streaming API sends these event types:
|
|
317
|
-
|
|
318
|
-
| Event Type | Description |
|
|
319
|
-
| --------------------- | ------------------------------------------- |
|
|
320
|
-
| `message_start` | Initial message metadata (model, id, usage) |
|
|
321
|
-
| `content_block_start` | Start of a content block (text, tool_use) |
|
|
322
|
-
| `content_block_delta` | Incremental text or tool input |
|
|
323
|
-
| `content_block_stop` | End of a content block |
|
|
324
|
-
| `message_delta` | Final message metadata (stop_reason, usage) |
|
|
325
|
-
| `message_stop` | Stream complete |
|
|
326
|
-
| `ping` | Keep-alive ping |
|
|
327
|
-
|
|
328
244
|
## Trace Metadata
|
|
329
245
|
|
|
330
246
|
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.
|
|
@@ -333,7 +249,7 @@ All methods accept an optional `metadata` parameter as the last argument for dia
|
|
|
333
249
|
|
|
334
250
|
### No Specialized Methods
|
|
335
251
|
|
|
336
|
-
The Anthropic client only provides `apiRequest()
|
|
252
|
+
The Anthropic client only provides `apiRequest()`. There are no other specialized methods:
|
|
337
253
|
|
|
338
254
|
```typescript
|
|
339
255
|
// WRONG - These methods do not exist
|
|
@@ -474,7 +390,7 @@ const result = await ctx.integrations.ai.apiRequest(
|
|
|
474
390
|
## Error Handling
|
|
475
391
|
|
|
476
392
|
```typescript
|
|
477
|
-
import { RestApiValidationError
|
|
393
|
+
import { RestApiValidationError } from "@superblocksteam/sdk-api";
|
|
478
394
|
|
|
479
395
|
try {
|
|
480
396
|
const result = await ctx.integrations.ai.apiRequest(
|
|
@@ -487,18 +403,6 @@ try {
|
|
|
487
403
|
console.error("Actual response:", error.details.data);
|
|
488
404
|
}
|
|
489
405
|
}
|
|
490
|
-
|
|
491
|
-
// For streaming requests
|
|
492
|
-
try {
|
|
493
|
-
for await (const chunk of stream) {
|
|
494
|
-
// Process chunk
|
|
495
|
-
}
|
|
496
|
-
} catch (error) {
|
|
497
|
-
if (error instanceof StreamChunkValidationError) {
|
|
498
|
-
console.error("Chunk validation failed at index:", error.details.chunkIndex);
|
|
499
|
-
console.error("Raw chunk:", error.details.chunk);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
406
|
```
|
|
503
407
|
|
|
504
408
|
## API Reference
|
|
@@ -3,16 +3,12 @@
|
|
|
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
|
* Anthropic client for Claude AI model interactions.
|
|
13
10
|
*
|
|
14
|
-
* Provides the generic apiRequest() method for any Anthropic API endpoint
|
|
15
|
-
* and streamApiRequest() for streaming responses.
|
|
11
|
+
* Provides the generic apiRequest() method for any Anthropic API endpoint.
|
|
16
12
|
* Use this to interact with Anthropic's messages API and other endpoints.
|
|
17
13
|
*
|
|
18
14
|
* @example
|
|
@@ -58,31 +54,9 @@ import type {
|
|
|
58
54
|
* }
|
|
59
55
|
* );
|
|
60
56
|
*
|
|
61
|
-
* // Or use streaming for real-time responses
|
|
62
|
-
* const stream = anthropic.streamApiRequest(
|
|
63
|
-
* {
|
|
64
|
-
* method: 'POST',
|
|
65
|
-
* path: '/v1/messages',
|
|
66
|
-
* body: {
|
|
67
|
-
* model: 'claude-3-5-sonnet-20241022',
|
|
68
|
-
* max_tokens: 1024,
|
|
69
|
-
* stream: true,
|
|
70
|
-
* messages: [{ role: 'user', content: 'Hello!' }],
|
|
71
|
-
* },
|
|
72
|
-
* },
|
|
73
|
-
* { chunk: StreamEventSchema }
|
|
74
|
-
* );
|
|
75
|
-
*
|
|
76
|
-
* for await (const event of stream) {
|
|
77
|
-
* // Handle streaming events
|
|
78
|
-
* }
|
|
79
57
|
* ```
|
|
80
58
|
*/
|
|
81
59
|
export interface AnthropicClient
|
|
82
|
-
extends
|
|
83
|
-
BaseIntegrationClient,
|
|
84
|
-
SupportsApiRequest,
|
|
85
|
-
SupportsStreamingApiRequest {
|
|
60
|
+
extends BaseIntegrationClient, SupportsApiRequest {
|
|
86
61
|
// apiRequest() method inherited from SupportsApiRequest
|
|
87
|
-
// streamApiRequest() method inherited from SupportsStreamingApiRequest
|
|
88
62
|
}
|
|
@@ -49,7 +49,7 @@ export default api({
|
|
|
49
49
|
const result = await ctx.integrations.asana.apiRequest(
|
|
50
50
|
{
|
|
51
51
|
method: "POST",
|
|
52
|
-
path: "/
|
|
52
|
+
path: "/tasks",
|
|
53
53
|
body: {
|
|
54
54
|
data: {
|
|
55
55
|
name: name,
|
|
@@ -88,7 +88,7 @@ const ListTasksResponseSchema = z.object({
|
|
|
88
88
|
const result = await ctx.integrations.asana.apiRequest(
|
|
89
89
|
{
|
|
90
90
|
method: "GET",
|
|
91
|
-
path: `/
|
|
91
|
+
path: `/projects/${projectId}/tasks`,
|
|
92
92
|
params: {
|
|
93
93
|
opt_fields: "name,completed,due_on,assignee.name",
|
|
94
94
|
completed_since: "now", // Only incomplete tasks
|
|
@@ -108,7 +108,7 @@ result.data.forEach((task) => {
|
|
|
108
108
|
const result = await ctx.integrations.asana.apiRequest(
|
|
109
109
|
{
|
|
110
110
|
method: "PUT",
|
|
111
|
-
path: `/
|
|
111
|
+
path: `/tasks/${taskId}`,
|
|
112
112
|
body: {
|
|
113
113
|
data: {
|
|
114
114
|
completed: true,
|
|
@@ -126,7 +126,7 @@ const result = await ctx.integrations.asana.apiRequest(
|
|
|
126
126
|
const result = await ctx.integrations.asana.apiRequest(
|
|
127
127
|
{
|
|
128
128
|
method: "PUT",
|
|
129
|
-
path: `/
|
|
129
|
+
path: `/tasks/${taskId}`,
|
|
130
130
|
body: {
|
|
131
131
|
data: {
|
|
132
132
|
assignee: userId, // User GID
|
|
@@ -154,7 +154,7 @@ const ListProjectsResponseSchema = z.object({
|
|
|
154
154
|
const result = await ctx.integrations.asana.apiRequest(
|
|
155
155
|
{
|
|
156
156
|
method: "GET",
|
|
157
|
-
path: "/
|
|
157
|
+
path: "/projects",
|
|
158
158
|
params: {
|
|
159
159
|
workspace: workspaceId,
|
|
160
160
|
opt_fields: "name,archived,owner.name",
|
|
@@ -178,7 +178,7 @@ const CreateProjectResponseSchema = z.object({
|
|
|
178
178
|
const result = await ctx.integrations.asana.apiRequest(
|
|
179
179
|
{
|
|
180
180
|
method: "POST",
|
|
181
|
-
path: "/
|
|
181
|
+
path: "/projects",
|
|
182
182
|
body: {
|
|
183
183
|
data: {
|
|
184
184
|
name: "Q1 Marketing Campaign",
|
|
@@ -207,7 +207,7 @@ const StoryResponseSchema = z.object({
|
|
|
207
207
|
const result = await ctx.integrations.asana.apiRequest(
|
|
208
208
|
{
|
|
209
209
|
method: "POST",
|
|
210
|
-
path: `/
|
|
210
|
+
path: `/tasks/${taskId}/stories`,
|
|
211
211
|
body: {
|
|
212
212
|
data: {
|
|
213
213
|
text: "Great progress on this task!",
|
|
@@ -233,7 +233,7 @@ const SearchResponseSchema = z.object({
|
|
|
233
233
|
const result = await ctx.integrations.asana.apiRequest(
|
|
234
234
|
{
|
|
235
235
|
method: "GET",
|
|
236
|
-
path: "/
|
|
236
|
+
path: "/workspaces/{workspace_gid}/tasks/search",
|
|
237
237
|
params: {
|
|
238
238
|
"text.value": "urgent",
|
|
239
239
|
completed: false,
|
|
@@ -252,7 +252,7 @@ const result = await ctx.integrations.asana.apiRequest(
|
|
|
252
252
|
const result = await ctx.integrations.asana.apiRequest(
|
|
253
253
|
{
|
|
254
254
|
method: "GET",
|
|
255
|
-
path: `/
|
|
255
|
+
path: `/tasks/${taskId}/subtasks`,
|
|
256
256
|
params: {
|
|
257
257
|
opt_fields: "name,completed,assignee.name",
|
|
258
258
|
},
|
|
@@ -276,7 +276,7 @@ await asana.getTasks({ ... });
|
|
|
276
276
|
|
|
277
277
|
// CORRECT - Use apiRequest
|
|
278
278
|
await ctx.integrations.asana.apiRequest(
|
|
279
|
-
{ method: "POST", path: "/
|
|
279
|
+
{ method: "POST", path: "/tasks", body: { data: { ... } } },
|
|
280
280
|
{ response: CreateTaskResponseSchema }
|
|
281
281
|
);
|
|
282
282
|
```
|
|
@@ -381,7 +381,7 @@ async function getAllTasks(asana: AsanaClient, projectId: string) {
|
|
|
381
381
|
const result = await ctx.integrations.asana.apiRequest(
|
|
382
382
|
{
|
|
383
383
|
method: "GET",
|
|
384
|
-
path: `/
|
|
384
|
+
path: `/projects/${projectId}/tasks`,
|
|
385
385
|
params: {
|
|
386
386
|
limit: 100,
|
|
387
387
|
...(offset && { offset }),
|
|
@@ -405,7 +405,7 @@ import { RestApiValidationError } from "@superblocksteam/sdk-api";
|
|
|
405
405
|
|
|
406
406
|
try {
|
|
407
407
|
const result = await ctx.integrations.asana.apiRequest(
|
|
408
|
-
{ method: "POST", path: "/
|
|
408
|
+
{ method: "POST", path: "/tasks", body: { data: { ... } } },
|
|
409
409
|
{ response: CreateTaskResponseSchema }
|
|
410
410
|
);
|
|
411
411
|
} catch (error) {
|
|
@@ -41,7 +41,7 @@ export default api({
|
|
|
41
41
|
const logs = await ctx.integrations.athena.query(
|
|
42
42
|
`SELECT timestamp, level, message, request_id
|
|
43
43
|
FROM logs
|
|
44
|
-
WHERE level =
|
|
44
|
+
WHERE level = ?
|
|
45
45
|
LIMIT 100`,
|
|
46
46
|
LogSchema,
|
|
47
47
|
[level],
|
|
@@ -65,8 +65,8 @@ const EventSchema = z.object({
|
|
|
65
65
|
const events = await ctx.integrations.athena.query(
|
|
66
66
|
`SELECT event_id, event_type, user_id, created_at
|
|
67
67
|
FROM events
|
|
68
|
-
WHERE date_partition =
|
|
69
|
-
AND event_type =
|
|
68
|
+
WHERE date_partition = ?
|
|
69
|
+
AND event_type = ?`,
|
|
70
70
|
EventSchema,
|
|
71
71
|
["2024-01-15", "purchase"],
|
|
72
72
|
);
|
|
@@ -138,7 +138,7 @@ Always use partition filters when possible to reduce data scanned:
|
|
|
138
138
|
```typescript
|
|
139
139
|
// GOOD - Uses partition filter
|
|
140
140
|
const logs = await ctx.integrations.athena.query(
|
|
141
|
-
"SELECT * FROM logs WHERE date_partition =
|
|
141
|
+
"SELECT * FROM logs WHERE date_partition = ?",
|
|
142
142
|
LogSchema,
|
|
143
143
|
["2024-01-15"],
|
|
144
144
|
);
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
* runtime validation using Zod schemas.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { z } from "zod";
|
|
9
8
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
9
|
+
import type { z } from "zod";
|
|
10
|
+
|
|
10
11
|
import type { Plugin as AthenaPlugin } from "@superblocksteam/types/dist/src/plugins/athena/v1/plugin_pb";
|
|
11
|
-
|
|
12
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
12
|
+
|
|
13
13
|
import { QueryValidationError } from "../../errors.js";
|
|
14
14
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
15
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
16
|
+
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
15
17
|
import { describeType } from "../utils.js";
|
|
16
18
|
import type { AthenaClient } from "./types.js";
|
|
17
19
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { z } from "zod";
|
|
8
|
+
|
|
8
9
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
9
10
|
import type { TraceMetadata } from "../registry.js";
|
|
10
11
|
|
|
@@ -24,7 +25,7 @@ import type { TraceMetadata } from "../registry.js";
|
|
|
24
25
|
* });
|
|
25
26
|
*
|
|
26
27
|
* const logs = await athena.query(
|
|
27
|
-
* 'SELECT * FROM logs WHERE level =
|
|
28
|
+
* 'SELECT * FROM logs WHERE level = ?',
|
|
28
29
|
* LogSchema,
|
|
29
30
|
* ['ERROR']
|
|
30
31
|
* );
|
|
@@ -34,7 +35,7 @@ export interface AthenaClient extends BaseIntegrationClient {
|
|
|
34
35
|
/**
|
|
35
36
|
* Execute a SQL query and validate results against a Zod schema.
|
|
36
37
|
*
|
|
37
|
-
* @param sql - SQL query string (use
|
|
38
|
+
* @param sql - SQL query string (use ? placeholders for parameters)
|
|
38
39
|
* @param schema - Zod schema to validate the query results
|
|
39
40
|
* @param params - Optional query parameters
|
|
40
41
|
* @returns Promise resolving to validated query results
|
|
@@ -5,10 +5,14 @@
|
|
|
5
5
|
* Handles proto message construction and response validation.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {
|
|
9
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
8
|
+
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
10
9
|
import { z } from "zod";
|
|
10
|
+
|
|
11
|
+
import type { Property } from "@superblocksteam/types/dist/src/common/v1/plugin_pb";
|
|
12
|
+
|
|
11
13
|
import { RestApiValidationError } from "../../errors.js";
|
|
14
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
15
|
+
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* Base class for GraphQL integration clients.
|
|
@@ -18,6 +22,8 @@ import { RestApiValidationError } from "../../errors.js";
|
|
|
18
22
|
* - Executing queries and mutations through the orchestrator
|
|
19
23
|
* - Required Zod schema validation on full GraphQL response
|
|
20
24
|
* - Variables serialization for parameterized queries
|
|
25
|
+
* - Optional per-request HTTP headers (in addition to any headers configured
|
|
26
|
+
* on the integration)
|
|
21
27
|
*/
|
|
22
28
|
export abstract class GraphQLIntegrationClient implements IntegrationClientImpl {
|
|
23
29
|
readonly name: string;
|
|
@@ -39,6 +45,7 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
39
45
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
40
46
|
* @param variables - Optional variables for the query
|
|
41
47
|
* @param metadata - Optional trace metadata for observability
|
|
48
|
+
* @param headers - Optional HTTP headers to send with the request
|
|
42
49
|
* @returns Validated query result
|
|
43
50
|
*/
|
|
44
51
|
async query<TResponse>(
|
|
@@ -46,8 +53,9 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
46
53
|
schema: { response: z.ZodSchema<TResponse> },
|
|
47
54
|
variables?: Record<string, unknown>,
|
|
48
55
|
metadata?: TraceMetadata,
|
|
56
|
+
headers?: Record<string, string>,
|
|
49
57
|
): Promise<TResponse> {
|
|
50
|
-
return this.executeGraphQL(query, schema, variables, metadata);
|
|
58
|
+
return this.executeGraphQL(query, schema, variables, metadata, headers);
|
|
51
59
|
}
|
|
52
60
|
|
|
53
61
|
/**
|
|
@@ -57,6 +65,7 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
57
65
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
58
66
|
* @param variables - Optional variables for the mutation
|
|
59
67
|
* @param metadata - Optional trace metadata for observability
|
|
68
|
+
* @param headers - Optional HTTP headers to send with the request
|
|
60
69
|
* @returns Validated mutation result
|
|
61
70
|
*/
|
|
62
71
|
async mutation<TResponse>(
|
|
@@ -64,8 +73,9 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
64
73
|
schema: { response: z.ZodSchema<TResponse> },
|
|
65
74
|
variables?: Record<string, unknown>,
|
|
66
75
|
metadata?: TraceMetadata,
|
|
76
|
+
headers?: Record<string, string>,
|
|
67
77
|
): Promise<TResponse> {
|
|
68
|
-
return this.executeGraphQL(mutation, schema, variables, metadata);
|
|
78
|
+
return this.executeGraphQL(mutation, schema, variables, metadata, headers);
|
|
69
79
|
}
|
|
70
80
|
|
|
71
81
|
/**
|
|
@@ -79,9 +89,17 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
79
89
|
schema: { response: z.ZodSchema<TResponse> },
|
|
80
90
|
variables?: Record<string, unknown>,
|
|
81
91
|
metadata?: TraceMetadata,
|
|
92
|
+
headers?: Record<string, string>,
|
|
82
93
|
): Promise<TResponse> {
|
|
94
|
+
const headerProps: PartialMessage<Property>[] = [];
|
|
95
|
+
if (headers) {
|
|
96
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
97
|
+
headerProps.push({ key, value });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
83
101
|
// Build graphql.v1.Plugin proto message
|
|
84
|
-
const request = {
|
|
102
|
+
const request: Record<string, unknown> = {
|
|
85
103
|
body: queryString,
|
|
86
104
|
custom: variables
|
|
87
105
|
? {
|
|
@@ -95,6 +113,10 @@ export abstract class GraphQLIntegrationClient implements IntegrationClientImpl
|
|
|
95
113
|
failOnGraphqlErrors: true,
|
|
96
114
|
};
|
|
97
115
|
|
|
116
|
+
if (headerProps.length > 0) {
|
|
117
|
+
request.headers = headerProps;
|
|
118
|
+
}
|
|
119
|
+
|
|
98
120
|
// Execute query through orchestrator
|
|
99
121
|
const response = await this.executeQuery(request, undefined, metadata);
|
|
100
122
|
|