epicenter-libs 3.28.0 → 3.28.2

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 (39) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/browser/{AckExtension-1fe508aa.js → AckExtension-4ccb1b3b.js} +3 -3
  3. package/dist/{module/AckExtension-755114ce.js.map → browser/AckExtension-4ccb1b3b.js.map} +1 -1
  4. package/dist/{module/ReloadExtension-22370c97.js → browser/ReloadExtension-26e320cf.js} +3 -3
  5. package/dist/{module/ReloadExtension-22370c97.js.map → browser/ReloadExtension-26e320cf.js.map} +1 -1
  6. package/dist/browser/{cometd-95666f77.js → cometd-009d1cc7.js} +2 -2
  7. package/dist/browser/{cometd-95666f77.js.map → cometd-009d1cc7.js.map} +1 -1
  8. package/dist/browser/{epicenter-53acd5e1.js → epicenter-ffc2b7a7.js} +15 -8
  9. package/dist/browser/epicenter-ffc2b7a7.js.map +1 -0
  10. package/dist/browser/epicenter.js +1 -1
  11. package/dist/cjs/{AckExtension-da9f05ef.js → AckExtension-f8c57030.js} +3 -3
  12. package/dist/cjs/{AckExtension-da9f05ef.js.map → AckExtension-f8c57030.js.map} +1 -1
  13. package/dist/cjs/{ReloadExtension-72077f71.js → ReloadExtension-0d52f073.js} +3 -3
  14. package/dist/cjs/{ReloadExtension-72077f71.js.map → ReloadExtension-0d52f073.js.map} +1 -1
  15. package/dist/cjs/{cometd-bb7d98a6.js → cometd-369eb10e.js} +2 -2
  16. package/dist/cjs/{cometd-bb7d98a6.js.map → cometd-369eb10e.js.map} +1 -1
  17. package/dist/cjs/{epicenter-52f23ee7.js → epicenter-54f0befe.js} +15 -8
  18. package/dist/cjs/epicenter-54f0befe.js.map +1 -0
  19. package/dist/cjs/epicenter.js +1 -1
  20. package/dist/epicenter.js +12 -5
  21. package/dist/epicenter.js.map +1 -1
  22. package/dist/epicenter.min.js +1 -1
  23. package/dist/epicenter.min.js.map +1 -1
  24. package/dist/module/{AckExtension-755114ce.js → AckExtension-cd7b3bcb.js} +3 -3
  25. package/dist/{browser/AckExtension-1fe508aa.js.map → module/AckExtension-cd7b3bcb.js.map} +1 -1
  26. package/dist/{browser/ReloadExtension-51e9dfea.js → module/ReloadExtension-da4ee10c.js} +3 -3
  27. package/dist/{browser/ReloadExtension-51e9dfea.js.map → module/ReloadExtension-da4ee10c.js.map} +1 -1
  28. package/dist/module/{cometd-8498d64f.js → cometd-c640d287.js} +2 -2
  29. package/dist/module/{cometd-8498d64f.js.map → cometd-c640d287.js.map} +1 -1
  30. package/dist/module/{epicenter-46d3b19d.js → epicenter-e4a6d235.js} +15 -8
  31. package/dist/module/epicenter-e4a6d235.js.map +1 -0
  32. package/dist/module/epicenter.js +1 -1
  33. package/dist/types/adapters/world.d.ts +4 -0
  34. package/package.json +1 -1
  35. package/src/adapters/cometd.ts +2 -2
  36. package/src/adapters/world.ts +34 -9
  37. package/dist/browser/epicenter-53acd5e1.js.map +0 -1
  38. package/dist/cjs/epicenter-52f23ee7.js.map +0 -1
  39. package/dist/module/epicenter-46d3b19d.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export { J as Channel, D as DEFAULT_ERROR_HANDLERS, F as Fault, P as PUSH_CATEGORY, R as RITUAL, b as ROLE, f as Router, S as SCOPE_BOUNDARY, g as accountAdapter, h as adminAdapter, i as assetAdapter, l as authAdapter, m as chatAdapter, d as config, j as consensusAdapter, G as dailyAdapter, k as emailAdapter, n as episodeAdapter, e as errorManager, o as groupAdapter, p as leaderboardAdapter, H as matchmakerAdapter, q as presenceAdapter, r as projectAdapter, s as recaptchaAdapter, t as runAdapter, E as somebodyAdapter, w as taskAdapter, x as timeAdapter, y as userAdapter, u as utils, z as vaultAdapter, v as version, K as videoAPI, A as videoAdapter, L as vonageAPI, B as vonageAdapter, I as walletAdapter, C as worldAdapter } from './epicenter-46d3b19d.js';
