@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
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Redis client implementation.
|
|
3
|
-
*
|
|
4
|
-
* Uses the native Redis plugin type from @superblocksteam/types.
|
|
5
|
-
* Supports raw Redis commands and typed structured operations
|
|
6
|
-
* (get, set, del, keys, hget, hset, hgetall, etc.).
|
|
7
|
-
*
|
|
8
|
-
* Request format matches the Redis plugin proto's oneof structure:
|
|
9
|
-
* - Raw: `{ raw: { singleton: { query: "..." } } }`
|
|
10
|
-
* - Structured: `{ structured: { set: { key: "...", value: "..." } } }`
|
|
11
|
-
*/
|
|
12
|
-
import type { z } from "zod";
|
|
13
|
-
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
14
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
15
|
-
import type { RedisClient } from "./types.js";
|
|
16
|
-
/**
|
|
17
|
-
* Internal implementation of RedisClient.
|
|
18
|
-
*
|
|
19
|
-
* Provides both raw and structured Redis command execution.
|
|
20
|
-
*/
|
|
21
|
-
export declare class RedisClientImpl implements RedisClient, IntegrationClientImpl {
|
|
22
|
-
readonly config: IntegrationConfig;
|
|
23
|
-
private readonly executeQuery;
|
|
24
|
-
constructor(config: IntegrationConfig, executeQuery: QueryExecutor);
|
|
25
|
-
get name(): string;
|
|
26
|
-
get pluginId(): string;
|
|
27
|
-
/**
|
|
28
|
-
* Execute a request and wrap errors.
|
|
29
|
-
*/
|
|
30
|
-
private exec;
|
|
31
|
-
command<T>(command: string, schema: z.ZodSchema<T>, metadata?: TraceMetadata): Promise<T>;
|
|
32
|
-
get(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
33
|
-
set(key: string, value: string, expirationMs?: number, metadata?: TraceMetadata): Promise<unknown>;
|
|
34
|
-
del(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
35
|
-
keys(pattern: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
36
|
-
hget(key: string, field: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
37
|
-
hset(key: string, field: string, value: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
38
|
-
hgetall(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
39
|
-
hdel(key: string, field: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
40
|
-
expire(key: string, seconds: number, metadata?: TraceMetadata): Promise<unknown>;
|
|
41
|
-
ttl(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/integrations/redis/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAsC9C;;;;GAIG;AACH,qBAAa,eAAgB,YAAW,WAAW,EAAE,qBAAqB;IACxE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;gBAEjC,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa;IAKlE,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;YACW,IAAI;IAmBZ,OAAO,CAAC,CAAC,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,CAAC,CAAC;IA4BP,GAAG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redis plugin type from @superblocksteam/types.
|
|
5
|
-
* Supports raw Redis commands and typed structured operations
|
|
6
|
-
* (get, set, del, keys, hget, hset, hgetall, etc.).
|
|
7
|
-
*
|
|
8
|
-
* Request format matches the Redis plugin proto's oneof structure:
|
|
9
|
-
* - Raw: `{ raw: { singleton: { query: "..." } } }`
|
|
10
|
-
* - Structured: `{ structured: { set: { key: "...", value: "..." } } }`
|
|
11
|
-
*/
|
|
12
|
-
import { RestApiValidationError } from "../../errors.js";
|
|
13
|
-
import { IntegrationError } from "../../runtime/errors.js";
|
|
14
|
-
/**
|
|
15
|
-
* Build a raw Redis command request matching the proto JSON format.
|
|
16
|
-
*
|
|
17
|
-
* Proto structure: `oneof command_type { Raw raw = 3; }`
|
|
18
|
-
* Raw structure: `oneof action { Singleton singleton = 1; }`
|
|
19
|
-
*/
|
|
20
|
-
function buildRawRequest(command) {
|
|
21
|
-
return {
|
|
22
|
-
raw: {
|
|
23
|
-
singleton: {
|
|
24
|
-
query: command,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Build a structured Redis command request matching the proto JSON format.
|
|
31
|
-
*
|
|
32
|
-
* Proto structure: `oneof command_type { Structured structured = 4; }`
|
|
33
|
-
* Structured structure: `oneof action { Get get = 6; Set set = 7; ... }`
|
|
34
|
-
*
|
|
35
|
-
* @param actionName - The structured action name (e.g., 'get', 'set')
|
|
36
|
-
* @param value - The action-specific parameters
|
|
37
|
-
*/
|
|
38
|
-
function buildStructuredRequest(actionName, value) {
|
|
39
|
-
return {
|
|
40
|
-
structured: {
|
|
41
|
-
[actionName]: value,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Internal implementation of RedisClient.
|
|
47
|
-
*
|
|
48
|
-
* Provides both raw and structured Redis command execution.
|
|
49
|
-
*/
|
|
50
|
-
export class RedisClientImpl {
|
|
51
|
-
config;
|
|
52
|
-
executeQuery;
|
|
53
|
-
constructor(config, executeQuery) {
|
|
54
|
-
this.config = config;
|
|
55
|
-
this.executeQuery = executeQuery;
|
|
56
|
-
}
|
|
57
|
-
get name() {
|
|
58
|
-
return this.config.name;
|
|
59
|
-
}
|
|
60
|
-
get pluginId() {
|
|
61
|
-
return this.config.pluginId;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Execute a request and wrap errors.
|
|
65
|
-
*/
|
|
66
|
-
async exec(request, operation, metadata) {
|
|
67
|
-
try {
|
|
68
|
-
return await this.executeQuery(request, undefined, metadata);
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
if (error instanceof RestApiValidationError ||
|
|
72
|
-
error instanceof IntegrationError) {
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
throw new IntegrationError(this.config.name, operation, error);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async command(command, schema, metadata) {
|
|
79
|
-
const request = buildRawRequest(command);
|
|
80
|
-
const rawResult = await this.exec(request, "command", metadata);
|
|
81
|
-
// The Redis plugin wraps raw command results in { response: ... }.
|
|
82
|
-
// Unwrap to the actual value so callers can validate against the expected type.
|
|
83
|
-
const result = rawResult !== null &&
|
|
84
|
-
typeof rawResult === "object" &&
|
|
85
|
-
"response" in rawResult
|
|
86
|
-
? rawResult.response
|
|
87
|
-
: rawResult;
|
|
88
|
-
const parseResult = schema.safeParse(result);
|
|
89
|
-
if (!parseResult.success) {
|
|
90
|
-
throw new RestApiValidationError(`Result validation failed: ${parseResult.error.message}`, {
|
|
91
|
-
zodError: parseResult.error,
|
|
92
|
-
data: result,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return parseResult.data;
|
|
96
|
-
}
|
|
97
|
-
async get(key, metadata) {
|
|
98
|
-
const request = buildStructuredRequest("get", { key });
|
|
99
|
-
return this.exec(request, "get", metadata);
|
|
100
|
-
}
|
|
101
|
-
async set(key, value, expirationMs, metadata) {
|
|
102
|
-
const params = { key, value };
|
|
103
|
-
if (expirationMs !== undefined) {
|
|
104
|
-
params.expirationMs = expirationMs;
|
|
105
|
-
}
|
|
106
|
-
const request = buildStructuredRequest("set", params);
|
|
107
|
-
return this.exec(request, "set", metadata);
|
|
108
|
-
}
|
|
109
|
-
async del(key, metadata) {
|
|
110
|
-
const request = buildStructuredRequest("del", { key });
|
|
111
|
-
return this.exec(request, "del", metadata);
|
|
112
|
-
}
|
|
113
|
-
async keys(pattern, metadata) {
|
|
114
|
-
const request = buildStructuredRequest("keys", { pattern });
|
|
115
|
-
return this.exec(request, "keys", metadata);
|
|
116
|
-
}
|
|
117
|
-
async hget(key, field, metadata) {
|
|
118
|
-
const request = buildStructuredRequest("hget", { key, field });
|
|
119
|
-
return this.exec(request, "hget", metadata);
|
|
120
|
-
}
|
|
121
|
-
async hset(key, field, value, metadata) {
|
|
122
|
-
const request = buildStructuredRequest("hset", { key, field, value });
|
|
123
|
-
return this.exec(request, "hset", metadata);
|
|
124
|
-
}
|
|
125
|
-
async hgetall(key, metadata) {
|
|
126
|
-
const request = buildStructuredRequest("hgetall", { key });
|
|
127
|
-
return this.exec(request, "hgetall", metadata);
|
|
128
|
-
}
|
|
129
|
-
async hdel(key, field, metadata) {
|
|
130
|
-
const request = buildStructuredRequest("hdel", { key, field });
|
|
131
|
-
return this.exec(request, "hdel", metadata);
|
|
132
|
-
}
|
|
133
|
-
async expire(key, seconds, metadata) {
|
|
134
|
-
const request = buildStructuredRequest("expire", { key, seconds });
|
|
135
|
-
return this.exec(request, "expire", metadata);
|
|
136
|
-
}
|
|
137
|
-
async ttl(key, metadata) {
|
|
138
|
-
const request = buildStructuredRequest("ttl", { key });
|
|
139
|
-
return this.exec(request, "ttl", metadata);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/redis/client.ts"],"names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C;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,IAAI,CACR,GAAW,EACX,KAAa,EACb,QAAwB;QAExB,MAAM,OAAO,GAAG,sBAAsB,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,MAAM,CACV,GAAW,EACX,OAAe,EACf,QAAwB;QAExB,MAAM,OAAO,GAAG,sBAAsB,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,QAAwB;QAC7C,MAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/redis/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/redis/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Redis client types.
|
|
3
|
-
*/
|
|
4
|
-
import type { z } from "zod";
|
|
5
|
-
import type { BaseIntegrationClient } from "../../types.js";
|
|
6
|
-
import type { TraceMetadata } from "../registry.js";
|
|
7
|
-
/**
|
|
8
|
-
* Redis client for executing commands.
|
|
9
|
-
*
|
|
10
|
-
* Provides typed methods for common Redis operations as well as a
|
|
11
|
-
* generic command() method for executing raw Redis commands.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* // Declare in api(): integrations: { redis: redis(INTEGRATION_ID) }
|
|
16
|
-
* // In run(), access via ctx.integrations.redis
|
|
17
|
-
*
|
|
18
|
-
* // Typed string operations
|
|
19
|
-
* await redis.set('user:1', 'Alice');
|
|
20
|
-
* const name = await redis.get('user:1');
|
|
21
|
-
*
|
|
22
|
-
* // Typed hash operations
|
|
23
|
-
* await redis.hset('user:1', 'name', 'Alice');
|
|
24
|
-
* const val = await redis.hget('user:1', 'name');
|
|
25
|
-
* const all = await redis.hgetall('user:1');
|
|
26
|
-
*
|
|
27
|
-
* // Key operations
|
|
28
|
-
* await redis.del('user:1');
|
|
29
|
-
* const userKeys = await redis.keys('user:*');
|
|
30
|
-
*
|
|
31
|
-
* // Raw command for anything not covered by typed methods
|
|
32
|
-
* const result = await redis.command(
|
|
33
|
-
* 'LRANGE mylist 0 -1',
|
|
34
|
-
* z.array(z.string())
|
|
35
|
-
* );
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export interface RedisClient extends BaseIntegrationClient {
|
|
39
|
-
/**
|
|
40
|
-
* Execute a raw Redis command.
|
|
41
|
-
*
|
|
42
|
-
* Use this for commands not covered by the typed methods.
|
|
43
|
-
*
|
|
44
|
-
* @param command - The Redis command string (e.g., "LRANGE mylist 0 -1")
|
|
45
|
-
* @param schema - Zod schema for validating the result
|
|
46
|
-
* @returns The validated result
|
|
47
|
-
*/
|
|
48
|
-
command<T>(command: string, schema: z.ZodSchema<T>, metadata?: TraceMetadata): Promise<T>;
|
|
49
|
-
/**
|
|
50
|
-
* Get the value of a key.
|
|
51
|
-
*
|
|
52
|
-
* @param key - The key to get
|
|
53
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
54
|
-
* @returns The value, or null if the key does not exist
|
|
55
|
-
*/
|
|
56
|
-
get(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
57
|
-
/**
|
|
58
|
-
* Set the value of a key.
|
|
59
|
-
*
|
|
60
|
-
* @param key - The key to set
|
|
61
|
-
* @param value - The value to set
|
|
62
|
-
* @param expirationMs - Optional expiration time in milliseconds
|
|
63
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
64
|
-
* @returns The result (typically "OK")
|
|
65
|
-
*/
|
|
66
|
-
set(key: string, value: string, expirationMs?: number, metadata?: TraceMetadata): Promise<unknown>;
|
|
67
|
-
/**
|
|
68
|
-
* Delete a key.
|
|
69
|
-
*
|
|
70
|
-
* @param key - The key to delete
|
|
71
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
72
|
-
* @returns The number of keys removed
|
|
73
|
-
*/
|
|
74
|
-
del(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
75
|
-
/**
|
|
76
|
-
* Find all keys matching a pattern.
|
|
77
|
-
*
|
|
78
|
-
* @param pattern - The glob-style pattern to match (e.g., "user:*")
|
|
79
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
80
|
-
* @returns Array of matching keys
|
|
81
|
-
*/
|
|
82
|
-
keys(pattern: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
83
|
-
/**
|
|
84
|
-
* Get the value of a hash field.
|
|
85
|
-
*
|
|
86
|
-
* @param key - The hash key
|
|
87
|
-
* @param field - The field name
|
|
88
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
89
|
-
* @returns The field value, or null if the field does not exist
|
|
90
|
-
*/
|
|
91
|
-
hget(key: string, field: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
92
|
-
/**
|
|
93
|
-
* Set the value of a hash field.
|
|
94
|
-
*
|
|
95
|
-
* @param key - The hash key
|
|
96
|
-
* @param field - The field name
|
|
97
|
-
* @param value - The value to set
|
|
98
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
99
|
-
* @returns The number of fields that were added
|
|
100
|
-
*/
|
|
101
|
-
hset(key: string, field: string, value: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
102
|
-
/**
|
|
103
|
-
* Get all fields and values of a hash.
|
|
104
|
-
*
|
|
105
|
-
* @param key - The hash key
|
|
106
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
107
|
-
* @returns Object with all field-value pairs
|
|
108
|
-
*/
|
|
109
|
-
hgetall(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
110
|
-
/**
|
|
111
|
-
* Delete a hash field.
|
|
112
|
-
*
|
|
113
|
-
* @param key - The hash key
|
|
114
|
-
* @param field - The field to delete
|
|
115
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
116
|
-
* @returns The number of fields that were removed
|
|
117
|
-
*/
|
|
118
|
-
hdel(key: string, field: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
119
|
-
/**
|
|
120
|
-
* Set expiration on a key.
|
|
121
|
-
*
|
|
122
|
-
* @param key - The key to set expiration on
|
|
123
|
-
* @param seconds - Time to live in seconds
|
|
124
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
125
|
-
* @returns 1 if timeout was set, 0 if key does not exist
|
|
126
|
-
*/
|
|
127
|
-
expire(key: string, seconds: number, metadata?: TraceMetadata): Promise<unknown>;
|
|
128
|
-
/**
|
|
129
|
-
* Get the remaining time to live of a key.
|
|
130
|
-
*
|
|
131
|
-
* @param key - The key to check
|
|
132
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
133
|
-
* @returns TTL in seconds, -2 if key does not exist, -1 if no expiration
|
|
134
|
-
*/
|
|
135
|
-
ttl(key: string, metadata?: TraceMetadata): Promise<unknown>;
|
|
136
|
-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Q,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7E;;;;;;;;OAQG;IACH,IAAI,CACF,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjE;;;;;;;OAOG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7E;;;;;;;OAOG;IACH,MAAM,CACJ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/integrations/redis/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified API execution function.
|
|
3
|
-
*
|
|
4
|
-
* Provides a single `execute()` function that handles both regular and streaming APIs,
|
|
5
|
-
* detecting the API type at runtime and returning appropriate result types.
|
|
6
|
-
*/
|
|
7
|
-
import type { CompiledApi } from "../api/definition.js";
|
|
8
|
-
import { isStreamingApi, type CompiledStreamingApi } from "../api/streaming.js";
|
|
9
|
-
import type { TraceMetadata } from "../integrations/registry.js";
|
|
10
|
-
import type { IntegrationConfig } from "../integrations/types.js";
|
|
11
|
-
import type { ApiUser } from "../types.js";
|
|
12
|
-
import { type ExecuteApiResponse } from "./executor.js";
|
|
13
|
-
/**
|
|
14
|
-
* Unified request for executing any API (regular or streaming).
|
|
15
|
-
*
|
|
16
|
-
* This interface combines the fields from both `ExecuteApiRequest` and
|
|
17
|
-
* `ExecuteStreamingApiRequest` into a single type. The `executeStreamingQuery`
|
|
18
|
-
* field is only required when executing streaming APIs that use streaming
|
|
19
|
-
* integration support.
|
|
20
|
-
*/
|
|
21
|
-
export interface UnifiedExecuteApiRequest {
|
|
22
|
-
/** Raw input data to be validated */
|
|
23
|
-
input: unknown;
|
|
24
|
-
/** Available integration configurations */
|
|
25
|
-
integrations: IntegrationConfig[];
|
|
26
|
-
/** Unique execution ID for tracing */
|
|
27
|
-
executionId: string;
|
|
28
|
-
/** Environment variables available to the API */
|
|
29
|
-
env: Record<string, string>;
|
|
30
|
-
/** User information extracted from the Superblocks JWT */
|
|
31
|
-
user: ApiUser;
|
|
32
|
-
/**
|
|
33
|
-
* Function to execute integration operations (non-streaming).
|
|
34
|
-
*
|
|
35
|
-
* @param integrationId - The integration ID
|
|
36
|
-
* @param request - Plugin-specific request object
|
|
37
|
-
* @param bindings - Optional bindings for language plugins
|
|
38
|
-
* @returns Promise resolving to the operation result
|
|
39
|
-
*/
|
|
40
|
-
executeQuery: (integrationId: string, request: Record<string, unknown>, bindings?: Record<string, unknown>, metadata?: TraceMetadata) => Promise<unknown>;
|
|
41
|
-
/**
|
|
42
|
-
* Function to execute streaming integration operations.
|
|
43
|
-
* Optional - only needed for streaming APIs that use streaming integrations.
|
|
44
|
-
*
|
|
45
|
-
* @param integrationId - The integration ID
|
|
46
|
-
* @param request - Plugin-specific request object
|
|
47
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
48
|
-
* @returns AsyncIterable yielding raw chunks
|
|
49
|
-
*/
|
|
50
|
-
executeStreamingQuery?: (integrationId: string, request: Record<string, unknown>, metadata?: TraceMetadata) => AsyncIterable<unknown>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Union type for any compiled API (regular or streaming).
|
|
54
|
-
*
|
|
55
|
-
* Note: This is a permissive type for runtime use. The `execute` function
|
|
56
|
-
* provides overloads for proper type inference.
|
|
57
|
-
*/
|
|
58
|
-
export type AnyCompiledApi = CompiledApi<any, any> | CompiledStreamingApi<any, any>;
|
|
59
|
-
/**
|
|
60
|
-
* Execute a regular (non-streaming) compiled API.
|
|
61
|
-
*
|
|
62
|
-
* @param api - The compiled API definition
|
|
63
|
-
* @param request - The execution request
|
|
64
|
-
* @returns Promise resolving to execution response with success/error and output
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* const response = await execute(myApi, {
|
|
69
|
-
* input: { userId: '123' },
|
|
70
|
-
* integrations: [...],
|
|
71
|
-
* executionId: 'exec_abc',
|
|
72
|
-
* env: {},
|
|
73
|
-
* executeQuery: async (id, req) => orchestrator.execute(id, req),
|
|
74
|
-
* });
|
|
75
|
-
*
|
|
76
|
-
* if (response.success) {
|
|
77
|
-
* console.log(response.output);
|
|
78
|
-
* } else {
|
|
79
|
-
* console.error(response.error);
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export declare function execute<TInput, TOutput>(api: CompiledApi<TInput, TOutput>, request: UnifiedExecuteApiRequest): Promise<ExecuteApiResponse<TOutput>>;
|
|
84
|
-
/**
|
|
85
|
-
* Execute a streaming compiled API.
|
|
86
|
-
*
|
|
87
|
-
* @param api - The compiled streaming API definition
|
|
88
|
-
* @param request - The execution request
|
|
89
|
-
* @returns AsyncGenerator that yields validated chunks
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* const stream = execute(myStreamingApi, {
|
|
94
|
-
* input: { prompt: 'Hello' },
|
|
95
|
-
* integrations: [...],
|
|
96
|
-
* executionId: 'exec_abc',
|
|
97
|
-
* env: {},
|
|
98
|
-
* executeQuery: async (id, req) => orchestrator.execute(id, req),
|
|
99
|
-
* executeStreamingQuery: (id, req) => orchestrator.stream(id, req),
|
|
100
|
-
* });
|
|
101
|
-
*
|
|
102
|
-
* for await (const chunk of stream) {
|
|
103
|
-
* console.log(chunk.text);
|
|
104
|
-
* }
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
export declare function execute<TInput, TChunk>(api: CompiledStreamingApi<TInput, TChunk>, request: UnifiedExecuteApiRequest): AsyncGenerator<TChunk, void, undefined>;
|
|
108
|
-
/**
|
|
109
|
-
* Type guard to check if an API is a streaming API.
|
|
110
|
-
*
|
|
111
|
-
* Use this to determine which result type you'll get from `execute()`.
|
|
112
|
-
*
|
|
113
|
-
* @param api - The API to check
|
|
114
|
-
* @returns `true` if the API is a streaming API
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```typescript
|
|
118
|
-
* if (isStreamingApi(api)) {
|
|
119
|
-
* const stream = execute(api, request);
|
|
120
|
-
* for await (const chunk of stream) { ... }
|
|
121
|
-
* } else {
|
|
122
|
-
* const response = await execute(api, request);
|
|
123
|
-
* if (response.success) { ... }
|
|
124
|
-
* }
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
export { isStreamingApi };
|
|
128
|
-
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/runtime/execute.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM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AAO,CAAC,MAAM,EAAE,MAAM,EACpC,GAAG,EAAE,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,OAAO,EAAE,wBAAwB,GAChC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAgE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/runtime/execute.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified API execution function.
|
|
3
|
-
*
|
|
4
|
-
* Provides a single `execute()` function that handles both regular and streaming APIs,
|
|
5
|
-
* detecting the API type at runtime and returning appropriate result types.
|
|
6
|
-
*/
|
|
7
|
-
import { isStreamingApi } from "../api/streaming.js";
|
|
8
|
-
import { executeApi } from "./executor.js";
|
|
9
|
-
import { createStreamingApiGenerator } from "./streaming-executor.js";
|
|
10
|
-
/**
|
|
11
|
-
* Execute any compiled API (regular or streaming).
|
|
12
|
-
*
|
|
13
|
-
* This unified function detects whether the API is streaming or regular
|
|
14
|
-
* and returns the appropriate result type:
|
|
15
|
-
*
|
|
16
|
-
* - **Regular APIs**: Returns `Promise<ExecuteApiResponse<TOutput>>`
|
|
17
|
-
* - **Streaming APIs**: Returns `AsyncGenerator<TChunk>`
|
|
18
|
-
*
|
|
19
|
-
* @param api - The compiled API definition (regular or streaming)
|
|
20
|
-
* @param request - The execution request
|
|
21
|
-
* @returns Promise for regular APIs, AsyncGenerator for streaming APIs
|
|
22
|
-
*
|
|
23
|
-
* @example Regular API
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const response = await execute(myApi, {
|
|
26
|
-
* input: { userId: '123' },
|
|
27
|
-
* integrations: [...],
|
|
28
|
-
* executionId: 'exec_abc',
|
|
29
|
-
* env: {},
|
|
30
|
-
* executeQuery: async (id, req) => orchestrator.execute(id, req),
|
|
31
|
-
* });
|
|
32
|
-
*
|
|
33
|
-
* if (response.success) {
|
|
34
|
-
* console.log(response.output);
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @example Streaming API
|
|
39
|
-
* ```typescript
|
|
40
|
-
* const stream = execute(myStreamingApi, {
|
|
41
|
-
* input: { prompt: 'Hello' },
|
|
42
|
-
* integrations: [...],
|
|
43
|
-
* executionId: 'exec_abc',
|
|
44
|
-
* env: {},
|
|
45
|
-
* executeQuery: async (id, req) => orchestrator.execute(id, req),
|
|
46
|
-
* executeStreamingQuery: (id, req) => orchestrator.stream(id, req),
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* for await (const chunk of stream) {
|
|
50
|
-
* console.log(chunk.text);
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export function execute(api, request) {
|
|
55
|
-
if (isStreamingApi(api)) {
|
|
56
|
-
// Streaming API - return generator directly
|
|
57
|
-
return createStreamingApiGenerator(api, request);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
// Regular API - return promise
|
|
61
|
-
return executeApi(api, request);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Type guard to check if an API is a streaming API.
|
|
66
|
-
*
|
|
67
|
-
* Use this to determine which result type you'll get from `execute()`.
|
|
68
|
-
*
|
|
69
|
-
* @param api - The API to check
|
|
70
|
-
* @returns `true` if the API is a streaming API
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* if (isStreamingApi(api)) {
|
|
75
|
-
* const stream = execute(api, request);
|
|
76
|
-
* for await (const chunk of stream) { ... }
|
|
77
|
-
* } else {
|
|
78
|
-
* const response = await execute(api, request);
|
|
79
|
-
* if (response.success) { ... }
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export { isStreamingApi };
|
|
84
|
-
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/runtime/execute.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAA6B,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAE,UAAU,EAA2B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AA8HtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,OAAO,CACrB,GAAmB,EACnB,OAAiC;IAIjC,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,4CAA4C;QAC5C,OAAO,2BAA2B,CAChC,GAA6C,EAC7C,OAAO,CACR,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,+BAA+B;QAC/B,OAAO,UAAU,CAAC,GAAoC,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Streaming API execution context factory.
|
|
3
|
-
*
|
|
4
|
-
* Creates the context object for streaming API functions, providing
|
|
5
|
-
* access to integrations (with streaming support), logging, and environment.
|
|
6
|
-
*/
|
|
7
|
-
import type { ApiContext, ApiUser, Logger, AnyIntegrationRef } from "../types.js";
|
|
8
|
-
import type { IntegrationConfig } from "../integrations/types.js";
|
|
9
|
-
import type { IntegrationDeclaration } from "../integrations/declarations.js";
|
|
10
|
-
import { type TraceMetadata } from "../integrations/registry.js";
|
|
11
|
-
/**
|
|
12
|
-
* Options for creating a streaming API execution context.
|
|
13
|
-
*/
|
|
14
|
-
export interface CreateStreamingContextOptions {
|
|
15
|
-
/** Available integration configurations keyed by id */
|
|
16
|
-
integrations: Map<string, IntegrationConfig>;
|
|
17
|
-
/**
|
|
18
|
-
* Declared integrations from the API config.
|
|
19
|
-
*/
|
|
20
|
-
integrationDeclarations: IntegrationDeclaration[];
|
|
21
|
-
/**
|
|
22
|
-
* Function to execute integration operations (non-streaming).
|
|
23
|
-
*/
|
|
24
|
-
executeQuery: (integrationId: string, request: Record<string, unknown>, bindings?: Record<string, unknown>, metadata?: TraceMetadata) => Promise<unknown>;
|
|
25
|
-
/**
|
|
26
|
-
* Function to execute streaming integration operations.
|
|
27
|
-
* Optional - if not provided, streaming operations will throw an error.
|
|
28
|
-
*/
|
|
29
|
-
executeStreamingQuery?: (integrationId: string, request: Record<string, unknown>, metadata?: TraceMetadata) => AsyncIterable<unknown>;
|
|
30
|
-
/** Execution ID for logging correlation */
|
|
31
|
-
executionId: string;
|
|
32
|
-
/** Environment variables */
|
|
33
|
-
env: Record<string, string>;
|
|
34
|
-
/** User information from JWT */
|
|
35
|
-
user: ApiUser;
|
|
36
|
-
/** Optional custom logger */
|
|
37
|
-
logger?: Logger;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Creates a streaming API execution context.
|
|
41
|
-
*
|
|
42
|
-
* Similar to createApiContext but supports streaming query execution
|
|
43
|
-
* for integration clients that support it.
|
|
44
|
-
*
|
|
45
|
-
* @param options - Context creation options
|
|
46
|
-
* @returns The API context for streaming API execution
|
|
47
|
-
*/
|
|
48
|
-
export declare function createStreamingApiContext(options: CreateStreamingContextOptions): ApiContext<Record<string, AnyIntegrationRef>>;
|
|
49
|
-
//# sourceMappingURL=streaming-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-context.d.ts","sourceRoot":"","sources":["../../src/runtime/streaming-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,MAAM,EACN,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,C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