@tmlmobilidade/types 20251103.1255.55 → 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 -407
  137. package/dist/src/file-exports/ride-export.js +0 -120
  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,41 @@
1
+ import { z } from 'zod';
2
+ /* * */
3
+ import { MetricBaseSchema } from './common.js';
4
+ /* * */
5
+ const NowLastWeekSchema = z.object({
6
+ last_week: z.number(),
7
+ now: z.number(),
8
+ });
9
+ /* REALTIME DEMAND */
10
+ export const RealtimeDemandSchema = MetricBaseSchema.extend({
11
+ data: z.object({
12
+ agencies: z.record(z.string(), NowLastWeekSchema),
13
+ total: NowLastWeekSchema,
14
+ }),
15
+ metric: z.literal('realtime_demand'),
16
+ });
17
+ export const RealtimeServiceComplianceSchema = MetricBaseSchema.extend({
18
+ data: z.object({
19
+ agencies: z.record(z.string(), z.object({
20
+ accomplished_rides: NowLastWeekSchema,
21
+ advanced_rides: NowLastWeekSchema,
22
+ five_min_delays: NowLastWeekSchema,
23
+ mean_delay_minutes: NowLastWeekSchema,
24
+ no_passengers_rides: NowLastWeekSchema,
25
+ rides_with_sales: NowLastWeekSchema,
26
+ scheduled_rides: NowLastWeekSchema,
27
+ valid_rides: NowLastWeekSchema,
28
+ })),
29
+ total: z.object({
30
+ accomplished_rides: NowLastWeekSchema,
31
+ advanced_rides: NowLastWeekSchema,
32
+ five_min_delays: NowLastWeekSchema,
33
+ mean_delay_minutes: NowLastWeekSchema,
34
+ no_passengers_rides: NowLastWeekSchema,
35
+ rides_with_sales: NowLastWeekSchema,
36
+ scheduled_rides: NowLastWeekSchema,
37
+ valid_rides: NowLastWeekSchema,
38
+ }),
39
+ }),
40
+ metric: z.literal('realtime_service_compliance'),
41
+ });
@@ -2,9 +2,9 @@ import { z } from 'zod';
2
2
  export type Notification = z.infer<typeof NotificationSchema>;
