@marteye/studiojs 1.1.38 → 1.1.39

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.
@@ -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>;
@@ -5,6 +5,31 @@ export interface PayoutsListResponse {
5
5
  lastId: string | null;
6
6
  hasMore: boolean;
7
7
  }
8
+ export interface PayoutCreateResponse {
9
+ payout: Payout;
10
+ }
11
+ export interface CreatePayoutRequest {
12
+ /** IDs of the seller invoices this payout is for. All must be for the same customer and have status "issued". */
13
+ invoiceIds: string[];
14
+ /** Payout method */
15
+ method: "BACS" | "Cheque" | "Cash";
16
+ /** Payout amount in cents. If not provided, defaults to the sum of amountDueInCents across all invoices. */
17
+ amountInCents?: number;
18
+ /** Transaction date (ISO 8601). Defaults to now. */
19
+ transactionDate?: string;
20
+ /** Cheque number or BACS reference */
21
+ reference?: string | null;
22
+ /** Optional notes */
23
+ notes?: string | null;
24
+ /** Account holder name (BACS only). Falls back to customer bank details or display name. */
25
+ accountName?: string;
26
+ /** 8-digit account number (BACS only). Falls back to customer bank details. */
27
+ accountNumber?: string;
28
+ /** 6-digit sort code (BACS only). Falls back to customer bank details. */
29
+ sortCode?: string;
30
+ /** Name on cheque (Cheque only). Falls back to customer display name. */
31
+ chequeMadePayableTo?: string;
32
+ }
8
33
  export default function create(httpClient: HttpClient): {
9
34
  /**
10
35
  * List all payouts for a market with pagination
@@ -20,5 +45,14 @@ export default function create(httpClient: HttpClient): {
20
45
  * @returns The payout details
21
46
  */
22
47
  get: (marketId: string, payoutId: string) => Promise<Payout>;
48
+ /**
49
+ * Create a payout for one or more seller invoices.
50
+ * Use this to re-create a payout after voiding (e.g., lost cheque).
51
+ * Payment details will fall back to customer defaults if not provided.
52
+ * @param marketId - ID of the market
53
+ * @param data - Payout creation data
54
+ * @returns The created payout
55
+ */
56
+ create: (marketId: string, data: CreatePayoutRequest) => Promise<PayoutCreateResponse>;
23
57
  };
24
58
  export type Payouts = ReturnType<typeof create>;
@@ -1,5 +1,9 @@
1
1
  import type { HttpClient } from "./net/http";
