@joai/sdk 12.1.2 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _$_joai_core0 from "@joai/core";
2
- import { Address, AddressCreatePayload, AddressInput, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, AnalyticsConfiguration, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, 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, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, 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, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, 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, ProductRelation, ProductVariation, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalCreateInput, ProposalPollOption, ProposalPricing, 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, 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, AnalyticsConfiguration, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, 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, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, 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, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, 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, ProductRelation, ProductVariation, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalCreateInput, ProposalPollOption, ProposalPricing, 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, 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
@@ -187,11 +187,11 @@ declare class ShippingResource {
187
187
  constructor(http: IHttpService);
188
188
  zones(team: string): Promise<_$_joai_core0.IAppResponse<ShippingZone[]>>;
189
189
  createZone(team: string, data: ShippingZoneInput): Promise<_$_joai_core0.IAppResponse<ShippingZone>>;
190
- updateZone(team: string, zoneId: number, data: ShippingZoneInput): Promise<_$_joai_core0.IAppResponse<ShippingZone>>;
191
- deleteZone(team: string, zoneId: number): Promise<_$_joai_core0.IAppResponse<void>>;
192
- createRate(team: string, zoneId: number, data: ShippingRateInput): Promise<_$_joai_core0.IAppResponse<ShippingRate$1>>;
193
- updateRate(team: string, zoneId: number, rateId: number, data: ShippingRateInput): Promise<_$_joai_core0.IAppResponse<ShippingRate$1>>;
194
- deleteRate(team: string, zoneId: number, rateId: number): Promise<_$_joai_core0.IAppResponse<void>>;
190
+ updateZone(team: string, zoneId: HashidInput, data: ShippingZoneInput): Promise<_$_joai_core0.IAppResponse<ShippingZone>>;
191
+ deleteZone(team: string, zoneId: HashidInput): Promise<_$_joai_core0.IAppResponse<void>>;
192
+ createRate(team: string, zoneId: HashidInput, data: ShippingRateInput): Promise<_$_joai_core0.IAppResponse<ShippingRate$1>>;
193
+ updateRate(team: string, zoneId: HashidInput, rateId: HashidInput, data: ShippingRateInput): Promise<_$_joai_core0.IAppResponse<ShippingRate$1>>;
194
+ deleteRate(team: string, zoneId: HashidInput, rateId: HashidInput): Promise<_$_joai_core0.IAppResponse<void>>;
195
195
  locations(team: string): Promise<_$_joai_core0.IAppResponse<FulfillmentLocation$1[]>>;
196
196
  createLocation(team: string, data: FulfillmentLocationInput): Promise<_$_joai_core0.IAppResponse<FulfillmentLocation$1>>;
197
197
  updateLocation(team: string, locationId: string, data: FulfillmentLocationInput): Promise<_$_joai_core0.IAppResponse<FulfillmentLocation$1>>;
@@ -222,7 +222,7 @@ type GuestOrderAccess = {
222
222
  type GuestCheckoutDraft<TCart = unknown> = {
223
223
  cart: TCart;
224
224
  fulfillmentMethod: FulfillmentMethod;
225
- shippingRateId: number | null;
225
+ shippingRateId: HashidInput | null;
226
226
  fulfillmentLocationId: string | null;
227
227
  couponCode?: string | null; /** Pickup appointment start (ISO-8601), required for pickup confirm. */
228
228
  scheduledAt?: string | null; /** Bookable service slug when the shop has more than one. */
@@ -330,7 +330,7 @@ type GuestCheckoutSnapshotResult = {
330
330
  accessToken: string;
331
331
  };
332
332
  shippingRates: ShippingRate$1[];
333
- shippingRateId: number | null;
333
+ shippingRateId: string | null;
334
334
  };
335
335
  declare function createGuestCheckoutSnapshot(options: {
336
336
  client: GuestCheckoutClient;
@@ -608,39 +608,43 @@ type OpeningHoursFormatOptions = {
608
608
  timeRangeSeparator?: string;
609
609
  };
610
610
  declare const formatOpeningHours: (availability: OpeningHoursAvailability, options?: OpeningHoursFormatOptions) => OpeningHoursEntry[];
611
+ type AppointmentAvailabilityParams = {
612
+ windowStart: string;
613
+ windowEnd: string;
614
+ durationMinutes: number;
615
+ timezone?: string;
616
+ limit?: number;
617
+ serviceSlug?: string;
618
+ quantity?: number;
619
+ };
620
+ type AppointmentBookData = {
621
+ title: string;
622
+ scheduledAt: string;
623
+ description?: string;
624
+ conferenceProvider?: string;
625
+ timezone?: string;
626
+ attendeeEmail?: string;
627
+ attendeeName?: string;
628
+ contactIds?: string[];
629
+ attendees?: {
630
+ email: string;
631
+ name?: string;
632
+ }[];
633
+ serviceSlug?: string;
634
+ appointmentRequestId?: string;
635
+ configuration?: Configuration;
636
+ quantity?: number;
637
+ };
611
638
  declare class AppointmentsResource {
612
639
  private readonly http;
613
640
  private readonly config;
614
641
  constructor(http: IHttpService, config: JoAiClientConfig);
615
642
  getPolicy(): Promise<_$_joai_core0.IAppResponse<AppointmentPolicy | null>>;
616
643
  upsertPolicy(data: AppointmentPolicyUpsert): Promise<_$_joai_core0.IAppResponse<AppointmentPolicy>>;
617
- checkAvailability(agentUuid: string, params: {
618
- windowStart: string;
619
- windowEnd: string;
620
- durationMinutes: number;
621
- timezone?: string;
622
- limit?: number;
623
- serviceSlug?: string;
624
- quantity?: number;
625
- }): Promise<_$_joai_core0.IAppResponse<AppointmentAvailability>>;
626
- book(agentUuid: string, data: {
627
- title: string;
628
- scheduledAt: string;
629
- description?: string;
630
- conferenceProvider?: string;
631
- timezone?: string;
632
- attendeeEmail?: string;
633
- attendeeName?: string;
634
- contactIds?: string[];
635
- attendees?: {
636
- email: string;
637
- name?: string;
638
- }[];
639
- serviceSlug?: string;
640
- appointmentRequestId?: string;
641
- configuration?: Configuration;
642
- quantity?: number;
643
- }): Promise<_$_joai_core0.IAppResponse<AppointmentBooking>>;
644
+ checkAvailability(agentUuid: string, params: AppointmentAvailabilityParams): Promise<_$_joai_core0.IAppResponse<AppointmentAvailability>>;
645
+ checkStaffAvailability(agentUuid: string, params: AppointmentAvailabilityParams): Promise<_$_joai_core0.IAppResponse<AppointmentAvailability>>;
646
+ book(agentUuid: string, data: AppointmentBookData): Promise<_$_joai_core0.IAppResponse<AppointmentBooking>>;
647
+ bookAsStaff(agentUuid: string, data: AppointmentBookData): Promise<_$_joai_core0.IAppResponse<AppointmentBooking>>;
644
648
  reschedule(agentUuid: string, meetingId: string, data: {
645
649
  scheduledAt: string;
646
650
  timezone?: string;
@@ -1553,7 +1557,7 @@ declare class OrdersResource {
1553
1557
  shippingAddressId?: string;
1554
1558
  billingAddress?: AddressInput;
1555
1559
  shippingAddress?: AddressInput;
1556
- shippingRateId?: number;
1560
+ shippingRateId?: HashidInput;
1557
1561
  fulfillmentLocationId?: string;
1558
1562
  idempotencyKey?: string;
1559
1563
  guest?: {
@@ -1846,7 +1850,7 @@ declare class SitesResource {
1846
1850
  }): Promise<_$_joai_core0.IAppResponse<Site>>;
1847
1851
  resolve(teamSlug: string, brandSlug?: string): Promise<_$_joai_core0.IAppResponse<Site>>;
1848
1852
  resolveByDomain(domain: string): Promise<_$_joai_core0.IAppResponse<Site>>;
1849
- update(siteId: number, data: {
1853
+ update(siteId: HashidInput, data: {
1850
1854
  customDomain?: string | null;
1851
1855
  enabled?: boolean;
1852
1856
  modules?: string[];
@@ -1940,7 +1944,7 @@ declare class SubscriptionsResource {
1940
1944
  updateDelivery(id: string, data: {
1941
1945
  fulfillmentMethod: 'shipping' | 'pickup';
1942
1946
  shippingAddressId?: string | null;
1943
- shippingRateId?: number | null;
1947
+ shippingRateId?: HashidInput | null;
1944
1948
  fulfillmentLocationId?: string | null;
1945
1949
  }): Promise<_$_joai_core0.IAppResponse<Subscription>>;
1946
1950
  skip(id: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
package/dist/index.mjs CHANGED
@@ -580,7 +580,7 @@ async function createGuestCheckoutSnapshot(options) {
580
580
  accessToken: snapshot.data.accessToken
581
581
  },
582
582
  shippingRates,
583
- shippingRateId: typeof snapshotRequest.shippingRateId === "number" ? snapshotRequest.shippingRateId : null
583
+ shippingRateId: typeof snapshotRequest.shippingRateId === "string" ? snapshotRequest.shippingRateId : null
584
584
  };
585
585
  }
586
586
  /**
@@ -1007,9 +1007,21 @@ var AppointmentsResource = class {
1007
1007
  checkAvailability(agentUuid, params) {
1008
1008
  return this.http.post(`agents/${agentUuid}/appointments/availability`, params);
1009
1009
  }
1010
+ checkStaffAvailability(agentUuid, params) {
1011
+ return this.http.post(`teams/${this.config.team}/appointments/availability`, {
1012
+ agentUuid,
1013
+ ...params
1014
+ });
1015
+ }
1010
1016
  book(agentUuid, data) {
1011
1017
  return this.http.post(`agents/${agentUuid}/appointments/book`, data);
1012
1018
  }
1019
+ bookAsStaff(agentUuid, data) {
1020
+ return this.http.post(`teams/${this.config.team}/appointments/book`, {
1021
+ agentUuid,
1022
+ ...data
1023
+ });
1024
+ }
1013
1025
  reschedule(agentUuid, meetingId, data) {
1014
1026
  return this.http.post(`agents/${agentUuid}/appointments/${meetingId}/reschedule`, data);
1015
1027
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "12.1.2",
3
+ "version": "13.0.1",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,11 +35,11 @@
35
35
  "test": "jest --config jest.config.js"
36
36
  },
37
37
  "dependencies": {
38
- "@joai/core": "^5.3.7",
38
+ "@joai/core": "^5.4.1",
39
39
  "@joai/warps": "*"
40
40
  },
41
41
  "peerDependencies": {
42
- "@joai/core": "^5.3.7"
42
+ "@joai/core": "^5.4.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "tsdown": "^0.21.0",