@joai/sdk 13.1.3 → 14.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _$_joai_core0 from "@joai/core";
2
- import { Address, AddressCreatePayload, AddressInput, AddressInput as AddressInput$1, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, AnalyticsConfiguration, ApiToken, AppEnv, AppEnv as AppEnv$1, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactDeliveryPreview, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarFeed, CalendarFeedInput, CalendarFeedSyncResult, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignSendTestDraftPayload, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartItem, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CheckoutSnapshotRequest as CheckoutSnapshotRequest$1, ClientProposal, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentValue, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementType, ElementVariation, EmbedStatus, Entity, Flow, FollowListParams, FollowPayload, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, HashidInput, HashidInput as HashidInput$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IAppResponse as IAppResponse$1, IHttpService, IRequestOptions, IdentifiedSiteEvent, Inquiry, InquiryType, Install, InstallClaimPayload, InstallOptOutPayload, InstallRegisterPayload, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyCollectPointInput, LoyaltyCollectResponse, LoyaltyJoinResponse, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, LoyaltyWalletAccount, McpToolCall, Media, MediaAspectRatio, Meeting, MeetingJoinInfo, MeetingSpeakerAssignment, MeetingSummary, Memory, Message, MetricSource, MetricsResult, Mission, MissionCreatePayload, Notification, NotificationChannel, NotificationSetting, OfficeSnapshot, Order, Order as Order$1, OrderContext, OrderPriceMode, OrderPriceMode as OrderPriceMode$1, OrderStatus, OrderStatus as OrderStatus$1, OrderType, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, Plan, PlanFeature, Product, Product as Product$1, ProductDetailSection, ProductDetailSection as ProductDetailSection$1, ProductDetailText, ProductRelation, ProductRelationType, ProductVariation, ProductVariationExternalReference, ProductVariationExternalSource, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalCreateInput, ProposalPollOption, ProposalPricing, ProposalUpdateInput, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedArtifact, SharedProposal, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostScheduleSlot, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, TaxClass, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamSubscriptionStats, TeamUsage, TemplateMode, TemplateOverrides, TemplateSpec, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, TranslatableValue as TranslatableValue$1, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeStatus, UserPrivate, UserRole, UserSettings, VolumePrice, WarpBackend, WarpBackendStatus, WarpExecutionBackend, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceInfo, XIntegrationStatus } from "@joai/core";
2
+ import { Address, AddressCreatePayload, AddressInput, AddressInput as AddressInput$1, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, AnalyticsConfiguration, ApiToken, AppEnv, AppEnv as AppEnv$1, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactDeliveryPreview, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarFeed, CalendarFeedInput, CalendarFeedSyncResult, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignSendTestDraftPayload, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartItem, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CheckoutSnapshotRequest as CheckoutSnapshotRequest$1, ClientProposal, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentValue, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementType, ElementVariation, EmbedStatus, Entity, Flow, FollowListParams, FollowPayload, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, HashidInput, HashidInput as HashidInput$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IAppResponse as IAppResponse$1, IHttpService, IRequestOptions, IdentifiedSiteEvent, Inquiry, InquiryType, Install, InstallClaimPayload, InstallOptOutPayload, InstallRegisterPayload, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyCollectPointInput, LoyaltyCollectResponse, LoyaltyJoinResponse, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, LoyaltyWalletAccount, McpToolCall, Media, MediaAspectRatio, Meeting, MeetingJoinInfo, MeetingSpeakerAssignment, MeetingSummary, Memory, Message, MetricSource, MetricsResult, Mission, MissionCreatePayload, Notification, NotificationChannel, NotificationSetting, OfficeSnapshot, Order, Order as Order$1, OrderContext, OrderPriceMode, OrderPriceMode as OrderPriceMode$1, OrderStatus, OrderStatus as OrderStatus$1, OrderType, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, Plan, PlanFeature, Product, Product as Product$1, ProductDetailSection, ProductDetailSection as ProductDetailSection$1, ProductDetailText, ProductRelation, ProductRelationType, ProductVariation, ProductVariationExternalReference, ProductVariationExternalSource, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalCreateInput, ProposalPollOption, ProposalPricing, ProposalStats, ProposalUpdateInput, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedArtifact, SharedProposal, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostScheduleSlot, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, TaxClass, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamSubscriptionStats, TeamUsage, TemplateMode, TemplateOverrides, TemplateSpec, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, TranslatableValue as TranslatableValue$1, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeStatus, UserPrivate, UserRole, UserSettings, VolumePrice, WarpBackend, WarpBackendStatus, WarpExecutionBackend, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceInfo, XIntegrationStatus } from "@joai/core";
3
3
  import { WarpChainName, WarpClient, WarpLocale, WarpText, WarpWalletProvider } from "@joai/warps";
