@amityco/ts-sdk-react-native 6.12.0 → 6.12.1
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/index.cjs.js
CHANGED
|
@@ -116,8 +116,8 @@ const PostContentType = Object.freeze({
|
|
|
116
116
|
|
|
117
117
|
function getVersion() {
|
|
118
118
|
try {
|
|
119
|
-
// the string ''v6.12.
|
|
120
|
-
return 'v6.12.
|
|
119
|
+
// the string ''v6.12.1-cjs'' should be replaced by actual value by @rollup/plugin-replace
|
|
120
|
+
return 'v6.12.1-cjs';
|
|
121
121
|
}
|
|
122
122
|
catch (error) {
|
|
123
123
|
return '__dev__';
|
|
@@ -1767,34 +1767,6 @@ const createWebsocketTransport = (endpoint) => {
|
|
|
1767
1767
|
socket.connect();
|
|
1768
1768
|
});
|
|
1769
1769
|
return socket;
|
|
1770
|
-
};
|
|
1771
|
-
/**
|
|
1772
|
-
* Promisify a websocket event emission - resulting in a synchronous http-like XHR (ws legacy)
|
|
1773
|
-
*
|
|
1774
|
-
* @param client The current client for which to send the event with
|
|
1775
|
-
* @param event The websocket event name
|
|
1776
|
-
* @param data The event's payload
|
|
1777
|
-
*
|
|
1778
|
-
* @returns The data returned by the backend
|
|
1779
|
-
* @throws An error related to backend's rejection
|
|
1780
|
-
*
|
|
1781
|
-
* @category Transport
|
|
1782
|
-
* @async
|
|
1783
|
-
* @hidden
|
|
1784
|
-
*/
|
|
1785
|
-
const synchronousWSCall = async (client, event, data) => {
|
|
1786
|
-
const { ws } = client;
|
|
1787
|
-
const value = await new Promise((resolve, reject) => {
|
|
1788
|
-
ws.emit(event, data, (response) => {
|
|
1789
|
-
try {
|
|
1790
|
-
resolve(unwrapPayload(response));
|
|
1791
|
-
}
|
|
1792
|
-
catch (error) {
|
|
1793
|
-
reject(error);
|
|
1794
|
-
}
|
|
1795
|
-
});
|
|
1796
|
-
});
|
|
1797
|
-
return value;
|
|
1798
1770
|
};
|
|
1799
1771
|
|
|
1800
1772
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -13222,18 +13194,17 @@ const deleteReport = async (referenceType, referenceId) => {
|
|
|
13222
13194
|
* @async
|
|
13223
13195
|
* */
|
|
13224
13196
|
const isReportedByMe = async (referenceType, referenceId) => {
|
|
13225
|
-
var _a
|
|
13197
|
+
var _a;
|
|
13226
13198
|
const client = getActiveClient();
|
|
13227
13199
|
client.log('report/isReportedByMe', { referenceType, referenceId });
|
|
13228
|
-
const {
|
|
13200
|
+
const { domainName } = REFERENCE_TYPES[referenceType];
|
|
13229
13201
|
if (referenceType === 'message') {
|
|
13230
13202
|
const { data } = await client.http.get(`/api/v5/messages/${encodeURIComponent(referenceId)}/flags`);
|
|
13231
13203
|
return data.result;
|
|
13232
13204
|
}
|
|
13233
|
-
const {
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
return (_b = result !== null && result !== void 0 ? result : isFlagByMe) !== null && _b !== void 0 ? _b : false;
|
|
13205
|
+
const { data } = await client.http.get(`/api/v3/${domainName}/${referenceId}/isflagbyme`);
|
|
13206
|
+
const { result, isFlagByMe } = data !== null && data !== void 0 ? data : {};
|
|
13207
|
+
return (_a = result !== null && result !== void 0 ? result : isFlagByMe) !== null && _a !== void 0 ? _a : false;
|
|
13237
13208
|
};
|
|
13238
13209
|
|
|
13239
13210
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -83,8 +83,8 @@ const PostContentType = Object.freeze({
|
|
|
83
83
|
|
|
84
84
|
function getVersion() {
|
|
85
85
|
try {
|
|
86
|
-
// the string ''v6.12.
|
|
87
|
-
return 'v6.12.
|
|
86
|
+
// the string ''v6.12.1-esm'' should be replaced by actual value by @rollup/plugin-replace
|
|
87
|
+
return 'v6.12.1-esm';
|
|
88
88
|
}
|
|
89
89
|
catch (error) {
|
|
90
90
|
return '__dev__';
|
|
@@ -1734,34 +1734,6 @@ const createWebsocketTransport = (endpoint) => {
|
|
|
1734
1734
|
socket.connect();
|
|
1735
1735
|
});
|
|
1736
1736
|
return socket;
|
|
1737
|
-
};
|
|
1738
|
-
/**
|
|
1739
|
-
* Promisify a websocket event emission - resulting in a synchronous http-like XHR (ws legacy)
|
|
1740
|
-
*
|
|
1741
|
-
* @param client The current client for which to send the event with
|
|
1742
|
-
* @param event The websocket event name
|
|
1743
|
-
* @param data The event's payload
|
|
1744
|
-
*
|
|
1745
|
-
* @returns The data returned by the backend
|
|
1746
|
-
* @throws An error related to backend's rejection
|
|
1747
|
-
*
|
|
1748
|
-
* @category Transport
|
|
1749
|
-
* @async
|
|
1750
|
-
* @hidden
|
|
1751
|
-
*/
|
|
1752
|
-
const synchronousWSCall = async (client, event, data) => {
|
|
1753
|
-
const { ws } = client;
|
|
1754
|
-
const value = await new Promise((resolve, reject) => {
|
|
1755
|
-
ws.emit(event, data, (response) => {
|
|
1756
|
-
try {
|
|
1757
|
-
resolve(unwrapPayload(response));
|
|
1758
|
-
}
|
|
1759
|
-
catch (error) {
|
|
1760
|
-
reject(error);
|
|
1761
|
-
}
|
|
1762
|
-
});
|
|
1763
|
-
});
|
|
1764
|
-
return value;
|
|
1765
1737
|
};
|
|
1766
1738
|
|
|
1767
1739
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -29294,18 +29266,17 @@ const deleteReport = async (referenceType, referenceId) => {
|
|
|
29294
29266
|
* @async
|
|
29295
29267
|
* */
|
|
29296
29268
|
const isReportedByMe = async (referenceType, referenceId) => {
|
|
29297
|
-
var _a
|
|
29269
|
+
var _a;
|
|
29298
29270
|
const client = getActiveClient();
|
|
29299
29271
|
client.log('report/isReportedByMe', { referenceType, referenceId });
|
|
29300
|
-
const {
|
|
29272
|
+
const { domainName } = REFERENCE_TYPES[referenceType];
|
|
29301
29273
|
if (referenceType === 'message') {
|
|
29302
29274
|
const { data } = await client.http.get(`/api/v5/messages/${encodeURIComponent(referenceId)}/flags`);
|
|
29303
29275
|
return data.result;
|
|
29304
29276
|
}
|
|
29305
|
-
const {
|
|
29306
|
-
|
|
29307
|
-
|
|
29308
|
-
return (_b = result !== null && result !== void 0 ? result : isFlagByMe) !== null && _b !== void 0 ? _b : false;
|
|
29277
|
+
const { data } = await client.http.get(`/api/v3/${domainName}/${referenceId}/isflagbyme`);
|
|
29278
|
+
const { result, isFlagByMe } = data !== null && data !== void 0 ? data : {};
|
|
29279
|
+
return (_a = result !== null && result !== void 0 ? result : isFlagByMe) !== null && _a !== void 0 ? _a : false;
|
|
29309
29280
|
};
|
|
29310
29281
|
|
|
29311
29282
|
/**
|