Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Javascript] Remove deprecated querystring dependency. #12226

Merged
merged 3 commits into from
Feb 11, 2024
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 @@ -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
Loading