ti2-tourplan 1.0.54 → 1.0.56

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/index.js CHANGED
@@ -478,7 +478,10 @@ class Plugin {
478
478
  const replyObj = optionId
479
479
  ? await this.callTourplan(payload)
480
480
  : await this.cache.getOrExec({
481
- fnParams: [model],
481
+ // goway and pdnz uses the same AgentID and Password for agents
482
+ // but their endpoint is different
483
+ // so they had been overwritting each other's cache
484
+ fnParams: [model, hostConnectEndpoint],
482
485
  fn: () => this.callTourplan(payload),
483
486
  ttl: 60 * 60 * 2, // 2 hours
484
487
  forceRefresh: Boolean(forceRefresh),
@@ -492,7 +495,7 @@ class Plugin {
492
495
  }
493
496
  const supplierData = {
494
497
  supplierId: R.path(['SupplierId'], OptGeneral),
495
- supplierName: supplierName,
498
+ supplierName,
496
499
  supplierAddress: `${R.pathOr('', ['Address1'], OptGeneral)}, ${R.pathOr('', ['Address2'], OptGeneral)}, ${R.pathOr('', ['Address3'], OptGeneral)}, ${R.pathOr('', ['Address4'], OptGeneral)}, ${R.pathOr('', ['Address5'], OptGeneral)}`,
497
500
  serviceTypes: R.uniq(optionsGroupedBySupplierId.map(R.path(['OptGeneral', 'ButtonName']))),
498
501
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ti2-tourplan",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "Tourplan's TI2 Plugin",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -48,11 +48,14 @@ const translateTPOption = ({ optionsGroupedBySupplierId, supplierData }) => {
48
48
  let OptExtras = R.pathOr([], ['OptGeneral', 'OptExtras', 'OptExtra'], option);
49
49
  // console.log({ OptExtras })
50
50
  if (!Array.isArray(OptExtras)) OptExtras = [OptExtras];
51
+ const lastUpdateISO = R.path(['OptGeneral', 'LastUpdate'], option);
52
+ const lastUpdateTimestamp = lastUpdateISO ? new Date(lastUpdateISO).getTime() / 1000 : null;
51
53
  const keyData = {
52
54
  optionId: R.path(['Opt'], option),
53
55
  optionName: `${R.path(['OptGeneral', 'Description'], option)}${
54
56
  comment ? `-${comment}` : ''
55
57
  }`,
58
+ lastUpdateTimestamp,
56
59
  // Guides, Accommodation, Transfers, Entrance Fees, Meals, Other
57
60
  serviceType: typeof st === 'string' ? st : '',
58
61
  restrictions: {