2
2
  export default function resources(httpClient: HttpClient): {
3
+ activity: {
4
+ list: (marketId: string, params?: import("./resources/activity").ActivityListParams) => Promise<import("./resources/activity").ActivityListResponse>;
5
+ get: (marketId: string, activityId: string) => Promise<import("./types").ActivityLog>;
6
+ };
3
7
  markets: {
4
8
  get: (marketId: string) => Promise<import("./types").Market>;
5
9
  };
@@ -227,6 +231,7 @@ export default function resources(httpClient: HttpClient): {
227
231
  payouts: {
228
232
  list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payouts").PayoutsListResponse>;
229
233
  get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
234
+ create: (marketId: string, data: import("./resources/payouts").CreatePayoutRequest) => Promise<import("./resources/payouts").PayoutCreateResponse>;
230
235
  };
231
236
  search: {
232
237
  query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
@@ -257,5 +262,8 @@ export default function resources(httpClient: HttpClient): {
257
262
  };
258
263
  ledger: {
259
264
  getBalance: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerBalanceResponse>;
265
+ getTransaction: (marketId: string, transactionId: string) => Promise<import("./resources/ledger").LedgerTransaction>;
266
+ getLatestTransaction: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerTransaction>;
267
+ listTransactions: (marketId: string, params: import("./resources/ledger").ListTransactionsParams) => Promise<import("./resources/ledger").TransactionsListResponse>;
260
268
  };
261
269
  };
package/dist/studio.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare function Studio(info?: {
9
9
  debug?: boolean;
10
10
  }): {
11
11
  isDebugMode: boolean;
12
+ activity: {
13
+ list: (marketId: string, params?: import("./resources/activity").ActivityListParams) => Promise<import("./resources/activity").ActivityListResponse>;
14
+ get: (marketId: string, activityId: string) => Promise<import("./types").ActivityLog>;
15
+ };
12
16
  markets: {
13
17
  get: (marketId: string) => Promise<import("./types").Market>;
14
18
  };
@@ -236,6 +240,7 @@ export declare function Studio(info?: {
236
240
  payouts: {
237
241
  list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payouts").PayoutsListResponse>;
238
242
  get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
243
+ create: (marketId: string, data: import("./resources/payouts").CreatePayoutRequest) => Promise<import("./resources/payouts").PayoutCreateResponse>;
239
244
  };
240
245
  search: {
241
246
  query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
@@ -266,5 +271,8 @@ export declare function Studio(info?: {
266
271
  };
267
272
  ledger: {
268
273
  getBalance: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerBalanceResponse>;
274
+ getTransaction: (marketId: string, transactionId: string) => Promise<import("./resources/ledger").LedgerTransaction>;
275
+ getLatestTransaction: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerTransaction>;
276
+ listTransactions: (marketId: string, params: import("./resources/ledger").ListTransactionsParams) => Promise<import("./resources/ledger").TransactionsListResponse>;
269
277
  };
270
278
  };
package/dist/types.d.ts CHANGED
@@ -134,7 +134,7 @@ export type DisplayBoardMode = "off" | "live" | "manual" | {
134
134
  type: "focused";
135
135
  field: string;
136
136
  };
137
- export type SalePublishStatus = "unpublished" | "sale" | "catalogPublished";
137
+ export type SalePublishStatus = "unpublished" | "sale" | "saleAndCatalog";
138
138
  export interface Sale {
139
139
  id: string;
140
140
  createdAt: Timestamp;
@@ -206,7 +206,7 @@ export interface Sale {
206
206
  * Publishing status for external systems
207
207
  * - unpublished: Not listed in external system
208
208
  * - sale: Sale date is listed externally
209
- * - catalogPublished: Sale and catalog information synced
209
+ * - saleAndCatalog: Sale and catalog information synced
210
210
  */
211
211
  publishStatus?: SalePublishStatus;
212
212
  }
@@ -653,6 +653,7 @@ export interface Customer {
653
653
  notes?: string;
654
654
  status?: "archived" | "deleted" | null;
655
655
  deleteAfter?: Timestamp;
656
+ casualBuyerLabels?: string[];
656
657
  }
657
658
  export interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" | "lastItemPurchaseDate" | "lastItemSaleDate"> {
658
659
  createdAt: number;
@@ -1065,6 +1066,7 @@ export interface AttributeDefinition {
1065
1066
  prefillableFromPreviousLot?: boolean;
1066
1067
  hidden?: boolean;
1067
1068
  showInSellerDetailsPanel?: boolean;
1069
+ showInSellerReviewPanel?: boolean;
1068
1070
  displayTemplate?: string;
1069
1071
  displayTemplateMultiValue?: string;
1070
1072
  type: SupportedAttributeTypes;
@@ -1115,4 +1117,26 @@ export interface CphLookupResponse {
1115
1117
  cphValid?: boolean | null;
1116
1118
  farmName?: string | null;
1117
1119
  }
1120
+ export type ActivityOperation = "created" | "updated" | "deleted" | "voided";
1121
+ export interface ActivityChange {
1122
+ before?: any;
1123
+ after?: any;
1124
+ }
1125
+ export interface ActivityLog {
1126
+ id: string;
1127
+ firstEventAt: Timestamp;
1128
+ lastEventAt: Timestamp;
1129
+ userId: string | null;
1130
+ userName?: string;
1131
+ eventType: WebhookEventName;
1132
+ entityType: ObjectType;
1133
+ entityId: string;
1134
+ entityLabel?: string;
1135
+ saleIds: string[];
1136
+ operation: ActivityOperation;
1137
+ changeCount: number;
1138
+ changes?: {
1139
+ [fieldPath: string]: ActivityChange;
1140
+ };
1141
+ }
1118
1142
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marteye/studiojs",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "MartEye Studio JavaScript SDK",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",