@marteye/studiojs 1.1.36 → 1.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,17 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ declare function SimpleHttpClient(baseUrl: string, apiKey: string, fetch: any, defaultTimeout: number, debug?: boolean): {
4
+ get: <T>(path: string, queryParams?: any) => Promise<T>;
5
+ post: <T>(path: string, body: any) => Promise<T>;
6
+ patch: <T>(path: string, body: any) => Promise<T>;
7
+ delete: <T>(path: string) => Promise<T>;
8
+ };
9
+ type HttpClient = ReturnType<typeof SimpleHttpClient>;
10
+
11
+ interface LedgerBalanceResponse {
12
+ balanceInCents: number;
13
+ }
14
+
3
15
  type Timestamp = string;
4
16
  type ClientType = "Seller" | "Buyer";
5
17
  type SuperType = "Sheep" | "Goats" | "Cattle" | "Pigs" | "Horses" | "Deer" | "Poultry" | "Machinery" | "Antiques" | "Other";
@@ -12,6 +24,7 @@ type CurrenciesWithGuinea = Currency | "GUINEA-GBP";
12
24
  type UnitOfSale = "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
13
25
  declare const SupportedUnitsOfSale: UnitOfSale[];
14
26
  type PaymentMethod = "BACS" | "Cheque" | "BankTransfer" | "Cash" | "Card" | "Credit";
27
+ type InvoiceDeliveryPreference = "email" | "printed" | "both";
15
28
  type PayoutMethod = "BACS" | "Cheque" | "Cash";
16
29
  declare const SupportedPaymentMethods: PaymentMethod[];
