@marteye/studiojs 1.1.25 → 1.1.26

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
@@ -547,6 +547,31 @@ interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" |
547
547
  lastItemPurchaseDate?: number;
548
548
  lastItemSaleDate?: number;
549
549
  }
550
+ interface Application {
551
+ id: string;
552
+ createdAt: Timestamp;
553
+ updatedAt: Timestamp;
554
+ marketId: string;
555
+ status: "pending" | "approved" | "rejected";
556
+ displayName: string;
557
+ phoneNumber?: string;
558
+ email?: string;
559
+ address: {
560
+ firstLine: string;
561
+ secondLine?: string;
562
+ county?: string;
563
+ postCode: string;
564
+ };
565
+ dateOfMarteyeAccountCreation?: Timestamp;
566
+ hasWonLotsOnMarteye?: boolean;
567
+ isApprovedAtOtherMarkets?: boolean;
568
+ marteyeUid: string;
569
+ notes?: string;
570
+ approvedBy?: string;
571
+ rejectedBy?: string;
572
+ approvedAt?: Timestamp;
573
+ rejectedAt?: Timestamp;
574
+ }
550
575
  interface Address {
551
576
  id: string;
552
577
  nickname?: string;
@@ -638,6 +663,14 @@ interface Adjustment {
638
663
  ceilingInCents?: number;
639
664
  } | null;
640
665
  fixedAmountInCents?: number | null;
666
+ ladder?: {
667
+ steps: {
668
+ percentageValue?: number;
669
+ upToAmountInCents?: number | null;
670
+ }[];
671
+ floorInCents?: number;
672
+ ceilingInCents?: number;
673
+ };
641
674
  }
642
675
  interface LineItemAdjustmentConfiguration extends AdjustmentsConfiguration {
643
676
  adjustment: Adjustment & {
@@ -801,6 +834,7 @@ interface Invoice extends Omit<Omit<Omit<Omit<DraftInvoice, "ledgerAccountTotals
801
834
  sales: {
802
835
  id: string;
803
836
  name?: string;
837
+ startsAt?: Timestamp;
804
838
  }[];
805
839
  transactionIds?: string[];
806
840
  status: "draft" | "issued" | "void" | "imported" | "paid";
@@ -971,6 +1005,7 @@ type types_AdjustmentTarget = AdjustmentTarget;
971
1005
  type types_AdjustmentTotalTarget = AdjustmentTotalTarget;
972
1006
  type types_AdjustmentsConfiguration = AdjustmentsConfiguration;
973
1007
  type types_AppParameterConfig = AppParameterConfig;
1008
+ type types_Application = Application;
974
1009
  type types_AttributeDefinition = AttributeDefinition;
975
1010
  type types_AttributeValueType = AttributeValueType;
976
1011
  type types_BankDetails = BankDetails;
@@ -1052,7 +1087,7 @@ type types_WebhookEventName = WebhookEventName;
1052
1087
  declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
1053
1088
  declare namespace types {
1054
1089
  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 };
1055
- export type { types_Accessory as Accessory, types_Address as Address, types_AddressWrapper as AddressWrapper, types_AdjustmentTarget as AdjustmentTarget, types_AdjustmentTotalTarget as AdjustmentTotalTarget, types_AdjustmentsConfiguration as AdjustmentsConfiguration, types_AppParameterConfig as AppParameterConfig, types_AttributeDefinition as AttributeDefinition, types_AttributeValueType as AttributeValueType, types_BankDetails as BankDetails, types_Cart as Cart, types_CartItem as CartItem, types_ChequeField as ChequeField, types_ClientType as ClientType, types_CurrenciesWithGuinea as CurrenciesWithGuinea, types_Currency as Currency, types_Customer as Customer, types_CustomerFromSearch as CustomerFromSearch, types_DeviceType as DeviceType, types_DraftInvoice as DraftInvoice, types_EmailWrapper as EmailWrapper, types_FarmAssurances as FarmAssurances, types_FieldPositions as FieldPositions, types_ImageSizes as ImageSizes, types_IncrementLadder as IncrementLadder, types_IncrementLadderItem as IncrementLadderItem, types_Invoice as Invoice, types_InvoiceField as InvoiceField, types_InvoiceLineItem as InvoiceLineItem, types_InvoiceTotalAdjustmentConfiguration as InvoiceTotalAdjustmentConfiguration, types_InvoiceTotals as InvoiceTotals, types_LineItemAdjustmentConfiguration as LineItemAdjustmentConfiguration, types_Lot as Lot, types_LotGeneratedValues as LotGeneratedValues, types_LotIssue as LotIssue, types_LotItem as LotItem, types_LotSaleStatus as LotSaleStatus, types_LotWithItemsAsArray as LotWithItemsAsArray, types_Market as Market, types_MarketBankDetails as MarketBankDetails, types_MarketReportHeaders as MarketReportHeaders, types_MartEyeLiveSaleSettings as MartEyeLiveSaleSettings, types_MartEyeTimedSaleSettings as MartEyeTimedSaleSettings, types_Media as Media, types_MemberSharingConfiguration as MemberSharingConfiguration, types_ObjectType as ObjectType, types_Payment as Payment, types_PaymentMethod as PaymentMethod, types_Payout as Payout, types_PayoutMethod as PayoutMethod, types_PhoneNumberWrapper as PhoneNumberWrapper, types_Printer as Printer, types_Product as Product, types_ProductCodeConfiguration as ProductCodeConfiguration, types_ProductConfiguration as ProductConfiguration, types_Sale as Sale, types_SaleFromSearch as SaleFromSearch, types_SettingsAccessories as SettingsAccessories, types_SettingsAdjustmentsConfiguration as SettingsAdjustmentsConfiguration, types_SettingsGlobalAttributes as SettingsGlobalAttributes, types_SettingsMarketDefaults as SettingsMarketDefaults, types_SettingsPrinters as SettingsPrinters, types_SettingsProductCodes as SettingsProductCodes, types_SettingsTaxRates as SettingsTaxRates, types_ShortCustomerDetails as ShortCustomerDetails, types_SimplePaymentIn as SimplePaymentIn, types_SimplePaymentOut as SimplePaymentOut, types_StudioAppPartial as StudioAppPartial, types_SubtotalGroups as SubtotalGroups, types_SuperType as SuperType, types_SupportedAttributeTypes as SupportedAttributeTypes, types_SupportedCountryCode as SupportedCountryCode, 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 };
1090
+ 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_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 };
1056
1091
  }
