@abyss-project/tools 2.1.0 → 2.2.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.
Files changed (132) hide show
  1. package/dist/api/index.d.ts +4 -0
  2. package/dist/api/index.js +4 -0
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/probe-scan.api.d.ts +15 -0
  5. package/dist/api/probe-scan.api.js +74 -0
  6. package/dist/api/probe-scan.api.js.map +1 -0
  7. package/dist/api/probe-scan.api.test.d.ts +1 -0
  8. package/dist/api/probe-scan.api.test.js +37 -0
  9. package/dist/api/probe-scan.api.test.js.map +1 -0
  10. package/dist/api/probe-scan.application.api.d.ts +7 -0
  11. package/dist/api/probe-scan.application.api.js +40 -0
  12. package/dist/api/probe-scan.application.api.js.map +1 -0
  13. package/dist/api/probe-scan.application.api.test.d.ts +1 -0
  14. package/dist/api/probe-scan.application.api.test.js +37 -0
  15. package/dist/api/probe-scan.application.api.test.js.map +1 -0
  16. package/dist/api/probe-webhook.api.d.ts +4 -0
  17. package/dist/api/probe-webhook.api.js +34 -0
  18. package/dist/api/probe-webhook.api.js.map +1 -0
  19. package/dist/api/probe-webhook.api.test.d.ts +1 -0
  20. package/dist/api/probe-webhook.api.test.js +33 -0
  21. package/dist/api/probe-webhook.api.test.js.map +1 -0
  22. package/dist/api/probe-webhook.application.api.d.ts +4 -0
  23. package/dist/api/probe-webhook.application.api.js +14 -0
  24. package/dist/api/probe-webhook.application.api.js.map +1 -0
  25. package/dist/api/probe-webhook.application.api.test.d.ts +1 -0
  26. package/dist/api/probe-webhook.application.api.test.js +33 -0
  27. package/dist/api/probe-webhook.application.api.test.js.map +1 -0
  28. package/dist/index.d.ts +31 -0
  29. package/dist/index.js +32 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/types/enum/api-error.enum.d.ts +1 -5
  32. package/dist/types/enum/api-error.enum.js +0 -4
  33. package/dist/types/enum/api-error.enum.js.map +1 -1
  34. package/dist/types/enum/index.d.ts +1 -1
  35. package/dist/types/enum/index.js +1 -1
  36. package/dist/types/enum/index.js.map +1 -1
  37. package/dist/types/enum/probe-scan.enum.d.ts +14 -0
  38. package/dist/types/enum/probe-scan.enum.js +21 -0
  39. package/dist/types/enum/probe-scan.enum.js.map +1 -0
  40. package/dist/types/interface/api/requests/index.d.ts +2 -0
  41. package/dist/types/interface/api/requests/index.js +2 -0
  42. package/dist/types/interface/api/requests/index.js.map +1 -1
  43. package/dist/types/interface/api/requests/probe-scan.request.d.ts +22 -0
  44. package/dist/types/interface/api/{responses/file-scan.response.js → requests/probe-scan.request.js} +1 -1
  45. package/dist/types/interface/api/requests/probe-scan.request.js.map +1 -0
  46. package/dist/types/interface/api/requests/probe-webhook.request.d.ts +6 -0
  47. package/dist/types/{enum/file-scan-status.enum.js → interface/api/requests/probe-webhook.request.js} +1 -1
  48. package/dist/types/interface/api/requests/probe-webhook.request.js.map +1 -0
  49. package/dist/types/interface/api/responses/beam.response.d.ts +1 -3
  50. package/dist/types/interface/api/responses/index.d.ts +2 -0
  51. package/dist/types/interface/api/responses/index.js +2 -0
  52. package/dist/types/interface/api/responses/index.js.map +1 -1
  53. package/dist/types/interface/api/responses/probe-scan.response.d.ts +18 -0
  54. package/dist/types/interface/api/responses/probe-scan.response.js +3 -0
  55. package/dist/types/interface/api/responses/probe-scan.response.js.map +1 -0
  56. package/dist/types/interface/api/responses/probe-webhook.response.d.ts +10 -0
  57. package/dist/types/interface/api/responses/probe-webhook.response.js +3 -0
  58. package/dist/types/interface/api/responses/probe-webhook.response.js.map +1 -0
  59. package/dist/types/interface/models/atlas-document.dto.d.ts +0 -3
  60. package/dist/types/interface/models/beam.dto.d.ts +0 -3
  61. package/dist/types/interface/models/board-card-document.dto.d.ts +0 -3
  62. package/dist/types/interface/models/extraction.dto.d.ts +0 -2
  63. package/dist/types/interface/models/extraction.dto.js.map +1 -1
  64. package/dist/types/interface/models/index.d.ts +3 -0
  65. package/dist/types/interface/models/index.js +3 -0
  66. package/dist/types/interface/models/index.js.map +1 -1
  67. package/dist/types/interface/models/probe-scan.dto.d.ts +22 -0
  68. package/dist/types/interface/models/{file-scan.dto.js → probe-scan.dto.js} +1 -1
  69. package/dist/types/interface/models/probe-scan.dto.js.map +1 -0
  70. package/dist/types/interface/models/probe-webhook-delivery.dto.d.ts +7 -0
  71. package/dist/types/interface/models/probe-webhook-delivery.dto.js +3 -0
  72. package/dist/types/interface/models/probe-webhook-delivery.dto.js.map +1 -0
  73. package/dist/types/interface/models/probe-webhook.dto.d.ts +9 -0
  74. package/dist/types/interface/{api/requests/file-scan.request.js → models/probe-webhook.dto.js} +1 -1
  75. package/dist/types/interface/models/probe-webhook.dto.js.map +1 -0
  76. package/dist/types/tests/probe.dto.test.d.ts +1 -0
  77. package/dist/types/tests/probe.dto.test.js +62 -0
  78. package/dist/types/tests/probe.dto.test.js.map +1 -0
  79. package/dist/utils/index.d.ts +1 -0
  80. package/dist/utils/index.js +1 -0
  81. package/dist/utils/index.js.map +1 -1
  82. package/dist/utils/probe-webhook-signature.utils.d.ts +8 -0
  83. package/dist/utils/probe-webhook-signature.utils.js +22 -0
  84. package/dist/utils/probe-webhook-signature.utils.js.map +1 -0
  85. package/package.json +1 -1
  86. package/src/api/index.ts +6 -0
  87. package/src/api/probe-scan.api.test.ts +21 -0
  88. package/src/api/probe-scan.api.ts +191 -0
  89. package/src/api/probe-scan.application.api.test.ts +21 -0
  90. package/src/api/probe-scan.application.api.ts +157 -0
  91. package/src/api/probe-webhook.api.test.ts +17 -0
  92. package/src/api/probe-webhook.api.ts +81 -0
  93. package/src/api/probe-webhook.application.api.test.ts +18 -0
  94. package/src/api/probe-webhook.application.api.ts +87 -0
  95. package/src/index.ts +86 -0
  96. package/src/types/enum/api-error.enum.ts +0 -25
  97. package/src/types/enum/index.ts +1 -1
  98. package/src/types/enum/probe-scan.enum.ts +44 -0
  99. package/src/types/interface/api/requests/index.ts +2 -0
  100. package/src/types/interface/api/requests/probe-scan.request.ts +50 -0
  101. package/src/types/interface/api/requests/probe-webhook.request.ts +12 -0
  102. package/src/types/interface/api/responses/beam.response.ts +1 -15
  103. package/src/types/interface/api/responses/index.ts +2 -0
  104. package/src/types/interface/api/responses/probe-scan.response.ts +38 -0
  105. package/src/types/interface/api/responses/probe-webhook.response.ts +17 -0
  106. package/src/types/interface/models/atlas-document.dto.ts +0 -18
  107. package/src/types/interface/models/beam.dto.ts +0 -22
  108. package/src/types/interface/models/board-card-document.dto.ts +0 -18
  109. package/src/types/interface/models/extraction.dto.ts +0 -17
  110. package/src/types/interface/models/index.ts +3 -0
  111. package/src/types/interface/models/probe-scan.dto.ts +48 -0
  112. package/src/types/interface/models/probe-webhook-delivery.dto.ts +26 -0
  113. package/src/types/interface/models/probe-webhook.dto.ts +25 -0
  114. package/src/types/tests/beam.dto.spec.ts +0 -2
  115. package/src/types/tests/probe.dto.test.ts +97 -0
  116. package/src/utils/index.ts +1 -0
  117. package/src/utils/probe-webhook-signature.utils.ts +56 -0
  118. package/dist/api/file-scan.api.d.ts +0 -5
  119. package/dist/api/file-scan.api.js +0 -49
  120. package/dist/api/file-scan.api.js.map +0 -1
  121. package/dist/types/enum/analysis-status.enum.d.ts +0 -7
  122. package/dist/types/enum/analysis-status.enum.js +0 -12
  123. package/dist/types/enum/analysis-status.enum.js.map +0 -1
  124. package/dist/types/enum/file-scan-status.enum.d.ts +0 -1
  125. package/dist/types/enum/file-scan-status.enum.js.map +0 -1
  126. package/dist/types/interface/api/requests/file-scan.request.d.ts +0 -3
  127. package/dist/types/interface/api/requests/file-scan.request.js.map +0 -1
  128. package/dist/types/interface/api/responses/file-scan.response.d.ts +0 -7
  129. package/dist/types/interface/api/responses/file-scan.response.js.map +0 -1
  130. package/dist/types/interface/models/file-scan.dto.d.ts +0 -11
  131. package/dist/types/interface/models/file-scan.dto.js.map +0 -1
  132. package/src/types/enum/file-scan-status.enum.ts +0 -23
