Implemented RequestFactory and Processor completely

This commit is contained in:
Tino Fuhrmann 2018-10-13 15:25:53 +02:00
parent f5b062957d
commit a8ec866117
67 changed files with 2736 additions and 146 deletions

View File

@ -492,7 +492,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
@Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
// process enum in models
List<Object> models = (List<Object>) postProcessModelsEnum(objs).get("models");
List<Map<String, Object>> models = (List<Map<String, Object>>) postProcessModelsEnum(objs).get("models");
for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo;
CodegenModel cm = (CodegenModel) mo.get("model");
@ -512,10 +512,29 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
}
}
}
for (Map<String, Object> mo : models) {
CodegenModel cm = (CodegenModel) mo.get("model");
// Add additional filename information for imports
mo.put("tsImports", toTsImports(cm, cm.imports));
}
return objs;
}
private List<Map<String, String>> toTsImports(CodegenModel cm, Set<String> imports) {
List<Map<String, String>> tsImports = new ArrayList<>();
for (String im : imports) {
if (!im.equals(cm.classname)) {
HashMap<String, String> tsImport = new HashMap<>();
// TVG: This is used as class name in the import statements of the model file
tsImport.put("classname", im);
tsImport.put("filename", toModelFilename(im));
tsImports.add(tsImport);
}
}
return tsImports;
}
@Override
public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
Map<String, Object> result = super.postProcessAllModels(objs);

View File

