// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`OpenAPI Gateway Ts With Docs Unit Tests With Docs 1`] = ` Object { ".eslintrc.json": Object { "env": Object { "jest": true, "node": true, }, "extends": Array [ "plugin:import/typescript", ], "ignorePatterns": Array [ "*.js", "*.d.ts", "node_modules/", "*.generated.ts", "coverage", "!.projenrc.js", ], "overrides": Array [ Object { "files": Array [ ".projenrc.js", ], "rules": Object { "@typescript-eslint/no-require-imports": "off", "import/no-extraneous-dependencies": "off", }, }, ], "parser": "@typescript-eslint/parser", "parserOptions": Object { "ecmaVersion": 2018, "project": "./tsconfig.dev.json", "sourceType": "module", }, "plugins": Array [ "@typescript-eslint", "import", ], "root": true, "rules": Object { "@typescript-eslint/indent": Array [ "error", 2, ], "@typescript-eslint/member-delimiter-style": Array [ "error", ], "@typescript-eslint/member-ordering": Array [ "error", Object { "default": Array [ "public-static-field", "public-static-method", "protected-static-field", "protected-static-method", "private-static-field", "private-static-method", "field", "constructor", "method", ], }, ], "@typescript-eslint/no-floating-promises": Array [ "error", ], "@typescript-eslint/no-require-imports": Array [ "error", ], "@typescript-eslint/no-shadow": Array [ "error", ], "@typescript-eslint/return-await": Array [ "error", ], "array-bracket-newline": Array [ "error", "consistent", ], "array-bracket-spacing": Array [ "error", "never", ], "brace-style": Array [ "error", "1tbs", Object { "allowSingleLine": true, }, ], "comma-dangle": Array [ "error", "always-multiline", ], "comma-spacing": Array [ "error", Object { "after": true, "before": false, }, ], "curly": Array [ "error", "multi-line", "consistent", ], "dot-notation": Array [ "error", ], "import/no-extraneous-dependencies": Array [ "error", Object { "devDependencies": Array [ "**/test/**", "**/build-tools/**", ], "optionalDependencies": false, "peerDependencies": true, }, ], "import/no-unresolved": Array [ 2, Object { "ignore": Array [ "@test/my-api-typescript", ], }, ], "import/order": Array [ "warn", Object { "alphabetize": Object { "caseInsensitive": true, "order": "asc", }, "groups": Array [ "builtin", "external", ], }, ], "indent": Array [ "off", ], "key-spacing": Array [ "error", ], "keyword-spacing": Array [ "error", ], "max-len": Array [ "error", Object { "code": 150, "ignoreComments": true, "ignoreRegExpLiterals": true, "ignoreStrings": true, "ignoreTemplateLiterals": true, "ignoreUrls": true, }, ], "no-bitwise": Array [ "error", ], "no-duplicate-imports": Array [ "error", ], "no-multi-spaces": Array [ "error", Object { "ignoreEOLComments": false, }, ], "no-multiple-empty-lines": Array [ "error", ], "no-return-await": Array [ "off", ], "no-shadow": Array [ "off", ], "no-trailing-spaces": Array [ "error", ], "object-curly-newline": Array [ "error", Object { "consistent": true, "multiline": true, }, ], "object-curly-spacing": Array [ "error", "always", ], "object-property-newline": Array [ "error", Object { "allowAllPropertiesOnSameLine": true, }, ], "quote-props": Array [ "error", "consistent-as-needed", ], "quotes": Array [ "error", "single", Object { "avoidEscape": true, }, ], "semi": Array [ "error", "always", ], "space-before-blocks": Array [ "error", ], }, "settings": Object { "import/parsers": Object { "@typescript-eslint/parser": Array [ ".ts", ".tsx", ], }, "import/resolver": Object { "node": Object {}, "typescript": Object { "alwaysTryTypes": true, "project": "./tsconfig.dev.json", }, }, }, }, ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". *.snap linguist-generated /.eslintrc.json linguist-generated /.gitattributes linguist-generated /.github/pull_request_template.md linguist-generated /.github/workflows/build.yml linguist-generated /.github/workflows/pull-request-lint.yml linguist-generated /.github/workflows/release.yml linguist-generated /.github/workflows/upgrade-mainline.yml linguist-generated /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated /.projen/tasks.json linguist-generated /generated/README.md linguist-generated /LICENSE linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", ".github/pull_request_template.md": "Fixes #", ".github/workflows/build.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". name: build on: pull_request: {} workflow_dispatch: {} jobs: build: runs-on: ubuntu-latest permissions: contents: write outputs: self_mutation_happened: \${{ steps.self_mutation.outputs.self_mutation_happened }} env: CI: \\"true\\" steps: - name: Checkout uses: actions/checkout@v3 with: ref: \${{ github.event.pull_request.head.ref }} repository: \${{ github.event.pull_request.head.repo.full_name }} - name: Install dependencies run: yarn install --check-files - name: build run: npx projen build - name: Find mutations id: self_mutation run: |- git add . git diff --staged --patch --exit-code > .repo.patch || echo \\"self_mutation_happened=true\\" >> $GITHUB_OUTPUT - name: Upload patch if: steps.self_mutation.outputs.self_mutation_happened uses: actions/upload-artifact@v3 with: name: .repo.patch path: .repo.patch - name: Fail build on mutation if: steps.self_mutation.outputs.self_mutation_happened run: |- echo \\"::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch.\\" cat .repo.patch exit 1 self-mutation: needs: build runs-on: ubuntu-latest permissions: contents: write if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository) steps: - name: Checkout uses: actions/checkout@v3 with: token: \${{ secrets.PROJEN_GITHUB_TOKEN }} ref: \${{ github.event.pull_request.head.ref }} repository: \${{ github.event.pull_request.head.repo.full_name }} - name: Download patch uses: actions/download-artifact@v3 with: name: .repo.patch path: \${{ runner.temp }} - name: Apply patch run: '[ -s \${{ runner.temp }}/.repo.patch ] && git apply \${{ runner.temp }}/.repo.patch || echo \\"Empty patch. Skipping.\\"' - name: Set git identity run: |- git config user.name \\"github-actions\\" git config user.email \\"github-actions@github.com\\" - name: Push changes run: |2- git add . git commit -s -m \\"chore: self mutation\\" git push origin HEAD:\${{ github.event.pull_request.head.ref }} ", ".github/workflows/pull-request-lint.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". name: pull-request-lint on: pull_request_target: types: - labeled - opened - synchronize - reopened - ready_for_review - edited jobs: validate: name: Validate PR title runs-on: ubuntu-latest permissions: pull-requests: write steps: - uses: amannn/action-semantic-pull-request@v5.0.2 env: GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} with: types: |- feat fix chore requireScope: false ", ".github/workflows/release.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". name: release on: push: branches: - mainline workflow_dispatch: {} jobs: release: runs-on: ubuntu-latest permissions: contents: write outputs: latest_commit: \${{ steps.git_remote.outputs.latest_commit }} env: CI: \\"true\\" steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set git identity run: |- git config user.name \\"github-actions\\" git config user.email \\"github-actions@github.com\\" - name: Install dependencies run: yarn install --check-files --frozen-lockfile - name: release:mainline run: npx projen release:mainline - name: Check for new commits id: git_remote run: echo \\"latest_commit=$(git ls-remote origin -h \${{ github.ref }} | cut -f1)\\" >> $GITHUB_OUTPUT - name: Backup artifact permissions if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} run: cd dist && getfacl -R . > permissions-backup.acl continue-on-error: true - name: Upload artifact if: \${{ steps.git_remote.outputs.latest_commit == github.sha }} uses: actions/upload-artifact@v3 with: name: build-artifact path: dist release_github: name: Publish to GitHub Releases needs: release runs-on: ubuntu-latest permissions: contents: write if: needs.release.outputs.latest_commit == github.sha steps: - uses: actions/setup-node@v3 with: node-version: 16.x - name: Download build artifacts uses: actions/download-artifact@v3 with: name: build-artifact path: dist - name: Restore build artifact permissions run: cd dist && setfacl --restore=permissions-backup.acl continue-on-error: true - name: Release env: GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: \${{ github.repository }} GITHUB_REF: \${{ github.ref }} run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q \\"Release.tag_name already exists\\" $errout; then cat $errout; exit $exitcode; fi ", ".github/workflows/upgrade-mainline.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". name: upgrade-mainline on: workflow_dispatch: {} schedule: - cron: 0 0 * * * jobs: upgrade: name: Upgrade runs-on: ubuntu-latest permissions: contents: read outputs: patch_created: \${{ steps.create_patch.outputs.patch_created }} steps: - name: Checkout uses: actions/checkout@v3 with: ref: mainline - name: Install dependencies run: yarn install --check-files --frozen-lockfile - name: Upgrade dependencies run: npx projen upgrade - name: Find mutations id: create_patch run: |- git add . git diff --staged --patch --exit-code > .repo.patch || echo \\"patch_created=true\\" >> $GITHUB_OUTPUT - name: Upload patch if: steps.create_patch.outputs.patch_created uses: actions/upload-artifact@v3 with: name: .repo.patch path: .repo.patch pr: name: Create Pull Request needs: upgrade runs-on: ubuntu-latest permissions: contents: read if: \${{ needs.upgrade.outputs.patch_created }} steps: - name: Checkout uses: actions/checkout@v3 with: ref: mainline - name: Download patch uses: actions/download-artifact@v3 with: name: .repo.patch path: \${{ runner.temp }} - name: Apply patch run: '[ -s \${{ runner.temp }}/.repo.patch ] && git apply \${{ runner.temp }}/.repo.patch || echo \\"Empty patch. Skipping.\\"' - name: Set git identity run: |- git config user.name \\"github-actions\\" git config user.email \\"github-actions@github.com\\" - name: Create Pull Request id: create-pr uses: peter-evans/create-pull-request@v4 with: token: \${{ secrets.PROJEN_GITHUB_TOKEN }} commit-message: |- chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/\${{ github.repository }}/actions/runs/\${{ github.run_id }} ------ *Automatically created by projen via the \\"upgrade-mainline\\" workflow* branch: github-actions/upgrade-mainline title: \\"chore(deps): upgrade dependencies\\" body: |- Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/\${{ github.repository }}/actions/runs/\${{ github.run_id }} ------ *Automatically created by projen via the \\"upgrade-mainline\\" workflow* author: github-actions committer: github-actions signoff: true ", ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json !/.projen/files.json !/.github/workflows/pull-request-lint.yml !/package.json !/LICENSE !/.npmignore logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json pids *.pid *.seed *.pid.lock lib-cov coverage *.lcov .nyc_output build/Release node_modules/ jspm_packages/ *.tsbuildinfo .eslintcache *.tgz .yarn-integrity .cache !/.projenrc.js /test-reports/ junit.xml /coverage/ !/.github/workflows/build.yml /dist/changelog.md /dist/version.txt !/.github/workflows/release.yml !/.mergify.yml !/.github/workflows/upgrade-mainline.yml !/.github/pull_request_template.md !/test/ !/tsconfig.json !/tsconfig.dev.json !/src/ /lib /dist/ !/.eslintrc.json !/generated/README.md ", ".mergify.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". queue_rules: - name: default update_method: merge conditions: - \\"#approved-reviews-by>=1\\" - -label~=(do-not-merge) - status-success=build pull_request_rules: - name: Automatic merge on approval and successful build actions: delete_head_branch: {} queue: method: squash name: default commit_message_template: |- {{ title }} (#{{ number }}) {{ body }} conditions: - \\"#approved-reviews-by>=1\\" - -label~=(do-not-merge) - status-success=build ", ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". /.projen/ /test-reports/ junit.xml /coverage/ permissions-backup.acl /dist/changelog.md /dist/version.txt /.mergify.yml /test/ /tsconfig.dev.json /src/ !/lib/ !/lib/**/*.js !/lib/**/*.d.ts dist /tsconfig.json /.github/ /.vscode/ /.idea/ /.projenrc.js tsconfig.tsbuildinfo /.eslintrc.json ", ".projen/deps.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "dependencies": Array [ Object { "name": "@types/jest", "type": "build", }, Object { "name": "@types/node", "type": "build", "version": "^16", }, Object { "name": "@typescript-eslint/eslint-plugin", "type": "build", "version": "^5", }, Object { "name": "@typescript-eslint/parser", "type": "build", "version": "^5", }, Object { "name": "eslint-import-resolver-node", "type": "build", }, Object { "name": "eslint-import-resolver-typescript", "type": "build", }, Object { "name": "eslint-plugin-import", "type": "build", }, Object { "name": "eslint", "type": "build", "version": "^8", }, Object { "name": "jest", "type": "build", }, Object { "name": "jest-junit", "type": "build", "version": "^15", }, Object { "name": "npm-check-updates", "type": "build", "version": "^16", }, Object { "name": "projen", "type": "build", }, Object { "name": "standard-version", "type": "build", "version": "^9", }, Object { "name": "ts-jest", "type": "build", }, Object { "name": "typescript", "type": "build", }, Object { "name": "@aws-prototyping-sdk/open-api-gateway", "type": "runtime", }, Object { "name": "@test/my-api-typescript", "type": "runtime", "version": "file:./generated/typescript", }, Object { "name": "aws-cdk-lib", "type": "runtime", }, Object { "name": "cdk-nag", "type": "runtime", }, Object { "name": "constructs", "type": "runtime", }, ], }, ".projen/files.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "files": Array [ ".eslintrc.json", ".gitattributes", ".github/pull_request_template.md", ".github/workflows/build.yml", ".github/workflows/pull-request-lint.yml", ".github/workflows/release.yml", ".github/workflows/upgrade-mainline.yml", ".gitignore", ".mergify.yml", ".npmignore", ".projen/deps.json", ".projen/files.json", ".projen/tasks.json", "generated/README.md", "LICENSE", "tsconfig.dev.json", "tsconfig.json", ], }, ".projen/tasks.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "env": Object { "PATH": "$(npx -c \\"node -e \\\\\\"console.log(process.env.PATH)\\\\\\"\\")", }, "tasks": Object { "build": Object { "description": "Full release build", "name": "build", "steps": Array [ Object { "spawn": "default", }, Object { "spawn": "pre-compile", }, Object { "spawn": "compile", }, Object { "spawn": "post-compile", }, Object { "spawn": "test", }, Object { "spawn": "package", }, ], }, "bump": Object { "condition": "! git log --oneline -1 | grep -q \\"chore(release):\\"", "description": "Bumps version based on latest git tag and generates a changelog entry", "env": Object { "BUMPFILE": "dist/version.txt", "CHANGELOG": "dist/changelog.md", "OUTFILE": "package.json", "RELEASETAG": "dist/releasetag.txt", "RELEASE_TAG_PREFIX": "", }, "name": "bump", "steps": Array [ Object { "builtin": "release/bump-version", }, ], }, "clobber": Object { "condition": "git diff --exit-code > /dev/null", "description": "hard resets to HEAD of origin and cleans the local repo", "env": Object { "BRANCH": "$(git branch --show-current)", }, "name": "clobber", "steps": Array [ Object { "exec": "git checkout -b scratch", "name": "save current HEAD in \\"scratch\\" branch", }, Object { "exec": "git checkout $BRANCH", }, Object { "exec": "git fetch origin", "name": "fetch latest changes from origin", }, Object { "exec": "git reset --hard origin/$BRANCH", "name": "hard reset to origin commit", }, Object { "exec": "git clean -fdx", "name": "clean all untracked files", }, Object { "say": "ready to rock! (unpushed commits are under the \\"scratch\\" branch)", }, ], }, "compile": Object { "description": "Only compile", "name": "compile", "steps": Array [ Object { "exec": "tsc --build", }, ], }, "default": Object { "description": "Synthesize project files", "name": "default", "steps": Array [ Object { "exec": "node .projenrc.js", }, ], }, "eject": Object { "description": "Remove projen from the project", "env": Object { "PROJEN_EJECTING": "true", }, "name": "eject", "steps": Array [ Object { "spawn": "default", }, ], }, "eslint": Object { "description": "Runs eslint against the codebase", "name": "eslint", "steps": Array [ Object { "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools .projenrc.js", }, ], }, "install": Object { "description": "Install project dependencies and update lockfile (non-frozen)", "name": "install", "steps": Array [ Object { "exec": "yarn install --check-files", }, ], }, "install:ci": Object { "description": "Install project dependencies using frozen lockfile", "name": "install:ci", "steps": Array [ Object { "exec": "yarn install --check-files --frozen-lockfile", }, ], }, "package": Object { "description": "Creates the distribution package", "name": "package", "steps": Array [ Object { "exec": "mkdir -p dist/js", }, Object { "exec": "mv $(npm pack) dist/js/", }, ], }, "post-compile": Object { "description": "Runs after successful compilation", "name": "post-compile", }, "post-upgrade": Object { "description": "Runs after upgrading dependencies", "name": "post-upgrade", }, "pre-compile": Object { "description": "Prepare the project for compilation", "name": "pre-compile", "steps": Array [ Object { "exec": "rm -rf lib", }, ], }, "release:mainline": Object { "description": "Prepare a release from \\"mainline\\" branch", "env": Object { "RELEASE": "true", }, "name": "release:mainline", "steps": Array [ Object { "exec": "rm -fr dist", }, Object { "spawn": "bump", }, Object { "spawn": "build", }, Object { "spawn": "unbump", }, Object { "exec": "git diff --ignore-space-at-eol --exit-code", }, ], }, "test": Object { "description": "Run tests", "name": "test", "steps": Array [ Object { "exec": "jest --passWithNoTests --updateSnapshot", "receiveArgs": true, }, Object { "spawn": "eslint", }, ], }, "test:watch": Object { "description": "Run jest in watch mode", "name": "test:watch", "steps": Array [ Object { "exec": "jest --watch", }, ], }, "unbump": Object { "description": "Restores version to 0.0.0", "env": Object { "BUMPFILE": "dist/version.txt", "CHANGELOG": "dist/changelog.md", "OUTFILE": "package.json", "RELEASETAG": "dist/releasetag.txt", "RELEASE_TAG_PREFIX": "", }, "name": "unbump", "steps": Array [ Object { "builtin": "release/reset-version", }, ], }, "upgrade": Object { "description": "upgrade dependencies", "env": Object { "CI": "0", }, "name": "upgrade", "steps": Array [ Object { "exec": "yarn upgrade npm-check-updates", }, Object { "exec": "npm-check-updates --dep dev --upgrade --target=minor --reject='@test/my-api-typescript'", }, Object { "exec": "npm-check-updates --dep optional --upgrade --target=minor --reject='@test/my-api-typescript'", }, Object { "exec": "npm-check-updates --dep peer --upgrade --target=minor --reject='@test/my-api-typescript'", }, Object { "exec": "npm-check-updates --dep prod --upgrade --target=minor --reject='@test/my-api-typescript'", }, Object { "exec": "npm-check-updates --dep bundle --upgrade --target=minor --reject='@test/my-api-typescript'", }, Object { "exec": "yarn install --check-files", }, Object { "exec": "yarn upgrade", }, Object { "exec": "npx projen", }, Object { "spawn": "post-upgrade", }, ], }, "watch": Object { "description": "Watch & compile in the background", "name": "watch", "steps": Array [ Object { "exec": "tsc --build -w", }, ], }, }, }, "LICENSE": " Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \\"License\\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \\"Licensor\\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \\"Legal Entity\\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \\"control\\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \\"You\\" (or \\"Your\\") shall mean an individual or Legal Entity exercising permissions granted by this License. \\"Source\\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \\"Object\\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \\"Work\\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \\"Derivative Works\\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \\"Contribution\\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \\"submitted\\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \\"Not a Contribution.\\" \\"Contributor\\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \\"NOTICE\\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \\"AS IS\\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \\"[]\\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \\"printed page\\" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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. ", "README.md": "# replace this", "generated/.client-settings.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "clientLanguages": Array [ "typescript", ], "documentationFormats": Array [ "html2", "markdown", "plantuml", ], }, "generated/README.md": "## Generated Clients This directory contains generated client code based on your OpenAPI Specification file (spec.yaml). Like other \`projen\` managed files, this directory should be checked in to source control, but should not be edited manually.", "generated/documentation/html2/.openapi-generator-ignore": "# OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md ", "generated/documentation/html2/.openapi-generator/FILES": ".openapi-generator-ignore index.html ", "generated/documentation/html2/.openapi-generator/VERSION": "6.3.0", "generated/documentation/html2/index.html": " Example API

