diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptJqueryClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptJqueryClientCodegen.java index 9edb26a7829..701f764191e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptJqueryClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptJqueryClientCodegen.java @@ -130,6 +130,7 @@ private void addNpmPackageGeneration() { } //Files for building our lib + supportingFiles.add(new SupportingFile("README.mustache", getPackageRootDirectory(), "README.md")); supportingFiles.add(new SupportingFile("package.mustache", getPackageRootDirectory(), "package.json")); supportingFiles.add(new SupportingFile("typings.mustache", getPackageRootDirectory(), "typings.json")); supportingFiles.add(new SupportingFile("tsconfig.mustache", getPackageRootDirectory(), "tsconfig.json")); diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/README.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/README.mustache index d339a5933ea..0139231eaff 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/README.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/README.mustache @@ -27,11 +27,11 @@ npm run build ### Publishing -First build the package than run ```npm publish``` +First build the package then run ```npm publish``` ### Consuming -navigate to the folder of your consuming project and run one of next commando's. +navigate to the folder of your consuming project and run one of the following commands. _published:_ diff --git a/modules/swagger-codegen/src/main/resources/typescript-jquery/README.mustache b/modules/swagger-codegen/src/main/resources/typescript-jquery/README.mustache new file mode 100644 index 00000000000..31fe0fd5b00 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/typescript-jquery/README.mustache @@ -0,0 +1,45 @@ +## {{npmName}}@{{npmVersion}} + +This generator creates TypeScript/JavaScript client that utilizes [jQuery](https://jquery.com/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build an compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install {{npmName}}@{{npmVersion}} --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 524623e31c8..6cc673e543c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -36,7 +36,7 @@ export const COLLECTION_FORMATS = { * @interface FetchAPI */ export interface FetchAPI { - (url: string, init?: any): Promise; + (url: string, init?: any): Promise; } /** @@ -689,7 +689,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -709,7 +709,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -785,7 +785,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -806,7 +806,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1188,7 +1188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1637,7 +1637,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1656,7 +1656,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1675,7 +1675,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1694,7 +1694,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1751,7 +1751,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1771,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/default/git_push.sh b/samples/client/petstore/typescript-fetch/builds/default/git_push.sh index 1eb5727f6cd..a1ff4c9bcba 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-fetch/builds/default/git_push.sh @@ -36,7 +36,7 @@ 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." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential 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 diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/README.md b/samples/client/petstore/typescript-fetch/builds/es6-target/README.md index 3b95bfd7076..5e33f07adc5 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/README.md +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/README.md @@ -27,11 +27,11 @@ npm run build ### Publishing -First build the package than run ```npm publish``` +First build the package then run ```npm publish``` ### Consuming -navigate to the folder of your consuming project and run one of next commando's. +navigate to the folder of your consuming project and run one of the following commands. _published:_ diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index 524623e31c8..6cc673e543c 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -36,7 +36,7 @@ export const COLLECTION_FORMATS = { * @interface FetchAPI */ export interface FetchAPI { - (url: string, init?: any): Promise; + (url: string, init?: any): Promise; } /** @@ -689,7 +689,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -709,7 +709,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -785,7 +785,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -806,7 +806,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1188,7 +1188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1637,7 +1637,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1656,7 +1656,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1675,7 +1675,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1694,7 +1694,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1751,7 +1751,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1771,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh b/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh index 1eb5727f6cd..a1ff4c9bcba 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh @@ -36,7 +36,7 @@ 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." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential 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 diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md index 3b95bfd7076..5e33f07adc5 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md @@ -27,11 +27,11 @@ npm run build ### Publishing -First build the package than run ```npm publish``` +First build the package then run ```npm publish``` ### Consuming -navigate to the folder of your consuming project and run one of next commando's. +navigate to the folder of your consuming project and run one of the following commands. _published:_ diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 524623e31c8..6cc673e543c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -36,7 +36,7 @@ export const COLLECTION_FORMATS = { * @interface FetchAPI */ export interface FetchAPI { - (url: string, init?: any): Promise; + (url: string, init?: any): Promise; } /** @@ -689,7 +689,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -709,7 +709,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -785,7 +785,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -806,7 +806,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1188,7 +1188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1637,7 +1637,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1656,7 +1656,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1675,7 +1675,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1694,7 +1694,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1751,7 +1751,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { @@ -1771,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh b/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh index 1eb5727f6cd..a1ff4c9bcba 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh @@ -36,7 +36,7 @@ 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." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential 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 diff --git a/samples/client/petstore/typescript-jquery/default/git_push.sh b/samples/client/petstore/typescript-jquery/default/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-jquery/default/git_push.sh +++ b/samples/client/petstore/typescript-jquery/default/git_push.sh @@ -36,7 +36,7 @@ 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." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential 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 diff --git a/samples/client/petstore/typescript-jquery/npm/README.md b/samples/client/petstore/typescript-jquery/npm/README.md new file mode 100644 index 00000000000..6b1105e1d49 --- /dev/null +++ b/samples/client/petstore/typescript-jquery/npm/README.md @@ -0,0 +1,45 @@ +## @swagger/jquery-typescript-petstore@0.0.1 + +This generator creates TypeScript/JavaScript client that utilizes [jQuery](https://jquery.com/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build an compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install @swagger/jquery-typescript-petstore@0.0.1 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/samples/client/petstore/typescript-jquery/npm/git_push.sh b/samples/client/petstore/typescript-jquery/npm/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/typescript-jquery/npm/git_push.sh +++ b/samples/client/petstore/typescript-jquery/npm/git_push.sh @@ -36,7 +36,7 @@ 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." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential 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