@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,164 +1,360 @@
|
|
|
1
1
|
# Cache Store
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[RFC-9111](https://www.rfc-editor.org/rfc/rfc9111.html).
|
|
3
|
+
<!--introduced_in=v7.0.0-->
|
|
4
|
+
<!--type=module-->
|
|
5
|
+
<!-- source_link=lib/cache/memory-cache-store.js -->
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
> Stability: 2 - Stable
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
A cache store is the storage backend used by the cache interceptor to persist
|
|
10
|
+
and retrieve cached responses. A store decides which stored response to serve
|
|
11
|
+
for a request by comparing the request against the response's `Vary` header, and
|
|
12
|
+
is expected to be compliant with [RFC 9111][].
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
undici ships two stores. `MemoryCacheStore` keeps responses in memory, while
|
|
15
|
+
`SqliteCacheStore` persists them to a SQLite database. Both are available under
|
|
16
|
+
the `cacheStores` export:
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
```mjs
|
|
19
|
+
import { cacheStores } from 'undici'
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
const { MemoryCacheStore, SqliteCacheStore } = cacheStores
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`SqliteCacheStore` requires the [`node:sqlite`][] API. The class is always
|
|
25
|
+
exported, but constructing one throws if `node:sqlite` is not available in the
|
|
26
|
+
running Node.js version.
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
A cache store implements three methods — `get(key)`, `createWriteStream(key,
|
|
29
|
+
value)`, and `delete(key)` — that operate on a [`CacheKey`](#cachekey) and a
|
|
30
|
+
[`CacheValue`](#cachevalue). Any object implementing this contract can be passed
|
|
31
|
+
to the cache interceptor, so custom stores (for example, backed by Redis or a
|
|
32
|
+
remote service) are supported as well.
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
## Class: `MemoryCacheStore`
|
|
23
35
|
|
|
24
|
-
|
|
36
|
+
<!-- YAML
|
|
37
|
+
added: v7.0.0
|
|
38
|
+
-->
|
|
25
39
|
|
|
26
|
-
|
|
40
|
+
* Extends: {EventEmitter}
|
|
27
41
|
|
|
28
|
-
|
|
42
|
+
Stores cached responses in memory. The store enforces upper bounds on the total
|
|
43
|
+
number of responses, the total size of all responses, and the size of any single
|
|
44
|
+
response. When a limit is exceeded, the store evicts approximately half of its
|
|
45
|
+
entries and emits a [`'maxSizeExceeded'`](#event-maxsizeexceeded) event.
|
|
29
46
|
|
|
30
|
-
|
|
47
|
+
```mjs
|
|
48
|
+
import { interceptors, cacheStores, Agent, setGlobalDispatcher } from 'undici'
|
|
31
49
|
|
|
32
|
-
|
|
50
|
+
const store = new cacheStores.MemoryCacheStore({ maxSize: 50 * 1024 * 1024 })
|
|
51
|
+
|
|
52
|
+
setGlobalDispatcher(
|
|
53
|
+
new Agent().compose(interceptors.cache({ store }))
|
|
54
|
+
)
|
|
55
|
+
```
|
|
33
56
|
|
|
34
|
-
|
|
57
|
+
### `new MemoryCacheStore([options])`
|
|
35
58
|
|
|
36
|
-
|
|
59
|
+
<!-- YAML
|
|
60
|
+
added: v7.0.0
|
|
61
|
+
-->
|
|
37
62
|
|
|
63
|
+
* `options` {Object} (optional)
|
|
64
|
+
* `maxCount` {number} The maximum number of responses to store. **Default:**
|
|
65
|
+
`1024`.
|
|
66
|
+
* `maxSize` {number} The maximum total size, in bytes, of all stored
|
|
67
|
+
responses. **Default:** `104857600` (100 MiB).
|
|
68
|
+
* `maxEntrySize` {number} The maximum size, in bytes, of a single response
|
|
69
|
+
body. Responses whose body exceeds this value are not cached. **Default:**
|
|
70
|
+
`5242880` (5 MiB).
|
|
71
|
+
* `errorCallback` {Function} A callback invoked with any error raised by the
|
|
72
|
+
store. (optional)
|
|
73
|
+
* `err` {Error}
|
|
38
74
|
|
|
39
|
-
|
|
75
|
+
Each of `maxCount`, `maxSize`, and `maxEntrySize` must be a non-negative
|
|
76
|
+
integer; a `TypeError` is thrown otherwise.
|
|
40
77
|
|
|
41
|
-
|
|
42
|
-
Under the hood, it uses Node.js' [`node:sqlite`](https://nodejs.org/api/sqlite.html) api.
|
|
43
|
-
The `SqliteCacheStore` is only exposed if the `node:sqlite` api is present.
|
|
78
|
+
### `memoryCacheStore.size`
|
|
44
79
|
|
|
45
|
-
|
|
80
|
+
<!-- YAML
|
|
81
|
+
added: v7.0.0
|
|
82
|
+
-->
|
|
46
83
|
|
|
47
|
-
|
|
48
|
-
- `maxCount` - The maximum number of entries to store in the database. Default `Infinity`.
|
|
49
|
-
- `maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`.
|
|
84
|
+
* Type: {number}
|
|
50
85
|
|
|
51
|
-
|
|
86
|
+
The current total size, in bytes, of all stored response bodies.
|
|
52
87
|
|
|
53
|
-
|
|
88
|
+
### `memoryCacheStore.isFull()`
|
|
54
89
|
|
|
55
|
-
|
|
90
|
+
<!-- YAML
|
|
91
|
+
added: v7.0.0
|
|
92
|
+
-->
|
|
56
93
|
|
|
57
|
-
|
|
58
|
-
|
|
94
|
+
* Returns: {boolean} `true` when the store has reached its `maxSize` or
|
|
95
|
+
`maxCount` limit, `false` otherwise.
|
|
59
96
|
|
|
60
|
-
###
|
|
97
|
+
### `memoryCacheStore.get(key)`
|
|
61
98
|
|
|
62
|
-
|
|
99
|
+
<!-- YAML
|
|
100
|
+
added: v7.0.0
|
|
101
|
+
-->
|
|
63
102
|
|
|
64
|
-
*
|
|
103
|
+
* `key` {CacheKey} The request to look up. See [`CacheKey`](#cachekey).
|
|
104
|
+
* Returns: {GetResult|undefined} The matching cached response, or `undefined`
|
|
105
|
+
when there is no fresh entry for `key`. See [`GetResult`](#getresult).
|
|
65
106
|
|
|
66
|
-
|
|
67
|
-
|
|
107
|
+
Looks up a cached response for `key`. A stored entry matches only when its
|
|
108
|
+
`method` equals `key.method`, its `deleteAt` time is in the future, and every
|
|
109
|
+
header listed in its `vary` map matches the corresponding header in
|
|
110
|
+
`key.headers`.
|
|
68
111
|
|
|
69
|
-
|
|
112
|
+
### `memoryCacheStore.createWriteStream(key, value)`
|
|
70
113
|
|
|
71
|
-
|
|
114
|
+
<!-- YAML
|
|
115
|
+
added: v7.0.0
|
|
116
|
+
-->
|
|
72
117
|
|
|
73
|
-
*
|
|
74
|
-
|
|
118
|
+
* `key` {CacheKey} The request the response is being cached for. See
|
|
119
|
+
[`CacheKey`](#cachekey).
|
|
120
|
+
* `value` {CacheValue} The response metadata to store. See
|
|
121
|
+
[`CacheValue`](#cachevalue).
|
|
122
|
+
* Returns: {Writable|undefined} A writable stream that the response body is
|
|
123
|
+
written to, or `undefined` when the response cannot be cached.
|
|
75
124
|
|
|
76
|
-
|
|
125
|
+
Returns a {Writable} stream used to write the response body into the store. When
|
|
126
|
+
the stream finishes, the entry is committed; if its accumulated size exceeds
|
|
127
|
+
`maxEntrySize`, the stream is destroyed and nothing is stored. Writing a new
|
|
128
|
+
entry whose `key` matches an existing one replaces that entry.
|
|
77
129
|
|
|
78
|
-
|
|
130
|
+
### `memoryCacheStore.delete(key)`
|
|
79
131
|
|
|
80
|
-
|
|
81
|
-
|
|
132
|
+
<!-- YAML
|
|
133
|
+
added: v7.0.0
|
|
134
|
+
-->
|
|
82
135
|
|
|
83
|
-
|
|
136
|
+
* `key` {CacheKey} The request whose cached responses should be removed. See
|
|
137
|
+
[`CacheKey`](#cachekey).
|
|
138
|
+
* Returns: {undefined}
|
|
84
139
|
|
|
85
|
-
|
|
140
|
+
Removes every cached response stored for `key.origin` and `key.path`. Throws a
|
|
141
|
+
`TypeError` if `key` is not an object.
|
|
86
142
|
|
|
87
|
-
|
|
143
|
+
### Event: `'maxSizeExceeded'`
|
|
88
144
|
|
|
89
|
-
|
|
145
|
+
<!-- YAML
|
|
146
|
+
added: v7.10.0
|
|
147
|
+
-->
|
|
90
148
|
|
|
91
|
-
`
|
|
149
|
+
* `data` {Object}
|
|
150
|
+
* `size` {number} The current total size, in bytes, of all stored responses.
|
|
151
|
+
* `maxSize` {number} The configured `maxSize` limit.
|
|
152
|
+
* `count` {number} The current number of stored responses.
|
|
153
|
+
* `maxCount` {number} The configured `maxCount` limit.
|
|
92
154
|
|
|
93
|
-
|
|
155
|
+
Emitted when the store exceeds its `maxSize` or `maxCount` limit, immediately
|
|
156
|
+
before entries are evicted. The event fires only once per overflow; it is not
|
|
157
|
+
emitted again until the store drops back below both limits.
|
|
94
158
|
|
|
95
|
-
`
|
|
159
|
+
## Class: `SqliteCacheStore`
|
|
96
160
|
|
|
97
|
-
|
|
161
|
+
<!-- YAML
|
|
162
|
+
added: v7.0.0
|
|
163
|
+
-->
|
|
98
164
|
|
|
99
|
-
`
|
|
165
|
+
Stores cached responses in a SQLite database using the [`node:sqlite`][] API.
|
|
166
|
+
The constructor throws when [`node:sqlite`][] is not available.
|
|
100
167
|
|
|
101
|
-
|
|
168
|
+
```mjs
|
|
169
|
+
import { interceptors, cacheStores, Agent, setGlobalDispatcher } from 'undici'
|
|
102
170
|
|
|
103
|
-
|
|
104
|
-
and their respective values for later comparison. Values are `null` when the
|
|
105
|
-
header specified in `Vary` was not present in the original request. These `null`
|
|
106
|
-
values are automatically filtered out during revalidation so they are not sent
|
|
107
|
-
as request headers.
|
|
171
|
+
const store = new cacheStores.SqliteCacheStore({ location: './cache.db' })
|
|
108
172
|
|
|
109
|
-
|
|
173
|
+
setGlobalDispatcher(
|
|
174
|
+
new Agent().compose(interceptors.cache({ store }))
|
|
175
|
+
)
|
|
110
176
|
```
|
|
111
|
-
|
|
177
|
+
|
|
178
|
+
### `new SqliteCacheStore([options])`
|
|
179
|
+
|
|
180
|
+
<!-- YAML
|
|
181
|
+
added: v7.0.0
|
|
182
|
+
-->
|
|
183
|
+
|
|
184
|
+
* `options` {Object} (optional)
|
|
185
|
+
* `location` {string} The location of the SQLite database. Use `':memory:'`
|
|
186
|
+
for an in-memory database. **Default:** `':memory:'`.
|
|
187
|
+
* `maxCount` {number} The maximum number of responses to store. **Default:**
|
|
188
|
+
`Infinity`.
|
|
189
|
+
* `maxEntrySize` {number} The maximum size, in bytes, of a single response
|
|
190
|
+
body. Responses whose body exceeds this value are not cached. Must not
|
|
191
|
+
exceed `2000000000` (2 GB). **Default:** `2000000000` (2 GB).
|
|
192
|
+
|
|
193
|
+
`maxCount` and `maxEntrySize` must be non-negative integers; a `TypeError` is
|
|
194
|
+
thrown otherwise, or if `maxEntrySize` is greater than 2 GB.
|
|
195
|
+
|
|
196
|
+
### `sqliteCacheStore.close()`
|
|
197
|
+
|
|
198
|
+
<!-- YAML
|
|
199
|
+
added: v7.0.0
|
|
200
|
+
-->
|
|
201
|
+
|
|
202
|
+
* Returns: {undefined}
|
|
203
|
+
|
|
204
|
+
Closes the connection to the underlying SQLite database.
|
|
205
|
+
|
|
206
|
+
### `sqliteCacheStore.size`
|
|
207
|
+
|
|
208
|
+
<!-- YAML
|
|
209
|
+
added: v7.0.0
|
|
210
|
+
-->
|
|
211
|
+
|
|
212
|
+
* Type: {number}
|
|
213
|
+
|
|
214
|
+
The number of responses currently stored in the database.
|
|
215
|
+
|
|
216
|
+
### `sqliteCacheStore.get(key)`
|
|
217
|
+
|
|
218
|
+
<!-- YAML
|
|
219
|
+
added: v7.0.0
|
|
220
|
+
-->
|
|
221
|
+
|
|
222
|
+
* `key` {CacheKey} The request to look up. See [`CacheKey`](#cachekey).
|
|
223
|
+
* Returns: {GetResult|undefined} The matching cached response, or `undefined`
|
|
224
|
+
when there is no fresh entry for `key`. The returned `body` is a {Buffer}.
|
|
225
|
+
See [`GetResult`](#getresult).
|
|
226
|
+
|
|
227
|
+
Looks up a cached response for `key`, comparing the request method and every
|
|
228
|
+
header named in the stored `vary` map.
|
|
229
|
+
|
|
230
|
+
### `sqliteCacheStore.set(key, value)`
|
|
231
|
+
|
|
232
|
+
<!-- YAML
|
|
233
|
+
added: v7.0.0
|
|
234
|
+
-->
|
|
235
|
+
|
|
236
|
+
* `key` {CacheKey} The request the response is being cached for. See
|
|
237
|
+
[`CacheKey`](#cachekey).
|
|
238
|
+
* `value` {CacheValue} The response to store, with its `body` set to a {Buffer},
|
|
239
|
+
an {Array} of {Buffer}, or `null`. See [`CacheValue`](#cachevalue).
|
|
240
|
+
* Returns: {undefined}
|
|
241
|
+
|
|
242
|
+
Writes a response into the database directly, without going through a stream. If
|
|
243
|
+
the body exceeds `maxEntrySize`, nothing is stored. When an entry already exists
|
|
244
|
+
for `key` it is overwritten; otherwise a new row is inserted and old entries are
|
|
245
|
+
pruned to honour `maxCount`. This method is used internally by
|
|
246
|
+
[`sqliteCacheStore.createWriteStream()`](#sqlitecachestorecreatewritestreamkey-value).
|
|
247
|
+
|
|
248
|
+
### `sqliteCacheStore.createWriteStream(key, value)`
|
|
249
|
+
|
|
250
|
+
<!-- YAML
|
|
251
|
+
added: v7.0.0
|
|
252
|
+
-->
|
|
253
|
+
|
|
254
|
+
* `key` {CacheKey} The request the response is being cached for. See
|
|
255
|
+
[`CacheKey`](#cachekey).
|
|
256
|
+
* `value` {CacheValue} The response metadata to store. See
|
|
257
|
+
[`CacheValue`](#cachevalue).
|
|
258
|
+
* Returns: {Writable|undefined} A writable stream that the response body is
|
|
259
|
+
written to, or `undefined` when the response cannot be cached.
|
|
260
|
+
|
|
261
|
+
Returns a {Writable} stream used to write the response body into the store. When
|
|
262
|
+
the stream finishes, the buffered body is committed via
|
|
263
|
+
[`sqliteCacheStore.set()`](#sqlitecachestoresetkey-value). If the body exceeds
|
|
264
|
+
`maxEntrySize`, the stream is destroyed and nothing is stored.
|
|
265
|
+
|
|
266
|
+
### `sqliteCacheStore.delete(key)`
|
|
267
|
+
|
|
268
|
+
<!-- YAML
|
|
269
|
+
added: v7.0.0
|
|
270
|
+
-->
|
|
271
|
+
|
|
272
|
+
* `key` {CacheKey} The request whose cached responses should be removed. See
|
|
273
|
+
[`CacheKey`](#cachekey).
|
|
274
|
+
* Returns: {undefined}
|
|
275
|
+
|
|
276
|
+
Removes every cached response stored for the URL derived from `key.origin` and
|
|
277
|
+
`key.path`. Throws a `TypeError` if `key` is not an object.
|
|
278
|
+
|
|
279
|
+
## Implementing a custom cache store
|
|
280
|
+
|
|
281
|
+
A cache store is any object that implements the `CacheStore` interface:
|
|
282
|
+
|
|
283
|
+
* `get(key)` — Look up a response. Returns a [`GetResult`](#getresult),
|
|
284
|
+
`undefined`, or a {Promise} resolving to either.
|
|
285
|
+
* `createWriteStream(key, value)` — Return a {Writable} to receive the response
|
|
286
|
+
body, or `undefined` if the response cannot be stored.
|
|
287
|
+
* `delete(key)` — Remove all responses for `key`. May return a {Promise}.
|
|
288
|
+
|
|
289
|
+
Returning a {Promise} from `get` or `delete` lets a store be backed by an
|
|
290
|
+
asynchronous resource; the cache interceptor awaits these values, including on
|
|
291
|
+
the revalidation and stale-while-revalidate paths.
|
|
292
|
+
|
|
293
|
+
### `CacheKey`
|
|
294
|
+
|
|
295
|
+
The request a response is being looked up or stored for.
|
|
296
|
+
|
|
297
|
+
* `origin` {string} The request origin.
|
|
298
|
+
* `method` {string} The request method.
|
|
299
|
+
* `path` {string} The request path.
|
|
300
|
+
* `headers` {Record<string, string|string[]>} The request headers, used to
|
|
301
|
+
satisfy `Vary`. (optional)
|
|
302
|
+
|
|
303
|
+
### `CacheValue`
|
|
304
|
+
|
|
305
|
+
The metadata of a cached response, excluding its body.
|
|
306
|
+
|
|
307
|
+
* `statusCode` {number} The response's HTTP status code.
|
|
308
|
+
* `statusMessage` {string} The response's HTTP status message.
|
|
309
|
+
* `headers` {Record<string, string|string[]>} The response headers.
|
|
310
|
+
* `vary` {Record<string, string|string[]|null>} The header names listed in the
|
|
311
|
+
response's `Vary` header mapped to the values they had in the original
|
|
312
|
+
request. A value is `null` when that header was absent from the original
|
|
313
|
+
request. (optional)
|
|
314
|
+
* `etag` {string} The response's entity tag. (optional)
|
|
315
|
+
* `cacheControlDirectives` {Object} The parsed `Cache-Control` directives of the
|
|
316
|
+
response. (optional)
|
|
317
|
+
* `cachedAt` {number} The time, in milliseconds, at which the response was
|
|
318
|
+
cached.
|
|
319
|
+
* `staleAt` {number} The time, in milliseconds, at which the response becomes
|
|
320
|
+
stale.
|
|
321
|
+
* `deleteAt` {number} The time, in milliseconds, at which the response must be
|
|
322
|
+
evicted. A store must not return a response once this time has passed.
|
|
323
|
+
|
|
324
|
+
The `vary` map drives response selection. For a response such as:
|
|
325
|
+
|
|
326
|
+
```http
|
|
327
|
+
Vary: content-encoding, accept
|
|
112
328
|
content-encoding: utf8
|
|
113
|
-
|
|
329
|
+
accept: application/json
|
|
114
330
|
```
|
|
115
331
|
|
|
116
|
-
|
|
332
|
+
the recorded map is:
|
|
333
|
+
|
|
117
334
|
```js
|
|
118
335
|
{
|
|
119
336
|
'content-encoding': 'utf8',
|
|
120
|
-
|
|
337
|
+
accept: 'application/json'
|
|
121
338
|
}
|
|
122
339
|
```
|
|
123
340
|
|
|
124
|
-
If the original request did not include the `
|
|
341
|
+
If the original request did not include the `accept` header, its value is
|
|
342
|
+
recorded as `null`:
|
|
343
|
+
|
|
125
344
|
```js
|
|
126
345
|
{
|
|
127
346
|
'content-encoding': 'utf8',
|
|
128
|
-
|
|
347
|
+
accept: null
|
|
129
348
|
}
|
|
130
349
|
```
|
|
131
350
|
|
|
132
|
-
###
|
|
133
|
-
|
|
134
|
-
`number` - Time in millis that this value was cached.
|
|
135
|
-
|
|
136
|
-
### Property `staleAt`
|
|
137
|
-
|
|
138
|
-
`number` - Time in millis that this value is considered stale.
|
|
139
|
-
|
|
140
|
-
### Property `deleteAt`
|
|
141
|
-
|
|
142
|
-
`number` - Time in millis that this value is to be deleted from the cache. This
|
|
143
|
-
is either the same sa staleAt or the `max-stale` caching directive.
|
|
144
|
-
|
|
145
|
-
The store must not return a response after the time defined in this property.
|
|
146
|
-
|
|
147
|
-
## `CacheStoreReadable`
|
|
148
|
-
|
|
149
|
-
This extends Node's [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable)
|
|
150
|
-
and defines extra properties relevant to the cache interceptor.
|
|
151
|
-
|
|
152
|
-
### Getter: `value`
|
|
153
|
-
|
|
154
|
-
The response's [`CacheStoreValue`](/docs/docs/api/CacheStore.md#cachestorevalue)
|
|
155
|
-
|
|
156
|
-
## `CacheStoreWriteable`
|
|
351
|
+
### `GetResult`
|
|
157
352
|
|
|
158
|
-
|
|
159
|
-
|
|
353
|
+
The value returned by `get`. It contains every field of
|
|
354
|
+
[`CacheValue`](#cachevalue) plus the response body.
|
|
160
355
|
|
|
161
|
-
|
|
356
|
+
* `body` {Readable|Iterable|AsyncIterable|Buffer|string} The cached response
|
|
357
|
+
body. (optional)
|
|
162
358
|
|
|
163
|
-
|
|
164
|
-
|
|
359
|
+
[RFC 9111]: https://www.rfc-editor.org/rfc/rfc9111.html
|
|
360
|
+
[`node:sqlite`]: https://nodejs.org/api/sqlite.html
|