1
+ export { J as Channel, D as DEFAULT_ERROR_HANDLERS, F as Fault, P as PUSH_CATEGORY, R as RITUAL, b as ROLE, f as Router, S as SCOPE_BOUNDARY, g as accountAdapter, h as adminAdapter, i as assetAdapter, l as authAdapter, m as chatAdapter, d as config, j as consensusAdapter, G as dailyAdapter, k as emailAdapter, n as episodeAdapter, e as errorManager, o as groupAdapter, p as leaderboardAdapter, H as matchmakerAdapter, q as presenceAdapter, r as projectAdapter, s as recaptchaAdapter, t as runAdapter, E as somebodyAdapter, w as taskAdapter, x as timeAdapter, y as userAdapter, u as utils, z as vaultAdapter, v as version, K as videoAPI, A as videoAdapter, L as vonageAPI, B as vonageAdapter, I as walletAdapter, C as worldAdapter } from './epicenter-e4a6d235.js';
2
2
  import 'stream';
3
3
  import 'http';
4
4
  import 'url';
@@ -145,6 +145,7 @@ export declare function getSessionWorlds(optionals?: RoutingOptions): Promise<Wo
145
145
  * @param [optionals.populace[].minimum] The minimum number of users that required for this role
146
146
  * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role
147
147
  * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL
148
+ * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
148
149
  * @returns promise that resolves to the world the user was assigned to
149
150
  */