@ -1,6 +1,7 @@
// TODO: better import syntax?
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import { RequestContext, HttpMethod } from '../http/http';
import { RequestContext, HttpMethod, ResponseContext} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer';
{{#imports}}
import { {{classname}} } from '..{{filename}}';
@ -8,7 +9,8 @@ import { {{classname}} } from '..{{filename}}';
{{#operations}}
export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
{{#operation}}
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): RequestContext {
{{#allParams}}
@ -40,13 +42,54 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
requestContext.setHeaderParam("{{basename}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"));
{{/headerParams}}
let localVarUseFormData = false;
// Form Params
WE ARE HERE TODO!
let authMethod = null;
{{#hasFormParams}}
let localVarFormParams = new FormData();
{{/hasFormParams}}
{{#formParams}}
{{#isListContainer}}
if ({{paramName}}) {
{{#isCollectionFormatMulti}}
{{paramName}}.forEach((element) => {
localVarFormParams.append('{{baseName}}', element as any);
})
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
// TODO: replace .append with .set
localVarFormParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
{{/isCollectionFormatMulti}}
}
{{/isListContainer}}
{{^isListContainer}}
if ({{paramName}} !== undefined) {
// TODO: replace .append with .set
localVarFormParams.append('{{baseName}}', {{paramName}} as any);
}
{{/isListContainer}}
{{/formParams}}
{{#hasFormParams}}
requestContext.setBody(localVarFormParams);
{{/hasFormParams}}
// Body Params
{{#bodyParam}}
{{^consumes}}
requestContext.setHeaderParam("Content-Type", "application/json");
{{/consumes}}
// TODO: deal with this? Could be useful for server definition
{{#consumes.0}}
requestContext.setHeaderParam("Content-Type", "{{{mediaType}}}");
{{/consumes.0}}
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"{{dataType}}" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify({{paramName}} || {}) : ({{paramName}}.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
{{/bodyParam}}
{{#hasAuthMethods}}
let authMethod = null;
{{/hasAuthMethods}}
// Apply auth methods
{{#authMethods}}
authMethod = this.configuration.authMethods["{{name}}"]
@ -60,4 +103,39 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
{{/operation}}
}
{{/operations}}
{{/operations}}
// TODO: find way to split these two files (both dependent on apitemplatefiles)
{{#operations}}
export class {{classname}}ResponseProcessor {
{{#operation}}
/**
*
* @throws {{{returnType}}} if the httpStatusCode is not in [200, 299]
*/
public {{nickname}}(response: ResponseContext): {{#returnType}} {{{returnType}}}{{/returnType}} {{^returnType}} void {{/returnType}} {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
{{#returnType}}
const body: {{{returnType}}} = ObjectSerializer.deserialize(response.body, "{{{returnType}}}") as {{{returnType}}};
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
{{/returnType}}
{{^returnType}}
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
{{/returnType}}
}
{{/operation}}
}
{{/operations}}

View File

@ -0,0 +1,16 @@
# TODO:
# Generic for HTTP Library:
# Generate one class for each api
# constructor: Configuration + RequestFactory + ResponseProcessor
# one method for each API
# call request factory
# execute request with http library or w/e other library
# call response processor
# return promise
# Why is this good? Because it allows each generator to return whatever they want to return, but they rely on the same
# internal process to get the response (if done correctly...)
# Export correctly configured apis!

View File

@ -7,8 +7,8 @@
"declaration": true,
/* Additional Checks */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true, /* Report errors on unused parameters. */
"noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!)
"noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
@ -16,10 +16,10 @@
"sourceMap": true,
"outDir": "./dist",
"noLib": false,
"declaration": true,
"lib": [ "es6", "dom" ]
},
"exclude": [
"dist",
"node_modules"
],
"filesGlob": [

View File

@ -1,12 +1,14 @@
// TODO: better import syntax?
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import { RequestContext, HttpMethod } from '../http/http';
import { RequestContext, HttpMethod, ResponseContext} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer';
import { ApiResponse } from '../models/ApiResponse';
import { Pet } from '../models/Pet';
export class PetApiRequestFactory extends BaseAPIRequestFactory {
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
public addPet(pet: Pet, options?: any): RequestContext {
// verify required parameter 'pet' is not null or undefined
if (pet === null || pet === undefined) {
@ -20,13 +22,22 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// TODO: deal with this? Could be useful for server definition
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"Pet" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(pet || {}) : (pet.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -50,14 +61,17 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
// Query Params
// Header Params
requestContext.setHeaderParam("", ObjectSerializer.serialize(apiKey, "string"));
// Form Params
let authMethod = null;
// Form Params
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -80,17 +94,19 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Query Params
if (status !== undefined) {
requestContext.setQueryParam("", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>"));
}
// Form Params
let authMethod = null;
// Header Params
// Form Params
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -113,17 +129,19 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Query Params
if (tags !== undefined) {
requestContext.setQueryParam("", ObjectSerializer.serialize(tags, "Array<string>"));
}
// Form Params
let authMethod = null;
// Header Params
// Form Params
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -147,13 +165,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["api_key"]
if (authMethod) {
@ -176,13 +197,22 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// TODO: deal with this? Could be useful for server definition
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"Pet" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(pet || {}) : (pet.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -206,13 +236,26 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
let localVarFormParams = new FormData();
if (name !== undefined) {
// TODO: replace .append with .set
localVarFormParams.append('name', name as any);
}
if (status !== undefined) {
// TODO: replace .append with .set
localVarFormParams.append('status', status as any);
}
requestContext.setBody(localVarFormParams);
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -236,13 +279,26 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
let localVarFormParams = new FormData();
if (additionalMetadata !== undefined) {
// TODO: replace .append with .set
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
}
if (file !== undefined) {
// TODO: replace .append with .set
localVarFormParams.append('file', file as any);
}
requestContext.setBody(localVarFormParams);
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["petstore_auth"]
if (authMethod) {
@ -253,3 +309,119 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
}
}
// TODO: find way to split these two files (both dependent on apitemplatefiles)
export class PetApiResponseProcessor {
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public addPet(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public deletePet(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws Array<Pet> if the httpStatusCode is not in [200, 299]
*/
public findPetsByStatus(response: ResponseContext): Array<Pet> {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: Array<Pet> = ObjectSerializer.deserialize(response.body, "Array<Pet>") as Array<Pet>;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws Array<Pet> if the httpStatusCode is not in [200, 299]
*/
public findPetsByTags(response: ResponseContext): Array<Pet> {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: Array<Pet> = ObjectSerializer.deserialize(response.body, "Array<Pet>") as Array<Pet>;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws Pet if the httpStatusCode is not in [200, 299]
*/
public getPetById(response: ResponseContext): Pet {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: Pet = ObjectSerializer.deserialize(response.body, "Pet") as Pet;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public updatePet(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public updatePetWithForm(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws ApiResponse if the httpStatusCode is not in [200, 299]
*/
public uploadFile(response: ResponseContext): ApiResponse {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: ApiResponse = ObjectSerializer.deserialize(response.body, "ApiResponse") as ApiResponse;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
}

View File

@ -1,11 +1,13 @@
// TODO: better import syntax?
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import { RequestContext, HttpMethod } from '../http/http';
import { RequestContext, HttpMethod, ResponseContext} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer';
import { Order } from '../models/Order';
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
public deleteOrder(orderId: string, options?: any): RequestContext {
// verify required parameter 'orderId' is not null or undefined
if (orderId === null || orderId === undefined) {
@ -20,13 +22,15 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// Apply auth methods
return requestContext;
@ -40,13 +44,16 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
let authMethod = null;
// Apply auth methods
authMethod = this.configuration.authMethods["api_key"]
if (authMethod) {
@ -70,13 +77,15 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// Apply auth methods
return requestContext;
@ -95,16 +104,89 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: deal with this? Could be useful for server definition
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"Order" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(order || {}) : (order.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
// Apply auth methods
return requestContext;
}
}
// TODO: find way to split these two files (both dependent on apitemplatefiles)
export class StoreApiResponseProcessor {
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public deleteOrder(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws { [key: string]: number; } if the httpStatusCode is not in [200, 299]
*/
public getInventory(response: ResponseContext): { [key: string]: number; } {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: { [key: string]: number; } = ObjectSerializer.deserialize(response.body, "{ [key: string]: number; }") as { [key: string]: number; };
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws Order if the httpStatusCode is not in [200, 299]
*/
public getOrderById(response: ResponseContext): Order {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: Order = ObjectSerializer.deserialize(response.body, "Order") as Order;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws Order if the httpStatusCode is not in [200, 299]
*/
public placeOrder(response: ResponseContext): Order {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: Order = ObjectSerializer.deserialize(response.body, "Order") as Order;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
}

View File

@ -1,11 +1,13 @@
// TODO: better import syntax?
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import { RequestContext, HttpMethod } from '../http/http';
import { RequestContext, HttpMethod, ResponseContext} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer';
import { User } from '../models/User';
export class UserApiRequestFactory extends BaseAPIRequestFactory {
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
public createUser(user: User, options?: any): RequestContext {
// verify required parameter 'user' is not null or undefined
if (user === null || user === undefined) {
@ -19,13 +21,21 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: deal with this? Could be useful for server definition
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"User" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
// Apply auth methods
return requestContext;
@ -44,13 +54,21 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: deal with this? Could be useful for server definition
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"Array&lt;User&gt;" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
// Apply auth methods
return requestContext;
@ -69,13 +87,21 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: deal with this? Could be useful for server definition
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"Array&lt;User&gt;" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
// Apply auth methods
return requestContext;
@ -95,13 +121,15 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// Apply auth methods
return requestContext;
@ -121,13 +149,15 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// Apply auth methods
return requestContext;
@ -151,21 +181,21 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Query Params
if (username !== undefined) {
requestContext.setQueryParam("", ObjectSerializer.serialize(username, "string"));
}
if (password !== undefined) {
requestContext.setQueryParam("", ObjectSerializer.serialize(password, "string"));
}
// Form Params
let authMethod = null;
// Header Params
// Form Params
// Body Params
// Apply auth methods
return requestContext;
@ -179,13 +209,15 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
// Apply auth methods
return requestContext;
@ -210,16 +242,134 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
// Make Request Context
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
// Form Params
let authMethod = null;
// Query Params
// Header Params
// Form Params
// Body Params
requestContext.setHeaderParam("Content-Type", "application/json");
// TODO: deal with this? Could be useful for server definition
// TODO: Should this be handled by ObjectSerializer? imo yes => confidential information included in local object should not be sent
const needsSerialization = (<any>"User" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
const serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || ""); // TODO: `toString` call is unnecessary
requestContext.setBody(serializedBody);
// Apply auth methods
return requestContext;
}
}
// TODO: find way to split these two files (both dependent on apitemplatefiles)
export class UserApiResponseProcessor {
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public createUser(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public createUsersWithArrayInput(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public createUsersWithListInput(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public deleteUser(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws User if the httpStatusCode is not in [200, 299]
*/
public getUserByName(response: ResponseContext): User {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: User = ObjectSerializer.deserialize(response.body, "User") as User;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws string if the httpStatusCode is not in [200, 299]
*/
public loginUser(response: ResponseContext): string {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
const body: string = ObjectSerializer.deserialize(response.body, "string") as string;
if (responseOK) {
return body;
} else {
// TODO: deal with different errors based on httpStatusCode
throw body
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public logoutUser(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
/**
*
* @throws if the httpStatusCode is not in [200, 299]
*/
public updateUser(response: ResponseContext): void {
const responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
// TODO: make this based on status code!
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
}
}

View File

@ -0,0 +1,24 @@
import { BaseAPIRequestFactory } from './baseapi';
import { RequestContext, ResponseContext } from '../http/http';
import { ApiResponse } from '../models/ApiResponse';
import { Pet } from '../models/Pet';
export declare class PetApiRequestFactory extends BaseAPIRequestFactory {
addPet(pet: Pet, options?: any): RequestContext;
deletePet(petId: number, apiKey?: string, options?: any): RequestContext;
findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): RequestContext;
findPetsByTags(tags: Array<string>, options?: any): RequestContext;
getPetById(petId: number, options?: any): RequestContext;
updatePet(pet: Pet, options?: any): RequestContext;
updatePetWithForm(petId: number, name?: string, status?: string, options?: any): RequestContext;
uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): RequestContext;
}
export declare class PetApiResponseProcessor {
addPet(response: ResponseContext): void;
deletePet(response: ResponseContext): void;
findPetsByStatus(response: ResponseContext): Array<Pet>;
findPetsByTags(response: ResponseContext): Array<Pet>;
getPetById(response: ResponseContext): Pet;
updatePet(response: ResponseContext): void;
updatePetWithForm(response: ResponseContext): void;
uploadFile(response: ResponseContext): ApiResponse;
}

View File

@ -0,0 +1,237 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var baseapi_1 = require("./baseapi");
var http_1 = require("../http/http");
var FormData = require("form-data");
var ObjectSerializer_1 = require("../models/ObjectSerializer");
var PetApiRequestFactory = (function (_super) {
__extends(PetApiRequestFactory, _super);
function PetApiRequestFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
PetApiRequestFactory.prototype.addPet = function (pet, options) {
if (pet === null || pet === undefined) {
throw new baseapi_1.RequiredError('Required parameter pet was null or undefined when calling addPet.');
}
var localVarPath = '/pet';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("Pet" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(pet || {}) : (pet.toString() || "");
requestContext.setBody(serializedBody);
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.deletePet = function (petId, apiKey, options) {
if (petId === null || petId === undefined) {
throw new baseapi_1.RequiredError('Required parameter petId was null or undefined when calling deletePet.');
}
var localVarPath = '/pet/{petId}'
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
requestContext.setHeaderParam("", ObjectSerializer_1.ObjectSerializer.serialize(apiKey, "string"));
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.findPetsByStatus = function (status, options) {
if (status === null || status === undefined) {
throw new baseapi_1.RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
}
var localVarPath = '/pet/findByStatus';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
if (status !== undefined) {
requestContext.setQueryParam("", ObjectSerializer_1.ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>"));
}
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.findPetsByTags = function (tags, options) {
if (tags === null || tags === undefined) {
throw new baseapi_1.RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
}
var localVarPath = '/pet/findByTags';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
if (tags !== undefined) {
requestContext.setQueryParam("", ObjectSerializer_1.ObjectSerializer.serialize(tags, "Array<string>"));
}
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.getPetById = function (petId, options) {
if (petId === null || petId === undefined) {
throw new baseapi_1.RequiredError('Required parameter petId was null or undefined when calling getPetById.');
}
var localVarPath = '/pet/{petId}'
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
var authMethod = null;
authMethod = this.configuration.authMethods["api_key"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.updatePet = function (pet, options) {
if (pet === null || pet === undefined) {
throw new baseapi_1.RequiredError('Required parameter pet was null or undefined when calling updatePet.');
}
var localVarPath = '/pet';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("Pet" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(pet || {}) : (pet.toString() || "");
requestContext.setBody(serializedBody);
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.updatePetWithForm = function (petId, name, status, options) {
if (petId === null || petId === undefined) {
throw new baseapi_1.RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
}
var localVarPath = '/pet/{petId}'
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
var localVarFormParams = new FormData();
if (name !== undefined) {
localVarFormParams.append('name', name);
}
if (status !== undefined) {
localVarFormParams.append('status', status);
}
requestContext.setBody(localVarFormParams);
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
PetApiRequestFactory.prototype.uploadFile = function (petId, additionalMetadata, file, options) {
if (petId === null || petId === undefined) {
throw new baseapi_1.RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
}
var localVarPath = '/pet/{petId}/uploadImage'
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
var localVarFormParams = new FormData();
if (additionalMetadata !== undefined) {
localVarFormParams.append('additionalMetadata', additionalMetadata);
}
if (file !== undefined) {
localVarFormParams.append('file', file);
}
requestContext.setBody(localVarFormParams);
var authMethod = null;
authMethod = this.configuration.authMethods["petstore_auth"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
return PetApiRequestFactory;
}(baseapi_1.BaseAPIRequestFactory));
exports.PetApiRequestFactory = PetApiRequestFactory;
var PetApiResponseProcessor = (function () {
function PetApiResponseProcessor() {
}
PetApiResponseProcessor.prototype.addPet = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
PetApiResponseProcessor.prototype.deletePet = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
PetApiResponseProcessor.prototype.findPetsByStatus = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "Array<Pet>");
if (responseOK) {
return body;
}
else {
throw body;
}
};
PetApiResponseProcessor.prototype.findPetsByTags = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "Array<Pet>");
if (responseOK) {
return body;
}
else {
throw body;
}
};
PetApiResponseProcessor.prototype.getPetById = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "Pet");
if (responseOK) {
return body;
}
else {
throw body;
}
};
PetApiResponseProcessor.prototype.updatePet = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
PetApiResponseProcessor.prototype.updatePetWithForm = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
PetApiResponseProcessor.prototype.uploadFile = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "ApiResponse");
if (responseOK) {
return body;
}
else {
throw body;
}
};
return PetApiResponseProcessor;
}());
exports.PetApiResponseProcessor = PetApiResponseProcessor;
//# sourceMappingURL=PetApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,17 @@
import { BaseAPIRequestFactory } from './baseapi';
import { RequestContext, ResponseContext } from '../http/http';
import { Order } from '../models/Order';
export declare class StoreApiRequestFactory extends BaseAPIRequestFactory {
deleteOrder(orderId: string, options?: any): RequestContext;
getInventory(options?: any): RequestContext;
getOrderById(orderId: number, options?: any): RequestContext;
placeOrder(order: Order, options?: any): RequestContext;
}
export declare class StoreApiResponseProcessor {
deleteOrder(response: ResponseContext): void;
getInventory(response: ResponseContext): {
[key: string]: number;
};
getOrderById(response: ResponseContext): Order;
placeOrder(response: ResponseContext): Order;
}

View File

@ -0,0 +1,109 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var baseapi_1 = require("./baseapi");
var http_1 = require("../http/http");
var ObjectSerializer_1 = require("../models/ObjectSerializer");
var StoreApiRequestFactory = (function (_super) {
__extends(StoreApiRequestFactory, _super);
function StoreApiRequestFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
StoreApiRequestFactory.prototype.deleteOrder = function (orderId, options) {
if (orderId === null || orderId === undefined) {
throw new baseapi_1.RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
}
var localVarPath = '/store/order/{orderId}'
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
return requestContext;
};
StoreApiRequestFactory.prototype.getInventory = function (options) {
var localVarPath = '/store/inventory';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
var authMethod = null;
authMethod = this.configuration.authMethods["api_key"];
if (authMethod) {
authMethod.applySecurityAuthentication(requestContext);
}
return requestContext;
};
StoreApiRequestFactory.prototype.getOrderById = function (orderId, options) {
if (orderId === null || orderId === undefined) {
throw new baseapi_1.RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
}
var localVarPath = '/store/order/{orderId}'
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
return requestContext;
};
StoreApiRequestFactory.prototype.placeOrder = function (order, options) {
if (order === null || order === undefined) {
throw new baseapi_1.RequiredError('Required parameter order was null or undefined when calling placeOrder.');
}
var localVarPath = '/store/order';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("Order" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(order || {}) : (order.toString() || "");
requestContext.setBody(serializedBody);
return requestContext;
};
return StoreApiRequestFactory;
}(baseapi_1.BaseAPIRequestFactory));
exports.StoreApiRequestFactory = StoreApiRequestFactory;
var StoreApiResponseProcessor = (function () {
function StoreApiResponseProcessor() {
}
StoreApiResponseProcessor.prototype.deleteOrder = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
StoreApiResponseProcessor.prototype.getInventory = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "{ [key: string]: number; }");
if (responseOK) {
return body;
}
else {
throw body;
}
};
StoreApiResponseProcessor.prototype.getOrderById = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "Order");
if (responseOK) {
return body;
}
else {
throw body;
}
};
StoreApiResponseProcessor.prototype.placeOrder = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "Order");
if (responseOK) {
return body;
}
else {
throw body;
}
};
return StoreApiResponseProcessor;
}());
exports.StoreApiResponseProcessor = StoreApiResponseProcessor;
//# sourceMappingURL=StoreApi.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"StoreApi.js","sourceRoot":"","sources":["../../apis/StoreApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qCAAiE;AACjE,qCAA0E;AAE1E,+DAA4D;AAG5D;IAA4C,0CAAqB;IAAjE;;IAuHA,CAAC;IApHU,4CAAW,GAAlB,UAAmB,OAAe,EAAE,OAAa;QAE7C,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE;YAC3C,MAAM,IAAI,uBAAa,CAAC,4EAA4E,CAAC,CAAC;SACzG;QAIJ,IAAM,YAAY,GAAG,wBAAwB;aACrC,OAAO,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAG5E,IAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC,YAAY,EAAE,iBAAU,CAAC,MAAM,CAAC,CAAC;QAazG,OAAO,cAAc,CAAC;IACvB,CAAC;IAEM,6CAAY,GAAnB,UAAoB,OAAa;QAGhC,IAAM,YAAY,GAAG,kBAAkB,CAAC;QAGxC,IAAM,cAAc,GAAG,IAAI,CA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QAC5G,IAAM,IAAI,GAAU,mCAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAU,CAAC;QAClF,IAAI,UAAU,EAAE;YACrB,OAAO,IAAI,CAAC;SACN;aAAM;YAEN,MAAM,IAAI,CAAA;SACV;IACL,CAAC;IAMM,8CAAU,GAAjB,UAAkB,QAAyB;QAC1C,IAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,IAAI,QAAQ,CAAC,cAAc,IAAI,GAAG,IAAI,QAAQ,CAAC,cAAc,IAAI,GAAG,CAAC;QAC5G,IAAM,IAAI,GAAU,mCAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAU,CAAC;QAClF,IAAI,UAAU,EAAE;YACrB,OAAO,IAAI,CAAC;SACN;aAAM;YAEN,MAAM,IAAI,CAAA;SACV;IACL,CAAC;IAEL,gCAAC;AAAD,CAAC,AA3DD,IA2DC;AA3DY,8DAAyB"}

View File

@ -0,0 +1,23 @@
import { BaseAPIRequestFactory } from './baseapi';
import { RequestContext, ResponseContext } from '../http/http';
import { User } from '../models/User';
export declare class UserApiRequestFactory extends BaseAPIRequestFactory {
createUser(user: User, options?: any): RequestContext;
createUsersWithArrayInput(user: Array<User>, options?: any): RequestContext;
createUsersWithListInput(user: Array<User>, options?: any): RequestContext;
deleteUser(username: string, options?: any): RequestContext;
getUserByName(username: string, options?: any): RequestContext;
loginUser(username: string, password: string, options?: any): RequestContext;
logoutUser(options?: any): RequestContext;
updateUser(username: string, user: User, options?: any): RequestContext;
}
export declare class UserApiResponseProcessor {
createUser(response: ResponseContext): void;
createUsersWithArrayInput(response: ResponseContext): void;
createUsersWithListInput(response: ResponseContext): void;
deleteUser(response: ResponseContext): void;
getUserByName(response: ResponseContext): User;
loginUser(response: ResponseContext): string;
logoutUser(response: ResponseContext): void;
updateUser(response: ResponseContext): void;
}

View File

@ -0,0 +1,181 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var baseapi_1 = require("./baseapi");
var http_1 = require("../http/http");
var ObjectSerializer_1 = require("../models/ObjectSerializer");
var UserApiRequestFactory = (function (_super) {
__extends(UserApiRequestFactory, _super);
function UserApiRequestFactory() {
return _super !== null && _super.apply(this, arguments) || this;
}
UserApiRequestFactory.prototype.createUser = function (user, options) {
if (user === null || user === undefined) {
throw new baseapi_1.RequiredError('Required parameter user was null or undefined when calling createUser.');
}
var localVarPath = '/user';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("User" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || "");
requestContext.setBody(serializedBody);
return requestContext;
};
UserApiRequestFactory.prototype.createUsersWithArrayInput = function (user, options) {
if (user === null || user === undefined) {
throw new baseapi_1.RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
}
var localVarPath = '/user/createWithArray';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("Array&lt;User&gt;" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || "");
requestContext.setBody(serializedBody);
return requestContext;
};
UserApiRequestFactory.prototype.createUsersWithListInput = function (user, options) {
if (user === null || user === undefined) {
throw new baseapi_1.RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
}
var localVarPath = '/user/createWithList';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("Array&lt;User&gt;" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || "");
requestContext.setBody(serializedBody);
return requestContext;
};
UserApiRequestFactory.prototype.deleteUser = function (username, options) {
if (username === null || username === undefined) {
throw new baseapi_1.RequiredError('Required parameter username was null or undefined when calling deleteUser.');
}
var localVarPath = '/user/{username}'
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
return requestContext;
};
UserApiRequestFactory.prototype.getUserByName = function (username, options) {
if (username === null || username === undefined) {
throw new baseapi_1.RequiredError('Required parameter username was null or undefined when calling getUserByName.');
}
var localVarPath = '/user/{username}'
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
return requestContext;
};
UserApiRequestFactory.prototype.loginUser = function (username, password, options) {
if (username === null || username === undefined) {
throw new baseapi_1.RequiredError('Required parameter username was null or undefined when calling loginUser.');
}
if (password === null || password === undefined) {
throw new baseapi_1.RequiredError('Required parameter password was null or undefined when calling loginUser.');
}
var localVarPath = '/user/login';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
if (username !== undefined) {
requestContext.setQueryParam("", ObjectSerializer_1.ObjectSerializer.serialize(username, "string"));
}
if (password !== undefined) {
requestContext.setQueryParam("", ObjectSerializer_1.ObjectSerializer.serialize(password, "string"));
}
return requestContext;
};
UserApiRequestFactory.prototype.logoutUser = function (options) {
var localVarPath = '/user/logout';
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
return requestContext;
};
UserApiRequestFactory.prototype.updateUser = function (username, user, options) {
if (username === null || username === undefined) {
throw new baseapi_1.RequiredError('Required parameter username was null or undefined when calling updateUser.');
}
if (user === null || user === undefined) {
throw new baseapi_1.RequiredError('Required parameter user was null or undefined when calling updateUser.');
}
var localVarPath = '/user/{username}'
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
var requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.PUT);
requestContext.setHeaderParam("Content-Type", "application/json");
var needsSerialization = ("User" !== "string") || requestContext.getHeaders()['Content-Type'] === 'application/json';
var serializedBody = needsSerialization ? JSON.stringify(user || {}) : (user.toString() || "");
requestContext.setBody(serializedBody);
return requestContext;
};
return UserApiRequestFactory;
}(baseapi_1.BaseAPIRequestFactory));
exports.UserApiRequestFactory = UserApiRequestFactory;
var UserApiResponseProcessor = (function () {
function UserApiResponseProcessor() {
}
UserApiResponseProcessor.prototype.createUser = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
UserApiResponseProcessor.prototype.createUsersWithArrayInput = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
UserApiResponseProcessor.prototype.createUsersWithListInput = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
UserApiResponseProcessor.prototype.deleteUser = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
UserApiResponseProcessor.prototype.getUserByName = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "User");
if (responseOK) {
return body;
}
else {
throw body;
}
};
UserApiResponseProcessor.prototype.loginUser = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
var body = ObjectSerializer_1.ObjectSerializer.deserialize(response.body, "string");
if (responseOK) {
return body;
}
else {
throw body;
}
};
UserApiResponseProcessor.prototype.logoutUser = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
UserApiResponseProcessor.prototype.updateUser = function (response) {
var responseOK = response.httpStatusCode && response.httpStatusCode >= 200 && response.httpStatusCode <= 299;
if (!responseOK) {
throw new Error("Invalid status code: " + response.httpStatusCode + "!");
}
};
return UserApiResponseProcessor;
}());
exports.UserApiResponseProcessor = UserApiResponseProcessor;
//# sourceMappingURL=UserApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
import { Configuration } from '../configuration';
export declare const COLLECTION_FORMATS: {
csv: string;
ssv: string;
tsv: string;
pipes: string;
};
export declare class BaseAPIRequestFactory {
protected configuration: Configuration;
constructor(configuration: Configuration);
}
export declare class RequiredError extends Error {
field: string;
name: "RequiredError";
constructor(field: string, msg?: string);
}

View File

@ -0,0 +1,41 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
var BaseAPIRequestFactory = (function () {
function BaseAPIRequestFactory(configuration) {
this.configuration = configuration;
}
return BaseAPIRequestFactory;
}());
exports.BaseAPIRequestFactory = BaseAPIRequestFactory;
;
var RequiredError = (function (_super) {
__extends(RequiredError, _super);
function RequiredError(field, msg) {
var _this = _super.call(this, msg) || this;
_this.field = field;
_this.name = "RequiredError";
return _this;
}
return RequiredError;
}(Error));
exports.RequiredError = RequiredError;
//# sourceMappingURL=baseapi.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"baseapi.js","sourceRoot":"","sources":["../../apis/baseapi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMa,QAAA,kBAAkB,GAAG;IAC9B,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,GAAG;CACb,CAAC;AAQF;IAEI,+BAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAClD,CAAC;IACL,4BAAC;AAAD,CAAC,AAJD,IAIC;AAJY,sDAAqB;AAIjC,CAAC;AAQF;IAAmC,iCAAK;IAEpC,uBAAmB,KAAa,EAAE,GAAY;QAA9C,YACI,kBAAM,GAAG,CAAC,SACb;QAFkB,WAAK,GAAL,KAAK,CAAQ;QADhC,UAAI,GAAoB,eAAe,CAAC;;IAGxC,CAAC;IACL,oBAAC;AAAD,CAAC,AALD,CAAmC,KAAK,GAKvC;AALY,sCAAa"}

View File

@ -0,0 +1,43 @@
import { RequestContext } from '../http/http';
export declare abstract class SecurityAuthentication {
private name;
constructor(name: string);
getName(): string;
abstract applySecurityAuthentication(context: RequestContext): void;
}
export declare class NoAuthentication extends SecurityAuthentication {
constructor();
applySecurityAuthentication(_context: RequestContext): void;
}
export declare class APIKeyAuthentication extends SecurityAuthentication {
private paramName;
private keyLocation;
private apiKey;
constructor(authName: string, paramName: string, keyLocation: "query" | "header" | "cookie", apiKey: string);
applySecurityAuthentication(context: RequestContext): void;
}
export declare class HttpBasicAuthentication extends SecurityAuthentication {
private username;
private password;
constructor(authName: string, username: string, password: string);
applySecurityAuthentication(context: RequestContext): void;
}
export declare class OAuth2Authentication extends SecurityAuthentication {
constructor(authName: string);
applySecurityAuthentication(context: RequestContext): void;
}
export declare type AuthMethods = {
"api_key"?: APIKeyAuthentication;
"petstore_auth"?: OAuth2Authentication;
};
export declare type ApiKeyConfiguration = string;
export declare type HttpBasicConfiguration = {
"username": string;
"password": string;
};
export declare type OAuth2Configuration = string;
export declare type AuthMethodsConfiguration = {
"api_key"?: ApiKeyConfiguration;
"petstore_auth"?: OAuth2Configuration;
};
export declare function configureAuthMethods(conf: AuthMethodsConfiguration | undefined): AuthMethods;

View File

@ -0,0 +1,99 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var btoa = require("btoa");
var SecurityAuthentication = (function () {
function SecurityAuthentication(name) {
this.name = name;
}
SecurityAuthentication.prototype.getName = function () {
return this.name;
};
return SecurityAuthentication;
}());
exports.SecurityAuthentication = SecurityAuthentication;
var NoAuthentication = (function (_super) {
__extends(NoAuthentication, _super);
function NoAuthentication() {
return _super.call(this, "_no_auth") || this;
}
NoAuthentication.prototype.applySecurityAuthentication = function (_context) {
};
return NoAuthentication;
}(SecurityAuthentication));
exports.NoAuthentication = NoAuthentication;
var APIKeyAuthentication = (function (_super) {
__extends(APIKeyAuthentication, _super);
function APIKeyAuthentication(authName, paramName, keyLocation, apiKey) {
var _this = _super.call(this, authName) || this;
_this.paramName = paramName;
_this.keyLocation = keyLocation;
_this.apiKey = apiKey;
return _this;
}
APIKeyAuthentication.prototype.applySecurityAuthentication = function (context) {
if (this.keyLocation === "header") {
context.setHeaderParam(this.paramName, this.apiKey);
}
else if (this.keyLocation === "cookie") {
context.addCookie(this.paramName, this.apiKey);
}
else if (this.keyLocation === "query") {
context.setQueryParam(this.paramName, this.apiKey);
}
};
return APIKeyAuthentication;
}(SecurityAuthentication));
exports.APIKeyAuthentication = APIKeyAuthentication;
var HttpBasicAuthentication = (function (_super) {
__extends(HttpBasicAuthentication, _super);
function HttpBasicAuthentication(authName, username, password) {
var _this = _super.call(this, authName) || this;
_this.username = username;
_this.password = password;
return _this;
}
HttpBasicAuthentication.prototype.applySecurityAuthentication = function (context) {
var comb = this.username + ":" + this.password;
context.setHeaderParam("Authentication", "Basic " + btoa(comb));
};
return HttpBasicAuthentication;
}(SecurityAuthentication));
exports.HttpBasicAuthentication = HttpBasicAuthentication;
var OAuth2Authentication = (function (_super) {
__extends(OAuth2Authentication, _super);
function OAuth2Authentication(authName) {
return _super.call(this, authName) || this;
}
OAuth2Authentication.prototype.applySecurityAuthentication = function (context) {
};
return OAuth2Authentication;
}(SecurityAuthentication));
exports.OAuth2Authentication = OAuth2Authentication;
function configureAuthMethods(conf) {
var authMethods = {};
if (!conf) {
return authMethods;
}
if (conf["api_key"]) {
authMethods["api_key"] = new APIKeyAuthentication("api_key", "api_key", "header", conf["api_key"]);
}
if (conf["petstore_auth"]) {
authMethods["petstore_auth"] = new OAuth2Authentication("petstore_auth");
}
return authMethods;
}
exports.configureAuthMethods = configureAuthMethods;
//# sourceMappingURL=auth.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../auth/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,2BAA6B;AAE7B;IAEC,gCAA2B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAEvC,CAAC;IAMM,wCAAO,GAAd;QACC,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAIF,6BAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBqB,wDAAsB;AAkB5C;IAAsC,oC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AAQ,CAAC;QAC/C,OAAO,CAAC,cAAc,CAAC,gBAAgB,EAAE,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;IACF,8BAAC;AAAD,CAAC,AAVD,CAA6C,sBAAsB,GAUlE;AAVY,0DAAuB;AAYpC;IAA0C,wCAAsB;IAC/D,8BAAmB,QAAgB;eAClC,kBAAM,QAAQ,CAAC;IAChB,CAAC;IAEM,0DAA2B,GAAlC,UAAmC,OAAuB;IAE1D,CAAC;IACF,2BAAC;AAAD,CAAC,AARD,CAA0C,sBAAsB,GAQ/D;AARY,oDAAoB;AAqBjC,SAAgB,oBAAoB,CAAC,IAA0C;IAC9E,IAAI,WAAW,GAAgB,EAC9B,CAAA;IAED,IAAI,CAAC,IAAI,EAAE;QACV,OAAO,WAAW,CAAC;KACnB;IAED,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE;QACpB,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,oBAAoB,CAAC,SAAS,EAAG,SAAS,EAAE,QAAQ,EAAW,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;KAC7G;IAED,IAAI,IAAI,CAAC,eAAe,CAAC,EAAE;QAC1B,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,oBAAoB,CAAC,eAAe,CAAC,CAAC;KACzE;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAjBD,oDAiBC"}

View File

@ -0,0 +1,17 @@
import { HttpLibrary } from './http/http';
import { Middleware } from './middleware';
import { ServerConfiguration } from './servers';
import { AuthMethods, AuthMethodsConfiguration } from './auth/auth';
export interface ConfigurationParameters {
baseServer?: ServerConfiguration;
httpApi?: HttpLibrary;
middleware?: Middleware[];
authMethods?: AuthMethodsConfiguration;
}
export declare class Configuration {
baseServer: ServerConfiguration;
httpApi: HttpLibrary;
middleware: Middleware[];
authMethods: AuthMethods;
constructor(conf?: ConfigurationParameters);
}

View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isomorphic_fetch_1 = require("./http/isomorphic-fetch");
var servers_1 = require("./servers");
var auth_1 = require("./auth/auth");
var Configuration = (function () {
function Configuration(conf) {
if (conf === void 0) { conf = {}; }
this.baseServer = conf.baseServer !== undefined ? conf.baseServer : servers_1.servers[0];
this.httpApi = conf.httpApi || new isomorphic_fetch_1.IsomorphicFetchHttpLibrary();
this.middleware = conf.middleware || [];
this.authMethods = auth_1.configureAuthMethods(conf.authMethods);
}
return Configuration;
}());
exports.Configuration = Configuration;
//# sourceMappingURL=configuration.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../configuration.ts"],"names":[],"mappings":";;AAEA,4DAAmE;AACnE,qCAAuD;AACvD,oCAAwF;AAUxF;IAOI,uBAAY,IAAkC;QAAlC,qBAAA,EAAA,SAAkC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAO,CAAC,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,6CAA0B,EAAE,CAAC;QAChE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,2BAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxD,CAAC;IACL,oBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,sCAAa"}

View File

@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=api.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../fetch/api.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,50 @@
import * as FormData from "form-data";
export declare enum HttpMethod {
GET = "GET",
HEAD = "HEAD",
POST = "POST",
PUT = "PUT",
DELETE = "DELETE",
CONNECT = "CONNECT",
OPTIONS = "OPTIONS",
TRACE = "TRACE",
PATCH = "PATCH"
}
export interface FormEntry {
contentDisposition: string;
value: string | Blob;
}
export declare class HttpException extends Error {
constructor(msg: string);
}
export declare class RequestContext {
private httpMethod;
private headers;
private body;
private url;
constructor(url: string, httpMethod: HttpMethod);
getUrl(): string;
setUrl(url: string): void;
setBody(body: string | FormData): void;
getHttpMethod(): HttpMethod;
getHeaders(): {
[key: string]: string;
};
getBody(): string | FormData;
setQueryParam(name: string, value: string): void;
addCookie(name: string, value: string): void;
setHeaderParam(key: string, value: string): void;
}
export declare class ResponseContext {
httpStatusCode: number;
headers: {
[key: string]: string;
};
body: string;
constructor(httpStatusCode: number, headers: {
[key: string]: string;
}, body: string);
}
export interface HttpLibrary {
send(request: RequestContext): Promise<ResponseContext>;
}

View File

@ -0,0 +1,91 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var URLParse = require("url-parse");
var HttpMethod;
(function (HttpMethod) {
HttpMethod["GET"] = "GET";
HttpMethod["HEAD"] = "HEAD";
HttpMethod["POST"] = "POST";
HttpMethod["PUT"] = "PUT";
HttpMethod["DELETE"] = "DELETE";
HttpMethod["CONNECT"] = "CONNECT";
HttpMethod["OPTIONS"] = "OPTIONS";
HttpMethod["TRACE"] = "TRACE";
HttpMethod["PATCH"] = "PATCH";
})(HttpMethod = exports.HttpMethod || (exports.HttpMethod = {}));
var HttpException = (function (_super) {
__extends(HttpException, _super);
function HttpException(msg) {
return _super.call(this, msg) || this;
}
return HttpException;
}(Error));
exports.HttpException = HttpException;
var RequestContext = (function () {
function RequestContext(url, httpMethod) {
this.httpMethod = httpMethod;
this.headers = {};
this.body = "";
this.url = URLParse(url, true);
}
RequestContext.prototype.getUrl = function () {
return this.url.toString();
};
RequestContext.prototype.setUrl = function (url) {
this.url = URLParse(url, true);
};
RequestContext.prototype.setBody = function (body) {
if (this.httpMethod === HttpMethod.GET) {
throw new HttpException("Body should not be included in GET-Requests!");
}
this.body = body;
};
RequestContext.prototype.getHttpMethod = function () {
return this.httpMethod;
};
RequestContext.prototype.getHeaders = function () {
return this.headers;
};
RequestContext.prototype.getBody = function () {
return this.body;
};
RequestContext.prototype.setQueryParam = function (name, value) {
var queryObj = this.url.query;
queryObj[name] = value;
this.url.set("query", queryObj);
};
RequestContext.prototype.addCookie = function (name, value) {
if (!this.headers["Cookie"]) {
this.headers["Cookie"] = "";
}
this.headers["Cookie"] += name + "=" + value + "; ";
};
RequestContext.prototype.setHeaderParam = function (key, value) {
this.headers[key] = value;
};
return RequestContext;
}());
exports.RequestContext = RequestContext;
var ResponseContext = (function () {
function ResponseContext(httpStatusCode, headers, body) {
this.httpStatusCode = httpStatusCode;
this.headers = headers;
this.body = body;
}
return ResponseContext;
}());
exports.ResponseContext = ResponseContext;
//# sourceMappingURL=http.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../http/http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,oCAAsC;AAEtC,IAAY,UAUX;AAVD,WAAY,UAAU;IAClB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,6BAAe,CAAA;AACnB,CAAC,EAVW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAUrB;AAQD;IAAmC,iCAAK;IACpC,uBAAmB,GAAW;eAC1B,kBAAM,GAAG,CAAC;IACd,CAAC;IACL,oBAAC;AAAD,CAA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,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;SAC/B;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC;IACxD,CAAC;IAEM,uCAAc,GAArB,UAAsB,GAAW,EAAE,KAAa;QAC5C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC9B,CAAC;IACL,qBAAC;AAAD,CAAC,AA3DD,IA2DC;AA3DY,wCAAc;AA6D3B;IAEI,yBAA0B,cAAsB,EACrC,OAAkC,EAAS,IAAY;QADxC,mBAAc,GAAd,cAAc,CAAQ;QACrC,YAAO,GAAP,OAAO,CAA2B;QAAS,SAAI,GAAJ,IAAI,CAAQ;IAClE,CAAC;IAEL,sBAAC;AAAD,CAAC,AAND,IAMC;AANY,0CAAe"}

View File

@ -0,0 +1,5 @@
import { HttpLibrary, RequestContext, ResponseContext } from './http';
import 'isomorphic-fetch';
export declare class IsomorphicFetchHttpLibrary implements HttpLibrary {
send(request: RequestContext): Promise<ResponseContext>;
}

View File

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var http_1 = require("./http");
var e6p = require("es6-promise");
e6p.polyfill();
require("isomorphic-fetch");
var IsomorphicFetchHttpLibrary = (function () {
function IsomorphicFetchHttpLibrary() {
}
IsomorphicFetchHttpLibrary.prototype.send = function (request) {
var method = request.getHttpMethod().toString();
var body = request.getBody();
return fetch(request.getUrl(), {
method: method,
body: body,
headers: request.getHeaders(),
credentials: "same-origin"
}).then(function (resp) {
var headers = resp.headers._headers;
for (var key in headers) {
headers[key] = headers[key].join("; ");
}
return resp.text().then(function (body) {
return new http_1.ResponseContext(resp.status, headers, body);
});
});
};
return IsomorphicFetchHttpLibrary;
}());
exports.IsomorphicFetchHttpLibrary = IsomorphicFetchHttpLibrary;
//# sourceMappingURL=isomorphic-fetch.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"isomorphic-fetch.js","sourceRoot":"","sources":["../../http/isomorphic-fetch.ts"],"names":[],"mappings":";;AAAA,+BAAoE;AACpE,iCAAkC;AAClC,GAAG,CAAC,QAAQ,EAAE,CAAC;AACf,4BAA0B;AAE1B;IAAA;IAwBA,CAAC;IAtBU,yCAAI,GAAX,UAAY,OAAuB;QAC/B,IAAI,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC;QAChD,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QAE7B,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;YAC3B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAW;YACjB,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;YAC7B,WAAW,EAAE,aAAa;SAC7B,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YAET,IAAI,OAAO,GAAI,IAAI,CAAC,OAAe,CAAC,QAAQ,CAAC;YAC7C,KAAK,IAAI,GAAG,IAAI,OAAO,EAAE;gBACrB,OAAO,CAAC,GAAG,CAAC,GAAI,OAAO,CAAC,GAAG,CAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC7D;YAED,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,UAAC,IAAI;gBACzB,OAAO,IAAI,sBAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IAEP,CAAC;IACL,iCAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,gEAA0B"}

View File

@ -0,0 +1,6 @@
export * from './configuration';
export * from './http/http';
export * from './auth/auth';
export * from './middleware';
export * from './servers';
export * from './http/isomorphic-fetch';

View File

@ -0,0 +1,11 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./configuration"));
__export(require("./http/http"));
__export(require("./auth/auth"));
__export(require("./servers"));
__export(require("./http/isomorphic-fetch"));
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;AAAA,qCAA+B;AAC/B,iCAA4B;AAC5B,iCAA4B;AAE5B,+BAA0B;AAI1B,6CAAwC"}

View File

@ -0,0 +1,5 @@
import { RequestContext, ResponseContext } from './http/http';
export interface Middleware {
pre?(context: RequestContext): Promise<RequestContext>;
post?(context: ResponseContext): Promise<ResponseContext>;
}

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=middleware.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../middleware.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,16 @@
export declare class ApiResponse {
'code'?: number;
'type'?: string;
'message'?: string;
static discriminator: string | undefined;
static attributeTypeMap: Array<{
name: string;
baseName: string;
type: string;
}>;
static getAttributeTypeMap(): {
name: string;
baseName: string;
type: string;
}[];
}

View File

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ApiResponse = (function () {
function ApiResponse() {
}
ApiResponse.getAttributeTypeMap = function () {
return ApiResponse.attributeTypeMap;
};
ApiResponse.discriminator = undefined;
ApiResponse.attributeTypeMap = [
{
"name": "code",
"baseName": "code",
"type": "number"
},
{
"name": "type",
"baseName": "type",
"type": "string"
},
{
"name": "message",
"baseName": "message",
"type": "string"
}
];
return ApiResponse;
}());
exports.ApiResponse = ApiResponse;
//# sourceMappingURL=ApiResponse.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ApiResponse.js","sourceRoot":"","sources":["../../models/ApiResponse.ts"],"names":[],"mappings":";;AAOA;IAAA;IA2BA,CAAC;IAHU,+BAAmB,GAA1B;QACI,OAAO,WAAW,CAAC,gBAAgB,CAAC;IACxC,CAAC;IArBM,yBAAa,GAAuB,SAAS,CAAC;IAE9C,4BAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,kBAAC;CAAA,AA3BD,IA2BC;AA3BY,kCAAW"}

View File

@ -0,0 +1,15 @@
export declare class Category {
'id'?: number;
'name'?: string;
static discriminator: string | undefined;
static attributeTypeMap: Array<{
name: string;
baseName: string;
type: string;
}>;
static getAttributeTypeMap(): {
name: string;
baseName: string;
type: string;
}[];
}

View File

@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Category = (function () {
function Category() {
}
Category.getAttributeTypeMap = function () {
return Category.attributeTypeMap;
};
Category.discriminator = undefined;
Category.attributeTypeMap = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "name",
"baseName": "name",
"type": "string"
}
];
return Category;
}());
exports.Category = Category;
//# sourceMappingURL=Category.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Category.js","sourceRoot":"","sources":["../../models/Category.ts"],"names":[],"mappings":";;AAOA;IAAA;IAqBA,CAAC;IAHU,4BAAmB,GAA1B;QACI,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IACrC,CAAC;IAhBM,sBAAa,GAAuB,SAAS,CAAC;IAE9C,yBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,eAAC;CAAA,AArBD,IAqBC;AArBY,4BAAQ"}

View File

@ -0,0 +1,11 @@
export * from './ApiResponse';
export * from './Category';
export * from './Order';
export * from './Pet';
export * from './Tag';
export * from './User';
export declare class ObjectSerializer {
static findCorrectType(data: any, expectedType: string): any;
static serialize(data: any, type: string): any;
static deserialize(data: any, type: string): any;
}

View File

@ -0,0 +1,157 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./ApiResponse"));
__export(require("./Category"));
__export(require("./Order"));
__export(require("./Pet"));
__export(require("./Tag"));
__export(require("./User"));
var ApiResponse_1 = require("./ApiResponse");
var Category_1 = require("./Category");
var Order_1 = require("./Order");
var Pet_1 = require("./Pet");
var Tag_1 = require("./Tag");
var User_1 = require("./User");
var primitives = [
"string",
"boolean",
"double",
"integer",
"long",
"float",
"number",
"any"
];
var enumsMap = {
"Order.StatusEnum": Order_1.Order.StatusEnum,
"Pet.StatusEnum": Pet_1.Pet.StatusEnum,
};
var typeMap = {
"ApiResponse": ApiResponse_1.ApiResponse,
"Category": Category_1.Category,
"Order": Order_1.Order,
"Pet": Pet_1.Pet,
"Tag": Tag_1.Tag,
"User": User_1.User,
};
var ObjectSerializer = (function () {
function ObjectSerializer() {
}
ObjectSerializer.findCorrectType = function (data, expectedType) {
if (data == undefined) {
return expectedType;
}
else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
return expectedType;
}
else if (expectedType === "Date") {
return expectedType;
}
else {
if (enumsMap[expectedType]) {
return expectedType;
}
if (!typeMap[expectedType]) {
return expectedType;
}
var discriminatorProperty = typeMap[expectedType].discriminator;
if (discriminatorProperty == null) {
return expectedType;
}
else {
if (data[discriminatorProperty]) {
var discriminatorType = data[discriminatorProperty];
if (typeMap[discriminatorType]) {
return discriminatorType;
}
else {
return expectedType;
}
}
else {
return expectedType;
}
}
}
};
ObjectSerializer.serialize = function (data, type) {
if (data == undefined) {
return data;
}
else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
}
else if (type.lastIndexOf("Array<", 0) === 0) {
var subType = type.replace("Array<", "");
subType = subType.substring(0, subType.length - 1);
var transformedData = [];
for (var index in data) {
var date = data[index];
transformedData.push(ObjectSerializer.serialize(date, subType));
}
return transformedData;
}
else if (type === "Date") {
return data.toISOString();
}
else {
if (enumsMap[type]) {
return data;
}
if (!typeMap[type]) {
return data;
}
type = this.findCorrectType(data, type);
var attributeTypes = typeMap[type].getAttributeTypeMap();
var instance = {};
for (var index in attributeTypes) {
var attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
}
return instance;
}
};
ObjectSerializer.deserialize = function (data, type) {
type = ObjectSerializer.findCorrectType(data, type);
if (data == undefined) {
return data;
}
else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
}
else if (type.lastIndexOf("Array<", 0) === 0) {
var subType = type.replace("Array<", "");
subType = subType.substring(0, subType.length - 1);
var transformedData = [];
for (var index in data) {
var date = data[index];
transformedData.push(ObjectSerializer.deserialize(date, subType));
}
return transformedData;
}
else if (type === "Date") {
return new Date(data);
}
else {
if (enumsMap[type]) {
return data;
}
if (!typeMap[type]) {
return data;
}
var instance = new typeMap[type]();
var attributeTypes = typeMap[type].getAttributeTypeMap();
for (var index in attributeTypes) {
var attributeType = attributeTypes[index];
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
}
return instance;
}
};
return ObjectSerializer;
}());
exports.ObjectSerializer = ObjectSerializer;
//# sourceMappingURL=ObjectSerializer.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ObjectSerializer.js","sourceRoot":"","sources":["../../models/ObjectSerializer.ts"],"names":[],"mappings":";;;;;AAAA,mCAA8B;AAC9B,gCAA2B;AAC3B,6BAAwB;AACxB,2BAAsB;AACtB,2BAAsB;AACtB,4BAAuB;AAEvB,6CAA4C;AAC5C,uCAAsC;AACtC,iCAAgC;AA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B;aAAM,IAAI,IAAI,KAAK,MAAM,EAAE;YACxB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;SACzB;aAAM;YACH,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAChB,OAAO,IAAI,CAAC;aACf;YAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAChB,OAAO,IAAI,CAAC;aACf;YACD,IAAI,QAAQ,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;YACzD,KAAK,IAAI,KAAK,IAAI,cAAc,EAAE;gBAC9B,IAAI,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC1C,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;aACjH;YACD,OAAO,QAAQ,CAAC;SACnB;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AA7GD,IA6GC;AA7GY,4CAAgB"}

View File

@ -0,0 +1,26 @@
export declare class Order {
'id'?: number;
'petId'?: number;
'quantity'?: number;
'shipDate'?: Date;
'status'?: Order.StatusEnum;
'complete'?: boolean;
static discriminator: string | undefined;
static attributeTypeMap: Array<{
name: string;
baseName: string;
type: string;
}>;
static getAttributeTypeMap(): {
name: string;
baseName: string;
type: string;
}[];
}
export declare namespace Order {
enum StatusEnum {
Placed,
Approved,
Delivered
}
}

View File

@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Order = (function () {
function Order() {
}
Order.getAttributeTypeMap = function () {
return Order.attributeTypeMap;
};
Order.discriminator = undefined;
Order.attributeTypeMap = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "petId",
"baseName": "petId",
"type": "number"
},
{
"name": "quantity",
"baseName": "quantity",
"type": "number"
},
{
"name": "shipDate",
"baseName": "shipDate",
"type": "Date"
},
{
"name": "status",
"baseName": "status",
"type": "Order.StatusEnum"
},
{
"name": "complete",
"baseName": "complete",
"type": "boolean"
}
];
return Order;
}());
exports.Order = Order;
(function (Order) {
var StatusEnum;
(function (StatusEnum) {
StatusEnum[StatusEnum["Placed"] = 'placed'] = "Placed";
StatusEnum[StatusEnum["Approved"] = 'approved'] = "Approved";
StatusEnum[StatusEnum["Delivered"] = 'delivered'] = "Delivered";
})(StatusEnum = Order.StatusEnum || (Order.StatusEnum = {}));
})(Order = exports.Order || (exports.Order = {}));
exports.Order = Order;
//# sourceMappingURL=Order.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Order.js","sourceRoot":"","sources":["../../models/Order.ts"],"names":[],"mappings":";;AAOA;IAAA;IAgDA,CAAC;IAHU,yBAAmB,GAA1B;QACI,OAAO,KAAK,CAAC,gBAAgB,CAAC;IAClC,CAAC;IApCM,mBAAa,GAAuB,SAAS,CAAC;IAE9C,sBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,MAAM;SACjB;QACD;YACI,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,kBAAkB;SAC7B;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,SAAS;SACpB;KAAK,CAAC;IAKf,YAAC;CAAA,AAhDD,IAgDC;AAhDY,sBAAK;AAkDlB,WAAiB,KAAK;IAClB,IAAY,UAIX;IAJD,WAAY,UAAU;QAClB,kCAAe,QAAQ,YAAA,CAAA;QACvB,oCAAiB,UAAU,cAAA,CAAA;QAC3B,qCAAkB,WAAW,eAAA,CAAA;IACjC,CAAC,EAJW,UAAU,GAAV,gBAAU,KAAV,gBAAU,QAIrB;AACL,CAAC,EANgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAMrB;AAxDY,sBAAK"}

View File

@ -0,0 +1,28 @@
import { Category } from './Category';
import { Tag } from './Tag';
export declare class Pet {
'id'?: number;
'category'?: Category;
'name': string;
'photoUrls': Array<string>;
'tags'?: Array<Tag>;
'status'?: Pet.StatusEnum;
static discriminator: string | undefined;
static attributeTypeMap: Array<{
name: string;
baseName: string;
type: string;
}>;
static getAttributeTypeMap(): {
name: string;
baseName: string;
type: string;
}[];
}
export declare namespace Pet {
enum StatusEnum {
Available,
Pending,
Sold
}
}

View File

@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Pet = (function () {
function Pet() {
}
Pet.getAttributeTypeMap = function () {
return Pet.attributeTypeMap;
};
Pet.discriminator = undefined;
Pet.attributeTypeMap = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "category",
"baseName": "category",
"type": "Category"
},
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "photoUrls",
"baseName": "photoUrls",
"type": "Array<string>"
},
{
"name": "tags",
"baseName": "tags",
"type": "Array<Tag>"
},
{
"name": "status",
"baseName": "status",
"type": "Pet.StatusEnum"
}
];
return Pet;
}());
exports.Pet = Pet;
(function (Pet) {
var StatusEnum;
(function (StatusEnum) {
StatusEnum[StatusEnum["Available"] = 'available'] = "Available";
StatusEnum[StatusEnum["Pending"] = 'pending'] = "Pending";
StatusEnum[StatusEnum["Sold"] = 'sold'] = "Sold";
})(StatusEnum = Pet.StatusEnum || (Pet.StatusEnum = {}));
})(Pet = exports.Pet || (exports.Pet = {}));
exports.Pet = Pet;
//# sourceMappingURL=Pet.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Pet.js","sourceRoot":"","sources":["../../models/Pet.ts"],"names":[],"mappings":";;AASA;IAAA;IAgDA,CAAC;IAHU,uBAAmB,GAA1B;QACI,OAAO,GAAG,CAAC,gBAAgB,CAAC;IAChC,CAAC;IApCM,iBAAa,GAAuB,SAAS,CAAC;IAE9C,oBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,UAAU;SACrB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,eAAe;SAC1B;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,YAAY;SACvB;QACD;YACI,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,gBAAgB;SAC3B;KAAK,CAAC;IAKf,UAAC;CAAA,AAhDD,IAgDC;AAhDY,kBAAG;AAkDhB,WAAiB,GAAG;IAChB,IAAY,UAIX;IAJD,WAAY,UAAU;QAClB,qCAAkB,WAAW,eAAA,CAAA;QAC7B,mCAAgB,SAAS,aAAA,CAAA;QACzB,gCAAa,MAAM,UAAA,CAAA;IACvB,CAAC,EAJW,UAAU,GAAV,cAAU,KAAV,cAAU,QAIrB;AACL,CAAC,EANgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAMnB;AAxDY,kBAAG"}

View File

@ -0,0 +1,15 @@
export declare class Tag {
'id'?: number;
'name'?: string;
static discriminator: string | undefined;
static attributeTypeMap: Array<{
name: string;
baseName: string;
type: string;
}>;
static getAttributeTypeMap(): {
name: string;
baseName: string;
type: string;
}[];
}

View File

@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Tag = (function () {
function Tag() {
}
Tag.getAttributeTypeMap = function () {
return Tag.attributeTypeMap;
};
Tag.discriminator = undefined;
Tag.attributeTypeMap = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "name",
"baseName": "name",
"type": "string"
}
];
return Tag;
}());
exports.Tag = Tag;
//# sourceMappingURL=Tag.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../models/Tag.ts"],"names":[],"mappings":";;AAOA;IAAA;IAqBA,CAAC;IAHU,uBAAmB,GAA1B;QACI,OAAO,GAAG,CAAC,gBAAgB,CAAC;IAChC,CAAC;IAhBM,iBAAa,GAAuB,SAAS,CAAC;IAE9C,oBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,UAAC;CAAA,AArBD,IAqBC;AArBY,kBAAG"}

View File

@ -0,0 +1,21 @@
export declare class User {
'id'?: number;
'username'?: string;
'firstName'?: string;
'lastName'?: string;
'email'?: string;
'password'?: string;
'phone'?: string;
'userStatus'?: number;
static discriminator: string | undefined;
static attributeTypeMap: Array<{
name: string;
baseName: string;
type: string;
}>;
static getAttributeTypeMap(): {
name: string;
baseName: string;
type: string;
}[];
}

View File

@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var User = (function () {
function User() {
}
User.getAttributeTypeMap = function () {
return User.attributeTypeMap;
};
User.discriminator = undefined;
User.attributeTypeMap = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "username",
"baseName": "username",
"type": "string"
},
{
"name": "firstName",
"baseName": "firstName",
"type": "string"
},
{
"name": "lastName",
"baseName": "lastName",
"type": "string"
},
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
},
{
"name": "phone",
"baseName": "phone",
"type": "string"
},
{
"name": "userStatus",
"baseName": "userStatus",
"type": "number"
}
];
return User;
}());
exports.User = User;
//# sourceMappingURL=User.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../models/User.ts"],"names":[],"mappings":";;AAOA;IAAA;IA4DA,CAAC;IAHU,wBAAmB,GAA1B;QACI,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IA9CM,kBAAa,GAAuB,SAAS,CAAC;IAE9C,qBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,YAAY;YACxB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,WAAC;CAAA,AA5DD,IA4DC;AA5DY,oBAAI"}

View File

@ -0,0 +1,7 @@
import { RequestContext, HttpMethod } from './http/http';
export declare class ServerConfiguration {
private url;
constructor(url: string);
makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext;
}
export declare const servers: ServerConfiguration[];

View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var http_1 = require("./http/http");
var ServerConfiguration = (function () {
function ServerConfiguration(url) {
this.url = url;
}
ServerConfiguration.prototype.makeRequestContext = function (endpoint, httpMethod) {
return new http_1.RequestContext(this.url + endpoint, httpMethod);
};
return ServerConfiguration;
}());
exports.ServerConfiguration = ServerConfiguration;
exports.servers = [
new ServerConfiguration("http://petstore.swagger.io/v2"),
];
//# sourceMappingURL=servers.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../servers.ts"],"names":[],"mappings":";;AAAA,oCAAuD;AAEvD;IAEI,6BAA2B,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IACtC,CAAC;IAEG,gDAAkB,GAAzB,UAA0B,QAAgB,EAAE,UAAsB;QACjE,OAAO,IAAI,qBAAc,CAAC,IAAI,CAAC,GAAG,GAAG,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;IACF,0BAAC;AAAD,CAAC,AARD,IAQC;AARY,kDAAmB;AAUnB,QAAA,OAAO,GAAG;IACtB,IAAI,mBAAmB,CAAC,+BAA+B,CAAC;CACxD,CAAA"}

View File

@ -1,6 +1,8 @@
/*
TODO: LICENSE INFO
*/
import { Category } from './Category';
import { Tag } from './Tag';
/**
* A pet for sale in the pet store

View File

@ -0,0 +1,468 @@
{
"name": "ts-petstore-client",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/chai": {
"version": "4.1.6",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz",
"integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==",
"dev": true
},
"@types/form-data": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz",
"integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==",
"requires": {
"@types/node": "*"
}
},
"@types/isomorphic-fetch": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz",
"integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY="
},
"@types/mocha": {
"version": "5.2.5",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz",
"integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==",
"dev": true
},
"@types/node": {
"version": "10.11.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.7.tgz",
"integrity": "sha512-yOxFfkN9xUFLyvWaeYj90mlqTJ41CsQzWKS3gXdOMOyPVacUsymejKxJ4/pMW7exouubuEeZLJawGgcNGYlTeg=="
},
"arrify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
"dev": true
},
"assertion-error": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"browser-stdout": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
"dev": true
},
"btoa": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz",
"integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"chai": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz",
"integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==",
"dev": true,
"requires": {
"assertion-error": "^1.1.0",
"check-error": "^1.0.2",
"deep-eql": "^3.0.1",
"get-func-name": "^2.0.0",
"pathval": "^1.1.0",
"type-detect": "^4.0.5"
}
},
"check-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
"dev": true
},
"combined-stream": {
"version": "1.0.6",
"resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"commander": {
"version": "2.15.1",
"resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"deep-eql": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
"dev": true,
"requires": {
"type-detect": "^4.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"dev": true
},
"encoding": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
"requires": {
"iconv-lite": "~0.4.13"
}
},
"es6-promise": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz",
"integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg=="
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"form-data": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "1.0.6",
"mime-types": "^2.1.12"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"get-func-name": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
"integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"he": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true
},
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
},
"isomorphic-fetch": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
"integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
"requires": {
"node-fetch": "^1.0.1",
"whatwg-fetch": ">=0.10.0"
}
},
"make-error": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz",
"integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==",
"dev": true
},
"mime-db": {
"version": "1.36.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz",
"integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw=="
},
"mime-types": {
"version": "2.1.20",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz",
"integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==",
"requires": {
"mime-db": "~1.36.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"mocha": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
"integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
"dev": true,
"requires": {
"browser-stdout": "1.3.1",
"commander": "2.15.1",
"debug": "3.1.0",
"diff": "3.5.0",
"escape-string-regexp": "1.0.5",
"glob": "7.1.2",
"growl": "1.10.5",
"he": "1.1.1",
"minimatch": "3.0.4",
"mkdirp": "0.5.1",
"supports-color": "5.4.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
"requires": {
"encoding": "^0.1.11",
"is-stream": "^1.0.1"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"pathval": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
"integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
"dev": true
},
"querystringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz",
"integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg=="
},
"requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"source-map-support": {
"version": "0.5.9",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz",
"integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"supports-color": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"ts-node": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz",
"integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==",
"dev": true,
"requires": {
"arrify": "^1.0.0",
"buffer-from": "^1.1.0",
"diff": "^3.1.0",
"make-error": "^1.1.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.5.6",
"yn": "^2.0.0"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
}
},
"type-detect": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
"dev": true
},
"typescript": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
"dev": true
},
"url-parse": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz",
"integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==",
"requires": {
"querystringify": "^2.0.0",
"requires-port": "^1.0.0"
}
},
"whatwg-fetch": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz",
"integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q=="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"yn": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
"integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
"dev": true
}
}
}

View File

@ -7,8 +7,8 @@
"declaration": true,
/* Additional Checks */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true, /* Report errors on unused parameters. */
"noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!)
"noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
@ -16,10 +16,10 @@
"sourceMap": true,
"outDir": "./dist",
"noLib": false,
"declaration": true,
"lib": [ "es6", "dom" ]
},
"exclude": [
"dist",
"node_modules"
],
"filesGlob": [