@joai/sdk 13.1.2 → 14.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 +89 -5
- package/dist/index.mjs +75 -8
- package/package.json +3 -3
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, 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, 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;
|
|
@@ -1683,11 +1736,13 @@ declare class ProductsResource {
|
|
|
1683
1736
|
createVariation(productSlug: string, data: {
|
|
1684
1737
|
name: TranslatableValue$1;
|
|
1685
1738
|
sku: string;
|
|
1739
|
+
barcode?: string;
|
|
1686
1740
|
price: number;
|
|
1687
1741
|
type?: string;
|
|
1688
1742
|
}): Promise<_$_joai_core0.IAppResponse<ProductVariation>>;
|
|
1689
1743
|
updateVariation(variationId: string, data: {
|
|
1690
1744
|
name?: TranslatableValue$1;
|
|
1745
|
+
barcode?: string | null;
|
|
1691
1746
|
price?: number;
|
|
1692
1747
|
active?: boolean;
|
|
1693
1748
|
hidden?: boolean;
|
|
@@ -1698,6 +1753,21 @@ declare class ProductsResource {
|
|
|
1698
1753
|
stock?: number | null;
|
|
1699
1754
|
weight?: number | null;
|
|
1700
1755
|
}): Promise<_$_joai_core0.IAppResponse<ProductVariation>>;
|
|
1756
|
+
lookupVariation(params: {
|
|
1757
|
+
barcode?: string;
|
|
1758
|
+
source?: ProductVariationExternalSource;
|
|
1759
|
+
externalId?: string;
|
|
1760
|
+
}): Promise<_$_joai_core0.IAppResponse<ProductVariation>>;
|
|
1761
|
+
listVariationExternalReferences(variationId: string): Promise<_$_joai_core0.IAppResponse<ProductVariationExternalReference[]>>;
|
|
1762
|
+
createVariationExternalReference(variationId: string, data: {
|
|
1763
|
+
source: ProductVariationExternalSource;
|
|
1764
|
+
externalId: string;
|
|
1765
|
+
}): Promise<_$_joai_core0.IAppResponse<ProductVariationExternalReference>>;
|
|
1766
|
+
updateVariationExternalReference(variationId: string, referenceId: string, data: {
|
|
1767
|
+
source?: ProductVariationExternalSource;
|
|
1768
|
+
externalId?: string;
|
|
1769
|
+
}): Promise<_$_joai_core0.IAppResponse<ProductVariationExternalReference>>;
|
|
1770
|
+
deleteVariationExternalReference(variationId: string, referenceId: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1701
1771
|
sortVariations(ids: string[]): Promise<_$_joai_core0.IAppResponse<unknown>>;
|
|
1702
1772
|
deleteVariation(variationId: string): Promise<_$_joai_core0.IAppResponse<unknown>>;
|
|
1703
1773
|
createRelation(productSlug: string, data: {
|
|
@@ -1746,12 +1816,22 @@ declare class ProjectsResource {
|
|
|
1746
1816
|
}
|
|
1747
1817
|
//#endregion
|
|
1748
1818
|
//#region src/resources/proposals.d.ts
|
|
1819
|
+
type ProposalListParams = {
|
|
1820
|
+
page?: number;
|
|
1821
|
+
perPage?: number;
|
|
1822
|
+
};
|
|
1823
|
+
/**
|
|
1824
|
+
* Team-scoped proposal endpoints. Create the client with `createClient({ team })`
|
|
1825
|
+
* so the team travels as the default `X-Team` header.
|
|
1826
|
+
*/
|
|
1749
1827
|
declare class ProposalsResource {
|
|
1750
1828
|
private readonly http;
|
|
1751
1829
|
constructor(http: IHttpService);
|
|
1752
|
-
list(
|
|
1753
|
-
|
|
1754
|
-
|
|
1830
|
+
list(params?: ProposalListParams): Promise<_$_joai_core0.IAppResponse<ClientProposal[]>>;
|
|
1831
|
+
stats(): Promise<_$_joai_core0.IAppResponse<ProposalStats>>;
|
|
1832
|
+
get(id: string): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
|
|
1833
|
+
create(data: ProposalCreateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
|
|
1834
|
+
update(id: string, data: ProposalUpdateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
|
|
1755
1835
|
getShared(slug: string, password?: string): Promise<_$_joai_core0.IAppResponse<SharedProposal>>;
|
|
1756
1836
|
pricing(slug: string, password: string | undefined, itemIds: string[]): Promise<_$_joai_core0.IAppResponse<ProposalPricing>>;
|
|
1757
1837
|
confirm(slug: string, password: string | undefined, itemIds: string[]): Promise<_$_joai_core0.IAppResponse<SharedProposal>>;
|
|
@@ -1960,6 +2040,7 @@ declare class SubscriptionsResource {
|
|
|
1960
2040
|
private readonly http;
|
|
1961
2041
|
constructor(http: IHttpService);
|
|
1962
2042
|
list(team?: string): Promise<_$_joai_core0.IAppResponse<Subscription[]>>;
|
|
2043
|
+
stats(team: string): Promise<_$_joai_core0.IAppResponse<TeamSubscriptionStats>>;
|
|
1963
2044
|
get(id: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
1964
2045
|
cancel(id: string, team: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
1965
2046
|
resume(id: string, team: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
@@ -2483,6 +2564,8 @@ declare class JoAiClient {
|
|
|
2483
2564
|
isReady: boolean;
|
|
2484
2565
|
hasApiToken: boolean;
|
|
2485
2566
|
readonly agents: AgentsResource;
|
|
2567
|
+
readonly auditLogs: AuditLogsResource;
|
|
2568
|
+
readonly exports: ExportsResource;
|
|
2486
2569
|
readonly addresses: AddressesResource;
|
|
2487
2570
|
readonly commerce: CommerceResource;
|
|
2488
2571
|
readonly alerts: AlertsResource;
|
|
@@ -2591,6 +2674,7 @@ declare class CachedHttpService implements IHttpService {
|
|
|
2591
2674
|
put<T>(url: string, data?: JsonValue | FormData, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
|
|
2592
2675
|
patch<T>(url: string, data?: JsonValue | FormData, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
|
|
2593
2676
|
delete<T>(url: string, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
|
|
2677
|
+
download<T = Blob>(url: string, data?: any, options?: IRequestOptions): Promise<IAppResponse$1<T>>;
|
|
2594
2678
|
private mutate;
|
|
2595
2679
|
private bust;
|
|
2596
2680
|
}
|
|
@@ -2628,4 +2712,4 @@ declare class DistributionResource {
|
|
|
2628
2712
|
private fetchDistribution;
|
|
2629
2713
|
}
|
|
2630
2714
|
//#endregion
|
|
2631
|
-
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 };
|
|
2715
|
+
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) {
|
|
@@ -2437,6 +2461,25 @@ var ProductsResource = class {
|
|
|
2437
2461
|
updateVariation(variationId, data) {
|
|
2438
2462
|
return this.http.put(`products/variations/${variationId}`, data);
|
|
2439
2463
|
}
|
|
2464
|
+
lookupVariation(params) {
|
|
2465
|
+
const search = new URLSearchParams();
|
|
2466
|
+
if (params.barcode) search.set("barcode", params.barcode);
|
|
2467
|
+
if (params.source) search.set("source", params.source);
|
|
2468
|
+
if (params.externalId) search.set("externalId", params.externalId);
|
|
2469
|
+
return this.http.get(`products/variations/lookup?${search.toString()}`);
|
|
2470
|
+
}
|
|
2471
|
+
listVariationExternalReferences(variationId) {
|
|
2472
|
+
return this.http.get(`products/variations/${variationId}/external-references`);
|
|
2473
|
+
}
|
|
2474
|
+
createVariationExternalReference(variationId, data) {
|
|
2475
|
+
return this.http.post(`products/variations/${variationId}/external-references`, data);
|
|
2476
|
+
}
|
|
2477
|
+
updateVariationExternalReference(variationId, referenceId, data) {
|
|
2478
|
+
return this.http.put(`products/variations/${variationId}/external-references/${referenceId}`, data);
|
|
2479
|
+
}
|
|
2480
|
+
deleteVariationExternalReference(variationId, referenceId) {
|
|
2481
|
+
return this.http.delete(`products/variations/${variationId}/external-references/${referenceId}`);
|
|
2482
|
+
}
|
|
2440
2483
|
sortVariations(ids) {
|
|
2441
2484
|
return this.http.post("products/variations/sort", { ids });
|
|
2442
2485
|
}
|
|
@@ -2499,18 +2542,32 @@ var ProjectsResource = class {
|
|
|
2499
2542
|
//#endregion
|
|
2500
2543
|
//#region src/resources/proposals.ts
|
|
2501
2544
|
const access = (password) => password ? { headers: { "X-Proposal-Password": password } } : void 0;
|
|
2545
|
+
/**
|
|
2546
|
+
* Team-scoped proposal endpoints. Create the client with `createClient({ team })`
|
|
2547
|
+
* so the team travels as the default `X-Team` header.
|
|
2548
|
+
*/
|
|
2502
2549
|
var ProposalsResource = class {
|
|
2503
2550
|
constructor(http) {
|
|
2504
2551
|
this.http = http;
|
|
2505
2552
|
}
|
|
2506
|
-
list(
|
|
2507
|
-
|
|
2553
|
+
list(params) {
|
|
2554
|
+
const query = new URLSearchParams();
|
|
2555
|
+
if (params?.page != null) query.set("page", String(params.page));
|
|
2556
|
+
if (params?.perPage != null) query.set("perPage", String(params.perPage));
|
|
2557
|
+
const qs = query.toString();
|
|
2558
|
+
return this.http.get(`proposals${qs ? `?${qs}` : ""}`);
|
|
2508
2559
|
}
|
|
2509
|
-
|
|
2510
|
-
return this.http.
|
|
2560
|
+
stats() {
|
|
2561
|
+
return this.http.get("proposals/stats");
|
|
2511
2562
|
}
|
|
2512
|
-
|
|
2513
|
-
return this.http.
|
|
2563
|
+
get(id) {
|
|
2564
|
+
return this.http.get(`proposals/${id}`);
|
|
2565
|
+
}
|
|
2566
|
+
create(data) {
|
|
2567
|
+
return this.http.post("proposals", data);
|
|
2568
|
+
}
|
|
2569
|
+
update(id, data) {
|
|
2570
|
+
return this.http.put(`proposals/${id}`, data);
|
|
2514
2571
|
}
|
|
2515
2572
|
getShared(slug, password) {
|
|
2516
2573
|
return this.http.get(`proposals/shared/${encodeURIComponent(slug)}`, access(password));
|
|
@@ -2777,6 +2834,9 @@ var SubscriptionsResource = class {
|
|
|
2777
2834
|
list(team) {
|
|
2778
2835
|
return team ? this.http.get("subscriptions", { headers: { "X-Team": team } }) : this.http.get("subscriptions");
|
|
2779
2836
|
}
|
|
2837
|
+
stats(team) {
|
|
2838
|
+
return this.http.get(`subscriptions/stats?team=${encodeURIComponent(team)}`, { headers: { "X-Team": team } });
|
|
2839
|
+
}
|
|
2780
2840
|
get(id) {
|
|
2781
2841
|
return this.http.get(`subscriptions/${id}`);
|
|
2782
2842
|
}
|
|
@@ -3655,7 +3715,9 @@ const DEFAULTS = {
|
|
|
3655
3715
|
};
|
|
3656
3716
|
const RELATED_PREFIXES = {
|
|
3657
3717
|
content: ["contents"],
|
|
3658
|
-
contents: ["content"]
|
|
3718
|
+
contents: ["content"],
|
|
3719
|
+
returns: ["orders"],
|
|
3720
|
+
orders: ["returns"]
|
|
3659
3721
|
};
|
|
3660
3722
|
function getTtl(url, ttlMap, defaultTtl) {
|
|
3661
3723
|
for (const [prefix, ttl] of Object.entries(ttlMap)) if (url.startsWith(prefix) || url.startsWith(`/${prefix}`)) return ttl;
|
|
@@ -3733,6 +3795,9 @@ var CachedHttpService = class {
|
|
|
3733
3795
|
async delete(url, options) {
|
|
3734
3796
|
return this.mutate(getUrlPrefix(url), () => this.inner.delete(url, options));
|
|
3735
3797
|
}
|
|
3798
|
+
async download(url, data, options) {
|
|
3799
|
+
return this.inner.download(url, data, options);
|
|
3800
|
+
}
|
|
3736
3801
|
async mutate(prefix, request) {
|
|
3737
3802
|
this.bust(prefix);
|
|
3738
3803
|
try {
|
|
@@ -3773,6 +3838,8 @@ var JoAiClient = class {
|
|
|
3773
3838
|
const cache = config.cache;
|
|
3774
3839
|
this.http = cache?.enabled !== false ? new CachedHttpService(http, cache?.overrides, cache?.defaultTtl) : http;
|
|
3775
3840
|
this.agents = new AgentsResource(this.http);
|
|
3841
|
+
this.auditLogs = new AuditLogsResource(this.http);
|
|
3842
|
+
this.exports = new ExportsResource(this.http);
|
|
3776
3843
|
this.addresses = new AddressesResource(this.http);
|
|
3777
3844
|
this.commerce = new CommerceResource(this.http);
|
|
3778
3845
|
this.alerts = new AlertsResource(this.http);
|
|
@@ -3954,4 +4021,4 @@ var DistributionResource = class {
|
|
|
3954
4021
|
}
|
|
3955
4022
|
};
|
|
3956
4023
|
//#endregion
|
|
3957
|
-
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 };
|
|
4024
|
+
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": "
|
|
3
|
+
"version": "14.0.0",
|
|
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.
|
|
38
|
+
"@joai/core": "^5.4.6",
|
|
39
39
|
"@joai/warps": "*"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@joai/core": "^5.4.
|
|
42
|
+
"@joai/core": "^5.4.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsdown": "^0.21.0",
|