@onlyworlds/sdk 1.3.0 → 1.3.1

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/dist/index.d.mts CHANGED
@@ -824,6 +824,17 @@ declare enum ElementType {
824
824
  Trait = "trait",
825
825
  Zone = "zone"
826
826
  }
827
+ /**
828
+ * UI labels for element types - provides proper plural forms
829
+ * Useful for displaying element type names in user interfaces
830
+ */
831
+ declare const ELEMENT_LABELS: Record<ElementType, string>;
832
+ /**
833
+ * Get the plural label for an element type
834
+ * @param elementType The element type
835
+ * @returns The plural label string
836
+ */
837
+ declare function getElementLabel(elementType: ElementType): string;
827
838
  /**
828
839
  * Field type definitions for OnlyWorlds elements
829
840
  */
@@ -2278,4 +2289,4 @@ declare class OnlyWorldsClient {
2278
2289
  static prepareInput<T extends Record<string, any>>(data: T): any;
2279
2290
  }
2280
2291
 
2281
- export { type Ability, type AbilityInput, type AnyElementId, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, type ElementId, type ElementIds, ElementType, type Event, type EventInput, FIELD_MAPPINGS, FIELD_SCHEMA, type Family, type FamilyInput, type FieldInfo, type FieldMappingsType, type FieldType, type Institution, type InstitutionInput, type Language, type LanguageInput, type Law, type LawInput, type ListOptions, type Location, type LocationInput, type Map, type MapInput, type Marker, type MarkerInput, type Narrative, type NarrativeInput, type Object$1 as Object, type ObjectInput, OnlyWorldsClient, type OnlyWorldsConfig, type Phenomenon, type PhenomenonInput, type Pin, type PinInput, type Relation, type RelationInput, type Species, type SpeciesInput, type Title, type TitleInput, type Trait, type TraitInput, type World, type WorldInput, type Zone, type ZoneInput, createAnyElementId, createElementId, createElementIds };
2292
+ export { type Ability, type AbilityInput, type AnyElementId, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ELEMENT_LABELS, type ElementId, type ElementIds, ElementType, type Event, type EventInput, FIELD_MAPPINGS, FIELD_SCHEMA, type Family, type FamilyInput, type FieldInfo, type FieldMappingsType, type FieldType, type Institution, type InstitutionInput, type Language, type LanguageInput, type Law, type LawInput, type ListOptions, type Location, type LocationInput, type Map, type MapInput, type Marker, type MarkerInput, type Narrative, type NarrativeInput, type Object$1 as Object, type ObjectInput, OnlyWorldsClient, type OnlyWorldsConfig, type Phenomenon, type PhenomenonInput, type Pin, type PinInput, type Relation, type RelationInput, type Species, type SpeciesInput, type Title, type TitleInput, type Trait, type TraitInput, type World, type WorldInput, type Zone, type ZoneInput, createAnyElementId, createElementId, createElementIds, getElementLabel };
package/dist/index.d.ts CHANGED
@@ -824,6 +824,17 @@ declare enum ElementType {
824
824
  Trait = "trait",
825
825
  Zone = "zone"
826
826
  }
827
+ /**
828
+ * UI labels for element types - provides proper plural forms
829
+ * Useful for displaying element type names in user interfaces
830
+ */
831
+ declare const ELEMENT_LABELS: Record<ElementType, string>;
832
+ /**
833
+ * Get the plural label for an element type
834
+ * @param elementType The element type
835
+ * @returns The plural label string
836
+ */
837
+ declare function getElementLabel(elementType: ElementType): string;
827
838
  /**
828
839
  * Field type definitions for OnlyWorlds elements
829
840
  */
@@ -2278,4 +2289,4 @@ declare class OnlyWorldsClient {
2278
2289
  static prepareInput<T extends Record<string, any>>(data: T): any;
2279
2290
  }
2280
2291
 
2281
- export { type Ability, type AbilityInput, type AnyElementId, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, type ElementId, type ElementIds, ElementType, type Event, type EventInput, FIELD_MAPPINGS, FIELD_SCHEMA, type Family, type FamilyInput, type FieldInfo, type FieldMappingsType, type FieldType, type Institution, type InstitutionInput, type Language, type LanguageInput, type Law, type LawInput, type ListOptions, type Location, type LocationInput, type Map, type MapInput, type Marker, type MarkerInput, type Narrative, type NarrativeInput, type Object$1 as Object, type ObjectInput, OnlyWorldsClient, type OnlyWorldsConfig, type Phenomenon, type PhenomenonInput, type Pin, type PinInput, type Relation, type RelationInput, type Species, type SpeciesInput, type Title, type TitleInput, type Trait, type TraitInput, type World, type WorldInput, type Zone, type ZoneInput, createAnyElementId, createElementId, createElementIds };
2292
+ export { type Ability, type AbilityInput, type AnyElementId, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ELEMENT_LABELS, type ElementId, type ElementIds, ElementType, type Event, type EventInput, FIELD_MAPPINGS, FIELD_SCHEMA, type Family, type FamilyInput, type FieldInfo, type FieldMappingsType, type FieldType, type Institution, type InstitutionInput, type Language, type LanguageInput, type Law, type LawInput, type ListOptions, type Location, type LocationInput, type Map, type MapInput, type Marker, type MarkerInput, type Narrative, type NarrativeInput, type Object$1 as Object, type ObjectInput, OnlyWorldsClient, type OnlyWorldsConfig, type Phenomenon, type PhenomenonInput, type Pin, type PinInput, type Relation, type RelationInput, type Species, type SpeciesInput, type Title, type TitleInput, type Trait, type TraitInput, type World, type WorldInput, type Zone, type ZoneInput, createAnyElementId, createElementId, createElementIds, getElementLabel };
package/dist/index.js CHANGED
@@ -20,13 +20,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ELEMENT_LABELS: () => ELEMENT_LABELS,
23
24
  ElementType: () => ElementType,
