@updraft-solutions/mcrit-sdk 0.4.0 → 0.5.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.
Files changed (42) hide show
  1. package/dist/chunk-AKLFMP7G.cjs +2525 -0
  2. package/dist/chunk-YCIXOVEC.js +2525 -0
  3. package/dist/index.cjs +193 -3
  4. package/dist/index.d.cts +3 -3
  5. package/dist/index.d.ts +3 -3
  6. package/dist/index.js +196 -6
  7. package/dist/schemas/index.cjs +192 -2
  8. package/dist/schemas/index.d.cts +3123 -94
  9. package/dist/schemas/index.d.ts +3123 -94
  10. package/dist/schemas/index.js +195 -5
  11. package/dist/{models-Bc5BKYuI.d.cts → training-Der1DPU-.d.cts} +17563 -1056
  12. package/dist/{models-Bc5BKYuI.d.ts → training-Der1DPU-.d.ts} +17563 -1056
  13. package/dist/types/index.cjs +1 -1
  14. package/dist/types/index.d.cts +275 -6
  15. package/dist/types/index.d.ts +275 -6
  16. package/dist/types/index.js +1 -1
  17. package/package.json +1 -1
  18. package/src/index.ts +39 -0
  19. package/src/schemas/common.ts +33 -0
  20. package/src/schemas/course-milestone.ts +78 -0
  21. package/src/schemas/equipment.ts +27 -0
  22. package/src/schemas/form-template.ts +413 -0
  23. package/src/schemas/index.ts +7 -1
  24. package/src/schemas/location-map.ts +175 -0
  25. package/src/schemas/models.ts +38 -20
  26. package/src/schemas/newsletter.ts +362 -0
  27. package/src/schemas/todo.ts +46 -0
  28. package/src/schemas/training.ts +500 -0
  29. package/src/types/ai.ts +85 -0
  30. package/src/types/aircraft-block.ts +23 -0
  31. package/src/types/api.ts +3 -1
  32. package/src/types/background-task.ts +28 -0
  33. package/src/types/compliance.ts +27 -3
  34. package/src/types/index.ts +5 -0
  35. package/src/types/landing-fee.ts +92 -0
  36. package/src/types/models.ts +43 -3
  37. package/src/types/roles.ts +26 -0
  38. package/dist/chunk-RC2BBT6H.cjs +0 -1384
  39. package/dist/chunk-WQLDSZNN.js +0 -1384
  40. package/src/schemas/fee.ts +0 -37
  41. /package/dist/{chunk-LXNCAKJZ.js → chunk-2WJHTRIE.js} +0 -0
  42. /package/dist/{chunk-MOOGM3DW.cjs → chunk-DCEOET63.cjs} +0 -0
@@ -1 +1 @@
1
- "use strict";require('../chunk-MOOGM3DW.cjs');
1
+ "use strict";require('../chunk-DCEOET63.cjs');
@@ -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, 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';
2
+ import { aA as addressSchema, aB as aircraftRatingSchema, aG as airplaneSchema, aF as airplanePermissionSchema, aH as airplaneShareInviteSchema, aI as airportSchema, aJ as alertSchema, aK as allowedDocumentTypeSchema, aL as approachTypeSchema, aM as availSchema, aN as baseMembershipSchema, aO as bookingSchema, aQ as commentSchema, aR as companySchema, aX as courseSchema, aV as courseEnrollmentSchema, aW as courseFeeSchema, aD as airplaneIssueSeverityEnum, b1 as documentSchema, aZ as documentComplianceStatus, a_ as documentRequirement, a$ as documentRequirementGroup, b0 as documentRequirementGroupAssignment, b2 as documentShareSchema, b3 as documentType, b5 as eventSchema, b7 as expenseSchema, b6 as expenseItemSchema, b8 as extendedAirplaneSchema, ba as feeSchema, b9 as feeCategoryOptionsSchema, bb as flightLogSchema, bh as invoiceSchema, bj as landingSchema, bi as landingFeeSchema, bl as maintenanceEventSchema, bk as maintenanceEventEstimationSchema, bm as maintenanceStatusSchema, bn as mediaCollection, bp as membershipSchema, bq as postSchema, br as prePaidPackageSchema, bs as priceSchema, bt as qualificationSchema, bu as recurringFlightSchema, bv as roleSchema, bw as runwaySchema, bx as scheduledFlightSchema, by as settingSchema, bz as specialFlightSchema, bG as tagSchema, bH as ticketSchema, bR as userSchema, bP as userAircraftRatingSchema, bQ as userQualificationSchema, bS as waypointSchema, aC as airplaneIssueSchema, aE as airplaneIssueStatusEnum, B as BaseModel$1, aT as courseCheckSyllabusSchema, aU as courseEnrollmentMetricsSchema, bo as mediaSchema, l as FormSubmission } from '../training-Der1DPU-.cjs';
3
3
 
