From b88c5685d87aaad8418c1bfcb399fc06e9d5b81b Mon Sep 17 00:00:00 2001 From: Marat Shakirov Date: Mon, 12 Feb 2024 20:15:43 +0100 Subject: [PATCH] feat: update client all --- package-lock.json | 162 +- packages/sdk-client-aca/.gitignore | 37 + packages/sdk-client-aca/.npmignore | 10 + .../sdk-client-aca/.openapi-generator-ignore | 23 + .../sdk-client-aca/.openapi-generator/FILES | 14 + .../sdk-client-aca/.openapi-generator/VERSION | 1 + packages/sdk-client-aca/README.md | 53 + packages/sdk-client-aca/api.ts | 334 + packages/sdk-client-aca/base.ts | 88 + packages/sdk-client-aca/common.ts | 203 + packages/sdk-client-aca/configuration.ts | 132 + packages/sdk-client-aca/git_push.sh | 57 + packages/sdk-client-aca/index.ts | 16 + packages/sdk-client-aca/package.json | 37 + packages/sdk-client-aca/project.json | 41 + packages/sdk-client-aca/tsconfig.esm.json | 7 + packages/sdk-client-aca/tsconfig.json | 13 + packages/sdk-client-cwe/.gitignore | 37 + packages/sdk-client-cwe/.npmignore | 10 + .../sdk-client-cwe/.openapi-generator-ignore | 23 + .../sdk-client-cwe/.openapi-generator/FILES | 14 + .../sdk-client-cwe/.openapi-generator/VERSION | 1 + packages/sdk-client-cwe/README.md | 53 + packages/sdk-client-cwe/api.ts | 1525 ++++ packages/sdk-client-cwe/base.ts | 88 + packages/sdk-client-cwe/common.ts | 203 + packages/sdk-client-cwe/configuration.ts | 132 + packages/sdk-client-cwe/git_push.sh | 57 + packages/sdk-client-cwe/index.ts | 16 + packages/sdk-client-cwe/package.json | 37 + packages/sdk-client-cwe/project.json | 41 + packages/sdk-client-cwe/tsconfig.esm.json | 7 + packages/sdk-client-cwe/tsconfig.json | 13 + packages/sdk-client-dcf/.gitignore | 37 + packages/sdk-client-dcf/.npmignore | 10 + .../sdk-client-dcf/.openapi-generator-ignore | 23 + .../sdk-client-dcf/.openapi-generator/FILES | 14 + .../sdk-client-dcf/.openapi-generator/VERSION | 1 + packages/sdk-client-dcf/README.md | 53 + packages/sdk-client-dcf/api.ts | 6855 ++++++++++++++++ packages/sdk-client-dcf/base.ts | 88 + packages/sdk-client-dcf/common.ts | 203 + packages/sdk-client-dcf/configuration.ts | 132 + packages/sdk-client-dcf/git_push.sh | 57 + packages/sdk-client-dcf/index.ts | 16 + packages/sdk-client-dcf/package.json | 37 + packages/sdk-client-dcf/project.json | 41 + packages/sdk-client-dcf/tsconfig.esm.json | 7 + packages/sdk-client-dcf/tsconfig.json | 13 + packages/sdk-client-iam/CHANGELOG.md | 44 - packages/sdk-client-iam/api.ts | 1 - packages/sdk-client-iam/package.json | 4 +- packages/sdk-client-iam/project.json | 1 + packages/sdk-client-kms/CHANGELOG.md | 13 - packages/sdk-client-kms/package.json | 4 +- packages/sdk-client-kyc/.gitignore | 37 + packages/sdk-client-kyc/.npmignore | 10 + .../sdk-client-kyc/.openapi-generator-ignore | 23 + .../sdk-client-kyc/.openapi-generator/FILES | 14 + .../sdk-client-kyc/.openapi-generator/VERSION | 1 + packages/sdk-client-kyc/README.md | 53 + packages/sdk-client-kyc/api.ts | 1063 +++ packages/sdk-client-kyc/base.ts | 88 + packages/sdk-client-kyc/common.ts | 203 + packages/sdk-client-kyc/configuration.ts | 132 + packages/sdk-client-kyc/git_push.sh | 57 + packages/sdk-client-kyc/index.ts | 16 + packages/sdk-client-kyc/package.json | 37 + packages/sdk-client-kyc/project.json | 41 + packages/sdk-client-kyc/tsconfig.esm.json | 7 + packages/sdk-client-kyc/tsconfig.json | 13 + packages/sdk-client-vpa/.gitignore | 37 + packages/sdk-client-vpa/.npmignore | 10 + .../sdk-client-vpa/.openapi-generator-ignore | 23 + .../sdk-client-vpa/.openapi-generator/FILES | 14 + .../sdk-client-vpa/.openapi-generator/VERSION | 1 + packages/sdk-client-vpa/README.md | 53 + packages/sdk-client-vpa/api.ts | 6909 +++++++++++++++++ packages/sdk-client-vpa/base.ts | 88 + packages/sdk-client-vpa/common.ts | 203 + packages/sdk-client-vpa/configuration.ts | 132 + packages/sdk-client-vpa/git_push.sh | 57 + packages/sdk-client-vpa/index.ts | 16 + packages/sdk-client-vpa/package.json | 37 + packages/sdk-client-vpa/project.json | 41 + packages/sdk-client-vpa/tsconfig.esm.json | 7 + packages/sdk-client-vpa/tsconfig.json | 13 + 87 files changed, 20506 insertions(+), 69 deletions(-) create mode 100644 packages/sdk-client-aca/.gitignore create mode 100644 packages/sdk-client-aca/.npmignore create mode 100644 packages/sdk-client-aca/.openapi-generator-ignore create mode 100644 packages/sdk-client-aca/.openapi-generator/FILES create mode 100644 packages/sdk-client-aca/.openapi-generator/VERSION create mode 100644 packages/sdk-client-aca/README.md create mode 100644 packages/sdk-client-aca/api.ts create mode 100644 packages/sdk-client-aca/base.ts create mode 100644 packages/sdk-client-aca/common.ts create mode 100644 packages/sdk-client-aca/configuration.ts create mode 100644 packages/sdk-client-aca/git_push.sh create mode 100644 packages/sdk-client-aca/index.ts create mode 100644 packages/sdk-client-aca/package.json create mode 100644 packages/sdk-client-aca/project.json create mode 100644 packages/sdk-client-aca/tsconfig.esm.json create mode 100644 packages/sdk-client-aca/tsconfig.json create mode 100644 packages/sdk-client-cwe/.gitignore create mode 100644 packages/sdk-client-cwe/.npmignore create mode 100644 packages/sdk-client-cwe/.openapi-generator-ignore create mode 100644 packages/sdk-client-cwe/.openapi-generator/FILES create mode 100644 packages/sdk-client-cwe/.openapi-generator/VERSION create mode 100644 packages/sdk-client-cwe/README.md create mode 100644 packages/sdk-client-cwe/api.ts create mode 100644 packages/sdk-client-cwe/base.ts create mode 100644 packages/sdk-client-cwe/common.ts create mode 100644 packages/sdk-client-cwe/configuration.ts create mode 100644 packages/sdk-client-cwe/git_push.sh create mode 100644 packages/sdk-client-cwe/index.ts create mode 100644 packages/sdk-client-cwe/package.json create mode 100644 packages/sdk-client-cwe/project.json create mode 100644 packages/sdk-client-cwe/tsconfig.esm.json create mode 100644 packages/sdk-client-cwe/tsconfig.json create mode 100644 packages/sdk-client-dcf/.gitignore create mode 100644 packages/sdk-client-dcf/.npmignore create mode 100644 packages/sdk-client-dcf/.openapi-generator-ignore create mode 100644 packages/sdk-client-dcf/.openapi-generator/FILES create mode 100644 packages/sdk-client-dcf/.openapi-generator/VERSION create mode 100644 packages/sdk-client-dcf/README.md create mode 100644 packages/sdk-client-dcf/api.ts create mode 100644 packages/sdk-client-dcf/base.ts create mode 100644 packages/sdk-client-dcf/common.ts create mode 100644 packages/sdk-client-dcf/configuration.ts create mode 100644 packages/sdk-client-dcf/git_push.sh create mode 100644 packages/sdk-client-dcf/index.ts create mode 100644 packages/sdk-client-dcf/package.json create mode 100644 packages/sdk-client-dcf/project.json create mode 100644 packages/sdk-client-dcf/tsconfig.esm.json create mode 100644 packages/sdk-client-dcf/tsconfig.json delete mode 100644 packages/sdk-client-iam/CHANGELOG.md delete mode 100644 packages/sdk-client-kms/CHANGELOG.md create mode 100644 packages/sdk-client-kyc/.gitignore create mode 100644 packages/sdk-client-kyc/.npmignore create mode 100644 packages/sdk-client-kyc/.openapi-generator-ignore create mode 100644 packages/sdk-client-kyc/.openapi-generator/FILES create mode 100644 packages/sdk-client-kyc/.openapi-generator/VERSION create mode 100644 packages/sdk-client-kyc/README.md create mode 100644 packages/sdk-client-kyc/api.ts create mode 100644 packages/sdk-client-kyc/base.ts create mode 100644 packages/sdk-client-kyc/common.ts create mode 100644 packages/sdk-client-kyc/configuration.ts create mode 100644 packages/sdk-client-kyc/git_push.sh create mode 100644 packages/sdk-client-kyc/index.ts create mode 100644 packages/sdk-client-kyc/package.json create mode 100644 packages/sdk-client-kyc/project.json create mode 100644 packages/sdk-client-kyc/tsconfig.esm.json create mode 100644 packages/sdk-client-kyc/tsconfig.json create mode 100644 packages/sdk-client-vpa/.gitignore create mode 100644 packages/sdk-client-vpa/.npmignore create mode 100644 packages/sdk-client-vpa/.openapi-generator-ignore create mode 100644 packages/sdk-client-vpa/.openapi-generator/FILES create mode 100644 packages/sdk-client-vpa/.openapi-generator/VERSION create mode 100644 packages/sdk-client-vpa/README.md create mode 100644 packages/sdk-client-vpa/api.ts create mode 100644 packages/sdk-client-vpa/base.ts create mode 100644 packages/sdk-client-vpa/common.ts create mode 100644 packages/sdk-client-vpa/configuration.ts create mode 100644 packages/sdk-client-vpa/git_push.sh create mode 100644 packages/sdk-client-vpa/index.ts create mode 100644 packages/sdk-client-vpa/package.json create mode 100644 packages/sdk-client-vpa/project.json create mode 100644 packages/sdk-client-vpa/tsconfig.esm.json create mode 100644 packages/sdk-client-vpa/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 951ef115..040b28dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,18 @@ "node": ">=0.10.0" } }, + "node_modules/@affinidi/test-sdk-client-aca": { + "resolved": "packages/sdk-client-aca", + "link": true + }, + "node_modules/@affinidi/test-sdk-client-cwe": { + "resolved": "packages/sdk-client-cwe", + "link": true + }, + "node_modules/@affinidi/test-sdk-client-dcf": { + "resolved": "packages/sdk-client-dcf", + "link": true + }, "node_modules/@affinidi/test-sdk-client-iam": { "resolved": "packages/sdk-client-iam", "link": true @@ -58,6 +70,14 @@ "resolved": "packages/sdk-client-kms", "link": true }, + "node_modules/@affinidi/test-sdk-client-kyc": { + "resolved": "packages/sdk-client-kyc", + "link": true + }, + "node_modules/@affinidi/test-sdk-client-vpa": { + "resolved": "packages/sdk-client-vpa", + "link": true + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -14801,7 +14821,6 @@ "packages/sdk-client-aca": { "name": "@affinidi/test-sdk-client-aca", "version": "1.0.0", - "extraneous": true, "license": "Unlicense", "dependencies": { "axios": "^1.6.0", @@ -14812,10 +14831,65 @@ "typescript": "^4.0" } }, + "packages/sdk-client-aca/node_modules/@types/node": { + "version": "18.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", + "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "packages/sdk-client-aca/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "packages/sdk-client-cwe": { + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } + }, + "packages/sdk-client-cwe/node_modules/@types/node": { + "version": "18.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", + "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "packages/sdk-client-cwe/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "packages/sdk-client-dcf": { "name": "@affinidi/test-sdk-client-dcf", "version": "1.0.0", - "extraneous": true, "license": "Unlicense", "dependencies": { "axios": "^1.6.0", @@ -14826,10 +14900,32 @@ "typescript": "^4.0" } }, + "packages/sdk-client-dcf/node_modules/@types/node": { + "version": "18.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", + "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "packages/sdk-client-dcf/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "packages/sdk-client-iam": { "name": "@affinidi/test-sdk-client-iam", - "version": "1.3.0", - "license": "Unlicense", + "version": "1.0.0", + "license": "Apache-2.0", "dependencies": { "axios": "^1.6.0", "url": "^0.11.3" @@ -14863,8 +14959,8 @@ }, "packages/sdk-client-kms": { "name": "@affinidi/test-sdk-client-kms", - "version": "1.3.0", - "license": "Unlicense", + "version": "1.0.0", + "license": "Apache-2.0", "dependencies": { "axios": "^1.6.0", "url": "^0.11.3" @@ -14899,7 +14995,6 @@ "packages/sdk-client-kyc": { "name": "@affinidi/test-sdk-client-kyc", "version": "1.0.0", - "extraneous": true, "license": "Unlicense", "dependencies": { "axios": "^1.6.1" @@ -14908,6 +15003,59 @@ "@types/node": "^12.11.5", "typescript": "^4.0" } + }, + "packages/sdk-client-kyc/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "dev": true + }, + "packages/sdk-client-kyc/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "packages/sdk-client-vpa": { + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } + }, + "packages/sdk-client-vpa/node_modules/@types/node": { + "version": "18.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.15.tgz", + "integrity": "sha512-AMZ2UWx+woHNfM11PyAEQmfSxi05jm9OlkxczuHeEqmvwPkYj6MWv44gbzDPefYOLysTOFyI3ziiy2ONmUZfpA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "packages/sdk-client-vpa/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } } } } diff --git a/packages/sdk-client-aca/.gitignore b/packages/sdk-client-aca/.gitignore new file mode 100644 index 00000000..eb42e83e --- /dev/null +++ b/packages/sdk-client-aca/.gitignore @@ -0,0 +1,37 @@ +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings +wwwroot/*.js +dist + +# System Files +.DS_Store +Thumbs.db + +# other +.env +.env.production +.npmrc +.nyc_output +coverage diff --git a/packages/sdk-client-aca/.npmignore b/packages/sdk-client-aca/.npmignore new file mode 100644 index 00000000..40886a38 --- /dev/null +++ b/packages/sdk-client-aca/.npmignore @@ -0,0 +1,10 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm + +node_modules +coverage +.vscode +.DS_Store +.nyc_output +.history +.idea +Thumbs.db diff --git a/packages/sdk-client-aca/.openapi-generator-ignore b/packages/sdk-client-aca/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/packages/sdk-client-aca/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/packages/sdk-client-aca/.openapi-generator/FILES b/packages/sdk-client-aca/.openapi-generator/FILES new file mode 100644 index 00000000..909a3223 --- /dev/null +++ b/packages/sdk-client-aca/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +.npmignore +.openapi-generator-ignore +README.md +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +package.json +project.json +tsconfig.esm.json +tsconfig.json diff --git a/packages/sdk-client-aca/.openapi-generator/VERSION b/packages/sdk-client-aca/.openapi-generator/VERSION new file mode 100644 index 00000000..4b49d9bb --- /dev/null +++ b/packages/sdk-client-aca/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/packages/sdk-client-aca/README.md b/packages/sdk-client-aca/README.md new file mode 100644 index 00000000..39abf5f7 --- /dev/null +++ b/packages/sdk-client-aca/README.md @@ -0,0 +1,53 @@ +## @affinidi/test-sdk-client-aca + +### Usage + +```bash +npm install @affinidi/test-sdk-client-aca --save +``` + +#### With PAT + +To call service methods with personal access token, you need to get a getProjectScopedToken for the machine user: + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-aca'; +import { authProvider } from '@affinidi/test-auth-provider'; + +const projectScopedToken = await authProvider.getProjectScopedToken({ + apiGatewayUrl, + projectId, + machineUserId, + tokenEndpoint, + privateKey, + passphrase, + keyId, + publicKey, +}); + +const api = new SomeClassApi( + new Configuration({ + apiKey: projectScopedToken, + basePath: `${apiGatewayUrl}/aca`, + }) +); + +await api.oneOfMethods(); +``` + +#### With session ID via BFF + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-aca'; +import { getBffHeaders } from '@affinidi/test-auth-provider'; + +const headers = getBffHeaders(cookieName, sessionId); + +const baseOptions = { headers }; + +const api = new SomeClassApi( + new Configuration({ basePath: `${bffHost}/aca`, baseOptions }) +); + +await api.oneOfMethods(); +``` diff --git a/packages/sdk-client-aca/api.ts b/packages/sdk-client-aca/api.ts new file mode 100644 index 00000000..572e1a2f --- /dev/null +++ b/packages/sdk-client-aca/api.ts @@ -0,0 +1,334 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AivCloudApi + * Affinidi AivCloudApi Structure + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from './base'; + +/** + * missing data that could not be found in the vault + * @export + * @interface CredentialsDto + */ +export interface CredentialsDto { + /** + * signed VCs + * @type {object} + * @memberof CredentialsDto + */ + signedCredential?: object; +} +/** + * the object conatins the presentation definition + * @export + * @interface DataRequest + */ +export interface DataRequest { + /** + * the presentation definition + * @type {object} + * @memberof DataRequest + */ + presentationDefinition: object; +} +/** + * the response body + * @export + * @interface DataResponse + */ +export interface DataResponse { + /** + * list of schemas which are missing to complete request + * @type {Array} + * @memberof DataResponse + */ + missingDataSchemas: Array; + /** + * list of VCs that are found + * @type {Array} + * @memberof DataResponse + */ + credentials: Array; +} +/** + * The name of $.path that is missing from the vault + * @export + * @interface MissingDataSchemasDto + */ +export interface MissingDataSchemasDto { + /** + * the name of missing schema in vault + * @type {object} + * @memberof MissingDataSchemasDto + */ + schemaList?: object; +} +/** + * Error message when something goes wrong + * @export + * @interface ServiceErrorResponse + */ +export interface ServiceErrorResponse { + /** + * unique id for correlating this specific error to logs + * @type {string} + * @memberof ServiceErrorResponse + */ + debugId: string; + /** + * name of the error + * @type {string} + * @memberof ServiceErrorResponse + */ + name: string; + /** + * backwards compatible Affinidi error code + * @type {string} + * @memberof ServiceErrorResponse + */ + code: string; + /** + * details of error + * @type {Array} + * @memberof ServiceErrorResponse + */ + details?: Array; +} +/** + * + * @export + * @interface ServiceErrorResponseDetailsInner + */ +export interface ServiceErrorResponseDetailsInner { + /** + * what went wrong + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + issue: string; + /** + * the fields that caused the error + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + field?: string; + /** + * expected values of the errored field + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + value?: string; + /** + * location of error + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + location?: ServiceErrorResponseDetailsInnerLocationEnum; +} + +export const ServiceErrorResponseDetailsInnerLocationEnum = { + Body: 'BODY', + Path: 'PATH', + Query: 'QUERY', +} as const; + +export type ServiceErrorResponseDetailsInnerLocationEnum = + (typeof ServiceErrorResponseDetailsInnerLocationEnum)[keyof typeof ServiceErrorResponseDetailsInnerLocationEnum]; + +/** + * SignUserDataApi - axios parameter creator + * @export + */ +export const SignUserDataApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * get signed data based on PD + * @summary get signed data + * @param {DataRequest} dataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + dataRequest: async ( + dataRequest: DataRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataRequest' is not null or undefined + assertParamExists('dataRequest', 'dataRequest', dataRequest); + const localVarPath = `/v1/data-request`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * SignUserDataApi - functional programming interface + * @export + */ +export const SignUserDataApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + SignUserDataApiAxiosParamCreator(configuration); + return { + /** + * get signed data based on PD + * @summary get signed data + * @param {DataRequest} dataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async dataRequest( + dataRequest: DataRequest, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.dataRequest( + dataRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['SignUserDataApi.dataRequest']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * SignUserDataApi - factory interface + * @export + */ +export const SignUserDataApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = SignUserDataApiFp(configuration); + return { + /** + * get signed data based on PD + * @summary get signed data + * @param {DataRequest} dataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + dataRequest( + dataRequest: DataRequest, + options?: any + ): AxiosPromise { + return localVarFp + .dataRequest(dataRequest, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SignUserDataApi - object-oriented interface + * @export + * @class SignUserDataApi + * @extends {BaseAPI} + */ +export class SignUserDataApi extends BaseAPI { + /** + * get signed data based on PD + * @summary get signed data + * @param {DataRequest} dataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignUserDataApi + */ + public dataRequest( + dataRequest: DataRequest, + options?: RawAxiosRequestConfig + ) { + return SignUserDataApiFp(this.configuration) + .dataRequest(dataRequest, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/packages/sdk-client-aca/base.ts b/packages/sdk-client-aca/base.ts new file mode 100644 index 00000000..d7cf4622 --- /dev/null +++ b/packages/sdk-client-aca/base.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AivCloudApi + * Affinidi AivCloudApi Structure + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = '/api/v1'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = 'RequiredError'; + } +} + +interface ServerMap { + [key: string]: { + url: string; + description: string; + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {}; diff --git a/packages/sdk-client-aca/common.ts b/packages/sdk-client-aca/common.ts new file mode 100644 index 00000000..8c5f8ced --- /dev/null +++ b/packages/sdk-client-aca/common.ts @@ -0,0 +1,203 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AivCloudApi + * Affinidi AivCloudApi Structure + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { RequestArgs } from './base'; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from './base'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com'; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.` + ); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration +) { + if (configuration && (configuration.username || configuration.password)) { + object['auth'] = { + username: configuration.username, + password: configuration.password, + }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = '' +): void { + if (parameter == null) return; + if (typeof parameter === 'object') { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key) + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== '' ? '.' : ''}${currentKey}` + ) + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration +) { + const nonString = typeof value !== 'string'; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ''; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + + axiosArgs.url, + }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/packages/sdk-client-aca/configuration.ts b/packages/sdk-client-aca/configuration.ts new file mode 100644 index 00000000..d68ab1d6 --- /dev/null +++ b/packages/sdk-client-aca/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AivCloudApi + * Affinidi AivCloudApi Structure + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i' + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } +} diff --git a/packages/sdk-client-aca/git_push.sh b/packages/sdk-client-aca/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/packages/sdk-client-aca/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/sdk-client-aca/index.ts b/packages/sdk-client-aca/index.ts new file mode 100644 index 00000000..e9c26387 --- /dev/null +++ b/packages/sdk-client-aca/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AivCloudApi + * Affinidi AivCloudApi Structure + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/packages/sdk-client-aca/package.json b/packages/sdk-client-aca/package.json new file mode 100644 index 00000000..6d631567 --- /dev/null +++ b/packages/sdk-client-aca/package.json @@ -0,0 +1,37 @@ +{ + "name": "@affinidi/test-sdk-client-aca", + "version": "1.0.0", + "description": "OpenAPI client for @affinidi/test-sdk-client-aca main", + "author": "Affinidi", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "affinidi-sdk", + "identity", + "holistic", + "network", + "openapi-client", + "openapi-generator", + "@affinidi/test-sdk-client-aca" + ], + "license": "Apache-2.0", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "eslint . --ext .ts", + "prepare": "npm run build" + }, + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } +} diff --git a/packages/sdk-client-aca/project.json b/packages/sdk-client-aca/project.json new file mode 100644 index 00000000..f8fbb52a --- /dev/null +++ b/packages/sdk-client-aca/project.json @@ -0,0 +1,41 @@ +{ + "name": "@affinidi/test-sdk-client-aca", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/client-iam", + "projectType": "library", + "private": false, + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/packages/test-sdk-client-aca", + "main": "packages/test-sdk-client-aca/index.ts", + "tsConfig": "packages/test-sdk-client-aca/tsconfig.lib.json", + "assets": ["packages/test-sdk-client-aca/*.md"] + } + }, + "lint": { + "executor": "@nx/eslint:lint" + }, + "semantic-release": { + "executor": "@theunderscorer/nx-semantic-release:semantic-release", + "options": { + "changelog": true, + "github": true, + "npm": true, + "repositoryUrl": "git@github.com:affinidi/sdk.git", + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/npm", + { + "npmPublish": true + } + ] + ] + } + } + }, + "tags": [] +} diff --git a/packages/sdk-client-aca/tsconfig.esm.json b/packages/sdk-client-aca/tsconfig.esm.json new file mode 100644 index 00000000..2c0331cc --- /dev/null +++ b/packages/sdk-client-aca/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/packages/sdk-client-aca/tsconfig.json b/packages/sdk-client-aca/tsconfig.json new file mode 100644 index 00000000..bab039be --- /dev/null +++ b/packages/sdk-client-aca/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "ES6", + "module": "commonjs", + "noImplicitAny": true, + "esModuleInterop": true, + "outDir": "dist", + "rootDir": ".", + "moduleResolution": "node" + }, + "exclude": ["dist", "node_modules"] +} diff --git a/packages/sdk-client-cwe/.gitignore b/packages/sdk-client-cwe/.gitignore new file mode 100644 index 00000000..eb42e83e --- /dev/null +++ b/packages/sdk-client-cwe/.gitignore @@ -0,0 +1,37 @@ +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings +wwwroot/*.js +dist + +# System Files +.DS_Store +Thumbs.db + +# other +.env +.env.production +.npmrc +.nyc_output +coverage diff --git a/packages/sdk-client-cwe/.npmignore b/packages/sdk-client-cwe/.npmignore new file mode 100644 index 00000000..40886a38 --- /dev/null +++ b/packages/sdk-client-cwe/.npmignore @@ -0,0 +1,10 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm + +node_modules +coverage +.vscode +.DS_Store +.nyc_output +.history +.idea +Thumbs.db diff --git a/packages/sdk-client-cwe/.openapi-generator-ignore b/packages/sdk-client-cwe/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/packages/sdk-client-cwe/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/packages/sdk-client-cwe/.openapi-generator/FILES b/packages/sdk-client-cwe/.openapi-generator/FILES new file mode 100644 index 00000000..909a3223 --- /dev/null +++ b/packages/sdk-client-cwe/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +.npmignore +.openapi-generator-ignore +README.md +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +package.json +project.json +tsconfig.esm.json +tsconfig.json diff --git a/packages/sdk-client-cwe/.openapi-generator/VERSION b/packages/sdk-client-cwe/.openapi-generator/VERSION new file mode 100644 index 00000000..4b49d9bb --- /dev/null +++ b/packages/sdk-client-cwe/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/packages/sdk-client-cwe/README.md b/packages/sdk-client-cwe/README.md new file mode 100644 index 00000000..ef7c09da --- /dev/null +++ b/packages/sdk-client-cwe/README.md @@ -0,0 +1,53 @@ +## @affinidi/test-sdk-client-cwe + +### Usage + +```bash +npm install @affinidi/test-sdk-client-cwe --save +``` + +#### With PAT + +To call service methods with personal access token, you need to get a getProjectScopedToken for the machine user: + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-cwe'; +import { authProvider } from '@affinidi/test-auth-provider'; + +const projectScopedToken = await authProvider.getProjectScopedToken({ + apiGatewayUrl, + projectId, + machineUserId, + tokenEndpoint, + privateKey, + passphrase, + keyId, + publicKey, +}); + +const api = new SomeClassApi( + new Configuration({ + apiKey: projectScopedToken, + basePath: `${apiGatewayUrl}/cwe`, + }) +); + +await api.oneOfMethods(); +``` + +#### With session ID via BFF + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-cwe'; +import { getBffHeaders } from '@affinidi/test-auth-provider'; + +const headers = getBffHeaders(cookieName, sessionId); + +const baseOptions = { headers }; + +const api = new SomeClassApi( + new Configuration({ basePath: `${bffHost}/cwe`, baseOptions }) +); + +await api.oneOfMethods(); +``` diff --git a/packages/sdk-client-cwe/api.ts b/packages/sdk-client-cwe/api.ts new file mode 100644 index 00000000..6e6448f7 --- /dev/null +++ b/packages/sdk-client-cwe/api.ts @@ -0,0 +1,1525 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * CloudWalletEssentials + * Cloud Wallet For Enterprise Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from './base'; + +/** + * wallet dto + * @export + * @interface CreateWalletResponse + */ +export interface CreateWalletResponse { + /** + * + * @type {WalletDto} + * @memberof CreateWalletResponse + */ + wallet?: WalletDto; +} +/** + * + * @export + * @interface EntityNotFoundError + */ +export interface EntityNotFoundError { + /** + * + * @type {string} + * @memberof EntityNotFoundError + */ + name: EntityNotFoundErrorNameEnum; + /** + * + * @type {string} + * @memberof EntityNotFoundError + */ + message: EntityNotFoundErrorMessageEnum; + /** + * + * @type {number} + * @memberof EntityNotFoundError + */ + httpStatusCode: EntityNotFoundErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof EntityNotFoundError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof EntityNotFoundError + */ + details?: Array; +} + +export const EntityNotFoundErrorNameEnum = { + EntityNotFoundError: 'EntityNotFoundError', +} as const; + +export type EntityNotFoundErrorNameEnum = + (typeof EntityNotFoundErrorNameEnum)[keyof typeof EntityNotFoundErrorNameEnum]; +export const EntityNotFoundErrorMessageEnum = { + EntityNotFound: 'Entity not found', +} as const; + +export type EntityNotFoundErrorMessageEnum = + (typeof EntityNotFoundErrorMessageEnum)[keyof typeof EntityNotFoundErrorMessageEnum]; +export const EntityNotFoundErrorHttpStatusCodeEnum = { + NUMBER_404: 404, +} as const; + +export type EntityNotFoundErrorHttpStatusCodeEnum = + (typeof EntityNotFoundErrorHttpStatusCodeEnum)[keyof typeof EntityNotFoundErrorHttpStatusCodeEnum]; + +/** + * DTO contains revocation list credential + * @export + * @interface GetRevocationListCredentialResultDto + */ +export interface GetRevocationListCredentialResultDto { + /** + * + * @type {object} + * @memberof GetRevocationListCredentialResultDto + */ + revocationListCredential: object; +} +/** + * + * @export + * @interface InvalidDidParameterError + */ +export interface InvalidDidParameterError { + /** + * + * @type {string} + * @memberof InvalidDidParameterError + */ + name: InvalidDidParameterErrorNameEnum; + /** + * + * @type {string} + * @memberof InvalidDidParameterError + */ + message: InvalidDidParameterErrorMessageEnum; + /** + * + * @type {number} + * @memberof InvalidDidParameterError + */ + httpStatusCode: InvalidDidParameterErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof InvalidDidParameterError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof InvalidDidParameterError + */ + details?: Array; +} + +export const InvalidDidParameterErrorNameEnum = { + InvalidDidParameterError: 'InvalidDidParameterError', +} as const; + +export type InvalidDidParameterErrorNameEnum = + (typeof InvalidDidParameterErrorNameEnum)[keyof typeof InvalidDidParameterErrorNameEnum]; +export const InvalidDidParameterErrorMessageEnum = { + GivenDidInFieldToDidIsInvalidUseOnlyResolvableFormOfDid: + 'Given did in field "toDid" is invalid. Use only resolvable form of did.', +} as const; + +export type InvalidDidParameterErrorMessageEnum = + (typeof InvalidDidParameterErrorMessageEnum)[keyof typeof InvalidDidParameterErrorMessageEnum]; +export const InvalidDidParameterErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type InvalidDidParameterErrorHttpStatusCodeEnum = + (typeof InvalidDidParameterErrorHttpStatusCodeEnum)[keyof typeof InvalidDidParameterErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface InvalidParameterError + */ +export interface InvalidParameterError { + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + name: InvalidParameterErrorNameEnum; + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + message: InvalidParameterErrorMessageEnum; + /** + * + * @type {number} + * @memberof InvalidParameterError + */ + httpStatusCode: InvalidParameterErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof InvalidParameterError + */ + details?: Array; +} + +export const InvalidParameterErrorNameEnum = { + InvalidParameterError: 'InvalidParameterError', +} as const; + +export type InvalidParameterErrorNameEnum = + (typeof InvalidParameterErrorNameEnum)[keyof typeof InvalidParameterErrorNameEnum]; +export const InvalidParameterErrorMessageEnum = { + InvalidParameterParam: 'Invalid parameter: ${param}.', +} as const; + +export type InvalidParameterErrorMessageEnum = + (typeof InvalidParameterErrorMessageEnum)[keyof typeof InvalidParameterErrorMessageEnum]; +export const InvalidParameterErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type InvalidParameterErrorHttpStatusCodeEnum = + (typeof InvalidParameterErrorHttpStatusCodeEnum)[keyof typeof InvalidParameterErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface KeyNotFoundError + */ +export interface KeyNotFoundError { + /** + * + * @type {string} + * @memberof KeyNotFoundError + */ + name: KeyNotFoundErrorNameEnum; + /** + * + * @type {string} + * @memberof KeyNotFoundError + */ + message: KeyNotFoundErrorMessageEnum; + /** + * + * @type {number} + * @memberof KeyNotFoundError + */ + httpStatusCode: KeyNotFoundErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof KeyNotFoundError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof KeyNotFoundError + */ + details?: Array; +} + +export const KeyNotFoundErrorNameEnum = { + KeyNotFoundError: 'KeyNotFoundError', +} as const; + +export type KeyNotFoundErrorNameEnum = + (typeof KeyNotFoundErrorNameEnum)[keyof typeof KeyNotFoundErrorNameEnum]; +export const KeyNotFoundErrorMessageEnum = { + KeyNotFound: 'Key not found', +} as const; + +export type KeyNotFoundErrorMessageEnum = + (typeof KeyNotFoundErrorMessageEnum)[keyof typeof KeyNotFoundErrorMessageEnum]; +export const KeyNotFoundErrorHttpStatusCodeEnum = { + NUMBER_500: 500, +} as const; + +export type KeyNotFoundErrorHttpStatusCodeEnum = + (typeof KeyNotFoundErrorHttpStatusCodeEnum)[keyof typeof KeyNotFoundErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface NotFoundError + */ +export interface NotFoundError { + /** + * + * @type {string} + * @memberof NotFoundError + */ + name: NotFoundErrorNameEnum; + /** + * + * @type {string} + * @memberof NotFoundError + */ + message: NotFoundErrorMessageEnum; + /** + * + * @type {number} + * @memberof NotFoundError + */ + httpStatusCode: NotFoundErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof NotFoundError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof NotFoundError + */ + details?: Array; +} + +export const NotFoundErrorNameEnum = { + NotFoundError: 'NotFoundError', +} as const; + +export type NotFoundErrorNameEnum = + (typeof NotFoundErrorNameEnum)[keyof typeof NotFoundErrorNameEnum]; +export const NotFoundErrorMessageEnum = { + NotFoundParam: 'Not found: ${param}.', +} as const; + +export type NotFoundErrorMessageEnum = + (typeof NotFoundErrorMessageEnum)[keyof typeof NotFoundErrorMessageEnum]; +export const NotFoundErrorHttpStatusCodeEnum = { + NUMBER_404: 404, +} as const; + +export type NotFoundErrorHttpStatusCodeEnum = + (typeof NotFoundErrorHttpStatusCodeEnum)[keyof typeof NotFoundErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface OperationForbiddenError + */ +export interface OperationForbiddenError { + /** + * + * @type {string} + * @memberof OperationForbiddenError + */ + name: OperationForbiddenErrorNameEnum; + /** + * + * @type {string} + * @memberof OperationForbiddenError + */ + message: OperationForbiddenErrorMessageEnum; + /** + * + * @type {number} + * @memberof OperationForbiddenError + */ + httpStatusCode: OperationForbiddenErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof OperationForbiddenError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof OperationForbiddenError + */ + details?: Array; +} + +export const OperationForbiddenErrorNameEnum = { + OperationForbiddenError: 'OperationForbiddenError', +} as const; + +export type OperationForbiddenErrorNameEnum = + (typeof OperationForbiddenErrorNameEnum)[keyof typeof OperationForbiddenErrorNameEnum]; +export const OperationForbiddenErrorMessageEnum = { + OperationForbiddenParam: 'Operation forbidden: ${param}.', +} as const; + +export type OperationForbiddenErrorMessageEnum = + (typeof OperationForbiddenErrorMessageEnum)[keyof typeof OperationForbiddenErrorMessageEnum]; +export const OperationForbiddenErrorHttpStatusCodeEnum = { + NUMBER_403: 403, +} as const; + +export type OperationForbiddenErrorHttpStatusCodeEnum = + (typeof OperationForbiddenErrorHttpStatusCodeEnum)[keyof typeof OperationForbiddenErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface RevokeCredentialInput + */ +export interface RevokeCredentialInput { + /** + * + * @type {string} + * @memberof RevokeCredentialInput + */ + revocationReason?: string | null; + /** + * + * @type {string} + * @memberof RevokeCredentialInput + */ + credentialId?: string; +} +/** + * + * @export + * @interface ServiceErrorResponse + */ +export interface ServiceErrorResponse { + /** + * unique id for correlating this specific error to logs + * @type {string} + * @memberof ServiceErrorResponse + */ + debugId: string; + /** + * name of the error + * @type {string} + * @memberof ServiceErrorResponse + */ + name: string; + /** + * backwards compatible Affinidi error code + * @type {string} + * @memberof ServiceErrorResponse + */ + code: string; + /** + * + * @type {Array} + * @memberof ServiceErrorResponse + */ + details?: Array; +} +/** + * + * @export + * @interface ServiceErrorResponseDetailsInner + */ +export interface ServiceErrorResponseDetailsInner { + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + issue: string; + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + field?: string; + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + value?: string; + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + location?: string; +} +/** + * DTO contains params to sign credential + * @export + * @interface SignCredentialInputDto + */ +export interface SignCredentialInputDto { + /** + * + * @type {object} + * @memberof SignCredentialInputDto + */ + unsignedCredential: object; + /** + * + * @type {boolean} + * @memberof SignCredentialInputDto + */ + revocable?: boolean; +} +/** + * DTO contains signed credential + * @export + * @interface SignCredentialResultDto + */ +export interface SignCredentialResultDto { + /** + * + * @type {object} + * @memberof SignCredentialResultDto + */ + signedCredential: object; +} +/** + * wallet dto + * @export + * @interface WalletDto + */ +export interface WalletDto { + /** + * id of the wallet in uuidV4 format + * @type {string} + * @memberof WalletDto + */ + id?: string; + /** + * did of the wallet + * @type {string} + * @memberof WalletDto + */ + did?: string; + /** + * ARI of the wallet + * @type {string} + * @memberof WalletDto + */ + ari?: string; + /** + * + * @type {Array} + * @memberof WalletDto + */ + keys?: Array; +} +/** + * + * @export + * @interface WalletDtoKeysInner + */ +export interface WalletDtoKeysInner { + /** + * id of linked key + * @type {string} + * @memberof WalletDtoKeysInner + */ + id?: string; + /** + * ari of linked key + * @type {string} + * @memberof WalletDtoKeysInner + */ + ari?: string; +} +/** + * list of wallets + * @export + * @interface WalletsListDto + */ +export interface WalletsListDto { + /** + * + * @type {Array} + * @memberof WalletsListDto + */ + wallets?: Array; +} + +/** + * DefaultApi - axios parameter creator + * @export + */ +export const DefaultApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * delete wallet by walletId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteWallet: async ( + walletId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'walletId' is not null or undefined + assertParamExists('deleteWallet', 'walletId', walletId); + const localVarPath = `/v1/wallets/{walletId}`.replace( + `{${'walletId'}}`, + encodeURIComponent(String(walletId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * DefaultApi - functional programming interface + * @export + */ +export const DefaultApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration); + return { + /** + * delete wallet by walletId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteWallet( + walletId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWallet( + walletId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DefaultApi.deleteWallet']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * DefaultApi - factory interface + * @export + */ +export const DefaultApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = DefaultApiFp(configuration); + return { + /** + * delete wallet by walletId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteWallet(walletId: string, options?: any): AxiosPromise { + return localVarFp + .deleteWallet(walletId, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DefaultApi - object-oriented interface + * @export + * @class DefaultApi + * @extends {BaseAPI} + */ +export class DefaultApi extends BaseAPI { + /** + * delete wallet by walletId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public deleteWallet(walletId: string, options?: RawAxiosRequestConfig) { + return DefaultApiFp(this.configuration) + .deleteWallet(walletId, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * RevocationApi - axios parameter creator + * @export + */ +export const RevocationApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Get revocation list 2020 Credential (required to check if VC revoked). + * @summary Return revocation list credential. + * @param {string} listId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevocationListCredential: async ( + listId: string, + walletId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'listId' is not null or undefined + assertParamExists('getRevocationListCredential', 'listId', listId); + // verify required parameter 'walletId' is not null or undefined + assertParamExists('getRevocationListCredential', 'walletId', walletId); + const localVarPath = `/v1/wallets/{walletId}/revocation-list/{listId}` + .replace(`{${'listId'}}`, encodeURIComponent(String(listId))) + .replace(`{${'walletId'}}`, encodeURIComponent(String(walletId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update index/credetial at appropriate revocation list (set revoken is true). + * @summary Revoke Credential. + * @param {string} walletId id of the wallet + * @param {RevokeCredentialInput} revokeCredentialInput RevokeCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + revokeCredential: async ( + walletId: string, + revokeCredentialInput: RevokeCredentialInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'walletId' is not null or undefined + assertParamExists('revokeCredential', 'walletId', walletId); + // verify required parameter 'revokeCredentialInput' is not null or undefined + assertParamExists( + 'revokeCredential', + 'revokeCredentialInput', + revokeCredentialInput + ); + const localVarPath = `/v1/wallets/{walletId}/revoke`.replace( + `{${'walletId'}}`, + encodeURIComponent(String(walletId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + revokeCredentialInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * RevocationApi - functional programming interface + * @export + */ +export const RevocationApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + RevocationApiAxiosParamCreator(configuration); + return { + /** + * Get revocation list 2020 Credential (required to check if VC revoked). + * @summary Return revocation list credential. + * @param {string} listId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRevocationListCredential( + listId: string, + walletId: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getRevocationListCredential( + listId, + walletId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['RevocationApi.getRevocationListCredential']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Update index/credetial at appropriate revocation list (set revoken is true). + * @summary Revoke Credential. + * @param {string} walletId id of the wallet + * @param {RevokeCredentialInput} revokeCredentialInput RevokeCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async revokeCredential( + walletId: string, + revokeCredentialInput: RevokeCredentialInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.revokeCredential( + walletId, + revokeCredentialInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['RevocationApi.revokeCredential']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * RevocationApi - factory interface + * @export + */ +export const RevocationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = RevocationApiFp(configuration); + return { + /** + * Get revocation list 2020 Credential (required to check if VC revoked). + * @summary Return revocation list credential. + * @param {string} listId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRevocationListCredential( + listId: string, + walletId: string, + options?: any + ): AxiosPromise { + return localVarFp + .getRevocationListCredential(listId, walletId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Update index/credetial at appropriate revocation list (set revoken is true). + * @summary Revoke Credential. + * @param {string} walletId id of the wallet + * @param {RevokeCredentialInput} revokeCredentialInput RevokeCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + revokeCredential( + walletId: string, + revokeCredentialInput: RevokeCredentialInput, + options?: any + ): AxiosPromise { + return localVarFp + .revokeCredential(walletId, revokeCredentialInput, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * RevocationApi - object-oriented interface + * @export + * @class RevocationApi + * @extends {BaseAPI} + */ +export class RevocationApi extends BaseAPI { + /** + * Get revocation list 2020 Credential (required to check if VC revoked). + * @summary Return revocation list credential. + * @param {string} listId + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RevocationApi + */ + public getRevocationListCredential( + listId: string, + walletId: string, + options?: RawAxiosRequestConfig + ) { + return RevocationApiFp(this.configuration) + .getRevocationListCredential(listId, walletId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update index/credetial at appropriate revocation list (set revoken is true). + * @summary Revoke Credential. + * @param {string} walletId id of the wallet + * @param {RevokeCredentialInput} revokeCredentialInput RevokeCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RevocationApi + */ + public revokeCredential( + walletId: string, + revokeCredentialInput: RevokeCredentialInput, + options?: RawAxiosRequestConfig + ) { + return RevocationApiFp(this.configuration) + .revokeCredential(walletId, revokeCredentialInput, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * WalletApi - axios parameter creator + * @export + */ +export const WalletApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * creates a wallet + * @param {object} [body] CreateWallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createWallet: async ( + body?: object, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/wallets`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * get wallet details using wallet Id. + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getWallet: async ( + walletId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'walletId' is not null or undefined + assertParamExists('getWallet', 'walletId', walletId); + const localVarPath = `/v1/wallets/{walletId}`.replace( + `{${'walletId'}}`, + encodeURIComponent(String(walletId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * lists all wallets + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listWallets: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/wallets`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * signs credential with the wallet + * @param {string} walletId id of the wallet + * @param {SignCredentialInputDto} signCredentialInputDto SignCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signCredential: async ( + walletId: string, + signCredentialInputDto: SignCredentialInputDto, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'walletId' is not null or undefined + assertParamExists('signCredential', 'walletId', walletId); + // verify required parameter 'signCredentialInputDto' is not null or undefined + assertParamExists( + 'signCredential', + 'signCredentialInputDto', + signCredentialInputDto + ); + const localVarPath = `/v1/wallets/{walletId}/sign-credential`.replace( + `{${'walletId'}}`, + encodeURIComponent(String(walletId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + signCredentialInputDto, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * WalletApi - functional programming interface + * @export + */ +export const WalletApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = WalletApiAxiosParamCreator(configuration); + return { + /** + * creates a wallet + * @param {object} [body] CreateWallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createWallet( + body?: object, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.createWallet( + body, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['WalletApi.createWallet']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * get wallet details using wallet Id. + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getWallet( + walletId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.getWallet( + walletId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['WalletApi.getWallet']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * lists all wallets + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listWallets( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.listWallets( + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['WalletApi.listWallets']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * signs credential with the wallet + * @param {string} walletId id of the wallet + * @param {SignCredentialInputDto} signCredentialInputDto SignCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async signCredential( + walletId: string, + signCredentialInputDto: SignCredentialInputDto, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.signCredential( + walletId, + signCredentialInputDto, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['WalletApi.signCredential']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * WalletApi - factory interface + * @export + */ +export const WalletApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = WalletApiFp(configuration); + return { + /** + * creates a wallet + * @param {object} [body] CreateWallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createWallet( + body?: object, + options?: any + ): AxiosPromise { + return localVarFp + .createWallet(body, options) + .then((request) => request(axios, basePath)); + }, + /** + * get wallet details using wallet Id. + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getWallet(walletId: string, options?: any): AxiosPromise { + return localVarFp + .getWallet(walletId, options) + .then((request) => request(axios, basePath)); + }, + /** + * lists all wallets + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listWallets(options?: any): AxiosPromise { + return localVarFp + .listWallets(options) + .then((request) => request(axios, basePath)); + }, + /** + * signs credential with the wallet + * @param {string} walletId id of the wallet + * @param {SignCredentialInputDto} signCredentialInputDto SignCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signCredential( + walletId: string, + signCredentialInputDto: SignCredentialInputDto, + options?: any + ): AxiosPromise { + return localVarFp + .signCredential(walletId, signCredentialInputDto, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * WalletApi - object-oriented interface + * @export + * @class WalletApi + * @extends {BaseAPI} + */ +export class WalletApi extends BaseAPI { + /** + * creates a wallet + * @param {object} [body] CreateWallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WalletApi + */ + public createWallet(body?: object, options?: RawAxiosRequestConfig) { + return WalletApiFp(this.configuration) + .createWallet(body, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * get wallet details using wallet Id. + * @param {string} walletId id of the wallet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WalletApi + */ + public getWallet(walletId: string, options?: RawAxiosRequestConfig) { + return WalletApiFp(this.configuration) + .getWallet(walletId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * lists all wallets + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WalletApi + */ + public listWallets(options?: RawAxiosRequestConfig) { + return WalletApiFp(this.configuration) + .listWallets(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * signs credential with the wallet + * @param {string} walletId id of the wallet + * @param {SignCredentialInputDto} signCredentialInputDto SignCredential + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WalletApi + */ + public signCredential( + walletId: string, + signCredentialInputDto: SignCredentialInputDto, + options?: RawAxiosRequestConfig + ) { + return WalletApiFp(this.configuration) + .signCredential(walletId, signCredentialInputDto, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/packages/sdk-client-cwe/base.ts b/packages/sdk-client-cwe/base.ts new file mode 100644 index 00000000..c0c1f7dd --- /dev/null +++ b/packages/sdk-client-cwe/base.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * CloudWalletEssentials + * Cloud Wallet For Enterprise Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = 'RequiredError'; + } +} + +interface ServerMap { + [key: string]: { + url: string; + description: string; + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {}; diff --git a/packages/sdk-client-cwe/common.ts b/packages/sdk-client-cwe/common.ts new file mode 100644 index 00000000..1f48c597 --- /dev/null +++ b/packages/sdk-client-cwe/common.ts @@ -0,0 +1,203 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * CloudWalletEssentials + * Cloud Wallet For Enterprise Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { RequestArgs } from './base'; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from './base'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com'; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.` + ); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration +) { + if (configuration && (configuration.username || configuration.password)) { + object['auth'] = { + username: configuration.username, + password: configuration.password, + }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = '' +): void { + if (parameter == null) return; + if (typeof parameter === 'object') { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key) + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== '' ? '.' : ''}${currentKey}` + ) + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration +) { + const nonString = typeof value !== 'string'; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ''; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + + axiosArgs.url, + }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/packages/sdk-client-cwe/configuration.ts b/packages/sdk-client-cwe/configuration.ts new file mode 100644 index 00000000..349847c3 --- /dev/null +++ b/packages/sdk-client-cwe/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * CloudWalletEssentials + * Cloud Wallet For Enterprise Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i' + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } +} diff --git a/packages/sdk-client-cwe/git_push.sh b/packages/sdk-client-cwe/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/packages/sdk-client-cwe/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/sdk-client-cwe/index.ts b/packages/sdk-client-cwe/index.ts new file mode 100644 index 00000000..1d4f53c3 --- /dev/null +++ b/packages/sdk-client-cwe/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * CloudWalletEssentials + * Cloud Wallet For Enterprise Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/packages/sdk-client-cwe/package.json b/packages/sdk-client-cwe/package.json new file mode 100644 index 00000000..c1b0df70 --- /dev/null +++ b/packages/sdk-client-cwe/package.json @@ -0,0 +1,37 @@ +{ + "name": "@affinidi/test-sdk-client-cwe", + "version": "1.0.0", + "description": "OpenAPI client for @affinidi/test-sdk-client-cwe main", + "author": "Affinidi", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "affinidi-sdk", + "identity", + "holistic", + "network", + "openapi-client", + "openapi-generator", + "@affinidi/test-sdk-client-cwe" + ], + "license": "Apache-2.0", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "eslint . --ext .ts", + "prepare": "npm run build" + }, + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } +} diff --git a/packages/sdk-client-cwe/project.json b/packages/sdk-client-cwe/project.json new file mode 100644 index 00000000..5603aa16 --- /dev/null +++ b/packages/sdk-client-cwe/project.json @@ -0,0 +1,41 @@ +{ + "name": "@affinidi/test-sdk-client-cwe", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/client-iam", + "projectType": "library", + "private": false, + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/packages/test-sdk-client-cwe", + "main": "packages/test-sdk-client-cwe/index.ts", + "tsConfig": "packages/test-sdk-client-cwe/tsconfig.lib.json", + "assets": ["packages/test-sdk-client-cwe/*.md"] + } + }, + "lint": { + "executor": "@nx/eslint:lint" + }, + "semantic-release": { + "executor": "@theunderscorer/nx-semantic-release:semantic-release", + "options": { + "changelog": true, + "github": true, + "npm": true, + "repositoryUrl": "git@github.com:affinidi/sdk.git", + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/npm", + { + "npmPublish": true + } + ] + ] + } + } + }, + "tags": [] +} diff --git a/packages/sdk-client-cwe/tsconfig.esm.json b/packages/sdk-client-cwe/tsconfig.esm.json new file mode 100644 index 00000000..2c0331cc --- /dev/null +++ b/packages/sdk-client-cwe/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/packages/sdk-client-cwe/tsconfig.json b/packages/sdk-client-cwe/tsconfig.json new file mode 100644 index 00000000..bab039be --- /dev/null +++ b/packages/sdk-client-cwe/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "ES6", + "module": "commonjs", + "noImplicitAny": true, + "esModuleInterop": true, + "outDir": "dist", + "rootDir": ".", + "moduleResolution": "node" + }, + "exclude": ["dist", "node_modules"] +} diff --git a/packages/sdk-client-dcf/.gitignore b/packages/sdk-client-dcf/.gitignore new file mode 100644 index 00000000..eb42e83e --- /dev/null +++ b/packages/sdk-client-dcf/.gitignore @@ -0,0 +1,37 @@ +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings +wwwroot/*.js +dist + +# System Files +.DS_Store +Thumbs.db + +# other +.env +.env.production +.npmrc +.nyc_output +coverage diff --git a/packages/sdk-client-dcf/.npmignore b/packages/sdk-client-dcf/.npmignore new file mode 100644 index 00000000..40886a38 --- /dev/null +++ b/packages/sdk-client-dcf/.npmignore @@ -0,0 +1,10 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm + +node_modules +coverage +.vscode +.DS_Store +.nyc_output +.history +.idea +Thumbs.db diff --git a/packages/sdk-client-dcf/.openapi-generator-ignore b/packages/sdk-client-dcf/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/packages/sdk-client-dcf/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/packages/sdk-client-dcf/.openapi-generator/FILES b/packages/sdk-client-dcf/.openapi-generator/FILES new file mode 100644 index 00000000..909a3223 --- /dev/null +++ b/packages/sdk-client-dcf/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +.npmignore +.openapi-generator-ignore +README.md +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +package.json +project.json +tsconfig.esm.json +tsconfig.json diff --git a/packages/sdk-client-dcf/.openapi-generator/VERSION b/packages/sdk-client-dcf/.openapi-generator/VERSION new file mode 100644 index 00000000..4b49d9bb --- /dev/null +++ b/packages/sdk-client-dcf/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/packages/sdk-client-dcf/README.md b/packages/sdk-client-dcf/README.md new file mode 100644 index 00000000..cdd701da --- /dev/null +++ b/packages/sdk-client-dcf/README.md @@ -0,0 +1,53 @@ +## @affinidi/test-sdk-client-dcf + +### Usage + +```bash +npm install @affinidi/test-sdk-client-dcf --save +``` + +#### With PAT + +To call service methods with personal access token, you need to get a getProjectScopedToken for the machine user: + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-dcf'; +import { authProvider } from '@affinidi/test-auth-provider'; + +const projectScopedToken = await authProvider.getProjectScopedToken({ + apiGatewayUrl, + projectId, + machineUserId, + tokenEndpoint, + privateKey, + passphrase, + keyId, + publicKey, +}); + +const api = new SomeClassApi( + new Configuration({ + apiKey: projectScopedToken, + basePath: `${apiGatewayUrl}/dcf`, + }) +); + +await api.oneOfMethods(); +``` + +#### With session ID via BFF + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-dcf'; +import { getBffHeaders } from '@affinidi/test-auth-provider'; + +const headers = getBffHeaders(cookieName, sessionId); + +const baseOptions = { headers }; + +const api = new SomeClassApi( + new Configuration({ basePath: `${bffHost}/dcf`, baseOptions }) +); + +await api.oneOfMethods(); +``` diff --git a/packages/sdk-client-dcf/api.ts b/packages/sdk-client-dcf/api.ts new file mode 100644 index 00000000..75f8c24f --- /dev/null +++ b/packages/sdk-client-dcf/api.ts @@ -0,0 +1,6855 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * DcfOrchestrator + * # Affinidi Data Connector Framework (DCF) Affinidi DCF is a developer/contributor-focused suite of tools that enables contributors to configure, create, validate and manage data connectors for public consumption. This involves configuring connections to a third party data source and configuring transformation mapping from the data source to a target, “canonical” schema. After setup, DCF validates the configuration of the data connectors and transformation mapping. Following successful validation, created connectors are published. The Affinidi DCF Orchestrator API covers every step of the data ingestion process, enabling builders to onboard new third-party services as connectors, create authenticated user connections, and pull data to be streamed to Affinidi Vault. It provides a standardized approach to interact with REST APIs, which is also configuration-driven, allowing builders to easily customise the connector\'s behaviour by modifying configuration files. The DCF Orchestrator API is organised around three main concepts: Data Source & Configuration, Connector, and User Connection. Below you will find a brief explanation of these and other useful terms: *Data Source & Configuration* Data Sources represent the third-party service API in our framework. They consist of two entities: the details on how to authenticate with the third-party service are mapped to DataSourceConfig, while the service’s endpoints and data transformation templates are mapped to DataSource . Builders can list available DataSourceConfigs and DataSources, create new ones and modify them using our API. *Connector* This is the building block of our framework. It brings together a Data Source and its Configuration with the builder credentials necessary for connections to be made, for example client ID or client secret. Our endpoints allow builders to list available Connectors, create new ones and modify them. *User Connection* A user connection is created each time an end user authenticates with a data source via DCF. It holds user specific information relative to a connector and application, including credentials. Our API enables builders to list, create and delete available Connections as well as to execute them to pull data. *Templates* Builder-defined configuration objects that describe how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: robert.k@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from './base'; + +/** + * Object describing the information about an active connection. + * @export + * @interface ActiveConnectionsDto + */ +export interface ActiveConnectionsDto { + /** + * The ID of the data connector. + * @type {string} + * @memberof ActiveConnectionsDto + */ + connectorId?: string; + /** + * The ID of the data connection. + * @type {string} + * @memberof ActiveConnectionsDto + */ + connectionId?: string; + /** + * The name of the data connector. + * @type {string} + * @memberof ActiveConnectionsDto + */ + connectorName?: string; + /** + * The date and time at which the connection has been created. + * @type {string} + * @memberof ActiveConnectionsDto + */ + createdAt?: string; + /** + * The date and time at which the connection has been updated. + * @type {string} + * @memberof ActiveConnectionsDto + */ + activatedAt?: string; +} +/** + * Response payload after requesting a list of active connections. + * @export + * @interface ActiveConnectionsResponse + */ +export interface ActiveConnectionsResponse { + /** + * A list of active connections. + * @type {Array} + * @memberof ActiveConnectionsResponse + */ + connections: Array; +} +/** + * An object containing the name and id of a given data source. + * @export + * @interface AuthConfig + */ +export interface AuthConfig { + /** + * The ID of the data source. + * @type {string} + * @memberof AuthConfig + */ + id: string; + /** + * The name of the data source configuration. + * @type {string} + * @memberof AuthConfig + */ + dataSourceConfigName: string; +} +/** + * Object describing the information needed for a valid authentication configuration. + * @export + * @interface AuthConfigDto + */ +export interface AuthConfigDto { + /** + * The ID of the data source. + * @type {string} + * @memberof AuthConfigDto + */ + id?: string; + /** + * The name of the data source configuration connected to this authentication configuration. + * @type {string} + * @memberof AuthConfigDto + */ + dataSourceConfigName?: string; + /** + * The status of the data source config. + * @type {string} + * @memberof AuthConfigDto + */ + status?: AuthConfigDtoStatusEnum; + /** + * + * @type {AuthConfigInfoDto} + * @memberof AuthConfigDto + */ + authConfigInfo?: AuthConfigInfoDto; +} + +export const AuthConfigDtoStatusEnum = { + Draft: 'DRAFT', + Active: 'ACTIVE', +} as const; + +export type AuthConfigDtoStatusEnum = + (typeof AuthConfigDtoStatusEnum)[keyof typeof AuthConfigDtoStatusEnum]; + +/** + * The information needed to onboard and use a data source. + * @export + * @interface AuthConfigInfoDto + */ +export interface AuthConfigInfoDto { + /** + * + * @type {AuthConfigInfoDtoAuthDetails} + * @memberof AuthConfigInfoDto + */ + authDetails: AuthConfigInfoDtoAuthDetails; + /** + * + * @type {AuthConfigInfoDtoExchangeTokenTemplate} + * @memberof AuthConfigInfoDto + */ + exchangeTokenTemplate: AuthConfigInfoDtoExchangeTokenTemplate; + /** + * + * @type {AuthConfigInfoDtoRefreshTokenTemplate} + * @memberof AuthConfigInfoDto + */ + refreshTokenTemplate?: AuthConfigInfoDtoRefreshTokenTemplate; +} +/** + * The authentication information needed to connect with a data source. + * @export + * @interface AuthConfigInfoDtoAuthDetails + */ +export interface AuthConfigInfoDtoAuthDetails { + /** + * The base URL with which the data connector framework (DCF) can get authenticated for using the connector. Should be obtained from the API documentation of the third-party service. + * @type {string} + * @memberof AuthConfigInfoDtoAuthDetails + */ + authUrl: string; + /** + * The template for generating the full authentication URL for authenticating the DCF. + * @type {string} + * @memberof AuthConfigInfoDtoAuthDetails + */ + template: string; +} +/** + * Template for defining the requirements of authentication token exchange with the external data source. + * @export + * @interface AuthConfigInfoDtoExchangeTokenTemplate + */ +export interface AuthConfigInfoDtoExchangeTokenTemplate { + /** + * Defines all request and auth headers which are common for each operation. + * @type {{ [key: string]: any; }} + * @memberof AuthConfigInfoDtoExchangeTokenTemplate + */ + options: { [key: string]: any }; + /** + * A list of REST operations to exchange authentication token with the data source. + * @type {Array} + * @memberof AuthConfigInfoDtoExchangeTokenTemplate + */ + operations: Array; +} +/** + * Describes the configuration for a single REST operation for authenticating with the data source. + * @export + * @interface AuthConfigInfoDtoExchangeTokenTemplateOperationsInner + */ +export interface AuthConfigInfoDtoExchangeTokenTemplateOperationsInner { + /** + * An object which defines the REST operation as well as the URL to issue the request. + * @type {{ [key: string]: any; }} + * @memberof AuthConfigInfoDtoExchangeTokenTemplateOperationsInner + */ + template: { [key: string]: any }; + /** + * + * @type {AuthConfigInfoDtoExchangeTokenTemplateOperationsInnerFunctions} + * @memberof AuthConfigInfoDtoExchangeTokenTemplateOperationsInner + */ + functions: AuthConfigInfoDtoExchangeTokenTemplateOperationsInnerFunctions; +} +/** + * An object defining functions which process the received authentication data from the operation. + * @export + * @interface AuthConfigInfoDtoExchangeTokenTemplateOperationsInnerFunctions + */ +export interface AuthConfigInfoDtoExchangeTokenTemplateOperationsInnerFunctions { + /** + * Should always be an empty array. + * @type {Array} + * @memberof AuthConfigInfoDtoExchangeTokenTemplateOperationsInnerFunctions + */ + getData: Array; +} +/** + * Template for defining the requirements of renewing the authentication token with the external data source. + * @export + * @interface AuthConfigInfoDtoRefreshTokenTemplate + */ +export interface AuthConfigInfoDtoRefreshTokenTemplate { + /** + * Defines all request and auth headers which are common for each operation. + * @type {object} + * @memberof AuthConfigInfoDtoRefreshTokenTemplate + */ + options: object; + /** + * A list of REST operations to retrieve an exchange token from the data source. + * @type {Array} + * @memberof AuthConfigInfoDtoRefreshTokenTemplate + */ + operations: Array; +} +/** + * Describes the configuration for a single REST operation retrieving an exchange token from the data source. + * @export + * @interface AuthConfigInfoDtoRefreshTokenTemplateOperationsInner + */ +export interface AuthConfigInfoDtoRefreshTokenTemplateOperationsInner { + /** + * An object which defines the REST operation as well as the URL to issue the request. + * @type {{ [key: string]: any; }} + * @memberof AuthConfigInfoDtoRefreshTokenTemplateOperationsInner + */ + template: { [key: string]: any }; + /** + * + * @type {AuthConfigInfoDtoRefreshTokenTemplateOperationsInnerFunctions} + * @memberof AuthConfigInfoDtoRefreshTokenTemplateOperationsInner + */ + functions: AuthConfigInfoDtoRefreshTokenTemplateOperationsInnerFunctions; +} +/** + * An object defining functions which process the received refresh token data from the operation. + * @export + * @interface AuthConfigInfoDtoRefreshTokenTemplateOperationsInnerFunctions + */ +export interface AuthConfigInfoDtoRefreshTokenTemplateOperationsInnerFunctions { + /** + * + * @type {Array} + * @memberof AuthConfigInfoDtoRefreshTokenTemplateOperationsInnerFunctions + */ + getData: Array; +} +/** + * The information needed to onboard and use a data source. + * @export + * @interface AuthConfigInfoPatchDto + */ +export interface AuthConfigInfoPatchDto { + /** + * + * @type {AuthConfigInfoPatchDtoAuthDetails} + * @memberof AuthConfigInfoPatchDto + */ + authDetails?: AuthConfigInfoPatchDtoAuthDetails; + /** + * + * @type {AuthConfigInfoPatchDtoExchangeTokenTemplate} + * @memberof AuthConfigInfoPatchDto + */ + exchangeTokenTemplate?: AuthConfigInfoPatchDtoExchangeTokenTemplate; + /** + * + * @type {AuthConfigInfoPatchDtoRefreshTokenTemplate} + * @memberof AuthConfigInfoPatchDto + */ + refreshTokenTemplate?: AuthConfigInfoPatchDtoRefreshTokenTemplate; +} +/** + * The authentication information needed to connect with a Data Source. + * @export + * @interface AuthConfigInfoPatchDtoAuthDetails + */ +export interface AuthConfigInfoPatchDtoAuthDetails { + /** + * The base URL with which the data connector framework (DCF) can get authenticated for using the connector. Should be obtained from the API documentation of the third-party service. + * @type {string} + * @memberof AuthConfigInfoPatchDtoAuthDetails + */ + authUrl?: string; + /** + * The template for generating the full authentication URL for authenticating the DCF. + * @type {string} + * @memberof AuthConfigInfoPatchDtoAuthDetails + */ + template?: string; +} +/** + * Template for defining the requirements of authentication token exchange with the external data source. + * @export + * @interface AuthConfigInfoPatchDtoExchangeTokenTemplate + */ +export interface AuthConfigInfoPatchDtoExchangeTokenTemplate { + /** + * Defines all request and auth headers which are common for each operation.s + * @type {{ [key: string]: any; }} + * @memberof AuthConfigInfoPatchDtoExchangeTokenTemplate + */ + options?: { [key: string]: any }; + /** + * A list of REST operations to exchange authentication token with the data source. + * @type {Array} + * @memberof AuthConfigInfoPatchDtoExchangeTokenTemplate + */ + operations?: Array; +} +/** + * Describes the configuration for a single REST operation for authenticating with the data source. + * @export + * @interface AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInner + */ +export interface AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInner { + /** + * An object which defines the REST operation as well as the URL to issue the request. + * @type {{ [key: string]: any; }} + * @memberof AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInner + */ + template?: { [key: string]: any }; + /** + * + * @type {AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInnerFunctions} + * @memberof AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInner + */ + functions?: AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInnerFunctions; +} +/** + * An object defining functions which process the received authentication data from the operation. + * @export + * @interface AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInnerFunctions + */ +export interface AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInnerFunctions { + /** + * + * @type {Array} + * @memberof AuthConfigInfoPatchDtoExchangeTokenTemplateOperationsInnerFunctions + */ + getData?: Array; +} +/** + * Template for defining the requirements of renewing the authentication token with the external data source. + * @export + * @interface AuthConfigInfoPatchDtoRefreshTokenTemplate + */ +export interface AuthConfigInfoPatchDtoRefreshTokenTemplate { + /** + * Defines all request and auth headers which are common for each operation. + * @type {object} + * @memberof AuthConfigInfoPatchDtoRefreshTokenTemplate + */ + options?: object; + /** + * A list of REST operations to retrieve an exchange token from the data source. + * @type {Array} + * @memberof AuthConfigInfoPatchDtoRefreshTokenTemplate + */ + operations?: Array; +} +/** + * Describes the configuration for a single REST operation retrieving an exchange token from the data source. + * @export + * @interface AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInner + */ +export interface AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInner { + /** + * An object which defines the REST operation as well as the URL to issue the request. + * @type {{ [key: string]: any; }} + * @memberof AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInner + */ + template?: { [key: string]: any }; + /** + * + * @type {AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInnerFunctions} + * @memberof AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInner + */ + functions?: AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInnerFunctions; +} +/** + * An object defining functions which process the received refresh token data from the operation. + * @export + * @interface AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInnerFunctions + */ +export interface AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInnerFunctions { + /** + * Should always be an empty array. + * @type {Array} + * @memberof AuthConfigInfoPatchDtoRefreshTokenTemplateOperationsInnerFunctions + */ + getData?: Array; +} +/** + * Defines the consumer facing information of a connector. + * @export + * @interface AvailableConnectorDTO + */ +export interface AvailableConnectorDTO { + /** + * The ID of the connector. + * @type {string} + * @memberof AvailableConnectorDTO + */ + id: string; + /** + * The name of the connector. + * @type {string} + * @memberof AvailableConnectorDTO + */ + name: string; + /** + * The icon of the connector as base64 encoded string. + * @type {string} + * @memberof AvailableConnectorDTO + */ + icon: string; + /** + * The URL of the website for the connector. + * @type {string} + * @memberof AvailableConnectorDTO + */ + websiteUri?: string; +} +/** + * List of all available connectors. + * @export + * @interface AvailableConnectorsResponse + */ +export interface AvailableConnectorsResponse { + /** + * A list of available connectors. + * @type {Array} + * @memberof AvailableConnectorsResponse + */ + connectors: Array; +} +/** + * A basic connector information needed for mapping with a common schema + * @export + * @interface BasicConnectorDTO + */ +export interface BasicConnectorDTO { + /** + * The name of the connector. + * @type {string} + * @memberof BasicConnectorDTO + */ + name: string; + /** + * The website of the connector. + * @type {string} + * @memberof BasicConnectorDTO + */ + website: string; + /** + * The icon of the connector as base64 encoded string. + * @type {string} + * @memberof BasicConnectorDTO + */ + icon?: string; + /** + * The ID of the connector. + * @type {string} + * @memberof BasicConnectorDTO + */ + connectorId: string; +} +/** + * @type CallbackResponse + * @export + */ +export type CallbackResponse = + | CallbackResponseOneOf + | PatchDataSourceConfigStatusResponse + | PatchDataSourceStatusResponse; + +/** + * Response payload sent after calling the callback endpoint. + * @export + * @interface CallbackResponseOneOf + */ +export interface CallbackResponseOneOf { + /** + * The ID of the data connector. + * @type {string} + * @memberof CallbackResponseOneOf + */ + connectionId?: string; + /** + * The name of the data source. + * @type {string} + * @memberof CallbackResponseOneOf + */ + dataSource?: string; +} +/** + * A list to define templates fields which need to have specific names for the Connector. For example `clientSecret` needs to be named `secret` for the Deezer connector. + * @export + * @interface ConfigTemplateDto + */ +export interface ConfigTemplateDto extends Array {} +/** + * + * @export + * @interface ConfigTemplateDtoInner + */ +export interface ConfigTemplateDtoInner { + /** + * The placeholder name from any template within the postDataSourceConfig payload. + * @type {string} + * @memberof ConfigTemplateDtoInner + */ + key: string; + /** + * The replacement field name as required by the data connector for the postDataSourceConfig templates. + * @type {string} + * @memberof ConfigTemplateDtoInner + */ + value: string; + /** + * A descriptive comment giving context for the need of this custom field. + * @type {string} + * @memberof ConfigTemplateDtoInner + */ + description?: string; +} +/** + * Request payload for creating a new connection. + * @export + * @interface ConnectionCreationRequest + */ +export interface ConnectionCreationRequest { + /** + * The ID of the data connector. + * @type {string} + * @memberof ConnectionCreationRequest + */ + connectorId: string; + /** + * The ID of the data source. + * @type {string} + * @memberof ConnectionCreationRequest + */ + dataSourceId?: string; +} +/** + * Response payload after successful creation of a connection. + * @export + * @interface ConnectionCreationResponse + */ +export interface ConnectionCreationResponse { + /** + * the Single-Sign-On address through which a user need to authenticate the connection with the use of the data connector framework (DCF). + * @type {string} + * @memberof ConnectionCreationResponse + */ + ssoStartUrl?: string; +} +/** + * Represents a default API response communicating result details of the request. + * @export + * @interface ConnectionExecutedTempResponse + */ +export interface ConnectionExecutedTempResponse { + /** + * The actual response message. + * @type {object} + * @memberof ConnectionExecutedTempResponse + */ + credentials?: object; +} +/** + * The configuration object for the Connector containing builder\'s credentials and customs fields. + * @export + * @interface ConnectorAuthConfig + */ +export interface ConnectorAuthConfig { + /** + * The client ID acquired while registering at a third-party service. Might be named differently at each individual service. Reflect these differences within the `customFields` property. + * @type {string} + * @memberof ConnectorAuthConfig + */ + clientId: string; + /** + * + * @type {ConfigTemplateDto} + * @memberof ConnectorAuthConfig + */ + customFields?: ConfigTemplateDto; +} +/** + * An object containing required information to define a connector. + * @export + * @interface ConnectorDTO + */ +export interface ConnectorDTO { + /** + * The ID of the connector. + * @type {string} + * @memberof ConnectorDTO + */ + id: string; + /** + * The name of the connector. + * @type {string} + * @memberof ConnectorDTO + */ + name: string; + /** + * The date and time at which the connector has been created. + * @type {string} + * @memberof ConnectorDTO + */ + createdAt?: string; + /** + * A list of IDs of related data sources. + * @type {Array} + * @memberof ConnectorDTO + */ + dataSourceIds: Array; + /** + * + * @type {ConnectorAuthConfig} + * @memberof ConnectorDTO + */ + config: ConnectorAuthConfig; + /** + * The state in which the connector is currently. + * @type {string} + * @memberof ConnectorDTO + */ + status?: ConnectorDTOStatusEnum; + /** + * The icon of the connector as base64 encoded string. + * @type {string} + * @memberof ConnectorDTO + */ + icon: string; + /** + * The URL of the website for the connector. + * @type {string} + * @memberof ConnectorDTO + */ + websiteUri?: string; +} + +export const ConnectorDTOStatusEnum = { + Draft: 'DRAFT', + Ready: 'READY', +} as const; + +export type ConnectorDTOStatusEnum = + (typeof ConnectorDTOStatusEnum)[keyof typeof ConnectorDTOStatusEnum]; + +/** + * The requested connector. + * @export + * @interface ConnectorsByIdResponse + */ +export interface ConnectorsByIdResponse { + /** + * + * @type {ConnectorDTO} + * @memberof ConnectorsByIdResponse + */ + connector?: ConnectorDTO; +} +/** + * Request to create a new connector. + * @export + * @interface ConnectorsCreationRequest + */ +export interface ConnectorsCreationRequest { + /** + * The name of the connector. + * @type {string} + * @memberof ConnectorsCreationRequest + */ + name: string; + /** + * The list of data source IDs for the connector. + * @type {Array} + * @memberof ConnectorsCreationRequest + */ + dataSourceIds: Array; + /** + * + * @type {ConnectorAuthConfig} + * @memberof ConnectorsCreationRequest + */ + config: ConnectorAuthConfig; + /** + * The icon of the connector as base64 encoded string. + * @type {string} + * @memberof ConnectorsCreationRequest + */ + icon: string; + /** + * The URL of the website for the connector. + * @type {string} + * @memberof ConnectorsCreationRequest + */ + websiteUri?: string; +} +/** + * List of all configured connectors. + * @export + * @interface ConnectorsResponse + */ +export interface ConnectorsResponse { + /** + * A list of available connectors. + * @type {Array} + * @memberof ConnectorsResponse + */ + connectors: Array; +} +/** + * Request payload for creating of a transformation template for a given data source. + * @export + * @interface CreateTransformationTemplateRequest + */ +export interface CreateTransformationTemplateRequest { + /** + * + * @type {TransformationTemplateDto} + * @memberof CreateTransformationTemplateRequest + */ + transformationTemplate: TransformationTemplateDto; +} +/** + * An object that contains endpoint configurations for data retrieval + * @export + * @interface DataSource + */ +export interface DataSource { + /** + * The ID of the data source. + * @type {string} + * @memberof DataSource + */ + dataSourceId?: string; + /** + * The ID of the data source configuration. + * @type {string} + * @memberof DataSource + */ + dataSourceConfigId: string; + /** + * The name of the data source. + * @type {string} + * @memberof DataSource + */ + dataSourceName: string; + /** + * The human readable description of the data source. + * @type {string} + * @memberof DataSource + */ + description?: string; + /** + * Data-scoped permissions as string, requested from the third-party service API so that DCF can access that data on behalf of end users. + * @type {string} + * @memberof DataSource + */ + scope: string; + /** + * The status of the data source. + * @type {string} + * @memberof DataSource + */ + status?: DataSourceStatusEnum; + /** + * + * @type {EndpointConfigDto} + * @memberof DataSource + */ + endpointConfig: EndpointConfigDto; + /** + * + * @type {TransformationTemplateDto} + * @memberof DataSource + */ + transformationTemplate?: TransformationTemplateDto; +} + +export const DataSourceStatusEnum = { + Draft: 'DRAFT', + Active: 'ACTIVE', +} as const; + +export type DataSourceStatusEnum = + (typeof DataSourceStatusEnum)[keyof typeof DataSourceStatusEnum]; + +/** + * An object that contains configurations for authenticating with a given data source. + * @export + * @interface DataSourceConfig + */ +export interface DataSourceConfig { + /** + * The name of the data source configuration. + * @type {string} + * @memberof DataSourceConfig + */ + dataSourceConfigName: string; + /** + * The status of the data source config. + * @type {string} + * @memberof DataSourceConfig + */ + status?: DataSourceConfigStatusEnum; + /** + * + * @type {AuthConfigInfoDto} + * @memberof DataSourceConfig + */ + authConfigInfo: AuthConfigInfoDto; +} + +export const DataSourceConfigStatusEnum = { + Draft: 'DRAFT', + Active: 'ACTIVE', +} as const; + +export type DataSourceConfigStatusEnum = + (typeof DataSourceConfigStatusEnum)[keyof typeof DataSourceConfigStatusEnum]; + +/** + * @type DataSourceConfigByIdResponse + * @export + */ +export type DataSourceConfigByIdResponse = + | DataSourceConfigByIdResponseOneOf + | DataSourceConfigValidationResult; + +/** + * Specific data source configuration based on id provided + * @export + * @interface DataSourceConfigByIdResponseOneOf + */ +export interface DataSourceConfigByIdResponseOneOf { + /** + * + * @type {AuthConfigDto} + * @memberof DataSourceConfigByIdResponseOneOf + */ + dataSourceConfig: AuthConfigDto; +} +/** + * Request payload for updating certain authentication information of a data source configuration. + * @export + * @interface DataSourceConfigPatchRequest + */ +export interface DataSourceConfigPatchRequest { + /** + * + * @type {AuthConfigInfoPatchDto} + * @memberof DataSourceConfigPatchRequest + */ + authConfigInfo?: AuthConfigInfoPatchDto; +} +/** + * Updates a data source config\'s status. + * @export + * @interface DataSourceConfigPatchStatusRequest + */ +export interface DataSourceConfigPatchStatusRequest { + /** + * The new status of the data source config. + * @type {string} + * @memberof DataSourceConfigPatchStatusRequest + */ + status: DataSourceConfigPatchStatusRequestStatusEnum; + /** + * + * @type {string} + * @memberof DataSourceConfigPatchStatusRequest + */ + scope?: string; + /** + * + * @type {ConnectorAuthConfig} + * @memberof DataSourceConfigPatchStatusRequest + */ + config?: ConnectorAuthConfig; +} + +export const DataSourceConfigPatchStatusRequestStatusEnum = { + Draft: 'DRAFT', + Active: 'ACTIVE', +} as const; + +export type DataSourceConfigPatchStatusRequestStatusEnum = + (typeof DataSourceConfigPatchStatusRequestStatusEnum)[keyof typeof DataSourceConfigPatchStatusRequestStatusEnum]; + +/** + * List of all available configurations of data sources. + * @export + * @interface DataSourceConfigResponse + */ +export interface DataSourceConfigResponse { + /** + * The list of all available data source configurations. + * @type {Array} + * @memberof DataSourceConfigResponse + */ + dataSourceConfigs: Array; +} +/** + * + * @export + * @interface DataSourceConfigValidationResult + */ +export interface DataSourceConfigValidationResult { + /** + * + * @type {DataSourceConfigValidationResultValidationResult} + * @memberof DataSourceConfigValidationResult + */ + validationResult?: DataSourceConfigValidationResultValidationResult; +} +/** + * + * @export + * @interface DataSourceConfigValidationResultValidationResult + */ +export interface DataSourceConfigValidationResultValidationResult { + /** + * + * @type {boolean} + * @memberof DataSourceConfigValidationResultValidationResult + */ + isSuccessful?: boolean; + /** + * + * @type {string} + * @memberof DataSourceConfigValidationResultValidationResult + */ + connectionId?: string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof DataSourceConfigValidationResultValidationResult + */ + response?: { [key: string]: any }; +} +/** + * Response payload after successful creation of a data source configuration. + * @export + * @interface DataSourceCreationResponse + */ +export interface DataSourceCreationResponse { + /** + * The ID of the data source. + * @type {string} + * @memberof DataSourceCreationResponse + */ + dataSourceId?: string; +} +/** + * Request payload for updating of a data source. + * @export + * @interface DataSourcePatchRequest + */ +export interface DataSourcePatchRequest { + /** + * The name of the data source. + * @type {string} + * @memberof DataSourcePatchRequest + */ + dataSourceName?: string; + /** + * The human readable description of the data source. + * @type {string} + * @memberof DataSourcePatchRequest + */ + description?: string; + /** + * Data-scoped permissions as string, requested from the third-party service API so that DCF can access that data on behalf of end users. + * @type {string} + * @memberof DataSourcePatchRequest + */ + scope?: string; + /** + * + * @type {EndpointConfigPatchRequest} + * @memberof DataSourcePatchRequest + */ + endpointConfig?: EndpointConfigPatchRequest; + /** + * + * @type {TransformationTemplateDto} + * @memberof DataSourcePatchRequest + */ + transformationTemplate?: TransformationTemplateDto; +} +/** + * Updates a data source status. + * @export + * @interface DataSourcePatchStatusRequest + */ +export interface DataSourcePatchStatusRequest { + /** + * The status of the data source. + * @type {string} + * @memberof DataSourcePatchStatusRequest + */ + status: DataSourcePatchStatusRequestStatusEnum; + /** + * + * @type {ConnectorAuthConfig} + * @memberof DataSourcePatchStatusRequest + */ + config?: ConnectorAuthConfig; +} + +export const DataSourcePatchStatusRequestStatusEnum = { + Draft: 'DRAFT', + Active: 'ACTIVE', +} as const; + +export type DataSourcePatchStatusRequestStatusEnum = + (typeof DataSourcePatchStatusRequestStatusEnum)[keyof typeof DataSourcePatchStatusRequestStatusEnum]; + +/** + * List of all data source configurations. + * @export + * @interface DataSourceResponse + */ +export interface DataSourceResponse { + /** + * A list of data source configurations. + * @type {Array} + * @memberof DataSourceResponse + */ + dataSources?: Array; +} +/** + * An object that contains endpoint configurations for data retrievel + * @export + * @interface DataSourceResponseDto + */ +export interface DataSourceResponseDto { + /** + * The ID of the data source. + * @type {string} + * @memberof DataSourceResponseDto + */ + dataSourceId: string; + /** + * The ID of the data source configuration. + * @type {string} + * @memberof DataSourceResponseDto + */ + dataSourceConfigId: string; + /** + * The name of the data source. + * @type {string} + * @memberof DataSourceResponseDto + */ + dataSourceName: string; + /** + * The human readable description of the data source. + * @type {string} + * @memberof DataSourceResponseDto + */ + description?: string; + /** + * Data-scoped permissions as string, requested from the third-party service API so that DCF can access that data on behalf of end users. + * @type {string} + * @memberof DataSourceResponseDto + */ + scope: string; + /** + * The status of the data source. + * @type {string} + * @memberof DataSourceResponseDto + */ + status: DataSourceResponseDtoStatusEnum; + /** + * + * @type {EndpointConfigDto} + * @memberof DataSourceResponseDto + */ + endpointConfig: EndpointConfigDto; + /** + * + * @type {TransformationTemplateDto} + * @memberof DataSourceResponseDto + */ + transformationTemplate?: TransformationTemplateDto; +} + +export const DataSourceResponseDtoStatusEnum = { + Draft: 'DRAFT', + Active: 'ACTIVE', +} as const; + +export type DataSourceResponseDtoStatusEnum = + (typeof DataSourceResponseDtoStatusEnum)[keyof typeof DataSourceResponseDtoStatusEnum]; + +/** + * + * @export + * @interface DataSourceValidationResult + */ +export interface DataSourceValidationResult { + /** + * + * @type {DataSourceValidationResultValidationResult} + * @memberof DataSourceValidationResult + */ + validationResult?: DataSourceValidationResultValidationResult; +} +/** + * + * @export + * @interface DataSourceValidationResultValidationResult + */ +export interface DataSourceValidationResultValidationResult { + /** + * + * @type {boolean} + * @memberof DataSourceValidationResultValidationResult + */ + isSuccessful?: boolean; + /** + * + * @type {string} + * @memberof DataSourceValidationResultValidationResult + */ + connectionId?: string; + /** + * + * @type {Array} + * @memberof DataSourceValidationResultValidationResult + */ + response?: Array; +} +/** + * Defines the executable operations provided by the data connector in order to retrieve data. + * @export + * @interface EndpointConfigDto + */ +export interface EndpointConfigDto { + /** + * Defines all request and auth headers which are common for each operation. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigDto + */ + options: { [key: string]: any }; + /** + * A list of REST operations to retrieve data from the data connector. + * @type {Array} + * @memberof EndpointConfigDto + */ + operations: Array; +} +/** + * Describes the configuration for a single REST operation for the data connector. + * @export + * @interface EndpointConfigDtoOperationsInner + */ +export interface EndpointConfigDtoOperationsInner { + /** + * An object which defines the REST operation as well as the URL to issue the request. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigDtoOperationsInner + */ + template: { [key: string]: any }; + /** + * An object defining functions which process the received data from the defined operation. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigDtoOperationsInner + */ + functions: { [key: string]: any }; + /** + * An optional object defining how paginated results will be collected. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigDtoOperationsInner + */ + pagination?: { [key: string]: any }; + /** + * Schema of the response returned by the chosen API endpoint. It serves as a reference to understand the structure and format of data returned by the data source API. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigDtoOperationsInner + */ + sourceSchema: { [key: string]: any }; +} +/** + * Defines the executable operations provided by the data connector in order to retrieve data. + * @export + * @interface EndpointConfigPatchRequest + */ +export interface EndpointConfigPatchRequest { + /** + * Defines all request and auth headers which are common for each operation. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigPatchRequest + */ + options?: { [key: string]: any }; + /** + * + * @type {Array} + * @memberof EndpointConfigPatchRequest + */ + operations?: Array; +} +/** + * + * @export + * @interface EndpointConfigPatchRequestOperationsInner + */ +export interface EndpointConfigPatchRequestOperationsInner { + /** + * + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigPatchRequestOperationsInner + */ + template?: { [key: string]: any }; + /** + * + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigPatchRequestOperationsInner + */ + functions?: { [key: string]: any }; + /** + * + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigPatchRequestOperationsInner + */ + pagination?: { [key: string]: any }; + /** + * Schema of the response returned by the chosen API endpoint. It serves as a reference to understand the structure and format of data returned by the data source API. + * @type {{ [key: string]: any; }} + * @memberof EndpointConfigPatchRequestOperationsInner + */ + sourceSchema?: { [key: string]: any }; +} +/** + * Represents the results of executed connection request + * @export + * @interface ExecutedConnectionRequestResponse + */ +export interface ExecutedConnectionRequestResponse { + /** + * The status of the executed connection request. + * @type {string} + * @memberof ExecutedConnectionRequestResponse + */ + status?: string; + /** + * A list of errors that occurred during the execution of the connection request. + * @type {Array} + * @memberof ExecutedConnectionRequestResponse + */ + errors?: Array; + /** + * The ID of the connector. + * @type {string} + * @memberof ExecutedConnectionRequestResponse + */ + connectorId?: string; + /** + * The ID of the connection. + * @type {string} + * @memberof ExecutedConnectionRequestResponse + */ + connectionId?: string; + /** + * The name of the connector. + * @type {string} + * @memberof ExecutedConnectionRequestResponse + */ + connectorName?: string; + /** + * The date and time at which the connection has been created. + * @type {string} + * @memberof ExecutedConnectionRequestResponse + */ + createdAt?: string; + /** + * The date and time at which the connection has been activated. + * @type {string} + * @memberof ExecutedConnectionRequestResponse + */ + activatedAt?: string; +} +/** + * Represents a default API response communicating result details of the request. + * @export + * @interface GenericResponse + */ +export interface GenericResponse { + /** + * The actual response message. + * @type {string} + * @memberof GenericResponse + */ + message?: string; +} +/** + * @type GetDataSourcebyIdResponse + * @export + */ +export type GetDataSourcebyIdResponse = DataSource | DataSourceValidationResult; + +/** + * @type GetExecutedConnection404Response + * @export + */ +export type GetExecutedConnection404Response = + | NotFoundError + | ResourceNotFoundError; + +/** + * + * @export + * @interface InvalidParameterError + */ +export interface InvalidParameterError { + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + name?: InvalidParameterErrorNameEnum; + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + message?: InvalidParameterErrorMessageEnum; + /** + * + * @type {number} + * @memberof InvalidParameterError + */ + httpStatusCode?: InvalidParameterErrorHttpStatusCodeEnum; +} + +export const InvalidParameterErrorNameEnum = { + InvalidParameterError: 'InvalidParameterError', +} as const; + +export type InvalidParameterErrorNameEnum = + (typeof InvalidParameterErrorNameEnum)[keyof typeof InvalidParameterErrorNameEnum]; +export const InvalidParameterErrorMessageEnum = { + InvalidParameterParam: 'Invalid parameter: ${param}.', +} as const; + +export type InvalidParameterErrorMessageEnum = + (typeof InvalidParameterErrorMessageEnum)[keyof typeof InvalidParameterErrorMessageEnum]; +export const InvalidParameterErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type InvalidParameterErrorHttpStatusCodeEnum = + (typeof InvalidParameterErrorHttpStatusCodeEnum)[keyof typeof InvalidParameterErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface InvalidParametersError + */ +export interface InvalidParametersError { + /** + * + * @type {string} + * @memberof InvalidParametersError + */ + name?: InvalidParametersErrorNameEnum; + /** + * + * @type {string} + * @memberof InvalidParametersError + */ + message?: InvalidParametersErrorMessageEnum; + /** + * + * @type {number} + * @memberof InvalidParametersError + */ + httpStatusCode?: InvalidParametersErrorHttpStatusCodeEnum; +} + +export const InvalidParametersErrorNameEnum = { + InvalidParametersError: 'InvalidParametersError', +} as const; + +export type InvalidParametersErrorNameEnum = + (typeof InvalidParametersErrorNameEnum)[keyof typeof InvalidParametersErrorNameEnum]; +export const InvalidParametersErrorMessageEnum = { + ClassNameInvalidParameters: '${className} invalid parameters.', +} as const; + +export type InvalidParametersErrorMessageEnum = + (typeof InvalidParametersErrorMessageEnum)[keyof typeof InvalidParametersErrorMessageEnum]; +export const InvalidParametersErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type InvalidParametersErrorHttpStatusCodeEnum = + (typeof InvalidParametersErrorHttpStatusCodeEnum)[keyof typeof InvalidParametersErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface ItemAlreadyExistsError + */ +export interface ItemAlreadyExistsError { + /** + * + * @type {string} + * @memberof ItemAlreadyExistsError + */ + name?: ItemAlreadyExistsErrorNameEnum; + /** + * + * @type {string} + * @memberof ItemAlreadyExistsError + */ + message?: ItemAlreadyExistsErrorMessageEnum; + /** + * + * @type {number} + * @memberof ItemAlreadyExistsError + */ + httpStatusCode?: ItemAlreadyExistsErrorHttpStatusCodeEnum; +} + +export const ItemAlreadyExistsErrorNameEnum = { + ItemAlreadyExistsError: 'ItemAlreadyExistsError', +} as const; + +export type ItemAlreadyExistsErrorNameEnum = + (typeof ItemAlreadyExistsErrorNameEnum)[keyof typeof ItemAlreadyExistsErrorNameEnum]; +export const ItemAlreadyExistsErrorMessageEnum = { + ItemAlreadyExists: 'Item already exists', +} as const; + +export type ItemAlreadyExistsErrorMessageEnum = + (typeof ItemAlreadyExistsErrorMessageEnum)[keyof typeof ItemAlreadyExistsErrorMessageEnum]; +export const ItemAlreadyExistsErrorHttpStatusCodeEnum = { + NUMBER_409: 409, +} as const; + +export type ItemAlreadyExistsErrorHttpStatusCodeEnum = + (typeof ItemAlreadyExistsErrorHttpStatusCodeEnum)[keyof typeof ItemAlreadyExistsErrorHttpStatusCodeEnum]; + +/** + * Mappings between common schemas and connectors + * @export + * @interface MappingsResponse + */ +export interface MappingsResponse { + /** + * A dictionary containing mappings between a common schema and a list of connectors + * @type {{ [key: string]: Array; }} + * @memberof MappingsResponse + */ + mappings: { [key: string]: Array }; +} +/** + * + * @export + * @interface NotFoundError + */ +export interface NotFoundError { + /** + * + * @type {string} + * @memberof NotFoundError + */ + name?: NotFoundErrorNameEnum; + /** + * + * @type {string} + * @memberof NotFoundError + */ + message?: NotFoundErrorMessageEnum; + /** + * + * @type {number} + * @memberof NotFoundError + */ + httpStatusCode?: NotFoundErrorHttpStatusCodeEnum; +} + +export const NotFoundErrorNameEnum = { + NotFoundError: 'NotFoundError', +} as const; + +export type NotFoundErrorNameEnum = + (typeof NotFoundErrorNameEnum)[keyof typeof NotFoundErrorNameEnum]; +export const NotFoundErrorMessageEnum = { + NotFoundParam: 'Not found: ${param}.', +} as const; + +export type NotFoundErrorMessageEnum = + (typeof NotFoundErrorMessageEnum)[keyof typeof NotFoundErrorMessageEnum]; +export const NotFoundErrorHttpStatusCodeEnum = { + NUMBER_404: 404, +} as const; + +export type NotFoundErrorHttpStatusCodeEnum = + (typeof NotFoundErrorHttpStatusCodeEnum)[keyof typeof NotFoundErrorHttpStatusCodeEnum]; + +/** + * Updates a connector\'s data source IDs or configuration. + * @export + * @interface PatchConnectorRequest + */ +export interface PatchConnectorRequest { + /** + * The updated list of data source IDs for the connector. + * @type {Array} + * @memberof PatchConnectorRequest + */ + dataSourceIds?: Array; + /** + * + * @type {ConnectorAuthConfig} + * @memberof PatchConnectorRequest + */ + config?: ConnectorAuthConfig; + /** + * The name of the connector. + * @type {string} + * @memberof PatchConnectorRequest + */ + name?: string; + /** + * The new status of the connector. + * @type {string} + * @memberof PatchConnectorRequest + */ + status?: PatchConnectorRequestStatusEnum; + /** + * The icon of the connector as base64 encoded string. + * @type {string} + * @memberof PatchConnectorRequest + */ + icon?: string; + /** + * The URL of the website for the connector. + * @type {string} + * @memberof PatchConnectorRequest + */ + websiteUri?: string; +} + +export const PatchConnectorRequestStatusEnum = { + Draft: 'DRAFT', + Ready: 'READY', +} as const; + +export type PatchConnectorRequestStatusEnum = + (typeof PatchConnectorRequestStatusEnum)[keyof typeof PatchConnectorRequestStatusEnum]; + +/** + * The response for activating or deactivating + * @export + * @interface PatchDataSourceConfigStatusResponse + */ +export interface PatchDataSourceConfigStatusResponse { + /** + * + * @type {string} + * @memberof PatchDataSourceConfigStatusResponse + */ + ssoUrl?: string; + /** + * + * @type {DataSourceConfig} + * @memberof PatchDataSourceConfigStatusResponse + */ + dataSourceConfig?: DataSourceConfig; +} +/** + * The response for activating or deactivating + * @export + * @interface PatchDataSourceStatusResponse + */ +export interface PatchDataSourceStatusResponse { + /** + * + * @type {string} + * @memberof PatchDataSourceStatusResponse + */ + ssoUrl?: string; + /** + * + * @type {DataSource} + * @memberof PatchDataSourceStatusResponse + */ + dataSource?: DataSource; +} +/** + * The Connector that hast just been created. + * @export + * @interface PostConnectorsResponse + */ +export interface PostConnectorsResponse { + /** + * + * @type {ConnectorDTO} + * @memberof PostConnectorsResponse + */ + connector: ConnectorDTO; +} +/** + * + * @export + * @interface ReferentialIntegrityError + */ +export interface ReferentialIntegrityError { + /** + * + * @type {string} + * @memberof ReferentialIntegrityError + */ + name?: ReferentialIntegrityErrorNameEnum; + /** + * + * @type {string} + * @memberof ReferentialIntegrityError + */ + message?: ReferentialIntegrityErrorMessageEnum; + /** + * + * @type {number} + * @memberof ReferentialIntegrityError + */ + httpStatusCode?: ReferentialIntegrityErrorHttpStatusCodeEnum; +} + +export const ReferentialIntegrityErrorNameEnum = { + ReferentialIntegrityError: 'ReferentialIntegrityError', +} as const; + +export type ReferentialIntegrityErrorNameEnum = + (typeof ReferentialIntegrityErrorNameEnum)[keyof typeof ReferentialIntegrityErrorNameEnum]; +export const ReferentialIntegrityErrorMessageEnum = { + IntegrityConstraint: 'Integrity constraint', +} as const; + +export type ReferentialIntegrityErrorMessageEnum = + (typeof ReferentialIntegrityErrorMessageEnum)[keyof typeof ReferentialIntegrityErrorMessageEnum]; +export const ReferentialIntegrityErrorHttpStatusCodeEnum = { + NUMBER_409: 409, +} as const; + +export type ReferentialIntegrityErrorHttpStatusCodeEnum = + (typeof ReferentialIntegrityErrorHttpStatusCodeEnum)[keyof typeof ReferentialIntegrityErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface ResourceNotFoundError + */ +export interface ResourceNotFoundError { + /** + * + * @type {string} + * @memberof ResourceNotFoundError + */ + name?: ResourceNotFoundErrorNameEnum; + /** + * + * @type {string} + * @memberof ResourceNotFoundError + */ + message?: ResourceNotFoundErrorMessageEnum; + /** + * + * @type {number} + * @memberof ResourceNotFoundError + */ + httpStatusCode?: ResourceNotFoundErrorHttpStatusCodeEnum; +} + +export const ResourceNotFoundErrorNameEnum = { + ResourceNotFoundError: 'ResourceNotFoundError', +} as const; + +export type ResourceNotFoundErrorNameEnum = + (typeof ResourceNotFoundErrorNameEnum)[keyof typeof ResourceNotFoundErrorNameEnum]; +export const ResourceNotFoundErrorMessageEnum = { + TheRequestedResourceHasNotBeenFound: + 'The requested resource has not been found', +} as const; + +export type ResourceNotFoundErrorMessageEnum = + (typeof ResourceNotFoundErrorMessageEnum)[keyof typeof ResourceNotFoundErrorMessageEnum]; +export const ResourceNotFoundErrorHttpStatusCodeEnum = { + NUMBER_404: 404, +} as const; + +export type ResourceNotFoundErrorHttpStatusCodeEnum = + (typeof ResourceNotFoundErrorHttpStatusCodeEnum)[keyof typeof ResourceNotFoundErrorHttpStatusCodeEnum]; + +/** + * This schema represents the default response in case of an API call resulting in an error. + * @export + * @interface ServiceErrorResponse + */ +export interface ServiceErrorResponse { + /** + * An unique id for correlating this specific error to logs. + * @type {string} + * @memberof ServiceErrorResponse + */ + debugId: string; + /** + * The name of the error. + * @type {string} + * @memberof ServiceErrorResponse + */ + name: string; + /** + * The backwards compatible Affinidi error code. + * @type {string} + * @memberof ServiceErrorResponse + */ + code: string; + /** + * An optional list of explanatatory details about the occured errors. + * @type {Array} + * @memberof ServiceErrorResponse + */ + details?: Array; +} +/** + * Details about an input error informing about the location and the reason of the error. + * @export + * @interface ServiceErrorResponseDetailsInner + */ +export interface ServiceErrorResponseDetailsInner { + /** + * Information about what the error is about. + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + issue: string; + /** + * Indicates the field which contains or is the issue. + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + field?: string; + /** + * Indicates the field value which contains or is the issue. + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + value?: string; + /** + * Indicates where the error occurred. + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + location?: ServiceErrorResponseDetailsInnerLocationEnum; +} + +export const ServiceErrorResponseDetailsInnerLocationEnum = { + Body: 'BODY', + Path: 'PATH', + Query: 'QUERY', +} as const; + +export type ServiceErrorResponseDetailsInnerLocationEnum = + (typeof ServiceErrorResponseDetailsInnerLocationEnum)[keyof typeof ServiceErrorResponseDetailsInnerLocationEnum]; + +/** + * + * @export + * @interface TransformationTemplateDto + */ +export interface TransformationTemplateDto { + /** + * + * @type {string} + * @memberof TransformationTemplateDto + */ + endpoint: string; + /** + * + * @type {string} + * @memberof TransformationTemplateDto + */ + targetSchemaUrl: string; + /** + * + * @type {TransformationTemplateDtoSchemaMapping} + * @memberof TransformationTemplateDto + */ + schemaMapping: TransformationTemplateDtoSchemaMapping; +} +/** + * + * @export + * @interface TransformationTemplateDtoSchemaMapping + */ +export interface TransformationTemplateDtoSchemaMapping { + /** + * + * @type {Array} + * @memberof TransformationTemplateDtoSchemaMapping + */ + transformations: Array; + /** + * + * @type {Array} + * @memberof TransformationTemplateDtoSchemaMapping + */ + aggregations: Array; +} +/** + * + * @export + * @interface TransformationTemplateDtoSchemaMappingAggregationsInner + */ +export interface TransformationTemplateDtoSchemaMappingAggregationsInner { + [key: string]: any; + + /** + * + * @type {string} + * @memberof TransformationTemplateDtoSchemaMappingAggregationsInner + */ + name: string; + /** + * + * @type {Array} + * @memberof TransformationTemplateDtoSchemaMappingAggregationsInner + */ + fields?: Array; + /** + * + * @type {string} + * @memberof TransformationTemplateDtoSchemaMappingAggregationsInner + */ + resultField?: string; +} +/** + * + * @export + * @interface TransformationTemplateDtoSchemaMappingTransformationsInner + */ +export interface TransformationTemplateDtoSchemaMappingTransformationsInner { + [key: string]: any; + + /** + * + * @type {string} + * @memberof TransformationTemplateDtoSchemaMappingTransformationsInner + */ + name: string; + /** + * + * @type {Array} + * @memberof TransformationTemplateDtoSchemaMappingTransformationsInner + */ + fields?: Array; + /** + * + * @type {string} + * @memberof TransformationTemplateDtoSchemaMappingTransformationsInner + */ + resultField?: string; +} +/** + * + * @export + * @interface UnauthorizedError + */ +export interface UnauthorizedError { + /** + * + * @type {string} + * @memberof UnauthorizedError + */ + name?: UnauthorizedErrorNameEnum; + /** + * + * @type {string} + * @memberof UnauthorizedError + */ + message?: UnauthorizedErrorMessageEnum; + /** + * + * @type {number} + * @memberof UnauthorizedError + */ + httpStatusCode?: UnauthorizedErrorHttpStatusCodeEnum; +} + +export const UnauthorizedErrorNameEnum = { + UnauthorizedError: 'UnauthorizedError', +} as const; + +export type UnauthorizedErrorNameEnum = + (typeof UnauthorizedErrorNameEnum)[keyof typeof UnauthorizedErrorNameEnum]; +export const UnauthorizedErrorMessageEnum = { + UnauthorizedRequest: 'Unauthorized request', +} as const; + +export type UnauthorizedErrorMessageEnum = + (typeof UnauthorizedErrorMessageEnum)[keyof typeof UnauthorizedErrorMessageEnum]; +export const UnauthorizedErrorHttpStatusCodeEnum = { + NUMBER_401: 401, +} as const; + +export type UnauthorizedErrorHttpStatusCodeEnum = + (typeof UnauthorizedErrorHttpStatusCodeEnum)[keyof typeof UnauthorizedErrorHttpStatusCodeEnum]; + +/** + * CommonSchemaMappingsApi - axios parameter creator + * @export + */ +export const CommonSchemaMappingsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Fetches mappings between commons schemas and connectors by schema names + * @summary Gets mappings. + * @param {Array} schemas + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCommonSchemaMappings: async ( + schemas: Array, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'schemas' is not null or undefined + assertParamExists('getCommonSchemaMappings', 'schemas', schemas); + const localVarPath = `/v1/mappings`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (schemas) { + localVarQueryParameter['schemas'] = schemas; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * CommonSchemaMappingsApi - functional programming interface + * @export + */ +export const CommonSchemaMappingsApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + CommonSchemaMappingsApiAxiosParamCreator(configuration); + return { + /** + * Fetches mappings between commons schemas and connectors by schema names + * @summary Gets mappings. + * @param {Array} schemas + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getCommonSchemaMappings( + schemas: Array, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getCommonSchemaMappings( + schemas, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CommonSchemaMappingsApi.getCommonSchemaMappings']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * CommonSchemaMappingsApi - factory interface + * @export + */ +export const CommonSchemaMappingsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = CommonSchemaMappingsApiFp(configuration); + return { + /** + * Fetches mappings between commons schemas and connectors by schema names + * @summary Gets mappings. + * @param {Array} schemas + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCommonSchemaMappings( + schemas: Array, + options?: any + ): AxiosPromise { + return localVarFp + .getCommonSchemaMappings(schemas, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CommonSchemaMappingsApi - object-oriented interface + * @export + * @class CommonSchemaMappingsApi + * @extends {BaseAPI} + */ +export class CommonSchemaMappingsApi extends BaseAPI { + /** + * Fetches mappings between commons schemas and connectors by schema names + * @summary Gets mappings. + * @param {Array} schemas + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CommonSchemaMappingsApi + */ + public getCommonSchemaMappings( + schemas: Array, + options?: RawAxiosRequestConfig + ) { + return CommonSchemaMappingsApiFp(this.configuration) + .getCommonSchemaMappings(schemas, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * ConnectionsApi - axios parameter creator + * @export + */ +export const ConnectionsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Callback endpoint used by external data sources to redirect after successful authentication. + * @summary Authentication callback + * @param {string} code A code which identifies the connection from the request. + * @param {string} [state] The state of the connection. + * @param {string} [scope] The scope which has been send to the external data source and should be returned here. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + authCallback: async ( + code: string, + state?: string, + scope?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'code' is not null or undefined + assertParamExists('authCallback', 'code', code); + const localVarPath = `/v1/connections/callback`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (code !== undefined) { + localVarQueryParameter['code'] = code; + } + + if (state !== undefined) { + localVarQueryParameter['state'] = state; + } + + if (scope !== undefined) { + localVarQueryParameter['scope'] = scope; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteConnection: async ( + connectionId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionId' is not null or undefined + assertParamExists('deleteConnection', 'connectionId', connectionId); + const localVarPath = `/v1/connections/{connectionId}`.replace( + `{${'connectionId'}}`, + encodeURIComponent(String(connectionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + executeConnection: async ( + connectionId: string, + body: object | null, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionId' is not null or undefined + assertParamExists('executeConnection', 'connectionId', connectionId); + // verify required parameter 'body' is not null or undefined + assertParamExists('executeConnection', 'body', body); + const localVarPath = + `/v1/connections/{connectionId}/execution-request`.replace( + `{${'connectionId'}}`, + encodeURIComponent(String(connectionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getActiveConnections: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/active-connections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetch a list of active user connections in dry-run mode + * @summary Get dry run connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectionsDryRun: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/connections/dry-run`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the details of the executed connection. + * @summary Get executed connection + * @param {string} connectionId The ID of the connection. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExecutedConnection: async ( + connectionId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionId' is not null or undefined + assertParamExists('getExecutedConnection', 'connectionId', connectionId); + const localVarPath = + `/v1/connections/{connectionId}/execution-request`.replace( + `{${'connectionId'}}`, + encodeURIComponent(String(connectionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnection: async ( + connectionCreationRequest: ConnectionCreationRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionCreationRequest' is not null or undefined + assertParamExists( + 'postConnection', + 'connectionCreationRequest', + connectionCreationRequest + ); + const localVarPath = `/v1/connections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + connectionCreationRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Create a new user connection in dry-run mode to validate Connector + * @summary Post dry run connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnectionsDryRun + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnectionsDryRun: async ( + connectionCreationRequest: ConnectionCreationRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionCreationRequest' is not null or undefined + assertParamExists( + 'postConnectionsDryRun', + 'connectionCreationRequest', + connectionCreationRequest + ); + const localVarPath = `/v1/connections/dry-run`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + connectionCreationRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * ConnectionsApi - functional programming interface + * @export + */ +export const ConnectionsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ConnectionsApiAxiosParamCreator(configuration); + return { + /** + * Callback endpoint used by external data sources to redirect after successful authentication. + * @summary Authentication callback + * @param {string} code A code which identifies the connection from the request. + * @param {string} [state] The state of the connection. + * @param {string} [scope] The scope which has been send to the external data source and should be returned here. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async authCallback( + code: string, + state?: string, + scope?: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.authCallback( + code, + state, + scope, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.authCallback']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteConnection( + connectionId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteConnection(connectionId, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.deleteConnection']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async executeConnection( + connectionId: string, + body: object | null, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.executeConnection( + connectionId, + body, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.executeConnection']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getActiveConnections( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getActiveConnections(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.getActiveConnections']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetch a list of active user connections in dry-run mode + * @summary Get dry run connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getConnectionsDryRun( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getConnectionsDryRun(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.getConnectionsDryRun']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Retrieves the details of the executed connection. + * @summary Get executed connection + * @param {string} connectionId The ID of the connection. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getExecutedConnection( + connectionId: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getExecutedConnection( + connectionId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.getExecutedConnection']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postConnection( + connectionCreationRequest: ConnectionCreationRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.postConnection( + connectionCreationRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.postConnection']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Create a new user connection in dry-run mode to validate Connector + * @summary Post dry run connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnectionsDryRun + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postConnectionsDryRun( + connectionCreationRequest: ConnectionCreationRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.postConnectionsDryRun( + connectionCreationRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectionsApi.postConnectionsDryRun']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * ConnectionsApi - factory interface + * @export + */ +export const ConnectionsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ConnectionsApiFp(configuration); + return { + /** + * Callback endpoint used by external data sources to redirect after successful authentication. + * @summary Authentication callback + * @param {string} code A code which identifies the connection from the request. + * @param {string} [state] The state of the connection. + * @param {string} [scope] The scope which has been send to the external data source and should be returned here. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + authCallback( + code: string, + state?: string, + scope?: string, + options?: any + ): AxiosPromise { + return localVarFp + .authCallback(code, state, scope, options) + .then((request) => request(axios, basePath)); + }, + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteConnection(connectionId: string, options?: any): AxiosPromise { + return localVarFp + .deleteConnection(connectionId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + executeConnection( + connectionId: string, + body: object | null, + options?: any + ): AxiosPromise { + return localVarFp + .executeConnection(connectionId, body, options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getActiveConnections( + options?: any + ): AxiosPromise { + return localVarFp + .getActiveConnections(options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetch a list of active user connections in dry-run mode + * @summary Get dry run connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectionsDryRun( + options?: any + ): AxiosPromise { + return localVarFp + .getConnectionsDryRun(options) + .then((request) => request(axios, basePath)); + }, + /** + * Retrieves the details of the executed connection. + * @summary Get executed connection + * @param {string} connectionId The ID of the connection. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExecutedConnection( + connectionId: string, + options?: any + ): AxiosPromise { + return localVarFp + .getExecutedConnection(connectionId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnection( + connectionCreationRequest: ConnectionCreationRequest, + options?: any + ): AxiosPromise { + return localVarFp + .postConnection(connectionCreationRequest, options) + .then((request) => request(axios, basePath)); + }, + /** + * Create a new user connection in dry-run mode to validate Connector + * @summary Post dry run connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnectionsDryRun + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnectionsDryRun( + connectionCreationRequest: ConnectionCreationRequest, + options?: any + ): AxiosPromise { + return localVarFp + .postConnectionsDryRun(connectionCreationRequest, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ConnectionsApi - object-oriented interface + * @export + * @class ConnectionsApi + * @extends {BaseAPI} + */ +export class ConnectionsApi extends BaseAPI { + /** + * Callback endpoint used by external data sources to redirect after successful authentication. + * @summary Authentication callback + * @param {string} code A code which identifies the connection from the request. + * @param {string} [state] The state of the connection. + * @param {string} [scope] The scope which has been send to the external data source and should be returned here. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public authCallback( + code: string, + state?: string, + scope?: string, + options?: RawAxiosRequestConfig + ) { + return ConnectionsApiFp(this.configuration) + .authCallback(code, state, scope, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public deleteConnection( + connectionId: string, + options?: RawAxiosRequestConfig + ) { + return ConnectionsApiFp(this.configuration) + .deleteConnection(connectionId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public executeConnection( + connectionId: string, + body: object | null, + options?: RawAxiosRequestConfig + ) { + return ConnectionsApiFp(this.configuration) + .executeConnection(connectionId, body, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public getActiveConnections(options?: RawAxiosRequestConfig) { + return ConnectionsApiFp(this.configuration) + .getActiveConnections(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a list of active user connections in dry-run mode + * @summary Get dry run connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public getConnectionsDryRun(options?: RawAxiosRequestConfig) { + return ConnectionsApiFp(this.configuration) + .getConnectionsDryRun(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieves the details of the executed connection. + * @summary Get executed connection + * @param {string} connectionId The ID of the connection. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public getExecutedConnection( + connectionId: string, + options?: RawAxiosRequestConfig + ) { + return ConnectionsApiFp(this.configuration) + .getExecutedConnection(connectionId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public postConnection( + connectionCreationRequest: ConnectionCreationRequest, + options?: RawAxiosRequestConfig + ) { + return ConnectionsApiFp(this.configuration) + .postConnection(connectionCreationRequest, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Create a new user connection in dry-run mode to validate Connector + * @summary Post dry run connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnectionsDryRun + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectionsApi + */ + public postConnectionsDryRun( + connectionCreationRequest: ConnectionCreationRequest, + options?: RawAxiosRequestConfig + ) { + return ConnectionsApiFp(this.configuration) + .postConnectionsDryRun(connectionCreationRequest, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * ConnectorsApi - axios parameter creator + * @export + */ +export const ConnectorsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Used to delete a connector. + * @summary Delete connector + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteConnectors: async ( + connectorId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectorId' is not null or undefined + assertParamExists('deleteConnectors', 'connectorId', connectorId); + const localVarPath = `/v1/connectors/{connectorId}`.replace( + `{${'connectorId'}}`, + encodeURIComponent(String(connectorId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This is a consumer facing connector endpoint. It fetches list of available Connectors. + * @summary Lists available connectors. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAvailableConnectors: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/available-connectors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This is a consumer facing connector endpoint. It fetches an available connector by ID. + * @summary Gets an available connector by ID. + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAvailableConnectorsById: async ( + connectorId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectorId' is not null or undefined + assertParamExists( + 'getAvailableConnectorsById', + 'connectorId', + connectorId + ); + const localVarPath = `/v1/available-connectors/{connectorId}`.replace( + `{${'connectorId'}}`, + encodeURIComponent(String(connectorId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectors: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/connectors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a connector by its ID. + * @summary Get connector by ID + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectorsById: async ( + connectorId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectorId' is not null or undefined + assertParamExists('getConnectorsById', 'connectorId', connectorId); + const localVarPath = `/v1/connectors/{connectorId}`.replace( + `{${'connectorId'}}`, + encodeURIComponent(String(connectorId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates an existing connector by its ID. + * @summary Update connector + * @param {string} connectorId The ID of the connector. + * @param {PatchConnectorRequest} [patchConnectorRequest] PatchConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchConnectors: async ( + connectorId: string, + patchConnectorRequest?: PatchConnectorRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectorId' is not null or undefined + assertParamExists('patchConnectors', 'connectorId', connectorId); + const localVarPath = `/v1/connectors/{connectorId}`.replace( + `{${'connectorId'}}`, + encodeURIComponent(String(connectorId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + patchConnectorRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates a new connector. + * @summary Create connector + * @param {ConnectorsCreationRequest} [connectorsCreationRequest] PostConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnectors: async ( + connectorsCreationRequest?: ConnectorsCreationRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/connectors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + connectorsCreationRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * ConnectorsApi - functional programming interface + * @export + */ +export const ConnectorsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ConnectorsApiAxiosParamCreator(configuration); + return { + /** + * Used to delete a connector. + * @summary Delete connector + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteConnectors( + connectorId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteConnectors(connectorId, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.deleteConnectors']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * This is a consumer facing connector endpoint. It fetches list of available Connectors. + * @summary Lists available connectors. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAvailableConnectors( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getAvailableConnectors(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.getAvailableConnectors']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * This is a consumer facing connector endpoint. It fetches an available connector by ID. + * @summary Gets an available connector by ID. + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAvailableConnectorsById( + connectorId: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getAvailableConnectorsById( + connectorId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.getAvailableConnectorsById']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getConnectors( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectors( + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.getConnectors']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a connector by its ID. + * @summary Get connector by ID + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getConnectorsById( + connectorId: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getConnectorsById(connectorId, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.getConnectorsById']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Updates an existing connector by its ID. + * @summary Update connector + * @param {string} connectorId The ID of the connector. + * @param {PatchConnectorRequest} [patchConnectorRequest] PatchConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchConnectors( + connectorId: string, + patchConnectorRequest?: PatchConnectorRequest, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchConnectors( + connectorId, + patchConnectorRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.patchConnectors']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Creates a new connector. + * @summary Create connector + * @param {ConnectorsCreationRequest} [connectorsCreationRequest] PostConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postConnectors( + connectorsCreationRequest?: ConnectorsCreationRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.postConnectors( + connectorsCreationRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConnectorsApi.postConnectors']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * ConnectorsApi - factory interface + * @export + */ +export const ConnectorsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ConnectorsApiFp(configuration); + return { + /** + * Used to delete a connector. + * @summary Delete connector + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteConnectors(connectorId: string, options?: any): AxiosPromise { + return localVarFp + .deleteConnectors(connectorId, options) + .then((request) => request(axios, basePath)); + }, + /** + * This is a consumer facing connector endpoint. It fetches list of available Connectors. + * @summary Lists available connectors. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAvailableConnectors( + options?: any + ): AxiosPromise { + return localVarFp + .getAvailableConnectors(options) + .then((request) => request(axios, basePath)); + }, + /** + * This is a consumer facing connector endpoint. It fetches an available connector by ID. + * @summary Gets an available connector by ID. + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAvailableConnectorsById( + connectorId: string, + options?: any + ): AxiosPromise { + return localVarFp + .getAvailableConnectorsById(connectorId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectors(options?: any): AxiosPromise { + return localVarFp + .getConnectors(options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a connector by its ID. + * @summary Get connector by ID + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectorsById( + connectorId: string, + options?: any + ): AxiosPromise { + return localVarFp + .getConnectorsById(connectorId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Updates an existing connector by its ID. + * @summary Update connector + * @param {string} connectorId The ID of the connector. + * @param {PatchConnectorRequest} [patchConnectorRequest] PatchConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchConnectors( + connectorId: string, + patchConnectorRequest?: PatchConnectorRequest, + options?: any + ): AxiosPromise { + return localVarFp + .patchConnectors(connectorId, patchConnectorRequest, options) + .then((request) => request(axios, basePath)); + }, + /** + * Creates a new connector. + * @summary Create connector + * @param {ConnectorsCreationRequest} [connectorsCreationRequest] PostConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnectors( + connectorsCreationRequest?: ConnectorsCreationRequest, + options?: any + ): AxiosPromise { + return localVarFp + .postConnectors(connectorsCreationRequest, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ConnectorsApi - object-oriented interface + * @export + * @class ConnectorsApi + * @extends {BaseAPI} + */ +export class ConnectorsApi extends BaseAPI { + /** + * Used to delete a connector. + * @summary Delete connector + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public deleteConnectors( + connectorId: string, + options?: RawAxiosRequestConfig + ) { + return ConnectorsApiFp(this.configuration) + .deleteConnectors(connectorId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * This is a consumer facing connector endpoint. It fetches list of available Connectors. + * @summary Lists available connectors. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public getAvailableConnectors(options?: RawAxiosRequestConfig) { + return ConnectorsApiFp(this.configuration) + .getAvailableConnectors(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * This is a consumer facing connector endpoint. It fetches an available connector by ID. + * @summary Gets an available connector by ID. + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public getAvailableConnectorsById( + connectorId: string, + options?: RawAxiosRequestConfig + ) { + return ConnectorsApiFp(this.configuration) + .getAvailableConnectorsById(connectorId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public getConnectors(options?: RawAxiosRequestConfig) { + return ConnectorsApiFp(this.configuration) + .getConnectors(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a connector by its ID. + * @summary Get connector by ID + * @param {string} connectorId The ID of the connector. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public getConnectorsById( + connectorId: string, + options?: RawAxiosRequestConfig + ) { + return ConnectorsApiFp(this.configuration) + .getConnectorsById(connectorId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates an existing connector by its ID. + * @summary Update connector + * @param {string} connectorId The ID of the connector. + * @param {PatchConnectorRequest} [patchConnectorRequest] PatchConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public patchConnectors( + connectorId: string, + patchConnectorRequest?: PatchConnectorRequest, + options?: RawAxiosRequestConfig + ) { + return ConnectorsApiFp(this.configuration) + .patchConnectors(connectorId, patchConnectorRequest, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates a new connector. + * @summary Create connector + * @param {ConnectorsCreationRequest} [connectorsCreationRequest] PostConnectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConnectorsApi + */ + public postConnectors( + connectorsCreationRequest?: ConnectorsCreationRequest, + options?: RawAxiosRequestConfig + ) { + return ConnectorsApiFp(this.configuration) + .postConnectors(connectorsCreationRequest, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * CorsApi - axios parameter creator + * @export + */ +export const CorsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} connectorId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsDeleteConnectors: async ( + connectorId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectorId' is not null or undefined + assertParamExists('corsDeleteConnectors', 'connectorId', connectorId); + const localVarPath = `/v1/connectors/{connectorId}`.replace( + `{${'connectorId'}}`, + encodeURIComponent(String(connectorId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsGetActiveConnections: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/active-connections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsGetActiveConnectionsTemp: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/temp-active-connections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsGetAvailableConnectors: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/available-connectors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsPostConnection: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/connections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsPostConnectionTemp: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/connections-temp`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * CorsApi - functional programming interface + * @export + */ +export const CorsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = CorsApiAxiosParamCreator(configuration); + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} connectorId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsDeleteConnectors( + connectorId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsDeleteConnectors( + connectorId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsDeleteConnectors']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsGetActiveConnections( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsGetActiveConnections(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsGetActiveConnections']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsGetActiveConnectionsTemp( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsGetActiveConnectionsTemp(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsGetActiveConnectionsTemp']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsGetAvailableConnectors( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsGetAvailableConnectors(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsGetAvailableConnectors']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsPostConnection( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsPostConnection(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsPostConnection']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsPostConnectionTemp( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsPostConnectionTemp(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsPostConnectionTemp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * CorsApi - factory interface + * @export + */ +export const CorsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = CorsApiFp(configuration); + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} connectorId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsDeleteConnectors( + connectorId: string, + options?: any + ): AxiosPromise { + return localVarFp + .corsDeleteConnectors(connectorId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsGetActiveConnections(options?: any): AxiosPromise { + return localVarFp + .corsGetActiveConnections(options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsGetActiveConnectionsTemp(options?: any): AxiosPromise { + return localVarFp + .corsGetActiveConnectionsTemp(options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsGetAvailableConnectors(options?: any): AxiosPromise { + return localVarFp + .corsGetAvailableConnectors(options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsPostConnection(options?: any): AxiosPromise { + return localVarFp + .corsPostConnection(options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsPostConnectionTemp(options?: any): AxiosPromise { + return localVarFp + .corsPostConnectionTemp(options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CorsApi - object-oriented interface + * @export + * @class CorsApi + * @extends {BaseAPI} + */ +export class CorsApi extends BaseAPI { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} connectorId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsDeleteConnectors( + connectorId: string, + options?: RawAxiosRequestConfig + ) { + return CorsApiFp(this.configuration) + .corsDeleteConnectors(connectorId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsGetActiveConnections(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsGetActiveConnections(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsGetActiveConnectionsTemp(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsGetActiveConnectionsTemp(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsGetAvailableConnectors(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsGetAvailableConnectors(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsPostConnection(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsPostConnection(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsPostConnectionTemp(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsPostConnectionTemp(options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * DataSourceConfigsApi - axios parameter creator + * @export + */ +export const DataSourceConfigsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Deletes an existing data source configuration. + * @summary Delete data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteDataSourceConfig: async ( + dataSourceConfigId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceConfigId' is not null or undefined + assertParamExists( + 'deleteDataSourceConfig', + 'dataSourceConfigId', + dataSourceConfigId + ); + const localVarPath = + `/v1/data-source-configs/{dataSourceConfigId}`.replace( + `{${'dataSourceConfigId'}}`, + encodeURIComponent(String(dataSourceConfigId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of available data source configurations. + * @summary List data source config + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSourceConfig: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/data-source-configs`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of available data source configurations. + * @summary gets a data-source-config by it\'s ID + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSourceConfigById: async ( + dataSourceConfigId: string, + validationResult?: boolean, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceConfigId' is not null or undefined + assertParamExists( + 'getDataSourceConfigById', + 'dataSourceConfigId', + dataSourceConfigId + ); + const localVarPath = + `/v1/data-source-configs/{dataSourceConfigId}`.replace( + `{${'dataSourceConfigId'}}`, + encodeURIComponent(String(dataSourceConfigId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (validationResult !== undefined) { + localVarQueryParameter['validationResult'] = validationResult; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the status of an existing data source config. + * @summary Update data source config status + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchStatusRequest} [dataSourceConfigPatchStatusRequest] PatchDataSourceConfigStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSourceConfigStatus: async ( + dataSourceConfigId: string, + dataSourceConfigPatchStatusRequest?: DataSourceConfigPatchStatusRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceConfigId' is not null or undefined + assertParamExists( + 'patchDataSourceConfigStatus', + 'dataSourceConfigId', + dataSourceConfigId + ); + const localVarPath = + `/v1/data-source-configs/{dataSourceConfigId}/status`.replace( + `{${'dataSourceConfigId'}}`, + encodeURIComponent(String(dataSourceConfigId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataSourceConfigPatchStatusRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the authentication configuration of an existing data source. + * @summary Update data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchRequest} [dataSourceConfigPatchRequest] PatchDataSourceConfigs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSourceConfigs: async ( + dataSourceConfigId: string, + dataSourceConfigPatchRequest?: DataSourceConfigPatchRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceConfigId' is not null or undefined + assertParamExists( + 'patchDataSourceConfigs', + 'dataSourceConfigId', + dataSourceConfigId + ); + const localVarPath = + `/v1/data-source-configs/{dataSourceConfigId}`.replace( + `{${'dataSourceConfigId'}}`, + encodeURIComponent(String(dataSourceConfigId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataSourceConfigPatchRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates a new data source configuration. + * @summary Create data source config + * @param {DataSourceConfig} [dataSourceConfig] PostDataSourceConfig + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postDataSourceConfig: async ( + dataSourceConfig?: DataSourceConfig, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/data-source-configs`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataSourceConfig, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * DataSourceConfigsApi - functional programming interface + * @export + */ +export const DataSourceConfigsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + DataSourceConfigsApiAxiosParamCreator(configuration); + return { + /** + * Deletes an existing data source configuration. + * @summary Delete data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteDataSourceConfig( + dataSourceConfigId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteDataSourceConfig( + dataSourceConfigId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourceConfigsApi.deleteDataSourceConfig']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of available data source configurations. + * @summary List data source config + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getDataSourceConfig( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getDataSourceConfig(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourceConfigsApi.getDataSourceConfig']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of available data source configurations. + * @summary gets a data-source-config by it\'s ID + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getDataSourceConfigById( + dataSourceConfigId: string, + validationResult?: boolean, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getDataSourceConfigById( + dataSourceConfigId, + validationResult, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourceConfigsApi.getDataSourceConfigById']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Updates the status of an existing data source config. + * @summary Update data source config status + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchStatusRequest} [dataSourceConfigPatchStatusRequest] PatchDataSourceConfigStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchDataSourceConfigStatus( + dataSourceConfigId: string, + dataSourceConfigPatchStatusRequest?: DataSourceConfigPatchStatusRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.patchDataSourceConfigStatus( + dataSourceConfigId, + dataSourceConfigPatchStatusRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap[ + 'DataSourceConfigsApi.patchDataSourceConfigStatus' + ]?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Updates the authentication configuration of an existing data source. + * @summary Update data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchRequest} [dataSourceConfigPatchRequest] PatchDataSourceConfigs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchDataSourceConfigs( + dataSourceConfigId: string, + dataSourceConfigPatchRequest?: DataSourceConfigPatchRequest, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.patchDataSourceConfigs( + dataSourceConfigId, + dataSourceConfigPatchRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourceConfigsApi.patchDataSourceConfigs']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Creates a new data source configuration. + * @summary Create data source config + * @param {DataSourceConfig} [dataSourceConfig] PostDataSourceConfig + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postDataSourceConfig( + dataSourceConfig?: DataSourceConfig, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.postDataSourceConfig( + dataSourceConfig, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourceConfigsApi.postDataSourceConfig']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * DataSourceConfigsApi - factory interface + * @export + */ +export const DataSourceConfigsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = DataSourceConfigsApiFp(configuration); + return { + /** + * Deletes an existing data source configuration. + * @summary Delete data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteDataSourceConfig( + dataSourceConfigId: string, + options?: any + ): AxiosPromise { + return localVarFp + .deleteDataSourceConfig(dataSourceConfigId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of available data source configurations. + * @summary List data source config + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSourceConfig(options?: any): AxiosPromise { + return localVarFp + .getDataSourceConfig(options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of available data source configurations. + * @summary gets a data-source-config by it\'s ID + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSourceConfigById( + dataSourceConfigId: string, + validationResult?: boolean, + options?: any + ): AxiosPromise { + return localVarFp + .getDataSourceConfigById(dataSourceConfigId, validationResult, options) + .then((request) => request(axios, basePath)); + }, + /** + * Updates the status of an existing data source config. + * @summary Update data source config status + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchStatusRequest} [dataSourceConfigPatchStatusRequest] PatchDataSourceConfigStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSourceConfigStatus( + dataSourceConfigId: string, + dataSourceConfigPatchStatusRequest?: DataSourceConfigPatchStatusRequest, + options?: any + ): AxiosPromise { + return localVarFp + .patchDataSourceConfigStatus( + dataSourceConfigId, + dataSourceConfigPatchStatusRequest, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Updates the authentication configuration of an existing data source. + * @summary Update data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchRequest} [dataSourceConfigPatchRequest] PatchDataSourceConfigs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSourceConfigs( + dataSourceConfigId: string, + dataSourceConfigPatchRequest?: DataSourceConfigPatchRequest, + options?: any + ): AxiosPromise { + return localVarFp + .patchDataSourceConfigs( + dataSourceConfigId, + dataSourceConfigPatchRequest, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Creates a new data source configuration. + * @summary Create data source config + * @param {DataSourceConfig} [dataSourceConfig] PostDataSourceConfig + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postDataSourceConfig( + dataSourceConfig?: DataSourceConfig, + options?: any + ): AxiosPromise { + return localVarFp + .postDataSourceConfig(dataSourceConfig, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DataSourceConfigsApi - object-oriented interface + * @export + * @class DataSourceConfigsApi + * @extends {BaseAPI} + */ +export class DataSourceConfigsApi extends BaseAPI { + /** + * Deletes an existing data source configuration. + * @summary Delete data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourceConfigsApi + */ + public deleteDataSourceConfig( + dataSourceConfigId: string, + options?: RawAxiosRequestConfig + ) { + return DataSourceConfigsApiFp(this.configuration) + .deleteDataSourceConfig(dataSourceConfigId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of available data source configurations. + * @summary List data source config + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourceConfigsApi + */ + public getDataSourceConfig(options?: RawAxiosRequestConfig) { + return DataSourceConfigsApiFp(this.configuration) + .getDataSourceConfig(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of available data source configurations. + * @summary gets a data-source-config by it\'s ID + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourceConfigsApi + */ + public getDataSourceConfigById( + dataSourceConfigId: string, + validationResult?: boolean, + options?: RawAxiosRequestConfig + ) { + return DataSourceConfigsApiFp(this.configuration) + .getDataSourceConfigById(dataSourceConfigId, validationResult, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the status of an existing data source config. + * @summary Update data source config status + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchStatusRequest} [dataSourceConfigPatchStatusRequest] PatchDataSourceConfigStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourceConfigsApi + */ + public patchDataSourceConfigStatus( + dataSourceConfigId: string, + dataSourceConfigPatchStatusRequest?: DataSourceConfigPatchStatusRequest, + options?: RawAxiosRequestConfig + ) { + return DataSourceConfigsApiFp(this.configuration) + .patchDataSourceConfigStatus( + dataSourceConfigId, + dataSourceConfigPatchStatusRequest, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the authentication configuration of an existing data source. + * @summary Update data source config + * @param {string} dataSourceConfigId The ID of the data source config. + * @param {DataSourceConfigPatchRequest} [dataSourceConfigPatchRequest] PatchDataSourceConfigs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourceConfigsApi + */ + public patchDataSourceConfigs( + dataSourceConfigId: string, + dataSourceConfigPatchRequest?: DataSourceConfigPatchRequest, + options?: RawAxiosRequestConfig + ) { + return DataSourceConfigsApiFp(this.configuration) + .patchDataSourceConfigs( + dataSourceConfigId, + dataSourceConfigPatchRequest, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates a new data source configuration. + * @summary Create data source config + * @param {DataSourceConfig} [dataSourceConfig] PostDataSourceConfig + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourceConfigsApi + */ + public postDataSourceConfig( + dataSourceConfig?: DataSourceConfig, + options?: RawAxiosRequestConfig + ) { + return DataSourceConfigsApiFp(this.configuration) + .postDataSourceConfig(dataSourceConfig, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * DataSourcesApi - axios parameter creator + * @export + */ +export const DataSourcesApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Deletes an existing data source. + * @summary Delete data source + * @param {string} dataSourceId The ID of the data source. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteDataSource: async ( + dataSourceId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceId' is not null or undefined + assertParamExists('deleteDataSource', 'dataSourceId', dataSourceId); + const localVarPath = `/v1/data-sources/{dataSourceId}`.replace( + `{${'dataSourceId'}}`, + encodeURIComponent(String(dataSourceId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of available data sources. + * @summary List data source + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSource: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/data-sources`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a data source by the ID passed + * @summary Gets a data source by it\'s ID + * @param {string} dataSourceId The ID of the data source. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSourceById: async ( + dataSourceId: string, + validationResult?: boolean, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceId' is not null or undefined + assertParamExists('getDataSourceById', 'dataSourceId', dataSourceId); + const localVarPath = `/v1/data-sources/{dataSourceId}`.replace( + `{${'dataSourceId'}}`, + encodeURIComponent(String(dataSourceId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (validationResult !== undefined) { + localVarQueryParameter['validationResult'] = validationResult; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the endpoint configuration of an existing datasource. + * @summary Update data source + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchRequest} [dataSourcePatchRequest] PatchDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSource: async ( + dataSourceId: string, + dataSourcePatchRequest?: DataSourcePatchRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceId' is not null or undefined + assertParamExists('patchDataSource', 'dataSourceId', dataSourceId); + const localVarPath = `/v1/data-sources/{dataSourceId}`.replace( + `{${'dataSourceId'}}`, + encodeURIComponent(String(dataSourceId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataSourcePatchRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the status of an existing data source. + * @summary Update data source status + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchStatusRequest} [dataSourcePatchStatusRequest] PatchDataSourceStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSourceStatus: async ( + dataSourceId: string, + dataSourcePatchStatusRequest?: DataSourcePatchStatusRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceId' is not null or undefined + assertParamExists('patchDataSourceStatus', 'dataSourceId', dataSourceId); + const localVarPath = `/v1/data-sources/{dataSourceId}/status`.replace( + `{${'dataSourceId'}}`, + encodeURIComponent(String(dataSourceId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataSourcePatchStatusRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates a new data source. + * @summary Create data source + * @param {DataSource} [dataSource] PostDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postDataSource: async ( + dataSource?: DataSource, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/data-sources`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + dataSource, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Adds a new transformation template to a data source. Template is a contributors-defined configuration object that describes how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * @summary Create data source transformation template + * @param {string} dataSourceId The ID of the datasource for the transformation template. + * @param {CreateTransformationTemplateRequest} [createTransformationTemplateRequest] PostDataSourceTransformationTemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postDataSourceTransformationTemplate: async ( + dataSourceId: string, + createTransformationTemplateRequest?: CreateTransformationTemplateRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'dataSourceId' is not null or undefined + assertParamExists( + 'postDataSourceTransformationTemplate', + 'dataSourceId', + dataSourceId + ); + const localVarPath = + `/v1/data-sources/{dataSourceId}/transformation-template`.replace( + `{${'dataSourceId'}}`, + encodeURIComponent(String(dataSourceId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + createTransformationTemplateRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * DataSourcesApi - functional programming interface + * @export + */ +export const DataSourcesApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + DataSourcesApiAxiosParamCreator(configuration); + return { + /** + * Deletes an existing data source. + * @summary Delete data source + * @param {string} dataSourceId The ID of the data source. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteDataSource( + dataSourceId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteDataSource(dataSourceId, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourcesApi.deleteDataSource']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of available data sources. + * @summary List data source + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getDataSource( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDataSource( + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourcesApi.getDataSource']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a data source by the ID passed + * @summary Gets a data source by it\'s ID + * @param {string} dataSourceId The ID of the data source. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getDataSourceById( + dataSourceId: string, + validationResult?: boolean, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getDataSourceById( + dataSourceId, + validationResult, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourcesApi.getDataSourceById']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Updates the endpoint configuration of an existing datasource. + * @summary Update data source + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchRequest} [dataSourcePatchRequest] PatchDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchDataSource( + dataSourceId: string, + dataSourcePatchRequest?: DataSourcePatchRequest, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchDataSource( + dataSourceId, + dataSourcePatchRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourcesApi.patchDataSource']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Updates the status of an existing data source. + * @summary Update data source status + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchStatusRequest} [dataSourcePatchStatusRequest] PatchDataSourceStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchDataSourceStatus( + dataSourceId: string, + dataSourcePatchStatusRequest?: DataSourcePatchStatusRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.patchDataSourceStatus( + dataSourceId, + dataSourcePatchStatusRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourcesApi.patchDataSourceStatus']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Creates a new data source. + * @summary Create data source + * @param {DataSource} [dataSource] PostDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postDataSource( + dataSource?: DataSource, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.postDataSource( + dataSource, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DataSourcesApi.postDataSource']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Adds a new transformation template to a data source. Template is a contributors-defined configuration object that describes how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * @summary Create data source transformation template + * @param {string} dataSourceId The ID of the datasource for the transformation template. + * @param {CreateTransformationTemplateRequest} [createTransformationTemplateRequest] PostDataSourceTransformationTemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postDataSourceTransformationTemplate( + dataSourceId: string, + createTransformationTemplateRequest?: CreateTransformationTemplateRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.postDataSourceTransformationTemplate( + dataSourceId, + createTransformationTemplateRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap[ + 'DataSourcesApi.postDataSourceTransformationTemplate' + ]?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * DataSourcesApi - factory interface + * @export + */ +export const DataSourcesApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = DataSourcesApiFp(configuration); + return { + /** + * Deletes an existing data source. + * @summary Delete data source + * @param {string} dataSourceId The ID of the data source. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteDataSource(dataSourceId: string, options?: any): AxiosPromise { + return localVarFp + .deleteDataSource(dataSourceId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of available data sources. + * @summary List data source + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSource(options?: any): AxiosPromise { + return localVarFp + .getDataSource(options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a data source by the ID passed + * @summary Gets a data source by it\'s ID + * @param {string} dataSourceId The ID of the data source. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getDataSourceById( + dataSourceId: string, + validationResult?: boolean, + options?: any + ): AxiosPromise { + return localVarFp + .getDataSourceById(dataSourceId, validationResult, options) + .then((request) => request(axios, basePath)); + }, + /** + * Updates the endpoint configuration of an existing datasource. + * @summary Update data source + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchRequest} [dataSourcePatchRequest] PatchDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSource( + dataSourceId: string, + dataSourcePatchRequest?: DataSourcePatchRequest, + options?: any + ): AxiosPromise { + return localVarFp + .patchDataSource(dataSourceId, dataSourcePatchRequest, options) + .then((request) => request(axios, basePath)); + }, + /** + * Updates the status of an existing data source. + * @summary Update data source status + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchStatusRequest} [dataSourcePatchStatusRequest] PatchDataSourceStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchDataSourceStatus( + dataSourceId: string, + dataSourcePatchStatusRequest?: DataSourcePatchStatusRequest, + options?: any + ): AxiosPromise { + return localVarFp + .patchDataSourceStatus( + dataSourceId, + dataSourcePatchStatusRequest, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Creates a new data source. + * @summary Create data source + * @param {DataSource} [dataSource] PostDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postDataSource( + dataSource?: DataSource, + options?: any + ): AxiosPromise { + return localVarFp + .postDataSource(dataSource, options) + .then((request) => request(axios, basePath)); + }, + /** + * Adds a new transformation template to a data source. Template is a contributors-defined configuration object that describes how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * @summary Create data source transformation template + * @param {string} dataSourceId The ID of the datasource for the transformation template. + * @param {CreateTransformationTemplateRequest} [createTransformationTemplateRequest] PostDataSourceTransformationTemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postDataSourceTransformationTemplate( + dataSourceId: string, + createTransformationTemplateRequest?: CreateTransformationTemplateRequest, + options?: any + ): AxiosPromise { + return localVarFp + .postDataSourceTransformationTemplate( + dataSourceId, + createTransformationTemplateRequest, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DataSourcesApi - object-oriented interface + * @export + * @class DataSourcesApi + * @extends {BaseAPI} + */ +export class DataSourcesApi extends BaseAPI { + /** + * Deletes an existing data source. + * @summary Delete data source + * @param {string} dataSourceId The ID of the data source. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public deleteDataSource( + dataSourceId: string, + options?: RawAxiosRequestConfig + ) { + return DataSourcesApiFp(this.configuration) + .deleteDataSource(dataSourceId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of available data sources. + * @summary List data source + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public getDataSource(options?: RawAxiosRequestConfig) { + return DataSourcesApiFp(this.configuration) + .getDataSource(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a data source by the ID passed + * @summary Gets a data source by it\'s ID + * @param {string} dataSourceId The ID of the data source. + * @param {boolean} [validationResult] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public getDataSourceById( + dataSourceId: string, + validationResult?: boolean, + options?: RawAxiosRequestConfig + ) { + return DataSourcesApiFp(this.configuration) + .getDataSourceById(dataSourceId, validationResult, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the endpoint configuration of an existing datasource. + * @summary Update data source + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchRequest} [dataSourcePatchRequest] PatchDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public patchDataSource( + dataSourceId: string, + dataSourcePatchRequest?: DataSourcePatchRequest, + options?: RawAxiosRequestConfig + ) { + return DataSourcesApiFp(this.configuration) + .patchDataSource(dataSourceId, dataSourcePatchRequest, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the status of an existing data source. + * @summary Update data source status + * @param {string} dataSourceId The ID of the data source. + * @param {DataSourcePatchStatusRequest} [dataSourcePatchStatusRequest] PatchDataSourceStatus + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public patchDataSourceStatus( + dataSourceId: string, + dataSourcePatchStatusRequest?: DataSourcePatchStatusRequest, + options?: RawAxiosRequestConfig + ) { + return DataSourcesApiFp(this.configuration) + .patchDataSourceStatus( + dataSourceId, + dataSourcePatchStatusRequest, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates a new data source. + * @summary Create data source + * @param {DataSource} [dataSource] PostDataSource + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public postDataSource( + dataSource?: DataSource, + options?: RawAxiosRequestConfig + ) { + return DataSourcesApiFp(this.configuration) + .postDataSource(dataSource, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds a new transformation template to a data source. Template is a contributors-defined configuration object that describes how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * @summary Create data source transformation template + * @param {string} dataSourceId The ID of the datasource for the transformation template. + * @param {CreateTransformationTemplateRequest} [createTransformationTemplateRequest] PostDataSourceTransformationTemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DataSourcesApi + */ + public postDataSourceTransformationTemplate( + dataSourceId: string, + createTransformationTemplateRequest?: CreateTransformationTemplateRequest, + options?: RawAxiosRequestConfig + ) { + return DataSourcesApiFp(this.configuration) + .postDataSourceTransformationTemplate( + dataSourceId, + createTransformationTemplateRequest, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * TempApi - axios parameter creator + * @export + */ +export const TempApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteConnectionTemp: async ( + connectionId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionId' is not null or undefined + assertParamExists('deleteConnectionTemp', 'connectionId', connectionId); + const localVarPath = `/v1/temp-connections/{connectionId}`.replace( + `{${'connectionId'}}`, + encodeURIComponent(String(connectionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + executeConnectionTemp: async ( + connectionId: string, + body: object | null, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionId' is not null or undefined + assertParamExists('executeConnectionTemp', 'connectionId', connectionId); + // verify required parameter 'body' is not null or undefined + assertParamExists('executeConnectionTemp', 'body', body); + const localVarPath = + `/v1/temp-connections/{connectionId}/execution-request`.replace( + `{${'connectionId'}}`, + encodeURIComponent(String(connectionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getActiveConnectionsTemp: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/temp-active-connections`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectorsTemp: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/temp-connectors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnectionTemp: async ( + connectionCreationRequest: ConnectionCreationRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'connectionCreationRequest' is not null or undefined + assertParamExists( + 'postConnectionTemp', + 'connectionCreationRequest', + connectionCreationRequest + ); + const localVarPath = `/v1/connections-temp`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + connectionCreationRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * TempApi - functional programming interface + * @export + */ +export const TempApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = TempApiAxiosParamCreator(configuration); + return { + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteConnectionTemp( + connectionId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteConnectionTemp( + connectionId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['TempApi.deleteConnectionTemp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async executeConnectionTemp( + connectionId: string, + body: object | null, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.executeConnectionTemp( + connectionId, + body, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['TempApi.executeConnectionTemp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getActiveConnectionsTemp( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getActiveConnectionsTemp(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['TempApi.getActiveConnectionsTemp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getConnectorsTemp( + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getConnectorsTemp(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['TempApi.getConnectorsTemp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postConnectionTemp( + connectionCreationRequest: ConnectionCreationRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.postConnectionTemp( + connectionCreationRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['TempApi.postConnectionTemp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * TempApi - factory interface + * @export + */ +export const TempApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = TempApiFp(configuration); + return { + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteConnectionTemp( + connectionId: string, + options?: any + ): AxiosPromise { + return localVarFp + .deleteConnectionTemp(connectionId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + executeConnectionTemp( + connectionId: string, + body: object | null, + options?: any + ): AxiosPromise { + return localVarFp + .executeConnectionTemp(connectionId, body, options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getActiveConnectionsTemp( + options?: any + ): AxiosPromise { + return localVarFp + .getActiveConnectionsTemp(options) + .then((request) => request(axios, basePath)); + }, + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getConnectorsTemp(options?: any): AxiosPromise { + return localVarFp + .getConnectorsTemp(options) + .then((request) => request(axios, basePath)); + }, + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postConnectionTemp( + connectionCreationRequest: ConnectionCreationRequest, + options?: any + ): AxiosPromise { + return localVarFp + .postConnectionTemp(connectionCreationRequest, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * TempApi - object-oriented interface + * @export + * @class TempApi + * @extends {BaseAPI} + */ +export class TempApi extends BaseAPI { + /** + * Deactivates a connection. + * @summary Delete connection + * @param {string} connectionId The ID of the connection to be deleted. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TempApi + */ + public deleteConnectionTemp( + connectionId: string, + options?: RawAxiosRequestConfig + ) { + return TempApiFp(this.configuration) + .deleteConnectionTemp(connectionId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Executes a user connection on a connection. + * @summary Create execution request + * @param {string} connectionId The ID of the connection. + * @param {object | null} body ExecuteConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TempApi + */ + public executeConnectionTemp( + connectionId: string, + body: object | null, + options?: RawAxiosRequestConfig + ) { + return TempApiFp(this.configuration) + .executeConnectionTemp(connectionId, body, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of active user connections + * @summary List active connections + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TempApi + */ + public getActiveConnectionsTemp(options?: RawAxiosRequestConfig) { + return TempApiFp(this.configuration) + .getActiveConnectionsTemp(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetches a list of all connectors. + * @summary List connectors + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TempApi + */ + public getConnectorsTemp(options?: RawAxiosRequestConfig) { + return TempApiFp(this.configuration) + .getConnectorsTemp(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates a new user connection. + * @summary Create connection + * @param {ConnectionCreationRequest} connectionCreationRequest PostConnection + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TempApi + */ + public postConnectionTemp( + connectionCreationRequest: ConnectionCreationRequest, + options?: RawAxiosRequestConfig + ) { + return TempApiFp(this.configuration) + .postConnectionTemp(connectionCreationRequest, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/packages/sdk-client-dcf/base.ts b/packages/sdk-client-dcf/base.ts new file mode 100644 index 00000000..2cf990cf --- /dev/null +++ b/packages/sdk-client-dcf/base.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * DcfOrchestrator + * # Affinidi Data Connector Framework (DCF) Affinidi DCF is a developer/contributor-focused suite of tools that enables contributors to configure, create, validate and manage data connectors for public consumption. This involves configuring connections to a third party data source and configuring transformation mapping from the data source to a target, “canonical” schema. After setup, DCF validates the configuration of the data connectors and transformation mapping. Following successful validation, created connectors are published. The Affinidi DCF Orchestrator API covers every step of the data ingestion process, enabling builders to onboard new third-party services as connectors, create authenticated user connections, and pull data to be streamed to Affinidi Vault. It provides a standardized approach to interact with REST APIs, which is also configuration-driven, allowing builders to easily customise the connector\'s behaviour by modifying configuration files. The DCF Orchestrator API is organised around three main concepts: Data Source & Configuration, Connector, and User Connection. Below you will find a brief explanation of these and other useful terms: *Data Source & Configuration* Data Sources represent the third-party service API in our framework. They consist of two entities: the details on how to authenticate with the third-party service are mapped to DataSourceConfig, while the service’s endpoints and data transformation templates are mapped to DataSource . Builders can list available DataSourceConfigs and DataSources, create new ones and modify them using our API. *Connector* This is the building block of our framework. It brings together a Data Source and its Configuration with the builder credentials necessary for connections to be made, for example client ID or client secret. Our endpoints allow builders to list available Connectors, create new ones and modify them. *User Connection* A user connection is created each time an end user authenticates with a data source via DCF. It holds user specific information relative to a connector and application, including credentials. Our API enables builders to list, create and delete available Connections as well as to execute them to pull data. *Templates* Builder-defined configuration objects that describe how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: robert.k@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = 'RequiredError'; + } +} + +interface ServerMap { + [key: string]: { + url: string; + description: string; + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {}; diff --git a/packages/sdk-client-dcf/common.ts b/packages/sdk-client-dcf/common.ts new file mode 100644 index 00000000..6cd8b3ac --- /dev/null +++ b/packages/sdk-client-dcf/common.ts @@ -0,0 +1,203 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * DcfOrchestrator + * # Affinidi Data Connector Framework (DCF) Affinidi DCF is a developer/contributor-focused suite of tools that enables contributors to configure, create, validate and manage data connectors for public consumption. This involves configuring connections to a third party data source and configuring transformation mapping from the data source to a target, “canonical” schema. After setup, DCF validates the configuration of the data connectors and transformation mapping. Following successful validation, created connectors are published. The Affinidi DCF Orchestrator API covers every step of the data ingestion process, enabling builders to onboard new third-party services as connectors, create authenticated user connections, and pull data to be streamed to Affinidi Vault. It provides a standardized approach to interact with REST APIs, which is also configuration-driven, allowing builders to easily customise the connector\'s behaviour by modifying configuration files. The DCF Orchestrator API is organised around three main concepts: Data Source & Configuration, Connector, and User Connection. Below you will find a brief explanation of these and other useful terms: *Data Source & Configuration* Data Sources represent the third-party service API in our framework. They consist of two entities: the details on how to authenticate with the third-party service are mapped to DataSourceConfig, while the service’s endpoints and data transformation templates are mapped to DataSource . Builders can list available DataSourceConfigs and DataSources, create new ones and modify them using our API. *Connector* This is the building block of our framework. It brings together a Data Source and its Configuration with the builder credentials necessary for connections to be made, for example client ID or client secret. Our endpoints allow builders to list available Connectors, create new ones and modify them. *User Connection* A user connection is created each time an end user authenticates with a data source via DCF. It holds user specific information relative to a connector and application, including credentials. Our API enables builders to list, create and delete available Connections as well as to execute them to pull data. *Templates* Builder-defined configuration objects that describe how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: robert.k@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { RequestArgs } from './base'; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from './base'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com'; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.` + ); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration +) { + if (configuration && (configuration.username || configuration.password)) { + object['auth'] = { + username: configuration.username, + password: configuration.password, + }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = '' +): void { + if (parameter == null) return; + if (typeof parameter === 'object') { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key) + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== '' ? '.' : ''}${currentKey}` + ) + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration +) { + const nonString = typeof value !== 'string'; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ''; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + + axiosArgs.url, + }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/packages/sdk-client-dcf/configuration.ts b/packages/sdk-client-dcf/configuration.ts new file mode 100644 index 00000000..ae802f67 --- /dev/null +++ b/packages/sdk-client-dcf/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * DcfOrchestrator + * # Affinidi Data Connector Framework (DCF) Affinidi DCF is a developer/contributor-focused suite of tools that enables contributors to configure, create, validate and manage data connectors for public consumption. This involves configuring connections to a third party data source and configuring transformation mapping from the data source to a target, “canonical” schema. After setup, DCF validates the configuration of the data connectors and transformation mapping. Following successful validation, created connectors are published. The Affinidi DCF Orchestrator API covers every step of the data ingestion process, enabling builders to onboard new third-party services as connectors, create authenticated user connections, and pull data to be streamed to Affinidi Vault. It provides a standardized approach to interact with REST APIs, which is also configuration-driven, allowing builders to easily customise the connector\'s behaviour by modifying configuration files. The DCF Orchestrator API is organised around three main concepts: Data Source & Configuration, Connector, and User Connection. Below you will find a brief explanation of these and other useful terms: *Data Source & Configuration* Data Sources represent the third-party service API in our framework. They consist of two entities: the details on how to authenticate with the third-party service are mapped to DataSourceConfig, while the service’s endpoints and data transformation templates are mapped to DataSource . Builders can list available DataSourceConfigs and DataSources, create new ones and modify them using our API. *Connector* This is the building block of our framework. It brings together a Data Source and its Configuration with the builder credentials necessary for connections to be made, for example client ID or client secret. Our endpoints allow builders to list available Connectors, create new ones and modify them. *User Connection* A user connection is created each time an end user authenticates with a data source via DCF. It holds user specific information relative to a connector and application, including credentials. Our API enables builders to list, create and delete available Connections as well as to execute them to pull data. *Templates* Builder-defined configuration objects that describe how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: robert.k@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i' + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } +} diff --git a/packages/sdk-client-dcf/git_push.sh b/packages/sdk-client-dcf/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/packages/sdk-client-dcf/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/sdk-client-dcf/index.ts b/packages/sdk-client-dcf/index.ts new file mode 100644 index 00000000..ec663c84 --- /dev/null +++ b/packages/sdk-client-dcf/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * DcfOrchestrator + * # Affinidi Data Connector Framework (DCF) Affinidi DCF is a developer/contributor-focused suite of tools that enables contributors to configure, create, validate and manage data connectors for public consumption. This involves configuring connections to a third party data source and configuring transformation mapping from the data source to a target, “canonical” schema. After setup, DCF validates the configuration of the data connectors and transformation mapping. Following successful validation, created connectors are published. The Affinidi DCF Orchestrator API covers every step of the data ingestion process, enabling builders to onboard new third-party services as connectors, create authenticated user connections, and pull data to be streamed to Affinidi Vault. It provides a standardized approach to interact with REST APIs, which is also configuration-driven, allowing builders to easily customise the connector\'s behaviour by modifying configuration files. The DCF Orchestrator API is organised around three main concepts: Data Source & Configuration, Connector, and User Connection. Below you will find a brief explanation of these and other useful terms: *Data Source & Configuration* Data Sources represent the third-party service API in our framework. They consist of two entities: the details on how to authenticate with the third-party service are mapped to DataSourceConfig, while the service’s endpoints and data transformation templates are mapped to DataSource . Builders can list available DataSourceConfigs and DataSources, create new ones and modify them using our API. *Connector* This is the building block of our framework. It brings together a Data Source and its Configuration with the builder credentials necessary for connections to be made, for example client ID or client secret. Our endpoints allow builders to list available Connectors, create new ones and modify them. *User Connection* A user connection is created each time an end user authenticates with a data source via DCF. It holds user specific information relative to a connector and application, including credentials. Our API enables builders to list, create and delete available Connections as well as to execute them to pull data. *Templates* Builder-defined configuration objects that describe how to interact with a specific third-party service\'s API, allowing developers to easily connect to and interact with a variety of sources, as well as customising the connector\'s behaviour. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: robert.k@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/packages/sdk-client-dcf/package.json b/packages/sdk-client-dcf/package.json new file mode 100644 index 00000000..c51970f9 --- /dev/null +++ b/packages/sdk-client-dcf/package.json @@ -0,0 +1,37 @@ +{ + "name": "@affinidi/test-sdk-client-dcf", + "version": "1.0.0", + "description": "OpenAPI client for @affinidi/test-sdk-client-dcf main", + "author": "Affinidi", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "affinidi-sdk", + "identity", + "holistic", + "network", + "openapi-client", + "openapi-generator", + "@affinidi/test-sdk-client-dcf" + ], + "license": "Apache-2.0", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "eslint . --ext .ts", + "prepare": "npm run build" + }, + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } +} diff --git a/packages/sdk-client-dcf/project.json b/packages/sdk-client-dcf/project.json new file mode 100644 index 00000000..f5ccfacc --- /dev/null +++ b/packages/sdk-client-dcf/project.json @@ -0,0 +1,41 @@ +{ + "name": "@affinidi/test-sdk-client-dcf", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/client-iam", + "projectType": "library", + "private": false, + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/packages/test-sdk-client-dcf", + "main": "packages/test-sdk-client-dcf/index.ts", + "tsConfig": "packages/test-sdk-client-dcf/tsconfig.lib.json", + "assets": ["packages/test-sdk-client-dcf/*.md"] + } + }, + "lint": { + "executor": "@nx/eslint:lint" + }, + "semantic-release": { + "executor": "@theunderscorer/nx-semantic-release:semantic-release", + "options": { + "changelog": true, + "github": true, + "npm": true, + "repositoryUrl": "git@github.com:affinidi/sdk.git", + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/npm", + { + "npmPublish": true + } + ] + ] + } + } + }, + "tags": [] +} diff --git a/packages/sdk-client-dcf/tsconfig.esm.json b/packages/sdk-client-dcf/tsconfig.esm.json new file mode 100644 index 00000000..2c0331cc --- /dev/null +++ b/packages/sdk-client-dcf/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/packages/sdk-client-dcf/tsconfig.json b/packages/sdk-client-dcf/tsconfig.json new file mode 100644 index 00000000..bab039be --- /dev/null +++ b/packages/sdk-client-dcf/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "ES6", + "module": "commonjs", + "noImplicitAny": true, + "esModuleInterop": true, + "outDir": "dist", + "rootDir": ".", + "moduleResolution": "node" + }, + "exclude": ["dist", "node_modules"] +} diff --git a/packages/sdk-client-iam/CHANGELOG.md b/packages/sdk-client-iam/CHANGELOG.md deleted file mode 100644 index ddb5a462..00000000 --- a/packages/sdk-client-iam/CHANGELOG.md +++ /dev/null @@ -1,44 +0,0 @@ -## [1.3.1](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-iam-v1.3.0...@affinidi/test-sdk-client-iam-v1.3.1) (2024-02-12) - - -### Bug Fixes - -* upgrade lock ([48d4381](https://github.com/affinidi/sdk/commit/48d4381997af25830e261bd6eadff1803acf0094)) - -# [1.3.0](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-iam-v1.2.1...@affinidi/test-sdk-client-iam-v1.3.0) (2024-02-12) - - -### Features - -* update client kms ([#27](https://github.com/affinidi/sdk/issues/27)) ([255df40](https://github.com/affinidi/sdk/commit/255df40f4be3e3a0fe6a1703f8ff5947b04869d7)) - -## [1.2.1](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-iam-v1.2.0...@affinidi/test-sdk-client-iam-v1.2.1) (2024-02-12) - - -### Bug Fixes - -* disalbe publishing for now ([b3f18c0](https://github.com/affinidi/sdk/commit/b3f18c0387b654e12bb93e05e3848e4fa8ea3995)) - -# [1.2.0](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-iam-v1.1.0...@affinidi/test-sdk-client-iam-v1.2.0) (2024-02-07) - - -### Bug Fixes - -* fix fix ([e5fb857](https://github.com/affinidi/sdk/commit/e5fb85735d2f1b5f1d038a7f9248bc00d0bf109c)) - - -### Features - -* update client kms ([#25](https://github.com/affinidi/sdk/issues/25)) ([fb9b966](https://github.com/affinidi/sdk/commit/fb9b966b1e0f278f5f673ba78c8f270606ad7398)) - -# [1.1.0](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-iam-v1.0.4...@affinidi/test-sdk-client-iam-v1.1.0) (2024-02-07) - - -### Bug Fixes - -* unprivate ([3ed123f](https://github.com/affinidi/sdk/commit/3ed123f615e6c59f55fb8abbd6de258da200caa0)) - - -### Features - -* update client iam ([#23](https://github.com/affinidi/sdk/issues/23)) ([66a0010](https://github.com/affinidi/sdk/commit/66a001014dea0d582512cd5d005da1e49438a165)) diff --git a/packages/sdk-client-iam/api.ts b/packages/sdk-client-iam/api.ts index 5533798e..83793664 100644 --- a/packages/sdk-client-iam/api.ts +++ b/packages/sdk-client-iam/api.ts @@ -10,7 +10,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * FIXI IXI */ import type { Configuration } from './configuration'; diff --git a/packages/sdk-client-iam/package.json b/packages/sdk-client-iam/package.json index 4fe269d1..89eef7e8 100644 --- a/packages/sdk-client-iam/package.json +++ b/packages/sdk-client-iam/package.json @@ -1,6 +1,6 @@ { "name": "@affinidi/test-sdk-client-iam", - "version": "1.3.1", + "version": "1.0.0", "description": "OpenAPI client for @affinidi/test-sdk-client-iam main", "author": "Affinidi", "repository": { @@ -16,7 +16,7 @@ "openapi-generator", "@affinidi/test-sdk-client-iam" ], - "license": "Unlicense", + "license": "Apache-2.0", "main": "./dist/index.js", "typings": "./dist/index.d.ts", "module": "./dist/esm/index.js", diff --git a/packages/sdk-client-iam/project.json b/packages/sdk-client-iam/project.json index 84329615..b7b8239c 100644 --- a/packages/sdk-client-iam/project.json +++ b/packages/sdk-client-iam/project.json @@ -3,6 +3,7 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/client-iam", "projectType": "library", + "private": false, "targets": { "build": { "executor": "@nx/js:tsc", diff --git a/packages/sdk-client-kms/CHANGELOG.md b/packages/sdk-client-kms/CHANGELOG.md deleted file mode 100644 index 20ed8cc7..00000000 --- a/packages/sdk-client-kms/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -## [1.3.1](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-kms-v1.3.0...@affinidi/test-sdk-client-kms-v1.3.1) (2024-02-12) - - -### Bug Fixes - -* upgrade lock ([48d4381](https://github.com/affinidi/sdk/commit/48d4381997af25830e261bd6eadff1803acf0094)) - -# [1.3.0](https://github.com/affinidi/sdk/compare/@affinidi/test-sdk-client-kms-v1.2.1...@affinidi/test-sdk-client-kms-v1.3.0) (2024-02-12) - - -### Features - -* update client kms ([#27](https://github.com/affinidi/sdk/issues/27)) ([255df40](https://github.com/affinidi/sdk/commit/255df40f4be3e3a0fe6a1703f8ff5947b04869d7)) diff --git a/packages/sdk-client-kms/package.json b/packages/sdk-client-kms/package.json index b2082168..3da399ed 100644 --- a/packages/sdk-client-kms/package.json +++ b/packages/sdk-client-kms/package.json @@ -1,6 +1,6 @@ { "name": "@affinidi/test-sdk-client-kms", - "version": "1.3.1", + "version": "1.0.0", "description": "OpenAPI client for @affinidi/test-sdk-client-kms main", "author": "Affinidi", "repository": { @@ -16,7 +16,7 @@ "openapi-generator", "@affinidi/test-sdk-client-kms" ], - "license": "Unlicense", + "license": "Apache-2.0", "main": "./dist/index.js", "typings": "./dist/index.d.ts", "module": "./dist/esm/index.js", diff --git a/packages/sdk-client-kyc/.gitignore b/packages/sdk-client-kyc/.gitignore new file mode 100644 index 00000000..eb42e83e --- /dev/null +++ b/packages/sdk-client-kyc/.gitignore @@ -0,0 +1,37 @@ +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings +wwwroot/*.js +dist + +# System Files +.DS_Store +Thumbs.db + +# other +.env +.env.production +.npmrc +.nyc_output +coverage diff --git a/packages/sdk-client-kyc/.npmignore b/packages/sdk-client-kyc/.npmignore new file mode 100644 index 00000000..40886a38 --- /dev/null +++ b/packages/sdk-client-kyc/.npmignore @@ -0,0 +1,10 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm + +node_modules +coverage +.vscode +.DS_Store +.nyc_output +.history +.idea +Thumbs.db diff --git a/packages/sdk-client-kyc/.openapi-generator-ignore b/packages/sdk-client-kyc/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/packages/sdk-client-kyc/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/packages/sdk-client-kyc/.openapi-generator/FILES b/packages/sdk-client-kyc/.openapi-generator/FILES new file mode 100644 index 00000000..909a3223 --- /dev/null +++ b/packages/sdk-client-kyc/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +.npmignore +.openapi-generator-ignore +README.md +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +package.json +project.json +tsconfig.esm.json +tsconfig.json diff --git a/packages/sdk-client-kyc/.openapi-generator/VERSION b/packages/sdk-client-kyc/.openapi-generator/VERSION new file mode 100644 index 00000000..4b49d9bb --- /dev/null +++ b/packages/sdk-client-kyc/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/packages/sdk-client-kyc/README.md b/packages/sdk-client-kyc/README.md new file mode 100644 index 00000000..3da46f81 --- /dev/null +++ b/packages/sdk-client-kyc/README.md @@ -0,0 +1,53 @@ +## @affinidi/test-sdk-client-kyc + +### Usage + +```bash +npm install @affinidi/test-sdk-client-kyc --save +``` + +#### With PAT + +To call service methods with personal access token, you need to get a getProjectScopedToken for the machine user: + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-kyc'; +import { authProvider } from '@affinidi/test-auth-provider'; + +const projectScopedToken = await authProvider.getProjectScopedToken({ + apiGatewayUrl, + projectId, + machineUserId, + tokenEndpoint, + privateKey, + passphrase, + keyId, + publicKey, +}); + +const api = new SomeClassApi( + new Configuration({ + apiKey: projectScopedToken, + basePath: `${apiGatewayUrl}/kyc`, + }) +); + +await api.oneOfMethods(); +``` + +#### With session ID via BFF + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-kyc'; +import { getBffHeaders } from '@affinidi/test-auth-provider'; + +const headers = getBffHeaders(cookieName, sessionId); + +const baseOptions = { headers }; + +const api = new SomeClassApi( + new Configuration({ basePath: `${bffHost}/kyc`, baseOptions }) +); + +await api.oneOfMethods(); +``` diff --git a/packages/sdk-client-kyc/api.ts b/packages/sdk-client-kyc/api.ts new file mode 100644 index 00000000..64c32bd9 --- /dev/null +++ b/packages/sdk-client-kyc/api.ts @@ -0,0 +1,1063 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * KnowYourCustomer + * Affinidi KnowYourCustomer Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: consumer-eng@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from './base'; + +/** + * + * @export + * @interface CodeMismatchExceptionError + */ +export interface CodeMismatchExceptionError { + /** + * + * @type {string} + * @memberof CodeMismatchExceptionError + */ + name: CodeMismatchExceptionErrorNameEnum; + /** + * + * @type {string} + * @memberof CodeMismatchExceptionError + */ + message: CodeMismatchExceptionErrorMessageEnum; + /** + * + * @type {number} + * @memberof CodeMismatchExceptionError + */ + httpStatusCode: CodeMismatchExceptionErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof CodeMismatchExceptionError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof CodeMismatchExceptionError + */ + details?: Array; +} + +export const CodeMismatchExceptionErrorNameEnum = { + CodeMismatchExceptionError: 'CodeMismatchExceptionError', +} as const; + +export type CodeMismatchExceptionErrorNameEnum = + (typeof CodeMismatchExceptionErrorNameEnum)[keyof typeof CodeMismatchExceptionErrorNameEnum]; +export const CodeMismatchExceptionErrorMessageEnum = { + InvalidCode: 'Invalid code', +} as const; + +export type CodeMismatchExceptionErrorMessageEnum = + (typeof CodeMismatchExceptionErrorMessageEnum)[keyof typeof CodeMismatchExceptionErrorMessageEnum]; +export const CodeMismatchExceptionErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type CodeMismatchExceptionErrorHttpStatusCodeEnum = + (typeof CodeMismatchExceptionErrorHttpStatusCodeEnum)[keyof typeof CodeMismatchExceptionErrorHttpStatusCodeEnum]; + +/** + * @type CompleteOtpOperation400Response + * @export + */ +export type CompleteOtpOperation400Response = + | CodeMismatchExceptionError + | ExpiredCodeExceptionError; + +/** + * completeOtp operation request + * @export + * @interface CompleteRequest + */ +export interface CompleteRequest { + /** + * + * @type {string} + * @memberof CompleteRequest + */ + email: string; + /** + * + * @type {string} + * @memberof CompleteRequest + */ + did: string; + /** + * + * @type {string} + * @memberof CompleteRequest + */ + confirmationCode: string; +} +/** + * + * @export + * @interface CompleteResponse + */ +export interface CompleteResponse { + /** + * + * @type {object} + * @memberof CompleteResponse + */ + emailVc?: object; +} +/** + * + * @export + * @interface ExpiredCodeExceptionError + */ +export interface ExpiredCodeExceptionError { + /** + * + * @type {string} + * @memberof ExpiredCodeExceptionError + */ + name: ExpiredCodeExceptionErrorNameEnum; + /** + * + * @type {string} + * @memberof ExpiredCodeExceptionError + */ + message: ExpiredCodeExceptionErrorMessageEnum; + /** + * + * @type {number} + * @memberof ExpiredCodeExceptionError + */ + httpStatusCode: ExpiredCodeExceptionErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof ExpiredCodeExceptionError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof ExpiredCodeExceptionError + */ + details?: Array; +} + +export const ExpiredCodeExceptionErrorNameEnum = { + ExpiredCodeExceptionError: 'ExpiredCodeExceptionError', +} as const; + +export type ExpiredCodeExceptionErrorNameEnum = + (typeof ExpiredCodeExceptionErrorNameEnum)[keyof typeof ExpiredCodeExceptionErrorNameEnum]; +export const ExpiredCodeExceptionErrorMessageEnum = { + CodeHasExpired: 'Code has expired', +} as const; + +export type ExpiredCodeExceptionErrorMessageEnum = + (typeof ExpiredCodeExceptionErrorMessageEnum)[keyof typeof ExpiredCodeExceptionErrorMessageEnum]; +export const ExpiredCodeExceptionErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type ExpiredCodeExceptionErrorHttpStatusCodeEnum = + (typeof ExpiredCodeExceptionErrorHttpStatusCodeEnum)[keyof typeof ExpiredCodeExceptionErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface InitiateRequest + */ +export interface InitiateRequest { + /** + * + * @type {string} + * @memberof InitiateRequest + */ + email: string; +} +/** + * initiateOtp operation response + * @export + * @interface InitiateResponse + */ +export interface InitiateResponse { + /** + * + * @type {string} + * @memberof InitiateResponse + */ + message?: string; +} +/** + * Thrown if for the specified endpoint count of calls exceeds the limit + * @export + * @interface RateLimitExceededError + */ +export interface RateLimitExceededError { + /** + * + * @type {string} + * @memberof RateLimitExceededError + */ + name: RateLimitExceededErrorNameEnum; + /** + * + * @type {string} + * @memberof RateLimitExceededError + */ + message: RateLimitExceededErrorMessageEnum; + /** + * + * @type {number} + * @memberof RateLimitExceededError + */ + httpStatusCode: RateLimitExceededErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof RateLimitExceededError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof RateLimitExceededError + */ + details?: Array; +} + +export const RateLimitExceededErrorNameEnum = { + RateLimitExceededError: 'RateLimitExceededError', +} as const; + +export type RateLimitExceededErrorNameEnum = + (typeof RateLimitExceededErrorNameEnum)[keyof typeof RateLimitExceededErrorNameEnum]; +export const RateLimitExceededErrorMessageEnum = { + RateLimitExceededParam: 'Rate limit exceeded: ${param}.', +} as const; + +export type RateLimitExceededErrorMessageEnum = + (typeof RateLimitExceededErrorMessageEnum)[keyof typeof RateLimitExceededErrorMessageEnum]; +export const RateLimitExceededErrorHttpStatusCodeEnum = { + NUMBER_429: 429, +} as const; + +export type RateLimitExceededErrorHttpStatusCodeEnum = + (typeof RateLimitExceededErrorHttpStatusCodeEnum)[keyof typeof RateLimitExceededErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface RateLimitExceededErrorDetailsInner + */ +export interface RateLimitExceededErrorDetailsInner { + /** + * + * @type {string} + * @memberof RateLimitExceededErrorDetailsInner + */ + issue: string; + /** + * + * @type {string} + * @memberof RateLimitExceededErrorDetailsInner + */ + field?: string; + /** + * + * @type {string} + * @memberof RateLimitExceededErrorDetailsInner + */ + value?: string; + /** + * + * @type {string} + * @memberof RateLimitExceededErrorDetailsInner + */ + location?: string; +} +/** + * + * @export + * @interface ServiceErrorResponse + */ +export interface ServiceErrorResponse { + /** + * unique id for correlating this specific error to logs + * @type {string} + * @memberof ServiceErrorResponse + */ + traceId: string; + /** + * name of the error + * @type {string} + * @memberof ServiceErrorResponse + */ + name: string; + /** + * backwards compatible Affinidi error code + * @type {string} + * @memberof ServiceErrorResponse + */ + code: string; + /** + * + * @type {Array} + * @memberof ServiceErrorResponse + */ + details?: Array; +} +/** + * + * @export + * @interface ServiceErrorResponseDetailsInner + */ +export interface ServiceErrorResponseDetailsInner { + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + issue: string; + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + field?: string; + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + value?: string; + /** + * + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + location?: ServiceErrorResponseDetailsInnerLocationEnum; +} + +export const ServiceErrorResponseDetailsInnerLocationEnum = { + Body: 'BODY', + Path: 'PATH', + Query: 'QUERY', +} as const; + +export type ServiceErrorResponseDetailsInnerLocationEnum = + (typeof ServiceErrorResponseDetailsInnerLocationEnum)[keyof typeof ServiceErrorResponseDetailsInnerLocationEnum]; + +/** + * Unexpected service error. + * @export + * @interface UnexpectedServiceError + */ +export interface UnexpectedServiceError { + /** + * + * @type {string} + * @memberof UnexpectedServiceError + */ + name: UnexpectedServiceErrorNameEnum; + /** + * + * @type {string} + * @memberof UnexpectedServiceError + */ + message: UnexpectedServiceErrorMessageEnum; + /** + * + * @type {number} + * @memberof UnexpectedServiceError + */ + httpStatusCode: UnexpectedServiceErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof UnexpectedServiceError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof UnexpectedServiceError + */ + details?: Array; +} + +export const UnexpectedServiceErrorNameEnum = { + UnexpectedServiceError: 'UnexpectedServiceError', +} as const; + +export type UnexpectedServiceErrorNameEnum = + (typeof UnexpectedServiceErrorNameEnum)[keyof typeof UnexpectedServiceErrorNameEnum]; +export const UnexpectedServiceErrorMessageEnum = { + UnexpectedErrorOccurred: 'Unexpected error occurred.', +} as const; + +export type UnexpectedServiceErrorMessageEnum = + (typeof UnexpectedServiceErrorMessageEnum)[keyof typeof UnexpectedServiceErrorMessageEnum]; +export const UnexpectedServiceErrorHttpStatusCodeEnum = { + NUMBER_500: 500, +} as const; + +export type UnexpectedServiceErrorHttpStatusCodeEnum = + (typeof UnexpectedServiceErrorHttpStatusCodeEnum)[keyof typeof UnexpectedServiceErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface UserNotFoundExceptionError + */ +export interface UserNotFoundExceptionError { + /** + * + * @type {string} + * @memberof UserNotFoundExceptionError + */ + name: UserNotFoundExceptionErrorNameEnum; + /** + * + * @type {string} + * @memberof UserNotFoundExceptionError + */ + message: UserNotFoundExceptionErrorMessageEnum; + /** + * + * @type {number} + * @memberof UserNotFoundExceptionError + */ + httpStatusCode: UserNotFoundExceptionErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof UserNotFoundExceptionError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof UserNotFoundExceptionError + */ + details?: Array; +} + +export const UserNotFoundExceptionErrorNameEnum = { + UserNotFoundExceptionError: 'UserNotFoundExceptionError', +} as const; + +export type UserNotFoundExceptionErrorNameEnum = + (typeof UserNotFoundExceptionErrorNameEnum)[keyof typeof UserNotFoundExceptionErrorNameEnum]; +export const UserNotFoundExceptionErrorMessageEnum = { + UserCannotBeFoundPleaseEnterEmailAddressAgain: + 'User cannot be found. Please enter email address again.', +} as const; + +export type UserNotFoundExceptionErrorMessageEnum = + (typeof UserNotFoundExceptionErrorMessageEnum)[keyof typeof UserNotFoundExceptionErrorMessageEnum]; +export const UserNotFoundExceptionErrorHttpStatusCodeEnum = { + NUMBER_404: 404, +} as const; + +export type UserNotFoundExceptionErrorHttpStatusCodeEnum = + (typeof UserNotFoundExceptionErrorHttpStatusCodeEnum)[keyof typeof UserNotFoundExceptionErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface UsernameExistsExceptionError + */ +export interface UsernameExistsExceptionError { + /** + * + * @type {string} + * @memberof UsernameExistsExceptionError + */ + name: UsernameExistsExceptionErrorNameEnum; + /** + * + * @type {string} + * @memberof UsernameExistsExceptionError + */ + message: UsernameExistsExceptionErrorMessageEnum; + /** + * + * @type {number} + * @memberof UsernameExistsExceptionError + */ + httpStatusCode: UsernameExistsExceptionErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof UsernameExistsExceptionError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof UsernameExistsExceptionError + */ + details?: Array; +} + +export const UsernameExistsExceptionErrorNameEnum = { + UsernameExistsExceptionError: 'UsernameExistsExceptionError', +} as const; + +export type UsernameExistsExceptionErrorNameEnum = + (typeof UsernameExistsExceptionErrorNameEnum)[keyof typeof UsernameExistsExceptionErrorNameEnum]; +export const UsernameExistsExceptionErrorMessageEnum = { + UsernameAlreadyExists: 'Username already exists', +} as const; + +export type UsernameExistsExceptionErrorMessageEnum = + (typeof UsernameExistsExceptionErrorMessageEnum)[keyof typeof UsernameExistsExceptionErrorMessageEnum]; +export const UsernameExistsExceptionErrorHttpStatusCodeEnum = { + NUMBER_409: 409, +} as const; + +export type UsernameExistsExceptionErrorHttpStatusCodeEnum = + (typeof UsernameExistsExceptionErrorHttpStatusCodeEnum)[keyof typeof UsernameExistsExceptionErrorHttpStatusCodeEnum]; + +/** + * CorsApi - axios parameter creator + * @export + */ +export const CorsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsCompleteOtpOperation: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/otp/complete`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsInitiateOtpOperation: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/otp/initiate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * CorsApi - functional programming interface + * @export + */ +export const CorsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = CorsApiAxiosParamCreator(configuration); + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsCompleteOtpOperation( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsCompleteOtpOperation(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsCompleteOtpOperation']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsInitiateOtpOperation( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsInitiateOtpOperation(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsInitiateOtpOperation']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * CorsApi - factory interface + * @export + */ +export const CorsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = CorsApiFp(configuration); + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsCompleteOtpOperation(options?: any): AxiosPromise { + return localVarFp + .corsCompleteOtpOperation(options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsInitiateOtpOperation(options?: any): AxiosPromise { + return localVarFp + .corsInitiateOtpOperation(options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CorsApi - object-oriented interface + * @export + * @class CorsApi + * @extends {BaseAPI} + */ +export class CorsApi extends BaseAPI { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsCompleteOtpOperation(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsCompleteOtpOperation(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsInitiateOtpOperation(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsInitiateOtpOperation(options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * OtpApi - axios parameter creator + * @export + */ +export const OtpApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * + * @param {CompleteRequest} completeRequest CompleteOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + completeOtpOperation: async ( + completeRequest: CompleteRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'completeRequest' is not null or undefined + assertParamExists( + 'completeOtpOperation', + 'completeRequest', + completeRequest + ); + const localVarPath = `/v1/otp/complete`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + completeRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {InitiateRequest} initiateRequest InitiateOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + initiateOtpOperation: async ( + initiateRequest: InitiateRequest, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'initiateRequest' is not null or undefined + assertParamExists( + 'initiateOtpOperation', + 'initiateRequest', + initiateRequest + ); + const localVarPath = `/v1/otp/initiate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ConsumerTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + initiateRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * OtpApi - functional programming interface + * @export + */ +export const OtpApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = OtpApiAxiosParamCreator(configuration); + return { + /** + * + * @param {CompleteRequest} completeRequest CompleteOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async completeOtpOperation( + completeRequest: CompleteRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.completeOtpOperation( + completeRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['OtpApi.completeOtpOperation']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {InitiateRequest} initiateRequest InitiateOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async initiateOtpOperation( + initiateRequest: InitiateRequest, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.initiateOtpOperation( + initiateRequest, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['OtpApi.initiateOtpOperation']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * OtpApi - factory interface + * @export + */ +export const OtpApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = OtpApiFp(configuration); + return { + /** + * + * @param {CompleteRequest} completeRequest CompleteOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + completeOtpOperation( + completeRequest: CompleteRequest, + options?: any + ): AxiosPromise { + return localVarFp + .completeOtpOperation(completeRequest, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {InitiateRequest} initiateRequest InitiateOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + initiateOtpOperation( + initiateRequest: InitiateRequest, + options?: any + ): AxiosPromise { + return localVarFp + .initiateOtpOperation(initiateRequest, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * OtpApi - object-oriented interface + * @export + * @class OtpApi + * @extends {BaseAPI} + */ +export class OtpApi extends BaseAPI { + /** + * + * @param {CompleteRequest} completeRequest CompleteOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OtpApi + */ + public completeOtpOperation( + completeRequest: CompleteRequest, + options?: RawAxiosRequestConfig + ) { + return OtpApiFp(this.configuration) + .completeOtpOperation(completeRequest, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {InitiateRequest} initiateRequest InitiateOtpOperation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OtpApi + */ + public initiateOtpOperation( + initiateRequest: InitiateRequest, + options?: RawAxiosRequestConfig + ) { + return OtpApiFp(this.configuration) + .initiateOtpOperation(initiateRequest, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/packages/sdk-client-kyc/base.ts b/packages/sdk-client-kyc/base.ts new file mode 100644 index 00000000..4fc3e48f --- /dev/null +++ b/packages/sdk-client-kyc/base.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * KnowYourCustomer + * Affinidi KnowYourCustomer Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: consumer-eng@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = 'RequiredError'; + } +} + +interface ServerMap { + [key: string]: { + url: string; + description: string; + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {}; diff --git a/packages/sdk-client-kyc/common.ts b/packages/sdk-client-kyc/common.ts new file mode 100644 index 00000000..581e5973 --- /dev/null +++ b/packages/sdk-client-kyc/common.ts @@ -0,0 +1,203 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * KnowYourCustomer + * Affinidi KnowYourCustomer Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: consumer-eng@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { RequestArgs } from './base'; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from './base'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com'; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.` + ); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration +) { + if (configuration && (configuration.username || configuration.password)) { + object['auth'] = { + username: configuration.username, + password: configuration.password, + }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = '' +): void { + if (parameter == null) return; + if (typeof parameter === 'object') { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key) + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== '' ? '.' : ''}${currentKey}` + ) + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration +) { + const nonString = typeof value !== 'string'; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ''; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + + axiosArgs.url, + }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/packages/sdk-client-kyc/configuration.ts b/packages/sdk-client-kyc/configuration.ts new file mode 100644 index 00000000..55972449 --- /dev/null +++ b/packages/sdk-client-kyc/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * KnowYourCustomer + * Affinidi KnowYourCustomer Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: consumer-eng@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i' + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } +} diff --git a/packages/sdk-client-kyc/git_push.sh b/packages/sdk-client-kyc/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/packages/sdk-client-kyc/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/sdk-client-kyc/index.ts b/packages/sdk-client-kyc/index.ts new file mode 100644 index 00000000..0d8d51fa --- /dev/null +++ b/packages/sdk-client-kyc/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * KnowYourCustomer + * Affinidi KnowYourCustomer Structure + * + * The version of the OpenAPI document: 1.0.0 + * Contact: consumer-eng@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/packages/sdk-client-kyc/package.json b/packages/sdk-client-kyc/package.json new file mode 100644 index 00000000..de4ea2eb --- /dev/null +++ b/packages/sdk-client-kyc/package.json @@ -0,0 +1,37 @@ +{ + "name": "@affinidi/test-sdk-client-kyc", + "version": "1.0.0", + "description": "OpenAPI client for @affinidi/test-sdk-client-kyc main", + "author": "Affinidi", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "affinidi-sdk", + "identity", + "holistic", + "network", + "openapi-client", + "openapi-generator", + "@affinidi/test-sdk-client-kyc" + ], + "license": "Apache-2.0", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "eslint . --ext .ts", + "prepare": "npm run build" + }, + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } +} diff --git a/packages/sdk-client-kyc/project.json b/packages/sdk-client-kyc/project.json new file mode 100644 index 00000000..4bdfc8fc --- /dev/null +++ b/packages/sdk-client-kyc/project.json @@ -0,0 +1,41 @@ +{ + "name": "@affinidi/test-sdk-client-kyc", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/client-iam", + "projectType": "library", + "private": false, + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/packages/test-sdk-client-kyc", + "main": "packages/test-sdk-client-kyc/index.ts", + "tsConfig": "packages/test-sdk-client-kyc/tsconfig.lib.json", + "assets": ["packages/test-sdk-client-kyc/*.md"] + } + }, + "lint": { + "executor": "@nx/eslint:lint" + }, + "semantic-release": { + "executor": "@theunderscorer/nx-semantic-release:semantic-release", + "options": { + "changelog": true, + "github": true, + "npm": true, + "repositoryUrl": "git@github.com:affinidi/sdk.git", + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/npm", + { + "npmPublish": true + } + ] + ] + } + } + }, + "tags": [] +} diff --git a/packages/sdk-client-kyc/tsconfig.esm.json b/packages/sdk-client-kyc/tsconfig.esm.json new file mode 100644 index 00000000..2c0331cc --- /dev/null +++ b/packages/sdk-client-kyc/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/packages/sdk-client-kyc/tsconfig.json b/packages/sdk-client-kyc/tsconfig.json new file mode 100644 index 00000000..bab039be --- /dev/null +++ b/packages/sdk-client-kyc/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "ES6", + "module": "commonjs", + "noImplicitAny": true, + "esModuleInterop": true, + "outDir": "dist", + "rootDir": ".", + "moduleResolution": "node" + }, + "exclude": ["dist", "node_modules"] +} diff --git a/packages/sdk-client-vpa/.gitignore b/packages/sdk-client-vpa/.gitignore new file mode 100644 index 00000000..eb42e83e --- /dev/null +++ b/packages/sdk-client-vpa/.gitignore @@ -0,0 +1,37 @@ +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings +wwwroot/*.js +dist + +# System Files +.DS_Store +Thumbs.db + +# other +.env +.env.production +.npmrc +.nyc_output +coverage diff --git a/packages/sdk-client-vpa/.npmignore b/packages/sdk-client-vpa/.npmignore new file mode 100644 index 00000000..40886a38 --- /dev/null +++ b/packages/sdk-client-vpa/.npmignore @@ -0,0 +1,10 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm + +node_modules +coverage +.vscode +.DS_Store +.nyc_output +.history +.idea +Thumbs.db diff --git a/packages/sdk-client-vpa/.openapi-generator-ignore b/packages/sdk-client-vpa/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/packages/sdk-client-vpa/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/packages/sdk-client-vpa/.openapi-generator/FILES b/packages/sdk-client-vpa/.openapi-generator/FILES new file mode 100644 index 00000000..909a3223 --- /dev/null +++ b/packages/sdk-client-vpa/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +.npmignore +.openapi-generator-ignore +README.md +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +package.json +project.json +tsconfig.esm.json +tsconfig.json diff --git a/packages/sdk-client-vpa/.openapi-generator/VERSION b/packages/sdk-client-vpa/.openapi-generator/VERSION new file mode 100644 index 00000000..4b49d9bb --- /dev/null +++ b/packages/sdk-client-vpa/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/packages/sdk-client-vpa/README.md b/packages/sdk-client-vpa/README.md new file mode 100644 index 00000000..30941166 --- /dev/null +++ b/packages/sdk-client-vpa/README.md @@ -0,0 +1,53 @@ +## @affinidi/test-sdk-client-vpa + +### Usage + +```bash +npm install @affinidi/test-sdk-client-vpa --save +``` + +#### With PAT + +To call service methods with personal access token, you need to get a getProjectScopedToken for the machine user: + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-vpa'; +import { authProvider } from '@affinidi/test-auth-provider'; + +const projectScopedToken = await authProvider.getProjectScopedToken({ + apiGatewayUrl, + projectId, + machineUserId, + tokenEndpoint, + privateKey, + passphrase, + keyId, + publicKey, +}); + +const api = new SomeClassApi( + new Configuration({ + apiKey: projectScopedToken, + basePath: `${apiGatewayUrl}/vpa`, + }) +); + +await api.oneOfMethods(); +``` + +#### With session ID via BFF + +```ts +import { SomeClassApi, Configuration } from '@affinidi/test-sdk-client-vpa'; +import { getBffHeaders } from '@affinidi/test-auth-provider'; + +const headers = getBffHeaders(cookieName, sessionId); + +const baseOptions = { headers }; + +const api = new SomeClassApi( + new Configuration({ basePath: `${bffHost}/vpa`, baseOptions }) +); + +await api.oneOfMethods(); +``` diff --git a/packages/sdk-client-vpa/api.ts b/packages/sdk-client-vpa/api.ts new file mode 100644 index 00000000..047383ff --- /dev/null +++ b/packages/sdk-client-vpa/api.ts @@ -0,0 +1,6909 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OidcVpAdapterBackend + * Affinidi OIDC VP Adapter Backend An authorization token is necessary to create or obtain a project Access Token and access Admin APIs. Follow these step-by-step [instructions](https://lemmatree.atlassian.net/wiki/spaces/NETCORE/pages/2735317648020/ASA+Developer+Flow#Instructions-on-how-to-create-the-Project.) to set up an authorization token + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from './base'; + +/** + * + * @export + * @interface ActionForbiddenError + */ +export interface ActionForbiddenError { + /** + * + * @type {string} + * @memberof ActionForbiddenError + */ + name: ActionForbiddenErrorNameEnum; + /** + * + * @type {string} + * @memberof ActionForbiddenError + */ + message: ActionForbiddenErrorMessageEnum; + /** + * + * @type {number} + * @memberof ActionForbiddenError + */ + httpStatusCode: ActionForbiddenErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof ActionForbiddenError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof ActionForbiddenError + */ + details?: Array; +} + +export const ActionForbiddenErrorNameEnum = { + ActionForbiddenError: 'ActionForbiddenError', +} as const; + +export type ActionForbiddenErrorNameEnum = + (typeof ActionForbiddenErrorNameEnum)[keyof typeof ActionForbiddenErrorNameEnum]; +export const ActionForbiddenErrorMessageEnum = { + PrincipalCanNotExecuteActionOnGivenResource: + 'Principal can not execute action on given resource', +} as const; + +export type ActionForbiddenErrorMessageEnum = + (typeof ActionForbiddenErrorMessageEnum)[keyof typeof ActionForbiddenErrorMessageEnum]; +export const ActionForbiddenErrorHttpStatusCodeEnum = { + NUMBER_403: 403, +} as const; + +export type ActionForbiddenErrorHttpStatusCodeEnum = + (typeof ActionForbiddenErrorHttpStatusCodeEnum)[keyof typeof ActionForbiddenErrorHttpStatusCodeEnum]; + +/** + * input used to add a user to a group + * @export + * @interface AddUserToGroupInput + */ +export interface AddUserToGroupInput { + /** + * Unique identifier of the user + * @type {string} + * @memberof AddUserToGroupInput + */ + userId: string; +} +/** + * + * @export + * @interface BlockedUsers + */ +export interface BlockedUsers { + /** + * + * @type {Array} + * @memberof BlockedUsers + */ + userIds: Array; + /** + * + * @type {object} + * @memberof BlockedUsers + */ + pageToken?: object; +} +/** + * + * @export + * @interface BlockedUsersInput + */ +export interface BlockedUsersInput { + /** + * + * @type {Array} + * @memberof BlockedUsersInput + */ + userIds: Array; +} +/** + * + * @export + * @interface CreateGroupInput + */ +export interface CreateGroupInput { + /** + * name of the group for users, used as an id + * @type {string} + * @memberof CreateGroupInput + */ + groupName: string; +} +/** + * + * @export + * @interface CreateLoginConfigurationInput + */ +export interface CreateLoginConfigurationInput { + /** + * User defined login configuration name + * @type {string} + * @memberof CreateLoginConfigurationInput + */ + name: string; + /** + * OAuth 2.0 Redirect URIs + * @type {Array} + * @memberof CreateLoginConfigurationInput + */ + redirectUris: Array; + /** + * VP definition in JSON stringify format + * @type {string} + * @memberof CreateLoginConfigurationInput + */ + vpDefinition?: string; + /** + * Presentation Definition + * @type {object} + * @memberof CreateLoginConfigurationInput + */ + presentationDefinition?: object; + /** + * + * @type {IdTokenMapping} + * @memberof CreateLoginConfigurationInput + */ + idTokenMapping?: IdTokenMapping; + /** + * + * @type {LoginConfigurationClientMetadata} + * @memberof CreateLoginConfigurationInput + */ + clientMetadata?: LoginConfigurationClientMetadata; + /** + * ID token claims output format. Default is array. + * @type {string} + * @memberof CreateLoginConfigurationInput + */ + claimFormat?: CreateLoginConfigurationInputClaimFormatEnum; + /** + * Interrupts login process if duplications of data fields names will be found + * @type {boolean} + * @memberof CreateLoginConfigurationInput + */ + failOnMappingConflict?: boolean; + /** + * List of groups separated by space + * @type {string} + * @memberof CreateLoginConfigurationInput + */ + scope?: string; + /** + * + * @type {TokenEndpointAuthMethod} + * @memberof CreateLoginConfigurationInput + */ + tokenEndpointAuthMethod?: TokenEndpointAuthMethod; +} + +export const CreateLoginConfigurationInputClaimFormatEnum = { + Array: 'array', + Map: 'map', +} as const; + +export type CreateLoginConfigurationInputClaimFormatEnum = + (typeof CreateLoginConfigurationInputClaimFormatEnum)[keyof typeof CreateLoginConfigurationInputClaimFormatEnum]; + +/** + * + * @export + * @interface CreateLoginConfigurationOutput + */ +export interface CreateLoginConfigurationOutput { + /** + * Configuration ari + * @type {string} + * @memberof CreateLoginConfigurationOutput + */ + ari: string; + /** + * Project id + * @type {string} + * @memberof CreateLoginConfigurationOutput + */ + projectId: string; + /** + * Configuration id + * @type {string} + * @memberof CreateLoginConfigurationOutput + */ + configurationId?: string; + /** + * User defined login configuration name + * @type {string} + * @memberof CreateLoginConfigurationOutput + */ + name: string; + /** + * + * @type {CreateLoginConfigurationOutputAuth} + * @memberof CreateLoginConfigurationOutput + */ + auth: CreateLoginConfigurationOutputAuth; + /** + * OAuth 2.0 Redirect URIs + * @type {Array} + * @memberof CreateLoginConfigurationOutput + */ + redirectUris: Array; + /** + * + * @type {LoginConfigurationClientMetadata} + * @memberof CreateLoginConfigurationOutput + */ + clientMetadata: LoginConfigurationClientMetadata; + /** + * OAuth 2.0 Client Creation Date + * @type {string} + * @memberof CreateLoginConfigurationOutput + */ + creationDate: string; +} +/** + * OIDC Auth Credentials + * @export + * @interface CreateLoginConfigurationOutputAuth + */ +export interface CreateLoginConfigurationOutputAuth { + /** + * OAuth 2.0 Client ID + * @type {string} + * @memberof CreateLoginConfigurationOutputAuth + */ + clientId: string; + /** + * OAuth 2.0 Client Secret + * @type {string} + * @memberof CreateLoginConfigurationOutputAuth + */ + clientSecret?: string; + /** + * OAuth 2.0 Client Scope + * @type {string} + * @memberof CreateLoginConfigurationOutputAuth + */ + scope?: string; + /** + * Issuer URL + * @type {string} + * @memberof CreateLoginConfigurationOutputAuth + */ + issuer?: string; +} +/** + * + * @export + * @interface ErrorOAuth2 + */ +export interface ErrorOAuth2 { + /** + * Error + * @type {string} + * @memberof ErrorOAuth2 + */ + error: string; + /** + * Error Debug Information. Only available in dev mode. + * @type {string} + * @memberof ErrorOAuth2 + */ + error_debug?: string; + /** + * Error Description + * @type {string} + * @memberof ErrorOAuth2 + */ + error_description: string; + /** + * Error Hint. Helps the user identify the error cause. + * @type {string} + * @memberof ErrorOAuth2 + */ + error_hint?: string; + /** + * HTTP Status Code + * @type {string} + * @memberof ErrorOAuth2 + */ + status_code: string; +} +/** + * + * @export + * @interface GetUserInfo + */ +export interface GetUserInfo { + /** + * End-User\'s birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format. The year MAY be 0000, indicating that it is omitted. To represent only the year, YYYY format is allowed. Note that depending on the underlying platform\'s date related function, providing just year can result in varying month and day, so the implementers need to take this factor into account to correctly process the dates. + * @type {string} + * @memberof GetUserInfo + */ + birthdate?: string; + /** + * End-User\'s preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7. + * @type {string} + * @memberof GetUserInfo + */ + email?: string; + /** + * True if the End-User\'s e-mail address has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this e-mail address was controlled by the End-User at the time the verification was performed. The means by which an e-mail address is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. + * @type {boolean} + * @memberof GetUserInfo + */ + email_verified?: boolean; + /** + * Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters. + * @type {string} + * @memberof GetUserInfo + */ + family_name?: string; + /** + * End-User\'s gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable. + * @type {string} + * @memberof GetUserInfo + */ + gender?: string; + /** + * Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters. + * @type {string} + * @memberof GetUserInfo + */ + given_name?: string; + /** + * End-User\'s locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Relying Parties MAY choose to accept this locale syntax as well. + * @type {string} + * @memberof GetUserInfo + */ + locale?: string; + /** + * Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used. + * @type {string} + * @memberof GetUserInfo + */ + middle_name?: string; + /** + * End-User\'s full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User\'s locale and preferences. + * @type {string} + * @memberof GetUserInfo + */ + name?: string; + /** + * Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael. + * @type {string} + * @memberof GetUserInfo + */ + nickname?: string; + /** + * End-User\'s preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400. If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678. + * @type {string} + * @memberof GetUserInfo + */ + phone_number?: string; + /** + * True if the End-User\'s phone number has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this phone number was controlled by the End-User at the time the verification was performed. The means by which a phone number is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. When true, the phone_number Claim MUST be in E.164 format and any extensions MUST be represented in RFC 3966 format. + * @type {boolean} + * @memberof GetUserInfo + */ + phone_number_verified?: boolean; + /** + * URL of the End-User\'s profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User. + * @type {string} + * @memberof GetUserInfo + */ + picture?: string; + /** + * Non-unique shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace. + * @type {string} + * @memberof GetUserInfo + */ + preferred_username?: string; + /** + * URL of the End-User\'s profile page. The contents of this Web page SHOULD be about the End-User. + * @type {string} + * @memberof GetUserInfo + */ + profile?: string; + /** + * Subject - Identifier for the End-User at the IssuerURL. + * @type {string} + * @memberof GetUserInfo + */ + sub?: string; + /** + * Time the End-User\'s information was last updated. Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time. + * @type {number} + * @memberof GetUserInfo + */ + updated_at?: number; + /** + * URL of the End-User\'s Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with. + * @type {string} + * @memberof GetUserInfo + */ + website?: string; + /** + * String from zoneinfo [zoneinfo] time zone database representing the End-User\'s time zone. For example, Europe/Paris or America/Los_Angeles. + * @type {string} + * @memberof GetUserInfo + */ + zoneinfo?: string; +} +/** + * + * @export + * @interface GroupDto + */ +export interface GroupDto { + /** + * Group ari + * @type {string} + * @memberof GroupDto + */ + ari: string; + /** + * Project id + * @type {string} + * @memberof GroupDto + */ + projectId: string; + /** + * name of the group, identifier within a project + * @type {string} + * @memberof GroupDto + */ + groupName: string; + /** + * Group creation date + * @type {string} + * @memberof GroupDto + */ + creationDate: string; +} +/** + * + * @export + * @interface GroupNames + */ +export interface GroupNames { + /** + * + * @type {Array} + * @memberof GroupNames + */ + groupNames: Array; + /** + * + * @type {object} + * @memberof GroupNames + */ + pageToken?: object; +} +/** + * + * @export + * @interface GroupNamesInput + */ +export interface GroupNamesInput { + /** + * + * @type {Array} + * @memberof GroupNamesInput + */ + groupNames: Array; +} +/** + * + * @export + * @interface GroupUserMappingDto + */ +export interface GroupUserMappingDto { + /** + * Unique identifier of the user + * @type {string} + * @memberof GroupUserMappingDto + */ + userId: string; + /** + * Group to user mapping creation date + * @type {string} + * @memberof GroupUserMappingDto + */ + addedAt: string; +} +/** + * + * @export + * @interface GroupUserMappingsList + */ +export interface GroupUserMappingsList { + /** + * + * @type {Array} + * @memberof GroupUserMappingsList + */ + users?: Array; + /** + * + * @type {string} + * @memberof GroupUserMappingsList + */ + lastEvaluatedKey?: string; + /** + * + * @type {number} + * @memberof GroupUserMappingsList + */ + totalUserCount?: number; +} +/** + * + * @export + * @interface GroupsList + */ +export interface GroupsList { + /** + * + * @type {Array} + * @memberof GroupsList + */ + groups?: Array; +} +/** + * + * @export + * @interface GroupsPerUserLimitExceededError + */ +export interface GroupsPerUserLimitExceededError { + /** + * + * @type {string} + * @memberof GroupsPerUserLimitExceededError + */ + name: GroupsPerUserLimitExceededErrorNameEnum; + /** + * + * @type {string} + * @memberof GroupsPerUserLimitExceededError + */ + message: GroupsPerUserLimitExceededErrorMessageEnum; + /** + * + * @type {number} + * @memberof GroupsPerUserLimitExceededError + */ + httpStatusCode: GroupsPerUserLimitExceededErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof GroupsPerUserLimitExceededError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof GroupsPerUserLimitExceededError + */ + details?: Array; +} + +export const GroupsPerUserLimitExceededErrorNameEnum = { + GroupsPerUserLimitExceededError: 'GroupsPerUserLimitExceededError', +} as const; + +export type GroupsPerUserLimitExceededErrorNameEnum = + (typeof GroupsPerUserLimitExceededErrorNameEnum)[keyof typeof GroupsPerUserLimitExceededErrorNameEnum]; +export const GroupsPerUserLimitExceededErrorMessageEnum = { + AmountOfGroupsPerUserIsLimited: 'Amount of groups per user is limited.', +} as const; + +export type GroupsPerUserLimitExceededErrorMessageEnum = + (typeof GroupsPerUserLimitExceededErrorMessageEnum)[keyof typeof GroupsPerUserLimitExceededErrorMessageEnum]; +export const GroupsPerUserLimitExceededErrorHttpStatusCodeEnum = { + NUMBER_409: 409, +} as const; + +export type GroupsPerUserLimitExceededErrorHttpStatusCodeEnum = + (typeof GroupsPerUserLimitExceededErrorHttpStatusCodeEnum)[keyof typeof GroupsPerUserLimitExceededErrorHttpStatusCodeEnum]; + +/** + * Fields name/path mapping between the vp_token and the id_token + * @export + * @interface IdTokenMapping + */ +export interface IdTokenMapping extends Array {} +/** + * + * @export + * @interface IdTokenMappingInner + */ +export interface IdTokenMappingInner { + /** + * Name(path) of the corresponding field in the vp_token + * @type {string} + * @memberof IdTokenMappingInner + */ + sourceField: string; + /** + * Name of the corresponding field in the id_token + * @type {string} + * @memberof IdTokenMappingInner + */ + idTokenClaim: string; + /** + * Id of related input descriptor from presentation definition + * @type {string} + * @memberof IdTokenMappingInner + */ + inputDescriptorId?: string; +} +/** + * + * @export + * @interface InvalidGroupsError + */ +export interface InvalidGroupsError { + /** + * + * @type {string} + * @memberof InvalidGroupsError + */ + name: InvalidGroupsErrorNameEnum; + /** + * + * @type {string} + * @memberof InvalidGroupsError + */ + message: InvalidGroupsErrorMessageEnum; + /** + * + * @type {number} + * @memberof InvalidGroupsError + */ + httpStatusCode: InvalidGroupsErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof InvalidGroupsError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof InvalidGroupsError + */ + details?: Array; +} + +export const InvalidGroupsErrorNameEnum = { + InvalidGroupsError: 'InvalidGroupsError', +} as const; + +export type InvalidGroupsErrorNameEnum = + (typeof InvalidGroupsErrorNameEnum)[keyof typeof InvalidGroupsErrorNameEnum]; +export const InvalidGroupsErrorMessageEnum = { + InvalidGroupsNames: 'Invalid groups names', +} as const; + +export type InvalidGroupsErrorMessageEnum = + (typeof InvalidGroupsErrorMessageEnum)[keyof typeof InvalidGroupsErrorMessageEnum]; +export const InvalidGroupsErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type InvalidGroupsErrorHttpStatusCodeEnum = + (typeof InvalidGroupsErrorHttpStatusCodeEnum)[keyof typeof InvalidGroupsErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface InvalidParameterError + */ +export interface InvalidParameterError { + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + name: InvalidParameterErrorNameEnum; + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + message: InvalidParameterErrorMessageEnum; + /** + * + * @type {number} + * @memberof InvalidParameterError + */ + httpStatusCode: InvalidParameterErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof InvalidParameterError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof InvalidParameterError + */ + details?: Array; +} + +export const InvalidParameterErrorNameEnum = { + InvalidParameterError: 'InvalidParameterError', +} as const; + +export type InvalidParameterErrorNameEnum = + (typeof InvalidParameterErrorNameEnum)[keyof typeof InvalidParameterErrorNameEnum]; +export const InvalidParameterErrorMessageEnum = { + InvalidParameterParam: 'Invalid parameter: ${param}.', +} as const; + +export type InvalidParameterErrorMessageEnum = + (typeof InvalidParameterErrorMessageEnum)[keyof typeof InvalidParameterErrorMessageEnum]; +export const InvalidParameterErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type InvalidParameterErrorHttpStatusCodeEnum = + (typeof InvalidParameterErrorHttpStatusCodeEnum)[keyof typeof InvalidParameterErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface InvalidParameterErrorDetailsInner + */ +export interface InvalidParameterErrorDetailsInner { + /** + * + * @type {string} + * @memberof InvalidParameterErrorDetailsInner + */ + issue: string; + /** + * + * @type {string} + * @memberof InvalidParameterErrorDetailsInner + */ + field?: string; + /** + * + * @type {string} + * @memberof InvalidParameterErrorDetailsInner + */ + value?: string; + /** + * + * @type {string} + * @memberof InvalidParameterErrorDetailsInner + */ + location?: string; +} +/** + * + * @export + * @interface JsonWebKey + */ +export interface JsonWebKey { + /** + * The value of the \"keys\" parameter is an array of JSON Web Key (JWK) values. By default, the order of the JWK values within the array does not imply an order of preference among them, although applications of JWK Sets can choose to assign a meaning to the order for their purposes, if desired. + * @type {Array} + * @memberof JsonWebKey + */ + keys?: Array; +} +/** + * + * @export + * @interface JsonWebKeyKeysInner + */ +export interface JsonWebKeyKeysInner { + /** + * The \"alg\" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA \"JSON Web Signature and Encryption Algorithms\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + alg: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + crv?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + d?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + dp?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + dq?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + e?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + k?: string; + /** + * The \"kid\" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the \"kid\" value is unspecified. When \"kid\" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct \"kid\" values. (One example in which different keys might use the same \"kid\" value is if they have different \"kty\" (key type) values but are considered to be equivalent alternatives by the application using them.) The \"kid\" value is a case-sensitive string. + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + kid: string; + /** + * The \"kty\" (key type) parameter identifies the cryptographic algorithm family used with the key, such as \"RSA\" or \"EC\". \"kty\" values should either be registered in the IANA \"JSON Web Key Types\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. The \"kty\" value is a case-sensitive string. + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + kty: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + n?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + p?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + q?: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + qi?: string; + /** + * Use (\"public key use\") identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly \"sig\" (signature) or \"enc\" (encryption). + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + use: string; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + x?: string; + /** + * The \"x5c\" (X.509 certificate chain) parameter contains a chain of one or more PKIX certificates [RFC5280]. The certificate chain is represented as a JSON array of certificate value strings. Each string in the array is a base64-encoded (Section 4 of [RFC4648] -- not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. The PKIX certificate containing the key value MUST be the first certificate. + * @type {Array} + * @memberof JsonWebKeyKeysInner + */ + x5c: Array; + /** + * + * @type {string} + * @memberof JsonWebKeyKeysInner + */ + y?: string; +} +/** + * + * @export + * @interface ListLoginConfigurationOutput + */ +export interface ListLoginConfigurationOutput { + /** + * + * @type {Array} + * @memberof ListLoginConfigurationOutput + */ + configurations: Array; + /** + * + * @type {string} + * @memberof ListLoginConfigurationOutput + */ + lastEvaluatedKey?: string; +} +/** + * login configuration client metadata + * @export + * @interface LoginConfigurationClientMetadata + */ +export interface LoginConfigurationClientMetadata { + [key: string]: any; + + /** + * application name that will be displayed in consent page + * @type {string} + * @memberof LoginConfigurationClientMetadata + */ + name: string; + /** + * origin url that will be displayed in consent page + * @type {string} + * @memberof LoginConfigurationClientMetadata + */ + origin: string; + /** + * logo url that will be displayed in consent page + * @type {string} + * @memberof LoginConfigurationClientMetadata + */ + logo: string; +} +/** + * + * @export + * @interface LoginConfigurationObject + */ +export interface LoginConfigurationObject { + [key: string]: any; + + /** + * Configuration ari + * @type {string} + * @memberof LoginConfigurationObject + */ + ari: string; + /** + * Configuration id + * @type {string} + * @memberof LoginConfigurationObject + */ + configurationId?: string; + /** + * Project id + * @type {string} + * @memberof LoginConfigurationObject + */ + projectId: string; + /** + * User defined login configuration name + * @type {string} + * @memberof LoginConfigurationObject + */ + name: string; + /** + * OAuth 2.0 Redirect URIs + * @type {Array} + * @memberof LoginConfigurationObject + */ + redirectUris?: Array; + /** + * OAuth 2.0 Client Scope + * @type {string} + * @memberof LoginConfigurationObject + */ + scope?: string; + /** + * OAuth 2.0 Client ID + * @type {string} + * @memberof LoginConfigurationObject + */ + clientId: string; + /** + * OAuth 2.0 Client Creation Date + * @type {string} + * @memberof LoginConfigurationObject + */ + creationDate: string; + /** + * VP definition in JSON stringify format + * @type {string} + * @memberof LoginConfigurationObject + */ + vpDefinition: string; + /** + * Presentation Definition + * @type {object} + * @memberof LoginConfigurationObject + */ + presentationDefinition?: object; + /** + * + * @type {IdTokenMapping} + * @memberof LoginConfigurationObject + */ + idTokenMapping: IdTokenMapping; + /** + * + * @type {LoginConfigurationClientMetadata} + * @memberof LoginConfigurationObject + */ + clientMetadata: LoginConfigurationClientMetadata; + /** + * + * @type {TokenEndpointAuthMethod} + * @memberof LoginConfigurationObject + */ + tokenEndpointAuthMethod: TokenEndpointAuthMethod; +} + +/** + * + * @export + * @interface LoginConfigurationReadInvalidClientIdError + */ +export interface LoginConfigurationReadInvalidClientIdError { + /** + * + * @type {string} + * @memberof LoginConfigurationReadInvalidClientIdError + */ + name: LoginConfigurationReadInvalidClientIdErrorNameEnum; + /** + * + * @type {string} + * @memberof LoginConfigurationReadInvalidClientIdError + */ + message: LoginConfigurationReadInvalidClientIdErrorMessageEnum; + /** + * + * @type {number} + * @memberof LoginConfigurationReadInvalidClientIdError + */ + httpStatusCode: LoginConfigurationReadInvalidClientIdErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof LoginConfigurationReadInvalidClientIdError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof LoginConfigurationReadInvalidClientIdError + */ + details?: Array; +} + +export const LoginConfigurationReadInvalidClientIdErrorNameEnum = { + LoginConfigurationReadInvalidClientIdError: + 'LoginConfigurationReadInvalidClientIdError', +} as const; + +export type LoginConfigurationReadInvalidClientIdErrorNameEnum = + (typeof LoginConfigurationReadInvalidClientIdErrorNameEnum)[keyof typeof LoginConfigurationReadInvalidClientIdErrorNameEnum]; +export const LoginConfigurationReadInvalidClientIdErrorMessageEnum = { + LoginConfigurationReadInvalidClientIdError: + 'LoginConfigurationReadInvalidClientIdError', +} as const; + +export type LoginConfigurationReadInvalidClientIdErrorMessageEnum = + (typeof LoginConfigurationReadInvalidClientIdErrorMessageEnum)[keyof typeof LoginConfigurationReadInvalidClientIdErrorMessageEnum]; +export const LoginConfigurationReadInvalidClientIdErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type LoginConfigurationReadInvalidClientIdErrorHttpStatusCodeEnum = + (typeof LoginConfigurationReadInvalidClientIdErrorHttpStatusCodeEnum)[keyof typeof LoginConfigurationReadInvalidClientIdErrorHttpStatusCodeEnum]; + +/** + * @type LoginSessionAcceptResponse400Response + * @export + */ +export type LoginSessionAcceptResponse400Response = + | InvalidParameterError + | VPTokenValidationError; + +/** + * Authorization Response per OpenID for Verifiable Presentations Specification + * @export + * @interface LoginSessionAcceptResponseInput + */ +export interface LoginSessionAcceptResponseInput { + [key: string]: any; +} +/** + * Direct Post Response URI endpoint result + * @export + * @interface LoginSessionAcceptResponseOutput + */ +export interface LoginSessionAcceptResponseOutput { + [key: string]: any; +} +/** + * + * @export + * @interface LoginSessionDto + */ +export interface LoginSessionDto { + /** + * Session primary identifier + * @type {string} + * @memberof LoginSessionDto + */ + id: string; + /** + * + * @type {LoginSessionDtoAuthorizationRequest} + * @memberof LoginSessionDto + */ + authorizationRequest: LoginSessionDtoAuthorizationRequest; +} +/** + * + * @export + * @interface LoginSessionDtoAuthorizationRequest + */ +export interface LoginSessionDtoAuthorizationRequest { + /** + * State parameter + * @type {string} + * @memberof LoginSessionDtoAuthorizationRequest + */ + state: string; + /** + * Presentation Definition to ask from the user. In JSON Stringify format. + * @type {string} + * @memberof LoginSessionDtoAuthorizationRequest + */ + presentationDefinition: string; + /** + * ARI is used for analytics proposals. + * @type {string} + * @memberof LoginSessionDtoAuthorizationRequest + */ + ari?: string; + /** + * clientId used for detect origin. + * @type {string} + * @memberof LoginSessionDtoAuthorizationRequest + */ + clientId?: string; +} +/** + * Input for Creating a Login Session + * @export + * @interface LoginSessionForIDPInput + */ +export interface LoginSessionForIDPInput { + /** + * IDP Login Challenge to Associate the Session with + * @type {string} + * @memberof LoginSessionForIDPInput + */ + loginChallenge: string; + /** + * IDP client id to Associate the Session with + * @type {string} + * @memberof LoginSessionForIDPInput + */ + clientId: string; +} +/** + * Authorization Response per OpenID for Verifiable Presentations Specification + * @export + * @interface LoginSessionRejectResponseInput + */ +export interface LoginSessionRejectResponseInput { + [key: string]: any; + + /** + * The error should follow the OAuth2 error format (e.g. invalid_request, login_required). Defaults to request_denied + * @type {string} + * @memberof LoginSessionRejectResponseInput + */ + error?: string; + /** + * Description of the error in a human readable format + * @type {string} + * @memberof LoginSessionRejectResponseInput + */ + errorDescription?: string; + /** + * Random state associated to the Session + * @type {string} + * @memberof LoginSessionRejectResponseInput + */ + state: string; +} +/** + * Direct Post Response URI endpoint result + * @export + * @interface LoginSessionRejectResponseOutput + */ +export interface LoginSessionRejectResponseOutput { + [key: string]: any; +} +/** + * + * @export + * @interface NotFoundError + */ +export interface NotFoundError { + /** + * + * @type {string} + * @memberof NotFoundError + */ + name: NotFoundErrorNameEnum; + /** + * + * @type {string} + * @memberof NotFoundError + */ + message: NotFoundErrorMessageEnum; + /** + * + * @type {number} + * @memberof NotFoundError + */ + httpStatusCode: NotFoundErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof NotFoundError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof NotFoundError + */ + details?: Array; +} + +export const NotFoundErrorNameEnum = { + NotFoundError: 'NotFoundError', +} as const; + +export type NotFoundErrorNameEnum = + (typeof NotFoundErrorNameEnum)[keyof typeof NotFoundErrorNameEnum]; +export const NotFoundErrorMessageEnum = { + NotFoundParam: 'Not found: ${param}.', +} as const; + +export type NotFoundErrorMessageEnum = + (typeof NotFoundErrorMessageEnum)[keyof typeof NotFoundErrorMessageEnum]; +export const NotFoundErrorHttpStatusCodeEnum = { + NUMBER_404: 404, +} as const; + +export type NotFoundErrorHttpStatusCodeEnum = + (typeof NotFoundErrorHttpStatusCodeEnum)[keyof typeof NotFoundErrorHttpStatusCodeEnum]; + +/** + * + * @export + * @interface OAuth2Token + */ +export interface OAuth2Token { + /** + * The access token issued by the authorization server. + * @type {string} + * @memberof OAuth2Token + */ + access_token?: string; + /** + * The lifetime in seconds of the access token. For example, the value \"3600\" denotes that the access token will expire in one hour from the time the response was generated. + * @type {number} + * @memberof OAuth2Token + */ + expires_in?: number; + /** + * To retrieve a refresh token request the id_token scope. + * @type {number} + * @memberof OAuth2Token + */ + id_token?: number; + /** + * The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request. + * @type {string} + * @memberof OAuth2Token + */ + refresh_token?: string; + /** + * The scope of the access token + * @type {string} + * @memberof OAuth2Token + */ + scope?: string; + /** + * The type of the token issued + * @type {string} + * @memberof OAuth2Token + */ + token_type?: string; +} +/** + * + * @export + * @interface OIDCConfig + */ +export interface OIDCConfig { + /** + * OAuth 2.0 Authorization Endpoint URL + * @type {string} + * @memberof OIDCConfig + */ + authorization_endpoint: string; + /** + * OpenID Connect Back-Channel Logout Session Required. Boolean value specifying whether the OP can pass a sid (session ID) Claim in the Logout Token to identify the RP session with the OP. If supported, the sid Claim is also included in ID Tokens issued by the OP + * @type {boolean} + * @memberof OIDCConfig + */ + backchannel_logout_session_supported?: boolean; + /** + * OpenID Connect Back-Channel Logout Supported. Boolean value specifying whether the OP supports back-channel logout, with true indicating support. + * @type {boolean} + * @memberof OIDCConfig + */ + backchannel_logout_supported?: boolean; + /** + * OpenID Connect Claims Parameter Parameter Supported Boolean value specifying whether the OP supports use of the claims parameter, with true indicating support. + * @type {boolean} + * @memberof OIDCConfig + */ + claims_parameter_supported?: boolean; + /** + * OpenID Connect Supported Claims JSON array containing a list of the Claim Names of the Claims that the OpenID Provider MAY be able to supply values for. Note that for privacy or other reasons, this might not be an exhaustive list. + * @type {Array} + * @memberof OIDCConfig + */ + claims_supported?: Array; + /** + * OAuth 2.0 PKCE Supported Code Challenge Methods JSON array containing a list of Proof Key for Code Exchange (PKCE) [RFC7636] code challenge methods supported by this authorization server. + * @type {Array} + * @memberof OIDCConfig + */ + code_challenge_methods_supported?: Array; + /** + * OpenID Connect Verifiable Credentials Endpoint Contains the URL of the Verifiable Credentials Endpoint. + * @type {string} + * @memberof OIDCConfig + */ + credentials_endpoint_draft_00?: string; + /** + * OpenID Connect Verifiable Credentials Supported JSON array containing a list of the Verifiable Credentials supported by this authorization server. + * @type {Array} + * @memberof OIDCConfig + */ + credentials_supported_draft_00?: Array; + /** + * OpenID Connect End-Session Endpoint URL at the OP to which an RP can perform a redirect to request that the End-User be logged out at the OP. + * @type {string} + * @memberof OIDCConfig + */ + end_session_endpoint?: string; + /** + * OpenID Connect Front-Channel Logout Session Required Boolean value specifying whether the OP can pass iss (issuer) and sid (session ID) query parameters to identify the RP session with the OP when the frontchannel_logout_uri is used. If supported, the sid Claim is also included in ID Tokens issued by the OP. + * @type {boolean} + * @memberof OIDCConfig + */ + frontchannel_logout_session_supported?: boolean; + /** + * OpenID Connect Front-Channel Logout Supported Boolean value specifying whether the OP supports HTTP-based logout, with true indicating support. + * @type {boolean} + * @memberof OIDCConfig + */ + frontchannel_logout_supported?: boolean; + /** + * OAuth 2.0 Supported Grant Types JSON array containing a list of the OAuth 2.0 Grant Type values that this OP supports. + * @type {Array} + * @memberof OIDCConfig + */ + grant_types_supported?: Array; + /** + * OpenID Connect Default ID Token Signing Algorithms Algorithm used to sign OpenID Connect ID Tokens. + * @type {Array} + * @memberof OIDCConfig + */ + id_token_signed_response_alg: Array; + /** + * OpenID Connect Supported ID Token Signing Algorithms JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for the ID Token to encode the Claims in a JWT. + * @type {Array} + * @memberof OIDCConfig + */ + id_token_signing_alg_values_supported: Array; + /** + * OpenID Connect Issuer URL An URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. + * @type {string} + * @memberof OIDCConfig + */ + issuer: string; + /** + * OpenID Connect Well-Known JSON Web Keys URL URL of the OP\'s JSON Web Key Set [JWK] document. This contains the signing key(s) the RP uses to validate signatures from the OP. The JWK Set MAY also contain the Server\'s encryption key(s), which are used by RPs to encrypt requests to the Server. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key\'s intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. + * @type {string} + * @memberof OIDCConfig + */ + jwks_uri: string; + /** + * OpenID Connect Dynamic Client Registration Endpoint URL + * @type {string} + * @memberof OIDCConfig + */ + registration_endpoint?: string; + /** + * OpenID Connect Supported Request Object Signing Algorithms JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for Request Objects, which are described in Section 6.1 of OpenID Connect Core 1.0 [OpenID.Core]. These algorithms are used both when the Request Object is passed by value (using the request parameter) and when it is passed by reference (using the request_uri parameter). + * @type {Array} + * @memberof OIDCConfig + */ + request_object_signing_alg_values_supported?: Array; + /** + * OpenID Connect Request Parameter Supported Boolean value specifying whether the OP supports use of the request parameter, with true indicating support. + * @type {boolean} + * @memberof OIDCConfig + */ + request_parameter_supported?: boolean; + /** + * OpenID Connect Request URI Parameter Supported Boolean value specifying whether the OP supports use of the request_uri parameter, with true indicating support. + * @type {boolean} + * @memberof OIDCConfig + */ + request_uri_parameter_supported?: boolean; + /** + * OpenID Connect Requires Request URI Registration Boolean value specifying whether the OP requires any request_uri values used to be pre-registered using the request_uris registration parameter. + * @type {boolean} + * @memberof OIDCConfig + */ + require_request_uri_registration?: boolean; + /** + * OAuth 2.0 Supported Response Modes JSON array containing a list of the OAuth 2.0 response_mode values that this OP supports. + * @type {Array} + * @memberof OIDCConfig + */ + response_modes_supported?: Array; + /** + * OAuth 2.0 Supported Response Types JSON array containing a list of the OAuth 2.0 response_type values that this OP supports. Dynamic OpenID Providers MUST support the code, id_token, and the token id_token Response Type values. + * @type {Array} + * @memberof OIDCConfig + */ + response_types_supported: Array; + /** + * OAuth 2.0 Token Revocation URL URL of the authorization server\'s OAuth 2.0 revocation endpoint. + * @type {string} + * @memberof OIDCConfig + */ + revocation_endpoint?: string; + /** + * OAuth 2.0 Supported Scope Values JSON array containing a list of the OAuth 2.0 [RFC6749] scope values that this server supports. The server MUST support the openid scope value. Servers MAY choose not to advertise some supported scope values even when this parameter is used + * @type {Array} + * @memberof OIDCConfig + */ + scopes_supported?: Array; + /** + * OpenID Connect Supported Subject Types JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include pairwise and public. + * @type {Array} + * @memberof OIDCConfig + */ + subject_types_supported: Array; + /** + * OAuth 2.0 Token Endpoint URL + * @type {string} + * @memberof OIDCConfig + */ + token_endpoint: string; + /** + * OAuth 2.0 Supported Client Authentication Methods JSON array containing a list of Client Authentication methods supported by this Token Endpoint. The options are client_secret_post, client_secret_basic, client_secret_jwt, and private_key_jwt, as described in Section 9 of OpenID Connect Core 1.0 + * @type {Array} + * @memberof OIDCConfig + */ + token_endpoint_auth_methods_supported?: Array; + /** + * OpenID Connect Userinfo URL URL of the OP\'s UserInfo Endpoint. + * @type {string} + * @memberof OIDCConfig + */ + userinfo_endpoint?: string; + /** + * OpenID Connect User Userinfo Signing Algorithm Algorithm used to sign OpenID Connect Userinfo Responses. + * @type {Array} + * @memberof OIDCConfig + */ + userinfo_signed_response_alg: Array; + /** + * OpenID Connect Supported Userinfo Signing Algorithm JSON array containing a list of the JWS [JWS] signing algorithms (alg values) [JWA] supported by the UserInfo Endpoint to encode the Claims in a JWT [JWT]. + * @type {Array} + * @memberof OIDCConfig + */ + userinfo_signing_alg_values_supported?: Array; +} +/** + * + * @export + * @interface OIDCConfigCredentialsSupportedDraft00Inner + */ +export interface OIDCConfigCredentialsSupportedDraft00Inner { + /** + * + * @type {Array} + * @memberof OIDCConfigCredentialsSupportedDraft00Inner + */ + cryptographic_binding_methods_supported?: Array; + /** + * + * @type {Array} + * @memberof OIDCConfigCredentialsSupportedDraft00Inner + */ + cryptographic_suites_supported?: Array; + /** + * + * @type {string} + * @memberof OIDCConfigCredentialsSupportedDraft00Inner + */ + format?: string; + /** + * + * @type {Array} + * @memberof OIDCConfigCredentialsSupportedDraft00Inner + */ + types?: Array; +} +/** + * Redirect Response + * @export + * @interface RedirectResponse + */ +export interface RedirectResponse { + /** + * type + * @type {string} + * @memberof RedirectResponse + */ + type: RedirectResponseTypeEnum; + /** + * URL to redirect to + * @type {string} + * @memberof RedirectResponse + */ + to: string; +} + +export const RedirectResponseTypeEnum = { + RedirectResponse: 'REDIRECT_RESPONSE', +} as const; + +export type RedirectResponseTypeEnum = + (typeof RedirectResponseTypeEnum)[keyof typeof RedirectResponseTypeEnum]; + +/** + * input used to remove a user from a group + * @export + * @interface RemoveUserFromGroupInput + */ +export interface RemoveUserFromGroupInput { + /** + * Unique identifier of the user + * @type {string} + * @memberof RemoveUserFromGroupInput + */ + userId: string; +} +/** + * + * @export + * @interface ResourceCreationError + */ +export interface ResourceCreationError { + /** + * + * @type {string} + * @memberof ResourceCreationError + */ + name: ResourceCreationErrorNameEnum; + /** + * + * @type {string} + * @memberof ResourceCreationError + */ + message: ResourceCreationErrorMessageEnum; + /** + * + * @type {number} + * @memberof ResourceCreationError + */ + httpStatusCode: ResourceCreationErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof ResourceCreationError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof ResourceCreationError + */ + details?: Array; +} + +export const ResourceCreationErrorNameEnum = { + ResourceCreationError: 'ResourceCreationError', +} as const; + +export type ResourceCreationErrorNameEnum = + (typeof ResourceCreationErrorNameEnum)[keyof typeof ResourceCreationErrorNameEnum]; +export const ResourceCreationErrorMessageEnum = { + FailedToCreateResources: 'Failed to create resources.', +} as const; + +export type ResourceCreationErrorMessageEnum = + (typeof ResourceCreationErrorMessageEnum)[keyof typeof ResourceCreationErrorMessageEnum]; +export const ResourceCreationErrorHttpStatusCodeEnum = { + NUMBER_424: 424, +} as const; + +export type ResourceCreationErrorHttpStatusCodeEnum = + (typeof ResourceCreationErrorHttpStatusCodeEnum)[keyof typeof ResourceCreationErrorHttpStatusCodeEnum]; + +/** + * Service Error Response + * @export + * @interface ServiceErrorResponse + */ +export interface ServiceErrorResponse { + /** + * unique id for correlating this specific error to logs + * @type {string} + * @memberof ServiceErrorResponse + */ + debugId: string; + /** + * name of the error + * @type {string} + * @memberof ServiceErrorResponse + */ + name: string; + /** + * backwards compatible Affinidi error code + * @type {string} + * @memberof ServiceErrorResponse + */ + code: string; + /** + * error details + * @type {Array} + * @memberof ServiceErrorResponse + */ + details?: Array; +} +/** + * + * @export + * @interface ServiceErrorResponseDetailsInner + */ +export interface ServiceErrorResponseDetailsInner { + /** + * issue + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + issue: string; + /** + * fields + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + field?: string; + /** + * value + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + value?: string; + /** + * location + * @type {string} + * @memberof ServiceErrorResponseDetailsInner + */ + location?: string; +} +/** + * Requested Client Authentication method for the Token Endpoint. The options are: `client_secret_post`: (default) Send client_id and client_secret as application/x-www-form-urlencoded in the HTTP body. `client_secret_basic`: Send client_id and client_secret as application/x-www-form-urlencoded encoded in the HTTP Authorization header. `none`: For public clients (native/mobile apps) which can not have secret. + * @export + * @enum {string} + */ + +export const TokenEndpointAuthMethod = { + ClientSecretBasic: 'client_secret_basic', + ClientSecretPost: 'client_secret_post', + None: 'none', +} as const; + +export type TokenEndpointAuthMethod = + (typeof TokenEndpointAuthMethod)[keyof typeof TokenEndpointAuthMethod]; + +/** + * + * @export + * @interface UpdateLoginConfigurationInput + */ +export interface UpdateLoginConfigurationInput { + /** + * User defined login configuration name + * @type {string} + * @memberof UpdateLoginConfigurationInput + */ + name?: string; + /** + * OAuth 2.0 Redirect URIs + * @type {Array} + * @memberof UpdateLoginConfigurationInput + */ + redirectUris?: Array; + /** + * OAuth2 client secret + * @type {string} + * @memberof UpdateLoginConfigurationInput + */ + clientSecret?: string; + /** + * VP definition in JSON stringify format + * @type {string} + * @memberof UpdateLoginConfigurationInput + */ + vpDefinition?: string; + /** + * Presentation Definition + * @type {object} + * @memberof UpdateLoginConfigurationInput + */ + presentationDefinition?: object; + /** + * + * @type {IdTokenMapping} + * @memberof UpdateLoginConfigurationInput + */ + idTokenMapping?: IdTokenMapping; + /** + * + * @type {LoginConfigurationClientMetadata} + * @memberof UpdateLoginConfigurationInput + */ + clientMetadata?: LoginConfigurationClientMetadata; + /** + * + * @type {TokenEndpointAuthMethod} + * @memberof UpdateLoginConfigurationInput + */ + tokenEndpointAuthMethod?: TokenEndpointAuthMethod; + /** + * Interrupts login process if duplications of data fields names will be found + * @type {boolean} + * @memberof UpdateLoginConfigurationInput + */ + failOnMappingConflict?: boolean; +} + +/** + * + * @export + * @interface VPTokenValidationError + */ +export interface VPTokenValidationError { + /** + * + * @type {string} + * @memberof VPTokenValidationError + */ + name: VPTokenValidationErrorNameEnum; + /** + * + * @type {string} + * @memberof VPTokenValidationError + */ + message: VPTokenValidationErrorMessageEnum; + /** + * + * @type {number} + * @memberof VPTokenValidationError + */ + httpStatusCode: VPTokenValidationErrorHttpStatusCodeEnum; + /** + * + * @type {string} + * @memberof VPTokenValidationError + */ + traceId: string; + /** + * + * @type {Array} + * @memberof VPTokenValidationError + */ + details?: Array; +} + +export const VPTokenValidationErrorNameEnum = { + VpTokenValidationError: 'VPTokenValidationError', +} as const; + +export type VPTokenValidationErrorNameEnum = + (typeof VPTokenValidationErrorNameEnum)[keyof typeof VPTokenValidationErrorNameEnum]; +export const VPTokenValidationErrorMessageEnum = { + VpTokenValidationEndedWithAnError: 'VP token validation ended with an error', +} as const; + +export type VPTokenValidationErrorMessageEnum = + (typeof VPTokenValidationErrorMessageEnum)[keyof typeof VPTokenValidationErrorMessageEnum]; +export const VPTokenValidationErrorHttpStatusCodeEnum = { + NUMBER_400: 400, +} as const; + +export type VPTokenValidationErrorHttpStatusCodeEnum = + (typeof VPTokenValidationErrorHttpStatusCodeEnum)[keyof typeof VPTokenValidationErrorHttpStatusCodeEnum]; + +/** + * AllowListApi - axios parameter creator + * @export + */ +export const AllowListApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Allow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + allowGroups: async ( + groupNamesInput?: GroupNamesInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/allow-list/groups/add`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + groupNamesInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Disallow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + disallowGroups: async ( + groupNamesInput?: GroupNamesInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/allow-list/groups/remove`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + groupNamesInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get Allowed Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllowedGroups: async ( + pageToken?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/allow-list/groups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (pageToken !== undefined) { + localVarQueryParameter['pageToken'] = pageToken; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * AllowListApi - functional programming interface + * @export + */ +export const AllowListApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + AllowListApiAxiosParamCreator(configuration); + return { + /** + * Allow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async allowGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.allowGroups( + groupNamesInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['AllowListApi.allowGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Disallow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async disallowGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.disallowGroups( + groupNamesInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['AllowListApi.disallowGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Get Allowed Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listAllowedGroups( + pageToken?: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listAllowedGroups(pageToken, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['AllowListApi.listAllowedGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * AllowListApi - factory interface + * @export + */ +export const AllowListApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = AllowListApiFp(configuration); + return { + /** + * Allow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + allowGroups( + groupNamesInput?: GroupNamesInput, + options?: any + ): AxiosPromise { + return localVarFp + .allowGroups(groupNamesInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * Disallow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + disallowGroups( + groupNamesInput?: GroupNamesInput, + options?: any + ): AxiosPromise { + return localVarFp + .disallowGroups(groupNamesInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * Get Allowed Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listAllowedGroups( + pageToken?: string, + options?: any + ): AxiosPromise { + return localVarFp + .listAllowedGroups(pageToken, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * AllowListApi - object-oriented interface + * @export + * @class AllowListApi + * @extends {BaseAPI} + */ +export class AllowListApi extends BaseAPI { + /** + * Allow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AllowListApi + */ + public allowGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ) { + return AllowListApiFp(this.configuration) + .allowGroups(groupNamesInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Disallow Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AllowListApi + */ + public disallowGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ) { + return AllowListApiFp(this.configuration) + .disallowGroups(groupNamesInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get Allowed Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AllowListApi + */ + public listAllowedGroups( + pageToken?: string, + options?: RawAxiosRequestConfig + ) { + return AllowListApiFp(this.configuration) + .listAllowedGroups(pageToken, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * ConfigurationApi - axios parameter creator + * @export + */ +export const ConfigurationApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Create a new login configuration `vpDefinition` and `idTokenMapping` have default settings that provide user email VP presentation definitions. An essential default definition is in place when it comes to the login process for end users using the Chrome extension. This definition requires users to input their email address as OIDCVP compliant, which is then verified by the Affinidi verification service. + * @summary Create a new login configuration + * @param {CreateLoginConfigurationInput} [createLoginConfigurationInput] CreateLoginConfigurations + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createLoginConfigurations: async ( + createLoginConfigurationInput?: CreateLoginConfigurationInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/login/configurations`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + createLoginConfigurationInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete login configurations by ID + * @summary Delete login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteLoginConfigurationsById: async ( + configurationId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'configurationId' is not null or undefined + assertParamExists( + 'deleteLoginConfigurationsById', + 'configurationId', + configurationId + ); + const localVarPath = `/v1/login/configurations/{configurationId}`.replace( + `{${'configurationId'}}`, + encodeURIComponent(String(configurationId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get Client Metadata By OAuth 2.0 Client ID + * @summary Get Client Metadata By OAuth 2.0 Client ID + * @param {string} clientId OAuth 2.0 Client ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getClientMetadataByClientId: async ( + clientId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'clientId' is not null or undefined + assertParamExists('getClientMetadataByClientId', 'clientId', clientId); + const localVarPath = + `/v1/login/configurations/metadata/{clientId}`.replace( + `{${'clientId'}}`, + encodeURIComponent(String(clientId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get login configuration by ID + * @summary Get login configuration by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLoginConfigurationsById: async ( + configurationId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'configurationId' is not null or undefined + assertParamExists( + 'getLoginConfigurationsById', + 'configurationId', + configurationId + ); + const localVarPath = `/v1/login/configurations/{configurationId}`.replace( + `{${'configurationId'}}`, + encodeURIComponent(String(configurationId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Endpoint to retrieve list of login configurations + * @summary List login configurations + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLoginConfigurations: async ( + limit?: number, + exclusiveStartKey?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/login/configurations`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (exclusiveStartKey !== undefined) { + localVarQueryParameter['exclusiveStartKey'] = exclusiveStartKey; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update login configurations by ID + * @summary Update login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {UpdateLoginConfigurationInput} [updateLoginConfigurationInput] UpdateLoginConfigurationsById + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateLoginConfigurationsById: async ( + configurationId: string, + updateLoginConfigurationInput?: UpdateLoginConfigurationInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'configurationId' is not null or undefined + assertParamExists( + 'updateLoginConfigurationsById', + 'configurationId', + configurationId + ); + const localVarPath = `/v1/login/configurations/{configurationId}`.replace( + `{${'configurationId'}}`, + encodeURIComponent(String(configurationId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + updateLoginConfigurationInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * ConfigurationApi - functional programming interface + * @export + */ +export const ConfigurationApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = + ConfigurationApiAxiosParamCreator(configuration); + return { + /** + * Create a new login configuration `vpDefinition` and `idTokenMapping` have default settings that provide user email VP presentation definitions. An essential default definition is in place when it comes to the login process for end users using the Chrome extension. This definition requires users to input their email address as OIDCVP compliant, which is then verified by the Affinidi verification service. + * @summary Create a new login configuration + * @param {CreateLoginConfigurationInput} [createLoginConfigurationInput] CreateLoginConfigurations + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createLoginConfigurations( + createLoginConfigurationInput?: CreateLoginConfigurationInput, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createLoginConfigurations( + createLoginConfigurationInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConfigurationApi.createLoginConfigurations']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Delete login configurations by ID + * @summary Delete login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteLoginConfigurationsById( + configurationId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deleteLoginConfigurationsById( + configurationId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConfigurationApi.deleteLoginConfigurationsById']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Get Client Metadata By OAuth 2.0 Client ID + * @summary Get Client Metadata By OAuth 2.0 Client ID + * @param {string} clientId OAuth 2.0 Client ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getClientMetadataByClientId( + clientId: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getClientMetadataByClientId( + clientId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConfigurationApi.getClientMetadataByClientId']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Get login configuration by ID + * @summary Get login configuration by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLoginConfigurationsById( + configurationId: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getLoginConfigurationsById( + configurationId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConfigurationApi.getLoginConfigurationsById']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Endpoint to retrieve list of login configurations + * @summary List login configurations + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listLoginConfigurations( + limit?: number, + exclusiveStartKey?: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listLoginConfigurations( + limit, + exclusiveStartKey, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConfigurationApi.listLoginConfigurations']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Update login configurations by ID + * @summary Update login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {UpdateLoginConfigurationInput} [updateLoginConfigurationInput] UpdateLoginConfigurationsById + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateLoginConfigurationsById( + configurationId: string, + updateLoginConfigurationInput?: UpdateLoginConfigurationInput, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updateLoginConfigurationsById( + configurationId, + updateLoginConfigurationInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConfigurationApi.updateLoginConfigurationsById']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * ConfigurationApi - factory interface + * @export + */ +export const ConfigurationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ConfigurationApiFp(configuration); + return { + /** + * Create a new login configuration `vpDefinition` and `idTokenMapping` have default settings that provide user email VP presentation definitions. An essential default definition is in place when it comes to the login process for end users using the Chrome extension. This definition requires users to input their email address as OIDCVP compliant, which is then verified by the Affinidi verification service. + * @summary Create a new login configuration + * @param {CreateLoginConfigurationInput} [createLoginConfigurationInput] CreateLoginConfigurations + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createLoginConfigurations( + createLoginConfigurationInput?: CreateLoginConfigurationInput, + options?: any + ): AxiosPromise { + return localVarFp + .createLoginConfigurations(createLoginConfigurationInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * Delete login configurations by ID + * @summary Delete login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteLoginConfigurationsById( + configurationId: string, + options?: any + ): AxiosPromise { + return localVarFp + .deleteLoginConfigurationsById(configurationId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Get Client Metadata By OAuth 2.0 Client ID + * @summary Get Client Metadata By OAuth 2.0 Client ID + * @param {string} clientId OAuth 2.0 Client ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getClientMetadataByClientId( + clientId: string, + options?: any + ): AxiosPromise { + return localVarFp + .getClientMetadataByClientId(clientId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Get login configuration by ID + * @summary Get login configuration by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLoginConfigurationsById( + configurationId: string, + options?: any + ): AxiosPromise { + return localVarFp + .getLoginConfigurationsById(configurationId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Endpoint to retrieve list of login configurations + * @summary List login configurations + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLoginConfigurations( + limit?: number, + exclusiveStartKey?: string, + options?: any + ): AxiosPromise { + return localVarFp + .listLoginConfigurations(limit, exclusiveStartKey, options) + .then((request) => request(axios, basePath)); + }, + /** + * Update login configurations by ID + * @summary Update login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {UpdateLoginConfigurationInput} [updateLoginConfigurationInput] UpdateLoginConfigurationsById + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateLoginConfigurationsById( + configurationId: string, + updateLoginConfigurationInput?: UpdateLoginConfigurationInput, + options?: any + ): AxiosPromise { + return localVarFp + .updateLoginConfigurationsById( + configurationId, + updateLoginConfigurationInput, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ConfigurationApi - object-oriented interface + * @export + * @class ConfigurationApi + * @extends {BaseAPI} + */ +export class ConfigurationApi extends BaseAPI { + /** + * Create a new login configuration `vpDefinition` and `idTokenMapping` have default settings that provide user email VP presentation definitions. An essential default definition is in place when it comes to the login process for end users using the Chrome extension. This definition requires users to input their email address as OIDCVP compliant, which is then verified by the Affinidi verification service. + * @summary Create a new login configuration + * @param {CreateLoginConfigurationInput} [createLoginConfigurationInput] CreateLoginConfigurations + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConfigurationApi + */ + public createLoginConfigurations( + createLoginConfigurationInput?: CreateLoginConfigurationInput, + options?: RawAxiosRequestConfig + ) { + return ConfigurationApiFp(this.configuration) + .createLoginConfigurations(createLoginConfigurationInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete login configurations by ID + * @summary Delete login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConfigurationApi + */ + public deleteLoginConfigurationsById( + configurationId: string, + options?: RawAxiosRequestConfig + ) { + return ConfigurationApiFp(this.configuration) + .deleteLoginConfigurationsById(configurationId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get Client Metadata By OAuth 2.0 Client ID + * @summary Get Client Metadata By OAuth 2.0 Client ID + * @param {string} clientId OAuth 2.0 Client ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConfigurationApi + */ + public getClientMetadataByClientId( + clientId: string, + options?: RawAxiosRequestConfig + ) { + return ConfigurationApiFp(this.configuration) + .getClientMetadataByClientId(clientId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get login configuration by ID + * @summary Get login configuration by ID + * @param {string} configurationId The id of the login configuration + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConfigurationApi + */ + public getLoginConfigurationsById( + configurationId: string, + options?: RawAxiosRequestConfig + ) { + return ConfigurationApiFp(this.configuration) + .getLoginConfigurationsById(configurationId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Endpoint to retrieve list of login configurations + * @summary List login configurations + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConfigurationApi + */ + public listLoginConfigurations( + limit?: number, + exclusiveStartKey?: string, + options?: RawAxiosRequestConfig + ) { + return ConfigurationApiFp(this.configuration) + .listLoginConfigurations(limit, exclusiveStartKey, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update login configurations by ID + * @summary Update login configurations by ID + * @param {string} configurationId The id of the login configuration + * @param {UpdateLoginConfigurationInput} [updateLoginConfigurationInput] UpdateLoginConfigurationsById + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConfigurationApi + */ + public updateLoginConfigurationsById( + configurationId: string, + updateLoginConfigurationInput?: UpdateLoginConfigurationInput, + options?: RawAxiosRequestConfig + ) { + return ConfigurationApiFp(this.configuration) + .updateLoginConfigurationsById( + configurationId, + updateLoginConfigurationInput, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * ConsentApi - axios parameter creator + * @export + */ +export const ConsentApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * IDP consent request automated by adapter frontend + * @summary IDP consent request automated by adapter frontend + * @param {string} [consentChallenge] Consent challenge provided by IDP + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + consentRequest: async ( + consentChallenge?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/consent/request`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (consentChallenge !== undefined) { + localVarQueryParameter['consent_challenge'] = consentChallenge; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * ConsentApi - functional programming interface + * @export + */ +export const ConsentApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = ConsentApiAxiosParamCreator(configuration); + return { + /** + * IDP consent request automated by adapter frontend + * @summary IDP consent request automated by adapter frontend + * @param {string} [consentChallenge] Consent challenge provided by IDP + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async consentRequest( + consentChallenge?: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.consentRequest( + consentChallenge, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['ConsentApi.consentRequest']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * ConsentApi - factory interface + * @export + */ +export const ConsentApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ConsentApiFp(configuration); + return { + /** + * IDP consent request automated by adapter frontend + * @summary IDP consent request automated by adapter frontend + * @param {string} [consentChallenge] Consent challenge provided by IDP + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + consentRequest( + consentChallenge?: string, + options?: any + ): AxiosPromise { + return localVarFp + .consentRequest(consentChallenge, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ConsentApi - object-oriented interface + * @export + * @class ConsentApi + * @extends {BaseAPI} + */ +export class ConsentApi extends BaseAPI { + /** + * IDP consent request automated by adapter frontend + * @summary IDP consent request automated by adapter frontend + * @param {string} [consentChallenge] Consent challenge provided by IDP + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ConsentApi + */ + public consentRequest( + consentChallenge?: string, + options?: RawAxiosRequestConfig + ) { + return ConsentApiFp(this.configuration) + .consentRequest(consentChallenge, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * CorsApi - axios parameter creator + * @export + */ +export const CorsApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsLoginSessionAcceptResponse: async ( + sessionId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'sessionId' is not null or undefined + assertParamExists( + 'corsLoginSessionAcceptResponse', + 'sessionId', + sessionId + ); + const localVarPath = + `/v1/login/sessions/{sessionId}/accept-response`.replace( + `{${'sessionId'}}`, + encodeURIComponent(String(sessionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsLoginSessionForIdp: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/login/sessions/for-idp`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsLoginSessionRejectResponse: async ( + sessionId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'sessionId' is not null or undefined + assertParamExists( + 'corsLoginSessionRejectResponse', + 'sessionId', + sessionId + ); + const localVarPath = + `/v1/login/sessions/{sessionId}/reject-response`.replace( + `{${'sessionId'}}`, + encodeURIComponent(String(sessionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'OPTIONS', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * CorsApi - functional programming interface + * @export + */ +export const CorsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = CorsApiAxiosParamCreator(configuration); + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsLoginSessionAcceptResponse( + sessionId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsLoginSessionAcceptResponse( + sessionId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsLoginSessionAcceptResponse']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsLoginSessionForIdp( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsLoginSessionForIdp(options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsLoginSessionForIdp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async corsLoginSessionRejectResponse( + sessionId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.corsLoginSessionRejectResponse( + sessionId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['CorsApi.corsLoginSessionRejectResponse']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * CorsApi - factory interface + * @export + */ +export const CorsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = CorsApiFp(configuration); + return { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsLoginSessionAcceptResponse( + sessionId: string, + options?: any + ): AxiosPromise { + return localVarFp + .corsLoginSessionAcceptResponse(sessionId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsLoginSessionForIdp(options?: any): AxiosPromise { + return localVarFp + .corsLoginSessionForIdp(options) + .then((request) => request(axios, basePath)); + }, + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + corsLoginSessionRejectResponse( + sessionId: string, + options?: any + ): AxiosPromise { + return localVarFp + .corsLoginSessionRejectResponse(sessionId, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CorsApi - object-oriented interface + * @export + * @class CorsApi + * @extends {BaseAPI} + */ +export class CorsApi extends BaseAPI { + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsLoginSessionAcceptResponse( + sessionId: string, + options?: RawAxiosRequestConfig + ) { + return CorsApiFp(this.configuration) + .corsLoginSessionAcceptResponse(sessionId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsLoginSessionForIdp(options?: RawAxiosRequestConfig) { + return CorsApiFp(this.configuration) + .corsLoginSessionForIdp(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Enable CORS by returning correct headers + * @summary CORS Support + * @param {string} sessionId The id of the login session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CorsApi + */ + public corsLoginSessionRejectResponse( + sessionId: string, + options?: RawAxiosRequestConfig + ) { + return CorsApiFp(this.configuration) + .corsLoginSessionRejectResponse(sessionId, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * DefaultApi - axios parameter creator + * @export + */ +export const DefaultApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyDelete: async ( + proxy: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'proxy' is not null or undefined + assertParamExists('v1LoginAdminProxyDelete', 'proxy', proxy); + const localVarPath = `/v1/login/admin/{proxy+}`.replace( + `{${'proxy'}}`, + encodeURIComponent(String(proxy)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyGet: async ( + proxy: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'proxy' is not null or undefined + assertParamExists('v1LoginAdminProxyGet', 'proxy', proxy); + const localVarPath = `/v1/login/admin/{proxy+}`.replace( + `{${'proxy'}}`, + encodeURIComponent(String(proxy)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyPatch: async ( + proxy: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'proxy' is not null or undefined + assertParamExists('v1LoginAdminProxyPatch', 'proxy', proxy); + const localVarPath = `/v1/login/admin/{proxy+}`.replace( + `{${'proxy'}}`, + encodeURIComponent(String(proxy)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PATCH', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyPost: async ( + proxy: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'proxy' is not null or undefined + assertParamExists('v1LoginAdminProxyPost', 'proxy', proxy); + const localVarPath = `/v1/login/admin/{proxy+}`.replace( + `{${'proxy'}}`, + encodeURIComponent(String(proxy)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyPut: async ( + proxy: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'proxy' is not null or undefined + assertParamExists('v1LoginAdminProxyPut', 'proxy', proxy); + const localVarPath = `/v1/login/admin/{proxy+}`.replace( + `{${'proxy'}}`, + encodeURIComponent(String(proxy)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'PUT', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * DefaultApi - functional programming interface + * @export + */ +export const DefaultApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration); + return { + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginAdminProxyDelete( + proxy: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginAdminProxyDelete(proxy, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DefaultApi.v1LoginAdminProxyDelete']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginAdminProxyGet( + proxy: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginAdminProxyGet(proxy, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DefaultApi.v1LoginAdminProxyGet']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginAdminProxyPatch( + proxy: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginAdminProxyPatch(proxy, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DefaultApi.v1LoginAdminProxyPatch']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginAdminProxyPost( + proxy: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginAdminProxyPost(proxy, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DefaultApi.v1LoginAdminProxyPost']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginAdminProxyPut( + proxy: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginAdminProxyPut(proxy, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DefaultApi.v1LoginAdminProxyPut']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * DefaultApi - factory interface + * @export + */ +export const DefaultApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = DefaultApiFp(configuration); + return { + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyDelete(proxy: string, options?: any): AxiosPromise { + return localVarFp + .v1LoginAdminProxyDelete(proxy, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyGet(proxy: string, options?: any): AxiosPromise { + return localVarFp + .v1LoginAdminProxyGet(proxy, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyPatch(proxy: string, options?: any): AxiosPromise { + return localVarFp + .v1LoginAdminProxyPatch(proxy, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyPost(proxy: string, options?: any): AxiosPromise { + return localVarFp + .v1LoginAdminProxyPost(proxy, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginAdminProxyPut(proxy: string, options?: any): AxiosPromise { + return localVarFp + .v1LoginAdminProxyPut(proxy, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DefaultApi - object-oriented interface + * @export + * @class DefaultApi + * @extends {BaseAPI} + */ +export class DefaultApi extends BaseAPI { + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public v1LoginAdminProxyDelete( + proxy: string, + options?: RawAxiosRequestConfig + ) { + return DefaultApiFp(this.configuration) + .v1LoginAdminProxyDelete(proxy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public v1LoginAdminProxyGet(proxy: string, options?: RawAxiosRequestConfig) { + return DefaultApiFp(this.configuration) + .v1LoginAdminProxyGet(proxy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public v1LoginAdminProxyPatch( + proxy: string, + options?: RawAxiosRequestConfig + ) { + return DefaultApiFp(this.configuration) + .v1LoginAdminProxyPatch(proxy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public v1LoginAdminProxyPost(proxy: string, options?: RawAxiosRequestConfig) { + return DefaultApiFp(this.configuration) + .v1LoginAdminProxyPost(proxy, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} proxy + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public v1LoginAdminProxyPut(proxy: string, options?: RawAxiosRequestConfig) { + return DefaultApiFp(this.configuration) + .v1LoginAdminProxyPut(proxy, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * DenyListApi - axios parameter creator + * @export + */ +export const DenyListApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Block Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + blockGroups: async ( + groupNamesInput?: GroupNamesInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/deny-list/groups/add`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + groupNamesInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Block Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + blockUsers: async ( + blockedUsersInput?: BlockedUsersInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/deny-list/users/add`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + blockedUsersInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get Blocked Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listBlockedGroups: async ( + pageToken?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/deny-list/groups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (pageToken !== undefined) { + localVarQueryParameter['pageToken'] = pageToken; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get List of Blocked Users + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listBlockedUsers: async ( + pageToken?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/deny-list/users`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (pageToken !== undefined) { + localVarQueryParameter['pageToken'] = pageToken; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Unblock Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unblockGroups: async ( + groupNamesInput?: GroupNamesInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/deny-list/groups/remove`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + groupNamesInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Unblock Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unblockUsers: async ( + blockedUsersInput?: BlockedUsersInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/deny-list/users/remove`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + blockedUsersInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * DenyListApi - functional programming interface + * @export + */ +export const DenyListApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = DenyListApiAxiosParamCreator(configuration); + return { + /** + * Block Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async blockGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.blockGroups( + groupNamesInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DenyListApi.blockGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Block Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async blockUsers( + blockedUsersInput?: BlockedUsersInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.blockUsers( + blockedUsersInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DenyListApi.blockUsers']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Get Blocked Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listBlockedGroups( + pageToken?: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listBlockedGroups(pageToken, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DenyListApi.listBlockedGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Get List of Blocked Users + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listBlockedUsers( + pageToken?: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listBlockedUsers(pageToken, options); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DenyListApi.listBlockedUsers']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Unblock Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async unblockGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.unblockGroups( + groupNamesInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DenyListApi.unblockGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Unblock Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async unblockUsers( + blockedUsersInput?: BlockedUsersInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.unblockUsers( + blockedUsersInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['DenyListApi.unblockUsers']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * DenyListApi - factory interface + * @export + */ +export const DenyListApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = DenyListApiFp(configuration); + return { + /** + * Block Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + blockGroups( + groupNamesInput?: GroupNamesInput, + options?: any + ): AxiosPromise { + return localVarFp + .blockGroups(groupNamesInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * Block Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + blockUsers( + blockedUsersInput?: BlockedUsersInput, + options?: any + ): AxiosPromise { + return localVarFp + .blockUsers(blockedUsersInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * Get Blocked Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listBlockedGroups( + pageToken?: string, + options?: any + ): AxiosPromise { + return localVarFp + .listBlockedGroups(pageToken, options) + .then((request) => request(axios, basePath)); + }, + /** + * Get List of Blocked Users + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listBlockedUsers( + pageToken?: string, + options?: any + ): AxiosPromise { + return localVarFp + .listBlockedUsers(pageToken, options) + .then((request) => request(axios, basePath)); + }, + /** + * Unblock Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unblockGroups( + groupNamesInput?: GroupNamesInput, + options?: any + ): AxiosPromise { + return localVarFp + .unblockGroups(groupNamesInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * Unblock Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unblockUsers( + blockedUsersInput?: BlockedUsersInput, + options?: any + ): AxiosPromise { + return localVarFp + .unblockUsers(blockedUsersInput, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DenyListApi - object-oriented interface + * @export + * @class DenyListApi + * @extends {BaseAPI} + */ +export class DenyListApi extends BaseAPI { + /** + * Block Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DenyListApi + */ + public blockGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ) { + return DenyListApiFp(this.configuration) + .blockGroups(groupNamesInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Block Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DenyListApi + */ + public blockUsers( + blockedUsersInput?: BlockedUsersInput, + options?: RawAxiosRequestConfig + ) { + return DenyListApiFp(this.configuration) + .blockUsers(blockedUsersInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get Blocked Groups + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DenyListApi + */ + public listBlockedGroups( + pageToken?: string, + options?: RawAxiosRequestConfig + ) { + return DenyListApiFp(this.configuration) + .listBlockedGroups(pageToken, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get List of Blocked Users + * @param {string} [pageToken] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DenyListApi + */ + public listBlockedUsers(pageToken?: string, options?: RawAxiosRequestConfig) { + return DenyListApiFp(this.configuration) + .listBlockedUsers(pageToken, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Unblock Single or Multiple Groups + * @param {GroupNamesInput} [groupNamesInput] List of group names as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DenyListApi + */ + public unblockGroups( + groupNamesInput?: GroupNamesInput, + options?: RawAxiosRequestConfig + ) { + return DenyListApiFp(this.configuration) + .unblockGroups(groupNamesInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Unblock Single or Multiple user ids + * @param {BlockedUsersInput} [blockedUsersInput] List of blocked users as input + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DenyListApi + */ + public unblockUsers( + blockedUsersInput?: BlockedUsersInput, + options?: RawAxiosRequestConfig + ) { + return DenyListApiFp(this.configuration) + .unblockUsers(blockedUsersInput, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * GroupApi - axios parameter creator + * @export + */ +export const GroupApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * + * @param {string} groupName + * @param {AddUserToGroupInput} addUserToGroupInput AddUserToGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addUserToGroup: async ( + groupName: string, + addUserToGroupInput: AddUserToGroupInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupName' is not null or undefined + assertParamExists('addUserToGroup', 'groupName', groupName); + // verify required parameter 'addUserToGroupInput' is not null or undefined + assertParamExists( + 'addUserToGroup', + 'addUserToGroupInput', + addUserToGroupInput + ); + const localVarPath = `/v1/groups/{groupName}/users`.replace( + `{${'groupName'}}`, + encodeURIComponent(String(groupName)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + addUserToGroupInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {CreateGroupInput} createGroupInput CreateGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroup: async ( + createGroupInput: CreateGroupInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'createGroupInput' is not null or undefined + assertParamExists('createGroup', 'createGroupInput', createGroupInput); + const localVarPath = `/v1/groups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + createGroupInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroup: async ( + groupName: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupName' is not null or undefined + assertParamExists('deleteGroup', 'groupName', groupName); + const localVarPath = `/v1/groups/{groupName}`.replace( + `{${'groupName'}}`, + encodeURIComponent(String(groupName)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGroupById: async ( + groupName: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupName' is not null or undefined + assertParamExists('getGroupById', 'groupName', groupName); + const localVarPath = `/v1/groups/{groupName}`.replace( + `{${'groupName'}}`, + encodeURIComponent(String(groupName)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} groupName + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGroupUserMappings: async ( + groupName: string, + limit?: number, + exclusiveStartKey?: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupName' is not null or undefined + assertParamExists('listGroupUserMappings', 'groupName', groupName); + const localVarPath = `/v1/groups/{groupName}/users`.replace( + `{${'groupName'}}`, + encodeURIComponent(String(groupName)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (exclusiveStartKey !== undefined) { + localVarQueryParameter['exclusiveStartKey'] = exclusiveStartKey; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGroups: async ( + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/groups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {string} groupName + * @param {RemoveUserFromGroupInput} removeUserFromGroupInput Remove user from group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeUserFromGroup: async ( + groupName: string, + removeUserFromGroupInput: RemoveUserFromGroupInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'groupName' is not null or undefined + assertParamExists('removeUserFromGroup', 'groupName', groupName); + // verify required parameter 'removeUserFromGroupInput' is not null or undefined + assertParamExists( + 'removeUserFromGroup', + 'removeUserFromGroupInput', + removeUserFromGroupInput + ); + const localVarPath = `/v1/groups/{groupName}/users`.replace( + `{${'groupName'}}`, + encodeURIComponent(String(groupName)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'DELETE', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ProjectTokenAuth required + await setApiKeyToObject( + localVarHeaderParameter, + 'authorization', + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + removeUserFromGroupInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * GroupApi - functional programming interface + * @export + */ +export const GroupApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = GroupApiAxiosParamCreator(configuration); + return { + /** + * + * @param {string} groupName + * @param {AddUserToGroupInput} addUserToGroupInput AddUserToGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addUserToGroup( + groupName: string, + addUserToGroupInput: AddUserToGroupInput, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.addUserToGroup( + groupName, + addUserToGroupInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.addUserToGroup']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {CreateGroupInput} createGroupInput CreateGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGroup( + createGroupInput: CreateGroupInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGroup( + createGroupInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.createGroup']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGroup( + groupName: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroup( + groupName, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.deleteGroup']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getGroupById( + groupName: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGroupById( + groupName, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.getGroupById']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} groupName + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listGroupUserMappings( + groupName: string, + limit?: number, + exclusiveStartKey?: string, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listGroupUserMappings( + groupName, + limit, + exclusiveStartKey, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.listGroupUserMappings']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listGroups( + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.listGroups( + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.listGroups']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * + * @param {string} groupName + * @param {RemoveUserFromGroupInput} removeUserFromGroupInput Remove user from group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async removeUserFromGroup( + groupName: string, + removeUserFromGroupInput: RemoveUserFromGroupInput, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.removeUserFromGroup( + groupName, + removeUserFromGroupInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['GroupApi.removeUserFromGroup']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * GroupApi - factory interface + * @export + */ +export const GroupApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = GroupApiFp(configuration); + return { + /** + * + * @param {string} groupName + * @param {AddUserToGroupInput} addUserToGroupInput AddUserToGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addUserToGroup( + groupName: string, + addUserToGroupInput: AddUserToGroupInput, + options?: any + ): AxiosPromise { + return localVarFp + .addUserToGroup(groupName, addUserToGroupInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {CreateGroupInput} createGroupInput CreateGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGroup( + createGroupInput: CreateGroupInput, + options?: any + ): AxiosPromise { + return localVarFp + .createGroup(createGroupInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGroup(groupName: string, options?: any): AxiosPromise { + return localVarFp + .deleteGroup(groupName, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGroupById(groupName: string, options?: any): AxiosPromise { + return localVarFp + .getGroupById(groupName, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} groupName + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGroupUserMappings( + groupName: string, + limit?: number, + exclusiveStartKey?: string, + options?: any + ): AxiosPromise { + return localVarFp + .listGroupUserMappings(groupName, limit, exclusiveStartKey, options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGroups(options?: any): AxiosPromise { + return localVarFp + .listGroups(options) + .then((request) => request(axios, basePath)); + }, + /** + * + * @param {string} groupName + * @param {RemoveUserFromGroupInput} removeUserFromGroupInput Remove user from group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + removeUserFromGroup( + groupName: string, + removeUserFromGroupInput: RemoveUserFromGroupInput, + options?: any + ): AxiosPromise { + return localVarFp + .removeUserFromGroup(groupName, removeUserFromGroupInput, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * GroupApi - object-oriented interface + * @export + * @class GroupApi + * @extends {BaseAPI} + */ +export class GroupApi extends BaseAPI { + /** + * + * @param {string} groupName + * @param {AddUserToGroupInput} addUserToGroupInput AddUserToGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public addUserToGroup( + groupName: string, + addUserToGroupInput: AddUserToGroupInput, + options?: RawAxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .addUserToGroup(groupName, addUserToGroupInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {CreateGroupInput} createGroupInput CreateGroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public createGroup( + createGroupInput: CreateGroupInput, + options?: RawAxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .createGroup(createGroupInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public deleteGroup(groupName: string, options?: RawAxiosRequestConfig) { + return GroupApiFp(this.configuration) + .deleteGroup(groupName, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} groupName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public getGroupById(groupName: string, options?: RawAxiosRequestConfig) { + return GroupApiFp(this.configuration) + .getGroupById(groupName, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} groupName + * @param {number} [limit] Maximum number of records to fetch in a list + * @param {string} [exclusiveStartKey] The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listGroupUserMappings( + groupName: string, + limit?: number, + exclusiveStartKey?: string, + options?: RawAxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .listGroupUserMappings(groupName, limit, exclusiveStartKey, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public listGroups(options?: RawAxiosRequestConfig) { + return GroupApiFp(this.configuration) + .listGroups(options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {string} groupName + * @param {RemoveUserFromGroupInput} removeUserFromGroupInput Remove user from group + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof GroupApi + */ + public removeUserFromGroup( + groupName: string, + removeUserFromGroupInput: RemoveUserFromGroupInput, + options?: RawAxiosRequestConfig + ) { + return GroupApiFp(this.configuration) + .removeUserFromGroup(groupName, removeUserFromGroupInput, options) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * IdpApi - axios parameter creator + * @export + */ +export const IdpApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * The authorization endpoint is one of the components in the OAuth 2.0 flow. It\'s the URL where a user is redirected to grant or deny access to their resources. When a user tries to access a service that requires OAuth 2.0 authorization, the application will redirect the user to this authorization endpoint. Here, the user can log in (if necessary) and then decide whether to grant the application access. + * @summary OAuth 2.0 Authorize Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2AuthGet: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdOauth2AuthGet', + 'projectId', + projectId + ); + const localVarPath = `/v1/login/project/{projectId}/oauth2/auth`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. + * @summary Revoke OAuth 2.0 Access or Refresh Token + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2RevokePost: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdOauth2RevokePost', + 'projectId', + projectId + ); + const localVarPath = + `/v1/login/project/{projectId}/oauth2/revoke`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This endpoint initiates and completes user logout at the IdP OAuth2 & OpenID provider and initiates OpenID Connect Front- / Back-channel logout: https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow. + * @summary OpenID Connect Front- and Back-channel Enabled Logout + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2SessionsLogoutGet: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdOauth2SessionsLogoutGet', + 'projectId', + projectId + ); + const localVarPath = + `/v1/login/project/{projectId}/oauth2/sessions/logout`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * The token endpoint is a critical component in the OAuth 2.0 protocol. It\'s the URL where a client application makes a request to exchange an authorization grant (such as an authorization code) for an access token. After a user grants authorization at the authorization endpoint, the client application receives an authorization grant, which is then exchanged for an access token at the token endpoint. This access token is then used to access the user\'s resources on the protected server. + * @summary The OAuth 2.0 Token Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2TokenPost: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdOauth2TokenPost', + 'projectId', + projectId + ); + const localVarPath = `/v1/login/project/{projectId}/oauth2/token`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This endpoint returns the payload of the ID Token, including session.id_token values, of the provided OAuth 2.0 Access Token\'s consent request. In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See the spec for more details about header format. + * @summary OpenID Connect Userinfo + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdUserinfoGet: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdUserinfoGet', + 'projectId', + projectId + ); + const localVarPath = `/v1/login/project/{projectId}/userinfo`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like node-jwks-rsa among others. + * @summary Discover Well-Known JSON Web Keys + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdWellKnownJwksJsonGet: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdWellKnownJwksJsonGet', + 'projectId', + projectId + ); + const localVarPath = + `/v1/login/project/{projectId}/.well-known/jwks.json`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * A mechanism for an OpenID Connect Relying Party to discover the End-User\'s OpenID Provider and obtain information needed to interact with it, including its OAuth 2.0 endpoint locations. + * @summary OpenID Connect Discovery + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdWellKnownOpenidConfigurationGet: async ( + projectId: string, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists( + 'v1LoginProjectProjectIdWellKnownOpenidConfigurationGet', + 'projectId', + projectId + ); + const localVarPath = + `/v1/login/project/{projectId}/.well-known/openid-configuration`.replace( + `{${'projectId'}}`, + encodeURIComponent(String(projectId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'GET', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * IdpApi - functional programming interface + * @export + */ +export const IdpApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = IdpApiAxiosParamCreator(configuration); + return { + /** + * The authorization endpoint is one of the components in the OAuth 2.0 flow. It\'s the URL where a user is redirected to grant or deny access to their resources. When a user tries to access a service that requires OAuth 2.0 authorization, the application will redirect the user to this authorization endpoint. Here, the user can log in (if necessary) and then decide whether to grant the application access. + * @summary OAuth 2.0 Authorize Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdOauth2AuthGet( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdOauth2AuthGet( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['IdpApi.v1LoginProjectProjectIdOauth2AuthGet']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. + * @summary Revoke OAuth 2.0 Access or Refresh Token + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdOauth2RevokePost( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdOauth2RevokePost( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['IdpApi.v1LoginProjectProjectIdOauth2RevokePost']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * This endpoint initiates and completes user logout at the IdP OAuth2 & OpenID provider and initiates OpenID Connect Front- / Back-channel logout: https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow. + * @summary OpenID Connect Front- and Back-channel Enabled Logout + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdOauth2SessionsLogoutGet( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdOauth2SessionsLogoutGet( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap[ + 'IdpApi.v1LoginProjectProjectIdOauth2SessionsLogoutGet' + ]?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * The token endpoint is a critical component in the OAuth 2.0 protocol. It\'s the URL where a client application makes a request to exchange an authorization grant (such as an authorization code) for an access token. After a user grants authorization at the authorization endpoint, the client application receives an authorization grant, which is then exchanged for an access token at the token endpoint. This access token is then used to access the user\'s resources on the protected server. + * @summary The OAuth 2.0 Token Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdOauth2TokenPost( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdOauth2TokenPost( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['IdpApi.v1LoginProjectProjectIdOauth2TokenPost']?.[ + index + ]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * This endpoint returns the payload of the ID Token, including session.id_token values, of the provided OAuth 2.0 Access Token\'s consent request. In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See the spec for more details about header format. + * @summary OpenID Connect Userinfo + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdUserinfoGet( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdUserinfoGet( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['IdpApi.v1LoginProjectProjectIdUserinfoGet']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like node-jwks-rsa among others. + * @summary Discover Well-Known JSON Web Keys + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdWellKnownJwksJsonGet( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdWellKnownJwksJsonGet( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap[ + 'IdpApi.v1LoginProjectProjectIdWellKnownJwksJsonGet' + ]?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * A mechanism for an OpenID Connect Relying Party to discover the End-User\'s OpenID Provider and obtain information needed to interact with it, including its OAuth 2.0 endpoint locations. + * @summary OpenID Connect Discovery + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async v1LoginProjectProjectIdWellKnownOpenidConfigurationGet( + projectId: string, + options?: RawAxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.v1LoginProjectProjectIdWellKnownOpenidConfigurationGet( + projectId, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap[ + 'IdpApi.v1LoginProjectProjectIdWellKnownOpenidConfigurationGet' + ]?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * IdpApi - factory interface + * @export + */ +export const IdpApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = IdpApiFp(configuration); + return { + /** + * The authorization endpoint is one of the components in the OAuth 2.0 flow. It\'s the URL where a user is redirected to grant or deny access to their resources. When a user tries to access a service that requires OAuth 2.0 authorization, the application will redirect the user to this authorization endpoint. Here, the user can log in (if necessary) and then decide whether to grant the application access. + * @summary OAuth 2.0 Authorize Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2AuthGet( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdOauth2AuthGet(projectId, options) + .then((request) => request(axios, basePath)); + }, + /** + * Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. + * @summary Revoke OAuth 2.0 Access or Refresh Token + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2RevokePost( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdOauth2RevokePost(projectId, options) + .then((request) => request(axios, basePath)); + }, + /** + * This endpoint initiates and completes user logout at the IdP OAuth2 & OpenID provider and initiates OpenID Connect Front- / Back-channel logout: https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow. + * @summary OpenID Connect Front- and Back-channel Enabled Logout + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2SessionsLogoutGet( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdOauth2SessionsLogoutGet(projectId, options) + .then((request) => request(axios, basePath)); + }, + /** + * The token endpoint is a critical component in the OAuth 2.0 protocol. It\'s the URL where a client application makes a request to exchange an authorization grant (such as an authorization code) for an access token. After a user grants authorization at the authorization endpoint, the client application receives an authorization grant, which is then exchanged for an access token at the token endpoint. This access token is then used to access the user\'s resources on the protected server. + * @summary The OAuth 2.0 Token Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdOauth2TokenPost( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdOauth2TokenPost(projectId, options) + .then((request) => request(axios, basePath)); + }, + /** + * This endpoint returns the payload of the ID Token, including session.id_token values, of the provided OAuth 2.0 Access Token\'s consent request. In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See the spec for more details about header format. + * @summary OpenID Connect Userinfo + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdUserinfoGet( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdUserinfoGet(projectId, options) + .then((request) => request(axios, basePath)); + }, + /** + * This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like node-jwks-rsa among others. + * @summary Discover Well-Known JSON Web Keys + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdWellKnownJwksJsonGet( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdWellKnownJwksJsonGet(projectId, options) + .then((request) => request(axios, basePath)); + }, + /** + * A mechanism for an OpenID Connect Relying Party to discover the End-User\'s OpenID Provider and obtain information needed to interact with it, including its OAuth 2.0 endpoint locations. + * @summary OpenID Connect Discovery + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + v1LoginProjectProjectIdWellKnownOpenidConfigurationGet( + projectId: string, + options?: any + ): AxiosPromise { + return localVarFp + .v1LoginProjectProjectIdWellKnownOpenidConfigurationGet( + projectId, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * IdpApi - object-oriented interface + * @export + * @class IdpApi + * @extends {BaseAPI} + */ +export class IdpApi extends BaseAPI { + /** + * The authorization endpoint is one of the components in the OAuth 2.0 flow. It\'s the URL where a user is redirected to grant or deny access to their resources. When a user tries to access a service that requires OAuth 2.0 authorization, the application will redirect the user to this authorization endpoint. Here, the user can log in (if necessary) and then decide whether to grant the application access. + * @summary OAuth 2.0 Authorize Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdOauth2AuthGet( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdOauth2AuthGet(projectId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. + * @summary Revoke OAuth 2.0 Access or Refresh Token + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdOauth2RevokePost( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdOauth2RevokePost(projectId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * This endpoint initiates and completes user logout at the IdP OAuth2 & OpenID provider and initiates OpenID Connect Front- / Back-channel logout: https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html Back-channel logout is performed asynchronously and does not affect logout flow. + * @summary OpenID Connect Front- and Back-channel Enabled Logout + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdOauth2SessionsLogoutGet( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdOauth2SessionsLogoutGet(projectId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * The token endpoint is a critical component in the OAuth 2.0 protocol. It\'s the URL where a client application makes a request to exchange an authorization grant (such as an authorization code) for an access token. After a user grants authorization at the authorization endpoint, the client application receives an authorization grant, which is then exchanged for an access token at the token endpoint. This access token is then used to access the user\'s resources on the protected server. + * @summary The OAuth 2.0 Token Endpoint + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdOauth2TokenPost( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdOauth2TokenPost(projectId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * This endpoint returns the payload of the ID Token, including session.id_token values, of the provided OAuth 2.0 Access Token\'s consent request. In the case of authentication error, a WWW-Authenticate header might be set in the response with more information about the error. See the spec for more details about header format. + * @summary OpenID Connect Userinfo + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdUserinfoGet( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdUserinfoGet(projectId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * This endpoint returns JSON Web Keys required to verifying OpenID Connect ID Tokens and, if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like node-jwks-rsa among others. + * @summary Discover Well-Known JSON Web Keys + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdWellKnownJwksJsonGet( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdWellKnownJwksJsonGet(projectId, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * A mechanism for an OpenID Connect Relying Party to discover the End-User\'s OpenID Provider and obtain information needed to interact with it, including its OAuth 2.0 endpoint locations. + * @summary OpenID Connect Discovery + * @param {string} projectId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof IdpApi + */ + public v1LoginProjectProjectIdWellKnownOpenidConfigurationGet( + projectId: string, + options?: RawAxiosRequestConfig + ) { + return IdpApiFp(this.configuration) + .v1LoginProjectProjectIdWellKnownOpenidConfigurationGet( + projectId, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} + +/** + * SessionApi - axios parameter creator + * @export + */ +export const SessionApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Accepts and Validates the OIDC VP Response sent by the Wallet + * @summary Accept OIDC VP Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionAcceptResponseInput} [loginSessionAcceptResponseInput] LoginSessionAcceptResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginSessionAcceptResponse: async ( + sessionId: string, + loginSessionAcceptResponseInput?: LoginSessionAcceptResponseInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'sessionId' is not null or undefined + assertParamExists('loginSessionAcceptResponse', 'sessionId', sessionId); + const localVarPath = + `/v1/login/sessions/{sessionId}/accept-response`.replace( + `{${'sessionId'}}`, + encodeURIComponent(String(sessionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + loginSessionAcceptResponseInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates Login Session for IDP Login by using the Login Challenge + * @summary Create Login Session for IDP Login + * @param {LoginSessionForIDPInput} [loginSessionForIDPInput] LoginSessionForIdp + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginSessionForIdp: async ( + loginSessionForIDPInput?: LoginSessionForIDPInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/v1/login/sessions/for-idp`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + loginSessionForIDPInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * The user declines the request for access to their data + * @summary Reject Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionRejectResponseInput} [loginSessionRejectResponseInput] LoginSessionRejectResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginSessionRejectResponse: async ( + sessionId: string, + loginSessionRejectResponseInput?: LoginSessionRejectResponseInput, + options: RawAxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'sessionId' is not null or undefined + assertParamExists('loginSessionRejectResponse', 'sessionId', sessionId); + const localVarPath = + `/v1/login/sessions/{sessionId}/reject-response`.replace( + `{${'sessionId'}}`, + encodeURIComponent(String(sessionId)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + loginSessionRejectResponseInput, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * SessionApi - functional programming interface + * @export + */ +export const SessionApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = SessionApiAxiosParamCreator(configuration); + return { + /** + * Accepts and Validates the OIDC VP Response sent by the Wallet + * @summary Accept OIDC VP Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionAcceptResponseInput} [loginSessionAcceptResponseInput] LoginSessionAcceptResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginSessionAcceptResponse( + sessionId: string, + loginSessionAcceptResponseInput?: LoginSessionAcceptResponseInput, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.loginSessionAcceptResponse( + sessionId, + loginSessionAcceptResponseInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['SessionApi.loginSessionAcceptResponse']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * Creates Login Session for IDP Login by using the Login Challenge + * @summary Create Login Session for IDP Login + * @param {LoginSessionForIDPInput} [loginSessionForIDPInput] LoginSessionForIdp + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginSessionForIdp( + loginSessionForIDPInput?: LoginSessionForIDPInput, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.loginSessionForIdp( + loginSessionForIDPInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['SessionApi.loginSessionForIdp']?.[index]?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + /** + * The user declines the request for access to their data + * @summary Reject Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionRejectResponseInput} [loginSessionRejectResponseInput] LoginSessionRejectResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginSessionRejectResponse( + sessionId: string, + loginSessionRejectResponseInput?: LoginSessionRejectResponseInput, + options?: RawAxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.loginSessionRejectResponse( + sessionId, + loginSessionRejectResponseInput, + options + ); + const index = configuration?.serverIndex ?? 0; + const operationBasePath = + operationServerMap['SessionApi.loginSessionRejectResponse']?.[index] + ?.url; + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + )(axios, operationBasePath || basePath); + }, + }; +}; + +/** + * SessionApi - factory interface + * @export + */ +export const SessionApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = SessionApiFp(configuration); + return { + /** + * Accepts and Validates the OIDC VP Response sent by the Wallet + * @summary Accept OIDC VP Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionAcceptResponseInput} [loginSessionAcceptResponseInput] LoginSessionAcceptResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginSessionAcceptResponse( + sessionId: string, + loginSessionAcceptResponseInput?: LoginSessionAcceptResponseInput, + options?: any + ): AxiosPromise { + return localVarFp + .loginSessionAcceptResponse( + sessionId, + loginSessionAcceptResponseInput, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Creates Login Session for IDP Login by using the Login Challenge + * @summary Create Login Session for IDP Login + * @param {LoginSessionForIDPInput} [loginSessionForIDPInput] LoginSessionForIdp + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginSessionForIdp( + loginSessionForIDPInput?: LoginSessionForIDPInput, + options?: any + ): AxiosPromise { + return localVarFp + .loginSessionForIdp(loginSessionForIDPInput, options) + .then((request) => request(axios, basePath)); + }, + /** + * The user declines the request for access to their data + * @summary Reject Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionRejectResponseInput} [loginSessionRejectResponseInput] LoginSessionRejectResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginSessionRejectResponse( + sessionId: string, + loginSessionRejectResponseInput?: LoginSessionRejectResponseInput, + options?: any + ): AxiosPromise { + return localVarFp + .loginSessionRejectResponse( + sessionId, + loginSessionRejectResponseInput, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SessionApi - object-oriented interface + * @export + * @class SessionApi + * @extends {BaseAPI} + */ +export class SessionApi extends BaseAPI { + /** + * Accepts and Validates the OIDC VP Response sent by the Wallet + * @summary Accept OIDC VP Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionAcceptResponseInput} [loginSessionAcceptResponseInput] LoginSessionAcceptResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public loginSessionAcceptResponse( + sessionId: string, + loginSessionAcceptResponseInput?: LoginSessionAcceptResponseInput, + options?: RawAxiosRequestConfig + ) { + return SessionApiFp(this.configuration) + .loginSessionAcceptResponse( + sessionId, + loginSessionAcceptResponseInput, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates Login Session for IDP Login by using the Login Challenge + * @summary Create Login Session for IDP Login + * @param {LoginSessionForIDPInput} [loginSessionForIDPInput] LoginSessionForIdp + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public loginSessionForIdp( + loginSessionForIDPInput?: LoginSessionForIDPInput, + options?: RawAxiosRequestConfig + ) { + return SessionApiFp(this.configuration) + .loginSessionForIdp(loginSessionForIDPInput, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * The user declines the request for access to their data + * @summary Reject Response for Login Session + * @param {string} sessionId The id of the login session + * @param {LoginSessionRejectResponseInput} [loginSessionRejectResponseInput] LoginSessionRejectResponse + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SessionApi + */ + public loginSessionRejectResponse( + sessionId: string, + loginSessionRejectResponseInput?: LoginSessionRejectResponseInput, + options?: RawAxiosRequestConfig + ) { + return SessionApiFp(this.configuration) + .loginSessionRejectResponse( + sessionId, + loginSessionRejectResponseInput, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/packages/sdk-client-vpa/base.ts b/packages/sdk-client-vpa/base.ts new file mode 100644 index 00000000..e456615f --- /dev/null +++ b/packages/sdk-client-vpa/base.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OidcVpAdapterBackend + * Affinidi OIDC VP Adapter Backend An authorization token is necessary to create or obtain a project Access Token and access Admin APIs. Follow these step-by-step [instructions](https://lemmatree.atlassian.net/wiki/spaces/NETCORE/pages/2735317648020/ASA+Developer+Flow#Instructions-on-how-to-create-the-Project.) to set up an authorization token + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = 'http://localhost'.replace(/\/+$/, ''); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios + ) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +} + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = 'RequiredError'; + } +} + +interface ServerMap { + [key: string]: { + url: string; + description: string; + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = {}; diff --git a/packages/sdk-client-vpa/common.ts b/packages/sdk-client-vpa/common.ts new file mode 100644 index 00000000..4ff8d875 --- /dev/null +++ b/packages/sdk-client-vpa/common.ts @@ -0,0 +1,203 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OidcVpAdapterBackend + * Affinidi OIDC VP Adapter Backend An authorization token is necessary to create or obtain a project Access Token and access Admin APIs. Follow these step-by-step [instructions](https://lemmatree.atlassian.net/wiki/spaces/NETCORE/pages/2735317648020/ASA+Developer+Flow#Instructions-on-how-to-create-the-Project.) to set up an authorization token + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Configuration } from './configuration'; +import type { RequestArgs } from './base'; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from './base'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com'; + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.` + ); + } +}; + +/** + * + * @export + */ +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +}; + +/** + * + * @export + */ +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration +) { + if (configuration && (configuration.username || configuration.password)) { + object['auth'] = { + username: configuration.username, + password: configuration.password, + }; + } +}; + +/** + * + * @export + */ +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + accessToken; + } +}; + +/** + * + * @export + */ +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object['Authorization'] = 'Bearer ' + localVarAccessTokenValue; + } +}; + +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = '' +): void { + if (parameter == null) return; + if (typeof parameter === 'object') { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key) + ); + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== '' ? '.' : ''}${currentKey}` + ) + ); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +}; + +/** + * + * @export + */ +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration +) { + const nonString = typeof value !== 'string'; + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || ''; +}; + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash; +}; + +/** + * + * @export + */ +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + + axiosArgs.url, + }; + return axios.request(axiosRequestArgs); + }; +}; diff --git a/packages/sdk-client-vpa/configuration.ts b/packages/sdk-client-vpa/configuration.ts new file mode 100644 index 00000000..ad585822 --- /dev/null +++ b/packages/sdk-client-vpa/configuration.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OidcVpAdapterBackend + * Affinidi OIDC VP Adapter Backend An authorization token is necessary to create or obtain a project Access Token and access Admin APIs. Follow these step-by-step [instructions](https://lemmatree.atlassian.net/wiki/spaces/NETCORE/pages/2735317648020/ASA+Developer+Flow#Instructions-on-how-to-create-the-Project.) to set up an authorization token + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface ConfigurationParameters { + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i' + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } +} diff --git a/packages/sdk-client-vpa/git_push.sh b/packages/sdk-client-vpa/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/packages/sdk-client-vpa/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/sdk-client-vpa/index.ts b/packages/sdk-client-vpa/index.ts new file mode 100644 index 00000000..a55d7e9b --- /dev/null +++ b/packages/sdk-client-vpa/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OidcVpAdapterBackend + * Affinidi OIDC VP Adapter Backend An authorization token is necessary to create or obtain a project Access Token and access Admin APIs. Follow these step-by-step [instructions](https://lemmatree.atlassian.net/wiki/spaces/NETCORE/pages/2735317648020/ASA+Developer+Flow#Instructions-on-how-to-create-the-Project.) to set up an authorization token + * + * The version of the OpenAPI document: 1.0.0 + * Contact: nucleus.team@affinidi.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export * from './api'; +export * from './configuration'; diff --git a/packages/sdk-client-vpa/package.json b/packages/sdk-client-vpa/package.json new file mode 100644 index 00000000..781e1564 --- /dev/null +++ b/packages/sdk-client-vpa/package.json @@ -0,0 +1,37 @@ +{ + "name": "@affinidi/test-sdk-client-vpa", + "version": "1.0.0", + "description": "OpenAPI client for @affinidi/test-sdk-client-vpa main", + "author": "Affinidi", + "repository": { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + }, + "keywords": [ + "affinidi-sdk", + "identity", + "holistic", + "network", + "openapi-client", + "openapi-generator", + "@affinidi/test-sdk-client-vpa" + ], + "license": "Apache-2.0", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "eslint . --ext .ts", + "prepare": "npm run build" + }, + "dependencies": { + "axios": "^1.6.0", + "url": "^0.11.3" + }, + "devDependencies": { + "@types/node": "^18.18.2", + "typescript": "^4.0" + } +} diff --git a/packages/sdk-client-vpa/project.json b/packages/sdk-client-vpa/project.json new file mode 100644 index 00000000..6ac7ff25 --- /dev/null +++ b/packages/sdk-client-vpa/project.json @@ -0,0 +1,41 @@ +{ + "name": "@affinidi/test-sdk-client-vpa", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/client-iam", + "projectType": "library", + "private": false, + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/packages/test-sdk-client-vpa", + "main": "packages/test-sdk-client-vpa/index.ts", + "tsConfig": "packages/test-sdk-client-vpa/tsconfig.lib.json", + "assets": ["packages/test-sdk-client-vpa/*.md"] + } + }, + "lint": { + "executor": "@nx/eslint:lint" + }, + "semantic-release": { + "executor": "@theunderscorer/nx-semantic-release:semantic-release", + "options": { + "changelog": true, + "github": true, + "npm": true, + "repositoryUrl": "git@github.com:affinidi/sdk.git", + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/npm", + { + "npmPublish": true + } + ] + ] + } + } + }, + "tags": [] +} diff --git a/packages/sdk-client-vpa/tsconfig.esm.json b/packages/sdk-client-vpa/tsconfig.esm.json new file mode 100644 index 00000000..2c0331cc --- /dev/null +++ b/packages/sdk-client-vpa/tsconfig.esm.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/packages/sdk-client-vpa/tsconfig.json b/packages/sdk-client-vpa/tsconfig.json new file mode 100644 index 00000000..bab039be --- /dev/null +++ b/packages/sdk-client-vpa/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "ES6", + "module": "commonjs", + "noImplicitAny": true, + "esModuleInterop": true, + "outDir": "dist", + "rootDir": ".", + "moduleResolution": "node" + }, + "exclude": ["dist", "node_modules"] +}