@@ -0,0 +1,97 @@
1
+ // Type-level compile test for AbyssProbe's DTO/response shapes — asserts
2
+ // they match the server contract (probe-scan.controller.ts /
3
+ // probe-webhook.controller.ts / probe-webhook-delivery.service.ts) at
4
+ // compile time: any incompatible rename/removal on either side fails
5
+ // `npm run build` here. No jest runner in this SDK package; compile guard
6
+ // only (mirrors ../api/extraction-plan-preset.api.test.ts). Run: npx tsc --noEmit.
7
+
8
+ import {
9
+ ProbeScanVerdict,
10
+ ProbeScanMode,
11
+ ProbeScanStatus,
12
+ IProbeScanDetail,
13
+ IProbeScanHistoryItem,
14
+ IProbeWebhook,
15
+ IProbeWebhookCreated,
16
+ IProbeWebhookDeliveryPayload,
17
+ IScanSyncData,
18
+ IScanAsyncData,
19
+ } from '..';
20
+
21
+ // Enum exhaustiveness: fails to compile if a member is added/removed/renamed
22
+ // here without updating this file — a cheap drift guard for values
23
+ // transported verbatim over the wire (this SDK does not control the
24
+ // server's enum, so a silent value drift is exactly what this must catch).
25
+ const _verdicts: Record<ProbeScanVerdict, true> = { clean: true, infected: true };
26
+ const _modes: Record<ProbeScanMode, true> = { sync: true, async: true };
27
+ const _statuses: Record<ProbeScanStatus, true> = {
28
+ queued: true,
29
+ scanning: true,
30
+ done: true,
31
+ error: true,
32
+ };
33
+
34
+ // GET /scan/:scanId
35
+ const _scanDetail: IProbeScanDetail = {
36
+ scanId: 's1',
37
+ status: ProbeScanStatus.DONE,
38
+ verdict: ProbeScanVerdict.CLEAN,
39
+ viruses: [],
40
+ context: null,
41
+ };
42
+
43
+ // GET /scan history row — richer than IProbeScanDetail (fileName/fileSize/
44
+ // mimeType/mode/timestamps), still never the internal ownership columns.
45
+ const _historyItem: IProbeScanHistoryItem = {
46
+ scanId: 's1',
47
+ fileName: 'invoice.pdf',
48
+ fileSize: 1024,
49
+ mimeType: 'application/pdf',
50
+ verdict: ProbeScanVerdict.INFECTED,
51
+ viruses: ['Eicar-Test-Signature'],
52
+ mode: ProbeScanMode.ASYNC,
53
+ status: ProbeScanStatus.DONE,
54
+ context: { applicationFileId: 'af1' },
55
+ startedAt: new Date(),
56
+ finishedAt: new Date(),
57
+ createdAt: new Date(),
58
+ };
59
+
60
+ // POST /scan — sync (200) / async (202) data shapes.
61
+ const _scanSyncData: IScanSyncData = {
62
+ scanId: 's1',
63
+ verdict: ProbeScanVerdict.CLEAN,
64
+ viruses: [],
65
+ };
66
+ const _scanAsyncData: IScanAsyncData = { scanId: 's1', status: ProbeScanStatus.QUEUED };
67
+
68
+ // Webhook subscription — list/get shape vs the create-only `secret` shape.
69
+ const _webhook: IProbeWebhook = {
70
+ id: 'w1',
71
+ callbackUrl: 'https://example.com/hook',
72
+ active: true,
73
+ createdAt: new Date(),
74
+ };
75
+ const _webhookCreated: IProbeWebhookCreated = { ..._webhook, secret: 'shh' };
76
+
77
+ // Webhook delivery payload — the exact body signed by x-probe-signature
78
+ // (see verifyProbeWebhookSignature).
79
+ const _deliveryPayload: IProbeWebhookDeliveryPayload = {
80
+ scanId: 's1',
81
+ context: null,
82
+ verdict: ProbeScanVerdict.INFECTED,
83
+ viruses: ['Eicar-Test-Signature'],
84
+ };
85
+
86
+ void _verdicts;
87
+ void _modes;
88
+ void _statuses;
89
+ void _scanDetail;
90
+ void _historyItem;
91
+ void _scanSyncData;
92
+ void _scanAsyncData;
93
+ void _webhook;
94
+ void _webhookCreated;
95
+ void _deliveryPayload;
96
+
97
+ export {};
@@ -4,3 +4,4 @@ export * from './shape.utils';
4
4
  export * from './icons.utils';
