Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { {{ classname }} } from './{{ classFilename }}';
export * from './{{ classFilename }}Interface'
{{/withInterfaces}}
{{/apis}}
import * as fs from 'fs';
import * as http from 'http';

export class HttpError extends Error {
Expand All @@ -18,15 +17,7 @@ export class HttpError extends Error {
}
}

export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}

export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
export { RequestFile } from '../model/models';

export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^-last}}, {{/-last}}{{/apis}}];
{{/apiInfo}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{>licenseInfo}}
{{#models}}
{{#model}}
import { RequestFile } from '../api';
import { RequestFile } from './models';
{{#tsImports}}
import { {{classname}} } from '{{filename}}';
{{/tsImports}}
Expand Down Expand Up @@ -78,4 +78,4 @@ export enum {{classname}} {
}
{{/isEnum}}
{{/model}}
{{/models}}
{{/models}}
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
{{#generateApis}}
import localVarRequest from 'request';
{{/generateApis}}

{{#models}}
{{#model}}
export * from '{{{ classFilename }}}';
{{/model}}
{{/models}}

import localVarRequest from 'request';
import * as fs from 'fs';

export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}

export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;

{{! Object serialization only relevant if generating APIs, too }}
{{#generateApis}}

{{#models}}
{{#model}}
Expand Down Expand Up @@ -235,3 +252,4 @@ export class VoidAuth implements Authentication {
}

export type Interceptor = (requestOptions: localVarRequest.Options) => (Promise<void> | void);
{{/generateApis}}
11 changes: 1 addition & 10 deletions samples/client/petstore/typescript-node/default/api/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from './storeApi';
import { StoreApi } from './storeApi';
export * from './userApi';
import { UserApi } from './userApi';
import * as fs from 'fs';
import * as http from 'http';

export class HttpError extends Error {
Expand All @@ -14,14 +13,6 @@ export class HttpError extends Error {
}
}

export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}

export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
export { RequestFile } from '../model/models';

export const APIS = [PetApi, StoreApi, UserApi];
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* Describes the result of uploading an image resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* A category for a pet
Expand Down
15 changes: 14 additions & 1 deletion samples/client/petstore/typescript-node/default/model/models.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import localVarRequest from 'request';

export * from './apiResponse';
export * from './category';
export * from './order';
export * from './pet';
export * from './tag';
export * from './user';

import localVarRequest from 'request';
import * as fs from 'fs';

export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}

export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;


import { ApiResponse } from './apiResponse';
import { Category } from './category';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* An order for a pets from the pet store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';
import { Category } from './category';
import { Tag } from './tag';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* A tag for a pet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* A User who is purchasing from the pet store
Expand Down
11 changes: 1 addition & 10 deletions samples/client/petstore/typescript-node/npm/api/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from './storeApi';
import { StoreApi } from './storeApi';
export * from './userApi';
import { UserApi } from './userApi';
import * as fs from 'fs';
import * as http from 'http';

export class HttpError extends Error {
Expand All @@ -14,14 +13,6 @@ export class HttpError extends Error {
}
}

export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}

export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
export { RequestFile } from '../model/models';

export const APIS = [PetApi, StoreApi, UserApi];
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* Describes the result of uploading an image resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* A category for a pet
Expand Down
15 changes: 14 additions & 1 deletion samples/client/petstore/typescript-node/npm/model/models.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import localVarRequest from 'request';

export * from './apiResponse';
export * from './category';
export * from './order';
export * from './pet';
export * from './tag';
export * from './user';

import localVarRequest from 'request';
import * as fs from 'fs';

export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}

export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;


import { ApiResponse } from './apiResponse';
import { Category } from './category';
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/typescript-node/npm/model/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* An order for a pets from the pet store
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/typescript-node/npm/model/pet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';
import { Category } from './category';
import { Tag } from './tag';

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/typescript-node/npm/model/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* A tag for a pet
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/typescript-node/npm/model/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Do not edit the class manually.
*/

import { RequestFile } from '../api';
import { RequestFile } from './models';

/**
* A User who is purchasing from the pet store
Expand Down