@onlyworlds/sdk 4.177.0 → 4.178.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/CHANGELOG.md +25 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +2 -2
- package/package.json +14 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,31 @@
|
|
|
3
3
|
All notable changes to `@onlyworlds/sdk`. Maintained from 3.1.0 onward;
|
|
4
4
|
earlier history lives in git log only.
|
|
5
5
|
|
|
6
|
-
## [
|
|
6
|
+
## [4.178.1] - 2026-11-17
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- **Installing the package into a plain JavaScript project no longer installs TypeScript.** TypeScript was a required peer, so npm placed the newest compiler beside the package in every project, used or not: two of the four packages a first `npm install @onlyworlds/sdk` added. It is an optional peer now: a TypeScript project brings its own (4.5 or later, as before) and a JavaScript project gets the package and `fflate`, nothing else.
|
|
11
|
+
- **`@onlyworlds/sdk/waymark` has types in a project on the older module resolution.** With `moduleResolution` set to `node` (or `node10`), which does not read a package's `exports`, the import answered TS2307, "Cannot find module", while the package root's types were found. The package now carries a `typesVersions` entry for the subpath. Projects on `node16`, `nodenext` or `bundler` were not affected and read the same files as before. Read with TypeScript 4.5, 4.7, 5.0, 5.9, 6.0 and 7.0 against the packed build.
|
|
12
|
+
|
|
13
|
+
### Tests
|
|
14
|
+
|
|
15
|
+
- **What a TypeScript project is handed is compiled, under each module resolution.** A new test type-checks a consumer of the built package's root and `/waymark` subpath on `node`, `node16` and `bundler`, and holds every typed subpath of `exports` to its `typesVersions` entry and the peer to optional.
|
|
16
|
+
|
|
17
|
+
- **Node 18 is tested.** `package.json` admits Node 18 and later, and the suite ran on 20 and 22 only. It now runs on 18 as well, with one flag: Sign in with OnlyWorlds needs Web Crypto as a global, which Node has from 19 on and Node 18 only when started with `--experimental-global-webcrypto`. Without it `signInWithOnlyWorlds` and `pkceChallenge` refuse with a `TypeError` that names Web Crypto, storing and opening nothing (a new test holds that on every Node), and the rest of the package runs.
|
|
18
|
+
- **Node 24 is tested**, beside 18, 20 and 22.
|
|
19
|
+
- **The build and the tests install from a committed lockfile.** `package-lock.json` was ignored, so every CI run and every release installed whatever the version ranges resolved to that day, and `npm ci || npm install` hid that there was no lockfile to install from. It is committed now and CI and the release run `npm ci`. Nothing changes for a project that installs the package: a lockfile is not published.
|
|
20
|
+
- **happy-dom 21.0.4**, which only the tests use (the Waymark's DOM), past a published advisory on 21.0.3 and earlier (GHSA-834v-8h66-3h79). It is a development dependency and never part of the published package.
|
|
21
|
+
|
|
22
|
+
## [4.178.0] - 2026-11-17
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **`by_role` on every row of a draught's `work`**, which `GET /character/{id}/context` now serves: the ids of her Titles that the work item names, each once, in the item's order, and an empty list when none does. Work is for her by name (the item's `actor`) or by a role she holds (the item's `x_packet_for` names a Title whose `holders` name her), and a row that reached her only through a Title has `via` `['holders']`. Read as her (`mode: 'voice'`) a work item reaches her only through a field of its own that names her, so a caller asks with `mode: 'act'` for what is hers by role.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **The message for a write the host refused says the whole way out.** The same command passes in a fenced code block whose first line names a language, or with no backtick, semicolon or pipe directly before it; the message named only the backtick.
|
|
7
31
|
|
|
8
32
|
## [4.177.0] - 2026-11-17
|
|
9
33
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3618,9 +3618,17 @@ interface OwDraught {
|
|
|
3618
3618
|
element: OwElement;
|
|
3619
3619
|
} | null;
|
|
3620
3620
|
role?: OwDraughtItem[];
|
|
3621
|
-
/**
|
|
3621
|
+
/**
|
|
3622
|
+
* Her open work: Relations with supertype `Work item` and subtype `open` or `taken` that are for her, by name
|
|
3623
|
+
* (`actor` is her) or by a role she holds (`x_packet_for` names a Title whose `holders` name her). Each row adds
|
|
3624
|
+
* `packet`, the item's `x_packet_elements` (`[]` when it has none), and `by_role`, the ids of her Titles the item
|
|
3625
|
+
* names, each once, in the item's order (`[]` when none does). A row that reached her only through a Title has
|
|
3626
|
+
* `via` `['holders']`. Read as her (`mode: 'voice'`) a work item reaches her only through a field of its own
|
|
3627
|
+
* that names her: ask with `mode: 'act'` for what is hers by role.
|
|
3628
|
+
*/
|
|
3622
3629
|
work?: Array<OwDraughtItem & {
|
|
3623
3630
|
packet: Array<Record<string, unknown>>;
|
|
3631
|
+
by_role: string[];
|
|
3624
3632
|
}>;
|
|
3625
3633
|
style?: OwDraughtItem | null;
|
|
3626
3634
|
events?: OwDraughtItem[];
|
|
@@ -4278,7 +4286,7 @@ declare class OwApiError extends Error {
|
|
|
4278
4286
|
* page titled "Blocked", not the API's JSON envelope. Nothing was written. The host refuses text that holds a
|
|
4279
4287
|
* shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after
|
|
4280
4288
|
* a backtick, a semicolon or a pipe; such a command passes in a fenced code block whose first line names a
|
|
4281
|
-
* language, or
|
|
4289
|
+
* language, or with none of the three directly before it. `code` is null (it is no API code) and `detail` keeps the page.
|
|
4282
4290
|
*/
|
|
4283
4291
|
get isHostBlocked(): boolean;
|
|
4284
4292
|
/** 422s/400s name the offending param/field -- typos error loudly platform-wide. */
|
package/dist/index.js
CHANGED
|
@@ -129,7 +129,7 @@ var OwApiError = class extends Error {
|
|
|
129
129
|
* page titled "Blocked", not the API's JSON envelope. Nothing was written. The host refuses text that holds a
|
|
130
130
|
* shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after
|
|
131
131
|
* a backtick, a semicolon or a pipe; such a command passes in a fenced code block whose first line names a
|
|
132
|
-
* language, or
|
|
132
|
+
* language, or with none of the three directly before it. `code` is null (it is no API code) and `detail` keeps the page.
|
|
133
133
|
*/
|
|
134
134
|
get isHostBlocked() {
|
|
135
135
|
return isHostBlockedPage(this.status, this.detail);
|
|
@@ -530,7 +530,7 @@ var OwSignInError = class extends Error {
|
|
|
530
530
|
function isHostBlockedPage(status, body) {
|
|
531
531
|
return status === 403 && typeof body === "string" && /<title[^>]*>\s*Blocked\s*<\/title>/i.test(body);
|
|
532
532
|
}
|
|
533
|
-
var HOST_BLOCKED_MESSAGE = 'The host in front of onlyworlds.com refused this request before the API saw it (a 403 page titled "Blocked"), and nothing was written. It refuses text that holds a shell command such as python -m, python -c, perl -e, or curl or wget with an address, right after a backtick, a semicolon or a pipe. Put such a command in a fenced code block whose first line names a language, or write it
|
|
533
|
+
var HOST_BLOCKED_MESSAGE = 'The host in front of onlyworlds.com refused this request before the API saw it (a 403 page titled "Blocked"), and nothing was written. It refuses text that holds a shell command such as python -m, python -c, perl -e, or curl or wget with an address, right after a backtick, a semicolon or a pipe. Put such a command in a fenced code block whose first line names a language, or write it with none of the three directly before it.';
|
|
534
534
|
function parseErrorEnvelope(status, body, retryAfter = null) {
|
|
535
535
|
if (isHostBlockedPage(status, body)) return new OwApiError(status, null, HOST_BLOCKED_MESSAGE, null, body, null, null, retryAfter);
|
|
536
536
|
const env = body && typeof body === "object" ? body : {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlyworlds/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.178.1",
|
|
4
4
|
"description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"types": "dist/index.d.ts",
|
|
19
|
+
"typesVersions": {
|
|
20
|
+
"*": {
|
|
21
|
+
"waymark": [
|
|
22
|
+
"dist/waymark.d.ts"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
19
26
|
"sideEffects": [
|
|
20
27
|
"*.css"
|
|
21
28
|
],
|
|
@@ -60,13 +67,18 @@
|
|
|
60
67
|
"url": "https://github.com/OnlyWorlds/sdk/issues"
|
|
61
68
|
},
|
|
62
69
|
"devDependencies": {
|
|
63
|
-
"happy-dom": "^
|
|
70
|
+
"happy-dom": "^21.0.4",
|
|
64
71
|
"tsup": "^8.0.1",
|
|
65
72
|
"typescript": "^5.3.3"
|
|
66
73
|
},
|
|
67
74
|
"peerDependencies": {
|
|
68
75
|
"typescript": ">=4.5.0"
|
|
69
76
|
},
|
|
77
|
+
"peerDependenciesMeta": {
|
|
78
|
+
"typescript": {
|
|
79
|
+
"optional": true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
70
82
|
"engines": {
|
|
71
83
|
"node": ">=18.0.0"
|
|
72
84
|
},
|