@marteye/studiojs 1.1.47 → 1.1.48-beta.0
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 +124 -23
- package/dist/index.d.ts +241 -10
- package/dist/index.esm.js +117 -79
- package/dist/index.js +117 -79
- package/dist/resources/broadcast.d.ts +7 -0
- package/dist/resources/reports.d.ts +8 -0
- package/dist/resources/sales.d.ts +2 -0
- package/dist/resources.d.ts +11 -4
- package/dist/studio.d.ts +11 -4
- package/dist/types.d.ts +185 -0
- package/package.json +3 -2
- package/dist/resources/sms.d.ts +0 -7
package/dist/index.esm.js
CHANGED
|
@@ -51,7 +51,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
|
|
|
51
51
|
if (response.status === 404) {
|
|
52
52
|
throw new Error(`${baseUrl}${path} not found`);
|
|
53
53
|
}
|
|
54
|
-
throw new Error(`Request failed with status ${response.status}: ${await response.text()}
|
|
54
|
+
throw new Error(`Request failed with status ${response.status}: ${await response.text()}`);
|
|
55
55
|
}
|
|
56
56
|
return {
|
|
57
57
|
get: async (path, queryParams) => {
|
|
@@ -73,7 +73,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// Path: studiojs/src/resources/markets.ts
|
|
76
|
-
function create$
|
|
76
|
+
function create$r(_) {
|
|
77
77
|
const actions = {
|
|
78
78
|
/***
|
|
79
79
|
* This is used to construct the action from the request body
|
|
@@ -103,7 +103,7 @@ function create$q(_) {
|
|
|
103
103
|
return actions;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
function create$
|
|
106
|
+
function create$q(httpClient) {
|
|
107
107
|
let activity = {
|
|
108
108
|
/**
|
|
109
109
|
* List activity logs for a market with pagination and filtering
|
|
@@ -155,7 +155,7 @@ function create$p(httpClient) {
|
|
|
155
155
|
return activity;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
function create$
|
|
158
|
+
function create$p(httpClient) {
|
|
159
159
|
return {
|
|
160
160
|
list: async (marketId) => {
|
|
161
161
|
return httpClient.get(`/${marketId}/adjustments`);
|
|
@@ -172,7 +172,7 @@ function create$o(httpClient) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
function create$
|
|
175
|
+
function create$o(httpClient) {
|
|
176
176
|
return {
|
|
177
177
|
/**
|
|
178
178
|
* Get the full cart for a customer including extras and uninvoiced lots
|
|
@@ -195,7 +195,7 @@ function create$n(httpClient) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
function create$
|
|
198
|
+
function create$n(httpClient) {
|
|
199
199
|
return {
|
|
200
200
|
list: async (marketId) => {
|
|
201
201
|
return httpClient.get(`/${marketId}/extras`);
|
|
@@ -215,7 +215,7 @@ function create$m(httpClient) {
|
|
|
215
215
|
/***
|
|
216
216
|
* Bidder applications
|
|
217
217
|
*/
|
|
218
|
-
function create$
|
|
218
|
+
function create$m(httpClient) {
|
|
219
219
|
let applications = {
|
|
220
220
|
/**
|
|
221
221
|
* List applications for a market with optional filtering
|
|
@@ -298,6 +298,13 @@ function create$l(httpClient) {
|
|
|
298
298
|
return applications;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
function create$l(httpClient) {
|
|
302
|
+
return {
|
|
303
|
+
send: async (marketId, data) => httpClient.post(`/${marketId}/broadcast/send`, data),
|
|
304
|
+
get: async (marketId, type, taskId) => httpClient.get(`/${marketId}/broadcast/${type}/${taskId}`),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
301
308
|
// Path: studiojs/src/resources/markets.ts
|
|
302
309
|
function create$k(httpClient) {
|
|
303
310
|
let customers = {
|
|
@@ -5955,6 +5962,43 @@ function create$a(httpClient) {
|
|
|
5955
5962
|
}
|
|
5956
5963
|
|
|
5957
5964
|
function create$9(httpClient) {
|
|
5965
|
+
let reports = {
|
|
5966
|
+
getDebtOperationalOverview: async (marketId, options) => {
|
|
5967
|
+
let queryParams = {};
|
|
5968
|
+
if ((options === null || options === void 0 ? void 0 : options.comparisonDays) !== undefined) {
|
|
5969
|
+
queryParams.comparisonDays = options.comparisonDays;
|
|
5970
|
+
}
|
|
5971
|
+
return httpClient.get(`/${marketId}/debt/operational-overview`, queryParams);
|
|
5972
|
+
},
|
|
5973
|
+
getDebtBehavior: async (marketId, options) => {
|
|
5974
|
+
let overview = await reports.getDebtOperationalOverview(marketId, options);
|
|
5975
|
+
return {
|
|
5976
|
+
customers: overview.customers.map((customer) => ({
|
|
5977
|
+
customerId: customer.customerId,
|
|
5978
|
+
displayName: customer.displayName,
|
|
5979
|
+
accountNumber: customer.accountNumber,
|
|
5980
|
+
balanceInCents: customer.balanceInCents,
|
|
5981
|
+
balanceXDaysAgoInCents: customer.balanceXDaysAgoInCents,
|
|
5982
|
+
balanceChangeInCents: customer.balanceChangeInCents,
|
|
5983
|
+
balanceChangePercent: customer.balanceChangePercent,
|
|
5984
|
+
paymentBehavior: customer.paymentBehavior,
|
|
5985
|
+
warningSignCodes: customer.warningSignCodes,
|
|
5986
|
+
warningSignLabels: customer.warningSignLabels,
|
|
5987
|
+
})),
|
|
5988
|
+
};
|
|
5989
|
+
},
|
|
5990
|
+
getDebtProduct: async (marketId, options) => {
|
|
5991
|
+
let queryParams = {};
|
|
5992
|
+
if ((options === null || options === void 0 ? void 0 : options.limit) !== undefined) {
|
|
5993
|
+
queryParams.limit = options.limit;
|
|
5994
|
+
}
|
|
5995
|
+
return httpClient.get(`/${marketId}/debt/outstanding-by-product`, queryParams);
|
|
5996
|
+
},
|
|
5997
|
+
};
|
|
5998
|
+
return reports;
|
|
5999
|
+
}
|
|
6000
|
+
|
|
6001
|
+
function create$8(httpClient) {
|
|
5958
6002
|
return {
|
|
5959
6003
|
get: async (marketId, saleId, options) => {
|
|
5960
6004
|
return httpClient.get(`/${marketId}/sales/${saleId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
|
|
@@ -5971,7 +6015,7 @@ function create$9(httpClient) {
|
|
|
5971
6015
|
};
|
|
5972
6016
|
}
|
|
5973
6017
|
|
|
5974
|
-
function create$
|
|
6018
|
+
function create$7(httpClient) {
|
|
5975
6019
|
return {
|
|
5976
6020
|
list: async (marketId) => {
|
|
5977
6021
|
return httpClient.get(`/${marketId}/sale-templates`);
|
|
@@ -5991,7 +6035,7 @@ function create$8(httpClient) {
|
|
|
5991
6035
|
};
|
|
5992
6036
|
}
|
|
5993
6037
|
|
|
5994
|
-
function create$
|
|
6038
|
+
function create$6(httpClient) {
|
|
5995
6039
|
let search = {
|
|
5996
6040
|
/**
|
|
5997
6041
|
* Search for documents within a market
|
|
@@ -6006,7 +6050,7 @@ function create$7(httpClient) {
|
|
|
6006
6050
|
return search;
|
|
6007
6051
|
}
|
|
6008
6052
|
|
|
6009
|
-
function create$
|
|
6053
|
+
function create$5(httpClient) {
|
|
6010
6054
|
return {
|
|
6011
6055
|
get: async (marketId, options) => {
|
|
6012
6056
|
return httpClient.get(`/${marketId}/settings`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
|
|
@@ -6014,60 +6058,13 @@ function create$6(httpClient) {
|
|
|
6014
6058
|
};
|
|
6015
6059
|
}
|
|
6016
6060
|
|
|
6017
|
-
function create$
|
|
6018
|
-
return {
|
|
6019
|
-
list: async (marketId) => {
|
|
6020
|
-
return httpClient.get(`/${marketId}/tax_rates`);
|
|
6021
|
-
},
|
|
6022
|
-
get: async (marketId, id) => {
|
|
6023
|
-
return httpClient.get(`/${marketId}/tax_rates/${id}`);
|
|
6024
|
-
},
|
|
6025
|
-
};
|
|
6026
|
-
}
|
|
6027
|
-
|
|
6028
|
-
// Path: studiojs/src/resources/markets.ts
|
|
6029
|
-
function create$4(_) {
|
|
6030
|
-
const webhooks = {
|
|
6031
|
-
/***
|
|
6032
|
-
* This is used to construct the webhook event from the request body
|
|
6033
|
-
* @param body the request body
|
|
6034
|
-
* @param signature the signature of the request taken from the header
|
|
6035
|
-
* @param endpointSecret the pre-shared secret
|
|
6036
|
-
* @returns the webhook event
|
|
6037
|
-
*/
|
|
6038
|
-
constructEvent: async (bodyAsBuffer, signature, endpointSecret) => {
|
|
6039
|
-
if (!endpointSecret) {
|
|
6040
|
-
throw new Error("Endpoint secret is required");
|
|
6041
|
-
}
|
|
6042
|
-
if (!signature) {
|
|
6043
|
-
throw new Error("Signature is required");
|
|
6044
|
-
}
|
|
6045
|
-
let bodyText = bodyAsBuffer.toString();
|
|
6046
|
-
let expectedSignature = createHmac("sha256", endpointSecret)
|
|
6047
|
-
.update(bodyText)
|
|
6048
|
-
.digest("hex");
|
|
6049
|
-
if (signature !== expectedSignature) {
|
|
6050
|
-
console.error(`Unable to construct event. Signature mismatch.`, signature, "!=", expectedSignature);
|
|
6051
|
-
throw new Error(`Unable to construct event. Signature mismatch.`);
|
|
6052
|
-
}
|
|
6053
|
-
try {
|
|
6054
|
-
return JSON.parse(bodyText);
|
|
6055
|
-
}
|
|
6056
|
-
catch (e) {
|
|
6057
|
-
throw new Error(`Unable to construct event. ${e}`);
|
|
6058
|
-
}
|
|
6059
|
-
},
|
|
6060
|
-
};
|
|
6061
|
-
return webhooks;
|
|
6062
|
-
}
|
|
6063
|
-
|
|
6064
|
-
function create$3(httpClient) {
|
|
6061
|
+
function create$4(httpClient) {
|
|
6065
6062
|
return {
|
|
6066
6063
|
lookup: async (marketId, cph) => httpClient.get(`/${marketId}/cph`, { cph }),
|
|
6067
6064
|
};
|
|
6068
6065
|
}
|
|
6069
6066
|
|
|
6070
|
-
function create$
|
|
6067
|
+
function create$3(httpClient) {
|
|
6071
6068
|
return {
|
|
6072
6069
|
list: async (marketId, customerId, params) => {
|
|
6073
6070
|
const query = {};
|
|
@@ -6092,7 +6089,7 @@ function create$2(httpClient) {
|
|
|
6092
6089
|
};
|
|
6093
6090
|
}
|
|
6094
6091
|
|
|
6095
|
-
function create$
|
|
6092
|
+
function create$2(httpClient) {
|
|
6096
6093
|
let ledger = {
|
|
6097
6094
|
/**
|
|
6098
6095
|
* Get the current balance for a ledger account
|
|
@@ -6153,42 +6150,83 @@ function create$1(httpClient) {
|
|
|
6153
6150
|
return ledger;
|
|
6154
6151
|
}
|
|
6155
6152
|
|
|
6156
|
-
function create(httpClient) {
|
|
6153
|
+
function create$1(httpClient) {
|
|
6157
6154
|
return {
|
|
6158
|
-
|
|
6159
|
-
|
|
6155
|
+
list: async (marketId) => {
|
|
6156
|
+
return httpClient.get(`/${marketId}/tax_rates`);
|
|
6157
|
+
},
|
|
6158
|
+
get: async (marketId, id) => {
|
|
6159
|
+
return httpClient.get(`/${marketId}/tax_rates/${id}`);
|
|
6160
|
+
},
|
|
6160
6161
|
};
|
|
6161
6162
|
}
|
|
6162
6163
|
|
|
6164
|
+
// Path: studiojs/src/resources/markets.ts
|
|
6165
|
+
function create(_) {
|
|
6166
|
+
const webhooks = {
|
|
6167
|
+
/***
|
|
6168
|
+
* This is used to construct the webhook event from the request body
|
|
6169
|
+
* @param body the request body
|
|
6170
|
+
* @param signature the signature of the request taken from the header
|
|
6171
|
+
* @param endpointSecret the pre-shared secret
|
|
6172
|
+
* @returns the webhook event
|
|
6173
|
+
*/
|
|
6174
|
+
constructEvent: async (bodyAsBuffer, signature, endpointSecret) => {
|
|
6175
|
+
if (!endpointSecret) {
|
|
6176
|
+
throw new Error("Endpoint secret is required");
|
|
6177
|
+
}
|
|
6178
|
+
if (!signature) {
|
|
6179
|
+
throw new Error("Signature is required");
|
|
6180
|
+
}
|
|
6181
|
+
let bodyText = bodyAsBuffer.toString();
|
|
6182
|
+
let expectedSignature = createHmac("sha256", endpointSecret)
|
|
6183
|
+
.update(bodyText)
|
|
6184
|
+
.digest("hex");
|
|
6185
|
+
if (signature !== expectedSignature) {
|
|
6186
|
+
console.error(`Unable to construct event. Signature mismatch.`, signature, "!=", expectedSignature);
|
|
6187
|
+
throw new Error(`Unable to construct event. Signature mismatch.`);
|
|
6188
|
+
}
|
|
6189
|
+
try {
|
|
6190
|
+
return JSON.parse(bodyText);
|
|
6191
|
+
}
|
|
6192
|
+
catch (e) {
|
|
6193
|
+
throw new Error(`Unable to construct event. ${e}`);
|
|
6194
|
+
}
|
|
6195
|
+
},
|
|
6196
|
+
};
|
|
6197
|
+
return webhooks;
|
|
6198
|
+
}
|
|
6199
|
+
|
|
6163
6200
|
function resources(httpClient) {
|
|
6164
6201
|
return {
|
|
6165
|
-
activity: create$
|
|
6202
|
+
activity: create$q(httpClient),
|
|
6203
|
+
broadcast: create$l(httpClient),
|
|
6166
6204
|
markets: create$e(httpClient),
|
|
6167
6205
|
members: create$d(httpClient),
|
|
6168
|
-
sales: create$
|
|
6206
|
+
sales: create$8(httpClient),
|
|
6169
6207
|
lots: create$f(httpClient),
|
|
6170
6208
|
lotitems: create$g(httpClient),
|
|
6171
|
-
carts: create$
|
|
6172
|
-
cph: create$
|
|
6173
|
-
webhooks: create
|
|
6174
|
-
actions: create$
|
|
6175
|
-
bidderApplications: create$
|
|
6176
|
-
settings: create$
|
|
6177
|
-
adjustments: create$
|
|
6178
|
-
extras: create$
|
|
6209
|
+
carts: create$o(httpClient),
|
|
6210
|
+
cph: create$4(httpClient),
|
|
6211
|
+
webhooks: create(),
|
|
6212
|
+
actions: create$r(),
|
|
6213
|
+
bidderApplications: create$m(httpClient),
|
|
6214
|
+
settings: create$5(httpClient),
|
|
6215
|
+
adjustments: create$p(httpClient),
|
|
6216
|
+
extras: create$n(httpClient),
|
|
6179
6217
|
productCodes: create$a(httpClient),
|
|
6180
|
-
saleTemplates: create$
|
|
6181
|
-
taxRates: create$
|
|
6218
|
+
saleTemplates: create$7(httpClient),
|
|
6219
|
+
taxRates: create$1(httpClient),
|
|
6182
6220
|
customers: create$k(httpClient),
|
|
6183
6221
|
customerLists: create$j(httpClient),
|
|
6184
6222
|
invoices: create$h(httpClient),
|
|
6185
6223
|
payments: create$c(httpClient),
|
|
6186
6224
|
payouts: create$b(httpClient),
|
|
6187
|
-
|
|
6225
|
+
reports: create$9(httpClient),
|
|
6226
|
+
search: create$6(httpClient),
|
|
6188
6227
|
files: create$i(),
|
|
6189
|
-
contacts: create$
|
|
6190
|
-
ledger: create$
|
|
6191
|
-
sms: create(httpClient),
|
|
6228
|
+
contacts: create$3(httpClient),
|
|
6229
|
+
ledger: create$2(httpClient),
|
|
6192
6230
|
};
|
|
6193
6231
|
}
|
|
6194
6232
|
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
|
|
|
55
55
|
if (response.status === 404) {
|
|
56
56
|
throw new Error(`${baseUrl}${path} not found`);
|
|
57
57
|
}
|
|
58
|
-
throw new Error(`Request failed with status ${response.status}: ${await response.text()}
|
|
58
|
+
throw new Error(`Request failed with status ${response.status}: ${await response.text()}`);
|
|
59
59
|
}
|
|
60
60
|
return {
|
|
61
61
|
get: async (path, queryParams) => {
|
|
@@ -77,7 +77,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// Path: studiojs/src/resources/markets.ts
|
|
80
|
-
function create$
|
|
80
|
+
function create$r(_) {
|
|
81
81
|
const actions = {
|
|
82
82
|
/***
|
|
83
83
|
* This is used to construct the action from the request body
|
|
@@ -107,7 +107,7 @@ function create$q(_) {
|
|
|
107
107
|
return actions;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
function create$
|
|
110
|
+
function create$q(httpClient) {
|
|
111
111
|
let activity = {
|
|
112
112
|
/**
|
|
113
113
|
* List activity logs for a market with pagination and filtering
|
|
@@ -159,7 +159,7 @@ function create$p(httpClient) {
|
|
|
159
159
|
return activity;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
function create$
|
|
162
|
+
function create$p(httpClient) {
|
|
163
163
|
return {
|
|
164
164
|
list: async (marketId) => {
|
|
165
165
|
return httpClient.get(`/${marketId}/adjustments`);
|
|
@@ -176,7 +176,7 @@ function create$o(httpClient) {
|
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
function create$
|
|
179
|
+
function create$o(httpClient) {
|
|
180
180
|
return {
|
|
181
181
|
/**
|
|
182
182
|
* Get the full cart for a customer including extras and uninvoiced lots
|
|
@@ -199,7 +199,7 @@ function create$n(httpClient) {
|
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
function create$
|
|
202
|
+
function create$n(httpClient) {
|
|
203
203
|
return {
|
|
204
204
|
list: async (marketId) => {
|
|
205
205
|
return httpClient.get(`/${marketId}/extras`);
|
|
@@ -219,7 +219,7 @@ function create$m(httpClient) {
|
|
|
219
219
|
/***
|
|
220
220
|
* Bidder applications
|
|
221
221
|
*/
|
|
222
|
-
function create$
|
|
222
|
+
function create$m(httpClient) {
|
|
223
223
|
let applications = {
|
|
224
224
|
/**
|
|
225
225
|
* List applications for a market with optional filtering
|
|
@@ -302,6 +302,13 @@ function create$l(httpClient) {
|
|
|
302
302
|
return applications;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
function create$l(httpClient) {
|
|
306
|
+
return {
|
|
307
|
+
send: async (marketId, data) => httpClient.post(`/${marketId}/broadcast/send`, data),
|
|
308
|
+
get: async (marketId, type, taskId) => httpClient.get(`/${marketId}/broadcast/${type}/${taskId}`),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
305
312
|
// Path: studiojs/src/resources/markets.ts
|
|
306
313
|
function create$k(httpClient) {
|
|
307
314
|
let customers = {
|
|
@@ -5959,6 +5966,43 @@ function create$a(httpClient) {
|
|
|
5959
5966
|
}
|
|
5960
5967
|
|
|
5961
5968
|
function create$9(httpClient) {
|
|
5969
|
+
let reports = {
|
|
5970
|
+
getDebtOperationalOverview: async (marketId, options) => {
|
|
5971
|
+
let queryParams = {};
|
|
5972
|
+
if ((options === null || options === void 0 ? void 0 : options.comparisonDays) !== undefined) {
|
|
5973
|
+
queryParams.comparisonDays = options.comparisonDays;
|
|
5974
|
+
}
|
|
5975
|
+
return httpClient.get(`/${marketId}/debt/operational-overview`, queryParams);
|
|
5976
|
+
},
|
|
5977
|
+
getDebtBehavior: async (marketId, options) => {
|
|
5978
|
+
let overview = await reports.getDebtOperationalOverview(marketId, options);
|
|
5979
|
+
return {
|
|
5980
|
+
customers: overview.customers.map((customer) => ({
|
|
5981
|
+
customerId: customer.customerId,
|
|
5982
|
+
displayName: customer.displayName,
|
|
5983
|
+
accountNumber: customer.accountNumber,
|
|
5984
|
+
balanceInCents: customer.balanceInCents,
|
|
5985
|
+
balanceXDaysAgoInCents: customer.balanceXDaysAgoInCents,
|
|
5986
|
+
balanceChangeInCents: customer.balanceChangeInCents,
|
|
5987
|
+
balanceChangePercent: customer.balanceChangePercent,
|
|
5988
|
+
paymentBehavior: customer.paymentBehavior,
|
|
5989
|
+
warningSignCodes: customer.warningSignCodes,
|
|
5990
|
+
warningSignLabels: customer.warningSignLabels,
|
|
5991
|
+
})),
|
|
5992
|
+
};
|
|
5993
|
+
},
|
|
5994
|
+
getDebtProduct: async (marketId, options) => {
|
|
5995
|
+
let queryParams = {};
|
|
5996
|
+
if ((options === null || options === void 0 ? void 0 : options.limit) !== undefined) {
|
|
5997
|
+
queryParams.limit = options.limit;
|
|
5998
|
+
}
|
|
5999
|
+
return httpClient.get(`/${marketId}/debt/outstanding-by-product`, queryParams);
|
|
6000
|
+
},
|
|
6001
|
+
};
|
|
6002
|
+
return reports;
|
|
6003
|
+
}
|
|
6004
|
+
|
|
6005
|
+
function create$8(httpClient) {
|
|
5962
6006
|
return {
|
|
5963
6007
|
get: async (marketId, saleId, options) => {
|
|
5964
6008
|
return httpClient.get(`/${marketId}/sales/${saleId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
|
|
@@ -5975,7 +6019,7 @@ function create$9(httpClient) {
|
|
|
5975
6019
|
};
|
|
5976
6020
|
}
|
|
5977
6021
|
|
|
5978
|
-
function create$
|
|
6022
|
+
function create$7(httpClient) {
|
|
5979
6023
|
return {
|
|
5980
6024
|
list: async (marketId) => {
|
|
5981
6025
|
return httpClient.get(`/${marketId}/sale-templates`);
|
|
@@ -5995,7 +6039,7 @@ function create$8(httpClient) {
|
|
|
5995
6039
|
};
|
|
5996
6040
|
}
|
|
5997
6041
|
|
|
5998
|
-
function create$
|
|
6042
|
+
function create$6(httpClient) {
|
|
5999
6043
|
let search = {
|
|
6000
6044
|
/**
|
|
6001
6045
|
* Search for documents within a market
|
|
@@ -6010,7 +6054,7 @@ function create$7(httpClient) {
|
|
|
6010
6054
|
return search;
|
|
6011
6055
|
}
|
|
6012
6056
|
|
|
6013
|
-
function create$
|
|
6057
|
+
function create$5(httpClient) {
|
|
6014
6058
|
return {
|
|
6015
6059
|
get: async (marketId, options) => {
|
|
6016
6060
|
return httpClient.get(`/${marketId}/settings`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
|
|
@@ -6018,60 +6062,13 @@ function create$6(httpClient) {
|
|
|
6018
6062
|
};
|
|
6019
6063
|
}
|
|
6020
6064
|
|
|
6021
|
-
function create$
|
|
6022
|
-
return {
|
|
6023
|
-
list: async (marketId) => {
|
|
6024
|
-
return httpClient.get(`/${marketId}/tax_rates`);
|
|
6025
|
-
},
|
|
6026
|
-
get: async (marketId, id) => {
|
|
6027
|
-
return httpClient.get(`/${marketId}/tax_rates/${id}`);
|
|
6028
|
-
},
|
|
6029
|
-
};
|
|
6030
|
-
}
|
|
6031
|
-
|
|
6032
|
-
// Path: studiojs/src/resources/markets.ts
|
|
6033
|
-
function create$4(_) {
|
|
6034
|
-
const webhooks = {
|
|
6035
|
-
/***
|
|
6036
|
-
* This is used to construct the webhook event from the request body
|
|
6037
|
-
* @param body the request body
|
|
6038
|
-
* @param signature the signature of the request taken from the header
|
|
6039
|
-
* @param endpointSecret the pre-shared secret
|
|
6040
|
-
* @returns the webhook event
|
|
6041
|
-
*/
|
|
6042
|
-
constructEvent: async (bodyAsBuffer, signature, endpointSecret) => {
|
|
6043
|
-
if (!endpointSecret) {
|
|
6044
|
-
throw new Error("Endpoint secret is required");
|
|
6045
|
-
}
|
|
6046
|
-
if (!signature) {
|
|
6047
|
-
throw new Error("Signature is required");
|
|
6048
|
-
}
|
|
6049
|
-
let bodyText = bodyAsBuffer.toString();
|
|
6050
|
-
let expectedSignature = crypto.createHmac("sha256", endpointSecret)
|
|
6051
|
-
.update(bodyText)
|
|
6052
|
-
.digest("hex");
|
|
6053
|
-
if (signature !== expectedSignature) {
|
|
6054
|
-
console.error(`Unable to construct event. Signature mismatch.`, signature, "!=", expectedSignature);
|
|
6055
|
-
throw new Error(`Unable to construct event. Signature mismatch.`);
|
|
6056
|
-
}
|
|
6057
|
-
try {
|
|
6058
|
-
return JSON.parse(bodyText);
|
|
6059
|
-
}
|
|
6060
|
-
catch (e) {
|
|
6061
|
-
throw new Error(`Unable to construct event. ${e}`);
|
|
6062
|
-
}
|
|
6063
|
-
},
|
|
6064
|
-
};
|
|
6065
|
-
return webhooks;
|
|
6066
|
-
}
|
|
6067
|
-
|
|
6068
|
-
function create$3(httpClient) {
|
|
6065
|
+
function create$4(httpClient) {
|
|
6069
6066
|
return {
|
|
6070
6067
|
lookup: async (marketId, cph) => httpClient.get(`/${marketId}/cph`, { cph }),
|
|
6071
6068
|
};
|
|
6072
6069
|
}
|
|
6073
6070
|
|
|
6074
|
-
function create$
|
|
6071
|
+
function create$3(httpClient) {
|
|
6075
6072
|
return {
|
|
6076
6073
|
list: async (marketId, customerId, params) => {
|
|
6077
6074
|
const query = {};
|
|
@@ -6096,7 +6093,7 @@ function create$2(httpClient) {
|
|
|
6096
6093
|
};
|
|
6097
6094
|
}
|
|
6098
6095
|
|
|
6099
|
-
function create$
|
|
6096
|
+
function create$2(httpClient) {
|
|
6100
6097
|
let ledger = {
|
|
6101
6098
|
/**
|
|
6102
6099
|
* Get the current balance for a ledger account
|
|
@@ -6157,42 +6154,83 @@ function create$1(httpClient) {
|
|
|
6157
6154
|
return ledger;
|
|
6158
6155
|
}
|
|
6159
6156
|
|
|
6160
|
-
function create(httpClient) {
|
|
6157
|
+
function create$1(httpClient) {
|
|
6161
6158
|
return {
|
|
6162
|
-
|
|
6163
|
-
|
|
6159
|
+
list: async (marketId) => {
|
|
6160
|
+
return httpClient.get(`/${marketId}/tax_rates`);
|
|
6161
|
+
},
|
|
6162
|
+
get: async (marketId, id) => {
|
|
6163
|
+
return httpClient.get(`/${marketId}/tax_rates/${id}`);
|
|
6164
|
+
},
|
|
6164
6165
|
};
|
|
6165
6166
|
}
|
|
6166
6167
|
|
|
6168
|
+
// Path: studiojs/src/resources/markets.ts
|
|
6169
|
+
function create(_) {
|
|
6170
|
+
const webhooks = {
|
|
6171
|
+
/***
|
|
6172
|
+
* This is used to construct the webhook event from the request body
|
|
6173
|
+
* @param body the request body
|
|
6174
|
+
* @param signature the signature of the request taken from the header
|
|
6175
|
+
* @param endpointSecret the pre-shared secret
|
|
6176
|
+
* @returns the webhook event
|
|
6177
|
+
*/
|
|
6178
|
+
constructEvent: async (bodyAsBuffer, signature, endpointSecret) => {
|
|
6179
|
+
if (!endpointSecret) {
|
|
6180
|
+
throw new Error("Endpoint secret is required");
|
|
6181
|
+
}
|
|
6182
|
+
if (!signature) {
|
|
6183
|
+
throw new Error("Signature is required");
|
|
6184
|
+
}
|
|
6185
|
+
let bodyText = bodyAsBuffer.toString();
|
|
6186
|
+
let expectedSignature = crypto.createHmac("sha256", endpointSecret)
|
|
6187
|
+
.update(bodyText)
|
|
6188
|
+
.digest("hex");
|
|
6189
|
+
if (signature !== expectedSignature) {
|
|
6190
|
+
console.error(`Unable to construct event. Signature mismatch.`, signature, "!=", expectedSignature);
|
|
6191
|
+
throw new Error(`Unable to construct event. Signature mismatch.`);
|
|
6192
|
+
}
|
|
6193
|
+
try {
|
|
6194
|
+
return JSON.parse(bodyText);
|
|
6195
|
+
}
|
|
6196
|
+
catch (e) {
|
|
6197
|
+
throw new Error(`Unable to construct event. ${e}`);
|
|
6198
|
+
}
|
|
6199
|
+
},
|
|
6200
|
+
};
|
|
6201
|
+
return webhooks;
|
|
6202
|
+
}
|
|
6203
|
+
|
|
6167
6204
|
function resources(httpClient) {
|
|
6168
6205
|
return {
|
|
6169
|
-
activity: create$
|
|
6206
|
+
activity: create$q(httpClient),
|
|
6207
|
+
broadcast: create$l(httpClient),
|
|
6170
6208
|
markets: create$e(httpClient),
|
|
6171
6209
|
members: create$d(httpClient),
|
|
6172
|
-
sales: create$
|
|
6210
|
+
sales: create$8(httpClient),
|
|
6173
6211
|
lots: create$f(httpClient),
|
|
6174
6212
|
lotitems: create$g(httpClient),
|
|
6175
|
-
carts: create$
|
|
6176
|
-
cph: create$
|
|
6177
|
-
webhooks: create
|
|
6178
|
-
actions: create$
|
|
6179
|
-
bidderApplications: create$
|
|
6180
|
-
settings: create$
|
|
6181
|
-
adjustments: create$
|
|
6182
|
-
extras: create$
|
|
6213
|
+
carts: create$o(httpClient),
|
|
6214
|
+
cph: create$4(httpClient),
|
|
6215
|
+
webhooks: create(),
|
|
6216
|
+
actions: create$r(),
|
|
6217
|
+
bidderApplications: create$m(httpClient),
|
|
6218
|
+
settings: create$5(httpClient),
|
|
6219
|
+
adjustments: create$p(httpClient),
|
|
6220
|
+
extras: create$n(httpClient),
|
|
6183
6221
|
productCodes: create$a(httpClient),
|
|
6184
|
-
saleTemplates: create$
|
|
6185
|
-
taxRates: create$
|
|
6222
|
+
saleTemplates: create$7(httpClient),
|
|
6223
|
+
taxRates: create$1(httpClient),
|
|
6186
6224
|
customers: create$k(httpClient),
|
|
6187
6225
|
customerLists: create$j(httpClient),
|
|
6188
6226
|
invoices: create$h(httpClient),
|
|
6189
6227
|
payments: create$c(httpClient),
|
|
6190
6228
|
payouts: create$b(httpClient),
|
|
6191
|
-
|
|
6229
|
+
reports: create$9(httpClient),
|
|
6230
|
+
search: create$6(httpClient),
|
|
6192
6231
|
files: create$i(),
|
|
6193
|
-
contacts: create$
|
|
6194
|
-
ledger: create$
|
|
6195
|
-
sms: create(httpClient),
|
|
6232
|
+
contacts: create$3(httpClient),
|
|
6233
|
+
ledger: create$2(httpClient),
|
|
6196
6234
|
};
|
|
6197
6235
|
}
|
|
6198
6236
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { BroadcastPayload, BroadcastSendResponse, BroadcastTask, BroadcastType } from "../types";
|
|
3
|
+
export default function create(httpClient: HttpClient): {
|
|
4
|
+
send: (marketId: string, data: BroadcastPayload) => Promise<BroadcastSendResponse>;
|
|
5
|
+
get: (marketId: string, type: BroadcastType, taskId: string) => Promise<BroadcastTask>;
|
|
6
|
+
};
|
|
7
|
+
export type Broadcast = ReturnType<typeof create>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HttpClient } from "../net/http";
|
|
2
|
+
import { DebtBehaviorResponse, DebtOperationalOverviewOptions, DebtOperationalOverviewResponse, DebtProductOptions, DebtProductResponse } from "../types";
|
|
3
|
+
export default function create(httpClient: HttpClient): {
|
|
4
|
+
getDebtOperationalOverview: (marketId: string, options?: DebtOperationalOverviewOptions) => Promise<DebtOperationalOverviewResponse>;
|
|
5
|
+
getDebtBehavior: (marketId: string, options?: DebtOperationalOverviewOptions) => Promise<DebtBehaviorResponse>;
|
|
6
|
+
getDebtProduct: (marketId: string, options?: DebtProductOptions) => Promise<DebtProductResponse>;
|
|
7
|
+
};
|
|
8
|
+
export type Reports = ReturnType<typeof create>;
|
|
@@ -19,6 +19,7 @@ type CreateSaleRequest = {
|
|
|
19
19
|
image?: string | null;
|
|
20
20
|
cover?: string | null;
|
|
21
21
|
templateId?: string | null;
|
|
22
|
+
enableLotGrouping?: boolean;
|
|
22
23
|
attributeDefaults?: {
|
|
23
24
|
[attributekey: string]: string | number | boolean;
|
|
24
25
|
};
|
|
@@ -37,6 +38,7 @@ export default function create(httpClient: HttpClient): {
|
|
|
37
38
|
defaultProductCode?: string;
|
|
38
39
|
attributeDefaults?: Record<string, any>;
|
|
39
40
|
publishStatus?: SalePublishStatus;
|
|
41
|
+
enableLotGrouping?: boolean;
|
|
40
42
|
marteyeSettings?: {
|
|
41
43
|
description?: string;
|
|
42
44
|
image?: string;
|