cribl-control-plane 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/README.md +30 -0
- package/.devcontainer/devcontainer.json +45 -0
- package/FUNCTIONS.md +87 -0
- package/README.md +452 -0
- package/RUNTIMES.md +48 -0
- package/bin/mcp-server.js +36958 -0
- package/bin/mcp-server.js.map +266 -0
- package/dist/commonjs/__tests__/assertions.d.ts +2 -0
- package/dist/commonjs/__tests__/assertions.d.ts.map +1 -0
- package/dist/commonjs/__tests__/assertions.js +14 -0
- package/dist/commonjs/__tests__/assertions.js.map +1 -0
- package/dist/commonjs/__tests__/diag.test.d.ts +2 -0
- package/dist/commonjs/__tests__/diag.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/diag.test.js +22 -0
- package/dist/commonjs/__tests__/diag.test.js.map +1 -0
- package/dist/commonjs/__tests__/files.d.ts +6 -0
- package/dist/commonjs/__tests__/files.d.ts.map +1 -0
- package/dist/commonjs/__tests__/files.js +51 -0
- package/dist/commonjs/__tests__/files.js.map +1 -0
- package/dist/commonjs/__tests__/testclient.d.ts +3 -0
- package/dist/commonjs/__tests__/testclient.d.ts.map +1 -0
- package/dist/commonjs/__tests__/testclient.js +38 -0
- package/dist/commonjs/__tests__/testclient.js.map +1 -0
- package/dist/commonjs/core.d.ts +10 -0
- package/dist/commonjs/core.d.ts.map +1 -0
- package/dist/commonjs/core.js +17 -0
- package/dist/commonjs/core.js.map +1 -0
- package/dist/commonjs/funcs/diagGetHealthInfo.d.ts +15 -0
- package/dist/commonjs/funcs/diagGetHealthInfo.d.ts.map +1 -0
- package/dist/commonjs/funcs/diagGetHealthInfo.js +100 -0
- package/dist/commonjs/funcs/diagGetHealthInfo.js.map +1 -0
- package/dist/commonjs/hooks/hooks.d.ts +25 -0
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
- package/dist/commonjs/hooks/hooks.js +86 -0
- package/dist/commonjs/hooks/hooks.js.map +1 -0
- package/dist/commonjs/hooks/index.d.ts +3 -0
- package/dist/commonjs/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/hooks/index.js +22 -0
- package/dist/commonjs/hooks/index.js.map +1 -0
- package/dist/commonjs/hooks/registration.d.ts +3 -0
- package/dist/commonjs/hooks/registration.d.ts.map +1 -0
- package/dist/commonjs/hooks/registration.js +15 -0
- package/dist/commonjs/hooks/registration.js.map +1 -0
- package/dist/commonjs/hooks/types.d.ts +76 -0
- package/dist/commonjs/hooks/types.d.ts.map +1 -0
- package/dist/commonjs/hooks/types.js +6 -0
- package/dist/commonjs/hooks/types.js.map +1 -0
- package/dist/commonjs/index.d.ts +6 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +48 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/lib/base64.d.ts +10 -0
- package/dist/commonjs/lib/base64.d.ts.map +1 -0
- package/dist/commonjs/lib/base64.js +71 -0
- package/dist/commonjs/lib/base64.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +38 -0
- package/dist/commonjs/lib/config.d.ts.map +1 -0
- package/dist/commonjs/lib/config.js +35 -0
- package/dist/commonjs/lib/config.js.map +1 -0
- package/dist/commonjs/lib/dlv.d.ts +14 -0
- package/dist/commonjs/lib/dlv.d.ts.map +1 -0
- package/dist/commonjs/lib/dlv.js +49 -0
- package/dist/commonjs/lib/dlv.js.map +1 -0
- package/dist/commonjs/lib/encodings.d.ts +52 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -0
- package/dist/commonjs/lib/encodings.js +368 -0
- package/dist/commonjs/lib/encodings.js.map +1 -0
- package/dist/commonjs/lib/env.d.ts +15 -0
- package/dist/commonjs/lib/env.d.ts.map +1 -0
- package/dist/commonjs/lib/env.js +65 -0
- package/dist/commonjs/lib/env.js.map +1 -0
- package/dist/commonjs/lib/files.d.ts +13 -0
- package/dist/commonjs/lib/files.d.ts.map +1 -0
- package/dist/commonjs/lib/files.js +77 -0
- package/dist/commonjs/lib/files.js.map +1 -0
- package/dist/commonjs/lib/http.d.ts +67 -0
- package/dist/commonjs/lib/http.d.ts.map +1 -0
- package/dist/commonjs/lib/http.js +217 -0
- package/dist/commonjs/lib/http.js.map +1 -0
- package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
- package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
- package/dist/commonjs/lib/is-plain-object.js +41 -0
- package/dist/commonjs/lib/is-plain-object.js.map +1 -0
- package/dist/commonjs/lib/logger.d.ts +6 -0
- package/dist/commonjs/lib/logger.d.ts.map +1 -0
- package/dist/commonjs/lib/logger.js +6 -0
- package/dist/commonjs/lib/logger.js.map +1 -0
- package/dist/commonjs/lib/matchers.d.ts +59 -0
- package/dist/commonjs/lib/matchers.d.ts.map +1 -0
- package/dist/commonjs/lib/matchers.js +222 -0
- package/dist/commonjs/lib/matchers.js.map +1 -0
- package/dist/commonjs/lib/primitives.d.ts +26 -0
- package/dist/commonjs/lib/primitives.d.ts.map +1 -0
- package/dist/commonjs/lib/primitives.js +111 -0
- package/dist/commonjs/lib/primitives.js.map +1 -0
- package/dist/commonjs/lib/retries.d.ts +38 -0
- package/dist/commonjs/lib/retries.d.ts.map +1 -0
- package/dist/commonjs/lib/retries.js +153 -0
- package/dist/commonjs/lib/retries.js.map +1 -0
- package/dist/commonjs/lib/schemas.d.ts +19 -0
- package/dist/commonjs/lib/schemas.d.ts.map +1 -0
- package/dist/commonjs/lib/schemas.js +62 -0
- package/dist/commonjs/lib/schemas.js.map +1 -0
- package/dist/commonjs/lib/sdks.d.ts +63 -0
- package/dist/commonjs/lib/sdks.d.ts.map +1 -0
- package/dist/commonjs/lib/sdks.js +273 -0
- package/dist/commonjs/lib/sdks.js.map +1 -0
- package/dist/commonjs/lib/security.d.ts +83 -0
- package/dist/commonjs/lib/security.d.ts.map +1 -0
- package/dist/commonjs/lib/security.js +144 -0
- package/dist/commonjs/lib/security.js.map +1 -0
- package/dist/commonjs/lib/url.d.ts +5 -0
- package/dist/commonjs/lib/url.d.ts.map +1 -0
- package/dist/commonjs/lib/url.js +25 -0
- package/dist/commonjs/lib/url.js.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/command.d.ts +2 -0
- package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/command.js +126 -0
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +16 -0
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/impl.js +102 -0
- package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -0
- package/dist/commonjs/mcp-server/cli.d.ts +6 -0
- package/dist/commonjs/mcp-server/cli.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli.js +10 -0
- package/dist/commonjs/mcp-server/cli.js.map +1 -0
- package/dist/commonjs/mcp-server/console-logger.d.ts +7 -0
- package/dist/commonjs/mcp-server/console-logger.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/console-logger.js +59 -0
- package/dist/commonjs/mcp-server/console-logger.js.map +1 -0
- package/dist/commonjs/mcp-server/extensions.d.ts +11 -0
- package/dist/commonjs/mcp-server/extensions.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/extensions.js +6 -0
- package/dist/commonjs/mcp-server/extensions.js.map +1 -0
- package/dist/commonjs/mcp-server/mcp-server.d.ts +2 -0
- package/dist/commonjs/mcp-server/mcp-server.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/mcp-server.js +29 -0
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -0
- package/dist/commonjs/mcp-server/prompts.d.ts +26 -0
- package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/prompts.js +51 -0
- package/dist/commonjs/mcp-server/prompts.js.map +1 -0
- package/dist/commonjs/mcp-server/resources.d.ts +32 -0
- package/dist/commonjs/mcp-server/resources.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/resources.js +87 -0
- package/dist/commonjs/mcp-server/resources.js.map +1 -0
- package/dist/commonjs/mcp-server/scopes.d.ts +3 -0
- package/dist/commonjs/mcp-server/scopes.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/scopes.js +8 -0
- package/dist/commonjs/mcp-server/scopes.js.map +1 -0
- package/dist/commonjs/mcp-server/server.d.ts +13 -0
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/server.js +34 -0
- package/dist/commonjs/mcp-server/server.js.map +1 -0
- package/dist/commonjs/mcp-server/shared.d.ts +7 -0
- package/dist/commonjs/mcp-server/shared.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/shared.js +98 -0
- package/dist/commonjs/mcp-server/shared.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.d.ts +3 -0
- package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.js +24 -0
- package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.js.map +1 -0
- package/dist/commonjs/mcp-server/tools.d.ts +25 -0
- package/dist/commonjs/mcp-server/tools.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools.js +82 -0
- package/dist/commonjs/mcp-server/tools.js.map +1 -0
- package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.d.ts +10 -0
- package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.js +34 -0
- package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.js.map +1 -0
- package/dist/commonjs/models/errors/criblcontrolplaneerror.d.ts +19 -0
- package/dist/commonjs/models/errors/criblcontrolplaneerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/criblcontrolplaneerror.js +20 -0
- package/dist/commonjs/models/errors/criblcontrolplaneerror.js.map +1 -0
- package/dist/commonjs/models/errors/healthstatuserror.d.ts +43 -0
- package/dist/commonjs/models/errors/healthstatuserror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/healthstatuserror.js +93 -0
- package/dist/commonjs/models/errors/healthstatuserror.js.map +1 -0
- package/dist/commonjs/models/errors/httpclienterrors.d.ts +44 -0
- package/dist/commonjs/models/errors/httpclienterrors.d.ts.map +1 -0
- package/dist/commonjs/models/errors/httpclienterrors.js +78 -0
- package/dist/commonjs/models/errors/httpclienterrors.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +6 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -0
- package/dist/commonjs/models/errors/index.js +25 -0
- package/dist/commonjs/models/errors/index.js.map +1 -0
- package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
- package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
- package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +21 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.js +129 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -0
- package/dist/commonjs/models/healthstatus.d.ts +87 -0
- package/dist/commonjs/models/healthstatus.d.ts.map +1 -0
- package/dist/commonjs/models/healthstatus.js +113 -0
- package/dist/commonjs/models/healthstatus.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +3 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +22 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/security.d.ts +29 -0
- package/dist/commonjs/models/security.d.ts.map +1 -0
- package/dist/commonjs/models/security.js +69 -0
- package/dist/commonjs/models/security.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/sdk/diag.d.ts +9 -0
- package/dist/commonjs/sdk/diag.d.ts.map +1 -0
- package/dist/commonjs/sdk/diag.js +19 -0
- package/dist/commonjs/sdk/diag.js.map +1 -0
- package/dist/commonjs/sdk/health.d.ts +9 -0
- package/dist/commonjs/sdk/health.d.ts.map +1 -0
- package/dist/commonjs/sdk/health.js +19 -0
- package/dist/commonjs/sdk/health.js.map +1 -0
- package/dist/commonjs/sdk/index.d.ts +2 -0
- package/dist/commonjs/sdk/index.d.ts.map +1 -0
- package/dist/commonjs/sdk/index.js +21 -0
- package/dist/commonjs/sdk/index.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +10 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
- package/dist/commonjs/sdk/sdk.js +19 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -0
- package/dist/commonjs/types/async.d.ts +23 -0
- package/dist/commonjs/types/async.d.ts.map +1 -0
- package/dist/commonjs/types/async.js +44 -0
- package/dist/commonjs/types/async.js.map +1 -0
- package/dist/commonjs/types/blobs.d.ts +4 -0
- package/dist/commonjs/types/blobs.d.ts.map +1 -0
- package/dist/commonjs/types/blobs.js +62 -0
- package/dist/commonjs/types/blobs.js.map +1 -0
- package/dist/commonjs/types/constdatetime.d.ts +3 -0
- package/dist/commonjs/types/constdatetime.d.ts.map +1 -0
- package/dist/commonjs/types/constdatetime.js +46 -0
- package/dist/commonjs/types/constdatetime.js.map +1 -0
- package/dist/commonjs/types/enums.d.ts +12 -0
- package/dist/commonjs/types/enums.d.ts.map +1 -0
- package/dist/commonjs/types/enums.js +10 -0
- package/dist/commonjs/types/enums.js.map +1 -0
- package/dist/commonjs/types/fp.d.ts +31 -0
- package/dist/commonjs/types/fp.d.ts.map +1 -0
- package/dist/commonjs/types/fp.js +37 -0
- package/dist/commonjs/types/fp.js.map +1 -0
- package/dist/commonjs/types/index.d.ts +8 -0
- package/dist/commonjs/types/index.d.ts.map +1 -0
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/index.js.map +1 -0
- package/dist/commonjs/types/operations.d.ts +27 -0
- package/dist/commonjs/types/operations.d.ts.map +1 -0
- package/dist/commonjs/types/operations.js +83 -0
- package/dist/commonjs/types/operations.js.map +1 -0
- package/dist/commonjs/types/rfcdate.d.ts +21 -0
- package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
- package/dist/commonjs/types/rfcdate.js +46 -0
- package/dist/commonjs/types/rfcdate.js.map +1 -0
- package/dist/commonjs/types/streams.d.ts +2 -0
- package/dist/commonjs/types/streams.d.ts.map +1 -0
- package/dist/commonjs/types/streams.js +18 -0
- package/dist/commonjs/types/streams.js.map +1 -0
- package/dist/esm/__tests__/assertions.d.ts +2 -0
- package/dist/esm/__tests__/assertions.d.ts.map +1 -0
- package/dist/esm/__tests__/assertions.js +11 -0
- package/dist/esm/__tests__/assertions.js.map +1 -0
- package/dist/esm/__tests__/diag.test.d.ts +2 -0
- package/dist/esm/__tests__/diag.test.d.ts.map +1 -0
- package/dist/esm/__tests__/diag.test.js +20 -0
- package/dist/esm/__tests__/diag.test.js.map +1 -0
- package/dist/esm/__tests__/files.d.ts +6 -0
- package/dist/esm/__tests__/files.d.ts.map +1 -0
- package/dist/esm/__tests__/files.js +44 -0
- package/dist/esm/__tests__/files.js.map +1 -0
- package/dist/esm/__tests__/testclient.d.ts +3 -0
- package/dist/esm/__tests__/testclient.d.ts.map +1 -0
- package/dist/esm/__tests__/testclient.js +35 -0
- package/dist/esm/__tests__/testclient.js.map +1 -0
- package/dist/esm/core.d.ts +10 -0
- package/dist/esm/core.d.ts.map +1 -0
- package/dist/esm/core.js +13 -0
- package/dist/esm/core.js.map +1 -0
- package/dist/esm/funcs/diagGetHealthInfo.d.ts +15 -0
- package/dist/esm/funcs/diagGetHealthInfo.d.ts.map +1 -0
- package/dist/esm/funcs/diagGetHealthInfo.js +64 -0
- package/dist/esm/funcs/diagGetHealthInfo.js.map +1 -0
- package/dist/esm/hooks/hooks.d.ts +25 -0
- package/dist/esm/hooks/hooks.d.ts.map +1 -0
- package/dist/esm/hooks/hooks.js +82 -0
- package/dist/esm/hooks/hooks.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +3 -0
- package/dist/esm/hooks/index.d.ts.map +1 -0
- package/dist/esm/hooks/index.js +6 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/registration.d.ts +3 -0
- package/dist/esm/hooks/registration.d.ts.map +1 -0
- package/dist/esm/hooks/registration.js +12 -0
- package/dist/esm/hooks/registration.js.map +1 -0
- package/dist/esm/hooks/types.d.ts +76 -0
- package/dist/esm/hooks/types.d.ts.map +1 -0
- package/dist/esm/hooks/types.js +5 -0
- package/dist/esm/hooks/types.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/base64.d.ts +10 -0
- package/dist/esm/lib/base64.d.ts.map +1 -0
- package/dist/esm/lib/base64.js +29 -0
- package/dist/esm/lib/base64.js.map +1 -0
- package/dist/esm/lib/config.d.ts +38 -0
- package/dist/esm/lib/config.d.ts.map +1 -0
- package/dist/esm/lib/config.js +31 -0
- package/dist/esm/lib/config.js.map +1 -0
- package/dist/esm/lib/dlv.d.ts +14 -0
- package/dist/esm/lib/dlv.d.ts.map +1 -0
- package/dist/esm/lib/dlv.js +46 -0
- package/dist/esm/lib/dlv.js.map +1 -0
- package/dist/esm/lib/encodings.d.ts +52 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -0
- package/dist/esm/lib/encodings.js +354 -0
- package/dist/esm/lib/encodings.js.map +1 -0
- package/dist/esm/lib/env.d.ts +15 -0
- package/dist/esm/lib/env.d.ts.map +1 -0
- package/dist/esm/lib/env.js +27 -0
- package/dist/esm/lib/env.js.map +1 -0
- package/dist/esm/lib/files.d.ts +13 -0
- package/dist/esm/lib/files.d.ts.map +1 -0
- package/dist/esm/lib/files.js +73 -0
- package/dist/esm/lib/files.js.map +1 -0
- package/dist/esm/lib/http.d.ts +67 -0
- package/dist/esm/lib/http.d.ts.map +1 -0
- package/dist/esm/lib/http.js +207 -0
- package/dist/esm/lib/http.js.map +1 -0
- package/dist/esm/lib/is-plain-object.d.ts +2 -0
- package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
- package/dist/esm/lib/is-plain-object.js +38 -0
- package/dist/esm/lib/is-plain-object.js.map +1 -0
- package/dist/esm/lib/logger.d.ts +6 -0
- package/dist/esm/lib/logger.d.ts.map +1 -0
- package/dist/esm/lib/logger.js +5 -0
- package/dist/esm/lib/logger.js.map +1 -0
- package/dist/esm/lib/matchers.d.ts +59 -0
- package/dist/esm/lib/matchers.d.ts.map +1 -0
- package/dist/esm/lib/matchers.js +203 -0
- package/dist/esm/lib/matchers.js.map +1 -0
- package/dist/esm/lib/primitives.d.ts +26 -0
- package/dist/esm/lib/primitives.d.ts.map +1 -0
- package/dist/esm/lib/primitives.js +103 -0
- package/dist/esm/lib/primitives.js.map +1 -0
- package/dist/esm/lib/retries.d.ts +38 -0
- package/dist/esm/lib/retries.d.ts.map +1 -0
- package/dist/esm/lib/retries.js +147 -0
- package/dist/esm/lib/retries.js.map +1 -0
- package/dist/esm/lib/schemas.d.ts +19 -0
- package/dist/esm/lib/schemas.d.ts.map +1 -0
- package/dist/esm/lib/schemas.js +57 -0
- package/dist/esm/lib/schemas.js.map +1 -0
- package/dist/esm/lib/sdks.d.ts +63 -0
- package/dist/esm/lib/sdks.d.ts.map +1 -0
- package/dist/esm/lib/sdks.js +269 -0
- package/dist/esm/lib/sdks.js.map +1 -0
- package/dist/esm/lib/security.d.ts +83 -0
- package/dist/esm/lib/security.d.ts.map +1 -0
- package/dist/esm/lib/security.js +137 -0
- package/dist/esm/lib/security.js.map +1 -0
- package/dist/esm/lib/url.d.ts +5 -0
- package/dist/esm/lib/url.d.ts.map +1 -0
- package/dist/esm/lib/url.js +22 -0
- package/dist/esm/lib/url.js.map +1 -0
- package/dist/esm/mcp-server/build.d.mts.map +1 -0
- package/dist/esm/mcp-server/build.mjs +14 -0
- package/dist/esm/mcp-server/build.mjs.map +1 -0
- package/dist/esm/mcp-server/cli/start/command.d.ts +2 -0
- package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli/start/command.js +90 -0
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -0
- package/dist/esm/mcp-server/cli/start/impl.d.ts +16 -0
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli/start/impl.js +96 -0
- package/dist/esm/mcp-server/cli/start/impl.js.map +1 -0
- package/dist/esm/mcp-server/cli.d.ts +6 -0
- package/dist/esm/mcp-server/cli.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli.js +7 -0
- package/dist/esm/mcp-server/cli.js.map +1 -0
- package/dist/esm/mcp-server/console-logger.d.ts +7 -0
- package/dist/esm/mcp-server/console-logger.d.ts.map +1 -0
- package/dist/esm/mcp-server/console-logger.js +55 -0
- package/dist/esm/mcp-server/console-logger.js.map +1 -0
- package/dist/esm/mcp-server/extensions.d.ts +11 -0
- package/dist/esm/mcp-server/extensions.d.ts.map +1 -0
- package/dist/esm/mcp-server/extensions.js +5 -0
- package/dist/esm/mcp-server/extensions.js.map +1 -0
- package/dist/esm/mcp-server/mcp-server.d.ts +2 -0
- package/dist/esm/mcp-server/mcp-server.d.ts.map +1 -0
- package/dist/esm/mcp-server/mcp-server.js +23 -0
- package/dist/esm/mcp-server/mcp-server.js.map +1 -0
- package/dist/esm/mcp-server/prompts.d.ts +26 -0
- package/dist/esm/mcp-server/prompts.d.ts.map +1 -0
- package/dist/esm/mcp-server/prompts.js +47 -0
- package/dist/esm/mcp-server/prompts.js.map +1 -0
- package/dist/esm/mcp-server/resources.d.ts +32 -0
- package/dist/esm/mcp-server/resources.d.ts.map +1 -0
- package/dist/esm/mcp-server/resources.js +82 -0
- package/dist/esm/mcp-server/resources.js.map +1 -0
- package/dist/esm/mcp-server/scopes.d.ts +3 -0
- package/dist/esm/mcp-server/scopes.d.ts.map +1 -0
- package/dist/esm/mcp-server/scopes.js +5 -0
- package/dist/esm/mcp-server/scopes.js.map +1 -0
- package/dist/esm/mcp-server/server.d.ts +13 -0
- package/dist/esm/mcp-server/server.d.ts.map +1 -0
- package/dist/esm/mcp-server/server.js +31 -0
- package/dist/esm/mcp-server/server.js.map +1 -0
- package/dist/esm/mcp-server/shared.d.ts +7 -0
- package/dist/esm/mcp-server/shared.d.ts.map +1 -0
- package/dist/esm/mcp-server/shared.js +59 -0
- package/dist/esm/mcp-server/shared.js.map +1 -0
- package/dist/esm/mcp-server/tools/diagGetHealthInfo.d.ts +3 -0
- package/dist/esm/mcp-server/tools/diagGetHealthInfo.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/diagGetHealthInfo.js +21 -0
- package/dist/esm/mcp-server/tools/diagGetHealthInfo.js.map +1 -0
- package/dist/esm/mcp-server/tools.d.ts +25 -0
- package/dist/esm/mcp-server/tools.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools.js +78 -0
- package/dist/esm/mcp-server/tools.js.map +1 -0
- package/dist/esm/models/errors/criblcontrolplanedefaulterror.d.ts +10 -0
- package/dist/esm/models/errors/criblcontrolplanedefaulterror.d.ts.map +1 -0
- package/dist/esm/models/errors/criblcontrolplanedefaulterror.js +30 -0
- package/dist/esm/models/errors/criblcontrolplanedefaulterror.js.map +1 -0
- package/dist/esm/models/errors/criblcontrolplaneerror.d.ts +19 -0
- package/dist/esm/models/errors/criblcontrolplaneerror.d.ts.map +1 -0
- package/dist/esm/models/errors/criblcontrolplaneerror.js +16 -0
- package/dist/esm/models/errors/criblcontrolplaneerror.js.map +1 -0
- package/dist/esm/models/errors/healthstatuserror.d.ts +43 -0
- package/dist/esm/models/errors/healthstatuserror.d.ts.map +1 -0
- package/dist/esm/models/errors/healthstatuserror.js +56 -0
- package/dist/esm/models/errors/healthstatuserror.js.map +1 -0
- package/dist/esm/models/errors/httpclienterrors.d.ts +44 -0
- package/dist/esm/models/errors/httpclienterrors.d.ts.map +1 -0
- package/dist/esm/models/errors/httpclienterrors.js +69 -0
- package/dist/esm/models/errors/httpclienterrors.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +6 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -0
- package/dist/esm/models/errors/index.js +9 -0
- package/dist/esm/models/errors/index.js.map +1 -0
- package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
- package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/dist/esm/models/errors/responsevalidationerror.js +29 -0
- package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
- package/dist/esm/models/errors/sdkvalidationerror.d.ts +21 -0
- package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/dist/esm/models/errors/sdkvalidationerror.js +91 -0
- package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -0
- package/dist/esm/models/healthstatus.d.ts +87 -0
- package/dist/esm/models/healthstatus.d.ts.map +1 -0
- package/dist/esm/models/healthstatus.js +75 -0
- package/dist/esm/models/healthstatus.js.map +1 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/security.d.ts +29 -0
- package/dist/esm/models/security.d.ts.map +1 -0
- package/dist/esm/models/security.js +31 -0
- package/dist/esm/models/security.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/sdk/diag.d.ts +9 -0
- package/dist/esm/sdk/diag.d.ts.map +1 -0
- package/dist/esm/sdk/diag.js +15 -0
- package/dist/esm/sdk/diag.js.map +1 -0
- package/dist/esm/sdk/health.d.ts +9 -0
- package/dist/esm/sdk/health.d.ts.map +1 -0
- package/dist/esm/sdk/health.js +15 -0
- package/dist/esm/sdk/health.js.map +1 -0
- package/dist/esm/sdk/index.d.ts +2 -0
- package/dist/esm/sdk/index.d.ts.map +1 -0
- package/dist/esm/sdk/index.js +5 -0
- package/dist/esm/sdk/index.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +10 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -0
- package/dist/esm/sdk/sdk.js +15 -0
- package/dist/esm/sdk/sdk.js.map +1 -0
- package/dist/esm/types/async.d.ts +23 -0
- package/dist/esm/types/async.d.ts.map +1 -0
- package/dist/esm/types/async.js +40 -0
- package/dist/esm/types/async.js.map +1 -0
- package/dist/esm/types/blobs.d.ts +4 -0
- package/dist/esm/types/blobs.d.ts.map +1 -0
- package/dist/esm/types/blobs.js +25 -0
- package/dist/esm/types/blobs.js.map +1 -0
- package/dist/esm/types/constdatetime.d.ts +3 -0
- package/dist/esm/types/constdatetime.d.ts.map +1 -0
- package/dist/esm/types/constdatetime.js +10 -0
- package/dist/esm/types/constdatetime.js.map +1 -0
- package/dist/esm/types/enums.d.ts +12 -0
- package/dist/esm/types/enums.d.ts.map +1 -0
- package/dist/esm/types/enums.js +7 -0
- package/dist/esm/types/enums.js.map +1 -0
- package/dist/esm/types/fp.d.ts +31 -0
- package/dist/esm/types/fp.d.ts.map +1 -0
- package/dist/esm/types/fp.js +31 -0
- package/dist/esm/types/fp.js.map +1 -0
- package/dist/esm/types/index.d.ts +8 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +8 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/operations.d.ts +27 -0
- package/dist/esm/types/operations.d.ts.map +1 -0
- package/dist/esm/types/operations.js +77 -0
- package/dist/esm/types/operations.js.map +1 -0
- package/dist/esm/types/rfcdate.d.ts +21 -0
- package/dist/esm/types/rfcdate.d.ts.map +1 -0
- package/dist/esm/types/rfcdate.js +42 -0
- package/dist/esm/types/rfcdate.js.map +1 -0
- package/dist/esm/types/streams.d.ts +2 -0
- package/dist/esm/types/streams.d.ts.map +1 -0
- package/dist/esm/types/streams.js +15 -0
- package/dist/esm/types/streams.js.map +1 -0
- package/docs/sdks/criblcontrolplane/README.md +7 -0
- package/docs/sdks/diag/README.md +78 -0
- package/docs/sdks/health/README.md +78 -0
- package/examples/README.md +26 -0
- package/examples/diagGetHealthInfo.example.ts +24 -0
- package/examples/package-lock.json +629 -0
- package/examples/package.json +18 -0
- package/jsr.json +27 -0
- package/package.json +131 -0
- package/src/__tests__/assertions.ts +13 -0
- package/src/__tests__/diag.test.ts +23 -0
- package/src/__tests__/files.ts +56 -0
- package/src/__tests__/mockserver/README.md +52 -0
- package/src/__tests__/testclient.ts +48 -0
- package/src/core.ts +13 -0
- package/src/funcs/diagGetHealthInfo.ts +142 -0
- package/src/hooks/hooks.ts +132 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +107 -0
- package/src/index.ts +9 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +65 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +483 -0
- package/src/lib/env.ts +41 -0
- package/src/lib/files.ts +82 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +358 -0
- package/src/lib/primitives.ts +150 -0
- package/src/lib/retries.ts +218 -0
- package/src/lib/schemas.ts +91 -0
- package/src/lib/sdks.ts +406 -0
- package/src/lib/security.ts +261 -0
- package/src/lib/url.ts +33 -0
- package/src/mcp-server/cli/start/command.ts +94 -0
- package/src/mcp-server/cli/start/impl.ts +130 -0
- package/src/mcp-server/cli.ts +13 -0
- package/src/mcp-server/console-logger.ts +71 -0
- package/src/mcp-server/extensions.ts +17 -0
- package/src/mcp-server/mcp-server.ts +26 -0
- package/src/mcp-server/prompts.ts +117 -0
- package/src/mcp-server/resources.ts +172 -0
- package/src/mcp-server/scopes.ts +7 -0
- package/src/mcp-server/server.ts +61 -0
- package/src/mcp-server/shared.ts +75 -0
- package/src/mcp-server/tools/diagGetHealthInfo.ts +28 -0
- package/src/mcp-server/tools.ts +129 -0
- package/src/models/errors/criblcontrolplanedefaulterror.ts +40 -0
- package/src/models/errors/criblcontrolplaneerror.ts +35 -0
- package/src/models/errors/healthstatuserror.ts +92 -0
- package/src/models/errors/httpclienterrors.ts +62 -0
- package/src/models/errors/index.ts +9 -0
- package/src/models/errors/responsevalidationerror.ts +50 -0
- package/src/models/errors/sdkvalidationerror.ts +109 -0
- package/src/models/healthstatus.ts +123 -0
- package/src/models/index.ts +6 -0
- package/src/models/security.ts +62 -0
- package/src/sdk/diag.ts +22 -0
- package/src/sdk/health.ts +22 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/sdk.ts +19 -0
- package/src/types/async.ts +68 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/constdatetime.ts +15 -0
- package/src/types/enums.ts +16 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +11 -0
- package/src/types/operations.ts +105 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/streams.ts +21 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
|
|
3
|
+
|
|
4
|
+
# Dev Containers Quick Start
|
|
5
|
+
|
|
6
|
+
The default location for usage snippets is the `samples` directory.
|
|
7
|
+
|
|
8
|
+
## Running a Usage Sample
|
|
9
|
+
|
|
10
|
+
A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
ts-node root.ts
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Generating Additional Usage Samples
|
|
17
|
+
|
|
18
|
+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
|
|
19
|
+
|
|
20
|
+
- To generate a sample for a specific operation by providing an operation ID, use:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -i {INPUT_OPERATION_ID} -o ./samples
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- To generate samples for an entire namespace (like a tag or group name), use:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -n {INPUT_TAG_NAME} -o ./samples
|
|
30
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
|
2
|
+
// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
|
|
3
|
+
{
|
|
4
|
+
"name": "TypeScript",
|
|
5
|
+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
|
|
6
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
|
7
|
+
// "features": {},
|
|
8
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
9
|
+
// "forwardPorts": [],
|
|
10
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
|
11
|
+
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
|
|
12
|
+
"customizations": {
|
|
13
|
+
"vscode": {
|
|
14
|
+
"extensions": [
|
|
15
|
+
"ms-vscode.vscode-typescript-tslint-plugin",
|
|
16
|
+
"esbenp.prettier-vscode",
|
|
17
|
+
"github.vscode-pull-request-github"
|
|
18
|
+
],
|
|
19
|
+
"settings": {
|
|
20
|
+
"files.eol": "\n",
|
|
21
|
+
"editor.formatOnSave": true,
|
|
22
|
+
"typescript.tsc.autoDetect": "on",
|
|
23
|
+
"typescript.updateImportsOnFileMove.enabled": "always",
|
|
24
|
+
"typescript.preferences.importModuleSpecifier": "relative",
|
|
25
|
+
"[typescript]": {
|
|
26
|
+
"editor.codeActionsOnSave": {
|
|
27
|
+
"source.organizeImports": true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"[typescriptreact]": {
|
|
31
|
+
"editor.codeActionsOnSave": {
|
|
32
|
+
"source.organizeImports": true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"codespaces": {
|
|
38
|
+
"openFiles": [
|
|
39
|
+
".devcontainer/README.md"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
|
44
|
+
// "remoteUser": "root"
|
|
45
|
+
}
|
package/FUNCTIONS.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Standalone Functions
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This section is useful if you are using a bundler and targetting browsers and
|
|
5
|
+
> runtimes where the size of an application affects performance and load times.
|
|
6
|
+
|
|
7
|
+
Every method in this SDK is also available as a standalone function. This
|
|
8
|
+
alternative API is suitable when targetting the browser or serverless runtimes
|
|
9
|
+
and using a bundler to build your application since all unused functionality
|
|
10
|
+
will be tree-shaken away. This includes code for unused methods, Zod schemas,
|
|
11
|
+
encoding helpers and response handlers. The result is dramatically smaller
|
|
12
|
+
impact on the application's final bundle size which grows very slowly as you use
|
|
13
|
+
more and more functionality from this SDK.
|
|
14
|
+
|
|
15
|
+
Calling methods through the main SDK class remains a valid and generally more
|
|
16
|
+
more ergonomic option. Standalone functions represent an optimisation for a
|
|
17
|
+
specific category of applications.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { CriblControlPlaneCore } from "cribl-control-plane/core.js";
|
|
23
|
+
import { diagGetHealthInfo } from "cribl-control-plane/funcs/diagGetHealthInfo.js";
|
|
24
|
+
|
|
25
|
+
// Use `CriblControlPlaneCore` for best tree-shaking performance.
|
|
26
|
+
// You can create one instance of it to use across an application.
|
|
27
|
+
const criblControlPlane = new CriblControlPlaneCore({
|
|
28
|
+
serverURL: "https://api.example.com",
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
const res = await diagGetHealthInfo(criblControlPlane);
|
|
33
|
+
if (res.ok) {
|
|
34
|
+
const { value: result } = res;
|
|
35
|
+
console.log(result);
|
|
36
|
+
} else {
|
|
37
|
+
console.log("diagGetHealthInfo failed:", res.error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
run();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Result types
|
|
45
|
+
|
|
46
|
+
Standalone functions differ from SDK methods in that they return a
|
|
47
|
+
`Result<Value, Error>` type to capture _known errors_ and document them using
|
|
48
|
+
the type system. By avoiding throwing errors, application code maintains clear
|
|
49
|
+
control flow and error-handling become part of the regular flow of application
|
|
50
|
+
code.
|
|
51
|
+
|
|
52
|
+
> We use the term "known errors" because standalone functions, and JavaScript
|
|
53
|
+
> code in general, can still throw unexpected errors such as `TypeError`s,
|
|
54
|
+
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
|
|
55
|
+
> something this SDK addresses in the future. Nevertheless, there is still a lot
|
|
56
|
+
> of benefit from capturing most errors and turning them into values.
|
|
57
|
+
|
|
58
|
+
The second reason for this style of programming is because these functions will
|
|
59
|
+
typically be used in front-end applications where exception throwing is
|
|
60
|
+
sometimes discouraged or considered unidiomatic. React and similar ecosystems
|
|
61
|
+
and libraries tend to promote this style of programming so that components
|
|
62
|
+
render useful content under all states (loading, success, error and so on).
|
|
63
|
+
|
|
64
|
+
The general pattern when calling standalone functions looks like this:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { Core } from "<sdk-package-name>";
|
|
68
|
+
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
|
|
69
|
+
|
|
70
|
+
const client = new Core();
|
|
71
|
+
|
|
72
|
+
async function run() {
|
|
73
|
+
const result = await fetchSomething(client, { id: "123" });
|
|
74
|
+
if (!result.ok) {
|
|
75
|
+
// You can throw the error or handle it. It's your choice now.
|
|
76
|
+
throw result.error;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log(result.value);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
run();
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Notably, `result.error` above will have an explicit type compared to a try-catch
|
|
86
|
+
variation where the error in the catch block can only be of type `unknown` (or
|
|
87
|
+
`any` depending on your TypeScript settings).
|
package/README.md
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
# cribl-control-plane-sdk-typescript
|
|
2
|
+
<!-- Start Summary [summary] -->
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Cribl API Reference: This API Reference lists available REST endpoints, along with their supported operations for accessing, creating, updating, or deleting resources. See our complementary product documentation at [docs.cribl.io](http://docs.cribl.io).
|
|
6
|
+
<!-- End Summary [summary] -->
|
|
7
|
+
|
|
8
|
+
<!-- Start Table of Contents [toc] -->
|
|
9
|
+
## Table of Contents
|
|
10
|
+
<!-- $toc-max-depth=2 -->
|
|
11
|
+
* [cribl-control-plane-sdk-typescript](#cribl-control-plane-sdk-typescript)
|
|
12
|
+
* [SDK Installation](#sdk-installation)
|
|
13
|
+
* [Requirements](#requirements)
|
|
14
|
+
* [SDK Example Usage](#sdk-example-usage)
|
|
15
|
+
* [Authentication](#authentication)
|
|
16
|
+
* [Available Resources and Operations](#available-resources-and-operations)
|
|
17
|
+
* [Standalone functions](#standalone-functions)
|
|
18
|
+
* [Retries](#retries)
|
|
19
|
+
* [Error Handling](#error-handling)
|
|
20
|
+
* [Custom HTTP Client](#custom-http-client)
|
|
21
|
+
* [Debugging](#debugging)
|
|
22
|
+
|
|
23
|
+
<!-- End Table of Contents [toc] -->
|
|
24
|
+
|
|
25
|
+
<!-- Start SDK Installation [installation] -->
|
|
26
|
+
## SDK Installation
|
|
27
|
+
|
|
28
|
+
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
|
29
|
+
|
|
30
|
+
### NPM
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm add cribl-control-plane
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### PNPM
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm add cribl-control-plane
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Bun
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bun add cribl-control-plane
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Yarn
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
yarn add cribl-control-plane zod
|
|
52
|
+
|
|
53
|
+
# Note that Yarn does not install peer dependencies automatically. You will need
|
|
54
|
+
# to install zod as shown above.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> [!NOTE]
|
|
58
|
+
> This package is published with CommonJS and ES Modules (ESM) support.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Model Context Protocol (MCP) Server
|
|
62
|
+
|
|
63
|
+
This SDK is also an installable MCP server where the various SDK methods are
|
|
64
|
+
exposed as tools that can be invoked by AI applications.
|
|
65
|
+
|
|
66
|
+
> Node.js v20 or greater is required to run the MCP server from npm.
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
<summary>Claude installation steps</summary>
|
|
70
|
+
|
|
71
|
+
Add the following server definition to your `claude_desktop_config.json` file:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"CriblControlPlane": {
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": [
|
|
79
|
+
"-y", "--package", "cribl-control-plane",
|
|
80
|
+
"--",
|
|
81
|
+
"mcp", "start",
|
|
82
|
+
"--server-url", "...",
|
|
83
|
+
"--bearer-auth", "..."
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary>Cursor installation steps</summary>
|
|
94
|
+
|
|
95
|
+
Create a `.cursor/mcp.json` file in your project root with the following content:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"CriblControlPlane": {
|
|
101
|
+
"command": "npx",
|
|
102
|
+
"args": [
|
|
103
|
+
"-y", "--package", "cribl-control-plane",
|
|
104
|
+
"--",
|
|
105
|
+
"mcp", "start",
|
|
106
|
+
"--server-url", "...",
|
|
107
|
+
"--bearer-auth", "..."
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
</details>
|
|
115
|
+
|
|
116
|
+
You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
curl -L -o mcp-server \
|
|
120
|
+
https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \
|
|
121
|
+
chmod +x mcp-server
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"mcpServers": {
|
|
130
|
+
"Todos": {
|
|
131
|
+
"command": "./DOWNLOAD/PATH/mcp-server",
|
|
132
|
+
"args": [
|
|
133
|
+
"start"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
For a full list of server arguments, run:
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
npx -y --package cribl-control-plane -- mcp start --help
|
|
144
|
+
```
|
|
145
|
+
<!-- End SDK Installation [installation] -->
|
|
146
|
+
|
|
147
|
+
<!-- Start Requirements [requirements] -->
|
|
148
|
+
## Requirements
|
|
149
|
+
|
|
150
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
151
|
+
<!-- End Requirements [requirements] -->
|
|
152
|
+
|
|
153
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
154
|
+
## SDK Example Usage
|
|
155
|
+
|
|
156
|
+
### Example
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
160
|
+
|
|
161
|
+
const criblControlPlane = new CriblControlPlane({
|
|
162
|
+
serverURL: "https://api.example.com",
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
async function run() {
|
|
166
|
+
const result = await criblControlPlane.diag.getHealthInfo();
|
|
167
|
+
|
|
168
|
+
console.log(result);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
run();
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
<!-- End SDK Example Usage [usage] -->
|
|
175
|
+
|
|
176
|
+
<!-- Start Authentication [security] -->
|
|
177
|
+
## Authentication
|
|
178
|
+
|
|
179
|
+
### Per-Client Security Schemes
|
|
180
|
+
|
|
181
|
+
This SDK supports the following security scheme globally:
|
|
182
|
+
|
|
183
|
+
| Name | Type | Scheme | Environment Variable |
|
|
184
|
+
| ------------ | ---- | ----------- | ------------------------------- |
|
|
185
|
+
| `bearerAuth` | http | HTTP Bearer | `CRIBLCONTROLPLANE_BEARER_AUTH` |
|
|
186
|
+
|
|
187
|
+
To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
|
|
188
|
+
```typescript
|
|
189
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
190
|
+
|
|
191
|
+
const criblControlPlane = new CriblControlPlane({
|
|
192
|
+
serverURL: "https://api.example.com",
|
|
193
|
+
bearerAuth: process.env["CRIBLCONTROLPLANE_BEARER_AUTH"] ?? "",
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
async function run() {
|
|
197
|
+
const result = await criblControlPlane.diag.getHealthInfo();
|
|
198
|
+
|
|
199
|
+
console.log(result);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
run();
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
<!-- End Authentication [security] -->
|
|
206
|
+
|
|
207
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
208
|
+
## Available Resources and Operations
|
|
209
|
+
|
|
210
|
+
<details open>
|
|
211
|
+
<summary>Available methods</summary>
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
### [diag](docs/sdks/diag/README.md)
|
|
215
|
+
|
|
216
|
+
* [getHealthInfo](docs/sdks/diag/README.md#gethealthinfo) - Provides health info for REST server
|
|
217
|
+
|
|
218
|
+
### [health](docs/sdks/health/README.md)
|
|
219
|
+
|
|
220
|
+
* [getHealthInfo](docs/sdks/health/README.md#gethealthinfo) - Provides health info for REST server
|
|
221
|
+
|
|
222
|
+
</details>
|
|
223
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
224
|
+
|
|
225
|
+
<!-- Start Standalone functions [standalone-funcs] -->
|
|
226
|
+
## Standalone functions
|
|
227
|
+
|
|
228
|
+
All the methods listed above are available as standalone functions. These
|
|
229
|
+
functions are ideal for use in applications running in the browser, serverless
|
|
230
|
+
runtimes or other environments where application bundle size is a primary
|
|
231
|
+
concern. When using a bundler to build your application, all unused
|
|
232
|
+
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
233
|
+
|
|
234
|
+
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
235
|
+
|
|
236
|
+
<details>
|
|
237
|
+
|
|
238
|
+
<summary>Available standalone functions</summary>
|
|
239
|
+
|
|
240
|
+
- [`diagGetHealthInfo`](docs/sdks/diag/README.md#gethealthinfo) - Provides health info for REST server
|
|
241
|
+
- [`diagGetHealthInfo`](docs/sdks/health/README.md#gethealthinfo) - Provides health info for REST server
|
|
242
|
+
|
|
243
|
+
</details>
|
|
244
|
+
<!-- End Standalone functions [standalone-funcs] -->
|
|
245
|
+
|
|
246
|
+
<!-- Start Retries [retries] -->
|
|
247
|
+
## Retries
|
|
248
|
+
|
|
249
|
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
250
|
+
|
|
251
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
252
|
+
```typescript
|
|
253
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
254
|
+
|
|
255
|
+
const criblControlPlane = new CriblControlPlane({
|
|
256
|
+
serverURL: "https://api.example.com",
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
async function run() {
|
|
260
|
+
const result = await criblControlPlane.diag.getHealthInfo({
|
|
261
|
+
retries: {
|
|
262
|
+
strategy: "backoff",
|
|
263
|
+
backoff: {
|
|
264
|
+
initialInterval: 1,
|
|
265
|
+
maxInterval: 50,
|
|
266
|
+
exponent: 1.1,
|
|
267
|
+
maxElapsedTime: 100,
|
|
268
|
+
},
|
|
269
|
+
retryConnectionErrors: false,
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
console.log(result);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
run();
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
281
|
+
```typescript
|
|
282
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
283
|
+
|
|
284
|
+
const criblControlPlane = new CriblControlPlane({
|
|
285
|
+
serverURL: "https://api.example.com",
|
|
286
|
+
retryConfig: {
|
|
287
|
+
strategy: "backoff",
|
|
288
|
+
backoff: {
|
|
289
|
+
initialInterval: 1,
|
|
290
|
+
maxInterval: 50,
|
|
291
|
+
exponent: 1.1,
|
|
292
|
+
maxElapsedTime: 100,
|
|
293
|
+
},
|
|
294
|
+
retryConnectionErrors: false,
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
async function run() {
|
|
299
|
+
const result = await criblControlPlane.diag.getHealthInfo();
|
|
300
|
+
|
|
301
|
+
console.log(result);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
run();
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
<!-- End Retries [retries] -->
|
|
308
|
+
|
|
309
|
+
<!-- Start Error Handling [errors] -->
|
|
310
|
+
## Error Handling
|
|
311
|
+
|
|
312
|
+
[`CriblControlPlaneError`](./src/models/errors/criblcontrolplaneerror.ts) is the base class for all HTTP error responses. It has the following properties:
|
|
313
|
+
|
|
314
|
+
| Property | Type | Description |
|
|
315
|
+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
316
|
+
| `error.message` | `string` | Error message |
|
|
317
|
+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
|
|
318
|
+
| `error.headers` | `Headers` | HTTP response headers |
|
|
319
|
+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
|
|
320
|
+
| `error.rawResponse` | `Response` | Raw HTTP response |
|
|
321
|
+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
|
|
322
|
+
|
|
323
|
+
### Example
|
|
324
|
+
```typescript
|
|
325
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
326
|
+
import * as errors from "cribl-control-plane/models/errors";
|
|
327
|
+
|
|
328
|
+
const criblControlPlane = new CriblControlPlane({
|
|
329
|
+
serverURL: "https://api.example.com",
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
async function run() {
|
|
333
|
+
try {
|
|
334
|
+
const result = await criblControlPlane.diag.getHealthInfo();
|
|
335
|
+
|
|
336
|
+
console.log(result);
|
|
337
|
+
} catch (error) {
|
|
338
|
+
// The base class for HTTP error responses
|
|
339
|
+
if (error instanceof errors.CriblControlPlaneError) {
|
|
340
|
+
console.log(error.message);
|
|
341
|
+
console.log(error.statusCode);
|
|
342
|
+
console.log(error.body);
|
|
343
|
+
console.log(error.headers);
|
|
344
|
+
|
|
345
|
+
// Depending on the method different errors may be thrown
|
|
346
|
+
if (error instanceof errors.HealthStatusError) {
|
|
347
|
+
console.log(error.data$.role); // models.Role
|
|
348
|
+
console.log(error.data$.status); // models.Status
|
|
349
|
+
console.log(error.data$.startTime); // number
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
run();
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Error Classes
|
|
360
|
+
**Primary error:**
|
|
361
|
+
* [`CriblControlPlaneError`](./src/models/errors/criblcontrolplaneerror.ts): The base class for HTTP error responses.
|
|
362
|
+
|
|
363
|
+
<details><summary>Less common errors (7)</summary>
|
|
364
|
+
|
|
365
|
+
<br />
|
|
366
|
+
|
|
367
|
+
**Network errors:**
|
|
368
|
+
* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
|
|
369
|
+
* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
|
|
370
|
+
* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
|
|
371
|
+
* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
|
|
372
|
+
* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
**Inherit from [`CriblControlPlaneError`](./src/models/errors/criblcontrolplaneerror.ts)**:
|
|
376
|
+
* [`HealthStatusError`](./src/models/errors/healthstatuserror.ts): Healthy status. Status code `420`. Applicable to 1 of 2 methods.*
|
|
377
|
+
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
378
|
+
|
|
379
|
+
</details>
|
|
380
|
+
|
|
381
|
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
|
|
382
|
+
<!-- End Error Handling [errors] -->
|
|
383
|
+
|
|
384
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
385
|
+
## Custom HTTP Client
|
|
386
|
+
|
|
387
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
388
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
389
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
390
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
391
|
+
errors and response.
|
|
392
|
+
|
|
393
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
394
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
395
|
+
the HTTP client and feed in fixtures.
|
|
396
|
+
|
|
397
|
+
The following example shows how to use the `"beforeRequest"` hook to to add a
|
|
398
|
+
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
399
|
+
to log errors:
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
403
|
+
import { HTTPClient } from "cribl-control-plane/lib/http";
|
|
404
|
+
|
|
405
|
+
const httpClient = new HTTPClient({
|
|
406
|
+
// fetcher takes a function that has the same signature as native `fetch`.
|
|
407
|
+
fetcher: (request) => {
|
|
408
|
+
return fetch(request);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
413
|
+
const nextRequest = new Request(request, {
|
|
414
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
418
|
+
|
|
419
|
+
return nextRequest;
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
423
|
+
console.group("Request Error");
|
|
424
|
+
console.log("Reason:", `${error}`);
|
|
425
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
426
|
+
console.groupEnd();
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
const sdk = new CriblControlPlane({ httpClient });
|
|
430
|
+
```
|
|
431
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
432
|
+
|
|
433
|
+
<!-- Start Debugging [debug] -->
|
|
434
|
+
## Debugging
|
|
435
|
+
|
|
436
|
+
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
437
|
+
|
|
438
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
439
|
+
|
|
440
|
+
> [!WARNING]
|
|
441
|
+
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
|
442
|
+
|
|
443
|
+
```typescript
|
|
444
|
+
import { CriblControlPlane } from "cribl-control-plane";
|
|
445
|
+
|
|
446
|
+
const sdk = new CriblControlPlane({ debugLogger: console });
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
You can also enable a default debug logger by setting an environment variable `CRIBLCONTROLPLANE_DEBUG` to true.
|
|
450
|
+
<!-- End Debugging [debug] -->
|
|
451
|
+
|
|
452
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
package/RUNTIMES.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Supported JavaScript runtimes
|
|
2
|
+
|
|
3
|
+
This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
|
|
4
|
+
|
|
5
|
+
* [Web Fetch API][web-fetch]
|
|
6
|
+
* [Web Streams API][web-streams] and in particular `ReadableStream`
|
|
7
|
+
* [Async iterables][async-iter] using `Symbol.asyncIterator`
|
|
8
|
+
|
|
9
|
+
[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
|
|
10
|
+
[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
|
|
11
|
+
[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
|
|
12
|
+
|
|
13
|
+
Runtime environments that are explicitly supported are:
|
|
14
|
+
|
|
15
|
+
- Evergreen browsers which include: Chrome, Safari, Edge, Firefox
|
|
16
|
+
- Node.js active and maintenance LTS releases
|
|
17
|
+
- Currently, this is v18 and v20
|
|
18
|
+
- Bun v1 and above
|
|
19
|
+
- Deno v1.39
|
|
20
|
+
- Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
|
|
21
|
+
|
|
22
|
+
[deno-file-streaming]: https://github.com/denoland/deno/issues/11018
|
|
23
|
+
|
|
24
|
+
## Recommended TypeScript compiler options
|
|
25
|
+
|
|
26
|
+
The following `tsconfig.json` options are recommended for projects using this
|
|
27
|
+
SDK in order to get static type support for features like async iterables,
|
|
28
|
+
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
|
|
29
|
+
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
|
|
30
|
+
so on):
|
|
31
|
+
|
|
32
|
+
[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
|
33
|
+
[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
34
|
+
[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
|
|
35
|
+
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
{
|
|
39
|
+
"compilerOptions": {
|
|
40
|
+
"target": "es2020", // or higher
|
|
41
|
+
"lib": ["es2020", "dom", "dom.iterable"],
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
While `target` can be set to older ECMAScript versions, it may result in extra,
|
|
47
|
+
unnecessary compatibility code being generated if you are not targeting old
|
|
48
|
+
runtimes.
|