@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { PlansPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { PlansPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { PlansPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const PlansPermissionSchema = z.object({
|
|
8
|
+
action: PlansPermissionActionsSchema,
|
|
9
|
+
resources: PlansPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: PlansPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PlansPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy", "read_apex_file", "update_apex_file", "delete_apex_file", "send_apex_notification", "generate_pdf_posters"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"plans">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "plans";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy" | "read_apex_file" | "update_apex_file" | "delete_apex_file" | "send_apex_notification" | "generate_pdf_posters")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "plans";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy" | "read_apex_file" | "update_apex_file" | "delete_apex_file" | "send_apex_notification" | "generate_pdf_posters")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type PlansPermissionRegistry = z.infer<typeof PlansPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { PlansPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { PlansPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const PlansPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(PlansPermissionActionsSchema),
|
|
8
|
+
scope: PlansPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PlansPermissionResourcesSchema: 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 PlansPermissionResources = z.infer<typeof PlansPermissionResourcesSchema>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RidesPermissionActionsSchema: 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", "acceptance_comment_activity"]>;
|
|
3
|
+
export type RidesPermissionActions = z.infer<typeof RidesPermissionActionsSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/* * */
|
|
4
|
+
const RidesPermissionActionsValues = [
|
|
5
|
+
'acceptance_change_status',
|
|
6
|
+
'acceptance_justify',
|
|
7
|
+
'acceptance_lock',
|
|
8
|
+
'acceptance_read',
|
|
9
|
+
'analsys_lock',
|
|
10
|
+
'analysis_lock',
|
|
11
|
+
'analysis_read',
|
|
12
|
+
'analysis_reprocess',
|
|
13
|
+
'analysis_update',
|
|
14
|
+
'audit_lock',
|
|
15
|
+
'audit_read',
|
|
16
|
+
'audit_update',
|
|
17
|
+
'acceptance_comment_activity',
|
|
18
|
+
];
|
|
19
|
+
export const RidesPermissionActionsSchema = z.enum(RidesPermissionActionsValues);
|
|
@@ -0,0 +1,25 @@
|
|
|
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", "acceptance_comment_activity"]>;
|
|
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
|
+
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" | "acceptance_comment_activity";
|
|
14
|
+
scope: "rides";
|
|
15
|
+
resources: {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
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" | "acceptance_comment_activity";
|
|
20
|
+
scope: "rides";
|
|
21
|
+
resources?: {
|
|
22
|
+
agency_ids?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type RidesPermission = z.infer<typeof RidesPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { RidesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { RidesPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { RidesPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const RidesPermissionSchema = z.object({
|
|
8
|
+
action: RidesPermissionActionsSchema,
|
|
9
|
+
resources: RidesPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: RidesPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RidesPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<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", "acceptance_comment_activity"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"rides">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "rides";
|
|
7
|
+
actions: ("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" | "acceptance_comment_activity")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "rides";
|
|
10
|
+
actions: ("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" | "acceptance_comment_activity")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type RidesPermissionRegistry = z.infer<typeof RidesPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { RidesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { RidesPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const RidesPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(RidesPermissionActionsSchema),
|
|
8
|
+
scope: RidesPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RidesPermissionResourcesSchema: 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 RidesPermissionResources = z.infer<typeof RidesPermissionResourcesSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RolesPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
|
|
4
|
+
scope: z.ZodLiteral<"roles">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
7
|
+
scope: "roles";
|
|
8
|
+
}, {
|
|
9
|
+
action: "create" | "delete" | "read" | "lock" | "update";
|
|
10
|
+
scope: "roles";
|
|
11
|
+
}>;
|
|
12
|
+
export type RolesPermission = z.infer<typeof RolesPermissionSchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { RolesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { RolesPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const RolesPermissionSchema = z.object({
|
|
7
|
+
action: RolesPermissionActionsSchema,
|
|
8
|
+
scope: RolesPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RolesPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "lock", "update"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"roles">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "roles";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "roles";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type RolesPermissionRegistry = z.infer<typeof RolesPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { RolesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { RolesPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const RolesPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(RolesPermissionActionsSchema),
|
|
8
|
+
scope: RolesPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SamsPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["read", "export"]>;
|
|
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<"sams">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
action: "read" | "export";
|
|
14
|
+
scope: "sams";
|
|
15
|
+
resources: {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
action: "read" | "export";
|
|
20
|
+
scope: "sams";
|
|
21
|
+
resources?: {
|
|
22
|
+
agency_ids?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type SamsPermission = z.infer<typeof SamsPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { SamsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { SamsPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { SamsPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const SamsPermissionSchema = z.object({
|
|
8
|
+
action: SamsPermissionActionsSchema,
|
|
9
|
+
resources: SamsPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: SamsPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SamsPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["read", "export"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"sams">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "sams";
|
|
7
|
+
actions: ("read" | "export")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "sams";
|
|
10
|
+
actions: ("read" | "export")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type SamsPermissionRegistry = z.infer<typeof SamsPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { SamsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { SamsPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const SamsPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(SamsPermissionActionsSchema),
|
|
8
|
+
scope: SamsPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SamsPermissionResourcesSchema: 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 SamsPermissionResources = z.infer<typeof SamsPermissionResourcesSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/* * */
|
|
4
|
+
const StopsPermissionActionsValues = [
|
|
5
|
+
'create',
|
|
6
|
+
'delete',
|
|
7
|
+
'read',
|
|
8
|
+
'lock',
|
|
9
|
+
'update',
|
|
10
|
+
'export',
|
|
11
|
+
'edit_coordinates',
|
|
12
|
+
'edit_name',
|
|
13
|
+
];
|
|
14
|
+
export const StopsPermissionActionsSchema = z.enum(StopsPermissionActionsValues);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StopsPermissionSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<["create", "delete", "read", "lock", "update", "export", "edit_coordinates", "edit_name"]>;
|
|
4
|
+
resources: z.ZodDefault<z.ZodObject<{
|
|
5
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
agency_ids: string[];
|
|
9
|
+
municipality_ids: string[];
|
|
10
|
+
}, {
|
|
11
|
+
agency_ids?: string[] | undefined;
|
|
12
|
+
municipality_ids?: string[] | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
scope: z.ZodLiteral<"stops">;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
action: "create" | "delete" | "read" | "lock" | "update" | "export" | "edit_coordinates" | "edit_name";
|
|
17
|
+
scope: "stops";
|
|
18
|
+
resources: {
|
|
19
|
+
agency_ids: string[];
|
|
20
|
+
municipality_ids: string[];
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
action: "create" | "delete" | "read" | "lock" | "update" | "export" | "edit_coordinates" | "edit_name";
|
|
24
|
+
scope: "stops";
|
|
25
|
+
resources?: {
|
|
26
|
+
agency_ids?: string[] | undefined;
|
|
27
|
+
municipality_ids?: string[] | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type StopsPermission = z.infer<typeof StopsPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { StopsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { StopsPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { StopsPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const StopsPermissionSchema = z.object({
|
|
8
|
+
action: StopsPermissionActionsSchema,
|
|
9
|
+
resources: StopsPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: StopsPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StopsPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "read", "lock", "update", "export", "edit_coordinates", "edit_name"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"stops">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "stops";
|
|
7
|
+
actions: ("create" | "delete" | "read" | "lock" | "update" | "export" | "edit_coordinates" | "edit_name")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "stops";
|
|
10
|
+
actions: ("create" | "delete" | "read" | "lock" | "update" | "export" | "edit_coordinates" | "edit_name")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type StopsPermissionRegistry = z.infer<typeof StopsPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { StopsPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { StopsPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const StopsPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(StopsPermissionActionsSchema),
|
|
8
|
+
scope: StopsPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StopsPermissionResourcesSchema: z.ZodObject<{
|
|
3
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
agency_ids: string[];
|
|
7
|
+
municipality_ids: string[];
|
|
8
|
+
}, {
|
|
9
|
+
agency_ids?: string[] | undefined;
|
|
10
|
+
municipality_ids?: string[] | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type StopsPermissionResources = z.infer<typeof StopsPermissionResourcesSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TypologiesPermissionSchema: 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<"typologies">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
action: "create" | "delete" | "lock" | "update" | "nav";
|
|
14
|
+
scope: "typologies";
|
|
15
|
+
resources: {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
action: "create" | "delete" | "lock" | "update" | "nav";
|
|
20
|
+
scope: "typologies";
|
|
21
|
+
resources?: {
|
|
22
|
+
agency_ids?: string[] | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type TypologiesPermission = z.infer<typeof TypologiesPermissionSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { TypologiesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { TypologiesPermissionResourcesSchema } from './resources.js';
|
|
5
|
+
import { TypologiesPermissionScopeSchema } from './scope.js';
|
|
6
|
+
/* * */
|
|
7
|
+
export const TypologiesPermissionSchema = z.object({
|
|
8
|
+
action: TypologiesPermissionActionsSchema,
|
|
9
|
+
resources: TypologiesPermissionResourcesSchema.default({}),
|
|
10
|
+
scope: TypologiesPermissionScopeSchema,
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TypologiesPermissionRegistrySchema: z.ZodObject<{
|
|
3
|
+
actions: z.ZodArray<z.ZodEnum<["create", "delete", "lock", "nav", "update"]>, "many">;
|
|
4
|
+
scope: z.ZodLiteral<"typologies">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
scope: "typologies";
|
|
7
|
+
actions: ("create" | "delete" | "lock" | "update" | "nav")[];
|
|
8
|
+
}, {
|
|
9
|
+
scope: "typologies";
|
|
10
|
+
actions: ("create" | "delete" | "lock" | "update" | "nav")[];
|
|
11
|
+
}>;
|
|
12
|
+
export type TypologiesPermissionRegistry = z.infer<typeof TypologiesPermissionRegistrySchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { TypologiesPermissionActionsSchema } from './actions.js';
|
|
4
|
+
import { TypologiesPermissionScopeSchema } from './scope.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const TypologiesPermissionRegistrySchema = z.object({
|
|
7
|
+
actions: z.array(TypologiesPermissionActionsSchema),
|
|
8
|
+
scope: TypologiesPermissionScopeSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TypologiesPermissionResourcesSchema: 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 TypologiesPermissionResources = z.infer<typeof TypologiesPermissionResourcesSchema>;
|