├── ._logo.png ├── .eslintrc.yml ├── .github └── workflows │ ├── ci.yml │ └── codeql.yml ├── .gitignore ├── .node-version ├── .nvmrc ├── LICENSE ├── README.md ├── clients ├── access-token-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── address-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── address-suggestions-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── app-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── audit-logs-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── automation-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── billing-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── blueprint-manifest-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── consent-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── customer-portal-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── design-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── discussion-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── document-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── email-settings-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── email-template-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── entity-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ ├── openapi.json │ │ └── schema-model.ts │ ├── tsconfig.json │ └── webpack.config.js ├── entity-mapping-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── entity-viewers-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── erp-integration-client │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── file-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── kanban-client │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── message-client │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── metering-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── notes-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── notification-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── organization-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── partner-directory-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── permissions-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── pricing-client │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── pricing-tier-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── sandbox-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── submission-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── targeting-client │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── template-variables-client │ ├── .node-version │ ├── .nvmrc │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── user-client │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── webhooks-client │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── workflow-client │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── definition.ts │ │ ├── index.ts │ │ ├── openapi-runtime.json │ │ ├── openapi.d.ts │ │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js └── workflow-definition-client │ ├── CHANGELOG.md │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── client.test.ts │ ├── client.ts │ ├── definition.ts │ ├── index.ts │ ├── openapi-runtime.json │ ├── openapi.d.ts │ └── openapi.json │ ├── tsconfig.json │ └── webpack.config.js ├── lerna.json ├── logo.png ├── package-lock.json ├── package.json ├── packages ├── auth │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── client.ts │ │ ├── cognito.ts │ │ ├── config.ts │ │ ├── index.test.ts │ │ ├── index.ts │ │ ├── login.ts │ │ ├── script │ │ │ └── print-token.ts │ │ ├── token.ts │ │ ├── types.ts │ │ └── user.ts │ └── tsconfig.json └── epilot-sdk │ ├── .gitignore │ ├── README.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── __tests__ │ │ └── server-mocks.ts │ ├── access-token-client.ts │ ├── address-suggestions-client.ts │ ├── audit-logs-client.ts │ ├── auth.ts │ ├── automation-client.ts │ ├── blueprint-manifest-client.ts │ ├── customer-portal-client.ts │ ├── design-client.ts │ ├── discussion-client.ts │ ├── email-settings-client.ts │ ├── email-template-client.ts │ ├── entity-client.ts │ ├── file-client.ts │ ├── index.test.ts │ ├── index.ts │ ├── message-client.ts │ ├── metering-client.ts │ ├── notification-client.ts │ ├── organization-client.ts │ ├── partner-directory-client.ts │ ├── permissions-client.ts │ ├── pricing-client.ts │ ├── sandbox-client.ts │ ├── submission-client.ts │ ├── template-variables-client.ts │ ├── user-client.ts │ └── workflow-client.ts │ └── tsconfig.json └── scripts └── update-openapi.js /._logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epilot-dev/sdk-js/969a7054ec30b489d622c25a2dccf71591ee7dac/._logo.png -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | extends: 2 | - "@epilot/eslint-config" 3 | ignorePatterns: 4 | - node_modules 5 | - dist 6 | rules: 7 | "spaced-comment": 8 | - error 9 | - always 10 | - line: 11 | markers: ["/"] 12 | exceptions: ["-", "+"] 13 | block: 14 | markers: ["!"] 15 | exceptions: ["*"] 16 | balanced: true 17 | "prettier/prettier": 18 | - error 19 | - printWidth: 120 # https://hackernoon.com/does-column-width-of-80-make-sense-in-2018-50c161fbdcf6 20 | trailingComma: all # better diffs, obviously 21 | bracketSpacing: true # more space = pretty 22 | semi: true # https://github.com/standard/semistandard 23 | useTabs: false 24 | tabWidth: 2 25 | singleQuote: true 26 | quoteProps: as-needed 27 | proseWrap: never 28 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: ["main"] 5 | tags: ["*"] 6 | pull_request: 7 | branches: ["main"] 8 | 9 | jobs: 10 | test: 11 | name: Test 12 | runs-on: ubuntu-latest 13 | strategy: 14 | matrix: 15 | node-version: [18.x] 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Use Node.js ${{ matrix.node-version }} 19 | uses: actions/setup-node@v2 20 | with: 21 | node-version: ${{ matrix.node-version }} 22 | - run: npm ci 23 | - run: npm run build 24 | - run: npm run lint 25 | - run: npm test 26 | 27 | publish: 28 | name: Publish 29 | runs-on: ubuntu-latest 30 | if: startsWith(github.ref, 'refs/tags/') 31 | needs: 32 | - test 33 | steps: 34 | - uses: actions/checkout@v2 35 | - uses: actions/setup-node@v2 36 | with: 37 | registry-url: https://registry.npmjs.org/ 38 | - run: npm ci 39 | - run: npm run build 40 | - run: npx lerna publish from-package --yes --no-verify-access --ignore-prepublish 41 | env: 42 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 43 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | schedule: 9 | - cron: "0 2 * * 6" 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ubuntu-latest 15 | permissions: 16 | actions: read 17 | contents: read 18 | security-events: write 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | language: [ javascript ] 24 | 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v3 28 | 29 | - name: Initialize CodeQL 30 | uses: github/codeql-action/init@v2 31 | with: 32 | languages: ${{ matrix.language }} 33 | queries: +security-and-quality 34 | 35 | - name: Autobuild 36 | uses: github/codeql-action/autobuild@v2 37 | 38 | - name: Perform CodeQL Analysis 39 | uses: github/codeql-action/analyze@v2 40 | with: 41 | category: "/language:${{ matrix.language }}" 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm_debug.log* 3 | .eslintcache 4 | dist 5 | *.log 6 | .idea 7 | **/*.DS_Store -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 18 -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 18 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 epilot GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /clients/access-token-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/access-token-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/access-token-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/access-token-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/access-token-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/access-token-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { Document, OpenAPIClient, OpenAPIClientAxios } from 'openapi-client-axios'; 2 | export type { Client, Components, OperationMethods, Paths, PathsDictionary } from './openapi'; 3 | 4 | export * from './client'; 5 | export * from './openapi'; 6 | -------------------------------------------------------------------------------- /clients/access-token-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/access-token-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/address-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/address-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/address-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/address-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/address-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/address-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/address-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/address-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/address-suggestions-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/app-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/app-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI) 4 | [![npm version](https://img.shields.io/npm/v/@epilot/app-client.svg)](https://www.npmjs.com/package/@epilot/app-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/app-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/app-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | tbw 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```bash 15 | npm install --save @epilot/app-client 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```typescript 21 | import { getClient } from '@epilot/app-client'; 22 | const appClient = getClient(); 23 | 24 | const logs = await appClient.getLogs({ limit: 25, page: 2 }); 25 | ``` 26 | 27 | ## Documentation 28 | 29 | tbw 30 | -------------------------------------------------------------------------------- /clients/app-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/app-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/app-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/app-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/app-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/app-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true, 20 | "skipLibCheck": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["**/*.test.ts"] 24 | } 25 | -------------------------------------------------------------------------------- /clients/app-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/audit-logs-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/audit-logs-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/audit-logs-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/audit-logs-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/audit-logs-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/audit-logs-client/src/openapi-runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "title": "", 5 | "version": "" 6 | }, 7 | "servers": [ 8 | { 9 | "url": "https://audit-logs.sls.epilot.io" 10 | } 11 | ], 12 | "paths": { 13 | "/v1/logs": { 14 | "post": { 15 | "operationId": "getLogs", 16 | "requestBody": { 17 | "content": { 18 | "application/json": {} 19 | } 20 | }, 21 | "responses": {} 22 | } 23 | }, 24 | "/v1/logs/{logId}": { 25 | "get": { 26 | "operationId": "getLogById", 27 | "parameters": [ 28 | { 29 | "in": "path", 30 | "name": "logId", 31 | "required": true 32 | } 33 | ], 34 | "responses": {} 35 | } 36 | } 37 | }, 38 | "components": {} 39 | } 40 | -------------------------------------------------------------------------------- /clients/audit-logs-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true, 20 | "skipLibCheck": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["**/*.test.ts"] 24 | } 25 | -------------------------------------------------------------------------------- /clients/audit-logs-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/automation-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/automation-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/automation-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/automation-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/automation-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/automation-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/automation-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/billing-client/README.md: -------------------------------------------------------------------------------- 1 | # `@epilot/billing-client` 2 | 3 | API Client for epilot Billing API. 4 | 5 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 6 | 7 | ## Getting Started 8 | 9 | Install the package: 10 | 11 | ```bash 12 | npm install --save-dev @epilot/billing-client 13 | ``` 14 | 15 | Import the package: 16 | 17 | ```typescript 18 | import { getClient } from '@epilot/billing-client'; 19 | ``` 20 | 21 | Use the client: 22 | ```typescript 23 | // get typed client 24 | const client = await getClient(); 25 | 26 | // call an operation 27 | const res = await client.testAuth(); 28 | ``` 29 | 30 | ## BaseURL & Authorization 31 | 32 | To pass an authorization header and set up the API url, you can use axios 33 | defaults: 34 | 35 | ```typescript 36 | const client = getClient(); 37 | client.defaults.baseURL = config.CUSTOMER_PORTAL_API; 38 | client.defaults.headers['authorization'] = `Bearer ${token}`; 39 | ``` 40 | 41 | ## API Docs: 42 | 43 | https://docs.api.epilot.io/ 44 | -------------------------------------------------------------------------------- /clients/billing-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/billing-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /clients/billing-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | import { Client } from './openapi'; 5 | 6 | export const getClient = () => { 7 | const api = new OpenAPIClientAxios({ definition, quick: true }); 8 | 9 | return api.initSync(); 10 | }; 11 | -------------------------------------------------------------------------------- /clients/billing-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi'; 4 | 5 | export default definition as Document; 6 | -------------------------------------------------------------------------------- /clients/billing-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/billing-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/billing-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [{ from: '*.d.ts', context: './src' }], 21 | }), 22 | ], 23 | output: { 24 | path: path.join(__dirname, 'dist'), 25 | filename: 'definition.js', 26 | libraryTarget: 'commonjs', 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { Document, OpenAPIClient, OpenAPIClientAxios } from 'openapi-client-axios'; 2 | export type { Client, Components, OperationMethods, Paths, PathsDictionary } from './openapi'; 3 | 4 | export * from './client'; 5 | export * from './openapi'; 6 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/blueprint-manifest-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/consent-client/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /clients/consent-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/consent-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/consent-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/consent-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/consent-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/consent-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/consent-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/customer-portal-client/README.md: -------------------------------------------------------------------------------- 1 | # `@epilot/customer-portal-client` 2 | 3 | API Client for epilot customer-portal API. 4 | 5 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 6 | 7 | ## Getting Started 8 | 9 | Install the package: 10 | 11 | ```bash 12 | npm install --save-dev @epilot/customer-portal-client 13 | ``` 14 | 15 | Import the package: 16 | 17 | ```typescript 18 | import { getClient } from '@epilot/customer-portal-client'; 19 | ``` 20 | 21 | Use the client: 22 | ```typescript 23 | // get typed client 24 | const client = await getClient(); 25 | 26 | // call an operation 27 | const res = await client.testAuth(); 28 | ``` 29 | 30 | ## BaseURL & Authorization 31 | 32 | To pass an authorization header and set up the API url, you can use axios 33 | defaults: 34 | 35 | ```typescript 36 | const client = getClient(); 37 | client.defaults.baseURL = config.CUSTOMER_PORTAL_API; 38 | client.defaults.headers['authorization'] = `Bearer ${token}`; 39 | ``` 40 | 41 | ## API Docs: 42 | 43 | https://docs.api.epilot.io/ 44 | -------------------------------------------------------------------------------- /clients/customer-portal-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/customer-portal-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /clients/customer-portal-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | import { Client } from './openapi'; 5 | 6 | export const getClient = () => { 7 | const api = new OpenAPIClientAxios({ definition, quick: true }); 8 | 9 | return api.initSync(); 10 | }; 11 | -------------------------------------------------------------------------------- /clients/customer-portal-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi'; 4 | 5 | export default definition as Document; 6 | -------------------------------------------------------------------------------- /clients/customer-portal-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/customer-portal-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/customer-portal-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [{ from: '*.d.ts', context: './src' }], 21 | }), 22 | ], 23 | output: { 24 | path: path.join(__dirname, 'dist'), 25 | filename: 'definition.js', 26 | libraryTarget: 'commonjs', 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /clients/design-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/design-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/design-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/design-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/design-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/design-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { Document, OpenAPIClient, OpenAPIClientAxios } from 'openapi-client-axios'; 2 | export type { Client, Components, OperationMethods, Paths, PathsDictionary } from './openapi'; 3 | 4 | export * from './client'; 5 | export * from './openapi'; 6 | -------------------------------------------------------------------------------- /clients/design-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/design-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/discussion-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/discussion-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/discussion-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/discussion-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/discussion-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/discussion-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/discussion-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/document-client/README.md: -------------------------------------------------------------------------------- 1 | # `@epilot/document-client` 2 | 3 | API Client for epilot Document API. 4 | 5 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 6 | 7 | ## Getting Started 8 | 9 | Install the package: 10 | 11 | ```bash 12 | npm install --save-dev @epilot/document-client 13 | ``` 14 | 15 | Import the package: 16 | 17 | ```typescript 18 | import { getClient } from '@epilot/document-client'; 19 | ``` 20 | 21 | Use the client: 22 | ```typescript 23 | // get typed client 24 | const client = await getClient(); 25 | 26 | // call an operation 27 | const res = await client.generateDocument(null, {}); 28 | ``` 29 | 30 | ## BaseURL & Authorization 31 | 32 | To pass an authorization header and set up the API url, you can use axios 33 | defaults: 34 | 35 | ```typescript 36 | const client = getClient(); 37 | client.defaults.baseURL = config.API_URL; 38 | client.defaults.headers['authorization'] = `Bearer ${token}`; 39 | ``` 40 | 41 | ## API Docs: 42 | 43 | https://docs.api.epilot.io/document 44 | -------------------------------------------------------------------------------- /clients/document-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/document-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /clients/document-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | // eslint-disable-next-line import/no-unresolved 5 | import { Client } from './openapi'; 6 | 7 | export const getClient = () => { 8 | const api = new OpenAPIClientAxios({ definition, quick: true }); 9 | 10 | return api.initSync(); 11 | }; 12 | -------------------------------------------------------------------------------- /clients/document-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi.json'; 4 | 5 | export default definition as Document; 6 | -------------------------------------------------------------------------------- /clients/document-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | // eslint-disable-next-line import/no-unresolved 4 | 5 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 6 | -------------------------------------------------------------------------------- /clients/document-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": [ 8 | "esnext", 9 | "dom" 10 | ], 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "esModuleInterop": true, 14 | "noImplicitAny": true, 15 | "strictPropertyInitialization": false, 16 | "strictNullChecks": false, 17 | "resolveJsonModule": true, 18 | "baseUrl": ".", 19 | "rootDir": "src", 20 | "outDir": "dist", 21 | "sourceMap": true, 22 | "declaration": true 23 | }, 24 | "include": [ 25 | "src/**/*" 26 | ], 27 | "exclude": [ 28 | "**/*.test.ts" 29 | ] 30 | } -------------------------------------------------------------------------------- /clients/document-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/email-settings-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/email-settings-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/email-settings-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/email-settings-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/email-settings-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/email-settings-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/email-settings-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/email-template-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/email-template-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/email-template-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = (): Client => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | apiClient.defaults.headers.common = { 20 | ...(apiClient.defaults.headers.common ?? {}), 21 | ...(CorrelationIds.get() || {}), 22 | }; 23 | 24 | return apiClient; 25 | }; 26 | -------------------------------------------------------------------------------- /clients/email-template-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/email-template-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/email-template-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/email-template-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/entity-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/entity-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/entity-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/entity-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/entity-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | export * from './schema-model'; 4 | 5 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 6 | -------------------------------------------------------------------------------- /clients/entity-client/src/schema-model.ts: -------------------------------------------------------------------------------- 1 | export enum RelationAffinityMode { 2 | /** 3 | * For strong affinity mode on a relation attribute, deleting or creating the parent or the relation linkage will trigger a CASCADE delete or create to the relation entity itself. 4 | * For weak affinity mode on a relation attribute, deleting or creating the parent or the relation linkage will NOT trigger a CASCADE delete or create to the relation entity itself. 5 | */ 6 | WEAK = 'weak', 7 | STRONG = 'strong', 8 | } 9 | -------------------------------------------------------------------------------- /clients/entity-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true, 20 | "skipLibCheck": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["**/*.test.ts"] 24 | } 25 | -------------------------------------------------------------------------------- /clients/entity-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/entity-mapping-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/README.md: -------------------------------------------------------------------------------- 1 | # `@epilot/entity-viewers-client` 2 | 3 | API Client for epilot entity-viewers API. 4 | 5 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 6 | 7 | ## Getting Started 8 | 9 | Install the package: 10 | 11 | ```bash 12 | npm install --save-dev @epilot/entity-viewers-client 13 | ``` 14 | 15 | Import the package: 16 | 17 | ```typescript 18 | import { getClient } from '@epilot/entity-viewers-client'; 19 | ``` 20 | 21 | Use the client: 22 | ```typescript 23 | // get typed client 24 | const client = await getClient(); 25 | 26 | // call an operation 27 | const res = await client.testAuth(); 28 | ``` 29 | 30 | ## BaseURL & Authorization 31 | 32 | To pass an authorization header and set up the API url, you can use axios 33 | defaults: 34 | 35 | ```typescript 36 | const client = getClient(); 37 | client.defaults.baseURL = config.ENTITY_VIEWERS_API; 38 | client.defaults.headers['authorization'] = `Bearer ${token}`; 39 | ``` 40 | 41 | ## API Docs: 42 | 43 | https://docs.api.epilot.io/ 44 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | import { Client } from './openapi'; 5 | 6 | export const getClient = () => { 7 | const api = new OpenAPIClientAxios({ definition, quick: true }); 8 | 9 | return api.initSync(); 10 | }; 11 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi'; 4 | 5 | export default definition as Document; 6 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/entity-viewers-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [{ from: '*.d.ts', context: './src' }], 21 | }), 22 | ], 23 | output: { 24 | path: path.join(__dirname, 'dist'), 25 | filename: 'definition.js', 26 | libraryTarget: 'commonjs', 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /clients/erp-integration-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | -------------------------------------------------------------------------------- /clients/erp-integration-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/erp-integration-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/erp-integration-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/erp-integration-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/erp-integration-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/erp-integration-client/src/openapi-runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.3", 3 | "info": { 4 | "title": "", 5 | "version": "" 6 | }, 7 | "paths": { 8 | "/v1/erp/tracking/acknowledgement": { 9 | "post": { 10 | "operationId": "acknowledgeTracking", 11 | "requestBody": { 12 | "content": { 13 | "application/json": {} 14 | } 15 | }, 16 | "responses": {} 17 | } 18 | }, 19 | "/v1/erp/trigger": { 20 | "post": { 21 | "operationId": "triggerErp", 22 | "requestBody": { 23 | "content": { 24 | "application/json": {} 25 | } 26 | }, 27 | "responses": {} 28 | } 29 | } 30 | }, 31 | "components": {}, 32 | "servers": [ 33 | { 34 | "url": "https://erp-integration-api.sls.epilot.io" 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /clients/erp-integration-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/erp-integration-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/file-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/file-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/file-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | import { Client } from './openapi'; 5 | 6 | let client: Client; 7 | export const getClient = () => { 8 | if (!client) { 9 | client = createClient(); 10 | } 11 | 12 | return client; 13 | }; 14 | 15 | export const createClient = () => { 16 | const api = new OpenAPIClientAxios({ definition, quick: true }); 17 | 18 | return api.initSync(); 19 | }; 20 | -------------------------------------------------------------------------------- /clients/file-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/file-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/file-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/file-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/kanban-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | -------------------------------------------------------------------------------- /clients/kanban-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/kanban-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI) 4 | [![npm version](https://img.shields.io/npm/v/@epilot/kanban-client.svg)](https://www.npmjs.com/package/@epilot/kanban-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/kanban-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/kanban-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | Client library for epilot [Kanban API](https://docs.epilot.io/api/kanban) 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```bash 15 | npm install --save @epilot/kanban-client 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```typescript 21 | import { getClient } from '@epilot/kanban-client'; 22 | 23 | const kanbanClient = getClient(); 24 | const res = await kanbanClient.getKanbanBoards(null); 25 | ``` 26 | 27 | ## Documentation 28 | 29 | https://docs.epilot.io/docs/kanban 30 | -------------------------------------------------------------------------------- /clients/kanban-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/kanban-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/kanban-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/kanban-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/kanban-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/kanban-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/kanban-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/message-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/message-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/message-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/message-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/message-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/message-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/message-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/message-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/metering-client/README.md: -------------------------------------------------------------------------------- 1 | # `@epilot/metering-client` 2 | 3 | API Client for epilot ts-sam API. 4 | 5 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 6 | 7 | ## Getting Started 8 | 9 | Install the package: 10 | 11 | ```bash 12 | npm install --save-dev @epilot/metering-client 13 | ``` 14 | 15 | Import the package: 16 | 17 | ```typescript 18 | import { getClient } from '@epilot/metering-client'; 19 | ``` 20 | 21 | Use the client: 22 | ```typescript 23 | // get typed client 24 | const client = await getClient(); 25 | 26 | // call an operation 27 | const res = await client.createMeterReading(); 28 | ``` 29 | 30 | ## BaseURL & Authorization 31 | 32 | To pass an authorization header and set up the API url, you can use axios 33 | defaults: 34 | 35 | ```typescript 36 | const client = getClient(); 37 | client.defaults.baseURL = config.API_URL; 38 | client.defaults.headers['authorization'] = `Bearer ${token}`; 39 | ``` 40 | 41 | ## API Docs: 42 | 43 | https://docs.api.epilot.io/ 44 | -------------------------------------------------------------------------------- /clients/metering-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/metering-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /clients/metering-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | import { Client } from './openapi'; 5 | 6 | export const getClient = () => { 7 | const api = new OpenAPIClientAxios({ definition, quick: true }); 8 | 9 | return api.initSync(); 10 | }; 11 | -------------------------------------------------------------------------------- /clients/metering-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi.json'; 4 | 5 | export default definition as Document; 6 | -------------------------------------------------------------------------------- /clients/metering-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/metering-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/metering-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [{ from: '*.d.ts', context: './src' }], 21 | }), 22 | ], 23 | output: { 24 | path: path.join(__dirname, 'dist'), 25 | filename: 'definition.js', 26 | libraryTarget: 'commonjs', 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /clients/notes-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/notes-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)]() 4 | [![npm version](https://img.shields.io/npm/v/@epilot/notes-client.svg)](https://www.npmjs.com/package/@epilot/notes-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/notes-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/notes-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | Client library for epilot Notes API 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```bash 15 | npm install --save @epilot/notes-client 16 | ``` 17 | -------------------------------------------------------------------------------- /clients/notes-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/notes-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/notes-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/notes-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/notes-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/notes-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/notes-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/notification-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/notification-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/notification-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/notification-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/notification-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { Document, OpenAPIClient, OpenAPIClientAxios } from 'openapi-client-axios'; 2 | export * from './client'; 3 | export * from './openapi'; 4 | export type { Client, Components, OperationMethods, Paths, PathsDictionary } from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/notification-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/notification-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/organization-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/organization-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/organization-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/organization-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/organization-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/organization-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/organization-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/partner-directory-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/partner-directory-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/partner-directory-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import OpenAPIClientAxios from 'openapi-client-axios'; 2 | 3 | import definition from './definition'; 4 | import { Client } from './openapi'; 5 | 6 | let client: Client; 7 | export const getClient = () => { 8 | if (!client) { 9 | client = createClient(); 10 | } 11 | 12 | return client; 13 | }; 14 | 15 | export const createClient = () => { 16 | const api = new OpenAPIClientAxios({ definition, quick: true }); 17 | 18 | return api.initSync(); 19 | }; 20 | -------------------------------------------------------------------------------- /clients/partner-directory-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/partner-directory-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/partner-directory-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/partner-directory-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/permissions-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/permissions-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/permissions-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/permissions-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/permissions-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/permissions-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/permissions-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/pricing-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/pricing-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/pricing-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI) 4 | [![npm version](https://img.shields.io/npm/v/@epilot/pricing-client.svg)](https://www.npmjs.com/package/@epilot/pricing-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/pricing-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/pricing-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | Client library for epilot [Pricing API](https://docs.epilot.io/api/pricing) 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```bash 15 | npm install --save @epilot/pricing-client 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```typescript 21 | import { getClient } from '@epilot/pricing-client'; 22 | 23 | const pricingClient = getClient() 24 | const res = await pricingClient.createOrder(null, order) 25 | ``` 26 | 27 | ## Documentation: 28 | 29 | https://docs.epilot.io/api/pricing 30 | -------------------------------------------------------------------------------- /clients/pricing-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/pricing-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/pricing-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/pricing-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/pricing-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/pricing-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/pricing-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/pricing-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI) 4 | [![npm version](https://img.shields.io/npm/v/@epilot/pricing-client.svg)](https://www.npmjs.com/package/@epilot/pricing-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/pricing-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/pricing-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | Client library for epilot [Pricing API](https://docs.epilot.io/api/pricing) 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```bash 15 | npm install --save @epilot/pricing-tier-client 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```typescript 21 | import { getClient } from '@epilot/pricing-tier-client'; 22 | 23 | const client = getClient() 24 | const res = await client.getPricingTiers() 25 | ``` 26 | 27 | ## Documentation: 28 | 29 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/src/openapi-runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.3", 3 | "info": { 4 | "title": "", 5 | "version": "" 6 | }, 7 | "paths": { 8 | "/v2/pricing-tiers/me": { 9 | "get": { 10 | "operationId": "getCurrentPricingTier" 11 | } 12 | } 13 | }, 14 | "components": {}, 15 | "servers": [ 16 | { 17 | "url": "https://pricing-tier.sls.epilot.io" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/pricing-tier-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/sandbox-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !webpack.config.js 3 | -------------------------------------------------------------------------------- /clients/sandbox-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/sandbox-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI) 4 | [![npm version](https://img.shields.io/npm/v/@epilot/sandbox-client.svg)](https://www.npmjs.com/package/@epilot/sandbox-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/sandbox-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/sandbox-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | Client library for epilot [Design API](https://docs.epilot.io/api/sandbox) 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```bash 15 | npm install --save @epilot/sandbox-client 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```typescript 21 | import { getClient } from "@epilot/sandbox-client"; 22 | 23 | const sanboxClient = getClient(); 24 | const res = await sanboxClient.listPipelines(); 25 | ``` 26 | 27 | ## Documentation: 28 | 29 | https://docs.epilot.io/api/sandbox 30 | -------------------------------------------------------------------------------- /clients/sandbox-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/sandbox-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/sandbox-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ 18 | definition, 19 | quick: true, 20 | }); 21 | 22 | const apiClient = api.initSync(); 23 | 24 | apiClient.defaults.headers.common = { 25 | ...(apiClient.defaults.headers.common ?? {}), 26 | ...(CorrelationIds.get() || {}), 27 | }; 28 | 29 | return apiClient; 30 | }; 31 | -------------------------------------------------------------------------------- /clients/sandbox-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/sandbox-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { Document, OpenAPIClient, OpenAPIClientAxios } from 'openapi-client-axios'; 2 | export type { Client, Components, OperationMethods, Paths, PathsDictionary } from './openapi'; 3 | 4 | export * from './client'; 5 | export * from './openapi'; 6 | -------------------------------------------------------------------------------- /clients/sandbox-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/sandbox-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/submission-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/submission-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/submission-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/submission-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/submission-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/submission-client/src/openapi-runtime.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.2", 3 | "info": { 4 | "title": "", 5 | "version": "" 6 | }, 7 | "paths": { 8 | "/v1/submission/submissions": { 9 | "post": { 10 | "operationId": "createSubmission", 11 | "requestBody": { 12 | "content": { 13 | "application/json": {} 14 | } 15 | }, 16 | "responses": {} 17 | } 18 | }, 19 | "/v1/submission/nonce/{nonce_id}": { 20 | "get": { 21 | "operationId": "getNonce", 22 | "parameters": [ 23 | { 24 | "name": "nonce_id", 25 | "in": "path", 26 | "required": true 27 | } 28 | ], 29 | "responses": {} 30 | } 31 | } 32 | }, 33 | "components": {}, 34 | "servers": [ 35 | { 36 | "url": "https://submission.sls.epilot.io" 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /clients/submission-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/submission-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/targeting-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/targeting-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/targeting-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/targeting-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/targeting-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/targeting-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true, 20 | "skipLibCheck": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["**/*.test.ts"] 24 | } 25 | -------------------------------------------------------------------------------- /clients/targeting-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/template-variables-client/.node-version: -------------------------------------------------------------------------------- 1 | v16 2 | -------------------------------------------------------------------------------- /clients/template-variables-client/.nvmrc: -------------------------------------------------------------------------------- 1 | v16 2 | -------------------------------------------------------------------------------- /clients/template-variables-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/template-variables-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/template-variables-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/template-variables-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/template-variables-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './client'; 2 | export * from './openapi'; 3 | 4 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 5 | -------------------------------------------------------------------------------- /clients/template-variables-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true, 20 | "allowJs": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["**/*.test.ts"] 24 | } 25 | -------------------------------------------------------------------------------- /clients/template-variables-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/user-client/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /clients/user-client/README.md: -------------------------------------------------------------------------------- 1 | # @epilot/user-client 2 | 3 | [![CI](https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg)](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI) 4 | [![npm version](https://img.shields.io/npm/v/@epilot/user-client.svg)](https://www.npmjs.com/package/@epilot/user-client) 5 | [![bundle size](https://img.shields.io/bundlephobia/minzip/@epilot/user-client?label=gzip%20bundle)](https://bundlephobia.com/package/@epilot/user-client) 6 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE) 7 | 8 | Client library for epilot [User API](https://docs.epilot.io/api/user). 9 | 10 | Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios) 11 | 12 | ## Installation 13 | 14 | ```sh 15 | npm install --save-dev @epilot/user-client 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```typescript 21 | import { getClient } from '@epilot/user-client'; 22 | 23 | const userCLient = getClient(); 24 | const currentUser = await userClient.getMe().then(res => res.data); 25 | ``` 26 | 27 | ## Documentation 28 | 29 | https://docs.epilot.io/api/user 30 | -------------------------------------------------------------------------------- /clients/user-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/user-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should inititalise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/user-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | 19 | const apiClient = api.initSync(); 20 | 21 | apiClient.defaults.headers.common = { 22 | ...(apiClient.defaults.headers.common ?? {}), 23 | ...(CorrelationIds.get() || {}), 24 | }; 25 | 26 | return apiClient; 27 | }; 28 | -------------------------------------------------------------------------------- /clients/user-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/user-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/user-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/user-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/webhooks-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### [0.1.1](https://github.com/epilot-dev/sdk-js/compare/v1.0.0...v0.1.1) (2022-03-09) 6 | -------------------------------------------------------------------------------- /clients/webhooks-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/webhooks-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/webhooks-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/webhooks-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/webhooks-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/webhooks-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/webhooks-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/workflow-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### [0.1.1](https://github.com/epilot-dev/sdk-js/compare/v1.0.0...v0.1.1) (2022-03-09) 6 | -------------------------------------------------------------------------------- /clients/workflow-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/workflow-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/workflow-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/workflow-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/workflow-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/workflow-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/workflow-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### [0.1.1](https://github.com/epilot-dev/sdk-js/compare/v1.0.0...v0.1.1) (2022-03-09) 6 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 7 | testPathIgnorePatterns: ['node_modules'], 8 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 9 | verbose: true, 10 | silent: true, 11 | moduleNameMapper: { 12 | '^axios$': require.resolve('axios'), 13 | }, 14 | }; 15 | 16 | export default config; 17 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/src/client.test.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from './client'; 2 | 3 | describe('client', () => { 4 | describe('getClient', () => { 5 | it('should initialise and return client', async () => { 6 | const client = getClient(); 7 | 8 | expect(client.api.initialized).toBe(true); 9 | }); 10 | 11 | it('should have operations', async () => { 12 | const client = getClient(); 13 | 14 | const operations = client.api.getOperations(); 15 | 16 | expect(operations.length).toBeGreaterThan(0); 17 | }); 18 | 19 | it('should have a default server defined', async () => { 20 | const client = getClient(); 21 | 22 | expect(client.defaults.baseURL).toBeDefined(); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/src/client.ts: -------------------------------------------------------------------------------- 1 | import CorrelationIds from '@dazn/lambda-powertools-correlation-ids'; 2 | import OpenAPIClientAxios from 'openapi-client-axios'; 3 | 4 | import definition from './definition'; 5 | import { Client } from './openapi'; 6 | 7 | let client: Client; 8 | export const getClient = () => { 9 | if (!client) { 10 | client = createClient(); 11 | } 12 | 13 | return client; 14 | }; 15 | 16 | export const createClient = () => { 17 | const api = new OpenAPIClientAxios({ definition, quick: true }); 18 | const apiClient = api.initSync(); 19 | 20 | apiClient.defaults.headers.common = { 21 | ...(apiClient.defaults.headers.common ?? {}), 22 | ...(CorrelationIds.get() || {}), 23 | }; 24 | 25 | return apiClient; 26 | }; 27 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/src/definition.ts: -------------------------------------------------------------------------------- 1 | import type { Document } from 'openapi-client-axios'; 2 | 3 | import definition from './openapi-runtime.json'; 4 | 5 | export default (definition as unknown) as Document; 6 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios'; 2 | 3 | export * from './client'; 4 | export * from './openapi'; 5 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": ["esnext", "dom"], 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "esModuleInterop": true, 11 | "noImplicitAny": true, 12 | "strictPropertyInitialization": false, 13 | "strictNullChecks": false, 14 | "resolveJsonModule": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "outDir": "dist", 18 | "sourceMap": true, 19 | "declaration": true 20 | }, 21 | "include": ["src/**/*"], 22 | "exclude": ["**/*.test.ts"] 23 | } 24 | -------------------------------------------------------------------------------- /clients/workflow-definition-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | const path = require('path'); 3 | 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = { 7 | entry: './src/definition.ts', 8 | mode: 'production', 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.tsx?$/, 13 | use: 'ts-loader', 14 | exclude: /node_modules/, 15 | }, 16 | ], 17 | }, 18 | plugins: [ 19 | new CopyPlugin({ 20 | patterns: [ 21 | { from: '*.d.ts', context: './src' }, 22 | { from: '*.json', context: './src' }, 23 | ], 24 | }), 25 | ], 26 | output: { 27 | path: path.join(__dirname, 'dist'), 28 | filename: 'definition.js', 29 | libraryTarget: 'commonjs', 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["packages/*", "clients/*"], 3 | "version": "independent" 4 | } 5 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epilot-dev/sdk-js/969a7054ec30b489d622c25a2dccf71591ee7dac/logo.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@epilot/sdk-monorepo", 3 | "private": true, 4 | "version": "4.7.3", 5 | "description": "Javascript SDK monorepo for epilot", 6 | "scripts": { 7 | "clean": "lerna clean", 8 | "dev": "lerna run build:watch", 9 | "test": "lerna run test --stream", 10 | "lint": "lerna run lint", 11 | "build": "lerna run build", 12 | "postinstall": "lerna bootstrap", 13 | "lint:fix": "eslint \"**/*.{js,ts}\" --fix" 14 | }, 15 | "keywords": [ 16 | "epilot", 17 | "sdk" 18 | ], 19 | "author": "epilot GmbH", 20 | "license": "MIT", 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/epilot-dev/sdk-js.git" 24 | }, 25 | "bugs": { 26 | "url": "https://github.com/epilot-dev/sdk-js/issues" 27 | }, 28 | "homepage": "https://github.com/epilot-dev/sdk-js#readme", 29 | "devDependencies": { 30 | "@epilot/eslint-config": "^1.2.10", 31 | "@types/jest": "^27.4.0", 32 | "eslint": "^7.32.0", 33 | "lerna": "^6.4.1", 34 | "typescript": "^4.9.3", 35 | "openapicmd": "^2.6.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/auth/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /packages/auth/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | clearMocks: true, 7 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 8 | testPathIgnorePatterns: ['node_modules'], 9 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 10 | verbose: true, 11 | silent: false, 12 | forceExit: true, 13 | moduleNameMapper: { 14 | '^axios$': require.resolve('axios'), 15 | }, 16 | }; 17 | 18 | export default config; 19 | -------------------------------------------------------------------------------- /packages/auth/src/client.ts: -------------------------------------------------------------------------------- 1 | import { AxiosInstance } from 'openapi-client-axios'; 2 | 3 | import { OAuthTokens } from './types'; 4 | 5 | export const authorizeClient = (tokens: OAuthTokens) => (client: T): T => { 6 | client.interceptors.request.use((request) => { 7 | request.headers['authorization'] = `Bearer ${tokens.access_token}`; 8 | 9 | return request; 10 | }); 11 | 12 | return client; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/auth/src/config.ts: -------------------------------------------------------------------------------- 1 | export const config = { 2 | USER_API_URL: process.env.USER_API_URL ?? process.env.REACT_APP_USER_API_URL ?? 'https://user.sls.epilot.io', 3 | }; 4 | -------------------------------------------------------------------------------- /packages/auth/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './token'; 2 | export * from './login'; 3 | -------------------------------------------------------------------------------- /packages/auth/src/script/print-token.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import yargsInteractive from 'yargs-interactive'; 4 | 5 | import { authenticate } from '..'; 6 | 7 | yargsInteractive() 8 | .usage('$0 [args]') 9 | .interactive({ 10 | interactive: { default: true }, 11 | user: { type: 'input', describe: 'Email' }, 12 | pass: { type: 'password', describe: 'Password' }, 13 | }) 14 | .then(async (result) => { 15 | try { 16 | const credentials = await authenticate({ 17 | username: result.user, 18 | password: result.pass, 19 | }); 20 | console.log(credentials?.tokens?.access_token); 21 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 22 | } catch (err: any) { 23 | console.error(err.message); 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /packages/auth/src/token.ts: -------------------------------------------------------------------------------- 1 | import type { AxiosInstance } from 'axios'; 2 | 3 | import { authorizeClient } from './client'; 4 | 5 | /** 6 | * Configures an epilot API client with a Bearer token 7 | */ 8 | export const authorizeWithToken = (client: T, accessToken: string): T => { 9 | return authorizeClient({ access_token: accessToken })(client); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/auth/src/types.ts: -------------------------------------------------------------------------------- 1 | import type { AxiosInstance } from 'openapi-client-axios'; 2 | 3 | export interface Credentials { 4 | /** 5 | * Currently active OAuth tokens 6 | */ 7 | tokens: OAuthTokens; 8 | /** 9 | * Refresh tokens 10 | */ 11 | refresh(): Promise; 12 | /** 13 | * Revoke tokens and sign out 14 | */ 15 | logout(): Promise; 16 | /** 17 | * Configures an axios instance to pass oauth tokens 18 | */ 19 | configureClient: (client: T) => T; 20 | } 21 | 22 | export interface OAuthTokens { 23 | access_token: string; 24 | id_token?: string; 25 | refresh_token?: string; 26 | } 27 | -------------------------------------------------------------------------------- /packages/auth/src/user.ts: -------------------------------------------------------------------------------- 1 | import { getClient as getUserClient } from '@epilot/user-client'; 2 | import axios from 'axios'; 3 | 4 | import { config } from './config'; 5 | 6 | export const getLoginParametersForUser = async (params: { username: string }) => { 7 | try { 8 | const userClient = getUserClient(); 9 | userClient.defaults.baseURL = userClient.defaults.baseURL ?? config.USER_API_URL; 10 | 11 | const loginParamsRes = await userClient.getUserLoginParametersV2({ username: params.username }); 12 | const loginParams = loginParamsRes.data?.login_parameters?.[0]; 13 | 14 | return { 15 | userPoolId: loginParams.cognito_user_pool_id, 16 | userPoolClientId: loginParams.cognito_user_pool_client_id, 17 | }; 18 | } catch (err) { 19 | if (axios.isAxiosError(err) && err.code === '404') { 20 | throw new Error('InvalidUser'); 21 | } 22 | 23 | throw err; 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /packages/auth/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "lib": [ 8 | "esnext" 9 | ], 10 | "allowSyntheticDefaultImports": true, 11 | "esModuleInterop": true, 12 | "noImplicitAny": true, 13 | "strictPropertyInitialization": false, 14 | "strictNullChecks": false, 15 | "skipLibCheck": true, 16 | "baseUrl": ".", 17 | "rootDir": "src/", 18 | "outDir": "dist/", 19 | "sourceMap": true, 20 | "declaration": true 21 | }, 22 | "include": [ 23 | "src/**/*" 24 | ], 25 | "exclude": [ 26 | "**/*.test.ts", 27 | "src/__tests__", 28 | "node_modules", 29 | "dist" 30 | ] 31 | } -------------------------------------------------------------------------------- /packages/epilot-sdk/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.d.ts 3 | *.map 4 | !src/* 5 | !webpack.config.js 6 | -------------------------------------------------------------------------------- /packages/epilot-sdk/jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from '@jest/types'; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: 'ts-jest', 5 | testEnvironment: 'node', 6 | clearMocks: true, 7 | testMatch: ['**/?(*.)+(spec|test).ts?(x)'], 8 | testPathIgnorePatterns: ['node_modules'], 9 | coveragePathIgnorePatterns: ['__tests__', 'node_modules'], 10 | verbose: true, 11 | silent: false, 12 | forceExit: true, 13 | moduleNameMapper: { 14 | '^axios$': require.resolve('axios'), 15 | }, 16 | }; 17 | 18 | export default config; 19 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/access-token-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/access-token-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/access-token-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/address-suggestions-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/address-suggestions-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/address-suggestions-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/audit-logs-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/audit-logs-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/audit-logs-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/auth.ts: -------------------------------------------------------------------------------- 1 | export * from '@epilot/auth'; 2 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/automation-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/automation-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/automation-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/blueprint-manifest-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/blueprint-manifest-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/blueprint-manifest-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/customer-portal-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/customer-portal-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/customer-portal-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/design-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/design-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/design-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/discussion-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/discussion-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/discussion-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/email-settings-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/email-settings-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/email-settings-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/email-template-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/email-template-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/email-template-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/entity-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/entity-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/entity-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/file-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/file-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/file-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/message-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/message-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/message-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/metering-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/metering-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/metering-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/notification-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/notification-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/notification-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/organization-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/organization-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/organization-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/partner-directory-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/partner-directory-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/partner-directory-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/permissions-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/permissions-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/permissions-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/pricing-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/pricing-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/pricing-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/sandbox-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/sandbox-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/sandbox-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/submission-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/organization-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/organization-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/template-variables-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/template-variables-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/template-variables-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/user-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/user-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/user-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/src/workflow-client.ts: -------------------------------------------------------------------------------- 1 | import { getClient } from '@epilot/workflow-client'; 2 | 3 | const client = getClient(); 4 | export default client; 5 | 6 | export * from '@epilot/workflow-client'; 7 | -------------------------------------------------------------------------------- /packages/epilot-sdk/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "NodeNext", 7 | "lib": ["esnext"], 8 | "esModuleInterop": true, 9 | "noImplicitAny": true, 10 | "strictPropertyInitialization": false, 11 | "strictNullChecks": false, 12 | "experimentalDecorators": true, 13 | "emitDecoratorMetadata": true, 14 | "noUnusedLocals": true, 15 | "baseUrl": ".", 16 | "rootDir": "src", 17 | "resolveJsonModule": true, 18 | "outDir": ".", 19 | "sourceMap": true, 20 | "declaration": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["**/*.test.ts", "src/__tests__", "node_modules", "dist"] 24 | } 25 | --------------------------------------------------------------------------------