5
5
  export * from './enum.utils';
6
6
  export * from './extraction-webhook.utils';
7
+ export * from './probe-webhook-signature.utils';
@@ -0,0 +1,56 @@
1
+ // ──────────────────────────────────────────────
2
+ // AbyssProbe webhook signature verification (helper for RECEIVERS of a
3
+ // webhook delivery — the abyss-main UI/abyss-storage/any external
4
+ // integrator that registered a callbackUrl).
5
+ //
6
+ // Mirrors this package's own extraction-webhook.utils.ts
7
+ // (verifyExtractionWebhook) — the same package's own precedent for this
8
+ // exact problem — adapted to AbyssProbe's actual wire format: the signature
9
+ // header (see PROBE_WEBHOOK_SIGNATURE_HEADER in this package's root index)
10
+ // carries the RAW hex HMAC digest with no `sha256=` prefix (unlike
11
+ // extraction's `X-RCB-Signature: sha256=<hex>`) — see
12
+ // apps/api/src/services/probe-webhook-delivery.service.ts's `sign()`.
13
+ //
14
+ // Lazy-requires `crypto` so the SDK stays browser-compatible when this
15
+ // utility is never invoked (a browser page is never the receiving end of a
16
+ // server-to-server webhook).
17
+ // ──────────────────────────────────────────────
18
+
19
+ export interface VerifyProbeWebhookSignatureInput {
20
+ /** The exact bytes/string the receiver's HTTP framework handed it — must be the RAW body, not a re-serialized JSON.parse/stringify round trip (whitespace/key-order would change the HMAC). */
21
+ rawBody: string | Buffer;
22
+ /** The incoming `x-probe-signature` header value. */
23
+ signatureHeader: string | undefined;
24
+ /** This webhook registration's secret (returned once at creation — see IProbeWebhookCreated). */
25
+ secret: string;
26
+ }
27
+
28
+ /**
29
+ * Recompute the HMAC-SHA256 of `rawBody` with `secret` and constant-time
30
+ * compare it against `signatureHeader`. Returns `false` (never throws) for
31
+ * any malformed input — a hostile/truncated header must not crash the
32
+ * receiver.
33
+ */
34
+ export function verifyProbeWebhookSignature(input: VerifyProbeWebhookSignatureInput): boolean {
35
+ if (!input.signatureHeader || !input.secret) return false;
36
+
37
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
38
+ const crypto = require('crypto');
39
+ const computed: string = crypto
40
+ .createHmac('sha256', input.secret)
41
+ .update(input.rawBody)
42
+ .digest('hex');
43
+
44
+ if (input.signatureHeader.length !== computed.length) return false;
45
+
46
+ try {
47
+ return crypto.timingSafeEqual(
48
+ Buffer.from(input.signatureHeader, 'hex'),
49
+ Buffer.from(computed, 'hex'),
50
+ );
51
+ } catch {
52
+ // Buffer.from(..., 'hex') on a non-hex string yields a shorter buffer,
53
+ // which would otherwise make timingSafeEqual throw on a length mismatch.
54
+ return false;
55
+ }
56
+ }
@@ -1,5 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { IFileScanOptions } from '../types';
4
- import { IFileScanResponse } from '../types';
5
- export declare const scan: (file: Buffer | Uint8Array, opts?: IFileScanOptions, apiKey?: string) => Promise<IFileScanResponse>;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scan = void 0;
4
- const __1 = require("..");
5
- const DEFAULT_API_KEY_HEADER = 'abyss-api-key';
6
- function authHeader(apiKey) {
7
- return apiKey ? { [DEFAULT_API_KEY_HEADER]: apiKey } : {};
8
- }
9
- async function loadFormData() {
10
- if (typeof FormData !== 'undefined' && typeof window !== 'undefined') {
11
- return FormData;
12
- }
13
- const nodeRequire = new Function('return require')();
14
- return nodeRequire('form-data');
15
- }
16
- const scan = async (file, opts = {}, apiKey) => {
17
- const fileName = 'file';
18
- const isBrowser = typeof window !== 'undefined' && typeof FormData !== 'undefined';
19
- if (isBrowser) {
20
- const form = new FormData();
21
- const blob = new Blob([file]);
22
- form.append('file', blob, fileName);
23
- if (opts.organizationId) {
24
- form.append('organizationId', opts.organizationId);
25
- }
26
- return (await __1.AbyssToolsCore.axios.post(`file-scan/scan`, form, {
27
- headers: authHeader(apiKey),
28
- maxBodyLength: Infinity,
29
- maxContentLength: Infinity,
30
- })).data;
31
- }
32
- const FormDataCtor = await loadFormData();
33
- const form = new FormDataCtor();
34
- const buf = Buffer.isBuffer(file) ? file : Buffer.from(file);
35
- form.append('file', buf, { filename: fileName });
36
- if (opts.organizationId) {
37
- form.append('organizationId', opts.organizationId);
38
- }
39
- return (await __1.AbyssToolsCore.axios.post(`file-scan/scan`, form, {
40
- headers: {
41
- ...(typeof form.getHeaders === 'function' ? form.getHeaders() : {}),
42
- ...authHeader(apiKey),
43
- },
44
- maxBodyLength: Infinity,
45
- maxContentLength: Infinity,
46
- })).data;
47
- };
48
- exports.scan = scan;
49
- //# sourceMappingURL=file-scan.api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-scan.api.js","sourceRoot":"","sources":["../../src/api/file-scan.api.ts"],"names":[],"mappings":";;;AAUA,0BAAoC;AAIpC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,SAAS,UAAU,CAAC,MAAe;IACjC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED,KAAK,UAAU,YAAY;IACzB,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACrE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAKD,MAAM,WAAW,GAAgB,IAAI,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;IAClE,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC;AAQM,MAAM,IAAI,GAAG,KAAK,EACvB,IAAyB,EACzB,OAAyB,EAAE,EAC3B,MAAe,EACa,EAAE;IAC9B,MAAM,QAAQ,GAAG,MAAM,CAAC;IACxB,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;IACnF,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAkB,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QACpC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,CACL,MAAM,kBAAc,CAAC,KAAK,CAAC,IAAI,CAAoB,gBAAgB,EAAE,IAAI,EAAE;YACzE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC;YAC3B,aAAa,EAAE,QAAQ;YACvB,gBAAgB,EAAE,QAAQ;SAC3B,CAAC,CACH,CAAC,IAAI,CAAC;IACT,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,YAAY,EAAE,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;IAChC,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,CACL,MAAM,kBAAc,CAAC,KAAK,CAAC,IAAI,CAAoB,gBAAgB,EAAE,IAAI,EAAE;QACzE,OAAO,EAAE;YACP,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnE,GAAG,UAAU,CAAC,MAAM,CAAC;SACtB;QACD,aAAa,EAAE,QAAQ;QACvB,gBAAgB,EAAE,QAAQ;KAC3B,CAAC,CACH,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AAvCW,QAAA,IAAI,QAuCf"}
@@ -1,7 +0,0 @@
1
- export declare enum AnalysisStatus {
2
- PENDING = "pending",
3
- CLEAN = "clean",
4
- INFECTED = "infected",
5
- SKIPPED = "skipped",
6
- ERROR = "error"
7
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalysisStatus = void 0;
4
- var AnalysisStatus;
5
- (function (AnalysisStatus) {
6
- AnalysisStatus["PENDING"] = "pending";
7
- AnalysisStatus["CLEAN"] = "clean";
8
- AnalysisStatus["INFECTED"] = "infected";
9
- AnalysisStatus["SKIPPED"] = "skipped";
10
- AnalysisStatus["ERROR"] = "error";
11
- })(AnalysisStatus || (exports.AnalysisStatus = AnalysisStatus = {}));
12
- //# sourceMappingURL=analysis-status.enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analysis-status.enum.js","sourceRoot":"","sources":["../../../src/types/enum/analysis-status.enum.ts"],"names":[],"mappings":";;;AAOA,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,uCAAqB,CAAA;IACrB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;AACjB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB"}
@@ -1 +0,0 @@
1
- export type FileScanStatus = 'pending_scan' | 'clean' | 'infected' | 'skipped' | 'error';
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-scan-status.enum.js","sourceRoot":"","sources":["../../../src/types/enum/file-scan-status.enum.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export interface IFileScanOptions {
2
- organizationId?: string;
3
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-scan.request.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/requests/file-scan.request.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import { IResponse } from '../type-message/response';
2
- import { IFileAnalysis } from '../../models/file-scan.dto';
3
- export interface IFileScanData {
4
- analysis: IFileAnalysis;
5
- scanCostUnits: number;
6
- }
7
- export type IFileScanResponse = IResponse<IFileScanData>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-scan.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/file-scan.response.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { AnalysisStatus } from '../../enum/analysis-status.enum';
2
- export interface IFileAnalysis {
3
- status: AnalysisStatus;
4
- engine: string | null;
5
- engineVersion: string | null;
6
- contentHash: string | null;
7
- viruses: string[];
8
- startedAt: string | null;
9
- finishedAt: string | null;
10
- durationMs: number | null;
11
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-scan.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/file-scan.dto.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- /**
2
- * Antivirus scan verdict for a stored file, mirrored from AbyssStorage.
3
- *
4
- * This is the SAME vocabulary as `@abyss-project/storage`'s `FileScanStatus`
5
- * enum (`application_files.scanStatus`): `pending_scan` | `clean` | `infected`
6
- * | `skipped` | `error`. It is intentionally re-declared here as a string
7
- * union — NOT imported — because abyss-tools-core is standalone (does not
8
- * depend on `@abyss-project/storage`), the same approach every other core
9
- * package (abyss-main asset-core, abyss-banking-core, abyss-memories-core)
10
- * takes. A string union (rather than a local TS enum) is deliberate: the
11
- * backend assigns a storage `FileScanStatus` enum value straight into this
12
- * type with no cast (a string-enum member is assignable to the matching
13
- * string union, but NOT to a distinct local enum with identical values).
14
- * Keep the members in sync with storage's enum.
15
- *
16
- * Used by both async-enforce document surfaces (AV v3 P2): BoardCardDocument
17
- * and AtlasDocument. `pending_scan` gates `get()` (see
18
- * board-card-document.service.ts#assertNotPendingScan /
19
- * atlas-document.service.ts#assertNotPendingScan) with a 423; `infected`
20
- * never persists on a row (the row is purged instead, see purgeInfected on
21
- * both services).
22
- */
23
- export type FileScanStatus = 'pending_scan' | 'clean' | 'infected' | 'skipped' | 'error';