@abyss-project/probe 2.0.0 → 2.0.1
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/.eslintrc.js +32 -32
- package/.prettierrc +5 -5
- package/README.md +22 -22
- package/package.json +10 -15
- package/src/api/index.ts +6 -6
- package/src/api/probe-scan.api.test.ts +47 -47
- package/src/api/probe-scan.api.ts +203 -203
- package/src/api/probe-scan.application.api.test.ts +35 -35
- package/src/api/probe-scan.application.api.ts +157 -157
- package/src/api/probe-usage.api.ts +47 -47
- package/src/api/probe-usage.application.api.ts +25 -25
- package/src/api/probe-webhook.api.test.ts +17 -17
- package/src/api/probe-webhook.api.ts +119 -119
- package/src/api/probe-webhook.application.api.test.ts +18 -18
- package/src/api/probe-webhook.application.api.ts +141 -141
- package/src/constants/index.ts +1 -1
- package/src/index.ts +205 -205
- package/src/types/enum/api-error.enum.ts +33 -33
- package/src/types/enum/index.ts +2 -2
- package/src/types/enum/probe-scan.enum.ts +44 -44
- package/src/types/index.ts +2 -2
- package/src/types/interface/api/index.ts +5 -5
- package/src/types/interface/api/requests/index.ts +3 -3
- package/src/types/interface/api/requests/probe-scan.request.ts +54 -54
- package/src/types/interface/api/requests/probe-usage.request.ts +7 -7
- package/src/types/interface/api/requests/probe-webhook.request.ts +33 -33
- package/src/types/interface/api/responses/index.ts +3 -3
- package/src/types/interface/api/responses/probe-scan.response.ts +45 -45
- package/src/types/interface/api/responses/probe-usage.response.ts +25 -25
- package/src/types/interface/api/responses/probe-webhook.response.ts +24 -24
- package/src/types/interface/api/type-message/api-error.ts +7 -7
- package/src/types/interface/api/type-message/base-paginate.ts +11 -11
- package/src/types/interface/api/type-message/response.ts +6 -6
- package/src/types/interface/index.ts +2 -2
- package/src/types/interface/models/index.ts +3 -3
- package/src/types/interface/models/probe-scan.dto.ts +67 -67
- package/src/types/interface/models/probe-webhook-delivery.dto.ts +73 -73
- package/src/types/interface/models/probe-webhook.dto.ts +29 -29
- package/src/types/tests/probe.dto.test.ts +156 -156
- package/src/utils/enum.utils.ts +1 -1
- package/src/utils/error.utils.ts +30 -30
- package/src/utils/index.ts +4 -4
- package/src/utils/probe-scan-cost.utils.ts +101 -101
- package/src/utils/probe-webhook-signature.utils.ts +56 -56
- package/tsconfig.check.json +15 -15
- package/tsconfig.json +36 -36
package/.eslintrc.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: 'tsconfig.check.json',
|
|
5
|
-
tsconfigRootDir: __dirname,
|
|
6
|
-
sourceType: 'module',
|
|
7
|
-
},
|
|
8
|
-
plugins: ['@typescript-eslint/eslint-plugin', 'filenames-simple'],
|
|
9
|
-
extends: [
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:prettier/recommended',
|
|
12
|
-
],
|
|
13
|
-
root: true,
|
|
14
|
-
env: {
|
|
15
|
-
node: true,
|
|
16
|
-
jest: true,
|
|
17
|
-
},
|
|
18
|
-
ignorePatterns: ['.eslintrc.js'],
|
|
19
|
-
rules: {
|
|
20
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
21
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
22
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
23
|
-
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
24
|
-
'filenames-simple/naming-convention': [
|
|
25
|
-
'error',
|
|
26
|
-
{
|
|
27
|
-
rule: '^([a-z0-9]*)(-[a-z0-9]+)*$',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
overrides: [],
|
|
32
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: '@typescript-eslint/parser',
|
|
3
|
+
parserOptions: {
|
|
4
|
+
project: 'tsconfig.check.json',
|
|
5
|
+
tsconfigRootDir: __dirname,
|
|
6
|
+
sourceType: 'module',
|
|
7
|
+
},
|
|
8
|
+
plugins: ['@typescript-eslint/eslint-plugin', 'filenames-simple'],
|
|
9
|
+
extends: [
|
|
10
|
+
'plugin:@typescript-eslint/recommended',
|
|
11
|
+
'plugin:prettier/recommended',
|
|
12
|
+
],
|
|
13
|
+
root: true,
|
|
14
|
+
env: {
|
|
15
|
+
node: true,
|
|
16
|
+
jest: true,
|
|
17
|
+
},
|
|
18
|
+
ignorePatterns: ['.eslintrc.js'],
|
|
19
|
+
rules: {
|
|
20
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
21
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
22
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
23
|
+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
24
|
+
'filenames-simple/naming-convention': [
|
|
25
|
+
'error',
|
|
26
|
+
{
|
|
27
|
+
rule: '^([a-z0-9]*)(-[a-z0-9]+)*$',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
overrides: [],
|
|
32
|
+
};
|
package/.prettierrc
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"trailingComma": "all",
|
|
4
|
-
"printWidth": 100
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"trailingComma": "all",
|
|
4
|
+
"printWidth": 100
|
|
5
|
+
}
|
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# @abyss-project/probe
|
|
2
|
-
|
|
3
|
-
SDK of the AbyssProbe service.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @abyss-project/probe
|
|
9
|
-
# or
|
|
10
|
-
pnpm add @abyss-project/probe
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Liens
|
|
14
|
-
|
|
15
|
-
- **Documentation** : [https://docs.abyss-project.fr](https://docs.abyss-project.fr)
|
|
16
|
-
- **NPM** : [@abyss-project/probe](https://www.npmjs.com/package/@abyss-project/probe)
|
|
17
|
-
- **Application Abyss** : [app.abyss-project.fr](https://app.abyss-project.fr)
|
|
18
|
-
- **Statut des services** : [status.abyss-project.fr](https://status.abyss-project.fr)
|
|
19
|
-
|
|
20
|
-
## Support
|
|
21
|
-
|
|
22
|
-
Pour toute demande, ouvrir un ticket depuis [l'application Abyss](https://app.abyss-project.fr/dashboard/account/tickets/create).
|
|
1
|
+
# @abyss-project/probe
|
|
2
|
+
|
|
3
|
+
SDK of the AbyssProbe service.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @abyss-project/probe
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @abyss-project/probe
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Liens
|
|
14
|
+
|
|
15
|
+
- **Documentation** : [https://docs.abyss-project.fr](https://docs.abyss-project.fr)
|
|
16
|
+
- **NPM** : [@abyss-project/probe](https://www.npmjs.com/package/@abyss-project/probe)
|
|
17
|
+
- **Application Abyss** : [app.abyss-project.fr](https://app.abyss-project.fr)
|
|
18
|
+
- **Statut des services** : [status.abyss-project.fr](https://status.abyss-project.fr)
|
|
19
|
+
|
|
20
|
+
## Support
|
|
21
|
+
|
|
22
|
+
Pour toute demande, ouvrir un ticket depuis [l'application Abyss](https://app.abyss-project.fr/dashboard/account/tickets/create).
|
package/package.json
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/probe",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Core package to interact with AbyssProbe",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.ts"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"lint": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --fix",
|
|
13
|
-
"lint:check": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --max-warnings 0",
|
|
14
|
-
"tsc": "tsc",
|
|
15
|
-
"build": "tsc",
|
|
16
|
-
"prepublishOnly": "tsc && node ../../scripts/check-sdk-surface.cjs",
|
|
17
|
-
"dev": "tsc --watch"
|
|
18
|
-
},
|
|
19
7
|
"repository": {
|
|
20
8
|
"type": "git",
|
|
21
|
-
"url": "https://gitlab.com/abyss-group/abyss-
|
|
9
|
+
"url": "https://gitlab.com/abyss-group/abyss-probe.git"
|
|
22
10
|
},
|
|
23
11
|
"keywords": [],
|
|
24
12
|
"author": "scylla",
|
|
@@ -56,5 +44,12 @@
|
|
|
56
44
|
"prettier": "2.3.1",
|
|
57
45
|
"tsc-watch": "^4.6.2",
|
|
58
46
|
"typescript": "5.9.3"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"lint": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --fix",
|
|
50
|
+
"lint:check": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --max-warnings 0",
|
|
51
|
+
"tsc": "tsc",
|
|
52
|
+
"build": "tsc",
|
|
53
|
+
"dev": "tsc --watch"
|
|
59
54
|
}
|
|
60
|
-
}
|
|
55
|
+
}
|
package/src/api/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './probe-scan.api';
|
|
2
|
-
export * from './probe-webhook.api';
|
|
3
|
-
export * from './probe-scan.application.api';
|
|
4
|
-
export * from './probe-webhook.application.api';
|
|
5
|
-
export * from './probe-usage.api';
|
|
6
|
-
export * from './probe-usage.application.api';
|
|
1
|
+
export * from './probe-scan.api';
|
|
2
|
+
export * from './probe-webhook.api';
|
|
3
|
+
export * from './probe-scan.application.api';
|
|
4
|
+
export * from './probe-webhook.application.api';
|
|
5
|
+
export * from './probe-usage.api';
|
|
6
|
+
export * from './probe-usage.application.api';
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
// Type-level compile test for the probe-scan api surface.
|
|
2
|
-
// No jest runner in this SDK package; compile guard only (mirrors this
|
|
3
|
-
// package's own extraction-plan-preset.api.test.ts).
|
|
4
|
-
// Run: npx tsc --noEmit (from packages/abyss_probe_core), or `npm run build`.
|
|
5
|
-
|
|
6
|
-
import * as api from './probe-scan.api';
|
|
7
|
-
|
|
8
|
-
// All five functions must be exported with these exact signatures.
|
|
9
|
-
const _scan: typeof api.scan = api.scan;
|
|
10
|
-
const _scanSync: typeof api.scanSync = api.scanSync;
|
|
11
|
-
const _scanAsync: typeof api.scanAsync = api.scanAsync;
|
|
12
|
-
const _getScan: typeof api.getScan = api.getScan;
|
|
13
|
-
const _listScans: typeof api.listScans = api.listScans;
|
|
14
|
-
|
|
15
|
-
void _scan;
|
|
16
|
-
void _scanSync;
|
|
17
|
-
void _scanAsync;
|
|
18
|
-
void _getScan;
|
|
19
|
-
void _listScans;
|
|
20
|
-
|
|
21
|
-
// The accepted file inputs (#519). A Blob covers the browser's File and Node's
|
|
22
|
-
// file-backed fs.openAsBlob(path); raw bytes are accepted as a Uint8Array (and
|
|
23
|
-
// therefore a Buffer). A Node stream is refused AT COMPILE TIME: the body is a
|
|
24
|
-
// spec FormData, whose parts need a known length, so honouring a stream would
|
|
25
|
-
// mean buffering up to 2 GiB in memory.
|
|
26
|
-
declare const blob: Blob;
|
|
27
|
-
declare const bytes: Uint8Array;
|
|
28
|
-
declare const buffer: Buffer;
|
|
29
|
-
declare const stream: NodeJS.ReadableStream;
|
|
30
|
-
|
|
31
|
-
const _fromBlob: api.ProbeScanFileInput = blob;
|
|
32
|
-
const _fromBytes: api.ProbeScanFileInput = bytes;
|
|
33
|
-
const _fromBuffer: api.ProbeScanFileInput = buffer;
|
|
34
|
-
// @ts-expect-error a Readable stream is not an accepted scan input since 2.12.0
|
|
35
|
-
const _fromStream: api.ProbeScanFileInput = stream;
|
|
36
|
-
|
|
37
|
-
void _fromBlob;
|
|
38
|
-
void _fromBytes;
|
|
39
|
-
void _fromBuffer;
|
|
40
|
-
void _fromStream;
|
|
41
|
-
|
|
42
|
-
// buildScanForm returns the FormData alone — axios sets the multipart
|
|
43
|
-
// content type and boundary, so there are no headers to merge in.
|
|
44
|
-
const _form: FormData = api.buildScanForm(blob, { filename: 'f.bin' });
|
|
45
|
-
void _form;
|
|
46
|
-
|
|
47
|
-
export {};
|
|
1
|
+
// Type-level compile test for the probe-scan api surface.
|
|
2
|
+
// No jest runner in this SDK package; compile guard only (mirrors this
|
|
3
|
+
// package's own extraction-plan-preset.api.test.ts).
|
|
4
|
+
// Run: npx tsc --noEmit (from packages/abyss_probe_core), or `npm run build`.
|
|
5
|
+
|
|
6
|
+
import * as api from './probe-scan.api';
|
|
7
|
+
|
|
8
|
+
// All five functions must be exported with these exact signatures.
|
|
9
|
+
const _scan: typeof api.scan = api.scan;
|
|
10
|
+
const _scanSync: typeof api.scanSync = api.scanSync;
|
|
11
|
+
const _scanAsync: typeof api.scanAsync = api.scanAsync;
|
|
12
|
+
const _getScan: typeof api.getScan = api.getScan;
|
|
13
|
+
const _listScans: typeof api.listScans = api.listScans;
|
|
14
|
+
|
|
15
|
+
void _scan;
|
|
16
|
+
void _scanSync;
|
|
17
|
+
void _scanAsync;
|
|
18
|
+
void _getScan;
|
|
19
|
+
void _listScans;
|
|
20
|
+
|
|
21
|
+
// The accepted file inputs (#519). A Blob covers the browser's File and Node's
|
|
22
|
+
// file-backed fs.openAsBlob(path); raw bytes are accepted as a Uint8Array (and
|
|
23
|
+
// therefore a Buffer). A Node stream is refused AT COMPILE TIME: the body is a
|
|
24
|
+
// spec FormData, whose parts need a known length, so honouring a stream would
|
|
25
|
+
// mean buffering up to 2 GiB in memory.
|
|
26
|
+
declare const blob: Blob;
|
|
27
|
+
declare const bytes: Uint8Array;
|
|
28
|
+
declare const buffer: Buffer;
|
|
29
|
+
declare const stream: NodeJS.ReadableStream;
|
|
30
|
+
|
|
31
|
+
const _fromBlob: api.ProbeScanFileInput = blob;
|
|
32
|
+
const _fromBytes: api.ProbeScanFileInput = bytes;
|
|
33
|
+
const _fromBuffer: api.ProbeScanFileInput = buffer;
|
|
34
|
+
// @ts-expect-error a Readable stream is not an accepted scan input since 2.12.0
|
|
35
|
+
const _fromStream: api.ProbeScanFileInput = stream;
|
|
36
|
+
|
|
37
|
+
void _fromBlob;
|
|
38
|
+
void _fromBytes;
|
|
39
|
+
void _fromBuffer;
|
|
40
|
+
void _fromStream;
|
|
41
|
+
|
|
42
|
+
// buildScanForm returns the FormData alone — axios sets the multipart
|
|
43
|
+
// content type and boundary, so there are no headers to merge in.
|
|
44
|
+
const _form: FormData = api.buildScanForm(blob, { filename: 'f.bin' });
|
|
45
|
+
void _form;
|
|
46
|
+
|
|
47
|
+
export {};
|