@onlyworlds/sdk 4.33.1 → 4.34.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.34.0] - 2026-10-20
9
+
10
+ ### Added
11
+
12
+ - **`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.
13
+
8
14
  ## [4.33.1] - 2026-10-19
9
15
 
10
16
  ### Fixed
package/dist/index.d.ts CHANGED
@@ -3328,6 +3328,27 @@ declare function elementColor(type: ElementType, mode?: 'light' | 'dark'): strin
3328
3328
  /** All four families, in ruling order (the order IS the CVD-safety mechanism of the source palette). */
3329
3329
  declare const FAMILY_ORDER: readonly ElementFamily[];
3330
3330
 
3331
+ /**
3332
+ * Field labels: the one rule for turning a field name into the words a tool shows.
3333
+ *
3334
+ * Presentation, not the standard: the schema never carries a label. The house rule
3335
+ * (OW Style, the Captain 2026-10-20, h63 #8074; Studio/style/RULES.md) is sentence case
3336
+ * with acronyms kept: "birth_date" → "Birth date", "image_url" → "Image URL". Seeded
3337
+ * from Atlas's humanizeFieldName as of 1.59.1 (Temper, h63 #8119), so Atlas, Lantern
3338
+ * and Council read one copy instead of three.
3339
+ */
3340
+ /** Words shown in capitals wherever they fall in a label. */
3341
+ declare const FIELD_ACRONYMS: readonly string[];
3342
+ /**
3343
+ * A field name as a label: split on `_`, the first word capitalised, every other word
3344
+ * lowercase, an acronym in capitals wherever it falls ("image_url" → "Image URL",
3345
+ * "url" → "URL", "time_range_current" → "Time range current").
3346
+ *
3347
+ * The name is taken as given: a tool that hides an extension prefix (`atlas_`, `x_`,
3348
+ * `shadow_`) drops it before calling this.
3349
+ */
3350
+ declare function fieldLabel(name: string): string;
3351
+
3331
3352
  /**
3332
3353
  * Current OnlyWorlds version
3333
3354
  * Synced with https://github.com/OnlyWorlds/OnlyWorlds/blob/main/VERSION
@@ -4215,4 +4236,4 @@ declare class TokenResource {
4215
4236
  getEncryptionInfo(): Promise<EncryptionInfo>;
4216
4237
  }
4217
4238
 
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 };
4239
+ 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
@@ -1997,6 +1997,30 @@ function elementColor(type, mode = "dark") {
1997
1997
  }
1998
1998
  var FAMILY_ORDER = ["agents", "world", "abstract", "temporal"];
1999
1999
 
2000
+ // src/v2/labels.ts
2001
+ var FIELD_ACRONYMS = Object.freeze([
2002
+ "url",
2003
+ "id",
2004
+ "api",
2005
+ "ui",
2006
+ "ip",
2007
+ "html",
2008
+ "http",
2009
+ "dns",
2010
+ "uuid",
2011
+ "sdk",
2012
+ "pin",
2013
+ "gps"
2014
+ ]);
2015
+ var ACRONYM_SET = new Set(FIELD_ACRONYMS);
2016
+ function fieldLabel(name) {
2017
+ return name.split("_").map((word, i) => {
2018
+ const lower = word.toLowerCase();
2019
+ if (ACRONYM_SET.has(lower)) return lower.toUpperCase();
2020
+ return i === 0 ? lower.charAt(0).toUpperCase() + lower.slice(1) : lower;
2021
+ }).join(" ");
2022
+ }
2023
+
2000
2024
  // src/v2/constants.ts
2001
2025
  var ELEMENT_LABELS = {
2002
2026
  ability: "Abilities",
@@ -3408,6 +3432,7 @@ export {
3408
3432
  ELEMENT_TYPES,
3409
3433
  FAMILY_COLORS,
3410
3434
  FAMILY_ORDER,
3435
+ FIELD_ACRONYMS,
3411
3436
  FIELD_SCHEMA,
3412
3437
  FILE_EXTENSIONS,
3413
3438
  GameTier,
@@ -3436,6 +3461,7 @@ export {
3436
3461
  eraForStep,
3437
3462
  errorFromResponse,
3438
3463
  familyOf,
3464
+ fieldLabel,
3439
3465
  fileKindOf,
3440
3466
  floorDiv,
3441
3467
  floorMod,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.33.1",
3
+ "version": "4.34.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {