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