@marteye/studiojs 1.1.35 → 1.1.37
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.d.ts +385 -60
- package/dist/index.esm.js +258 -49
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +258 -49
- package/dist/index.js.map +1 -1
- package/dist/net/http.d.ts +1 -0
- package/dist/resources/adjustments.d.ts +2 -0
- package/dist/resources/contacts.d.ts +28 -0
- package/dist/resources/cph.d.ts +6 -0
- package/dist/resources/customers.d.ts +56 -2
- package/dist/resources/extras.d.ts +32 -0
- package/dist/resources/invoices.d.ts +24 -0
- package/dist/resources/payments.d.ts +24 -0
- package/dist/resources/payouts.d.ts +24 -0
- package/dist/resources/productCodes.d.ts +2 -0
- package/dist/resources/saleTemplates.d.ts +30 -0
- package/dist/resources/sales.d.ts +1 -0
- package/dist/resources.d.ts +62 -1
- package/dist/studio.d.ts +63 -2
- package/dist/types.d.ts +110 -26
- package/package.json +1 -1
package/dist/net/http.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export default function SimpleHttpClient(baseUrl: string, apiKey: string, fetch: any, defaultTimeout: number, debug?: boolean): {
|
|
2
2
|
get: <T>(path: string, queryParams?: any) => Promise<T>;
|
|
3
3
|
post: <T>(path: string, body: any) => Promise<T>;
|
|
4
|
+
patch: <T>(path: string, body: any) => Promise<T>;
|
|
4
5
|
delete: <T>(path: string) => Promise<T>;
|
|
5
6
|
};
|
|
6
7
|
export type HttpClient = ReturnType<typeof SimpleHttpClient>;
|
|
@@ -3,5 +3,7 @@ import { AdjustmentsConfiguration } from "../types";
|
|
|
3
3
|
export default function create(httpClient: HttpClient): {
|
|
4
4
|
list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
|
|
5
5
|
get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
|
|
6
|
+
create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
7
|
+
update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
6
8
|
};
|
|
7
9
|
export type Adjustments = ReturnType<typeof create>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { CustomerContact } from "../types";
|
|
3
|
+
export interface ListContactsResponse {
|
|
4
|
+
contacts: CustomerContact[];
|
|
5
|
+
lastId: string | null;
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateOrUpdateContactPayload {
|
|
9
|
+
id?: string;
|
|
10
|
+
displayName?: string | null;
|
|
11
|
+
email?: string | null;
|
|
12
|
+
phoneNumber?: string | null;
|
|
13
|
+
notes?: string | null;
|
|
14
|
+
marteyeUid?: string | null;
|
|
15
|
+
accountEmails?: boolean;
|
|
16
|
+
marketingEmails?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export default function create(httpClient: HttpClient): {
|
|
19
|
+
list: (marketId: string, customerId: string, params?: {
|
|
20
|
+
lastId?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}) => Promise<ListContactsResponse>;
|
|
23
|
+
get: (marketId: string, customerId: string, contactId: string) => Promise<CustomerContact>;
|
|
24
|
+
create: (marketId: string, customerId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
|
|
25
|
+
update: (marketId: string, customerId: string, contactId: string, payload: CreateOrUpdateContactPayload) => Promise<CustomerContact>;
|
|
26
|
+
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export type Contacts = ReturnType<typeof create>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { CphLookupResponse } from "../types";
|
|
3
|
+
export default function create(httpClient: HttpClient): {
|
|
4
|
+
lookup: (marketId: string, cph: string) => Promise<CphLookupResponse>;
|
|
5
|
+
};
|
|
6
|
+
export type Cph = ReturnType<typeof create>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Customer } from "../types";
|
|
2
|
+
import { Customer, InvoiceDeliveryPreference, PayoutMethod } from "../types";
|
|
3
3
|
export interface CreateCustomerPayload {
|
|
4
4
|
displayName: string;
|
|
5
5
|
email?: string;
|
|
@@ -21,16 +21,70 @@ export interface CreateCustomerPayload {
|
|
|
21
21
|
};
|
|
22
22
|
marteyeUid?: string;
|
|
23
23
|
}
|
|
24
|
+
export interface FarmAssuranceUpdate {
|
|
25
|
+
number?: string | null;
|
|
26
|
+
scheme?: string | null;
|
|
27
|
+
expiry?: string | Date | null;
|
|
28
|
+
}
|
|
29
|
+
export interface KeeperDetailsUpdate {
|
|
30
|
+
herdNumber?: string | null;
|
|
31
|
+
flockNumber?: string | null;
|
|
32
|
+
cphNumber?: string | null;
|
|
33
|
+
farmName?: string | null;
|
|
34
|
+
slapMark?: string | null;
|
|
35
|
+
farmAssurance?: {
|
|
36
|
+
cattle?: FarmAssuranceUpdate | null;
|
|
37
|
+
sheep?: FarmAssuranceUpdate | null;
|
|
38
|
+
pigs?: FarmAssuranceUpdate | null;
|
|
39
|
+
};
|
|
40
|
+
vetAttestation?: {
|
|
41
|
+
vanNumber?: string | null;
|
|
42
|
+
expiry?: string | Date | null;
|
|
43
|
+
} | null;
|
|
44
|
+
movementReporting?: {
|
|
45
|
+
fromOrigin?: boolean | null;
|
|
46
|
+
toDestination?: boolean | null;
|
|
47
|
+
} | null;
|
|
48
|
+
}
|
|
49
|
+
export interface UpdateCustomerPayload {
|
|
50
|
+
displayName?: string | null;
|
|
51
|
+
email?: {
|
|
52
|
+
email: string;
|
|
53
|
+
isVerified?: boolean;
|
|
54
|
+
createdAt?: string | Date;
|
|
55
|
+
} | null;
|
|
56
|
+
phoneNumber?: {
|
|
57
|
+
phoneNumber: string;
|
|
58
|
+
isVerified?: boolean;
|
|
59
|
+
createdAt?: string | Date;
|
|
60
|
+
} | null;
|
|
61
|
+
address?: Customer["address"] | null;
|
|
62
|
+
otherAddresses?: Customer["otherAddresses"] | null;
|
|
63
|
+
otherPhoneNumbers?: Customer["otherPhoneNumbers"] | null;
|
|
64
|
+
payoutPreference?: PayoutMethod | "none" | null;
|
|
65
|
+
invoiceDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
|
|
66
|
+
statementDeliveryPreference?: InvoiceDeliveryPreference | "none" | null;
|
|
67
|
+
bankDetails?: Customer["bankDetails"] | null;
|
|
68
|
+
preferSettleDebtsFirst?: boolean;
|
|
69
|
+
vatNumber?: string | null;
|
|
70
|
+
accountNumber?: string | null;
|
|
71
|
+
notes?: string | null;
|
|
72
|
+
attributeDefaultsBuyer?: Customer["attributeDefaultsBuyer"] | null;
|
|
73
|
+
attributeDefaultsSeller?: Customer["attributeDefaultsSeller"] | null;
|
|
74
|
+
metadata?: Customer["metadata"] | null;
|
|
75
|
+
keeperDetails?: KeeperDetailsUpdate;
|
|
76
|
+
}
|
|
24
77
|
export interface CustomersListResponse {
|
|
25
78
|
customers: Customer[];
|
|
26
79
|
lastId: string | null;
|
|
27
80
|
hasMore: boolean;
|
|
28
81
|
}
|
|
29
82
|
export default function create(httpClient: HttpClient): {
|
|
30
|
-
list: (marketId: string, lastId?: string) => Promise<CustomersListResponse>;
|
|
83
|
+
list: (marketId: string, lastId?: string | null) => Promise<CustomersListResponse>;
|
|
31
84
|
get: (marketId: string, customerId: string) => Promise<Customer>;
|
|
32
85
|
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
33
86
|
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
87
|
+
update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
|
|
34
88
|
/**
|
|
35
89
|
* Get a customer by their account number
|
|
36
90
|
* @param marketId - ID of the market the customer belongs to
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { Product } from "../types";
|
|
3
|
+
export interface CreateExtraPayload {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
taxRateId: string;
|
|
7
|
+
defaultUnitPriceInCents?: number;
|
|
8
|
+
unitPriceIncludesVat?: boolean;
|
|
9
|
+
applyToClients?: ("Seller" | "Buyer")[];
|
|
10
|
+
subtotalGroup?: string | null;
|
|
11
|
+
passThroughFundsToAnotherCustomer?: boolean;
|
|
12
|
+
isEnabled?: boolean;
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export interface UpdateExtraPayload {
|
|
16
|
+
name?: string;
|
|
17
|
+
taxRateId?: string;
|
|
18
|
+
defaultUnitPriceInCents?: number;
|
|
19
|
+
unitPriceIncludesVat?: boolean;
|
|
20
|
+
applyToClients?: ("Seller" | "Buyer")[];
|
|
21
|
+
subtotalGroup?: string | null;
|
|
22
|
+
passThroughFundsToAnotherCustomer?: boolean;
|
|
23
|
+
isEnabled?: boolean;
|
|
24
|
+
metadata?: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
export default function create(httpClient: HttpClient): {
|
|
27
|
+
list: (marketId: string) => Promise<Product[]>;
|
|
28
|
+
get: (marketId: string, id: string) => Promise<Product>;
|
|
29
|
+
create: (marketId: string, data: CreateExtraPayload) => Promise<Product>;
|
|
30
|
+
update: (marketId: string, id: string, data: UpdateExtraPayload) => Promise<Product>;
|
|
31
|
+
};
|
|
32
|
+
export type Extras = ReturnType<typeof create>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { Invoice } from "../types";
|
|
3
|
+
export interface InvoicesListResponse {
|
|
4
|
+
invoices: Invoice[];
|
|
5
|
+
lastId: string | null;
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function create(httpClient: HttpClient): {
|
|
9
|
+
/**
|
|
10
|
+
* List all invoices for a market with pagination
|
|
11
|
+
* @param marketId - ID of the market
|
|
12
|
+
* @param lastId - ID of the last invoice from previous page (for pagination)
|
|
13
|
+
* @returns Paginated list of invoices
|
|
14
|
+
*/
|
|
15
|
+
list: (marketId: string, lastId?: string | null) => Promise<InvoicesListResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a specific invoice by ID
|
|
18
|
+
* @param marketId - ID of the market
|
|
19
|
+
* @param invoiceId - ID of the invoice to fetch
|
|
20
|
+
* @returns The invoice details
|
|
21
|
+
*/
|
|
22
|
+
get: (marketId: string, invoiceId: string) => Promise<Invoice>;
|
|
23
|
+
};
|
|
24
|
+
export type Invoices = ReturnType<typeof create>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { Payment } from "../types";
|
|
3
|
+
export interface PaymentsListResponse {
|
|
4
|
+
payments: Payment[];
|
|
5
|
+
lastId: string | null;
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function create(httpClient: HttpClient): {
|
|
9
|
+
/**
|
|
10
|
+
* List all payments for a market with pagination
|
|
11
|
+
* @param marketId - ID of the market
|
|
12
|
+
* @param lastId - ID of the last payment from previous page (for pagination)
|
|
13
|
+
* @returns Paginated list of payments
|
|
14
|
+
*/
|
|
15
|
+
list: (marketId: string, lastId?: string | null) => Promise<PaymentsListResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a specific payment by ID
|
|
18
|
+
* @param marketId - ID of the market
|
|
19
|
+
* @param paymentId - ID of the payment to fetch
|
|
20
|
+
* @returns The payment details
|
|
21
|
+
*/
|
|
22
|
+
get: (marketId: string, paymentId: string) => Promise<Payment>;
|
|
23
|
+
};
|
|
24
|
+
export type Payments = ReturnType<typeof create>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { Payout } from "../types";
|
|
3
|
+
export interface PayoutsListResponse {
|
|
4
|
+
payouts: Payout[];
|
|
5
|
+
lastId: string | null;
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function create(httpClient: HttpClient): {
|
|
9
|
+
/**
|
|
10
|
+
* List all payouts for a market with pagination
|
|
11
|
+
* @param marketId - ID of the market
|
|
12
|
+
* @param lastId - ID of the last payout from previous page (for pagination)
|
|
13
|
+
* @returns Paginated list of payouts
|
|
14
|
+
*/
|
|
15
|
+
list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a specific payout by ID
|
|
18
|
+
* @param marketId - ID of the market
|
|
19
|
+
* @param payoutId - ID of the payout to fetch
|
|
20
|
+
* @returns The payout details
|
|
21
|
+
*/
|
|
22
|
+
get: (marketId: string, payoutId: string) => Promise<Payout>;
|
|
23
|
+
};
|
|
24
|
+
export type Payouts = ReturnType<typeof create>;
|
|
@@ -3,5 +3,7 @@ import { ProductCodeConfiguration } from "../types";
|
|
|
3
3
|
export default function create(httpClient: HttpClient): {
|
|
4
4
|
list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
|
|
5
5
|
get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
|
|
6
|
+
create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
7
|
+
update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
6
8
|
};
|
|
7
9
|
export type ProductCodes = ReturnType<typeof create>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { SaleTemplate } from "../types";
|
|
3
|
+
type CreateTemplateRequest = {
|
|
4
|
+
saleId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
};
|
|
8
|
+
type UpdateTemplateRequest = {
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export default function create(httpClient: HttpClient): {
|
|
13
|
+
list: (marketId: string) => Promise<{
|
|
14
|
+
templates: SaleTemplate[];
|
|
15
|
+
}>;
|
|
16
|
+
get: (marketId: string, templateId: string) => Promise<{
|
|
17
|
+
template: SaleTemplate;
|
|
18
|
+
}>;
|
|
19
|
+
create: (marketId: string, body: CreateTemplateRequest) => Promise<{
|
|
20
|
+
templateId: string;
|
|
21
|
+
}>;
|
|
22
|
+
update: (marketId: string, templateId: string, body: UpdateTemplateRequest) => Promise<{
|
|
23
|
+
template: SaleTemplate;
|
|
24
|
+
}>;
|
|
25
|
+
delete: (marketId: string, templateId: string) => Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
export type SaleTemplates = ReturnType<typeof create>;
|
|
30
|
+
export {};
|
package/dist/resources.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
23
23
|
description?: string | null;
|
|
24
24
|
image?: string | null;
|
|
25
25
|
cover?: string | null;
|
|
26
|
+
templateId?: string | null;
|
|
26
27
|
attributeDefaults?: {
|
|
27
28
|
[attributekey: string]: string | number | boolean;
|
|
28
29
|
};
|
|
@@ -134,6 +135,9 @@ export default function resources(httpClient: HttpClient): {
|
|
|
134
135
|
}) => Promise<import("./types").LotItem>;
|
|
135
136
|
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
136
137
|
};
|
|
138
|
+
cph: {
|
|
139
|
+
lookup: (marketId: string, cph: string) => Promise<import("./types").CphLookupResponse>;
|
|
140
|
+
};
|
|
137
141
|
webhooks: {
|
|
138
142
|
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<import("./types").WebhookEvent<T>>;
|
|
139
143
|
};
|
|
@@ -154,23 +158,70 @@ export default function resources(httpClient: HttpClient): {
|
|
|
154
158
|
adjustments: {
|
|
155
159
|
list: (marketId: string) => Promise<import("./types").AdjustmentsConfiguration[]>;
|
|
156
160
|
get: (marketId: string, id: string) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
161
|
+
create: (marketId: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
162
|
+
update: (marketId: string, id: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
163
|
+
};
|
|
164
|
+
extras: {
|
|
165
|
+
list: (marketId: string) => Promise<import("./types").Product[]>;
|
|
166
|
+
get: (marketId: string, id: string) => Promise<import("./types").Product>;
|
|
167
|
+
create: (marketId: string, data: import("./resources/extras").CreateExtraPayload) => Promise<import("./types").Product>;
|
|
168
|
+
update: (marketId: string, id: string, data: import("./resources/extras").UpdateExtraPayload) => Promise<import("./types").Product>;
|
|
157
169
|
};
|
|
158
170
|
productCodes: {
|
|
159
171
|
list: (marketId: string) => Promise<import("./types").ProductCodeConfiguration[]>;
|
|
160
172
|
get: (marketId: string, id: string) => Promise<import("./types").ProductCodeConfiguration>;
|
|
173
|
+
create: (marketId: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
174
|
+
update: (marketId: string, id: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
175
|
+
};
|
|
176
|
+
saleTemplates: {
|
|
177
|
+
list: (marketId: string) => Promise<{
|
|
178
|
+
templates: import("./types").SaleTemplate[];
|
|
179
|
+
}>;
|
|
180
|
+
get: (marketId: string, templateId: string) => Promise<{
|
|
181
|
+
template: import("./types").SaleTemplate;
|
|
182
|
+
}>;
|
|
183
|
+
create: (marketId: string, body: {
|
|
184
|
+
saleId: string;
|
|
185
|
+
name: string;
|
|
186
|
+
description?: string | null;
|
|
187
|
+
}) => Promise<{
|
|
188
|
+
templateId: string;
|
|
189
|
+
}>;
|
|
190
|
+
update: (marketId: string, templateId: string, body: {
|
|
191
|
+
name?: string;
|
|
192
|
+
description?: string | null;
|
|
193
|
+
}) => Promise<{
|
|
194
|
+
template: import("./types").SaleTemplate;
|
|
195
|
+
}>;
|
|
196
|
+
delete: (marketId: string, templateId: string) => Promise<{
|
|
197
|
+
success: boolean;
|
|
198
|
+
}>;
|
|
161
199
|
};
|
|
162
200
|
taxRates: {
|
|
163
201
|
list: (marketId: string) => Promise<import("./types").TaxRate[]>;
|
|
164
202
|
get: (marketId: string, id: string) => Promise<import("./types").TaxRate>;
|
|
165
203
|
};
|
|
166
204
|
customers: {
|
|
167
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
205
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
168
206
|
get: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
169
207
|
avatar: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
170
208
|
create: (marketId: string, customerData: import("./resources/customers").CreateCustomerPayload) => Promise<import("./types").Customer>;
|
|
209
|
+
update: (marketId: string, customerId: string, customerData: import("./resources/customers").UpdateCustomerPayload) => Promise<import("./types").Customer>;
|
|
171
210
|
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<import("./types").Customer | null>;
|
|
172
211
|
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<import("./types").Customer | null>;
|
|
173
212
|
};
|
|
213
|
+
invoices: {
|
|
214
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
215
|
+
get: (marketId: string, invoiceId: string) => Promise<import("./types").Invoice>;
|
|
216
|
+
};
|
|
217
|
+
payments: {
|
|
218
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payments").PaymentsListResponse>;
|
|
219
|
+
get: (marketId: string, paymentId: string) => Promise<import("./types").Payment>;
|
|
220
|
+
};
|
|
221
|
+
payouts: {
|
|
222
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payouts").PayoutsListResponse>;
|
|
223
|
+
get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
|
|
224
|
+
};
|
|
174
225
|
search: {
|
|
175
226
|
query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
|
|
176
227
|
};
|
|
@@ -188,4 +239,14 @@ export default function resources(httpClient: HttpClient): {
|
|
|
188
239
|
data: boolean;
|
|
189
240
|
}>;
|
|
190
241
|
};
|
|
242
|
+
contacts: {
|
|
243
|
+
list: (marketId: string, customerId: string, params?: {
|
|
244
|
+
lastId?: string;
|
|
245
|
+
limit?: number;
|
|
246
|
+
}) => Promise<import("./resources/contacts").ListContactsResponse>;
|
|
247
|
+
get: (marketId: string, customerId: string, contactId: string) => Promise<import("./types").CustomerContact>;
|
|
248
|
+
create: (marketId: string, customerId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
249
|
+
update: (marketId: string, customerId: string, contactId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
250
|
+
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
251
|
+
};
|
|
191
252
|
};
|
package/dist/studio.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare function Studio(info?: {
|
|
|
32
32
|
description?: string | null;
|
|
33
33
|
image?: string | null;
|
|
34
34
|
cover?: string | null;
|
|
35
|
+
templateId?: string | null;
|
|
35
36
|
attributeDefaults?: {
|
|
36
37
|
[attributekey: string]: string | number | boolean;
|
|
37
38
|
};
|
|
@@ -143,6 +144,9 @@ export declare function Studio(info?: {
|
|
|
143
144
|
}) => Promise<import("./types").LotItem>;
|
|
144
145
|
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
145
146
|
};
|
|
147
|
+
cph: {
|
|
148
|
+
lookup: (marketId: string, cph: string) => Promise<import("./types").CphLookupResponse>;
|
|
149
|
+
};
|
|
146
150
|
webhooks: {
|
|
147
151
|
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<import("./types").WebhookEvent<T>>;
|
|
148
152
|
};
|
|
@@ -163,23 +167,70 @@ export declare function Studio(info?: {
|
|
|
163
167
|
adjustments: {
|
|
164
168
|
list: (marketId: string) => Promise<import("./types").AdjustmentsConfiguration[]>;
|
|
165
169
|
get: (marketId: string, id: string) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
170
|
+
create: (marketId: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
171
|
+
update: (marketId: string, id: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
172
|
+
};
|
|
173
|
+
extras: {
|
|
174
|
+
list: (marketId: string) => Promise<import("./types").Product[]>;
|
|
175
|
+
get: (marketId: string, id: string) => Promise<import("./types").Product>;
|
|
176
|
+
create: (marketId: string, data: import("./resources/extras").CreateExtraPayload) => Promise<import("./types").Product>;
|
|
177
|
+
update: (marketId: string, id: string, data: import("./resources/extras").UpdateExtraPayload) => Promise<import("./types").Product>;
|
|
166
178
|
};
|
|
167
179
|
productCodes: {
|
|
168
180
|
list: (marketId: string) => Promise<import("./types").ProductCodeConfiguration[]>;
|
|
169
181
|
get: (marketId: string, id: string) => Promise<import("./types").ProductCodeConfiguration>;
|
|
182
|
+
create: (marketId: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
183
|
+
update: (marketId: string, id: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
184
|
+
};
|
|
185
|
+
saleTemplates: {
|
|
186
|
+
list: (marketId: string) => Promise<{
|
|
187
|
+
templates: import("./types").SaleTemplate[];
|
|
188
|
+
}>;
|
|
189
|
+
get: (marketId: string, templateId: string) => Promise<{
|
|
190
|
+
template: import("./types").SaleTemplate;
|
|
191
|
+
}>;
|
|
192
|
+
create: (marketId: string, body: {
|
|
193
|
+
saleId: string;
|
|
194
|
+
name: string;
|
|
195
|
+
description?: string | null;
|
|
196
|
+
}) => Promise<{
|
|
197
|
+
templateId: string;
|
|
198
|
+
}>;
|
|
199
|
+
update: (marketId: string, templateId: string, body: {
|
|
200
|
+
name?: string;
|
|
201
|
+
description?: string | null;
|
|
202
|
+
}) => Promise<{
|
|
203
|
+
template: import("./types").SaleTemplate;
|
|
204
|
+
}>;
|
|
205
|
+
delete: (marketId: string, templateId: string) => Promise<{
|
|
206
|
+
success: boolean;
|
|
207
|
+
}>;
|
|
170
208
|
};
|
|
171
209
|
taxRates: {
|
|
172
210
|
list: (marketId: string) => Promise<import("./types").TaxRate[]>;
|
|
173
211
|
get: (marketId: string, id: string) => Promise<import("./types").TaxRate>;
|
|
174
212
|
};
|
|
175
213
|
customers: {
|
|
176
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
214
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
177
215
|
get: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
178
216
|
avatar: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
179
|
-
create: (marketId: string, customerData: import("
|
|
217
|
+
create: (marketId: string, customerData: import(".").CreateCustomerPayload) => Promise<import("./types").Customer>;
|
|
218
|
+
update: (marketId: string, customerId: string, customerData: import(".").UpdateCustomerPayload) => Promise<import("./types").Customer>;
|
|
180
219
|
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<import("./types").Customer | null>;
|
|
181
220
|
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<import("./types").Customer | null>;
|
|
182
221
|
};
|
|
222
|
+
invoices: {
|
|
223
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
224
|
+
get: (marketId: string, invoiceId: string) => Promise<import("./types").Invoice>;
|
|
225
|
+
};
|
|
226
|
+
payments: {
|
|
227
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payments").PaymentsListResponse>;
|
|
228
|
+
get: (marketId: string, paymentId: string) => Promise<import("./types").Payment>;
|
|
229
|
+
};
|
|
230
|
+
payouts: {
|
|
231
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payouts").PayoutsListResponse>;
|
|
232
|
+
get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
|
|
233
|
+
};
|
|
183
234
|
search: {
|
|
184
235
|
query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
|
|
185
236
|
};
|
|
@@ -197,4 +248,14 @@ export declare function Studio(info?: {
|
|
|
197
248
|
data: boolean;
|
|
198
249
|
}>;
|
|
199
250
|
};
|
|
251
|
+
contacts: {
|
|
252
|
+
list: (marketId: string, customerId: string, params?: {
|
|
253
|
+
lastId?: string;
|
|
254
|
+
limit?: number;
|
|
255
|
+
}) => Promise<import("./resources/contacts").ListContactsResponse>;
|
|
256
|
+
get: (marketId: string, customerId: string, contactId: string) => Promise<import("./types").CustomerContact>;
|
|
257
|
+
create: (marketId: string, customerId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
258
|
+
update: (marketId: string, customerId: string, contactId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
259
|
+
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
260
|
+
};
|
|
200
261
|
};
|