@onlyworlds/sdk 4.34.0 → 4.36.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,18 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.36.0] - 2026-10-20
9
+
10
+ ### Changed
11
+
12
+ - **`fieldLabel`** keeps a word written all in capitals as written (`STR` reads "STR", `plan_B` "Plan B"), so a custom stat block reads the same in every tool (Temper, h63 #8197; Lantern and Atlas both call it). Schema field names are all lowercase, so no schema label changes.
13
+
14
+ ## [4.35.0] - 2026-10-20
15
+
16
+ ### Added
17
+
18
+ - **`createWorldLink(worldId, { preview })`** and `preview` on `OwWorldLink` (keel #422 PR 1, live 2026-10-20): a person or player link with `preview: true` is `/join/<world_id>#<code>`, so a chat that unfurls it shows the world's name and picture; the code stays in the fragment. Absent means off, as keel rules for the API; `true` on an agent link is 422, param `preview`. The wire gate failed on production's document until this release.
19
+
8
20
  ## [4.34.0] - 2026-10-20
9
21
 
10
22
  ### Added
package/dist/index.d.ts CHANGED
@@ -2249,6 +2249,8 @@ interface OwWorldLink {
2249
2249
  /** 0 or 1: a link works once. */
2250
2250
  uses: number;
2251
2251
  status: 'pending' | 'used' | 'revoked' | 'expired';
2252
+ /** Whether the link shows the world's name and picture when it is pasted into a chat (keel #422): then the link is `/join/<world_id>#<code>`, else `/join#<code>`. Never on an agent link. */
2253
+ preview?: boolean;
2252
2254
  /** A player link only: the Character the player reads as; null while a link for a fresh Character is unused. `name` is null if that Character was deleted (the redeem then makes a fresh one). */
2253
2255
  character?: {
2254
2256
  id: string;
@@ -2260,7 +2262,7 @@ interface OwWorldLink {
2260
2262
  interface OwCreatedWorldLink extends OwWorldLink {
2261
2263
  /** The `ow_j_` join code. Shown once; it can never be read again. */
2262
2264
  code: string;
2263
- /** The invite link: the /join page with the code after `#`. */
2265
+ /** The invite link: the /join page (`/join/<world_id>` when `preview` is on) with the code after `#`. */
2264
2266
  link: string;
2265
2267
  /** The one line to send: who invites, to which world, and the link. */
2266
2268
  line: string;
@@ -3142,7 +3144,10 @@ declare class OwV2Client {
3142
3144
  * redeemJoin for a read key, keel #353); `role`, when left out, is keel's default: guest for a
3143
3145
  * person link, contributor for an agent link (a player link is guest, and refuses any other), `days` (1, 7 or 30) to 7; `withCharacter` (agent links
3144
3146
  * only) to true; `character` (player links only) a Character's id or `new` (the default):
3145
- * whoever opens the link first reads as it, until removed. 201 with the code, shown in this
3147
+ * whoever opens the link first reads as it, until removed. `preview` (person and player links,
3148
+ * keel #422) to false: true puts the world's id in the link's path, so a chat that unfurls it
3149
+ * shows the world's name and picture (the code stays after `#`); true on an agent link is
3150
+ * 422, param `preview`. 201 with the code, shown in this
3146
3151
  * answer only. Owner only: anyone else, and a world that doesn't exist, gets 404
3147
3152
  * `not_found` (`err.isNotFound`). A world key is a TypeError before anything is sent.
3148
3153
  */
@@ -3153,6 +3158,7 @@ declare class OwV2Client {
3153
3158
  inviterName?: string;
3154
3159
  withCharacter?: boolean;
3155
3160
  character?: string;
3161
+ preview?: boolean;
3156
3162
  }): Promise<OwCreatedWorldLink>;
3157
3163
  /**
3158
3164
  * GET /account/worlds/{worldId}/links -- the world's invite links, without their codes:
@@ -3342,7 +3348,10 @@ declare const FIELD_ACRONYMS: readonly string[];
3342
3348
  /**
3343
3349
  * A field name as a label: split on `_`, the first word capitalised, every other word
3344
3350
  * lowercase, an acronym in capitals wherever it falls ("image_url" → "Image URL",
3345
- * "url" → "URL", "time_range_current" → "Time range current").
3351
+ * "url" → "URL", "time_range_current" → "Time range current"). A word written all in
3352
+ * capitals stays as written: a custom field named `STR` reads "STR"
3353
+ * (Lantern's stat blocks; Temper, h63 #8197). Every schema field name is lowercase, so this
3354
+ * reaches only names a person or tool chose.
3346
3355
  *
3347
3356
  * The name is taken as given: a tool that hides an extension prefix (`atlas_`, `x_`,
3348
3357
  * `shadow_`) drops it before calling this.
package/dist/index.js CHANGED
@@ -902,7 +902,10 @@ var OwV2Client = class {
902
902
  * redeemJoin for a read key, keel #353); `role`, when left out, is keel's default: guest for a
903
903
  * person link, contributor for an agent link (a player link is guest, and refuses any other), `days` (1, 7 or 30) to 7; `withCharacter` (agent links
904
904
  * only) to true; `character` (player links only) a Character's id or `new` (the default):
905
- * whoever opens the link first reads as it, until removed. 201 with the code, shown in this
905
+ * whoever opens the link first reads as it, until removed. `preview` (person and player links,
906
+ * keel #422) to false: true puts the world's id in the link's path, so a chat that unfurls it
907
+ * shows the world's name and picture (the code stays after `#`); true on an agent link is
908
+ * 422, param `preview`. 201 with the code, shown in this
906
909
  * answer only. Owner only: anyone else, and a world that doesn't exist, gets 404
907
910
  * `not_found` (`err.isNotFound`). A world key is a TypeError before anything is sent.
908
911
  */
@@ -916,6 +919,7 @@ var OwV2Client = class {
916
919
  if (opts.inviterName !== void 0) body.inviter_name = opts.inviterName;
917
920
  if (opts.withCharacter !== void 0) body.with_character = opts.withCharacter;
918
921
  if (opts.character !== void 0) body.character = opts.character;
922
+ if (opts.preview !== void 0) body.preview = opts.preview;
919
923
  return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/links`, { body });
920
924
  }
921
925
  /**
@@ -2017,6 +2021,7 @@ function fieldLabel(name) {
2017
2021
  return name.split("_").map((word, i) => {
2018
2022
  const lower = word.toLowerCase();
2019
2023
  if (ACRONYM_SET.has(lower)) return lower.toUpperCase();
2024
+ if (/[A-Z]/.test(word) && word === word.toUpperCase()) return word;
2020
2025
  return i === 0 ? lower.charAt(0).toUpperCase() + lower.slice(1) : lower;
2021
2026
  }).join(" ");
2022
2027
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.34.0",
3
+ "version": "4.36.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {