diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4095ae7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "monthly" + groups: + patch-dependencies: + update-types: + - "patch" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" \ No newline at end of file diff --git a/.github/workflows/auto-merge.yaml b/.github/workflows/auto-merge.yaml new file mode 100644 index 0000000..f178745 --- /dev/null +++ b/.github/workflows/auto-merge.yaml @@ -0,0 +1,26 @@ +name: Dependabot auto-merge + +# Taken and adapted rom: +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request + +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2 + id: metadata + + - name: Enable auto-merge for Dependabot PRs + if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..acba330 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,22 @@ +name: CI + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + name: Build + + steps: + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm ci + - run: npm test \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fbabc80 --- /dev/null +++ b/.gitignore @@ -0,0 +1,148 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node +# Edit at https://www.toptal.com/developers/gitignore?templates=node + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +# End of https://www.toptal.com/developers/gitignore/api/node + +# ignore IDE folders +.vscode/ +.idea/ diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..b55aa46 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v2 +inputs: + - directory: proto +plugins: + - local: protoc-gen-es + opt: target=ts + out: src/gen + - local: protoc-gen-connect-es + out: gen + opt: target=ts \ No newline at end of file diff --git a/gen/v1/run_function_connect.ts b/gen/v1/run_function_connect.ts new file mode 100644 index 0000000..c93c99d --- /dev/null +++ b/gen/v1/run_function_connect.ts @@ -0,0 +1,45 @@ +// +//Copyright 2022 The Crossplane Authors. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file v1/run_function.proto (package apiextensions.fn.proto.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { RunFunctionRequest, RunFunctionResponse } from "./run_function_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * A FunctionRunnerService is a Composition Function. + * + * @generated from service apiextensions.fn.proto.v1.FunctionRunnerService + */ +export const FunctionRunnerService = { + typeName: "apiextensions.fn.proto.v1.FunctionRunnerService", + methods: { + /** + * RunFunction runs the Composition Function. + * + * @generated from rpc apiextensions.fn.proto.v1.FunctionRunnerService.RunFunction + */ + runFunction: { + name: "RunFunction", + I: RunFunctionRequest, + O: RunFunctionResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/gen/v1beta1/run_function_connect.ts b/gen/v1beta1/run_function_connect.ts new file mode 100644 index 0000000..b94352b --- /dev/null +++ b/gen/v1beta1/run_function_connect.ts @@ -0,0 +1,47 @@ +// +//Copyright 2022 The Crossplane Authors. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file v1beta1/run_function.proto (package apiextensions.fn.proto.v1beta1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +// Generated from apiextensions/fn/proto/v1/run_function.proto by ../hack/duplicate_proto_type.sh. DO NOT EDIT. + +import { RunFunctionRequest, RunFunctionResponse } from "./run_function_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * A FunctionRunnerService is a Composition Function. + * + * @generated from service apiextensions.fn.proto.v1beta1.FunctionRunnerService + */ +export const FunctionRunnerService = { + typeName: "apiextensions.fn.proto.v1beta1.FunctionRunnerService", + methods: { + /** + * RunFunction runs the Composition Function. + * + * @generated from rpc apiextensions.fn.proto.v1beta1.FunctionRunnerService.RunFunction + */ + runFunction: { + name: "RunFunction", + I: RunFunctionRequest, + O: RunFunctionResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a893b1a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,897 @@ +{ + "name": "function-sdk-typescript", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@connectrpc/connect-fastify": "^1.4.0", + "@connectrpc/connect-node": "^1.4.0", + "fastify": "^4.28.1" + }, + "devDependencies": { + "@bufbuild/buf": "^1.39.0", + "@bufbuild/protobuf": "^1.10.0", + "@bufbuild/protoc-gen-es": "^1.10.0", + "@connectrpc/connect": "^1.4.0", + "@connectrpc/protoc-gen-connect-es": "^1.4.0", + "typescript": "^5.5.4" + } + }, + "node_modules/@bufbuild/buf": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.39.0.tgz", + "integrity": "sha512-lm7xb9pc7X04rRjCQ69o9byAAZ7/dsUQGoH+iJ9uBSXQWiwQ1Ts8gneBnuUVsAH2vdW73NFBpmNQGE9XtFauVQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "buf": "bin/buf", + "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", + "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@bufbuild/buf-darwin-arm64": "1.39.0", + "@bufbuild/buf-darwin-x64": "1.39.0", + "@bufbuild/buf-linux-aarch64": "1.39.0", + "@bufbuild/buf-linux-x64": "1.39.0", + "@bufbuild/buf-win32-arm64": "1.39.0", + "@bufbuild/buf-win32-x64": "1.39.0" + } + }, + "node_modules/@bufbuild/buf-darwin-arm64": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.39.0.tgz", + "integrity": "sha512-Ptl0uAGssLxQTzoZhGwv1FFTbzUfcstIpEwMhN+XrwiuqsSxOg9eq/n3yXoci5VJsHokjDUHnWkR3y+j5P/5KA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-darwin-x64": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.39.0.tgz", + "integrity": "sha512-XNCuy9sjQwVJ4NIZqxaTIyzUtlyquSkp/Uuoh5W5thJ3nzZ5RSgvXKF5iXHhZmesrfRGApktwoCx5Am8runsfQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-aarch64": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.39.0.tgz", + "integrity": "sha512-Am+hrw94awp/eY027ROXwRQBuwAzOpQ/4zI4dgmgsyhzeWZ8w1LWC8z2SSr8T2cqd0cm52KxtoWMW+B3b2qzbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-x64": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.39.0.tgz", + "integrity": "sha512-JXVkHoMrTvmpseqdoQPJJ6MRV7/vlloYtvXHHACEzVytYjljOYCNoVET/E5gLBco/edeXFMNc40cCi1KgL3rSw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-arm64": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.39.0.tgz", + "integrity": "sha512-akdGW02mo04wbLfjNMBQqxC4mPQ/L/vTU8/o79I67GSxyFYt7bKifvYIYhAA39C2gibHyB7ZLmoeRPbaU8wbYA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-x64": { + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.39.0.tgz", + "integrity": "sha512-jos08UMg9iUZsGjPrNpLXP+FNk6q6GizO+bjee/GcI0kSijIzXYMg14goQr0TKlvqs/+IRAM5vZIokQBYlAENQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/protobuf": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", + "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" + }, + "node_modules/@bufbuild/protoc-gen-es": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-1.10.0.tgz", + "integrity": "sha512-zBYBsVT/ul4uZb6F+kD7/k4sWNHVVbEPfJwKi0FDr+9VJo8MKIofI6pkr5ksBLr4fi/74r+e/75Xi/0clL5dXg==", + "dev": true, + "dependencies": { + "@bufbuild/protobuf": "^1.10.0", + "@bufbuild/protoplugin": "1.10.0" + }, + "bin": { + "protoc-gen-es": "bin/protoc-gen-es" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@bufbuild/protobuf": "1.10.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protobuf": { + "optional": true + } + } + }, + "node_modules/@bufbuild/protoplugin": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-1.10.0.tgz", + "integrity": "sha512-u6NE4vL0lw1+EK4/PiE/SQB7fKO4LRJNTEScIXVOi2x88K/c8WKc/k0KyEaA0asVBMpwekJQZGnRyj04ZtN5Gg==", + "dev": true, + "dependencies": { + "@bufbuild/protobuf": "1.10.0", + "@typescript/vfs": "^1.4.0", + "typescript": "4.5.2" + } + }, + "node_modules/@bufbuild/protoplugin/node_modules/typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/@connectrpc/connect": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.4.0.tgz", + "integrity": "sha512-vZeOkKaAjyV4+RH3+rJZIfDFJAfr+7fyYr6sLDKbYX3uuTVszhFe9/YKf5DNqrDb5cKdKVlYkGn6DTDqMitAnA==", + "peerDependencies": { + "@bufbuild/protobuf": "^1.4.2" + } + }, + "node_modules/@connectrpc/connect-fastify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-fastify/-/connect-fastify-1.4.0.tgz", + "integrity": "sha512-TYiaunbO96KYMjCzMUZ5NDB2txdDLfiJPLEJMRdw3paoZRnW/GSFYXHCseUP34Rh3ICClYvhfRkDLwW1PFx04Q==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^1.4.2", + "@connectrpc/connect": "1.4.0", + "@connectrpc/connect-node": "1.4.0", + "fastify": "^4.22.1" + } + }, + "node_modules/@connectrpc/connect-node": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-node/-/connect-node-1.4.0.tgz", + "integrity": "sha512-0ANnrr6SvsjevsWEgdzHy7BaHkluZyS6s4xNoVt7RBHFR5V/kT9lPokoIbYUOU9JHzdRgTaS3x5595mwUsu15g==", + "dependencies": { + "undici": "^5.28.3" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^1.4.2", + "@connectrpc/connect": "1.4.0" + } + }, + "node_modules/@connectrpc/protoc-gen-connect-es": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/protoc-gen-connect-es/-/protoc-gen-connect-es-1.4.0.tgz", + "integrity": "sha512-/7vQ8Q7mEBhV8qEVh/eifRQlQnf8EJ6weMwCD2DljVAQRlZYcW9SLxjYZhV1uM1ZZqQC7Cw2vvgXRg2XQswHBg==", + "dev": true, + "dependencies": { + "@bufbuild/protobuf": "^1.7.2", + "@bufbuild/protoplugin": "^1.7.2" + }, + "bin": { + "protoc-gen-connect-es": "bin/protoc-gen-connect-es" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@bufbuild/protoc-gen-es": "^1.7.2", + "@connectrpc/connect": "1.4.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protoc-gen-es": { + "optional": true + }, + "@connectrpc/connect": { + "optional": true + } + } + }, + "node_modules/@fastify/ajv-compiler": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.6.0.tgz", + "integrity": "sha512-LwdXQJjmMD+GwLOkP7TVC68qa+pSSogeWWmznRJ/coyTcfe9qA05AHFSe1eZFwK6q+xVRpChnvFUkf1iYaSZsQ==", + "dependencies": { + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1", + "fast-uri": "^2.0.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@fastify/error": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.4.1.tgz", + "integrity": "sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ==" + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", + "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", + "dependencies": { + "fast-json-stringify": "^5.7.0" + } + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.1.1.tgz", + "integrity": "sha512-fERDVz7topgNjtXsJTTW1JKLy0rhuLRcquYqNR9rF7OcVpCa2OVW49ZPDIhaRRCaUuvVxI+N416xUoF76HNSXA==", + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.0.tgz", + "integrity": "sha512-hvJUjNVeBMp77qPINuUvYXj4FyWeeMMKZkxEATEU3hqBAQ7qdTBCUFT7Sp0Zu0faeEtFf+ldXxMEDr/bk73ISg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv/node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==" + }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/avvio": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.4.0.tgz", + "integrity": "sha512-CDSwaxINFy59iNwhYnkvALBwZiTydGkOecZyPkqBpABYR1KqGEsET0VOOYDwtleZSUIdeY36DC2bSZ24CO1igA==", + "dependencies": { + "@fastify/error": "^3.3.0", + "fastq": "^1.17.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-content-type-parse": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz", + "integrity": "sha512-fBHHqSTFLVnR61C+gltJuE5GkVQMV0S2nqUO8TJ+5Z3qAKG8vAx4FKai1s5jq/inV1+sREynIWSuQ6HgoSXpDQ==" + }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-json-stringify": { + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.16.1.tgz", + "integrity": "sha512-KAdnLvy1yu/XrRtP+LJnxbBGrhN+xXu+gt3EUvZhYGKCr3lFHq/7UFJHHFgmJKoqlh6B40bZLEv7w46B0mqn1g==", + "dependencies": { + "@fastify/merge-json-schemas": "^0.1.0", + "ajv": "^8.10.0", + "ajv-formats": "^3.0.1", + "fast-deep-equal": "^3.1.3", + "fast-uri": "^2.1.0", + "json-schema-ref-resolver": "^1.0.1", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-json-stringify/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-redact": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", + "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/fast-uri": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.0.tgz", + "integrity": "sha512-ypuAmmMKInk5q7XcepxlnUWDLWv4GFtaJqAzWKqn62IpQ3pejtr5dTVbt3vwqVaMKmkNR55sTT+CqUKIaT21BA==" + }, + "node_modules/fastify": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.28.1.tgz", + "integrity": "sha512-kFWUtpNr4i7t5vY2EJPCN2KgMVpuqfU4NjnJNCgiNB900oiDeYqaNDRcAfeBbOF5hGixixxcKnOU4KN9z6QncQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/ajv-compiler": "^3.5.0", + "@fastify/error": "^3.4.0", + "@fastify/fast-json-stringify-compiler": "^4.3.0", + "abstract-logging": "^2.0.1", + "avvio": "^8.3.0", + "fast-content-type-parse": "^1.1.0", + "fast-json-stringify": "^5.8.0", + "find-my-way": "^8.0.0", + "light-my-request": "^5.11.0", + "pino": "^9.0.0", + "process-warning": "^3.0.0", + "proxy-addr": "^2.0.7", + "rfdc": "^1.3.0", + "secure-json-parse": "^2.7.0", + "semver": "^7.5.4", + "toad-cache": "^3.3.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/find-my-way": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-8.2.0.tgz", + "integrity": "sha512-HdWXgFYc6b1BJcOBDBwjqWuHJj1WYiqrxSh25qtU4DabpMFdj/gSunNBQb83t+8Zt67D7CXEzJWTkxaShMTMOA==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^3.1.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/json-schema-ref-resolver": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-1.0.1.tgz", + "integrity": "sha512-EJAj1pgHc1hxF6vo2Z3s69fMjO1INq6eGHXZ8Z6wCQeldCuwxGK9Sxf4/cScGn3FZubCVUehfWtcDM/PLteCQw==", + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/light-my-request": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.13.0.tgz", + "integrity": "sha512-9IjUN9ZyCS9pTG+KqTDEQo68Sui2lHsYBrfMyVUTTZ3XhH8PMZq7xO94Kr+eP9dhi/kcKsx4N41p2IXEBil1pQ==", + "dependencies": { + "cookie": "^0.6.0", + "process-warning": "^3.0.0", + "set-cookie-parser": "^2.4.1" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/pino": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.4.0.tgz", + "integrity": "sha512-nbkQb5+9YPhQRz/BeQmrWpEknAaqjpAqRK8NwJpmrX/JHu7JuZC5G1CeAwJDJfGes4h+YihC6in3Q2nGb+Y09w==", + "dependencies": { + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.1.1", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^1.2.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^4.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", + "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "dependencies": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, + "node_modules/pino-std-serializers": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==" + }, + "node_modules/pino/node_modules/process-warning": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.0.tgz", + "integrity": "sha512-/MyYDxttz7DfGMMHiysAsFE4qF+pQYAA8ziO/3NcRVrQ5fSk+Mns4QZA/oRPFzvcqNoVJXQNWNAsdwBXLUkQKw==" + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + }, + "node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/real-require": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ret": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.4.3.tgz", + "integrity": "sha512-0f4Memo5QP7WQyUEAYUO3esD/XjOc3Zjjg5CPsAq1p8sIu0XPeMbHJemKA0BO7tV0X7+A0FoEpbmHXWxPyD3wQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-3.1.0.tgz", + "integrity": "sha512-RAAZAGbap2kBfbVhvmnTFv73NWLMvDGOITFYTZBAaY8eR+Ir4ef7Up/e7amo+y1+AH+3PtLkrt9mvcTsG9LXug==", + "dependencies": { + "ret": "~0.4.0" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/secure-json-parse": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", + "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.0.tgz", + "integrity": "sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==" + }, + "node_modules/sonic-boom": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.1.0.tgz", + "integrity": "sha512-NGipjjRicyJJ03rPiZCJYjwlsuP2d1/5QUviozRXC7S3WdVWNK5e3Ojieb9CCyfhq2UC+3+SRd9nG3I2lPRvUw==", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/thread-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", + "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", + "dependencies": { + "real-require": "^0.2.0" + } + }, + "node_modules/toad-cache": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.0.tgz", + "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..4beb3ef --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "scripts": { + "generate": "buf generate", + "test": "node --test" + }, + "devDependencies": { + "@bufbuild/buf": "^1.39.0", + "@bufbuild/protobuf": "^1.10.0", + "@bufbuild/protoc-gen-es": "^1.10.0", + "@connectrpc/connect": "^1.4.0", + "@connectrpc/protoc-gen-connect-es": "^1.4.0", + "typescript": "^5.5.4" + }, + "dependencies": { + "@connectrpc/connect-fastify": "^1.4.0", + "@connectrpc/connect-node": "^1.4.0", + "fastify": "^4.28.1" + } +} \ No newline at end of file diff --git a/proto/v1/run_function.proto b/proto/v1/run_function.proto new file mode 100644 index 0000000..a6834d4 --- /dev/null +++ b/proto/v1/run_function.proto @@ -0,0 +1,326 @@ +/* +Copyright 2022 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +syntax = "proto3"; + +import "google/protobuf/struct.proto"; +import "google/protobuf/duration.proto"; + +package apiextensions.fn.proto.v1; + +option go_package = "github.com/crossplane/crossplane/apis/apiextensions/fn/proto/v1"; + +// A FunctionRunnerService is a Composition Function. +service FunctionRunnerService { + // RunFunction runs the Composition Function. + rpc RunFunction(RunFunctionRequest) returns (RunFunctionResponse) {} +} + +// A RunFunctionRequest requests that the Composition Function be run. +message RunFunctionRequest { + // Metadata pertaining to this request. + RequestMeta meta = 1; + + // The observed state prior to invocation of a Function pipeline. State passed + // to each Function is fresh as of the time the pipeline was invoked, not as + // of the time each Function was invoked. + State observed = 2; + + // Desired state according to a Function pipeline. The state passed to a + // particular Function may have been accumulated by previous Functions in the + // pipeline. + // + // Note that the desired state must be a partial object with only the fields + // that this function (and its predecessors in the pipeline) wants to have + // set in the object. Copying a non-partial observed state to desired is most + // likely not what you want to do. Leaving out fields that had been returned + // as desired before will result in them being deleted from the objects in the + // cluster. + State desired = 3; + + // Optional input specific to this Function invocation. A JSON representation + // of the 'input' block of the relevant entry in a Composition's pipeline. + optional google.protobuf.Struct input = 4; + + // Optional context. Crossplane may pass arbitary contextual information to a + // Function. A Function may also return context in its RunFunctionResponse, + // and that context will be passed to subsequent Functions. Crossplane + // discards all context returned by the last Function in the pipeline. + optional google.protobuf.Struct context = 5; + + // Optional extra resources that the Function required. + // Note that extra resources is a map to Resources, plural. + // The map key corresponds to the key in a RunFunctionResponse's + // extra_resources field. If a Function requested extra resources that + // did not exist, Crossplane sets the map key to an empty Resources message to + // indicate that it attempted to satisfy the request. + map extra_resources = 6; + + // Optional credentials that this Function may use to communicate with an + // external system. + map credentials = 7; +} + +// Credentials that a Function may use to communicate with an external system. +message Credentials { + // Source of the credentials. + oneof source { + // Credential data loaded by Crossplane, for example from a Secret. + CredentialData credential_data = 1; + } +} + +// CredentialData loaded by Crossplane, for example from a Secret. +message CredentialData { + map data = 1; +} + +// Resources represents the state of several Crossplane resources. +message Resources { + repeated Resource items = 1; +} + +// A RunFunctionResponse contains the result of a Composition Function run. +message RunFunctionResponse { + // Metadata pertaining to this response. + ResponseMeta meta = 1; + + // Desired state according to a Function pipeline. Functions may add desired + // state, and may mutate or delete any part of the desired state they are + // concerned with. A Function must pass through any part of the desired state + // that it is not concerned with. + // + // + // Note that the desired state must be a partial object with only the fields + // that this function (and its predecessors in the pipeline) wants to have + // set in the object. Copying a non-partial observed state to desired is most + // likely not what you want to do. Leaving out fields that had been returned + // as desired before will result in them being deleted from the objects in the + // cluster. + State desired = 2; + + // Results of the Function run. Results are used for observability purposes. + repeated Result results = 3; + + // Optional context to be passed to the next Function in the pipeline as part + // of the RunFunctionRequest. Dropped on the last function in the pipeline. + optional google.protobuf.Struct context = 4; + + // Requirements that must be satisfied for this Function to run successfully. + Requirements requirements = 5; + + // Status conditions to be applied to the composite resource. Conditions may also + // optionally be applied to the composite resource's associated claim. + repeated Condition conditions = 6; +} + +// RequestMeta contains metadata pertaining to a RunFunctionRequest. +message RequestMeta { + // An opaque string identifying the content of the request. Two identical + // requests should have the same tag. + string tag = 1; +} + +// Requirements that must be satisfied for a Function to run successfully. +message Requirements { + // Extra resources that this Function requires. + // The map key uniquely identifies the group of resources. + map extra_resources = 1; +} + +// ResourceSelector selects a group of resources, either by name or by label. +message ResourceSelector { + // API version of resources to select. + string api_version = 1; + + // Kind of resources to select. + string kind = 2; + + // Resources to match. + oneof match { + // Match the resource with this name. + string match_name = 3; + + // Match all resources with these labels. + MatchLabels match_labels = 4; + } +} + +// MatchLabels defines a set of labels to match resources against. +message MatchLabels { + map labels = 1; +} + +// ResponseMeta contains metadata pertaining to a RunFunctionResponse. +message ResponseMeta { + // An opaque string identifying the content of the request. Must match the + // meta.tag of the corresponding RunFunctionRequest. + string tag = 1; + + // Time-to-live of this response. Deterministic Functions with no side-effects + // (e.g. simple templating Functions) may specify a TTL. Crossplane may choose + // to cache responses until the TTL expires. + optional google.protobuf.Duration ttl = 2; +} + +// State of the composite resource (XR) and any composed resources. +message State { + // The state of the composite resource (XR). + Resource composite = 1; + + // The state of any composed resources. + map resources = 2; +} + +// A Resource represents the state of a composite or composed resource. +message Resource { + // The JSON representation of the resource. + // + // * Crossplane will set this field in a RunFunctionRequest to the entire + // observed state of a resource - including its metadata, spec, and status. + // + // * A Function should set this field in a RunFunctionRequest to communicate + // the desired state of a composite or composed resource. + // + // * A Function may only specify the desired status of a composite resource - + // not its metadata or spec. A Function should not return desired metadata + // or spec for a composite resource. This will be ignored. + // + // * A Function may not specify the desired status of a composed resource - + // only its metadata and spec. A Function should not return desired status + // for a composed resource. This will be ignored. + google.protobuf.Struct resource = 1; + + // The resource's connection details. + // + // * Crossplane will set this field in a RunFunctionRequest to communicate the + // the observed connection details of a composite or composed resource. + // + // * A Function should set this field in a RunFunctionResponse to indicate the + // desired connection details of the composite resource. + // + // * A Function should not set this field in a RunFunctionResponse to indicate + // the desired connection details of a composed resource. This will be + // ignored. + map connection_details = 2; + + // Ready indicates whether the resource should be considered ready. + // + // * Crossplane will never set this field in a RunFunctionRequest. + // + // * A Function should set this field to READY_TRUE in a RunFunctionResponse + // to indicate that a desired composed resource is ready. + // + // * A Function should not set this field in a RunFunctionResponse to indicate + // that the desired composite resource is ready. This will be ignored. + Ready ready = 3; +} + +// Ready indicates whether a composed resource should be considered ready. +enum Ready { + READY_UNSPECIFIED = 0; + + // True means the composed resource has been observed to be ready. + READY_TRUE = 1; + + // False means the composed resource has not been observed to be ready. + READY_FALSE = 2; +} + +// A Result of running a Function. +message Result { + // Severity of this result. + Severity severity = 1; + + // Human-readable details about the result. + string message = 2; + + // Optional PascalCase, machine-readable reason for this result. If omitted, + // the value will be ComposeResources. + optional string reason = 3; + + // The resources this result targets. + optional Target target = 4; +} + +// Severity of Function results. +enum Severity { + SEVERITY_UNSPECIFIED = 0; + + // Fatal results are fatal; subsequent Composition Functions may run, but + // the Composition Function pipeline run will be considered a failure and + // the first fatal result will be returned as an error. + SEVERITY_FATAL = 1; + + // Warning results are non-fatal; the entire Composition will run to + // completion but warning events and debug logs associated with the + // composite resource will be emitted. + SEVERITY_WARNING = 2; + + // Normal results are emitted as normal events and debug logs associated + // with the composite resource. + SEVERITY_NORMAL = 3; +} + +// Target of Function results and conditions. +enum Target { + // If the target is unspecified, the result targets the composite resource. + TARGET_UNSPECIFIED = 0; + + // Target the composite resource. Results that target the composite resource + // should include detailed, advanced information. + TARGET_COMPOSITE = 1; + + // Target the composite and the claim. Results that target the composite and + // the claim should include only end-user friendly information. + TARGET_COMPOSITE_AND_CLAIM = 2; +} + +// Status condition to be applied to the composite resource. Condition may also +// optionally be applied to the composite resource's associated claim. For +// detailed information on proper usage of status conditions, please see +// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties. +message Condition { + // Type of condition in PascalCase. + string type = 1; + + // Status of the condition. + Status status = 2; + + // Reason contains a programmatic identifier indicating the reason for the + // condition's last transition. Producers of specific condition types may + // define expected values and meanings for this field, and whether the values + // are considered a guaranteed API. The value should be a PascalCase string. + // This field may not be empty. + string reason = 3; + + // Message is a human readable message indicating details about the + // transition. This may be an empty string. + optional string message = 4; + + // The resources this condition targets. + optional Target target = 5; +} + +enum Status { + STATUS_CONDITION_UNSPECIFIED = 0; + + STATUS_CONDITION_UNKNOWN = 1; + + STATUS_CONDITION_TRUE = 2; + + STATUS_CONDITION_FALSE = 3; +} \ No newline at end of file diff --git a/proto/v1beta1/run_function.proto b/proto/v1beta1/run_function.proto new file mode 100644 index 0000000..c4a2aa2 --- /dev/null +++ b/proto/v1beta1/run_function.proto @@ -0,0 +1,328 @@ +/* +Copyright 2022 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +syntax = "proto3"; + +import "google/protobuf/struct.proto"; +import "google/protobuf/duration.proto"; + +// Generated from apiextensions/fn/proto/v1/run_function.proto by ../hack/duplicate_proto_type.sh. DO NOT EDIT. + +package apiextensions.fn.proto.v1beta1; + +option go_package = "github.com/crossplane/crossplane/apis/apiextensions/fn/proto/v1beta1"; + +// A FunctionRunnerService is a Composition Function. +service FunctionRunnerService { + // RunFunction runs the Composition Function. + rpc RunFunction(RunFunctionRequest) returns (RunFunctionResponse) {} +} + +// A RunFunctionRequest requests that the Composition Function be run. +message RunFunctionRequest { + // Metadata pertaining to this request. + RequestMeta meta = 1; + + // The observed state prior to invocation of a Function pipeline. State passed + // to each Function is fresh as of the time the pipeline was invoked, not as + // of the time each Function was invoked. + State observed = 2; + + // Desired state according to a Function pipeline. The state passed to a + // particular Function may have been accumulated by previous Functions in the + // pipeline. + // + // Note that the desired state must be a partial object with only the fields + // that this function (and its predecessors in the pipeline) wants to have + // set in the object. Copying a non-partial observed state to desired is most + // likely not what you want to do. Leaving out fields that had been returned + // as desired before will result in them being deleted from the objects in the + // cluster. + State desired = 3; + + // Optional input specific to this Function invocation. A JSON representation + // of the 'input' block of the relevant entry in a Composition's pipeline. + optional google.protobuf.Struct input = 4; + + // Optional context. Crossplane may pass arbitary contextual information to a + // Function. A Function may also return context in its RunFunctionResponse, + // and that context will be passed to subsequent Functions. Crossplane + // discards all context returned by the last Function in the pipeline. + optional google.protobuf.Struct context = 5; + + // Optional extra resources that the Function required. + // Note that extra resources is a map to Resources, plural. + // The map key corresponds to the key in a RunFunctionResponse's + // extra_resources field. If a Function requested extra resources that + // did not exist, Crossplane sets the map key to an empty Resources message to + // indicate that it attempted to satisfy the request. + map extra_resources = 6; + + // Optional credentials that this Function may use to communicate with an + // external system. + map credentials = 7; +} + +// Credentials that a Function may use to communicate with an external system. +message Credentials { + // Source of the credentials. + oneof source { + // Credential data loaded by Crossplane, for example from a Secret. + CredentialData credential_data = 1; + } +} + +// CredentialData loaded by Crossplane, for example from a Secret. +message CredentialData { + map data = 1; +} + +// Resources represents the state of several Crossplane resources. +message Resources { + repeated Resource items = 1; +} + +// A RunFunctionResponse contains the result of a Composition Function run. +message RunFunctionResponse { + // Metadata pertaining to this response. + ResponseMeta meta = 1; + + // Desired state according to a Function pipeline. Functions may add desired + // state, and may mutate or delete any part of the desired state they are + // concerned with. A Function must pass through any part of the desired state + // that it is not concerned with. + // + // + // Note that the desired state must be a partial object with only the fields + // that this function (and its predecessors in the pipeline) wants to have + // set in the object. Copying a non-partial observed state to desired is most + // likely not what you want to do. Leaving out fields that had been returned + // as desired before will result in them being deleted from the objects in the + // cluster. + State desired = 2; + + // Results of the Function run. Results are used for observability purposes. + repeated Result results = 3; + + // Optional context to be passed to the next Function in the pipeline as part + // of the RunFunctionRequest. Dropped on the last function in the pipeline. + optional google.protobuf.Struct context = 4; + + // Requirements that must be satisfied for this Function to run successfully. + Requirements requirements = 5; + + // Status conditions to be applied to the composite resource. Conditions may also + // optionally be applied to the composite resource's associated claim. + repeated Condition conditions = 6; +} + +// RequestMeta contains metadata pertaining to a RunFunctionRequest. +message RequestMeta { + // An opaque string identifying the content of the request. Two identical + // requests should have the same tag. + string tag = 1; +} + +// Requirements that must be satisfied for a Function to run successfully. +message Requirements { + // Extra resources that this Function requires. + // The map key uniquely identifies the group of resources. + map extra_resources = 1; +} + +// ResourceSelector selects a group of resources, either by name or by label. +message ResourceSelector { + // API version of resources to select. + string api_version = 1; + + // Kind of resources to select. + string kind = 2; + + // Resources to match. + oneof match { + // Match the resource with this name. + string match_name = 3; + + // Match all resources with these labels. + MatchLabels match_labels = 4; + } +} + +// MatchLabels defines a set of labels to match resources against. +message MatchLabels { + map labels = 1; +} + +// ResponseMeta contains metadata pertaining to a RunFunctionResponse. +message ResponseMeta { + // An opaque string identifying the content of the request. Must match the + // meta.tag of the corresponding RunFunctionRequest. + string tag = 1; + + // Time-to-live of this response. Deterministic Functions with no side-effects + // (e.g. simple templating Functions) may specify a TTL. Crossplane may choose + // to cache responses until the TTL expires. + optional google.protobuf.Duration ttl = 2; +} + +// State of the composite resource (XR) and any composed resources. +message State { + // The state of the composite resource (XR). + Resource composite = 1; + + // The state of any composed resources. + map resources = 2; +} + +// A Resource represents the state of a composite or composed resource. +message Resource { + // The JSON representation of the resource. + // + // * Crossplane will set this field in a RunFunctionRequest to the entire + // observed state of a resource - including its metadata, spec, and status. + // + // * A Function should set this field in a RunFunctionRequest to communicate + // the desired state of a composite or composed resource. + // + // * A Function may only specify the desired status of a composite resource - + // not its metadata or spec. A Function should not return desired metadata + // or spec for a composite resource. This will be ignored. + // + // * A Function may not specify the desired status of a composed resource - + // only its metadata and spec. A Function should not return desired status + // for a composed resource. This will be ignored. + google.protobuf.Struct resource = 1; + + // The resource's connection details. + // + // * Crossplane will set this field in a RunFunctionRequest to communicate the + // the observed connection details of a composite or composed resource. + // + // * A Function should set this field in a RunFunctionResponse to indicate the + // desired connection details of the composite resource. + // + // * A Function should not set this field in a RunFunctionResponse to indicate + // the desired connection details of a composed resource. This will be + // ignored. + map connection_details = 2; + + // Ready indicates whether the resource should be considered ready. + // + // * Crossplane will never set this field in a RunFunctionRequest. + // + // * A Function should set this field to READY_TRUE in a RunFunctionResponse + // to indicate that a desired composed resource is ready. + // + // * A Function should not set this field in a RunFunctionResponse to indicate + // that the desired composite resource is ready. This will be ignored. + Ready ready = 3; +} + +// Ready indicates whether a composed resource should be considered ready. +enum Ready { + READY_UNSPECIFIED = 0; + + // True means the composed resource has been observed to be ready. + READY_TRUE = 1; + + // False means the composed resource has not been observed to be ready. + READY_FALSE = 2; +} + +// A Result of running a Function. +message Result { + // Severity of this result. + Severity severity = 1; + + // Human-readable details about the result. + string message = 2; + + // Optional PascalCase, machine-readable reason for this result. If omitted, + // the value will be ComposeResources. + optional string reason = 3; + + // The resources this result targets. + optional Target target = 4; +} + +// Severity of Function results. +enum Severity { + SEVERITY_UNSPECIFIED = 0; + + // Fatal results are fatal; subsequent Composition Functions may run, but + // the Composition Function pipeline run will be considered a failure and + // the first fatal result will be returned as an error. + SEVERITY_FATAL = 1; + + // Warning results are non-fatal; the entire Composition will run to + // completion but warning events and debug logs associated with the + // composite resource will be emitted. + SEVERITY_WARNING = 2; + + // Normal results are emitted as normal events and debug logs associated + // with the composite resource. + SEVERITY_NORMAL = 3; +} + +// Target of Function results and conditions. +enum Target { + // If the target is unspecified, the result targets the composite resource. + TARGET_UNSPECIFIED = 0; + + // Target the composite resource. Results that target the composite resource + // should include detailed, advanced information. + TARGET_COMPOSITE = 1; + + // Target the composite and the claim. Results that target the composite and + // the claim should include only end-user friendly information. + TARGET_COMPOSITE_AND_CLAIM = 2; +} + +// Status condition to be applied to the composite resource. Condition may also +// optionally be applied to the composite resource's associated claim. For +// detailed information on proper usage of status conditions, please see +// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties. +message Condition { + // Type of condition in PascalCase. + string type = 1; + + // Status of the condition. + Status status = 2; + + // Reason contains a programmatic identifier indicating the reason for the + // condition's last transition. Producers of specific condition types may + // define expected values and meanings for this field, and whether the values + // are considered a guaranteed API. The value should be a PascalCase string. + // This field may not be empty. + string reason = 3; + + // Message is a human readable message indicating details about the + // transition. This may be an empty string. + optional string message = 4; + + // The resources this condition targets. + optional Target target = 5; +} + +enum Status { + STATUS_CONDITION_UNSPECIFIED = 0; + + STATUS_CONDITION_UNKNOWN = 1; + + STATUS_CONDITION_TRUE = 2; + + STATUS_CONDITION_FALSE = 3; +} \ No newline at end of file diff --git a/src/connect.ts b/src/connect.ts new file mode 100644 index 0000000..0d81133 --- /dev/null +++ b/src/connect.ts @@ -0,0 +1,9 @@ +import type { ConnectRouter } from "@connectrpc/connect"; +import { FunctionRunnerService } from "../gen/v1/run_function_connect"; + +export default (router: ConnectRouter) => + router.service(FunctionRunnerService, { + async runFunction(request, context) { + + } + }); \ No newline at end of file diff --git a/src/gen/v1/run_function_pb.ts b/src/gen/v1/run_function_pb.ts new file mode 100644 index 0000000..682ad69 --- /dev/null +++ b/src/gen/v1/run_function_pb.ts @@ -0,0 +1,1033 @@ +// +//Copyright 2022 The Crossplane Authors. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file v1/run_function.proto (package apiextensions.fn.proto.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Duration, Message, proto3, Struct } from "@bufbuild/protobuf"; + +/** + * Ready indicates whether a composed resource should be considered ready. + * + * @generated from enum apiextensions.fn.proto.v1.Ready + */ +export enum Ready { + /** + * @generated from enum value: READY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * True means the composed resource has been observed to be ready. + * + * @generated from enum value: READY_TRUE = 1; + */ + TRUE = 1, + + /** + * False means the composed resource has not been observed to be ready. + * + * @generated from enum value: READY_FALSE = 2; + */ + FALSE = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(Ready) +proto3.util.setEnumType(Ready, "apiextensions.fn.proto.v1.Ready", [ + { no: 0, name: "READY_UNSPECIFIED" }, + { no: 1, name: "READY_TRUE" }, + { no: 2, name: "READY_FALSE" }, +]); + +/** + * Severity of Function results. + * + * @generated from enum apiextensions.fn.proto.v1.Severity + */ +export enum Severity { + /** + * @generated from enum value: SEVERITY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Fatal results are fatal; subsequent Composition Functions may run, but + * the Composition Function pipeline run will be considered a failure and + * the first fatal result will be returned as an error. + * + * @generated from enum value: SEVERITY_FATAL = 1; + */ + FATAL = 1, + + /** + * Warning results are non-fatal; the entire Composition will run to + * completion but warning events and debug logs associated with the + * composite resource will be emitted. + * + * @generated from enum value: SEVERITY_WARNING = 2; + */ + WARNING = 2, + + /** + * Normal results are emitted as normal events and debug logs associated + * with the composite resource. + * + * @generated from enum value: SEVERITY_NORMAL = 3; + */ + NORMAL = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(Severity) +proto3.util.setEnumType(Severity, "apiextensions.fn.proto.v1.Severity", [ + { no: 0, name: "SEVERITY_UNSPECIFIED" }, + { no: 1, name: "SEVERITY_FATAL" }, + { no: 2, name: "SEVERITY_WARNING" }, + { no: 3, name: "SEVERITY_NORMAL" }, +]); + +/** + * Target of Function results and conditions. + * + * @generated from enum apiextensions.fn.proto.v1.Target + */ +export enum Target { + /** + * If the target is unspecified, the result targets the composite resource. + * + * @generated from enum value: TARGET_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Target the composite resource. Results that target the composite resource + * should include detailed, advanced information. + * + * @generated from enum value: TARGET_COMPOSITE = 1; + */ + COMPOSITE = 1, + + /** + * Target the composite and the claim. Results that target the composite and + * the claim should include only end-user friendly information. + * + * @generated from enum value: TARGET_COMPOSITE_AND_CLAIM = 2; + */ + COMPOSITE_AND_CLAIM = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(Target) +proto3.util.setEnumType(Target, "apiextensions.fn.proto.v1.Target", [ + { no: 0, name: "TARGET_UNSPECIFIED" }, + { no: 1, name: "TARGET_COMPOSITE" }, + { no: 2, name: "TARGET_COMPOSITE_AND_CLAIM" }, +]); + +/** + * @generated from enum apiextensions.fn.proto.v1.Status + */ +export enum Status { + /** + * @generated from enum value: STATUS_CONDITION_UNSPECIFIED = 0; + */ + CONDITION_UNSPECIFIED = 0, + + /** + * @generated from enum value: STATUS_CONDITION_UNKNOWN = 1; + */ + CONDITION_UNKNOWN = 1, + + /** + * @generated from enum value: STATUS_CONDITION_TRUE = 2; + */ + CONDITION_TRUE = 2, + + /** + * @generated from enum value: STATUS_CONDITION_FALSE = 3; + */ + CONDITION_FALSE = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(Status) +proto3.util.setEnumType(Status, "apiextensions.fn.proto.v1.Status", [ + { no: 0, name: "STATUS_CONDITION_UNSPECIFIED" }, + { no: 1, name: "STATUS_CONDITION_UNKNOWN" }, + { no: 2, name: "STATUS_CONDITION_TRUE" }, + { no: 3, name: "STATUS_CONDITION_FALSE" }, +]); + +/** + * A RunFunctionRequest requests that the Composition Function be run. + * + * @generated from message apiextensions.fn.proto.v1.RunFunctionRequest + */ +export class RunFunctionRequest extends Message { + /** + * Metadata pertaining to this request. + * + * @generated from field: apiextensions.fn.proto.v1.RequestMeta meta = 1; + */ + meta?: RequestMeta; + + /** + * The observed state prior to invocation of a Function pipeline. State passed + * to each Function is fresh as of the time the pipeline was invoked, not as + * of the time each Function was invoked. + * + * @generated from field: apiextensions.fn.proto.v1.State observed = 2; + */ + observed?: State; + + /** + * Desired state according to a Function pipeline. The state passed to a + * particular Function may have been accumulated by previous Functions in the + * pipeline. + * + * Note that the desired state must be a partial object with only the fields + * that this function (and its predecessors in the pipeline) wants to have + * set in the object. Copying a non-partial observed state to desired is most + * likely not what you want to do. Leaving out fields that had been returned + * as desired before will result in them being deleted from the objects in the + * cluster. + * + * @generated from field: apiextensions.fn.proto.v1.State desired = 3; + */ + desired?: State; + + /** + * Optional input specific to this Function invocation. A JSON representation + * of the 'input' block of the relevant entry in a Composition's pipeline. + * + * @generated from field: optional google.protobuf.Struct input = 4; + */ + input?: Struct; + + /** + * Optional context. Crossplane may pass arbitary contextual information to a + * Function. A Function may also return context in its RunFunctionResponse, + * and that context will be passed to subsequent Functions. Crossplane + * discards all context returned by the last Function in the pipeline. + * + * @generated from field: optional google.protobuf.Struct context = 5; + */ + context?: Struct; + + /** + * Optional extra resources that the Function required. + * Note that extra resources is a map to Resources, plural. + * The map key corresponds to the key in a RunFunctionResponse's + * extra_resources field. If a Function requested extra resources that + * did not exist, Crossplane sets the map key to an empty Resources message to + * indicate that it attempted to satisfy the request. + * + * @generated from field: map extra_resources = 6; + */ + extraResources: { [key: string]: Resources } = {}; + + /** + * Optional credentials that this Function may use to communicate with an + * external system. + * + * @generated from field: map credentials = 7; + */ + credentials: { [key: string]: Credentials } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.RunFunctionRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "meta", kind: "message", T: RequestMeta }, + { no: 2, name: "observed", kind: "message", T: State }, + { no: 3, name: "desired", kind: "message", T: State }, + { no: 4, name: "input", kind: "message", T: Struct, opt: true }, + { no: 5, name: "context", kind: "message", T: Struct, opt: true }, + { no: 6, name: "extra_resources", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Resources} }, + { no: 7, name: "credentials", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Credentials} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RunFunctionRequest { + return new RunFunctionRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RunFunctionRequest { + return new RunFunctionRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RunFunctionRequest { + return new RunFunctionRequest().fromJsonString(jsonString, options); + } + + static equals(a: RunFunctionRequest | PlainMessage | undefined, b: RunFunctionRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RunFunctionRequest, a, b); + } +} + +/** + * Credentials that a Function may use to communicate with an external system. + * + * @generated from message apiextensions.fn.proto.v1.Credentials + */ +export class Credentials extends Message { + /** + * Source of the credentials. + * + * @generated from oneof apiextensions.fn.proto.v1.Credentials.source + */ + source: { + /** + * Credential data loaded by Crossplane, for example from a Secret. + * + * @generated from field: apiextensions.fn.proto.v1.CredentialData credential_data = 1; + */ + value: CredentialData; + case: "credentialData"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.Credentials"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "credential_data", kind: "message", T: CredentialData, oneof: "source" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Credentials { + return new Credentials().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Credentials { + return new Credentials().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Credentials { + return new Credentials().fromJsonString(jsonString, options); + } + + static equals(a: Credentials | PlainMessage | undefined, b: Credentials | PlainMessage | undefined): boolean { + return proto3.util.equals(Credentials, a, b); + } +} + +/** + * CredentialData loaded by Crossplane, for example from a Secret. + * + * @generated from message apiextensions.fn.proto.v1.CredentialData + */ +export class CredentialData extends Message { + /** + * @generated from field: map data = 1; + */ + data: { [key: string]: Uint8Array } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.CredentialData"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CredentialData { + return new CredentialData().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CredentialData { + return new CredentialData().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CredentialData { + return new CredentialData().fromJsonString(jsonString, options); + } + + static equals(a: CredentialData | PlainMessage | undefined, b: CredentialData | PlainMessage | undefined): boolean { + return proto3.util.equals(CredentialData, a, b); + } +} + +/** + * Resources represents the state of several Crossplane resources. + * + * @generated from message apiextensions.fn.proto.v1.Resources + */ +export class Resources extends Message { + /** + * @generated from field: repeated apiextensions.fn.proto.v1.Resource items = 1; + */ + items: Resource[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.Resources"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "items", kind: "message", T: Resource, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Resources { + return new Resources().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Resources { + return new Resources().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Resources { + return new Resources().fromJsonString(jsonString, options); + } + + static equals(a: Resources | PlainMessage | undefined, b: Resources | PlainMessage | undefined): boolean { + return proto3.util.equals(Resources, a, b); + } +} + +/** + * A RunFunctionResponse contains the result of a Composition Function run. + * + * @generated from message apiextensions.fn.proto.v1.RunFunctionResponse + */ +export class RunFunctionResponse extends Message { + /** + * Metadata pertaining to this response. + * + * @generated from field: apiextensions.fn.proto.v1.ResponseMeta meta = 1; + */ + meta?: ResponseMeta; + + /** + * Desired state according to a Function pipeline. Functions may add desired + * state, and may mutate or delete any part of the desired state they are + * concerned with. A Function must pass through any part of the desired state + * that it is not concerned with. + * + * + * Note that the desired state must be a partial object with only the fields + * that this function (and its predecessors in the pipeline) wants to have + * set in the object. Copying a non-partial observed state to desired is most + * likely not what you want to do. Leaving out fields that had been returned + * as desired before will result in them being deleted from the objects in the + * cluster. + * + * @generated from field: apiextensions.fn.proto.v1.State desired = 2; + */ + desired?: State; + + /** + * Results of the Function run. Results are used for observability purposes. + * + * @generated from field: repeated apiextensions.fn.proto.v1.Result results = 3; + */ + results: Result[] = []; + + /** + * Optional context to be passed to the next Function in the pipeline as part + * of the RunFunctionRequest. Dropped on the last function in the pipeline. + * + * @generated from field: optional google.protobuf.Struct context = 4; + */ + context?: Struct; + + /** + * Requirements that must be satisfied for this Function to run successfully. + * + * @generated from field: apiextensions.fn.proto.v1.Requirements requirements = 5; + */ + requirements?: Requirements; + + /** + * Status conditions to be applied to the composite resource. Conditions may also + * optionally be applied to the composite resource's associated claim. + * + * @generated from field: repeated apiextensions.fn.proto.v1.Condition conditions = 6; + */ + conditions: Condition[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.RunFunctionResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "meta", kind: "message", T: ResponseMeta }, + { no: 2, name: "desired", kind: "message", T: State }, + { no: 3, name: "results", kind: "message", T: Result, repeated: true }, + { no: 4, name: "context", kind: "message", T: Struct, opt: true }, + { no: 5, name: "requirements", kind: "message", T: Requirements }, + { no: 6, name: "conditions", kind: "message", T: Condition, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RunFunctionResponse { + return new RunFunctionResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RunFunctionResponse { + return new RunFunctionResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RunFunctionResponse { + return new RunFunctionResponse().fromJsonString(jsonString, options); + } + + static equals(a: RunFunctionResponse | PlainMessage | undefined, b: RunFunctionResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RunFunctionResponse, a, b); + } +} + +/** + * RequestMeta contains metadata pertaining to a RunFunctionRequest. + * + * @generated from message apiextensions.fn.proto.v1.RequestMeta + */ +export class RequestMeta extends Message { + /** + * An opaque string identifying the content of the request. Two identical + * requests should have the same tag. + * + * @generated from field: string tag = 1; + */ + tag = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.RequestMeta"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tag", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RequestMeta { + return new RequestMeta().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RequestMeta { + return new RequestMeta().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RequestMeta { + return new RequestMeta().fromJsonString(jsonString, options); + } + + static equals(a: RequestMeta | PlainMessage | undefined, b: RequestMeta | PlainMessage | undefined): boolean { + return proto3.util.equals(RequestMeta, a, b); + } +} + +/** + * Requirements that must be satisfied for a Function to run successfully. + * + * @generated from message apiextensions.fn.proto.v1.Requirements + */ +export class Requirements extends Message { + /** + * Extra resources that this Function requires. + * The map key uniquely identifies the group of resources. + * + * @generated from field: map extra_resources = 1; + */ + extraResources: { [key: string]: ResourceSelector } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.Requirements"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "extra_resources", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: ResourceSelector} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Requirements { + return new Requirements().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Requirements { + return new Requirements().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Requirements { + return new Requirements().fromJsonString(jsonString, options); + } + + static equals(a: Requirements | PlainMessage | undefined, b: Requirements | PlainMessage | undefined): boolean { + return proto3.util.equals(Requirements, a, b); + } +} + +/** + * ResourceSelector selects a group of resources, either by name or by label. + * + * @generated from message apiextensions.fn.proto.v1.ResourceSelector + */ +export class ResourceSelector extends Message { + /** + * API version of resources to select. + * + * @generated from field: string api_version = 1; + */ + apiVersion = ""; + + /** + * Kind of resources to select. + * + * @generated from field: string kind = 2; + */ + kind = ""; + + /** + * Resources to match. + * + * @generated from oneof apiextensions.fn.proto.v1.ResourceSelector.match + */ + match: { + /** + * Match the resource with this name. + * + * @generated from field: string match_name = 3; + */ + value: string; + case: "matchName"; + } | { + /** + * Match all resources with these labels. + * + * @generated from field: apiextensions.fn.proto.v1.MatchLabels match_labels = 4; + */ + value: MatchLabels; + case: "matchLabels"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.ResourceSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "api_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "match_name", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "match" }, + { no: 4, name: "match_labels", kind: "message", T: MatchLabels, oneof: "match" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResourceSelector { + return new ResourceSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResourceSelector { + return new ResourceSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResourceSelector { + return new ResourceSelector().fromJsonString(jsonString, options); + } + + static equals(a: ResourceSelector | PlainMessage | undefined, b: ResourceSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(ResourceSelector, a, b); + } +} + +/** + * MatchLabels defines a set of labels to match resources against. + * + * @generated from message apiextensions.fn.proto.v1.MatchLabels + */ +export class MatchLabels extends Message { + /** + * @generated from field: map labels = 1; + */ + labels: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.MatchLabels"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "labels", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MatchLabels { + return new MatchLabels().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MatchLabels { + return new MatchLabels().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MatchLabels { + return new MatchLabels().fromJsonString(jsonString, options); + } + + static equals(a: MatchLabels | PlainMessage | undefined, b: MatchLabels | PlainMessage | undefined): boolean { + return proto3.util.equals(MatchLabels, a, b); + } +} + +/** + * ResponseMeta contains metadata pertaining to a RunFunctionResponse. + * + * @generated from message apiextensions.fn.proto.v1.ResponseMeta + */ +export class ResponseMeta extends Message { + /** + * An opaque string identifying the content of the request. Must match the + * meta.tag of the corresponding RunFunctionRequest. + * + * @generated from field: string tag = 1; + */ + tag = ""; + + /** + * Time-to-live of this response. Deterministic Functions with no side-effects + * (e.g. simple templating Functions) may specify a TTL. Crossplane may choose + * to cache responses until the TTL expires. + * + * @generated from field: optional google.protobuf.Duration ttl = 2; + */ + ttl?: Duration; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.ResponseMeta"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tag", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "ttl", kind: "message", T: Duration, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResponseMeta { + return new ResponseMeta().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResponseMeta { + return new ResponseMeta().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResponseMeta { + return new ResponseMeta().fromJsonString(jsonString, options); + } + + static equals(a: ResponseMeta | PlainMessage | undefined, b: ResponseMeta | PlainMessage | undefined): boolean { + return proto3.util.equals(ResponseMeta, a, b); + } +} + +/** + * State of the composite resource (XR) and any composed resources. + * + * @generated from message apiextensions.fn.proto.v1.State + */ +export class State extends Message { + /** + * The state of the composite resource (XR). + * + * @generated from field: apiextensions.fn.proto.v1.Resource composite = 1; + */ + composite?: Resource; + + /** + * The state of any composed resources. + * + * @generated from field: map resources = 2; + */ + resources: { [key: string]: Resource } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.State"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "composite", kind: "message", T: Resource }, + { no: 2, name: "resources", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Resource} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): State { + return new State().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): State { + return new State().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): State { + return new State().fromJsonString(jsonString, options); + } + + static equals(a: State | PlainMessage | undefined, b: State | PlainMessage | undefined): boolean { + return proto3.util.equals(State, a, b); + } +} + +/** + * A Resource represents the state of a composite or composed resource. + * + * @generated from message apiextensions.fn.proto.v1.Resource + */ +export class Resource extends Message { + /** + * The JSON representation of the resource. + * + * * Crossplane will set this field in a RunFunctionRequest to the entire + * observed state of a resource - including its metadata, spec, and status. + * + * * A Function should set this field in a RunFunctionRequest to communicate + * the desired state of a composite or composed resource. + * + * * A Function may only specify the desired status of a composite resource - + * not its metadata or spec. A Function should not return desired metadata + * or spec for a composite resource. This will be ignored. + * + * * A Function may not specify the desired status of a composed resource - + * only its metadata and spec. A Function should not return desired status + * for a composed resource. This will be ignored. + * + * @generated from field: google.protobuf.Struct resource = 1; + */ + resource?: Struct; + + /** + * The resource's connection details. + * + * * Crossplane will set this field in a RunFunctionRequest to communicate the + * the observed connection details of a composite or composed resource. + * + * * A Function should set this field in a RunFunctionResponse to indicate the + * desired connection details of the composite resource. + * + * * A Function should not set this field in a RunFunctionResponse to indicate + * the desired connection details of a composed resource. This will be + * ignored. + * + * @generated from field: map connection_details = 2; + */ + connectionDetails: { [key: string]: Uint8Array } = {}; + + /** + * Ready indicates whether the resource should be considered ready. + * + * * Crossplane will never set this field in a RunFunctionRequest. + * + * * A Function should set this field to READY_TRUE in a RunFunctionResponse + * to indicate that a desired composed resource is ready. + * + * * A Function should not set this field in a RunFunctionResponse to indicate + * that the desired composite resource is ready. This will be ignored. + * + * @generated from field: apiextensions.fn.proto.v1.Ready ready = 3; + */ + ready = Ready.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.Resource"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource", kind: "message", T: Struct }, + { no: 2, name: "connection_details", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, + { no: 3, name: "ready", kind: "enum", T: proto3.getEnumType(Ready) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Resource { + return new Resource().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Resource { + return new Resource().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Resource { + return new Resource().fromJsonString(jsonString, options); + } + + static equals(a: Resource | PlainMessage | undefined, b: Resource | PlainMessage | undefined): boolean { + return proto3.util.equals(Resource, a, b); + } +} + +/** + * A Result of running a Function. + * + * @generated from message apiextensions.fn.proto.v1.Result + */ +export class Result extends Message { + /** + * Severity of this result. + * + * @generated from field: apiextensions.fn.proto.v1.Severity severity = 1; + */ + severity = Severity.UNSPECIFIED; + + /** + * Human-readable details about the result. + * + * @generated from field: string message = 2; + */ + message = ""; + + /** + * Optional PascalCase, machine-readable reason for this result. If omitted, + * the value will be ComposeResources. + * + * @generated from field: optional string reason = 3; + */ + reason?: string; + + /** + * The resources this result targets. + * + * @generated from field: optional apiextensions.fn.proto.v1.Target target = 4; + */ + target?: Target; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.Result"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "severity", kind: "enum", T: proto3.getEnumType(Severity) }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "reason", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "target", kind: "enum", T: proto3.getEnumType(Target), opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Result { + return new Result().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Result { + return new Result().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Result { + return new Result().fromJsonString(jsonString, options); + } + + static equals(a: Result | PlainMessage | undefined, b: Result | PlainMessage | undefined): boolean { + return proto3.util.equals(Result, a, b); + } +} + +/** + * Status condition to be applied to the composite resource. Condition may also + * optionally be applied to the composite resource's associated claim. For + * detailed information on proper usage of status conditions, please see + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties. + * + * @generated from message apiextensions.fn.proto.v1.Condition + */ +export class Condition extends Message { + /** + * Type of condition in PascalCase. + * + * @generated from field: string type = 1; + */ + type = ""; + + /** + * Status of the condition. + * + * @generated from field: apiextensions.fn.proto.v1.Status status = 2; + */ + status = Status.CONDITION_UNSPECIFIED; + + /** + * Reason contains a programmatic identifier indicating the reason for the + * condition's last transition. Producers of specific condition types may + * define expected values and meanings for this field, and whether the values + * are considered a guaranteed API. The value should be a PascalCase string. + * This field may not be empty. + * + * @generated from field: string reason = 3; + */ + reason = ""; + + /** + * Message is a human readable message indicating details about the + * transition. This may be an empty string. + * + * @generated from field: optional string message = 4; + */ + message?: string; + + /** + * The resources this condition targets. + * + * @generated from field: optional apiextensions.fn.proto.v1.Target target = 5; + */ + target?: Target; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1.Condition"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(Status) }, + { no: 3, name: "reason", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 5, name: "target", kind: "enum", T: proto3.getEnumType(Target), opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Condition { + return new Condition().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Condition { + return new Condition().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Condition { + return new Condition().fromJsonString(jsonString, options); + } + + static equals(a: Condition | PlainMessage | undefined, b: Condition | PlainMessage | undefined): boolean { + return proto3.util.equals(Condition, a, b); + } +} + diff --git a/src/gen/v1beta1/run_function_pb.ts b/src/gen/v1beta1/run_function_pb.ts new file mode 100644 index 0000000..03a235d --- /dev/null +++ b/src/gen/v1beta1/run_function_pb.ts @@ -0,0 +1,1035 @@ +// +//Copyright 2022 The Crossplane Authors. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file v1beta1/run_function.proto (package apiextensions.fn.proto.v1beta1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +// Generated from apiextensions/fn/proto/v1/run_function.proto by ../hack/duplicate_proto_type.sh. DO NOT EDIT. + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Duration, Message, proto3, Struct } from "@bufbuild/protobuf"; + +/** + * Ready indicates whether a composed resource should be considered ready. + * + * @generated from enum apiextensions.fn.proto.v1beta1.Ready + */ +export enum Ready { + /** + * @generated from enum value: READY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * True means the composed resource has been observed to be ready. + * + * @generated from enum value: READY_TRUE = 1; + */ + TRUE = 1, + + /** + * False means the composed resource has not been observed to be ready. + * + * @generated from enum value: READY_FALSE = 2; + */ + FALSE = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(Ready) +proto3.util.setEnumType(Ready, "apiextensions.fn.proto.v1beta1.Ready", [ + { no: 0, name: "READY_UNSPECIFIED" }, + { no: 1, name: "READY_TRUE" }, + { no: 2, name: "READY_FALSE" }, +]); + +/** + * Severity of Function results. + * + * @generated from enum apiextensions.fn.proto.v1beta1.Severity + */ +export enum Severity { + /** + * @generated from enum value: SEVERITY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Fatal results are fatal; subsequent Composition Functions may run, but + * the Composition Function pipeline run will be considered a failure and + * the first fatal result will be returned as an error. + * + * @generated from enum value: SEVERITY_FATAL = 1; + */ + FATAL = 1, + + /** + * Warning results are non-fatal; the entire Composition will run to + * completion but warning events and debug logs associated with the + * composite resource will be emitted. + * + * @generated from enum value: SEVERITY_WARNING = 2; + */ + WARNING = 2, + + /** + * Normal results are emitted as normal events and debug logs associated + * with the composite resource. + * + * @generated from enum value: SEVERITY_NORMAL = 3; + */ + NORMAL = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(Severity) +proto3.util.setEnumType(Severity, "apiextensions.fn.proto.v1beta1.Severity", [ + { no: 0, name: "SEVERITY_UNSPECIFIED" }, + { no: 1, name: "SEVERITY_FATAL" }, + { no: 2, name: "SEVERITY_WARNING" }, + { no: 3, name: "SEVERITY_NORMAL" }, +]); + +/** + * Target of Function results and conditions. + * + * @generated from enum apiextensions.fn.proto.v1beta1.Target + */ +export enum Target { + /** + * If the target is unspecified, the result targets the composite resource. + * + * @generated from enum value: TARGET_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Target the composite resource. Results that target the composite resource + * should include detailed, advanced information. + * + * @generated from enum value: TARGET_COMPOSITE = 1; + */ + COMPOSITE = 1, + + /** + * Target the composite and the claim. Results that target the composite and + * the claim should include only end-user friendly information. + * + * @generated from enum value: TARGET_COMPOSITE_AND_CLAIM = 2; + */ + COMPOSITE_AND_CLAIM = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(Target) +proto3.util.setEnumType(Target, "apiextensions.fn.proto.v1beta1.Target", [ + { no: 0, name: "TARGET_UNSPECIFIED" }, + { no: 1, name: "TARGET_COMPOSITE" }, + { no: 2, name: "TARGET_COMPOSITE_AND_CLAIM" }, +]); + +/** + * @generated from enum apiextensions.fn.proto.v1beta1.Status + */ +export enum Status { + /** + * @generated from enum value: STATUS_CONDITION_UNSPECIFIED = 0; + */ + CONDITION_UNSPECIFIED = 0, + + /** + * @generated from enum value: STATUS_CONDITION_UNKNOWN = 1; + */ + CONDITION_UNKNOWN = 1, + + /** + * @generated from enum value: STATUS_CONDITION_TRUE = 2; + */ + CONDITION_TRUE = 2, + + /** + * @generated from enum value: STATUS_CONDITION_FALSE = 3; + */ + CONDITION_FALSE = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(Status) +proto3.util.setEnumType(Status, "apiextensions.fn.proto.v1beta1.Status", [ + { no: 0, name: "STATUS_CONDITION_UNSPECIFIED" }, + { no: 1, name: "STATUS_CONDITION_UNKNOWN" }, + { no: 2, name: "STATUS_CONDITION_TRUE" }, + { no: 3, name: "STATUS_CONDITION_FALSE" }, +]); + +/** + * A RunFunctionRequest requests that the Composition Function be run. + * + * @generated from message apiextensions.fn.proto.v1beta1.RunFunctionRequest + */ +export class RunFunctionRequest extends Message { + /** + * Metadata pertaining to this request. + * + * @generated from field: apiextensions.fn.proto.v1beta1.RequestMeta meta = 1; + */ + meta?: RequestMeta; + + /** + * The observed state prior to invocation of a Function pipeline. State passed + * to each Function is fresh as of the time the pipeline was invoked, not as + * of the time each Function was invoked. + * + * @generated from field: apiextensions.fn.proto.v1beta1.State observed = 2; + */ + observed?: State; + + /** + * Desired state according to a Function pipeline. The state passed to a + * particular Function may have been accumulated by previous Functions in the + * pipeline. + * + * Note that the desired state must be a partial object with only the fields + * that this function (and its predecessors in the pipeline) wants to have + * set in the object. Copying a non-partial observed state to desired is most + * likely not what you want to do. Leaving out fields that had been returned + * as desired before will result in them being deleted from the objects in the + * cluster. + * + * @generated from field: apiextensions.fn.proto.v1beta1.State desired = 3; + */ + desired?: State; + + /** + * Optional input specific to this Function invocation. A JSON representation + * of the 'input' block of the relevant entry in a Composition's pipeline. + * + * @generated from field: optional google.protobuf.Struct input = 4; + */ + input?: Struct; + + /** + * Optional context. Crossplane may pass arbitary contextual information to a + * Function. A Function may also return context in its RunFunctionResponse, + * and that context will be passed to subsequent Functions. Crossplane + * discards all context returned by the last Function in the pipeline. + * + * @generated from field: optional google.protobuf.Struct context = 5; + */ + context?: Struct; + + /** + * Optional extra resources that the Function required. + * Note that extra resources is a map to Resources, plural. + * The map key corresponds to the key in a RunFunctionResponse's + * extra_resources field. If a Function requested extra resources that + * did not exist, Crossplane sets the map key to an empty Resources message to + * indicate that it attempted to satisfy the request. + * + * @generated from field: map extra_resources = 6; + */ + extraResources: { [key: string]: Resources } = {}; + + /** + * Optional credentials that this Function may use to communicate with an + * external system. + * + * @generated from field: map credentials = 7; + */ + credentials: { [key: string]: Credentials } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.RunFunctionRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "meta", kind: "message", T: RequestMeta }, + { no: 2, name: "observed", kind: "message", T: State }, + { no: 3, name: "desired", kind: "message", T: State }, + { no: 4, name: "input", kind: "message", T: Struct, opt: true }, + { no: 5, name: "context", kind: "message", T: Struct, opt: true }, + { no: 6, name: "extra_resources", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Resources} }, + { no: 7, name: "credentials", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Credentials} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RunFunctionRequest { + return new RunFunctionRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RunFunctionRequest { + return new RunFunctionRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RunFunctionRequest { + return new RunFunctionRequest().fromJsonString(jsonString, options); + } + + static equals(a: RunFunctionRequest | PlainMessage | undefined, b: RunFunctionRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RunFunctionRequest, a, b); + } +} + +/** + * Credentials that a Function may use to communicate with an external system. + * + * @generated from message apiextensions.fn.proto.v1beta1.Credentials + */ +export class Credentials extends Message { + /** + * Source of the credentials. + * + * @generated from oneof apiextensions.fn.proto.v1beta1.Credentials.source + */ + source: { + /** + * Credential data loaded by Crossplane, for example from a Secret. + * + * @generated from field: apiextensions.fn.proto.v1beta1.CredentialData credential_data = 1; + */ + value: CredentialData; + case: "credentialData"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.Credentials"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "credential_data", kind: "message", T: CredentialData, oneof: "source" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Credentials { + return new Credentials().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Credentials { + return new Credentials().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Credentials { + return new Credentials().fromJsonString(jsonString, options); + } + + static equals(a: Credentials | PlainMessage | undefined, b: Credentials | PlainMessage | undefined): boolean { + return proto3.util.equals(Credentials, a, b); + } +} + +/** + * CredentialData loaded by Crossplane, for example from a Secret. + * + * @generated from message apiextensions.fn.proto.v1beta1.CredentialData + */ +export class CredentialData extends Message { + /** + * @generated from field: map data = 1; + */ + data: { [key: string]: Uint8Array } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.CredentialData"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CredentialData { + return new CredentialData().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CredentialData { + return new CredentialData().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CredentialData { + return new CredentialData().fromJsonString(jsonString, options); + } + + static equals(a: CredentialData | PlainMessage | undefined, b: CredentialData | PlainMessage | undefined): boolean { + return proto3.util.equals(CredentialData, a, b); + } +} + +/** + * Resources represents the state of several Crossplane resources. + * + * @generated from message apiextensions.fn.proto.v1beta1.Resources + */ +export class Resources extends Message { + /** + * @generated from field: repeated apiextensions.fn.proto.v1beta1.Resource items = 1; + */ + items: Resource[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.Resources"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "items", kind: "message", T: Resource, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Resources { + return new Resources().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Resources { + return new Resources().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Resources { + return new Resources().fromJsonString(jsonString, options); + } + + static equals(a: Resources | PlainMessage | undefined, b: Resources | PlainMessage | undefined): boolean { + return proto3.util.equals(Resources, a, b); + } +} + +/** + * A RunFunctionResponse contains the result of a Composition Function run. + * + * @generated from message apiextensions.fn.proto.v1beta1.RunFunctionResponse + */ +export class RunFunctionResponse extends Message { + /** + * Metadata pertaining to this response. + * + * @generated from field: apiextensions.fn.proto.v1beta1.ResponseMeta meta = 1; + */ + meta?: ResponseMeta; + + /** + * Desired state according to a Function pipeline. Functions may add desired + * state, and may mutate or delete any part of the desired state they are + * concerned with. A Function must pass through any part of the desired state + * that it is not concerned with. + * + * + * Note that the desired state must be a partial object with only the fields + * that this function (and its predecessors in the pipeline) wants to have + * set in the object. Copying a non-partial observed state to desired is most + * likely not what you want to do. Leaving out fields that had been returned + * as desired before will result in them being deleted from the objects in the + * cluster. + * + * @generated from field: apiextensions.fn.proto.v1beta1.State desired = 2; + */ + desired?: State; + + /** + * Results of the Function run. Results are used for observability purposes. + * + * @generated from field: repeated apiextensions.fn.proto.v1beta1.Result results = 3; + */ + results: Result[] = []; + + /** + * Optional context to be passed to the next Function in the pipeline as part + * of the RunFunctionRequest. Dropped on the last function in the pipeline. + * + * @generated from field: optional google.protobuf.Struct context = 4; + */ + context?: Struct; + + /** + * Requirements that must be satisfied for this Function to run successfully. + * + * @generated from field: apiextensions.fn.proto.v1beta1.Requirements requirements = 5; + */ + requirements?: Requirements; + + /** + * Status conditions to be applied to the composite resource. Conditions may also + * optionally be applied to the composite resource's associated claim. + * + * @generated from field: repeated apiextensions.fn.proto.v1beta1.Condition conditions = 6; + */ + conditions: Condition[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.RunFunctionResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "meta", kind: "message", T: ResponseMeta }, + { no: 2, name: "desired", kind: "message", T: State }, + { no: 3, name: "results", kind: "message", T: Result, repeated: true }, + { no: 4, name: "context", kind: "message", T: Struct, opt: true }, + { no: 5, name: "requirements", kind: "message", T: Requirements }, + { no: 6, name: "conditions", kind: "message", T: Condition, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RunFunctionResponse { + return new RunFunctionResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RunFunctionResponse { + return new RunFunctionResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RunFunctionResponse { + return new RunFunctionResponse().fromJsonString(jsonString, options); + } + + static equals(a: RunFunctionResponse | PlainMessage | undefined, b: RunFunctionResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RunFunctionResponse, a, b); + } +} + +/** + * RequestMeta contains metadata pertaining to a RunFunctionRequest. + * + * @generated from message apiextensions.fn.proto.v1beta1.RequestMeta + */ +export class RequestMeta extends Message { + /** + * An opaque string identifying the content of the request. Two identical + * requests should have the same tag. + * + * @generated from field: string tag = 1; + */ + tag = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.RequestMeta"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tag", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RequestMeta { + return new RequestMeta().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RequestMeta { + return new RequestMeta().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RequestMeta { + return new RequestMeta().fromJsonString(jsonString, options); + } + + static equals(a: RequestMeta | PlainMessage | undefined, b: RequestMeta | PlainMessage | undefined): boolean { + return proto3.util.equals(RequestMeta, a, b); + } +} + +/** + * Requirements that must be satisfied for a Function to run successfully. + * + * @generated from message apiextensions.fn.proto.v1beta1.Requirements + */ +export class Requirements extends Message { + /** + * Extra resources that this Function requires. + * The map key uniquely identifies the group of resources. + * + * @generated from field: map extra_resources = 1; + */ + extraResources: { [key: string]: ResourceSelector } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.Requirements"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "extra_resources", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: ResourceSelector} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Requirements { + return new Requirements().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Requirements { + return new Requirements().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Requirements { + return new Requirements().fromJsonString(jsonString, options); + } + + static equals(a: Requirements | PlainMessage | undefined, b: Requirements | PlainMessage | undefined): boolean { + return proto3.util.equals(Requirements, a, b); + } +} + +/** + * ResourceSelector selects a group of resources, either by name or by label. + * + * @generated from message apiextensions.fn.proto.v1beta1.ResourceSelector + */ +export class ResourceSelector extends Message { + /** + * API version of resources to select. + * + * @generated from field: string api_version = 1; + */ + apiVersion = ""; + + /** + * Kind of resources to select. + * + * @generated from field: string kind = 2; + */ + kind = ""; + + /** + * Resources to match. + * + * @generated from oneof apiextensions.fn.proto.v1beta1.ResourceSelector.match + */ + match: { + /** + * Match the resource with this name. + * + * @generated from field: string match_name = 3; + */ + value: string; + case: "matchName"; + } | { + /** + * Match all resources with these labels. + * + * @generated from field: apiextensions.fn.proto.v1beta1.MatchLabels match_labels = 4; + */ + value: MatchLabels; + case: "matchLabels"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.ResourceSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "api_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "kind", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "match_name", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "match" }, + { no: 4, name: "match_labels", kind: "message", T: MatchLabels, oneof: "match" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResourceSelector { + return new ResourceSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResourceSelector { + return new ResourceSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResourceSelector { + return new ResourceSelector().fromJsonString(jsonString, options); + } + + static equals(a: ResourceSelector | PlainMessage | undefined, b: ResourceSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(ResourceSelector, a, b); + } +} + +/** + * MatchLabels defines a set of labels to match resources against. + * + * @generated from message apiextensions.fn.proto.v1beta1.MatchLabels + */ +export class MatchLabels extends Message { + /** + * @generated from field: map labels = 1; + */ + labels: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.MatchLabels"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "labels", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MatchLabels { + return new MatchLabels().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MatchLabels { + return new MatchLabels().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MatchLabels { + return new MatchLabels().fromJsonString(jsonString, options); + } + + static equals(a: MatchLabels | PlainMessage | undefined, b: MatchLabels | PlainMessage | undefined): boolean { + return proto3.util.equals(MatchLabels, a, b); + } +} + +/** + * ResponseMeta contains metadata pertaining to a RunFunctionResponse. + * + * @generated from message apiextensions.fn.proto.v1beta1.ResponseMeta + */ +export class ResponseMeta extends Message { + /** + * An opaque string identifying the content of the request. Must match the + * meta.tag of the corresponding RunFunctionRequest. + * + * @generated from field: string tag = 1; + */ + tag = ""; + + /** + * Time-to-live of this response. Deterministic Functions with no side-effects + * (e.g. simple templating Functions) may specify a TTL. Crossplane may choose + * to cache responses until the TTL expires. + * + * @generated from field: optional google.protobuf.Duration ttl = 2; + */ + ttl?: Duration; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.ResponseMeta"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tag", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "ttl", kind: "message", T: Duration, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResponseMeta { + return new ResponseMeta().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResponseMeta { + return new ResponseMeta().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResponseMeta { + return new ResponseMeta().fromJsonString(jsonString, options); + } + + static equals(a: ResponseMeta | PlainMessage | undefined, b: ResponseMeta | PlainMessage | undefined): boolean { + return proto3.util.equals(ResponseMeta, a, b); + } +} + +/** + * State of the composite resource (XR) and any composed resources. + * + * @generated from message apiextensions.fn.proto.v1beta1.State + */ +export class State extends Message { + /** + * The state of the composite resource (XR). + * + * @generated from field: apiextensions.fn.proto.v1beta1.Resource composite = 1; + */ + composite?: Resource; + + /** + * The state of any composed resources. + * + * @generated from field: map resources = 2; + */ + resources: { [key: string]: Resource } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.State"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "composite", kind: "message", T: Resource }, + { no: 2, name: "resources", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Resource} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): State { + return new State().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): State { + return new State().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): State { + return new State().fromJsonString(jsonString, options); + } + + static equals(a: State | PlainMessage | undefined, b: State | PlainMessage | undefined): boolean { + return proto3.util.equals(State, a, b); + } +} + +/** + * A Resource represents the state of a composite or composed resource. + * + * @generated from message apiextensions.fn.proto.v1beta1.Resource + */ +export class Resource extends Message { + /** + * The JSON representation of the resource. + * + * * Crossplane will set this field in a RunFunctionRequest to the entire + * observed state of a resource - including its metadata, spec, and status. + * + * * A Function should set this field in a RunFunctionRequest to communicate + * the desired state of a composite or composed resource. + * + * * A Function may only specify the desired status of a composite resource - + * not its metadata or spec. A Function should not return desired metadata + * or spec for a composite resource. This will be ignored. + * + * * A Function may not specify the desired status of a composed resource - + * only its metadata and spec. A Function should not return desired status + * for a composed resource. This will be ignored. + * + * @generated from field: google.protobuf.Struct resource = 1; + */ + resource?: Struct; + + /** + * The resource's connection details. + * + * * Crossplane will set this field in a RunFunctionRequest to communicate the + * the observed connection details of a composite or composed resource. + * + * * A Function should set this field in a RunFunctionResponse to indicate the + * desired connection details of the composite resource. + * + * * A Function should not set this field in a RunFunctionResponse to indicate + * the desired connection details of a composed resource. This will be + * ignored. + * + * @generated from field: map connection_details = 2; + */ + connectionDetails: { [key: string]: Uint8Array } = {}; + + /** + * Ready indicates whether the resource should be considered ready. + * + * * Crossplane will never set this field in a RunFunctionRequest. + * + * * A Function should set this field to READY_TRUE in a RunFunctionResponse + * to indicate that a desired composed resource is ready. + * + * * A Function should not set this field in a RunFunctionResponse to indicate + * that the desired composite resource is ready. This will be ignored. + * + * @generated from field: apiextensions.fn.proto.v1beta1.Ready ready = 3; + */ + ready = Ready.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.Resource"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource", kind: "message", T: Struct }, + { no: 2, name: "connection_details", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 12 /* ScalarType.BYTES */} }, + { no: 3, name: "ready", kind: "enum", T: proto3.getEnumType(Ready) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Resource { + return new Resource().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Resource { + return new Resource().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Resource { + return new Resource().fromJsonString(jsonString, options); + } + + static equals(a: Resource | PlainMessage | undefined, b: Resource | PlainMessage | undefined): boolean { + return proto3.util.equals(Resource, a, b); + } +} + +/** + * A Result of running a Function. + * + * @generated from message apiextensions.fn.proto.v1beta1.Result + */ +export class Result extends Message { + /** + * Severity of this result. + * + * @generated from field: apiextensions.fn.proto.v1beta1.Severity severity = 1; + */ + severity = Severity.UNSPECIFIED; + + /** + * Human-readable details about the result. + * + * @generated from field: string message = 2; + */ + message = ""; + + /** + * Optional PascalCase, machine-readable reason for this result. If omitted, + * the value will be ComposeResources. + * + * @generated from field: optional string reason = 3; + */ + reason?: string; + + /** + * The resources this result targets. + * + * @generated from field: optional apiextensions.fn.proto.v1beta1.Target target = 4; + */ + target?: Target; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.Result"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "severity", kind: "enum", T: proto3.getEnumType(Severity) }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "reason", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 4, name: "target", kind: "enum", T: proto3.getEnumType(Target), opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Result { + return new Result().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Result { + return new Result().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Result { + return new Result().fromJsonString(jsonString, options); + } + + static equals(a: Result | PlainMessage | undefined, b: Result | PlainMessage | undefined): boolean { + return proto3.util.equals(Result, a, b); + } +} + +/** + * Status condition to be applied to the composite resource. Condition may also + * optionally be applied to the composite resource's associated claim. For + * detailed information on proper usage of status conditions, please see + * https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties. + * + * @generated from message apiextensions.fn.proto.v1beta1.Condition + */ +export class Condition extends Message { + /** + * Type of condition in PascalCase. + * + * @generated from field: string type = 1; + */ + type = ""; + + /** + * Status of the condition. + * + * @generated from field: apiextensions.fn.proto.v1beta1.Status status = 2; + */ + status = Status.CONDITION_UNSPECIFIED; + + /** + * Reason contains a programmatic identifier indicating the reason for the + * condition's last transition. Producers of specific condition types may + * define expected values and meanings for this field, and whether the values + * are considered a guaranteed API. The value should be a PascalCase string. + * This field may not be empty. + * + * @generated from field: string reason = 3; + */ + reason = ""; + + /** + * Message is a human readable message indicating details about the + * transition. This may be an empty string. + * + * @generated from field: optional string message = 4; + */ + message?: string; + + /** + * The resources this condition targets. + * + * @generated from field: optional apiextensions.fn.proto.v1beta1.Target target = 5; + */ + target?: Target; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "apiextensions.fn.proto.v1beta1.Condition"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(Status) }, + { no: 3, name: "reason", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 5, name: "target", kind: "enum", T: proto3.getEnumType(Target), opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Condition { + return new Condition().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Condition { + return new Condition().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Condition { + return new Condition().fromJsonString(jsonString, options); + } + + static equals(a: Condition | PlainMessage | undefined, b: Condition | PlainMessage | undefined): boolean { + return proto3.util.equals(Condition, a, b); + } +} + diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000..c86b50d --- /dev/null +++ b/src/server.ts @@ -0,0 +1,20 @@ +import { fastify } from "fastify"; +import { fastifyConnectPlugin } from "@connectrpc/connect-fastify"; +import routes from "./connect"; + +async function main() { + const server = fastify(); + await server.register(fastifyConnectPlugin, { + routes, + }); + server.get("/", (_, reply) => { + reply.type("text/plain"); + reply.send("Hello World!"); + }); + await server.listen({ host: "localhost", port: 8080 }); + console.log("server is listening at", server.addresses()); +} + +// You can remove the main() wrapper if you set type: module in your package.json, +// and update your tsconfig.json with target: es2017 and module: es2022. +void main(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8bb6097 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,108 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +}