@tmlmobilidade/types 20251031.1051.3 → 20251202.1817.5

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.
Files changed (235) hide show
  1. package/dist/{src/_common → _common}/index.d.ts +4 -2
  2. package/dist/{src/_common → _common}/index.js +4 -2
  3. package/dist/_common/mongo.d.ts +3 -0
  4. package/dist/_common/status.d.ts +13 -0
  5. package/dist/_common/status.js +20 -0
  6. package/dist/_common/utility.js +1 -0
  7. package/dist/{src/agency.d.ts → agency.d.ts} +4 -15
  8. package/dist/{src/agency.js → agency.js} +1 -6
  9. package/dist/{src/alert.d.ts → alert.d.ts} +20 -21
  10. package/dist/{src/alert.js → alert.js} +8 -14
  11. package/dist/{src/simplified-apex → apex}/simplified-apex-validation.d.ts +20 -20
  12. package/dist/{src/auth → auth}/index.d.ts +1 -1
  13. package/dist/{src/auth → auth}/index.js +1 -1
  14. package/dist/{src/auth → auth}/password-requirements.js +2 -1
  15. package/dist/auth/role.d.ts +958 -0
  16. package/dist/{src/auth → auth}/role.js +2 -2
  17. package/dist/{src/auth → auth}/session.d.ts +13 -9
  18. package/dist/{src/auth → auth}/session.js +1 -1
  19. package/dist/auth/user.d.ts +1281 -0
  20. package/dist/{src/auth → auth}/user.js +11 -14
  21. package/dist/{src/file-exports → file-exports}/common.d.ts +9 -8
  22. package/dist/{src/file-exports → file-exports}/common.js +1 -1
  23. package/dist/file-exports/index.d.ts +121 -0
  24. package/dist/file-exports/ride-export.d.ts +410 -0
  25. package/dist/file-exports/ride-export.js +131 -0
  26. package/dist/{src/file.d.ts → file.d.ts} +18 -18
  27. package/dist/gtfs/agency.d.ts +30 -0
  28. package/dist/gtfs/agency.js +13 -0
  29. package/dist/gtfs/feed-info.d.ts +33 -0
  30. package/dist/{src/gtfs.js → gtfs/feed-info.js} +1 -11
  31. package/dist/{src/gtfs → gtfs}/index.d.ts +3 -0
  32. package/dist/{src/gtfs → gtfs}/index.js +3 -0
  33. package/dist/gtfs/service-alert.d.ts +26 -0
  34. package/dist/index.d.ts +22 -22
  35. package/dist/index.js +22 -22
  36. package/dist/locations/census.d.ts +211 -0
  37. package/dist/locations/census.js +2 -0
  38. package/dist/locations/district.d.ts +24 -0
  39. package/dist/locations/district.js +2 -0
  40. package/dist/locations/index.d.ts +6 -0
  41. package/dist/locations/index.js +6 -0
  42. package/dist/locations/locality.d.ts +27 -0
  43. package/dist/locations/locality.js +2 -0
  44. package/dist/locations/municipality.d.ts +25 -0
  45. package/dist/locations/municipality.js +2 -0
  46. package/dist/locations/parish.d.ts +26 -0
  47. package/dist/locations/parish.js +2 -0
  48. package/dist/locations/queries.d.ts +117 -0
  49. package/dist/{src/locations.js → locations/queries.js} +5 -16
  50. package/dist/metrics/demand/demand_by_agency.d.ts +210 -0
  51. package/dist/metrics/demand/demand_by_agency.js +39 -0
  52. package/dist/metrics/demand/demand_by_category.d.ts +475 -0
  53. package/dist/metrics/demand/demand_by_category.js +114 -0
  54. package/dist/metrics/demand/demand_by_line.d.ts +246 -0
  55. package/dist/metrics/demand/demand_by_line.js +56 -0
  56. package/dist/metrics/demand/demand_by_pattern.d.ts +332 -0
  57. package/dist/metrics/demand/demand_by_pattern.js +56 -0
  58. package/dist/metrics/demand/demand_by_product.d.ts +475 -0
  59. package/dist/metrics/demand/demand_by_product.js +114 -0
  60. package/dist/metrics/demand/index.d.ts +6 -0
  61. package/dist/metrics/demand/index.js +8 -0
  62. package/dist/metrics/demand/records.d.ts +320 -0
  63. package/dist/metrics/demand/records.js +53 -0
  64. package/dist/metrics/index.d.ts +2647 -0
  65. package/dist/metrics/index.js +48 -0
  66. package/dist/metrics/realtime.d.ts +667 -0
  67. package/dist/metrics/realtime.js +41 -0
  68. package/dist/{src/notification.d.ts → notification.d.ts} +4 -4
  69. package/dist/{src/organization.d.ts → organization.d.ts} +32 -32
  70. package/dist/{src/organization.js → organization.js} +7 -7
  71. package/dist/permissions/agencies.d.ts +12 -0
  72. package/dist/permissions/agencies.js +13 -0
  73. package/dist/permissions/alerts.d.ts +36 -0
  74. package/dist/permissions/alerts.js +25 -0
  75. package/dist/permissions/controller.d.ts +36 -0
  76. package/dist/permissions/controller.js +30 -0
  77. package/dist/permissions/gtfs-validations.d.ts +25 -0
  78. package/dist/permissions/gtfs-validations.js +14 -0
  79. package/dist/permissions/home.d.ts +12 -0
  80. package/dist/permissions/home.js +10 -0
  81. package/dist/permissions/index.d.ts +268 -0
  82. package/dist/permissions/index.js +149 -0
  83. package/dist/permissions/organizations.d.ts +12 -0
  84. package/dist/permissions/organizations.js +12 -0
  85. package/dist/permissions/performance.d.ts +12 -0
  86. package/dist/permissions/performance.js +9 -0
  87. package/dist/permissions/plans.d.ts +25 -0
  88. package/dist/permissions/plans.js +22 -0
  89. package/dist/permissions/roles.d.ts +12 -0
  90. package/dist/permissions/roles.js +12 -0
  91. package/dist/permissions/stops.d.ts +30 -0
  92. package/dist/permissions/stops.js +17 -0
  93. package/dist/permissions/users.d.ts +12 -0
  94. package/dist/permissions/users.js +12 -0
  95. package/dist/{src/plans → plans}/gtfs-validation.d.ts +55 -63
  96. package/dist/{src/plans → plans}/gtfs-validation.js +3 -6
  97. package/dist/plans/plan-app-status.d.ts +15 -0
  98. package/dist/plans/plan-app-status.js +10 -0
  99. package/dist/{src/plans → plans}/plan.d.ts +240 -104
  100. package/dist/{src/plans → plans}/plan.js +8 -10
  101. package/dist/{src/_common/proposed-change.d.ts → proposed-change.d.ts} +21 -22
  102. package/dist/{src/_common/proposed-change.js → proposed-change.js} +5 -7
  103. package/dist/{src/rides → rides}/index.d.ts +1 -0
  104. package/dist/{src/rides → rides}/index.js +1 -0
  105. package/dist/{src/rides → rides}/ride-acceptance.d.ts +65 -65
  106. package/dist/{src/rides → rides}/ride-analysis.d.ts +34 -34
  107. package/dist/{src/rides → rides}/ride-audit.d.ts +10 -10
  108. package/dist/rides/ride-normalized.d.ts +29 -0
  109. package/dist/rides/ride-normalized.js +2 -0
  110. package/dist/{src/rides → rides}/ride.d.ts +523 -567
  111. package/dist/{src/rides → rides}/ride.js +2 -16
  112. package/dist/{src/sams → sams}/sam-analysis.d.ts +11 -11
  113. package/dist/{src/sams → sams}/sam-analysis.js +4 -4
  114. package/dist/{src/sams → sams}/sam.d.ts +76 -76
  115. package/dist/{src/sams → sams}/sam.js +1 -1
  116. package/dist/{src/stop.d.ts → stop.d.ts} +32 -43
  117. package/dist/{src/stop.js → stop.js} +3 -8
  118. package/dist/vehicle-events/gtfs-rt-vehicle-event-extended.d.ts +77 -0
  119. package/dist/vehicle-events/gtfs-rt-vehicle-event-extended.js +21 -0
  120. package/dist/vehicle-events/index.d.ts +2 -0
  121. package/dist/vehicle-events/index.js +2 -0
  122. package/dist/{src/vehicle-event.d.ts → vehicle-events/simplified-vehicle-event.d.ts} +9 -9
  123. package/dist/{src/vehicle-event.js → vehicle-events/simplified-vehicle-event.js} +3 -3
  124. package/dist/wiki.js +2 -0
  125. package/dist/{src/zone.d.ts → zone.d.ts} +2 -16
  126. package/dist/{src/zone.js → zone.js} +0 -6
  127. package/package.json +18 -21
  128. package/README.md +0 -13
  129. package/dist/src/_common/email.d.ts +0 -4
  130. package/dist/src/_common/email.js +0 -7
  131. package/dist/src/auth/permission.d.ts +0 -19
  132. package/dist/src/auth/permission.js +0 -8
  133. package/dist/src/auth/role.d.ts +0 -127
  134. package/dist/src/auth/user.d.ts +0 -311
  135. package/dist/src/file-exports/index.d.ts +0 -121
  136. package/dist/src/file-exports/ride-export.d.ts +0 -470
  137. package/dist/src/file-exports/ride-export.js +0 -128
  138. package/dist/src/gtfs.d.ts +0 -88
  139. package/dist/src/locations.d.ts +0 -319
  140. package/dist/src/metrics/demand.d.ts +0 -803
  141. package/dist/src/metrics/demand.js +0 -153
  142. package/dist/src/metrics/index.d.ts +0 -806
  143. package/dist/src/metrics/index.js +0 -19
  144. package/dist/src/plans/plan-controller.d.ts +0 -15
  145. package/dist/src/plans/plan-controller.js +0 -10
  146. package/dist/src/system/index.d.ts +0 -2
  147. package/dist/src/system/index.js +0 -2
  148. package/dist/src/system/processing-status.d.ts +0 -9
  149. package/dist/src/system/processing-status.js +0 -5
  150. package/dist/{src/_common → _common}/comment.d.ts +8 -8
  151. package/dist/{src/_common → _common}/comment.js +0 -0
  152. package/dist/{src/_common → _common}/document.d.ts +0 -0
  153. package/dist/{src/_common → _common}/document.js +0 -0
  154. package/dist/{src/system → _common}/environment.d.ts +0 -0
  155. package/dist/{src/system → _common}/environment.js +0 -0
  156. package/dist/{src/_common → _common}/fastify.d.ts +0 -0
  157. package/dist/{src/_common → _common}/fastify.js +0 -0
  158. package/dist/{src/_common/utility.js → _common/mongo.js} +0 -0
  159. package/dist/{src/_common → _common}/operational-date.d.ts +0 -0
  160. package/dist/{src/_common → _common}/operational-date.js +0 -0
  161. package/dist/{src/_common → _common}/unix-timestamp.d.ts +0 -0
  162. package/dist/{src/_common → _common}/unix-timestamp.js +0 -0
  163. package/dist/{src/_common → _common}/utility.d.ts +0 -0
  164. package/dist/{src/simplified-apex → apex}/index.d.ts +0 -0
  165. package/dist/{src/simplified-apex → apex}/index.js +0 -0
  166. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection-decision.d.ts +0 -0
  167. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection-decision.js +0 -0
  168. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection.d.ts +0 -0
  169. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection.js +0 -0
  170. package/dist/{src/simplified-apex → apex}/simplified-apex-location.d.ts +16 -16
  171. package/dist/{src/simplified-apex → apex}/simplified-apex-location.js +0 -0
  172. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-refund.d.ts +20 -20
  173. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-refund.js +0 -0
  174. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-sale.d.ts +25 -25
  175. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-sale.js +0 -0
  176. package/dist/{src/simplified-apex → apex}/simplified-apex-type.d.ts +0 -0
  177. package/dist/{src/simplified-apex → apex}/simplified-apex-type.js +0 -0
  178. package/dist/{src/simplified-apex → apex}/simplified-apex-validation.js +0 -0
  179. package/dist/{src/auth → auth}/login.d.ts +0 -0
  180. package/dist/{src/auth → auth}/login.js +0 -0
  181. package/dist/{src/auth → auth}/password-requirements.d.ts +0 -0
  182. package/dist/{src/auth → auth}/verification-token.d.ts +0 -0
  183. package/dist/{src/auth → auth}/verification-token.js +0 -0
  184. package/dist/{src/file-exports → file-exports}/index.js +0 -0
  185. package/dist/{src/file.js → file.js} +0 -0
  186. package/dist/{src/gtfs → gtfs}/calendar-dates.d.ts +0 -0
  187. package/dist/{src/gtfs → gtfs}/calendar-dates.js +0 -0
  188. package/dist/{src/gtfs → gtfs}/calendar.d.ts +0 -0
  189. package/dist/{src/gtfs → gtfs}/calendar.js +0 -0
  190. package/dist/{src/gtfs → gtfs}/cause-effetcs.d.ts +0 -0
  191. package/dist/{src/gtfs → gtfs}/cause-effetcs.js +0 -0
  192. package/dist/{src/gtfs → gtfs}/common.d.ts +0 -0
  193. package/dist/{src/gtfs → gtfs}/common.js +0 -0
  194. package/dist/{src/gtfs → gtfs}/routes.d.ts +0 -0
  195. package/dist/{src/gtfs → gtfs}/routes.js +0 -0
  196. package/dist/{src/pcgi/pcgi-apex-location.js → gtfs/service-alert.js} +0 -0
  197. package/dist/{src/gtfs → gtfs}/shapes.d.ts +0 -0
  198. package/dist/{src/gtfs → gtfs}/shapes.js +0 -0
  199. package/dist/{src/gtfs → gtfs}/stop-times.d.ts +0 -0
  200. package/dist/{src/gtfs → gtfs}/stop-times.js +0 -0
  201. package/dist/{src/gtfs → gtfs}/stops.d.ts +0 -0
  202. package/dist/{src/gtfs → gtfs}/stops.js +0 -0
  203. package/dist/{src/gtfs → gtfs}/trips.d.ts +0 -0
  204. package/dist/{src/gtfs → gtfs}/trips.js +0 -0
  205. package/dist/{src/metrics → metrics}/common.d.ts +0 -0
  206. package/dist/{src/metrics → metrics}/common.js +0 -0
  207. package/dist/{src/notification.js → notification.js} +0 -0
  208. package/dist/{src/pcgi → pcgi}/index.d.ts +0 -0
  209. package/dist/{src/pcgi → pcgi}/index.js +0 -0
  210. package/dist/{src/pcgi → pcgi}/pcgi-apex-location.d.ts +0 -0
  211. package/dist/{src/pcgi/pcgi-apex-refund.js → pcgi/pcgi-apex-location.js} +0 -0
  212. package/dist/{src/pcgi → pcgi}/pcgi-apex-refund.d.ts +0 -0
  213. package/dist/{src/pcgi/pcgi-apex-sale.js → pcgi/pcgi-apex-refund.js} +0 -0
  214. package/dist/{src/pcgi → pcgi}/pcgi-apex-sale.d.ts +0 -0
  215. package/dist/{src/pcgi/pcgi-apex-validation.js → pcgi/pcgi-apex-sale.js} +0 -0
  216. package/dist/{src/pcgi → pcgi}/pcgi-apex-validation.d.ts +0 -0
  217. package/dist/{src/pcgi/pcgi-transaction-entity.js → pcgi/pcgi-apex-validation.js} +0 -0
  218. package/dist/{src/pcgi → pcgi}/pcgi-transaction-entity.d.ts +0 -0
  219. package/dist/{src/rides/hashed-shape.js → pcgi/pcgi-transaction-entity.js} +0 -0
  220. package/dist/{src/plans → plans}/index.d.ts +0 -0
  221. package/dist/{src/plans → plans}/index.js +0 -0
  222. package/dist/{src/plans → plans}/plan-pcgi-legacy.d.ts +0 -0
  223. package/dist/{src/plans → plans}/plan-pcgi-legacy.js +0 -0
  224. package/dist/{src/rides → rides}/hashed-shape.d.ts +0 -0
  225. package/dist/{src/rides/hashed-trip.js → rides/hashed-shape.js} +0 -0
  226. package/dist/{src/rides → rides}/hashed-trip.d.ts +0 -0
  227. package/dist/{src/wiki.js → rides/hashed-trip.js} +0 -0
  228. package/dist/{src/rides → rides}/ride-acceptance.js +1 -1
  229. /package/dist/{src/rides → rides}/ride-analysis.js +0 -0
  230. /package/dist/{src/rides → rides}/ride-audit.js +0 -0
  231. /package/dist/{src/rides → rides}/ride-overrides.d.ts +0 -0
  232. /package/dist/{src/rides → rides}/ride-overrides.js +0 -0
  233. /package/dist/{src/sams → sams}/index.d.ts +0 -0
  234. /package/dist/{src/sams → sams}/index.js +0 -0
  235. /package/dist/{src/wiki.d.ts → wiki.d.ts} +0 -0
