@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
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# REST API Integration Client
|
|
2
|
+
|
|
3
|
+
Make HTTP requests to any REST API configured with a base URL and authentication in the integrations page.
|
|
4
|
+
|
|
5
|
+
This is the generic REST API Integration plugin. Unlike named integrations (Slack, GitHub, etc.) which target a specific service, this plugin works with **any** HTTP API you configure as an integration.
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
| Method | Description |
|
|
10
|
+
| ---------------------------------------- | -------------------------------------------- |
|
|
11
|
+
| `apiRequest(options, schema, metadata?)` | Make any HTTP request with schema validation |
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Basic GET Request
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { api, z, restApiIntegration } from "@superblocksteam/sdk-api";
|
|
19
|
+
|
|
20
|
+
// Integration ID from the integrations panel
|
|
21
|
+
const MY_API = "a1b2c3d4-5678-90ab-cdef-111111111111";
|
|
22
|
+
|
|
23
|
+
const UsersResponseSchema = z.object({
|
|
24
|
+
users: z.array(
|
|
25
|
+
z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
email: z.string(),
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export default api({
|
|
34
|
+
name: "FetchUsers",
|
|
35
|
+
integrations: {
|
|
36
|
+
myApi: restApiIntegration(MY_API),
|
|
37
|
+
},
|
|
38
|
+
input: z.object({}),
|
|
39
|
+
output: z.object({
|
|
40
|
+
users: z.array(
|
|
41
|
+
z.object({ id: z.string(), name: z.string(), email: z.string() }),
|
|
42
|
+
),
|
|
43
|
+
}),
|
|
44
|
+
async run(ctx) {
|
|
45
|
+
const result = await ctx.integrations.myApi.apiRequest(
|
|
46
|
+
{
|
|
47
|
+
method: "GET",
|
|
48
|
+
path: "/users",
|
|
49
|
+
params: { limit: 50 },
|
|
50
|
+
},
|
|
51
|
+
{ response: UsersResponseSchema },
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return { users: result.users };
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### POST Request with Body
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const CreateRecordSchema = z.object({
|
|
63
|
+
id: z.string(),
|
|
64
|
+
created_at: z.string(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const record = await ctx.integrations.myApi.apiRequest(
|
|
68
|
+
{
|
|
69
|
+
method: "POST",
|
|
70
|
+
path: "/records",
|
|
71
|
+
body: {
|
|
72
|
+
title: "New Record",
|
|
73
|
+
description: "Created via Superblocks",
|
|
74
|
+
tags: ["automated"],
|
|
75
|
+
},
|
|
76
|
+
headers: {
|
|
77
|
+
"Content-Type": "application/json",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{ response: CreateRecordSchema },
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
console.log(`Created record: ${record.id}`);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### PATCH/PUT Request
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const UpdateResponseSchema = z.object({
|
|
90
|
+
id: z.string(),
|
|
91
|
+
updated_at: z.string(),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
await ctx.integrations.myApi.apiRequest(
|
|
95
|
+
{
|
|
96
|
+
method: "PATCH",
|
|
97
|
+
path: `/records/${recordId}`,
|
|
98
|
+
body: {
|
|
99
|
+
title: "Updated Title",
|
|
100
|
+
status: "published",
|
|
101
|
+
},
|
|
102
|
+
headers: {
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{ response: UpdateResponseSchema },
|
|
107
|
+
);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### DELETE Request
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
await ctx.integrations.myApi.apiRequest(
|
|
114
|
+
{
|
|
115
|
+
method: "DELETE",
|
|
116
|
+
path: `/records/${recordId}`,
|
|
117
|
+
},
|
|
118
|
+
{ response: z.object({}).passthrough() },
|
|
119
|
+
);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Search with Query Parameters
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
const SearchResponseSchema = z.object({
|
|
126
|
+
items: z.array(
|
|
127
|
+
z.object({
|
|
128
|
+
id: z.string(),
|
|
129
|
+
title: z.string(),
|
|
130
|
+
score: z.number().optional(),
|
|
131
|
+
}),
|
|
132
|
+
),
|
|
133
|
+
total: z.number(),
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const results = await ctx.integrations.myApi.apiRequest(
|
|
137
|
+
{
|
|
138
|
+
method: "GET",
|
|
139
|
+
path: "/search",
|
|
140
|
+
params: {
|
|
141
|
+
q: "my query",
|
|
142
|
+
page: 1,
|
|
143
|
+
per_page: 25,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{ response: SearchResponseSchema },
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
console.log(`Found ${results.total} results`);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Using Multiple Integrations
|
|
153
|
+
|
|
154
|
+
You can use multiple REST API Integrations in a single API, each targeting a different service:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { api, z, restApiIntegration, postgres } from "@superblocksteam/sdk-api";
|
|
158
|
+
|
|
159
|
+
const EXTERNAL_API = "a1b2c3d4-5678-90ab-cdef-111111111111";
|
|
160
|
+
const INTERNAL_API = "e5f6a7b8-9012-34cd-ef56-222222222222";
|
|
161
|
+
const MY_DB = "c3d4e5f6-7890-12ab-cdef-333333333333";
|
|
162
|
+
|
|
163
|
+
export default api({
|
|
164
|
+
name: "SyncData",
|
|
165
|
+
integrations: {
|
|
166
|
+
externalApi: restApiIntegration(EXTERNAL_API),
|
|
167
|
+
internalApi: restApiIntegration(INTERNAL_API),
|
|
168
|
+
db: postgres(MY_DB),
|
|
169
|
+
},
|
|
170
|
+
input: z.object({ query: z.string() }),
|
|
171
|
+
output: z.object({ synced: z.number() }),
|
|
172
|
+
async run(ctx, { query }) {
|
|
173
|
+
// Fetch from external API
|
|
174
|
+
const external = await ctx.integrations.externalApi.apiRequest(
|
|
175
|
+
{ method: "GET", path: "/data", params: { q: query } },
|
|
176
|
+
{ response: z.object({ items: z.array(z.unknown()) }) },
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
// Push to internal API
|
|
180
|
+
await ctx.integrations.internalApi.apiRequest(
|
|
181
|
+
{ method: "POST", path: "/import", body: { items: external.items } },
|
|
182
|
+
{ response: z.object({ imported: z.number() }) },
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
return { synced: external.items.length };
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Trace Metadata
|
|
191
|
+
|
|
192
|
+
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.
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const result = await ctx.integrations.myApi.apiRequest(
|
|
196
|
+
{ method: "GET", path: "/users" },
|
|
197
|
+
{ response: UsersResponseSchema },
|
|
198
|
+
{ label: "myApi.getUsers", description: "Fetch all active users" },
|
|
199
|
+
);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Common Pitfalls
|
|
203
|
+
|
|
204
|
+
### No `.request()` Method
|
|
205
|
+
|
|
206
|
+
The only public method is `apiRequest()`. There is no `.request()` method:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// WRONG - .request() does not exist
|
|
210
|
+
await ctx.integrations.myApi.request({
|
|
211
|
+
method: "GET",
|
|
212
|
+
path: "/users",
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// CORRECT - Use apiRequest with a response schema
|
|
216
|
+
await ctx.integrations.myApi.apiRequest(
|
|
217
|
+
{ method: "GET", path: "/users" },
|
|
218
|
+
{ response: UsersResponseSchema },
|
|
219
|
+
);
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Response Schema is Required
|
|
223
|
+
|
|
224
|
+
`apiRequest()` requires a response schema for type safety:
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
// WRONG - Missing response schema
|
|
228
|
+
const result = await ctx.integrations.myApi.apiRequest({
|
|
229
|
+
method: "GET",
|
|
230
|
+
path: "/users",
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// CORRECT - Provide a response schema
|
|
234
|
+
const result = await ctx.integrations.myApi.apiRequest(
|
|
235
|
+
{ method: "GET", path: "/users" },
|
|
236
|
+
{ response: z.object({ users: z.array(z.unknown()) }) },
|
|
237
|
+
);
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Use `body` Instead of `JSON.stringify`
|
|
241
|
+
|
|
242
|
+
The `body` field is automatically serialized. Do not stringify it manually:
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
// WRONG - Manual stringify
|
|
246
|
+
await ctx.integrations.myApi.apiRequest(
|
|
247
|
+
{
|
|
248
|
+
method: "POST",
|
|
249
|
+
path: "/records",
|
|
250
|
+
body: JSON.stringify({ title: "New" }),
|
|
251
|
+
},
|
|
252
|
+
{ response: ResponseSchema },
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
// CORRECT - Pass object directly
|
|
256
|
+
await ctx.integrations.myApi.apiRequest(
|
|
257
|
+
{
|
|
258
|
+
method: "POST",
|
|
259
|
+
path: "/records",
|
|
260
|
+
body: { title: "New" },
|
|
261
|
+
},
|
|
262
|
+
{ response: ResponseSchema },
|
|
263
|
+
);
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Use `params` for Query Parameters
|
|
267
|
+
|
|
268
|
+
Query parameters go in the `params` field, not in the URL path:
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
// WRONG - Query params in path
|
|
272
|
+
await ctx.integrations.myApi.apiRequest(
|
|
273
|
+
{ method: "GET", path: "/search?q=hello&limit=10" },
|
|
274
|
+
{ response: ResponseSchema },
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
// CORRECT - Use params field
|
|
278
|
+
await ctx.integrations.myApi.apiRequest(
|
|
279
|
+
{
|
|
280
|
+
method: "GET",
|
|
281
|
+
path: "/search",
|
|
282
|
+
params: { q: "hello", limit: 10 },
|
|
283
|
+
},
|
|
284
|
+
{ response: ResponseSchema },
|
|
285
|
+
);
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Use `.passthrough()` for Flexible Schemas
|
|
289
|
+
|
|
290
|
+
When the response contains fields you don't need to validate, use `.passthrough()`:
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
// Strict schema - will reject unknown fields
|
|
294
|
+
const StrictSchema = z.object({ id: z.string() });
|
|
295
|
+
|
|
296
|
+
// Flexible schema - allows additional fields
|
|
297
|
+
const FlexibleSchema = z.object({ id: z.string() }).passthrough();
|
|
298
|
+
|
|
299
|
+
// For dynamic responses
|
|
300
|
+
const GenericSchema = z.record(z.unknown());
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Error Handling
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
import { RestApiValidationError } from "@superblocksteam/sdk-api";
|
|
307
|
+
|
|
308
|
+
try {
|
|
309
|
+
const result = await ctx.integrations.myApi.apiRequest(
|
|
310
|
+
{ method: "GET", path: "/users" },
|
|
311
|
+
{ response: UsersResponseSchema },
|
|
312
|
+
);
|
|
313
|
+
} catch (error) {
|
|
314
|
+
if (error instanceof RestApiValidationError) {
|
|
315
|
+
// Response didn't match the schema
|
|
316
|
+
console.error("Validation failed:", error.details.zodError);
|
|
317
|
+
console.error("Actual response:", error.details.data);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
@@ -3,10 +3,7 @@
|
|
|
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
|
* REST API Integration client for making HTTP requests to configured endpoints.
|
|
@@ -34,7 +31,4 @@ import type {
|
|
|
34
31
|
* ```
|
|
35
32
|
*/
|
|
36
33
|
export interface RestApiIntegrationPluginClient
|
|
37
|
-
extends
|
|
38
|
-
BaseIntegrationClient,
|
|
39
|
-
SupportsApiRequest,
|
|
40
|
-
SupportsStreamingApiRequest {}
|
|
34
|
+
extends BaseIntegrationClient, SupportsApiRequest {}
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* Uses the native S3 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 S3Plugin } from "@superblocksteam/types/dist/src/plugins/s3/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
|
S3Client,
|
|
16
18
|
S3Action,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { z } from "zod";
|
|
6
|
+
|
|
6
7
|
import type { BaseIntegrationClient } from "../../types.js";
|
|
7
8
|
import type { TraceMetadata } from "../registry.js";
|
|
8
9
|
|
|
@@ -129,7 +130,9 @@ export interface S3Client extends BaseIntegrationClient {
|
|
|
129
130
|
*
|
|
130
131
|
* @param bucket - Bucket name
|
|
131
132
|
* @param path - Object key/path
|
|
132
|
-
* @param body -
|
|
133
|
+
* @param body - String content stored verbatim (no base64 decoding is performed).
|
|
134
|
+
* Suitable for plain text, JSON, or CSV. For binary files (PDF, DOCX, images),
|
|
135
|
+
* use {@link S3Client.uploadMultipleObjects | uploadMultipleObjects} with file references instead.
|
|
133
136
|
* @param metadata - Optional trace metadata for diagnostics
|
|
134
137
|
*/
|
|
135
138
|
uploadObject(
|
|
@@ -77,7 +77,7 @@ const opportunities = await ctx.integrations.salesforce.query(
|
|
|
77
77
|
### Create a Record
|
|
78
78
|
|
|
79
79
|
```typescript
|
|
80
|
-
await salesforce.create("Account", {
|
|
80
|
+
await ctx.integrations.salesforce.create("Account", {
|
|
81
81
|
Name: "Acme Corp",
|
|
82
82
|
Industry: "Technology",
|
|
83
83
|
Website: "https://acme.example.com",
|
|
@@ -87,7 +87,7 @@ await salesforce.create("Account", {
|
|
|
87
87
|
### Read a Record by ID
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
|
-
const account = await salesforce.read(
|
|
90
|
+
const account = await ctx.integrations.salesforce.read(
|
|
91
91
|
"Account",
|
|
92
92
|
"001xx000003DGb2AAG",
|
|
93
93
|
z.object({
|
|
@@ -101,7 +101,7 @@ const account = await salesforce.read(
|
|
|
101
101
|
### Update a Record
|
|
102
102
|
|
|
103
103
|
```typescript
|
|
104
|
-
await salesforce.update("Account", "001xx000003DGb2AAG", {
|
|
104
|
+
await ctx.integrations.salesforce.update("Account", "001xx000003DGb2AAG", {
|
|
105
105
|
Name: "Acme Corp (Updated)",
|
|
106
106
|
Industry: "Software",
|
|
107
107
|
});
|
|
@@ -116,7 +116,7 @@ await ctx.integrations.salesforce.remove("Account", "001xx000003DGb2AAG");
|
|
|
116
116
|
### Bulk Create
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
|
-
await salesforce.bulkCreate("Contact", [
|
|
119
|
+
await ctx.integrations.salesforce.bulkCreate("Contact", [
|
|
120
120
|
{ FirstName: "Alice", LastName: "Smith", Email: "alice@example.com" },
|
|
121
121
|
{ FirstName: "Bob", LastName: "Jones", Email: "bob@example.com" },
|
|
122
122
|
{ FirstName: "Charlie", LastName: "Lee", Email: "charlie@example.com" },
|
|
@@ -126,7 +126,7 @@ await salesforce.bulkCreate("Contact", [
|
|
|
126
126
|
### Bulk Update
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
|
-
await salesforce.bulkUpdate("Contact", [
|
|
129
|
+
await ctx.integrations.salesforce.bulkUpdate("Contact", [
|
|
130
130
|
{ Id: "003xx000004TmiQAAS", Email: "alice-new@example.com" },
|
|
131
131
|
{ Id: "003xx000004TmiRAAS", Email: "bob-new@example.com" },
|
|
132
132
|
]);
|
|
@@ -135,7 +135,7 @@ await salesforce.bulkUpdate("Contact", [
|
|
|
135
135
|
### Bulk Delete
|
|
136
136
|
|
|
137
137
|
```typescript
|
|
138
|
-
await salesforce.bulkDelete("Contact", [
|
|
138
|
+
await ctx.integrations.salesforce.bulkDelete("Contact", [
|
|
139
139
|
{ Id: "003xx000004TmiQAAS" },
|
|
140
140
|
{ Id: "003xx000004TmiRAAS" },
|
|
141
141
|
]);
|
|
@@ -144,7 +144,7 @@ await salesforce.bulkDelete("Contact", [
|
|
|
144
144
|
### Bulk Upsert
|
|
145
145
|
|
|
146
146
|
```typescript
|
|
147
|
-
await salesforce.bulkUpsert(
|
|
147
|
+
await ctx.integrations.salesforce.bulkUpsert(
|
|
148
148
|
"Account",
|
|
149
149
|
[
|
|
150
150
|
{ ExternalId__c: "EXT-001", Name: "Acme Corp", Industry: "Tech" },
|
|
@@ -198,12 +198,14 @@ Bulk update and delete records must include the `Id` field:
|
|
|
198
198
|
|
|
199
199
|
```typescript
|
|
200
200
|
// CORRECT
|
|
201
|
-
await salesforce.bulkUpdate("Contact", [
|
|
201
|
+
await ctx.integrations.salesforce.bulkUpdate("Contact", [
|
|
202
202
|
{ Id: "003xx000004TmiQAAS", Email: "new@example.com" },
|
|
203
203
|
]);
|
|
204
204
|
|
|
205
205
|
// WRONG - Missing Id field
|
|
206
|
-
await salesforce.bulkUpdate("Contact", [
|
|
206
|
+
await ctx.integrations.salesforce.bulkUpdate("Contact", [
|
|
207
|
+
{ Email: "new@example.com" },
|
|
208
|
+
]);
|
|
207
209
|
```
|
|
208
210
|
|
|
209
211
|
## Error Handling
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { z } from "zod";
|
|
9
|
-
|
|
10
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
9
|
+
|
|
11
10
|
import { QueryValidationError, RestApiValidationError } from "../../errors.js";
|
|
12
11
|
import { IntegrationError } from "../../runtime/errors.js";
|
|
12
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
13
|
+
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
13
14
|
import { describeType } from "../utils.js";
|
|
14
15
|
import type { SalesforceClient } from "./types.js";
|
|
15
16
|
|
|
@@ -13,7 +13,7 @@ Send transactional emails, manage contacts, and interact with SendGrid's email A
|
|
|
13
13
|
### Send a Simple Email
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { api, z,
|
|
16
|
+
import { api, z, sendGrid } from "@superblocksteam/sdk-api";
|
|
17
17
|
|
|
18
18
|
// Integration ID from the integrations panel
|
|
19
19
|
const PROD_SENDGRID = "a1b2c3d4-5678-90ab-cdef-sendgrid0001";
|
|
@@ -23,7 +23,7 @@ const SendEmailResponseSchema = z.object({}).optional();
|
|
|
23
23
|
|
|
24
24
|
export default api({
|
|
25
25
|
integrations: {
|
|
26
|
-
sendgrid:
|
|
26
|
+
sendgrid: sendGrid(PROD_SENDGRID),
|
|
27
27
|
},
|
|
28
28
|
name: "SendGridExample",
|
|
29
29
|
input: z.object({
|