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
@@ -83321,6 +83321,10 @@ class Identification {
83321
83321
  cookies.removeItem(EPI_SSO_KEY, {
83322
83322
  path: `/app${account}${project}`
83323
83323
  });
83324
+ cookies.removeItem(EPI_SSO_KEY, {
83325
+ domain: `.${window.location.hostname}`,
83326
+ path: `/app${account}${project}`
83327
+ });
83324
83328
  }
83325
83329
  }
83326
83330
  }
@@ -90216,13 +90220,112 @@ async function getMessages(chatKey, optionals = {}) {
90216
90220
  }) => body);
90217
90221
  }
90218
90222
 
90223
+ /**
90224
+ * Retrieves messages for a given user; requires facilitator authentication; works with an admin user
90225
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/{CHAT_KEY}/{PSEUDONYM_KEY}`
90226
+ *
90227
+ * @example
90228
+ * import { chatAdapter } from 'epicenter-libs';
90229
+ * // gets the chat message with id: 5
90230
+ * const message = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 1 });
90231
+ * // gets the 10 chat messages starting from id 5 (inclusive)
90232
+ * const messages = await chatAdapter.getMessagesForUser('0000017dd3bf540e5ada5b1e058f08f20461', '000001796733eef0842f4d6d960997018a33', { horizon: 5, maxRecords: 10 });
90233
+ *
90234
+ * @param chatKey Key associated with the chat
90235
+ * @param pseudonymKey Key associated with the user whose messages are being retrieved
90236
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
90237
+ * @param [optionals.maxRecords] Maximum number of messages to get
90238
+ * @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
90239
+ * @returns promise that resolves to the list of chat messages requested
90240
+ */
90241
+ async function getMessagesForUser(chatKey, pseudonymKey, optionals = {}) {
90242
+ const {
90243
+ maxRecords,
90244
+ horizon,
90245
+ ...routingOptions
90246
+ } = optionals;
90247
+ return new Router().withSearchParams({
90248
+ maxRecords,
90249
+ horizon
90250
+ }).get(`/chat/message/${chatKey}/${pseudonymKey}`, routingOptions).then(({
90251
+ body
90252
+ }) => body);
90253
+ }
90254
+
90255
+ /**
90256
+ * Retrieves messages from for a given chat for an admin user; requires support authentication
90257
+ * Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/chat/message/all/{CHAT_KEY}`
90258
+ *
90259
+ * @example
90260
+ * import { chatAdapter } from 'epicenter-libs';
90261
+ * // gets the chat message with id: 5
90262
+ * const message = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 1 });
90263
+ * // gets the 10 chat messages starting from id 5 (inclusive)
90264
+ * const messages = await chatAdapter.getMessagesAdmin('0000017dd3bf540e5ada5b1e058f08f20461', { horizon: 5, maxRecords: 10 });
90265
+ *
90266
+ * @param chatKey Key associated with the chat
90267
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
90268
+ * @param [optionals.maxRecords] Maximum number of messages to get
90269
+ * @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
90270
+ * @returns promise that resolves to the list of chat messages requested
90271
+ */
90272
+ async function getMessagesAdmin(chatKey, optionals = {}) {
90273
+ const {
90274
+ maxRecords,
90275
+ horizon,
90276
+ ...routingOptions
90277
+ } = optionals;
90278
+ return new Router().withSearchParams({
90279
+ maxRecords,
90280
+ horizon
90281
+ }).get(`/chat/message/all/${chatKey}`, routingOptions).then(({
90282
+ body
90283
+ }) => body);
90284
+ }
90285
+
90286
+ /**
90287
+ * Sends a message to a chat as an admin user; requires support authentication
90288
+ * 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}`
90289
+ *
90290
+ * @example
90291
+ * import { chatAdapter } from 'epicenter-libs';
90292
+ * // Send a public message to the chat
90293
+ * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello');
90294
+ * // Send a private message to a specific user
90295
+ * await chatAdapter.sendMessageAdmin('0000017dd3bf540e5ada5b1e058f08f20461', 'hello, privately', { userKey: '000001796733eef0842f4d6d960997018a33' });
90296
+ *
90297
+ * @param chatKey Key associated with the chat
90298
+ * @param message Message text to send
90299
+ * @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
90300
+ * @param [optionals.userKey] Key of the user to send the message to. If omitted, will send as a public message
90301
+ * @returns promise that resolves to the chat message created
90302
+ */
90303
+ async function sendMessageAdmin(chatKey, message, optionals = {}) {
90304
+ const {
90305
+ userKey,
90306
+ ...routingOptions
90307
+ } = optionals;
90308
+ const uriComponent = userKey ? `/${userKey}` : '';
90309
+ return new Router().put(`/chat/message/system/${chatKey}${uriComponent}`, {
90310
+ body: {
90311
+ message
90312
+ },
90313
+ ...routingOptions
90314
+ }).then(({
90315
+ body
90316
+ }) => body);
90317
+ }
90318
+
90219
90319
  var chat = /*#__PURE__*/Object.freeze({
90220
90320
  __proto__: null,
90221
90321
  create: create$3,
90222
90322
  get: get$3,
90223
90323
  getMessages: getMessages,
90324
+ getMessagesAdmin: getMessagesAdmin,
90325
+ getMessagesForUser: getMessagesForUser,
90224
90326
  query: query,
90225
90327
  sendMessage: sendMessage,
90328
+ sendMessageAdmin: sendMessageAdmin,
90226
90329
  updatePermit: updatePermit
90227
90330
  });
90228
90331
 
@@ -91627,8 +91730,8 @@ var utilities = /*#__PURE__*/Object.freeze({
91627
91730
  });
91628
91731
 
91629
91732
  /* yes, this string template literal is weird;
91630
- * it's cause rollup does not recogize 3.33.0 as an individual token otherwise */
91631
- const version = `Epicenter (v${'3.33.0'}) for Module | Build Date: 2025-11-20T19:19:11.394Z`;
91733
+ * it's cause rollup does not recogize 3.34.1 as an individual token otherwise */
91734
+ const version = `Epicenter (v${'3.34.1'}) for Module | Build Date: 2026-02-19T18:00:42.889Z`;
91632
91735
  const UNAUTHORIZED = 401;
91633
91736
  const FORBIDDEN = 403;
91634
91737
  const DEFAULT_ERROR_HANDLERS = {};