@joai/sdk 0.17.2 → 0.18.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.
Files changed (3) hide show
  1. package/dist/index.d.mts +2182 -485
  2. package/dist/index.mjs +1245 -258
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -110,6 +110,110 @@ var HttpService = class {
110
110
  }
111
111
  };
112
112
  //#endregion
113
+ //#region src/resources/agents.ts
114
+ var AgentsResource = class {
115
+ constructor(http) {
116
+ this.http = http;
117
+ }
118
+ list(team) {
119
+ const url = team ? `agents?team=${team}` : "agents?me=true";
120
+ return this.http.get(url);
121
+ }
122
+ async get(uuid) {
123
+ const res = await this.http.get(`agents/${uuid}`);
124
+ return res.ok ? res.data : null;
125
+ }
126
+ create(params) {
127
+ return this.http.post("agents", params);
128
+ }
129
+ update(uuid, name, description, avatar) {
130
+ return this.http.put(`agents/${uuid}`, {
131
+ name,
132
+ description,
133
+ avatar
134
+ });
135
+ }
136
+ delete(uuid) {
137
+ return this.http.delete(`agents/${uuid}`);
138
+ }
139
+ updatePassword(uuid, password) {
140
+ return this.http.put(`agents/${uuid}/password`, { password });
141
+ }
142
+ storePassword(uuid, password) {
143
+ return this.http.post(`agents/${uuid}/password`, { password });
144
+ }
145
+ updateSetting(uuid, key, value) {
146
+ return this.http.put(`agents/${uuid}/settings/${key}`, { value });
147
+ }
148
+ updateMeta(uuid, key, value) {
149
+ return this.http.put(`agents/${uuid}/meta/${key}`, { value });
150
+ }
151
+ publish(uuid) {
152
+ return this.http.post(`agents/${uuid}/publish`, {});
153
+ }
154
+ unpublish(uuid) {
155
+ return this.http.delete(`agents/${uuid}/publish`);
156
+ }
157
+ moveToTeam(uuid, teamSlug) {
158
+ return this.http.put(`agents/${uuid}/team`, { teamSlug });
159
+ }
160
+ getActions(uuid, page = 1) {
161
+ return this.http.get(`agents/${uuid}/actions?page=${page}`);
162
+ }
163
+ provisionPhone(uuid) {
164
+ return this.http.post(`integrations/${uuid}/phone/provision`);
165
+ }
166
+ execute(agentUuid, payload) {
167
+ const { audio, media, ghost, context } = payload;
168
+ const mediaIds = media?.map((m) => m.id);
169
+ if (audio) {
170
+ const formData = new FormData();
171
+ formData.append("audio", audio, audio.name);
172
+ formData.append("sender", payload.sender);
173
+ formData.append("room", payload.room);
174
+ formData.append("message", payload.message);
175
+ if (mediaIds) formData.append("media", JSON.stringify(mediaIds));
176
+ formData.append("preferences[ghost]", ghost ? "1" : "0");
177
+ if (context) Object.entries(context).forEach(([key, value]) => {
178
+ if (Array.isArray(value)) value.forEach((v) => formData.append(`context[${key}][]`, String(v)));
179
+ else if (value != null) formData.append(`context[${key}]`, String(value));
180
+ });
181
+ return this.http.post(`agents/${agentUuid}/execute`, formData, { isJson: false });
182
+ }
183
+ return this.http.post(`agents/${agentUuid}/execute`, {
184
+ sender: payload.sender,
185
+ room: payload.room,
186
+ message: payload.message,
187
+ media: mediaIds,
188
+ context,
189
+ preferences: { ghost: ghost ?? false }
190
+ });
191
+ }
192
+ actionCallback(agent, room, action, result) {
193
+ return this.http.post(`agents/${agent}/action-callback`, {
194
+ room,
195
+ action,
196
+ result
197
+ });
198
+ }
199
+ };
200
+ //#endregion
201
+ //#region src/resources/alerts.ts
202
+ var AlertsResource = class {
203
+ constructor(http) {
204
+ this.http = http;
205
+ }
206
+ list(agent, page = 1) {
207
+ return this.http.get(`alerts?agent=${agent}&page=${page}`);
208
+ }
209
+ delete(id) {
210
+ return this.http.delete(`alerts/${id}`);
211
+ }
212
+ toggle(id) {
213
+ return this.http.post(`alerts/${id}/toggle`);
214
+ }
215
+ };
216
+ //#endregion
113
217
  //#region src/resources/appointments.ts
114
218
  const WEEKDAYS = [
115
219
  "monday",
@@ -223,23 +327,6 @@ var AppointmentsResource = class {
223
327
  }
224
328
  };
225
329
  //#endregion
226
- //#region src/resources/agents.ts
227
- var AgentsResource = class {
228
- constructor(http) {
229
- this.http = http;
230
- }
231
- list() {
232
- return this.http.get("agents");
233
- }
234
- async get(uuid) {
235
- const res = await this.http.get(`agents/${uuid}`);
236
- return res.ok ? res.data : null;
237
- }
238
- execute(agentUuid, payload) {
239
- return this.http.post(`agents/${agentUuid}/execute`, payload);
240
- }
241
- };
242
- //#endregion
243
330
  //#region src/resources/auth.ts
