epicenter-libs 3.33.0 → 3.34.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/CHANGELOG.md +17 -0
- package/dist/browser/epicenter.js +105 -2
- package/dist/browser/epicenter.js.map +1 -1
- package/dist/cjs/epicenter.js +105 -2
- package/dist/cjs/epicenter.js.map +1 -1
- package/dist/epicenter.js +105 -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 +105 -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/src/utils/identification.ts +4 -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/dist/epicenter.js
CHANGED
|
@@ -2354,6 +2354,10 @@
|
|
|
2354
2354
|
cookies.removeItem(EPI_SSO_KEY, {
|
|
2355
2355
|
path: `/app${account}${project}`
|
|
2356
2356
|
});
|
|
2357
|
+
cookies.removeItem(EPI_SSO_KEY, {
|
|
2358
|
+
domain: `.${window.location.hostname}`,
|
|
2359
|
+
path: `/app${account}${project}`
|
|
2360
|
+
});
|
|
2357
2361
|
}
|
|
2358
2362
|
}
|
|
2359
2363
|
}
|
|
@@ -9249,13 +9253,112 @@
|
|
|
9249
9253
|
}) => body);
|
|
9250
9254
|
}
|
|
9251
9255
|
|
|
9256
|
+
/**
|
|
9257
|
+
* Retrieves messages for a given user; requires facilitator authentication; works with an admin user
|
|
9258
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{PSEUDONYM_KEY}`
|
|
9259
|
+
*
|
|
9260
|
+
* @example
|
|
9261
|
+
* import { chatAdapter } from 'epicenter-libs';
|
|
9262
|
+
* // gets the chat message with id: 5
|
|
9263
|
+
* const message = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 1 });
|
|
9264
|
+
* // gets the 10 chat messages starting from id 5 (inclusive)
|
|
9265
|
+
* const messages = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 10 });
|
|
9266
|
+
*
|
|
9267
|
+
* @param chatKey Key associated with the chat
|
|
9268
|
+
* @param pseudonymKey Key associated with the user whose messages are being retrieved
|
|
9269
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
9270
|
+
* @param [optionals.maxRecords] Maximum number of messages to get
|
|
9271
|
+
* @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
|
|
9272
|
+
* @returns promise that resolves to the list of chat messages requested
|
|
9273
|
+
*/
|
|
9274
|
+
async function getMessagesForUser(chatKey, pseudonymKey, optionals = {}) {
|
|
9275
|
+
const {
|
|
9276
|
+
maxRecords,
|
|
9277
|
+
horizon,
|
|
9278
|
+
...routingOptions
|
|
9279
|
+
} = optionals;
|
|
9280
|
+
return new Router().withSearchParams({
|
|
9281
|
+
maxRecords,
|
|
9282
|
+
horizon
|
|
9283
|
+
}).get(`/chat/message/${chatKey}/${pseudonymKey}`, routingOptions).then(({
|
|
9284
|
+
body
|
|
9285
|
+
}) => body);
|
|
9286
|
+
}
|
|
9287
|
+
|
|
9288
|
+
/**
|
|
9289
|
+
* Retrieves messages from for a given chat for an admin user; requires support authentication
|
|
9290
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/all/{CHAT_KEY}`
|
|
9291
|
+
*
|
|
9292
|
+
* @example
|
|
9293
|
+
* import { chatAdapter } from 'epicenter-libs';
|
|
9294
|
+
* // gets the chat message with id: 5
|
|
9295
|
+
* const message = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });
|
|
9296
|
+
* // gets the 10 chat messages starting from id 5 (inclusive)
|
|
9297
|
+
* const messages = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });
|
|
9298
|
+
*
|
|
9299
|
+
* @param chatKey Key associated with the chat
|
|
9300
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
9301
|
+
* @param [optionals.maxRecords] Maximum number of messages to get
|
|
9302
|
+
* @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
|
|
9303
|
+
* @returns promise that resolves to the list of chat messages requested
|
|
9304
|
+
*/
|
|
9305
|
+
async function getMessagesAdmin(chatKey, optionals = {}) {
|
|
9306
|
+
const {
|
|
9307
|
+
maxRecords,
|
|
9308
|
+
horizon,
|
|
9309
|
+
...routingOptions
|
|
9310
|
+
} = optionals;
|
|
9311
|
+
return new Router().withSearchParams({
|
|
9312
|
+
maxRecords,
|
|
9313
|
+
horizon
|
|
9314
|
+
}).get(`/chat/message/all/${chatKey}`, routingOptions).then(({
|
|
9315
|
+
body
|
|
9316
|
+
}) => body);
|
|
9317
|
+
}
|
|
9318
|
+
|
|
9319
|
+
/**
|
|
9320
|
+
* Sends a message to a chat as an admin user; requires support authentication
|
|
9321
|
+
* 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}`
|
|
9322
|
+
*
|
|
9323
|
+
* @example
|
|
9324
|
+
* import { chatAdapter } from 'epicenter-libs';
|
|
9325
|
+
* // Send a public message to the chat
|
|
9326
|
+
* await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');
|
|
9327
|
+
* // Send a private message to a specific user
|
|
9328
|
+
* await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });
|
|
9329
|
+
*
|
|
9330
|
+
* @param chatKey Key associated with the chat
|
|
9331
|
+
* @param message Message text to send
|
|
9332
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
9333
|
+
* @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message
|
|
9334
|
+
* @returns promise that resolves to the chat message created
|
|
9335
|
+
*/
|
|
9336
|
+
async function sendMessageAdmin(chatKey, message, optionals = {}) {
|
|
9337
|
+
const {
|
|
9338
|
+
userKey,
|
|
9339
|
+
...routingOptions
|
|
9340
|
+
} = optionals;
|
|
9341
|
+
const uriComponent = userKey ? `/${userKey}` : '';
|
|
9342
|
+
return new Router().put(`/chat/message/system/${chatKey}${uriComponent}`, {
|
|
9343
|
+
body: {
|
|
9344
|
+
message
|
|
9345
|
+
},
|
|
9346
|
+
...routingOptions
|
|
9347
|
+
}).then(({
|
|
9348
|
+
body
|
|
9349
|
+
}) => body);
|
|
9350
|
+
}
|
|
9351
|
+
|
|
9252
9352
|
var chat = /*#__PURE__*/Object.freeze({
|
|
9253
9353
|
__proto__: null,
|
|
9254
9354
|
create: create$3,
|
|
9255
9355
|
get: get$3,
|
|
9256
9356
|
getMessages: getMessages,
|
|
9357
|
+
getMessagesAdmin: getMessagesAdmin,
|
|
9358
|
+
getMessagesForUser: getMessagesForUser,
|
|
9257
9359
|
query: query,
|
|
9258
9360
|
sendMessage: sendMessage,
|
|
9361
|
+
sendMessageAdmin: sendMessageAdmin,
|
|
9259
9362
|
updatePermit: updatePermit
|
|
9260
9363
|
});
|
|
9261
9364
|
|
|
@@ -10660,8 +10763,8 @@
|
|
|
10660
10763
|
});
|
|
10661
10764
|
|
|
10662
10765
|
/* yes, this string template literal is weird;
|
|
10663
|
-
* it's cause rollup does not recogize 3.
|
|
10664
|
-
const version = `Epicenter (v${'3.
|
|
10766
|
+
* it's cause rollup does not recogize 3.34.1 as an individual token otherwise */
|
|
10767
|
+
const version = `Epicenter (v${'3.34.1'}) for Browsers | Build Date: 2026-02-19T18:00:38.906Z`;
|
|
10665
10768
|
const UNAUTHORIZED = 401;
|
|
10666
10769
|
const FORBIDDEN = 403;
|
|
10667
10770
|
const DEFAULT_ERROR_HANDLERS = {};
|