ti2 1.0.58 → 1.0.59

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.
@@ -38,7 +38,7 @@ const typeDefs = `
38
38
  available: Boolean
39
39
  pricing: Pricing
40
40
  unitPricing: [Pricing]
41
- offer: Offer
41
+ offer: [Offer]
42
42
  pickupAvailable: Boolean
43
43
  pickupRequired: Boolean
44
44
  pickupPoints: [PickupPoint]
package/index.js CHANGED
@@ -15,10 +15,6 @@ const EventEmitter = require('eventemitter2');
15
15
  const axios = require('axios');
16
16
  const curlirize = require('axios-curlirize');
17
17
 
18
- if (process.env.debug) {
19
- curlirize(axios);
20
- }
21
-
22
18
  const cacheSettings = {
23
19
  '*': [
24
20
  'getAffiliateAgents',
@@ -237,6 +233,9 @@ module.exports = async ({
237
233
  }
238
234
  return response;
239
235
  });
236
+ if (process.env.debug) {
237
+ curlirize(axiosPlugin);
238
+ }
240
239
  req.axios = async (...args) => axiosPlugin(...args).catch(err => {
241
240
  const errMsg = (() => {
242
241
  const defaultErr = R.omit(['config'], err.toJSON()); // default error
@@ -248,7 +247,7 @@ module.exports = async ({
248
247
  }
249
248
  return defaultErr;
250
249
  })();
251
- if (console.env.debug) console.error(`error in ${pluginName}`, args[0], errMsg);
250
+ if (process.env.debug) console.error(`error in ${pluginName}`, args[0], errMsg);
252
251
  if (ti2Events.events) {
253
252
  ti2Events.events.emit(`${pluginName}.axios.error`, {
254
253
  request: args[0],
@@ -310,7 +309,7 @@ module.exports = async ({
310
309
  return next(err);
311
310
  }
312
311
  if (process.env.CONSOLE_ERRORS || process.env.JEST_WORKER_ID) {
313
- console.error(R.path(['response', 'data'], err), err);
312
+ console.error(R.path(['response', 'data'], err));
314
313
  }
315
314
  return res.status((() => {
316
315
  if (!isNumber(err.status)) return 500;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ti2",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "Tourist Industry Exchange (TI2)",
5
5
  "main": "index.js",
6
6
  "scripts": {