17
30
  interface Market {
@@ -46,6 +59,8 @@ interface SettingsMarketDefaults {
46
59
  defaultPayoutPreference: PayoutMethod;
47
60
  defaultUnitOfSale: UnitOfSale;
48
61
  defaultSuperType?: SuperType | null;
62
+ defaultSettleDebtsFirst?: boolean;
63
+ liveEmailsEnabled?: boolean;
49
64
  lotDescriptionTemplateMap?: {
50
65
  default: string | undefined;
51
66
  [supertype: string]: string | undefined;
@@ -109,6 +124,7 @@ type DisplayBoardMode = "off" | "live" | "manual" | {
109
124
  type: "focused";
110
125
  field: string;
111
126
  };
127
+ type SalePublishStatus = "unpublished" | "sale" | "catalogPublished";
112
128
  interface Sale {
113
129
  id: string;
114
130
  createdAt: Timestamp;
@@ -176,6 +192,47 @@ interface Sale {
176
192
  };
177
193
  };
178
194
  editedBy?: string[];
195
+ /**
196
+ * Publishing status for external systems
197
+ * - unpublished: Not listed in external system
198
+ * - sale: Sale date is listed externally
199
+ * - catalogPublished: Sale and catalog information synced
200
+ */
201
+ publishStatus?: SalePublishStatus;
202
+ }
203
+ interface TemplateSaleData {
204
+ name?: string;
205
+ description?: string | null;
206
+ image?: string | null;
207
+ location?: string | null;
208
+ martEyeSaleType?: "LIVE" | "TIMED" | null;
209
+ cover?: string | null;
210
+ availableProductCodes: string[];
211
+ attributeDefaults?: {
212
+ [attributekey: string]: AttributeValueType;
213
+ };
214
+ marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
215
+ }
216
+ interface SaleTemplate {
217
+ id: string;
218
+ marketId: string;
219
+ name: string;
220
+ description?: string | null;
221
+ sourceSaleId?: string;
222
+ createdAt: Timestamp;
223
+ updatedAt: Timestamp;
224
+ createdBy: string;
225
+ saleData: TemplateSaleData;
226
+ lotGridConfigs?: {
227
+ [configId: string]: StoredDataGridConfig;
228
+ };
229
+ }
230
+ interface StoredDataGridConfig {
231
+ widths?: {
232
+ [key: string]: number;
233
+ };
234
+ hiddenColumnIds: string[];
235
+ columnOrder: string[];
179
236
  }
180
237
  interface MartEyeLiveSaleSettings {
181
238
  description?: string;
@@ -361,6 +418,34 @@ interface LotItem {
361
418
  [key: string]: string | number | boolean | Timestamp | Media;
362
419
  };
363
420
  }
421
+ /***
422
+ * A market may offer other products and services. This is a way to track those.
423
+ * They simply create a line item on the invoice
424
+ *
425
+ * /settings/products
426
+ */
427
+ interface Product {
428
+ id: string;
429
+ createdAt: Timestamp;
430
+ updatedAt: Timestamp;
431
+ marketId: string;
432
+ name: string;
433
+ taxRateId: string;
434
+ defaultUnitPriceInCents: number;
435
+ unitPriceIncludesVat?: boolean;
436
+ applyToClients: ClientType[];
437
+ subtotalGroup?: SubtotalGroups | null | undefined;
438
+ passThroughFundsToAnotherCustomer?: boolean;
439
+ isEnabled?: boolean;
440
+ relatedTo?: {
441
+ lotId: string;
442
+ saleId: string;
443
+ } | null;
444
+ obfusicate?: boolean;
445
+ metadata: {
446
+ [key: string]: string | number | boolean | Timestamp | Media;
447
+ };
448
+ }
364
449
  /***
365
450
  * When a product is added to a cart it becomes a CartProductItem
366
451
  *
@@ -423,54 +508,6 @@ interface ProductCodeConfiguration {
423
508
  interface ProductConfiguration {
424
509
  [id: string]: Product;
425
510
  }
426
- /***
427
- * A market may offer other products and services. This is a way to track those.
428
- * They simply create a line item on the invoice
429
- *
430
- * /settings/products
431
- */
432
- interface Product {
433
- id: string;
434
- createdAt: Timestamp;
435
- updatedAt: Timestamp;
436
- marketId: string;
437
- name: string;
438
- taxRateId: string;
439
- defaultUnitPriceInCents: number;
440
- unitPriceIncludesVat?: boolean;
441
- applyToClients: ClientType[];
442
- subtotalGroup?: SubtotalGroups | null | undefined;
443
- passThroughFundsToAnotherCustomer?: boolean;
444
- isEnabled?: boolean;
445
- metadata: {
446
- [key: string]: string | number | boolean | Timestamp | Media;
447
- };
448
- }
449
- /***
450
- * A market may offer other products and services. This is a way to track those.
451
- * They simply create a line item on the invoice
452
- */
453
- interface Product {
454
- id: string;
455
- createdAt: Timestamp;
456
- updatedAt: Timestamp;
457
- marketId: string;
458
- name: string;
459
- taxRateId: string;
460
- defaultUnitPriceInCents: number;
461
- unitPriceIncludesVat?: boolean;
462
- applyToClients: ClientType[];
463
- subtotalGroup?: SubtotalGroups | null | undefined;
464
- passThroughFundsToAnotherCustomer?: boolean;
465
- relatedTo?: {
466
- lotId: string;
467
- saleId: string;
468
- } | null;
469
- obfusicate?: boolean;
470
- metadata: {
471
- [key: string]: string | number | boolean | Timestamp | Media;
472
- };
473
- }
474
511
  interface Cart {
475
512
  customerId: string;
476
513
  updatedAt: Timestamp;
@@ -513,6 +550,37 @@ type BankDetails = {
513
550
  accountNumber?: never;
514
551
  sortCode?: never;
515
552
  });
553
+ type CustomerBankDetails = BankDetails & {
554
+ id?: string;
555
+ createdAt?: Timestamp;
556
+ updatedAt?: Timestamp;
557
+ updatedBy?: string | null;
558
+ };
559
+ interface CustomerContact {
560
+ id: string;
561
+ createdAt: Timestamp;
562
+ updatedAt: Timestamp;
563
+ updatedBy?: string | null;
564
+ marketId: string;
565
+ displayName: string;
566
+ email?: string | null;
567
+ phoneNumber?: string | null;
568
+ /** @deprecated */
569
+ landlineNumber?: string | null;
570
+ /** @deprecated */
571
+ address?: Address;
572
+ isPrimary?: boolean;
573
+ isActive?: boolean;
574
+ isDeleted?: boolean;
575
+ isVerified?: boolean;
576
+ accountEmails?: boolean;
577
+ marketingEmails?: boolean;
578
+ marteyeUid?: string | null;
579
+ notes?: string | null;
580
+ metadata?: {
581
+ [key: string]: string | number | boolean | Timestamp | Media;
582
+ };
583
+ }
516
584
  /**
517
585
  * Used to store the bank details for a market
518
586
  */
@@ -538,19 +606,25 @@ interface Customer {
538
606
  isMarketAccount?: boolean;
539
607
  accountNumber?: string;
540
608
  bidderNumber?: number | null;
609
+ displayName?: string | null;
541
610
  firstName?: string | null;
542
611
  lastName?: string | null;
543
612
  tradingName?: string | null;
544
613
  email?: EmailWrapper;
545
614
  phoneNumber?: PhoneNumberWrapper;
615
+ /** @deprecated */
546
616
  otherPhoneNumbers?: PhoneNumberWrapper[];
547
617
  address: AddressWrapper;
618
+ /** @deprecated */
548
619
  otherAddresses: {
549
620
  [addressId: string]: AddressWrapper;
550
621
  };
551
622
  photoURL?: string | null;
552
623
  payoutPreference?: PayoutMethod;
553
- bankDetails?: BankDetails;
624
+ invoiceDeliveryPreference?: InvoiceDeliveryPreference;
625
+ statementDeliveryPreference?: InvoiceDeliveryPreference;
626
+ bankDetails?: CustomerBankDetails | CustomerBankDetails[] | null;
627
+ contacts?: CustomerContact[];
554
628
  attributeDefaultsBuyer?: {
555
629
  [attributekey: string]: AttributeValueType[];
556
630
  };
@@ -567,6 +641,8 @@ interface Customer {
567
641
  hasPurchasedItems?: boolean;
568
642
  hasSoldItems?: boolean;
569
643
  notes?: string;
644
+ status?: "archived" | "deleted" | null;
645
+ deleteAfter?: Timestamp;
570
646
  }
571
647
  interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" | "lastItemPurchaseDate" | "lastItemSaleDate"> {
572
648
  createdAt: number;
@@ -738,6 +814,10 @@ interface Payment {
738
814
  voidedBy?: string | null;
739
815
  voidReason?: string | null;
740
816
  invoiceIds: string[];
817
+ invoices?: Array<{
818
+ id: string;
819
+ amountAppliedInCents?: number;
820
+ }>;
741
821
  transactionIds: string[];
742
822
  }
743
823
  interface Payout {
@@ -749,6 +829,10 @@ interface Payout {
749
829
  customerId: string;
750
830
  method: PayoutMethod | "Credit";
751
831
  amountInCents: number;
832
+ invoices?: Array<{
833
+ id: string;
834
+ amountAppliedInCents?: number;
835
+ }>;
752
836
  accountName?: string;
753
837
  accountNumber?: string;
754
838
  sortCode?: string;
@@ -906,6 +990,10 @@ interface Printer {
906
990
  */
907
991
  name: string;
908
992
  friendlyName: string;
993
+ /**
994
+ * Optional single IPP URI if linked by IP discovery
995
+ */
996
+ uri?: string;
909
997
  chequePrinter?: boolean;
910
998
  /**
911
999
  * The next cheque number to use when printing a cheque
@@ -1024,6 +1112,23 @@ type AppParameterConfig = {
1024
1112
  required?: boolean;
1025
1113
  defaultValue?: string | number | boolean | string[];
1026
1114
  };
1115
+ interface CphLookupResponse {
1116
+ cph: string;
1117
+ county: string;
1118
+ parish: string;
1119
+ holding: string;
1120
+ subLocation?: string;
1121
+ country: string;
1122
+ region: string | null;
1123
+ spatialUnit: string | null;
1124
+ office: string | null;
1125
+ ahdoNumber: string | null;
1126
+ parishName: string;
1127
+ tbTestingInterval: string | null;
1128
+ tbArea: string | null;
1129
+ cphValid?: boolean | null;
1130
+ farmName?: string | null;
1131
+ }
1027
1132
 
1028
1133
  type types_Accessory = Accessory;
1029
1134
  type types_Address = Address;
@@ -1040,9 +1145,12 @@ type types_Cart = Cart;
1040
1145
  type types_CartItem = CartItem;
1041
1146
  type types_ChequeField = ChequeField;
1042
1147
  type types_ClientType = ClientType;
1148
+ type types_CphLookupResponse = CphLookupResponse;
1043
1149
  type types_CurrenciesWithGuinea = CurrenciesWithGuinea;
1044
1150
  type types_Currency = Currency;
1045
1151
  type types_Customer = Customer;
1152
+ type types_CustomerBankDetails = CustomerBankDetails;
1153
+ type types_CustomerContact = CustomerContact;
1046
1154
  type types_CustomerFromSearch = CustomerFromSearch;
1047
1155
  type types_DeviceType = DeviceType;
1048
1156
  type types_DisplayBoardMode = DisplayBoardMode;
@@ -1055,6 +1163,7 @@ type types_ImageSizes = ImageSizes;
1055
1163
  type types_IncrementLadder = IncrementLadder;
1056
1164
  type types_IncrementLadderItem = IncrementLadderItem;
1057
1165
  type types_Invoice = Invoice;
1166
+ type types_InvoiceDeliveryPreference = InvoiceDeliveryPreference;
1058
1167
  type types_InvoiceField = InvoiceField;
1059
1168
  type types_InvoiceLineItem = InvoiceLineItem;
1060
1169
  type types_InvoiceTotalAdjustmentConfiguration = InvoiceTotalAdjustmentConfiguration;
@@ -1086,6 +1195,8 @@ type types_ProductCodeConfiguration = ProductCodeConfiguration;
1086
1195
  type types_ProductConfiguration = ProductConfiguration;
1087
1196
  type types_Sale = Sale;
1088
1197
  type types_SaleFromSearch = SaleFromSearch;
1198
+ type types_SalePublishStatus = SalePublishStatus;
1199
+ type types_SaleTemplate = SaleTemplate;
1089
1200
  type types_SettingsAccessories = SettingsAccessories;
1090
1201
  type types_SettingsAdjustmentsConfiguration = SettingsAdjustmentsConfiguration;
1091
1202
  type types_SettingsGlobalAttributes = SettingsGlobalAttributes;
@@ -1096,6 +1207,7 @@ type types_SettingsTaxRates = SettingsTaxRates;
1096
1207
  type types_ShortCustomerDetails = ShortCustomerDetails;
1097
1208
  type types_SimplePaymentIn = SimplePaymentIn;
1098
1209
  type types_SimplePaymentOut = SimplePaymentOut;
1210
+ type types_StoredDataGridConfig = StoredDataGridConfig;
1099
1211
  type types_StudioAppPartial = StudioAppPartial;
1100
1212
  type types_SubtotalGroups = SubtotalGroups;
1101
1213
  type types_SuperType = SuperType;
@@ -1107,6 +1219,7 @@ declare const types_SupportedSuperTypes: typeof SupportedSuperTypes;
1107
1219
  declare const types_SupportedUnitsOfSale: typeof SupportedUnitsOfSale;
1108
1220
  type types_TablePosition = TablePosition;
1109
1221
  type types_TaxRate = TaxRate;
1222
+ type types_TemplateSaleData = TemplateSaleData;
1110
1223
  type types_UnitOfSale = UnitOfSale;
1111
1224
  declare const types_VIDEO_TASKS_VALUES: typeof VIDEO_TASKS_VALUES;
1112
1225
  type types_VideoTasks = VideoTasks;
@@ -1115,7 +1228,23 @@ type types_WebhookEventName = WebhookEventName;
1115
1228
  declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
1116
1229
  declare namespace types {
1117
1230
  export { types_IMAGE_SIZES_VALUES as IMAGE_SIZES_VALUES, types_LivestockSuperTypes as LivestockSuperTypes, types_SupportedCurrencyCodes as SupportedCurrencyCodes, types_SupportedPaymentMethods as SupportedPaymentMethods, types_SupportedSuperTypes as SupportedSuperTypes, types_SupportedUnitsOfSale as SupportedUnitsOfSale, types_VIDEO_TASKS_VALUES as VIDEO_TASKS_VALUES, types_supportedWebhookEvents as supportedWebhookEvents };
1118
- export type { types_Accessory as Accessory, types_Address as Address, types_AddressWrapper as AddressWrapper, types_AdjustmentTarget as AdjustmentTarget, types_AdjustmentTotalTarget as AdjustmentTotalTarget, types_AdjustmentsConfiguration as AdjustmentsConfiguration, types_AppParameterConfig as AppParameterConfig, types_Application as Application, types_AttributeDefinition as AttributeDefinition, types_AttributeValueType as AttributeValueType, types_BankDetails as BankDetails, types_Cart as Cart, types_CartItem as CartItem, types_ChequeField as ChequeField, types_ClientType as ClientType, types_CurrenciesWithGuinea as CurrenciesWithGuinea, types_Currency as Currency, types_Customer as Customer, types_CustomerFromSearch as CustomerFromSearch, types_DeviceType as DeviceType, types_DisplayBoardMode as DisplayBoardMode, types_DraftInvoice as DraftInvoice, types_EmailWrapper as EmailWrapper, types_FarmAssurances as FarmAssurances, types_FieldPositions as FieldPositions, types_ImageSizes as ImageSizes, types_IncrementLadder as IncrementLadder, types_IncrementLadderItem as IncrementLadderItem, types_Invoice as Invoice, types_InvoiceField as InvoiceField, types_InvoiceLineItem as InvoiceLineItem, types_InvoiceTotalAdjustmentConfiguration as InvoiceTotalAdjustmentConfiguration, types_InvoiceTotals as InvoiceTotals, types_LineItemAdjustmentConfiguration as LineItemAdjustmentConfiguration, types_Lot as Lot, types_LotGeneratedValues as LotGeneratedValues, types_LotIssue as LotIssue, types_LotItem as LotItem, types_LotSaleStatus as LotSaleStatus, types_LotWithItemsAsArray as LotWithItemsAsArray, types_Market as Market, types_MarketBankDetails as MarketBankDetails, types_MarketReportHeaders as MarketReportHeaders, types_MartEyeLiveSaleSettings as MartEyeLiveSaleSettings, types_MartEyeTimedSaleSettings as MartEyeTimedSaleSettings, types_Media as Media, types_MemberSharingConfiguration as MemberSharingConfiguration, types_ObjectType as ObjectType, types_Payment as Payment, types_PaymentMethod as PaymentMethod, types_Payout as Payout, types_PayoutMethod as PayoutMethod, types_PhoneNumberWrapper as PhoneNumberWrapper, types_Printer as Printer, types_Product as Product, types_ProductCodeConfiguration as ProductCodeConfiguration, types_ProductConfiguration as ProductConfiguration, types_Sale as Sale, types_SaleFromSearch as SaleFromSearch, types_SettingsAccessories as SettingsAccessories, types_SettingsAdjustmentsConfiguration as SettingsAdjustmentsConfiguration, types_SettingsGlobalAttributes as SettingsGlobalAttributes, types_SettingsMarketDefaults as SettingsMarketDefaults, types_SettingsPrinters as SettingsPrinters, types_SettingsProductCodes as SettingsProductCodes, types_SettingsTaxRates as SettingsTaxRates, types_ShortCustomerDetails as ShortCustomerDetails, types_SimplePaymentIn as SimplePaymentIn, types_SimplePaymentOut as SimplePaymentOut, types_StudioAppPartial as StudioAppPartial, types_SubtotalGroups as SubtotalGroups, types_SuperType as SuperType, types_SupportedAttributeTypes as SupportedAttributeTypes, types_SupportedCountryCode as SupportedCountryCode, SupportedFileTypesNames$1 as SupportedFileTypesNames, types_TablePosition as TablePosition, types_TaxRate as TaxRate, types_UnitOfSale as UnitOfSale, types_VideoTasks as VideoTasks, types_WebhookEvent as WebhookEvent, types_WebhookEventName as WebhookEventName };
1231
+ export type { types_Accessory as Accessory, types_Address as Address, types_AddressWrapper as AddressWrapper, types_AdjustmentTarget as AdjustmentTarget, types_AdjustmentTotalTarget as AdjustmentTotalTarget, types_AdjustmentsConfiguration as AdjustmentsConfiguration, types_AppParameterConfig as AppParameterConfig, types_Application as Application, types_AttributeDefinition as AttributeDefinition, types_AttributeValueType as AttributeValueType, types_BankDetails as BankDetails, types_Cart as Cart, types_CartItem as CartItem, types_ChequeField as ChequeField, types_ClientType as ClientType, types_CphLookupResponse as CphLookupResponse, types_CurrenciesWithGuinea as CurrenciesWithGuinea, types_Currency as Currency, types_Customer as Customer, types_CustomerBankDetails as CustomerBankDetails, types_CustomerContact as CustomerContact, types_CustomerFromSearch as CustomerFromSearch, types_DeviceType as DeviceType, types_DisplayBoardMode as DisplayBoardMode, types_DraftInvoice as DraftInvoice, types_EmailWrapper as EmailWrapper, types_FarmAssurances as FarmAssurances, types_FieldPositions as FieldPositions, types_ImageSizes as ImageSizes, types_IncrementLadder as IncrementLadder, types_IncrementLadderItem as IncrementLadderItem, types_Invoice as Invoice, types_InvoiceDeliveryPreference as InvoiceDeliveryPreference, types_InvoiceField as InvoiceField, types_InvoiceLineItem as InvoiceLineItem, types_InvoiceTotalAdjustmentConfiguration as InvoiceTotalAdjustmentConfiguration, types_InvoiceTotals as InvoiceTotals, types_LineItemAdjustmentConfiguration as LineItemAdjustmentConfiguration, types_Lot as Lot, types_LotGeneratedValues as LotGeneratedValues, types_LotIssue as LotIssue, types_LotItem as LotItem, types_LotSaleStatus as LotSaleStatus, types_LotWithItemsAsArray as LotWithItemsAsArray, types_Market as Market, types_MarketBankDetails as MarketBankDetails, types_MarketReportHeaders as MarketReportHeaders, types_MartEyeLiveSaleSettings as MartEyeLiveSaleSettings, types_MartEyeTimedSaleSettings as MartEyeTimedSaleSettings, types_Media as Media, types_MemberSharingConfiguration as MemberSharingConfiguration, types_ObjectType as ObjectType, types_Payment as Payment, types_PaymentMethod as PaymentMethod, types_Payout as Payout, types_PayoutMethod as PayoutMethod, types_PhoneNumberWrapper as PhoneNumberWrapper, types_Printer as Printer, types_Product as Product, types_ProductCodeConfiguration as ProductCodeConfiguration, types_ProductConfiguration as ProductConfiguration, types_Sale as Sale, types_SaleFromSearch as SaleFromSearch, types_SalePublishStatus as SalePublishStatus, types_SaleTemplate as SaleTemplate, types_SettingsAccessories as SettingsAccessories, types_SettingsAdjustmentsConfiguration as SettingsAdjustmentsConfiguration, types_SettingsGlobalAttributes as SettingsGlobalAttributes, types_SettingsMarketDefaults as SettingsMarketDefaults, types_SettingsPrinters as SettingsPrinters, types_SettingsProductCodes as SettingsProductCodes, types_SettingsTaxRates as SettingsTaxRates, types_ShortCustomerDetails as ShortCustomerDetails, types_SimplePaymentIn as SimplePaymentIn, types_SimplePaymentOut as SimplePaymentOut, types_StoredDataGridConfig as StoredDataGridConfig, types_StudioAppPartial as StudioAppPartial, types_SubtotalGroups as SubtotalGroups, types_SuperType as SuperType, types_SupportedAttributeTypes as SupportedAttributeTypes, types_SupportedCountryCode as SupportedCountryCode, SupportedFileTypesNames$1 as SupportedFileTypesNames, types_TablePosition as TablePosition, types_TaxRate as TaxRate, types_TemplateSaleData as TemplateSaleData, types_UnitOfSale as UnitOfSale, types_VideoTasks as VideoTasks, types_WebhookEvent as WebhookEvent, types_WebhookEventName as WebhookEventName };
1232
+ }
1233
+
1234
+ interface ListContactsResponse {
1235
+ contacts: CustomerContact[];
1236
+ lastId: string | null;
1237
+ hasMore: boolean;
1238
+ }
1239
+ interface CreateOrUpdateContactPayload {
1240
+ id?: string;
1241
+ displayName?: string | null;
1242
+ email?: string | null;
1243
+ phoneNumber?: string | null;
1244
+ notes?: string | null;
1245
+ marteyeUid?: string | null;
1246
+ accountEmails?: boolean;
1247
+ marketingEmails?: boolean;
1119
1248
  }
1120
1249
 
1121
1250
  declare const videoTaskSchema: z.ZodEnum<["compressed", "thumbnail"]>;
@@ -1212,13 +1341,6 @@ declare const uploadSingleFile: (input: SingleFileInput, token: string) => Promi
1212
1341
  data: Media;
1213
1342
  }>;
1214
1343
 
1215
- declare function SimpleHttpClient(baseUrl: string, apiKey: string, fetch: any, defaultTimeout: number, debug?: boolean): {
1216
- get: <T>(path: string, queryParams?: any) => Promise<T>;
1217
- post: <T>(path: string, body: any) => Promise<T>;
1218
- delete: <T>(path: string) => Promise<T>;
1219
- };
1220
- type HttpClient = ReturnType<typeof SimpleHttpClient>;
1221
-
1222
1344
  /**
1223
1345
  * Search result interface based on the API implementation
1224
1346
  */
@@ -1272,12 +1394,89 @@ interface CreateCustomerPayload {
1272
1394
  };
1273
1395
  marteyeUid?: string;
1274
1396
  }
1397
+ interface FarmAssuranceUpdate {
1398
+ number?: string | null;
1399
+ scheme?: string | null;
1400
+ expiry?: string | Date | null;
1401
+ }
1402
+ interface KeeperDetailsUpdate {
1403
+ herdNumber?: string | null;
1404
+ flockNumber?: string | null;
1405
+ cphNumber?: string | null;
1406
+ farmName?: string | null;
1407
+ slapMark?: string | null;
1408
+ farmAssurance?: {
1409
+ cattle?: FarmAssuranceUpdate | null;
1410
+ sheep?: FarmAssuranceUpdate | null;
1411
+ pigs?: FarmAssuranceUpdate | null;
1412
+ };
1413
+ vetAttestation?: {
1414
+ vanNumber?: string | null;
1415
+ expiry?: string | Date | null;
1416
+ } | null;
1417
+ movementReporting?: {
1418
+ fromOrigin?: boolean | null;
1419
+ toDestination?: boolean | null;
1420
+ } | null;
1421
+ }
1422
+ interface UpdateCustomerPayload {
1423
+ displayName?: string | null;
1424
+ email?: {
1425
+ email: string;
1426
+ isVerified?: boolean;
1427
+ createdAt?: string | Date;
1428
+ } | null;
1429
+ phoneNumber?: {
1430
+ phoneNumber: string;
1431
+ isVerified?: boolean;
1432
+ createdAt?: string | Date;
1433
+ } | null;
1434
+ address?: Customer["address"] | null;
1435
+ otherAddresses?: Customer["otherAddresses"] | null;
1436
+ otherPhoneNumbers?: Customer["otherPhoneNumbers"] | null;
1437
+ payoutPreference?: PayoutMethod | "none" | null;
1438
+ invoiceDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
1439
+ statementDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
1440
+ bankDetails?: Customer["bankDetails"] | null;
1441
+ preferSettleDebtsFirst?: boolean;
1442
+ vatNumber?: string | null;
1443
+ accountNumber?: string | null;
1444
+ notes?: string | null;
1445
+ attributeDefaultsBuyer?: Customer["attributeDefaultsBuyer"] | null;
1446
+ attributeDefaultsSeller?: Customer["attributeDefaultsSeller"] | null;
1447
+ metadata?: Customer["metadata"] | null;
1448
+ keeperDetails?: KeeperDetailsUpdate;
1449
+ }
1275
1450
  interface CustomersListResponse {
1276
1451
  customers: Customer[];
1277
1452
  lastId: string | null;
1278
1453
  hasMore: boolean;
1279
1454
  }
1280
1455
 
1456
+ interface CreateExtraPayload {
1457
+ id: string;
1458
+ name: string;
1459
+ taxRateId: string;
1460
+ defaultUnitPriceInCents?: number;
1461
+ unitPriceIncludesVat?: boolean;
1462
+ applyToClients?: ("Seller" | "Buyer")[];
1463
+ subtotalGroup?: string | null;
1464
+ passThroughFundsToAnotherCustomer?: boolean;
1465
+ isEnabled?: boolean;
1466
+ metadata?: Record<string, any>;
1467
+ }
1468
+ interface UpdateExtraPayload {
1469
+ name?: string;
1470
+ taxRateId?: string;
1471
+ defaultUnitPriceInCents?: number;
1472
+ unitPriceIncludesVat?: boolean;
1473
+ applyToClients?: ("Seller" | "Buyer")[];
1474
+ subtotalGroup?: string | null;
1475
+ passThroughFundsToAnotherCustomer?: boolean;
1476
+ isEnabled?: boolean;
1477
+ metadata?: Record<string, any>;
1478
+ }
1479
+
1281
1480
  interface CreateApplicationPayload {
1282
1481
  displayName: string;
1283
1482
  phoneNumber?: string;
@@ -1316,6 +1515,25 @@ interface ListApplicationsResponse {
1316
1515
  hasMore: boolean;
1317
1516
  }
1318
1517
 
1518
+ interface LotsBySale {
1519
+ saleId: string;
1520
+ marketId: string;
1521
+ lots: Lot[];
1522
+ }
1523
+ interface CartResponse {
1524
+ customerId: string;
1525
+ extras: CartItem[];
1526
+ lotsBuyingBySale: LotsBySale[];
1527
+ lotsSellingBySale: LotsBySale[];
1528
+ }
1529
+ interface AddExtraPayload {
1530
+ productId: string;
1531
+ clientType: "Seller" | "Buyer";
1532
+ quantity: number;
1533
+ unitPriceInCents: number;
1534
+ passthroughFundsToCustomerId?: string | null;
1535
+ }
1536
+
1319
1537
  declare function resources(httpClient: HttpClient): {
1320
1538
  markets: {
1321
1539
  get: (marketId: string) => Promise<Market>;
@@ -1340,6 +1558,7 @@ declare function resources(httpClient: HttpClient): {
1340
1558
  description?: string | null;
1341
1559
  image?: string | null;
1342
1560
  cover?: string | null;
1561
+ templateId?: string | null;
1343
1562
  attributeDefaults?: {
1344
1563
  [attributekey: string]: string | number | boolean;
1345
1564
  };
@@ -1352,6 +1571,7 @@ declare function resources(httpClient: HttpClient): {
1352
1571
  recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
1353
1572
  defaultProductCode?: string;
1354
1573
  attributeDefaults?: Record<string, any>;
1574
+ publishStatus?: SalePublishStatus;
1355
1575
  marteyeSettings?: {
1356
1576
  description?: string;
1357
1577
  image?: string;
@@ -1451,6 +1671,14 @@ declare function resources(httpClient: HttpClient): {
1451
1671
  }) => Promise<LotItem>;
1452
1672
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
1453
1673
  };
1674
+ carts: {
1675
+ get: (marketId: string, customerId: string) => Promise<CartResponse>;
1676
+ addExtra: (marketId: string, customerId: string, data: AddExtraPayload) => Promise<CartResponse>;
1677
+ removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
1678
+ };
1679
+ cph: {
1680
+ lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
1681
+ };
1454
1682
  webhooks: {
1455
1683
  constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
1456
1684
  };
@@ -1471,33 +1699,68 @@ declare function resources(httpClient: HttpClient): {
1471
1699
  adjustments: {
1472
1700
  list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
1473
1701
  get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
1702
+ create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1703
+ update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1704
+ };
1705
+ extras: {
1706
+ list: (marketId: string) => Promise<Product[]>;
1707
+ get: (marketId: string, id: string) => Promise<Product>;
1708
+ create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
1709
+ update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
1474
1710
  };
1475
1711
  productCodes: {
1476
1712
  list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
1477
1713
  get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
1714
+ create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1715
+ update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1716
+ };
1717
+ saleTemplates: {
1718
+ list: (marketId: string) => Promise<{
1719
+ templates: SaleTemplate[];
1720
+ }>;
1721
+ get: (marketId: string, templateId: string) => Promise<{
1722
+ template: SaleTemplate;
1723
+ }>;
1724
+ create: (marketId: string, body: {
1725
+ saleId: string;
1726
+ name: string;
1727
+ description?: string | null;
1728
+ }) => Promise<{
1729
+ templateId: string;
1730
+ }>;
1731
+ update: (marketId: string, templateId: string, body: {
1732
+ name?: string;
1733
+ description?: string | null;
1734
+ }) => Promise<{
1735
+ template: SaleTemplate;
1736
+ }>;
1737
+ delete: (marketId: string, templateId: string) => Promise<{
1738
+ success: boolean;
1739
+ }>;
1478
1740
  };
1479
1741
  taxRates: {
1480
1742
  list: (marketId: string) => Promise<TaxRate[]>;
1481
1743
  get: (marketId: string, id: string) => Promise<TaxRate>;
1482
1744
  };
1483
1745
  customers: {
1484
- list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
1746
+ list: (marketId: string, lastId?: string | null) => Promise<CustomersListResponse>;
1485
1747
  get: (marketId: string, customerId: string) => Promise<Customer>;
1486
1748
  avatar: (marketId: string, customerId: string) => Promise<Customer>;
1487
1749
  create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
1750
+ update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
1488
1751
  getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
1489
1752
  getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
1490
1753
  };
1491
1754
  invoices: {
1492
- list: (marketId: string, lastId?: string) => Promise<InvoicesListResponse>;
1755
+ list: (marketId: string, lastId?: string | null) => Promise<InvoicesListResponse>;
1493
1756
  get: (marketId: string, invoiceId: string) => Promise<Invoice>;
1494
1757
  };
1495
1758
  payments: {
1496
- list: (marketId: string, lastId?: string) => Promise<PaymentsListResponse>;
1759
+ list: (marketId: string, lastId?: string | null) => Promise<PaymentsListResponse>;
1497
1760
  get: (marketId: string, paymentId: string) => Promise<Payment>;
1498
1761
  };
1499
1762
  payouts: {
1500
- list: (marketId: string, lastId?: string) => Promise<PayoutsListResponse>;
1763
+ list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
1501
1764
  get: (marketId: string, payoutId: string) => Promise<Payout>;
1502
1765
  };
1503
1766
  search: {
@@ -1517,6 +1780,19 @@ declare function resources(httpClient: HttpClient): {
1517
1780
  data: boolean;
1518
1781
  }>;
1519
1782
  };
1783
+ contacts: {
1784
+ list: (marketId: string, customerId: string, params?: {
1785
+ lastId?: string;
1786
+ limit?: number;
1787
+ }) => Promise<ListContactsResponse>;
1788
+ get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
1789
+ create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
1790
+ update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
1791
+ delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
1792
+ };
1793
+ ledger: {
1794
+ getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
1795
+ };
1520
1796
  };
1521
1797
 
1522
1798
  type StudioInstance = ReturnType<typeof resources> & {
@@ -1552,6 +1828,7 @@ declare function Studio(info?: {
1552
1828
  description?: string | null;
1553
1829
  image?: string | null;
1554
1830
  cover?: string | null;
1831
+ templateId?: string | null;
1555
1832
  attributeDefaults?: {
1556
1833
  [attributekey: string]: string | number | boolean;
1557
1834
  };
@@ -1564,6 +1841,7 @@ declare function Studio(info?: {
1564
1841
  recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
1565
1842
  defaultProductCode?: string;
1566
1843
  attributeDefaults?: Record<string, any>;
1844
+ publishStatus?: SalePublishStatus;
1567
1845
  marteyeSettings?: {
1568
1846
  description?: string;
1569
1847
  image?: string;
@@ -1663,6 +1941,14 @@ declare function Studio(info?: {
1663
1941
  }) => Promise<LotItem>;
1664
1942
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
1665
1943
  };
1944
+ carts: {
1945
+ get: (marketId: string, customerId: string) => Promise<CartResponse>;
1946
+ addExtra: (marketId: string, customerId: string, data: AddExtraPayload) => Promise<CartResponse>;
1947
+ removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
1948
+ };
1949
+ cph: {
1950
+ lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
1951
+ };
1666
1952
  webhooks: {
1667
1953
  constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
1668
1954
  };
@@ -1683,33 +1969,68 @@ declare function Studio(info?: {
1683
1969
  adjustments: {
1684
1970
  list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
1685
1971
  get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
1972
+ create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1973
+ update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1974
+ };
1975
+ extras: {
1976
+ list: (marketId: string) => Promise<Product[]>;
1977
+ get: (marketId: string, id: string) => Promise<Product>;
1978
+ create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
1979
+ update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
1686
1980
  };
1687
1981
  productCodes: {
1688
1982
  list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
1689
1983
  get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
1984
+ create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1985
+ update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1986
+ };
1987
+ saleTemplates: {
1988
+ list: (marketId: string) => Promise<{
1989
+ templates: SaleTemplate[];
1990
+ }>;
1991
+ get: (marketId: string, templateId: string) => Promise<{
1992
+ template: SaleTemplate;
1993
+ }>;
1994
+ create: (marketId: string, body: {
1995
+ saleId: string;
1996
+ name: string;
1997
+ description?: string | null;
1998
+ }) => Promise<{
1999
+ templateId: string;
2000
+ }>;
2001
+ update: (marketId: string, templateId: string, body: {
2002
+ name?: string;
2003
+ description?: string | null;
2004
+ }) => Promise<{
2005
+ template: SaleTemplate;
2006
+ }>;
2007
+ delete: (marketId: string, templateId: string) => Promise<{
2008
+ success: boolean;
2009
+ }>;
1690
2010
  };
1691
2011
  taxRates: {
1692
2012
  list: (marketId: string) => Promise<TaxRate[]>;
1693
2013
  get: (marketId: string, id: string) => Promise<TaxRate>;
1694
2014
  };
1695
2015
  customers: {
1696
- list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
2016
+ list: (marketId: string, lastId?: string | null) => Promise<CustomersListResponse>;
1697
2017
  get: (marketId: string, customerId: string) => Promise<Customer>;
1698
2018
  avatar: (marketId: string, customerId: string) => Promise<Customer>;
1699
2019
  create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
2020
+ update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
1700
2021
  getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
1701
2022
  getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
1702
2023
  };
1703
2024
  invoices: {
1704
- list: (marketId: string, lastId?: string) => Promise<InvoicesListResponse>;
2025
+ list: (marketId: string, lastId?: string | null) => Promise<InvoicesListResponse>;
1705
2026
  get: (marketId: string, invoiceId: string) => Promise<Invoice>;
1706
2027
  };
1707
2028
  payments: {
1708
- list: (marketId: string, lastId?: string) => Promise<PaymentsListResponse>;
2029
+ list: (marketId: string, lastId?: string | null) => Promise<PaymentsListResponse>;
1709
2030
  get: (marketId: string, paymentId: string) => Promise<Payment>;
1710
2031
  };
1711
2032
  payouts: {
1712
- list: (marketId: string, lastId?: string) => Promise<PayoutsListResponse>;
2033
+ list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
1713
2034
  get: (marketId: string, payoutId: string) => Promise<Payout>;
1714
2035
  };
1715
2036
  search: {
@@ -1729,6 +2050,19 @@ declare function Studio(info?: {
1729
2050
  data: boolean;
1730
2051
  }>;
1731
2052
  };
2053
+ contacts: {
2054
+ list: (marketId: string, customerId: string, params?: {
2055
+ lastId?: string;
2056
+ limit?: number;
2057
+ }) => Promise<ListContactsResponse>;
2058
+ get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
2059
+ create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
2060
+ update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
2061
+ delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
2062
+ };
2063
+ ledger: {
2064
+ getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
2065
+ };
1732
2066
  };
1733
2067
 
1734
2068
  /**
@@ -1828,9 +2162,15 @@ declare function sortByLotNumber<T extends {
1828
2162
  lotNumber: string;
1829
2163
  }>(lots: T[]): T[];
1830
2164
  /***
1831
- * Generate the next lot number in a sequence:
2165
+ * Generate the next lot number in a sequence.
2166
+ * Handles various formats:
2167
+ * - Simple: "7" -> "8"
2168
+ * - Alphanumeric: "7A" -> "7B"
2169
+ * - Range: "1-3" -> "4", "1 - 3" -> "4" (flexible whitespace)
2170
+ * - Range with alpha: "1-3A" -> "3B"
2171
+ * - Compound: "1-3, 10" -> "11", "1-5, 7-9" -> "10"
1832
2172
  */
1833
2173
  declare function nextLotNumber(previousLotNumber: string): string;
1834
2174
 
1835
2175
  export { EarTag, Studio, StudioHeaders, types as StudioTypes, createAppManifest, Studio as default, lotComparator, nextLotNumber, sortByLotNumber };
1836
- export type { ChunkedFile, StudioInstance, StudioManifest };
2176
+ export type { ChunkedFile, CreateCustomerPayload, FarmAssuranceUpdate, KeeperDetailsUpdate, StudioInstance, StudioManifest, UpdateCustomerPayload };