@joai/sdk 0.13.0 → 0.15.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 +169 -40
- package/dist/index.mjs +60 -20
- package/package.json +1 -1
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
|
|
@@ -118,6 +118,9 @@ type MediaLibraryAttributes = {
|
|
|
118
118
|
extension?: string;
|
|
119
119
|
size?: number;
|
|
120
120
|
};
|
|
121
|
+
type MediaLibraryItems = {
|
|
122
|
+
[uuid: string]: MediaLibraryAttributes;
|
|
123
|
+
};
|
|
121
124
|
type MediaMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm' | 'video/quicktime' | 'video/x-msvideo' | 'audio/mpeg' | 'audio/mp3' | 'audio/ogg' | 'audio/wav' | 'audio/webm' | 'audio/aac' | 'audio/m4a' | 'audio/m4b' | 'audio/m4p' | 'audio/m4v' | 'application/pdf' | 'application/json';
|
|
122
125
|
type Media = {
|
|
123
126
|
id: string;
|
|
@@ -183,9 +186,26 @@ type ProductRelation = {
|
|
|
183
186
|
type VolumePrice = {
|
|
184
187
|
id: number;
|
|
185
188
|
minQty: number;
|
|
186
|
-
maxQty: number | null;
|
|
187
189
|
unitPrice: number;
|
|
188
190
|
};
|
|
191
|
+
type ProductConfiguration = Record<string, WarpNativeValue>;
|
|
192
|
+
type OrderConfigurationItem = {
|
|
193
|
+
itemId: string | null;
|
|
194
|
+
type: string;
|
|
195
|
+
configuration: ProductConfiguration;
|
|
196
|
+
};
|
|
197
|
+
type ProductVariationMeta = {
|
|
198
|
+
itemGroupId?: string | null;
|
|
199
|
+
appleProductId: string | null;
|
|
200
|
+
googleProductId: string | null;
|
|
201
|
+
gtin?: string | null;
|
|
202
|
+
mpn?: string | null;
|
|
203
|
+
condition?: 'new' | 'used' | 'refurbished';
|
|
204
|
+
};
|
|
205
|
+
type ProductMeta = {
|
|
206
|
+
googleProductCategory?: number | null;
|
|
207
|
+
brand?: string | null;
|
|
208
|
+
};
|
|
189
209
|
type ProductVariation = {
|
|
190
210
|
resource?: 'product-variation';
|
|
191
211
|
id?: string;
|
|
@@ -197,6 +217,9 @@ type ProductVariation = {
|
|
|
197
217
|
badge?: string;
|
|
198
218
|
quantity?: number;
|
|
199
219
|
media?: Media[];
|
|
220
|
+
preview?: Media[];
|
|
221
|
+
stock?: number | null;
|
|
222
|
+
weight?: number | null;
|
|
200
223
|
preorder?: boolean;
|
|
201
224
|
active?: boolean;
|
|
202
225
|
hidden?: boolean;
|
|
@@ -204,11 +227,9 @@ type ProductVariation = {
|
|
|
204
227
|
order?: number | null;
|
|
205
228
|
pieces?: ProductPieces | null;
|
|
206
229
|
discount?: ProductDiscount | null;
|
|
230
|
+
settings?: Record<string, unknown> | null;
|
|
207
231
|
product?: Product;
|
|
208
|
-
meta?:
|
|
209
|
-
appleProductId: string | null;
|
|
210
|
-
googleProductId: string | null;
|
|
211
|
-
};
|
|
232
|
+
meta?: ProductVariationMeta;
|
|
212
233
|
nativePriceStr?: string | null;
|
|
213
234
|
};
|
|
214
235
|
type Product = {
|
|
@@ -216,8 +237,10 @@ type Product = {
|
|
|
216
237
|
name: TranslatableValue;
|
|
217
238
|
description?: Partial<Record<WarpLocale, string>>;
|
|
218
239
|
price?: number;
|
|
219
|
-
unit?:
|
|
240
|
+
unit?: TranslatableValue | null;
|
|
220
241
|
active?: boolean;
|
|
242
|
+
public?: boolean;
|
|
243
|
+
meta?: ProductMeta;
|
|
221
244
|
virtual?: boolean;
|
|
222
245
|
tags?: string[] | null;
|
|
223
246
|
createdAt?: string;
|
|
@@ -227,6 +250,7 @@ type Product = {
|
|
|
227
250
|
rating?: ProductRating;
|
|
228
251
|
settings?: Record<string, unknown> | null;
|
|
229
252
|
volumePrices?: VolumePrice[];
|
|
253
|
+
media?: Media[];
|
|
230
254
|
};
|
|
231
255
|
type OrderItem = {
|
|
232
256
|
id: string;
|
|
@@ -243,7 +267,9 @@ type CartItem = {
|
|
|
243
267
|
type: 'service' | 'product';
|
|
244
268
|
sku: string | null;
|
|
245
269
|
badge: string | null;
|
|
270
|
+
configuration?: ProductConfiguration;
|
|
246
271
|
media: Media[];
|
|
272
|
+
product?: Product | null;
|
|
247
273
|
};
|
|
248
274
|
type Cart = {
|
|
249
275
|
subtotal: number;
|
|
@@ -262,19 +288,68 @@ type Coupon = {
|
|
|
262
288
|
percent: number;
|
|
263
289
|
expiresAt: string | null;
|
|
264
290
|
};
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/team/types.d.ts
|
|
293
|
+
type TeamFeature = 'shop' | 'appointments';
|
|
265
294
|
type Team = {
|
|
266
295
|
slug: string;
|
|
267
296
|
name: string;
|
|
268
297
|
personal: boolean;
|
|
269
|
-
description:
|
|
298
|
+
description: TranslatableValue | null;
|
|
270
299
|
locale: WarpLocale;
|
|
271
300
|
timezone: string;
|
|
301
|
+
settings?: TeamSettings;
|
|
302
|
+
features?: TeamFeature[];
|
|
303
|
+
cover?: string | null;
|
|
272
304
|
logo: string | null;
|
|
305
|
+
tagline?: TranslatableValue | null;
|
|
273
306
|
public: boolean;
|
|
274
307
|
createdAt: string;
|
|
275
308
|
blueprints?: Blueprint[];
|
|
276
309
|
flows?: Flow[];
|
|
277
310
|
};
|
|
311
|
+
type TeamBrand = {
|
|
312
|
+
bg?: string;
|
|
313
|
+
fg?: string;
|
|
314
|
+
label?: string;
|
|
315
|
+
logo?: string;
|
|
316
|
+
bankName?: string;
|
|
317
|
+
bankIban?: string;
|
|
318
|
+
bankBic?: string;
|
|
319
|
+
invoiceAddress?: string;
|
|
320
|
+
invoiceVat?: string;
|
|
321
|
+
invoiceCity?: string;
|
|
322
|
+
invoiceZip?: string;
|
|
323
|
+
invoiceCountry?: string;
|
|
324
|
+
};
|
|
325
|
+
type ByokProviderConfig = {
|
|
326
|
+
apiKey?: string;
|
|
327
|
+
accessKey?: string;
|
|
328
|
+
secretKey?: string;
|
|
329
|
+
};
|
|
330
|
+
type ByokProviders = {
|
|
331
|
+
openai?: ByokProviderConfig;
|
|
332
|
+
anthropic?: ByokProviderConfig;
|
|
333
|
+
google?: ByokProviderConfig;
|
|
334
|
+
xai?: ByokProviderConfig;
|
|
335
|
+
klingai?: ByokProviderConfig;
|
|
336
|
+
};
|
|
337
|
+
type TeamSettings = {
|
|
338
|
+
'extra.messages': number;
|
|
339
|
+
'limit.spending': number | null;
|
|
340
|
+
'currency': string;
|
|
341
|
+
'extra.usage.enabled'?: boolean;
|
|
342
|
+
'auto.reload.enabled'?: boolean;
|
|
343
|
+
'auto.reload.threshold_cents'?: number | null;
|
|
344
|
+
'auto.reload.amount_cents'?: number | null;
|
|
345
|
+
'llm.provider'?: 'openai' | 'anthropic' | 'google' | 'xai' | null;
|
|
346
|
+
'byok.providers'?: ByokProviders | null;
|
|
347
|
+
'board.auto.enabled'?: boolean;
|
|
348
|
+
'payments.online'?: boolean;
|
|
349
|
+
'payments.coupons'?: boolean;
|
|
350
|
+
'stock.enabled'?: boolean;
|
|
351
|
+
'branding'?: TeamBrand | null;
|
|
352
|
+
};
|
|
278
353
|
//#endregion
|
|
279
354
|
//#region src/flow/types.d.ts
|
|
280
355
|
type FlowCategory = 'none' | 'defi' | 'nft' | 'social' | 'devtools' | 'productivity' | 'trading' | 'portfolio';
|
|
@@ -488,6 +563,7 @@ type BrandBackend = {
|
|
|
488
563
|
locales: WarpLocale[];
|
|
489
564
|
warps: WarpBackend[];
|
|
490
565
|
isTeamOwned?: boolean;
|
|
566
|
+
isPublic?: boolean;
|
|
491
567
|
inviteCode?: string;
|
|
492
568
|
source?: BrandSourceConfig | null;
|
|
493
569
|
contract?: string;
|
|
@@ -604,17 +680,39 @@ type BlueprintShortcut = {
|
|
|
604
680
|
}; //#endregion
|
|
605
681
|
//#region src/helpers/string.d.ts
|
|
606
682
|
//#endregion
|
|
683
|
+
//#region src/service/types.d.ts
|
|
684
|
+
type Service = {
|
|
685
|
+
id: string;
|
|
686
|
+
slug: string;
|
|
687
|
+
name: TranslatableValue;
|
|
688
|
+
price: number;
|
|
689
|
+
durationMinutes: number;
|
|
690
|
+
tags?: string[] | null;
|
|
691
|
+
description: TranslatableValue | null;
|
|
692
|
+
active: boolean;
|
|
693
|
+
digital: boolean;
|
|
694
|
+
public: boolean;
|
|
695
|
+
createdAt: string;
|
|
696
|
+
updatedAt: string;
|
|
697
|
+
}; //#endregion
|
|
607
698
|
//#region src/appointment/types.d.ts
|
|
608
|
-
type
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
699
|
+
type AppointmentAvailabilityService = {
|
|
700
|
+
slug: string;
|
|
701
|
+
name: string | null;
|
|
702
|
+
durationMinutes: number | null;
|
|
703
|
+
};
|
|
704
|
+
type AppointmentAvailabilitySlot = {
|
|
705
|
+
startAt: string;
|
|
706
|
+
endAt: string;
|
|
707
|
+
agentUuid: string;
|
|
708
|
+
agentName: string;
|
|
709
|
+
serviceSlug: string | null;
|
|
612
710
|
};
|
|
613
711
|
type AppointmentAvailability = {
|
|
614
712
|
connected: boolean;
|
|
615
713
|
timezone: string;
|
|
616
|
-
service:
|
|
617
|
-
slots:
|
|
714
|
+
service: AppointmentAvailabilityService | null;
|
|
715
|
+
slots: AppointmentAvailabilitySlot[];
|
|
618
716
|
};
|
|
619
717
|
type AppointmentPolicy = {
|
|
620
718
|
timezone: string | null;
|
|
@@ -629,6 +727,8 @@ type AppointmentPolicy = {
|
|
|
629
727
|
blockedDates: string[] | null;
|
|
630
728
|
holidays: string[] | null;
|
|
631
729
|
conferenceEnabled: boolean | null;
|
|
730
|
+
serviceSelectionEnabled?: boolean | null;
|
|
731
|
+
paymentEnabled?: boolean | null;
|
|
632
732
|
};
|
|
633
733
|
type AppointmentBooking = {
|
|
634
734
|
id: string;
|
|
@@ -638,6 +738,7 @@ type AppointmentBooking = {
|
|
|
638
738
|
timezone: string | null;
|
|
639
739
|
conferenceUrl: string | null;
|
|
640
740
|
conferenceProvider: string | null;
|
|
741
|
+
inviteUrl?: string | null;
|
|
641
742
|
status: string;
|
|
642
743
|
attendeeEmail: string | null;
|
|
643
744
|
attendeeName: string | null;
|
|
@@ -843,21 +944,6 @@ type Reminder = {
|
|
|
843
944
|
dispatchedAt?: string | null;
|
|
844
945
|
createdAt: string;
|
|
845
946
|
}; //#endregion
|
|
846
|
-
//#region src/service/types.d.ts
|
|
847
|
-
type Service = {
|
|
848
|
-
id: string;
|
|
849
|
-
slug: string;
|
|
850
|
-
name: TranslatableValue;
|
|
851
|
-
price: number;
|
|
852
|
-
durationMinutes: number;
|
|
853
|
-
category: string | null;
|
|
854
|
-
description: TranslatableValue | null;
|
|
855
|
-
active: boolean;
|
|
856
|
-
digital: boolean;
|
|
857
|
-
public: boolean;
|
|
858
|
-
createdAt: string;
|
|
859
|
-
updatedAt: string;
|
|
860
|
-
}; //#endregion
|
|
861
947
|
//#region src/shortcut/types.d.ts
|
|
862
948
|
//#endregion
|
|
863
949
|
//#region src/site/types.d.ts
|
|
@@ -912,7 +998,8 @@ type LinkCreatePayload = {
|
|
|
912
998
|
url: string;
|
|
913
999
|
title: string;
|
|
914
1000
|
};
|
|
915
|
-
type LinkUpdatePayload = Partial<LinkCreatePayload>;
|
|
1001
|
+
type LinkUpdatePayload = Partial<LinkCreatePayload>;
|
|
1002
|
+
//#endregion
|
|
916
1003
|
//#region src/store/types.d.ts
|
|
917
1004
|
type StoreVisibility = 'private' | 'team' | 'public';
|
|
918
1005
|
type StoreEntry = {
|
|
@@ -967,6 +1054,7 @@ type Update = {
|
|
|
967
1054
|
title: string;
|
|
968
1055
|
body: string | null;
|
|
969
1056
|
imageUrl: string | null;
|
|
1057
|
+
media: Media[];
|
|
970
1058
|
linkUrl: string | null;
|
|
971
1059
|
startsAt: string | null;
|
|
972
1060
|
endsAt: string | null;
|
|
@@ -978,20 +1066,33 @@ type UpdateCreatePayload = {
|
|
|
978
1066
|
type: UpdateType;
|
|
979
1067
|
body?: string;
|
|
980
1068
|
imageUrl?: string;
|
|
1069
|
+
media?: MediaLibraryItems;
|
|
981
1070
|
linkUrl?: string;
|
|
982
1071
|
startsAt?: string;
|
|
983
1072
|
endsAt?: string;
|
|
984
1073
|
status?: UpdateStatus;
|
|
985
1074
|
};
|
|
986
|
-
type UpdateUpdatePayload = Partial<UpdateCreatePayload>;
|
|
1075
|
+
type UpdateUpdatePayload = Partial<UpdateCreatePayload>;
|
|
1076
|
+
type UpdateStats = {
|
|
1077
|
+
totalUpdates: number;
|
|
1078
|
+
activeUpdates: number;
|
|
1079
|
+
dealsCount: number;
|
|
1080
|
+
eventsCount: number;
|
|
1081
|
+
newsCount: number;
|
|
1082
|
+
publishedCount: number;
|
|
1083
|
+
draftCount: number;
|
|
1084
|
+
archivedCount: number;
|
|
1085
|
+
creationHistory: number[];
|
|
1086
|
+
}; //#endregion
|
|
987
1087
|
//#region src/swarm/types.d.ts
|
|
988
1088
|
//#endregion
|
|
989
1089
|
//#region src/resources/appointments.d.ts
|
|
990
1090
|
declare class AppointmentsResource {
|
|
991
1091
|
private readonly http;
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1092
|
+
private readonly config;
|
|
1093
|
+
constructor(http: IHttpService, config: JoAiClientConfig);
|
|
1094
|
+
getPolicy(): Promise<IAppResponse<AppointmentPolicy>>;
|
|
1095
|
+
upsertPolicy(data: Partial<AppointmentPolicy>): Promise<IAppResponse<AppointmentPolicy>>;
|
|
995
1096
|
checkAvailability(agentUuid: string, params: {
|
|
996
1097
|
windowStart: string;
|
|
997
1098
|
windowEnd: string;
|
|
@@ -1095,6 +1196,7 @@ declare class AuthResource {
|
|
|
1095
1196
|
phone: string | null;
|
|
1096
1197
|
email: string | null;
|
|
1097
1198
|
}>>;
|
|
1199
|
+
logout(): Promise<IAppResponse<void>>;
|
|
1098
1200
|
}
|
|
1099
1201
|
//#endregion
|
|
1100
1202
|
//#region src/resources/blueprints.d.ts
|
|
@@ -1113,10 +1215,13 @@ declare class CartsResource {
|
|
|
1113
1215
|
private readonly http;
|
|
1114
1216
|
constructor(http: IHttpService);
|
|
1115
1217
|
get(): Promise<IAppResponse<Cart>>;
|
|
1116
|
-
add(id: string, quantity?: number): Promise<IAppResponse<Cart>>;
|
|
1117
|
-
remove(id: string): Promise<IAppResponse<Cart>>;
|
|
1118
|
-
updateQuantity(id: string, quantity: number): Promise<IAppResponse<Cart>>;
|
|
1218
|
+
add(type: 'product' | 'service', id: string, quantity?: number, configuration?: ProductConfiguration): Promise<IAppResponse<Cart>>;
|
|
1219
|
+
remove(type: 'product' | 'service', id: string): Promise<IAppResponse<Cart>>;
|
|
1220
|
+
updateQuantity(type: 'product' | 'service', id: string, quantity: number): Promise<IAppResponse<Cart>>;
|
|
1119
1221
|
clear(): Promise<IAppResponse<Cart>>;
|
|
1222
|
+
applyCoupon(code: string): Promise<IAppResponse<{
|
|
1223
|
+
ok: boolean;
|
|
1224
|
+
}>>;
|
|
1120
1225
|
}
|
|
1121
1226
|
//#endregion
|
|
1122
1227
|
//#region src/resources/flows.d.ts
|
|
@@ -1141,8 +1246,8 @@ declare class MarketplaceResource {
|
|
|
1141
1246
|
declare class ServicesResource {
|
|
1142
1247
|
private readonly http;
|
|
1143
1248
|
constructor(http: IHttpService);
|
|
1144
|
-
|
|
1145
|
-
|
|
1249
|
+
list(team?: string): Promise<IAppResponse<Service[]>>;
|
|
1250
|
+
get(slug: string): Promise<IAppResponse<Service>>;
|
|
1146
1251
|
store(team: string, data: {
|
|
1147
1252
|
name: string;
|
|
1148
1253
|
price: number;
|
|
@@ -1230,6 +1335,19 @@ declare class MeetingsResource {
|
|
|
1230
1335
|
join(code: string): Promise<IAppResponse<MeetingJoinInfo>>;
|
|
1231
1336
|
}
|
|
1232
1337
|
//#endregion
|
|
1338
|
+
//#region src/resources/media.d.ts
|
|
1339
|
+
type MediaUploadType = 'brand' | 'reference' | 'template' | 'output';
|
|
1340
|
+
declare class MediaResource {
|
|
1341
|
+
private readonly http;
|
|
1342
|
+
constructor(http: IHttpService);
|
|
1343
|
+
upload(data: {
|
|
1344
|
+
team: string;
|
|
1345
|
+
file: File;
|
|
1346
|
+
type: MediaUploadType;
|
|
1347
|
+
label?: string;
|
|
1348
|
+
}): Promise<IAppResponse<Media>>;
|
|
1349
|
+
}
|
|
1350
|
+
//#endregion
|
|
1233
1351
|
//#region src/resources/ingestions.d.ts
|
|
1234
1352
|
declare class IngestionsResource {
|
|
1235
1353
|
private readonly http;
|
|
@@ -1281,6 +1399,7 @@ type Order = {
|
|
|
1281
1399
|
invoiceUrl: string | null;
|
|
1282
1400
|
createdAt: string;
|
|
1283
1401
|
items: OrderItem[];
|
|
1402
|
+
configuration: OrderConfigurationItem[];
|
|
1284
1403
|
contactId: string | null;
|
|
1285
1404
|
};
|
|
1286
1405
|
declare class OrdersResource {
|
|
@@ -1297,6 +1416,7 @@ declare class OrdersResource {
|
|
|
1297
1416
|
id: string;
|
|
1298
1417
|
type: 'product' | 'service';
|
|
1299
1418
|
quantity: number;
|
|
1419
|
+
configuration?: ProductConfiguration;
|
|
1300
1420
|
}[];
|
|
1301
1421
|
}): Promise<IAppResponse<Order>>;
|
|
1302
1422
|
}
|
|
@@ -1364,6 +1484,10 @@ declare class TeamsResource {
|
|
|
1364
1484
|
private readonly http;
|
|
1365
1485
|
constructor(http: IHttpService);
|
|
1366
1486
|
list(): Promise<IAppResponse<Team[]>>;
|
|
1487
|
+
listPublic(params?: {
|
|
1488
|
+
tags?: string;
|
|
1489
|
+
}): Promise<IAppResponse<Team[]>>;
|
|
1490
|
+
get(slug: string): Promise<IAppResponse<Team>>;
|
|
1367
1491
|
invite(teamSlug: string, payload: {
|
|
1368
1492
|
email: string;
|
|
1369
1493
|
role: 'owner' | 'admin' | 'member';
|
|
@@ -1403,6 +1527,7 @@ declare class UpdatesResource {
|
|
|
1403
1527
|
create(payload: UpdateCreatePayload): Promise<IAppResponse<Update>>;
|
|
1404
1528
|
update(id: string, payload: UpdateUpdatePayload): Promise<IAppResponse<Update>>;
|
|
1405
1529
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1530
|
+
stats(): Promise<IAppResponse<UpdateStats>>;
|
|
1406
1531
|
}
|
|
1407
1532
|
//#endregion
|
|
1408
1533
|
//#region src/resources/links.d.ts
|
|
@@ -1422,9 +1547,11 @@ declare class LinksResource {
|
|
|
1422
1547
|
//#endregion
|
|
1423
1548
|
//#region src/resources/warps.d.ts
|
|
1424
1549
|
type BackendWarpBrand = {
|
|
1550
|
+
slug: string;
|
|
1425
1551
|
name: string;
|
|
1426
1552
|
description?: WarpText | null;
|
|
1427
1553
|
logo?: string | null;
|
|
1554
|
+
isPublic?: boolean;
|
|
1428
1555
|
};
|
|
1429
1556
|
type BackendWarp = {
|
|
1430
1557
|
id: string;
|
|
@@ -1453,6 +1580,7 @@ declare class WarpsResource {
|
|
|
1453
1580
|
update(identifier: string, data: {
|
|
1454
1581
|
definition?: Record<string, any>;
|
|
1455
1582
|
agent?: string | null;
|
|
1583
|
+
public?: boolean;
|
|
1456
1584
|
}): Promise<IAppResponse<{
|
|
1457
1585
|
id: string;
|
|
1458
1586
|
}>>;
|
|
@@ -1511,6 +1639,7 @@ declare class JoAiClient {
|
|
|
1511
1639
|
readonly sites: SitesResource;
|
|
1512
1640
|
readonly documents: DocumentsResource;
|
|
1513
1641
|
readonly meetings: MeetingsResource;
|
|
1642
|
+
readonly media: MediaResource;
|
|
1514
1643
|
readonly stores: StoresResource;
|
|
1515
1644
|
readonly updates: UpdatesResource;
|
|
1516
1645
|
readonly links: LinksResource;
|
|
@@ -1520,7 +1649,7 @@ declare class JoAiClient {
|
|
|
1520
1649
|
readonly auth: AuthResource;
|
|
1521
1650
|
constructor(config: JoAiClientConfig);
|
|
1522
1651
|
clearCache(): void;
|
|
1523
|
-
warps(locale?: WarpLocale): WarpClient;
|
|
1652
|
+
warps(locale?: WarpLocale, currentUrl?: string): WarpClient;
|
|
1524
1653
|
}
|
|
1525
1654
|
declare function createClient(config: JoAiClientConfig): JoAiClient;
|
|
1526
1655
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -112,14 +112,15 @@ var HttpService = class {
|
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/resources/appointments.ts
|
|
114
114
|
var AppointmentsResource = class {
|
|
115
|
-
constructor(http) {
|
|
115
|
+
constructor(http, config) {
|
|
116
116
|
this.http = http;
|
|
117
|
+
this.config = config;
|
|
117
118
|
}
|
|
118
|
-
getPolicy(
|
|
119
|
-
return this.http.get(`
|
|
119
|
+
getPolicy() {
|
|
120
|
+
return this.http.get(`teams/${this.config.team}/appointments/policy`);
|
|
120
121
|
}
|
|
121
|
-
upsertPolicy(
|
|
122
|
-
return this.http.put(`
|
|
122
|
+
upsertPolicy(data) {
|
|
123
|
+
return this.http.put(`teams/${this.config.team}/appointments/policy`, data);
|
|
123
124
|
}
|
|
124
125
|
checkAvailability(agentUuid, params) {
|
|
125
126
|
return this.http.post(`agents/${agentUuid}/appointments/availability`, params);
|
|
@@ -175,6 +176,9 @@ var AuthResource = class {
|
|
|
175
176
|
me() {
|
|
176
177
|
return this.http.get("auth/me");
|
|
177
178
|
}
|
|
179
|
+
logout() {
|
|
180
|
+
return this.http.post("auth/logout");
|
|
181
|
+
}
|
|
178
182
|
};
|
|
179
183
|
//#endregion
|
|
180
184
|
//#region src/resources/blueprints.ts
|
|
@@ -200,25 +204,34 @@ var CartsResource = class {
|
|
|
200
204
|
this.http = http;
|
|
201
205
|
}
|
|
202
206
|
get() {
|
|
203
|
-
return this.http.get("cart");
|
|
207
|
+
return this.http.get("v1/cart");
|
|
204
208
|
}
|
|
205
|
-
add(id, quantity = 1) {
|
|
206
|
-
return this.http.post("cart/add", {
|
|
209
|
+
add(type, id, quantity = 1, configuration) {
|
|
210
|
+
return this.http.post("v1/cart/add", {
|
|
207
211
|
id,
|
|
208
|
-
|
|
212
|
+
type,
|
|
213
|
+
quantity,
|
|
214
|
+
configuration
|
|
209
215
|
});
|
|
210
216
|
}
|
|
211
|
-
remove(id) {
|
|
212
|
-
return this.http.post("cart/remove", {
|
|
217
|
+
remove(type, id) {
|
|
218
|
+
return this.http.post("v1/cart/remove", {
|
|
219
|
+
id,
|
|
220
|
+
type
|
|
221
|
+
});
|
|
213
222
|
}
|
|
214
|
-
updateQuantity(id, quantity) {
|
|
215
|
-
return this.http.post("cart/quantity", {
|
|
223
|
+
updateQuantity(type, id, quantity) {
|
|
224
|
+
return this.http.post("v1/cart/quantity", {
|
|
216
225
|
id,
|
|
226
|
+
type,
|
|
217
227
|
quantity
|
|
218
228
|
});
|
|
219
229
|
}
|
|
220
230
|
clear() {
|
|
221
|
-
return this.http.post("cart/clear");
|
|
231
|
+
return this.http.post("v1/cart/clear");
|
|
232
|
+
}
|
|
233
|
+
applyCoupon(code) {
|
|
234
|
+
return this.http.post("v1/cart/coupon", { code });
|
|
222
235
|
}
|
|
223
236
|
};
|
|
224
237
|
//#endregion
|
|
@@ -288,11 +301,12 @@ var ServicesResource = class {
|
|
|
288
301
|
constructor(http) {
|
|
289
302
|
this.http = http;
|
|
290
303
|
}
|
|
291
|
-
get(id) {
|
|
292
|
-
return this.http.get(`services/${id}`);
|
|
293
|
-
}
|
|
294
304
|
list(team) {
|
|
295
|
-
|
|
305
|
+
const url = team ? `services?team=${encodeURIComponent(team)}` : "services";
|
|
306
|
+
return this.http.get(url);
|
|
307
|
+
}
|
|
308
|
+
get(slug) {
|
|
309
|
+
return this.http.get(`services/${slug}`);
|
|
296
310
|
}
|
|
297
311
|
store(team, data) {
|
|
298
312
|
return this.http.post("services", {
|
|
@@ -412,6 +426,20 @@ var MeetingsResource = class {
|
|
|
412
426
|
}
|
|
413
427
|
};
|
|
414
428
|
//#endregion
|
|
429
|
+
//#region src/resources/media.ts
|
|
430
|
+
var MediaResource = class {
|
|
431
|
+
constructor(http) {
|
|
432
|
+
this.http = http;
|
|
433
|
+
}
|
|
434
|
+
upload(data) {
|
|
435
|
+
const formData = new FormData();
|
|
436
|
+
formData.append("file", data.file, data.file.name);
|
|
437
|
+
formData.append("type", data.type);
|
|
438
|
+
if (data.label) formData.append("label", data.label);
|
|
439
|
+
return this.http.post("media", formData, { headers: { "X-Team": data.team } });
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
//#endregion
|
|
415
443
|
//#region src/resources/ingestions.ts
|
|
416
444
|
var IngestionsResource = class {
|
|
417
445
|
constructor(http) {
|
|
@@ -571,6 +599,13 @@ var TeamsResource = class {
|
|
|
571
599
|
list() {
|
|
572
600
|
return this.http.get("teams");
|
|
573
601
|
}
|
|
602
|
+
listPublic(params) {
|
|
603
|
+
const qs = params?.tags ? `?tags=${encodeURIComponent(params.tags)}` : "";
|
|
604
|
+
return this.http.get(`teams/public${qs}`);
|
|
605
|
+
}
|
|
606
|
+
get(slug) {
|
|
607
|
+
return this.http.get(`teams/${encodeURIComponent(slug)}`);
|
|
608
|
+
}
|
|
574
609
|
invite(teamSlug, payload) {
|
|
575
610
|
return this.http.post(`teams/${teamSlug}/invitations`, payload);
|
|
576
611
|
}
|
|
@@ -631,6 +666,9 @@ var UpdatesResource = class {
|
|
|
631
666
|
delete(id) {
|
|
632
667
|
return this.http.delete(`updates/${id}`);
|
|
633
668
|
}
|
|
669
|
+
stats() {
|
|
670
|
+
return this.http.get("updates/stats");
|
|
671
|
+
}
|
|
634
672
|
};
|
|
635
673
|
//#endregion
|
|
636
674
|
//#region src/resources/links.ts
|
|
@@ -825,7 +863,7 @@ var JoAiClient = class {
|
|
|
825
863
|
const http = new HttpService(`${getApiBaseUrl(config.env ?? "mainnet")}/v1`, void 0, config.apiToken, { headers });
|
|
826
864
|
const cache = config.cache;
|
|
827
865
|
this.http = cache?.enabled !== false ? new CachedHttpService(http, cache?.overrides, cache?.defaultTtl) : http;
|
|
828
|
-
this.appointments = new AppointmentsResource(this.http);
|
|
866
|
+
this.appointments = new AppointmentsResource(this.http, config);
|
|
829
867
|
this.hub = new HubResource(this.http);
|
|
830
868
|
this.teams = new TeamsResource(this.http);
|
|
831
869
|
this.agents = new AgentsResource(this.http);
|
|
@@ -844,6 +882,7 @@ var JoAiClient = class {
|
|
|
844
882
|
this.sites = new SitesResource(this.http);
|
|
845
883
|
this.documents = new DocumentsResource(this.http);
|
|
846
884
|
this.meetings = new MeetingsResource(this.http);
|
|
885
|
+
this.media = new MediaResource(this.http);
|
|
847
886
|
this.stores = new StoresResource(this.http);
|
|
848
887
|
this.products = new ProductsResource(this.http);
|
|
849
888
|
this.orders = new OrdersResource(this.http);
|
|
@@ -857,9 +896,10 @@ var JoAiClient = class {
|
|
|
857
896
|
clearCache() {
|
|
858
897
|
if (this.http instanceof CachedHttpService) this.http.clearCache();
|
|
859
898
|
}
|
|
860
|
-
warps(locale = "en") {
|
|
899
|
+
warps(locale = "en", currentUrl) {
|
|
861
900
|
return new WarpClient({
|
|
862
901
|
env: toWarpEnv(this.env),
|
|
902
|
+
currentUrl,
|
|
863
903
|
preferences: { locale }
|
|
864
904
|
}, { chains: [] });
|
|
865
905
|
}
|