@marteye/studiojs 1.1.36 → 1.1.38
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 +407 -67
- package/dist/index.esm.js +277 -72
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +277 -72
- 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/carts.d.ts +35 -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 +1 -1
- package/dist/resources/ledger.d.ts +15 -0
- package/dist/resources/payments.d.ts +1 -1
- package/dist/resources/payouts.d.ts +1 -1
- package/dist/resources/productCodes.d.ts +2 -0
- package/dist/resources/saleTemplates.d.ts +30 -0
- package/dist/resources/sales.d.ts +3 -1
- package/dist/resources.d.ts +62 -4
- package/dist/studio.d.ts +63 -5
- package/dist/types.d.ts +119 -26
- package/dist/utils/lots.d.ts +7 -1
- 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,35 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { CartItem, Lot } from "../types";
|
|
3
|
+
export interface LotsBySale {
|
|
4
|
+
saleId: string;
|
|
5
|
+
marketId: string;
|
|
6
|
+
lots: Lot[];
|
|
7
|
+
}
|
|
8
|
+
export interface CartResponse {
|
|
9
|
+
customerId: string;
|
|
10
|
+
extras: CartItem[];
|
|
11
|
+
lotsBuyingBySale: LotsBySale[];
|
|
12
|
+
lotsSellingBySale: LotsBySale[];
|
|
13
|
+
}
|
|
14
|
+
export interface AddExtraPayload {
|
|
15
|
+
productId: string;
|
|
16
|
+
clientType: "Seller" | "Buyer";
|
|
17
|
+
quantity: number;
|
|
18
|
+
unitPriceInCents: number;
|
|
19
|
+
passthroughFundsToCustomerId?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export default function create(httpClient: HttpClient): {
|
|
22
|
+
/**
|
|
23
|
+
* Get the full cart for a customer including extras and uninvoiced lots
|
|
24
|
+
*/
|
|
25
|
+
get: (marketId: string, customerId: string) => Promise<CartResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Add an extra product to the customer's cart
|
|
28
|
+
*/
|
|
29
|
+
addExtra: (marketId: string, customerId: string, data: AddExtraPayload) => Promise<CartResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Remove an extra from the customer's cart
|
|
32
|
+
*/
|
|
33
|
+
removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
export type Carts = 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>;
|
|
@@ -12,7 +12,7 @@ export default function create(httpClient: HttpClient): {
|
|
|
12
12
|
* @param lastId - ID of the last invoice from previous page (for pagination)
|
|
13
13
|
* @returns Paginated list of invoices
|
|
14
14
|
*/
|
|
15
|
-
list: (marketId: string, lastId?: string) => Promise<InvoicesListResponse>;
|
|
15
|
+
list: (marketId: string, lastId?: string | null) => Promise<InvoicesListResponse>;
|
|
16
16
|
/**
|
|
17
17
|
* Get a specific invoice by ID
|
|
18
18
|
* @param marketId - ID of the market
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
export interface LedgerBalanceResponse {
|
|
3
|
+
balanceInCents: number;
|
|
4
|
+
}
|
|
5
|
+
export default function create(httpClient: HttpClient): {
|
|
6
|
+
/**
|
|
7
|
+
* Get the current balance for a ledger account
|
|
8
|
+
* @param marketId - ID of the market
|
|
9
|
+
* @param account - Full account string (format: owner:accountType:accountName)
|
|
10
|
+
* e.g. "customerId:asset:trade receivable" or "market:liability:trade payable"
|
|
11
|
+
* @returns The current balance in cents
|
|
12
|
+
*/
|
|
13
|
+
getBalance: (marketId: string, account: string) => Promise<LedgerBalanceResponse>;
|
|
14
|
+
};
|
|
15
|
+
export type Ledger = ReturnType<typeof create>;
|
|
@@ -12,7 +12,7 @@ export default function create(httpClient: HttpClient): {
|
|
|
12
12
|
* @param lastId - ID of the last payment from previous page (for pagination)
|
|
13
13
|
* @returns Paginated list of payments
|
|
14
14
|
*/
|
|
15
|
-
list: (marketId: string, lastId?: string) => Promise<PaymentsListResponse>;
|
|
15
|
+
list: (marketId: string, lastId?: string | null) => Promise<PaymentsListResponse>;
|
|
16
16
|
/**
|
|
17
17
|
* Get a specific payment by ID
|
|
18
18
|
* @param marketId - ID of the market
|
|
@@ -12,7 +12,7 @@ export default function create(httpClient: HttpClient): {
|
|
|
12
12
|
* @param lastId - ID of the last payout from previous page (for pagination)
|
|
13
13
|
* @returns Paginated list of payouts
|
|
14
14
|
*/
|
|
15
|
-
list: (marketId: string, lastId?: string) => Promise<PayoutsListResponse>;
|
|
15
|
+
list: (marketId: string, lastId?: string | null) => Promise<PayoutsListResponse>;
|
|
16
16
|
/**
|
|
17
17
|
* Get a specific payout by ID
|
|
18
18
|
* @param marketId - ID of the market
|
|
@@ -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 {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Sale } from "../types";
|
|
2
|
+
import { Sale, SalePublishStatus } from "../types";
|
|
3
3
|
type SalesListResponse = {
|
|
4
4
|
start: string;
|
|
5
5
|
end: string;
|
|
@@ -18,6 +18,7 @@ type CreateSaleRequest = {
|
|
|
18
18
|
description?: string | null;
|
|
19
19
|
image?: string | null;
|
|
20
20
|
cover?: string | null;
|
|
21
|
+
templateId?: string | null;
|
|
21
22
|
attributeDefaults?: {
|
|
22
23
|
[attributekey: string]: string | number | boolean;
|
|
23
24
|
};
|
|
@@ -35,6 +36,7 @@ export default function create(httpClient: HttpClient): {
|
|
|
35
36
|
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
|
|
36
37
|
defaultProductCode?: string;
|
|
37
38
|
attributeDefaults?: Record<string, any>;
|
|
39
|
+
publishStatus?: SalePublishStatus;
|
|
38
40
|
marteyeSettings?: {
|
|
39
41
|
description?: string;
|
|
40
42
|
image?: string;
|
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
|
};
|
|
@@ -35,6 +36,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
35
36
|
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
|
|
36
37
|
defaultProductCode?: string;
|
|
37
38
|
attributeDefaults?: Record<string, any>;
|
|
39
|
+
publishStatus?: import("./types").SalePublishStatus;
|
|
38
40
|
marteyeSettings?: {
|
|
39
41
|
description?: string;
|
|
40
42
|
image?: string;
|
|
@@ -134,6 +136,14 @@ export default function resources(httpClient: HttpClient): {
|
|
|
134
136
|
}) => Promise<import("./types").LotItem>;
|
|
135
137
|
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
136
138
|
};
|
|
139
|
+
carts: {
|
|
140
|
+
get: (marketId: string, customerId: string) => Promise<import("./resources/carts").CartResponse>;
|
|
141
|
+
addExtra: (marketId: string, customerId: string, data: import("./resources/carts").AddExtraPayload) => Promise<import("./resources/carts").CartResponse>;
|
|
142
|
+
removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
|
|
143
|
+
};
|
|
144
|
+
cph: {
|
|
145
|
+
lookup: (marketId: string, cph: string) => Promise<import("./types").CphLookupResponse>;
|
|
146
|
+
};
|
|
137
147
|
webhooks: {
|
|
138
148
|
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<import("./types").WebhookEvent<T>>;
|
|
139
149
|
};
|
|
@@ -154,33 +164,68 @@ export default function resources(httpClient: HttpClient): {
|
|
|
154
164
|
adjustments: {
|
|
155
165
|
list: (marketId: string) => Promise<import("./types").AdjustmentsConfiguration[]>;
|
|
156
166
|
get: (marketId: string, id: string) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
167
|
+
create: (marketId: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
168
|
+
update: (marketId: string, id: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
169
|
+
};
|
|
170
|
+
extras: {
|
|
171
|
+
list: (marketId: string) => Promise<import("./types").Product[]>;
|
|
172
|
+
get: (marketId: string, id: string) => Promise<import("./types").Product>;
|
|
173
|
+
create: (marketId: string, data: import("./resources/extras").CreateExtraPayload) => Promise<import("./types").Product>;
|
|
174
|
+
update: (marketId: string, id: string, data: import("./resources/extras").UpdateExtraPayload) => Promise<import("./types").Product>;
|
|
157
175
|
};
|
|
158
176
|
productCodes: {
|
|
159
177
|
list: (marketId: string) => Promise<import("./types").ProductCodeConfiguration[]>;
|
|
160
178
|
get: (marketId: string, id: string) => Promise<import("./types").ProductCodeConfiguration>;
|
|
179
|
+
create: (marketId: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
180
|
+
update: (marketId: string, id: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
181
|
+
};
|
|
182
|
+
saleTemplates: {
|
|
183
|
+
list: (marketId: string) => Promise<{
|
|
184
|
+
templates: import("./types").SaleTemplate[];
|
|
185
|
+
}>;
|
|
186
|
+
get: (marketId: string, templateId: string) => Promise<{
|
|
187
|
+
template: import("./types").SaleTemplate;
|
|
188
|
+
}>;
|
|
189
|
+
create: (marketId: string, body: {
|
|
190
|
+
saleId: string;
|
|
191
|
+
name: string;
|
|
192
|
+
description?: string | null;
|
|
193
|
+
}) => Promise<{
|
|
194
|
+
templateId: string;
|
|
195
|
+
}>;
|
|
196
|
+
update: (marketId: string, templateId: string, body: {
|
|
197
|
+
name?: string;
|
|
198
|
+
description?: string | null;
|
|
199
|
+
}) => Promise<{
|
|
200
|
+
template: import("./types").SaleTemplate;
|
|
201
|
+
}>;
|
|
202
|
+
delete: (marketId: string, templateId: string) => Promise<{
|
|
203
|
+
success: boolean;
|
|
204
|
+
}>;
|
|
161
205
|
};
|
|
162
206
|
taxRates: {
|
|
163
207
|
list: (marketId: string) => Promise<import("./types").TaxRate[]>;
|
|
164
208
|
get: (marketId: string, id: string) => Promise<import("./types").TaxRate>;
|
|
165
209
|
};
|
|
166
210
|
customers: {
|
|
167
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
211
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
168
212
|
get: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
169
213
|
avatar: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
170
214
|
create: (marketId: string, customerData: import("./resources/customers").CreateCustomerPayload) => Promise<import("./types").Customer>;
|
|
215
|
+
update: (marketId: string, customerId: string, customerData: import("./resources/customers").UpdateCustomerPayload) => Promise<import("./types").Customer>;
|
|
171
216
|
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<import("./types").Customer | null>;
|
|
172
217
|
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<import("./types").Customer | null>;
|
|
173
218
|
};
|
|
174
219
|
invoices: {
|
|
175
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
220
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
176
221
|
get: (marketId: string, invoiceId: string) => Promise<import("./types").Invoice>;
|
|
177
222
|
};
|
|
178
223
|
payments: {
|
|
179
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/payments").PaymentsListResponse>;
|
|
224
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payments").PaymentsListResponse>;
|
|
180
225
|
get: (marketId: string, paymentId: string) => Promise<import("./types").Payment>;
|
|
181
226
|
};
|
|
182
227
|
payouts: {
|
|
183
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/payouts").PayoutsListResponse>;
|
|
228
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payouts").PayoutsListResponse>;
|
|
184
229
|
get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
|
|
185
230
|
};
|
|
186
231
|
search: {
|
|
@@ -200,4 +245,17 @@ export default function resources(httpClient: HttpClient): {
|
|
|
200
245
|
data: boolean;
|
|
201
246
|
}>;
|
|
202
247
|
};
|
|
248
|
+
contacts: {
|
|
249
|
+
list: (marketId: string, customerId: string, params?: {
|
|
250
|
+
lastId?: string;
|
|
251
|
+
limit?: number;
|
|
252
|
+
}) => Promise<import("./resources/contacts").ListContactsResponse>;
|
|
253
|
+
get: (marketId: string, customerId: string, contactId: string) => Promise<import("./types").CustomerContact>;
|
|
254
|
+
create: (marketId: string, customerId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
255
|
+
update: (marketId: string, customerId: string, contactId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
256
|
+
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
257
|
+
};
|
|
258
|
+
ledger: {
|
|
259
|
+
getBalance: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerBalanceResponse>;
|
|
260
|
+
};
|
|
203
261
|
};
|
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
|
};
|
|
@@ -44,6 +45,7 @@ export declare function Studio(info?: {
|
|
|
44
45
|
recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
|
|
45
46
|
defaultProductCode?: string;
|
|
46
47
|
attributeDefaults?: Record<string, any>;
|
|
48
|
+
publishStatus?: import("./types").SalePublishStatus;
|
|
47
49
|
marteyeSettings?: {
|
|
48
50
|
description?: string;
|
|
49
51
|
image?: string;
|
|
@@ -143,6 +145,14 @@ export declare function Studio(info?: {
|
|
|
143
145
|
}) => Promise<import("./types").LotItem>;
|
|
144
146
|
delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
|
|
145
147
|
};
|
|
148
|
+
carts: {
|
|
149
|
+
get: (marketId: string, customerId: string) => Promise<import("./resources/carts").CartResponse>;
|
|
150
|
+
addExtra: (marketId: string, customerId: string, data: import("./resources/carts").AddExtraPayload) => Promise<import("./resources/carts").CartResponse>;
|
|
151
|
+
removeExtra: (marketId: string, customerId: string, itemId: string) => Promise<void>;
|
|
152
|
+
};
|
|
153
|
+
cph: {
|
|
154
|
+
lookup: (marketId: string, cph: string) => Promise<import("./types").CphLookupResponse>;
|
|
155
|
+
};
|
|
146
156
|
webhooks: {
|
|
147
157
|
constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<import("./types").WebhookEvent<T>>;
|
|
148
158
|
};
|
|
@@ -163,33 +173,68 @@ export declare function Studio(info?: {
|
|
|
163
173
|
adjustments: {
|
|
164
174
|
list: (marketId: string) => Promise<import("./types").AdjustmentsConfiguration[]>;
|
|
165
175
|
get: (marketId: string, id: string) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
176
|
+
create: (marketId: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
177
|
+
update: (marketId: string, id: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
178
|
+
};
|
|
179
|
+
extras: {
|
|
180
|
+
list: (marketId: string) => Promise<import("./types").Product[]>;
|
|
181
|
+
get: (marketId: string, id: string) => Promise<import("./types").Product>;
|
|
182
|
+
create: (marketId: string, data: import("./resources/extras").CreateExtraPayload) => Promise<import("./types").Product>;
|
|
183
|
+
update: (marketId: string, id: string, data: import("./resources/extras").UpdateExtraPayload) => Promise<import("./types").Product>;
|
|
166
184
|
};
|
|
167
185
|
productCodes: {
|
|
168
186
|
list: (marketId: string) => Promise<import("./types").ProductCodeConfiguration[]>;
|
|
169
187
|
get: (marketId: string, id: string) => Promise<import("./types").ProductCodeConfiguration>;
|
|
188
|
+
create: (marketId: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
189
|
+
update: (marketId: string, id: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
190
|
+
};
|
|
191
|
+
saleTemplates: {
|
|
192
|
+
list: (marketId: string) => Promise<{
|
|
193
|
+
templates: import("./types").SaleTemplate[];
|
|
194
|
+
}>;
|
|
195
|
+
get: (marketId: string, templateId: string) => Promise<{
|
|
196
|
+
template: import("./types").SaleTemplate;
|
|
197
|
+
}>;
|
|
198
|
+
create: (marketId: string, body: {
|
|
199
|
+
saleId: string;
|
|
200
|
+
name: string;
|
|
201
|
+
description?: string | null;
|
|
202
|
+
}) => Promise<{
|
|
203
|
+
templateId: string;
|
|
204
|
+
}>;
|
|
205
|
+
update: (marketId: string, templateId: string, body: {
|
|
206
|
+
name?: string;
|
|
207
|
+
description?: string | null;
|
|
208
|
+
}) => Promise<{
|
|
209
|
+
template: import("./types").SaleTemplate;
|
|
210
|
+
}>;
|
|
211
|
+
delete: (marketId: string, templateId: string) => Promise<{
|
|
212
|
+
success: boolean;
|
|
213
|
+
}>;
|
|
170
214
|
};
|
|
171
215
|
taxRates: {
|
|
172
216
|
list: (marketId: string) => Promise<import("./types").TaxRate[]>;
|
|
173
217
|
get: (marketId: string, id: string) => Promise<import("./types").TaxRate>;
|
|
174
218
|
};
|
|
175
219
|
customers: {
|
|
176
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
220
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
177
221
|
get: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
178
222
|
avatar: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
179
|
-
create: (marketId: string, customerData: import("
|
|
223
|
+
create: (marketId: string, customerData: import(".").CreateCustomerPayload) => Promise<import("./types").Customer>;
|
|
224
|
+
update: (marketId: string, customerId: string, customerData: import(".").UpdateCustomerPayload) => Promise<import("./types").Customer>;
|
|
180
225
|
getByAccountNumber: (marketId: string, accountNumber: string) => Promise<import("./types").Customer | null>;
|
|
181
226
|
getByMartEyeUid: (marketId: string, marteyeUid: string) => Promise<import("./types").Customer | null>;
|
|
182
227
|
};
|
|
183
228
|
invoices: {
|
|
184
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
229
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
185
230
|
get: (marketId: string, invoiceId: string) => Promise<import("./types").Invoice>;
|
|
186
231
|
};
|
|
187
232
|
payments: {
|
|
188
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/payments").PaymentsListResponse>;
|
|
233
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payments").PaymentsListResponse>;
|
|
189
234
|
get: (marketId: string, paymentId: string) => Promise<import("./types").Payment>;
|
|
190
235
|
};
|
|
191
236
|
payouts: {
|
|
192
|
-
list: (marketId: string, lastId?: string) => Promise<import("./resources/payouts").PayoutsListResponse>;
|
|
237
|
+
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payouts").PayoutsListResponse>;
|
|
193
238
|
get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
|
|
194
239
|
};
|
|
195
240
|
search: {
|
|
@@ -209,4 +254,17 @@ export declare function Studio(info?: {
|
|
|
209
254
|
data: boolean;
|
|
210
255
|
}>;
|
|
211
256
|
};
|
|
257
|
+
contacts: {
|
|
258
|
+
list: (marketId: string, customerId: string, params?: {
|
|
259
|
+
lastId?: string;
|
|
260
|
+
limit?: number;
|
|
261
|
+
}) => Promise<import("./resources/contacts").ListContactsResponse>;
|
|
262
|
+
get: (marketId: string, customerId: string, contactId: string) => Promise<import("./types").CustomerContact>;
|
|
263
|
+
create: (marketId: string, customerId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
264
|
+
update: (marketId: string, customerId: string, contactId: string, payload: import("./resources/contacts").CreateOrUpdateContactPayload) => Promise<import("./types").CustomerContact>;
|
|
265
|
+
delete: (marketId: string, customerId: string, contactId: string) => Promise<void>;
|
|
266
|
+
};
|
|
267
|
+
ledger: {
|
|
268
|
+
getBalance: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerBalanceResponse>;
|
|
269
|
+
};
|
|
212
270
|
};
|