@joai/core 4.15.3 → 4.15.5
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 +466 -393
- package/dist/index.mjs +179 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ declare const getFormsBaseUrl: (env: AppEnv) => "http://forms.joai--api.test:300
|
|
|
23
23
|
declare const getDigestBaseUrl: (env: AppEnv) => "http://localhost:3005" | "https://devnet-digests.joai.ai" | "https://testnet-digests.joai.ai" | "https://digests.joai.ai";
|
|
24
24
|
declare const getStoreBaseUrl: (env: AppEnv) => "http://localhost:3005" | "https://devnet-store.joai.ai" | "https://testnet-store.joai.ai" | "https://store.joai.ai";
|
|
25
25
|
declare const getAgentsBaseUrl: (env: AppEnv) => "http://localhost:3007" | "https://devnet-agents.joai.ai" | "https://testnet-agents.joai.ai" | "https://agents.joai.ai";
|
|
26
|
+
declare const getGenBaseUrl: (env: AppEnv) => "http://localhost:3011" | "https://devnet-gen.joai.ai" | "https://testnet-gen.joai.ai" | "https://gen.joai.ai";
|
|
26
27
|
declare const getMcpServerUrl: (env: AppEnv) => string;
|
|
27
28
|
declare const getMcpServerAgentUrl: (env: AppEnv, agent: string) => string;
|
|
28
29
|
declare const getSitesBaseUrl: (env: AppEnv) => "http://sites.joai--api.test:3007" | "https://devnet-sites.joai.ai" | "https://testnet-sites.joai.ai" | "https://sites.joai.ai";
|
|
@@ -316,12 +317,12 @@ type CheckoutSnapshotRequest = {
|
|
|
316
317
|
type: 'product' | 'service' | 'coupon';
|
|
317
318
|
quantity: number;
|
|
318
319
|
}[];
|
|
319
|
-
billingAddressId?:
|
|
320
|
-
shippingAddressId?:
|
|
320
|
+
billingAddressId?: string | null;
|
|
321
|
+
shippingAddressId?: string | null;
|
|
321
322
|
billingAddress?: AddressInput;
|
|
322
323
|
shippingAddress?: AddressInput;
|
|
323
324
|
shippingRateId?: number | null;
|
|
324
|
-
fulfillmentLocationId?:
|
|
325
|
+
fulfillmentLocationId?: string | null;
|
|
325
326
|
couponCode?: string | null;
|
|
326
327
|
};
|
|
327
328
|
type ShippingZone = {
|
|
@@ -334,9 +335,9 @@ type ShippingZone = {
|
|
|
334
335
|
rates: ShippingRate[];
|
|
335
336
|
};
|
|
336
337
|
type FulfillmentLocation = {
|
|
337
|
-
id:
|
|
338
|
+
id: string;
|
|
338
339
|
name: string;
|
|
339
|
-
addressId:
|
|
340
|
+
addressId: string | null;
|
|
340
341
|
address: Address | null;
|
|
341
342
|
instructions: string | null;
|
|
342
343
|
active: boolean;
|
|
@@ -489,8 +490,8 @@ type ContactCreatePayload = ContactFormData & {
|
|
|
489
490
|
name: string;
|
|
490
491
|
wallets?: WalletList;
|
|
491
492
|
};
|
|
492
|
-
type ContactRelationType = 'parent_of' | 'child_of' | 'spouse_of' | 'sibling_of' | 'aunt_of' | 'nibling_of' | 'manages' | 'reports_to' | 'colleague_of' | 'partner_of' | 'client_of' | 'supplier_of' | 'referred_by' | 'referred';
|
|
493
|
-
type ContactRelationCategory = 'family' | 'organization' | 'business' | 'referral';
|
|
493
|
+
type ContactRelationType = 'parent_of' | 'child_of' | 'spouse_of' | 'sibling_of' | 'aunt_of' | 'nibling_of' | 'friend_of' | 'manages' | 'reports_to' | 'colleague_of' | 'partner_of' | 'client_of' | 'supplier_of' | 'referred_by' | 'referred';
|
|
494
|
+
type ContactRelationCategory = 'family' | 'social' | 'organization' | 'business' | 'referral';
|
|
494
495
|
type ContactRelationDirection = 'outgoing' | 'incoming';
|
|
495
496
|
type ContactRelationContact = {
|
|
496
497
|
id: string;
|
|
@@ -552,6 +553,290 @@ type Media = {
|
|
|
552
553
|
aiGenerated?: boolean;
|
|
553
554
|
};
|
|
554
555
|
//#endregion
|
|
556
|
+
//#region src/integration/types.d.ts
|
|
557
|
+
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';
|
|
558
|
+
type IntegrationDetails = {
|
|
559
|
+
type: IntegrationType;
|
|
560
|
+
name: string;
|
|
561
|
+
description?: string;
|
|
562
|
+
logoUrl?: string;
|
|
563
|
+
logoUrlDark?: string;
|
|
564
|
+
slug?: string;
|
|
565
|
+
category?: string;
|
|
566
|
+
[key: string]: unknown;
|
|
567
|
+
};
|
|
568
|
+
type IntegrationMeta = {
|
|
569
|
+
handle?: string;
|
|
570
|
+
provider?: EmailProvider | null;
|
|
571
|
+
hookSource?: string;
|
|
572
|
+
[key: string]: unknown;
|
|
573
|
+
};
|
|
574
|
+
type IntegrationConnectionDetails = IntegrationDetails & {
|
|
575
|
+
phoneNumberId?: string;
|
|
576
|
+
phoneNumber?: string;
|
|
577
|
+
webhookUrl?: string;
|
|
578
|
+
webhookSecret?: string;
|
|
579
|
+
webhookSecretKey?: string;
|
|
580
|
+
};
|
|
581
|
+
type Integration = {
|
|
582
|
+
id: string;
|
|
583
|
+
type: IntegrationType;
|
|
584
|
+
name: string;
|
|
585
|
+
active: boolean;
|
|
586
|
+
configured: boolean;
|
|
587
|
+
createdAt: string;
|
|
588
|
+
meta?: IntegrationMeta;
|
|
589
|
+
details?: IntegrationConnectionDetails;
|
|
590
|
+
};
|
|
591
|
+
type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github' | 'xchat' | 'instagram';
|
|
592
|
+
type SocialBot = {
|
|
593
|
+
name: string;
|
|
594
|
+
createdAt: string;
|
|
595
|
+
phoneNumberId?: string;
|
|
596
|
+
phoneNumber?: string;
|
|
597
|
+
applicationId?: string;
|
|
598
|
+
appId?: string;
|
|
599
|
+
installationId?: string;
|
|
600
|
+
username?: string;
|
|
601
|
+
};
|
|
602
|
+
type XIntegrationStatus = {
|
|
603
|
+
enabled: boolean;
|
|
604
|
+
integrationId: string | null;
|
|
605
|
+
xAccountLinked: boolean;
|
|
606
|
+
currentAgentName: string | null;
|
|
607
|
+
};
|
|
608
|
+
type EmbedStatus = {
|
|
609
|
+
integrationId: string;
|
|
610
|
+
agentName: string;
|
|
611
|
+
agentAvatar: string | null;
|
|
612
|
+
active: boolean;
|
|
613
|
+
allowedDomains: string[];
|
|
614
|
+
};
|
|
615
|
+
type EmailProvider = 'resend' | 'mailgun' | 'sendgrid';
|
|
616
|
+
type CalendarProvider = 'google' | 'apple' | 'microsoft';
|
|
617
|
+
type CalendarStatus = {
|
|
618
|
+
connected: boolean;
|
|
619
|
+
provider?: CalendarProvider;
|
|
620
|
+
providerDisplayName?: string;
|
|
621
|
+
accountEmail?: string;
|
|
622
|
+
lastSynced?: string;
|
|
623
|
+
tokenHealthy?: boolean;
|
|
624
|
+
upcomingEvents?: {
|
|
625
|
+
title: string;
|
|
626
|
+
startAt: string;
|
|
627
|
+
endAt: string;
|
|
628
|
+
allDay: boolean;
|
|
629
|
+
}[];
|
|
630
|
+
};
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/agent/types.d.ts
|
|
633
|
+
type AgentCharacter = {
|
|
634
|
+
name: string | null;
|
|
635
|
+
system: string | null;
|
|
636
|
+
bio: string | null;
|
|
637
|
+
};
|
|
638
|
+
type Agent = {
|
|
639
|
+
uuid: string;
|
|
640
|
+
name: string;
|
|
641
|
+
description: string;
|
|
642
|
+
avatar: string;
|
|
643
|
+
wallets: Wallet[];
|
|
644
|
+
settings: AgentSettings;
|
|
645
|
+
store: StoreInfo;
|
|
646
|
+
character?: AgentCharacter | null;
|
|
647
|
+
room: Room;
|
|
648
|
+
role: string | null;
|
|
649
|
+
blueprint: Blueprint | null;
|
|
650
|
+
team: string;
|
|
651
|
+
};
|
|
652
|
+
type AgentPrivate = {
|
|
653
|
+
uuid: string;
|
|
654
|
+
name: string;
|
|
655
|
+
description: string;
|
|
656
|
+
avatar: string;
|
|
657
|
+
wallets: Wallet[];
|
|
658
|
+
settings: AgentSettings;
|
|
659
|
+
store: StoreInfo;
|
|
660
|
+
password: string | null;
|
|
661
|
+
authKey: string | null;
|
|
662
|
+
secKey: string;
|
|
663
|
+
phoneNumber: string | null;
|
|
664
|
+
room: Room;
|
|
665
|
+
role: string | null;
|
|
666
|
+
blueprint: Blueprint | null;
|
|
667
|
+
justCreated?: boolean;
|
|
668
|
+
team: string;
|
|
669
|
+
};
|
|
670
|
+
type AgentActionHistoryEntry = {
|
|
671
|
+
id: string;
|
|
672
|
+
action: string | null;
|
|
673
|
+
outcome: 'succeeded' | 'failed';
|
|
674
|
+
outcomeDetail: string | null;
|
|
675
|
+
warpIdentifier: string | null;
|
|
676
|
+
meta: Record<string, unknown> | null;
|
|
677
|
+
createdAt: string | null;
|
|
678
|
+
};
|
|
679
|
+
type AgentSimple = {
|
|
680
|
+
uuid: string;
|
|
681
|
+
name: string;
|
|
682
|
+
avatar?: string | null;
|
|
683
|
+
authKey?: string | null;
|
|
684
|
+
team?: {
|
|
685
|
+
slug: string;
|
|
686
|
+
} | null;
|
|
687
|
+
settings?: Pick<AgentSettings, 'auto'>;
|
|
688
|
+
};
|
|
689
|
+
type AgentWalletMode = 'local' | 'cloud' | 'external';
|
|
690
|
+
type AgentEngine = 'cortex' | 'openclaw';
|
|
691
|
+
type AgentGender = 'male' | 'female' | 'neutral';
|
|
692
|
+
type AgentTrustedActionRule = {
|
|
693
|
+
id: string;
|
|
694
|
+
hash: string;
|
|
695
|
+
match?: Record<string, string>;
|
|
696
|
+
identifier?: string;
|
|
697
|
+
title?: string;
|
|
698
|
+
};
|
|
699
|
+
type AgentSettings = {
|
|
700
|
+
auto: boolean;
|
|
701
|
+
'model.url': string;
|
|
702
|
+
'voice.output': boolean;
|
|
703
|
+
'voice.id': string | null;
|
|
704
|
+
'agent.gender'?: AgentGender;
|
|
705
|
+
'proactivity.enabled': boolean;
|
|
706
|
+
'proactivity.quietHoursStart'?: number;
|
|
707
|
+
'proactivity.quietHoursEnd'?: number;
|
|
708
|
+
'proactivity.maxMessagesPerDay'?: number;
|
|
709
|
+
'proactivity.timezone'?: string;
|
|
710
|
+
'proactivity.blockedBehaviors'?: string[];
|
|
711
|
+
engine: AgentEngine;
|
|
712
|
+
'training.url'?: string | null;
|
|
713
|
+
'training.status'?: 'idle' | 'training' | 'completed' | 'failed' | null;
|
|
714
|
+
'training.recrawlInterval'?: number | null;
|
|
715
|
+
'email_provider'?: EmailProvider | null;
|
|
716
|
+
};
|
|
717
|
+
type LocalAgentWallet = {
|
|
718
|
+
provider: WarpWalletProvider;
|
|
719
|
+
address: string;
|
|
720
|
+
mnemonic?: string | null;
|
|
721
|
+
privateKey?: string | null;
|
|
722
|
+
};
|
|
723
|
+
type AgentExecuteHandler = (prompt: string, options?: AgentExecuteOptions) => void;
|
|
724
|
+
type AgentExecuteOptions = {
|
|
725
|
+
audio?: File;
|
|
726
|
+
sender?: string;
|
|
727
|
+
media?: Media[];
|
|
728
|
+
ghost?: boolean;
|
|
729
|
+
context?: Record<string, unknown>;
|
|
730
|
+
};
|
|
731
|
+
//#endregion
|
|
732
|
+
//#region src/room/types.d.ts
|
|
733
|
+
type RoomId = string;
|
|
734
|
+
type RoomKind = 'default' | 'phone' | 'meeting';
|
|
735
|
+
type Room = {
|
|
736
|
+
id: string;
|
|
737
|
+
name: string;
|
|
738
|
+
description: string | null;
|
|
739
|
+
public: boolean;
|
|
740
|
+
default: boolean;
|
|
741
|
+
active: boolean;
|
|
742
|
+
kind?: RoomKind | null;
|
|
743
|
+
archivedAt?: string | null;
|
|
744
|
+
secKey: string | null;
|
|
745
|
+
createdAt: string | null;
|
|
746
|
+
contactId?: string | null;
|
|
747
|
+
agent: AgentSimple;
|
|
748
|
+
integration: Integration | null;
|
|
749
|
+
};
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region src/meeting/types.d.ts
|
|
752
|
+
type MeetingSessionState = 'idle' | 'listening' | 'ended';
|
|
753
|
+
type TranscriptEntry = {
|
|
754
|
+
id: string;
|
|
755
|
+
text: string;
|
|
756
|
+
isFinal: boolean;
|
|
757
|
+
timestamp: number;
|
|
758
|
+
speakerId?: number;
|
|
759
|
+
speakerName?: string;
|
|
760
|
+
};
|
|
761
|
+
type BookmarkEntry = {
|
|
762
|
+
id: string;
|
|
763
|
+
timestamp: number;
|
|
764
|
+
transcriptEntryId: string;
|
|
765
|
+
};
|
|
766
|
+
type MeetingParticipant = {
|
|
767
|
+
name: string | null;
|
|
768
|
+
profileImageUrl: string | null;
|
|
769
|
+
};
|
|
770
|
+
type MeetingSpeakerAssignment = {
|
|
771
|
+
speakerId: number;
|
|
772
|
+
name: string;
|
|
773
|
+
contactId: string | null;
|
|
774
|
+
};
|
|
775
|
+
type Meeting = {
|
|
776
|
+
id: string;
|
|
777
|
+
code: string;
|
|
778
|
+
name: string | null;
|
|
779
|
+
room: Room | null;
|
|
780
|
+
inviteUrl: string;
|
|
781
|
+
status: MeetingStatus;
|
|
782
|
+
conferenceProvider: MeetingConferenceProvider | null;
|
|
783
|
+
conferenceUrl: string | null;
|
|
784
|
+
conferenceExternalId: string | null;
|
|
785
|
+
configuration?: Configuration;
|
|
786
|
+
captureMode: 'desktop_local' | null;
|
|
787
|
+
transcriptUrl: string | null;
|
|
788
|
+
summaryUrl: string | null;
|
|
789
|
+
participants?: MeetingParticipant[]; /** CRM contacts linked to an appointment booking, when available. */
|
|
790
|
+
contacts?: Contact[];
|
|
791
|
+
speakerAssignments?: MeetingSpeakerAssignment[] | null;
|
|
792
|
+
scheduledAt: string | null;
|
|
793
|
+
scheduledEndAt?: string | null;
|
|
794
|
+
timezone?: string | null;
|
|
795
|
+
calendarEventId: number | null;
|
|
796
|
+
startedAt: string | null;
|
|
797
|
+
endedAt: string | null;
|
|
798
|
+
createdAt: string;
|
|
799
|
+
};
|
|
800
|
+
type MeetingStatus = 'active' | 'completed' | 'analyzed' | 'scheduled' | 'cancelled';
|
|
801
|
+
type MeetingConferenceProvider = 'google_meet' | 'teams' | 'zoom';
|
|
802
|
+
type MeetingFeature = 'transcription' | 'summary' | 'insights' | 'actions';
|
|
803
|
+
type MeetingJoinTeam = {
|
|
804
|
+
name: string;
|
|
805
|
+
logo: string | null;
|
|
806
|
+
};
|
|
807
|
+
type MeetingJoinInfo = {
|
|
808
|
+
id: string;
|
|
809
|
+
code: string;
|
|
810
|
+
name: string | null;
|
|
811
|
+
inviteUrl: string;
|
|
812
|
+
agentName: string;
|
|
813
|
+
team: MeetingJoinTeam;
|
|
814
|
+
status: MeetingStatus;
|
|
815
|
+
isPhysical: boolean;
|
|
816
|
+
scheduledAt: string | null;
|
|
817
|
+
scheduledEndAt: string | null;
|
|
818
|
+
timezone: string;
|
|
819
|
+
conferenceUrl: string | null;
|
|
820
|
+
conferenceProvider: MeetingConferenceProvider | null;
|
|
821
|
+
endedAt: string | null;
|
|
822
|
+
canCancel: boolean;
|
|
823
|
+
features: Record<MeetingFeature, boolean>;
|
|
824
|
+
};
|
|
825
|
+
type MeetingTranscriptEntry = {
|
|
826
|
+
speaker: 'user' | 'agent';
|
|
827
|
+
text: string;
|
|
828
|
+
timestamp: string;
|
|
829
|
+
};
|
|
830
|
+
type MeetingUsage = {
|
|
831
|
+
current: number;
|
|
832
|
+
limit: number;
|
|
833
|
+
reached: boolean;
|
|
834
|
+
remainingWords: number | null;
|
|
835
|
+
};
|
|
836
|
+
type MeetingSummary = {
|
|
837
|
+
content: string;
|
|
838
|
+
};
|
|
839
|
+
//#endregion
|
|
555
840
|
//#region src/site/types.d.ts
|
|
556
841
|
type SiteType = 'undefined' | 'shop';
|
|
557
842
|
type SiteTeam = {
|
|
@@ -811,6 +1096,7 @@ declare const NativeApps: {
|
|
|
811
1096
|
readonly Artifacts: "artifacts";
|
|
812
1097
|
readonly Social: "social";
|
|
813
1098
|
readonly Studio: "studio";
|
|
1099
|
+
readonly Loyalty: "loyalty";
|
|
814
1100
|
};
|
|
815
1101
|
type NativeApp = (typeof NativeApps)[keyof typeof NativeApps];
|
|
816
1102
|
declare const nativeAppSlugs: NativeApp[];
|
|
@@ -871,6 +1157,7 @@ type TeamMeta = {
|
|
|
871
1157
|
'payments.coupons'?: boolean;
|
|
872
1158
|
'kiosk.enabled'?: boolean;
|
|
873
1159
|
'stock.enabled'?: boolean;
|
|
1160
|
+
'orders.notify_emails'?: string[];
|
|
874
1161
|
contactPropertyMaskWarp?: string;
|
|
875
1162
|
branding?: TeamBrand | null;
|
|
876
1163
|
settings: Record<string, unknown> & {
|
|
@@ -992,6 +1279,7 @@ type TeamSettings = {
|
|
|
992
1279
|
'payments.coupons'?: boolean;
|
|
993
1280
|
'kiosk.enabled'?: boolean;
|
|
994
1281
|
'stock.enabled'?: boolean;
|
|
1282
|
+
'orders.notify_emails'?: string[];
|
|
995
1283
|
branding?: TeamBrand | null;
|
|
996
1284
|
};
|
|
997
1285
|
type TeamUsage = Partial<Record<PlanFeature, TeamFeatureUsage>> & {
|
|
@@ -1256,7 +1544,8 @@ type Product = {
|
|
|
1256
1544
|
media?: Media[];
|
|
1257
1545
|
};
|
|
1258
1546
|
type OrderItem = {
|
|
1259
|
-
id: string | null;
|
|
1547
|
+
id: string | null; /** Database id of the order_items row — required for fulfillments/returns. */
|
|
1548
|
+
orderItemId: number;
|
|
1260
1549
|
name: string;
|
|
1261
1550
|
quantity: number;
|
|
1262
1551
|
unitPrice: number;
|
|
@@ -1282,6 +1571,7 @@ type Order = {
|
|
|
1282
1571
|
status: OrderStatus;
|
|
1283
1572
|
paymentUrl?: string | null;
|
|
1284
1573
|
invoiceUrl: string | null;
|
|
1574
|
+
deliveryNoteUrl: string | null;
|
|
1285
1575
|
justCreated?: boolean;
|
|
1286
1576
|
createdAt: string;
|
|
1287
1577
|
invoiceDate: string;
|
|
@@ -1296,7 +1586,8 @@ type Order = {
|
|
|
1296
1586
|
paymentMode: string | null;
|
|
1297
1587
|
priceMode?: OrderPriceMode | null;
|
|
1298
1588
|
linkVariationId: string | null;
|
|
1299
|
-
notes: string | null;
|
|
1589
|
+
notes: string | null; /** Linked pickup appointment when booked (canonical Meeting resource). */
|
|
1590
|
+
meeting?: Meeting | null;
|
|
1300
1591
|
site?: Site | null;
|
|
1301
1592
|
fulfillmentMethod?: FulfillmentMethod | null;
|
|
1302
1593
|
billingAddress?: AddressSnapshot | null;
|
|
@@ -1331,289 +1622,94 @@ type CartItem = {
|
|
|
1331
1622
|
media: Media[];
|
|
1332
1623
|
product?: Product | null;
|
|
1333
1624
|
};
|
|
1334
|
-
type Cart = {
|
|
1335
|
-
subtotal: number;
|
|
1336
|
-
taxes: {
|
|
1337
|
-
amount: number;
|
|
1338
|
-
percent: number;
|
|
1339
|
-
};
|
|
1340
|
-
total: number;
|
|
1341
|
-
items: CartItem[];
|
|
1342
|
-
coupon: Coupon | null;
|
|
1343
|
-
couponDiscount: number;
|
|
1344
|
-
};
|
|
1345
|
-
type CouponCondition = 'none' | 'onetime-use' | 'previous-purchase';
|
|
1346
|
-
type CouponRestrictedItemType = 'product' | 'service';
|
|
1347
|
-
type CouponRestrictedItem = {
|
|
1348
|
-
type: CouponRestrictedItemType;
|
|
1349
|
-
ref: string;
|
|
1350
|
-
};
|
|
1351
|
-
type Coupon = {
|
|
1352
|
-
id: string;
|
|
1353
|
-
code: string;
|
|
1354
|
-
name: TranslatableValue;
|
|
1355
|
-
amount: number | null;
|
|
1356
|
-
percent: number | null;
|
|
1357
|
-
price: number | null;
|
|
1358
|
-
discount?: number;
|
|
1359
|
-
condition: CouponCondition;
|
|
1360
|
-
restrictedItems: CouponRestrictedItem[];
|
|
1361
|
-
usesLeft: number | null;
|
|
1362
|
-
expiresAt: string | null;
|
|
1363
|
-
active: boolean;
|
|
1364
|
-
public: boolean;
|
|
1365
|
-
sellable: boolean;
|
|
1366
|
-
redemptionCount?: number;
|
|
1367
|
-
media: Media[];
|
|
1368
|
-
};
|
|
1369
|
-
type PurchaseResult = {
|
|
1370
|
-
order_id?: string;
|
|
1371
|
-
message?: string;
|
|
1372
|
-
subscription_active?: boolean;
|
|
1373
|
-
};
|
|
1374
|
-
type PurchaseOptions = {
|
|
1375
|
-
forceProvider?: PaymentProvider;
|
|
1376
|
-
billingAddress?: AddressSnapshot | null;
|
|
1377
|
-
meta?: Record<string, string>;
|
|
1378
|
-
};
|
|
1379
|
-
//#endregion
|
|
1380
|
-
//#region src/skill/types.d.ts
|
|
1381
|
-
declare const SkillType: {
|
|
1382
|
-
readonly Knowledge: "knowledge";
|
|
1383
|
-
readonly ContentTemplate: "content-template";
|
|
1384
|
-
readonly PersonalityClone: "personality-clone";
|
|
1385
|
-
readonly BrandKit: "brand-kit";
|
|
1386
|
-
readonly VideoTemplate: "video-template";
|
|
1387
|
-
readonly VisualKit: "visual-kit";
|
|
1388
|
-
};
|
|
1389
|
-
type SkillTypeValue = (typeof SkillType)[keyof typeof SkillType];
|
|
1390
|
-
declare const SkillMediaBindingRole: {
|
|
1391
|
-
readonly Subject: "subject";
|
|
1392
|
-
readonly Style: "style";
|
|
1393
|
-
readonly Logo: "logo";
|
|
1394
|
-
readonly Product: "product";
|
|
1395
|
-
readonly Motion: "motion";
|
|
1396
|
-
readonly FirstFrame: "first_frame";
|
|
1397
|
-
readonly LastFrame: "last_frame";
|
|
1398
|
-
};
|
|
1399
|
-
type SkillMediaBindingRoleValue = (typeof SkillMediaBindingRole)[keyof typeof SkillMediaBindingRole];
|
|
1400
|
-
declare const SkillScope: {
|
|
1401
|
-
readonly Agent: "agent";
|
|
1402
|
-
readonly Team: "team";
|
|
1403
|
-
};
|
|
1404
|
-
type SkillScopeValue = (typeof SkillScope)[keyof typeof SkillScope];
|
|
1405
|
-
type Skill = {
|
|
1406
|
-
id: string;
|
|
1407
|
-
name: string;
|
|
1408
|
-
description: string;
|
|
1409
|
-
content: string;
|
|
1410
|
-
meta: Record<string, unknown> | null;
|
|
1411
|
-
license: string | null;
|
|
1412
|
-
compatibility: string | null;
|
|
1413
|
-
allowedTools: string | null;
|
|
1414
|
-
source: string;
|
|
1415
|
-
sourcePath: string | null;
|
|
1416
|
-
scope?: SkillScopeValue;
|
|
1417
|
-
active: boolean;
|
|
1418
|
-
store: StoreInfo;
|
|
1419
|
-
createdAt: string;
|
|
1420
|
-
media?: Media[];
|
|
1421
|
-
screenshots: string[];
|
|
1422
|
-
};
|
|
1423
|
-
//#endregion
|
|
1424
|
-
//#region src/integration/types.d.ts
|
|
1425
|
-
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';
|
|
1426
|
-
type IntegrationDetails = {
|
|
1427
|
-
type: IntegrationType;
|
|
1428
|
-
name: string;
|
|
1429
|
-
description?: string;
|
|
1430
|
-
logoUrl?: string;
|
|
1431
|
-
logoUrlDark?: string;
|
|
1432
|
-
slug?: string;
|
|
1433
|
-
category?: string;
|
|
1434
|
-
[key: string]: unknown;
|
|
1435
|
-
};
|
|
1436
|
-
type IntegrationMeta = {
|
|
1437
|
-
handle?: string;
|
|
1438
|
-
provider?: EmailProvider | null;
|
|
1439
|
-
hookSource?: string;
|
|
1440
|
-
[key: string]: unknown;
|
|
1441
|
-
};
|
|
1442
|
-
type IntegrationConnectionDetails = IntegrationDetails & {
|
|
1443
|
-
phoneNumberId?: string;
|
|
1444
|
-
phoneNumber?: string;
|
|
1445
|
-
webhookUrl?: string;
|
|
1446
|
-
webhookSecret?: string;
|
|
1447
|
-
webhookSecretKey?: string;
|
|
1448
|
-
};
|
|
1449
|
-
type Integration = {
|
|
1450
|
-
id: string;
|
|
1451
|
-
type: IntegrationType;
|
|
1452
|
-
name: string;
|
|
1453
|
-
active: boolean;
|
|
1454
|
-
configured: boolean;
|
|
1455
|
-
createdAt: string;
|
|
1456
|
-
meta?: IntegrationMeta;
|
|
1457
|
-
details?: IntegrationConnectionDetails;
|
|
1458
|
-
};
|
|
1459
|
-
type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github' | 'xchat' | 'instagram';
|
|
1460
|
-
type SocialBot = {
|
|
1461
|
-
name: string;
|
|
1462
|
-
createdAt: string;
|
|
1463
|
-
phoneNumberId?: string;
|
|
1464
|
-
phoneNumber?: string;
|
|
1465
|
-
applicationId?: string;
|
|
1466
|
-
appId?: string;
|
|
1467
|
-
installationId?: string;
|
|
1468
|
-
username?: string;
|
|
1469
|
-
};
|
|
1470
|
-
type XIntegrationStatus = {
|
|
1471
|
-
enabled: boolean;
|
|
1472
|
-
integrationId: string | null;
|
|
1473
|
-
xAccountLinked: boolean;
|
|
1474
|
-
currentAgentName: string | null;
|
|
1475
|
-
};
|
|
1476
|
-
type EmbedStatus = {
|
|
1477
|
-
integrationId: string;
|
|
1478
|
-
agentName: string;
|
|
1479
|
-
agentAvatar: string | null;
|
|
1480
|
-
active: boolean;
|
|
1481
|
-
allowedDomains: string[];
|
|
1482
|
-
};
|
|
1483
|
-
type EmailProvider = 'resend' | 'mailgun' | 'sendgrid';
|
|
1484
|
-
type CalendarProvider = 'google' | 'apple' | 'microsoft';
|
|
1485
|
-
type CalendarStatus = {
|
|
1486
|
-
connected: boolean;
|
|
1487
|
-
provider?: CalendarProvider;
|
|
1488
|
-
providerDisplayName?: string;
|
|
1489
|
-
accountEmail?: string;
|
|
1490
|
-
lastSynced?: string;
|
|
1491
|
-
tokenHealthy?: boolean;
|
|
1492
|
-
upcomingEvents?: {
|
|
1493
|
-
title: string;
|
|
1494
|
-
startAt: string;
|
|
1495
|
-
endAt: string;
|
|
1496
|
-
allDay: boolean;
|
|
1497
|
-
}[];
|
|
1498
|
-
};
|
|
1499
|
-
//#endregion
|
|
1500
|
-
//#region src/room/types.d.ts
|
|
1501
|
-
type RoomId = string;
|
|
1502
|
-
type RoomKind = 'default' | 'phone' | 'meeting';
|
|
1503
|
-
type Room = {
|
|
1504
|
-
id: string;
|
|
1505
|
-
name: string;
|
|
1506
|
-
description: string | null;
|
|
1507
|
-
public: boolean;
|
|
1508
|
-
default: boolean;
|
|
1509
|
-
active: boolean;
|
|
1510
|
-
kind?: RoomKind | null;
|
|
1511
|
-
archivedAt?: string | null;
|
|
1512
|
-
secKey: string | null;
|
|
1513
|
-
createdAt: string | null;
|
|
1514
|
-
contactId?: string | null;
|
|
1515
|
-
agent: AgentSimple;
|
|
1516
|
-
integration: Integration | null;
|
|
1517
|
-
};
|
|
1518
|
-
//#endregion
|
|
1519
|
-
//#region src/agent/types.d.ts
|
|
1520
|
-
type AgentCharacter = {
|
|
1521
|
-
name: string | null;
|
|
1522
|
-
system: string | null;
|
|
1523
|
-
bio: string | null;
|
|
1524
|
-
};
|
|
1525
|
-
type Agent = {
|
|
1526
|
-
uuid: string;
|
|
1527
|
-
name: string;
|
|
1528
|
-
description: string;
|
|
1529
|
-
avatar: string;
|
|
1530
|
-
wallets: Wallet[];
|
|
1531
|
-
settings: AgentSettings;
|
|
1532
|
-
store: StoreInfo;
|
|
1533
|
-
character?: AgentCharacter | null;
|
|
1534
|
-
room: Room;
|
|
1535
|
-
role: string | null;
|
|
1536
|
-
blueprint: Blueprint | null;
|
|
1537
|
-
team: string;
|
|
1538
|
-
};
|
|
1539
|
-
type AgentPrivate = {
|
|
1540
|
-
uuid: string;
|
|
1541
|
-
name: string;
|
|
1542
|
-
description: string;
|
|
1543
|
-
avatar: string;
|
|
1544
|
-
wallets: Wallet[];
|
|
1545
|
-
settings: AgentSettings;
|
|
1546
|
-
store: StoreInfo;
|
|
1547
|
-
password: string | null;
|
|
1548
|
-
authKey: string | null;
|
|
1549
|
-
secKey: string;
|
|
1550
|
-
phoneNumber: string | null;
|
|
1551
|
-
room: Room;
|
|
1552
|
-
role: string | null;
|
|
1553
|
-
blueprint: Blueprint | null;
|
|
1554
|
-
justCreated?: boolean;
|
|
1555
|
-
team: string;
|
|
1556
|
-
};
|
|
1557
|
-
type AgentActionHistoryEntry = {
|
|
1558
|
-
id: string;
|
|
1559
|
-
action: string | null;
|
|
1560
|
-
outcome: 'succeeded' | 'failed';
|
|
1561
|
-
outcomeDetail: string | null;
|
|
1562
|
-
warpIdentifier: string | null;
|
|
1563
|
-
meta: Record<string, unknown> | null;
|
|
1564
|
-
createdAt: string | null;
|
|
1625
|
+
type Cart = {
|
|
1626
|
+
subtotal: number;
|
|
1627
|
+
taxes: {
|
|
1628
|
+
amount: number;
|
|
1629
|
+
percent: number;
|
|
1630
|
+
};
|
|
1631
|
+
total: number;
|
|
1632
|
+
items: CartItem[];
|
|
1633
|
+
coupon: Coupon | null;
|
|
1634
|
+
couponDiscount: number;
|
|
1565
1635
|
};
|
|
1566
|
-
type
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
team?: {
|
|
1572
|
-
slug: string;
|
|
1573
|
-
} | null;
|
|
1574
|
-
settings?: Pick<AgentSettings, 'auto'>;
|
|
1636
|
+
type CouponCondition = 'none' | 'onetime-use' | 'previous-purchase';
|
|
1637
|
+
type CouponRestrictedItemType = 'product' | 'service';
|
|
1638
|
+
type CouponRestrictedItem = {
|
|
1639
|
+
type: CouponRestrictedItemType;
|
|
1640
|
+
ref: string;
|
|
1575
1641
|
};
|
|
1576
|
-
type
|
|
1577
|
-
type AgentEngine = 'cortex' | 'openclaw';
|
|
1578
|
-
type AgentGender = 'male' | 'female' | 'neutral';
|
|
1579
|
-
type AgentTrustedActionRule = {
|
|
1642
|
+
type Coupon = {
|
|
1580
1643
|
id: string;
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1644
|
+
code: string;
|
|
1645
|
+
name: TranslatableValue;
|
|
1646
|
+
amount: number | null;
|
|
1647
|
+
percent: number | null;
|
|
1648
|
+
price: number | null;
|
|
1649
|
+
discount?: number;
|
|
1650
|
+
condition: CouponCondition;
|
|
1651
|
+
restrictedItems: CouponRestrictedItem[];
|
|
1652
|
+
usesLeft: number | null;
|
|
1653
|
+
expiresAt: string | null;
|
|
1654
|
+
active: boolean;
|
|
1655
|
+
public: boolean;
|
|
1656
|
+
sellable: boolean;
|
|
1657
|
+
redemptionCount?: number;
|
|
1658
|
+
media: Media[];
|
|
1585
1659
|
};
|
|
1586
|
-
type
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
'voice.id': string | null;
|
|
1591
|
-
'agent.gender'?: AgentGender;
|
|
1592
|
-
'proactivity.enabled': boolean;
|
|
1593
|
-
'proactivity.quietHoursStart'?: number;
|
|
1594
|
-
'proactivity.quietHoursEnd'?: number;
|
|
1595
|
-
'proactivity.maxMessagesPerDay'?: number;
|
|
1596
|
-
'proactivity.timezone'?: string;
|
|
1597
|
-
'proactivity.blockedBehaviors'?: string[];
|
|
1598
|
-
engine: AgentEngine;
|
|
1599
|
-
'training.url'?: string | null;
|
|
1600
|
-
'training.status'?: 'idle' | 'training' | 'completed' | 'failed' | null;
|
|
1601
|
-
'training.recrawlInterval'?: number | null;
|
|
1602
|
-
'email_provider'?: EmailProvider | null;
|
|
1660
|
+
type PurchaseResult = {
|
|
1661
|
+
order_id?: string;
|
|
1662
|
+
message?: string;
|
|
1663
|
+
subscription_active?: boolean;
|
|
1603
1664
|
};
|
|
1604
|
-
type
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
privateKey?: string | null;
|
|
1665
|
+
type PurchaseOptions = {
|
|
1666
|
+
forceProvider?: PaymentProvider;
|
|
1667
|
+
billingAddress?: AddressSnapshot | null;
|
|
1668
|
+
meta?: Record<string, string>;
|
|
1609
1669
|
};
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1670
|
+
//#endregion
|
|
1671
|
+
//#region src/skill/types.d.ts
|
|
1672
|
+
declare const SkillType: {
|
|
1673
|
+
readonly Knowledge: "knowledge";
|
|
1674
|
+
readonly ContentTemplate: "content-template";
|
|
1675
|
+
readonly PersonalityClone: "personality-clone";
|
|
1676
|
+
readonly BrandKit: "brand-kit";
|
|
1677
|
+
readonly VideoTemplate: "video-template";
|
|
1678
|
+
readonly VisualKit: "visual-kit";
|
|
1679
|
+
};
|
|
1680
|
+
type SkillTypeValue = (typeof SkillType)[keyof typeof SkillType];
|
|
1681
|
+
declare const SkillMediaBindingRole: {
|
|
1682
|
+
readonly Subject: "subject";
|
|
1683
|
+
readonly Style: "style";
|
|
1684
|
+
readonly Logo: "logo";
|
|
1685
|
+
readonly Product: "product";
|
|
1686
|
+
readonly Motion: "motion";
|
|
1687
|
+
readonly FirstFrame: "first_frame";
|
|
1688
|
+
readonly LastFrame: "last_frame";
|
|
1689
|
+
};
|
|
1690
|
+
type SkillMediaBindingRoleValue = (typeof SkillMediaBindingRole)[keyof typeof SkillMediaBindingRole];
|
|
1691
|
+
declare const SkillScope: {
|
|
1692
|
+
readonly Agent: "agent";
|
|
1693
|
+
readonly Team: "team";
|
|
1694
|
+
};
|
|
1695
|
+
type SkillScopeValue = (typeof SkillScope)[keyof typeof SkillScope];
|
|
1696
|
+
type Skill = {
|
|
1697
|
+
id: string;
|
|
1698
|
+
name: string;
|
|
1699
|
+
description: string;
|
|
1700
|
+
content: string;
|
|
1701
|
+
meta: Record<string, unknown> | null;
|
|
1702
|
+
license: string | null;
|
|
1703
|
+
compatibility: string | null;
|
|
1704
|
+
allowedTools: string | null;
|
|
1705
|
+
source: string;
|
|
1706
|
+
sourcePath: string | null;
|
|
1707
|
+
scope?: SkillScopeValue;
|
|
1708
|
+
active: boolean;
|
|
1709
|
+
store: StoreInfo;
|
|
1710
|
+
createdAt: string;
|
|
1614
1711
|
media?: Media[];
|
|
1615
|
-
|
|
1616
|
-
context?: Record<string, unknown>;
|
|
1712
|
+
screenshots: string[];
|
|
1617
1713
|
};
|
|
1618
1714
|
//#endregion
|
|
1619
1715
|
//#region src/link/types.d.ts
|
|
@@ -2180,95 +2276,6 @@ type Service = {
|
|
|
2180
2276
|
updatedAt: string;
|
|
2181
2277
|
};
|
|
2182
2278
|
//#endregion
|
|
2183
|
-
//#region src/meeting/types.d.ts
|
|
2184
|
-
type MeetingSessionState = 'idle' | 'listening' | 'ended';
|
|
2185
|
-
type TranscriptEntry = {
|
|
2186
|
-
id: string;
|
|
2187
|
-
text: string;
|
|
2188
|
-
isFinal: boolean;
|
|
2189
|
-
timestamp: number;
|
|
2190
|
-
speakerId?: number;
|
|
2191
|
-
speakerName?: string;
|
|
2192
|
-
};
|
|
2193
|
-
type BookmarkEntry = {
|
|
2194
|
-
id: string;
|
|
2195
|
-
timestamp: number;
|
|
2196
|
-
transcriptEntryId: string;
|
|
2197
|
-
};
|
|
2198
|
-
type MeetingParticipant = {
|
|
2199
|
-
name: string | null;
|
|
2200
|
-
profileImageUrl: string | null;
|
|
2201
|
-
};
|
|
2202
|
-
type MeetingSpeakerAssignment = {
|
|
2203
|
-
speakerId: number;
|
|
2204
|
-
name: string;
|
|
2205
|
-
contactId: string | null;
|
|
2206
|
-
};
|
|
2207
|
-
type Meeting = {
|
|
2208
|
-
id: string;
|
|
2209
|
-
code: string;
|
|
2210
|
-
name: string | null;
|
|
2211
|
-
room: Room | null;
|
|
2212
|
-
inviteUrl: string;
|
|
2213
|
-
status: MeetingStatus;
|
|
2214
|
-
conferenceProvider: MeetingConferenceProvider | null;
|
|
2215
|
-
conferenceUrl: string | null;
|
|
2216
|
-
conferenceExternalId: string | null;
|
|
2217
|
-
configuration?: Configuration;
|
|
2218
|
-
captureMode: 'desktop_local' | null;
|
|
2219
|
-
transcriptUrl: string | null;
|
|
2220
|
-
summaryUrl: string | null;
|
|
2221
|
-
participants?: MeetingParticipant[]; /** CRM contacts linked to an appointment booking, when available. */
|
|
2222
|
-
contacts?: Contact[];
|
|
2223
|
-
speakerAssignments?: MeetingSpeakerAssignment[] | null;
|
|
2224
|
-
scheduledAt: string | null;
|
|
2225
|
-
scheduledEndAt?: string | null;
|
|
2226
|
-
timezone?: string | null;
|
|
2227
|
-
calendarEventId: number | null;
|
|
2228
|
-
startedAt: string | null;
|
|
2229
|
-
endedAt: string | null;
|
|
2230
|
-
createdAt: string;
|
|
2231
|
-
};
|
|
2232
|
-
type MeetingStatus = 'active' | 'completed' | 'analyzed' | 'scheduled' | 'cancelled';
|
|
2233
|
-
type MeetingConferenceProvider = 'google_meet' | 'teams' | 'zoom';
|
|
2234
|
-
type MeetingFeature = 'transcription' | 'summary' | 'insights' | 'actions';
|
|
2235
|
-
type MeetingJoinTeam = {
|
|
2236
|
-
name: string;
|
|
2237
|
-
logo: string | null;
|
|
2238
|
-
};
|
|
2239
|
-
type MeetingJoinInfo = {
|
|
2240
|
-
id: string;
|
|
2241
|
-
code: string;
|
|
2242
|
-
name: string | null;
|
|
2243
|
-
inviteUrl: string;
|
|
2244
|
-
agentName: string;
|
|
2245
|
-
team: MeetingJoinTeam;
|
|
2246
|
-
status: MeetingStatus;
|
|
2247
|
-
isPhysical: boolean;
|
|
2248
|
-
scheduledAt: string | null;
|
|
2249
|
-
scheduledEndAt: string | null;
|
|
2250
|
-
timezone: string;
|
|
2251
|
-
conferenceUrl: string | null;
|
|
2252
|
-
conferenceProvider: MeetingConferenceProvider | null;
|
|
2253
|
-
endedAt: string | null;
|
|
2254
|
-
canCancel: boolean;
|
|
2255
|
-
features: Record<MeetingFeature, boolean>;
|
|
2256
|
-
};
|
|
2257
|
-
type MeetingTranscriptEntry = {
|
|
2258
|
-
speaker: 'user' | 'agent';
|
|
2259
|
-
text: string;
|
|
2260
|
-
timestamp: string;
|
|
2261
|
-
};
|
|
2262
|
-
type MeetingUsage = {
|
|
2263
|
-
current: number;
|
|
2264
|
-
limit: number;
|
|
2265
|
-
reached: boolean;
|
|
2266
|
-
remainingWords: number | null;
|
|
2267
|
-
};
|
|
2268
|
-
type MeetingSummary = {
|
|
2269
|
-
content: string;
|
|
2270
|
-
};
|
|
2271
|
-
//#endregion
|
|
2272
2279
|
//#region src/appointment/types.d.ts
|
|
2273
2280
|
type AppointmentSlot = {
|
|
2274
2281
|
start: string;
|
|
@@ -2299,11 +2306,8 @@ type AppointmentPolicySync = {
|
|
|
2299
2306
|
};
|
|
2300
2307
|
type AppointmentPolicy = {
|
|
2301
2308
|
active: boolean;
|
|
2302
|
-
timezone: string | null;
|
|
2303
|
-
availability: Record<string,
|
|
2304
|
-
start: string;
|
|
2305
|
-
end: string;
|
|
2306
|
-
}[]> | null;
|
|
2309
|
+
timezone: string | null; /** Weekday → `"HH:mm-HH:mm"` ranges, e.g. `monday: ['09:00-17:00']`. */
|
|
2310
|
+
availability: Record<string, string[]> | null;
|
|
2307
2311
|
minNoticeMinutes: number | null;
|
|
2308
2312
|
bufferMinutes: number | null;
|
|
2309
2313
|
maxDaysAhead: number | null;
|
|
@@ -2582,6 +2586,7 @@ type PatchContentInput = {
|
|
|
2582
2586
|
};
|
|
2583
2587
|
//#endregion
|
|
2584
2588
|
//#region src/address/formatAddressSnapshot.d.ts
|
|
2589
|
+
/** Accepts camelCase API snapshots and legacy snake_case stored snapshots. */
|
|
2585
2590
|
declare const formatAddressSnapshotLines: (address: AddressSnapshot | null | undefined) => string[];
|
|
2586
2591
|
//#endregion
|
|
2587
2592
|
//#region src/billing/orderStatus.d.ts
|
|
@@ -2589,8 +2594,8 @@ declare const formatAddressSnapshotLines: (address: AddressSnapshot | null | und
|
|
|
2589
2594
|
declare const ORDER_FULFILLMENT_STATUSES: readonly OrderStatus[];
|
|
2590
2595
|
/** Statuses where checkout is finished and the guest may leave the JoAi thank-you page. */
|
|
2591
2596
|
declare const ORDER_POST_CHECKOUT_STATUSES: readonly OrderStatus[];
|
|
2592
|
-
/** Storefront/admin label kind — pickup remaps
|
|
2593
|
-
type OrderStatusDisplay = OrderStatus | 'preparing' | 'ready_for_pickup' | 'picked_up';
|
|
2597
|
+
/** Storefront/admin label kind — pickup remaps fulfillment steps; invoice remaps delivered → paid. */
|
|
2598
|
+
type OrderStatusDisplay = OrderStatus | 'new' | 'preparing' | 'ready_for_pickup' | 'picked_up' | 'paid';
|
|
2594
2599
|
declare const isOrderPending: (status: OrderStatus) => boolean;
|
|
2595
2600
|
declare const isOrderCanceled: (status: OrderStatus) => boolean;
|
|
2596
2601
|
declare const isOrderInFulfillment: (status: OrderStatus) => boolean;
|
|
@@ -2603,6 +2608,36 @@ declare const isPickupReady: (order: Pick<Order, "fulfillmentMethod"> & {
|
|
|
2603
2608
|
declare const isPickupOrderReady: (order: Pick<Order, "fulfillmentMethod" | "status"> & {
|
|
2604
2609
|
fulfillments?: Order["fulfillments"] | null;
|
|
2605
2610
|
}) => boolean;
|
|
2611
|
+
/** Next owner action for a local-pickup packing workstation. */
|
|
2612
|
+
type PickupNextAction = 'mark_ready' | 'mark_picked_up' | null;
|
|
2613
|
+
declare const getPickupNextAction: (order: Pick<Order, "fulfillmentMethod" | "status"> & {
|
|
2614
|
+
fulfillments?: Order["fulfillments"] | null;
|
|
2615
|
+
items?: Order["items"];
|
|
2616
|
+
}) => PickupNextAction;
|
|
2617
|
+
/** Allowed manual status targets for pickup (illegal jumps stay out). Ready/picked-up go via fulfillment. */
|
|
2618
|
+
declare const getPickupEditableStatuses: (status: OrderStatus) => OrderStatus[];
|
|
2619
|
+
/** Allowed manual status targets for shipping. Carrier ship stays on fulfillment; delivered closes the order. */
|
|
2620
|
+
declare const getShippingEditableStatuses: (status: OrderStatus) => OrderStatus[];
|
|
2621
|
+
/** Allowed manual status targets for invoice/service orders (no fulfillment method). */
|
|
2622
|
+
declare const getInvoiceEditableStatuses: (status: OrderStatus) => OrderStatus[];
|
|
2623
|
+
/** Manual owner-editable statuses for the order's fulfillment context. */
|
|
2624
|
+
declare const getEditableOrderStatuses: (status: OrderStatus, fulfillmentMethod?: string | null) => OrderStatus[];
|
|
2625
|
+
declare const canTransitionOrderStatus: (from: OrderStatus, to: OrderStatus, fulfillmentMethod?: string | null) => boolean;
|
|
2626
|
+
/** Owner fulfill dialog: payment → prepare → dispatch → complete. */
|
|
2627
|
+
type FulfillmentFlowStep = 'payment' | 'prepare' | 'dispatch' | 'complete';
|
|
2628
|
+
type FulfillmentFlowAction = 'notify_ready' | 'mark_collected' | 'mark_shipped' | 'mark_delivered' | null;
|
|
2629
|
+
declare const resolveFulfillmentFlowStep: (order: Pick<Order, "fulfillmentMethod" | "status"> & {
|
|
2630
|
+
fulfillments?: Order["fulfillments"] | null;
|
|
2631
|
+
}) => FulfillmentFlowStep | null;
|
|
2632
|
+
declare const getFulfillmentFlowAction: (order: Pick<Order, "fulfillmentMethod" | "status"> & {
|
|
2633
|
+
fulfillments?: Order["fulfillments"] | null;
|
|
2634
|
+
items?: Order["items"];
|
|
2635
|
+
}) => FulfillmentFlowAction;
|
|
2636
|
+
/** Stepper index 0–3: payment → prepare → dispatch → complete. */
|
|
2637
|
+
declare const getFulfillmentFlowStepperIndex: (step: FulfillmentFlowStep | null) => number;
|
|
2638
|
+
declare const canOpenFulfillmentFlow: (order: Pick<Order, "fulfillmentMethod" | "status" | "type"> & {
|
|
2639
|
+
items?: Order["items"];
|
|
2640
|
+
}) => boolean;
|
|
2606
2641
|
//#endregion
|
|
2607
2642
|
//#region src/commerce/helpers.d.ts
|
|
2608
2643
|
type CartLine = {
|
|
@@ -2610,6 +2645,8 @@ type CartLine = {
|
|
|
2610
2645
|
quantity: number;
|
|
2611
2646
|
};
|
|
2612
2647
|
declare const cartLineTotal: <T extends CartLine>(items: T[]) => number;
|
|
2648
|
+
/** Merchandise total after a discount (cents), never below zero. */
|
|
2649
|
+
declare const cartPayableTotal: <T extends CartLine>(items: T[], discountCents?: number) => number;
|
|
2613
2650
|
declare const isCompleteAddressInput: (address: Pick<AddressInput, "name" | "addressOne" | "city" | "zipCode" | "country">) => boolean;
|
|
2614
2651
|
//#endregion
|
|
2615
2652
|
//#region src/budget/types.d.ts
|
|
@@ -2830,6 +2867,13 @@ type Document = {
|
|
|
2830
2867
|
name: string;
|
|
2831
2868
|
content: string | null;
|
|
2832
2869
|
documentUrl: string | null;
|
|
2870
|
+
sourceUrl?: string | null;
|
|
2871
|
+
type?: string;
|
|
2872
|
+
meta?: Record<string, unknown> | null;
|
|
2873
|
+
slug?: string | null;
|
|
2874
|
+
isPublic?: boolean;
|
|
2875
|
+
url?: string | null;
|
|
2876
|
+
archivedAt?: string | null;
|
|
2833
2877
|
createdAt: string;
|
|
2834
2878
|
};
|
|
2835
2879
|
//#endregion
|
|
@@ -3689,15 +3733,6 @@ type OfficeEntity = {
|
|
|
3689
3733
|
};
|
|
3690
3734
|
//#endregion
|
|
3691
3735
|
//#region src/ogimage/types.d.ts
|
|
3692
|
-
type OgImageType = 'default' | 'article' | 'category' | 'listing' | 'brand';
|
|
3693
|
-
type OgImageParams = {
|
|
3694
|
-
type?: OgImageType;
|
|
3695
|
-
title: string;
|
|
3696
|
-
subtitle?: string;
|
|
3697
|
-
category?: string;
|
|
3698
|
-
categoryColor?: string;
|
|
3699
|
-
brandLogo?: string;
|
|
3700
|
-
};
|
|
3701
3736
|
declare const OG_IMAGE_WIDTH = 1200;
|
|
3702
3737
|
declare const OG_IMAGE_HEIGHT = 630;
|
|
3703
3738
|
declare const OG_IMAGE_CONFIG: {
|
|
@@ -3720,13 +3755,51 @@ declare const OgImageColors: {
|
|
|
3720
3755
|
};
|
|
3721
3756
|
//#endregion
|
|
3722
3757
|
//#region src/ogimage/helpers.d.ts
|
|
3723
|
-
type OgResourceType = 'meeting';
|
|
3758
|
+
type OgResourceType = 'meeting' | 'action' | 'app' | 'actions' | 'apps' | 'changelog' | 'agent' | 'agents' | 'skill' | 'flow' | 'blueprint' | 'digest' | 'digests' | 'store' | 'product' | 'service';
|
|
3724
3759
|
type OgResourceParams = {
|
|
3725
3760
|
meeting: {
|
|
3726
3761
|
code: string;
|
|
3727
3762
|
};
|
|
3763
|
+
action: {
|
|
3764
|
+
slug: string;
|
|
3765
|
+
locale?: string;
|
|
3766
|
+
};
|
|
3767
|
+
app: {
|
|
3768
|
+
slug: string;
|
|
3769
|
+
locale?: string;
|
|
3770
|
+
};
|
|
3771
|
+
actions: Record<string, never>;
|
|
3772
|
+
apps: Record<string, never>;
|
|
3773
|
+
changelog: Record<string, never>;
|
|
3774
|
+
agent: {
|
|
3775
|
+
id: string;
|
|
3776
|
+
locale?: string;
|
|
3777
|
+
};
|
|
3778
|
+
agents: Record<string, never>;
|
|
3779
|
+
skill: {
|
|
3780
|
+
id: string;
|
|
3781
|
+
};
|
|
3782
|
+
flow: {
|
|
3783
|
+
slug: string;
|
|
3784
|
+
};
|
|
3785
|
+
blueprint: {
|
|
3786
|
+
slug: string;
|
|
3787
|
+
};
|
|
3788
|
+
digest: {
|
|
3789
|
+
id: string;
|
|
3790
|
+
};
|
|
3791
|
+
digests: Record<string, never>;
|
|
3792
|
+
store: Record<string, never>;
|
|
3793
|
+
product: {
|
|
3794
|
+
teamname: string;
|
|
3795
|
+
slug: string;
|
|
3796
|
+
};
|
|
3797
|
+
service: {
|
|
3798
|
+
teamname: string;
|
|
3799
|
+
slug: string;
|
|
3800
|
+
};
|
|
3728
3801
|
};
|
|
3729
|
-
declare function ogImageUrl<T extends OgResourceType>(type: T, params: OgResourceParams[T]): string;
|
|
3802
|
+
declare function ogImageUrl<T extends OgResourceType>(type: T, params: OgResourceParams[T], env?: AppEnv): string;
|
|
3730
3803
|
//#endregion
|
|
3731
3804
|
//#region src/project/types.d.ts
|
|
3732
3805
|
type ProjectStatus = 'draft' | 'planned' | 'render-ready' | 'rendered' | 'composed' | 'exported';
|
|
@@ -4720,4 +4793,4 @@ type CliSessionStatus = {
|
|
|
4720
4793
|
meta: CliSessionMeta | null;
|
|
4721
4794
|
};
|
|
4722
4795
|
//#endregion
|
|
4723
|
-
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, 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, OgImageParams, OgImageType, 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, 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, cartLineTotal, createCursorMcpInstallLink, defaultInviteTeamRole, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getMcpServerUrl, 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, resolveOrderStatusDisplay, resolveTeamCurrency, resolveWarpText, returnStatusValues, returnUpdateStatusValues, sanitizeAlphanumeric, sanitizeNumeric, slugifyMcpSegment, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, userPermissionValues, userRoleValues, withRetry };
|
|
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -42,6 +42,12 @@ const getAgentsBaseUrl = (env) => {
|
|
|
42
42
|
if (env === "testnet") return "https://testnet-agents.joai.ai";
|
|
43
43
|
return "https://agents.joai.ai";
|
|
44
44
|
};
|
|
45
|
+
const getGenBaseUrl = (env) => {
|
|
46
|
+
if (env === "local") return "http://localhost:3011";
|
|
47
|
+
if (env === "devnet") return "https://devnet-gen.joai.ai";
|
|
48
|
+
if (env === "testnet") return "https://testnet-gen.joai.ai";
|
|
49
|
+
return "https://gen.joai.ai";
|
|
50
|
+
};
|
|
45
51
|
const getMcpServerUrl = (env) => `${getCortexBaseUrl(env)}/mcp`;
|
|
46
52
|
const getMcpServerAgentUrl = (env, agent) => `${getCortexBaseUrl(env)}/mcp/agents/${agent}`;
|
|
47
53
|
const getSitesBaseUrl = (env) => {
|
|
@@ -366,16 +372,22 @@ const AddressTypes = {
|
|
|
366
372
|
const addressTypeValues = Object.values(AddressTypes);
|
|
367
373
|
//#endregion
|
|
368
374
|
//#region src/address/formatAddressSnapshot.ts
|
|
375
|
+
const pickLine = (...values) => values.find((value) => typeof value === "string" && value.trim().length > 0);
|
|
376
|
+
/** Accepts camelCase API snapshots and legacy snake_case stored snapshots. */
|
|
369
377
|
const formatAddressSnapshotLines = (address) => {
|
|
370
378
|
if (!address) return [];
|
|
379
|
+
const loose = address;
|
|
380
|
+
const addressOne = pickLine(address.addressOne, loose.address_one);
|
|
381
|
+
const addressTwo = pickLine(address.addressTwo, loose.address_two);
|
|
382
|
+
const postalCity = [pickLine(address.zipCode, loose.zip_code), pickLine(address.city)].filter(Boolean).join(" ");
|
|
371
383
|
return [
|
|
372
|
-
address.company,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
address.state,
|
|
377
|
-
address.country
|
|
378
|
-
].filter((line) => !!line
|
|
384
|
+
pickLine(address.company),
|
|
385
|
+
addressOne,
|
|
386
|
+
addressTwo,
|
|
387
|
+
postalCity || void 0,
|
|
388
|
+
pickLine(address.state),
|
|
389
|
+
pickLine(address.country)
|
|
390
|
+
].filter((line) => !!line);
|
|
379
391
|
};
|
|
380
392
|
//#endregion
|
|
381
393
|
//#region src/billing/orderStatus.ts
|
|
@@ -399,10 +411,12 @@ const isOrderInFulfillment = (status) => ORDER_FULFILLMENT_STATUSES.includes(sta
|
|
|
399
411
|
const isOrderPostCheckout = (status) => ORDER_POST_CHECKOUT_STATUSES.includes(status);
|
|
400
412
|
const resolveOrderStatusDisplay = (status, fulfillmentMethod) => {
|
|
401
413
|
if (fulfillmentMethod === "pickup") {
|
|
414
|
+
if (status === "pending") return "new";
|
|
402
415
|
if (status === "confirmed" || status === "processing") return "preparing";
|
|
403
416
|
if (status === "shipped") return "ready_for_pickup";
|
|
404
417
|
if (status === "delivered") return "picked_up";
|
|
405
418
|
}
|
|
419
|
+
if (!fulfillmentMethod && status === "delivered") return "paid";
|
|
406
420
|
return status;
|
|
407
421
|
};
|
|
408
422
|
const isPickupReady = (order) => order.fulfillmentMethod === "pickup" && (order.fulfillments ?? []).some((fulfillment) => fulfillment.status === "ready_for_pickup");
|
|
@@ -416,6 +430,122 @@ const isPickupOrderReady = (order) => {
|
|
|
416
430
|
if (fulfillments.length === 0) return true;
|
|
417
431
|
return !fulfillments.some((fulfillment) => fulfillment.status === "delivered");
|
|
418
432
|
};
|
|
433
|
+
const getPickupNextAction = (order) => {
|
|
434
|
+
if (order.fulfillmentMethod !== "pickup") return null;
|
|
435
|
+
if (order.status === "delivered" || order.status === "canceled" || order.status === "returned") return null;
|
|
436
|
+
if (isPickupOrderReady(order) || order.status === "shipped") return "mark_picked_up";
|
|
437
|
+
if (isOrderInFulfillment(order.status) && (order.items ?? []).some((item) => !item.digital)) return "mark_ready";
|
|
438
|
+
return null;
|
|
439
|
+
};
|
|
440
|
+
/** Allowed manual status targets for pickup (illegal jumps stay out). Ready/picked-up go via fulfillment. */
|
|
441
|
+
const getPickupEditableStatuses = (status) => {
|
|
442
|
+
if (status === "pending") return ["pending", "canceled"];
|
|
443
|
+
if (status === "confirmed") return [
|
|
444
|
+
"confirmed",
|
|
445
|
+
"processing",
|
|
446
|
+
"canceled"
|
|
447
|
+
];
|
|
448
|
+
if (status === "processing") return ["processing", "canceled"];
|
|
449
|
+
if (status === "shipped") return ["shipped", "canceled"];
|
|
450
|
+
if (status === "delivered") return ["delivered"];
|
|
451
|
+
if (status === "canceled") return ["canceled"];
|
|
452
|
+
if (status === "returned") return ["returned"];
|
|
453
|
+
return [status];
|
|
454
|
+
};
|
|
455
|
+
/** Allowed manual status targets for shipping. Carrier ship stays on fulfillment; delivered closes the order. */
|
|
456
|
+
const getShippingEditableStatuses = (status) => {
|
|
457
|
+
if (status === "pending") return ["pending", "canceled"];
|
|
458
|
+
if (status === "confirmed") return [
|
|
459
|
+
"confirmed",
|
|
460
|
+
"processing",
|
|
461
|
+
"delivered",
|
|
462
|
+
"canceled"
|
|
463
|
+
];
|
|
464
|
+
if (status === "processing") return [
|
|
465
|
+
"processing",
|
|
466
|
+
"delivered",
|
|
467
|
+
"canceled"
|
|
468
|
+
];
|
|
469
|
+
if (status === "shipped") return [
|
|
470
|
+
"shipped",
|
|
471
|
+
"delivered",
|
|
472
|
+
"canceled"
|
|
473
|
+
];
|
|
474
|
+
if (status === "delivered") return ["delivered"];
|
|
475
|
+
if (status === "canceled") return ["canceled"];
|
|
476
|
+
if (status === "returned") return ["returned"];
|
|
477
|
+
return [status];
|
|
478
|
+
};
|
|
479
|
+
/** Allowed manual status targets for invoice/service orders (no fulfillment method). */
|
|
480
|
+
const getInvoiceEditableStatuses = (status) => {
|
|
481
|
+
if (status === "pending") return [
|
|
482
|
+
"pending",
|
|
483
|
+
"delivered",
|
|
484
|
+
"canceled"
|
|
485
|
+
];
|
|
486
|
+
if (status === "confirmed") return [
|
|
487
|
+
"confirmed",
|
|
488
|
+
"delivered",
|
|
489
|
+
"canceled"
|
|
490
|
+
];
|
|
491
|
+
if (status === "processing") return [
|
|
492
|
+
"processing",
|
|
493
|
+
"delivered",
|
|
494
|
+
"canceled"
|
|
495
|
+
];
|
|
496
|
+
if (status === "shipped") return [
|
|
497
|
+
"shipped",
|
|
498
|
+
"delivered",
|
|
499
|
+
"canceled"
|
|
500
|
+
];
|
|
501
|
+
if (status === "delivered" || status === "completed") return [status];
|
|
502
|
+
if (status === "canceled") return ["canceled"];
|
|
503
|
+
if (status === "returned") return ["returned"];
|
|
504
|
+
return [status];
|
|
505
|
+
};
|
|
506
|
+
/** Manual owner-editable statuses for the order's fulfillment context. */
|
|
507
|
+
const getEditableOrderStatuses = (status, fulfillmentMethod) => {
|
|
508
|
+
if (fulfillmentMethod === "pickup") return getPickupEditableStatuses(status);
|
|
509
|
+
if (fulfillmentMethod === "shipping") return getShippingEditableStatuses(status);
|
|
510
|
+
return getInvoiceEditableStatuses(status);
|
|
511
|
+
};
|
|
512
|
+
const canTransitionOrderStatus = (from, to, fulfillmentMethod) => {
|
|
513
|
+
if (from === to) return true;
|
|
514
|
+
return getEditableOrderStatuses(from, fulfillmentMethod).includes(to);
|
|
515
|
+
};
|
|
516
|
+
const resolveFulfillmentFlowStep = (order) => {
|
|
517
|
+
if (!order.fulfillmentMethod) return null;
|
|
518
|
+
if (order.status === "canceled" || order.status === "returned") return "complete";
|
|
519
|
+
if (order.status === "pending") return "payment";
|
|
520
|
+
if (order.status === "delivered" || order.status === "completed") return "complete";
|
|
521
|
+
if (order.fulfillmentMethod === "pickup") {
|
|
522
|
+
if (isPickupOrderReady(order) || order.status === "shipped") return "dispatch";
|
|
523
|
+
return "prepare";
|
|
524
|
+
}
|
|
525
|
+
if (order.status === "shipped") return "dispatch";
|
|
526
|
+
return "prepare";
|
|
527
|
+
};
|
|
528
|
+
const getFulfillmentFlowAction = (order) => {
|
|
529
|
+
const step = resolveFulfillmentFlowStep(order);
|
|
530
|
+
if (step === "prepare" && isOrderInFulfillment(order.status)) {
|
|
531
|
+
if (!(order.items ?? []).some((item) => !item.digital)) return null;
|
|
532
|
+
return order.fulfillmentMethod === "pickup" ? "notify_ready" : "mark_shipped";
|
|
533
|
+
}
|
|
534
|
+
if (step === "dispatch") return order.fulfillmentMethod === "pickup" ? "mark_collected" : "mark_delivered";
|
|
535
|
+
return null;
|
|
536
|
+
};
|
|
537
|
+
/** Stepper index 0–3: payment → prepare → dispatch → complete. */
|
|
538
|
+
const getFulfillmentFlowStepperIndex = (step) => {
|
|
539
|
+
if (step === "prepare") return 1;
|
|
540
|
+
if (step === "dispatch") return 2;
|
|
541
|
+
if (step === "complete") return 3;
|
|
542
|
+
return 0;
|
|
543
|
+
};
|
|
544
|
+
const canOpenFulfillmentFlow = (order) => {
|
|
545
|
+
if (!order.fulfillmentMethod || order.type !== "order") return false;
|
|
546
|
+
if (order.status === "canceled" || order.status === "returned") return false;
|
|
547
|
+
return (order.items ?? []).some((item) => !item.digital);
|
|
548
|
+
};
|
|
419
549
|
//#endregion
|
|
420
550
|
//#region src/commerce/enums.ts
|
|
421
551
|
const FulfillmentStatuses = {
|
|
@@ -449,6 +579,8 @@ const returnUpdateStatusValues = Object.values(ReturnUpdateStatuses);
|
|
|
449
579
|
//#endregion
|
|
450
580
|
//#region src/commerce/helpers.ts
|
|
451
581
|
const cartLineTotal = (items) => items.reduce((total, item) => total + item.price * item.quantity, 0);
|
|
582
|
+
/** Merchandise total after a discount (cents), never below zero. */
|
|
583
|
+
const cartPayableTotal = (items, discountCents = 0) => Math.max(0, cartLineTotal(items) - Math.max(0, discountCents));
|
|
452
584
|
const isCompleteAddressInput = (address) => Boolean(address.name.trim() && address.addressOne.trim() && address.city.trim() && address.zipCode.trim() && address.country.trim());
|
|
453
585
|
//#endregion
|
|
454
586
|
//#region src/budget/types.ts
|
|
@@ -600,10 +732,44 @@ const OgImageColors = {
|
|
|
600
732
|
};
|
|
601
733
|
//#endregion
|
|
602
734
|
//#region src/ogimage/helpers.ts
|
|
603
|
-
const
|
|
604
|
-
|
|
735
|
+
const withLocale = (path, locale) => {
|
|
736
|
+
if (!locale || locale === "en") return path;
|
|
737
|
+
return `${path}?locale=${encodeURIComponent(locale)}`;
|
|
738
|
+
};
|
|
739
|
+
function ogImageUrl(type, params, env = "mainnet") {
|
|
740
|
+
const base = `${getGenBaseUrl(env)}/image/og`;
|
|
605
741
|
switch (type) {
|
|
606
|
-
case "meeting": return `${
|
|
742
|
+
case "meeting": return `${base}/meeting/${params.code}`;
|
|
743
|
+
case "action": {
|
|
744
|
+
const { slug, locale } = params;
|
|
745
|
+
return withLocale(`${base}/action/${encodeURIComponent(slug)}`, locale);
|
|
746
|
+
}
|
|
747
|
+
case "app": {
|
|
748
|
+
const { slug, locale } = params;
|
|
749
|
+
return withLocale(`${base}/app/${encodeURIComponent(slug)}`, locale);
|
|
750
|
+
}
|
|
751
|
+
case "actions": return `${base}/actions`;
|
|
752
|
+
case "apps": return `${base}/apps`;
|
|
753
|
+
case "changelog": return `${base}/changelog`;
|
|
754
|
+
case "agent": {
|
|
755
|
+
const { id, locale } = params;
|
|
756
|
+
return withLocale(`${base}/agent/${encodeURIComponent(id)}`, locale);
|
|
757
|
+
}
|
|
758
|
+
case "agents": return `${base}/agents`;
|
|
759
|
+
case "skill": return `${base}/skill/${encodeURIComponent(params.id)}`;
|
|
760
|
+
case "flow": return `${base}/flow/${encodeURIComponent(params.slug)}`;
|
|
761
|
+
case "blueprint": return `${base}/blueprint/${encodeURIComponent(params.slug)}`;
|
|
762
|
+
case "digest": return `${base}/digest/${encodeURIComponent(params.id)}`;
|
|
763
|
+
case "digests": return `${base}/digests`;
|
|
764
|
+
case "store": return `${base}/store`;
|
|
765
|
+
case "product": {
|
|
766
|
+
const { teamname, slug } = params;
|
|
767
|
+
return `${base}/store/${encodeURIComponent(teamname)}/${encodeURIComponent(slug)}`;
|
|
768
|
+
}
|
|
769
|
+
case "service": {
|
|
770
|
+
const { teamname, slug } = params;
|
|
771
|
+
return `${base}/store/service/${encodeURIComponent(teamname)}/${encodeURIComponent(slug)}`;
|
|
772
|
+
}
|
|
607
773
|
}
|
|
608
774
|
}
|
|
609
775
|
//#endregion
|
|
@@ -665,7 +831,8 @@ const NativeApps = {
|
|
|
665
831
|
Contracts: "contracts",
|
|
666
832
|
Artifacts: "artifacts",
|
|
667
833
|
Social: "social",
|
|
668
|
-
Studio: "studio"
|
|
834
|
+
Studio: "studio",
|
|
835
|
+
Loyalty: "loyalty"
|
|
669
836
|
};
|
|
670
837
|
const nativeAppSlugs = Object.values(NativeApps);
|
|
671
838
|
const isNativeApp = (value) => typeof value === "string" && nativeAppSlugs.includes(value);
|
|
@@ -763,4 +930,4 @@ const DefaultInviteTeamRole = UserRoles.Member;
|
|
|
763
930
|
const inviteableTeamRoles = () => [...InviteableTeamRoles];
|
|
764
931
|
const defaultInviteTeamRole = () => DefaultInviteTeamRole;
|
|
765
932
|
//#endregion
|
|
766
|
-
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, cartLineTotal, createCursorMcpInstallLink, defaultInviteTeamRole, formatAddressSnapshotLines, fulfillmentMethodValues, fulfillmentStatusValues, getAgentSetupPromptUrl, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getMcpServerUrl, 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, resolveOrderStatusDisplay, resolveTeamCurrency, resolveWarpText, returnStatusValues, returnUpdateStatusValues, sanitizeAlphanumeric, sanitizeNumeric, slugifyMcpSegment, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, userPermissionValues, userRoleValues, withRetry };
|
|
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 };
|