@marteye/studiojs 1.1.14 → 1.1.16

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.
@@ -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$1 = "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$1;
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
  */
@@ -558,21 +648,22 @@ interface Address {
558
648
  zip: string;
559
649
  country: string;
560
650
  }
561
- interface ImageThumbnail {
562
- url: string;
563
- width: number;
564
- height: number;
565
- }
651
+ declare const IMAGE_SIZES_VALUES: readonly ["small", "medium", "large"];
652
+ declare const VIDEO_TASKS_VALUES: readonly ["compressed", "thumbnail"];
653
+ type ImageSizes = (typeof IMAGE_SIZES_VALUES)[number];
654
+ type VideoTasks = (typeof VIDEO_TASKS_VALUES)[number];
655
+ type SupportedFileTypesNames = "image" | "video" | "file";
566
656
  interface Media {
567
- id: string;
657
+ fileName: string;
658
+ path: string;
568
659
  url: string;
569
- type: "image/jpeg" | "image/png" | "video/mp4" | "application/pdf";
570
- filename: string;
571
- thumbnails?: {
572
- small?: ImageThumbnail;
573
- medium?: ImageThumbnail;
574
- large?: ImageThumbnail;
575
- };
660
+ fileType: string;
661
+ variants: Partial<Record<ImageSizes | VideoTasks, {
662
+ url: string;
663
+ isLocal?: boolean;
664
+ isProcessing: boolean;
665
+ type: SupportedFileTypesNames;
666
+ }>>;
576
667
  }
577
668
  type MarketReportHeaders = "grossServices" | "vatOnServices" | "grossGoods" | "vatOnGoods" | "netTotal" | "contra";
