@companieshouse/api-sdk-node 2.0.66 → 2.0.68
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/client.d.ts +0 -2
- package/dist/client.js +24 -26
- package/dist/client.js.map +1 -1
- package/dist/http/request-client.js +7 -4
- package/dist/http/request-client.js.map +1 -1
- package/package.json +1 -1
- package/dist/services/account-validator/index.d.ts +0 -2
- package/dist/services/account-validator/index.js +0 -20
- package/dist/services/account-validator/index.js.map +0 -1
- package/dist/services/account-validator/service.d.ts +0 -19
- package/dist/services/account-validator/service.js +0 -62
- package/dist/services/account-validator/service.js.map +0 -1
- package/dist/services/account-validator/types.d.ts +0 -23
- package/dist/services/account-validator/types.js +0 -3
- package/dist/services/account-validator/types.js.map +0 -1
- package/dist/services/file-transfer/types.d.ts +0 -26
- package/dist/services/file-transfer/types.js +0 -10
- package/dist/services/file-transfer/types.js.map +0 -1
package/dist/client.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import CompanyPscService from "./services/company-psc/service";
|
|
|
5
5
|
import { LateFilingPenaltyService } from "./services/lfp";
|
|
6
6
|
import { BasketService, CheckoutService, OrderService, CertificateService, CertifiedCopiesService, MidService } from "./services/order/";
|
|
7
7
|
import { PaymentService } from "./services/payment/";
|
|
8
|
-
import AccountValidatorService from "./services/account-validator/service";
|
|
9
8
|
import CompanyFilingHistoryService from "./services/company-filing-history/service";
|
|
10
9
|
import { RefreshTokenService } from "./services/refresh-token";
|
|
11
10
|
import AdvancedSearchService from "./services/search/advanced-search/service";
|
|
@@ -38,7 +37,6 @@ export default class ApiClient {
|
|
|
38
37
|
readonly certifiedCopies: CertifiedCopiesService;
|
|
39
38
|
readonly basket: BasketService;
|
|
40
39
|
readonly payment: PaymentService;
|
|
41
|
-
readonly accountValidatorService: AccountValidatorService;
|
|
42
40
|
readonly checkout: CheckoutService;
|
|
43
41
|
readonly checkoutItem: CheckoutItemService;
|
|
44
42
|
readonly order: OrderService;
|
package/dist/client.js
CHANGED
|
@@ -9,22 +9,21 @@ const service_3 = __importDefault(require("./services/company-psc/service"));
|
|
|
9
9
|
const lfp_1 = require("./services/lfp");
|
|
10
10
|
const order_1 = require("./services/order/");
|
|
11
11
|
const payment_1 = require("./services/payment/");
|
|
12
|
-
const service_4 = __importDefault(require("./services/
|
|
13
|
-
const service_5 = __importDefault(require("./services/company-filing-history/service"));
|
|
12
|
+
const service_4 = __importDefault(require("./services/company-filing-history/service"));
|
|
14
13
|
const refresh_token_1 = require("./services/refresh-token");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
14
|
+
const service_5 = __importDefault(require("./services/search/advanced-search/service"));
|
|
15
|
+
const service_6 = __importDefault(require("./services/search/alphabetical-search/service"));
|
|
16
|
+
const service_7 = __importDefault(require("./services/search/dissolved-search/service"));
|
|
17
|
+
const service_8 = __importDefault(require("./services/psc-discrepancies/service"));
|
|
18
|
+
const service_9 = __importDefault(require("./services/psc-discrepancies-report/service"));
|
|
19
|
+
const service_10 = __importDefault(require("./services/transaction/service"));
|
|
20
|
+
const service_11 = __importDefault(require("./services/company-psc-statements/service"));
|
|
22
21
|
const confirmation_statement_1 = require("./services/confirmation-statement");
|
|
23
22
|
const overseas_entities_1 = require("./services/overseas-entities");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
23
|
+
const service_12 = require("./services/order/search/service");
|
|
24
|
+
const service_13 = __importDefault(require("./services/order/order-item/service"));
|
|
25
|
+
const service_14 = __importDefault(require("./services/order/checkout-item/service"));
|
|
26
|
+
const service_15 = __importDefault(require("./services/officer-filing/service"));
|
|
28
27
|
/**
|
|
29
28
|
* ApiClient is the class that all service objects hang off.
|
|
30
29
|
*/
|
|
@@ -35,33 +34,32 @@ class ApiClient {
|
|
|
35
34
|
// services on the api domain using the apiClient
|
|
36
35
|
this.lateFilingPenalties = new lfp_1.LateFilingPenaltyService(apiClient);
|
|
37
36
|
this.companyOfficers = new service_1.default(apiClient);
|
|
38
|
-
this.companyFilingHistory = new
|
|
37
|
+
this.companyFilingHistory = new service_4.default(apiClient);
|
|
39
38
|
this.companyProfile = new service_2.default(apiClient);
|
|
40
39
|
this.companyPsc = new service_3.default(apiClient);
|
|
41
|
-
this.companyPscStatements = new
|
|
40
|
+
this.companyPscStatements = new service_11.default(apiClient);
|
|
42
41
|
this.confirmationStatementService = new confirmation_statement_1.ConfirmationStatementService(apiClient);
|
|
43
42
|
this.certificate = new order_1.CertificateService(apiClient);
|
|
44
43
|
this.certifiedCopies = new order_1.CertifiedCopiesService(apiClient);
|
|
45
44
|
this.basket = new order_1.BasketService(apiClient);
|
|
46
45
|
this.payment = new payment_1.PaymentService(apiClient); // TODO split payments url/domain into a separate config item and http client
|
|
47
|
-
this.accountValidatorService = new service_4.default(apiClient);
|
|
48
46
|
this.checkout = new order_1.CheckoutService(apiClient);
|
|
49
|
-
this.checkoutItem = new
|
|
47
|
+
this.checkoutItem = new service_14.default(apiClient);
|
|
50
48
|
this.order = new order_1.OrderService(apiClient);
|
|
51
|
-
this.orderItem = new
|
|
52
|
-
this.officerFiling = new
|
|
53
|
-
this.checkoutSearchService = new
|
|
49
|
+
this.orderItem = new service_13.default(apiClient);
|
|
50
|
+
this.officerFiling = new service_15.default(apiClient);
|
|
51
|
+
this.checkoutSearchService = new service_12.CheckoutSearchService(apiClient);
|
|
54
52
|
this.mid = new order_1.MidService(apiClient);
|
|
55
|
-
this.alphabeticalSearch = new
|
|
56
|
-
this.dissolvedSearch = new
|
|
57
|
-
this.advancedSearch = new
|
|
53
|
+
this.alphabeticalSearch = new service_6.default(apiClient);
|
|
54
|
+
this.dissolvedSearch = new service_7.default(apiClient);
|
|
55
|
+
this.advancedSearch = new service_5.default(apiClient);
|
|
58
56
|
this.overseasEntity = new overseas_entities_1.OverseasEntityService(apiClient);
|
|
59
57
|
// service on the account/identity domain using the accountClient
|
|
60
58
|
// e.g. user profile service can be added here when required
|
|
61
59
|
this.refreshToken = new refresh_token_1.RefreshTokenService(accountClient);
|
|
62
|
-
this.pscDiscrepancies = new
|
|
63
|
-
this.pscDiscrepancyReport = new
|
|
64
|
-
this.transaction = new
|
|
60
|
+
this.pscDiscrepancies = new service_8.default(apiClient);
|
|
61
|
+
this.pscDiscrepancyReport = new service_9.default(apiClient);
|
|
62
|
+
this.transaction = new service_10.default(apiClient);
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
65
|
exports.default = ApiClient;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;AACA,kFAAyE;AACzE,iFAAuE;AACvE,6EAA+D;AAC/D,wCAA0D;AAC1D,6CAAyI;AACzI,iDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;AACA,kFAAyE;AACzE,iFAAuE;AACvE,6EAA+D;AAC/D,wCAA0D;AAC1D,6CAAyI;AACzI,iDAAqD;AACrD,wFAAoF;AACpF,4DAA+D;AAC/D,wFAA8E;AAC9E,4FAAsF;AACtF,yFAAgF;AAChF,mFAAyE;AACzE,0FAAwF;AACxF,8EAAgE;AAChE,yFAAoF;AACpF,8EAAiF;AACjF,oEAAqE;AACrE,8DAAwE;AACxE,mFAAmE;AACnE,sFAAyE;AACzE,iFAAqE;AAErE;;GAEG;AACH,MAAqB,SAAS;IA4B5B,YAAsB,SAAsB,EAAW,aAA0B;QAA3D,cAAS,GAAT,SAAS,CAAa;QAAW,kBAAa,GAAb,aAAa,CAAa;QAC7E,iDAAiD;QACjD,IAAI,CAAC,mBAAmB,GAAG,IAAI,8BAAwB,CAAC,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,eAAe,GAAG,IAAI,iBAAsB,CAAC,SAAS,CAAC,CAAC;QAC7D,IAA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C,SAAS,CAAC,CAAC;QAC7D,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAqB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,GAAG,IAAI,yCAAqB,CAAC,SAAS,CAAC,CAAC;QAC3D,iEAAiE;QACjE,4DAA4D;QAC5D,IAAI,CAAC,YAAY,GAAG,IAAI,mCAAmB,CAAC,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,gBAAgB,GAAG,IAAI,iBAAqB,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,GAAG,IAAI,iBAA6B,CAAC,SAAS,CAAC,CAAC;QACzE,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF;AA3DD,4BA2DC"}
|
|
@@ -50,11 +50,14 @@ class RequestClient extends http_client_1.AbstractClient {
|
|
|
50
50
|
try {
|
|
51
51
|
const options = {
|
|
52
52
|
method: additionalOptions.method,
|
|
53
|
-
headers:
|
|
54
|
-
|
|
53
|
+
headers: {
|
|
54
|
+
authorization: this.headers.Authorization,
|
|
55
|
+
accept: "application/json",
|
|
56
|
+
"content-type": "application/json"
|
|
57
|
+
},
|
|
58
|
+
url: `${this.options.baseUrl}${additionalOptions.url}`,
|
|
55
59
|
data: additionalOptions.body,
|
|
56
|
-
responseType: "json"
|
|
57
|
-
validateStatus: () => true
|
|
60
|
+
responseType: "json"
|
|
58
61
|
};
|
|
59
62
|
// any errors (including status code errors) are thrown as exceptions and
|
|
60
63
|
// will be caught in the catch block.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-client.js","sourceRoot":"","sources":["../../src/http/request-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+CAAyF;AACzF,kDAA6E;AAE7E;;;GAGG;AACH,MAAqB,aAAc,SAAQ,4BAAc;IACxC,OAAO,CAAE,GAAW,EAAE,OAAiB;;YAChD,OAAO,IAAI,CAAC,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MAAM;oBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,OAAO,EAAE,IAAI,CAAC,OAAO;iBACxB,CAAC;aACL;YAAC,OAAO,CAAC,EAAE;gBACR,wDAAwD;gBACxD,8HAA8H;gBAC9H,MAAM,KAAK,GAAG,OAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,0CAAE,IAAI,KAAI,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;gBACjF,OAAO;oBACH,MAAM,EAAE,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,KAAI,GAAG;oBACxB,KAAK;iBACR,CAAC;aACL;;KACJ;CACJ;AArDD,gCAqDC"}
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.AccountValidator = void 0;
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
18
|
-
var service_1 = require("./service");
|
|
19
|
-
Object.defineProperty(exports, "AccountValidator", { enumerable: true, get: function () { return __importDefault(service_1).default; } });
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/account-validator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,qCAAwD;AAA/C,4HAAA,OAAO,OAAoB"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AccountValidatorRequest, AccountValidatorResponse } from "./types";
|
|
2
|
-
import { IHttpClient } from "../../http";
|
|
3
|
-
import Resource, { ApiErrorResponse } from "../resource";
|
|
4
|
-
export default class {
|
|
5
|
-
private readonly client;
|
|
6
|
-
constructor(client: IHttpClient);
|
|
7
|
-
/**
|
|
8
|
-
* POST method to submit a file for validation
|
|
9
|
-
* @param accountValidatorRequest
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
postFileForValidation(accountValidatorRequest: AccountValidatorRequest): Promise<Resource<AccountValidatorResponse> | ApiErrorResponse>;
|
|
13
|
-
/**
|
|
14
|
-
* GET method to check the status of a file for validation request
|
|
15
|
-
* @param fileId
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
getFileValidationStatus(fileId: string): Promise<Resource<AccountValidatorResponse> | ApiErrorResponse>;
|
|
19
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const mapping_1 = __importDefault(require("../../mapping/mapping"));
|
|
16
|
-
class default_1 {
|
|
17
|
-
constructor(client) {
|
|
18
|
-
this.client = client;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* POST method to submit a file for validation
|
|
22
|
-
* @param accountValidatorRequest
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
postFileForValidation(accountValidatorRequest) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const resp = yield this.client.httpPost("/validate", accountValidatorRequest);
|
|
28
|
-
if (resp.status !== 200) {
|
|
29
|
-
return {
|
|
30
|
-
httpStatusCode: resp.status,
|
|
31
|
-
errors: []
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
httpStatusCode: resp.status,
|
|
36
|
-
resource: mapping_1.default.camelCaseKeys(resp.body)
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* GET method to check the status of a file for validation request
|
|
42
|
-
* @param fileId
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
getFileValidationStatus(fileId) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const resp = yield this.client.httpGet(`/validate/check/${fileId}`);
|
|
48
|
-
if (resp.status !== 200) {
|
|
49
|
-
return {
|
|
50
|
-
httpStatusCode: resp.status,
|
|
51
|
-
errors: []
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
httpStatusCode: resp.status,
|
|
56
|
-
resource: mapping_1.default.camelCaseKeys(resp.body)
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.default = default_1;
|
|
62
|
-
//# sourceMappingURL=service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/services/account-validator/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,oEAA4C;AAC5C;IACI,YAA8B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACrD;;;;OAIG;IACU,qBAAqB,CAC9B,uBAAgD;;YAEhD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CACnC,WAAW,EACX,uBAAuB,CAC1B,CAAC;YAEF,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,EAAE;gBACrB,OAAO;oBACH,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,MAAM,EAAE,EAAE;iBACb,CAAC;aACL;YAED,OAAO;gBACH,cAAc,EAAE,IAAI,CAAC,MAAM;gBAC3B,QAAQ,EAAE,iBAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;aAC7C,CAAC;QACN,CAAC;KAAA;IAED;;;;OAIG;IACU,uBAAuB,CAChC,MAAc;;YAEd,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;YAEpE,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,EAAE;gBACrB,OAAO;oBACH,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,MAAM,EAAE,EAAE;iBACb,CAAC;aACL;YAED,OAAO;gBACH,cAAc,EAAE,IAAI,CAAC,MAAM;gBAC3B,QAAQ,EAAE,iBAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;aAC7C,CAAC;QACN,CAAC;KAAA;CACJ;AAlDD,4BAkDC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface AccountValidatorRequest {
|
|
2
|
-
fileName: string;
|
|
3
|
-
id: string;
|
|
4
|
-
}
|
|
5
|
-
export interface Data {
|
|
6
|
-
balanceSheetDate: string;
|
|
7
|
-
accountsType: string;
|
|
8
|
-
companieshouseRegisteredNumber: string;
|
|
9
|
-
}
|
|
10
|
-
export interface Result {
|
|
11
|
-
errorMessages: string[];
|
|
12
|
-
data: Data;
|
|
13
|
-
validationStatus: ValidationStatus;
|
|
14
|
-
}
|
|
15
|
-
export interface AccountValidatorResponse {
|
|
16
|
-
status: RequestStatus;
|
|
17
|
-
result: Result;
|
|
18
|
-
fileId: string;
|
|
19
|
-
fileName: string;
|
|
20
|
-
}
|
|
21
|
-
declare type RequestStatus = "complete" | "pending";
|
|
22
|
-
declare type ValidationStatus = "OK" | "FAILED";
|
|
23
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/account-validator/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface File {
|
|
2
|
-
fileName: string;
|
|
3
|
-
body: ArrayBuffer;
|
|
4
|
-
mimeType: string;
|
|
5
|
-
size: number;
|
|
6
|
-
extension: string;
|
|
7
|
-
}
|
|
8
|
-
export interface FileDetails {
|
|
9
|
-
id: string;
|
|
10
|
-
avTimestamp: string;
|
|
11
|
-
avStatus: AvStatus;
|
|
12
|
-
contentType: string;
|
|
13
|
-
size: number;
|
|
14
|
-
name: string;
|
|
15
|
-
createdOn: string;
|
|
16
|
-
links: FileLinks;
|
|
17
|
-
}
|
|
18
|
-
export interface FileLinks {
|
|
19
|
-
download: string;
|
|
20
|
-
self: string;
|
|
21
|
-
}
|
|
22
|
-
export declare enum AvStatus {
|
|
23
|
-
INFECTED = "INFECTED",
|
|
24
|
-
CLEAN = "CLEAN",
|
|
25
|
-
NOT_SCANNED = "NOT_SCANNED"
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AvStatus = void 0;
|
|
4
|
-
var AvStatus;
|
|
5
|
-
(function (AvStatus) {
|
|
6
|
-
AvStatus["INFECTED"] = "INFECTED";
|
|
7
|
-
AvStatus["CLEAN"] = "CLEAN";
|
|
8
|
-
AvStatus["NOT_SCANNED"] = "NOT_SCANNED";
|
|
9
|
-
})(AvStatus = exports.AvStatus || (exports.AvStatus = {}));
|
|
10
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/file-transfer/types.ts"],"names":[],"mappings":";;;AAwBA,IAAY,QAIX;AAJD,WAAY,QAAQ;IAChB,iCAAqB,CAAA;IACrB,2BAAe,CAAA;IACf,uCAA2B,CAAA;AAC/B,CAAC,EAJW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAInB"}
|