@aloma.io/integration-sdk 3.7.43 → 3.7.45
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/builder/runtime-context.mjs +1 -0
 - package/build/controller/index.d.mts +2 -0
 - package/build/controller/index.mjs +6 -0
 - package/build/internal/index.mjs +10 -10
 - package/package.json +1 -1
 - package/src/builder/runtime-context.mts +1 -0
 - package/src/controller/index.mts +8 -0
 - package/src/internal/index.mts +5 -5
 
| 
         @@ -4,6 +4,7 @@ export declare abstract class AbstractController { 
     | 
|
| 
       4 
4 
     | 
    
         
             
                protected start(): Promise<void>;
         
     | 
| 
       5 
5 
     | 
    
         
             
                protected stop(isShutdown?: boolean): Promise<void>;
         
     | 
| 
       6 
6 
     | 
    
         
             
                protected configQuery(arg: any): Promise<any>;
         
     | 
| 
      
 7 
     | 
    
         
            +
                protected autocomplete(arg: any): Promise<any>;
         
     | 
| 
       7 
8 
     | 
    
         
             
                protected fallback(arg: any): Promise<any>;
         
     | 
| 
       8 
9 
     | 
    
         
             
                protected endpoint(arg: any): Promise<any>;
         
     | 
| 
       9 
10 
     | 
    
         
             
                protected newTask(name: string, data: any): Promise<string>;
         
     | 
| 
         @@ -32,6 +33,7 @@ export declare abstract class AbstractController { 
     | 
|
| 
       32 
33 
     | 
    
         
             
                protected healthCheck(): Promise<any>;
         
     | 
| 
       33 
34 
     | 
    
         
             
                __endpoint(arg: any): Promise<any | null>;
         
     | 
| 
       34 
35 
     | 
    
         
             
                __configQuery(arg: any): Promise<any | null>;
         
     | 
| 
      
 36 
     | 
    
         
            +
                __autocomplete(arg: any): Promise<any | null>;
         
     | 
| 
       35 
37 
     | 
    
         
             
                __default(arg: any): Promise<any | null>;
         
     | 
| 
       36 
38 
     | 
    
         
             
                __healthCheck(): Promise<any>;
         
     | 
| 
       37 
39 
     | 
    
         
             
                _doStart(config: any, client: any, newTask: any, updateTask: any, getClient: any, getBlob: any, getBlobContent: any, createBlob: any): Promise<void>;
         
     | 
| 
         @@ -6,6 +6,9 @@ export class AbstractController { 
     | 
|
| 
       6 
6 
     | 
    
         
             
                configQuery(arg) {
         
     | 
| 
       7 
7 
     | 
    
         
             
                    return Promise.resolve({});
         
     | 
| 
       8 
8 
     | 
    
         
             
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
                autocomplete(arg) {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    return Promise.resolve({});
         
     | 
| 
      
 11 
     | 
    
         
            +
                }
         
     | 
| 
       9 
12 
     | 
    
         
             
                fallback(arg) {
         
     | 
| 
       10 
13 
     | 
    
         
             
                    throw new Error("method not found");
         
     | 
| 
       11 
14 
     | 
    
         
             
                }
         
     | 
| 
         @@ -39,6 +42,9 @@ export class AbstractController { 
     | 
|
| 
       39 
42 
     | 
    
         
             
                async __configQuery(arg) {
         
     | 
| 
       40 
43 
     | 
    
         
             
                    return this.configQuery(arg);
         
     | 
| 
       41 
44 
     | 
    
         
             
                }
         
     | 
| 
      
 45 
     | 
    
         
            +
                async __autocomplete(arg) {
         
     | 
| 
      
 46 
     | 
    
         
            +
                    return this.autocomplete(arg);
         
     | 
| 
      
 47 
     | 
    
         
            +
                }
         
     | 
| 
       42 
48 
     | 
    
         
             
                async __default(arg) {
         
     | 
| 
       43 
49 
     | 
    
         
             
                    return this.fallback(arg);
         
     | 
| 
       44 
50 
     | 
    
         
             
                }
         
     | 
    
        package/build/internal/index.mjs
    CHANGED
    
    | 
         @@ -125,8 +125,8 @@ ${text} 
     | 
|
| 
       125 
125 
     | 
    
         
             
                                        that._oauth.authorizationURL;
         
     | 
| 
       126 
126 
     | 
    
         
             
                                    if (!authorizationURL)
         
     | 
| 
       127 
127 
     | 
    
         
             
                                        throw new Error("authorizationURL not configured");
         
     | 
| 
       128 
     | 
    
         
            -
                                    const clientId =  
     | 
| 
       129 
     | 
    
         
            -
                                         
     | 
| 
      
 128 
     | 
    
         
            +
                                    const clientId = decrypted.clientId ||
         
     | 
| 
      
 129 
     | 
    
         
            +
                                        process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       130 
130 
     | 
    
         
             
                                        this._oauth.clientId;
         
     | 
| 
       131 
131 
     | 
    
         
             
                                    if (!clientId)
         
     | 
| 
       132 
132 
     | 
    
         
             
                                        throw new Error("clientId not configured");
         
     | 
| 
         @@ -156,13 +156,13 @@ ${text} 
     | 
|
| 
       156 
156 
     | 
    
         
             
                                    const doFinish = async () => {
         
     | 
| 
       157 
157 
     | 
    
         
             
                                        if (!arg.code || !arg.redirectURI)
         
     | 
| 
       158 
158 
     | 
    
         
             
                                            throw new Error("need code and redirectUri");
         
     | 
| 
       159 
     | 
    
         
            -
                                        const clientId =  
     | 
| 
       160 
     | 
    
         
            -
                                             
     | 
| 
      
 159 
     | 
    
         
            +
                                        const clientId = decrypted.clientId ||
         
     | 
| 
      
 160 
     | 
    
         
            +
                                            process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       161 
161 
     | 
    
         
             
                                            that._oauth.clientId;
         
     | 
| 
       162 
162 
     | 
    
         
             
                                        if (!clientId)
         
     | 
| 
       163 
163 
     | 
    
         
             
                                            throw new Error("clientId not configured");
         
     | 
| 
       164 
     | 
    
         
            -
                                        const clientSecret =  
     | 
| 
       165 
     | 
    
         
            -
                                             
     | 
| 
      
 164 
     | 
    
         
            +
                                        const clientSecret = decrypted.clientSecret ||
         
     | 
| 
      
 165 
     | 
    
         
            +
                                            process.env.OAUTH_CLIENT_SECRET ||
         
     | 
| 
       166 
166 
     | 
    
         
             
                                            that._oauth.clientSecret;
         
     | 
| 
       167 
167 
     | 
    
         
             
                                        if (!clientSecret)
         
     | 
| 
       168 
168 
     | 
    
         
             
                                            throw new Error("clientSecret not configured");
         
     | 
| 
         @@ -247,13 +247,13 @@ ${text} 
     | 
|
| 
       247 
247 
     | 
    
         
             
                                    const tokenURL = process.env.OAUTH_TOKEN_URL ||
         
     | 
| 
       248 
248 
     | 
    
         
             
                                        decrypted.tokenURL ||
         
     | 
| 
       249 
249 
     | 
    
         
             
                                        that._oauth.tokenURL;
         
     | 
| 
       250 
     | 
    
         
            -
                                    const clientId =  
     | 
| 
       251 
     | 
    
         
            -
                                         
     | 
| 
      
 250 
     | 
    
         
            +
                                    const clientId = decrypted.clientId ||
         
     | 
| 
      
 251 
     | 
    
         
            +
                                        process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       252 
252 
     | 
    
         
             
                                        that._oauth.clientId;
         
     | 
| 
       253 
253 
     | 
    
         
             
                                    if (!clientId)
         
     | 
| 
       254 
254 
     | 
    
         
             
                                        throw new Error("clientId not configured");
         
     | 
| 
       255 
     | 
    
         
            -
                                    const clientSecret =  
     | 
| 
       256 
     | 
    
         
            -
                                         
     | 
| 
      
 255 
     | 
    
         
            +
                                    const clientSecret = decrypted.clientSecret ||
         
     | 
| 
      
 256 
     | 
    
         
            +
                                        process.env.OAUTH_CLIENT_SECRET ||
         
     | 
| 
       257 
257 
     | 
    
         
             
                                        that._oauth.clientSecret;
         
     | 
| 
       258 
258 
     | 
    
         
             
                                    if (!clientSecret)
         
     | 
| 
       259 
259 
     | 
    
         
             
                                        throw new Error("clientSecret not configured");
         
     | 
    
        package/package.json
    CHANGED
    
    
    
        package/src/controller/index.mts
    CHANGED
    
    | 
         @@ -9,6 +9,10 @@ export abstract class AbstractController { 
     | 
|
| 
       9 
9 
     | 
    
         
             
              protected configQuery(arg: any): Promise<any> {
         
     | 
| 
       10 
10 
     | 
    
         
             
                return Promise.resolve({});
         
     | 
| 
       11 
11 
     | 
    
         
             
              }
         
     | 
| 
      
 12 
     | 
    
         
            +
              
         
     | 
| 
      
 13 
     | 
    
         
            +
              protected autocomplete(arg: any): Promise<any> {
         
     | 
| 
      
 14 
     | 
    
         
            +
                return Promise.resolve({});
         
     | 
| 
      
 15 
     | 
    
         
            +
              }
         
     | 
| 
       12 
16 
     | 
    
         | 
| 
       13 
17 
     | 
    
         
             
              protected fallback(arg: any): Promise<any> {
         
     | 
| 
       14 
18 
     | 
    
         
             
                throw new Error("method not found");
         
     | 
| 
         @@ -81,6 +85,10 @@ export abstract class AbstractController { 
     | 
|
| 
       81 
85 
     | 
    
         
             
              async __configQuery(arg: any): Promise<any | null> {
         
     | 
| 
       82 
86 
     | 
    
         
             
                return this.configQuery(arg);
         
     | 
| 
       83 
87 
     | 
    
         
             
              }
         
     | 
| 
      
 88 
     | 
    
         
            +
              
         
     | 
| 
      
 89 
     | 
    
         
            +
              async __autocomplete(arg: any): Promise<any | null> {
         
     | 
| 
      
 90 
     | 
    
         
            +
                return this.autocomplete(arg);
         
     | 
| 
      
 91 
     | 
    
         
            +
              }
         
     | 
| 
       84 
92 
     | 
    
         | 
| 
       85 
93 
     | 
    
         
             
              async __default(arg: any): Promise<any | null> {
         
     | 
| 
       86 
94 
     | 
    
         
             
                return this.fallback(arg);
         
     | 
    
        package/src/internal/index.mts
    CHANGED
    
    | 
         @@ -148,8 +148,8 @@ ${text} 
     | 
|
| 
       148 
148 
     | 
    
         
             
                          throw new Error("authorizationURL not configured");
         
     | 
| 
       149 
149 
     | 
    
         | 
| 
       150 
150 
     | 
    
         
             
                        const clientId =
         
     | 
| 
       151 
     | 
    
         
            -
                          process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       152 
151 
     | 
    
         
             
                          decrypted.clientId ||
         
     | 
| 
      
 152 
     | 
    
         
            +
                          process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       153 
153 
     | 
    
         
             
                          this._oauth.clientId;
         
     | 
| 
       154 
154 
     | 
    
         | 
| 
       155 
155 
     | 
    
         
             
                        if (!clientId) throw new Error("clientId not configured");
         
     | 
| 
         @@ -189,15 +189,15 @@ ${text} 
     | 
|
| 
       189 
189 
     | 
    
         
             
                            throw new Error("need code and redirectUri");
         
     | 
| 
       190 
190 
     | 
    
         | 
| 
       191 
191 
     | 
    
         
             
                          const clientId =
         
     | 
| 
       192 
     | 
    
         
            -
                            process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       193 
192 
     | 
    
         
             
                            decrypted.clientId ||
         
     | 
| 
      
 193 
     | 
    
         
            +
                            process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       194 
194 
     | 
    
         
             
                            that._oauth.clientId;
         
     | 
| 
       195 
195 
     | 
    
         | 
| 
       196 
196 
     | 
    
         
             
                          if (!clientId) throw new Error("clientId not configured");
         
     | 
| 
       197 
197 
     | 
    
         | 
| 
       198 
198 
     | 
    
         
             
                          const clientSecret =
         
     | 
| 
       199 
     | 
    
         
            -
                            process.env.OAUTH_CLIENT_SECRET ||
         
     | 
| 
       200 
199 
     | 
    
         
             
                            decrypted.clientSecret ||
         
     | 
| 
      
 200 
     | 
    
         
            +
                            process.env.OAUTH_CLIENT_SECRET ||
         
     | 
| 
       201 
201 
     | 
    
         
             
                            that._oauth.clientSecret;
         
     | 
| 
       202 
202 
     | 
    
         
             
                          if (!clientSecret) throw new Error("clientSecret not configured");
         
     | 
| 
       203 
203 
     | 
    
         | 
| 
         @@ -301,14 +301,14 @@ ${text} 
     | 
|
| 
       301 
301 
     | 
    
         
             
                          that._oauth.tokenURL;
         
     | 
| 
       302 
302 
     | 
    
         | 
| 
       303 
303 
     | 
    
         
             
                        const clientId =
         
     | 
| 
       304 
     | 
    
         
            -
                          process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       305 
304 
     | 
    
         
             
                          decrypted.clientId ||
         
     | 
| 
      
 305 
     | 
    
         
            +
                          process.env.OAUTH_CLIENT_ID ||
         
     | 
| 
       306 
306 
     | 
    
         
             
                          that._oauth.clientId;
         
     | 
| 
       307 
307 
     | 
    
         
             
                        if (!clientId) throw new Error("clientId not configured");
         
     | 
| 
       308 
308 
     | 
    
         | 
| 
       309 
309 
     | 
    
         
             
                        const clientSecret =
         
     | 
| 
       310 
     | 
    
         
            -
                          process.env.OAUTH_CLIENT_SECRET ||
         
     | 
| 
       311 
310 
     | 
    
         
             
                          decrypted.clientSecret ||
         
     | 
| 
      
 311 
     | 
    
         
            +
                          process.env.OAUTH_CLIENT_SECRET ||
         
     | 
| 
       312 
312 
     | 
    
         
             
                          that._oauth.clientSecret;
         
     | 
| 
       313 
313 
     | 
    
         
             
                        if (!clientSecret) throw new Error("clientSecret not configured");
         
     | 
| 
       314 
314 
     | 
    
         |