@onlyworlds/sdk 1.0.0 → 1.0.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
@@ -12,6 +12,41 @@ interface BaseElement {
12
12
  created_at?: string;
13
13
  updated_at?: string;
14
14
  }
15
+ /**
16
+ * World element type
17
+ */
18
+ interface World {
19
+ id?: string;
20
+ api_key: string;
21
+ name: string;
22
+ description?: string;
23
+ version?: string;
24
+ image_url?: string;
25
+ time_format_equivalents?: any[];
26
+ time_format_names?: any[];
27
+ time_basic_unit?: string;
28
+ time_range_min?: number;
29
+ time_range_max?: number;
30
+ time_current?: number;
31
+ user?: string;
32
+ created_at?: string;
33
+ updated_at?: string;
34
+ }
35
+ /**
36
+ * World input type for creation/updates
37
+ */
38
+ interface WorldInput {
39
+ name: string;
40
+ description?: string;
41
+ version?: string;
42
+ image_url?: string;
43
+ time_format_equivalents?: any[];
44
+ time_format_names?: any[];
45
+ time_basic_unit?: string;
46
+ time_range_min?: number;
47
+ time_range_max?: number;
48
+ time_current?: number;
49
+ }
15
50
  /**
16
51
  * Ability element type
17
52
  */
@@ -1018,6 +1053,7 @@ declare class Resource<T, TInput> {
1018
1053
  declare class OnlyWorldsClient {
1019
1054
  private baseUrl;
1020
1055
  private headers;
1056
+ worlds: Resource<World, WorldInput>;
1021
1057
  abilities: Resource<Ability, AbilityInput>;
1022
1058
  characters: Resource<Character, CharacterInput>;
1023
1059
  collectives: Resource<Collective, CollectiveInput>;
@@ -1050,12 +1086,13 @@ declare class OnlyWorldsClient {
1050
1086
  }): Promise<T>;
1051
1087
  /**
1052
1088
  * Get all worlds accessible with current credentials
1089
+ * @deprecated Use client.worlds.list() instead for consistent API
1053
1090
  */
1054
- getWorlds(): Promise<any>;
1091
+ getWorlds(): Promise<ApiResponse<World>>;
1055
1092
  /**
1056
1093
  * Helper to convert nested objects to _id/_ids format
1057
1094
  */
1058
1095
  static prepareInput<T extends Record<string, any>>(data: T): any;
1059
1096
  }
1060
1097
 
1061
- export { type Ability, type AbilityInput, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ElementType, type Event, type EventInput, type Family, type FamilyInput, 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 Zone, type ZoneInput };
1098
+ export { type Ability, type AbilityInput, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ElementType, type Event, type EventInput, type Family, type FamilyInput, 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 };
package/dist/index.d.ts CHANGED
@@ -12,6 +12,41 @@ interface BaseElement {
12
12
  created_at?: string;
13
13
  updated_at?: string;
14
14
  }
15
+ /**
16
+ * World element type
17
+ */
18
+ interface World {
19
+ id?: string;
20
+ api_key: string;
21
+ name: string;
22
+ description?: string;
23
+ version?: string;
24
+ image_url?: string;
25
+ time_format_equivalents?: any[];
26
+ time_format_names?: any[];
27
+ time_basic_unit?: string;
28
+ time_range_min?: number;
29
+ time_range_max?: number;
30
+ time_current?: number;
31
+ user?: string;
32
+ created_at?: string;
33
+ updated_at?: string;
34
+ }
35
+ /**
36
+ * World input type for creation/updates
37
+ */
38
+ interface WorldInput {
39
+ name: string;
40
+ description?: string;
41
+ version?: string;
42
+ image_url?: string;
43
+ time_format_equivalents?: any[];
44
+ time_format_names?: any[];
45
+ time_basic_unit?: string;
46
+ time_range_min?: number;
47
+ time_range_max?: number;
48
+ time_current?: number;
49
+ }
15
50
  /**
16
51
  * Ability element type
17
52
  */
@@ -1018,6 +1053,7 @@ declare class Resource<T, TInput> {
1018
1053
  declare class OnlyWorldsClient {
1019
1054
  private baseUrl;
1020
1055
  private headers;
1056
+ worlds: Resource<World, WorldInput>;
1021
1057
  abilities: Resource<Ability, AbilityInput>;
1022
1058
  characters: Resource<Character, CharacterInput>;
1023
1059
  collectives: Resource<Collective, CollectiveInput>;
@@ -1050,12 +1086,13 @@ declare class OnlyWorldsClient {
1050
1086
  }): Promise<T>;
1051
1087
  /**
1052
1088
  * Get all worlds accessible with current credentials
1089
+ * @deprecated Use client.worlds.list() instead for consistent API
1053
1090
  */
1054
- getWorlds(): Promise<any>;
1091
+ getWorlds(): Promise<ApiResponse<World>>;
1055
1092
  /**
1056
1093
  * Helper to convert nested objects to _id/_ids format
1057
1094
  */
1058
1095
  static prepareInput<T extends Record<string, any>>(data: T): any;
1059
1096
  }
1060
1097
 
1061
- export { type Ability, type AbilityInput, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ElementType, type Event, type EventInput, type Family, type FamilyInput, 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 Zone, type ZoneInput };
1098
+ export { type Ability, type AbilityInput, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ElementType, type Event, type EventInput, type Family, type FamilyInput, 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 };
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ var OnlyWorldsClient = class {
55
55
  "API-Key": config.apiKey,
56
56
  "API-Pin": config.apiPin
57
57
  };
58
+ this.worlds = new Resource(this, "world");
58
59
  this.abilities = new Resource(this, "ability");
59
60
  this.characters = new Resource(this, "character");
60
61
  this.collectives = new Resource(this, "collective");
@@ -121,9 +122,10 @@ var OnlyWorldsClient = class {
121
122
  }
122
123
  /**
123
124
  * Get all worlds accessible with current credentials
125
+ * @deprecated Use client.worlds.list() instead for consistent API
124
126
  */
125
127
  async getWorlds() {
126
- return this.request("GET", "/worlds/");
128
+ return this.request("GET", "/world/");
127
129
  }
128
130
  /**
129
131
  * Helper to convert nested objects to _id/_ids format
package/dist/index.mjs CHANGED
@@ -28,6 +28,7 @@ var OnlyWorldsClient = class {
28
28
  "API-Key": config.apiKey,
29
29
  "API-Pin": config.apiPin
30
30
  };
31
+ this.worlds = new Resource(this, "world");
31
32
  this.abilities = new Resource(this, "ability");
32
33
  this.characters = new Resource(this, "character");
33
34
  this.collectives = new Resource(this, "collective");
@@ -94,9 +95,10 @@ var OnlyWorldsClient = class {
94
95
  }
95
96
  /**
96
97
  * Get all worlds accessible with current credentials
98
+ * @deprecated Use client.worlds.list() instead for consistent API
97
99
  */
98
100
  async getWorlds() {
99
- return this.request("GET", "/worlds/");
101
+ return this.request("GET", "/world/");
100
102
  }
101
103
  /**
102
104
  * Helper to convert nested objects to _id/_ids format
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.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",
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "https://github.com/onlyworlds/sdk"
31
+ "url": "git+https://github.com/onlyworlds/sdk.git"
32
32
  },
33
33
  "devDependencies": {
34
34
  "tsup": "^8.0.1",
@@ -40,4 +40,4 @@
40
40
  "engines": {
41
41
  "node": ">=18.0.0"
42
42
  }
43
- }
43
+ }