@joai/sdk 7.0.5 → 7.0.7
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 +67 -23
- package/dist/index.mjs +65 -19
- 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, 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";
|
|
2
|
+
import { Address, AddressCreatePayload, AddressInput, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, 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, ShippingCarrierOption, 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, TaxClass, 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
|
|
@@ -71,6 +71,8 @@ declare class AddressesResource {
|
|
|
71
71
|
type PlaceCheckoutOrderRequest = CheckoutSnapshotRequest & {
|
|
72
72
|
guest?: GuestBuyer;
|
|
73
73
|
notes?: string;
|
|
74
|
+
scheduledAt?: string;
|
|
75
|
+
serviceSlug?: string;
|
|
74
76
|
idempotencyKey?: string;
|
|
75
77
|
saveAddresses?: boolean;
|
|
76
78
|
sendConfirmation?: boolean;
|
|
@@ -107,10 +109,16 @@ declare class CheckoutResource {
|
|
|
107
109
|
}
|
|
108
110
|
//#endregion
|
|
109
111
|
//#region src/commerce/fulfillments.d.ts
|
|
112
|
+
type FulfillmentUpdateInput = {
|
|
113
|
+
status?: Fulfillment['status'];
|
|
114
|
+
carrierCode?: string | null;
|
|
115
|
+
trackingNumber?: string | null;
|
|
116
|
+
};
|
|
110
117
|
declare class FulfillmentsResource {
|
|
111
118
|
private readonly http;
|
|
112
119
|
constructor(http: IHttpService);
|
|
113
120
|
list(orderId: string): Promise<_$_joai_core0.IAppResponse<Fulfillment[]>>;
|
|
121
|
+
carriers(): Promise<_$_joai_core0.IAppResponse<ShippingCarrierOption[]>>;
|
|
114
122
|
create(orderId: string, data: {
|
|
115
123
|
items: {
|
|
116
124
|
orderItemId: number;
|
|
@@ -118,10 +126,9 @@ declare class FulfillmentsResource {
|
|
|
118
126
|
}[];
|
|
119
127
|
carrierCode?: string;
|
|
120
128
|
trackingNumber?: string;
|
|
121
|
-
trackingUrl?: string;
|
|
122
129
|
status?: Fulfillment['status'];
|
|
123
130
|
}): Promise<_$_joai_core0.IAppResponse<Fulfillment>>;
|
|
124
|
-
update(orderId: string, fulfillmentId: string,
|
|
131
|
+
update(orderId: string, fulfillmentId: string, data: FulfillmentUpdateInput | Fulfillment['status']): Promise<_$_joai_core0.IAppResponse<Fulfillment>>;
|
|
125
132
|
}
|
|
126
133
|
//#endregion
|
|
127
134
|
//#region src/commerce/returns.d.ts
|
|
@@ -170,7 +177,7 @@ type ShippingRateInput = {
|
|
|
170
177
|
};
|
|
171
178
|
type FulfillmentLocationInput = {
|
|
172
179
|
name: string;
|
|
173
|
-
addressId?:
|
|
180
|
+
addressId?: string | null;
|
|
174
181
|
instructions?: string | null;
|
|
175
182
|
active?: boolean;
|
|
176
183
|
};
|
|
@@ -186,8 +193,24 @@ declare class ShippingResource {
|
|
|
186
193
|
deleteRate(team: string, zoneId: number, rateId: number): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
187
194
|
locations(team: string): Promise<_$_joai_core0.IAppResponse<FulfillmentLocation$1[]>>;
|
|
188
195
|
createLocation(team: string, data: FulfillmentLocationInput): Promise<_$_joai_core0.IAppResponse<FulfillmentLocation$1>>;
|
|
189
|
-
updateLocation(team: string, locationId:
|
|
190
|
-
deleteLocation(team: string, locationId:
|
|
196
|
+
updateLocation(team: string, locationId: string, data: FulfillmentLocationInput): Promise<_$_joai_core0.IAppResponse<FulfillmentLocation$1>>;
|
|
197
|
+
deleteLocation(team: string, locationId: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/commerce/taxClasses.d.ts
|
|
201
|
+
type TaxClassInput = {
|
|
202
|
+
name: string;
|
|
203
|
+
rate: number;
|
|
204
|
+
isDefault?: boolean;
|
|
205
|
+
position?: number;
|
|
206
|
+
};
|
|
207
|
+
declare class TaxClassesResource {
|
|
208
|
+
private readonly http;
|
|
209
|
+
constructor(http: IHttpService);
|
|
210
|
+
list(team: string): Promise<_$_joai_core0.IAppResponse<TaxClass[]>>;
|
|
211
|
+
create(team: string, data: TaxClassInput): Promise<_$_joai_core0.IAppResponse<TaxClass>>;
|
|
212
|
+
update(team: string, taxClassId: string, data: TaxClassInput): Promise<_$_joai_core0.IAppResponse<TaxClass>>;
|
|
213
|
+
delete(team: string, taxClassId: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
191
214
|
}
|
|
192
215
|
//#endregion
|
|
193
216
|
//#region src/commerce/guest.d.ts
|
|
@@ -199,8 +222,10 @@ type GuestCheckoutDraft<TCart = unknown> = {
|
|
|
199
222
|
cart: TCart;
|
|
200
223
|
fulfillmentMethod: FulfillmentMethod;
|
|
201
224
|
shippingRateId: number | null;
|
|
202
|
-
fulfillmentLocationId:
|
|
203
|
-
couponCode?: string | null;
|
|
225
|
+
fulfillmentLocationId: string | null;
|
|
226
|
+
couponCode?: string | null; /** Pickup appointment start (ISO-8601), required for pickup confirm. */
|
|
227
|
+
scheduledAt?: string | null; /** Bookable service slug when the shop has more than one. */
|
|
228
|
+
serviceSlug?: string | null;
|
|
204
229
|
};
|
|
205
230
|
type GuestCommerceStorageOptions = {
|
|
206
231
|
namespace: string;
|
|
@@ -234,7 +259,7 @@ type GuestCheckoutState<TCart = GuestCheckoutCartItem[]> = GuestCheckoutDraft<TC
|
|
|
234
259
|
identity: GuestBuyer$1;
|
|
235
260
|
address: AddressInput;
|
|
236
261
|
};
|
|
237
|
-
type GuestCheckoutErrorCode = 'empty_cart' | 'missing_identity' | 'missing_pickup_phone' | 'incomplete_shipping_address' | 'pickup_unavailable' | 'missing_shipping_rate' | 'rates_failed' | 'snapshot_failed' | 'review_required' | 'terms_required' | 'review_expired' | 'order_failed' | 'payment_failed';
|
|
262
|
+
type GuestCheckoutErrorCode = 'empty_cart' | 'missing_identity' | 'missing_pickup_phone' | 'missing_scheduled_at' | 'incomplete_shipping_address' | 'pickup_unavailable' | 'missing_shipping_rate' | 'rates_failed' | 'snapshot_failed' | 'review_required' | 'terms_required' | 'review_expired' | 'order_failed' | 'payment_failed';
|
|
238
263
|
declare class GuestCheckoutError extends Error {
|
|
239
264
|
readonly code: GuestCheckoutErrorCode;
|
|
240
265
|
constructor(code: GuestCheckoutErrorCode);
|
|
@@ -260,6 +285,8 @@ type GuestCheckoutClient = {
|
|
|
260
285
|
guest?: GuestBuyer$1;
|
|
261
286
|
idempotencyKey?: string;
|
|
262
287
|
notes?: string;
|
|
288
|
+
scheduledAt?: string;
|
|
289
|
+
serviceSlug?: string;
|
|
263
290
|
sendConfirmation?: boolean;
|
|
264
291
|
}): Promise<IAppResponse<Order$1>>;
|
|
265
292
|
pay(id: string, provider?: PaymentProvider, accessToken?: string): Promise<IAppResponse<{
|
|
@@ -273,10 +300,11 @@ type CreateEmptyGuestCheckoutOptions = {
|
|
|
273
300
|
};
|
|
274
301
|
declare const createEmptyGuestCheckoutState: <TCart = GuestCheckoutCartItem[]>(options?: CreateEmptyGuestCheckoutOptions) => GuestCheckoutState<TCart>;
|
|
275
302
|
declare const toGuestCheckoutDraft: <TCart>(state: GuestCheckoutState<TCart>) => GuestCheckoutDraft<TCart>;
|
|
276
|
-
declare const assertGuestCheckoutReady: (state: GuestCheckoutState, pickupLocationIds?:
|
|
303
|
+
declare const assertGuestCheckoutReady: (state: GuestCheckoutState, pickupLocationIds?: string[]) => void;
|
|
304
|
+
declare const assertGuestPickupSlotReady: (state: GuestCheckoutState) => void;
|
|
277
305
|
declare const buildGuestCheckoutSnapshotRequest: (state: GuestCheckoutState, options?: {
|
|
278
306
|
shippingRates?: ShippingRate$1[];
|
|
279
|
-
pickupLocationIds?:
|
|
307
|
+
pickupLocationIds?: string[];
|
|
280
308
|
}) => CheckoutSnapshotRequest;
|
|
281
309
|
type GuestCheckoutSnapshotResult = {
|
|
282
310
|
snapshot: CheckoutSnapshot$1 & {
|
|
@@ -289,7 +317,7 @@ declare function createGuestCheckoutSnapshot(options: {
|
|
|
289
317
|
client: GuestCheckoutClient;
|
|
290
318
|
team: string;
|
|
291
319
|
state: GuestCheckoutState;
|
|
292
|
-
pickupLocationIds?:
|
|
320
|
+
pickupLocationIds?: string[];
|
|
293
321
|
shippingRates?: ShippingRate$1[];
|
|
294
322
|
}): Promise<GuestCheckoutSnapshotResult>;
|
|
295
323
|
type PlaceGuestCheckoutOrderResult = {
|
|
@@ -317,6 +345,8 @@ declare function placeGuestCheckoutOrder(options: {
|
|
|
317
345
|
guest: GuestBuyer$1;
|
|
318
346
|
acceptedTerms?: boolean;
|
|
319
347
|
notes?: string;
|
|
348
|
+
scheduledAt?: string;
|
|
349
|
+
serviceSlug?: string;
|
|
320
350
|
idempotencyKey?: string;
|
|
321
351
|
pay?: boolean;
|
|
322
352
|
}): Promise<PlaceGuestCheckoutOrderResult>;
|
|
@@ -391,10 +421,15 @@ declare function revalidateGuestCoupon(options: {
|
|
|
391
421
|
items: GuestCheckoutCartItem[];
|
|
392
422
|
}): Promise<RevalidateGuestCouponResult>;
|
|
393
423
|
//#endregion
|
|
424
|
+
//#region src/commerce/pickupSlotLabel.d.ts
|
|
425
|
+
/** Formats a pickup slot in a locale-aware 24h label. Pass timeZone when the meeting/policy provides one. */
|
|
426
|
+
declare const formatPickupSlotLabel: (iso: string, locale: string, timeZone?: string | null) => string;
|
|
427
|
+
//#endregion
|
|
394
428
|
//#region src/commerce/index.d.ts
|
|
395
429
|
declare class CommerceResource {
|
|
396
430
|
readonly checkout: CheckoutResource;
|
|
397
431
|
readonly shipping: ShippingResource;
|
|
432
|
+
readonly taxClasses: TaxClassesResource;
|
|
398
433
|
readonly fulfillments: FulfillmentsResource;
|
|
399
434
|
readonly returns: ReturnsResource;
|
|
400
435
|
constructor(http: IHttpService);
|
|
@@ -546,7 +581,7 @@ declare class AppointmentsResource {
|
|
|
546
581
|
private readonly config;
|
|
547
582
|
constructor(http: IHttpService, config: JoAiClientConfig);
|
|
548
583
|
getPolicy(): Promise<_$_joai_core0.IAppResponse<AppointmentPolicy | null>>;
|
|
549
|
-
upsertPolicy(data:
|
|
584
|
+
upsertPolicy(data: AppointmentPolicyUpsert): Promise<_$_joai_core0.IAppResponse<AppointmentPolicy>>;
|
|
550
585
|
checkAvailability(agentUuid: string, params: {
|
|
551
586
|
windowStart: string;
|
|
552
587
|
windowEnd: string;
|
|
@@ -689,7 +724,7 @@ declare class BillingResource {
|
|
|
689
724
|
orders(team: TeamPrivate | null, page?: number, filters?: {
|
|
690
725
|
contactId?: string;
|
|
691
726
|
couponId?: string;
|
|
692
|
-
}): Promise<_$_joai_core0.IAppResponse<Order$1[]>>;
|
|
727
|
+
}, perPage?: number): Promise<_$_joai_core0.IAppResponse<Order$1[]>>;
|
|
693
728
|
orderStats(team: string): Promise<_$_joai_core0.IAppResponse<TeamOrderStats>>;
|
|
694
729
|
payOrder(id: string, provider?: PaymentProvider, accessToken?: string): Promise<_$_joai_core0.IAppResponse<{
|
|
695
730
|
url: string;
|
|
@@ -889,12 +924,14 @@ declare class DocumentsResource {
|
|
|
889
924
|
blueprint?: string;
|
|
890
925
|
}): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
891
926
|
get(id: string): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
892
|
-
getShared(slug: string): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
927
|
+
getShared(slug: string, password?: string): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
893
928
|
update(id: string, data: {
|
|
894
929
|
title?: string;
|
|
895
930
|
content?: string;
|
|
896
931
|
public?: boolean;
|
|
897
932
|
archived?: boolean;
|
|
933
|
+
password?: string | null;
|
|
934
|
+
clearPassword?: boolean;
|
|
898
935
|
meta?: Record<string, unknown>;
|
|
899
936
|
}): Promise<_$_joai_core0.IAppResponse<Document>>;
|
|
900
937
|
delete(id: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
@@ -1353,7 +1390,7 @@ declare class OfficeResource {
|
|
|
1353
1390
|
declare class OrdersResource {
|
|
1354
1391
|
private readonly http;
|
|
1355
1392
|
constructor(http: IHttpService);
|
|
1356
|
-
list(team: string): Promise<_$_joai_core0.IAppResponse<Order$1[]>>;
|
|
1393
|
+
list(team: string, page?: number, perPage?: number): Promise<_$_joai_core0.IAppResponse<Order$1[]>>;
|
|
1357
1394
|
get(id: string, accessToken?: string): Promise<_$_joai_core0.IAppResponse<Order$1>>;
|
|
1358
1395
|
create(data: {
|
|
1359
1396
|
contactId?: string;
|
|
@@ -1375,23 +1412,27 @@ declare class OrdersResource {
|
|
|
1375
1412
|
quantity: number;
|
|
1376
1413
|
name?: string;
|
|
1377
1414
|
unitPrice?: number;
|
|
1415
|
+
taxClassId?: string | null;
|
|
1378
1416
|
configuration?: Configuration;
|
|
1379
1417
|
}[];
|
|
1380
1418
|
fulfillmentMethod?: FulfillmentMethod;
|
|
1381
1419
|
snapshotId?: string;
|
|
1382
1420
|
snapshotAccessToken?: string;
|
|
1383
|
-
billingAddressId?:
|
|
1384
|
-
shippingAddressId?:
|
|
1421
|
+
billingAddressId?: string;
|
|
1422
|
+
shippingAddressId?: string;
|
|
1385
1423
|
billingAddress?: AddressInput;
|
|
1386
1424
|
shippingAddress?: AddressInput;
|
|
1387
1425
|
shippingRateId?: number;
|
|
1388
|
-
fulfillmentLocationId?:
|
|
1426
|
+
fulfillmentLocationId?: string;
|
|
1389
1427
|
idempotencyKey?: string;
|
|
1390
1428
|
guest?: {
|
|
1391
1429
|
name: string;
|
|
1392
1430
|
email: string;
|
|
1393
1431
|
phone?: string;
|
|
1394
1432
|
};
|
|
1433
|
+
scheduledAt?: string;
|
|
1434
|
+
serviceSlug?: string;
|
|
1435
|
+
couponCode?: string;
|
|
1395
1436
|
}): Promise<_$_joai_core0.IAppResponse<Order$1>>;
|
|
1396
1437
|
update(id: string, data: {
|
|
1397
1438
|
status?: OrderStatus$1;
|
|
@@ -1436,6 +1477,7 @@ declare class ProductsResource {
|
|
|
1436
1477
|
description?: TranslatableValue | null;
|
|
1437
1478
|
virtual?: boolean;
|
|
1438
1479
|
public?: boolean;
|
|
1480
|
+
taxClassId?: string | null;
|
|
1439
1481
|
}, teamSlug?: string): Promise<_$_joai_core0.IAppResponse<Product>>;
|
|
1440
1482
|
update(id: string, data: {
|
|
1441
1483
|
name?: TranslatableValue;
|
|
@@ -1446,6 +1488,7 @@ declare class ProductsResource {
|
|
|
1446
1488
|
active?: boolean;
|
|
1447
1489
|
public?: boolean;
|
|
1448
1490
|
virtual?: boolean;
|
|
1491
|
+
taxClassId?: string | null;
|
|
1449
1492
|
media?: string[];
|
|
1450
1493
|
}): Promise<_$_joai_core0.IAppResponse<Product>>;
|
|
1451
1494
|
delete(id: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
@@ -1570,10 +1613,11 @@ declare class ServicesResource {
|
|
|
1570
1613
|
digital?: boolean;
|
|
1571
1614
|
public?: boolean;
|
|
1572
1615
|
bookable?: boolean;
|
|
1616
|
+
taxClassId?: string | null;
|
|
1573
1617
|
pricingModel?: string;
|
|
1574
1618
|
settings?: Record<string, unknown> | null;
|
|
1575
1619
|
}): Promise<_$_joai_core0.IAppResponse<Service>>;
|
|
1576
|
-
update(id: string, data: Partial<Pick<Service, 'name' | 'price' | 'description' | 'active' | 'digital' | 'public' | 'bookable'>> & {
|
|
1620
|
+
update(id: string, data: Partial<Pick<Service, 'name' | 'price' | 'description' | 'active' | 'digital' | 'public' | 'bookable' | 'taxClassId'>> & {
|
|
1577
1621
|
durationMinutes?: number | null;
|
|
1578
1622
|
settings?: Record<string, unknown> | null;
|
|
1579
1623
|
}): Promise<_$_joai_core0.IAppResponse<Service>>;
|
|
@@ -1709,9 +1753,9 @@ declare class SubscriptionsResource {
|
|
|
1709
1753
|
resume(id: string, team: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
1710
1754
|
updateDelivery(id: string, data: {
|
|
1711
1755
|
fulfillmentMethod: 'shipping' | 'pickup';
|
|
1712
|
-
shippingAddressId?:
|
|
1756
|
+
shippingAddressId?: string | null;
|
|
1713
1757
|
shippingRateId?: number | null;
|
|
1714
|
-
fulfillmentLocationId?:
|
|
1758
|
+
fulfillmentLocationId?: string | null;
|
|
1715
1759
|
}): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
1716
1760
|
skip(id: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
1717
1761
|
pause(id: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
|
|
@@ -2344,4 +2388,4 @@ declare class DistributionResource {
|
|
|
2344
2388
|
private fetchDistribution;
|
|
2345
2389
|
}
|
|
2346
2390
|
//#endregion
|
|
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 };
|
|
2391
|
+
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 TaxClassInput, TaxClassesResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, assertGuestCheckoutReady, assertGuestPickupSlotReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, formatOpeningHours, formatPickupSlotLabel, 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, cartLineTotal, cartPayableTotal, getApiBaseUrl, isCompleteAddressInput } from "@joai/core";
|
|
1
|
+
import { HttpService, cartLineTotal, cartPayableTotal, firstValidationMessage, getApiBaseUrl, isCompleteAddressInput, validationMessageFor } from "@joai/core";
|
|
2
2
|
import { WarpClient } from "@joai/warps";
|
|
3
3
|
//#region src/resources/agents.ts
|
|
4
4
|
var AgentsResource = class {
|
|
@@ -162,11 +162,15 @@ var FulfillmentsResource = class {
|
|
|
162
162
|
list(orderId) {
|
|
163
163
|
return this.http.get(`orders/${orderId}/fulfillments`);
|
|
164
164
|
}
|
|
165
|
+
carriers() {
|
|
166
|
+
return this.http.get("shipping-carriers");
|
|
167
|
+
}
|
|
165
168
|
create(orderId, data) {
|
|
166
169
|
return this.http.post(`orders/${orderId}/fulfillments`, data);
|
|
167
170
|
}
|
|
168
|
-
update(orderId, fulfillmentId,
|
|
169
|
-
|
|
171
|
+
update(orderId, fulfillmentId, data) {
|
|
172
|
+
const body = typeof data === "string" ? { status: data } : data;
|
|
173
|
+
return this.http.patch(`orders/${orderId}/fulfillments/${fulfillmentId}`, body);
|
|
170
174
|
}
|
|
171
175
|
};
|
|
172
176
|
//#endregion
|
|
@@ -227,6 +231,25 @@ var ShippingResource = class {
|
|
|
227
231
|
}
|
|
228
232
|
};
|
|
229
233
|
//#endregion
|
|
234
|
+
//#region src/commerce/taxClasses.ts
|
|
235
|
+
var TaxClassesResource = class {
|
|
236
|
+
constructor(http) {
|
|
237
|
+
this.http = http;
|
|
238
|
+
}
|
|
239
|
+
list(team) {
|
|
240
|
+
return this.http.get(`teams/${team}/tax-classes`);
|
|
241
|
+
}
|
|
242
|
+
create(team, data) {
|
|
243
|
+
return this.http.post(`teams/${team}/tax-classes`, data);
|
|
244
|
+
}
|
|
245
|
+
update(team, taxClassId, data) {
|
|
246
|
+
return this.http.patch(`teams/${team}/tax-classes/${taxClassId}`, data);
|
|
247
|
+
}
|
|
248
|
+
delete(team, taxClassId) {
|
|
249
|
+
return this.http.delete(`teams/${team}/tax-classes/${taxClassId}`);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
//#endregion
|
|
230
253
|
//#region src/commerce/guest.ts
|
|
231
254
|
const orderAccessPrefix = "joai:order-access:";
|
|
232
255
|
const checkoutKey = (namespace) => `joai:guest-checkout:${namespace}`;
|
|
@@ -390,14 +413,18 @@ const createEmptyGuestCheckoutState = (options = {}) => ({
|
|
|
390
413
|
},
|
|
391
414
|
shippingRateId: null,
|
|
392
415
|
fulfillmentLocationId: null,
|
|
393
|
-
couponCode: null
|
|
416
|
+
couponCode: null,
|
|
417
|
+
scheduledAt: null,
|
|
418
|
+
serviceSlug: null
|
|
394
419
|
});
|
|
395
420
|
const toGuestCheckoutDraft = (state) => ({
|
|
396
421
|
cart: state.cart,
|
|
397
422
|
fulfillmentMethod: state.fulfillmentMethod,
|
|
398
423
|
shippingRateId: state.shippingRateId,
|
|
399
424
|
fulfillmentLocationId: state.fulfillmentLocationId,
|
|
400
|
-
couponCode: state.couponCode ?? null
|
|
425
|
+
couponCode: state.couponCode ?? null,
|
|
426
|
+
scheduledAt: state.scheduledAt ?? null,
|
|
427
|
+
serviceSlug: state.serviceSlug ?? null
|
|
401
428
|
});
|
|
402
429
|
const assertGuestCheckoutReady = (state, pickupLocationIds = []) => {
|
|
403
430
|
if (!state.cart.length) throw new GuestCheckoutError("empty_cart");
|
|
@@ -410,6 +437,9 @@ const assertGuestCheckoutReady = (state, pickupLocationIds = []) => {
|
|
|
410
437
|
if (state.fulfillmentMethod === "shipping" && !isCompleteAddressInput(address)) throw new GuestCheckoutError("incomplete_shipping_address");
|
|
411
438
|
if (state.fulfillmentMethod === "pickup" && !state.fulfillmentLocationId && !pickupLocationIds[0]) throw new GuestCheckoutError("pickup_unavailable");
|
|
412
439
|
};
|
|
440
|
+
const assertGuestPickupSlotReady = (state) => {
|
|
441
|
+
if (state.fulfillmentMethod === "pickup" && !state.scheduledAt?.trim()) throw new GuestCheckoutError("missing_scheduled_at");
|
|
442
|
+
};
|
|
413
443
|
const buildGuestCheckoutSnapshotRequest = (state, options = {}) => {
|
|
414
444
|
assertGuestCheckoutReady(state, options.pickupLocationIds ?? []);
|
|
415
445
|
const items = state.cart.map(({ id, type, quantity }) => ({
|
|
@@ -507,9 +537,15 @@ async function placeGuestCheckoutOrder(options) {
|
|
|
507
537
|
guest: options.guest,
|
|
508
538
|
idempotencyKey: options.idempotencyKey ?? crypto.randomUUID(),
|
|
509
539
|
notes: options.notes,
|
|
540
|
+
scheduledAt: options.scheduledAt,
|
|
541
|
+
serviceSlug: options.serviceSlug,
|
|
510
542
|
sendConfirmation: true
|
|
511
543
|
});
|
|
512
|
-
if (!order.ok || !order.data?.id)
|
|
544
|
+
if (!order.ok || !order.data?.id) {
|
|
545
|
+
const validationMessage = firstValidationMessage(order.errors);
|
|
546
|
+
if (validationMessage) throw new Error(validationMessage);
|
|
547
|
+
throw new GuestCheckoutError("order_failed");
|
|
548
|
+
}
|
|
513
549
|
const accessToken = typeof order.meta?.orderAccessToken === "string" ? order.meta.orderAccessToken : null;
|
|
514
550
|
if (options.pay === false) return {
|
|
515
551
|
order: order.data,
|
|
@@ -544,12 +580,7 @@ var GuestCouponError = class extends Error {
|
|
|
544
580
|
}
|
|
545
581
|
};
|
|
546
582
|
/** First `couponCode` validation message from an API error payload. */
|
|
547
|
-
const guestCouponMessageFromErrors = (errors) =>
|
|
548
|
-
if (!errors || typeof errors !== "object" || Array.isArray(errors)) return void 0;
|
|
549
|
-
const couponError = errors.couponCode;
|
|
550
|
-
if (Array.isArray(couponError) && typeof couponError[0] === "string") return couponError[0];
|
|
551
|
-
if (typeof couponError === "string") return couponError;
|
|
552
|
-
};
|
|
583
|
+
const guestCouponMessageFromErrors = (errors) => validationMessageFor(errors, "couponCode");
|
|
553
584
|
const isGuestCouponError = (error) => {
|
|
554
585
|
if (error instanceof GuestCouponError) return true;
|
|
555
586
|
return typeof error === "object" && error !== null && error.name === "GuestCouponError" && typeof error.code === "string";
|
|
@@ -618,11 +649,25 @@ async function revalidateGuestCoupon(options) {
|
|
|
618
649
|
}
|
|
619
650
|
}
|
|
620
651
|
//#endregion
|
|
652
|
+
//#region src/commerce/pickupSlotLabel.ts
|
|
653
|
+
/** Formats a pickup slot in a locale-aware 24h label. Pass timeZone when the meeting/policy provides one. */
|
|
654
|
+
const formatPickupSlotLabel = (iso, locale, timeZone) => new Intl.DateTimeFormat(locale, {
|
|
655
|
+
...timeZone ? { timeZone } : {},
|
|
656
|
+
weekday: "short",
|
|
657
|
+
day: "2-digit",
|
|
658
|
+
month: "2-digit",
|
|
659
|
+
year: "numeric",
|
|
660
|
+
hour: "2-digit",
|
|
661
|
+
minute: "2-digit",
|
|
662
|
+
hourCycle: "h23"
|
|
663
|
+
}).format(new Date(iso));
|
|
664
|
+
//#endregion
|
|
621
665
|
//#region src/commerce/index.ts
|
|
622
666
|
var CommerceResource = class {
|
|
623
667
|
constructor(http) {
|
|
624
668
|
this.checkout = new CheckoutResource(http);
|
|
625
669
|
this.shipping = new ShippingResource(http);
|
|
670
|
+
this.taxClasses = new TaxClassesResource(http);
|
|
626
671
|
this.fulfillments = new FulfillmentsResource(http);
|
|
627
672
|
this.returns = new ReturnsResource(http);
|
|
628
673
|
}
|
|
@@ -993,8 +1038,8 @@ var BillingResource = class {
|
|
|
993
1038
|
checkoutProduct(id) {
|
|
994
1039
|
return this.http.get(`products/${id}`);
|
|
995
1040
|
}
|
|
996
|
-
orders(team, page = 1, filters = {}) {
|
|
997
|
-
let params = `orders?page=${page}`;
|
|
1041
|
+
orders(team, page = 1, filters = {}, perPage = 10) {
|
|
1042
|
+
let params = `orders?page=${page}&perPage=${perPage}`;
|
|
998
1043
|
if (filters.contactId) params += `&contactId=${encodeURIComponent(filters.contactId)}`;
|
|
999
1044
|
if (filters.couponId) params += `&couponId=${encodeURIComponent(filters.couponId)}`;
|
|
1000
1045
|
return this.http.get(params, team ? { headers: { "X-Team": team.slug } } : void 0);
|
|
@@ -1346,8 +1391,9 @@ var DocumentsResource = class {
|
|
|
1346
1391
|
get(id) {
|
|
1347
1392
|
return this.http.get(`documents/${id}`);
|
|
1348
1393
|
}
|
|
1349
|
-
getShared(slug) {
|
|
1350
|
-
|
|
1394
|
+
getShared(slug, password) {
|
|
1395
|
+
const query = password ? `?password=${encodeURIComponent(password)}` : "";
|
|
1396
|
+
return this.http.get(`documents/shared/${encodeURIComponent(slug)}${query}`);
|
|
1351
1397
|
}
|
|
1352
1398
|
update(id, data) {
|
|
1353
1399
|
return this.http.put(`documents/${id}`, data);
|
|
@@ -2043,8 +2089,8 @@ var OrdersResource = class {
|
|
|
2043
2089
|
constructor(http) {
|
|
2044
2090
|
this.http = http;
|
|
2045
2091
|
}
|
|
2046
|
-
list(team) {
|
|
2047
|
-
return this.http.get(
|
|
2092
|
+
list(team, page = 1, perPage = 10) {
|
|
2093
|
+
return this.http.get(`orders?page=${page}&perPage=${perPage}`, { headers: { "X-Team": team } });
|
|
2048
2094
|
}
|
|
2049
2095
|
get(id, accessToken) {
|
|
2050
2096
|
return this.http.get(`orders/${id}`, orderAccessHeaders(accessToken));
|
|
@@ -3542,4 +3588,4 @@ var DistributionResource = class {
|
|
|
3542
3588
|
}
|
|
3543
3589
|
};
|
|
3544
3590
|
//#endregion
|
|
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 };
|
|
3591
|
+
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, TaxClassesResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WorkspaceResource, assertGuestCheckoutReady, assertGuestPickupSlotReady, buildGuestCheckoutSnapshotRequest, buildGuestOrderReturnUrl, completePortalSession, createClient, createEmptyGuestCheckoutState, createGuestCheckoutSnapshot, createGuestCommerceStorage, formatOpeningHours, formatPickupSlotLabel, 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.7",
|
|
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.6",
|
|
39
39
|
"@joai/warps": "*"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@joai/core": "^4.15.
|
|
42
|
+
"@joai/core": "^4.15.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsdown": "^0.21.0",
|