@joai/core 4.15.5 → 4.15.6
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 +50 -4
- package/dist/index.mjs +62 -16
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,8 @@ declare const getApiBaseUrl: (env: AppEnv) => string;
|
|
|
20
20
|
declare const getCortexBaseUrl: (env: AppEnv) => "http://localhost:3010" | "https://devnet-cortex.joai.ai" | "https://testnet-cortex.joai.ai" | "https://cortex.joai.ai";
|
|
21
21
|
declare const getAppBaseUrl: (env: AppEnv) => "http://app.joai--api.test:3004" | "https://devnet.joai.ai" | "https://testnet.joai.ai" | "https://joai.ai";
|
|
22
22
|
declare const getFormsBaseUrl: (env: AppEnv) => "http://forms.joai--api.test:3008" | "https://devnet-forms.joai.ai" | "https://testnet-forms.joai.ai" | "https://forms.joai.ai";
|
|
23
|
+
declare const getDocumentsBaseUrl: (env: AppEnv) => "http://documents.joai--api.test:3012" | "https://devnet-documents.joai.ai" | "https://testnet-documents.joai.ai" | "https://documents.joai.ai";
|
|
24
|
+
declare const documentShareUrl: (env: AppEnv, locale: string, slug: string, password?: string | null) => string;
|
|
23
25
|
declare const getDigestBaseUrl: (env: AppEnv) => "http://localhost:3005" | "https://devnet-digests.joai.ai" | "https://testnet-digests.joai.ai" | "https://digests.joai.ai";
|
|
24
26
|
declare const getStoreBaseUrl: (env: AppEnv) => "http://localhost:3005" | "https://devnet-store.joai.ai" | "https://testnet-store.joai.ai" | "https://store.joai.ai";
|
|
25
27
|
declare const getAgentsBaseUrl: (env: AppEnv) => "http://localhost:3007" | "https://devnet-agents.joai.ai" | "https://testnet-agents.joai.ai" | "https://agents.joai.ai";
|
|
@@ -43,6 +45,11 @@ declare const JoaiUrls: {
|
|
|
43
45
|
readonly AppStore: "https://apps.apple.com/app/joai/id6741204807";
|
|
44
46
|
readonly PlayStore: "https://play.google.com/store/apps/details?id=ai.joai.app";
|
|
45
47
|
};
|
|
48
|
+
/** App UI locales — keep in sync with API `config('app.languages.supported')`. */
|
|
49
|
+
declare const SupportedAppLocales: readonly ["en", "de", "fr", "es", "ro", "it"];
|
|
50
|
+
type SupportedAppLocale = (typeof SupportedAppLocales)[number];
|
|
51
|
+
declare const DefaultAppLocale: SupportedAppLocale;
|
|
52
|
+
declare const isSupportedAppLocale: (value: string | null | undefined) => value is SupportedAppLocale;
|
|
46
53
|
//#endregion
|
|
47
54
|
//#region src/http/types.d.ts
|
|
48
55
|
interface IHttpService {
|
|
@@ -106,6 +113,12 @@ declare class HttpService implements IHttpService {
|
|
|
106
113
|
private getRequestInfo;
|
|
107
114
|
}
|
|
108
115
|
//#endregion
|
|
116
|
+
//#region src/http/errors.d.ts
|
|
117
|
+
/** First localized string from a Laravel-style `errors` map (`field → string | string[]`). */
|
|
118
|
+
declare const firstValidationMessage: (errors: unknown) => string | undefined;
|
|
119
|
+
/** Localized validation message for a specific field, when present. */
|
|
120
|
+
declare const validationMessageFor: (errors: unknown, field: string) => string | undefined;
|
|
121
|
+
//#endregion
|
|
109
122
|
//#region src/voice/types.d.ts
|
|
110
123
|
type TranscriptionCorrection = {
|
|
111
124
|
wrong: string;
|
|
@@ -334,6 +347,19 @@ type ShippingZone = {
|
|
|
334
347
|
position: number;
|
|
335
348
|
rates: ShippingRate[];
|
|
336
349
|
};
|
|
350
|
+
type TaxClass = {
|
|
351
|
+
id: string;
|
|
352
|
+
name: string; /** Integer percent, e.g. 20 for 20%. */
|
|
353
|
+
rate: number;
|
|
354
|
+
isDefault: boolean;
|
|
355
|
+
position: number;
|
|
356
|
+
};
|
|
357
|
+
type TaxBreakdownRow = {
|
|
358
|
+
/** Integer percent, e.g. 20 for 20%. */rate: number;
|
|
359
|
+
name?: string | null;
|
|
360
|
+
net?: number;
|
|
361
|
+
tax: number;
|
|
362
|
+
};
|
|
337
363
|
type FulfillmentLocation = {
|
|
338
364
|
id: string;
|
|
339
365
|
name: string;
|
|
@@ -342,6 +368,10 @@ type FulfillmentLocation = {
|
|
|
342
368
|
instructions: string | null;
|
|
343
369
|
active: boolean;
|
|
344
370
|
};
|
|
371
|
+
type ShippingCarrierOption = {
|
|
372
|
+
id: string;
|
|
373
|
+
label: string;
|
|
374
|
+
};
|
|
345
375
|
type Fulfillment = {
|
|
346
376
|
id: string;
|
|
347
377
|
orderId: number;
|
|
@@ -1395,7 +1425,7 @@ type MollieTerminalPaymentResult = {
|
|
|
1395
1425
|
failureReason?: string | null;
|
|
1396
1426
|
signature?: string | null;
|
|
1397
1427
|
};
|
|
1398
|
-
type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'phone-call' | 'phone-number' | 'custom-domain' | 'contacts' | 'links' | 'store-fee-rate' | 'store-fee-rate-physical' | 'tap-to-pay';
|
|
1428
|
+
type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'phone-call' | 'phone-number' | 'meeting-bot' | 'custom-domain' | 'contacts' | 'links' | 'store-fee-rate' | 'store-fee-rate-physical' | 'tap-to-pay' | 'campaigns' | 'social-posts' | 'automations';
|
|
1399
1429
|
type PlanBenefit = {
|
|
1400
1430
|
label: Partial<Record<WarpLocale, string>>;
|
|
1401
1431
|
tip?: Partial<Record<WarpLocale, string>>;
|
|
@@ -1534,6 +1564,7 @@ type Product = {
|
|
|
1534
1564
|
meta?: ProductMeta;
|
|
1535
1565
|
virtual?: boolean;
|
|
1536
1566
|
tags?: string[] | null;
|
|
1567
|
+
taxClassId?: string | null;
|
|
1537
1568
|
createdAt?: string;
|
|
1538
1569
|
updatedAt?: string;
|
|
1539
1570
|
variations: ProductVariation[];
|
|
@@ -1549,6 +1580,10 @@ type OrderItem = {
|
|
|
1549
1580
|
name: string;
|
|
1550
1581
|
quantity: number;
|
|
1551
1582
|
unitPrice: number;
|
|
1583
|
+
taxClassId?: string | null;
|
|
1584
|
+
taxClassName?: string | null;
|
|
1585
|
+
taxRate?: number | null;
|
|
1586
|
+
taxAmount?: number | null;
|
|
1552
1587
|
type: 'product-variation' | 'service' | 'coupon' | 'custom';
|
|
1553
1588
|
digital?: boolean | null;
|
|
1554
1589
|
sellerTeamId?: string | null;
|
|
@@ -1585,6 +1620,10 @@ type Order = {
|
|
|
1585
1620
|
context: OrderContext | null;
|
|
1586
1621
|
paymentMode: string | null;
|
|
1587
1622
|
priceMode?: OrderPriceMode | null;
|
|
1623
|
+
taxRate?: number | null;
|
|
1624
|
+
taxValue?: number | null;
|
|
1625
|
+
netPrice?: number | null;
|
|
1626
|
+
taxBreakdown?: TaxBreakdownRow[];
|
|
1588
1627
|
linkVariationId: string | null;
|
|
1589
1628
|
notes: string | null; /** Linked pickup appointment when booked (canonical Meeting resource). */
|
|
1590
1629
|
meeting?: Meeting | null;
|
|
@@ -2101,7 +2140,7 @@ type BlueprintShortcut = {
|
|
|
2101
2140
|
//#region src/helpers/string.d.ts
|
|
2102
2141
|
declare const sanitizeAlphanumeric: (val: string) => string;
|
|
2103
2142
|
declare const sanitizeNumeric: (val: string) => string;
|
|
2104
|
-
declare const toNameInitials: (name?: string) => string;
|
|
2143
|
+
declare const toNameInitials: (name?: string | null) => string;
|
|
2105
2144
|
declare const toPreviewText: (text: string, maxChars?: number) => string;
|
|
2106
2145
|
declare const localize: (value: Partial<Record<string, string>> | string | null | undefined, locale?: string) => string;
|
|
2107
2146
|
//#endregion
|
|
@@ -2271,6 +2310,7 @@ type Service = {
|
|
|
2271
2310
|
digital: boolean;
|
|
2272
2311
|
public: boolean;
|
|
2273
2312
|
bookable: boolean;
|
|
2313
|
+
taxClassId?: string | null;
|
|
2274
2314
|
settings?: Record<string, unknown> | null;
|
|
2275
2315
|
createdAt: string;
|
|
2276
2316
|
updatedAt: string;
|
|
@@ -2321,8 +2361,11 @@ type AppointmentPolicy = {
|
|
|
2321
2361
|
bookingCapacityUnit?: 'booking' | 'person' | null;
|
|
2322
2362
|
requireApproval?: boolean | null;
|
|
2323
2363
|
notificationEmail?: string | null;
|
|
2324
|
-
sync?: AppointmentPolicySync | null;
|
|
2364
|
+
sync?: AppointmentPolicySync | null; /** Assigned booking agent (required for shop slot loading). */
|
|
2325
2365
|
agent?: Agent | null;
|
|
2366
|
+
};
|
|
2367
|
+
/** Writable policy fields. `agentUuid` assigns the booking agent (read back as `agent`). */
|
|
2368
|
+
type AppointmentPolicyUpsert = Partial<Omit<AppointmentPolicy, 'agent'>> & {
|
|
2326
2369
|
agentUuid?: string | null;
|
|
2327
2370
|
};
|
|
2328
2371
|
type AppointmentBookingContext = {
|
|
@@ -2872,9 +2915,12 @@ type Document = {
|
|
|
2872
2915
|
meta?: Record<string, unknown> | null;
|
|
2873
2916
|
slug?: string | null;
|
|
2874
2917
|
isPublic?: boolean;
|
|
2918
|
+
password?: string | null;
|
|
2875
2919
|
url?: string | null;
|
|
2876
2920
|
archivedAt?: string | null;
|
|
2921
|
+
team?: Team | null;
|
|
2877
2922
|
createdAt: string;
|
|
2923
|
+
updatedAt?: string | null;
|
|
2878
2924
|
};
|
|
2879
2925
|
//#endregion
|
|
2880
2926
|
//#region src/experience/types.d.ts
|
|
@@ -4793,4 +4839,4 @@ type CliSessionStatus = {
|
|
|
4793
4839
|
meta: CliSessionMeta | null;
|
|
4794
4840
|
};
|
|
4795
4841
|
//#endregion
|
|
4796
|
-
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, 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, 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, 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, Swarm, Tag, TagType, Task, 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, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, 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, 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, withRetry };
|
|
4842
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
//#region src/config/constants.ts
|
|
2
|
+
const JoaiUrls = {
|
|
3
|
+
TelegramGroup: "https://telegram.joai.ai",
|
|
4
|
+
Twitter: "https://x.com/JoAiAgents",
|
|
5
|
+
Reddit: "https://www.reddit.com/r/JoAi/",
|
|
6
|
+
GitHub: "https://github.com/JoAiHQ",
|
|
7
|
+
LinkedIn: "https://www.linkedin.com/company/joai",
|
|
8
|
+
Docs: "https://docs.joai.ai",
|
|
9
|
+
DocsApi: "https://docs.joai.ai/api",
|
|
10
|
+
DocsWebhooks: "https://docs.joai.ai/webhooks",
|
|
11
|
+
AppStore: "https://apps.apple.com/app/joai/id6741204807",
|
|
12
|
+
PlayStore: "https://play.google.com/store/apps/details?id=ai.joai.app"
|
|
13
|
+
};
|
|
14
|
+
/** App UI locales — keep in sync with API `config('app.languages.supported')`. */
|
|
15
|
+
const SupportedAppLocales = [
|
|
16
|
+
"en",
|
|
17
|
+
"de",
|
|
18
|
+
"fr",
|
|
19
|
+
"es",
|
|
20
|
+
"ro",
|
|
21
|
+
"it"
|
|
22
|
+
];
|
|
23
|
+
const DefaultAppLocale = "en";
|
|
24
|
+
const isSupportedAppLocale = (value) => !!value && SupportedAppLocales.includes(value);
|
|
25
|
+
//#endregion
|
|
1
26
|
//#region src/config/urls.ts
|
|
2
27
|
const toSubdomainBaseUrl = (env, subdomain) => {
|
|
3
28
|
if (env === "local") return `http://${subdomain}.joai--api.test`;
|
|
@@ -24,6 +49,18 @@ const getFormsBaseUrl = (env) => {
|
|
|
24
49
|
if (env === "testnet") return "https://testnet-forms.joai.ai";
|
|
25
50
|
return "https://forms.joai.ai";
|
|
26
51
|
};
|
|
52
|
+
const getDocumentsBaseUrl = (env) => {
|
|
53
|
+
if (env === "local") return "http://documents.joai--api.test:3012";
|
|
54
|
+
if (env === "devnet") return "https://devnet-documents.joai.ai";
|
|
55
|
+
if (env === "testnet") return "https://testnet-documents.joai.ai";
|
|
56
|
+
return "https://documents.joai.ai";
|
|
57
|
+
};
|
|
58
|
+
const documentShareUrl = (env, locale, slug, password) => {
|
|
59
|
+
const lang = isSupportedAppLocale(locale) ? locale : "en";
|
|
60
|
+
const url = `${getDocumentsBaseUrl(env)}/${lang}/${encodeURIComponent(slug)}`;
|
|
61
|
+
if (password) return `${url}?password=${encodeURIComponent(password)}`;
|
|
62
|
+
return url;
|
|
63
|
+
};
|
|
27
64
|
const getDigestBaseUrl = (env) => {
|
|
28
65
|
if (env === "local") return "http://localhost:3005";
|
|
29
66
|
if (env === "devnet") return "https://devnet-digests.joai.ai";
|
|
@@ -77,20 +114,6 @@ const getLoginUrl = (env, returnTo, branding) => {
|
|
|
77
114
|
return `${getAppBaseUrl(env)}/login?${params}`;
|
|
78
115
|
};
|
|
79
116
|
//#endregion
|
|
80
|
-
//#region src/config/constants.ts
|
|
81
|
-
const JoaiUrls = {
|
|
82
|
-
TelegramGroup: "https://telegram.joai.ai",
|
|
83
|
-
Twitter: "https://x.com/JoAiAgents",
|
|
84
|
-
Reddit: "https://www.reddit.com/r/JoAi/",
|
|
85
|
-
GitHub: "https://github.com/JoAiHQ",
|
|
86
|
-
LinkedIn: "https://www.linkedin.com/company/joai",
|
|
87
|
-
Docs: "https://docs.joai.ai",
|
|
88
|
-
DocsApi: "https://docs.joai.ai/api",
|
|
89
|
-
DocsWebhooks: "https://docs.joai.ai/webhooks",
|
|
90
|
-
AppStore: "https://apps.apple.com/app/joai/id6741204807",
|
|
91
|
-
PlayStore: "https://play.google.com/store/apps/details?id=ai.joai.app"
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
117
|
//#region src/http/service.ts
|
|
95
118
|
var HttpService = class {
|
|
96
119
|
constructor(baseUrl, cookies, authToken, options) {
|
|
@@ -196,12 +219,35 @@ var HttpService = class {
|
|
|
196
219
|
}
|
|
197
220
|
};
|
|
198
221
|
//#endregion
|
|
222
|
+
//#region src/http/errors.ts
|
|
223
|
+
/** First localized string from a Laravel-style `errors` map (`field → string | string[]`). */
|
|
224
|
+
const firstValidationMessage = (errors) => {
|
|
225
|
+
if (!errors || typeof errors !== "object" || Array.isArray(errors)) return void 0;
|
|
226
|
+
for (const value of Object.values(errors)) {
|
|
227
|
+
const message = validationMessageValue(value);
|
|
228
|
+
if (message) return message;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
/** Localized validation message for a specific field, when present. */
|
|
232
|
+
const validationMessageFor = (errors, field) => {
|
|
233
|
+
if (!errors || typeof errors !== "object" || Array.isArray(errors)) return void 0;
|
|
234
|
+
return validationMessageValue(errors[field]);
|
|
235
|
+
};
|
|
236
|
+
const validationMessageValue = (value) => {
|
|
237
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
238
|
+
if (Array.isArray(value) && typeof value[0] === "string" && value[0].trim()) return value[0].trim();
|
|
239
|
+
};
|
|
240
|
+
//#endregion
|
|
199
241
|
//#region src/helpers/string.ts
|
|
200
242
|
const sanitizeAlphanumeric = (val) => val.replace(/[^a-z0-9]/gi, "");
|
|
201
243
|
const sanitizeNumeric = (val) => {
|
|
202
244
|
return (val.split(".").length > 2 && val.endsWith(".") ? val.slice(0, -1) : val).replace(/[^0-9\.]+/g, "");
|
|
203
245
|
};
|
|
204
|
-
const toNameInitials = (name) =>
|
|
246
|
+
const toNameInitials = (name) => {
|
|
247
|
+
const parts = name?.trim().split(/\s+/).filter(Boolean) ?? [];
|
|
248
|
+
if (parts.length === 0) return "?";
|
|
249
|
+
return parts.map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
250
|
+
};
|
|
205
251
|
const toPreviewText = (text, maxChars = 100) => {
|
|
206
252
|
if (!text) return "";
|
|
207
253
|
let sanitized = text.replace(/<\/?(h[1-6])[^>]*>/gi, " - ").replace(/<\/?(p|div|ul|ol|li|br|hr)[^>]*>/gi, " ").replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim();
|
|
@@ -930,4 +976,4 @@ const DefaultInviteTeamRole = UserRoles.Member;
|
|
|
930
976
|
const inviteableTeamRoles = () => [...InviteableTeamRoles];
|
|
931
977
|
const defaultInviteTeamRole = () => DefaultInviteTeamRole;
|
|
932
978
|
//#endregion
|
|
933
|
-
export { AUTOMATION_SEND_CHANNELS, AddressTypes, AgentToolingAccess, BillingManageAccess, CAMPAIGN_CHANNELS, CONTACT_MESSAGE_SEND_WARP, ContractCategoryDisplayNames, 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, TeamManageAccess, TeamViewAccess, UNIFIED_MCP_SERVER_NAME, UserPermissions, UserRoles, abbreviateNumber, addressTypeValues, automationSendChannel, buildAgentMcpServerName, buildAgentSetupClipboardText, buildAppSetupClipboardText, buildFeatureSetupClipboardText, buildMcpServerName, canOpenFulfillmentFlow, canTransitionOrderStatus, cartLineTotal, cartPayableTotal, createCursorMcpInstallLink, defaultInviteTeamRole, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, 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, 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, withRetry };
|
|
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 };
|