@joai/sdk 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { WarpBrandUrls, WarpChainName, WarpClient, WarpI18nText, WarpLocale, WarpText, WarpWalletProvider } from "@joai/warps";
1
+ import { WarpBrandUrls, WarpChainName, WarpClient, WarpI18nText, WarpLocale, WarpNativeValue, WarpText, WarpWalletProvider } from "@joai/warps";
2
2
 
3
3
  //#region ../core/dist/types-CWSaEVa7.d.mts
4
4
  //#region src/http/types.d.ts
@@ -183,9 +183,26 @@ type ProductRelation = {
183
183
  type VolumePrice = {
184
184
  id: number;
185
185
  minQty: number;
186
- maxQty: number | null;
187
186
  unitPrice: number;
188
187
  };
188
+ type ProductConfiguration = Record<string, WarpNativeValue>;
189
+ type OrderConfigurationItem = {
190
+ itemId: string | null;
191
+ type: string;
192
+ configuration: ProductConfiguration;
193
+ };
194
+ type ProductVariationMeta = {
195
+ itemGroupId?: string | null;
196
+ appleProductId: string | null;
197
+ googleProductId: string | null;
198
+ gtin?: string | null;
199
+ mpn?: string | null;
200
+ condition?: 'new' | 'used' | 'refurbished';
201
+ };
202
+ type ProductMeta = {
203
+ googleProductCategory?: number | null;
204
+ brand?: string | null;
205
+ };
189
206
  type ProductVariation = {
190
207
  resource?: 'product-variation';
191
208
  id?: string;
@@ -197,6 +214,9 @@ type ProductVariation = {
197
214
  badge?: string;
198
215
  quantity?: number;
199
216
  media?: Media[];
217
+ preview?: Media[];
218
+ stock?: number | null;
219
+ weight?: number | null;
200
220
  preorder?: boolean;
201
221
  active?: boolean;
202
222
  hidden?: boolean;
@@ -204,11 +224,9 @@ type ProductVariation = {
204
224
  order?: number | null;
205
225
  pieces?: ProductPieces | null;
206
226
  discount?: ProductDiscount | null;
227
+ settings?: Record<string, unknown> | null;
207
228
  product?: Product;
208
- meta?: {
209
- appleProductId: string | null;
210
- googleProductId: string | null;
211
- };
229
+ meta?: ProductVariationMeta;
212
230
  nativePriceStr?: string | null;
213
231
  };
214
232
  type Product = {
@@ -216,8 +234,10 @@ type Product = {
216
234
  name: TranslatableValue;
217
235
  description?: Partial<Record<WarpLocale, string>>;
218
236
  price?: number;
219
- unit?: string | null;
237
+ unit?: TranslatableValue | null;
220
238
  active?: boolean;
239
+ public?: boolean;
240
+ meta?: ProductMeta;
221
241
  virtual?: boolean;
222
242
  tags?: string[] | null;
223
243
  createdAt?: string;
@@ -227,20 +247,100 @@ type Product = {
227
247
  rating?: ProductRating;
228
248
  settings?: Record<string, unknown> | null;
229
249
  volumePrices?: VolumePrice[];
250
+ media?: Media[];
251
+ };
252
+ type OrderItem = {
253
+ id: string;
254
+ name: string;
255
+ quantity: number;
256
+ unitPrice: number;
257
+ type: 'product-variation' | 'service';
258
+ };
259
+ type CartItem = {
260
+ id: string;
261
+ name: TranslatableValue;
262
+ price: number;
263
+ quantity: number;
264
+ type: 'service' | 'product';
265
+ sku: string | null;
266
+ badge: string | null;
267
+ configuration?: ProductConfiguration;
268
+ media: Media[];
269
+ product?: Product | null;
270
+ };
271
+ type Cart = {
272
+ subtotal: number;
273
+ taxes: {
274
+ amount: number;
275
+ percent: number;
276
+ };
277
+ total: number;
278
+ items: CartItem[];
279
+ coupon: Coupon | null;
280
+ couponDiscount: number;
281
+ };
282
+ type Coupon = {
283
+ code: string;
284
+ amount: number;
285
+ percent: number;
286
+ expiresAt: string | null;
230
287
  };
231
288
  type Team = {
232
289
  slug: string;
233
290
  name: string;
234
291
  personal: boolean;
235
- description: string | null;
292
+ description: TranslatableValue | null;
236
293
  locale: WarpLocale;
237
294
  timezone: string;
295
+ settings?: TeamSettings;
238
296
  logo: string | null;
297
+ tagline?: TranslatableValue | null;
239
298
  public: boolean;
240
299
  createdAt: string;
241
300
  blueprints?: Blueprint[];
242
301
  flows?: Flow[];
243
302
  };
303
+ type TeamBrand = {
304
+ bg?: string;
305
+ fg?: string;
306
+ label?: string;
307
+ logo?: string;
308
+ bankName?: string;
309
+ bankIban?: string;
310
+ bankBic?: string;
311
+ invoiceAddress?: string;
312
+ invoiceVat?: string;
313
+ invoiceCity?: string;
314
+ invoiceZip?: string;
315
+ invoiceCountry?: string;
316
+ };
317
+ type ByokProviderConfig = {
318
+ apiKey?: string;
319
+ accessKey?: string;
320
+ secretKey?: string;
321
+ };
322
+ type ByokProviders = {
323
+ openai?: ByokProviderConfig;
324
+ anthropic?: ByokProviderConfig;
325
+ google?: ByokProviderConfig;
326
+ xai?: ByokProviderConfig;
327
+ klingai?: ByokProviderConfig;
328
+ };
329
+ type TeamSettings = {
330
+ 'extra.messages': number;
331
+ 'limit.spending': number | null;
332
+ 'currency': string;
333
+ 'extra.usage.enabled'?: boolean;
334
+ 'auto.reload.enabled'?: boolean;
335
+ 'auto.reload.threshold_cents'?: number | null;
336
+ 'auto.reload.amount_cents'?: number | null;
337
+ 'llm.provider'?: 'openai' | 'anthropic' | 'google' | 'xai' | null;
338
+ 'byok.providers'?: ByokProviders | null;
339
+ 'board.auto.enabled'?: boolean;
340
+ 'payments.online'?: boolean;
341
+ 'payments.coupons'?: boolean;
342
+ 'branding'?: TeamBrand | null;
343
+ };
244
344
  //#endregion
245
345
  //#region src/flow/types.d.ts
246
346
  type FlowCategory = 'none' | 'defi' | 'nft' | 'social' | 'devtools' | 'productivity' | 'trading' | 'portfolio';
@@ -454,6 +554,7 @@ type BrandBackend = {
454
554
  locales: WarpLocale[];
455
555
  warps: WarpBackend[];
456
556
  isTeamOwned?: boolean;
557
+ isPublic?: boolean;
457
558
  inviteCode?: string;
458
559
  source?: BrandSourceConfig | null;
459
560
  contract?: string;
@@ -570,6 +671,98 @@ type BlueprintShortcut = {
570
671
  }; //#endregion
571
672
  //#region src/helpers/string.d.ts
572
673
  //#endregion
674
+ //#region src/service/types.d.ts
675
+ type Service = {
676
+ id: string;
677
+ slug: string;
678
+ name: TranslatableValue;
679
+ price: number;
680
+ durationMinutes: number;
681
+ tags?: string[] | null;
682
+ category: string | null;
683
+ description: TranslatableValue | null;
684
+ active: boolean;
685
+ digital: boolean;
686
+ public: boolean;
687
+ createdAt: string;
688
+ updatedAt: string;
689
+ }; //#endregion
690
+ //#region src/appointment/types.d.ts
691
+ type AppointmentAvailabilityService = {
692
+ slug: string;
693
+ name: string | null;
694
+ durationMinutes: number | null;
695
+ };
696
+ type AppointmentAvailabilitySlot = {
697
+ startAt: string;
698
+ endAt: string;
699
+ agentUuid: string;
700
+ agentName: string;
701
+ serviceSlug: string | null;
702
+ };
703
+ type AppointmentAvailability = {
704
+ connected: boolean;
705
+ timezone: string;
706
+ service: AppointmentAvailabilityService | null;
707
+ slots: AppointmentAvailabilitySlot[];
708
+ };
709
+ type AppointmentPolicy = {
710
+ timezone: string | null;
711
+ availability: Record<string, {
712
+ start: string;
713
+ end: string;
714
+ }[]> | null;
715
+ minNoticeMinutes: number | null;
716
+ bufferMinutes: number | null;
717
+ maxDaysAhead: number | null;
718
+ slotIntervalMinutes: number | null;
719
+ blockedDates: string[] | null;
720
+ holidays: string[] | null;
721
+ conferenceEnabled: boolean | null;
722
+ serviceSelectionEnabled?: boolean | null;
723
+ marketplacePaymentEnabled?: boolean | null;
724
+ };
725
+ type AppointmentBookingContext = {
726
+ resolved: AppointmentPolicy | null;
727
+ policy: AppointmentPolicy | null;
728
+ services: Service[];
729
+ availableStaff: {
730
+ uuid: string;
731
+ name: string;
732
+ }[];
733
+ requestStatuses: string[];
734
+ };
735
+ type AppointmentBooking = {
736
+ id: string;
737
+ name: string;
738
+ scheduledAt: string;
739
+ scheduledEndAt: string;
740
+ timezone: string | null;
741
+ conferenceUrl: string | null;
742
+ conferenceProvider: string | null;
743
+ inviteUrl?: string | null;
744
+ status: string;
745
+ attendeeEmail: string | null;
746
+ attendeeName: string | null;
747
+ };
748
+ type AppointmentRequest = {
749
+ id: string;
750
+ title: string;
751
+ requesterName: string | null;
752
+ requesterEmail: string | null;
753
+ timezone: string | null;
754
+ durationMinutes: number | null;
755
+ notes: string | null;
756
+ status: string;
757
+ failureReason: string | null;
758
+ preferredWindows: {
759
+ start: string;
760
+ end: string;
761
+ }[] | null;
762
+ createdAt: string;
763
+ }; //#endregion
764
+ //#region src/budget/types.d.ts
765
+ //#endregion
573
766
  //#region src/contact/types.d.ts
574
767
  type Contact = {
575
768
  id: string;
@@ -753,21 +946,6 @@ type Reminder = {
753
946
  dispatchedAt?: string | null;
754
947
  createdAt: string;
755
948
  }; //#endregion
756
- //#region src/service/types.d.ts
757
- type Service = {
758
- id: string;
759
- slug: string;
760
- name: TranslatableValue;
761
- price: number;
762
- durationMinutes: number;
763
- category: string | null;
764
- description: TranslatableValue | null;
765
- active: boolean;
766
- digital: boolean;
767
- public: boolean;
768
- createdAt: string;
769
- updatedAt: string;
770
- }; //#endregion
771
949
  //#region src/shortcut/types.d.ts
772
950
  //#endregion
773
951
  //#region src/site/types.d.ts
@@ -812,6 +990,8 @@ type Link = {
812
990
  status: 'active' | 'paused' | 'expired';
813
991
  title: string | null;
814
992
  scanCount: number;
993
+ scanHistory: number[];
994
+ scanGeography: Record<string, number>;
815
995
  lastScannedAt: string | null;
816
996
  createdAt: string;
817
997
  updatedAt: string;
@@ -820,7 +1000,8 @@ type LinkCreatePayload = {
820
1000
  url: string;
821
1001
  title: string;
822
1002
  };
823
- type LinkUpdatePayload = Partial<LinkCreatePayload>; //#endregion
1003
+ type LinkUpdatePayload = Partial<LinkCreatePayload>;
1004
+ //#endregion
824
1005
  //#region src/store/types.d.ts
825
1006
  type StoreVisibility = 'private' | 'team' | 'public';
826
1007
  type StoreEntry = {
@@ -894,6 +1075,65 @@ type UpdateCreatePayload = {
894
1075
  type UpdateUpdatePayload = Partial<UpdateCreatePayload>; //#endregion
895
1076
  //#region src/swarm/types.d.ts
896
1077
  //#endregion
1078
+ //#region src/resources/appointments.d.ts
1079
+ declare class AppointmentsResource {
1080
+ private readonly http;
1081
+ constructor(http: IHttpService);
1082
+ getBookingPolicy(agentUuid: string): Promise<IAppResponse<AppointmentBookingContext>>;
1083
+ upsertPolicy(agentUuid: string, data: Partial<AppointmentPolicy>): Promise<IAppResponse<AppointmentPolicy>>;
1084
+ checkAvailability(agentUuid: string, params: {
1085
+ windowStart: string;
1086
+ windowEnd: string;
1087
+ durationMinutes: number;
1088
+ timezone?: string;
1089
+ limit?: number;
1090
+ serviceSlug?: string;
1091
+ }): Promise<IAppResponse<AppointmentAvailability>>;
1092
+ book(agentUuid: string, data: {
1093
+ title: string;
1094
+ scheduledAt: string;
1095
+ description?: string;
1096
+ conferenceProvider?: string;
1097
+ timezone?: string;
1098
+ attendeeEmail?: string;
1099
+ attendeeName?: string;
1100
+ attendees?: {
1101
+ email: string;
1102
+ name?: string;
1103
+ }[];
1104
+ serviceSlug?: string;
1105
+ appointmentRequestId?: string;
1106
+ }): Promise<IAppResponse<AppointmentBooking>>;
1107
+ reschedule(agentUuid: string, meetingId: string, data: {
1108
+ scheduledAt: string;
1109
+ timezone?: string;
1110
+ }): Promise<IAppResponse<AppointmentBooking>>;
1111
+ cancel(agentUuid: string, meetingId: string, data?: {
1112
+ reason?: string;
1113
+ }): Promise<IAppResponse<AppointmentBooking>>;
1114
+ listRequests(agentUuid: string): Promise<IAppResponse<AppointmentRequest[]>>;
1115
+ createRequest(agentUuid: string, data: {
1116
+ title: string;
1117
+ requesterName?: string;
1118
+ requesterEmail?: string;
1119
+ timezone?: string;
1120
+ durationMinutes?: number;
1121
+ notes?: string;
1122
+ windowStart?: string;
1123
+ windowEnd?: string;
1124
+ preferredWindows?: {
1125
+ start: string;
1126
+ end: string;
1127
+ }[];
1128
+ serviceSlug?: string;
1129
+ }): Promise<IAppResponse<AppointmentRequest>>;
1130
+ updateRequest(agentUuid: string, requestId: string, data: {
1131
+ status?: string;
1132
+ notes?: string;
1133
+ failureReason?: string;
1134
+ }): Promise<IAppResponse<AppointmentRequest>>;
1135
+ }
1136
+ //#endregion
897
1137
  //#region src/resources/agents.d.ts
898
1138
  declare class AgentsResource {
899
1139
  private readonly http;
@@ -906,6 +1146,47 @@ declare class AgentsResource {
906
1146
  }): Promise<IAppResponse<unknown>>;
907
1147
  }
908
1148
  //#endregion
1149
+ //#region src/resources/auth.d.ts
1150
+ type AuthSendCodeRequest = {
1151
+ name: string;
1152
+ phone?: string;
1153
+ email?: string;
1154
+ team?: string;
1155
+ table?: string;
1156
+ };
1157
+ type AuthVerifyResponse = {
1158
+ user: {
1159
+ id: string;
1160
+ name: string;
1161
+ phone: string | null;
1162
+ email: string | null;
1163
+ };
1164
+ team: {
1165
+ slug: string;
1166
+ name: string;
1167
+ } | null;
1168
+ contact: {
1169
+ id: string;
1170
+ name: string;
1171
+ phone: string | null;
1172
+ email: string | null;
1173
+ } | null;
1174
+ table: string | null;
1175
+ };
1176
+ declare class AuthResource {
1177
+ private http;
1178
+ constructor(http: IHttpService);
1179
+ sendCode(data: AuthSendCodeRequest): Promise<IAppResponse<void>>;
1180
+ verify(token: string): Promise<IAppResponse<AuthVerifyResponse>>;
1181
+ me(): Promise<IAppResponse<{
1182
+ id: string;
1183
+ name: string;
1184
+ phone: string | null;
1185
+ email: string | null;
1186
+ }>>;
1187
+ logout(): Promise<IAppResponse<void>>;
1188
+ }
1189
+ //#endregion
909
1190
  //#region src/resources/blueprints.d.ts
910
1191
  declare class BlueprintsResource {
911
1192
  private readonly http;
@@ -917,6 +1198,17 @@ declare class BlueprintsResource {
917
1198
  get(slug: string, locale?: string): Promise<IAppResponse<Blueprint>>;
918
1199
  }
919
1200
  //#endregion
1201
+ //#region src/resources/carts.d.ts
1202
+ declare class CartsResource {
1203
+ private readonly http;
1204
+ constructor(http: IHttpService);
1205
+ get(): Promise<IAppResponse<Cart>>;
1206
+ add(type: 'product' | 'service', id: string, quantity?: number, configuration?: ProductConfiguration): Promise<IAppResponse<Cart>>;
1207
+ remove(type: 'product' | 'service', id: string): Promise<IAppResponse<Cart>>;
1208
+ updateQuantity(type: 'product' | 'service', id: string, quantity: number): Promise<IAppResponse<Cart>>;
1209
+ clear(): Promise<IAppResponse<Cart>>;
1210
+ }
1211
+ //#endregion
920
1212
  //#region src/resources/flows.d.ts
921
1213
  declare class FlowsResource {
922
1214
  private readonly http;
@@ -939,8 +1231,8 @@ declare class MarketplaceResource {
939
1231
  declare class ServicesResource {
940
1232
  private readonly http;
941
1233
  constructor(http: IHttpService);
942
- get(id: string): Promise<IAppResponse<Service>>;
943
- list(team: string): Promise<IAppResponse<Service[]>>;
1234
+ list(team?: string): Promise<IAppResponse<Service[]>>;
1235
+ get(slug: string): Promise<IAppResponse<Service>>;
944
1236
  store(team: string, data: {
945
1237
  name: string;
946
1238
  price: number;
@@ -1028,6 +1320,19 @@ declare class MeetingsResource {
1028
1320
  join(code: string): Promise<IAppResponse<MeetingJoinInfo>>;
1029
1321
  }
1030
1322
  //#endregion
1323
+ //#region src/resources/media.d.ts
1324
+ type MediaUploadType = 'brand' | 'reference' | 'template' | 'output';
1325
+ declare class MediaResource {
1326
+ private readonly http;
1327
+ constructor(http: IHttpService);
1328
+ upload(data: {
1329
+ team: string;
1330
+ file: File;
1331
+ type: MediaUploadType;
1332
+ label?: string;
1333
+ }): Promise<IAppResponse<Media>>;
1334
+ }
1335
+ //#endregion
1031
1336
  //#region src/resources/ingestions.d.ts
1032
1337
  declare class IngestionsResource {
1033
1338
  private readonly http;
@@ -1077,17 +1382,26 @@ type Order = {
1077
1382
  status: string;
1078
1383
  paymentUrl: string | null;
1079
1384
  invoiceUrl: string | null;
1385
+ createdAt: string;
1386
+ items: OrderItem[];
1387
+ configuration: OrderConfigurationItem[];
1388
+ contactId: string | null;
1080
1389
  };
1081
1390
  declare class OrdersResource {
1082
1391
  private readonly http;
1083
1392
  constructor(http: IHttpService);
1393
+ list(team: string): Promise<IAppResponse<Order[]>>;
1394
+ get(id: string): Promise<IAppResponse<Order>>;
1084
1395
  create(data: {
1085
- contactId: string;
1396
+ contactId?: string;
1086
1397
  notes?: string;
1398
+ team: string;
1399
+ fresh?: boolean;
1087
1400
  items: {
1088
1401
  id: string;
1089
1402
  type: 'product' | 'service';
1090
1403
  quantity: number;
1404
+ configuration?: ProductConfiguration;
1091
1405
  }[];
1092
1406
  }): Promise<IAppResponse<Order>>;
1093
1407
  }
@@ -1096,7 +1410,7 @@ declare class OrdersResource {
1096
1410
  declare class ProductsResource {
1097
1411
  private readonly http;
1098
1412
  constructor(http: IHttpService);
1099
- list(): Promise<IAppResponse<Product[]>>;
1413
+ list(team?: string): Promise<IAppResponse<Product[]>>;
1100
1414
  get(id: string): Promise<IAppResponse<Product>>;
1101
1415
  create(data: {
1102
1416
  name: TranslatableValue;
@@ -1155,6 +1469,10 @@ declare class TeamsResource {
1155
1469
  private readonly http;
1156
1470
  constructor(http: IHttpService);
1157
1471
  list(): Promise<IAppResponse<Team[]>>;
1472
+ listPublic(params?: {
1473
+ tags?: string;
1474
+ }): Promise<IAppResponse<Team[]>>;
1475
+ get(slug: string): Promise<IAppResponse<Team>>;
1158
1476
  invite(teamSlug: string, payload: {
1159
1477
  email: string;
1160
1478
  role: 'owner' | 'admin' | 'member';
@@ -1212,23 +1530,25 @@ declare class LinksResource {
1212
1530
  }
1213
1531
  //#endregion
1214
1532
  //#region src/resources/warps.d.ts
1215
- type WarpResponseData = {
1533
+ type BackendWarpBrand = {
1534
+ name: string;
1535
+ description?: WarpText | null;
1536
+ logo?: string | null;
1537
+ isPublic?: boolean;
1538
+ };
1539
+ type BackendWarp = {
1216
1540
  id: string;
1217
1541
  title: string;
1218
1542
  url: string;
1219
1543
  definition: Record<string, any>;
1220
- brand: {
1221
- name: string;
1222
- description?: string;
1223
- logo?: string | null;
1224
- } | null;
1544
+ brand: BackendWarpBrand | null;
1225
1545
  agent?: AgentPrivate | null;
1226
1546
  };
1227
1547
  declare class WarpsResource {
1228
1548
  private readonly http;
1229
1549
  constructor(http: IHttpService);
1230
- list(brand?: string): Promise<IAppResponse<WarpResponseData[]>>;
1231
- show(identifier: string): Promise<IAppResponse<WarpResponseData>>;
1550
+ list(brand?: string): Promise<IAppResponse<BackendWarp[]>>;
1551
+ show(identifier: string): Promise<IAppResponse<BackendWarp>>;
1232
1552
  create(data: {
1233
1553
  brand: string;
1234
1554
  definition: Record<string, any>;
@@ -1243,6 +1563,7 @@ declare class WarpsResource {
1243
1563
  update(identifier: string, data: {
1244
1564
  definition?: Record<string, any>;
1245
1565
  agent?: string | null;
1566
+ public?: boolean;
1246
1567
  }): Promise<IAppResponse<{
1247
1568
  id: string;
1248
1569
  }>>;
@@ -1280,6 +1601,7 @@ interface JoAiClientConfig {
1280
1601
  declare class JoAiClient {
1281
1602
  readonly http: IHttpService;
1282
1603
  private readonly env;
1604
+ readonly appointments: AppointmentsResource;
1283
1605
  readonly hub: HubResource;
1284
1606
  readonly teams: TeamsResource;
1285
1607
  readonly agents: AgentsResource;
@@ -1300,14 +1622,17 @@ declare class JoAiClient {
1300
1622
  readonly sites: SitesResource;
1301
1623
  readonly documents: DocumentsResource;
1302
1624
  readonly meetings: MeetingsResource;
1625
+ readonly media: MediaResource;
1303
1626
  readonly stores: StoresResource;
1304
1627
  readonly updates: UpdatesResource;
1305
1628
  readonly links: LinksResource;
1306
1629
  readonly privateWarps: WarpsResource;
1307
1630
  readonly subscriptions: SubscriptionsResource;
1631
+ readonly cart: CartsResource;
1632
+ readonly auth: AuthResource;
1308
1633
  constructor(config: JoAiClientConfig);
1309
1634
  clearCache(): void;
1310
- warps(locale?: WarpLocale): WarpClient;
1635
+ warps(locale?: WarpLocale, currentUrl?: string): WarpClient;
1311
1636
  }
1312
1637
  declare function createClient(config: JoAiClientConfig): JoAiClient;
1313
1638
  //#endregion
@@ -1340,4 +1665,4 @@ declare class DistributionResource {
1340
1665
  private fetchDistribution;
1341
1666
  }
1342
1667
  //#endregion
1343
- export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type Order, OrdersResource, type Product, type ProductVariation, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
1668
+ export { AppointmentsResource, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BlueprintsResource, type CacheConfig, CachedHttpService, CartsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type Order, OrdersResource, type Product, type ProductVariation, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient };
package/dist/index.mjs CHANGED
@@ -110,6 +110,40 @@ var HttpService = class {
110
110
  }
111
111
  };
112
112
  //#endregion
113
+ //#region src/resources/appointments.ts
114
+ var AppointmentsResource = class {
115
+ constructor(http) {
116
+ this.http = http;
117
+ }
118
+ getBookingPolicy(agentUuid) {
119
+ return this.http.get(`agents/${agentUuid}/appointments/policy`);
120
+ }
121
+ upsertPolicy(agentUuid, data) {
122
+ return this.http.put(`agents/${agentUuid}/appointments/policy`, data);
123
+ }
124
+ checkAvailability(agentUuid, params) {
125
+ return this.http.post(`agents/${agentUuid}/appointments/availability`, params);
126
+ }
127
+ book(agentUuid, data) {
128
+ return this.http.post(`agents/${agentUuid}/appointments/book`, data);
129
+ }
130
+ reschedule(agentUuid, meetingId, data) {
131
+ return this.http.post(`agents/${agentUuid}/appointments/${meetingId}/reschedule`, data);
132
+ }
133
+ cancel(agentUuid, meetingId, data) {
134
+ return this.http.post(`agents/${agentUuid}/appointments/${meetingId}/cancel`, data ?? {});
135
+ }
136
+ listRequests(agentUuid) {
137
+ return this.http.get(`agents/${agentUuid}/appointment-requests`);
138
+ }
139
+ createRequest(agentUuid, data) {
140
+ return this.http.post(`agents/${agentUuid}/appointment-requests`, data);
141
+ }
142
+ updateRequest(agentUuid, requestId, data) {
143
+ return this.http.put(`agents/${agentUuid}/appointment-requests/${requestId}`, data);
144
+ }
145
+ };
146
+ //#endregion
113
147
  //#region src/resources/agents.ts
114
148
  var AgentsResource = class {
115
149
  constructor(http) {
@@ -127,6 +161,25 @@ var AgentsResource = class {
127
161
  }
128
162
  };
129
163
  //#endregion
164
+ //#region src/resources/auth.ts
165
+ var AuthResource = class {
166
+ constructor(http) {
167
+ this.http = http;
168
+ }
169
+ sendCode(data) {
170
+ return this.http.post("auth/send-code", data);
171
+ }
172
+ verify(token) {
173
+ return this.http.get("auth/verify?token=" + token);
174
+ }
175
+ me() {
176
+ return this.http.get("auth/me");
177
+ }
178
+ logout() {
179
+ return this.http.post("auth/logout");
180
+ }
181
+ };
182
+ //#endregion
130
183
  //#region src/resources/blueprints.ts
131
184
  var BlueprintsResource = class {
132
185
  constructor(http) {
@@ -144,6 +197,40 @@ var BlueprintsResource = class {
144
197
  }
145
198
  };
146
199
  //#endregion
200
+ //#region src/resources/carts.ts
201
+ var CartsResource = class {
202
+ constructor(http) {
203
+ this.http = http;
204
+ }
205
+ get() {
206
+ return this.http.get("cart");
207
+ }
208
+ add(type, id, quantity = 1, configuration) {
209
+ return this.http.post("cart/add", {
210
+ id,
211
+ type,
212
+ quantity,
213
+ configuration
214
+ });
215
+ }
216
+ remove(type, id) {
217
+ return this.http.post("cart/remove", {
218
+ id,
219
+ type
220
+ });
221
+ }
222
+ updateQuantity(type, id, quantity) {
223
+ return this.http.post("cart/quantity", {
224
+ id,
225
+ type,
226
+ quantity
227
+ });
228
+ }
229
+ clear() {
230
+ return this.http.post("cart/clear");
231
+ }
232
+ };
233
+ //#endregion
147
234
  //#region src/resources/flows.ts
148
235
  var FlowsResource = class {
149
236
  constructor(http) {
@@ -210,11 +297,12 @@ var ServicesResource = class {
210
297
  constructor(http) {
211
298
  this.http = http;
212
299
  }
213
- get(id) {
214
- return this.http.get(`services/${id}`);
215
- }
216
300
  list(team) {
217
- return this.http.get(`services?team=${encodeURIComponent(team)}`);
301
+ const url = team ? `services?team=${encodeURIComponent(team)}` : "services";
302
+ return this.http.get(url);
303
+ }
304
+ get(slug) {
305
+ return this.http.get(`services/${slug}`);
218
306
  }
219
307
  store(team, data) {
220
308
  return this.http.post("services", {
@@ -334,6 +422,20 @@ var MeetingsResource = class {
334
422
  }
335
423
  };
336
424
  //#endregion
425
+ //#region src/resources/media.ts
426
+ var MediaResource = class {
427
+ constructor(http) {
428
+ this.http = http;
429
+ }
430
+ upload(data) {
431
+ const formData = new FormData();
432
+ formData.append("file", data.file, data.file.name);
433
+ formData.append("type", data.type);
434
+ if (data.label) formData.append("label", data.label);
435
+ return this.http.post("media", formData, { headers: { "X-Team": data.team } });
436
+ }
437
+ };
438
+ //#endregion
337
439
  //#region src/resources/ingestions.ts
338
440
  var IngestionsResource = class {
339
441
  constructor(http) {
@@ -399,8 +501,14 @@ var OrdersResource = class {
399
501
  constructor(http) {
400
502
  this.http = http;
401
503
  }
504
+ list(team) {
505
+ return this.http.get("orders", { headers: { "X-Team": team } });
506
+ }
507
+ get(id) {
508
+ return this.http.get(`orders/${id}`);
509
+ }
402
510
  create(data) {
403
- return this.http.post("orders", data);
511
+ return this.http.post("orders", data, { headers: { "X-Team": data.team } });
404
512
  }
405
513
  };
406
514
  //#endregion
@@ -409,8 +517,9 @@ var ProductsResource = class {
409
517
  constructor(http) {
410
518
  this.http = http;
411
519
  }
412
- list() {
413
- return this.http.get("products");
520
+ list(team) {
521
+ const url = team ? `products?team=${encodeURIComponent(team)}` : "products";
522
+ return this.http.get(url);
414
523
  }
415
524
  get(id) {
416
525
  return this.http.get(`products/${id}`);
@@ -486,6 +595,13 @@ var TeamsResource = class {
486
595
  list() {
487
596
  return this.http.get("teams");
488
597
  }
598
+ listPublic(params) {
599
+ const qs = params?.tags ? `?tags=${encodeURIComponent(params.tags)}` : "";
600
+ return this.http.get(`teams/public${qs}`);
601
+ }
602
+ get(slug) {
603
+ return this.http.get(`teams/${encodeURIComponent(slug)}`);
604
+ }
489
605
  invite(teamSlug, payload) {
490
606
  return this.http.post(`teams/${teamSlug}/invitations`, payload);
491
607
  }
@@ -740,6 +856,7 @@ var JoAiClient = class {
740
856
  const http = new HttpService(`${getApiBaseUrl(config.env ?? "mainnet")}/v1`, void 0, config.apiToken, { headers });
741
857
  const cache = config.cache;
742
858
  this.http = cache?.enabled !== false ? new CachedHttpService(http, cache?.overrides, cache?.defaultTtl) : http;
859
+ this.appointments = new AppointmentsResource(this.http);
743
860
  this.hub = new HubResource(this.http);
744
861
  this.teams = new TeamsResource(this.http);
745
862
  this.agents = new AgentsResource(this.http);
@@ -758,6 +875,7 @@ var JoAiClient = class {
758
875
  this.sites = new SitesResource(this.http);
759
876
  this.documents = new DocumentsResource(this.http);
760
877
  this.meetings = new MeetingsResource(this.http);
878
+ this.media = new MediaResource(this.http);
761
879
  this.stores = new StoresResource(this.http);
762
880
  this.products = new ProductsResource(this.http);
763
881
  this.orders = new OrdersResource(this.http);
@@ -765,13 +883,16 @@ var JoAiClient = class {
765
883
  this.links = new LinksResource(this.http);
766
884
  this.privateWarps = new WarpsResource(this.http);
767
885
  this.subscriptions = new SubscriptionsResource(this.http);
886
+ this.cart = new CartsResource(this.http);
887
+ this.auth = new AuthResource(this.http);
768
888
  }
769
889
  clearCache() {
770
890
  if (this.http instanceof CachedHttpService) this.http.clearCache();
771
891
  }
772
- warps(locale = "en") {
892
+ warps(locale = "en", currentUrl) {
773
893
  return new WarpClient({
774
894
  env: toWarpEnv(this.env),
895
+ currentUrl,
775
896
  preferences: { locale }
776
897
  }, { chains: [] });
777
898
  }
@@ -808,4 +929,4 @@ var DistributionResource = class {
808
929
  }
809
930
  };
810
931
  //#endregion
811
- export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, OrdersResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
932
+ export { AppointmentsResource, AuthResource, BlueprintsResource, CachedHttpService, CartsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, OrdersResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",