244
331
  var AuthResource = class {
245
332
  constructor(http) {
@@ -248,6 +335,15 @@ var AuthResource = class {
248
335
  sendCode(data) {
249
336
  return this.http.post("auth/send-code", data);
250
337
  }
338
+ requestEmail(email, redirect) {
339
+ return this.http.post("auth/email/request", {
340
+ email,
341
+ redirect
342
+ });
343
+ }
344
+ loginWithSocialAccessToken(provider, accessToken) {
345
+ return this.http.get(`auth/social/${provider}/callback?access_token=${accessToken}`);
346
+ }
251
347
  verify(token) {
252
348
  return this.http.get("auth/verify?token=" + token);
253
349
  }
@@ -257,6 +353,90 @@ var AuthResource = class {
257
353
  logout() {
258
354
  return this.http.post("auth/logout");
259
355
  }
356
+ createApiToken() {
357
+ return this.http.post("auth/api-tokens");
358
+ }
359
+ verifyWallet(accessToken, withMobileApiToken) {
360
+ return this.http.post("auth/wallet/verify", {
361
+ accessToken,
362
+ withMobileApiToken
363
+ });
364
+ }
365
+ };
366
+ //#endregion
367
+ //#region src/resources/billing-addresses.ts
368
+ var BillingAddressesResource = class {
369
+ constructor(http) {
370
+ this.http = http;
371
+ }
372
+ get(contact, team) {
373
+ const params = new URLSearchParams();
374
+ if (contact) params.set("contact", contact);
375
+ if (team) params.set("team", team);
376
+ const qs = params.toString();
377
+ return this.http.get(`billing/addresses${qs ? "?" + qs : ""}`);
378
+ }
379
+ store(data) {
380
+ return this.http.post("billing/addresses", data);
381
+ }
382
+ };
383
+ //#endregion
384
+ //#region src/resources/billing.ts
385
+ var BillingResource = class {
386
+ constructor(http) {
387
+ this.http = http;
388
+ }
389
+ plans(type = "current") {
390
+ return this.http.get(`billing/plans?type=${type}`);
391
+ }
392
+ checkoutProduct(id) {
393
+ return this.http.get(`billing/products/${id}`);
394
+ }
395
+ orders(team, page = 1, contactId) {
396
+ let params = team ? `billing/orders?team=${team.slug}&page=${page}` : `billing/orders?page=${page}`;
397
+ if (contactId) params += `&contactId=${encodeURIComponent(contactId)}`;
398
+ return this.http.get(params);
399
+ }
400
+ payOrder(id, provider) {
401
+ return this.http.post(`billing/orders/${id}/pay`, { provider });
402
+ }
403
+ deleteOrder(id) {
404
+ return this.http.delete(`billing/orders/${id}`);
405
+ }
406
+ paymentAccount(team, provider) {
407
+ return this.http.get(`payment-accounts/${provider}`, { headers: { "X-Team": team } });
408
+ }
409
+ createPaymentAccountOnboarding(team, provider) {
410
+ return this.http.post(`payment-accounts/${provider}/onboarding`, void 0, { headers: { "X-Team": team } });
411
+ }
412
+ updatePaymentAccount(team, provider, input) {
413
+ return this.http.put(`payment-accounts/${provider}`, input, { headers: { "X-Team": team } });
414
+ }
415
+ createTerminalConnectionToken(team, provider) {
416
+ return this.http.post(`payment-accounts/${provider}/terminal/connection-token`, void 0, { headers: { "X-Team": team } });
417
+ }
418
+ createTerminalPaymentIntent(orderId, provider) {
419
+ return this.http.post(`orders/${orderId}/terminal/${provider}/payment-intent`);
420
+ }
421
+ captureTerminalPaymentIntent(orderId, provider, paymentIntentId) {
422
+ return this.http.post(`orders/${orderId}/terminal/${provider}/capture`, { paymentIntentId });
423
+ }
424
+ cancelTerminalPaymentIntent(orderId, provider, paymentIntentId) {
425
+ return this.http.post(`orders/${orderId}/terminal/${provider}/cancel`, { paymentIntentId });
426
+ }
427
+ verifyIap(receipt, team, meta) {
428
+ if (receipt.platform === "ios") return this.http.post("billing/gateways/apple/validate-receipt", {
429
+ receipt_data: receipt.receipt,
430
+ team,
431
+ ...meta
432
+ });
433
+ return this.http.post("billing/gateways/google/validate-receipt", {
434
+ product_id: receipt.productId,
435
+ purchase_token: receipt.receipt,
436
+ team,
437
+ ...meta
438
+ });
439
+ }
260
440
  };
261
441
  //#endregion
262
442
  //#region src/resources/blueprints.ts
@@ -274,6 +454,45 @@ var BlueprintsResource = class {
274
454
  get(slug, locale = "en") {
275
455
  return this.http.get(`blueprints/${slug}?locale=${locale}`);
276
456
  }
457
+ create(data) {
458
+ return this.http.post("blueprints", data);
459
+ }
460
+ assemble(blueprint, team, name) {
461
+ return this.http.post("blueprints/assemble", {
462
+ blueprint,
463
+ team,
464
+ name
465
+ });
466
+ }
467
+ };
468
+ //#endregion
469
+ //#region src/resources/cards.ts
470
+ var CardsResource = class {
471
+ constructor(http) {
472
+ this.http = http;
473
+ }
474
+ list(agent) {
475
+ return this.http.get(`cards?agent=${agent}`);
476
+ }
477
+ create(agent, warp, inputs = []) {
478
+ return this.http.post("cards", {
479
+ agent,
480
+ warp,
481
+ inputs
482
+ });
483
+ }
484
+ update(id, warp, inputs = []) {
485
+ return this.http.put(`cards/${id}`, {
486
+ warp,
487
+ inputs
488
+ });
489
+ }
490
+ delete(id) {
491
+ return this.http.delete(`cards/${id}`);
492
+ }
493
+ toggle(id) {
494
+ return this.http.post(`cards/${id}/toggle`);
495
+ }
277
496
  };
278
497
  //#endregion
279
498
  //#region src/resources/carts.ts
@@ -313,113 +532,16 @@ var CartsResource = class {
313
532
  }
314
533
  };
315
534
  //#endregion
316
- //#region src/resources/flows.ts
317
- var FlowsResource = class {
318
- constructor(http) {
319
- this.http = http;
320
- }
321
- list(params) {
322
- const query = new URLSearchParams();
323
- if (params?.locale) query.set("locale", params.locale);
324
- if (params?.page !== void 0) query.set("page", String(params.page));
325
- const qs = query.toString();
326
- return this.http.get(qs ? `flows?${qs}` : "flows");
327
- }
328
- get(slug, locale = "en") {
329
- return this.http.get(`flows/${slug}?locale=${locale}`);
330
- }
331
- };
332
- //#endregion
333
- //#region src/resources/marketplace.ts
334
- var MarketplaceResource = class {
335
- constructor(http) {
336
- this.http = http;
337
- }
338
- async get(locale = "en") {
339
- const res = await this.http.get(`marketplace?locale=${locale}`);
340
- if (!res.ok || !res.data) return {
341
- blueprints: [],
342
- skills: [],
343
- flows: [],
344
- creators: [],
345
- agents: [],
346
- items: []
347
- };
348
- const { blueprints = [], skills = [], flows = [], creators = [], agents = [] } = res.data;
349
- return {
350
- blueprints,
351
- skills,
352
- flows,
353
- creators,
354
- agents,
355
- items: [
356
- ...agents.map((item) => ({
357
- type: "agent",
358
- item
359
- })),
360
- ...blueprints.map((item) => ({
361
- type: "blueprint",
362
- item
363
- })),
364
- ...flows.map((item) => ({
365
- type: "flow",
366
- item
367
- })),
368
- ...skills.map((item) => ({
369
- type: "skill",
370
- item
371
- }))
372
- ]
373
- };
374
- }
375
- };
376
- //#endregion
377
- //#region src/resources/services.ts
378
- var ServicesResource = class {
379
- constructor(http) {
380
- this.http = http;
381
- }
382
- list(team) {
383
- const url = team ? `services?team=${encodeURIComponent(team)}` : "services";
384
- return this.http.get(url);
385
- }
386
- get(slug) {
387
- return this.http.get(`services/${slug}`);
388
- }
389
- store(team, data) {
390
- return this.http.post("services", {
391
- team,
392
- ...data
393
- });
394
- }
395
- update(id, data) {
396
- return this.http.put(`services/${id}`, data);
397
- }
398
- delete(id) {
399
- return this.http.delete(`services/${id}`);
400
- }
401
- };
402
- //#endregion
403
- //#region src/resources/skills.ts
404
- var SkillsResource = class {
535
+ //#region src/resources/changelog.ts
536
+ var ChangelogResource = class {
405
537
  constructor(http) {
406
538
  this.http = http;
407
539
  }
408
- get(id) {
409
- return this.http.get(`skills/${id}`);
410
- }
411
- };
412
- //#endregion
413
- //#region src/resources/hub.ts
414
- var HubResource = class {
415
- constructor(http) {
416
- this.http = http;
540
+ get(locale) {
541
+ return this.http.get(`changelog?locale=${locale}`);
417
542
  }
418
- subscribe(email, tag) {
419
- return this.http.post("hub/subscribe", {
420
- email,
421
- tag
422
- });
543
+ subscribe(email) {
544
+ return this.http.post("changelog/subscribe", { email });
423
545
  }
424
546
  };
425
547
  //#endregion
@@ -430,7 +552,7 @@ var ContactsResource = class {
430
552
  }
431
553
  list(params) {
432
554
  const query = new URLSearchParams();
433
- if (params?.search) query.set("search", params.search);
555
+ if (params?.search) query.set("filter[search]", params.search);
434
556
  if (params?.page) query.set("page", String(params.page));
435
557
  const qs = query.toString();
436
558
  return this.http.get(`contacts${qs ? "?" + qs : ""}`);
@@ -462,6 +584,60 @@ var ContactsResource = class {
462
584
  deleteActivity(id, activityId) {
463
585
  return this.http.delete(`contacts/${id}/activities/${activityId}`);
464
586
  }
587
+ send(id, message, integration) {
588
+ return this.http.post(`contacts/${id}/send`, {
589
+ message,
590
+ integration
591
+ });
592
+ }
593
+ };
594
+ //#endregion
595
+ //#region src/resources/contracts.ts
596
+ var ContractsResource = class {
597
+ constructor(http) {
598
+ this.http = http;
599
+ }
600
+ list(agentUuid) {
601
+ return this.http.get(`contracts?agent=${agentUuid}`);
602
+ }
603
+ get(uuid) {
604
+ return this.http.get(`contracts/${uuid}`);
605
+ }
606
+ create(agentUuid, name, chain, category = "default", isPublic = false, description) {
607
+ return this.http.post("contracts", {
608
+ agent: agentUuid,
609
+ name,
610
+ chain,
611
+ category,
612
+ public: isPublic,
613
+ description
614
+ });
615
+ }
616
+ update(uuid, data) {
617
+ return this.http.put(`contracts/${uuid}`, data);
618
+ }
619
+ delete(uuid) {
620
+ return this.http.delete(`contracts/${uuid}`);
621
+ }
622
+ deploy(uuid, env, txHash, type) {
623
+ return this.http.post(`contracts/${uuid}/deployment`, {
624
+ env,
625
+ tx: txHash,
626
+ type
627
+ });
628
+ }
629
+ setAddress(uuid, env, address) {
630
+ return this.http.post(`contracts/${uuid}/addresses`, {
631
+ env,
632
+ address
633
+ });
634
+ }
635
+ resetAddress(uuid, env) {
636
+ return this.http.post(`contracts/${uuid}/reset`, { env });
637
+ }
638
+ listVersions(uuid) {
639
+ return this.http.get(`contracts/${uuid}/versions`);
640
+ }
465
641
  };
466
642
  //#endregion
467
643
  //#region src/resources/documents.ts
@@ -486,80 +662,60 @@ var DocumentsResource = class {
486
662
  delete(id) {
487
663
  return this.http.delete(`documents/${id}`);
488
664
  }
665
+ trainFromUrl(agent, url) {
666
+ return this.http.post("documents/training/url", {
667
+ agent,
668
+ url
669
+ });
670
+ }
489
671
  };
490
672
  //#endregion
491
- //#region src/resources/goals.ts
492
- var GoalsResource = class {
673
+ //#region src/resources/flows.ts
674
+ var FlowsResource = class {
493
675
  constructor(http) {
494
676
  this.http = http;
495
677
  }
496
- list() {
497
- return this.http.get("goals");
498
- }
499
- create(payload) {
500
- return this.http.post("goals", payload);
678
+ list(params) {
679
+ const query = new URLSearchParams();
680
+ if (params?.locale) query.set("locale", params.locale);
681
+ if (params?.page !== void 0) query.set("page", String(params.page));
682
+ const qs = query.toString();
683
+ return this.http.get(qs ? `flows?${qs}` : "flows");
501
684
  }
502
- update(id, data) {
503
- return this.http.put(`goals/${id}`, data);
685
+ get(slug, locale = "en") {
686
+ return this.http.get(`flows/${slug}?locale=${locale}`);
504
687
  }
505
688
  };
506
689
  //#endregion
507
- //#region src/resources/meetings.ts
508
- var MeetingsResource = class {
509
- constructor(http, config) {
690
+ //#region src/resources/goals.ts
691
+ var GoalsResource = class {
692
+ constructor(http) {
510
693
  this.http = http;
511
- this.config = config;
512
694
  }
513
- listUpcoming() {
514
- return this.http.get(`teams/${this.config.team}/meetings/upcoming`);
515
- }
516
- get(id) {
517
- return this.http.get(`meetings/${id}`);
518
- }
519
- getSummary(id) {
520
- return this.http.get(`meetings/${id}/summary`);
521
- }
522
- join(code) {
523
- return this.http.get(`meetings/join/${code}`);
524
- }
525
- cancel(code) {
526
- return this.http.post(`meetings/cancel/${code}`, {});
695
+ list() {
696
+ return this.http.get("goals");
527
697
  }
528
- share(id, recipients) {
529
- return this.http.post(`meetings/${id}/share`, { recipients });
698
+ create(payload) {
699
+ return this.http.post("goals", payload);
530
700
  }
531
- update(id, name, notify, speakers) {
532
- return this.http.put(`meetings/${id}`, {
533
- name,
534
- ...notify !== void 0 && { notify },
535
- ...speakers !== void 0 && { speakers }
536
- });
701
+ update(id, data) {
702
+ return this.http.put(`goals/${id}`, data);
537
703
  }
538
- finalize(id, notify) {
539
- return this.http.post(`meetings/${id}/finalize`, { notify });
704
+ delete(id) {
705
+ return this.http.delete(`goals/${id}`);
540
706
  }
541
707
  };
542
708
  //#endregion
543
- //#region src/resources/media.ts
544
- var MediaResource = class {
709
+ //#region src/resources/hub.ts
710
+ var HubResource = class {
545
711
  constructor(http) {
546
712
  this.http = http;
547
713
  }
548
- listPublic(params) {
549
- const query = new URLSearchParams();
550
- if (params?.tags) query.set("tags", params.tags);
551
- if (params?.team) query.set("team", params.team);
552
- if (params?.mime) query.set("mime", params.mime);
553
- const qs = query.toString();
554
- return this.http.get(`media/public${qs ? "?" + qs : ""}`);
555
- }
556
- upload(data) {
557
- const formData = new FormData();
558
- formData.append("file", data.file, data.file.name);
559
- formData.append("type", data.type);
560
- if (data.label) formData.append("label", data.label);
561
- if (data.tags) data.tags.forEach((t) => formData.append("tags[]", t));
562
- return this.http.post("media", formData, { headers: { "X-Team": data.team } });
714
+ subscribe(email, tag) {
715
+ return this.http.post("hub/subscribe", {
716
+ email,
717
+ tag
718
+ });
563
719
  }
564
720
  };
565
721
  //#endregion
@@ -579,6 +735,79 @@ var IngestionsResource = class {
579
735
  }
580
736
  };
581
737
  //#endregion
738
+ //#region src/resources/inquiries.ts
739
+ var InquiriesResource = class {
740
+ constructor(http) {
741
+ this.http = http;
742
+ }
743
+ create(content, type, message) {
744
+ return this.http.post("inquiries", {
745
+ content,
746
+ type,
747
+ message
748
+ });
749
+ }
750
+ };
751
+ //#endregion
752
+ //#region src/resources/integrations.ts
753
+ var IntegrationsResource = class {
754
+ constructor(http) {
755
+ this.http = http;
756
+ }
757
+ list(agent, page = 1) {
758
+ return this.http.get(`integrations?agent=${agent}&page=${page}`);
759
+ }
760
+ delete(id) {
761
+ return this.http.delete(`integrations/${id}`);
762
+ }
763
+ toggle(id) {
764
+ return this.http.post(`integrations/${id}/toggle`);
765
+ }
766
+ storeBot(platform, agent, data) {
767
+ return this.http.post(`integrations/${platform}/${agent}/bot`, data);
768
+ }
769
+ getBot(platform, agent) {
770
+ return this.http.get(`integrations/${platform}/${agent}/bot`);
771
+ }
772
+ storeWhatsAppEmbeddedSignup(agent, data) {
773
+ return this.http.post("integrations/whatsapp/" + agent + "/embedded-signup", data);
774
+ }
775
+ reconfigureWhatsAppWebhook(agent) {
776
+ return this.http.post("integrations/whatsapp/" + agent + "/reconfigure");
777
+ }
778
+ getXStatus(agent) {
779
+ return this.http.get("integrations/x/" + agent + "/status");
780
+ }
781
+ setupX(agent) {
782
+ return this.http.post("integrations/x/" + agent + "/setup");
783
+ }
784
+ getCalendarStatus(agent) {
785
+ return this.http.get("integrations/calendar/" + agent);
786
+ }
787
+ syncCalendar(agent) {
788
+ return this.http.post("integrations/calendar/" + agent + "/sync");
789
+ }
790
+ deleteCalendar(agent) {
791
+ return this.http.delete("integrations/calendar/" + agent);
792
+ }
793
+ getEmbedStatus(agentUuid) {
794
+ return this.http.get("integrations/embed/" + agentUuid);
795
+ }
796
+ setupEmbed(agentUuid, allowedDomains) {
797
+ return this.http.post("integrations/embed/" + agentUuid + "/setup", { allowedDomains });
798
+ }
799
+ };
800
+ //#endregion
801
+ //#region src/resources/intents.ts
802
+ var IntentsResource = class {
803
+ constructor(http) {
804
+ this.http = http;
805
+ }
806
+ getUnseen(agent) {
807
+ return this.http.get(`intents?agent=${agent}&unseen`);
808
+ }
809
+ };
810
+ //#endregion
582
811
  //#region src/resources/items.ts
583
812
  var ItemsResource = class {
584
813
  constructor(http) {
@@ -602,6 +831,255 @@ var ItemsResource = class {
602
831
  delete(id) {
603
832
  return this.http.delete(`items/${id}`);
604
833
  }
834
+ sort(team, itemIds) {
835
+ return this.http.post("items/sort", {
836
+ team,
837
+ itemIds
838
+ });
839
+ }
840
+ };
841
+ //#endregion
842
+ //#region src/resources/links.ts
843
+ var LinksResource = class {
844
+ constructor(http) {
845
+ this.http = http;
846
+ }
847
+ list(params) {
848
+ const query = new URLSearchParams();
849
+ if (params?.type) query.set("type", params.type);
850
+ if (params?.active != null) query.set("active", String(params.active));
851
+ const qs = query.toString();
852
+ return this.http.get(`links${qs ? "?" + qs : ""}`);
853
+ }
854
+ create(payload) {
855
+ return this.http.post("links", payload);
856
+ }
857
+ update(id, payload) {
858
+ return this.http.patch(`links/${id}`, payload);
859
+ }
860
+ delete(id) {
861
+ return this.http.delete(`links/${id}`);
862
+ }
863
+ stats() {
864
+ return this.http.get("links/stats");
865
+ }
866
+ variations(linkId) {
867
+ return this.http.get(`links/${linkId}/variations`);
868
+ }
869
+ createVariation(linkId, payload) {
870
+ return this.http.post(`links/${linkId}/variations`, payload);
871
+ }
872
+ createVariationBatch(linkId, payload) {
873
+ return this.http.post(`links/${linkId}/variations/batch`, payload);
874
+ }
875
+ deleteVariation(linkId, variationId) {
876
+ return this.http.delete(`links/${linkId}/variations/${variationId}`);
877
+ }
878
+ };
879
+ //#endregion
880
+ //#region src/resources/loyalty.ts
881
+ var LoyaltyResource = class {
882
+ constructor(http) {
883
+ this.http = http;
884
+ }
885
+ getProgram() {
886
+ return this.http.get("loyalty/program");
887
+ }
888
+ updateProgram(data) {
889
+ return this.http.patch("loyalty/program", data);
890
+ }
891
+ getRewards() {
892
+ return this.http.get("loyalty/rewards");
893
+ }
894
+ createReward(data) {
895
+ return this.http.post("loyalty/rewards", data);
896
+ }
897
+ updateReward(id, data) {
898
+ return this.http.patch(`loyalty/rewards/${id}`, data);
899
+ }
900
+ deleteReward(id) {
901
+ return this.http.delete(`loyalty/rewards/${id}`);
902
+ }
903
+ getTiers() {
904
+ return this.http.get("loyalty/tiers");
905
+ }
906
+ createTier(data) {
907
+ return this.http.post("loyalty/tiers", data);
908
+ }
909
+ updateTier(id, data) {
910
+ return this.http.patch(`loyalty/tiers/${id}`, data);
911
+ }
912
+ deleteTier(id) {
913
+ return this.http.delete(`loyalty/tiers/${id}`);
914
+ }
915
+ getPromotions() {
916
+ return this.http.get("loyalty/promotions");
917
+ }
918
+ createPromotion(data) {
919
+ return this.http.post("loyalty/promotions", data);
920
+ }
921
+ updatePromotion(id, data) {
922
+ return this.http.patch(`loyalty/promotions/${id}`, data);
923
+ }
924
+ deletePromotion(id) {
925
+ return this.http.delete(`loyalty/promotions/${id}`);
926
+ }
927
+ enroll(contactId) {
928
+ return this.http.post("loyalty/enroll", { contactId });
929
+ }
930
+ getAccount(contactId) {
931
+ return this.http.get(`loyalty/accounts/${contactId}`);
932
+ }
933
+ earn(contactId, context) {
934
+ return this.http.post("loyalty/earn", {
935
+ contactId,
936
+ ...context
937
+ });
938
+ }
939
+ redeem(contactId, rewardId) {
940
+ return this.http.post("loyalty/redeem", {
941
+ contactId,
942
+ rewardId
943
+ });
944
+ }
945
+ adjustPoints(contactId, points, reason) {
946
+ return this.http.post("loyalty/adjust", {
947
+ contactId,
948
+ points,
949
+ reason
950
+ });
951
+ }
952
+ getTransactionHistory(contactId) {
953
+ return this.http.get(`loyalty/accounts/${contactId}/history`);
954
+ }
955
+ listMembers() {
956
+ return this.http.get("loyalty/members");
957
+ }
958
+ };
959
+ //#endregion
960
+ //#region src/resources/marketplace.ts
961
+ var MarketplaceResource = class {
962
+ constructor(http) {
963
+ this.http = http;
964
+ }
965
+ async get(locale = "en") {
966
+ const res = await this.http.get(`marketplace?locale=${locale}`);
967
+ if (!res.ok || !res.data) return {
968
+ blueprints: [],
969
+ skills: [],
970
+ flows: [],
971
+ creators: [],
972
+ agents: [],
973
+ items: []
974
+ };
975
+ const { blueprints = [], skills = [], flows = [], creators = [], agents = [] } = res.data;
976
+ return {
977
+ blueprints,
978
+ skills,
979
+ flows,
980
+ creators,
981
+ agents,
982
+ items: [
983
+ ...agents.map((item) => ({
984
+ type: "agent",
985
+ item
986
+ })),
987
+ ...blueprints.map((item) => ({
988
+ type: "blueprint",
989
+ item
990
+ })),
991
+ ...flows.map((item) => ({
992
+ type: "flow",
993
+ item
994
+ })),
995
+ ...skills.map((item) => ({
996
+ type: "skill",
997
+ item
998
+ }))
999
+ ]
1000
+ };
1001
+ }
1002
+ };
1003
+ //#endregion
1004
+ //#region src/resources/media.ts
1005
+ var MediaResource = class {
1006
+ constructor(http) {
1007
+ this.http = http;
1008
+ }
1009
+ listPublic(params) {
1010
+ const query = new URLSearchParams();
1011
+ if (params?.tags) query.set("tags", params.tags);
1012
+ if (params?.team) query.set("team", params.team);
1013
+ if (params?.mime) query.set("mime", params.mime);
1014
+ const qs = query.toString();
1015
+ return this.http.get(`media/public${qs ? "?" + qs : ""}`);
1016
+ }
1017
+ upload(data) {
1018
+ const formData = new FormData();
1019
+ formData.append("file", data.file, data.file.name);
1020
+ formData.append("type", data.type);
1021
+ if (data.label) formData.append("label", data.label);
1022
+ if (data.tags) data.tags.forEach((t) => formData.append("tags[]", t));
1023
+ return this.http.post("media", formData, { headers: { "X-Team": data.team } });
1024
+ }
1025
+ listTeam(team, params) {
1026
+ const query = new URLSearchParams();
1027
+ query.set("page", String(params?.page ?? 1));
1028
+ if (params?.mime) query.set("mime", params.mime);
1029
+ return this.http.get(`teams/${team}/media?${query.toString()}`);
1030
+ }
1031
+ uploadTeam(team, media, tags, options) {
1032
+ return this.http.post(`teams/${team}/media/upload`, {
1033
+ media,
1034
+ tags,
1035
+ preserveOriginal: options?.preserveOriginal
1036
+ });
1037
+ }
1038
+ deleteTeam(team, mediaId) {
1039
+ return this.http.delete(`teams/${team}/media/${mediaId}`);
1040
+ }
1041
+ updateTeamMedia(team, mediaId, data) {
1042
+ return this.http.put(`teams/${team}/media/${mediaId}`, data);
1043
+ }
1044
+ updateTeamMediaTags(team, mediaId, tags) {
1045
+ return this.http.put(`teams/${team}/media/${mediaId}/tags`, { tags });
1046
+ }
1047
+ };
1048
+ //#endregion
1049
+ //#region src/resources/meetings.ts
1050
+ var MeetingsResource = class {
1051
+ constructor(http, config) {
1052
+ this.http = http;
1053
+ this.config = config;
1054
+ }
1055
+ listUpcoming() {
1056
+ return this.http.get(`teams/${this.config.team}/meetings/upcoming`);
1057
+ }
1058
+ get(id) {
1059
+ return this.http.get(`meetings/${id}`);
1060
+ }
1061
+ getSummary(id) {
1062
+ return this.http.get(`meetings/${id}/summary`);
1063
+ }
1064
+ join(code) {
1065
+ return this.http.get(`meetings/join/${code}`);
1066
+ }
1067
+ cancel(code) {
1068
+ return this.http.post(`meetings/cancel/${code}`, {});
1069
+ }
1070
+ share(id, recipients) {
1071
+ return this.http.post(`meetings/${id}/share`, { recipients });
1072
+ }
1073
+ update(id, name, notify, speakers) {
1074
+ return this.http.put(`meetings/${id}`, {
1075
+ name,
1076
+ ...notify !== void 0 && { notify },
1077
+ ...speakers !== void 0 && { speakers }
1078
+ });
1079
+ }
1080
+ finalize(id, notify) {
1081
+ return this.http.post(`meetings/${id}/finalize`, { notify });
1082
+ }
605
1083
  };
606
1084
  //#endregion
607
1085
  //#region src/resources/memories.ts
@@ -627,6 +1105,96 @@ var MemoriesResource = class {
627
1105
  }
628
1106
  };
629
1107
  //#endregion
1108
+ //#region src/resources/messages.ts
1109
+ var MessagesResource = class {
1110
+ constructor(http) {
1111
+ this.http = http;
1112
+ }
1113
+ list(team, room, page = 1, perPage = 20) {
1114
+ return this.http.get(`messages?team=${team}&room=${room}&page=${page}&perPage=${perPage}`);
1115
+ }
1116
+ search(team, search) {
1117
+ return this.http.get(`messages/search?team=${team}&search=${encodeURIComponent(search)}`);
1118
+ }
1119
+ delete(messageId) {
1120
+ return this.http.delete(`messages/${messageId}`);
1121
+ }
1122
+ pendingApprovals(teams) {
1123
+ const params = new URLSearchParams();
1124
+ teams.forEach((t) => params.append("teams[]", t));
1125
+ return this.http.get(`messages/pending-approvals?${params.toString()}`);
1126
+ }
1127
+ generateAudio(messageId) {
1128
+ return this.http.post(`messages/${messageId}/audio`, {});
1129
+ }
1130
+ };
1131
+ //#endregion
1132
+ //#region src/resources/missions.ts
1133
+ var MissionsResource = class {
1134
+ constructor(http) {
1135
+ this.http = http;
1136
+ }
1137
+ list(agent, page = 1) {
1138
+ return this.http.get(`missions?agent=${agent}&page=${page}`);
1139
+ }
1140
+ get(missionId) {
1141
+ return this.http.get(`missions/${missionId}`);
1142
+ }
1143
+ create(agent, data) {
1144
+ return this.http.post("missions", {
1145
+ agent,
1146
+ ...data
1147
+ });
1148
+ }
1149
+ cancel(missionId) {
1150
+ return this.http.delete(`missions/${missionId}`);
1151
+ }
1152
+ pause(missionId) {
1153
+ return this.http.put(`missions/${missionId}`, { status: "paused" });
1154
+ }
1155
+ resume(missionId) {
1156
+ return this.http.put(`missions/${missionId}`, { status: "active" });
1157
+ }
1158
+ };
1159
+ //#endregion
1160
+ //#region src/resources/notifications.ts
1161
+ var NotificationsResource = class {
1162
+ constructor(http) {
1163
+ this.http = http;
1164
+ }
1165
+ list(page = 1) {
1166
+ return this.http.get(`notifications?page=${page}`);
1167
+ }
1168
+ getUnread() {
1169
+ return this.http.get("notifications?unread");
1170
+ }
1171
+ getSettings() {
1172
+ return this.http.get("notifications/settings");
1173
+ }
1174
+ updateSettings(notificationType, channel) {
1175
+ return this.http.post("notifications/settings", {
1176
+ ntype: notificationType,
1177
+ nchannel: channel
1178
+ });
1179
+ }
1180
+ getAgentSettings() {
1181
+ return this.http.get("notifications/settings/agents");
1182
+ }
1183
+ toggleAgent(agentUuid) {
1184
+ return this.http.post("notifications/settings/agents", { agent: agentUuid });
1185
+ }
1186
+ };
1187
+ //#endregion
1188
+ //#region src/resources/office.ts
1189
+ var OfficeResource = class {
1190
+ constructor(http) {
1191
+ this.http = http;
1192
+ }
1193
+ getSnapshot(team) {
1194
+ return this.http.get(`teams/${team}/office`);
1195
+ }
1196
+ };
1197
+ //#endregion
630
1198
  //#region src/resources/orders.ts
631
1199
  var OrdersResource = class {
632
1200
  constructor(http) {
@@ -641,6 +1209,31 @@ var OrdersResource = class {
641
1209
  create(data) {
642
1210
  return this.http.post("orders", data, { headers: { "X-Team": data.team } });
643
1211
  }
1212
+ update(id, data) {
1213
+ return this.http.put(`orders/${id}`, data);
1214
+ }
1215
+ delete(id) {
1216
+ return this.http.delete(`orders/${id}`);
1217
+ }
1218
+ pay(id, provider) {
1219
+ return this.http.post(`orders/${id}/pay`, { provider });
1220
+ }
1221
+ };
1222
+ //#endregion
1223
+ //#region src/resources/persona.ts
1224
+ var PersonaResource = class {
1225
+ constructor(http) {
1226
+ this.http = http;
1227
+ }
1228
+ recordAnswer(questionKey, answer) {
1229
+ return this.http.post("persona/answer", {
1230
+ questionKey,
1231
+ answer
1232
+ });
1233
+ }
1234
+ dismiss(questionKey) {
1235
+ return this.http.post("persona/dismiss", { questionKey });
1236
+ }
644
1237
  };
645
1238
  //#endregion
646
1239
  //#region src/resources/products.ts
@@ -666,6 +1259,46 @@ var ProductsResource = class {
666
1259
  }
667
1260
  };
668
1261
  //#endregion
1262
+ //#region src/resources/projects.ts
1263
+ var ProjectsResource = class {
1264
+ constructor(http) {
1265
+ this.http = http;
1266
+ }
1267
+ list(team) {
1268
+ return this.http.get(`teams/${team}/projects`);
1269
+ }
1270
+ get(team, projectId) {
1271
+ return this.http.get(`teams/${team}/projects/${projectId}`);
1272
+ }
1273
+ update(team, agent, projectId, payload) {
1274
+ return this.http.put(`teams/${team}/projects/${projectId}`, {
1275
+ ...payload,
1276
+ agentId: agent
1277
+ });
1278
+ }
1279
+ orchestrate(team, agent, payload) {
1280
+ return this.http.post(`teams/${team}/projects/studio`, {
1281
+ ...payload,
1282
+ agentId: agent
1283
+ });
1284
+ }
1285
+ assist(team, agent, payload) {
1286
+ return this.http.post(`teams/${team}/projects/assist`, {
1287
+ ...payload,
1288
+ agentId: agent
1289
+ });
1290
+ }
1291
+ delete(team, projectId) {
1292
+ return this.http.delete(`teams/${team}/projects/${projectId}`);
1293
+ }
1294
+ produce(team, agent, projectId) {
1295
+ return this.http.post(`teams/${team}/projects/${projectId}/produce`, { agentId: agent });
1296
+ }
1297
+ exportProject(team, agent, projectId) {
1298
+ return this.http.post(`teams/${team}/projects/${projectId}/export`, { agentId: agent });
1299
+ }
1300
+ };
1301
+ //#endregion
669
1302
  //#region src/resources/reminders.ts
670
1303
  var RemindersResource = class {
671
1304
  constructor(http) {
@@ -674,27 +1307,85 @@ var RemindersResource = class {
674
1307
  list() {
675
1308
  return this.http.get("reminders");
676
1309
  }
677
- add(payload) {
678
- return this.http.post("reminders", payload);
1310
+ add(payload) {
1311
+ return this.http.post("reminders", payload);
1312
+ }
1313
+ delete(id) {
1314
+ return this.http.delete(`reminders/${id}`);
1315
+ }
1316
+ };
1317
+ //#endregion
1318
+ //#region src/resources/rooms.ts
1319
+ var RoomsResource = class {
1320
+ constructor(http) {
1321
+ this.http = http;
1322
+ }
1323
+ list() {
1324
+ return this.http.get("rooms");
1325
+ }
1326
+ messages(roomId, params) {
1327
+ const query = new URLSearchParams();
1328
+ if (params?.perPage) query.set("perPage", String(params.perPage));
1329
+ const qs = query.toString();
1330
+ return this.http.get(`rooms/${roomId}/messages${qs ? "?" + qs : ""}`);
1331
+ }
1332
+ };
1333
+ //#endregion
1334
+ //#region src/resources/services.ts
1335
+ var ServicesResource = class {
1336
+ constructor(http) {
1337
+ this.http = http;
1338
+ }
1339
+ list(team) {
1340
+ const url = team ? `services?team=${encodeURIComponent(team)}` : "services";
1341
+ return this.http.get(url);
1342
+ }
1343
+ get(slug) {
1344
+ return this.http.get(`services/${slug}`);
1345
+ }
1346
+ store(team, data) {
1347
+ return this.http.post("services", {
1348
+ team,
1349
+ ...data
1350
+ });
1351
+ }
1352
+ update(id, data) {
1353
+ return this.http.put(`services/${id}`, data);
679
1354
  }
680
1355
  delete(id) {
681
- return this.http.delete(`reminders/${id}`);
1356
+ return this.http.delete(`services/${id}`);
682
1357
  }
683
1358
  };
684
1359
  //#endregion
685
- //#region src/resources/rooms.ts
686
- var RoomsResource = class {
1360
+ //#region src/resources/shortcuts.ts
1361
+ var ShortcutsResource = class {
687
1362
  constructor(http) {
688
1363
  this.http = http;
689
1364
  }
690
- list() {
691
- return this.http.get("rooms");
1365
+ list(agent, page = 1) {
1366
+ return this.http.get(`shortcuts?agent=${agent}&page=${page}`);
692
1367
  }
693
- messages(roomId, params) {
694
- const query = new URLSearchParams();
695
- if (params?.perPage) query.set("perPage", String(params.perPage));
696
- const qs = query.toString();
697
- return this.http.get(`rooms/${roomId}/messages${qs ? "?" + qs : ""}`);
1368
+ create(agent, name, warp, options = {}) {
1369
+ return this.http.post("shortcuts", {
1370
+ agent,
1371
+ name,
1372
+ warp,
1373
+ description: options.description ?? null,
1374
+ inputs: options.inputs ?? null,
1375
+ chat: options.chat ?? false
1376
+ });
1377
+ }
1378
+ update(id, name, warp, options = {}) {
1379
+ return this.http.put(`shortcuts/${id}`, {
1380
+ name,
1381
+ warp,
1382
+ description: options.description ?? null,
1383
+ inputs: options.inputs ?? null,
1384
+ chat: options.chat ?? false
1385
+ });
1386
+ }
1387
+ delete(id) {
1388
+ return this.http.delete(`shortcuts/${id}`);
698
1389
  }
699
1390
  };
700
1391
  //#endregion
@@ -718,32 +1409,50 @@ var SitesResource = class {
718
1409
  }
719
1410
  };
720
1411
  //#endregion
721
- //#region src/resources/teams.ts
722
- var TeamsResource = class {
1412
+ //#region src/resources/skills.ts
1413
+ var SkillsResource = class {
723
1414
  constructor(http) {
724
1415
  this.http = http;
725
1416
  }
726
- list() {
727
- return this.http.get("teams");
1417
+ list(agent) {
1418
+ return this.http.get(`skills?agent=${encodeURIComponent(agent)}`);
728
1419
  }
729
- listPublic(params) {
730
- const qs = params?.tags ? `?tags=${encodeURIComponent(params.tags)}` : "";
731
- return this.http.get(`teams/public${qs}`);
1420
+ get(id) {
1421
+ return this.http.get(`skills/${id}`);
732
1422
  }
733
- get(slug) {
734
- return this.http.get(`teams/${encodeURIComponent(slug)}`);
1423
+ create(params) {
1424
+ return this.http.post("skills", params);
735
1425
  }
736
- invite(teamSlug, payload) {
737
- return this.http.post(`teams/${teamSlug}/invitations`, payload);
1426
+ update(id, data) {
1427
+ return this.http.put(`skills/${id}`, data);
738
1428
  }
739
- updateLogo(teamSlug, logo) {
740
- return this.http.post(`teams/${teamSlug}/logo`, { logo });
1429
+ delete(id) {
1430
+ return this.http.delete(`skills/${id}`);
741
1431
  }
742
- updateCover(teamSlug, cover) {
743
- return this.http.post(`teams/${teamSlug}/cover`, { cover });
1432
+ toggle(id) {
1433
+ return this.http.post(`skills/${id}/toggle`);
744
1434
  }
745
- updateSetting(teamSlug, key, value) {
746
- return this.http.put(`teams/${teamSlug}/settings/${key}`, { value });
1435
+ parseFile(content) {
1436
+ return this.http.post("skills/parse", { content });
1437
+ }
1438
+ importSkill(agent, content) {
1439
+ return this.http.post("skills/import", {
1440
+ agent,
1441
+ content
1442
+ });
1443
+ }
1444
+ exportSkill(id) {
1445
+ return this.http.get(`skills/${id}/export`);
1446
+ }
1447
+ };
1448
+ //#endregion
1449
+ //#region src/resources/stats.ts
1450
+ var StatsResource = class {
1451
+ constructor(http) {
1452
+ this.http = http;
1453
+ }
1454
+ getGamification() {
1455
+ return this.http.get("me/stats");
747
1456
  }
748
1457
  };
749
1458
  //#endregion
@@ -781,6 +1490,145 @@ var StoresResource = class {
781
1490
  }
782
1491
  };
783
1492
  //#endregion
1493
+ //#region src/resources/subscriptions.ts
1494
+ var SubscriptionsResource = class {
1495
+ constructor(http) {
1496
+ this.http = http;
1497
+ }
1498
+ list(team) {
1499
+ return this.http.get(`subscriptions?team=${encodeURIComponent(team)}`);
1500
+ }
1501
+ get(id) {
1502
+ return this.http.get(`subscriptions/${id}`);
1503
+ }
1504
+ cancel(id) {
1505
+ return this.http.post(`subscriptions/${id}/cancel`);
1506
+ }
1507
+ resume(id) {
1508
+ return this.http.post(`subscriptions/${id}/resume`);
1509
+ }
1510
+ cancelPlan(team) {
1511
+ return this.http.post("billing/plans/cancel", { team });
1512
+ }
1513
+ resumePlan(team) {
1514
+ return this.http.post("billing/plans/resume", { team });
1515
+ }
1516
+ };
1517
+ //#endregion
1518
+ //#region src/resources/swarms.ts
1519
+ var SwarmsResource = class {
1520
+ constructor(http) {
1521
+ this.http = http;
1522
+ }
1523
+ listSwarms(team) {
1524
+ return this.http.get(`swarms?team=${team}`);
1525
+ }
1526
+ listAgents(swarm) {
1527
+ return this.http.get(`swarms/${swarm}/agents`);
1528
+ }
1529
+ storeProposal(agent, swarm, title, description, actions, attachments, poll) {
1530
+ return this.http.post(`swarms/${swarm}/entities/proposals`, {
1531
+ agent,
1532
+ title,
1533
+ description,
1534
+ actions,
1535
+ attachments,
1536
+ poll
1537
+ });
1538
+ }
1539
+ finalizeProposal(swarm, txHash, proposal) {
1540
+ return this.http.post(`swarms/${swarm}/entities/finalize-proposal`, {
1541
+ tx: txHash,
1542
+ proposal
1543
+ });
1544
+ }
1545
+ finalizeSignature(swarm, txHash, proposal) {
1546
+ return this.http.post(`swarms/${swarm}/entities/finalize-signature`, {
1547
+ tx: txHash,
1548
+ proposal
1549
+ });
1550
+ }
1551
+ finalizeExecution(chain, txHash, actions) {
1552
+ return this.http.post("swarms/finalize-exec", {
1553
+ chain,
1554
+ tx: txHash,
1555
+ actions: actions || []
1556
+ });
1557
+ }
1558
+ };
1559
+ //#endregion
1560
+ //#region src/resources/tasks.ts
1561
+ var TasksResource = class {
1562
+ constructor(http) {
1563
+ this.http = http;
1564
+ }
1565
+ list(agent, page = 1) {
1566
+ return this.http.get(`tasks?agent=${agent}&page=${page}`);
1567
+ }
1568
+ create(agent, room, warp, options = {}) {
1569
+ return this.http.post("tasks", {
1570
+ agent,
1571
+ room,
1572
+ warp,
1573
+ cron_expression: options.cronExpression,
1574
+ inputs: options.inputs,
1575
+ max_runs: options.maxRuns,
1576
+ starts_at: options.startsAt,
1577
+ ends_at: options.endsAt
1578
+ });
1579
+ }
1580
+ delete(id) {
1581
+ return this.http.delete(`tasks/${id}`);
1582
+ }
1583
+ toggle(id) {
1584
+ return this.http.post(`tasks/${id}/toggle`);
1585
+ }
1586
+ };
1587
+ //#endregion
1588
+ //#region src/resources/teams.ts
1589
+ var TeamsResource = class {
1590
+ constructor(http) {
1591
+ this.http = http;
1592
+ }
1593
+ list() {
1594
+ return this.http.get("teams");
1595
+ }
1596
+ listPublic(params) {
1597
+ const qs = params?.tags ? `?tags=${encodeURIComponent(params.tags)}` : "";
1598
+ return this.http.get(`teams/public${qs}`);
1599
+ }
1600
+ get(slug) {
1601
+ return this.http.get(`teams/${encodeURIComponent(slug)}`);
1602
+ }
1603
+ create(data) {
1604
+ return this.http.post("teams", data);
1605
+ }
1606
+ update(teamSlug, data) {
1607
+ return this.http.patch(`teams/${teamSlug}`, data);
1608
+ }
1609
+ invite(teamSlug, payload) {
1610
+ return this.http.post(`teams/${teamSlug}/invitations`, payload);
1611
+ }
1612
+ updateLogo(teamSlug, logo) {
1613
+ return this.http.post(`teams/${teamSlug}/logo`, { logo });
1614
+ }
1615
+ updateCover(teamSlug, cover) {
1616
+ return this.http.post(`teams/${teamSlug}/cover`, { cover });
1617
+ }
1618
+ updateSetting(teamSlug, key, value) {
1619
+ return this.http.put(`teams/${teamSlug}/settings/${key}`, { value });
1620
+ }
1621
+ listPrivate() {
1622
+ return this.http.get("teams?me=true");
1623
+ }
1624
+ getInviteByToken(token) {
1625
+ return this.http.get(`teams/invite/${token}`);
1626
+ }
1627
+ acceptInvite(slug) {
1628
+ return this.http.post(`teams/${slug}/members/accept`);
1629
+ }
1630
+ };
1631
+ //#endregion
784
1632
  //#region src/resources/updates.ts
785
1633
  var UpdatesResource = class {
786
1634
  constructor(http) {
@@ -816,41 +1664,138 @@ var UpdatesResource = class {
816
1664
  }
817
1665
  };
818
1666
  //#endregion
819
- //#region src/resources/links.ts
820
- var LinksResource = class {
1667
+ //#region src/resources/upgrades.ts
1668
+ var UpgradesResource = class {
821
1669
  constructor(http) {
822
1670
  this.http = http;
823
1671
  }
824
- list(params) {
825
- const query = new URLSearchParams();
826
- if (params?.type) query.set("type", params.type);
827
- if (params?.active != null) query.set("active", String(params.active));
828
- const qs = query.toString();
829
- return this.http.get(`links${qs ? "?" + qs : ""}`);
1672
+ listPendingByTeam(teamSlug) {
1673
+ return this.http.get(`teams/${teamSlug}/upgrades/pending`);
830
1674
  }
831
- create(payload) {
832
- return this.http.post("links", payload);
1675
+ listPendingByAgent(agentId, entityType, status) {
1676
+ const params = new URLSearchParams();
1677
+ if (entityType) params.set("entityType", entityType);
1678
+ if (status) params.set("status", status);
1679
+ const query = params.toString();
1680
+ return this.http.get(`agents/${agentId}/upgrades${query ? `?${query}` : ""}`);
1681
+ }
1682
+ get(agentId, upgradeId) {
1683
+ return this.http.get(`agents/${agentId}/upgrades/${upgradeId}`);
1684
+ }
1685
+ accept(agentId, upgradeId) {
1686
+ return this.http.post(`agents/${agentId}/upgrades/${upgradeId}/accept`);
1687
+ }
1688
+ reject(agentId, upgradeId) {
1689
+ return this.http.post(`agents/${agentId}/upgrades/${upgradeId}/reject`);
1690
+ }
1691
+ propose(agentId, entityType, proposedContent, reason, entityId) {
1692
+ return this.http.post(`agents/${agentId}/upgrades`, {
1693
+ entityType,
1694
+ entityId: entityId || null,
1695
+ proposedContent,
1696
+ reason: reason || null
1697
+ });
833
1698
  }
834
- update(id, payload) {
835
- return this.http.patch(`links/${id}`, payload);
1699
+ };
1700
+ //#endregion
1701
+ //#region src/resources/users.ts
1702
+ var UsersResource = class {
1703
+ constructor(http) {
1704
+ this.http = http;
836
1705
  }
837
- delete(id) {
838
- return this.http.delete(`links/${id}`);
1706
+ getPreference(key) {
1707
+ return this.http.get(`me/preferences/${key}`);
839
1708
  }
840
- stats() {
841
- return this.http.get("links/stats");
1709
+ updatePreference(key, value) {
1710
+ return this.http.put(`me/preferences/${key}`, { value });
842
1711
  }
843
- variations(linkId) {
844
- return this.http.get(`links/${linkId}/variations`);
1712
+ getMe() {
1713
+ return this.http.get("me");
845
1714
  }
846
- createVariation(linkId, payload) {
847
- return this.http.post(`links/${linkId}/variations`, payload);
1715
+ updateMe(name, timezone) {
1716
+ return this.http.post("me/update", {
1717
+ name,
1718
+ timezone
1719
+ });
848
1720
  }
849
- createVariationBatch(linkId, payload) {
850
- return this.http.post(`links/${linkId}/variations/batch`, payload);
1721
+ updateEmail(email) {
1722
+ return this.http.post("me/update-email", { email });
851
1723
  }
852
- deleteVariation(linkId, variationId) {
853
- return this.http.delete(`links/${linkId}/variations/${variationId}`);
1724
+ resendEmailVerification() {
1725
+ return this.http.post("me/resend-email-verification");
1726
+ }
1727
+ deleteMe() {
1728
+ return this.http.post("me/request-delete");
1729
+ }
1730
+ updatePayoutAddress(address, chain) {
1731
+ return this.http.put("me/payout-address", {
1732
+ payoutAddress: address,
1733
+ payoutChain: chain
1734
+ });
1735
+ }
1736
+ getAffiliate(code) {
1737
+ return this.http.get(`affiliates/${code}`);
1738
+ }
1739
+ getAffiliateTiers() {
1740
+ return this.http.get("affiliates/tiers");
1741
+ }
1742
+ storeAffiliate(name, email, application) {
1743
+ return this.http.post("affiliates", {
1744
+ name,
1745
+ email,
1746
+ application
1747
+ });
1748
+ }
1749
+ getEarnings(page) {
1750
+ return this.http.get(`earnings?page=${page}`);
1751
+ }
1752
+ getPayouts(page) {
1753
+ return this.http.get(`payouts?page=${page}`);
1754
+ }
1755
+ requestPayout() {
1756
+ return this.http.post("payouts");
1757
+ }
1758
+ };
1759
+ //#endregion
1760
+ //#region src/resources/voice.ts
1761
+ var VoiceResource = class {
1762
+ constructor(http) {
1763
+ this.http = http;
1764
+ }
1765
+ transcribe(teamSlug, audio, language, prompt) {
1766
+ const formData = new FormData();
1767
+ formData.append("audio", audio, audio.name);
1768
+ formData.append("team", teamSlug);
1769
+ if (language) formData.append("language", language);
1770
+ if (prompt) formData.append("prompt", prompt);
1771
+ return this.http.post("transcribe", formData, { isJson: false });
1772
+ }
1773
+ };
1774
+ //#endregion
1775
+ //#region src/resources/wallets.ts
1776
+ var WalletsResource = class {
1777
+ constructor(http) {
1778
+ this.http = http;
1779
+ }
1780
+ store(agentUuid, provider, chain, address) {
1781
+ return this.http.post("wallets", {
1782
+ agent: agentUuid,
1783
+ provider,
1784
+ chain,
1785
+ address
1786
+ });
1787
+ }
1788
+ delete(agentUuid, chain) {
1789
+ return this.http.delete(`wallets?agent=${agentUuid}&chain=${chain}`);
1790
+ }
1791
+ sort(agentUuid, walletOrders) {
1792
+ return this.http.post("wallets/sort", {
1793
+ agent: agentUuid,
1794
+ walletOrders
1795
+ });
1796
+ }
1797
+ getProviders(agentUuid) {
1798
+ return this.http.get(`wallets/providers?agent=${agentUuid}`);
854
1799
  }
855
1800
  };
856
1801
  //#endregion
@@ -883,22 +1828,39 @@ var WarpsResource = class {
883
1828
  }
884
1829
  };
885
1830
  //#endregion
886
- //#region src/resources/subscriptions.ts
887
- var SubscriptionsResource = class {
1831
+ //#region src/resources/webhooks.ts
1832
+ var WebhooksResource = class {
888
1833
  constructor(http) {
889
1834
  this.http = http;
890
1835
  }
891
- list(team) {
892
- return this.http.get(`subscriptions?team=${encodeURIComponent(team)}`);
1836
+ list(agentId) {
1837
+ return this.http.get(`agents/${agentId}/webhooks`);
893
1838
  }
894
- get(id) {
895
- return this.http.get(`subscriptions/${id}`);
1839
+ create(agentId, name, url, trigger, options) {
1840
+ return this.http.post(`agents/${agentId}/webhooks`, {
1841
+ name,
1842
+ url,
1843
+ trigger,
1844
+ ...options
1845
+ });
896
1846
  }
897
- cancel(id) {
898
- return this.http.post(`subscriptions/${id}/cancel`);
1847
+ update(agentId, webhookId, updates) {
1848
+ return this.http.put(`agents/${agentId}/webhooks/${webhookId}`, updates);
899
1849
  }
900
- resume(id) {
901
- return this.http.post(`subscriptions/${id}/resume`);
1850
+ delete(agentId, webhookId) {
1851
+ return this.http.delete(`agents/${agentId}/webhooks/${webhookId}`);
1852
+ }
1853
+ listWarps(agentId) {
1854
+ return this.http.get(`agents/${agentId}/webhook-warps`);
1855
+ }
1856
+ activateWarp(agentId, payload) {
1857
+ return this.http.post(`agents/${agentId}/webhook-warps`, payload);
1858
+ }
1859
+ deactivateWarp(agentId, warpIdentifier) {
1860
+ return this.http.delete(`agents/${agentId}/webhook-warps?warpIdentifier=${encodeURIComponent(warpIdentifier)}`);
1861
+ }
1862
+ deleteWarpHook(agentId, webhookId) {
1863
+ return this.http.delete(`agents/${agentId}/webhook-warps?webhookId=${encodeURIComponent(webhookId)}`);
902
1864
  }
903
1865
  };
904
1866
  //#endregion
@@ -1023,35 +1985,60 @@ var JoAiClient = class {
1023
1985
  const http = new HttpService(`${getApiBaseUrl(config.env ?? "mainnet")}/v1`, void 0, config.apiToken, { headers });
1024
1986
  const cache = config.cache;
1025
1987
  this.http = cache?.enabled !== false ? new CachedHttpService(http, cache?.overrides, cache?.defaultTtl) : http;
1026
- this.appointments = new AppointmentsResource(this.http, config);
1027
- this.hub = new HubResource(this.http);
1028
- this.teams = new TeamsResource(this.http);
1029
1988
  this.agents = new AgentsResource(this.http);
1989
+ this.alerts = new AlertsResource(this.http);
1990
+ this.appointments = new AppointmentsResource(this.http, config);
1991
+ this.auth = new AuthResource(this.http);
1992
+ this.billing = new BillingResource(this.http);
1993
+ this.billingAddresses = new BillingAddressesResource(this.http);
1030
1994
  this.blueprints = new BlueprintsResource(this.http);
1995
+ this.cards = new CardsResource(this.http);
1996
+ this.cart = new CartsResource(this.http);
1997
+ this.changelog = new ChangelogResource(this.http);
1998
+ this.contacts = new ContactsResource(this.http);
1999
+ this.contracts = new ContractsResource(this.http);
2000
+ this.documents = new DocumentsResource(this.http);
1031
2001
  this.flows = new FlowsResource(this.http);
1032
- this.marketplace = new MarketplaceResource(this.http);
1033
- this.services = new ServicesResource(this.http);
1034
- this.skills = new SkillsResource(this.http);
2002
+ this.goals = new GoalsResource(this.http);
2003
+ this.hub = new HubResource(this.http);
1035
2004
  this.ingestions = new IngestionsResource(this.http);
1036
- this.rooms = new RoomsResource(this.http);
1037
- this.contacts = new ContactsResource(this.http);
2005
+ this.inquiries = new InquiriesResource(this.http);
2006
+ this.integrations = new IntegrationsResource(this.http);
2007
+ this.intents = new IntentsResource(this.http);
1038
2008
  this.items = new ItemsResource(this.http);
2009
+ this.links = new LinksResource(this.http);
2010
+ this.loyalty = new LoyaltyResource(this.http);
2011
+ this.marketplace = new MarketplaceResource(this.http);
2012
+ this.media = new MediaResource(this.http);
2013
+ this.meetings = new MeetingsResource(this.http, config);
1039
2014
  this.memories = new MemoriesResource(this.http);
1040
- this.goals = new GoalsResource(this.http);
2015
+ this.messages = new MessagesResource(this.http);
2016
+ this.missions = new MissionsResource(this.http);
2017
+ this.notifications = new NotificationsResource(this.http);
2018
+ this.office = new OfficeResource(this.http);
2019
+ this.orders = new OrdersResource(this.http);
2020
+ this.persona = new PersonaResource(this.http);
2021
+ this.privateWarps = new WarpsResource(this.http);
2022
+ this.products = new ProductsResource(this.http);
2023
+ this.projects = new ProjectsResource(this.http);
1041
2024
  this.reminders = new RemindersResource(this.http);
2025
+ this.rooms = new RoomsResource(this.http);
2026
+ this.services = new ServicesResource(this.http);
2027
+ this.shortcuts = new ShortcutsResource(this.http);
1042
2028
  this.sites = new SitesResource(this.http);
1043
- this.documents = new DocumentsResource(this.http);
1044
- this.meetings = new MeetingsResource(this.http, config);
1045
- this.media = new MediaResource(this.http);
2029
+ this.skills = new SkillsResource(this.http);
2030
+ this.stats = new StatsResource(this.http);
1046
2031
  this.stores = new StoresResource(this.http);
1047
- this.products = new ProductsResource(this.http);
1048
- this.orders = new OrdersResource(this.http);
1049
- this.updates = new UpdatesResource(this.http);
1050
- this.links = new LinksResource(this.http);
1051
- this.privateWarps = new WarpsResource(this.http);
1052
2032
  this.subscriptions = new SubscriptionsResource(this.http);
1053
- this.cart = new CartsResource(this.http);
1054
- this.auth = new AuthResource(this.http);
2033
+ this.swarms = new SwarmsResource(this.http);
2034
+ this.tasks = new TasksResource(this.http);
2035
+ this.teams = new TeamsResource(this.http);
2036
+ this.updates = new UpdatesResource(this.http);
2037
+ this.upgrades = new UpgradesResource(this.http);
2038
+ this.users = new UsersResource(this.http);
2039
+ this.voice = new VoiceResource(this.http);
2040
+ this.wallets = new WalletsResource(this.http);
2041
+ this.webhooks = new WebhooksResource(this.http);
1055
2042
  }
1056
2043
  clearCache() {
1057
2044
  if (this.http instanceof CachedHttpService) this.http.clearCache();
@@ -1096,4 +2083,4 @@ var DistributionResource = class {
1096
2083
  }
1097
2084
  };
1098
2085
  //#endregion
1099
- export { AppointmentsResource, AuthResource, BlueprintsResource, CachedHttpService, CartsResource, ContactsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, LinksResource, MarketplaceResource, MeetingsResource, OrdersResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient, formatOpeningHours };
2086
+ export { AgentsResource, AlertsResource, AppointmentsResource, AuthResource, BillingAddressesResource, BillingResource, BlueprintsResource, CachedHttpService, CardsResource, CartsResource, ChangelogResource, ContactsResource, ContractsResource, DistributionResource, DocumentsResource, FlowsResource, GoalsResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, LinksResource, LoyaltyResource, MarketplaceResource, MeetingsResource, MemoriesResource, MessagesResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, RemindersResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoresResource, SubscriptionsResource, SwarmsResource, TasksResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WebhooksResource, createClient, formatOpeningHours };