@digital-science-dsl/dimensions-analytics-mcp 0.5.3
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/CHANGELOG.md +61 -0
- package/README.md +152 -0
- package/bin/dimensions-analytics-mcp-http.js +2 -0
- package/bin/dimensions-analytics-mcp.js +2 -0
- package/dist/client/auth/config-loaders.d.ts +22 -0
- package/dist/client/auth/config-loaders.d.ts.map +1 -0
- package/dist/client/auth/config-loaders.js +68 -0
- package/dist/client/auth/config-loaders.js.map +1 -0
- package/dist/client/auth/decorators/index.d.ts +7 -0
- package/dist/client/auth/decorators/index.d.ts.map +1 -0
- package/dist/client/auth/decorators/index.js +6 -0
- package/dist/client/auth/decorators/index.js.map +1 -0
- package/dist/client/auth/decorators/with-caching.d.ts +81 -0
- package/dist/client/auth/decorators/with-caching.d.ts.map +1 -0
- package/dist/client/auth/decorators/with-caching.js +168 -0
- package/dist/client/auth/decorators/with-caching.js.map +1 -0
- package/dist/client/auth/factory.d.ts +13 -0
- package/dist/client/auth/factory.d.ts.map +1 -0
- package/dist/client/auth/factory.js +29 -0
- package/dist/client/auth/factory.js.map +1 -0
- package/dist/client/auth/index.d.ts +7 -0
- package/dist/client/auth/index.d.ts.map +1 -0
- package/dist/client/auth/index.js +6 -0
- package/dist/client/auth/index.js.map +1 -0
- package/dist/client/auth/jwt-utils.d.ts +17 -0
- package/dist/client/auth/jwt-utils.d.ts.map +1 -0
- package/dist/client/auth/jwt-utils.js +33 -0
- package/dist/client/auth/jwt-utils.js.map +1 -0
- package/dist/client/auth/node.d.ts +16 -0
- package/dist/client/auth/node.d.ts.map +1 -0
- package/dist/client/auth/node.js +15 -0
- package/dist/client/auth/node.js.map +1 -0
- package/dist/client/auth/providers/index.d.ts +2 -0
- package/dist/client/auth/providers/index.d.ts.map +1 -0
- package/dist/client/auth/providers/index.js +2 -0
- package/dist/client/auth/providers/index.js.map +1 -0
- package/dist/client/auth/providers/jwt-auth-provider.d.ts +70 -0
- package/dist/client/auth/providers/jwt-auth-provider.d.ts.map +1 -0
- package/dist/client/auth/providers/jwt-auth-provider.js +134 -0
- package/dist/client/auth/providers/jwt-auth-provider.js.map +1 -0
- package/dist/client/auth/schemas.d.ts +19 -0
- package/dist/client/auth/schemas.d.ts.map +1 -0
- package/dist/client/auth/schemas.js +23 -0
- package/dist/client/auth/schemas.js.map +1 -0
- package/dist/client/auth/types.d.ts +25 -0
- package/dist/client/auth/types.d.ts.map +1 -0
- package/dist/client/auth/types.js +9 -0
- package/dist/client/auth/types.js.map +1 -0
- package/dist/client/command.d.ts +44 -0
- package/dist/client/command.d.ts.map +1 -0
- package/dist/client/command.js +23 -0
- package/dist/client/command.js.map +1 -0
- package/dist/client/config/index.d.ts +11 -0
- package/dist/client/config/index.d.ts.map +1 -0
- package/dist/client/config/index.js +8 -0
- package/dist/client/config/index.js.map +1 -0
- package/dist/client/config/loader.d.ts +27 -0
- package/dist/client/config/loader.d.ts.map +1 -0
- package/dist/client/config/loader.js +128 -0
- package/dist/client/config/loader.js.map +1 -0
- package/dist/client/config/node.d.ts +18 -0
- package/dist/client/config/node.d.ts.map +1 -0
- package/dist/client/config/node.js +17 -0
- package/dist/client/config/node.js.map +1 -0
- package/dist/client/config/schemas.d.ts +23 -0
- package/dist/client/config/schemas.d.ts.map +1 -0
- package/dist/client/config/schemas.js +24 -0
- package/dist/client/config/schemas.js.map +1 -0
- package/dist/client/config/types.d.ts +37 -0
- package/dist/client/config/types.d.ts.map +1 -0
- package/dist/client/config/types.js +6 -0
- package/dist/client/config/types.js.map +1 -0
- package/dist/client/config/unified-loader.d.ts +41 -0
- package/dist/client/config/unified-loader.d.ts.map +1 -0
- package/dist/client/config/unified-loader.js +86 -0
- package/dist/client/config/unified-loader.js.map +1 -0
- package/dist/client/config.d.ts +43 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/config.js +56 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/deployment-config.d.ts +36 -0
- package/dist/client/deployment-config.d.ts.map +1 -0
- package/dist/client/deployment-config.js +79 -0
- package/dist/client/deployment-config.js.map +1 -0
- package/dist/client/errors.d.ts +180 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +253 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/http-client.d.ts +215 -0
- package/dist/client/http-client.d.ts.map +1 -0
- package/dist/client/http-client.js +419 -0
- package/dist/client/http-client.js.map +1 -0
- package/dist/client/index.d.ts +28 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +18 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/internal-dsl-client.d.ts +30 -0
- package/dist/client/internal-dsl-client.d.ts.map +1 -0
- package/dist/client/internal-dsl-client.js +101 -0
- package/dist/client/internal-dsl-client.js.map +1 -0
- package/dist/client/rate-limiter.d.ts +79 -0
- package/dist/client/rate-limiter.d.ts.map +1 -0
- package/dist/client/rate-limiter.js +118 -0
- package/dist/client/rate-limiter.js.map +1 -0
- package/dist/client/resolve-api-key-user.d.ts +24 -0
- package/dist/client/resolve-api-key-user.d.ts.map +1 -0
- package/dist/client/resolve-api-key-user.js +80 -0
- package/dist/client/resolve-api-key-user.js.map +1 -0
- package/dist/client/types.d.ts +44 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +10 -0
- package/dist/client/types.js.map +1 -0
- package/dist/dsl/client.d.ts +330 -0
- package/dist/dsl/client.d.ts.map +1 -0
- package/dist/dsl/client.js +433 -0
- package/dist/dsl/client.js.map +1 -0
- package/dist/dsl/commands/apply-filters.d.ts +15 -0
- package/dist/dsl/commands/apply-filters.d.ts.map +1 -0
- package/dist/dsl/commands/apply-filters.js +29 -0
- package/dist/dsl/commands/apply-filters.js.map +1 -0
- package/dist/dsl/commands/facet/index.d.ts +6 -0
- package/dist/dsl/commands/facet/index.d.ts.map +1 -0
- package/dist/dsl/commands/facet/index.js +6 -0
- package/dist/dsl/commands/facet/index.js.map +1 -0
- package/dist/dsl/commands/facet/schemas.d.ts +71 -0
- package/dist/dsl/commands/facet/schemas.d.ts.map +1 -0
- package/dist/dsl/commands/facet/schemas.js +84 -0
- package/dist/dsl/commands/facet/schemas.js.map +1 -0
- package/dist/dsl/commands/functions/ClassifyCommand.d.ts +96 -0
- package/dist/dsl/commands/functions/ClassifyCommand.d.ts.map +1 -0
- package/dist/dsl/commands/functions/ClassifyCommand.js +95 -0
- package/dist/dsl/commands/functions/ClassifyCommand.js.map +1 -0
- package/dist/dsl/commands/functions/ExtractAffiliationsCommand.d.ts +86 -0
- package/dist/dsl/commands/functions/ExtractAffiliationsCommand.d.ts.map +1 -0
- package/dist/dsl/commands/functions/ExtractAffiliationsCommand.js +131 -0
- package/dist/dsl/commands/functions/ExtractAffiliationsCommand.js.map +1 -0
- package/dist/dsl/commands/functions/ExtractConceptsCommand.d.ts +73 -0
- package/dist/dsl/commands/functions/ExtractConceptsCommand.d.ts.map +1 -0
- package/dist/dsl/commands/functions/ExtractConceptsCommand.js +110 -0
- package/dist/dsl/commands/functions/ExtractConceptsCommand.js.map +1 -0
- package/dist/dsl/commands/functions/ExtractGrantsCommand.d.ts +66 -0
- package/dist/dsl/commands/functions/ExtractGrantsCommand.d.ts.map +1 -0
- package/dist/dsl/commands/functions/ExtractGrantsCommand.js +87 -0
- package/dist/dsl/commands/functions/ExtractGrantsCommand.js.map +1 -0
- package/dist/dsl/commands/functions/index.d.ts +10 -0
- package/dist/dsl/commands/functions/index.d.ts.map +1 -0
- package/dist/dsl/commands/functions/index.js +10 -0
- package/dist/dsl/commands/functions/index.js.map +1 -0
- package/dist/dsl/commands/index.d.ts +8 -0
- package/dist/dsl/commands/index.d.ts.map +1 -0
- package/dist/dsl/commands/index.js +7 -0
- package/dist/dsl/commands/index.js.map +1 -0
- package/dist/dsl/commands/validate-input.d.ts +18 -0
- package/dist/dsl/commands/validate-input.d.ts.map +1 -0
- package/dist/dsl/commands/validate-input.js +27 -0
- package/dist/dsl/commands/validate-input.js.map +1 -0
- package/dist/dsl/create-client.d.ts +32 -0
- package/dist/dsl/create-client.d.ts.map +1 -0
- package/dist/dsl/create-client.js +58 -0
- package/dist/dsl/create-client.js.map +1 -0
- package/dist/dsl/fluent-query-builder.d.ts +439 -0
- package/dist/dsl/fluent-query-builder.d.ts.map +1 -0
- package/dist/dsl/fluent-query-builder.js +534 -0
- package/dist/dsl/fluent-query-builder.js.map +1 -0
- package/dist/dsl/index.d.ts +32 -0
- package/dist/dsl/index.d.ts.map +1 -0
- package/dist/dsl/index.js +31 -0
- package/dist/dsl/index.js.map +1 -0
- package/dist/dsl/pagination.d.ts +82 -0
- package/dist/dsl/pagination.d.ts.map +1 -0
- package/dist/dsl/pagination.js +135 -0
- package/dist/dsl/pagination.js.map +1 -0
- package/dist/dsl/query-builder.d.ts +456 -0
- package/dist/dsl/query-builder.d.ts.map +1 -0
- package/dist/dsl/query-builder.js +994 -0
- package/dist/dsl/query-builder.js.map +1 -0
- package/dist/dsl/response-parser.d.ts +111 -0
- package/dist/dsl/response-parser.d.ts.map +1 -0
- package/dist/dsl/response-parser.js +210 -0
- package/dist/dsl/response-parser.js.map +1 -0
- package/dist/dsl/schema/cache.d.ts +52 -0
- package/dist/dsl/schema/cache.d.ts.map +1 -0
- package/dist/dsl/schema/cache.js +97 -0
- package/dist/dsl/schema/cache.js.map +1 -0
- package/dist/dsl/schema/extract.d.ts +18 -0
- package/dist/dsl/schema/extract.d.ts.map +1 -0
- package/dist/dsl/schema/extract.js +41 -0
- package/dist/dsl/schema/extract.js.map +1 -0
- package/dist/dsl/schema/index.d.ts +13 -0
- package/dist/dsl/schema/index.d.ts.map +1 -0
- package/dist/dsl/schema/index.js +12 -0
- package/dist/dsl/schema/index.js.map +1 -0
- package/dist/dsl/schema/load.d.ts +41 -0
- package/dist/dsl/schema/load.d.ts.map +1 -0
- package/dist/dsl/schema/load.js +119 -0
- package/dist/dsl/schema/load.js.map +1 -0
- package/dist/dsl/schema/store.d.ts +137 -0
- package/dist/dsl/schema/store.d.ts.map +1 -0
- package/dist/dsl/schema/store.js +204 -0
- package/dist/dsl/schema/store.js.map +1 -0
- package/dist/dsl/schema/structured-entities.d.ts +21 -0
- package/dist/dsl/schema/structured-entities.d.ts.map +1 -0
- package/dist/dsl/schema/structured-entities.js +39 -0
- package/dist/dsl/schema/structured-entities.js.map +1 -0
- package/dist/dsl/schema/summary.d.ts +51 -0
- package/dist/dsl/schema/summary.d.ts.map +1 -0
- package/dist/dsl/schema/summary.js +61 -0
- package/dist/dsl/schema/summary.js.map +1 -0
- package/dist/dsl/schema/types.d.ts +36 -0
- package/dist/dsl/schema/types.d.ts.map +1 -0
- package/dist/dsl/schema/types.js +6 -0
- package/dist/dsl/schema/types.js.map +1 -0
- package/dist/dsl/schema/validation.d.ts +21 -0
- package/dist/dsl/schema/validation.d.ts.map +1 -0
- package/dist/dsl/schema/validation.js +44 -0
- package/dist/dsl/schema/validation.js.map +1 -0
- package/dist/dsl/types/buckets.d.ts +18 -0
- package/dist/dsl/types/buckets.d.ts.map +1 -0
- package/dist/dsl/types/buckets.js +6 -0
- package/dist/dsl/types/buckets.js.map +1 -0
- package/dist/dsl/types/common.d.ts +91 -0
- package/dist/dsl/types/common.d.ts.map +1 -0
- package/dist/dsl/types/common.js +6 -0
- package/dist/dsl/types/common.js.map +1 -0
- package/dist/dsl/types/entities.d.ts +35 -0
- package/dist/dsl/types/entities.d.ts.map +1 -0
- package/dist/dsl/types/entities.js +11 -0
- package/dist/dsl/types/entities.js.map +1 -0
- package/dist/dsl/types/index.d.ts +12 -0
- package/dist/dsl/types/index.d.ts.map +1 -0
- package/dist/dsl/types/index.js +7 -0
- package/dist/dsl/types/index.js.map +1 -0
- package/dist/dsl/types/return-clauses.d.ts +107 -0
- package/dist/dsl/types/return-clauses.d.ts.map +1 -0
- package/dist/dsl/types/return-clauses.js +22 -0
- package/dist/dsl/types/return-clauses.js.map +1 -0
- package/dist/dsl/types/special-functions.d.ts +175 -0
- package/dist/dsl/types/special-functions.d.ts.map +1 -0
- package/dist/dsl/types/special-functions.js +25 -0
- package/dist/dsl/types/special-functions.js.map +1 -0
- package/dist/dsl/types/vocabulary.d.ts +21 -0
- package/dist/dsl/types/vocabulary.d.ts.map +1 -0
- package/dist/dsl/types/vocabulary.js +44 -0
- package/dist/dsl/types/vocabulary.js.map +1 -0
- package/dist/dsl/usage-policy.d.ts +87 -0
- package/dist/dsl/usage-policy.d.ts.map +1 -0
- package/dist/dsl/usage-policy.js +133 -0
- package/dist/dsl/usage-policy.js.map +1 -0
- package/dist/dsl/utils/escape.d.ts +24 -0
- package/dist/dsl/utils/escape.d.ts.map +1 -0
- package/dist/dsl/utils/escape.js +124 -0
- package/dist/dsl/utils/escape.js.map +1 -0
- package/dist/dsl/utils/sanitize.d.ts +13 -0
- package/dist/dsl/utils/sanitize.d.ts.map +1 -0
- package/dist/dsl/utils/sanitize.js +19 -0
- package/dist/dsl/utils/sanitize.js.map +1 -0
- package/dist/dsl/utils/string-utils.d.ts +35 -0
- package/dist/dsl/utils/string-utils.d.ts.map +1 -0
- package/dist/dsl/utils/string-utils.js +145 -0
- package/dist/dsl/utils/string-utils.js.map +1 -0
- package/dist/dsl/utils/validate-field-name.d.ts +11 -0
- package/dist/dsl/utils/validate-field-name.d.ts.map +1 -0
- package/dist/dsl/utils/validate-field-name.js +18 -0
- package/dist/dsl/utils/validate-field-name.js.map +1 -0
- package/dist/examples/dsl-examples.d.ts +11 -0
- package/dist/examples/dsl-examples.d.ts.map +1 -0
- package/dist/examples/dsl-examples.js +49 -0
- package/dist/examples/dsl-examples.js.map +1 -0
- package/dist/examples/usage-scenarios.d.ts +22 -0
- package/dist/examples/usage-scenarios.d.ts.map +1 -0
- package/dist/examples/usage-scenarios.js +173 -0
- package/dist/examples/usage-scenarios.js.map +1 -0
- package/dist/funder-org-names.d.ts +12 -0
- package/dist/funder-org-names.d.ts.map +1 -0
- package/dist/funder-org-names.js +30 -0
- package/dist/funder-org-names.js.map +1 -0
- package/dist/http-main.d.ts +7 -0
- package/dist/http-main.d.ts.map +1 -0
- package/dist/http-main.js +36 -0
- package/dist/http-main.js.map +1 -0
- package/dist/http.d.ts +29 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +173 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/kwq/build-query.d.ts +26 -0
- package/dist/kwq/build-query.d.ts.map +1 -0
- package/dist/kwq/build-query.js +37 -0
- package/dist/kwq/build-query.js.map +1 -0
- package/dist/kwq/concept-groups.d.ts +49 -0
- package/dist/kwq/concept-groups.d.ts.map +1 -0
- package/dist/kwq/concept-groups.js +55 -0
- package/dist/kwq/concept-groups.js.map +1 -0
- package/dist/kwq/dsl-assembler.d.ts +28 -0
- package/dist/kwq/dsl-assembler.d.ts.map +1 -0
- package/dist/kwq/dsl-assembler.js +124 -0
- package/dist/kwq/dsl-assembler.js.map +1 -0
- package/dist/kwq/ensemble.d.ts +38 -0
- package/dist/kwq/ensemble.d.ts.map +1 -0
- package/dist/kwq/ensemble.js +107 -0
- package/dist/kwq/ensemble.js.map +1 -0
- package/dist/kwq/index.d.ts +16 -0
- package/dist/kwq/index.d.ts.map +1 -0
- package/dist/kwq/index.js +14 -0
- package/dist/kwq/index.js.map +1 -0
- package/dist/kwq/types.d.ts +120 -0
- package/dist/kwq/types.d.ts.map +1 -0
- package/dist/kwq/types.js +11 -0
- package/dist/kwq/types.js.map +1 -0
- package/dist/lambda.d.ts +10 -0
- package/dist/lambda.d.ts.map +1 -0
- package/dist/lambda.js +4 -0
- package/dist/lambda.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +33 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp/batch-fetch.d.ts +89 -0
- package/dist/mcp/batch-fetch.d.ts.map +1 -0
- package/dist/mcp/batch-fetch.js +178 -0
- package/dist/mcp/batch-fetch.js.map +1 -0
- package/dist/mcp/examples/dsl-examples.d.ts +21 -0
- package/dist/mcp/examples/dsl-examples.d.ts.map +1 -0
- package/dist/mcp/examples/dsl-examples.js +61 -0
- package/dist/mcp/examples/dsl-examples.js.map +1 -0
- package/dist/mcp/examples/usage-scenarios.d.ts +20 -0
- package/dist/mcp/examples/usage-scenarios.d.ts.map +1 -0
- package/dist/mcp/examples/usage-scenarios.js +169 -0
- package/dist/mcp/examples/usage-scenarios.js.map +1 -0
- package/dist/mcp/export-format.d.ts +43 -0
- package/dist/mcp/export-format.d.ts.map +1 -0
- package/dist/mcp/export-format.js +92 -0
- package/dist/mcp/export-format.js.map +1 -0
- package/dist/mcp/funder-org-names.d.ts +12 -0
- package/dist/mcp/funder-org-names.d.ts.map +1 -0
- package/dist/mcp/funder-org-names.js +30 -0
- package/dist/mcp/funder-org-names.js.map +1 -0
- package/dist/mcp/http-server.d.ts +20 -0
- package/dist/mcp/http-server.d.ts.map +1 -0
- package/dist/mcp/http-server.js +118 -0
- package/dist/mcp/http-server.js.map +1 -0
- package/dist/mcp/middleware/field-aliases.d.ts +97 -0
- package/dist/mcp/middleware/field-aliases.d.ts.map +1 -0
- package/dist/mcp/middleware/field-aliases.js +208 -0
- package/dist/mcp/middleware/field-aliases.js.map +1 -0
- package/dist/mcp/resources/schema.d.ts +13 -0
- package/dist/mcp/resources/schema.d.ts.map +1 -0
- package/dist/mcp/resources/schema.js +262 -0
- package/dist/mcp/resources/schema.js.map +1 -0
- package/dist/mcp/schema/context.d.ts +10 -0
- package/dist/mcp/schema/context.d.ts.map +1 -0
- package/dist/mcp/schema/context.js +6 -0
- package/dist/mcp/schema/context.js.map +1 -0
- package/dist/mcp/schema/index.d.ts +8 -0
- package/dist/mcp/schema/index.d.ts.map +1 -0
- package/dist/mcp/schema/index.js +6 -0
- package/dist/mcp/schema/index.js.map +1 -0
- package/dist/mcp/server.d.ts +56 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +168 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/shared-schema.d.ts +13 -0
- package/dist/mcp/shared-schema.d.ts.map +1 -0
- package/dist/mcp/shared-schema.js +28 -0
- package/dist/mcp/shared-schema.js.map +1 -0
- package/dist/mcp/tools/analytics-filters.d.ts +18 -0
- package/dist/mcp/tools/analytics-filters.d.ts.map +1 -0
- package/dist/mcp/tools/analytics-filters.js +35 -0
- package/dist/mcp/tools/analytics-filters.js.map +1 -0
- package/dist/mcp/tools/analytics.d.ts +16 -0
- package/dist/mcp/tools/analytics.d.ts.map +1 -0
- package/dist/mcp/tools/analytics.js +381 -0
- package/dist/mcp/tools/analytics.js.map +1 -0
- package/dist/mcp/tools/concept-profile.d.ts +14 -0
- package/dist/mcp/tools/concept-profile.d.ts.map +1 -0
- package/dist/mcp/tools/concept-profile.js +130 -0
- package/dist/mcp/tools/concept-profile.js.map +1 -0
- package/dist/mcp/tools/dataset-profile.d.ts +15 -0
- package/dist/mcp/tools/dataset-profile.d.ts.map +1 -0
- package/dist/mcp/tools/dataset-profile.js +194 -0
- package/dist/mcp/tools/dataset-profile.js.map +1 -0
- package/dist/mcp/tools/fetch-search-pages.d.ts +15 -0
- package/dist/mcp/tools/fetch-search-pages.d.ts.map +1 -0
- package/dist/mcp/tools/fetch-search-pages.js +237 -0
- package/dist/mcp/tools/fetch-search-pages.js.map +1 -0
- package/dist/mcp/tools/functions.d.ts +14 -0
- package/dist/mcp/tools/functions.d.ts.map +1 -0
- package/dist/mcp/tools/functions.js +87 -0
- package/dist/mcp/tools/functions.js.map +1 -0
- package/dist/mcp/tools/impact-chain.d.ts +15 -0
- package/dist/mcp/tools/impact-chain.d.ts.map +1 -0
- package/dist/mcp/tools/impact-chain.js +96 -0
- package/dist/mcp/tools/impact-chain.js.map +1 -0
- package/dist/mcp/tools/kwq.d.ts +19 -0
- package/dist/mcp/tools/kwq.d.ts.map +1 -0
- package/dist/mcp/tools/kwq.js +156 -0
- package/dist/mcp/tools/kwq.js.map +1 -0
- package/dist/mcp/tools/lookup.d.ts +14 -0
- package/dist/mcp/tools/lookup.d.ts.map +1 -0
- package/dist/mcp/tools/lookup.js +146 -0
- package/dist/mcp/tools/lookup.js.map +1 -0
- package/dist/mcp/tools/policy-profile.d.ts +15 -0
- package/dist/mcp/tools/policy-profile.d.ts.map +1 -0
- package/dist/mcp/tools/policy-profile.js +174 -0
- package/dist/mcp/tools/policy-profile.js.map +1 -0
- package/dist/mcp/tools/profile.d.ts +14 -0
- package/dist/mcp/tools/profile.d.ts.map +1 -0
- package/dist/mcp/tools/profile.js +349 -0
- package/dist/mcp/tools/profile.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +16 -0
- package/dist/mcp/tools/query.d.ts.map +1 -0
- package/dist/mcp/tools/query.js +75 -0
- package/dist/mcp/tools/query.js.map +1 -0
- package/dist/mcp/tools/schema.d.ts +23 -0
- package/dist/mcp/tools/schema.d.ts.map +1 -0
- package/dist/mcp/tools/schema.js +124 -0
- package/dist/mcp/tools/schema.js.map +1 -0
- package/dist/mcp/tools/search-entity-metadata.d.ts +18 -0
- package/dist/mcp/tools/search-entity-metadata.d.ts.map +1 -0
- package/dist/mcp/tools/search-entity-metadata.js +221 -0
- package/dist/mcp/tools/search-entity-metadata.js.map +1 -0
- package/dist/mcp/tools/search-input.d.ts +58 -0
- package/dist/mcp/tools/search-input.d.ts.map +1 -0
- package/dist/mcp/tools/search-input.js +76 -0
- package/dist/mcp/tools/search-input.js.map +1 -0
- package/dist/mcp/tools/search.d.ts +24 -0
- package/dist/mcp/tools/search.d.ts.map +1 -0
- package/dist/mcp/tools/search.js +115 -0
- package/dist/mcp/tools/search.js.map +1 -0
- package/dist/mcp/utils.d.ts +82 -0
- package/dist/mcp/utils.d.ts.map +1 -0
- package/dist/mcp/utils.js +126 -0
- package/dist/mcp/utils.js.map +1 -0
- package/dist/middleware/field-aliases.d.ts +97 -0
- package/dist/middleware/field-aliases.d.ts.map +1 -0
- package/dist/middleware/field-aliases.js +208 -0
- package/dist/middleware/field-aliases.js.map +1 -0
- package/dist/resources/schema.d.ts +13 -0
- package/dist/resources/schema.d.ts.map +1 -0
- package/dist/resources/schema.js +204 -0
- package/dist/resources/schema.js.map +1 -0
- package/dist/schema/context.d.ts +10 -0
- package/dist/schema/context.d.ts.map +1 -0
- package/dist/schema/context.js +6 -0
- package/dist/schema/context.js.map +1 -0
- package/dist/schema/index.d.ts +9 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +6 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/load.d.ts +43 -0
- package/dist/schema/load.d.ts.map +1 -0
- package/dist/schema/load.js +139 -0
- package/dist/schema/load.js.map +1 -0
- package/dist/schema/store.d.ts +112 -0
- package/dist/schema/store.d.ts.map +1 -0
- package/dist/schema/store.js +173 -0
- package/dist/schema/store.js.map +1 -0
- package/dist/schema/structured-entities.d.ts +21 -0
- package/dist/schema/structured-entities.d.ts.map +1 -0
- package/dist/schema/structured-entities.js +39 -0
- package/dist/schema/structured-entities.js.map +1 -0
- package/dist/schema/types.d.ts +36 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/types.js +6 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/server.d.ts +57 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +144 -0
- package/dist/server.js.map +1 -0
- package/dist/telemetry.d.ts +172 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +233 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tools/analytics-filters.d.ts +18 -0
- package/dist/tools/analytics-filters.d.ts.map +1 -0
- package/dist/tools/analytics-filters.js +35 -0
- package/dist/tools/analytics-filters.js.map +1 -0
- package/dist/tools/analytics.d.ts +16 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +381 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/concept-profile.d.ts +14 -0
- package/dist/tools/concept-profile.d.ts.map +1 -0
- package/dist/tools/concept-profile.js +130 -0
- package/dist/tools/concept-profile.js.map +1 -0
- package/dist/tools/dataset-profile.d.ts +15 -0
- package/dist/tools/dataset-profile.d.ts.map +1 -0
- package/dist/tools/dataset-profile.js +194 -0
- package/dist/tools/dataset-profile.js.map +1 -0
- package/dist/tools/functions.d.ts +14 -0
- package/dist/tools/functions.d.ts.map +1 -0
- package/dist/tools/functions.js +294 -0
- package/dist/tools/functions.js.map +1 -0
- package/dist/tools/impact-chain.d.ts +15 -0
- package/dist/tools/impact-chain.d.ts.map +1 -0
- package/dist/tools/impact-chain.js +96 -0
- package/dist/tools/impact-chain.js.map +1 -0
- package/dist/tools/kwq.d.ts +19 -0
- package/dist/tools/kwq.d.ts.map +1 -0
- package/dist/tools/kwq.js +156 -0
- package/dist/tools/kwq.js.map +1 -0
- package/dist/tools/lookup.d.ts +14 -0
- package/dist/tools/lookup.d.ts.map +1 -0
- package/dist/tools/lookup.js +213 -0
- package/dist/tools/lookup.js.map +1 -0
- package/dist/tools/policy-profile.d.ts +15 -0
- package/dist/tools/policy-profile.d.ts.map +1 -0
- package/dist/tools/policy-profile.js +174 -0
- package/dist/tools/policy-profile.js.map +1 -0
- package/dist/tools/profile.d.ts +14 -0
- package/dist/tools/profile.d.ts.map +1 -0
- package/dist/tools/profile.js +349 -0
- package/dist/tools/profile.js.map +1 -0
- package/dist/tools/query.d.ts +16 -0
- package/dist/tools/query.d.ts.map +1 -0
- package/dist/tools/query.js +53 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/tools/schema.d.ts +23 -0
- package/dist/tools/schema.d.ts.map +1 -0
- package/dist/tools/schema.js +124 -0
- package/dist/tools/schema.js.map +1 -0
- package/dist/tools/search-entity-metadata.d.ts +18 -0
- package/dist/tools/search-entity-metadata.d.ts.map +1 -0
- package/dist/tools/search-entity-metadata.js +221 -0
- package/dist/tools/search-entity-metadata.js.map +1 -0
- package/dist/tools/search.d.ts +23 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +110 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/solr-fields.d.ts +39 -0
- package/dist/tools/solr-fields.d.ts.map +1 -0
- package/dist/tools/solr-fields.js +40 -0
- package/dist/tools/solr-fields.js.map +1 -0
- package/dist/utils.d.ts +70 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +104 -0
- package/dist/utils.js.map +1 -0
- package/package.json +41 -0
- package/src/client/auth/config-loaders.ts +81 -0
- package/src/client/auth/decorators/index.ts +7 -0
- package/src/client/auth/decorators/with-caching.ts +237 -0
- package/src/client/auth/factory.ts +34 -0
- package/src/client/auth/index.ts +6 -0
- package/src/client/auth/jwt-utils.ts +36 -0
- package/src/client/auth/node.ts +16 -0
- package/src/client/auth/providers/index.ts +1 -0
- package/src/client/auth/providers/jwt-auth-provider.ts +153 -0
- package/src/client/auth/schemas.ts +25 -0
- package/src/client/auth/types.ts +30 -0
- package/src/client/command.ts +54 -0
- package/src/client/config/index.ts +15 -0
- package/src/client/config/loader.ts +155 -0
- package/src/client/config/node.ts +22 -0
- package/src/client/config/schemas.ts +28 -0
- package/src/client/config/types.ts +39 -0
- package/src/client/config/unified-loader.ts +118 -0
- package/src/client/config.ts +69 -0
- package/src/client/deployment-config.ts +98 -0
- package/src/client/errors.ts +295 -0
- package/src/client/http-client.ts +577 -0
- package/src/client/index.ts +68 -0
- package/src/client/internal-dsl-client.ts +128 -0
- package/src/client/rate-limiter.ts +139 -0
- package/src/client/resolve-api-key-user.ts +99 -0
- package/src/client/types.ts +44 -0
- package/src/dsl/client.ts +538 -0
- package/src/dsl/commands/apply-filters.ts +35 -0
- package/src/dsl/commands/facet/index.ts +12 -0
- package/src/dsl/commands/facet/schemas.ts +101 -0
- package/src/dsl/commands/functions/ClassifyCommand.ts +129 -0
- package/src/dsl/commands/functions/ExtractAffiliationsCommand.ts +163 -0
- package/src/dsl/commands/functions/ExtractConceptsCommand.ts +141 -0
- package/src/dsl/commands/functions/ExtractGrantsCommand.ts +112 -0
- package/src/dsl/commands/functions/index.ts +31 -0
- package/src/dsl/commands/index.ts +29 -0
- package/src/dsl/commands/validate-input.ts +29 -0
- package/src/dsl/create-client.ts +80 -0
- package/src/dsl/fluent-query-builder.ts +684 -0
- package/src/dsl/index.ts +206 -0
- package/src/dsl/pagination.ts +202 -0
- package/src/dsl/query-builder.ts +1120 -0
- package/src/dsl/response-parser.ts +299 -0
- package/src/dsl/schema/cache.ts +124 -0
- package/src/dsl/schema/extract.ts +44 -0
- package/src/dsl/schema/index.ts +50 -0
- package/src/dsl/schema/load.ts +160 -0
- package/src/dsl/schema/store.ts +253 -0
- package/src/dsl/schema/structured-entities.ts +44 -0
- package/src/dsl/schema/summary.ts +94 -0
- package/src/dsl/schema/types.ts +40 -0
- package/src/dsl/schema/validation.ts +56 -0
- package/src/dsl/types/buckets.ts +22 -0
- package/src/dsl/types/common.ts +99 -0
- package/src/dsl/types/entities.ts +43 -0
- package/src/dsl/types/index.ts +63 -0
- package/src/dsl/types/return-clauses.ts +147 -0
- package/src/dsl/types/special-functions.ts +220 -0
- package/src/dsl/types/vocabulary.ts +82 -0
- package/src/dsl/usage-policy.ts +219 -0
- package/src/dsl/utils/escape.ts +123 -0
- package/src/dsl/utils/sanitize.ts +21 -0
- package/src/dsl/utils/string-utils.ts +147 -0
- package/src/dsl/utils/validate-field-name.ts +19 -0
- package/src/http-main.ts +41 -0
- package/src/index.ts +14 -0
- package/src/main.ts +40 -0
- package/src/mcp/batch-fetch.ts +255 -0
- package/src/mcp/examples/dsl-examples.ts +66 -0
- package/src/mcp/examples/usage-scenarios.ts +185 -0
- package/src/mcp/export-format.ts +113 -0
- package/src/mcp/funder-org-names.ts +30 -0
- package/src/mcp/http-server.ts +148 -0
- package/src/mcp/middleware/field-aliases.ts +274 -0
- package/src/mcp/resources/schema.ts +364 -0
- package/src/mcp/schema/context.ts +11 -0
- package/src/mcp/schema/index.ts +38 -0
- package/src/mcp/server.ts +247 -0
- package/src/mcp/shared-schema.ts +34 -0
- package/src/mcp/tools/analytics-filters.ts +46 -0
- package/src/mcp/tools/analytics.ts +453 -0
- package/src/mcp/tools/fetch-search-pages.ts +329 -0
- package/src/mcp/tools/functions.ts +105 -0
- package/src/mcp/tools/lookup.ts +182 -0
- package/src/mcp/tools/query.ts +91 -0
- package/src/mcp/tools/schema.ts +147 -0
- package/src/mcp/tools/search-entity-metadata.ts +253 -0
- package/src/mcp/tools/search-input.ts +87 -0
- package/src/mcp/tools/search.ts +168 -0
- package/src/mcp/utils.ts +199 -0
- package/test/client/auth/config-loaders.test.ts +92 -0
- package/test/client/auth/decorators/with-caching.test.ts +482 -0
- package/test/client/auth/factory.test.ts +68 -0
- package/test/client/auth/providers/jwt-auth-provider.test.ts +398 -0
- package/test/client/auth/types.test.ts +18 -0
- package/test/client/command.test.ts +163 -0
- package/test/client/config/loader.test.ts +377 -0
- package/test/client/config/unified-loader.test.ts +136 -0
- package/test/client/deployment-config.test.ts +69 -0
- package/test/client/errors/index.test.ts +408 -0
- package/test/client/helpers/mock-fetch.ts +42 -0
- package/test/client/http-client.test.ts +1148 -0
- package/test/client/integration/auth-providers.integration.test.ts +186 -0
- package/test/client/internal-dsl-client.test.ts +76 -0
- package/test/client/rate-limiter.test.ts +204 -0
- package/test/client/resolve-api-key-user.test.ts +87 -0
- package/test/dsl/client.special-functions.test.ts +387 -0
- package/test/dsl/client.test.ts +457 -0
- package/test/dsl/commands/apply-filters.test.ts +147 -0
- package/test/dsl/commands/functions/ClassifyCommand.test.ts +170 -0
- package/test/dsl/commands/functions/ExtractAffiliationsCommand.test.ts +306 -0
- package/test/dsl/commands/functions/ExtractConceptsCommand.test.ts +136 -0
- package/test/dsl/commands/functions/ExtractGrantsCommand.test.ts +202 -0
- package/test/dsl/commands/search/filters.test.ts +42 -0
- package/test/dsl/fluent-query-builder.test.ts +865 -0
- package/test/dsl/integration/client.integration.test.ts +294 -0
- package/test/dsl/integration/facet-api.integration.test.ts +276 -0
- package/test/dsl/integration/field-existence.integration.test.ts +148 -0
- package/test/dsl/integration/fluent-api-docs-examples.integration.test.ts +988 -0
- package/test/dsl/integration/fluent-api.integration.test.ts +615 -0
- package/test/dsl/integration/search-helpers.ts +27 -0
- package/test/dsl/integration/special-functions.integration.test.ts +224 -0
- package/test/dsl/integration/test-config.ts +52 -0
- package/test/dsl/pagination.test.ts +86 -0
- package/test/dsl/query-builder.test.ts +1775 -0
- package/test/dsl/response-parser.test.ts +520 -0
- package/test/dsl/schema/cache.test.ts +53 -0
- package/test/dsl/schema/load.test.ts +165 -0
- package/test/dsl/schema/summary.test.ts +61 -0
- package/test/dsl/schema/validation.test.ts +46 -0
- package/test/dsl/time-series.test.ts +135 -0
- package/test/dsl/unnest.test.ts +151 -0
- package/test/dsl/usage-policy.test.ts +100 -0
- package/test/dsl/utils/escape.property.test.ts +109 -0
- package/test/dsl/utils/escape.test.ts +140 -0
- package/test/dsl/utils/validate-field-name.property.test.ts +99 -0
- package/test/dsl/utils/validate-field-name.test.ts +55 -0
- package/test/examples/dsl-examples.test.ts +29 -0
- package/test/examples/usage-scenarios.test.ts +90 -0
- package/test/fixtures/describe-schema.json +4000 -0
- package/test/funder-org-names.test.ts +20 -0
- package/test/helpers/schema-fixture.ts +18 -0
- package/test/helpers/tool-test-harness.ts +114 -0
- package/test/integration/assertions.ts +263 -0
- package/test/integration/env.ts +108 -0
- package/test/integration/harness.ts +307 -0
- package/test/integration/hosted-client.ts +56 -0
- package/test/integration/hosted-mocks.ts +81 -0
- package/test/integration/hosted-run.ts +86 -0
- package/test/integration/hosted.e2e.test.ts +101 -0
- package/test/integration/reporter.ts +100 -0
- package/test/integration/run.ts +74 -0
- package/test/integration/suites/analytics.integration.ts +72 -0
- package/test/integration/suites/functions.integration.ts +37 -0
- package/test/integration/suites/hosted-smoke.integration.ts +38 -0
- package/test/integration/suites/index.ts +22 -0
- package/test/integration/suites/lookup.integration.ts +57 -0
- package/test/integration/suites/query.integration.ts +49 -0
- package/test/integration/suites/resources.integration.ts +68 -0
- package/test/integration/suites/search.integration.ts +80 -0
- package/test/integration/types.ts +92 -0
- package/test/integration/verify-usage-scenarios.ts +162 -0
- package/test/mcp/export-format.test.ts +67 -0
- package/test/mcp/http-server.test.ts +80 -0
- package/test/middleware/field-aliases.test.ts +287 -0
- package/test/resources/schema.test.ts +28 -0
- package/test/schema/describe-contract.test.ts +24 -0
- package/test/schema/store.test.ts +45 -0
- package/test/server.test.ts +170 -0
- package/test/tools/analytics-filters.test.ts +35 -0
- package/test/tools/analytics.test.ts +419 -0
- package/test/tools/fetch-search-pages.test.ts +200 -0
- package/test/tools/functions.test.ts +153 -0
- package/test/tools/lookup.test.ts +296 -0
- package/test/tools/query.test.ts +100 -0
- package/test/tools/schema.test.ts +37 -0
- package/test/tools/search.test.ts +415 -0
- package/test/utils.test.ts +45 -0
- package/tsconfig.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP client for Dimensions API requests.
|
|
3
|
+
* Handles retry logic, timeout, and error mapping.
|
|
4
|
+
* @module core/http-client
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { AuthProvider } from "./auth/types.js";
|
|
8
|
+
import {
|
|
9
|
+
AuthenticationError,
|
|
10
|
+
DimensionsError,
|
|
11
|
+
NetworkError,
|
|
12
|
+
NotFoundError,
|
|
13
|
+
QuerySyntaxError,
|
|
14
|
+
RateLimitError,
|
|
15
|
+
ServerError,
|
|
16
|
+
sanitizeErrorMessage,
|
|
17
|
+
TimeoutError,
|
|
18
|
+
UnprocessableEntityError,
|
|
19
|
+
} from "./errors.js";
|
|
20
|
+
import type { RateLimiter } from "./rate-limiter.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Configuration options for the HTTP client.
|
|
24
|
+
*/
|
|
25
|
+
export interface HttpClientConfig {
|
|
26
|
+
/** Base URL for API requests */
|
|
27
|
+
readonly baseUrl: string;
|
|
28
|
+
/** Authentication provider for generating request headers */
|
|
29
|
+
readonly authProvider: AuthProvider;
|
|
30
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
31
|
+
readonly timeout?: number;
|
|
32
|
+
/** Maximum number of retry attempts (default: 3) */
|
|
33
|
+
readonly maxRetries?: number;
|
|
34
|
+
/** Delay between retries in milliseconds (default: 1000) */
|
|
35
|
+
readonly retryDelay?: number;
|
|
36
|
+
/** Optional rate limiter for client-side request throttling */
|
|
37
|
+
readonly rateLimiter?: RateLimiter;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Base options for all request types.
|
|
42
|
+
*/
|
|
43
|
+
export interface RequestOptions {
|
|
44
|
+
/** Additional headers to include */
|
|
45
|
+
readonly headers?: Record<string, string>;
|
|
46
|
+
/** Request timeout override */
|
|
47
|
+
readonly timeout?: number;
|
|
48
|
+
/** AbortSignal for cancellation */
|
|
49
|
+
readonly signal?: AbortSignal;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Options for GET requests.
|
|
54
|
+
*/
|
|
55
|
+
export interface GetOptions extends RequestOptions {
|
|
56
|
+
/** Query parameters to append to URL */
|
|
57
|
+
readonly params?: Record<string, string | number | boolean | string[] | number[]>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Options for POST requests with JSON body.
|
|
62
|
+
*/
|
|
63
|
+
export interface PostJsonOptions extends RequestOptions {
|
|
64
|
+
/** JSON body (will be serialized) */
|
|
65
|
+
readonly json: unknown;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Options for POST requests with form-urlencoded body.
|
|
70
|
+
*/
|
|
71
|
+
export interface PostFormOptions extends RequestOptions {
|
|
72
|
+
/** Form data (will be URL-encoded) */
|
|
73
|
+
readonly form: Record<string, string>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Generic response structure from Dimensions API.
|
|
78
|
+
*/
|
|
79
|
+
export interface DimensionsResponse {
|
|
80
|
+
/** Statistics about the query result */
|
|
81
|
+
_stats?: {
|
|
82
|
+
total_count: number;
|
|
83
|
+
};
|
|
84
|
+
/** Additional response fields (dynamic based on query) */
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* HTTP client for making requests to the Dimensions API.
|
|
90
|
+
* Implements retry logic with client-side throttling and exponential backoff for transient errors.
|
|
91
|
+
*/
|
|
92
|
+
export class HttpClient {
|
|
93
|
+
private readonly baseUrl: string;
|
|
94
|
+
private readonly authProvider: AuthProvider;
|
|
95
|
+
private readonly timeout: number;
|
|
96
|
+
private readonly maxRetries: number;
|
|
97
|
+
private readonly retryDelay: number;
|
|
98
|
+
private readonly rateLimiter: RateLimiter | undefined;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Creates a new HttpClient instance.
|
|
102
|
+
* @param config - HTTP client configuration
|
|
103
|
+
*/
|
|
104
|
+
constructor(config: HttpClientConfig) {
|
|
105
|
+
this.baseUrl = config.baseUrl;
|
|
106
|
+
this.authProvider = config.authProvider;
|
|
107
|
+
this.timeout = config.timeout ?? 30000;
|
|
108
|
+
this.maxRetries = config.maxRetries ?? 3;
|
|
109
|
+
this.retryDelay = config.retryDelay ?? 1000;
|
|
110
|
+
this.rateLimiter = config.rateLimiter;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Executes a DSL query against the Dimensions API.
|
|
115
|
+
* @param dsl - The DSL query string
|
|
116
|
+
* @param endpoint - API endpoint (default: /api/dsl/v2)
|
|
117
|
+
* @param options - Optional request overrides (timeout, signal)
|
|
118
|
+
* @returns The API response
|
|
119
|
+
* @throws {QuerySyntaxError} If the query syntax is invalid
|
|
120
|
+
* @throws {RateLimitError} If rate limit is exceeded after retries
|
|
121
|
+
* @throws {ServerError} If server error persists after retries
|
|
122
|
+
* @throws {NetworkError} If network error occurs after retries
|
|
123
|
+
* @throws {TimeoutError} If request times out
|
|
124
|
+
* @throws {AuthenticationError} If authentication fails
|
|
125
|
+
*/
|
|
126
|
+
async query(
|
|
127
|
+
dsl: string,
|
|
128
|
+
endpoint: string = "/api/dsl/v2",
|
|
129
|
+
options?: RequestOptions,
|
|
130
|
+
): Promise<DimensionsResponse> {
|
|
131
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
132
|
+
return this.executeWithRetry<DimensionsResponse>(() =>
|
|
133
|
+
this.executeDslRequest(url, dsl, options),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Executes a single DSL request with raw body.
|
|
139
|
+
* @param url - Full request URL
|
|
140
|
+
* @param dsl - DSL query string (sent as raw body)
|
|
141
|
+
* @returns Parsed response
|
|
142
|
+
*/
|
|
143
|
+
private async executeDslRequest(
|
|
144
|
+
url: string,
|
|
145
|
+
dsl: string,
|
|
146
|
+
options?: RequestOptions,
|
|
147
|
+
): Promise<DimensionsResponse> {
|
|
148
|
+
return this.wrapFetch<DimensionsResponse>({
|
|
149
|
+
url,
|
|
150
|
+
method: "POST",
|
|
151
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
152
|
+
body: dsl,
|
|
153
|
+
timeoutMs: options?.timeout ?? this.timeout,
|
|
154
|
+
signal: options?.signal,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Maps HTTP response status to appropriate error type.
|
|
160
|
+
* @param response - HTTP response
|
|
161
|
+
* @returns Appropriate error instance
|
|
162
|
+
*/
|
|
163
|
+
private async mapHttpError(response: Response): Promise<DimensionsError> {
|
|
164
|
+
const status = response.status;
|
|
165
|
+
|
|
166
|
+
switch (status) {
|
|
167
|
+
case 400: {
|
|
168
|
+
let message = "Query syntax error";
|
|
169
|
+
try {
|
|
170
|
+
const body = (await response.json()) as {
|
|
171
|
+
error?: { message?: string };
|
|
172
|
+
};
|
|
173
|
+
if (body.error?.message) {
|
|
174
|
+
message = body.error.message;
|
|
175
|
+
}
|
|
176
|
+
} catch {
|
|
177
|
+
// Ignore JSON parse errors
|
|
178
|
+
}
|
|
179
|
+
return new QuerySyntaxError(message);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
case 401:
|
|
183
|
+
return new AuthenticationError("Authentication failed");
|
|
184
|
+
|
|
185
|
+
case 403:
|
|
186
|
+
return new DimensionsError("Access denied", 403);
|
|
187
|
+
|
|
188
|
+
case 404: {
|
|
189
|
+
let message = "Resource not found";
|
|
190
|
+
try {
|
|
191
|
+
const body = (await response.json()) as {
|
|
192
|
+
error?: { message?: string };
|
|
193
|
+
detail?: string;
|
|
194
|
+
};
|
|
195
|
+
if (body.error?.message) {
|
|
196
|
+
message = body.error.message;
|
|
197
|
+
} else if (body.detail) {
|
|
198
|
+
message = body.detail;
|
|
199
|
+
}
|
|
200
|
+
} catch {
|
|
201
|
+
// Ignore JSON parse errors
|
|
202
|
+
}
|
|
203
|
+
return new NotFoundError(message);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
case 422: {
|
|
207
|
+
let message = "Unprocessable entity";
|
|
208
|
+
let details: Record<string, unknown> | undefined;
|
|
209
|
+
try {
|
|
210
|
+
const body = (await response.json()) as {
|
|
211
|
+
error?: { message?: string };
|
|
212
|
+
detail?: string | Record<string, unknown>;
|
|
213
|
+
};
|
|
214
|
+
if (body.error?.message) {
|
|
215
|
+
message = body.error.message;
|
|
216
|
+
} else if (typeof body.detail === "string") {
|
|
217
|
+
message = body.detail;
|
|
218
|
+
} else if (body.detail) {
|
|
219
|
+
details = body.detail;
|
|
220
|
+
}
|
|
221
|
+
} catch {
|
|
222
|
+
// Ignore JSON parse errors
|
|
223
|
+
}
|
|
224
|
+
return new UnprocessableEntityError(message, details);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
case 429: {
|
|
228
|
+
const retryAfterMs = this.rateLimiter?.getRetryDelayMs() ?? 2000;
|
|
229
|
+
const clientRateLimit = {
|
|
230
|
+
remaining: this.rateLimiter?.getRemainingRequests() ?? 0,
|
|
231
|
+
retryAfterMs,
|
|
232
|
+
};
|
|
233
|
+
return new RateLimitError(
|
|
234
|
+
"Rate limit exceeded — wait before retrying",
|
|
235
|
+
Math.ceil(retryAfterMs / 1000),
|
|
236
|
+
clientRateLimit,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
default:
|
|
241
|
+
if (status >= 500) {
|
|
242
|
+
return new ServerError(`Server error: ${response.statusText}`, status);
|
|
243
|
+
}
|
|
244
|
+
return new DimensionsError(`HTTP error: ${status} ${response.statusText}`, status);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Executes a fetch request with timeout management and unified error mapping.
|
|
250
|
+
* @param options - Request configuration
|
|
251
|
+
* @returns Parsed JSON response
|
|
252
|
+
* @throws {TimeoutError} If the request times out or the external signal fires
|
|
253
|
+
* @throws {NetworkError} If a network-level error occurs
|
|
254
|
+
* @throws {DimensionsError} If the HTTP response indicates an error
|
|
255
|
+
*/
|
|
256
|
+
private async wrapFetch<T>(options: {
|
|
257
|
+
readonly url: string;
|
|
258
|
+
readonly method: string;
|
|
259
|
+
readonly headers?: Record<string, string>;
|
|
260
|
+
readonly body?: string;
|
|
261
|
+
readonly timeoutMs: number;
|
|
262
|
+
readonly signal?: AbortSignal;
|
|
263
|
+
}): Promise<T> {
|
|
264
|
+
const controller = new AbortController();
|
|
265
|
+
const timeoutId = setTimeout(() => controller.abort(), options.timeoutMs);
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
const authHeaders = await this.authProvider.getHeaders();
|
|
269
|
+
|
|
270
|
+
const response = await fetch(options.url, {
|
|
271
|
+
method: options.method,
|
|
272
|
+
headers: { ...authHeaders, ...options.headers },
|
|
273
|
+
body: options.body,
|
|
274
|
+
signal:
|
|
275
|
+
options.signal != null
|
|
276
|
+
? AbortSignal.any([options.signal, controller.signal])
|
|
277
|
+
: controller.signal,
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
if (!response.ok) {
|
|
281
|
+
throw await this.mapHttpError(response);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return (await response.json()) as T;
|
|
285
|
+
} catch (error) {
|
|
286
|
+
if (error instanceof DimensionsError) {
|
|
287
|
+
throw error;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (error instanceof Error) {
|
|
291
|
+
if (error.name === "AbortError") {
|
|
292
|
+
throw new TimeoutError("Request timeout");
|
|
293
|
+
}
|
|
294
|
+
throw new NetworkError(`Network error: ${sanitizeErrorMessage(error)}`);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
throw new NetworkError("Unknown network error");
|
|
298
|
+
} finally {
|
|
299
|
+
clearTimeout(timeoutId);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Determines if an error is retryable.
|
|
305
|
+
* @param error - Error to check
|
|
306
|
+
* @returns True if the error should be retried
|
|
307
|
+
*/
|
|
308
|
+
private isRetryable(error: unknown): boolean {
|
|
309
|
+
// Retry rate limit errors
|
|
310
|
+
if (error instanceof RateLimitError) {
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Retry server errors (5xx)
|
|
315
|
+
if (error instanceof ServerError) {
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Retry network errors
|
|
320
|
+
if (error instanceof NetworkError) {
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Retry timeout errors
|
|
325
|
+
if (error instanceof TimeoutError) {
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Don't retry other errors (400, 401, 403, etc.)
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Delays execution for the specified time.
|
|
335
|
+
* @param ms - Delay in milliseconds
|
|
336
|
+
*/
|
|
337
|
+
private delay(ms: number): Promise<void> {
|
|
338
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Sends a GET request with optional query parameters.
|
|
343
|
+
* @param path - URL path (appended to baseUrl)
|
|
344
|
+
* @param options - Request options including params
|
|
345
|
+
* @returns Parsed JSON response
|
|
346
|
+
*/
|
|
347
|
+
async get<T = unknown>(path: string, options?: GetOptions): Promise<T> {
|
|
348
|
+
const url = this.buildUrl(path, options?.params);
|
|
349
|
+
return this.executeWithRetry<T>(() => this.executeGetRequest(url, options));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Builds URL with query parameters.
|
|
354
|
+
* @param path - URL path
|
|
355
|
+
* @param params - Query parameters
|
|
356
|
+
* @returns Full URL with query string
|
|
357
|
+
*/
|
|
358
|
+
private buildUrl(
|
|
359
|
+
path: string,
|
|
360
|
+
params?: Record<string, string | number | boolean | string[] | number[]>,
|
|
361
|
+
): string {
|
|
362
|
+
const url = `${this.baseUrl}${path}`;
|
|
363
|
+
if (!params || Object.keys(params).length === 0) {
|
|
364
|
+
return url;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const searchParams = new URLSearchParams();
|
|
368
|
+
for (const [key, value] of Object.entries(params)) {
|
|
369
|
+
if (Array.isArray(value)) {
|
|
370
|
+
for (const item of value) {
|
|
371
|
+
searchParams.append(key, String(item));
|
|
372
|
+
}
|
|
373
|
+
} else {
|
|
374
|
+
searchParams.append(key, String(value));
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return `${url}?${searchParams.toString()}`;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Executes a single GET request.
|
|
383
|
+
* @param url - Full request URL
|
|
384
|
+
* @param options - Request options
|
|
385
|
+
* @returns Parsed response
|
|
386
|
+
*/
|
|
387
|
+
private async executeGetRequest<T>(url: string, options?: RequestOptions): Promise<T> {
|
|
388
|
+
return this.wrapFetch<T>({
|
|
389
|
+
url,
|
|
390
|
+
method: "GET",
|
|
391
|
+
headers: options?.headers,
|
|
392
|
+
timeoutMs: options?.timeout ?? this.timeout,
|
|
393
|
+
signal: options?.signal,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Calculates the delay before the next retry attempt.
|
|
399
|
+
* For rate-limit errors, uses the client rate limiter's slot timing.
|
|
400
|
+
* For other transient errors, uses exponential backoff with jitter.
|
|
401
|
+
* The result is capped at 60 seconds.
|
|
402
|
+
* @param error - The error that triggered the retry
|
|
403
|
+
* @param attempt - The current attempt number (0-based)
|
|
404
|
+
* @returns Delay in milliseconds
|
|
405
|
+
*/
|
|
406
|
+
private calculateRetryDelay(error: unknown, attempt: number): number {
|
|
407
|
+
const MAX_DELAY = 60_000;
|
|
408
|
+
|
|
409
|
+
if (error instanceof RateLimitError) {
|
|
410
|
+
const delay =
|
|
411
|
+
error.clientRateLimit?.retryAfterMs ??
|
|
412
|
+
this.rateLimiter?.getRetryDelayMs() ??
|
|
413
|
+
2000 * 2 ** attempt;
|
|
414
|
+
return Math.min(delay, MAX_DELAY);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const backoff = this.retryDelay * 2 ** attempt * (0.5 + Math.random() * 0.5);
|
|
418
|
+
return Math.min(backoff, MAX_DELAY);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Executes a request with retry logic.
|
|
423
|
+
* Uses client-side throttling before each attempt and exponential backoff for transient errors.
|
|
424
|
+
* @param requestFn - Function that executes the request
|
|
425
|
+
* @returns Response from successful request
|
|
426
|
+
*/
|
|
427
|
+
private async executeWithRetry<T>(requestFn: () => Promise<T>): Promise<T> {
|
|
428
|
+
let lastError: Error | null = null;
|
|
429
|
+
|
|
430
|
+
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
431
|
+
await this.rateLimiter?.waitIfNeeded();
|
|
432
|
+
try {
|
|
433
|
+
const result = await requestFn();
|
|
434
|
+
this.rateLimiter?.recordRequest();
|
|
435
|
+
return result;
|
|
436
|
+
} catch (error) {
|
|
437
|
+
lastError = error as Error;
|
|
438
|
+
|
|
439
|
+
if (!this.isRetryable(error)) {
|
|
440
|
+
throw error;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (attempt >= this.maxRetries) {
|
|
444
|
+
throw error;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const retryDelay = this.calculateRetryDelay(error, attempt);
|
|
448
|
+
await this.delay(retryDelay);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
throw lastError ?? new NetworkError("Unknown error occurred");
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Sends a POST request with JSON body.
|
|
457
|
+
* @param path - URL path (appended to baseUrl)
|
|
458
|
+
* @param options - Request options with JSON body
|
|
459
|
+
* @returns Parsed JSON response
|
|
460
|
+
*/
|
|
461
|
+
async postJson<T = unknown>(path: string, options: PostJsonOptions): Promise<T> {
|
|
462
|
+
const url = `${this.baseUrl}${path}`;
|
|
463
|
+
return this.executeWithRetry<T>(() => this.executePostJsonRequest(url, options));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Executes a single POST JSON request.
|
|
468
|
+
* @param url - Full request URL
|
|
469
|
+
* @param options - Request options with JSON body
|
|
470
|
+
* @returns Parsed response
|
|
471
|
+
*/
|
|
472
|
+
private async executePostJsonRequest<T>(url: string, options: PostJsonOptions): Promise<T> {
|
|
473
|
+
return this.wrapFetch<T>({
|
|
474
|
+
url,
|
|
475
|
+
method: "POST",
|
|
476
|
+
headers: { "Content-Type": "application/json", ...options.headers },
|
|
477
|
+
body: JSON.stringify(options.json),
|
|
478
|
+
timeoutMs: options.timeout ?? this.timeout,
|
|
479
|
+
signal: options.signal,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Sends a POST request with JSON body and returns the raw `Response`.
|
|
485
|
+
* The caller owns the response body and must consume or close it.
|
|
486
|
+
* Auth, timeout, retry, and error-status handling are applied identically
|
|
487
|
+
* to {@link postJson}, but the body is **not** read or parsed.
|
|
488
|
+
* @param path - URL path (appended to baseUrl)
|
|
489
|
+
* @param options - Request options with JSON body
|
|
490
|
+
* @returns The raw fetch Response (body unconsumed)
|
|
491
|
+
*/
|
|
492
|
+
async postJsonRaw(path: string, options: PostJsonOptions): Promise<Response> {
|
|
493
|
+
const url = `${this.baseUrl}${path}`;
|
|
494
|
+
return this.executeWithRetry<Response>(() => this.executePostJsonRawRequest(url, options));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Executes a single POST JSON request and returns the raw Response.
|
|
499
|
+
* @param url - Full request URL
|
|
500
|
+
* @param options - Request options with JSON body
|
|
501
|
+
* @returns Raw Response with unconsumed body
|
|
502
|
+
*/
|
|
503
|
+
private async executePostJsonRawRequest(
|
|
504
|
+
url: string,
|
|
505
|
+
options: PostJsonOptions,
|
|
506
|
+
): Promise<Response> {
|
|
507
|
+
const controller = new AbortController();
|
|
508
|
+
const timeoutMs = options.timeout ?? this.timeout;
|
|
509
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
510
|
+
|
|
511
|
+
try {
|
|
512
|
+
const authHeaders = await this.authProvider.getHeaders();
|
|
513
|
+
|
|
514
|
+
const response = await fetch(url, {
|
|
515
|
+
method: "POST",
|
|
516
|
+
headers: { "Content-Type": "application/json", ...authHeaders, ...options.headers },
|
|
517
|
+
body: JSON.stringify(options.json),
|
|
518
|
+
signal:
|
|
519
|
+
options.signal != null
|
|
520
|
+
? AbortSignal.any([options.signal, controller.signal])
|
|
521
|
+
: controller.signal,
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
if (!response.ok) {
|
|
525
|
+
throw await this.mapHttpError(response);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// Clear timeout only for the request phase — the caller is responsible
|
|
529
|
+
// for consuming the body within a reasonable timeframe.
|
|
530
|
+
clearTimeout(timeoutId);
|
|
531
|
+
return response;
|
|
532
|
+
} catch (error) {
|
|
533
|
+
clearTimeout(timeoutId);
|
|
534
|
+
|
|
535
|
+
if (error instanceof DimensionsError) {
|
|
536
|
+
throw error;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (error instanceof Error) {
|
|
540
|
+
if (error.name === "AbortError") {
|
|
541
|
+
throw new TimeoutError("Request timeout");
|
|
542
|
+
}
|
|
543
|
+
throw new NetworkError(`Network error: ${sanitizeErrorMessage(error)}`);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
throw new NetworkError("Unknown network error");
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Sends a POST request with form-urlencoded body.
|
|
552
|
+
* @param path - URL path (appended to baseUrl)
|
|
553
|
+
* @param options - Request options with form data
|
|
554
|
+
* @returns Parsed JSON response
|
|
555
|
+
*/
|
|
556
|
+
async postForm<T = unknown>(path: string, options: PostFormOptions): Promise<T> {
|
|
557
|
+
const url = `${this.baseUrl}${path}`;
|
|
558
|
+
return this.executeWithRetry<T>(() => this.executePostFormRequest(url, options));
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Executes a single POST form-urlencoded request.
|
|
563
|
+
* @param url - Full request URL
|
|
564
|
+
* @param options - Request options with form data
|
|
565
|
+
* @returns Parsed response
|
|
566
|
+
*/
|
|
567
|
+
private async executePostFormRequest<T>(url: string, options: PostFormOptions): Promise<T> {
|
|
568
|
+
return this.wrapFetch<T>({
|
|
569
|
+
url,
|
|
570
|
+
method: "POST",
|
|
571
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded", ...options.headers },
|
|
572
|
+
body: new URLSearchParams(options.form).toString(),
|
|
573
|
+
timeoutMs: options.timeout ?? this.timeout,
|
|
574
|
+
signal: options.signal,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP client, authentication, and shared infrastructure for the Dimensions API.
|
|
3
|
+
* @module client
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type { CachingOptions } from "./auth/decorators/index.js";
|
|
7
|
+
export { withCaching } from "./auth/decorators/index.js";
|
|
8
|
+
export { createAuthProvider } from "./auth/factory.js";
|
|
9
|
+
export { JwtAuthProvider } from "./auth/providers/jwt-auth-provider.js";
|
|
10
|
+
export { AuthResponseSchema } from "./auth/schemas.js";
|
|
11
|
+
export type { AuthConfig, AuthProvider, JwtAuthConfig } from "./auth/types.js";
|
|
12
|
+
export type { CommandInput, CommandOutput } from "./command.js";
|
|
13
|
+
export { Command } from "./command.js";
|
|
14
|
+
export type {
|
|
15
|
+
ConfigLoaderOptions,
|
|
16
|
+
ConfigResult,
|
|
17
|
+
DslConfig,
|
|
18
|
+
RawConfigFile,
|
|
19
|
+
} from "./config/index.js";
|
|
20
|
+
export { DslConfigSchema, RawConfigFileSchema } from "./config/index.js";
|
|
21
|
+
export type { DimensionsClientConfig, ResolvedDimensionsClientConfig } from "./config.js";
|
|
22
|
+
export { DimensionsClientConfigSchema } from "./config.js";
|
|
23
|
+
export type {
|
|
24
|
+
AppDeploymentConfig,
|
|
25
|
+
DeploymentMode,
|
|
26
|
+
HostedEnvConfig,
|
|
27
|
+
InternalDslEnvConfig,
|
|
28
|
+
} from "./deployment-config.js";
|
|
29
|
+
export {
|
|
30
|
+
hostedBootstrapUser,
|
|
31
|
+
InternalDslEnvSchema,
|
|
32
|
+
loadDeploymentConfig,
|
|
33
|
+
} from "./deployment-config.js";
|
|
34
|
+
export type { ClientRateLimitInfo } from "./errors.js";
|
|
35
|
+
export {
|
|
36
|
+
AuthenticationError,
|
|
37
|
+
DimensionsError,
|
|
38
|
+
isDimensionsError,
|
|
39
|
+
isNotFoundError,
|
|
40
|
+
isUnprocessableEntityError,
|
|
41
|
+
NetworkError,
|
|
42
|
+
NotFoundError,
|
|
43
|
+
QuerySyntaxError,
|
|
44
|
+
RateLimitError,
|
|
45
|
+
ServerError,
|
|
46
|
+
sanitizeErrorMessage,
|
|
47
|
+
TimeoutError,
|
|
48
|
+
UnprocessableEntityError,
|
|
49
|
+
ValidationError,
|
|
50
|
+
} from "./errors.js";
|
|
51
|
+
export type {
|
|
52
|
+
DimensionsResponse,
|
|
53
|
+
GetOptions,
|
|
54
|
+
HttpClientConfig,
|
|
55
|
+
PostFormOptions,
|
|
56
|
+
PostJsonOptions,
|
|
57
|
+
RequestOptions,
|
|
58
|
+
} from "./http-client.js";
|
|
59
|
+
export { HttpClient } from "./http-client.js";
|
|
60
|
+
export { InternalDslClient } from "./internal-dsl-client.js";
|
|
61
|
+
export type { RateLimiterConfig } from "./rate-limiter.js";
|
|
62
|
+
export { RateLimiter } from "./rate-limiter.js";
|
|
63
|
+
export {
|
|
64
|
+
JWT_API_KEY_SUB_PREFIX,
|
|
65
|
+
parseBearerToken,
|
|
66
|
+
resolveUserFromApiKey,
|
|
67
|
+
} from "./resolve-api-key-user.js";
|
|
68
|
+
export type { DslResponse, QueryExecutor, QueryExecutorOptions } from "./types.js";
|