@joai/sdk 0.19.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -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;
@@ -2299,6 +2312,7 @@ type LoyaltyReward = {
2299
2312
  pointsCost: number;
2300
2313
  config: Record<string, JsonValue> | null;
2301
2314
  sortOrder: number;
2315
+ createdAt: string;
2302
2316
  };
2303
2317
  type LoyaltyTier = {
2304
2318
  id: string;
@@ -2374,8 +2388,26 @@ type RedeemResponse = {
2374
2388
  remainingPoints: number;
2375
2389
  discountConfig?: JsonValue;
2376
2390
  };
2391
+ type Pass = {
2392
+ contact: Contact;
2393
+ team: Team;
2394
+ points: number;
2395
+ tier: string | null;
2396
+ benefit: {
2397
+ pointName: string | null;
2398
+ earning: {
2399
+ type: 'per_visit' | 'per_spend' | 'per_item' | 'per_category';
2400
+ value: number;
2401
+ minimumSpendCents: number | null;
2402
+ currency: string | null;
2403
+ };
2404
+ reward: {
2405
+ name: string;
2406
+ pointsCost: number;
2407
+ };
2408
+ } | null;
2409
+ };
2377
2410
  type LoyaltyMember = {
2378
- id: string;
2379
2411
  contactId: string;
2380
2412
  contactName: string;
2381
2413
  points: number;
@@ -2474,6 +2506,17 @@ type Task = {
2474
2506
  inputs: Record<string, string> | null;
2475
2507
  };
2476
2508
  //#endregion
2509
+ //#region src/wallet-chains/types.d.ts
2510
+ type RampProvider = 'coinbase' | 'xmoney' | 'moonpay';
2511
+ type RampProviderInfo = {
2512
+ name: RampProvider;
2513
+ displayName: string;
2514
+ logo: string;
2515
+ chains: WarpChainName[];
2516
+ countries: string[];
2517
+ assets: string[];
2518
+ active: boolean;
2519
+ }; //#endregion
2477
2520
  //#region src/warp-webhooks/types.d.ts
2478
2521
  type AgentWebhookTriggerCondition = {
2479
2522
  path: string;
@@ -2971,7 +3014,8 @@ declare class ContactsResource {
2971
3014
  meta?: Record<string, JsonValue> | null;
2972
3015
  }): Promise<IAppResponse<ContactActivity>>;
2973
3016
  deleteActivity(id: string, activityId: string): Promise<IAppResponse<void>>;
2974
- send(id: string, message: string, integration?: IntegrationType | 'preferred'): Promise<IAppResponse<void>>;
3017
+ send(id: string, message: string, subject?: string, integration?: IntegrationType | 'preferred'): Promise<IAppResponse<void>>;
3018
+ upsertProperty(id: string, key: string, value: string): Promise<IAppResponse<void>>;
2975
3019
  }
2976
3020
  //#endregion
2977
3021
  //#region src/resources/contracts.d.ts
@@ -3131,6 +3175,9 @@ declare class IntegrationsResource {
3131
3175
  constructor(http: IHttpService);
3132
3176
  list(agent: string, page?: number): Promise<IAppResponse<Integration[]>>;
3133
3177
  delete(id: string): Promise<IAppResponse<void>>;
3178
+ update(id: string, data: {
3179
+ meta?: Record<string, string | null>;
3180
+ }): Promise<IAppResponse<Integration>>;
3134
3181
  toggle(id: string): Promise<IAppResponse<Integration>>;
3135
3182
  storeBot(platform: SocialPlatform, agent: string, data: Record<string, unknown>): Promise<IAppResponse<SocialBot>>;
3136
3183
  getBot(platform: SocialPlatform, agent: string): Promise<IAppResponse<SocialBot | null>>;
@@ -3163,21 +3210,7 @@ declare class IntegrationsResource {
3163
3210
  confirmDevicePush(agent: string, eventIds: number[]): Promise<IAppResponse<{
3164
3211
  confirmed: boolean;
3165
3212
  }>>;
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
- }>>;
3213
+ setup(type: IntegrationType, agent: string, data?: Record<string, unknown>): Promise<IAppResponse<Integration>>;
3181
3214
  }
3182
3215
  //#endregion
3183
3216
  //#region src/resources/intents.d.ts
@@ -3223,7 +3256,9 @@ declare class LinksResource {
3223
3256
  declare class LoyaltyResource {
3224
3257
  private readonly http;
3225
3258
  constructor(http: IHttpService);
3226
- getProgram(): Promise<IAppResponse<LoyaltyProgram>>;
3259
+ getProgram(params?: {
3260
+ team?: string;
3261
+ }): Promise<IAppResponse<LoyaltyProgram>>;
3227
3262
  updateProgram(data: {
3228
3263
  name?: string;
3229
3264
  settings?: ProgramSettings;
@@ -3296,7 +3331,11 @@ declare class LoyaltyResource {
3296
3331
  redeem(contactId: string, rewardId: string): Promise<IAppResponse<RedeemResponse>>;
3297
3332
  adjustPoints(contactId: string, points: number, reason: string): Promise<IAppResponse<LoyaltyAccount>>;
3298
3333
  getTransactionHistory(contactId: string): Promise<IAppResponse<LoyaltyTransaction[]>>;
3299
- listMembers(): Promise<IAppResponse<LoyaltyMember[]>>;
3334
+ listMembers(): Promise<IAppResponse<PaginatedResponse<LoyaltyMember>>>;
3335
+ getPass(contact: string): Promise<IAppResponse<Pass>>;
3336
+ generatePass(contact: string, platform: 'apple' | 'google'): Promise<IAppResponse<{
3337
+ url: string | null;
3338
+ }>>;
3300
3339
  }
3301
3340
  //#endregion
3302
3341
  //#region src/resources/store.d.ts
@@ -3327,6 +3366,7 @@ declare class MediaResource {
3327
3366
  type: MediaUploadType;
3328
3367
  label?: string;
3329
3368
  tags?: string[];
3369
+ copyright?: string;
3330
3370
  }): Promise<IAppResponse<Media>>;
3331
3371
  listTeam(team: string, params?: {
3332
3372
  page?: number;
@@ -3334,10 +3374,12 @@ declare class MediaResource {
3334
3374
  }): Promise<IAppResponse<Media[]>>;
3335
3375
  uploadTeam(team: string, media: MediaLibraryItems, tags?: string[], options?: {
3336
3376
  preserveOriginal?: boolean;
3377
+ copyright?: string;
3337
3378
  }): Promise<IAppResponse<Media[]>>;
3338
3379
  deleteTeam(team: string, mediaId: string): Promise<IAppResponse<void>>;
3339
3380
  updateTeamMedia(team: string, mediaId: string, data: {
3340
3381
  name: string;
3382
+ copyright?: string | null;
3341
3383
  }): Promise<IAppResponse<Media>>;
3342
3384
  updateTeamMediaTags(team: string, mediaId: string, tags: string[]): Promise<IAppResponse<Media>>;
3343
3385
  }
@@ -3392,6 +3434,9 @@ declare class MessagesResource {
3392
3434
  audioUrl: string;
3393
3435
  }>>;
3394
3436
  storeFeedback(agent: string, message: string, positive: boolean, inquiry: Inquiry | null): Promise<IAppResponse<void>>;
3437
+ toggleReaction(messageId: string, emoji: string): Promise<IAppResponse<{
3438
+ reactions: Reactions | null;
3439
+ }>>;
3395
3440
  }
3396
3441
  //#endregion
3397
3442
  //#region src/resources/missions.d.ts
@@ -3444,6 +3489,7 @@ declare class OrdersResource {
3444
3489
  context?: OrderContext;
3445
3490
  linkVariationId?: string;
3446
3491
  priceMode?: string;
3492
+ type?: OrderType;
3447
3493
  sendConfirmation?: boolean;
3448
3494
  items?: {
3449
3495
  id: string;
@@ -3455,7 +3501,9 @@ declare class OrdersResource {
3455
3501
  update(id: string, data: {
3456
3502
  status?: OrderStatus;
3457
3503
  date?: string;
3504
+ type?: OrderType;
3458
3505
  }): Promise<IAppResponse<Order>>;
3506
+ convertToOrder(id: string): Promise<IAppResponse<Order>>;
3459
3507
  delete(id: string): Promise<IAppResponse<void>>;
3460
3508
  pay(id: string, provider: string): Promise<IAppResponse<{
3461
3509
  url: string;
@@ -3474,7 +3522,7 @@ declare class PersonaResource {
3474
3522
  declare class ProductsResource {
3475
3523
  private readonly http;
3476
3524
  constructor(http: IHttpService);
3477
- list(team?: string): Promise<IAppResponse<Product[]>>;
3525
+ list(): Promise<IAppResponse<Product[]>>;
3478
3526
  get(id: string): Promise<IAppResponse<Product>>;
3479
3527
  create(data: {
3480
3528
  name: TranslatableValue;
@@ -3605,7 +3653,7 @@ declare class RoomsResource {
3605
3653
  declare class ServicesResource {
3606
3654
  private readonly http;
3607
3655
  constructor(http: IHttpService);
3608
- list(team?: string): Promise<IAppResponse<Service[]>>;
3656
+ list(): Promise<IAppResponse<Service[]>>;
3609
3657
  get(slug: string): Promise<IAppResponse<Service>>;
3610
3658
  store(team: string, data: {
3611
3659
  name: TranslatableValue;
@@ -3779,6 +3827,10 @@ type TeamMutationPayload = {
3779
3827
  features?: TeamFeature[];
3780
3828
  meta?: Partial<TeamMeta>;
3781
3829
  settings?: Record<string, JsonValue>;
3830
+ emails?: {
3831
+ email: string;
3832
+ role: 'owner' | 'admin' | 'member';
3833
+ }[];
3782
3834
  website?: string | null;
3783
3835
  phone?: string | null;
3784
3836
  email?: string | null;
@@ -3891,13 +3943,14 @@ declare class VoiceResource {
3891
3943
  declare class WalletsResource {
3892
3944
  private readonly http;
3893
3945
  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>>;
3946
+ store(agentUuid: string, provider: WarpWalletProvider, chain: WarpChainName, address: string | null): Promise<IAppResponse<AgentPrivate>>;
3947
+ delete(agentUuid: string, chain: WarpChainName): Promise<IAppResponse<AgentPrivate>>;
3896
3948
  sort(agentUuid: string, walletOrders: {
3897
3949
  chain: WarpChainName;
3898
3950
  order: number;
3899
- }[]): Promise<IAppResponse<Record<string, unknown>>>;
3951
+ }[]): Promise<IAppResponse<AgentPrivate>>;
3900
3952
  getProviders(agentUuid: string): Promise<IAppResponse<Record<string, unknown>>>;
3953
+ listRampProviders(): Promise<IAppResponse<RampProviderInfo[]>>;
3901
3954
  }
3902
3955
  //#endregion
3903
3956
  //#region src/resources/workspace.d.ts
@@ -3997,11 +4050,13 @@ declare class WarpsResource {
3997
4050
  title: Record<string, string>;
3998
4051
  description?: Record<string, string>;
3999
4052
  definition: Record<string, any>;
4053
+ extras?: Record<string, any>;
4000
4054
  agent?: string | null;
4001
4055
  }): Promise<IAppResponse<WarpBackend>>;
4002
4056
  updateBrandWarp(teamSlug: string, brandSlug: string, warpHash: string, data: {
4003
4057
  name?: string;
4004
4058
  definition?: Record<string, any>;
4059
+ extras?: Record<string, any>;
4005
4060
  agent?: string | null;
4006
4061
  }): Promise<IAppResponse<WarpBackend>>;
4007
4062
  deleteBrandWarp(teamSlug: string, brandSlug: string, warpHash: string): Promise<IAppResponse<void>>;
@@ -4136,6 +4191,7 @@ declare class CachedHttpService implements IHttpService {
4136
4191
  private cache;
4137
4192
  private ttlMap;
4138
4193
  private defaultTtl;
4194
+ private cacheVersion;
4139
4195
  onNetworkError: (error: Error) => void;
4140
4196
  onUnauthorized: (response: IAppResponse<JsonValue>) => void;
4141
4197
  onSuccessfulResponse: (response: IAppResponse<JsonValue>) => void;
@@ -4148,6 +4204,8 @@ declare class CachedHttpService implements IHttpService {
4148
4204
  put<T>(url: string, data?: JsonValue | FormData, options?: IRequestOptions): Promise<IAppResponse<T>>;
4149
4205
  patch<T>(url: string, data?: JsonValue | FormData, options?: IRequestOptions): Promise<IAppResponse<T>>;
4150
4206
  delete<T>(url: string, options?: IRequestOptions): Promise<IAppResponse<T>>;
4207
+ private mutate;
4208
+ private bust;
4151
4209
  }
4152
4210
  //#endregion
4153
4211
  //#region src/resources/distribution.d.ts
package/dist/index.mjs CHANGED
@@ -130,7 +130,7 @@ var AgentsResource = class {
130
130
  return this.http.post("agents", params);
131
131
  }
132
132
  update(uuid, name, description, avatar) {
133
- return this.http.put(`agents/${uuid}`, {
133
+ return this.http.patch(`agents/${uuid}`, {
134
134
  name,
135
135
  description,
136
136
  avatar
@@ -149,7 +149,7 @@ var AgentsResource = class {
149
149
  return this.http.put(`agents/${uuid}/settings/${key}`, { value });
150
150
  }
151
151
  updateMeta(uuid, key, value) {
152
- return this.http.put(`agents/${uuid}/meta/${key}`, { value });
152
+ return this.http.put(`agents/${uuid}/settings/${key}`, { value });
153
153
  }
154
154
  publish(uuid) {
155
155
  return this.http.post(`agents/${uuid}/publish`, {});
@@ -540,18 +540,18 @@ var BillingResource = class {
540
540
  return this.http.get(`billing/plans?type=${type}`);
541
541
  }
542
542
  checkoutProduct(id) {
543
- return this.http.get(`billing/products/${id}`);
543
+ return this.http.get(`products/${id}`);
544
544
  }
545
545
  orders(team, page = 1, contactId) {
546
- let params = `billing/orders?page=${page}`;
546
+ let params = `orders?page=${page}`;
547
547
  if (contactId) params += `&contactId=${encodeURIComponent(contactId)}`;
548
548
  return this.http.get(params);
549
549
  }
550
550
  payOrder(id, provider) {
551
- return this.http.post(`billing/orders/${id}/pay`, { provider });
551
+ return this.http.post(`orders/${id}/pay`, { provider });
552
552
  }
553
553
  deleteOrder(id) {
554
- return this.http.delete(`billing/orders/${id}`);
554
+ return this.http.delete(`orders/${id}`);
555
555
  }
556
556
  paymentAccount(team, provider) {
557
557
  return this.http.get(`payment-accounts/${provider}`, { headers: { "X-Team": team } });
@@ -619,8 +619,7 @@ var BlueprintsResource = class {
619
619
  return this.http.post("blueprints", data);
620
620
  }
621
621
  assemble(blueprint, team, name) {
622
- return this.http.post("blueprints/assemble", {
623
- blueprint,
622
+ return this.http.post(`blueprints/${blueprint}/assemble`, {
624
623
  team,
625
624
  name
626
625
  });
@@ -745,12 +744,19 @@ var ContactsResource = class {
745
744
  deleteActivity(id, activityId) {
746
745
  return this.http.delete(`contacts/${id}/activities/${activityId}`);
747
746
  }
748
- send(id, message, integration) {
747
+ send(id, message, subject, integration) {
749
748
  return this.http.post(`contacts/${id}/send`, {
750
749
  message,
750
+ subject,
751
751
  integration
752
752
  });
753
753
  }
754
+ upsertProperty(id, key, value) {
755
+ return this.http.post(`contacts/${id}/properties`, {
756
+ key,
757
+ value
758
+ });
759
+ }
754
760
  };
755
761
  //#endregion
756
762
  //#region src/resources/contracts.ts
@@ -849,7 +855,7 @@ var DocumentsResource = class {
849
855
  });
850
856
  }
851
857
  uploadFile(agentUuid, name, document) {
852
- return this.http.post("documents", {
858
+ return this.http.post("documents/upload", {
853
859
  agent: agentUuid,
854
860
  name,
855
861
  document
@@ -971,6 +977,9 @@ var IntegrationsResource = class {
971
977
  delete(id) {
972
978
  return this.http.delete(`integrations/${id}`);
973
979
  }
980
+ update(id, data) {
981
+ return this.http.put(`integrations/${id}`, data);
982
+ }
974
983
  toggle(id) {
975
984
  return this.http.post(`integrations/${id}/toggle`);
976
985
  }
@@ -1016,20 +1025,8 @@ var IntegrationsResource = class {
1016
1025
  confirmDevicePush(agent, eventIds) {
1017
1026
  return this.http.post("integrations/calendar/" + agent + "/confirm-push", { eventIds });
1018
1027
  }
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);
1028
+ setup(type, agent, data) {
1029
+ return this.http.post(`integrations/${type}/${agent}/setup`, data ?? {});
1033
1030
  }
1034
1031
  };
1035
1032
  //#endregion
@@ -1117,8 +1114,9 @@ var LoyaltyResource = class {
1117
1114
  constructor(http) {
1118
1115
  this.http = http;
1119
1116
  }
1120
- getProgram() {
1121
- return this.http.get("loyalty/program");
1117
+ getProgram(params) {
1118
+ const query = params?.team ? `?team=${encodeURIComponent(params.team)}` : "";
1119
+ return this.http.get(`loyalty/program${query}`);
1122
1120
  }
1123
1121
  updateProgram(data) {
1124
1122
  return this.http.patch("loyalty/program", data);
@@ -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
@@ -1198,7 +1202,7 @@ var StoreResource = class {
1198
1202
  this.http = http;
1199
1203
  }
1200
1204
  async get(locale = "en") {
1201
- const res = await this.http.get(`store?locale=${locale}`);
1205
+ const res = await this.http.get(`billing/catalog?locale=${locale}`);
1202
1206
  if (!res.ok || !res.data) return {
1203
1207
  blueprints: [],
1204
1208
  skills: [],
@@ -1244,10 +1248,10 @@ var StoreResource = class {
1244
1248
  return this.http.get(`billing/commissions?team=${encodeURIComponent(teamSlug)}`);
1245
1249
  }
1246
1250
  priceTiers() {
1247
- return this.http.get("marketplace/price-tiers");
1251
+ return this.http.get("billing/price-tiers");
1248
1252
  }
1249
1253
  purchase(entityType, entityId, paymentMethod = "balance") {
1250
- return this.http.post("marketplace/purchase", {
1254
+ return this.http.post("billing/purchase", {
1251
1255
  entityType,
1252
1256
  entityId,
1253
1257
  paymentMethod
@@ -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) {
@@ -1349,7 +1355,7 @@ var MemoriesResource = class {
1349
1355
  return this.http.get(`memories${qs ? "?" + qs : ""}`);
1350
1356
  }
1351
1357
  add(payload) {
1352
- return this.http.post("memories", payload);
1358
+ return this.http.post(`agents/${payload.agentId}/memories`, payload);
1353
1359
  }
1354
1360
  update(id, data) {
1355
1361
  return this.http.put(`memories/${id}`, data);
@@ -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,43 +1515,42 @@ 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("products");
1509
1520
  }
1510
1521
  get(id) {
1511
- return this.http.get(`billing/products/${id}`);
1522
+ return this.http.get(`products/${id}`);
1512
1523
  }
1513
1524
  create(data, teamSlug) {
1514
- const url = teamSlug ? `billing/products?team=${teamSlug}` : "billing/products";
1525
+ const url = teamSlug ? `products?team=${teamSlug}` : "products";
1515
1526
  return this.http.post(url, data);
1516
1527
  }
1517
1528
  update(id, data) {
1518
- return this.http.put(`billing/products/${id}`, data);
1529
+ return this.http.put(`products/${id}`, data);
1519
1530
  }
1520
1531
  delete(id) {
1521
- return this.http.delete(`billing/products/${id}`);
1532
+ return this.http.delete(`products/${id}`);
1522
1533
  }
1523
1534
  createVariation(productSlug, data) {
1524
- return this.http.post(`billing/products/${productSlug}/variations`, data);
1535
+ return this.http.post(`products/${productSlug}/variations`, data);
1525
1536
  }
1526
1537
  updateVariation(variationId, data) {
1527
- return this.http.put(`billing/products/variations/${variationId}`, data);
1538
+ return this.http.put(`products/variations/${variationId}`, data);
1528
1539
  }
1529
1540
  sortVariations(ids) {
1530
- return this.http.post("billing/products/variations/sort", { ids });
1541
+ return this.http.post("products/variations/sort", { ids });
1531
1542
  }
1532
1543
  deleteVariation(variationId) {
1533
- return this.http.delete(`billing/products/variations/${variationId}`);
1544
+ return this.http.delete(`products/variations/${variationId}`);
1534
1545
  }
1535
1546
  createRelation(productSlug, data) {
1536
- return this.http.post(`billing/products/${productSlug}/relations`, data);
1547
+ return this.http.post(`products/${productSlug}/relations`, data);
1537
1548
  }
1538
1549
  deleteRelation(productSlug, relatedProductId) {
1539
- return this.http.delete(`billing/products/${productSlug}/relations?relatedProductId=${relatedProductId}`);
1550
+ return this.http.delete(`products/${productSlug}/relations?relatedProductId=${relatedProductId}`);
1540
1551
  }
1541
1552
  updateVolumePrices(productSlug, data) {
1542
- return this.http.put(`billing/products/${productSlug}/volume-prices`, { prices: data });
1553
+ return this.http.put(`products/${productSlug}/volume-prices`, { prices: data });
1543
1554
  }
1544
1555
  };
1545
1556
  //#endregion
@@ -1592,7 +1603,7 @@ var RemindersResource = class {
1592
1603
  return this.http.get("reminders");
1593
1604
  }
1594
1605
  add(payload) {
1595
- return this.http.post("reminders", payload);
1606
+ return this.http.post(`agents/${payload.agentId}/reminders`, payload);
1596
1607
  }
1597
1608
  delete(id) {
1598
1609
  return this.http.delete(`reminders/${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) {
@@ -1770,10 +1781,10 @@ var KvResource = class {
1770
1781
  this.http = http;
1771
1782
  }
1772
1783
  list() {
1773
- return this.http.get("stores");
1784
+ return this.http.get("kv");
1774
1785
  }
1775
1786
  create(payload) {
1776
- return this.http.post("stores", payload);
1787
+ return this.http.post("kv", payload);
1777
1788
  }
1778
1789
  entries(params) {
1779
1790
  const query = new URLSearchParams();
@@ -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
@@ -2210,7 +2224,7 @@ var WarpsResource = class {
2210
2224
  return this.http.post("warps", data);
2211
2225
  }
2212
2226
  update(identifier, data) {
2213
- return this.http.put(`warps/${identifier}`, data);
2227
+ return this.http.patch(`warps/${identifier}`, data);
2214
2228
  }
2215
2229
  destroy(identifier) {
2216
2230
  return this.http.delete(`warps/${identifier}`);
@@ -2300,7 +2314,7 @@ var WebhooksResource = class {
2300
2314
  });
2301
2315
  }
2302
2316
  update(agentId, webhookId, updates) {
2303
- return this.http.put(`agents/${agentId}/webhooks/${webhookId}`, updates);
2317
+ return this.http.patch(`agents/${agentId}/webhooks/${webhookId}`, updates);
2304
2318
  }
2305
2319
  delete(agentId, webhookId) {
2306
2320
  return this.http.delete(`agents/${agentId}/webhooks/${webhookId}`);
@@ -2380,6 +2394,7 @@ var CachedHttpService = class {
2380
2394
  constructor(inner, overrides, defaultTtl) {
2381
2395
  this.inner = inner;
2382
2396
  this.cache = new MemoryCache();
2397
+ this.cacheVersion = 0;
2383
2398
  this.onNetworkError = () => {};
2384
2399
  this.onUnauthorized = () => {};
2385
2400
  this.onSuccessfulResponse = () => {};
@@ -2394,34 +2409,40 @@ var CachedHttpService = class {
2394
2409
  this.defaultTtl = defaultTtl ?? DEFAULT_TTL;
2395
2410
  }
2396
2411
  clearCache() {
2412
+ this.cacheVersion++;
2397
2413
  this.cache.clear();
2398
2414
  }
2399
2415
  async get(url, options) {
2400
2416
  const cached = this.cache.get(url);
2401
2417
  if (cached !== void 0) return cached;
2418
+ const cacheVersion = this.cacheVersion;
2402
2419
  const response = await this.inner.get(url, options);
2403
- if (response.ok) this.cache.set(url, response, getTtl(url, this.ttlMap, this.defaultTtl));
2420
+ if (response.ok && cacheVersion === this.cacheVersion) this.cache.set(url, response, getTtl(url, this.ttlMap, this.defaultTtl));
2404
2421
  return response;
2405
2422
  }
2406
2423
  async post(url, data, options) {
2407
- const response = await this.inner.post(url, data, options);
2408
- this.cache.bust(getUrlPrefix(url));
2409
- return response;
2424
+ return this.mutate(getUrlPrefix(url), () => this.inner.post(url, data, options));
2410
2425
  }
2411
2426
  async put(url, data, options) {
2412
- const response = await this.inner.put(url, data, options);
2413
- this.cache.bust(getUrlPrefix(url));
2414
- return response;
2427
+ return this.mutate(getUrlPrefix(url), () => this.inner.put(url, data, options));
2415
2428
  }
2416
2429
  async patch(url, data, options) {
2417
- const response = await this.inner.patch(url, data, options);
2418
- this.cache.bust(getUrlPrefix(url));
2419
- return response;
2430
+ return this.mutate(getUrlPrefix(url), () => this.inner.patch(url, data, options));
2420
2431
  }
2421
2432
  async delete(url, options) {
2422
- const response = await this.inner.delete(url, options);
2423
- this.cache.bust(getUrlPrefix(url));
2424
- return response;
2433
+ return this.mutate(getUrlPrefix(url), () => this.inner.delete(url, options));
2434
+ }
2435
+ async mutate(prefix, request) {
2436
+ this.bust(prefix);
2437
+ try {
2438
+ return await request();
2439
+ } finally {
2440
+ this.bust(prefix);
2441
+ }
2442
+ }
2443
+ bust(prefix) {
2444
+ this.cacheVersion++;
2445
+ this.cache.bust(prefix);
2425
2446
  }
2426
2447
  };
2427
2448
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "0.19.1",
3
+ "version": "1.0.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",