@marteye/studiojs 1.1.13 → 1.1.15
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.common.d.ts +11 -0
- package/dist/index.d.ts +363 -84
- package/dist/index.esm.js +4741 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4741 -6
- package/dist/index.js.map +1 -1
- package/dist/net/http.d.ts +2 -2
- package/dist/resources/actions.d.ts +0 -1
- package/dist/resources/customers.d.ts +1 -3
- package/dist/resources/files.d.ts +12 -0
- package/dist/resources/lots.d.ts +8 -4
- package/dist/resources/webhooks.d.ts +0 -1
- package/dist/resources.d.ts +92 -79
- package/dist/studio.d.ts +91 -78
- package/dist/types.d.ts +4 -2
- package/dist/utils/multipart-upload.d.ts +201 -0
- package/package.json +16 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|--------------------------------------------------
|
|
3
|
+
| Common code for the Studio JS SDK
|
|
4
|
+
| Code here can run in both Node, Native and Browser environments
|
|
5
|
+
|--------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import { ChunkedFile, MediaUploadOptions, FileInput, ChunkedInput } from "./utils/multipart-upload";
|
|
8
|
+
export type { ChunkedFile, MediaUploadOptions, FileInput, ChunkedInput };
|
|
9
|
+
import * as StudioTypes from "./types";
|
|
10
|
+
export { StudioTypes };
|
|
11
|
+
export * from "./createApp";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const videoTaskSchema: z.ZodEnum<["compressed", "thumbnail"]>;
|
|
4
|
+
declare const imageSizeSchema: z.ZodEnum<["small", "medium", "large"]>;
|
|
5
|
+
type ImageSize = z.infer<typeof imageSizeSchema>;
|
|
6
|
+
type VideoTask = z.infer<typeof videoTaskSchema>;
|
|
7
|
+
type SupportedFileTypesNames = "image" | "video" | "file";
|
|
8
|
+
type VariantProcessingState = {
|
|
9
|
+
fileName: string;
|
|
10
|
+
thumbHash: string;
|
|
11
|
+
path: string;
|
|
12
|
+
url: string;
|
|
13
|
+
fileType: string;
|
|
14
|
+
variants: Partial<Record<ImageSize | VideoTask, {
|
|
15
|
+
url: string;
|
|
16
|
+
isProcessing: boolean;
|
|
17
|
+
type: SupportedFileTypesNames;
|
|
18
|
+
}>>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
|--------------------------------------------------
|
|
22
|
+
| END OF MEDIA CRATE CODE
|
|
23
|
+
|--------------------------------------------------
|
|
24
|
+
*/
|
|
25
|
+
type MediaFinishUploadResponse = {
|
|
26
|
+
message: string;
|
|
27
|
+
mediaType: string;
|
|
28
|
+
process: VariantProcessingState;
|
|
29
|
+
};
|
|
30
|
+
type MediaUploadOptions = {
|
|
31
|
+
marketId: string;
|
|
32
|
+
saleId: string;
|
|
33
|
+
lotId: string;
|
|
34
|
+
attributeId: string;
|
|
35
|
+
options?: {
|
|
36
|
+
bucket?: "raw";
|
|
37
|
+
parallelParts?: number;
|
|
38
|
+
baseUrl?: string;
|
|
39
|
+
progressCallback?: (progress: {
|
|
40
|
+
/**
|
|
41
|
+
* The state of the upload
|
|
42
|
+
*/
|
|
43
|
+
state: "uploading" | "finished" | "failed" | "starting";
|
|
44
|
+
/**
|
|
45
|
+
* The progress of the upload
|
|
46
|
+
*/
|
|
47
|
+
progress: number;
|
|
48
|
+
/**
|
|
49
|
+
* The current part number
|
|
50
|
+
*/
|
|
51
|
+
currentPart?: number;
|
|
52
|
+
/**
|
|
53
|
+
* The total parts
|
|
54
|
+
*/
|
|
55
|
+
totalParts?: number;
|
|
56
|
+
}) => void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type ChunkedFile = {
|
|
60
|
+
partNumber: string;
|
|
61
|
+
chunk: string;
|
|
62
|
+
fileExtension: string;
|
|
63
|
+
fileMimeType: string;
|
|
64
|
+
};
|
|
65
|
+
type FileInput = {
|
|
66
|
+
file: File;
|
|
67
|
+
uploadConfig: MediaUploadOptions;
|
|
68
|
+
};
|
|
69
|
+
type ChunkedInput = {
|
|
70
|
+
fileName: string;
|
|
71
|
+
chunks: ChunkedFile[];
|
|
72
|
+
uploadConfig: MediaUploadOptions;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Handles the complete file upload process including chunking and progress tracking -
|
|
76
|
+
* WEB: Pass in a file and we will chunk it and upload it in parallel
|
|
77
|
+
* NATIVE: You need to chunk the file yourself.
|
|
78
|
+
* @param {FileInput | ChunkedInput} input - Either {file, options} or {fileName, chunks, options}
|
|
79
|
+
* @returns {Promise<MediaFinishUploadResponse>}
|
|
80
|
+
* @throws {Error} When upload fails
|
|
81
|
+
*/
|
|
82
|
+
declare const uploadFile: (input: FileInput | ChunkedInput, token: string) => Promise<MediaFinishUploadResponse>;
|
|
83
|
+
|
|
84
|
+
declare function SimpleHttpClient(baseUrl: string, apiKey: string, fetch: any, defaultTimeout: number, debug?: boolean): {
|
|
85
|
+
get: <T>(path: string, queryParams?: any) => Promise<T>;
|
|
86
|
+
post: <T>(path: string, body: any) => Promise<T>;
|
|
87
|
+
delete: <T>(path: string) => Promise<T>;
|
|
88
|
+
};
|
|
89
|
+
type HttpClient = ReturnType<typeof SimpleHttpClient>;
|
|
90
|
+
|
|
1
91
|
/**
|
|
2
92
|
* Search result interface based on the API implementation
|
|
3
93
|
*/
|
|
@@ -249,12 +339,14 @@ interface Lot {
|
|
|
249
339
|
notes?: string;
|
|
250
340
|
currency: CurrenciesWithGuinea;
|
|
251
341
|
unitOfSale: UnitOfSale;
|
|
342
|
+
reservePriceInCents?: number | null;
|
|
343
|
+
startingPriceInCents?: number | null;
|
|
252
344
|
unitPriceInCents?: number;
|
|
253
345
|
buyerCasual?: string | null;
|
|
254
346
|
buyerCustomerId: string | null;
|
|
255
347
|
buyer?: ShortCustomerDetails | null;
|
|
256
|
-
|
|
257
|
-
|
|
348
|
+
startAt?: Timestamp;
|
|
349
|
+
endAt?: Timestamp;
|
|
258
350
|
sellerInvoiceId: string | null;
|
|
259
351
|
sellerInvoiceNumber?: number | undefined | null;
|
|
260
352
|
buyerInvoiceId: string | null;
|
|
@@ -1035,15 +1127,14 @@ type types_WebhookEvent<T> = WebhookEvent<T>;
|
|
|
1035
1127
|
type types_WebhookEventName = WebhookEventName;
|
|
1036
1128
|
declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
|
|
1037
1129
|
declare namespace types {
|
|
1038
|
-
export {
|
|
1130
|
+
export { types_LivestockSuperTypes as LivestockSuperTypes, types_SupportedCurrencyCodes as SupportedCurrencyCodes, types_SupportedPaymentMethods as SupportedPaymentMethods, types_SupportedSuperTypes as SupportedSuperTypes, types_SupportedUnitsOfSale as SupportedUnitsOfSale, types_supportedWebhookEvents as supportedWebhookEvents };
|
|
1131
|
+
export type { types_Accessory as Accessory, types_Address as Address, types_AddressWrapper as AddressWrapper, types_AdjustmentTarget as AdjustmentTarget, types_AdjustmentTotalTarget as AdjustmentTotalTarget, types_AdjustmentsConfiguration as AdjustmentsConfiguration, types_AppParameterConfig as AppParameterConfig, types_AttributeDefinition as AttributeDefinition, types_AttributeValueType as AttributeValueType, types_BankDetails as BankDetails, types_Cart as Cart, types_CartItem as CartItem, types_ChequeField as ChequeField, types_ClientType as ClientType, types_CurrenciesWithGuinea as CurrenciesWithGuinea, types_Currency as Currency, types_Customer as Customer, types_CustomerFromSearch as CustomerFromSearch, types_DeviceType as DeviceType, types_DraftInvoice as DraftInvoice, types_EmailWrapper as EmailWrapper, types_FarmAssurances as FarmAssurances, types_FieldPositions as FieldPositions, types_IncrementLadder as IncrementLadder, types_IncrementLadderItem as IncrementLadderItem, types_Invoice as Invoice, types_InvoiceField as InvoiceField, types_InvoiceLineItem as InvoiceLineItem, types_InvoiceTotalAdjustmentConfiguration as InvoiceTotalAdjustmentConfiguration, types_InvoiceTotals as InvoiceTotals, types_LineItemAdjustmentConfiguration as LineItemAdjustmentConfiguration, types_Lot as Lot, types_LotGeneratedValues as LotGeneratedValues, types_LotIssue as LotIssue, types_LotItem as LotItem, types_LotSaleStatus as LotSaleStatus, types_LotWithItemsAsArray as LotWithItemsAsArray, types_Market as Market, types_MarketBankDetails as MarketBankDetails, types_MarketReportHeaders as MarketReportHeaders, types_MartEyeLiveSaleSettings as MartEyeLiveSaleSettings, types_MartEyeTimedSaleSettings as MartEyeTimedSaleSettings, types_Media as Media, types_MemberSharingConfiguration as MemberSharingConfiguration, types_ObjectType as ObjectType, types_Payment as Payment, types_PaymentMethod as PaymentMethod, types_Payout as Payout, types_PayoutMethod as PayoutMethod, types_PhoneNumberWrapper as PhoneNumberWrapper, types_Printer as Printer, types_Product as Product, types_ProductCodeConfiguration as ProductCodeConfiguration, types_ProductConfiguration as ProductConfiguration, types_Sale as Sale, types_SaleFromSearch as SaleFromSearch, types_SettingsAccessories as SettingsAccessories, types_SettingsAdjustmentsConfiguration as SettingsAdjustmentsConfiguration, types_SettingsGlobalAttributes as SettingsGlobalAttributes, types_SettingsMarketDefaults as SettingsMarketDefaults, types_SettingsPrinters as SettingsPrinters, types_SettingsProductCodes as SettingsProductCodes, types_SettingsTaxRates as SettingsTaxRates, types_ShortCustomerDetails as ShortCustomerDetails, types_SimplePaymentIn as SimplePaymentIn, types_SimplePaymentOut as SimplePaymentOut, types_StudioAppPartial as StudioAppPartial, types_SubtotalGroups as SubtotalGroups, types_SuperType as SuperType, types_SupportedAttributeTypes as SupportedAttributeTypes, types_SupportedCountryCode as SupportedCountryCode, types_TablePosition as TablePosition, types_TaxRate as TaxRate, types_UnitOfSale as UnitOfSale, types_WebhookEvent as WebhookEvent, types_WebhookEventName as WebhookEventName };
|
|
1039
1132
|
}
|
|
1040
1133
|
|
|
1041
1134
|
interface CreateCustomerPayload {
|
|
1042
|
-
|
|
1043
|
-
lastName?: string;
|
|
1135
|
+
displayName: string;
|
|
1044
1136
|
email?: string;
|
|
1045
1137
|
phone?: string;
|
|
1046
|
-
tradingName: string;
|
|
1047
1138
|
accountNumberPrefix?: string;
|
|
1048
1139
|
accountNumber?: string;
|
|
1049
1140
|
cphNumber?: string;
|
|
@@ -1062,6 +1153,179 @@ interface CreateCustomerPayload {
|
|
|
1062
1153
|
marteyeUid?: string;
|
|
1063
1154
|
}
|
|
1064
1155
|
|
|
1156
|
+
declare function resources(httpClient: HttpClient): {
|
|
1157
|
+
markets: {
|
|
1158
|
+
get: (marketId: string) => Promise<Market>;
|
|
1159
|
+
};
|
|
1160
|
+
sales: {
|
|
1161
|
+
get: (marketId: string, saleId: string) => Promise<Sale>;
|
|
1162
|
+
list: (marketId: string, opts: {
|
|
1163
|
+
start?: string;
|
|
1164
|
+
end?: string;
|
|
1165
|
+
}) => Promise<{
|
|
1166
|
+
start: string;
|
|
1167
|
+
end: string;
|
|
1168
|
+
sales: Sale[];
|
|
1169
|
+
}>;
|
|
1170
|
+
create: (marketId: string, saleData: {
|
|
1171
|
+
name: string;
|
|
1172
|
+
startsAt: string;
|
|
1173
|
+
availableProductCodes: string[];
|
|
1174
|
+
recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
|
|
1175
|
+
martEyeSaleType?: "LIVE" | "TIMED" | null;
|
|
1176
|
+
location?: string | null;
|
|
1177
|
+
description?: string | null;
|
|
1178
|
+
image?: string | null;
|
|
1179
|
+
cover?: string | null;
|
|
1180
|
+
attributeDefaults?: {
|
|
1181
|
+
[attributekey: string]: string | number | boolean;
|
|
1182
|
+
};
|
|
1183
|
+
}) => Promise<{
|
|
1184
|
+
saleId: string;
|
|
1185
|
+
}>;
|
|
1186
|
+
update: (marketId: string, saleId: string, data: {
|
|
1187
|
+
name?: string;
|
|
1188
|
+
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
|
|
1189
|
+
defaultProductCode?: string;
|
|
1190
|
+
attributeDefaults?: Record<string, any>;
|
|
1191
|
+
martEyeId?: string | null;
|
|
1192
|
+
marteyeSettings?: {
|
|
1193
|
+
description?: string;
|
|
1194
|
+
image?: string;
|
|
1195
|
+
logo?: string;
|
|
1196
|
+
type: "LIVE" | "TIMED";
|
|
1197
|
+
location?: string | null;
|
|
1198
|
+
descriptionLines?: string[];
|
|
1199
|
+
descriptionLink?: string;
|
|
1200
|
+
deposit?: number;
|
|
1201
|
+
hidePrices?: boolean;
|
|
1202
|
+
hideReplay?: boolean;
|
|
1203
|
+
labels?: string[];
|
|
1204
|
+
tags?: string[];
|
|
1205
|
+
details?: Array<{
|
|
1206
|
+
markdownBase64: string;
|
|
1207
|
+
title: string;
|
|
1208
|
+
}>;
|
|
1209
|
+
cover?: string;
|
|
1210
|
+
primaryColour?: string;
|
|
1211
|
+
secondaryColour?: string;
|
|
1212
|
+
foregroundColour?: string;
|
|
1213
|
+
extensionTime?: number;
|
|
1214
|
+
incrementLadder?: Array<{
|
|
1215
|
+
max: number;
|
|
1216
|
+
increment: number;
|
|
1217
|
+
}>;
|
|
1218
|
+
hideNav?: boolean;
|
|
1219
|
+
signInOverrideLink?: string;
|
|
1220
|
+
published?: boolean;
|
|
1221
|
+
pin?: boolean;
|
|
1222
|
+
cascade?: boolean;
|
|
1223
|
+
reportEmail?: string;
|
|
1224
|
+
} | null;
|
|
1225
|
+
}) => Promise<Sale>;
|
|
1226
|
+
};
|
|
1227
|
+
lots: {
|
|
1228
|
+
get: (marketId: string, saleId: string, lotId: string) => Promise<Lot>;
|
|
1229
|
+
list: (marketId: string, saleId: string) => Promise<Lot[]>;
|
|
1230
|
+
create: (marketId: string, saleId: string, data: {
|
|
1231
|
+
index?: number;
|
|
1232
|
+
lotNumber?: string;
|
|
1233
|
+
group?: string;
|
|
1234
|
+
productCode?: string;
|
|
1235
|
+
sellerCustomerId?: string;
|
|
1236
|
+
attributes?: Record<string, any>;
|
|
1237
|
+
metadata?: Record<string, any>;
|
|
1238
|
+
buyerCustomerId?: string;
|
|
1239
|
+
unitPriceInCents?: number;
|
|
1240
|
+
reservePriceInCents?: number;
|
|
1241
|
+
startingPriceInCents?: number;
|
|
1242
|
+
startAt?: string;
|
|
1243
|
+
endAt?: string;
|
|
1244
|
+
previousLotNumber?: string;
|
|
1245
|
+
saleStatus?: LotSaleStatus;
|
|
1246
|
+
}) => Promise<Lot>;
|
|
1247
|
+
update: (marketId: string, saleId: string, lotId: string, data: {
|
|
1248
|
+
productCode?: string;
|
|
1249
|
+
attributes?: Record<string, any>;
|
|
1250
|
+
sellerCasual?: string | null;
|
|
1251
|
+
sellerCustomerId?: string | null;
|
|
1252
|
+
lotNumber?: string | null;
|
|
1253
|
+
remarks?: string;
|
|
1254
|
+
notes?: string;
|
|
1255
|
+
unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
|
|
1256
|
+
unitPriceInCents?: number;
|
|
1257
|
+
reservePriceInCents?: number;
|
|
1258
|
+
startingPriceInCents?: number;
|
|
1259
|
+
buyerCasual?: string | null;
|
|
1260
|
+
buyerCustomerId?: string | null;
|
|
1261
|
+
startAt?: string | null;
|
|
1262
|
+
endAt?: string | null;
|
|
1263
|
+
saleStatus?: LotSaleStatus;
|
|
1264
|
+
metadata?: Record<string, any>;
|
|
1265
|
+
}) => Promise<Lot>;
|
|
1266
|
+
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
1267
|
+
};
|
|
1268
|
+
lotitems: {
|
|
1269
|
+
create: (marketId: string, saleId: string, lotId: string, data: {
|
|
1270
|
+
attributes?: Record<string, any>;
|
|
1271
|
+
notes?: Array<{
|
|
1272
|
+
text: string;
|
|
1273
|
+
}>;
|
|
1274
|
+
metadata?: Record<string, any>;
|
|
1275
|
+
}) => Promise<LotItem>;
|
|
1276
|
+
update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
|
|
1277
|
+
attributes?: Record<string, any>;
|
|
1278
|
+
index?: number;
|
|
1279
|
+
metadata?: Record<string, any>;
|
|
1280
|
+
}) => Promise<LotItem>;
|
|
1281
|
+
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
1282
|
+
};
|
|
1283
|
+
webhooks: {
|
|
1284
|
+
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
|
|
1285
|
+
};
|
|
1286
|
+
actions: {
|
|
1287
|
+
constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
|
|
1288
|
+
};
|
|
1289
|
+
settings: {
|
|
1290
|
+
get: (marketId: string) => Promise<SettingsMarketDefaults>;
|
|
1291
|
+
};
|
|
1292
|
+
adjustments: {
|
|
1293
|
+
list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
|
|
1294
|
+
get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
|
|
1295
|
+
};
|
|
1296
|
+
productCodes: {
|
|
1297
|
+
list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
|
|
1298
|
+
get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
|
|
1299
|
+
};
|
|
1300
|
+
taxRates: {
|
|
1301
|
+
list: (marketId: string) => Promise<TaxRate[]>;
|
|
1302
|
+
get: (marketId: string, id: string) => Promise<TaxRate>;
|
|
1303
|
+
};
|
|
1304
|
+
customers: {
|
|
1305
|
+
list: (marketId: string) => Promise<Customer>;
|
|
1306
|
+
get: (marketId: string, customerId: string) => Promise<Customer>;
|
|
1307
|
+
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
1308
|
+
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
1309
|
+
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
|
|
1310
|
+
};
|
|
1311
|
+
search: {
|
|
1312
|
+
query: (marketId: string, query: string) => Promise<SearchResult>;
|
|
1313
|
+
};
|
|
1314
|
+
files: {
|
|
1315
|
+
uploadFile: (input: Parameters<typeof uploadFile>[0], token: string) => Promise<{
|
|
1316
|
+
message: string;
|
|
1317
|
+
mediaType: string;
|
|
1318
|
+
process: VariantProcessingState;
|
|
1319
|
+
}>;
|
|
1320
|
+
deleteFile: (fileUrl: string, token: string) => Promise<{
|
|
1321
|
+
data: boolean;
|
|
1322
|
+
}>;
|
|
1323
|
+
};
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1326
|
+
type StudioInstance = ReturnType<typeof resources> & {
|
|
1327
|
+
isDebugMode: boolean;
|
|
1328
|
+
};
|
|
1065
1329
|
declare function Studio(info?: {
|
|
1066
1330
|
apiKey?: string;
|
|
1067
1331
|
baseUrl?: string;
|
|
@@ -1075,8 +1339,8 @@ declare function Studio(info?: {
|
|
|
1075
1339
|
sales: {
|
|
1076
1340
|
get: (marketId: string, saleId: string) => Promise<Sale>;
|
|
1077
1341
|
list: (marketId: string, opts: {
|
|
1078
|
-
start?: string
|
|
1079
|
-
end?: string
|
|
1342
|
+
start?: string;
|
|
1343
|
+
end?: string;
|
|
1080
1344
|
}) => Promise<{
|
|
1081
1345
|
start: string;
|
|
1082
1346
|
end: string;
|
|
@@ -1086,113 +1350,117 @@ declare function Studio(info?: {
|
|
|
1086
1350
|
name: string;
|
|
1087
1351
|
startsAt: string;
|
|
1088
1352
|
availableProductCodes: string[];
|
|
1089
|
-
recurring?: "Weekly" | "Bi-weekly" | "Monthly"
|
|
1090
|
-
martEyeSaleType?: "LIVE" | "TIMED" | null
|
|
1091
|
-
location?: string | null
|
|
1092
|
-
description?: string | null
|
|
1093
|
-
image?: string | null
|
|
1094
|
-
cover?: string | null
|
|
1353
|
+
recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
|
|
1354
|
+
martEyeSaleType?: "LIVE" | "TIMED" | null;
|
|
1355
|
+
location?: string | null;
|
|
1356
|
+
description?: string | null;
|
|
1357
|
+
image?: string | null;
|
|
1358
|
+
cover?: string | null;
|
|
1095
1359
|
attributeDefaults?: {
|
|
1096
1360
|
[attributekey: string]: string | number | boolean;
|
|
1097
|
-
}
|
|
1361
|
+
};
|
|
1098
1362
|
}) => Promise<{
|
|
1099
1363
|
saleId: string;
|
|
1100
1364
|
}>;
|
|
1101
1365
|
update: (marketId: string, saleId: string, data: {
|
|
1102
|
-
name?: string
|
|
1103
|
-
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null
|
|
1104
|
-
defaultProductCode?: string
|
|
1105
|
-
attributeDefaults?: Record<string, any
|
|
1106
|
-
martEyeId?: string | null
|
|
1366
|
+
name?: string;
|
|
1367
|
+
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
|
|
1368
|
+
defaultProductCode?: string;
|
|
1369
|
+
attributeDefaults?: Record<string, any>;
|
|
1370
|
+
martEyeId?: string | null;
|
|
1107
1371
|
marteyeSettings?: {
|
|
1108
|
-
description?: string
|
|
1109
|
-
image?: string
|
|
1110
|
-
logo?: string
|
|
1372
|
+
description?: string;
|
|
1373
|
+
image?: string;
|
|
1374
|
+
logo?: string;
|
|
1111
1375
|
type: "LIVE" | "TIMED";
|
|
1112
|
-
location?: string | null
|
|
1113
|
-
descriptionLines?: string[]
|
|
1114
|
-
descriptionLink?: string
|
|
1115
|
-
deposit?: number
|
|
1116
|
-
hidePrices?: boolean
|
|
1117
|
-
hideReplay?: boolean
|
|
1118
|
-
labels?: string[]
|
|
1119
|
-
tags?: string[]
|
|
1120
|
-
details?: {
|
|
1376
|
+
location?: string | null;
|
|
1377
|
+
descriptionLines?: string[];
|
|
1378
|
+
descriptionLink?: string;
|
|
1379
|
+
deposit?: number;
|
|
1380
|
+
hidePrices?: boolean;
|
|
1381
|
+
hideReplay?: boolean;
|
|
1382
|
+
labels?: string[];
|
|
1383
|
+
tags?: string[];
|
|
1384
|
+
details?: Array<{
|
|
1121
1385
|
markdownBase64: string;
|
|
1122
1386
|
title: string;
|
|
1123
|
-
}
|
|
1124
|
-
cover?: string
|
|
1125
|
-
primaryColour?: string
|
|
1126
|
-
secondaryColour?: string
|
|
1127
|
-
foregroundColour?: string
|
|
1128
|
-
extensionTime?: number
|
|
1129
|
-
incrementLadder?: {
|
|
1387
|
+
}>;
|
|
1388
|
+
cover?: string;
|
|
1389
|
+
primaryColour?: string;
|
|
1390
|
+
secondaryColour?: string;
|
|
1391
|
+
foregroundColour?: string;
|
|
1392
|
+
extensionTime?: number;
|
|
1393
|
+
incrementLadder?: Array<{
|
|
1130
1394
|
max: number;
|
|
1131
1395
|
increment: number;
|
|
1132
|
-
}
|
|
1133
|
-
hideNav?: boolean
|
|
1134
|
-
signInOverrideLink?: string
|
|
1135
|
-
published?: boolean
|
|
1136
|
-
pin?: boolean
|
|
1137
|
-
cascade?: boolean
|
|
1138
|
-
reportEmail?: string
|
|
1139
|
-
} | null
|
|
1396
|
+
}>;
|
|
1397
|
+
hideNav?: boolean;
|
|
1398
|
+
signInOverrideLink?: string;
|
|
1399
|
+
published?: boolean;
|
|
1400
|
+
pin?: boolean;
|
|
1401
|
+
cascade?: boolean;
|
|
1402
|
+
reportEmail?: string;
|
|
1403
|
+
} | null;
|
|
1140
1404
|
}) => Promise<Sale>;
|
|
1141
1405
|
};
|
|
1142
1406
|
lots: {
|
|
1143
1407
|
get: (marketId: string, saleId: string, lotId: string) => Promise<Lot>;
|
|
1144
1408
|
list: (marketId: string, saleId: string) => Promise<Lot[]>;
|
|
1145
1409
|
create: (marketId: string, saleId: string, data: {
|
|
1146
|
-
index?: number
|
|
1147
|
-
lotNumber?: string
|
|
1148
|
-
group?: string
|
|
1149
|
-
productCode?: string
|
|
1150
|
-
sellerCustomerId?: string
|
|
1151
|
-
attributes?: Record<string, any
|
|
1152
|
-
metadata?: Record<string, any
|
|
1153
|
-
buyerCustomerId?: string
|
|
1154
|
-
unitPriceInCents?: number
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1410
|
+
index?: number;
|
|
1411
|
+
lotNumber?: string;
|
|
1412
|
+
group?: string;
|
|
1413
|
+
productCode?: string;
|
|
1414
|
+
sellerCustomerId?: string;
|
|
1415
|
+
attributes?: Record<string, any>;
|
|
1416
|
+
metadata?: Record<string, any>;
|
|
1417
|
+
buyerCustomerId?: string;
|
|
1418
|
+
unitPriceInCents?: number;
|
|
1419
|
+
reservePriceInCents?: number;
|
|
1420
|
+
startingPriceInCents?: number;
|
|
1421
|
+
startAt?: string;
|
|
1422
|
+
endAt?: string;
|
|
1423
|
+
previousLotNumber?: string;
|
|
1424
|
+
saleStatus?: LotSaleStatus;
|
|
1159
1425
|
}) => Promise<Lot>;
|
|
1160
1426
|
update: (marketId: string, saleId: string, lotId: string, data: {
|
|
1161
|
-
productCode?: string
|
|
1162
|
-
attributes?: Record<string, any
|
|
1163
|
-
sellerCasual?: string | null
|
|
1164
|
-
sellerCustomerId?: string | null
|
|
1165
|
-
lotNumber?: string | null
|
|
1166
|
-
remarks?: string
|
|
1167
|
-
notes?: string
|
|
1168
|
-
unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG"
|
|
1169
|
-
unitPriceInCents?: number
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1427
|
+
productCode?: string;
|
|
1428
|
+
attributes?: Record<string, any>;
|
|
1429
|
+
sellerCasual?: string | null;
|
|
1430
|
+
sellerCustomerId?: string | null;
|
|
1431
|
+
lotNumber?: string | null;
|
|
1432
|
+
remarks?: string;
|
|
1433
|
+
notes?: string;
|
|
1434
|
+
unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
|
|
1435
|
+
unitPriceInCents?: number;
|
|
1436
|
+
reservePriceInCents?: number;
|
|
1437
|
+
startingPriceInCents?: number;
|
|
1438
|
+
buyerCasual?: string | null;
|
|
1439
|
+
buyerCustomerId?: string | null;
|
|
1440
|
+
startAt?: string | null;
|
|
1441
|
+
endAt?: string | null;
|
|
1442
|
+
saleStatus?: LotSaleStatus;
|
|
1443
|
+
metadata?: Record<string, any>;
|
|
1176
1444
|
}) => Promise<Lot>;
|
|
1177
1445
|
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
1178
1446
|
};
|
|
1179
1447
|
lotitems: {
|
|
1180
1448
|
create: (marketId: string, saleId: string, lotId: string, data: {
|
|
1181
|
-
attributes?: Record<string, any
|
|
1182
|
-
notes?: {
|
|
1449
|
+
attributes?: Record<string, any>;
|
|
1450
|
+
notes?: Array<{
|
|
1183
1451
|
text: string;
|
|
1184
|
-
}
|
|
1185
|
-
metadata?: Record<string, any
|
|
1452
|
+
}>;
|
|
1453
|
+
metadata?: Record<string, any>;
|
|
1186
1454
|
}) => Promise<LotItem>;
|
|
1187
1455
|
update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
|
|
1188
|
-
attributes?: Record<string, any
|
|
1189
|
-
index?: number
|
|
1190
|
-
metadata?: Record<string, any
|
|
1456
|
+
attributes?: Record<string, any>;
|
|
1457
|
+
index?: number;
|
|
1458
|
+
metadata?: Record<string, any>;
|
|
1191
1459
|
}) => Promise<LotItem>;
|
|
1192
1460
|
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
1193
1461
|
};
|
|
1194
1462
|
webhooks: {
|
|
1195
|
-
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string |
|
|
1463
|
+
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
|
|
1196
1464
|
};
|
|
1197
1465
|
actions: {
|
|
1198
1466
|
constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
|
|
@@ -1222,6 +1490,16 @@ declare function Studio(info?: {
|
|
|
1222
1490
|
search: {
|
|
1223
1491
|
query: (marketId: string, query: string) => Promise<SearchResult>;
|
|
1224
1492
|
};
|
|
1493
|
+
files: {
|
|
1494
|
+
uploadFile: (input: Parameters<typeof uploadFile>[0], token: string) => Promise<{
|
|
1495
|
+
message: string;
|
|
1496
|
+
mediaType: string;
|
|
1497
|
+
process: VariantProcessingState;
|
|
1498
|
+
}>;
|
|
1499
|
+
deleteFile: (fileUrl: string, token: string) => Promise<{
|
|
1500
|
+
data: boolean;
|
|
1501
|
+
}>;
|
|
1502
|
+
};
|
|
1225
1503
|
};
|
|
1226
1504
|
|
|
1227
1505
|
/**
|
|
@@ -1288,4 +1566,5 @@ declare function createAppManifest(appConfig: {
|
|
|
1288
1566
|
readonly manifest: StudioManifest;
|
|
1289
1567
|
};
|
|
1290
1568
|
|
|
1291
|
-
export { Studio, StudioHeaders,
|
|
1569
|
+
export { Studio, StudioHeaders, types as StudioTypes, createAppManifest, Studio as default };
|
|
1570
|
+
export type { ChunkedFile, StudioInstance, StudioManifest };
|