@onlyworlds/sdk 4.174.0 → 4.175.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 +10 -0
- package/dist/index.d.ts +12 -5
- package/dist/index.js +19 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.175.0] - 2026-11-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`OwApiError.isHostBlocked`: a write the host refused before the API saw it.** The host in front of onlyworlds.com answers some writes with a 403 whose body is an HTML page titled "Blocked", not the API's JSON envelope: 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. Such an error read "OnlyWorlds API error 403" until now. It now says the host refused the request and nothing was written, and how to write the command so it passes (a fenced code block whose first line names a language, or no backtick). `code` stays null, as it is no API code, and `detail` keeps the page. Read on the page's title and on the body not being JSON, so the API's own 403s read as before.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **`removeSeat`'s description** says when the Character a seat plays goes with it: only while it is as the seat's join left it (made by the join, named as the seat, supertype `Agent` alone, last written by the join, linked from nothing and played by no one else). Any other stays, one given to the seat to play included.
|
|
17
|
+
|
|
8
18
|
## [4.174.0] - 2026-11-16
|
|
9
19
|
|
|
10
20
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -4245,6 +4245,14 @@ declare class OwApiError extends Error {
|
|
|
4245
4245
|
readonly retryAfter: number | null;
|
|
4246
4246
|
constructor(status: number, code: string | null, message: string, docUrl: string | null, detail: unknown, type?: string | null, param?: string | null, retryAfter?: number | null);
|
|
4247
4247
|
get isAuthError(): boolean;
|
|
4248
|
+
/**
|
|
4249
|
+
* The host in front of onlyworlds.com refused the request before the API saw it: a 403 whose body is an HTML
|
|
4250
|
+
* page titled "Blocked", not the API's JSON envelope. Nothing was written. The host refuses text that holds a
|
|
4251
|
+
* shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after
|
|
4252
|
+
* a backtick, a semicolon or a pipe; such a command passes in a fenced code block whose first line names a
|
|
4253
|
+
* language, or without the backtick. `code` is null (it is no API code) and `detail` keeps the page.
|
|
4254
|
+
*/
|
|
4255
|
+
get isHostBlocked(): boolean;
|
|
4248
4256
|
/** 422s/400s name the offending param/field -- typos error loudly platform-wide. */
|
|
4249
4257
|
get isValidationError(): boolean;
|
|
4250
4258
|
/**
|
|
@@ -4570,9 +4578,6 @@ declare class OwSignInError extends Error {
|
|
|
4570
4578
|
retryAfter?: number;
|
|
4571
4579
|
});
|
|
4572
4580
|
}
|
|
4573
|
-
/** Parse a wire envelope into OwApiError parts (exported for the error type-tests). */
|
|
4574
|
-
/** Parse the platform ERROR envelope into an OwApiError. (Renamed from parseEnvelope in 4.0 —
|
|
4575
|
-
* distinct from the world-export envelope, which is a different artifact entirely.) */
|
|
4576
4581
|
declare function parseErrorEnvelope(status: number, body: unknown, retryAfter?: number | null): OwApiError;
|
|
4577
4582
|
/** Build an OwApiError from a non-2xx response, tolerating non-JSON bodies. */
|
|
4578
4583
|
declare function errorFromResponse(res: Response): Promise<OwApiError>;
|
|
@@ -5397,8 +5402,10 @@ declare class OwV2Client {
|
|
|
5397
5402
|
rekeySeat(worldId: string, seatId: string): Promise<OwSeatCreated>;
|
|
5398
5403
|
/**
|
|
5399
5404
|
* DELETE /account/worlds/{worldId}/seats/{seatId} -- remove an agent seat: its sponsor or the
|
|
5400
|
-
* world's owner may. Its key and secret stop at once;
|
|
5401
|
-
*
|
|
5405
|
+
* world's owner may. Its key and secret stop at once; the Character it plays goes with it only
|
|
5406
|
+
* while it is as the join left one (made by the join, named as the seat, supertype `Agent` alone,
|
|
5407
|
+
* last written by the join, linked from nothing, played by no one else); any other stays, one
|
|
5408
|
+
* given to the seat to play included. Needs the client's `ow_a_` token.
|
|
5402
5409
|
*/
|
|
5403
5410
|
removeSeat(worldId: string, seatId: string): Promise<void>;
|
|
5404
5411
|
/**
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,16 @@ var OwApiError = class extends Error {
|
|
|
124
124
|
get isAuthError() {
|
|
125
125
|
return this.code === "invalid_credentials" || this.code === "key_revoked" || this.code === "world_gone";
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The host in front of onlyworlds.com refused the request before the API saw it: a 403 whose body is an HTML
|
|
129
|
+
* page titled "Blocked", not the API's JSON envelope. Nothing was written. The host refuses text that holds a
|
|
130
|
+
* shell command such as `python -m`, `python -c`, `perl -e`, or `curl` or `wget` with an address right after
|
|
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 without the backtick. `code` is null (it is no API code) and `detail` keeps the page.
|
|
133
|
+
*/
|
|
134
|
+
get isHostBlocked() {
|
|
135
|
+
return isHostBlockedPage(this.status, this.detail);
|
|
136
|
+
}
|
|
127
137
|
/** 422s/400s name the offending param/field -- typos error loudly platform-wide. */
|
|
128
138
|
get isValidationError() {
|
|
129
139
|
return this.status === 422 || this.status === 400;
|
|
@@ -517,7 +527,12 @@ var OwSignInError = class extends Error {
|
|
|
517
527
|
if (opts.retryAfter !== void 0) this.retryAfter = opts.retryAfter;
|
|
518
528
|
}
|
|
519
529
|
};
|
|
530
|
+
function isHostBlockedPage(status, body) {
|
|
531
|
+
return status === 403 && typeof body === "string" && /<title[^>]*>\s*Blocked\s*<\/title>/i.test(body);
|
|
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 without the backtick.';
|
|
520
534
|
function parseErrorEnvelope(status, body, retryAfter = null) {
|
|
535
|
+
if (isHostBlockedPage(status, body)) return new OwApiError(status, null, HOST_BLOCKED_MESSAGE, null, body, null, null, retryAfter);
|
|
521
536
|
const env = body && typeof body === "object" ? body : {};
|
|
522
537
|
const nested = typeof env.error === "object" && env.error !== null ? env.error : void 0;
|
|
523
538
|
const code = env.code ?? nested?.code ?? (typeof env.error === "string" ? env.error : null) ?? null;
|
|
@@ -1831,8 +1846,10 @@ var OwV2Client = class {
|
|
|
1831
1846
|
}
|
|
1832
1847
|
/**
|
|
1833
1848
|
* DELETE /account/worlds/{worldId}/seats/{seatId} -- remove an agent seat: its sponsor or the
|
|
1834
|
-
* world's owner may. Its key and secret stop at once;
|
|
1835
|
-
*
|
|
1849
|
+
* world's owner may. Its key and secret stop at once; the Character it plays goes with it only
|
|
1850
|
+
* while it is as the join left one (made by the join, named as the seat, supertype `Agent` alone,
|
|
1851
|
+
* last written by the join, linked from nothing, played by no one else); any other stays, one
|
|
1852
|
+
* given to the seat to play included. Needs the client's `ow_a_` token.
|
|
1836
1853
|
*/
|
|
1837
1854
|
async removeSeat(worldId, seatId) {
|
|
1838
1855
|
if (this.keyKind !== "account") {
|