@themeparks/typelib 1.0.0 → 1.0.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.
@@ -0,0 +1,56 @@
1
+ // THIS FILE IS GENERATED - DO NOT EDIT DIRECTLY
2
+ export var CurrencyTypesEnum;
3
+ (function (CurrencyTypesEnum) {
4
+ CurrencyTypesEnum["USD"] = "USD";
5
+ CurrencyTypesEnum["EUR"] = "EUR";
6
+ CurrencyTypesEnum["GBP"] = "GBP";
7
+ CurrencyTypesEnum["JPY"] = "JPY";
8
+ })(CurrencyTypesEnum || (CurrencyTypesEnum = {}));
9
+ // Function to convert string to CurrencyTypesEnum
10
+ export function StringToCurrencyTypes(value) {
11
+ const lowerValue = value.toLowerCase();
12
+ switch (lowerValue) {
13
+ case 'usd':
14
+ return CurrencyTypesEnum.USD;
15
+ case 'eur':
16
+ return CurrencyTypesEnum.EUR;
17
+ case 'gbp':
18
+ return CurrencyTypesEnum.GBP;
19
+ case 'jpy':
20
+ return CurrencyTypesEnum.JPY;
21
+ }
22
+ throw new Error('Unknown CurrencyTypes value: ' + value);
23
+ }
24
+ // Runtime Schema Registration
25
+ import { registerTypeSchema } from "../type_register.js";
26
+ registerTypeSchema("CurrencyTypes", {
27
+ "type": "string",
28
+ "enum": [
29
+ "USD",
30
+ "EUR",
31
+ "GBP",
32
+ "JPY"
33
+ ],
34
+ "description": "Currently supported currency codes by ThemeParks.wiki"
35
+ });
36
+ registerTypeSchema("PriceData", {
37
+ "type": "object",
38
+ "required": [
39
+ "amount",
40
+ "currency"
41
+ ],
42
+ "properties": {
43
+ "amount": {
44
+ "type": "number",
45
+ "description": "Numerical price amount. Always in the lowest denomination (e.g. cents for USD)"
46
+ },
47
+ "currency": {
48
+ "$ref": "#/properties/CurrencyTypes",
49
+ "description": "Currency code"
50
+ },
51
+ "formatted": {
52
+ "type": "string",
53
+ "description": "Formatted price string in human-readable format. E.g. $12.00"
54
+ }
55
+ }
56
+ });
@@ -0,0 +1,31 @@
1
+ export declare enum ScheduleTypeEnum {
2
+ "OPERATING" = "OPERATING",
3
+ "TICKETED_EVENT" = "TICKETED_EVENT",
4
+ "PRIVATE_EVENT" = "PRIVATE_EVENT",
5
+ "EXTRA_HOURS" = "EXTRA_HOURS",
6
+ "INFO" = "INFO"
7
+ }
8
+ /** Types of schedule entries for parks */
9
+ export type ScheduleType = keyof typeof ScheduleTypeEnum;
10
+ export declare function StringToScheduleType(value: string): ScheduleTypeEnum;
11
+ /** Represents a single schedule entry */
12
+ export type ScheduleEntry = {
13
+ /** The date of the schedule entry, YYYY-MM-DD format */
14
+ date: string;
15
+ /** Type of schedule entry e.g. OPERATING, EXTRA_HOURS, etc. */
16
+ type: ScheduleType;
17
+ /** Optional description of the schedule entry */
18
+ description?: string;
19
+ /** Opening time for this schedule entry */
20
+ openingTime: string;
21
+ /** Closing time for this schedule entry */
22
+ closingTime: string;
23
+ };
24
+ /** Represents the schedule for a specific park entity */
25
+ export type EntitySchedule = {
26
+ /** Identifier of the park entity this schedule belongs to */
27
+ id: string;
28
+ /** Array of schedule entries for the park */
29
+ schedule: ScheduleEntry[];
30
+ };
31
+ //# sourceMappingURL=schedule.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule.types.d.ts","sourceRoot":"","sources":["../../src/types/schedule.types.ts"],"names":[],"mappings":"AAEA,oBAAY,gBAAgB;IACxB,WAAW,cAAc;IACzB,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IACjC,aAAa,gBAAgB;IAC7B,MAAM,SAAS;CAClB;AAED,0CAA0C;AAC1C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAGzD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAepE;AAED,yCAAyC;AACzC,MAAM,MAAM,aAAa,GAAG;IAExB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IAEb,+DAA+D;IAC/D,IAAI,EAAE,YAAY,CAAC;IAEnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IAEpB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;CACvB,CAAA;AAED,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG;IAEzB,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAC;IAEX,6CAA6C;IAC7C,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B,CAAA"}
@@ -0,0 +1,98 @@
1
+ // THIS FILE IS GENERATED - DO NOT EDIT DIRECTLY
2
+ export var ScheduleTypeEnum;
3
+ (function (ScheduleTypeEnum) {
4
+ ScheduleTypeEnum["OPERATING"] = "OPERATING";
5
+ ScheduleTypeEnum["TICKETED_EVENT"] = "TICKETED_EVENT";
6
+ ScheduleTypeEnum["PRIVATE_EVENT"] = "PRIVATE_EVENT";
7
+ ScheduleTypeEnum["EXTRA_HOURS"] = "EXTRA_HOURS";
8
+ ScheduleTypeEnum["INFO"] = "INFO";
9
+ })(ScheduleTypeEnum || (ScheduleTypeEnum = {}));
10
+ // Function to convert string to ScheduleTypeEnum
11
+ export function StringToScheduleType(value) {
12
+ const lowerValue = value.toLowerCase();
13
+ switch (lowerValue) {
14
+ case 'operating':
15
+ return ScheduleTypeEnum.OPERATING;
16
+ case 'ticketed_event':
17
+ return ScheduleTypeEnum.TICKETED_EVENT;
18
+ case 'private_event':
19
+ return ScheduleTypeEnum.PRIVATE_EVENT;
20
+ case 'extra_hours':
21
+ return ScheduleTypeEnum.EXTRA_HOURS;
22
+ case 'info':
23
+ return ScheduleTypeEnum.INFO;
24
+ }
25
+ throw new Error('Unknown ScheduleType value: ' + value);
26
+ }
27
+ // Runtime Schema Registration
28
+ import { registerTypeSchema } from "../type_register.js";
29
+ registerTypeSchema("ScheduleType", {
30
+ "type": "string",
31
+ "enum": [
32
+ "OPERATING",
33
+ "TICKETED_EVENT",
34
+ "PRIVATE_EVENT",
35
+ "EXTRA_HOURS",
36
+ "INFO"
37
+ ],
38
+ "description": "Types of schedule entries for parks"
39
+ });
40
+ registerTypeSchema("ScheduleEntry", {
41
+ "type": "object",
42
+ "required": [
43
+ "date",
44
+ "type",
45
+ "openingTime",
46
+ "closingTime"
47
+ ],
48
+ "properties": {
49
+ "date": {
50
+ "type": "string",
51
+ "description": "The date of the schedule entry, YYYY-MM-DD format",
52
+ "format": "date",
53
+ "example": "1992-04-12"
54
+ },
55
+ "type": {
56
+ "$ref": "#/properties/ScheduleType",
57
+ "description": "Type of schedule entry e.g. OPERATING, EXTRA_HOURS, etc."
58
+ },
59
+ "description": {
60
+ "type": "string",
61
+ "description": "Optional description of the schedule entry"
62
+ },
63
+ "openingTime": {
64
+ "type": "string",
65
+ "format": "date-time",
66
+ "description": "Opening time for this schedule entry",
67
+ "example": "1992-04-12T09:00:00-07:00"
68
+ },
69
+ "closingTime": {
70
+ "type": "string",
71
+ "format": "date-time",
72
+ "description": "Closing time for this schedule entry",
73
+ "example": "1992-04-12T17:00:00-07:00"
74
+ }
75
+ },
76
+ "description": "Represents a single schedule entry"
77
+ });
78
+ registerTypeSchema("EntitySchedule", {
79
+ "type": "object",
80
+ "required": [
81
+ "id",
82
+ "schedule"
83
+ ],
84
+ "properties": {
85
+ "id": {
86
+ "type": "string",
87
+ "description": "Identifier of the park entity this schedule belongs to"
88
+ },
89
+ "schedule": {
90
+ "type": "array",
91
+ "items": {
92
+ "$ref": "#/properties/ScheduleEntry"
93
+ },
94
+ "description": "Array of schedule entries for the park"
95
+ }
96
+ },
97
+ "description": "Represents the schedule for a specific park entity"
98
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themeparks/typelib",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Entities",
4
+ "type": "object",
5
+ "properties": {
6
+ "EntityType": {
7
+ "type": "string",
8
+ "enum": [
9
+ "DESTINATION",
10
+ "PARK",
11
+ "ATTRACTION",
12
+ "RESTAURANT",
13
+ "SHOW",
14
+ "HOTEL"
15
+ ],
16
+ "description": "Possible types of entity in ThemeParks.wiki"
17
+ },
18
+ "EntityLocation": {
19
+ "type": "object",
20
+ "properties": {
21
+ "latitude": {
22
+ "type": "number",
23
+ "description": "Latitude coordinate of the entity location",
24
+ "nullable": true
25
+ },
26
+ "longitude": {
27
+ "type": "number",
28
+ "description": "Longitude coordinate of the entity location",
29
+ "nullable": true
30
+ }
31
+ }
32
+ },
33
+ "TagData": {
34
+ "type": "object",
35
+ "required": [
36
+ "tag",
37
+ "tagName"
38
+ ],
39
+ "properties": {
40
+ "tag": {
41
+ "type": "string",
42
+ "description": "Tag identifier"
43
+ },
44
+ "tagName": {
45
+ "type": "string",
46
+ "description": "Human readable tag name"
47
+ },
48
+ "id": {
49
+ "type": "string",
50
+ "description": "Unique identifier"
51
+ },
52
+ "value": {
53
+ "description": "Tag value - can be string, number or object"
54
+ }
55
+ }
56
+ },
57
+ "Entity": {
58
+ "type": "object",
59
+ "required": [
60
+ "id",
61
+ "name",
62
+ "entityType",
63
+ "timezone"
64
+ ],
65
+ "properties": {
66
+ "id": {
67
+ "type": "string",
68
+ "description": "Unique entity identifier"
69
+ },
70
+ "name": {
71
+ "type": "string",
72
+ "description": "Entity name"
73
+ },
74
+ "entityType": {
75
+ "$ref": "#/properties/EntityType",
76
+ "description": "Type of entity"
77
+ },
78
+ "parentId": {
79
+ "type": "string",
80
+ "nullable": true,
81
+ "description": "Parent entity identifier, must always be set when entityType is not DESTINATION"
82
+ },
83
+ "destinationId": {
84
+ "type": "string",
85
+ "nullable": true,
86
+ "description": "Destination identifier, must always be set when entityType is not DESTINATION"
87
+ },
88
+ "parkId": {
89
+ "type": "string",
90
+ "nullable": true,
91
+ "description": "Park identifier, must be set if any parent entity in the hierarchy is a park"
92
+ },
93
+ "timezone": {
94
+ "type": "string",
95
+ "description": "Entity timezone"
96
+ },
97
+ "location": {
98
+ "$ref": "#/properties/EntityLocation",
99
+ "description": "Entity location coordinates"
100
+ },
101
+ "tags": {
102
+ "type": "array",
103
+ "items": {
104
+ "$ref": "#/properties/TagData"
105
+ },
106
+ "description": "Array of tags associated with the entity"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,257 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "LiveData",
4
+ "type": "object",
5
+ "properties": {
6
+ "LiveStatusType": {
7
+ "type": "string",
8
+ "enum": [
9
+ "OPERATING",
10
+ "DOWN",
11
+ "CLOSED",
12
+ "REFURBISHMENT"
13
+ ],
14
+ "description": "Current operating status of an entity"
15
+ },
16
+ "ReturnTimeState": {
17
+ "type": "string",
18
+ "enum": [
19
+ "AVAILABLE",
20
+ "TEMP_FULL",
21
+ "FINISHED"
22
+ ],
23
+ "description": "State of return time availability"
24
+ },
25
+ "BoardingGroupState": {
26
+ "type": "string",
27
+ "enum": [
28
+ "AVAILABLE",
29
+ "PAUSED",
30
+ "CLOSED"
31
+ ],
32
+ "description": "State of boarding group availability"
33
+ },
34
+ "LiveQueue": {
35
+ "type": "object",
36
+ "properties": {
37
+ "STANDBY": {
38
+ "type": "object",
39
+ "properties": {
40
+ "waitTime": {
41
+ "type": "number",
42
+ "description": "Current standby wait time in minutes"
43
+ }
44
+ },
45
+ "description": "Standard queue type for most attractions. Wait in line for attraction, no additional cost."
46
+ },
47
+ "SINGLE_RIDER": {
48
+ "type": "object",
49
+ "required": [
50
+ "waitTime"
51
+ ],
52
+ "properties": {
53
+ "waitTime": {
54
+ "type": "number",
55
+ "nullable": true,
56
+ "description": "Current single rider wait time in minutes"
57
+ }
58
+ },
59
+ "description": "Single Rider queue type for attractions that offer it. Usually a shorter wait time, but you may be separated from your party. No additional cost."
60
+ },
61
+ "RETURN_TIME": {
62
+ "type": "object",
63
+ "required": [
64
+ "state",
65
+ "returnStart",
66
+ "returnEnd"
67
+ ],
68
+ "properties": {
69
+ "state": {
70
+ "$ref": "#/properties/ReturnTimeState",
71
+ "description": "State of return time availability"
72
+ },
73
+ "returnStart": {
74
+ "type": "string",
75
+ "format": "date-time",
76
+ "nullable": true,
77
+ "description": "Start time of return window"
78
+ },
79
+ "returnEnd": {
80
+ "type": "string",
81
+ "format": "date-time",
82
+ "nullable": true,
83
+ "description": "End time of return window"
84
+ }
85
+ },
86
+ "description": "Return Time queue type for attractions that offer it. You get a return time to come back and ride the attraction later, instead of waiting in a physical line. No additional cost."
87
+ },
88
+ "PAID_RETURN_TIME": {
89
+ "type": "object",
90
+ "required": [
91
+ "state",
92
+ "returnStart",
93
+ "returnEnd",
94
+ "price"
95
+ ],
96
+ "properties": {
97
+ "state": {
98
+ "$ref": "#/properties/ReturnTimeState",
99
+ "description": "State of return time availability"
100
+ },
101
+ "returnStart": {
102
+ "type": "string",
103
+ "format": "date-time",
104
+ "nullable": true,
105
+ "description": "Start time of return window"
106
+ },
107
+ "returnEnd": {
108
+ "type": "string",
109
+ "format": "date-time",
110
+ "nullable": true,
111
+ "description": "End time of return window"
112
+ },
113
+ "price": {
114
+ "$ref": "#/properties/PriceData",
115
+ "description": "Price information for paid return time"
116
+ }
117
+ },
118
+ "description": "Paid Return Time queue type for attractions that offer it. You pay an additional cost to get a return time to come back and ride the attraction later, instead of waiting in a physical line."
119
+ },
120
+ "BOARDING_GROUP": {
121
+ "type": "object",
122
+ "required": [
123
+ "allocationStatus",
124
+ "currentGroupStart",
125
+ "currentGroupEnd",
126
+ "nextAllocationTime",
127
+ "estimatedWait"
128
+ ],
129
+ "properties": {
130
+ "allocationStatus": {
131
+ "$ref": "#/properties/BoardingGroupState",
132
+ "description": "State of boarding group availability"
133
+ },
134
+ "currentGroupStart": {
135
+ "type": "number",
136
+ "nullable": true,
137
+ "description": "Current boarding group start number"
138
+ },
139
+ "currentGroupEnd": {
140
+ "type": "number",
141
+ "nullable": true,
142
+ "description": "Current boarding group end number"
143
+ },
144
+ "nextAllocationTime": {
145
+ "type": "string",
146
+ "format": "date-time",
147
+ "nullable": true,
148
+ "description": "Next boarding group allocation time"
149
+ },
150
+ "estimatedWait": {
151
+ "type": "number",
152
+ "nullable": true,
153
+ "description": "Estimated wait time in minutes"
154
+ }
155
+ },
156
+ "description": "Boarding Group queue type for attractions that offer it. You get allocated a boarding group number and wait until your group is called. No additional cost."
157
+ },
158
+ "PAID_STANDBY": {
159
+ "type": "object",
160
+ "required": [
161
+ "waitTime"
162
+ ],
163
+ "properties": {
164
+ "waitTime": {
165
+ "type": "number",
166
+ "nullable": true,
167
+ "description": "Current paid standby wait time in minutes"
168
+ }
169
+ },
170
+ "description": "Paid Standby queue type for attractions that offer it. You pay an additional cost to use a separate standby line, usually with a shorter wait time."
171
+ }
172
+ }
173
+ },
174
+ "LiveTimeSlot": {
175
+ "type": "object",
176
+ "required": [
177
+ "type"
178
+ ],
179
+ "properties": {
180
+ "type": {
181
+ "type": "string",
182
+ "description": "Type of time entry"
183
+ },
184
+ "startTime": {
185
+ "type": "string",
186
+ "format": "date-time",
187
+ "nullable": true,
188
+ "description": "Start time"
189
+ },
190
+ "endTime": {
191
+ "type": "string",
192
+ "format": "date-time",
193
+ "nullable": true,
194
+ "description": "End time"
195
+ }
196
+ },
197
+ "description": "Time entry for shows or attraction operating hours"
198
+ },
199
+ "DiningAvailability": {
200
+ "type": "object",
201
+ "properties": {
202
+ "partySize": {
203
+ "type": "number",
204
+ "nullable": true,
205
+ "description": "Available party size"
206
+ },
207
+ "waitTime": {
208
+ "type": "number",
209
+ "nullable": true,
210
+ "description": "Current wait time in minutes"
211
+ }
212
+ },
213
+ "description": "Dining availability information for restaurants"
214
+ },
215
+ "LiveData": {
216
+ "type": "object",
217
+ "required": [
218
+ "id"
219
+ ],
220
+ "properties": {
221
+ "id": {
222
+ "type": "string",
223
+ "description": "Entity identifier"
224
+ },
225
+ "status": {
226
+ "$ref": "#/properties/LiveStatusType",
227
+ "description": "Current operating status of the entity"
228
+ },
229
+ "queue": {
230
+ "$ref": "#/properties/LiveQueue",
231
+ "description": "Current queue information for entities with queues (e.g. attractions)"
232
+ },
233
+ "showtimes": {
234
+ "type": "array",
235
+ "items": {
236
+ "$ref": "#/properties/LiveTimeSlot"
237
+ },
238
+ "description": "Array of showtime entries for entities that have scheduled showtimes (e.g. shows)"
239
+ },
240
+ "operatingHours": {
241
+ "type": "array",
242
+ "items": {
243
+ "$ref": "#/properties/LiveTimeSlot"
244
+ },
245
+ "description": "Array of operating hours entries for entities that have specific operating hours (e.g. parks, restaurants)"
246
+ },
247
+ "diningAvailability": {
248
+ "type": "array",
249
+ "items": {
250
+ "$ref": "#/properties/DiningAvailability"
251
+ },
252
+ "description": "Array of dining availability entries for entities that have dining options (e.g. restaurants)"
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "PriceData",
4
+ "type": "object",
5
+ "properties": {
6
+ "CurrencyTypes": {
7
+ "type": "string",
8
+ "enum": [
9
+ "USD",
10
+ "EUR",
11
+ "GBP",
12
+ "JPY"
13
+ ],
14
+ "description": "Currently supported currency codes by ThemeParks.wiki"
15
+ },
16
+ "PriceData": {
17
+ "type": "object",
18
+ "required": [
19
+ "amount",
20
+ "currency"
21
+ ],
22
+ "properties": {
23
+ "amount": {
24
+ "type": "number",
25
+ "description": "Numerical price amount. Always in the lowest denomination (e.g. cents for USD)"
26
+ },
27
+ "currency": {
28
+ "$ref": "#/properties/CurrencyTypes",
29
+ "description": "Currency code"
30
+ },
31
+ "formatted": {
32
+ "type": "string",
33
+ "description": "Formatted price string in human-readable format. E.g. $12.00"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }