@onlyworlds/sdk 4.147.0 → 4.148.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 CHANGED
@@ -5,6 +5,12 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.148.0] - 2026-11-10
9
+
10
+ ### Added
11
+
12
+ - **A file on an element can be an image**: `OwFileKind` gains `png`, `jpg`, `webp` and `avif`, and `FILE_EXTENSIONS` (so `fileKindOf`, `createFileTicket` and `uploadFile`) reads `.png`, `.jpg`, `.jpeg` (kind `jpg`), `.webp` and `.avif`, as onlyworlds.com now takes them. `uploadFile(type, id, file)` with `screen.png` sends instead of refusing before the request. An image file is private to the element's readers like every file, and is not the element's picture (`image_url`). `.svg` and `.gif` are still refused before sending.
13
+
8
14
  ## [4.147.0] - 2026-11-10
9
15
 
10
16
  ### Added
package/dist/index.d.ts CHANGED
@@ -3885,12 +3885,14 @@ interface OwUploadedImage {
3885
3885
  [k: string]: unknown;
3886
3886
  }
3887
3887
  /**
3888
- * What a file on an element can be (keel `FileKind`): text (`txt`, `md`, `json`, `csv`,
3889
- * `yaml`, `toml`), `pdf`, and `zip` only as a world's own bundle. The upload host checks each
3890
- * against the file's first bytes. A file's name ends in its kind's extension; `.yml` counts as
3891
- * yaml and `.markdown` as md.
3892
- */
3893
- type OwFileKind = 'pdf' | 'txt' | 'md' | 'json' | 'csv' | 'yaml' | 'toml' | 'zip';
3888
+ * What a file on an element can be: text (`txt`, `md`, `json`, `csv`, `yaml`, `toml`), `pdf`,
3889
+ * `zip` only as a world's own bundle, and an image (`png`, `jpg`, `webp`, `avif`; no svg or gif).
3890
+ * The upload host checks each against the file's first bytes. A file's name ends in its kind's
3891
+ * extension; `.yml` counts as yaml, `.markdown` as md and `.jpeg` as jpg. An image file is private
3892
+ * to the element's readers like any file and is served as a download, not as an element's
3893
+ * picture (that is `image_url`).
3894
+ */
3895
+ type OwFileKind = 'pdf' | 'txt' | 'md' | 'json' | 'csv' | 'yaml' | 'toml' | 'zip' | 'png' | 'jpg' | 'webp' | 'avif';
3894
3896
  /** Who added a file. */
3895
3897
  interface OwFileAddedBy {
3896
3898
  /** A member's or a seat's name; the owner's username for the owner's keys. */
@@ -5063,7 +5065,7 @@ declare class OwV2Client {
5063
5065
  * (the ticket's file is already stored: an earlier send with this ticket succeeded, so the
5064
5066
  * file is there), 413 `too_large`, 415 `unsupported_type` (the bytes are not the kind:
5065
5067
  * a pdf must start as one, a text file must be UTF-8 with no NUL in its first 8 KB, a zip
5066
- * must be a world's own bundle; nothing is stored and the ticket is still unspent), 502
5068
+ * must be a world's own bundle, an image must be the kind its first bytes say; nothing is stored and the ticket is still unspent), 502
5067
5069
  * `write_failed` (nothing stored; the ticket is still unspent). A ticket is spent once the
5068
5070
  * upload succeeds: another file needs a new one.
5069
5071
  */
@@ -5658,8 +5660,8 @@ declare class OwV2Client {
5658
5660
  }): Promise<T>;
5659
5661
  }
5660
5662
  /**
5661
- * Every extension a file on an element may end in, to the kind it gives: keel's NAME_EXTS
5662
- * (files/service.py), `.yml` and `.markdown` included. A file picker's accept list is
5663
+ * Every extension a file on an element may end in, to the kind it gives, as onlyworlds.com reads
5664
+ * a name: `.yml`, `.markdown` and `.jpeg` included. A file picker's accept list is
5663
5665
  * `Object.keys(FILE_EXTENSIONS).map((e) => '.' + e)`.
5664
5666
  */
5665
5667
  declare const FILE_EXTENSIONS: Readonly<Record<string, OwFileKind>>;
package/dist/index.js CHANGED
@@ -1428,7 +1428,7 @@ var OwV2Client = class {
1428
1428
  * (the ticket's file is already stored: an earlier send with this ticket succeeded, so the
1429
1429
  * file is there), 413 `too_large`, 415 `unsupported_type` (the bytes are not the kind:
1430
1430
  * a pdf must start as one, a text file must be UTF-8 with no NUL in its first 8 KB, a zip
1431
- * must be a world's own bundle; nothing is stored and the ticket is still unspent), 502
1431
+ * must be a world's own bundle, an image must be the kind its first bytes say; nothing is stored and the ticket is still unspent), 502
1432
1432
  * `write_failed` (nothing stored; the ticket is still unspent). A ticket is spent once the
1433
1433
  * upload succeeds: another file needs a new one.
1434
1434
  */
@@ -2510,7 +2510,12 @@ var FILE_EXTENSIONS = Object.freeze({
2510
2510
  yaml: "yaml",
2511
2511
  yml: "yaml",
2512
2512
  toml: "toml",
2513
- zip: "zip"
2513
+ zip: "zip",
2514
+ png: "png",
2515
+ jpg: "jpg",
2516
+ jpeg: "jpg",
2517
+ webp: "webp",
2518
+ avif: "avif"
2514
2519
  });
2515
2520
  function fileKindOf(name) {
2516
2521
  const base = name.split(/[\\/]/).pop() ?? "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.147.0",
3
+ "version": "4.148.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {