@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/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) => {
@@ -298,8 +298,15 @@ function create$l(httpClient) {
298
298
  return applications;
299
299
  }
300
300
 
301
- // Path: studiojs/src/resources/markets.ts
302
301
  function create$k(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
+
308
+ // Path: studiojs/src/resources/markets.ts
309
+ function create$j(httpClient) {
303
310
  let customers = {
304
311
  list: async (marketId, lastId) => {
305
312
  let params = {};
@@ -348,7 +355,7 @@ function create$k(httpClient) {
348
355
 
349
356
  const DEFAULT_PAGE_SIZE = 100;
350
357
  const MAX_MEMBER_BATCH_SIZE = 100;
351
- function create$j(httpClient) {
358
+ function create$i(httpClient) {
352
359
  const customerLists = {
353
360
  list: async (marketId, options) => {
354
361
  return httpClient.get(`/${marketId}/lists`, buildListQueryParams(options));
@@ -5728,7 +5735,7 @@ const uploadSingleFile = async (input, token) => {
5728
5735
  };
5729
5736
 
5730
5737
  // Multipart Upload for Media to the MARTEYE Media Service
5731
- function create$i() {
5738
+ function create$h() {
5732
5739
  const files = {
5733
5740
  uploadSingleFile: async (input, token) => {
5734
5741
  return await uploadSingleFile(input, token);
@@ -5743,7 +5750,7 @@ function create$i() {
5743
5750
  return files;
5744
5751
  }
5745
5752
 
5746
- function create$h(httpClient) {
5753
+ function create$g(httpClient) {
5747
5754
  const invoices = {
5748
5755
  /**
5749
5756
  * List all invoices for a market with pagination
@@ -5771,7 +5778,7 @@ function create$h(httpClient) {
5771
5778
  return invoices;
5772
5779
  }
5773
5780
 
5774
- function create$g(httpClient) {
5781
+ function create$f(httpClient) {
5775
5782
  return {
5776
5783
  create: async (marketId, saleId, lotId, data) => {
5777
5784
  return httpClient.post(`/${marketId}/sales/${saleId}/lots/${lotId}/items`, data);
@@ -5788,7 +5795,7 @@ function create$g(httpClient) {
5788
5795
  /**
5789
5796
  * Defines the possible status values for a lot in a sale
5790
5797
  */
5791
- function create$f(httpClient) {
5798
+ function create$e(httpClient) {
5792
5799
  return {
5793
5800
  get: async (marketId, saleId, lotId, options) => {
5794
5801
  return httpClient.get(`/${marketId}/sales/${saleId}/lots/${lotId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -5817,7 +5824,7 @@ function create$f(httpClient) {
5817
5824
  };
5818
5825
  }
5819
5826
 
5820
- function create$e(httpClient) {
5827
+ function create$d(httpClient) {
5821
5828
  const markets = {
5822
5829
  get: async (marketId, options) => {
5823
5830
  return httpClient.get(`/${marketId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -5839,7 +5846,7 @@ function create$e(httpClient) {
5839
5846
  return markets;
5840
5847
  }
5841
5848
 
5842
- function create$d(httpClient) {
5849
+ function create$c(httpClient) {
5843
5850
  let members = {
5844
5851
  /**
5845
5852
  * List members (staff accounts) for a market with pagination
@@ -5870,7 +5877,7 @@ function create$d(httpClient) {
5870
5877
  return members;
5871
5878
  }
5872
5879
 
5873
- function create$c(httpClient) {
5880
+ function create$b(httpClient) {
5874
5881
  const payments = {
5875
5882
  /**
5876
5883
  * List all payments for a market with pagination
@@ -5898,7 +5905,7 @@ function create$c(httpClient) {
5898
5905
  return payments;
5899
5906
  }
5900
5907
 
5901
- function create$b(httpClient) {
5908
+ function create$a(httpClient) {
5902
5909
  const payouts = {
5903
5910
  /**
5904
5911
  * List all payouts for a market with pagination
@@ -5937,7 +5944,7 @@ function create$b(httpClient) {
5937
5944
  return payouts;
5938
5945
  }
5939
5946
 
5940
- function create$a(httpClient) {
5947
+ function create$9(httpClient) {
5941
5948
  return {
5942
5949
  list: async (marketId) => {
5943
5950
  return httpClient.get(`/${marketId}/product-codes`);
@@ -5954,7 +5961,7 @@ function create$a(httpClient) {
5954
5961
  };
5955
5962
  }
5956
5963
 
5957
- function create$9(httpClient) {
5964
+ function create$8(httpClient) {
5958
5965
  return {
5959
5966
  get: async (marketId, saleId, options) => {
5960
5967
  return httpClient.get(`/${marketId}/sales/${saleId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -5971,7 +5978,7 @@ function create$9(httpClient) {
5971
5978
  };
5972
5979
  }
5973
5980
 
5974
- function create$8(httpClient) {
5981
+ function create$7(httpClient) {
5975
5982
  return {
5976
5983
  list: async (marketId) => {
5977
5984
  return httpClient.get(`/${marketId}/sale-templates`);
@@ -5991,7 +5998,7 @@ function create$8(httpClient) {
5991
5998
  };
5992
5999
  }
5993
6000
 
5994
- function create$7(httpClient) {
6001
+ function create$6(httpClient) {
5995
6002
  let search = {
5996
6003
  /**
5997
6004
  * Search for documents within a market
@@ -6006,7 +6013,7 @@ function create$7(httpClient) {
6006
6013
  return search;
6007
6014
  }
6008
6015
 
6009
- function create$6(httpClient) {
6016
+ function create$5(httpClient) {
6010
6017
  return {
6011
6018
  get: async (marketId, options) => {
6012
6019
  return httpClient.get(`/${marketId}/settings`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -6014,60 +6021,13 @@ function create$6(httpClient) {
6014
6021
  };
6015
6022
  }
6016
6023
 
6017
- function create$5(httpClient) {
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) {
6024
+ function create$4(httpClient) {
6065
6025
  return {
6066
6026
  lookup: async (marketId, cph) => httpClient.get(`/${marketId}/cph`, { cph }),
6067
6027
  };
6068
6028
  }
6069
6029
 
6070
- function create$2(httpClient) {
6030
+ function create$3(httpClient) {
6071
6031
  return {
6072
6032
  list: async (marketId, customerId, params) => {
6073
6033
  const query = {};
@@ -6092,7 +6052,7 @@ function create$2(httpClient) {
6092
6052
  };
6093
6053
  }
6094
6054
 
6095
- function create$1(httpClient) {
6055
+ function create$2(httpClient) {
6096
6056
  let ledger = {
6097
6057
  /**
6098
6058
  * Get the current balance for a ledger account
@@ -6153,42 +6113,82 @@ function create$1(httpClient) {
6153
6113
  return ledger;
6154
6114
  }
6155
6115
 
6156
- function create(httpClient) {
6116
+ function create$1(httpClient) {
6157
6117
  return {
6158
- sendSMS: async (marketId, data) => httpClient.post(`/${marketId}/sms/send`, data),
6159
- getSMS: async (marketId, smsId) => httpClient.get(`/${marketId}/sms/${smsId}`),
6118
+ list: async (marketId) => {
6119
+ return httpClient.get(`/${marketId}/tax_rates`);
6120
+ },
6121
+ get: async (marketId, id) => {
6122
+ return httpClient.get(`/${marketId}/tax_rates/${id}`);
6123
+ },
6124
+ };
6125
+ }
6126
+
6127
+ // Path: studiojs/src/resources/markets.ts
6128
+ function create(_) {
6129
+ const webhooks = {
6130
+ /***
6131
+ * This is used to construct the webhook event from the request body
6132
+ * @param body the request body
6133
+ * @param signature the signature of the request taken from the header
6134
+ * @param endpointSecret the pre-shared secret
6135
+ * @returns the webhook event
6136
+ */
6137
+ constructEvent: async (bodyAsBuffer, signature, endpointSecret) => {
6138
+ if (!endpointSecret) {
6139
+ throw new Error("Endpoint secret is required");
6140
+ }
6141
+ if (!signature) {
6142
+ throw new Error("Signature is required");
6143
+ }
6144
+ let bodyText = bodyAsBuffer.toString();
6145
+ let expectedSignature = createHmac("sha256", endpointSecret)
6146
+ .update(bodyText)
6147
+ .digest("hex");
6148
+ if (signature !== expectedSignature) {
6149
+ console.error(`Unable to construct event. Signature mismatch.`, signature, "!=", expectedSignature);
6150
+ throw new Error(`Unable to construct event. Signature mismatch.`);
6151
+ }
6152
+ try {
6153
+ return JSON.parse(bodyText);
6154
+ }
6155
+ catch (e) {
6156
+ throw new Error(`Unable to construct event. ${e}`);
6157
+ }
6158
+ },
6160
6159
  };
6160
+ return webhooks;
6161
6161
  }
6162
6162
 
6163
6163
  function resources(httpClient) {
6164
6164
  return {
6165
6165
  activity: create$p(httpClient),
6166
- markets: create$e(httpClient),
6167
- members: create$d(httpClient),
6168
- sales: create$9(httpClient),
6169
- lots: create$f(httpClient),
6170
- lotitems: create$g(httpClient),
6166
+ broadcast: create$k(httpClient),
6167
+ markets: create$d(httpClient),
6168
+ members: create$c(httpClient),
6169
+ sales: create$8(httpClient),
6170
+ lots: create$e(httpClient),
6171
+ lotitems: create$f(httpClient),
6171
6172
  carts: create$n(httpClient),
6172
- cph: create$3(httpClient),
6173
- webhooks: create$4(),
6173
+ cph: create$4(httpClient),
6174
+ webhooks: create(),
6174
6175
  actions: create$q(),
6175
6176
  bidderApplications: create$l(httpClient),
6176
- settings: create$6(httpClient),
6177
+ settings: create$5(httpClient),
6177
6178
  adjustments: create$o(httpClient),
6178
6179
  extras: create$m(httpClient),
6179
- productCodes: create$a(httpClient),
6180
- saleTemplates: create$8(httpClient),
6181
- taxRates: create$5(httpClient),
6182
- customers: create$k(httpClient),
6183
- customerLists: create$j(httpClient),
6184
- invoices: create$h(httpClient),
6185
- payments: create$c(httpClient),
6186
- payouts: create$b(httpClient),
6187
- search: create$7(httpClient),
6188
- files: create$i(),
6189
- contacts: create$2(httpClient),
6190
- ledger: create$1(httpClient),
6191
- sms: create(httpClient),
6180
+ productCodes: create$9(httpClient),
6181
+ saleTemplates: create$7(httpClient),
6182
+ taxRates: create$1(httpClient),
6183
+ customers: create$j(httpClient),
6184
+ customerLists: create$i(httpClient),
6185
+ invoices: create$g(httpClient),
6186
+ payments: create$b(httpClient),
6187
+ payouts: create$a(httpClient),
6188
+ search: create$6(httpClient),
6189
+ files: create$h(),
6190
+ contacts: create$3(httpClient),
6191
+ ledger: create$2(httpClient),
6192
6192
  };
6193
6193
  }
6194
6194
 
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) => {
@@ -302,8 +302,15 @@ function create$l(httpClient) {
302
302
  return applications;
303
303
  }
304
304
 
305
- // Path: studiojs/src/resources/markets.ts
306
305
  function create$k(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
+
312
+ // Path: studiojs/src/resources/markets.ts
313
+ function create$j(httpClient) {
307
314
  let customers = {
308
315
  list: async (marketId, lastId) => {
309
316
  let params = {};
@@ -352,7 +359,7 @@ function create$k(httpClient) {
352
359
 
353
360
  const DEFAULT_PAGE_SIZE = 100;
354
361
  const MAX_MEMBER_BATCH_SIZE = 100;
355
- function create$j(httpClient) {
362
+ function create$i(httpClient) {
356
363
  const customerLists = {
357
364
  list: async (marketId, options) => {
358
365
  return httpClient.get(`/${marketId}/lists`, buildListQueryParams(options));
@@ -5732,7 +5739,7 @@ const uploadSingleFile = async (input, token) => {
5732
5739
  };
5733
5740
 
5734
5741
  // Multipart Upload for Media to the MARTEYE Media Service
5735
- function create$i() {
5742
+ function create$h() {
5736
5743
  const files = {
5737
5744
  uploadSingleFile: async (input, token) => {
5738
5745
  return await uploadSingleFile(input, token);
@@ -5747,7 +5754,7 @@ function create$i() {
5747
5754
  return files;
5748
5755
  }
5749
5756
 
5750
- function create$h(httpClient) {
5757
+ function create$g(httpClient) {
5751
5758
  const invoices = {
5752
5759
  /**
5753
5760
  * List all invoices for a market with pagination
@@ -5775,7 +5782,7 @@ function create$h(httpClient) {
5775
5782
  return invoices;
5776
5783
  }
5777
5784
 
5778
- function create$g(httpClient) {
5785
+ function create$f(httpClient) {
5779
5786
  return {
5780
5787
  create: async (marketId, saleId, lotId, data) => {
5781
5788
  return httpClient.post(`/${marketId}/sales/${saleId}/lots/${lotId}/items`, data);
@@ -5792,7 +5799,7 @@ function create$g(httpClient) {
5792
5799
  /**
5793
5800
  * Defines the possible status values for a lot in a sale
5794
5801
  */
5795
- function create$f(httpClient) {
5802
+ function create$e(httpClient) {
5796
5803
  return {
5797
5804
  get: async (marketId, saleId, lotId, options) => {
5798
5805
  return httpClient.get(`/${marketId}/sales/${saleId}/lots/${lotId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -5821,7 +5828,7 @@ function create$f(httpClient) {
5821
5828
  };
5822
5829
  }
5823
5830
 
5824
- function create$e(httpClient) {
5831
+ function create$d(httpClient) {
5825
5832
  const markets = {
5826
5833
  get: async (marketId, options) => {
5827
5834
  return httpClient.get(`/${marketId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -5843,7 +5850,7 @@ function create$e(httpClient) {
5843
5850
  return markets;
5844
5851
  }
5845
5852
 
5846
- function create$d(httpClient) {
5853
+ function create$c(httpClient) {
5847
5854
  let members = {
5848
5855
  /**
5849
5856
  * List members (staff accounts) for a market with pagination
@@ -5874,7 +5881,7 @@ function create$d(httpClient) {
5874
5881
  return members;
5875
5882
  }
5876
5883
 
5877
- function create$c(httpClient) {
5884
+ function create$b(httpClient) {
5878
5885
  const payments = {
5879
5886
  /**
5880
5887
  * List all payments for a market with pagination
@@ -5902,7 +5909,7 @@ function create$c(httpClient) {
5902
5909
  return payments;
5903
5910
  }
5904
5911
 
5905
- function create$b(httpClient) {
5912
+ function create$a(httpClient) {
5906
5913
  const payouts = {
5907
5914
  /**
5908
5915
  * List all payouts for a market with pagination
@@ -5941,7 +5948,7 @@ function create$b(httpClient) {
5941
5948
  return payouts;
5942
5949
  }
5943
5950
 
5944
- function create$a(httpClient) {
5951
+ function create$9(httpClient) {
5945
5952
  return {
5946
5953
  list: async (marketId) => {
5947
5954
  return httpClient.get(`/${marketId}/product-codes`);
@@ -5958,7 +5965,7 @@ function create$a(httpClient) {
5958
5965
  };
5959
5966
  }
5960
5967
 
5961
- function create$9(httpClient) {
5968
+ function create$8(httpClient) {
5962
5969
  return {
5963
5970
  get: async (marketId, saleId, options) => {
5964
5971
  return httpClient.get(`/${marketId}/sales/${saleId}`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -5975,7 +5982,7 @@ function create$9(httpClient) {
5975
5982
  };
5976
5983
  }
5977
5984
 
5978
- function create$8(httpClient) {
5985
+ function create$7(httpClient) {
5979
5986
  return {
5980
5987
  list: async (marketId) => {
5981
5988
  return httpClient.get(`/${marketId}/sale-templates`);
@@ -5995,7 +6002,7 @@ function create$8(httpClient) {
5995
6002
  };
5996
6003
  }
5997
6004
 
5998
- function create$7(httpClient) {
6005
+ function create$6(httpClient) {
5999
6006
  let search = {
6000
6007
  /**
6001
6008
  * Search for documents within a market
@@ -6010,7 +6017,7 @@ function create$7(httpClient) {
6010
6017
  return search;
6011
6018
  }
6012
6019
 
6013
- function create$6(httpClient) {
6020
+ function create$5(httpClient) {
6014
6021
  return {
6015
6022
  get: async (marketId, options) => {
6016
6023
  return httpClient.get(`/${marketId}/settings`, (options === null || options === void 0 ? void 0 : options.at) ? { at: options.at } : undefined);
@@ -6018,60 +6025,13 @@ function create$6(httpClient) {
6018
6025
  };
6019
6026
  }
6020
6027
 
6021
- function create$5(httpClient) {
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) {
6028
+ function create$4(httpClient) {
6069
6029
  return {
6070
6030
  lookup: async (marketId, cph) => httpClient.get(`/${marketId}/cph`, { cph }),
6071
6031
  };
6072
6032
  }
6073
6033
 
6074
- function create$2(httpClient) {
6034
+ function create$3(httpClient) {
6075
6035
  return {
6076
6036
  list: async (marketId, customerId, params) => {
6077
6037
  const query = {};
@@ -6096,7 +6056,7 @@ function create$2(httpClient) {
6096
6056
  };
6097
6057
  }
6098
6058
 
6099
- function create$1(httpClient) {
6059
+ function create$2(httpClient) {
6100
6060
  let ledger = {
6101
6061
  /**
6102
6062
  * Get the current balance for a ledger account
@@ -6157,42 +6117,82 @@ function create$1(httpClient) {
6157
6117
  return ledger;
6158
6118
  }
6159
6119
 
6160
- function create(httpClient) {
6120
+ function create$1(httpClient) {
6161
6121
  return {
6162
- sendSMS: async (marketId, data) => httpClient.post(`/${marketId}/sms/send`, data),
6163
- getSMS: async (marketId, smsId) => httpClient.get(`/${marketId}/sms/${smsId}`),
6122
+ list: async (marketId) => {
6123
+ return httpClient.get(`/${marketId}/tax_rates`);
6124
+ },
6125
+ get: async (marketId, id) => {
6126
+ return httpClient.get(`/${marketId}/tax_rates/${id}`);
6127
+ },
6128
+ };
6129
+ }
6130
+
6131
+ // Path: studiojs/src/resources/markets.ts
6132
+ function create(_) {
6133
+ const webhooks = {
6134
+ /***
6135
+ * This is used to construct the webhook event from the request body
6136
+ * @param body the request body
6137
+ * @param signature the signature of the request taken from the header
6138
+ * @param endpointSecret the pre-shared secret
6139
+ * @returns the webhook event
6140
+ */
6141
+ constructEvent: async (bodyAsBuffer, signature, endpointSecret) => {
6142
+ if (!endpointSecret) {
6143
+ throw new Error("Endpoint secret is required");
6144
+ }
6145
+ if (!signature) {
6146
+ throw new Error("Signature is required");
6147
+ }
6148
+ let bodyText = bodyAsBuffer.toString();
6149
+ let expectedSignature = crypto.createHmac("sha256", endpointSecret)
6150
+ .update(bodyText)
6151
+ .digest("hex");
6152
+ if (signature !== expectedSignature) {
6153
+ console.error(`Unable to construct event. Signature mismatch.`, signature, "!=", expectedSignature);
6154
+ throw new Error(`Unable to construct event. Signature mismatch.`);
6155
+ }
6156
+ try {
6157
+ return JSON.parse(bodyText);
6158
+ }
6159
+ catch (e) {
6160
+ throw new Error(`Unable to construct event. ${e}`);
6161
+ }
6162
+ },
6164
6163
  };
6164
+ return webhooks;
6165
6165
  }
6166
6166
 
6167
6167
  function resources(httpClient) {
6168
6168
  return {
6169
6169
  activity: create$p(httpClient),
6170
- markets: create$e(httpClient),
6171
- members: create$d(httpClient),
6172
- sales: create$9(httpClient),
6173
- lots: create$f(httpClient),
6174
- lotitems: create$g(httpClient),
6170
+ broadcast: create$k(httpClient),
6171
+ markets: create$d(httpClient),
6172
+ members: create$c(httpClient),
6173
+ sales: create$8(httpClient),
6174
+ lots: create$e(httpClient),
6175
+ lotitems: create$f(httpClient),
6175
6176
  carts: create$n(httpClient),
6176
- cph: create$3(httpClient),
6177
- webhooks: create$4(),
6177
+ cph: create$4(httpClient),
6178
+ webhooks: create(),
6178
6179
  actions: create$q(),
6179
6180
  bidderApplications: create$l(httpClient),
6180
- settings: create$6(httpClient),
6181
+ settings: create$5(httpClient),
6181
6182
  adjustments: create$o(httpClient),
6182
6183
  extras: create$m(httpClient),
6183
- productCodes: create$a(httpClient),
6184
- saleTemplates: create$8(httpClient),
6185
- taxRates: create$5(httpClient),
6186
- customers: create$k(httpClient),
6187
- customerLists: create$j(httpClient),
6188
- invoices: create$h(httpClient),
6189
- payments: create$c(httpClient),
6190
- payouts: create$b(httpClient),
6191
- search: create$7(httpClient),
6192
- files: create$i(),
6193
- contacts: create$2(httpClient),
6194
- ledger: create$1(httpClient),
6195
- sms: create(httpClient),
6184
+ productCodes: create$9(httpClient),
6185
+ saleTemplates: create$7(httpClient),
6186
+ taxRates: create$1(httpClient),
6187
+ customers: create$j(httpClient),
6188
+ customerLists: create$i(httpClient),
6189
+ invoices: create$g(httpClient),
6190
+ payments: create$b(httpClient),
6191
+ payouts: create$a(httpClient),
6192
+ search: create$6(httpClient),
6193
+ files: create$h(),
6194
+ contacts: create$3(httpClient),
6195
+ ledger: create$2(httpClient),
6196
6196
  };
6197
6197
  }
6198
6198
 
@@ -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>;
@@ -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;