@marteye/studiojs 1.1.47 → 1.1.48-beta.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/README.md +101 -23
- package/dist/__tests__/activity.test.d.ts +1 -0
- package/dist/__tests__/cattlePassport.test.d.ts +1 -0
- package/dist/__tests__/customerLists.test.d.ts +1 -0
- package/dist/__tests__/customerLists.unit.test.d.ts +1 -0
- package/dist/__tests__/eartag.test.d.ts +1 -0
- package/dist/__tests__/lot-util.test.d.ts +1 -0
- package/dist/__tests__/lots.test.d.ts +1 -0
- package/dist/__tests__/markets.test.d.ts +1 -0
- package/dist/__tests__/media.test.d.ts +1 -0
- package/dist/__tests__/sales.test.d.ts +1 -0
- package/dist/__tests__/studio.test.d.ts +311 -0
- package/dist/index.d.ts +13 -2706
- package/dist/index.esm.js +90 -90
- package/dist/index.js +90 -90
- package/dist/resources/broadcast.d.ts +7 -0
- package/dist/resources/sales.d.ts +2 -0
- package/dist/resources.d.ts +6 -4
- package/dist/studio.d.ts +6 -4
- package/dist/types.d.ts +81 -0
- package/package.json +3 -2
- package/dist/resources/sms.d.ts +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,2706 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
interface LedgerTransaction {
|
|
15
|
-
id: string;
|
|
16
|
-
createdAt: string;
|
|
17
|
-
updatedAt: string;
|
|
18
|
-
transactionDate: string;
|
|
19
|
-
marketId: string;
|
|
20
|
-
account: string;
|
|
21
|
-
rollUpAccounts: string[];
|
|
22
|
-
accountType: "income" | "expense" | "asset" | "liability" | "equity";
|
|
23
|
-
accountName: string;
|
|
24
|
-
owner: "market" | string;
|
|
25
|
-
isMarketAccount: boolean;
|
|
26
|
-
amountInCents: number;
|
|
27
|
-
batchId: string;
|
|
28
|
-
batchDescription: string;
|
|
29
|
-
referenceId: string;
|
|
30
|
-
referenceType: string;
|
|
31
|
-
referenceTxnCount: number;
|
|
32
|
-
referenceGroupKey: string;
|
|
33
|
-
tags: Record<string, string | number | boolean>;
|
|
34
|
-
parentTransactionId: string | null;
|
|
35
|
-
currentBalanceInCents: number;
|
|
36
|
-
sumOfCreditsInCents: number;
|
|
37
|
-
sumOfDebitsInCents: number;
|
|
38
|
-
index: number;
|
|
39
|
-
}
|
|
40
|
-
interface TransactionsListResponse {
|
|
41
|
-
transactions: LedgerTransaction[];
|
|
42
|
-
nextCursor: string | null;
|
|
43
|
-
hasMore: boolean;
|
|
44
|
-
}
|
|
45
|
-
interface ListTransactionsParams {
|
|
46
|
-
account?: string;
|
|
47
|
-
referenceGroupKey?: string;
|
|
48
|
-
dateFrom?: string;
|
|
49
|
-
dateTo?: string;
|
|
50
|
-
limit?: number;
|
|
51
|
-
cursor?: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
type Timestamp = string;
|
|
55
|
-
type ClientType = "Seller" | "Buyer";
|
|
56
|
-
type SuperType = "Sheep" | "Goats" | "Cattle" | "Pigs" | "Horses" | "Deer" | "Poultry" | "Machinery" | "Antiques" | "Other";
|
|
57
|
-
declare const SupportedSuperTypes: SuperType[];
|
|
58
|
-
declare const LivestockSuperTypes: SuperType[];
|
|
59
|
-
type Currency = "GBP" | "EUR" | "USD";
|
|
60
|
-
declare const SupportedCurrencyCodes: Currency[];
|
|
61
|
-
type SupportedCountryCode = "GB-ENG" | "GB-SCT" | "GB-WLS" | "GB-NIR" | "IE";
|
|
62
|
-
type CurrenciesWithGuinea = Currency | "GUINEA-GBP";
|
|
63
|
-
type UnitOfSale = "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
|
|
64
|
-
declare const SupportedUnitsOfSale: UnitOfSale[];
|
|
65
|
-
type PaymentMethod = "BACS" | "Cheque" | "BankTransfer" | "Cash" | "Card" | "Credit";
|
|
66
|
-
type InvoiceDeliveryPreference = "email" | "printed" | "both";
|
|
67
|
-
type PayoutMethod = "BACS" | "Cheque" | "Cash";
|
|
68
|
-
declare const SupportedPaymentMethods: PaymentMethod[];
|
|
69
|
-
interface Market {
|
|
70
|
-
id: string;
|
|
71
|
-
createdAt: Timestamp;
|
|
72
|
-
updatedAt: Timestamp;
|
|
73
|
-
name: string;
|
|
74
|
-
description: string;
|
|
75
|
-
logo: string;
|
|
76
|
-
primaryColour: string;
|
|
77
|
-
secondaryColour: string;
|
|
78
|
-
countryCode: SupportedCountryCode;
|
|
79
|
-
address: Address;
|
|
80
|
-
telephone?: string;
|
|
81
|
-
vatNumber?: string;
|
|
82
|
-
email?: string;
|
|
83
|
-
movementLocationNumbers?: {
|
|
84
|
-
number: string;
|
|
85
|
-
type: "CPH" | "Herd Number" | "Flock Number" | "Other";
|
|
86
|
-
createdAt: Timestamp;
|
|
87
|
-
}[];
|
|
88
|
-
paymentInstructions?: string;
|
|
89
|
-
}
|
|
90
|
-
interface SettingsMarketDefaults {
|
|
91
|
-
updatedAt: Timestamp;
|
|
92
|
-
updatedBy: string | null;
|
|
93
|
-
marketId: string;
|
|
94
|
-
name: string;
|
|
95
|
-
description: string;
|
|
96
|
-
address: Address;
|
|
97
|
-
defaultCurrency: Currency;
|
|
98
|
-
defaultPayoutPreference: PayoutMethod;
|
|
99
|
-
defaultUnitOfSale: UnitOfSale;
|
|
100
|
-
defaultSuperType?: SuperType | null;
|
|
101
|
-
defaultSettleDebtsFirst?: boolean;
|
|
102
|
-
liveEmailsEnabled?: boolean;
|
|
103
|
-
lotDescriptionTemplateMap?: {
|
|
104
|
-
default: string | undefined;
|
|
105
|
-
[supertype: string]: string | undefined;
|
|
106
|
-
};
|
|
107
|
-
rostrumAttributesMap?: {
|
|
108
|
-
default: string[] | undefined;
|
|
109
|
-
[supertype: string]: string[] | undefined;
|
|
110
|
-
};
|
|
111
|
-
selectDocumentIdsMap: {
|
|
112
|
-
[supertype: string]: string[];
|
|
113
|
-
};
|
|
114
|
-
enableLuckMoney?: boolean;
|
|
115
|
-
}
|
|
116
|
-
interface SettingsProductCodes {
|
|
117
|
-
[code: string]: ProductCodeConfiguration;
|
|
118
|
-
}
|
|
119
|
-
interface SettingsTaxRates {
|
|
120
|
-
[id: string]: TaxRate;
|
|
121
|
-
}
|
|
122
|
-
interface SettingsAdjustmentsConfiguration {
|
|
123
|
-
[id: string]: AdjustmentsConfiguration;
|
|
124
|
-
}
|
|
125
|
-
interface SettingsAccessories {
|
|
126
|
-
[id: string]: Accessory;
|
|
127
|
-
}
|
|
128
|
-
interface SettingsPrinters {
|
|
129
|
-
[id: string]: Printer;
|
|
130
|
-
}
|
|
131
|
-
type DeviceType = "globeWeigh" | "allflexRaceReader";
|
|
132
|
-
interface Accessory {
|
|
133
|
-
deviceId: string;
|
|
134
|
-
deviceType: DeviceType;
|
|
135
|
-
friendlyName: string;
|
|
136
|
-
endOfMessagePattern: string;
|
|
137
|
-
host: string;
|
|
138
|
-
isEnabled: boolean;
|
|
139
|
-
port: number;
|
|
140
|
-
regex: string;
|
|
141
|
-
saleProfileId: string;
|
|
142
|
-
timeoutMs: number;
|
|
143
|
-
updatedAt: Timestamp;
|
|
144
|
-
createdAt: Timestamp;
|
|
145
|
-
}
|
|
146
|
-
interface SettingsGlobalAttributes {
|
|
147
|
-
[id: string]: AttributeDefinition;
|
|
148
|
-
}
|
|
149
|
-
type AttributeValueType = string | number | boolean | Timestamp | Media | Media[];
|
|
150
|
-
/****
|
|
151
|
-
* Used to grant a user access to a market.
|
|
152
|
-
* Each member of staff should have their own.
|
|
153
|
-
*/
|
|
154
|
-
interface MemberSharingConfiguration {
|
|
155
|
-
uid: string;
|
|
156
|
-
createdAt: Timestamp;
|
|
157
|
-
updatedAt: Timestamp;
|
|
158
|
-
displayName?: string;
|
|
159
|
-
photoURL?: string;
|
|
160
|
-
marketId: string;
|
|
161
|
-
role: "Owner" | "Admin" | "Editor";
|
|
162
|
-
}
|
|
163
|
-
type DisplayBoardMode = "off" | "live" | "manual" | {
|
|
164
|
-
type: "focused";
|
|
165
|
-
field: string;
|
|
166
|
-
};
|
|
167
|
-
type SalePublishStatus = "unpublished" | "sale" | "saleAndCatalog";
|
|
168
|
-
interface Sale {
|
|
169
|
-
id: string;
|
|
170
|
-
createdAt: Timestamp;
|
|
171
|
-
updatedAt: Timestamp;
|
|
172
|
-
updatedBy?: string | null;
|
|
173
|
-
startsAt: Timestamp;
|
|
174
|
-
closedAt?: Timestamp | null;
|
|
175
|
-
marketId: string;
|
|
176
|
-
name: string;
|
|
177
|
-
recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
|
|
178
|
-
defaultProductCode: string;
|
|
179
|
-
/**
|
|
180
|
-
* Default attributes values for any new lot item
|
|
181
|
-
*/
|
|
182
|
-
attributeDefaults?: {
|
|
183
|
-
[attributekey: string]: AttributeValueType;
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* the codes that are allowed for the sale
|
|
187
|
-
*/
|
|
188
|
-
availableProductCodes: string[];
|
|
189
|
-
/**
|
|
190
|
-
* the supertypes from the product codes. e..g Cattle, Sheep, Pigs etc
|
|
191
|
-
*/
|
|
192
|
-
superTypes: SuperType[];
|
|
193
|
-
attributeSet: AttributeDefinition[];
|
|
194
|
-
attributeSetByProductCode: {
|
|
195
|
-
[code: string]: string[];
|
|
196
|
-
};
|
|
197
|
-
currentLotGroup?: string | null;
|
|
198
|
-
displayBoardLotGroup?: string | null | "BLANK";
|
|
199
|
-
nextLotGroup?: string | null;
|
|
200
|
-
/**
|
|
201
|
-
* Auto queue the next lot when the current lot is sold in rostrum
|
|
202
|
-
*/
|
|
203
|
-
autoQueue?: boolean;
|
|
204
|
-
/**
|
|
205
|
-
* The sale profile ID to use for this sale. Which is used to find settings specific devices and printers etc.
|
|
206
|
-
*/
|
|
207
|
-
saleProfileId?: string | null;
|
|
208
|
-
/**
|
|
209
|
-
* Show the display board
|
|
210
|
-
*/
|
|
211
|
-
displayBoard?: boolean;
|
|
212
|
-
/**
|
|
213
|
-
* The display board mode (off, live, manual, or focused on a field)
|
|
214
|
-
*/
|
|
215
|
-
displayBoardMode?: DisplayBoardMode;
|
|
216
|
-
martEyeId?: string | null;
|
|
217
|
-
marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
|
|
218
|
-
stats?: {
|
|
219
|
-
lots: {
|
|
220
|
-
count: number;
|
|
221
|
-
sold: number;
|
|
222
|
-
invoiced: number;
|
|
223
|
-
valueInCents: number;
|
|
224
|
-
};
|
|
225
|
-
lotItems: {
|
|
226
|
-
count: number;
|
|
227
|
-
};
|
|
228
|
-
customers: {
|
|
229
|
-
count: number;
|
|
230
|
-
buyers: number;
|
|
231
|
-
sellers: number;
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
editedBy?: string[];
|
|
235
|
-
/**
|
|
236
|
-
* Publishing status for external systems
|
|
237
|
-
* - unpublished: Not listed in external system
|
|
238
|
-
* - sale: Sale date is listed externally
|
|
239
|
-
* - saleAndCatalog: Sale and catalog information synced
|
|
240
|
-
*/
|
|
241
|
-
publishStatus?: SalePublishStatus;
|
|
242
|
-
enableLuckMoney?: boolean;
|
|
243
|
-
}
|
|
244
|
-
interface TemplateSaleData {
|
|
245
|
-
name?: string;
|
|
246
|
-
description?: string | null;
|
|
247
|
-
image?: string | null;
|
|
248
|
-
location?: string | null;
|
|
249
|
-
martEyeSaleType?: "LIVE" | "TIMED" | null;
|
|
250
|
-
cover?: string | null;
|
|
251
|
-
availableProductCodes: string[];
|
|
252
|
-
attributeDefaults?: {
|
|
253
|
-
[attributekey: string]: AttributeValueType;
|
|
254
|
-
};
|
|
255
|
-
marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
|
|
256
|
-
enableLuckMoney?: boolean;
|
|
257
|
-
}
|
|
258
|
-
interface SaleTemplate {
|
|
259
|
-
id: string;
|
|
260
|
-
marketId: string;
|
|
261
|
-
name: string;
|
|
262
|
-
description?: string | null;
|
|
263
|
-
sourceSaleId?: string;
|
|
264
|
-
createdAt: Timestamp;
|
|
265
|
-
updatedAt: Timestamp;
|
|
266
|
-
createdBy: string;
|
|
267
|
-
saleData: TemplateSaleData;
|
|
268
|
-
lotGridConfigs?: {
|
|
269
|
-
[configId: string]: StoredDataGridConfig;
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
interface StoredDataGridConfig {
|
|
273
|
-
widths?: {
|
|
274
|
-
[key: string]: number;
|
|
275
|
-
};
|
|
276
|
-
hiddenColumnIds: string[];
|
|
277
|
-
columnOrder: string[];
|
|
278
|
-
}
|
|
279
|
-
interface MartEyeLiveSaleSettings {
|
|
280
|
-
description?: string;
|
|
281
|
-
image?: string;
|
|
282
|
-
logo?: string;
|
|
283
|
-
type: "LIVE";
|
|
284
|
-
location?: string | null;
|
|
285
|
-
descriptionLines?: string[];
|
|
286
|
-
descriptionLink?: string;
|
|
287
|
-
deposit?: number;
|
|
288
|
-
hidePrices?: boolean;
|
|
289
|
-
hideReplay?: boolean;
|
|
290
|
-
labels?: string[];
|
|
291
|
-
tags?: string[];
|
|
292
|
-
queueLots?: boolean;
|
|
293
|
-
markSubjectLotsAsSold?: boolean;
|
|
294
|
-
}
|
|
295
|
-
interface MartEyeTimedSaleSettings {
|
|
296
|
-
description?: string;
|
|
297
|
-
image?: string;
|
|
298
|
-
logo?: string;
|
|
299
|
-
type: "TIMED";
|
|
300
|
-
/**
|
|
301
|
-
* The moment the staggered closing sequence should begin.
|
|
302
|
-
* The first lot will close at this time, with subsequent lots
|
|
303
|
-
* offset by `staggerSeconds` each.
|
|
304
|
-
*/
|
|
305
|
-
closingStartsAt: Timestamp;
|
|
306
|
-
/**
|
|
307
|
-
* The number of seconds to offset each subsequent lot’s closing time
|
|
308
|
-
* from the previous one.
|
|
309
|
-
* Example: 30 → lot #1 closes at `closingStartsAt`, lot #2 at +30 s, lot #3 at +60 s …
|
|
310
|
-
*/
|
|
311
|
-
staggerSeconds: number;
|
|
312
|
-
/**
|
|
313
|
-
* The location of the sale. This could be a physical location Ring 1 / Ring 2 / Farm Address etc
|
|
314
|
-
*/
|
|
315
|
-
location?: string | null;
|
|
316
|
-
details?: {
|
|
317
|
-
markdownBase64: string;
|
|
318
|
-
title: string;
|
|
319
|
-
}[];
|
|
320
|
-
cover?: string;
|
|
321
|
-
primaryColour?: string;
|
|
322
|
-
secondaryColour?: string;
|
|
323
|
-
foregroundColour?: string;
|
|
324
|
-
extensionTime: number;
|
|
325
|
-
incrementLadder: IncrementLadder;
|
|
326
|
-
hideNav?: boolean;
|
|
327
|
-
signInOverrideLink?: string;
|
|
328
|
-
published?: boolean;
|
|
329
|
-
pin?: boolean;
|
|
330
|
-
labels?: string[];
|
|
331
|
-
deposit?: number;
|
|
332
|
-
cascade?: boolean;
|
|
333
|
-
reportEmail?: string;
|
|
334
|
-
}
|
|
335
|
-
type IncrementLadder = IncrementLadderItem[];
|
|
336
|
-
interface IncrementLadderItem {
|
|
337
|
-
max: number;
|
|
338
|
-
increment: number;
|
|
339
|
-
}
|
|
340
|
-
interface SaleFromSearch extends Omit<Omit<Omit<Sale, "createdAt">, "updatedAt">, "startsAt"> {
|
|
341
|
-
createdAt: number;
|
|
342
|
-
updatedAt: number;
|
|
343
|
-
startsAt: number;
|
|
344
|
-
}
|
|
345
|
-
type LotSaleStatus = "Sold" | "Unsold" | "Rerun" | "Resold" | null;
|
|
346
|
-
type LotDeleteDecision = "allow" | "confirm" | "block";
|
|
347
|
-
type LotDeleteReason = "local_only" | "not_started" | "started" | "started_with_bids" | "finished" | "studio_locked" | "not_found" | "sync_unavailable" | "link_unresolved";
|
|
348
|
-
interface LotDeletePreflightItem {
|
|
349
|
-
lotId: string;
|
|
350
|
-
lotNumber: string | null;
|
|
351
|
-
decision: LotDeleteDecision;
|
|
352
|
-
reason: LotDeleteReason;
|
|
353
|
-
isMartEyeEnabled: boolean;
|
|
354
|
-
saleType: "LIVE" | "TIMED" | null;
|
|
355
|
-
started: boolean;
|
|
356
|
-
finished: boolean;
|
|
357
|
-
hasBids: boolean;
|
|
358
|
-
bidCount: number;
|
|
359
|
-
startAt: string | null;
|
|
360
|
-
endAt: string | null;
|
|
361
|
-
}
|
|
362
|
-
interface LotDeletePreflightResponse {
|
|
363
|
-
version: 1;
|
|
364
|
-
saleId: string;
|
|
365
|
-
lotId: string;
|
|
366
|
-
result: LotDeletePreflightItem;
|
|
367
|
-
}
|
|
368
|
-
interface DeleteLotsResponse {
|
|
369
|
-
version: 1;
|
|
370
|
-
saleId: string;
|
|
371
|
-
status: "deleted" | "blocked" | "confirmation_required";
|
|
372
|
-
deletedLotIds: string[];
|
|
373
|
-
results: LotDeletePreflightItem[];
|
|
374
|
-
}
|
|
375
|
-
interface Lot {
|
|
376
|
-
id: string;
|
|
377
|
-
saleId: string;
|
|
378
|
-
marketId: string;
|
|
379
|
-
createdAt: Timestamp;
|
|
380
|
-
updatedAt: Timestamp;
|
|
381
|
-
updatedBy?: string | null;
|
|
382
|
-
productCode: string;
|
|
383
|
-
superType?: SuperType;
|
|
384
|
-
isLivestock?: boolean;
|
|
385
|
-
attributes: {
|
|
386
|
-
[key: string]: AttributeValueType;
|
|
387
|
-
};
|
|
388
|
-
loadingAttributes?: {
|
|
389
|
-
[attributePath: string]: {
|
|
390
|
-
id: string;
|
|
391
|
-
startAt: Timestamp;
|
|
392
|
-
path: string;
|
|
393
|
-
};
|
|
394
|
-
};
|
|
395
|
-
itemMap: {
|
|
396
|
-
[itemId: string]: LotItem;
|
|
397
|
-
};
|
|
398
|
-
sellerCasual?: string | null;
|
|
399
|
-
sellerCustomerId: string | null;
|
|
400
|
-
seller?: ShortCustomerDetails;
|
|
401
|
-
lotNumber?: string | null;
|
|
402
|
-
index: number;
|
|
403
|
-
group?: string;
|
|
404
|
-
remarks?: string;
|
|
405
|
-
notes?: string;
|
|
406
|
-
currency: CurrenciesWithGuinea;
|
|
407
|
-
unitOfSale: UnitOfSale;
|
|
408
|
-
reservePriceInCents?: number | null;
|
|
409
|
-
startingPriceInCents?: number | null;
|
|
410
|
-
luckMoneyInCents?: number | null;
|
|
411
|
-
unitPriceInCents?: number;
|
|
412
|
-
buyerCasual?: string | null;
|
|
413
|
-
buyerCustomerId: string | null;
|
|
414
|
-
buyer?: ShortCustomerDetails | null;
|
|
415
|
-
startAt?: Timestamp;
|
|
416
|
-
endAt?: Timestamp;
|
|
417
|
-
sellerInvoiceId: string | null;
|
|
418
|
-
sellerInvoiceNumber?: number | undefined | null;
|
|
419
|
-
buyerInvoiceId: string | null;
|
|
420
|
-
buyerInvoiceNumber?: number | undefined | null;
|
|
421
|
-
voidedSellerInvoiceIds?: string[];
|
|
422
|
-
voidedBuyerInvoiceIds?: string[];
|
|
423
|
-
saleStatus?: LotSaleStatus;
|
|
424
|
-
void?: boolean;
|
|
425
|
-
originalLot?: string;
|
|
426
|
-
metadata: {
|
|
427
|
-
[key: string]: any;
|
|
428
|
-
};
|
|
429
|
-
generated?: LotGeneratedValues;
|
|
430
|
-
issues?: {
|
|
431
|
-
[issueId: string]: LotIssue;
|
|
432
|
-
};
|
|
433
|
-
resolvedIssues?: {
|
|
434
|
-
[issueId: string]: LotIssue;
|
|
435
|
-
};
|
|
436
|
-
/***
|
|
437
|
-
* Default values for any new lot item
|
|
438
|
-
*/
|
|
439
|
-
itemAttributeDefaults?: {
|
|
440
|
-
[attributekey: string]: AttributeValueType;
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
type LotIssueCode = "unknown-attribute" | "validation-error" | "staff-flagged";
|
|
444
|
-
interface LotIssue {
|
|
445
|
-
id: string;
|
|
446
|
-
itemId?: string | null;
|
|
447
|
-
path?: string | null;
|
|
448
|
-
code: LotIssueCode;
|
|
449
|
-
description: string;
|
|
450
|
-
severity: "error" | "warning" | "info";
|
|
451
|
-
createdAt: Timestamp;
|
|
452
|
-
createdBy: string;
|
|
453
|
-
blockCheckout: boolean;
|
|
454
|
-
}
|
|
455
|
-
interface LotWithItemsAsArray extends Omit<Lot, "itemMap"> {
|
|
456
|
-
items: LotItem[];
|
|
457
|
-
}
|
|
458
|
-
interface LotGeneratedValues {
|
|
459
|
-
totalValueInCents?: number | null;
|
|
460
|
-
description?: string | null;
|
|
461
|
-
pricePerKiloInCents?: number | null;
|
|
462
|
-
averageWeightKg?: number | null;
|
|
463
|
-
pricePerItemInCents?: number | null;
|
|
464
|
-
countOfItems?: number | null;
|
|
465
|
-
ordinal?: number | null;
|
|
466
|
-
}
|
|
467
|
-
interface ShortCustomerDetails {
|
|
468
|
-
isSet: boolean;
|
|
469
|
-
id?: string;
|
|
470
|
-
copiedInAt?: Timestamp;
|
|
471
|
-
accountNumber?: string;
|
|
472
|
-
bidderNumber?: number | null;
|
|
473
|
-
displayName?: string;
|
|
474
|
-
avatar?: string | null;
|
|
475
|
-
}
|
|
476
|
-
interface LotItem {
|
|
477
|
-
id: string;
|
|
478
|
-
createdAt: Timestamp;
|
|
479
|
-
updatedAt: Timestamp;
|
|
480
|
-
updatedBy?: string | null;
|
|
481
|
-
index: number;
|
|
482
|
-
attributes: {
|
|
483
|
-
[key: string]: AttributeValueType;
|
|
484
|
-
};
|
|
485
|
-
notes: {
|
|
486
|
-
id: string;
|
|
487
|
-
text: string;
|
|
488
|
-
createdAt: Timestamp;
|
|
489
|
-
}[];
|
|
490
|
-
metadata: {
|
|
491
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
/***
|
|
495
|
-
* A market may offer other products and services. This is a way to track those.
|
|
496
|
-
* They simply create a line item on the invoice
|
|
497
|
-
*
|
|
498
|
-
* /settings/products
|
|
499
|
-
*/
|
|
500
|
-
interface Product {
|
|
501
|
-
id: string;
|
|
502
|
-
createdAt: Timestamp;
|
|
503
|
-
updatedAt: Timestamp;
|
|
504
|
-
marketId: string;
|
|
505
|
-
name: string;
|
|
506
|
-
taxRateId: string;
|
|
507
|
-
defaultUnitPriceInCents: number;
|
|
508
|
-
unitPriceIncludesVat?: boolean;
|
|
509
|
-
applyToClients: ClientType[];
|
|
510
|
-
subtotalGroup?: SubtotalGroups | null | undefined;
|
|
511
|
-
passThroughFundsToAnotherCustomer?: boolean;
|
|
512
|
-
isEnabled?: boolean;
|
|
513
|
-
relatedTo?: {
|
|
514
|
-
lotId: string;
|
|
515
|
-
saleId: string;
|
|
516
|
-
} | null;
|
|
517
|
-
obfusicate?: boolean;
|
|
518
|
-
metadata: {
|
|
519
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
/***
|
|
523
|
-
* When a product is added to a cart it becomes a CartProductItem
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
* markets/ballymena/carts/{userId}
|
|
527
|
-
*
|
|
528
|
-
* {id: CartItem}
|
|
529
|
-
*/
|
|
530
|
-
interface CartItem {
|
|
531
|
-
id: string;
|
|
532
|
-
createdAt: Timestamp;
|
|
533
|
-
updatedAt: Timestamp;
|
|
534
|
-
updatedBy?: string | null;
|
|
535
|
-
marketId: string;
|
|
536
|
-
customerId: string;
|
|
537
|
-
productId: string;
|
|
538
|
-
clientType: ClientType;
|
|
539
|
-
quantity: number;
|
|
540
|
-
unitPriceInCents: number;
|
|
541
|
-
passthroughFundsToCustomerId?: string | null;
|
|
542
|
-
generated?: {
|
|
543
|
-
totalInCents: number;
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
/***
|
|
547
|
-
* Items have codes. And those codes are used to apply the correct commission rates, report movements etc.
|
|
548
|
-
*/
|
|
549
|
-
interface ProductCodeConfiguration {
|
|
550
|
-
code: string;
|
|
551
|
-
createdAt?: Timestamp;
|
|
552
|
-
updatedAt?: Timestamp;
|
|
553
|
-
updatedBy?: string | null;
|
|
554
|
-
superType: SuperType;
|
|
555
|
-
description: string;
|
|
556
|
-
icon?: string;
|
|
557
|
-
metadata: {
|
|
558
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
559
|
-
};
|
|
560
|
-
taxRateId: string;
|
|
561
|
-
subtotalGroup?: SubtotalGroups | null;
|
|
562
|
-
adjustmentIds: string[];
|
|
563
|
-
unitPriceIncludesVat?: boolean;
|
|
564
|
-
totalExVatRebatePecentage?: number;
|
|
565
|
-
defaultCurrency?: CurrenciesWithGuinea;
|
|
566
|
-
defaultUnitOfSale: UnitOfSale;
|
|
567
|
-
defaultLotRange?: {
|
|
568
|
-
min: number;
|
|
569
|
-
max: number;
|
|
570
|
-
};
|
|
571
|
-
attributeDefaults?: {
|
|
572
|
-
[attributekey: string]: AttributeValueType;
|
|
573
|
-
};
|
|
574
|
-
lotDescriptionTemplate?: string;
|
|
575
|
-
rostrumAttributes?: string[];
|
|
576
|
-
selectDocumentIds?: string[] | null;
|
|
577
|
-
}
|
|
578
|
-
/***
|
|
579
|
-
* How the products are stored in settings
|
|
580
|
-
*/
|
|
581
|
-
interface ProductConfiguration {
|
|
582
|
-
[id: string]: Product;
|
|
583
|
-
}
|
|
584
|
-
interface Cart {
|
|
585
|
-
customerId: string;
|
|
586
|
-
updatedAt: Timestamp;
|
|
587
|
-
itemsById: {
|
|
588
|
-
[itemId: string]: CartItem;
|
|
589
|
-
};
|
|
590
|
-
checkoutPrefs?: {
|
|
591
|
-
[key: string]: any;
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
interface EmailWrapper {
|
|
595
|
-
email: string;
|
|
596
|
-
isVerified: boolean;
|
|
597
|
-
createdAt: Timestamp;
|
|
598
|
-
}
|
|
599
|
-
interface PhoneNumberWrapper {
|
|
600
|
-
phoneNumber: string;
|
|
601
|
-
isVerified: boolean;
|
|
602
|
-
createdAt: Timestamp;
|
|
603
|
-
}
|
|
604
|
-
interface AddressWrapper {
|
|
605
|
-
address: Address;
|
|
606
|
-
createdAt: Timestamp;
|
|
607
|
-
updatedAt?: Timestamp;
|
|
608
|
-
updatedBy?: string | null;
|
|
609
|
-
}
|
|
610
|
-
interface FarmAssurances {
|
|
611
|
-
createdAt: Timestamp;
|
|
612
|
-
updatedAt?: Timestamp;
|
|
613
|
-
updatedBy?: string | null;
|
|
614
|
-
memberReference: string;
|
|
615
|
-
expiryDate: Timestamp;
|
|
616
|
-
scope?: "Beef" | "Dairy" | "Pork" | "Sheep" | "Other";
|
|
617
|
-
}
|
|
618
|
-
type BankDetails = {
|
|
619
|
-
accountName?: string;
|
|
620
|
-
} & ({
|
|
621
|
-
accountNumber: string;
|
|
622
|
-
sortCode: string;
|
|
623
|
-
IBAN?: never;
|
|
624
|
-
} | {
|
|
625
|
-
IBAN: string;
|
|
626
|
-
accountNumber?: never;
|
|
627
|
-
sortCode?: never;
|
|
628
|
-
});
|
|
629
|
-
type CustomerBankDetails = BankDetails & {
|
|
630
|
-
id?: string;
|
|
631
|
-
createdAt?: Timestamp;
|
|
632
|
-
updatedAt?: Timestamp;
|
|
633
|
-
updatedBy?: string | null;
|
|
634
|
-
};
|
|
635
|
-
interface CustomerContact {
|
|
636
|
-
id: string;
|
|
637
|
-
createdAt: Timestamp;
|
|
638
|
-
updatedAt: Timestamp;
|
|
639
|
-
updatedBy?: string | null;
|
|
640
|
-
marketId: string;
|
|
641
|
-
displayName: string;
|
|
642
|
-
email?: string | null;
|
|
643
|
-
phoneNumber?: string | null;
|
|
644
|
-
/** @deprecated */
|
|
645
|
-
landlineNumber?: string | null;
|
|
646
|
-
/** @deprecated */
|
|
647
|
-
address?: Address;
|
|
648
|
-
isPrimary?: boolean;
|
|
649
|
-
isActive?: boolean;
|
|
650
|
-
isDeleted?: boolean;
|
|
651
|
-
isVerified?: boolean;
|
|
652
|
-
accountEmails?: boolean;
|
|
653
|
-
marketingEmails?: boolean;
|
|
654
|
-
marteyeUid?: string | null;
|
|
655
|
-
notes?: string | null;
|
|
656
|
-
metadata?: {
|
|
657
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Used to store the bank details for a market
|
|
662
|
-
*/
|
|
663
|
-
type MarketBankDetails = {
|
|
664
|
-
name: string;
|
|
665
|
-
bankId: string;
|
|
666
|
-
address: Address;
|
|
667
|
-
} & ({
|
|
668
|
-
accountNumber: string;
|
|
669
|
-
sortCode: string;
|
|
670
|
-
IBAN?: never;
|
|
671
|
-
} | {
|
|
672
|
-
IBAN: string;
|
|
673
|
-
accountNumber?: never;
|
|
674
|
-
sortCode?: never;
|
|
675
|
-
});
|
|
676
|
-
interface Customer {
|
|
677
|
-
id: string;
|
|
678
|
-
createdAt: Timestamp;
|
|
679
|
-
updatedAt: Timestamp;
|
|
680
|
-
updatedBy?: string | null;
|
|
681
|
-
marketId: string;
|
|
682
|
-
isMarketAccount?: boolean;
|
|
683
|
-
accountNumber?: string;
|
|
684
|
-
bidderNumber?: number | null;
|
|
685
|
-
displayName?: string | null;
|
|
686
|
-
firstName?: string | null;
|
|
687
|
-
lastName?: string | null;
|
|
688
|
-
tradingName?: string | null;
|
|
689
|
-
email?: EmailWrapper;
|
|
690
|
-
phoneNumber?: PhoneNumberWrapper;
|
|
691
|
-
/** @deprecated */
|
|
692
|
-
otherPhoneNumbers?: PhoneNumberWrapper[];
|
|
693
|
-
address: AddressWrapper;
|
|
694
|
-
/** @deprecated */
|
|
695
|
-
otherAddresses: {
|
|
696
|
-
[addressId: string]: AddressWrapper;
|
|
697
|
-
};
|
|
698
|
-
photoURL?: string | null;
|
|
699
|
-
payoutPreference?: PayoutMethod;
|
|
700
|
-
invoiceDeliveryPreference?: InvoiceDeliveryPreference;
|
|
701
|
-
statementDeliveryPreference?: InvoiceDeliveryPreference;
|
|
702
|
-
bankDetails?: CustomerBankDetails | CustomerBankDetails[] | null;
|
|
703
|
-
contacts?: CustomerContact[];
|
|
704
|
-
attributeDefaultsBuyer?: {
|
|
705
|
-
[attributekey: string]: AttributeValueType[];
|
|
706
|
-
};
|
|
707
|
-
attributeDefaultsSeller?: {
|
|
708
|
-
[attributekey: string]: AttributeValueType[];
|
|
709
|
-
};
|
|
710
|
-
preferSettleDebtsFirst?: boolean;
|
|
711
|
-
vatNumber?: string;
|
|
712
|
-
metadata: {
|
|
713
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
714
|
-
};
|
|
715
|
-
lastItemPurchaseDate?: Timestamp;
|
|
716
|
-
lastItemSaleDate?: Timestamp;
|
|
717
|
-
hasPurchasedItems?: boolean;
|
|
718
|
-
hasSoldItems?: boolean;
|
|
719
|
-
notes?: string;
|
|
720
|
-
status?: "archived" | "deleted" | null;
|
|
721
|
-
deleteAfter?: Timestamp;
|
|
722
|
-
casualBuyerLabels?: string[];
|
|
723
|
-
}
|
|
724
|
-
interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" | "lastItemPurchaseDate" | "lastItemSaleDate"> {
|
|
725
|
-
createdAt: number;
|
|
726
|
-
updatedAt: number;
|
|
727
|
-
lastItemPurchaseDate?: number;
|
|
728
|
-
lastItemSaleDate?: number;
|
|
729
|
-
}
|
|
730
|
-
interface Application {
|
|
731
|
-
id: string;
|
|
732
|
-
createdAt: Timestamp;
|
|
733
|
-
updatedAt: Timestamp;
|
|
734
|
-
marketId: string;
|
|
735
|
-
status: "pending" | "approved" | "rejected";
|
|
736
|
-
displayName: string;
|
|
737
|
-
phoneNumber?: string;
|
|
738
|
-
email?: string;
|
|
739
|
-
address: {
|
|
740
|
-
firstLine: string;
|
|
741
|
-
secondLine?: string;
|
|
742
|
-
county?: string;
|
|
743
|
-
postCode: string;
|
|
744
|
-
};
|
|
745
|
-
dateOfMarteyeAccountCreation?: Timestamp;
|
|
746
|
-
hasWonLotsOnMarteye?: boolean;
|
|
747
|
-
isApprovedAtOtherMarkets?: boolean;
|
|
748
|
-
marteyeUid: string;
|
|
749
|
-
notes?: string;
|
|
750
|
-
customerId?: string;
|
|
751
|
-
contactId?: string;
|
|
752
|
-
accountNumber?: string;
|
|
753
|
-
approvedBy?: string;
|
|
754
|
-
rejectedBy?: string;
|
|
755
|
-
approvedAt?: Timestamp;
|
|
756
|
-
rejectedAt?: Timestamp;
|
|
757
|
-
}
|
|
758
|
-
interface Address {
|
|
759
|
-
id: string;
|
|
760
|
-
nickname?: string;
|
|
761
|
-
company?: string;
|
|
762
|
-
firstName?: string;
|
|
763
|
-
lastName?: string;
|
|
764
|
-
address1: string;
|
|
765
|
-
address2?: string;
|
|
766
|
-
city: string;
|
|
767
|
-
province?: string;
|
|
768
|
-
zip: string;
|
|
769
|
-
country: string;
|
|
770
|
-
}
|
|
771
|
-
declare const IMAGE_SIZES_VALUES: readonly ["small", "medium", "large"];
|
|
772
|
-
declare const VIDEO_TASKS_VALUES: readonly ["compressed", "thumbnail"];
|
|
773
|
-
type ImageSizes = (typeof IMAGE_SIZES_VALUES)[number];
|
|
774
|
-
type VideoTasks = (typeof VIDEO_TASKS_VALUES)[number];
|
|
775
|
-
type SupportedFileTypesNames$1 = "image" | "video" | "file";
|
|
776
|
-
interface Media {
|
|
777
|
-
id: string;
|
|
778
|
-
fileName: string;
|
|
779
|
-
path: string;
|
|
780
|
-
url: string;
|
|
781
|
-
fileType: string;
|
|
782
|
-
variants: Partial<Record<ImageSizes | VideoTasks, {
|
|
783
|
-
url: string;
|
|
784
|
-
isLocal?: boolean;
|
|
785
|
-
isProcessing: boolean;
|
|
786
|
-
type: SupportedFileTypesNames$1;
|
|
787
|
-
}>>;
|
|
788
|
-
}
|
|
789
|
-
type MarketReportHeaders = "grossServices" | "vatOnServices" | "grossGoods" | "vatOnGoods" | "netTotal" | "contra";
|
|
790
|
-
/**
|
|
791
|
-
* Content types which will denote the position of the data on the invoice wihth out with a cheque
|
|
792
|
-
*/
|
|
793
|
-
type FieldPositions = {
|
|
794
|
-
id: ChequeField | InvoiceField;
|
|
795
|
-
x: number;
|
|
796
|
-
y: number;
|
|
797
|
-
};
|
|
798
|
-
type InvoiceField = "invoiceNumber" | "invoiceDate" | "description" | "lotNumber" | "quantity" | "weight" | "unitPrice" | "grossLineTotal" | "accountRef" | "accountName" | "businessAddress" | "customerAddress" | "lineItemsStartLine" | "footerBoundaryLine" | "vatNumber" | "saleName" | "subTotal" | "subTotalTable" | "tagList" | "tagNumber";
|
|
799
|
-
type ChequeField = "chequeDate" | "chequeNumber" | "payee" | "amount" | "amountInWords" | "hunderdsOfThousands" | "tensOfThousands" | "thousands" | "hundreds" | "tens" | "units";
|
|
800
|
-
type SubtotalGroups = "Commission" | string;
|
|
801
|
-
type AdjustmentTotalTarget = "Per Invoice" | "Total - finalTotalInCents" | "Total - lotTotalLessCommissionInCentsExVat";
|
|
802
|
-
type AdjustmentTarget = UnitOfSale | AdjustmentTotalTarget;
|
|
803
|
-
/***
|
|
804
|
-
* Commission is added as a line item. Can also be used for levies etc
|
|
805
|
-
*/
|
|
806
|
-
interface AdjustmentsConfiguration {
|
|
807
|
-
id: string;
|
|
808
|
-
createdAt: Timestamp;
|
|
809
|
-
updatedAt: Timestamp;
|
|
810
|
-
updatedBy?: string | null;
|
|
811
|
-
name?: string | null;
|
|
812
|
-
description?: string | null;
|
|
813
|
-
applyToClients: ClientType[];
|
|
814
|
-
subtotalGroup?: SubtotalGroups | null | undefined;
|
|
815
|
-
type: "commission" | "levy" | "vat-rebate";
|
|
816
|
-
filter?: {
|
|
817
|
-
currency?: CurrenciesWithGuinea | null;
|
|
818
|
-
quantity?: {
|
|
819
|
-
min?: number;
|
|
820
|
-
max?: number;
|
|
821
|
-
} | null;
|
|
822
|
-
unitPrice?: {
|
|
823
|
-
minInCents?: number;
|
|
824
|
-
maxInCents?: number;
|
|
825
|
-
} | null;
|
|
826
|
-
totalPrice?: {
|
|
827
|
-
minInCents?: number;
|
|
828
|
-
maxInCents?: number;
|
|
829
|
-
} | null;
|
|
830
|
-
customerIsVATRegistered?: boolean | null;
|
|
831
|
-
customerWithinTaxRegion?: boolean | null;
|
|
832
|
-
attribute?: {
|
|
833
|
-
key: string;
|
|
834
|
-
value: string | number | boolean | null;
|
|
835
|
-
} | null;
|
|
836
|
-
};
|
|
837
|
-
taxRateId: string;
|
|
838
|
-
adjustment: Adjustment & {
|
|
839
|
-
target: AdjustmentTarget;
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
interface Adjustment {
|
|
843
|
-
percentage?: {
|
|
844
|
-
value?: number;
|
|
845
|
-
floorInCents?: number;
|
|
846
|
-
ceilingInCents?: number;
|
|
847
|
-
} | null;
|
|
848
|
-
fixedAmountInCents?: number | null;
|
|
849
|
-
ladder?: {
|
|
850
|
-
steps: {
|
|
851
|
-
percentageValue?: number;
|
|
852
|
-
upToAmountInCents?: number | null;
|
|
853
|
-
}[];
|
|
854
|
-
floorInCents?: number;
|
|
855
|
-
ceilingInCents?: number;
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
interface LineItemAdjustmentConfiguration extends AdjustmentsConfiguration {
|
|
859
|
-
adjustment: Adjustment & {
|
|
860
|
-
target: UnitOfSale;
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
interface InvoiceTotalAdjustmentConfiguration extends AdjustmentsConfiguration {
|
|
864
|
-
adjustment: Adjustment & {
|
|
865
|
-
target: AdjustmentTotalTarget;
|
|
866
|
-
};
|
|
867
|
-
}
|
|
868
|
-
/***
|
|
869
|
-
* Tax config is used to generate the invoice but the user can still edit the invoice, overriding the final values.
|
|
870
|
-
*/
|
|
871
|
-
interface TaxRate {
|
|
872
|
-
id: string;
|
|
873
|
-
createdAt: Timestamp;
|
|
874
|
-
updatedAt: Timestamp;
|
|
875
|
-
marketId: string;
|
|
876
|
-
description: string;
|
|
877
|
-
taxSubtotalGroup?: string | null;
|
|
878
|
-
percentage: number;
|
|
879
|
-
isExportTaxRate?: boolean;
|
|
880
|
-
}
|
|
881
|
-
interface Payment {
|
|
882
|
-
id: string;
|
|
883
|
-
createdAt: Timestamp;
|
|
884
|
-
updatedAt: Timestamp;
|
|
885
|
-
updatedBy?: string;
|
|
886
|
-
transactionDate: Timestamp;
|
|
887
|
-
marketId: string;
|
|
888
|
-
customerId: string;
|
|
889
|
-
method: PaymentMethod;
|
|
890
|
-
amountInCents: number;
|
|
891
|
-
reference: string | null;
|
|
892
|
-
status: "complete" | "void";
|
|
893
|
-
voidedAt?: Timestamp | null;
|
|
894
|
-
voidedBy?: string | null;
|
|
895
|
-
voidReason?: string | null;
|
|
896
|
-
invoiceIds: string[];
|
|
897
|
-
invoices?: Array<{
|
|
898
|
-
id: string;
|
|
899
|
-
amountAppliedInCents?: number;
|
|
900
|
-
}>;
|
|
901
|
-
transactionIds: string[];
|
|
902
|
-
}
|
|
903
|
-
interface Payout {
|
|
904
|
-
id: string;
|
|
905
|
-
marketId: string;
|
|
906
|
-
createdAt: Timestamp;
|
|
907
|
-
updatedAt: Timestamp;
|
|
908
|
-
updatedBy: string | null;
|
|
909
|
-
customerId: string;
|
|
910
|
-
method: PayoutMethod | "Credit";
|
|
911
|
-
amountInCents: number;
|
|
912
|
-
invoices?: Array<{
|
|
913
|
-
id: string;
|
|
914
|
-
amountAppliedInCents?: number;
|
|
915
|
-
}>;
|
|
916
|
-
accountName?: string;
|
|
917
|
-
accountNumber?: string;
|
|
918
|
-
sortCode?: string;
|
|
919
|
-
chequeMadePayableTo?: string;
|
|
920
|
-
transactionDate: Timestamp;
|
|
921
|
-
reference: string | null;
|
|
922
|
-
status: "pending" | "complete" | "void";
|
|
923
|
-
notes: string | null;
|
|
924
|
-
completedAt?: Timestamp | null;
|
|
925
|
-
completedBy?: string | null;
|
|
926
|
-
voidedAt?: Timestamp | null;
|
|
927
|
-
voidedBy?: string | null;
|
|
928
|
-
voidReason?: string | null;
|
|
929
|
-
transactionIds: string[];
|
|
930
|
-
invoiceIds: string[];
|
|
931
|
-
}
|
|
932
|
-
interface DraftInvoice extends InvoiceTotals {
|
|
933
|
-
id: string;
|
|
934
|
-
currency: Currency;
|
|
935
|
-
status: "draft";
|
|
936
|
-
issuedAt?: Timestamp;
|
|
937
|
-
lotIdents: {
|
|
938
|
-
lotId: string;
|
|
939
|
-
saleId: string;
|
|
940
|
-
}[];
|
|
941
|
-
clientType: ClientType;
|
|
942
|
-
customerId: string;
|
|
943
|
-
customerAccountNumber: string;
|
|
944
|
-
name: string;
|
|
945
|
-
address: Address;
|
|
946
|
-
email: string | null;
|
|
947
|
-
superTypes?: SuperType[];
|
|
948
|
-
customerIsVATRegistered: boolean;
|
|
949
|
-
customerWithinTaxRegion: boolean;
|
|
950
|
-
lineItems: InvoiceLineItem[];
|
|
951
|
-
adjustmentLineItems: InvoiceLineItem[];
|
|
952
|
-
vatNumber?: string;
|
|
953
|
-
extraProductIds: string[];
|
|
954
|
-
payoutMethod?: PayoutMethod | null;
|
|
955
|
-
payoutParams?: {
|
|
956
|
-
settleDebtsFirst: boolean;
|
|
957
|
-
accountName?: string;
|
|
958
|
-
accountNumber?: string;
|
|
959
|
-
sortCode?: string;
|
|
960
|
-
chequeMadePayableTo?: string;
|
|
961
|
-
};
|
|
962
|
-
potentialPayoutsById?: {
|
|
963
|
-
[payoutId: string]: {
|
|
964
|
-
id: string;
|
|
965
|
-
amountInCents: number;
|
|
966
|
-
paymentMethod: PaymentMethod;
|
|
967
|
-
invoice?: {
|
|
968
|
-
id: string;
|
|
969
|
-
invoiceNumber: number;
|
|
970
|
-
fullyPaid: boolean;
|
|
971
|
-
};
|
|
972
|
-
};
|
|
973
|
-
};
|
|
974
|
-
attributeValues?: {
|
|
975
|
-
[attributekey: string]: AttributeValueType;
|
|
976
|
-
};
|
|
977
|
-
attributes: AttributeDefinition[];
|
|
978
|
-
averages?: {
|
|
979
|
-
label: string;
|
|
980
|
-
value: number;
|
|
981
|
-
formattedValue: string;
|
|
982
|
-
}[];
|
|
983
|
-
paymentInstructions?: string | null;
|
|
984
|
-
}
|
|
985
|
-
interface InvoiceTotals {
|
|
986
|
-
lotTotalInCentsExVat: number;
|
|
987
|
-
vatOnLotTotalInCents: number;
|
|
988
|
-
commissionTotalInCents?: number;
|
|
989
|
-
vatOnCommissionInCents?: number;
|
|
990
|
-
nonCommissionAdjustmentsInCents?: number;
|
|
991
|
-
vatOnAdjustmentsInCents?: number;
|
|
992
|
-
subtotalGroupTotals: {
|
|
993
|
-
[key in SubtotalGroups]: number;
|
|
994
|
-
};
|
|
995
|
-
taxSubtotalGroupTotals: {
|
|
996
|
-
[key in string]: number;
|
|
997
|
-
};
|
|
998
|
-
finalTotalInCents: number;
|
|
999
|
-
}
|
|
1000
|
-
interface SimplePaymentIn {
|
|
1001
|
-
paymentId: string;
|
|
1002
|
-
amountInCents: number;
|
|
1003
|
-
paymentMethod: PaymentMethod;
|
|
1004
|
-
reference: string | null;
|
|
1005
|
-
paidAt: Timestamp;
|
|
1006
|
-
}
|
|
1007
|
-
/**
|
|
1008
|
-
* Used on invoice to show the payout. Use payout collection for the source of truth
|
|
1009
|
-
*/
|
|
1010
|
-
interface SimplePaymentOut {
|
|
1011
|
-
payoutId: string;
|
|
1012
|
-
amountInCents: number;
|
|
1013
|
-
paymentMethod: PaymentMethod;
|
|
1014
|
-
reference: string | null;
|
|
1015
|
-
paidAt: Timestamp;
|
|
1016
|
-
}
|
|
1017
|
-
interface Invoice extends Omit<Omit<Omit<Omit<DraftInvoice, "ledgerAccountTotals">, "potentialPayoutsById">, "payoutParams">, "status"> {
|
|
1018
|
-
id: string;
|
|
1019
|
-
invoiceNumber: number;
|
|
1020
|
-
createdAt: Timestamp;
|
|
1021
|
-
updatedAt: Timestamp;
|
|
1022
|
-
updatedBy?: string | null;
|
|
1023
|
-
marketId: string;
|
|
1024
|
-
saleIds: string[];
|
|
1025
|
-
sales: {
|
|
1026
|
-
id: string;
|
|
1027
|
-
name?: string;
|
|
1028
|
-
startsAt?: Timestamp;
|
|
1029
|
-
}[];
|
|
1030
|
-
transactionIds?: string[];
|
|
1031
|
-
status: "draft" | "issued" | "void" | "imported" | "paid";
|
|
1032
|
-
paymentsInById: {
|
|
1033
|
-
[paymentId: string]: SimplePaymentIn;
|
|
1034
|
-
};
|
|
1035
|
-
payoutMethod: PayoutMethod | null;
|
|
1036
|
-
payoutsById: {
|
|
1037
|
-
[payoutId: string]: SimplePaymentOut;
|
|
1038
|
-
};
|
|
1039
|
-
voidReason?: string;
|
|
1040
|
-
voidedAt?: Timestamp;
|
|
1041
|
-
voidedBy?: string;
|
|
1042
|
-
description?: string;
|
|
1043
|
-
footnotes?: string[];
|
|
1044
|
-
metadata: {
|
|
1045
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
1046
|
-
};
|
|
1047
|
-
/***
|
|
1048
|
-
* this is important to add when adding an invoice
|
|
1049
|
-
* it creates a lock so we only ever get sequential invoice numbers
|
|
1050
|
-
* The invoice will have this as null until the next invoice is created
|
|
1051
|
-
*/
|
|
1052
|
-
internalNextInvoiceId: string | null;
|
|
1053
|
-
emailNotifications?: string[];
|
|
1054
|
-
emailStatus?: {
|
|
1055
|
-
recipient: string;
|
|
1056
|
-
status: "sent" | "delivered" | "opened" | "bounced";
|
|
1057
|
-
timestamp: Timestamp;
|
|
1058
|
-
}[];
|
|
1059
|
-
printHistory?: {
|
|
1060
|
-
printedAt: Timestamp;
|
|
1061
|
-
printedBy: string;
|
|
1062
|
-
deviceId: string;
|
|
1063
|
-
documentIds: string[];
|
|
1064
|
-
}[];
|
|
1065
|
-
pitchPayLink: string | null;
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* @description Configuration for the printer
|
|
1069
|
-
*/
|
|
1070
|
-
interface Printer {
|
|
1071
|
-
id: string;
|
|
1072
|
-
createdAt: Timestamp;
|
|
1073
|
-
updatedAt: Timestamp;
|
|
1074
|
-
/**
|
|
1075
|
-
* @description The name of the printer. Its the same as the id
|
|
1076
|
-
*/
|
|
1077
|
-
name: string;
|
|
1078
|
-
friendlyName: string;
|
|
1079
|
-
/**
|
|
1080
|
-
* Optional single IPP URI if linked by IP discovery
|
|
1081
|
-
*/
|
|
1082
|
-
uri?: string;
|
|
1083
|
-
chequePrinter?: boolean;
|
|
1084
|
-
/**
|
|
1085
|
-
* The next cheque number to use when printing a cheque
|
|
1086
|
-
*/
|
|
1087
|
-
nextChequeNumber?: number;
|
|
1088
|
-
lastPrintedAt?: Timestamp;
|
|
1089
|
-
lastPrinterMessage?: string;
|
|
1090
|
-
}
|
|
1091
|
-
interface Printer {
|
|
1092
|
-
name: string;
|
|
1093
|
-
id: string;
|
|
1094
|
-
}
|
|
1095
|
-
interface InvoiceLineItem {
|
|
1096
|
-
id: string;
|
|
1097
|
-
createdAt: Timestamp;
|
|
1098
|
-
updatedAt: Timestamp;
|
|
1099
|
-
subtotalGroup?: SubtotalGroups | null;
|
|
1100
|
-
clientType: ClientType;
|
|
1101
|
-
description: string;
|
|
1102
|
-
index?: number;
|
|
1103
|
-
quantity: number;
|
|
1104
|
-
impreciseUnitPriceInCents: number;
|
|
1105
|
-
unitOfSale?: UnitOfSale;
|
|
1106
|
-
unitPriceIncludesVat?: boolean;
|
|
1107
|
-
taxRate: TaxRate;
|
|
1108
|
-
taxAmountInCents: number;
|
|
1109
|
-
discountAmountInCents?: number;
|
|
1110
|
-
totalAmountInCentsExVat: number;
|
|
1111
|
-
saleId?: string;
|
|
1112
|
-
lotId?: string;
|
|
1113
|
-
lotProductCode?: string;
|
|
1114
|
-
superType?: SuperType | null;
|
|
1115
|
-
productId?: string;
|
|
1116
|
-
productRelatedTo?: {
|
|
1117
|
-
lotId: string;
|
|
1118
|
-
saleId: string;
|
|
1119
|
-
} | null;
|
|
1120
|
-
productObfusicate?: boolean;
|
|
1121
|
-
passthroughFundsToCustomerId?: string | null;
|
|
1122
|
-
adjustmentConfig?: AdjustmentsConfiguration;
|
|
1123
|
-
isLuckMoney?: boolean;
|
|
1124
|
-
metadata: {
|
|
1125
|
-
[key: string]: string | number | boolean | Timestamp | Media | {
|
|
1126
|
-
[key: string]: string | number | boolean | Timestamp;
|
|
1127
|
-
};
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
interface TablePosition {
|
|
1131
|
-
id: InvoiceField | ChequeField | MarketReportHeaders;
|
|
1132
|
-
title: string;
|
|
1133
|
-
cellWidth: number;
|
|
1134
|
-
halign: "left" | "center" | "right";
|
|
1135
|
-
}
|
|
1136
|
-
type WebhookEventName = "market.updated" | "sale.created" | "sale.updated" | "sale.deleted" | "lot.created" | "lot.updated" | "lot.deleted" | "lot.media.created" | "lot.media.deleted" | "invoice.created" | "invoice.updated" | "invoice.deleted" | "payment.created" | "payment.updated" | "payment.deleted" | "payout.created" | "payout.updated" | "payout.deleted" | "customer.created" | "customer.updated" | "customer.deleted" | "member.created" | "member.updated" | "member.deleted" | "sms-task.created" | "sms-task.updated" | "sms-task.deleted";
|
|
1137
|
-
declare const supportedWebhookEvents: readonly ["market.updated", "sale.created", "sale.updated", "sale.deleted", "lot.created", "lot.updated", "lot.deleted", "lot.media.created", "lot.media.deleted", "invoice.created", "invoice.updated", "invoice.deleted", "payment.created", "payment.updated", "payment.deleted", "payout.created", "payout.updated", "payout.deleted", "customer.created", "customer.updated", "customer.deleted", "member.created", "member.updated", "member.deleted", "sms-task.created", "sms-task.updated", "sms-task.deleted"];
|
|
1138
|
-
type ObjectType = "market" | "sale" | "lot" | "invoice" | "payment" | "customer" | "member" | "sms-task";
|
|
1139
|
-
interface WebhookEvent<T> {
|
|
1140
|
-
id: string;
|
|
1141
|
-
createdAt: Timestamp;
|
|
1142
|
-
trigger: WebhookEventName;
|
|
1143
|
-
marketId: string;
|
|
1144
|
-
objectType: ObjectType;
|
|
1145
|
-
data: {
|
|
1146
|
-
object: T;
|
|
1147
|
-
objectBefore?: T;
|
|
1148
|
-
};
|
|
1149
|
-
}
|
|
1150
|
-
type SupportedAttributeTypes = "string" | "number" | "boolean" | "date" | "datetime" | "media" | "mediaset" | "time";
|
|
1151
|
-
interface AttributeDefinition {
|
|
1152
|
-
id: string;
|
|
1153
|
-
name: string;
|
|
1154
|
-
shortName?: string;
|
|
1155
|
-
description?: string;
|
|
1156
|
-
martEyeAttribute?: string;
|
|
1157
|
-
applyTo: string[];
|
|
1158
|
-
level: "item" | "lot";
|
|
1159
|
-
readonly?: boolean;
|
|
1160
|
-
lotDetailFlyoutGroup?: string;
|
|
1161
|
-
buyerCheckoutGroup?: string;
|
|
1162
|
-
sellerCheckoutGroup?: string;
|
|
1163
|
-
buyerCustomerAttribute?: boolean;
|
|
1164
|
-
sellerCustomerAttribute?: boolean;
|
|
1165
|
-
defaultHiddenOnSaleSheet?: boolean;
|
|
1166
|
-
prefillableFromPreviousLot?: boolean;
|
|
1167
|
-
hidden?: boolean;
|
|
1168
|
-
showInSellerDetailsPanel?: boolean;
|
|
1169
|
-
showInSellerReviewPanel?: boolean;
|
|
1170
|
-
displayTemplate?: string;
|
|
1171
|
-
displayTemplateMultiValue?: string;
|
|
1172
|
-
type: SupportedAttributeTypes;
|
|
1173
|
-
requiredPreSale: boolean;
|
|
1174
|
-
requiredToCheckout: boolean;
|
|
1175
|
-
minValue?: number;
|
|
1176
|
-
maxValue?: number;
|
|
1177
|
-
minLength?: number;
|
|
1178
|
-
maxLength?: number;
|
|
1179
|
-
regexPattern?: string;
|
|
1180
|
-
minDateExpression?: string;
|
|
1181
|
-
maxDateExpression?: string;
|
|
1182
|
-
allowedValues?: string[];
|
|
1183
|
-
}
|
|
1184
|
-
interface StudioAppPartial {
|
|
1185
|
-
id: string;
|
|
1186
|
-
name: string;
|
|
1187
|
-
version: string;
|
|
1188
|
-
description: string;
|
|
1189
|
-
icon: string;
|
|
1190
|
-
parameterConfig: AppParameterConfig[];
|
|
1191
|
-
parameterValues: {
|
|
1192
|
-
[key: string]: string | number | boolean | string[];
|
|
1193
|
-
};
|
|
1194
|
-
}
|
|
1195
|
-
type AppParameterConfig = {
|
|
1196
|
-
id: string;
|
|
1197
|
-
type: "string" | "number" | "boolean" | "string[]" | "password";
|
|
1198
|
-
label: string;
|
|
1199
|
-
description?: string;
|
|
1200
|
-
required?: boolean;
|
|
1201
|
-
defaultValue?: string | number | boolean | string[];
|
|
1202
|
-
};
|
|
1203
|
-
interface CphLookupResponse {
|
|
1204
|
-
cph: string;
|
|
1205
|
-
county: string;
|
|
1206
|
-
parish: string;
|
|
1207
|
-
holding: string;
|
|
1208
|
-
subLocation?: string;
|
|
1209
|
-
country: string;
|
|
1210
|
-
region: string | null;
|
|
1211
|
-
spatialUnit: string | null;
|
|
1212
|
-
office: string | null;
|
|
1213
|
-
ahdoNumber: string | null;
|
|
1214
|
-
parishName: string;
|
|
1215
|
-
tbTestingInterval: string | null;
|
|
1216
|
-
tbArea: string | null;
|
|
1217
|
-
cphValid?: boolean | null;
|
|
1218
|
-
farmName?: string | null;
|
|
1219
|
-
}
|
|
1220
|
-
type ActivityOperation = "created" | "updated" | "deleted" | "voided";
|
|
1221
|
-
interface ActivityChange {
|
|
1222
|
-
before?: any;
|
|
1223
|
-
after?: any;
|
|
1224
|
-
}
|
|
1225
|
-
type ReadOptions = {
|
|
1226
|
-
at?: string;
|
|
1227
|
-
};
|
|
1228
|
-
interface ActivityLog {
|
|
1229
|
-
id: string;
|
|
1230
|
-
firstEventAt: Timestamp;
|
|
1231
|
-
lastEventAt: Timestamp;
|
|
1232
|
-
userId: string | null;
|
|
1233
|
-
userName?: string;
|
|
1234
|
-
eventType: WebhookEventName;
|
|
1235
|
-
entityType: ObjectType;
|
|
1236
|
-
entityId: string;
|
|
1237
|
-
entityLabel?: string;
|
|
1238
|
-
saleIds: string[];
|
|
1239
|
-
operation: ActivityOperation;
|
|
1240
|
-
changeCount: number;
|
|
1241
|
-
changes?: {
|
|
1242
|
-
[fieldPath: string]: ActivityChange;
|
|
1243
|
-
};
|
|
1244
|
-
}
|
|
1245
|
-
interface SendSMSPayload {
|
|
1246
|
-
to: string[];
|
|
1247
|
-
message: string;
|
|
1248
|
-
customerId?: string;
|
|
1249
|
-
reference?: string;
|
|
1250
|
-
senderName?: string;
|
|
1251
|
-
}
|
|
1252
|
-
interface SMSTask {
|
|
1253
|
-
id: string;
|
|
1254
|
-
marketId: string;
|
|
1255
|
-
to: string[];
|
|
1256
|
-
message: string;
|
|
1257
|
-
customerId?: string;
|
|
1258
|
-
reference?: string;
|
|
1259
|
-
senderName?: string;
|
|
1260
|
-
metadata?: Record<string, any>;
|
|
1261
|
-
status: "pending" | "sent" | "delivered" | "failed" | "partial";
|
|
1262
|
-
errorCode?: string;
|
|
1263
|
-
errorMessage?: string;
|
|
1264
|
-
providerMessageIds?: string[];
|
|
1265
|
-
providerName?: string;
|
|
1266
|
-
createdAt: Timestamp;
|
|
1267
|
-
updatedAt: Timestamp;
|
|
1268
|
-
sentAt?: Timestamp;
|
|
1269
|
-
deliveredAt?: Timestamp;
|
|
1270
|
-
recipientStatus?: {
|
|
1271
|
-
[phoneNumber: string]: {
|
|
1272
|
-
status: "pending" | "sent" | "delivered" | "failed";
|
|
1273
|
-
providerMessageId?: string;
|
|
1274
|
-
errorCode?: string;
|
|
1275
|
-
errorMessage?: string;
|
|
1276
|
-
timestamp: Timestamp;
|
|
1277
|
-
};
|
|
1278
|
-
};
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
type types_Accessory = Accessory;
|
|
1282
|
-
type types_ActivityChange = ActivityChange;
|
|
1283
|
-
type types_ActivityLog = ActivityLog;
|
|
1284
|
-
type types_ActivityOperation = ActivityOperation;
|
|
1285
|
-
type types_Address = Address;
|
|
1286
|
-
type types_AddressWrapper = AddressWrapper;
|
|
1287
|
-
type types_AdjustmentTarget = AdjustmentTarget;
|
|
1288
|
-
type types_AdjustmentTotalTarget = AdjustmentTotalTarget;
|
|
1289
|
-
type types_AdjustmentsConfiguration = AdjustmentsConfiguration;
|
|
1290
|
-
type types_AppParameterConfig = AppParameterConfig;
|
|
1291
|
-
type types_Application = Application;
|
|
1292
|
-
type types_AttributeDefinition = AttributeDefinition;
|
|
1293
|
-
type types_AttributeValueType = AttributeValueType;
|
|
1294
|
-
type types_BankDetails = BankDetails;
|
|
1295
|
-
type types_Cart = Cart;
|
|
1296
|
-
type types_CartItem = CartItem;
|
|
1297
|
-
type types_ChequeField = ChequeField;
|
|
1298
|
-
type types_ClientType = ClientType;
|
|
1299
|
-
type types_CphLookupResponse = CphLookupResponse;
|
|
1300
|
-
type types_CurrenciesWithGuinea = CurrenciesWithGuinea;
|
|
1301
|
-
type types_Currency = Currency;
|
|
1302
|
-
type types_Customer = Customer;
|
|
1303
|
-
type types_CustomerBankDetails = CustomerBankDetails;
|
|
1304
|
-
type types_CustomerContact = CustomerContact;
|
|
1305
|
-
type types_CustomerFromSearch = CustomerFromSearch;
|
|
1306
|
-
type types_DeleteLotsResponse = DeleteLotsResponse;
|
|
1307
|
-
type types_DeviceType = DeviceType;
|
|
1308
|
-
type types_DisplayBoardMode = DisplayBoardMode;
|
|
1309
|
-
type types_DraftInvoice = DraftInvoice;
|
|
1310
|
-
type types_EmailWrapper = EmailWrapper;
|
|
1311
|
-
type types_FarmAssurances = FarmAssurances;
|
|
1312
|
-
type types_FieldPositions = FieldPositions;
|
|
1313
|
-
declare const types_IMAGE_SIZES_VALUES: typeof IMAGE_SIZES_VALUES;
|
|
1314
|
-
type types_ImageSizes = ImageSizes;
|
|
1315
|
-
type types_IncrementLadder = IncrementLadder;
|
|
1316
|
-
type types_IncrementLadderItem = IncrementLadderItem;
|
|
1317
|
-
type types_Invoice = Invoice;
|
|
1318
|
-
type types_InvoiceDeliveryPreference = InvoiceDeliveryPreference;
|
|
1319
|
-
type types_InvoiceField = InvoiceField;
|
|
1320
|
-
type types_InvoiceLineItem = InvoiceLineItem;
|
|
1321
|
-
type types_InvoiceTotalAdjustmentConfiguration = InvoiceTotalAdjustmentConfiguration;
|
|
1322
|
-
type types_InvoiceTotals = InvoiceTotals;
|
|
1323
|
-
type types_LineItemAdjustmentConfiguration = LineItemAdjustmentConfiguration;
|
|
1324
|
-
declare const types_LivestockSuperTypes: typeof LivestockSuperTypes;
|
|
1325
|
-
type types_Lot = Lot;
|
|
1326
|
-
type types_LotDeleteDecision = LotDeleteDecision;
|
|
1327
|
-
type types_LotDeletePreflightItem = LotDeletePreflightItem;
|
|
1328
|
-
type types_LotDeletePreflightResponse = LotDeletePreflightResponse;
|
|
1329
|
-
type types_LotDeleteReason = LotDeleteReason;
|
|
1330
|
-
type types_LotGeneratedValues = LotGeneratedValues;
|
|
1331
|
-
type types_LotIssue = LotIssue;
|
|
1332
|
-
type types_LotItem = LotItem;
|
|
1333
|
-
type types_LotSaleStatus = LotSaleStatus;
|
|
1334
|
-
type types_LotWithItemsAsArray = LotWithItemsAsArray;
|
|
1335
|
-
type types_Market = Market;
|
|
1336
|
-
type types_MarketBankDetails = MarketBankDetails;
|
|
1337
|
-
type types_MarketReportHeaders = MarketReportHeaders;
|
|
1338
|
-
type types_MartEyeLiveSaleSettings = MartEyeLiveSaleSettings;
|
|
1339
|
-
type types_MartEyeTimedSaleSettings = MartEyeTimedSaleSettings;
|
|
1340
|
-
type types_Media = Media;
|
|
1341
|
-
type types_MemberSharingConfiguration = MemberSharingConfiguration;
|
|
1342
|
-
type types_ObjectType = ObjectType;
|
|
1343
|
-
type types_Payment = Payment;
|
|
1344
|
-
type types_PaymentMethod = PaymentMethod;
|
|
1345
|
-
type types_Payout = Payout;
|
|
1346
|
-
type types_PayoutMethod = PayoutMethod;
|
|
1347
|
-
type types_PhoneNumberWrapper = PhoneNumberWrapper;
|
|
1348
|
-
type types_Printer = Printer;
|
|
1349
|
-
type types_Product = Product;
|
|
1350
|
-
type types_ProductCodeConfiguration = ProductCodeConfiguration;
|
|
1351
|
-
type types_ProductConfiguration = ProductConfiguration;
|
|
1352
|
-
type types_ReadOptions = ReadOptions;
|
|
1353
|
-
type types_SMSTask = SMSTask;
|
|
1354
|
-
type types_Sale = Sale;
|
|
1355
|
-
type types_SaleFromSearch = SaleFromSearch;
|
|
1356
|
-
type types_SalePublishStatus = SalePublishStatus;
|
|
1357
|
-
type types_SaleTemplate = SaleTemplate;
|
|
1358
|
-
type types_SendSMSPayload = SendSMSPayload;
|
|
1359
|
-
type types_SettingsAccessories = SettingsAccessories;
|
|
1360
|
-
type types_SettingsAdjustmentsConfiguration = SettingsAdjustmentsConfiguration;
|
|
1361
|
-
type types_SettingsGlobalAttributes = SettingsGlobalAttributes;
|
|
1362
|
-
type types_SettingsMarketDefaults = SettingsMarketDefaults;
|
|
1363
|
-
type types_SettingsPrinters = SettingsPrinters;
|
|
1364
|
-
type types_SettingsProductCodes = SettingsProductCodes;
|
|
1365
|
-
type types_SettingsTaxRates = SettingsTaxRates;
|
|
1366
|
-
type types_ShortCustomerDetails = ShortCustomerDetails;
|
|
1367
|
-
type types_SimplePaymentIn = SimplePaymentIn;
|
|
1368
|
-
type types_SimplePaymentOut = SimplePaymentOut;
|
|
1369
|
-
type types_StoredDataGridConfig = StoredDataGridConfig;
|
|
1370
|
-
type types_StudioAppPartial = StudioAppPartial;
|
|
1371
|
-
type types_SubtotalGroups = SubtotalGroups;
|
|
1372
|
-
type types_SuperType = SuperType;
|
|
1373
|
-
type types_SupportedAttributeTypes = SupportedAttributeTypes;
|
|
1374
|
-
type types_SupportedCountryCode = SupportedCountryCode;
|
|
1375
|
-
declare const types_SupportedCurrencyCodes: typeof SupportedCurrencyCodes;
|
|
1376
|
-
declare const types_SupportedPaymentMethods: typeof SupportedPaymentMethods;
|
|
1377
|
-
declare const types_SupportedSuperTypes: typeof SupportedSuperTypes;
|
|
1378
|
-
declare const types_SupportedUnitsOfSale: typeof SupportedUnitsOfSale;
|
|
1379
|
-
type types_TablePosition = TablePosition;
|
|
1380
|
-
type types_TaxRate = TaxRate;
|
|
1381
|
-
type types_TemplateSaleData = TemplateSaleData;
|
|
1382
|
-
type types_UnitOfSale = UnitOfSale;
|
|
1383
|
-
declare const types_VIDEO_TASKS_VALUES: typeof VIDEO_TASKS_VALUES;
|
|
1384
|
-
type types_VideoTasks = VideoTasks;
|
|
1385
|
-
type types_WebhookEvent<T> = WebhookEvent<T>;
|
|
1386
|
-
type types_WebhookEventName = WebhookEventName;
|
|
1387
|
-
declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
|
|
1388
|
-
declare namespace types {
|
|
1389
|
-
export { type types_Accessory as Accessory, type types_ActivityChange as ActivityChange, type types_ActivityLog as ActivityLog, type types_ActivityOperation as ActivityOperation, 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_Application as Application, 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_CphLookupResponse as CphLookupResponse, type types_CurrenciesWithGuinea as CurrenciesWithGuinea, type types_Currency as Currency, type types_Customer as Customer, type types_CustomerBankDetails as CustomerBankDetails, type types_CustomerContact as CustomerContact, type types_CustomerFromSearch as CustomerFromSearch, type types_DeleteLotsResponse as DeleteLotsResponse, type types_DeviceType as DeviceType, type types_DisplayBoardMode as DisplayBoardMode, type types_DraftInvoice as DraftInvoice, type types_EmailWrapper as EmailWrapper, type types_FarmAssurances as FarmAssurances, type types_FieldPositions as FieldPositions, types_IMAGE_SIZES_VALUES as IMAGE_SIZES_VALUES, type types_ImageSizes as ImageSizes, type types_IncrementLadder as IncrementLadder, type types_IncrementLadderItem as IncrementLadderItem, type types_Invoice as Invoice, type types_InvoiceDeliveryPreference as InvoiceDeliveryPreference, 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_LotDeleteDecision as LotDeleteDecision, type types_LotDeletePreflightItem as LotDeletePreflightItem, type types_LotDeletePreflightResponse as LotDeletePreflightResponse, type types_LotDeleteReason as LotDeleteReason, 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_ReadOptions as ReadOptions, type types_SMSTask as SMSTask, type types_Sale as Sale, type types_SaleFromSearch as SaleFromSearch, type types_SalePublishStatus as SalePublishStatus, type types_SaleTemplate as SaleTemplate, type types_SendSMSPayload as SendSMSPayload, 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_StoredDataGridConfig as StoredDataGridConfig, 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, type SupportedFileTypesNames$1 as SupportedFileTypesNames, types_SupportedPaymentMethods as SupportedPaymentMethods, types_SupportedSuperTypes as SupportedSuperTypes, types_SupportedUnitsOfSale as SupportedUnitsOfSale, type types_TablePosition as TablePosition, type types_TaxRate as TaxRate, type types_TemplateSaleData as TemplateSaleData, type types_UnitOfSale as UnitOfSale, types_VIDEO_TASKS_VALUES as VIDEO_TASKS_VALUES, type types_VideoTasks as VideoTasks, type types_WebhookEvent as WebhookEvent, type types_WebhookEventName as WebhookEventName, types_supportedWebhookEvents as supportedWebhookEvents };
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
|
-
interface ListContactsResponse {
|
|
1393
|
-
contacts: CustomerContact[];
|
|
1394
|
-
lastId: string | null;
|
|
1395
|
-
hasMore: boolean;
|
|
1396
|
-
}
|
|
1397
|
-
interface CreateOrUpdateContactPayload {
|
|
1398
|
-
id?: string;
|
|
1399
|
-
displayName?: string | null;
|
|
1400
|
-
email?: string | null;
|
|
1401
|
-
phoneNumber?: string | null;
|
|
1402
|
-
notes?: string | null;
|
|
1403
|
-
marteyeUid?: string | null;
|
|
1404
|
-
accountEmails?: boolean;
|
|
1405
|
-
marketingEmails?: boolean;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
declare const videoTaskSchema: z.ZodEnum<["compressed", "thumbnail"]>;
|
|
1409
|
-
declare const imageSizeSchema: z.ZodEnum<["thumbnail", "small", "medium", "large"]>;
|
|
1410
|
-
type ImageSize = z.infer<typeof imageSizeSchema>;
|
|
1411
|
-
type VideoTask = z.infer<typeof videoTaskSchema>;
|
|
1412
|
-
type SupportedFileTypesNames = "image" | "video" | "file";
|
|
1413
|
-
type VariantProcessingState = {
|
|
1414
|
-
fileName: string;
|
|
1415
|
-
thumbHash: string;
|
|
1416
|
-
path: string;
|
|
1417
|
-
url: string;
|
|
1418
|
-
fileType: string;
|
|
1419
|
-
variants: Partial<Record<ImageSize | VideoTask, {
|
|
1420
|
-
url: string;
|
|
1421
|
-
isProcessing: boolean;
|
|
1422
|
-
type: SupportedFileTypesNames;
|
|
1423
|
-
}>>;
|
|
1424
|
-
};
|
|
1425
|
-
type MediaUploadOptions = {
|
|
1426
|
-
marketId: string;
|
|
1427
|
-
saleId: string;
|
|
1428
|
-
lotId: string;
|
|
1429
|
-
attributeId: string;
|
|
1430
|
-
options?: {
|
|
1431
|
-
bucket?: "raw";
|
|
1432
|
-
parallelParts?: number;
|
|
1433
|
-
baseUrl?: string;
|
|
1434
|
-
progressCallback?: (progress: {
|
|
1435
|
-
/**
|
|
1436
|
-
* The state of the upload
|
|
1437
|
-
*/
|
|
1438
|
-
state: "uploading" | "finished" | "failed" | "starting";
|
|
1439
|
-
/**
|
|
1440
|
-
* The progress of the upload
|
|
1441
|
-
*/
|
|
1442
|
-
progress: number;
|
|
1443
|
-
/**
|
|
1444
|
-
* The current part number
|
|
1445
|
-
*/
|
|
1446
|
-
currentPart?: number;
|
|
1447
|
-
/**
|
|
1448
|
-
* The total parts
|
|
1449
|
-
*/
|
|
1450
|
-
totalParts?: number;
|
|
1451
|
-
}) => void;
|
|
1452
|
-
};
|
|
1453
|
-
};
|
|
1454
|
-
type ChunkedFile = {
|
|
1455
|
-
partNumber: string;
|
|
1456
|
-
chunk: string;
|
|
1457
|
-
fileExtension: string;
|
|
1458
|
-
fileMimeType: string;
|
|
1459
|
-
};
|
|
1460
|
-
type FileInput = {
|
|
1461
|
-
file: File;
|
|
1462
|
-
uploadConfig: MediaUploadOptions;
|
|
1463
|
-
};
|
|
1464
|
-
type ChunkedInput = {
|
|
1465
|
-
fileName: string;
|
|
1466
|
-
chunks: ChunkedFile[];
|
|
1467
|
-
uploadConfig: MediaUploadOptions;
|
|
1468
|
-
};
|
|
1469
|
-
type SingleFileInput = {
|
|
1470
|
-
file?: File;
|
|
1471
|
-
filePath?: never;
|
|
1472
|
-
uploadConfig: MediaUploadOptions;
|
|
1473
|
-
} | {
|
|
1474
|
-
filePath?: string;
|
|
1475
|
-
file?: never;
|
|
1476
|
-
uploadConfig: MediaUploadOptions;
|
|
1477
|
-
};
|
|
1478
|
-
|
|
1479
|
-
/**
|
|
1480
|
-
* Search result interface based on the API implementation
|
|
1481
|
-
*/
|
|
1482
|
-
interface SearchResult {
|
|
1483
|
-
hits: Array<{
|
|
1484
|
-
id: string;
|
|
1485
|
-
marketId: string;
|
|
1486
|
-
title: string;
|
|
1487
|
-
[key: string]: any;
|
|
1488
|
-
}>;
|
|
1489
|
-
processingTimeMs: number;
|
|
1490
|
-
query: string;
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
interface PayoutsListResponse {
|
|
1494
|
-
payouts: Payout[];
|
|
1495
|
-
lastId: string | null;
|
|
1496
|
-
hasMore: boolean;
|
|
1497
|
-
}
|
|
1498
|
-
interface PayoutCreateResponse {
|
|
1499
|
-
payout: Payout;
|
|
1500
|
-
}
|
|
1501
|
-
interface CreatePayoutRequest {
|
|
1502
|
-
/** IDs of the seller invoices this payout is for. All must be for the same customer and have status "issued". */
|
|
1503
|
-
invoiceIds: string[];
|
|
1504
|
-
/** Payout method */
|
|
1505
|
-
method: "BACS" | "Cheque" | "Cash";
|
|
1506
|
-
/** Payout amount in cents. If not provided, defaults to the sum of amountDueInCents across all invoices. */
|
|
1507
|
-
amountInCents?: number;
|
|
1508
|
-
/** Transaction date (ISO 8601). Defaults to now. */
|
|
1509
|
-
transactionDate?: string;
|
|
1510
|
-
/** Cheque number or BACS reference */
|
|
1511
|
-
reference?: string | null;
|
|
1512
|
-
/** Optional notes */
|
|
1513
|
-
notes?: string | null;
|
|
1514
|
-
/** Account holder name (BACS only). Falls back to customer bank details or display name. */
|
|
1515
|
-
accountName?: string;
|
|
1516
|
-
/** 8-digit account number (BACS only). Falls back to customer bank details. */
|
|
1517
|
-
accountNumber?: string;
|
|
1518
|
-
/** 6-digit sort code (BACS only). Falls back to customer bank details. */
|
|
1519
|
-
sortCode?: string;
|
|
1520
|
-
/** Name on cheque (Cheque only). Falls back to customer display name. */
|
|
1521
|
-
chequeMadePayableTo?: string;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
interface PaymentsListResponse {
|
|
1525
|
-
payments: Payment[];
|
|
1526
|
-
lastId: string | null;
|
|
1527
|
-
hasMore: boolean;
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
interface InvoicesListResponse {
|
|
1531
|
-
invoices: Invoice[];
|
|
1532
|
-
lastId: string | null;
|
|
1533
|
-
hasMore: boolean;
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
interface CreateCustomerPayload {
|
|
1537
|
-
displayName: string;
|
|
1538
|
-
email?: string;
|
|
1539
|
-
phone?: string;
|
|
1540
|
-
accountNumberPrefix?: string;
|
|
1541
|
-
accountNumber?: string;
|
|
1542
|
-
cphNumber?: string;
|
|
1543
|
-
farmName?: string;
|
|
1544
|
-
herdNumber?: string;
|
|
1545
|
-
flockNumber?: string;
|
|
1546
|
-
address?: {
|
|
1547
|
-
company?: string;
|
|
1548
|
-
firstName?: string;
|
|
1549
|
-
lastName?: string;
|
|
1550
|
-
address1: string;
|
|
1551
|
-
address2?: string;
|
|
1552
|
-
city: string;
|
|
1553
|
-
province?: string;
|
|
1554
|
-
zip: string;
|
|
1555
|
-
country: string;
|
|
1556
|
-
};
|
|
1557
|
-
marteyeUid?: string;
|
|
1558
|
-
bankDetails?: {
|
|
1559
|
-
sortCode?: string;
|
|
1560
|
-
accountNumber?: string;
|
|
1561
|
-
accountName?: string;
|
|
1562
|
-
};
|
|
1563
|
-
vatNumber?: string;
|
|
1564
|
-
invoiceDeliveryPreference?: string;
|
|
1565
|
-
statementDeliveryPreference?: string;
|
|
1566
|
-
payoutPreference?: string;
|
|
1567
|
-
notes?: string;
|
|
1568
|
-
}
|
|
1569
|
-
interface FarmAssuranceUpdate {
|
|
1570
|
-
number?: string | null;
|
|
1571
|
-
scheme?: string | null;
|
|
1572
|
-
expiry?: string | Date | null;
|
|
1573
|
-
}
|
|
1574
|
-
interface KeeperDetailsUpdate {
|
|
1575
|
-
herdNumber?: string | null;
|
|
1576
|
-
flockNumber?: string | null;
|
|
1577
|
-
cphNumber?: string | null;
|
|
1578
|
-
farmName?: string | null;
|
|
1579
|
-
slapMark?: string | null;
|
|
1580
|
-
farmAssurance?: {
|
|
1581
|
-
cattle?: FarmAssuranceUpdate | null;
|
|
1582
|
-
sheep?: FarmAssuranceUpdate | null;
|
|
1583
|
-
pigs?: FarmAssuranceUpdate | null;
|
|
1584
|
-
};
|
|
1585
|
-
vetAttestation?: {
|
|
1586
|
-
vanNumber?: string | null;
|
|
1587
|
-
expiry?: string | Date | null;
|
|
1588
|
-
} | null;
|
|
1589
|
-
movementReporting?: {
|
|
1590
|
-
fromOrigin?: boolean | null;
|
|
1591
|
-
toDestination?: boolean | null;
|
|
1592
|
-
} | null;
|
|
1593
|
-
}
|
|
1594
|
-
interface UpdateCustomerPayload {
|
|
1595
|
-
displayName?: string | null;
|
|
1596
|
-
email?: {
|
|
1597
|
-
email: string;
|
|
1598
|
-
isVerified?: boolean;
|
|
1599
|
-
createdAt?: string | Date;
|
|
1600
|
-
} | null;
|
|
1601
|
-
phoneNumber?: {
|
|
1602
|
-
phoneNumber: string;
|
|
1603
|
-
isVerified?: boolean;
|
|
1604
|
-
createdAt?: string | Date;
|
|
1605
|
-
} | null;
|
|
1606
|
-
address?: Customer["address"] | null;
|
|
1607
|
-
otherAddresses?: Customer["otherAddresses"] | null;
|
|
1608
|
-
otherPhoneNumbers?: Customer["otherPhoneNumbers"] | null;
|
|
1609
|
-
payoutPreference?: PayoutMethod | "none" | null;
|
|
1610
|
-
invoiceDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
|
|
1611
|
-
statementDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
|
|
1612
|
-
bankDetails?: Customer["bankDetails"] | null;
|
|
1613
|
-
preferSettleDebtsFirst?: boolean;
|
|
1614
|
-
vatNumber?: string | null;
|
|
1615
|
-
accountNumber?: string | null;
|
|
1616
|
-
notes?: string | null;
|
|
1617
|
-
attributeDefaultsBuyer?: Customer["attributeDefaultsBuyer"] | null;
|
|
1618
|
-
attributeDefaultsSeller?: Customer["attributeDefaultsSeller"] | null;
|
|
1619
|
-
metadata?: Customer["metadata"] | null;
|
|
1620
|
-
keeperDetails?: KeeperDetailsUpdate;
|
|
1621
|
-
}
|
|
1622
|
-
interface CustomersListResponse {
|
|
1623
|
-
customers: Customer[];
|
|
1624
|
-
lastId: string | null;
|
|
1625
|
-
hasMore: boolean;
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
interface CreateExtraPayload {
|
|
1629
|
-
id: string;
|
|
1630
|
-
name: string;
|
|
1631
|
-
taxRateId: string;
|
|
1632
|
-
defaultUnitPriceInCents?: number;
|
|
1633
|
-
unitPriceIncludesVat?: boolean;
|
|
1634
|
-
applyToClients?: ("Seller" | "Buyer")[];
|
|
1635
|
-
subtotalGroup?: string | null;
|
|
1636
|
-
passThroughFundsToAnotherCustomer?: boolean;
|
|
1637
|
-
isEnabled?: boolean;
|
|
1638
|
-
metadata?: Record<string, any>;
|
|
1639
|
-
}
|
|
1640
|
-
interface UpdateExtraPayload {
|
|
1641
|
-
name?: string;
|
|
1642
|
-
taxRateId?: string;
|
|
1643
|
-
defaultUnitPriceInCents?: number;
|
|
1644
|
-
unitPriceIncludesVat?: boolean;
|
|
1645
|
-
applyToClients?: ("Seller" | "Buyer")[];
|
|
1646
|
-
subtotalGroup?: string | null;
|
|
1647
|
-
passThroughFundsToAnotherCustomer?: boolean;
|
|
1648
|
-
isEnabled?: boolean;
|
|
1649
|
-
metadata?: Record<string, any>;
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
interface CreateApplicationPayload {
|
|
1653
|
-
displayName: string;
|
|
1654
|
-
phoneNumber?: string;
|
|
1655
|
-
email?: string;
|
|
1656
|
-
address: {
|
|
1657
|
-
firstLine: string;
|
|
1658
|
-
secondLine?: string;
|
|
1659
|
-
county?: string;
|
|
1660
|
-
postCode: string;
|
|
1661
|
-
};
|
|
1662
|
-
dateOfMarteyeAccountCreation?: string;
|
|
1663
|
-
hasWonLotsOnMarteye?: boolean;
|
|
1664
|
-
isApprovedAtOtherMarkets?: boolean;
|
|
1665
|
-
marteyeUid: string;
|
|
1666
|
-
notes?: string;
|
|
1667
|
-
}
|
|
1668
|
-
interface UpdateApplicationPayload {
|
|
1669
|
-
displayName?: string;
|
|
1670
|
-
phoneNumber?: string;
|
|
1671
|
-
email?: string;
|
|
1672
|
-
address?: {
|
|
1673
|
-
firstLine?: string;
|
|
1674
|
-
secondLine?: string;
|
|
1675
|
-
county?: string;
|
|
1676
|
-
postCode?: string;
|
|
1677
|
-
};
|
|
1678
|
-
notes?: string;
|
|
1679
|
-
}
|
|
1680
|
-
interface ListApplicationsOptions {
|
|
1681
|
-
lastId?: string;
|
|
1682
|
-
status?: "pending" | "approved" | "rejected";
|
|
1683
|
-
}
|
|
1684
|
-
interface ListApplicationsResponse {
|
|
1685
|
-
applications: Application[];
|
|
1686
|
-
lastId: string | null;
|
|
1687
|
-
hasMore: boolean;
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
interface LotsBySale {
|
|
1691
|
-
saleId: string;
|
|
1692
|
-
marketId: string;
|
|
1693
|
-
lots: Lot[];
|
|
1694
|
-
}
|
|
1695
|
-
interface CartResponse {
|
|
1696
|
-
customerId: string;
|
|
1697
|
-
extras: CartItem[];
|
|
1698
|
-
lotsBuyingBySale: LotsBySale[];
|
|
1699
|
-
lotsSellingBySale: LotsBySale[];
|
|
1700
|
-
}
|
|
1701
|
-
interface AddExtraPayload {
|
|
1702
|
-
productId: string;
|
|
1703
|
-
clientType: "Seller" | "Buyer";
|
|
1704
|
-
quantity: number;
|
|
1705
|
-
unitPriceInCents: number;
|
|
1706
|
-
passthroughFundsToCustomerId?: string | null;
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
interface Member {
|
|
1710
|
-
uid: string;
|
|
1711
|
-
displayName: string | null;
|
|
1712
|
-
role: "Owner" | "Admin" | "Editor";
|
|
1713
|
-
createdAt: string;
|
|
1714
|
-
updatedAt: string;
|
|
1715
|
-
}
|
|
1716
|
-
interface MembersListResponse {
|
|
1717
|
-
data: Member[];
|
|
1718
|
-
lastId: string | null;
|
|
1719
|
-
hasMore: boolean;
|
|
1720
|
-
}
|
|
1721
|
-
interface MembersListParams {
|
|
1722
|
-
limit?: number;
|
|
1723
|
-
lastId?: string;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
interface ActivityListResponse {
|
|
1727
|
-
data: ActivityLog[];
|
|
1728
|
-
lastId: string | null;
|
|
1729
|
-
hasMore: boolean;
|
|
1730
|
-
}
|
|
1731
|
-
interface ActivityListParams {
|
|
1732
|
-
saleId?: string;
|
|
1733
|
-
entityType?: string;
|
|
1734
|
-
entityId?: string;
|
|
1735
|
-
operation?: string;
|
|
1736
|
-
memberId?: string;
|
|
1737
|
-
from?: string;
|
|
1738
|
-
to?: string;
|
|
1739
|
-
limit?: number;
|
|
1740
|
-
lastId?: string;
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
type CustomerListType = "simple" | "smart";
|
|
1744
|
-
type CustomerListRole = "buyer" | "seller" | "both";
|
|
1745
|
-
interface GeoBounds {
|
|
1746
|
-
north: number;
|
|
1747
|
-
south: number;
|
|
1748
|
-
east: number;
|
|
1749
|
-
west: number;
|
|
1750
|
-
}
|
|
1751
|
-
interface RollingDateConfig {
|
|
1752
|
-
windowDays: number;
|
|
1753
|
-
originalStart: string;
|
|
1754
|
-
originalEnd: string;
|
|
1755
|
-
}
|
|
1756
|
-
interface CustomerListQuery {
|
|
1757
|
-
role: CustomerListRole;
|
|
1758
|
-
filter?: string;
|
|
1759
|
-
excludeFilters?: string[];
|
|
1760
|
-
bounds?: GeoBounds;
|
|
1761
|
-
rollingDateConfig?: RollingDateConfig;
|
|
1762
|
-
secondaryFilter?: {
|
|
1763
|
-
role: CustomerListRole;
|
|
1764
|
-
filter?: string;
|
|
1765
|
-
bounds?: GeoBounds;
|
|
1766
|
-
rollingDateConfig?: RollingDateConfig;
|
|
1767
|
-
};
|
|
1768
|
-
}
|
|
1769
|
-
interface CustomerList {
|
|
1770
|
-
id: string;
|
|
1771
|
-
marketId: string;
|
|
1772
|
-
name: string;
|
|
1773
|
-
slug: string;
|
|
1774
|
-
description?: string;
|
|
1775
|
-
type: CustomerListType;
|
|
1776
|
-
query?: CustomerListQuery;
|
|
1777
|
-
rollingDateConfig?: RollingDateConfig;
|
|
1778
|
-
excludedCustomerIds?: string[];
|
|
1779
|
-
memberCount: number;
|
|
1780
|
-
refreshStatus?: "idle" | "refreshing" | "failed";
|
|
1781
|
-
refreshError?: string;
|
|
1782
|
-
lastRefreshedAt?: string;
|
|
1783
|
-
lastRefreshDurationMs?: number;
|
|
1784
|
-
lastRefreshCostEstimate?: number;
|
|
1785
|
-
lastRollingDateRange?: {
|
|
1786
|
-
start: string;
|
|
1787
|
-
end: string;
|
|
1788
|
-
};
|
|
1789
|
-
createdAt: string;
|
|
1790
|
-
createdBy: string;
|
|
1791
|
-
updatedAt: string;
|
|
1792
|
-
updatedBy: string;
|
|
1793
|
-
}
|
|
1794
|
-
interface CustomerListMember {
|
|
1795
|
-
marketId: string;
|
|
1796
|
-
listId: string;
|
|
1797
|
-
customerId: string;
|
|
1798
|
-
dateAdded: string;
|
|
1799
|
-
addedBy: string;
|
|
1800
|
-
customerDisplayName?: string;
|
|
1801
|
-
customerAccountNumber?: string;
|
|
1802
|
-
email?: string;
|
|
1803
|
-
phoneNumber?: string;
|
|
1804
|
-
}
|
|
1805
|
-
interface CustomerListFilterGroup {
|
|
1806
|
-
role: CustomerListRole;
|
|
1807
|
-
dateStart?: string | null;
|
|
1808
|
-
dateEnd?: string | null;
|
|
1809
|
-
productCodes?: string[];
|
|
1810
|
-
geoBounds?: GeoBounds | null;
|
|
1811
|
-
rollingDateConfig?: RollingDateConfig;
|
|
1812
|
-
}
|
|
1813
|
-
interface CustomerListFilters {
|
|
1814
|
-
role?: CustomerListRole | null;
|
|
1815
|
-
dateStart?: string | null;
|
|
1816
|
-
dateEnd?: string | null;
|
|
1817
|
-
productCodes?: string[];
|
|
1818
|
-
excludeDateStart?: string | null;
|
|
1819
|
-
excludeDateEnd?: string | null;
|
|
1820
|
-
excludedProductCodes?: string[];
|
|
1821
|
-
geoBounds?: GeoBounds | null;
|
|
1822
|
-
boughtOnlineOnly?: boolean;
|
|
1823
|
-
cattleBreeds?: string[];
|
|
1824
|
-
sheepBreeds?: string[];
|
|
1825
|
-
rollingDateConfig?: RollingDateConfig;
|
|
1826
|
-
secondaryFilter?: CustomerListFilterGroup | null;
|
|
1827
|
-
}
|
|
1828
|
-
interface CustomerListReportRow {
|
|
1829
|
-
customerId: string;
|
|
1830
|
-
displayName?: string | null;
|
|
1831
|
-
accountNumber?: string | null;
|
|
1832
|
-
purchasedItemCount: number;
|
|
1833
|
-
totalPurchasedValueInCents: number;
|
|
1834
|
-
soldItemCount: number;
|
|
1835
|
-
totalSoldValueInCents: number;
|
|
1836
|
-
lastSaleDate?: string | null;
|
|
1837
|
-
lastPurchaseDate?: string | null;
|
|
1838
|
-
productCodesSold?: string[] | null;
|
|
1839
|
-
productCodesBought?: string[] | null;
|
|
1840
|
-
latitude?: number | null;
|
|
1841
|
-
longitude?: number | null;
|
|
1842
|
-
address1?: string | null;
|
|
1843
|
-
address2?: string | null;
|
|
1844
|
-
city?: string | null;
|
|
1845
|
-
province?: string | null;
|
|
1846
|
-
zip?: string | null;
|
|
1847
|
-
country?: string | null;
|
|
1848
|
-
email?: string | null;
|
|
1849
|
-
phoneNumber?: string | null;
|
|
1850
|
-
}
|
|
1851
|
-
interface CustomerListReportSummary {
|
|
1852
|
-
totalCustomers: number;
|
|
1853
|
-
totalSoldValueInCents: number;
|
|
1854
|
-
totalPurchasedValueInCents: number;
|
|
1855
|
-
customersWithLocation: number;
|
|
1856
|
-
uniqueProductCodes: string[];
|
|
1857
|
-
}
|
|
1858
|
-
type CustomerListViewResult = {
|
|
1859
|
-
mode: "simple";
|
|
1860
|
-
list: CustomerList;
|
|
1861
|
-
members: CustomerListMember[];
|
|
1862
|
-
total: number;
|
|
1863
|
-
} | {
|
|
1864
|
-
mode: "smart";
|
|
1865
|
-
list: CustomerList;
|
|
1866
|
-
effectiveFilters: CustomerListFilters;
|
|
1867
|
-
rows: CustomerListReportRow[];
|
|
1868
|
-
summary: CustomerListReportSummary;
|
|
1869
|
-
};
|
|
1870
|
-
interface CustomerListsListOptions {
|
|
1871
|
-
type?: CustomerListType;
|
|
1872
|
-
limit?: number;
|
|
1873
|
-
offset?: number;
|
|
1874
|
-
}
|
|
1875
|
-
interface CustomerListMembersOptions {
|
|
1876
|
-
limit?: number;
|
|
1877
|
-
offset?: number;
|
|
1878
|
-
includeArchived?: boolean;
|
|
1879
|
-
}
|
|
1880
|
-
interface CustomerListViewOptions {
|
|
1881
|
-
identifierType?: "auto" | "id" | "slug";
|
|
1882
|
-
limit?: number;
|
|
1883
|
-
offset?: number;
|
|
1884
|
-
allMembers?: boolean;
|
|
1885
|
-
refresh?: boolean;
|
|
1886
|
-
}
|
|
1887
|
-
interface CustomerListsListResponse {
|
|
1888
|
-
lists: CustomerList[];
|
|
1889
|
-
total: number;
|
|
1890
|
-
}
|
|
1891
|
-
interface CustomerListMembersResponse {
|
|
1892
|
-
members: CustomerListMember[];
|
|
1893
|
-
total: number;
|
|
1894
|
-
hasMore: boolean;
|
|
1895
|
-
}
|
|
1896
|
-
interface CustomerListPreviewResponse {
|
|
1897
|
-
rows: CustomerListReportRow[];
|
|
1898
|
-
summary: CustomerListReportSummary;
|
|
1899
|
-
}
|
|
1900
|
-
interface CustomerListProductCodesResponse {
|
|
1901
|
-
uniqueProductCodes: string[];
|
|
1902
|
-
}
|
|
1903
|
-
interface CustomerListAddMembersResponse {
|
|
1904
|
-
added: number;
|
|
1905
|
-
alreadyMembers: number;
|
|
1906
|
-
notFound: number;
|
|
1907
|
-
memberCount: number;
|
|
1908
|
-
}
|
|
1909
|
-
interface CustomerListRemoveMemberResponse {
|
|
1910
|
-
removed: boolean;
|
|
1911
|
-
memberCount: number;
|
|
1912
|
-
}
|
|
1913
|
-
interface CustomerListDeleteResponse {
|
|
1914
|
-
deleted: boolean;
|
|
1915
|
-
membersRemoved: number;
|
|
1916
|
-
}
|
|
1917
|
-
interface CustomerListRefreshResponse {
|
|
1918
|
-
refreshStatus: "refreshing";
|
|
1919
|
-
message: string;
|
|
1920
|
-
}
|
|
1921
|
-
type CreateCustomerListPayload = {
|
|
1922
|
-
name: string;
|
|
1923
|
-
description?: string;
|
|
1924
|
-
type: "simple";
|
|
1925
|
-
} | {
|
|
1926
|
-
name: string;
|
|
1927
|
-
description?: string;
|
|
1928
|
-
type: "smart";
|
|
1929
|
-
query?: CustomerListQuery;
|
|
1930
|
-
filters?: CustomerListFilters;
|
|
1931
|
-
};
|
|
1932
|
-
interface UpdateCustomerListPayload {
|
|
1933
|
-
name?: string;
|
|
1934
|
-
description?: string | null;
|
|
1935
|
-
query?: CustomerListQuery;
|
|
1936
|
-
filters?: Partial<CustomerListFilters>;
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
declare function resources(httpClient: HttpClient): {
|
|
1940
|
-
activity: {
|
|
1941
|
-
list: (marketId: string, params?: ActivityListParams | undefined) => Promise<ActivityListResponse>;
|
|
1942
|
-
get: (marketId: string, activityId: string) => Promise<ActivityLog>;
|
|
1943
|
-
};
|
|
1944
|
-
markets: {
|
|
1945
|
-
get: (marketId: string, options?: ReadOptions | undefined) => Promise<Market>;
|
|
1946
|
-
};
|
|
1947
|
-
members: {
|
|
1948
|
-
list: (marketId: string, params?: MembersListParams | undefined) => Promise<MembersListResponse>;
|
|
1949
|
-
get: (marketId: string, memberId: string) => Promise<Member>;
|
|
1950
|
-
};
|
|
1951
|
-
sales: {
|
|
1952
|
-
get: (marketId: string, saleId: string, options?: ReadOptions | undefined) => Promise<Sale>;
|
|
1953
|
-
list: (marketId: string, opts: {
|
|
1954
|
-
start?: string | undefined;
|
|
1955
|
-
end?: string | undefined;
|
|
1956
|
-
}) => Promise<{
|
|
1957
|
-
start: string;
|
|
1958
|
-
end: string;
|
|
1959
|
-
sales: Sale[];
|
|
1960
|
-
}>;
|
|
1961
|
-
create: (marketId: string, saleData: {
|
|
1962
|
-
name: string;
|
|
1963
|
-
startsAt: string;
|
|
1964
|
-
availableProductCodes: string[];
|
|
1965
|
-
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
|
|
1966
|
-
martEyeSaleType?: "LIVE" | "TIMED" | null | undefined;
|
|
1967
|
-
location?: string | null | undefined;
|
|
1968
|
-
description?: string | null | undefined;
|
|
1969
|
-
image?: string | null | undefined;
|
|
1970
|
-
cover?: string | null | undefined;
|
|
1971
|
-
templateId?: string | null | undefined;
|
|
1972
|
-
attributeDefaults?: {
|
|
1973
|
-
[attributekey: string]: string | number | boolean;
|
|
1974
|
-
} | undefined;
|
|
1975
|
-
}) => Promise<{
|
|
1976
|
-
saleId: string;
|
|
1977
|
-
}>;
|
|
1978
|
-
update: (marketId: string, saleId: string, data: {
|
|
1979
|
-
name?: string | undefined;
|
|
1980
|
-
startsAt?: string | undefined;
|
|
1981
|
-
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
|
|
1982
|
-
defaultProductCode?: string | undefined;
|
|
1983
|
-
attributeDefaults?: Record<string, any> | undefined;
|
|
1984
|
-
publishStatus?: SalePublishStatus | undefined;
|
|
1985
|
-
marteyeSettings?: {
|
|
1986
|
-
description?: string | undefined;
|
|
1987
|
-
image?: string | undefined;
|
|
1988
|
-
logo?: string | undefined;
|
|
1989
|
-
type: "LIVE" | "TIMED";
|
|
1990
|
-
location?: string | null | undefined;
|
|
1991
|
-
descriptionLines?: string[] | undefined;
|
|
1992
|
-
descriptionLink?: string | undefined;
|
|
1993
|
-
deposit?: number | undefined;
|
|
1994
|
-
hidePrices?: boolean | undefined;
|
|
1995
|
-
hideReplay?: boolean | undefined;
|
|
1996
|
-
labels?: string[] | undefined;
|
|
1997
|
-
tags?: string[] | undefined;
|
|
1998
|
-
details?: {
|
|
1999
|
-
markdownBase64: string;
|
|
2000
|
-
title: string;
|
|
2001
|
-
}[] | undefined;
|
|
2002
|
-
cover?: string | undefined;
|
|
2003
|
-
primaryColour?: string | undefined;
|
|
2004
|
-
secondaryColour?: string | undefined;
|
|
2005
|
-
foregroundColour?: string | undefined;
|
|
2006
|
-
extensionTime?: number | undefined;
|
|
2007
|
-
incrementLadder?: {
|
|
2008
|
-
max: number;
|
|
2009
|
-
increment: number;
|
|
2010
|
-
}[] | undefined;
|
|
2011
|
-
hideNav?: boolean | undefined;
|
|
2012
|
-
signInOverrideLink?: string | undefined;
|
|
2013
|
-
published?: boolean | undefined;
|
|
2014
|
-
pin?: boolean | undefined;
|
|
2015
|
-
cascade?: boolean | undefined;
|
|
2016
|
-
reportEmail?: string | undefined;
|
|
2017
|
-
queueLots?: boolean | undefined;
|
|
2018
|
-
markSubjectLotsAsSold?: boolean | undefined;
|
|
2019
|
-
} | null | undefined;
|
|
2020
|
-
}) => Promise<Sale>;
|
|
2021
|
-
};
|
|
2022
|
-
lots: {
|
|
2023
|
-
get: (marketId: string, saleId: string, lotId: string, options?: ReadOptions | undefined) => Promise<Lot>;
|
|
2024
|
-
list: (marketId: string, saleId: string, filters?: {
|
|
2025
|
-
group?: string | undefined;
|
|
2026
|
-
productCode?: string | undefined;
|
|
2027
|
-
saleStatus?: LotSaleStatus | undefined;
|
|
2028
|
-
sellerCustomerId?: string | undefined;
|
|
2029
|
-
buyerCustomerId?: string | undefined;
|
|
2030
|
-
} | undefined) => Promise<Lot[]>;
|
|
2031
|
-
create: (marketId: string, saleId: string, data: {
|
|
2032
|
-
index?: number | undefined;
|
|
2033
|
-
lotNumber?: string | undefined;
|
|
2034
|
-
group?: string | undefined;
|
|
2035
|
-
productCode?: string | undefined;
|
|
2036
|
-
sellerCustomerId?: string | undefined;
|
|
2037
|
-
attributes?: Record<string, any> | undefined;
|
|
2038
|
-
metadata?: Record<string, any> | undefined;
|
|
2039
|
-
buyerCustomerId?: string | undefined;
|
|
2040
|
-
unitPriceInCents?: number | undefined;
|
|
2041
|
-
reservePriceInCents?: number | undefined;
|
|
2042
|
-
startingPriceInCents?: number | undefined;
|
|
2043
|
-
startAt?: string | undefined;
|
|
2044
|
-
endAt?: string | undefined;
|
|
2045
|
-
previousLotNumber?: string | undefined;
|
|
2046
|
-
saleStatus?: LotSaleStatus | undefined;
|
|
2047
|
-
}) => Promise<Lot>;
|
|
2048
|
-
update: (marketId: string, saleId: string, lotId: string, data: {
|
|
2049
|
-
productCode?: string | undefined;
|
|
2050
|
-
attributes?: Record<string, any> | undefined;
|
|
2051
|
-
sellerCasual?: string | null | undefined;
|
|
2052
|
-
sellerCustomerId?: string | null | undefined;
|
|
2053
|
-
lotNumber?: string | null | undefined;
|
|
2054
|
-
remarks?: string | undefined;
|
|
2055
|
-
notes?: string | undefined;
|
|
2056
|
-
unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
|
|
2057
|
-
unitPriceInCents?: number | undefined;
|
|
2058
|
-
reservePriceInCents?: number | undefined;
|
|
2059
|
-
startingPriceInCents?: number | undefined;
|
|
2060
|
-
buyerCasual?: string | null | undefined;
|
|
2061
|
-
buyerCustomerId?: string | null | undefined;
|
|
2062
|
-
startAt?: string | null | undefined;
|
|
2063
|
-
endAt?: string | null | undefined;
|
|
2064
|
-
saleStatus?: LotSaleStatus | undefined;
|
|
2065
|
-
metadata?: Record<string, any> | undefined;
|
|
2066
|
-
inputAccessories?: Record<string, any> | undefined;
|
|
2067
|
-
}) => Promise<Lot>;
|
|
2068
|
-
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
2069
|
-
deletePreflight: (marketId: string, saleId: string, lotId: string) => Promise<LotDeletePreflightResponse>;
|
|
2070
|
-
deletePreflightBatch: (marketId: string, saleId: string, lotIds: string[]) => Promise<DeleteLotsResponse>;
|
|
2071
|
-
deleteBatch: (marketId: string, saleId: string, lotIds: string[], confirmedLotIds?: string[] | undefined) => Promise<DeleteLotsResponse>;
|
|
2072
|
-
};
|
|
2073
|
-
lotitems: {
|
|
2074
|
-
create: (marketId: string, saleId: string, lotId: string, data: {
|
|
2075
|
-
attributes?: Record<string, any> | undefined;
|
|
2076
|
-
notes?: {
|
|
2077
|
-
text: string;
|
|
2078
|
-
}[] | undefined;
|
|
2079
|
-
metadata?: Record<string, any> | undefined;
|
|
2080
|
-
}) => Promise<LotItem>;
|
|
2081
|
-
update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
|
|
2082
|
-
attributes?: Record<string, any> | undefined;
|
|
2083
|
-
index?: number | undefined;
|
|
2084
|
-
metadata?: Record<string, any> | undefined;
|
|
2085
|
-
}) => Promise<LotItem>;
|
|
2086
|
-
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
2087
|
-
};
|
|
2088
|
-
carts: {
|
|
2089
|
-
get: (marketId: string, customerId: string) => Promise<CartResponse>;
|
|
2090
|
-
addExtra: (marketId: string, customerId: string, data: AddExtraPayload) => Promise<CartResponse>;
|
|
2091
|
-
removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
|
|
2092
|
-
};
|
|
2093
|
-
cph: {
|
|
2094
|
-
lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
|
|
2095
|
-
};
|
|
2096
|
-
webhooks: {
|
|
2097
|
-
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | null | undefined, endpointSecret: string | null | undefined) => Promise<WebhookEvent<T>>;
|
|
2098
|
-
};
|
|
2099
|
-
actions: {
|
|
2100
|
-
constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
|
|
2101
|
-
};
|
|
2102
|
-
bidderApplications: {
|
|
2103
|
-
list: (marketId: string, options?: ListApplicationsOptions | undefined) => Promise<ListApplicationsResponse>;
|
|
2104
|
-
get: (marketId: string, applicationId: string) => Promise<Application>;
|
|
2105
|
-
create: (marketId: string, applicationData: CreateApplicationPayload) => Promise<Application>;
|
|
2106
|
-
update: (marketId: string, applicationId: string, updateData: UpdateApplicationPayload) => Promise<Application>;
|
|
2107
|
-
approve: (marketId: string, applicationId: string, notes?: string | undefined) => Promise<Application>;
|
|
2108
|
-
reject: (marketId: string, applicationId: string, notes?: string | undefined) => Promise<Application>;
|
|
2109
|
-
unlink: (marketId: string, applicationId: string) => Promise<Application>;
|
|
2110
|
-
delete: (marketId: string, applicationId: string) => Promise<void>;
|
|
2111
|
-
};
|
|
2112
|
-
settings: {
|
|
2113
|
-
get: (marketId: string, options?: ReadOptions | undefined) => Promise<SettingsMarketDefaults>;
|
|
2114
|
-
};
|
|
2115
|
-
adjustments: {
|
|
2116
|
-
list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
|
|
2117
|
-
get: (marketId: string, id: string, options?: ReadOptions | undefined) => Promise<AdjustmentsConfiguration>;
|
|
2118
|
-
create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
2119
|
-
update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
2120
|
-
};
|
|
2121
|
-
extras: {
|
|
2122
|
-
list: (marketId: string) => Promise<Product[]>;
|
|
2123
|
-
get: (marketId: string, id: string) => Promise<Product>;
|
|
2124
|
-
create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
|
|
2125
|
-
update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
|
|
2126
|
-
};
|
|
2127
|
-
productCodes: {
|
|
2128
|
-
list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
|
|
2129
|
-
get: (marketId: string, id: string, options?: ReadOptions | undefined) => Promise<ProductCodeConfiguration>;
|
|
2130
|
-
create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
2131
|
-
update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
2132
|
-
};
|
|
2133
|
-
saleTemplates: {
|
|
2134
|
-
list: (marketId: string) => Promise<{
|
|
2135
|
-
templates: SaleTemplate[];
|
|
2136
|
-
}>;
|
|
2137
|
-
get: (marketId: string, templateId: string) => Promise<{
|
|
2138
|
-
template: SaleTemplate;
|
|
2139
|
-
}>;
|
|
2140
|
-
create: (marketId: string, body: {
|
|
2141
|
-
saleId: string;
|
|
2142
|
-
name: string;
|
|
2143
|
-
description?: string | null | undefined;
|
|
2144
|
-
}) => Promise<{
|
|
2145
|
-
templateId: string;
|
|
2146
|
-
}>;
|
|
2147
|
-
update: (marketId: string, templateId: string, body: {
|
|
2148
|
-
name?: string | undefined;
|
|
2149
|
-
description?: string | null | undefined;
|
|
2150
|
-
}) => Promise<{
|
|
2151
|
-
template: SaleTemplate;
|
|
2152
|
-
}>;
|
|
2153
|
-
delete: (marketId: string, templateId: string) => Promise<{
|
|
2154
|
-
success: boolean;
|
|
2155
|
-
}>;
|
|
2156
|
-
};
|
|
2157
|
-
taxRates: {
|
|
2158
|
-
list: (marketId: string) => Promise<TaxRate[]>;
|
|
2159
|
-
get: (marketId: string, id: string) => Promise<TaxRate>;
|
|
2160
|
-
};
|
|
2161
|
-
customers: {
|
|
2162
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<CustomersListResponse>;
|
|
2163
|
-
get: (marketId: string, customerId: string, options?: ReadOptions | undefined) => Promise<Customer>;
|
|
2164
|
-
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
2165
|
-
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
2166
|
-
update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
|
|
2167
|
-
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
|
|
2168
|
-
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
|
|
2169
|
-
};
|
|
2170
|
-
customerLists: {
|
|
2171
|
-
list: (marketId: string, options?: CustomerListsListOptions | undefined) => Promise<CustomerListsListResponse>;
|
|
2172
|
-
listAll: (marketId: string, options?: Omit<CustomerListsListOptions, "offset"> | undefined) => Promise<CustomerList[]>;
|
|
2173
|
-
get: (marketId: string, listId: string) => Promise<CustomerList>;
|
|
2174
|
-
getBySlug: (marketId: string, slug: string) => Promise<CustomerList>;
|
|
2175
|
-
create: (marketId: string, payload: CreateCustomerListPayload) => Promise<CustomerList>;
|
|
2176
|
-
update: (marketId: string, listId: string, payload: UpdateCustomerListPayload) => Promise<CustomerList>;
|
|
2177
|
-
delete: (marketId: string, listId: string) => Promise<CustomerListDeleteResponse>;
|
|
2178
|
-
refresh: (marketId: string, listId: string) => Promise<CustomerListRefreshResponse>;
|
|
2179
|
-
getMembers: (marketId: string, listId: string, options?: CustomerListMembersOptions | undefined) => Promise<CustomerListMembersResponse>;
|
|
2180
|
-
getAllMembers: (marketId: string, listId: string, options?: Omit<CustomerListMembersOptions, "offset"> | undefined) => Promise<CustomerListMember[]>;
|
|
2181
|
-
addMembers: (marketId: string, listId: string, customerIds: string[]) => Promise<CustomerListAddMembersResponse>;
|
|
2182
|
-
removeMember: (marketId: string, listId: string, customerId: string) => Promise<CustomerListRemoveMemberResponse>;
|
|
2183
|
-
preview: (marketId: string, filters: CustomerListFilters) => Promise<CustomerListPreviewResponse>;
|
|
2184
|
-
listProductCodes: (marketId: string) => Promise<CustomerListProductCodesResponse>;
|
|
2185
|
-
view: (marketId: string, listIdOrSlug: string, options?: CustomerListViewOptions | undefined) => Promise<CustomerListViewResult>;
|
|
2186
|
-
};
|
|
2187
|
-
invoices: {
|
|
2188
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<InvoicesListResponse>;
|
|
2189
|
-
get: (marketId: string, invoiceId: string, options?: ReadOptions | undefined) => Promise<Invoice>;
|
|
2190
|
-
};
|
|
2191
|
-
payments: {
|
|
2192
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<PaymentsListResponse>;
|
|
2193
|
-
get: (marketId: string, paymentId: string) => Promise<Payment>;
|
|
2194
|
-
};
|
|
2195
|
-
payouts: {
|
|
2196
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<PayoutsListResponse>;
|
|
2197
|
-
get: (marketId: string, payoutId: string) => Promise<Payout>;
|
|
2198
|
-
create: (marketId: string, data: CreatePayoutRequest) => Promise<PayoutCreateResponse>;
|
|
2199
|
-
};
|
|
2200
|
-
search: {
|
|
2201
|
-
query: (marketId: string, query: string) => Promise<SearchResult>;
|
|
2202
|
-
};
|
|
2203
|
-
files: {
|
|
2204
|
-
uploadSingleFile: (input: SingleFileInput, token: string) => Promise<{
|
|
2205
|
-
message: string;
|
|
2206
|
-
data: Media;
|
|
2207
|
-
}>;
|
|
2208
|
-
uploadMultipartFile: (input: FileInput | ChunkedInput, token: string) => Promise<{
|
|
2209
|
-
message: string;
|
|
2210
|
-
mediaType: string;
|
|
2211
|
-
process: VariantProcessingState;
|
|
2212
|
-
}>;
|
|
2213
|
-
deleteFile: (fileUrl: string, token: string) => Promise<{
|
|
2214
|
-
data: boolean;
|
|
2215
|
-
}>;
|
|
2216
|
-
};
|
|
2217
|
-
contacts: {
|
|
2218
|
-
list: (marketId: string, customerId: string, params?: {
|
|
2219
|
-
lastId?: string | undefined;
|
|
2220
|
-
limit?: number | undefined;
|
|
2221
|
-
} | undefined) => Promise<ListContactsResponse>;
|
|
2222
|
-
get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
|
|
2223
|
-
create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
|
|
2224
|
-
update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
|
|
2225
|
-
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
2226
|
-
};
|
|
2227
|
-
ledger: {
|
|
2228
|
-
getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
|
|
2229
|
-
getTransaction: (marketId: string, transactionId: string) => Promise<LedgerTransaction>;
|
|
2230
|
-
getLatestTransaction: (marketId: string, account: string) => Promise<LedgerTransaction>;
|
|
2231
|
-
listTransactions: (marketId: string, params: ListTransactionsParams) => Promise<TransactionsListResponse>;
|
|
2232
|
-
};
|
|
2233
|
-
sms: {
|
|
2234
|
-
sendSMS: (marketId: string, data: SendSMSPayload) => Promise<SMSTask>;
|
|
2235
|
-
getSMS: (marketId: string, smsId: string) => Promise<SMSTask>;
|
|
2236
|
-
};
|
|
2237
|
-
};
|
|
2238
|
-
|
|
2239
|
-
type StudioInstance = ReturnType<typeof resources> & {
|
|
2240
|
-
isDebugMode: boolean;
|
|
2241
|
-
};
|
|
2242
|
-
declare function Studio(info?: {
|
|
2243
|
-
apiKey?: string;
|
|
2244
|
-
baseUrl?: string;
|
|
2245
|
-
defaultTimeout?: number;
|
|
2246
|
-
debug?: boolean;
|
|
2247
|
-
}): {
|
|
2248
|
-
isDebugMode: boolean;
|
|
2249
|
-
activity: {
|
|
2250
|
-
list: (marketId: string, params?: ActivityListParams | undefined) => Promise<ActivityListResponse>;
|
|
2251
|
-
get: (marketId: string, activityId: string) => Promise<ActivityLog>;
|
|
2252
|
-
};
|
|
2253
|
-
markets: {
|
|
2254
|
-
get: (marketId: string, options?: ReadOptions | undefined) => Promise<Market>;
|
|
2255
|
-
};
|
|
2256
|
-
members: {
|
|
2257
|
-
list: (marketId: string, params?: MembersListParams | undefined) => Promise<MembersListResponse>;
|
|
2258
|
-
get: (marketId: string, memberId: string) => Promise<Member>;
|
|
2259
|
-
};
|
|
2260
|
-
sales: {
|
|
2261
|
-
get: (marketId: string, saleId: string, options?: ReadOptions | undefined) => Promise<Sale>;
|
|
2262
|
-
list: (marketId: string, opts: {
|
|
2263
|
-
start?: string | undefined;
|
|
2264
|
-
end?: string | undefined;
|
|
2265
|
-
}) => Promise<{
|
|
2266
|
-
start: string;
|
|
2267
|
-
end: string;
|
|
2268
|
-
sales: Sale[];
|
|
2269
|
-
}>;
|
|
2270
|
-
create: (marketId: string, saleData: {
|
|
2271
|
-
name: string;
|
|
2272
|
-
startsAt: string;
|
|
2273
|
-
availableProductCodes: string[];
|
|
2274
|
-
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
|
|
2275
|
-
martEyeSaleType?: "LIVE" | "TIMED" | null | undefined;
|
|
2276
|
-
location?: string | null | undefined;
|
|
2277
|
-
description?: string | null | undefined;
|
|
2278
|
-
image?: string | null | undefined;
|
|
2279
|
-
cover?: string | null | undefined;
|
|
2280
|
-
templateId?: string | null | undefined;
|
|
2281
|
-
attributeDefaults?: {
|
|
2282
|
-
[attributekey: string]: string | number | boolean;
|
|
2283
|
-
} | undefined;
|
|
2284
|
-
}) => Promise<{
|
|
2285
|
-
saleId: string;
|
|
2286
|
-
}>;
|
|
2287
|
-
update: (marketId: string, saleId: string, data: {
|
|
2288
|
-
name?: string | undefined;
|
|
2289
|
-
startsAt?: string | undefined;
|
|
2290
|
-
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
|
|
2291
|
-
defaultProductCode?: string | undefined;
|
|
2292
|
-
attributeDefaults?: Record<string, any> | undefined;
|
|
2293
|
-
publishStatus?: SalePublishStatus | undefined;
|
|
2294
|
-
marteyeSettings?: {
|
|
2295
|
-
description?: string | undefined;
|
|
2296
|
-
image?: string | undefined;
|
|
2297
|
-
logo?: string | undefined;
|
|
2298
|
-
type: "LIVE" | "TIMED";
|
|
2299
|
-
location?: string | null | undefined;
|
|
2300
|
-
descriptionLines?: string[] | undefined;
|
|
2301
|
-
descriptionLink?: string | undefined;
|
|
2302
|
-
deposit?: number | undefined;
|
|
2303
|
-
hidePrices?: boolean | undefined;
|
|
2304
|
-
hideReplay?: boolean | undefined;
|
|
2305
|
-
labels?: string[] | undefined;
|
|
2306
|
-
tags?: string[] | undefined;
|
|
2307
|
-
details?: {
|
|
2308
|
-
markdownBase64: string;
|
|
2309
|
-
title: string;
|
|
2310
|
-
}[] | undefined;
|
|
2311
|
-
cover?: string | undefined;
|
|
2312
|
-
primaryColour?: string | undefined;
|
|
2313
|
-
secondaryColour?: string | undefined;
|
|
2314
|
-
foregroundColour?: string | undefined;
|
|
2315
|
-
extensionTime?: number | undefined;
|
|
2316
|
-
incrementLadder?: {
|
|
2317
|
-
max: number;
|
|
2318
|
-
increment: number;
|
|
2319
|
-
}[] | undefined;
|
|
2320
|
-
hideNav?: boolean | undefined;
|
|
2321
|
-
signInOverrideLink?: string | undefined;
|
|
2322
|
-
published?: boolean | undefined;
|
|
2323
|
-
pin?: boolean | undefined;
|
|
2324
|
-
cascade?: boolean | undefined;
|
|
2325
|
-
reportEmail?: string | undefined;
|
|
2326
|
-
queueLots?: boolean | undefined;
|
|
2327
|
-
markSubjectLotsAsSold?: boolean | undefined;
|
|
2328
|
-
} | null | undefined;
|
|
2329
|
-
}) => Promise<Sale>;
|
|
2330
|
-
};
|
|
2331
|
-
lots: {
|
|
2332
|
-
get: (marketId: string, saleId: string, lotId: string, options?: ReadOptions | undefined) => Promise<Lot>;
|
|
2333
|
-
list: (marketId: string, saleId: string, filters?: {
|
|
2334
|
-
group?: string | undefined;
|
|
2335
|
-
productCode?: string | undefined;
|
|
2336
|
-
saleStatus?: LotSaleStatus | undefined;
|
|
2337
|
-
sellerCustomerId?: string | undefined;
|
|
2338
|
-
buyerCustomerId?: string | undefined;
|
|
2339
|
-
} | undefined) => Promise<Lot[]>;
|
|
2340
|
-
create: (marketId: string, saleId: string, data: {
|
|
2341
|
-
index?: number | undefined;
|
|
2342
|
-
lotNumber?: string | undefined;
|
|
2343
|
-
group?: string | undefined;
|
|
2344
|
-
productCode?: string | undefined;
|
|
2345
|
-
sellerCustomerId?: string | undefined;
|
|
2346
|
-
attributes?: Record<string, any> | undefined;
|
|
2347
|
-
metadata?: Record<string, any> | undefined;
|
|
2348
|
-
buyerCustomerId?: string | undefined;
|
|
2349
|
-
unitPriceInCents?: number | undefined;
|
|
2350
|
-
reservePriceInCents?: number | undefined;
|
|
2351
|
-
startingPriceInCents?: number | undefined;
|
|
2352
|
-
startAt?: string | undefined;
|
|
2353
|
-
endAt?: string | undefined;
|
|
2354
|
-
previousLotNumber?: string | undefined;
|
|
2355
|
-
saleStatus?: LotSaleStatus | undefined;
|
|
2356
|
-
}) => Promise<Lot>;
|
|
2357
|
-
update: (marketId: string, saleId: string, lotId: string, data: {
|
|
2358
|
-
productCode?: string | undefined;
|
|
2359
|
-
attributes?: Record<string, any> | undefined;
|
|
2360
|
-
sellerCasual?: string | null | undefined;
|
|
2361
|
-
sellerCustomerId?: string | null | undefined;
|
|
2362
|
-
lotNumber?: string | null | undefined;
|
|
2363
|
-
remarks?: string | undefined;
|
|
2364
|
-
notes?: string | undefined;
|
|
2365
|
-
unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
|
|
2366
|
-
unitPriceInCents?: number | undefined;
|
|
2367
|
-
reservePriceInCents?: number | undefined;
|
|
2368
|
-
startingPriceInCents?: number | undefined;
|
|
2369
|
-
buyerCasual?: string | null | undefined;
|
|
2370
|
-
buyerCustomerId?: string | null | undefined;
|
|
2371
|
-
startAt?: string | null | undefined;
|
|
2372
|
-
endAt?: string | null | undefined;
|
|
2373
|
-
saleStatus?: LotSaleStatus | undefined;
|
|
2374
|
-
metadata?: Record<string, any> | undefined;
|
|
2375
|
-
inputAccessories?: Record<string, any> | undefined;
|
|
2376
|
-
}) => Promise<Lot>;
|
|
2377
|
-
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
2378
|
-
deletePreflight: (marketId: string, saleId: string, lotId: string) => Promise<LotDeletePreflightResponse>;
|
|
2379
|
-
deletePreflightBatch: (marketId: string, saleId: string, lotIds: string[]) => Promise<DeleteLotsResponse>;
|
|
2380
|
-
deleteBatch: (marketId: string, saleId: string, lotIds: string[], confirmedLotIds?: string[] | undefined) => Promise<DeleteLotsResponse>;
|
|
2381
|
-
};
|
|
2382
|
-
lotitems: {
|
|
2383
|
-
create: (marketId: string, saleId: string, lotId: string, data: {
|
|
2384
|
-
attributes?: Record<string, any> | undefined;
|
|
2385
|
-
notes?: {
|
|
2386
|
-
text: string;
|
|
2387
|
-
}[] | undefined;
|
|
2388
|
-
metadata?: Record<string, any> | undefined;
|
|
2389
|
-
}) => Promise<LotItem>;
|
|
2390
|
-
update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
|
|
2391
|
-
attributes?: Record<string, any> | undefined;
|
|
2392
|
-
index?: number | undefined;
|
|
2393
|
-
metadata?: Record<string, any> | undefined;
|
|
2394
|
-
}) => Promise<LotItem>;
|
|
2395
|
-
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
2396
|
-
};
|
|
2397
|
-
carts: {
|
|
2398
|
-
get: (marketId: string, customerId: string) => Promise<CartResponse>;
|
|
2399
|
-
addExtra: (marketId: string, customerId: string, data: AddExtraPayload) => Promise<CartResponse>;
|
|
2400
|
-
removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
|
|
2401
|
-
};
|
|
2402
|
-
cph: {
|
|
2403
|
-
lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
|
|
2404
|
-
};
|
|
2405
|
-
webhooks: {
|
|
2406
|
-
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | null | undefined, endpointSecret: string | null | undefined) => Promise<WebhookEvent<T>>;
|
|
2407
|
-
};
|
|
2408
|
-
actions: {
|
|
2409
|
-
constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
|
|
2410
|
-
};
|
|
2411
|
-
bidderApplications: {
|
|
2412
|
-
list: (marketId: string, options?: ListApplicationsOptions | undefined) => Promise<ListApplicationsResponse>;
|
|
2413
|
-
get: (marketId: string, applicationId: string) => Promise<Application>;
|
|
2414
|
-
create: (marketId: string, applicationData: CreateApplicationPayload) => Promise<Application>;
|
|
2415
|
-
update: (marketId: string, applicationId: string, updateData: UpdateApplicationPayload) => Promise<Application>;
|
|
2416
|
-
approve: (marketId: string, applicationId: string, notes?: string | undefined) => Promise<Application>;
|
|
2417
|
-
reject: (marketId: string, applicationId: string, notes?: string | undefined) => Promise<Application>;
|
|
2418
|
-
unlink: (marketId: string, applicationId: string) => Promise<Application>;
|
|
2419
|
-
delete: (marketId: string, applicationId: string) => Promise<void>;
|
|
2420
|
-
};
|
|
2421
|
-
settings: {
|
|
2422
|
-
get: (marketId: string, options?: ReadOptions | undefined) => Promise<SettingsMarketDefaults>;
|
|
2423
|
-
};
|
|
2424
|
-
adjustments: {
|
|
2425
|
-
list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
|
|
2426
|
-
get: (marketId: string, id: string, options?: ReadOptions | undefined) => Promise<AdjustmentsConfiguration>;
|
|
2427
|
-
create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
2428
|
-
update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
2429
|
-
};
|
|
2430
|
-
extras: {
|
|
2431
|
-
list: (marketId: string) => Promise<Product[]>;
|
|
2432
|
-
get: (marketId: string, id: string) => Promise<Product>;
|
|
2433
|
-
create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
|
|
2434
|
-
update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
|
|
2435
|
-
};
|
|
2436
|
-
productCodes: {
|
|
2437
|
-
list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
|
|
2438
|
-
get: (marketId: string, id: string, options?: ReadOptions | undefined) => Promise<ProductCodeConfiguration>;
|
|
2439
|
-
create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
2440
|
-
update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
2441
|
-
};
|
|
2442
|
-
saleTemplates: {
|
|
2443
|
-
list: (marketId: string) => Promise<{
|
|
2444
|
-
templates: SaleTemplate[];
|
|
2445
|
-
}>;
|
|
2446
|
-
get: (marketId: string, templateId: string) => Promise<{
|
|
2447
|
-
template: SaleTemplate;
|
|
2448
|
-
}>;
|
|
2449
|
-
create: (marketId: string, body: {
|
|
2450
|
-
saleId: string;
|
|
2451
|
-
name: string;
|
|
2452
|
-
description?: string | null | undefined;
|
|
2453
|
-
}) => Promise<{
|
|
2454
|
-
templateId: string;
|
|
2455
|
-
}>;
|
|
2456
|
-
update: (marketId: string, templateId: string, body: {
|
|
2457
|
-
name?: string | undefined;
|
|
2458
|
-
description?: string | null | undefined;
|
|
2459
|
-
}) => Promise<{
|
|
2460
|
-
template: SaleTemplate;
|
|
2461
|
-
}>;
|
|
2462
|
-
delete: (marketId: string, templateId: string) => Promise<{
|
|
2463
|
-
success: boolean;
|
|
2464
|
-
}>;
|
|
2465
|
-
};
|
|
2466
|
-
taxRates: {
|
|
2467
|
-
list: (marketId: string) => Promise<TaxRate[]>;
|
|
2468
|
-
get: (marketId: string, id: string) => Promise<TaxRate>;
|
|
2469
|
-
};
|
|
2470
|
-
customers: {
|
|
2471
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<CustomersListResponse>;
|
|
2472
|
-
get: (marketId: string, customerId: string, options?: ReadOptions | undefined) => Promise<Customer>;
|
|
2473
|
-
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
2474
|
-
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
2475
|
-
update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
|
|
2476
|
-
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
|
|
2477
|
-
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
|
|
2478
|
-
};
|
|
2479
|
-
customerLists: {
|
|
2480
|
-
list: (marketId: string, options?: CustomerListsListOptions | undefined) => Promise<CustomerListsListResponse>;
|
|
2481
|
-
listAll: (marketId: string, options?: Omit<CustomerListsListOptions, "offset"> | undefined) => Promise<CustomerList[]>;
|
|
2482
|
-
get: (marketId: string, listId: string) => Promise<CustomerList>;
|
|
2483
|
-
getBySlug: (marketId: string, slug: string) => Promise<CustomerList>;
|
|
2484
|
-
create: (marketId: string, payload: CreateCustomerListPayload) => Promise<CustomerList>;
|
|
2485
|
-
update: (marketId: string, listId: string, payload: UpdateCustomerListPayload) => Promise<CustomerList>;
|
|
2486
|
-
delete: (marketId: string, listId: string) => Promise<CustomerListDeleteResponse>;
|
|
2487
|
-
refresh: (marketId: string, listId: string) => Promise<CustomerListRefreshResponse>;
|
|
2488
|
-
getMembers: (marketId: string, listId: string, options?: CustomerListMembersOptions | undefined) => Promise<CustomerListMembersResponse>;
|
|
2489
|
-
getAllMembers: (marketId: string, listId: string, options?: Omit<CustomerListMembersOptions, "offset"> | undefined) => Promise<CustomerListMember[]>;
|
|
2490
|
-
addMembers: (marketId: string, listId: string, customerIds: string[]) => Promise<CustomerListAddMembersResponse>;
|
|
2491
|
-
removeMember: (marketId: string, listId: string, customerId: string) => Promise<CustomerListRemoveMemberResponse>;
|
|
2492
|
-
preview: (marketId: string, filters: CustomerListFilters) => Promise<CustomerListPreviewResponse>;
|
|
2493
|
-
listProductCodes: (marketId: string) => Promise<CustomerListProductCodesResponse>;
|
|
2494
|
-
view: (marketId: string, listIdOrSlug: string, options?: CustomerListViewOptions | undefined) => Promise<CustomerListViewResult>;
|
|
2495
|
-
};
|
|
2496
|
-
invoices: {
|
|
2497
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<InvoicesListResponse>;
|
|
2498
|
-
get: (marketId: string, invoiceId: string, options?: ReadOptions | undefined) => Promise<Invoice>;
|
|
2499
|
-
};
|
|
2500
|
-
payments: {
|
|
2501
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<PaymentsListResponse>;
|
|
2502
|
-
get: (marketId: string, paymentId: string) => Promise<Payment>;
|
|
2503
|
-
};
|
|
2504
|
-
payouts: {
|
|
2505
|
-
list: (marketId: string, lastId?: string | null | undefined) => Promise<PayoutsListResponse>;
|
|
2506
|
-
get: (marketId: string, payoutId: string) => Promise<Payout>;
|
|
2507
|
-
create: (marketId: string, data: CreatePayoutRequest) => Promise<PayoutCreateResponse>;
|
|
2508
|
-
};
|
|
2509
|
-
search: {
|
|
2510
|
-
query: (marketId: string, query: string) => Promise<SearchResult>;
|
|
2511
|
-
};
|
|
2512
|
-
files: {
|
|
2513
|
-
uploadSingleFile: (input: SingleFileInput, token: string) => Promise<{
|
|
2514
|
-
message: string;
|
|
2515
|
-
data: Media;
|
|
2516
|
-
}>;
|
|
2517
|
-
uploadMultipartFile: (input: FileInput | ChunkedInput, token: string) => Promise<{
|
|
2518
|
-
message: string;
|
|
2519
|
-
mediaType: string;
|
|
2520
|
-
process: VariantProcessingState;
|
|
2521
|
-
}>;
|
|
2522
|
-
deleteFile: (fileUrl: string, token: string) => Promise<{
|
|
2523
|
-
data: boolean;
|
|
2524
|
-
}>;
|
|
2525
|
-
};
|
|
2526
|
-
contacts: {
|
|
2527
|
-
list: (marketId: string, customerId: string, params?: {
|
|
2528
|
-
lastId?: string | undefined;
|
|
2529
|
-
limit?: number | undefined;
|
|
2530
|
-
} | undefined) => Promise<ListContactsResponse>;
|
|
2531
|
-
get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
|
|
2532
|
-
create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
|
|
2533
|
-
update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
|
|
2534
|
-
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
2535
|
-
};
|
|
2536
|
-
ledger: {
|
|
2537
|
-
getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
|
|
2538
|
-
getTransaction: (marketId: string, transactionId: string) => Promise<LedgerTransaction>;
|
|
2539
|
-
getLatestTransaction: (marketId: string, account: string) => Promise<LedgerTransaction>;
|
|
2540
|
-
listTransactions: (marketId: string, params: ListTransactionsParams) => Promise<TransactionsListResponse>;
|
|
2541
|
-
};
|
|
2542
|
-
sms: {
|
|
2543
|
-
sendSMS: (marketId: string, data: SendSMSPayload) => Promise<SMSTask>;
|
|
2544
|
-
getSMS: (marketId: string, smsId: string) => Promise<SMSTask>;
|
|
2545
|
-
};
|
|
2546
|
-
};
|
|
2547
|
-
|
|
2548
|
-
/**
|
|
2549
|
-
* Headers used by Studio to identify webhook and action requests
|
|
2550
|
-
*/
|
|
2551
|
-
declare const StudioHeaders: {
|
|
2552
|
-
marketId: string;
|
|
2553
|
-
webhookId: string;
|
|
2554
|
-
action: string;
|
|
2555
|
-
apiKey: string;
|
|
2556
|
-
signature: string;
|
|
2557
|
-
};
|
|
2558
|
-
interface StudioManifest {
|
|
2559
|
-
id: string;
|
|
2560
|
-
name: string;
|
|
2561
|
-
version: string;
|
|
2562
|
-
description: string;
|
|
2563
|
-
icon: string;
|
|
2564
|
-
author: string;
|
|
2565
|
-
actions: {
|
|
2566
|
-
name: string;
|
|
2567
|
-
url: string;
|
|
2568
|
-
}[];
|
|
2569
|
-
webhooks: {
|
|
2570
|
-
url: string;
|
|
2571
|
-
triggers: WebhookEventName[];
|
|
2572
|
-
}[];
|
|
2573
|
-
parameterConfig: {
|
|
2574
|
-
id: string;
|
|
2575
|
-
type: "string" | "number" | "boolean" | "string[]" | "password";
|
|
2576
|
-
label: string;
|
|
2577
|
-
description?: string;
|
|
2578
|
-
required?: boolean;
|
|
2579
|
-
defaultValue?: string | number | boolean | string[];
|
|
2580
|
-
}[];
|
|
2581
|
-
}
|
|
2582
|
-
/***
|
|
2583
|
-
* Creates an app manifest used to describe the app to Studio
|
|
2584
|
-
*
|
|
2585
|
-
* @param appConfig
|
|
2586
|
-
* @returns
|
|
2587
|
-
*/
|
|
2588
|
-
declare function createAppManifest(appConfig: {
|
|
2589
|
-
id: string;
|
|
2590
|
-
name: string;
|
|
2591
|
-
version: string;
|
|
2592
|
-
description: string;
|
|
2593
|
-
icon: string;
|
|
2594
|
-
author: string;
|
|
2595
|
-
}): {
|
|
2596
|
-
addWebhook: (url: string, triggers: WebhookEventName[]) => void;
|
|
2597
|
-
addConfig: (config: {
|
|
2598
|
-
id: string;
|
|
2599
|
-
type: "string" | "number" | "boolean" | "string[]" | "password";
|
|
2600
|
-
label: string;
|
|
2601
|
-
description?: string;
|
|
2602
|
-
required?: boolean;
|
|
2603
|
-
defaultValue?: string | number | boolean | string[];
|
|
2604
|
-
}) => void;
|
|
2605
|
-
addAction: (action: {
|
|
2606
|
-
name: string;
|
|
2607
|
-
url: string;
|
|
2608
|
-
}) => void;
|
|
2609
|
-
readonly manifest: StudioManifest;
|
|
2610
|
-
};
|
|
2611
|
-
|
|
2612
|
-
type CountryCode = keyof typeof EarTag.countryCodes;
|
|
2613
|
-
declare class EarTag {
|
|
2614
|
-
static regexISO24631: RegExp;
|
|
2615
|
-
static countryCodes: {
|
|
2616
|
-
[key: string]: string;
|
|
2617
|
-
};
|
|
2618
|
-
static get countryCodesByNumber(): {
|
|
2619
|
-
[code: string]: CountryCode;
|
|
2620
|
-
};
|
|
2621
|
-
private normalisedCountryCode;
|
|
2622
|
-
private _raw;
|
|
2623
|
-
get raw(): string;
|
|
2624
|
-
private _isEartag;
|
|
2625
|
-
isEartag(): boolean;
|
|
2626
|
-
private _isoCountryCode?;
|
|
2627
|
-
get isoCountryCode(): string | undefined;
|
|
2628
|
-
private _nationalIdentifier?;
|
|
2629
|
-
get nationalIdentifier(): string | undefined;
|
|
2630
|
-
constructor(input: string, fallbackCountryCode?: CountryCode | string | null);
|
|
2631
|
-
static parse(str: string, fallbackCountryCode?: CountryCode | string | null): EarTag;
|
|
2632
|
-
static format(str: string, marketCountry?: string | null | undefined): string | null;
|
|
2633
|
-
toString(): string;
|
|
2634
|
-
isISO24631(): boolean;
|
|
2635
|
-
toISO24631(): string;
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
|
-
/**
|
|
2639
|
-
* Parses the bottom barcode on a UK cattle passport.
|
|
2640
|
-
*
|
|
2641
|
-
* The barcode is a 30-character fixed-width positional format:
|
|
2642
|
-
* [0-13] Eartag — 2 alpha country code + 12 char national ID (space-padded for shorter foreign tags)
|
|
2643
|
-
* [14-21] Date of birth — ddMMyyyy
|
|
2644
|
-
* [22] Sex — F or M
|
|
2645
|
-
* [23-27] Breed code — left-justified, space-padded to 5 chars
|
|
2646
|
-
* [28-29] Passport version — 2 digits
|
|
2647
|
-
*
|
|
2648
|
-
* UK animals fill all 12 digits of the national ID. Imported animals (DE, FR, BE, etc.)
|
|
2649
|
-
* have shorter national IDs so the field is right-padded with spaces.
|
|
2650
|
-
*
|
|
2651
|
-
* Examples:
|
|
2652
|
-
* UK12345671004215032023MHER 01 ← UK tag, breed HER
|
|
2653
|
-
* UK98765430018722112022FLIMX 01 ← UK tag, breed LIMX
|
|
2654
|
-
* DE04821 9315614092018FHF 01 ← German import, 10-digit national ID
|
|
2655
|
-
* FR72341 6850203052020FHF 01 ← French import, 10-digit national ID
|
|
2656
|
-
*/
|
|
2657
|
-
declare class CattlePassport {
|
|
2658
|
-
static BARCODE_MIN_LENGTH: number;
|
|
2659
|
-
static BARCODE_MAX_LENGTH: number;
|
|
2660
|
-
private _raw;
|
|
2661
|
-
private _earTag;
|
|
2662
|
-
private _dateOfBirth;
|
|
2663
|
-
private _sex;
|
|
2664
|
-
private _breed;
|
|
2665
|
-
private _passportVersion;
|
|
2666
|
-
private constructor();
|
|
2667
|
-
static parse(code: string): CattlePassport | null;
|
|
2668
|
-
/** The original raw barcode string */
|
|
2669
|
-
get raw(): string;
|
|
2670
|
-
/** The eartag extracted from the barcode, e.g. "UK705946601313" or "DE0359581730" */
|
|
2671
|
-
get earTag(): string;
|
|
2672
|
-
/** Date of birth (UTC) */
|
|
2673
|
-
get dateOfBirth(): Date;
|
|
2674
|
-
/** Male or Female */
|
|
2675
|
-
get sex(): "Male" | "Female";
|
|
2676
|
-
/** Breed code, e.g. "AA", "HF", "LIMX" */
|
|
2677
|
-
get breed(): string;
|
|
2678
|
-
/** Passport version number */
|
|
2679
|
-
get passportVersion(): number;
|
|
2680
|
-
/** 2-letter country code, e.g. "UK", "DE", "FR" */
|
|
2681
|
-
get countryCode(): string;
|
|
2682
|
-
/** Format the eartag via the EarTag class. Falls back to the raw tag string. */
|
|
2683
|
-
get formattedEarTag(): string;
|
|
2684
|
-
/** Date of birth as DD/MM/YYYY */
|
|
2685
|
-
get formattedDateOfBirth(): string;
|
|
2686
|
-
toString(): string;
|
|
2687
|
-
}
|
|
2688
|
-
|
|
2689
|
-
declare function lotComparator<T extends {
|
|
2690
|
-
lotNumber: string;
|
|
2691
|
-
}>(a: T, b: T): number;
|
|
2692
|
-
declare function sortByLotNumber<T extends {
|
|
2693
|
-
lotNumber: string;
|
|
2694
|
-
}>(lots: T[]): T[];
|
|
2695
|
-
/***
|
|
2696
|
-
* Generate the next lot number in a sequence.
|
|
2697
|
-
* Handles various formats:
|
|
2698
|
-
* - Simple: "7" -> "8"
|
|
2699
|
-
* - Alphanumeric: "7A" -> "7B"
|
|
2700
|
-
* - Range: "1-3" -> "4", "1 - 3" -> "4" (flexible whitespace)
|
|
2701
|
-
* - Range with alpha: "1-3A" -> "3B"
|
|
2702
|
-
* - Compound: "1-3, 10" -> "11", "1-5, 7-9" -> "10"
|
|
2703
|
-
*/
|
|
2704
|
-
declare function nextLotNumber(previousLotNumber: string): string;
|
|
2705
|
-
|
|
2706
|
-
export { CattlePassport, type ChunkedFile, type CreateCustomerListPayload, type CreateCustomerPayload, type CustomerList, type CustomerListAddMembersResponse, type CustomerListDeleteResponse, type CustomerListFilterGroup, type CustomerListFilters, type CustomerListMember, type CustomerListMembersOptions, type CustomerListMembersResponse, type CustomerListPreviewResponse, type CustomerListProductCodesResponse, type CustomerListQuery, type CustomerListRefreshResponse, type CustomerListRemoveMemberResponse, type CustomerListReportRow, type CustomerListReportSummary, type CustomerListRole, type CustomerListType, type CustomerListViewOptions, type CustomerListViewResult, type CustomerListsListOptions, type CustomerListsListResponse, EarTag, type FarmAssuranceUpdate, type KeeperDetailsUpdate, type RollingDateConfig, Studio, StudioHeaders, type StudioInstance, type StudioManifest, types as StudioTypes, type UpdateCustomerListPayload, type UpdateCustomerPayload, createAppManifest, Studio as default, lotComparator, nextLotNumber, sortByLotNumber };
|
|
1
|
+
import { Studio } from "./studio";
|
|
2
|
+
export * from "./createApp";
|
|
3
|
+
export { Studio };
|
|
4
|
+
export default Studio;
|
|
5
|
+
import * as StudioTypes from "./types";
|
|
6
|
+
export { StudioTypes };
|
|
7
|
+
export type { StudioInstance } from "./studio";
|
|
8
|
+
export type { ChunkedFile } from "./utils/multipart-upload";
|
|
9
|
+
export { default as EarTag } from "./utils/eartag";
|
|
10
|
+
export { default as CattlePassport } from "./utils/cattlePassport";
|
|
11
|
+
export { lotComparator, nextLotNumber, sortByLotNumber } from "./utils/lots";
|
|
12
|
+
export type { CreateCustomerPayload, UpdateCustomerPayload, KeeperDetailsUpdate, FarmAssuranceUpdate, } from "./resources/customers";
|
|
13
|
+
export type { CustomerList, CustomerListQuery, RollingDateConfig, CustomerListMember, CustomerListFilters, CustomerListReportRow, CustomerListReportSummary, CustomerListViewResult, CustomerListType, CustomerListRole, CustomerListFilterGroup, CustomerListsListOptions, CustomerListMembersOptions, CustomerListViewOptions, CustomerListsListResponse, CustomerListMembersResponse, CustomerListPreviewResponse, CustomerListProductCodesResponse, CustomerListAddMembersResponse, CustomerListRemoveMemberResponse, CustomerListDeleteResponse, CustomerListRefreshResponse, CreateCustomerListPayload, UpdateCustomerListPayload, } from "./resources/customerLists";
|