@tmlmobilidade/types 20260408.1117.19 → 20260409.1552.16
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/dates/common.d.ts +0 -32
- package/dist/dates/common.js +0 -18
- package/dist/dates/index.d.ts +2 -0
- package/dist/dates/index.js +2 -0
- package/dist/dates/months.d.ts +52 -0
- package/dist/dates/months.js +29 -0
- package/dist/dates/weekdays.d.ts +32 -0
- package/dist/dates/weekdays.js +19 -0
- package/dist/file-exports/base.d.ts +11 -11
- package/dist/file-exports/base.js +1 -1
- package/dist/file-exports/file-exports.d.ts +114 -0
- package/dist/file-exports/file-exports.js +2 -0
- package/dist/file-exports/gtfs-export.d.ts +203 -0
- package/dist/file-exports/gtfs-export.js +27 -0
- package/dist/file-exports/index.d.ts +1 -0
- package/dist/file-exports/index.js +1 -0
- package/dist/gtfs/feed-info.d.ts +4 -4
- package/dist/gtfs-tml/feed-info.d.ts +4 -4
- package/dist/gtfs-validation/gtfs-validation.d.ts +24 -24
- package/dist/offer/parameters.js +1 -1
- package/dist/offer/pattern.d.ts +56 -0
- package/dist/offer/rules.d.ts +102 -0
- package/dist/offer/rules.js +19 -7
- package/dist/plans/plan.d.ts +24 -24
- package/package.json +1 -1
package/dist/dates/common.d.ts
CHANGED
|
@@ -1,36 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export type IsoWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
3
|
-
export declare const WEEKDAYS: {
|
|
4
|
-
readonly Fri: 5;
|
|
5
|
-
readonly Mon: 1;
|
|
6
|
-
readonly Sat: 6;
|
|
7
|
-
readonly Sun: 7;
|
|
8
|
-
readonly Thu: 4;
|
|
9
|
-
readonly Tue: 2;
|
|
10
|
-
readonly Wed: 3;
|
|
11
|
-
};
|
|
12
|
-
export declare const WEEKDAY_OPTIONS: readonly [{
|
|
13
|
-
readonly label: "Seg";
|
|
14
|
-
readonly value: 1;
|
|
15
|
-
}, {
|
|
16
|
-
readonly label: "Ter";
|
|
17
|
-
readonly value: 2;
|
|
18
|
-
}, {
|
|
19
|
-
readonly label: "Qua";
|
|
20
|
-
readonly value: 3;
|
|
21
|
-
}, {
|
|
22
|
-
readonly label: "Qui";
|
|
23
|
-
readonly value: 4;
|
|
24
|
-
}, {
|
|
25
|
-
readonly label: "Sex";
|
|
26
|
-
readonly value: 5;
|
|
27
|
-
}, {
|
|
28
|
-
readonly label: "Sáb";
|
|
29
|
-
readonly value: 6;
|
|
30
|
-
}, {
|
|
31
|
-
readonly label: "Dom e Fer";
|
|
32
|
-
readonly value: 7;
|
|
33
|
-
}];
|
|
34
2
|
/**
|
|
35
3
|
* Parses an operational HH:MM.
|
|
36
4
|
*
|
package/dist/dates/common.js
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export const WEEKDAYS = {
|
|
4
|
-
Fri: 5,
|
|
5
|
-
Mon: 1,
|
|
6
|
-
Sat: 6,
|
|
7
|
-
Sun: 7,
|
|
8
|
-
Thu: 4,
|
|
9
|
-
Tue: 2,
|
|
10
|
-
Wed: 3,
|
|
11
|
-
};
|
|
12
|
-
export const WEEKDAY_OPTIONS = [
|
|
13
|
-
{ label: 'Seg', value: WEEKDAYS.Mon },
|
|
14
|
-
{ label: 'Ter', value: WEEKDAYS.Tue },
|
|
15
|
-
{ label: 'Qua', value: WEEKDAYS.Wed },
|
|
16
|
-
{ label: 'Qui', value: WEEKDAYS.Thu },
|
|
17
|
-
{ label: 'Sex', value: WEEKDAYS.Fri },
|
|
18
|
-
{ label: 'Sáb', value: WEEKDAYS.Sat },
|
|
19
|
-
{ label: 'Dom e Fer', value: WEEKDAYS.Sun },
|
|
20
|
-
];
|
|
21
3
|
/* * */
|
|
22
4
|
const OPERATIONAL_DAY_START_HOUR = 4;
|
|
23
5
|
/**
|
package/dist/dates/index.d.ts
CHANGED
package/dist/dates/index.js
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type Month = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
2
|
+
export declare const MONTHS: {
|
|
3
|
+
readonly Apr: 4;
|
|
4
|
+
readonly Aug: 8;
|
|
5
|
+
readonly Dec: 12;
|
|
6
|
+
readonly Feb: 2;
|
|
7
|
+
readonly Jan: 1;
|
|
8
|
+
readonly Jul: 7;
|
|
9
|
+
readonly Jun: 6;
|
|
10
|
+
readonly Mar: 3;
|
|
11
|
+
readonly May: 5;
|
|
12
|
+
readonly Nov: 11;
|
|
13
|
+
readonly Oct: 10;
|
|
14
|
+
readonly Sep: 9;
|
|
15
|
+
};
|
|
16
|
+
export declare const MONTH_OPTIONS: readonly [{
|
|
17
|
+
readonly label: "Jan";
|
|
18
|
+
readonly value: 1;
|
|
19
|
+
}, {
|
|
20
|
+
readonly label: "Fev";
|
|
21
|
+
readonly value: 2;
|
|
22
|
+
}, {
|
|
23
|
+
readonly label: "Mar";
|
|
24
|
+
readonly value: 3;
|
|
25
|
+
}, {
|
|
26
|
+
readonly label: "Abr";
|
|
27
|
+
readonly value: 4;
|
|
28
|
+
}, {
|
|
29
|
+
readonly label: "Mai";
|
|
30
|
+
readonly value: 5;
|
|
31
|
+
}, {
|
|
32
|
+
readonly label: "Jun";
|
|
33
|
+
readonly value: 6;
|
|
34
|
+
}, {
|
|
35
|
+
readonly label: "Jul";
|
|
36
|
+
readonly value: 7;
|
|
37
|
+
}, {
|
|
38
|
+
readonly label: "Ago";
|
|
39
|
+
readonly value: 8;
|
|
40
|
+
}, {
|
|
41
|
+
readonly label: "Set";
|
|
42
|
+
readonly value: 9;
|
|
43
|
+
}, {
|
|
44
|
+
readonly label: "Out";
|
|
45
|
+
readonly value: 10;
|
|
46
|
+
}, {
|
|
47
|
+
readonly label: "Nov";
|
|
48
|
+
readonly value: 11;
|
|
49
|
+
}, {
|
|
50
|
+
readonly label: "Dez";
|
|
51
|
+
readonly value: 12;
|
|
52
|
+
}];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
export const MONTHS = {
|
|
3
|
+
Apr: 4,
|
|
4
|
+
Aug: 8,
|
|
5
|
+
Dec: 12,
|
|
6
|
+
Feb: 2,
|
|
7
|
+
Jan: 1,
|
|
8
|
+
Jul: 7,
|
|
9
|
+
Jun: 6,
|
|
10
|
+
Mar: 3,
|
|
11
|
+
May: 5,
|
|
12
|
+
Nov: 11,
|
|
13
|
+
Oct: 10,
|
|
14
|
+
Sep: 9,
|
|
15
|
+
};
|
|
16
|
+
export const MONTH_OPTIONS = [
|
|
17
|
+
{ label: 'Jan', value: MONTHS.Jan },
|
|
18
|
+
{ label: 'Fev', value: MONTHS.Feb },
|
|
19
|
+
{ label: 'Mar', value: MONTHS.Mar },
|
|
20
|
+
{ label: 'Abr', value: MONTHS.Apr },
|
|
21
|
+
{ label: 'Mai', value: MONTHS.May },
|
|
22
|
+
{ label: 'Jun', value: MONTHS.Jun },
|
|
23
|
+
{ label: 'Jul', value: MONTHS.Jul },
|
|
24
|
+
{ label: 'Ago', value: MONTHS.Aug },
|
|
25
|
+
{ label: 'Set', value: MONTHS.Sep },
|
|
26
|
+
{ label: 'Out', value: MONTHS.Oct },
|
|
27
|
+
{ label: 'Nov', value: MONTHS.Nov },
|
|
28
|
+
{ label: 'Dez', value: MONTHS.Dec },
|
|
29
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type IsoWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
2
|
+
export declare const WEEKDAYS: {
|
|
3
|
+
readonly Fri: 5;
|
|
4
|
+
readonly Mon: 1;
|
|
5
|
+
readonly Sat: 6;
|
|
6
|
+
readonly Sun: 7;
|
|
7
|
+
readonly Thu: 4;
|
|
8
|
+
readonly Tue: 2;
|
|
9
|
+
readonly Wed: 3;
|
|
10
|
+
};
|
|
11
|
+
export declare const WEEKDAY_OPTIONS: readonly [{
|
|
12
|
+
readonly label: "Seg";
|
|
13
|
+
readonly value: 1;
|
|
14
|
+
}, {
|
|
15
|
+
readonly label: "Ter";
|
|
16
|
+
readonly value: 2;
|
|
17
|
+
}, {
|
|
18
|
+
readonly label: "Qua";
|
|
19
|
+
readonly value: 3;
|
|
20
|
+
}, {
|
|
21
|
+
readonly label: "Qui";
|
|
22
|
+
readonly value: 4;
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "Sex";
|
|
25
|
+
readonly value: 5;
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "Sáb";
|
|
28
|
+
readonly value: 6;
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "Dom e Fer";
|
|
31
|
+
readonly value: 7;
|
|
32
|
+
}];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
export const WEEKDAYS = {
|
|
3
|
+
Fri: 5,
|
|
4
|
+
Mon: 1,
|
|
5
|
+
Sat: 6,
|
|
6
|
+
Sun: 7,
|
|
7
|
+
Thu: 4,
|
|
8
|
+
Tue: 2,
|
|
9
|
+
Wed: 3,
|
|
10
|
+
};
|
|
11
|
+
export const WEEKDAY_OPTIONS = [
|
|
12
|
+
{ label: 'Seg', value: WEEKDAYS.Mon },
|
|
13
|
+
{ label: 'Ter', value: WEEKDAYS.Tue },
|
|
14
|
+
{ label: 'Qua', value: WEEKDAYS.Wed },
|
|
15
|
+
{ label: 'Qui', value: WEEKDAYS.Thu },
|
|
16
|
+
{ label: 'Sex', value: WEEKDAYS.Fri },
|
|
17
|
+
{ label: 'Sáb', value: WEEKDAYS.Sat },
|
|
18
|
+
{ label: 'Dom e Fer', value: WEEKDAYS.Sun },
|
|
19
|
+
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const FileExportTypes: readonly ["ride"];
|
|
3
|
-
export declare const FileExportTypeSchema: z.ZodEnum<["ride"]>;
|
|
2
|
+
export declare const FileExportTypes: readonly ["gtfs", "ride"];
|
|
3
|
+
export declare const FileExportTypeSchema: z.ZodEnum<["gtfs", "ride"]>;
|
|
4
4
|
export type FileExportType = z.infer<typeof FileExportTypeSchema>;
|
|
5
5
|
export declare const FileExportBaseSchema: z.ZodObject<Omit<{
|
|
6
6
|
_id: z.ZodString;
|
|
@@ -14,7 +14,7 @@ export declare const FileExportBaseSchema: z.ZodObject<Omit<{
|
|
|
14
14
|
file_name: z.ZodString;
|
|
15
15
|
processing_status: z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>;
|
|
16
16
|
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
17
|
-
type: z.ZodEnum<["ride"]>;
|
|
17
|
+
type: z.ZodEnum<["gtfs", "ride"]>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
19
|
_id: string;
|
|
20
20
|
created_at: number & {
|
|
@@ -24,7 +24,7 @@ export declare const FileExportBaseSchema: z.ZodObject<Omit<{
|
|
|
24
24
|
updated_at: number & {
|
|
25
25
|
__brand: "UnixTimestamp";
|
|
26
26
|
};
|
|
27
|
-
type: "ride";
|
|
27
|
+
type: "gtfs" | "ride";
|
|
28
28
|
file_name: string;
|
|
29
29
|
processing_status: "waiting" | "processing" | "complete" | "error" | "skipped";
|
|
30
30
|
properties: Record<string, any>;
|
|
@@ -34,7 +34,7 @@ export declare const FileExportBaseSchema: z.ZodObject<Omit<{
|
|
|
34
34
|
_id: string;
|
|
35
35
|
created_at: number;
|
|
36
36
|
updated_at: number;
|
|
37
|
-
type: "ride";
|
|
37
|
+
type: "gtfs" | "ride";
|
|
38
38
|
file_name: string;
|
|
39
39
|
processing_status: "waiting" | "processing" | "complete" | "error" | "skipped";
|
|
40
40
|
properties: Record<string, any>;
|
|
@@ -45,7 +45,7 @@ export declare const FileExportBaseSchema: z.ZodObject<Omit<{
|
|
|
45
45
|
export declare const CreateFileExportSchema: z.ZodObject<{
|
|
46
46
|
created_by: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
47
47
|
updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
48
|
-
type: z.ZodOptional<z.ZodEnum<["ride"]>>;
|
|
48
|
+
type: z.ZodOptional<z.ZodEnum<["gtfs", "ride"]>>;
|
|
49
49
|
file_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
50
50
|
file_name: z.ZodOptional<z.ZodString>;
|
|
51
51
|
processing_status: z.ZodOptional<z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>>;
|
|
@@ -53,7 +53,7 @@ export declare const CreateFileExportSchema: z.ZodObject<{
|
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
54
|
created_by?: string | null | undefined;
|
|
55
55
|
updated_by?: string | undefined;
|
|
56
|
-
type?: "ride" | undefined;
|
|
56
|
+
type?: "gtfs" | "ride" | undefined;
|
|
57
57
|
file_id?: string | null | undefined;
|
|
58
58
|
file_name?: string | undefined;
|
|
59
59
|
processing_status?: "waiting" | "processing" | "complete" | "error" | "skipped" | undefined;
|
|
@@ -61,7 +61,7 @@ export declare const CreateFileExportSchema: z.ZodObject<{
|
|
|
61
61
|
}, {
|
|
62
62
|
created_by?: string | null | undefined;
|
|
63
63
|
updated_by?: string | undefined;
|
|
64
|
-
type?: "ride" | undefined;
|
|
64
|
+
type?: "gtfs" | "ride" | undefined;
|
|
65
65
|
file_id?: string | null | undefined;
|
|
66
66
|
file_name?: string | undefined;
|
|
67
67
|
processing_status?: "waiting" | "processing" | "complete" | "error" | "skipped" | undefined;
|
|
@@ -70,7 +70,7 @@ export declare const CreateFileExportSchema: z.ZodObject<{
|
|
|
70
70
|
export declare const UpdateFileExportSchema: z.ZodObject<{
|
|
71
71
|
created_by: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>>;
|
|
72
72
|
updated_by: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
|
|
73
|
-
type: z.ZodOptional<z.ZodOptional<z.ZodEnum<["ride"]>>>;
|
|
73
|
+
type: z.ZodOptional<z.ZodOptional<z.ZodEnum<["gtfs", "ride"]>>>;
|
|
74
74
|
file_id: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
|
|
75
75
|
file_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
76
76
|
processing_status: z.ZodOptional<z.ZodOptional<z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>>>;
|
|
@@ -78,7 +78,7 @@ export declare const UpdateFileExportSchema: z.ZodObject<{
|
|
|
78
78
|
}, "strip", z.ZodTypeAny, {
|
|
79
79
|
created_by?: string | null | undefined;
|
|
80
80
|
updated_by?: string | undefined;
|
|
81
|
-
type?: "ride" | undefined;
|
|
81
|
+
type?: "gtfs" | "ride" | undefined;
|
|
82
82
|
file_id?: string | null | undefined;
|
|
83
83
|
file_name?: string | undefined;
|
|
84
84
|
processing_status?: "waiting" | "processing" | "complete" | "error" | "skipped" | undefined;
|
|
@@ -86,7 +86,7 @@ export declare const UpdateFileExportSchema: z.ZodObject<{
|
|
|
86
86
|
}, {
|
|
87
87
|
created_by?: string | null | undefined;
|
|
88
88
|
updated_by?: string | undefined;
|
|
89
|
-
type?: "ride" | undefined;
|
|
89
|
+
type?: "gtfs" | "ride" | undefined;
|
|
90
90
|
file_id?: string | null | undefined;
|
|
91
91
|
file_name?: string | undefined;
|
|
92
92
|
processing_status?: "waiting" | "processing" | "complete" | "error" | "skipped" | undefined;
|
|
@@ -3,7 +3,7 @@ import { DocumentSchema } from '../_common/document.js';
|
|
|
3
3
|
import { ProcessingStatusSchema } from '../_common/status.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/* * */
|
|
6
|
-
export const FileExportTypes = ['ride'];
|
|
6
|
+
export const FileExportTypes = ['gtfs', 'ride'];
|
|
7
7
|
export const FileExportTypeSchema = z.enum(FileExportTypes);
|
|
8
8
|
/* * */
|
|
9
9
|
export const FileExportBaseSchema = DocumentSchema
|
|
@@ -8,6 +8,120 @@ export declare const FileExportSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObj
|
|
|
8
8
|
file_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
9
|
file_name: z.ZodString;
|
|
10
10
|
processing_status: z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>;
|
|
11
|
+
} & {
|
|
12
|
+
properties: z.ZodObject<{
|
|
13
|
+
agency_ids: z.ZodArray<z.ZodString, "many">;
|
|
14
|
+
calendars_clip_end_date: z.ZodEffects<z.ZodString, import("../index.js").OperationalDate, string>;
|
|
15
|
+
calendars_clip_start_date: z.ZodEffects<z.ZodString, import("../index.js").OperationalDate, string>;
|
|
16
|
+
feed_end_date: z.ZodEffects<z.ZodString, import("../index.js").OperationalDate, string>;
|
|
17
|
+
feed_start_date: z.ZodEffects<z.ZodString, import("../index.js").OperationalDate, string>;
|
|
18
|
+
lines_exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
lines_include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
lines_mode: z.ZodDefault<z.ZodEnum<["all", "exclude", "include"]>>;
|
|
21
|
+
numeric_calendar_codes: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
stop_sequence_start: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
stops_export_all: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
agency_ids: string[];
|
|
26
|
+
lines_mode: "exclude" | "include" | "all";
|
|
27
|
+
calendars_clip_end_date: string & {
|
|
28
|
+
__brand: "OperationalDate";
|
|
29
|
+
};
|
|
30
|
+
calendars_clip_start_date: string & {
|
|
31
|
+
__brand: "OperationalDate";
|
|
32
|
+
};
|
|
33
|
+
feed_end_date: string & {
|
|
34
|
+
__brand: "OperationalDate";
|
|
35
|
+
};
|
|
36
|
+
feed_start_date: string & {
|
|
37
|
+
__brand: "OperationalDate";
|
|
38
|
+
};
|
|
39
|
+
lines_exclude: string[];
|
|
40
|
+
lines_include: string[];
|
|
41
|
+
numeric_calendar_codes: boolean;
|
|
42
|
+
stop_sequence_start: number;
|
|
43
|
+
stops_export_all: boolean;
|
|
44
|
+
}, {
|
|
45
|
+
agency_ids: string[];
|
|
46
|
+
calendars_clip_end_date: string;
|
|
47
|
+
calendars_clip_start_date: string;
|
|
48
|
+
feed_end_date: string;
|
|
49
|
+
feed_start_date: string;
|
|
50
|
+
lines_mode?: "exclude" | "include" | "all" | undefined;
|
|
51
|
+
lines_exclude?: string[] | undefined;
|
|
52
|
+
lines_include?: string[] | undefined;
|
|
53
|
+
numeric_calendar_codes?: boolean | undefined;
|
|
54
|
+
stop_sequence_start?: number | undefined;
|
|
55
|
+
stops_export_all?: boolean | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
type: z.ZodLiteral<"gtfs">;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
_id: string;
|
|
60
|
+
created_at: number & {
|
|
61
|
+
__brand: "UnixTimestamp";
|
|
62
|
+
};
|
|
63
|
+
created_by: string | null;
|
|
64
|
+
updated_at: number & {
|
|
65
|
+
__brand: "UnixTimestamp";
|
|
66
|
+
};
|
|
67
|
+
type: "gtfs";
|
|
68
|
+
file_name: string;
|
|
69
|
+
processing_status: "waiting" | "processing" | "complete" | "error" | "skipped";
|
|
70
|
+
properties: {
|
|
71
|
+
agency_ids: string[];
|
|
72
|
+
lines_mode: "exclude" | "include" | "all";
|
|
73
|
+
calendars_clip_end_date: string & {
|
|
74
|
+
__brand: "OperationalDate";
|
|
75
|
+
};
|
|
76
|
+
calendars_clip_start_date: string & {
|
|
77
|
+
__brand: "OperationalDate";
|
|
78
|
+
};
|
|
79
|
+
feed_end_date: string & {
|
|
80
|
+
__brand: "OperationalDate";
|
|
81
|
+
};
|
|
82
|
+
feed_start_date: string & {
|
|
83
|
+
__brand: "OperationalDate";
|
|
84
|
+
};
|
|
85
|
+
lines_exclude: string[];
|
|
86
|
+
lines_include: string[];
|
|
87
|
+
numeric_calendar_codes: boolean;
|
|
88
|
+
stop_sequence_start: number;
|
|
89
|
+
stops_export_all: boolean;
|
|
90
|
+
};
|
|
91
|
+
updated_by?: string | undefined;
|
|
92
|
+
file_id?: string | null | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
_id: string;
|
|
95
|
+
created_at: number;
|
|
96
|
+
updated_at: number;
|
|
97
|
+
type: "gtfs";
|
|
98
|
+
file_name: string;
|
|
99
|
+
processing_status: "waiting" | "processing" | "complete" | "error" | "skipped";
|
|
100
|
+
properties: {
|
|
101
|
+
agency_ids: string[];
|
|
102
|
+
calendars_clip_end_date: string;
|
|
103
|
+
calendars_clip_start_date: string;
|
|
104
|
+
feed_end_date: string;
|
|
105
|
+
feed_start_date: string;
|
|
106
|
+
lines_mode?: "exclude" | "include" | "all" | undefined;
|
|
107
|
+
lines_exclude?: string[] | undefined;
|
|
108
|
+
lines_include?: string[] | undefined;
|
|
109
|
+
numeric_calendar_codes?: boolean | undefined;
|
|
110
|
+
stop_sequence_start?: number | undefined;
|
|
111
|
+
stops_export_all?: boolean | undefined;
|
|
112
|
+
};
|
|
113
|
+
created_by?: string | null | undefined;
|
|
114
|
+
updated_by?: string | undefined;
|
|
115
|
+
file_id?: string | null | undefined;
|
|
116
|
+
}>, z.ZodObject<{
|
|
117
|
+
_id: z.ZodString;
|
|
118
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
119
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
120
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
121
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
122
|
+
file_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
file_name: z.ZodString;
|
|
124
|
+
processing_status: z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>;
|
|
11
125
|
} & {
|
|
12
126
|
properties: z.ZodObject<{
|
|
13
127
|
agency_ids: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* * */
|
|
2
|
+
import { GtfsExportSchema } from './gtfs-export.js';
|
|
2
3
|
import { RideExportSchema } from './ride-export.js';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
/* * */
|
|
5
6
|
export const FileExportSchema = z.discriminatedUnion('type', [
|
|
7
|
+
GtfsExportSchema,
|
|
6
8
|
RideExportSchema,
|
|
7
9
|
]);
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GtfsExportPropertiesSchema: z.ZodObject<{
|
|
3
|
+
properties: z.ZodObject<{
|
|
4
|
+
agency_ids: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
calendars_clip_end_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
6
|
+
calendars_clip_start_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
7
|
+
feed_end_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
8
|
+
feed_start_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
9
|
+
lines_exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
lines_include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
+
lines_mode: z.ZodDefault<z.ZodEnum<["all", "exclude", "include"]>>;
|
|
12
|
+
numeric_calendar_codes: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
stop_sequence_start: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
stops_export_all: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
agency_ids: string[];
|
|
17
|
+
lines_mode: "exclude" | "include" | "all";
|
|
18
|
+
calendars_clip_end_date: string & {
|
|
19
|
+
__brand: "OperationalDate";
|
|
20
|
+
};
|
|
21
|
+
calendars_clip_start_date: string & {
|
|
22
|
+
__brand: "OperationalDate";
|
|
23
|
+
};
|
|
24
|
+
feed_end_date: string & {
|
|
25
|
+
__brand: "OperationalDate";
|
|
26
|
+
};
|
|
27
|
+
feed_start_date: string & {
|
|
28
|
+
__brand: "OperationalDate";
|
|
29
|
+
};
|
|
30
|
+
lines_exclude: string[];
|
|
31
|
+
lines_include: string[];
|
|
32
|
+
numeric_calendar_codes: boolean;
|
|
33
|
+
stop_sequence_start: number;
|
|
34
|
+
stops_export_all: boolean;
|
|
35
|
+
}, {
|
|
36
|
+
agency_ids: string[];
|
|
37
|
+
calendars_clip_end_date: string;
|
|
38
|
+
calendars_clip_start_date: string;
|
|
39
|
+
feed_end_date: string;
|
|
40
|
+
feed_start_date: string;
|
|
41
|
+
lines_mode?: "exclude" | "include" | "all" | undefined;
|
|
42
|
+
lines_exclude?: string[] | undefined;
|
|
43
|
+
lines_include?: string[] | undefined;
|
|
44
|
+
numeric_calendar_codes?: boolean | undefined;
|
|
45
|
+
stop_sequence_start?: number | undefined;
|
|
46
|
+
stops_export_all?: boolean | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
type: z.ZodLiteral<"gtfs">;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
type: "gtfs";
|
|
51
|
+
properties: {
|
|
52
|
+
agency_ids: string[];
|
|
53
|
+
lines_mode: "exclude" | "include" | "all";
|
|
54
|
+
calendars_clip_end_date: string & {
|
|
55
|
+
__brand: "OperationalDate";
|
|
56
|
+
};
|
|
57
|
+
calendars_clip_start_date: string & {
|
|
58
|
+
__brand: "OperationalDate";
|
|
59
|
+
};
|
|
60
|
+
feed_end_date: string & {
|
|
61
|
+
__brand: "OperationalDate";
|
|
62
|
+
};
|
|
63
|
+
feed_start_date: string & {
|
|
64
|
+
__brand: "OperationalDate";
|
|
65
|
+
};
|
|
66
|
+
lines_exclude: string[];
|
|
67
|
+
lines_include: string[];
|
|
68
|
+
numeric_calendar_codes: boolean;
|
|
69
|
+
stop_sequence_start: number;
|
|
70
|
+
stops_export_all: boolean;
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
type: "gtfs";
|
|
74
|
+
properties: {
|
|
75
|
+
agency_ids: string[];
|
|
76
|
+
calendars_clip_end_date: string;
|
|
77
|
+
calendars_clip_start_date: string;
|
|
78
|
+
feed_end_date: string;
|
|
79
|
+
feed_start_date: string;
|
|
80
|
+
lines_mode?: "exclude" | "include" | "all" | undefined;
|
|
81
|
+
lines_exclude?: string[] | undefined;
|
|
82
|
+
lines_include?: string[] | undefined;
|
|
83
|
+
numeric_calendar_codes?: boolean | undefined;
|
|
84
|
+
stop_sequence_start?: number | undefined;
|
|
85
|
+
stops_export_all?: boolean | undefined;
|
|
86
|
+
};
|
|
87
|
+
}>;
|
|
88
|
+
export declare const GtfsExportSchema: z.ZodObject<{
|
|
89
|
+
_id: z.ZodString;
|
|
90
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
91
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
93
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
94
|
+
file_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
file_name: z.ZodString;
|
|
96
|
+
processing_status: z.ZodEnum<["waiting", "processing", "complete", "error", "skipped"]>;
|
|
97
|
+
} & {
|
|
98
|
+
properties: z.ZodObject<{
|
|
99
|
+
agency_ids: z.ZodArray<z.ZodString, "many">;
|
|
100
|
+
calendars_clip_end_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
101
|
+
calendars_clip_start_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
102
|
+
feed_end_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
103
|
+
feed_start_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
|
|
104
|
+
lines_exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
105
|
+
lines_include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
106
|
+
lines_mode: z.ZodDefault<z.ZodEnum<["all", "exclude", "include"]>>;
|
|
107
|
+
numeric_calendar_codes: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
stop_sequence_start: z.ZodDefault<z.ZodNumber>;
|
|
109
|
+
stops_export_all: z.ZodDefault<z.ZodBoolean>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
agency_ids: string[];
|
|
112
|
+
lines_mode: "exclude" | "include" | "all";
|
|
113
|
+
calendars_clip_end_date: string & {
|
|
114
|
+
__brand: "OperationalDate";
|
|
115
|
+
};
|
|
116
|
+
calendars_clip_start_date: string & {
|
|
117
|
+
__brand: "OperationalDate";
|
|
118
|
+
};
|
|
119
|
+
feed_end_date: string & {
|
|
120
|
+
__brand: "OperationalDate";
|
|
121
|
+
};
|
|
122
|
+
feed_start_date: string & {
|
|
123
|
+
__brand: "OperationalDate";
|
|
124
|
+
};
|
|
125
|
+
lines_exclude: string[];
|
|
126
|
+
lines_include: string[];
|
|
127
|
+
numeric_calendar_codes: boolean;
|
|
128
|
+
stop_sequence_start: number;
|
|
129
|
+
stops_export_all: boolean;
|
|
130
|
+
}, {
|
|
131
|
+
agency_ids: string[];
|
|
132
|
+
calendars_clip_end_date: string;
|
|
133
|
+
calendars_clip_start_date: string;
|
|
134
|
+
feed_end_date: string;
|
|
135
|
+
feed_start_date: string;
|
|
136
|
+
lines_mode?: "exclude" | "include" | "all" | undefined;
|
|
137
|
+
lines_exclude?: string[] | undefined;
|
|
138
|
+
lines_include?: string[] | undefined;
|
|
139
|
+
numeric_calendar_codes?: boolean | undefined;
|
|
140
|
+
stop_sequence_start?: number | undefined;
|
|
141
|
+
stops_export_all?: boolean | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
type: z.ZodLiteral<"gtfs">;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
_id: string;
|
|
146
|
+
created_at: number & {
|
|
147
|
+
__brand: "UnixTimestamp";
|
|
148
|
+
};
|
|
149
|
+
created_by: string | null;
|
|
150
|
+
updated_at: number & {
|
|
151
|
+
__brand: "UnixTimestamp";
|
|
152
|
+
};
|
|
153
|
+
type: "gtfs";
|
|
154
|
+
file_name: string;
|
|
155
|
+
processing_status: "waiting" | "processing" | "complete" | "error" | "skipped";
|
|
156
|
+
properties: {
|
|
157
|
+
agency_ids: string[];
|
|
158
|
+
lines_mode: "exclude" | "include" | "all";
|
|
159
|
+
calendars_clip_end_date: string & {
|
|
160
|
+
__brand: "OperationalDate";
|
|
161
|
+
};
|
|
162
|
+
calendars_clip_start_date: string & {
|
|
163
|
+
__brand: "OperationalDate";
|
|
164
|
+
};
|
|
165
|
+
feed_end_date: string & {
|
|
166
|
+
__brand: "OperationalDate";
|
|
167
|
+
};
|
|
168
|
+
feed_start_date: string & {
|
|
169
|
+
__brand: "OperationalDate";
|
|
170
|
+
};
|
|
171
|
+
lines_exclude: string[];
|
|
172
|
+
lines_include: string[];
|
|
173
|
+
numeric_calendar_codes: boolean;
|
|
174
|
+
stop_sequence_start: number;
|
|
175
|
+
stops_export_all: boolean;
|
|
176
|
+
};
|
|
177
|
+
updated_by?: string | undefined;
|
|
178
|
+
file_id?: string | null | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
_id: string;
|
|
181
|
+
created_at: number;
|
|
182
|
+
updated_at: number;
|
|
183
|
+
type: "gtfs";
|
|
184
|
+
file_name: string;
|
|
185
|
+
processing_status: "waiting" | "processing" | "complete" | "error" | "skipped";
|
|
186
|
+
properties: {
|
|
187
|
+
agency_ids: string[];
|
|
188
|
+
calendars_clip_end_date: string;
|
|
189
|
+
calendars_clip_start_date: string;
|
|
190
|
+
feed_end_date: string;
|
|
191
|
+
feed_start_date: string;
|
|
192
|
+
lines_mode?: "exclude" | "include" | "all" | undefined;
|
|
193
|
+
lines_exclude?: string[] | undefined;
|
|
194
|
+
lines_include?: string[] | undefined;
|
|
195
|
+
numeric_calendar_codes?: boolean | undefined;
|
|
196
|
+
stop_sequence_start?: number | undefined;
|
|
197
|
+
stops_export_all?: boolean | undefined;
|
|
198
|
+
};
|
|
199
|
+
created_by?: string | null | undefined;
|
|
200
|
+
updated_by?: string | undefined;
|
|
201
|
+
file_id?: string | null | undefined;
|
|
202
|
+
}>;
|
|
203
|
+
export type GtfsExportProperties = z.infer<typeof GtfsExportPropertiesSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { OperationalDateSchema } from '../_common/operational-date.js';
|
|
3
|
+
import { FileExportBaseSchema } from './base.js';
|
|
4
|
+
import { LinesModeSchema } from '../offer/rules.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/* * */
|
|
7
|
+
/* PROPERTIES SCHEMA */
|
|
8
|
+
/* * */
|
|
9
|
+
export const GtfsExportPropertiesSchema = z.object({
|
|
10
|
+
properties: z.object({
|
|
11
|
+
agency_ids: z.array(z.string()),
|
|
12
|
+
calendars_clip_end_date: OperationalDateSchema,
|
|
13
|
+
calendars_clip_start_date: OperationalDateSchema,
|
|
14
|
+
feed_end_date: OperationalDateSchema,
|
|
15
|
+
feed_start_date: OperationalDateSchema,
|
|
16
|
+
lines_exclude: z.array(z.string()).default([]),
|
|
17
|
+
lines_include: z.array(z.string()).default([]),
|
|
18
|
+
lines_mode: LinesModeSchema.default('all'),
|
|
19
|
+
numeric_calendar_codes: z.boolean().default(false),
|
|
20
|
+
stop_sequence_start: z.number().default(1),
|
|
21
|
+
stops_export_all: z.boolean().default(true),
|
|
22
|
+
}),
|
|
23
|
+
type: z.literal('gtfs'),
|
|
24
|
+
});
|
|
25
|
+
/* CREATE SCHEMA */
|
|
26
|
+
/* * */
|
|
27
|
+
export const GtfsExportSchema = FileExportBaseSchema.extend(GtfsExportPropertiesSchema.shape);
|