@onlyworlds/sdk 4.42.2 → 4.42.4
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 +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.42.4] - 2026-10-21
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **`parseDate` refuses a date the typed era does not hold**, rather than reading its number as an absolute year in another era. With a down era Before Gate turning on 6 Frost, "10 Thaw, 1 BG" read as step 39 ("10 Thaw, 2 AG") and "3 Frost, 0 BG" as "3 Frost, 1 BG"; both now answer `not a date in Before Gate`. The absolute reading stays for a step in no era, where `formatStep` prints the absolute year. No date `formatStep` prints changes how it parses: 20,826 round trips over the profile fixture's calendars read the same before and after. Found by Temper in Atlas 1.67.1 (OW Council h58 #9304).
|
|
12
|
+
|
|
13
|
+
## [4.42.3] - 2026-10-21
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **`parseDate` reads a down era's dates back to the step they were written from, with a mid-year pivot too.** 4.42.2 moved the display count to the year holding the step before the pivot, and the parse kept the old count, so with a mid-year pivot every date before it parsed back one year early ("6 Frost, 4 BG" read 20 steps early on a 20-step year). Year-boundary pivots were never affected. Found by Quillon porting 4.42.2 to the Unity SDK and confirmed on this kernel by Temper (OW Council h58 #8962, #9111); a round-trip test now holds every step on both sides of the pivot.
|
|
17
|
+
- `redeemJoin`'s doc names a full world's refusal as 422 `world_full` (`isWorldFull`), as keel answers since the party link; it said `invalid_request` (Quillon, OW Keel h29 #9038).
|
|
18
|
+
|
|
8
19
|
## [4.42.2] - 2026-10-20
|
|
9
20
|
|
|
10
21
|
Two calendar reading fixes, found writing the `atlas_calendar` profile's conformance fixture (OW Council h58 #8943, #8946).
|
package/dist/index.d.ts
CHANGED
|
@@ -3278,7 +3278,7 @@ declare class OwV2Client {
|
|
|
3278
3278
|
* deleted since, or none sent, is 422 `invalid_request`, param `character`
|
|
3279
3279
|
* (`err.isCharacterInvalid`; read the preview again). With no list
|
|
3280
3280
|
* (`name_required`), send `name` and no `character`: the player's fresh Character takes the
|
|
3281
|
-
* name (missing: 422, param `name`). A world with its 50 players is 422 `
|
|
3281
|
+
* name (missing: 422, param `name`). A world with its 50 players is 422 `world_full` (`err.isWorldFull`);
|
|
3282
3282
|
* the last place taken by someone else first is the one 404. A refusal spends nothing. A link
|
|
3283
3283
|
* for one ignores `character`.
|
|
3284
3284
|
*/
|
package/dist/index.js
CHANGED
|
@@ -843,7 +843,7 @@ var OwV2Client = class {
|
|
|
843
843
|
* deleted since, or none sent, is 422 `invalid_request`, param `character`
|
|
844
844
|
* (`err.isCharacterInvalid`; read the preview again). With no list
|
|
845
845
|
* (`name_required`), send `name` and no `character`: the player's fresh Character takes the
|
|
846
|
-
* name (missing: 422, param `name`). A world with its 50 players is 422 `
|
|
846
|
+
* name (missing: 422, param `name`). A world with its 50 players is 422 `world_full` (`err.isWorldFull`);
|
|
847
847
|
* the last place taken by someone else first is the one 404. A refusal spends nothing. A link
|
|
848
848
|
* for one ignores `character`.
|
|
849
849
|
*/
|
|
@@ -3238,7 +3238,7 @@ function formatMidLabel(cfg, step) {
|
|
|
3238
3238
|
function absYearForEraYear(cfg, era, Y) {
|
|
3239
3239
|
if (era.restart === false) return Y;
|
|
3240
3240
|
const base = era.year_base ?? 1;
|
|
3241
|
-
if ((era.direction ?? "up") === "down") return absoluteYear(cfg, era.start) - (Y - base
|
|
3241
|
+
if ((era.direction ?? "up") === "down") return absoluteYear(cfg, era.start - 1) - (Y - base);
|
|
3242
3242
|
return absoluteYear(cfg, era.start) + (Y - base);
|
|
3243
3243
|
}
|
|
3244
3244
|
function defaultEra(cfg, now) {
|
|
@@ -3348,7 +3348,11 @@ function parseDate(cfg, input, opts = {}) {
|
|
|
3348
3348
|
const viaEra = resolveInYear(absYearForEraYear(cfg, target, year));
|
|
3349
3349
|
if (isParseError(viaEra)) return viaEra;
|
|
3350
3350
|
if (eraForStep(cfg, viaEra.step) === target) return viaEra;
|
|
3351
|
-
|
|
3351
|
+
const viaAbs = resolveInYear(year);
|
|
3352
|
+
if (era && !isParseError(viaAbs) && eraForStep(cfg, viaAbs.step) !== null) {
|
|
3353
|
+
return { error: `not a date in ${era.name}` };
|
|
3354
|
+
}
|
|
3355
|
+
return viaAbs;
|
|
3352
3356
|
}
|
|
3353
3357
|
function isParseError(r) {
|
|
3354
3358
|
return r.error !== void 0;
|