@seayoo-io/combo-sdk-node 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/const.d.ts +1 -1
- package/dist/index.cjs +4 -5
- package/dist/index.js +4 -5
- package/dist/request/inc/type.d.ts +1 -1
- package/package.json +1 -1
package/dist/const.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
|
|
|
12
12
|
/** SDK 名称 */
|
|
13
13
|
const SDKName = "combo-sdk-node";
|
|
14
14
|
/** SDK 版本,在编译前会被动态替换 */
|
|
15
|
-
const SDKVersion = "0.1.
|
|
15
|
+
const SDKVersion = "0.1.8";
|
|
16
16
|
/**
|
|
17
17
|
* 世游支持的服务端点列表
|
|
18
18
|
*/
|
|
@@ -575,15 +575,14 @@ async function convertOptions(url, config, options) {
|
|
|
575
575
|
const opt = Object.assign({
|
|
576
576
|
method: "GET"
|
|
577
577
|
}, options);
|
|
578
|
-
const
|
|
579
|
-
const method = isFormMode ? "POST" : opt.method;
|
|
578
|
+
const method = opt.method;
|
|
580
579
|
if (method === "GET" || method === "HEAD" || method === "DELETE") {
|
|
581
580
|
if (opt.body !== undefined) {
|
|
582
581
|
console.warn("request body is invalid with method get, head, delete");
|
|
583
582
|
delete opt.body;
|
|
584
583
|
}
|
|
585
584
|
}
|
|
586
|
-
const headers = Object.assign(
|
|
585
|
+
const headers = Object.assign({
|
|
587
586
|
"Content-Type": "application/json;charset=utf-8"
|
|
588
587
|
}, opt.headers);
|
|
589
588
|
const p = opt.params || {};
|
|
@@ -638,7 +637,7 @@ function convertBody(body) {
|
|
|
638
637
|
if (!body) {
|
|
639
638
|
return;
|
|
640
639
|
}
|
|
641
|
-
if (body instanceof Blob || body instanceof ArrayBuffer || body instanceof
|
|
640
|
+
if (body instanceof Blob || body instanceof ArrayBuffer || body instanceof URLSearchParams || typeof body === "string") {
|
|
642
641
|
return body;
|
|
643
642
|
}
|
|
644
643
|
return JSON.stringify(body);
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { verify } from 'jsonwebtoken';
|
|
|
7
7
|
/** SDK 名称 */
|
|
8
8
|
const SDKName = "combo-sdk-node";
|
|
9
9
|
/** SDK 版本,在编译前会被动态替换 */
|
|
10
|
-
const SDKVersion = "0.1.
|
|
10
|
+
const SDKVersion = "0.1.8";
|
|
11
11
|
/**
|
|
12
12
|
* 世游支持的服务端点列表
|
|
13
13
|
*/
|
|
@@ -570,15 +570,14 @@ async function convertOptions(url, config, options) {
|
|
|
570
570
|
const opt = Object.assign({
|
|
571
571
|
method: "GET"
|
|
572
572
|
}, options);
|
|
573
|
-
const
|
|
574
|
-
const method = isFormMode ? "POST" : opt.method;
|
|
573
|
+
const method = opt.method;
|
|
575
574
|
if (method === "GET" || method === "HEAD" || method === "DELETE") {
|
|
576
575
|
if (opt.body !== undefined) {
|
|
577
576
|
console.warn("request body is invalid with method get, head, delete");
|
|
578
577
|
delete opt.body;
|
|
579
578
|
}
|
|
580
579
|
}
|
|
581
|
-
const headers = Object.assign(
|
|
580
|
+
const headers = Object.assign({
|
|
582
581
|
"Content-Type": "application/json;charset=utf-8"
|
|
583
582
|
}, opt.headers);
|
|
584
583
|
const p = opt.params || {};
|
|
@@ -633,7 +632,7 @@ function convertBody(body) {
|
|
|
633
632
|
if (!body) {
|
|
634
633
|
return;
|
|
635
634
|
}
|
|
636
|
-
if (body instanceof Blob || body instanceof ArrayBuffer || body instanceof
|
|
635
|
+
if (body instanceof Blob || body instanceof ArrayBuffer || body instanceof URLSearchParams || typeof body === "string") {
|
|
637
636
|
return body;
|
|
638
637
|
}
|
|
639
638
|
return JSON.stringify(body);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestGlobalConfig } from "./config";
|
|
2
2
|
import type { MaybePromise, TypeGuard, TypeGuardFn } from "../../utils";
|
|
3
|
-
export type IBaseRequestBody = Blob | ArrayBuffer |
|
|
3
|
+
export type IBaseRequestBody = Blob | ArrayBuffer | URLSearchParams | string;
|
|
4
4
|
/** 通用网络请求工具的基本配置 */
|
|
5
5
|
export interface IBaseRequestOptions {
|
|
6
6
|
/** 网络请求方法,默认 GET */
|