@updraft-solutions/mcrit-sdk 0.16.0 → 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-4T3JURL3.js → chunk-Q2UPZUCE.js} +71 -1
- package/dist/{chunk-7HPJT4VX.cjs → chunk-RKSVNZQ7.cjs} +71 -1
- package/dist/{fbo-TbdcUaI9.d.cts → conversation-CJlHvwCn.d.cts} +17623 -17379
- package/dist/{fbo-TbdcUaI9.d.ts → conversation-CJlHvwCn.d.ts} +17623 -17379
- package/dist/index.cjs +26 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +75 -59
- package/dist/schemas/index.cjs +18 -2
- package/dist/schemas/index.d.cts +196 -196
- package/dist/schemas/index.d.ts +196 -196
- package/dist/schemas/index.js +17 -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/index.ts +1 -0
- 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
|
@@ -120,6 +120,14 @@ import {
|
|
|
120
120
|
companyIdentitySchema,
|
|
121
121
|
companySchema,
|
|
122
122
|
contactAttributeSchema,
|
|
123
|
+
conversationKindSchema,
|
|
124
|
+
conversationMessageSchema,
|
|
125
|
+
conversationMessageSentEventSchema,
|
|
126
|
+
conversationParticipantSchema,
|
|
127
|
+
conversationReadEventSchema,
|
|
128
|
+
conversationRecipientSchema,
|
|
129
|
+
conversationSchema,
|
|
130
|
+
conversationUnreadSummarySchema,
|
|
123
131
|
courseCheckSyllabusSchema,
|
|
124
132
|
courseEnrollmentMetricsSchema,
|
|
125
133
|
courseEnrollmentMilestoneSchema,
|
|
@@ -253,7 +261,7 @@ import {
|
|
|
253
261
|
zMoneyObject,
|
|
254
262
|
zNetGross,
|
|
255
263
|
zNullableBool
|
|
256
|
-
} from "../chunk-
|
|
264
|
+
} from "../chunk-Q2UPZUCE.js";
|
|
257
265
|
export {
|
|
258
266
|
ALLOWED_GEOMETRY_TYPES,
|
|
259
267
|
ALLOWED_NEWSLETTER_VARIABLES,
|
|
@@ -376,6 +384,14 @@ export {
|
|
|
376
384
|
companyIdentitySchema,
|
|
377
385
|
companySchema,
|
|
378
386
|
contactAttributeSchema,
|
|
387
|
+
conversationKindSchema,
|
|
388
|
+
conversationMessageSchema,
|
|
389
|
+
conversationMessageSentEventSchema,
|
|
390
|
+
conversationParticipantSchema,
|
|
391
|
+
conversationReadEventSchema,
|
|
392
|
+
conversationRecipientSchema,
|
|
393
|
+
conversationSchema,
|
|
394
|
+
conversationUnreadSummarySchema,
|
|
379
395
|
courseCheckSyllabusSchema,
|
|
380
396
|
courseEnrollmentMetricsSchema,
|
|
381
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,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
|