Update security samples for typescript-clients (Angular1/2). (#5288)

This commit is contained in:
Paŭlo Ebermann
2017-04-04 08:44:25 +02:00
committed by wing328
parent ca976c524a
commit 41b04e0e01
9 changed files with 123 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
import * as api from './api/api';
import * as angular from 'angular';
const apiModule = angular.module('api', [])
.service('FakeApi', api.FakeApi)
export default apiModule;

View File

@@ -0,0 +1,59 @@
/**
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import * as models from '../model/models';
/* tslint:disable:no-unused-variable member-ordering */
export class FakeApi {
protected basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
public defaultHeaders : any = {};
static $inject: string[] = ['$http', '$httpParamSerializer', 'basePath'];
constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) {
if (basePath !== undefined) {
this.basePath = basePath;
}
}
/**
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
*
* @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
*/
public testCodeInjectEndRnNR (test code inject * &#39; &quot; &#x3D;end rn n r?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/fake';
let queryParameters: any = {};
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
let formParams: any = {};
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
formParams['test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r'] = test code inject * &#39; &quot; &#x3D;end rn n r;
let httpRequestParams: ng.IRequestConfig = {
method: 'PUT',
url: localVarPath,
data: this.$httpParamSerializer(formParams),
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = (<any>Object).assign(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
}

View File

@@ -0,0 +1,3 @@
export * from './FakeApi';
import { FakeApi } from './FakeApi';
export const APIS = [ FakeApi, ];

View File

@@ -0,0 +1,2 @@
export * from './api/api';
export * from './model/models';

View File

@@ -0,0 +1,24 @@
/**
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import * as models from './models';
/**
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
*/
export interface ModelReturn {
/**
* property description *_/ ' \" =end -- \\r\\n \\n \\r
*/
"return"?: number;
}

View File

@@ -0,0 +1 @@
export * from './ModelReturn';

View File

@@ -63,7 +63,7 @@ export class FakeApi {
* @param test code inject * &#39; &quot; &#x3D;end rn n r To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*/
public testCodeInjectEndRnNRWithHttpInfo(test code inject * &#39; &quot; &#x3D;end rn n r?: string, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + `/fake`;
const path = this.basePath + '/fake';
let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

View File

@@ -1,3 +1,3 @@
export * from './FakeApi';
import { FakeApi } from './FakeApi';
export const APIS = [ FakeApi, ];
import { FakeApi } from './FakeApi';
export const APIS = [FakeApi];

View File

@@ -0,0 +1,24 @@
/**
* Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import * as models from './models';
/**
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
*/
export interface ModelReturn {
/**
* property description *_/ ' \" =end -- \\r\\n \\n \\r
*/
return?: number;
}