@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.
@@ -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,10 +1,10 @@
1
1
  {
2
2
  "name": "@marteye/studiojs",
3
- "version": "1.1.38",
3
+ "version": "1.1.40",
4
4
  "description": "MartEye Studio JavaScript SDK",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",
7
- "main": "dist/index.js",
7
+ "main": "dist/index.cjs",
8
8
  "module": "dist/index.esm.js",
9
9
  "types": "dist/index.d.ts",
10
10
  "browser": {
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "exports": {
17
17
  ".": {
18
- "require": "./dist/index.js",
18
+ "require": "./dist/index.cjs",
19
19
  "import": "./dist/index.esm.js",
20
20
  "types": "./dist/index.d.ts"
21
21
  }