@joai/sdk 13.1.1 → 13.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _$_joai_core0 from "@joai/core";
2
- import { Address, AddressCreatePayload, AddressInput, AddressInput as AddressInput$1, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, AnalyticsConfiguration, ApiToken, AppEnv, AppEnv as AppEnv$1, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactDeliveryPreview, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarFeed, CalendarFeedInput, CalendarFeedSyncResult, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignSendTestDraftPayload, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartItem, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CheckoutSnapshotRequest as CheckoutSnapshotRequest$1, ClientProposal, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentValue, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementType, ElementVariation, EmbedStatus, Entity, Flow, FollowListParams, FollowPayload, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, HashidInput, HashidInput as HashidInput$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IAppResponse as IAppResponse$1, IHttpService, IRequestOptions, IdentifiedSiteEvent, Inquiry, InquiryType, Install, InstallClaimPayload, InstallOptOutPayload, InstallRegisterPayload, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyCollectPointInput, LoyaltyCollectResponse, LoyaltyJoinResponse, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, LoyaltyWalletAccount, McpToolCall, Media, MediaAspectRatio, Meeting, MeetingJoinInfo, MeetingSpeakerAssignment, MeetingSummary, Memory, Message, MetricSource, MetricsResult, Mission, MissionCreatePayload, Notification, NotificationChannel, NotificationSetting, OfficeSnapshot, Order, Order as Order$1, OrderContext, OrderPriceMode, OrderPriceMode as OrderPriceMode$1, OrderStatus, OrderStatus as OrderStatus$1, OrderType, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, Plan, PlanFeature, Product, Product as Product$1, ProductDetailSection, ProductDetailSection as ProductDetailSection$1, ProductDetailText, ProductRelation, ProductRelationType, ProductVariation, 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, TranslatableValue as TranslatableValue$1, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeStatus, UserPrivate, UserRole, UserSettings, VolumePrice, WarpBackend, WarpBackendStatus, WarpExecutionBackend, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceInfo, XIntegrationStatus } from "@joai/core";
2
+ import { Address, AddressCreatePayload, AddressInput, AddressInput as AddressInput$1, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, AnalyticsConfiguration, ApiToken, AppEnv, AppEnv as AppEnv$1, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentAvailabilitySlot, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactDeliveryPreview, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarFeed, CalendarFeedInput, CalendarFeedSyncResult, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignSendTestDraftPayload, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartItem, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CheckoutSnapshotRequest as CheckoutSnapshotRequest$1, ClientProposal, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentValue, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementType, ElementVariation, EmbedStatus, Entity, Flow, FollowListParams, FollowPayload, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, HashidInput, HashidInput as HashidInput$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IAppResponse as IAppResponse$1, IHttpService, IRequestOptions, IdentifiedSiteEvent, Inquiry, InquiryType, Install, InstallClaimPayload, InstallOptOutPayload, InstallRegisterPayload, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyCollectPointInput, LoyaltyCollectResponse, LoyaltyJoinResponse, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, LoyaltyWalletAccount, McpToolCall, Media, MediaAspectRatio, Meeting, MeetingJoinInfo, MeetingSpeakerAssignment, MeetingSummary, Memory, Message, MetricSource, MetricsResult, Mission, MissionCreatePayload, Notification, NotificationChannel, NotificationSetting, OfficeSnapshot, Order, Order as Order$1, OrderContext, OrderPriceMode, OrderPriceMode as OrderPriceMode$1, OrderStatus, OrderStatus as OrderStatus$1, OrderType, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, Plan, PlanFeature, Product, Product as Product$1, ProductDetailSection, ProductDetailSection as ProductDetailSection$1, ProductDetailText, ProductRelation, ProductRelationType, ProductVariation, ProductVariationExternalReference, ProductVariationExternalSource, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalCreateInput, ProposalPollOption, ProposalPricing, ProposalUpdateInput, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedArtifact, SharedProposal, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostScheduleSlot, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, TaxClass, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamSubscriptionStats, TeamUsage, TemplateMode, TemplateOverrides, TemplateSpec, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, TranslatableValue as TranslatableValue$1, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeStatus, UserPrivate, UserRole, UserSettings, VolumePrice, WarpBackend, WarpBackendStatus, WarpExecutionBackend, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceInfo, XIntegrationStatus } from "@joai/core";
3
3
  import { WarpChainName, WarpClient, WarpLocale, WarpText, WarpWalletProvider } from "@joai/warps";
4
4
 
5
5
  //#region src/resources/agents.d.ts
