@joai/sdk 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -121,7 +121,7 @@ type Flow = {
121
121
  updatedAt: string;
122
122
  steps: FlowStep[];
123
123
  locales: WarpLocale[];
124
- marketplace: StoreInfo;
124
+ store: StoreInfo;
125
125
  screenshots: string[];
126
126
  };
127
127
  type FlowStep = {
@@ -310,7 +310,7 @@ type TeamBrand = {
310
310
  fg?: string;
311
311
  label?: string;
312
312
  logo?: string;
313
- bankName?: string;
313
+ bankAccountHolder?: string;
314
314
  bankIban?: string;
315
315
  bankBic?: string;
316
316
  invoiceAddress?: string;
@@ -422,6 +422,7 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
422
422
  [key: string]: JsonValue;
423
423
  }; //#endregion
424
424
  //#region src/contact/types.d.ts
425
+ type ContactHealth = 'active' | 'lukewarm' | 'cold' | 'stale' | 'unknown';
425
426
  type Contact = {
426
427
  id: string;
427
428
  name: string;
@@ -439,6 +440,8 @@ type Contact = {
439
440
  userId: string | null;
440
441
  locale?: string | null;
441
442
  props?: Record<string, string> | null;
443
+ lastActivityAt?: string | null;
444
+ health?: ContactHealth;
442
445
  };
443
446
  type ContactActivityType = 'note' | 'call' | 'meeting' | 'task' | 'update' | 'custom' | 'form' | 'loyalty';
444
447
  type ContactActivityAuthor = {
@@ -711,6 +714,7 @@ type Order = {
711
714
  invoiceDate: string;
712
715
  meta: Record<string, JsonValue> | null;
713
716
  contactId: string | null;
717
+ contact?: Contact | null;
714
718
  source: OrderSource | null;
715
719
  context: OrderContext | null;
716
720
  paymentMode: string | null;
@@ -747,9 +751,12 @@ type Cart = {
747
751
  couponDiscount: number;
748
752
  };
749
753
  type Coupon = {
754
+ id: string;
750
755
  code: string;
751
- amount: number;
752
- percent: number;
756
+ amount: number | null;
757
+ percent: number | null;
758
+ condition: number;
759
+ usesLeft: number | null;
753
760
  expiresAt: string | null;
754
761
  };
755
762
  type PurchaseResult = {
@@ -775,7 +782,7 @@ type Skill = {
775
782
  sourcePath: string | null;
776
783
  scope?: SkillScopeValue;
777
784
  active: boolean;
778
- marketplace: StoreInfo;
785
+ store: StoreInfo;
779
786
  createdAt: string;
780
787
  media?: Media[];
781
788
  screenshots: string[];
@@ -802,11 +809,12 @@ type Integration = {
802
809
  type: IntegrationType;
803
810
  name: string;
804
811
  active: boolean;
812
+ configured: boolean;
805
813
  createdAt: string;
806
814
  meta?: IntegrationMeta;
807
815
  details?: IntegrationDetails;
808
816
  };
809
- type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'discord' | 'github';
817
+ type SocialPlatform = 'telegram' | 'slack' | 'whatsapp' | 'sms' | 'discord' | 'github';
810
818
  type SocialBot = {
811
819
  name: string;
812
820
  createdAt: string;
@@ -875,7 +883,7 @@ type Agent = {
875
883
  avatar: string;
876
884
  wallets: Wallet[];
877
885
  settings: AgentSettings;
878
- marketplace: StoreInfo;
886
+ store: StoreInfo;
879
887
  character?: AgentCharacter | null;
880
888
  room: Room;
881
889
  role: string | null;
@@ -889,7 +897,7 @@ type AgentPrivate = {
889
897
  avatar: string;
890
898
  wallets: Wallet[];
891
899
  settings: AgentSettings;
892
- marketplace: StoreInfo;
900
+ store: StoreInfo;
893
901
  password: string | null;
894
902
  authKey: string | null;
895
903
  secKey: string;
@@ -924,7 +932,7 @@ type AgentSettings = {
924
932
  auto: boolean;
925
933
  'model.url': string;
926
934
  'voice.output': boolean;
927
- 'voice.id': string;
935
+ 'voice.id': string | null;
928
936
  'agent.gender'?: AgentGender;
929
937
  'proactivity.enabled': boolean;
930
938
  'proactivity.quietHoursStart'?: number;
@@ -939,6 +947,64 @@ type AgentSettings = {
939
947
  'email_provider'?: EmailProvider | null;
940
948
  };
941
949
  //#endregion
950
+ //#region src/link/types.d.ts
951
+ type LinkScanHistory = {
952
+ daily: number[];
953
+ geography: Record<string, number>;
954
+ devices?: Record<string, number>;
955
+ operatingSystems?: Record<string, number>;
956
+ browsers?: Record<string, number>;
957
+ };
958
+ type Link = {
959
+ id: string;
960
+ url: string;
961
+ shortUrl: string;
962
+ status: 'active' | 'paused' | 'expired';
963
+ title: string | null;
964
+ scanCount: number;
965
+ scanHistory: LinkScanHistory;
966
+ lastScannedAt: string | null;
967
+ createdAt: string;
968
+ updatedAt: string;
969
+ };
970
+ type LinkVariation = {
971
+ id: string;
972
+ linkId: string;
973
+ title: string | null;
974
+ values: Record<string, string>;
975
+ url: string;
976
+ shortUrl: string;
977
+ status: 'active' | 'paused' | 'expired';
978
+ scanCount: number;
979
+ lastScannedAt: string | null;
980
+ createdAt: string;
981
+ updatedAt: string;
982
+ };
983
+ type LinkVariationCreatePayload = {
984
+ title?: string | null;
985
+ values: Record<string, string>;
986
+ };
987
+ type LinkVariationBatchCreatePayload = {
988
+ placeholder: string;
989
+ labelTemplate?: string | null;
990
+ from?: number | null;
991
+ to?: number | null;
992
+ values?: Array<{
993
+ value: string;
994
+ label?: string | null;
995
+ }>;
996
+ };
997
+ type LinkCreatePayload = {
998
+ url: string;
999
+ title: string;
1000
+ };
1001
+ type LinkUpdatePayload = Partial<LinkCreatePayload>;
1002
+ type LinkStats = {
1003
+ totalLinks: number;
1004
+ activeLinks: number;
1005
+ totalScans: number;
1006
+ scanHistory: LinkScanHistory;
1007
+ }; //#endregion
942
1008
  //#region src/warp/types.d.ts
943
1009
  type WarpExtrasFaq = {
944
1010
  question: string;
@@ -968,17 +1034,31 @@ type WarpBackend = {
968
1034
  active: boolean;
969
1035
  category: WarpBackendCategory;
970
1036
  featured: boolean;
1037
+ form: boolean;
1038
+ store: boolean;
1039
+ executions: number;
971
1040
  price?: number | null;
972
1041
  primaryAddress: string | null;
973
1042
  primaryFunc: string | null;
974
1043
  locales: WarpLocale[];
975
1044
  brand: BrandBackend | null;
1045
+ team?: Team | null;
976
1046
  definition?: Record<string, any> | null;
977
1047
  extras?: WarpExtras | null;
978
1048
  agent?: AgentSimple | null;
1049
+ link?: Link | null;
1050
+ executionHistory?: number[] | null;
979
1051
  };
980
1052
  type WarpBackendStatus = 'unverified' | 'verified' | 'blacklisted';
981
1053
  type WarpBackendCategory = 'none';
1054
+ type WarpExecutionBackend = {
1055
+ id: string;
1056
+ room: string | null;
1057
+ inputs: Record<string, unknown> | null;
1058
+ status: string;
1059
+ agent: AgentSimple | null;
1060
+ createdAt: string;
1061
+ };
982
1062
  type BrandSourceConfig = {
983
1063
  type: string;
984
1064
  chain?: string;
@@ -1106,7 +1186,7 @@ type StoreAgent = {
1106
1186
  name: string | null;
1107
1187
  bio: string | null;
1108
1188
  } | null;
1109
- marketplace: StoreInfo;
1189
+ store: StoreInfo;
1110
1190
  screenshots: string[];
1111
1191
  mcpEndpoint: string;
1112
1192
  a2aCard: string;
@@ -1124,6 +1204,9 @@ type StoreItem = {
1124
1204
  } | {
1125
1205
  type: 'skill';
1126
1206
  item: Skill;
1207
+ } | {
1208
+ type: 'form';
1209
+ item: WarpBackend;
1127
1210
  };
1128
1211
  type StoreData = {
1129
1212
  blueprints: Blueprint[];
@@ -1131,6 +1214,7 @@ type StoreData = {
1131
1214
  flows: Flow[];
1132
1215
  creators: BrandBackend[];
1133
1216
  agents: StoreAgent[];
1217
+ forms: WarpBackend[];
1134
1218
  items: StoreItem[];
1135
1219
  };
1136
1220
  type StorePriceTier = {
@@ -1139,8 +1223,8 @@ type StorePriceTier = {
1139
1223
  label: string;
1140
1224
  };
1141
1225
  /**
1142
- * Normalized representation of any marketplace entity for use in checkout flows.
1143
- * All marketplace entities share a `.marketplace: StoreInfo` property —
1226
+ * Normalized representation of any store entity for use in checkout flows.
1227
+ * All store entities share a `.store: StoreInfo` property —
1144
1228
  * combine that with the entity type and ID to construct this.
1145
1229
  */
1146
1230
  type StorePurchaseResult = {
@@ -1189,7 +1273,7 @@ type Blueprint = {
1189
1273
  verified: boolean;
1190
1274
  createdAt: string;
1191
1275
  locales: WarpLocale[];
1192
- marketplace: StoreInfo;
1276
+ store: StoreInfo;
1193
1277
  tags: string[];
1194
1278
  screenshots: string[];
1195
1279
  };
@@ -2230,64 +2314,6 @@ type GamificationData = {
2230
2314
  recentExperiences: RecentExperience[];
2231
2315
  nextMilestones: Milestone[];
2232
2316
  }; //#endregion
2233
- //#region src/link/types.d.ts
2234
- type LinkScanHistory = {
2235
- daily: number[];
2236
- geography: Record<string, number>;
2237
- devices?: Record<string, number>;
2238
- operatingSystems?: Record<string, number>;
2239
- browsers?: Record<string, number>;
2240
- };
2241
- type Link = {
2242
- id: string;
2243
- url: string;
2244
- shortUrl: string;
2245
- status: 'active' | 'paused' | 'expired';
2246
- title: string | null;
2247
- scanCount: number;
2248
- scanHistory: LinkScanHistory;
2249
- lastScannedAt: string | null;
2250
- createdAt: string;
2251
- updatedAt: string;
2252
- };
2253
- type LinkVariation = {
2254
- id: string;
2255
- linkId: string;
2256
- title: string | null;
2257
- values: Record<string, string>;
2258
- url: string;
2259
- shortUrl: string;
2260
- status: 'active' | 'paused' | 'expired';
2261
- scanCount: number;
2262
- lastScannedAt: string | null;
2263
- createdAt: string;
2264
- updatedAt: string;
2265
- };
2266
- type LinkVariationCreatePayload = {
2267
- title?: string | null;
2268
- values: Record<string, string>;
2269
- };
2270
- type LinkVariationBatchCreatePayload = {
2271
- placeholder: string;
2272
- labelTemplate?: string | null;
2273
- from?: number | null;
2274
- to?: number | null;
2275
- values?: Array<{
2276
- value: string;
2277
- label?: string | null;
2278
- }>;
2279
- };
2280
- type LinkCreatePayload = {
2281
- url: string;
2282
- title: string;
2283
- };
2284
- type LinkUpdatePayload = Partial<LinkCreatePayload>;
2285
- type LinkStats = {
2286
- totalLinks: number;
2287
- activeLinks: number;
2288
- totalScans: number;
2289
- scanHistory: LinkScanHistory;
2290
- }; //#endregion
2291
2317
  //#region src/loyalty/types.d.ts
2292
2318
  type ProgramSettings = {
2293
2319
  point_name?: string;
@@ -2381,6 +2407,11 @@ type EarnResponse = {
2381
2407
  tierName?: string;
2382
2408
  multiplier?: number;
2383
2409
  };
2410
+ type StampResponse = {
2411
+ contactName: string;
2412
+ stamps: number;
2413
+ rewardReady: boolean;
2414
+ };
2384
2415
  type RedeemResponse = {
2385
2416
  rewardName: string;
2386
2417
  rewardType: string;
@@ -2619,8 +2650,8 @@ declare class AgentsResource {
2619
2650
  delete(uuid: string): Promise<IAppResponse<void>>;
2620
2651
  updatePassword(uuid: string, password: string): Promise<IAppResponse<void>>;
2621
2652
  storePassword(uuid: string, password: string): Promise<IAppResponse<AgentPrivate>>;
2622
- updateSetting(uuid: string, key: keyof AgentSettings, value: boolean | string | number | string[] | null): Promise<IAppResponse<AgentPrivate>>;
2623
- updateMeta(uuid: string, key: string, value: Record<string, unknown> | null): Promise<IAppResponse<AgentPrivate>>;
2653
+ updateSetting<K extends keyof AgentSettings>(uuid: string, key: K, value: AgentSettings[K]): Promise<IAppResponse<AgentPrivate>>;
2654
+ updateMeta(uuid: string, key: string, value: unknown): Promise<IAppResponse<AgentPrivate>>;
2624
2655
  publish(uuid: string): Promise<IAppResponse<AgentPrivate>>;
2625
2656
  unpublish(uuid: string): Promise<IAppResponse<AgentPrivate>>;
2626
2657
  moveToTeam(uuid: string, teamSlug: string): Promise<IAppResponse<AgentPrivate>>;
@@ -2981,6 +3012,26 @@ declare class CartsResource {
2981
3012
  applyCoupon(code: string): Promise<IAppResponse<void>>;
2982
3013
  }
2983
3014
  //#endregion
3015
+ //#region src/resources/coupons.d.ts
3016
+ type CouponPayload = {
3017
+ code: string;
3018
+ percent?: number | null;
3019
+ amount?: number | null;
3020
+ condition?: number;
3021
+ usesLeft?: number | null;
3022
+ expiresAt?: string | null;
3023
+ };
3024
+ declare class CouponsResource {
3025
+ private readonly http;
3026
+ constructor(http: IHttpService);
3027
+ list(team: string): Promise<IAppResponse<Coupon[]>>;
3028
+ create(team: string, data: CouponPayload): Promise<IAppResponse<Coupon>>;
3029
+ update(id: string, data: Partial<CouponPayload> & {
3030
+ clearExpiry?: boolean;
3031
+ }): Promise<IAppResponse<Coupon>>;
3032
+ delete(id: string): Promise<IAppResponse<void>>;
3033
+ }
3034
+ //#endregion
2984
3035
  //#region src/resources/changelog.d.ts
2985
3036
  declare class ChangelogResource {
2986
3037
  private readonly http;
@@ -2996,6 +3047,7 @@ declare class ContactsResource {
2996
3047
  list(params?: {
2997
3048
  search?: string;
2998
3049
  page?: number;
3050
+ staleDays?: number;
2999
3051
  }): Promise<IAppResponse<Contact[]>>;
3000
3052
  get(id: string): Promise<IAppResponse<Contact>>;
3001
3053
  create(payload: ContactCreatePayload): Promise<IAppResponse<Contact>>;
@@ -3320,6 +3372,7 @@ declare class LoyaltyResource {
3320
3372
  deletePromotion(id: string): Promise<IAppResponse<void>>;
3321
3373
  enroll(contactId: string): Promise<IAppResponse<LoyaltyAccount>>;
3322
3374
  getAccount(contactId: string): Promise<IAppResponse<LoyaltyAccount>>;
3375
+ stamp(contactId: string): Promise<IAppResponse<StampResponse>>;
3323
3376
  earn(contactId: string, context?: {
3324
3377
  spendCents?: number;
3325
3378
  items?: {
@@ -3508,6 +3561,9 @@ declare class OrdersResource {
3508
3561
  pay(id: string, provider: string): Promise<IAppResponse<{
3509
3562
  url: string;
3510
3563
  }>>;
3564
+ notify(id: string, type?: string): Promise<IAppResponse<{
3565
+ message: string;
3566
+ }>>;
3511
3567
  }
3512
3568
  //#endregion
3513
3569
  //#region src/resources/persona.d.ts
@@ -3522,7 +3578,9 @@ declare class PersonaResource {
3522
3578
  declare class ProductsResource {
3523
3579
  private readonly http;
3524
3580
  constructor(http: IHttpService);
3525
- list(): Promise<IAppResponse<Product[]>>;
3581
+ list(params?: {
3582
+ includePrivate?: boolean;
3583
+ }): Promise<IAppResponse<Product[]>>;
3526
3584
  get(id: string): Promise<IAppResponse<Product>>;
3527
3585
  create(data: {
3528
3586
  name: TranslatableValue;
@@ -3627,6 +3685,7 @@ declare class RemindersResource {
3627
3685
  declare class RoomsResource {
3628
3686
  private readonly http;
3629
3687
  constructor(http: IHttpService);
3688
+ get(id: string): Promise<IAppResponse<Room>>;
3630
3689
  list(options?: {
3631
3690
  team?: string;
3632
3691
  agent?: string;
@@ -3653,7 +3712,9 @@ declare class RoomsResource {
3653
3712
  declare class ServicesResource {
3654
3713
  private readonly http;
3655
3714
  constructor(http: IHttpService);
3656
- list(): Promise<IAppResponse<Service[]>>;
3715
+ list(params?: {
3716
+ includePrivate?: boolean;
3717
+ }): Promise<IAppResponse<Service[]>>;
3657
3718
  get(slug: string): Promise<IAppResponse<Service>>;
3658
3719
  store(team: string, data: {
3659
3720
  name: TranslatableValue;
@@ -3726,7 +3787,7 @@ declare class SkillsResource {
3726
3787
  isPublic?: boolean;
3727
3788
  price?: number;
3728
3789
  }): Promise<IAppResponse<Skill>>;
3729
- update(id: string, data: Partial<Omit<Skill, 'media' | 'marketplace'>> & {
3790
+ update(id: string, data: Partial<Omit<Skill, 'media' | 'store'>> & {
3730
3791
  media?: MediaLibraryItems;
3731
3792
  public?: boolean;
3732
3793
  price?: number;
@@ -3836,6 +3897,8 @@ type TeamMutationPayload = {
3836
3897
  email?: string | null;
3837
3898
  address?: string | null;
3838
3899
  location?: string | null;
3900
+ logoMediaId?: string | null;
3901
+ coverMediaId?: string | null;
3839
3902
  };
3840
3903
  declare class TeamsResource {
3841
3904
  private readonly http;
@@ -3981,11 +4044,13 @@ type BackendWarpCreateResponse = Pick<BackendWarp, 'id' | 'url' | 'definition' |
3981
4044
  type BackendWarpUpdateResponse = Pick<BackendWarp, 'id'>;
3982
4045
  type BackendWarp = {
3983
4046
  id: string;
4047
+ hash: string;
3984
4048
  title: string;
3985
4049
  url: string;
3986
4050
  definition: WarpDefinition;
3987
4051
  brand: BackendWarpBrand | null;
3988
4052
  agent?: AgentPrivate | null;
4053
+ link?: Link | null;
3989
4054
  };
3990
4055
  declare class WarpsResource {
3991
4056
  private readonly http;
@@ -3995,23 +4060,41 @@ declare class WarpsResource {
3995
4060
  creator?: string;
3996
4061
  primaryAddress?: string;
3997
4062
  status?: WarpBackendStatus;
4063
+ form?: boolean;
4064
+ store?: boolean;
3998
4065
  page?: number;
3999
4066
  perPage?: number;
4000
4067
  }): Promise<IAppResponse<WarpBackend[]>>;
4001
4068
  show(identifier: string): Promise<IAppResponse<WarpBackend>>;
4002
4069
  create(data: {
4003
- brand: string;
4070
+ brand?: string | null;
4004
4071
  definition: WarpDefinition;
4072
+ title?: TranslatableValue;
4073
+ description?: TranslatableValue | null;
4074
+ extras?: Record<string, any> | null;
4005
4075
  public?: boolean;
4076
+ form?: boolean;
4077
+ store?: boolean;
4006
4078
  agent?: string | null;
4007
4079
  }): Promise<IAppResponse<BackendWarpCreateResponse>>;
4008
4080
  update(identifier: string, data: {
4081
+ name?: string;
4082
+ title?: TranslatableValue;
4083
+ description?: TranslatableValue | null;
4009
4084
  definition?: WarpDefinition;
4085
+ extras?: Record<string, any> | null;
4086
+ form?: boolean;
4087
+ store?: boolean;
4010
4088
  agent?: string | null;
4011
4089
  public?: boolean;
4012
4090
  }): Promise<IAppResponse<BackendWarpUpdateResponse>>;
4013
4091
  destroy(identifier: string): Promise<IAppResponse<void>>;
4014
4092
  execute(identifier: string, inputs: string[], room?: string): Promise<IAppResponse<JsonValue>>;
4093
+ executions(identifier: string, page?: number, perPage?: number): Promise<IAppResponse<WarpExecutionBackend[]>>;
4094
+ ensureLink(identifier: string): Promise<IAppResponse<Link>>;
4095
+ install(identifier: string): Promise<IAppResponse<{
4096
+ identifier: string;
4097
+ }>>;
4015
4098
  sync(tx: string): Promise<IAppResponse<void>>;
4016
4099
  listBrands(locale: WarpLocale, options?: {
4017
4100
  chain?: string | string[];
@@ -4052,12 +4135,16 @@ declare class WarpsResource {
4052
4135
  definition: Record<string, any>;
4053
4136
  extras?: Record<string, any>;
4054
4137
  agent?: string | null;
4138
+ form?: boolean;
4139
+ store?: boolean;
4055
4140
  }): Promise<IAppResponse<WarpBackend>>;
4056
4141
  updateBrandWarp(teamSlug: string, brandSlug: string, warpHash: string, data: {
4057
4142
  name?: string;
4058
4143
  definition?: Record<string, any>;
4059
4144
  extras?: Record<string, any>;
4060
4145
  agent?: string | null;
4146
+ form?: boolean;
4147
+ store?: boolean;
4061
4148
  }): Promise<IAppResponse<WarpBackend>>;
4062
4149
  deleteBrandWarp(teamSlug: string, brandSlug: string, warpHash: string): Promise<IAppResponse<void>>;
4063
4150
  fetchSourceSchemaFromUrl(url: string): Promise<IAppResponse<any>>;
@@ -4152,6 +4239,7 @@ declare class JoAiClient {
4152
4239
  readonly notifications: NotificationsResource;
4153
4240
  readonly office: OfficeResource;
4154
4241
  readonly orders: OrdersResource;
4242
+ readonly coupons: CouponsResource;
4155
4243
  readonly persona: PersonaResource;
4156
4244
  readonly privateWarps: WarpsResource;
4157
4245
  readonly products: ProductsResource;
package/dist/index.mjs CHANGED
@@ -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}/settings/${key}`, { value });
152
+ return this.http.put(`agents/${uuid}/meta/${key}`, { value });
153
153
  }
154
154
  publish(uuid) {
155
155
  return this.http.post(`agents/${uuid}/publish`, {});
@@ -692,6 +692,25 @@ var CartsResource = class {
692
692
  }
693
693
  };
694
694
  //#endregion
695
+ //#region src/resources/coupons.ts
696
+ var CouponsResource = class {
697
+ constructor(http) {
698
+ this.http = http;
699
+ }
700
+ list(team) {
701
+ return this.http.get("coupons", { headers: { "X-Team": team } });
702
+ }
703
+ create(team, data) {
704
+ return this.http.post("coupons", data, { headers: { "X-Team": team } });
705
+ }
706
+ update(id, data) {
707
+ return this.http.put(`coupons/${id}`, data);
708
+ }
709
+ delete(id) {
710
+ return this.http.delete(`coupons/${id}`);
711
+ }
712
+ };
713
+ //#endregion
695
714
  //#region src/resources/changelog.ts
696
715
  var ChangelogResource = class {
697
716
  constructor(http) {
@@ -714,6 +733,7 @@ var ContactsResource = class {
714
733
  const query = new URLSearchParams();
715
734
  if (params?.search) query.set("filter[search]", params.search);
716
735
  if (params?.page) query.set("page", String(params.page));
736
+ if (params?.staleDays) query.set("filter[stale_days]", String(params.staleDays));
717
737
  const qs = query.toString();
718
738
  return this.http.get(`contacts${qs ? "?" + qs : ""}`);
719
739
  }
@@ -1163,6 +1183,9 @@ var LoyaltyResource = class {
1163
1183
  getAccount(contactId) {
1164
1184
  return this.http.get(`loyalty/accounts/${contactId}`);
1165
1185
  }
1186
+ stamp(contactId) {
1187
+ return this.http.post("loyalty/stamp", { contactId });
1188
+ }
1166
1189
  earn(contactId, context) {
1167
1190
  return this.http.post("loyalty/earn", {
1168
1191
  contactId,
@@ -1209,15 +1232,17 @@ var StoreResource = class {
1209
1232
  flows: [],
1210
1233
  creators: [],
1211
1234
  agents: [],
1235
+ forms: [],
1212
1236
  items: []
1213
1237
  };
1214
- const { blueprints = [], skills = [], flows = [], creators = [], agents = [] } = res.data;
1238
+ const { blueprints = [], skills = [], flows = [], creators = [], agents = [], forms = [] } = res.data;
1215
1239
  return {
1216
1240
  blueprints,
1217
1241
  skills,
1218
1242
  flows,
1219
1243
  creators,
1220
1244
  agents,
1245
+ forms,
1221
1246
  items: [
1222
1247
  ...agents.map((item) => ({
1223
1248
  type: "agent",
@@ -1234,6 +1259,10 @@ var StoreResource = class {
1234
1259
  ...skills.map((item) => ({
1235
1260
  type: "skill",
1236
1261
  item
1262
+ })),
1263
+ ...forms.map((item) => ({
1264
+ type: "form",
1265
+ item
1237
1266
  }))
1238
1267
  ]
1239
1268
  };
@@ -1492,6 +1521,9 @@ var OrdersResource = class {
1492
1521
  pay(id, provider) {
1493
1522
  return this.http.post(`orders/${id}/pay`, { provider });
1494
1523
  }
1524
+ notify(id, type = "confirmation") {
1525
+ return this.http.post(`orders/${id}/notify`, { type });
1526
+ }
1495
1527
  };
1496
1528
  //#endregion
1497
1529
  //#region src/resources/persona.ts
@@ -1515,8 +1547,10 @@ var ProductsResource = class {
1515
1547
  constructor(http) {
1516
1548
  this.http = http;
1517
1549
  }
1518
- list() {
1519
- return this.http.get("products");
1550
+ list(params) {
1551
+ let url = "products";
1552
+ if (params?.includePrivate) url += "?includePrivate=1";
1553
+ return this.http.get(url);
1520
1554
  }
1521
1555
  get(id) {
1522
1556
  return this.http.get(`products/${id}`);
@@ -1587,7 +1621,10 @@ var ProjectsResource = class {
1587
1621
  return this.http.delete(`teams/${team}/projects/${projectId}`);
1588
1622
  }
1589
1623
  produce(team, agent, projectId) {
1590
- return this.http.post(`teams/${team}/projects/${projectId}/produce`, { agentId: agent });
1624
+ return this.http.post(`studio/projects/${projectId}/produce`, {
1625
+ agentId: agent,
1626
+ team
1627
+ });
1591
1628
  }
1592
1629
  exportProject(team, agent, projectId) {
1593
1630
  return this.http.post(`teams/${team}/projects/${projectId}/export`, { agentId: agent });
@@ -1615,6 +1652,9 @@ var RoomsResource = class {
1615
1652
  constructor(http) {
1616
1653
  this.http = http;
1617
1654
  }
1655
+ get(id) {
1656
+ return this.http.get(`rooms/${id}`);
1657
+ }
1618
1658
  list(options) {
1619
1659
  const params = new URLSearchParams();
1620
1660
  if (options) {
@@ -1653,8 +1693,10 @@ var ServicesResource = class {
1653
1693
  constructor(http) {
1654
1694
  this.http = http;
1655
1695
  }
1656
- list() {
1657
- return this.http.get("services");
1696
+ list(params) {
1697
+ let url = "services";
1698
+ if (params?.includePrivate) url += "?includePrivate=1";
1699
+ return this.http.get(url);
1658
1700
  }
1659
1701
  get(slug) {
1660
1702
  return this.http.get(`services/${slug}`);
@@ -2212,6 +2254,8 @@ var WarpsResource = class {
2212
2254
  if (options?.creator) params.set("creator", options.creator);
2213
2255
  if (options?.primaryAddress) params.set("primaryAddress", options.primaryAddress);
2214
2256
  if (options?.status) params.set("status", options.status);
2257
+ if (options?.form !== void 0) params.set("form", options.form ? "1" : "0");
2258
+ if (options?.store !== void 0) params.set("store", options.store ? "1" : "0");
2215
2259
  if (options?.page) params.set("page", options.page.toString());
2216
2260
  if (options?.perPage) params.set("perPage", options.perPage.toString());
2217
2261
  const qs = params.toString();
@@ -2235,6 +2279,15 @@ var WarpsResource = class {
2235
2279
  ...room ? { room } : {}
2236
2280
  });
2237
2281
  }
2282
+ executions(identifier, page = 1, perPage = 20) {
2283
+ return this.http.get(`warps/${identifier}/executions?page=${page}&perPage=${perPage}`);
2284
+ }
2285
+ ensureLink(identifier) {
2286
+ return this.http.post(`warps/${identifier}/link`, {});
2287
+ }
2288
+ install(identifier) {
2289
+ return this.http.post(`warps/${identifier}/install`, {});
2290
+ }
2238
2291
  sync(tx) {
2239
2292
  return this.http.post("warps/sync", { tx });
2240
2293
  }
@@ -2366,7 +2419,7 @@ const DEFAULT_TTL = 15e3;
2366
2419
  const DEFAULTS = {
2367
2420
  blueprints: 3e5,
2368
2421
  flows: 3e5,
2369
- marketplace: 3e5,
2422
+ "billing/catalog": 3e5,
2370
2423
  skills: 3e5,
2371
2424
  sites: 3e5,
2372
2425
  stores: 3e4,
@@ -2505,6 +2558,7 @@ var JoAiClient = class {
2505
2558
  this.notifications = new NotificationsResource(this.http);
2506
2559
  this.office = new OfficeResource(this.http);
2507
2560
  this.orders = new OrdersResource(this.http);
2561
+ this.coupons = new CouponsResource(this.http);
2508
2562
  this.persona = new PersonaResource(this.http);
2509
2563
  this.privateWarps = new WarpsResource(this.http);
2510
2564
  this.products = new ProductsResource(this.http);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",