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.
Files changed (76) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/browser/epicenter.js +105 -2
  3. package/dist/browser/epicenter.js.map +1 -1
  4. package/dist/cjs/epicenter.js +105 -2
  5. package/dist/cjs/epicenter.js.map +1 -1
  6. package/dist/epicenter.js +105 -2
  7. package/dist/epicenter.js.map +1 -1
  8. package/dist/epicenter.min.js +1 -1
  9. package/dist/epicenter.min.js.map +1 -1
  10. package/dist/module/epicenter.js +105 -2
  11. package/dist/module/epicenter.js.map +1 -1
  12. package/dist/types/adapters/chat.d.ts +63 -0
  13. package/package.json +1 -1
  14. package/src/adapters/chat.ts +95 -0
  15. package/src/utils/identification.ts +4 -0
  16. package/dist/test/_virtual/runtime.js +0 -3
  17. package/dist/test/_virtual/runtime2.js +0 -3
  18. package/dist/test/adapters/account.js +0 -169
  19. package/dist/test/adapters/admin.js +0 -53
  20. package/dist/test/adapters/asset.js +0 -425
  21. package/dist/test/adapters/authentication.js +0 -349
  22. package/dist/test/adapters/channel.js +0 -201
  23. package/dist/test/adapters/chat.js +0 -199
  24. package/dist/test/adapters/cometd.js +0 -514
  25. package/dist/test/adapters/consensus.js +0 -484
  26. package/dist/test/adapters/daily.js +0 -244
  27. package/dist/test/adapters/email.js +0 -179
  28. package/dist/test/adapters/episode.js +0 -175
  29. package/dist/test/adapters/group.js +0 -655
  30. package/dist/test/adapters/leaderboard.js +0 -162
  31. package/dist/test/adapters/matchmaker.js +0 -159
  32. package/dist/test/adapters/presence.js +0 -85
  33. package/dist/test/adapters/project.js +0 -94
  34. package/dist/test/adapters/recaptcha.js +0 -24
  35. package/dist/test/adapters/run.js +0 -1008
  36. package/dist/test/adapters/somebody.js +0 -154
  37. package/dist/test/adapters/task.js +0 -192
  38. package/dist/test/adapters/time.js +0 -28
  39. package/dist/test/adapters/user.js +0 -105
  40. package/dist/test/adapters/vault.js +0 -403
  41. package/dist/test/adapters/video.js +0 -249
  42. package/dist/test/adapters/vonage.js +0 -130
  43. package/dist/test/adapters/wallet.js +0 -130
  44. package/dist/test/adapters/world.js +0 -507
  45. package/dist/test/apis/video.js +0 -294
  46. package/dist/test/apis/vonage.js +0 -121
  47. package/dist/test/epicenter.js +0 -121
  48. package/dist/test/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -12
  49. package/dist/test/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -14
  50. package/dist/test/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -9
  51. package/dist/test/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -11
  52. package/dist/test/node_modules/cometd/AckExtension.js +0 -91
  53. package/dist/test/node_modules/cometd/CallbackPollingTransport.js +0 -148
  54. package/dist/test/node_modules/cometd/Client.js +0 -2160
  55. package/dist/test/node_modules/cometd/Extension.js +0 -47
  56. package/dist/test/node_modules/cometd/LongPollingTransport.js +0 -135
  57. package/dist/test/node_modules/cometd/ReloadExtension.js +0 -214
  58. package/dist/test/node_modules/cometd/RequestTransport.js +0 -252
  59. package/dist/test/node_modules/cometd/Transport.js +0 -167
  60. package/dist/test/node_modules/cometd/TransportRegistry.js +0 -107
  61. package/dist/test/node_modules/cometd/WebSocketTransport.js +0 -384
  62. package/dist/test/node_modules/cometd/cometd.js +0 -9
  63. package/dist/test/node_modules/regenerator-runtime/runtime.js +0 -773
  64. package/dist/test/utilities.js +0 -17
  65. package/dist/test/utils/config.js +0 -189
  66. package/dist/test/utils/constants.js +0 -293
  67. package/dist/test/utils/cookies.js +0 -75
  68. package/dist/test/utils/error-manager.js +0 -57
  69. package/dist/test/utils/error.js +0 -12
  70. package/dist/test/utils/fault.js +0 -34
  71. package/dist/test/utils/filter-parser.js +0 -68
  72. package/dist/test/utils/helpers.js +0 -9
  73. package/dist/test/utils/identification.js +0 -161
  74. package/dist/test/utils/result.js +0 -20
  75. package/dist/test/utils/router.js +0 -551
  76. package/dist/test/utils/store.js +0 -79
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## [3.34.1](https://github.com/forio/epicenter-libs/compare/v3.34.0...v3.34.1) (2026-02-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove both host-only and subdomain v3 SSO cookies ([6d217b2](https://github.com/forio/epicenter-libs/commit/6d217b2253f918197afdc90136fa569d3c734be3))
7
+
8
+
9
+ # [3.34.0](https://github.com/forio/epicenter-libs/compare/v3.33.0...v3.34.0) (2026-02-12)
10
+
11
+
12
+ ### Features
13
+
14
+ * added chat endpoints for admin ([bd252cb](https://github.com/forio/epicenter-libs/commit/bd252cb03d5cc841ea43914651d951bba4c1ab65))
15
+
16
+
17
+
1
18
  # [3.33.0](https://github.com/forio/epicenter-libs/compare/v3.32.0...v3.33.0) (2025-11-20)
2
19
 
3
20
 
@@ -2348,6 +2348,10 @@ class Identification {
2348
2348
  cookies.removeItem(EPI_SSO_KEY, {
2349
2349
  path: `/app${account}${project}`
2350
2350
  });
2351
+ cookies.removeItem(EPI_SSO_KEY, {
2352
+ domain: `.${window.location.hostname}`,
2353
+ path: `/app${account}${project}`
2354
+ });
2351
2355
  }
2352
2356
  }
2353
2357
  }
