@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.
- package/dist/index.common.d.ts +11 -0
- package/dist/index.d.ts +377 -96
- package/dist/index.esm.js +4745 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4745 -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/files.d.ts +12 -0
- package/dist/resources/webhooks.d.ts +0 -1
- package/dist/resources.d.ts +92 -83
- package/dist/studio.d.ts +91 -82
- package/dist/types.d.ts +14 -13
- 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$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
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
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
|
-
|
|
657
|
+
fileName: string;
|
|
658
|
+
path: string;
|
|
568
659
|
url: string;
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
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 {
|
|
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
|
|
1079
|
-
end?: string
|
|
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"
|
|
1090
|
-
martEyeSaleType?: "LIVE" | "TIMED" | null
|
|
1091
|
-
location?: string | null
|
|
1092
|
-
description?: string | null
|
|
1093
|
-
image?: string | null
|
|
1094
|
-
cover?: string | null
|
|
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
|
-
}
|
|
1367
|
+
};
|
|
1098
1368
|
}) => Promise<{
|
|
1099
1369
|
saleId: string;
|
|
1100
1370
|
}>;
|
|
1101
1371
|
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
|
|
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
|
|
1109
|
-
image?: string
|
|
1110
|
-
logo?: string
|
|
1378
|
+
description?: string;
|
|
1379
|
+
image?: string;
|
|
1380
|
+
logo?: string;
|
|
1111
1381
|
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?: {
|
|
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
|
-
}
|
|
1124
|
-
cover?: string
|
|
1125
|
-
primaryColour?: string
|
|
1126
|
-
secondaryColour?: string
|
|
1127
|
-
foregroundColour?: string
|
|
1128
|
-
extensionTime?: number
|
|
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
|
-
}
|
|
1133
|
-
hideNav?: boolean
|
|
1134
|
-
signInOverrideLink?: string
|
|
1135
|
-
published?: boolean
|
|
1136
|
-
pin?: boolean
|
|
1137
|
-
cascade?: boolean
|
|
1138
|
-
reportEmail?: string
|
|
1139
|
-
} | null
|
|
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
|
|
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
|
-
reservePriceInCents?: number
|
|
1156
|
-
startingPriceInCents?: number
|
|
1157
|
-
startAt?: string
|
|
1158
|
-
endAt?: string
|
|
1159
|
-
previousLotNumber?: string
|
|
1160
|
-
saleStatus?: LotSaleStatus
|
|
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
|
|
1164
|
-
attributes?: Record<string, any
|
|
1165
|
-
sellerCasual?: string | null
|
|
1166
|
-
sellerCustomerId?: string | null
|
|
1167
|
-
lotNumber?: string | null
|
|
1168
|
-
remarks?: string
|
|
1169
|
-
notes?: string
|
|
1170
|
-
unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG"
|
|
1171
|
-
unitPriceInCents?: number
|
|
1172
|
-
reservePriceInCents?: number
|
|
1173
|
-
startingPriceInCents?: number
|
|
1174
|
-
buyerCasual?: string | null
|
|
1175
|
-
buyerCustomerId?: string | null
|
|
1176
|
-
startAt?: string | null
|
|
1177
|
-
endAt?: string | null
|
|
1178
|
-
saleStatus?: LotSaleStatus
|
|
1179
|
-
metadata?: Record<string, any
|
|
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
|
|
1186
|
-
notes?: {
|
|
1455
|
+
attributes?: Record<string, any>;
|
|
1456
|
+
notes?: Array<{
|
|
1187
1457
|
text: string;
|
|
1188
|
-
}
|
|
1189
|
-
metadata?: Record<string, any
|
|
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
|
|
1193
|
-
index?: number
|
|
1194
|
-
metadata?: Record<string, any
|
|
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 |
|
|
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,
|
|
1575
|
+
export { Studio, StudioHeaders, types as StudioTypes, createAppManifest, Studio as default };
|
|
1576
|
+
export type { ChunkedFile, StudioInstance, StudioManifest };
|