@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,958 @@
1
+ import { z } from 'zod';
2
+ export declare const RoleSchema: z.ZodObject<{
3
+ _id: z.ZodString;
4
+ created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
5
+ created_by: z.ZodOptional<z.ZodString>;
6
+ updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
7
+ updated_by: z.ZodOptional<z.ZodString>;
8
+ } & {
9
+ name: z.ZodString;
10
+ permissions: z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
11
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
12
+ scope: z.ZodLiteral<"agencies">;
13
+ }, "strip", z.ZodTypeAny, {
14
+ scope: "agencies";
15
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
16
+ }, {
17
+ scope: "agencies";
18
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
19
+ }>, z.ZodObject<{
20
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
21
+ scope: z.ZodLiteral<"alerts_scheduled">;
22
+ }, "strip", z.ZodTypeAny, {
23
+ scope: "alerts_scheduled";
24
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
25
+ }, {
26
+ scope: "alerts_scheduled";
27
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
28
+ }>, z.ZodObject<{
29
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
30
+ resources: z.ZodDefault<z.ZodObject<{
31
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ agency_ids: string[];
34
+ }, {
35
+ agency_ids?: string[] | undefined;
36
+ }>>;
37
+ scope: z.ZodLiteral<"alerts_realtime">;
38
+ }, "strip", z.ZodTypeAny, {
39
+ scope: "alerts_realtime";
40
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
41
+ resources: {
42
+ agency_ids: string[];
43
+ };
44
+ }, {
45
+ scope: "alerts_realtime";
46
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
47
+ resources?: {
48
+ agency_ids?: string[] | undefined;
49
+ } | undefined;
50
+ }>, z.ZodObject<{
51
+ 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"]>;
52
+ resources: z.ZodDefault<z.ZodObject<{
53
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ agency_ids: string[];
56
+ }, {
57
+ agency_ids?: string[] | undefined;
58
+ }>>;
59
+ scope: z.ZodLiteral<"rides">;
60
+ }, "strip", z.ZodTypeAny, {
61
+ scope: "rides";
62
+ 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";
63
+ resources: {
64
+ agency_ids: string[];
65
+ };
66
+ }, {
67
+ scope: "rides";
68
+ 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";
69
+ resources?: {
70
+ agency_ids?: string[] | undefined;
71
+ } | undefined;
72
+ }>, z.ZodObject<{
73
+ action: z.ZodEnum<["read"]>;
74
+ scope: z.ZodLiteral<"sams">;
75
+ }, "strip", z.ZodTypeAny, {
76
+ scope: "sams";
77
+ action: "read";
78
+ }, {
79
+ scope: "sams";
80
+ action: "read";
81
+ }>, z.ZodObject<{
82
+ action: z.ZodEnum<["create", "read", "request_approval"]>;
83
+ resources: z.ZodDefault<z.ZodObject<{
84
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ agency_ids: string[];
87
+ }, {
88
+ agency_ids?: string[] | undefined;
89
+ }>>;
90
+ scope: z.ZodLiteral<"gtfs_validations">;
91
+ }, "strip", z.ZodTypeAny, {
92
+ scope: "gtfs_validations";
93
+ action: "create" | "read" | "request_approval";
94
+ resources: {
95
+ agency_ids: string[];
96
+ };
97
+ }, {
98
+ scope: "gtfs_validations";
99
+ action: "create" | "read" | "request_approval";
100
+ resources?: {
101
+ agency_ids?: string[] | undefined;
102
+ } | undefined;
103
+ }>, z.ZodObject<{
104
+ action: z.ZodEnum<["read_links", "read_wiki"]>;
105
+ scope: z.ZodLiteral<"home">;
106
+ }, "strip", z.ZodTypeAny, {
107
+ scope: "home";
108
+ action: "read_links" | "read_wiki";
109
+ }, {
110
+ scope: "home";
111
+ action: "read_links" | "read_wiki";
112
+ }>, z.ZodObject<{
113
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
114
+ scope: z.ZodLiteral<"organizations">;
115
+ }, "strip", z.ZodTypeAny, {
116
+ scope: "organizations";
117
+ action: "create" | "update" | "delete" | "read";
118
+ }, {
119
+ scope: "organizations";
120
+ action: "create" | "update" | "delete" | "read";
121
+ }>, z.ZodObject<{
122
+ action: z.ZodEnum<["read"]>;
123
+ scope: z.ZodLiteral<"performance">;
124
+ }, "strip", z.ZodTypeAny, {
125
+ scope: "performance";
126
+ action: "read";
127
+ }, {
128
+ scope: "performance";
129
+ action: "read";
130
+ }>, z.ZodObject<{
131
+ action: z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "toggle_lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy"]>;
132
+ resources: z.ZodDefault<z.ZodObject<{
133
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
134
+ }, "strip", z.ZodTypeAny, {
135
+ agency_ids: string[];
136
+ }, {
137
+ agency_ids?: string[] | undefined;
138
+ }>>;
139
+ scope: z.ZodLiteral<"plans">;
140
+ }, "strip", z.ZodTypeAny, {
141
+ scope: "plans";
142
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
143
+ resources: {
144
+ agency_ids: string[];
145
+ };
146
+ }, {
147
+ scope: "plans";
148
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
149
+ resources?: {
150
+ agency_ids?: string[] | undefined;
151
+ } | undefined;
152
+ }>, z.ZodObject<{
153
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
154
+ scope: z.ZodLiteral<"roles">;
155
+ }, "strip", z.ZodTypeAny, {
156
+ scope: "roles";
157
+ action: "create" | "update" | "delete" | "read";
158
+ }, {
159
+ scope: "roles";
160
+ action: "create" | "update" | "delete" | "read";
161
+ }>, z.ZodObject<{
162
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
163
+ resources: z.ZodDefault<z.ZodObject<{
164
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
165
+ municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ municipality_ids: string[];
168
+ agency_ids: string[];
169
+ }, {
170
+ municipality_ids?: string[] | undefined;
171
+ agency_ids?: string[] | undefined;
172
+ }>>;
173
+ scope: z.ZodLiteral<"stops">;
174
+ }, "strip", z.ZodTypeAny, {
175
+ scope: "stops";
176
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
177
+ resources: {
178
+ municipality_ids: string[];
179
+ agency_ids: string[];
180
+ };
181
+ }, {
182
+ scope: "stops";
183
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
184
+ resources?: {
185
+ municipality_ids?: string[] | undefined;
186
+ agency_ids?: string[] | undefined;
187
+ } | undefined;
188
+ }>, z.ZodObject<{
189
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
190
+ scope: z.ZodLiteral<"users">;
191
+ }, "strip", z.ZodTypeAny, {
192
+ scope: "users";
193
+ action: "create" | "update" | "delete" | "read";
194
+ }, {
195
+ scope: "users";
196
+ action: "create" | "update" | "delete" | "read";
197
+ }>]>, "many">;
198
+ }, "strip", z.ZodTypeAny, {
199
+ _id: string;
200
+ created_at: number & {
201
+ __brand: "UnixTimestamp";
202
+ };
203
+ updated_at: number & {
204
+ __brand: "UnixTimestamp";
205
+ };
206
+ name: string;
207
+ permissions: ({
208
+ scope: "agencies";
209
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
210
+ } | {
211
+ scope: "alerts_scheduled";
212
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
213
+ } | {
214
+ scope: "alerts_realtime";
215
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
216
+ resources: {
217
+ agency_ids: string[];
218
+ };
219
+ } | {
220
+ scope: "rides";
221
+ 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";
222
+ resources: {
223
+ agency_ids: string[];
224
+ };
225
+ } | {
226
+ scope: "sams";
227
+ action: "read";
228
+ } | {
229
+ scope: "gtfs_validations";
230
+ action: "create" | "read" | "request_approval";
231
+ resources: {
232
+ agency_ids: string[];
233
+ };
234
+ } | {
235
+ scope: "home";
236
+ action: "read_links" | "read_wiki";
237
+ } | {
238
+ scope: "organizations";
239
+ action: "create" | "update" | "delete" | "read";
240
+ } | {
241
+ scope: "performance";
242
+ action: "read";
243
+ } | {
244
+ scope: "plans";
245
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
246
+ resources: {
247
+ agency_ids: string[];
248
+ };
249
+ } | {
250
+ scope: "roles";
251
+ action: "create" | "update" | "delete" | "read";
252
+ } | {
253
+ scope: "stops";
254
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
255
+ resources: {
256
+ municipality_ids: string[];
257
+ agency_ids: string[];
258
+ };
259
+ } | {
260
+ scope: "users";
261
+ action: "create" | "update" | "delete" | "read";
262
+ })[];
263
+ created_by?: string | undefined;
264
+ updated_by?: string | undefined;
265
+ }, {
266
+ _id: string;
267
+ created_at: number;
268
+ updated_at: number;
269
+ name: string;
270
+ permissions: ({
271
+ scope: "agencies";
272
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
273
+ } | {
274
+ scope: "alerts_scheduled";
275
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
276
+ } | {
277
+ scope: "alerts_realtime";
278
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
279
+ resources?: {
280
+ agency_ids?: string[] | undefined;
281
+ } | undefined;
282
+ } | {
283
+ scope: "rides";
284
+ 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";
285
+ resources?: {
286
+ agency_ids?: string[] | undefined;
287
+ } | undefined;
288
+ } | {
289
+ scope: "sams";
290
+ action: "read";
291
+ } | {
292
+ scope: "gtfs_validations";
293
+ action: "create" | "read" | "request_approval";
294
+ resources?: {
295
+ agency_ids?: string[] | undefined;
296
+ } | undefined;
297
+ } | {
298
+ scope: "home";
299
+ action: "read_links" | "read_wiki";
300
+ } | {
301
+ scope: "organizations";
302
+ action: "create" | "update" | "delete" | "read";
303
+ } | {
304
+ scope: "performance";
305
+ action: "read";
306
+ } | {
307
+ scope: "plans";
308
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
309
+ resources?: {
310
+ agency_ids?: string[] | undefined;
311
+ } | undefined;
312
+ } | {
313
+ scope: "roles";
314
+ action: "create" | "update" | "delete" | "read";
315
+ } | {
316
+ scope: "stops";
317
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
318
+ resources?: {
319
+ municipality_ids?: string[] | undefined;
320
+ agency_ids?: string[] | undefined;
321
+ } | undefined;
322
+ } | {
323
+ scope: "users";
324
+ action: "create" | "update" | "delete" | "read";
325
+ })[];
326
+ created_by?: string | undefined;
327
+ updated_by?: string | undefined;
328
+ }>;
329
+ export declare const CreateRoleSchema: z.ZodObject<Omit<{
330
+ _id: z.ZodString;
331
+ created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
332
+ created_by: z.ZodOptional<z.ZodString>;
333
+ updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
334
+ updated_by: z.ZodOptional<z.ZodString>;
335
+ } & {
336
+ name: z.ZodString;
337
+ permissions: z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
338
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
339
+ scope: z.ZodLiteral<"agencies">;
340
+ }, "strip", z.ZodTypeAny, {
341
+ scope: "agencies";
342
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
343
+ }, {
344
+ scope: "agencies";
345
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
346
+ }>, z.ZodObject<{
347
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
348
+ scope: z.ZodLiteral<"alerts_scheduled">;
349
+ }, "strip", z.ZodTypeAny, {
350
+ scope: "alerts_scheduled";
351
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
352
+ }, {
353
+ scope: "alerts_scheduled";
354
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
355
+ }>, z.ZodObject<{
356
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
357
+ resources: z.ZodDefault<z.ZodObject<{
358
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ agency_ids: string[];
361
+ }, {
362
+ agency_ids?: string[] | undefined;
363
+ }>>;
364
+ scope: z.ZodLiteral<"alerts_realtime">;
365
+ }, "strip", z.ZodTypeAny, {
366
+ scope: "alerts_realtime";
367
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
368
+ resources: {
369
+ agency_ids: string[];
370
+ };
371
+ }, {
372
+ scope: "alerts_realtime";
373
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
374
+ resources?: {
375
+ agency_ids?: string[] | undefined;
376
+ } | undefined;
377
+ }>, z.ZodObject<{
378
+ 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"]>;
379
+ resources: z.ZodDefault<z.ZodObject<{
380
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
381
+ }, "strip", z.ZodTypeAny, {
382
+ agency_ids: string[];
383
+ }, {
384
+ agency_ids?: string[] | undefined;
385
+ }>>;
386
+ scope: z.ZodLiteral<"rides">;
387
+ }, "strip", z.ZodTypeAny, {
388
+ scope: "rides";
389
+ 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";
390
+ resources: {
391
+ agency_ids: string[];
392
+ };
393
+ }, {
394
+ scope: "rides";
395
+ 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";
396
+ resources?: {
397
+ agency_ids?: string[] | undefined;
398
+ } | undefined;
399
+ }>, z.ZodObject<{
400
+ action: z.ZodEnum<["read"]>;
401
+ scope: z.ZodLiteral<"sams">;
402
+ }, "strip", z.ZodTypeAny, {
403
+ scope: "sams";
404
+ action: "read";
405
+ }, {
406
+ scope: "sams";
407
+ action: "read";
408
+ }>, z.ZodObject<{
409
+ action: z.ZodEnum<["create", "read", "request_approval"]>;
410
+ resources: z.ZodDefault<z.ZodObject<{
411
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ agency_ids: string[];
414
+ }, {
415
+ agency_ids?: string[] | undefined;
416
+ }>>;
417
+ scope: z.ZodLiteral<"gtfs_validations">;
418
+ }, "strip", z.ZodTypeAny, {
419
+ scope: "gtfs_validations";
420
+ action: "create" | "read" | "request_approval";
421
+ resources: {
422
+ agency_ids: string[];
423
+ };
424
+ }, {
425
+ scope: "gtfs_validations";
426
+ action: "create" | "read" | "request_approval";
427
+ resources?: {
428
+ agency_ids?: string[] | undefined;
429
+ } | undefined;
430
+ }>, z.ZodObject<{
431
+ action: z.ZodEnum<["read_links", "read_wiki"]>;
432
+ scope: z.ZodLiteral<"home">;
433
+ }, "strip", z.ZodTypeAny, {
434
+ scope: "home";
435
+ action: "read_links" | "read_wiki";
436
+ }, {
437
+ scope: "home";
438
+ action: "read_links" | "read_wiki";
439
+ }>, z.ZodObject<{
440
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
441
+ scope: z.ZodLiteral<"organizations">;
442
+ }, "strip", z.ZodTypeAny, {
443
+ scope: "organizations";
444
+ action: "create" | "update" | "delete" | "read";
445
+ }, {
446
+ scope: "organizations";
447
+ action: "create" | "update" | "delete" | "read";
448
+ }>, z.ZodObject<{
449
+ action: z.ZodEnum<["read"]>;
450
+ scope: z.ZodLiteral<"performance">;
451
+ }, "strip", z.ZodTypeAny, {
452
+ scope: "performance";
453
+ action: "read";
454
+ }, {
455
+ scope: "performance";
456
+ action: "read";
457
+ }>, z.ZodObject<{
458
+ action: z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "toggle_lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy"]>;
459
+ resources: z.ZodDefault<z.ZodObject<{
460
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
461
+ }, "strip", z.ZodTypeAny, {
462
+ agency_ids: string[];
463
+ }, {
464
+ agency_ids?: string[] | undefined;
465
+ }>>;
466
+ scope: z.ZodLiteral<"plans">;
467
+ }, "strip", z.ZodTypeAny, {
468
+ scope: "plans";
469
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
470
+ resources: {
471
+ agency_ids: string[];
472
+ };
473
+ }, {
474
+ scope: "plans";
475
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
476
+ resources?: {
477
+ agency_ids?: string[] | undefined;
478
+ } | undefined;
479
+ }>, z.ZodObject<{
480
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
481
+ scope: z.ZodLiteral<"roles">;
482
+ }, "strip", z.ZodTypeAny, {
483
+ scope: "roles";
484
+ action: "create" | "update" | "delete" | "read";
485
+ }, {
486
+ scope: "roles";
487
+ action: "create" | "update" | "delete" | "read";
488
+ }>, z.ZodObject<{
489
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
490
+ resources: z.ZodDefault<z.ZodObject<{
491
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
492
+ municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
493
+ }, "strip", z.ZodTypeAny, {
494
+ municipality_ids: string[];
495
+ agency_ids: string[];
496
+ }, {
497
+ municipality_ids?: string[] | undefined;
498
+ agency_ids?: string[] | undefined;
499
+ }>>;
500
+ scope: z.ZodLiteral<"stops">;
501
+ }, "strip", z.ZodTypeAny, {
502
+ scope: "stops";
503
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
504
+ resources: {
505
+ municipality_ids: string[];
506
+ agency_ids: string[];
507
+ };
508
+ }, {
509
+ scope: "stops";
510
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
511
+ resources?: {
512
+ municipality_ids?: string[] | undefined;
513
+ agency_ids?: string[] | undefined;
514
+ } | undefined;
515
+ }>, z.ZodObject<{
516
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
517
+ scope: z.ZodLiteral<"users">;
518
+ }, "strip", z.ZodTypeAny, {
519
+ scope: "users";
520
+ action: "create" | "update" | "delete" | "read";
521
+ }, {
522
+ scope: "users";
523
+ action: "create" | "update" | "delete" | "read";
524
+ }>]>, "many">;
525
+ }, "_id" | "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
526
+ name: string;
527
+ permissions: ({
528
+ scope: "agencies";
529
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
530
+ } | {
531
+ scope: "alerts_scheduled";
532
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
533
+ } | {
534
+ scope: "alerts_realtime";
535
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
536
+ resources: {
537
+ agency_ids: string[];
538
+ };
539
+ } | {
540
+ scope: "rides";
541
+ 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";
542
+ resources: {
543
+ agency_ids: string[];
544
+ };
545
+ } | {
546
+ scope: "sams";
547
+ action: "read";
548
+ } | {
549
+ scope: "gtfs_validations";
550
+ action: "create" | "read" | "request_approval";
551
+ resources: {
552
+ agency_ids: string[];
553
+ };
554
+ } | {
555
+ scope: "home";
556
+ action: "read_links" | "read_wiki";
557
+ } | {
558
+ scope: "organizations";
559
+ action: "create" | "update" | "delete" | "read";
560
+ } | {
561
+ scope: "performance";
562
+ action: "read";
563
+ } | {
564
+ scope: "plans";
565
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
566
+ resources: {
567
+ agency_ids: string[];
568
+ };
569
+ } | {
570
+ scope: "roles";
571
+ action: "create" | "update" | "delete" | "read";
572
+ } | {
573
+ scope: "stops";
574
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
575
+ resources: {
576
+ municipality_ids: string[];
577
+ agency_ids: string[];
578
+ };
579
+ } | {
580
+ scope: "users";
581
+ action: "create" | "update" | "delete" | "read";
582
+ })[];
583
+ created_by?: string | undefined;
584
+ updated_by?: string | undefined;
585
+ }, {
586
+ name: string;
587
+ permissions: ({
588
+ scope: "agencies";
589
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
590
+ } | {
591
+ scope: "alerts_scheduled";
592
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
593
+ } | {
594
+ scope: "alerts_realtime";
595
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
596
+ resources?: {
597
+ agency_ids?: string[] | undefined;
598
+ } | undefined;
599
+ } | {
600
+ scope: "rides";
601
+ 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";
602
+ resources?: {
603
+ agency_ids?: string[] | undefined;
604
+ } | undefined;
605
+ } | {
606
+ scope: "sams";
607
+ action: "read";
608
+ } | {
609
+ scope: "gtfs_validations";
610
+ action: "create" | "read" | "request_approval";
611
+ resources?: {
612
+ agency_ids?: string[] | undefined;
613
+ } | undefined;
614
+ } | {
615
+ scope: "home";
616
+ action: "read_links" | "read_wiki";
617
+ } | {
618
+ scope: "organizations";
619
+ action: "create" | "update" | "delete" | "read";
620
+ } | {
621
+ scope: "performance";
622
+ action: "read";
623
+ } | {
624
+ scope: "plans";
625
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
626
+ resources?: {
627
+ agency_ids?: string[] | undefined;
628
+ } | undefined;
629
+ } | {
630
+ scope: "roles";
631
+ action: "create" | "update" | "delete" | "read";
632
+ } | {
633
+ scope: "stops";
634
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
635
+ resources?: {
636
+ municipality_ids?: string[] | undefined;
637
+ agency_ids?: string[] | undefined;
638
+ } | undefined;
639
+ } | {
640
+ scope: "users";
641
+ action: "create" | "update" | "delete" | "read";
642
+ })[];
643
+ created_by?: string | undefined;
644
+ updated_by?: string | undefined;
645
+ }>;
646
+ export declare const UpdateRoleSchema: z.ZodObject<{
647
+ updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
648
+ name: z.ZodOptional<z.ZodString>;
649
+ permissions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
650
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
651
+ scope: z.ZodLiteral<"agencies">;
652
+ }, "strip", z.ZodTypeAny, {
653
+ scope: "agencies";
654
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
655
+ }, {
656
+ scope: "agencies";
657
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
658
+ }>, z.ZodObject<{
659
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
660
+ scope: z.ZodLiteral<"alerts_scheduled">;
661
+ }, "strip", z.ZodTypeAny, {
662
+ scope: "alerts_scheduled";
663
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
664
+ }, {
665
+ scope: "alerts_scheduled";
666
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
667
+ }>, z.ZodObject<{
668
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
669
+ resources: z.ZodDefault<z.ZodObject<{
670
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ agency_ids: string[];
673
+ }, {
674
+ agency_ids?: string[] | undefined;
675
+ }>>;
676
+ scope: z.ZodLiteral<"alerts_realtime">;
677
+ }, "strip", z.ZodTypeAny, {
678
+ scope: "alerts_realtime";
679
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
680
+ resources: {
681
+ agency_ids: string[];
682
+ };
683
+ }, {
684
+ scope: "alerts_realtime";
685
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
686
+ resources?: {
687
+ agency_ids?: string[] | undefined;
688
+ } | undefined;
689
+ }>, z.ZodObject<{
690
+ 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"]>;
691
+ resources: z.ZodDefault<z.ZodObject<{
692
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ agency_ids: string[];
695
+ }, {
696
+ agency_ids?: string[] | undefined;
697
+ }>>;
698
+ scope: z.ZodLiteral<"rides">;
699
+ }, "strip", z.ZodTypeAny, {
700
+ scope: "rides";
701
+ 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";
702
+ resources: {
703
+ agency_ids: string[];
704
+ };
705
+ }, {
706
+ scope: "rides";
707
+ 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";
708
+ resources?: {
709
+ agency_ids?: string[] | undefined;
710
+ } | undefined;
711
+ }>, z.ZodObject<{
712
+ action: z.ZodEnum<["read"]>;
713
+ scope: z.ZodLiteral<"sams">;
714
+ }, "strip", z.ZodTypeAny, {
715
+ scope: "sams";
716
+ action: "read";
717
+ }, {
718
+ scope: "sams";
719
+ action: "read";
720
+ }>, z.ZodObject<{
721
+ action: z.ZodEnum<["create", "read", "request_approval"]>;
722
+ resources: z.ZodDefault<z.ZodObject<{
723
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
724
+ }, "strip", z.ZodTypeAny, {
725
+ agency_ids: string[];
726
+ }, {
727
+ agency_ids?: string[] | undefined;
728
+ }>>;
729
+ scope: z.ZodLiteral<"gtfs_validations">;
730
+ }, "strip", z.ZodTypeAny, {
731
+ scope: "gtfs_validations";
732
+ action: "create" | "read" | "request_approval";
733
+ resources: {
734
+ agency_ids: string[];
735
+ };
736
+ }, {
737
+ scope: "gtfs_validations";
738
+ action: "create" | "read" | "request_approval";
739
+ resources?: {
740
+ agency_ids?: string[] | undefined;
741
+ } | undefined;
742
+ }>, z.ZodObject<{
743
+ action: z.ZodEnum<["read_links", "read_wiki"]>;
744
+ scope: z.ZodLiteral<"home">;
745
+ }, "strip", z.ZodTypeAny, {
746
+ scope: "home";
747
+ action: "read_links" | "read_wiki";
748
+ }, {
749
+ scope: "home";
750
+ action: "read_links" | "read_wiki";
751
+ }>, z.ZodObject<{
752
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
753
+ scope: z.ZodLiteral<"organizations">;
754
+ }, "strip", z.ZodTypeAny, {
755
+ scope: "organizations";
756
+ action: "create" | "update" | "delete" | "read";
757
+ }, {
758
+ scope: "organizations";
759
+ action: "create" | "update" | "delete" | "read";
760
+ }>, z.ZodObject<{
761
+ action: z.ZodEnum<["read"]>;
762
+ scope: z.ZodLiteral<"performance">;
763
+ }, "strip", z.ZodTypeAny, {
764
+ scope: "performance";
765
+ action: "read";
766
+ }, {
767
+ scope: "performance";
768
+ action: "read";
769
+ }>, z.ZodObject<{
770
+ action: z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "toggle_lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy"]>;
771
+ resources: z.ZodDefault<z.ZodObject<{
772
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
773
+ }, "strip", z.ZodTypeAny, {
774
+ agency_ids: string[];
775
+ }, {
776
+ agency_ids?: string[] | undefined;
777
+ }>>;
778
+ scope: z.ZodLiteral<"plans">;
779
+ }, "strip", z.ZodTypeAny, {
780
+ scope: "plans";
781
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
782
+ resources: {
783
+ agency_ids: string[];
784
+ };
785
+ }, {
786
+ scope: "plans";
787
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
788
+ resources?: {
789
+ agency_ids?: string[] | undefined;
790
+ } | undefined;
791
+ }>, z.ZodObject<{
792
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
793
+ scope: z.ZodLiteral<"roles">;
794
+ }, "strip", z.ZodTypeAny, {
795
+ scope: "roles";
796
+ action: "create" | "update" | "delete" | "read";
797
+ }, {
798
+ scope: "roles";
799
+ action: "create" | "update" | "delete" | "read";
800
+ }>, z.ZodObject<{
801
+ action: z.ZodEnum<["create", "delete", "read", "toggle_lock", "update"]>;
802
+ resources: z.ZodDefault<z.ZodObject<{
803
+ agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
804
+ municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
805
+ }, "strip", z.ZodTypeAny, {
806
+ municipality_ids: string[];
807
+ agency_ids: string[];
808
+ }, {
809
+ municipality_ids?: string[] | undefined;
810
+ agency_ids?: string[] | undefined;
811
+ }>>;
812
+ scope: z.ZodLiteral<"stops">;
813
+ }, "strip", z.ZodTypeAny, {
814
+ scope: "stops";
815
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
816
+ resources: {
817
+ municipality_ids: string[];
818
+ agency_ids: string[];
819
+ };
820
+ }, {
821
+ scope: "stops";
822
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
823
+ resources?: {
824
+ municipality_ids?: string[] | undefined;
825
+ agency_ids?: string[] | undefined;
826
+ } | undefined;
827
+ }>, z.ZodObject<{
828
+ action: z.ZodEnum<["create", "delete", "read", "update"]>;
829
+ scope: z.ZodLiteral<"users">;
830
+ }, "strip", z.ZodTypeAny, {
831
+ scope: "users";
832
+ action: "create" | "update" | "delete" | "read";
833
+ }, {
834
+ scope: "users";
835
+ action: "create" | "update" | "delete" | "read";
836
+ }>]>, "many">>;
837
+ }, "strip", z.ZodTypeAny, {
838
+ updated_by?: string | undefined;
839
+ name?: string | undefined;
840
+ permissions?: ({
841
+ scope: "agencies";
842
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
843
+ } | {
844
+ scope: "alerts_scheduled";
845
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
846
+ } | {
847
+ scope: "alerts_realtime";
848
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
849
+ resources: {
850
+ agency_ids: string[];
851
+ };
852
+ } | {
853
+ scope: "rides";
854
+ 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";
855
+ resources: {
856
+ agency_ids: string[];
857
+ };
858
+ } | {
859
+ scope: "sams";
860
+ action: "read";
861
+ } | {
862
+ scope: "gtfs_validations";
863
+ action: "create" | "read" | "request_approval";
864
+ resources: {
865
+ agency_ids: string[];
866
+ };
867
+ } | {
868
+ scope: "home";
869
+ action: "read_links" | "read_wiki";
870
+ } | {
871
+ scope: "organizations";
872
+ action: "create" | "update" | "delete" | "read";
873
+ } | {
874
+ scope: "performance";
875
+ action: "read";
876
+ } | {
877
+ scope: "plans";
878
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
879
+ resources: {
880
+ agency_ids: string[];
881
+ };
882
+ } | {
883
+ scope: "roles";
884
+ action: "create" | "update" | "delete" | "read";
885
+ } | {
886
+ scope: "stops";
887
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
888
+ resources: {
889
+ municipality_ids: string[];
890
+ agency_ids: string[];
891
+ };
892
+ } | {
893
+ scope: "users";
894
+ action: "create" | "update" | "delete" | "read";
895
+ })[] | undefined;
896
+ }, {
897
+ updated_by?: string | undefined;
898
+ name?: string | undefined;
899
+ permissions?: ({
900
+ scope: "agencies";
901
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
902
+ } | {
903
+ scope: "alerts_scheduled";
904
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
905
+ } | {
906
+ scope: "alerts_realtime";
907
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
908
+ resources?: {
909
+ agency_ids?: string[] | undefined;
910
+ } | undefined;
911
+ } | {
912
+ scope: "rides";
913
+ 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";
914
+ resources?: {
915
+ agency_ids?: string[] | undefined;
916
+ } | undefined;
917
+ } | {
918
+ scope: "sams";
919
+ action: "read";
920
+ } | {
921
+ scope: "gtfs_validations";
922
+ action: "create" | "read" | "request_approval";
923
+ resources?: {
924
+ agency_ids?: string[] | undefined;
925
+ } | undefined;
926
+ } | {
927
+ scope: "home";
928
+ action: "read_links" | "read_wiki";
929
+ } | {
930
+ scope: "organizations";
931
+ action: "create" | "update" | "delete" | "read";
932
+ } | {
933
+ scope: "performance";
934
+ action: "read";
935
+ } | {
936
+ scope: "plans";
937
+ action: "create" | "update" | "delete" | "read" | "toggle_lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
938
+ resources?: {
939
+ agency_ids?: string[] | undefined;
940
+ } | undefined;
941
+ } | {
942
+ scope: "roles";
943
+ action: "create" | "update" | "delete" | "read";
944
+ } | {
945
+ scope: "stops";
946
+ action: "create" | "update" | "delete" | "read" | "toggle_lock";
947
+ resources?: {
948
+ municipality_ids?: string[] | undefined;
949
+ agency_ids?: string[] | undefined;
950
+ } | undefined;
951
+ } | {
952
+ scope: "users";
953
+ action: "create" | "update" | "delete" | "read";
954
+ })[] | undefined;
955
+ }>;
956
+ export type Role = z.infer<typeof RoleSchema>;
957
+ export type CreateRoleDto = z.infer<typeof CreateRoleSchema>;
958
+ export type UpdateRoleDto = z.infer<typeof UpdateRoleSchema>;