@joai/core 4.15.7 → 5.0.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
@@ -584,7 +584,7 @@ type Media = {
584
584
  };
585
585
  //#endregion
586
586
  //#region src/integration/types.d.ts
587
- type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'whatsapp-personal' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'xchat' | 'instagram' | 'facebook' | 'linkedin' | 'grok' | 'cloudflare' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
587
+ type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'whatsapp-personal' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'xchat' | 'instagram' | 'facebook' | 'linkedin' | 'grok' | 'cloudflare' | 'google-search-console' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
588
588
  type IntegrationDetails = {
589
589
  type: IntegrationType;
590
590
  name: string;
@@ -831,6 +831,7 @@ type MeetingStatus = 'active' | 'completed' | 'analyzed' | 'scheduled' | 'cancel
831
831
  type MeetingConferenceProvider = 'google_meet' | 'teams' | 'zoom';
832
832
  type MeetingFeature = 'transcription' | 'summary' | 'insights' | 'actions';
833
833
  type MeetingJoinTeam = {
834
+ slug: string;
834
835
  name: string;
835
836
  logo: string | null;
836
837
  };
@@ -1127,6 +1128,7 @@ declare const NativeApps: {
1127
1128
  readonly Social: "social";
1128
1129
  readonly Studio: "studio";
1129
1130
  readonly Loyalty: "loyalty";
1131
+ readonly Documents: "documents";
1130
1132
  };
1131
1133
  type NativeApp = (typeof NativeApps)[keyof typeof NativeApps];
1132
1134
  declare const nativeAppSlugs: NativeApp[];
@@ -1188,6 +1190,10 @@ type TeamMeta = {
1188
1190
  'shop.kiosk.enabled'?: boolean;
1189
1191
  'shop.stock.enabled'?: boolean;
1190
1192
  'shop.reorder.enabled'?: boolean;
1193
+ 'shop.legal.terms_url'?: string | null;
1194
+ 'shop.legal.privacy_url'?: string | null;
1195
+ 'shop.legal.withdrawal_url'?: string | null;
1196
+ 'shop.legal.imprint_url'?: string | null;
1191
1197
  'orders.notify_emails'?: string[];
1192
1198
  contactPropertyMaskWarp?: string;
1193
1199
  branding?: TeamBrand | null;
@@ -1311,6 +1317,10 @@ type TeamSettings = {
1311
1317
  'shop.kiosk.enabled'?: boolean;
1312
1318
  'shop.stock.enabled'?: boolean;
1313
1319
  'shop.reorder.enabled'?: boolean;
1320
+ 'shop.legal.terms_url'?: string | null;
1321
+ 'shop.legal.privacy_url'?: string | null;
1322
+ 'shop.legal.withdrawal_url'?: string | null;
1323
+ 'shop.legal.imprint_url'?: string | null;
1314
1324
  'orders.notify_emails'?: string[];
1315
1325
  branding?: TeamBrand | null;
1316
1326
  };
@@ -1525,9 +1535,23 @@ type ProductVariationMeta = {
1525
1535
  mpn?: string | null;
1526
1536
  condition?: 'new' | 'used' | 'refurbished';
1527
1537
  };
1538
+ type ProductDetailKind = 'kv' | 'text';
1539
+ type ProductDetailText = string | TranslatableValue;
1540
+ type ProductDetailRow = {
1541
+ label: ProductDetailText;
1542
+ value: ProductDetailText;
1543
+ };
1544
+ type ProductDetailSection = {
1545
+ key: string;
1546
+ title: ProductDetailText;
1547
+ kind: ProductDetailKind;
1548
+ text?: ProductDetailText;
1549
+ rows?: ProductDetailRow[];
1550
+ };
1528
1551
  type ProductMeta = {
1529
1552
  googleProductCategory?: number | null;
1530
1553
  brand?: string | null;
1554
+ details?: ProductDetailSection[];
1531
1555
  };
1532
1556
  type ProductVariation = {
1533
1557
  resource?: 'product-variation';
@@ -2417,7 +2441,7 @@ type AppointmentRequest = {
2417
2441
  };
2418
2442
  //#endregion
2419
2443
  //#region src/automation/types.d.ts
2420
- type AutomationTriggerType = 'prop' | 'segment' | 'manual' | 'webhook';
2444
+ type AutomationTriggerType = 'prop' | 'segment' | 'manual' | 'webhook' | 'site_monthly_report';
2421
2445
  type AutomationActionType = 'wait' | 'halt' | 'warp' | 'branch';
2422
2446
  type AutomationEnrollmentStatus = 'active' | 'completed' | 'skipped';
2423
2447
  type AutomationEnrollmentChange = 'created' | 'advanced' | 'sent' | 'completed' | 'skipped' | 'errored';
@@ -2628,7 +2652,47 @@ type PatchContentInput = {
2628
2652
  expectedVersion: number;
2629
2653
  patches: ContentPatch[];
2630
2654
  origin?: 'api' | 'inlineEditor' | 'joai' | 'mcp';
2655
+ publish?: boolean;
2656
+ };
2657
+ //#endregion
2658
+ //#region src/content/image-processing.d.ts
2659
+ type ImageDimensions = {
2660
+ width: number;
2661
+ height: number;
2662
+ };
2663
+ type ImageCropState = {
2664
+ x: number;
2665
+ y: number;
2666
+ zoom: number;
2667
+ };
2668
+ type ImageCropRectangle = {
2669
+ x: number;
2670
+ y: number;
2671
+ width: number;
2672
+ height: number;
2631
2673
  };
2674
+ type ImageDimensionRules = {
2675
+ minWidth?: number;
2676
+ minHeight?: number;
2677
+ maxWidth?: number;
2678
+ maxHeight?: number;
2679
+ maxPixels?: number;
2680
+ };
2681
+ type ImageCompressionOptions = {
2682
+ maxWidth?: number;
2683
+ maxHeight?: number;
2684
+ mimeType?: 'image/jpeg' | 'image/png' | 'image/webp';
2685
+ quality?: number;
2686
+ };
2687
+ type ImageCropOptions = {
2688
+ aspectRatio: number;
2689
+ outputWidth?: number;
2690
+ outputHeight?: number;
2691
+ };
2692
+ declare const validateImageDimensions: (dimensions: ImageDimensions, rules: ImageDimensionRules) => "too-small" | "too-large" | null;
2693
+ declare const imageCropRectangle: (dimensions: ImageDimensions, aspectRatio: number, crop: ImageCropState) => ImageCropRectangle;
2694
+ declare const containedImageDimensions: (source: ImageDimensions, options: ImageCompressionOptions) => ImageDimensions;
2695
+ declare const cropOutputDimensions: (source: ImageDimensions, options: ImageCropOptions, compression: ImageCompressionOptions) => ImageDimensions;
2632
2696
  //#endregion
2633
2697
  //#region src/address/formatAddressSnapshot.d.ts
2634
2698
  /** Accepts camelCase API snapshots and legacy snake_case stored snapshots. */
@@ -3180,7 +3244,7 @@ declare const buildMcpServerName: (slug: string, teamName?: string) => string;
3180
3244
  declare const buildAgentMcpServerName: (agentName: string, teamName?: string) => string;
3181
3245
  //#endregion
3182
3246
  //#region src/metric/types.d.ts
3183
- type MetricSource = 'cloudflare';
3247
+ type MetricSource = 'cloudflare' | 'google_search_console';
3184
3248
  type Metric = {
3185
3249
  key: string;
3186
3250
  value: number;
@@ -4841,4 +4905,4 @@ type CliSessionStatus = {
4841
4905
  meta: CliSessionMeta | null;
4842
4906
  };
4843
4907
  //#endregion
4844
- export { AUTOMATION_SEND_CHANNELS, Achievement, Address, AddressCreatePayload, AddressInput, AddressSnapshot, type AddressType, AddressTypes, AddressUpdatePayload, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSetupTarget, AgentSimple, AgentToolingAccess, AgentTrustedActionRule, AgentWalletMode, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppAccessRule, AppEnv, AppFile, AppFileType, AppIngestion, AppSetupTarget, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentPolicySync, AppointmentPolicyUpsert, AppointmentRequest, AppointmentSlot, Artifact, ArtifactBlock, ArtifactBlockType, ArtifactContactSummary, ArtifactCreatePayload, ArtifactDeliverIntegration, ArtifactDeliverPayload, ArtifactDelivery, ArtifactLink, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, Automation, AutomationAction, AutomationActionConfig, AutomationActionInput, AutomationActionType, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationEnrollmentChange, AutomationEnrollmentStatus, AutomationEnrollmentUpdatedPayload, AutomationSendChannel, AutomationSendChannelId, AutomationSkipReason, AutomationStats, AutomationTriggerConfig, AutomationTriggerType, AutomationUpdatePayload, BillingManageAccess, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CAMPAIGN_CHANNELS, CONTACT_MESSAGE_SEND_WARP, CalendarProvider, CalendarStatus, Campaign, CampaignApproval, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCategory, CampaignChannel, CampaignChannelId, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignSkipReason, CampaignSkipReasons, 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, ContactRelation, ContactRelationCategory, ContactRelationContact, ContactRelationDirection, ContactRelationPayload, ContactRelationType, ContactRelationUpdatePayload, ContactViewable, Content, ContentDefinition, ContentEntry, ContentField, ContentFieldType, ContentPatch, ContentStatus, ContentValue, ContentVersion, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, CouponCondition, CouponRestrictedItem, CouponRestrictedItemType, CreateContentInput, CreateHookPayload, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, DefaultAppLocale, DefaultCodeMetadata, DefaultInviteTeamRole, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, EarnResponse, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FeatureSetupTarget, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, Fulfillment, FulfillmentFlowAction, FulfillmentFlowStep, FulfillmentLocation, type FulfillmentMethod, FulfillmentMethods, type FulfillmentStatus, FulfillmentStatuses, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, GuestBuyer, HintOptions, HintPosition, Hook, HookSample, HookTrigger, HookTriggerCondition, HookTriggerInput, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationConnectionDetails, IntegrationDetails, IntegrationMeta, IntegrationType, Intent, InviteableTeamRoles, 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, Metric, MetricSource, MetricsResult, 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, ORDER_FULFILLMENT_STATUSES, ORDER_POST_CHECKOUT_STATUSES, OUTBOUND_CHANNELS, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, Order, OrderConfigurationItem, OrderContext, OrderItem, OrderPriceMode, OrderSource, OrderStatus, OrderStatusDisplay, OrderType, OutboundChannel, OutboundChannelId, PLATFORM_CURRENCY, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PermissionPresetName, PermissionPresetNames, PersonaQuestionable, PickupNextAction, 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, type ReturnStatus, ReturnStatuses, ReturnUpdateStatus, ReturnUpdateStatuses, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, Segment, SegmentCondition, SegmentConditionType, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, SegmentGroup, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, SetKvEntryResult, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingZone, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, SiteType, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreCheckoutItem, StoreData, StoreEntityType, StoreInfo, StoreItem, StoreListing, StorePriceTier, StorePricing, StorePurchasable, StorePurchaseResult, Streak, Subscription, SubscriptionDelivery, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, SupportedAppLocale, SupportedAppLocales, Swarm, Tag, TagType, Task, TaxBreakdownRow, TaxClass, Team, TeamAccessCatalog, TeamAccessConfig, TeamBrand, TeamCategory, TeamCurrencySource, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureAccess, TeamFeatureArea, TeamFeatureUsage, TeamManageAccess, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPlace, TeamPrivate, TeamSettings, TeamUsage, TeamViewAccess, TerminalConnectionToken, TerminalPaymentIntent, Tier, TierFeature, TierName, ToggleKvFieldResult, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, UNIFIED_MCP_SERVER_NAME, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateStatus, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeSourceType, UpgradeStatus, User, UserInterest, UserMode, type UserPermission, UserPermissions, UserPrivate, type UserRole, UserRoles, 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, addressTypeValues, automationSendChannel, buildAgentMcpServerName, buildAgentSetupClipboardText, buildAppSetupClipboardText, buildFeatureSetupClipboardText, buildMcpServerName, canOpenFulfillmentFlow, canTransitionOrderStatus, cartLineTotal, cartPayableTotal, createCursorMcpInstallLink, defaultInviteTeamRole, documentShareUrl, firstValidationMessage, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getDocumentsBaseUrl, getEditableOrderStatuses, getFormsBaseUrl, getFulfillmentFlowAction, getFulfillmentFlowStepperIndex, getGenBaseUrl, getInvoiceEditableStatuses, getLoginUrl, getMcpServerAgentUrl, getMcpServerUrl, getPickupEditableStatuses, getPickupNextAction, getShippingEditableStatuses, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, hasAllPermissions, hasAllTeamPermissions, hasAnyPermissions, hasPermission, hasTeamPermission, integrationSlugForChannel, inviteableTeamRoles, isAutomationSendChannelId, isCampaignChannelId, isCompleteAddressInput, isContactMessageAction, isContactMessageWarpId, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, isNativeAppAccessible, isNativeAppGated, isNativeAppLocked, isOrderCanceled, isOrderInFulfillment, isOrderPending, isOrderPostCheckout, isPickupOrderReady, isPickupReady, isSupportedAppLocale, isTeamFeatureAccessible, isTeamFeatureGated, isTeamFeatureLocked, isUnifiedMcpUrl, isUserRole, localize, nativeAppSlugs, normalizeAutomationActionType, ogImageUrl, outboundChannel, permissionPresetRules, resolveAccessCatalog, resolveAgentMcpUrl, resolveConnectMcpUrl, resolveFulfillmentFlowStep, resolveOrderStatusDisplay, resolveTeamCurrency, resolveWarpText, returnStatusValues, returnUpdateStatusValues, sanitizeAlphanumeric, sanitizeNumeric, slugifyMcpSegment, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, userPermissionValues, userRoleValues, validationMessageFor, withRetry };
4908
+ export { AUTOMATION_SEND_CHANNELS, Achievement, Address, AddressCreatePayload, AddressInput, AddressSnapshot, type AddressType, AddressTypes, AddressUpdatePayload, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSetupTarget, AgentSimple, AgentToolingAccess, AgentTrustedActionRule, AgentWalletMode, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppAccessRule, AppEnv, AppFile, AppFileType, AppIngestion, AppSetupTarget, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentPolicySync, AppointmentPolicyUpsert, AppointmentRequest, AppointmentSlot, Artifact, ArtifactBlock, ArtifactBlockType, ArtifactContactSummary, ArtifactCreatePayload, ArtifactDeliverIntegration, ArtifactDeliverPayload, ArtifactDelivery, ArtifactLink, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, Automation, AutomationAction, AutomationActionConfig, AutomationActionInput, AutomationActionType, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationEnrollmentChange, AutomationEnrollmentStatus, AutomationEnrollmentUpdatedPayload, AutomationSendChannel, AutomationSendChannelId, AutomationSkipReason, AutomationStats, AutomationTriggerConfig, AutomationTriggerType, AutomationUpdatePayload, BillingManageAccess, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CAMPAIGN_CHANNELS, CONTACT_MESSAGE_SEND_WARP, CalendarProvider, CalendarStatus, Campaign, CampaignApproval, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCategory, CampaignChannel, CampaignChannelId, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignSkipReason, CampaignSkipReasons, 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, ContactRelation, ContactRelationCategory, ContactRelationContact, ContactRelationDirection, ContactRelationPayload, ContactRelationType, ContactRelationUpdatePayload, ContactViewable, Content, ContentDefinition, ContentEntry, ContentField, ContentFieldType, ContentPatch, ContentStatus, ContentValue, ContentVersion, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, CouponCondition, CouponRestrictedItem, CouponRestrictedItemType, CreateContentInput, CreateHookPayload, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, DefaultAppLocale, DefaultCodeMetadata, DefaultInviteTeamRole, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, EarnResponse, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FeatureSetupTarget, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, Fulfillment, FulfillmentFlowAction, FulfillmentFlowStep, FulfillmentLocation, type FulfillmentMethod, FulfillmentMethods, type FulfillmentStatus, FulfillmentStatuses, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, GuestBuyer, HintOptions, HintPosition, Hook, HookSample, HookTrigger, HookTriggerCondition, HookTriggerInput, HttpService, IAppResponse, IHttpService, IRequestOptions, ImageCompressionOptions, ImageCropOptions, ImageCropRectangle, ImageCropState, ImageDimensionRules, ImageDimensions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationConnectionDetails, IntegrationDetails, IntegrationMeta, IntegrationType, Intent, InviteableTeamRoles, 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, Metric, MetricSource, MetricsResult, 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, ORDER_FULFILLMENT_STATUSES, ORDER_POST_CHECKOUT_STATUSES, OUTBOUND_CHANNELS, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, Order, OrderConfigurationItem, OrderContext, OrderItem, OrderPriceMode, OrderSource, OrderStatus, OrderStatusDisplay, OrderType, OutboundChannel, OutboundChannelId, PLATFORM_CURRENCY, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PermissionPresetName, PermissionPresetNames, PersonaQuestionable, PickupNextAction, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductDetailKind, ProductDetailRow, ProductDetailSection, ProductDetailText, 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, type ReturnStatus, ReturnStatuses, ReturnUpdateStatus, ReturnUpdateStatuses, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, Segment, SegmentCondition, SegmentConditionType, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, SegmentGroup, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, SetKvEntryResult, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingZone, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, SiteType, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreCheckoutItem, StoreData, StoreEntityType, StoreInfo, StoreItem, StoreListing, StorePriceTier, StorePricing, StorePurchasable, StorePurchaseResult, Streak, Subscription, SubscriptionDelivery, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, SupportedAppLocale, SupportedAppLocales, Swarm, Tag, TagType, Task, TaxBreakdownRow, TaxClass, Team, TeamAccessCatalog, TeamAccessConfig, TeamBrand, TeamCategory, TeamCurrencySource, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureAccess, TeamFeatureArea, TeamFeatureUsage, TeamManageAccess, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPlace, TeamPrivate, TeamSettings, TeamUsage, TeamViewAccess, TerminalConnectionToken, TerminalPaymentIntent, Tier, TierFeature, TierName, ToggleKvFieldResult, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, UNIFIED_MCP_SERVER_NAME, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateStatus, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeSourceType, UpgradeStatus, User, UserInterest, UserMode, type UserPermission, UserPermissions, UserPrivate, type UserRole, UserRoles, 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, addressTypeValues, automationSendChannel, buildAgentMcpServerName, buildAgentSetupClipboardText, buildAppSetupClipboardText, buildFeatureSetupClipboardText, buildMcpServerName, canOpenFulfillmentFlow, canTransitionOrderStatus, cartLineTotal, cartPayableTotal, containedImageDimensions, createCursorMcpInstallLink, cropOutputDimensions, defaultInviteTeamRole, documentShareUrl, firstValidationMessage, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getDocumentsBaseUrl, getEditableOrderStatuses, getFormsBaseUrl, getFulfillmentFlowAction, getFulfillmentFlowStepperIndex, getGenBaseUrl, getInvoiceEditableStatuses, getLoginUrl, getMcpServerAgentUrl, getMcpServerUrl, getPickupEditableStatuses, getPickupNextAction, getShippingEditableStatuses, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, hasAllPermissions, hasAllTeamPermissions, hasAnyPermissions, hasPermission, hasTeamPermission, imageCropRectangle, integrationSlugForChannel, inviteableTeamRoles, isAutomationSendChannelId, isCampaignChannelId, isCompleteAddressInput, isContactMessageAction, isContactMessageWarpId, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, isNativeAppAccessible, isNativeAppGated, isNativeAppLocked, isOrderCanceled, isOrderInFulfillment, isOrderPending, isOrderPostCheckout, isPickupOrderReady, isPickupReady, isSupportedAppLocale, isTeamFeatureAccessible, isTeamFeatureGated, isTeamFeatureLocked, isUnifiedMcpUrl, isUserRole, localize, nativeAppSlugs, normalizeAutomationActionType, ogImageUrl, outboundChannel, permissionPresetRules, resolveAccessCatalog, resolveAgentMcpUrl, resolveConnectMcpUrl, resolveFulfillmentFlowStep, resolveOrderStatusDisplay, resolveTeamCurrency, resolveWarpText, returnStatusValues, returnUpdateStatusValues, sanitizeAlphanumeric, sanitizeNumeric, slugifyMcpSegment, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, userPermissionValues, userRoleValues, validateImageDimensions, validationMessageFor, withRetry };
package/dist/index.mjs CHANGED
@@ -410,6 +410,63 @@ function integrationSlugForChannel(channel) {
410
410
  return channel === "sms" ? "twilio" : channel;
411
411
  }
412
412
  //#endregion
413
+ //#region src/content/image-processing.ts
414
+ const positiveFinite = (value) => typeof value === "number" && Number.isFinite(value) && value > 0;
415
+ const validateImageDimensions = (dimensions, rules) => {
416
+ if (!positiveFinite(dimensions.width) || !positiveFinite(dimensions.height)) return "too-small";
417
+ if (rules.minWidth && dimensions.width < rules.minWidth || rules.minHeight && dimensions.height < rules.minHeight) return "too-small";
418
+ if (rules.maxWidth && dimensions.width > rules.maxWidth || rules.maxHeight && dimensions.height > rules.maxHeight || rules.maxPixels && dimensions.width * dimensions.height > rules.maxPixels) return "too-large";
419
+ return null;
420
+ };
421
+ const imageCropRectangle = (dimensions, aspectRatio, crop) => {
422
+ if (!positiveFinite(aspectRatio)) throw new RangeError("Crop aspect ratio must be a positive finite number.");
423
+ if (!positiveFinite(dimensions.width) || !positiveFinite(dimensions.height)) throw new RangeError("Image dimensions must be positive finite numbers.");
424
+ const sourceAspect = dimensions.width / dimensions.height;
425
+ const baseWidth = sourceAspect > aspectRatio ? dimensions.height * aspectRatio : dimensions.width;
426
+ const baseHeight = sourceAspect > aspectRatio ? dimensions.height : dimensions.width / aspectRatio;
427
+ const zoom = Number.isFinite(crop.zoom) ? Math.max(1, crop.zoom) : 1;
428
+ const positionX = Number.isFinite(crop.x) ? Math.max(-1, Math.min(1, crop.x)) : 0;
429
+ const positionY = Number.isFinite(crop.y) ? Math.max(-1, Math.min(1, crop.y)) : 0;
430
+ const width = baseWidth / zoom;
431
+ const height = baseHeight / zoom;
432
+ const availableX = dimensions.width - width;
433
+ const availableY = dimensions.height - height;
434
+ return {
435
+ x: availableX * ((positionX + 1) / 2),
436
+ y: availableY * ((positionY + 1) / 2),
437
+ width,
438
+ height
439
+ };
440
+ };
441
+ const containedImageDimensions = (source, options) => {
442
+ if (!positiveFinite(source.width) || !positiveFinite(source.height)) throw new RangeError("Image dimensions must be positive finite numbers.");
443
+ const maxWidth = positiveFinite(options.maxWidth) ? options.maxWidth : source.width;
444
+ const maxHeight = positiveFinite(options.maxHeight) ? options.maxHeight : source.height;
445
+ const scale = Math.min(1, maxWidth / source.width, maxHeight / source.height);
446
+ return {
447
+ width: Math.max(1, Math.round(source.width * scale)),
448
+ height: Math.max(1, Math.round(source.height * scale))
449
+ };
450
+ };
451
+ const cropOutputDimensions = (source, options, compression) => {
452
+ if (!positiveFinite(options.aspectRatio)) throw new RangeError("Crop aspect ratio must be a positive finite number.");
453
+ const width = positiveFinite(options.outputWidth) ? options.outputWidth : void 0;
454
+ const height = positiveFinite(options.outputHeight) ? options.outputHeight : void 0;
455
+ if (width && height) return {
456
+ width: Math.max(1, Math.round(width)),
457
+ height: Math.max(1, Math.round(height))
458
+ };
459
+ if (width) return {
460
+ width: Math.max(1, Math.round(width)),
461
+ height: Math.max(1, Math.round(width / options.aspectRatio))
462
+ };
463
+ if (height) return {
464
+ width: Math.max(1, Math.round(height * options.aspectRatio)),
465
+ height: Math.max(1, Math.round(height))
466
+ };
467
+ return containedImageDimensions(source, compression);
468
+ };
469
+ //#endregion
413
470
  //#region src/address/enums.ts
414
471
  const AddressTypes = {
415
472
  Billing: "billing",
@@ -878,7 +935,8 @@ const NativeApps = {
878
935
  Artifacts: "artifacts",
879
936
  Social: "social",
880
937
  Studio: "studio",
881
- Loyalty: "loyalty"
938
+ Loyalty: "loyalty",
939
+ Documents: "documents"
882
940
  };
883
941
  const nativeAppSlugs = Object.values(NativeApps);
884
942
  const isNativeApp = (value) => typeof value === "string" && nativeAppSlugs.includes(value);
@@ -976,4 +1034,4 @@ const DefaultInviteTeamRole = UserRoles.Member;
976
1034
  const inviteableTeamRoles = () => [...InviteableTeamRoles];
977
1035
  const defaultInviteTeamRole = () => DefaultInviteTeamRole;
978
1036
  //#endregion
979
- export { AUTOMATION_SEND_CHANNELS, AddressTypes, AgentToolingAccess, BillingManageAccess, CAMPAIGN_CHANNELS, CONTACT_MESSAGE_SEND_WARP, ContractCategoryDisplayNames, DefaultAppLocale, DefaultCodeMetadata, DefaultInviteTeamRole, FulfillmentMethods, FulfillmentStatuses, HttpService, InviteableTeamRoles, JoaiUrls, NATIVE_AUTH_TOKEN_PARAM, NativeApps, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, ORDER_FULFILLMENT_STATUSES, ORDER_POST_CHECKOUT_STATUSES, OUTBOUND_CHANNELS, OgImageColors, PLATFORM_CURRENCY, PeriodTypeLabels, PeriodTypeOptions, PermissionPresetNames, ReturnStatuses, ReturnUpdateStatuses, SkillMediaBindingRole, SkillScope, SkillType, SupportedAppLocales, TeamManageAccess, TeamViewAccess, UNIFIED_MCP_SERVER_NAME, UserPermissions, UserRoles, abbreviateNumber, addressTypeValues, automationSendChannel, buildAgentMcpServerName, buildAgentSetupClipboardText, buildAppSetupClipboardText, buildFeatureSetupClipboardText, buildMcpServerName, canOpenFulfillmentFlow, canTransitionOrderStatus, cartLineTotal, cartPayableTotal, createCursorMcpInstallLink, defaultInviteTeamRole, documentShareUrl, firstValidationMessage, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getDocumentsBaseUrl, getEditableOrderStatuses, getFormsBaseUrl, getFulfillmentFlowAction, getFulfillmentFlowStepperIndex, getGenBaseUrl, getInvoiceEditableStatuses, getLoginUrl, getMcpServerAgentUrl, getMcpServerUrl, getPickupEditableStatuses, getPickupNextAction, getShippingEditableStatuses, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, hasAllPermissions, hasAllTeamPermissions, hasAnyPermissions, hasPermission, hasTeamPermission, integrationSlugForChannel, inviteableTeamRoles, isAutomationSendChannelId, isCampaignChannelId, isCompleteAddressInput, isContactMessageAction, isContactMessageWarpId, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, isNativeAppAccessible, isNativeAppGated, isNativeAppLocked, isOrderCanceled, isOrderInFulfillment, isOrderPending, isOrderPostCheckout, isPickupOrderReady, isPickupReady, isSupportedAppLocale, isTeamFeatureAccessible, isTeamFeatureGated, isTeamFeatureLocked, isUnifiedMcpUrl, isUserRole, localize, nativeAppSlugs, normalizeAutomationActionType, ogImageUrl, outboundChannel, permissionPresetRules, resolveAccessCatalog, resolveAgentMcpUrl, resolveConnectMcpUrl, resolveFulfillmentFlowStep, resolveOrderStatusDisplay, resolveTeamCurrency, resolveWarpText, returnStatusValues, returnUpdateStatusValues, sanitizeAlphanumeric, sanitizeNumeric, slugifyMcpSegment, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, userPermissionValues, userRoleValues, validationMessageFor, withRetry };
1037
+ export { AUTOMATION_SEND_CHANNELS, AddressTypes, AgentToolingAccess, BillingManageAccess, CAMPAIGN_CHANNELS, CONTACT_MESSAGE_SEND_WARP, ContractCategoryDisplayNames, DefaultAppLocale, DefaultCodeMetadata, DefaultInviteTeamRole, FulfillmentMethods, FulfillmentStatuses, HttpService, InviteableTeamRoles, JoaiUrls, NATIVE_AUTH_TOKEN_PARAM, NativeApps, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, ORDER_FULFILLMENT_STATUSES, ORDER_POST_CHECKOUT_STATUSES, OUTBOUND_CHANNELS, OgImageColors, PLATFORM_CURRENCY, PeriodTypeLabels, PeriodTypeOptions, PermissionPresetNames, ReturnStatuses, ReturnUpdateStatuses, SkillMediaBindingRole, SkillScope, SkillType, SupportedAppLocales, TeamManageAccess, TeamViewAccess, UNIFIED_MCP_SERVER_NAME, UserPermissions, UserRoles, abbreviateNumber, addressTypeValues, automationSendChannel, buildAgentMcpServerName, buildAgentSetupClipboardText, buildAppSetupClipboardText, buildFeatureSetupClipboardText, buildMcpServerName, canOpenFulfillmentFlow, canTransitionOrderStatus, cartLineTotal, cartPayableTotal, containedImageDimensions, createCursorMcpInstallLink, cropOutputDimensions, defaultInviteTeamRole, documentShareUrl, firstValidationMessage, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getDocumentsBaseUrl, getEditableOrderStatuses, getFormsBaseUrl, getFulfillmentFlowAction, getFulfillmentFlowStepperIndex, getGenBaseUrl, getInvoiceEditableStatuses, getLoginUrl, getMcpServerAgentUrl, getMcpServerUrl, getPickupEditableStatuses, getPickupNextAction, getShippingEditableStatuses, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, hasAllPermissions, hasAllTeamPermissions, hasAnyPermissions, hasPermission, hasTeamPermission, imageCropRectangle, integrationSlugForChannel, inviteableTeamRoles, isAutomationSendChannelId, isCampaignChannelId, isCompleteAddressInput, isContactMessageAction, isContactMessageWarpId, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, isNativeApp, isNativeAppAccessible, isNativeAppGated, isNativeAppLocked, isOrderCanceled, isOrderInFulfillment, isOrderPending, isOrderPostCheckout, isPickupOrderReady, isPickupReady, isSupportedAppLocale, isTeamFeatureAccessible, isTeamFeatureGated, isTeamFeatureLocked, isUnifiedMcpUrl, isUserRole, localize, nativeAppSlugs, normalizeAutomationActionType, ogImageUrl, outboundChannel, permissionPresetRules, resolveAccessCatalog, resolveAgentMcpUrl, resolveConnectMcpUrl, resolveFulfillmentFlowStep, resolveOrderStatusDisplay, resolveTeamCurrency, resolveWarpText, returnStatusValues, returnUpdateStatusValues, sanitizeAlphanumeric, sanitizeNumeric, slugifyMcpSegment, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, userPermissionValues, userRoleValues, validateImageDimensions, validationMessageFor, withRetry };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/core",
3
- "version": "4.15.7",
3
+ "version": "5.0.0",
4
4
  "description": "JoAi shared types, HTTP service, and config",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -10,10 +10,6 @@
10
10
  ".": {
11
11
  "import": "./dist/index.mjs",
12
12
  "types": "./dist/index.d.mts"
13
- },
14
- "./react": {
15
- "import": "./dist/react/index.mjs",
16
- "types": "./dist/react/index.d.mts"
17
13
  }
18
14
  },
19
15
  "files": [
@@ -26,17 +22,10 @@
26
22
  "test:watch": "jest --watch"
27
23
  },
28
24
  "peerDependencies": {
29
- "@joai/warps": ">=4.0.0",
30
- "react": ">=18.0.0"
31
- },
32
- "peerDependenciesMeta": {
33
- "react": {
34
- "optional": true
35
- }
25
+ "@joai/warps": ">=4.0.0"
36
26
  },
37
27
  "devDependencies": {
38
28
  "@types/jest": "^30.0.0",
39
- "@types/react": "^19.2.14",
40
29
  "jest": "^30.3.0",
41
30
  "ts-jest": "^29.4.6",
42
31
  "tsdown": "^0.21.0",
@@ -1,361 +0,0 @@
1
- 'use client';
2
- import * as _$react from "react";
3
- import { ReactNode } from "react";
4
-
5
- //#region src/react/types.d.ts
6
- type EmbedChatItem = {
7
- content: string;
8
- byUser: boolean;
9
- streaming?: boolean;
10
- error?: boolean;
11
- };
12
- //#endregion
13
- //#region src/react/guest.d.ts
14
- declare function getOrCreateGuestId(storageKey?: string): string;
15
- declare function loadRoom(storageKey: string): string | null;
16
- declare function saveRoom(storageKey: string, roomId: string): void;
17
- declare function clearRoom(storageKey: string): void;
18
- //#endregion
19
- //#region src/react/stream-connection.d.ts
20
- type StreamDataHandler = (data: unknown) => void;
21
- declare function openEventSourceStream(url: string, onData: StreamDataHandler, options?: {
22
- withCredentials?: boolean;
23
- onError?: (e: unknown) => void;
24
- onConnectionError?: (e: Event | null) => void;
25
- }): () => void;
26
- //#endregion
27
- //#region src/react/components.d.ts
28
- type ListClassNames = {
29
- container?: string;
30
- userBubble?: string;
31
- agentBubble?: string;
32
- errorBubble?: string;
33
- thinkingWrapper?: string;
34
- dot?: string;
35
- };
36
- type EmbedChatListProps = {
37
- items: EmbedChatItem[];
38
- agentName: string;
39
- awaitingResponse: boolean;
40
- classNames?: ListClassNames;
41
- renderEmptyState?: () => ReactNode;
42
- renderAgentContent?: (item: EmbedChatItem) => ReactNode;
43
- };
44
- declare function EmbedChatList({
45
- items,
46
- agentName,
47
- awaitingResponse,
48
- classNames,
49
- renderEmptyState,
50
- renderAgentContent
51
- }: EmbedChatListProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | _$react.ReactPortal | _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | _$react.JSX.Element | null | undefined;
52
- type EmbedChatInputProps = {
53
- onSend: (message: string) => void;
54
- disabled: boolean;
55
- placeholder?: string;
56
- maxLength?: number;
57
- classNames?: {
58
- container?: string;
59
- textarea?: string;
60
- };
61
- renderSendButton: (props: {
62
- onClick: () => void;
63
- disabled: boolean;
64
- }) => ReactNode;
65
- };
66
- declare function EmbedChatInput({
67
- onSend,
68
- disabled,
69
- placeholder,
70
- maxLength,
71
- classNames,
72
- renderSendButton
73
- }: EmbedChatInputProps): _$react.JSX.Element;
74
- //#endregion
75
- //#region src/http/types.d.ts
76
- interface IHttpService {
77
- readonly baseUrl: string;
78
- readonly authToken: string | null;
79
- onNetworkError: (error: Error) => void;
80
- onUnauthorized: (response: IAppResponse<any>) => void;
81
- onSuccessfulResponse: (response: IAppResponse<any>) => void;
82
- onMaintenanceMode: (response: IAppResponse<any>) => void;
83
- onTooManyRequests: (response: IAppResponse<any>) => void;
84
- get: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
85
- post: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
86
- put: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
87
- patch: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
88
- delete: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
89
- }
90
- interface IAppResponse<T> {
91
- data: T;
92
- meta?: any;
93
- body: any;
94
- errors: any;
95
- ok: boolean;
96
- paymentRequired: boolean;
97
- noContent: boolean;
98
- original: Response;
99
- }
100
- interface IRequestOptions {
101
- isJson?: boolean;
102
- headers?: {
103
- [name: string]: string;
104
- };
105
- }
106
- //#endregion
107
- //#region src/react/use-embed-chat.d.ts
108
- type Options = {
109
- agentUuid: string | null;
110
- http: IHttpService;
111
- cortexBaseUrl: string;
112
- guestId: string;
113
- roomStorageKey: string;
114
- enabled?: boolean;
115
- extraPayload?: Record<string, unknown>;
116
- };
117
- declare function useEmbedChat({
118
- agentUuid,
119
- http,
120
- cortexBaseUrl,
121
- guestId,
122
- roomStorageKey,
123
- enabled,
124
- extraPayload
125
- }: Options): {
126
- items: EmbedChatItem[];
127
- setItems: _$react.Dispatch<_$react.SetStateAction<EmbedChatItem[]>>;
128
- sending: boolean;
129
- awaitingResponse: boolean;
130
- roomId: string | null;
131
- setRoomId: _$react.Dispatch<_$react.SetStateAction<string | null>>;
132
- send: (message: string) => Promise<void>;
133
- connectionError: boolean;
134
- };
135
- //#endregion
136
- //#region src/content/types.d.ts
137
- type ContentStatus = 'draft' | 'published' | 'archived';
138
- type ContentFieldType = 'text' | 'richText' | 'number' | 'boolean' | 'url' | 'image' | 'media' | 'list' | 'object' | 'reference';
139
- type ContentField = {
140
- key: string;
141
- type: ContentFieldType;
142
- label?: string;
143
- required?: boolean;
144
- };
145
- type ContentDefinition = {
146
- fields: ContentField[];
147
- };
148
- type ContentValue = string | number | boolean | null | ContentValue[] | {
149
- [key: string]: ContentValue;
150
- };
151
- type ContentEntry = {
152
- key: string;
153
- value: ContentValue;
154
- updatedAt: string;
155
- };
156
- type ContentVersion = {
157
- id: string;
158
- number: number;
159
- status: ContentStatus;
160
- entries: ContentEntry[];
161
- snapshotHash: string;
162
- origin: string;
163
- createdAt: string;
164
- updatedAt: string;
165
- publishedAt: string | null;
166
- };
167
- type Content = {
168
- id: string;
169
- name: string;
170
- slug: string;
171
- schema: string | null;
172
- definition: ContentDefinition;
173
- metadata: Record<string, ContentValue>;
174
- version: ContentVersion | null;
175
- createdAt: string;
176
- updatedAt: string;
177
- };
178
- type ContentPatch = {
179
- key: string;
180
- value: ContentValue;
181
- };
182
- type PatchContentInput = {
183
- expectedVersion: number;
184
- patches: ContentPatch[];
185
- origin?: 'api' | 'inlineEditor' | 'joai' | 'mcp';
186
- };
187
- //#endregion
188
- //#region src/json/types.d.ts
189
- type JsonValue = string | number | boolean | null | JsonValue[] | {
190
- [key: string]: JsonValue;
191
- };
192
- //#endregion
193
- //#region src/media/types.d.ts
194
- type MediaLibraryAttributes = {
195
- uuid: string;
196
- order: number;
197
- name: string;
198
- custom_properties: {
199
- [key: string]: JsonValue;
200
- };
201
- preview_url: null | string;
202
- original_url: null | string;
203
- extension?: string;
204
- size?: number;
205
- };
206
- type MediaMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm' | 'video/quicktime' | 'video/x-msvideo' | 'audio/mpeg' | 'audio/mp3' | 'audio/ogg' | 'audio/wav' | 'audio/webm' | 'audio/aac' | 'audio/m4a' | 'audio/m4b' | 'audio/m4p' | 'audio/m4v' | 'application/pdf' | 'application/json';
207
- type Media = {
208
- id: string;
209
- name: string;
210
- mime: MediaMime;
211
- url: string;
212
- library: MediaLibraryAttributes;
213
- tags?: string[];
214
- copyright?: string | null;
215
- aiGenerated?: boolean;
216
- };
217
- //#endregion
218
- //#region src/react/content/types.d.ts
219
- type ContentResource = {
220
- get: (contentId: string) => Promise<{
221
- ok: boolean;
222
- data?: Content;
223
- }>;
224
- getPublic: (slug: string) => Promise<{
225
- ok: boolean;
226
- data?: Content;
227
- }>;
228
- patch: (contentId: string, input: PatchContentInput) => Promise<{
229
- ok: boolean;
230
- data?: ContentVersion;
231
- }>;
232
- publish: (contentId: string, expectedVersion: number) => Promise<{
233
- ok: boolean;
234
- data?: ContentVersion;
235
- }>;
236
- };
237
- type ContentClient = {
238
- content: ContentResource;
239
- media?: {
240
- list: (team: string, params?: {
241
- page?: number;
242
- mime?: string;
243
- }) => Promise<{
244
- ok: boolean;
245
- data?: Media[];
246
- }>;
247
- upload: (data: {
248
- team: string;
249
- file: File;
250
- type: 'output';
251
- label?: string;
252
- }) => Promise<{
253
- ok: boolean;
254
- data?: Media;
255
- }>;
256
- };
257
- };
258
- type ContentContextValue = {
259
- content: Content | null;
260
- values: Record<string, ContentValue>;
261
- isLoading: boolean;
262
- isSaving: boolean;
263
- isEditing: boolean;
264
- isDirty: boolean;
265
- canEdit: boolean;
266
- canPublish: boolean;
267
- teamSlug?: string;
268
- media?: ContentClient['media'];
269
- error: string | null;
270
- setEditing: (editing: boolean) => void;
271
- setValue: (key: string, value: ContentValue) => void;
272
- save: () => Promise<boolean>;
273
- publish: () => Promise<boolean>;
274
- };
275
- type ContentProviderProp = {
276
- children: ReactNode;
277
- client: ContentClient;
278
- contentId?: string;
279
- publicSlug?: string;
280
- initialContent?: Content;
281
- canEdit?: boolean;
282
- canPublish?: boolean;
283
- teamSlug?: string;
284
- };
285
- type EditableContentProp = {
286
- field: string;
287
- as?: 'span' | 'p' | 'div' | 'h1' | 'h2' | 'h3';
288
- className?: string;
289
- placeholder?: string;
290
- multiline?: boolean;
291
- };
292
- type EditableImageProp = {
293
- field: string;
294
- alt?: string;
295
- className?: string;
296
- onSelect?: () => void;
297
- inputClassName?: string;
298
- placeholder?: string;
299
- };
300
- type ContentToolbarProp = {
301
- className?: string;
302
- confirmPublish?: () => boolean | Promise<boolean>;
303
- labels?: {
304
- edit?: string;
305
- save?: string;
306
- publish?: string;
307
- cancel?: string;
308
- };
309
- };
310
- //#endregion
311
- //#region src/react/content/provider.d.ts
312
- declare function ContentProvider({
313
- children,
314
- client,
315
- contentId,
316
- publicSlug,
317
- initialContent,
318
- canEdit,
319
- canPublish,
320
- teamSlug
321
- }: ContentProviderProp): _$react.JSX.Element;
322
- //#endregion
323
- //#region src/react/content/editable-content.d.ts
324
- declare function EditableContent({
325
- field,
326
- as: Tag,
327
- className,
328
- placeholder,
329
- multiline
330
- }: EditableContentProp): _$react.JSX.Element;
331
- declare function useContentValue<T extends ContentValue = ContentValue>(key: string): T | undefined;
332
- //#endregion
333
- //#region src/react/content/editable-image.d.ts
334
- declare function EditableImage({
335
- field,
336
- alt,
337
- className,
338
- inputClassName,
339
- placeholder,
340
- onSelect
341
- }: EditableImageProp): _$react.JSX.Element | null;
342
- //#endregion
343
- //#region src/react/content/toolbar.d.ts
344
- declare function ContentToolbar({
345
- className,
346
- labels,
347
- confirmPublish
348
- }: ContentToolbarProp): _$react.JSX.Element | null;
349
- //#endregion
350
- //#region src/react/content/content-editor.d.ts
351
- type Prop = ContentProviderProp & {
352
- children: ReactNode;
353
- title?: string;
354
- };
355
- declare function ContentEditor({
356
- children,
357
- title,
358
- ...provider
359
- }: Prop): _$react.JSX.Element;
360
- //#endregion
361
- export { ContentClient, ContentContextValue, ContentEditor, ContentProvider, ContentProviderProp, ContentResource, ContentToolbar, ContentToolbarProp, EditableContent, EditableContentProp, EditableImage, EditableImageProp, EmbedChatInput, EmbedChatItem, EmbedChatList, StreamDataHandler, clearRoom, getOrCreateGuestId, loadRoom, openEventSourceStream, saveRoom, useContentValue, useEmbedChat };