@superblocksteam/sdk-api 0.0.6 → 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 -36
- package/dist/integrations/couchbase/client.d.ts.map +0 -1
- package/dist/integrations/couchbase/client.js +0 -148
- package/dist/integrations/couchbase/client.js.map +0 -1
- package/dist/integrations/couchbase/index.d.ts +0 -8
- package/dist/integrations/couchbase/index.d.ts.map +0 -1
- package/dist/integrations/couchbase/index.js +0 -7
- package/dist/integrations/couchbase/index.js.map +0 -1
- package/dist/integrations/couchbase/types.d.ts +0 -100
- package/dist/integrations/couchbase/types.d.ts.map +0 -1
- package/dist/integrations/couchbase/types.js +0 -5
- package/dist/integrations/couchbase/types.js.map +0 -1
- package/dist/integrations/kafka/client.d.ts +0 -25
- package/dist/integrations/kafka/client.d.ts.map +0 -1
- package/dist/integrations/kafka/client.js +0 -124
- package/dist/integrations/kafka/client.js.map +0 -1
- package/dist/integrations/kafka/index.d.ts +0 -8
- package/dist/integrations/kafka/index.d.ts.map +0 -1
- package/dist/integrations/kafka/index.js +0 -7
- package/dist/integrations/kafka/index.js.map +0 -1
- package/dist/integrations/kafka/types.d.ts +0 -113
- package/dist/integrations/kafka/types.d.ts.map +0 -1
- package/dist/integrations/kafka/types.js +0 -5
- package/dist/integrations/kafka/types.js.map +0 -1
- package/dist/integrations/kinesis/client.d.ts +0 -31
- package/dist/integrations/kinesis/client.d.ts.map +0 -1
- package/dist/integrations/kinesis/client.js +0 -101
- package/dist/integrations/kinesis/client.js.map +0 -1
- package/dist/integrations/kinesis/index.d.ts +0 -8
- package/dist/integrations/kinesis/index.d.ts.map +0 -1
- package/dist/integrations/kinesis/index.js +0 -7
- package/dist/integrations/kinesis/index.js.map +0 -1
- package/dist/integrations/kinesis/types.d.ts +0 -97
- package/dist/integrations/kinesis/types.d.ts.map +0 -1
- package/dist/integrations/kinesis/types.js +0 -7
- package/dist/integrations/kinesis/types.js.map +0 -1
- package/dist/integrations/python/client.d.ts +0 -42
- package/dist/integrations/python/client.d.ts.map +0 -1
- package/dist/integrations/python/client.js +0 -89
- package/dist/integrations/python/client.js.map +0 -1
- package/dist/integrations/python/client.test.d.ts +0 -5
- package/dist/integrations/python/client.test.d.ts.map +0 -1
- package/dist/integrations/python/client.test.js +0 -214
- package/dist/integrations/python/client.test.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -6
- package/dist/integrations/python/index.d.ts.map +0 -1
- package/dist/integrations/python/index.js +0 -5
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/python/types.d.ts +0 -85
- package/dist/integrations/python/types.d.ts.map +0 -1
- package/dist/integrations/python/types.js +0 -5
- package/dist/integrations/python/types.js.map +0 -1
- package/dist/integrations/redis/client.d.ts +0 -43
- package/dist/integrations/redis/client.d.ts.map +0 -1
- package/dist/integrations/redis/client.js +0 -142
- package/dist/integrations/redis/client.js.map +0 -1
- package/dist/integrations/redis/index.d.ts +0 -8
- package/dist/integrations/redis/index.d.ts.map +0 -1
- package/dist/integrations/redis/index.js +0 -7
- package/dist/integrations/redis/index.js.map +0 -1
- package/dist/integrations/redis/types.d.ts +0 -137
- package/dist/integrations/redis/types.d.ts.map +0 -1
- package/dist/integrations/redis/types.js +0 -5
- package/dist/integrations/redis/types.js.map +0 -1
- package/dist/runtime/execute.d.ts +0 -128
- package/dist/runtime/execute.d.ts.map +0 -1
- package/dist/runtime/execute.js +0 -84
- package/dist/runtime/execute.js.map +0 -1
- package/dist/runtime/streaming-context.d.ts +0 -49
- package/dist/runtime/streaming-context.d.ts.map +0 -1
- package/dist/runtime/streaming-context.js +0 -71
- package/dist/runtime/streaming-context.js.map +0 -1
- package/dist/runtime/streaming-executor.d.ts +0 -159
- package/dist/runtime/streaming-executor.d.ts.map +0 -1
- package/dist/runtime/streaming-executor.js +0 -229
- package/dist/runtime/streaming-executor.js.map +0 -1
- package/src/api/streaming.test.ts +0 -432
- package/src/api/streaming.ts +0 -302
- package/src/integrations/couchbase/README.md +0 -138
- package/src/integrations/couchbase/client.ts +0 -224
- package/src/integrations/couchbase/index.ts +0 -8
- package/src/integrations/couchbase/types.ts +0 -125
- package/src/integrations/kafka/README.md +0 -144
- package/src/integrations/kafka/client.ts +0 -215
- package/src/integrations/kafka/index.ts +0 -14
- package/src/integrations/kafka/types.ts +0 -127
- package/src/integrations/kinesis/README.md +0 -153
- package/src/integrations/kinesis/client.ts +0 -146
- package/src/integrations/kinesis/index.ts +0 -14
- package/src/integrations/kinesis/types.ts +0 -114
- package/src/integrations/python/README.md +0 -566
- package/src/integrations/python/client.test.ts +0 -340
- package/src/integrations/python/client.ts +0 -134
- package/src/integrations/python/index.ts +0 -6
- package/src/integrations/python/types.ts +0 -91
- package/src/integrations/redis/README.md +0 -200
- package/src/integrations/redis/client.ts +0 -207
- package/src/integrations/redis/index.ts +0 -8
- package/src/integrations/redis/types.ts +0 -166
- package/src/runtime/execute.ts +0 -221
- package/src/runtime/streaming-context.ts +0 -164
- package/src/runtime/streaming-executor.ts +0 -367
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/integrations/athena/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/integrations/athena/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,qBAAa,gBAAiB,YAAW,YAAY,EAAE,qBAAqB;IAC1E,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;;;;;;;;;;OAUG;IACH,OAAO,CAAC,YAAY;IAcd,KAAK,CAAC,CAAC,EACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,MAAM,CAAC,EAAE,OAAO,EAAE,EAClB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,CAAC,EAAE,CAAC;IAiDT,OAAO,CACX,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,EAClB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAmBjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/athena/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/athena/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAClB,MAAM,CAAoB;IAClB,YAAY,CAAgB;IAE7C,YAAY,MAAyB,EAAE,YAA2B;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;OAUG;IACK,YAAY,CAClB,GAAW,EACX,MAAkB;QAElB,MAAM,SAAS,GAAG,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAE9C,OAAO;YACL,MAAM,EAAE;gBACN,OAAO,EAAE,GAAG;gBACZ,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;aAC3D;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK,CACT,GAAW,EACX,MAAsB,EACtB,MAAkB,EAClB,QAAwB;QAExB,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,oBAAoB;gBACrC,KAAK,YAAY,gBAAgB,EACjC,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,MAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CACX,GAAW,EACX,MAAkB,EAClB,QAAwB;QAExB,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAE/C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;YAErE,IACE,OAAO,MAAM,KAAK,QAAQ;gBAC1B,MAAM,KAAK,IAAI;gBACf,UAAU,IAAI,MAAM,EACpB,CAAC;gBACD,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,CAAC;YAED,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -22,7 +22,7 @@ import type { TraceMetadata } from "../registry.js";
|
|
|
22
22
|
* });
|
|
23
23
|
*
|
|
24
24
|
* const logs = await athena.query(
|
|
25
|
-
* 'SELECT * FROM logs WHERE level =
|
|
25
|
+
* 'SELECT * FROM logs WHERE level = ?',
|
|
26
26
|
* LogSchema,
|
|
27
27
|
* ['ERROR']
|
|
28
28
|
* );
|
|
@@ -32,7 +32,7 @@ export interface AthenaClient extends BaseIntegrationClient {
|
|
|
32
32
|
/**
|
|
33
33
|
* Execute a SQL query and validate results against a Zod schema.
|
|
34
34
|
*
|
|
35
|
-
* @param sql - SQL query string (use
|
|
35
|
+
* @param sql - SQL query string (use ? placeholders for parameters)
|
|
36
36
|
* @param schema - Zod schema to validate the query results
|
|
37
37
|
* @param params - Optional query parameters
|
|
38
38
|
* @returns Promise resolving to validated query results
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/integrations/athena/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/integrations/athena/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IACzD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,CAAC,EACL,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,MAAM,CAAC,EAAE,OAAO,EAAE,EAClB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAEhB;;;;;;OAMG;IACH,OAAO,CACL,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,EAClB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClC"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Provides the foundation for GraphQL integration clients with query() and mutation() methods.
|
|
5
5
|
* Handles proto message construction and response validation.
|
|
6
6
|
*/
|
|
7
|
-
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
8
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
9
7
|
import { z } from "zod";
|
|
8
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
9
|
+
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
10
10
|
/**
|
|
11
11
|
* Base class for GraphQL integration clients.
|
|
12
12
|
*
|
|
@@ -15,6 +15,8 @@ import { z } from "zod";
|
|
|
15
15
|
* - Executing queries and mutations through the orchestrator
|
|
16
16
|
* - Required Zod schema validation on full GraphQL response
|
|
17
17
|
* - Variables serialization for parameterized queries
|
|
18
|
+
* - Optional per-request HTTP headers (in addition to any headers configured
|
|
19
|
+
* on the integration)
|
|
18
20
|
*/
|
|
19
21
|
export declare abstract class GraphQLIntegrationClient implements IntegrationClientImpl {
|
|
20
22
|
readonly name: string;
|
|
@@ -29,11 +31,12 @@ export declare abstract class GraphQLIntegrationClient implements IntegrationCli
|
|
|
29
31
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
30
32
|
* @param variables - Optional variables for the query
|
|
31
33
|
* @param metadata - Optional trace metadata for observability
|
|
34
|
+
* @param headers - Optional HTTP headers to send with the request
|
|
32
35
|
* @returns Validated query result
|
|
33
36
|
*/
|
|
34
37
|
query<TResponse>(query: string, schema: {
|
|
35
38
|
response: z.ZodSchema<TResponse>;
|
|
36
|
-
}, variables?: Record<string, unknown>, metadata?: TraceMetadata): Promise<TResponse>;
|
|
39
|
+
}, variables?: Record<string, unknown>, metadata?: TraceMetadata, headers?: Record<string, string>): Promise<TResponse>;
|
|
37
40
|
/**
|
|
38
41
|
* Execute a GraphQL mutation.
|
|
39
42
|
*
|
|
@@ -41,11 +44,12 @@ export declare abstract class GraphQLIntegrationClient implements IntegrationCli
|
|
|
41
44
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
42
45
|
* @param variables - Optional variables for the mutation
|
|
43
46
|
* @param metadata - Optional trace metadata for observability
|
|
47
|
+
* @param headers - Optional HTTP headers to send with the request
|
|
44
48
|
* @returns Validated mutation result
|
|
45
49
|
*/
|
|
46
50
|
mutation<TResponse>(mutation: string, schema: {
|
|
47
51
|
response: z.ZodSchema<TResponse>;
|
|
48
|
-
}, variables?: Record<string, unknown>, metadata?: TraceMetadata): Promise<TResponse>;
|
|
52
|
+
}, variables?: Record<string, unknown>, metadata?: TraceMetadata, headers?: Record<string, string>): Promise<TResponse>;
|
|
49
53
|
/**
|
|
50
54
|
* Execute a GraphQL operation (query or mutation).
|
|
51
55
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-integration-client.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/graphql-integration-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"graphql-integration-client.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/graphql-integration-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,8BAAsB,wBAAyB,YAAW,qBAAqB;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,OAAO,CAAC,YAAY,CAAgB;gBAExB,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa;IAOlE;;;;;;;;;OASG;IACG,KAAK,CAAC,SAAS,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;KAAE,EAC5C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,CAAC,EAAE,aAAa,EACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,SAAS,CAAC;IAIrB;;;;;;;;;OASG;IACG,QAAQ,CAAC,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;KAAE,EAC5C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,CAAC,EAAE,aAAa,EACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,SAAS,CAAC;IAIrB;;;;;OAKG;YACW,cAAc;CAkD7B"}
|
|
@@ -13,6 +13,8 @@ import { RestApiValidationError } from "../../errors.js";
|
|
|
13
13
|
* - Executing queries and mutations through the orchestrator
|
|
14
14
|
* - Required Zod schema validation on full GraphQL response
|
|
15
15
|
* - Variables serialization for parameterized queries
|
|
16
|
+
* - Optional per-request HTTP headers (in addition to any headers configured
|
|
17
|
+
* on the integration)
|
|
16
18
|
*/
|
|
17
19
|
export class GraphQLIntegrationClient {
|
|
18
20
|
name;
|
|
@@ -32,10 +34,11 @@ export class GraphQLIntegrationClient {
|
|
|
32
34
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
33
35
|
* @param variables - Optional variables for the query
|
|
34
36
|
* @param metadata - Optional trace metadata for observability
|
|
37
|
+
* @param headers - Optional HTTP headers to send with the request
|
|
35
38
|
* @returns Validated query result
|
|
36
39
|
*/
|
|
37
|
-
async query(query, schema, variables, metadata) {
|
|
38
|
-
return this.executeGraphQL(query, schema, variables, metadata);
|
|
40
|
+
async query(query, schema, variables, metadata, headers) {
|
|
41
|
+
return this.executeGraphQL(query, schema, variables, metadata, headers);
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
44
|
* Execute a GraphQL mutation.
|
|
@@ -44,10 +47,11 @@ export class GraphQLIntegrationClient {
|
|
|
44
47
|
* @param schema - Zod schema for full response validation (REQUIRED)
|
|
45
48
|
* @param variables - Optional variables for the mutation
|
|
46
49
|
* @param metadata - Optional trace metadata for observability
|
|
50
|
+
* @param headers - Optional HTTP headers to send with the request
|
|
47
51
|
* @returns Validated mutation result
|
|
48
52
|
*/
|
|
49
|
-
async mutation(mutation, schema, variables, metadata) {
|
|
50
|
-
return this.executeGraphQL(mutation, schema, variables, metadata);
|
|
53
|
+
async mutation(mutation, schema, variables, metadata, headers) {
|
|
54
|
+
return this.executeGraphQL(mutation, schema, variables, metadata, headers);
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Execute a GraphQL operation (query or mutation).
|
|
@@ -55,7 +59,13 @@ export class GraphQLIntegrationClient {
|
|
|
55
59
|
* Builds the graphql.v1.Plugin proto message, executes through orchestrator,
|
|
56
60
|
* and validates the full response against the required schema.
|
|
57
61
|
*/
|
|
58
|
-
async executeGraphQL(queryString, schema, variables, metadata) {
|
|
62
|
+
async executeGraphQL(queryString, schema, variables, metadata, headers) {
|
|
63
|
+
const headerProps = [];
|
|
64
|
+
if (headers) {
|
|
65
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
66
|
+
headerProps.push({ key, value });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
59
69
|
// Build graphql.v1.Plugin proto message
|
|
60
70
|
const request = {
|
|
61
71
|
body: queryString,
|
|
@@ -70,6 +80,9 @@ export class GraphQLIntegrationClient {
|
|
|
70
80
|
verboseHttpOutput: false,
|
|
71
81
|
failOnGraphqlErrors: true,
|
|
72
82
|
};
|
|
83
|
+
if (headerProps.length > 0) {
|
|
84
|
+
request.headers = headerProps;
|
|
85
|
+
}
|
|
73
86
|
// Execute query through orchestrator
|
|
74
87
|
const response = await this.executeQuery(request, undefined, metadata);
|
|
75
88
|
// Return full GraphQL response without unwrapping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-integration-client.js","sourceRoot":"","sources":["../../../src/integrations/base/graphql-integration-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"graphql-integration-client.js","sourceRoot":"","sources":["../../../src/integrations/base/graphql-integration-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIzD;;;;;;;;;;GAUG;AACH,MAAM,OAAgB,wBAAwB;IACnC,IAAI,CAAS;IACb,QAAQ,CAAS;IACjB,MAAM,CAAoB;IAC3B,YAAY,CAAgB;IAEpC,YAAY,MAAyB,EAAE,YAA2B;QAChE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,KAAK,CACT,KAAa,EACb,MAA4C,EAC5C,SAAmC,EACnC,QAAwB,EACxB,OAAgC;QAEhC,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,QAAQ,CACZ,QAAgB,EAChB,MAA4C,EAC5C,SAAmC,EACnC,QAAwB,EACxB,OAAgC;QAEhC,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,cAAc,CAC1B,WAAmB,EACnB,MAA4C,EAC5C,SAA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
|
|
1
1
|
/**
|
|
2
2
|
* Base clients for integrations.
|
|
3
3
|
*/
|
|
4
|
+
export { RestApiClientBase } from "./rest-api-client-base.js";
|
|
4
5
|
export { RestApiIntegrationClient } from "./rest-api-integration-client.js";
|
|
5
|
-
export type { RestApiRequest } from "./rest-api-
|
|
6
|
+
export type { RestApiRequest } from "./rest-api-client-base.js";
|
|
6
7
|
export { GraphQLIntegrationClient } from "./graphql-integration-client.js";
|
|
7
|
-
export type { ApiRequestOptions, ApiRequestSchema, SupportsApiRequest,
|
|
8
|
+
export type { ApiRequestOptions, ApiRequestSchema, SupportsApiRequest, } from "./types.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base clients for integrations.
|
|
3
3
|
*/
|
|
4
|
+
export { RestApiClientBase } from "./rest-api-client-base.js";
|
|
4
5
|
export { RestApiIntegrationClient } from "./rest-api-integration-client.js";
|
|
5
6
|
export { GraphQLIntegrationClient } from "./graphql-integration-client.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/base/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/base/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract base for REST API Integration clients.
|
|
3
|
+
*
|
|
4
|
+
* Owns the shared infrastructure that every REST-API-backed integration
|
|
5
|
+
* needs: config storage, parameter helpers, body validation, request
|
|
6
|
+
* construction, and query execution. Subclasses add their own
|
|
7
|
+
* `apiRequest` with whatever response-handling strategy they need
|
|
8
|
+
* (e.g. direct Zod validation, discriminated-union wrapping).
|
|
9
|
+
*/
|
|
10
|
+
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import type { Property } from "@superblocksteam/types/dist/src/common/v1/plugin_pb";
|
|
13
|
+
import type { Plugin as RestApiIntegrationPlugin } from "@superblocksteam/types/dist/src/plugins/restapiintegration/v1/plugin_pb";
|
|
14
|
+
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
15
|
+
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
16
|
+
import type { ApiRequestOptions } from "./types.js";
|
|
17
|
+
export type RestApiRequest = PartialMessage<RestApiIntegrationPlugin>;
|
|
18
|
+
/**
|
|
19
|
+
* Shared base for all REST API Integration clients.
|
|
20
|
+
*
|
|
21
|
+
* Provides config fields, parameter helpers, body validation, request
|
|
22
|
+
* building, and query execution. Does NOT define `apiRequest` — each
|
|
23
|
+
* concrete subclass supplies its own return-type contract.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class RestApiClientBase implements IntegrationClientImpl {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly pluginId: string;
|
|
28
|
+
readonly config: IntegrationConfig;
|
|
29
|
+
protected readonly executeQuery: QueryExecutor;
|
|
30
|
+
constructor(config: IntegrationConfig, executeQuery: QueryExecutor);
|
|
31
|
+
/**
|
|
32
|
+
* Create a Property object for query params / headers.
|
|
33
|
+
*/
|
|
34
|
+
protected createParam(key: string, value: unknown): PartialMessage<Property>;
|
|
35
|
+
/**
|
|
36
|
+
* Validate the request body, build the proto request, and execute it.
|
|
37
|
+
*
|
|
38
|
+
* Returns the raw (unvalidated) response from the orchestrator.
|
|
39
|
+
* Subclasses call this, then apply their own response handling.
|
|
40
|
+
*
|
|
41
|
+
* @param options - HTTP method, path, body, params, headers
|
|
42
|
+
* @param bodySchema - Optional Zod schema for body validation
|
|
43
|
+
* @param metadata - Optional trace metadata for observability
|
|
44
|
+
* @returns Raw response from the orchestrator
|
|
45
|
+
*/
|
|
46
|
+
protected executeApiRequest<TBody>(options: ApiRequestOptions<TBody>, bodySchema?: z.ZodSchema<TBody>, metadata?: TraceMetadata): Promise<unknown>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=rest-api-client-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest-api-client-base.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/rest-api-client-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,KAAK,EAAE,MAAM,IAAI,wBAAwB,EAAE,MAAM,yEAAyE,CAAC;AAGlI,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,wBAAwB,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,8BAAsB,iBAAkB,YAAW,qBAAqB;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAEnC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;gBAEnC,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa;IAOlE;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC;IAO5E;;;;;;;;;;OAUG;cACa,iBAAiB,CAAC,KAAK,EACrC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACjC,UAAU,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAC/B,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,OAAO,CAAC;CAgEpB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract base for REST API Integration clients.
|
|
3
|
+
*
|
|
4
|
+
* Owns the shared infrastructure that every REST-API-backed integration
|
|
5
|
+
* needs: config storage, parameter helpers, body validation, request
|
|
6
|
+
* construction, and query execution. Subclasses add their own
|
|
7
|
+
* `apiRequest` with whatever response-handling strategy they need
|
|
8
|
+
* (e.g. direct Zod validation, discriminated-union wrapping).
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { RestApiValidationError } from "../../errors.js";
|
|
12
|
+
/**
|
|
13
|
+
* Shared base for all REST API Integration clients.
|
|
14
|
+
*
|
|
15
|
+
* Provides config fields, parameter helpers, body validation, request
|
|
16
|
+
* building, and query execution. Does NOT define `apiRequest` — each
|
|
17
|
+
* concrete subclass supplies its own return-type contract.
|
|
18
|
+
*/
|
|
19
|
+
export class RestApiClientBase {
|
|
20
|
+
name;
|
|
21
|
+
pluginId;
|
|
22
|
+
config;
|
|
23
|
+
executeQuery;
|
|
24
|
+
constructor(config, executeQuery) {
|
|
25
|
+
this.name = config.name;
|
|
26
|
+
this.pluginId = config.pluginId;
|
|
27
|
+
this.config = config;
|
|
28
|
+
this.executeQuery = executeQuery;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a Property object for query params / headers.
|
|
32
|
+
*/
|
|
33
|
+
createParam(key, value) {
|
|
34
|
+
return {
|
|
35
|
+
key,
|
|
36
|
+
value: typeof value === "string" ? value : JSON.stringify(value),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Validate the request body, build the proto request, and execute it.
|
|
41
|
+
*
|
|
42
|
+
* Returns the raw (unvalidated) response from the orchestrator.
|
|
43
|
+
* Subclasses call this, then apply their own response handling.
|
|
44
|
+
*
|
|
45
|
+
* @param options - HTTP method, path, body, params, headers
|
|
46
|
+
* @param bodySchema - Optional Zod schema for body validation
|
|
47
|
+
* @param metadata - Optional trace metadata for observability
|
|
48
|
+
* @returns Raw response from the orchestrator
|
|
49
|
+
*/
|
|
50
|
+
async executeApiRequest(options, bodySchema, metadata) {
|
|
51
|
+
// Validate request body if both body and schema are present.
|
|
52
|
+
if (options.body !== undefined && bodySchema) {
|
|
53
|
+
const bodyParseResult = bodySchema.safeParse(options.body);
|
|
54
|
+
if (!bodyParseResult.success) {
|
|
55
|
+
throw new RestApiValidationError(`Request body validation failed: ${bodyParseResult.error.message}`, {
|
|
56
|
+
zodError: bodyParseResult.error,
|
|
57
|
+
data: options.body,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const headers = [];
|
|
62
|
+
if (options.headers) {
|
|
63
|
+
for (const [key, value] of Object.entries(options.headers)) {
|
|
64
|
+
headers.push(this.createParam(key, value));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const params = [];
|
|
68
|
+
if (options.params) {
|
|
69
|
+
for (const [key, value] of Object.entries(options.params)) {
|
|
70
|
+
params.push(this.createParam(key, value));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const request = {
|
|
74
|
+
openApiAction: "genericHttpRequest",
|
|
75
|
+
httpMethod: options.method.toUpperCase(),
|
|
76
|
+
urlPath: options.path,
|
|
77
|
+
headers,
|
|
78
|
+
params,
|
|
79
|
+
responseType: "json",
|
|
80
|
+
};
|
|
81
|
+
if (options.body !== undefined) {
|
|
82
|
+
request.body = JSON.stringify(options.body);
|
|
83
|
+
request.bodyType = "jsonBody";
|
|
84
|
+
}
|
|
85
|
+
const result = await this.executeQuery(request, undefined, metadata);
|
|
86
|
+
if (result === null || result === undefined) {
|
|
87
|
+
const nonNullResult = z.object({}).safeParse(result);
|
|
88
|
+
if (!nonNullResult.success) {
|
|
89
|
+
throw new RestApiValidationError(`Integration query returned ${String(result)} — expected a JSON response object`, {
|
|
90
|
+
zodError: nonNullResult.error,
|
|
91
|
+
data: result,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=rest-api-client-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest-api-client-base.js","sourceRoot":"","sources":["../../../src/integrations/base/rest-api-client-base.ts"],"names":[],"mappings":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AAM,CAAC,CAAC;YACrD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;gBAC3B,MAAM,IAAI,sBAAsB,CAC9B,8BAA8B,MAAM,CAAC,MAAM,CAAC,oCAAoC,EAChF;oBACE,QAAQ,EAAE,aAAa,CAAC,KAAK;oBAC7B,IAAI,EAAE,MAAM;iBACb,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,78 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Generic REST API Integration client with Zod response validation.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Extends RestApiClientBase with an apiRequest() that validates the
|
|
5
|
+
* full response against a caller-supplied Zod schema and throws
|
|
6
|
+
* RestApiValidationError on mismatch.
|
|
5
7
|
*/
|
|
6
|
-
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
7
|
-
import type { Plugin as RestApiIntegrationPlugin } from "@superblocksteam/types/dist/src/plugins/restapiintegration/v1/plugin_pb";
|
|
8
|
-
import type { Property } from "@superblocksteam/types/dist/src/common/v1/plugin_pb";
|
|
9
|
-
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
10
|
-
import type { QueryExecutor, StreamingQueryExecutor, TraceMetadata } from "../registry.js";
|
|
11
|
-
import type { ApiRequestOptions, ApiRequestSchema, SupportsApiRequest, StreamApiRequestSchema, SupportsStreamingApiRequest } from "./types.js";
|
|
12
8
|
import type { z } from "zod";
|
|
13
|
-
|
|
9
|
+
import type { TraceMetadata } from "../registry.js";
|
|
10
|
+
import { RestApiClientBase } from "./rest-api-client-base.js";
|
|
11
|
+
import type { ApiRequestOptions, ApiRequestSchema, SupportsApiRequest } from "./types.js";
|
|
14
12
|
/**
|
|
15
13
|
* Base implementation for REST API Integration clients.
|
|
16
14
|
*
|
|
17
|
-
* All OpenAPI-based integration clients
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* All OpenAPI-based integration clients (except those with
|
|
16
|
+
* integration-specific response handling) extend this class to
|
|
17
|
+
* inherit the generic apiRequest() method with runtime Zod validation.
|
|
20
18
|
*/
|
|
21
|
-
export declare abstract class RestApiIntegrationClient implements
|
|
22
|
-
readonly name: string;
|
|
23
|
-
readonly pluginId: string;
|
|
24
|
-
readonly config: IntegrationConfig;
|
|
25
|
-
protected readonly executeQuery: QueryExecutor;
|
|
26
|
-
protected readonly executeStreamingQuery?: StreamingQueryExecutor;
|
|
27
|
-
constructor(config: IntegrationConfig, executeQuery: QueryExecutor, executeStreamingQuery?: StreamingQueryExecutor);
|
|
28
|
-
/**
|
|
29
|
-
* Helper to create a Property object for params.
|
|
30
|
-
*/
|
|
31
|
-
protected createParam(key: string, value: unknown): PartialMessage<Property>;
|
|
19
|
+
export declare abstract class RestApiIntegrationClient extends RestApiClientBase implements SupportsApiRequest {
|
|
32
20
|
apiRequest<TBody, TResponse>(options: ApiRequestOptions<TBody>, schema: ApiRequestSchema<TBody, TResponse> & {
|
|
33
21
|
response: z.ZodSchema<TResponse>;
|
|
34
22
|
}, metadata?: TraceMetadata): Promise<TResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Execute a streaming API request with type-safe chunk validation.
|
|
37
|
-
*
|
|
38
|
-
* Returns an AsyncIterable that yields validated chunks as they arrive.
|
|
39
|
-
* Each chunk is validated against the provided schema before being yielded.
|
|
40
|
-
*
|
|
41
|
-
* @param options - Request configuration including method, path, params, and body
|
|
42
|
-
* @param schema - Zod schemas for request body and chunk validation
|
|
43
|
-
* @param metadata - Optional trace metadata for observability (label, description)
|
|
44
|
-
* @returns AsyncIterable yielding validated chunks
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const ChunkSchema = z.object({
|
|
49
|
-
* id: z.string(),
|
|
50
|
-
* choices: z.array(z.object({
|
|
51
|
-
* delta: z.object({
|
|
52
|
-
* content: z.string().optional(),
|
|
53
|
-
* }),
|
|
54
|
-
* })),
|
|
55
|
-
* });
|
|
56
|
-
*
|
|
57
|
-
* const stream = client.streamApiRequest(
|
|
58
|
-
* {
|
|
59
|
-
* method: 'POST',
|
|
60
|
-
* path: '/v1/chat/completions',
|
|
61
|
-
* body: {
|
|
62
|
-
* model: 'gpt-4',
|
|
63
|
-
* stream: true,
|
|
64
|
-
* messages: [{ role: 'user', content: 'Hello!' }],
|
|
65
|
-
* },
|
|
66
|
-
* },
|
|
67
|
-
* { chunk: ChunkSchema },
|
|
68
|
-
* { label: 'openai.chatCompletions', description: 'Stream chat completion' }
|
|
69
|
-
* );
|
|
70
|
-
*
|
|
71
|
-
* for await (const chunk of stream) {
|
|
72
|
-
* console.log(chunk.choices[0]?.delta?.content);
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
streamApiRequest<TBody, TChunk>(options: ApiRequestOptions<TBody>, schema: StreamApiRequestSchema<TBody, TChunk>, metadata?: TraceMetadata): AsyncIterable<TChunk>;
|
|
77
23
|
}
|
|
78
24
|
//# sourceMappingURL=rest-api-integration-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-api-integration-client.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/rest-api-integration-client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rest-api-integration-client.d.ts","sourceRoot":"","sources":["../../../src/integrations/base/rest-api-integration-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,8BAAsB,wBACpB,SAAQ,iBACR,YAAW,kBAAkB;IAEvB,UAAU,CAAC,KAAK,EAAE,SAAS,EAC/B,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACjC,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG;QAC3C,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KAClC,EACD,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,SAAS,CAAC;CAkBtB"}
|