@marteye/studiojs 1.1.38 → 1.1.40

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.cjs ADDED
@@ -0,0 +1,10 @@
1
+ const mod = require("./index.js");
2
+ const api = mod && mod.default ? mod.default : mod;
3
+ if (mod && typeof mod === "object") {
4
+ for (const key of Object.keys(mod)) {
5
+ if (key !== "default") {
6
+ api[key] = mod[key];
7
+ }
8
+ }
9
+ }
10
+ module.exports = api;
package/dist/index.d.ts CHANGED
@@ -11,6 +11,44 @@ type HttpClient = ReturnType<typeof SimpleHttpClient>;
11
11
  interface LedgerBalanceResponse {
12
12
  balanceInCents: number;
13
13
  }
14
+ interface LedgerTransaction {
15
+ id: string;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ transactionDate: string;
19
+ marketId: string;
20
+ account: string;
21
+ rollUpAccounts: string[];
22
+ accountType: "income" | "expense" | "asset" | "liability" | "equity";
23
+ accountName: string;
24
+ owner: "market" | string;
25
+ isMarketAccount: boolean;
26
+ amountInCents: number;
27
+ batchId: string;
28
+ batchDescription: string;
29
+ referenceId: string;
30
+ referenceType: string;
31
+ referenceTxnCount: number;
32
+ referenceGroupKey: string;
33
+ tags: Record<string, string | number | boolean>;
34
+ parentTransactionId: string | null;
35
+ currentBalanceInCents: number;
36
+ sumOfCreditsInCents: number;
37
+ sumOfDebitsInCents: number;
38
+ index: number;
39
+ }
40
+ interface TransactionsListResponse {
41
+ transactions: LedgerTransaction[];
42
+ nextCursor: string | null;
43
+ hasMore: boolean;
44
+ }
45
+ interface ListTransactionsParams {
46
+ account: string;
47
+ dateFrom?: string;
48
+ dateTo?: string;
49
+ limit?: number;
50
+ cursor?: string;
51
+ }
14
52
 
15
53
  type Timestamp = string;
16
54
  type ClientType = "Seller" | "Buyer";
@@ -124,7 +162,7 @@ type DisplayBoardMode = "off" | "live" | "manual" | {
124
162
  type: "focused";
125
163
  field: string;
126
164
  };
