@tmlmobilidade/types
Version:
1,201 lines • 75.3 kB
TypeScript
import { z } from 'zod';
export declare const UserPreferenceValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>;
export type UserPreferenceValue = z.infer<typeof UserPreferenceValueSchema>;
export declare const UserSchema_UNSAFE: z.ZodObject<{
_id: z.ZodString;
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
created_by: z.ZodOptional<z.ZodString>;
is_locked: z.ZodDefault<z.ZodBoolean>;
updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
updated_by: z.ZodOptional<z.ZodString>;
} & {
email: z.ZodString;
email_verified: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
first_name: z.ZodString;
last_name: z.ZodString;
organization_id: z.ZodString;
password_hash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
permissions: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"agencies">;
}, "strip", z.ZodTypeAny, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"alerts_scheduled">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"alerts_realtime">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
agency_ids: string[];
};
}, {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
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"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"rides">;
}, "strip", z.ZodTypeAny, {
scope: "rides";
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";
resources: {
agency_ids: string[];
};
}, {
scope: "rides";
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";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["read"]>;
scope: z.ZodLiteral<"sams">;
}, "strip", z.ZodTypeAny, {
scope: "sams";
action: "read";
}, {
scope: "sams";
action: "read";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "read", "lock", "request_approval"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"gtfs_validations">;
}, "strip", z.ZodTypeAny, {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources: {
agency_ids: string[];
};
}, {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["read_links", "read_wiki"]>;
scope: z.ZodLiteral<"home">;
}, "strip", z.ZodTypeAny, {
scope: "home";
action: "read_links" | "read_wiki";
}, {
scope: "home";
action: "read_links" | "read_wiki";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"organizations">;
}, "strip", z.ZodTypeAny, {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["read"]>;
scope: z.ZodLiteral<"performance">;
}, "strip", z.ZodTypeAny, {
scope: "performance";
action: "read";
}, {
scope: "performance";
action: "read";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"plans">;
}, "strip", z.ZodTypeAny, {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources: {
agency_ids: string[];
};
}, {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"roles">;
}, "strip", z.ZodTypeAny, {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
municipality_ids: string[];
agency_ids: string[];
}, {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"stops">;
}, "strip", z.ZodTypeAny, {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
municipality_ids: string[];
agency_ids: string[];
};
}, {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"users">;
}, "strip", z.ZodTypeAny, {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create_annotations", "delete_annotations", "read_annotations", "update_annotations", "lock_annotations"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"dates">;
}, "strip", z.ZodTypeAny, {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources: {
agency_ids: string[];
};
}, {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>]>, "many">>;
phone: z.ZodDefault<z.ZodNullable<z.ZodString>>;
preferences: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
seen_last_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
verification_token_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
is_locked: boolean;
updated_at: number & {
__brand: "UnixTimestamp";
};
phone: string | null;
email: string;
permissions: ({
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
agency_ids: string[];
};
} | {
scope: "rides";
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";
resources: {
agency_ids: string[];
};
} | {
scope: "sams";
action: "read";
} | {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources: {
agency_ids: string[];
};
} | {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources: {
agency_ids: string[];
};
} | {
scope: "home";
action: "read_links" | "read_wiki";
} | {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "performance";
action: "read";
} | {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources: {
agency_ids: string[];
};
} | {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
municipality_ids: string[];
agency_ids: string[];
};
} | {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
})[];
email_verified: import("../_common/unix-timestamp.js").UnixTimestamp | null;
first_name: string;
last_name: string;
organization_id: string;
password_hash: string | null;
preferences: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null;
role_ids: string[];
seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
session_ids: string[];
verification_token_ids: string[];
created_by?: string | undefined;
updated_by?: string | undefined;
}, {
_id: string;
created_at: number;
updated_at: number;
email: string;
first_name: string;
last_name: string;
organization_id: string;
created_by?: string | undefined;
is_locked?: boolean | undefined;
updated_by?: string | undefined;
phone?: string | null | undefined;
permissions?: ({
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "rides";
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";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "sams";
action: "read";
} | {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "home";
action: "read_links" | "read_wiki";
} | {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "performance";
action: "read";
} | {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
})[] | undefined;
email_verified?: number | null | undefined;
password_hash?: string | null | undefined;
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
role_ids?: string[] | undefined;
seen_last_at?: number | null | undefined;
session_ids?: string[] | undefined;
verification_token_ids?: string[] | undefined;
}>;
export declare const CreateUserSchema: z.ZodObject<Omit<{
_id: z.ZodString;
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
created_by: z.ZodOptional<z.ZodString>;
is_locked: z.ZodDefault<z.ZodBoolean>;
updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
updated_by: z.ZodOptional<z.ZodString>;
} & {
email: z.ZodString;
email_verified: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
first_name: z.ZodString;
last_name: z.ZodString;
organization_id: z.ZodString;
password_hash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
permissions: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"agencies">;
}, "strip", z.ZodTypeAny, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"alerts_scheduled">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"alerts_realtime">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
agency_ids: string[];
};
}, {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
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"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"rides">;
}, "strip", z.ZodTypeAny, {
scope: "rides";
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";
resources: {
agency_ids: string[];
};
}, {
scope: "rides";
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";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["read"]>;
scope: z.ZodLiteral<"sams">;
}, "strip", z.ZodTypeAny, {
scope: "sams";
action: "read";
}, {
scope: "sams";
action: "read";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "read", "lock", "request_approval"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"gtfs_validations">;
}, "strip", z.ZodTypeAny, {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources: {
agency_ids: string[];
};
}, {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["read_links", "read_wiki"]>;
scope: z.ZodLiteral<"home">;
}, "strip", z.ZodTypeAny, {
scope: "home";
action: "read_links" | "read_wiki";
}, {
scope: "home";
action: "read_links" | "read_wiki";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"organizations">;
}, "strip", z.ZodTypeAny, {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["read"]>;
scope: z.ZodLiteral<"performance">;
}, "strip", z.ZodTypeAny, {
scope: "performance";
action: "read";
}, {
scope: "performance";
action: "read";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"plans">;
}, "strip", z.ZodTypeAny, {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources: {
agency_ids: string[];
};
}, {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"roles">;
}, "strip", z.ZodTypeAny, {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
municipality_ids: string[];
agency_ids: string[];
}, {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"stops">;
}, "strip", z.ZodTypeAny, {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
municipality_ids: string[];
agency_ids: string[];
};
}, {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"users">;
}, "strip", z.ZodTypeAny, {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create_annotations", "delete_annotations", "read_annotations", "update_annotations", "lock_annotations"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"dates">;
}, "strip", z.ZodTypeAny, {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources: {
agency_ids: string[];
};
}, {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>]>, "many">>;
phone: z.ZodDefault<z.ZodNullable<z.ZodString>>;
preferences: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
seen_last_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
verification_token_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "_id" | "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
is_locked: boolean;
phone: string | null;
email: string;
permissions: ({
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
agency_ids: string[];
};
} | {
scope: "rides";
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";
resources: {
agency_ids: string[];
};
} | {
scope: "sams";
action: "read";
} | {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources: {
agency_ids: string[];
};
} | {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources: {
agency_ids: string[];
};
} | {
scope: "home";
action: "read_links" | "read_wiki";
} | {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "performance";
action: "read";
} | {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources: {
agency_ids: string[];
};
} | {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
municipality_ids: string[];
agency_ids: string[];
};
} | {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
})[];
email_verified: import("../_common/unix-timestamp.js").UnixTimestamp | null;
first_name: string;
last_name: string;
organization_id: string;
password_hash: string | null;
preferences: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null;
role_ids: string[];
seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
session_ids: string[];
verification_token_ids: string[];
created_by?: string | undefined;
updated_by?: string | undefined;
}, {
email: string;
first_name: string;
last_name: string;
organization_id: string;
created_by?: string | undefined;
is_locked?: boolean | undefined;
updated_by?: string | undefined;
phone?: string | null | undefined;
permissions?: ({
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "rides";
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";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "sams";
action: "read";
} | {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "home";
action: "read_links" | "read_wiki";
} | {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "performance";
action: "read";
} | {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
})[] | undefined;
email_verified?: number | null | undefined;
password_hash?: string | null | undefined;
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
role_ids?: string[] | undefined;
seen_last_at?: number | null | undefined;
session_ids?: string[] | undefined;
verification_token_ids?: string[] | undefined;
}>;
export declare const UpdateUserSchema: z.ZodObject<{
is_locked: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
phone: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
email: z.ZodOptional<z.ZodString>;
permissions: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"agencies">;
}, "strip", z.ZodTypeAny, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"alerts_scheduled">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"alerts_realtime">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
agency_ids: string[];
};
}, {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
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"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"rides">;
}, "strip", z.ZodTypeAny, {
scope: "rides";
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";
resources: {
agency_ids: string[];
};
}, {
scope: "rides";
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";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["read"]>;
scope: z.ZodLiteral<"sams">;
}, "strip", z.ZodTypeAny, {
scope: "sams";
action: "read";
}, {
scope: "sams";
action: "read";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "read", "lock", "request_approval"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"gtfs_validations">;
}, "strip", z.ZodTypeAny, {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources: {
agency_ids: string[];
};
}, {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["read_links", "read_wiki"]>;
scope: z.ZodLiteral<"home">;
}, "strip", z.ZodTypeAny, {
scope: "home";
action: "read_links" | "read_wiki";
}, {
scope: "home";
action: "read_links" | "read_wiki";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"organizations">;
}, "strip", z.ZodTypeAny, {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["read"]>;
scope: z.ZodLiteral<"performance">;
}, "strip", z.ZodTypeAny, {
scope: "performance";
action: "read";
}, {
scope: "performance";
action: "read";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "read_controller", "read_pcgi_legacy", "lock", "update", "update_controller", "update_feed_info_dates", "update_gtfs_plan", "update_pcgi_legacy"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"plans">;
}, "strip", z.ZodTypeAny, {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources: {
agency_ids: string[];
};
}, {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"roles">;
}, "strip", z.ZodTypeAny, {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
municipality_ids: string[];
agency_ids: string[];
}, {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"stops">;
}, "strip", z.ZodTypeAny, {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
municipality_ids: string[];
agency_ids: string[];
};
}, {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"users">;
}, "strip", z.ZodTypeAny, {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create_annotations", "delete_annotations", "read_annotations", "update_annotations", "lock_annotations"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string[] | undefined;
}>>;
scope: z.ZodLiteral<"dates">;
}, "strip", z.ZodTypeAny, {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources: {
agency_ids: string[];
};
}, {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
}>]>, "many">>>;
email_verified: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>>;
first_name: z.ZodOptional<z.ZodString>;
last_name: z.ZodOptional<z.ZodString>;
organization_id: z.ZodOptional<z.ZodString>;
password_hash: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
preferences: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>>;
role_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
seen_last_at: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>>;
}, "strip", z.ZodTypeAny, {
is_locked?: boolean | undefined;
updated_by?: string | undefined;
phone?: string | null | undefined;
email?: string | undefined;
permissions?: ({
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
agency_ids: string[];
};
} | {
scope: "rides";
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";
resources: {
agency_ids: string[];
};
} | {
scope: "sams";
action: "read";
} | {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources: {
agency_ids: string[];
};
} | {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources: {
agency_ids: string[];
};
} | {
scope: "home";
action: "read_links" | "read_wiki";
} | {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "performance";
action: "read";
} | {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources: {
agency_ids: string[];
};
} | {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources: {
municipality_ids: string[];
agency_ids: string[];
};
} | {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
})[] | undefined;
email_verified?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
first_name?: string | undefined;
last_name?: string | undefined;
organization_id?: string | undefined;
password_hash?: string | null | undefined;
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
role_ids?: string[] | undefined;
seen_last_at?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
}, {
is_locked?: boolean | undefined;
updated_by?: string | undefined;
phone?: string | null | undefined;
email?: string | undefined;
permissions?: ({
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "alerts_realtime";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "rides";
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";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "sams";
action: "read";
} | {
scope: "dates";
action: "create_annotations" | "delete_annotations" | "read_annotations" | "update_annotations" | "lock_annotations";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "gtfs_validations";
action: "create" | "read" | "lock" | "request_approval";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "home";
action: "read_links" | "read_wiki";
} | {
scope: "organizations";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "performance";
action: "read";
} | {
scope: "plans";
action: "create" | "update" | "delete" | "read" | "lock" | "read_controller" | "read_pcgi_legacy" | "update_controller" | "update_feed_info_dates" | "update_gtfs_plan" | "update_pcgi_legacy";
resources?: {
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "roles";
action: "create" | "update" | "delete" | "read" | "lock";
} | {
scope: "stops";
action: "create" | "update" | "delete" | "read" | "lock";
resources?: {
municipality_ids?: string[] | undefined;
agency_ids?: string[] | undefined;
} | undefined;
} | {
scope: "users";
action: "create" | "update" | "delete" | "read" | "lock";
})[] | undefined;
email_verified?: number | null | undefined;
first_name?: string | undefined;
last_name?: string | undefined;
organization_id?: string | undefined;
password_hash?: string | null | undefined;
preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
role_ids?: string[] | undefined;
seen_last_at?: number | null | undefined;
}>;
export declare const UserSchema: z.ZodObject<Omit<{
_id: z.ZodString;
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
created_by: z.ZodOptional<z.ZodString>;
is_locked: z.ZodDefault<z.ZodBoolean>;
updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
updated_by: z.ZodOptional<z.ZodString>;
} & {
email: z.ZodString;
email_verified: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
first_name: z.ZodString;
last_name: z.ZodString;
organization_id: z.ZodString;
password_hash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
permissions: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"scope", [z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"agencies">;
}, "strip", z.ZodTypeAny, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "agencies";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
scope: z.ZodLiteral<"alerts_scheduled">;
}, "strip", z.ZodTypeAny, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}, {
scope: "alerts_scheduled";
action: "create" | "update" | "delete" | "read" | "lock";
}>, z.ZodObject<{
action: z.ZodEnum<["create", "delete", "read", "lock", "update"]>;
resources: z.ZodDefault<z.ZodObject<{
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
agency_ids: string[];
}, {
agency_ids?: string