@amityco/ts-sdk 7.26.0 → 7.26.1-1be41ff.0
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/@types/core/permissions.d.ts +7 -3
- package/dist/@types/core/permissions.d.ts.map +1 -1
- package/dist/@types/core/transport.d.ts +3 -1
- package/dist/@types/core/transport.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +1 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/file.d.ts +11 -2
- package/dist/@types/domains/file.d.ts.map +1 -1
- package/dist/@types/domains/liveViewerCount.d.ts +22 -0
- package/dist/@types/domains/liveViewerCount.d.ts.map +1 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/client/api/createClient.d.ts.map +1 -1
- package/dist/client/api/getLiveViewerCountConfig.d.ts +24 -0
- package/dist/client/api/getLiveViewerCountConfig.d.ts.map +1 -0
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/core/transports/mqtt.d.ts.map +1 -1
- package/dist/fileRepository/api/getFile.d.ts.map +1 -1
- package/dist/fileRepository/api/uploadImage.d.ts.map +1 -1
- package/dist/fileRepository/api/uploadVideo.d.ts.map +1 -1
- package/dist/index.cjs.js +142 -14
- package/dist/index.esm.js +143 -15
- package/dist/index.umd.js +2 -2
- package/dist/userRepository/observers/index.d.ts +1 -0
- package/dist/userRepository/observers/index.d.ts.map +1 -1
- package/dist/userRepository/observers/searchUserByDisplayName.d.ts +2 -0
- package/dist/userRepository/observers/searchUserByDisplayName.d.ts.map +1 -1
- package/dist/userRepository/observers/searchUsers.d.ts +26 -0
- package/dist/userRepository/observers/searchUsers.d.ts.map +1 -0
- package/dist/userRepository/observers/tests/integrations/searchUsers.integration.test.d.ts +2 -0
- package/dist/userRepository/observers/tests/integrations/searchUsers.integration.test.d.ts.map +1 -0
- package/dist/userRepository/observers/tests/searchUsers.test.d.ts +2 -0
- package/dist/userRepository/observers/tests/searchUsers.test.d.ts.map +1 -0
- package/dist/utils/linkedObject/fileLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/fileLinkedObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/index.d.ts +1 -0
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/postLinkedObject.d.ts.map +1 -1
- package/dist/utils/tests/dummy/file.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -306,6 +306,13 @@ var NotificationRolesFilterTypeEnum;
|
|
|
306
306
|
NotificationRolesFilterTypeEnum["ONLY"] = "only";
|
|
307
307
|
})(NotificationRolesFilterTypeEnum || (NotificationRolesFilterTypeEnum = {}));
|
|
308
308
|
|
|
309
|
+
var AmityLiveViewerCountMode;
|
|
310
|
+
(function (AmityLiveViewerCountMode) {
|
|
311
|
+
AmityLiveViewerCountMode["ALWAYS_SHOW"] = "always";
|
|
312
|
+
AmityLiveViewerCountMode["HIDE_ENTIRELY"] = "hidden";
|
|
313
|
+
AmityLiveViewerCountMode["SHOW_ABOVE_MINIMUM"] = "above-minimum";
|
|
314
|
+
})(AmityLiveViewerCountMode || (AmityLiveViewerCountMode = {}));
|
|
315
|
+
|
|
309
316
|
function getVersion() {
|
|
310
317
|
try {
|
|
311
318
|
// the string ''v7.26.0-esm'' should be replaced by actual value by @rollup/plugin-replace
|
|
@@ -2433,10 +2440,11 @@ var MqttError;
|
|
|
2433
2440
|
MqttError[MqttError["BAD_USERNAME_OR_PASSWORD"] = 134] = "BAD_USERNAME_OR_PASSWORD";
|
|
2434
2441
|
MqttError[MqttError["NOT_AUTHORIZED"] = 135] = "NOT_AUTHORIZED";
|
|
2435
2442
|
})(MqttError || (MqttError = {}));
|
|
2436
|
-
// MQTT 5 session expiry, in seconds.
|
|
2437
|
-
//
|
|
2438
|
-
//
|
|
2439
|
-
|
|
2443
|
+
// MQTT 5 session expiry, in seconds. Under MQTT 3.1.1 the broker capped
|
|
2444
|
+
// retained sessions at ~30 min; under MQTT 5 the client's value wins, so an
|
|
2445
|
+
// unbounded value ("never") left disconnected sessions piling up on the broker.
|
|
2446
|
+
// 1800s matches the previous 3.1.1 cap.
|
|
2447
|
+
const SESSION_EXPIRY_INTERVAL = 1800;
|
|
2440
2448
|
function getMqttOptions(params) {
|
|
2441
2449
|
return Object.assign({ clean: false, clientId: `mqttjs_ + ${Math.random().toString(16).substring(2, 10)}`, protocolId: 'MQTT', protocolVersion: 5, reconnectPeriod: RETRY_BASE_TIMEOUT, resubscribe: true,
|
|
2442
2450
|
// The broker/LB drops idle sockets at ~60s. mqtt.js v5 sends its first
|
|
@@ -2538,8 +2546,16 @@ const createMqttTransport = (endpoint) => {
|
|
|
2538
2546
|
}
|
|
2539
2547
|
return {
|
|
2540
2548
|
connect,
|
|
2541
|
-
async disconnect() {
|
|
2549
|
+
async disconnect(options) {
|
|
2542
2550
|
if (this.connected) {
|
|
2551
|
+
// On logout we want the broker to release the session immediately
|
|
2552
|
+
// instead of keeping it around for SESSION_EXPIRY_INTERVAL. mqtt.js
|
|
2553
|
+
// only sends a DISCONNECT packet when `force` is false; force=true
|
|
2554
|
+
// just tears the socket down and the broker keeps the session until
|
|
2555
|
+
// it expires on its own.
|
|
2556
|
+
if (options === null || options === void 0 ? void 0 : options.endSession) {
|
|
2557
|
+
return new Promise(resolve => mqttClient === null || mqttClient === void 0 ? void 0 : mqttClient.end(false, { reasonCode: 0, properties: { sessionExpiryInterval: 0 } }, () => resolve()));
|
|
2558
|
+
}
|
|
2543
2559
|
return new Promise(resolve => mqttClient === null || mqttClient === void 0 ? void 0 : mqttClient.end(true, undefined, () => resolve()));
|
|
2544
2560
|
}
|
|
2545
2561
|
},
|
|
@@ -5021,6 +5037,51 @@ const getCoreUserSettings = async () => {
|
|
|
5021
5037
|
return data;
|
|
5022
5038
|
};
|
|
5023
5039
|
|
|
5040
|
+
const DEFAULT_CONFIG = {
|
|
5041
|
+
mode: AmityLiveViewerCountMode.ALWAYS_SHOW,
|
|
5042
|
+
threshold: 50,
|
|
5043
|
+
};
|
|
5044
|
+
const isValidMode = (value) => value === AmityLiveViewerCountMode.ALWAYS_SHOW ||
|
|
5045
|
+
value === AmityLiveViewerCountMode.HIDE_ENTIRELY ||
|
|
5046
|
+
value === AmityLiveViewerCountMode.SHOW_ABOVE_MINIMUM;
|
|
5047
|
+
const isValidThreshold = (value) => typeof value === 'number' && Number.isInteger(value) && value >= 1 && value <= 1000;
|
|
5048
|
+
/**
|
|
5049
|
+
* ```js
|
|
5050
|
+
* import { getLiveViewerCountConfig } from '@amityco/ts-sdk'
|
|
5051
|
+
* const config = await getLiveViewerCountConfig()
|
|
5052
|
+
* ```
|
|
5053
|
+
*
|
|
5054
|
+
* Fetches the network-level {@link Amity.LiveViewerCountConfig} governing
|
|
5055
|
+
* how the live viewer count is displayed to viewers on a livestream.
|
|
5056
|
+
*
|
|
5057
|
+
* Cold-read — no observable, no cache. Call once per livestream mount /
|
|
5058
|
+
* rejoin. Admin-driven config changes take effect on the next join, not
|
|
5059
|
+
* mid-stream.
|
|
5060
|
+
*
|
|
5061
|
+
* On a malformed payload (unknown mode, out-of-range or missing threshold)
|
|
5062
|
+
* the SDK falls open to `{ mode: ALWAYS_SHOW, threshold: 50 }` and logs a
|
|
5063
|
+
* warning. Network errors reject.
|
|
5064
|
+
*
|
|
5065
|
+
* @returns A Promise of {@link Amity.LiveViewerCountConfig}
|
|
5066
|
+
*
|
|
5067
|
+
* @category Client API
|
|
5068
|
+
* @async
|
|
5069
|
+
*/
|
|
5070
|
+
/* begin_public_function id: client.getLiveViewerCountConfig */
|
|
5071
|
+
const getLiveViewerCountConfig = async () => {
|
|
5072
|
+
var _a, _b;
|
|
5073
|
+
const client = getActiveClient();
|
|
5074
|
+
const { data } = await client.http.get('/api/v3/network-settings/video-streaming');
|
|
5075
|
+
const mode = (_a = data === null || data === void 0 ? void 0 : data.videoStreaming) === null || _a === void 0 ? void 0 : _a.viewerCountDisplayMode;
|
|
5076
|
+
const threshold = (_b = data === null || data === void 0 ? void 0 : data.videoStreaming) === null || _b === void 0 ? void 0 : _b.viewerCountDisplayMinimum;
|
|
5077
|
+
if (!isValidMode(mode) || !isValidThreshold(threshold)) {
|
|
5078
|
+
client.log('client/getLiveViewerCountConfig', 'malformed videoStreaming settings, falling back to default', { mode, threshold });
|
|
5079
|
+
return DEFAULT_CONFIG;
|
|
5080
|
+
}
|
|
5081
|
+
return { mode, threshold };
|
|
5082
|
+
};
|
|
5083
|
+
/* end_public_function */
|
|
5084
|
+
|
|
5024
5085
|
/* begin_public_function
|
|
5025
5086
|
id: client.getProductCatalogueSetting
|
|
5026
5087
|
*/
|
|
@@ -5387,7 +5448,7 @@ const logout = async () => {
|
|
|
5387
5448
|
const client = getActiveClient();
|
|
5388
5449
|
client.log('client/api/disconnectClient');
|
|
5389
5450
|
if (client.mqtt && client.mqtt.connected) {
|
|
5390
|
-
client.mqtt.disconnect();
|
|
5451
|
+
await client.mqtt.disconnect({ endSession: true });
|
|
5391
5452
|
}
|
|
5392
5453
|
/*
|
|
5393
5454
|
* for cases when session state is terminated (example on ban) or token expired,
|
|
@@ -8470,6 +8531,7 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
|
|
|
8470
8531
|
getCoreUserSettings,
|
|
8471
8532
|
getSocialSettings,
|
|
8472
8533
|
getChatSettings,
|
|
8534
|
+
getLiveViewerCountConfig,
|
|
8473
8535
|
getVisitorDeviceId: getDeviceId,
|
|
8474
8536
|
getMessagePreviewSetting: getMessagePreviewSetting$1,
|
|
8475
8537
|
use: () => setActiveClient(client),
|
|
@@ -9561,6 +9623,7 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
9561
9623
|
setCurrentUserType: setCurrentUserType,
|
|
9562
9624
|
setAccessTokenHandler: setAccessTokenHandler,
|
|
9563
9625
|
getChatSettings: getChatSettings,
|
|
9626
|
+
getLiveViewerCountConfig: getLiveViewerCountConfig,
|
|
9564
9627
|
getCoreUserSettings: getCoreUserSettings,
|
|
9565
9628
|
notifications: notifications,
|
|
9566
9629
|
enableAutoSubscriptions: enableAutoSubscriptions,
|
|
@@ -12477,7 +12540,7 @@ const getWatchSessionStorage = () => {
|
|
|
12477
12540
|
return storageInstance;
|
|
12478
12541
|
};
|
|
12479
12542
|
|
|
12480
|
-
const privateKey = "
|
|
12543
|
+
const privateKey = "MIIEpQIBAAKCAQEAwAEc/oZgYIvKSUG/C3mONYLR4ZPgAjMEX4bJ+xqqakUDRtqlNO+eZs2blQ1Ko0DBkqPExyQezvjibH5W2UZBV5RaBTlTcNVKTToMBEGesAfaEcM3qUyQHxdbFYZv6P4sb14dcwxTQ8usmaV8ooiR1Fcaso5ZWYcZ8Hb46FbQ7OoVumsBtPWwfZ4f003o5VCl6AIM6lcLv9UDLlFVYhE+PeXpRHtfWlGqxMvqC9oinlwhL6nWv6VjQXW4nhcib72dPBzfHT7k/PMKto2SxALYdb68ENiAGuJLWi3AUHSyYCJK2w7wIlWfJUAI0v26ub10IpExr6D5QuW2577jjP93iwIDAQABAoIBAFWfqXhwIIatkFY+9Z1+ZcbDQimgsmMIsUiQaX6Lk7e0cxOj6czDlxYtVtaPiNtow2pLkjNkjkCqiP7tEHnwdK9DvylZOTa2R15NJpK3WLcTqVIGhsn/FL5owfvFah6zSsmXZParZm5zY9NZE03ALZhOB9/cz0e3kf/EbpfeL2mW7MApyiUt5i09ycchroOpcWp73ipIxvgigtZyUGFmsQicWhUs28F0D7w4Qfk76yG3nqXeb+BAMhCaIaa/k/aAxhiZG/ygEQWQrcC8gfe+jyicMAQPDEVS9YuUMGsLjIjKuVLZzp2xirQnhc2i2zVNEIvG6soprPOBEMQugzrtX5ECgYEA3b7KAbBIbDl1e4ZSCWhHdHkiWVZHaopsR/LhqDDNhXjWjq3AesgV6k0j9EdziMn/HmmOso0bz99GTV3JZf4A9ztTLumJlkHbdVtlgOqSjrFLj12rH9KXTheyIhWSpUmm8+WB1xasFbqpvJaGo7F3pd2Fqj1XR4mp5BO7c/t7LJ0CgYEA3aouEzXQ9THRKYocdfY69EI1Il1t/d/RSqqd9BxEjxBgxkM13ZiYIn/R4WW/nCUrlmhxG44Aa2Gob4Ahfsui2xKTg/g/3Zk/rAxAEGkfOLGoenaJMD41fH4wUq3FRYwkvnaMb9Hd6f/TlBHslIRa2NN58bSBGJCyBP2b59+2+EcCgYEAixDVRXvV37GlYUOa/XVdosk5Zoe6oDGRuQm0xbNdoUBoZvDHDvme7ONWEiQha/8qtVsD+CyQ7awcPfb8kK9c0bBt+bTS6d4BkTcxkEkMgtrkBVR8Nqfu5jXsLH4VCv4G61zbMhZw8+ut+az5YX2yCN7Frj9sFlxapMRPQmzMEe0CgYEAumsAzM8ZqNv4mAK65Mnr0rhLj1cbxcKRdUYACOgtEFQpzxN/HZnTeFAe5nx3pI3uFlRHq3DFEYnT6dHMWaJQmAULYpVIwMi9L6gtyJ9fzoI6uqMtxRDMUqKdaSsTGOY/kJ6KhQ/unXi1K3XXjR+yd1+C0q+HUm1+CYxvrZYLfskCgYEArsEy+IQOiqniJ0NE2vVUF+UK/IRZaic9YKcpov5Ot7Vvzm/MnnW4N1ljVskocETBWMmPUvNSExVjPebi+rxd8fa5kY8BJScPTzMFbunZn/wjtGdcM10qdlVQ9doG61A/9P3ezFKCfS4AvF/H/59LcSx2Bh28fp3/efiVIOpVd4Y=";
|
|
12481
12544
|
/*
|
|
12482
12545
|
* The crypto algorithm used for importing key and signing string
|
|
12483
12546
|
*/
|
|
@@ -12905,6 +12968,21 @@ const productTagLinkedObject = (productTag) => {
|
|
|
12905
12968
|
return Object.assign(Object.assign({}, productTag), { product: internalProduct ? productLinkedObject(internalProduct) : undefined });
|
|
12906
12969
|
};
|
|
12907
12970
|
|
|
12971
|
+
const fileLinkedObject = (file) => {
|
|
12972
|
+
var _a, _b, _c;
|
|
12973
|
+
if (!file)
|
|
12974
|
+
return file;
|
|
12975
|
+
if (file.type === 'video') {
|
|
12976
|
+
const video = (_b = (_a = file.attributes) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.video;
|
|
12977
|
+
return Object.assign(Object.assign({}, file), { getWidth: () => { var _a; return (_a = video === null || video === void 0 ? void 0 : video.width) !== null && _a !== void 0 ? _a : 0; }, getHeight: () => { var _a; return (_a = video === null || video === void 0 ? void 0 : video.height) !== null && _a !== void 0 ? _a : 0; }, getRotation: () => { var _a; return (_a = video === null || video === void 0 ? void 0 : video.rotation) !== null && _a !== void 0 ? _a : 0; } });
|
|
12978
|
+
}
|
|
12979
|
+
if (file.type === 'image') {
|
|
12980
|
+
const metadata = (_c = file.attributes) === null || _c === void 0 ? void 0 : _c.metadata;
|
|
12981
|
+
return Object.assign(Object.assign({}, file), { getWidth: () => { var _a; return (_a = metadata === null || metadata === void 0 ? void 0 : metadata.width) !== null && _a !== void 0 ? _a : 0; }, getHeight: () => { var _a; return (_a = metadata === null || metadata === void 0 ? void 0 : metadata.height) !== null && _a !== void 0 ? _a : 0; } });
|
|
12982
|
+
}
|
|
12983
|
+
return file;
|
|
12984
|
+
};
|
|
12985
|
+
|
|
12908
12986
|
const postLinkedObject = (post) => {
|
|
12909
12987
|
return shallowClone(post, {
|
|
12910
12988
|
childrenPosts: post.children
|
|
@@ -12962,19 +13040,19 @@ const postLinkedObject = (post) => {
|
|
|
12962
13040
|
getImageInfo() {
|
|
12963
13041
|
var _a, _b;
|
|
12964
13042
|
return isAmityImagePost(post)
|
|
12965
|
-
? (_b = pullFromCache(['file', 'get', (_a = post === null || post === void 0 ? void 0 : post.data) === null || _a === void 0 ? void 0 : _a.fileId])) === null || _b === void 0 ? void 0 : _b.data
|
|
13043
|
+
? fileLinkedObject((_b = pullFromCache(['file', 'get', (_a = post === null || post === void 0 ? void 0 : post.data) === null || _a === void 0 ? void 0 : _a.fileId])) === null || _b === void 0 ? void 0 : _b.data)
|
|
12966
13044
|
: undefined;
|
|
12967
13045
|
},
|
|
12968
13046
|
getVideoInfo() {
|
|
12969
13047
|
var _a, _b, _c;
|
|
12970
13048
|
return isAmityVideoPost(post)
|
|
12971
|
-
? (_c = pullFromCache(['file', 'get', (_b = (_a = post === null || post === void 0 ? void 0 : post.data) === null || _a === void 0 ? void 0 : _a.videoFileId) === null || _b === void 0 ? void 0 : _b.original])) === null || _c === void 0 ? void 0 : _c.data
|
|
13049
|
+
? fileLinkedObject((_c = pullFromCache(['file', 'get', (_b = (_a = post === null || post === void 0 ? void 0 : post.data) === null || _a === void 0 ? void 0 : _a.videoFileId) === null || _b === void 0 ? void 0 : _b.original])) === null || _c === void 0 ? void 0 : _c.data)
|
|
12972
13050
|
: undefined;
|
|
12973
13051
|
},
|
|
12974
13052
|
getVideoThumbnailInfo() {
|
|
12975
13053
|
var _a, _b;
|
|
12976
13054
|
return isAmityVideoPost(post)
|
|
12977
|
-
? (_b = pullFromCache(['file', 'get', (_a = post === null || post === void 0 ? void 0 : post.data) === null || _a === void 0 ? void 0 : _a.thumbnailFileId])) === null || _b === void 0 ? void 0 : _b.data
|
|
13055
|
+
? fileLinkedObject((_b = pullFromCache(['file', 'get', (_a = post === null || post === void 0 ? void 0 : post.data) === null || _a === void 0 ? void 0 : _a.thumbnailFileId])) === null || _b === void 0 ? void 0 : _b.data)
|
|
12978
13056
|
: undefined;
|
|
12979
13057
|
},
|
|
12980
13058
|
getFileInfo() {
|
|
@@ -13965,6 +14043,7 @@ const eventLinkedObject = (event) => {
|
|
|
13965
14043
|
};
|
|
13966
14044
|
|
|
13967
14045
|
const LinkedObject = {
|
|
14046
|
+
file: fileLinkedObject,
|
|
13968
14047
|
ad: adLinkedObject,
|
|
13969
14048
|
comment: commentLinkedObject,
|
|
13970
14049
|
post: postLinkedObject,
|
|
@@ -15128,10 +15207,58 @@ class SearchUserLiveCollectionController extends LiveCollectionController {
|
|
|
15128
15207
|
}
|
|
15129
15208
|
}
|
|
15130
15209
|
|
|
15210
|
+
/* begin_public_function
|
|
15211
|
+
id: user.searchUsers
|
|
15212
|
+
*/
|
|
15213
|
+
/**
|
|
15214
|
+
* ```js
|
|
15215
|
+
* import { UserRepository } from '@amityco/ts-sdk'
|
|
15216
|
+
*
|
|
15217
|
+
* let users = []
|
|
15218
|
+
* const unsub = UserRepository.searchUsers(
|
|
15219
|
+
* { displayName: 'jack', searchBy: [SearchUsersByEnum.DISPLAY_NAME] },
|
|
15220
|
+
* response => merge(users, response.data),
|
|
15221
|
+
* )
|
|
15222
|
+
* ```
|
|
15223
|
+
*
|
|
15224
|
+
* Observe all mutations on a list of {@link Amity.InternalUser}s.
|
|
15225
|
+
*
|
|
15226
|
+
* Pass `searchBy` in `params` to restrict which user fields are matched
|
|
15227
|
+
* (e.g. `[SearchUsersByEnum.DISPLAY_NAME]`). When omitted, the backend
|
|
15228
|
+
* default (both `displayName` and `userId`) applies.
|
|
15229
|
+
*
|
|
15230
|
+
* @param params for searching users
|
|
15231
|
+
* @param callback the function to call when new data are available
|
|
15232
|
+
* @param config the configuration for the live collection
|
|
15233
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the users
|
|
15234
|
+
*
|
|
15235
|
+
* @category Category Live Collection
|
|
15236
|
+
*/
|
|
15237
|
+
const searchUsers = (params, callback, config) => {
|
|
15238
|
+
const { log, cache } = getActiveClient();
|
|
15239
|
+
if (!cache) {
|
|
15240
|
+
// eslint-disable-next-line no-console
|
|
15241
|
+
console.log(ENABLE_CACHE_MESSAGE);
|
|
15242
|
+
}
|
|
15243
|
+
const timestamp = Date.now();
|
|
15244
|
+
log(`liveSearchUsers(tmpid: ${timestamp}) > listen`);
|
|
15245
|
+
const searchUsersLiveCollection = new SearchUserLiveCollectionController(params, callback);
|
|
15246
|
+
const disposers = searchUsersLiveCollection.startSubscription();
|
|
15247
|
+
const cacheKey = searchUsersLiveCollection.getCacheKey();
|
|
15248
|
+
disposers.push(() => dropFromCache(cacheKey));
|
|
15249
|
+
return () => {
|
|
15250
|
+
log(`liveSearchUsers(tmpid: ${timestamp}) > dispose`);
|
|
15251
|
+
disposers.forEach(fn => fn());
|
|
15252
|
+
};
|
|
15253
|
+
};
|
|
15254
|
+
/* end_public_function */
|
|
15255
|
+
|
|
15131
15256
|
/* begin_public_function
|
|
15132
15257
|
id: user.search
|
|
15133
15258
|
*/
|
|
15134
15259
|
/**
|
|
15260
|
+
* @deprecated Use {@link searchUsers} instead. `searchUserByDisplayName` will be removed in a future major version.
|
|
15261
|
+
*
|
|
15135
15262
|
* ```js
|
|
15136
15263
|
* import { UserRepository } from '@amityco/ts-sdk'
|
|
15137
15264
|
*
|
|
@@ -15280,6 +15407,7 @@ var index$q = /*#__PURE__*/Object.freeze({
|
|
|
15280
15407
|
getUsers: getUsers,
|
|
15281
15408
|
getBlockedUsers: getBlockedUsers,
|
|
15282
15409
|
getBlockingUsers: getBlockingUsers,
|
|
15410
|
+
searchUsers: searchUsers,
|
|
15283
15411
|
searchUserByDisplayName: searchUserByDisplayName,
|
|
15284
15412
|
getReachedUsers: getReachedUsers,
|
|
15285
15413
|
get AmityUserSearchMatchType () { return AmityUserSearchMatchType; }
|
|
@@ -15312,7 +15440,7 @@ const getFile = async (fileId) => {
|
|
|
15312
15440
|
if (client.cache)
|
|
15313
15441
|
ingestInCache({ files: [data] }, { cachedAt });
|
|
15314
15442
|
return {
|
|
15315
|
-
data,
|
|
15443
|
+
data: fileLinkedObject(data),
|
|
15316
15444
|
cachedAt,
|
|
15317
15445
|
};
|
|
15318
15446
|
};
|
|
@@ -15339,7 +15467,7 @@ getFile.locally = (fileId) => {
|
|
|
15339
15467
|
if (!cached)
|
|
15340
15468
|
return;
|
|
15341
15469
|
return {
|
|
15342
|
-
data: cached.data,
|
|
15470
|
+
data: fileLinkedObject(cached.data),
|
|
15343
15471
|
cachedAt: cached.cachedAt,
|
|
15344
15472
|
};
|
|
15345
15473
|
};
|
|
@@ -15476,7 +15604,7 @@ const uploadVideo = async (formData, feedType, onProgress) => {
|
|
|
15476
15604
|
if (client.cache)
|
|
15477
15605
|
ingestInCache({ files: data }, { cachedAt });
|
|
15478
15606
|
return {
|
|
15479
|
-
data,
|
|
15607
|
+
data: data.map(file => fileLinkedObject(file)),
|
|
15480
15608
|
cachedAt,
|
|
15481
15609
|
};
|
|
15482
15610
|
};
|
|
@@ -15537,7 +15665,7 @@ const uploadImage = async (formData, onProgress, altText) => {
|
|
|
15537
15665
|
if (client.cache)
|
|
15538
15666
|
ingestInCache({ files: data }, { cachedAt });
|
|
15539
15667
|
return {
|
|
15540
|
-
data,
|
|
15668
|
+
data: data.map(file => fileLinkedObject(file)),
|
|
15541
15669
|
cachedAt,
|
|
15542
15670
|
};
|
|
15543
15671
|
};
|
|
@@ -35494,4 +35622,4 @@ class AmityAttachmentProductTags {
|
|
|
35494
35622
|
}
|
|
35495
35623
|
}
|
|
35496
35624
|
|
|
35497
|
-
export { API_REGIONS, index$5 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmitySharableContentType, AnalyticsSourceTypeEnum, index$f as CategoryRepository, index$j as ChannelRepository, index$s as Client, index$e as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$g as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$1 as EventRepository, FeedDataTypeEnum, index$d as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$p as FileRepository, FileType, GET_WATCHER_URLS, index$3 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$2 as LiveReactionRepository, index$7 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$n as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$8 as PollRepository, PostContentType, index$b as PostRepository, PostStructureType, index as ProductRepository, index$o as ReactionRepository, index$9 as RoomPresenceRepository, index$c as RoomRepository, SearchUsersByEnum, index$6 as StoryRepository, index$a as StreamRepository, index$m as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, UserReportTypeEnum, index$q as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$4 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|
|
35625
|
+
export { API_REGIONS, index$5 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmityLiveViewerCountMode, AmitySharableContentType, AnalyticsSourceTypeEnum, index$f as CategoryRepository, index$j as ChannelRepository, index$s as Client, index$e as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$g as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$1 as EventRepository, FeedDataTypeEnum, index$d as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$p as FileRepository, FileType, GET_WATCHER_URLS, index$3 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$2 as LiveReactionRepository, index$7 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$n as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$8 as PollRepository, PostContentType, index$b as PostRepository, PostStructureType, index as ProductRepository, index$o as ReactionRepository, index$9 as RoomPresenceRepository, index$c as RoomRepository, SearchUsersByEnum, index$6 as StoryRepository, index$a as StreamRepository, index$m as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, UserReportTypeEnum, index$q as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$4 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|