@joai/sdk 0.19.1 → 0.20.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
@@ -282,6 +282,7 @@ type TeamMeta = {
282
282
  'payments.online'?: boolean;
283
283
  'payments.coupons'?: boolean;
284
284
  'stock.enabled'?: boolean;
285
+ 'contactPropertyMaskWarp'?: string;
285
286
  'branding'?: TeamBrand | null;
286
287
  settings: Record<string, unknown>;
287
288
  };
@@ -496,11 +497,13 @@ type Media = {
496
497
  url: string;
497
498
  library: MediaLibraryAttributes;
498
499
  tags?: string[];
500
+ copyright?: string | null;
499
501
  }; //#endregion
500
502
  //#region src/billing/types.d.ts
501
503
  type TranslatableValue = Partial<Record<WarpLocale, string>>;
502
504
  type OrderStatus = 'pending' | 'completed' | 'delivered' | 'canceled';
503
505
  type OrderSource = 'auto' | 'manual' | 'kiosk';
506
+ type OrderType = 'order' | 'quote';
504
507
  type SubscriptionStatus = 'active' | 'canceled' | 'past_due';
505
508
  type SubscriptionInterval = 'weekly' | 'biweekly' | 'monthly' | 'quarterly' | 'yearly';
506
509
  type PricingModel = 'free' | 'one-time' | 'weekly' | 'biweekly' | 'monthly' | 'quarterly' | 'yearly' | 'per-run';
