@themeparks/typelib 1.0.1 → 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.
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/schedule.types.d.ts +31 -0
- package/dist/types/schedule.types.d.ts.map +1 -0
- package/dist/types/schedule.types.js +98 -0
- package/package.json +1 -1
- package/typesrc/schedule.json +77 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import './entities.types.js';
|
|
2
2
|
import './livedata.types.js';
|
|
3
3
|
import './pricedata.types.js';
|
|
4
|
+
import './schedule.types.js';
|
|
4
5
|
export * from './entities.types.js';
|
|
5
6
|
export * from './livedata.types.js';
|
|
6
7
|
export * from './pricedata.types.js';
|
|
8
|
+
export * from './schedule.types.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,qBAAqB,CAAC;AAG7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import './entities.types.js';
|
|
4
4
|
import './livedata.types.js';
|
|
5
5
|
import './pricedata.types.js';
|
|
6
|
+
import './schedule.types.js';
|
|
6
7
|
// Re-export types
|
|
7
8
|
export * from './entities.types.js';
|
|
8
9
|
export * from './livedata.types.js';
|
|
9
10
|
export * from './pricedata.types.js';
|
|
11
|
+
export * from './schedule.types.js';
|
|
@@ -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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Schedule",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"ScheduleType": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"enum": [
|
|
9
|
+
"OPERATING",
|
|
10
|
+
"TICKETED_EVENT",
|
|
11
|
+
"PRIVATE_EVENT",
|
|
12
|
+
"EXTRA_HOURS",
|
|
13
|
+
"INFO"
|
|
14
|
+
],
|
|
15
|
+
"description": "Types of schedule entries for parks"
|
|
16
|
+
},
|
|
17
|
+
"ScheduleEntry": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": [
|
|
20
|
+
"date",
|
|
21
|
+
"type",
|
|
22
|
+
"openingTime",
|
|
23
|
+
"closingTime"
|
|
24
|
+
],
|
|
25
|
+
"properties": {
|
|
26
|
+
"date": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "The date of the schedule entry, YYYY-MM-DD format",
|
|
29
|
+
"format": "date",
|
|
30
|
+
"example": "1992-04-12"
|
|
31
|
+
},
|
|
32
|
+
"type": {
|
|
33
|
+
"$ref": "#/properties/ScheduleType",
|
|
34
|
+
"description": "Type of schedule entry e.g. OPERATING, EXTRA_HOURS, etc."
|
|
35
|
+
},
|
|
36
|
+
"description": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Optional description of the schedule entry"
|
|
39
|
+
},
|
|
40
|
+
"openingTime": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"format": "date-time",
|
|
43
|
+
"description": "Opening time for this schedule entry",
|
|
44
|
+
"example": "1992-04-12T09:00:00-07:00"
|
|
45
|
+
},
|
|
46
|
+
"closingTime": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"format": "date-time",
|
|
49
|
+
"description": "Closing time for this schedule entry",
|
|
50
|
+
"example": "1992-04-12T17:00:00-07:00"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"description": "Represents a single schedule entry"
|
|
54
|
+
},
|
|
55
|
+
"EntitySchedule": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": [
|
|
58
|
+
"id",
|
|
59
|
+
"schedule"
|
|
60
|
+
],
|
|
61
|
+
"properties": {
|
|
62
|
+
"id": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "Identifier of the park entity this schedule belongs to"
|
|
65
|
+
},
|
|
66
|
+
"schedule": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"$ref": "#/properties/ScheduleEntry"
|
|
70
|
+
},
|
|
71
|
+
"description": "Array of schedule entries for the park"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"description": "Represents the schedule for a specific park entity"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|