Example API

API and SDK Documentation

Version: 1.0.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Default

sayHello


/hello

Usage and SDK Samples

curl -X GET \\\\
 -H \\"Accept: application/json\\" \\\\
 \\"http://localhost/hello?name=name_example\\"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        String name = name_example; // String | 

        try {
            SayHelloResponseContent result = apiInstance.sayHello(name);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println(\\"Exception when calling DefaultApi#sayHello\\");
            e.printStackTrace();
        }
    }
}
import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String name = name_example; // String | 

        try {
            SayHelloResponseContent result = apiInstance.sayHello(name);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println(\\"Exception when calling DefaultApi#sayHello\\");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *name = name_example; //  (default to null)

[apiInstance sayHelloWith:name
              completionHandler: ^(SayHelloResponseContent output, NSError* error) {
    if (output) {
        NSLog(@\\"%@\\", output);
    }
    if (error) {
        NSLog(@\\"Error: %@\\", error);
    }
}];
var ExampleApi = require('example_api');

// Create an instance of the API class
var api = new ExampleApi.DefaultApi()
var name = name_example; // {String} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.sayHello(name, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class sayHelloExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var name = name_example;  // String |  (default to null)

            try {
                SayHelloResponseContent result = apiInstance.sayHello(name);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print(\\"Exception when calling DefaultApi.sayHello: \\" + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\\\\Client\\\\Api\\\\DefaultApi();
$name = name_example; // String | 

try {
    $result = $api_instance->sayHello($name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->sayHello: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $name = name_example; # String | 

eval {
    my $result = $api_instance->sayHello(name => $name);
    print Dumper($result);
};
if ($@) {
    warn \\"Exception when calling DefaultApi->sayHello: $@\\\\n\\";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
name = name_example # String |  (default to null)

try:
    api_response = api_instance.say_hello(name)
    pprint(api_response)
except ApiException as e:
    print(\\"Exception when calling DefaultApi->sayHello: %s\\\\n\\" % e)
extern crate DefaultApi;

pub fn main() {
    let name = name_example; // String

    let mut context = DefaultApi::Context::default();
    let result = client.sayHello(name, &context).wait();

    println!(\\"{:?}\\", result);
}

Scopes

Parameters

Query parameters
Name Description
name*
String
Required

Responses


Suggestions, contact, support and error reporting;

Contact Info: team@openapitools.org

All rights reserved
http://apache.org/licenses/LICENSE-2.0.html
", "generated/documentation/markdown/.openapi-generator-ignore": "# OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md ", "generated/documentation/markdown/.openapi-generator/FILES": ".openapi-generator-ignore Apis/DefaultApi.md Models/ApiErrorResponseContent.md Models/SayHelloResponseContent.md README.md ", "generated/documentation/markdown/.openapi-generator/VERSION": "6.3.0", "generated/documentation/markdown/Apis/DefaultApi.md": "# DefaultApi All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**sayHello**](DefaultApi.md#sayHello) | **GET** /hello | | # **sayHello** > SayHelloResponseContent sayHello(name) ### Parameters |Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **name** | **String**| | [default to null] | ### Return type [**SayHelloResponseContent**](../Models/SayHelloResponseContent.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ", "generated/documentation/markdown/Models/ApiErrorResponseContent.md": "# ApiErrorResponseContent ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | **errorMessage** | **String** | | [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ", "generated/documentation/markdown/Models/SayHelloResponseContent.md": "# SayHelloResponseContent ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | **message** | **String** | | [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ", "generated/documentation/markdown/README.md": "# Documentation for Example API ## Documentation for API Endpoints All URIs are relative to *http://localhost* | Class | Method | HTTP request | Description | |------------ | ------------- | ------------- | -------------| | *DefaultApi* | [**sayHello**](Apis/DefaultApi.md#sayhello) | **GET** /hello | | ## Documentation for Models - [ApiErrorResponseContent](./Models/ApiErrorResponseContent.md) - [SayHelloResponseContent](./Models/SayHelloResponseContent.md) ## Documentation for Authorization All endpoints do not require authorization. ", "generated/documentation/plantuml/.openapi-generator-ignore": "# OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md ", "generated/documentation/plantuml/.openapi-generator/FILES": ".openapi-generator-ignore schemas.plantuml ", "generated/documentation/plantuml/.openapi-generator/VERSION": "6.3.0", "generated/documentation/plantuml/schemas.plantuml": "@startuml title Example API Schemas Diagram entity ApiErrorResponseContent { * errorMessage: String } entity SayHelloResponseContent { * message: String } @enduml", "generated/typescript/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated /.projen/tasks.json linguist-generated /LICENSE linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json !/.projen/files.json !/package.json !/LICENSE !/.npmignore logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json pids *.pid *.seed *.pid.lock lib-cov coverage *.lcov .nyc_output build/Release node_modules/ jspm_packages/ *.tsbuildinfo .eslintcache *.tgz .yarn-integrity .cache !/.projenrc.js !/test/ !/tsconfig.json !/tsconfig.dev.json !/src/ /lib /dist/ !/.openapi-generator-ignore ", "generated/typescript/.npmignore": "README.md", "generated/typescript/.openapi-generator-ignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". .gitignore package.json tsconfig.json tsconfig.esm.json src/index.ts ", "generated/typescript/.openapi-generator/FILES": ".npmignore README.md src/apis/DefaultApi.ts src/apis/DefaultApi/OperationConfig.ts src/apis/index.ts src/models/ApiErrorResponseContent.ts src/models/ApiErrorResponseContent.ts src/models/ApiErrorResponseContent.ts src/models/SayHelloResponseContent.ts src/models/SayHelloResponseContent.ts src/models/SayHelloResponseContent.ts src/models/index.ts src/runtime.ts ", "generated/typescript/.openapi-generator/VERSION": "6.3.0", "generated/typescript/.projen/deps.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "dependencies": Array [ Object { "name": "@types/node", "type": "build", "version": "^16", }, Object { "name": "npm-check-updates", "type": "build", "version": "^16", }, Object { "name": "projen", "type": "build", }, Object { "name": "typescript", "type": "build", }, Object { "name": "@types/aws-lambda", "type": "runtime", }, ], }, "generated/typescript/.projen/files.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "files": Array [ ".gitattributes", ".gitignore", ".npmignore", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", ".projen/tasks.json", "LICENSE", "tsconfig.dev.json", "tsconfig.json", ], }, "generated/typescript/.projen/tasks.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "env": Object { "PATH": "$(npx -c \\"node -e \\\\\\"console.log(process.env.PATH)\\\\\\"\\")", }, "tasks": Object { "build": Object { "description": "Full release build", "name": "build", "steps": Array [ Object { "spawn": "pre-compile", }, Object { "spawn": "compile", }, Object { "spawn": "post-compile", }, Object { "spawn": "test", }, Object { "spawn": "package", }, ], }, "compile": Object { "description": "Only compile", "name": "compile", "steps": Array [ Object { "exec": "tsc --build", }, ], }, "default": Object { "description": "Synthesize project files", "name": "default", "steps": Array [ Object { "cwd": "../..", "exec": "npx projen default", }, ], }, "install": Object { "description": "Install project dependencies and update lockfile (non-frozen)", "name": "install", "steps": Array [ Object { "exec": "yarn install --check-files", }, ], }, "install:ci": Object { "description": "Install project dependencies using frozen lockfile", "name": "install:ci", "steps": Array [ Object { "exec": "yarn install --check-files --frozen-lockfile", }, ], }, "package": Object { "description": "Creates the distribution package", "name": "package", "steps": Array [ Object { "exec": "mkdir -p dist/js", }, Object { "exec": "mv $(npm pack) dist/js/", }, ], }, "post-compile": Object { "description": "Runs after successful compilation", "name": "post-compile", }, "post-upgrade": Object { "description": "Runs after upgrading dependencies", "name": "post-upgrade", }, "pre-compile": Object { "description": "Prepare the project for compilation", "name": "pre-compile", }, "test": Object { "description": "Run tests", "name": "test", }, "upgrade": Object { "description": "upgrade dependencies", "env": Object { "CI": "0", }, "name": "upgrade", "steps": Array [ Object { "exec": "yarn upgrade npm-check-updates", }, Object { "exec": "npm-check-updates --dep dev --upgrade --target=minor", }, Object { "exec": "npm-check-updates --dep optional --upgrade --target=minor", }, Object { "exec": "npm-check-updates --dep peer --upgrade --target=minor", }, Object { "exec": "npm-check-updates --dep prod --upgrade --target=minor", }, Object { "exec": "npm-check-updates --dep bundle --upgrade --target=minor", }, Object { "exec": "yarn install --check-files", }, Object { "exec": "yarn upgrade", }, Object { "exec": "npx projen", }, Object { "spawn": "post-upgrade", }, ], }, "watch": Object { "description": "Watch & compile in the background", "name": "watch", "steps": Array [ Object { "exec": "tsc --build -w", }, ], }, }, }, "generated/typescript/LICENSE": " Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \\"License\\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \\"Licensor\\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \\"Legal Entity\\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \\"control\\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \\"You\\" (or \\"Your\\") shall mean an individual or Legal Entity exercising permissions granted by this License. \\"Source\\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \\"Object\\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \\"Work\\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \\"Derivative Works\\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \\"Contribution\\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \\"submitted\\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \\"Not a Contribution.\\" \\"Contributor\\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \\"NOTICE\\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \\"AS IS\\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \\"[]\\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \\"printed page\\" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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/typescript/README.md": "## @test/my-api-typescript@1.0.0 This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: Environment * Node.js * Webpack * Browserify Language level * ES5 - you must have a Promises/A+ library installed * ES6 Module system * CommonJS * ES6 module system It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via \`package.json\`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) ### Building To build and compile the typescript sources to javascript use: \`\`\` npm install npm run build \`\`\` ### Publishing First build the package then run \`\`\`npm publish\`\`\` ### Consuming navigate to the folder of your consuming project and run one of the following commands. _published:_ \`\`\` npm install @test/my-api-typescript@1.0.0 --save \`\`\` _unPublished (not recommended):_ \`\`\` npm install PATH_TO_GENERATED_PACKAGE --save ", "generated/typescript/package.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "dependencies": Object { "@types/aws-lambda": "*", }, "devDependencies": Object { "@types/node": "^16", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", "name": "@test/my-api-typescript", "scripts": Object { "build": "npx projen build", "compile": "npx projen compile", "default": "npx projen default", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", "pre-compile": "npx projen pre-compile", "projen": "npx projen", "test": "npx projen test", "upgrade": "npx projen upgrade", "watch": "npx projen watch", }, "types": "lib/index.d.ts", "version": "0.0.0", }, "generated/typescript/src/apis/DefaultApi.ts": "/* tslint:disable */ /* eslint-disable */ /** * Example API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { ApiErrorResponseContent, SayHelloResponseContent, } from '../models'; import { ApiErrorResponseContentFromJSON, ApiErrorResponseContentToJSON, SayHelloResponseContentFromJSON, SayHelloResponseContentToJSON, } from '../models'; export interface SayHelloRequest { name: string; } /** * */ export class DefaultApi extends runtime.BaseAPI { /** */ async sayHelloRaw(requestParameters: SayHelloRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.name === null || requestParameters.name === undefined) { throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling sayHello.'); } const queryParameters: any = {}; if (requestParameters.name !== undefined) { queryParameters['name'] = requestParameters.name; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ path: \`/hello\`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => SayHelloResponseContentFromJSON(jsonValue)); } /** */ async sayHello(requestParameters: SayHelloRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.sayHelloRaw(requestParameters, initOverrides); return await response.value(); } } ", "generated/typescript/src/apis/DefaultApi/OperationConfig.ts": "// Import models import { ApiErrorResponseContent, ApiErrorResponseContentFromJSON, ApiErrorResponseContentToJSON, SayHelloResponseContent, SayHelloResponseContentFromJSON, SayHelloResponseContentToJSON, } from '../../models'; // Import request parameter interfaces import { SayHelloRequest, } from '..'; // API Gateway Types import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from \\"aws-lambda\\"; // Generic type for object keyed by operation names export interface OperationConfig { sayHello: T; } // Look up path and http method for a given operation name export const OperationLookup = { sayHello: { path: '/hello', method: 'GET', }, }; export class Operations { /** * Return an OperationConfig with the same value for every operation */ public static all = (value: T): OperationConfig => Object.fromEntries( Object.keys(OperationLookup).map((operationId) => [operationId, value]) ) as unknown as OperationConfig; } // Standard apigateway request parameters (query parameters or path parameters, multi or single value) type ApiGatewayRequestParameters = { [key: string]: string | string[] | undefined }; /** * URI decode for a string or array of strings */ const uriDecode = (value: string | string[]): string | string[] => typeof value === 'string' ? decodeURIComponent(value) : value.map((v) => decodeURIComponent(v)); /** * URI decodes apigateway request parameters (query or path parameters) */ const decodeRequestParameters = (parameters: ApiGatewayRequestParameters): ApiGatewayRequestParameters => { const decodedParameters = {}; Object.keys(parameters || {}).forEach((key) => { decodedParameters[key] = parameters[key] ? uriDecode(parameters[key]) : parameters[key]; }); return decodedParameters; }; /** * Parse the body if the content type is json, otherwise leave as a raw string */ const parseBody = (body: string, demarshal: (body: string) => any, contentTypes: string[]): any => contentTypes.filter((contentType) => contentType !== 'application/json').length === 0 ? demarshal(body || '{}') : body; type OperationIds = | 'sayHello'; type OperationApiGatewayProxyResult = APIGatewayProxyResult & { __operationId?: T }; // Api gateway lambda handler type type OperationApiGatewayLambdaHandler = (event: APIGatewayProxyEvent, context: Context) => Promise>; // Type of the response to be returned by an operation lambda handler export interface OperationResponse { statusCode: StatusCode; headers?: { [key: string]: string }; body: Body; } // Input for a lambda handler for an operation export type LambdaRequestParameters = { requestParameters: RequestParameters, requestArrayParameters: RequestArrayParameters, body: RequestBody, }; export type InterceptorContext = { [key: string]: any }; export interface RequestInput { input: LambdaRequestParameters; event: APIGatewayProxyEvent; context: Context; interceptorContext: InterceptorContext; } export interface ChainedRequestInput extends RequestInput { chain: LambdaHandlerChain; } /** * A lambda handler function which is part of a chain. It may invoke the remainder of the chain via the given chain input */ export type ChainedLambdaHandlerFunction = ( input: ChainedRequestInput, ) => Promise; // Type for a lambda handler function to be wrapped export type LambdaHandlerFunction = ( input: RequestInput, ) => Promise; export interface LambdaHandlerChain { next: LambdaHandlerFunction; } // Interceptor is a type alias for ChainedLambdaHandlerFunction export type Interceptor = ChainedLambdaHandlerFunction; /** * Build a chain from the given array of chained lambda handlers */ const buildHandlerChain = ( ...handlers: ChainedLambdaHandlerFunction[] ): LambdaHandlerChain => { if (handlers.length === 0) { return { next: () => { throw new Error(\\"No more handlers remain in the chain! The last handler should not call next.\\"); } }; } const [currentHandler, ...remainingHandlers] = handlers; return { next: (input) => { return currentHandler({ ...input, chain: buildHandlerChain(...remainingHandlers), }); }, }; }; /** * Single-value path/query parameters for SayHello */ export interface SayHelloRequestParameters { readonly name: string; } /** * Multi-value query parameters for SayHello */ export interface SayHelloRequestArrayParameters { } /** * Request body parameter for SayHello */ export type SayHelloRequestBody = never; export type SayHello200OperationResponse = OperationResponse<200, SayHelloResponseContent>; export type SayHello400OperationResponse = OperationResponse<400, ApiErrorResponseContent>; export type SayHelloOperationResponses = | SayHello200OperationResponse | SayHello400OperationResponse ; // Type that the handler function provided to the wrapper must conform to export type SayHelloHandlerFunction = LambdaHandlerFunction; export type SayHelloChainedHandlerFunction = ChainedLambdaHandlerFunction; /** * Lambda handler wrapper to provide typed interface for the implementation of sayHello */ export const sayHelloHandler = ( firstHandler: SayHelloChainedHandlerFunction, ...remainingHandlers: SayHelloChainedHandlerFunction[] ): OperationApiGatewayLambdaHandler<'sayHello'> => async (event: any, context: any, _callback?: any, additionalInterceptors: SayHelloChainedHandlerFunction[] = []): Promise => { const requestParameters = decodeRequestParameters({ ...(event.pathParameters || {}), ...(event.queryStringParameters || {}), }) as unknown as SayHelloRequestParameters; const requestArrayParameters = decodeRequestParameters({ ...(event.multiValueQueryStringParameters || {}), }) as unknown as SayHelloRequestArrayParameters; const demarshal = (bodyString: string): any => { return {}; }; const body = parseBody(event.body, demarshal, ['application/json']) as SayHelloRequestBody; const chain = buildHandlerChain(...additionalInterceptors, firstHandler, ...remainingHandlers); const response = await chain.next({ input: { requestParameters, requestArrayParameters, body, }, event, context, interceptorContext: {}, }); const marshal = (statusCode: number, responseBody: any): string => { let marshalledBody = responseBody; switch(statusCode) { case 200: marshalledBody = JSON.stringify(SayHelloResponseContentToJSON(marshalledBody)); break; case 400: marshalledBody = JSON.stringify(ApiErrorResponseContentToJSON(marshalledBody)); break; default: break; } return marshalledBody; }; return { ...response, body: response.body ? marshal(response.statusCode, response.body) : '', }; }; export interface HandlerRouterHandlers { readonly sayHello: OperationApiGatewayLambdaHandler<'sayHello'>; } export type AnyOperationRequestParameters = | SayHelloRequestParameters; export type AnyOperationRequestArrayParameters = | SayHelloRequestArrayParameters; export type AnyOperationRequestBodies = | SayHelloRequestBody; export type AnyOperationResponses = | SayHelloOperationResponses; export interface HandlerRouterProps< RequestParameters, RequestArrayParameters, RequestBody, Response extends AnyOperationResponses > { /** * Interceptors to apply to all handlers */ readonly interceptors?: ChainedLambdaHandlerFunction< RequestParameters, RequestArrayParameters, RequestBody, Response >[]; /** * Handlers to register for each operation */ readonly handlers: HandlerRouterHandlers; } const concatMethodAndPath = (method: string, path: string) => \`\${method.toLowerCase()}||\${path}\`; const OperationIdByMethodAndPath = Object.fromEntries(Object.entries(OperationLookup).map( ([operationId, methodAndPath]) => [concatMethodAndPath(methodAndPath.method, methodAndPath.path), operationId] )); /** * Returns a lambda handler which can be used to route requests to the appropriate typed lambda handler function. */ export const handlerRouter = (props: HandlerRouterProps< AnyOperationRequestParameters, AnyOperationRequestArrayParameters, AnyOperationRequestBodies, AnyOperationResponses >): OperationApiGatewayLambdaHandler => async (event, context) => { const operationId = OperationIdByMethodAndPath[concatMethodAndPath(event.requestContext.httpMethod, event.requestContext.resourcePath)]; const handler = props.handlers[operationId]; return handler(event, context, undefined, props.interceptors); }; ", "generated/typescript/src/apis/index.ts": "/* tslint:disable */ /* eslint-disable */ export * from './DefaultApi'; ", "generated/typescript/src/index.ts": "/* tslint:disable */ /* eslint-disable */ export * from './runtime'; export * from './apis'; export * from './models'; export * from './apis/DefaultApi/OperationConfig';", "generated/typescript/src/models/ApiErrorResponseContent.ts": "/* tslint:disable */ /* eslint-disable */ /** * Example API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; /** * * @export * @interface ApiErrorResponseContent */ export interface ApiErrorResponseContent { /** * * @type {string} * @memberof ApiErrorResponseContent */ errorMessage: string; } /** * Check if a given object implements the ApiErrorResponseContent interface. */ export function instanceOfApiErrorResponseContent(value: object): boolean { let isInstance = true; isInstance = isInstance && \\"errorMessage\\" in value; return isInstance; } export function ApiErrorResponseContentFromJSON(json: any): ApiErrorResponseContent { return ApiErrorResponseContentFromJSONTyped(json, false); } export function ApiErrorResponseContentFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiErrorResponseContent { if ((json === undefined) || (json === null)) { return json; } return { 'errorMessage': json['errorMessage'], }; } export function ApiErrorResponseContentToJSON(value?: ApiErrorResponseContent | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'errorMessage': value.errorMessage, }; } ", "generated/typescript/src/models/SayHelloResponseContent.ts": "/* tslint:disable */ /* eslint-disable */ /** * Example API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; /** * * @export * @interface SayHelloResponseContent */ export interface SayHelloResponseContent { /** * * @type {string} * @memberof SayHelloResponseContent */ message: string; } /** * Check if a given object implements the SayHelloResponseContent interface. */ export function instanceOfSayHelloResponseContent(value: object): boolean { let isInstance = true; isInstance = isInstance && \\"message\\" in value; return isInstance; } export function SayHelloResponseContentFromJSON(json: any): SayHelloResponseContent { return SayHelloResponseContentFromJSONTyped(json, false); } export function SayHelloResponseContentFromJSONTyped(json: any, ignoreDiscriminator: boolean): SayHelloResponseContent { if ((json === undefined) || (json === null)) { return json; } return { 'message': json['message'], }; } export function SayHelloResponseContentToJSON(value?: SayHelloResponseContent | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'message': value.message, }; } ", "generated/typescript/src/models/index.ts": "/* tslint:disable */ /* eslint-disable */ export * from './ApiErrorResponseContent'; export * from './SayHelloResponseContent'; ", "generated/typescript/src/runtime.ts": "/* tslint:disable */ /* eslint-disable */ /** * Example API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ export const BASE_PATH = \\"http://localhost\\".replace(/\\\\/+$/, \\"\\"); export interface ConfigurationParameters { basePath?: string; // override base path fetchApi?: FetchAPI; // override for fetch implementation middleware?: Middleware[]; // middleware to apply before/after fetch requests queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security headers?: HTTPHeaders; //header params we want to use on every request credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { constructor(private configuration: ConfigurationParameters = {}) {} set config(configuration: Configuration) { this.configuration = configuration; } get basePath(): string { return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; } get fetchApi(): FetchAPI | undefined { return this.configuration.fetchApi; } get middleware(): Middleware[] { return this.configuration.middleware || []; } get queryParamsStringify(): (params: HTTPQuery) => string { return this.configuration.queryParamsStringify || querystring; } get username(): string | undefined { return this.configuration.username; } get password(): string | undefined { return this.configuration.password; } get apiKey(): ((name: string) => string) | undefined { const apiKey = this.configuration.apiKey; if (apiKey) { return typeof apiKey === 'function' ? apiKey : () => apiKey; } return undefined; } get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { const accessToken = this.configuration.accessToken; if (accessToken) { return typeof accessToken === 'function' ? accessToken : async () => accessToken; } return undefined; } get headers(): HTTPHeaders | undefined { return this.configuration.headers; } get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } export const DefaultConfig = new Configuration(); /** * This is the base class for all generated API classes. */ export class BaseAPI { private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { this.middleware = configuration.middleware; } withMiddleware(this: T, ...middlewares: Middleware[]) { const next = this.clone(); next.middleware = next.middleware.concat(...middlewares); return next; } withPreMiddleware(this: T, ...preMiddlewares: Array) { const middlewares = preMiddlewares.map((pre) => ({ pre })); return this.withMiddleware(...middlewares); } withPostMiddleware(this: T, ...postMiddlewares: Array) { const middlewares = postMiddlewares.map((post) => ({ post })); return this.withMiddleware(...middlewares); } protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); if (response && (response.status >= 200 && response.status < 300)) { return response; } throw new ResponseError(response, 'Response returned an error code'); } private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { let url = this.configuration.basePath + context.path; if (context.query !== undefined && Object.keys(context.query).length !== 0) { // only add the querystring to the URL if there are query parameters. // this is done to avoid urls ending with a \\"?\\" character which buggy webservers // do not handle correctly sometimes. url += '?' + this.configuration.queryParamsStringify(context.query); } const headers = Object.assign({}, this.configuration.headers, context.headers); Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); const initOverrideFn = typeof initOverrides === \\"function\\" ? initOverrides : async () => initOverrides; const initParams = { method: context.method, headers, body: context.body, credentials: this.configuration.credentials, }; const overriddenInit: RequestInit = { ...initParams, ...(await initOverrideFn({ init: initParams, context, })) }; const init: RequestInit = { ...overriddenInit, body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body), }; return { url, init }; } private fetchApi = async (url: string, init: RequestInit) => { let fetchParams = { url, init }; for (const middleware of this.middleware) { if (middleware.pre) { fetchParams = await middleware.pre({ fetch: this.fetchApi, ...fetchParams, }) || fetchParams; } } let response: Response | undefined = undefined; try { response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); } catch (e) { for (const middleware of this.middleware) { if (middleware.onError) { response = await middleware.onError({ fetch: this.fetchApi, url: fetchParams.url, init: fetchParams.init, error: e, response: response ? response.clone() : undefined, }) || response; } } if (response === undefined) { if (e instanceof Error) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } else { throw e; } } } for (const middleware of this.middleware) { if (middleware.post) { response = await middleware.post({ fetch: this.fetchApi, url: fetchParams.url, init: fetchParams.init, response: response.clone(), }) || response; } } return response; } /** * Create a shallow clone of \`this\` by constructing a new instance * and then shallow cloning data members. */ private clone(this: T): T { const constructor = this.constructor as any; const next = new constructor(this.configuration); next.middleware = this.middleware.slice(); return next; } }; function isBlob(value: any): value is Blob { return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { return typeof FormData !== \\"undefined\\" && value instanceof FormData; } export class ResponseError extends Error { override name: \\"ResponseError\\" = \\"ResponseError\\"; constructor(public response: Response, msg?: string) { super(msg); } } export class FetchError extends Error { override name: \\"FetchError\\" = \\"FetchError\\"; constructor(public cause: Error, msg?: string) { super(msg); } } export class RequiredError extends Error { override name: \\"RequiredError\\" = \\"RequiredError\\"; constructor(public field: string, msg?: string) { super(msg); } } export const COLLECTION_FORMATS = { csv: \\",\\", ssv: \\" \\", tsv: \\"\\\\t\\", pipes: \\"|\\", }; export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise export interface FetchParams { url: string; init: RequestInit; } export interface RequestOpts { path: string; method: HTTPMethod; headers: HTTPHeaders; query?: HTTPQuery; body?: HTTPBody; } export function exists(json: any, key: string) { const value = json[key]; return value !== null && value !== undefined; } export function querystring(params: HTTPQuery, prefix: string = ''): string { return Object.keys(params) .map(key => querystringSingleKey(key, params[key], prefix)) .filter(part => part.length > 0) .join('&'); } function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { const fullKey = keyPrefix + (keyPrefix.length ? \`[\${key}]\` : key); if (value instanceof Array) { const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) .join(\`&\${encodeURIComponent(fullKey)}=\`); return \`\${encodeURIComponent(fullKey)}=\${multiValue}\`; } if (value instanceof Set) { const valueAsArray = Array.from(value); return querystringSingleKey(key, valueAsArray, keyPrefix); } if (value instanceof Date) { return \`\${encodeURIComponent(fullKey)}=\${encodeURIComponent(value.toISOString())}\`; } if (value instanceof Object) { return querystring(value as HTTPQuery, fullKey); } return \`\${encodeURIComponent(fullKey)}=\${encodeURIComponent(String(value))}\`; } export function mapValues(data: any, fn: (item: any) => any) { return Object.keys(data).reduce( (acc, key) => ({ ...acc, [key]: fn(data[key]) }), {} ); } export function canConsumeForm(consumes: Consume[]): boolean { for (const consume of consumes) { if ('multipart/form-data' === consume.contentType) { return true; } } return false; } export interface Consume { contentType: string; } export interface RequestContext { fetch: FetchAPI; url: string; init: RequestInit; } export interface ResponseContext { fetch: FetchAPI; url: string; init: RequestInit; response: Response; } export interface ErrorContext { fetch: FetchAPI; url: string; init: RequestInit; error: unknown; response?: Response; } export interface Middleware { pre?(context: RequestContext): Promise; post?(context: ResponseContext): Promise; onError?(context: ErrorContext): Promise; } export interface ApiResponse { raw: Response; value(): Promise; } export interface ResponseTransformer { (json: any): T; } export class JSONApiResponse { constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} async value(): Promise { return this.transformer(await this.raw.json()); } } export class VoidApiResponse { constructor(public raw: Response) {} async value(): Promise { return undefined; } } export class BlobApiResponse { constructor(public raw: Response) {} async value(): Promise { return await this.raw.blob(); }; } export class TextApiResponse { constructor(public raw: Response) {} async value(): Promise { return await this.raw.text(); }; } ", "generated/typescript/tsconfig.dev.json": Object { "compilerOptions": Object { "alwaysStrict": false, "declaration": true, "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": Array [ "dom", "es2019", ], "module": "CommonJS", "noEmitOnError": false, "noFallthroughCasesInSwitch": true, "noImplicitAny": false, "noImplicitReturns": false, "noImplicitThis": false, "noUnusedLocals": false, "noUnusedParameters": false, "resolveJsonModule": true, "strict": false, "strictNullChecks": false, "strictPropertyInitialization": false, "stripInternal": true, "target": "ES2019", }, "exclude": Array [ "node_modules", ], "include": Array [ ".projenrc.js", "src/**/*.ts", "test/**/*.ts", ], }, "generated/typescript/tsconfig.json": Object { "compilerOptions": Object { "alwaysStrict": false, "declaration": true, "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": Array [ "dom", "es2019", ], "module": "CommonJS", "noEmitOnError": false, "noFallthroughCasesInSwitch": true, "noImplicitAny": false, "noImplicitReturns": false, "noImplicitThis": false, "noUnusedLocals": false, "noUnusedParameters": false, "outDir": "lib", "resolveJsonModule": true, "rootDir": "src", "strict": false, "strictNullChecks": false, "strictPropertyInitialization": false, "stripInternal": true, "target": "ES2019", }, "exclude": Array [], "include": Array [ "src/**/*.ts", ], }, "package.json": Object { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".", "dependencies": Object { "@aws-prototyping-sdk/open-api-gateway": "*", "@test/my-api-typescript": "file:./generated/typescript", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", }, "devDependencies": Object { "@types/jest": "*", "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^5", "@typescript-eslint/parser": "^5", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", "eslint-plugin-import": "*", "jest": "*", "jest-junit": "^15", "npm-check-updates": "^16", "projen": "*", "standard-version": "^9", "ts-jest": "*", "typescript": "*", }, "jest": Object { "clearMocks": true, "collectCoverage": true, "coverageDirectory": "coverage", "coveragePathIgnorePatterns": Array [ "/node_modules/", ], "coverageReporters": Array [ "json", "lcov", "clover", "cobertura", "text", ], "globals": Object { "ts-jest": Object { "tsconfig": "tsconfig.dev.json", }, }, "preset": "ts-jest", "reporters": Array [ "default", Array [ "jest-junit", Object { "outputDirectory": "test-reports", }, ], ], "testMatch": Array [ "/src/**/__tests__/**/*.ts?(x)", "/(test|src)/**/*(*.)@(spec|test).ts?(x)", ], "testPathIgnorePatterns": Array [ "/node_modules/", ], "watchPathIgnorePatterns": Array [ "/node_modules/", ], }, "license": "Apache-2.0", "main": "lib/index.js", "name": "@test/my-api", "private": true, "scripts": Object { "build": "npx projen build", "bump": "npx projen bump", "clobber": "npx projen clobber", "compile": "npx projen compile", "default": "npx projen default", "eject": "npx projen eject", "eslint": "npx projen eslint", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", "pre-compile": "npx projen pre-compile", "projen": "npx projen", "release:mainline": "npx projen release:mainline", "test": "npx projen test", "test:watch": "npx projen test:watch", "unbump": "npx projen unbump", "upgrade": "npx projen upgrade", "watch": "npx projen watch", }, "types": "lib/index.d.ts", "version": "0.0.0", }, "src/api/api.ts": "import { OpenApiGatewayRestApi, OpenApiGatewayRestApiProps, OpenApiIntegration } from \\"@aws-prototyping-sdk/open-api-gateway\\"; import { Construct } from \\"constructs\\"; import { OperationLookup, OperationConfig } from \\"@test/my-api-typescript\\"; import * as path from \\"path\\"; import spec from \\"../spec/.parsed-spec.json\\"; export type ApiIntegrations = OperationConfig; export interface ApiProps extends Omit { readonly integrations: ApiIntegrations; } /** * Type-safe construct for the API Gateway resources defined by the spec. * You will likely not need to modify this file, and can instead extend it and define your integrations. */ export class Api extends OpenApiGatewayRestApi { constructor(scope: Construct, id: string, props: ApiProps) { super(scope, id, { ...props, integrations: props.integrations as any, spec, specPath: path.resolve(__dirname, \\"../spec/.parsed-spec.json\\"), operationLookup: OperationLookup as any, }); } } ", "src/api/index.ts": "export * from './api'; export * from './sample-api';", "src/api/sample-api.say-hello.ts": "import { sayHelloHandler } from \\"@test/my-api-typescript\\"; /** * An example lambda handler which uses the generated handler wrapper to manage marshalling inputs/outputs. */ export const handler = sayHelloHandler(async ({ input }) => { return { statusCode: 200, headers: { \\"Access-Control-Allow-Origin\\": \\"*\\", \\"Access-Control-Allow-Headers\\": \\"*\\", }, body: { message: \`Hello \${input.requestParameters.name}!\`, }, }; }); ", "src/api/sample-api.ts": "import { Authorizers, Integrations } from \\"@aws-prototyping-sdk/open-api-gateway\\"; import { Construct } from \\"constructs\\"; import { Cors } from \\"aws-cdk-lib/aws-apigateway\\"; import { NodejsFunction } from \\"aws-cdk-lib/aws-lambda-nodejs\\"; import { Api } from \\"./api\\"; /** * An example of how to wire lambda handler functions to the API */ export class SampleApi extends Api { constructor(scope: Construct, id: string) { super(scope, id, { defaultAuthorizer: Authorizers.iam(), corsOptions: { allowOrigins: Cors.ALL_ORIGINS, allowMethods: Cors.ALL_METHODS, }, integrations: { sayHello: { integration: Integrations.lambda(new NodejsFunction(scope, \\"say-hello\\")), }, }, }); } } ", "src/index.ts": "export * from \\"./api\\";", "src/spec/.parsed-spec.json": Object { "components": Object { "schemas": Object { "ApiErrorResponseContent": Object { "properties": Object { "errorMessage": Object { "type": "string", }, }, "required": Array [ "errorMessage", ], "type": "object", }, "SayHelloResponseContent": Object { "properties": Object { "message": Object { "type": "string", }, }, "required": Array [ "message", ], "type": "object", }, }, }, "info": Object { "title": "Example API", "version": "1.0.0", }, "openapi": "3.0.3", "paths": Object { "/hello": Object { "get": Object { "operationId": "sayHello", "parameters": Array [ Object { "in": "query", "name": "name", "required": true, "schema": Object { "type": "string", }, }, ], "responses": Object { "200": Object { "content": Object { "application/json": Object { "schema": Object { "$ref": "#/components/schemas/SayHelloResponseContent", }, }, }, "description": "Successful response", }, "400": Object { "content": Object { "application/json": Object { "schema": Object { "$ref": "#/components/schemas/ApiErrorResponseContent", }, }, }, "description": "Error response", }, }, }, }, }, }, "src/spec/spec.yaml": "openapi: 3.0.3 info: version: 1.0.0 title: Example API paths: /hello: get: operationId: sayHello parameters: - in: query name: name schema: type: string required: true responses: '200': description: Successful response content: 'application/json': schema: $ref: '#/components/schemas/SayHelloResponseContent' '400': description: Error response content: 'application/json': schema: $ref: '#/components/schemas/ApiErrorResponseContent' components: schemas: ApiErrorResponseContent: type: object properties: errorMessage: type: string required: - errorMessage SayHelloResponseContent: type: object properties: message: type: string required: - message ", "test/api.test.ts": "import { Integrations } from \\"@aws-prototyping-sdk/open-api-gateway\\"; import { Stack } from \\"aws-cdk-lib\\"; import { Template } from \\"aws-cdk-lib/assertions\\"; import { Code, Function, Runtime } from \\"aws-cdk-lib/aws-lambda\\"; import { OperationLookup } from \\"@test/my-api-typescript\\"; import { Api } from \\"../src/api\\"; /** * A simple test to ensure the api construct synthesizes correctly */ describe(\\"Api\\", () => { it(\\"should synthesize\\", () => { const stack = new Stack(); new Api(stack, \\"ApiTest\\", { // Create a dummy integration for every operation defined in the api integrations: Object.fromEntries(Object.keys(OperationLookup).map((operation) => [operation, { integration: Integrations.lambda(new Function(stack, \`\${operation}Lambda\`, { code: Code.fromInline(\\"test\\"), handler: \\"test\\", runtime: Runtime.NODEJS_14_X, })), }])) as any, }); const template = Template.fromStack(stack); expect(template.toJSON()).toMatchSnapshot(); }); }); ", "tsconfig.dev.json": Object { "compilerOptions": Object { "alwaysStrict": true, "declaration": true, "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": Array [ "dom", "es2019", ], "module": "CommonJS", "noEmitOnError": false, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, "resolveJsonModule": true, "strict": true, "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, "target": "ES2019", }, "exclude": Array [ "node_modules", ], "include": Array [ ".projenrc.js", "src/**/*.ts", "test/**/*.ts", ], }, "tsconfig.json": Object { "compilerOptions": Object { "alwaysStrict": true, "declaration": true, "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": Array [ "dom", "es2019", ], "module": "CommonJS", "noEmitOnError": false, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, "outDir": "lib", "resolveJsonModule": true, "rootDir": "src", "strict": true, "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, "target": "ES2019", }, "exclude": Array [], "include": Array [ "src/**/*.ts", "src/**/*.json", ], }, } `;