@empathyco/x-adapter-platform 1.1.0-alpha.18 → 1.1.0-alpha.19

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.
@@ -70,7 +70,7 @@ function extractUrlParameters(url) {
70
70
  // eslint-disable-next-line unused-imports/no-unused-vars
71
71
  }
72
72
  catch (_error) {
73
- console.warn('Invalid url', url); // TODO Use Empathy's logger
73
+ console.warn('Invalid url', url);
74
74
  return {
75
75
  url,
76
76
  };
@@ -1 +1 @@
1
- {"version":3,"file":"url.utils.js","sourceRoot":"","sources":["../../../src/mappers/url.utils.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,UAAkB;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;IACxD,OAAO;QACL,GAAG;QACH,MAAM,EAAE;YACN,GAAG,MAAM;YACT,MAAM,EAAE,KAAK;SACd;KACF,CAAA;AACH,CAAC;AATD,sDASC;AAED;;;;;;;GAOG;AACH,SAAgB,4BAA4B,CAAC,iBAAyB;;IACpE,MAAM,cAAc,GAAG,qBAAqB,CAAC,iBAAiB,CAAC,CAAA;IAC/D,MAAM,oBAAoB,GAAG,cAAc,CAAC,MAAM,CAAA;IAElD,oBAAoB,CAAC,SAAS,GAAG,MAAA,oBAAoB,CAAC,CAAC,mCAAI,UAAU,CAAA;IACrE,OAAO,oBAAoB,CAAC,CAAC,CAAA;IAE7B,OAAO,cAAc,CAAA;AACvB,CAAC;AARD,oEAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,GAAW;IAI9C,MAAM,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAA;IACzD,IAAI;QACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC9B,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACnC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxB,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;aACzC;iBAAM,IAAI,KAAK,EAAE;gBAChB,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;aACtC;iBAAM;gBACL,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;aAC7B;QACH,CAAC,CAAC,CAAA;QACF,OAAO;YACL,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/C,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACzC,CAAA;QACD,yDAAyD;KAC1D;IAAC,OAAO,MAAM,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA,CAAC,4BAA4B;QAC7D,OAAO;YACL,GAAG;SACJ,CAAA;KACF;AACH,CAAC;AA5BD,oDA4BC","sourcesContent":["import type { TaggingRequest } from '@empathyco/x-types'\n\n/**\n * Extracts the tagging info from a URL.\n *\n * @param taggingUrl - The url containing the tagging info.\n *\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getTaggingInfoFromUrl(taggingUrl: string): TaggingRequest {\n const { url, params } = extractUrlParameters(taggingUrl)\n return {\n url,\n params: {\n ...params,\n follow: false,\n },\n }\n}\n\n/**\n * Generates the displayClick tagging info.\n *\n * @param displayTaggingUrl - The url containing the displayClick tagging info.\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getDisplayTaggingInfoFromUrl(displayTaggingUrl: string): TaggingRequest {\n const displayTagging = getTaggingInfoFromUrl(displayTaggingUrl)\n const displayTaggingParams = displayTagging.params\n\n displayTaggingParams.displayId = displayTaggingParams.q ?? 'no_query'\n delete displayTaggingParams.q\n\n return displayTagging\n}\n\n/**\n * Returns the base url path and an object with the query parameters.\n *\n * @param url - The url string to manipulate.\n *\n * @returns The object with the url information.\n *\n * @public\n */\nexport function extractUrlParameters(url: string): {\n url: string\n params?: Record<string, string[] | string>\n} {\n const searchParams = new Map<string, string | string[]>()\n try {\n const urlObject = new URL(url)\n urlObject.searchParams.forEach((value, key) => {\n const param = searchParams.get(key)\n if (Array.isArray(param)) {\n searchParams.set(key, [...param, value])\n } else if (param) {\n searchParams.set(key, [param, value])\n } else {\n searchParams.set(key, value)\n }\n })\n return {\n url: `${urlObject.origin}${urlObject.pathname}`,\n params: Object.fromEntries(searchParams),\n }\n // eslint-disable-next-line unused-imports/no-unused-vars\n } catch (_error) {\n console.warn('Invalid url', url) // TODO Use Empathy's logger\n return {\n url,\n }\n }\n}\n"]}
1
+ {"version":3,"file":"url.utils.js","sourceRoot":"","sources":["../../../src/mappers/url.utils.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,UAAkB;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;IACxD,OAAO;QACL,GAAG;QACH,MAAM,EAAE;YACN,GAAG,MAAM;YACT,MAAM,EAAE,KAAK;SACd;KACF,CAAA;AACH,CAAC;AATD,sDASC;AAED;;;;;;;GAOG;AACH,SAAgB,4BAA4B,CAAC,iBAAyB;;IACpE,MAAM,cAAc,GAAG,qBAAqB,CAAC,iBAAiB,CAAC,CAAA;IAC/D,MAAM,oBAAoB,GAAG,cAAc,CAAC,MAAM,CAAA;IAElD,oBAAoB,CAAC,SAAS,GAAG,MAAA,oBAAoB,CAAC,CAAC,mCAAI,UAAU,CAAA;IACrE,OAAO,oBAAoB,CAAC,CAAC,CAAA;IAE7B,OAAO,cAAc,CAAA;AACvB,CAAC;AARD,oEAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,GAAW;IAI9C,MAAM,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAA;IACzD,IAAI;QACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC9B,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACnC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxB,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;aACzC;iBAAM,IAAI,KAAK,EAAE;gBAChB,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;aACtC;iBAAM;gBACL,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;aAC7B;QACH,CAAC,CAAC,CAAA;QACF,OAAO;YACL,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/C,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACzC,CAAA;QACD,yDAAyD;KAC1D;IAAC,OAAO,MAAM,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;QAChC,OAAO;YACL,GAAG;SACJ,CAAA;KACF;AACH,CAAC;AA5BD,oDA4BC","sourcesContent":["import type { TaggingRequest } from '@empathyco/x-types'\n\n/**\n * Extracts the tagging info from a URL.\n *\n * @param taggingUrl - The url containing the tagging info.\n *\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getTaggingInfoFromUrl(taggingUrl: string): TaggingRequest {\n const { url, params } = extractUrlParameters(taggingUrl)\n return {\n url,\n params: {\n ...params,\n follow: false,\n },\n }\n}\n\n/**\n * Generates the displayClick tagging info.\n *\n * @param displayTaggingUrl - The url containing the displayClick tagging info.\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getDisplayTaggingInfoFromUrl(displayTaggingUrl: string): TaggingRequest {\n const displayTagging = getTaggingInfoFromUrl(displayTaggingUrl)\n const displayTaggingParams = displayTagging.params\n\n displayTaggingParams.displayId = displayTaggingParams.q ?? 'no_query'\n delete displayTaggingParams.q\n\n return displayTagging\n}\n\n/**\n * Returns the base url path and an object with the query parameters.\n *\n * @param url - The url string to manipulate.\n *\n * @returns The object with the url information.\n *\n * @public\n */\nexport function extractUrlParameters(url: string): {\n url: string\n params?: Record<string, string[] | string>\n} {\n const searchParams = new Map<string, string | string[]>()\n try {\n const urlObject = new URL(url)\n urlObject.searchParams.forEach((value, key) => {\n const param = searchParams.get(key)\n if (Array.isArray(param)) {\n searchParams.set(key, [...param, value])\n } else if (param) {\n searchParams.set(key, [param, value])\n } else {\n searchParams.set(key, value)\n }\n })\n return {\n url: `${urlObject.origin}${urlObject.pathname}`,\n params: Object.fromEntries(searchParams),\n }\n // eslint-disable-next-line unused-imports/no-unused-vars\n } catch (_error) {\n console.warn('Invalid url', url)\n return {\n url,\n }\n }\n}\n"]}
@@ -65,7 +65,7 @@ export function extractUrlParameters(url) {
65
65
  // eslint-disable-next-line unused-imports/no-unused-vars
66
66
  }
67
67
  catch (_error) {
68
- console.warn('Invalid url', url); // TODO Use Empathy's logger
68
+ console.warn('Invalid url', url);
69
69
  return {
70
70
  url,
71
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"url.utils.js","sourceRoot":"","sources":["../../../src/mappers/url.utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;IACxD,OAAO;QACL,GAAG;QACH,MAAM,EAAE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QACD,yDAAyD;KAC1D;IAAC,OAAO,MAAM,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA,CAAC,4BAA4B;QAC7D,OAAO;YACL,GAAG;SACJ,CAAA;KACF;AACH,CAAC","sourcesContent":["import type { TaggingRequest } from '@empathyco/x-types'\n\n/**\n * Extracts the tagging info from a URL.\n *\n * @param taggingUrl - The url containing the tagging info.\n *\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getTaggingInfoFromUrl(taggingUrl: string): TaggingRequest {\n const { url, params } = extractUrlParameters(taggingUrl)\n return {\n url,\n params: {\n ...params,\n follow: false,\n },\n }\n}\n\n/**\n * Generates the displayClick tagging info.\n *\n * @param displayTaggingUrl - The url containing the displayClick tagging info.\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getDisplayTaggingInfoFromUrl(displayTaggingUrl: string): TaggingRequest {\n const displayTagging = getTaggingInfoFromUrl(displayTaggingUrl)\n const displayTaggingParams = displayTagging.params\n\n displayTaggingParams.displayId = displayTaggingParams.q ?? 'no_query'\n delete displayTaggingParams.q\n\n return displayTagging\n}\n\n/**\n * Returns the base url path and an object with the query parameters.\n *\n * @param url - The url string to manipulate.\n *\n * @returns The object with the url information.\n *\n * @public\n */\nexport function extractUrlParameters(url: string): {\n url: string\n params?: Record<string, string[] | string>\n} {\n const searchParams = new Map<string, string | string[]>()\n try {\n const urlObject = new URL(url)\n urlObject.searchParams.forEach((value, key) => {\n const param = searchParams.get(key)\n if (Array.isArray(param)) {\n searchParams.set(key, [...param, value])\n } else if (param) {\n searchParams.set(key, [param, value])\n } else {\n searchParams.set(key, value)\n }\n })\n return {\n url: `${urlObject.origin}${urlObject.pathname}`,\n params: Object.fromEntries(searchParams),\n }\n // eslint-disable-next-line unused-imports/no-unused-vars\n } catch (_error) {\n console.warn('Invalid url', url) // TODO Use Empathy's logger\n return {\n url,\n }\n }\n}\n"]}
1
+ {"version":3,"file":"url.utils.js","sourceRoot":"","s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CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;aAC7B;QACH,CAAC,CAAC,CAAA;QACF,OAAO;YACL,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/C,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACzC,CAAA;QACD,yDAAyD;KAC1D;IAAC,OAAO,MAAM,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;QAChC,OAAO;YACL,GAAG;SACJ,CAAA;KACF;AACH,CAAC","sourcesContent":["import type { TaggingRequest } from '@empathyco/x-types'\n\n/**\n * Extracts the tagging info from a URL.\n *\n * @param taggingUrl - The url containing the tagging info.\n *\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getTaggingInfoFromUrl(taggingUrl: string): TaggingRequest {\n const { url, params } = extractUrlParameters(taggingUrl)\n return {\n url,\n params: {\n ...params,\n follow: false,\n },\n }\n}\n\n/**\n * Generates the displayClick tagging info.\n *\n * @param displayTaggingUrl - The url containing the displayClick tagging info.\n * @returns The object with the tagging info.\n *\n * @public\n */\nexport function getDisplayTaggingInfoFromUrl(displayTaggingUrl: string): TaggingRequest {\n const displayTagging = getTaggingInfoFromUrl(displayTaggingUrl)\n const displayTaggingParams = displayTagging.params\n\n displayTaggingParams.displayId = displayTaggingParams.q ?? 'no_query'\n delete displayTaggingParams.q\n\n return displayTagging\n}\n\n/**\n * Returns the base url path and an object with the query parameters.\n *\n * @param url - The url string to manipulate.\n *\n * @returns The object with the url information.\n *\n * @public\n */\nexport function extractUrlParameters(url: string): {\n url: string\n params?: Record<string, string[] | string>\n} {\n const searchParams = new Map<string, string | string[]>()\n try {\n const urlObject = new URL(url)\n urlObject.searchParams.forEach((value, key) => {\n const param = searchParams.get(key)\n if (Array.isArray(param)) {\n searchParams.set(key, [...param, value])\n } else if (param) {\n searchParams.set(key, [param, value])\n } else {\n searchParams.set(key, value)\n }\n })\n return {\n url: `${urlObject.origin}${urlObject.pathname}`,\n params: Object.fromEntries(searchParams),\n }\n // eslint-disable-next-line unused-imports/no-unused-vars\n } catch (_error) {\n console.warn('Invalid url', url)\n return {\n url,\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-adapter-platform",
3
- "version": "1.1.0-alpha.18",
3
+ "version": "1.1.0-alpha.19",
4
4
  "description": "A search client for the Empathy Platform API",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -45,9 +45,9 @@
45
45
  "prepublishOnly": "pnpm run build"
46
46
  },
47
47
  "dependencies": {
48
- "@empathyco/x-adapter": "^8.1.0-alpha.3",
49
- "@empathyco/x-types": "^10.1.0-alpha.13",
50
- "@empathyco/x-utils": "^1.0.3-alpha.3",
48
+ "@empathyco/x-adapter": "^8.1.0-alpha.4",
49
+ "@empathyco/x-types": "^10.1.0-alpha.14",
50
+ "@empathyco/x-utils": "^1.0.3-alpha.4",
51
51
  "tslib": "~2.6.0"
52
52
  },
53
53
  "devDependencies": {
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "558d522cf94c5dcecee09689de8aea5b2d16cbfe"
66
+ "gitHead": "4d065ad22ccadaaa5d6e590208d2cd2b3cc995f5"
67
67
  }