@tmlmobilidade/go-types-permissions 20260828.1636.54
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/allow-all.d.ts +4 -0
- package/dist/allow-all.js +5 -0
- package/dist/catalog.d.ts +199 -0
- package/dist/catalog.js +349 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/permissions.d.ts +397 -0
- package/dist/permissions.js +47 -0
- package/dist/registry.d.ts +192 -0
- package/dist/registry.js +47 -0
- package/dist/resources-registy.d.ts +16 -0
- package/dist/resources-registy.js +32 -0
- package/dist/scopes/agencies/actions.d.ts +3 -0
- package/dist/scopes/agencies/actions.js +11 -0
- package/dist/scopes/agencies/permission.d.ts +12 -0
- package/dist/scopes/agencies/permission.js +9 -0
- package/dist/scopes/agencies/registry.d.ts +12 -0
- package/dist/scopes/agencies/registry.js +9 -0
- package/dist/scopes/agencies/scope.d.ts +3 -0
- package/dist/scopes/agencies/scope.js +4 -0
- package/dist/scopes/alerts/actions.d.ts +3 -0
- package/dist/scopes/alerts/actions.js +14 -0
- package/dist/scopes/alerts/permission.d.ts +30 -0
- package/dist/scopes/alerts/permission.js +11 -0
- package/dist/scopes/alerts/registry.d.ts +12 -0
- package/dist/scopes/alerts/registry.js +9 -0
- package/dist/scopes/alerts/resources.d.ts +12 -0
- package/dist/scopes/alerts/resources.js +7 -0
- package/dist/scopes/alerts/scope.d.ts +3 -0
- package/dist/scopes/alerts/scope.js +4 -0
- package/dist/scopes/annotations/actions.d.ts +3 -0
- package/dist/scopes/annotations/actions.js +11 -0
- package/dist/scopes/annotations/permission.d.ts +25 -0
- package/dist/scopes/annotations/permission.js +11 -0
- package/dist/scopes/annotations/registry.d.ts +12 -0
- package/dist/scopes/annotations/registry.js +9 -0
- package/dist/scopes/annotations/resources.d.ts +9 -0
- package/dist/scopes/annotations/resources.js +6 -0
- package/dist/scopes/annotations/scope.d.ts +3 -0
- package/dist/scopes/annotations/scope.js +4 -0
- package/dist/scopes/events/actions.d.ts +3 -0
- package/dist/scopes/events/actions.js +11 -0
- package/dist/scopes/events/permission.d.ts +25 -0
- package/dist/scopes/events/permission.js +11 -0
- package/dist/scopes/events/registry.d.ts +12 -0
- package/dist/scopes/events/registry.js +9 -0
- package/dist/scopes/events/resources.d.ts +9 -0
- package/dist/scopes/events/resources.js +6 -0
- package/dist/scopes/events/scope.d.ts +3 -0
- package/dist/scopes/events/scope.js +4 -0
- package/dist/scopes/fares/actions.d.ts +3 -0
- package/dist/scopes/fares/actions.js +11 -0
- package/dist/scopes/fares/permission.d.ts +25 -0
- package/dist/scopes/fares/permission.js +11 -0
- package/dist/scopes/fares/registry.d.ts +12 -0
- package/dist/scopes/fares/registry.js +9 -0
- package/dist/scopes/fares/resources.d.ts +9 -0
- package/dist/scopes/fares/resources.js +6 -0
- package/dist/scopes/fares/scope.d.ts +3 -0
- package/dist/scopes/fares/scope.js +4 -0
- package/dist/scopes/gtfs-validations/actions.d.ts +3 -0
- package/dist/scopes/gtfs-validations/actions.js +11 -0
- package/dist/scopes/gtfs-validations/permission.d.ts +25 -0
- package/dist/scopes/gtfs-validations/permission.js +11 -0
- package/dist/scopes/gtfs-validations/registry.d.ts +12 -0
- package/dist/scopes/gtfs-validations/registry.js +9 -0
- package/dist/scopes/gtfs-validations/resources.d.ts +9 -0
- package/dist/scopes/gtfs-validations/resources.js +6 -0
- package/dist/scopes/gtfs-validations/scope.d.ts +3 -0
- package/dist/scopes/gtfs-validations/scope.js +4 -0
- package/dist/scopes/holidays/actions.d.ts +3 -0
- package/dist/scopes/holidays/actions.js +11 -0
- package/dist/scopes/holidays/permission.d.ts +25 -0
- package/dist/scopes/holidays/permission.js +11 -0
- package/dist/scopes/holidays/registry.d.ts +12 -0
- package/dist/scopes/holidays/registry.js +9 -0
- package/dist/scopes/holidays/resources.d.ts +9 -0
- package/dist/scopes/holidays/resources.js +6 -0
- package/dist/scopes/holidays/scope.d.ts +3 -0
- package/dist/scopes/holidays/scope.js +4 -0
- package/dist/scopes/home/actions.d.ts +3 -0
- package/dist/scopes/home/actions.js +8 -0
- package/dist/scopes/home/permission.d.ts +12 -0
- package/dist/scopes/home/permission.js +9 -0
- package/dist/scopes/home/registry.d.ts +12 -0
- package/dist/scopes/home/registry.js +9 -0
- package/dist/scopes/home/scope.d.ts +3 -0
- package/dist/scopes/home/scope.js +4 -0
- package/dist/scopes/lines/actions.d.ts +3 -0
- package/dist/scopes/lines/actions.js +11 -0
- package/dist/scopes/lines/permission.d.ts +25 -0
- package/dist/scopes/lines/permission.js +11 -0
- package/dist/scopes/lines/registry.d.ts +12 -0
- package/dist/scopes/lines/registry.js +9 -0
- package/dist/scopes/lines/resources.d.ts +9 -0
- package/dist/scopes/lines/resources.js +6 -0
- package/dist/scopes/lines/scope.d.ts +3 -0
- package/dist/scopes/lines/scope.js +4 -0
- package/dist/scopes/organizations/actions.d.ts +3 -0
- package/dist/scopes/organizations/actions.js +11 -0
- package/dist/scopes/organizations/permission.d.ts +12 -0
- package/dist/scopes/organizations/permission.js +9 -0
- package/dist/scopes/organizations/registry.d.ts +12 -0
- package/dist/scopes/organizations/registry.js +9 -0
- package/dist/scopes/organizations/scope.d.ts +3 -0
- package/dist/scopes/organizations/scope.js +4 -0
- package/dist/scopes/performance/actions.d.ts +3 -0
- package/dist/scopes/performance/actions.js +7 -0
- package/dist/scopes/performance/permission.d.ts +12 -0
- package/dist/scopes/performance/permission.js +9 -0
- package/dist/scopes/performance/registry.d.ts +12 -0
- package/dist/scopes/performance/registry.js +9 -0
- package/dist/scopes/performance/scope.d.ts +3 -0
- package/dist/scopes/performance/scope.js +4 -0
- package/dist/scopes/plans/actions.d.ts +3 -0
- package/dist/scopes/plans/actions.js +22 -0
- package/dist/scopes/plans/permission.d.ts +25 -0
- package/dist/scopes/plans/permission.js +11 -0
- package/dist/scopes/plans/registry.d.ts +12 -0
- package/dist/scopes/plans/registry.js +9 -0
- package/dist/scopes/plans/resources.d.ts +9 -0
- package/dist/scopes/plans/resources.js +6 -0
- package/dist/scopes/plans/scope.d.ts +3 -0
- package/dist/scopes/plans/scope.js +4 -0
- package/dist/scopes/rides/actions.d.ts +3 -0
- package/dist/scopes/rides/actions.js +19 -0
- package/dist/scopes/rides/permission.d.ts +25 -0
- package/dist/scopes/rides/permission.js +11 -0
- package/dist/scopes/rides/registry.d.ts +12 -0
- package/dist/scopes/rides/registry.js +9 -0
- package/dist/scopes/rides/resources.d.ts +9 -0
- package/dist/scopes/rides/resources.js +6 -0
- package/dist/scopes/rides/scope.d.ts +3 -0
- package/dist/scopes/rides/scope.js +4 -0
- package/dist/scopes/roles/actions.d.ts +3 -0
- package/dist/scopes/roles/actions.js +11 -0
- package/dist/scopes/roles/permission.d.ts +12 -0
- package/dist/scopes/roles/permission.js +9 -0
- package/dist/scopes/roles/registry.d.ts +12 -0
- package/dist/scopes/roles/registry.js +9 -0
- package/dist/scopes/roles/scope.d.ts +3 -0
- package/dist/scopes/roles/scope.js +4 -0
- package/dist/scopes/sams/actions.d.ts +3 -0
- package/dist/scopes/sams/actions.js +8 -0
- package/dist/scopes/sams/permission.d.ts +25 -0
- package/dist/scopes/sams/permission.js +11 -0
- package/dist/scopes/sams/registry.d.ts +12 -0
- package/dist/scopes/sams/registry.js +9 -0
- package/dist/scopes/sams/resources.d.ts +9 -0
- package/dist/scopes/sams/resources.js +6 -0
- package/dist/scopes/sams/scope.d.ts +3 -0
- package/dist/scopes/sams/scope.js +4 -0
- package/dist/scopes/stops/actions.d.ts +3 -0
- package/dist/scopes/stops/actions.js +14 -0
- package/dist/scopes/stops/permission.d.ts +30 -0
- package/dist/scopes/stops/permission.js +11 -0
- package/dist/scopes/stops/registry.d.ts +12 -0
- package/dist/scopes/stops/registry.js +9 -0
- package/dist/scopes/stops/resources.d.ts +12 -0
- package/dist/scopes/stops/resources.js +7 -0
- package/dist/scopes/stops/scope.d.ts +3 -0
- package/dist/scopes/stops/scope.js +4 -0
- package/dist/scopes/typologies/actions.d.ts +3 -0
- package/dist/scopes/typologies/actions.js +11 -0
- package/dist/scopes/typologies/permission.d.ts +25 -0
- package/dist/scopes/typologies/permission.js +11 -0
- package/dist/scopes/typologies/registry.d.ts +12 -0
- package/dist/scopes/typologies/registry.js +9 -0
- package/dist/scopes/typologies/resources.d.ts +9 -0
- package/dist/scopes/typologies/resources.js +6 -0
- package/dist/scopes/typologies/scope.d.ts +3 -0
- package/dist/scopes/typologies/scope.js +4 -0
- package/dist/scopes/users/actions.d.ts +3 -0
- package/dist/scopes/users/actions.js +11 -0
- package/dist/scopes/users/permission.d.ts +12 -0
- package/dist/scopes/users/permission.js +9 -0
- package/dist/scopes/users/registry.d.ts +12 -0
- package/dist/scopes/users/registry.js +9 -0
- package/dist/scopes/users/scope.d.ts +3 -0
- package/dist/scopes/users/scope.js +4 -0
- package/dist/scopes/vehicles/actions.d.ts +3 -0
- package/dist/scopes/vehicles/actions.js +11 -0
- package/dist/scopes/vehicles/permission.d.ts +25 -0
- package/dist/scopes/vehicles/permission.js +11 -0
- package/dist/scopes/vehicles/registry.d.ts +12 -0
- package/dist/scopes/vehicles/registry.js +9 -0
- package/dist/scopes/vehicles/resources.d.ts +9 -0
- package/dist/scopes/vehicles/resources.js +6 -0
- package/dist/scopes/vehicles/scope.d.ts +3 -0
- package/dist/scopes/vehicles/scope.js +4 -0
- package/dist/scopes/year-periods/actions.d.ts +3 -0
- package/dist/scopes/year-periods/actions.js +11 -0
- package/dist/scopes/year-periods/permission.d.ts +25 -0
- package/dist/scopes/year-periods/permission.js +11 -0
- package/dist/scopes/year-periods/registry.d.ts +12 -0
- package/dist/scopes/year-periods/registry.js +9 -0
- package/dist/scopes/year-periods/resources.d.ts +9 -0
- package/dist/scopes/year-periods/resources.js +6 -0
- package/dist/scopes/year-periods/scope.d.ts +3 -0
- package/dist/scopes/year-periods/scope.js +4 -0
- package/dist/scopes/zones/actions.d.ts +3 -0
- package/dist/scopes/zones/actions.js +11 -0
- package/dist/scopes/zones/permission.d.ts +25 -0
- package/dist/scopes/zones/permission.js +11 -0
- package/dist/scopes/zones/registry.d.ts +12 -0
- package/dist/scopes/zones/registry.js +9 -0
- package/dist/scopes/zones/resources.d.ts +9 -0
- package/dist/scopes/zones/resources.js +6 -0
- package/dist/scopes/zones/scope.d.ts +3 -0
- package/dist/scopes/zones/scope.js +4 -0
- package/dist/utils/has-permission-resource.d.ts +29 -0
- package/dist/utils/has-permission-resource.js +41 -0
- package/dist/utils/has-permission.d.ts +8 -0
- package/dist/utils/has-permission.js +20 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/package.json +48 -0
package/dist/registry.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AgenciesPermissionRegistrySchema } from './scopes/agencies/registry.js';
|
|
4
|
+
import { AlertsPermissionRegistrySchema } from './scopes/alerts/registry.js';
|
|
5
|
+
import { AnnotationsPermissionRegistrySchema } from './scopes/annotations/registry.js';
|
|
6
|
+
import { EventsPermissionRegistrySchema } from './scopes/events/registry.js';
|
|
7
|
+
import { FaresPermissionRegistrySchema } from './scopes/fares/registry.js';
|
|
8
|
+
import { GtfsValidationsPermissionRegistrySchema } from './scopes/gtfs-validations/registry.js';
|
|
9
|
+
import { HolidaysPermissionRegistrySchema } from './scopes/holidays/registry.js';
|
|
10
|
+
import { HomePermissionRegistrySchema } from './scopes/home/registry.js';
|
|
11
|
+
import { LinesPermissionRegistrySchema } from './scopes/lines/registry.js';
|
|
12
|
+
import { OrganizationsPermissionRegistrySchema } from './scopes/organizations/registry.js';
|
|
13
|
+
import { PerformancePermissionRegistrySchema } from './scopes/performance/registry.js';
|
|
14
|
+
import { PlansPermissionRegistrySchema } from './scopes/plans/registry.js';
|
|
15
|
+
import { RidesPermissionRegistrySchema } from './scopes/rides/registry.js';
|
|
16
|
+
import { RolesPermissionRegistrySchema } from './scopes/roles/registry.js';
|
|
17
|
+
import { SamsPermissionRegistrySchema } from './scopes/sams/registry.js';
|
|
18
|
+
import { StopsPermissionRegistrySchema } from './scopes/stops/registry.js';
|
|
19
|
+
import { TypologiesPermissionRegistrySchema } from './scopes/typologies/registry.js';
|
|
20
|
+
import { UsersPermissionRegistrySchema } from './scopes/users/registry.js';
|
|
21
|
+
import { VehiclesPermissionRegistrySchema } from './scopes/vehicles/registry.js';
|
|
22
|
+
import { YearPeriodsPermissionRegistrySchema } from './scopes/year-periods/registry.js';
|
|
23
|
+
import { ZonesPermissionRegistrySchema } from './scopes/zones/registry.js';
|
|
24
|
+
/* * */
|
|
25
|
+
export const PermissionsRegistrySchema = z.discriminatedUnion('scope', [
|
|
26
|
+
AgenciesPermissionRegistrySchema,
|
|
27
|
+
AlertsPermissionRegistrySchema,
|
|
28
|
+
AnnotationsPermissionRegistrySchema,
|
|
29
|
+
EventsPermissionRegistrySchema,
|
|
30
|
+
FaresPermissionRegistrySchema,
|
|
31
|
+
GtfsValidationsPermissionRegistrySchema,
|
|
32
|
+
HolidaysPermissionRegistrySchema,
|
|
33
|
+
HomePermissionRegistrySchema,
|
|
34
|
+
LinesPermissionRegistrySchema,
|
|
35
|
+
OrganizationsPermissionRegistrySchema,
|
|
36
|
+
PerformancePermissionRegistrySchema,
|
|
37
|
+
PlansPermissionRegistrySchema,
|
|
38
|
+
RidesPermissionRegistrySchema,
|
|
39
|
+
RolesPermissionRegistrySchema,
|
|
40
|
+
SamsPermissionRegistrySchema,
|
|
41
|
+
StopsPermissionRegistrySchema,
|
|
42
|
+
TypologiesPermissionRegistrySchema,
|
|
43
|
+
UsersPermissionRegistrySchema,
|
|
44
|
+
VehiclesPermissionRegistrySchema,
|
|
45
|
+
YearPeriodsPermissionRegistrySchema,
|
|
46
|
+
ZonesPermissionRegistrySchema,
|
|
47
|
+
]);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PermissionsResourcesSchema: z.ZodObject<{
|
|
3
|
+
reference_types: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
} & {
|
|
6
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
agency_ids: string[];
|
|
9
|
+
reference_types: string[];
|
|
10
|
+
municipality_ids: string[];
|
|
11
|
+
}, {
|
|
12
|
+
agency_ids?: string[] | undefined;
|
|
13
|
+
reference_types?: string[] | undefined;
|
|
14
|
+
municipality_ids?: string[] | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export type PermissionsResources = z.infer<typeof PermissionsResourcesSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { AlertsPermissionResourcesSchema } from './scopes/alerts/resources.js';
|
|
3
|
+
import { AnnotationsPermissionResourcesSchema } from './scopes/annotations/resources.js';
|
|
4
|
+
import { EventsPermissionResourcesSchema } from './scopes/events/resources.js';
|
|
5
|
+
import { FaresPermissionResourcesSchema } from './scopes/fares/resources.js';
|
|
6
|
+
import { GtfsValidationsPermissionResourcesSchema } from './scopes/gtfs-validations/resources.js';
|
|
7
|
+
import { HolidaysPermissionResourcesSchema } from './scopes/holidays/resources.js';
|
|
8
|
+
import { LinesPermissionResourcesSchema } from './scopes/lines/resources.js';
|
|
9
|
+
import { PlansPermissionResourcesSchema } from './scopes/plans/resources.js';
|
|
10
|
+
import { RidesPermissionResourcesSchema } from './scopes/rides/resources.js';
|
|
11
|
+
import { SamsPermissionResourcesSchema } from './scopes/sams/resources.js';
|
|
12
|
+
import { StopsPermissionResourcesSchema } from './scopes/stops/resources.js';
|
|
13
|
+
import { TypologiesPermissionResourcesSchema } from './scopes/typologies/resources.js';
|
|
14
|
+
import { VehiclesPermissionResourcesSchema } from './scopes/vehicles/resources.js';
|
|
15
|
+
import { YearPeriodsPermissionResourcesSchema } from './scopes/year-periods/resources.js';
|
|
16
|
+
import { ZonesPermissionResourcesSchema } from './scopes/zones/resources.js';
|
|
17
|
+
/* * */
|
|
18
|
+
export const PermissionsResourcesSchema = AlertsPermissionResourcesSchema
|
|
19
|
+
.merge(AnnotationsPermissionResourcesSchema)
|
|
20
|
+
.merge(EventsPermissionResourcesSchema)
|
|
21
|
+
.merge(FaresPermissionResourcesSchema)
|
|
22
|
+
.merge(GtfsValidationsPermissionResourcesSchema)
|
|
23
|
+
.merge(HolidaysPermissionResourcesSchema)
|
|
24
|
+
.merge(LinesPermissionResourcesSchema)
|
|
25
|
+
.merge(PlansPermissionResourcesSchema)
|
|
26
|
+
.merge(RidesPermissionResourcesSchema)
|
|
27
|
+
.merge(SamsPermissionResourcesSchema)
|
|
28
|
+
.merge(StopsPermissionResourcesSchema)
|
|
29
|
+
.merge(TypologiesPermissionResourcesSchema)
|
|
30
|
+
.merge(VehiclesPermissionResourcesSchema)
|
|
31
|
+
.merge(YearPeriodsPermissionResourcesSchema)
|
|
32
|
+
.merge(ZonesPermissionResourcesSchema);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AgenciesPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
|
|
4
|
+
scope: z.ZodLiteral<"agencies">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
7
|
+
scope: "agencies";
|
|
8
|
+
}, {
|
|
9
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
10
|
+
scope: "agencies";
|
|
11
|
+
}>;
|
|
12
|
+
export type AgenciesPermission = z.infer<typeof AgenciesPermissionSchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AgenciesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { AgenciesPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const AgenciesPermissionSchema = z.object({
|
|
7
|
+
action: AgenciesPermissionActionsSchema,
|
|
8
|
+
scope: AgenciesPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AgenciesPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "lock", "update"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"agencies">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "agencies";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "agencies";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type AgenciesPermissionRegistry = z.infer<typeof AgenciesPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AgenciesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { AgenciesPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const AgenciesPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(AgenciesPermissionActionsSchema),
|
|
8
|
+
scope: AgenciesPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AlertsPermissionActionsSchema: z.ZodEnum<["create", "delete", "read", "lock", "update", "update_texts", "update_dates", "update_publish_status"]>;
|
|
3
|
+
export type AlertsPermissionActions = z.infer<typeof AlertsPermissionActionsSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/* * */
|
|
4
|
+
const AlertsPermissionActionsValues = [
|
|
5
|
+
'create',
|
|
6
|
+
'delete',
|
|
7
|
+
'read',
|
|
8
|
+
'lock',
|
|
9
|
+
'update',
|
|
10
|
+
'update_texts',
|
|
11
|
+
'update_dates',
|
|
12
|
+
'update_publish_status',
|
|
13
|
+
];
|
|
14
|
+
export const AlertsPermissionActionsSchema = z.enum(AlertsPermissionActionsValues);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AlertsPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "read", "lock", "update", "update_texts", "update_dates", "update_publish_status"]>;
|
|
4
|
+
resources: z.ZodDefault<z.ZodObject<{
|
|
5
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
reference_types: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
agency_ids: string[];
|
|
9
|
+
reference_types: string[];
|
|
10
|
+
}, {
|
|
11
|
+
agency_ids?: string[] | undefined;
|
|
12
|
+
reference_types?: string[] | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
scope: z.ZodLiteral<"alerts">;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
action: "create" | "delete" | "read" | "lock" | "update" | "update_texts" | "update_dates" | "update_publish_status";
|
|
17
|
+
scope: "alerts";
|
|
18
|
+
resources: {
|
|
19
|
+
agency_ids: string[];
|
|
20
|
+
reference_types: string[];
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
action: "create" | "delete" | "read" | "lock" | "update" | "update_texts" | "update_dates" | "update_publish_status";
|
|
24
|
+
scope: "alerts";
|
|
25
|
+
resources?: {
|
|
26
|
+
agency_ids?: string[] | undefined;
|
|
27
|
+
reference_types?: string[] | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type AlertsPermission = z.infer<typeof AlertsPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AlertsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { AlertsPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { AlertsPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const AlertsPermissionSchema = z.object({
|
|
8
|
+
action: AlertsPermissionActionsSchema,
|
|
9
|
+
resources: AlertsPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: AlertsPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AlertsPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "lock", "update", "update_texts", "update_dates", "update_publish_status"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"alerts">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "alerts";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update" | "update_texts" | "update_dates" | "update_publish_status")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "alerts";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update" | "update_texts" | "update_dates" | "update_publish_status")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type AlertsPermissionRegistry = z.infer<typeof AlertsPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AlertsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { AlertsPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const AlertsPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(AlertsPermissionActionsSchema),
|
|
8
|
+
scope: AlertsPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AlertsPermissionResourcesSchema: z.ZodObject<{
|
|
3
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
reference_types: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
agency_ids: string[];
|
|
7
|
+
reference_types: string[];
|
|
8
|
+
}, {
|
|
9
|
+
agency_ids?: string[] | undefined;
|
|
10
|
+
reference_types?: string[] | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type AlertsPermissionResources = z.infer<typeof AlertsPermissionResourcesSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AnnotationsPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "read", "lock", "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<"annotations">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
14
|
+
scope: "annotations";
|
|
15
|
+
resources: {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
20
|
+
scope: "annotations";
|
|
21
|
+
resources?: {
|
|
22
|
+
agency_ids?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type AnnotationsPermission = z.infer<typeof AnnotationsPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AnnotationsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { AnnotationsPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { AnnotationsPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const AnnotationsPermissionSchema = z.object({
|
|
8
|
+
action: AnnotationsPermissionActionsSchema,
|
|
9
|
+
resources: AnnotationsPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: AnnotationsPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AnnotationsPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "lock", "update"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"annotations">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "annotations";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "annotations";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type AnnotationsPermissionRegistry = z.infer<typeof AnnotationsPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AnnotationsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { AnnotationsPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const AnnotationsPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(AnnotationsPermissionActionsSchema),
|
|
8
|
+
scope: AnnotationsPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AnnotationsPermissionResourcesSchema: z.ZodObject<{
|
|
3
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
agency_ids: string[];
|
|
6
|
+
}, {
|
|
7
|
+
agency_ids?: string[] | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export type AnnotationsPermissionResources = z.infer<typeof AnnotationsPermissionResourcesSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EventsPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "read", "lock", "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<"events">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
14
|
+
scope: "events";
|
|
15
|
+
resources: {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
20
|
+
scope: "events";
|
|
21
|
+
resources?: {
|
|
22
|
+
agency_ids?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type EventsPermission = z.infer<typeof EventsPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { EventsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { EventsPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { EventsPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const EventsPermissionSchema = z.object({
|
|
8
|
+
action: EventsPermissionActionsSchema,
|
|
9
|
+
resources: EventsPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: EventsPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EventsPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "lock", "update"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"events">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "events";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "events";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type EventsPermissionRegistry = z.infer<typeof EventsPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { EventsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { EventsPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const EventsPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(EventsPermissionActionsSchema),
|
|
8
|
+
scope: EventsPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EventsPermissionResourcesSchema: z.ZodObject<{
|
|
3
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
agency_ids: string[];
|
|
6
|
+
}, {
|
|
7
|
+
agency_ids?: string[] | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export type EventsPermissionResources = z.infer<typeof EventsPermissionResourcesSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FaresPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "lock", "nav", "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<"fares">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
action: "create" | "delete" | "lock" | "update" | "nav";
|
|
14
|
+
scope: "fares";
|
|
15
|
+
resources: {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
action: "create" | "delete" | "lock" | "update" | "nav";
|
|
20
|
+
scope: "fares";
|
|
21
|
+
resources?: {
|
|
22
|
+
agency_ids?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type FaresPermission = z.infer<typeof FaresPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { FaresPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { FaresPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { FaresPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const FaresPermissionSchema = z.object({
|
|
8
|
+
action: FaresPermissionActionsSchema,
|
|
9
|
+
resources: FaresPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: FaresPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FaresPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "lock", "nav", "update"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"fares">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "fares";
|
|
7
|
+
actions: ("create" | "delete" | "lock" | "update" | "nav")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "fares";
|
|
10
|
+
actions: ("create" | "delete" | "lock" | "update" | "nav")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type FaresPermissionRegistry = z.infer<typeof FaresPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { FaresPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { FaresPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const FaresPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(FaresPermissionActionsSchema),
|
|
8
|
+
scope: FaresPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FaresPermissionResourcesSchema: z.ZodObject<{
|
|
3
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
agency_ids: string[];
|
|
6
|
+
}, {
|
|
7
|
+
agency_ids?: string[] | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export type FaresPermissionResources = z.infer<typeof FaresPermissionResourcesSchema>;
|