4
4
 
5
5
  //#region src/resources/agents.d.ts
@@ -53,6 +53,59 @@ declare class AgentsResource {
53
53
  }>>;
54
54
  }
55
55
  //#endregion
56
+ //#region src/resources/audit-logs.d.ts
57
+ type AuditLogEvent = {
58
+ id: number;
59
+ correlationId: string;
60
+ action: string;
61
+ event: string;
62
+ subjectType: string | null;
63
+ subjectId: string | null;
64
+ userId: number | null;
65
+ userName: string | null;
66
+ agentId: string | null;
67
+ approvedByUserId: number | null;
68
+ approvedByUserName: string | null;
69
+ approvalId: string | null;
70
+ warpExecutionId: string | null;
71
+ source: string;
72
+ metadata: Record<string, unknown> | null;
73
+ ip: string | null;
74
+ userAgent: string | null;
75
+ createdAt: string;
76
+ };
77
+ type AuditLogListParams = {
78
+ action?: string;
79
+ event?: string;
80
+ source?: string;
81
+ userId?: number;
82
+ agentId?: string;
83
+ from?: string;
84
+ to?: string;
85
+ page?: number;
86
+ perPage?: number;
87
+ };
88
+ declare class AuditLogsResource {
89
+ private readonly http;
90
+ constructor(http: IHttpService);
91
+ list(params?: AuditLogListParams): Promise<_$_joai_core0.IAppResponse<AuditLogEvent[]>>;
92
+ }
93
+ //#endregion
94
+ //#region src/resources/exports.d.ts
95
+ type CatalogExportResource = 'products' | 'services' | 'orders';
96
+ type CatalogExportFormat = 'csv' | 'xlsx' | 'json';
97
+ type CatalogExportRequest = {
98
+ resource: CatalogExportResource;
99
+ format: CatalogExportFormat;
100
+ filters?: Record<string, string | number | boolean>;
101
+ };
102
+ /** Binary catalog export download. The filename is available on `response.original.headers`. */
103
+ declare class ExportsResource {
104
+ private readonly http;
105
+ constructor(http: IHttpService);
106
+ catalog(input: CatalogExportRequest): Promise<_$_joai_core0.IAppResponse<Blob>>;
107
+ }
108
+ //#endregion
56
109
  //#region src/address/addresses.d.ts
