@joai/sdk 2.0.0 → 2.1.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
@@ -271,6 +271,21 @@ type TeamMeta = {
271
271
  branding?: TeamBrand | null;
272
272
  settings: Record<string, unknown>;
273
273
  };
274
+ type TeamPlace = {
275
+ provider: 'google';
276
+ sourceId: string;
277
+ name: string | null;
278
+ address: string | null;
279
+ location: {
280
+ lat: number | null;
281
+ lng: number | null;
282
+ };
283
+ rating?: number | null;
284
+ reviewCount?: number | null;
285
+ websiteUrl?: string | null;
286
+ mapsUrl?: string | null;
287
+ businessStatus?: string | null;
288
+ };
274
289
  type Team = {
275
290
  slug: string;
276
291
  name: string;
@@ -280,6 +295,7 @@ type Team = {
280
295
  description: TranslatableValue | null;
281
296
  locale: WarpLocale;
282
297
  timezone: string;
298
+ place?: TeamPlace | null;
283
299
  meta?: TeamMeta;
284
300
  features?: TeamFeature[];
285
301
  cover?: string | null;
@@ -315,6 +331,7 @@ type TeamPrivate = {
315
331
  balance: number;
316
332
  locale: WarpLocale;
317
333
  timezone: string;
334
+ place?: TeamPlace | null;
318
335
  logo: string | null;
319
336
  cover: string | null;
320
337
  subscription: {
@@ -409,6 +426,25 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
409
426
  }; //#endregion
410
427
  //#region src/contact/types.d.ts
411
428
  type ContactHealth = 'active' | 'lukewarm' | 'cold' | 'stale' | 'unknown';
429
+ type ContactConsentStatus = 'pending' | 'confirmed' | 'superseded' | 'unsubscribed';
430
+ type ContactConsent = {
431
+ id: string;
432
+ purpose: string;
433
+ status: ContactConsentStatus;
434
+ email: string;
435
+ consentText: {
436
+ label?: string | Record<string, string>;
437
+ description?: string | Record<string, string> | null;
438
+ };
439
+ privacyUrl: string | null;
440
+ source: {
441
+ formIdentifier?: string | null;
442
+ formTitle?: string | Record<string, string> | null;
443
+ };
444
+ requestedAt: string;
445
+ confirmedAt: string | null;
446
+ unsubscribedAt: string | null;
447
+ };
412
448
  type Contact = {
413
449
  id: string;
414
450
  name: string;
@@ -429,8 +465,11 @@ type Contact = {
429
465
  settings?: {
430
466
  marketingOptOut?: boolean;
431
467
  } | null;
468
+ consents?: ContactConsent[];
432
469
  lastActivityAt?: string | null;
433
470
  health?: ContactHealth;
471
+ nextFollowUpAt?: string | null;
472
+ followUpNote?: string | null;
434
473
  };
435
474
  type ContactActivityType = 'note' | 'call' | 'meeting' | 'task' | 'update' | 'custom' | 'form' | 'loyalty';
436
475
  type ContactActivityAuthor = {
@@ -463,6 +502,8 @@ type ContactFormData = {
463
502
  settings?: {
464
503
  marketingOptOut?: boolean;
465
504
  };
505
+ nextFollowUpAt?: string | null;
506
+ followUpNote?: string | null;
466
507
  };
467
508
  type ContactCreatePayload = ContactFormData & {
468
509
  name: string;
@@ -481,10 +522,8 @@ type MediaLibraryAttributes = {
481
522
  extension?: string;
482
523
  size?: number;
483
524
  };
484
- type MediaLibraryItems = {
485
- [uuid: string]: MediaLibraryAttributes;
486
- };
487
525
  type MediaMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm' | 'video/quicktime' | 'video/x-msvideo' | 'audio/mpeg' | 'audio/mp3' | 'audio/ogg' | 'audio/wav' | 'audio/webm' | 'audio/aac' | 'audio/m4a' | 'audio/m4b' | 'audio/m4p' | 'audio/m4v' | 'application/pdf' | 'application/json';
526
+ type MediaAspectRatio = 'free' | '1:1' | '16:9' | '9:16' | '4:3' | '3:4';
488
527
  type Media = {
489
528
  id: string;
490
529
  name: string;
@@ -1029,6 +1068,12 @@ type WarpExtras = {
1029
1068
  enabled?: boolean;
1030
1069
  contact?: string | null;
1031
1070
  };
1071
+ optIn?: {
1072
+ enabled?: boolean;
1073
+ };
1074
+ results?: {
1075
+ public?: boolean;
1076
+ };
1032
1077
  };
1033
1078
  type WarpBackend = {
1034
1079
  hash: string;
@@ -1447,7 +1492,13 @@ type AppointmentAvailability = {
1447
1492
  service: AppointmentAvailabilityService | null;
1448
1493
  slots: AppointmentAvailabilitySlot[];
1449
1494
  };
1495
+ type AppointmentPolicySync = {
1496
+ enabled: boolean;
1497
+ lastSyncedAt?: string | null;
1498
+ lastSyncError?: string | null;
1499
+ };
1450
1500
  type AppointmentPolicy = {
1501
+ active: boolean;
1451
1502
  timezone: string | null;
1452
1503
  availability: Record<string, {
1453
1504
  start: string;
@@ -1463,7 +1514,9 @@ type AppointmentPolicy = {
1463
1514
  serviceSelectionEnabled?: boolean | null;
1464
1515
  paymentEnabled?: boolean | null;
1465
1516
  requireApproval?: boolean | null;
1517
+ sync?: AppointmentPolicySync | null;
1466
1518
  agent?: Agent | null;
1519
+ agentUuid?: string | null;
1467
1520
  };
1468
1521
  type AppointmentBooking = {
1469
1522
  id: string;
@@ -2021,11 +2074,8 @@ type NotificationAction = {
2021
2074
  };
2022
2075
  type NotificationSetting = {
2023
2076
  identifier: string;
2024
- name: string;
2025
- description: string;
2026
2077
  channels: {
2027
2078
  identifier: NotificationChannel;
2028
- name: string;
2029
2079
  isEnabled: boolean;
2030
2080
  }[];
2031
2081
  }; //#endregion
@@ -2471,7 +2521,7 @@ type LoyaltyMember = {
2471
2521
  updatedAt: string;
2472
2522
  }; //#endregion
2473
2523
  //#region src/segment/types.d.ts
2474
- type SegmentConditionType = 'tag' | 'has_email' | 'has_phone' | 'has_user' | 'last_purchase_after' | 'last_purchase_before' | 'total_order_amount' | 'order_count_at_least' | 'never_purchased' | 'avg_order_value_at_least' | 'last_contact_after' | 'last_contact_before' | 'created_after' | 'created_before' | 'email_contains';
2524
+ type SegmentConditionType = 'tag' | 'has_email' | 'has_phone' | 'has_user' | 'last_purchase_after' | 'last_purchase_before' | 'total_order_amount' | 'order_count_at_least' | 'never_purchased' | 'avg_order_value_at_least' | 'last_contact_after' | 'last_contact_before' | 'waiting_on' | 'created_after' | 'created_before' | 'email_contains';
2475
2525
  type SegmentCondition = {
2476
2526
  type: SegmentConditionType;
2477
2527
  value: string | boolean;
@@ -2579,7 +2629,7 @@ type UpdateCreatePayload = {
2579
2629
  type: UpdateType;
2580
2630
  body?: string;
2581
2631
  imageUrl?: string;
2582
- media?: MediaLibraryItems;
2632
+ media?: string[];
2583
2633
  linkUrl?: string;
2584
2634
  startsAt?: string;
2585
2635
  endsAt?: string;
@@ -2762,7 +2812,7 @@ declare class AgentsResource {
2762
2812
  trainingUrl?: string | null;
2763
2813
  };
2764
2814
  }): Promise<IAppResponse<AgentPrivate>>;
2765
- update(uuid: string, name: string, description: string | null, avatar?: MediaLibraryItems): Promise<IAppResponse<AgentPrivate>>;
2815
+ update(uuid: string, name: string, description: string | null, avatar?: string[]): Promise<IAppResponse<AgentPrivate>>;
2766
2816
  delete(uuid: string): Promise<IAppResponse<void>>;
2767
2817
  updatePassword(uuid: string, password: string): Promise<IAppResponse<void>>;
2768
2818
  storePassword(uuid: string, password: string): Promise<IAppResponse<AgentPrivate>>;
@@ -2849,14 +2899,14 @@ declare class ElementsResource {
2849
2899
  type: string;
2850
2900
  description?: string | null;
2851
2901
  spec?: ElementSpec | null;
2852
- media?: any[];
2902
+ media?: string[];
2853
2903
  }): Promise<IAppResponse<Element>>;
2854
2904
  update(team: string, elementId: string, payload: {
2855
2905
  name?: string;
2856
2906
  type?: string;
2857
2907
  description?: string | null;
2858
2908
  spec?: ElementSpec | null;
2859
- media?: any[];
2909
+ media?: string[];
2860
2910
  }): Promise<IAppResponse<Element>>;
2861
2911
  delete(team: string, elementId: string): Promise<IAppResponse<void>>;
2862
2912
  generateVariation(team: string, elementId: string, payload?: {
@@ -2935,7 +2985,7 @@ declare class AppointmentsResource {
2935
2985
  private readonly http;
2936
2986
  private readonly config;
2937
2987
  constructor(http: IHttpService, config: JoAiClientConfig);
2938
- getPolicy(): Promise<IAppResponse<AppointmentPolicy>>;
2988
+ getPolicy(): Promise<IAppResponse<AppointmentPolicy | null>>;
2939
2989
  upsertPolicy(data: Partial<AppointmentPolicy>): Promise<IAppResponse<AppointmentPolicy>>;
2940
2990
  checkAvailability(agentUuid: string, params: {
2941
2991
  windowStart: string;
@@ -3061,12 +3111,12 @@ declare class BillingResource {
3061
3111
  plans(type?: 'current' | 'all'): Promise<IAppResponse<Plan[]>>;
3062
3112
  checkoutProduct(id: string): Promise<IAppResponse<Product>>;
3063
3113
  orders(team: TeamPrivate | null, page?: number, contactId?: string): Promise<IAppResponse<Order[]>>;
3064
- payOrder(id: string, provider: string): Promise<IAppResponse<{
3114
+ payOrder(id: string, provider?: PaymentProvider): Promise<IAppResponse<{
3065
3115
  url: string;
3066
3116
  }>>;
3067
3117
  deleteOrder(id: string): Promise<IAppResponse<void>>;
3068
- paymentAccount(team: string, provider: string): Promise<IAppResponse<PaymentAccount>>;
3069
- createPaymentAccountOnboarding(team: string, provider: string): Promise<IAppResponse<PaymentAccountOnboarding>>;
3118
+ paymentAccount(team: string, provider: PaymentProvider): Promise<IAppResponse<PaymentAccount>>;
3119
+ createPaymentAccountOnboarding(team: string, provider: PaymentProvider): Promise<IAppResponse<PaymentAccountOnboarding>>;
3070
3120
  updatePaymentAccount(team: string, provider: string, input: {
3071
3121
  providerAccountId: string;
3072
3122
  chargesEnabled?: boolean;
@@ -3145,7 +3195,7 @@ type CouponPayload = {
3145
3195
  restrictedItems?: CouponRestrictedItem[] | null;
3146
3196
  usesLeft?: number | null;
3147
3197
  expiresAt?: string | null;
3148
- media?: MediaLibraryAttributes[];
3198
+ media?: string[];
3149
3199
  };
3150
3200
  declare class CouponsResource {
3151
3201
  private readonly http;
@@ -3177,6 +3227,8 @@ declare class ContactsResource {
3177
3227
  search?: string;
3178
3228
  page?: number;
3179
3229
  staleDays?: number;
3230
+ waitingOn?: boolean;
3231
+ overdue?: boolean;
3180
3232
  }): Promise<IAppResponse<Contact[]>>;
3181
3233
  get(id: string): Promise<IAppResponse<Contact>>;
3182
3234
  create(payload: ContactCreatePayload): Promise<IAppResponse<Contact>>;
@@ -3253,7 +3305,7 @@ declare class DocumentsResource {
3253
3305
  }): Promise<IAppResponse<Document>>;
3254
3306
  delete(id: string): Promise<IAppResponse<void>>;
3255
3307
  trainFromUrl(agent: string, url: string): Promise<IAppResponse<Document>>;
3256
- uploadFile(agentUuid: string, name: string, document: MediaLibraryItems): Promise<IAppResponse<Document>>;
3308
+ uploadFile(agentUuid: string, name: string, document: string[]): Promise<IAppResponse<Document>>;
3257
3309
  }
3258
3310
  //#endregion
3259
3311
  //#region src/resources/flows.d.ts
@@ -3538,6 +3590,10 @@ declare class StoreResource {
3538
3590
  //#endregion
3539
3591
  //#region src/resources/media.d.ts
3540
3592
  type MediaUploadType = 'brand' | 'reference' | 'template' | 'output';
3593
+ type AttachedMedia = {
3594
+ id: string;
3595
+ custom_properties?: Record<string, unknown> | null;
3596
+ };
3541
3597
  declare class MediaResource {
3542
3598
  private readonly http;
3543
3599
  constructor(http: IHttpService);
@@ -3553,24 +3609,24 @@ declare class MediaResource {
3553
3609
  fileName?: string;
3554
3610
  mimeType?: string;
3555
3611
  type: MediaUploadType;
3612
+ aspect?: MediaAspectRatio;
3556
3613
  label?: string;
3557
3614
  tags?: string[];
3558
3615
  copyright?: string;
3559
3616
  }): Promise<IAppResponse<Media>>;
3560
- listTeam(team: string, params?: {
3617
+ list(team: string, params?: {
3561
3618
  page?: number;
3562
3619
  mime?: string;
3563
3620
  }): Promise<IAppResponse<Media[]>>;
3564
- uploadTeam(team: string, media: MediaLibraryItems, tags?: string[], options?: {
3565
- preserveOriginal?: boolean;
3566
- copyright?: string;
3567
- }): Promise<IAppResponse<Media[]>>;
3568
- deleteTeam(team: string, mediaId: string): Promise<IAppResponse<void>>;
3569
- updateTeamMedia(team: string, mediaId: string, data: {
3621
+ get(team: string, mediaId: string): Promise<IAppResponse<Media>>;
3622
+ delete(team: string, mediaId: string): Promise<IAppResponse<void>>;
3623
+ update(team: string, mediaId: string, data: {
3570
3624
  name: string;
3571
3625
  copyright?: string | null;
3572
3626
  }): Promise<IAppResponse<Media>>;
3573
- updateTeamMediaTags(team: string, mediaId: string, tags: string[]): Promise<IAppResponse<Media>>;
3627
+ updateTags(team: string, mediaId: string, tags: string[]): Promise<IAppResponse<Media>>;
3628
+ /** Download the stored bytes of a media item as a File (used to re-edit existing images). */
3629
+ download(team: string, mediaId: string, name: string, mime: string): Promise<File>;
3574
3630
  }
3575
3631
  //#endregion
3576
3632
  //#region src/resources/meetings.d.ts
@@ -3736,7 +3792,7 @@ declare class ProductsResource {
3736
3792
  active?: boolean;
3737
3793
  public?: boolean;
3738
3794
  virtual?: boolean;
3739
- media?: MediaLibraryAttributes[];
3795
+ media?: string[];
3740
3796
  }): Promise<IAppResponse<Product>>;
3741
3797
  delete(id: string): Promise<IAppResponse<void>>;
3742
3798
  createVariation(productSlug: string, data: {
@@ -3752,8 +3808,8 @@ declare class ProductsResource {
3752
3808
  hidden?: boolean;
3753
3809
  type?: string;
3754
3810
  settings?: Record<string, unknown> | null;
3755
- media?: MediaLibraryAttributes[];
3756
- preview?: MediaLibraryAttributes[];
3811
+ media?: string[];
3812
+ preview?: string[];
3757
3813
  stock?: number | null;
3758
3814
  weight?: number | null;
3759
3815
  }): Promise<IAppResponse<ProductVariation>>;
@@ -3918,13 +3974,13 @@ declare class SkillsResource {
3918
3974
  license?: string;
3919
3975
  compatibility?: string;
3920
3976
  allowedTools?: string;
3921
- media?: MediaLibraryItems;
3977
+ media?: AttachedMedia[];
3922
3978
  active?: boolean;
3923
3979
  isPublic?: boolean;
3924
3980
  price?: number;
3925
3981
  }): Promise<IAppResponse<Skill>>;
3926
3982
  update(id: string, data: Partial<Omit<Skill, 'media' | 'store'>> & {
3927
- media?: MediaLibraryItems;
3983
+ media?: AttachedMedia[];
3928
3984
  public?: boolean;
3929
3985
  price?: number;
3930
3986
  }): Promise<IAppResponse<Skill>>;
@@ -3986,7 +4042,7 @@ declare class SwarmsResource {
3986
4042
  constructor(http: IHttpService);
3987
4043
  listSwarms(team: string): Promise<IAppResponse<Swarm[]>>;
3988
4044
  listAgents(swarm: string): Promise<IAppResponse<Agent[]>>;
3989
- storeProposal(agent: string, swarm: string, title: string, description: string, actions: ProposalAction[], attachments: MediaLibraryItems, poll: ProposalPollOption[]): Promise<IAppResponse<Proposal>>;
4045
+ storeProposal(agent: string, swarm: string, title: string, description: string, actions: ProposalAction[], attachments: string[], poll: ProposalPollOption[]): Promise<IAppResponse<Proposal>>;
3990
4046
  finalizeProposal(swarm: string, txHash: string, proposal: string): Promise<IAppResponse<void>>;
3991
4047
  finalizeSignature(swarm: string, txHash: string, proposal: string): Promise<IAppResponse<void>>;
3992
4048
  finalizeExecution(chain: WarpChainName, txHash: string, actions?: ProposalAction[]): Promise<IAppResponse<void>>;
@@ -4065,9 +4121,15 @@ declare class TeamsResource {
4065
4121
  inviteMember(teamSlug: string, email: string, role: UserRole): Promise<IAppResponse<void>>;
4066
4122
  removeMember(teamSlug: string, memberId: string): Promise<IAppResponse<void>>;
4067
4123
  listMembers(teamSlug: string): Promise<IAppResponse<TeamMember[]>>;
4068
- updateLogo(teamSlug: string, logo: MediaLibraryItems): Promise<IAppResponse<TeamPrivate>>;
4069
- updateCover(teamSlug: string, cover: MediaLibraryItems): Promise<IAppResponse<TeamPrivate>>;
4124
+ updateLogo(teamSlug: string, logo: string[]): Promise<IAppResponse<TeamPrivate>>;
4125
+ updateCover(teamSlug: string, cover: string[]): Promise<IAppResponse<TeamPrivate>>;
4070
4126
  updateSetting(teamSlug: string, key: string, value: boolean | string | number | object | null): Promise<IAppResponse<TeamPrivate>>;
4127
+ searchPlaces(teamSlug: string, query: string, options?: {
4128
+ language?: string;
4129
+ region?: string;
4130
+ limit?: number;
4131
+ }): Promise<IAppResponse<TeamPlace[]>>;
4132
+ selectPlace(teamSlug: string, sourceId: string | null): Promise<IAppResponse<TeamPrivate>>;
4071
4133
  listPrivate(): Promise<IAppResponse<TeamPrivate[]>>;
4072
4134
  getInviteByToken(token: string): Promise<IAppResponse<TeamInviteInfo>>;
4073
4135
  acceptInvite(slug: string): Promise<IAppResponse<void>>;
@@ -4214,6 +4276,12 @@ type BackendWarp = {
4214
4276
  agent?: AgentPrivate | null;
4215
4277
  link?: Link | null;
4216
4278
  };
4279
+ type WarpExecutionContext<C extends Record<string, unknown> = Record<string, never>> = {
4280
+ locale?: string;
4281
+ sourceUrl?: string;
4282
+ ipAddress?: string;
4283
+ userAgent?: string;
4284
+ } & C;
4217
4285
  declare class WarpsResource {
4218
4286
  private readonly http;
4219
4287
  constructor(http: IHttpService);
@@ -4238,6 +4306,7 @@ declare class WarpsResource {
4238
4306
  form?: boolean;
4239
4307
  store?: boolean;
4240
4308
  agent?: string | null;
4309
+ optIn?: boolean | null;
4241
4310
  }): Promise<IAppResponse<BackendWarpCreateResponse>>;
4242
4311
  update(identifier: string, data: {
4243
4312
  name?: string;
@@ -4249,10 +4318,12 @@ declare class WarpsResource {
4249
4318
  store?: boolean;
4250
4319
  agent?: string | null;
4251
4320
  public?: boolean;
4321
+ optIn?: boolean | null;
4252
4322
  }): Promise<IAppResponse<BackendWarpUpdateResponse>>;
4253
4323
  destroy(identifier: string): Promise<IAppResponse<void>>;
4254
- execute(identifier: string, inputs: string[], room?: string): Promise<IAppResponse<JsonValue>>;
4324
+ execute<C extends Record<string, unknown> = Record<string, never>>(identifier: string, inputs: string[], room?: string, context?: WarpExecutionContext<C>): Promise<IAppResponse<JsonValue>>;
4255
4325
  executions(identifier: string, page?: number, perPage?: number): Promise<IAppResponse<WarpExecutionBackend[]>>;
4326
+ results(identifier: string, page?: number, perPage?: number): Promise<IAppResponse<WarpExecutionBackend[]>>;
4256
4327
  ensureLink(identifier: string): Promise<IAppResponse<Link>>;
4257
4328
  install(identifier: string): Promise<IAppResponse<{
4258
4329
  identifier: string;
@@ -4283,7 +4354,7 @@ declare class WarpsResource {
4283
4354
  name?: string;
4284
4355
  description?: string;
4285
4356
  public?: boolean;
4286
- logo?: MediaLibraryItems | null;
4357
+ logo?: string[] | null;
4287
4358
  source?: BrandSourceConfig | null;
4288
4359
  }): Promise<IAppResponse<BrandBackend>>;
4289
4360
  deleteTeamBrand(teamSlug: string, brandSlug: string): Promise<IAppResponse<void>>;
@@ -4357,6 +4428,7 @@ interface JoAiClientConfig {
4357
4428
  env?: AppEnv;
4358
4429
  agentAuthKey?: string;
4359
4430
  cache?: CacheConfig;
4431
+ buildSecret?: string;
4360
4432
  }
4361
4433
  declare class JoAiClient {
4362
4434
  readonly http: IHttpService;
@@ -4467,4 +4539,4 @@ declare class DistributionResource {
4467
4539
  private fetchDistribution;
4468
4540
  }
4469
4541
  //#endregion
4470
- export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BillingAddressesResource, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, type JoAiClientConfig, KvResource, LinksResource, LoyaltyResource, McpResource, 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, WebhooksResource, WorkspaceResource, createClient, formatOpeningHours };
4542
+ 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, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, 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, WebhooksResource, WorkspaceResource, createClient, formatOpeningHours };
package/dist/index.mjs CHANGED
@@ -548,7 +548,7 @@ var BillingResource = class {
548
548
  return this.http.get(params);
549
549
  }
550
550
  payOrder(id, provider) {
551
- return this.http.post(`orders/${id}/pay`, { provider });
551
+ return this.http.post(`orders/${id}/pay`, provider ? { provider } : {});
552
552
  }
553
553
  deleteOrder(id) {
554
554
  return this.http.delete(`orders/${id}`);
@@ -741,6 +741,8 @@ var ContactsResource = class {
741
741
  if (params?.search) query.set("filter[search]", params.search);
742
742
  if (params?.page) query.set("page", String(params.page));
743
743
  if (params?.staleDays) query.set("filter[stale_days]", String(params.staleDays));
744
+ if (params?.waitingOn) query.set("filter[waiting_on]", "1");
745
+ if (params?.overdue) query.set("filter[followup_overdue]", "1");
744
746
  const qs = query.toString();
745
747
  return this.http.get(`contacts${qs ? "?" + qs : ""}`);
746
748
  }
@@ -1325,11 +1327,12 @@ var MediaResource = class {
1325
1327
  return this.http.get(`media/public${qs ? "?" + qs : ""}`);
1326
1328
  }
1327
1329
  upload(data) {
1328
- const { team, file, fileUrl, fileName, mimeType, type, label, tags, copyright } = data;
1330
+ const { team, file, fileUrl, fileName, mimeType, type, aspect, label, tags, copyright } = data;
1329
1331
  if (file) {
1330
1332
  const formData = new FormData();
1331
1333
  formData.append("file", file, file.name);
1332
1334
  formData.append("type", type);
1335
+ if (aspect) formData.append("aspect", aspect);
1333
1336
  if (label) formData.append("label", label);
1334
1337
  if (tags) tags.forEach((t) => formData.append("tags[]", t));
1335
1338
  if (copyright) formData.append("copyright", copyright);
@@ -1340,33 +1343,39 @@ var MediaResource = class {
1340
1343
  fileName,
1341
1344
  mimeType,
1342
1345
  type,
1346
+ aspect,
1343
1347
  label,
1344
1348
  tags,
1345
1349
  copyright
1346
1350
  }, { headers: { "X-Team": team } });
1347
1351
  }
1348
- listTeam(team, params) {
1352
+ list(team, params) {
1349
1353
  const query = new URLSearchParams();
1350
1354
  query.set("page", String(params?.page ?? 1));
1351
1355
  if (params?.mime) query.set("mime", params.mime);
1352
- return this.http.get(`teams/${team}/media?${query.toString()}`);
1356
+ return this.http.get(`media?${query.toString()}`, { headers: { "X-Team": team } });
1353
1357
  }
1354
- uploadTeam(team, media, tags, options) {
1355
- return this.http.post(`teams/${team}/media/upload`, {
1356
- media,
1357
- tags,
1358
- preserveOriginal: options?.preserveOriginal,
1359
- copyright: options?.copyright
1360
- });
1358
+ get(team, mediaId) {
1359
+ return this.http.get(`media/${mediaId}`, { headers: { "X-Team": team } });
1360
+ }
1361
+ delete(team, mediaId) {
1362
+ return this.http.delete(`media/${mediaId}`, { headers: { "X-Team": team } });
1361
1363
  }
1362
- deleteTeam(team, mediaId) {
1363
- return this.http.delete(`teams/${team}/media/${mediaId}`);
1364
+ update(team, mediaId, data) {
1365
+ return this.http.put(`media/${mediaId}`, data, { headers: { "X-Team": team } });
1364
1366
  }
1365
- updateTeamMedia(team, mediaId, data) {
1366
- return this.http.put(`teams/${team}/media/${mediaId}`, data);
1367
+ updateTags(team, mediaId, tags) {
1368
+ return this.http.put(`media/${mediaId}/tags`, { tags }, { headers: { "X-Team": team } });
1367
1369
  }
1368
- updateTeamMediaTags(team, mediaId, tags) {
1369
- return this.http.put(`teams/${team}/media/${mediaId}/tags`, { tags });
1370
+ /** Download the stored bytes of a media item as a File (used to re-edit existing images). */
1371
+ async download(team, mediaId, name, mime) {
1372
+ const url = `${this.http.baseUrl}/media/${mediaId}/download`;
1373
+ const headers = { "X-Team": team };
1374
+ if (this.http.authToken) headers["Authorization"] = `Bearer ${this.http.authToken}`;
1375
+ const res = await fetch(url, { headers });
1376
+ if (!res.ok) throw new Error(`Failed to download media (${res.status})`);
1377
+ const blob = await res.blob();
1378
+ return new File([blob], name, { type: mime });
1370
1379
  }
1371
1380
  };
1372
1381
  //#endregion
@@ -2049,6 +2058,16 @@ var TeamsResource = class {
2049
2058
  updateSetting(teamSlug, key, value) {
2050
2059
  return this.http.put(`teams/${teamSlug}/settings/${key}`, { value });
2051
2060
  }
2061
+ searchPlaces(teamSlug, query, options) {
2062
+ const params = new URLSearchParams({ query });
2063
+ if (options?.language) params.set("language", options.language);
2064
+ if (options?.region) params.set("region", options.region);
2065
+ if (options?.limit) params.set("limit", String(options.limit));
2066
+ return this.http.get(`teams/${teamSlug}/places?${params}`);
2067
+ }
2068
+ selectPlace(teamSlug, sourceId) {
2069
+ return this.http.put(`teams/${teamSlug}/place`, { sourceId });
2070
+ }
2052
2071
  listPrivate() {
2053
2072
  return this.http.get("teams?me=true");
2054
2073
  }
@@ -2355,15 +2374,19 @@ var WarpsResource = class {
2355
2374
  destroy(identifier) {
2356
2375
  return this.http.delete(`warps/${identifier}`);
2357
2376
  }
2358
- execute(identifier, inputs, room) {
2377
+ execute(identifier, inputs, room, context) {
2359
2378
  return this.http.post(`warps/${identifier}/execute`, {
2360
2379
  inputs,
2361
- ...room ? { room } : {}
2380
+ ...room ? { room } : {},
2381
+ ...context ? { context } : {}
2362
2382
  });
2363
2383
  }
2364
2384
  executions(identifier, page = 1, perPage = 20) {
2365
2385
  return this.http.get(`warps/${identifier}/executions?page=${page}&perPage=${perPage}`);
2366
2386
  }
2387
+ results(identifier, page = 1, perPage = 50) {
2388
+ return this.http.get(`warps/${identifier}/results?page=${page}&perPage=${perPage}`);
2389
+ }
2367
2390
  ensureLink(identifier) {
2368
2391
  return this.http.post(`warps/${identifier}/link`, {});
2369
2392
  }
@@ -2596,6 +2619,7 @@ var JoAiClient = class {
2596
2619
  const headers = {};
2597
2620
  if (config.team) headers["X-Team"] = config.team;
2598
2621
  if (config.agentAuthKey) headers["X-Agent-Auth-Key"] = config.agentAuthKey;
2622
+ if (config.buildSecret) headers["X-Build-Secret"] = config.buildSecret;
2599
2623
  const http = new HttpService(`${apiBaseUrl}/v1`, void 0, config.apiToken, {
2600
2624
  headers,
2601
2625
  csrfBaseUrl: apiBaseUrl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",