3
3
  export declare const NotificationSchema: z.ZodObject<{
4
4
  _id: z.ZodString;
5
- created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
5
+ created_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
6
6
  created_by: z.ZodOptional<z.ZodString>;
7
- updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
7
+ updated_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
8
8
  updated_by: z.ZodOptional<z.ZodString>;
9
9
  } & {
10
10
  is_read: z.ZodBoolean;
@@ -69,9 +69,9 @@ export declare const NotificationSchema: z.ZodObject<{
69
69
  }>;
70
70
  export declare const CreateNotificationSchema: z.ZodObject<Omit<{
71
71
  _id: z.ZodString;
72
- created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
72
+ created_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
73
73
  created_by: z.ZodOptional<z.ZodString>;
74
- updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
74
+ updated_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
75
75
  updated_by: z.ZodOptional<z.ZodString>;
76
76
  } & {
77
77
  is_read: z.ZodBoolean;
@@ -4,7 +4,7 @@ export declare const HomeLinkSchema: z.ZodObject<{
4
4
  icon: z.ZodString;
5
5
  order: z.ZodNumber;
6
6
  title: z.ZodString;
7
- }, "strict", z.ZodTypeAny, {
7
+ }, "strip", z.ZodTypeAny, {
8
8
  title: string;
9
9
  href: string;
10
10
  icon: string;
@@ -18,9 +18,9 @@ export declare const HomeLinkSchema: z.ZodObject<{
18
18
  export type HomeLink = z.infer<typeof HomeLinkSchema>;
19
19
  export declare const OrganizationSchema: z.ZodObject<{
20
20
  _id: z.ZodString;
21
- created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
21
+ created_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
22
22
  created_by: z.ZodOptional<z.ZodString>;
23
- updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
23
+ updated_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
24
24
  updated_by: z.ZodOptional<z.ZodString>;
25
25
  } & {
26
26
  home_links: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -28,7 +28,7 @@ export declare const OrganizationSchema: z.ZodObject<{
28
28
  icon: z.ZodString;
29
29
  order: z.ZodNumber;
30
30
  title: z.ZodString;
31
- }, "strict", z.ZodTypeAny, {
31
+ }, "strip", z.ZodTypeAny, {
32
32
  title: string;
33
33
  href: string;
34
34
  icon: string;
@@ -40,12 +40,12 @@ export declare const OrganizationSchema: z.ZodObject<{
40
40
  order: number;
41
41
  }>, "many">>;
42
42
  home_wikis: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
43
- logo_dark: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
- logo_light: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ logo_dark: z.ZodNullable<z.ZodString>;
44
+ logo_light: z.ZodNullable<z.ZodString>;
45
45
  long_name: z.ZodString;
46
46
  short_name: z.ZodString;
47
- theme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
- }, "strict", z.ZodTypeAny, {
47
+ theme: z.ZodNullable<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
49
  _id: string;
50
50
  created_at: number & {
51
51
  __brand: "UnixTimestamp";
@@ -61,18 +61,21 @@ export declare const OrganizationSchema: z.ZodObject<{
61
61
  order: number;
62
62
  }[];
63
63
  home_wikis: string[];
64
+ logo_dark: string | null;
65
+ logo_light: string | null;
64
66
  long_name: string;
67
+ theme: string | null;
65
68
  created_by?: string | undefined;
66
69
  updated_by?: string | undefined;
67
- logo_dark?: string | null | undefined;
68
- logo_light?: string | null | undefined;
69
- theme?: string | null | undefined;
70
70
  }, {
71
71
  _id: string;
72
72
  created_at: number;
73
73
  updated_at: number;
74
74
  short_name: string;
75
+ logo_dark: string | null;
76
+ logo_light: string | null;
75
77
  long_name: string;
78
+ theme: string | null;
76
79
  created_by?: string | undefined;
77
80
  updated_by?: string | undefined;
78
81
  home_links?: {
@@ -82,15 +85,12 @@ export declare const OrganizationSchema: z.ZodObject<{
82
85
  order: number;
83
86
  }[] | undefined;
84
87
  home_wikis?: string[] | undefined;
85
- logo_dark?: string | null | undefined;
86
- logo_light?: string | null | undefined;
87
- theme?: string | null | undefined;
88
88
  }>;
89
89
  export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
90
90
  _id: z.ZodString;
91
- created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
91
+ created_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
92
92
  created_by: z.ZodOptional<z.ZodString>;
93
- updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
93
+ updated_at: z.ZodEffects<z.ZodNumber, import("./index.js").UnixTimestamp, number>;
94
94
  updated_by: z.ZodOptional<z.ZodString>;
95
95
  } & {
96
96
  home_links: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -98,7 +98,7 @@ export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
98
98
  icon: z.ZodString;
99
99
  order: z.ZodNumber;
100
100
  title: z.ZodString;
101
- }, "strict", z.ZodTypeAny, {
101
+ }, "strip", z.ZodTypeAny, {
102
102
  title: string;
103
103
  href: string;
104
104
  icon: string;
@@ -110,12 +110,12 @@ export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
110
110
  order: number;
111
111
  }>, "many">>;
112
112
  home_wikis: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
113
- logo_dark: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
- logo_light: z.ZodOptional<z.ZodNullable<z.ZodString>>;
113
+ logo_dark: z.ZodNullable<z.ZodString>;
114
+ logo_light: z.ZodNullable<z.ZodString>;
115
115
  long_name: z.ZodString;
116
116
  short_name: z.ZodString;
117
- theme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
- }, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
117
+ theme: z.ZodNullable<z.ZodString>;
118
+ }, "_id" | "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
119
119
  short_name: string;
120
120
  home_links: {
121
121
  title: string;
@@ -124,15 +124,18 @@ export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
124
124
  order: number;
125
125
  }[];
126
126
  home_wikis: string[];
127
+ logo_dark: string | null;
128
+ logo_light: string | null;
127
129
  long_name: string;
130
+ theme: string | null;
128
131
  created_by?: string | undefined;
129
132
  updated_by?: string | undefined;
130
- logo_dark?: string | null | undefined;
131
- logo_light?: string | null | undefined;
132
- theme?: string | null | undefined;
133
133
  }, {
134
134
  short_name: string;
135
+ logo_dark: string | null;
136
+ logo_light: string | null;
135
137
  long_name: string;
138
+ theme: string | null;
136
139
  created_by?: string | undefined;
137
140
  updated_by?: string | undefined;
138
141
  home_links?: {
@@ -142,9 +145,6 @@ export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
142
145
  order: number;
143
146
  }[] | undefined;
144
147
  home_wikis?: string[] | undefined;
145
- logo_dark?: string | null | undefined;
146
- logo_light?: string | null | undefined;
147
- theme?: string | null | undefined;
148
148
  }>;
149
149
  export declare const UpdateOrganizationSchema: z.ZodObject<{
150
150
  updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -154,7 +154,7 @@ export declare const UpdateOrganizationSchema: z.ZodObject<{
154
154
  icon: z.ZodString;
155
155
  order: z.ZodNumber;
156
156
  title: z.ZodString;
157
- }, "strict", z.ZodTypeAny, {
157
+ }, "strip", z.ZodTypeAny, {
158
158
  title: string;
159
159
  href: string;
160
160
  icon: string;
@@ -166,11 +166,11 @@ export declare const UpdateOrganizationSchema: z.ZodObject<{
166
166
  order: number;
167
167
  }>, "many">>>;
168
168
  home_wikis: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
169
- logo_dark: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
170
- logo_light: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
169
+ logo_dark: z.ZodOptional<z.ZodNullable<z.ZodString>>;
170
+ logo_light: z.ZodOptional<z.ZodNullable<z.ZodString>>;
171
171
  long_name: z.ZodOptional<z.ZodString>;
172
- theme: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
173
- }, "strict", z.ZodTypeAny, {
172
+ theme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
+ }, "strip", z.ZodTypeAny, {
174
174
  updated_by?: string | undefined;
175
175
  short_name?: string | undefined;
176
176
  home_links?: {
@@ -7,16 +7,16 @@ export const HomeLinkSchema = z.object({
7
7
  icon: z.string(),
8
8
  order: z.number().min(0),
9
9
  title: z.string(),
10
- }).strict();
10
+ });
11
11
  /* * */
12
12
  export const OrganizationSchema = DocumentSchema.extend({
13
13
  home_links: z.array(HomeLinkSchema).default([]),
14
14
  home_wikis: z.array(z.string()).default([]),
15
- logo_dark: z.string().nullish(),
16
- logo_light: z.string().nullish(),
17
- long_name: z.string().nonempty(),
18
- short_name: z.string().nonempty(),
19
- theme: z.string().nullish(),
20
- }).strict();
15
+ logo_dark: z.string().nullable(),
16
+ logo_light: z.string().nullable(),
17
+ long_name: z.string(),
18
+ short_name: z.string(),
19
+ theme: z.string().nullable(),
20
+ });
21
21
  export const CreateOrganizationSchema = OrganizationSchema.omit({ _id: true, created_at: true, updated_at: true });
22
22
  export const UpdateOrganizationSchema = CreateOrganizationSchema.omit({ created_by: true }).partial();
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const AgenciesPermissionSchema: z.ZodObject<{
3
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
4
+ scope: z.ZodLiteral<"agencies">;
5
+ }, "strip", z.ZodTypeAny, {
6
+ scope: "agencies";
7
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
8
+ }, {
9
+ scope: "agencies";
10
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
11
+ }>;
12
+ export type AgenciesPermission = z.infer<typeof AgenciesPermissionSchema>;
@@ -0,0 +1,13 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const AgenciesPermissionSchema = z.object({
5
+ action: z.enum([
6
+ 'create',
7
+ 'delete',
8
+ 'read',
9
+ 'toggle_lock',
10
+ 'update',
11
+ ]),
12
+ scope: z.literal('agencies'),
13
+ });
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export declare const AlertsScheduledPermissionSchema: z.ZodObject<{
3
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
4
+ scope: z.ZodLiteral<"alerts_scheduled">;
5
+ }, "strip", z.ZodTypeAny, {
6
+ scope: "alerts_scheduled";
7
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
8
+ }, {
9
+ scope: "alerts_scheduled";
10
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
11
+ }>;
12
+ export type AlertsScheduledPermission = z.infer<typeof AlertsScheduledPermissionSchema>;
13
+ export declare const AlertsRealtimePermissionSchema: z.ZodObject<{
14
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
15
+ resources: z.ZodDefault<z.ZodObject<{
16
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ agency_ids: string[];
19
+ }, {
20
+ agency_ids?: string[] | undefined;
21
+ }>>;
22
+ scope: z.ZodLiteral<"alerts_realtime">;
23
+ }, "strip", z.ZodTypeAny, {
24
+ scope: "alerts_realtime";
25
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
26
+ resources: {
27
+ agency_ids: string[];
28
+ };
29
+ }, {
30
+ scope: "alerts_realtime";
31
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
32
+ resources?: {
33
+ agency_ids?: string[] | undefined;
34
+ } | undefined;
35
+ }>;
36
+ export type AlertsRealtimePermission = z.infer<typeof AlertsRealtimePermissionSchema>;
@@ -0,0 +1,25 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const AlertsScheduledPermissionSchema = z.object({
5
+ action: z.enum(['create',
6
+ 'delete',
7
+ 'read',
8
+ 'toggle_lock',
9
+ 'update',
10
+ ]),
11
+ scope: z.literal('alerts_scheduled'),
12
+ });
13
+ /* * */
14
+ export const AlertsRealtimePermissionSchema = z.object({
15
+ action: z.enum(['create',
16
+ 'delete',
17
+ 'read',
18
+ 'toggle_lock',
19
+ 'update',
20
+ ]),
21
+ resources: z.object({
22
+ agency_ids: z.array(z.string()).default([]),
23
+ }).default({}),
24
+ scope: z.literal('alerts_realtime'),
25
+ });
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export declare const RidesPermissionSchema: z.ZodObject<{
3
+ action: z.ZodEnum<["acceptance_change_status", "acceptance_justify", "acceptance_lock", "acceptance_read", "analsys_lock", "analysis_lock", "analysis_read", "analysis_reprocess", "analysis_update", "audit_lock", "audit_read", "audit_update"]>;
4
+ resources: z.ZodDefault<z.ZodObject<{
5
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ agency_ids: string[];
8
+ }, {
9
+ agency_ids?: string[] | undefined;
10
+ }>>;
11
+ scope: z.ZodLiteral<"rides">;
12
+ }, "strip", z.ZodTypeAny, {
13
+ scope: "rides";
14
+ action: "acceptance_change_status" | "acceptance_justify" | "acceptance_lock" | "acceptance_read" | "analsys_lock" | "analysis_lock" | "analysis_read" | "analysis_reprocess" | "analysis_update" | "audit_lock" | "audit_read" | "audit_update";
15
+ resources: {
16
+ agency_ids: string[];
17
+ };
18
+ }, {
19
+ scope: "rides";
20
+ action: "acceptance_change_status" | "acceptance_justify" | "acceptance_lock" | "acceptance_read" | "analsys_lock" | "analysis_lock" | "analysis_read" | "analysis_reprocess" | "analysis_update" | "audit_lock" | "audit_read" | "audit_update";
21
+ resources?: {
22
+ agency_ids?: string[] | undefined;
23
+ } | undefined;
24
+ }>;
25
+ export type RidesPermission = z.infer<typeof RidesPermissionSchema>;
26
+ export declare const SamsPermissionSchema: z.ZodObject<{
27
+ action: z.ZodEnum<["read"]>;
28
+ scope: z.ZodLiteral<"sams">;
29
+ }, "strip", z.ZodTypeAny, {
30
+ scope: "sams";
31
+ action: "read";
32
+ }, {
33
+ scope: "sams";
34
+ action: "read";
35
+ }>;
36
+ export type SamsPermission = z.infer<typeof SamsPermissionSchema>;
@@ -0,0 +1,30 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const RidesPermissionSchema = z.object({
5
+ action: z.enum([
6
+ 'acceptance_change_status',
7
+ 'acceptance_justify',
8
+ 'acceptance_lock',
9
+ 'acceptance_read',
10
+ 'analsys_lock',
11
+ 'analysis_lock',
12
+ 'analysis_read',
13
+ 'analysis_reprocess',
14
+ 'analysis_update',
15
+ 'audit_lock',
16
+ 'audit_read',
17
+ 'audit_update',
18
+ ]),
19
+ resources: z.object({
20
+ agency_ids: z.array(z.string()).default([]),
21
+ }).default({}),
22
+ scope: z.literal('rides'),
23
+ });
24
+ /* * */
25
+ export const SamsPermissionSchema = z.object({
26
+ action: z.enum([
27
+ 'read',
28
+ ]),
29
+ scope: z.literal('sams'),
30
+ });
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare const GtfsValidationsPermissionSchema: z.ZodObject<{
3
+ action: z.ZodEnum<["create", "read", "request_approval"]>;
4
+ resources: z.ZodDefault<z.ZodObject<{
5
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ agency_ids: string[];
8
+ }, {
9
+ agency_ids?: string[] | undefined;
10
+ }>>;
11
+ scope: z.ZodLiteral<"gtfs_validations">;
12
+ }, "strip", z.ZodTypeAny, {
13
+ scope: "gtfs_validations";
14
+ action: "create" | "read" | "request_approval";
15
+ resources: {
16
+ agency_ids: string[];
17
+ };
18
+ }, {
19
+ scope: "gtfs_validations";
20
+ action: "create" | "read" | "request_approval";
21
+ resources?: {
22
+ agency_ids?: string[] | undefined;
23
+ } | undefined;
24
+ }>;
25
+ export type GtfsValidationsPermission = z.infer<typeof GtfsValidationsPermissionSchema>;
@@ -0,0 +1,14 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const GtfsValidationsPermissionSchema = z.object({
5
+ action: z.enum([
6
+ 'create',
7
+ 'read',
8
+ 'request_approval',
9
+ ]),
10
+ resources: z.object({
11
+ agency_ids: z.array(z.string()).default([]),
12
+ }).default({}),
13
+ scope: z.literal('gtfs_validations'),
14
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const HomePermissionSchema: z.ZodObject<{
3
+ action: z.ZodEnum<["read_links", "read_wiki"]>;
4
+ scope: z.ZodLiteral<"home">;
5
+ }, "strip", z.ZodTypeAny, {
6
+ scope: "home";
7
+ action: "read_links" | "read_wiki";
8
+ }, {
9
+ scope: "home";
10
+ action: "read_links" | "read_wiki";
11
+ }>;
12
+ export type HomePermission = z.infer<typeof HomePermissionSchema>;
@@ -0,0 +1,10 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const HomePermissionSchema = z.object({
5
+ action: z.enum([
6
+ 'read_links',
7
+ 'read_wiki',
8
+ ]),
9
+ scope: z.literal('home'),
10
+ });