578
669
  /**
@@ -977,6 +1068,8 @@ type types_DraftInvoice = DraftInvoice;
977
1068
  type types_EmailWrapper = EmailWrapper;
978
1069
  type types_FarmAssurances = FarmAssurances;
979
1070
  type types_FieldPositions = FieldPositions;
1071
+ declare const types_IMAGE_SIZES_VALUES: typeof IMAGE_SIZES_VALUES;
1072
+ type types_ImageSizes = ImageSizes;
980
1073
  type types_IncrementLadder = IncrementLadder;
981
1074
  type types_IncrementLadderItem = IncrementLadderItem;
982
1075
  type types_Invoice = Invoice;
@@ -1027,17 +1120,21 @@ type types_SuperType = SuperType;
1027
1120
  type types_SupportedAttributeTypes = SupportedAttributeTypes;
1028
1121
  type types_SupportedCountryCode = SupportedCountryCode;
1029
1122
  declare const types_SupportedCurrencyCodes: typeof SupportedCurrencyCodes;
1123
+ type types_SupportedFileTypesNames = SupportedFileTypesNames;
1030
1124
  declare const types_SupportedPaymentMethods: typeof SupportedPaymentMethods;
1031
1125
  declare const types_SupportedSuperTypes: typeof SupportedSuperTypes;
1032
1126
  declare const types_SupportedUnitsOfSale: typeof SupportedUnitsOfSale;
1033
1127
  type types_TablePosition = TablePosition;
1034
1128
  type types_TaxRate = TaxRate;
1035
1129
  type types_UnitOfSale = UnitOfSale;
1130
+ declare const types_VIDEO_TASKS_VALUES: typeof VIDEO_TASKS_VALUES;
1131
+ type types_VideoTasks = VideoTasks;
1036
1132
  type types_WebhookEvent<T> = WebhookEvent<T>;
1037
1133
  type types_WebhookEventName = WebhookEventName;
1038
1134
  declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
1039
1135
  declare namespace types {
1040
- export { type types_Accessory as Accessory, type types_Address as Address, type types_AddressWrapper as AddressWrapper, type types_AdjustmentTarget as AdjustmentTarget, type types_AdjustmentTotalTarget as AdjustmentTotalTarget, type types_AdjustmentsConfiguration as AdjustmentsConfiguration, type types_AppParameterConfig as AppParameterConfig, type types_AttributeDefinition as AttributeDefinition, type types_AttributeValueType as AttributeValueType, type types_BankDetails as BankDetails, type types_Cart as Cart, type types_CartItem as CartItem, type types_ChequeField as ChequeField, type types_ClientType as ClientType, type types_CurrenciesWithGuinea as CurrenciesWithGuinea, type types_Currency as Currency, type types_Customer as Customer, type types_CustomerFromSearch as CustomerFromSearch, type types_DeviceType as DeviceType, type types_DraftInvoice as DraftInvoice, type types_EmailWrapper as EmailWrapper, type types_FarmAssurances as FarmAssurances, type types_FieldPositions as FieldPositions, type types_IncrementLadder as IncrementLadder, type types_IncrementLadderItem as IncrementLadderItem, type types_Invoice as Invoice, type types_InvoiceField as InvoiceField, type types_InvoiceLineItem as InvoiceLineItem, type types_InvoiceTotalAdjustmentConfiguration as InvoiceTotalAdjustmentConfiguration, type types_InvoiceTotals as InvoiceTotals, type types_LineItemAdjustmentConfiguration as LineItemAdjustmentConfiguration, types_LivestockSuperTypes as LivestockSuperTypes, type types_Lot as Lot, type types_LotGeneratedValues as LotGeneratedValues, type types_LotIssue as LotIssue, type types_LotItem as LotItem, type types_LotSaleStatus as LotSaleStatus, type types_LotWithItemsAsArray as LotWithItemsAsArray, type types_Market as Market, type types_MarketBankDetails as MarketBankDetails, type types_MarketReportHeaders as MarketReportHeaders, type types_MartEyeLiveSaleSettings as MartEyeLiveSaleSettings, type types_MartEyeTimedSaleSettings as MartEyeTimedSaleSettings, type types_Media as Media, type types_MemberSharingConfiguration as MemberSharingConfiguration, type types_ObjectType as ObjectType, type types_Payment as Payment, type types_PaymentMethod as PaymentMethod, type types_Payout as Payout, type types_PayoutMethod as PayoutMethod, type types_PhoneNumberWrapper as PhoneNumberWrapper, type types_Printer as Printer, type types_Product as Product, type types_ProductCodeConfiguration as ProductCodeConfiguration, type types_ProductConfiguration as ProductConfiguration, type types_Sale as Sale, type types_SaleFromSearch as SaleFromSearch, type types_SettingsAccessories as SettingsAccessories, type types_SettingsAdjustmentsConfiguration as SettingsAdjustmentsConfiguration, type types_SettingsGlobalAttributes as SettingsGlobalAttributes, type types_SettingsMarketDefaults as SettingsMarketDefaults, type types_SettingsPrinters as SettingsPrinters, type types_SettingsProductCodes as SettingsProductCodes, type types_SettingsTaxRates as SettingsTaxRates, type types_ShortCustomerDetails as ShortCustomerDetails, type types_SimplePaymentIn as SimplePaymentIn, type types_SimplePaymentOut as SimplePaymentOut, type types_StudioAppPartial as StudioAppPartial, type types_SubtotalGroups as SubtotalGroups, type types_SuperType as SuperType, type types_SupportedAttributeTypes as SupportedAttributeTypes, type types_SupportedCountryCode as SupportedCountryCode, types_SupportedCurrencyCodes as SupportedCurrencyCodes, types_SupportedPaymentMethods as SupportedPaymentMethods, types_SupportedSuperTypes as SupportedSuperTypes, types_SupportedUnitsOfSale as SupportedUnitsOfSale, type types_TablePosition as TablePosition, type types_TaxRate as TaxRate, type types_UnitOfSale as UnitOfSale, type types_WebhookEvent as WebhookEvent, type types_WebhookEventName as WebhookEventName, types_supportedWebhookEvents as supportedWebhookEvents };
1136
+ export { types_IMAGE_SIZES_VALUES as IMAGE_SIZES_VALUES, types_LivestockSuperTypes as LivestockSuperTypes, types_SupportedCurrencyCodes as SupportedCurrencyCodes, types_SupportedPaymentMethods as SupportedPaymentMethods, types_SupportedSuperTypes as SupportedSuperTypes, types_SupportedUnitsOfSale as SupportedUnitsOfSale, types_VIDEO_TASKS_VALUES as VIDEO_TASKS_VALUES, types_supportedWebhookEvents as supportedWebhookEvents };
1137
+ 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_ImageSizes as ImageSizes, 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_SupportedFileTypesNames as SupportedFileTypesNames, types_TablePosition as TablePosition, types_TaxRate as TaxRate, types_UnitOfSale as UnitOfSale, types_VideoTasks as VideoTasks, types_WebhookEvent as WebhookEvent, types_WebhookEventName as WebhookEventName };
1041
1138
  }
1042
1139
 
1043
1140
  interface CreateCustomerPayload {
@@ -1062,6 +1159,179 @@ interface CreateCustomerPayload {
1062
1159
  marteyeUid?: string;
1063
1160
  }
1064
1161
 
1162
+ declare function resources(httpClient: HttpClient): {
1163
+ markets: {
1164
+ get: (marketId: string) => Promise<Market>;
1165
+ };
1166
+ sales: {
1167
+ get: (marketId: string, saleId: string) => Promise<Sale>;
1168
+ list: (marketId: string, opts: {
1169
+ start?: string;
1170
+ end?: string;
1171
+ }) => Promise<{
1172
+ start: string;
1173
+ end: string;
1174
+ sales: Sale[];
1175
+ }>;
1176
+ create: (marketId: string, saleData: {
1177
+ name: string;
1178
+ startsAt: string;
1179
+ availableProductCodes: string[];
1180
+ recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
1181
+ martEyeSaleType?: "LIVE" | "TIMED" | null;
1182
+ location?: string | null;
1183
+ description?: string | null;
1184
+ image?: string | null;
1185
+ cover?: string | null;
1186
+ attributeDefaults?: {
1187
+ [attributekey: string]: string | number | boolean;
1188
+ };
1189
+ }) => Promise<{
1190
+ saleId: string;
1191
+ }>;
1192
+ update: (marketId: string, saleId: string, data: {
1193
+ name?: string;
1194
+ recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
1195
+ defaultProductCode?: string;
1196
+ attributeDefaults?: Record<string, any>;
1197
+ martEyeId?: string | null;
1198
+ marteyeSettings?: {
1199
+ description?: string;
1200
+ image?: string;
1201
+ logo?: string;
1202
+ type: "LIVE" | "TIMED";
1203
+ location?: string | null;
1204
+ descriptionLines?: string[];
1205
+ descriptionLink?: string;
1206
+ deposit?: number;
1207
+ hidePrices?: boolean;
1208
+ hideReplay?: boolean;
1209
+ labels?: string[];
1210
+ tags?: string[];
1211
+ details?: Array<{
1212
+ markdownBase64: string;
1213
+ title: string;
1214
+ }>;
1215
+ cover?: string;
1216
+ primaryColour?: string;
1217
+ secondaryColour?: string;
1218
+ foregroundColour?: string;
1219
+ extensionTime?: number;
1220
+ incrementLadder?: Array<{
1221
+ max: number;
1222
+ increment: number;
1223
+ }>;
1224
+ hideNav?: boolean;
1225
+ signInOverrideLink?: string;
1226
+ published?: boolean;
1227
+ pin?: boolean;
1228
+ cascade?: boolean;
1229
+ reportEmail?: string;
1230
+ } | null;
1231
+ }) => Promise<Sale>;
1232
+ };
1233
+ lots: {
1234
+ get: (marketId: string, saleId: string, lotId: string) => Promise<Lot>;
1235
+ list: (marketId: string, saleId: string) => Promise<Lot[]>;
1236
+ create: (marketId: string, saleId: string, data: {
1237
+ index?: number;
1238
+ lotNumber?: string;
1239
+ group?: string;
1240
+ productCode?: string;
1241
+ sellerCustomerId?: string;
1242
+ attributes?: Record<string, any>;
1243
+ metadata?: Record<string, any>;
1244
+ buyerCustomerId?: string;
1245
+ unitPriceInCents?: number;
1246
+ reservePriceInCents?: number;
1247
+ startingPriceInCents?: number;
1248
+ startAt?: string;
1249
+ endAt?: string;
1250
+ previousLotNumber?: string;
1251
+ saleStatus?: LotSaleStatus;
1252
+ }) => Promise<Lot>;
1253
+ update: (marketId: string, saleId: string, lotId: string, data: {
1254
+ productCode?: string;
1255
+ attributes?: Record<string, any>;
1256
+ sellerCasual?: string | null;
1257
+ sellerCustomerId?: string | null;
1258
+ lotNumber?: string | null;
1259
+ remarks?: string;
1260
+ notes?: string;
1261
+ unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
1262
+ unitPriceInCents?: number;
1263
+ reservePriceInCents?: number;
1264
+ startingPriceInCents?: number;
1265
+ buyerCasual?: string | null;
1266
+ buyerCustomerId?: string | null;
1267
+ startAt?: string | null;
1268
+ endAt?: string | null;
1269
+ saleStatus?: LotSaleStatus;
1270
+ metadata?: Record<string, any>;
1271
+ }) => Promise<Lot>;
1272
+ delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
1273
+ };
1274
+ lotitems: {
1275
+ create: (marketId: string, saleId: string, lotId: string, data: {
1276
+ attributes?: Record<string, any>;
1277
+ notes?: Array<{
1278
+ text: string;
1279
+ }>;
1280
+ metadata?: Record<string, any>;
1281
+ }) => Promise<LotItem>;
1282
+ update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
1283
+ attributes?: Record<string, any>;
1284
+ index?: number;
1285
+ metadata?: Record<string, any>;
1286
+ }) => Promise<LotItem>;
1287
+ delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
1288
+ };
1289
+ webhooks: {
1290
+ constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
1291
+ };
1292
+ actions: {
1293
+ constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
1294
+ };
1295
+ settings: {
1296
+ get: (marketId: string) => Promise<SettingsMarketDefaults>;
1297
+ };
1298
+ adjustments: {
1299
+ list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
1300
+ get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
1301
+ };
1302
+ productCodes: {
1303
+ list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
1304
+ get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
1305
+ };
1306
+ taxRates: {
1307
+ list: (marketId: string) => Promise<TaxRate[]>;
1308
+ get: (marketId: string, id: string) => Promise<TaxRate>;
1309
+ };
1310
+ customers: {
1311
+ list: (marketId: string) => Promise<Customer>;
1312
+ get: (marketId: string, customerId: string) => Promise<Customer>;
1313
+ avatar: (marketId: string, customerId: string) => Promise<Customer>;
1314
+ create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
1315
+ getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
1316
+ };
1317
+ search: {
1318
+ query: (marketId: string, query: string) => Promise<SearchResult>;
1319
+ };
1320
+ files: {
1321
+ uploadFile: (input: Parameters<typeof uploadFile>[0], token: string) => Promise<{
1322
+ message: string;
1323
+ mediaType: string;
1324
+ process: VariantProcessingState;
1325
+ }>;
1326
+ deleteFile: (fileUrl: string, token: string) => Promise<{
1327
+ data: boolean;
1328
+ }>;
1329
+ };
1330
+ };
1331
+
1332
+ type StudioInstance = ReturnType<typeof resources> & {
1333
+ isDebugMode: boolean;
1334
+ };
1065
1335
  declare function Studio(info?: {
1066
1336
  apiKey?: string;
1067
1337
  baseUrl?: string;
@@ -1075,8 +1345,8 @@ declare function Studio(info?: {
1075
1345
  sales: {
1076
1346
  get: (marketId: string, saleId: string) => Promise<Sale>;
1077
1347
  list: (marketId: string, opts: {
1078
- start?: string | undefined;
1079
- end?: string | undefined;
1348
+ start?: string;
1349
+ end?: string;
1080
1350
  }) => Promise<{
1081
1351
  start: string;
1082
1352
  end: string;
@@ -1086,117 +1356,117 @@ declare function Studio(info?: {
1086
1356
  name: string;
1087
1357
  startsAt: string;
1088
1358
  availableProductCodes: string[];
1089
- recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
1090
- martEyeSaleType?: "LIVE" | "TIMED" | null | undefined;
1091
- location?: string | null | undefined;
1092
- description?: string | null | undefined;
1093
- image?: string | null | undefined;
1094
- cover?: string | null | undefined;
1359
+ recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
1360
+ martEyeSaleType?: "LIVE" | "TIMED" | null;
1361
+ location?: string | null;
1362
+ description?: string | null;
1363
+ image?: string | null;
1364
+ cover?: string | null;
1095
1365
  attributeDefaults?: {
1096
1366
  [attributekey: string]: string | number | boolean;
1097
- } | undefined;
1367
+ };
1098
1368
  }) => Promise<{
1099
1369
  saleId: string;
1100
1370
  }>;
1101
1371
  update: (marketId: string, saleId: string, data: {
1102
- name?: string | undefined;
1103
- recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
1104
- defaultProductCode?: string | undefined;
1105
- attributeDefaults?: Record<string, any> | undefined;
1106
- martEyeId?: string | null | undefined;
1372
+ name?: string;
1373
+ recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
1374
+ defaultProductCode?: string;
1375
+ attributeDefaults?: Record<string, any>;
1376
+ martEyeId?: string | null;
1107
1377
  marteyeSettings?: {
1108
- description?: string | undefined;
1109
- image?: string | undefined;
1110
- logo?: string | undefined;
1378
+ description?: string;
1379
+ image?: string;
1380
+ logo?: string;
1111
1381
  type: "LIVE" | "TIMED";
1112
- location?: string | null | undefined;
1113
- descriptionLines?: string[] | undefined;
1114
- descriptionLink?: string | undefined;
1115
- deposit?: number | undefined;
1116
- hidePrices?: boolean | undefined;
1117
- hideReplay?: boolean | undefined;
1118
- labels?: string[] | undefined;
1119
- tags?: string[] | undefined;
1120
- details?: {
1382
+ location?: string | null;
1383
+ descriptionLines?: string[];
1384
+ descriptionLink?: string;
1385
+ deposit?: number;
1386
+ hidePrices?: boolean;
1387
+ hideReplay?: boolean;
1388
+ labels?: string[];
1389
+ tags?: string[];
1390
+ details?: Array<{
1121
1391
  markdownBase64: string;
1122
1392
  title: string;
1123
- }[] | undefined;
1124
- cover?: string | undefined;
1125
- primaryColour?: string | undefined;
1126
- secondaryColour?: string | undefined;
1127
- foregroundColour?: string | undefined;
1128
- extensionTime?: number | undefined;
1129
- incrementLadder?: {
1393
+ }>;
1394
+ cover?: string;
1395
+ primaryColour?: string;
1396
+ secondaryColour?: string;
1397
+ foregroundColour?: string;
1398
+ extensionTime?: number;
1399
+ incrementLadder?: Array<{
1130
1400
  max: number;
1131
1401
  increment: number;
1132
- }[] | undefined;
1133
- hideNav?: boolean | undefined;
1134
- signInOverrideLink?: string | undefined;
1135
- published?: boolean | undefined;
1136
- pin?: boolean | undefined;
1137
- cascade?: boolean | undefined;
1138
- reportEmail?: string | undefined;
1139
- } | null | undefined;
1402
+ }>;
1403
+ hideNav?: boolean;
1404
+ signInOverrideLink?: string;
1405
+ published?: boolean;
1406
+ pin?: boolean;
1407
+ cascade?: boolean;
1408
+ reportEmail?: string;
1409
+ } | null;
1140
1410
  }) => Promise<Sale>;
1141
1411
  };
1142
1412
  lots: {
1143
1413
  get: (marketId: string, saleId: string, lotId: string) => Promise<Lot>;
1144
1414
  list: (marketId: string, saleId: string) => Promise<Lot[]>;
1145
1415
  create: (marketId: string, saleId: string, data: {
1146
- index?: number | undefined;
1147
- lotNumber?: string | undefined;
1148
- group?: string | undefined;
1149
- productCode?: string | undefined;
1150
- sellerCustomerId?: string | undefined;
1151
- attributes?: Record<string, any> | undefined;
1152
- metadata?: Record<string, any> | undefined;
1153
- buyerCustomerId?: string | undefined;
1154
- unitPriceInCents?: number | undefined;
1155
- reservePriceInCents?: number | undefined;
1156
- startingPriceInCents?: number | undefined;
1157
- startAt?: string | undefined;
1158
- endAt?: string | undefined;
1159
- previousLotNumber?: string | undefined;
1160
- saleStatus?: LotSaleStatus | undefined;
1416
+ index?: number;
1417
+ lotNumber?: string;
1418
+ group?: string;
1419
+ productCode?: string;
1420
+ sellerCustomerId?: string;
1421
+ attributes?: Record<string, any>;
1422
+ metadata?: Record<string, any>;
1423
+ buyerCustomerId?: string;
1424
+ unitPriceInCents?: number;
1425
+ reservePriceInCents?: number;
1426
+ startingPriceInCents?: number;
1427
+ startAt?: string;
1428
+ endAt?: string;
1429
+ previousLotNumber?: string;
1430
+ saleStatus?: LotSaleStatus;
1161
1431
  }) => Promise<Lot>;
1162
1432
  update: (marketId: string, saleId: string, lotId: string, data: {
1163
- productCode?: string | undefined;
1164
- attributes?: Record<string, any> | undefined;
1165
- sellerCasual?: string | null | undefined;
1166
- sellerCustomerId?: string | null | undefined;
1167
- lotNumber?: string | null | undefined;
1168
- remarks?: string | undefined;
1169
- notes?: string | undefined;
1170
- unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
1171
- unitPriceInCents?: number | undefined;
1172
- reservePriceInCents?: number | undefined;
1173
- startingPriceInCents?: number | undefined;
1174
- buyerCasual?: string | null | undefined;
1175
- buyerCustomerId?: string | null | undefined;
1176
- startAt?: string | null | undefined;
1177
- endAt?: string | null | undefined;
1178
- saleStatus?: LotSaleStatus | undefined;
1179
- metadata?: Record<string, any> | undefined;
1433
+ productCode?: string;
1434
+ attributes?: Record<string, any>;
1435
+ sellerCasual?: string | null;
1436
+ sellerCustomerId?: string | null;
1437
+ lotNumber?: string | null;
1438
+ remarks?: string;
1439
+ notes?: string;
1440
+ unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
1441
+ unitPriceInCents?: number;
1442
+ reservePriceInCents?: number;
1443
+ startingPriceInCents?: number;
1444
+ buyerCasual?: string | null;
1445
+ buyerCustomerId?: string | null;
1446
+ startAt?: string | null;
1447
+ endAt?: string | null;
1448
+ saleStatus?: LotSaleStatus;
1449
+ metadata?: Record<string, any>;
1180
1450
  }) => Promise<Lot>;
1181
1451
  delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
1182
1452
  };
1183
1453
  lotitems: {
1184
1454
  create: (marketId: string, saleId: string, lotId: string, data: {
1185
- attributes?: Record<string, any> | undefined;
1186
- notes?: {
1455
+ attributes?: Record<string, any>;
1456
+ notes?: Array<{
1187
1457
  text: string;
1188
- }[] | undefined;
1189
- metadata?: Record<string, any> | undefined;
1458
+ }>;
1459
+ metadata?: Record<string, any>;
1190
1460
  }) => Promise<LotItem>;
1191
1461
  update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
1192
- attributes?: Record<string, any> | undefined;
1193
- index?: number | undefined;
1194
- metadata?: Record<string, any> | undefined;
1462
+ attributes?: Record<string, any>;
1463
+ index?: number;
1464
+ metadata?: Record<string, any>;
1195
1465
  }) => Promise<LotItem>;
1196
1466
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
1197
1467
  };
1198
1468
  webhooks: {
1199
- constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | null | undefined, endpointSecret: string | null | undefined) => Promise<WebhookEvent<T>>;
1469
+ constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
1200
1470
  };
1201
1471
  actions: {
1202
1472
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
@@ -1226,6 +1496,16 @@ declare function Studio(info?: {
1226
1496
  search: {
1227
1497
  query: (marketId: string, query: string) => Promise<SearchResult>;
1228
1498
  };
1499
+ files: {
1500
+ uploadFile: (input: Parameters<typeof uploadFile>[0], token: string) => Promise<{
1501
+ message: string;
1502
+ mediaType: string;
1503
+ process: VariantProcessingState;
1504
+ }>;
1505
+ deleteFile: (fileUrl: string, token: string) => Promise<{
1506
+ data: boolean;
1507
+ }>;
1508
+ };
1229
1509
  };
1230
1510
 
1231
1511
  /**
@@ -1292,4 +1572,5 @@ declare function createAppManifest(appConfig: {
1292
1572
  readonly manifest: StudioManifest;
1293
1573
  };
1294
1574
 
1295
- export { Studio, StudioHeaders, type StudioManifest, types as StudioTypes, createAppManifest, Studio as default };
1575
+ export { Studio, StudioHeaders, types as StudioTypes, createAppManifest, Studio as default };
1576
+ export type { ChunkedFile, StudioInstance, StudioManifest };