@zkp2p/providers 7.0.0 → 7.2.0

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.
@@ -119,10 +119,11 @@
119
119
  "mercadolibre.com",
120
120
  "www.mercadolibre.com"
121
121
  ],
122
- "internal": {
123
- "actionLink": "https://www.mercadopago.com.ar/money-out/transfer/",
124
- "actionCompletedUrlRegex": "https://www.mercadopago.com.ar/money-out/transfer/congrats\\?data=\\S+",
125
- "injectedJavaScript": "(function(){\n try{\n var DETAILS={RECIPIENT_ID:'{{RECIPIENT_ID}}',AMOUNT:'{{AMOUNT}}'};\n function xFirst(xpath){try{var r=document.evaluate(xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);return r&&r.singleNodeValue?r.singleNodeValue:null;}catch(e){return null;}}\n function q(sel){try{return document.querySelector(sel);}catch(e){return null;}}\n\n function setNative(node,val){\n try{var desc=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value');if(desc&&desc.set)desc.set.call(node,String(val));else node.value=String(val);}catch(e){node.value=String(val);} \n try{node.dispatchEvent(new Event('input',{bubbles:true}));}catch(e){}\n }\n function typeChars(node, seq){\n try{\n node.focus&&node.focus();\n setNative(node,'');\n try{node.setSelectionRange(0,0);}catch(e){}\n for(var i=0;i<seq.length;i++){\n var c=seq[i];\n try{node.dispatchEvent(new InputEvent('beforeinput',{inputType:'insertText',data:c,bubbles:true,cancelable:true}))}catch(e){}\n try{node.dispatchEvent(new KeyboardEvent('keydown',{key:c,bubbles:true}))}catch(e){}\n setNative(node,(node.value||'')+c);\n try{node.dispatchEvent(new KeyboardEvent('keyup',{key:c,bubbles:true}))}catch(e){}\n }\n try{node.dispatchEvent(new Event('change',{bubbles:true}))}catch(e){}\n return true;\n }catch(e){return false;}\n }\n\n // ===== Amount helpers (comma-decimal, no thousands dots typed) =====\n function getHiddenValue(node){\n try{var h=node&&node.parentElement&&node.parentElement.querySelector('.andes-amount-field__hidden-content');return h?String(h.textContent||'').trim():String(node.value||'');}catch(e){return String(node&&node.value||'');}\n }\n function stripDots(s){return String(s||'').replace(/\\./g,'');}\n function normalizeAmountCommaOnly(raw){\n try{\n var s=String(raw||'').trim(); if(!s) return '';\n s=s.replace(/\\s+/g,'');\n var lastDot=s.lastIndexOf('.');\n var lastComma=s.lastIndexOf(',');\n var dec=(lastDot>lastComma)?'.':','; // whichever appears last is decimal\n var parts=dec==='.'?s.split('.') : s.split(',');\n var intPart=parts[0].replace(/[.,]/g,''); // remove all separators\n var fracPart=(parts[1]||'').replace(/[.,]/g,'').slice(0,2);\n return fracPart? (intPart+','+fracPart) : intPart; // use comma as decimal, no dots\n }catch(e){return String(raw||'');}\n }\n function hvMatchesExpected(node, expected){\n var hv=getHiddenValue(node);\n return stripDots(hv)===stripDots(expected) && expected.length>0;\n }\n function typeAmountCommaOnly(node, raw){\n var expected=normalizeAmountCommaOnly(raw); // e.g., '1000,12'\n typeChars(node, expected.split(''));\n try{ node.focus&&node.focus(); }catch(e){}\n setTimeout(function(){\n try{ if(!hvMatchesExpected(node, expected)){ setNative(node,''); typeChars(node, expected.split('')); try{ node.focus&&node.focus(); }catch(e){} }\n }catch(e){}\n }, 160);\n // Persist for a few seconds in case mask clears it again\n try{\n if(!node.__zkp2p_amt_norm_guard){\n node.__zkp2p_amt_norm_guard=true;\n var until=Date.now()+8000;\n var t=setInterval(function(){\n if(Date.now()>until){ clearInterval(t); return; }\n try{ if(!hvMatchesExpected(node, expected)){ setNative(node,''); typeChars(node, expected.split('')); } }catch(e){}\n }, 300);\n }\n }catch(e){}\n }\n\n // ===== CVU stabilizers (unchanged) =====\n function attachStabilizers(node,want,ms){\n try{\n if(node.__zkp2p_stable) return; node.__zkp2p_stable=true;\n var until = Date.now() + (ms||5000);\n var wantStr = String(want||'');\n function reassert(){\n try{\n if(Date.now()>until) return;\n var now=String(node.value||'');\n if(now!==wantStr && wantStr){ setNative(node,wantStr); try{node.setAttribute('value',wantStr)}catch(e){} try{node.defaultValue=wantStr}catch(e){} try{node.dispatchEvent(new Event('change',{bubbles:true}))}catch(e){} }\n }catch(e){}\n }\n node.addEventListener('blur',function(){ setTimeout(reassert,20); }, true);\n node.addEventListener('focus',function(){ setTimeout(reassert,80); }, true);\n node.addEventListener('input',function(){ setTimeout(reassert,120); }, true);\n setTimeout(reassert,100);\n var t=setInterval(function(){ if(Date.now()>until){clearInterval(t);} else { reassert(); } }, 300);\n }catch(e){}\n }\n\n function fill(){\n var ok=true;\n // CVU (unchanged)\n var cvu=DETAILS.RECIPIENT_ID||DETAILS.recipient||DETAILS.recipientId||DETAILS.cvu||'';\n if(cvu){\n var cvuEl=xFirst(\"//section[contains(@class,'new-account-form')]//input[contains(@class,'andes-form-control__field')]\")||q(\"input[name='identification_account']\")||q('section.new-account-form input.andes-form-control__field');\n if(cvuEl&&!cvuEl.getAttribute('data-zkp2p-filled')){\n typeChars(cvuEl, String(cvu).split(''));\n attachStabilizers(cvuEl,cvu,6000);\n try{ cvuEl.focus && cvuEl.focus(); }catch(e){}\n cvuEl.setAttribute('data-zkp2p-filled','1');\n } else if(!cvuEl){ ok=false; }\n }\n // Amount (comma-decimal, no thousands dots typed)\n var amtRaw=DETAILS.AMOUNT||DETAILS.amount||DETAILS.amt||'';\n if(amtRaw){\n var amtEl=q('#amount-field-input')||q('input.andes-amount-field__input');\n if(amtEl&&!amtEl.getAttribute('data-zkp2p-filled')){\n typeAmountCommaOnly(amtEl, amtRaw);\n try{ amtEl.focus && amtEl.focus(); }catch(e){}\n amtEl.setAttribute('data-zkp2p-filled','1');\n } else if(!amtEl){ ok=false; }\n }\n return ok;\n }\n\n if(!fill()){\n var tries=0; var t=setInterval(function(){ tries++; if(fill()||tries>500){ clearInterval(t); } }, 120);\n }\n (function(){var push=history.pushState,rep=history.replaceState,emit=function(){try{window.dispatchEvent(new Event('locationchange'));}catch(e){}};history.pushState=function(){var r=push.apply(this,arguments);emit();return r;};history.replaceState=function(){var r=rep.apply(this,arguments);emit();return r;};window.addEventListener('popstate',emit);window.addEventListener('locationchange',function(){fill();});})();\n }catch(e){}\n return true;\n})();"
122
+ "useExternalAction": true,
123
+ "external": {
124
+ "actionLink": "mercadopago://",
125
+ "appStoreLink": "https://apps.apple.com/us/app/mercado-pago-cuenta-digital/id925436649",
126
+ "playStoreLink": "https://play.google.com/store/apps/details?id=com.mercadopago.wallet"
126
127
  }
127
128
  }