57
110
  type AddressQuery = {
58
111
  contact?: string;
@@ -768,6 +821,8 @@ declare class BillingResource {
768
821
  orders(team: TeamPrivate | null, page?: number, filters?: {
769
822
  contactId?: string;
770
823
  couponId?: string;
824
+ search?: string;
825
+ status?: OrderStatus$1[];
771
826
  }, perPage?: number): Promise<_$_joai_core0.IAppResponse<Order$1[]>>;
772
827
  orderStats(team: string): Promise<_$_joai_core0.IAppResponse<TeamOrderStats>>;
773
828
  payOrder(id: string, provider?: PaymentProvider, accessToken?: string): Promise<_$_joai_core0.IAppResponse<{
@@ -1763,12 +1818,22 @@ declare class ProjectsResource {
1763
1818
  }
1764
1819
  //#endregion
1765
1820
  //#region src/resources/proposals.d.ts
1821
+ type ProposalListParams = {
1822
+ page?: number;
1823
+ perPage?: number;
1824
+ };
1825
+ /**
1826
+ * Team-scoped proposal endpoints. Create the client with `createClient({ team })`
1827
+ * so the team travels as the default `X-Team` header.
1828
+ */
1766
1829
  declare class ProposalsResource {
1767
1830
  private readonly http;
1768
1831
  constructor(http: IHttpService);
1769
- list(team: string): Promise<_$_joai_core0.IAppResponse<ClientProposal[]>>;
1770
- create(team: string, data: ProposalCreateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1771
- update(team: string, id: string, data: ProposalUpdateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1832
+ list(params?: ProposalListParams): Promise<_$_joai_core0.IAppResponse<ClientProposal[]>>;
1833
+ stats(): Promise<_$_joai_core0.IAppResponse<ProposalStats>>;
1834
+ get(id: string): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1835
+ create(data: ProposalCreateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1836
+ update(id: string, data: ProposalUpdateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1772
1837
  getShared(slug: string, password?: string): Promise<_$_joai_core0.IAppResponse<SharedProposal>>;
1773
1838
  pricing(slug: string, password: string | undefined, itemIds: string[]): Promise<_$_joai_core0.IAppResponse<ProposalPricing>>;
1774
1839
  confirm(slug: string, password: string | undefined, itemIds: string[]): Promise<_$_joai_core0.IAppResponse<SharedProposal>>;
@@ -2501,6 +2566,8 @@ declare class JoAiClient {
2501
2566
  isReady: boolean;
2502
2567
  hasApiToken: boolean;
2503
2568
  readonly agents: AgentsResource;
2569
+ readonly auditLogs: AuditLogsResource;
2570
+ readonly exports: ExportsResource;
2504
2571
  readonly addresses: AddressesResource;
2505
2572
  readonly commerce: CommerceResource;
2506
2573
  readonly alerts: AlertsResource;
@@ -2609,6 +2676,7 @@ declare class CachedHttpService implements IHttpService {
2609
2676
  put<T>(url: string, data?: JsonValue | FormData, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
2610
2677
  patch<T>(url: string, data?: JsonValue | FormData, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
2611
2678
  delete<T>(url: string, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
2679
+ download<T = Blob>(url: string, data?: any, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
2612
2680
  private mutate;
2613
2681
  private bust;
2614
2682
  }
@@ -2646,4 +2714,4 @@ declare class DistributionResource {
2646
2714
  private fetchDistribution;
2647
2715
  }
2648
2716
  //#endregion
2649
- export { type AddressInput, AddressesResource, AgentsResource, AlertsResource, AnalyticsResource, ApiTokensResource, type AppEnv, type AppointmentAvailabilitySlot, AppointmentsResource, type AttachedMedia, type AuthConfirmCodeRequest, type AuthConfirmCodeResponse, type AuthNativeSessionResponse, type AuthPortalSessionResponse, AuthResource, type AuthSendCodeRequest, type AuthUser, AutomationsResource, type BackendWarp, type BackendWarpBrand, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, type Cart, type CartItem, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, type CheckoutSnapshot, type CheckoutSnapshotRequest, CommerceResource, ContactsResource, ContentResource, ContractsResource, type CreateEmptyGuestCheckoutOptions, type CreateHookPayload, type CreateInboundHookPayload, type CreateInternalHookPayload, type CreateWarpLinkedHookPayload, type CreateWebHookPayload, type DeleteUserParams, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, FollowsResource, type FulfillmentLocation, type FulfillmentLocationInput, FulfillmentsResource, GoalsResource, type GuestBuyer, type GuestCartAmounts, type GuestCheckoutCartItem, type GuestCheckoutClient, type GuestCheckoutDraft, GuestCheckoutError, type GuestCheckoutErrorCode, type GuestCheckoutSnapshotResult, type GuestCheckoutState, type GuestCommerceStorage, type GuestCommerceStorageOptions, type GuestCouponClient, GuestCouponError, type GuestCouponErrorCode, type GuestCouponPreview, type GuestOrderAccess, type HashidInput, type Hook, type HookSample, type HookTrigger, type HookTriggerCondition, type HookTriggerInput, HooksResource, type IAppResponse, IngestionsResource, InquiriesResource, InstallsResource, IntegrationsResource, IntentsResource, type ItemListParams, ItemsResource, JoAiClient, type JoAiClientConfig, KvResource, LinksResource, LoyaltyResource, McpResource, type MediaUploadType, MeetingsResource, MemoriesResource, MessagesResource, MetricsResource, MissionsResource, NotificationsResource, OfficeResource, type OpenPortalSessionOptions, type OpeningHoursEntry, type OpeningHoursFormatOptions, type Order, type OrderPriceMode, type OrderStatus, OrdersResource, PersonaResource, type PlaceCheckoutOrderRequest, type PlaceGuestCheckoutOrderResult, type Product, type ProductCategories, type ProductDetailSection, type ProductDetailText, type ProductFacets, type ProductRelationType, type ProductVariation, type ProductsListParams, ProductsResource, type ProductsSort, ProjectsResource, ProposalsResource, type RecentlyViewedStorage, type RecentlyViewedStorageOptions, RemindersResource, ReturnsResource, type RevalidateGuestCouponResult, SegmentsResource, type ServicesListParams, ServicesResource, type ShippingRate, type ShippingRateInput, ShippingResource, type ShippingZoneInput, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TaxClassInput, TaxClassesResource, type TeamInviteInfo, TeamsResource, type TranslatableValue, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, assertGuestCheckoutReady, assertGuestPickupSlotReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, createRecentlyViewedStorage, formatOpeningHours, formatPickupSlotLabel, getAuthFragmentToken, getRecentlyViewedSlugs, guestCartAmounts, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, trackRecentlyViewed, validateGuestCoupon };
2717
+ export { type AddressInput, AddressesResource, AgentsResource, AlertsResource, AnalyticsResource, ApiTokensResource, type AppEnv, type AppointmentAvailabilitySlot, AppointmentsResource, type AttachedMedia, type AuditLogEvent, type AuditLogListParams, AuditLogsResource, type AuthConfirmCodeRequest, type AuthConfirmCodeResponse, type AuthNativeSessionResponse, type AuthPortalSessionResponse, AuthResource, type AuthSendCodeRequest, type AuthUser, AutomationsResource, type BackendWarp, type BackendWarpBrand, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, type Cart, type CartItem, CartsResource, type CatalogExportFormat, type CatalogExportRequest, type CatalogExportResource, ChangelogResource, CharactersResource, CheckoutResource, type CheckoutSnapshot, type CheckoutSnapshotRequest, CommerceResource, ContactsResource, ContentResource, ContractsResource, type CreateEmptyGuestCheckoutOptions, type CreateHookPayload, type CreateInboundHookPayload, type CreateInternalHookPayload, type CreateWarpLinkedHookPayload, type CreateWebHookPayload, type DeleteUserParams, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, ExportsResource, FlowsResource, FollowsResource, type FulfillmentLocation, type FulfillmentLocationInput, FulfillmentsResource, GoalsResource, type GuestBuyer, type GuestCartAmounts, type GuestCheckoutCartItem, type GuestCheckoutClient, type GuestCheckoutDraft, GuestCheckoutError, type GuestCheckoutErrorCode, type GuestCheckoutSnapshotResult, type GuestCheckoutState, type GuestCommerceStorage, type GuestCommerceStorageOptions, type GuestCouponClient, GuestCouponError, type GuestCouponErrorCode, type GuestCouponPreview, type GuestOrderAccess, type HashidInput, type Hook, type HookSample, type HookTrigger, type HookTriggerCondition, type HookTriggerInput, HooksResource, type IAppResponse, IngestionsResource, InquiriesResource, InstallsResource, IntegrationsResource, IntentsResource, type ItemListParams, ItemsResource, JoAiClient, type JoAiClientConfig, KvResource, LinksResource, LoyaltyResource, McpResource, type MediaUploadType, MeetingsResource, MemoriesResource, MessagesResource, MetricsResource, MissionsResource, NotificationsResource, OfficeResource, type OpenPortalSessionOptions, type OpeningHoursEntry, type OpeningHoursFormatOptions, type Order, type OrderPriceMode, type OrderStatus, OrdersResource, PersonaResource, type PlaceCheckoutOrderRequest, type PlaceGuestCheckoutOrderResult, type Product, type ProductCategories, type ProductDetailSection, type ProductDetailText, type ProductFacets, type ProductRelationType, type ProductVariation, type ProductsListParams, ProductsResource, type ProductsSort, ProjectsResource, type ProposalListParams, ProposalsResource, type RecentlyViewedStorage, type RecentlyViewedStorageOptions, RemindersResource, ReturnsResource, type RevalidateGuestCouponResult, SegmentsResource, type ServicesListParams, ServicesResource, type ShippingRate, type ShippingRateInput, ShippingResource, type ShippingZoneInput, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TaxClassInput, TaxClassesResource, type TeamInviteInfo, TeamsResource, type TranslatableValue, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, assertGuestCheckoutReady, assertGuestPickupSlotReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, createRecentlyViewedStorage, formatOpeningHours, formatPickupSlotLabel, getAuthFragmentToken, getRecentlyViewedSlugs, guestCartAmounts, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, trackRecentlyViewed, validateGuestCoupon };
package/dist/index.mjs CHANGED
@@ -100,6 +100,30 @@ var AgentsResource = class {
100
100
  }
101
101
  };
102
102
  //#endregion
103
+ //#region src/resources/audit-logs.ts
104
+ var AuditLogsResource = class {
105
+ constructor(http) {
106
+ this.http = http;
107
+ }
108
+ list(params = {}) {
109
+ const query = new URLSearchParams();
110
+ for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== "") query.set(key, String(value));
111
+ const qs = query.toString();
112
+ return this.http.get(`audit-logs${qs ? `?${qs}` : ""}`);
113
+ }
114
+ };
115
+ //#endregion
116
+ //#region src/resources/exports.ts
117
+ /** Binary catalog export download. The filename is available on `response.original.headers`. */
118
+ var ExportsResource = class {
119
+ constructor(http) {
120
+ this.http = http;
121
+ }
122
+ catalog(input) {
123
+ return this.http.download("exports/catalog", input);
124
+ }
125
+ };
126
+ //#endregion
103
127
  //#region src/address/addresses.ts
104
128
  var AddressesResource = class {
105
129
  constructor(http) {
@@ -1139,6 +1163,8 @@ var BillingResource = class {
1139
1163
  let params = `orders?page=${page}&perPage=${perPage}`;
1140
1164
  if (filters.contactId) params += `&contactId=${encodeURIComponent(filters.contactId)}`;
1141
1165
  if (filters.couponId) params += `&couponId=${encodeURIComponent(filters.couponId)}`;
1166
+ if (filters.search) params += `&search=${encodeURIComponent(filters.search)}`;
1167
+ if (filters.status?.length) params += `&status=${encodeURIComponent(filters.status.join(","))}`;
1142
1168
  return this.http.get(params, team ? { headers: { "X-Team": team.slug } } : void 0);
1143
1169
  }
1144
1170
  orderStats(team) {
@@ -2518,18 +2544,32 @@ var ProjectsResource = class {
2518
2544
  //#endregion
2519
2545
  //#region src/resources/proposals.ts
2520
2546
  const access = (password) => password ? { headers: { "X-Proposal-Password": password } } : void 0;
2547
+ /**
2548
+ * Team-scoped proposal endpoints. Create the client with `createClient({ team })`
2549
+ * so the team travels as the default `X-Team` header.
2550
+ */
2521
2551
  var ProposalsResource = class {
2522
2552
  constructor(http) {
2523
2553
  this.http = http;
2524
2554
  }
2525
- list(team) {
2526
- return this.http.get("proposals", { headers: { "X-Team": team } });
2555
+ list(params) {
2556
+ const query = new URLSearchParams();
2557
+ if (params?.page != null) query.set("page", String(params.page));
2558
+ if (params?.perPage != null) query.set("perPage", String(params.perPage));
2559
+ const qs = query.toString();
2560
+ return this.http.get(`proposals${qs ? `?${qs}` : ""}`);
2527
2561
  }
2528
- create(team, data) {
2529
- return this.http.post("proposals", data, { headers: { "X-Team": team } });
2562
+ stats() {
2563
+ return this.http.get("proposals/stats");
2530
2564
  }
2531
- update(team, id, data) {
2532
- return this.http.put(`proposals/${id}`, data, { headers: { "X-Team": team } });
2565
+ get(id) {
2566
+ return this.http.get(`proposals/${id}`);
2567
+ }
2568
+ create(data) {
2569
+ return this.http.post("proposals", data);
2570
+ }
2571
+ update(id, data) {
2572
+ return this.http.put(`proposals/${id}`, data);
2533
2573
  }
2534
2574
  getShared(slug, password) {
2535
2575
  return this.http.get(`proposals/shared/${encodeURIComponent(slug)}`, access(password));
@@ -3677,16 +3717,19 @@ const DEFAULTS = {
3677
3717
  };
3678
3718
  const RELATED_PREFIXES = {
3679
3719
  content: ["contents"],
3680
- contents: ["content"]
3720
+ contents: ["content"],
3721
+ returns: ["orders"],
3722
+ orders: ["returns"]
3681
3723
  };
3724
+ const prefixVersions = /* @__PURE__ */ new Map();
3682
3725
  function getTtl(url, ttlMap, defaultTtl) {
3683
3726
  for (const [prefix, ttl] of Object.entries(ttlMap)) if (url.startsWith(prefix) || url.startsWith(`/${prefix}`)) return ttl;
3684
3727
  return defaultTtl;
3685
3728
  }
3686
3729
  function getUrlPrefix(url) {
3687
3730
  const clean = url.startsWith("/") ? url.slice(1) : url;
3688
- const slash = clean.indexOf("/");
3689
- return slash > 0 ? clean.slice(0, slash) : clean;
3731
+ const end = clean.search(/[/?]/);
3732
+ return end > 0 ? clean.slice(0, end) : clean;
3690
3733
  }
3691
3734
  var CachedHttpService = class {
3692
3735
  constructor(inner, overrides, defaultTtl) {
@@ -3736,11 +3779,13 @@ var CachedHttpService = class {
3736
3779
  this.cache.clear();
3737
3780
  }
3738
3781
  async get(url, options) {
3739
- const cached = this.cache.get(url);
3782
+ const key = `${url}#${prefixVersions.get(getUrlPrefix(url)) ?? 0}`;
3783
+ const cached = this.cache.get(key);
3740
3784
  if (cached !== void 0) return cached;
3785
+ this.cache.bust(`${url}#`);
3741
3786
  const cacheVersion = this.cacheVersion;
3742
3787
  const response = await this.inner.get(url, options);
3743
- if (response.ok && cacheVersion === this.cacheVersion) this.cache.set(url, response, getTtl(url, this.ttlMap, this.defaultTtl));
3788
+ if (response.ok && cacheVersion === this.cacheVersion) this.cache.set(key, response, getTtl(url, this.ttlMap, this.defaultTtl));
3744
3789
  return response;
3745
3790
  }
3746
3791
  async post(url, data, options) {
@@ -3755,6 +3800,9 @@ var CachedHttpService = class {
3755
3800
  async delete(url, options) {
3756
3801
  return this.mutate(getUrlPrefix(url), () => this.inner.delete(url, options));
3757
3802
  }
3803
+ async download(url, data, options) {
3804
+ return this.inner.download(url, data, options);
3805
+ }
3758
3806
  async mutate(prefix, request) {
3759
3807
  this.bust(prefix);
3760
3808
  try {
@@ -3766,7 +3814,11 @@ var CachedHttpService = class {
3766
3814
  bust(prefix) {
3767
3815
  this.cacheVersion++;
3768
3816
  this.cache.bust(prefix);
3769
- for (const relatedPrefix of RELATED_PREFIXES[prefix] ?? []) this.cache.bust(relatedPrefix);
3817
+ prefixVersions.set(prefix, (prefixVersions.get(prefix) ?? 0) + 1);
3818
+ for (const relatedPrefix of RELATED_PREFIXES[prefix] ?? []) {
3819
+ this.cache.bust(relatedPrefix);
3820
+ prefixVersions.set(relatedPrefix, (prefixVersions.get(relatedPrefix) ?? 0) + 1);
3821
+ }
3770
3822
  }
3771
3823
  };
3772
3824
  //#endregion
@@ -3795,6 +3847,8 @@ var JoAiClient = class {
3795
3847
  const cache = config.cache;
3796
3848
  this.http = cache?.enabled !== false ? new CachedHttpService(http, cache?.overrides, cache?.defaultTtl) : http;
3797
3849
  this.agents = new AgentsResource(this.http);
3850
+ this.auditLogs = new AuditLogsResource(this.http);
3851
+ this.exports = new ExportsResource(this.http);
3798
3852
  this.addresses = new AddressesResource(this.http);
3799
3853
  this.commerce = new CommerceResource(this.http);
3800
3854
  this.alerts = new AlertsResource(this.http);
@@ -3976,4 +4030,4 @@ var DistributionResource = class {
3976
4030
  }
3977
4031
  };
3978
4032
  //#endregion
3979
- export { AddressesResource, AgentsResource, AlertsResource, AnalyticsResource, ApiTokensResource, AppointmentsResource, AuthResource, AutomationsResource, BillingResource, BlueprintsResource, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, CommerceResource, ContactsResource, ContentResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, FollowsResource, FulfillmentsResource, GoalsResource, GuestCheckoutError, GuestCouponError, HooksResource, IngestionsResource, InquiriesResource, InstallsResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MetricsResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, ProposalsResource, RemindersResource, ReturnsResource, SegmentsResource, ServicesResource, ShippingResource, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, TaxClassesResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WorkspaceResource, assertGuestCheckoutReady, assertGuestPickupSlotReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, createRecentlyViewedStorage, formatOpeningHours, formatPickupSlotLabel, getAuthFragmentToken, getRecentlyViewedSlugs, guestCartAmounts, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, trackRecentlyViewed, validateGuestCoupon };
4033
+ export { AddressesResource, AgentsResource, AlertsResource, AnalyticsResource, ApiTokensResource, AppointmentsResource, AuditLogsResource, AuthResource, AutomationsResource, BillingResource, BlueprintsResource, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, CommerceResource, ContactsResource, ContentResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, ExportsResource, FlowsResource, FollowsResource, FulfillmentsResource, GoalsResource, GuestCheckoutError, GuestCouponError, HooksResource, IngestionsResource, InquiriesResource, InstallsResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MetricsResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, ProposalsResource, RemindersResource, ReturnsResource, SegmentsResource, ServicesResource, ShippingResource, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, TaxClassesResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WorkspaceResource, assertGuestCheckoutReady, assertGuestPickupSlotReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, createRecentlyViewedStorage, formatOpeningHours, formatPickupSlotLabel, getAuthFragmentToken, getRecentlyViewedSlugs, guestCartAmounts, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, trackRecentlyViewed, validateGuestCoupon };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "13.1.3",
3
+ "version": "14.0.1",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,11 +35,11 @@
35
35
  "test": "jest --config jest.config.js"
36
36
  },
37
37
  "dependencies": {
38
- "@joai/core": "^5.4.5",
38
+ "@joai/core": "^5.4.7",
39
39
  "@joai/warps": "*"
40
40
  },
41
41
  "peerDependencies": {
42
- "@joai/core": "^5.4.5"
42
+ "@joai/core": "^5.4.7"
43
43
  },
44
44
  "devDependencies": {
45
45
  "tsdown": "^0.21.0",