@superbuilders/primer-tives 5.0.0 → 5.0.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.
- package/README.md +8 -0
- package/dist/client/index.js +6 -1
- package/dist/client/index.js.map +5 -5
- package/dist/client/session.d.ts.map +1 -1
- package/dist/client/transport.d.ts.map +1 -1
- package/dist/errors.d.ts +2 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +3 -1
- package/dist/errors.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -898,6 +898,7 @@ Fatal sentinels:
|
|
|
898
898
|
| Sentinel | Meaning |
|
|
899
899
|
| --- | --- |
|
|
900
900
|
| `ErrBadRequest` | Primer rejected the runtime request as invalid for the SDK contract. |
|
|
901
|
+
| `ErrCurriculumInstructionalUndeliverable` | The active curriculum instructional has no deliverable frame content. |
|
|
901
902
|
| `ErrInvalidAccessToken` | The learner token was rejected. |
|
|
902
903
|
| `ErrTokenExpired` | The learner token expired. |
|
|
903
904
|
| `ErrForbidden` | The learner is not allowed to continue in this runtime scope. |
|
|
@@ -1275,6 +1276,7 @@ import {
|
|
|
1275
1276
|
ErrAuthUnavailable,
|
|
1276
1277
|
ErrBadRequest,
|
|
1277
1278
|
ErrConflict,
|
|
1279
|
+
ErrCurriculumInstructionalUndeliverable,
|
|
1278
1280
|
ErrForbidden,
|
|
1279
1281
|
ErrInvalidAccessToken,
|
|
1280
1282
|
ErrInvalidSubmission,
|
|
@@ -1322,6 +1324,7 @@ Runtime errors are represented as `ErroredState` or `FatalState`.
|
|
|
1322
1324
|
| `ErrJsonParse` | `ErroredState` | yes | Runtime data could not be interpreted as the SDK contract. |
|
|
1323
1325
|
| `ErrInvalidSubmission` | `ErroredState` | no | Renderer submitted a value that is invalid for the active interaction. |
|
|
1324
1326
|
| `ErrBadRequest` | `FatalState` | no | Runtime request violates the SDK contract. |
|
|
1327
|
+
| `ErrCurriculumInstructionalUndeliverable` | `FatalState` | no | Curriculum routing reached an instructional with no deliverable frame content. |
|
|
1325
1328
|
| `ErrInvalidAccessToken` | `FatalState` | no | Learner token is invalid. |
|
|
1326
1329
|
| `ErrTokenExpired` | `FatalState` | no | Learner token expired. |
|
|
1327
1330
|
| `ErrForbidden` | `FatalState` | no | Learner cannot continue in this runtime scope. |
|
|
@@ -1389,6 +1392,10 @@ if (state.phase === "fatal") {
|
|
|
1389
1392
|
renderSdkUpgradeMessage()
|
|
1390
1393
|
return
|
|
1391
1394
|
}
|
|
1395
|
+
if (errors.is(state.error, ErrCurriculumInstructionalUndeliverable)) {
|
|
1396
|
+
renderContentUnavailableMessage()
|
|
1397
|
+
return
|
|
1398
|
+
}
|
|
1392
1399
|
logger.error({ error: state.error }, "primer fatal state")
|
|
1393
1400
|
throw state.error
|
|
1394
1401
|
}
|
|
@@ -1462,6 +1469,7 @@ The runtime exchange shape is not public SDK surface. Tests should assert SDK se
|
|
|
1462
1469
|
| first runtime work fails recoverably | `start` resolves to `ErroredState` with `retriable: true` |
|
|
1463
1470
|
| first runtime work fails terminally | `start` resolves to `FatalState` |
|
|
1464
1471
|
| unsupported PCI is presented | `start` resolves to `FatalState` with `ErrUnsupportedPci` |
|
|
1472
|
+
| curriculum instructional has no deliverable content | transition resolves to `FatalState` with `ErrCurriculumInstructionalUndeliverable` |
|
|
1465
1473
|
| standard submission is invalid | submit method resolves to `ErroredState` with `ErrInvalidSubmission` |
|
|
1466
1474
|
| concurrent submit/timeout conflict occurs | transition resolves to `ErroredState` with `ErrConflict` |
|
|
1467
1475
|
| state is serialized | serialization throws `ErrNotSerializable` |
|
package/dist/client/index.js
CHANGED
|
@@ -6279,6 +6279,7 @@ var ErrAuthStateMismatch = errors.new("auth state mismatch");
|
|
|
6279
6279
|
var ErrAuthPopupBlocked = errors.new("auth popup blocked");
|
|
6280
6280
|
var ErrAuthCancelled = errors.new("auth cancelled");
|
|
6281
6281
|
var ErrSdkUpgradeRequired = errors.new("sdk upgrade required");
|
|
6282
|
+
var ErrCurriculumInstructionalUndeliverable = errors.new("curriculum instructional undeliverable");
|
|
6282
6283
|
// src/contracts/content.ts
|
|
6283
6284
|
function inlinesToPlainText(nodes) {
|
|
6284
6285
|
const parts = [];
|
|
@@ -7751,6 +7752,7 @@ function textEntryState(ctx, body, stimulus, interaction, feedback) {
|
|
|
7751
7752
|
// src/client/session.ts
|
|
7752
7753
|
var FATAL_SENTINELS = [
|
|
7753
7754
|
ErrBadRequest,
|
|
7755
|
+
ErrCurriculumInstructionalUndeliverable,
|
|
7754
7756
|
ErrInvalidAccessToken,
|
|
7755
7757
|
ErrTokenExpired,
|
|
7756
7758
|
ErrForbidden,
|
|
@@ -8004,6 +8006,9 @@ function httpSentinel(status, body) {
|
|
|
8004
8006
|
if (parsed?.error === "sdk_upgrade_required") {
|
|
8005
8007
|
return ErrSdkUpgradeRequired;
|
|
8006
8008
|
}
|
|
8009
|
+
if (parsed?.error === "curriculum_instructional_undeliverable") {
|
|
8010
|
+
return ErrCurriculumInstructionalUndeliverable;
|
|
8011
|
+
}
|
|
8007
8012
|
return ErrBadRequest;
|
|
8008
8013
|
}
|
|
8009
8014
|
if (status === 401) {
|
|
@@ -8269,4 +8274,4 @@ export {
|
|
|
8269
8274
|
start
|
|
8270
8275
|
};
|
|
8271
8276
|
|
|
8272
|
-
//# debugId=
|
|
8277
|
+
//# debugId=5F7821132D289BDA64756E2164756E21
|