@superblocksteam/sdk-api 2.0.93 → 2.0.94-next.1
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 +137 -98
- package/dist/api/definition.d.ts +10 -0
- package/dist/api/definition.d.ts.map +1 -1
- package/dist/api/definition.js +17 -0
- package/dist/api/definition.js.map +1 -1
- package/dist/api/definition.test.d.ts +1 -1
- package/dist/api/definition.test.js +56 -3
- package/dist/api/definition.test.js.map +1 -1
- package/dist/api/index.d.ts +4 -4
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/streaming.d.ts +17 -3
- package/dist/api/streaming.d.ts.map +1 -1
- package/dist/api/streaming.js +10 -7
- package/dist/api/streaming.js.map +1 -1
- package/dist/api/streaming.test.js +147 -80
- package/dist/api/streaming.test.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +5 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/airtable/client.d.ts +2 -2
- package/dist/integrations/airtable/client.d.ts.map +1 -1
- package/dist/integrations/airtable/client.js +1 -1
- package/dist/integrations/airtable/client.js.map +1 -1
- package/dist/integrations/airtable/index.d.ts +2 -2
- package/dist/integrations/airtable/index.js +1 -1
- package/dist/integrations/airtable/types.d.ts +5 -10
- package/dist/integrations/airtable/types.d.ts.map +1 -1
- package/dist/integrations/anthropic/client.d.ts +2 -2
- package/dist/integrations/anthropic/client.d.ts.map +1 -1
- package/dist/integrations/anthropic/client.js +1 -1
- package/dist/integrations/anthropic/client.js.map +1 -1
- package/dist/integrations/anthropic/index.d.ts +2 -2
- package/dist/integrations/anthropic/index.js +1 -1
- package/dist/integrations/anthropic/types.d.ts +5 -4
- package/dist/integrations/anthropic/types.d.ts.map +1 -1
- package/dist/integrations/asana/client.d.ts +2 -2
- package/dist/integrations/asana/client.d.ts.map +1 -1
- package/dist/integrations/asana/client.js +1 -1
- package/dist/integrations/asana/client.js.map +1 -1
- package/dist/integrations/asana/index.d.ts +2 -2
- package/dist/integrations/asana/index.js +1 -1
- package/dist/integrations/asana/types.d.ts +4 -3
- package/dist/integrations/asana/types.d.ts.map +1 -1
- package/dist/integrations/athena/client.d.ts +4 -4
- package/dist/integrations/athena/client.d.ts.map +1 -1
- package/dist/integrations/athena/client.js +8 -8
- package/dist/integrations/athena/client.js.map +1 -1
- package/dist/integrations/athena/index.d.ts +2 -2
- package/dist/integrations/athena/index.js +1 -1
- package/dist/integrations/athena/types.d.ts +4 -3
- package/dist/integrations/athena/types.d.ts.map +1 -1
- package/dist/integrations/base/graphql-integration-client.d.ts +3 -3
- package/dist/integrations/base/graphql-integration-client.js +3 -3
- package/dist/integrations/base/index.d.ts +4 -4
- package/dist/integrations/base/index.js +2 -2
- package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.js +1 -1
- package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
- package/dist/integrations/base/types.d.ts +5 -10
- package/dist/integrations/base/types.d.ts.map +1 -1
- package/dist/integrations/bigquery/client.d.ts +4 -4
- package/dist/integrations/bigquery/client.d.ts.map +1 -1
- package/dist/integrations/bigquery/client.js +8 -8
- package/dist/integrations/bigquery/client.js.map +1 -1
- package/dist/integrations/bigquery/index.d.ts +2 -2
- package/dist/integrations/bigquery/index.js +1 -1
- package/dist/integrations/bigquery/types.d.ts +4 -3
- package/dist/integrations/bigquery/types.d.ts.map +1 -1
- package/dist/integrations/bitbucket/client.d.ts +2 -2
- package/dist/integrations/bitbucket/client.d.ts.map +1 -1
- package/dist/integrations/bitbucket/client.js +1 -1
- package/dist/integrations/bitbucket/client.js.map +1 -1
- package/dist/integrations/bitbucket/index.d.ts +2 -2
- package/dist/integrations/bitbucket/index.js +1 -1
- package/dist/integrations/bitbucket/types.d.ts +4 -3
- package/dist/integrations/bitbucket/types.d.ts.map +1 -1
- package/dist/integrations/box/client.d.ts +2 -2
- package/dist/integrations/box/client.d.ts.map +1 -1
- package/dist/integrations/box/client.js +1 -1
- package/dist/integrations/box/client.js.map +1 -1
- package/dist/integrations/box/index.d.ts +2 -2
- package/dist/integrations/box/index.js +1 -1
- package/dist/integrations/box/types.d.ts +4 -3
- package/dist/integrations/box/types.d.ts.map +1 -1
- package/dist/integrations/circleci/client.d.ts +2 -2
- package/dist/integrations/circleci/client.d.ts.map +1 -1
- package/dist/integrations/circleci/client.js +1 -1
- package/dist/integrations/circleci/client.js.map +1 -1
- package/dist/integrations/circleci/index.d.ts +2 -2
- package/dist/integrations/circleci/index.js +1 -1
- package/dist/integrations/circleci/types.d.ts +4 -3
- package/dist/integrations/circleci/types.d.ts.map +1 -1
- package/dist/integrations/cockroachdb/client.d.ts +4 -4
- package/dist/integrations/cockroachdb/client.d.ts.map +1 -1
- package/dist/integrations/cockroachdb/client.js +8 -8
- package/dist/integrations/cockroachdb/client.js.map +1 -1
- package/dist/integrations/cockroachdb/index.d.ts +2 -2
- package/dist/integrations/cockroachdb/index.js +1 -1
- package/dist/integrations/cockroachdb/types.d.ts +4 -3
- package/dist/integrations/cockroachdb/types.d.ts.map +1 -1
- package/dist/integrations/cohere/client.d.ts +2 -2
- package/dist/integrations/cohere/client.d.ts.map +1 -1
- package/dist/integrations/cohere/client.js +1 -1
- package/dist/integrations/cohere/client.js.map +1 -1
- package/dist/integrations/cohere/index.d.ts +2 -2
- package/dist/integrations/cohere/index.js +1 -1
- package/dist/integrations/cohere/types.d.ts +5 -10
- package/dist/integrations/cohere/types.d.ts.map +1 -1
- package/dist/integrations/confluence/client.d.ts +2 -2
- package/dist/integrations/confluence/client.d.ts.map +1 -1
- package/dist/integrations/confluence/client.js +1 -1
- package/dist/integrations/confluence/client.js.map +1 -1
- package/dist/integrations/confluence/index.d.ts +2 -2
- package/dist/integrations/confluence/index.js +1 -1
- package/dist/integrations/confluence/types.d.ts +4 -3
- package/dist/integrations/confluence/types.d.ts.map +1 -1
- package/dist/integrations/cosmosdb/client.d.ts +4 -4
- package/dist/integrations/cosmosdb/client.d.ts.map +1 -1
- package/dist/integrations/cosmosdb/client.js +23 -23
- package/dist/integrations/cosmosdb/client.js.map +1 -1
- package/dist/integrations/cosmosdb/index.d.ts +2 -2
- package/dist/integrations/cosmosdb/index.js +1 -1
- package/dist/integrations/cosmosdb/types.d.ts +4 -3
- package/dist/integrations/cosmosdb/types.d.ts.map +1 -1
- package/dist/integrations/couchbase/client.d.ts +4 -4
- package/dist/integrations/couchbase/client.d.ts.map +1 -1
- package/dist/integrations/couchbase/client.js +13 -13
- package/dist/integrations/couchbase/client.js.map +1 -1
- package/dist/integrations/couchbase/index.d.ts +2 -2
- package/dist/integrations/couchbase/index.js +1 -1
- package/dist/integrations/couchbase/types.d.ts +8 -7
- package/dist/integrations/couchbase/types.d.ts.map +1 -1
- package/dist/integrations/databricks/client.d.ts +4 -4
- package/dist/integrations/databricks/client.d.ts.map +1 -1
- package/dist/integrations/databricks/client.js +8 -8
- package/dist/integrations/databricks/client.js.map +1 -1
- package/dist/integrations/databricks/index.d.ts +2 -2
- package/dist/integrations/databricks/index.js +1 -1
- package/dist/integrations/databricks/types.d.ts +4 -3
- package/dist/integrations/databricks/types.d.ts.map +1 -1
- package/dist/integrations/datadog/client.d.ts +2 -2
- package/dist/integrations/datadog/client.d.ts.map +1 -1
- package/dist/integrations/datadog/client.js +1 -1
- package/dist/integrations/datadog/client.js.map +1 -1
- package/dist/integrations/datadog/index.d.ts +2 -2
- package/dist/integrations/datadog/index.js +1 -1
- package/dist/integrations/datadog/types.d.ts +4 -3
- package/dist/integrations/datadog/types.d.ts.map +1 -1
- package/dist/integrations/declarations.d.ts +130 -130
- package/dist/integrations/declarations.d.ts.map +1 -1
- package/dist/integrations/declarations.js +66 -66
- package/dist/integrations/declarations.js.map +1 -1
- package/dist/integrations/dropbox/client.d.ts +2 -2
- package/dist/integrations/dropbox/client.d.ts.map +1 -1
- package/dist/integrations/dropbox/client.js +1 -1
- package/dist/integrations/dropbox/client.js.map +1 -1
- package/dist/integrations/dropbox/index.d.ts +2 -2
- package/dist/integrations/dropbox/index.js +1 -1
- package/dist/integrations/dropbox/types.d.ts +4 -3
- package/dist/integrations/dropbox/types.d.ts.map +1 -1
- package/dist/integrations/dynamodb/client.d.ts +4 -4
- package/dist/integrations/dynamodb/client.d.ts.map +1 -1
- package/dist/integrations/dynamodb/client.js +30 -30
- package/dist/integrations/dynamodb/client.js.map +1 -1
- package/dist/integrations/dynamodb/index.d.ts +2 -2
- package/dist/integrations/dynamodb/index.js +1 -1
- package/dist/integrations/dynamodb/types.d.ts +10 -9
- package/dist/integrations/dynamodb/types.d.ts.map +1 -1
- package/dist/integrations/elasticsearch/client.d.ts +2 -2
- package/dist/integrations/elasticsearch/client.d.ts.map +1 -1
- package/dist/integrations/elasticsearch/client.js +1 -1
- package/dist/integrations/elasticsearch/client.js.map +1 -1
- package/dist/integrations/elasticsearch/index.d.ts +2 -2
- package/dist/integrations/elasticsearch/index.js +1 -1
- package/dist/integrations/elasticsearch/types.d.ts +4 -3
- package/dist/integrations/elasticsearch/types.d.ts.map +1 -1
- package/dist/integrations/fireworks/client.d.ts +2 -2
- package/dist/integrations/fireworks/client.d.ts.map +1 -1
- package/dist/integrations/fireworks/client.js +1 -1
- package/dist/integrations/fireworks/client.js.map +1 -1
- package/dist/integrations/fireworks/index.d.ts +2 -2
- package/dist/integrations/fireworks/index.js +1 -1
- package/dist/integrations/fireworks/types.d.ts +4 -3
- package/dist/integrations/fireworks/types.d.ts.map +1 -1
- package/dist/integrations/front/client.d.ts +2 -2
- package/dist/integrations/front/client.d.ts.map +1 -1
- package/dist/integrations/front/client.js +1 -1
- package/dist/integrations/front/client.js.map +1 -1
- package/dist/integrations/front/index.d.ts +2 -2
- package/dist/integrations/front/index.js +1 -1
- package/dist/integrations/front/types.d.ts +4 -3
- package/dist/integrations/front/types.d.ts.map +1 -1
- package/dist/integrations/gcs/client.d.ts +4 -4
- package/dist/integrations/gcs/client.js +20 -20
- package/dist/integrations/gcs/index.d.ts +2 -2
- package/dist/integrations/gcs/index.js +1 -1
- package/dist/integrations/gcs/types.d.ts +3 -3
- package/dist/integrations/gcs/types.d.ts.map +1 -1
- package/dist/integrations/gemini/client.d.ts +2 -2
- package/dist/integrations/gemini/client.d.ts.map +1 -1
- package/dist/integrations/gemini/client.js +1 -1
- package/dist/integrations/gemini/client.js.map +1 -1
- package/dist/integrations/gemini/index.d.ts +2 -2
- package/dist/integrations/gemini/index.js +1 -1
- package/dist/integrations/gemini/types.d.ts +4 -3
- package/dist/integrations/gemini/types.d.ts.map +1 -1
- package/dist/integrations/github/client.d.ts +2 -2
- package/dist/integrations/github/client.d.ts.map +1 -1
- package/dist/integrations/github/client.js +1 -1
- package/dist/integrations/github/client.js.map +1 -1
- package/dist/integrations/github/index.d.ts +2 -2
- package/dist/integrations/github/index.js +1 -1
- package/dist/integrations/github/types.d.ts +6 -5
- package/dist/integrations/github/types.d.ts.map +1 -1
- package/dist/integrations/googleanalytics/client.d.ts +2 -2
- package/dist/integrations/googleanalytics/client.d.ts.map +1 -1
- package/dist/integrations/googleanalytics/client.js +1 -1
- package/dist/integrations/googleanalytics/client.js.map +1 -1
- package/dist/integrations/googleanalytics/index.d.ts +2 -2
- package/dist/integrations/googleanalytics/index.js +1 -1
- package/dist/integrations/googleanalytics/types.d.ts +4 -3
- package/dist/integrations/googleanalytics/types.d.ts.map +1 -1
- package/dist/integrations/googledrive/client.d.ts +2 -2
- package/dist/integrations/googledrive/client.d.ts.map +1 -1
- package/dist/integrations/googledrive/client.js +1 -1
- package/dist/integrations/googledrive/client.js.map +1 -1
- package/dist/integrations/googledrive/index.d.ts +2 -2
- package/dist/integrations/googledrive/index.js +1 -1
- package/dist/integrations/googledrive/types.d.ts +4 -3
- package/dist/integrations/googledrive/types.d.ts.map +1 -1
- package/dist/integrations/graphql/client.d.ts +2 -2
- package/dist/integrations/graphql/client.d.ts.map +1 -1
- package/dist/integrations/graphql/client.js +1 -1
- package/dist/integrations/graphql/client.js.map +1 -1
- package/dist/integrations/graphql/index.d.ts +2 -2
- package/dist/integrations/graphql/index.js +1 -1
- package/dist/integrations/graphql/types.d.ts +4 -3
- package/dist/integrations/graphql/types.d.ts.map +1 -1
- package/dist/integrations/groq/client.d.ts +2 -2
- package/dist/integrations/groq/client.d.ts.map +1 -1
- package/dist/integrations/groq/client.js +1 -1
- package/dist/integrations/groq/client.js.map +1 -1
- package/dist/integrations/groq/index.d.ts +2 -2
- package/dist/integrations/groq/index.js +1 -1
- package/dist/integrations/groq/types.d.ts +4 -3
- package/dist/integrations/groq/types.d.ts.map +1 -1
- package/dist/integrations/gsheets/client.d.ts +4 -4
- package/dist/integrations/gsheets/client.d.ts.map +1 -1
- package/dist/integrations/gsheets/client.js +3 -3
- package/dist/integrations/gsheets/client.js.map +1 -1
- package/dist/integrations/gsheets/index.d.ts +2 -2
- package/dist/integrations/gsheets/index.js +1 -1
- package/dist/integrations/gsheets/types.d.ts +7 -6
- package/dist/integrations/gsheets/types.d.ts.map +1 -1
- package/dist/integrations/hubspot/client.d.ts +2 -2
- package/dist/integrations/hubspot/client.d.ts.map +1 -1
- package/dist/integrations/hubspot/client.js +1 -1
- package/dist/integrations/hubspot/client.js.map +1 -1
- package/dist/integrations/hubspot/index.d.ts +2 -2
- package/dist/integrations/hubspot/index.js +1 -1
- package/dist/integrations/hubspot/types.d.ts +4 -3
- package/dist/integrations/hubspot/types.d.ts.map +1 -1
- package/dist/integrations/index.d.ts +131 -131
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +66 -66
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/intercom/client.d.ts +2 -2
- package/dist/integrations/intercom/client.d.ts.map +1 -1
- package/dist/integrations/intercom/client.js +1 -1
- package/dist/integrations/intercom/client.js.map +1 -1
- package/dist/integrations/intercom/index.d.ts +2 -2
- package/dist/integrations/intercom/index.js +1 -1
- package/dist/integrations/intercom/types.d.ts +4 -3
- package/dist/integrations/intercom/types.d.ts.map +1 -1
- package/dist/integrations/jira/client.d.ts +2 -2
- package/dist/integrations/jira/client.d.ts.map +1 -1
- package/dist/integrations/jira/client.js +1 -1
- package/dist/integrations/jira/client.js.map +1 -1
- package/dist/integrations/jira/index.d.ts +2 -2
- package/dist/integrations/jira/index.js +1 -1
- package/dist/integrations/jira/types.d.ts +4 -3
- package/dist/integrations/jira/types.d.ts.map +1 -1
- package/dist/integrations/kafka/client.d.ts +4 -4
- package/dist/integrations/kafka/client.d.ts.map +1 -1
- package/dist/integrations/kafka/client.js +19 -17
- package/dist/integrations/kafka/client.js.map +1 -1
- package/dist/integrations/kafka/index.d.ts +2 -2
- package/dist/integrations/kafka/index.js +1 -1
- package/dist/integrations/kafka/types.d.ts +8 -7
- package/dist/integrations/kafka/types.d.ts.map +1 -1
- package/dist/integrations/kinesis/client.d.ts +3 -3
- package/dist/integrations/kinesis/client.d.ts.map +1 -1
- package/dist/integrations/kinesis/client.js +5 -5
- package/dist/integrations/kinesis/client.js.map +1 -1
- package/dist/integrations/kinesis/index.d.ts +2 -2
- package/dist/integrations/kinesis/index.js +1 -1
- package/dist/integrations/kinesis/types.d.ts +5 -4
- package/dist/integrations/kinesis/types.d.ts.map +1 -1
- package/dist/integrations/lakebase/client.d.ts +4 -4
- package/dist/integrations/lakebase/client.d.ts.map +1 -1
- package/dist/integrations/lakebase/client.js +8 -8
- package/dist/integrations/lakebase/client.js.map +1 -1
- package/dist/integrations/lakebase/index.d.ts +2 -2
- package/dist/integrations/lakebase/index.js +1 -1
- package/dist/integrations/lakebase/types.d.ts +2 -2
- package/dist/integrations/lakebase/types.d.ts.map +1 -1
- package/dist/integrations/launchdarkly/client.d.ts +2 -2
- package/dist/integrations/launchdarkly/client.d.ts.map +1 -1
- package/dist/integrations/launchdarkly/client.js +1 -1
- package/dist/integrations/launchdarkly/client.js.map +1 -1
- package/dist/integrations/launchdarkly/index.d.ts +2 -2
- package/dist/integrations/launchdarkly/index.js +1 -1
- package/dist/integrations/launchdarkly/types.d.ts +4 -3
- package/dist/integrations/launchdarkly/types.d.ts.map +1 -1
- package/dist/integrations/mariadb/client.d.ts +4 -4
- package/dist/integrations/mariadb/client.d.ts.map +1 -1
- package/dist/integrations/mariadb/client.js +8 -8
- package/dist/integrations/mariadb/client.js.map +1 -1
- package/dist/integrations/mariadb/index.d.ts +2 -2
- package/dist/integrations/mariadb/index.js +1 -1
- package/dist/integrations/mariadb/types.d.ts +4 -3
- package/dist/integrations/mariadb/types.d.ts.map +1 -1
- package/dist/integrations/mistral/client.d.ts +2 -2
- package/dist/integrations/mistral/client.d.ts.map +1 -1
- package/dist/integrations/mistral/client.js +1 -1
- package/dist/integrations/mistral/client.js.map +1 -1
- package/dist/integrations/mistral/index.d.ts +2 -2
- package/dist/integrations/mistral/index.js +1 -1
- package/dist/integrations/mistral/types.d.ts +4 -3
- package/dist/integrations/mistral/types.d.ts.map +1 -1
- package/dist/integrations/mongodb/client.d.ts +4 -4
- package/dist/integrations/mongodb/client.d.ts.map +1 -1
- package/dist/integrations/mongodb/client.js +3 -3
- package/dist/integrations/mongodb/client.js.map +1 -1
- package/dist/integrations/mongodb/index.d.ts +2 -2
- package/dist/integrations/mongodb/index.js +1 -1
- package/dist/integrations/mongodb/types.d.ts +5 -4
- package/dist/integrations/mongodb/types.d.ts.map +1 -1
- package/dist/integrations/mssql/client.d.ts +4 -4
- package/dist/integrations/mssql/client.d.ts.map +1 -1
- package/dist/integrations/mssql/client.js +8 -8
- package/dist/integrations/mssql/client.js.map +1 -1
- package/dist/integrations/mssql/index.d.ts +2 -2
- package/dist/integrations/mssql/index.js +1 -1
- package/dist/integrations/mssql/types.d.ts +4 -3
- package/dist/integrations/mssql/types.d.ts.map +1 -1
- package/dist/integrations/mysql/client.d.ts +4 -4
- package/dist/integrations/mysql/client.d.ts.map +1 -1
- package/dist/integrations/mysql/client.js +8 -8
- package/dist/integrations/mysql/client.js.map +1 -1
- package/dist/integrations/mysql/index.d.ts +2 -2
- package/dist/integrations/mysql/index.js +1 -1
- package/dist/integrations/mysql/types.d.ts +4 -3
- package/dist/integrations/mysql/types.d.ts.map +1 -1
- package/dist/integrations/notion/client.d.ts +2 -2
- package/dist/integrations/notion/client.d.ts.map +1 -1
- package/dist/integrations/notion/client.js +1 -1
- package/dist/integrations/notion/client.js.map +1 -1
- package/dist/integrations/notion/index.d.ts +2 -2
- package/dist/integrations/notion/index.js +1 -1
- package/dist/integrations/notion/types.d.ts +6 -5
- package/dist/integrations/notion/types.d.ts.map +1 -1
- package/dist/integrations/openai_v2/client.d.ts +2 -2
- package/dist/integrations/openai_v2/client.d.ts.map +1 -1
- package/dist/integrations/openai_v2/client.js +1 -1
- package/dist/integrations/openai_v2/client.js.map +1 -1
- package/dist/integrations/openai_v2/index.d.ts +2 -2
- package/dist/integrations/openai_v2/index.js +1 -1
- package/dist/integrations/openai_v2/types.d.ts +5 -4
- package/dist/integrations/openai_v2/types.d.ts.map +1 -1
- package/dist/integrations/oracledb/client.d.ts +4 -4
- package/dist/integrations/oracledb/client.d.ts.map +1 -1
- package/dist/integrations/oracledb/client.js +8 -8
- package/dist/integrations/oracledb/client.js.map +1 -1
- package/dist/integrations/oracledb/index.d.ts +2 -2
- package/dist/integrations/oracledb/index.js +1 -1
- package/dist/integrations/oracledb/types.d.ts +4 -3
- package/dist/integrations/oracledb/types.d.ts.map +1 -1
- package/dist/integrations/pagerduty/client.d.ts +2 -2
- package/dist/integrations/pagerduty/client.d.ts.map +1 -1
- package/dist/integrations/pagerduty/client.js +1 -1
- package/dist/integrations/pagerduty/client.js.map +1 -1
- package/dist/integrations/pagerduty/index.d.ts +2 -2
- package/dist/integrations/pagerduty/index.js +1 -1
- package/dist/integrations/pagerduty/types.d.ts +4 -3
- package/dist/integrations/pagerduty/types.d.ts.map +1 -1
- package/dist/integrations/perplexity/client.d.ts +2 -2
- package/dist/integrations/perplexity/client.d.ts.map +1 -1
- package/dist/integrations/perplexity/client.js +1 -1
- package/dist/integrations/perplexity/client.js.map +1 -1
- package/dist/integrations/perplexity/index.d.ts +2 -2
- package/dist/integrations/perplexity/index.js +1 -1
- package/dist/integrations/perplexity/types.d.ts +4 -3
- package/dist/integrations/perplexity/types.d.ts.map +1 -1
- package/dist/integrations/postgres/client.d.ts +6 -6
- package/dist/integrations/postgres/client.d.ts.map +1 -1
- package/dist/integrations/postgres/client.js +8 -8
- package/dist/integrations/postgres/client.js.map +1 -1
- package/dist/integrations/postgres/index.d.ts +2 -2
- package/dist/integrations/postgres/index.js +1 -1
- package/dist/integrations/postgres/types.d.ts +8 -7
- package/dist/integrations/postgres/types.d.ts.map +1 -1
- package/dist/integrations/python/client.d.ts +6 -6
- package/dist/integrations/python/client.d.ts.map +1 -1
- package/dist/integrations/python/client.js +5 -5
- package/dist/integrations/python/client.js.map +1 -1
- package/dist/integrations/python/client.test.js +82 -63
- package/dist/integrations/python/client.test.js.map +1 -1
- package/dist/integrations/python/index.d.ts +2 -2
- package/dist/integrations/python/index.js +1 -1
- package/dist/integrations/python/types.d.ts +5 -5
- package/dist/integrations/redis/client.d.ts +4 -4
- package/dist/integrations/redis/client.d.ts.map +1 -1
- package/dist/integrations/redis/client.js +23 -23
- package/dist/integrations/redis/client.js.map +1 -1
- package/dist/integrations/redis/index.d.ts +2 -2
- package/dist/integrations/redis/index.js +1 -1
- package/dist/integrations/redis/types.d.ts +4 -3
- package/dist/integrations/redis/types.d.ts.map +1 -1
- package/dist/integrations/redshift/client.d.ts +4 -4
- package/dist/integrations/redshift/client.d.ts.map +1 -1
- package/dist/integrations/redshift/client.js +8 -8
- package/dist/integrations/redshift/client.js.map +1 -1
- package/dist/integrations/redshift/index.d.ts +2 -2
- package/dist/integrations/redshift/index.js +1 -1
- package/dist/integrations/redshift/types.d.ts +4 -3
- package/dist/integrations/redshift/types.d.ts.map +1 -1
- package/dist/integrations/registry.d.ts +2 -2
- package/dist/integrations/registry.d.ts.map +1 -1
- package/dist/integrations/registry.js +132 -132
- package/dist/integrations/registry.js.map +1 -1
- package/dist/integrations/registry.test.js +10 -10
- package/dist/integrations/registry.test.js.map +1 -1
- package/dist/integrations/s3/client.d.ts +4 -4
- package/dist/integrations/s3/client.d.ts.map +1 -1
- package/dist/integrations/s3/client.js +20 -20
- package/dist/integrations/s3/client.js.map +1 -1
- package/dist/integrations/s3/index.d.ts +2 -2
- package/dist/integrations/s3/index.js +1 -1
- package/dist/integrations/s3/types.d.ts +3 -3
- package/dist/integrations/s3/types.d.ts.map +1 -1
- package/dist/integrations/salesforce/client.d.ts +4 -4
- package/dist/integrations/salesforce/client.d.ts.map +1 -1
- package/dist/integrations/salesforce/client.js +22 -22
- package/dist/integrations/salesforce/client.js.map +1 -1
- package/dist/integrations/salesforce/index.d.ts +2 -2
- package/dist/integrations/salesforce/index.d.ts.map +1 -1
- package/dist/integrations/salesforce/index.js +1 -1
- package/dist/integrations/salesforce/index.js.map +1 -1
- package/dist/integrations/salesforce/types.d.ts +12 -11
- package/dist/integrations/salesforce/types.d.ts.map +1 -1
- package/dist/integrations/segment/client.d.ts +2 -2
- package/dist/integrations/segment/client.d.ts.map +1 -1
- package/dist/integrations/segment/client.js +1 -1
- package/dist/integrations/segment/client.js.map +1 -1
- package/dist/integrations/segment/index.d.ts +2 -2
- package/dist/integrations/segment/index.js +1 -1
- package/dist/integrations/segment/types.d.ts +4 -3
- package/dist/integrations/segment/types.d.ts.map +1 -1
- package/dist/integrations/sendgrid/client.d.ts +2 -2
- package/dist/integrations/sendgrid/client.d.ts.map +1 -1
- package/dist/integrations/sendgrid/client.js +1 -1
- package/dist/integrations/sendgrid/client.js.map +1 -1
- package/dist/integrations/sendgrid/index.d.ts +2 -2
- package/dist/integrations/sendgrid/index.js +1 -1
- package/dist/integrations/sendgrid/types.d.ts +4 -3
- package/dist/integrations/sendgrid/types.d.ts.map +1 -1
- package/dist/integrations/slack/client.d.ts.map +1 -1
- package/dist/integrations/slack/client.js.map +1 -1
- package/dist/integrations/slack/index.d.ts +2 -2
- package/dist/integrations/slack/index.js +1 -1
- package/dist/integrations/slack/types.d.ts +6 -12
- package/dist/integrations/slack/types.d.ts.map +1 -1
- package/dist/integrations/smtp/client.d.ts +3 -3
- package/dist/integrations/smtp/client.js +6 -6
- package/dist/integrations/smtp/index.d.ts +2 -2
- package/dist/integrations/smtp/index.js +1 -1
- package/dist/integrations/smtp/types.d.ts +1 -1
- package/dist/integrations/snowflake/client.d.ts.map +1 -1
- package/dist/integrations/snowflake/client.js.map +1 -1
- package/dist/integrations/snowflake/index.d.ts +2 -2
- package/dist/integrations/snowflake/index.js +1 -1
- package/dist/integrations/snowflake/types.d.ts +4 -3
- package/dist/integrations/snowflake/types.d.ts.map +1 -1
- package/dist/integrations/snowflakecortex/client.d.ts +2 -2
- package/dist/integrations/snowflakecortex/client.d.ts.map +1 -1
- package/dist/integrations/snowflakecortex/client.js +1 -1
- package/dist/integrations/snowflakecortex/client.js.map +1 -1
- package/dist/integrations/snowflakecortex/index.d.ts +2 -2
- package/dist/integrations/snowflakecortex/index.js +1 -1
- package/dist/integrations/snowflakecortex/types.d.ts +2 -2
- package/dist/integrations/snowflakecortex/types.d.ts.map +1 -1
- package/dist/integrations/snowflakepostgres/client.d.ts +2 -2
- package/dist/integrations/snowflakepostgres/client.js +1 -1
- package/dist/integrations/snowflakepostgres/index.d.ts +2 -2
- package/dist/integrations/snowflakepostgres/index.js +1 -1
- package/dist/integrations/snowflakepostgres/types.d.ts +2 -2
- package/dist/integrations/snowflakepostgres/types.d.ts.map +1 -1
- package/dist/integrations/stabilityai/client.d.ts +2 -2
- package/dist/integrations/stabilityai/client.d.ts.map +1 -1
- package/dist/integrations/stabilityai/client.js +1 -1
- package/dist/integrations/stabilityai/client.js.map +1 -1
- package/dist/integrations/stabilityai/index.d.ts +2 -2
- package/dist/integrations/stabilityai/index.js +1 -1
- package/dist/integrations/stabilityai/types.d.ts +4 -3
- package/dist/integrations/stabilityai/types.d.ts.map +1 -1
- package/dist/integrations/stripe/client.d.ts +2 -2
- package/dist/integrations/stripe/client.d.ts.map +1 -1
- package/dist/integrations/stripe/client.js +1 -1
- package/dist/integrations/stripe/client.js.map +1 -1
- package/dist/integrations/stripe/index.d.ts +2 -2
- package/dist/integrations/stripe/index.js +1 -1
- package/dist/integrations/stripe/types.d.ts +6 -5
- package/dist/integrations/stripe/types.d.ts.map +1 -1
- package/dist/integrations/superblocks-ocr/client.d.ts +2 -2
- package/dist/integrations/superblocks-ocr/client.d.ts.map +1 -1
- package/dist/integrations/superblocks-ocr/client.js +1 -1
- package/dist/integrations/superblocks-ocr/client.js.map +1 -1
- package/dist/integrations/superblocks-ocr/index.d.ts +2 -2
- package/dist/integrations/superblocks-ocr/index.js +1 -1
- package/dist/integrations/superblocks-ocr/types.d.ts +4 -3
- package/dist/integrations/superblocks-ocr/types.d.ts.map +1 -1
- package/dist/integrations/twilio/client.d.ts +2 -2
- package/dist/integrations/twilio/client.d.ts.map +1 -1
- package/dist/integrations/twilio/client.js +1 -1
- package/dist/integrations/twilio/client.js.map +1 -1
- package/dist/integrations/twilio/index.d.ts +2 -2
- package/dist/integrations/twilio/index.js +1 -1
- package/dist/integrations/twilio/types.d.ts +4 -3
- package/dist/integrations/twilio/types.d.ts.map +1 -1
- package/dist/integrations/types.d.ts +1 -1
- package/dist/integrations/utils.js +5 -5
- package/dist/integrations/zendesk/client.d.ts +2 -2
- package/dist/integrations/zendesk/client.d.ts.map +1 -1
- package/dist/integrations/zendesk/client.js +1 -1
- package/dist/integrations/zendesk/client.js.map +1 -1
- package/dist/integrations/zendesk/index.d.ts +2 -2
- package/dist/integrations/zendesk/index.js +1 -1
- package/dist/integrations/zendesk/types.d.ts +4 -3
- package/dist/integrations/zendesk/types.d.ts.map +1 -1
- package/dist/integrations/zoom/client.d.ts +2 -2
- package/dist/integrations/zoom/client.d.ts.map +1 -1
- package/dist/integrations/zoom/client.js +1 -1
- package/dist/integrations/zoom/client.js.map +1 -1
- package/dist/integrations/zoom/index.d.ts +2 -2
- package/dist/integrations/zoom/index.js +1 -1
- package/dist/integrations/zoom/types.d.ts +5 -4
- package/dist/integrations/zoom/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 +3 -3
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/errors.d.ts.map +1 -1
- package/dist/runtime/errors.js +17 -13
- package/dist/runtime/errors.js.map +1 -1
- package/dist/runtime/execute.d.ts +5 -5
- package/dist/runtime/execute.d.ts.map +1 -1
- package/dist/runtime/execute.js +3 -3
- package/dist/runtime/execute.js.map +1 -1
- package/dist/runtime/executor.d.ts +4 -4
- package/dist/runtime/executor.js +5 -5
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +6 -6
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/logger.d.ts +1 -1
- package/dist/runtime/logger.d.ts.map +1 -1
- package/dist/runtime/logger.js +5 -5
- package/dist/runtime/logger.js.map +1 -1
- package/dist/runtime/streaming-context.d.ts +3 -3
- package/dist/runtime/streaming-context.d.ts.map +1 -1
- package/dist/runtime/streaming-context.js +2 -2
- package/dist/runtime/streaming-context.js.map +1 -1
- package/dist/runtime/streaming-executor.d.ts +4 -4
- package/dist/runtime/streaming-executor.d.ts.map +1 -1
- package/dist/runtime/streaming-executor.js +5 -5
- package/dist/runtime/streaming-executor.js.map +1 -1
- package/dist/types.d.ts +10 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/api/definition.test.ts +65 -2
- package/src/api/definition.ts +33 -1
- package/src/api/index.ts +4 -4
- package/src/api/streaming.test.ts +166 -88
- package/src/api/streaming.ts +41 -13
- package/src/errors.ts +6 -6
- package/src/index.ts +14 -3
- package/src/integrations/airtable/README.md +46 -39
- package/src/integrations/airtable/client.ts +5 -3
- package/src/integrations/airtable/index.ts +2 -2
- package/src/integrations/airtable/types.ts +7 -11
- package/src/integrations/anthropic/README.md +57 -47
- package/src/integrations/anthropic/client.ts +5 -3
- package/src/integrations/anthropic/index.ts +2 -2
- package/src/integrations/anthropic/types.ts +12 -5
- package/src/integrations/asana/README.md +39 -37
- package/src/integrations/asana/client.ts +5 -3
- package/src/integrations/asana/index.ts +2 -2
- package/src/integrations/asana/types.ts +4 -3
- package/src/integrations/athena/README.md +23 -16
- package/src/integrations/athena/client.ts +18 -15
- package/src/integrations/athena/index.ts +2 -2
- package/src/integrations/athena/types.ts +9 -4
- package/src/integrations/base/graphql-integration-client.ts +9 -9
- package/src/integrations/base/index.ts +4 -4
- package/src/integrations/base/rest-api-integration-client.ts +15 -4
- package/src/integrations/base/types.ts +8 -11
- package/src/integrations/bigquery/README.md +24 -19
- package/src/integrations/bigquery/client.ts +21 -16
- package/src/integrations/bigquery/index.ts +2 -2
- package/src/integrations/bigquery/types.ts +9 -4
- package/src/integrations/bitbucket/README.md +56 -40
- package/src/integrations/bitbucket/client.ts +5 -3
- package/src/integrations/bitbucket/index.ts +2 -2
- package/src/integrations/bitbucket/types.ts +6 -4
- package/src/integrations/box/README.md +60 -53
- package/src/integrations/box/client.ts +5 -3
- package/src/integrations/box/index.ts +2 -2
- package/src/integrations/box/types.ts +4 -3
- package/src/integrations/circleci/README.md +70 -43
- package/src/integrations/circleci/client.ts +5 -3
- package/src/integrations/circleci/index.ts +2 -2
- package/src/integrations/circleci/types.ts +6 -4
- package/src/integrations/cockroachdb/README.md +26 -21
- package/src/integrations/cockroachdb/client.ts +18 -15
- package/src/integrations/cockroachdb/index.ts +2 -2
- package/src/integrations/cockroachdb/types.ts +9 -4
- package/src/integrations/cohere/README.md +30 -29
- package/src/integrations/cohere/client.ts +5 -3
- package/src/integrations/cohere/index.ts +2 -2
- package/src/integrations/cohere/types.ts +7 -11
- package/src/integrations/confluence/README.md +50 -46
- package/src/integrations/confluence/client.ts +5 -3
- package/src/integrations/confluence/index.ts +2 -2
- package/src/integrations/confluence/types.ts +6 -4
- package/src/integrations/cosmosdb/README.md +26 -23
- package/src/integrations/cosmosdb/client.ts +32 -30
- package/src/integrations/cosmosdb/index.ts +2 -2
- package/src/integrations/cosmosdb/types.ts +4 -3
- package/src/integrations/couchbase/README.md +37 -23
- package/src/integrations/couchbase/client.ts +28 -22
- package/src/integrations/couchbase/index.ts +2 -2
- package/src/integrations/couchbase/types.ts +14 -8
- package/src/integrations/databricks/README.md +25 -20
- package/src/integrations/databricks/client.ts +18 -15
- package/src/integrations/databricks/index.ts +2 -2
- package/src/integrations/databricks/types.ts +9 -4
- package/src/integrations/datadog/README.md +51 -38
- package/src/integrations/datadog/client.ts +5 -3
- package/src/integrations/datadog/index.ts +2 -2
- package/src/integrations/datadog/types.ts +6 -4
- package/src/integrations/declarations.ts +237 -199
- package/src/integrations/dropbox/README.md +42 -39
- package/src/integrations/dropbox/client.ts +5 -3
- package/src/integrations/dropbox/index.ts +2 -2
- package/src/integrations/dropbox/types.ts +6 -4
- package/src/integrations/dynamodb/README.md +92 -60
- package/src/integrations/dynamodb/client.ts +45 -36
- package/src/integrations/dynamodb/index.ts +2 -2
- package/src/integrations/dynamodb/types.ts +10 -9
- package/src/integrations/elasticsearch/README.md +72 -70
- package/src/integrations/elasticsearch/client.ts +5 -3
- package/src/integrations/elasticsearch/index.ts +2 -2
- package/src/integrations/elasticsearch/types.ts +6 -4
- package/src/integrations/fireworks/README.md +35 -38
- package/src/integrations/fireworks/client.ts +5 -3
- package/src/integrations/fireworks/index.ts +2 -2
- package/src/integrations/fireworks/types.ts +6 -4
- package/src/integrations/front/README.md +29 -28
- package/src/integrations/front/client.ts +5 -3
- package/src/integrations/front/index.ts +2 -2
- package/src/integrations/front/types.ts +4 -3
- package/src/integrations/gcs/README.md +24 -19
- package/src/integrations/gcs/client.ts +26 -26
- package/src/integrations/gcs/index.ts +2 -2
- package/src/integrations/gcs/types.ts +11 -14
- package/src/integrations/gemini/README.md +31 -28
- package/src/integrations/gemini/client.ts +5 -3
- package/src/integrations/gemini/index.ts +2 -2
- package/src/integrations/gemini/types.ts +6 -4
- package/src/integrations/github/README.md +41 -35
- package/src/integrations/github/client.ts +5 -3
- package/src/integrations/github/index.ts +2 -2
- package/src/integrations/github/types.ts +8 -6
- package/src/integrations/googleanalytics/README.md +51 -40
- package/src/integrations/googleanalytics/client.ts +5 -3
- package/src/integrations/googleanalytics/index.ts +2 -2
- package/src/integrations/googleanalytics/types.ts +6 -4
- package/src/integrations/googledrive/README.md +57 -50
- package/src/integrations/googledrive/client.ts +5 -3
- package/src/integrations/googledrive/index.ts +2 -2
- package/src/integrations/googledrive/types.ts +6 -4
- package/src/integrations/graphql/README.md +62 -41
- package/src/integrations/graphql/client.ts +5 -3
- package/src/integrations/graphql/index.ts +2 -2
- package/src/integrations/graphql/types.ts +6 -5
- package/src/integrations/groq/README.md +34 -35
- package/src/integrations/groq/client.ts +5 -3
- package/src/integrations/groq/index.ts +2 -2
- package/src/integrations/groq/types.ts +4 -3
- package/src/integrations/gsheets/README.md +61 -47
- package/src/integrations/gsheets/client.ts +19 -11
- package/src/integrations/gsheets/index.ts +2 -2
- package/src/integrations/gsheets/types.ts +12 -11
- package/src/integrations/hubspot/README.md +80 -67
- package/src/integrations/hubspot/client.ts +5 -3
- package/src/integrations/hubspot/index.ts +2 -2
- package/src/integrations/hubspot/types.ts +6 -4
- package/src/integrations/index.ts +169 -131
- package/src/integrations/intercom/README.md +25 -24
- package/src/integrations/intercom/client.ts +5 -3
- package/src/integrations/intercom/index.ts +2 -2
- package/src/integrations/intercom/types.ts +6 -4
- package/src/integrations/jira/README.md +46 -43
- package/src/integrations/jira/client.ts +5 -3
- package/src/integrations/jira/index.ts +2 -2
- package/src/integrations/jira/types.ts +4 -3
- package/src/integrations/kafka/README.md +39 -33
- package/src/integrations/kafka/client.ts +34 -30
- package/src/integrations/kafka/index.ts +2 -2
- package/src/integrations/kafka/types.ts +8 -7
- package/src/integrations/kinesis/README.md +34 -32
- package/src/integrations/kinesis/client.ts +12 -8
- package/src/integrations/kinesis/index.ts +2 -2
- package/src/integrations/kinesis/types.ts +9 -10
- package/src/integrations/lakebase/client.ts +33 -20
- package/src/integrations/lakebase/index.ts +2 -2
- package/src/integrations/lakebase/types.ts +7 -3
- package/src/integrations/launchdarkly/README.md +38 -37
- package/src/integrations/launchdarkly/client.ts +5 -3
- package/src/integrations/launchdarkly/index.ts +2 -2
- package/src/integrations/launchdarkly/types.ts +6 -4
- package/src/integrations/mariadb/README.md +24 -19
- package/src/integrations/mariadb/client.ts +18 -15
- package/src/integrations/mariadb/index.ts +2 -2
- package/src/integrations/mariadb/types.ts +9 -4
- package/src/integrations/mistral/README.md +33 -34
- package/src/integrations/mistral/client.ts +5 -3
- package/src/integrations/mistral/index.ts +2 -2
- package/src/integrations/mistral/types.ts +6 -4
- package/src/integrations/mongodb/README.md +131 -86
- package/src/integrations/mongodb/client.ts +12 -10
- package/src/integrations/mongodb/index.ts +2 -2
- package/src/integrations/mongodb/types.ts +17 -16
- package/src/integrations/mssql/README.md +26 -21
- package/src/integrations/mssql/client.ts +18 -15
- package/src/integrations/mssql/index.ts +2 -2
- package/src/integrations/mssql/types.ts +9 -4
- package/src/integrations/mysql/README.md +27 -22
- package/src/integrations/mysql/client.ts +18 -15
- package/src/integrations/mysql/index.ts +2 -2
- package/src/integrations/mysql/types.ts +9 -4
- package/src/integrations/notion/README.md +31 -28
- package/src/integrations/notion/client.ts +5 -3
- package/src/integrations/notion/index.ts +2 -2
- package/src/integrations/notion/types.ts +8 -6
- package/src/integrations/openai_v2/README.md +40 -39
- package/src/integrations/openai_v2/client.ts +5 -3
- package/src/integrations/openai_v2/index.ts +2 -2
- package/src/integrations/openai_v2/types.ts +12 -5
- package/src/integrations/oracledb/README.md +26 -21
- package/src/integrations/oracledb/client.ts +21 -16
- package/src/integrations/oracledb/index.ts +2 -2
- package/src/integrations/oracledb/types.ts +9 -4
- package/src/integrations/pagerduty/README.md +48 -41
- package/src/integrations/pagerduty/client.ts +5 -3
- package/src/integrations/pagerduty/index.ts +2 -2
- package/src/integrations/pagerduty/types.ts +6 -4
- package/src/integrations/perplexity/README.md +31 -32
- package/src/integrations/perplexity/client.ts +5 -3
- package/src/integrations/perplexity/index.ts +2 -2
- package/src/integrations/perplexity/types.ts +6 -4
- package/src/integrations/postgres/README.md +30 -27
- package/src/integrations/postgres/client.ts +27 -18
- package/src/integrations/postgres/index.ts +2 -2
- package/src/integrations/postgres/types.ts +13 -8
- package/src/integrations/python/README.md +86 -67
- package/src/integrations/python/client.test.ts +104 -86
- package/src/integrations/python/client.ts +27 -23
- package/src/integrations/python/index.ts +2 -2
- package/src/integrations/python/types.ts +6 -6
- package/src/integrations/redis/README.md +48 -35
- package/src/integrations/redis/client.ts +32 -28
- package/src/integrations/redis/index.ts +2 -2
- package/src/integrations/redis/types.ts +4 -3
- package/src/integrations/redshift/README.md +26 -21
- package/src/integrations/redshift/client.ts +21 -16
- package/src/integrations/redshift/index.ts +2 -2
- package/src/integrations/redshift/types.ts +9 -4
- package/src/integrations/registry.test.ts +14 -10
- package/src/integrations/registry.ts +225 -154
- package/src/integrations/s3/README.md +23 -18
- package/src/integrations/s3/client.ts +26 -27
- package/src/integrations/s3/index.ts +2 -2
- package/src/integrations/s3/types.ts +11 -15
- package/src/integrations/salesforce/README.md +35 -30
- package/src/integrations/salesforce/client.ts +27 -30
- package/src/integrations/salesforce/index.ts +6 -2
- package/src/integrations/salesforce/types.ts +23 -18
- package/src/integrations/segment/README.md +23 -22
- package/src/integrations/segment/client.ts +5 -3
- package/src/integrations/segment/index.ts +2 -2
- package/src/integrations/segment/types.ts +6 -4
- package/src/integrations/sendgrid/README.md +27 -24
- package/src/integrations/sendgrid/client.ts +5 -3
- package/src/integrations/sendgrid/index.ts +2 -2
- package/src/integrations/sendgrid/types.ts +6 -4
- package/src/integrations/slack/README.md +29 -28
- package/src/integrations/slack/client.ts +3 -1
- package/src/integrations/slack/index.ts +2 -2
- package/src/integrations/slack/types.ts +6 -12
- package/src/integrations/smtp/client.ts +11 -11
- package/src/integrations/smtp/index.ts +2 -2
- package/src/integrations/smtp/types.ts +1 -1
- package/src/integrations/snowflake/README.md +35 -37
- package/src/integrations/snowflake/client.ts +2 -1
- package/src/integrations/snowflake/index.ts +2 -2
- package/src/integrations/snowflake/types.ts +9 -4
- package/src/integrations/snowflakecortex/client.ts +5 -3
- package/src/integrations/snowflakecortex/index.ts +2 -2
- package/src/integrations/snowflakecortex/types.ts +9 -3
- package/src/integrations/snowflakepostgres/client.ts +2 -2
- package/src/integrations/snowflakepostgres/index.ts +2 -2
- package/src/integrations/snowflakepostgres/types.ts +7 -3
- package/src/integrations/stabilityai/README.md +34 -39
- package/src/integrations/stabilityai/client.ts +5 -3
- package/src/integrations/stabilityai/index.ts +2 -2
- package/src/integrations/stabilityai/types.ts +6 -4
- package/src/integrations/stripe/README.md +34 -33
- package/src/integrations/stripe/client.ts +5 -3
- package/src/integrations/stripe/index.ts +2 -2
- package/src/integrations/stripe/types.ts +8 -6
- package/src/integrations/superblocks-ocr/README.md +35 -30
- package/src/integrations/superblocks-ocr/client.ts +3 -4
- package/src/integrations/superblocks-ocr/index.ts +2 -2
- package/src/integrations/superblocks-ocr/types.ts +6 -4
- package/src/integrations/twilio/README.md +26 -32
- package/src/integrations/twilio/client.ts +5 -3
- package/src/integrations/twilio/index.ts +2 -2
- package/src/integrations/twilio/types.ts +6 -4
- package/src/integrations/types.ts +1 -1
- package/src/integrations/utils.ts +5 -5
- package/src/integrations/zendesk/README.md +29 -28
- package/src/integrations/zendesk/client.ts +5 -3
- package/src/integrations/zendesk/index.ts +2 -2
- package/src/integrations/zendesk/types.ts +6 -4
- package/src/integrations/zoom/README.md +40 -41
- package/src/integrations/zoom/client.ts +5 -3
- package/src/integrations/zoom/index.ts +2 -2
- package/src/integrations/zoom/types.ts +5 -4
- package/src/runtime/context.ts +25 -10
- package/src/runtime/errors.ts +17 -13
- package/src/runtime/execute.ts +10 -11
- package/src/runtime/executor.ts +9 -9
- package/src/runtime/index.ts +9 -6
- package/src/runtime/logger.ts +11 -7
- package/src/runtime/streaming-context.ts +23 -9
- package/src/runtime/streaming-executor.ts +15 -9
- package/src/types.ts +23 -6
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ An **API** in this SDK is a self-contained, typed function definition that:
|
|
|
26
26
|
4. **Is portable** - Can be executed by any compatible runtime (local, server, orchestrator)
|
|
27
27
|
|
|
28
28
|
An API is **not** just a function - it's a complete definition that includes metadata, schemas, and dependencies, enabling the runtime to:
|
|
29
|
+
|
|
29
30
|
- Validate inputs before execution
|
|
30
31
|
- Pre-authenticate integrations
|
|
31
32
|
- Validate outputs after execution
|
|
@@ -59,22 +60,24 @@ interface CompiledApi<TInput, TOutput> {
|
|
|
59
60
|
You can inspect a `CompiledApi` to understand what it is:
|
|
60
61
|
|
|
61
62
|
```typescript
|
|
62
|
-
import { api, z, postgres } from
|
|
63
|
+
import { api, z, postgres } from "@superblocksteam/sdk-api";
|
|
63
64
|
|
|
64
65
|
const myApi = api({
|
|
65
|
-
name:
|
|
66
|
-
integrations: { db: postgres(
|
|
66
|
+
name: "GetUsers",
|
|
67
|
+
integrations: { db: postgres("prod-postgres-id") },
|
|
67
68
|
input: z.object({ limit: z.number() }),
|
|
68
69
|
output: z.object({ users: z.array(z.object({ id: z.string() })) }),
|
|
69
|
-
async run(ctx, { limit }) {
|
|
70
|
+
async run(ctx, { limit }) {
|
|
71
|
+
/* ... */
|
|
72
|
+
},
|
|
70
73
|
});
|
|
71
74
|
|
|
72
75
|
// Inspect the compiled API
|
|
73
|
-
console.log(myApi.name);
|
|
74
|
-
console.log(myApi.integrations);
|
|
76
|
+
console.log(myApi.name); // 'GetUsers'
|
|
77
|
+
console.log(myApi.integrations); // [{ key: 'db', pluginId: 'postgres', integrationId: 'prod-postgres-id' }]
|
|
75
78
|
|
|
76
79
|
// Schemas can be used for validation or type extraction
|
|
77
|
-
type Input = z.infer<typeof myApi.inputSchema>;
|
|
80
|
+
type Input = z.infer<typeof myApi.inputSchema>; // { limit: number }
|
|
78
81
|
type Output = z.infer<typeof myApi.outputSchema>; // { users: { id: string }[] }
|
|
79
82
|
```
|
|
80
83
|
|
|
@@ -133,21 +136,24 @@ When an integration client (like `ctx.integrations.db`) makes a request, it call
|
|
|
133
136
|
```typescript
|
|
134
137
|
// Inside PostgresClient.query():
|
|
135
138
|
const result = await executeQuery(
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
+
"prod-postgres-id", // Integration ID
|
|
140
|
+
{
|
|
141
|
+
// Plugin-specific request (matches protobuf schema)
|
|
142
|
+
body: "SELECT * FROM users WHERE id = $1",
|
|
139
143
|
},
|
|
140
|
-
{ userId:
|
|
144
|
+
{ userId: "123" }, // Optional bindings for language plugins
|
|
141
145
|
);
|
|
142
146
|
```
|
|
143
147
|
|
|
144
148
|
The runtime (orchestrator) receives this callback and:
|
|
149
|
+
|
|
145
150
|
1. Looks up the integration configuration
|
|
146
151
|
2. Authenticates with the external service
|
|
147
152
|
3. Executes the actual operation (SQL query, API call, etc.)
|
|
148
153
|
4. Returns the result to the SDK
|
|
149
154
|
|
|
150
155
|
This architecture means:
|
|
156
|
+
|
|
151
157
|
- **SDK is environment-agnostic** - Same code runs locally, in tests, or in production
|
|
152
158
|
- **Authentication is centralized** - The runtime handles all credentials
|
|
153
159
|
- **Operations are auditable** - The runtime can log/trace all operations
|
|
@@ -197,8 +203,8 @@ interface UnifiedExecuteApiRequest {
|
|
|
197
203
|
*/
|
|
198
204
|
executeQuery: (
|
|
199
205
|
integrationId: string,
|
|
200
|
-
request: Record<string, unknown>,
|
|
201
|
-
bindings?: Record<string, unknown
|
|
206
|
+
request: Record<string, unknown>, // Plugin-specific request matching protobuf schema
|
|
207
|
+
bindings?: Record<string, unknown>, // For language plugins (Python/JavaScript)
|
|
202
208
|
) => Promise<unknown>;
|
|
203
209
|
|
|
204
210
|
/**
|
|
@@ -207,7 +213,7 @@ interface UnifiedExecuteApiRequest {
|
|
|
207
213
|
*/
|
|
208
214
|
executeStreamingQuery?: (
|
|
209
215
|
integrationId: string,
|
|
210
|
-
request: Record<string, unknown
|
|
216
|
+
request: Record<string, unknown>,
|
|
211
217
|
) => AsyncIterable<unknown>;
|
|
212
218
|
}
|
|
213
219
|
```
|
|
@@ -219,7 +225,10 @@ Regular APIs return a discriminated union:
|
|
|
219
225
|
```typescript
|
|
220
226
|
type ExecuteApiResponse<TOutput> =
|
|
221
227
|
| { success: true; output: TOutput }
|
|
222
|
-
| {
|
|
228
|
+
| {
|
|
229
|
+
success: false;
|
|
230
|
+
error: { code: string; message: string; details?: unknown };
|
|
231
|
+
};
|
|
223
232
|
```
|
|
224
233
|
|
|
225
234
|
Streaming APIs return an `AsyncGenerator`:
|
|
@@ -318,13 +327,13 @@ For streaming responses (e.g., LLM token streaming), see [`streamingApi()`](#str
|
|
|
318
327
|
|
|
319
328
|
#### Required Fields
|
|
320
329
|
|
|
321
|
-
| Field
|
|
322
|
-
|
|
|
323
|
-
| `name`
|
|
324
|
-
| `input`
|
|
325
|
-
| `output`
|
|
326
|
-
| `run`
|
|
327
|
-
| `integrations` | `Record<string, IntegrationRef>`
|
|
330
|
+
| Field | Type | Description |
|
|
331
|
+
| -------------- | --------------------------------- | ---------------------------------------------- |
|
|
332
|
+
| `name` | `string` | **Required.** Unique identifier for the API |
|
|
333
|
+
| `input` | `z.ZodType` | **Required.** Zod schema for input validation |
|
|
334
|
+
| `output` | `z.ZodType` | **Required.** Zod schema for output validation |
|
|
335
|
+
| `run` | `(ctx, input) => Promise<Output>` | **Required.** The implementation function |
|
|
336
|
+
| `integrations` | `Record<string, IntegrationRef>` | Optional. Integration declarations for the API |
|
|
328
337
|
|
|
329
338
|
```typescript
|
|
330
339
|
import { api, z } from "@superblocksteam/sdk-api";
|
|
@@ -399,12 +408,15 @@ export default streamingApi({
|
|
|
399
408
|
messages: [{ role: "user", content: prompt }],
|
|
400
409
|
},
|
|
401
410
|
},
|
|
402
|
-
{ chunk: AnthropicStreamEventSchema }
|
|
411
|
+
{ chunk: AnthropicStreamEventSchema },
|
|
403
412
|
);
|
|
404
413
|
|
|
405
414
|
// Process and yield each chunk
|
|
406
415
|
for await (const event of stream) {
|
|
407
|
-
if (
|
|
416
|
+
if (
|
|
417
|
+
event.type === "content_block_delta" &&
|
|
418
|
+
event.delta?.type === "text_delta"
|
|
419
|
+
) {
|
|
408
420
|
yield { type: "text" as const, text: event.delta.text };
|
|
409
421
|
}
|
|
410
422
|
}
|
|
@@ -414,11 +426,11 @@ export default streamingApi({
|
|
|
414
426
|
|
|
415
427
|
#### Streaming API Configuration
|
|
416
428
|
|
|
417
|
-
| Property | Type
|
|
418
|
-
| -------------- |
|
|
419
|
-
| `integrations` | `Record<string, IntegrationRef>`
|
|
420
|
-
| `input` | `z.ZodType`
|
|
421
|
-
| `chunk` | `z.ZodType`
|
|
429
|
+
| Property | Type | Description |
|
|
430
|
+
| -------------- | ------------------------------------------ | ----------------------------------------------- |
|
|
431
|
+
| `integrations` | `Record<string, IntegrationRef>` | Integration declarations (same as `api()`) |
|
|
432
|
+
| `input` | `z.ZodType` | Zod schema for input validation |
|
|
433
|
+
| `chunk` | `z.ZodType` | Zod schema for each yielded chunk |
|
|
422
434
|
| `run` | `(ctx, input) => AsyncIterable<ChunkType>` | Generator function that yields validated chunks |
|
|
423
435
|
|
|
424
436
|
#### Key Differences from `api()`
|
|
@@ -431,6 +443,7 @@ export default streamingApi({
|
|
|
431
443
|
### Context (`ctx`) and Input
|
|
432
444
|
|
|
433
445
|
The `run` function receives two arguments:
|
|
446
|
+
|
|
434
447
|
1. **`ctx`** - Context object with integrations, logging, and environment
|
|
435
448
|
2. **`input`** - Typed, validated input data matching your input schema
|
|
436
449
|
|
|
@@ -443,7 +456,7 @@ async run(ctx, { userId, options }) {
|
|
|
443
456
|
|
|
444
457
|
#### `ctx.integrations`
|
|
445
458
|
|
|
446
|
-
Access typed integration clients via the `integrations`
|
|
459
|
+
Access typed integration clients via the **name (key)** you declared in the API config: `ctx.integrations.<name>`. For example, if you declared `integrations: { db: postgres(...), notifier: slack(...) }`, use `ctx.integrations.db` and `ctx.integrations.notifier` in your `run` function. Integrations must be declared upfront to enable type-safe access and pre-authentication.
|
|
447
460
|
|
|
448
461
|
```typescript
|
|
449
462
|
import { api, z, postgres, slack, openai, anthropic, stripe, github, notion, python } from "@superblocksteam/sdk-api";
|
|
@@ -521,47 +534,47 @@ async run(ctx, { userId }) {
|
|
|
521
534
|
|
|
522
535
|
#### Method Availability by Client
|
|
523
536
|
|
|
524
|
-
| Client | Available Methods | Notes
|
|
525
|
-
| ------------------------- | ------------------------------------------------------------------------------ |
|
|
526
|
-
| **PostgresClient** | `query<T>(sql, schema, params?)`, `execute(sql, params?)` | Schema parameter is REQUIRED for query()
|
|
527
|
-
| **SnowflakeClient** | `query<T>(sql, schema, params?)`, `execute(sql, params?)` | Schema parameter is REQUIRED for query()
|
|
528
|
-
| **PythonClient** | `run<T>(code, schema, bindings?)` | Schema parameter is REQUIRED, bindings via {{}} syntax
|
|
529
|
-
| **AirtableClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
530
|
-
| **AnthropicClient** | `apiRequest(options, schema)`, `streamApiRequest(options, schema)` | Supports streaming for real-time token output
|
|
531
|
-
| **AsanaClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
532
|
-
| **BitbucketClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
533
|
-
| **BoxClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
534
|
-
| **CircleCIClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
535
|
-
| **CohereClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
536
|
-
| **ConfluenceClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
537
|
-
| **DatadogClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
538
|
-
| **DropboxClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
539
|
-
| **ElasticSearchClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
540
|
-
| **FireworksClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
541
|
-
| **FrontClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
542
|
-
| **GeminiClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
543
|
-
| **GitHubClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no createIssue, etc.
|
|
544
|
-
| **GoogleAnalyticsClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
545
|
-
| **GoogleDriveClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
546
|
-
| **GraphQLClient** | `query(query, variables?, schema?)`, `mutation(mutation, variables?, schema?)` | GraphQL-specific methods
|
|
547
|
-
| **GroqClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
548
|
-
| **HubSpotClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
549
|
-
| **IntercomClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
550
|
-
| **JiraClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
551
|
-
| **LaunchDarklyClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
552
|
-
| **MistralClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
553
|
-
| **NotionClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no queryDatabase, etc.
|
|
554
|
-
| **OpenAIClient** | `apiRequest(options, schema)`, `streamApiRequest(options, schema)` | Supports streaming for real-time token output
|
|
555
|
-
| **PagerDutyClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
556
|
-
| **PerplexityClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
557
|
-
| **SegmentClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
558
|
-
| **SendGridClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
559
|
-
| **SlackClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no specialized methods
|
|
560
|
-
| **StabilityAIClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
561
|
-
| **StripeClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no createCustomer, etc.
|
|
562
|
-
| **TwilioClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
563
|
-
| **ZendeskClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
564
|
-
| **ZoomClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest
|
|
537
|
+
| Client | Available Methods | Notes |
|
|
538
|
+
| ------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------ |
|
|
539
|
+
| **PostgresClient** | `query<T>(sql, schema, params?)`, `execute(sql, params?)` | Schema parameter is REQUIRED for query() |
|
|
540
|
+
| **SnowflakeClient** | `query<T>(sql, schema, params?)`, `execute(sql, params?)` | Schema parameter is REQUIRED for query() |
|
|
541
|
+
| **PythonClient** | `run<T>(code, schema, bindings?)` | Schema parameter is REQUIRED, bindings via {{}} syntax |
|
|
542
|
+
| **AirtableClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
543
|
+
| **AnthropicClient** | `apiRequest(options, schema)`, `streamApiRequest(options, schema)` | Supports streaming for real-time token output |
|
|
544
|
+
| **AsanaClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
545
|
+
| **BitbucketClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
546
|
+
| **BoxClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
547
|
+
| **CircleCIClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
548
|
+
| **CohereClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
549
|
+
| **ConfluenceClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
550
|
+
| **DatadogClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
551
|
+
| **DropboxClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
552
|
+
| **ElasticSearchClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
553
|
+
| **FireworksClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
554
|
+
| **FrontClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
555
|
+
| **GeminiClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
556
|
+
| **GitHubClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no createIssue, etc. |
|
|
557
|
+
| **GoogleAnalyticsClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
558
|
+
| **GoogleDriveClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
559
|
+
| **GraphQLClient** | `query(query, variables?, schema?)`, `mutation(mutation, variables?, schema?)` | GraphQL-specific methods |
|
|
560
|
+
| **GroqClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
561
|
+
| **HubSpotClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
562
|
+
| **IntercomClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
563
|
+
| **JiraClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
564
|
+
| **LaunchDarklyClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
565
|
+
| **MistralClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
566
|
+
| **NotionClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no queryDatabase, etc. |
|
|
567
|
+
| **OpenAIClient** | `apiRequest(options, schema)`, `streamApiRequest(options, schema)` | Supports streaming for real-time token output |
|
|
568
|
+
| **PagerDutyClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
569
|
+
| **PerplexityClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
570
|
+
| **SegmentClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
571
|
+
| **SendGridClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
572
|
+
| **SlackClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no specialized methods |
|
|
573
|
+
| **StabilityAIClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
574
|
+
| **StripeClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest - no createCustomer, etc. |
|
|
575
|
+
| **TwilioClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
576
|
+
| **ZendeskClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
577
|
+
| **ZoomClient** | `apiRequest(options, schema?)` | ONLY generic apiRequest |
|
|
565
578
|
|
|
566
579
|
#### Common Mistakes to Avoid
|
|
567
580
|
|
|
@@ -593,9 +606,10 @@ await openai.apiRequest(
|
|
|
593
606
|
|
|
594
607
|
```typescript
|
|
595
608
|
// Schema is REQUIRED for query()
|
|
596
|
-
const users = await ctx.integrations.db.query(
|
|
597
|
-
|
|
598
|
-
]
|
|
609
|
+
const users = await ctx.integrations.db.query(
|
|
610
|
+
"SELECT * FROM users WHERE id = $1",
|
|
611
|
+
[userId],
|
|
612
|
+
);
|
|
599
613
|
```
|
|
600
614
|
|
|
601
615
|
**CORRECT - Include schema:**
|
|
@@ -622,13 +636,16 @@ To verify available methods and signatures:
|
|
|
622
636
|
Each integration client has detailed documentation with examples and common pitfalls. Click on an integration below for its full README:
|
|
623
637
|
|
|
624
638
|
#### SQL Databases
|
|
639
|
+
|
|
625
640
|
- [PostgreSQL](./src/integrations/postgres/README.md) - Query PostgreSQL databases with schema validation
|
|
626
641
|
- [Snowflake](./src/integrations/snowflake/README.md) - Query Snowflake data warehouses
|
|
627
642
|
|
|
628
643
|
#### GraphQL
|
|
644
|
+
|
|
629
645
|
- [GraphQL](./src/integrations/graphql/README.md) - Execute queries and mutations against GraphQL endpoints
|
|
630
646
|
|
|
631
647
|
#### AI/LLM
|
|
648
|
+
|
|
632
649
|
- [OpenAI](./src/integrations/openai_v2/README.md) - Chat completions, embeddings, DALL-E, and more
|
|
633
650
|
- [Anthropic](./src/integrations/anthropic/README.md) - Claude models for chat and analysis
|
|
634
651
|
- [Cohere](./src/integrations/cohere/README.md) - Text generation, embeddings, classification
|
|
@@ -639,6 +656,7 @@ Each integration client has detailed documentation with examples and common pitf
|
|
|
639
656
|
- [Fireworks](./src/integrations/fireworks/README.md) - Fast model inference
|
|
640
657
|
|
|
641
658
|
#### Messaging & Communication
|
|
659
|
+
|
|
642
660
|
- [Slack](./src/integrations/slack/README.md) - Send messages, manage channels, Block Kit
|
|
643
661
|
- [Twilio](./src/integrations/twilio/README.md) - SMS, voice calls, phone lookups
|
|
644
662
|
- [SendGrid](./src/integrations/sendgrid/README.md) - Transactional and marketing emails
|
|
@@ -646,6 +664,7 @@ Each integration client has detailed documentation with examples and common pitf
|
|
|
646
664
|
- [Front](./src/integrations/front/README.md) - Shared inbox and team communication
|
|
647
665
|
|
|
648
666
|
#### Productivity & Collaboration
|
|
667
|
+
|
|
649
668
|
- [Notion](./src/integrations/notion/README.md) - Databases, pages, and blocks
|
|
650
669
|
- [Airtable](./src/integrations/airtable/README.md) - Spreadsheet-database hybrid
|
|
651
670
|
- [Asana](./src/integrations/asana/README.md) - Project and task management
|
|
@@ -654,11 +673,13 @@ Each integration client has detailed documentation with examples and common pitf
|
|
|
654
673
|
- [Zoom](./src/integrations/zoom/README.md) - Video meetings and webinars
|
|
655
674
|
|
|
656
675
|
#### Developer Tools
|
|
676
|
+
|
|
657
677
|
- [GitHub](./src/integrations/github/README.md) - Repositories, issues, pull requests
|
|
658
678
|
- [Bitbucket](./src/integrations/bitbucket/README.md) - Git repositories and pipelines
|
|
659
679
|
- [CircleCI](./src/integrations/circleci/README.md) - CI/CD pipelines and jobs
|
|
660
680
|
|
|
661
681
|
#### Business & Enterprise
|
|
682
|
+
|
|
662
683
|
- [Stripe](./src/integrations/stripe/README.md) - Payments, subscriptions, invoicing
|
|
663
684
|
- [HubSpot](./src/integrations/hubspot/README.md) - CRM, contacts, deals
|
|
664
685
|
- [Zendesk](./src/integrations/zendesk/README.md) - Support tickets and customer service
|
|
@@ -666,19 +687,23 @@ Each integration client has detailed documentation with examples and common pitf
|
|
|
666
687
|
- [LaunchDarkly](./src/integrations/launchdarkly/README.md) - Feature flags and experimentation
|
|
667
688
|
|
|
668
689
|
#### Analytics & Monitoring
|
|
690
|
+
|
|
669
691
|
- [Google Analytics](./src/integrations/googleanalytics/README.md) - GA4 reports and real-time data
|
|
670
692
|
- [Datadog](./src/integrations/datadog/README.md) - Metrics, monitors, and logs
|
|
671
693
|
- [Segment](./src/integrations/segment/README.md) - Customer data platform
|
|
672
694
|
|
|
673
695
|
#### Cloud Storage
|
|
696
|
+
|
|
674
697
|
- [Google Drive](./src/integrations/googledrive/README.md) - Files, folders, and sharing
|
|
675
698
|
- [Dropbox](./src/integrations/dropbox/README.md) - Cloud file storage
|
|
676
699
|
- [Box](./src/integrations/box/README.md) - Enterprise content management
|
|
677
700
|
|
|
678
701
|
#### Code Execution
|
|
702
|
+
|
|
679
703
|
- [Python](./src/integrations/python/README.md) - Execute Python scripts with type-safe inputs and outputs
|
|
680
704
|
|
|
681
705
|
#### Other
|
|
706
|
+
|
|
682
707
|
- [Elasticsearch](./src/integrations/elasticsearch/README.md) - Search and analytics engine
|
|
683
708
|
- [Stability AI](./src/integrations/stabilityai/README.md) - Image generation and editing
|
|
684
709
|
|
|
@@ -776,9 +801,17 @@ const AnthropicStreamEventSchema = z.discriminatedUnion("type", [
|
|
|
776
801
|
}),
|
|
777
802
|
}),
|
|
778
803
|
z.object({ type: z.literal("message_start"), message: z.any() }),
|
|
779
|
-
z.object({
|
|
804
|
+
z.object({
|
|
805
|
+
type: z.literal("content_block_start"),
|
|
806
|
+
index: z.number(),
|
|
807
|
+
content_block: z.any(),
|
|
808
|
+
}),
|
|
780
809
|
z.object({ type: z.literal("content_block_stop"), index: z.number() }),
|
|
781
|
-
z.object({
|
|
810
|
+
z.object({
|
|
811
|
+
type: z.literal("message_delta"),
|
|
812
|
+
delta: z.any(),
|
|
813
|
+
usage: z.any(),
|
|
814
|
+
}),
|
|
782
815
|
z.object({ type: z.literal("message_stop") }),
|
|
783
816
|
z.object({ type: z.literal("ping") }),
|
|
784
817
|
]);
|
|
@@ -805,7 +838,7 @@ export default streamingApi({
|
|
|
805
838
|
messages: [{ role: "user", content: prompt }],
|
|
806
839
|
},
|
|
807
840
|
},
|
|
808
|
-
{ chunk: AnthropicStreamEventSchema }
|
|
841
|
+
{ chunk: AnthropicStreamEventSchema },
|
|
809
842
|
);
|
|
810
843
|
|
|
811
844
|
for await (const event of stream) {
|
|
@@ -823,10 +856,10 @@ Same as `ApiRequestOptions` - see above.
|
|
|
823
856
|
|
|
824
857
|
### StreamApiRequestSchema
|
|
825
858
|
|
|
826
|
-
| Property | Type
|
|
827
|
-
| -------- |
|
|
828
|
-
| `body?` | `z.ZodSchema<TBody>`
|
|
829
|
-
| `chunk` | `z.ZodSchema<TChunk>`
|
|
859
|
+
| Property | Type | Description |
|
|
860
|
+
| -------- | --------------------- | ------------------------------------------------------------------------------ |
|
|
861
|
+
| `body?` | `z.ZodSchema<TBody>` | Optional Zod schema for request body validation (required if body is provided) |
|
|
862
|
+
| `chunk` | `z.ZodSchema<TChunk>` | **Required** Zod schema for validating each streamed chunk |
|
|
830
863
|
|
|
831
864
|
### Supported Integrations
|
|
832
865
|
|
|
@@ -857,16 +890,16 @@ import {
|
|
|
857
890
|
} from "@superblocksteam/sdk-api";
|
|
858
891
|
```
|
|
859
892
|
|
|
860
|
-
| Error Type
|
|
861
|
-
|
|
|
862
|
-
| `InputValidationError`
|
|
863
|
-
| `OutputValidationError`
|
|
864
|
-
| `QueryValidationError`
|
|
865
|
-
| `RestApiValidationError`
|
|
866
|
-
| `StreamChunkValidationError` | N/A
|
|
867
|
-
| `IntegrationNotFoundError`
|
|
868
|
-
| `IntegrationError`
|
|
869
|
-
| `ExecutionError`
|
|
893
|
+
| Error Type | Code | Description |
|
|
894
|
+
| ---------------------------- | ----------------------- | -------------------------------------------------- |
|
|
895
|
+
| `InputValidationError` | `INPUT_VALIDATION` | Input failed Zod validation |
|
|
896
|
+
| `OutputValidationError` | `OUTPUT_VALIDATION` | Output failed Zod validation |
|
|
897
|
+
| `QueryValidationError` | N/A | Database query result validation failed (Postgres) |
|
|
898
|
+
| `RestApiValidationError` | N/A | REST API request/response validation failed |
|
|
899
|
+
| `StreamChunkValidationError` | N/A | Streaming chunk failed schema validation |
|
|
900
|
+
| `IntegrationNotFoundError` | `INTEGRATION_NOT_FOUND` | Integration not configured |
|
|
901
|
+
| `IntegrationError` | `INTEGRATION_ERROR` | Integration operation failed |
|
|
902
|
+
| `ExecutionError` | `EXECUTION_ERROR` | User code threw an error |
|
|
870
903
|
|
|
871
904
|
### QueryValidationError (Postgres)
|
|
872
905
|
|
|
@@ -1089,7 +1122,10 @@ Don't fetch related data one item at a time in a loop. Use JOINs or batch querie
|
|
|
1089
1122
|
**N+1 Problem - One query per order:**
|
|
1090
1123
|
|
|
1091
1124
|
```typescript
|
|
1092
|
-
const orders = await ctx.integrations.db.query(
|
|
1125
|
+
const orders = await ctx.integrations.db.query(
|
|
1126
|
+
"SELECT * FROM orders",
|
|
1127
|
+
OrderSchema,
|
|
1128
|
+
);
|
|
1093
1129
|
|
|
1094
1130
|
// BAD: This makes N additional queries!
|
|
1095
1131
|
for (const order of orders) {
|
|
@@ -1126,7 +1162,10 @@ const rows = await ctx.integrations.db.query(
|
|
|
1126
1162
|
**Alternative - Batch fetch with IN clause:**
|
|
1127
1163
|
|
|
1128
1164
|
```typescript
|
|
1129
|
-
const orders = await ctx.integrations.db.query(
|
|
1165
|
+
const orders = await ctx.integrations.db.query(
|
|
1166
|
+
"SELECT * FROM orders",
|
|
1167
|
+
OrderSchema,
|
|
1168
|
+
);
|
|
1130
1169
|
const orderIds = orders.map((o) => o.id);
|
|
1131
1170
|
|
|
1132
1171
|
// Single query for all items
|
|
@@ -1211,8 +1250,8 @@ The app template provides automatic type inference for API calls using a tRPC-st
|
|
|
1211
1250
|
**Step 2**: Add it to the registry at `server/apis/index.ts`:
|
|
1212
1251
|
|
|
1213
1252
|
```typescript
|
|
1214
|
-
import GetUsers from
|
|
1215
|
-
import CreateOrder from
|
|
1253
|
+
import GetUsers from "./GetUsers/api.js";
|
|
1254
|
+
import CreateOrder from "./CreateOrder/api.js";
|
|
1216
1255
|
|
|
1217
1256
|
const apis = {
|
|
1218
1257
|
GetUsers,
|
|
@@ -1263,6 +1302,7 @@ The template includes two files that work together:
|
|
|
1263
1302
|
The hook uses `import type` to pull in only the type information from the registry, keeping server code out of the client bundle.
|
|
1264
1303
|
|
|
1265
1304
|
**Key benefits**:
|
|
1305
|
+
|
|
1266
1306
|
- **Single source of truth**: Just update `server/apis/index.ts`
|
|
1267
1307
|
- **No server code in client bundle**: Type-only imports are erased at compile time
|
|
1268
1308
|
- **Full type safety**: Autocomplete for API names, type errors for invalid inputs/outputs
|
|
@@ -1272,8 +1312,8 @@ The hook uses `import type` to pull in only the type information from the regist
|
|
|
1272
1312
|
For testing or when the registry isn't available:
|
|
1273
1313
|
|
|
1274
1314
|
```typescript
|
|
1275
|
-
import { useApi } from
|
|
1276
|
-
import type GetUsersApi from
|
|
1315
|
+
import { useApi } from "@superblocksteam/library";
|
|
1316
|
+
import type GetUsersApi from "../../server/apis/GetUsers/api.js";
|
|
1277
1317
|
|
|
1278
1318
|
const { run } = useApi<typeof GetUsersApi>("GetUsers");
|
|
1279
1319
|
```
|
|
@@ -1348,7 +1388,6 @@ export default api({
|
|
|
1348
1388
|
}),
|
|
1349
1389
|
|
|
1350
1390
|
async run(ctx, { customerId, items, sendAiSummary }) {
|
|
1351
|
-
|
|
1352
1391
|
ctx.log.info("Creating order", { customerId, itemCount: items.length });
|
|
1353
1392
|
|
|
1354
1393
|
// Get customer from database
|
package/dist/api/definition.d.ts
CHANGED
|
@@ -39,6 +39,9 @@ export type ExtractApiInput<T> = T extends CompiledApi<infer TInput, any> ? TInp
|
|
|
39
39
|
export type ExtractApiOutput<T> = T extends CompiledApi<any, infer TOutput> ? TOutput : never;
|
|
40
40
|
import type { ApiConfig, ApiContext, AnyIntegrationRef } from "../types.js";
|
|
41
41
|
import { type IntegrationDeclaration } from "../integrations/declarations.js";
|
|
42
|
+
/** Called by the Vite plugin to set the entry point for the next api() call. */
|
|
43
|
+
export declare function __setEntryPoint(entryPoint: string): void;
|
|
44
|
+
export declare function consumeEntryPoint(): string | undefined;
|
|
42
45
|
/**
|
|
43
46
|
* A compiled API definition ready for execution.
|
|
44
47
|
*
|
|
@@ -48,6 +51,13 @@ import { type IntegrationDeclaration } from "../integrations/declarations.js";
|
|
|
48
51
|
export interface CompiledApi<TInput = unknown, TOutput = unknown> {
|
|
49
52
|
/** Name of the API for identification in logs and debugging */
|
|
50
53
|
readonly name: string;
|
|
54
|
+
/** Plain-language summary of what this API does */
|
|
55
|
+
readonly description?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Source file path relative to the app root (e.g. "server/apis/GetUsers/api.ts").
|
|
58
|
+
* Injected automatically by the Vite plugin — not authored by the user.
|
|
59
|
+
*/
|
|
60
|
+
readonly entryPoint?: string;
|
|
51
61
|
/** Zod schema for validating inputs */
|
|
52
62
|
readonly inputSchema: z.ZodType<TInput>;
|
|
53
63
|
/** Zod schema for validating outputs */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/api/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAE3B,CAAC,SAAS,WAAW,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAE5B,CAAC,SAAS,WAAW,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/api/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAE3B,CAAC,SAAS,WAAW,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAE5B,CAAC,SAAS,WAAW,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAUzC,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAExD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAItD;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IAC9D,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,mDAAmD;IACnD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,uCAAuC;IACvC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExC,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1C;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,CACZ,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EAClD,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtB;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAC9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,GAAG,CACjB,MAAM,SAAS,CAAC,CAAC,OAAO,EACxB,OAAO,SAAS,CAAC,CAAC,OAAO,EACzB,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,MAAM,CAC9D,MAAM,EACN,KAAK,CACN,EAED,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,GAChD,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAkBhD"}
|
package/dist/api/definition.js
CHANGED
|
@@ -5,6 +5,21 @@
|
|
|
5
5
|
* with input/output validation using Zod schemas and upfront integration declarations.
|
|
6
6
|
*/
|
|
7
7
|
import { extractIntegrationDeclarations, } from "../integrations/declarations.js";
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Entry point setter — used by the Vite plugin to stamp the source file path
|
|
10
|
+
// onto the next api()/streamingApi() call. ESM top-level execution is
|
|
11
|
+
// synchronous, so the prepended __setEntryPoint() always runs before api().
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
let __pendingEntryPoint;
|
|
14
|
+
/** Called by the Vite plugin to set the entry point for the next api() call. */
|
|
15
|
+
export function __setEntryPoint(entryPoint) {
|
|
16
|
+
__pendingEntryPoint = entryPoint;
|
|
17
|
+
}
|
|
18
|
+
export function consumeEntryPoint() {
|
|
19
|
+
const ep = __pendingEntryPoint;
|
|
20
|
+
__pendingEntryPoint = undefined;
|
|
21
|
+
return ep;
|
|
22
|
+
}
|
|
8
23
|
/**
|
|
9
24
|
* Define a TypeScript-based API with input/output validation.
|
|
10
25
|
*
|
|
@@ -64,6 +79,8 @@ export function api(config) {
|
|
|
64
79
|
const integrations = extractIntegrationDeclarations(config.integrations);
|
|
65
80
|
const compiled = {
|
|
66
81
|
name: config.name,
|
|
82
|
+
description: config.description,
|
|
83
|
+
entryPoint: consumeEntryPoint(),
|
|
67
84
|
inputSchema: config.input,
|
|
68
85
|
outputSchema: config.output,
|
|
69
86
|
run: config.run,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/api/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0CH,OAAO,EACL,8BAA8B,GAE/B,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/api/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0CH,OAAO,EACL,8BAA8B,GAE/B,MAAM,iCAAiC,CAAC;AAEzC,8EAA8E;AAC9E,6EAA6E;AAC7E,sEAAsE;AACtE,4EAA4E;AAC5E,8EAA8E;AAE9E,IAAI,mBAAuC,CAAC;AAE5C,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,mBAAmB,GAAG,UAAU,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,EAAE,GAAG,mBAAmB,CAAC;IAC/B,mBAAmB,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,CAAC;AACZ,CAAC;AA2DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,UAAU,GAAG,CAQjB,MAAiD;IAEjD,oDAAoD;IACpD,MAAM,YAAY,GAAG,8BAA8B,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEzE,MAAM,QAAQ,GAAmD;QAC/D,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU,EAAE,iBAAiB,EAAE;QAC/B,WAAW,EAAE,MAAM,CAAC,KAAK;QACzB,YAAY,EAAE,MAAM,CAAC,MAAM;QAC3B,GAAG,EAAE,MAAM,CAAC,GAGkB;QAC9B,YAAY;KACb,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests for API definition utility types.
|
|
2
|
+
* Tests for API definition utility types and entry point mechanism.
|
|
3
3
|
*/
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
-
import { describe, it, expectTypeOf } from "vitest";
|
|
5
|
+
import { describe, it, expect, expectTypeOf } from "vitest";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { api, } from "./definition.js";
|
|
7
|
+
import { api, __setEntryPoint, consumeEntryPoint, } from "./definition.js";
|
|
8
8
|
describe("ExtractApiInput", () => {
|
|
9
9
|
it("extracts input type from simple API", () => {
|
|
10
10
|
const _SimpleApi = api({
|
|
@@ -207,4 +207,57 @@ describe("ExtractApiInput and ExtractApiOutput together", () => {
|
|
|
207
207
|
expectTypeOf().toEqualTypeOf();
|
|
208
208
|
});
|
|
209
209
|
});
|
|
210
|
+
describe("entryPoint mechanism", () => {
|
|
211
|
+
it("api() has no entryPoint when __setEntryPoint was not called", () => {
|
|
212
|
+
const compiled = api({
|
|
213
|
+
name: "NoEntryPoint",
|
|
214
|
+
input: z.object({}),
|
|
215
|
+
output: z.object({ ok: z.boolean() }),
|
|
216
|
+
async run() {
|
|
217
|
+
return { ok: true };
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
expect(compiled.entryPoint).toBeUndefined();
|
|
221
|
+
});
|
|
222
|
+
it("api() picks up entryPoint set via __setEntryPoint", () => {
|
|
223
|
+
__setEntryPoint("server/apis/GetUsers/api.ts");
|
|
224
|
+
const compiled = api({
|
|
225
|
+
name: "GetUsers",
|
|
226
|
+
input: z.object({}),
|
|
227
|
+
output: z.object({ users: z.array(z.string()) }),
|
|
228
|
+
async run() {
|
|
229
|
+
return { users: [] };
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
expect(compiled.entryPoint).toBe("server/apis/GetUsers/api.ts");
|
|
233
|
+
});
|
|
234
|
+
it("consumeEntryPoint clears the pending value", () => {
|
|
235
|
+
__setEntryPoint("server/apis/Temp/api.ts");
|
|
236
|
+
const first = consumeEntryPoint();
|
|
237
|
+
const second = consumeEntryPoint();
|
|
238
|
+
expect(first).toBe("server/apis/Temp/api.ts");
|
|
239
|
+
expect(second).toBeUndefined();
|
|
240
|
+
});
|
|
241
|
+
it("entryPoint is consumed once — second api() call gets undefined", () => {
|
|
242
|
+
__setEntryPoint("server/apis/First/api.ts");
|
|
243
|
+
const first = api({
|
|
244
|
+
name: "First",
|
|
245
|
+
input: z.object({}),
|
|
246
|
+
output: z.object({}),
|
|
247
|
+
async run() {
|
|
248
|
+
return {};
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
const second = api({
|
|
252
|
+
name: "Second",
|
|
253
|
+
input: z.object({}),
|
|
254
|
+
output: z.object({}),
|
|
255
|
+
async run() {
|
|
256
|
+
return {};
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
expect(first.entryPoint).toBe("server/apis/First/api.ts");
|
|
260
|
+
expect(second.entryPoint).toBeUndefined();
|
|
261
|
+
});
|
|
262
|
+
});
|
|
210
263
|
//# sourceMappingURL=definition.test.js.map
|