@marteye/studiojs 1.1.48-beta.0 → 1.1.48-beta.1

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/README.md CHANGED
@@ -116,29 +116,6 @@ await studio.broadcast.send(marketId, {
116
116
  await studio.broadcast.get(marketId, "sms", taskId);
117
117
  ```
118
118
 
119
- ## Reports
120
-
121
- Debt reporting is exposed under `studio.reports`.
122
-
123
- ```ts
124
- const overview = await studio.reports.getDebtOperationalOverview(
125
- "greenfields",
126
- {
127
- comparisonDays: 7,
128
- }
129
- );
130
-
131
- const behavior = await studio.reports.getDebtBehavior("greenfields", {
132
- comparisonDays: 7,
133
- });
134
-
135
- const product = await studio.reports.getDebtProduct("greenfields", {
136
- limit: 500,
137
- });
138
- ```
139
-
140
- These debt report endpoints are restricted to **Mart Owners and Admins**.
141
-
142
119
  ## Types
143
120
 
144
121
  Relevant exported types include:
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,311 @@
1
+ /// <reference types="node" />
2
+ export declare function createTestStudio(opts?: {
3
+ debug?: boolean;
4
+ }): {
5
+ TEST_CONFIG: {
6
+ apiKey: string;
7
+ marketId: string;
8
+ baseUrl: string;
9
+ timeout: number;
10
+ };
11
+ isDebugMode: boolean;
12
+ activity: {
13
+ list: (marketId: string, params?: import("../resources/activity").ActivityListParams | undefined) => Promise<import("../resources/activity").ActivityListResponse>;
14
+ get: (marketId: string, activityId: string) => Promise<import("../types").ActivityLog>;
15
+ };
16
+ broadcast: {
17
+ send: (marketId: string, data: import("../types").BroadcastPayload) => Promise<import("../types").BroadcastSendResponse>;
18
+ get: (marketId: string, type: import("../types").BroadcastType, taskId: string) => Promise<import("../types").BroadcastTask>;
19
+ };
20
+ markets: {
21
+ get: (marketId: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").Market>;
22
+ };
23
+ members: {
24
+ list: (marketId: string, params?: import("../resources/members").MembersListParams | undefined) => Promise<import("../resources/members").MembersListResponse>;
25
+ get: (marketId: string, memberId: string) => Promise<import("../resources/members").Member>;
26
+ };
27
+ sales: {
28
+ get: (marketId: string, saleId: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").Sale>;
29
+ list: (marketId: string, opts: {
30
+ start?: string | undefined;
31
+ end?: string | undefined;
32
+ }) => Promise<{
33
+ start: string;
34
+ end: string;
35
+ sales: import("../types").Sale[];
36
+ }>;
37
+ create: (marketId: string, saleData: {
38
+ name: string;
39
+ startsAt: string;
40
+ availableProductCodes: string[];
41
+ recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
42
+ martEyeSaleType?: "LIVE" | "TIMED" | null | undefined;
43
+ location?: string | null | undefined;
44
+ description?: string | null | undefined;
45
+ image?: string | null | undefined;
46
+ cover?: string | null | undefined;
47
+ templateId?: string | null | undefined;
48
+ enableLotGrouping?: boolean | undefined;
49
+ attributeDefaults?: {
50
+ [attributekey: string]: string | number | boolean;
51
+ } | undefined;
52
+ }) => Promise<{
53
+ saleId: string;
54
+ }>;
55
+ update: (marketId: string, saleId: string, data: {
56
+ name?: string | undefined;
57
+ startsAt?: string | undefined;
58
+ recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
59
+ defaultProductCode?: string | undefined;
60
+ attributeDefaults?: Record<string, any> | undefined;
61
+ publishStatus?: import("../types").SalePublishStatus | undefined;
62
+ enableLotGrouping?: boolean | undefined;
63
+ marteyeSettings?: {
64
+ description?: string | undefined;
65
+ image?: string | undefined;
66
+ logo?: string | undefined;
67
+ type: "LIVE" | "TIMED";
68
+ location?: string | null | undefined;
69
+ descriptionLines?: string[] | undefined;
70
+ descriptionLink?: string | undefined;
71
+ deposit?: number | undefined;
72
+ hidePrices?: boolean | undefined;
73
+ hideReplay?: boolean | undefined;
74
+ labels?: string[] | undefined;
75
+ tags?: string[] | undefined;
76
+ details?: {
77
+ markdownBase64: string;
78
+ title: string;
79
+ }[] | undefined;
80
+ cover?: string | undefined;
81
+ primaryColour?: string | undefined;
82
+ secondaryColour?: string | undefined;
83
+ foregroundColour?: string | undefined;
84
+ extensionTime?: number | undefined;
85
+ incrementLadder?: {
86
+ max: number;
87
+ increment: number;
88
+ }[] | undefined;
89
+ hideNav?: boolean | undefined;
90
+ signInOverrideLink?: string | undefined;
91
+ published?: boolean | undefined;
92
+ pin?: boolean | undefined;
93
+ cascade?: boolean | undefined;
94
+ reportEmail?: string | undefined;
95
+ queueLots?: boolean | undefined;
96
+ markSubjectLotsAsSold?: boolean | undefined;
97
+ } | null | undefined;
98
+ }) => Promise<import("../types").Sale>;
99
+ };
100
+ lots: {
101
+ get: (marketId: string, saleId: string, lotId: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").Lot>;
102
+ list: (marketId: string, saleId: string, filters?: {
103
+ group?: string | undefined;
104
+ productCode?: string | undefined;
105
+ saleStatus?: import("../types").LotSaleStatus | undefined;
106
+ sellerCustomerId?: string | undefined;
107
+ buyerCustomerId?: string | undefined;
108
+ } | undefined) => Promise<import("../types").Lot[]>;
109
+ create: (marketId: string, saleId: string, data: {
110
+ index?: number | undefined;
111
+ lotNumber?: string | undefined;
112
+ group?: string | undefined;
113
+ productCode?: string | undefined;
114
+ sellerCustomerId?: string | undefined;
115
+ attributes?: Record<string, any> | undefined;
116
+ metadata?: Record<string, any> | undefined;
117
+ buyerCustomerId?: string | undefined;
118
+ unitPriceInCents?: number | undefined;
119
+ reservePriceInCents?: number | undefined;
120
+ startingPriceInCents?: number | undefined;
121
+ startAt?: string | undefined;
122
+ endAt?: string | undefined;
123
+ previousLotNumber?: string | undefined;
124
+ saleStatus?: import("../types").LotSaleStatus | undefined;
125
+ }) => Promise<import("../types").Lot>;
126
+ update: (marketId: string, saleId: string, lotId: string, data: {
127
+ productCode?: string | undefined;
128
+ attributes?: Record<string, any> | undefined;
129
+ sellerCasual?: string | null | undefined;
130
+ sellerCustomerId?: string | null | undefined;
131
+ lotNumber?: string | null | undefined;
132
+ remarks?: string | undefined;
133
+ notes?: string | undefined;
134
+ unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
135
+ unitPriceInCents?: number | undefined;
136
+ reservePriceInCents?: number | undefined;
137
+ startingPriceInCents?: number | undefined;
138
+ buyerCasual?: string | null | undefined;
139
+ buyerCustomerId?: string | null | undefined;
140
+ startAt?: string | null | undefined;
141
+ endAt?: string | null | undefined;
142
+ saleStatus?: import("../types").LotSaleStatus | undefined;
143
+ metadata?: Record<string, any> | undefined;
144
+ inputAccessories?: Record<string, any> | undefined;
145
+ }) => Promise<import("../types").Lot>;
146
+ delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
147
+ deletePreflight: (marketId: string, saleId: string, lotId: string) => Promise<import("../types").LotDeletePreflightResponse>;
148
+ deletePreflightBatch: (marketId: string, saleId: string, lotIds: string[]) => Promise<import("../types").DeleteLotsResponse>;
149
+ deleteBatch: (marketId: string, saleId: string, lotIds: string[], confirmedLotIds?: string[] | undefined) => Promise<import("../types").DeleteLotsResponse>;
150
+ };
151
+ lotitems: {
152
+ create: (marketId: string, saleId: string, lotId: string, data: {
153
+ attributes?: Record<string, any> | undefined;
154
+ notes?: {
155
+ text: string;
156
+ }[] | undefined;
157
+ metadata?: Record<string, any> | undefined;
158
+ }) => Promise<import("../types").LotItem>;
159
+ update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
160
+ attributes?: Record<string, any> | undefined;
161
+ index?: number | undefined;
162
+ metadata?: Record<string, any> | undefined;
163
+ }) => Promise<import("../types").LotItem>;
164
+ delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
165
+ };
166
+ carts: {
167
+ get: (marketId: string, customerId: string) => Promise<import("../resources/carts").CartResponse>;
168
+ addExtra: (marketId: string, customerId: string, data: import("../resources/carts").AddExtraPayload) => Promise<import("../resources/carts").CartResponse>;
169
+ removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
170
+ };
171
+ cph: {
172
+ lookup: (marketId: string, cph: string) => Promise<import("../types").CphLookupResponse>;
173
+ };
174
+ webhooks: {
175
+ constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | null | undefined, endpointSecret: string | null | undefined) => Promise<import("../types").WebhookEvent<T>>;
176
+ };
177
+ actions: {
178
+ constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
179
+ };
180
+ bidderApplications: {
181
+ list: (marketId: string, options?: import("../resources/bidderApplications").ListApplicationsOptions | undefined) => Promise<import("../resources/bidderApplications").ListApplicationsResponse>;
182
+ get: (marketId: string, applicationId: string) => Promise<import("../types").Application>;
183
+ create: (marketId: string, applicationData: import("../resources/bidderApplications").CreateApplicationPayload) => Promise<import("../types").Application>;
184
+ update: (marketId: string, applicationId: string, updateData: import("../resources/bidderApplications").UpdateApplicationPayload) => Promise<import("../types").Application>;
185
+ approve: (marketId: string, applicationId: string, notes?: string | undefined) => Promise<import("../types").Application>;
186
+ reject: (marketId: string, applicationId: string, notes?: string | undefined) => Promise<import("../types").Application>;
187
+ unlink: (marketId: string, applicationId: string) => Promise<import("../types").Application>;
188
+ delete: (marketId: string, applicationId: string) => Promise<void>;
189
+ };
190
+ settings: {
191
+ get: (marketId: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").SettingsMarketDefaults>;
192
+ };
193
+ adjustments: {
194
+ list: (marketId: string) => Promise<import("../types").AdjustmentsConfiguration[]>;
195
+ get: (marketId: string, id: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").AdjustmentsConfiguration>;
196
+ create: (marketId: string, data: Partial<import("../types").AdjustmentsConfiguration>) => Promise<import("../types").AdjustmentsConfiguration>;
197
+ update: (marketId: string, id: string, data: Partial<import("../types").AdjustmentsConfiguration>) => Promise<import("../types").AdjustmentsConfiguration>;
198
+ };
199
+ extras: {
200
+ list: (marketId: string) => Promise<import("../types").Product[]>;
201
+ get: (marketId: string, id: string) => Promise<import("../types").Product>;
202
+ create: (marketId: string, data: import("../resources/extras").CreateExtraPayload) => Promise<import("../types").Product>;
203
+ update: (marketId: string, id: string, data: import("../resources/extras").UpdateExtraPayload) => Promise<import("../types").Product>;
204
+ };
205
+ productCodes: {
206
+ list: (marketId: string) => Promise<import("../types").ProductCodeConfiguration[]>;
207
+ get: (marketId: string, id: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").ProductCodeConfiguration>;
208
+ create: (marketId: string, data: Partial<import("../types").ProductCodeConfiguration>) => Promise<import("../types").ProductCodeConfiguration>;
209
+ update: (marketId: string, id: string, data: Partial<import("../types").ProductCodeConfiguration>) => Promise<import("../types").ProductCodeConfiguration>;
210
+ };
211
+ saleTemplates: {
212
+ list: (marketId: string) => Promise<{
213
+ templates: import("../types").SaleTemplate[];
214
+ }>;
215
+ get: (marketId: string, templateId: string) => Promise<{
216
+ template: import("../types").SaleTemplate;
217
+ }>;
218
+ create: (marketId: string, body: {
219
+ saleId: string;
220
+ name: string;
221
+ description?: string | null | undefined;
222
+ }) => Promise<{
223
+ templateId: string;
224
+ }>;
225
+ update: (marketId: string, templateId: string, body: {
226
+ name?: string | undefined;
227
+ description?: string | null | undefined;
228
+ }) => Promise<{
229
+ template: import("../types").SaleTemplate;
230
+ }>;
231
+ delete: (marketId: string, templateId: string) => Promise<{
232
+ success: boolean;
233
+ }>;
234
+ };
235
+ taxRates: {
236
+ list: (marketId: string) => Promise<import("../types").TaxRate[]>;
237
+ get: (marketId: string, id: string) => Promise<import("../types").TaxRate>;
238
+ };
239
+ customers: {
240
+ list: (marketId: string, lastId?: string | null | undefined) => Promise<import("../resources/customers").CustomersListResponse>;
241
+ get: (marketId: string, customerId: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").Customer>;
242
+ avatar: (marketId: string, customerId: string) => Promise<import("../types").Customer>;
243
+ create: (marketId: string, customerData: import("..").CreateCustomerPayload) => Promise<import("../types").Customer>;
244
+ update: (marketId: string, customerId: string, customerData: import("..").UpdateCustomerPayload) => Promise<import("../types").Customer>;
245
+ getByAccountNumber: (marketId: string, accountNumber: string) => Promise<import("../types").Customer | null>;
246
+ getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<import("../types").Customer | null>;
247
+ };
248
+ customerLists: {
249
+ list: (marketId: string, options?: import("..").CustomerListsListOptions | undefined) => Promise<import("..").CustomerListsListResponse>;
250
+ listAll: (marketId: string, options?: Omit<import("..").CustomerListsListOptions, "offset"> | undefined) => Promise<import("..").CustomerList[]>;
251
+ get: (marketId: string, listId: string) => Promise<import("..").CustomerList>;
252
+ getBySlug: (marketId: string, slug: string) => Promise<import("..").CustomerList>;
253
+ create: (marketId: string, payload: import("..").CreateCustomerListPayload) => Promise<import("..").CustomerList>;
254
+ update: (marketId: string, listId: string, payload: import("..").UpdateCustomerListPayload) => Promise<import("..").CustomerList>;
255
+ delete: (marketId: string, listId: string) => Promise<import("..").CustomerListDeleteResponse>;
256
+ refresh: (marketId: string, listId: string) => Promise<import("..").CustomerListRefreshResponse>;
257
+ getMembers: (marketId: string, listId: string, options?: import("..").CustomerListMembersOptions | undefined) => Promise<import("..").CustomerListMembersResponse>;
258
+ getAllMembers: (marketId: string, listId: string, options?: Omit<import("..").CustomerListMembersOptions, "offset"> | undefined) => Promise<import("..").CustomerListMember[]>;
259
+ addMembers: (marketId: string, listId: string, customerIds: string[]) => Promise<import("..").CustomerListAddMembersResponse>;
260
+ removeMember: (marketId: string, listId: string, customerId: string) => Promise<import("..").CustomerListRemoveMemberResponse>;
261
+ preview: (marketId: string, filters: import("..").CustomerListFilters) => Promise<import("..").CustomerListPreviewResponse>;
262
+ listProductCodes: (marketId: string) => Promise<import("..").CustomerListProductCodesResponse>;
263
+ view: (marketId: string, listIdOrSlug: string, options?: import("..").CustomerListViewOptions | undefined) => Promise<import("..").CustomerListViewResult>;
264
+ };
265
+ invoices: {
266
+ list: (marketId: string, lastId?: string | null | undefined) => Promise<import("../resources/invoices").InvoicesListResponse>;
267
+ get: (marketId: string, invoiceId: string, options?: import("../types").ReadOptions | undefined) => Promise<import("../types").Invoice>;
268
+ };
269
+ payments: {
270
+ list: (marketId: string, lastId?: string | null | undefined) => Promise<import("../resources/payments").PaymentsListResponse>;
271
+ get: (marketId: string, paymentId: string) => Promise<import("../types").Payment>;
272
+ };
273
+ payouts: {
274
+ list: (marketId: string, lastId?: string | null | undefined) => Promise<import("../resources/payouts").PayoutsListResponse>;
275
+ get: (marketId: string, payoutId: string) => Promise<import("../types").Payout>;
276
+ create: (marketId: string, data: import("../resources/payouts").CreatePayoutRequest) => Promise<import("../resources/payouts").PayoutCreateResponse>;
277
+ };
278
+ search: {
279
+ query: (marketId: string, query: string) => Promise<import("../resources/search").SearchResult>;
280
+ };
281
+ files: {
282
+ uploadSingleFile: (input: import("../utils/multipart-upload").SingleFileInput, token: string) => Promise<{
283
+ message: string;
284
+ data: import("../types").Media;
285
+ }>;
286
+ uploadMultipartFile: (input: import("../index.common").FileInput | import("../index.common").ChunkedInput, token: string) => Promise<{
287
+ message: string;
288
+ mediaType: string;
289
+ process: import("../utils/multipart-upload").VariantProcessingState;
290
+ }>;
291
+ deleteFile: (fileUrl: string, token: string) => Promise<{
292
+ data: boolean;
293
+ }>;
294
+ };
295
+ contacts: {
296
+ list: (marketId: string, customerId: string, params?: {
297
+ lastId?: string | undefined;
298
+ limit?: number | undefined;
299
+ } | undefined) => Promise<import("../resources/contacts").ListContactsResponse>;
300
+ get: (marketId: string, customerId: string, contactId: string) => Promise<import("../types").CustomerContact>;
301
+ create: (marketId: string, customerId: string, payload: import("../resources/contacts").CreateOrUpdateContactPayload) => Promise<import("../types").CustomerContact>;
302
+ update: (marketId: string, customerId: string, contactId: string, payload: import("../resources/contacts").CreateOrUpdateContactPayload) => Promise<import("../types").CustomerContact>;
303
+ delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
304
+ };
305
+ ledger: {
306
+ getBalance: (marketId: string, account: string) => Promise<import("../resources/ledger").LedgerBalanceResponse>;
307
+ getTransaction: (marketId: string, transactionId: string) => Promise<import("../resources/ledger").LedgerTransaction>;
308
+ getLatestTransaction: (marketId: string, account: string) => Promise<import("../resources/ledger").LedgerTransaction>;
309
+ listTransactions: (marketId: string, params: import("../resources/ledger").ListTransactionsParams) => Promise<import("../resources/ledger").TransactionsListResponse>;
310
+ };
311
+ };