epicenter-libs 3.33.0 → 3.34.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/CHANGELOG.md +9 -0
- package/dist/browser/epicenter.js +101 -2
- package/dist/browser/epicenter.js.map +1 -1
- package/dist/cjs/epicenter.js +101 -2
- package/dist/cjs/epicenter.js.map +1 -1
- package/dist/epicenter.js +101 -2
- package/dist/epicenter.js.map +1 -1
- package/dist/epicenter.min.js +1 -1
- package/dist/epicenter.min.js.map +1 -1
- package/dist/module/epicenter.js +101 -2
- package/dist/module/epicenter.js.map +1 -1
- package/dist/types/adapters/chat.d.ts +63 -0
- package/package.json +1 -1
- package/src/adapters/chat.ts +95 -0
- package/dist/test/_virtual/runtime.js +0 -3
- package/dist/test/_virtual/runtime2.js +0 -3
- package/dist/test/adapters/account.js +0 -169
- package/dist/test/adapters/admin.js +0 -53
- package/dist/test/adapters/asset.js +0 -425
- package/dist/test/adapters/authentication.js +0 -349
- package/dist/test/adapters/channel.js +0 -201
- package/dist/test/adapters/chat.js +0 -199
- package/dist/test/adapters/cometd.js +0 -514
- package/dist/test/adapters/consensus.js +0 -484
- package/dist/test/adapters/daily.js +0 -244
- package/dist/test/adapters/email.js +0 -179
- package/dist/test/adapters/episode.js +0 -175
- package/dist/test/adapters/group.js +0 -655
- package/dist/test/adapters/leaderboard.js +0 -162
- package/dist/test/adapters/matchmaker.js +0 -159
- package/dist/test/adapters/presence.js +0 -85
- package/dist/test/adapters/project.js +0 -94
- package/dist/test/adapters/recaptcha.js +0 -24
- package/dist/test/adapters/run.js +0 -1008
- package/dist/test/adapters/somebody.js +0 -154
- package/dist/test/adapters/task.js +0 -192
- package/dist/test/adapters/time.js +0 -28
- package/dist/test/adapters/user.js +0 -105
- package/dist/test/adapters/vault.js +0 -403
- package/dist/test/adapters/video.js +0 -249
- package/dist/test/adapters/vonage.js +0 -130
- package/dist/test/adapters/wallet.js +0 -130
- package/dist/test/adapters/world.js +0 -507
- package/dist/test/apis/video.js +0 -294
- package/dist/test/apis/vonage.js +0 -121
- package/dist/test/epicenter.js +0 -121
- package/dist/test/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -12
- package/dist/test/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -14
- package/dist/test/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -9
- package/dist/test/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -11
- package/dist/test/node_modules/cometd/AckExtension.js +0 -91
- package/dist/test/node_modules/cometd/CallbackPollingTransport.js +0 -148
- package/dist/test/node_modules/cometd/Client.js +0 -2160
- package/dist/test/node_modules/cometd/Extension.js +0 -47
- package/dist/test/node_modules/cometd/LongPollingTransport.js +0 -135
- package/dist/test/node_modules/cometd/ReloadExtension.js +0 -214
- package/dist/test/node_modules/cometd/RequestTransport.js +0 -252
- package/dist/test/node_modules/cometd/Transport.js +0 -167
- package/dist/test/node_modules/cometd/TransportRegistry.js +0 -107
- package/dist/test/node_modules/cometd/WebSocketTransport.js +0 -384
- package/dist/test/node_modules/cometd/cometd.js +0 -9
- package/dist/test/node_modules/regenerator-runtime/runtime.js +0 -773
- package/dist/test/utilities.js +0 -17
- package/dist/test/utils/config.js +0 -189
- package/dist/test/utils/constants.js +0 -293
- package/dist/test/utils/cookies.js +0 -75
- package/dist/test/utils/error-manager.js +0 -57
- package/dist/test/utils/error.js +0 -12
- package/dist/test/utils/fault.js +0 -34
- package/dist/test/utils/filter-parser.js +0 -68
- package/dist/test/utils/helpers.js +0 -9
- package/dist/test/utils/identification.js +0 -161
- package/dist/test/utils/result.js +0 -20
- package/dist/test/utils/router.js +0 -551
- package/dist/test/utils/store.js +0 -79
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# [3.34.0](https://github.com/forio/epicenter-libs/compare/v3.33.0...v3.34.0) (2026-02-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* added chat endpoints for admin ([bd252cb](https://github.com/forio/epicenter-libs/commit/bd252cb03d5cc841ea43914651d951bba4c1ab65))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
# [3.33.0](https://github.com/forio/epicenter-libs/compare/v3.32.0...v3.33.0) (2025-11-20)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -9243,13 +9243,112 @@ async function getMessages(chatKey, optionals = {}) {
|
|
|
9243
9243
|
}) => body);
|
|
9244
9244
|
}
|
|
9245
9245
|
|
|
9246
|
+
/**
|
|
9247
|
+
* Retrieves messages for a given user; requires facilitator authentication; works with an admin user
|
|
9248
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{PSEUDONYM_KEY}`
|
|
9249
|
+
*
|
|
9250
|
+
* @example
|
|
9251
|
+
* import { chatAdapter } from 'epicenter-libs';
|
|
9252
|
+
* // gets the chat message with id: 5
|
|
9253
|
+
* const message = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 1 });
|
|
9254
|
+
* // gets the 10 chat messages starting from id 5 (inclusive)
|
|
9255
|
+
* const messages = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 10 });
|
|
9256
|
+
*
|
|
9257
|
+
* @param chatKey Key associated with the chat
|
|
9258
|
+
* @param pseudonymKey Key associated with the user whose messages are being retrieved
|
|
9259
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
9260
|
+
* @param [optionals.maxRecords] Maximum number of messages to get
|
|
9261
|
+
* @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat
|
|
9262
|
+
* @returns promise that resolves to the list of chat messages requested
|
|
9263
|
+
*/
|
|
9264
|
+
async function getMessagesForUser(chatKey, pseudonymKey, optionals = {}) {
|
|
9265
|
+
const {
|
|
9266
|
+
maxRecords,
|
|
9267
|
+
horizon,
|
|
9268
|
+
...routingOptions
|
|
9269
|
+
} = optionals;
|
|
9270
|
+
return new Router().withSearchParams({
|
|
9271
|
+
maxRecords,
|
|
9272
|
+
horizon
|
|
9273
|
+
}).get(`/chat/message/${chatKey}/${pseudonymKey}`, routingOptions).then(({
|
|
9274
|
+
body
|
|
9275
|
+
}) => body);
|
|
9276
|
+
}
|
|
9277
|
+
|
|
9278
|
+
/**
|
|
9279
|
+
* Retrieves messages from for a given chat for an admin user; requires support authentication
|
|
9280
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/all/{CHAT_KEY}`
|
|
9281
|
+
*
|
|
9282
|
+
* @example
|
|
9283
|
+
* import { chatAdapter } from 'epicenter-libs';
|
|
9284
|
+
* // gets the chat message with id: 5
|
|
9285
|
+
* const message = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });
|
|
9286
|
+
* // gets the 10 chat messages starting from id 5 (inclusive)
|
|
9287
|
+
* const messages = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });
|
|
9288
|
+
*
|
|
9289
|
+
* @param chatKey Key associated with the chat
|
|
9290
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
9291
|
+
* @param [optionals.maxRecords] Maximum number of messages to get
|
|
9292
|
+
* @param [optionals.horizon] The message ID from which to start with; works backwards so if `maxRecords=20` and `horizon=50`, it will get the 20 messages starting from message ID 50, working backwards (50, 49, 48..., etc.). If this value is omitted the platform assumes it is the most recent message in the chat
|
|
9293
|
+
* @returns promise that resolves to the list of chat messages requested
|
|
9294
|
+
*/
|
|
9295
|
+
async function getMessagesAdmin(chatKey, optionals = {}) {
|
|
9296
|
+
const {
|
|
9297
|
+
maxRecords,
|
|
9298
|
+
horizon,
|
|
9299
|
+
...routingOptions
|
|
9300
|
+
} = optionals;
|
|
9301
|
+
return new Router().withSearchParams({
|
|
9302
|
+
maxRecords,
|
|
9303
|
+
horizon
|
|
9304
|
+
}).get(`/chat/message/all/${chatKey}`, routingOptions).then(({
|
|
9305
|
+
body
|
|
9306
|
+
}) => body);
|
|
9307
|
+
}
|
|
9308
|
+
|
|
9309
|
+
/**
|
|
9310
|
+
* Sends a message to a chat as an admin user; requires support authentication
|
|
9311
|
+
* Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/system/{CHAT_KEY}` or PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/system/{CHAT_KEY}/{USER_KEY}`
|
|
9312
|
+
*
|
|
9313
|
+
* @example
|
|
9314
|
+
* import { chatAdapter } from 'epicenter-libs';
|
|
9315
|
+
* // Send a public message to the chat
|
|
9316
|
+
* await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');
|
|
9317
|
+
* // Send a private message to a specific user
|
|
9318
|
+
* await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });
|
|
9319
|
+
*
|
|
9320
|
+
* @param chatKey Key associated with the chat
|
|
9321
|
+
* @param message Message text to send
|
|
9322
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
9323
|
+
* @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message
|
|
9324
|
+
* @returns promise that resolves to the chat message created
|
|
9325
|
+
*/
|
|
9326
|
+
async function sendMessageAdmin(chatKey, message, optionals = {}) {
|
|
9327
|
+
const {
|
|
9328
|
+
userKey,
|
|
9329
|
+
...routingOptions
|
|
9330
|
+
} = optionals;
|
|
9331
|
+
const uriComponent = userKey ? `/${userKey}` : '';
|
|
9332
|
+
return new Router().put(`/chat/message/system/${chatKey}${uriComponent}`, {
|
|
9333
|
+
body: {
|
|
9334
|
+
message
|
|
9335
|
+
},
|
|
9336
|
+
...routingOptions
|
|
9337
|
+
}).then(({
|
|
9338
|
+
body
|
|
9339
|
+
}) => body);
|
|
9340
|
+
}
|
|
9341
|
+
|
|
9246
9342
|
var chat = /*#__PURE__*/Object.freeze({
|
|
9247
9343
|
__proto__: null,
|
|
9248
9344
|
create: create$3,
|
|
9249
9345
|
get: get$3,
|
|
9250
9346
|
getMessages: getMessages,
|
|
9347
|
+
getMessagesAdmin: getMessagesAdmin,
|
|
9348
|
+
getMessagesForUser: getMessagesForUser,
|
|
9251
9349
|
query: query,
|
|
9252
9350
|
sendMessage: sendMessage,
|
|
9351
|
+
sendMessageAdmin: sendMessageAdmin,
|
|
9253
9352
|
updatePermit: updatePermit
|
|
9254
9353
|
});
|
|
9255
9354
|
|
|
@@ -10654,8 +10753,8 @@ var utilities = /*#__PURE__*/Object.freeze({
|
|
|
10654
10753
|
});
|
|
10655
10754
|
|
|
10656
10755
|
/* yes, this string template literal is weird;
|
|
10657
|
-
* it's cause rollup does not recogize 3.
|
|
10658
|
-
const version = `Epicenter (v${'3.
|
|
10756
|
+
* it's cause rollup does not recogize 3.34.0 as an individual token otherwise */
|
|
10757
|
+
const version = `Epicenter (v${'3.34.0'}) for Browsers | Build Date: 2026-02-12T21:41:02.367Z`;
|
|
10659
10758
|
const UNAUTHORIZED = 401;
|
|
10660
10759
|
const FORBIDDEN = 403;
|
|
10661
10760
|
const DEFAULT_ERROR_HANDLERS = {};
|