1057
1092
 
1058
1093
  declare const videoTaskSchema: z.ZodEnum<["compressed", "thumbnail"]>;
@@ -1192,6 +1227,44 @@ interface CreateCustomerPayload {
1192
1227
  marteyeUid?: string;
1193
1228
  }
1194
1229
 
1230
+ interface CreateApplicationPayload {
1231
+ displayName: string;
1232
+ phoneNumber?: string;
1233
+ email?: string;
1234
+ address: {
1235
+ firstLine: string;
1236
+ secondLine?: string;
1237
+ county?: string;
1238
+ postCode: string;
1239
+ };
1240
+ dateOfMarteyeAccountCreation?: string;
1241
+ hasWonLotsOnMarteye?: boolean;
1242
+ isApprovedAtOtherMarkets?: boolean;
1243
+ marteyeUid: string;
1244
+ notes?: string;
1245
+ }
1246
+ interface UpdateApplicationPayload {
1247
+ displayName?: string;
1248
+ phoneNumber?: string;
1249
+ email?: string;
1250
+ address?: {
1251
+ firstLine?: string;
1252
+ secondLine?: string;
1253
+ county?: string;
1254
+ postCode?: string;
1255
+ };
1256
+ notes?: string;
1257
+ }
1258
+ interface ListApplicationsOptions {
1259
+ lastId?: string;
1260
+ status?: "pending" | "approved" | "rejected";
1261
+ }
1262
+ interface ListApplicationsResponse {
1263
+ applications: Application[];
1264
+ lastId: string | null;
1265
+ hasMore: boolean;
1266
+ }
1267
+
1195
1268
  declare function resources(httpClient: HttpClient): {
1196
1269
  markets: {
1197
1270
  get: (marketId: string) => Promise<Market>;
@@ -1326,6 +1399,14 @@ declare function resources(httpClient: HttpClient): {
1326
1399
  actions: {
1327
1400
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
1328
1401
  };
1402
+ applications: {
1403
+ list: (marketId: string, options?: ListApplicationsOptions) => Promise<ListApplicationsResponse>;
1404
+ get: (marketId: string, applicationId: string) => Promise<Application>;
1405
+ create: (marketId: string, applicationData: CreateApplicationPayload) => Promise<Application>;
1406
+ update: (marketId: string, applicationId: string, updateData: UpdateApplicationPayload) => Promise<Application>;
1407
+ approve: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
1408
+ reject: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
1409
+ };
1329
1410
  settings: {
1330
1411
  get: (marketId: string) => Promise<SettingsMarketDefaults>;
1331
1412
  };
@@ -1510,6 +1591,14 @@ declare function Studio(info?: {
1510
1591
  actions: {
1511
1592
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
1512
1593
  };
1594
+ applications: {
1595
+ list: (marketId: string, options?: ListApplicationsOptions) => Promise<ListApplicationsResponse>;
1596
+ get: (marketId: string, applicationId: string) => Promise<Application>;
1597
+ create: (marketId: string, applicationData: CreateApplicationPayload) => Promise<Application>;
1598
+ update: (marketId: string, applicationId: string, updateData: UpdateApplicationPayload) => Promise<Application>;
1599
+ approve: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
1600
+ reject: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
1601
+ };
1513
1602
  settings: {
1514
1603
  get: (marketId: string) => Promise<SettingsMarketDefaults>;
1515
1604
  };
package/dist/index.esm.js CHANGED
@@ -67,7 +67,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
67
67
  }
68
68
 
69
69
  // Path: studiojs/src/resources/markets.ts
70
- function create$c(_) {
70
+ function create$d(_) {
71
71
  const actions = {
72
72
  /***
73
73
  * This is used to construct the action from the request body
@@ -97,7 +97,7 @@ function create$c(_) {
97
97
  return actions;
98
98
  }
99
99
 
100
- function create$b(httpClient) {
100
+ function create$c(httpClient) {
101
101
  return {
102
102
  list: async (marketId) => {
103
103
  return httpClient.get(`/${marketId}/adjustments`);
@@ -108,6 +108,72 @@ function create$b(httpClient) {
108
108
  };
109
109
  }
110
110
 
111
+ function create$b(httpClient) {
112
+ let applications = {
113
+ /**
114
+ * List applications for a market with optional filtering
115
+ * @param marketId - ID of the market
116
+ * @param options - Optional query parameters for filtering and pagination
117
+ * @returns Paginated list of applications
118
+ */
119
+ list: async (marketId, options) => {
120
+ return httpClient.get(`/${marketId}/applications`, options);
121
+ },
122
+ /**
123
+ * Get a single application by ID
124
+ * @param marketId - ID of the market
125
+ * @param applicationId - ID of the application
126
+ * @returns The application details
127
+ */
128
+ get: async (marketId, applicationId) => {
129
+ return httpClient.get(`/${marketId}/applications/${applicationId}`);
130
+ },
131
+ /**
132
+ * Create a new application
133
+ * @param marketId - ID of the market
134
+ * @param applicationData - The application data
135
+ * @returns The created application
136
+ */
137
+ create: async (marketId, applicationData) => {
138
+ return httpClient.post(`/${marketId}/applications`, applicationData);
139
+ },
140
+ /**
141
+ * Update an existing application
142
+ * @param marketId - ID of the market
143
+ * @param applicationId - ID of the application to update
144
+ * @param updateData - The fields to update
145
+ * @returns The updated application
146
+ * @throws Error if the application is already approved or rejected
147
+ */
148
+ update: async (marketId, applicationId, updateData) => {
149
+ return httpClient.post(`/${marketId}/applications/${applicationId}`, updateData);
150
+ },
151
+ /**
152
+ * Approve an application
153
+ * @param marketId - ID of the market
154
+ * @param applicationId - ID of the application to approve
155
+ * @param notes - Optional notes for the approval
156
+ * @returns The approved application
157
+ * @throws Error if the application is not in pending status
158
+ */
159
+ approve: async (marketId, applicationId, notes) => {
160
+ return httpClient.post(`/${marketId}/applications/${applicationId}/approve`, { notes });
161
+ },
162
+ /**
163
+ * Reject an application
164
+ * @param marketId - ID of the market
165
+ * @param applicationId - ID of the application to reject
166
+ * @param notes - Optional notes for the rejection
167
+ * @returns The rejected application
168
+ * @throws Error if the application is not in pending status
169
+ */
170
+ reject: async (marketId, applicationId, notes) => {
171
+ return httpClient.post(`/${marketId}/applications/${applicationId}/reject`, { notes });
172
+ },
173
+ };
174
+ return applications;
175
+ }
176
+
111
177
  // Path: studiojs/src/resources/markets.ts
112
178
  function create$a(httpClient) {
113
179
  let customers = {
@@ -5111,9 +5177,10 @@ function resources(httpClient) {
5111
5177
  lots: create$7(httpClient),
5112
5178
  lotitems: create$8(httpClient),
5113
5179
  webhooks: create(),
5114
- actions: create$c(),
5180
+ actions: create$d(),
5181
+ applications: create$b(httpClient),
5115
5182
  settings: create$2(httpClient),
5116
- adjustments: create$b(httpClient),
5183
+ adjustments: create$c(httpClient),
5117
5184
  productCodes: create$5(httpClient),
5118
5185
  taxRates: create$1(httpClient),
5119
5186
  customers: create$a(httpClient),