24
25
  FIELD_MAPPINGS: () => FIELD_MAPPINGS,
25
26
  FIELD_SCHEMA: () => FIELD_SCHEMA,
26
27
  OnlyWorldsClient: () => OnlyWorldsClient,
27
28
  createAnyElementId: () => createAnyElementId,
28
29
  createElementId: () => createElementId,
29
- createElementIds: () => createElementIds
30
+ createElementIds: () => createElementIds,
31
+ getElementLabel: () => getElementLabel
30
32
  });
31
33
  module.exports = __toCommonJS(index_exports);
32
34
 
@@ -176,6 +178,33 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
176
178
  ElementType2["Zone"] = "zone";
177
179
  return ElementType2;
178
180
  })(ElementType || {});
181
+ var ELEMENT_LABELS = {
182
+ ["ability" /* Ability */]: "Abilities",
183
+ ["character" /* Character */]: "Characters",
184
+ ["collective" /* Collective */]: "Collectives",
185
+ ["construct" /* Construct */]: "Constructs",
186
+ ["creature" /* Creature */]: "Creatures",
187
+ ["event" /* Event */]: "Events",
188
+ ["family" /* Family */]: "Families",
189
+ ["institution" /* Institution */]: "Institutions",
190
+ ["language" /* Language */]: "Languages",
191
+ ["law" /* Law */]: "Laws",
192
+ ["location" /* Location */]: "Locations",
193
+ ["map" /* Map */]: "Maps",
194
+ ["marker" /* Marker */]: "Markers",
195
+ ["narrative" /* Narrative */]: "Narratives",
196
+ ["object" /* Object */]: "Objects",
197
+ ["phenomenon" /* Phenomenon */]: "Phenomena",
198
+ ["pin" /* Pin */]: "Pins",
199
+ ["relation" /* Relation */]: "Relations",
200
+ ["species" /* Species */]: "Species",
201
+ ["title" /* Title */]: "Titles",
202
+ ["trait" /* Trait */]: "Traits",
203
+ ["zone" /* Zone */]: "Zones"
204
+ };
205
+ function getElementLabel(elementType) {
206
+ return ELEMENT_LABELS[elementType];
207
+ }
179
208
  var FIELD_SCHEMA = {
180
209
  ability: {
181
210
  // Text fields
@@ -643,11 +672,13 @@ function createAnyElementId(id) {
643
672
  }
644
673
  // Annotate the CommonJS export names for ESM import in node:
645
674
  0 && (module.exports = {
675
+ ELEMENT_LABELS,
646
676
  ElementType,
647
677
  FIELD_MAPPINGS,
648
678
  FIELD_SCHEMA,
649
679
  OnlyWorldsClient,
650
680
  createAnyElementId,
651
681
  createElementId,
652
- createElementIds
682
+ createElementIds,
683
+ getElementLabel
653
684
  });
package/dist/index.mjs CHANGED
@@ -144,6 +144,33 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
144
144
  ElementType2["Zone"] = "zone";
145
145
  return ElementType2;
146
146
  })(ElementType || {});
147
+ var ELEMENT_LABELS = {
148
+ ["ability" /* Ability */]: "Abilities",
149
+ ["character" /* Character */]: "Characters",
150
+ ["collective" /* Collective */]: "Collectives",
151
+ ["construct" /* Construct */]: "Constructs",
152
+ ["creature" /* Creature */]: "Creatures",
153
+ ["event" /* Event */]: "Events",
154
+ ["family" /* Family */]: "Families",
155
+ ["institution" /* Institution */]: "Institutions",
156
+ ["language" /* Language */]: "Languages",
157
+ ["law" /* Law */]: "Laws",
158
+ ["location" /* Location */]: "Locations",
159
+ ["map" /* Map */]: "Maps",
160
+ ["marker" /* Marker */]: "Markers",
161
+ ["narrative" /* Narrative */]: "Narratives",
162
+ ["object" /* Object */]: "Objects",
163
+ ["phenomenon" /* Phenomenon */]: "Phenomena",
164
+ ["pin" /* Pin */]: "Pins",
165
+ ["relation" /* Relation */]: "Relations",
166
+ ["species" /* Species */]: "Species",
167
+ ["title" /* Title */]: "Titles",
168
+ ["trait" /* Trait */]: "Traits",
169
+ ["zone" /* Zone */]: "Zones"
170
+ };
171
+ function getElementLabel(elementType) {
172
+ return ELEMENT_LABELS[elementType];
173
+ }
147
174
  var FIELD_SCHEMA = {
148
175
  ability: {
149
176
  // Text fields
@@ -610,11 +637,13 @@ function createAnyElementId(id) {
610
637
  return id;
611
638
  }
612
639
  export {
640
+ ELEMENT_LABELS,
613
641
  ElementType,
614
642
  FIELD_MAPPINGS,
615
643
  FIELD_SCHEMA,
616
644
  OnlyWorldsClient,
617
645
  createAnyElementId,
618
646
  createElementId,
619
- createElementIds
647
+ createElementIds,
648
+ getElementLabel
620
649
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",