@andersonalmeidax0/webcomponents 0.1.5 → 0.1.6

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/RestAPIAdapter.js CHANGED
@@ -14,7 +14,7 @@ import {PlatAPIError,PlatAPIReturnCodeError,PlatAPIAuthError,PlatAPIDBNotFound,P
14
14
  //https://docs.oracle.com/en/cloud/saas/marketing/eloqua-rest-api/op-api-rest-1.0-data-account-post.html
15
15
 
16
16
 
17
- var DEBUG_APIFETCH=true;
17
+ //var DEBUG_APIFETCH=true;
18
18
 
19
19
  //TODO:
20
20
  //1-tem que usar heranca para metodos new, validate, etc
@@ -84,8 +84,8 @@ function getStorageWithExpiry(key) {
84
84
  * tableName is entity (after server)
85
85
  * Server is option (can be null for local API ou not for remote APIs)
86
86
  *********************** */
87
- constructor(tableName,urlServer,tagData,token,pnewVO) {
88
-
87
+ constructor(tableName,urlServer,tagData,token,pnewVO,debug) {
88
+ this.DEBUG_APIFETCH=debug;
89
89
  this.tableName=tableName;
90
90
  this.urlServer=urlServer;
91
91
  this.tagData=tagData;
@@ -119,7 +119,7 @@ function getStorageWithExpiry(key) {
119
119
  async getJSONResponse(response) {
120
120
  var r=null;
121
121
  r=await response.json();
122
- if(DEBUG_APIFETCH)alert(JSON.stringify(r,null,2));
122
+ if(this.DEBUG_APIFETCH)alert(JSON.stringify(r,null,2));
123
123
  if(r.error)
124
124
  throw new PlatAPIReturnCodeError(r.error.message);
125
125
  return r;
@@ -185,10 +185,10 @@ function getStorageWithExpiry(key) {
185
185
  *
186
186
  *********************** */
187
187
  async myFetch3 (token,url,method,body) {
188
- if(DEBUG_APIFETCH)alert("url:"+url);
189
- if(DEBUG_APIFETCH)alert("m:"+method);
190
- if(DEBUG_APIFETCH)alert("body:"+body);
191
- if(DEBUG_APIFETCH)alert("token:"+JSON.stringify(token));
188
+ if(this.DEBUG_APIFETCH)alert("url:"+url);
189
+ if(this.DEBUG_APIFETCH)alert("m:"+method);
190
+ if(this.DEBUG_APIFETCH)alert("body:"+body);
191
+ if(this.DEBUG_APIFETCH)alert("token:"+JSON.stringify(token));
192
192
 
193
193
  var r = await fetch(url,
194
194
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andersonalmeidax0/webcomponents",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "webcomponents",
5
5
  "main": "webcomponents",
6
6
  "scripts": {
package/releasenotes.txt CHANGED
@@ -3,6 +3,7 @@
3
3
  0.1.2: with text labels for buttons
4
4
  0.1.3: RestAPIAdapter init
5
5
  0.1.4: Error move to root
6
+ 0.1.6: url correct, debug
6
7
 
7
8
 
8
9
  TODO