@@ -694,6 +697,7 @@ type OrderContext = {
694
697
  type Order = {
695
698
  resource: 'order';
696
699
  id: string;
700
+ type: OrderType;
697
701
  total: number;
698
702
  provider: PaymentProvider | null;
699
703
  providerAccountId?: string | null;
@@ -788,12 +792,18 @@ type IntegrationDetails = {
788
792
  category?: string;
789
793
  [key: string]: unknown;
790
794
  };
795
+ type IntegrationMeta = {
796
+ handle?: string;
797
+ provider?: EmailProvider | null;
798
+ [key: string]: unknown;
799
+ };
791
800
  type Integration = {
792
801
  id: string;
793
802
  type: IntegrationType;
794
803
  name: string;
795
804
  active: boolean;
796
805
  createdAt: string;
806
+ meta?: IntegrationMeta;
797
807
  details?: IntegrationDetails;
798
808
  };
799
809
  type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'discord' | 'github';
@@ -883,7 +893,6 @@ type AgentPrivate = {
883
893
  password: string | null;
884
894
  authKey: string | null;
885
895
  secKey: string;
886
- emailAddress: string | null;
887
896
  phoneNumber: string | null;
888
897
  room: Room;
889
898
  role: string | null;
@@ -940,6 +949,10 @@ type WarpExtras = {
940
949
  useCases?: Record<string, string[]>;
941
950
  category?: string;
942
951
  faq?: Record<string, WarpExtrasFaq[]>;
952
+ notification?: {
953
+ enabled?: boolean;
954
+ contact?: string | null;
955
+ };
943
956
  };
944
957
  type WarpBackend = {
945
958
  hash: string;
@@ -1416,7 +1429,7 @@ type ChangelogEntry = {
1416
1429
  }; //#endregion
1417
1430
  //#region src/chat-reactions/types.d.ts
1418
1431
  /** Emoji → array of user hashids who reacted */
1419
- //#endregion
1432
+ type Reactions = Record<string, string[]>; //#endregion
1420
1433
  //#region src/contract/types.d.ts
1421
1434
  type Contract = {
1422
1435
  id: string;
@@ -2374,6 +2387,13 @@ type RedeemResponse = {
2374
2387
  remainingPoints: number;
2375
2388
  discountConfig?: JsonValue;
2376
2389
  };
2390
+ type Pass = {
2391
+ contact: Contact;
2392
+ team: Team;
2393
+ points: number;
2394
+ tier: string | null;
2395
+ walletUrl: string | null;
2396
+ };
2377
2397
  type LoyaltyMember = {
2378
2398
  id: string;
2379
2399
  contactId: string;
@@ -2474,6 +2494,17 @@ type Task = {
2474
2494
  inputs: Record<string, string> | null;
2475
2495
  };
2476
2496
  //#endregion
2497
+ //#region src/wallet-chains/types.d.ts
2498
+ type RampProvider = 'coinbase' | 'xmoney' | 'moonpay';
2499
+ type RampProviderInfo = {
2500
+ name: RampProvider;
2501
+ displayName: string;
2502
+ logo: string;
2503
+ chains: WarpChainName[];
2504
+ countries: string[];
2505
+ assets: string[];
2506
+ active: boolean;
2507
+ }; //#endregion
2477
2508
  //#region src/warp-webhooks/types.d.ts
2478
2509
  type AgentWebhookTriggerCondition = {
2479
2510
  path: string;
@@ -2971,7 +3002,8 @@ declare class ContactsResource {
2971
3002
  meta?: Record<string, JsonValue> | null;
2972
3003
  }): Promise<IAppResponse<ContactActivity>>;
2973
3004
  deleteActivity(id: string, activityId: string): Promise<IAppResponse<void>>;
2974
- send(id: string, message: string, integration?: IntegrationType | 'preferred'): Promise<IAppResponse<void>>;
3005
+ send(id: string, message: string, subject?: string, integration?: IntegrationType | 'preferred'): Promise<IAppResponse<void>>;
3006
+ upsertProperty(id: string, key: string, value: string): Promise<IAppResponse<void>>;
2975
3007
  }
2976
3008
  //#endregion
2977
3009
  //#region src/resources/contracts.d.ts
@@ -3131,6 +3163,9 @@ declare class IntegrationsResource {
3131
3163
  constructor(http: IHttpService);
3132
3164
  list(agent: string, page?: number): Promise<IAppResponse<Integration[]>>;
3133
3165
  delete(id: string): Promise<IAppResponse<void>>;
3166
+ update(id: string, data: {
3167
+ meta?: Record<string, string | null>;
3168
+ }): Promise<IAppResponse<Integration>>;
3134
3169
  toggle(id: string): Promise<IAppResponse<Integration>>;
3135
3170
  storeBot(platform: SocialPlatform, agent: string, data: Record<string, unknown>): Promise<IAppResponse<SocialBot>>;
3136
3171
  getBot(platform: SocialPlatform, agent: string): Promise<IAppResponse<SocialBot | null>>;
@@ -3163,21 +3198,7 @@ declare class IntegrationsResource {
3163
3198
  confirmDevicePush(agent: string, eventIds: number[]): Promise<IAppResponse<{
3164
3199
  confirmed: boolean;
3165
3200
  }>>;
3166
- updateEmailHandle(agent: string, handle: string | null): Promise<IAppResponse<{
3167
- emailAddress: string | null;
3168
- }>>;
3169
- generateEmailHandle(agent: string): Promise<IAppResponse<{
3170
- emailAddress: string | null;
3171
- }>>;
3172
- getSecretStatus(agent: string, keys: string[]): Promise<IAppResponse<Record<string, boolean>>>;
3173
- setSecret(agent: string, key: string, value: string): Promise<IAppResponse<{
3174
- key: string;
3175
- isSet: boolean;
3176
- }>>;
3177
- clearSecret(agent: string, key: string): Promise<IAppResponse<{
3178
- key: string;
3179
- isSet: boolean;
3180
- }>>;
3201
+ setup(type: IntegrationType, agent: string, data?: Record<string, unknown>): Promise<IAppResponse<Integration>>;
3181
3202
  }
3182
3203
  //#endregion
3183
3204
  //#region src/resources/intents.d.ts
@@ -3297,6 +3318,10 @@ declare class LoyaltyResource {
3297
3318
  adjustPoints(contactId: string, points: number, reason: string): Promise<IAppResponse<LoyaltyAccount>>;
3298
3319
  getTransactionHistory(contactId: string): Promise<IAppResponse<LoyaltyTransaction[]>>;
3299
3320
  listMembers(): Promise<IAppResponse<LoyaltyMember[]>>;
3321
+ getPass(contact: string): Promise<IAppResponse<Pass>>;
3322
+ generatePass(contact: string, platform: 'apple' | 'google'): Promise<IAppResponse<{
3323
+ url: string | null;
3324
+ }>>;
3300
3325
  }
3301
3326
  //#endregion
3302
3327
  //#region src/resources/store.d.ts
@@ -3327,6 +3352,7 @@ declare class MediaResource {
3327
3352
  type: MediaUploadType;
3328
3353
  label?: string;
3329
3354
  tags?: string[];
3355
+ copyright?: string;
3330
3356
  }): Promise<IAppResponse<Media>>;
3331
3357
  listTeam(team: string, params?: {
3332
3358
  page?: number;
@@ -3334,10 +3360,12 @@ declare class MediaResource {
3334
3360
  }): Promise<IAppResponse<Media[]>>;
3335
3361
  uploadTeam(team: string, media: MediaLibraryItems, tags?: string[], options?: {
3336
3362
  preserveOriginal?: boolean;
3363
+ copyright?: string;
3337
3364
  }): Promise<IAppResponse<Media[]>>;
3338
3365
  deleteTeam(team: string, mediaId: string): Promise<IAppResponse<void>>;
3339
3366
  updateTeamMedia(team: string, mediaId: string, data: {
3340
3367
  name: string;
3368
+ copyright?: string | null;
3341
3369
  }): Promise<IAppResponse<Media>>;
3342
3370
  updateTeamMediaTags(team: string, mediaId: string, tags: string[]): Promise<IAppResponse<Media>>;
3343
3371
  }
@@ -3392,6 +3420,9 @@ declare class MessagesResource {
3392
3420
  audioUrl: string;
3393
3421
  }>>;
3394
3422
  storeFeedback(agent: string, message: string, positive: boolean, inquiry: Inquiry | null): Promise<IAppResponse<void>>;
3423
+ toggleReaction(messageId: string, emoji: string): Promise<IAppResponse<{
3424
+ reactions: Reactions | null;
3425
+ }>>;
3395
3426
  }
3396
3427
  //#endregion
3397
3428
  //#region src/resources/missions.d.ts
@@ -3444,6 +3475,7 @@ declare class OrdersResource {
3444
3475
  context?: OrderContext;
3445
3476
  linkVariationId?: string;
3446
3477
  priceMode?: string;
3478
+ type?: OrderType;
3447
3479
  sendConfirmation?: boolean;
3448
3480
  items?: {
3449
3481
  id: string;
@@ -3455,7 +3487,9 @@ declare class OrdersResource {
3455
3487
  update(id: string, data: {
3456
3488
  status?: OrderStatus;
3457
3489
  date?: string;
3490
+ type?: OrderType;
3458
3491
  }): Promise<IAppResponse<Order>>;
3492
+ convertToOrder(id: string): Promise<IAppResponse<Order>>;
3459
3493
  delete(id: string): Promise<IAppResponse<void>>;
3460
3494
  pay(id: string, provider: string): Promise<IAppResponse<{
3461
3495
  url: string;
@@ -3474,7 +3508,7 @@ declare class PersonaResource {
3474
3508
  declare class ProductsResource {
3475
3509
  private readonly http;
3476
3510
  constructor(http: IHttpService);
3477
- list(team?: string): Promise<IAppResponse<Product[]>>;
3511
+ list(): Promise<IAppResponse<Product[]>>;
3478
3512
  get(id: string): Promise<IAppResponse<Product>>;
3479
3513
  create(data: {
3480
3514
  name: TranslatableValue;
@@ -3605,7 +3639,7 @@ declare class RoomsResource {
3605
3639
  declare class ServicesResource {
3606
3640
  private readonly http;
3607
3641
  constructor(http: IHttpService);
3608
- list(team?: string): Promise<IAppResponse<Service[]>>;
3642
+ list(): Promise<IAppResponse<Service[]>>;
3609
3643
  get(slug: string): Promise<IAppResponse<Service>>;
3610
3644
  store(team: string, data: {
3611
3645
  name: TranslatableValue;
@@ -3779,6 +3813,10 @@ type TeamMutationPayload = {
3779
3813
  features?: TeamFeature[];
3780
3814
  meta?: Partial<TeamMeta>;
3781
3815
  settings?: Record<string, JsonValue>;
3816
+ emails?: {
3817
+ email: string;
3818
+ role: 'owner' | 'admin' | 'member';
3819
+ }[];
3782
3820
  website?: string | null;
3783
3821
  phone?: string | null;
3784
3822
  email?: string | null;
@@ -3891,13 +3929,14 @@ declare class VoiceResource {
3891
3929
  declare class WalletsResource {
3892
3930
  private readonly http;
3893
3931
  constructor(http: IHttpService);
3894
- store(agentUuid: string, provider: WarpWalletProvider, chain: WarpChainName, address: string | null): Promise<IAppResponse<Record<string, unknown>>>;
3895
- delete(agentUuid: string, chain: WarpChainName): Promise<IAppResponse<void>>;
3932
+ store(agentUuid: string, provider: WarpWalletProvider, chain: WarpChainName, address: string | null): Promise<IAppResponse<AgentPrivate>>;
3933
+ delete(agentUuid: string, chain: WarpChainName): Promise<IAppResponse<AgentPrivate>>;
3896
3934
  sort(agentUuid: string, walletOrders: {
3897
3935
  chain: WarpChainName;
3898
3936
  order: number;
3899
- }[]): Promise<IAppResponse<Record<string, unknown>>>;
3937
+ }[]): Promise<IAppResponse<AgentPrivate>>;
3900
3938
  getProviders(agentUuid: string): Promise<IAppResponse<Record<string, unknown>>>;
3939
+ listRampProviders(): Promise<IAppResponse<RampProviderInfo[]>>;
3901
3940
  }
3902
3941
  //#endregion
3903
3942
  //#region src/resources/workspace.d.ts
@@ -3997,11 +4036,13 @@ declare class WarpsResource {
3997
4036
  title: Record<string, string>;
3998
4037
  description?: Record<string, string>;
3999
4038
  definition: Record<string, any>;
4039
+ extras?: Record<string, any>;
4000
4040
  agent?: string | null;
4001
4041
  }): Promise<IAppResponse<WarpBackend>>;
4002
4042
  updateBrandWarp(teamSlug: string, brandSlug: string, warpHash: string, data: {
4003
4043
  name?: string;
4004
4044
  definition?: Record<string, any>;
4045
+ extras?: Record<string, any>;
4005
4046
  agent?: string | null;
4006
4047
  }): Promise<IAppResponse<WarpBackend>>;
4007
4048
  deleteBrandWarp(teamSlug: string, brandSlug: string, warpHash: string): Promise<IAppResponse<void>>;
package/dist/index.mjs CHANGED
@@ -745,12 +745,19 @@ var ContactsResource = class {
745
745
  deleteActivity(id, activityId) {
746
746
  return this.http.delete(`contacts/${id}/activities/${activityId}`);
747
747
  }
748
- send(id, message, integration) {
748
+ send(id, message, subject, integration) {
749
749
  return this.http.post(`contacts/${id}/send`, {
750
750
  message,
751
+ subject,
751
752
  integration
752
753
  });
753
754
  }
755
+ upsertProperty(id, key, value) {
756
+ return this.http.post(`contacts/${id}/properties`, {
757
+ key,
758
+ value
759
+ });
760
+ }
754
761
  };
755
762
  //#endregion
756
763
  //#region src/resources/contracts.ts
@@ -971,6 +978,9 @@ var IntegrationsResource = class {
971
978
  delete(id) {
972
979
  return this.http.delete(`integrations/${id}`);
973
980
  }
981
+ update(id, data) {
982
+ return this.http.put(`integrations/${id}`, data);
983
+ }
974
984
  toggle(id) {
975
985
  return this.http.post(`integrations/${id}/toggle`);
976
986
  }
@@ -1016,20 +1026,8 @@ var IntegrationsResource = class {
1016
1026
  confirmDevicePush(agent, eventIds) {
1017
1027
  return this.http.post("integrations/calendar/" + agent + "/confirm-push", { eventIds });
1018
1028
  }
1019
- updateEmailHandle(agent, handle) {
1020
- return this.http.put("agents/" + agent + "/email", { handle });
1021
- }
1022
- generateEmailHandle(agent) {
1023
- return this.http.post("agents/" + agent + "/email/generate");
1024
- }
1025
- getSecretStatus(agent, keys) {
1026
- return this.http.get("agents/" + agent + "/secrets/status?keys=" + keys.join(","));
1027
- }
1028
- setSecret(agent, key, value) {
1029
- return this.http.put("agents/" + agent + "/secrets/" + key, { value });
1030
- }
1031
- clearSecret(agent, key) {
1032
- return this.http.delete("agents/" + agent + "/secrets/" + key);
1029
+ setup(type, agent, data) {
1030
+ return this.http.post(`integrations/${type}/${agent}/setup`, data ?? {});
1033
1031
  }
1034
1032
  };
1035
1033
  //#endregion
@@ -1190,6 +1188,12 @@ var LoyaltyResource = class {
1190
1188
  listMembers() {
1191
1189
  return this.http.get("loyalty/members");
1192
1190
  }
1191
+ getPass(contact) {
1192
+ return this.http.get(`pass/${contact}`);
1193
+ }
1194
+ generatePass(contact, platform) {
1195
+ return this.http.post(`pass/${contact}/generate`, { platform });
1196
+ }
1193
1197
  };
1194
1198
  //#endregion
1195
1199
  //#region src/resources/store.ts
@@ -1274,6 +1278,7 @@ var MediaResource = class {
1274
1278
  formData.append("type", data.type);
1275
1279
  if (data.label) formData.append("label", data.label);
1276
1280
  if (data.tags) data.tags.forEach((t) => formData.append("tags[]", t));
1281
+ if (data.copyright) formData.append("copyright", data.copyright);
1277
1282
  return this.http.post("media", formData, { headers: { "X-Team": data.team } });
1278
1283
  }
1279
1284
  listTeam(team, params) {
@@ -1286,7 +1291,8 @@ var MediaResource = class {
1286
1291
  return this.http.post(`teams/${team}/media/upload`, {
1287
1292
  media,
1288
1293
  tags,
1289
- preserveOriginal: options?.preserveOriginal
1294
+ preserveOriginal: options?.preserveOriginal,
1295
+ copyright: options?.copyright
1290
1296
  });
1291
1297
  }
1292
1298
  deleteTeam(team, mediaId) {
@@ -1389,6 +1395,9 @@ var MessagesResource = class {
1389
1395
  inquiry: inquiry?.id || null
1390
1396
  });
1391
1397
  }
1398
+ toggleReaction(messageId, emoji) {
1399
+ return this.http.post(`messages/${messageId}/reactions`, { emoji });
1400
+ }
1392
1401
  };
1393
1402
  //#endregion
1394
1403
  //#region src/resources/missions.ts
@@ -1474,6 +1483,9 @@ var OrdersResource = class {
1474
1483
  update(id, data) {
1475
1484
  return this.http.put(`orders/${id}`, data);
1476
1485
  }
1486
+ convertToOrder(id) {
1487
+ return this.update(id, { type: "order" });
1488
+ }
1477
1489
  delete(id) {
1478
1490
  return this.http.delete(`orders/${id}`);
1479
1491
  }
@@ -1503,9 +1515,8 @@ var ProductsResource = class {
1503
1515
  constructor(http) {
1504
1516
  this.http = http;
1505
1517
  }
1506
- list(team) {
1507
- const url = team ? `billing/products?team=${team}` : "billing/products";
1508
- return this.http.get(url);
1518
+ list() {
1519
+ return this.http.get("billing/products");
1509
1520
  }
1510
1521
  get(id) {
1511
1522
  return this.http.get(`billing/products/${id}`);
@@ -1642,7 +1653,7 @@ var ServicesResource = class {
1642
1653
  constructor(http) {
1643
1654
  this.http = http;
1644
1655
  }
1645
- list(team) {
1656
+ list() {
1646
1657
  return this.http.get("services");
1647
1658
  }
1648
1659
  get(slug) {
@@ -1921,10 +1932,10 @@ var TeamsResource = class {
1921
1932
  return this.http.patch(`teams/${teamSlug}`, data);
1922
1933
  }
1923
1934
  updateDescription(teamSlug, description) {
1924
- return this.http.post(`teams/${teamSlug}/update`, { description });
1935
+ return this.http.patch(`teams/${teamSlug}`, { description });
1925
1936
  }
1926
1937
  updateTagline(teamSlug, tagline) {
1927
- return this.http.post(`teams/${teamSlug}/update`, { tagline });
1938
+ return this.http.patch(`teams/${teamSlug}`, { tagline });
1928
1939
  }
1929
1940
  invite(teamSlug, payload) {
1930
1941
  return this.http.post(`teams/${teamSlug}/invitations`, payload);
@@ -2141,6 +2152,9 @@ var WalletsResource = class {
2141
2152
  getProviders(agentUuid) {
2142
2153
  return this.http.get(`wallets/providers?agent=${agentUuid}`);
2143
2154
  }
2155
+ listRampProviders() {
2156
+ return this.http.get("ramp/providers");
2157
+ }
2144
2158
  };
2145
2159
  //#endregion
2146
2160
  //#region src/resources/workspace.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "0.19.1",
3
+ "version": "0.20.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",