@@ -9243,13 +9247,112 @@ async function getMessages(chatKey, optionals = {}) {
9243
9247
  }) => body);
9244
9248
  }
9245
9249
 
9250
+ /**
9251
+ * Retrieves messages for a given user; requires facilitator authentication; works with an admin user
9252
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{PSEUDONYM_KEY}`
9253
+ *
9254
+ * @example
9255
+ * import { chatAdapter } from 'epicenter-libs';
9256
+ * // gets the chat message with id: 5
9257
+ * const message = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 1 });
9258
+ * // gets the 10 chat messages starting from id 5 (inclusive)
9259
+ * const messages = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 10 });
9260
+ *
9261
+ * @param chatKey Key associated with the chat
9262
+ * @param pseudonymKey Key associated with the user whose messages are being retrieved
9263
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9264
+ * @param [optionals.maxRecords] Maximum number of messages to get
9265
+ * @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
9266
+ * @returns promise that resolves to the list of chat messages requested
9267
+ */
9268
+ async function getMessagesForUser(chatKey, pseudonymKey, optionals = {}) {
9269
+ const {
9270
+ maxRecords,
9271
+ horizon,
9272
+ ...routingOptions
9273
+ } = optionals;
9274
+ return new Router().withSearchParams({
9275
+ maxRecords,
9276
+ horizon
9277
+ }).get(`/chat/message/${chatKey}/${pseudonymKey}`, routingOptions).then(({
9278
+ body
9279
+ }) => body);
9280
+ }
9281
+
9282
+ /**
9283
+ * Retrieves messages from for a given chat for an admin user; requires support authentication
9284
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/all/{CHAT_KEY}`
9285
+ *
9286
+ * @example
9287
+ * import { chatAdapter } from 'epicenter-libs';
9288
+ * // gets the chat message with id: 5
9289
+ * const message = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });
9290
+ * // gets the 10 chat messages starting from id 5 (inclusive)
9291
+ * const messages = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });
9292
+ *
9293
+ * @param chatKey Key associated with the chat
9294
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9295
+ * @param [optionals.maxRecords] Maximum number of messages to get
9296
+ * @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
9297
+ * @returns promise that resolves to the list of chat messages requested
9298
+ */
9299
+ async function getMessagesAdmin(chatKey, optionals = {}) {
9300
+ const {
9301
+ maxRecords,
9302
+ horizon,
9303
+ ...routingOptions
9304
+ } = optionals;
9305
+ return new Router().withSearchParams({
9306
+ maxRecords,
9307
+ horizon
9308
+ }).get(`/chat/message/all/${chatKey}`, routingOptions).then(({
9309
+ body
9310
+ }) => body);
9311
+ }
9312
+
9313
+ /**
9314
+ * Sends a message to a chat as an admin user; requires support authentication
9315
+ * 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}`
9316
+ *
9317
+ * @example
9318
+ * import { chatAdapter } from 'epicenter-libs';
9319
+ * // Send a public message to the chat
9320
+ * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');
9321
+ * // Send a private message to a specific user
9322
+ * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });
9323
+ *
9324
+ * @param chatKey Key associated with the chat
9325
+ * @param message Message text to send
9326
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
9327
+ * @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message
9328
+ * @returns promise that resolves to the chat message created
9329
+ */
9330
+ async function sendMessageAdmin(chatKey, message, optionals = {}) {
9331
+ const {
9332
+ userKey,
9333
+ ...routingOptions
9334
+ } = optionals;
9335
+ const uriComponent = userKey ? `/${userKey}` : '';
9336
+ return new Router().put(`/chat/message/system/${chatKey}${uriComponent}`, {
9337
+ body: {
9338
+ message
9339
+ },
9340
+ ...routingOptions
9341
+ }).then(({
9342
+ body
9343
+ }) => body);
9344
+ }
9345
+
9246
9346
  var chat = /*#__PURE__*/Object.freeze({
9247
9347
  __proto__: null,
9248
9348
  create: create$3,
9249
9349
  get: get$3,
9250
9350
  getMessages: getMessages,
9351
+ getMessagesAdmin: getMessagesAdmin,
9352
+ getMessagesForUser: getMessagesForUser,
9251
9353
  query: query,
9252
9354
  sendMessage: sendMessage,
9355
+ sendMessageAdmin: sendMessageAdmin,
9253
9356
  updatePermit: updatePermit
9254
9357
  });
9255
9358
 
@@ -10654,8 +10757,8 @@ var utilities = /*#__PURE__*/Object.freeze({
10654
10757
  });
10655
10758
 
10656
10759
  /* yes, this string template literal is weird;
10657
- * it's cause rollup does not recogize 3.33.0 as an individual token otherwise */
10658
- const version = `Epicenter (v${'3.33.0'}) for Browsers | Build Date: 2025-11-20T19:19:07.204Z`;
10760
+ * it's cause rollup does not recogize 3.34.1 as an individual token otherwise */
10761
+ const version = `Epicenter (v${'3.34.1'}) for Browsers | Build Date: 2026-02-19T18:00:38.906Z`;
10659
10762
  const UNAUTHORIZED = 401;
10660
10763
  const FORBIDDEN = 403;
10661
10764
  const DEFAULT_ERROR_HANDLERS = {};