@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 +6 -0
- package/dist/index.d.ts +11 -9
- package/dist/index.js +7 -2
- 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.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
|
|
3889
|
-
* `
|
|
3890
|
-
* against the file's first bytes. A file's name ends in its kind's
|
|
3891
|
-
* yaml and `.
|
|
3892
|
-
|
|
3893
|
-
|
|
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
|
|
5662
|
-
*
|
|
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() ?? "";
|