@aloma.io/integration-sdk 3.0.11 → 3.0.13
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/build/internal/index.mjs
    CHANGED
    
    | 
         @@ -58,9 +58,10 @@ class Fetcher { 
     | 
|
| 
       58 
58 
     | 
    
         
             
                    var local = this, baseUrl = local.baseUrl;
         
     | 
| 
       59 
59 
     | 
    
         
             
                    if (retries == null)
         
     | 
| 
       60 
60 
     | 
    
         
             
                        retries = local.retry;
         
     | 
| 
      
 61 
     | 
    
         
            +
                    const theURL = `${baseUrl?.endsWith("/") ? baseUrl : baseUrl + "/"}${url}`.replace(/\/\/+/gi, "/");
         
     | 
| 
       61 
62 
     | 
    
         
             
                    try {
         
     | 
| 
       62 
     | 
    
         
            -
                        const theURL = `${baseUrl?.endsWith("/") ? baseUrl : baseUrl + "/"}${url}`.replace(/\/\/+/gi, "/");
         
     | 
| 
       63 
63 
     | 
    
         
             
                        await local.customize(options, args);
         
     | 
| 
      
 64 
     | 
    
         
            +
                        console.log(options, args);
         
     | 
| 
       64 
65 
     | 
    
         
             
                        const ret = await fetch(theURL, options);
         
     | 
| 
       65 
66 
     | 
    
         
             
                        const status = await ret.status;
         
     | 
| 
       66 
67 
     | 
    
         
             
                        if (status > 399) {
         
     | 
| 
         @@ -73,7 +74,7 @@ class Fetcher { 
     | 
|
| 
       73 
74 
     | 
    
         
             
                    }
         
     | 
| 
       74 
75 
     | 
    
         
             
                    catch (e) {
         
     | 
| 
       75 
76 
     | 
    
         
             
                        --retries;
         
     | 
| 
       76 
     | 
    
         
            -
                        console.log( 
     | 
| 
      
 77 
     | 
    
         
            +
                        console.log(theURL, e, this);
         
     | 
| 
       77 
78 
     | 
    
         
             
                        if (retries <= 0)
         
     | 
| 
       78 
79 
     | 
    
         
             
                            throw e;
         
     | 
| 
       79 
80 
     | 
    
         
             
                        return local.onError(e, url, options, retries, args);
         
     | 
    
        package/package.json
    CHANGED
    
    
    
        package/src/internal/index.mjs
    CHANGED
    
    | 
         @@ -72,13 +72,15 @@ class Fetcher { 
     | 
|
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
                if (retries == null) retries = local.retry;
         
     | 
| 
       74 
74 
     | 
    
         | 
| 
       75 
     | 
    
         
            -
                 
     | 
| 
       76 
     | 
    
         
            -
                   
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
       78 
     | 
    
         
            -
                  }${url}`.replace(/\/\/+/gi, "/");
         
     | 
| 
      
 75 
     | 
    
         
            +
                const theURL = `${
         
     | 
| 
      
 76 
     | 
    
         
            +
                  baseUrl?.endsWith("/") ? baseUrl : baseUrl + "/"
         
     | 
| 
      
 77 
     | 
    
         
            +
                }${url}`.replace(/\/\/+/gi, "/");
         
     | 
| 
       79 
78 
     | 
    
         | 
| 
      
 79 
     | 
    
         
            +
                try {
         
     | 
| 
       80 
80 
     | 
    
         
             
                  await local.customize(options, args);
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
      
 82 
     | 
    
         
            +
                  console.log(options, args);
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
       82 
84 
     | 
    
         
             
                  const ret = await fetch(theURL, options);
         
     | 
| 
       83 
85 
     | 
    
         
             
                  const status = await ret.status;
         
     | 
| 
       84 
86 
     | 
    
         | 
| 
         @@ -94,7 +96,7 @@ class Fetcher { 
     | 
|
| 
       94 
96 
     | 
    
         
             
                } catch (e) {
         
     | 
| 
       95 
97 
     | 
    
         
             
                  --retries;
         
     | 
| 
       96 
98 
     | 
    
         | 
| 
       97 
     | 
    
         
            -
                  console.log( 
     | 
| 
      
 99 
     | 
    
         
            +
                  console.log(theURL, e);
         
     | 
| 
       98 
100 
     | 
    
         | 
| 
       99 
101 
     | 
    
         
             
                  if (retries <= 0) throw e;
         
     | 
| 
       100 
102 
     | 
    
         | 
| 
         @@ -156,7 +158,6 @@ class OAuthFetcher extends Fetcher { 
     | 
|
| 
       156 
158 
     | 
    
         
             
                const local = this;
         
     | 
| 
       157 
159 
     | 
    
         
             
                const token = await local.getToken(args.forceTokenRefresh);
         
     | 
| 
       158 
160 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
                options = { ...options };
         
     | 
| 
       160 
161 
     | 
    
         
             
                options.headers = {
         
     | 
| 
       161 
162 
     | 
    
         
             
                  ...options.headers,
         
     | 
| 
       162 
163 
     | 
    
         
             
                  Authorization: `Bearer ${token}`,
         
     |