woodenfish-bot 5.0.3 → 5.0.4
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/es/index.js +57 -48
- package/lib/index.js +57 -48
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -282,7 +282,7 @@ var Guild = /*#__PURE__*/function () {
|
|
|
282
282
|
}]);
|
|
283
283
|
}();
|
|
284
284
|
|
|
285
|
-
var version = "5.0.
|
|
285
|
+
var version = "5.0.4";
|
|
286
286
|
|
|
287
287
|
function getDefaultExportFromCjs (x) {
|
|
288
288
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -1309,8 +1309,8 @@ var Audio = /*#__PURE__*/function () {
|
|
|
1309
1309
|
}]);
|
|
1310
1310
|
}();
|
|
1311
1311
|
|
|
1312
|
-
function ownKeys$
|
|
1313
|
-
function _objectSpread$
|
|
1312
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1313
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1314
1314
|
var Mute = /*#__PURE__*/function () {
|
|
1315
1315
|
function Mute(request, config) {
|
|
1316
1316
|
_classCallCheck(this, Mute);
|
|
@@ -1371,7 +1371,7 @@ var Mute = /*#__PURE__*/function () {
|
|
|
1371
1371
|
guildID: guildID
|
|
1372
1372
|
},
|
|
1373
1373
|
// 将options和userIDList合并到一起
|
|
1374
|
-
data: _objectSpread$
|
|
1374
|
+
data: _objectSpread$6(_objectSpread$6({}, options), {}, {
|
|
1375
1375
|
user_ids: userIDList
|
|
1376
1376
|
})
|
|
1377
1377
|
};
|
|
@@ -1567,8 +1567,8 @@ var Schedule = /*#__PURE__*/function () {
|
|
|
1567
1567
|
}]);
|
|
1568
1568
|
}();
|
|
1569
1569
|
|
|
1570
|
-
function ownKeys$
|
|
1571
|
-
function _objectSpread$
|
|
1570
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1571
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1572
1572
|
var Threads = /*#__PURE__*/function () {
|
|
1573
1573
|
function Threads(request, config) {
|
|
1574
1574
|
_classCallCheck(this, Threads);
|
|
@@ -1582,7 +1582,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1582
1582
|
return _createClass(Threads, [{
|
|
1583
1583
|
key: "threads",
|
|
1584
1584
|
value: function threads(channelID, requestOptions) {
|
|
1585
|
-
var options = _objectSpread$
|
|
1585
|
+
var options = _objectSpread$5({
|
|
1586
1586
|
method: 'GET',
|
|
1587
1587
|
url: getURL$1('threadsURI'),
|
|
1588
1588
|
rest: {
|
|
@@ -1596,7 +1596,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1596
1596
|
}, {
|
|
1597
1597
|
key: "thread",
|
|
1598
1598
|
value: function thread(channelID, threadID, requestOptions) {
|
|
1599
|
-
var options = _objectSpread$
|
|
1599
|
+
var options = _objectSpread$5({
|
|
1600
1600
|
method: 'GET',
|
|
1601
1601
|
url: getURL$1('threadURI'),
|
|
1602
1602
|
rest: {
|
|
@@ -1611,7 +1611,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1611
1611
|
}, {
|
|
1612
1612
|
key: "putThreads",
|
|
1613
1613
|
value: function putThreads(channelID, _Threads2, requestOptions) {
|
|
1614
|
-
var options = _objectSpread$
|
|
1614
|
+
var options = _objectSpread$5({
|
|
1615
1615
|
method: 'PUT',
|
|
1616
1616
|
url: getURL$1('threadsURI'),
|
|
1617
1617
|
rest: {
|
|
@@ -1628,7 +1628,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1628
1628
|
}, {
|
|
1629
1629
|
key: "putPostReply",
|
|
1630
1630
|
value: function putPostReply(channelID, threadID, postID, reply, requestOptions) {
|
|
1631
|
-
var options = _objectSpread$
|
|
1631
|
+
var options = _objectSpread$5({
|
|
1632
1632
|
method: 'PUT',
|
|
1633
1633
|
url: getURL$1('threadPostRepliesURI'),
|
|
1634
1634
|
rest: {
|
|
@@ -1645,7 +1645,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1645
1645
|
}, {
|
|
1646
1646
|
key: "deleteThreads",
|
|
1647
1647
|
value: function deleteThreads(channelID, threadID, requestOptions) {
|
|
1648
|
-
var options = _objectSpread$
|
|
1648
|
+
var options = _objectSpread$5({
|
|
1649
1649
|
method: 'DELETE',
|
|
1650
1650
|
url: getURL$1('threadURI'),
|
|
1651
1651
|
rest: {
|
|
@@ -1727,8 +1727,8 @@ var Interaction = /*#__PURE__*/function () {
|
|
|
1727
1727
|
}]);
|
|
1728
1728
|
}();
|
|
1729
1729
|
|
|
1730
|
-
function ownKeys$
|
|
1731
|
-
function _objectSpread$
|
|
1730
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1731
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1732
1732
|
var getTraceID = function getTraceID(error) {
|
|
1733
1733
|
var _error$response;
|
|
1734
1734
|
return error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.headers) === null || _error$response === void 0 ? void 0 : _error$response['x-tps-trace-id'];
|
|
@@ -1737,12 +1737,12 @@ var normalizeV1OpenAPIError = function normalizeV1OpenAPIError(error) {
|
|
|
1737
1737
|
var _error$response2;
|
|
1738
1738
|
var traceid = getTraceID(error);
|
|
1739
1739
|
if (error !== null && error !== void 0 && (_error$response2 = error.response) !== null && _error$response2 !== void 0 && _error$response2.data) {
|
|
1740
|
-
return _objectSpread$
|
|
1740
|
+
return _objectSpread$4(_objectSpread$4({}, error.response.data), {}, {
|
|
1741
1741
|
traceid: traceid
|
|
1742
1742
|
});
|
|
1743
1743
|
}
|
|
1744
1744
|
if (error !== null && error !== void 0 && error.response) {
|
|
1745
|
-
return _objectSpread$
|
|
1745
|
+
return _objectSpread$4(_objectSpread$4({}, error.response), {}, {
|
|
1746
1746
|
traceid: traceid
|
|
1747
1747
|
});
|
|
1748
1748
|
}
|
|
@@ -1752,20 +1752,20 @@ var normalizeV2OpenAPIError = function normalizeV2OpenAPIError(error) {
|
|
|
1752
1752
|
var _error$response3;
|
|
1753
1753
|
var traceID = getTraceID(error);
|
|
1754
1754
|
if (error !== null && error !== void 0 && (_error$response3 = error.response) !== null && _error$response3 !== void 0 && _error$response3.data) {
|
|
1755
|
-
return _objectSpread$
|
|
1755
|
+
return _objectSpread$4(_objectSpread$4({}, error.response.data), {}, {
|
|
1756
1756
|
trace_id: error.response.data.trace_id || traceID
|
|
1757
1757
|
});
|
|
1758
1758
|
}
|
|
1759
1759
|
if (error !== null && error !== void 0 && error.response) {
|
|
1760
|
-
return _objectSpread$
|
|
1760
|
+
return _objectSpread$4(_objectSpread$4({}, error.response), {}, {
|
|
1761
1761
|
trace_id: traceID
|
|
1762
1762
|
});
|
|
1763
1763
|
}
|
|
1764
1764
|
return error;
|
|
1765
1765
|
};
|
|
1766
1766
|
|
|
1767
|
-
function ownKeys$
|
|
1768
|
-
function _objectSpread$
|
|
1767
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1768
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1769
1769
|
var OpenAPI$1 = /*#__PURE__*/function () {
|
|
1770
1770
|
function OpenAPI(config) {
|
|
1771
1771
|
var _this = this;
|
|
@@ -1794,23 +1794,25 @@ var OpenAPI$1 = /*#__PURE__*/function () {
|
|
|
1794
1794
|
// 基础rest请求
|
|
1795
1795
|
_defineProperty(this, "request", /*#__PURE__*/function () {
|
|
1796
1796
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
1797
|
-
var _this$config, appID, token, botUrl, client, _t;
|
|
1797
|
+
var _this$config, appID, token, requestOptions, botUrl, client, _t;
|
|
1798
1798
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
1799
1799
|
while (1) switch (_context.prev = _context.next) {
|
|
1800
1800
|
case 0:
|
|
1801
1801
|
_this$config = _this.config, appID = _this$config.appID, token = _this$config.token;
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1802
|
+
requestOptions = _objectSpread$3(_objectSpread$3({}, options), {}, {
|
|
1803
|
+
headers: _objectSpread$3({}, options.headers),
|
|
1804
|
+
// QQ OpenAPI must not inherit HTTP(S)_PROXY or ALL_PROXY from the host process.
|
|
1805
|
+
proxy: false
|
|
1806
|
+
}); // 添加 UA
|
|
1807
|
+
addUserAgent(requestOptions.headers);
|
|
1806
1808
|
// 添加鉴权信息
|
|
1807
|
-
addV1Authorization(
|
|
1809
|
+
addV1Authorization(requestOptions.headers, appID, token);
|
|
1808
1810
|
// 组装完整Url
|
|
1809
|
-
botUrl = buildUrl(
|
|
1810
|
-
client = resty.create(
|
|
1811
|
+
botUrl = buildUrl(requestOptions.url, _this.config.sandbox);
|
|
1812
|
+
client = resty.create(requestOptions);
|
|
1811
1813
|
_context.prev = 1;
|
|
1812
1814
|
_context.next = 2;
|
|
1813
|
-
return client.request(botUrl,
|
|
1815
|
+
return client.request(botUrl, requestOptions);
|
|
1814
1816
|
case 2:
|
|
1815
1817
|
return _context.abrupt("return", _context.sent);
|
|
1816
1818
|
case 3:
|
|
@@ -2060,8 +2062,8 @@ var getURL = function getURL(endpoint) {
|
|
|
2060
2062
|
return apiMap[endpoint];
|
|
2061
2063
|
};
|
|
2062
2064
|
|
|
2063
|
-
function ownKeys$
|
|
2064
|
-
function _objectSpread$
|
|
2065
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2066
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2065
2067
|
var Group = /*#__PURE__*/function () {
|
|
2066
2068
|
function Group(request, config) {
|
|
2067
2069
|
_classCallCheck(this, Group);
|
|
@@ -2073,7 +2075,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2073
2075
|
return _createClass(Group, [{
|
|
2074
2076
|
key: "getGroupInfo",
|
|
2075
2077
|
value: function getGroupInfo(groupOpenid, requestOptions) {
|
|
2076
|
-
return this.request(_objectSpread$
|
|
2078
|
+
return this.request(_objectSpread$2({
|
|
2077
2079
|
method: 'GET',
|
|
2078
2080
|
url: getURL('groupInfoURI'),
|
|
2079
2081
|
rest: {
|
|
@@ -2084,7 +2086,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2084
2086
|
}, {
|
|
2085
2087
|
key: "getGroupBotState",
|
|
2086
2088
|
value: function getGroupBotState(groupOpenid, requestOptions) {
|
|
2087
|
-
return this.request(_objectSpread$
|
|
2089
|
+
return this.request(_objectSpread$2({
|
|
2088
2090
|
method: 'GET',
|
|
2089
2091
|
url: getURL('groupBotStateURI'),
|
|
2090
2092
|
rest: {
|
|
@@ -2095,7 +2097,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2095
2097
|
}, {
|
|
2096
2098
|
key: "getGroupJoinRequests",
|
|
2097
2099
|
value: function getGroupJoinRequests(groupOpenid, pager, requestOptions) {
|
|
2098
|
-
return this.request(_objectSpread$
|
|
2100
|
+
return this.request(_objectSpread$2({
|
|
2099
2101
|
method: 'GET',
|
|
2100
2102
|
url: getURL('groupJoinRequestListURI'),
|
|
2101
2103
|
rest: {
|
|
@@ -2107,7 +2109,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2107
2109
|
}, {
|
|
2108
2110
|
key: "approveGroupJoinRequest",
|
|
2109
2111
|
value: function approveGroupJoinRequest(groupOpenid, memberOpenid, options, requestOptions) {
|
|
2110
|
-
return this.request(_objectSpread$
|
|
2112
|
+
return this.request(_objectSpread$2({
|
|
2111
2113
|
method: 'POST',
|
|
2112
2114
|
url: getURL('groupJoinRequestApprovalURI'),
|
|
2113
2115
|
rest: {
|
|
@@ -2120,7 +2122,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2120
2122
|
}, {
|
|
2121
2123
|
key: "getGroupRestrictChatSetting",
|
|
2122
2124
|
value: function getGroupRestrictChatSetting(groupOpenid, requestOptions) {
|
|
2123
|
-
return this.request(_objectSpread$
|
|
2125
|
+
return this.request(_objectSpread$2({
|
|
2124
2126
|
method: 'GET',
|
|
2125
2127
|
url: getURL('groupRestrictChatSettingURI'),
|
|
2126
2128
|
rest: {
|
|
@@ -2131,7 +2133,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2131
2133
|
}, {
|
|
2132
2134
|
key: "setGroupRestrictChatSetting",
|
|
2133
2135
|
value: function setGroupRestrictChatSetting(groupOpenid, options, requestOptions) {
|
|
2134
|
-
return this.request(_objectSpread$
|
|
2136
|
+
return this.request(_objectSpread$2({
|
|
2135
2137
|
method: 'POST',
|
|
2136
2138
|
url: getURL('groupRestrictChatSettingURI'),
|
|
2137
2139
|
rest: {
|
|
@@ -2143,7 +2145,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2143
2145
|
}, {
|
|
2144
2146
|
key: "getGroupJoinApprovalStrategies",
|
|
2145
2147
|
value: function getGroupJoinApprovalStrategies(pager, requestOptions) {
|
|
2146
|
-
return this.request(_objectSpread$
|
|
2148
|
+
return this.request(_objectSpread$2({
|
|
2147
2149
|
method: 'GET',
|
|
2148
2150
|
url: getURL('groupJoinApprovalStrategiesURI'),
|
|
2149
2151
|
params: pager || {}
|
|
@@ -2152,7 +2154,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2152
2154
|
}, {
|
|
2153
2155
|
key: "createGroupJoinApprovalStrategy",
|
|
2154
2156
|
value: function createGroupJoinApprovalStrategy(options, requestOptions) {
|
|
2155
|
-
return this.request(_objectSpread$
|
|
2157
|
+
return this.request(_objectSpread$2({
|
|
2156
2158
|
method: 'POST',
|
|
2157
2159
|
url: getURL('groupJoinApprovalStrategiesURI'),
|
|
2158
2160
|
data: options
|
|
@@ -2161,7 +2163,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2161
2163
|
}, {
|
|
2162
2164
|
key: "updateGroupJoinApprovalStrategy",
|
|
2163
2165
|
value: function updateGroupJoinApprovalStrategy(strategyID, options, requestOptions) {
|
|
2164
|
-
return this.request(_objectSpread$
|
|
2166
|
+
return this.request(_objectSpread$2({
|
|
2165
2167
|
method: 'PATCH',
|
|
2166
2168
|
url: getURL('groupJoinApprovalStrategyURI'),
|
|
2167
2169
|
rest: {
|
|
@@ -2173,7 +2175,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2173
2175
|
}, {
|
|
2174
2176
|
key: "deleteGroupJoinApprovalStrategy",
|
|
2175
2177
|
value: function deleteGroupJoinApprovalStrategy(strategyID, requestOptions) {
|
|
2176
|
-
return this.request(_objectSpread$
|
|
2178
|
+
return this.request(_objectSpread$2({
|
|
2177
2179
|
method: 'DELETE',
|
|
2178
2180
|
url: getURL('groupJoinApprovalStrategyURI'),
|
|
2179
2181
|
rest: {
|
|
@@ -2184,7 +2186,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2184
2186
|
}, {
|
|
2185
2187
|
key: "executeGroupJoinApprovalStrategy",
|
|
2186
2188
|
value: function executeGroupJoinApprovalStrategy(strategyID, requestOptions) {
|
|
2187
|
-
return this.request(_objectSpread$
|
|
2189
|
+
return this.request(_objectSpread$2({
|
|
2188
2190
|
method: 'POST',
|
|
2189
2191
|
url: getURL('groupJoinApprovalStrategyExecuteURI'),
|
|
2190
2192
|
rest: {
|
|
@@ -2196,7 +2198,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2196
2198
|
}, {
|
|
2197
2199
|
key: "updateGroupJoinApprovalStrategyWhitelist",
|
|
2198
2200
|
value: function updateGroupJoinApprovalStrategyWhitelist(strategyID, options, requestOptions) {
|
|
2199
|
-
return this.request(_objectSpread$
|
|
2201
|
+
return this.request(_objectSpread$2({
|
|
2200
2202
|
method: 'POST',
|
|
2201
2203
|
url: getURL('groupJoinApprovalStrategyWhitelistURI'),
|
|
2202
2204
|
rest: {
|
|
@@ -2303,8 +2305,8 @@ var Message = /*#__PURE__*/function (_CommonMessage) {
|
|
|
2303
2305
|
}]);
|
|
2304
2306
|
}(Message$1);
|
|
2305
2307
|
|
|
2306
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2307
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2308
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2309
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2308
2310
|
var isAuthenticationError = function isAuthenticationError(error) {
|
|
2309
2311
|
var _error$response, _error$response2;
|
|
2310
2312
|
var responseData = error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data;
|
|
@@ -2342,8 +2344,10 @@ var OpenAPI = /*#__PURE__*/function () {
|
|
|
2342
2344
|
while (1) switch (_context.prev = _context.next) {
|
|
2343
2345
|
case 0:
|
|
2344
2346
|
forceRefresh = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
2345
|
-
preparedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
2346
|
-
headers: _objectSpread({}, options.headers)
|
|
2347
|
+
preparedOptions = _objectSpread$1(_objectSpread$1({}, options), {}, {
|
|
2348
|
+
headers: _objectSpread$1({}, options.headers),
|
|
2349
|
+
// QQ OpenAPI must not inherit HTTP(S)_PROXY or ALL_PROXY from the host process.
|
|
2350
|
+
proxy: false
|
|
2347
2351
|
});
|
|
2348
2352
|
addUserAgent(preparedOptions.headers);
|
|
2349
2353
|
_context.next = 1;
|
|
@@ -3178,6 +3182,8 @@ var Ws = /*#__PURE__*/function () {
|
|
|
3178
3182
|
}]);
|
|
3179
3183
|
}();
|
|
3180
3184
|
|
|
3185
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3186
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3181
3187
|
var Session = /*#__PURE__*/function () {
|
|
3182
3188
|
function Session(config, authorization, event, sessionRecord) {
|
|
3183
3189
|
_classCallCheck(this, Session);
|
|
@@ -3202,7 +3208,7 @@ var Session = /*#__PURE__*/function () {
|
|
|
3202
3208
|
key: "createSession",
|
|
3203
3209
|
value: function () {
|
|
3204
3210
|
var _createSession = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3205
|
-
var reqOptions, response, wsData, _response, _t;
|
|
3211
|
+
var reqOptions, requestOptions, response, wsData, _response, _t;
|
|
3206
3212
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
3207
3213
|
while (1) switch (_context.prev = _context.next) {
|
|
3208
3214
|
case 0:
|
|
@@ -3213,8 +3219,11 @@ var Session = /*#__PURE__*/function () {
|
|
|
3213
3219
|
return this.authorization.getAuthorization();
|
|
3214
3220
|
case 1:
|
|
3215
3221
|
reqOptions.headers.Authorization = _context.sent;
|
|
3222
|
+
requestOptions = _objectSpread(_objectSpread({}, reqOptions), {}, {
|
|
3223
|
+
proxy: false
|
|
3224
|
+
});
|
|
3216
3225
|
_context.next = 2;
|
|
3217
|
-
return resty.create(
|
|
3226
|
+
return resty.create(requestOptions).get(requestOptions.url, requestOptions);
|
|
3218
3227
|
case 2:
|
|
3219
3228
|
response = _context.sent;
|
|
3220
3229
|
wsData = response.data;
|
package/lib/index.js
CHANGED
|
@@ -284,7 +284,7 @@ var Guild = /*#__PURE__*/function () {
|
|
|
284
284
|
}]);
|
|
285
285
|
}();
|
|
286
286
|
|
|
287
|
-
var version = "5.0.
|
|
287
|
+
var version = "5.0.4";
|
|
288
288
|
|
|
289
289
|
function getDefaultExportFromCjs (x) {
|
|
290
290
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -1311,8 +1311,8 @@ var Audio = /*#__PURE__*/function () {
|
|
|
1311
1311
|
}]);
|
|
1312
1312
|
}();
|
|
1313
1313
|
|
|
1314
|
-
function ownKeys$
|
|
1315
|
-
function _objectSpread$
|
|
1314
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1315
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1316
1316
|
var Mute = /*#__PURE__*/function () {
|
|
1317
1317
|
function Mute(request, config) {
|
|
1318
1318
|
_classCallCheck(this, Mute);
|
|
@@ -1373,7 +1373,7 @@ var Mute = /*#__PURE__*/function () {
|
|
|
1373
1373
|
guildID: guildID
|
|
1374
1374
|
},
|
|
1375
1375
|
// 将options和userIDList合并到一起
|
|
1376
|
-
data: _objectSpread$
|
|
1376
|
+
data: _objectSpread$6(_objectSpread$6({}, options), {}, {
|
|
1377
1377
|
user_ids: userIDList
|
|
1378
1378
|
})
|
|
1379
1379
|
};
|
|
@@ -1569,8 +1569,8 @@ var Schedule = /*#__PURE__*/function () {
|
|
|
1569
1569
|
}]);
|
|
1570
1570
|
}();
|
|
1571
1571
|
|
|
1572
|
-
function ownKeys$
|
|
1573
|
-
function _objectSpread$
|
|
1572
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1573
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1574
1574
|
var Threads = /*#__PURE__*/function () {
|
|
1575
1575
|
function Threads(request, config) {
|
|
1576
1576
|
_classCallCheck(this, Threads);
|
|
@@ -1584,7 +1584,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1584
1584
|
return _createClass(Threads, [{
|
|
1585
1585
|
key: "threads",
|
|
1586
1586
|
value: function threads(channelID, requestOptions) {
|
|
1587
|
-
var options = _objectSpread$
|
|
1587
|
+
var options = _objectSpread$5({
|
|
1588
1588
|
method: 'GET',
|
|
1589
1589
|
url: getURL$1('threadsURI'),
|
|
1590
1590
|
rest: {
|
|
@@ -1598,7 +1598,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1598
1598
|
}, {
|
|
1599
1599
|
key: "thread",
|
|
1600
1600
|
value: function thread(channelID, threadID, requestOptions) {
|
|
1601
|
-
var options = _objectSpread$
|
|
1601
|
+
var options = _objectSpread$5({
|
|
1602
1602
|
method: 'GET',
|
|
1603
1603
|
url: getURL$1('threadURI'),
|
|
1604
1604
|
rest: {
|
|
@@ -1613,7 +1613,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1613
1613
|
}, {
|
|
1614
1614
|
key: "putThreads",
|
|
1615
1615
|
value: function putThreads(channelID, _Threads2, requestOptions) {
|
|
1616
|
-
var options = _objectSpread$
|
|
1616
|
+
var options = _objectSpread$5({
|
|
1617
1617
|
method: 'PUT',
|
|
1618
1618
|
url: getURL$1('threadsURI'),
|
|
1619
1619
|
rest: {
|
|
@@ -1630,7 +1630,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1630
1630
|
}, {
|
|
1631
1631
|
key: "putPostReply",
|
|
1632
1632
|
value: function putPostReply(channelID, threadID, postID, reply, requestOptions) {
|
|
1633
|
-
var options = _objectSpread$
|
|
1633
|
+
var options = _objectSpread$5({
|
|
1634
1634
|
method: 'PUT',
|
|
1635
1635
|
url: getURL$1('threadPostRepliesURI'),
|
|
1636
1636
|
rest: {
|
|
@@ -1647,7 +1647,7 @@ var Threads = /*#__PURE__*/function () {
|
|
|
1647
1647
|
}, {
|
|
1648
1648
|
key: "deleteThreads",
|
|
1649
1649
|
value: function deleteThreads(channelID, threadID, requestOptions) {
|
|
1650
|
-
var options = _objectSpread$
|
|
1650
|
+
var options = _objectSpread$5({
|
|
1651
1651
|
method: 'DELETE',
|
|
1652
1652
|
url: getURL$1('threadURI'),
|
|
1653
1653
|
rest: {
|
|
@@ -1729,8 +1729,8 @@ var Interaction = /*#__PURE__*/function () {
|
|
|
1729
1729
|
}]);
|
|
1730
1730
|
}();
|
|
1731
1731
|
|
|
1732
|
-
function ownKeys$
|
|
1733
|
-
function _objectSpread$
|
|
1732
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1733
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1734
1734
|
var getTraceID = function getTraceID(error) {
|
|
1735
1735
|
var _error$response;
|
|
1736
1736
|
return error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.headers) === null || _error$response === void 0 ? void 0 : _error$response['x-tps-trace-id'];
|
|
@@ -1739,12 +1739,12 @@ var normalizeV1OpenAPIError = function normalizeV1OpenAPIError(error) {
|
|
|
1739
1739
|
var _error$response2;
|
|
1740
1740
|
var traceid = getTraceID(error);
|
|
1741
1741
|
if (error !== null && error !== void 0 && (_error$response2 = error.response) !== null && _error$response2 !== void 0 && _error$response2.data) {
|
|
1742
|
-
return _objectSpread$
|
|
1742
|
+
return _objectSpread$4(_objectSpread$4({}, error.response.data), {}, {
|
|
1743
1743
|
traceid: traceid
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
if (error !== null && error !== void 0 && error.response) {
|
|
1747
|
-
return _objectSpread$
|
|
1747
|
+
return _objectSpread$4(_objectSpread$4({}, error.response), {}, {
|
|
1748
1748
|
traceid: traceid
|
|
1749
1749
|
});
|
|
1750
1750
|
}
|
|
@@ -1754,20 +1754,20 @@ var normalizeV2OpenAPIError = function normalizeV2OpenAPIError(error) {
|
|
|
1754
1754
|
var _error$response3;
|
|
1755
1755
|
var traceID = getTraceID(error);
|
|
1756
1756
|
if (error !== null && error !== void 0 && (_error$response3 = error.response) !== null && _error$response3 !== void 0 && _error$response3.data) {
|
|
1757
|
-
return _objectSpread$
|
|
1757
|
+
return _objectSpread$4(_objectSpread$4({}, error.response.data), {}, {
|
|
1758
1758
|
trace_id: error.response.data.trace_id || traceID
|
|
1759
1759
|
});
|
|
1760
1760
|
}
|
|
1761
1761
|
if (error !== null && error !== void 0 && error.response) {
|
|
1762
|
-
return _objectSpread$
|
|
1762
|
+
return _objectSpread$4(_objectSpread$4({}, error.response), {}, {
|
|
1763
1763
|
trace_id: traceID
|
|
1764
1764
|
});
|
|
1765
1765
|
}
|
|
1766
1766
|
return error;
|
|
1767
1767
|
};
|
|
1768
1768
|
|
|
1769
|
-
function ownKeys$
|
|
1770
|
-
function _objectSpread$
|
|
1769
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1770
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1771
1771
|
var OpenAPI$1 = /*#__PURE__*/function () {
|
|
1772
1772
|
function OpenAPI(config) {
|
|
1773
1773
|
var _this = this;
|
|
@@ -1796,23 +1796,25 @@ var OpenAPI$1 = /*#__PURE__*/function () {
|
|
|
1796
1796
|
// 基础rest请求
|
|
1797
1797
|
_defineProperty(this, "request", /*#__PURE__*/function () {
|
|
1798
1798
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
1799
|
-
var _this$config, appID, token, botUrl, client, _t;
|
|
1799
|
+
var _this$config, appID, token, requestOptions, botUrl, client, _t;
|
|
1800
1800
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
1801
1801
|
while (1) switch (_context.prev = _context.next) {
|
|
1802
1802
|
case 0:
|
|
1803
1803
|
_this$config = _this.config, appID = _this$config.appID, token = _this$config.token;
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1804
|
+
requestOptions = _objectSpread$3(_objectSpread$3({}, options), {}, {
|
|
1805
|
+
headers: _objectSpread$3({}, options.headers),
|
|
1806
|
+
// QQ OpenAPI must not inherit HTTP(S)_PROXY or ALL_PROXY from the host process.
|
|
1807
|
+
proxy: false
|
|
1808
|
+
}); // 添加 UA
|
|
1809
|
+
addUserAgent(requestOptions.headers);
|
|
1808
1810
|
// 添加鉴权信息
|
|
1809
|
-
addV1Authorization(
|
|
1811
|
+
addV1Authorization(requestOptions.headers, appID, token);
|
|
1810
1812
|
// 组装完整Url
|
|
1811
|
-
botUrl = buildUrl(
|
|
1812
|
-
client = resty.create(
|
|
1813
|
+
botUrl = buildUrl(requestOptions.url, _this.config.sandbox);
|
|
1814
|
+
client = resty.create(requestOptions);
|
|
1813
1815
|
_context.prev = 1;
|
|
1814
1816
|
_context.next = 2;
|
|
1815
|
-
return client.request(botUrl,
|
|
1817
|
+
return client.request(botUrl, requestOptions);
|
|
1816
1818
|
case 2:
|
|
1817
1819
|
return _context.abrupt("return", _context.sent);
|
|
1818
1820
|
case 3:
|
|
@@ -2062,8 +2064,8 @@ var getURL = function getURL(endpoint) {
|
|
|
2062
2064
|
return apiMap[endpoint];
|
|
2063
2065
|
};
|
|
2064
2066
|
|
|
2065
|
-
function ownKeys$
|
|
2066
|
-
function _objectSpread$
|
|
2067
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2068
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2067
2069
|
var Group = /*#__PURE__*/function () {
|
|
2068
2070
|
function Group(request, config) {
|
|
2069
2071
|
_classCallCheck(this, Group);
|
|
@@ -2075,7 +2077,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2075
2077
|
return _createClass(Group, [{
|
|
2076
2078
|
key: "getGroupInfo",
|
|
2077
2079
|
value: function getGroupInfo(groupOpenid, requestOptions) {
|
|
2078
|
-
return this.request(_objectSpread$
|
|
2080
|
+
return this.request(_objectSpread$2({
|
|
2079
2081
|
method: 'GET',
|
|
2080
2082
|
url: getURL('groupInfoURI'),
|
|
2081
2083
|
rest: {
|
|
@@ -2086,7 +2088,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2086
2088
|
}, {
|
|
2087
2089
|
key: "getGroupBotState",
|
|
2088
2090
|
value: function getGroupBotState(groupOpenid, requestOptions) {
|
|
2089
|
-
return this.request(_objectSpread$
|
|
2091
|
+
return this.request(_objectSpread$2({
|
|
2090
2092
|
method: 'GET',
|
|
2091
2093
|
url: getURL('groupBotStateURI'),
|
|
2092
2094
|
rest: {
|
|
@@ -2097,7 +2099,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2097
2099
|
}, {
|
|
2098
2100
|
key: "getGroupJoinRequests",
|
|
2099
2101
|
value: function getGroupJoinRequests(groupOpenid, pager, requestOptions) {
|
|
2100
|
-
return this.request(_objectSpread$
|
|
2102
|
+
return this.request(_objectSpread$2({
|
|
2101
2103
|
method: 'GET',
|
|
2102
2104
|
url: getURL('groupJoinRequestListURI'),
|
|
2103
2105
|
rest: {
|
|
@@ -2109,7 +2111,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2109
2111
|
}, {
|
|
2110
2112
|
key: "approveGroupJoinRequest",
|
|
2111
2113
|
value: function approveGroupJoinRequest(groupOpenid, memberOpenid, options, requestOptions) {
|
|
2112
|
-
return this.request(_objectSpread$
|
|
2114
|
+
return this.request(_objectSpread$2({
|
|
2113
2115
|
method: 'POST',
|
|
2114
2116
|
url: getURL('groupJoinRequestApprovalURI'),
|
|
2115
2117
|
rest: {
|
|
@@ -2122,7 +2124,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2122
2124
|
}, {
|
|
2123
2125
|
key: "getGroupRestrictChatSetting",
|
|
2124
2126
|
value: function getGroupRestrictChatSetting(groupOpenid, requestOptions) {
|
|
2125
|
-
return this.request(_objectSpread$
|
|
2127
|
+
return this.request(_objectSpread$2({
|
|
2126
2128
|
method: 'GET',
|
|
2127
2129
|
url: getURL('groupRestrictChatSettingURI'),
|
|
2128
2130
|
rest: {
|
|
@@ -2133,7 +2135,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2133
2135
|
}, {
|
|
2134
2136
|
key: "setGroupRestrictChatSetting",
|
|
2135
2137
|
value: function setGroupRestrictChatSetting(groupOpenid, options, requestOptions) {
|
|
2136
|
-
return this.request(_objectSpread$
|
|
2138
|
+
return this.request(_objectSpread$2({
|
|
2137
2139
|
method: 'POST',
|
|
2138
2140
|
url: getURL('groupRestrictChatSettingURI'),
|
|
2139
2141
|
rest: {
|
|
@@ -2145,7 +2147,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2145
2147
|
}, {
|
|
2146
2148
|
key: "getGroupJoinApprovalStrategies",
|
|
2147
2149
|
value: function getGroupJoinApprovalStrategies(pager, requestOptions) {
|
|
2148
|
-
return this.request(_objectSpread$
|
|
2150
|
+
return this.request(_objectSpread$2({
|
|
2149
2151
|
method: 'GET',
|
|
2150
2152
|
url: getURL('groupJoinApprovalStrategiesURI'),
|
|
2151
2153
|
params: pager || {}
|
|
@@ -2154,7 +2156,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2154
2156
|
}, {
|
|
2155
2157
|
key: "createGroupJoinApprovalStrategy",
|
|
2156
2158
|
value: function createGroupJoinApprovalStrategy(options, requestOptions) {
|
|
2157
|
-
return this.request(_objectSpread$
|
|
2159
|
+
return this.request(_objectSpread$2({
|
|
2158
2160
|
method: 'POST',
|
|
2159
2161
|
url: getURL('groupJoinApprovalStrategiesURI'),
|
|
2160
2162
|
data: options
|
|
@@ -2163,7 +2165,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2163
2165
|
}, {
|
|
2164
2166
|
key: "updateGroupJoinApprovalStrategy",
|
|
2165
2167
|
value: function updateGroupJoinApprovalStrategy(strategyID, options, requestOptions) {
|
|
2166
|
-
return this.request(_objectSpread$
|
|
2168
|
+
return this.request(_objectSpread$2({
|
|
2167
2169
|
method: 'PATCH',
|
|
2168
2170
|
url: getURL('groupJoinApprovalStrategyURI'),
|
|
2169
2171
|
rest: {
|
|
@@ -2175,7 +2177,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2175
2177
|
}, {
|
|
2176
2178
|
key: "deleteGroupJoinApprovalStrategy",
|
|
2177
2179
|
value: function deleteGroupJoinApprovalStrategy(strategyID, requestOptions) {
|
|
2178
|
-
return this.request(_objectSpread$
|
|
2180
|
+
return this.request(_objectSpread$2({
|
|
2179
2181
|
method: 'DELETE',
|
|
2180
2182
|
url: getURL('groupJoinApprovalStrategyURI'),
|
|
2181
2183
|
rest: {
|
|
@@ -2186,7 +2188,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2186
2188
|
}, {
|
|
2187
2189
|
key: "executeGroupJoinApprovalStrategy",
|
|
2188
2190
|
value: function executeGroupJoinApprovalStrategy(strategyID, requestOptions) {
|
|
2189
|
-
return this.request(_objectSpread$
|
|
2191
|
+
return this.request(_objectSpread$2({
|
|
2190
2192
|
method: 'POST',
|
|
2191
2193
|
url: getURL('groupJoinApprovalStrategyExecuteURI'),
|
|
2192
2194
|
rest: {
|
|
@@ -2198,7 +2200,7 @@ var Group = /*#__PURE__*/function () {
|
|
|
2198
2200
|
}, {
|
|
2199
2201
|
key: "updateGroupJoinApprovalStrategyWhitelist",
|
|
2200
2202
|
value: function updateGroupJoinApprovalStrategyWhitelist(strategyID, options, requestOptions) {
|
|
2201
|
-
return this.request(_objectSpread$
|
|
2203
|
+
return this.request(_objectSpread$2({
|
|
2202
2204
|
method: 'POST',
|
|
2203
2205
|
url: getURL('groupJoinApprovalStrategyWhitelistURI'),
|
|
2204
2206
|
rest: {
|
|
@@ -2305,8 +2307,8 @@ var Message = /*#__PURE__*/function (_CommonMessage) {
|
|
|
2305
2307
|
}]);
|
|
2306
2308
|
}(Message$1);
|
|
2307
2309
|
|
|
2308
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2309
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2310
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2311
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2310
2312
|
var isAuthenticationError = function isAuthenticationError(error) {
|
|
2311
2313
|
var _error$response, _error$response2;
|
|
2312
2314
|
var responseData = error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data;
|
|
@@ -2344,8 +2346,10 @@ var OpenAPI = /*#__PURE__*/function () {
|
|
|
2344
2346
|
while (1) switch (_context.prev = _context.next) {
|
|
2345
2347
|
case 0:
|
|
2346
2348
|
forceRefresh = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
2347
|
-
preparedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
2348
|
-
headers: _objectSpread({}, options.headers)
|
|
2349
|
+
preparedOptions = _objectSpread$1(_objectSpread$1({}, options), {}, {
|
|
2350
|
+
headers: _objectSpread$1({}, options.headers),
|
|
2351
|
+
// QQ OpenAPI must not inherit HTTP(S)_PROXY or ALL_PROXY from the host process.
|
|
2352
|
+
proxy: false
|
|
2349
2353
|
});
|
|
2350
2354
|
addUserAgent(preparedOptions.headers);
|
|
2351
2355
|
_context.next = 1;
|
|
@@ -3180,6 +3184,8 @@ var Ws = /*#__PURE__*/function () {
|
|
|
3180
3184
|
}]);
|
|
3181
3185
|
}();
|
|
3182
3186
|
|
|
3187
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3188
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3183
3189
|
var Session = /*#__PURE__*/function () {
|
|
3184
3190
|
function Session(config, authorization, event, sessionRecord) {
|
|
3185
3191
|
_classCallCheck(this, Session);
|
|
@@ -3204,7 +3210,7 @@ var Session = /*#__PURE__*/function () {
|
|
|
3204
3210
|
key: "createSession",
|
|
3205
3211
|
value: function () {
|
|
3206
3212
|
var _createSession = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3207
|
-
var reqOptions, response, wsData, _response, _t;
|
|
3213
|
+
var reqOptions, requestOptions, response, wsData, _response, _t;
|
|
3208
3214
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
3209
3215
|
while (1) switch (_context.prev = _context.next) {
|
|
3210
3216
|
case 0:
|
|
@@ -3215,8 +3221,11 @@ var Session = /*#__PURE__*/function () {
|
|
|
3215
3221
|
return this.authorization.getAuthorization();
|
|
3216
3222
|
case 1:
|
|
3217
3223
|
reqOptions.headers.Authorization = _context.sent;
|
|
3224
|
+
requestOptions = _objectSpread(_objectSpread({}, reqOptions), {}, {
|
|
3225
|
+
proxy: false
|
|
3226
|
+
});
|
|
3218
3227
|
_context.next = 2;
|
|
3219
|
-
return resty.create(
|
|
3228
|
+
return resty.create(requestOptions).get(requestOptions.url, requestOptions);
|
|
3220
3229
|
case 2:
|
|
3221
3230
|
response = _context.sent;
|
|
3222
3231
|
wsData = response.data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "woodenfish-bot",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "woodenfish-bot",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"eslint-config-prettier": "^10.1.8",
|
|
62
62
|
"eslint-plugin-jest": "^29.16.1",
|
|
63
63
|
"eslint-plugin-prettier": "^5.5.6",
|
|
64
|
-
"globals": "^17.
|
|
64
|
+
"globals": "^17.11.0",
|
|
65
65
|
"handlebars": "^4.7.9",
|
|
66
66
|
"inquirer": "^13.4.2",
|
|
67
67
|
"jest": "^30.4.2",
|