@joai/core 2.4.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +82 -50
- package/dist/index.mjs +21 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -7,15 +7,25 @@ type SocialAuthProvider = 'github' | 'apple' | 'google' | 'x' | 'telegram' | 'sl
|
|
|
7
7
|
//#region src/config/types.d.ts
|
|
8
8
|
type AppEnv = 'mainnet' | 'testnet' | 'devnet' | 'local';
|
|
9
9
|
//#endregion
|
|
10
|
+
//#region src/auth/token.d.ts
|
|
11
|
+
/** One-time native/deep-link handoff param (exchanged for a Bearer via API). */
|
|
12
|
+
declare const AUTH_CODE_PARAM = "auth_code";
|
|
13
|
+
/** Login URL on the main app with a direct return URL (no mini-app callback). */
|
|
14
|
+
declare const getLoginUrl: (env: AppEnv, returnTo: string, branding?: {
|
|
15
|
+
team: string;
|
|
16
|
+
brand?: string;
|
|
17
|
+
}) => string;
|
|
18
|
+
//#endregion
|
|
10
19
|
//#region src/config/urls.d.ts
|
|
11
20
|
declare const getApiBaseUrl: (env: AppEnv) => string;
|
|
12
21
|
declare const getCortexBaseUrl: (env: AppEnv) => "http://localhost:3010" | "https://devnet-cortex.joai.ai" | "https://testnet-cortex.joai.ai" | "https://cortex.joai.ai";
|
|
13
22
|
declare const getAppBaseUrl: (env: AppEnv) => "http://app.joai--api.test:3004" | "https://devnet.joai.ai" | "https://testnet.joai.ai" | "https://joai.ai";
|
|
14
|
-
declare const getFormsBaseUrl: (env: AppEnv) => "http://
|
|
23
|
+
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";
|
|
15
24
|
declare const getDigestBaseUrl: (env: AppEnv) => "http://localhost:3005" | "https://devnet-digests.joai.ai" | "https://testnet-digests.joai.ai" | "https://digests.joai.ai";
|
|
16
25
|
declare const getStoreBaseUrl: (env: AppEnv) => "http://localhost:3005" | "https://devnet-store.joai.ai" | "https://testnet-store.joai.ai" | "https://store.joai.ai";
|
|
17
26
|
declare const getAgentsBaseUrl: (env: AppEnv) => "http://localhost:3007" | "https://devnet-agents.joai.ai" | "https://testnet-agents.joai.ai" | "https://agents.joai.ai";
|
|
18
27
|
declare const getMcpServerAgentUrl: (env: AppEnv, agent: string) => string;
|
|
28
|
+
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";
|
|
19
29
|
declare const getSitesRootDomain: (env: AppEnv) => string;
|
|
20
30
|
declare const getSiteUrl: (env: AppEnv, teamSlug: string, brandSlug: string) => string;
|
|
21
31
|
//#endregion
|
|
@@ -831,7 +841,7 @@ type OrderItem = {
|
|
|
831
841
|
name: string;
|
|
832
842
|
quantity: number;
|
|
833
843
|
unitPrice: number;
|
|
834
|
-
type: 'product-variation' | 'service';
|
|
844
|
+
type: 'product-variation' | 'service' | 'coupon';
|
|
835
845
|
digital?: boolean | null;
|
|
836
846
|
sellerTeamId?: string | null;
|
|
837
847
|
};
|
|
@@ -865,6 +875,7 @@ type Order = {
|
|
|
865
875
|
notes: string | null;
|
|
866
876
|
configuration?: OrderConfigurationItem[];
|
|
867
877
|
items: OrderItem[];
|
|
878
|
+
coupon?: Coupon | null;
|
|
868
879
|
plan: Plan | null;
|
|
869
880
|
user: UserPrivate | null;
|
|
870
881
|
team: TeamPrivate | null;
|
|
@@ -906,6 +917,7 @@ type Coupon = {
|
|
|
906
917
|
amount: number | null;
|
|
907
918
|
percent: number | null;
|
|
908
919
|
price: number | null;
|
|
920
|
+
discount?: number;
|
|
909
921
|
condition: CouponCondition;
|
|
910
922
|
restrictedItems: CouponRestrictedItem[];
|
|
911
923
|
usesLeft: number | null;
|
|
@@ -971,7 +983,7 @@ type Skill = {
|
|
|
971
983
|
};
|
|
972
984
|
//#endregion
|
|
973
985
|
//#region src/integration/types.d.ts
|
|
974
|
-
type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
|
|
986
|
+
type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'whatsapp-personal' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'xchat' | 'instagram' | 'grok' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
|
|
975
987
|
type IntegrationDetails = {
|
|
976
988
|
type: IntegrationType;
|
|
977
989
|
name: string;
|
|
@@ -985,8 +997,16 @@ type IntegrationDetails = {
|
|
|
985
997
|
type IntegrationMeta = {
|
|
986
998
|
handle?: string;
|
|
987
999
|
provider?: EmailProvider | null;
|
|
1000
|
+
hookSource?: string;
|
|
988
1001
|
[key: string]: unknown;
|
|
989
1002
|
};
|
|
1003
|
+
type IntegrationConnectionDetails = IntegrationDetails & {
|
|
1004
|
+
phoneNumberId?: string;
|
|
1005
|
+
phoneNumber?: string;
|
|
1006
|
+
webhookUrl?: string;
|
|
1007
|
+
webhookSecret?: string;
|
|
1008
|
+
webhookSecretKey?: string;
|
|
1009
|
+
};
|
|
990
1010
|
type Integration = {
|
|
991
1011
|
id: string;
|
|
992
1012
|
type: IntegrationType;
|
|
@@ -995,9 +1015,9 @@ type Integration = {
|
|
|
995
1015
|
configured: boolean;
|
|
996
1016
|
createdAt: string;
|
|
997
1017
|
meta?: IntegrationMeta;
|
|
998
|
-
details?:
|
|
1018
|
+
details?: IntegrationConnectionDetails;
|
|
999
1019
|
};
|
|
1000
|
-
type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github';
|
|
1020
|
+
type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github' | 'xchat' | 'instagram';
|
|
1001
1021
|
type SocialBot = {
|
|
1002
1022
|
name: string;
|
|
1003
1023
|
createdAt: string;
|
|
@@ -1348,49 +1368,6 @@ type WarpSearchHit = {
|
|
|
1348
1368
|
};
|
|
1349
1369
|
//#endregion
|
|
1350
1370
|
//#region src/store/types.d.ts
|
|
1351
|
-
type StoreVisibility = 'private' | 'team' | 'public';
|
|
1352
|
-
type StoreEntry = {
|
|
1353
|
-
value: number | string | boolean;
|
|
1354
|
-
label?: string;
|
|
1355
|
-
at: string;
|
|
1356
|
-
};
|
|
1357
|
-
type Store = {
|
|
1358
|
-
name: string;
|
|
1359
|
-
description: string;
|
|
1360
|
-
valueType: 'scalar' | 'series';
|
|
1361
|
-
unit?: string;
|
|
1362
|
-
visibility: StoreVisibility;
|
|
1363
|
-
entryCount: number;
|
|
1364
|
-
lastValue?: number | string | boolean;
|
|
1365
|
-
lastAt?: string;
|
|
1366
|
-
};
|
|
1367
|
-
type StoreWithEntries = {
|
|
1368
|
-
name: string;
|
|
1369
|
-
description: string;
|
|
1370
|
-
unit?: string;
|
|
1371
|
-
entries: StoreEntry[];
|
|
1372
|
-
};
|
|
1373
|
-
type StoreCreatePayload = {
|
|
1374
|
-
name: string;
|
|
1375
|
-
description?: string;
|
|
1376
|
-
valueType?: 'scalar' | 'series';
|
|
1377
|
-
unit?: string;
|
|
1378
|
-
visibility?: StoreVisibility;
|
|
1379
|
-
};
|
|
1380
|
-
type StoreEntryPayload = {
|
|
1381
|
-
storeName?: string;
|
|
1382
|
-
value: number | string | boolean;
|
|
1383
|
-
label?: string;
|
|
1384
|
-
};
|
|
1385
|
-
type StoreEntryResult = {
|
|
1386
|
-
name: string;
|
|
1387
|
-
entryCount: number;
|
|
1388
|
-
};
|
|
1389
|
-
type StoreToggleResult = {
|
|
1390
|
-
name: string;
|
|
1391
|
-
value: number | string | boolean;
|
|
1392
|
-
previous: number | string | boolean;
|
|
1393
|
-
};
|
|
1394
1371
|
type StoreEntityType = 'skill' | 'flow' | 'blueprint' | 'agent' | 'service';
|
|
1395
1372
|
type StorePricing = {
|
|
1396
1373
|
model: PricingModel;
|
|
@@ -1789,6 +1766,7 @@ type AppointmentPolicy = {
|
|
|
1789
1766
|
serviceSelectionEnabled?: boolean | null;
|
|
1790
1767
|
paymentEnabled?: boolean | null;
|
|
1791
1768
|
bookingCapacity?: number | null;
|
|
1769
|
+
bookingCapacityUnit?: 'booking' | 'person' | null;
|
|
1792
1770
|
requireApproval?: boolean | null;
|
|
1793
1771
|
sync?: AppointmentPolicySync | null;
|
|
1794
1772
|
agent?: Agent | null;
|
|
@@ -2166,6 +2144,7 @@ type Item = {
|
|
|
2166
2144
|
};
|
|
2167
2145
|
type ItemCreatePayload = {
|
|
2168
2146
|
title: string;
|
|
2147
|
+
source?: 'user' | 'api';
|
|
2169
2148
|
description?: string;
|
|
2170
2149
|
priority?: ItemPriority;
|
|
2171
2150
|
tags?: string[];
|
|
@@ -2189,6 +2168,49 @@ type ItemUpdatePayload = {
|
|
|
2189
2168
|
assignedToIds?: string[];
|
|
2190
2169
|
};
|
|
2191
2170
|
//#endregion
|
|
2171
|
+
//#region src/kv/types.d.ts
|
|
2172
|
+
type KvValue = number | string | boolean;
|
|
2173
|
+
type KvEntry = {
|
|
2174
|
+
value: KvValue;
|
|
2175
|
+
label?: string | null;
|
|
2176
|
+
at: string;
|
|
2177
|
+
};
|
|
2178
|
+
type KvField = {
|
|
2179
|
+
name: string;
|
|
2180
|
+
description: string | null;
|
|
2181
|
+
valueType: 'scalar' | 'series';
|
|
2182
|
+
unit: string | null;
|
|
2183
|
+
entryCount: number;
|
|
2184
|
+
lastValue?: KvValue | null;
|
|
2185
|
+
lastAt?: string | null;
|
|
2186
|
+
};
|
|
2187
|
+
type KvFieldWithEntries = Pick<KvField, 'name' | 'description' | 'unit'> & {
|
|
2188
|
+
entries: KvEntry[];
|
|
2189
|
+
};
|
|
2190
|
+
type CreateKvFieldPayload = {
|
|
2191
|
+
name: string;
|
|
2192
|
+
description?: string;
|
|
2193
|
+
valueType?: 'scalar' | 'series';
|
|
2194
|
+
unit?: string;
|
|
2195
|
+
};
|
|
2196
|
+
type KvEntryPayload = {
|
|
2197
|
+
field?: string;
|
|
2198
|
+
value: KvValue;
|
|
2199
|
+
label?: string;
|
|
2200
|
+
};
|
|
2201
|
+
type SetKvEntryResult = KvEntry & {
|
|
2202
|
+
name: string;
|
|
2203
|
+
};
|
|
2204
|
+
type AppendKvEntryResult = {
|
|
2205
|
+
name: string;
|
|
2206
|
+
entryCount: number;
|
|
2207
|
+
};
|
|
2208
|
+
type ToggleKvFieldResult = {
|
|
2209
|
+
name: string;
|
|
2210
|
+
value: KvValue;
|
|
2211
|
+
previous: KvValue | null;
|
|
2212
|
+
};
|
|
2213
|
+
//#endregion
|
|
2192
2214
|
//#region src/marketing/types.d.ts
|
|
2193
2215
|
type SubscriptionPlan = {
|
|
2194
2216
|
name: string;
|
|
@@ -3658,7 +3680,17 @@ type CreateWebHookPayload = {
|
|
|
3658
3680
|
type CreateWarpLinkedHookPayload = {
|
|
3659
3681
|
warpIdentifier: string;
|
|
3660
3682
|
};
|
|
3661
|
-
type
|
|
3683
|
+
type CreateInboundHookPayload = {
|
|
3684
|
+
source: string;
|
|
3685
|
+
warpIdentifier: string;
|
|
3686
|
+
trigger?: HookTrigger;
|
|
3687
|
+
};
|
|
3688
|
+
type CreateHookPayload = CreateInternalHookPayload | CreateWebHookPayload | CreateWarpLinkedHookPayload | CreateInboundHookPayload;
|
|
3689
|
+
type HookSample = {
|
|
3690
|
+
source: string;
|
|
3691
|
+
payload: Record<string, unknown> | null;
|
|
3692
|
+
recordedAt: string | null;
|
|
3693
|
+
};
|
|
3662
3694
|
//#endregion
|
|
3663
3695
|
//#region src/workspace/types.d.ts
|
|
3664
3696
|
type WorkspaceInfo = {
|
|
@@ -3748,4 +3780,4 @@ type CliSessionStatus = {
|
|
|
3748
3780
|
meta: CliSessionMeta | null;
|
|
3749
3781
|
};
|
|
3750
3782
|
//#endregion
|
|
3751
|
-
export { Achievement, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSimple, AgentWalletMode, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppEnv, AppFile, AppFileType, AppIngestion, AppSubscription, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentPolicySync, AppointmentRequest, AppointmentSlot, AuthUser, BillingAddress, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CalendarProvider, CalendarStatus, Campaign, CampaignApproval, CampaignCategory, CampaignChannel, CampaignCreatePayload, CampaignStats, CampaignStatus, CampaignUpdatePayload, Card, Cart, CartItem, Challenge, Challenges, ChangelogEntry, Character, ChatClientAction, ChatClientThought, ChatStreamData, ChatStreamEventType, CliSessionMeta, CliSessionStatus, CommissionAgreement, Configuration, Contact, ContactActivity, ContactActivityAuthor, ContactActivityType, ContactConsent, ContactConsentStatus, ContactCreatePayload, ContactFormData, ContactHealth, ContactViewable, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, CouponCondition, CouponRestrictedItem, CouponRestrictedItemType, CreateHookPayload, CreateInternalHookPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, DefaultCodeMetadata, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, EarnResponse, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, HintOptions, HintPosition, Hook, HookTrigger, HookTriggerCondition, HookTriggerInput, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationDetails, IntegrationMeta, IntegrationType, Intent, Item, ItemCreatePayload, ItemExecutionStatus, ItemPriority, ItemStatus, ItemUpdatePayload, ItemViewable, JoaiUrls, JsonValue, Kyc, KycStatus, Link, LinkCreatePayload, LinkScanHistory, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LocalAgentWallet, LoyaltyAccount, LoyaltyMember, LoyaltyNextTier, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyStatus, LoyaltyTier, LoyaltyTierInfo, LoyaltyTransaction, McpToolCall, McpToolCallBroadcast, McpToolCallStatus, Media, MediaAspectRatio, MediaAttributes, MediaItems, MediaLibraryAttributes, MediaMime, Meeting, MeetingConferenceProvider, MeetingFeature, MeetingJoinInfo, MeetingJoinTeam, MeetingParticipant, MeetingSessionState, MeetingSpeakerAssignment, MeetingStatus, MeetingSummary, MeetingTranscriptEntry, MeetingUsage, Memory, Message, MessageId, MessageRole, Milestone, MilestoneType, Mission, MissionBudget, MissionCreatePayload, MissionPlan, MissionPriority, MissionSchedule, MissionStatus, MissionViewable, MollieTerminalPaymentResult, MultimodalContent, MultimodalFile, Notification, NotificationAction, NotificationAgent, NotificationChannel, NotificationSetting, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, OgImageParams, OgImageType, Order, OrderConfigurationItem, OrderContext, OrderItem, OrderSource, OrderStatus, OrderType, PaginatedResponse, Pass, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PersonaQuestionable, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductDiscount, ProductMeta, ProductPieces, ProductRating, ProductRelation, ProductRelationType, ProductVariation, ProductVariationMeta, ProductVariationType, ProgramSettings, Project, ProjectAspectRatio, ProjectAssembly, ProjectCaptionStyle, ProjectClipCandidate, ProjectClips, ProjectExport, ProjectExportAsset, ProjectExportResponse, ProjectImages, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectPlan, ProjectRender, ProjectRenderMode, ProjectSelectedClip, ProjectShot, ProjectSoundtrack, ProjectSourceMedia, ProjectStatus, ProjectStudioHistoryEntry, ProjectStudioQuestion, ProjectStudioResponse, ProjectStudioStage, ProjectStudioState, ProjectStudioSummary, ProjectStyleDirection, ProjectTranscript, ProjectTranscriptSegment, Proposal, ProposalAction, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, ProposalPollOption, ProposalStatus, PublicFormResults, PurchaseOptions, PurchaseResult, RampProvider, RampProviderInfo, Reactions, RecentExperience, RedeemResponse, Reminder, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, Segment, SegmentCondition, SegmentConditionType, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, SegmentGroup, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, StampResponse,
|
|
3783
|
+
export { AUTH_CODE_PARAM, Achievement, Affiliate, AffiliateStatus, AffiliateTier, AffiliateTierName, Agent, AgentActionHistoryEntry, AgentCharacter, AgentDelegatable, AgentEngine, AgentExecuteHandler, AgentExecuteOptions, AgentGender, AgentMessageMeta, AgentMessageOptions, AgentPrivate, AgentSettings, AgentSimple, AgentWalletMode, AggregatedRoute, AiCostEntry, AiCostsResponse, AiCostsSummary, Alert, ApiToken, AppEnv, AppFile, AppFileType, AppIngestion, AppSubscription, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilityService, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentBookingContext, AppointmentPolicy, AppointmentPolicySync, AppointmentRequest, AppointmentSlot, AuthUser, BillingAddress, Blueprint, BlueprintOnboardingStep, BlueprintRedirect, BlueprintSettings, BlueprintShortcut, BlueprintTask, BlueprintTeam, BoardSummaryViewable, BookmarkEntry, BrandBackend, BrandIntegration, BrandIntegrationAction, BrandIntegrationProvider, BrandSearchHit, BrandSiteConfig, BrandSourceConfig, Budget, ByokProviderConfig, ByokProviderName, ByokProviders, CalendarProvider, CalendarStatus, Campaign, CampaignApproval, CampaignCategory, CampaignChannel, CampaignCreatePayload, CampaignStats, CampaignStatus, CampaignUpdatePayload, Card, Cart, CartItem, Challenge, Challenges, ChangelogEntry, Character, ChatClientAction, ChatClientThought, ChatStreamData, ChatStreamEventType, CliSessionMeta, CliSessionStatus, CommissionAgreement, Configuration, Contact, ContactActivity, ContactActivityAuthor, ContactActivityType, ContactConsent, ContactConsentStatus, ContactCreatePayload, ContactFormData, ContactHealth, ContactViewable, Contract, ContractCategoryDisplayNames, ContractCategoryName, ContractCodeMetadata, ContractEntity, ContractOnNetwork, ContractVersion, ContractsAddressConfig, CortexExecuteOptions, Coupon, CouponCondition, CouponRestrictedItem, CouponRestrictedItemType, CreateHookPayload, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, DefaultCodeMetadata, DemoFlow, DemoMessage, Desk, DeskItem, DeskItemRole, Document, EarnResponse, Earning, Element, ElementSpec, ElementType, ElementVariation, EmailProvider, EmbedStatus, EncryptionStatus, Entity, EntityDirectExecuteRequest, EntityProposable, EntitySignable, EntityTemplate, Experience, FileInfo, FileMetadata, Flow, FlowCategory, FlowInputMapping, FlowStatus, FlowStep, GamificationData, GamificationEventType, Goal, GoalCreatePayload, GoalPriority, GoalProgressViewable, GoalStatus, HintOptions, HintPosition, Hook, HookSample, HookTrigger, HookTriggerCondition, HookTriggerInput, HttpService, IAppResponse, IHttpService, IRequestOptions, IngestionSourceType, IngestionStatus, Inquiry, InquiryStatus, InquiryType, Integration, IntegrationConnectionDetails, IntegrationDetails, IntegrationMeta, IntegrationType, Intent, Item, ItemCreatePayload, ItemExecutionStatus, ItemPriority, ItemStatus, ItemUpdatePayload, ItemViewable, JoaiUrls, JsonValue, KvEntry, KvEntryPayload, KvField, KvFieldWithEntries, KvValue, Kyc, KycStatus, Link, LinkCreatePayload, LinkScanHistory, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LocalAgentWallet, LoyaltyAccount, LoyaltyMember, LoyaltyNextTier, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyStatus, LoyaltyTier, LoyaltyTierInfo, LoyaltyTransaction, McpToolCall, McpToolCallBroadcast, McpToolCallStatus, Media, MediaAspectRatio, MediaAttributes, MediaItems, MediaLibraryAttributes, MediaMime, Meeting, MeetingConferenceProvider, MeetingFeature, MeetingJoinInfo, MeetingJoinTeam, MeetingParticipant, MeetingSessionState, MeetingSpeakerAssignment, MeetingStatus, MeetingSummary, MeetingTranscriptEntry, MeetingUsage, Memory, Message, MessageId, MessageRole, Milestone, MilestoneType, Mission, MissionBudget, MissionCreatePayload, MissionPlan, MissionPriority, MissionSchedule, MissionStatus, MissionViewable, MollieTerminalPaymentResult, MultimodalContent, MultimodalFile, Notification, NotificationAction, NotificationAgent, NotificationChannel, NotificationSetting, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OfficeAgent, OfficeEntity, OfficeEntityKind, OfficeLiveOverrides, OfficeMember, OfficeSnapshot, OfficeStatus, OfficeStatusFilter, OfficeTypeFilter, OgImageColors, OgImageParams, OgImageType, Order, OrderConfigurationItem, OrderContext, OrderItem, OrderSource, OrderStatus, OrderType, PaginatedResponse, Pass, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, PayoutEntry, PeriodTypeLabels, PeriodTypeOptions, PermissionConfigType, PersonaQuestionable, Plan, PlanBenefit, PlanExtra, PlanFeature, PlanInterval, PolicyMethod, PolicySetting, PricingModel, Product, ProductDiscount, ProductMeta, ProductPieces, ProductRating, ProductRelation, ProductRelationType, ProductVariation, ProductVariationMeta, ProductVariationType, ProgramSettings, Project, ProjectAspectRatio, ProjectAssembly, ProjectCaptionStyle, ProjectClipCandidate, ProjectClips, ProjectExport, ProjectExportAsset, ProjectExportResponse, ProjectImages, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectPlan, ProjectRender, ProjectRenderMode, ProjectSelectedClip, ProjectShot, ProjectSoundtrack, ProjectSourceMedia, ProjectStatus, ProjectStudioHistoryEntry, ProjectStudioQuestion, ProjectStudioResponse, ProjectStudioStage, ProjectStudioState, ProjectStudioSummary, ProjectStyleDirection, ProjectTranscript, ProjectTranscriptSegment, Proposal, ProposalAction, ProposalActionPayment, ProposalActionPaymentSerializable, ProposalActionSerializable, ProposalPollOption, ProposalStatus, PublicFormResults, PurchaseOptions, PurchaseResult, RampProvider, RampProviderInfo, Reactions, RecentExperience, RedeemResponse, Reminder, Room, RoomId, RoomKind, ScInfo, SchedulePreset, SecretAuthorizable, SecretSettable, Segment, SegmentCondition, SegmentConditionType, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, SegmentGroup, SendableActivityUpdate, SendableAgentAction, SendableAgentMessage, SendableAgentThought, SendableMedia, SendableUserMessage, Service, SetKvEntryResult, Shortcut, Site, SiteAgent, SiteBrand, SiteRoute, SiteTeam, Skill, SkillMediaBindingRole, SkillMediaBindingRoleValue, SkillScope, SkillScopeValue, SkillType, SkillTypeValue, SocialAuthProvider, SocialBot, SocialPlatform, StampResponse, StoreAgent, StoreCheckoutItem, StoreData, StoreEntityType, StoreInfo, StoreItem, StoreListing, StorePriceTier, StorePricing, StorePurchasable, StorePurchaseResult, Streak, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, Swarm, Tag, TagType, Task, Team, TeamBrand, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamPayout, TeamPayoutAddress, TeamPlace, TeamPrivate, TeamSettings, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, Tier, TierFeature, TierName, ToggleKvFieldResult, TranscriptEntry, TranscriptionCorrection, TranscriptionResponse, TranslatableValue, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateStatus, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeSourceType, UpgradeStatus, User, UserInterest, UserMode, UserPrivate, UserRole, UserSettings, UserSocialAccount, UserStats, VolumePrice, Wallet, WalletList, WarpApprovable, WarpBackend, WarpBackendStatus, WarpBatchItem, WarpBatchable, WarpCloudExecutable, WarpCreateable, WarpExecutable, WarpExecutionBackend, WarpExtras, WarpExtrasFaq, WarpInputable, WarpScreenshotVariant, WarpSearchHit, WarpSelectable, WarpSelectableDetails, WarpSuggestion, WarpTestable, WarpViewable, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceContext, WorkspaceInfo, WorkspaceSettings, XIntegrationStatus, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, localize, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
|
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const getAppBaseUrl = (env) => {
|
|
|
19
19
|
return "https://joai.ai";
|
|
20
20
|
};
|
|
21
21
|
const getFormsBaseUrl = (env) => {
|
|
22
|
-
if (env === "local") return "http://
|
|
22
|
+
if (env === "local") return "http://forms.joai--api.test:3008";
|
|
23
23
|
if (env === "devnet") return "https://devnet-forms.joai.ai";
|
|
24
24
|
if (env === "testnet") return "https://testnet-forms.joai.ai";
|
|
25
25
|
return "https://forms.joai.ai";
|
|
@@ -43,6 +43,12 @@ const getAgentsBaseUrl = (env) => {
|
|
|
43
43
|
return "https://agents.joai.ai";
|
|
44
44
|
};
|
|
45
45
|
const getMcpServerAgentUrl = (env, agent) => `${toSubdomainBaseUrl(env, "cortex")}/mcp/agents/${agent}`;
|
|
46
|
+
const getSitesBaseUrl = (env) => {
|
|
47
|
+
if (env === "local") return "http://sites.joai--api.test:3007";
|
|
48
|
+
if (env === "devnet") return "https://devnet-sites.joai.ai";
|
|
49
|
+
if (env === "testnet") return "https://testnet-sites.joai.ai";
|
|
50
|
+
return "https://sites.joai.ai";
|
|
51
|
+
};
|
|
46
52
|
const getSitesRootDomain = (env) => {
|
|
47
53
|
if (env === "local") return "sites.joai--api.test";
|
|
48
54
|
if (env === "devnet") return "devnet-sites.joai.ai";
|
|
@@ -51,6 +57,19 @@ const getSitesRootDomain = (env) => {
|
|
|
51
57
|
};
|
|
52
58
|
const getSiteUrl = (env, teamSlug, brandSlug) => `https://${getSitesRootDomain(env)}/${teamSlug}/${brandSlug}`;
|
|
53
59
|
//#endregion
|
|
60
|
+
//#region src/auth/token.ts
|
|
61
|
+
/** One-time native/deep-link handoff param (exchanged for a Bearer via API). */
|
|
62
|
+
const AUTH_CODE_PARAM = "auth_code";
|
|
63
|
+
/** Login URL on the main app with a direct return URL (no mini-app callback). */
|
|
64
|
+
const getLoginUrl = (env, returnTo, branding) => {
|
|
65
|
+
const params = new URLSearchParams({ redirect: returnTo });
|
|
66
|
+
if (branding) {
|
|
67
|
+
params.set("team", branding.team);
|
|
68
|
+
if (branding.brand) params.set("brand", branding.brand);
|
|
69
|
+
}
|
|
70
|
+
return `${getAppBaseUrl(env)}/login?${params}`;
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
54
73
|
//#region src/config/constants.ts
|
|
55
74
|
const JoaiUrls = {
|
|
56
75
|
TelegramGroup: "https://telegram.joai.ai",
|
|
@@ -377,4 +396,4 @@ const teamCategories = [
|
|
|
377
396
|
"leisure-tourism"
|
|
378
397
|
];
|
|
379
398
|
//#endregion
|
|
380
|
-
export { ContractCategoryDisplayNames, DefaultCodeMetadata, HttpService, JoaiUrls, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OgImageColors, PeriodTypeLabels, PeriodTypeOptions, SkillMediaBindingRole, SkillScope, SkillType, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getMcpServerAgentUrl, getSiteUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, localize, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
|
|
399
|
+
export { AUTH_CODE_PARAM, ContractCategoryDisplayNames, DefaultCodeMetadata, HttpService, JoaiUrls, OG_IMAGE_CONFIG, OG_IMAGE_HEIGHT, OG_IMAGE_WIDTH, OgImageColors, PeriodTypeLabels, PeriodTypeOptions, SkillMediaBindingRole, SkillScope, SkillType, abbreviateNumber, getAgentsBaseUrl, getApiBaseUrl, getAppBaseUrl, getAssetAppLogoUrl, getAssetChainLogoUrl, getAssetPartnerLogoUrl, getAssetTokenLogoUrl, getAssetWalletLogoUrl, getCortexBaseUrl, getDigestBaseUrl, getFormsBaseUrl, getLoginUrl, getMcpServerAgentUrl, getSiteUrl, getSitesBaseUrl, getSitesRootDomain, getStoreBaseUrl, getWarpScreenshotUrl, isFileFormatAudio, isFileFormatImage, isFileFormatVideo, localize, ogImageUrl, resolveWarpText, sanitizeAlphanumeric, sanitizeNumeric, teamCategories, toCurrencyDisplay, toHexEncodedNonce, toNameInitials, toNftId, toPreviewText, withRetry };
|