@updraft-solutions/mcrit-sdk 0.3.0 → 0.4.0
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/{chunk-MF7G76QS.cjs → chunk-IVMOR5SW.cjs} +26 -1
- package/dist/{chunk-D5DUVW34.js → chunk-KIMCBEY7.js} +26 -1
- package/dist/{chunk-S632QB2N.cjs → chunk-RC2BBT6H.cjs} +88 -14
- package/dist/{chunk-4A2CDUAO.js → chunk-WQLDSZNN.js} +87 -13
- package/dist/format/index.cjs +2 -2
- package/dist/format/index.d.cts +13 -4
- package/dist/format/index.d.ts +13 -4
- package/dist/format/index.js +1 -1
- package/dist/index.cjs +9 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -2
- package/dist/{models-DOcMz5Pd.d.cts → models-Bc5BKYuI.d.cts} +6826 -5789
- package/dist/{models-DOcMz5Pd.d.ts → models-Bc5BKYuI.d.ts} +6826 -5789
- package/dist/schemas/index.cjs +8 -2
- package/dist/schemas/index.d.cts +55 -55
- package/dist/schemas/index.d.ts +55 -55
- package/dist/schemas/index.js +7 -1
- package/dist/types/index.d.cts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/package.json +2 -1
- package/src/format/index.ts +51 -5
- package/src/schemas/common.ts +4 -0
- package/src/schemas/models.ts +96 -17
- package/src/types/models.ts +4 -0
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseModel, a as addressSchema, b as aircraftRatingSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, f as airplanePermissionSchema, g as airplaneSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, p as
|
|
1
|
+
export { B as BaseModel, a as addressSchema, b as aircraftRatingSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, f as airplanePermissionSchema, g as airplaneSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, p as bookingWaypointSchema, q as commentSchema, r as companySchema, s as contactAttributeSchema, t as courseCheckSyllabusSchema, u as courseEnrollmentMetricsSchema, v as courseEnrollmentSchema, w as courseFeeSchema, x as courseSchema, y as documentComplianceStatus, z as documentRequirement, A as documentRequirementGroup, C as documentRequirementGroupAssignment, D as documentSchema, E as documentShareSchema, F as documentType, G as eventSchema, H as expenseItemSchema, I as expenseSchema, J as extendedAirplaneSchema, K as feeSchema, L as flightLogSchema, M as invoiceSchema, N as landingFeeSchema, O as landingSchema, P as maintenanceEventEstimationSchema, Q as maintenanceEventSchema, R as maintenanceStatusSchema, S as mediaCollection, T as mediaSchema, U as membershipSchema, V as postSchema, W as prePaidPackageSchema, X as priceSchema, Y as qualificationSchema, Z as recurringFlightSchema, _ as roleSchema, $ as runwaySchema, a0 as scheduledFlightSchema, a1 as settingSchema, a2 as specialFlightSchema, a3 as tagSchema, a4 as ticketSchema, a5 as userAircraftRatingSchema, a6 as userQualificationSchema, a7 as userSchema, a8 as waypointSchema, a9 as zContactDTO, aa as zNetGross, ab as zNullableBool, ac as zPhpMoneyObject } from '../models-Bc5BKYuI.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare enum FaqStatus {
|
|
@@ -29,26 +29,26 @@ declare const FaqSchema: z.ZodObject<{
|
|
|
29
29
|
name: z.ZodString;
|
|
30
30
|
email: z.ZodString;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
id: number;
|
|
33
32
|
name: string;
|
|
34
33
|
email: string;
|
|
35
|
-
}, {
|
|
36
34
|
id: number;
|
|
35
|
+
}, {
|
|
37
36
|
name: string;
|
|
38
37
|
email: string;
|
|
38
|
+
id: number;
|
|
39
39
|
}>>>;
|
|
40
40
|
reviewer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
41
41
|
id: z.ZodNumber;
|
|
42
42
|
name: z.ZodString;
|
|
43
43
|
email: z.ZodString;
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
id: number;
|
|
46
45
|
name: string;
|
|
47
46
|
email: string;
|
|
48
|
-
}, {
|
|
49
47
|
id: number;
|
|
48
|
+
}, {
|
|
50
49
|
name: string;
|
|
51
50
|
email: string;
|
|
51
|
+
id: number;
|
|
52
52
|
}>>>;
|
|
53
53
|
is_pending: z.ZodOptional<z.ZodBoolean>;
|
|
54
54
|
is_user_submitted: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -72,9 +72,9 @@ declare const FaqSchema: z.ZodObject<{
|
|
|
72
72
|
submit?: boolean | undefined;
|
|
73
73
|
}>>;
|
|
74
74
|
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
id: number;
|
|
76
75
|
type: "faq";
|
|
77
76
|
status: "pending" | "approved" | "rejected";
|
|
77
|
+
id: number;
|
|
78
78
|
created_at: string;
|
|
79
79
|
updated_at: string;
|
|
80
80
|
company_id: number | null;
|
|
@@ -97,21 +97,21 @@ declare const FaqSchema: z.ZodObject<{
|
|
|
97
97
|
submit?: boolean | undefined;
|
|
98
98
|
} | undefined;
|
|
99
99
|
submitter?: {
|
|
100
|
-
id: number;
|
|
101
100
|
name: string;
|
|
102
101
|
email: string;
|
|
102
|
+
id: number;
|
|
103
103
|
} | null | undefined;
|
|
104
104
|
reviewer?: {
|
|
105
|
-
id: number;
|
|
106
105
|
name: string;
|
|
107
106
|
email: string;
|
|
107
|
+
id: number;
|
|
108
108
|
} | null | undefined;
|
|
109
109
|
is_pending?: boolean | undefined;
|
|
110
110
|
is_user_submitted?: boolean | undefined;
|
|
111
111
|
}, {
|
|
112
|
-
id: number;
|
|
113
112
|
type: "faq";
|
|
114
113
|
status: "pending" | "approved" | "rejected";
|
|
114
|
+
id: number;
|
|
115
115
|
created_at: string;
|
|
116
116
|
updated_at: string;
|
|
117
117
|
company_id: number | null;
|
|
@@ -134,14 +134,14 @@ declare const FaqSchema: z.ZodObject<{
|
|
|
134
134
|
submit?: boolean | undefined;
|
|
135
135
|
} | undefined;
|
|
136
136
|
submitter?: {
|
|
137
|
-
id: number;
|
|
138
137
|
name: string;
|
|
139
138
|
email: string;
|
|
139
|
+
id: number;
|
|
140
140
|
} | null | undefined;
|
|
141
141
|
reviewer?: {
|
|
142
|
-
id: number;
|
|
143
142
|
name: string;
|
|
144
143
|
email: string;
|
|
144
|
+
id: number;
|
|
145
145
|
} | null | undefined;
|
|
146
146
|
is_pending?: boolean | undefined;
|
|
147
147
|
is_user_submitted?: boolean | undefined;
|
|
@@ -227,16 +227,16 @@ declare const FeeSchema: z.ZodObject<{
|
|
|
227
227
|
}>>;
|
|
228
228
|
}, "strip", z.ZodTypeAny, {
|
|
229
229
|
id: number;
|
|
230
|
-
title: string;
|
|
231
230
|
company_id: number;
|
|
232
231
|
category: string;
|
|
233
|
-
|
|
234
|
-
prices?: any[] | undefined;
|
|
232
|
+
title: string;
|
|
235
233
|
type?: "fee" | undefined;
|
|
236
234
|
can?: {
|
|
237
235
|
update?: boolean | undefined;
|
|
238
236
|
delete?: boolean | undefined;
|
|
239
237
|
} | undefined;
|
|
238
|
+
price?: any;
|
|
239
|
+
prices?: any[] | undefined;
|
|
240
240
|
provider?: string | null | undefined;
|
|
241
241
|
subcategory?: string | null | undefined;
|
|
242
242
|
relation?: ("instructor" | "booking" | "invoice" | "flightlog")[] | null | undefined;
|
|
@@ -245,16 +245,16 @@ declare const FeeSchema: z.ZodObject<{
|
|
|
245
245
|
display_title?: string | undefined;
|
|
246
246
|
}, {
|
|
247
247
|
id: number;
|
|
248
|
-
title: string;
|
|
249
248
|
company_id: number;
|
|
250
249
|
category: string;
|
|
251
|
-
|
|
252
|
-
prices?: any[] | undefined;
|
|
250
|
+
title: string;
|
|
253
251
|
type?: "fee" | undefined;
|
|
254
252
|
can?: {
|
|
255
253
|
update?: boolean | undefined;
|
|
256
254
|
delete?: boolean | undefined;
|
|
257
255
|
} | undefined;
|
|
256
|
+
price?: any;
|
|
257
|
+
prices?: any[] | undefined;
|
|
258
258
|
provider?: string | null | undefined;
|
|
259
259
|
subcategory?: string | null | undefined;
|
|
260
260
|
relation?: ("instructor" | "booking" | "invoice" | "flightlog")[] | null | undefined;
|
|
@@ -288,22 +288,22 @@ declare const SafetyReportCategorySchema: z.ZodObject<{
|
|
|
288
288
|
created_at: z.ZodOptional<z.ZodString>;
|
|
289
289
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
290
290
|
}, "strip", z.ZodTypeAny, {
|
|
291
|
-
sort_order: number;
|
|
292
|
-
id: number;
|
|
293
291
|
name: string;
|
|
292
|
+
id: number;
|
|
294
293
|
description: string | null;
|
|
295
294
|
is_active: boolean;
|
|
296
295
|
color: string;
|
|
296
|
+
sort_order: number;
|
|
297
297
|
created_at?: string | undefined;
|
|
298
298
|
updated_at?: string | undefined;
|
|
299
299
|
is_global?: boolean | undefined;
|
|
300
300
|
}, {
|
|
301
|
-
sort_order: number;
|
|
302
|
-
id: number;
|
|
303
301
|
name: string;
|
|
302
|
+
id: number;
|
|
304
303
|
description: string | null;
|
|
305
304
|
is_active: boolean;
|
|
306
305
|
color: string;
|
|
306
|
+
sort_order: number;
|
|
307
307
|
created_at?: string | undefined;
|
|
308
308
|
updated_at?: string | undefined;
|
|
309
309
|
is_global?: boolean | undefined;
|
|
@@ -317,16 +317,16 @@ declare const SafetyReportCategoryFormSchema: z.ZodObject<{
|
|
|
317
317
|
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
318
318
|
}, "strip", z.ZodTypeAny, {
|
|
319
319
|
name: string;
|
|
320
|
-
sort_order?: number | undefined;
|
|
321
320
|
description?: string | null | undefined;
|
|
322
321
|
is_active?: boolean | undefined;
|
|
323
322
|
color?: string | null | undefined;
|
|
323
|
+
sort_order?: number | undefined;
|
|
324
324
|
}, {
|
|
325
325
|
name: string;
|
|
326
|
-
sort_order?: number | undefined;
|
|
327
326
|
description?: string | null | undefined;
|
|
328
327
|
is_active?: boolean | undefined;
|
|
329
328
|
color?: string | null | undefined;
|
|
329
|
+
sort_order?: number | undefined;
|
|
330
330
|
}>;
|
|
331
331
|
type SafetyReportCategoryForm = z.infer<typeof SafetyReportCategoryFormSchema>;
|
|
332
332
|
declare const SafetyReportMediaSchema: z.ZodObject<{
|
|
@@ -367,22 +367,22 @@ declare const SafetyReportSchema: z.ZodObject<{
|
|
|
367
367
|
created_at: z.ZodOptional<z.ZodString>;
|
|
368
368
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
369
369
|
}, "strip", z.ZodTypeAny, {
|
|
370
|
-
sort_order: number;
|
|
371
|
-
id: number;
|
|
372
370
|
name: string;
|
|
371
|
+
id: number;
|
|
373
372
|
description: string | null;
|
|
374
373
|
is_active: boolean;
|
|
375
374
|
color: string;
|
|
375
|
+
sort_order: number;
|
|
376
376
|
created_at?: string | undefined;
|
|
377
377
|
updated_at?: string | undefined;
|
|
378
378
|
is_global?: boolean | undefined;
|
|
379
379
|
}, {
|
|
380
|
-
sort_order: number;
|
|
381
|
-
id: number;
|
|
382
380
|
name: string;
|
|
381
|
+
id: number;
|
|
383
382
|
description: string | null;
|
|
384
383
|
is_active: boolean;
|
|
385
384
|
color: string;
|
|
385
|
+
sort_order: number;
|
|
386
386
|
created_at?: string | undefined;
|
|
387
387
|
updated_at?: string | undefined;
|
|
388
388
|
is_global?: boolean | undefined;
|
|
@@ -411,22 +411,22 @@ declare const SafetyReportSchema: z.ZodObject<{
|
|
|
411
411
|
updated_at: z.ZodString;
|
|
412
412
|
can: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
413
413
|
}, "strip", z.ZodTypeAny, {
|
|
414
|
-
id: number;
|
|
415
414
|
status: "new" | "under_review" | "action_taken" | "closed";
|
|
415
|
+
id: number;
|
|
416
416
|
created_at: string;
|
|
417
417
|
updated_at: string;
|
|
418
418
|
description: string;
|
|
419
|
+
is_archived: boolean;
|
|
419
420
|
location: string | null;
|
|
420
421
|
incident_date: string;
|
|
421
|
-
is_archived: boolean;
|
|
422
422
|
can?: Record<string, boolean> | undefined;
|
|
423
423
|
category?: {
|
|
424
|
-
sort_order: number;
|
|
425
|
-
id: number;
|
|
426
424
|
name: string;
|
|
425
|
+
id: number;
|
|
427
426
|
description: string | null;
|
|
428
427
|
is_active: boolean;
|
|
429
428
|
color: string;
|
|
429
|
+
sort_order: number;
|
|
430
430
|
created_at?: string | undefined;
|
|
431
431
|
updated_at?: string | undefined;
|
|
432
432
|
is_global?: boolean | undefined;
|
|
@@ -440,22 +440,22 @@ declare const SafetyReportSchema: z.ZodObject<{
|
|
|
440
440
|
}[] | undefined;
|
|
441
441
|
attachments_count?: number | undefined;
|
|
442
442
|
}, {
|
|
443
|
-
id: number;
|
|
444
443
|
status: "new" | "under_review" | "action_taken" | "closed";
|
|
444
|
+
id: number;
|
|
445
445
|
created_at: string;
|
|
446
446
|
updated_at: string;
|
|
447
447
|
description: string;
|
|
448
|
+
is_archived: boolean;
|
|
448
449
|
location: string | null;
|
|
449
450
|
incident_date: string;
|
|
450
|
-
is_archived: boolean;
|
|
451
451
|
can?: Record<string, boolean> | undefined;
|
|
452
452
|
category?: {
|
|
453
|
-
sort_order: number;
|
|
454
|
-
id: number;
|
|
455
453
|
name: string;
|
|
454
|
+
id: number;
|
|
456
455
|
description: string | null;
|
|
457
456
|
is_active: boolean;
|
|
458
457
|
color: string;
|
|
458
|
+
sort_order: number;
|
|
459
459
|
created_at?: string | undefined;
|
|
460
460
|
updated_at?: string | undefined;
|
|
461
461
|
is_global?: boolean | undefined;
|
|
@@ -489,22 +489,22 @@ declare const SafetyReportListResponseSchema: z.ZodObject<{
|
|
|
489
489
|
created_at: z.ZodOptional<z.ZodString>;
|
|
490
490
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
491
491
|
}, "strip", z.ZodTypeAny, {
|
|
492
|
-
sort_order: number;
|
|
493
|
-
id: number;
|
|
494
492
|
name: string;
|
|
493
|
+
id: number;
|
|
495
494
|
description: string | null;
|
|
496
495
|
is_active: boolean;
|
|
497
496
|
color: string;
|
|
497
|
+
sort_order: number;
|
|
498
498
|
created_at?: string | undefined;
|
|
499
499
|
updated_at?: string | undefined;
|
|
500
500
|
is_global?: boolean | undefined;
|
|
501
501
|
}, {
|
|
502
|
-
sort_order: number;
|
|
503
|
-
id: number;
|
|
504
502
|
name: string;
|
|
503
|
+
id: number;
|
|
505
504
|
description: string | null;
|
|
506
505
|
is_active: boolean;
|
|
507
506
|
color: string;
|
|
507
|
+
sort_order: number;
|
|
508
508
|
created_at?: string | undefined;
|
|
509
509
|
updated_at?: string | undefined;
|
|
510
510
|
is_global?: boolean | undefined;
|
|
@@ -533,22 +533,22 @@ declare const SafetyReportListResponseSchema: z.ZodObject<{
|
|
|
533
533
|
updated_at: z.ZodString;
|
|
534
534
|
can: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
535
535
|
}, "strip", z.ZodTypeAny, {
|
|
536
|
-
id: number;
|
|
537
536
|
status: "new" | "under_review" | "action_taken" | "closed";
|
|
537
|
+
id: number;
|
|
538
538
|
created_at: string;
|
|
539
539
|
updated_at: string;
|
|
540
540
|
description: string;
|
|
541
|
+
is_archived: boolean;
|
|
541
542
|
location: string | null;
|
|
542
543
|
incident_date: string;
|
|
543
|
-
is_archived: boolean;
|
|
544
544
|
can?: Record<string, boolean> | undefined;
|
|
545
545
|
category?: {
|
|
546
|
-
sort_order: number;
|
|
547
|
-
id: number;
|
|
548
546
|
name: string;
|
|
547
|
+
id: number;
|
|
549
548
|
description: string | null;
|
|
550
549
|
is_active: boolean;
|
|
551
550
|
color: string;
|
|
551
|
+
sort_order: number;
|
|
552
552
|
created_at?: string | undefined;
|
|
553
553
|
updated_at?: string | undefined;
|
|
554
554
|
is_global?: boolean | undefined;
|
|
@@ -562,22 +562,22 @@ declare const SafetyReportListResponseSchema: z.ZodObject<{
|
|
|
562
562
|
}[] | undefined;
|
|
563
563
|
attachments_count?: number | undefined;
|
|
564
564
|
}, {
|
|
565
|
-
id: number;
|
|
566
565
|
status: "new" | "under_review" | "action_taken" | "closed";
|
|
566
|
+
id: number;
|
|
567
567
|
created_at: string;
|
|
568
568
|
updated_at: string;
|
|
569
569
|
description: string;
|
|
570
|
+
is_archived: boolean;
|
|
570
571
|
location: string | null;
|
|
571
572
|
incident_date: string;
|
|
572
|
-
is_archived: boolean;
|
|
573
573
|
can?: Record<string, boolean> | undefined;
|
|
574
574
|
category?: {
|
|
575
|
-
sort_order: number;
|
|
576
|
-
id: number;
|
|
577
575
|
name: string;
|
|
576
|
+
id: number;
|
|
578
577
|
description: string | null;
|
|
579
578
|
is_active: boolean;
|
|
580
579
|
color: string;
|
|
580
|
+
sort_order: number;
|
|
581
581
|
created_at?: string | undefined;
|
|
582
582
|
updated_at?: string | undefined;
|
|
583
583
|
is_global?: boolean | undefined;
|
|
@@ -631,22 +631,22 @@ declare const SafetyReportListResponseSchema: z.ZodObject<{
|
|
|
631
631
|
}>>;
|
|
632
632
|
}, "strip", z.ZodTypeAny, {
|
|
633
633
|
data: {
|
|
634
|
-
id: number;
|
|
635
634
|
status: "new" | "under_review" | "action_taken" | "closed";
|
|
635
|
+
id: number;
|
|
636
636
|
created_at: string;
|
|
637
637
|
updated_at: string;
|
|
638
638
|
description: string;
|
|
639
|
+
is_archived: boolean;
|
|
639
640
|
location: string | null;
|
|
640
641
|
incident_date: string;
|
|
641
|
-
is_archived: boolean;
|
|
642
642
|
can?: Record<string, boolean> | undefined;
|
|
643
643
|
category?: {
|
|
644
|
-
sort_order: number;
|
|
645
|
-
id: number;
|
|
646
644
|
name: string;
|
|
645
|
+
id: number;
|
|
647
646
|
description: string | null;
|
|
648
647
|
is_active: boolean;
|
|
649
648
|
color: string;
|
|
649
|
+
sort_order: number;
|
|
650
650
|
created_at?: string | undefined;
|
|
651
651
|
updated_at?: string | undefined;
|
|
652
652
|
is_global?: boolean | undefined;
|
|
@@ -676,22 +676,22 @@ declare const SafetyReportListResponseSchema: z.ZodObject<{
|
|
|
676
676
|
} | undefined;
|
|
677
677
|
}, {
|
|
678
678
|
data: {
|
|
679
|
-
id: number;
|
|
680
679
|
status: "new" | "under_review" | "action_taken" | "closed";
|
|
680
|
+
id: number;
|
|
681
681
|
created_at: string;
|
|
682
682
|
updated_at: string;
|
|
683
683
|
description: string;
|
|
684
|
+
is_archived: boolean;
|
|
684
685
|
location: string | null;
|
|
685
686
|
incident_date: string;
|
|
686
|
-
is_archived: boolean;
|
|
687
687
|
can?: Record<string, boolean> | undefined;
|
|
688
688
|
category?: {
|
|
689
|
-
sort_order: number;
|
|
690
|
-
id: number;
|
|
691
689
|
name: string;
|
|
690
|
+
id: number;
|
|
692
691
|
description: string | null;
|
|
693
692
|
is_active: boolean;
|
|
694
693
|
color: string;
|
|
694
|
+
sort_order: number;
|
|
695
695
|
created_at?: string | undefined;
|
|
696
696
|
updated_at?: string | undefined;
|
|
697
697
|
is_global?: boolean | undefined;
|
package/dist/schemas/index.js
CHANGED
|
@@ -33,9 +33,11 @@ import {
|
|
|
33
33
|
availSchema,
|
|
34
34
|
baseMembershipSchema,
|
|
35
35
|
bookingSchema,
|
|
36
|
+
bookingWaypointSchema,
|
|
36
37
|
commentSchema,
|
|
37
38
|
companySchema,
|
|
38
39
|
contactAttributeSchema,
|
|
40
|
+
courseCheckSyllabusSchema,
|
|
39
41
|
courseEnrollmentMetricsSchema,
|
|
40
42
|
courseEnrollmentSchema,
|
|
41
43
|
courseFeeSchema,
|
|
@@ -72,6 +74,7 @@ import {
|
|
|
72
74
|
scheduledFlightSchema,
|
|
73
75
|
settingSchema,
|
|
74
76
|
specialFlightSchema,
|
|
77
|
+
tagSchema,
|
|
75
78
|
ticketSchema,
|
|
76
79
|
userAircraftRatingSchema,
|
|
77
80
|
userQualificationSchema,
|
|
@@ -81,7 +84,7 @@ import {
|
|
|
81
84
|
zNetGross,
|
|
82
85
|
zNullableBool,
|
|
83
86
|
zPhpMoneyObject
|
|
84
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-WQLDSZNN.js";
|
|
85
88
|
export {
|
|
86
89
|
BaseModel,
|
|
87
90
|
FaqSchema,
|
|
@@ -117,9 +120,11 @@ export {
|
|
|
117
120
|
availSchema,
|
|
118
121
|
baseMembershipSchema,
|
|
119
122
|
bookingSchema,
|
|
123
|
+
bookingWaypointSchema,
|
|
120
124
|
commentSchema,
|
|
121
125
|
companySchema,
|
|
122
126
|
contactAttributeSchema,
|
|
127
|
+
courseCheckSyllabusSchema,
|
|
123
128
|
courseEnrollmentMetricsSchema,
|
|
124
129
|
courseEnrollmentSchema,
|
|
125
130
|
courseFeeSchema,
|
|
@@ -156,6 +161,7 @@ export {
|
|
|
156
161
|
scheduledFlightSchema,
|
|
157
162
|
settingSchema,
|
|
158
163
|
specialFlightSchema,
|
|
164
|
+
tagSchema,
|
|
159
165
|
ticketSchema,
|
|
160
166
|
userAircraftRatingSchema,
|
|
161
167
|
userQualificationSchema,
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as addressSchema, b as aircraftRatingSchema, g as airplaneSchema, f as airplanePermissionSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema,
|
|
2
|
+
import { a as addressSchema, b as aircraftRatingSchema, g as airplaneSchema, f as airplanePermissionSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, q as commentSchema, r as companySchema, x as courseSchema, v as courseEnrollmentSchema, w as courseFeeSchema, D as documentSchema, y as documentComplianceStatus, z as documentRequirement, A as documentRequirementGroup, C as documentRequirementGroupAssignment, E as documentShareSchema, F as documentType, G as eventSchema, I as expenseSchema, H as expenseItemSchema, J as extendedAirplaneSchema, L as flightLogSchema, M as invoiceSchema, O as landingSchema, N as landingFeeSchema, Q as maintenanceEventSchema, P as maintenanceEventEstimationSchema, R as maintenanceStatusSchema, S as mediaCollection, U as membershipSchema, V as postSchema, W as prePaidPackageSchema, X as priceSchema, Y as qualificationSchema, Z as recurringFlightSchema, _ as roleSchema, $ as runwaySchema, a0 as scheduledFlightSchema, a1 as settingSchema, a2 as specialFlightSchema, a4 as ticketSchema, a7 as userSchema, a5 as userAircraftRatingSchema, a6 as userQualificationSchema, a8 as waypointSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, B as BaseModel$1, t as courseCheckSyllabusSchema, u as courseEnrollmentMetricsSchema, K as feeSchema, T as mediaSchema, a3 as tagSchema } from '../models-Bc5BKYuI.cjs';
|
|
3
3
|
|
|
4
4
|
type BaseModel = z.infer<typeof BaseModel$1>;
|
|
5
5
|
type User = z.infer<typeof userSchema>;
|
|
@@ -20,6 +20,8 @@ type Airport = z.infer<typeof airportSchema>;
|
|
|
20
20
|
type RecurringFlight = z.infer<typeof recurringFlightSchema>;
|
|
21
21
|
type Fee = z.infer<typeof feeSchema>;
|
|
22
22
|
type CourseFee = z.infer<typeof courseFeeSchema>;
|
|
23
|
+
type Tag = z.infer<typeof tagSchema>;
|
|
24
|
+
type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
|
|
23
25
|
type Price = z.infer<typeof priceSchema>;
|
|
24
26
|
type MaintenanceEvent = z.infer<typeof maintenanceEventSchema>;
|
|
25
27
|
type MaintenanceStatus = z.infer<typeof maintenanceStatusSchema>;
|
|
@@ -145,4 +147,4 @@ interface ComplianceResponse {
|
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
export type { Address, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
|
150
|
+
export type { Address, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseCheckSyllabus, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Tag, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as addressSchema, b as aircraftRatingSchema, g as airplaneSchema, f as airplanePermissionSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema,
|
|
2
|
+
import { a as addressSchema, b as aircraftRatingSchema, g as airplaneSchema, f as airplanePermissionSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, q as commentSchema, r as companySchema, x as courseSchema, v as courseEnrollmentSchema, w as courseFeeSchema, D as documentSchema, y as documentComplianceStatus, z as documentRequirement, A as documentRequirementGroup, C as documentRequirementGroupAssignment, E as documentShareSchema, F as documentType, G as eventSchema, I as expenseSchema, H as expenseItemSchema, J as extendedAirplaneSchema, L as flightLogSchema, M as invoiceSchema, O as landingSchema, N as landingFeeSchema, Q as maintenanceEventSchema, P as maintenanceEventEstimationSchema, R as maintenanceStatusSchema, S as mediaCollection, U as membershipSchema, V as postSchema, W as prePaidPackageSchema, X as priceSchema, Y as qualificationSchema, Z as recurringFlightSchema, _ as roleSchema, $ as runwaySchema, a0 as scheduledFlightSchema, a1 as settingSchema, a2 as specialFlightSchema, a4 as ticketSchema, a7 as userSchema, a5 as userAircraftRatingSchema, a6 as userQualificationSchema, a8 as waypointSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, B as BaseModel$1, t as courseCheckSyllabusSchema, u as courseEnrollmentMetricsSchema, K as feeSchema, T as mediaSchema, a3 as tagSchema } from '../models-Bc5BKYuI.js';
|
|
3
3
|
|
|
4
4
|
type BaseModel = z.infer<typeof BaseModel$1>;
|
|
5
5
|
type User = z.infer<typeof userSchema>;
|
|
@@ -20,6 +20,8 @@ type Airport = z.infer<typeof airportSchema>;
|
|
|
20
20
|
type RecurringFlight = z.infer<typeof recurringFlightSchema>;
|
|
21
21
|
type Fee = z.infer<typeof feeSchema>;
|
|
22
22
|
type CourseFee = z.infer<typeof courseFeeSchema>;
|
|
23
|
+
type Tag = z.infer<typeof tagSchema>;
|
|
24
|
+
type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
|
|
23
25
|
type Price = z.infer<typeof priceSchema>;
|
|
24
26
|
type MaintenanceEvent = z.infer<typeof maintenanceEventSchema>;
|
|
25
27
|
type MaintenanceStatus = z.infer<typeof maintenanceStatusSchema>;
|
|
@@ -145,4 +147,4 @@ interface ComplianceResponse {
|
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
export type { Address, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
|
150
|
+
export type { Address, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseCheckSyllabus, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Tag, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updraft-solutions/mcrit-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Shared TypeScript types, Zod schemas, and pure helpers for the MCRIT aviation fleet management platform",
|
|
5
5
|
"homepage": "https://github.com/updraft-solutions/mcrit-sdk#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
"README.md"
|
|
135
135
|
],
|
|
136
136
|
"scripts": {
|
|
137
|
+
"release": "node scripts/release.js",
|
|
137
138
|
"build": "tsup",
|
|
138
139
|
"dev": "tsup --watch",
|
|
139
140
|
"typecheck": "tsc --noEmit",
|
package/src/format/index.ts
CHANGED
|
@@ -3,10 +3,11 @@ import moment from "moment-timezone";
|
|
|
3
3
|
const DEFAULT_TZ = "UTC";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Locale note: `timeUntil` uses `Intl.RelativeTimeFormat` — natively
|
|
7
|
+
* localized, no moment locale files required. The moment-based formatters
|
|
8
|
+
* below are locale-INdependent except for the `MMM` token
|
|
9
|
+
* (`DATE_FORMATS.MONTH_SHORT`), which renders English month abbreviations
|
|
10
|
+
* unless a consumer registers moment locale data itself.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
/** Predefined moment format strings, frozen so callers can reference them safely. */
|
|
@@ -195,6 +196,25 @@ export function timeString(
|
|
|
195
196
|
return formatted;
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
const RELATIVE_TIME_UNITS: Array<{
|
|
200
|
+
unit: Intl.RelativeTimeFormatUnit;
|
|
201
|
+
ms: number;
|
|
202
|
+
}> = [
|
|
203
|
+
{ unit: "year", ms: 365 * 24 * 60 * 60 * 1000 },
|
|
204
|
+
{ unit: "month", ms: 30 * 24 * 60 * 60 * 1000 },
|
|
205
|
+
{ unit: "day", ms: 24 * 60 * 60 * 1000 },
|
|
206
|
+
{ unit: "hour", ms: 60 * 60 * 1000 },
|
|
207
|
+
{ unit: "minute", ms: 60 * 1000 },
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Relative time ("vor 3 Tagen" / "in 2 Stunden") via the browser-native
|
|
212
|
+
* `Intl.RelativeTimeFormat` — fully localized for any BCP 47 locale with
|
|
213
|
+
* zero locale files, and immune to the moment CJS/ESM dual-instance
|
|
214
|
+
* locale-registry pitfall that used to silently produce English output.
|
|
215
|
+
* `numeric: "auto"` yields natural wording for adjacent days
|
|
216
|
+
* ("gestern" / "morgen").
|
|
217
|
+
*/
|
|
198
218
|
export function timeUntil(
|
|
199
219
|
dateTime: string | Date | null | undefined,
|
|
200
220
|
locale: string = "de",
|
|
@@ -202,7 +222,33 @@ export function timeUntil(
|
|
|
202
222
|
if (!dateTime) {
|
|
203
223
|
return "";
|
|
204
224
|
}
|
|
205
|
-
|
|
225
|
+
const target =
|
|
226
|
+
dateTime instanceof Date ? dateTime.getTime() : Date.parse(dateTime);
|
|
227
|
+
if (Number.isNaN(target)) {
|
|
228
|
+
return "";
|
|
229
|
+
}
|
|
230
|
+
const diff = target - Date.now();
|
|
231
|
+
|
|
232
|
+
// A structurally valid but unsupported tag doesn't throw — it silently
|
|
233
|
+
// uses the system default. Check actual support so unknown locales land
|
|
234
|
+
// on the SDK default (de) deterministically; malformed tags throw and
|
|
235
|
+
// take the same path.
|
|
236
|
+
let resolved = "de";
|
|
237
|
+
try {
|
|
238
|
+
if (Intl.RelativeTimeFormat.supportedLocalesOf(locale).length > 0) {
|
|
239
|
+
resolved = locale;
|
|
240
|
+
}
|
|
241
|
+
} catch {
|
|
242
|
+
// malformed tag — keep the default
|
|
243
|
+
}
|
|
244
|
+
const formatter = new Intl.RelativeTimeFormat(resolved, { numeric: "auto" });
|
|
245
|
+
|
|
246
|
+
for (const { unit, ms } of RELATIVE_TIME_UNITS) {
|
|
247
|
+
if (Math.abs(diff) >= ms) {
|
|
248
|
+
return formatter.format(Math.round(diff / ms), unit);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return formatter.format(Math.round(diff / 1000), "second");
|
|
206
252
|
}
|
|
207
253
|
|
|
208
254
|
export function minutesFormatted(minutes: number | null | undefined): string {
|
package/src/schemas/common.ts
CHANGED
|
@@ -72,5 +72,9 @@ export const companySchema = z.object({
|
|
|
72
72
|
media: mediaCollection,
|
|
73
73
|
can: z.record(z.string(), z.boolean().nullable()).optional(),
|
|
74
74
|
permissions: z.array(z.string()).optional(),
|
|
75
|
+
// Company display timezone (companies.timezone, default Europe/Berlin
|
|
76
|
+
// server-side); booking/event surfaces render in this zone. Optional:
|
|
77
|
+
// slim company payloads may omit it.
|
|
78
|
+
timezone: z.string().optional(),
|
|
75
79
|
ai_landing_fee_invoices_enabled: z.boolean().optional(),
|
|
76
80
|
});
|