127
- type SalePublishStatus = "unpublished" | "sale" | "catalogPublished";
165
+ type SalePublishStatus = "unpublished" | "sale" | "saleAndCatalog";
128
166
  interface Sale {
129
167
  id: string;
130
168
  createdAt: Timestamp;
@@ -196,7 +234,7 @@ interface Sale {
196
234
  * Publishing status for external systems
197
235
  * - unpublished: Not listed in external system
198
236
  * - sale: Sale date is listed externally
199
- * - catalogPublished: Sale and catalog information synced
237
+ * - saleAndCatalog: Sale and catalog information synced
200
238
  */
201
239
  publishStatus?: SalePublishStatus;
202
240
  }
@@ -643,6 +681,7 @@ interface Customer {
643
681
  notes?: string;
644
682
  status?: "archived" | "deleted" | null;
645
683
  deleteAfter?: Timestamp;
684
+ casualBuyerLabels?: string[];
646
685
  }
647
686
  interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" | "lastItemPurchaseDate" | "lastItemSaleDate"> {
648
687
  createdAt: number;
@@ -1079,6 +1118,7 @@ interface AttributeDefinition {
1079
1118
  prefillableFromPreviousLot?: boolean;
1080
1119
  hidden?: boolean;
1081
1120
  showInSellerDetailsPanel?: boolean;
1121
+ showInSellerReviewPanel?: boolean;
1082
1122
  displayTemplate?: string;
1083
1123
  displayTemplateMultiValue?: string;
1084
1124
  type: SupportedAttributeTypes;
@@ -1129,8 +1169,33 @@ interface CphLookupResponse {
1129
1169
  cphValid?: boolean | null;
1130
1170
  farmName?: string | null;
1131
1171
  }
1172
+ type ActivityOperation = "created" | "updated" | "deleted" | "voided";
1173
+ interface ActivityChange {
1174
+ before?: any;
1175
+ after?: any;
1176
+ }
1177
+ interface ActivityLog {
1178
+ id: string;
1179
+ firstEventAt: Timestamp;
1180
+ lastEventAt: Timestamp;
1181
+ userId: string | null;
1182
+ userName?: string;
1183
+ eventType: WebhookEventName;
1184
+ entityType: ObjectType;
1185
+ entityId: string;
1186
+ entityLabel?: string;
1187
+ saleIds: string[];
1188
+ operation: ActivityOperation;
1189
+ changeCount: number;
1190
+ changes?: {
1191
+ [fieldPath: string]: ActivityChange;
1192
+ };
1193
+ }
1132
1194
 
1133
1195
  type types_Accessory = Accessory;
1196
+ type types_ActivityChange = ActivityChange;
1197
+ type types_ActivityLog = ActivityLog;
1198
+ type types_ActivityOperation = ActivityOperation;
1134
1199
  type types_Address = Address;
1135
1200
  type types_AddressWrapper = AddressWrapper;
1136
1201
  type types_AdjustmentTarget = AdjustmentTarget;
@@ -1228,7 +1293,7 @@ type types_WebhookEventName = WebhookEventName;
1228
1293
  declare const types_supportedWebhookEvents: typeof supportedWebhookEvents;
1229
1294
  declare namespace types {
1230
1295
  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 };
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 };
1296
+ export type { types_Accessory as Accessory, types_ActivityChange as ActivityChange, types_ActivityLog as ActivityLog, types_ActivityOperation as ActivityOperation, 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
1297
  }
1233
1298
 
1234
1299
  interface ListContactsResponse {
@@ -1360,6 +1425,31 @@ interface PayoutsListResponse {
1360
1425
  lastId: string | null;
1361
1426
  hasMore: boolean;
1362
1427
  }
1428
+ interface PayoutCreateResponse {
1429
+ payout: Payout;
1430
+ }
1431
+ interface CreatePayoutRequest {
1432
+ /** IDs of the seller invoices this payout is for. All must be for the same customer and have status "issued". */
1433
+ invoiceIds: string[];
1434
+ /** Payout method */
1435
+ method: "BACS" | "Cheque" | "Cash";
1436
+ /** Payout amount in cents. If not provided, defaults to the sum of amountDueInCents across all invoices. */
1437
+ amountInCents?: number;
1438
+ /** Transaction date (ISO 8601). Defaults to now. */
1439
+ transactionDate?: string;
1440
+ /** Cheque number or BACS reference */
1441
+ reference?: string | null;
1442
+ /** Optional notes */
1443
+ notes?: string | null;
1444
+ /** Account holder name (BACS only). Falls back to customer bank details or display name. */
1445
+ accountName?: string;
1446
+ /** 8-digit account number (BACS only). Falls back to customer bank details. */
1447
+ accountNumber?: string;
1448
+ /** 6-digit sort code (BACS only). Falls back to customer bank details. */
1449
+ sortCode?: string;
1450
+ /** Name on cheque (Cheque only). Falls back to customer display name. */
1451
+ chequeMadePayableTo?: string;
1452
+ }
1363
1453
 
1364
1454
  interface PaymentsListResponse {
1365
1455
  payments: Payment[];
@@ -1534,7 +1624,28 @@ interface AddExtraPayload {
1534
1624
  passthroughFundsToCustomerId?: string | null;
1535
1625
  }
1536
1626
 
1627
+ interface ActivityListResponse {
1628
+ data: ActivityLog[];
1629
+ lastId: string | null;
1630
+ hasMore: boolean;
1631
+ }
1632
+ interface ActivityListParams {
1633
+ saleId?: string;
1634
+ entityType?: string;
1635
+ entityId?: string;
1636
+ operation?: string;
1637
+ memberId?: string;
1638
+ from?: string;
1639
+ to?: string;
1640
+ limit?: number;
1641
+ lastId?: string;
1642
+ }
1643
+
1537
1644
  declare function resources(httpClient: HttpClient): {
1645
+ activity: {
1646
+ list: (marketId: string, params?: ActivityListParams) => Promise<ActivityListResponse>;
1647
+ get: (marketId: string, activityId: string) => Promise<ActivityLog>;
1648
+ };
1538
1649
  markets: {
1539
1650
  get: (marketId: string) => Promise<Market>;
1540
1651
  };
@@ -1762,6 +1873,7 @@ declare function resources(httpClient: HttpClient): {
1762
1873
  payouts: {
1763
1874
  list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
1764
1875
  get: (marketId: string, payoutId: string) => Promise<Payout>;
1876
+ create: (marketId: string, data: CreatePayoutRequest) => Promise<PayoutCreateResponse>;
1765
1877
  };
1766
1878
  search: {
1767
1879
  query: (marketId: string, query: string) => Promise<SearchResult>;
@@ -1792,6 +1904,9 @@ declare function resources(httpClient: HttpClient): {
1792
1904
  };
1793
1905
  ledger: {
1794
1906
  getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
1907
+ getTransaction: (marketId: string, transactionId: string) => Promise<LedgerTransaction>;
1908
+ getLatestTransaction: (marketId: string, account: string) => Promise<LedgerTransaction>;
1909
+ listTransactions: (marketId: string, params: ListTransactionsParams) => Promise<TransactionsListResponse>;
1795
1910
  };
1796
1911
  };
1797
1912
 
@@ -1805,6 +1920,10 @@ declare function Studio(info?: {
1805
1920
  debug?: boolean;
1806
1921
  }): {
1807
1922
  isDebugMode: boolean;
1923
+ activity: {
1924
+ list: (marketId: string, params?: ActivityListParams) => Promise<ActivityListResponse>;
1925
+ get: (marketId: string, activityId: string) => Promise<ActivityLog>;
1926
+ };
1808
1927
  markets: {
1809
1928
  get: (marketId: string) => Promise<Market>;
1810
1929
  };
@@ -2032,6 +2151,7 @@ declare function Studio(info?: {
2032
2151
  payouts: {
2033
2152
  list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
2034
2153
  get: (marketId: string, payoutId: string) => Promise<Payout>;
2154
+ create: (marketId: string, data: CreatePayoutRequest) => Promise<PayoutCreateResponse>;
2035
2155
  };
2036
2156
  search: {
2037
2157
  query: (marketId: string, query: string) => Promise<SearchResult>;
@@ -2062,6 +2182,9 @@ declare function Studio(info?: {
2062
2182
  };
2063
2183
  ledger: {
2064
2184
  getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
2185
+ getTransaction: (marketId: string, transactionId: string) => Promise<LedgerTransaction>;
2186
+ getLatestTransaction: (marketId: string, account: string) => Promise<LedgerTransaction>;
2187
+ listTransactions: (marketId: string, params: ListTransactionsParams) => Promise<TransactionsListResponse>;
2065
2188
  };
2066
2189
  };
2067
2190
 
package/dist/index.esm.js CHANGED
@@ -70,7 +70,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
70
70
  }
71
71
 
72
72
  // Path: studiojs/src/resources/markets.ts
73
- function create$m(_) {
73
+ function create$n(_) {
74
74
  const actions = {
75
75
  /***
76
76
  * This is used to construct the action from the request body
@@ -100,6 +100,58 @@ function create$m(_) {
100
100
  return actions;
101
101
  }
102
102
 
103
+ function create$m(httpClient) {
104
+ let activity = {
105
+ /**
106
+ * List activity logs for a market with pagination and filtering
107
+ * @param marketId - ID of the market
108
+ * @param params - Optional filtering and pagination parameters
109
+ * @returns Paginated list of activity logs
110
+ */
111
+ list: async (marketId, params) => {
112
+ let queryParams = {};
113
+ if (params === null || params === void 0 ? void 0 : params.saleId) {
114
+ queryParams.saleId = params.saleId;
115
+ }
116
+ if (params === null || params === void 0 ? void 0 : params.entityType) {
117
+ queryParams.entityType = params.entityType;
118
+ }
119
+ if (params === null || params === void 0 ? void 0 : params.entityId) {
120
+ queryParams.entityId = params.entityId;
121
+ }
122
+ if (params === null || params === void 0 ? void 0 : params.operation) {
123
+ queryParams.operation = params.operation;
124
+ }
125
+ if (params === null || params === void 0 ? void 0 : params.memberId) {
126
+ queryParams.memberId = params.memberId;
127
+ }
128
+ if (params === null || params === void 0 ? void 0 : params.from) {
129
+ queryParams.from = params.from;
130
+ }
131
+ if (params === null || params === void 0 ? void 0 : params.to) {
132
+ queryParams.to = params.to;
133
+ }
134
+ if ((params === null || params === void 0 ? void 0 : params.limit) !== undefined) {
135
+ queryParams.limit = String(params.limit);
136
+ }
137
+ if (params === null || params === void 0 ? void 0 : params.lastId) {
138
+ queryParams.lastId = params.lastId;
139
+ }
140
+ return httpClient.get(`/${marketId}/activity`, queryParams);
141
+ },
142
+ /**
143
+ * Get a specific activity log by ID
144
+ * @param marketId - ID of the market
145
+ * @param activityId - ID of the activity log entry
146
+ * @returns The activity log details
147
+ */
148
+ get: async (marketId, activityId) => {
149
+ return httpClient.get(`/${marketId}/activity/${activityId}`);
150
+ },
151
+ };
152
+ return activity;
153
+ }
154
+
103
155
  function create$l(httpClient) {
104
156
  return {
105
157
  list: async (marketId) => {
@@ -5218,6 +5270,17 @@ function create$a(httpClient) {
5218
5270
  get: async (marketId, payoutId) => {
5219
5271
  return httpClient.get(`/${marketId}/payouts/${payoutId}`);
5220
5272
  },
5273
+ /**
5274
+ * Create a payout for one or more seller invoices.
5275
+ * Use this to re-create a payout after voiding (e.g., lost cheque).
5276
+ * Payment details will fall back to customer defaults if not provided.
5277
+ * @param marketId - ID of the market
5278
+ * @param data - Payout creation data
5279
+ * @returns The created payout
5280
+ */
5281
+ create: async (marketId, data) => {
5282
+ return httpClient.post(`/${marketId}/payouts`, data);
5283
+ },
5221
5284
  };
5222
5285
  return payouts;
5223
5286
  }
@@ -5389,12 +5452,52 @@ function create(httpClient) {
5389
5452
  getBalance: async (marketId, account) => {
5390
5453
  return httpClient.get(`/${marketId}/ledger/balance`, { account });
5391
5454
  },
5455
+ /**
5456
+ * Get a transaction by ID
5457
+ * @param marketId - ID of the market
5458
+ * @param transactionId - ID of the transaction
5459
+ * @returns The transaction details
5460
+ */
5461
+ getTransaction: async (marketId, transactionId) => {
5462
+ return httpClient.get(`/${marketId}/ledger/transactions/${transactionId}`);
5463
+ },
5464
+ /**
5465
+ * Get the latest transaction on an account
5466
+ * @param marketId - ID of the market
5467
+ * @param account - Full account string (format: owner:accountType:accountName)
5468
+ * @returns The latest transaction on the account
5469
+ */
5470
+ getLatestTransaction: async (marketId, account) => {
5471
+ return httpClient.get(`/${marketId}/ledger/transactions/latest`, { account });
5472
+ },
5473
+ /**
5474
+ * List transactions for an account with optional date range and pagination
5475
+ * @param marketId - ID of the market
5476
+ * @param params - Query parameters
5477
+ * @param params.account - Full account string (format: owner:accountType:accountName)
5478
+ * @param params.dateFrom - Optional start date (ISO 8601 format, e.g. "2024-01-01")
5479
+ * @param params.dateTo - Optional end date (ISO 8601 format, e.g. "2024-12-31")
5480
+ * @param params.limit - Optional max results (default 50, max 100)
5481
+ * @param params.cursor - Optional cursor for pagination
5482
+ * @returns List of transactions with pagination info
5483
+ */
5484
+ listTransactions: async (marketId, params) => {
5485
+ let queryParams = {
5486
+ account: params.account,
5487
+ dateFrom: params.dateFrom,
5488
+ dateTo: params.dateTo,
5489
+ limit: params.limit,
5490
+ cursor: params.cursor,
5491
+ };
5492
+ return httpClient.get(`/${marketId}/ledger/transactions`, queryParams);
5493
+ },
5392
5494
  };
5393
5495
  return ledger;
5394
5496
  }
5395
5497
 
5396
5498
  function resources(httpClient) {
5397
5499
  return {
5500
+ activity: create$m(httpClient),
5398
5501
  markets: create$c(httpClient),
5399
5502
  sales: create$8(httpClient),
5400
5503
  lots: create$d(httpClient),
@@ -5402,7 +5505,7 @@ function resources(httpClient) {
5402
5505
  carts: create$k(httpClient),
5403
5506
  cph: create$2(httpClient),
5404
5507
  webhooks: create$3(),
5405
- actions: create$m(),
5508
+ actions: create$n(),
5406
5509
  bidderApplications: create$i(httpClient),
5407
5510
  settings: create$5(httpClient),
5408
5511
  adjustments: create$l(httpClient),
@@ -5890,4 +5993,3 @@ function incrementAlphaSequence(alpha) {
5890
5993
  }
5891
5994
 
5892
5995
  export { EarTag, Studio, StudioHeaders, types as StudioTypes, createAppManifest, Studio as default, lotComparator, nextLotNumber, sortByLotNumber };
5893
- //# sourceMappingURL=index.esm.js.map
package/dist/index.js CHANGED
@@ -74,7 +74,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
74
74
  }
75
75
 
76
76
  // Path: studiojs/src/resources/markets.ts
77
- function create$m(_) {
77
+ function create$n(_) {
78
78
  const actions = {
79
79
  /***
80
80
  * This is used to construct the action from the request body
@@ -104,6 +104,58 @@ function create$m(_) {
104
104
  return actions;
105
105
  }
106
106
 
107
+ function create$m(httpClient) {
108
+ let activity = {
109
+ /**
110
+ * List activity logs for a market with pagination and filtering
111
+ * @param marketId - ID of the market
112
+ * @param params - Optional filtering and pagination parameters
113
+ * @returns Paginated list of activity logs
114
+ */
115
+ list: async (marketId, params) => {
116
+ let queryParams = {};
117
+ if (params === null || params === void 0 ? void 0 : params.saleId) {
118
+ queryParams.saleId = params.saleId;
119
+ }
120
+ if (params === null || params === void 0 ? void 0 : params.entityType) {
121
+ queryParams.entityType = params.entityType;
122
+ }
123
+ if (params === null || params === void 0 ? void 0 : params.entityId) {
124
+ queryParams.entityId = params.entityId;
125
+ }
126
+ if (params === null || params === void 0 ? void 0 : params.operation) {
127
+ queryParams.operation = params.operation;
128
+ }
129
+ if (params === null || params === void 0 ? void 0 : params.memberId) {
130
+ queryParams.memberId = params.memberId;
131
+ }
132
+ if (params === null || params === void 0 ? void 0 : params.from) {
133
+ queryParams.from = params.from;
134
+ }
135
+ if (params === null || params === void 0 ? void 0 : params.to) {
136
+ queryParams.to = params.to;
137
+ }
138
+ if ((params === null || params === void 0 ? void 0 : params.limit) !== undefined) {
139
+ queryParams.limit = String(params.limit);
140
+ }
141
+ if (params === null || params === void 0 ? void 0 : params.lastId) {
142
+ queryParams.lastId = params.lastId;
143
+ }
144
+ return httpClient.get(`/${marketId}/activity`, queryParams);
145
+ },
146
+ /**
147
+ * Get a specific activity log by ID
148
+ * @param marketId - ID of the market
149
+ * @param activityId - ID of the activity log entry
150
+ * @returns The activity log details
151
+ */
152
+ get: async (marketId, activityId) => {
153
+ return httpClient.get(`/${marketId}/activity/${activityId}`);
154
+ },
155
+ };
156
+ return activity;
157
+ }
158
+
107
159
  function create$l(httpClient) {
108
160
  return {
109
161
  list: async (marketId) => {
@@ -5222,6 +5274,17 @@ function create$a(httpClient) {
5222
5274
  get: async (marketId, payoutId) => {
5223
5275
  return httpClient.get(`/${marketId}/payouts/${payoutId}`);
5224
5276
  },
5277
+ /**
5278
+ * Create a payout for one or more seller invoices.
5279
+ * Use this to re-create a payout after voiding (e.g., lost cheque).
5280
+ * Payment details will fall back to customer defaults if not provided.
5281
+ * @param marketId - ID of the market
5282
+ * @param data - Payout creation data
5283
+ * @returns The created payout
5284
+ */
5285
+ create: async (marketId, data) => {
5286
+ return httpClient.post(`/${marketId}/payouts`, data);
5287
+ },
5225
5288
  };
5226
5289
  return payouts;
5227
5290
  }
@@ -5393,12 +5456,52 @@ function create(httpClient) {
5393
5456
  getBalance: async (marketId, account) => {
5394
5457
  return httpClient.get(`/${marketId}/ledger/balance`, { account });
5395
5458
  },
5459
+ /**
5460
+ * Get a transaction by ID
5461
+ * @param marketId - ID of the market
5462
+ * @param transactionId - ID of the transaction
5463
+ * @returns The transaction details
5464
+ */
5465
+ getTransaction: async (marketId, transactionId) => {
5466
+ return httpClient.get(`/${marketId}/ledger/transactions/${transactionId}`);
5467
+ },
5468
+ /**
5469
+ * Get the latest transaction on an account
5470
+ * @param marketId - ID of the market
5471
+ * @param account - Full account string (format: owner:accountType:accountName)
5472
+ * @returns The latest transaction on the account
5473
+ */
5474
+ getLatestTransaction: async (marketId, account) => {
5475
+ return httpClient.get(`/${marketId}/ledger/transactions/latest`, { account });
5476
+ },
5477
+ /**
5478
+ * List transactions for an account with optional date range and pagination
5479
+ * @param marketId - ID of the market
5480
+ * @param params - Query parameters
5481
+ * @param params.account - Full account string (format: owner:accountType:accountName)
5482
+ * @param params.dateFrom - Optional start date (ISO 8601 format, e.g. "2024-01-01")
5483
+ * @param params.dateTo - Optional end date (ISO 8601 format, e.g. "2024-12-31")
5484
+ * @param params.limit - Optional max results (default 50, max 100)
5485
+ * @param params.cursor - Optional cursor for pagination
5486
+ * @returns List of transactions with pagination info
5487
+ */
5488
+ listTransactions: async (marketId, params) => {
5489
+ let queryParams = {
5490
+ account: params.account,
5491
+ dateFrom: params.dateFrom,
5492
+ dateTo: params.dateTo,
5493
+ limit: params.limit,
5494
+ cursor: params.cursor,
5495
+ };
5496
+ return httpClient.get(`/${marketId}/ledger/transactions`, queryParams);
5497
+ },
5396
5498
  };
5397
5499
  return ledger;
5398
5500
  }
5399
5501
 
5400
5502
  function resources(httpClient) {
5401
5503
  return {
5504
+ activity: create$m(httpClient),
5402
5505
  markets: create$c(httpClient),
5403
5506
  sales: create$8(httpClient),
5404
5507
  lots: create$d(httpClient),
@@ -5406,7 +5509,7 @@ function resources(httpClient) {
5406
5509
  carts: create$k(httpClient),
5407
5510
  cph: create$2(httpClient),
5408
5511
  webhooks: create$3(),
5409
- actions: create$m(),
5512
+ actions: create$n(),
5410
5513
  bidderApplications: create$i(httpClient),
5411
5514
  settings: create$5(httpClient),
5412
5515
  adjustments: create$l(httpClient),
@@ -5902,4 +6005,3 @@ exports.default = Studio;
5902
6005
  exports.lotComparator = lotComparator;
5903
6006
  exports.nextLotNumber = nextLotNumber;
5904
6007
  exports.sortByLotNumber = sortByLotNumber;
5905
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,35 @@
1
+ import { HttpClient } from "../net/http";
2
+ import { ActivityLog } from "../types";
3
+ export interface ActivityListResponse {
4
+ data: ActivityLog[];
5
+ lastId: string | null;
6
+ hasMore: boolean;
7
+ }
8
+ export interface ActivityListParams {
9
+ saleId?: string;
10
+ entityType?: string;
11
+ entityId?: string;
12
+ operation?: string;
13
+ memberId?: string;
14
+ from?: string;
15
+ to?: string;
16
+ limit?: number;
17
+ lastId?: string;
18
+ }
19
+ export default function create(httpClient: HttpClient): {
20
+ /**
21
+ * List activity logs for a market with pagination and filtering
22
+ * @param marketId - ID of the market
23
+ * @param params - Optional filtering and pagination parameters
24
+ * @returns Paginated list of activity logs
25
+ */
26
+ list: (marketId: string, params?: ActivityListParams) => Promise<ActivityListResponse>;
27
+ /**
28
+ * Get a specific activity log by ID
29
+ * @param marketId - ID of the market
30
+ * @param activityId - ID of the activity log entry
31
+ * @returns The activity log details
32
+ */
33
+ get: (marketId: string, activityId: string) => Promise<ActivityLog>;
34
+ };
35
+ export type Activity = ReturnType<typeof create>;
@@ -2,6 +2,44 @@ import { HttpClient } from "../net/http";
2
2
  export interface LedgerBalanceResponse {
3
3
  balanceInCents: number;
4
4
  }
5
+ export interface LedgerTransaction {
6
+ id: string;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ transactionDate: string;
10
+ marketId: string;
11
+ account: string;
12
+ rollUpAccounts: string[];
13
+ accountType: "income" | "expense" | "asset" | "liability" | "equity";
14
+ accountName: string;
15
+ owner: "market" | string;
16
+ isMarketAccount: boolean;
17
+ amountInCents: number;
18
+ batchId: string;
19
+ batchDescription: string;
20
+ referenceId: string;
21
+ referenceType: string;
22
+ referenceTxnCount: number;
23
+ referenceGroupKey: string;
24
+ tags: Record<string, string | number | boolean>;
25
+ parentTransactionId: string | null;
26
+ currentBalanceInCents: number;
27
+ sumOfCreditsInCents: number;
28
+ sumOfDebitsInCents: number;
29
+ index: number;
30
+ }
31
+ export interface TransactionsListResponse {
32
+ transactions: LedgerTransaction[];
33
+ nextCursor: string | null;
34
+ hasMore: boolean;
35
+ }
36
+ export interface ListTransactionsParams {
37
+ account: string;
38
+ dateFrom?: string;
39
+ dateTo?: string;
40
+ limit?: number;
41
+ cursor?: string;
42
+ }
5
43
  export default function create(httpClient: HttpClient): {
6
44
  /**
7
45
  * Get the current balance for a ledger account
@@ -11,5 +49,31 @@ export default function create(httpClient: HttpClient): {
11
49
  * @returns The current balance in cents
12
50
  */
13
51
  getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
52
+ /**
53
+ * Get a transaction by ID
54
+ * @param marketId - ID of the market
55
+ * @param transactionId - ID of the transaction
56
+ * @returns The transaction details
57
+ */
58
+ getTransaction: (marketId: string, transactionId: string) => Promise<LedgerTransaction>;
59
+ /**
60
+ * Get the latest transaction on an account
61
+ * @param marketId - ID of the market
62
+ * @param account - Full account string (format: owner:accountType:accountName)
63
+ * @returns The latest transaction on the account
64
+ */
65
+ getLatestTransaction: (marketId: string, account: string) => Promise<LedgerTransaction>;
66
+ /**
67
+ * List transactions for an account with optional date range and pagination
68
+ * @param marketId - ID of the market
69
+ * @param params - Query parameters
70
+ * @param params.account - Full account string (format: owner:accountType:accountName)
71
+ * @param params.dateFrom - Optional start date (ISO 8601 format, e.g. "2024-01-01")
72
+ * @param params.dateTo - Optional end date (ISO 8601 format, e.g. "2024-12-31")
73
+ * @param params.limit - Optional max results (default 50, max 100)
74
+ * @param params.cursor - Optional cursor for pagination
75
+ * @returns List of transactions with pagination info
76
+ */
77
+ listTransactions: (marketId: string, params: ListTransactionsParams) => Promise<TransactionsListResponse>;
14
78
  };
15
79
  export type Ledger = ReturnType<typeof create>;