4
4
  type BaseModel = z.infer<typeof BaseModel$1>;
5
5
  type User = z.infer<typeof userSchema>;
@@ -20,6 +20,7 @@ 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 FeeCategoryOptions = z.infer<typeof feeCategoryOptionsSchema>;
23
24
  type Tag = z.infer<typeof tagSchema>;
24
25
  type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
25
26
  type Price = z.infer<typeof priceSchema>;
@@ -57,6 +58,37 @@ type AirplaneIssueStatus = z.infer<typeof airplaneIssueStatusEnum>;
57
58
  type Event = z.infer<typeof eventSchema>;
58
59
  type Ticket = z.infer<typeof ticketSchema>;
59
60
  type Post = z.infer<typeof postSchema>;
61
+ interface CreatePostInput {
62
+ title?: string | null;
63
+ content: string;
64
+ sticky?: boolean;
65
+ public?: boolean;
66
+ }
67
+ interface UpdatePostInput {
68
+ title?: string | null;
69
+ content: string;
70
+ sticky?: boolean;
71
+ public?: boolean;
72
+ }
73
+ interface CreateAirplaneIssueInput {
74
+ title?: string | null;
75
+ body: string;
76
+ severity?: AirplaneIssueSeverity;
77
+ ata_chapter?: string | null;
78
+ }
79
+ interface UpdateAirplaneIssueInput {
80
+ title?: string | null;
81
+ body?: string;
82
+ severity?: AirplaneIssueSeverity;
83
+ ata_chapter?: string | null;
84
+ }
85
+ interface ResolveAirplaneIssueInput {
86
+ resolution_notes?: string | null;
87
+ }
88
+ interface DeferAirplaneIssueInput {
89
+ deferred_until?: string | null;
90
+ deferral_notes?: string | null;
91
+ }
60
92
  type Comment = z.infer<typeof commentSchema>;