@@ -0,0 +1,246 @@
1
+ import { z } from 'zod';
2
+ export declare const DemandByLineByYearSchema: z.ZodObject<{
3
+ description: z.ZodOptional<z.ZodString>;
4
+ generated_at: z.ZodDate;
5
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
6
+ qty: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ qty: number;
9
+ }, {
10
+ qty: number;
11
+ }>>;
12
+ properties: z.ZodObject<{
13
+ line_id: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ line_id: string;
16
+ }, {
17
+ line_id: string;
18
+ }>;
19
+ } & {
20
+ metric: z.ZodLiteral<"demand_by_line_by_year">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ properties: {
23
+ line_id: string;
24
+ };
25
+ generated_at: Date;
26
+ metric: "demand_by_line_by_year";
27
+ data: Record<string, {
28
+ qty: number;
29
+ }>;
30
+ description?: string | undefined;
31
+ }, {
32
+ properties: {
33
+ line_id: string;
34
+ };
35
+ generated_at: Date;
36
+ metric: "demand_by_line_by_year";
37
+ data: Record<string, {
38
+ qty: number;
39
+ }>;
40
+ description?: string | undefined;
41
+ }>;
42
+ export declare const DemandByLineByMonthSchema: z.ZodObject<{
43
+ description: z.ZodOptional<z.ZodString>;
44
+ generated_at: z.ZodDate;
45
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
46
+ qty: z.ZodNumber;
47
+ }, "strip", z.ZodTypeAny, {
48
+ qty: number;
49
+ }, {
50
+ qty: number;
51
+ }>>;
52
+ properties: z.ZodObject<{
53
+ line_id: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ line_id: string;
56
+ }, {
57
+ line_id: string;
58
+ }>;
59
+ } & {
60
+ metric: z.ZodLiteral<"demand_by_line_by_month">;
61
+ }, "strip", z.ZodTypeAny, {
62
+ properties: {
63
+ line_id: string;
64
+ };
65
+ generated_at: Date;
66
+ metric: "demand_by_line_by_month";
67
+ data: Record<string, {
68
+ qty: number;
69
+ }>;
70
+ description?: string | undefined;
71
+ }, {
72
+ properties: {
73
+ line_id: string;
74
+ };
75
+ generated_at: Date;
76
+ metric: "demand_by_line_by_month";
77
+ data: Record<string, {
78
+ qty: number;
79
+ }>;
80
+ description?: string | undefined;
81
+ }>;
82
+ export declare const DemandByLineByDaySchema: z.ZodObject<{
83
+ description: z.ZodOptional<z.ZodString>;
84
+ generated_at: z.ZodDate;
85
+ properties: z.ZodObject<{
86
+ line_id: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ line_id: string;
89
+ }, {
90
+ line_id: string;
91
+ }>;
92
+ } & {
93
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
94
+ day_type: z.ZodEnum<["1", "2", "3"]>;
95
+ holiday: z.ZodEnum<["0", "1"]>;
96
+ notes: z.ZodNullable<z.ZodString>;
97
+ period: z.ZodEnum<["1", "2", "3"]>;
98
+ qty: z.ZodNumber;
99
+ }, "strip", z.ZodTypeAny, {
100
+ qty: number;
101
+ day_type: "1" | "2" | "3";
102
+ holiday: "0" | "1";
103
+ notes: string | null;
104
+ period: "1" | "2" | "3";
105
+ }, {
106
+ qty: number;
107
+ day_type: "1" | "2" | "3";
108
+ holiday: "0" | "1";
109
+ notes: string | null;
110
+ period: "1" | "2" | "3";
111
+ }>>;
112
+ metric: z.ZodLiteral<"demand_by_line_by_day">;
113
+ }, "strip", z.ZodTypeAny, {
114
+ properties: {
115
+ line_id: string;
116
+ };
117
+ generated_at: Date;
118
+ metric: "demand_by_line_by_day";
119
+ data: Record<string, {
120
+ qty: number;
121
+ day_type: "1" | "2" | "3";
122
+ holiday: "0" | "1";
123
+ notes: string | null;
124
+ period: "1" | "2" | "3";
125
+ }>;
126
+ description?: string | undefined;
127
+ }, {
128
+ properties: {
129
+ line_id: string;
130
+ };
131
+ generated_at: Date;
132
+ metric: "demand_by_line_by_day";
133
+ data: Record<string, {
134
+ qty: number;
135
+ day_type: "1" | "2" | "3";
136
+ holiday: "0" | "1";
137
+ notes: string | null;
138
+ period: "1" | "2" | "3";
139
+ }>;
140
+ description?: string | undefined;
141
+ }>;
142
+ export declare const MeanDemandByLineByMonthSchema: z.ZodObject<{
143
+ description: z.ZodOptional<z.ZodString>;
144
+ generated_at: z.ZodDate;
145
+ properties: z.ZodObject<{
146
+ line_id: z.ZodString;
147
+ }, "strip", z.ZodTypeAny, {
148
+ line_id: string;
149
+ }, {
150
+ line_id: string;
151
+ }>;
152
+ } & {
153
+ data: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
154
+ avg: z.ZodOptional<z.ZodNumber>;
155
+ count: z.ZodNumber;
156
+ qty: z.ZodNumber;
157
+ }, "strip", z.ZodTypeAny, {
158
+ qty: number;
159
+ count: number;
160
+ avg?: number | undefined;
161
+ }, {
162
+ qty: number;
163
+ count: number;
164
+ avg?: number | undefined;
165
+ }>>>;
166
+ metric: z.ZodLiteral<"mean_demand_by_line_by_month">;
167
+ }, "strip", z.ZodTypeAny, {
168
+ properties: {
169
+ line_id: string;
170
+ };
171
+ generated_at: Date;
172
+ metric: "mean_demand_by_line_by_month";
173
+ data: Record<string, Record<string, {
174
+ qty: number;
175
+ count: number;
176
+ avg?: number | undefined;
177
+ }>>;
178
+ description?: string | undefined;
179
+ }, {
180
+ properties: {
181
+ line_id: string;
182
+ };
183
+ generated_at: Date;
184
+ metric: "mean_demand_by_line_by_month";
185
+ data: Record<string, Record<string, {
186
+ qty: number;
187
+ count: number;
188
+ avg?: number | undefined;
189
+ }>>;
190
+ description?: string | undefined;
191
+ }>;
192
+ export declare const TopMeanDemandByLineByMonthSchema: z.ZodObject<{
193
+ description: z.ZodOptional<z.ZodString>;
194
+ generated_at: z.ZodDate;
195
+ } & {
196
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
197
+ increase_pct: z.ZodNumber;
198
+ qty: z.ZodNumber;
199
+ year_avg: z.ZodNumber;
200
+ }, "strip", z.ZodTypeAny, {
201
+ qty: number;
202
+ increase_pct: number;
203
+ year_avg: number;
204
+ }, {
205
+ qty: number;
206
+ increase_pct: number;
207
+ year_avg: number;
208
+ }>>;
209
+ metric: z.ZodLiteral<"top_mean_demand_by_line_by_month">;
210
+ properties: z.ZodObject<{
211
+ year_month: z.ZodString;
212
+ }, "strip", z.ZodTypeAny, {
213
+ year_month: string;
214
+ }, {
215
+ year_month: string;
216
+ }>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ properties: {
219
+ year_month: string;
220
+ };
221
+ generated_at: Date;
222
+ metric: "top_mean_demand_by_line_by_month";
223
+ data: Record<string, {
224
+ qty: number;
225
+ increase_pct: number;
226
+ year_avg: number;
227
+ }>;
228
+ description?: string | undefined;
229
+ }, {
230
+ properties: {
231
+ year_month: string;
232
+ };
233
+ generated_at: Date;
234
+ metric: "top_mean_demand_by_line_by_month";
235
+ data: Record<string, {
236
+ qty: number;
237
+ increase_pct: number;
238
+ year_avg: number;
239
+ }>;
240
+ description?: string | undefined;
241
+ }>;
242
+ export type DemandByLineByYear = z.infer<typeof DemandByLineByYearSchema>;
243
+ export type DemandByLineByMonth = z.infer<typeof DemandByLineByMonthSchema>;
244
+ export type DemandByLineByDay = z.infer<typeof DemandByLineByDaySchema>;
245
+ export type MeanDemandByLineByMonth = z.infer<typeof MeanDemandByLineByMonthSchema>;
246
+ export type TopMeanDemandByLineByMonth = z.infer<typeof TopMeanDemandByLineByMonthSchema>;
@@ -0,0 +1,56 @@
1
+ /* * */
2
+ import { MetricBaseSchema } from '../common.js';
3
+ import { z } from 'zod';
4
+ /* DEMAND BY LINE */
5
+ const DemandByLineSchema = MetricBaseSchema.extend({
6
+ data: z.record(z.string(), z.object({
7
+ qty: z.number(),
8
+ })),
9
+ properties: z.object({
10
+ line_id: z.string(),
11
+ }),
12
+ });
13
+ export const DemandByLineByYearSchema = DemandByLineSchema.extend({
14
+ metric: z.literal('demand_by_line_by_year'),
15
+ });
16
+ export const DemandByLineByMonthSchema = DemandByLineSchema.extend({
17
+ metric: z.literal('demand_by_line_by_month'),
18
+ });
19
+ export const DemandByLineByDaySchema = DemandByLineSchema.extend({
20
+ data: z.record(z.string(), z.object({
21
+ day_type: z.enum(['1', '2', '3']),
22
+ holiday: z.enum(['0', '1']),
23
+ notes: z.string().nullable(),
24
+ period: z.enum(['1', '2', '3']),
25
+ qty: z.number(),
26
+ })),
27
+ metric: z.literal('demand_by_line_by_day'),
28
+ });
29
+ // data: "2025-03": {
30
+ // "weekday": { "qty": 9300, "count": 31, "avg": 300 },
31
+ // "saturday": { "qty": 600, "count": 4, "avg": 150 },
32
+ // "sunday": { "qty": 200, "count": 4, "avg": 50 }
33
+ // },
34
+ export const MeanDemandByLineByMonthSchema = DemandByLineSchema.extend({
35
+ data: z.record(z.string(), z.record(z.string(), z.object({
36
+ avg: z.number().optional(),
37
+ count: z.number(),
38
+ qty: z.number(),
39
+ }))),
40
+ metric: z.literal('mean_demand_by_line_by_month'),
41
+ });
42
+ // data: {
43
+ // "12345": { increase: 20, qty: 4800, year_avg: 4000 },
44
+ // "67890": { increase: 18, qty: 3700, year_avg: 3130 },
45
+ // },
46
+ export const TopMeanDemandByLineByMonthSchema = DemandByLineSchema.extend({
47
+ data: z.record(z.string(), z.object({
48
+ increase_pct: z.number(),
49
+ qty: z.number(),
50
+ year_avg: z.number(),
51
+ })),
52
+ metric: z.literal('top_mean_demand_by_line_by_month'),
53
+ properties: z.object({
54
+ year_month: z.string(),
55
+ }),
56
+ });
@@ -0,0 +1,332 @@
1
+ import { z } from 'zod';
2
+ export declare const DemandByPatternByYearSchema: z.ZodObject<{
3
+ description: z.ZodOptional<z.ZodString>;
4
+ generated_at: z.ZodDate;
5
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
6
+ qty: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ qty: number;
9
+ }, {
10
+ qty: number;
11
+ }>>;
12
+ properties: z.ZodObject<{
13
+ pattern_id: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ pattern_id: string;
16
+ }, {
17
+ pattern_id: string;
18
+ }>;
19
+ } & {
20
+ metric: z.ZodLiteral<"demand_by_pattern_by_year">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ properties: {
23
+ pattern_id: string;
24
+ };
25
+ generated_at: Date;
26
+ metric: "demand_by_pattern_by_year";
27
+ data: Record<string, {
28
+ qty: number;
29
+ }>;
30
+ description?: string | undefined;
31
+ }, {
32
+ properties: {
33
+ pattern_id: string;
34
+ };
35
+ generated_at: Date;
36
+ metric: "demand_by_pattern_by_year";
37
+ data: Record<string, {
38
+ qty: number;
39
+ }>;
40
+ description?: string | undefined;
41
+ }>;
42
+ export declare const DemandByPatternByMonthSchema: z.ZodObject<{
43
+ description: z.ZodOptional<z.ZodString>;
44
+ generated_at: z.ZodDate;
45
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
46
+ qty: z.ZodNumber;
47
+ }, "strip", z.ZodTypeAny, {
48
+ qty: number;
49
+ }, {
50
+ qty: number;
51
+ }>>;
52
+ properties: z.ZodObject<{
53
+ pattern_id: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ pattern_id: string;
56
+ }, {
57
+ pattern_id: string;
58
+ }>;
59
+ } & {
60
+ metric: z.ZodLiteral<"demand_by_pattern_by_month">;
61
+ }, "strip", z.ZodTypeAny, {
62
+ properties: {
63
+ pattern_id: string;
64
+ };
65
+ generated_at: Date;
66
+ metric: "demand_by_pattern_by_month";
67
+ data: Record<string, {
68
+ qty: number;
69
+ }>;
70
+ description?: string | undefined;
71
+ }, {
72
+ properties: {
73
+ pattern_id: string;
74
+ };
75
+ generated_at: Date;
76
+ metric: "demand_by_pattern_by_month";
77
+ data: Record<string, {
78
+ qty: number;
79
+ }>;
80
+ description?: string | undefined;
81
+ }>;
82
+ export declare const DemandByPatternByDaySchema: z.ZodObject<{
83
+ description: z.ZodOptional<z.ZodString>;
84
+ generated_at: z.ZodDate;
85
+ properties: z.ZodObject<{
86
+ pattern_id: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ pattern_id: string;
89
+ }, {
90
+ pattern_id: string;
91
+ }>;
92
+ } & {
93
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
94
+ day_type: z.ZodEnum<["1", "2", "3"]>;
95
+ holiday: z.ZodEnum<["0", "1"]>;
96
+ notes: z.ZodNullable<z.ZodString>;
97
+ period: z.ZodEnum<["1", "2", "3"]>;
98
+ qty: z.ZodNumber;
99
+ }, "strip", z.ZodTypeAny, {
100
+ qty: number;
101
+ day_type: "1" | "2" | "3";
102
+ holiday: "0" | "1";
103
+ notes: string | null;
104
+ period: "1" | "2" | "3";
105
+ }, {
106
+ qty: number;
107
+ day_type: "1" | "2" | "3";
108
+ holiday: "0" | "1";
109
+ notes: string | null;
110
+ period: "1" | "2" | "3";
111
+ }>>;
112
+ metric: z.ZodLiteral<"demand_by_pattern_by_day">;
113
+ }, "strip", z.ZodTypeAny, {
114
+ properties: {
115
+ pattern_id: string;
116
+ };
117
+ generated_at: Date;
118
+ metric: "demand_by_pattern_by_day";
119
+ data: Record<string, {
120
+ qty: number;
121
+ day_type: "1" | "2" | "3";
122
+ holiday: "0" | "1";
123
+ notes: string | null;
124
+ period: "1" | "2" | "3";
125
+ }>;
126
+ description?: string | undefined;
127
+ }, {
128
+ properties: {
129
+ pattern_id: string;
130
+ };
131
+ generated_at: Date;
132
+ metric: "demand_by_pattern_by_day";
133
+ data: Record<string, {
134
+ qty: number;
135
+ day_type: "1" | "2" | "3";
136
+ holiday: "0" | "1";
137
+ notes: string | null;
138
+ period: "1" | "2" | "3";
139
+ }>;
140
+ description?: string | undefined;
141
+ }>;
142
+ export declare const DemandByPatternHourByYearSchema: z.ZodObject<{
143
+ description: z.ZodOptional<z.ZodString>;
144
+ generated_at: z.ZodDate;
145
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
146
+ qty: z.ZodNumber;
147
+ }, "strip", z.ZodTypeAny, {
148
+ qty: number;
149
+ }, {
150
+ qty: number;
151
+ }>>;
152
+ properties: z.ZodObject<{
153
+ hour: z.ZodNumber;
154
+ line_id: z.ZodString;
155
+ minute: z.ZodNumber;
156
+ pattern_id: z.ZodString;
157
+ }, "strip", z.ZodTypeAny, {
158
+ line_id: string;
159
+ pattern_id: string;
160
+ hour: number;
161
+ minute: number;
162
+ }, {
163
+ line_id: string;
164
+ pattern_id: string;
165
+ hour: number;
166
+ minute: number;
167
+ }>;
168
+ } & {
169
+ metric: z.ZodLiteral<"demand_by_pattern_hour_by_year">;
170
+ }, "strip", z.ZodTypeAny, {
171
+ properties: {
172
+ line_id: string;
173
+ pattern_id: string;
174
+ hour: number;
175
+ minute: number;
176
+ };
177
+ generated_at: Date;
178
+ metric: "demand_by_pattern_hour_by_year";
179
+ data: Record<string, {
180
+ qty: number;
181
+ }>;
182
+ description?: string | undefined;
183
+ }, {
184
+ properties: {
185
+ line_id: string;
186
+ pattern_id: string;
187
+ hour: number;
188
+ minute: number;
189
+ };
190
+ generated_at: Date;
191
+ metric: "demand_by_pattern_hour_by_year";
192
+ data: Record<string, {
193
+ qty: number;
194
+ }>;
195
+ description?: string | undefined;
196
+ }>;
197
+ export declare const DemandByPatternHourByMonthSchema: z.ZodObject<{
198
+ description: z.ZodOptional<z.ZodString>;
199
+ generated_at: z.ZodDate;
200
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
201
+ qty: z.ZodNumber;
202
+ }, "strip", z.ZodTypeAny, {
203
+ qty: number;
204
+ }, {
205
+ qty: number;
206
+ }>>;
207
+ properties: z.ZodObject<{
208
+ hour: z.ZodNumber;
209
+ line_id: z.ZodString;
210
+ minute: z.ZodNumber;
211
+ pattern_id: z.ZodString;
212
+ }, "strip", z.ZodTypeAny, {
213
+ line_id: string;
214
+ pattern_id: string;
215
+ hour: number;
216
+ minute: number;
217
+ }, {
218
+ line_id: string;
219
+ pattern_id: string;
220
+ hour: number;
221
+ minute: number;
222
+ }>;
223
+ } & {
224
+ metric: z.ZodLiteral<"demand_by_pattern_hour_by_month">;
225
+ }, "strip", z.ZodTypeAny, {
226
+ properties: {
227
+ line_id: string;
228
+ pattern_id: string;
229
+ hour: number;
230
+ minute: number;
231
+ };
232
+ generated_at: Date;
233
+ metric: "demand_by_pattern_hour_by_month";
234
+ data: Record<string, {
235
+ qty: number;
236
+ }>;
237
+ description?: string | undefined;
238
+ }, {
239
+ properties: {
240
+ line_id: string;
241
+ pattern_id: string;
242
+ hour: number;
243
+ minute: number;
244
+ };
245
+ generated_at: Date;
246
+ metric: "demand_by_pattern_hour_by_month";
247
+ data: Record<string, {
248
+ qty: number;
249
+ }>;
250
+ description?: string | undefined;
251
+ }>;
252
+ export declare const DemandByPatternHourByDaySchema: z.ZodObject<{
253
+ description: z.ZodOptional<z.ZodString>;
254
+ generated_at: z.ZodDate;
255
+ properties: z.ZodObject<{
256
+ hour: z.ZodNumber;
257
+ line_id: z.ZodString;
258
+ minute: z.ZodNumber;
259
+ pattern_id: z.ZodString;
260
+ }, "strip", z.ZodTypeAny, {
261
+ line_id: string;
262
+ pattern_id: string;
263
+ hour: number;
264
+ minute: number;
265
+ }, {
266
+ line_id: string;
267
+ pattern_id: string;
268
+ hour: number;
269
+ minute: number;
270
+ }>;
271
+ } & {
272
+ data: z.ZodRecord<z.ZodString, z.ZodObject<{
273
+ day_type: z.ZodEnum<["1", "2", "3"]>;
274
+ holiday: z.ZodEnum<["0", "1"]>;
275
+ notes: z.ZodNullable<z.ZodString>;
276
+ period: z.ZodEnum<["1", "2", "3"]>;
277
+ qty: z.ZodNumber;
278
+ }, "strip", z.ZodTypeAny, {
279
+ qty: number;
280
+ day_type: "1" | "2" | "3";
281
+ holiday: "0" | "1";
282
+ notes: string | null;
283
+ period: "1" | "2" | "3";
284
+ }, {
285
+ qty: number;
286
+ day_type: "1" | "2" | "3";
287
+ holiday: "0" | "1";
288
+ notes: string | null;
289
+ period: "1" | "2" | "3";
290
+ }>>;
291
+ metric: z.ZodLiteral<"demand_by_pattern_hour_by_day">;
292
+ }, "strip", z.ZodTypeAny, {
293
+ properties: {
294
+ line_id: string;
295
+ pattern_id: string;
296
+ hour: number;
297
+ minute: number;
298
+ };
299
+ generated_at: Date;
300
+ metric: "demand_by_pattern_hour_by_day";
301
+ data: Record<string, {
302
+ qty: number;
303
+ day_type: "1" | "2" | "3";
304
+ holiday: "0" | "1";
305
+ notes: string | null;
306
+ period: "1" | "2" | "3";
307
+ }>;
308
+ description?: string | undefined;
309
+ }, {
310
+ properties: {
311
+ line_id: string;
312
+ pattern_id: string;
313
+ hour: number;
314
+ minute: number;
315
+ };
316
+ generated_at: Date;
317
+ metric: "demand_by_pattern_hour_by_day";
318
+ data: Record<string, {
319
+ qty: number;
320
+ day_type: "1" | "2" | "3";
321
+ holiday: "0" | "1";
322
+ notes: string | null;
323
+ period: "1" | "2" | "3";
324
+ }>;
325
+ description?: string | undefined;
326
+ }>;
327
+ export type DemandByPatternByYear = z.infer<typeof DemandByPatternByYearSchema>;
328
+ export type DemandByPatternByMonth = z.infer<typeof DemandByPatternByMonthSchema>;
329
+ export type DemandByPatternByDay = z.infer<typeof DemandByPatternByDaySchema>;
330
+ export type DemandByPatternHourByYear = z.infer<typeof DemandByPatternHourByYearSchema>;
331
+ export type DemandByPatternHourByMonth = z.infer<typeof DemandByPatternHourByMonthSchema>;
332
+ export type DemandByPatternHourByDay = z.infer<typeof DemandByPatternHourByDaySchema>;
@@ -0,0 +1,56 @@
1
+ /* * */
2
+ import { MetricBaseSchema } from '../common.js';
3
+ import { z } from 'zod';
4
+ /* DEMAND BY PATTERN */
5
+ const DemandByPatternSchema = MetricBaseSchema.extend({
6
+ data: z.record(z.string(), z.object({
7
+ qty: z.number(),
8
+ })),
9
+ properties: z.object({
10
+ pattern_id: z.string(),
11
+ }),
12
+ });
13
+ export const DemandByPatternByYearSchema = DemandByPatternSchema.extend({
14
+ metric: z.literal('demand_by_pattern_by_year'),
15
+ });
16
+ export const DemandByPatternByMonthSchema = DemandByPatternSchema.extend({
17
+ metric: z.literal('demand_by_pattern_by_month'),
18
+ });
19
+ export const DemandByPatternByDaySchema = DemandByPatternSchema.extend({
20
+ data: z.record(z.string(), z.object({
21
+ day_type: z.enum(['1', '2', '3']),
22
+ holiday: z.enum(['0', '1']),
23
+ notes: z.string().nullable(),
24
+ period: z.enum(['1', '2', '3']),
25
+ qty: z.number(),
26
+ })),
27
+ metric: z.literal('demand_by_pattern_by_day'),
28
+ });
29
+ /* DEMAND BY PATTERN_HOUR */
30
+ const DemandByPatternHourSchema = MetricBaseSchema.extend({
31
+ data: z.record(z.string(), z.object({
32
+ qty: z.number(),
33
+ })),
34
+ properties: z.object({
35
+ hour: z.number().min(0).max(23),
36
+ line_id: z.string(),
37
+ minute: z.number().min(0).max(59),
38
+ pattern_id: z.string(),
39
+ }),
40
+ });
41
+ export const DemandByPatternHourByYearSchema = DemandByPatternHourSchema.extend({
42
+ metric: z.literal('demand_by_pattern_hour_by_year'),
43
+ });
44
+ export const DemandByPatternHourByMonthSchema = DemandByPatternHourSchema.extend({
45
+ metric: z.literal('demand_by_pattern_hour_by_month'),
46
+ });
47
+ export const DemandByPatternHourByDaySchema = DemandByPatternHourSchema.extend({
48
+ data: z.record(z.string(), z.object({
49
+ day_type: z.enum(['1', '2', '3']),
50
+ holiday: z.enum(['0', '1']),
51
+ notes: z.string().nullable(),
52
+ period: z.enum(['1', '2', '3']),
53
+ qty: z.number(),
54
+ })),
55
+ metric: z.literal('demand_by_pattern_hour_by_day'),
56
+ });