@joai/sdk 0.10.1 → 0.11.1
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 +74 -35
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -154,6 +154,70 @@ type AppSubscription = {
|
|
|
154
154
|
createdAt: string;
|
|
155
155
|
updatedAt: string;
|
|
156
156
|
};
|
|
157
|
+
type ProductRating = {
|
|
158
|
+
average: number;
|
|
159
|
+
count: number;
|
|
160
|
+
};
|
|
161
|
+
type ProductPieces = {
|
|
162
|
+
amount: number;
|
|
163
|
+
name: string;
|
|
164
|
+
};
|
|
165
|
+
type ProductDiscount = {
|
|
166
|
+
original: number;
|
|
167
|
+
percent: number;
|
|
168
|
+
};
|
|
169
|
+
type ProductVariationType = {
|
|
170
|
+
name: string;
|
|
171
|
+
};
|
|
172
|
+
type ProductRelationType = 'cross_sell' | 'upsell' | 'add_on';
|
|
173
|
+
type ProductRelation = {
|
|
174
|
+
id: string;
|
|
175
|
+
name: TranslatableValue;
|
|
176
|
+
slug: string;
|
|
177
|
+
price: number;
|
|
178
|
+
unit: string | null;
|
|
179
|
+
type: ProductRelationType;
|
|
180
|
+
position: number;
|
|
181
|
+
variations: ProductVariation[];
|
|
182
|
+
};
|
|
183
|
+
type ProductVariation = {
|
|
184
|
+
resource?: 'product-variation';
|
|
185
|
+
sku: string;
|
|
186
|
+
name: TranslatableValue;
|
|
187
|
+
type?: ProductVariationType | null;
|
|
188
|
+
description?: Partial<Record<WarpLocale, string>>;
|
|
189
|
+
price: number;
|
|
190
|
+
badge?: string;
|
|
191
|
+
quantity?: number;
|
|
192
|
+
media?: Media[];
|
|
193
|
+
preorder?: boolean;
|
|
194
|
+
active?: boolean;
|
|
195
|
+
hidden?: boolean;
|
|
196
|
+
availableAt?: string | null;
|
|
197
|
+
pieces?: ProductPieces | null;
|
|
198
|
+
discount?: ProductDiscount | null;
|
|
199
|
+
product?: Product;
|
|
200
|
+
meta?: {
|
|
201
|
+
appleProductId: string | null;
|
|
202
|
+
googleProductId: string | null;
|
|
203
|
+
};
|
|
204
|
+
nativePriceStr?: string | null;
|
|
205
|
+
};
|
|
206
|
+
type Product = {
|
|
207
|
+
slug: string;
|
|
208
|
+
name: TranslatableValue;
|
|
209
|
+
description?: Partial<Record<WarpLocale, string>>;
|
|
210
|
+
price?: number;
|
|
211
|
+
unit?: string | null;
|
|
212
|
+
active?: boolean;
|
|
213
|
+
virtual?: boolean;
|
|
214
|
+
tags?: string[] | null;
|
|
215
|
+
createdAt?: string;
|
|
216
|
+
updatedAt?: string;
|
|
217
|
+
variations: ProductVariation[];
|
|
218
|
+
relatedProducts?: ProductRelation[];
|
|
219
|
+
rating?: ProductRating;
|
|
220
|
+
};
|
|
157
221
|
type Team = {
|
|
158
222
|
slug: string;
|
|
159
223
|
name: string;
|
|
@@ -1014,50 +1078,25 @@ declare class OrdersResource {
|
|
|
1014
1078
|
constructor(http: IHttpService);
|
|
1015
1079
|
create(data: {
|
|
1016
1080
|
contactId: string;
|
|
1081
|
+
notes?: string;
|
|
1017
1082
|
items: OrderItem[];
|
|
1018
1083
|
}): Promise<IAppResponse<Order>>;
|
|
1019
1084
|
}
|
|
1020
1085
|
//#endregion
|
|
1021
1086
|
//#region src/resources/products.d.ts
|
|
1022
|
-
type ProductVariation = {
|
|
1023
|
-
id: string;
|
|
1024
|
-
sku: string;
|
|
1025
|
-
name: TranslatableValue;
|
|
1026
|
-
description: string | null;
|
|
1027
|
-
price: number;
|
|
1028
|
-
badge: string;
|
|
1029
|
-
meta: Record<string, unknown> | null;
|
|
1030
|
-
active: boolean;
|
|
1031
|
-
order: number | null;
|
|
1032
|
-
type: string | null;
|
|
1033
|
-
};
|
|
1034
|
-
type ProductItem = {
|
|
1035
|
-
id: string;
|
|
1036
|
-
slug: string;
|
|
1037
|
-
name: TranslatableValue;
|
|
1038
|
-
price: number;
|
|
1039
|
-
unit: string;
|
|
1040
|
-
tags: string[];
|
|
1041
|
-
description: string;
|
|
1042
|
-
active: boolean;
|
|
1043
|
-
createdAt?: string;
|
|
1044
|
-
updatedAt?: string;
|
|
1045
|
-
variations?: ProductVariation[];
|
|
1046
|
-
settings?: Record<string, unknown> | null;
|
|
1047
|
-
};
|
|
1048
1087
|
declare class ProductsResource {
|
|
1049
1088
|
private readonly http;
|
|
1050
1089
|
constructor(http: IHttpService);
|
|
1051
|
-
list(): Promise<IAppResponse<
|
|
1052
|
-
get(id: string): Promise<IAppResponse<
|
|
1090
|
+
list(): Promise<IAppResponse<Product[]>>;
|
|
1091
|
+
get(id: string): Promise<IAppResponse<Product>>;
|
|
1053
1092
|
create(data: {
|
|
1054
1093
|
name: TranslatableValue;
|
|
1055
|
-
price: number;
|
|
1056
1094
|
unit?: string;
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1095
|
+
}): Promise<IAppResponse<Product>>;
|
|
1096
|
+
update(id: string, data: {
|
|
1097
|
+
name?: TranslatableValue;
|
|
1098
|
+
active?: boolean;
|
|
1099
|
+
}): Promise<IAppResponse<Product>>;
|
|
1061
1100
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1062
1101
|
}
|
|
1063
1102
|
//#endregion
|
|
@@ -1199,7 +1238,7 @@ declare class WarpsResource {
|
|
|
1199
1238
|
id: string;
|
|
1200
1239
|
}>>;
|
|
1201
1240
|
destroy(identifier: string): Promise<IAppResponse<unknown>>;
|
|
1202
|
-
execute(identifier: string, inputs:
|
|
1241
|
+
execute(identifier: string, inputs: string[], room?: string): Promise<IAppResponse<any>>;
|
|
1203
1242
|
}
|
|
1204
1243
|
//#endregion
|
|
1205
1244
|
//#region src/resources/subscriptions.d.ts
|
|
@@ -1292,4 +1331,4 @@ declare class DistributionResource {
|
|
|
1292
1331
|
private fetchDistribution;
|
|
1293
1332
|
}
|
|
1294
1333
|
//#endregion
|
|
1295
|
-
export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type Order, type OrderItem, OrdersResource, type
|
|
1334
|
+
export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type Order, type OrderItem, OrdersResource, type Product, type ProductVariation, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
|
package/dist/index.mjs
CHANGED
|
@@ -592,8 +592,11 @@ var WarpsResource = class {
|
|
|
592
592
|
destroy(identifier) {
|
|
593
593
|
return this.http.delete(`warps/${identifier}`);
|
|
594
594
|
}
|
|
595
|
-
execute(identifier, inputs) {
|
|
596
|
-
return this.http.post(`warps/${identifier}/execute`, {
|
|
595
|
+
execute(identifier, inputs, room) {
|
|
596
|
+
return this.http.post(`warps/${identifier}/execute`, {
|
|
597
|
+
inputs,
|
|
598
|
+
...room ? { room } : {}
|
|
599
|
+
});
|
|
597
600
|
}
|
|
598
601
|
};
|
|
599
602
|
//#endregion
|