From 40f3c4f4dd47e26c83c24cd99c2ee5e69b10650d Mon Sep 17 00:00:00 2001 From: Tino Fuhrmann Date: Wed, 1 May 2019 10:45:07 +0200 Subject: [PATCH] Removed accidentally created generated code --- .../ts-fetch-client/.openapi-generator-ignore | 23 --------- .../.openapi-generator/VERSION | 1 - .../~/ts-fetch-client/README.md | 1 - .../~/ts-fetch-client/configuration.ts | 38 -------------- .../~/ts-fetch-client/http/http.ts | 51 ------------------- .../ts-fetch-client/http/isomorphic-fetch.ts | 38 -------------- .../~/ts-fetch-client/middleware.ts | 6 --- .../~/ts-fetch-client/package.json | 28 ---------- .../~/ts-fetch-client/tsconfig.json | 29 ----------- 9 files changed, 215 deletions(-) delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator-ignore delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator/VERSION delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/README.md delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/configuration.ts delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/http/http.ts delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/http/isomorphic-fetch.ts delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/middleware.ts delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/package.json delete mode 100644 modules/openapi-generator-cli/~/ts-fetch-client/tsconfig.json diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator-ignore b/modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator/VERSION b/modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator/VERSION deleted file mode 100644 index 717311e32e3..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -unset \ No newline at end of file diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/README.md b/modules/openapi-generator-cli/~/ts-fetch-client/README.md deleted file mode 100644 index ea786ff2cf6..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/README.md +++ /dev/null @@ -1 +0,0 @@ -readme \ No newline at end of file diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/configuration.ts b/modules/openapi-generator-cli/~/ts-fetch-client/configuration.ts deleted file mode 100644 index 06cc0f09bdd..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/configuration.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {HttpLibrary} from './http/http'; -import {Middleware} from './middleware'; - -export interface ConfigurationParameters { - basePath?: string; // override base path - httpApi?: HttpLibrary; // override for fetch implementation - middleware?: Middleware[]; // middleware to apply before/after fetch requests - username?: string; // parameter for basic security - password?: string; // parameter for basic security - apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security -} - -export class Configuration { - - basePath: string; - httpApi: HttpLibrary; - middleware: Middleware[]; - username?: string; - password?: string; - apiKey?: (name: string) => string; - accessToken?: (name: string, scopes?: string[]) => string; - - constructor(conf: ConfigurationParameters = {}) { - this.basePath = conf.basePath !== undefined ? conf.basePath : BASE_PATH; - this.fetchApi = conf.fetchApi || window.fetch.bind(window); - this.middleware = conf.middleware || []; - this.username = conf.username; - this.password = conf.password; - const { apiKey, accessToken } = conf; - if (apiKey) { - this.apiKey = typeof apiKey === 'function' ? apiKey : () => apiKey; - } - if (accessToken) { - this.accessToken = typeof accessToken === 'function' ? accessToken : () => accessToken; - } - } -} \ No newline at end of file diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/http/http.ts b/modules/openapi-generator-cli/~/ts-fetch-client/http/http.ts deleted file mode 100644 index 79391f8588c..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/http/http.ts +++ /dev/null @@ -1,51 +0,0 @@ -export enum HttpMethod { - GET = "GET", - HEAD = "HEAD", - POST = "POST", - PUT = "PUT", - DELETE = "DELETE", - CONNECT = "CONNECT", - OPTIONS = "OPTIONS", - TRACE = "TRACE", - PATCH = "PATCH" -} - -export interface FormEntry { - contentType: string; - value: string | Blob; -} - -export type FormData = { [key: string]: FormEntry }; - - -export class RequestContext { - public headers: { [key: string]: string } = {}; - public body: string | FormData = ""; - - public constructor(public url: string, public httpMethod: HttpMethod) { - - } - - public addCookie(name: string, value: string): void { - if (!this.headers["Cookie"]) { - this.headers["Cookie"] = ""; - } - this.headers["Cookie"] += name + "=" + value + "; "; - } - - public setHeader(key: string, value: string): void { - this.headers[key] = value; - } -} - -export class ResponseContext { - - public constructor(public httpStatusCode: number, - public headers: { [key: string]: string }, public body: string) { - } - -} - -export interface HttpLibrary { - send(request: RequestContext): Promise; -} \ No newline at end of file diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/http/isomorphic-fetch.ts b/modules/openapi-generator-cli/~/ts-fetch-client/http/isomorphic-fetch.ts deleted file mode 100644 index 47fb11c86e5..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/http/isomorphic-fetch.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {HttpLibrary, RequestContext, ResponseContext} from './http'; -import * as e6p from 'es6-promise' -e6p.polyfill(); -import 'isomorphic-fetch'; - -export class IsomorphicFetchHttpLibrary implements HttpLibrary { - - public send(request: RequestContext): Promise { - let method = request.httpMethod.toString(); - let body: string | FormData = ""; - if (typeof request.body === "string") { - body = request.body; - } else { - body = new FormData(); - for (const key in request.body) { - body.append(key, request.body[key].value); - } - } - - return fetch(request.url, { - method: method, - body: body, - headers: request.headers, - credentials: "same-origin" - }).then((resp) => { - // hack - let headers = (resp.headers as any)._headers; - for (let key in headers) { - headers[key] = (headers[key] as Array).join("; "); - } - - return resp.text().then((body) => { - return new ResponseContext(resp.status, headers, body) - }); - }); - - } -} diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/middleware.ts b/modules/openapi-generator-cli/~/ts-fetch-client/middleware.ts deleted file mode 100644 index 17fdcc8ea6f..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/middleware.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {RequestContext, ResponseContext} from './http/http'; - -export interface Middleware { - pre?(context: RequestContext): Promise; - post?(context: ResponseContext): Promise; -} \ No newline at end of file diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/package.json b/modules/openapi-generator-cli/~/ts-fetch-client/package.json deleted file mode 100644 index 4b73dd96ff2..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "", - "version": "", - "description": "OpenAPI client for ", - "author": "OpenAPI-Generator Contributors", - "keywords": [ - "fetch", - "typescript", - "openapi-client", - "openapi-generator", - "" - ], - "license": "Unlicense", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "scripts" : { - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "dependencies": { - "es6-promise": "^4.2.4", - "isomorphic-fetch": "^2.2.1", - "@types/isomorphic-fetch": "0.0.34" - }, - "devDependencies": { - "typescript": "^2.9.2" - } -} diff --git a/modules/openapi-generator-cli/~/ts-fetch-client/tsconfig.json b/modules/openapi-generator-cli/~/ts-fetch-client/tsconfig.json deleted file mode 100644 index 4ef0a027802..00000000000 --- a/modules/openapi-generator-cli/~/ts-fetch-client/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - /* Basic Options */ - "target": "es5", - "module": "commonjs", - "declaration": true, - - /* Additional Checks */ - "noUnusedLocals": true, /* Report errors on unused locals. */ - "noUnusedParameters": true, /* Report errors on unused parameters. */ - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - "removeComments": true, - "sourceMap": true, - "outDir": "./dist", - "noLib": false, - "declaration": true, - "lib": [ "es6", "dom" ] - }, - "exclude": [ - "node_modules" - ], - "filesGlob": [ - "./**/*.ts", - ] - -} \ No newline at end of file