@onlyworlds/sdk 4.52.0 → 4.53.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 +6 -0
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.53.0] - 2026-10-22
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **The last seven options objects refuse an unknown key** too: `patch` and `editLinks` (`ifMatch`; the edit itself is `{add, remove}`), `uploadImage`, `createFileTicket`, `uploadFile`, `createWorldLink` and `createSeat`. With 4.51.0 and 4.52.0 every method of the client that takes an object now names a stray key before anything is sent; a client that drops a key it does not know has no place left.
|
|
13
|
+
|
|
8
14
|
## [4.52.0] - 2026-10-22
|
|
9
15
|
|
|
10
16
|
### Changed
|
package/dist/index.js
CHANGED
|
@@ -673,6 +673,7 @@ var OwV2Client = class {
|
|
|
673
673
|
* it for today's unconditional write.
|
|
674
674
|
*/
|
|
675
675
|
async patch(type, id, partial, opts = {}) {
|
|
676
|
+
only("patch", opts, ["ifMatch"]);
|
|
676
677
|
refuseKnownOf(partial, "patch");
|
|
677
678
|
return this.request("PATCH", `/${type}/${id}/`, { write: true, body: sanitizePayload(partial), ifMatch: opts.ifMatch });
|
|
678
679
|
}
|
|
@@ -692,6 +693,8 @@ var OwV2Client = class {
|
|
|
692
693
|
* moves the element too.
|
|
693
694
|
*/
|
|
694
695
|
async editLinks(type, id, field, edit, opts = {}) {
|
|
696
|
+
only("editLinks", opts, ["ifMatch"]);
|
|
697
|
+
only("editLinks", edit, ["add", "remove"], "The edit is { add?: string[], remove?: string[] }.");
|
|
695
698
|
return this.request("POST", `/${type}/${id}/links/${field}`, { write: true, body: edit, ifMatch: opts.ifMatch });
|
|
696
699
|
}
|
|
697
700
|
/**
|
|
@@ -841,6 +844,7 @@ var OwV2Client = class {
|
|
|
841
844
|
* needs a new one.
|
|
842
845
|
*/
|
|
843
846
|
async uploadImage(image, opts = {}) {
|
|
847
|
+
only("uploadImage", opts, ["key", "ticket"]);
|
|
844
848
|
const ticket = opts.ticket ?? await this.createMediaTicket();
|
|
845
849
|
const size = typeof Blob !== "undefined" && image instanceof Blob ? image.size : image.byteLength;
|
|
846
850
|
if (size > ticket.max_bytes) {
|
|
@@ -944,6 +948,7 @@ var OwV2Client = class {
|
|
|
944
948
|
* `retryAfter`; 503 `media_unavailable`.
|
|
945
949
|
*/
|
|
946
950
|
async createFileTicket(type, id, req) {
|
|
951
|
+
only("createFileTicket", req, ["name", "kind", "size", "label"]);
|
|
947
952
|
const { name, size } = req;
|
|
948
953
|
if (typeof name !== "string" || name.trim() === "") {
|
|
949
954
|
throw new TypeError("createFileTicket needs the file's name, with its extension");
|
|
@@ -984,6 +989,7 @@ var OwV2Client = class {
|
|
|
984
989
|
* upload succeeds: another file needs a new one.
|
|
985
990
|
*/
|
|
986
991
|
async uploadFile(type, id, file, opts = {}) {
|
|
992
|
+
only("uploadFile", opts, ["name", "kind", "label", "ticket", "onProgress"]);
|
|
987
993
|
const size = typeof Blob !== "undefined" && file instanceof Blob ? file.size : file.byteLength;
|
|
988
994
|
let ticket = opts.ticket;
|
|
989
995
|
if (!ticket) {
|
|
@@ -1249,6 +1255,7 @@ var OwV2Client = class {
|
|
|
1249
1255
|
* `not_found` (`err.isNotFound`). A world key is a TypeError before anything is sent.
|
|
1250
1256
|
*/
|
|
1251
1257
|
async createWorldLink(worldId, opts) {
|
|
1258
|
+
only("createWorldLink", opts, ["reader", "role", "days", "inviterName", "withCharacter", "character", "preview", "maxUses", "characters"]);
|
|
1252
1259
|
if (this.keyKind !== "account") {
|
|
1253
1260
|
throw new TypeError("createWorldLink needs an account token (ow_a_): only the world's owner makes links");
|
|
1254
1261
|
}
|
|
@@ -1300,6 +1307,7 @@ var OwV2Client = class {
|
|
|
1300
1307
|
* its key: rekeySeat gives it a new one (or removeSeat and make another). Needs the client's `ow_a_` token.
|
|
1301
1308
|
*/
|
|
1302
1309
|
async createSeat(worldId, opts) {
|
|
1310
|
+
only("createSeat", opts, ["name", "role", "character"]);
|
|
1303
1311
|
if (this.keyKind !== "account") {
|
|
1304
1312
|
throw new TypeError("createSeat needs an account token (ow_a_): a seat is made by the person who answers for it");
|
|
1305
1313
|
}
|