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