ec4w_validator 0.0.1001111221 → 0.0.1001111222

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.
@@ -0,0 +1,22 @@
1
+ ### Building and running your application
2
+
3
+ When you're ready, start your application by running:
4
+ `docker compose down && docker compose up --build`.
5
+
6
+ Your application will be available at http://localhost:5173.
7
+
8
+ ### Deploying your application to the cloud
9
+
10
+ First, build your image, e.g.: `docker build -t myapp .`.
11
+ If your cloud uses a different CPU architecture than your development
12
+ machine (e.g., you are on a Mac M1 and your cloud provider is amd64),
13
+ you'll want to build the image for that platform, e.g.:
14
+ `docker build --platform=linux/amd64 -t myapp .`.
15
+
16
+ Then, push it to your registry, e.g. `docker push myregistry.com/myapp`.
17
+
18
+ Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/)
19
+ docs for more detail on building and pushing.
20
+
21
+ ### References
22
+ * [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)
@@ -0,0 +1 @@
1
+ export {}
package/dist/index.js CHANGED
File without changes
package/dist/vite.svg CHANGED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ec4w_validator",
3
3
  "private": false,
4
- "version": "0.0.1001111221",
4
+ "version": "0.0.1001111222",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -11,7 +11,9 @@
11
11
  "test-watch": "vitest",
12
12
  "test-coverage": "vitest run --coverage"
13
13
  },
14
- "files": ["dist"],
14
+ "files": [
15
+ "./dist/"
16
+ ],
15
17
  "main": "./dist/index.umd.cjs",
16
18
  "module": "./dist/index.js",
17
19
  "exports": {
@@ -29,4 +31,4 @@
29
31
  "vite": "^7.2.4",
30
32
  "vitest": "^4.0.18"
31
33
  }
32
- }
34
+ }
@@ -1 +0,0 @@
1
- (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.fafafa={}))})(this,(function(n){"use strict";class a{#t=[];constructor(e){this.#t=e}conclude(){const e=[];for(const i of this.#t){if(!i.url)continue;const s=new URL(i.url);d.canBe(i.method,s)?e.push(new d(i.method,s)):f.canBe(i.method,s)&&e.push(new f(i.method,s))}if(e.length<1)throw new Error("no ( sentRequest ) detected");const t=[];{let i=null;for(const s of e)s instanceof d?i=s:s instanceof f&&t.push(new c(i,s))}if(t.length<1)throw new Error("no ( UPDE | EC4w ) requests detected");return new h(t)}static emIsValid(e){if(!e||e.startsWith("tv.1")===!1||e==="tv.1"||/^tv\.1~e[0-9]/.test(e))return!1;const t=e.split("~"),i=t.length;if(i<2)return!1;for(let s=1;s<i;++s){if(t[s]==="")return!1;const[g,v]=t[s].split(".");if(!g||!v)return!1}return!0}}const u=Object.freeze({em_validInConversion:"valid `em` in Conversion payload",em_validInUPDE:"valid `em` in UPDE payload"}),l=Object.freeze({em_invalidInConversion:"invalid `em` in Conversion payload",em_invalidInUPDE:"invalid `em` in UPDE payload",ecsid_mismatch:"mismatch `ecsid` between UPDE and Conversion payload",conversionId_mismatch:"mismatch `Conversion ID` between UPDE and Conversion payload",noEC4W_request:"no valid EC4W requests detected at all"});class c{#t=null;#e;constructor(e,t){this.#t=e,this.#e=t}get result(){return!this.#t&&!this.#e?new r(!1,l.noEC4W_request):this.#s()===!1?new r(!1,l.ecsid_mismatch):this.#n()}#s(){return this.#e===null?!1:this.#t===null?!0:!(!this.#t.ecsid||!this.#e.ecsid||this.#t.ecsid!==this.#e.ecsid)}#n(){if(this.#e===null)return new r(!1,l.em_invalidInConversion);if(this.#t===null){const t=this.#e.emIsValid();return t?new r(t,u.em_validInConversion):new r(t,l.em_invalidInConversion)}if(this.#e.em===null){const t=this.#t.emIsValid();return t?new r(t,u.em_validInUPDE):new r(t,l.em_invalidInUPDE)}const e=this.#e.emIsValid();return e?new r(e,u.em_validInConversion):new r(e,l.em_invalidInConversion)}}class r{#t;get isGood(){return this.#t}#e;get message(){return this.#e}constructor(e,t){this.#t=e,this.#e=t}}class d{static canBe(e,t){return!(e!=="GET"||t.toString().startsWith("https://www.google.com/ccm/form-data/")===!1||t.searchParams.get("em")===null)}#t;get method(){return this.#t}#e;get url(){return this.#e.toString()}constructor(e,t){this.#t=e,this.#e=t}get em(){return this.#e.searchParams.get("em")}get ecsid(){return this.#e.searchParams.get("ecsid")}emIsValid(){return a.emIsValid(this.em)}}class f{static canBe(e,t){return!(e!=="GET"||t.toString().startsWith("https://www.googleadservices.com/ccm/conversion/")===!1||t.searchParams.get("label")===null)}#t;get method(){return this.#t}#e;get url(){return this.#e.toString()}constructor(e,t){this.#t=e,this.#e=t}get em(){return this.#e.searchParams.get("em")}get ecsid(){return this.#e.searchParams.get("ecsid")}emIsValid(){return a.emIsValid(this.em)}}class h{EC4W_Requests=[];messages=[];constructor(e){if(!e||e.length<1)throw new Error("no requests detected");this.EC4W_Requests=e}get invalidRequest(){for(const e of this.EC4W_Requests)if(e.result.isGood===!1)return e;return null}get validRequest(){for(const e of this.EC4W_Requests)if(e.result.isGood)return e;return null}}class m{url="https://";method="GET";constructor(e,t){this.url=e,this.method=t}}n.Conversion_Request=f,n.EC4W_ErrorMessages=l,n.EC4W_Request=c,n.EC4W_Result=h,n.EC4W_ValidMessages=u,n.EC4W_Validator=a,n.SentRequest=m,n.UPDE_Request=d,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));