@updraft-solutions/mcrit-sdk 0.12.0 → 0.13.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-T7J6XEV7.cjs → chunk-OPJ4YGN2.cjs} +108 -1
- package/dist/{chunk-Q73PQFAM.js → chunk-SW6VWDVT.js} +108 -1
- package/dist/{training-B5bsRTKy.d.cts → fbo-yr7LUerk.d.cts} +18591 -17916
- package/dist/{training-B5bsRTKy.d.ts → fbo-yr7LUerk.d.ts} +18591 -17916
- package/dist/index.cjs +31 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +33 -7
- package/dist/operating-hours-CRZMz4E5.d.cts +574 -0
- package/dist/operating-hours-DqN2V6Jq.d.ts +574 -0
- package/dist/schemas/index.cjs +28 -2
- package/dist/schemas/index.d.cts +121 -121
- package/dist/schemas/index.d.ts +121 -121
- package/dist/schemas/index.js +27 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +18 -573
- package/dist/types/index.d.ts +18 -573
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/src/schemas/fbo.spec.ts +49 -0
- package/src/schemas/fbo.ts +126 -0
- package/src/schemas/index.ts +1 -0
- package/src/types/fbo.ts +16 -0
- package/src/types/index.ts +1 -0
- /package/dist/{chunk-UV5JLKAL.js → chunk-ASPK4M5R.js} +0 -0
- /package/dist/{chunk-YVC6Q3YU.cjs → chunk-CJHCF4FW.cjs} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,574 +1,19 @@
|
|
|
1
|
+
export { A as Activity, a as Address, b as AiSuggestedMilestone, c as AiSuggestion, d as AiSuggestionStatus, e as AircraftBlock, f as AircraftBlockReason, g as AircraftPosition, h as AircraftRating, i as Airplane, b0 as AirplaneIssue, b1 as AirplaneIssueSeverity, b2 as AirplaneIssueStatus, j as AirplanePermission, k as AirplaneShareInvite, l as Airport, m as Alert, n as AllowedDocumentType, o as ApiResponse, p as ApproachType, q as Avail, B as BackgroundTask, r as BackgroundTaskStatus, s as BaseMembership, b3 as BaseModel, t as Booking, C as Comment, u as Company, v as ComplianceData, w as ComplianceGroup, x as ComplianceGroupSource, y as ComplianceRequirement, z as ComplianceRequirementGroup, D as ComplianceResponse, E as ComplianceSummary, F as Course, b4 as CourseCheckSyllabus, G as CourseDescriptionSuggestionPayload, H as CourseEnrollment, b5 as CourseEnrollmentMetrics, I as CourseFee, J as CreateAirplaneIssueInput, K as CreateCommentInput, L as CreatePostInput, M as DataWrappedResponse, N as DeferAirplaneIssueInput, O as DiscardedRow, P as Document, Q as DocumentComplianceStatus, R as DocumentRequirement, S as DocumentRequirementGroup, T as DocumentRequirementGroupAssignment, U as DocumentShare, V as DocumentType, W as Event, X as Expense, Y as ExpenseItem, Z as ExtendedAirplane, _ as Fee, $ as FeeCategoryOptions, a0 as FlightLog, a1 as GroupedPermissions, a2 as Invoice, a3 as Landing, a4 as LandingFee, a5 as LandingFeeImportResult, a6 as LandingFeeInvoiceApplyPayload, a7 as LandingFeeInvoiceApplyResult, a8 as LandingFeeInvoicePreview, a9 as LandingFeeInvoicePreviewRow, aa as LandingFeeTemplateParams, ab as LogbookFlightLogPayload, ac as LogbookStageResult, ad as LogbookSuggestion, ae as LogbookSuggestionMeta, af as MaintenanceEvent, ag as MaintenanceEventEstimation, ah as MaintenanceStatus, b6 as Media, ai as MediaCollection, aj as Membership, ak as MembershipSignup, al as OperatingHourDay, am as OperatingHourException, an as OperatingHourExceptionInput, ao as OperatingHourInterval, ap as OperatingHourKind, aq as OperatingHourResolvedDate, ar as OperatingHourSchedule, as as OperatingHourScheduleInput, at as OperatingHourStatusEntry, au as OperatingHourWindow, av as OperatingHoursMeta, aw as OperatingHoursNextOpenEntry, ax as OperatingHoursNextOpenResponse, ay as OperatingHoursStatusResponse, az as OperatingStatusValue, aA as PaginatedResponse, aB as PermissionItem, aC as Post, aD as PostSubject, aE as PrePaidPackage, aF as Price, aG as Qualification, aH as RecurringFlight, aI as ResolveAirplaneIssueInput, aJ as Resource, aK as Role, aL as RoleDetail, aM as RoleListItem, aN as Runway, aO as ScheduledFlight, aP as Setting, aQ as SpecialFlight, aR as Tag, b7 as TagSyncEntry, aS as Ticket, aT as TimeAnchor, aU as ToggleFavoriteResponse, aV as UpdateAirplaneIssueInput, aW as UpdateCommentInput, aX as UpdatePostInput, aY as User, aZ as UserAircraftRating, a_ as UserQualification, a$ as Waypoint } from '../operating-hours-DqN2V6Jq.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
type
|
|
12
|
-
type
|
|
13
|
-
type
|
|
14
|
-
type
|
|
15
|
-
type
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
type
|
|
19
|
-
type Airport = z.infer<typeof airportSchema>;
|
|
20
|
-
type RecurringFlight = z.infer<typeof recurringFlightSchema>;
|
|
21
|
-
type Fee = z.infer<typeof feeSchema>;
|
|
22
|
-
type CourseFee = z.infer<typeof courseFeeSchema>;
|
|
23
|
-
type FeeCategoryOptions = z.infer<typeof feeCategoryOptionsSchema>;
|
|
24
|
-
type Tag = z.infer<typeof tagSchema>;
|
|
25
|
-
type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
|
|
26
|
-
type Price = z.infer<typeof priceSchema>;
|
|
27
|
-
type MaintenanceEvent = z.infer<typeof maintenanceEventSchema>;
|
|
28
|
-
type MaintenanceStatus = z.infer<typeof maintenanceStatusSchema>;
|
|
29
|
-
type MaintenanceEventEstimation = z.infer<typeof maintenanceEventEstimationSchema>;
|
|
30
|
-
type Activity = z.infer<typeof activitySchema>;
|
|
31
|
-
type MembershipSignup = z.infer<typeof membershipSignupSchema>;
|
|
32
|
-
type AircraftPosition = z.infer<typeof aircraftPositionSchema>;
|
|
33
|
-
type Avail = z.infer<typeof availSchema>;
|
|
34
|
-
type Alert = z.infer<typeof alertSchema>;
|
|
35
|
-
type Booking = z.infer<typeof bookingSchema>;
|
|
36
|
-
type Document = z.infer<typeof documentSchema>;
|
|
37
|
-
type DocumentType = z.infer<typeof documentType>;
|
|
38
|
-
type DocumentRequirement = z.infer<typeof documentRequirement>;
|
|
39
|
-
type DocumentRequirementGroup = z.infer<typeof documentRequirementGroup>;
|
|
40
|
-
type DocumentRequirementGroupAssignment = z.infer<typeof documentRequirementGroupAssignment>;
|
|
41
|
-
type DocumentComplianceStatus = z.infer<typeof documentComplianceStatus>;
|
|
42
|
-
type DocumentShare = z.infer<typeof documentShareSchema>;
|
|
43
|
-
type AllowedDocumentType = z.infer<typeof allowedDocumentTypeSchema>;
|
|
44
|
-
type FlightLog = z.infer<typeof flightLogSchema>;
|
|
45
|
-
type ScheduledFlight = z.infer<typeof scheduledFlightSchema>;
|
|
46
|
-
type Landing = z.infer<typeof landingSchema>;
|
|
47
|
-
type ApproachType = z.infer<typeof approachTypeSchema>;
|
|
48
|
-
type Waypoint = z.infer<typeof waypointSchema>;
|
|
49
|
-
type Invoice = z.infer<typeof invoiceSchema>;
|
|
50
|
-
type Expense = z.infer<typeof expenseSchema>;
|
|
51
|
-
type ExpenseItem = z.infer<typeof expenseItemSchema>;
|
|
52
|
-
type SpecialFlight = z.infer<typeof specialFlightSchema>;
|
|
53
|
-
type PrePaidPackage = z.infer<typeof prePaidPackageSchema>;
|
|
54
|
-
type Qualification = z.infer<typeof qualificationSchema>;
|
|
55
|
-
type Course = z.infer<typeof courseSchema>;
|
|
56
|
-
type CourseEnrollment = z.infer<typeof courseEnrollmentSchema>;
|
|
57
|
-
type CourseEnrollmentMetrics = z.infer<typeof courseEnrollmentMetricsSchema>;
|
|
58
|
-
type AirplaneIssue = z.infer<typeof airplaneIssueSchema>;
|
|
59
|
-
type AirplaneIssueSeverity = z.infer<typeof airplaneIssueSeverityEnum>;
|
|
60
|
-
type AirplaneIssueStatus = z.infer<typeof airplaneIssueStatusEnum>;
|
|
61
|
-
type Event = z.infer<typeof eventSchema>;
|
|
62
|
-
type Ticket = z.infer<typeof ticketSchema>;
|
|
63
|
-
type Post = z.infer<typeof postSchema>;
|
|
64
|
-
type PostSubject = z.infer<typeof postSubjectSchema>;
|
|
65
|
-
/**
|
|
66
|
-
* Full-replacement tag sync entry — `id` marks an existing tag (wins over
|
|
67
|
-
* name matching), fresh tags carry only name (+ optional color) and are
|
|
68
|
-
* created server-side on save.
|
|
69
|
-
*/
|
|
70
|
-
interface TagSyncEntry {
|
|
71
|
-
id?: number | null;
|
|
72
|
-
name: string;
|
|
73
|
-
color?: string | null;
|
|
74
|
-
}
|
|
75
|
-
interface CreatePostInput {
|
|
76
|
-
title?: string | null;
|
|
77
|
-
content: string;
|
|
78
|
-
sticky?: boolean;
|
|
79
|
-
public?: boolean;
|
|
80
|
-
comments_disabled?: boolean;
|
|
81
|
-
tags?: TagSyncEntry[];
|
|
82
|
-
/** Action flag, not persisted: notify company members on publish. */
|
|
83
|
-
notify?: boolean;
|
|
84
|
-
}
|
|
85
|
-
interface UpdatePostInput {
|
|
86
|
-
title?: string | null;
|
|
87
|
-
content: string;
|
|
88
|
-
sticky?: boolean;
|
|
89
|
-
public?: boolean;
|
|
90
|
-
comments_disabled?: boolean;
|
|
91
|
-
tags?: TagSyncEntry[];
|
|
92
|
-
}
|
|
93
|
-
interface CreateAirplaneIssueInput {
|
|
94
|
-
title?: string | null;
|
|
95
|
-
body: string;
|
|
96
|
-
severity?: AirplaneIssueSeverity;
|
|
97
|
-
ata_chapter?: string | null;
|
|
98
|
-
}
|
|
99
|
-
interface UpdateAirplaneIssueInput {
|
|
100
|
-
title?: string | null;
|
|
101
|
-
body?: string;
|
|
102
|
-
severity?: AirplaneIssueSeverity;
|
|
103
|
-
ata_chapter?: string | null;
|
|
104
|
-
}
|
|
105
|
-
interface ResolveAirplaneIssueInput {
|
|
106
|
-
resolution_notes?: string | null;
|
|
107
|
-
}
|
|
108
|
-
interface DeferAirplaneIssueInput {
|
|
109
|
-
deferred_until?: string | null;
|
|
110
|
-
deferral_notes?: string | null;
|
|
111
|
-
}
|
|
112
|
-
type Comment = z.infer<typeof commentSchema>;
|
|
113
|
-
interface CreateCommentInput {
|
|
114
|
-
body: string;
|
|
115
|
-
parent_id?: number;
|
|
116
|
-
title?: string;
|
|
117
|
-
}
|
|
118
|
-
interface UpdateCommentInput {
|
|
119
|
-
body?: string;
|
|
120
|
-
title?: string;
|
|
121
|
-
}
|
|
122
|
-
type Address = z.infer<typeof addressSchema>;
|
|
123
|
-
type Runway = z.infer<typeof runwaySchema>;
|
|
124
|
-
type Role = z.infer<typeof roleSchema>;
|
|
125
|
-
type Setting = z.infer<typeof settingSchema>;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Generic response wrapper for data with optional metadata
|
|
129
|
-
* @template T - The data type
|
|
130
|
-
* @template M - The metadata type (optional)
|
|
131
|
-
*/
|
|
132
|
-
interface DataWrappedResponse<T, M = undefined> {
|
|
133
|
-
data: T;
|
|
134
|
-
meta?: M;
|
|
135
|
-
}
|
|
136
|
-
type ApiResponse<T> = DataWrappedResponse<T>;
|
|
137
|
-
interface PaginatedResponse<T = unknown> {
|
|
138
|
-
data: T[];
|
|
139
|
-
meta: {
|
|
140
|
-
current_page: number;
|
|
141
|
-
from: number;
|
|
142
|
-
last_page: number;
|
|
143
|
-
per_page: number;
|
|
144
|
-
to: number;
|
|
145
|
-
total: number;
|
|
146
|
-
};
|
|
147
|
-
links?: {
|
|
148
|
-
first?: string | null;
|
|
149
|
-
last?: string | null;
|
|
150
|
-
prev?: string | null;
|
|
151
|
-
next?: string | null;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
interface Resource {
|
|
155
|
-
id: number;
|
|
156
|
-
type: string;
|
|
157
|
-
}
|
|
158
|
-
interface ToggleFavoriteResponse {
|
|
159
|
-
id: number;
|
|
160
|
-
hasFavorited: boolean;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
interface ComplianceRequirement {
|
|
164
|
-
requirement_id: number;
|
|
165
|
-
form_template_id: number;
|
|
166
|
-
form_template_name: string;
|
|
167
|
-
logical_group: string;
|
|
168
|
-
is_satisfied: boolean;
|
|
169
|
-
awaiting_countersignature?: boolean;
|
|
170
|
-
submission: FormSubmission | null;
|
|
171
|
-
}
|
|
172
|
-
interface ComplianceRequirementGroup {
|
|
173
|
-
group_name: string;
|
|
174
|
-
group_operator: "AND" | "OR";
|
|
175
|
-
group_satisfied: boolean;
|
|
176
|
-
requirements: ComplianceRequirement[];
|
|
177
|
-
}
|
|
178
|
-
type ComplianceGroupSource = {
|
|
179
|
-
type: "direct";
|
|
180
|
-
} | {
|
|
181
|
-
type: "role";
|
|
182
|
-
role: string;
|
|
183
|
-
} | {
|
|
184
|
-
type: "airplane";
|
|
185
|
-
airplane_id: number;
|
|
186
|
-
registration: string;
|
|
187
|
-
};
|
|
188
|
-
interface ComplianceGroup {
|
|
189
|
-
group_id: number;
|
|
190
|
-
group_name: string;
|
|
191
|
-
overall_satisfied: boolean;
|
|
192
|
-
requirement_groups: ComplianceRequirementGroup[];
|
|
193
|
-
sources?: ComplianceGroupSource[];
|
|
194
|
-
}
|
|
195
|
-
interface ComplianceSummary {
|
|
196
|
-
total_groups: number;
|
|
197
|
-
satisfied_groups: number;
|
|
198
|
-
failed_groups: number;
|
|
199
|
-
}
|
|
200
|
-
interface ComplianceData {
|
|
201
|
-
overall_satisfied: boolean;
|
|
202
|
-
requirement_groups: ComplianceGroup[];
|
|
203
|
-
summary: ComplianceSummary;
|
|
204
|
-
}
|
|
205
|
-
interface ComplianceResponse {
|
|
206
|
-
data: ComplianceData;
|
|
207
|
-
meta: {
|
|
208
|
-
model_id: string;
|
|
209
|
-
model_type: string;
|
|
210
|
-
target_model_id: string;
|
|
211
|
-
target_model_type: string;
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
type AircraftBlockReason = "general" | "ferry" | "weather" | "private" | "aog" | "other";
|
|
216
|
-
interface AircraftBlock {
|
|
217
|
-
type: "aircraftBlock";
|
|
218
|
-
id: number;
|
|
219
|
-
airplane_id: number;
|
|
220
|
-
company_id: number;
|
|
221
|
-
starts_at: string;
|
|
222
|
-
ends_at: string;
|
|
223
|
-
reason: AircraftBlockReason;
|
|
224
|
-
note: string | null;
|
|
225
|
-
is_maintenance: boolean;
|
|
226
|
-
maintenance_event_id: number | null;
|
|
227
|
-
created_at: string;
|
|
228
|
-
updated_at: string;
|
|
229
|
-
can?: Record<string, boolean | null>;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
type BackgroundTaskStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
233
|
-
interface BackgroundTask<TResult = unknown> {
|
|
234
|
-
type: "background_task";
|
|
235
|
-
/** Store key — mirrors `uuid` (the API has no client-facing integer id). */
|
|
236
|
-
id: string;
|
|
237
|
-
uuid: string;
|
|
238
|
-
task_type: string;
|
|
239
|
-
status: BackgroundTaskStatus;
|
|
240
|
-
progress: number | null;
|
|
241
|
-
progress_label: string | null;
|
|
242
|
-
company_id: number | null;
|
|
243
|
-
user_id: number | null;
|
|
244
|
-
result: TResult | null;
|
|
245
|
-
error: string | null;
|
|
246
|
-
started_at: string | null;
|
|
247
|
-
finished_at: string | null;
|
|
248
|
-
created_at: string | null;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
type AiSuggestionStatus = "pending" | "ready" | "applied" | "dismissed" | "failed";
|
|
252
|
-
interface AiSuggestion<TPayload = unknown> {
|
|
253
|
-
type: "ai_suggestion";
|
|
254
|
-
id: number;
|
|
255
|
-
subject_type: string;
|
|
256
|
-
subject_id: number;
|
|
257
|
-
company_id: number | null;
|
|
258
|
-
suggestion_type: string;
|
|
259
|
-
locale: string;
|
|
260
|
-
payload: TPayload;
|
|
261
|
-
meta?: unknown;
|
|
262
|
-
status: AiSuggestionStatus;
|
|
263
|
-
requested_by: number | null;
|
|
264
|
-
applied_at: string | null;
|
|
265
|
-
dismissed_at: string | null;
|
|
266
|
-
created_at: string;
|
|
267
|
-
}
|
|
268
|
-
interface AiSuggestedMilestone {
|
|
269
|
-
name: string;
|
|
270
|
-
description?: string | null;
|
|
271
|
-
kind: "progress" | "prerequisite" | "solo" | "cross_country";
|
|
272
|
-
is_prerequisite: boolean;
|
|
273
|
-
sort_order: number;
|
|
274
|
-
}
|
|
275
|
-
interface CourseDescriptionSuggestionPayload {
|
|
276
|
-
title: string;
|
|
277
|
-
subtitle: string;
|
|
278
|
-
summary: string;
|
|
279
|
-
html: string;
|
|
280
|
-
milestones: AiSuggestedMilestone[];
|
|
281
|
-
}
|
|
282
|
-
interface LogbookFlightLogPayload {
|
|
283
|
-
etdZ: string | null;
|
|
284
|
-
etaZ: string | null;
|
|
285
|
-
departure_airport_id: number | null;
|
|
286
|
-
destination_airport_id: number | null;
|
|
287
|
-
departure_airport_icao: string | null;
|
|
288
|
-
destination_airport_icao: string | null;
|
|
289
|
-
full_stop_landings: number;
|
|
290
|
-
touch_and_gos: number;
|
|
291
|
-
low_approaches: number;
|
|
292
|
-
crew_assignments: {
|
|
293
|
-
membership_id: number;
|
|
294
|
-
role: string;
|
|
295
|
-
}[];
|
|
296
|
-
membership_id: number | null;
|
|
297
|
-
billing_profile_id?: number | null;
|
|
298
|
-
}
|
|
299
|
-
interface LogbookSuggestionMeta {
|
|
300
|
-
flags?: string[];
|
|
301
|
-
match?: {
|
|
302
|
-
confidence: string;
|
|
303
|
-
reasoning: string;
|
|
304
|
-
};
|
|
305
|
-
extraction?: {
|
|
306
|
-
valid: boolean | null;
|
|
307
|
-
discrepancy_minutes: number | null;
|
|
308
|
-
};
|
|
309
|
-
crew_text?: string | null;
|
|
310
|
-
}
|
|
311
|
-
type LogbookSuggestion = AiSuggestion<LogbookFlightLogPayload> & {
|
|
312
|
-
meta?: LogbookSuggestionMeta;
|
|
313
|
-
};
|
|
314
|
-
interface DiscardedRow {
|
|
315
|
-
reason: string;
|
|
316
|
-
flight: Record<string, unknown>;
|
|
317
|
-
}
|
|
318
|
-
interface LogbookStageResult {
|
|
319
|
-
booking_id: number;
|
|
320
|
-
suggestion_ids: number[];
|
|
321
|
-
staged: number;
|
|
322
|
-
routed: Record<string, number> | number[];
|
|
323
|
-
discarded: DiscardedRow[];
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
interface RoleListItem {
|
|
327
|
-
id: number;
|
|
328
|
-
name: string;
|
|
329
|
-
description: string | null;
|
|
330
|
-
is_system: boolean;
|
|
331
|
-
has_duties: boolean;
|
|
332
|
-
company_id: number | null;
|
|
333
|
-
permissions_count: number;
|
|
334
|
-
}
|
|
335
|
-
interface PermissionItem {
|
|
336
|
-
id: number;
|
|
337
|
-
name: string;
|
|
338
|
-
description: string | null;
|
|
339
|
-
group: string;
|
|
340
|
-
}
|
|
341
|
-
interface RoleDetail extends Omit<RoleListItem, "permissions_count"> {
|
|
342
|
-
permissions: PermissionItem[];
|
|
343
|
-
}
|
|
344
|
-
interface GroupedPermissions {
|
|
345
|
-
[group: string]: PermissionItem[];
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
interface LandingFeeTemplateParams {
|
|
349
|
-
landing_type: "FULLSTOP" | "TOUCHANDGO" | "LOWAPPROACH";
|
|
350
|
-
net_gross: "net" | "gross";
|
|
351
|
-
valid_from: string;
|
|
352
|
-
tax_percentage?: number;
|
|
353
|
-
approach_type_id?: number;
|
|
354
|
-
}
|
|
355
|
-
interface LandingFeeImportResult {
|
|
356
|
-
created: number;
|
|
357
|
-
updated: number;
|
|
358
|
-
unchanged: number;
|
|
359
|
-
prices_added: number;
|
|
360
|
-
skipped: number;
|
|
361
|
-
issues: string[];
|
|
362
|
-
preview: Array<[
|
|
363
|
-
string,
|
|
364
|
-
string,
|
|
365
|
-
string,
|
|
366
|
-
string,
|
|
367
|
-
string,
|
|
368
|
-
"new" | "update" | "unchanged"
|
|
369
|
-
]>;
|
|
370
|
-
meta: {
|
|
371
|
-
landing_type: string;
|
|
372
|
-
approach_type_id: number;
|
|
373
|
-
net_gross: string;
|
|
374
|
-
tax_percentage: number;
|
|
375
|
-
valid_from: string;
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
interface LandingFeeInvoicePreviewRow {
|
|
379
|
-
registration: string;
|
|
380
|
-
airplane_id: number | null;
|
|
381
|
-
fee_type: string;
|
|
382
|
-
landing_type: string | null;
|
|
383
|
-
unit_price: number;
|
|
384
|
-
price_basis: "net" | "gross";
|
|
385
|
-
vat_rate: number | null;
|
|
386
|
-
net_total: number | null;
|
|
387
|
-
gross_total: number | null;
|
|
388
|
-
current_price: number | null;
|
|
389
|
-
current_net_total: number | null;
|
|
390
|
-
current_gross_total: number | null;
|
|
391
|
-
date: string | null;
|
|
392
|
-
start_time: string | null;
|
|
393
|
-
landing_time: string | null;
|
|
394
|
-
status: "new" | "changed" | "unchanged" | "unmatched-aircraft" | "unmapped-fee-type" | "airport-unknown";
|
|
395
|
-
}
|
|
396
|
-
interface LandingFeeInvoicePreview {
|
|
397
|
-
rejected: boolean;
|
|
398
|
-
message: string | null;
|
|
399
|
-
company_id: number;
|
|
400
|
-
airport: {
|
|
401
|
-
id: number;
|
|
402
|
-
ident: string;
|
|
403
|
-
name: string;
|
|
404
|
-
} | null;
|
|
405
|
-
invoice: {
|
|
406
|
-
number: string | null;
|
|
407
|
-
date: string | null;
|
|
408
|
-
currency: string | null;
|
|
409
|
-
issuing_airport_name: string | null;
|
|
410
|
-
suggested_airport_icao_ident: string | null;
|
|
411
|
-
};
|
|
412
|
-
landing_fee_rows: LandingFeeInvoicePreviewRow[];
|
|
413
|
-
other_fees: Array<Record<string, unknown>>;
|
|
414
|
-
warnings: Array<{
|
|
415
|
-
type: string;
|
|
416
|
-
message: string;
|
|
417
|
-
}>;
|
|
418
|
-
}
|
|
419
|
-
interface LandingFeeInvoiceApplyPayload {
|
|
420
|
-
airport_id: number;
|
|
421
|
-
valid_from: string;
|
|
422
|
-
tax_percentage: number;
|
|
423
|
-
approach_type_id: number;
|
|
424
|
-
rows: Array<{
|
|
425
|
-
airplane_id: number;
|
|
426
|
-
landing_type: string;
|
|
427
|
-
unit_price: number;
|
|
428
|
-
price_basis: "net" | "gross";
|
|
429
|
-
vat_rate: number | null;
|
|
430
|
-
}>;
|
|
431
|
-
}
|
|
432
|
-
interface LandingFeeInvoiceApplyResult {
|
|
433
|
-
created: number;
|
|
434
|
-
updated: number;
|
|
435
|
-
unchanged: number;
|
|
436
|
-
prices_added: number;
|
|
437
|
-
issues: string[];
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Operating hours — an organization defines several independent groups (its
|
|
442
|
-
* own office hours, a military field it flies from, the tower, an FBO). Each
|
|
443
|
-
* group is self-contained (own IANA timezone + optional airport) and is
|
|
444
|
-
* materialised server-side into merged, half-open UTC windows; status is
|
|
445
|
-
* answered per group as open / partial / closed / unknown.
|
|
446
|
-
*/
|
|
447
|
-
type OperatingHourKind = "company" | "airport" | "atc" | "fbo" | "military" | "fuel" | "customs" | "handling" | "maintenance" | "other";
|
|
448
|
-
type TimeAnchor = "fixed" | "sunrise" | "sunset";
|
|
449
|
-
type OperatingStatusValue = "open" | "partial" | "closed" | "unknown";
|
|
450
|
-
/**
|
|
451
|
-
* One open block. Each bound is a fixed local time, or sunrise/sunset with a
|
|
452
|
-
* signed offset and an optional cap ("SR-30 aber nicht vor 07:00"). An end at
|
|
453
|
-
* or before its start crosses midnight.
|
|
454
|
-
*/
|
|
455
|
-
type OperatingHourInterval = {
|
|
456
|
-
id?: number;
|
|
457
|
-
sort: number;
|
|
458
|
-
start_kind: TimeAnchor;
|
|
459
|
-
start_time: string | null;
|
|
460
|
-
start_offset_minutes: number | null;
|
|
461
|
-
start_not_before: string | null;
|
|
462
|
-
end_kind: TimeAnchor;
|
|
463
|
-
end_time: string | null;
|
|
464
|
-
end_offset_minutes: number | null;
|
|
465
|
-
end_not_after: string | null;
|
|
466
|
-
};
|
|
467
|
-
/** One weekday. ISO: 1 = Monday .. 7 = Sunday. */
|
|
468
|
-
type OperatingHourDay = {
|
|
469
|
-
id?: number;
|
|
470
|
-
schedule_id?: number;
|
|
471
|
-
day_of_week: number;
|
|
472
|
-
is_closed: boolean;
|
|
473
|
-
is_24_hours: boolean;
|
|
474
|
-
notes: string | null;
|
|
475
|
-
intervals: OperatingHourInterval[];
|
|
476
|
-
};
|
|
477
|
-
/** A hand-entered override for a date range. No recurrence, by design. */
|
|
478
|
-
type OperatingHourException = {
|
|
479
|
-
id: number;
|
|
480
|
-
schedule_id: number;
|
|
481
|
-
starts_on: string;
|
|
482
|
-
ends_on: string;
|
|
483
|
-
is_closed: boolean;
|
|
484
|
-
is_24_hours: boolean;
|
|
485
|
-
reason: string;
|
|
486
|
-
intervals: OperatingHourInterval[];
|
|
487
|
-
};
|
|
488
|
-
/**
|
|
489
|
-
* What the client composes before an exception exists — no id, no owner yet.
|
|
490
|
-
* The read type above is what comes back; keeping the two apart lets the
|
|
491
|
-
* dialog's `createItem` seed a blank without lying about an id.
|
|
492
|
-
*/
|
|
493
|
-
type OperatingHourExceptionInput = Omit<OperatingHourException, "id" | "schedule_id">;
|
|
494
|
-
/** A concrete, merged, half-open UTC window. Derived — read-only. */
|
|
495
|
-
type OperatingHourWindow = {
|
|
496
|
-
starts_at: string;
|
|
497
|
-
ends_at: string;
|
|
498
|
-
};
|
|
499
|
-
/**
|
|
500
|
-
* A group. Self-contained: carries its own timezone and airport, resolved
|
|
501
|
-
* from nowhere else. `materialized_from`/`materialized_through` bound the
|
|
502
|
-
* range in which "no window" genuinely means closed rather than unknown.
|
|
503
|
-
*/
|
|
504
|
-
type OperatingHourSchedule = {
|
|
505
|
-
id: number;
|
|
506
|
-
company_id: number;
|
|
507
|
-
airport_id: number | null;
|
|
508
|
-
airport?: {
|
|
509
|
-
id: number;
|
|
510
|
-
ident: string;
|
|
511
|
-
name: string;
|
|
512
|
-
} | null;
|
|
513
|
-
kind: OperatingHourKind;
|
|
514
|
-
name: string;
|
|
515
|
-
description: string | null;
|
|
516
|
-
timezone: string;
|
|
517
|
-
valid_from: string;
|
|
518
|
-
valid_until: string | null;
|
|
519
|
-
is_active: boolean;
|
|
520
|
-
sort_order: number;
|
|
521
|
-
source: string | null;
|
|
522
|
-
verified_at: string | null;
|
|
523
|
-
materialized_from: string | null;
|
|
524
|
-
materialized_through: string | null;
|
|
525
|
-
days: OperatingHourDay[];
|
|
526
|
-
exceptions: OperatingHourException[];
|
|
527
|
-
created_at?: string;
|
|
528
|
-
updated_at?: string;
|
|
529
|
-
};
|
|
530
|
-
/** The fields a client may send when creating a group. */
|
|
531
|
-
type OperatingHourScheduleInput = Partial<Omit<OperatingHourSchedule, "id" | "company_id" | "airport" | "materialized_from" | "materialized_through" | "days" | "exceptions" | "created_at" | "updated_at">>;
|
|
532
|
-
/**
|
|
533
|
-
* What the saved rules resolve to on ONE named calendar date — used for the
|
|
534
|
-
* solstice hints. Carries its own date and status precisely so the extremes
|
|
535
|
-
* can never be merged into a weekday bucket alongside the current week, and
|
|
536
|
-
* so an `unknown` date is reported as unknown rather than as closed.
|
|
537
|
-
*/
|
|
538
|
-
type OperatingHourResolvedDate = {
|
|
539
|
-
/** `Y-m-d` in the group's timezone. */
|
|
540
|
-
date: string;
|
|
541
|
-
status: OperatingStatusValue;
|
|
542
|
-
windows: OperatingHourWindow[];
|
|
543
|
-
};
|
|
544
|
-
type OperatingHourStatusEntry = {
|
|
545
|
-
schedule_id: number;
|
|
546
|
-
kind: OperatingHourKind;
|
|
547
|
-
name: string;
|
|
548
|
-
timezone: string;
|
|
549
|
-
status: OperatingStatusValue;
|
|
550
|
-
windows: OperatingHourWindow[];
|
|
551
|
-
};
|
|
552
|
-
type OperatingHoursStatusResponse = {
|
|
553
|
-
from: string;
|
|
554
|
-
to: string;
|
|
555
|
-
data: OperatingHourStatusEntry[];
|
|
556
|
-
};
|
|
557
|
-
type OperatingHoursNextOpenEntry = {
|
|
558
|
-
schedule_id: number;
|
|
559
|
-
kind: OperatingHourKind;
|
|
560
|
-
name: string;
|
|
561
|
-
next_opening: string | null;
|
|
562
|
-
};
|
|
563
|
-
type OperatingHoursNextOpenResponse = {
|
|
564
|
-
after: string;
|
|
565
|
-
data: OperatingHoursNextOpenEntry[];
|
|
566
|
-
};
|
|
567
|
-
type OperatingHoursMeta = {
|
|
568
|
-
kinds: OperatingHourKind[];
|
|
569
|
-
anchors: TimeAnchor[];
|
|
570
|
-
statuses: OperatingStatusValue[];
|
|
571
|
-
max_status_range_days: number;
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
export type { Activity, Address, AiSuggestedMilestone, AiSuggestion, AiSuggestionStatus, AircraftBlock, AircraftBlockReason, AircraftPosition, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApiResponse, ApproachType, Avail, BackgroundTask, BackgroundTaskStatus, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceGroupSource, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseCheckSyllabus, CourseDescriptionSuggestionPayload, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateAirplaneIssueInput, CreateCommentInput, CreatePostInput, DataWrappedResponse, DeferAirplaneIssueInput, DiscardedRow, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FeeCategoryOptions, FlightLog, GroupedPermissions, Invoice, Landing, LandingFee, LandingFeeImportResult, LandingFeeInvoiceApplyPayload, LandingFeeInvoiceApplyResult, LandingFeeInvoicePreview, LandingFeeInvoicePreviewRow, LandingFeeTemplateParams, LogbookFlightLogPayload, LogbookStageResult, LogbookSuggestion, LogbookSuggestionMeta, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, MembershipSignup, OperatingHourDay, OperatingHourException, OperatingHourExceptionInput, OperatingHourInterval, OperatingHourKind, OperatingHourResolvedDate, OperatingHourSchedule, OperatingHourScheduleInput, OperatingHourStatusEntry, OperatingHourWindow, OperatingHoursMeta, OperatingHoursNextOpenEntry, OperatingHoursNextOpenResponse, OperatingHoursStatusResponse, OperatingStatusValue, PaginatedResponse, PermissionItem, Post, PostSubject, PrePaidPackage, Price, Qualification, RecurringFlight, ResolveAirplaneIssueInput, Resource, Role, RoleDetail, RoleListItem, Runway, ScheduledFlight, Setting, SpecialFlight, Tag, TagSyncEntry, Ticket, TimeAnchor, ToggleFavoriteResponse, UpdateAirplaneIssueInput, UpdateCommentInput, UpdatePostInput, User, UserAircraftRating, UserQualification, Waypoint };
|
|
3
|
+
import { bf as fboAcceptanceAxisSchema, bg as fboAcceptanceStatusSchema, bh as fboCompanyProfileSchema, bk as fboDecisionSchema, bi as fboDecisionAxisSchema, bj as fboDecisionInputSchema, bl as fboDutySchema, bm as fboFlightSchema, bn as fboFlightStatusSchema, bo as fboFlightTypeSchema, bp as fboGroundServicesSchema, bq as fboOccupationSchema, br as fboRoleSchema } from '../fbo-yr7LUerk.js';
|
|
4
|
+
|
|
5
|
+
type FboAcceptanceAxis = z.infer<typeof fboAcceptanceAxisSchema>;
|
|
6
|
+
type FboAcceptanceStatus = z.infer<typeof fboAcceptanceStatusSchema>;
|
|
7
|
+
type FboGroundServices = z.infer<typeof fboGroundServicesSchema>;
|
|
8
|
+
type FboFlightType = z.infer<typeof fboFlightTypeSchema>;
|
|
9
|
+
type FboFlightStatus = z.infer<typeof fboFlightStatusSchema>;
|
|
10
|
+
type FboFlight = z.infer<typeof fboFlightSchema>;
|
|
11
|
+
type FboOccupation = z.infer<typeof fboOccupationSchema>;
|
|
12
|
+
type FboDuty = z.infer<typeof fboDutySchema>;
|
|
13
|
+
type FboRole = z.infer<typeof fboRoleSchema>;
|
|
14
|
+
type FboCompanyProfile = z.infer<typeof fboCompanyProfileSchema>;
|
|
15
|
+
type FboDecisionAxis = z.infer<typeof fboDecisionAxisSchema>;
|
|
16
|
+
type FboDecision = z.infer<typeof fboDecisionSchema>;
|
|
17
|
+
type FboDecisionInput = z.infer<typeof fboDecisionInputSchema>;
|
|
18
|
+
|
|
19
|
+
export type { FboAcceptanceAxis, FboAcceptanceStatus, FboCompanyProfile, FboDecision, FboDecisionAxis, FboDecisionInput, FboDuty, FboFlight, FboFlightStatus, FboFlightType, FboGroundServices, FboOccupation, FboRole };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-ASPK4M5R.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updraft-solutions/mcrit-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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": {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { fboDutySchema, fboFlightSchema } from "./fbo";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fixtures are copied from the API's FlightResource / DutyResource shapes, not
|
|
6
|
+
* invented, so a schema that drifts from the payload fails here rather than at
|
|
7
|
+
* runtime in the app.
|
|
8
|
+
*/
|
|
9
|
+
const flightPayload = {
|
|
10
|
+
id: 44796, type: "ppr", uuid: "0f1b3d5e-0000-4000-8000-000000000001", flight_status: "pending",
|
|
11
|
+
company_id: 34, author_id: null,
|
|
12
|
+
ac_call: "DEABC", ac_reg: null, ac_type: "C172", operator: "PrivateWings",
|
|
13
|
+
etdZ: "2026-09-01T20:00:00.000000Z", etdZ_no_time: false, etaZ: null, etaZ_no_time: false,
|
|
14
|
+
departure_airport_id: 2753, destination_airport_id: null,
|
|
15
|
+
ifr: false, wx: false, landings: 1, remarks: null,
|
|
16
|
+
contact: { name: "Erika Muster", email: "erika@example.test", phone: null, company: null, fax: null },
|
|
17
|
+
ground_services: { stairs: false, hangar: false, car_access: false, lifter: false, rental_car: false, refueling: false, gpu: false },
|
|
18
|
+
acceptance_status: {
|
|
19
|
+
fbo: { status: "pending", is_required: true, decided_by_id: null, updated_at: "2026-08-26T10:00:00.000000Z" },
|
|
20
|
+
airport: { status: "unknown", is_required: false, decided_by_id: null, updated_at: null },
|
|
21
|
+
customs: { status: "unknown", is_required: false, decided_by_id: null, updated_at: null },
|
|
22
|
+
},
|
|
23
|
+
created_at: "2026-08-26T10:00:00.000000Z", updated_at: "2026-08-26T10:00:00.000000Z",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe("fboFlightSchema", () => {
|
|
27
|
+
it("parses a PPR exactly as FlightResource emits it", () => {
|
|
28
|
+
expect(fboFlightSchema.parse(flightPayload).type).toBe("ppr");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("rejects a status outside AcceptanceStatusData's vocabulary", () => {
|
|
32
|
+
const bad = { ...flightPayload, acceptance_status: { ...flightPayload.acceptance_status, fbo: { ...flightPayload.acceptance_status.fbo, status: "idle" } } };
|
|
33
|
+
expect(() => fboFlightSchema.parse(bad)).toThrow();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("rejects the flight-school type — the FBO domain never holds a 'booking'", () => {
|
|
37
|
+
expect(() => fboFlightSchema.parse({ ...flightPayload, type: "booking" })).toThrow();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("fboDutySchema", () => {
|
|
42
|
+
it("accepts a userless, occupation-less duty — 27% of the migrated roster has no user", () => {
|
|
43
|
+
expect(fboDutySchema.parse({
|
|
44
|
+
id: 1, company_id: 35, user_id: null, author_id: null, occupation_id: null, scheduled_flight_id: null,
|
|
45
|
+
start: "2026-09-01T18:00:00.000000Z", end: "2026-09-01T23:00:00.000000Z", all_day: false, remarks: null,
|
|
46
|
+
created_at: null, updated_at: null,
|
|
47
|
+
}).user_id).toBeNull();
|
|
48
|
+
});
|
|
49
|
+
});
|