@updraft-solutions/mcrit-sdk 0.15.2 → 0.17.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-C2S2RM6I.js → chunk-Q2UPZUCE.js} +110 -3
- package/dist/{chunk-JNHPVGJJ.cjs → chunk-RKSVNZQ7.cjs} +110 -3
- package/dist/{fbo-8TJiRqg1.d.cts → conversation-CJlHvwCn.d.cts} +17625 -17380
- package/dist/{fbo-8TJiRqg1.d.ts → conversation-CJlHvwCn.d.ts} +17625 -17380
- package/dist/index.cjs +38 -10
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +87 -59
- package/dist/schemas/index.cjs +30 -2
- package/dist/schemas/index.d.cts +2052 -127
- package/dist/schemas/index.d.ts +2052 -127
- package/dist/schemas/index.js +29 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +11 -2
- package/dist/types/index.d.ts +11 -2
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -0
- package/src/schemas/conversation.spec.ts +127 -0
- package/src/schemas/conversation.ts +74 -0
- package/src/schemas/form-template.ts +1 -0
- package/src/schemas/index.ts +2 -0
- package/src/schemas/system-contract.spec.ts +54 -0
- package/src/schemas/system-contract.ts +37 -0
- package/src/schemas/todo.ts +5 -1
- package/src/types/conversation.ts +11 -0
- package/src/types/index.ts +1 -0
- /package/dist/{chunk-CJHCF4FW.cjs → chunk-EWXSZOUI.cjs} +0 -0
- /package/dist/{chunk-ASPK4M5R.js → chunk-WCQXIIQB.js} +0 -0
package/dist/schemas/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
AudienceBucketType,
|
|
8
8
|
BaseModel,
|
|
9
9
|
ButtonBlockSchema,
|
|
10
|
+
CompanySystemContractsResponseSchema,
|
|
10
11
|
CompanyUsersBucketSchema,
|
|
11
12
|
CourseMilestoneFormSchema,
|
|
12
13
|
CourseMilestoneKindEnum,
|
|
@@ -75,10 +76,15 @@ import {
|
|
|
75
76
|
SubmissionFileSchema,
|
|
76
77
|
SubmitFaqQuestionSchema,
|
|
77
78
|
SyllabusKindEnum,
|
|
79
|
+
SystemContractRegisterEntrySchema,
|
|
80
|
+
SystemContractRegisterResponseSchema,
|
|
81
|
+
SystemContractRegisterRowSchema,
|
|
82
|
+
SystemContractStateSchema,
|
|
78
83
|
TemplateSchemaSchema,
|
|
79
84
|
TipTapNodeSchema,
|
|
80
85
|
TodoActionSchema,
|
|
81
86
|
TodoKey,
|
|
87
|
+
TodoPrioritySchema,
|
|
82
88
|
TodoSchema,
|
|
83
89
|
TrainingElementFormSchema,
|
|
84
90
|
TrainingElementKindEnum,
|
|
@@ -114,6 +120,14 @@ import {
|
|
|
114
120
|
companyIdentitySchema,
|
|
115
121
|
companySchema,
|
|
116
122
|
contactAttributeSchema,
|
|
123
|
+
conversationKindSchema,
|
|
124
|
+
conversationMessageSchema,
|
|
125
|
+
conversationMessageSentEventSchema,
|
|
126
|
+
conversationParticipantSchema,
|
|
127
|
+
conversationReadEventSchema,
|
|
128
|
+
conversationRecipientSchema,
|
|
129
|
+
conversationSchema,
|
|
130
|
+
conversationUnreadSummarySchema,
|
|
117
131
|
courseCheckSyllabusSchema,
|
|
118
132
|
courseEnrollmentMetricsSchema,
|
|
119
133
|
courseEnrollmentMilestoneSchema,
|
|
@@ -247,7 +261,7 @@ import {
|
|
|
247
261
|
zMoneyObject,
|
|
248
262
|
zNetGross,
|
|
249
263
|
zNullableBool
|
|
250
|
-
} from "../chunk-
|
|
264
|
+
} from "../chunk-Q2UPZUCE.js";
|
|
251
265
|
export {
|
|
252
266
|
ALLOWED_GEOMETRY_TYPES,
|
|
253
267
|
ALLOWED_NEWSLETTER_VARIABLES,
|
|
@@ -257,6 +271,7 @@ export {
|
|
|
257
271
|
AudienceBucketType,
|
|
258
272
|
BaseModel,
|
|
259
273
|
ButtonBlockSchema,
|
|
274
|
+
CompanySystemContractsResponseSchema,
|
|
260
275
|
CompanyUsersBucketSchema,
|
|
261
276
|
CourseMilestoneFormSchema,
|
|
262
277
|
CourseMilestoneKindEnum,
|
|
@@ -325,10 +340,15 @@ export {
|
|
|
325
340
|
SubmissionFileSchema,
|
|
326
341
|
SubmitFaqQuestionSchema,
|
|
327
342
|
SyllabusKindEnum,
|
|
343
|
+
SystemContractRegisterEntrySchema,
|
|
344
|
+
SystemContractRegisterResponseSchema,
|
|
345
|
+
SystemContractRegisterRowSchema,
|
|
346
|
+
SystemContractStateSchema,
|
|
328
347
|
TemplateSchemaSchema,
|
|
329
348
|
TipTapNodeSchema,
|
|
330
349
|
TodoActionSchema,
|
|
331
350
|
TodoKey,
|
|
351
|
+
TodoPrioritySchema,
|
|
332
352
|
TodoSchema,
|
|
333
353
|
TrainingElementFormSchema,
|
|
334
354
|
TrainingElementKindEnum,
|
|
@@ -364,6 +384,14 @@ export {
|
|
|
364
384
|
companyIdentitySchema,
|
|
365
385
|
companySchema,
|
|
366
386
|
contactAttributeSchema,
|
|
387
|
+
conversationKindSchema,
|
|
388
|
+
conversationMessageSchema,
|
|
389
|
+
conversationMessageSentEventSchema,
|
|
390
|
+
conversationParticipantSchema,
|
|
391
|
+
conversationReadEventSchema,
|
|
392
|
+
conversationRecipientSchema,
|
|
393
|
+
conversationSchema,
|
|
394
|
+
conversationUnreadSummarySchema,
|
|
367
395
|
courseCheckSyllabusSchema,
|
|
368
396
|
courseEnrollmentMetricsSchema,
|
|
369
397
|
courseEnrollmentMilestoneSchema,
|
package/dist/types/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('../chunk-
|
|
1
|
+
"use strict";require('../chunk-EWXSZOUI.cjs');
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { aE as activitySchema, aF as addressSchema, aG as aircraftPositionSchema, aH as aircraftRatingSchema, aM as airplaneSchema, aL as airplanePermissionSchema, aN as airplaneShareInviteSchema, aO as airportSchema, aP as alertSchema, aQ as allowedDocumentTypeSchema, aR as approachTypeSchema, aS as availSchema, aT as baseMembershipSchema, aV as bookingSchema, aX as commentSchema, aZ as companySchema,
|
|
2
|
+
import { aE as activitySchema, aF as addressSchema, aG as aircraftPositionSchema, aH as aircraftRatingSchema, aM as airplaneSchema, aL as airplanePermissionSchema, aN as airplaneShareInviteSchema, aO as airportSchema, aP as alertSchema, aQ as allowedDocumentTypeSchema, aR as approachTypeSchema, aS as availSchema, aT as baseMembershipSchema, aV as bookingSchema, aX as commentSchema, aZ as companySchema, bb as courseSchema, b9 as courseEnrollmentSchema, ba as courseFeeSchema, aJ as airplaneIssueSeverityEnum, bh as documentSchema, bd as documentComplianceStatus, be as documentRequirement, bf as documentRequirementGroup, bg as documentRequirementGroupAssignment, bi as documentShareSchema, bj as documentType, bl as eventSchema, bn as expenseSchema, bm as expenseItemSchema, bo as extendedAirplaneSchema, c8 as feeSchema, c7 as feeCategoryOptionsSchema, c9 as flightLogSchema, ce as flightRequestSchema, ca as flightRequestAvailabilitySchema, cb as flightRequestBusyIntervalSchema, cc as flightRequestResponseSchema, cd as flightRequestResponseStatusSchema, cf as flightRequestSeatSchema, cg as flightRequestStatusSchema, ch as flightRequestWindowSchema, cp as invoiceSchema, cr as landingSchema, cq as landingFeeSchema, ct as maintenanceEventSchema, cs as maintenanceEventEstimationSchema, cu as maintenanceStatusSchema, cv as mediaCollection, cy as membershipSchema, cz as membershipSignupSchema, cB as postSchema, cC as postSubjectSchema, cE as prePaidPackageSchema, cF as priceSchema, cG as qualificationSchema, cH as recurringFlightSchema, cI as roleSchema, cJ as runwaySchema, cK as scheduledFlightSchema, cL as settingSchema, cM as specialFlightSchema, cT as tagSchema, cU as teachingPermissionSchema, cV as ticketSchema, d3 as userSchema, d1 as userAircraftRatingSchema, d2 as userQualificationSchema, d4 as waypointSchema, aI as airplaneIssueSchema, aK as airplaneIssueStatusEnum, B as BaseModel$1, b7 as courseCheckSyllabusSchema, b8 as courseEnrollmentMetricsSchema, cw as mediaSchema, n as FormSubmission, bp as fboAcceptanceAxisSchema, bq as fboAcceptanceStatusSchema, bt as fboActivitySchema, br as fboActivityCauserSchema, bs as fboActivityChangesSchema, by as fboCompanySchema, bv as fboCompanyGrantSchema, bu as fboCompanyGrantInputSchema, bw as fboCompanyMemberSchema, bx as fboCompanyProfileSchema, bB as fboDecisionSchema, bz as fboDecisionAxisSchema, bA as fboDecisionInputSchema, bD as fboDutySchema, bC as fboDutyAffectedSchema, bE as fboDutySeriesResponseSchema, bH as fboFlightSchema, bG as fboFlightDocumentSchema, bI as fboFlightStatusSchema, bJ as fboFlightTypeSchema, bL as fboGrantAbilitySchema, bK as fboGrantAbilityOptionSchema, bM as fboGrantCompanyRefSchema, bN as fboGroundServicesSchema, bO as fboLandingsSummarySchema, bP as fboMaterialiseResultSchema, bQ as fboMetaSchema, bR as fboNextDutySchema, bS as fboOccupationSchema, bT as fboOperationsSchema, bU as fboPersonSchema, bV as fboPobSchema, bW as fboRecurrenceSchema, bX as fboRecurrenceTypeSchema, bY as fboRecurringFlightSchema, bZ as fboRoleSchema, b$ as fboStatisticsSchema, c0 as fboSystemRoleSchema, c1 as fboTrafficLayerInputSchema, c2 as fboTrafficRowSchema, c4 as fboTrafficSourceSchema, c5 as fboVisibilitySchema, c6 as fboWeeklyLandingSchema, b5 as conversationSchema, a$ as conversationKindSchema, b0 as conversationMessageSchema, b1 as conversationMessageSentEventSchema, b2 as conversationParticipantSchema, b3 as conversationReadEventSchema, b4 as conversationRecipientSchema, b6 as conversationUnreadSummarySchema } from '../conversation-CJlHvwCn.cjs';
|
|
3
3
|
|
|
4
4
|
type BaseModel = z.infer<typeof BaseModel$1>;
|
|
5
5
|
type User = z.infer<typeof userSchema>;
|
|
@@ -632,4 +632,13 @@ type FboCompanyGrantInput = z.infer<typeof fboCompanyGrantInputSchema>;
|
|
|
632
632
|
type FboMeta = z.infer<typeof fboMetaSchema>;
|
|
633
633
|
type FboCompany = z.infer<typeof fboCompanySchema>;
|
|
634
634
|
|
|
635
|
-
|
|
635
|
+
type ConversationKind = z.infer<typeof conversationKindSchema>;
|
|
636
|
+
type ConversationMessage = z.infer<typeof conversationMessageSchema>;
|
|
637
|
+
type ConversationParticipant = z.infer<typeof conversationParticipantSchema>;
|
|
638
|
+
type Conversation = z.infer<typeof conversationSchema>;
|
|
639
|
+
type ConversationRecipient = z.infer<typeof conversationRecipientSchema>;
|
|
640
|
+
type ConversationUnreadSummary = z.infer<typeof conversationUnreadSummarySchema>;
|
|
641
|
+
type ConversationMessageSentEvent = z.infer<typeof conversationMessageSentEventSchema>;
|
|
642
|
+
type ConversationReadEvent = z.infer<typeof conversationReadEventSchema>;
|
|
643
|
+
|
|
644
|
+
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, Conversation, ConversationKind, ConversationMessage, ConversationMessageSentEvent, ConversationParticipant, ConversationReadEvent, ConversationRecipient, ConversationUnreadSummary, Course, CourseCheckSyllabus, CourseDescriptionSuggestionPayload, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateAirplaneIssueInput, CreateCommentInput, CreatePostInput, DataWrappedResponse, DeferAirplaneIssueInput, DiscardedRow, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, FboAcceptanceAxis, FboAcceptanceStatus, FboActivity, FboActivityCauser, FboActivityChanges, FboCompany, FboCompanyGrant, FboCompanyGrantInput, FboCompanyMember, FboCompanyProfile, FboDecision, FboDecisionAxis, FboDecisionInput, FboDuty, FboDutyAffected, FboDutySeriesResponse, FboFlight, FboFlightDocument, FboFlightStatus, FboFlightType, FboGrantAbility, FboGrantAbilityOption, FboGrantCompanyRef, FboGroundServices, FboLandingsSummary, FboMaterialiseResult, FboMeta, FboNextDuty, FboOccupation, FboOperations, FboPerson, FboPob, FboRecurrence, FboRecurrenceType, FboRecurringFlight, FboRole, FboStatistics, FboSystemRole, FboTrafficLayerInput, FboTrafficRow, FboTrafficSource, FboVisibility, FboWeeklyLanding, Fee, FeeCategoryOptions, FlightLog, FlightRequest, FlightRequestAvailability, FlightRequestBusyInterval, FlightRequestResponse, FlightRequestResponseStatus, FlightRequestSeat, FlightRequestStatus, FlightRequestWindow, 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, TeachingPermission, Ticket, TimeAnchor, ToggleFavoriteResponse, UpdateAirplaneIssueInput, UpdateCommentInput, UpdatePostInput, User, UserAircraftRating, UserQualification, Waypoint };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { aE as activitySchema, aF as addressSchema, aG as aircraftPositionSchema, aH as aircraftRatingSchema, aM as airplaneSchema, aL as airplanePermissionSchema, aN as airplaneShareInviteSchema, aO as airportSchema, aP as alertSchema, aQ as allowedDocumentTypeSchema, aR as approachTypeSchema, aS as availSchema, aT as baseMembershipSchema, aV as bookingSchema, aX as commentSchema, aZ as companySchema,
|
|
2
|
+
import { aE as activitySchema, aF as addressSchema, aG as aircraftPositionSchema, aH as aircraftRatingSchema, aM as airplaneSchema, aL as airplanePermissionSchema, aN as airplaneShareInviteSchema, aO as airportSchema, aP as alertSchema, aQ as allowedDocumentTypeSchema, aR as approachTypeSchema, aS as availSchema, aT as baseMembershipSchema, aV as bookingSchema, aX as commentSchema, aZ as companySchema, bb as courseSchema, b9 as courseEnrollmentSchema, ba as courseFeeSchema, aJ as airplaneIssueSeverityEnum, bh as documentSchema, bd as documentComplianceStatus, be as documentRequirement, bf as documentRequirementGroup, bg as documentRequirementGroupAssignment, bi as documentShareSchema, bj as documentType, bl as eventSchema, bn as expenseSchema, bm as expenseItemSchema, bo as extendedAirplaneSchema, c8 as feeSchema, c7 as feeCategoryOptionsSchema, c9 as flightLogSchema, ce as flightRequestSchema, ca as flightRequestAvailabilitySchema, cb as flightRequestBusyIntervalSchema, cc as flightRequestResponseSchema, cd as flightRequestResponseStatusSchema, cf as flightRequestSeatSchema, cg as flightRequestStatusSchema, ch as flightRequestWindowSchema, cp as invoiceSchema, cr as landingSchema, cq as landingFeeSchema, ct as maintenanceEventSchema, cs as maintenanceEventEstimationSchema, cu as maintenanceStatusSchema, cv as mediaCollection, cy as membershipSchema, cz as membershipSignupSchema, cB as postSchema, cC as postSubjectSchema, cE as prePaidPackageSchema, cF as priceSchema, cG as qualificationSchema, cH as recurringFlightSchema, cI as roleSchema, cJ as runwaySchema, cK as scheduledFlightSchema, cL as settingSchema, cM as specialFlightSchema, cT as tagSchema, cU as teachingPermissionSchema, cV as ticketSchema, d3 as userSchema, d1 as userAircraftRatingSchema, d2 as userQualificationSchema, d4 as waypointSchema, aI as airplaneIssueSchema, aK as airplaneIssueStatusEnum, B as BaseModel$1, b7 as courseCheckSyllabusSchema, b8 as courseEnrollmentMetricsSchema, cw as mediaSchema, n as FormSubmission, bp as fboAcceptanceAxisSchema, bq as fboAcceptanceStatusSchema, bt as fboActivitySchema, br as fboActivityCauserSchema, bs as fboActivityChangesSchema, by as fboCompanySchema, bv as fboCompanyGrantSchema, bu as fboCompanyGrantInputSchema, bw as fboCompanyMemberSchema, bx as fboCompanyProfileSchema, bB as fboDecisionSchema, bz as fboDecisionAxisSchema, bA as fboDecisionInputSchema, bD as fboDutySchema, bC as fboDutyAffectedSchema, bE as fboDutySeriesResponseSchema, bH as fboFlightSchema, bG as fboFlightDocumentSchema, bI as fboFlightStatusSchema, bJ as fboFlightTypeSchema, bL as fboGrantAbilitySchema, bK as fboGrantAbilityOptionSchema, bM as fboGrantCompanyRefSchema, bN as fboGroundServicesSchema, bO as fboLandingsSummarySchema, bP as fboMaterialiseResultSchema, bQ as fboMetaSchema, bR as fboNextDutySchema, bS as fboOccupationSchema, bT as fboOperationsSchema, bU as fboPersonSchema, bV as fboPobSchema, bW as fboRecurrenceSchema, bX as fboRecurrenceTypeSchema, bY as fboRecurringFlightSchema, bZ as fboRoleSchema, b$ as fboStatisticsSchema, c0 as fboSystemRoleSchema, c1 as fboTrafficLayerInputSchema, c2 as fboTrafficRowSchema, c4 as fboTrafficSourceSchema, c5 as fboVisibilitySchema, c6 as fboWeeklyLandingSchema, b5 as conversationSchema, a$ as conversationKindSchema, b0 as conversationMessageSchema, b1 as conversationMessageSentEventSchema, b2 as conversationParticipantSchema, b3 as conversationReadEventSchema, b4 as conversationRecipientSchema, b6 as conversationUnreadSummarySchema } from '../conversation-CJlHvwCn.js';
|
|
3
3
|
|
|
4
4
|
type BaseModel = z.infer<typeof BaseModel$1>;
|
|
5
5
|
type User = z.infer<typeof userSchema>;
|
|
@@ -632,4 +632,13 @@ type FboCompanyGrantInput = z.infer<typeof fboCompanyGrantInputSchema>;
|
|
|
632
632
|
type FboMeta = z.infer<typeof fboMetaSchema>;
|
|
633
633
|
type FboCompany = z.infer<typeof fboCompanySchema>;
|
|
634
634
|
|
|
635
|
-
|
|
635
|
+
type ConversationKind = z.infer<typeof conversationKindSchema>;
|
|
636
|
+
type ConversationMessage = z.infer<typeof conversationMessageSchema>;
|
|
637
|
+
type ConversationParticipant = z.infer<typeof conversationParticipantSchema>;
|
|
638
|
+
type Conversation = z.infer<typeof conversationSchema>;
|
|
639
|
+
type ConversationRecipient = z.infer<typeof conversationRecipientSchema>;
|
|
640
|
+
type ConversationUnreadSummary = z.infer<typeof conversationUnreadSummarySchema>;
|
|
641
|
+
type ConversationMessageSentEvent = z.infer<typeof conversationMessageSentEventSchema>;
|
|
642
|
+
type ConversationReadEvent = z.infer<typeof conversationReadEventSchema>;
|
|
643
|
+
|
|
644
|
+
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, Conversation, ConversationKind, ConversationMessage, ConversationMessageSentEvent, ConversationParticipant, ConversationReadEvent, ConversationRecipient, ConversationUnreadSummary, Course, CourseCheckSyllabus, CourseDescriptionSuggestionPayload, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateAirplaneIssueInput, CreateCommentInput, CreatePostInput, DataWrappedResponse, DeferAirplaneIssueInput, DiscardedRow, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, FboAcceptanceAxis, FboAcceptanceStatus, FboActivity, FboActivityCauser, FboActivityChanges, FboCompany, FboCompanyGrant, FboCompanyGrantInput, FboCompanyMember, FboCompanyProfile, FboDecision, FboDecisionAxis, FboDecisionInput, FboDuty, FboDutyAffected, FboDutySeriesResponse, FboFlight, FboFlightDocument, FboFlightStatus, FboFlightType, FboGrantAbility, FboGrantAbilityOption, FboGrantCompanyRef, FboGroundServices, FboLandingsSummary, FboMaterialiseResult, FboMeta, FboNextDuty, FboOccupation, FboOperations, FboPerson, FboPob, FboRecurrence, FboRecurrenceType, FboRecurringFlight, FboRole, FboStatistics, FboSystemRole, FboTrafficLayerInput, FboTrafficRow, FboTrafficSource, FboVisibility, FboWeeklyLanding, Fee, FeeCategoryOptions, FlightLog, FlightRequest, FlightRequestAvailability, FlightRequestBusyInterval, FlightRequestResponse, FlightRequestResponseStatus, FlightRequestSeat, FlightRequestStatus, FlightRequestWindow, 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, TeachingPermission, Ticket, TimeAnchor, ToggleFavoriteResponse, UpdateAirplaneIssueInput, UpdateCommentInput, UpdatePostInput, User, UserAircraftRating, UserQualification, Waypoint };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-WCQXIIQB.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updraft-solutions/mcrit-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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": {
|
package/src/index.ts
CHANGED
|
@@ -180,6 +180,15 @@ export {
|
|
|
180
180
|
type FboCompanyGrantInput,
|
|
181
181
|
type FboMeta,
|
|
182
182
|
type FboCompany,
|
|
183
|
+
// types/conversation.ts
|
|
184
|
+
type ConversationKind,
|
|
185
|
+
type ConversationMessage,
|
|
186
|
+
type ConversationParticipant,
|
|
187
|
+
type Conversation,
|
|
188
|
+
type ConversationRecipient,
|
|
189
|
+
type ConversationUnreadSummary,
|
|
190
|
+
type ConversationMessageSentEvent,
|
|
191
|
+
type ConversationReadEvent,
|
|
183
192
|
} from "./types/index.js";
|
|
184
193
|
|
|
185
194
|
export * from "./money/index.js";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
conversationMessageSchema,
|
|
4
|
+
conversationMessageSentEventSchema,
|
|
5
|
+
conversationParticipantSchema,
|
|
6
|
+
conversationReadEventSchema,
|
|
7
|
+
conversationRecipientSchema,
|
|
8
|
+
conversationSchema,
|
|
9
|
+
conversationUnreadSummarySchema,
|
|
10
|
+
} from "./conversation";
|
|
11
|
+
|
|
12
|
+
const message = {
|
|
13
|
+
type: "conversation_message",
|
|
14
|
+
id: 13,
|
|
15
|
+
conversation_id: 11,
|
|
16
|
+
participant_id: 17,
|
|
17
|
+
body: "Hallo",
|
|
18
|
+
client_id: null,
|
|
19
|
+
created_at: "2026-10-01T10:00:00+00:00",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const participant = {
|
|
23
|
+
type: "conversation_participant",
|
|
24
|
+
id: 17,
|
|
25
|
+
membership_id: 20,
|
|
26
|
+
user_id: 5,
|
|
27
|
+
name: "Anna Beispiel",
|
|
28
|
+
is_me: true,
|
|
29
|
+
is_active: true,
|
|
30
|
+
last_read_message_id: 13,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
describe("conversation schemas", () => {
|
|
34
|
+
it("parses a conversation with participants and a last message", () => {
|
|
35
|
+
const parsed = conversationSchema.parse({
|
|
36
|
+
type: "conversation",
|
|
37
|
+
id: 11,
|
|
38
|
+
company_id: 7,
|
|
39
|
+
kind: "direct",
|
|
40
|
+
participants: [participant, { ...participant, id: 18, membership_id: 21, user_id: 6, is_me: false, last_read_message_id: null }],
|
|
41
|
+
last_message: message,
|
|
42
|
+
unread_count: 0,
|
|
43
|
+
last_message_at: "2026-10-01T10:00:00+00:00",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(parsed.participants).toHaveLength(2);
|
|
47
|
+
expect(parsed.last_message?.body).toBe("Hallo");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("parses an empty conversation", () => {
|
|
51
|
+
const parsed = conversationSchema.parse({
|
|
52
|
+
type: "conversation",
|
|
53
|
+
id: 11,
|
|
54
|
+
company_id: 7,
|
|
55
|
+
kind: "direct",
|
|
56
|
+
participants: [participant],
|
|
57
|
+
last_message: null,
|
|
58
|
+
unread_count: 0,
|
|
59
|
+
last_message_at: null,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
expect(parsed.last_message).toBeNull();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("parses a participant whose membership is gone and whose name is hidden", () => {
|
|
66
|
+
const parsed = conversationParticipantSchema.parse({
|
|
67
|
+
...participant,
|
|
68
|
+
membership_id: null,
|
|
69
|
+
name: null,
|
|
70
|
+
is_me: false,
|
|
71
|
+
is_active: false,
|
|
72
|
+
last_read_message_id: null,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
expect(parsed.membership_id).toBeNull();
|
|
76
|
+
expect(parsed.name).toBeNull();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("rejects an unknown conversation kind", () => {
|
|
80
|
+
expect(() =>
|
|
81
|
+
conversationSchema.parse({
|
|
82
|
+
type: "conversation",
|
|
83
|
+
id: 11,
|
|
84
|
+
company_id: 7,
|
|
85
|
+
kind: "broadcast",
|
|
86
|
+
participants: [],
|
|
87
|
+
last_message: null,
|
|
88
|
+
unread_count: 0,
|
|
89
|
+
last_message_at: null,
|
|
90
|
+
}),
|
|
91
|
+
).toThrow();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("drops contact data that a participant payload should never carry", () => {
|
|
95
|
+
const parsed = conversationParticipantSchema.parse({ ...participant, email: "anna@example.test", mobile: "+49 170 1" });
|
|
96
|
+
|
|
97
|
+
expect(parsed).not.toHaveProperty("email");
|
|
98
|
+
expect(parsed).not.toHaveProperty("mobile");
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("parses a message with a client id", () => {
|
|
102
|
+
const parsed = conversationMessageSchema.parse({ ...message, client_id: "0b6f6a0e-3c1b-4c0e-9d5e-2f0b8f6a1c11" });
|
|
103
|
+
|
|
104
|
+
expect(parsed.client_id).toBe("0b6f6a0e-3c1b-4c0e-9d5e-2f0b8f6a1c11");
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("requires a message timestamp", () => {
|
|
108
|
+
expect(() => conversationMessageSchema.parse({ ...message, created_at: null })).toThrow();
|
|
109
|
+
|
|
110
|
+
const { created_at: _dropped, ...withoutTimestamp } = message;
|
|
111
|
+
expect(() => conversationMessageSchema.parse(withoutTimestamp)).toThrow();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("parses a recipient and an unread summary row", () => {
|
|
115
|
+
expect(conversationRecipientSchema.parse({ type: "conversation_recipient", membership_id: 21, user_id: 6, name: "Ben Muster" }).name).toBe("Ben Muster");
|
|
116
|
+
expect(conversationUnreadSummarySchema.parse({ company_id: 7, unread_conversations: 2 }).unread_conversations).toBe(2);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("parses both realtime events", () => {
|
|
120
|
+
expect(conversationMessageSentEventSchema.parse({ company_id: 7, conversation_id: 11, message_id: 13, participant_id: 17 }).message_id).toBe(13);
|
|
121
|
+
expect(conversationReadEventSchema.parse({ company_id: 7, conversation_id: 11, participant_id: 17, last_read_message_id: 13 }).last_read_message_id).toBe(13);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("rejects a realtime event that carries no ids", () => {
|
|
125
|
+
expect(() => conversationMessageSentEventSchema.parse({ body: "Hallo" })).toThrow();
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Member messaging: private conversations between members of one company.
|
|
5
|
+
* No payload in this domain carries contact data of a participant.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const conversationKindSchema = z.enum(["direct"]);
|
|
9
|
+
|
|
10
|
+
export const conversationMessageSchema = z.object({
|
|
11
|
+
type: z.literal("conversation_message"),
|
|
12
|
+
id: z.number(),
|
|
13
|
+
conversation_id: z.number(),
|
|
14
|
+
/** The sending participant (not a membership: the participant outlives it). */
|
|
15
|
+
participant_id: z.number(),
|
|
16
|
+
body: z.string(),
|
|
17
|
+
/** Set by the sending client; the same id on a retry returns the stored message. */
|
|
18
|
+
client_id: z.string().nullable(),
|
|
19
|
+
created_at: z.string(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const conversationParticipantSchema = z.object({
|
|
23
|
+
type: z.literal("conversation_participant"),
|
|
24
|
+
id: z.number(),
|
|
25
|
+
/** Null once the person has left the company. */
|
|
26
|
+
membership_id: z.number().nullable(),
|
|
27
|
+
user_id: z.number(),
|
|
28
|
+
/** Null when the person hides their name from the viewer. */
|
|
29
|
+
name: z.string().nullable(),
|
|
30
|
+
is_me: z.boolean(),
|
|
31
|
+
/** False once the membership is gone or no longer confirmed — sending is rejected. */
|
|
32
|
+
is_active: z.boolean(),
|
|
33
|
+
/** Everything up to this message id is read by this participant. */
|
|
34
|
+
last_read_message_id: z.number().nullable(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const conversationSchema = z.object({
|
|
38
|
+
type: z.literal("conversation"),
|
|
39
|
+
id: z.number(),
|
|
40
|
+
company_id: z.number(),
|
|
41
|
+
kind: conversationKindSchema,
|
|
42
|
+
participants: z.array(conversationParticipantSchema),
|
|
43
|
+
last_message: conversationMessageSchema.nullable(),
|
|
44
|
+
/** Messages above the viewer's own read pointer. */
|
|
45
|
+
unread_count: z.number(),
|
|
46
|
+
last_message_at: z.string().nullable(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const conversationRecipientSchema = z.object({
|
|
50
|
+
type: z.literal("conversation_recipient"),
|
|
51
|
+
membership_id: z.number(),
|
|
52
|
+
user_id: z.number(),
|
|
53
|
+
name: z.string(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const conversationUnreadSummarySchema = z.object({
|
|
57
|
+
company_id: z.number(),
|
|
58
|
+
unread_conversations: z.number(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/** Realtime events carry ids only; the text is fetched through the API. */
|
|
62
|
+
export const conversationMessageSentEventSchema = z.object({
|
|
63
|
+
company_id: z.number(),
|
|
64
|
+
conversation_id: z.number(),
|
|
65
|
+
message_id: z.number(),
|
|
66
|
+
participant_id: z.number(),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const conversationReadEventSchema = z.object({
|
|
70
|
+
company_id: z.number(),
|
|
71
|
+
conversation_id: z.number(),
|
|
72
|
+
participant_id: z.number(),
|
|
73
|
+
last_read_message_id: z.number(),
|
|
74
|
+
});
|
package/src/schemas/index.ts
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { FormSubmissionSource } from "./form-template";
|
|
3
|
+
import {
|
|
4
|
+
CompanySystemContractsResponseSchema,
|
|
5
|
+
SystemContractRegisterResponseSchema,
|
|
6
|
+
} from "./system-contract";
|
|
7
|
+
import { TodoSchema } from "./todo";
|
|
8
|
+
|
|
9
|
+
describe("system contract schemas", () => {
|
|
10
|
+
it("parses the super-admin register", () => {
|
|
11
|
+
const parsed = SystemContractRegisterResponseSchema.parse({
|
|
12
|
+
data: [{
|
|
13
|
+
slug: "sys-contract-avv",
|
|
14
|
+
name: "Vertrag zur Auftragsverarbeitung (AVV)",
|
|
15
|
+
current_version: 2,
|
|
16
|
+
companies: [
|
|
17
|
+
{ company_id: 1, company_name: "A", state: "open", signed_version: 1, due_date: "2026-10-17", signed_at: null, signed_by: null, submission_id: 9 },
|
|
18
|
+
{ company_id: 2, company_name: "B", state: "not_issued", signed_version: null, due_date: null, signed_at: null, signed_by: null, submission_id: null },
|
|
19
|
+
],
|
|
20
|
+
}],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
expect(parsed.data[0].companies[0].state).toBe("open");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("rejects an unknown register state", () => {
|
|
27
|
+
expect(() => SystemContractRegisterResponseSchema.parse({
|
|
28
|
+
data: [{ slug: "s", name: "n", current_version: 1, companies: [
|
|
29
|
+
{ company_id: 1, company_name: "A", state: "lost", signed_version: null, due_date: null, signed_at: null, signed_by: null, submission_id: null },
|
|
30
|
+
] }],
|
|
31
|
+
})).toThrow();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("parses the company list envelope with its current versions", () => {
|
|
35
|
+
const parsed = CompanySystemContractsResponseSchema.parse({ data: [], meta: { current_versions: { "41": 2 } } });
|
|
36
|
+
|
|
37
|
+
expect(parsed.meta.current_versions["41"]).toBe(2);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("todo + source enums", () => {
|
|
42
|
+
it("accepts the critical priority and the ticket todo", () => {
|
|
43
|
+
const todo = TodoSchema.parse({
|
|
44
|
+
key: "handle_ticket", ref_type: "ticket", ref_id: 1, title: "t", priority: "critical",
|
|
45
|
+
action: { type: "navigate", target: "/" },
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
expect(todo.priority).toBe("critical");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("knows the system_contract submission source", () => {
|
|
52
|
+
expect(FormSubmissionSource.SystemContract).toBe("system_contract");
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FormSubmissionSchema } from "./form-template";
|
|
3
|
+
|
|
4
|
+
/** State of a company for the CURRENT version of a system contract. */
|
|
5
|
+
export const SystemContractStateSchema = z.enum(["signed", "open", "overdue", "not_issued"]);
|
|
6
|
+
export type SystemContractState = z.infer<typeof SystemContractStateSchema>;
|
|
7
|
+
|
|
8
|
+
export const SystemContractRegisterRowSchema = z.object({
|
|
9
|
+
company_id: z.number(),
|
|
10
|
+
company_name: z.string(),
|
|
11
|
+
state: SystemContractStateSchema,
|
|
12
|
+
/** Highest version this company ever signed — may be older than the current one. */
|
|
13
|
+
signed_version: z.number().nullable(),
|
|
14
|
+
due_date: z.string().nullable(),
|
|
15
|
+
signed_at: z.string().nullable(),
|
|
16
|
+
signed_by: z.string().nullable(),
|
|
17
|
+
submission_id: z.number().nullable(),
|
|
18
|
+
});
|
|
19
|
+
export type SystemContractRegisterRow = z.infer<typeof SystemContractRegisterRowSchema>;
|
|
20
|
+
|
|
21
|
+
export const SystemContractRegisterEntrySchema = z.object({
|
|
22
|
+
slug: z.string(),
|
|
23
|
+
name: z.string(),
|
|
24
|
+
current_version: z.number(),
|
|
25
|
+
companies: z.array(SystemContractRegisterRowSchema),
|
|
26
|
+
});
|
|
27
|
+
export type SystemContractRegisterEntry = z.infer<typeof SystemContractRegisterEntrySchema>;
|
|
28
|
+
|
|
29
|
+
export const SystemContractRegisterResponseSchema = z.object({
|
|
30
|
+
data: z.array(SystemContractRegisterEntrySchema),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const CompanySystemContractsResponseSchema = z.object({
|
|
34
|
+
data: z.array(FormSubmissionSchema),
|
|
35
|
+
meta: z.object({ current_versions: z.record(z.string(), z.number()) }),
|
|
36
|
+
});
|
|
37
|
+
export type CompanySystemContractsResponse = z.infer<typeof CompanySystemContractsResponseSchema>;
|
package/src/schemas/todo.ts
CHANGED
|
@@ -16,8 +16,12 @@ export const TodoKey = z.enum([
|
|
|
16
16
|
"share_document",
|
|
17
17
|
"fill_training_record",
|
|
18
18
|
"sign_training_record",
|
|
19
|
+
"handle_ticket",
|
|
19
20
|
]);
|
|
20
21
|
|
|
22
|
+
export const TodoPrioritySchema = z.enum(["critical", "high", "normal", "low"]);
|
|
23
|
+
export type TodoPriority = z.infer<typeof TodoPrioritySchema>;
|
|
24
|
+
|
|
21
25
|
export const TodoSchema = z.object({
|
|
22
26
|
key: TodoKey,
|
|
23
27
|
ref_type: z.string(),
|
|
@@ -26,7 +30,7 @@ export const TodoSchema = z.object({
|
|
|
26
30
|
subtitle: z.string().nullable().optional(),
|
|
27
31
|
due_date: z.string().nullable().optional(),
|
|
28
32
|
is_overdue: z.boolean().default(false),
|
|
29
|
-
priority:
|
|
33
|
+
priority: TodoPrioritySchema.default("normal"),
|
|
30
34
|
company_id: z.number().nullable().optional(),
|
|
31
35
|
action: TodoActionSchema,
|
|
32
36
|
meta: z.record(z.any()).optional(),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type * as Conversations from "../schemas/conversation";
|
|
3
|
+
|
|
4
|
+
export type ConversationKind = z.infer<typeof Conversations.conversationKindSchema>;
|
|
5
|
+
export type ConversationMessage = z.infer<typeof Conversations.conversationMessageSchema>;
|
|
6
|
+
export type ConversationParticipant = z.infer<typeof Conversations.conversationParticipantSchema>;
|
|
7
|
+
export type Conversation = z.infer<typeof Conversations.conversationSchema>;
|
|
8
|
+
export type ConversationRecipient = z.infer<typeof Conversations.conversationRecipientSchema>;
|
|
9
|
+
export type ConversationUnreadSummary = z.infer<typeof Conversations.conversationUnreadSummarySchema>;
|
|
10
|
+
export type ConversationMessageSentEvent = z.infer<typeof Conversations.conversationMessageSentEventSchema>;
|
|
11
|
+
export type ConversationReadEvent = z.infer<typeof Conversations.conversationReadEventSchema>;
|
package/src/types/index.ts
CHANGED
|
File without changes
|
|
File without changes
|