@joai/sdk 0.9.0 → 0.10.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
@@ -1,6 +1,6 @@
1
1
  import { WarpBrandUrls, WarpChainName, WarpClient, WarpI18nText, WarpLocale, WarpText, WarpWalletProvider } from "@joai/warps";
2
2
 
3
- //#region ../core/dist/types-C4eYYzWF.d.mts
3
+ //#region ../core/dist/types-CWSaEVa7.d.mts
4
4
  //#region src/http/types.d.ts
5
5
  interface IHttpService {
6
6
  readonly baseUrl: string;
@@ -12,6 +12,7 @@ interface IHttpService {
12
12
  get: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
13
13
  post: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
14
14
  put: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
15
+ patch: <T>(url: string, data?: any, options?: IRequestOptions) => Promise<IAppResponse<T>>;
15
16
  delete: <T>(url: string, options?: IRequestOptions) => Promise<IAppResponse<T>>;
16
17
  }
17
18
  interface IAppResponse<T> {
@@ -134,6 +135,9 @@ type Wallet = {
134
135
  privateKey?: string;
135
136
  mnemonic?: string;
136
137
  };
138
+ //#endregion
139
+ //#region src/billing/types.d.ts
140
+ type TranslatableValue = Partial<Record<WarpLocale, string>>;
137
141
  type SubscriptionStatus = 'active' | 'canceled' | 'past_due';
138
142
  type SubscriptionInterval = 'weekly' | 'monthly' | 'yearly';
139
143
  type AppSubscription = {
@@ -222,6 +226,88 @@ type Skill = {
222
226
  media?: Media[];
223
227
  screenshots: string[];
224
228
  }; //#endregion
229
+ //#region src/integration/types.d.ts
230
+ type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'n8n' | 'ai-nexus' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'sentry' | 'readwise';
231
+ type IntegrationDetails = {
232
+ type: IntegrationType;
233
+ name: string;
234
+ description?: string;
235
+ logoUrl?: string;
236
+ logoUrlDark?: string;
237
+ slug?: string;
238
+ category?: string;
239
+ [key: string]: unknown;
240
+ };
241
+ type Integration = {
242
+ id: string;
243
+ type: IntegrationType;
244
+ name: string;
245
+ active: boolean;
246
+ createdAt: string;
247
+ details?: IntegrationDetails;
248
+ };
249
+ type EmailProvider = 'resend' | 'mailgun' | 'sendgrid';
250
+ type RoomKind = 'default' | 'phone' | 'meeting';
251
+ type Room = {
252
+ id: string;
253
+ name: string;
254
+ description: string | null;
255
+ public: boolean;
256
+ default: boolean;
257
+ active: boolean;
258
+ kind?: RoomKind | null;
259
+ archivedAt?: string | null;
260
+ secKey: string | null;
261
+ createdAt: string | null;
262
+ contactId?: string | null;
263
+ agent: AgentSimple;
264
+ integration: Integration | null;
265
+ }; //#endregion
266
+ //#region src/agent/types.d.ts
267
+ type AgentPrivate = {
268
+ uuid: string;
269
+ name: string;
270
+ description: string;
271
+ avatar: string;
272
+ wallets: Wallet[];
273
+ settings: AgentSettings;
274
+ marketplace: MarketplaceInfo;
275
+ password: string | null;
276
+ authKey: string | null;
277
+ secKey: string;
278
+ emailAddress: string | null;
279
+ phoneNumber: string | null;
280
+ room: Room;
281
+ role: string | null;
282
+ blueprint: Blueprint | null;
283
+ justCreated?: boolean;
284
+ team: string;
285
+ };
286
+ type AgentSimple = {
287
+ uuid: string;
288
+ name: string;
289
+ };
290
+ type AgentEngine = 'cortex' | 'openclaw';
291
+ type AgentGender = 'male' | 'female' | 'neutral';
292
+ type AgentSettings = {
293
+ auto: boolean;
294
+ 'model.url': string;
295
+ 'voice.output': boolean;
296
+ 'voice.id': string;
297
+ 'agent.gender'?: AgentGender;
298
+ 'proactivity.enabled': boolean;
299
+ 'proactivity.quietHoursStart'?: number;
300
+ 'proactivity.quietHoursEnd'?: number;
301
+ 'proactivity.maxMessagesPerDay'?: number;
302
+ 'proactivity.timezone'?: string;
303
+ 'proactivity.blockedBehaviors'?: string[];
304
+ engine: AgentEngine;
305
+ 'training.url'?: string | null;
306
+ 'training.status'?: 'idle' | 'training' | 'completed' | 'failed' | null;
307
+ 'training.recrawlInterval'?: number | null;
308
+ 'email_provider'?: EmailProvider | null;
309
+ };
310
+ //#endregion
225
311
  //#region src/warp/types.d.ts
226
312
  type WarpExtrasFaq = {
227
313
  question: string;
@@ -254,6 +340,7 @@ type WarpBackend = {
254
340
  brand: BrandBackend | null;
255
341
  definition?: Record<string, any> | null;
256
342
  extras?: WarpExtras | null;
343
+ agent?: AgentSimple | null;
257
344
  };
258
345
  type WarpBackendStatus = 'unverified' | 'verified' | 'blacklisted';
259
346
  type WarpBackendCategory = 'none';
@@ -409,88 +496,6 @@ type BlueprintShortcut = {
409
496
  }; //#endregion
410
497
  //#region src/helpers/string.d.ts
411
498
  //#endregion
412
- //#region src/integration/types.d.ts
413
- type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'n8n' | 'ai-nexus' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'sentry' | 'readwise';
414
- type IntegrationDetails = {
415
- type: IntegrationType;
416
- name: string;
417
- description?: string;
418
- logoUrl?: string;
419
- logoUrlDark?: string;
420
- slug?: string;
421
- category?: string;
422
- [key: string]: unknown;
423
- };
424
- type Integration = {
425
- id: string;
426
- type: IntegrationType;
427
- name: string;
428
- active: boolean;
429
- createdAt: string;
430
- details?: IntegrationDetails;
431
- };
432
- type EmailProvider = 'resend' | 'mailgun' | 'sendgrid';
433
- type RoomKind = 'default' | 'phone' | 'meeting';
434
- type Room = {
435
- id: string;
436
- name: string;
437
- description: string | null;
438
- public: boolean;
439
- default: boolean;
440
- active: boolean;
441
- kind?: RoomKind | null;
442
- archivedAt?: string | null;
443
- secKey: string | null;
444
- createdAt: string | null;
445
- contactId?: string | null;
446
- agent: AgentSimple;
447
- integration: Integration | null;
448
- }; //#endregion
449
- //#region src/agent/types.d.ts
450
- type AgentPrivate = {
451
- uuid: string;
452
- name: string;
453
- description: string;
454
- avatar: string;
455
- wallets: Wallet[];
456
- settings: AgentSettings;
457
- marketplace: MarketplaceInfo;
458
- password: string | null;
459
- authKey: string | null;
460
- secKey: string;
461
- emailAddress: string | null;
462
- phoneNumber: string | null;
463
- room: Room;
464
- role: string | null;
465
- blueprint: Blueprint | null;
466
- justCreated?: boolean;
467
- team: string;
468
- };
469
- type AgentSimple = {
470
- uuid: string;
471
- name: string;
472
- };
473
- type AgentEngine = 'cortex' | 'openclaw';
474
- type AgentGender = 'male' | 'female' | 'neutral';
475
- type AgentSettings = {
476
- auto: boolean;
477
- 'model.url': string;
478
- 'voice.output': boolean;
479
- 'voice.id': string;
480
- 'agent.gender'?: AgentGender;
481
- 'proactivity.enabled': boolean;
482
- 'proactivity.quietHoursStart'?: number;
483
- 'proactivity.quietHoursEnd'?: number;
484
- 'proactivity.maxMessagesPerDay'?: number;
485
- 'proactivity.timezone'?: string;
486
- 'proactivity.blockedBehaviors'?: string[];
487
- engine: AgentEngine;
488
- 'training.url'?: string | null;
489
- 'training.status'?: 'idle' | 'training' | 'completed' | 'failed' | null;
490
- 'training.recrawlInterval'?: number | null;
491
- 'email_provider'?: EmailProvider | null;
492
- };
493
- //#endregion
494
499
  //#region src/contact/types.d.ts
495
500
  type Contact = {
496
501
  id: string;
@@ -510,6 +515,10 @@ type Contact = {
510
515
  locale?: string | null;
511
516
  props?: Record<string, string> | null;
512
517
  };
518
+ type ContactActivityAuthor = {
519
+ name: string;
520
+ imageUrl: string | null;
521
+ };
513
522
  type ContactActivity = {
514
523
  id: string;
515
524
  type: 'note' | 'call' | 'meeting' | 'email' | 'task' | 'update' | 'custom';
@@ -517,6 +526,7 @@ type ContactActivity = {
517
526
  meta: Record<string, any> | null;
518
527
  agentName: string | null;
519
528
  createdAt: string;
529
+ author?: ContactActivityAuthor | null;
520
530
  };
521
531
  type ContactFormData = {
522
532
  name?: string;
@@ -673,11 +683,11 @@ type Reminder = {
673
683
  type Service = {
674
684
  id: string;
675
685
  slug: string;
676
- name: string;
686
+ name: TranslatableValue;
677
687
  price: number;
678
688
  durationMinutes: number;
679
689
  category: string | null;
680
- description: string | null;
690
+ description: TranslatableValue | null;
681
691
  active: boolean;
682
692
  digital: boolean;
683
693
  public: boolean;
@@ -723,25 +733,18 @@ type BrandSiteConfig = {
723
733
  //#region src/link/types.d.ts
724
734
  type Link = {
725
735
  id: string;
726
- slug: string;
727
736
  url: string;
728
737
  shortUrl: string;
729
738
  status: 'active' | 'paused' | 'expired';
730
739
  title: string | null;
731
740
  scanCount: number;
732
- maxScans: number | null;
733
- startsAt: string | null;
734
- expiresAt: string | null;
741
+ lastScannedAt: string | null;
735
742
  createdAt: string;
736
743
  updatedAt: string;
737
744
  };
738
745
  type LinkCreatePayload = {
739
746
  url: string;
740
747
  title: string;
741
- maxScans?: number;
742
- startsAt?: string;
743
- expiresAt?: string;
744
- status?: 'active' | 'paused' | 'expired';
745
748
  };
746
749
  type LinkUpdatePayload = Partial<LinkCreatePayload>; //#endregion
747
750
  //#region src/store/types.d.ts
@@ -993,7 +996,41 @@ declare class MemoriesResource {
993
996
  delete(id: string): Promise<IAppResponse<unknown>>;
994
997
  }
995
998
  //#endregion
999
+ //#region src/resources/orders.d.ts
1000
+ type OrderItem = {
1001
+ id: string;
1002
+ type: 'product' | 'service';
1003
+ quantity: number;
1004
+ };
1005
+ type Order = {
1006
+ id: string;
1007
+ total: number;
1008
+ status: string;
1009
+ paymentUrl: string | null;
1010
+ invoiceUrl: string | null;
1011
+ };
1012
+ declare class OrdersResource {
1013
+ private readonly http;
1014
+ constructor(http: IHttpService);
1015
+ create(data: {
1016
+ contactId: string;
1017
+ items: OrderItem[];
1018
+ }): Promise<IAppResponse<Order>>;
1019
+ }
1020
+ //#endregion
996
1021
  //#region src/resources/products.d.ts
1022
+ type ProductVariation = {
1023
+ id: string;
1024
+ sku: string;
1025
+ name: string;
1026
+ description: string | null;
1027
+ price: number;
1028
+ badge: string;
1029
+ meta: Record<string, unknown> | null;
1030
+ active: boolean;
1031
+ order: number | null;
1032
+ type: string | null;
1033
+ };
997
1034
  type ProductItem = {
998
1035
  id: string;
999
1036
  slug: string;
@@ -1003,6 +1040,10 @@ type ProductItem = {
1003
1040
  tags: string[];
1004
1041
  description: string;
1005
1042
  active: boolean;
1043
+ createdAt?: string;
1044
+ updatedAt?: string;
1045
+ variations?: ProductVariation[];
1046
+ settings?: Record<string, unknown> | null;
1006
1047
  };
1007
1048
  declare class ProductsResource {
1008
1049
  private readonly http;
@@ -1103,7 +1144,7 @@ declare class UpdatesResource {
1103
1144
  data: Update[];
1104
1145
  }>>;
1105
1146
  create(payload: UpdateCreatePayload): Promise<IAppResponse<Update>>;
1106
- update(id: string, payload: UpdateUpdatePayload): any;
1147
+ update(id: string, payload: UpdateUpdatePayload): Promise<IAppResponse<Update>>;
1107
1148
  delete(id: string): Promise<IAppResponse<unknown>>;
1108
1149
  }
1109
1150
  //#endregion
@@ -1118,7 +1159,7 @@ declare class LinksResource {
1118
1159
  data: Link[];
1119
1160
  }>>;
1120
1161
  create(payload: LinkCreatePayload): Promise<IAppResponse<Link>>;
1121
- update(id: string, payload: LinkUpdatePayload): any;
1162
+ update(id: string, payload: LinkUpdatePayload): Promise<IAppResponse<Link>>;
1122
1163
  delete(id: string): Promise<IAppResponse<unknown>>;
1123
1164
  }
1124
1165
  //#endregion
@@ -1143,6 +1184,16 @@ declare class WarpsResource {
1143
1184
  brand: string;
1144
1185
  definition: Record<string, any>;
1145
1186
  public?: boolean;
1187
+ agent?: string | null;
1188
+ }): Promise<IAppResponse<{
1189
+ id: string;
1190
+ url: string;
1191
+ definition: Record<string, any>;
1192
+ brand: any;
1193
+ }>>;
1194
+ update(identifier: string, data: {
1195
+ definition?: Record<string, any>;
1196
+ agent?: string | null;
1146
1197
  }): Promise<IAppResponse<{
1147
1198
  id: string;
1148
1199
  }>>;
@@ -1195,6 +1246,7 @@ declare class JoAiClient {
1195
1246
  readonly memories: MemoriesResource;
1196
1247
  readonly goals: GoalsResource;
1197
1248
  readonly reminders: RemindersResource;
1249
+ readonly orders: OrdersResource;
1198
1250
  readonly products: ProductsResource;
1199
1251
  readonly sites: SitesResource;
1200
1252
  readonly documents: DocumentsResource;
@@ -1229,6 +1281,7 @@ declare class CachedHttpService implements IHttpService {
1229
1281
  get<T>(url: string, options?: IRequestOptions): Promise<IAppResponse<T>>;
1230
1282
  post<T>(url: string, data?: any, options?: IRequestOptions): Promise<IAppResponse<T>>;
1231
1283
  put<T>(url: string, data?: any, options?: IRequestOptions): Promise<IAppResponse<T>>;
1284
+ patch<T>(url: string, data?: any, options?: IRequestOptions): Promise<IAppResponse<T>>;
1232
1285
  delete<T>(url: string, options?: IRequestOptions): Promise<IAppResponse<T>>;
1233
1286
  }
1234
1287
  //#endregion
@@ -1238,4 +1291,4 @@ declare class DistributionResource {
1238
1291
  private fetchDistribution;
1239
1292
  }
1240
1293
  //#endregion
1241
- export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type ProductItem, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
1294
+ export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type Order, type OrderItem, OrdersResource, type ProductItem, type ProductVariation, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
package/dist/index.mjs CHANGED
@@ -12,6 +12,7 @@ var HttpService = class {
12
12
  this.get = async (url, options) => await this.request("GET", url, void 0, options);
13
13
  this.post = async (url, data, options) => await this.request("POST", url, data, options);
14
14
  this.put = async (url, data, options) => await this.request("PUT", url, data, options);
15
+ this.patch = async (url, data, options) => await this.request("PATCH", url, data, options);
15
16
  this.delete = async (url, options) => await this.request("DELETE", url, void 0, options);
16
17
  this.getCsrfToken = () => {
17
18
  if (typeof document === "undefined") return null;
@@ -393,6 +394,16 @@ var MemoriesResource = class {
393
394
  }
394
395
  };
395
396
  //#endregion
397
+ //#region src/resources/orders.ts
398
+ var OrdersResource = class {
399
+ constructor(http) {
400
+ this.http = http;
401
+ }
402
+ create(data) {
403
+ return this.http.post("orders", data);
404
+ }
405
+ };
406
+ //#endregion
396
407
  //#region src/resources/products.ts
397
408
  var ProductsResource = class {
398
409
  constructor(http) {
@@ -575,6 +586,9 @@ var WarpsResource = class {
575
586
  create(data) {
576
587
  return this.http.post("warps", data);
577
588
  }
589
+ update(identifier, data) {
590
+ return this.http.put(`warps/${identifier}`, data);
591
+ }
578
592
  destroy(identifier) {
579
593
  return this.http.delete(`warps/${identifier}`);
580
594
  }
@@ -696,6 +710,11 @@ var CachedHttpService = class {
696
710
  this.cache.bust(getUrlPrefix(url));
697
711
  return response;
698
712
  }
713
+ async patch(url, data, options) {
714
+ const response = await this.inner.patch(url, data, options);
715
+ this.cache.bust(getUrlPrefix(url));
716
+ return response;
717
+ }
699
718
  async delete(url, options) {
700
719
  const response = await this.inner.delete(url, options);
701
720
  this.cache.bust(getUrlPrefix(url));
@@ -738,6 +757,7 @@ var JoAiClient = class {
738
757
  this.meetings = new MeetingsResource(this.http);
739
758
  this.stores = new StoresResource(this.http);
740
759
  this.products = new ProductsResource(this.http);
760
+ this.orders = new OrdersResource(this.http);
741
761
  this.updates = new UpdatesResource(this.http);
742
762
  this.links = new LinksResource(this.http);
743
763
  this.privateWarps = new WarpsResource(this.http);
@@ -785,4 +805,4 @@ var DistributionResource = class {
785
805
  }
786
806
  };
787
807
  //#endregion
788
- export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
808
+ export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, OrdersResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",