@superblocksteam/sdk-api 0.0.5 → 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 -30
- package/dist/integrations/couchbase/client.d.ts.map +0 -1
- package/dist/integrations/couchbase/client.js +0 -154
- 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 -237
- 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
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6
6
|
import { describe, it, expect, expectTypeOf } from "vitest";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
|
|
8
9
|
import {
|
|
9
10
|
api,
|
|
10
11
|
__setEntryPoint,
|
|
11
|
-
|
|
12
|
+
getEntryPoint,
|
|
12
13
|
type ExtractApiInput,
|
|
13
14
|
type ExtractApiOutput,
|
|
14
15
|
} from "./definition.js";
|
|
@@ -344,27 +345,52 @@ describe("entryPoint mechanism", () => {
|
|
|
344
345
|
expect(compiled.entryPoint).toBe("server/apis/GetUsers/api.ts");
|
|
345
346
|
});
|
|
346
347
|
|
|
347
|
-
it("
|
|
348
|
-
__setEntryPoint("server/apis/
|
|
349
|
-
const
|
|
350
|
-
|
|
348
|
+
it("entryPoint persists across multiple api() calls from the same file", () => {
|
|
349
|
+
__setEntryPoint("server/apis/slack/helper.ts");
|
|
350
|
+
const dashboard = api({
|
|
351
|
+
name: "SlackDashboard",
|
|
352
|
+
input: z.object({}),
|
|
353
|
+
output: z.object({}),
|
|
354
|
+
async run() {
|
|
355
|
+
return {};
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
const search = api({
|
|
359
|
+
name: "SlackSearch",
|
|
360
|
+
input: z.object({}),
|
|
361
|
+
output: z.object({}),
|
|
362
|
+
async run() {
|
|
363
|
+
return {};
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
const postMessage = api({
|
|
367
|
+
name: "SlackPostMessage",
|
|
368
|
+
input: z.object({}),
|
|
369
|
+
output: z.object({}),
|
|
370
|
+
async run() {
|
|
371
|
+
return {};
|
|
372
|
+
},
|
|
373
|
+
});
|
|
351
374
|
|
|
352
|
-
expect(
|
|
353
|
-
expect(
|
|
375
|
+
expect(dashboard.entryPoint).toBe("server/apis/slack/helper.ts");
|
|
376
|
+
expect(search.entryPoint).toBe("server/apis/slack/helper.ts");
|
|
377
|
+
expect(postMessage.entryPoint).toBe("server/apis/slack/helper.ts");
|
|
354
378
|
});
|
|
355
379
|
|
|
356
|
-
it("
|
|
357
|
-
__setEntryPoint("server/apis/
|
|
358
|
-
const
|
|
359
|
-
name: "
|
|
380
|
+
it("new __setEntryPoint overwrites previous value for a different file", () => {
|
|
381
|
+
__setEntryPoint("server/apis/slack/helper.ts");
|
|
382
|
+
const slackApi = api({
|
|
383
|
+
name: "SlackDashboard",
|
|
360
384
|
input: z.object({}),
|
|
361
385
|
output: z.object({}),
|
|
362
386
|
async run() {
|
|
363
387
|
return {};
|
|
364
388
|
},
|
|
365
389
|
});
|
|
366
|
-
|
|
367
|
-
|
|
390
|
+
|
|
391
|
+
__setEntryPoint("server/apis/users/api.ts");
|
|
392
|
+
const usersApi = api({
|
|
393
|
+
name: "GetUsers",
|
|
368
394
|
input: z.object({}),
|
|
369
395
|
output: z.object({}),
|
|
370
396
|
async run() {
|
|
@@ -372,7 +398,7 @@ describe("entryPoint mechanism", () => {
|
|
|
372
398
|
},
|
|
373
399
|
});
|
|
374
400
|
|
|
375
|
-
expect(
|
|
376
|
-
expect(
|
|
401
|
+
expect(slackApi.entryPoint).toBe("server/apis/slack/helper.ts");
|
|
402
|
+
expect(usersApi.entryPoint).toBe("server/apis/users/api.ts");
|
|
377
403
|
});
|
|
378
404
|
});
|
package/src/api/definition.ts
CHANGED
|
@@ -44,29 +44,36 @@ export type ExtractApiInput<T> =
|
|
|
44
44
|
export type ExtractApiOutput<T> =
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
46
|
T extends CompiledApi<any, infer TOutput> ? TOutput : never;
|
|
47
|
-
import type { ApiConfig, ApiContext, AnyIntegrationRef } from "../types.js";
|
|
48
47
|
import {
|
|
49
48
|
extractIntegrationDeclarations,
|
|
50
49
|
type IntegrationDeclaration,
|
|
51
50
|
} from "../integrations/declarations.js";
|
|
51
|
+
import type { ApiConfig, ApiContext, AnyIntegrationRef } from "../types.js";
|
|
52
52
|
|
|
53
53
|
// ---------------------------------------------------------------------------
|
|
54
54
|
// Entry point setter — used by the Vite plugin to stamp the source file path
|
|
55
|
-
// onto
|
|
56
|
-
// synchronous, so the prepended __setEntryPoint() always runs before
|
|
55
|
+
// onto every api()/streamingApi() call in a module. ESM top-level execution
|
|
56
|
+
// is synchronous, so the prepended __setEntryPoint() always runs before any
|
|
57
|
+
// api() call in the same file. The value is intentionally NOT cleared after
|
|
58
|
+
// the first read so that multiple named-exported api() calls in a single file
|
|
59
|
+
// all receive the same entry point. The next file's __setEntryPoint() call
|
|
60
|
+
// naturally overwrites the value.
|
|
57
61
|
// ---------------------------------------------------------------------------
|
|
58
62
|
|
|
59
63
|
let __pendingEntryPoint: string | undefined;
|
|
60
64
|
|
|
61
|
-
/** Called by the Vite plugin to set the entry point for
|
|
65
|
+
/** Called by the Vite plugin to set the entry point for api() calls in this file. */
|
|
62
66
|
export function __setEntryPoint(entryPoint: string): void {
|
|
63
67
|
__pendingEntryPoint = entryPoint;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Returns the current pending entry point without clearing it.
|
|
72
|
+
* This allows multiple api() calls within the same file to share the same
|
|
73
|
+
* entry point (e.g. named exports from a single module).
|
|
74
|
+
*/
|
|
75
|
+
export function getEntryPoint(): string | undefined {
|
|
76
|
+
return __pendingEntryPoint;
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
/**
|
|
@@ -170,10 +177,10 @@ export interface CompiledApi<TInput = unknown, TOutput = unknown> {
|
|
|
170
177
|
* throw new Error('User not found');
|
|
171
178
|
* }
|
|
172
179
|
*
|
|
173
|
-
* await ctx.integrations.notifier.
|
|
174
|
-
* channel: '#user-lookups',
|
|
175
|
-
*
|
|
176
|
-
*
|
|
180
|
+
* await ctx.integrations.notifier.apiRequest(
|
|
181
|
+
* { method: 'POST', path: '/chat.postMessage', body: { channel: '#user-lookups', text: `Fetched user ${user.name}` } },
|
|
182
|
+
* { response: z.object({ ok: z.boolean() }) }
|
|
183
|
+
* );
|
|
177
184
|
*
|
|
178
185
|
* return { user };
|
|
179
186
|
* },
|
|
@@ -196,7 +203,7 @@ export function api<
|
|
|
196
203
|
const compiled: CompiledApi<z.infer<TInput>, z.infer<TOutput>> = {
|
|
197
204
|
name: config.name,
|
|
198
205
|
description: config.description,
|
|
199
|
-
entryPoint:
|
|
206
|
+
entryPoint: getEntryPoint(),
|
|
200
207
|
inputSchema: config.input,
|
|
201
208
|
outputSchema: config.output,
|
|
202
209
|
run: config.run as (
|
package/src/api/index.ts
CHANGED
|
@@ -4,7 +4,3 @@
|
|
|
4
4
|
|
|
5
5
|
export { api, __setEntryPoint } from "./definition.js";
|
|
6
6
|
export type { CompiledApi } from "./definition.js";
|
|
7
|
-
|
|
8
|
-
// Streaming API support
|
|
9
|
-
export { streamingApi, isStreamingApi } from "./streaming.js";
|
|
10
|
-
export type { StreamingApiConfig, CompiledStreamingApi } from "./streaming.js";
|
package/src/errors.ts
CHANGED
|
@@ -53,7 +53,7 @@ export class QueryValidationError extends Error {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Error thrown when
|
|
56
|
+
* Error thrown when code execution fails.
|
|
57
57
|
*
|
|
58
58
|
* Contains context about the code, bindings, and any validation errors
|
|
59
59
|
* that occurred during execution.
|
|
@@ -80,51 +80,3 @@ export class CodeExecutionError extends Error {
|
|
|
80
80
|
Object.setPrototypeOf(this, CodeExecutionError.prototype);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Error thrown when a streamed chunk fails validation.
|
|
86
|
-
*
|
|
87
|
-
* Contains information about the chunk index, the raw chunk data,
|
|
88
|
-
* and the Zod validation error details.
|
|
89
|
-
*/
|
|
90
|
-
export class StreamChunkValidationError extends Error {
|
|
91
|
-
constructor(
|
|
92
|
-
message: string,
|
|
93
|
-
public readonly details: {
|
|
94
|
-
/** Index of the chunk that failed validation (0-based) */
|
|
95
|
-
chunkIndex: number;
|
|
96
|
-
/** The raw chunk data that failed validation */
|
|
97
|
-
chunk: unknown;
|
|
98
|
-
/** The complete Zod error object with all validation information */
|
|
99
|
-
zodError: z.ZodError;
|
|
100
|
-
},
|
|
101
|
-
) {
|
|
102
|
-
super(message);
|
|
103
|
-
this.name = "StreamChunkValidationError";
|
|
104
|
-
// Ensure proper prototype chain for instanceof checks
|
|
105
|
-
Object.setPrototypeOf(this, StreamChunkValidationError.prototype);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Error thrown when a streaming API encounters an error mid-stream.
|
|
111
|
-
*
|
|
112
|
-
* This error indicates that the stream was interrupted before completion.
|
|
113
|
-
* Contains context about where in the stream the error occurred.
|
|
114
|
-
*/
|
|
115
|
-
export class StreamError extends Error {
|
|
116
|
-
constructor(
|
|
117
|
-
message: string,
|
|
118
|
-
public readonly details?: {
|
|
119
|
-
/** Number of chunks successfully received before the error */
|
|
120
|
-
chunksReceived?: number;
|
|
121
|
-
/** The original error that caused the stream to fail */
|
|
122
|
-
originalError?: unknown;
|
|
123
|
-
},
|
|
124
|
-
) {
|
|
125
|
-
super(message);
|
|
126
|
-
this.name = "StreamError";
|
|
127
|
-
// Ensure proper prototype chain for instanceof checks
|
|
128
|
-
Object.setPrototypeOf(this, StreamError.prototype);
|
|
129
|
-
}
|
|
130
|
-
}
|
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
|
}
|