forked from loafle/openapi-generator-original
add back petstore-security-test/typescript-angular
This commit is contained in:
3
samples/client/petstore-security-test/typescript-angular/.gitignore
vendored
Normal file
3
samples/client/petstore-security-test/typescript-angular/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
wwwroot/*.js
|
||||
node_modules
|
||||
typings
|
||||
@@ -0,0 +1,23 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
@@ -0,0 +1 @@
|
||||
2.2.3-SNAPSHOT
|
||||
@@ -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;
|
||||
@@ -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 * ' " =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 */ ' " =end -- \r\n \n \r'] = test code inject * ' " =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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './FakeApi';
|
||||
import { FakeApi } from './FakeApi';
|
||||
export const APIS = [FakeApi];
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="GIT_USER_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './api/api';
|
||||
export * from './model/models';
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from './ModelReturn';
|
||||
Reference in New Issue
Block a user