@mrtdown/core 2.0.0-alpha.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/README.md +107 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.js +11 -0
- package/dist/constants.js.map +1 -0
- package/dist/helpers/calculateDurationWithinServiceHours.d.ts +2 -0
- package/dist/helpers/calculateDurationWithinServiceHours.js +13 -0
- package/dist/helpers/calculateDurationWithinServiceHours.js.map +1 -0
- package/dist/helpers/calculateDurationWithinServiceHours.test.d.ts +1 -0
- package/dist/helpers/calculateDurationWithinServiceHours.test.js +83 -0
- package/dist/helpers/calculateDurationWithinServiceHours.test.js.map +1 -0
- package/dist/helpers/computeImpactFromEvidenceClaims.d.ts +21 -0
- package/dist/helpers/computeImpactFromEvidenceClaims.js +293 -0
- package/dist/helpers/computeImpactFromEvidenceClaims.js.map +1 -0
- package/dist/helpers/computeImpactFromEvidenceClaims.test.d.ts +1 -0
- package/dist/helpers/computeImpactFromEvidenceClaims.test.js +544 -0
- package/dist/helpers/computeImpactFromEvidenceClaims.test.js.map +1 -0
- package/dist/helpers/computeStartOfDaysWithinInterval.d.ts +2 -0
- package/dist/helpers/computeStartOfDaysWithinInterval.js +15 -0
- package/dist/helpers/computeStartOfDaysWithinInterval.js.map +1 -0
- package/dist/helpers/computeStartOfDaysWithinInterval.test.d.ts +1 -0
- package/dist/helpers/computeStartOfDaysWithinInterval.test.js +126 -0
- package/dist/helpers/computeStartOfDaysWithinInterval.test.js.map +1 -0
- package/dist/helpers/estimateOpenAICost.d.ts +40 -0
- package/dist/helpers/estimateOpenAICost.js +55 -0
- package/dist/helpers/estimateOpenAICost.js.map +1 -0
- package/dist/helpers/keyForAffectedEntity.d.ts +7 -0
- package/dist/helpers/keyForAffectedEntity.js +14 -0
- package/dist/helpers/keyForAffectedEntity.js.map +1 -0
- package/dist/helpers/normalizeRecurringPeriod.d.ts +7 -0
- package/dist/helpers/normalizeRecurringPeriod.js +118 -0
- package/dist/helpers/normalizeRecurringPeriod.js.map +1 -0
- package/dist/helpers/normalizeRecurringPeriod.test.d.ts +1 -0
- package/dist/helpers/normalizeRecurringPeriod.test.js +93 -0
- package/dist/helpers/normalizeRecurringPeriod.test.js.map +1 -0
- package/dist/helpers/resolvePeriods.d.ts +224 -0
- package/dist/helpers/resolvePeriods.js +207 -0
- package/dist/helpers/resolvePeriods.js.map +1 -0
- package/dist/helpers/resolvePeriods.test.d.ts +1 -0
- package/dist/helpers/resolvePeriods.test.js +239 -0
- package/dist/helpers/resolvePeriods.test.js.map +1 -0
- package/dist/helpers/splitIntervalByServiceHours.d.ts +2 -0
- package/dist/helpers/splitIntervalByServiceHours.js +30 -0
- package/dist/helpers/splitIntervalByServiceHours.js.map +1 -0
- package/dist/helpers/splitIntervalByServiceHours.test.d.ts +1 -0
- package/dist/helpers/splitIntervalByServiceHours.test.js +152 -0
- package/dist/helpers/splitIntervalByServiceHours.test.js.map +1 -0
- package/dist/helpers/sumIntervalDuration.d.ts +2 -0
- package/dist/helpers/sumIntervalDuration.js +9 -0
- package/dist/helpers/sumIntervalDuration.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/repo/MRTDownRepository.d.ts +23 -0
- package/dist/repo/MRTDownRepository.js +28 -0
- package/dist/repo/MRTDownRepository.js.map +1 -0
- package/dist/repo/common/FileStore.d.ts +12 -0
- package/dist/repo/common/FileStore.js +27 -0
- package/dist/repo/common/FileStore.js.map +1 -0
- package/dist/repo/common/StandardRepository.d.ts +32 -0
- package/dist/repo/common/StandardRepository.js +58 -0
- package/dist/repo/common/StandardRepository.js.map +1 -0
- package/dist/repo/common/store.d.ts +29 -0
- package/dist/repo/common/store.js +2 -0
- package/dist/repo/common/store.js.map +1 -0
- package/dist/repo/issue/IssueRepository.d.ts +36 -0
- package/dist/repo/issue/IssueRepository.js +177 -0
- package/dist/repo/issue/IssueRepository.js.map +1 -0
- package/dist/repo/issue/helpers/deriveCurrentState.d.ts +51 -0
- package/dist/repo/issue/helpers/deriveCurrentState.js +113 -0
- package/dist/repo/issue/helpers/deriveCurrentState.js.map +1 -0
- package/dist/repo/issue/helpers/deriveCurrentState.test.d.ts +1 -0
- package/dist/repo/issue/helpers/deriveCurrentState.test.js +477 -0
- package/dist/repo/issue/helpers/deriveCurrentState.test.js.map +1 -0
- package/dist/repo/landmark/LandmarkRepository.d.ts +7 -0
- package/dist/repo/landmark/LandmarkRepository.js +12 -0
- package/dist/repo/landmark/LandmarkRepository.js.map +1 -0
- package/dist/repo/line/LineRepository.d.ts +13 -0
- package/dist/repo/line/LineRepository.js +32 -0
- package/dist/repo/line/LineRepository.js.map +1 -0
- package/dist/repo/operator/OperatorRepository.d.ts +7 -0
- package/dist/repo/operator/OperatorRepository.js +12 -0
- package/dist/repo/operator/OperatorRepository.js.map +1 -0
- package/dist/repo/service/ServiceRepository.d.ts +19 -0
- package/dist/repo/service/ServiceRepository.js +39 -0
- package/dist/repo/service/ServiceRepository.js.map +1 -0
- package/dist/repo/station/StationRepository.d.ts +13 -0
- package/dist/repo/station/StationRepository.js +30 -0
- package/dist/repo/station/StationRepository.js.map +1 -0
- package/dist/repo/town/TownRepository.d.ts +7 -0
- package/dist/repo/town/TownRepository.js +12 -0
- package/dist/repo/town/TownRepository.js.map +1 -0
- package/dist/schema/Landmark.d.ts +11 -0
- package/dist/schema/Landmark.js +7 -0
- package/dist/schema/Landmark.js.map +1 -0
- package/dist/schema/Line.d.ts +58 -0
- package/dist/schema/Line.js +35 -0
- package/dist/schema/Line.js.map +1 -0
- package/dist/schema/Operator.d.ts +16 -0
- package/dist/schema/Operator.js +12 -0
- package/dist/schema/Operator.js.map +1 -0
- package/dist/schema/Service.d.ts +55 -0
- package/dist/schema/Service.js +24 -0
- package/dist/schema/Service.js.map +1 -0
- package/dist/schema/Station.d.ts +29 -0
- package/dist/schema/Station.js +25 -0
- package/dist/schema/Station.js.map +1 -0
- package/dist/schema/Town.d.ts +11 -0
- package/dist/schema/Town.js +7 -0
- package/dist/schema/Town.js.map +1 -0
- package/dist/schema/common.d.ts +24 -0
- package/dist/schema/common.js +23 -0
- package/dist/schema/common.js.map +1 -0
- package/dist/schema/issue/bundle.d.ts +239 -0
- package/dist/schema/issue/bundle.js +11 -0
- package/dist/schema/issue/bundle.js.map +1 -0
- package/dist/schema/issue/cause.d.ts +51 -0
- package/dist/schema/issue/cause.js +30 -0
- package/dist/schema/issue/cause.js.map +1 -0
- package/dist/schema/issue/claim.d.ts +149 -0
- package/dist/schema/issue/claim.js +36 -0
- package/dist/schema/issue/claim.js.map +1 -0
- package/dist/schema/issue/entity.d.ts +176 -0
- package/dist/schema/issue/entity.js +35 -0
- package/dist/schema/issue/entity.js.map +1 -0
- package/dist/schema/issue/evidence.d.ts +124 -0
- package/dist/schema/issue/evidence.js +30 -0
- package/dist/schema/issue/evidence.js.map +1 -0
- package/dist/schema/issue/facilityEffect.d.ts +15 -0
- package/dist/schema/issue/facilityEffect.js +12 -0
- package/dist/schema/issue/facilityEffect.js.map +1 -0
- package/dist/schema/issue/id.d.ts +3 -0
- package/dist/schema/issue/id.js +6 -0
- package/dist/schema/issue/id.js.map +1 -0
- package/dist/schema/issue/impactEvent.d.ts +373 -0
- package/dist/schema/issue/impactEvent.js +43 -0
- package/dist/schema/issue/impactEvent.js.map +1 -0
- package/dist/schema/issue/issue.d.ts +19 -0
- package/dist/schema/issue/issue.js +13 -0
- package/dist/schema/issue/issue.js.map +1 -0
- package/dist/schema/issue/issueType.d.ts +7 -0
- package/dist/schema/issue/issueType.js +3 -0
- package/dist/schema/issue/issueType.js.map +1 -0
- package/dist/schema/issue/period.d.ts +72 -0
- package/dist/schema/issue/period.js +32 -0
- package/dist/schema/issue/period.js.map +1 -0
- package/dist/schema/issue/serviceEffect.d.ts +29 -0
- package/dist/schema/issue/serviceEffect.js +21 -0
- package/dist/schema/issue/serviceEffect.js.map +1 -0
- package/dist/schema/issue/serviceScope.d.ts +38 -0
- package/dist/schema/issue/serviceScope.js +30 -0
- package/dist/schema/issue/serviceScope.js.map +1 -0
- package/dist/util/assert.d.ts +1 -0
- package/dist/util/assert.js +6 -0
- package/dist/util/assert.js.map +1 -0
- package/dist/util/ingestContent/helpers/getSlugDateTimeFromClaims.d.ts +7 -0
- package/dist/util/ingestContent/helpers/getSlugDateTimeFromClaims.js +24 -0
- package/dist/util/ingestContent/helpers/getSlugDateTimeFromClaims.js.map +1 -0
- package/dist/util/ingestContent/index.d.ts +12 -0
- package/dist/util/ingestContent/index.js +171 -0
- package/dist/util/ingestContent/index.js.map +1 -0
- package/dist/util/ingestContent/types.d.ts +32 -0
- package/dist/util/ingestContent/types.js +2 -0
- package/dist/util/ingestContent/types.js.map +1 -0
- package/dist/write/MRTDownWriter.d.ts +27 -0
- package/dist/write/MRTDownWriter.js +27 -0
- package/dist/write/MRTDownWriter.js.map +1 -0
- package/dist/write/common/FileWriteStore.d.ts +13 -0
- package/dist/write/common/FileWriteStore.js +31 -0
- package/dist/write/common/FileWriteStore.js.map +1 -0
- package/dist/write/common/StandardWriter.d.ts +14 -0
- package/dist/write/common/StandardWriter.js +17 -0
- package/dist/write/common/StandardWriter.js.map +1 -0
- package/dist/write/common/store.d.ts +32 -0
- package/dist/write/common/store.js +2 -0
- package/dist/write/common/store.js.map +1 -0
- package/dist/write/id/IdGenerator.d.ts +18 -0
- package/dist/write/id/IdGenerator.js +23 -0
- package/dist/write/id/IdGenerator.js.map +1 -0
- package/dist/write/issue/IssueWriter.d.ts +12 -0
- package/dist/write/issue/IssueWriter.js +33 -0
- package/dist/write/issue/IssueWriter.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const ImpactEventBaseSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"service">;
|
|
6
|
+
serviceId: z.ZodString;
|
|
7
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"facility">;
|
|
9
|
+
stationId: z.ZodString;
|
|
10
|
+
kind: z.ZodEnum<{
|
|
11
|
+
lift: "lift";
|
|
12
|
+
escalator: "escalator";
|
|
13
|
+
"screen-door": "screen-door";
|
|
14
|
+
}>;
|
|
15
|
+
}, z.z.core.$strip>]>;
|
|
16
|
+
ts: z.z.ZodISODateTime;
|
|
17
|
+
basis: z.ZodObject<{
|
|
18
|
+
evidenceId: z.ZodString;
|
|
19
|
+
}, z.z.core.$strip>;
|
|
20
|
+
}, z.z.core.$strip>;
|
|
21
|
+
export type ImpactEventBase = z.infer<typeof ImpactEventBaseSchema>;
|
|
22
|
+
export declare const ImpactEventPeriodsSetSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"service">;
|
|
26
|
+
serviceId: z.ZodString;
|
|
27
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"facility">;
|
|
29
|
+
stationId: z.ZodString;
|
|
30
|
+
kind: z.ZodEnum<{
|
|
31
|
+
lift: "lift";
|
|
32
|
+
escalator: "escalator";
|
|
33
|
+
"screen-door": "screen-door";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.z.core.$strip>]>;
|
|
36
|
+
ts: z.z.ZodISODateTime;
|
|
37
|
+
basis: z.ZodObject<{
|
|
38
|
+
evidenceId: z.ZodString;
|
|
39
|
+
}, z.z.core.$strip>;
|
|
40
|
+
type: z.ZodLiteral<"periods.set">;
|
|
41
|
+
periods: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
+
kind: z.ZodLiteral<"fixed">;
|
|
43
|
+
startAt: z.z.ZodISODateTime;
|
|
44
|
+
endAt: z.ZodNullable<z.z.ZodISODateTime>;
|
|
45
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
46
|
+
kind: z.ZodLiteral<"recurring">;
|
|
47
|
+
frequency: z.ZodEnum<{
|
|
48
|
+
daily: "daily";
|
|
49
|
+
weekly: "weekly";
|
|
50
|
+
monthly: "monthly";
|
|
51
|
+
yearly: "yearly";
|
|
52
|
+
}>;
|
|
53
|
+
startAt: z.z.ZodISODateTime;
|
|
54
|
+
endAt: z.z.ZodISODateTime;
|
|
55
|
+
daysOfWeek: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
56
|
+
MO: "MO";
|
|
57
|
+
TU: "TU";
|
|
58
|
+
WE: "WE";
|
|
59
|
+
TH: "TH";
|
|
60
|
+
FR: "FR";
|
|
61
|
+
SA: "SA";
|
|
62
|
+
SU: "SU";
|
|
63
|
+
}>>>;
|
|
64
|
+
timeWindow: z.ZodObject<{
|
|
65
|
+
startAt: z.z.ZodISOTime;
|
|
66
|
+
endAt: z.z.ZodISOTime;
|
|
67
|
+
}, z.z.core.$strip>;
|
|
68
|
+
timeZone: z.ZodLiteral<"Asia/Singapore">;
|
|
69
|
+
excludedDates: z.ZodNullable<z.ZodArray<z.z.ZodISODate>>;
|
|
70
|
+
}, z.z.core.$strip>]>>;
|
|
71
|
+
}, z.z.core.$strip>;
|
|
72
|
+
export type ImpactEventPeriodsSet = z.infer<typeof ImpactEventPeriodsSetSchema>;
|
|
73
|
+
export declare const ImpactEventServiceScopeSetSchema: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"service">;
|
|
77
|
+
serviceId: z.ZodString;
|
|
78
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"facility">;
|
|
80
|
+
stationId: z.ZodString;
|
|
81
|
+
kind: z.ZodEnum<{
|
|
82
|
+
lift: "lift";
|
|
83
|
+
escalator: "escalator";
|
|
84
|
+
"screen-door": "screen-door";
|
|
85
|
+
}>;
|
|
86
|
+
}, z.z.core.$strip>]>;
|
|
87
|
+
ts: z.z.ZodISODateTime;
|
|
88
|
+
basis: z.ZodObject<{
|
|
89
|
+
evidenceId: z.ZodString;
|
|
90
|
+
}, z.z.core.$strip>;
|
|
91
|
+
type: z.ZodLiteral<"service_scopes.set">;
|
|
92
|
+
serviceScopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"service.whole">;
|
|
94
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"service.segment">;
|
|
96
|
+
fromStationId: z.ZodString;
|
|
97
|
+
toStationId: z.ZodString;
|
|
98
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"service.point">;
|
|
100
|
+
stationId: z.ZodString;
|
|
101
|
+
}, z.z.core.$strip>]>>;
|
|
102
|
+
}, z.z.core.$strip>;
|
|
103
|
+
export type ImpactEventServiceScopeSet = z.infer<typeof ImpactEventServiceScopeSetSchema>;
|
|
104
|
+
export declare const ImpactEventServiceEffectSetSchema: z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"service">;
|
|
108
|
+
serviceId: z.ZodString;
|
|
109
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
110
|
+
type: z.ZodLiteral<"facility">;
|
|
111
|
+
stationId: z.ZodString;
|
|
112
|
+
kind: z.ZodEnum<{
|
|
113
|
+
lift: "lift";
|
|
114
|
+
escalator: "escalator";
|
|
115
|
+
"screen-door": "screen-door";
|
|
116
|
+
}>;
|
|
117
|
+
}, z.z.core.$strip>]>;
|
|
118
|
+
ts: z.z.ZodISODateTime;
|
|
119
|
+
basis: z.ZodObject<{
|
|
120
|
+
evidenceId: z.ZodString;
|
|
121
|
+
}, z.z.core.$strip>;
|
|
122
|
+
type: z.ZodLiteral<"service_effects.set">;
|
|
123
|
+
effect: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
124
|
+
kind: z.ZodLiteral<"delay">;
|
|
125
|
+
duration: z.ZodNullable<z.z.ZodISODuration>;
|
|
126
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
127
|
+
kind: z.ZodLiteral<"no-service">;
|
|
128
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
129
|
+
kind: z.ZodLiteral<"reduced-service">;
|
|
130
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
131
|
+
kind: z.ZodLiteral<"service-hours-adjustment">;
|
|
132
|
+
}, z.z.core.$strip>]>;
|
|
133
|
+
}, z.z.core.$strip>;
|
|
134
|
+
export type ImpactEventServiceEffectSet = z.infer<typeof ImpactEventServiceEffectSetSchema>;
|
|
135
|
+
export declare const ImpactEventFacilityEffectSetSchema: z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
138
|
+
type: z.ZodLiteral<"service">;
|
|
139
|
+
serviceId: z.ZodString;
|
|
140
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
141
|
+
type: z.ZodLiteral<"facility">;
|
|
142
|
+
stationId: z.ZodString;
|
|
143
|
+
kind: z.ZodEnum<{
|
|
144
|
+
lift: "lift";
|
|
145
|
+
escalator: "escalator";
|
|
146
|
+
"screen-door": "screen-door";
|
|
147
|
+
}>;
|
|
148
|
+
}, z.z.core.$strip>]>;
|
|
149
|
+
ts: z.z.ZodISODateTime;
|
|
150
|
+
basis: z.ZodObject<{
|
|
151
|
+
evidenceId: z.ZodString;
|
|
152
|
+
}, z.z.core.$strip>;
|
|
153
|
+
type: z.ZodLiteral<"facility_effects.set">;
|
|
154
|
+
effect: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
155
|
+
kind: z.ZodLiteral<"facility-out-of-service">;
|
|
156
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
157
|
+
kind: z.ZodLiteral<"facility-degraded">;
|
|
158
|
+
}, z.z.core.$strip>]>;
|
|
159
|
+
}, z.z.core.$strip>;
|
|
160
|
+
export type ImpactEventFacilityEffectSet = z.infer<typeof ImpactEventFacilityEffectSetSchema>;
|
|
161
|
+
export declare const ImpactEventCausesSetSchema: z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"service">;
|
|
165
|
+
serviceId: z.ZodString;
|
|
166
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
167
|
+
type: z.ZodLiteral<"facility">;
|
|
168
|
+
stationId: z.ZodString;
|
|
169
|
+
kind: z.ZodEnum<{
|
|
170
|
+
lift: "lift";
|
|
171
|
+
escalator: "escalator";
|
|
172
|
+
"screen-door": "screen-door";
|
|
173
|
+
}>;
|
|
174
|
+
}, z.z.core.$strip>]>;
|
|
175
|
+
ts: z.z.ZodISODateTime;
|
|
176
|
+
basis: z.ZodObject<{
|
|
177
|
+
evidenceId: z.ZodString;
|
|
178
|
+
}, z.z.core.$strip>;
|
|
179
|
+
type: z.ZodLiteral<"causes.set">;
|
|
180
|
+
causes: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
181
|
+
"signal.fault": "signal.fault";
|
|
182
|
+
"track.fault": "track.fault";
|
|
183
|
+
"train.fault": "train.fault";
|
|
184
|
+
"power.fault": "power.fault";
|
|
185
|
+
"station.fault": "station.fault";
|
|
186
|
+
security: "security";
|
|
187
|
+
weather: "weather";
|
|
188
|
+
"passenger.incident": "passenger.incident";
|
|
189
|
+
"platform_door.fault": "platform_door.fault";
|
|
190
|
+
delay: "delay";
|
|
191
|
+
}>, z.ZodEnum<{
|
|
192
|
+
"track.work": "track.work";
|
|
193
|
+
"system.upgrade": "system.upgrade";
|
|
194
|
+
}>, z.ZodEnum<{
|
|
195
|
+
"elevator.outage": "elevator.outage";
|
|
196
|
+
"escalator.outage": "escalator.outage";
|
|
197
|
+
"air_conditioning.issue": "air_conditioning.issue";
|
|
198
|
+
"station.renovation": "station.renovation";
|
|
199
|
+
}>]>>;
|
|
200
|
+
}, z.z.core.$strip>;
|
|
201
|
+
export type ImpactEventCauseSet = z.infer<typeof ImpactEventCausesSetSchema>;
|
|
202
|
+
export declare const ImpactEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
203
|
+
id: z.ZodString;
|
|
204
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
205
|
+
type: z.ZodLiteral<"service">;
|
|
206
|
+
serviceId: z.ZodString;
|
|
207
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
208
|
+
type: z.ZodLiteral<"facility">;
|
|
209
|
+
stationId: z.ZodString;
|
|
210
|
+
kind: z.ZodEnum<{
|
|
211
|
+
lift: "lift";
|
|
212
|
+
escalator: "escalator";
|
|
213
|
+
"screen-door": "screen-door";
|
|
214
|
+
}>;
|
|
215
|
+
}, z.z.core.$strip>]>;
|
|
216
|
+
ts: z.z.ZodISODateTime;
|
|
217
|
+
basis: z.ZodObject<{
|
|
218
|
+
evidenceId: z.ZodString;
|
|
219
|
+
}, z.z.core.$strip>;
|
|
220
|
+
type: z.ZodLiteral<"periods.set">;
|
|
221
|
+
periods: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
222
|
+
kind: z.ZodLiteral<"fixed">;
|
|
223
|
+
startAt: z.z.ZodISODateTime;
|
|
224
|
+
endAt: z.ZodNullable<z.z.ZodISODateTime>;
|
|
225
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
226
|
+
kind: z.ZodLiteral<"recurring">;
|
|
227
|
+
frequency: z.ZodEnum<{
|
|
228
|
+
daily: "daily";
|
|
229
|
+
weekly: "weekly";
|
|
230
|
+
monthly: "monthly";
|
|
231
|
+
yearly: "yearly";
|
|
232
|
+
}>;
|
|
233
|
+
startAt: z.z.ZodISODateTime;
|
|
234
|
+
endAt: z.z.ZodISODateTime;
|
|
235
|
+
daysOfWeek: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
236
|
+
MO: "MO";
|
|
237
|
+
TU: "TU";
|
|
238
|
+
WE: "WE";
|
|
239
|
+
TH: "TH";
|
|
240
|
+
FR: "FR";
|
|
241
|
+
SA: "SA";
|
|
242
|
+
SU: "SU";
|
|
243
|
+
}>>>;
|
|
244
|
+
timeWindow: z.ZodObject<{
|
|
245
|
+
startAt: z.z.ZodISOTime;
|
|
246
|
+
endAt: z.z.ZodISOTime;
|
|
247
|
+
}, z.z.core.$strip>;
|
|
248
|
+
timeZone: z.ZodLiteral<"Asia/Singapore">;
|
|
249
|
+
excludedDates: z.ZodNullable<z.ZodArray<z.z.ZodISODate>>;
|
|
250
|
+
}, z.z.core.$strip>]>>;
|
|
251
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
+
type: z.ZodLiteral<"service">;
|
|
255
|
+
serviceId: z.ZodString;
|
|
256
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
257
|
+
type: z.ZodLiteral<"facility">;
|
|
258
|
+
stationId: z.ZodString;
|
|
259
|
+
kind: z.ZodEnum<{
|
|
260
|
+
lift: "lift";
|
|
261
|
+
escalator: "escalator";
|
|
262
|
+
"screen-door": "screen-door";
|
|
263
|
+
}>;
|
|
264
|
+
}, z.z.core.$strip>]>;
|
|
265
|
+
ts: z.z.ZodISODateTime;
|
|
266
|
+
basis: z.ZodObject<{
|
|
267
|
+
evidenceId: z.ZodString;
|
|
268
|
+
}, z.z.core.$strip>;
|
|
269
|
+
type: z.ZodLiteral<"service_scopes.set">;
|
|
270
|
+
serviceScopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
271
|
+
type: z.ZodLiteral<"service.whole">;
|
|
272
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
273
|
+
type: z.ZodLiteral<"service.segment">;
|
|
274
|
+
fromStationId: z.ZodString;
|
|
275
|
+
toStationId: z.ZodString;
|
|
276
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
277
|
+
type: z.ZodLiteral<"service.point">;
|
|
278
|
+
stationId: z.ZodString;
|
|
279
|
+
}, z.z.core.$strip>]>>;
|
|
280
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
281
|
+
id: z.ZodString;
|
|
282
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
283
|
+
type: z.ZodLiteral<"service">;
|
|
284
|
+
serviceId: z.ZodString;
|
|
285
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"facility">;
|
|
287
|
+
stationId: z.ZodString;
|
|
288
|
+
kind: z.ZodEnum<{
|
|
289
|
+
lift: "lift";
|
|
290
|
+
escalator: "escalator";
|
|
291
|
+
"screen-door": "screen-door";
|
|
292
|
+
}>;
|
|
293
|
+
}, z.z.core.$strip>]>;
|
|
294
|
+
ts: z.z.ZodISODateTime;
|
|
295
|
+
basis: z.ZodObject<{
|
|
296
|
+
evidenceId: z.ZodString;
|
|
297
|
+
}, z.z.core.$strip>;
|
|
298
|
+
type: z.ZodLiteral<"service_effects.set">;
|
|
299
|
+
effect: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
300
|
+
kind: z.ZodLiteral<"delay">;
|
|
301
|
+
duration: z.ZodNullable<z.z.ZodISODuration>;
|
|
302
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
303
|
+
kind: z.ZodLiteral<"no-service">;
|
|
304
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
305
|
+
kind: z.ZodLiteral<"reduced-service">;
|
|
306
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
307
|
+
kind: z.ZodLiteral<"service-hours-adjustment">;
|
|
308
|
+
}, z.z.core.$strip>]>;
|
|
309
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
310
|
+
id: z.ZodString;
|
|
311
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
312
|
+
type: z.ZodLiteral<"service">;
|
|
313
|
+
serviceId: z.ZodString;
|
|
314
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
315
|
+
type: z.ZodLiteral<"facility">;
|
|
316
|
+
stationId: z.ZodString;
|
|
317
|
+
kind: z.ZodEnum<{
|
|
318
|
+
lift: "lift";
|
|
319
|
+
escalator: "escalator";
|
|
320
|
+
"screen-door": "screen-door";
|
|
321
|
+
}>;
|
|
322
|
+
}, z.z.core.$strip>]>;
|
|
323
|
+
ts: z.z.ZodISODateTime;
|
|
324
|
+
basis: z.ZodObject<{
|
|
325
|
+
evidenceId: z.ZodString;
|
|
326
|
+
}, z.z.core.$strip>;
|
|
327
|
+
type: z.ZodLiteral<"facility_effects.set">;
|
|
328
|
+
effect: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
329
|
+
kind: z.ZodLiteral<"facility-out-of-service">;
|
|
330
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
331
|
+
kind: z.ZodLiteral<"facility-degraded">;
|
|
332
|
+
}, z.z.core.$strip>]>;
|
|
333
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
334
|
+
id: z.ZodString;
|
|
335
|
+
entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
336
|
+
type: z.ZodLiteral<"service">;
|
|
337
|
+
serviceId: z.ZodString;
|
|
338
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
339
|
+
type: z.ZodLiteral<"facility">;
|
|
340
|
+
stationId: z.ZodString;
|
|
341
|
+
kind: z.ZodEnum<{
|
|
342
|
+
lift: "lift";
|
|
343
|
+
escalator: "escalator";
|
|
344
|
+
"screen-door": "screen-door";
|
|
345
|
+
}>;
|
|
346
|
+
}, z.z.core.$strip>]>;
|
|
347
|
+
ts: z.z.ZodISODateTime;
|
|
348
|
+
basis: z.ZodObject<{
|
|
349
|
+
evidenceId: z.ZodString;
|
|
350
|
+
}, z.z.core.$strip>;
|
|
351
|
+
type: z.ZodLiteral<"causes.set">;
|
|
352
|
+
causes: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
353
|
+
"signal.fault": "signal.fault";
|
|
354
|
+
"track.fault": "track.fault";
|
|
355
|
+
"train.fault": "train.fault";
|
|
356
|
+
"power.fault": "power.fault";
|
|
357
|
+
"station.fault": "station.fault";
|
|
358
|
+
security: "security";
|
|
359
|
+
weather: "weather";
|
|
360
|
+
"passenger.incident": "passenger.incident";
|
|
361
|
+
"platform_door.fault": "platform_door.fault";
|
|
362
|
+
delay: "delay";
|
|
363
|
+
}>, z.ZodEnum<{
|
|
364
|
+
"track.work": "track.work";
|
|
365
|
+
"system.upgrade": "system.upgrade";
|
|
366
|
+
}>, z.ZodEnum<{
|
|
367
|
+
"elevator.outage": "elevator.outage";
|
|
368
|
+
"escalator.outage": "escalator.outage";
|
|
369
|
+
"air_conditioning.issue": "air_conditioning.issue";
|
|
370
|
+
"station.renovation": "station.renovation";
|
|
371
|
+
}>]>>;
|
|
372
|
+
}, z.z.core.$strip>]>;
|
|
373
|
+
export type ImpactEvent = z.infer<typeof ImpactEventSchema>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { CauseSubtypeSchema } from './cause.js';
|
|
3
|
+
import { AffectedEntitySchema } from './entity.js';
|
|
4
|
+
import { FacilityEffectSchema } from './facilityEffect.js';
|
|
5
|
+
import { PeriodSchema } from './period.js';
|
|
6
|
+
import { ServiceEffectSchema } from './serviceEffect.js';
|
|
7
|
+
import { ServiceScopeSchema } from './serviceScope.js';
|
|
8
|
+
export const ImpactEventBaseSchema = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
entity: AffectedEntitySchema,
|
|
11
|
+
ts: z.iso.datetime({ offset: true }),
|
|
12
|
+
basis: z.object({
|
|
13
|
+
evidenceId: z.string(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
export const ImpactEventPeriodsSetSchema = ImpactEventBaseSchema.extend({
|
|
17
|
+
type: z.literal('periods.set'),
|
|
18
|
+
periods: z.array(PeriodSchema),
|
|
19
|
+
});
|
|
20
|
+
export const ImpactEventServiceScopeSetSchema = ImpactEventBaseSchema.extend({
|
|
21
|
+
type: z.literal('service_scopes.set'),
|
|
22
|
+
serviceScopes: z.array(ServiceScopeSchema),
|
|
23
|
+
});
|
|
24
|
+
export const ImpactEventServiceEffectSetSchema = ImpactEventBaseSchema.extend({
|
|
25
|
+
type: z.literal('service_effects.set'),
|
|
26
|
+
effect: ServiceEffectSchema,
|
|
27
|
+
});
|
|
28
|
+
export const ImpactEventFacilityEffectSetSchema = ImpactEventBaseSchema.extend({
|
|
29
|
+
type: z.literal('facility_effects.set'),
|
|
30
|
+
effect: FacilityEffectSchema,
|
|
31
|
+
});
|
|
32
|
+
export const ImpactEventCausesSetSchema = ImpactEventBaseSchema.extend({
|
|
33
|
+
type: z.literal('causes.set'),
|
|
34
|
+
causes: z.array(CauseSubtypeSchema),
|
|
35
|
+
});
|
|
36
|
+
export const ImpactEventSchema = z.discriminatedUnion('type', [
|
|
37
|
+
ImpactEventPeriodsSetSchema,
|
|
38
|
+
ImpactEventServiceScopeSetSchema,
|
|
39
|
+
ImpactEventServiceEffectSetSchema,
|
|
40
|
+
ImpactEventFacilityEffectSetSchema,
|
|
41
|
+
ImpactEventCausesSetSchema,
|
|
42
|
+
]);
|
|
43
|
+
//# sourceMappingURL=impactEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impactEvent.js","sourceRoot":"/","sources":["schema/issue/impactEvent.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,oBAAoB;IAC5B,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;KACvB,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACtE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CAC/B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gCAAgC,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,iCAAiC,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAC5E,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtC,MAAM,EAAE,mBAAmB;CAC5B,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,kCAAkC,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAC7E,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IACvC,MAAM,EAAE,oBAAoB;CAC7B,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACrE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC7B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;CACpC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC5D,2BAA2B;IAC3B,gCAAgC;IAChC,iCAAiC;IACjC,kCAAkC;IAClC,0BAA0B;CAC3B,CAAC,CAAC","sourcesContent":["import z from 'zod';\nimport { CauseSubtypeSchema } from './cause.js';\nimport { AffectedEntitySchema } from './entity.js';\nimport { FacilityEffectSchema } from './facilityEffect.js';\nimport { PeriodSchema } from './period.js';\nimport { ServiceEffectSchema } from './serviceEffect.js';\nimport { ServiceScopeSchema } from './serviceScope.js';\n\nexport const ImpactEventBaseSchema = z.object({\n id: z.string(),\n entity: AffectedEntitySchema,\n ts: z.iso.datetime({ offset: true }),\n basis: z.object({\n evidenceId: z.string(),\n }),\n});\nexport type ImpactEventBase = z.infer<typeof ImpactEventBaseSchema>;\n\nexport const ImpactEventPeriodsSetSchema = ImpactEventBaseSchema.extend({\n type: z.literal('periods.set'),\n periods: z.array(PeriodSchema),\n});\nexport type ImpactEventPeriodsSet = z.infer<typeof ImpactEventPeriodsSetSchema>;\n\nexport const ImpactEventServiceScopeSetSchema = ImpactEventBaseSchema.extend({\n type: z.literal('service_scopes.set'),\n serviceScopes: z.array(ServiceScopeSchema),\n});\nexport type ImpactEventServiceScopeSet = z.infer<\n typeof ImpactEventServiceScopeSetSchema\n>;\n\nexport const ImpactEventServiceEffectSetSchema = ImpactEventBaseSchema.extend({\n type: z.literal('service_effects.set'),\n effect: ServiceEffectSchema,\n});\nexport type ImpactEventServiceEffectSet = z.infer<\n typeof ImpactEventServiceEffectSetSchema\n>;\n\nexport const ImpactEventFacilityEffectSetSchema = ImpactEventBaseSchema.extend({\n type: z.literal('facility_effects.set'),\n effect: FacilityEffectSchema,\n});\nexport type ImpactEventFacilityEffectSet = z.infer<\n typeof ImpactEventFacilityEffectSetSchema\n>;\n\nexport const ImpactEventCausesSetSchema = ImpactEventBaseSchema.extend({\n type: z.literal('causes.set'),\n causes: z.array(CauseSubtypeSchema),\n});\nexport type ImpactEventCauseSet = z.infer<typeof ImpactEventCausesSetSchema>;\n\nexport const ImpactEventSchema = z.discriminatedUnion('type', [\n ImpactEventPeriodsSetSchema,\n ImpactEventServiceScopeSetSchema,\n ImpactEventServiceEffectSetSchema,\n ImpactEventFacilityEffectSetSchema,\n ImpactEventCausesSetSchema,\n]);\nexport type ImpactEvent = z.infer<typeof ImpactEventSchema>;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const IssueSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
type: z.ZodEnum<{
|
|
5
|
+
disruption: "disruption";
|
|
6
|
+
maintenance: "maintenance";
|
|
7
|
+
infra: "infra";
|
|
8
|
+
}>;
|
|
9
|
+
title: z.ZodObject<{
|
|
10
|
+
'en-SG': z.ZodString;
|
|
11
|
+
'zh-Hans': z.ZodNullable<z.ZodString>;
|
|
12
|
+
ms: z.ZodNullable<z.ZodString>;
|
|
13
|
+
ta: z.ZodNullable<z.ZodString>;
|
|
14
|
+
}, z.z.core.$strip>;
|
|
15
|
+
titleMeta: z.ZodObject<{
|
|
16
|
+
source: z.ZodString;
|
|
17
|
+
}, z.z.core.$strip>;
|
|
18
|
+
}, z.z.core.$strip>;
|
|
19
|
+
export type Issue = z.infer<typeof IssueSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { TranslationsSchema } from '#schema/common.js';
|
|
3
|
+
import { IssueIdSchema } from './id.js';
|
|
4
|
+
import { IssueTypeSchema } from './issueType.js';
|
|
5
|
+
export const IssueSchema = z.object({
|
|
6
|
+
id: IssueIdSchema,
|
|
7
|
+
type: IssueTypeSchema,
|
|
8
|
+
title: TranslationsSchema,
|
|
9
|
+
titleMeta: z.object({
|
|
10
|
+
source: z.string(),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue.js","sourceRoot":"/","sources":["schema/issue/issue.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC;QAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import z from 'zod';\nimport { TranslationsSchema } from '#schema/common.js';\nimport { IssueIdSchema } from './id.js';\nimport { IssueTypeSchema } from './issueType.js';\n\nexport const IssueSchema = z.object({\n id: IssueIdSchema,\n type: IssueTypeSchema,\n title: TranslationsSchema,\n titleMeta: z.object({\n source: z.string(),\n }),\n});\nexport type Issue = z.infer<typeof IssueSchema>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issueType.js","sourceRoot":"/","sources":["schema/issue/issueType.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC","sourcesContent":["import z from 'zod';\n\nexport const IssueTypeSchema = z.enum(['disruption', 'maintenance', 'infra']);\nexport type IssueType = z.infer<typeof IssueTypeSchema>;\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const PeriodFixedSchema: z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"fixed">;
|
|
4
|
+
startAt: z.z.ZodISODateTime;
|
|
5
|
+
endAt: z.ZodNullable<z.z.ZodISODateTime>;
|
|
6
|
+
}, z.z.core.$strip>;
|
|
7
|
+
export type PeriodFixed = z.infer<typeof PeriodFixedSchema>;
|
|
8
|
+
export declare const PeriodFrequencySchema: z.ZodEnum<{
|
|
9
|
+
daily: "daily";
|
|
10
|
+
weekly: "weekly";
|
|
11
|
+
monthly: "monthly";
|
|
12
|
+
yearly: "yearly";
|
|
13
|
+
}>;
|
|
14
|
+
export type PeriodFrequency = z.infer<typeof PeriodFrequencySchema>;
|
|
15
|
+
export declare const PeriodRecurringSchema: z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"recurring">;
|
|
17
|
+
frequency: z.ZodEnum<{
|
|
18
|
+
daily: "daily";
|
|
19
|
+
weekly: "weekly";
|
|
20
|
+
monthly: "monthly";
|
|
21
|
+
yearly: "yearly";
|
|
22
|
+
}>;
|
|
23
|
+
startAt: z.z.ZodISODateTime;
|
|
24
|
+
endAt: z.z.ZodISODateTime;
|
|
25
|
+
daysOfWeek: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
26
|
+
MO: "MO";
|
|
27
|
+
TU: "TU";
|
|
28
|
+
WE: "WE";
|
|
29
|
+
TH: "TH";
|
|
30
|
+
FR: "FR";
|
|
31
|
+
SA: "SA";
|
|
32
|
+
SU: "SU";
|
|
33
|
+
}>>>;
|
|
34
|
+
timeWindow: z.ZodObject<{
|
|
35
|
+
startAt: z.z.ZodISOTime;
|
|
36
|
+
endAt: z.z.ZodISOTime;
|
|
37
|
+
}, z.z.core.$strip>;
|
|
38
|
+
timeZone: z.ZodLiteral<"Asia/Singapore">;
|
|
39
|
+
excludedDates: z.ZodNullable<z.ZodArray<z.z.ZodISODate>>;
|
|
40
|
+
}, z.z.core.$strip>;
|
|
41
|
+
export type PeriodRecurring = z.infer<typeof PeriodRecurringSchema>;
|
|
42
|
+
export declare const PeriodSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
43
|
+
kind: z.ZodLiteral<"fixed">;
|
|
44
|
+
startAt: z.z.ZodISODateTime;
|
|
45
|
+
endAt: z.ZodNullable<z.z.ZodISODateTime>;
|
|
46
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"recurring">;
|
|
48
|
+
frequency: z.ZodEnum<{
|
|
49
|
+
daily: "daily";
|
|
50
|
+
weekly: "weekly";
|
|
51
|
+
monthly: "monthly";
|
|
52
|
+
yearly: "yearly";
|
|
53
|
+
}>;
|
|
54
|
+
startAt: z.z.ZodISODateTime;
|
|
55
|
+
endAt: z.z.ZodISODateTime;
|
|
56
|
+
daysOfWeek: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
57
|
+
MO: "MO";
|
|
58
|
+
TU: "TU";
|
|
59
|
+
WE: "WE";
|
|
60
|
+
TH: "TH";
|
|
61
|
+
FR: "FR";
|
|
62
|
+
SA: "SA";
|
|
63
|
+
SU: "SU";
|
|
64
|
+
}>>>;
|
|
65
|
+
timeWindow: z.ZodObject<{
|
|
66
|
+
startAt: z.z.ZodISOTime;
|
|
67
|
+
endAt: z.z.ZodISOTime;
|
|
68
|
+
}, z.z.core.$strip>;
|
|
69
|
+
timeZone: z.ZodLiteral<"Asia/Singapore">;
|
|
70
|
+
excludedDates: z.ZodNullable<z.ZodArray<z.z.ZodISODate>>;
|
|
71
|
+
}, z.z.core.$strip>]>;
|
|
72
|
+
export type Period = z.infer<typeof PeriodSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export const PeriodFixedSchema = z.object({
|
|
3
|
+
kind: z.literal('fixed'),
|
|
4
|
+
startAt: z.iso.datetime({ offset: true }),
|
|
5
|
+
endAt: z.iso.datetime({ offset: true }).nullable(),
|
|
6
|
+
});
|
|
7
|
+
export const PeriodFrequencySchema = z.enum([
|
|
8
|
+
'daily',
|
|
9
|
+
'weekly',
|
|
10
|
+
'monthly',
|
|
11
|
+
'yearly',
|
|
12
|
+
]);
|
|
13
|
+
export const PeriodRecurringSchema = z.object({
|
|
14
|
+
kind: z.literal('recurring'),
|
|
15
|
+
frequency: PeriodFrequencySchema,
|
|
16
|
+
startAt: z.iso.datetime({ offset: true }),
|
|
17
|
+
endAt: z.iso.datetime({ offset: true }),
|
|
18
|
+
daysOfWeek: z
|
|
19
|
+
.array(z.enum(['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']))
|
|
20
|
+
.nullable(),
|
|
21
|
+
timeWindow: z.object({
|
|
22
|
+
startAt: z.iso.time(),
|
|
23
|
+
endAt: z.iso.time(),
|
|
24
|
+
}),
|
|
25
|
+
timeZone: z.literal('Asia/Singapore'),
|
|
26
|
+
excludedDates: z.array(z.iso.date()).nullable(),
|
|
27
|
+
});
|
|
28
|
+
export const PeriodSchema = z.discriminatedUnion('kind', [
|
|
29
|
+
PeriodFixedSchema,
|
|
30
|
+
PeriodRecurringSchema,
|
|
31
|
+
]);
|
|
32
|
+
//# sourceMappingURL=period.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"period.js","sourceRoot":"/","sources":["schema/issue/period.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,OAAO;IACP,QAAQ;IACR,SAAS;IACT,QAAQ;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvC,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;SACzD,QAAQ,EAAE;IACb,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE;QACrB,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE;KACpB,CAAC;IACF,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACvD,iBAAiB;IACjB,qBAAqB;CACtB,CAAC,CAAC","sourcesContent":["import z from 'zod';\n\nexport const PeriodFixedSchema = z.object({\n kind: z.literal('fixed'),\n startAt: z.iso.datetime({ offset: true }),\n endAt: z.iso.datetime({ offset: true }).nullable(),\n});\nexport type PeriodFixed = z.infer<typeof PeriodFixedSchema>;\n\nexport const PeriodFrequencySchema = z.enum([\n 'daily',\n 'weekly',\n 'monthly',\n 'yearly',\n]);\nexport type PeriodFrequency = z.infer<typeof PeriodFrequencySchema>;\n\nexport const PeriodRecurringSchema = z.object({\n kind: z.literal('recurring'),\n frequency: PeriodFrequencySchema,\n startAt: z.iso.datetime({ offset: true }),\n endAt: z.iso.datetime({ offset: true }),\n daysOfWeek: z\n .array(z.enum(['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']))\n .nullable(),\n timeWindow: z.object({\n startAt: z.iso.time(),\n endAt: z.iso.time(),\n }),\n timeZone: z.literal('Asia/Singapore'),\n excludedDates: z.array(z.iso.date()).nullable(),\n});\nexport type PeriodRecurring = z.infer<typeof PeriodRecurringSchema>;\n\nexport const PeriodSchema = z.discriminatedUnion('kind', [\n PeriodFixedSchema,\n PeriodRecurringSchema,\n]);\nexport type Period = z.infer<typeof PeriodSchema>;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const ServiceEffectDelaySchema: z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"delay">;
|
|
4
|
+
duration: z.ZodNullable<z.z.ZodISODuration>;
|
|
5
|
+
}, z.z.core.$strip>;
|
|
6
|
+
export type ServiceEffectDelay = z.infer<typeof ServiceEffectDelaySchema>;
|
|
7
|
+
export declare const ServiceEffectNoServiceSchema: z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"no-service">;
|
|
9
|
+
}, z.z.core.$strip>;
|
|
10
|
+
export type ServiceEffectNoService = z.infer<typeof ServiceEffectNoServiceSchema>;
|
|
11
|
+
export declare const ServiceEffectReducedServiceSchema: z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"reduced-service">;
|
|
13
|
+
}, z.z.core.$strip>;
|
|
14
|
+
export type ServiceEffectReducedService = z.infer<typeof ServiceEffectReducedServiceSchema>;
|
|
15
|
+
export declare const ServiceEffectServiceHoursAdjustmentSchema: z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"service-hours-adjustment">;
|
|
17
|
+
}, z.z.core.$strip>;
|
|
18
|
+
export type ServiceEffectServiceHoursAdjustment = z.infer<typeof ServiceEffectServiceHoursAdjustmentSchema>;
|
|
19
|
+
export declare const ServiceEffectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"delay">;
|
|
21
|
+
duration: z.ZodNullable<z.z.ZodISODuration>;
|
|
22
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
23
|
+
kind: z.ZodLiteral<"no-service">;
|
|
24
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"reduced-service">;
|
|
26
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"service-hours-adjustment">;
|
|
28
|
+
}, z.z.core.$strip>]>;
|
|
29
|
+
export type ServiceEffect = z.infer<typeof ServiceEffectSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export const ServiceEffectDelaySchema = z.object({
|
|
3
|
+
kind: z.literal('delay'),
|
|
4
|
+
duration: z.iso.duration().nullable(),
|
|
5
|
+
});
|
|
6
|
+
export const ServiceEffectNoServiceSchema = z.object({
|
|
7
|
+
kind: z.literal('no-service'),
|
|
8
|
+
});
|
|
9
|
+
export const ServiceEffectReducedServiceSchema = z.object({
|
|
10
|
+
kind: z.literal('reduced-service'),
|
|
11
|
+
});
|
|
12
|
+
export const ServiceEffectServiceHoursAdjustmentSchema = z.object({
|
|
13
|
+
kind: z.literal('service-hours-adjustment'),
|
|
14
|
+
});
|
|
15
|
+
export const ServiceEffectSchema = z.discriminatedUnion('kind', [
|
|
16
|
+
ServiceEffectDelaySchema,
|
|
17
|
+
ServiceEffectNoServiceSchema,
|
|
18
|
+
ServiceEffectReducedServiceSchema,
|
|
19
|
+
ServiceEffectServiceHoursAdjustmentSchema,
|
|
20
|
+
]);
|
|
21
|
+
//# sourceMappingURL=serviceEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceEffect.js","sourceRoot":"/","sources":["schema/issue/serviceEffect.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;CAC9B,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;CACnC,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;CAC5C,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC9D,wBAAwB;IACxB,4BAA4B;IAC5B,iCAAiC;IACjC,yCAAyC;CAC1C,CAAC,CAAC","sourcesContent":["import z from 'zod';\n\nexport const ServiceEffectDelaySchema = z.object({\n kind: z.literal('delay'),\n duration: z.iso.duration().nullable(),\n});\nexport type ServiceEffectDelay = z.infer<typeof ServiceEffectDelaySchema>;\n\nexport const ServiceEffectNoServiceSchema = z.object({\n kind: z.literal('no-service'),\n});\nexport type ServiceEffectNoService = z.infer<\n typeof ServiceEffectNoServiceSchema\n>;\n\nexport const ServiceEffectReducedServiceSchema = z.object({\n kind: z.literal('reduced-service'),\n});\nexport type ServiceEffectReducedService = z.infer<\n typeof ServiceEffectReducedServiceSchema\n>;\n\nexport const ServiceEffectServiceHoursAdjustmentSchema = z.object({\n kind: z.literal('service-hours-adjustment'),\n});\nexport type ServiceEffectServiceHoursAdjustment = z.infer<\n typeof ServiceEffectServiceHoursAdjustmentSchema\n>;\n\nexport const ServiceEffectSchema = z.discriminatedUnion('kind', [\n ServiceEffectDelaySchema,\n ServiceEffectNoServiceSchema,\n ServiceEffectReducedServiceSchema,\n ServiceEffectServiceHoursAdjustmentSchema,\n]);\nexport type ServiceEffect = z.infer<typeof ServiceEffectSchema>;\n"]}
|