@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
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for GraphQLClientImpl.
|
|
3
|
+
*
|
|
4
|
+
* Validates:
|
|
5
|
+
* - The proto request built by query()/mutation() matches the
|
|
6
|
+
* graphql.v1.Plugin shape expected by the orchestrator.
|
|
7
|
+
* - Optional per-request headers are forwarded as the proto's repeated
|
|
8
|
+
* `headers` field (key/value Property entries) so dynamic values like
|
|
9
|
+
* Authorization tokens can be sent from API code.
|
|
10
|
+
* - Variables are serialized into the proto `custom.variables` Property.
|
|
11
|
+
* - Trace metadata is passed through to the executeQuery callback.
|
|
12
|
+
* - Response Zod validation throws RestApiValidationError on mismatch.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { describe, it, expect, vi } from "vitest";
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
|
|
18
|
+
import { RestApiValidationError } from "../../errors.js";
|
|
19
|
+
import type { IntegrationConfig } from "../types.js";
|
|
20
|
+
import { GraphQLClientImpl } from "./client.js";
|
|
21
|
+
|
|
22
|
+
const TEST_CONFIG: IntegrationConfig = {
|
|
23
|
+
id: "graphql-test-id",
|
|
24
|
+
name: "Test GraphQL",
|
|
25
|
+
pluginId: "graphqlintegration",
|
|
26
|
+
configuration: {},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function createClient(mockResult: unknown) {
|
|
30
|
+
const executeQuery = vi.fn().mockResolvedValue(mockResult);
|
|
31
|
+
const client = new GraphQLClientImpl(TEST_CONFIG, executeQuery);
|
|
32
|
+
return { client, executeQuery };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const UserResponseSchema = z.object({
|
|
36
|
+
data: z.object({
|
|
37
|
+
user: z.object({
|
|
38
|
+
id: z.string(),
|
|
39
|
+
name: z.string(),
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const SAMPLE_QUERY = `query GetUser($id: ID!) {
|
|
45
|
+
user(id: $id) { id name }
|
|
46
|
+
}`;
|
|
47
|
+
|
|
48
|
+
const SAMPLE_MUTATION = `mutation CreateUser($name: String!) {
|
|
49
|
+
createUser(name: $name) { id name }
|
|
50
|
+
}`;
|
|
51
|
+
|
|
52
|
+
describe("GraphQLClientImpl", () => {
|
|
53
|
+
describe("query()", () => {
|
|
54
|
+
it("returns validated data on a successful response", async () => {
|
|
55
|
+
const { client } = createClient({
|
|
56
|
+
data: { user: { id: "u1", name: "Alice" } },
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const result = await client.query(
|
|
60
|
+
SAMPLE_QUERY,
|
|
61
|
+
{ response: UserResponseSchema },
|
|
62
|
+
{ id: "u1" },
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(result.data.user).toEqual({ id: "u1", name: "Alice" });
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("builds the proto request with body, variables, and defaults", async () => {
|
|
69
|
+
const { client, executeQuery } = createClient({
|
|
70
|
+
data: { user: { id: "u1", name: "Alice" } },
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
await client.query(
|
|
74
|
+
SAMPLE_QUERY,
|
|
75
|
+
{ response: UserResponseSchema },
|
|
76
|
+
{ id: "u1" },
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
expect(executeQuery).toHaveBeenCalledOnce();
|
|
80
|
+
const request = executeQuery.mock.calls[0][0];
|
|
81
|
+
expect(request.body).toBe(SAMPLE_QUERY);
|
|
82
|
+
expect(request.verboseHttpOutput).toBe(false);
|
|
83
|
+
expect(request.failOnGraphqlErrors).toBe(true);
|
|
84
|
+
expect(request.custom).toEqual({
|
|
85
|
+
variables: {
|
|
86
|
+
key: "variables",
|
|
87
|
+
value: JSON.stringify({ id: "u1" }),
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
expect(request.headers).toBeUndefined();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("omits custom when no variables are provided", async () => {
|
|
94
|
+
const { client, executeQuery } = createClient({
|
|
95
|
+
data: { user: { id: "u1", name: "Alice" } },
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
await client.query(SAMPLE_QUERY, { response: UserResponseSchema });
|
|
99
|
+
|
|
100
|
+
const request = executeQuery.mock.calls[0][0];
|
|
101
|
+
expect(request.custom).toBeUndefined();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("forwards per-request headers into the proto headers field", async () => {
|
|
105
|
+
const { client, executeQuery } = createClient({
|
|
106
|
+
data: { user: { id: "u1", name: "Alice" } },
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
await client.query(
|
|
110
|
+
SAMPLE_QUERY,
|
|
111
|
+
{ response: UserResponseSchema },
|
|
112
|
+
{ id: "u1" },
|
|
113
|
+
undefined,
|
|
114
|
+
{
|
|
115
|
+
Authorization: "Bearer abc123",
|
|
116
|
+
"X-Trace-Id": "trace-1",
|
|
117
|
+
},
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const request = executeQuery.mock.calls[0][0];
|
|
121
|
+
expect(request.headers).toEqual([
|
|
122
|
+
{ key: "Authorization", value: "Bearer abc123" },
|
|
123
|
+
{ key: "X-Trace-Id", value: "trace-1" },
|
|
124
|
+
]);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("does not set headers when an empty headers object is passed", async () => {
|
|
128
|
+
const { client, executeQuery } = createClient({
|
|
129
|
+
data: { user: { id: "u1", name: "Alice" } },
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
await client.query(
|
|
133
|
+
SAMPLE_QUERY,
|
|
134
|
+
{ response: UserResponseSchema },
|
|
135
|
+
undefined,
|
|
136
|
+
undefined,
|
|
137
|
+
{},
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const request = executeQuery.mock.calls[0][0];
|
|
141
|
+
expect(request.headers).toBeUndefined();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("passes trace metadata through to executeQuery", async () => {
|
|
145
|
+
const { client, executeQuery } = createClient({
|
|
146
|
+
data: { user: { id: "u1", name: "Alice" } },
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
await client.query(
|
|
150
|
+
SAMPLE_QUERY,
|
|
151
|
+
{ response: UserResponseSchema },
|
|
152
|
+
undefined,
|
|
153
|
+
{ label: "graphql.getUser", description: "Fetch a user by id" },
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
expect(executeQuery).toHaveBeenCalledWith(expect.any(Object), undefined, {
|
|
157
|
+
label: "graphql.getUser",
|
|
158
|
+
description: "Fetch a user by id",
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it("throws RestApiValidationError when the response fails schema validation", async () => {
|
|
163
|
+
const { client } = createClient({
|
|
164
|
+
data: { user: { id: "u1" /* missing name */ } },
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
await expect(
|
|
168
|
+
client.query(SAMPLE_QUERY, { response: UserResponseSchema }),
|
|
169
|
+
).rejects.toThrow(RestApiValidationError);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
describe("mutation()", () => {
|
|
174
|
+
it("returns validated data on a successful response", async () => {
|
|
175
|
+
const { client } = createClient({
|
|
176
|
+
data: { createUser: { id: "u2", name: "Bob" } },
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const Schema = z.object({
|
|
180
|
+
data: z.object({
|
|
181
|
+
createUser: z.object({ id: z.string(), name: z.string() }),
|
|
182
|
+
}),
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const result = await client.mutation(
|
|
186
|
+
SAMPLE_MUTATION,
|
|
187
|
+
{ response: Schema },
|
|
188
|
+
{ name: "Bob" },
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
expect(result.data.createUser).toEqual({ id: "u2", name: "Bob" });
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it("forwards per-request headers into the proto headers field", async () => {
|
|
195
|
+
const { client, executeQuery } = createClient({
|
|
196
|
+
data: { createUser: { id: "u2", name: "Bob" } },
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const Schema = z.object({
|
|
200
|
+
data: z.object({
|
|
201
|
+
createUser: z.object({ id: z.string(), name: z.string() }),
|
|
202
|
+
}),
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
await client.mutation(
|
|
206
|
+
SAMPLE_MUTATION,
|
|
207
|
+
{ response: Schema },
|
|
208
|
+
{ name: "Bob" },
|
|
209
|
+
undefined,
|
|
210
|
+
{ Authorization: "Bearer xyz" },
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
const request = executeQuery.mock.calls[0][0];
|
|
214
|
+
expect(request.body).toBe(SAMPLE_MUTATION);
|
|
215
|
+
expect(request.headers).toEqual([
|
|
216
|
+
{ key: "Authorization", value: "Bearer xyz" },
|
|
217
|
+
]);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## @replace: Methods
|
|
2
|
+
|
|
3
|
+
| Method | Description |
|
|
4
|
+
| ---------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
5
|
+
| `query<T>(query, schema, variables?, metadata?, headers?)` | Execute a GraphQL query with required schema validation |
|
|
6
|
+
| `mutation<T>(mutation, schema, variables?, metadata?, headers?)` | Execute a GraphQL mutation with required schema validation |
|
|
7
|
+
|
|
8
|
+
## @replace: Trace Metadata
|
|
9
|
+
|
|
10
|
+
All methods accept an optional `metadata` parameter for diagnostics labeling. See the [root SDK README](../../../README.md#trace-metadata) for details.
|
|
11
|
+
|
|
12
|
+
## Dynamic Headers
|
|
13
|
+
|
|
14
|
+
Static headers (e.g. a fixed `X-API-Version`) and auth headers (e.g. Bearer tokens, API keys) should be configured on the GraphQL integration in the Superblocks UI so they apply to every call automatically.
|
|
15
|
+
|
|
16
|
+
For values that change per request — for example a bearer token derived from the API's input or from `ctx.env` — pass an optional `headers` map as the final argument to `query()` or `mutation()`:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
const MeResponseSchema = z.object({
|
|
20
|
+
data: z.object({
|
|
21
|
+
me: z.object({ id: z.string(), email: z.string() }),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const result = await ctx.integrations.graphql.query(
|
|
26
|
+
`query { me { id email } }`,
|
|
27
|
+
{ response: MeResponseSchema },
|
|
28
|
+
undefined, // no variables
|
|
29
|
+
undefined, // no trace metadata
|
|
30
|
+
{ Authorization: `Bearer ${ctx.env.UPSTREAM_TOKEN}` },
|
|
31
|
+
);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Since both `variables` and `metadata` accept plain objects, pass `undefined` for any of them that you do not need.
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* GraphQL client types.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import type { z } from "zod";
|
|
6
|
+
|
|
5
7
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
6
8
|
import type { TraceMetadata } from "../registry.js";
|
|
7
|
-
import type { z } from "zod";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* GraphQL client for executing queries and mutations.
|
|
@@ -61,6 +62,17 @@ import type { z } from "zod";
|
|
|
61
62
|
* { response: MutationResponseSchema },
|
|
62
63
|
* { name: 'John Doe' }
|
|
63
64
|
* );
|
|
65
|
+
*
|
|
66
|
+
* // Send per-request headers (e.g. a dynamic Authorization token).
|
|
67
|
+
* // Static headers and auth configured on the integration apply automatically;
|
|
68
|
+
* // use this parameter only for values that vary per request.
|
|
69
|
+
* await graphql.query(
|
|
70
|
+
* `query { me { id } }`,
|
|
71
|
+
* { response: z.object({ data: z.object({ me: z.object({ id: z.string() }) }) }) },
|
|
72
|
+
* undefined,
|
|
73
|
+
* undefined,
|
|
74
|
+
* { Authorization: `Bearer ${token}` },
|
|
75
|
+
* );
|
|
64
76
|
* ```
|
|
65
77
|
*/
|
|
66
78
|
export interface GraphQLClient extends BaseIntegrationClient {
|
|
@@ -73,6 +85,10 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
73
85
|
* `metadata` accept plain objects, pass `undefined` for variables when you only need metadata:
|
|
74
86
|
* `query(q, schema, undefined, { label: "..." })`
|
|
75
87
|
* @param metadata - Optional trace metadata for observability
|
|
88
|
+
* @param headers - Optional HTTP headers to include on this request. Static
|
|
89
|
+
* headers and auth configured on the integration apply automatically; use
|
|
90
|
+
* this parameter only for values that vary per request (e.g. a bearer token
|
|
91
|
+
* derived from the API's input).
|
|
76
92
|
* @returns Validated query result
|
|
77
93
|
*
|
|
78
94
|
* @example
|
|
@@ -94,6 +110,7 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
94
110
|
schema: { response: z.ZodSchema<TResponse> },
|
|
95
111
|
variables?: Record<string, unknown>,
|
|
96
112
|
metadata?: TraceMetadata,
|
|
113
|
+
headers?: Record<string, string>,
|
|
97
114
|
): Promise<TResponse>;
|
|
98
115
|
|
|
99
116
|
/**
|
|
@@ -105,6 +122,10 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
105
122
|
* `metadata` accept plain objects, pass `undefined` for variables when you only need metadata:
|
|
106
123
|
* `mutation(m, schema, undefined, { label: "..." })`
|
|
107
124
|
* @param metadata - Optional trace metadata for observability
|
|
125
|
+
* @param headers - Optional HTTP headers to include on this request. Static
|
|
126
|
+
* headers and auth configured on the integration apply automatically; use
|
|
127
|
+
* this parameter only for values that vary per request (e.g. a bearer token
|
|
128
|
+
* derived from the API's input).
|
|
108
129
|
* @returns Validated mutation result
|
|
109
130
|
*
|
|
110
131
|
* @example
|
|
@@ -127,5 +148,6 @@ export interface GraphQLClient extends BaseIntegrationClient {
|
|
|
127
148
|
schema: { response: z.ZodSchema<TResponse> },
|
|
128
149
|
variables?: Record<string, unknown>,
|
|
129
150
|
metadata?: TraceMetadata,
|
|
151
|
+
headers?: Record<string, string>,
|
|
130
152
|
): Promise<TResponse>;
|
|
131
153
|
}
|
|
@@ -10,7 +10,9 @@ Interact with Groq's ultra-fast inference API for LLM chat completions with low
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Step 1: List Available Models
|
|
14
|
+
|
|
15
|
+
Model availability varies by account and changes over time. Before making requests, validate which models are available:
|
|
14
16
|
|
|
15
17
|
```typescript
|
|
16
18
|
import { api, z, groq } from "@superblocksteam/sdk-api";
|
|
@@ -18,6 +20,30 @@ import { api, z, groq } from "@superblocksteam/sdk-api";
|
|
|
18
20
|
// Integration ID from the integrations panel
|
|
19
21
|
const PROD_GROQ = "a1b2c3d4-5678-90ab-cdef-groq00000001";
|
|
20
22
|
|
|
23
|
+
const ModelsResponseSchema = z.object({
|
|
24
|
+
data: z.array(
|
|
25
|
+
z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
object: z.string(),
|
|
28
|
+
}),
|
|
29
|
+
),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const models = await ctx.integrations.groq.apiRequest(
|
|
33
|
+
{
|
|
34
|
+
method: "GET",
|
|
35
|
+
path: "/v1/models",
|
|
36
|
+
},
|
|
37
|
+
{ response: ModelsResponseSchema },
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Use a model ID from the response in subsequent requests
|
|
41
|
+
const availableModelId = models.data[0]?.id;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Chat Completion
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
21
47
|
const ChatCompletionResponseSchema = z.object({
|
|
22
48
|
id: z.string(),
|
|
23
49
|
object: z.literal("chat.completion"),
|
|
@@ -59,9 +85,9 @@ export default api({
|
|
|
59
85
|
const result = await ctx.integrations.groq.apiRequest(
|
|
60
86
|
{
|
|
61
87
|
method: "POST",
|
|
62
|
-
path: "/
|
|
88
|
+
path: "/v1/chat/completions",
|
|
63
89
|
body: {
|
|
64
|
-
model: "llama-3.
|
|
90
|
+
model: "llama-3.3-70b-versatile",
|
|
65
91
|
messages: [
|
|
66
92
|
{ role: "system", content: "You are a helpful assistant." },
|
|
67
93
|
{ role: "user", content: prompt },
|
|
@@ -79,13 +105,13 @@ export default api({
|
|
|
79
105
|
### Using Different Models
|
|
80
106
|
|
|
81
107
|
```typescript
|
|
82
|
-
// Llama 3.
|
|
108
|
+
// Llama 3.3 70B - Best balance of speed and quality
|
|
83
109
|
const llama70b = await ctx.integrations.groq.apiRequest(
|
|
84
110
|
{
|
|
85
111
|
method: "POST",
|
|
86
|
-
path: "/
|
|
112
|
+
path: "/v1/chat/completions",
|
|
87
113
|
body: {
|
|
88
|
-
model: "llama-3.
|
|
114
|
+
model: "llama-3.3-70b-versatile",
|
|
89
115
|
messages: [{ role: "user", content: "Hello" }],
|
|
90
116
|
},
|
|
91
117
|
},
|
|
@@ -96,7 +122,7 @@ const llama70b = await ctx.integrations.groq.apiRequest(
|
|
|
96
122
|
const llama8b = await ctx.integrations.groq.apiRequest(
|
|
97
123
|
{
|
|
98
124
|
method: "POST",
|
|
99
|
-
path: "/
|
|
125
|
+
path: "/v1/chat/completions",
|
|
100
126
|
body: {
|
|
101
127
|
model: "llama-3.1-8b-instant",
|
|
102
128
|
messages: [{ role: "user", content: "Hello" }],
|
|
@@ -105,13 +131,13 @@ const llama8b = await ctx.integrations.groq.apiRequest(
|
|
|
105
131
|
{ response: ChatCompletionResponseSchema },
|
|
106
132
|
);
|
|
107
133
|
|
|
108
|
-
//
|
|
109
|
-
const
|
|
134
|
+
// GPT-OSS 120B - Good for code and reasoning
|
|
135
|
+
const gptOss = await ctx.integrations.groq.apiRequest(
|
|
110
136
|
{
|
|
111
137
|
method: "POST",
|
|
112
|
-
path: "/
|
|
138
|
+
path: "/v1/chat/completions",
|
|
113
139
|
body: {
|
|
114
|
-
model: "
|
|
140
|
+
model: "openai/gpt-oss-120b",
|
|
115
141
|
messages: [{ role: "user", content: "Hello" }],
|
|
116
142
|
},
|
|
117
143
|
},
|
|
@@ -150,9 +176,9 @@ const ToolCallResponseSchema = z.object({
|
|
|
150
176
|
const result = await ctx.integrations.groq.apiRequest(
|
|
151
177
|
{
|
|
152
178
|
method: "POST",
|
|
153
|
-
path: "/
|
|
179
|
+
path: "/v1/chat/completions",
|
|
154
180
|
body: {
|
|
155
|
-
model: "llama-3.
|
|
181
|
+
model: "llama-3.3-70b-versatile",
|
|
156
182
|
messages: [{ role: "user", content: "What's the weather in Tokyo?" }],
|
|
157
183
|
tools: [
|
|
158
184
|
{
|
|
@@ -200,9 +226,9 @@ const JSONResponseSchema = z.object({
|
|
|
200
226
|
const result = await ctx.integrations.groq.apiRequest(
|
|
201
227
|
{
|
|
202
228
|
method: "POST",
|
|
203
|
-
path: "/
|
|
229
|
+
path: "/v1/chat/completions",
|
|
204
230
|
body: {
|
|
205
|
-
model: "llama-3.
|
|
231
|
+
model: "llama-3.3-70b-versatile",
|
|
206
232
|
messages: [
|
|
207
233
|
{
|
|
208
234
|
role: "user",
|
|
@@ -234,55 +260,36 @@ await groq.createChatCompletion({ ... });
|
|
|
234
260
|
|
|
235
261
|
// CORRECT - Use apiRequest
|
|
236
262
|
await ctx.integrations.groq.apiRequest(
|
|
237
|
-
{ method: "POST", path: "/
|
|
263
|
+
{ method: "POST", path: "/v1/chat/completions", body: { ... } },
|
|
238
264
|
{ response: ChatCompletionResponseSchema }
|
|
239
265
|
);
|
|
240
266
|
```
|
|
241
267
|
|
|
242
268
|
### OpenAI-Compatible Path
|
|
243
269
|
|
|
244
|
-
|
|
270
|
+
The integration's base URL already includes `https://api.groq.com/openai`, so paths should start with `/v1/`:
|
|
245
271
|
|
|
246
272
|
```typescript
|
|
247
|
-
// WRONG -
|
|
273
|
+
// WRONG - Duplicates the /openai prefix (base URL already includes it)
|
|
248
274
|
await ctx.integrations.groq.apiRequest(
|
|
249
|
-
{ method: "POST", path: "/v1/chat/completions", body: { ... } },
|
|
275
|
+
{ method: "POST", path: "/openai/v1/chat/completions", body: { ... } },
|
|
250
276
|
{ response: schema }
|
|
251
277
|
);
|
|
252
278
|
|
|
253
|
-
// CORRECT -
|
|
279
|
+
// CORRECT - Start with /v1/ (the integration prepends /openai automatically)
|
|
254
280
|
await ctx.integrations.groq.apiRequest(
|
|
255
|
-
{ method: "POST", path: "/
|
|
281
|
+
{ method: "POST", path: "/v1/chat/completions", body: { ... } },
|
|
256
282
|
{ response: schema }
|
|
257
283
|
);
|
|
258
284
|
```
|
|
259
285
|
|
|
260
|
-
### Model Availability
|
|
261
|
-
|
|
262
|
-
Groq has specific models available. Check current availability:
|
|
263
|
-
|
|
264
|
-
| Model | Context Window | Best For |
|
|
265
|
-
| ----------------------- | -------------- | ------------------ |
|
|
266
|
-
| llama-3.1-70b-versatile | 128K | General use |
|
|
267
|
-
| llama-3.1-8b-instant | 128K | Fast, simple tasks |
|
|
268
|
-
| mixtral-8x7b-32768 | 32K | Code, reasoning |
|
|
269
|
-
| gemma2-9b-it | 8K | Lightweight tasks |
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
// Ensure model is available
|
|
273
|
-
const body = {
|
|
274
|
-
model: "llama-3.1-70b-versatile", // Verify model exists
|
|
275
|
-
messages: [...],
|
|
276
|
-
};
|
|
277
|
-
```
|
|
278
|
-
|
|
279
286
|
### Rate Limits
|
|
280
287
|
|
|
281
288
|
Groq has rate limits based on tokens per minute. Monitor usage:
|
|
282
289
|
|
|
283
290
|
```typescript
|
|
284
291
|
const result = await ctx.integrations.groq.apiRequest(
|
|
285
|
-
{ method: "POST", path: "/
|
|
292
|
+
{ method: "POST", path: "/v1/chat/completions", body: { ... } },
|
|
286
293
|
{ response: ChatCompletionResponseSchema }
|
|
287
294
|
);
|
|
288
295
|
|
|
@@ -297,7 +304,7 @@ import { RestApiValidationError } from "@superblocksteam/sdk-api";
|
|
|
297
304
|
|
|
298
305
|
try {
|
|
299
306
|
const result = await ctx.integrations.groq.apiRequest(
|
|
300
|
-
{ method: "POST", path: "/
|
|
307
|
+
{ method: "POST", path: "/v1/chat/completions", body: { ... } },
|
|
301
308
|
{ response: ChatCompletionResponseSchema }
|
|
302
309
|
);
|
|
303
310
|
} catch (error) {
|
|
@@ -24,7 +24,7 @@ Interact with Google Sheets with full type safety and runtime validation.
|
|
|
24
24
|
### Read Spreadsheet Data
|
|
25
25
|
|
|
26
26
|
```typescript
|
|
27
|
-
import { api, z,
|
|
27
|
+
import { api, z, googleSheets } from "@superblocksteam/sdk-api";
|
|
28
28
|
|
|
29
29
|
// Integration ID from the integrations panel
|
|
30
30
|
const PROD_GSHEETS = "a1b2c3d4-5678-90ab-cdef-gsheets00001";
|
|
@@ -39,7 +39,7 @@ const RowSchema = z.array(
|
|
|
39
39
|
|
|
40
40
|
export default api({
|
|
41
41
|
integrations: {
|
|
42
|
-
sheets:
|
|
42
|
+
sheets: googleSheets(PROD_GSHEETS),
|
|
43
43
|
},
|
|
44
44
|
name: "GoogleSheetsExample",
|
|
45
45
|
input: z.object({
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* Uses the native Google Sheets plugin type from @superblocksteam/types.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { z } from "zod";
|
|
8
7
|
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
8
|
+
import type { z } from "zod";
|
|
9
|
+
|
|
9
10
|
import type { Plugin as GSheetsPlugin } from "@superblocksteam/types/dist/src/plugins/gsheets/v1/plugin_pb";
|
|
10
|
-
|
|
11
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
11
|
+
|
|
12
12
|
import { RestApiValidationError } from "../../errors.js";
|
|
13
13
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
14
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
15
|
+
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
14
16
|
import type {
|
|
15
17
|
GoogleSheetsClient,
|
|
16
18
|
GoogleSheetsAction,
|