61
93
  interface CreateCommentInput {
62
94
  body: string;
@@ -81,7 +113,8 @@ interface DataWrappedResponse<T, M = undefined> {
81
113
  data: T;
82
114
  meta?: M;
83
115
  }
84
- interface PaginatedResponse<T = any> {
116
+ type ApiResponse<T> = DataWrappedResponse<T>;
117
+ interface PaginatedResponse<T = unknown> {
85
118
  data: T[];
86
119
  meta: {
87
120
  current_page: number;
@@ -109,11 +142,12 @@ interface ToggleFavoriteResponse {
109
142
 
110
143
  interface ComplianceRequirement {
111
144
  requirement_id: number;
112
- document_type_class: string;
113
- document_type_label: string;
145
+ form_template_id: number;
146
+ form_template_name: string;
114
147
  logical_group: string;
115
148
  is_satisfied: boolean;
116
- document: any | null;
149
+ awaiting_countersignature?: boolean;
150
+ submission: FormSubmission | null;
117
151
  }
118
152
  interface ComplianceRequirementGroup {
119
153
  group_name: string;
@@ -121,11 +155,22 @@ interface ComplianceRequirementGroup {
121
155
  group_satisfied: boolean;
122
156
  requirements: ComplianceRequirement[];
123
157
  }
158
+ type ComplianceGroupSource = {
159
+ type: "direct";
160
+ } | {
161
+ type: "role";
162
+ role: string;
163
+ } | {
164
+ type: "airplane";
165
+ airplane_id: number;
166
+ registration: string;
167
+ };
124
168
  interface ComplianceGroup {
125
169
  group_id: number;
126
170
  group_name: string;
127
171
  overall_satisfied: boolean;
128
172
  requirement_groups: ComplianceRequirementGroup[];
173
+ sources?: ComplianceGroupSource[];
129
174
  }
130
175
  interface ComplianceSummary {
131
176
  total_groups: number;
@@ -147,4 +192,228 @@ interface ComplianceResponse {
147
192
  };
148
193
  }
149
194
 
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 };
195
+ type AircraftBlockReason = "general" | "ferry" | "weather" | "private" | "aog" | "other";
196
+ interface AircraftBlock {
197
+ type: "aircraftBlock";
198
+ id: number;
199
+ airplane_id: number;
200
+ company_id: number;
201
+ starts_at: string;
202
+ ends_at: string;
203
+ reason: AircraftBlockReason;
204
+ note: string | null;
205
+ is_maintenance: boolean;
206
+ maintenance_event_id: number | null;
207
+ created_at: string;
208
+ updated_at: string;
209
+ can?: Record<string, boolean | null>;
210
+ }
211
+
212
+ type BackgroundTaskStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
213
+ interface BackgroundTask<TResult = unknown> {
214
+ type: "background_task";
215
+ /** Store key — mirrors `uuid` (the API has no client-facing integer id). */
216
+ id: string;
217
+ uuid: string;
218
+ task_type: string;
219
+ status: BackgroundTaskStatus;
220
+ progress: number | null;
221
+ progress_label: string | null;
222
+ company_id: number | null;
223
+ user_id: number | null;
224
+ result: TResult | null;
225
+ error: string | null;
226
+ started_at: string | null;
227
+ finished_at: string | null;
228
+ created_at: string | null;
229
+ }
230
+
231
+ type AiSuggestionStatus = "pending" | "ready" | "applied" | "dismissed" | "failed";
232
+ interface AiSuggestion<TPayload = unknown> {
233
+ type: "ai_suggestion";
234
+ id: number;
235
+ subject_type: string;
236
+ subject_id: number;
237
+ company_id: number | null;
238
+ suggestion_type: string;
239
+ locale: string;
240
+ payload: TPayload;
241
+ meta?: unknown;
242
+ status: AiSuggestionStatus;
243
+ requested_by: number | null;
244
+ applied_at: string | null;
245
+ dismissed_at: string | null;
246
+ created_at: string;
247
+ }
248
+ interface AiSuggestedMilestone {
249
+ name: string;
250
+ description?: string | null;
251
+ kind: "progress" | "prerequisite" | "solo" | "cross_country";
252
+ is_prerequisite: boolean;
253
+ sort_order: number;
254
+ }
255
+ interface CourseDescriptionSuggestionPayload {
256
+ title: string;
257
+ subtitle: string;
258
+ summary: string;
259
+ html: string;
260
+ milestones: AiSuggestedMilestone[];
261
+ }
262
+ interface LogbookFlightLogPayload {
263
+ etdZ: string | null;
264
+ etaZ: string | null;
265
+ departure_airport_id: number | null;
266
+ destination_airport_id: number | null;
267
+ departure_airport_icao: string | null;
268
+ destination_airport_icao: string | null;
269
+ full_stop_landings: number;
270
+ touch_and_gos: number;
271
+ low_approaches: number;
272
+ crew_assignments: {
273
+ membership_id: number;
274
+ role: string;
275
+ }[];
276
+ membership_id: number | null;
277
+ }
278
+ interface LogbookSuggestionMeta {
279
+ flags?: string[];
280
+ match?: {
281
+ confidence: string;
282
+ reasoning: string;
283
+ };
284
+ extraction?: {
285
+ valid: boolean | null;
286
+ discrepancy_minutes: number | null;
287
+ };
288
+ crew_text?: string | null;
289
+ }
290
+ type LogbookSuggestion = AiSuggestion<LogbookFlightLogPayload> & {
291
+ meta?: LogbookSuggestionMeta;
292
+ };
293
+ interface DiscardedRow {
294
+ reason: string;
295
+ flight: Record<string, unknown>;
296
+ }
297
+ interface LogbookStageResult {
298
+ booking_id: number;
299
+ suggestion_ids: number[];
300
+ staged: number;
301
+ routed: Record<string, number> | number[];
302
+ discarded: DiscardedRow[];
303
+ }
304
+
305
+ interface RoleListItem {
306
+ id: number;
307
+ name: string;
308
+ description: string | null;
309
+ is_system: boolean;
310
+ has_duties: boolean;
311
+ company_id: number | null;
312
+ permissions_count: number;
313
+ }
314
+ interface PermissionItem {
315
+ id: number;
316
+ name: string;
317
+ description: string | null;
318
+ group: string;
319
+ }
320
+ interface RoleDetail extends Omit<RoleListItem, "permissions_count"> {
321
+ permissions: PermissionItem[];
322
+ }
323
+ interface GroupedPermissions {
324
+ [group: string]: PermissionItem[];
325
+ }
326
+
327
+ interface LandingFeeTemplateParams {
328
+ landing_type: "FULLSTOP" | "TOUCHANDGO" | "LOWAPPROACH";
329
+ net_gross: "net" | "gross";
330
+ valid_from: string;
331
+ tax_percentage?: number;
332
+ approach_type_id?: number;
333
+ }
334
+ interface LandingFeeImportResult {
335
+ created: number;
336
+ updated: number;
337
+ unchanged: number;
338
+ prices_added: number;
339
+ skipped: number;
340
+ issues: string[];
341
+ preview: Array<[
342
+ string,
343
+ string,
344
+ string,
345
+ string,
346
+ string,
347
+ "new" | "update" | "unchanged"
348
+ ]>;
349
+ meta: {
350
+ landing_type: string;
351
+ approach_type_id: number;
352
+ net_gross: string;
353
+ tax_percentage: number;
354
+ valid_from: string;
355
+ };
356
+ }
357
+ interface LandingFeeInvoicePreviewRow {
358
+ registration: string;
359
+ airplane_id: number | null;
360
+ fee_type: string;
361
+ landing_type: string | null;
362
+ unit_price: number;
363
+ price_basis: "net" | "gross";
364
+ vat_rate: number | null;
365
+ net_total: number | null;
366
+ gross_total: number | null;
367
+ current_price: number | null;
368
+ current_net_total: number | null;
369
+ current_gross_total: number | null;
370
+ date: string | null;
371
+ start_time: string | null;
372
+ landing_time: string | null;
373
+ status: "new" | "changed" | "unchanged" | "unmatched-aircraft" | "unmapped-fee-type" | "airport-unknown";
374
+ }
375
+ interface LandingFeeInvoicePreview {
376
+ rejected: boolean;
377
+ message: string | null;
378
+ company_id: number;
379
+ airport: {
380
+ id: number;
381
+ ident: string;
382
+ name: string;
383
+ } | null;
384
+ invoice: {
385
+ number: string | null;
386
+ date: string | null;
387
+ currency: string | null;
388
+ issuing_airport_name: string | null;
389
+ suggested_airport_icao_ident: string | null;
390
+ };
391
+ landing_fee_rows: LandingFeeInvoicePreviewRow[];
392
+ other_fees: Array<Record<string, unknown>>;
393
+ warnings: Array<{
394
+ type: string;
395
+ message: string;
396
+ }>;
397
+ }
398
+ interface LandingFeeInvoiceApplyPayload {
399
+ airport_id: number;
400
+ valid_from: string;
401
+ tax_percentage: number;
402
+ approach_type_id: number;
403
+ rows: Array<{
404
+ airplane_id: number;
405
+ landing_type: string;
406
+ unit_price: number;
407
+ price_basis: "net" | "gross";
408
+ vat_rate: number | null;
409
+ }>;
410
+ }
411
+ interface LandingFeeInvoiceApplyResult {
412
+ created: number;
413
+ updated: number;
414
+ unchanged: number;
415
+ prices_added: number;
416
+ issues: string[];
417
+ }
418
+
419
+ export type { Address, AiSuggestedMilestone, AiSuggestion, AiSuggestionStatus, AircraftBlock, AircraftBlockReason, 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, PaginatedResponse, PermissionItem, Post, PrePaidPackage, Price, Qualification, RecurringFlight, ResolveAirplaneIssueInput, Resource, Role, RoleDetail, RoleListItem, Runway, ScheduledFlight, Setting, SpecialFlight, Tag, Ticket, ToggleFavoriteResponse, UpdateAirplaneIssueInput, UpdateCommentInput, UpdatePostInput, User, UserAircraftRating, UserQualification, Waypoint };
@@ -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, 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';
2
+ import { aA as addressSchema, aB as aircraftRatingSchema, aG as airplaneSchema, aF as airplanePermissionSchema, aH as airplaneShareInviteSchema, aI as airportSchema, aJ as alertSchema, aK as allowedDocumentTypeSchema, aL as approachTypeSchema, aM as availSchema, aN as baseMembershipSchema, aO as bookingSchema, aQ as commentSchema, aR as companySchema, aX as courseSchema, aV as courseEnrollmentSchema, aW as courseFeeSchema, aD as airplaneIssueSeverityEnum, b1 as documentSchema, aZ as documentComplianceStatus, a_ as documentRequirement, a$ as documentRequirementGroup, b0 as documentRequirementGroupAssignment, b2 as documentShareSchema, b3 as documentType, b5 as eventSchema, b7 as expenseSchema, b6 as expenseItemSchema, b8 as extendedAirplaneSchema, ba as feeSchema, b9 as feeCategoryOptionsSchema, bb as flightLogSchema, bh as invoiceSchema, bj as landingSchema, bi as landingFeeSchema, bl as maintenanceEventSchema, bk as maintenanceEventEstimationSchema, bm as maintenanceStatusSchema, bn as mediaCollection, bp as membershipSchema, bq as postSchema, br as prePaidPackageSchema, bs as priceSchema, bt as qualificationSchema, bu as recurringFlightSchema, bv as roleSchema, bw as runwaySchema, bx as scheduledFlightSchema, by as settingSchema, bz as specialFlightSchema, bG as tagSchema, bH as ticketSchema, bR as userSchema, bP as userAircraftRatingSchema, bQ as userQualificationSchema, bS as waypointSchema, aC as airplaneIssueSchema, aE as airplaneIssueStatusEnum, B as BaseModel$1, aT as courseCheckSyllabusSchema, aU as courseEnrollmentMetricsSchema, bo as mediaSchema, l as FormSubmission } from '../training-Der1DPU-.js';
3
3
 
4
4
  type BaseModel = z.infer<typeof BaseModel$1>;
5
5
  type User = z.infer<typeof userSchema>;
@@ -20,6 +20,7 @@ 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 FeeCategoryOptions = z.infer<typeof feeCategoryOptionsSchema>;
23
24
  type Tag = z.infer<typeof tagSchema>;
24
25
  type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
25
26
  type Price = z.infer<typeof priceSchema>;
@@ -57,6 +58,37 @@ type AirplaneIssueStatus = z.infer<typeof airplaneIssueStatusEnum>;
57
58
  type Event = z.infer<typeof eventSchema>;
58
59
  type Ticket = z.infer<typeof ticketSchema>;
59
60
  type Post = z.infer<typeof postSchema>;
61
+ interface CreatePostInput {
62
+ title?: string | null;
63
+ content: string;
64
+ sticky?: boolean;
65
+ public?: boolean;
66
+ }
67
+ interface UpdatePostInput {
68
+ title?: string | null;
69
+ content: string;
70
+ sticky?: boolean;
71
+ public?: boolean;
72
+ }
73
+ interface CreateAirplaneIssueInput {
74
+ title?: string | null;
75
+ body: string;
76
+ severity?: AirplaneIssueSeverity;
77
+ ata_chapter?: string | null;
78
+ }
79
+ interface UpdateAirplaneIssueInput {
80
+ title?: string | null;
81
+ body?: string;
82
+ severity?: AirplaneIssueSeverity;
83
+ ata_chapter?: string | null;
84
+ }
85
+ interface ResolveAirplaneIssueInput {
86
+ resolution_notes?: string | null;
87
+ }
88
+ interface DeferAirplaneIssueInput {
89
+ deferred_until?: string | null;
90
+ deferral_notes?: string | null;
91
+ }
60
92
  type Comment = z.infer<typeof commentSchema>;
61
93
  interface CreateCommentInput {
62
94
  body: string;
@@ -81,7 +113,8 @@ interface DataWrappedResponse<T, M = undefined> {
81
113
  data: T;
82
114
  meta?: M;
83
115
  }
84
- interface PaginatedResponse<T = any> {
116
+ type ApiResponse<T> = DataWrappedResponse<T>;
117
+ interface PaginatedResponse<T = unknown> {
85
118
  data: T[];
86
119
  meta: {
87
120
  current_page: number;
@@ -109,11 +142,12 @@ interface ToggleFavoriteResponse {
109
142
 
110
143
  interface ComplianceRequirement {
111
144
  requirement_id: number;
112
- document_type_class: string;
113
- document_type_label: string;
145
+ form_template_id: number;
146
+ form_template_name: string;
114
147
  logical_group: string;
115
148
  is_satisfied: boolean;
116
- document: any | null;
149
+ awaiting_countersignature?: boolean;
150
+ submission: FormSubmission | null;
117
151
  }
118
152
  interface ComplianceRequirementGroup {
119
153
  group_name: string;
@@ -121,11 +155,22 @@ interface ComplianceRequirementGroup {
121
155
  group_satisfied: boolean;
122
156
  requirements: ComplianceRequirement[];
123
157
  }
158
+ type ComplianceGroupSource = {
159
+ type: "direct";
160
+ } | {
161
+ type: "role";
162
+ role: string;
163
+ } | {
164
+ type: "airplane";
165
+ airplane_id: number;
166
+ registration: string;
167
+ };
124
168
  interface ComplianceGroup {
125
169
  group_id: number;
126
170
  group_name: string;
127
171
  overall_satisfied: boolean;
128
172
  requirement_groups: ComplianceRequirementGroup[];
173
+ sources?: ComplianceGroupSource[];
129
174
  }
130
175
  interface ComplianceSummary {
131
176
  total_groups: number;
@@ -147,4 +192,228 @@ interface ComplianceResponse {
147
192
  };
148
193
  }
149
194
 
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 };
195
+ type AircraftBlockReason = "general" | "ferry" | "weather" | "private" | "aog" | "other";
196
+ interface AircraftBlock {
197
+ type: "aircraftBlock";
198
+ id: number;
199
+ airplane_id: number;
200
+ company_id: number;
201
+ starts_at: string;
202
+ ends_at: string;
203
+ reason: AircraftBlockReason;
204
+ note: string | null;
205
+ is_maintenance: boolean;
206
+ maintenance_event_id: number | null;
207
+ created_at: string;
208
+ updated_at: string;
209
+ can?: Record<string, boolean | null>;
210
+ }
211
+
212
+ type BackgroundTaskStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
213
+ interface BackgroundTask<TResult = unknown> {
214
+ type: "background_task";
215
+ /** Store key — mirrors `uuid` (the API has no client-facing integer id). */
216
+ id: string;
217
+ uuid: string;
218
+ task_type: string;
219
+ status: BackgroundTaskStatus;
220
+ progress: number | null;
221
+ progress_label: string | null;
222
+ company_id: number | null;
223
+ user_id: number | null;
224
+ result: TResult | null;
225
+ error: string | null;
226
+ started_at: string | null;
227
+ finished_at: string | null;
228
+ created_at: string | null;
229
+ }
230
+
231
+ type AiSuggestionStatus = "pending" | "ready" | "applied" | "dismissed" | "failed";
232
+ interface AiSuggestion<TPayload = unknown> {
233
+ type: "ai_suggestion";
234
+ id: number;
235
+ subject_type: string;
236
+ subject_id: number;
237
+ company_id: number | null;
238
+ suggestion_type: string;
239
+ locale: string;
240
+ payload: TPayload;
241
+ meta?: unknown;
242
+ status: AiSuggestionStatus;
243
+ requested_by: number | null;
244
+ applied_at: string | null;
245
+ dismissed_at: string | null;
246
+ created_at: string;
247
+ }
248
+ interface AiSuggestedMilestone {
249
+ name: string;
250
+ description?: string | null;
251
+ kind: "progress" | "prerequisite" | "solo" | "cross_country";
252
+ is_prerequisite: boolean;
253
+ sort_order: number;
254
+ }
255
+ interface CourseDescriptionSuggestionPayload {
256
+ title: string;
257
+ subtitle: string;
258
+ summary: string;
259
+ html: string;
260
+ milestones: AiSuggestedMilestone[];
261
+ }
262
+ interface LogbookFlightLogPayload {
263
+ etdZ: string | null;
264
+ etaZ: string | null;
265
+ departure_airport_id: number | null;
266
+ destination_airport_id: number | null;
267
+ departure_airport_icao: string | null;
268
+ destination_airport_icao: string | null;
269
+ full_stop_landings: number;
270
+ touch_and_gos: number;
271
+ low_approaches: number;
272
+ crew_assignments: {
273
+ membership_id: number;
274
+ role: string;
275
+ }[];
276
+ membership_id: number | null;
277
+ }
278
+ interface LogbookSuggestionMeta {
279
+ flags?: string[];
280
+ match?: {
281
+ confidence: string;
282
+ reasoning: string;
283
+ };
284
+ extraction?: {
285
+ valid: boolean | null;
286
+ discrepancy_minutes: number | null;
287
+ };
288
+ crew_text?: string | null;
289
+ }
290
+ type LogbookSuggestion = AiSuggestion<LogbookFlightLogPayload> & {
291
+ meta?: LogbookSuggestionMeta;
292
+ };
293
+ interface DiscardedRow {
294
+ reason: string;
295
+ flight: Record<string, unknown>;
296
+ }
297
+ interface LogbookStageResult {
298
+ booking_id: number;
299
+ suggestion_ids: number[];
300
+ staged: number;
301
+ routed: Record<string, number> | number[];
302
+ discarded: DiscardedRow[];
303
+ }
304
+
305
+ interface RoleListItem {
306
+ id: number;
307
+ name: string;
308
+ description: string | null;
309
+ is_system: boolean;
310
+ has_duties: boolean;
311
+ company_id: number | null;
312
+ permissions_count: number;
313
+ }
314
+ interface PermissionItem {
315
+ id: number;
316
+ name: string;
317
+ description: string | null;
318
+ group: string;
319
+ }
320
+ interface RoleDetail extends Omit<RoleListItem, "permissions_count"> {
321
+ permissions: PermissionItem[];
322
+ }
323
+ interface GroupedPermissions {
324
+ [group: string]: PermissionItem[];
325
+ }
326
+
327
+ interface LandingFeeTemplateParams {
328
+ landing_type: "FULLSTOP" | "TOUCHANDGO" | "LOWAPPROACH";
329
+ net_gross: "net" | "gross";
330
+ valid_from: string;
331
+ tax_percentage?: number;
332
+ approach_type_id?: number;
333
+ }
334
+ interface LandingFeeImportResult {
335
+ created: number;
336
+ updated: number;
337
+ unchanged: number;
338
+ prices_added: number;
339
+ skipped: number;
340
+ issues: string[];
341
+ preview: Array<[
342
+ string,
343
+ string,
344
+ string,
345
+ string,
346
+ string,
347
+ "new" | "update" | "unchanged"
348
+ ]>;
349
+ meta: {
350
+ landing_type: string;
351
+ approach_type_id: number;
352
+ net_gross: string;
353
+ tax_percentage: number;
354
+ valid_from: string;
355
+ };
356
+ }
357
+ interface LandingFeeInvoicePreviewRow {
358
+ registration: string;
359
+ airplane_id: number | null;
360
+ fee_type: string;
361
+ landing_type: string | null;
362
+ unit_price: number;
363
+ price_basis: "net" | "gross";
364
+ vat_rate: number | null;
365
+ net_total: number | null;
366
+ gross_total: number | null;
367
+ current_price: number | null;
368
+ current_net_total: number | null;
369
+ current_gross_total: number | null;
370
+ date: string | null;
371
+ start_time: string | null;
372
+ landing_time: string | null;
373
+ status: "new" | "changed" | "unchanged" | "unmatched-aircraft" | "unmapped-fee-type" | "airport-unknown";
374
+ }
375
+ interface LandingFeeInvoicePreview {
376
+ rejected: boolean;
377
+ message: string | null;
378
+ company_id: number;
379
+ airport: {
380
+ id: number;
381
+ ident: string;
382
+ name: string;
383
+ } | null;
384
+ invoice: {
385
+ number: string | null;
386
+ date: string | null;
387
+ currency: string | null;
388
+ issuing_airport_name: string | null;
389
+ suggested_airport_icao_ident: string | null;
390
+ };
391
+ landing_fee_rows: LandingFeeInvoicePreviewRow[];
392
+ other_fees: Array<Record<string, unknown>>;
393
+ warnings: Array<{
394
+ type: string;
395
+ message: string;
396
+ }>;
397
+ }
398
+ interface LandingFeeInvoiceApplyPayload {
399
+ airport_id: number;
400
+ valid_from: string;
401
+ tax_percentage: number;
402
+ approach_type_id: number;
403
+ rows: Array<{
404
+ airplane_id: number;
405
+ landing_type: string;
406
+ unit_price: number;
407
+ price_basis: "net" | "gross";
408
+ vat_rate: number | null;
409
+ }>;
410
+ }
411
+ interface LandingFeeInvoiceApplyResult {
412
+ created: number;
413
+ updated: number;
414
+ unchanged: number;
415
+ prices_added: number;
416
+ issues: string[];
417
+ }
418
+
419
+ export type { Address, AiSuggestedMilestone, AiSuggestion, AiSuggestionStatus, AircraftBlock, AircraftBlockReason, 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, PaginatedResponse, PermissionItem, Post, PrePaidPackage, Price, Qualification, RecurringFlight, ResolveAirplaneIssueInput, Resource, Role, RoleDetail, RoleListItem, Runway, ScheduledFlight, Setting, SpecialFlight, Tag, Ticket, ToggleFavoriteResponse, UpdateAirplaneIssueInput, UpdateCommentInput, UpdatePostInput, User, UserAircraftRating, UserQualification, Waypoint };
@@ -1 +1 @@
1
- import "../chunk-LXNCAKJZ.js";
1
+ import "../chunk-2WJHTRIE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@updraft-solutions/mcrit-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.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": {