Skip to content

Commit

Permalink
Merge pull request #12226 from HEYGUL/remove-querystring
Browse files Browse the repository at this point in the history
[Javascript] Remove deprecated `querystring` dependency.
  • Loading branch information
HugoMario authored Feb 11, 2024
2 parents 67a018a + 7aaf80d commit 0f7dea0
Show file tree
Hide file tree
Showing 99 changed files with 113 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['superagent', 'querystring'], factory);
define(['superagent'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('superagent'), require('querystring'));
module.exports = factory(require('superagent'));
} else {
// Browser globals (root is window)
if (!root.{{moduleName}}) {
root.{{moduleName}} = {};
}
root.{{moduleName}}.ApiClient = factory(root.superagent, root.querystring);
root.{{moduleName}}.ApiClient = factory(root.superagent);
}
}(this, function(superagent, querystring) {
}(this, function(superagent) {
'use strict';
{{#emitJSDoc}} /**
Expand Down Expand Up @@ -432,7 +432,8 @@
}

if (contentType === 'application/x-www-form-urlencoded') {
request.send(querystring.stringify(this.normalizeParams(formParams)));
const searchParams = new URLSearchParams(this.normalizeParams(formParams));
request.send(searchParams.toString());
} else if (contentType == 'multipart/form-data') {
var _formParams = this.normalizeParams(formParams);
for (var key in _formParams) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{>licenseInfo}}
import superagent from "superagent";
import querystring from "querystring";

{{#emitJSDoc}}/**
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient
Expand Down Expand Up @@ -420,7 +419,8 @@ export class ApiClient {
}

if (contentType === 'application/x-www-form-urlencoded') {
request.send(querystring.stringify(this.normalizeParams(formParams)));
const searchParams = new URLSearchParams(this.normalizeParams(formParams));
request.send(searchParams.toString());
} else if (contentType == 'multipart/form-data') {
var _formParams = this.normalizeParams(formParams);
for (var key in _formParams) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"fs": false
},
"dependencies": {
"superagent": "3.7.0",
"querystring": "0.2.0"
"superagent": "3.7.0"
},
"devDependencies": {
"mocha": "~2.3.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.19-SNAPSHOT
2.4.33-SNAPSHOT
6 changes: 3 additions & 3 deletions samples/client/petstore/javascript-es6/src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
*/

import superagent from "superagent";
import querystring from "querystring";

/**
* @module ApiClient
Expand Down Expand Up @@ -425,7 +424,8 @@ export class ApiClient {
}

if (contentType === 'application/x-www-form-urlencoded') {
request.send(querystring.stringify(this.normalizeParams(formParams)));
const searchParams = new URLSearchParams(this.normalizeParams(formParams));
request.send(searchParams.toString());
} else if (contentType == 'multipart/form-data') {
var _formParams = this.normalizeParams(formParams);
for (var key in _formParams) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/api/FakeApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/api/PetApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/api/StoreApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/api/UserApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/Animal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/Cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/Dog.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/Ints.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/model/Name.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.19-SNAPSHOT
* Swagger Codegen version: 2.4.33-SNAPSHOT
*
* Do not edit the class manually.
*
Expand Down
Loading

0 comments on commit 0f7dea0

Please sign in to comment.