epicenter-libs 3.34.2 → 3.35.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.
- package/CHANGELOG.md +35 -0
- package/README.md +61 -86
- package/dist/browser/epicenter.js +1581 -226
- package/dist/browser/epicenter.js.map +1 -1
- package/dist/cjs/epicenter.js +1503 -141
- package/dist/cjs/epicenter.js.map +1 -1
- package/dist/epicenter.js +1587 -225
- package/dist/epicenter.js.map +1 -1
- package/dist/epicenter.min.js +1 -1
- package/dist/epicenter.min.js.map +1 -1
- package/dist/module/epicenter.js +1497 -142
- package/dist/module/epicenter.js.map +1 -1
- package/dist/types/adapters/docket.d.ts +80 -0
- package/dist/types/adapters/encyclopedia.d.ts +86 -0
- package/dist/types/adapters/file.d.ts +201 -0
- package/dist/types/adapters/git.d.ts +171 -0
- package/dist/types/adapters/index.d.ts +8 -1
- package/dist/types/adapters/pipeline.d.ts +88 -0
- package/dist/types/adapters/powerpoint.d.ts +130 -0
- package/dist/types/adapters/registration.d.ts +270 -0
- package/dist/types/adapters/task.d.ts +99 -37
- package/dist/types/epicenter.d.ts +2 -2
- package/dist/types/types.d.ts +6 -1
- package/dist/types/utils/router.d.ts +1 -0
- package/package.json +12 -7
- package/src/adapters/docket.ts +109 -0
- package/src/adapters/encyclopedia.ts +128 -0
- package/src/adapters/file.ts +332 -0
- package/src/adapters/git.ts +278 -0
- package/src/adapters/index.ts +14 -0
- package/src/adapters/pipeline.ts +145 -0
- package/src/adapters/powerpoint.ts +238 -0
- package/src/adapters/registration.ts +413 -0
- package/src/adapters/task.ts +170 -47
- package/src/epicenter.ts +10 -3
- package/src/globals.d.ts +6 -0
- package/src/types.ts +61 -0
- package/src/utils/router.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
# [3.35.0](https://github.com/forio/epicenter-libs/compare/v3.34.2...v3.35.0) (2026-07-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* correct privateKeySpec in examples and tests ([802ae14](https://github.com/forio/epicenter-libs/commit/802ae146edbf7c2b0c5ed8bba333546dd23b5244))
|
|
7
|
+
* fix required optionals.message errors ([d7266e6](https://github.com/forio/epicenter-libs/commit/d7266e67a43f5326ed467e9d5bd13d9584a0d242))
|
|
8
|
+
* resolve lockfile conflict ([ca6c8c1](https://github.com/forio/epicenter-libs/commit/ca6c8c18a49449eacf7f5620cc7fe61b1a9bb429))
|
|
9
|
+
* type task payload.target, ISO failSafeTermination, doc privileges ([79f613c](https://github.com/forio/epicenter-libs/commit/79f613cbfac11c0b2ddf02095625e9cbb3836f20))
|
|
10
|
+
* use a single build timestamp across all bundles ([27f8fdb](https://github.com/forio/epicenter-libs/commit/27f8fdb8795769bcdd68b1873be3b98449228872))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* complete task adapter contract ([7a8f40a](https://github.com/forio/epicenter-libs/commit/7a8f40a9c55c2881c58a30646a273b61d840e0b1))
|
|
16
|
+
* add docket adapter ([c59eebf](https://github.com/forio/epicenter-libs/commit/c59eebfb27bad4ec43a17f28823bc1a95afb8182))
|
|
17
|
+
* add encyclopedia adapter ([1fea349](https://github.com/forio/epicenter-libs/commit/1fea349f0b027aba1a38a1648b19a9d738566469))
|
|
18
|
+
* add file adapter ([a719fd5](https://github.com/forio/epicenter-libs/commit/a719fd521efe1427ba815b418813eb6024b11278))
|
|
19
|
+
* add git adapter ([20f3294](https://github.com/forio/epicenter-libs/commit/20f3294241baae88990890d4dcdfd951bf002bd6))
|
|
20
|
+
* add pipeline adapter ([f3271d6](https://github.com/forio/epicenter-libs/commit/f3271d66a676d2d7e8f8a8d6069b08a9445f036a))
|
|
21
|
+
* add powerpoint adapter ([7e825fd](https://github.com/forio/epicenter-libs/commit/7e825fd0d23b57f739bd984e10719d49268a4787))
|
|
22
|
+
* add registration adapter ([a848097](https://github.com/forio/epicenter-libs/commit/a848097525f0cae1b6c6ac9cabe7f097c9d6d04a))
|
|
23
|
+
* add taskAdapter.query wrapping GET /task/search ([d787069](https://github.com/forio/epicenter-libs/commit/d787069d29041dcbbb835595ae8a965b0c0731bb))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### BREAKING CHANGES
|
|
27
|
+
|
|
28
|
+
* `taskAdapter.getHistory()` and `taskAdapter.getTaskIn()` now resolve to a `Page` object instead of an array; read the records from `.values` (or use `.all()`/`.next()`/`.prev()`) rather than iterating the result directly.
|
|
29
|
+
* `taskAdapter.getHistory()` now resolves to `TaskHistoryReadOutView` records and no longer accepts `<Body, Headers>` type parameters (it was previously typed, incorrectly, as task read views).
|
|
30
|
+
* `taskAdapter.create()` `optionals.failSafeTermination` is now an ISO-8601 `string`; callers passing epoch milliseconds (`number`) must convert (e.g. `new Date(ms).toISOString()`).
|
|
31
|
+
* `taskAdapter.create()` payload `body` is now required, and `payload.method` is restricted to `'GET' | 'POST' | 'PUT' | 'DELETE'` (`PATCH` and other arbitrary strings are no longer accepted).
|
|
32
|
+
* `RETRY_POLICY.RESCHEDULE` has been removed (it was never accepted by the server); use `DO_NOTHING` or `FIRE_ON_FAIL_SAFE`.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
1
36
|
## [3.34.2](https://github.com/forio/epicenter-libs/compare/v3.34.1...v3.34.2) (2026-04-01)
|
|
2
37
|
|
|
3
38
|
|
package/README.md
CHANGED
|
@@ -2,22 +2,15 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
-
If you are comfortable with JavaScript,
|
|
5
|
+
If you are comfortable with JavaScript, epicenter-libs is an easy way to connect your project's model, data, and user interface.
|
|
6
6
|
|
|
7
7
|
Questions? Contact us at <support@forio.com> or file an issue on github!
|
|
8
8
|
|
|
9
|
-
JIRA (Forio internal): <https://
|
|
9
|
+
JIRA (Forio internal): <https://forio.atlassian.net/browse/EPILIBS>
|
|
10
10
|
|
|
11
11
|
## Table of Contents
|
|
12
12
|
|
|
13
|
-
- [
|
|
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)
|
|
13
|
+
- [Documentation](#documentation)
|
|
21
14
|
- [Tenets for Development](#tenets-for-development)
|
|
22
15
|
- [How to Contribute](#how-to-contribute)
|
|
23
16
|
- [How to Prepare a Release](#how-to-prepare-a-release)
|
|
@@ -28,62 +21,24 @@ JIRA (Forio internal): <https://issues.forio.com/projects/EPILIBS/issues>
|
|
|
28
21
|
- [npm dist-tag add | rm | ls](#npm-dist-tag-add--rm--ls)
|
|
29
22
|
- [Versioning](#versioning)
|
|
30
23
|
- [How to Test](#how-to-test)
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- All resources now have an associated scope to help categorize them -- e.g., project, group, episode, world.
|
|
41
|
-
|
|
42
|
-
- All resources now have an associated permit to help define permissions for roles (anonymous, participant, leader, reviewer, facilitator)
|
|
43
|
-
- Users now have a `displayName` for use in sims, detached from any private personal data
|
|
44
|
-
- Two new roles for end users:
|
|
45
|
-
- reviewer: a role similar to facilitators, but lower on the permissions hierarchy
|
|
46
|
-
- leader: a role similar to participants, but higher on the permissions hierarchy
|
|
47
|
-
- And more below...
|
|
48
|
-
|
|
49
|
-
### Some Things Were Renamed
|
|
50
|
-
|
|
51
|
-
- A bunch of user and run properties, among them --
|
|
52
|
-
- `userName → handle`
|
|
53
|
-
- `firstName → givenName`
|
|
54
|
-
- `lastName → familyName`
|
|
55
|
-
- `run.saved → run.marked`
|
|
56
|
-
- `run.trashed → run.hidden`
|
|
57
|
-
|
|
58
|
-
- Resources ID'd by `[RESOURCE]Id` (e.g., `runId`) now use `key` instead of `id` (so now it's `runKey`)
|
|
59
|
-
- `id` now refers to the long value of the row ID in the database instead
|
|
60
|
-
- All resource `key`s are GUIDs (globally unique IDs)
|
|
61
|
-
|
|
62
|
-
### Changes In The Way We Store And Expose User Data
|
|
63
|
-
|
|
64
|
-
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.
|
|
65
|
-
|
|
66
|
-
### Session Expiration & Generic Error Handling
|
|
67
|
-
|
|
68
|
-
- v3 authorization tokens can now expire after a period of inactivity, and become invalid after a world assignment change
|
|
69
|
-
|
|
70
|
-
- 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
|
|
71
|
-
|
|
72
|
-
### Built-in SSO Handling
|
|
73
|
-
|
|
74
|
-
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!
|
|
75
|
-
|
|
76
|
-
### Pagination
|
|
24
|
+
- [Transition Guide (v2 → v3)](#transition-guide-v2--v3)
|
|
25
|
+
- [New Features In v3](#new-features-in-v3)
|
|
26
|
+
- [Some Things Were Renamed](#some-things-were-renamed)
|
|
27
|
+
- [Changes In The Way We Store And Expose User Data](#changes-in-the-way-we-store-and-expose-user-data)
|
|
28
|
+
- [Session Expiration & Generic Error Handling](#session-expiration--generic-error-handling)
|
|
29
|
+
- [Built-in SSO Handling](#built-in-sso-handling)
|
|
30
|
+
- [Pagination](#pagination)
|
|
31
|
+
- [Presence](#presence)
|
|
77
32
|
|
|
78
|
-
|
|
33
|
+
## Documentation
|
|
79
34
|
|
|
80
|
-
-
|
|
81
|
-
- `end → page.firstResult + page.maxResults`
|
|
82
|
-
- `total → page.totalResults`
|
|
35
|
+
epicenter-libs is documented as part of the broader [Epicenter developer docs](https://docs.forio.com/epicenter), which also cover platform topics beyond the libraries (such as Interface Builder, models, and administration). The sections most relevant to working with the libraries are:
|
|
83
36
|
|
|
84
|
-
|
|
37
|
+
- [About the Libraries](https://docs.forio.com/epicenter/developer-concepts/about-the-libraries) — a higher-level overview of the libraries and the platform's core entities (worlds, groups, runs, and more).
|
|
38
|
+
- [About the Reference](https://docs.forio.com/epicenter/developer-reference/about-the-reference) — reference pages for each adapter's functions and entities, push channel implementation, and other utilities.
|
|
39
|
+
- [Developer Tutorials](https://docs.forio.com/epicenter/developer-tutorial/about) — ready-made starter-kit templates (single-player, multiplayer, leaderboard, and more) for getting an application up and running quickly.
|
|
85
40
|
|
|
86
|
-
|
|
41
|
+
Every exported function is also documented inline with JSDoc — descriptions plus usage examples — alongside complete TypeScript type definitions, so that documentation surfaces directly in your editor through autocomplete and hover.
|
|
87
42
|
|
|
88
43
|
## Tenets for Development
|
|
89
44
|
|
|
@@ -126,7 +81,7 @@ For doing a test run before actually publishing
|
|
|
126
81
|
|
|
127
82
|
#### npm publish --tag next
|
|
128
83
|
|
|
129
|
-
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
|
|
84
|
+
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 epicenter-libs@next` to go and play around with your changes.
|
|
130
85
|
|
|
131
86
|
#### npm unpublish epicenter-libs@{{version}}
|
|
132
87
|
|
|
@@ -145,40 +100,60 @@ The web development team isn't planning on incrementing the number that correlat
|
|
|
145
100
|
Tests are written to preserve behavior across releases. These are unit tests and are not intended for testing Epicenter features themselves.
|
|
146
101
|
|
|
147
102
|
```console
|
|
148
|
-
npm
|
|
103
|
+
npm ci # Installs dependencies for libs
|
|
149
104
|
npm run build # Builds libs to dist/ folder
|
|
150
105
|
npm run test:run # Runs the tests once
|
|
151
106
|
npm run test # Runs the tests w/ a watch
|
|
152
107
|
```
|
|
153
108
|
|
|
154
|
-
|
|
109
|
+
## Transition Guide (v2 → v3)
|
|
155
110
|
|
|
156
|
-
|
|
111
|
+
### New Features In v3
|
|
157
112
|
|
|
158
|
-
|
|
113
|
+
- All resources now have an associated scope to help categorize them -- e.g., project, group, episode, world.
|
|
159
114
|
|
|
160
|
-
|
|
115
|
+
- All resources now have an associated permit to help define permissions for roles (anonymous, participant, leader, reviewer, facilitator)
|
|
116
|
+
- Users now have a `displayName` for use in sims, detached from any private personal data
|
|
117
|
+
- Two new roles for end users:
|
|
118
|
+
- reviewer: a role similar to facilitators, but lower on the permissions hierarchy
|
|
119
|
+
- leader: a role similar to participants, but higher on the permissions hierarchy
|
|
120
|
+
- And more below...
|
|
161
121
|
|
|
162
|
-
###
|
|
122
|
+
### Some Things Were Renamed
|
|
163
123
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
```
|
|
124
|
+
- A bunch of user and run properties, among them --
|
|
125
|
+
- `userName → handle`
|
|
126
|
+
- `firstName → givenName`
|
|
127
|
+
- `lastName → familyName`
|
|
128
|
+
- `run.saved → run.marked`
|
|
129
|
+
- `run.trashed → run.hidden`
|
|
171
130
|
|
|
172
|
-
|
|
131
|
+
- Resources ID'd by `[RESOURCE]Id` (e.g., `runId`) now use `key` instead of `id` (so now it's `runKey`)
|
|
132
|
+
- `id` now refers to the long value of the row ID in the database instead
|
|
133
|
+
- All resource `key`s are GUIDs (globally unique IDs)
|
|
173
134
|
|
|
174
|
-
|
|
175
|
-
npm install # Installs dependencies for libs
|
|
176
|
-
npm run build # Builds libs to dist/ folder
|
|
177
|
-
cd examples/node
|
|
178
|
-
npm install # Install dependencies for example
|
|
179
|
-
npm start
|
|
180
|
-
```
|
|
135
|
+
### Changes In The Way We Store And Expose User Data
|
|
181
136
|
|
|
182
|
-
|
|
137
|
+
User information has been separated out to better support 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 maintain a record while allowing for easy removal of user-sensitive data when requested.
|
|
138
|
+
|
|
139
|
+
### Session Expiration & Generic Error Handling
|
|
140
|
+
|
|
141
|
+
- v3 authorization tokens can now expire after a period of inactivity, and become invalid after a world assignment change
|
|
142
|
+
|
|
143
|
+
- 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
|
|
183
144
|
|
|
184
|
-
|
|
145
|
+
### Built-in SSO Handling
|
|
146
|
+
|
|
147
|
+
On load, epicenter-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!
|
|
148
|
+
|
|
149
|
+
### Pagination
|
|
150
|
+
|
|
151
|
+
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:
|
|
152
|
+
|
|
153
|
+
- `first → page.firstResult`
|
|
154
|
+
- `end → page.firstResult + page.maxResults`
|
|
155
|
+
- `total → page.totalResults`
|
|
156
|
+
|
|
157
|
+
### Presence
|
|
158
|
+
|
|
159
|
+
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).
|