@@ -36,6 +36,8 @@ declare class AgentsResource {
36
36
  media?: Media[];
37
37
  ghost?: boolean;
38
38
  context?: Record<string, unknown>;
39
+ }, options?: {
40
+ team?: string;
39
41
  }): Promise<_$_joai_core0.IAppResponse<unknown>>;
40
42
  actionCallback(agent: string, room: string, action: string, result: {
41
43
  success: boolean;
@@ -1681,11 +1683,13 @@ declare class ProductsResource {
1681
1683
  createVariation(productSlug: string, data: {
1682
1684
  name: TranslatableValue$1;
1683
1685
  sku: string;
1686
+ barcode?: string;
1684
1687
  price: number;
1685
1688
  type?: string;
1686
1689
  }): Promise<_$_joai_core0.IAppResponse<ProductVariation>>;
1687
1690
  updateVariation(variationId: string, data: {
1688
1691
  name?: TranslatableValue$1;
1692
+ barcode?: string | null;
1689
1693
  price?: number;
1690
1694
  active?: boolean;
1691
1695
  hidden?: boolean;
@@ -1696,6 +1700,21 @@ declare class ProductsResource {
1696
1700
  stock?: number | null;
1697
1701
  weight?: number | null;
1698
1702
  }): Promise<_$_joai_core0.IAppResponse<ProductVariation>>;
1703
+ lookupVariation(params: {
1704
+ barcode?: string;
1705
+ source?: ProductVariationExternalSource;
1706
+ externalId?: string;
1707
+ }): Promise<_$_joai_core0.IAppResponse<ProductVariation>>;
1708
+ listVariationExternalReferences(variationId: string): Promise<_$_joai_core0.IAppResponse<ProductVariationExternalReference[]>>;
1709
+ createVariationExternalReference(variationId: string, data: {
1710
+ source: ProductVariationExternalSource;
1711
+ externalId: string;
1712
+ }): Promise<_$_joai_core0.IAppResponse<ProductVariationExternalReference>>;
1713
+ updateVariationExternalReference(variationId: string, referenceId: string, data: {
1714
+ source?: ProductVariationExternalSource;
1715
+ externalId?: string;
1716
+ }): Promise<_$_joai_core0.IAppResponse<ProductVariationExternalReference>>;
1717
+ deleteVariationExternalReference(variationId: string, referenceId: string): Promise<_$_joai_core0.IAppResponse<void>>;
1699
1718
  sortVariations(ids: string[]): Promise<_$_joai_core0.IAppResponse<unknown>>;
1700
1719
  deleteVariation(variationId: string): Promise<_$_joai_core0.IAppResponse<unknown>>;
1701
1720
  createRelation(productSlug: string, data: {
@@ -1749,6 +1768,7 @@ declare class ProposalsResource {
1749
1768
  constructor(http: IHttpService);
1750
1769
  list(team: string): Promise<_$_joai_core0.IAppResponse<ClientProposal[]>>;
1751
1770
  create(team: string, data: ProposalCreateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1771
+ update(team: string, id: string, data: ProposalUpdateInput): Promise<_$_joai_core0.IAppResponse<ClientProposal>>;
1752
1772
  getShared(slug: string, password?: string): Promise<_$_joai_core0.IAppResponse<SharedProposal>>;
1753
1773
  pricing(slug: string, password: string | undefined, itemIds: string[]): Promise<_$_joai_core0.IAppResponse<ProposalPricing>>;
1754
1774
  confirm(slug: string, password: string | undefined, itemIds: string[]): Promise<_$_joai_core0.IAppResponse<SharedProposal>>;
@@ -1957,6 +1977,7 @@ declare class SubscriptionsResource {
1957
1977
  private readonly http;
1958
1978
  constructor(http: IHttpService);
1959
1979
  list(team?: string): Promise<_$_joai_core0.IAppResponse<Subscription[]>>;
1980
+ stats(team: string): Promise<_$_joai_core0.IAppResponse<TeamSubscriptionStats>>;
1960
1981
  get(id: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
1961
1982
  cancel(id: string, team: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
1962
1983
  resume(id: string, team: string): Promise<_$_joai_core0.IAppResponse<Subscription>>;
package/dist/index.mjs CHANGED
@@ -55,9 +55,10 @@ var AgentsResource = class {
55
55
  provisionPhone(uuid) {
56
56
  return this.http.post(`integrations/${uuid}/phone/provision`);
57
57
  }
58
- execute(agentUuid, payload) {
58
+ execute(agentUuid, payload, options) {
59
59
  const { audio, media, ghost, context } = payload;
60
60
  const mediaIds = media?.map((m) => m.id);
61
+ const requestOptions = options?.team ? { headers: { "X-Team": options.team } } : void 0;
61
62
  if (audio) {
62
63
  const formData = new FormData();
63
64
  formData.append("audio", audio, audio.name);
@@ -70,7 +71,10 @@ var AgentsResource = class {
70
71
  if (Array.isArray(value)) value.forEach((v) => formData.append(`context[${key}][]`, String(v)));
71
72
  else if (value != null) formData.append(`context[${key}]`, String(value));
72
73
  });
73
- return this.http.post(`agents/${agentUuid}/execute`, formData, { isJson: false });
74
+ return this.http.post(`agents/${agentUuid}/execute`, formData, {
75
+ isJson: false,
76
+ ...requestOptions
77
+ });
74
78
  }
75
79
  return this.http.post(`agents/${agentUuid}/execute`, {
76
80
  sender: payload.sender,
@@ -79,7 +83,7 @@ var AgentsResource = class {
79
83
  media: mediaIds,
80
84
  context,
81
85
  preferences: { ghost: ghost ?? false }
82
- });
86
+ }, requestOptions);
83
87
  }
84
88
  actionCallback(agent, room, action, result) {
85
89
  return this.http.post(`agents/${agent}/action-callback`, {
@@ -2433,6 +2437,25 @@ var ProductsResource = class {
2433
2437
  updateVariation(variationId, data) {
2434
2438
  return this.http.put(`products/variations/${variationId}`, data);
2435
2439
  }
2440
+ lookupVariation(params) {
2441
+ const search = new URLSearchParams();
2442
+ if (params.barcode) search.set("barcode", params.barcode);
2443
+ if (params.source) search.set("source", params.source);
2444
+ if (params.externalId) search.set("externalId", params.externalId);
2445
+ return this.http.get(`products/variations/lookup?${search.toString()}`);
2446
+ }
2447
+ listVariationExternalReferences(variationId) {
2448
+ return this.http.get(`products/variations/${variationId}/external-references`);
2449
+ }
2450
+ createVariationExternalReference(variationId, data) {
2451
+ return this.http.post(`products/variations/${variationId}/external-references`, data);
2452
+ }
2453
+ updateVariationExternalReference(variationId, referenceId, data) {
2454
+ return this.http.put(`products/variations/${variationId}/external-references/${referenceId}`, data);
2455
+ }
2456
+ deleteVariationExternalReference(variationId, referenceId) {
2457
+ return this.http.delete(`products/variations/${variationId}/external-references/${referenceId}`);
2458
+ }
2436
2459
  sortVariations(ids) {
2437
2460
  return this.http.post("products/variations/sort", { ids });
2438
2461
  }
@@ -2505,6 +2528,9 @@ var ProposalsResource = class {
2505
2528
  create(team, data) {
2506
2529
  return this.http.post("proposals", data, { headers: { "X-Team": team } });
2507
2530
  }
2531
+ update(team, id, data) {
2532
+ return this.http.put(`proposals/${id}`, data, { headers: { "X-Team": team } });
2533
+ }
2508
2534
  getShared(slug, password) {
2509
2535
  return this.http.get(`proposals/shared/${encodeURIComponent(slug)}`, access(password));
2510
2536
  }
@@ -2770,6 +2796,9 @@ var SubscriptionsResource = class {
2770
2796
  list(team) {
2771
2797
  return team ? this.http.get("subscriptions", { headers: { "X-Team": team } }) : this.http.get("subscriptions");
2772
2798
  }
2799
+ stats(team) {
2800
+ return this.http.get(`subscriptions/stats?team=${encodeURIComponent(team)}`, { headers: { "X-Team": team } });
2801
+ }
2773
2802
  get(id) {
2774
2803
  return this.http.get(`subscriptions/${id}`);
2775
2804
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "13.1.1",
3
+ "version": "13.1.3",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,11 +35,11 @@
35
35
  "test": "jest --config jest.config.js"
36
36
  },
37
37
  "dependencies": {
38
- "@joai/core": "^5.4.3",
38
+ "@joai/core": "^5.4.5",
39
39
  "@joai/warps": "*"
40
40
  },
41
41
  "peerDependencies": {
42
- "@joai/core": "^5.4.3"
42
+ "@joai/core": "^5.4.5"
43
43
  },
44
44
  "devDependencies": {
45
45
  "tsdown": "^0.21.0",