@cloudbase/wx-cloud-client-sdk 1.7.1-alpha.0 → 1.7.2
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/lib/types/index.d.ts
CHANGED
|
@@ -718,6 +718,7 @@ export type IMySqlClient = (options?: IMySqlOptions) => MySqlClient;
|
|
|
718
718
|
export interface ExtendedCloudBaseInstance extends CloudBaseInstance {
|
|
719
719
|
models: OrmClient & OrmRawQueryClient;
|
|
720
720
|
mysql: IMySqlClient;
|
|
721
|
+
rdb: IMySqlClient;
|
|
721
722
|
}
|
|
722
723
|
/**
|
|
723
724
|
* 云函数调用方法定义。
|
|
@@ -145,7 +145,7 @@ function getUserAgent() {
|
|
|
145
145
|
return ua_1;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
var VERSION = "1.7.
|
|
148
|
+
var VERSION = "1.7.2";
|
|
149
149
|
|
|
150
150
|
var callDataSource = function (_a) {
|
|
151
151
|
var dataSourceName = _a.dataSourceName, methodName = _a.methodName, params = _a.params, realMethodName = _a.realMethodName, callFunction = _a.callFunction, _b = _a.envType, envType = _b === void 0 ? 'prod' : _b, mode = _a.mode;
|
|
@@ -595,6 +595,7 @@ var generateClient = function (callFunction) {
|
|
|
595
595
|
* Headers polyfill for environments without native Headers support
|
|
596
596
|
* 兼容的Headers类实现
|
|
597
597
|
*/
|
|
598
|
+
// @ts-ignore
|
|
598
599
|
var _Headers = /** @class */ (function () {
|
|
599
600
|
function _Headers(init) {
|
|
600
601
|
var _this = this;
|
|
@@ -614,7 +615,7 @@ var _Headers = /** @class */ (function () {
|
|
|
614
615
|
_this.append(key, value);
|
|
615
616
|
});
|
|
616
617
|
}
|
|
617
|
-
else if (typeof init ===
|
|
618
|
+
else if (typeof init === 'object') {
|
|
618
619
|
// 从普通对象初始化
|
|
619
620
|
Object.keys(init).forEach(function (key) {
|
|
620
621
|
_this.append(key, init[key]);
|
|
@@ -707,7 +708,7 @@ var _Headers = /** @class */ (function () {
|
|
|
707
708
|
_Headers.prototype.getSetCookie = function () {
|
|
708
709
|
var values = [];
|
|
709
710
|
this.map.forEach(function (value, key) {
|
|
710
|
-
if (key ===
|
|
711
|
+
if (key === 'set-cookie') {
|
|
711
712
|
values.push(value);
|
|
712
713
|
}
|
|
713
714
|
});
|
|
@@ -733,7 +734,7 @@ var _Headers = /** @class */ (function () {
|
|
|
733
734
|
return _Headers;
|
|
734
735
|
}());
|
|
735
736
|
// 自动polyfill,兼容不同环境
|
|
736
|
-
if (typeof globalThis ===
|
|
737
|
+
if (typeof globalThis === 'object' && !globalThis.Headers) {
|
|
737
738
|
globalThis.Headers = _Headers;
|
|
738
739
|
}
|
|
739
740
|
|
|
@@ -5668,6 +5669,9 @@ function init(cloud, options) {
|
|
|
5668
5669
|
cloud.mysql = generateMySQLClient(cloud, {
|
|
5669
5670
|
envId: options === null || options === void 0 ? void 0 : options.envId
|
|
5670
5671
|
});
|
|
5672
|
+
cloud.rdb = generateMySQLClient(cloud, {
|
|
5673
|
+
envId: options === null || options === void 0 ? void 0 : options.envId
|
|
5674
|
+
});
|
|
5671
5675
|
return cloud;
|
|
5672
5676
|
}
|
|
5673
5677
|
function generateMySQLClient(cloud, options) {
|
|
@@ -5735,7 +5739,7 @@ function getDefaultGatewayBaseUrl(cloud, envId) {
|
|
|
5735
5739
|
return {
|
|
5736
5740
|
model: "https://".concat(env, ".api.tcloudbasegateway.com/v1/model"),
|
|
5737
5741
|
sql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/sql"),
|
|
5738
|
-
mysql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/rdb/rest
|
|
5742
|
+
mysql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/rdb/rest")
|
|
5739
5743
|
};
|
|
5740
5744
|
}
|
|
5741
5745
|
var index = {
|
|
@@ -141,7 +141,7 @@ function getUserAgent() {
|
|
|
141
141
|
return ua_1;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
var VERSION = "1.7.
|
|
144
|
+
var VERSION = "1.7.2";
|
|
145
145
|
|
|
146
146
|
var callDataSource = function (_a) {
|
|
147
147
|
var dataSourceName = _a.dataSourceName, methodName = _a.methodName, params = _a.params, realMethodName = _a.realMethodName, callFunction = _a.callFunction, _b = _a.envType, envType = _b === void 0 ? 'prod' : _b, mode = _a.mode;
|
|
@@ -591,6 +591,7 @@ var generateClient = function (callFunction) {
|
|
|
591
591
|
* Headers polyfill for environments without native Headers support
|
|
592
592
|
* 兼容的Headers类实现
|
|
593
593
|
*/
|
|
594
|
+
// @ts-ignore
|
|
594
595
|
var _Headers = /** @class */ (function () {
|
|
595
596
|
function _Headers(init) {
|
|
596
597
|
var _this = this;
|
|
@@ -610,7 +611,7 @@ var _Headers = /** @class */ (function () {
|
|
|
610
611
|
_this.append(key, value);
|
|
611
612
|
});
|
|
612
613
|
}
|
|
613
|
-
else if (typeof init ===
|
|
614
|
+
else if (typeof init === 'object') {
|
|
614
615
|
// 从普通对象初始化
|
|
615
616
|
Object.keys(init).forEach(function (key) {
|
|
616
617
|
_this.append(key, init[key]);
|
|
@@ -703,7 +704,7 @@ var _Headers = /** @class */ (function () {
|
|
|
703
704
|
_Headers.prototype.getSetCookie = function () {
|
|
704
705
|
var values = [];
|
|
705
706
|
this.map.forEach(function (value, key) {
|
|
706
|
-
if (key ===
|
|
707
|
+
if (key === 'set-cookie') {
|
|
707
708
|
values.push(value);
|
|
708
709
|
}
|
|
709
710
|
});
|
|
@@ -729,7 +730,7 @@ var _Headers = /** @class */ (function () {
|
|
|
729
730
|
return _Headers;
|
|
730
731
|
}());
|
|
731
732
|
// 自动polyfill,兼容不同环境
|
|
732
|
-
if (typeof globalThis ===
|
|
733
|
+
if (typeof globalThis === 'object' && !globalThis.Headers) {
|
|
733
734
|
globalThis.Headers = _Headers;
|
|
734
735
|
}
|
|
735
736
|
|
|
@@ -5664,6 +5665,9 @@ function init(cloud, options) {
|
|
|
5664
5665
|
cloud.mysql = generateMySQLClient(cloud, {
|
|
5665
5666
|
envId: options === null || options === void 0 ? void 0 : options.envId
|
|
5666
5667
|
});
|
|
5668
|
+
cloud.rdb = generateMySQLClient(cloud, {
|
|
5669
|
+
envId: options === null || options === void 0 ? void 0 : options.envId
|
|
5670
|
+
});
|
|
5667
5671
|
return cloud;
|
|
5668
5672
|
}
|
|
5669
5673
|
function generateMySQLClient(cloud, options) {
|
|
@@ -5731,7 +5735,7 @@ function getDefaultGatewayBaseUrl(cloud, envId) {
|
|
|
5731
5735
|
return {
|
|
5732
5736
|
model: "https://".concat(env, ".api.tcloudbasegateway.com/v1/model"),
|
|
5733
5737
|
sql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/sql"),
|
|
5734
|
-
mysql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/rdb/rest
|
|
5738
|
+
mysql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/rdb/rest")
|
|
5735
5739
|
};
|
|
5736
5740
|
}
|
|
5737
5741
|
var index = {
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
return ua_1;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
var VERSION = "1.7.
|
|
150
|
+
var VERSION = "1.7.2";
|
|
151
151
|
|
|
152
152
|
var callDataSource = function (_a) {
|
|
153
153
|
var dataSourceName = _a.dataSourceName, methodName = _a.methodName, params = _a.params, realMethodName = _a.realMethodName, callFunction = _a.callFunction, _b = _a.envType, envType = _b === void 0 ? 'prod' : _b, mode = _a.mode;
|
|
@@ -597,6 +597,7 @@
|
|
|
597
597
|
* Headers polyfill for environments without native Headers support
|
|
598
598
|
* 兼容的Headers类实现
|
|
599
599
|
*/
|
|
600
|
+
// @ts-ignore
|
|
600
601
|
var _Headers = /** @class */ (function () {
|
|
601
602
|
function _Headers(init) {
|
|
602
603
|
var _this = this;
|
|
@@ -616,7 +617,7 @@
|
|
|
616
617
|
_this.append(key, value);
|
|
617
618
|
});
|
|
618
619
|
}
|
|
619
|
-
else if (typeof init ===
|
|
620
|
+
else if (typeof init === 'object') {
|
|
620
621
|
// 从普通对象初始化
|
|
621
622
|
Object.keys(init).forEach(function (key) {
|
|
622
623
|
_this.append(key, init[key]);
|
|
@@ -709,7 +710,7 @@
|
|
|
709
710
|
_Headers.prototype.getSetCookie = function () {
|
|
710
711
|
var values = [];
|
|
711
712
|
this.map.forEach(function (value, key) {
|
|
712
|
-
if (key ===
|
|
713
|
+
if (key === 'set-cookie') {
|
|
713
714
|
values.push(value);
|
|
714
715
|
}
|
|
715
716
|
});
|
|
@@ -735,7 +736,7 @@
|
|
|
735
736
|
return _Headers;
|
|
736
737
|
}());
|
|
737
738
|
// 自动polyfill,兼容不同环境
|
|
738
|
-
if (typeof globalThis ===
|
|
739
|
+
if (typeof globalThis === 'object' && !globalThis.Headers) {
|
|
739
740
|
globalThis.Headers = _Headers;
|
|
740
741
|
}
|
|
741
742
|
|
|
@@ -5670,6 +5671,9 @@
|
|
|
5670
5671
|
cloud.mysql = generateMySQLClient(cloud, {
|
|
5671
5672
|
envId: options === null || options === void 0 ? void 0 : options.envId
|
|
5672
5673
|
});
|
|
5674
|
+
cloud.rdb = generateMySQLClient(cloud, {
|
|
5675
|
+
envId: options === null || options === void 0 ? void 0 : options.envId
|
|
5676
|
+
});
|
|
5673
5677
|
return cloud;
|
|
5674
5678
|
}
|
|
5675
5679
|
function generateMySQLClient(cloud, options) {
|
|
@@ -5737,7 +5741,7 @@
|
|
|
5737
5741
|
return {
|
|
5738
5742
|
model: "https://".concat(env, ".api.tcloudbasegateway.com/v1/model"),
|
|
5739
5743
|
sql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/sql"),
|
|
5740
|
-
mysql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/rdb/rest
|
|
5744
|
+
mysql: "https://".concat(env, ".api.tcloudbasegateway.com/v1/rdb/rest")
|
|
5741
5745
|
};
|
|
5742
5746
|
}
|
|
5743
5747
|
var index = {
|