@noodleseed/one 0.22.0 → 0.24.0
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/author-loop.d.ts +1 -0
- package/dist/commands/author-loop.d.ts.map +1 -1
- package/dist/commands/author-loop.js +6 -2
- package/dist/commands/author-loop.js.map +1 -1
- package/dist/commands/catalog-data-core.d.ts.map +1 -1
- package/dist/commands/catalog-data-core.js +17 -3
- package/dist/commands/catalog-data-core.js.map +1 -1
- package/dist/commands/catalog-data-resources.js +2 -2
- package/dist/commands/catalog-data-resources.js.map +1 -1
- package/dist/commands/catalog-dispatch.d.ts.map +1 -1
- package/dist/commands/catalog-dispatch.js +21 -2
- package/dist/commands/catalog-dispatch.js.map +1 -1
- package/dist/commands/catalog-render.d.ts.map +1 -1
- package/dist/commands/catalog-render.js +6 -0
- package/dist/commands/catalog-render.js.map +1 -1
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +30 -13
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/deploy-status-ops.d.ts +1 -1
- package/dist/commands/deploy-status-ops.d.ts.map +1 -1
- package/dist/commands/deploy-status-ops.js +8 -4
- package/dist/commands/deploy-status-ops.js.map +1 -1
- package/dist/commands/devtools.d.ts +11 -0
- package/dist/commands/devtools.d.ts.map +1 -0
- package/dist/commands/devtools.js +123 -0
- package/dist/commands/devtools.js.map +1 -0
- package/dist/commands/mcp-apps.d.ts +0 -1
- package/dist/commands/mcp-apps.d.ts.map +1 -1
- package/dist/commands/mcp-apps.js +71 -122
- package/dist/commands/mcp-apps.js.map +1 -1
- package/dist/commands/shared.d.ts +6 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +19 -0
- package/dist/commands/shared.js.map +1 -1
- package/dist/deploy.d.ts +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +5 -1
- package/dist/deploy.js.map +1 -1
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +13 -1
- package/dist/dev.js.map +1 -1
- package/dist/fire.js +1 -1
- package/dist/fire.js.map +1 -1
- package/dist/first-run.d.ts +11 -0
- package/dist/first-run.d.ts.map +1 -1
- package/dist/first-run.js +19 -4
- package/dist/first-run.js.map +1 -1
- package/dist/flavor.d.ts +1 -1
- package/dist/flavor.d.ts.map +1 -1
- package/dist/flavor.js +12 -2
- package/dist/flavor.js.map +1 -1
- package/dist/project-scaffold-templates.d.ts +11 -0
- package/dist/project-scaffold-templates.d.ts.map +1 -0
- package/dist/project-scaffold-templates.js +359 -0
- package/dist/project-scaffold-templates.js.map +1 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +1 -323
- package/dist/project.js.map +1 -1
- package/dist/react.d.ts +2 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/validate.d.ts +12 -0
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +11 -0
- package/dist/validate.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +4 -4
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +72 -13
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +8 -3
- package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +18 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.js +17 -4
- package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts +3 -3
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.js +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts +302 -7
- package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/components.js +39 -7
- package/node_modules/@noodle-borg/authoring/dist/react/components.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts +4 -2
- package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/index.js +2 -1
- package/node_modules/@noodle-borg/authoring/dist/react/index.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts +2618 -0
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts.map +1 -0
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js +110 -0
- package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js.map +1 -0
- package/node_modules/@noodle-borg/authoring/dist/react.d.ts +2 -2
- package/node_modules/@noodle-borg/authoring/dist/react.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react.js +1 -1
- package/node_modules/@noodle-borg/authoring/dist/react.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.d.ts +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.js +38 -6
- package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts +25 -2
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +64 -6
- package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js +20 -8
- package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +2 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +6 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/call-graph.d.ts +14 -0
- package/node_modules/@noodle-borg/connector-defs/dist/call-graph.d.ts.map +1 -0
- package/node_modules/@noodle-borg/connector-defs/dist/call-graph.js +66 -0
- package/node_modules/@noodle-borg/connector-defs/dist/call-graph.js.map +1 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.d.ts +21 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.d.ts.map +1 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.js +102 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.js.map +1 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts +19 -4
- package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js +67 -99
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/index.d.ts +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +168 -10
- package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/schema.js +72 -5
- package/node_modules/@noodle-borg/connector-defs/dist/schema.js.map +1 -1
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts +6 -0
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts.map +1 -1
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +2 -0
- package/node_modules/@noodle-borg/connector-http/dist/http-connector.js.map +1 -1
- package/node_modules/@noodle-borg/connector-http/package.json +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js +8 -0
- package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/execute.d.ts.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/execute.js +87 -62
- package/node_modules/@noodle-borg/runtime/dist/execute.js.map +1 -1
- package/node_modules/@noodle-borg/runtime/dist/result.d.ts +1 -1
- package/node_modules/@noodle-borg/runtime/dist/result.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/credential-broker.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/credential-broker.js +113 -11
- package/node_modules/@noodle-borg/service/dist/credential-broker.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts +28 -5
- package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/github/app-client.js +116 -7
- package/node_modules/@noodle-borg/service/dist/github/app-client.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/github/builder-auth.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-auth.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-auth.js +15 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-auth.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-main.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-main.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-main.js +9 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-main.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-runner.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-runner.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-runner.js +192 -0
- package/node_modules/@noodle-borg/service/dist/github/builder-runner.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.d.ts +45 -0
- package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.js +60 -0
- package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.d.ts +64 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.js +121 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.js +14 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.d.ts +36 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.js +107 -0
- package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.d.ts +38 -0
- package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.js +60 -0
- package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/local-compile.d.ts +24 -0
- package/node_modules/@noodle-borg/service/dist/github/local-compile.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/local-compile.js +98 -0
- package/node_modules/@noodle-borg/service/dist/github/local-compile.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/local-process-executor.d.ts +39 -0
- package/node_modules/@noodle-borg/service/dist/github/local-process-executor.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/local-process-executor.js +67 -0
- package/node_modules/@noodle-borg/service/dist/github/local-process-executor.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/run-access-mode.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/github/run-access-mode.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/run-access-mode.js +32 -0
- package/node_modules/@noodle-borg/service/dist/github/run-access-mode.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/run-token.d.ts +41 -0
- package/node_modules/@noodle-borg/service/dist/github/run-token.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/run-token.js +59 -0
- package/node_modules/@noodle-borg/service/dist/github/run-token.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/http-util.d.ts +7 -1
- package/node_modules/@noodle-borg/service/dist/http-util.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/http-util.js +14 -0
- package/node_modules/@noodle-borg/service/dist/http-util.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +13 -2
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +12 -1
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/main.js +72 -0
- package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +26 -3
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-helpers.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/registry-helpers.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-helpers.js +3 -0
- package/node_modules/@noodle-borg/service/dist/registry-helpers.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +7 -29
- package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.js +62 -57
- package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.d.ts +3 -2
- package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.js +36 -8
- package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts +3 -2
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +100 -12
- package/node_modules/@noodle-borg/service/dist/routes/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +36 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js +84 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-status.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-status.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-status.js +73 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-run-status.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts +23 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js +41 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +10 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.d.ts +85 -0
- package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.js +90 -0
- package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +31 -0
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +8 -13
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +5 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js +5 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.d.ts +120 -0
- package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.js +6 -0
- package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts +6 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js +18 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts +22 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs.js +39 -2
- package/node_modules/@noodle-borg/service/dist/store/github-runs.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts +13 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +115 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +6 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +15 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +22 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.d.ts +22 -99
- package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +15 -21
- package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +8 -2
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +15 -21
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +8 -2
- package/node_modules/hono/dist/cjs/helper/css/common.js +3 -1
- package/node_modules/hono/dist/cjs/helper/css/index.js +9 -1
- package/node_modules/hono/dist/cjs/jsx/base.js +8 -14
- package/node_modules/hono/dist/cjs/jsx/components.js +41 -21
- package/node_modules/hono/dist/cjs/jsx/context.js +131 -5
- package/node_modules/hono/dist/cjs/jsx/streaming.js +9 -7
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -5
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +2 -2
- package/node_modules/hono/dist/cjs/utils/body.js +12 -4
- package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
- package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
- package/node_modules/hono/dist/helper/css/common.js +3 -1
- package/node_modules/hono/dist/helper/css/index.js +9 -1
- package/node_modules/hono/dist/jsx/base.js +15 -15
- package/node_modules/hono/dist/jsx/components.js +42 -22
- package/node_modules/hono/dist/jsx/context.js +129 -5
- package/node_modules/hono/dist/jsx/streaming.js +10 -8
- package/node_modules/hono/dist/middleware/cors/index.js +2 -5
- package/node_modules/hono/dist/middleware/serve-static/index.js +2 -2
- package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +1 -1
- package/node_modules/hono/dist/types/jsx/base.d.ts +1 -3
- package/node_modules/hono/dist/types/jsx/context.d.ts +39 -0
- package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
- package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
- package/node_modules/hono/dist/utils/body.js +12 -4
- package/node_modules/hono/dist/utils/buffer.js +2 -1
- package/node_modules/hono/dist/validator/validator.js +3 -3
- package/node_modules/hono/package.json +9 -10
- package/node_modules/tailwindcss/dist/chunk-HMCCH6MG.mjs +1 -0
- package/node_modules/tailwindcss/dist/default-theme.mjs +1 -1
- package/node_modules/tailwindcss/dist/lib.js +13 -13
- package/node_modules/tailwindcss/dist/lib.mjs +18 -18
- package/node_modules/tailwindcss/package.json +2 -2
- package/node_modules/undici/README.md +3 -2
- package/node_modules/undici/docs/docs/api/Agent.md +248 -44
- package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
- package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
- package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
- package/node_modules/undici/docs/docs/api/Client.md +365 -178
- package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
- package/node_modules/undici/docs/docs/api/Connector.md +118 -36
- package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
- package/node_modules/undici/docs/docs/api/Cookies.md +125 -47
- package/node_modules/undici/docs/docs/api/Debug.md +34 -18
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
- package/node_modules/undici/docs/docs/api/Dispatcher.md +479 -1093
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +101 -87
- package/node_modules/undici/docs/docs/api/Errors.md +503 -40
- package/node_modules/undici/docs/docs/api/EventSource.md +294 -32
- package/node_modules/undici/docs/docs/api/Fetch.md +680 -31
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -98
- package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
- package/node_modules/undici/docs/docs/api/Interceptors.md +355 -0
- package/node_modules/undici/docs/docs/api/MockAgent.md +314 -322
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
- package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
- package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
- package/node_modules/undici/docs/docs/api/MockPool.md +299 -263
- package/node_modules/undici/docs/docs/api/Pool.md +235 -43
- package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -63
- package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -26
- package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -77
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +264 -542
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +162 -186
- package/node_modules/undici/docs/docs/api/Util.md +68 -11
- package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
- package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +6 -4
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
- package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
- package/node_modules/undici/docs/docs/{GettingStarted.md → getting-started.md} +22 -19
- package/node_modules/undici/docs/docs/index.md +779 -0
- package/node_modules/undici/docs/docs/site.json +125 -0
- package/node_modules/undici/docs/docs/type-map.json +79 -0
- package/node_modules/undici/lib/api/api-request.js +7 -1
- package/node_modules/undici/lib/api/readable.js +47 -2
- package/node_modules/undici/lib/core/errors.js +20 -0
- package/node_modules/undici/lib/core/request.js +1 -1
- package/node_modules/undici/lib/core/util.js +24 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +92 -1
- package/node_modules/undici/lib/dispatcher/client-h2.js +322 -118
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -0
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +42 -7
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +4 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +1 -0
- package/node_modules/undici/lib/handler/retry-handler.js +57 -19
- package/node_modules/undici/lib/util/cache.js +8 -2
- package/node_modules/undici/lib/web/cookies/parse.js +20 -27
- package/node_modules/undici/lib/web/cookies/util.js +1 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +7 -18
- package/node_modules/undici/lib/web/eventsource/util.js +32 -1
- package/node_modules/undici/lib/web/fetch/body.js +43 -0
- package/node_modules/undici/lib/web/fetch/constants.js +1 -1
- package/node_modules/undici/lib/web/fetch/index.js +11 -2
- package/node_modules/undici/lib/web/fetch/request.js +1 -0
- package/node_modules/undici/lib/web/fetch/util.js +4 -1
- package/node_modules/undici/lib/web/websocket/receiver.js +20 -3
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
- package/node_modules/undici/lib/web/websocket/websocket.js +3 -1
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +6 -1
- package/node_modules/undici/types/cookies.d.ts +1 -1
- package/node_modules/undici/types/errors.d.ts +10 -0
- package/node_modules/undici/types/fetch.d.ts +1 -0
- package/node_modules/undici/types/handlers.d.ts +2 -0
- package/node_modules/undici/types/proxy-agent.d.ts +7 -0
- package/package.json +4 -4
- package/react/styles.css +510 -5
- package/react/styles.source.css +850 -0
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
- package/node_modules/tailwindcss/dist/chunk-XVOTX5KS.mjs +0 -1
|
@@ -1,99 +1,297 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BalancedPool
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!--introduced_in=v4.8.0-->
|
|
4
|
+
<!--type=module-->
|
|
5
|
+
<!-- source_link=lib/dispatcher/balanced-pool.js -->
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
> Stability: 2 - Stable
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
A `BalancedPool` distributes requests across a set of {Pool} instances, each
|
|
10
|
+
connected to a different upstream. It uses a weighted round-robin algorithm:
|
|
11
|
+
every upstream starts with the same weight, and the weight is adjusted up on
|
|
12
|
+
successful connections and down on connection errors, so that healthy upstreams
|
|
13
|
+
receive a larger share of traffic.
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
Requests are not guaranteed to be dispatched in the order they are issued.
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
```mjs
|
|
18
|
+
import { BalancedPool } from 'undici'
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
const pool = new BalancedPool([
|
|
21
|
+
'http://localhost:3000',
|
|
22
|
+
'http://localhost:3001',
|
|
23
|
+
'http://localhost:3002',
|
|
24
|
+
])
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
const { statusCode, body } = await pool.request({
|
|
27
|
+
path: '/',
|
|
28
|
+
method: 'GET',
|
|
29
|
+
})
|
|
30
|
+
console.log('response received', statusCode)
|
|
31
|
+
for await (const chunk of body) {
|
|
32
|
+
console.log('data', chunk.toString())
|
|
33
|
+
}
|
|
34
|
+
```
|
|
17
35
|
|
|
18
|
-
|
|
36
|
+
## Class: `BalancedPool`
|
|
19
37
|
|
|
20
|
-
|
|
38
|
+
<!-- YAML
|
|
39
|
+
added: v4.8.0
|
|
40
|
+
changes:
|
|
41
|
+
- version: v4.10.4
|
|
42
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
43
|
+
description: Introduced the `BalancedPool` class.
|
|
44
|
+
-->
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
## Instance Properties
|
|
46
|
+
* Extends: {Dispatcher}
|
|
24
47
|
|
|
25
|
-
|
|
48
|
+
A pool of {Pool} instances connected to multiple upstreams.
|
|
26
49
|
|
|
27
|
-
|
|
50
|
+
### `new BalancedPool(upstreams[, options])`
|
|
28
51
|
|
|
29
|
-
|
|
52
|
+
<!-- YAML
|
|
53
|
+
added: v4.8.0
|
|
54
|
+
changes:
|
|
55
|
+
- version: v4.15.0
|
|
56
|
+
pr-url: https://github.com/nodejs/undici/pull/1237
|
|
57
|
+
description: Added the `factory` option.
|
|
58
|
+
-->
|
|
30
59
|
|
|
31
|
-
|
|
60
|
+
* `upstreams` {URL|string|URL[]|string[]} One or more upstream origins. Each
|
|
61
|
+
value should only include the **protocol, hostname, and port**. **Default:**
|
|
62
|
+
`[]`.
|
|
63
|
+
* `options` {BalancedPoolOptions} (optional)
|
|
32
64
|
|
|
33
|
-
|
|
65
|
+
The options passed to the constructor are forwarded to every {Pool} instance
|
|
66
|
+
that is created for an upstream.
|
|
34
67
|
|
|
35
|
-
|
|
68
|
+
#### Parameter: `BalancedPoolOptions`
|
|
36
69
|
|
|
37
|
-
|
|
70
|
+
Extends: {PoolOptions}
|
|
38
71
|
|
|
39
|
-
|
|
72
|
+
In addition to all {PoolOptions}, the following options are supported:
|
|
40
73
|
|
|
41
|
-
|
|
74
|
+
* `factory` {Function} A function used to create the {Pool} instance for each
|
|
75
|
+
upstream. **Default:** `(origin, opts) => new Pool(origin, opts)`.
|
|
76
|
+
* `origin` {URL|string} The upstream origin.
|
|
77
|
+
* `opts` {Object} The options object derived from the constructor options.
|
|
78
|
+
* Returns: {Dispatcher}
|
|
79
|
+
* `maxWeightPerServer` {number} The maximum weight any single upstream can
|
|
80
|
+
reach. Successful connections increase an upstream's weight up to this value.
|
|
81
|
+
**Default:** `100`.
|
|
82
|
+
* `errorPenalty` {number} The amount by which an upstream's weight is decreased
|
|
83
|
+
on a connection error and increased on a successful connection. **Default:**
|
|
84
|
+
`15`.
|
|
42
85
|
|
|
43
|
-
### `
|
|
86
|
+
### `balancedPool.addUpstream(upstream)`
|
|
44
87
|
|
|
45
|
-
|
|
88
|
+
<!-- YAML
|
|
89
|
+
added: v4.8.0
|
|
90
|
+
-->
|
|
46
91
|
|
|
47
|
-
|
|
92
|
+
* `upstream` {URL|string} The upstream origin to add. It should only include the
|
|
93
|
+
**protocol, hostname, and port**.
|
|
94
|
+
* Returns: {BalancedPool} The `BalancedPool` instance, for chaining.
|
|
48
95
|
|
|
49
|
-
|
|
96
|
+
Adds an upstream. If an open, non-destroyed upstream with the same origin is
|
|
97
|
+
already present, the call is a no-op.
|
|
50
98
|
|
|
51
|
-
### `
|
|
99
|
+
### `balancedPool.removeUpstream(upstream)`
|
|
52
100
|
|
|
53
|
-
|
|
101
|
+
<!-- YAML
|
|
102
|
+
added: v4.8.0
|
|
103
|
+
-->
|
|
54
104
|
|
|
55
|
-
|
|
105
|
+
* `upstream` {URL|string} The upstream origin to remove. It should only include
|
|
106
|
+
the **protocol, hostname, and port**.
|
|
107
|
+
* Returns: {BalancedPool} The `BalancedPool` instance, for chaining.
|
|
56
108
|
|
|
57
|
-
|
|
109
|
+
Removes an upstream that was previously added. If no matching upstream is found,
|
|
110
|
+
the call is a no-op.
|
|
58
111
|
|
|
59
|
-
### `
|
|
112
|
+
### `balancedPool.getUpstream(upstream)`
|
|
60
113
|
|
|
61
|
-
|
|
114
|
+
<!-- YAML
|
|
115
|
+
added: v7.17.0
|
|
116
|
+
-->
|
|
62
117
|
|
|
63
|
-
|
|
118
|
+
* `upstream` {URL|string} The upstream origin to look up. It should only include
|
|
119
|
+
the **protocol, hostname, and port**.
|
|
120
|
+
* Returns: {Pool|undefined} The {Pool} instance managing the given upstream, or
|
|
121
|
+
`undefined` if it is not present.
|
|
64
122
|
|
|
65
|
-
|
|
123
|
+
Returns the {Pool} instance for the given upstream origin, if it is open and not
|
|
124
|
+
destroyed.
|
|
66
125
|
|
|
67
|
-
### `
|
|
126
|
+
### `balancedPool.upstreams`
|
|
68
127
|
|
|
69
|
-
|
|
128
|
+
<!-- YAML
|
|
129
|
+
added: v4.8.0
|
|
130
|
+
-->
|
|
70
131
|
|
|
71
|
-
|
|
132
|
+
* Type: {string[]} The origins of the upstreams that are currently open and not
|
|
133
|
+
destroyed.
|
|
72
134
|
|
|
73
|
-
|
|
135
|
+
### `balancedPool.closed`
|
|
74
136
|
|
|
75
|
-
|
|
137
|
+
<!-- YAML
|
|
138
|
+
added: v4.8.0
|
|
139
|
+
changes:
|
|
140
|
+
- version: v4.10.4
|
|
141
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
142
|
+
description: Introduced the `BalancedPool` class.
|
|
143
|
+
-->
|
|
76
144
|
|
|
77
|
-
|
|
145
|
+
* Type: {boolean} `true` after `balancedPool.close()` has been called.
|
|
78
146
|
|
|
79
|
-
|
|
147
|
+
Implements [`client.closed`][].
|
|
80
148
|
|
|
81
|
-
|
|
149
|
+
### `balancedPool.destroyed`
|
|
82
150
|
|
|
83
|
-
|
|
151
|
+
<!-- YAML
|
|
152
|
+
added: v4.8.0
|
|
153
|
+
changes:
|
|
154
|
+
- version: v4.10.4
|
|
155
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
156
|
+
description: Introduced the `BalancedPool` class.
|
|
157
|
+
-->
|
|
84
158
|
|
|
85
|
-
|
|
159
|
+
* Type: {boolean} `true` after `balancedPool.destroy()` has been called, or after
|
|
160
|
+
`balancedPool.close()` has been called and the shutdown has completed.
|
|
86
161
|
|
|
87
|
-
|
|
162
|
+
Implements [`client.destroyed`][].
|
|
163
|
+
|
|
164
|
+
### `balancedPool.stats`
|
|
165
|
+
|
|
166
|
+
<!-- YAML
|
|
167
|
+
added: v4.8.0
|
|
168
|
+
-->
|
|
169
|
+
|
|
170
|
+
* Type: {PoolStats}
|
|
171
|
+
|
|
172
|
+
Returns a {PoolStats} instance aggregating the statistics of the underlying
|
|
173
|
+
pools.
|
|
174
|
+
|
|
175
|
+
### `balancedPool.close([callback])`
|
|
176
|
+
|
|
177
|
+
<!-- YAML
|
|
178
|
+
added: v4.8.0
|
|
179
|
+
-->
|
|
180
|
+
|
|
181
|
+
Implements [`Dispatcher.close([callback])`][].
|
|
182
|
+
|
|
183
|
+
### `balancedPool.destroy([error[, callback]])`
|
|
184
|
+
|
|
185
|
+
<!-- YAML
|
|
186
|
+
added: v4.8.0
|
|
187
|
+
-->
|
|
188
|
+
|
|
189
|
+
Implements [`Dispatcher.destroy([error, callback])`][].
|
|
190
|
+
|
|
191
|
+
### `balancedPool.connect(options[, callback])`
|
|
192
|
+
|
|
193
|
+
<!-- YAML
|
|
194
|
+
added: v4.8.0
|
|
195
|
+
-->
|
|
196
|
+
|
|
197
|
+
See [`Dispatcher.connect(options[, callback])`][].
|
|
198
|
+
|
|
199
|
+
### `balancedPool.dispatch(options, handlers)`
|
|
200
|
+
|
|
201
|
+
<!-- YAML
|
|
202
|
+
added: v4.8.0
|
|
203
|
+
changes:
|
|
204
|
+
- version: v4.10.4
|
|
205
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
206
|
+
description: Introduced the `BalancedPool` class.
|
|
207
|
+
-->
|
|
208
|
+
|
|
209
|
+
Implements [`Dispatcher.dispatch(options, handler)`][].
|
|
210
|
+
|
|
211
|
+
### `balancedPool.pipeline(options, handler)`
|
|
212
|
+
|
|
213
|
+
<!-- YAML
|
|
214
|
+
added: v4.8.0
|
|
215
|
+
-->
|
|
216
|
+
|
|
217
|
+
See [`Dispatcher.pipeline(options, handler)`][].
|
|
218
|
+
|
|
219
|
+
### `balancedPool.request(options[, callback])`
|
|
220
|
+
|
|
221
|
+
<!-- YAML
|
|
222
|
+
added: v4.8.0
|
|
223
|
+
-->
|
|
224
|
+
|
|
225
|
+
See [`Dispatcher.request(options[, callback])`][].
|
|
226
|
+
|
|
227
|
+
### `balancedPool.stream(options, factory[, callback])`
|
|
228
|
+
|
|
229
|
+
<!-- YAML
|
|
230
|
+
added: v4.8.0
|
|
231
|
+
-->
|
|
232
|
+
|
|
233
|
+
See [`Dispatcher.stream(options, factory[, callback])`][].
|
|
234
|
+
|
|
235
|
+
### `balancedPool.upgrade(options[, callback])`
|
|
236
|
+
|
|
237
|
+
<!-- YAML
|
|
238
|
+
added: v4.8.0
|
|
239
|
+
-->
|
|
240
|
+
|
|
241
|
+
See [`Dispatcher.upgrade(options[, callback])`][].
|
|
88
242
|
|
|
89
243
|
### Event: `'connect'`
|
|
90
244
|
|
|
91
|
-
|
|
245
|
+
<!-- YAML
|
|
246
|
+
added: v4.8.0
|
|
247
|
+
changes:
|
|
248
|
+
- version: v4.10.4
|
|
249
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
250
|
+
description: Introduced the `BalancedPool` class.
|
|
251
|
+
- version: v5.8.0
|
|
252
|
+
pr-url: https://github.com/nodejs/undici/pull/1069
|
|
253
|
+
description: Adopted weighted round-robin selection across upstreams.
|
|
254
|
+
-->
|
|
255
|
+
|
|
256
|
+
See [Dispatcher Event: `'connect'`][].
|
|
92
257
|
|
|
93
258
|
### Event: `'disconnect'`
|
|
94
259
|
|
|
95
|
-
|
|
260
|
+
<!-- YAML
|
|
261
|
+
added: v4.8.0
|
|
262
|
+
changes:
|
|
263
|
+
- version: v4.10.4
|
|
264
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
265
|
+
description: Introduced the `BalancedPool` class.
|
|
266
|
+
- version: v5.8.0
|
|
267
|
+
pr-url: https://github.com/nodejs/undici/pull/1069
|
|
268
|
+
description: Adopted weighted round-robin selection across upstreams.
|
|
269
|
+
-->
|
|
270
|
+
|
|
271
|
+
See [Dispatcher Event: `'disconnect'`][].
|
|
96
272
|
|
|
97
273
|
### Event: `'drain'`
|
|
98
274
|
|
|
99
|
-
|
|
275
|
+
<!-- YAML
|
|
276
|
+
added: v4.8.0
|
|
277
|
+
changes:
|
|
278
|
+
- version: v4.10.4
|
|
279
|
+
pr-url: https://github.com/nodejs/undici/pull/1114
|
|
280
|
+
description: Introduced the `BalancedPool` class.
|
|
281
|
+
-->
|
|
282
|
+
|
|
283
|
+
See [Dispatcher Event: `'drain'`][].
|
|
284
|
+
|
|
285
|
+
[Dispatcher Event: `'connect'`]: Dispatcher.md#event-connect
|
|
286
|
+
[Dispatcher Event: `'disconnect'`]: Dispatcher.md#event-disconnect
|
|
287
|
+
[Dispatcher Event: `'drain'`]: Dispatcher.md#event-drain
|
|
288
|
+
[`Dispatcher.close([callback])`]: Dispatcher.md#dispatcherclosecallback-promise
|
|
289
|
+
[`Dispatcher.connect(options[, callback])`]: Dispatcher.md#dispatcherconnectoptions-callback
|
|
290
|
+
[`Dispatcher.destroy([error, callback])`]: Dispatcher.md#dispatcherdestroyerror-callback-promise
|
|
291
|
+
[`Dispatcher.dispatch(options, handler)`]: Dispatcher.md#dispatcherdispatchoptions-handler
|
|
292
|
+
[`Dispatcher.pipeline(options, handler)`]: Dispatcher.md#dispatcherpipelineoptions-handler
|
|
293
|
+
[`Dispatcher.request(options[, callback])`]: Dispatcher.md#dispatcherrequestoptions-callback
|
|
294
|
+
[`Dispatcher.stream(options, factory[, callback])`]: Dispatcher.md#dispatcherstreamoptions-factory-callback
|
|
295
|
+
[`Dispatcher.upgrade(options[, callback])`]: Dispatcher.md#dispatcherupgradeoptions-callback
|
|
296
|
+
[`client.closed`]: Client.md#clientclosed
|
|
297
|
+
[`client.destroyed`]: Client.md#clientdestroyed
|
|
@@ -1,30 +1,188 @@
|
|
|
1
1
|
# CacheStorage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!--introduced_in=v5.22.1-->
|
|
4
|
+
<!--type=module-->
|
|
5
|
+
<!-- source_link=lib/web/cache/cachestorage.js -->
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
> Stability: 2 - Stable
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
undici provides a spec-compliant implementation of the [W3C Service Worker
|
|
10
|
+
`CacheStorage`][] and [`Cache`][] interfaces. A `CacheStorage` is a named
|
|
11
|
+
collection of [`Cache`][] objects, each of which stores `Request`/`Response`
|
|
12
|
+
pairs.
|
|
13
|
+
|
|
14
|
+
The class itself is not exported; instead, undici exposes a single shared
|
|
15
|
+
`CacheStorage` instance named `caches`. Import it from `'undici'`:
|
|
16
|
+
|
|
17
|
+
```mjs
|
|
18
|
+
import { caches } from 'undici'
|
|
19
|
+
|
|
20
|
+
const cache = await caches.open('v1')
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```cjs
|
|
24
|
+
const { caches } = require('undici')
|
|
25
|
+
|
|
26
|
+
caches.open('v1').then((cache) => {
|
|
27
|
+
// ...
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## `caches`
|
|
32
|
+
|
|
33
|
+
<!-- YAML
|
|
34
|
+
added: v5.22.1
|
|
35
|
+
-->
|
|
36
|
+
|
|
37
|
+
* Type: {CacheStorage}
|
|
38
|
+
|
|
39
|
+
The shared [`CacheStorage`](#class-cachestorage) instance exported by undici.
|
|
40
|
+
All caches opened through `caches` live for the lifetime of the process.
|
|
41
|
+
|
|
42
|
+
```mjs
|
|
43
|
+
import { caches } from 'undici'
|
|
44
|
+
|
|
45
|
+
await caches.open('v1')
|
|
46
|
+
console.log(await caches.keys()) // ['v1']
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Class: `CacheStorage`
|
|
50
|
+
|
|
51
|
+
<!-- YAML
|
|
52
|
+
added: v5.22.1
|
|
53
|
+
-->
|
|
54
|
+
|
|
55
|
+
Represents the storage for [`Cache`][] objects. Each `CacheStorage` keeps a
|
|
56
|
+
mapping of cache names to their backing list of cached responses.
|
|
57
|
+
|
|
58
|
+
The constructor is not public: attempting to instantiate `CacheStorage`
|
|
59
|
+
directly throws a `TypeError`. Use the exported [`caches`](#caches) instance
|
|
60
|
+
instead.
|
|
61
|
+
|
|
62
|
+
### `caches.match(request[, options])`
|
|
63
|
+
|
|
64
|
+
<!-- YAML
|
|
65
|
+
added: v5.22.1
|
|
66
|
+
-->
|
|
67
|
+
|
|
68
|
+
* `request` {Request|string} The request to match against. A string is treated
|
|
69
|
+
as a URL.
|
|
70
|
+
* `options` {Object} (optional)
|
|
71
|
+
* `ignoreSearch` {boolean} When `true`, ignores the query string of the URL
|
|
72
|
+
when matching. **Default:** `false`.
|
|
73
|
+
* `ignoreMethod` {boolean} When `true`, prevents matching operations from
|
|
74
|
+
validating the `Request` `http` method. **Default:** `false`.
|
|
75
|
+
* `ignoreVary` {boolean} When `true`, ignores the `Vary` header when matching.
|
|
76
|
+
**Default:** `false`.
|
|
77
|
+
* `cacheName` {string} When set, restricts the search to the cache with this
|
|
78
|
+
name. **Default:** `undefined`.
|
|
79
|
+
* Returns: {Promise} Fulfills with the first matching {Response}, or
|
|
80
|
+
`undefined` if no response matched.
|
|
81
|
+
|
|
82
|
+
Searches the caches for a response matching `request`. When `options.cacheName`
|
|
83
|
+
is provided, only that cache is searched; otherwise every cache is searched in
|
|
84
|
+
insertion order and the first match is returned.
|
|
85
|
+
|
|
86
|
+
```mjs
|
|
87
|
+
import { caches } from 'undici'
|
|
88
|
+
|
|
89
|
+
const response = await caches.match('https://example.com/data', {
|
|
90
|
+
cacheName: 'v1'
|
|
91
|
+
})
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `caches.has(cacheName)`
|
|
95
|
+
|
|
96
|
+
<!-- YAML
|
|
97
|
+
added: v5.22.1
|
|
98
|
+
-->
|
|
99
|
+
|
|
100
|
+
* `cacheName` {string} The name of the cache to look up.
|
|
101
|
+
* Returns: {Promise} Fulfills with `true` if a cache named `cacheName` exists,
|
|
102
|
+
otherwise `false`.
|
|
103
|
+
|
|
104
|
+
Checks whether a cache with the given name exists in the storage.
|
|
105
|
+
|
|
106
|
+
```mjs
|
|
107
|
+
import { caches } from 'undici'
|
|
108
|
+
|
|
109
|
+
await caches.open('v1')
|
|
110
|
+
console.log(await caches.has('v1')) // true
|
|
111
|
+
console.log(await caches.has('v2')) // false
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### `caches.open(cacheName)`
|
|
115
|
+
|
|
116
|
+
<!-- YAML
|
|
117
|
+
added: v5.22.1
|
|
118
|
+
-->
|
|
119
|
+
|
|
120
|
+
* `cacheName` {string} The name of the cache to open.
|
|
121
|
+
* Returns: {Promise} Fulfills with the {Cache} named `cacheName`.
|
|
122
|
+
|
|
123
|
+
Opens the cache named `cacheName`, creating it if it does not already exist.
|
|
124
|
+
|
|
125
|
+
Each call returns a new [`Cache`][] object, but caches opened with the same name
|
|
126
|
+
share their underlying list of cached responses. As a result, a response stored
|
|
127
|
+
through one instance is visible through another instance with the same name.
|
|
8
128
|
|
|
9
129
|
```mjs
|
|
10
130
|
import { caches } from 'undici'
|
|
131
|
+
import assert from 'node:assert'
|
|
11
132
|
|
|
12
|
-
const
|
|
13
|
-
const
|
|
133
|
+
const cache1 = await caches.open('v1')
|
|
134
|
+
const cache2 = await caches.open('v1')
|
|
14
135
|
|
|
15
|
-
//
|
|
16
|
-
assert(
|
|
17
|
-
//
|
|
18
|
-
assert.deepStrictEqual(await
|
|
136
|
+
// open() returns distinct objects,
|
|
137
|
+
assert(cache1 !== cache2)
|
|
138
|
+
// but they share the same cached responses.
|
|
139
|
+
assert.deepStrictEqual(await cache1.match('/req'), await cache2.match('/req'))
|
|
19
140
|
```
|
|
20
141
|
|
|
21
|
-
|
|
142
|
+
### `caches.delete(cacheName)`
|
|
22
143
|
|
|
23
|
-
|
|
144
|
+
<!-- YAML
|
|
145
|
+
added: v5.22.1
|
|
146
|
+
-->
|
|
147
|
+
|
|
148
|
+
* `cacheName` {string} The name of the cache to delete.
|
|
149
|
+
* Returns: {Promise} Fulfills with `true` if the cache existed and was deleted,
|
|
150
|
+
otherwise `false`.
|
|
151
|
+
|
|
152
|
+
Removes the cache named `cacheName` from the storage. Any [`Cache`][] objects
|
|
153
|
+
already obtained for that name, along with the `Request`/`Response` pairs they
|
|
154
|
+
returned, remain usable after deletion.
|
|
24
155
|
|
|
25
156
|
```mjs
|
|
26
|
-
|
|
157
|
+
import { caches } from 'undici'
|
|
158
|
+
|
|
159
|
+
const cache = await caches.open('v1')
|
|
160
|
+
const response = await cache.match('/req')
|
|
161
|
+
|
|
27
162
|
await caches.delete('v1')
|
|
28
163
|
|
|
29
|
-
|
|
164
|
+
// The already-retrieved response is still usable.
|
|
165
|
+
await response.text()
|
|
30
166
|
```
|
|
167
|
+
|
|
168
|
+
### `caches.keys()`
|
|
169
|
+
|
|
170
|
+
<!-- YAML
|
|
171
|
+
added: v5.22.1
|
|
172
|
+
-->
|
|
173
|
+
|
|
174
|
+
* Returns: {Promise} Fulfills with a {string[]} of cache names in insertion
|
|
175
|
+
order.
|
|
176
|
+
|
|
177
|
+
Returns the names of all caches currently held by the storage.
|
|
178
|
+
|
|
179
|
+
```mjs
|
|
180
|
+
import { caches } from 'undici'
|
|
181
|
+
|
|
182
|
+
await caches.open('v1')
|
|
183
|
+
await caches.open('v2')
|
|
184
|
+
console.log(await caches.keys()) // ['v1', 'v2']
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
[W3C Service Worker `CacheStorage`]: https://w3c.github.io/ServiceWorker/#cachestorage-interface
|
|
188
|
+
[`Cache`]: https://w3c.github.io/ServiceWorker/#cache-interface
|