@marteye/studiojs 1.1.47 → 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 +101 -23
- package/dist/__tests__/activity.test.d.ts +1 -0
- package/dist/__tests__/cattlePassport.test.d.ts +1 -0
- package/dist/__tests__/customerLists.test.d.ts +1 -0
- package/dist/__tests__/customerLists.unit.test.d.ts +1 -0
- package/dist/__tests__/eartag.test.d.ts +1 -0
- package/dist/__tests__/lot-util.test.d.ts +1 -0
- package/dist/__tests__/lots.test.d.ts +1 -0
- package/dist/__tests__/markets.test.d.ts +1 -0
- package/dist/__tests__/media.test.d.ts +1 -0
- package/dist/__tests__/sales.test.d.ts +1 -0
- package/dist/__tests__/studio.test.d.ts +311 -0
- package/dist/index.d.ts +13 -2706
- package/dist/index.esm.js +90 -90
- package/dist/index.js +90 -90
- package/dist/resources/broadcast.d.ts +7 -0
- package/dist/resources/sales.d.ts +2 -0
- package/dist/resources.d.ts +6 -4
- package/dist/studio.d.ts +6 -4
- package/dist/types.d.ts +81 -0
- package/package.json +3 -2
- package/dist/resources/sms.d.ts +0 -7
package/README.md
CHANGED
|
@@ -1,52 +1,130 @@
|
|
|
1
|
-
# MartEye Studio JavaScript SDK (
|
|
1
|
+
# MartEye Studio JavaScript SDK (`@marteye/studiojs`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
JavaScript/TypeScript SDK for the MartEye Studio API.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
You can install the library using npm or yarn:
|
|
8
|
-
|
|
9
|
-
Using npm:
|
|
10
|
-
|
|
11
7
|
```bash
|
|
12
8
|
npm install @marteye/studiojs
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
For the beta release channel:
|
|
16
12
|
|
|
17
13
|
```bash
|
|
18
|
-
|
|
14
|
+
npm install @marteye/studiojs@beta
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Create a client
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import Studio from "@marteye/studiojs";
|
|
21
|
+
|
|
22
|
+
const studio = Studio({
|
|
23
|
+
apiKey: process.env.STUDIO_API_KEY!,
|
|
24
|
+
baseUrl: "https://app.marteyestudio.com/api", // optional
|
|
25
|
+
defaultTimeout: 30000, // optional
|
|
26
|
+
debug: false, // optional
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Basic usage
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
const market = await studio.markets.get("greenfields");
|
|
34
|
+
console.log(market.name);
|
|
35
|
+
|
|
36
|
+
const sales = await studio.sales.list("greenfields", {
|
|
37
|
+
start: "2026-01-01",
|
|
38
|
+
end: "2026-12-31",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
console.log(sales.sales.length);
|
|
19
42
|
```
|
|
20
43
|
|
|
21
|
-
##
|
|
44
|
+
## Messaging
|
|
22
45
|
|
|
23
|
-
|
|
46
|
+
StudioJS now exposes a single messaging interface:
|
|
24
47
|
|
|
25
|
-
|
|
48
|
+
- `studio.broadcast.send(...)`
|
|
49
|
+
- `studio.broadcast.get(...)`
|
|
26
50
|
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
Messaging is unified by:
|
|
52
|
+
|
|
53
|
+
- `type`: `"sms" | "email"`
|
|
54
|
+
- `kind`: `"broadcast" | "statement"`
|
|
55
|
+
|
|
56
|
+
### Send an SMS broadcast
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
await studio.broadcast.send("greenfields", {
|
|
60
|
+
type: "sms",
|
|
61
|
+
kind: "broadcast",
|
|
62
|
+
message: "Sale starts at 7pm",
|
|
63
|
+
recipients: [
|
|
64
|
+
{
|
|
65
|
+
customerId: "customer-1",
|
|
66
|
+
phoneNumbers: ["+447911123456"],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Send a statement email
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
await studio.broadcast.send("greenfields", {
|
|
76
|
+
type: "email",
|
|
77
|
+
kind: "statement",
|
|
78
|
+
message: "Dear {{customerName}}, your balance is {{balance}}.",
|
|
79
|
+
recipients: [
|
|
80
|
+
{
|
|
81
|
+
customerId: "customer-1",
|
|
82
|
+
emails: ["buyer@example.com"],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
});
|
|
29
86
|
```
|
|
30
87
|
|
|
31
|
-
|
|
88
|
+
### Get task status
|
|
32
89
|
|
|
33
|
-
```
|
|
34
|
-
|
|
90
|
+
```ts
|
|
91
|
+
const task = await studio.broadcast.get("greenfields", "sms", "task-id");
|
|
92
|
+
console.log(task.status);
|
|
35
93
|
```
|
|
36
94
|
|
|
37
|
-
|
|
95
|
+
## Migration note
|
|
38
96
|
|
|
39
|
-
|
|
97
|
+
`studio.sms` has been removed in favour of `studio.broadcast`.
|
|
40
98
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
99
|
+
### Before
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
await studio.sms.sendSMS(marketId, payload);
|
|
103
|
+
await studio.sms.getSMS(marketId, smsId);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### After
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
await studio.broadcast.send(marketId, {
|
|
110
|
+
type: "sms",
|
|
111
|
+
kind: "broadcast",
|
|
112
|
+
message: "Hello",
|
|
113
|
+
recipients: [{ customerId: "c1", phoneNumbers: ["+447911123456"] }],
|
|
44
114
|
});
|
|
115
|
+
|
|
116
|
+
await studio.broadcast.get(marketId, "sms", taskId);
|
|
45
117
|
```
|
|
46
118
|
|
|
47
|
-
##
|
|
119
|
+
## Types
|
|
120
|
+
|
|
121
|
+
Relevant exported types include:
|
|
48
122
|
|
|
49
|
-
|
|
123
|
+
- `BroadcastPayload`
|
|
124
|
+
- `BroadcastSendResponse`
|
|
125
|
+
- `BroadcastTask`
|
|
126
|
+
- `SMSTask`
|
|
127
|
+
- `EmailTask`
|
|
50
128
|
|
|
51
129
|
## License
|
|
52
130
|
|
|
@@ -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
|
+
};
|