@devrev/ts-adaas 1.17.1-beta.3 → 1.17.1-beta.5
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/mock-server/mock-server.d.ts.map +1 -1
- package/dist/mock-server/mock-server.interfaces.d.ts +1 -1
- package/dist/mock-server/mock-server.interfaces.d.ts.map +1 -1
- package/dist/mock-server/mock-server.js +6 -6
- package/dist/multithreading/worker-adapter/worker-adapter.js +2 -2
- package/dist/multithreading/worker-adapter/worker-adapter.test.js +3 -2
- package/package.json +14 -4
package/dist/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export { WorkerAdapter } from './multithreading/worker-adapter/worker-adapter';
|
|
|
13
13
|
export * from './types/workers';
|
|
14
14
|
export { formatAxiosError, serializeAxiosError } from './logger/logger';
|
|
15
15
|
export { MockServer } from './mock-server/mock-server';
|
|
16
|
+
export type { RequestInfo, RetryConfig, RouteConfig, } from './mock-server/mock-server.interfaces';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AAExB,cAAc,yCAAyC,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAE/E,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AAExB,cAAc,yCAAyC,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAE/E,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EACV,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,sCAAsC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-server.d.ts","sourceRoot":"","sources":["../../src/mock-server/mock-server.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,WAAW,EACX,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,YAAY,CAAS;IACtB,IAAI,EAAE,MAAM,C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1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-server.interfaces.d.ts","sourceRoot":"","sources":["../../src/mock-server/mock-server.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mock-server.interfaces.d.ts","sourceRoot":"","sources":["../../src/mock-server/mock-server.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.MockServer = void 0;
|
|
7
|
+
const express_1 = __importDefault(require("express"));
|
|
4
8
|
const mock_server_interfaces_1 = require("./mock-server.interfaces");
|
|
5
9
|
/**
|
|
6
10
|
* MockServer used in tests to mock internal AirSync endpoints.
|
|
@@ -13,16 +17,12 @@ class MockServer {
|
|
|
13
17
|
this.routeHandlers = new Map();
|
|
14
18
|
this.requests = [];
|
|
15
19
|
this.requestCounts = new Map();
|
|
16
|
-
// Lazy-load express so that importing MockServer doesn't require express at module load time.
|
|
17
|
-
// This allows the SDK to be used in production (Lambda) without express installed.
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
19
|
-
const express = require('express');
|
|
20
20
|
this.internalPort = port;
|
|
21
21
|
this.port = port;
|
|
22
22
|
this.baseUrl = `http://localhost:${this.port}`;
|
|
23
|
-
this.app =
|
|
23
|
+
this.app = (0, express_1.default)();
|
|
24
24
|
// Increase limit to handle size limit tests that send large artifact arrays
|
|
25
|
-
this.app.use(
|
|
25
|
+
this.app.use(express_1.default.json({ limit: '10mb' }));
|
|
26
26
|
this.setupRoutes();
|
|
27
27
|
}
|
|
28
28
|
async start() {
|
|
@@ -788,9 +788,9 @@ class WorkerAdapter {
|
|
|
788
788
|
if ((response === null || response === void 0 ? void 0 : response.delay) || (response === null || response === void 0 ? void 0 : response.error)) {
|
|
789
789
|
return response;
|
|
790
790
|
}
|
|
791
|
-
// On timeout, emit progress and exit to allow
|
|
791
|
+
// On timeout, emit progress and exit to allow continuation.
|
|
792
792
|
if (this.isTimeout) {
|
|
793
|
-
console.log(`Timeout detected after processing attachments for artifact ID: ${attachmentsMetadataArtifactId}. Emitting progress to allow
|
|
793
|
+
console.log(`Timeout detected after processing attachments for artifact ID: ${attachmentsMetadataArtifactId}. Emitting progress to allow continuation.`);
|
|
794
794
|
await this.emit(extraction_1.ExtractorEventType.AttachmentExtractionProgress);
|
|
795
795
|
process.exit(0);
|
|
796
796
|
return;
|
|
@@ -4,6 +4,7 @@ const attachments_streaming_pool_1 = require("../../attachments-streaming/attach
|
|
|
4
4
|
const state_1 = require("../../state/state");
|
|
5
5
|
const test_helpers_1 = require("../../tests/test-helpers");
|
|
6
6
|
const types_1 = require("../../types");
|
|
7
|
+
const loading_1 = require("../../types/loading");
|
|
7
8
|
const worker_adapter_1 = require("./worker-adapter");
|
|
8
9
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
9
10
|
// Mock dependencies
|
|
@@ -660,7 +661,7 @@ describe(worker_adapter_1.WorkerAdapter.name, () => {
|
|
|
660
661
|
.mockResolvedValue(undefined);
|
|
661
662
|
adapter.uploadAllRepos = jest.fn().mockResolvedValue(undefined);
|
|
662
663
|
adapter['loaderReports'] = [
|
|
663
|
-
{ item_type: 'tasks',
|
|
664
|
+
{ item_type: 'tasks', [loading_1.ActionType.CREATED]: 5 },
|
|
664
665
|
];
|
|
665
666
|
adapter['_processedFiles'] = ['file-1', 'file-2'];
|
|
666
667
|
await adapter.emit(types_1.LoaderEventType.DataLoadingDone);
|
|
@@ -686,7 +687,7 @@ describe(worker_adapter_1.WorkerAdapter.name, () => {
|
|
|
686
687
|
{ id: 'art-1', item_count: 10, item_type: 'issues' },
|
|
687
688
|
];
|
|
688
689
|
adapter['loaderReports'] = [
|
|
689
|
-
{ item_type: 'tasks',
|
|
690
|
+
{ item_type: 'tasks', [loading_1.ActionType.CREATED]: 5 },
|
|
690
691
|
];
|
|
691
692
|
adapter['_processedFiles'] = ['file-1'];
|
|
692
693
|
await adapter.emit('SOME_UNKNOWN_EVENT');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devrev/ts-adaas",
|
|
3
|
-
"version": "1.17.1-beta.
|
|
3
|
+
"version": "1.17.1-beta.5",
|
|
4
4
|
"description": "Typescript library containing the ADaaS(AirDrop as a Service) control protocol.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"eslint": "9.32.0",
|
|
39
39
|
"eslint-config-prettier": "^9.1.2",
|
|
40
40
|
"eslint-plugin-prettier": "4.0.0",
|
|
41
|
+
"express": "^5.2.1",
|
|
41
42
|
"jest": "^29.7.0",
|
|
42
43
|
"jiti": "^2.6.1",
|
|
43
44
|
"prettier": "^2.8.3",
|
|
@@ -45,6 +46,18 @@
|
|
|
45
46
|
"typescript": "^5.3.3",
|
|
46
47
|
"typescript-eslint": "^8.46.1"
|
|
47
48
|
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@types/express": "^5.0.0",
|
|
51
|
+
"express": "^5.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@types/express": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"express": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
48
61
|
"dependencies": {
|
|
49
62
|
"@devrev/typescript-sdk": "^1.1.59",
|
|
50
63
|
"axios": "^1.13.5",
|
|
@@ -54,9 +67,6 @@
|
|
|
54
67
|
"ts-node": "^10.9.2",
|
|
55
68
|
"yargs": "^17.7.2"
|
|
56
69
|
},
|
|
57
|
-
"peerDependencies": {
|
|
58
|
-
"express": "^4.21.0 || ^5.0.0"
|
|
59
|
-
},
|
|
60
70
|
"files": [
|
|
61
71
|
"dist/**/*",
|
|
62
72
|
"!dist/tests/**/*"
|