@joai/sdk 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -37,7 +37,8 @@ interface IRequestOptions {
37
37
  type SocialAuthProvider = 'github' | 'apple' | 'google' | 'x' | 'telegram' | 'slack'; //#endregion
38
38
  //#region src/config/types.d.ts
39
39
  type AppEnv = 'mainnet' | 'testnet' | 'devnet' | 'local'; //#endregion
40
- //#region src/config/urls.d.ts
40
+ //#region src/auth/token.d.ts
41
+ /** One-time native/deep-link handoff param (exchanged for a Bearer via API). */
41
42
  //#endregion
42
43
  //#region src/ingestion/types.d.ts
43
44
  type IngestionSourceType = 'note' | 'meeting' | 'article' | 'email' | 'chat' | 'post' | 'webhook';
@@ -471,7 +472,7 @@ type Contact = {
471
472
  nextFollowUpAt?: string | null;
472
473
  followUpNote?: string | null;
473
474
  };
474
- type ContactActivityType = 'note' | 'call' | 'meeting' | 'task' | 'update' | 'custom' | 'form' | 'loyalty';
475
+ type ContactActivityType = 'note' | 'call' | 'meeting' | 'task' | 'update' | 'custom' | 'form' | 'loyalty' | 'follow_up';
475
476
  type ContactActivityAuthor = {
476
477
  name: string;
477
478
  imageUrl: string | null;
@@ -581,7 +582,7 @@ type TerminalPaymentIntent = {
581
582
  payload?: string | null;
582
583
  signature?: string | null;
583
584
  };
584
- type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'mcp' | 'phone-call' | 'phone-number' | 'custom-domain' | 'contacts' | 'links' | 'store-fee-rate' | 'store-fee-rate-physical' | 'tap-to-pay';
585
+ type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'phone-call' | 'phone-number' | 'custom-domain' | 'contacts' | 'links' | 'store-fee-rate' | 'store-fee-rate-physical' | 'tap-to-pay';
585
586
  type PlanBenefit = {
586
587
  label: Partial<Record<WarpLocale, string>>;
587
588
  tip?: Partial<Record<WarpLocale, string>>;
@@ -607,7 +608,7 @@ type Plan = {
607
608
  resource: 'plan';
608
609
  id: string;
609
610
  sku: string;
610
- name: TranslatableValue;
611
+ name: string;
611
612
  description: Partial<Record<WarpLocale, string>>;
612
613
  price: number;
613
614
  priceDisplay: string;
@@ -724,7 +725,7 @@ type OrderItem = {
724
725
  name: string;
725
726
  quantity: number;
726
727
  unitPrice: number;
727
- type: 'product-variation' | 'service';
728
+ type: 'product-variation' | 'service' | 'coupon';
728
729
  digital?: boolean | null;
729
730
  sellerTeamId?: string | null;
730
731
  };
@@ -758,6 +759,7 @@ type Order = {
758
759
  notes: string | null;
759
760
  configuration?: OrderConfigurationItem[];
760
761
  items: OrderItem[];
762
+ coupon?: Coupon | null;
761
763
  plan: Plan | null;
762
764
  user: UserPrivate | null;
763
765
  team: TeamPrivate | null;
@@ -799,6 +801,7 @@ type Coupon = {
799
801
  amount: number | null;
800
802
  percent: number | null;
801
803
  price: number | null;
804
+ discount?: number;
802
805
  condition: CouponCondition;
803
806
  restrictedItems: CouponRestrictedItem[];
804
807
  usesLeft: number | null;
@@ -837,7 +840,7 @@ type Skill = {
837
840
  screenshots: string[];
838
841
  }; //#endregion
839
842
  //#region src/integration/types.d.ts
840
- type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
843
+ type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'whatsapp-personal' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'xchat' | 'instagram' | 'grok' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
841
844
  type IntegrationDetails = {
842
845
  type: IntegrationType;
843
846
  name: string;
@@ -851,8 +854,16 @@ type IntegrationDetails = {
851
854
  type IntegrationMeta = {
852
855
  handle?: string;
853
856
  provider?: EmailProvider | null;
857
+ hookSource?: string;
854
858
  [key: string]: unknown;
855
859
  };
860
+ type IntegrationConnectionDetails = IntegrationDetails & {
861
+ phoneNumberId?: string;
862
+ phoneNumber?: string;
863
+ webhookUrl?: string;
864
+ webhookSecret?: string;
865
+ webhookSecretKey?: string;
866
+ };
856
867
  type Integration = {
857
868
  id: string;
858
869
  type: IntegrationType;
@@ -861,9 +872,9 @@ type Integration = {
861
872
  configured: boolean;
862
873
  createdAt: string;
863
874
  meta?: IntegrationMeta;
864
- details?: IntegrationDetails;
875
+ details?: IntegrationConnectionDetails;
865
876
  };
866
- type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github';
877
+ type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github' | 'xchat' | 'instagram';
867
878
  type SocialBot = {
868
879
  name: string;
869
880
  createdAt: string;
@@ -1113,6 +1124,10 @@ type WarpExecutionBackend = {
1113
1124
  agent: AgentSimple | null;
1114
1125
  createdAt: string;
1115
1126
  };
1127
+ type PublicFormResults = {
1128
+ total: number;
1129
+ fields: Record<string, Record<string, number>>;
1130
+ };
1116
1131
  type BrandSourceConfig = {
1117
1132
  type: string;
1118
1133
  chain?: string;
@@ -1163,51 +1178,6 @@ type BrandBackend = {
1163
1178
  integrations?: Partial<Record<BrandIntegrationProvider, BrandIntegration>>;
1164
1179
  };
1165
1180
  };
1166
- //#endregion
1167
- //#region src/store/types.d.ts
1168
- type StoreVisibility = 'private' | 'team' | 'public';
1169
- type StoreEntry = {
1170
- value: number | string | boolean;
1171
- label?: string;
1172
- at: string;
1173
- };
1174
- type Store = {
1175
- name: string;
1176
- description: string;
1177
- valueType: 'scalar' | 'series';
1178
- unit?: string;
1179
- visibility: StoreVisibility;
1180
- entryCount: number;
1181
- lastValue?: number | string | boolean;
1182
- lastAt?: string;
1183
- };
1184
- type StoreWithEntries = {
1185
- name: string;
1186
- description: string;
1187
- unit?: string;
1188
- entries: StoreEntry[];
1189
- };
1190
- type StoreCreatePayload = {
1191
- name: string;
1192
- description?: string;
1193
- valueType?: 'scalar' | 'series';
1194
- unit?: string;
1195
- visibility?: StoreVisibility;
1196
- };
1197
- type StoreEntryPayload = {
1198
- storeName?: string;
1199
- value: number | string | boolean;
1200
- label?: string;
1201
- };
1202
- type StoreEntryResult = {
1203
- name: string;
1204
- entryCount: number;
1205
- };
1206
- type StoreToggleResult = {
1207
- name: string;
1208
- value: number | string | boolean;
1209
- previous: number | string | boolean;
1210
- };
1211
1181
  type StorePricing = {
1212
1182
  model: PricingModel;
1213
1183
  amount: string;
@@ -1513,6 +1483,8 @@ type AppointmentPolicy = {
1513
1483
  conferenceEnabled: boolean | null;
1514
1484
  serviceSelectionEnabled?: boolean | null;
1515
1485
  paymentEnabled?: boolean | null;
1486
+ bookingCapacity?: number | null;
1487
+ bookingCapacityUnit?: 'booking' | 'person' | null;
1516
1488
  requireApproval?: boolean | null;
1517
1489
  sync?: AppointmentPolicySync | null;
1518
1490
  agent?: Agent | null;
@@ -1531,6 +1503,7 @@ type AppointmentBooking = {
1531
1503
  attendeeEmail: string | null;
1532
1504
  attendeeName: string | null;
1533
1505
  configuration?: Configuration;
1506
+ quantity?: number;
1534
1507
  };
1535
1508
  type AppointmentRequest = {
1536
1509
  id: string;
@@ -1787,6 +1760,7 @@ type Item = {
1787
1760
  };
1788
1761
  type ItemCreatePayload = {
1789
1762
  title: string;
1763
+ source?: 'user' | 'api';
1790
1764
  description?: string;
1791
1765
  priority?: ItemPriority;
1792
1766
  tags?: string[];
@@ -1809,6 +1783,49 @@ type ItemUpdatePayload = {
1809
1783
  contactIds?: string[];
1810
1784
  assignedToIds?: string[];
1811
1785
  }; //#endregion
1786
+ //#region src/kv/types.d.ts
1787
+ type KvValue = number | string | boolean;
1788
+ type KvEntry = {
1789
+ value: KvValue;
1790
+ label?: string | null;
1791
+ at: string;
1792
+ };
1793
+ type KvField = {
1794
+ name: string;
1795
+ description: string | null;
1796
+ valueType: 'scalar' | 'series';
1797
+ unit: string | null;
1798
+ entryCount: number;
1799
+ lastValue?: KvValue | null;
1800
+ lastAt?: string | null;
1801
+ };
1802
+ type KvFieldWithEntries = Pick<KvField, 'name' | 'description' | 'unit'> & {
1803
+ entries: KvEntry[];
1804
+ nextCursor: string | null;
1805
+ };
1806
+ type CreateKvFieldPayload = {
1807
+ name: string;
1808
+ description?: string;
1809
+ valueType?: 'scalar' | 'series';
1810
+ unit?: string;
1811
+ };
1812
+ type KvEntryPayload = {
1813
+ field?: string;
1814
+ value: KvValue;
1815
+ label?: string;
1816
+ };
1817
+ type SetKvEntryResult = KvEntry & {
1818
+ name: string;
1819
+ };
1820
+ type AppendKvEntryResult = {
1821
+ name: string;
1822
+ entryCount: number;
1823
+ };
1824
+ type ToggleKvFieldResult = {
1825
+ name: string;
1826
+ value: KvValue;
1827
+ previous: KvValue | null;
1828
+ }; //#endregion
1812
1829
  //#region src/marketing/types.d.ts
1813
1830
  //#endregion
1814
1831
  //#region src/mcp/types.d.ts
@@ -2775,7 +2792,17 @@ type CreateWebHookPayload = {
2775
2792
  type CreateWarpLinkedHookPayload = {
2776
2793
  warpIdentifier: string;
2777
2794
  };
2778
- type CreateHookPayload = CreateInternalHookPayload | CreateWebHookPayload | CreateWarpLinkedHookPayload; //#endregion
2795
+ type CreateInboundHookPayload = {
2796
+ source: string;
2797
+ warpIdentifier: string;
2798
+ trigger?: HookTrigger;
2799
+ };
2800
+ type CreateHookPayload = CreateInternalHookPayload | CreateWebHookPayload | CreateWarpLinkedHookPayload | CreateInboundHookPayload;
2801
+ type HookSample = {
2802
+ source: string;
2803
+ payload: Record<string, unknown> | null;
2804
+ recordedAt: string | null;
2805
+ }; //#endregion
2779
2806
  //#region src/workspace/types.d.ts
2780
2807
  type WorkspaceInfo = {
2781
2808
  id?: string;
@@ -2997,6 +3024,7 @@ declare class AppointmentsResource {
2997
3024
  timezone?: string;
2998
3025
  limit?: number;
2999
3026
  serviceSlug?: string;
3027
+ quantity?: number;
3000
3028
  }): Promise<IAppResponse<AppointmentAvailability>>;
3001
3029
  book(agentUuid: string, data: {
3002
3030
  title: string;
@@ -3013,6 +3041,7 @@ declare class AppointmentsResource {
3013
3041
  serviceSlug?: string;
3014
3042
  appointmentRequestId?: string;
3015
3043
  configuration?: Configuration;
3044
+ quantity?: number;
3016
3045
  }): Promise<IAppResponse<AppointmentBooking>>;
3017
3046
  reschedule(agentUuid: string, meetingId: string, data: {
3018
3047
  scheduledAt: string;
@@ -3056,6 +3085,7 @@ type AuthSendCodeRequest = {
3056
3085
  table?: string;
3057
3086
  };
3058
3087
  type AuthVerifyResponse = {
3088
+ token: string;
3059
3089
  user: AuthUser;
3060
3090
  team: {
3061
3091
  slug: string;
@@ -3120,17 +3150,17 @@ declare class BillingResource {
3120
3150
  deleteOrder(id: string): Promise<IAppResponse<void>>;
3121
3151
  paymentAccount(team: string, provider: PaymentProvider): Promise<IAppResponse<PaymentAccount>>;
3122
3152
  createPaymentAccountOnboarding(team: string, provider: PaymentProvider): Promise<IAppResponse<PaymentAccountOnboarding>>;
3123
- updatePaymentAccount(team: string, provider: string, input: {
3153
+ updatePaymentAccount(team: string, provider: PaymentProvider, input: {
3124
3154
  providerAccountId: string;
3125
3155
  chargesEnabled?: boolean;
3126
3156
  payoutsEnabled?: boolean;
3127
3157
  detailsSubmitted?: boolean;
3128
3158
  requirements?: string[];
3129
3159
  }): Promise<IAppResponse<PaymentAccount>>;
3130
- createTerminalConnectionToken(team: string, provider: string): Promise<IAppResponse<TerminalConnectionToken>>;
3131
- createTerminalPaymentIntent(orderId: string, provider: string): Promise<IAppResponse<TerminalPaymentIntent>>;
3132
- captureTerminalPaymentIntent(orderId: string, provider: string, paymentIntentId: string): Promise<IAppResponse<void>>;
3133
- cancelTerminalPaymentIntent(orderId: string, provider: string, paymentIntentId: string): Promise<IAppResponse<void>>;
3160
+ createTerminalConnectionToken(team: string, provider: PaymentProvider): Promise<IAppResponse<TerminalConnectionToken>>;
3161
+ createTerminalPaymentIntent(orderId: string, provider: PaymentProvider): Promise<IAppResponse<TerminalPaymentIntent>>;
3162
+ captureTerminalPaymentIntent(orderId: string, provider: PaymentProvider, paymentIntentId: string): Promise<IAppResponse<void>>;
3163
+ cancelTerminalPaymentIntent(orderId: string, provider: PaymentProvider, paymentIntentId: string): Promise<IAppResponse<void>>;
3134
3164
  cancelSubscription(teamSlug: string): Promise<IAppResponse<void>>;
3135
3165
  resumeSubscription(teamSlug: string): Promise<IAppResponse<void>>;
3136
3166
  verifyIap(receipt: IapReceipt, team: string, meta?: Record<string, string>): Promise<IAppResponse<PurchaseResult>>;
@@ -3251,7 +3281,7 @@ declare class ContactsResource {
3251
3281
  }): Promise<IAppResponse<ContactActivity>>;
3252
3282
  deleteActivity(id: string, activityId: string): Promise<IAppResponse<void>>;
3253
3283
  send(id: string, message: string, subject?: string, integration?: IntegrationType | 'preferred'): Promise<IAppResponse<void>>;
3254
- upsertProperty(id: string, key: string, value: string): Promise<IAppResponse<void>>;
3284
+ setProperty(id: string, key: string, value: string): Promise<IAppResponse<void>>;
3255
3285
  }
3256
3286
  //#endregion
3257
3287
  //#region src/resources/contracts.d.ts
@@ -3753,7 +3783,7 @@ declare class OrdersResource {
3753
3783
  }): Promise<IAppResponse<Order>>;
3754
3784
  convertToOrder(id: string): Promise<IAppResponse<Order>>;
3755
3785
  delete(id: string): Promise<IAppResponse<void>>;
3756
- pay(id: string, provider: string): Promise<IAppResponse<{
3786
+ pay(id: string, provider?: PaymentProvider): Promise<IAppResponse<{
3757
3787
  url: string;
3758
3788
  }>>;
3759
3789
  notify(id: string, type?: string): Promise<IAppResponse<{
@@ -4013,18 +4043,19 @@ declare class StatsResource {
4013
4043
  declare class KvResource {
4014
4044
  private readonly http;
4015
4045
  constructor(http: IHttpService);
4016
- list(): Promise<IAppResponse<Store[]>>;
4017
- create(payload: StoreCreatePayload): Promise<IAppResponse<Store>>;
4046
+ list(): Promise<IAppResponse<KvField[]>>;
4047
+ create(payload: CreateKvFieldPayload): Promise<IAppResponse<KvField>>;
4018
4048
  entries(params?: {
4019
- storeName?: string;
4049
+ field?: string;
4020
4050
  since?: string;
4021
4051
  until?: string;
4022
4052
  last?: number;
4023
- }): Promise<IAppResponse<StoreWithEntries>>;
4024
- setEntry(payload: StoreEntryPayload): Promise<IAppResponse<StoreEntryResult>>;
4025
- appendEntry(payload: StoreEntryPayload): Promise<IAppResponse<StoreEntryResult>>;
4026
- toggle(storeName?: string): Promise<IAppResponse<StoreToggleResult>>;
4027
- delete(storeName: string): Promise<IAppResponse<void>>;
4053
+ cursor?: string;
4054
+ }): Promise<IAppResponse<KvFieldWithEntries>>;
4055
+ setEntry(payload: KvEntryPayload): Promise<IAppResponse<SetKvEntryResult>>;
4056
+ appendEntry(payload: KvEntryPayload): Promise<IAppResponse<AppendKvEntryResult>>;
4057
+ toggle(field?: string): Promise<IAppResponse<ToggleKvFieldResult>>;
4058
+ delete(field: string): Promise<IAppResponse<void>>;
4028
4059
  }
4029
4060
  //#endregion
4030
4061
  //#region src/resources/subscriptions.d.ts
@@ -4326,7 +4357,9 @@ declare class WarpsResource {
4326
4357
  destroy(identifier: string): Promise<IAppResponse<void>>;
4327
4358
  execute<C extends Record<string, unknown> = Record<string, never>>(identifier: string, inputs: string[], room?: string, context?: WarpExecutionContext<C>): Promise<IAppResponse<JsonValue>>;
4328
4359
  executions(identifier: string, page?: number, perPage?: number): Promise<IAppResponse<WarpExecutionBackend[]>>;
4329
- results(identifier: string, page?: number, perPage?: number): Promise<IAppResponse<WarpExecutionBackend[]>>;
4360
+ clearExecutions(identifier: string): Promise<IAppResponse<void>>;
4361
+ clearExecution(identifier: string, executionId: string): Promise<IAppResponse<void>>;
4362
+ results(identifier: string): Promise<IAppResponse<PublicFormResults>>;
4330
4363
  ensureLink(identifier: string): Promise<IAppResponse<Link>>;
4331
4364
  install(identifier: string): Promise<IAppResponse<{
4332
4365
  identifier: string;
@@ -4392,6 +4425,7 @@ declare class HooksResource {
4392
4425
  constructor(http: IHttpService);
4393
4426
  list(agentId: string): Promise<IAppResponse<Hook[]>>;
4394
4427
  create(agentId: string, payload: CreateHookPayload): Promise<IAppResponse<Hook>>;
4428
+ sample(agentId: string, source: string): Promise<IAppResponse<HookSample>>;
4395
4429
  toggle(agentId: string, hookId: string): Promise<IAppResponse<Hook>>;
4396
4430
  removeByHook(agentId: string, hookId: string): Promise<IAppResponse<void>>;
4397
4431
  removeByWarp(agentId: string, warpIdentifier: string): Promise<IAppResponse<void>>;
@@ -4522,4 +4556,4 @@ declare class DistributionResource {
4522
4556
  private fetchDistribution;
4523
4557
  }
4524
4558
  //#endregion
4525
- export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, type AttachedMedia, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BillingAddressesResource, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, type CreateHookPayload, type CreateInternalHookPayload, type CreateWarpLinkedHookPayload, type CreateWebHookPayload, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, type Hook, type HookTrigger, type HookTriggerCondition, type HookTriggerInput, HooksResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, type JoAiClientConfig, KvResource, LinksResource, LoyaltyResource, McpResource, type MediaUploadType, MeetingsResource, MemoriesResource, MessagesResource, MissionsResource, NotificationsResource, OfficeResource, type OpeningHoursEntry, type OpeningHoursFormatOptions, OrdersResource, PersonaResource, type Product, type ProductVariation, ProductsResource, ProjectsResource, RemindersResource, SegmentsResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, createClient, formatOpeningHours };
4559
+ export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, type AttachedMedia, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BillingAddressesResource, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, type CreateHookPayload, type CreateInboundHookPayload, type CreateInternalHookPayload, type CreateWarpLinkedHookPayload, type CreateWebHookPayload, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, 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, MissionsResource, NotificationsResource, OfficeResource, type OpeningHoursEntry, type OpeningHoursFormatOptions, OrdersResource, PersonaResource, type Product, type ProductVariation, ProductsResource, ProjectsResource, RemindersResource, SegmentsResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, type WebHookTriggerEvent, WorkspaceResource, createClient, formatOpeningHours };
package/dist/index.mjs CHANGED
@@ -780,7 +780,7 @@ var ContactsResource = class {
780
780
  integration
781
781
  });
782
782
  }
783
- upsertProperty(id, key, value) {
783
+ setProperty(id, key, value) {
784
784
  return this.http.post(`contacts/${id}/properties`, {
785
785
  key,
786
786
  value
@@ -1563,7 +1563,7 @@ var OrdersResource = class {
1563
1563
  return this.http.delete(`orders/${id}`);
1564
1564
  }
1565
1565
  pay(id, provider) {
1566
- return this.http.post(`orders/${id}/pay`, { provider });
1566
+ return this.http.post(`orders/${id}/pay`, provider ? { provider } : {});
1567
1567
  }
1568
1568
  notify(id, type = "confirmation") {
1569
1569
  return this.http.post(`orders/${id}/notify`, { type });
@@ -1874,10 +1874,11 @@ var KvResource = class {
1874
1874
  }
1875
1875
  entries(params) {
1876
1876
  const query = new URLSearchParams();
1877
- if (params?.storeName) query.set("storeName", params.storeName);
1877
+ if (params?.field) query.set("field", params.field);
1878
1878
  if (params?.since) query.set("since", params.since);
1879
1879
  if (params?.until) query.set("until", params.until);
1880
1880
  if (params?.last != null) query.set("last", String(params.last));
1881
+ if (params?.cursor) query.set("cursor", params.cursor);
1881
1882
  const qs = query.toString();
1882
1883
  return this.http.get(`kv/entries${qs ? "?" + qs : ""}`);
1883
1884
  }
@@ -1887,11 +1888,11 @@ var KvResource = class {
1887
1888
  appendEntry(payload) {
1888
1889
  return this.http.post("kv/entries/append", payload);
1889
1890
  }
1890
- toggle(storeName) {
1891
- return this.http.post("kv/toggle", { storeName });
1891
+ toggle(field) {
1892
+ return this.http.post("kv/toggle", { field });
1892
1893
  }
1893
- delete(storeName) {
1894
- return this.http.delete(`kv/${storeName}`);
1894
+ delete(field) {
1895
+ return this.http.delete(`kv/${encodeURIComponent(field)}`);
1895
1896
  }
1896
1897
  };
1897
1898
  //#endregion
@@ -2384,8 +2385,14 @@ var WarpsResource = class {
2384
2385
  executions(identifier, page = 1, perPage = 20) {
2385
2386
  return this.http.get(`warps/${identifier}/executions?page=${page}&perPage=${perPage}`);
2386
2387
  }
2387
- results(identifier, page = 1, perPage = 50) {
2388
- return this.http.get(`warps/${identifier}/results?page=${page}&perPage=${perPage}`);
2388
+ clearExecutions(identifier) {
2389
+ return this.http.delete(`warps/${identifier}/executions`);
2390
+ }
2391
+ clearExecution(identifier, executionId) {
2392
+ return this.http.delete(`warps/${identifier}/executions/${executionId}`);
2393
+ }
2394
+ results(identifier) {
2395
+ return this.http.get(`warps/${identifier}/results`);
2389
2396
  }
2390
2397
  ensureLink(identifier) {
2391
2398
  return this.http.post(`warps/${identifier}/link`, {});
@@ -2466,6 +2473,9 @@ var HooksResource = class {
2466
2473
  create(agentId, payload) {
2467
2474
  return this.http.post(`hooks?agent=${agentId}`, payload);
2468
2475
  }
2476
+ sample(agentId, source) {
2477
+ return this.http.get(`hooks/sample?agent=${agentId}&source=${encodeURIComponent(source)}`);
2478
+ }
2469
2479
  toggle(agentId, hookId) {
2470
2480
  return this.http.post(`hooks/${hookId}/toggle?agent=${agentId}`);
2471
2481
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,8 @@
31
31
  },
32
32
  "scripts": {
33
33
  "build": "tsdown",
34
- "dev": "tsdown --watch"
34
+ "dev": "tsdown --watch",
35
+ "test": "jest --config jest.config.js"
35
36
  },
36
37
  "dependencies": {
37
38
  "@joai/warps": "*"