@onlyworlds/sdk 1.3.0 → 1.3.2

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,22 @@ 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;
838
+ /**
839
+ * Current OnlyWorlds version
840
+ * Synced with https://github.com/OnlyWorlds/OnlyWorlds/blob/main/VERSION
841
+ */
842
+ declare const ONLYWORLDS_VERSION: "00.30.00";
827
843
  /**
828
844
  * Field type definitions for OnlyWorlds elements
829
845
  */
@@ -2278,4 +2294,4 @@ declare class OnlyWorldsClient {
2278
2294
  static prepareInput<T extends Record<string, any>>(data: T): any;
2279
2295
  }
2280
2296
 
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 };
2297
+ 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, ONLYWORLDS_VERSION, 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,22 @@ 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;
838
+ /**
839
+ * Current OnlyWorlds version
840
+ * Synced with https://github.com/OnlyWorlds/OnlyWorlds/blob/main/VERSION
841
+ */
842
+ declare const ONLYWORLDS_VERSION: "00.30.00";
827
843
  /**
828
844
  * Field type definitions for OnlyWorlds elements
829
845
  */
@@ -2278,4 +2294,4 @@ declare class OnlyWorldsClient {
2278
2294
  static prepareInput<T extends Record<string, any>>(data: T): any;
2279
2295
  }
2280
2296
 
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 };
2297
+ 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, ONLYWORLDS_VERSION, 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,16 @@ 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,
27
+ ONLYWORLDS_VERSION: () => ONLYWORLDS_VERSION,
26
28
  OnlyWorldsClient: () => OnlyWorldsClient,
27
29
  createAnyElementId: () => createAnyElementId,
28
30
  createElementId: () => createElementId,
29
- createElementIds: () => createElementIds
31
+ createElementIds: () => createElementIds,
32
+ getElementLabel: () => getElementLabel
30
33
  });
31
34
  module.exports = __toCommonJS(index_exports);
32
35
 
@@ -176,6 +179,34 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
176
179
  ElementType2["Zone"] = "zone";
177
180
  return ElementType2;
178
181
  })(ElementType || {});
182
+ var ELEMENT_LABELS = {
183
+ ["ability" /* Ability */]: "Abilities",
184
+ ["character" /* Character */]: "Characters",
185
+ ["collective" /* Collective */]: "Collectives",
186
+ ["construct" /* Construct */]: "Constructs",
187
+ ["creature" /* Creature */]: "Creatures",
188
+ ["event" /* Event */]: "Events",
189
+ ["family" /* Family */]: "Families",
190
+ ["institution" /* Institution */]: "Institutions",
191
+ ["language" /* Language */]: "Languages",
192
+ ["law" /* Law */]: "Laws",
193
+ ["location" /* Location */]: "Locations",
194
+ ["map" /* Map */]: "Maps",
195
+ ["marker" /* Marker */]: "Markers",
196
+ ["narrative" /* Narrative */]: "Narratives",
197
+ ["object" /* Object */]: "Objects",
198
+ ["phenomenon" /* Phenomenon */]: "Phenomena",
199
+ ["pin" /* Pin */]: "Pins",
200
+ ["relation" /* Relation */]: "Relations",
201
+ ["species" /* Species */]: "Species",
202
+ ["title" /* Title */]: "Titles",
203
+ ["trait" /* Trait */]: "Traits",
204
+ ["zone" /* Zone */]: "Zones"
205
+ };
206
+ function getElementLabel(elementType) {
207
+ return ELEMENT_LABELS[elementType];
208
+ }
209
+ var ONLYWORLDS_VERSION = "00.30.00";
179
210
  var FIELD_SCHEMA = {
180
211
  ability: {
181
212
  // Text fields
@@ -643,11 +674,14 @@ function createAnyElementId(id) {
643
674
  }
644
675
  // Annotate the CommonJS export names for ESM import in node:
645
676
  0 && (module.exports = {
677
+ ELEMENT_LABELS,
646
678
  ElementType,
647
679
  FIELD_MAPPINGS,
648
680
  FIELD_SCHEMA,
681
+ ONLYWORLDS_VERSION,
649
682
  OnlyWorldsClient,
650
683
  createAnyElementId,
651
684
  createElementId,
652
- createElementIds
685
+ createElementIds,
686
+ getElementLabel
653
687
  });
package/dist/index.mjs CHANGED
@@ -144,6 +144,34 @@ 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
+ }
174
+ var ONLYWORLDS_VERSION = "00.30.00";
147
175
  var FIELD_SCHEMA = {
148
176
  ability: {
149
177
  // Text fields
@@ -610,11 +638,14 @@ function createAnyElementId(id) {
610
638
  return id;
611
639
  }
612
640
  export {
641
+ ELEMENT_LABELS,
613
642
  ElementType,
614
643
  FIELD_MAPPINGS,
615
644
  FIELD_SCHEMA,
645
+ ONLYWORLDS_VERSION,
616
646
  OnlyWorldsClient,
617
647
  createAnyElementId,
618
648
  createElementId,
619
- createElementIds
649
+ createElementIds,
650
+ getElementLabel
620
651
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
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",