@onlyworlds/sdk 4.33.1 → 4.35.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.35.0] - 2026-10-20
9
+
10
+ ### Added
11
+
12
+ - **`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.
13
+
14
+ ## [4.34.0] - 2026-10-20
15
+
16
+ ### Added
17
+
18
+ - **`fieldLabel(name)`** and **`FIELD_ACRONYMS`**: a field name as the words a tool shows, by the house rule (OW Style, the Captain 2026-10-20): sentence case, acronyms kept wherever they fall (`birth_date` → "Birth date", `image_url` → "Image URL"). Seeded from Atlas's `humanizeFieldName` as of 1.59.1, so Atlas, Lantern and Council read one copy (h63 #8109, #8119). The name is taken as given: a tool that hides an extension prefix drops it first.
19
+
8
20
  ## [4.33.1] - 2026-10-19
9
21
 
10
22
  ### Fixed
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:
@@ -3328,6 +3334,27 @@ declare function elementColor(type: ElementType, mode?: 'light' | 'dark'): strin
3328
3334
  /** All four families, in ruling order (the order IS the CVD-safety mechanism of the source palette). */
3329
3335
  declare const FAMILY_ORDER: readonly ElementFamily[];
3330
3336
 
3337
+ /**
3338
+ * Field labels: the one rule for turning a field name into the words a tool shows.
3339
+ *
3340
+ * Presentation, not the standard: the schema never carries a label. The house rule
3341
+ * (OW Style, the Captain 2026-10-20, h63 #8074; Studio/style/RULES.md) is sentence case
3342
+ * with acronyms kept: "birth_date" → "Birth date", "image_url" → "Image URL". Seeded
3343
+ * from Atlas's humanizeFieldName as of 1.59.1 (Temper, h63 #8119), so Atlas, Lantern
3344
+ * and Council read one copy instead of three.
3345
+ */
3346
+ /** Words shown in capitals wherever they fall in a label. */
3347
+ declare const FIELD_ACRONYMS: readonly string[];
3348
+ /**
3349
+ * A field name as a label: split on `_`, the first word capitalised, every other word
3350
+ * lowercase, an acronym in capitals wherever it falls ("image_url" → "Image URL",
3351
+ * "url" → "URL", "time_range_current" → "Time range current").
3352
+ *
3353
+ * The name is taken as given: a tool that hides an extension prefix (`atlas_`, `x_`,
3354
+ * `shadow_`) drops it before calling this.
3355
+ */
3356
+ declare function fieldLabel(name: string): string;
3357
+
3331
3358
  /**
3332
3359
  * Current OnlyWorlds version
3333
3360
  * Synced with https://github.com/OnlyWorlds/OnlyWorlds/blob/main/VERSION
@@ -4215,4 +4242,4 @@ declare class TokenResource {
4215
4242
  getEncryptionInfo(): Promise<EncryptionInfo>;
4216
4243
  }
4217
4244
 
4218
- export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwSeat, type OwSeatCreated, OwSignInError, type OwSignInReason, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, type ParseError, type ParseOptions, type ParseResult, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
4245
+ export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwSeat, type OwSeatCreated, OwSignInError, type OwSignInReason, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, type ParseError, type ParseOptions, type ParseResult, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
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
  /**
@@ -1997,6 +2001,30 @@ function elementColor(type, mode = "dark") {
1997
2001
  }
1998
2002
  var FAMILY_ORDER = ["agents", "world", "abstract", "temporal"];
1999
2003
 
2004
+ // src/v2/labels.ts
2005
+ var FIELD_ACRONYMS = Object.freeze([
2006
+ "url",
2007
+ "id",
2008
+ "api",
2009
+ "ui",
2010
+ "ip",
2011
+ "html",
2012
+ "http",
2013
+ "dns",
2014
+ "uuid",
2015
+ "sdk",
2016
+ "pin",
2017
+ "gps"
2018
+ ]);
2019
+ var ACRONYM_SET = new Set(FIELD_ACRONYMS);
2020
+ function fieldLabel(name) {
2021
+ return name.split("_").map((word, i) => {
2022
+ const lower = word.toLowerCase();
2023
+ if (ACRONYM_SET.has(lower)) return lower.toUpperCase();
2024
+ return i === 0 ? lower.charAt(0).toUpperCase() + lower.slice(1) : lower;
2025
+ }).join(" ");
2026
+ }
2027
+
2000
2028
  // src/v2/constants.ts
2001
2029
  var ELEMENT_LABELS = {
2002
2030
  ability: "Abilities",
@@ -3408,6 +3436,7 @@ export {
3408
3436
  ELEMENT_TYPES,
3409
3437
  FAMILY_COLORS,
3410
3438
  FAMILY_ORDER,
3439
+ FIELD_ACRONYMS,
3411
3440
  FIELD_SCHEMA,
3412
3441
  FILE_EXTENSIONS,
3413
3442
  GameTier,
@@ -3436,6 +3465,7 @@ export {
3436
3465
  eraForStep,
3437
3466
  errorFromResponse,
3438
3467
  familyOf,
3468
+ fieldLabel,
3439
3469
  fileKindOf,
3440
3470
  floorDiv,
3441
3471
  floorMod,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.33.1",
3
+ "version": "4.35.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {