@joai/sdk 7.0.4 → 7.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +28 -6
- package/dist/index.mjs +28 -6
- 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, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentBooking, AppointmentPolicy, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementVariation, EmbedStatus, Entity, Flow, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IHttpService, IRequestOptions, Inquiry, InquiryType, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, 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, ProductRelation, ProductVariation, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalPollOption, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedSocialPost, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, 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, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentBooking, AppointmentPolicy, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementVariation, EmbedStatus, Entity, Flow, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IHttpService, IRequestOptions, Inquiry, InquiryType, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, 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, ProductRelation, ProductVariation, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalPollOption, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedSocialPost, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, 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
|
|
@@ -350,6 +350,16 @@ type GuestCouponClient = {
|
|
|
350
350
|
/** First `couponCode` validation message from an API error payload. */
|
|
351
351
|
declare const guestCouponMessageFromErrors: (errors: unknown) => string | undefined;
|
|
352
352
|
declare const isGuestCouponError: (error: unknown) => error is GuestCouponError;
|
|
353
|
+
type GuestCartAmounts = {
|
|
354
|
+
subtotal: number;
|
|
355
|
+
discount: number;
|
|
356
|
+
total: number;
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* Merchandise subtotal, coupon discount, and payable total (cents) for a guest cart.
|
|
360
|
+
* Pass the validated preview (or null) so discount and total stay in sync.
|
|
361
|
+
*/
|
|
362
|
+
declare const guestCartAmounts: <T extends CartLine>(cart: T[], preview?: GuestCouponPreview | null) => GuestCartAmounts;
|
|
353
363
|
/**
|
|
354
364
|
* Validates a guest coupon against cart lines. Throws {@link GuestCouponError} when the
|
|
355
365
|
* code is empty, the cart is empty, the API rejects it, or the preview discount is ≤ 0
|
|
@@ -869,16 +879,23 @@ declare class ContractsResource {
|
|
|
869
879
|
declare class DocumentsResource {
|
|
870
880
|
private readonly http;
|
|
871
881
|
constructor(http: IHttpService);
|
|
872
|
-
list(agent: string,
|
|
882
|
+
list(agent: string, params?: {
|
|
883
|
+
search?: string;
|
|
884
|
+
archived?: boolean;
|
|
885
|
+
}): Promise<_$_joai_core0.IAppResponse<Document[]>>;
|
|
873
886
|
create(agent: string, data: {
|
|
874
887
|
title: string;
|
|
875
888
|
content: string;
|
|
876
889
|
blueprint?: string;
|
|
877
890
|
}): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
878
891
|
get(id: string): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
892
|
+
getShared(slug: string): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
879
893
|
update(id: string, data: {
|
|
880
894
|
title?: string;
|
|
881
895
|
content?: string;
|
|
896
|
+
public?: boolean;
|
|
897
|
+
archived?: boolean;
|
|
898
|
+
meta?: Record<string, unknown>;
|
|
882
899
|
}): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
883
900
|
delete(id: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
884
901
|
trainFromUrl(agent: string, url: string): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
@@ -1031,12 +1048,17 @@ declare class IntentsResource {
|
|
|
1031
1048
|
}
|
|
1032
1049
|
//#endregion
|
|
1033
1050
|
//#region src/resources/items.d.ts
|
|
1051
|
+
type ItemListParams = {
|
|
1052
|
+
status?: string;
|
|
1053
|
+
priority?: string;
|
|
1054
|
+
dueToday?: boolean;
|
|
1055
|
+
scope?: 'mine' | 'all';
|
|
1056
|
+
tag?: string;
|
|
1057
|
+
};
|
|
1034
1058
|
declare class ItemsResource {
|
|
1035
1059
|
private readonly http;
|
|
1036
1060
|
constructor(http: IHttpService);
|
|
1037
|
-
list(params?:
|
|
1038
|
-
status?: string;
|
|
1039
|
-
}): Promise<_$_joai_core0.IAppResponse<Item[]>>;
|
|
1061
|
+
list(params?: ItemListParams): Promise<_$_joai_core0.IAppResponse<Item[]>>;
|
|
1040
1062
|
get(id: string): Promise<_$_joai_core0.IAppResponse<Item>>;
|
|
1041
1063
|
create(payload: ItemCreatePayload): Promise<_$_joai_core0.IAppResponse<Item>>;
|
|
1042
1064
|
update(id: string, data: ItemUpdatePayload): Promise<_$_joai_core0.IAppResponse<Item>>;
|
|
@@ -2322,4 +2344,4 @@ declare class DistributionResource {
|
|
|
2322
2344
|
private fetchDistribution;
|
|
2323
2345
|
}
|
|
2324
2346
|
//#endregion
|
|
2325
|
-
export { AddressesResource, AgentsResource, AlertsResource, ApiTokensResource, 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, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, type CheckoutSnapshot, CommerceResource, ContactsResource, ContentResource, ContractsResource, type CreateEmptyGuestCheckoutOptions, type CreateHookPayload, type CreateInboundHookPayload, type CreateInternalHookPayload, type CreateWarpLinkedHookPayload, type CreateWebHookPayload, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, type FulfillmentLocation, type FulfillmentLocationInput, FulfillmentsResource, GoalsResource, type GuestBuyer, 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 Hook, type HookSample, type HookTrigger, type HookTriggerCondition, type HookTriggerInput, HooksResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, 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 ProductVariation, ProductsResource, ProjectsResource, RemindersResource, ReturnsResource, type RevalidateGuestCouponResult, SegmentsResource, ServicesResource, type ShippingRate, type ShippingRateInput, ShippingResource, type ShippingZoneInput, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, assertGuestCheckoutReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, formatOpeningHours, getAuthFragmentToken, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, validateGuestCoupon };
|
|
2347
|
+
export { AddressesResource, AgentsResource, AlertsResource, ApiTokensResource, 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, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, type CheckoutSnapshot, CommerceResource, ContactsResource, ContentResource, ContractsResource, type CreateEmptyGuestCheckoutOptions, type CreateHookPayload, type CreateInboundHookPayload, type CreateInternalHookPayload, type CreateWarpLinkedHookPayload, type CreateWebHookPayload, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, 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 Hook, type HookSample, type HookTrigger, type HookTriggerCondition, type HookTriggerInput, HooksResource, IngestionsResource, InquiriesResource, 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 ProductVariation, ProductsResource, ProjectsResource, RemindersResource, ReturnsResource, type RevalidateGuestCouponResult, SegmentsResource, ServicesResource, type ShippingRate, type ShippingRateInput, ShippingResource, type ShippingZoneInput, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, assertGuestCheckoutReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, formatOpeningHours, getAuthFragmentToken, guestCartAmounts, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, validateGuestCoupon };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpService, getApiBaseUrl, isCompleteAddressInput } from "@joai/core";
|
|
1
|
+
import { HttpService, cartLineTotal, cartPayableTotal, getApiBaseUrl, isCompleteAddressInput } from "@joai/core";
|
|
2
2
|
import { WarpClient } from "@joai/warps";
|
|
3
3
|
//#region src/resources/agents.ts
|
|
4
4
|
var AgentsResource = class {
|
|
@@ -560,6 +560,19 @@ const toCheckoutItems = (items) => items.map(({ id, type, quantity }) => ({
|
|
|
560
560
|
quantity
|
|
561
561
|
}));
|
|
562
562
|
/**
|
|
563
|
+
* Merchandise subtotal, coupon discount, and payable total (cents) for a guest cart.
|
|
564
|
+
* Pass the validated preview (or null) so discount and total stay in sync.
|
|
565
|
+
*/
|
|
566
|
+
const guestCartAmounts = (cart, preview) => {
|
|
567
|
+
const subtotal = cartLineTotal(cart);
|
|
568
|
+
const discount = Math.max(0, preview?.discount ?? 0);
|
|
569
|
+
return {
|
|
570
|
+
subtotal,
|
|
571
|
+
discount,
|
|
572
|
+
total: cartPayableTotal(cart, discount)
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
563
576
|
* Validates a guest coupon against cart lines. Throws {@link GuestCouponError} when the
|
|
564
577
|
* code is empty, the cart is empty, the API rejects it, or the preview discount is ≤ 0
|
|
565
578
|
* (never treat a no-effect coupon as applied).
|
|
@@ -1320,10 +1333,12 @@ var DocumentsResource = class {
|
|
|
1320
1333
|
constructor(http) {
|
|
1321
1334
|
this.http = http;
|
|
1322
1335
|
}
|
|
1323
|
-
list(agent,
|
|
1324
|
-
const
|
|
1325
|
-
if (search)
|
|
1326
|
-
|
|
1336
|
+
list(agent, params) {
|
|
1337
|
+
const query = new URLSearchParams();
|
|
1338
|
+
if (params?.search) query.set("search", params.search);
|
|
1339
|
+
if (params?.archived) query.set("archived", "1");
|
|
1340
|
+
const qs = query.toString();
|
|
1341
|
+
return this.http.get(`agents/${agent}/documents${qs ? `?${qs}` : ""}`);
|
|
1327
1342
|
}
|
|
1328
1343
|
create(agent, data) {
|
|
1329
1344
|
return this.http.post(`agents/${agent}/documents`, data);
|
|
@@ -1331,6 +1346,9 @@ var DocumentsResource = class {
|
|
|
1331
1346
|
get(id) {
|
|
1332
1347
|
return this.http.get(`documents/${id}`);
|
|
1333
1348
|
}
|
|
1349
|
+
getShared(slug) {
|
|
1350
|
+
return this.http.get(`documents/shared/${encodeURIComponent(slug)}`);
|
|
1351
|
+
}
|
|
1334
1352
|
update(id, data) {
|
|
1335
1353
|
return this.http.put(`documents/${id}`, data);
|
|
1336
1354
|
}
|
|
@@ -1537,6 +1555,10 @@ var ItemsResource = class {
|
|
|
1537
1555
|
list(params) {
|
|
1538
1556
|
const query = new URLSearchParams();
|
|
1539
1557
|
if (params?.status) query.set("status", params.status);
|
|
1558
|
+
if (params?.priority) query.set("priority", params.priority);
|
|
1559
|
+
if (params?.dueToday) query.set("dueToday", "1");
|
|
1560
|
+
if (params?.scope) query.set("scope", params.scope);
|
|
1561
|
+
if (params?.tag) query.set("tag", params.tag);
|
|
1540
1562
|
const qs = query.toString();
|
|
1541
1563
|
return this.http.get(`items${qs ? "?" + qs : ""}`);
|
|
1542
1564
|
}
|
|
@@ -3520,4 +3542,4 @@ var DistributionResource = class {
|
|
|
3520
3542
|
}
|
|
3521
3543
|
};
|
|
3522
3544
|
//#endregion
|
|
3523
|
-
export { AddressesResource, AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, AutomationsResource, BillingResource, BlueprintsResource, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, CommerceResource, ContactsResource, ContentResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, FulfillmentsResource, GoalsResource, GuestCheckoutError, GuestCouponError, HooksResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MetricsResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, RemindersResource, ReturnsResource, SegmentsResource, ServicesResource, ShippingResource, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WorkspaceResource, assertGuestCheckoutReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, formatOpeningHours, getAuthFragmentToken, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, validateGuestCoupon };
|
|
3545
|
+
export { AddressesResource, AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, AutomationsResource, BillingResource, BlueprintsResource, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, CheckoutResource, CommerceResource, ContactsResource, ContentResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, FulfillmentsResource, GoalsResource, GuestCheckoutError, GuestCouponError, HooksResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MetricsResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, RemindersResource, ReturnsResource, SegmentsResource, ServicesResource, ShippingResource, ShortcutsResource, SitesResource, SkillsResource, SocialPostsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WorkspaceResource, assertGuestCheckoutReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, formatOpeningHours, getAuthFragmentToken, guestCartAmounts, guestCouponMessageFromErrors, isAllowedRedirectUrl, isGuestCheckoutError, isGuestCouponError, isPortalCallbackUrl, openPortalSession, placeGuestCheckoutOrder, readGuestOrderReturnAccess, revalidateGuestCoupon, sanitizePortalCallbackUrl, stripGuestOrderReturnToken, toGuestCheckoutDraft, validateGuestCoupon };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joai/sdk",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
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": "^4.15.
|
|
38
|
+
"@joai/core": "^4.15.4",
|
|
39
39
|
"@joai/warps": "*"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@joai/core": "^4.15.
|
|
42
|
+
"@joai/core": "^4.15.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsdown": "^0.21.0",
|