@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.
- package/dist/{src/_common → _common}/index.d.ts +4 -2
- package/dist/{src/_common → _common}/index.js +4 -2
- package/dist/_common/mongo.d.ts +3 -0
- package/dist/_common/status.d.ts +13 -0
- package/dist/_common/status.js +20 -0
- package/dist/_common/utility.js +1 -0
- package/dist/{src/agency.d.ts → agency.d.ts} +4 -15
- package/dist/{src/agency.js → agency.js} +1 -6
- package/dist/{src/alert.d.ts → alert.d.ts} +20 -21
- package/dist/{src/alert.js → alert.js} +8 -14
- package/dist/{src/simplified-apex → apex}/simplified-apex-validation.d.ts +20 -20
- package/dist/{src/auth → auth}/index.d.ts +1 -1
- package/dist/{src/auth → auth}/index.js +1 -1
- package/dist/{src/auth → auth}/password-requirements.js +2 -1
- package/dist/auth/role.d.ts +958 -0
- package/dist/{src/auth → auth}/role.js +2 -2
- package/dist/{src/auth → auth}/session.d.ts +13 -9
- package/dist/{src/auth → auth}/session.js +1 -1
- package/dist/auth/user.d.ts +1281 -0
- package/dist/{src/auth → auth}/user.js +11 -14
- package/dist/{src/file-exports → file-exports}/common.d.ts +9 -8
- package/dist/{src/file-exports → file-exports}/common.js +1 -1
- package/dist/file-exports/index.d.ts +121 -0
- package/dist/file-exports/ride-export.d.ts +410 -0
- package/dist/file-exports/ride-export.js +131 -0
- package/dist/{src/file.d.ts → file.d.ts} +18 -18
- package/dist/gtfs/agency.d.ts +30 -0
- package/dist/gtfs/agency.js +13 -0
- package/dist/gtfs/feed-info.d.ts +33 -0
- package/dist/{src/gtfs.js → gtfs/feed-info.js} +1 -11
- package/dist/{src/gtfs → gtfs}/index.d.ts +3 -0
- package/dist/{src/gtfs → gtfs}/index.js +3 -0
- package/dist/gtfs/service-alert.d.ts +26 -0
- package/dist/index.d.ts +22 -22
- package/dist/index.js +22 -22
- package/dist/locations/census.d.ts +211 -0
- package/dist/locations/census.js +2 -0
- package/dist/locations/district.d.ts +24 -0
- package/dist/locations/district.js +2 -0
- package/dist/locations/index.d.ts +6 -0
- package/dist/locations/index.js +6 -0
- package/dist/locations/locality.d.ts +27 -0
- package/dist/locations/locality.js +2 -0
- package/dist/locations/municipality.d.ts +25 -0
- package/dist/locations/municipality.js +2 -0
- package/dist/locations/parish.d.ts +26 -0
- package/dist/locations/parish.js +2 -0
- package/dist/locations/queries.d.ts +117 -0
- package/dist/{src/locations.js → locations/queries.js} +5 -16
- package/dist/metrics/demand/demand_by_agency.d.ts +210 -0
- package/dist/metrics/demand/demand_by_agency.js +39 -0
- package/dist/metrics/demand/demand_by_category.d.ts +475 -0
- package/dist/metrics/demand/demand_by_category.js +114 -0
- package/dist/metrics/demand/demand_by_line.d.ts +246 -0
- package/dist/metrics/demand/demand_by_line.js +56 -0
- package/dist/metrics/demand/demand_by_pattern.d.ts +332 -0
- package/dist/metrics/demand/demand_by_pattern.js +56 -0
- package/dist/metrics/demand/demand_by_product.d.ts +475 -0
- package/dist/metrics/demand/demand_by_product.js +114 -0
- package/dist/metrics/demand/index.d.ts +6 -0
- package/dist/metrics/demand/index.js +8 -0
- package/dist/metrics/demand/records.d.ts +320 -0
- package/dist/metrics/demand/records.js +53 -0
- package/dist/metrics/index.d.ts +2647 -0
- package/dist/metrics/index.js +48 -0
- package/dist/metrics/realtime.d.ts +667 -0
- package/dist/metrics/realtime.js +41 -0
- package/dist/{src/notification.d.ts → notification.d.ts} +4 -4
- package/dist/{src/organization.d.ts → organization.d.ts} +32 -32
- package/dist/{src/organization.js → organization.js} +7 -7
- package/dist/permissions/agencies.d.ts +12 -0
- package/dist/permissions/agencies.js +13 -0
- package/dist/permissions/alerts.d.ts +36 -0
- package/dist/permissions/alerts.js +25 -0
- package/dist/permissions/controller.d.ts +36 -0
- package/dist/permissions/controller.js +30 -0
- package/dist/permissions/gtfs-validations.d.ts +25 -0
- package/dist/permissions/gtfs-validations.js +14 -0
- package/dist/permissions/home.d.ts +12 -0
- package/dist/permissions/home.js +10 -0
- package/dist/permissions/index.d.ts +268 -0
- package/dist/permissions/index.js +149 -0
- package/dist/permissions/organizations.d.ts +12 -0
- package/dist/permissions/organizations.js +12 -0
- package/dist/permissions/performance.d.ts +12 -0
- package/dist/permissions/performance.js +9 -0
- package/dist/permissions/plans.d.ts +25 -0
- package/dist/permissions/plans.js +22 -0
- package/dist/permissions/roles.d.ts +12 -0
- package/dist/permissions/roles.js +12 -0
- package/dist/permissions/stops.d.ts +30 -0
- package/dist/permissions/stops.js +17 -0
- package/dist/permissions/users.d.ts +12 -0
- package/dist/permissions/users.js +12 -0
- package/dist/{src/plans → plans}/gtfs-validation.d.ts +55 -63
- package/dist/{src/plans → plans}/gtfs-validation.js +3 -6
- package/dist/plans/plan-app-status.d.ts +15 -0
- package/dist/plans/plan-app-status.js +10 -0
- package/dist/{src/plans → plans}/plan.d.ts +240 -104
- package/dist/{src/plans → plans}/plan.js +8 -10
- package/dist/{src/_common/proposed-change.d.ts → proposed-change.d.ts} +21 -22
- package/dist/{src/_common/proposed-change.js → proposed-change.js} +5 -7
- package/dist/{src/rides → rides}/index.d.ts +1 -0
- package/dist/{src/rides → rides}/index.js +1 -0
- package/dist/{src/rides → rides}/ride-acceptance.d.ts +65 -65
- package/dist/{src/rides → rides}/ride-analysis.d.ts +34 -34
- package/dist/{src/rides → rides}/ride-audit.d.ts +10 -10
- package/dist/rides/ride-normalized.d.ts +29 -0
- package/dist/rides/ride-normalized.js +2 -0
- package/dist/{src/rides → rides}/ride.d.ts +523 -567
- package/dist/{src/rides → rides}/ride.js +2 -16
- package/dist/{src/sams → sams}/sam-analysis.d.ts +11 -11
- package/dist/{src/sams → sams}/sam-analysis.js +4 -4
- package/dist/{src/sams → sams}/sam.d.ts +76 -76
- package/dist/{src/sams → sams}/sam.js +1 -1
- package/dist/{src/stop.d.ts → stop.d.ts} +32 -43
- package/dist/{src/stop.js → stop.js} +3 -8
- package/dist/vehicle-events/gtfs-rt-vehicle-event-extended.d.ts +77 -0
- package/dist/vehicle-events/gtfs-rt-vehicle-event-extended.js +21 -0
- package/dist/vehicle-events/index.d.ts +2 -0
- package/dist/vehicle-events/index.js +2 -0
- package/dist/{src/vehicle-event.d.ts → vehicle-events/simplified-vehicle-event.d.ts} +9 -9
- package/dist/{src/vehicle-event.js → vehicle-events/simplified-vehicle-event.js} +3 -3
- package/dist/wiki.js +2 -0
- package/dist/{src/zone.d.ts → zone.d.ts} +2 -16
- package/dist/{src/zone.js → zone.js} +0 -6
- package/package.json +18 -21
- package/README.md +0 -13
- package/dist/src/_common/email.d.ts +0 -4
- package/dist/src/_common/email.js +0 -7
- package/dist/src/auth/permission.d.ts +0 -19
- package/dist/src/auth/permission.js +0 -8
- package/dist/src/auth/role.d.ts +0 -127
- package/dist/src/auth/user.d.ts +0 -311
- package/dist/src/file-exports/index.d.ts +0 -121
- package/dist/src/file-exports/ride-export.d.ts +0 -407
- package/dist/src/file-exports/ride-export.js +0 -120
- package/dist/src/gtfs.d.ts +0 -88
- package/dist/src/locations.d.ts +0 -319
- package/dist/src/metrics/demand.d.ts +0 -803
- package/dist/src/metrics/demand.js +0 -153
- package/dist/src/metrics/index.d.ts +0 -806
- package/dist/src/metrics/index.js +0 -19
- package/dist/src/plans/plan-controller.d.ts +0 -15
- package/dist/src/plans/plan-controller.js +0 -10
- package/dist/src/system/index.d.ts +0 -2
- package/dist/src/system/index.js +0 -2
- package/dist/src/system/processing-status.d.ts +0 -9
- package/dist/src/system/processing-status.js +0 -5
- package/dist/{src/_common → _common}/comment.d.ts +8 -8
- package/dist/{src/_common → _common}/comment.js +0 -0
- package/dist/{src/_common → _common}/document.d.ts +0 -0
- package/dist/{src/_common → _common}/document.js +0 -0
- package/dist/{src/system → _common}/environment.d.ts +0 -0
- package/dist/{src/system → _common}/environment.js +0 -0
- package/dist/{src/_common → _common}/fastify.d.ts +0 -0
- package/dist/{src/_common → _common}/fastify.js +0 -0
- package/dist/{src/_common/utility.js → _common/mongo.js} +0 -0
- package/dist/{src/_common → _common}/operational-date.d.ts +0 -0
- package/dist/{src/_common → _common}/operational-date.js +0 -0
- package/dist/{src/_common → _common}/unix-timestamp.d.ts +0 -0
- package/dist/{src/_common → _common}/unix-timestamp.js +0 -0
- package/dist/{src/_common → _common}/utility.d.ts +0 -0
- package/dist/{src/simplified-apex → apex}/index.d.ts +0 -0
- package/dist/{src/simplified-apex → apex}/index.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-inspection-decision.d.ts +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-inspection-decision.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-inspection.d.ts +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-inspection.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-location.d.ts +16 -16
- package/dist/{src/simplified-apex → apex}/simplified-apex-location.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-refund.d.ts +20 -20
- package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-refund.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-sale.d.ts +25 -25
- package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-sale.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-type.d.ts +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-type.js +0 -0
- package/dist/{src/simplified-apex → apex}/simplified-apex-validation.js +0 -0
- package/dist/{src/auth → auth}/login.d.ts +0 -0
- package/dist/{src/auth → auth}/login.js +0 -0
- package/dist/{src/auth → auth}/password-requirements.d.ts +0 -0
- package/dist/{src/auth → auth}/verification-token.d.ts +0 -0
- package/dist/{src/auth → auth}/verification-token.js +0 -0
- package/dist/{src/file-exports → file-exports}/index.js +0 -0
- package/dist/{src/file.js → file.js} +0 -0
- package/dist/{src/gtfs → gtfs}/calendar-dates.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/calendar-dates.js +0 -0
- package/dist/{src/gtfs → gtfs}/calendar.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/calendar.js +0 -0
- package/dist/{src/gtfs → gtfs}/cause-effetcs.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/cause-effetcs.js +0 -0
- package/dist/{src/gtfs → gtfs}/common.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/common.js +0 -0
- package/dist/{src/gtfs → gtfs}/routes.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/routes.js +0 -0
- package/dist/{src/pcgi/pcgi-apex-location.js → gtfs/service-alert.js} +0 -0
- package/dist/{src/gtfs → gtfs}/shapes.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/shapes.js +0 -0
- package/dist/{src/gtfs → gtfs}/stop-times.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/stop-times.js +0 -0
- package/dist/{src/gtfs → gtfs}/stops.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/stops.js +0 -0
- package/dist/{src/gtfs → gtfs}/trips.d.ts +0 -0
- package/dist/{src/gtfs → gtfs}/trips.js +0 -0
- package/dist/{src/metrics → metrics}/common.d.ts +0 -0
- package/dist/{src/metrics → metrics}/common.js +0 -0
- package/dist/{src/notification.js → notification.js} +0 -0
- package/dist/{src/pcgi → pcgi}/index.d.ts +0 -0
- package/dist/{src/pcgi → pcgi}/index.js +0 -0
- package/dist/{src/pcgi → pcgi}/pcgi-apex-location.d.ts +0 -0
- package/dist/{src/pcgi/pcgi-apex-refund.js → pcgi/pcgi-apex-location.js} +0 -0
- package/dist/{src/pcgi → pcgi}/pcgi-apex-refund.d.ts +0 -0
- package/dist/{src/pcgi/pcgi-apex-sale.js → pcgi/pcgi-apex-refund.js} +0 -0
- package/dist/{src/pcgi → pcgi}/pcgi-apex-sale.d.ts +0 -0
- package/dist/{src/pcgi/pcgi-apex-validation.js → pcgi/pcgi-apex-sale.js} +0 -0
- package/dist/{src/pcgi → pcgi}/pcgi-apex-validation.d.ts +0 -0
- package/dist/{src/pcgi/pcgi-transaction-entity.js → pcgi/pcgi-apex-validation.js} +0 -0
- package/dist/{src/pcgi → pcgi}/pcgi-transaction-entity.d.ts +0 -0
- package/dist/{src/rides/hashed-shape.js → pcgi/pcgi-transaction-entity.js} +0 -0
- package/dist/{src/plans → plans}/index.d.ts +0 -0
- package/dist/{src/plans → plans}/index.js +0 -0
- package/dist/{src/plans → plans}/plan-pcgi-legacy.d.ts +0 -0
- package/dist/{src/plans → plans}/plan-pcgi-legacy.js +0 -0
- package/dist/{src/rides → rides}/hashed-shape.d.ts +0 -0
- package/dist/{src/rides/hashed-trip.js → rides/hashed-shape.js} +0 -0
- package/dist/{src/rides → rides}/hashed-trip.d.ts +0 -0
- package/dist/{src/wiki.js → rides/hashed-trip.js} +0 -0
- package/dist/{src/rides → rides}/ride-acceptance.js +1 -1
- /package/dist/{src/rides → rides}/ride-analysis.js +0 -0
- /package/dist/{src/rides → rides}/ride-audit.js +0 -0
- /package/dist/{src/rides → rides}/ride-overrides.d.ts +0 -0
- /package/dist/{src/rides → rides}/ride-overrides.js +0 -0
- /package/dist/{src/sams → sams}/index.d.ts +0 -0
- /package/dist/{src/sams → sams}/index.js +0 -0
- /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("./
|
|
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("./
|
|
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("./
|
|
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("./
|
|
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
|
-
}, "
|
|
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("./
|
|
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("./
|
|
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
|
-
}, "
|
|
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.
|
|
44
|
-
logo_light: z.
|
|
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.
|
|
48
|
-
}, "
|
|
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("./
|
|
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("./
|
|
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
|
-
}, "
|
|
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.
|
|
114
|
-
logo_light: z.
|
|
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.
|
|
118
|
-
}, "_id" | "created_at" | "updated_at">, "
|
|
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
|
-
}, "
|
|
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.
|
|
170
|
-
logo_light: z.ZodOptional<z.
|
|
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.
|
|
173
|
-
}, "
|
|
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
|
-
})
|
|
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().
|
|
16
|
-
logo_light: z.string().
|
|
17
|
-
long_name: z.string()
|
|
18
|
-
short_name: z.string()
|
|
19
|
-
theme: z.string().
|
|
20
|
-
})
|
|
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,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>;
|