@marteye/studiojs 1.1.35 → 1.1.37

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,13 @@
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
+
3
11
  type Timestamp = string;
4
12
  type ClientType = "Seller" | "Buyer";
5
13
  type SuperType = "Sheep" | "Goats" | "Cattle" | "Pigs" | "Horses" | "Deer" | "Poultry" | "Machinery" | "Antiques" | "Other";
@@ -12,6 +20,7 @@ type CurrenciesWithGuinea = Currency | "GUINEA-GBP";
12
20
  type UnitOfSale = "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
13
21
  declare const SupportedUnitsOfSale: UnitOfSale[];
14
22
  type PaymentMethod = "BACS" | "Cheque" | "BankTransfer" | "Cash" | "Card" | "Credit";
23
+ type InvoiceDeliveryPreference = "email" | "printed" | "both";
15
24
  type PayoutMethod = "BACS" | "Cheque" | "Cash";
16
25
  declare const SupportedPaymentMethods: PaymentMethod[];
17
26
  interface Market {
@@ -46,6 +55,7 @@ interface SettingsMarketDefaults {
46
55
  defaultPayoutPreference: PayoutMethod;
47
56
  defaultUnitOfSale: UnitOfSale;
48
57
  defaultSuperType?: SuperType | null;
58
+ defaultSettleDebtsFirst?: boolean;
49
59
  lotDescriptionTemplateMap?: {
50
60
  default: string | undefined;
51
61
  [supertype: string]: string | undefined;
@@ -177,6 +187,40 @@ interface Sale {
177
187
  };
178
188
  editedBy?: string[];
179
189
  }
190
+ interface TemplateSaleData {
191
+ name?: string;
192
+ description?: string | null;
193
+ image?: string | null;
194
+ location?: string | null;
195
+ martEyeSaleType?: "LIVE" | "TIMED" | null;
196
+ cover?: string | null;
197
+ availableProductCodes: string[];
198
+ attributeDefaults?: {
199
+ [attributekey: string]: AttributeValueType;
200
+ };
201
+ marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
202
+ }
203
+ interface SaleTemplate {
204
+ id: string;
205
+ marketId: string;
206
+ name: string;
207
+ description?: string | null;
208
+ sourceSaleId?: string;
209
+ createdAt: Timestamp;
210
+ updatedAt: Timestamp;
211
+ createdBy: string;
212
+ saleData: TemplateSaleData;
213
+ lotGridConfigs?: {
214
+ [configId: string]: StoredDataGridConfig;
215
+ };
216
+ }
217
+ interface StoredDataGridConfig {
218
+ widths?: {
219
+ [key: string]: number;
220
+ };
221
+ hiddenColumnIds: string[];
222
+ columnOrder: string[];
223
+ }
180
224
  interface MartEyeLiveSaleSettings {
181
225
  description?: string;
182
226
  image?: string;
@@ -361,6 +405,34 @@ interface LotItem {
361
405
  [key: string]: string | number | boolean | Timestamp | Media;
362
406
  };
363
407
  }
408
+ /***
409
+ * A market may offer other products and services. This is a way to track those.
410
+ * They simply create a line item on the invoice
411
+ *
412
+ * /settings/products
413
+ */
414
+ interface Product {
415
+ id: string;
416
+ createdAt: Timestamp;
417
+ updatedAt: Timestamp;
418
+ marketId: string;
419
+ name: string;
420
+ taxRateId: string;
421
+ defaultUnitPriceInCents: number;
422
+ unitPriceIncludesVat?: boolean;
423
+ applyToClients: ClientType[];
424
+ subtotalGroup?: SubtotalGroups | null | undefined;
425
+ passThroughFundsToAnotherCustomer?: boolean;
426
+ isEnabled?: boolean;
427
+ relatedTo?: {
428
+ lotId: string;
429
+ saleId: string;
430
+ } | null;
431
+ obfusicate?: boolean;
432
+ metadata: {
433
+ [key: string]: string | number | boolean | Timestamp | Media;
434
+ };
435
+ }
364
436
  /***
365
437
  * When a product is added to a cart it becomes a CartProductItem
366
438
  *
@@ -423,54 +495,6 @@ interface ProductCodeConfiguration {
423
495
  interface ProductConfiguration {
424
496
  [id: string]: Product;
425
497
  }
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
498
  interface Cart {
475
499
  customerId: string;
476
500
  updatedAt: Timestamp;
@@ -513,6 +537,37 @@ type BankDetails = {
513
537
  accountNumber?: never;
514
538
  sortCode?: never;
515
539
  });
540
+ type CustomerBankDetails = BankDetails & {
541
+ id?: string;
542
+ createdAt?: Timestamp;
543
+ updatedAt?: Timestamp;
544
+ updatedBy?: string | null;
545
+ };
546
+ interface CustomerContact {
547
+ id: string;
548
+ createdAt: Timestamp;
549
+ updatedAt: Timestamp;
550
+ updatedBy?: string | null;
551
+ marketId: string;
552
+ displayName: string;
553
+ email?: string | null;
554
+ phoneNumber?: string | null;
555
+ /** @deprecated */
556
+ landlineNumber?: string | null;
557
+ /** @deprecated */
558
+ address?: Address;
559
+ isPrimary?: boolean;
560
+ isActive?: boolean;
561
+ isDeleted?: boolean;
562
+ isVerified?: boolean;
563
+ accountEmails?: boolean;
564
+ marketingEmails?: boolean;
565
+ marteyeUid?: string | null;
566
+ notes?: string | null;
567
+ metadata?: {
568
+ [key: string]: string | number | boolean | Timestamp | Media;
569
+ };
570
+ }
516
571
  /**
517
572
  * Used to store the bank details for a market
518
573
  */
@@ -538,19 +593,25 @@ interface Customer {
538
593
  isMarketAccount?: boolean;
539
594
  accountNumber?: string;
540
595
  bidderNumber?: number | null;
596
+ displayName?: string | null;
541
597
  firstName?: string | null;
542
598
  lastName?: string | null;
543
599
  tradingName?: string | null;
544
600
  email?: EmailWrapper;
545
601
  phoneNumber?: PhoneNumberWrapper;
602
+ /** @deprecated */
546
603
  otherPhoneNumbers?: PhoneNumberWrapper[];
547
604
  address: AddressWrapper;
605
+ /** @deprecated */
548
606
  otherAddresses: {
549
607
  [addressId: string]: AddressWrapper;
550
608
  };
551
609
  photoURL?: string | null;
552
610
  payoutPreference?: PayoutMethod;
553
- bankDetails?: BankDetails;
611
+ invoiceDeliveryPreference?: InvoiceDeliveryPreference;
612
+ statementDeliveryPreference?: InvoiceDeliveryPreference;
613
+ bankDetails?: CustomerBankDetails | CustomerBankDetails[] | null;
614
+ contacts?: CustomerContact[];
554
615
  attributeDefaultsBuyer?: {
555
616
  [attributekey: string]: AttributeValueType[];
556
617
  };
@@ -567,6 +628,8 @@ interface Customer {
567
628
  hasPurchasedItems?: boolean;
568
629
  hasSoldItems?: boolean;
569
630
  notes?: string;
631
+ status?: "archived" | "deleted" | null;
632
+ deleteAfter?: Timestamp;
570
633
  }
571
634
  interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" | "lastItemPurchaseDate" | "lastItemSaleDate"> {
572
635
  createdAt: number;
@@ -738,6 +801,10 @@ interface Payment {
738
801
  voidedBy?: string | null;
739
802
  voidReason?: string | null;
740
803
  invoiceIds: string[];
804
+ invoices?: Array<{
805
+ id: string;
806
+ amountAppliedInCents?: number;
807
+ }>;
741
808
  transactionIds: string[];
742
809
  }
743
810
  interface Payout {
@@ -749,6 +816,10 @@ interface Payout {
749
816
  customerId: string;
750
817
  method: PayoutMethod | "Credit";
751
818
  amountInCents: number;
819
+ invoices?: Array<{
820
+ id: string;
821
+ amountAppliedInCents?: number;
822
+ }>;
752
823
  accountName?: string;
753
824
  accountNumber?: string;
754
825
  sortCode?: string;
@@ -906,6 +977,10 @@ interface Printer {
906
977
  */
907
978
  name: string;
908
979
  friendlyName: string;
980
+ /**
981
+ * Optional single IPP URI if linked by IP discovery
982
+ */
983
+ uri?: string;
909
984
  chequePrinter?: boolean;
910
985
  /**
911
986
  * The next cheque number to use when printing a cheque
@@ -1024,6 +1099,23 @@ type AppParameterConfig = {
1024
1099
  required?: boolean;
1025
1100
  defaultValue?: string | number | boolean | string[];
1026
1101
  };
1102
+ interface CphLookupResponse {
1103
+ cph: string;
1104
+ county: string;
1105
+ parish: string;
1106
+ holding: string;
1107
+ subLocation?: string;
1108
+ country: string;
1109
+ region: string | null;
1110
+ spatialUnit: string | null;
1111
+ office: string | null;
1112
+ ahdoNumber: string | null;
1113
+ parishName: string;
1114
+ tbTestingInterval: string | null;
1115
+ tbArea: string | null;
1116
+ cphValid?: boolean | null;
1117
+ farmName?: string | null;
1118
+ }
1027
1119
 
1028
1120
  type types_Accessory = Accessory;
1029
1121
  type types_Address = Address;
@@ -1040,9 +1132,12 @@ type types_Cart = Cart;
1040
1132
  type types_CartItem = CartItem;
1041
1133
  type types_ChequeField = ChequeField;
1042
1134
  type types_ClientType = ClientType;
1135
+ type types_CphLookupResponse = CphLookupResponse;
1043
1136
  type types_CurrenciesWithGuinea = CurrenciesWithGuinea;
1044
1137
  type types_Currency = Currency;
1045
1138
  type types_Customer = Customer;
1139
+ type types_CustomerBankDetails = CustomerBankDetails;
1140
+ type types_CustomerContact = CustomerContact;
1046
1141
  type types_CustomerFromSearch = CustomerFromSearch;
1047
1142
  type types_DeviceType = DeviceType;
1048
1143
  type types_DisplayBoardMode = DisplayBoardMode;
@@ -1055,6 +1150,7 @@ type types_ImageSizes = ImageSizes;
1055
1150
  type types_IncrementLadder = IncrementLadder;
1056
1151
  type types_IncrementLadderItem = IncrementLadderItem;
1057
1152
  type types_Invoice = Invoice;
1153
+ type types_InvoiceDeliveryPreference = InvoiceDeliveryPreference;
1058
1154
  type types_InvoiceField = InvoiceField;
1059
1155
  type types_InvoiceLineItem = InvoiceLineItem;
1060
1156
  type types_InvoiceTotalAdjustmentConfiguration = InvoiceTotalAdjustmentConfiguration;
@@ -1086,6 +1182,7 @@ type types_ProductCodeConfiguration = ProductCodeConfiguration;
1086
1182
  type types_ProductConfiguration = ProductConfiguration;
1087
1183
  type types_Sale = Sale;
1088
1184
  type types_SaleFromSearch = SaleFromSearch;
1185
+ type types_SaleTemplate = SaleTemplate;
1089
1186
  type types_SettingsAccessories = SettingsAccessories;
1090
1187
  type types_SettingsAdjustmentsConfiguration = SettingsAdjustmentsConfiguration;
1091
1188
  type types_SettingsGlobalAttributes = SettingsGlobalAttributes;
@@ -1096,6 +1193,7 @@ type types_SettingsTaxRates = SettingsTaxRates;
1096
1193
  type types_ShortCustomerDetails = ShortCustomerDetails;
1097
1194
  type types_SimplePaymentIn = SimplePaymentIn;
1098
1195
  type types_SimplePaymentOut = SimplePaymentOut;
1196
+ type types_StoredDataGridConfig = StoredDataGridConfig;
1099
1197
  type types_StudioAppPartial = StudioAppPartial;
1100
1198
  type types_SubtotalGroups = SubtotalGroups;
1101
1199
  type types_SuperType = SuperType;
@@ -1107,6 +1205,7 @@ declare const types_SupportedSuperTypes: typeof SupportedSuperTypes;
1107
1205
  declare const types_SupportedUnitsOfSale: typeof SupportedUnitsOfSale;
1108
1206
  type types_TablePosition = TablePosition;
1109
1207
  type types_TaxRate = TaxRate;
1208
+ type types_TemplateSaleData = TemplateSaleData;
1110
1209
  type types_UnitOfSale = UnitOfSale;
1111
1210
  declare const types_VIDEO_TASKS_VALUES: typeof VIDEO_TASKS_VALUES;
1112
1211
  type types_VideoTasks = VideoTasks;
@@ -1115,7 +1214,23 @@ type types_WebhookEventName = WebhookEventName;
1115
1214
  declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
1116
1215
  declare namespace types {
1117
1216
  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 };
1217
+ 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_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 };
1218
+ }
1219
+
1220
+ interface ListContactsResponse {
1221
+ contacts: CustomerContact[];
1222
+ lastId: string | null;
1223
+ hasMore: boolean;
1224
+ }
1225
+ interface CreateOrUpdateContactPayload {
1226
+ id?: string;
1227
+ displayName?: string | null;
1228
+ email?: string | null;
1229
+ phoneNumber?: string | null;
1230
+ notes?: string | null;
1231
+ marteyeUid?: string | null;
1232
+ accountEmails?: boolean;
1233
+ marketingEmails?: boolean;
1119
1234
  }
1120
1235
 
1121
1236
  declare const videoTaskSchema: z.ZodEnum<["compressed", "thumbnail"]>;
@@ -1212,13 +1327,6 @@ declare const uploadSingleFile: (input: SingleFileInput, token: string) => Promi
1212
1327
  data: Media;
1213
1328
  }>;
1214
1329
 
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
1330
  /**
1223
1331
  * Search result interface based on the API implementation
1224
1332
  */
@@ -1233,6 +1341,24 @@ interface SearchResult {
1233
1341
  query: string;
1234
1342
  }
1235
1343
 
1344
+ interface PayoutsListResponse {
1345
+ payouts: Payout[];
1346
+ lastId: string | null;
1347
+ hasMore: boolean;
1348
+ }
1349
+
1350
+ interface PaymentsListResponse {
1351
+ payments: Payment[];
1352
+ lastId: string | null;
1353
+ hasMore: boolean;
1354
+ }
1355
+
1356
+ interface InvoicesListResponse {
1357
+ invoices: Invoice[];
1358
+ lastId: string | null;
1359
+ hasMore: boolean;
1360
+ }
1361
+
1236
1362
  interface CreateCustomerPayload {
1237
1363
  displayName: string;
1238
1364
  email?: string;
@@ -1254,12 +1380,89 @@ interface CreateCustomerPayload {
1254
1380
  };
1255
1381
  marteyeUid?: string;
1256
1382
  }
1383
+ interface FarmAssuranceUpdate {
1384
+ number?: string | null;
1385
+ scheme?: string | null;
1386
+ expiry?: string | Date | null;
1387
+ }
1388
+ interface KeeperDetailsUpdate {
1389
+ herdNumber?: string | null;
1390
+ flockNumber?: string | null;
1391
+ cphNumber?: string | null;
1392
+ farmName?: string | null;
1393
+ slapMark?: string | null;
1394
+ farmAssurance?: {
1395
+ cattle?: FarmAssuranceUpdate | null;
1396
+ sheep?: FarmAssuranceUpdate | null;
1397
+ pigs?: FarmAssuranceUpdate | null;
1398
+ };
1399
+ vetAttestation?: {
1400
+ vanNumber?: string | null;
1401
+ expiry?: string | Date | null;
1402
+ } | null;
1403
+ movementReporting?: {
1404
+ fromOrigin?: boolean | null;
1405
+ toDestination?: boolean | null;
1406
+ } | null;
1407
+ }
1408
+ interface UpdateCustomerPayload {
1409
+ displayName?: string | null;
1410
+ email?: {
1411
+ email: string;
1412
+ isVerified?: boolean;
1413
+ createdAt?: string | Date;
1414
+ } | null;
1415
+ phoneNumber?: {
1416
+ phoneNumber: string;
1417
+ isVerified?: boolean;
1418
+ createdAt?: string | Date;
1419
+ } | null;
1420
+ address?: Customer["address"] | null;
1421
+ otherAddresses?: Customer["otherAddresses"] | null;
1422
+ otherPhoneNumbers?: Customer["otherPhoneNumbers"] | null;
1423
+ payoutPreference?: PayoutMethod | "none" | null;
1424
+ invoiceDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
1425
+ statementDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
1426
+ bankDetails?: Customer["bankDetails"] | null;
1427
+ preferSettleDebtsFirst?: boolean;
1428
+ vatNumber?: string | null;
1429
+ accountNumber?: string | null;
1430
+ notes?: string | null;
1431
+ attributeDefaultsBuyer?: Customer["attributeDefaultsBuyer"] | null;
1432
+ attributeDefaultsSeller?: Customer["attributeDefaultsSeller"] | null;
1433
+ metadata?: Customer["metadata"] | null;
1434
+ keeperDetails?: KeeperDetailsUpdate;
1435
+ }
1257
1436
  interface CustomersListResponse {
1258
1437
  customers: Customer[];
1259
1438
  lastId: string | null;
1260
1439
  hasMore: boolean;
1261
1440
  }
1262
1441
 
1442
+ interface CreateExtraPayload {
1443
+ id: string;
1444
+ name: string;
1445
+ taxRateId: string;
1446
+ defaultUnitPriceInCents?: number;
1447
+ unitPriceIncludesVat?: boolean;
1448
+ applyToClients?: ("Seller" | "Buyer")[];
1449
+ subtotalGroup?: string | null;
1450
+ passThroughFundsToAnotherCustomer?: boolean;
1451
+ isEnabled?: boolean;
1452
+ metadata?: Record<string, any>;
1453
+ }
1454
+ interface UpdateExtraPayload {
1455
+ name?: string;
1456
+ taxRateId?: string;
1457
+ defaultUnitPriceInCents?: number;
1458
+ unitPriceIncludesVat?: boolean;
1459
+ applyToClients?: ("Seller" | "Buyer")[];
1460
+ subtotalGroup?: string | null;
1461
+ passThroughFundsToAnotherCustomer?: boolean;
1462
+ isEnabled?: boolean;
1463
+ metadata?: Record<string, any>;
1464
+ }
1465
+
1263
1466
  interface CreateApplicationPayload {
1264
1467
  displayName: string;
1265
1468
  phoneNumber?: string;
@@ -1322,6 +1525,7 @@ declare function resources(httpClient: HttpClient): {
1322
1525
  description?: string | null;
1323
1526
  image?: string | null;
1324
1527
  cover?: string | null;
1528
+ templateId?: string | null;
1325
1529
  attributeDefaults?: {
1326
1530
  [attributekey: string]: string | number | boolean;
1327
1531
  };
@@ -1433,6 +1637,9 @@ declare function resources(httpClient: HttpClient): {
1433
1637
  }) => Promise<LotItem>;
1434
1638
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
1435
1639
  };
1640
+ cph: {
1641
+ lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
1642
+ };
1436
1643
  webhooks: {
1437
1644
  constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
1438
1645
  };
@@ -1453,23 +1660,70 @@ declare function resources(httpClient: HttpClient): {
1453
1660
  adjustments: {
1454
1661
  list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
1455
1662
  get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
1663
+ create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1664
+ update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1665
+ };
1666
+ extras: {
1667
+ list: (marketId: string) => Promise<Product[]>;
1668
+ get: (marketId: string, id: string) => Promise<Product>;
1669
+ create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
1670
+ update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
1456
1671
  };
1457
1672
  productCodes: {
1458
1673
  list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
1459
1674
  get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
1675
+ create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1676
+ update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1677
+ };
1678
+ saleTemplates: {
1679
+ list: (marketId: string) => Promise<{
1680
+ templates: SaleTemplate[];
1681
+ }>;
1682
+ get: (marketId: string, templateId: string) => Promise<{
1683
+ template: SaleTemplate;
1684
+ }>;
1685
+ create: (marketId: string, body: {
1686
+ saleId: string;
1687
+ name: string;
1688
+ description?: string | null;
1689
+ }) => Promise<{
1690
+ templateId: string;
1691
+ }>;
1692
+ update: (marketId: string, templateId: string, body: {
1693
+ name?: string;
1694
+ description?: string | null;
1695
+ }) => Promise<{
1696
+ template: SaleTemplate;
1697
+ }>;
1698
+ delete: (marketId: string, templateId: string) => Promise<{
1699
+ success: boolean;
1700
+ }>;
1460
1701
  };
1461
1702
  taxRates: {
1462
1703
  list: (marketId: string) => Promise<TaxRate[]>;
1463
1704
  get: (marketId: string, id: string) => Promise<TaxRate>;
1464
1705
  };
1465
1706
  customers: {
1466
- list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
1707
+ list: (marketId: string, lastId?: string | null) => Promise<CustomersListResponse>;
1467
1708
  get: (marketId: string, customerId: string) => Promise<Customer>;
1468
1709
  avatar: (marketId: string, customerId: string) => Promise<Customer>;
1469
1710
  create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
1711
+ update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
1470
1712
  getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
1471
1713
  getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
1472
1714
  };
1715
+ invoices: {
1716
+ list: (marketId: string, lastId?: string | null) => Promise<InvoicesListResponse>;
1717
+ get: (marketId: string, invoiceId: string) => Promise<Invoice>;
1718
+ };
1719
+ payments: {
1720
+ list: (marketId: string, lastId?: string | null) => Promise<PaymentsListResponse>;
1721
+ get: (marketId: string, paymentId: string) => Promise<Payment>;
1722
+ };
1723
+ payouts: {
1724
+ list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
1725
+ get: (marketId: string, payoutId: string) => Promise<Payout>;
1726
+ };
1473
1727
  search: {
1474
1728
  query: (marketId: string, query: string) => Promise<SearchResult>;
1475
1729
  };
@@ -1487,6 +1741,16 @@ declare function resources(httpClient: HttpClient): {
1487
1741
  data: boolean;
1488
1742
  }>;
1489
1743
  };
1744
+ contacts: {
1745
+ list: (marketId: string, customerId: string, params?: {
1746
+ lastId?: string;
1747
+ limit?: number;
1748
+ }) => Promise<ListContactsResponse>;
1749
+ get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
1750
+ create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
1751
+ update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
1752
+ delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
1753
+ };
1490
1754
  };
1491
1755
 
1492
1756
  type StudioInstance = ReturnType<typeof resources> & {
@@ -1522,6 +1786,7 @@ declare function Studio(info?: {
1522
1786
  description?: string | null;
1523
1787
  image?: string | null;
1524
1788
  cover?: string | null;
1789
+ templateId?: string | null;
1525
1790
  attributeDefaults?: {
1526
1791
  [attributekey: string]: string | number | boolean;
1527
1792
  };
@@ -1633,6 +1898,9 @@ declare function Studio(info?: {
1633
1898
  }) => Promise<LotItem>;
1634
1899
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
1635
1900
  };
1901
+ cph: {
1902
+ lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
1903
+ };
1636
1904
  webhooks: {
1637
1905
  constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<WebhookEvent<T>>;
1638
1906
  };
@@ -1653,23 +1921,70 @@ declare function Studio(info?: {
1653
1921
  adjustments: {
1654
1922
  list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
1655
1923
  get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
1924
+ create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1925
+ update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
1926
+ };
1927
+ extras: {
1928
+ list: (marketId: string) => Promise<Product[]>;
1929
+ get: (marketId: string, id: string) => Promise<Product>;
1930
+ create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
1931
+ update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
1656
1932
  };
1657
1933
  productCodes: {
1658
1934
  list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
1659
1935
  get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
1936
+ create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1937
+ update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
1938
+ };
1939
+ saleTemplates: {
1940
+ list: (marketId: string) => Promise<{
1941
+ templates: SaleTemplate[];
1942
+ }>;
1943
+ get: (marketId: string, templateId: string) => Promise<{
1944
+ template: SaleTemplate;
1945
+ }>;
1946
+ create: (marketId: string, body: {
1947
+ saleId: string;
1948
+ name: string;
1949
+ description?: string | null;
1950
+ }) => Promise<{
1951
+ templateId: string;
1952
+ }>;
1953
+ update: (marketId: string, templateId: string, body: {
1954
+ name?: string;
1955
+ description?: string | null;
1956
+ }) => Promise<{
1957
+ template: SaleTemplate;
1958
+ }>;
1959
+ delete: (marketId: string, templateId: string) => Promise<{
1960
+ success: boolean;
1961
+ }>;
1660
1962
  };
1661
1963
  taxRates: {
1662
1964
  list: (marketId: string) => Promise<TaxRate[]>;
1663
1965
  get: (marketId: string, id: string) => Promise<TaxRate>;
1664
1966
  };
1665
1967
  customers: {
1666
- list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
1968
+ list: (marketId: string, lastId?: string | null) => Promise<CustomersListResponse>;
1667
1969
  get: (marketId: string, customerId: string) => Promise<Customer>;
1668
1970
  avatar: (marketId: string, customerId: string) => Promise<Customer>;
1669
1971
  create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
1972
+ update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
1670
1973
  getByAccountNumber: (marketId: string, accountNumber: string) => Promise<Customer | null>;
1671
1974
  getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<Customer | null>;
1672
1975
  };
1976
+ invoices: {
1977
+ list: (marketId: string, lastId?: string | null) => Promise<InvoicesListResponse>;
1978
+ get: (marketId: string, invoiceId: string) => Promise<Invoice>;
1979
+ };
1980
+ payments: {
1981
+ list: (marketId: string, lastId?: string | null) => Promise<PaymentsListResponse>;
1982
+ get: (marketId: string, paymentId: string) => Promise<Payment>;
1983
+ };
1984
+ payouts: {
1985
+ list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
1986
+ get: (marketId: string, payoutId: string) => Promise<Payout>;
1987
+ };
1673
1988
  search: {
1674
1989
  query: (marketId: string, query: string) => Promise<SearchResult>;
1675
1990
  };
@@ -1687,6 +2002,16 @@ declare function Studio(info?: {
1687
2002
  data: boolean;
1688
2003
  }>;
1689
2004
  };
2005
+ contacts: {
2006
+ list: (marketId: string, customerId: string, params?: {
2007
+ lastId?: string;
2008
+ limit?: number;
2009
+ }) => Promise<ListContactsResponse>;
2010
+ get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
2011
+ create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
2012
+ update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
2013
+ delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
2014
+ };
1690
2015
  };
1691
2016
 
1692
2017
  /**
@@ -1791,4 +2116,4 @@ declare function sortByLotNumber<T extends {
1791
2116
  declare function nextLotNumber(previousLotNumber: string): string;
1792
2117
 
1793
2118
  export { EarTag, Studio, StudioHeaders, types as StudioTypes, createAppManifest, Studio as default, lotComparator, nextLotNumber, sortByLotNumber };
1794
- export type { ChunkedFile, StudioInstance, StudioManifest };
2119
+ export type { ChunkedFile, CreateCustomerPayload, FarmAssuranceUpdate, KeeperDetailsUpdate, StudioInstance, StudioManifest, UpdateCustomerPayload };