epicenter-libs 3.21.0 → 3.22.0

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 (128) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.md +37 -37
  3. package/README.md +160 -160
  4. package/dist/browser/{AckExtension-9d0532b6.js → AckExtension-438d234e.js} +3 -3
  5. package/dist/{module/AckExtension-8c9469ea.js.map → browser/AckExtension-438d234e.js.map} +1 -1
  6. package/dist/{module/ReloadExtension-1e56f710.js → browser/ReloadExtension-0baee856.js} +3 -3
  7. package/dist/{module/ReloadExtension-1e56f710.js.map → browser/ReloadExtension-0baee856.js.map} +1 -1
  8. package/dist/browser/{cometd-e3796a33.js → cometd-18cbd82a.js} +2 -2
  9. package/dist/browser/{cometd-e3796a33.js.map → cometd-18cbd82a.js.map} +1 -1
  10. package/dist/browser/{epicenter-20ce1de2.js → epicenter-93aec770.js} +1893 -1593
  11. package/dist/browser/epicenter-93aec770.js.map +1 -0
  12. package/dist/browser/epicenter.js +1 -1
  13. package/dist/cjs/{AckExtension-e64971c2.js → AckExtension-e57146b1.js} +3 -3
  14. package/dist/cjs/{AckExtension-e64971c2.js.map → AckExtension-e57146b1.js.map} +1 -1
  15. package/dist/cjs/{ReloadExtension-9bd8fb57.js → ReloadExtension-a83e7726.js} +3 -3
  16. package/dist/cjs/{ReloadExtension-9bd8fb57.js.map → ReloadExtension-a83e7726.js.map} +1 -1
  17. package/dist/cjs/{cometd-67bc75cb.js → cometd-18737d2d.js} +2 -2
  18. package/dist/cjs/{cometd-67bc75cb.js.map → cometd-18737d2d.js.map} +1 -1
  19. package/dist/cjs/{epicenter-98fb4dcf.js → epicenter-a3bb2d19.js} +1893 -1592
  20. package/dist/cjs/epicenter-a3bb2d19.js.map +1 -0
  21. package/dist/cjs/epicenter.js +2 -1
  22. package/dist/cjs/epicenter.js.map +1 -1
  23. package/dist/epicenter.js +1889 -1588
  24. package/dist/epicenter.js.map +1 -1
  25. package/dist/epicenter.min.js +1 -1
  26. package/dist/epicenter.min.js.map +1 -1
  27. package/dist/module/{AckExtension-8c9469ea.js → AckExtension-334a55cd.js} +3 -3
  28. package/dist/{browser/AckExtension-9d0532b6.js.map → module/AckExtension-334a55cd.js.map} +1 -1
  29. package/dist/{browser/ReloadExtension-fbce8d4d.js → module/ReloadExtension-73b0e442.js} +3 -3
  30. package/dist/{browser/ReloadExtension-fbce8d4d.js.map → module/ReloadExtension-73b0e442.js.map} +1 -1
  31. package/dist/module/{cometd-81ddc4ab.js → cometd-1c2beeec.js} +2 -2
  32. package/dist/module/{cometd-81ddc4ab.js.map → cometd-1c2beeec.js.map} +1 -1
  33. package/dist/module/{epicenter-8245daad.js → epicenter-cfee226f.js} +1893 -1593
  34. package/dist/module/epicenter-cfee226f.js.map +1 -0
  35. package/dist/module/epicenter.js +1 -1
  36. package/dist/types/adapters/account.d.ts +44 -44
  37. package/dist/types/adapters/admin.d.ts +33 -33
  38. package/dist/types/adapters/asset.d.ts +48 -48
  39. package/dist/types/adapters/authentication.d.ts +63 -63
  40. package/dist/types/adapters/channel.d.ts +39 -39
  41. package/dist/types/adapters/chat.d.ts +105 -105
  42. package/dist/types/adapters/cometd.d.ts +27 -27
  43. package/dist/types/adapters/consensus.d.ts +218 -218
  44. package/dist/types/adapters/daily.d.ts +124 -0
  45. package/dist/types/adapters/email.d.ts +86 -86
  46. package/dist/types/adapters/episode.d.ts +92 -92
  47. package/dist/types/adapters/group.d.ts +341 -341
  48. package/dist/types/adapters/index.d.ts +27 -26
  49. package/dist/types/adapters/leaderboard.d.ts +68 -68
  50. package/dist/types/adapters/matchmaker.d.ts +40 -40
  51. package/dist/types/adapters/presence.d.ts +35 -35
  52. package/dist/types/adapters/project.d.ts +100 -100
  53. package/dist/types/adapters/recaptcha.d.ts +1 -1
  54. package/dist/types/adapters/run.d.ts +298 -298
  55. package/dist/types/adapters/somebody.d.ts +56 -56
  56. package/dist/types/adapters/task.d.ts +154 -154
  57. package/dist/types/adapters/time.d.ts +2 -2
  58. package/dist/types/adapters/user.d.ts +52 -52
  59. package/dist/types/adapters/vault.d.ts +94 -94
  60. package/dist/types/adapters/video.d.ts +150 -113
  61. package/dist/types/adapters/vonage.d.ts +87 -87
  62. package/dist/types/adapters/world.d.ts +266 -266
  63. package/dist/types/apis/index.d.ts +3 -3
  64. package/dist/types/apis/video.d.ts +90 -80
  65. package/dist/types/apis/vonage.d.ts +35 -35
  66. package/dist/types/epicenter.d.ts +12 -12
  67. package/dist/types/utilities.d.ts +1 -1
  68. package/dist/types/utils/config.d.ts +107 -107
  69. package/dist/types/utils/constants.d.ts +318 -318
  70. package/dist/types/utils/cookies.d.ts +16 -16
  71. package/dist/types/utils/error-manager.d.ts +21 -21
  72. package/dist/types/utils/error.d.ts +4 -4
  73. package/dist/types/utils/fault.d.ts +17 -17
  74. package/dist/types/utils/helpers.d.ts +4 -4
  75. package/dist/types/utils/identification.d.ts +48 -48
  76. package/dist/types/utils/index.d.ts +11 -11
  77. package/dist/types/utils/result.d.ts +6 -6
  78. package/dist/types/utils/router.d.ts +189 -189
  79. package/dist/types/utils/store.d.ts +31 -31
  80. package/package.json +103 -103
  81. package/src/adapters/account.ts +103 -103
  82. package/src/adapters/admin.ts +52 -52
  83. package/src/adapters/asset.ts +215 -215
  84. package/src/adapters/authentication.ts +190 -190
  85. package/src/adapters/channel.ts +80 -80
  86. package/src/adapters/chat.ts +187 -187
  87. package/src/adapters/cometd.ts +342 -342
  88. package/src/adapters/consensus.ts +402 -402
  89. package/src/adapters/daily.ts +263 -0
  90. package/src/adapters/email.ts +145 -145
  91. package/src/adapters/episode.ts +165 -165
  92. package/src/adapters/group.ts +640 -640
  93. package/src/adapters/index.ts +55 -53
  94. package/src/adapters/leaderboard.ts +121 -121
  95. package/src/adapters/matchmaker.ts +133 -133
  96. package/src/adapters/presence.ts +63 -63
  97. package/src/adapters/project.ts +134 -134
  98. package/src/adapters/recaptcha.ts +10 -10
  99. package/src/adapters/run.ts +857 -857
  100. package/src/adapters/somebody.ts +98 -98
  101. package/src/adapters/task.ts +213 -213
  102. package/src/adapters/time.ts +36 -36
  103. package/src/adapters/user.ts +107 -107
  104. package/src/adapters/vault.ts +235 -235
  105. package/src/adapters/video.ts +222 -175
  106. package/src/adapters/vonage.ts +131 -131
  107. package/src/adapters/world.ts +456 -456
  108. package/src/apis/index.ts +8 -8
  109. package/src/apis/video.ts +178 -149
  110. package/src/apis/vonage.ts +70 -70
  111. package/src/epicenter.ts +132 -131
  112. package/src/globals.d.ts +15 -15
  113. package/src/utilities.ts +13 -13
  114. package/src/utils/config.ts +197 -197
  115. package/src/utils/constants.ts +354 -354
  116. package/src/utils/cookies.ts +71 -71
  117. package/src/utils/error-manager.ts +68 -68
  118. package/src/utils/error.ts +8 -8
  119. package/src/utils/fault.ts +38 -38
  120. package/src/utils/helpers.ts +7 -7
  121. package/src/utils/identification.ts +129 -129
  122. package/src/utils/index.ts +11 -11
  123. package/src/utils/result.ts +14 -14
  124. package/src/utils/router.ts +573 -573
  125. package/src/utils/store.ts +82 -82
  126. package/dist/browser/epicenter-20ce1de2.js.map +0 -1
  127. package/dist/cjs/epicenter-98fb4dcf.js.map +0 -1
  128. package/dist/module/epicenter-8245daad.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.22.0](https://github.com/forio/epicenter-libs/compare/v3.21.0...v3.22.0) (2023-04-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * accounted for various file types in getVideoByRecordingId ([707e87c](https://github.com/forio/epicenter-libs/commit/707e87cd6d1055e3f4ac24239e4b5ce2f93eb9ad))
7
+
8
+
9
+ ### Features
10
+
11
+ * added daily adapter ([3d98386](https://github.com/forio/epicenter-libs/commit/3d98386536b6b9d3aaf511f5632141e104696bcb))
12
+
13
+
14
+
1
15
  # [3.21.0](https://github.com/forio/epicenter-libs/compare/v3.20.0...v3.21.0) (2023-04-19)
2
16
 
3
17
 
package/LICENSE.md CHANGED
@@ -1,37 +1,37 @@
1
- LICENSE
2
- -------
3
-
4
- Forio Corporation (Forio) hereby gives you a non-exclusive license to use the software in this repository (the Software).
5
-
6
- This license is granted for use in developing online applications that interact with Forio servers and server software. Typically the Software will be used to create analytic web applications that are hosted by Forio Epicenter or Forio Simulate. As part of this license you may freely download the complete distribution from the following URL.
7
- https://github.com/forio/epicenter-libs
8
-
9
- You may:
10
- - use the Software on any computer for the purposes of developing an online application.
11
- - upload the contents of the "dist" folder of the Software to any server controlled by Forio Corporation or any server that is running software provided by Forio.
12
- - link to the Software from a web application as long as the purpose of the web application is to interact with Forio servers or Forio server software.
13
- - copy the Software for archival purposes, provided any copy contains all of the original Software's proprietary notices.
14
-
15
- You may not:
16
- - redistribute the Software except as allowed above
17
- - include the Software or any files from the Software in a web application except for the contents of the "dist" folder as noted above.
18
- - permit other individuals to use the Software except under the terms listed above;
19
- - modify, translate, reverse engineer, decompile, disassemble (except to the extent applicable laws specifically prohibit such restriction),
20
- - create derivative works based on the Software;
21
- - copy the Software (except as specified above);
22
- - rent, lease, transfer or otherwise transfer rights to the Software;
23
- - remove any proprietary notices or labels on the Software.
24
-
25
- TERMINATION.
26
- The license will terminate automatically if you fail to comply with the limitations described above. On termination, you must destroy all copies of the Software and Documentation.
27
-
28
-
29
- DISCLAIMER OF WARRANTY
30
- ---------------------------------------------
31
- The Software is provided on an AS IS basis, without warranty of any kind, including without limitation the warranties of merchantability, fitness for a particular purpose and non-infringement.
32
- The entire risk as to the quality and performance of the Software is borne by you.
33
- Should the Software prove defective, you and not Forio assume the entire cost of any service and repair.
34
-
35
- FORIO IS NOT RESPONSIBLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES.
36
-
37
- Title, ownership rights and intellectual property rights in and to the Software shall remain in Forio. The Software is protected by international copyright treaties.
1
+ LICENSE
2
+ -------
3
+
4
+ Forio Corporation (Forio) hereby gives you a non-exclusive license to use the software in this repository (the Software).
5
+
6
+ This license is granted for use in developing online applications that interact with Forio servers and server software. Typically the Software will be used to create analytic web applications that are hosted by Forio Epicenter or Forio Simulate. As part of this license you may freely download the complete distribution from the following URL.
7
+ https://github.com/forio/epicenter-libs
8
+
9
+ You may:
10
+ - use the Software on any computer for the purposes of developing an online application.
11
+ - upload the contents of the "dist" folder of the Software to any server controlled by Forio Corporation or any server that is running software provided by Forio.
12
+ - link to the Software from a web application as long as the purpose of the web application is to interact with Forio servers or Forio server software.
13
+ - copy the Software for archival purposes, provided any copy contains all of the original Software's proprietary notices.
14
+
15
+ You may not:
16
+ - redistribute the Software except as allowed above
17
+ - include the Software or any files from the Software in a web application except for the contents of the "dist" folder as noted above.
18
+ - permit other individuals to use the Software except under the terms listed above;
19
+ - modify, translate, reverse engineer, decompile, disassemble (except to the extent applicable laws specifically prohibit such restriction),
20
+ - create derivative works based on the Software;
21
+ - copy the Software (except as specified above);
22
+ - rent, lease, transfer or otherwise transfer rights to the Software;
23
+ - remove any proprietary notices or labels on the Software.
24
+
25
+ TERMINATION.
26
+ The license will terminate automatically if you fail to comply with the limitations described above. On termination, you must destroy all copies of the Software and Documentation.
27
+
28
+
29
+ DISCLAIMER OF WARRANTY
30
+ ---------------------------------------------
31
+ The Software is provided on an AS IS basis, without warranty of any kind, including without limitation the warranties of merchantability, fitness for a particular purpose and non-infringement.
32
+ The entire risk as to the quality and performance of the Software is borne by you.
33
+ Should the Software prove defective, you and not Forio assume the entire cost of any service and repair.
34
+
35
+ FORIO IS NOT RESPONSIBLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES.
36
+
37
+ Title, ownership rights and intellectual property rights in and to the Software shall remain in Forio. The Software is protected by international copyright treaties.
package/README.md CHANGED
@@ -1,160 +1,160 @@
1
- Epicenter JavaScript Libs (v3)
2
- ---
3
- The Epicenter JS libs is Forio's JavaScript library for interacting with the Epicenter platform. Similar to its [predecessor](https://github.com/forio/epicenter-js-libs), it is comprised of a set of adapters meant to help streamline your work with the underlying Epicenter APIs.
4
-
5
- If you are comfortable with JavaScript, the epicenter.js library is an easy way to connect your project's model, data, and user interface.
6
-
7
- Questions? Contact us at support@forio.com or file an issue on github!
8
-
9
- JIRA (Forio internal): https://issues.forio.com/projects/EPILIBS/issues
10
-
11
- Table of Contents
12
- ---
13
- - [Transition Guide (v2 → v3)](#transition-guide-v2--v3)
14
- - [New Features In v3](#new-features-in-v3)
15
- - [Some Things Were Renamed](#some-things-were-renamed)
16
- - [Changes In The Way We Store And Expose User Data](#changes-in-the-way-we-store-and-expose-user-data)
17
- - [Session Expiration & Generic Error Handling](#session-expiration--generic-error-handling)
18
- - [Built-in SSO Handling](#built-in-sso-handling)
19
- - [Pagination](#pagination)
20
- - [Presence](#presence)
21
- - [Tenets for Development](#tenets-for-development)
22
- - [How to Contribute](#how-to-contribute)
23
- - [How to Prepare a Release](#how-to-prepare-a-release)
24
- - [Publishing on NPM](#publishing-on-npm)
25
- - [npm publish --dry-run](#npm-publish---dry-run)
26
- - [npm publish --tag next](#npm-publish---tag-next)
27
- - [npm unpublish epicenter-libs@{{version}}](#npm-unpublish-epicenter-libsversion)
28
- - [npm dist-tag add | rm | ls](#npm-dist-tag-add--rm--ls)
29
- - [Versioning](#versioning)
30
- - [How to Test](#how-to-test)
31
- - [How to Use Examples (Local)](#how-to-use-examples-local)
32
- - [Vanilla JavaScript](#vanilla-javascript)
33
- - [Node Server](#node-server)
34
- - [Documentation](#documentation)
35
-
36
-
37
- # Transition Guide (v2 → v3)
38
- ## New Features In v3
39
- * All resources now have an associated scope to help categorize them -- e.g., project, group, episode, world.
40
- * All resources now have an associated permit to help define permissions for roles (anonymous, participant, leader, reviewer, facilitator)
41
- * Users now have a `displayName` for use in sims, detached from any private personal data
42
- * Two new roles for end users:
43
- * reviewer: a role similar to facilitators, but lower on the permissions hierarchy
44
- * leader: a role similar to participants, but higher on the permissions hierarchy
45
- * And more below...
46
-
47
- ## Some Things Were Renamed
48
- * A bunch of user and run properties, among them --
49
- * `userName → handle`
50
- * `firstName → givenName`
51
- * `lastName → familyName`
52
- * `run.saved → run.marked`
53
- * `run.trashed → run.hidden`
54
- * Resources ID'd by `[RESOURCE]Id` (e.g., `runId`) now use `key` instead of `id` (so now it's `runKey`)
55
- * `id` now refers to the long value of the row ID in the database instead
56
- * All resource `key`s are GUIDs (globally unique IDs)
57
-
58
- ## Changes In The Way We Store And Expose User Data
59
- User information has been separated into out to better support for GDPR standards. Users now own a "pseudonym" from which to interact with the simulations. This is detached from their personal data which lets the platform to maintain a record while allowing for easy removal of user-sensitive data when requested.
60
-
61
- ## Session Expiration & Generic Error Handling
62
- * v3 authorization tokens can now expire after a period of inactivity, and become invalid after a world assignment change
63
- * All calls have an error handling fallback to an `errorManager` instance, which will help to run checks on generic network errors like the expiration behavior described in the previous bullet
64
-
65
- ## Built-in SSO Handling
66
- On load, epi-libs will now make an effort to find any Epicenter SSO tokens and consume them to generate an Epicenter session for you. This means a node server is no longer a hard requirement if you want to do SSO!
67
-
68
- ## Pagination
69
- When retrieving records, pagination is no longer done via the request `Content-Range` header like in v2. Instead, the platform will now return a page-like object, which will contain properties that reflect the `records {start}-{end}/{total}` syntax:
70
-
71
- * `first → page.firstResult`
72
- * `end → page.firstResult + page.maxResults`
73
- * `total → page.totalResults`
74
-
75
- ## Presence
76
- A user's presence is now determined by their connection to the CometD server. Unlike in v2, the platform will automatically create push channel notifications on behalf of the user when they subscribe or do anything channel related (i.e., like a CometD handshake).
77
-
78
- # Tenets for Development
79
- * Code should function in both Browser and Node environments
80
- * Trailing slashes in URL pathnames are meaningful in v3; so where applicable: always omit the slash at the end of the URLs of your API REST call (**this includes the one that might show up before a search query**)
81
-
82
- # How to Contribute
83
- Prequisite Node version: 12+
84
-
85
- 1. Create a new branch for your change; if there's a JIRA ticket associated use that, e.g., `git checkout -b EPILIBS-42`
86
- 2. Make your changes
87
- 3. Create a [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) describing your changes
88
- * If you feel your change breaks the existing usage of the library be sure to indicate this in the commit message by adding a note in the commit footer starting with: `BREAKING CHANGE: `, and this will be automatically reflected in the changelog when it's generated.
89
- 4. Push up your branch and make sure it passes the tests in the pre-push hook
90
- 5. Make a pull request on github, or if you're confident: merge your branch into `master`
91
-
92
- # How to Prepare a Release
93
- 1. Build to the `dist/` folder: `npm run build`
94
- 2. Test to make sure there are no breaking changes: `npm run single-test`
95
- 3. Update the version in the `package.json` to the value you'd like to release
96
- 4. Generate a changelog entry using `conventional-changelog`
97
- - Entries are created based on the most recent git tag compared to the the version value in `package.json`
98
- - For this reason, make sure sure you have the latest tags: `git fetch origin`
99
- - Run: `npm run changelog` -- which will append to the CHANGELOG.md file an automated text translation of the commits created between the most recent git tag, and the current HEAD.
100
- - Commit your updated CHANGELOG.md: `git add CHANGELOG.md && git commit -m "chore: update CHANGELOG"`
101
- 5. Tag `master` with the same version you used in step 3 (prefix with 'v')
102
- 6. Visit Jenkins to deploy to `forio.com/tools/js-libs`: https://build.forio.com/job/deploy-epicenter-js-v3--epicenter--/
103
- 7. Publish the files in `dist/` folder to NPM: `npm publish`
104
-
105
- ## Publishing on NPM
106
- In order to publish to NPM, you have to be logged into the Forio NPM account. To do this, you'll need perform a one-time login with `npm adduser`. You will be prompted for a one-time password, which will be sent to `tech@forio.com`. Afterwhich, you'll be able to run `npm publish`. Below are other helpful commands to consider.
107
-
108
- ### npm publish --dry-run
109
- For doing a test run before actually publishing
110
-
111
- ### npm publish --tag next
112
- For when you want to publish an alpha version of the libs for testing. Normal installations will not pick up versions tagged as "next". This way, you can publish on a change you want to test, and then go to an external project and run `npm install -i epicenter-libs@next` to go and play around with your changes.
113
-
114
- ### npm unpublish epicenter-libs@{{version}}
115
- For when you accidentally publish an incorrect version (this removes the package version from the registry, as well as deletes its entry, removign the tarball).
116
-
117
- ### npm dist-tag add | rm | ls
118
- Manages distribution tags, for when you make a typo spelling "--tag next" and you end up publishing `epicenter-libs@name`.
119
-
120
-
121
- ## Versioning
122
- The web development team isn't planning on incrementing the number that correlates to the major version, that space is reserved for major platform changes (i.e., Epicenter v4 and beyond). Instead, starting in `v3.8.0` -- we will opt to track breaking changes with a suffix `-breaking` and increment the minor number instead.
123
-
124
-
125
-
126
- # How to Test
127
- Tests are written to preserve behavior across releases. These are unit tests and are not intended for testing Epicenter features themselves.
128
-
129
- ```
130
- npm install # Installs dependencies for libs
131
- npm run build # Builds libs to dist/ folder
132
- npm run single-test # Runs the tests once
133
- npm run test # Runs the tests w/ a watch
134
- ```
135
- Logs during testing are sent to `browser.log` file
136
-
137
- # How to Use Examples (Local)
138
- The following are examples of the Epicenter JS libs use cases. Their intended purpose is to be a sandbox for end-to-end testing.
139
-
140
- Do not use these as a starting point/template for new projects. They are not an indicator of frontend best practices, rather -- the choice to use vanilla JavaScript here was to make it universally understandable.
141
-
142
- ## Vanilla JavaScript
143
- ```
144
- npm install # Installs dependencies for libs
145
- npm run build # Builds libs to dist/ folder
146
- cd examples/parcel
147
- npm install # Install dependencies for example
148
- npm start # Serves example locally at local.forio.com:3913
149
- ```
150
- ## Node Server
151
- ```
152
- npm install # Installs dependencies for libs
153
- npm run build # Builds libs to dist/ folder
154
- cd examples/node
155
- npm install # Install dependencies for example
156
- npm start
157
- ```
158
-
159
- # Documentation
160
- Documentation is currently limited. For the time being, please refer to the comments in code. Hoping to support this in a more official capacity at some point, possibly having them generated automatically with tools like [TypeDoc](https://typedoc.org/).
1
+ Epicenter JavaScript Libs (v3)
2
+ ---
3
+ The Epicenter JS libs is Forio's JavaScript library for interacting with the Epicenter platform. Similar to its [predecessor](https://github.com/forio/epicenter-js-libs), it is comprised of a set of adapters meant to help streamline your work with the underlying Epicenter APIs.
4
+
5
+ If you are comfortable with JavaScript, the epicenter.js library is an easy way to connect your project's model, data, and user interface.
6
+
7
+ Questions? Contact us at support@forio.com or file an issue on github!
8
+
9
+ JIRA (Forio internal): https://issues.forio.com/projects/EPILIBS/issues
10
+
11
+ Table of Contents
12
+ ---
13
+ - [Transition Guide (v2 → v3)](#transition-guide-v2--v3)
14
+ - [New Features In v3](#new-features-in-v3)
15
+ - [Some Things Were Renamed](#some-things-were-renamed)
16
+ - [Changes In The Way We Store And Expose User Data](#changes-in-the-way-we-store-and-expose-user-data)
17
+ - [Session Expiration & Generic Error Handling](#session-expiration--generic-error-handling)
18
+ - [Built-in SSO Handling](#built-in-sso-handling)
19
+ - [Pagination](#pagination)
20
+ - [Presence](#presence)
21
+ - [Tenets for Development](#tenets-for-development)
22
+ - [How to Contribute](#how-to-contribute)
23
+ - [How to Prepare a Release](#how-to-prepare-a-release)
24
+ - [Publishing on NPM](#publishing-on-npm)
25
+ - [npm publish --dry-run](#npm-publish---dry-run)
26
+ - [npm publish --tag next](#npm-publish---tag-next)
27
+ - [npm unpublish epicenter-libs@{{version}}](#npm-unpublish-epicenter-libsversion)
28
+ - [npm dist-tag add | rm | ls](#npm-dist-tag-add--rm--ls)
29
+ - [Versioning](#versioning)
30
+ - [How to Test](#how-to-test)
31
+ - [How to Use Examples (Local)](#how-to-use-examples-local)
32
+ - [Vanilla JavaScript](#vanilla-javascript)
33
+ - [Node Server](#node-server)
34
+ - [Documentation](#documentation)
35
+
36
+
37
+ # Transition Guide (v2 → v3)
38
+ ## New Features In v3
39
+ * All resources now have an associated scope to help categorize them -- e.g., project, group, episode, world.
40
+ * All resources now have an associated permit to help define permissions for roles (anonymous, participant, leader, reviewer, facilitator)
41
+ * Users now have a `displayName` for use in sims, detached from any private personal data
42
+ * Two new roles for end users:
43
+ * reviewer: a role similar to facilitators, but lower on the permissions hierarchy
44
+ * leader: a role similar to participants, but higher on the permissions hierarchy
45
+ * And more below...
46
+
47
+ ## Some Things Were Renamed
48
+ * A bunch of user and run properties, among them --
49
+ * `userName → handle`
50
+ * `firstName → givenName`
51
+ * `lastName → familyName`
52
+ * `run.saved → run.marked`
53
+ * `run.trashed → run.hidden`
54
+ * Resources ID'd by `[RESOURCE]Id` (e.g., `runId`) now use `key` instead of `id` (so now it's `runKey`)
55
+ * `id` now refers to the long value of the row ID in the database instead
56
+ * All resource `key`s are GUIDs (globally unique IDs)
57
+
58
+ ## Changes In The Way We Store And Expose User Data
59
+ User information has been separated into out to better support for GDPR standards. Users now own a "pseudonym" from which to interact with the simulations. This is detached from their personal data which lets the platform to maintain a record while allowing for easy removal of user-sensitive data when requested.
60
+
61
+ ## Session Expiration & Generic Error Handling
62
+ * v3 authorization tokens can now expire after a period of inactivity, and become invalid after a world assignment change
63
+ * All calls have an error handling fallback to an `errorManager` instance, which will help to run checks on generic network errors like the expiration behavior described in the previous bullet
64
+
65
+ ## Built-in SSO Handling
66
+ On load, epi-libs will now make an effort to find any Epicenter SSO tokens and consume them to generate an Epicenter session for you. This means a node server is no longer a hard requirement if you want to do SSO!
67
+
68
+ ## Pagination
69
+ When retrieving records, pagination is no longer done via the request `Content-Range` header like in v2. Instead, the platform will now return a page-like object, which will contain properties that reflect the `records {start}-{end}/{total}` syntax:
70
+
71
+ * `first → page.firstResult`
72
+ * `end → page.firstResult + page.maxResults`
73
+ * `total → page.totalResults`
74
+
75
+ ## Presence
76
+ A user's presence is now determined by their connection to the CometD server. Unlike in v2, the platform will automatically create push channel notifications on behalf of the user when they subscribe or do anything channel related (i.e., like a CometD handshake).
77
+
78
+ # Tenets for Development
79
+ * Code should function in both Browser and Node environments
80
+ * Trailing slashes in URL pathnames are meaningful in v3; so where applicable: always omit the slash at the end of the URLs of your API REST call (**this includes the one that might show up before a search query**)
81
+
82
+ # How to Contribute
83
+ Prequisite Node version: 12+
84
+
85
+ 1. Create a new branch for your change; if there's a JIRA ticket associated use that, e.g., `git checkout -b EPILIBS-42`
86
+ 2. Make your changes
87
+ 3. Create a [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) describing your changes
88
+ * If you feel your change breaks the existing usage of the library be sure to indicate this in the commit message by adding a note in the commit footer starting with: `BREAKING CHANGE: `, and this will be automatically reflected in the changelog when it's generated.
89
+ 4. Push up your branch and make sure it passes the tests in the pre-push hook
90
+ 5. Make a pull request on github, or if you're confident: merge your branch into `master`
91
+
92
+ # How to Prepare a Release
93
+ 1. Build to the `dist/` folder: `npm run build`
94
+ 2. Test to make sure there are no breaking changes: `npm run single-test`
95
+ 3. Update the version in the `package.json` to the value you'd like to release
96
+ 4. Generate a changelog entry using `conventional-changelog`
97
+ - Entries are created based on the most recent git tag compared to the the version value in `package.json`
98
+ - For this reason, make sure sure you have the latest tags: `git fetch origin`
99
+ - Run: `npm run changelog` -- which will append to the CHANGELOG.md file an automated text translation of the commits created between the most recent git tag, and the current HEAD.
100
+ - Commit your updated CHANGELOG.md: `git add CHANGELOG.md && git commit -m "chore: update CHANGELOG"`
101
+ 5. Tag `master` with the same version you used in step 3 (prefix with 'v')
102
+ 6. Visit Jenkins to deploy to `forio.com/tools/js-libs`: https://build.forio.com/job/deploy-epicenter-js-v3--epicenter--/
103
+ 7. Publish the files in `dist/` folder to NPM: `npm publish`
104
+
105
+ ## Publishing on NPM
106
+ In order to publish to NPM, you have to be logged into the Forio NPM account. To do this, you'll need perform a one-time login with `npm adduser`. You will be prompted for a one-time password, which will be sent to `tech@forio.com`. Afterwhich, you'll be able to run `npm publish`. Below are other helpful commands to consider.
107
+
108
+ ### npm publish --dry-run
109
+ For doing a test run before actually publishing
110
+
111
+ ### npm publish --tag next
112
+ For when you want to publish an alpha version of the libs for testing. Normal installations will not pick up versions tagged as "next". This way, you can publish on a change you want to test, and then go to an external project and run `npm install -i epicenter-libs@next` to go and play around with your changes.
113
+
114
+ ### npm unpublish epicenter-libs@{{version}}
115
+ For when you accidentally publish an incorrect version (this removes the package version from the registry, as well as deletes its entry, removign the tarball).
116
+
117
+ ### npm dist-tag add | rm | ls
118
+ Manages distribution tags, for when you make a typo spelling "--tag next" and you end up publishing `epicenter-libs@name`.
119
+
120
+
121
+ ## Versioning
122
+ The web development team isn't planning on incrementing the number that correlates to the major version, that space is reserved for major platform changes (i.e., Epicenter v4 and beyond). Instead, starting in `v3.8.0` -- we will opt to track breaking changes with a suffix `-breaking` and increment the minor number instead.
123
+
124
+
125
+
126
+ # How to Test
127
+ Tests are written to preserve behavior across releases. These are unit tests and are not intended for testing Epicenter features themselves.
128
+
129
+ ```
130
+ npm install # Installs dependencies for libs
131
+ npm run build # Builds libs to dist/ folder
132
+ npm run single-test # Runs the tests once
133
+ npm run test # Runs the tests w/ a watch
134
+ ```
135
+ Logs during testing are sent to `browser.log` file
136
+
137
+ # How to Use Examples (Local)
138
+ The following are examples of the Epicenter JS libs use cases. Their intended purpose is to be a sandbox for end-to-end testing.
139
+
140
+ Do not use these as a starting point/template for new projects. They are not an indicator of frontend best practices, rather -- the choice to use vanilla JavaScript here was to make it universally understandable.
141
+
142
+ ## Vanilla JavaScript
143
+ ```
144
+ npm install # Installs dependencies for libs
145
+ npm run build # Builds libs to dist/ folder
146
+ cd examples/parcel
147
+ npm install # Install dependencies for example
148
+ npm start # Serves example locally at local.forio.com:3913
149
+ ```
150
+ ## Node Server
151
+ ```
152
+ npm install # Installs dependencies for libs
153
+ npm run build # Builds libs to dist/ folder
154
+ cd examples/node
155
+ npm install # Install dependencies for example
156
+ npm start
157
+ ```
158
+
159
+ # Documentation
160
+ Documentation is currently limited. For the time being, please refer to the comments in code. Hoping to support this in a more official capacity at some point, possibly having them generated automatically with tools like [TypeDoc](https://typedoc.org/).
@@ -1,5 +1,5 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-20ce1de2.js';
2
- import { a as cometd } from './cometd-e3796a33.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-93aec770.js';
2
+ import { a as cometd } from './cometd-18cbd82a.js';
3
3
 
4
4
  function _mergeNamespaces(n, m) {
5
5
  m.forEach(function (e) {
@@ -126,4 +126,4 @@ var AckExtension$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
126
126
  }, [AckExtension]));
127
127
 
128
128
  export { AckExtension$1 as A };
129
- //# sourceMappingURL=AckExtension-9d0532b6.js.map
129
+ //# sourceMappingURL=AckExtension-438d234e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AckExtension-8c9469ea.js","sources":["../../node_modules/cometd/AckExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory){\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * This client-side extension enables the client to acknowledge to the server\n * the messages that the client has received.\n * For the acknowledgement to work, the server must be configured with the\n * correspondent server-side ack extension. If both client and server support\n * the ack extension, then the ack functionality will take place automatically.\n * By enabling this extension, all messages arriving from the server will arrive\n * via /meta/connect, so the comet communication will be slightly chattier.\n * The fact that all messages will return via /meta/connect means also that the\n * messages will arrive with total order, which is not guaranteed if messages\n * can arrive via both /meta/connect and normal response.\n * Messages are not acknowledged one by one, but instead a batch of messages is\n * acknowledged when the /meta/connect returns.\n */\n return cometdModule.AckExtension = function() {\n var _cometd;\n var _serverSupportsAcks = false;\n var _batch;\n\n function _debug(text, args) {\n _cometd._debug(text, args);\n }\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _debug('AckExtension: executing registration callback');\n };\n\n this.unregistered = function() {\n _debug('AckExtension: executing unregistration callback');\n _cometd = null;\n };\n\n this.incoming = function(message) {\n var channel = message.channel;\n var ext = message.ext;\n if (channel === '/meta/handshake') {\n if (ext) {\n var ackField = ext.ack;\n if (typeof ackField === 'object') {\n // New format.\n _serverSupportsAcks = ackField.enabled === true;\n var batch = ackField.batch;\n if (typeof batch === 'number') {\n _batch = batch;\n }\n } else {\n // Old format.\n _serverSupportsAcks = ackField === true;\n }\n }\n _debug('AckExtension: server supports acknowledgements', _serverSupportsAcks);\n } else if (channel === '/meta/connect' && message.successful && _serverSupportsAcks) {\n if (ext && typeof ext.ack === 'number') {\n _batch = ext.ack;\n _debug('AckExtension: server sent batch', _batch);\n }\n }\n return message;\n };\n\n this.outgoing = function(message) {\n var channel = message.channel;\n if (!message.ext) {\n message.ext = {};\n }\n if (channel === '/meta/handshake') {\n message.ext.ack = _cometd && _cometd.ackEnabled !== false;\n _serverSupportsAcks = false;\n _batch = 0;\n } else if (channel === '/meta/connect') {\n if (_serverSupportsAcks) {\n message.ext.ack = _batch;\n _debug('AckExtension: client sending batch', _batch);\n }\n }\n return message;\n };\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,IAAI,EAAE,OAAO,CAAC;AACxB,IAAqC;AACrC,QAAQ,cAAc,GAAG,OAAO,CAACA,MAAmB,CAAC,CAAC;AACtD,KAIK;AACL,CAAC,CAACC,cAAI,EAAE,SAAS,YAAY,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,YAAY,CAAC,YAAY,GAAG,WAAW;AAClD,QAAQ,IAAI,OAAO,CAAC;AACpB,QAAQ,IAAI,mBAAmB,GAAG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esContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory){\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * This client-side extension enables the client to acknowledge to the server\n * the messages that the client has received.\n * For the acknowledgement to work, the server must be configured with the\n * correspondent server-side ack extension. If both client and server support\n * the ack extension, then the ack functionality will take place automatically.\n * By enabling this extension, all messages arriving from the server will arrive\n * via /meta/connect, so the comet communication will be slightly chattier.\n * The fact that all messages will return via /meta/connect means also that the\n * messages will arrive with total order, which is not guaranteed if messages\n * can arrive via both /meta/connect and normal response.\n * Messages are not acknowledged one by one, but instead a batch of messages is\n * acknowledged when the /meta/connect returns.\n */\n return cometdModule.AckExtension = function() {\n var _cometd;\n var _serverSupportsAcks = false;\n var _batch;\n\n function _debug(text, args) {\n _cometd._debug(text, args);\n }\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _debug('AckExtension: executing registration callback');\n };\n\n this.unregistered = function() {\n _debug('AckExtension: executing unregistration callback');\n _cometd = null;\n };\n\n this.incoming = function(message) {\n var channel = message.channel;\n var ext = message.ext;\n if (channel === '/meta/handshake') {\n if (ext) {\n var ackField = ext.ack;\n if (typeof ackField === 'object') {\n // New format.\n _serverSupportsAcks = ackField.enabled === true;\n var batch = ackField.batch;\n if (typeof batch === 'number') {\n _batch = batch;\n }\n } else {\n // Old format.\n _serverSupportsAcks = ackField === true;\n }\n }\n _debug('AckExtension: server supports acknowledgements', _serverSupportsAcks);\n } else if (channel === '/meta/connect' && message.successful && _serverSupportsAcks) {\n if (ext && typeof ext.ack === 'number') {\n _batch = ext.ack;\n _debug('AckExtension: server sent batch', _batch);\n }\n }\n return message;\n };\n\n this.outgoing = function(message) {\n var channel = message.channel;\n if (!message.ext) {\n message.ext = {};\n }\n if (channel === '/meta/handshake') {\n message.ext.ack = _cometd && _cometd.ackEnabled !== false;\n _serverSupportsAcks = false;\n _batch = 0;\n } else if (channel === '/meta/connect') {\n if (_serverSupportsAcks) {\n message.ext.ack = _batch;\n _debug('AckExtension: client sending batch', _batch);\n }\n }\n return message;\n };\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,IAAI,EAAE,OAAO,CAAC;AACxB,IAAqC;AACrC,QAAQ,cAAc,GAAG,OAAO,CAACA,MAAmB,CAAC,CAAC;AACtD,KAIK;AACL,CAAC,CAACC,cAAI,EAAE,SAAS,YAAY,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,YAAY,CAAC,YAAY,GAAG,WAAW;AAClD,QAAQ,IAAI,OAAO,CAAC;AACpB,QAAQ,IAAI,mBAAmB,GAAG,KAAK,CAAC;AACxC,QAAQ,IAAI,MAAM,CAAC;AACnB;AACA,QAAQ,SAAS,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE;AACpC,YAAY,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACvC,SAAS;AACT;AACA,QAAQ,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,EAAE,MAAM,EAAE;AACjD,YAAY,OAAO,GAAG,MAAM,CAAC;AAC7B,YAAY,MAAM,CAAC,+CAA+C,CAAC,CAAC;AACpE,SAAS,CAAC;A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O,CAAC;AAC3B,SAAS,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,QAAQ,GAAG,SAAS,OAAO,EAAE;AAC1C,YAAY,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAC1C,YAAY,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC9B,gBAAgB,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;AACjC,aAAa;AACb,YAAY,IAAI,OAAO,KAAK,iBAAiB,EAAE;AAC/C,gBAAgB,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,KAAK,CAAC;AAC1E,gBAAgB,mBAAmB,GAAG,KAAK,CAAC;AAC5C,gBAAgB,MAAM,GAAG,CAAC,CAAC;AAC3B,aAAa,MAAM,IAAI,OAAO,KAAK,eAAe,EAAE;AACpD,gBAAgB,IAAI,mBAAmB,EAAE;AACzC,oBAAoB,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC;AAC7C,oBAAoB,MAAM,CAAC,oCAAoC,EAAE,MAAM,CAAC,CAAC;AACzE,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC,CAAC;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-8245daad.js';
2
- import { a as cometd } from './cometd-81ddc4ab.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-93aec770.js';
2
+ import { a as cometd } from './cometd-18cbd82a.js';
3
3
 
4
4
  function _mergeNamespaces(n, m) {
5
5
  m.forEach(function (e) {
@@ -250,4 +250,4 @@ var ReloadExtension$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces
250
250
  }, [ReloadExtension]));
251
251
 
252
252
  export { ReloadExtension$1 as R };
253
- //# sourceMappingURL=ReloadExtension-1e56f710.js.map
253
+ //# sourceMappingURL=ReloadExtension-0baee856.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReloadExtension-1e56f710.js","sources":["../../node_modules/cometd/ReloadExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory) {\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * The reload extension allows a page to be loaded (or reloaded)\n * without having to re-handshake in the new (or reloaded) page,\n * therefore resuming the existing CometD connection.\n *\n * When the reload() method is called, the state of the CometD\n * connection is stored in the window.sessionStorage object.\n * The reload() method must therefore be called by page unload\n * handlers, often provided by JavaScript toolkits.\n *\n * When the page is (re)loaded, this extension checks the\n * window.sessionStorage and restores the CometD connection,\n * maintaining the same CometD clientId.\n */\n return cometdModule.ReloadExtension = function(configuration) {\n var _cometd;\n var _debug;\n var _state = {};\n var _name = 'org.cometd.reload';\n var _batch = false;\n var _reloading = false;\n\n function _reload(config) {\n if (_state.handshakeResponse) {\n _reloading = true;\n var transport = _cometd.getTransport();\n if (transport) {\n transport.abort();\n }\n _configure(config);\n var state = JSON.stringify(_state);\n _debug('Reload extension saving state', state);\n window.sessionStorage.setItem(_name, state);\n }\n }\n\n function _similarState(oldState) {\n // We want to check here that the CometD object\n // did not change much between reloads.\n // We just check the URL for now, but in future\n // further checks may involve the transport type\n // and other configuration parameters.\n return _state.url === oldState.url;\n }\n\n function _configure(config) {\n if (config) {\n if (typeof config.name === 'string') {\n _name = config.name;\n }\n }\n }\n\n function _receive(response) {\n _cometd.receive(response);\n }\n\n this.configure = _configure;\n\n this._receive = _receive;\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _cometd.reload = _reload;\n _debug = _cometd._debug;\n };\n\n this.unregistered = function() {\n delete _cometd.reload;\n _cometd = null;\n };\n\n this.outgoing = function(message) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n _state = {};\n _state.url = _cometd.getURL();\n\n var state = window.sessionStorage.getItem(_name);\n _debug('Reload extension found state', state);\n // Is there a saved handshake response from a prior load ?\n if (state) {\n try {\n var oldState = JSON.parse(state);\n\n // Remove the state, not needed anymore\n window.sessionStorage.removeItem(_name);\n\n if (oldState.handshakeResponse && _similarState(oldState)) {\n _debug('Reload extension restoring state', oldState);\n\n // Since we are going to abort this message,\n // we must save an eventual callback to restore\n // it when we replay the handshake response.\n var callback = _cometd._getCallback(message.id);\n\n var self = this;\n setTimeout(function() {\n _debug('Reload extension replaying handshake response', oldState.handshakeResponse);\n _state.handshakeResponse = oldState.handshakeResponse;\n _state.transportType = oldState.transportType;\n\n // Restore the callback.\n _cometd._putCallback(message.id, callback);\n\n var response = _cometd._mixin(true, {}, _state.handshakeResponse, {\n // Keep the response message id the same as the request.\n id: message.id,\n // Tells applications this is a handshake replayed by the reload extension.\n ext: {\n reload: true\n }\n });\n // Use the same transport as before.\n response.supportedConnectionTypes = [_state.transportType];\n\n self._receive(response);\n _debug('Reload extension replayed handshake response', response);\n }, 0);\n\n // Delay any sends until first connect is complete.\n // This avoids that there is an old /meta/connect pending on server\n // that will be resumed to send messages to the client, when the\n // client has already closed the connection, thereby losing the messages.\n if (!_batch) {\n _batch = true;\n _cometd.startBatch();\n }\n\n // This handshake is aborted, as we will replay the prior handshake response\n return null;\n } else {\n _debug('Reload extension could not restore state', oldState);\n }\n } catch (x) {\n _debug('Reload extension error while trying to restore state', x);\n }\n }\n break;\n }\n case '/meta/connect':\n {\n if (_reloading === true) {\n // The reload causes the failure of the outstanding /meta/connect,\n // which CometD will react to by sending another. Here we avoid\n // that /meta/connect messages are sent between the reload and\n // the destruction of the JavaScript context, so that we are sure\n // that the first /meta/connect is the one triggered after the\n // replay of the /meta/handshake by this extension.\n _debug('Reload extension aborting /meta/connect during reload');\n return null;\n }\n\n if (!_state.transportType) {\n _state.transportType = message.connectionType;\n _debug('Reload extension tracked transport type', _state.transportType);\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n return message;\n };\n\n this.incoming = function(message) {\n if (message.successful) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n // If the handshake response is already present, then we're replaying it.\n // Since the replay may have modified the handshake response, do not record it here.\n if (!_state.handshakeResponse) {\n // Save successful handshake response\n _state.handshakeResponse = message;\n _debug('Reload extension tracked handshake response', message);\n }\n break;\n }\n case '/meta/connect':\n {\n if (_batch) {\n _batch = false;\n _cometd.endBatch();\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n }\n return message;\n };\n\n _configure(configuration);\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE;AACzB,IAAqC;AACrC,QAAQ,cAAc,GAAG,OAAO,CAACA,MAAmB,CAAC,CAAC;AACtD,KAIK;AACL,CAAC,CAACC,cAAI,EAAE,SAAS,YAAY,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,YAAY,CAAC,eAAe,GAAG,SAAS,aAAa,EAAE;AAClE,QAAQ,IAAI,OAAO,CAAC;AACpB,QAAQ,IAAI,MAAM,CAAC;AACnB,QAAQ,IAAI,MAAM,GAAG,EAAE,CAAC;AACxB,QAAQ,I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AM;AAC9B,qBAAqB;AACrB,oBAAoB,KAAK,eAAe;AACxC,oBAAoB;AACpB,wBAAwB,IAAI,MAAM,EAAE;AACpC,4BAA4B,MAAM,GAAG,KAAK,CAAC;AAC3C,4BAA4B,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC/C,yBAAyB;AACzB,wBAAwB,MAAM;AAC9B,qBAAqB;AACrB,oBAAoB,KAAK,kBAAkB;AAC3C,oBAAoB;AACpB,wBAAwB,MAAM,GAAG,EAAE,CAAC;AACpC,wBAAwB,MAAM;AAC9B,qBAAqB;AAKrB,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS,CAAC;AACV;AACA,QAAQ,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,CAAC,CAAC;;;;;;;;;;"}
1
+ {"version":3,"file":"ReloadExtension-0baee856.js","sources":["../../node_modules/cometd/ReloadExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory) {\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * The reload extension allows a page to be loaded (or reloaded)\n * without having to re-handshake in the new (or reloaded) page,\n * therefore resuming the existing CometD connection.\n *\n * When the reload() method is called, the state of the CometD\n * connection is stored in the window.sessionStorage object.\n * The reload() method must therefore be called by page unload\n * handlers, often provided by JavaScript toolkits.\n *\n * When the page is (re)loaded, this extension checks the\n * window.sessionStorage and restores the CometD connection,\n * maintaining the same CometD clientId.\n */\n return cometdModule.ReloadExtension = function(configuration) {\n var _cometd;\n var _debug;\n var _state = {};\n var _name = 'org.cometd.reload';\n var _batch = false;\n var _reloading = false;\n\n function _reload(config) {\n if (_state.handshakeResponse) {\n _reloading = true;\n var transport = _cometd.getTransport();\n if (transport) {\n transport.abort();\n }\n _configure(config);\n var state = JSON.stringify(_state);\n _debug('Reload extension saving state', state);\n window.sessionStorage.setItem(_name, state);\n }\n }\n\n function _similarState(oldState) {\n // We want to check here that the CometD object\n // did not change much between reloads.\n // We just check the URL for now, but in future\n // further checks may involve the transport type\n // and other configuration parameters.\n return _state.url === oldState.url;\n }\n\n function _configure(config) {\n if (config) {\n if (typeof config.name === 'string') {\n _name = config.name;\n }\n }\n }\n\n function _receive(response) {\n _cometd.receive(response);\n }\n\n this.configure = _configure;\n\n this._receive = _receive;\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _cometd.reload = _reload;\n _debug = _cometd._debug;\n };\n\n this.unregistered = function() {\n delete _cometd.reload;\n _cometd = null;\n };\n\n this.outgoing = function(message) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n _state = {};\n _state.url = _cometd.getURL();\n\n var state = window.sessionStorage.getItem(_name);\n _debug('Reload extension found state', state);\n // Is there a saved handshake response from a prior load ?\n if (state) {\n try {\n var oldState = JSON.parse(state);\n\n // Remove the state, not needed anymore\n window.sessionStorage.removeItem(_name);\n\n if (oldState.handshakeResponse && _similarState(oldState)) {\n _debug('Reload extension restoring state', oldState);\n\n // Since we are going to abort this message,\n // we must save an eventual callback to restore\n // it when we replay the handshake response.\n var callback = _cometd._getCallback(message.id);\n\n var self = this;\n setTimeout(function() {\n _debug('Reload extension replaying handshake response', oldState.handshakeResponse);\n _state.handshakeResponse = oldState.handshakeResponse;\n _state.transportType = oldState.transportType;\n\n // Restore the callback.\n _cometd._putCallback(message.id, callback);\n\n var response = _cometd._mixin(true, {}, _state.handshakeResponse, {\n // Keep the response message id the same as the request.\n id: message.id,\n // Tells applications this is a handshake replayed by the reload extension.\n ext: {\n reload: true\n }\n });\n // Use the same transport as before.\n response.supportedConnectionTypes = [_state.transportType];\n\n self._receive(response);\n _debug('Reload extension replayed handshake response', response);\n }, 0);\n\n // Delay any sends until first connect is complete.\n // This avoids that there is an old /meta/connect pending on server\n // that will be resumed to send messages to the client, when the\n // client has already closed the connection, thereby losing the messages.\n if (!_batch) {\n _batch = true;\n _cometd.startBatch();\n }\n\n // This handshake is aborted, as we will replay the prior handshake response\n return null;\n } else {\n _debug('Reload extension could not restore state', oldState);\n }\n } catch (x) {\n _debug('Reload extension error while trying to restore state', x);\n }\n }\n break;\n }\n case '/meta/connect':\n {\n if (_reloading === true) {\n // The reload causes the failure of the outstanding /meta/connect,\n // which CometD will react to by sending another. Here we avoid\n // that /meta/connect messages are sent between the reload and\n // the destruction of the JavaScript context, so that we are sure\n // that the first /meta/connect is the one triggered after the\n // replay of the /meta/handshake by this extension.\n _debug('Reload extension aborting /meta/connect during reload');\n return null;\n }\n\n if (!_state.transportType) {\n _state.transportType = message.connectionType;\n _debug('Reload extension tracked transport type', _state.transportType);\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n return message;\n };\n\n this.incoming = function(message) {\n if (message.successful) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n // If the handshake response is already present, then we're replaying it.\n // Since the replay may have modified the handshake response, do not record it here.\n if (!_state.handshakeResponse) {\n // Save successful handshake response\n _state.handshakeResponse = message;\n _debug('Reload extension tracked handshake response', message);\n }\n break;\n }\n case '/meta/connect':\n {\n if (_batch) {\n _batch = false;\n _cometd.endBatch();\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n }\n return message;\n };\n\n _configure(configuration);\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;A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C1B,iBAAiB;AAKjB,aAAa;AACb,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,QAAQ,GAAG,SAAS,OAAO,EAAE;AAC1C,YAAY,IAAI,OAAO,CAAC,UAAU,EAAE;AACpC,gBAAgB,QAAQ,OAAO,CAAC,OAAO;AACvC,oBAAoB,KAAK,iBAAiB;AAC1C,oBAAoB;AACpB;AACA;AACA,wBAAwB,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;AACvD;AACA,4BAA4B,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC;AAC/D,4BAA4B,MAAM,CAAC,6CAA6C,EAAE,OAAO,CAAC,CAAC;AAC3F,yBAAyB;AACzB,wBAAwB,MAAM;AAC9B,qBAAqB;AACrB,oBAAoB,KAAK,eAAe;AACxC,oBAAoB;AACpB,wBAAwB,IAAI,MAAM,EAAE;AACpC,4BAA4B,MAAM,GAAG,KAAK,CAAC;AAC3C,4BAA4B,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC/C,yBAAyB;AACzB,wBAAwB,MAAM;AAC9B,qBAAqB;AACrB,oBAAoB,KAAK,kBAAkB;AAC3C,oBAAoB;AACpB,wBAAwB,MAAM,GAAG,EAAE,CAAC;AACpC,wBAAwB,MAAM;AAC9B,qBAAqB;AAKrB,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS,CAAC;AACV;AACA,QAAQ,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,CAAC,CAAC;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-20ce1de2.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-93aec770.js';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -3435,4 +3435,4 @@ var cometd$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
3435
3435
  }, [cometd]));
3436
3436
 
3437
3437
  export { cometd as a, cometd$1 as c };
3438
- //# sourceMappingURL=cometd-e3796a33.js.map
3438
+ //# sourceMappingURL=cometd-18cbd82a.js.map