@devrev/ts-adaas 1.11.1-beta.2 → 1.11.1-beta.3
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/dist/attachments-streaming/attachments-streaming-pool.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.js +2 -1
- package/dist/common/helpers.js +1 -1
- package/dist/logger/logger.d.ts +3 -19
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.interfaces.d.ts +18 -0
- package/dist/logger/logger.interfaces.d.ts.map +1 -1
- package/dist/logger/logger.js +6 -30
- package/dist/tests/backwards-compatibility/backwards-compatibility.test.d.ts.map +1 -1
- package/dist/tests/backwards-compatibility/backwards-compatibility.test.js +4 -2
- package/dist/workers/spawn.d.ts.map +1 -1
- package/dist/workers/spawn.js +4 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments-streaming-pool.d.ts","sourceRoot":"","sources":["../../src/attachments-streaming/attachments-streaming-pool.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAEzF,qBAAa,wBAAwB,CAAC,cAAc;IAClD,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,MAAM,CAA4C;IAE1D,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAM;gBAEnC,EACV,OAAO,EACP,WAAW,EACX,SAAc,EACd,MAAM,GACP,EAAE,8BAA8B,CAAC,cAAc,CAAC;YAQnC,cAAc;
|
|
1
|
+
{"version":3,"file":"attachments-streaming-pool.d.ts","sourceRoot":"","sources":["../../src/attachments-streaming/attachments-streaming-pool.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAEzF,qBAAa,wBAAwB,CAAC,cAAc;IAClD,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,MAAM,CAA4C;IAE1D,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAM;gBAEnC,EACV,OAAO,EACP,WAAW,EACX,SAAc,EACd,MAAM,GACP,EAAE,8BAA8B,CAAC,cAAc,CAAC;YAQnC,cAAc;IAStB,SAAS,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAuCjD,kBAAkB;CA0EzB"}
|
|
@@ -16,7 +16,8 @@ class AttachmentsStreamingPool {
|
|
|
16
16
|
this.totalProcessedCount++;
|
|
17
17
|
if (this.totalProcessedCount % this.PROGRESS_REPORT_INTERVAL === 0) {
|
|
18
18
|
console.info(`Processed ${this.totalProcessedCount} attachments so far.`);
|
|
19
|
-
|
|
19
|
+
// Sleep for 100ms to avoid blocking the event loop
|
|
20
|
+
await (0, helpers_1.sleep)(100);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
async streamAll() {
|
package/dist/common/helpers.js
CHANGED
|
@@ -167,7 +167,7 @@ function getLibraryVersion() {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
async function sleep(ms) {
|
|
170
|
-
console.log(`Sleeping for ${ms
|
|
170
|
+
console.log(`Sleeping for ${ms}ms.`);
|
|
171
171
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
172
172
|
}
|
|
173
173
|
function truncateFilename(filename) {
|
package/dist/logger/logger.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Console } from 'node:console';
|
|
2
|
-
import { AxiosError
|
|
3
|
-
import { LoggerFactoryInterface, LogLevel, PrintableState } from './logger.interfaces';
|
|
2
|
+
import { AxiosError } from 'axios';
|
|
3
|
+
import { AxiosErrorResponse, LoggerFactoryInterface, LogLevel, PrintableState } from './logger.interfaces';
|
|
4
4
|
export declare class Logger extends Console {
|
|
5
|
+
private originalConsole;
|
|
5
6
|
private options?;
|
|
6
7
|
private tags;
|
|
7
8
|
constructor({ event, options }: LoggerFactoryInterface);
|
|
@@ -18,22 +19,5 @@ export declare function getPrintableState(state: Record<string, any>): Printable
|
|
|
18
19
|
*/
|
|
19
20
|
export declare function formatAxiosError(error: AxiosError): object;
|
|
20
21
|
export declare const serializeError: (error: unknown) => unknown;
|
|
21
|
-
export interface AxiosErrorResponse {
|
|
22
|
-
config: {
|
|
23
|
-
method: string | undefined;
|
|
24
|
-
params: any;
|
|
25
|
-
url: string | undefined;
|
|
26
|
-
};
|
|
27
|
-
isAxiosError: boolean;
|
|
28
|
-
isCorsOrNoNetworkError: boolean;
|
|
29
|
-
response?: {
|
|
30
|
-
data: unknown;
|
|
31
|
-
headers: RawAxiosResponseHeaders;
|
|
32
|
-
status: number;
|
|
33
|
-
statusText: string;
|
|
34
|
-
};
|
|
35
|
-
code?: string;
|
|
36
|
-
message?: string;
|
|
37
|
-
}
|
|
38
22
|
export declare function serializeAxiosError(error: AxiosError): AxiosErrorResponse;
|
|
39
23
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAyC,MAAM,OAAO,CAAC;AAG1E,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EAER,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,MAAO,SAAQ,OAAO;IACjC,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,OAAO,CAAC,CAAuB;IACvC,OAAO,CAAC,IAAI,CAAqC;gBAErC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,sBAAsB;IAUtD,OAAO,CAAC,aAAa;IAYrB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI;IAepC,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI7B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAGzC;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,cAAc,CAyB5E;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE1D;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,YAK5C,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB,CAwBzE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RawAxiosResponseHeaders } from 'axios';
|
|
1
2
|
import { AirdropEvent } from '../types/extraction';
|
|
2
3
|
import { WorkerAdapterOptions } from '../types/workers';
|
|
3
4
|
export interface LoggerFactoryInterface {
|
|
@@ -18,4 +19,21 @@ export interface PrintableArray {
|
|
|
18
19
|
export interface PrintableState {
|
|
19
20
|
[key: string]: any | PrintableArray | PrintableState;
|
|
20
21
|
}
|
|
22
|
+
export interface AxiosErrorResponse {
|
|
23
|
+
config: {
|
|
24
|
+
method: string | undefined;
|
|
25
|
+
params: any;
|
|
26
|
+
url: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
isAxiosError: boolean;
|
|
29
|
+
isCorsOrNoNetworkError: boolean;
|
|
30
|
+
response?: {
|
|
31
|
+
data: unknown;
|
|
32
|
+
headers: RawAxiosResponseHeaders;
|
|
33
|
+
status: number;
|
|
34
|
+
statusText: string;
|
|
35
|
+
};
|
|
36
|
+
code?: string;
|
|
37
|
+
message?: string;
|
|
38
|
+
}
|
|
21
39
|
//# sourceMappingURL=logger.interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.interfaces.d.ts","sourceRoot":"","sources":["../../src/logger/logger.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,GAAG,CAAC;IAEhB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAE7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,cAAc,GAAG,cAAc,CAAC;CACtD"}
|
|
1
|
+
{"version":3,"file":"logger.interfaces.d.ts","sourceRoot":"","sources":["../../src/logger/logger.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,GAAG,CAAC;IAEhB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAE7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,cAAc,GAAG,cAAc,CAAC;CACtD;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAE3B,MAAM,EAAE,GAAG,CAAC;QACZ,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;KACzB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,OAAO,CAAC;QACd,OAAO,EAAE,uBAAuB,CAAC;QACjC,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/logger/logger.js
CHANGED
|
@@ -7,12 +7,11 @@ exports.serializeAxiosError = serializeAxiosError;
|
|
|
7
7
|
const node_console_1 = require("node:console");
|
|
8
8
|
const node_util_1 = require("node:util");
|
|
9
9
|
const axios_1 = require("axios");
|
|
10
|
-
const node_worker_threads_1 = require("node:worker_threads");
|
|
11
|
-
const workers_1 = require("../types/workers");
|
|
12
10
|
const logger_interfaces_1 = require("./logger.interfaces");
|
|
13
11
|
class Logger extends node_console_1.Console {
|
|
14
12
|
constructor({ event, options }) {
|
|
15
13
|
super(process.stdout, process.stderr);
|
|
14
|
+
this.originalConsole = console;
|
|
16
15
|
this.options = options;
|
|
17
16
|
this.tags = Object.assign(Object.assign({}, event.payload.event_context), { dev_oid: event.payload.event_context.dev_oid });
|
|
18
17
|
}
|
|
@@ -28,36 +27,13 @@ class Logger extends node_console_1.Console {
|
|
|
28
27
|
}
|
|
29
28
|
logFn(args, level) {
|
|
30
29
|
var _a;
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
console[level](...args);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
let message;
|
|
37
|
-
if (args.length === 1 && typeof args[0] === 'string') {
|
|
38
|
-
// Single string argument - use directly
|
|
39
|
-
message = args[0];
|
|
40
|
-
}
|
|
41
|
-
else if (args.length === 1) {
|
|
42
|
-
// Single non-string argument - convert to string properly
|
|
43
|
-
message = this.valueToString(args[0]);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
// Multiple arguments - create a readable format
|
|
47
|
-
message = args.map((arg) => this.valueToString(arg)).join(' ');
|
|
48
|
-
}
|
|
49
|
-
const logObject = Object.assign({ message }, this.tags);
|
|
50
|
-
console[level](JSON.stringify(logObject));
|
|
51
|
-
}
|
|
30
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.isLocalDevelopment) {
|
|
31
|
+
this.originalConsole[level](...args);
|
|
52
32
|
}
|
|
53
33
|
else {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
args: args.map((arg) => this.valueToString(arg)),
|
|
58
|
-
level,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
34
|
+
const message = args.map((arg) => this.valueToString(arg)).join(' ');
|
|
35
|
+
const logObject = Object.assign({ message }, this.tags);
|
|
36
|
+
this.originalConsole[level](JSON.stringify(logObject));
|
|
61
37
|
}
|
|
62
38
|
}
|
|
63
39
|
log(...args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backwards-compatibility.test.d.ts","sourceRoot":"","sources":["../../../src/tests/backwards-compatibility/backwards-compatibility.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAGd,WAAW,EAGX,kBAAkB,EAKnB,MAAM,gCAAgC,CAAC;AAgBxC,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,WAAW,GAAG,cAAc,GAAG,kBAAkB,EAC9D,eAAe,EAAE,WAAW,GAAG,cAAc,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"backwards-compatibility.test.d.ts","sourceRoot":"","sources":["../../../src/tests/backwards-compatibility/backwards-compatibility.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAGd,WAAW,EAGX,kBAAkB,EAKnB,MAAM,gCAAgC,CAAC;AAgBxC,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,WAAW,GAAG,cAAc,GAAG,kBAAkB,EAC9D,eAAe,EAAE,WAAW,GAAG,cAAc,GAAG,kBAAkB,QAkFnE"}
|
|
@@ -28,9 +28,11 @@ function checkFunctionCompatibility(newFunction, currentFunction) {
|
|
|
28
28
|
if (currentFunction instanceof api_extractor_model_1.ApiFunction &&
|
|
29
29
|
newFunction instanceof api_extractor_model_1.ApiFunction) {
|
|
30
30
|
if (!((_a = currentFunction.returnTypeExcerpt) === null || _a === void 0 ? void 0 : _a.isEmpty)) {
|
|
31
|
-
if (newFunction.returnTypeExcerpt.text !=
|
|
31
|
+
if (newFunction.returnTypeExcerpt.text !=
|
|
32
|
+
currentFunction.returnTypeExcerpt.text) {
|
|
32
33
|
// This will pass, if the new implementation is an object and the current one is not specified or a hard-coded type.
|
|
33
|
-
if (!(currentFunction.returnTypeExcerpt.text.split(
|
|
34
|
+
if (!(currentFunction.returnTypeExcerpt.text.split(' ').length != 1 &&
|
|
35
|
+
newFunction.returnTypeExcerpt.text.split(' ').length == 1)) {
|
|
34
36
|
it(`Function ${newFunction.displayName} should have the same return type as the current function`, () => {
|
|
35
37
|
expect(newFunction.returnTypeExcerpt.text).toEqual(currentFunction.returnTypeExcerpt.text);
|
|
36
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/workers/spawn.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,qBAAqB,EACrB,cAAc,EAGf,MAAM,kBAAkB,CAAC;AA4D1B;;;;;;;;;;GAUG;AACH,wBAAsB,KAAK,CAAC,cAAc,EAAE,EAC1C,KAAK,EACL,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,OAAO,GACR,EAAE,qBAAqB,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEvD;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,wBAAwB,CAA6C;IAC7E,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA4C;gBAE/C,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/workers/spawn.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,qBAAqB,EACrB,cAAc,EAGf,MAAM,kBAAkB,CAAC;AA4D1B;;;;;;;;;;GAUG;AACH,wBAAsB,KAAK,CAAC,cAAc,EAAE,EAC1C,KAAK,EACL,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,OAAO,GACR,EAAE,qBAAqB,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEvD;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,wBAAwB,CAA6C;IAC7E,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA4C;gBAE/C,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc;IA8F/D,OAAO,CAAC,aAAa;YAYP,kBAAkB;CA8BjC"}
|
package/dist/workers/spawn.js
CHANGED
|
@@ -163,8 +163,9 @@ class Spawn {
|
|
|
163
163
|
await this.exitFromMainThread();
|
|
164
164
|
}
|
|
165
165
|
})(), this.lambdaTimeout * constants_1.HARD_TIMEOUT_MULTIPLIER);
|
|
166
|
-
// If worker exits with process.exit(code), clear the timeouts and exit from
|
|
167
|
-
|
|
166
|
+
// If worker exits with process.exit(code), clear the timeouts and exit from
|
|
167
|
+
// main thread.
|
|
168
|
+
worker.on(workers_1.WorkerEvent.WorkerExit, (code) => void (async () => {
|
|
168
169
|
this.logger.info('Worker exited with exit code: ' + code + '.');
|
|
169
170
|
this.clearTimeouts();
|
|
170
171
|
await this.exitFromMainThread();
|
|
@@ -227,7 +228,7 @@ class Spawn {
|
|
|
227
228
|
event: this.event,
|
|
228
229
|
data: {
|
|
229
230
|
error: {
|
|
230
|
-
message: 'Worker
|
|
231
|
+
message: 'Worker exited the process without emitting an event. Check other logs for more information.',
|
|
231
232
|
},
|
|
232
233
|
},
|
|
233
234
|
});
|
package/package.json
CHANGED