128
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/providers",
3
- "version": "7.0.0",
3
+ "version": "7.2.0",
4
4
  "description": "Provider JSON templates for ZKP2P",
5
5
  "scripts": {
6
6
  "start": "node index.js"
@@ -7,11 +7,11 @@
7
7
  "body": "",
8
8
  "metadata": {
9
9
  "platform": "paypal",
10
- "urlRegex": "https://www.paypal.com/myaccount/activities/filter/\\?q=ZnJlZV90ZXh0X3NlYXJjaD0mc3RhcnRfZGF0ZT0yMDI1LTAxLTAxJmVuZF9kYXRlPTIwMzAtMTItMzEmdHlwZT0mc3RhdHVzPSZjdXJyZW5jeT0mZmlsdGVyX2lkPSZpc3N1YW5jZV9wcm9kdWN0X25hbWU9JmFzc2V0X25hbWVzPSZhc3NldF9zeW1ib2xzPQ",
10
+ "urlRegex": "^https://www.paypal.com/myaccount/activities/filter/\\?q=.*$",
11
11
  "method": "GET",
12
12
  "fallbackUrlRegex": "",
13
13
  "fallbackMethod": "",
14
- "preprocessRegex": "",
14
+ "preprocessRegex": "<pre[^>]*>([\\s\\S]*?)<\\/pre>",
15
15
  "transactionsExtraction": {
16
16
  "transactionJsonPathListSelector": "$.data.data.activity.transactions",
17
17
  "transactionJsonPathSelectors": {
@@ -97,5 +97,21 @@
97
97
  "jsonPath": "$.data.primitiveTimeCreated",
98
98
  "xPath": ""
99
99
  }
100
- ]
100
+ ],
101
+ "mobile": {
102
+ "includeAdditionalCookieDomains": [],
103
+ "additionalClientOptions": {
104
+ "cipherSuites": [
105
+ "TLS_CHACHA20_POLY1305_SHA256",
106
+ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
107
+ "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
108
+ ]
109
+ },
110
+ "useExternalAction": true,
111
+ "external": {
112
+ "actionLink": "paypal://",
113
+ "appStoreLink": "https://apps.apple.com/us/app/paypal-pay-send-save/id283646709",
114
+ "playStoreLink": "https://play.google.com/store/apps/details?id=com.paypal.android.p2pmobile&hl=en_US"
115
+ }
116
+ }
101
117
  }