150
151
  export declare function selfAssign(optionals?: {
@@ -156,6 +157,7 @@ export declare function selfAssign(optionals?: {
156
157
  objectType: keyof typeof WORLD_NAME_GENERATOR;
157
158
  };
158
159
  populace?: Persona[];
160
+ allowChannel?: boolean;
159
161
  } & RoutingOptions): Promise<World>;
160
162
  /**
161
163
  * (Auto assign) -- makes worlds given a list of users.
@@ -183,6 +185,7 @@ export declare function selfAssign(optionals?: {
183
185
  * @param [optionals.populace[].minimum] The minimum number of users that required for this role
184
186
  * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role
185
187
  * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL
188
+ * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
186
189
  * @returns promise that resolves to the list of worlds created by the assignment
187
190
  */
188
191
  export declare function autoAssignUsers(assignments: UserAssignment[], optionals?: {
@@ -195,6 +198,7 @@ export declare function autoAssignUsers(assignments: UserAssignment[], optionals
195
198
  requireAllAssignments?: boolean;
196
199
  keepEmptyWorlds?: boolean;
197
200
  populace?: Persona[];
201
+ allowChannel?: boolean;
198
202
  } & RoutingOptions): Promise<World[]>;
199
203
  declare type WorldKey = string;
200
204
  export declare function editAssignments(assignments: Record<WorldKey, UserAssignment[]>, optionals?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epicenter-libs",
3
- "version": "3.28.0",
3
+ "version": "3.28.2",
4
4
  "main": "dist/cjs/epicenter.js",
5
5
  "module": "dist/module/epicenter.js",
6
6
  "browser": "dist/browser/epicenter.js",
@@ -40,8 +40,8 @@ class CometdAdapter {
40
40
  const project = await getProject();
41
41
  if (!project.channelEnabled) throw new EpicenterError('Push Channels are not enabled on this project');
42
42
  const channelProtocol = project.channelProtocol?.toLowerCase() || DEFAULT_CHANNEL_PROTOCOL;
43
-
44
- const { CometD } = await import('cometd');
43
+ const CometDImports = await import('cometd');
44
+ const { CometD } = CometDImports;
45
45
  const AckExtension = (await import('cometd/AckExtension')).default;
46
46
  const ReloadExtension = (await import('cometd/ReloadExtension')).default;
47
47
 
@@ -68,9 +68,9 @@ interface World {
68
68
  export async function update(
69
69
  worldKey: string,
70
70
  update: {
71
- displayName?: string,
72
- runKey?: string,
73
- allowChannel?: boolean
71
+ displayName?: string,
72
+ runKey?: string,
73
+ allowChannel?: boolean
74
74
  },
75
75
  optionals: RoutingOptions = {}
76
76
  ): Promise<World> {
@@ -250,6 +250,7 @@ export async function getSessionWorlds(
250
250
  * @param [optionals.populace[].minimum] The minimum number of users that required for this role
251
251
  * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role
252
252
  * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL
253
+ * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
253
254
  * @returns promise that resolves to the world the user was assigned to
254
255
  */
255
256
  export async function selfAssign(
@@ -258,18 +259,25 @@ export async function selfAssign(
258
259
  groupName?: string,
259
260
  episodeName?: string,
260
261
  objective?: keyof typeof OBJECTIVE,
261
- worldNameGenerator?: {objectType: keyof typeof WORLD_NAME_GENERATOR},
262
+ worldNameGenerator?: { objectType: keyof typeof WORLD_NAME_GENERATOR },
262
263
  populace?: Persona[],
264
+ allowChannel?: boolean,
263
265
  } & RoutingOptions = {}
264
266
  ): Promise<World> {
265
267
  const {
266
- role, groupName, episodeName, objective = OBJECTIVE.MINIMUM, worldNameGenerator, populace,
268
+ role,
269
+ groupName,
270
+ episodeName,
271
+ objective = OBJECTIVE.MINIMUM,
272
+ worldNameGenerator,
273
+ populace,
274
+ allowChannel,
267
275
  ...routingOptions
268
276
  } = optionals;
269
277
  const session = identification.session as UserSession;
270
278
  return await new Router()
271
279
  .post(`/world/selfassign/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {
272
- body: { role, objective, worldNameGenerator, populace },
280
+ body: { role, objective, worldNameGenerator, populace, allowChannel },
273
281
  ...routingOptions,
274
282
  })
275
283
  .then(({ body }) => body);
@@ -302,6 +310,7 @@ export async function selfAssign(
302
310
  * @param [optionals.populace[].minimum] The minimum number of users that required for this role
303
311
  * @param [optionals.populace[].maximum] The maximum number of users that can be assigned to this role
304
312
  * @param [optionals.populace[].marginal] The maximum number of users that can be assigned to this role when using objective MARGINAL
313
+ * @param [optionals.allowChannel] Opt into push notifications for this resource. Applicable to projects with phylogeny >= SILENT
305
314
  * @returns promise that resolves to the list of worlds created by the assignment
306
315
  */
307
316
  export async function autoAssignUsers(
@@ -310,20 +319,36 @@ export async function autoAssignUsers(
310
319
  groupName?: string,
311
320
  episodeName?: string,
312
321
  objective?: keyof typeof OBJECTIVE,
313
- worldNameGenerator?: {objectType: keyof typeof WORLD_NAME_GENERATOR},
322
+ worldNameGenerator?: { objectType: keyof typeof WORLD_NAME_GENERATOR },
314
323
  requireAllAssignments?: boolean,
315
324
  keepEmptyWorlds?: boolean,
316
325
  populace?: Persona[],
326
+ allowChannel?: boolean,
317
327
  } & RoutingOptions = {}
318
328
  ): Promise<World[]> {
319
329
  const {
320
- groupName, episodeName, objective = OBJECTIVE.MINIMUM, requireAllAssignments, worldNameGenerator, keepEmptyWorlds, populace,
330
+ groupName,
331
+ episodeName,
332
+ objective = OBJECTIVE.MINIMUM,
333
+ requireAllAssignments,
334
+ worldNameGenerator,
335
+ keepEmptyWorlds,
336
+ populace,
337
+ allowChannel,
321
338
  ...routingOptions
322
339
  } = optionals;
323
340
  const session = identification.session as UserSession;
324
341
  return await new Router()
325
342
  .post(`/world/assignment/${groupName ?? session?.groupName}${episodeName ? `/${episodeName}` : ''}`, {
326
- body: { assignments, objective, requireAllAssignments, worldNameGenerator, keepEmptyWorlds, populace },
343
+ body: {
344
+ assignments,
345
+ objective,
346
+ requireAllAssignments,
347
+ worldNameGenerator,
348
+ keepEmptyWorlds,
349
+ populace,
350
+ allowChannel,
351
+ },
327
352
  ...routingOptions,
328
353
  })
329
354
  .then(({ body }) => body);