@joai/sdk 1.0.1 → 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 +152 -65
- package/dist/index.mjs +53 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -310,7 +310,7 @@ type TeamBrand = {
|
|
|
310
310
|
fg?: string;
|
|
311
311
|
label?: string;
|
|
312
312
|
logo?: string;
|
|
313
|
-
|
|
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 = {
|
|
@@ -802,6 +809,7 @@ 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;
|
|
@@ -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;
|
|
@@ -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 = {
|
|
@@ -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;
|
|
@@ -2620,7 +2651,7 @@ declare class AgentsResource {
|
|
|
2620
2651
|
updatePassword(uuid: string, password: string): Promise<IAppResponse<void>>;
|
|
2621
2652
|
storePassword(uuid: string, password: string): Promise<IAppResponse<AgentPrivate>>;
|
|
2622
2653
|
updateSetting<K extends keyof AgentSettings>(uuid: string, key: K, value: AgentSettings[K]): Promise<IAppResponse<AgentPrivate>>;
|
|
2623
|
-
updateMeta(uuid: string, key: string, value:
|
|
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(
|
|
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;
|
|
@@ -3654,7 +3712,9 @@ declare class RoomsResource {
|
|
|
3654
3712
|
declare class ServicesResource {
|
|
3655
3713
|
private readonly http;
|
|
3656
3714
|
constructor(http: IHttpService);
|
|
3657
|
-
list(
|
|
3715
|
+
list(params?: {
|
|
3716
|
+
includePrivate?: boolean;
|
|
3717
|
+
}): Promise<IAppResponse<Service[]>>;
|
|
3658
3718
|
get(slug: string): Promise<IAppResponse<Service>>;
|
|
3659
3719
|
store(team: string, data: {
|
|
3660
3720
|
name: TranslatableValue;
|
|
@@ -3837,6 +3897,8 @@ type TeamMutationPayload = {
|
|
|
3837
3897
|
email?: string | null;
|
|
3838
3898
|
address?: string | null;
|
|
3839
3899
|
location?: string | null;
|
|
3900
|
+
logoMediaId?: string | null;
|
|
3901
|
+
coverMediaId?: string | null;
|
|
3840
3902
|
};
|
|
3841
3903
|
declare class TeamsResource {
|
|
3842
3904
|
private readonly http;
|
|
@@ -3982,11 +4044,13 @@ type BackendWarpCreateResponse = Pick<BackendWarp, 'id' | 'url' | 'definition' |
|
|
|
3982
4044
|
type BackendWarpUpdateResponse = Pick<BackendWarp, 'id'>;
|
|
3983
4045
|
type BackendWarp = {
|
|
3984
4046
|
id: string;
|
|
4047
|
+
hash: string;
|
|
3985
4048
|
title: string;
|
|
3986
4049
|
url: string;
|
|
3987
4050
|
definition: WarpDefinition;
|
|
3988
4051
|
brand: BackendWarpBrand | null;
|
|
3989
4052
|
agent?: AgentPrivate | null;
|
|
4053
|
+
link?: Link | null;
|
|
3990
4054
|
};
|
|
3991
4055
|
declare class WarpsResource {
|
|
3992
4056
|
private readonly http;
|
|
@@ -3996,23 +4060,41 @@ declare class WarpsResource {
|
|
|
3996
4060
|
creator?: string;
|
|
3997
4061
|
primaryAddress?: string;
|
|
3998
4062
|
status?: WarpBackendStatus;
|
|
4063
|
+
form?: boolean;
|
|
4064
|
+
store?: boolean;
|
|
3999
4065
|
page?: number;
|
|
4000
4066
|
perPage?: number;
|
|
4001
4067
|
}): Promise<IAppResponse<WarpBackend[]>>;
|
|
4002
4068
|
show(identifier: string): Promise<IAppResponse<WarpBackend>>;
|
|
4003
4069
|
create(data: {
|
|
4004
|
-
brand
|
|
4070
|
+
brand?: string | null;
|
|
4005
4071
|
definition: WarpDefinition;
|
|
4072
|
+
title?: TranslatableValue;
|
|
4073
|
+
description?: TranslatableValue | null;
|
|
4074
|
+
extras?: Record<string, any> | null;
|
|
4006
4075
|
public?: boolean;
|
|
4076
|
+
form?: boolean;
|
|
4077
|
+
store?: boolean;
|
|
4007
4078
|
agent?: string | null;
|
|
4008
4079
|
}): Promise<IAppResponse<BackendWarpCreateResponse>>;
|
|
4009
4080
|
update(identifier: string, data: {
|
|
4081
|
+
name?: string;
|
|
4082
|
+
title?: TranslatableValue;
|
|
4083
|
+
description?: TranslatableValue | null;
|
|
4010
4084
|
definition?: WarpDefinition;
|
|
4085
|
+
extras?: Record<string, any> | null;
|
|
4086
|
+
form?: boolean;
|
|
4087
|
+
store?: boolean;
|
|
4011
4088
|
agent?: string | null;
|
|
4012
4089
|
public?: boolean;
|
|
4013
4090
|
}): Promise<IAppResponse<BackendWarpUpdateResponse>>;
|
|
4014
4091
|
destroy(identifier: string): Promise<IAppResponse<void>>;
|
|
4015
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
|
+
}>>;
|
|
4016
4098
|
sync(tx: string): Promise<IAppResponse<void>>;
|
|
4017
4099
|
listBrands(locale: WarpLocale, options?: {
|
|
4018
4100
|
chain?: string | string[];
|
|
@@ -4053,12 +4135,16 @@ declare class WarpsResource {
|
|
|
4053
4135
|
definition: Record<string, any>;
|
|
4054
4136
|
extras?: Record<string, any>;
|
|
4055
4137
|
agent?: string | null;
|
|
4138
|
+
form?: boolean;
|
|
4139
|
+
store?: boolean;
|
|
4056
4140
|
}): Promise<IAppResponse<WarpBackend>>;
|
|
4057
4141
|
updateBrandWarp(teamSlug: string, brandSlug: string, warpHash: string, data: {
|
|
4058
4142
|
name?: string;
|
|
4059
4143
|
definition?: Record<string, any>;
|
|
4060
4144
|
extras?: Record<string, any>;
|
|
4061
4145
|
agent?: string | null;
|
|
4146
|
+
form?: boolean;
|
|
4147
|
+
store?: boolean;
|
|
4062
4148
|
}): Promise<IAppResponse<WarpBackend>>;
|
|
4063
4149
|
deleteBrandWarp(teamSlug: string, brandSlug: string, warpHash: string): Promise<IAppResponse<void>>;
|
|
4064
4150
|
fetchSourceSchemaFromUrl(url: string): Promise<IAppResponse<any>>;
|
|
@@ -4153,6 +4239,7 @@ declare class JoAiClient {
|
|
|
4153
4239
|
readonly notifications: NotificationsResource;
|
|
4154
4240
|
readonly office: OfficeResource;
|
|
4155
4241
|
readonly orders: OrdersResource;
|
|
4242
|
+
readonly coupons: CouponsResource;
|
|
4156
4243
|
readonly persona: PersonaResource;
|
|
4157
4244
|
readonly privateWarps: WarpsResource;
|
|
4158
4245
|
readonly products: ProductsResource;
|
package/dist/index.mjs
CHANGED
|
@@ -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
|
-
|
|
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}`);
|
|
@@ -1659,8 +1693,10 @@ var ServicesResource = class {
|
|
|
1659
1693
|
constructor(http) {
|
|
1660
1694
|
this.http = http;
|
|
1661
1695
|
}
|
|
1662
|
-
list() {
|
|
1663
|
-
|
|
1696
|
+
list(params) {
|
|
1697
|
+
let url = "services";
|
|
1698
|
+
if (params?.includePrivate) url += "?includePrivate=1";
|
|
1699
|
+
return this.http.get(url);
|
|
1664
1700
|
}
|
|
1665
1701
|
get(slug) {
|
|
1666
1702
|
return this.http.get(`services/${slug}`);
|
|
@@ -2218,6 +2254,8 @@ var WarpsResource = class {
|
|
|
2218
2254
|
if (options?.creator) params.set("creator", options.creator);
|
|
2219
2255
|
if (options?.primaryAddress) params.set("primaryAddress", options.primaryAddress);
|
|
2220
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");
|
|
2221
2259
|
if (options?.page) params.set("page", options.page.toString());
|
|
2222
2260
|
if (options?.perPage) params.set("perPage", options.perPage.toString());
|
|
2223
2261
|
const qs = params.toString();
|
|
@@ -2241,6 +2279,15 @@ var WarpsResource = class {
|
|
|
2241
2279
|
...room ? { room } : {}
|
|
2242
2280
|
});
|
|
2243
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
|
+
}
|
|
2244
2291
|
sync(tx) {
|
|
2245
2292
|
return this.http.post("warps/sync", { tx });
|
|
2246
2293
|
}
|
|
@@ -2511,6 +2558,7 @@ var JoAiClient = class {
|
|
|
2511
2558
|
this.notifications = new NotificationsResource(this.http);
|
|
2512
2559
|
this.office = new OfficeResource(this.http);
|
|
2513
2560
|
this.orders = new OrdersResource(this.http);
|
|
2561
|
+
this.coupons = new CouponsResource(this.http);
|
|
2514
2562
|
this.persona = new PersonaResource(this.http);
|
|
2515
2563
|
this.privateWarps = new WarpsResource(this.http);
|
|
2516
2564
|
this.products = new ProductsResource(this.http);
|