@joai/core 4.1.0 → 4.2.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/index.d.mts CHANGED
@@ -8,8 +8,8 @@ type SocialAuthProvider = 'github' | 'apple' | 'google' | 'x' | 'telegram' | 'sl
8
8
  type AppEnv = 'mainnet' | 'testnet' | 'devnet' | 'local';
9
9
  //#endregion
10
10
  //#region src/auth/token.d.ts
11
- /** One-time native/deep-link handoff param (exchanged for a Bearer via API). */
12
- declare const AUTH_CODE_PARAM = "auth_code";
11
+ /** One-time native/deep-link handoff fragment key (exchanged for a Bearer via POST). */
12
+ declare const NATIVE_AUTH_TOKEN_PARAM = "token";
13
13
  /** Login URL on the main app with a direct return URL (no mini-app callback). */
14
14
  declare const getLoginUrl: (env: AppEnv, returnTo: string, branding?: {
15
15
  team: string;
@@ -234,7 +234,6 @@ type UserPrivate = {
234
234
  socials: UserSocialAccount[];
235
235
  justCreated: boolean;
236
236
  affiliate: Affiliate | null;
237
- billingAddress: BillingAddress | null;
238
237
  betaRestricted: boolean;
239
238
  kyc?: Kyc | null;
240
239
  settings: UserSettings;
@@ -312,6 +311,7 @@ declare const NativeApps: {
312
311
  readonly Shop: "shop";
313
312
  readonly SmartLinks: "smart-links";
314
313
  readonly Contacts: "contacts";
314
+ readonly Forms: "forms";
315
315
  readonly Appointments: "appointments";
316
316
  readonly Workspace: "workspace";
317
317
  readonly Meeting: "meeting";
@@ -524,6 +524,162 @@ type AiCostsResponse = {
524
524
  };
525
525
  };
526
526
  //#endregion
527
+ //#region src/address/types.d.ts
528
+ type AddressType = 'shipping' | 'billing';
529
+ type Address = {
530
+ id: string;
531
+ type: AddressType;
532
+ name: string;
533
+ company: string | null;
534
+ addressOne: string;
535
+ addressTwo: string | null;
536
+ city: string;
537
+ state: string | null;
538
+ zipCode: string;
539
+ country: string;
540
+ phone: string | null;
541
+ isDefault: boolean;
542
+ business: boolean;
543
+ vatId: string | null;
544
+ isEU: boolean;
545
+ isEEA: boolean;
546
+ };
547
+ type AddressSnapshot = Pick<Address, 'name' | 'company' | 'addressOne' | 'addressTwo' | 'city' | 'state' | 'zipCode' | 'country' | 'phone' | 'business' | 'vatId'>;
548
+ type AddressInput = {
549
+ name: string;
550
+ addressOne: string;
551
+ city: string;
552
+ zipCode: string;
553
+ country: string;
554
+ type?: AddressType;
555
+ company?: string | null;
556
+ addressTwo?: string | null;
557
+ state?: string | null;
558
+ phone?: string | null;
559
+ business?: boolean;
560
+ vatId?: string | null;
561
+ };
562
+ type AddressCreatePayload = {
563
+ name: string;
564
+ country: string;
565
+ type?: AddressType;
566
+ email?: string | null;
567
+ company?: string | null;
568
+ addressOne?: string | null;
569
+ addressTwo?: string | null;
570
+ city?: string | null;
571
+ state?: string | null;
572
+ zipCode?: string | null;
573
+ vatId?: string | null;
574
+ phone?: string | null;
575
+ isDefault?: boolean;
576
+ contact?: string;
577
+ team?: string;
578
+ };
579
+ type AddressUpdatePayload = Partial<Omit<AddressCreatePayload, 'contact' | 'team'>>;
580
+ //#endregion
581
+ //#region src/commerce/types.d.ts
582
+ type FulfillmentMethod = 'shipping' | 'pickup';
583
+ type ShippingRate = {
584
+ id: number;
585
+ name: string;
586
+ price: number;
587
+ fee?: number;
588
+ freeShippingThreshold?: number | null;
589
+ minOrderValue?: number | null;
590
+ maxOrderValue?: number | null;
591
+ minWeight?: number | null;
592
+ maxWeight?: number | null;
593
+ estimatedMinDays?: number | null;
594
+ estimatedMaxDays?: number | null;
595
+ active?: boolean;
596
+ position?: number;
597
+ };
598
+ type CheckoutSnapshot = {
599
+ id: string;
600
+ fulfillmentMethod: FulfillmentMethod;
601
+ totals: {
602
+ subtotal: number;
603
+ shippingFee: number;
604
+ total: number;
605
+ };
606
+ expiresAt: string;
607
+ accessToken?: string | null;
608
+ };
609
+ type CheckoutSnapshotRequest = {
610
+ fulfillmentMethod: FulfillmentMethod;
611
+ items: {
612
+ id: string;
613
+ type: 'product' | 'service' | 'coupon';
614
+ quantity: number;
615
+ }[];
616
+ billingAddressId?: number | null;
617
+ shippingAddressId?: number | null;
618
+ billingAddress?: AddressInput;
619
+ shippingAddress?: AddressInput;
620
+ shippingRateId?: number | null;
621
+ fulfillmentLocationId?: number | null;
622
+ };
623
+ type ShippingZone = {
624
+ id: number;
625
+ name: string;
626
+ countries: string[];
627
+ postal_code_rules: string[] | null;
628
+ active: boolean;
629
+ position: number;
630
+ rates: ShippingRate[];
631
+ };
632
+ type FulfillmentLocation = {
633
+ id: number;
634
+ name: string;
635
+ address_id: number | null;
636
+ address: Address | null;
637
+ instructions: string | null;
638
+ active: boolean;
639
+ };
640
+ type FulfillmentStatus = 'pending' | 'ready_for_pickup' | 'shipped' | 'delivered' | 'cancelled';
641
+ type Fulfillment = {
642
+ id: string;
643
+ orderId: number;
644
+ method: FulfillmentMethod;
645
+ status: FulfillmentStatus;
646
+ carrierCode: string | null;
647
+ trackingNumber: string | null;
648
+ trackingUrl: string | null;
649
+ items: {
650
+ orderItemId: number;
651
+ quantity: number;
652
+ }[];
653
+ shippedAt: string | null;
654
+ readyForPickupAt: string | null;
655
+ deliveredAt: string | null;
656
+ };
657
+ type ReturnStatus = 'requested' | 'approved' | 'rejected' | 'received' | 'closed';
658
+ type Return = {
659
+ id: string;
660
+ orderId: number;
661
+ status: ReturnStatus;
662
+ reason: string;
663
+ merchantNote: string | null;
664
+ items: {
665
+ orderItemId: number;
666
+ quantity: number;
667
+ condition: string | null;
668
+ }[];
669
+ refundAmount: number | null;
670
+ };
671
+ type SubscriptionDelivery = {
672
+ fulfillmentMethod: FulfillmentMethod | null;
673
+ nextOrderAt: string | null;
674
+ pausedAt: string | null;
675
+ shippingAddress?: AddressSnapshot | null;
676
+ shippingRate?: Pick<ShippingRate, 'name' | 'price'> | null;
677
+ fulfillmentLocation?: {
678
+ name: string;
679
+ instructions: string | null;
680
+ } | null;
681
+ };
682
+ //#endregion
527
683
  //#region src/json/types.d.ts
528
684
  type JsonValue = string | number | boolean | null | JsonValue[] | {
529
685
  [key: string]: JsonValue;
@@ -653,7 +809,7 @@ type OrderType = 'order' | 'quote';
653
809
  type SubscriptionStatus = 'active' | 'canceled' | 'past_due' | 'pending';
654
810
  type SubscriptionInterval = 'weekly' | 'biweekly' | 'monthly' | 'quarterly' | 'yearly';
655
811
  type PricingModel = 'free' | 'one-time' | 'weekly' | 'biweekly' | 'monthly' | 'quarterly' | 'yearly' | 'per-run';
656
- type AppSubscription = {
812
+ type Subscription = {
657
813
  id: string;
658
814
  orderId: string;
659
815
  teamId: string;
@@ -666,6 +822,7 @@ type AppSubscription = {
666
822
  meta: Record<string, JsonValue> | null;
667
823
  createdAt: string;
668
824
  updatedAt: string;
825
+ delivery?: SubscriptionDelivery | null;
669
826
  };
670
827
  type PaymentProvider = 'xmoney' | 'lemonsqueezy' | 'stripe' | 'stripe-connect' | 'mollie' | 'mollie-connect' | 'apple' | 'google' | 'blockchain' | 'offline';
671
828
  type PaymentAccount = {
@@ -712,16 +869,6 @@ type PlanExtra = {
712
869
  price: number;
713
870
  unitName: string;
714
871
  };
715
- type BillingAddress = {
716
- name: string;
717
- addressOne: string | null;
718
- city: string | null;
719
- state: string | null;
720
- zipCode: string | null;
721
- country: string;
722
- vatId: string | null;
723
- isEU: boolean;
724
- };
725
872
  type PlanInterval = 'weekly' | 'monthly' | 'yearly' | 'lifetime';
726
873
  type Plan = {
727
874
  resource: 'plan';
@@ -896,6 +1043,17 @@ type Order = {
896
1043
  paymentMode: string | null;
897
1044
  linkVariationId: string | null;
898
1045
  notes: string | null;
1046
+ fulfillmentMethod?: FulfillmentMethod | null;
1047
+ address?: AddressSnapshot | null;
1048
+ shippingAddress?: AddressSnapshot | null;
1049
+ shippingRate?: Pick<ShippingRate, 'name' | 'price' | 'estimatedMinDays' | 'estimatedMaxDays'> | null;
1050
+ fulfillmentLocation?: {
1051
+ name: string;
1052
+ instructions?: string | null;
1053
+ } | null;
1054
+ shippingFee?: number;
1055
+ fulfillments?: Fulfillment[];
1056
+ subscription?: Subscription | null;
899
1057
  configuration?: OrderConfigurationItem[];
900
1058
  items: OrderItem[];
901
1059
  coupon?: Coupon | null;
@@ -957,7 +1115,7 @@ type PurchaseResult = {
957
1115
  };
958
1116
  type PurchaseOptions = {
959
1117
  forceProvider?: PaymentProvider;
960
- billingAddress?: BillingAddress | null;
1118
+ billingAddress?: AddressSnapshot | null;
961
1119
  meta?: Record<string, string>;
962
1120
  };
963
1121
  //#endregion
@@ -1696,7 +1854,8 @@ type Meeting = {
1696
1854
  captureMode: 'desktop_local' | null;
1697
1855
  transcriptUrl: string | null;
1698
1856
  summaryUrl: string | null;
1699
- participants?: MeetingParticipant[];
1857
+ participants?: MeetingParticipant[]; /** The customer associated with an appointment booking, when available. */
1858
+ contact?: Contact | null;
1700
1859
  speakerAssignments?: MeetingSpeakerAssignment[] | null;
1701
1860
  scheduledAt: string | null;
1702
1861
  calendarEventId: number | null;
@@ -1791,6 +1950,7 @@ type AppointmentPolicy = {
1791
1950
  bookingCapacity?: number | null;
1792
1951
  bookingCapacityUnit?: 'booking' | 'person' | null;
1793
1952
  requireApproval?: boolean | null;
1953
+ notificationEmail?: string | null;
1794
1954
  sync?: AppointmentPolicySync | null;
1795
1955
  agent?: Agent | null;
1796
1956
  agentUuid?: string | null;
@@ -1841,6 +2001,14 @@ type AppointmentRequest = {
1841
2001
  createdAt: string;
1842
2002
  };
1843
2003
  //#endregion
2004
+ //#region src/commerce/helpers.d.ts
2005
+ type CartLine = {
2006
+ price: number;
2007
+ quantity: number;
2008
+ };
2009
+ declare const cartLineTotal: <T extends CartLine>(items: T[]) => number;
2010
+ declare const isCompleteAddressInput: (address: Pick<AddressInput, "name" | "addressOne" | "city" | "zipCode" | "country">) => boolean;
2011
+ //#endregion
1844
2012
  //#region src/budget/types.d.ts
1845
2013
  type Budget = {
1846
2014
  id: number;
@@ -3803,4 +3971,4 @@ type CliSessionStatus = {
3803
3971
  meta: CliSessionMeta | null;
3804
3972
  };
3805
3973
  //#endregion
3806
- export { AUTH_CODE_PARAM, Achievement, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSimple, AgentWalletMode, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppEnv, AppFile, AppFileType, AppIngestion, AppSubscription, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentPolicySync, AppointmentRequest, AppointmentSlot, AuthUser, BillingAddress, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CalendarProvider, CalendarStatus, Campaign, CampaignApproval, CampaignCategory, CampaignChannel, CampaignCreatePayload, CampaignStats, CampaignStatus, CampaignUpdatePayload, Card, Cart, CartItem, Challenge, Challenges, ChangelogEntry, Character, ChatClientAction, ChatClientThought, ChatStreamData, ChatStreamEventType, CliSessionMeta, CliSessionStatus, CommissionAgreement, Configuration, Contact, ContactActivity, ContactActivityAuthor, ContactActivityType, ContactConsent, ContactConsentStatus, ContactCreatePayload, ContactFormData, ContactHealth, ContactViewable, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, CouponCondition, CouponRestrictedItem, CouponRestrictedItemType, CreateHookPayload, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, DefaultCodeMetadata, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, EarnResponse, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, HintOptions, HintPosition, Hook, HookSample, HookTrigger, HookTriggerCondition, HookTriggerInput, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationConnectionDetails, IntegrationDetails, IntegrationMeta, IntegrationType, Intent, Item, ItemCreatePayload, ItemExecutionStatus, ItemPriority, ItemStatus, ItemUpdatePayload, ItemViewable, JoaiUrls, JsonValue, KvEntry, KvEntryPayload, KvField, KvFieldWithEntries, KvValue, Kyc, KycStatus, Link, LinkCreatePayload, LinkScanHistory, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LocalAgentWallet, LoyaltyAccount, LoyaltyMember, LoyaltyNextTier, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyStatus, LoyaltyTier, LoyaltyTierInfo, LoyaltyTransaction, McpToolCall, McpToolCallBroadcast, McpToolCallStatus, Media, MediaAspectRatio, MediaAttributes, MediaItems, MediaLibraryAttributes, MediaMime, Meeting, MeetingConferenceProvider, MeetingFeature, MeetingJoinInfo, MeetingJoinTeam, MeetingParticipant, MeetingSessionState, MeetingSpeakerAssignment, MeetingStatus, MeetingSummary, MeetingTranscriptEntry, MeetingUsage, Memory, Message, MessageId, MessageRole, Milestone, MilestoneType, Mission, MissionBudget, MissionCreatePayload, MissionPlan, MissionPriority, MissionSchedule, MissionStatus, MissionViewable, MollieTerminalPaymentResult, MultimodalContent, MultimodalFile, NativeApp, NativeApps, Notification, NotificationAction, NotificationAgent, NotificationChannel, NotificationSetting, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, OgImageParams, OgImageType, Order, OrderConfigurationItem, OrderContext, OrderItem, OrderSource, OrderStatus, OrderType, PaginatedResponse, Pass, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PersonaQuestionable, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductDiscount, ProductMeta, ProductPieces, ProductRating, ProductRelation, ProductRelationType, ProductVariation, ProductVariationMeta, ProductVariationType, ProgramSettings, Project, ProjectAspectRatio, ProjectAssembly, ProjectCaptionStyle, ProjectClipCandidate, ProjectClips, ProjectExport, ProjectExportAsset, ProjectExportResponse, ProjectImages, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectPlan, ProjectRender, ProjectRenderMode, ProjectSelectedClip, ProjectShot, ProjectSoundtrack, ProjectSourceMedia, ProjectStatus, ProjectStudioHistoryEntry, ProjectStudioQuestion, ProjectStudioResponse, ProjectStudioStage, ProjectStudioState, ProjectStudioSummary, ProjectStyleDirection, ProjectTranscript, ProjectTranscriptSegment, Proposal, ProposalAction, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, ProposalPollOption, ProposalStatus, PublicFormResults, PurchaseOptions, PurchaseResult, RampProvider, RampProviderInfo, Reactions, RecentExperience, RedeemResponse, Reminder, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, Segment, SegmentCondition, SegmentConditionType, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, SegmentGroup, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, SetKvEntryResult, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, StampResponse, StoreAgent, StoreCheckoutItem, StoreData, StoreEntityType, StoreInfo, StoreItem, StoreListing, StorePriceTier, StorePricing, StorePurchasable, StorePurchaseResult, Streak, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, Swarm, Tag, TagType, Task, Team, TeamBrand, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamPayout, TeamPayoutAddress, TeamPlace, TeamPrivate, TeamSettings, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, Tier, TierFeature, TierName, ToggleKvFieldResult, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateStatus, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeSourceType, UpgradeStatus, User, UserInterest, UserMode, UserPrivate, UserRole, UserSettings, UserSocialAccount, UserStats, VolumePrice, Wallet, WalletList, WarpApprovable, WarpBackend, WarpBackendStatus, WarpBatchItem, WarpBatchable, WarpCloudExecutable, WarpCreateable, WarpExecutable, WarpExecutionBackend, WarpExtras, WarpExtrasFaq, WarpInputable, WarpScreenshotVariant, WarpSearchHit, WarpSelectable, WarpSelectableDetails, WarpSuggestion, WarpTestable, WarpViewable, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceContext, WorkspaceInfo, WorkspaceSettings, XIntegrationStatus, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, localize, nativeAppSlugs, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
3974
+ export { Achievement, Address, AddressCreatePayload, AddressInput, AddressSnapshot, AddressType, AddressUpdatePayload, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSimple, AgentWalletMode, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppEnv, AppFile, AppFileType, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentPolicySync, AppointmentRequest, AppointmentSlot, AuthUser, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CalendarProvider, CalendarStatus, Campaign, CampaignApproval, CampaignCategory, CampaignChannel, CampaignCreatePayload, CampaignStats, CampaignStatus, CampaignUpdatePayload, Card, Cart, CartItem, CartLine, Challenge, Challenges, ChangelogEntry, Character, ChatClientAction, ChatClientThought, ChatStreamData, ChatStreamEventType, CheckoutSnapshot, CheckoutSnapshotRequest, CliSessionMeta, CliSessionStatus, CommissionAgreement, Configuration, Contact, ContactActivity, ContactActivityAuthor, ContactActivityType, ContactConsent, ContactConsentStatus, ContactCreatePayload, ContactFormData, ContactHealth, ContactViewable, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, CouponCondition, CouponRestrictedItem, CouponRestrictedItemType, CreateHookPayload, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, DefaultCodeMetadata, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, EarnResponse, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, Fulfillment, FulfillmentLocation, FulfillmentMethod, FulfillmentStatus, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, HintOptions, HintPosition, Hook, HookSample, HookTrigger, HookTriggerCondition, HookTriggerInput, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationConnectionDetails, IntegrationDetails, IntegrationMeta, IntegrationType, Intent, Item, ItemCreatePayload, ItemExecutionStatus, ItemPriority, ItemStatus, ItemUpdatePayload, ItemViewable, JoaiUrls, JsonValue, KvEntry, KvEntryPayload, KvField, KvFieldWithEntries, KvValue, Kyc, KycStatus, Link, LinkCreatePayload, LinkScanHistory, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LocalAgentWallet, LoyaltyAccount, LoyaltyMember, LoyaltyNextTier, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyStatus, LoyaltyTier, LoyaltyTierInfo, LoyaltyTransaction, McpToolCall, McpToolCallBroadcast, McpToolCallStatus, Media, MediaAspectRatio, MediaAttributes, MediaItems, MediaLibraryAttributes, MediaMime, Meeting, MeetingConferenceProvider, MeetingFeature, MeetingJoinInfo, MeetingJoinTeam, MeetingParticipant, MeetingSessionState, MeetingSpeakerAssignment, MeetingStatus, MeetingSummary, MeetingTranscriptEntry, MeetingUsage, Memory, Message, MessageId, MessageRole, Milestone, MilestoneType, Mission, MissionBudget, MissionCreatePayload, MissionPlan, MissionPriority, MissionSchedule, MissionStatus, MissionViewable, MollieTerminalPaymentResult, MultimodalContent, MultimodalFile, NATIVE_AUTH_TOKEN_PARAM, NativeApp, NativeApps, Notification, NotificationAction, NotificationAgent, NotificationChannel, NotificationSetting, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, OgImageParams, OgImageType, Order, OrderConfigurationItem, OrderContext, OrderItem, OrderSource, OrderStatus, OrderType, PaginatedResponse, Pass, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PersonaQuestionable, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductDiscount, ProductMeta, ProductPieces, ProductRating, ProductRelation, ProductRelationType, ProductVariation, ProductVariationMeta, ProductVariationType, ProgramSettings, Project, ProjectAspectRatio, ProjectAssembly, ProjectCaptionStyle, ProjectClipCandidate, ProjectClips, ProjectExport, ProjectExportAsset, ProjectExportResponse, ProjectImages, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectPlan, ProjectRender, ProjectRenderMode, ProjectSelectedClip, ProjectShot, ProjectSoundtrack, ProjectSourceMedia, ProjectStatus, ProjectStudioHistoryEntry, ProjectStudioQuestion, ProjectStudioResponse, ProjectStudioStage, ProjectStudioState, ProjectStudioSummary, ProjectStyleDirection, ProjectTranscript, ProjectTranscriptSegment, Proposal, ProposalAction, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, ProposalPollOption, ProposalStatus, PublicFormResults, PurchaseOptions, PurchaseResult, RampProvider, RampProviderInfo, Reactions, RecentExperience, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, Segment, SegmentCondition, SegmentConditionType, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, SegmentGroup, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, SetKvEntryResult, ShippingRate, ShippingZone, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, StampResponse, StoreAgent, StoreCheckoutItem, StoreData, StoreEntityType, StoreInfo, StoreItem, StoreListing, StorePriceTier, StorePricing, StorePurchasable, StorePurchaseResult, Streak, Subscription, SubscriptionDelivery, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, Swarm, Tag, TagType, Task, Team, TeamBrand, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamPayout, TeamPayoutAddress, TeamPlace, TeamPrivate, TeamSettings, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, Tier, TierFeature, TierName, ToggleKvFieldResult, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateStatus, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeSourceType, UpgradeStatus, User, UserInterest, UserMode, UserPrivate, UserRole, UserSettings, UserSocialAccount, UserStats, VolumePrice, Wallet, WalletList, WarpApprovable, WarpBackend, WarpBackendStatus, WarpBatchItem, WarpBatchable, WarpCloudExecutable, WarpCreateable, WarpExecutable, WarpExecutionBackend, WarpExtras, WarpExtrasFaq, WarpInputable, WarpScreenshotVariant, WarpSearchHit, WarpSelectable, WarpSelectableDetails, WarpSuggestion, WarpTestable, WarpViewable, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceContext, WorkspaceInfo, WorkspaceSettings, XIntegrationStatus, abbreviateNumber, cartLineTotal, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isCompleteAddressInput, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, localize, nativeAppSlugs, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
package/dist/index.mjs CHANGED
@@ -58,8 +58,8 @@ const getSitesRootDomain = (env) => {
58
58
  const getSiteUrl = (env, teamSlug, brandSlug) => `https://${getSitesRootDomain(env)}/${teamSlug}/${brandSlug}`;
59
59
  //#endregion
60
60
  //#region src/auth/token.ts
61
- /** One-time native/deep-link handoff param (exchanged for a Bearer via API). */
62
- const AUTH_CODE_PARAM = "auth_code";
61
+ /** One-time native/deep-link handoff fragment key (exchanged for a Bearer via POST). */
62
+ const NATIVE_AUTH_TOKEN_PARAM = "token";
63
63
  /** Login URL on the main app with a direct return URL (no mini-app callback). */
64
64
  const getLoginUrl = (env, returnTo, branding) => {
65
65
  const params = new URLSearchParams({ redirect: returnTo });
@@ -282,6 +282,10 @@ function resolveWarpText(text, locale = "en") {
282
282
  return text[locale] ?? text.en ?? Object.values(text)[0] ?? "";
283
283
  }
284
284
  //#endregion
285
+ //#region src/commerce/helpers.ts
286
+ const cartLineTotal = (items) => items.reduce((total, item) => total + item.price * item.quantity, 0);
287
+ const isCompleteAddressInput = (address) => Boolean(address.name.trim() && address.addressOne.trim() && address.city.trim() && address.zipCode.trim() && address.country.trim());
288
+ //#endregion
285
289
  //#region src/budget/types.ts
286
290
  const PeriodTypeLabels = {
287
291
  0: "One-time",
@@ -402,6 +406,7 @@ const NativeApps = {
402
406
  Shop: "shop",
403
407
  SmartLinks: "smart-links",
404
408
  Contacts: "contacts",
409
+ Forms: "forms",
405
410
  Appointments: "appointments",
406
411
  Workspace: "workspace",
407
412
  Meeting: "meeting",
@@ -416,4 +421,4 @@ const NativeApps = {
416
421
  const nativeAppSlugs = Object.values(NativeApps);
417
422
  const isNativeApp = (value) => typeof value === "string" && nativeAppSlugs.includes(value);
418
423
  //#endregion
419
- export { AUTH_CODE_PARAM, ContractCategoryDisplayNames, DefaultCodeMetadata, HttpService, JoaiUrls, NativeApps, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OgImageColors, PeriodTypeLabels, PeriodTypeOptions, SkillMediaBindingRole, SkillScope, SkillType, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, localize, nativeAppSlugs, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
424
+ export { ContractCategoryDisplayNames, DefaultCodeMetadata, HttpService, JoaiUrls, NATIVE_AUTH_TOKEN_PARAM, NativeApps, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OgImageColors, PeriodTypeLabels, PeriodTypeOptions, SkillMediaBindingRole, SkillScope, SkillType, abbreviateNumber, cartLineTotal, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isCompleteAddressInput, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, localize, nativeAppSlugs, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/core",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "JoAi shared types, HTTP service, and config",
5
5
  "license": "MIT",
6
6
  "type": "module",