@abyss-project/probe 1.0.0
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/README.md +32 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +19 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/probe-scan.api.d.ts +10 -0
- package/dist/api/probe-scan.api.js +60 -0
- package/dist/api/probe-scan.api.js.map +1 -0
- package/dist/api/probe-scan.api.test.d.ts +1 -0
- package/dist/api/probe-scan.api.test.js +37 -0
- package/dist/api/probe-scan.api.test.js.map +1 -0
- package/dist/api/probe-webhook.api.d.ts +4 -0
- package/dist/api/probe-webhook.api.js +21 -0
- package/dist/api/probe-webhook.api.js.map +1 -0
- package/dist/api/probe-webhook.api.test.d.ts +1 -0
- package/dist/api/probe-webhook.api.test.js +33 -0
- package/dist/api/probe-webhook.api.test.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -0
- package/dist/types/enum/api-error.enum.d.ts +17 -0
- package/dist/types/enum/api-error.enum.js +23 -0
- package/dist/types/enum/api-error.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +2 -0
- package/dist/types/enum/index.js +19 -0
- package/dist/types/enum/index.js.map +1 -0
- package/dist/types/enum/probe-scan.enum.d.ts +14 -0
- package/dist/types/enum/probe-scan.enum.js +21 -0
- package/dist/types/enum/probe-scan.enum.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface/api/index.d.ts +5 -0
- package/dist/types/interface/api/index.js +22 -0
- package/dist/types/interface/api/index.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +2 -0
- package/dist/types/interface/api/requests/index.js +19 -0
- package/dist/types/interface/api/requests/index.js.map +1 -0
- package/dist/types/interface/api/requests/probe-scan.request.d.ts +22 -0
- package/dist/types/interface/api/requests/probe-scan.request.js +3 -0
- package/dist/types/interface/api/requests/probe-scan.request.js.map +1 -0
- package/dist/types/interface/api/requests/probe-webhook.request.d.ts +6 -0
- package/dist/types/interface/api/requests/probe-webhook.request.js +3 -0
- package/dist/types/interface/api/requests/probe-webhook.request.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +2 -0
- package/dist/types/interface/api/responses/index.js +19 -0
- package/dist/types/interface/api/responses/index.js.map +1 -0
- package/dist/types/interface/api/responses/probe-scan.response.d.ts +18 -0
- package/dist/types/interface/api/responses/probe-scan.response.js +3 -0
- package/dist/types/interface/api/responses/probe-scan.response.js.map +1 -0
- package/dist/types/interface/api/responses/probe-webhook.response.d.ts +10 -0
- package/dist/types/interface/api/responses/probe-webhook.response.js +3 -0
- package/dist/types/interface/api/responses/probe-webhook.response.js.map +1 -0
- package/dist/types/interface/api/type-message/api-error.d.ts +6 -0
- package/dist/types/interface/api/type-message/api-error.js +3 -0
- package/dist/types/interface/api/type-message/api-error.js.map +1 -0
- package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
- package/dist/types/interface/api/type-message/base-paginate.js +3 -0
- package/dist/types/interface/api/type-message/base-paginate.js.map +1 -0
- package/dist/types/interface/api/type-message/response.d.ts +5 -0
- package/dist/types/interface/api/type-message/response.js +3 -0
- package/dist/types/interface/api/type-message/response.js.map +1 -0
- package/dist/types/interface/dto/index.d.ts +1 -0
- package/dist/types/interface/dto/index.js +18 -0
- package/dist/types/interface/dto/index.js.map +1 -0
- package/dist/types/interface/dto/probe-webhook-delivery.dto.d.ts +7 -0
- package/dist/types/interface/dto/probe-webhook-delivery.dto.js +3 -0
- package/dist/types/interface/dto/probe-webhook-delivery.dto.js.map +1 -0
- package/dist/types/interface/index.d.ts +3 -0
- package/dist/types/interface/index.js +20 -0
- package/dist/types/interface/index.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +2 -0
- package/dist/types/interface/models/index.js +19 -0
- package/dist/types/interface/models/index.js.map +1 -0
- package/dist/types/interface/models/probe-scan.model.d.ts +22 -0
- package/dist/types/interface/models/probe-scan.model.js +3 -0
- package/dist/types/interface/models/probe-scan.model.js.map +1 -0
- package/dist/types/interface/models/probe-webhook.model.d.ts +9 -0
- package/dist/types/interface/models/probe-webhook.model.js +3 -0
- package/dist/types/interface/models/probe-webhook.model.js.map +1 -0
- package/dist/types/tests/probe.dto.test.d.ts +1 -0
- package/dist/types/tests/probe.dto.test.js +62 -0
- package/dist/types/tests/probe.dto.test.js.map +1 -0
- package/dist/utils/http.utils.d.ts +3 -0
- package/dist/utils/http.utils.js +20 -0
- package/dist/utils/http.utils.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/probe-webhook-signature.utils.d.ts +8 -0
- package/dist/utils/probe-webhook-signature.utils.js +22 -0
- package/dist/utils/probe-webhook-signature.utils.js.map +1 -0
- package/package.json +50 -0
- package/tsconfig.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<img src="https://docs.abyss-project.fr/img/services/AbyssProbe.svg" align="right" width="96" alt="" />
|
|
2
|
+
|
|
3
|
+
# Abyss Probe
|
|
4
|
+
|
|
5
|
+
`@abyss-project/probe`
|
|
6
|
+
|
|
7
|
+
Antivirus scanning platform primitive : scan de fichiers sync/async, historique, webhooks de verdict.
|
|
8
|
+
|
|
9
|
+
_Antivirus scanning platform primitive: sync/async file scanning, scan history, verdict webhooks._
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @abyss-project/probe
|
|
15
|
+
# or
|
|
16
|
+
pnpm add @abyss-project/probe
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Liens
|
|
20
|
+
|
|
21
|
+
- **Documentation** : [https://docs.abyss-project.fr/probe](https://docs.abyss-project.fr/probe)
|
|
22
|
+
- **NPM** : [@abyss-project/probe](https://www.npmjs.com/package/@abyss-project/probe)
|
|
23
|
+
- **Application Abyss** : [app.abyss-project.fr](https://app.abyss-project.fr)
|
|
24
|
+
- **Statut des services** : [status.abyss-project.fr](https://status.abyss-project.fr)
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Voir la [documentation produit](https://docs.abyss-project.fr/probe) pour les guides d'utilisation, la configuration du Core, les exemples d'appel et la référence des permissions.
|
|
29
|
+
|
|
30
|
+
## Support
|
|
31
|
+
|
|
32
|
+
Pour toute demande, ouvrir un ticket depuis [l'application Abyss](https://app.abyss-project.fr/dashboard/my-account/ticket/create).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./probe-scan.api"), exports);
|
|
18
|
+
__exportStar(require("./probe-webhook.api"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,sDAAoC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import type { IScanOptions, IListScansQuery, IScanResponse, IScanSyncResponse, IScanAsyncResponse, IGetScanResponse, IPaginateScanResponse } from '../types';
|
|
5
|
+
export type ProbeScanFileInput = Buffer | Uint8Array | NodeJS.ReadableStream | Blob;
|
|
6
|
+
export declare const scan: (file: ProbeScanFileInput, options?: IScanOptions, apiKey?: string) => Promise<IScanResponse>;
|
|
7
|
+
export declare const scanSync: (file: ProbeScanFileInput, options?: Omit<IScanOptions, 'mode' | 'callbackUrl'>, apiKey?: string) => Promise<IScanSyncResponse>;
|
|
8
|
+
export declare const scanAsync: (file: ProbeScanFileInput, options?: Omit<IScanOptions, 'mode'>, apiKey?: string) => Promise<IScanAsyncResponse>;
|
|
9
|
+
export declare const getScan: (scanId: string, apiKey?: string) => Promise<IGetScanResponse>;
|
|
10
|
+
export declare const listScans: (query?: IListScansQuery, apiKey?: string) => Promise<IPaginateScanResponse>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listScans = exports.getScan = exports.scanAsync = exports.scanSync = exports.scan = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
function isBrowserEnv() {
|
|
8
|
+
return typeof window !== 'undefined' && typeof FormData !== 'undefined';
|
|
9
|
+
}
|
|
10
|
+
async function loadNodeFormData() {
|
|
11
|
+
const nodeRequire = new Function('return require')();
|
|
12
|
+
return nodeRequire('form-data');
|
|
13
|
+
}
|
|
14
|
+
async function buildScanForm(file, options) {
|
|
15
|
+
const filename = options.filename ?? 'file';
|
|
16
|
+
if (isBrowserEnv()) {
|
|
17
|
+
const form = new FormData();
|
|
18
|
+
const blob = file instanceof Blob ? file : new Blob([file], { type: options.mimeType });
|
|
19
|
+
form.append('file', blob, filename);
|
|
20
|
+
if (options.context)
|
|
21
|
+
form.append('context', JSON.stringify(options.context));
|
|
22
|
+
if (options.callbackUrl)
|
|
23
|
+
form.append('callbackUrl', options.callbackUrl);
|
|
24
|
+
return { form, headers: {} };
|
|
25
|
+
}
|
|
26
|
+
const FormDataCtor = await loadNodeFormData();
|
|
27
|
+
const form = new FormDataCtor();
|
|
28
|
+
const filePart = Buffer.isBuffer(file) || file instanceof Uint8Array ? Buffer.from(file) : file;
|
|
29
|
+
form.append('file', filePart, { filename, contentType: options.mimeType });
|
|
30
|
+
if (options.context)
|
|
31
|
+
form.append('context', JSON.stringify(options.context));
|
|
32
|
+
if (options.callbackUrl)
|
|
33
|
+
form.append('callbackUrl', options.callbackUrl);
|
|
34
|
+
const headers = typeof form.getHeaders === 'function' ? form.getHeaders() : {};
|
|
35
|
+
return { form, headers };
|
|
36
|
+
}
|
|
37
|
+
const scan = async (file, options = {}, apiKey) => {
|
|
38
|
+
const { form, headers } = await buildScanForm(file, options);
|
|
39
|
+
return (await __1.AbyssProbeCore.axios.post('scan', form, {
|
|
40
|
+
params: (0, utils_1.serializeProbeQuery)({ mode: options.mode, organizationId: options.organizationId }),
|
|
41
|
+
headers: { ...headers, ...(0, utils_1.authHeader)(apiKey) },
|
|
42
|
+
maxBodyLength: Infinity,
|
|
43
|
+
maxContentLength: Infinity,
|
|
44
|
+
})).data;
|
|
45
|
+
};
|
|
46
|
+
exports.scan = scan;
|
|
47
|
+
const scanSync = async (file, options = {}, apiKey) => (0, exports.scan)(file, { ...options, mode: types_1.ProbeScanMode.SYNC }, apiKey);
|
|
48
|
+
exports.scanSync = scanSync;
|
|
49
|
+
const scanAsync = async (file, options = {}, apiKey) => (0, exports.scan)(file, { ...options, mode: types_1.ProbeScanMode.ASYNC }, apiKey);
|
|
50
|
+
exports.scanAsync = scanAsync;
|
|
51
|
+
const getScan = async (scanId, apiKey) => (await __1.AbyssProbeCore.axios.get(`scan/${scanId}`, {
|
|
52
|
+
headers: (0, utils_1.authHeader)(apiKey),
|
|
53
|
+
})).data;
|
|
54
|
+
exports.getScan = getScan;
|
|
55
|
+
const listScans = async (query = {}, apiKey) => (await __1.AbyssProbeCore.axios.get('scan', {
|
|
56
|
+
params: (0, utils_1.serializeProbeQuery)(query),
|
|
57
|
+
headers: (0, utils_1.authHeader)(apiKey),
|
|
58
|
+
})).data;
|
|
59
|
+
exports.listScans = listScans;
|
|
60
|
+
//# sourceMappingURL=probe-scan.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-scan.api.js","sourceRoot":"","sources":["../../src/api/probe-scan.api.ts"],"names":[],"mappings":";;;AAiBA,0BAAoC;AACpC,oCAAyC;AAUzC,oCAA2D;AAK3D,SAAS,YAAY;IACnB,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AAC1E,CAAC;AAED,KAAK,UAAU,gBAAgB;IAK7B,MAAM,WAAW,GAAgB,IAAI,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;IAClE,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC;AAOD,KAAK,UAAU,aAAa,CAC1B,IAAwB,EACxB,OAAqB;IAErB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC;IAE5C,IAAI,YAAY,EAAE,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,GACR,IAAI,YAAY,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzF,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QACpC,IAAI,OAAO,CAAC,OAAO;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,SAAS,GAAG,KAAK,EAC5B,QAAyB,EAAE,EAC3B,MAAe,EACiB,EAAE,CAClC,CACE,MAAM,kBAAc,CAAC,KAAK,CAAC,GAAG,CAAwB,MAAM,EAAE;IAC5D,MAAM,EAAE,IAAA,2BAAmB,EAAC,KAAK,CAAC;IAClC,OAAO,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC;CAC5B,CAAC,CACH,CAAC,IAAI,CAAC;AATI,QAAA,SAAS,aASb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const api = __importStar(require("./probe-scan.api"));
|
|
27
|
+
const _scan = api.scan;
|
|
28
|
+
const _scanSync = api.scanSync;
|
|
29
|
+
const _scanAsync = api.scanAsync;
|
|
30
|
+
const _getScan = api.getScan;
|
|
31
|
+
const _listScans = api.listScans;
|
|
32
|
+
void _scan;
|
|
33
|
+
void _scanSync;
|
|
34
|
+
void _scanAsync;
|
|
35
|
+
void _getScan;
|
|
36
|
+
void _listScans;
|
|
37
|
+
//# sourceMappingURL=probe-scan.api.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-scan.api.test.js","sourceRoot":"","sources":["../../src/api/probe-scan.api.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,sDAAwC;AAGxC,MAAM,KAAK,GAAoB,GAAG,CAAC,IAAI,CAAC;AACxC,MAAM,SAAS,GAAwB,GAAG,CAAC,QAAQ,CAAC;AACpD,MAAM,UAAU,GAAyB,GAAG,CAAC,SAAS,CAAC;AACvD,MAAM,QAAQ,GAAuB,GAAG,CAAC,OAAO,CAAC;AACjD,MAAM,UAAU,GAAyB,GAAG,CAAC,SAAS,CAAC;AAEvD,KAAK,KAAK,CAAC;AACX,KAAK,SAAS,CAAC;AACf,KAAK,UAAU,CAAC;AAChB,KAAK,QAAQ,CAAC;AACd,KAAK,UAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ICreateProbeWebhookBody, IProbeWebhookScopeQuery, ICreateProbeWebhookResponse, IListProbeWebhookResponse, IDeleteProbeWebhookResponse } from '../types';
|
|
2
|
+
export declare const createProbeWebhook: (body: ICreateProbeWebhookBody, scope?: IProbeWebhookScopeQuery, apiKey?: string) => Promise<ICreateProbeWebhookResponse>;
|
|
3
|
+
export declare const listProbeWebhook: (scope?: IProbeWebhookScopeQuery, apiKey?: string) => Promise<IListProbeWebhookResponse>;
|
|
4
|
+
export declare const deleteProbeWebhook: (webhookId: string, scope?: IProbeWebhookScopeQuery, apiKey?: string) => Promise<IDeleteProbeWebhookResponse>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteProbeWebhook = exports.listProbeWebhook = exports.createProbeWebhook = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const createProbeWebhook = async (body, scope = {}, apiKey) => (await __1.AbyssProbeCore.axios.post('webhook', body, {
|
|
7
|
+
params: (0, utils_1.serializeProbeQuery)(scope),
|
|
8
|
+
headers: (0, utils_1.authHeader)(apiKey),
|
|
9
|
+
})).data;
|
|
10
|
+
exports.createProbeWebhook = createProbeWebhook;
|
|
11
|
+
const listProbeWebhook = async (scope = {}, apiKey) => (await __1.AbyssProbeCore.axios.get('webhook', {
|
|
12
|
+
params: (0, utils_1.serializeProbeQuery)(scope),
|
|
13
|
+
headers: (0, utils_1.authHeader)(apiKey),
|
|
14
|
+
})).data;
|
|
15
|
+
exports.listProbeWebhook = listProbeWebhook;
|
|
16
|
+
const deleteProbeWebhook = async (webhookId, scope = {}, apiKey) => (await __1.AbyssProbeCore.axios.delete(`webhook/${webhookId}`, {
|
|
17
|
+
params: (0, utils_1.serializeProbeQuery)(scope),
|
|
18
|
+
headers: (0, utils_1.authHeader)(apiKey),
|
|
19
|
+
})).data;
|
|
20
|
+
exports.deleteProbeWebhook = deleteProbeWebhook;
|
|
21
|
+
//# sourceMappingURL=probe-webhook.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-webhook.api.js","sourceRoot":"","sources":["../../src/api/probe-webhook.api.ts"],"names":[],"mappings":";;;AAOA,0BAAoC;AAQpC,oCAA2D;AAOpD,MAAM,kBAAkB,GAAG,KAAK,EACrC,IAA6B,EAC7B,QAAiC,EAAE,EACnC,MAAe,EACuB,EAAE,CACxC,CACE,MAAM,kBAAc,CAAC,KAAK,CAAC,IAAI,CAA8B,SAAS,EAAE,IAAI,EAAE;IAC5E,MAAM,EAAE,IAAA,2BAAmB,EAAC,KAAK,CAAC;IAClC,OAAO,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC;CAC5B,CAAC,CACH,CAAC,IAAI,CAAC;AAVI,QAAA,kBAAkB,sBAUtB;AAGF,MAAM,gBAAgB,GAAG,KAAK,EACnC,QAAiC,EAAE,EACnC,MAAe,EACqB,EAAE,CACtC,CACE,MAAM,kBAAc,CAAC,KAAK,CAAC,GAAG,CAA4B,SAAS,EAAE;IACnE,MAAM,EAAE,IAAA,2BAAmB,EAAC,KAAK,CAAC;IAClC,OAAO,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC;CAC5B,CAAC,CACH,CAAC,IAAI,CAAC;AATI,QAAA,gBAAgB,oBASpB;AAGF,MAAM,kBAAkB,GAAG,KAAK,EACrC,SAAiB,EACjB,QAAiC,EAAE,EACnC,MAAe,EACuB,EAAE,CACxC,CACE,MAAM,kBAAc,CAAC,KAAK,CAAC,MAAM,CAA8B,WAAW,SAAS,EAAE,EAAE;IACrF,MAAM,EAAE,IAAA,2BAAmB,EAAC,KAAK,CAAC;IAClC,OAAO,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC;CAC5B,CAAC,CACH,CAAC,IAAI,CAAC;AAVI,QAAA,kBAAkB,sBAUtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const api = __importStar(require("./probe-webhook.api"));
|
|
27
|
+
const _create = api.createProbeWebhook;
|
|
28
|
+
const _list = api.listProbeWebhook;
|
|
29
|
+
const _delete = api.deleteProbeWebhook;
|
|
30
|
+
void _create;
|
|
31
|
+
void _list;
|
|
32
|
+
void _delete;
|
|
33
|
+
//# sourceMappingURL=probe-webhook.api.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-webhook.api.test.js","sourceRoot":"","sources":["../../src/api/probe-webhook.api.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yDAA2C;AAI3C,MAAM,OAAO,GAAkC,GAAG,CAAC,kBAAkB,CAAC;AACtE,MAAM,KAAK,GAAgC,GAAG,CAAC,gBAAgB,CAAC;AAChE,MAAM,OAAO,GAAkC,GAAG,CAAC,kBAAkB,CAAC;AAEtE,KAAK,OAAO,CAAC;AACb,KAAK,KAAK,CAAC;AACX,KAAK,OAAO,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IAxiosRetryConfig } from 'axios-retry';
|
|
2
|
+
import * as probeScanApi from './api/probe-scan.api';
|
|
3
|
+
import * as probeWebhookApi from './api/probe-webhook.api';
|
|
4
|
+
export * from './api';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export declare const PROBE_WEBHOOK_SIGNATURE_HEADER = "x-probe-signature";
|
|
8
|
+
export declare const PROBE_WEBHOOK_SIGNATURE_ALGORITHM = "sha256";
|
|
9
|
+
type CoreConfig = {
|
|
10
|
+
token?: string;
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
baseURL?: string;
|
|
13
|
+
};
|
|
14
|
+
type AbyssProbeCoreSDK = {
|
|
15
|
+
scan: typeof probeScanApi.scan;
|
|
16
|
+
scanSync: typeof probeScanApi.scanSync;
|
|
17
|
+
scanAsync: typeof probeScanApi.scanAsync;
|
|
18
|
+
getScan: typeof probeScanApi.getScan;
|
|
19
|
+
listScans: typeof probeScanApi.listScans;
|
|
20
|
+
webhook: {
|
|
21
|
+
create: typeof probeWebhookApi.createProbeWebhook;
|
|
22
|
+
list: typeof probeWebhookApi.listProbeWebhook;
|
|
23
|
+
delete: typeof probeWebhookApi.deleteProbeWebhook;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare class AbyssProbeCore {
|
|
27
|
+
private static config;
|
|
28
|
+
static axios: import("axios").AxiosInstance;
|
|
29
|
+
private static _sdk;
|
|
30
|
+
static get sdk(): AbyssProbeCoreSDK;
|
|
31
|
+
private static buildSDK;
|
|
32
|
+
static enableAxiosRetry(axiosRetryConfig?: IAxiosRetryConfig): void;
|
|
33
|
+
static setConfig(config: CoreConfig): void;
|
|
34
|
+
static getConfig(): CoreConfig;
|
|
35
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
var _a;
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.AbyssProbeCore = exports.PROBE_WEBHOOK_SIGNATURE_ALGORITHM = exports.PROBE_WEBHOOK_SIGNATURE_HEADER = void 0;
|
|
34
|
+
const axios_1 = __importDefault(require("axios"));
|
|
35
|
+
const axios_retry_1 = __importStar(require("axios-retry"));
|
|
36
|
+
const probeScanApi = __importStar(require("./api/probe-scan.api"));
|
|
37
|
+
const probeWebhookApi = __importStar(require("./api/probe-webhook.api"));
|
|
38
|
+
const utils_1 = require("./utils");
|
|
39
|
+
__exportStar(require("./api"), exports);
|
|
40
|
+
__exportStar(require("./types"), exports);
|
|
41
|
+
__exportStar(require("./utils"), exports);
|
|
42
|
+
const DEFAULT_BASE_URL = 'https://tools-api.abyss-project.fr/api/';
|
|
43
|
+
exports.PROBE_WEBHOOK_SIGNATURE_HEADER = 'x-probe-signature';
|
|
44
|
+
exports.PROBE_WEBHOOK_SIGNATURE_ALGORITHM = 'sha256';
|
|
45
|
+
const NUMBER_RETRY_API = 10;
|
|
46
|
+
const BASE_DELAY_BETWEEN_RETRY = 5000;
|
|
47
|
+
const RETRY_CODES = [
|
|
48
|
+
502,
|
|
49
|
+
503,
|
|
50
|
+
];
|
|
51
|
+
class AbyssProbeCore {
|
|
52
|
+
static get sdk() {
|
|
53
|
+
if (!_a._sdk) {
|
|
54
|
+
_a._sdk = _a.buildSDK();
|
|
55
|
+
}
|
|
56
|
+
return _a._sdk;
|
|
57
|
+
}
|
|
58
|
+
static buildSDK() {
|
|
59
|
+
return {
|
|
60
|
+
scan: probeScanApi.scan,
|
|
61
|
+
scanSync: probeScanApi.scanSync,
|
|
62
|
+
scanAsync: probeScanApi.scanAsync,
|
|
63
|
+
getScan: probeScanApi.getScan,
|
|
64
|
+
listScans: probeScanApi.listScans,
|
|
65
|
+
webhook: {
|
|
66
|
+
create: probeWebhookApi.createProbeWebhook,
|
|
67
|
+
list: probeWebhookApi.listProbeWebhook,
|
|
68
|
+
delete: probeWebhookApi.deleteProbeWebhook,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
static enableAxiosRetry(axiosRetryConfig) {
|
|
73
|
+
(0, axios_retry_1.default)(_a.axios, {
|
|
74
|
+
retries: NUMBER_RETRY_API,
|
|
75
|
+
retryDelay: (retryCount) => retryCount * BASE_DELAY_BETWEEN_RETRY,
|
|
76
|
+
retryCondition: (error) => (0, axios_retry_1.isNetworkOrIdempotentRequestError)(error) ||
|
|
77
|
+
RETRY_CODES.includes(error.response?.status || 502),
|
|
78
|
+
...axiosRetryConfig,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static setConfig(config) {
|
|
82
|
+
_a._sdk = null;
|
|
83
|
+
_a.config = { ..._a.config, ...config };
|
|
84
|
+
if (config.baseURL) {
|
|
85
|
+
_a.axios.defaults.baseURL = config.baseURL;
|
|
86
|
+
}
|
|
87
|
+
if (config.token) {
|
|
88
|
+
_a.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
|
|
89
|
+
}
|
|
90
|
+
if (config.apiKey) {
|
|
91
|
+
_a.axios.defaults.headers.common[utils_1.API_KEY_HEADER] = `${config.apiKey}`;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static getConfig() {
|
|
95
|
+
return _a.config;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.AbyssProbeCore = AbyssProbeCore;
|
|
99
|
+
_a = AbyssProbeCore;
|
|
100
|
+
AbyssProbeCore.config = {
|
|
101
|
+
token: '',
|
|
102
|
+
apiKey: '',
|
|
103
|
+
baseURL: DEFAULT_BASE_URL,
|
|
104
|
+
};
|
|
105
|
+
AbyssProbeCore.axios = axios_1.default.create({
|
|
106
|
+
baseURL: _a.config.baseURL,
|
|
107
|
+
withCredentials: true,
|
|
108
|
+
});
|
|
109
|
+
AbyssProbeCore._sdk = null;
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,2DAA+F;AAC/F,mEAAqD;AACrD,yEAA2D;AAC3D,mCAAyC;AAEzC,wCAAsB;AACtB,0CAAwB;AACxB,0CAAwB;AAMxB,MAAM,gBAAgB,GAAG,yCAAyC,CAAC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,CAAC,SAAS,CAAC,MAAkB;QACxC,EAAc,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3B,EAAc,CAAC,MAAM,GAAG,EAAE,GAAG,EAAc,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QAEhE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,EAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QACzD,CAAC;QAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,EAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,GAAG,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC;QACxF,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,EAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,sBAAc,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QACpF,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,SAAS;QACrB,OAAO,EAAc,CAAC,MAAM,CAAC;IAC/B,CAAC;;AAlEH,wCAmEC;;AAlEgB,qBAAM,GAAe;IAClC,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,gBAAgB;CAC1B,AAJoB,CAInB;AAEK,oBAAK,GAAG,eAAK,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,EAAI,CAAC,MAAM,CAAC,OAAO;IAC5B,eAAe,EAAE,IAAI;CACtB,CAAC,AAHU,CAGT;AAEY,mBAAI,GAA6B,IAAI,AAAjC,CAAkC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum ErrorType {
|
|
2
|
+
apiError = "api_error",
|
|
3
|
+
authError = "authentication_error",
|
|
4
|
+
resourceError = "resource_error"
|
|
5
|
+
}
|
|
6
|
+
export declare enum Code {
|
|
7
|
+
tokenFailure = "token_authentication_failure",
|
|
8
|
+
authenticationFailure = "authentication_credentials_failure",
|
|
9
|
+
accessNotAllowed = "access_not_allowed",
|
|
10
|
+
notFound = "not_found",
|
|
11
|
+
validationError = "resource_validation_error",
|
|
12
|
+
constraintError = "resource_constraint_error",
|
|
13
|
+
internalServerError = "internal_server_error",
|
|
14
|
+
serviceUnavailable = "service_unavailable",
|
|
15
|
+
invalidData = "invalid_data",
|
|
16
|
+
notImplemented = "not_implemented"
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Code = exports.ErrorType = void 0;
|
|
4
|
+
var ErrorType;
|
|
5
|
+
(function (ErrorType) {
|
|
6
|
+
ErrorType["apiError"] = "api_error";
|
|
7
|
+
ErrorType["authError"] = "authentication_error";
|
|
8
|
+
ErrorType["resourceError"] = "resource_error";
|
|
9
|
+
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
|
10
|
+
var Code;
|
|
11
|
+
(function (Code) {
|
|
12
|
+
Code["tokenFailure"] = "token_authentication_failure";
|
|
13
|
+
Code["authenticationFailure"] = "authentication_credentials_failure";
|
|
14
|
+
Code["accessNotAllowed"] = "access_not_allowed";
|
|
15
|
+
Code["notFound"] = "not_found";
|
|
16
|
+
Code["validationError"] = "resource_validation_error";
|
|
17
|
+
Code["constraintError"] = "resource_constraint_error";
|
|
18
|
+
Code["internalServerError"] = "internal_server_error";
|
|
19
|
+
Code["serviceUnavailable"] = "service_unavailable";
|
|
20
|
+
Code["invalidData"] = "invalid_data";
|
|
21
|
+
Code["notImplemented"] = "not_implemented";
|
|
22
|
+
})(Code || (exports.Code = Code = {}));
|
|
23
|
+
//# sourceMappingURL=api-error.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.enum.js","sourceRoot":"","sources":["../../../src/types/enum/api-error.enum.ts"],"names":[],"mappings":";;;AASA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,mCAAsB,CAAA;IACtB,+CAAkC,CAAA;IAClC,6CAAgC,CAAA;AAClC,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAED,IAAY,IAWX;AAXD,WAAY,IAAI;IACd,qDAA6C,CAAA;IAC7C,oEAA4D,CAAA;IAC5D,+CAAuC,CAAA;IACvC,8BAAsB,CAAA;IACtB,qDAA6C,CAAA;IAC7C,qDAA6C,CAAA;IAC7C,qDAA6C,CAAA;IAC7C,kDAA0C,CAAA;IAC1C,oCAA4B,CAAA;IAC5B,0CAAkC,CAAA;AACpC,CAAC,EAXW,IAAI,oBAAJ,IAAI,QAWf"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api-error.enum"), exports);
|
|
18
|
+
__exportStar(require("./probe-scan.enum"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,oDAAkC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum ProbeScanVerdict {
|
|
2
|
+
CLEAN = "clean",
|
|
3
|
+
INFECTED = "infected"
|
|
4
|
+
}
|
|
5
|
+
export declare enum ProbeScanMode {
|
|
6
|
+
SYNC = "sync",
|
|
7
|
+
ASYNC = "async"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ProbeScanStatus {
|
|
10
|
+
QUEUED = "queued",
|
|
11
|
+
SCANNING = "scanning",
|
|
12
|
+
DONE = "done",
|
|
13
|
+
ERROR = "error"
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProbeScanStatus = exports.ProbeScanMode = exports.ProbeScanVerdict = void 0;
|
|
4
|
+
var ProbeScanVerdict;
|
|
5
|
+
(function (ProbeScanVerdict) {
|
|
6
|
+
ProbeScanVerdict["CLEAN"] = "clean";
|
|
7
|
+
ProbeScanVerdict["INFECTED"] = "infected";
|
|
8
|
+
})(ProbeScanVerdict || (exports.ProbeScanVerdict = ProbeScanVerdict = {}));
|
|
9
|
+
var ProbeScanMode;
|
|
10
|
+
(function (ProbeScanMode) {
|
|
11
|
+
ProbeScanMode["SYNC"] = "sync";
|
|
12
|
+
ProbeScanMode["ASYNC"] = "async";
|
|
13
|
+
})(ProbeScanMode || (exports.ProbeScanMode = ProbeScanMode = {}));
|
|
14
|
+
var ProbeScanStatus;
|
|
15
|
+
(function (ProbeScanStatus) {
|
|
16
|
+
ProbeScanStatus["QUEUED"] = "queued";
|
|
17
|
+
ProbeScanStatus["SCANNING"] = "scanning";
|
|
18
|
+
ProbeScanStatus["DONE"] = "done";
|
|
19
|
+
ProbeScanStatus["ERROR"] = "error";
|
|
20
|
+
})(ProbeScanStatus || (exports.ProbeScanStatus = ProbeScanStatus = {}));
|
|
21
|
+
//# sourceMappingURL=probe-scan.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-scan.enum.js","sourceRoot":"","sources":["../../../src/types/enum/probe-scan.enum.ts"],"names":[],"mappings":";;;AAYA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAQD,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,gCAAe,CAAA;AACjB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAYD,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./interface"), exports);
|
|
18
|
+
__exportStar(require("./enum"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
18
|
+
__exportStar(require("./responses"), exports);
|
|
19
|
+
__exportStar(require("./type-message/response"), exports);
|
|
20
|
+
__exportStar(require("./type-message/api-error"), exports);
|
|
21
|
+
__exportStar(require("./type-message/base-paginate"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/interface/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,0DAAwC;AACxC,2DAAyC;AACzC,+DAA6C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./probe-scan.request"), exports);
|
|
18
|
+
__exportStar(require("./probe-webhook.request"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/requests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,0DAAwC"}
|