@@ -130,5 +130,74 @@
130
130
  "appStoreLink": "https://apps.apple.com/us/app/revolut/id370619147",
131
131
  "playStoreLink": "https://play.google.com/store/apps/details?id=com.revolut.revolut"
132
132
  }
133
- }
133
+ },
134
+ "additionalProofs": [
135
+ {
136
+ "url": "https://app.revolut.com/api/retail/user/current/transactions/last?count=20",
137
+ "method": "GET",
138
+ "body": "",
139
+ "paramNames": [],
140
+ "paramSelectors": [],
141
+ "skipRequestHeaders": [
142
+ "x-device-id",
143
+ "Cookie"
144
+ ],
145
+ "secretHeaders": [
146
+ "x-device-id",
147
+ "Cookie"
148
+ ],
149
+ "responseMatches": [
150
+ {
151
+ "type": "regex",
152
+ "value": "\"amount\":(?<amount>[0-9\\-]+)"
153
+ },
154
+ {
155
+ "type": "regex",
156
+ "value": "\"completedDate\":(?<completedDate>[0-9]+)"
157
+ },
158
+ {
159
+ "type": "regex",
160
+ "value": "\"currency\":\"(?<currency>[^\"]+)\""
161
+ },
162
+ {
163
+ "type": "regex",
164
+ "value": "\"id\":\"(?<id>[^\"]+)\""
165
+ },
166
+ {
167
+ "type": "regex",
168
+ "value": "\"state\":\"(?<state>[^\"]+)\""
169
+ },
170
+ {
171
+ "type": "regex",
172
+ "value": "\"username\":\"(?<username>[^\"]+)\""
173
+ }
174
+ ],
175
+ "responseRedactions": [
176
+ {
177
+ "jsonPath": "$.[{{INDEX}}].counterpart.amount",
178
+ "xPath": ""
179
+ },
180
+ {
181
+ "jsonPath": "$.[{{INDEX}}].completedDate",
182
+ "xPath": ""
183
+ },
184
+ {
185
+ "jsonPath": "$.[{{INDEX}}].counterpart.currency",
186
+ "xPath": ""
187
+ },
188
+ {
189
+ "jsonPath": "$.[{{INDEX}}].id",
190
+ "xPath": ""
191
+ },
192
+ {
193
+ "jsonPath": "$.[{{INDEX}}].recipient.username",
194
+ "xPath": ""
195
+ },
196
+ {
197
+ "jsonPath": "$.[{{INDEX}}].state",
198
+ "xPath": ""
199
+ }
200
+ ]
201
+ }
202
+ ]
134
203
  }