@pactosigna/schemas 0.1.1 → 0.1.3

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.
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Common types and enums shared across contexts
3
+ */
4
+
5
+ type DocumentType = 'user_need' | 'requirement' | 'architecture' | 'detailed_design' | 'test_protocol' | 'test_report' | 'sop' | 'work_instruction' | 'policy' | 'usability_risk' | 'software_risk' | 'security_risk' | 'haz_soe_software' | 'haz_soe_security' | 'hazardous_situation' | 'harm' | 'hazard_category' | 'usability_plan' | 'use_specification' | 'task_analysis' | 'usability_evaluation' | 'summative_evaluation' | 'risk_management_plan' | 'software_development_plan' | 'software_maintenance_plan' | 'soup_register' | 'anomaly' | 'cybersecurity_plan' | 'sbom' | 'clinical_evaluation_plan' | 'clinical_evaluation_report' | 'post_market_surveillance_plan' | 'post_market_feedback' | 'labeling' | 'product_development_plan' | 'intended_use' | 'release_plan' | 'design_review' | 'release_notes' | 'supplier' | 'audit_schedule' | 'audit_report' | 'management_review' | 'software_test_plan';
6
+ type LinkType = 'derives_from' | 'implements' | 'verified_by' | 'mitigates' | 'parent_of' | 'related_to' | 'leads_to' | 'results_in' | 'analyzes';
7
+
8
+ /**
9
+ * Document Type Patterns
10
+ *
11
+ * Defines comprehensive folder-based document type inference rules.
12
+ * Maps folder paths to expected document ID prefixes and document types.
13
+ */
14
+
15
+ interface FolderRule {
16
+ /** Expected document ID prefixes for this folder */
17
+ prefixes: string[];
18
+ /** Document type(s) for documents in this folder */
19
+ type: DocumentType | DocumentType[];
20
+ /** Optional category for requirements (product, software, user) */
21
+ category?: string;
22
+ }
23
+ /**
24
+ * Folder rules mapping paths to expected document types and prefixes
25
+ *
26
+ * Rules are checked in order, first match wins.
27
+ * Paths are normalized to lowercase and use forward slashes.
28
+ */
29
+ declare const FOLDER_RULES: Record<string, FolderRule>;
30
+ /** Folders where .json SBOM files (CycloneDX/SPDX) are recognized alongside .md files */
31
+ declare const JSON_SBOM_FOLDERS: readonly ["docs/cybersecurity/sbom"];
32
+ /**
33
+ * Folders excluded from document type validation.
34
+ *
35
+ * Files in these directories are not regulated QMS documents and are
36
+ * automatically skipped by the directory validator.
37
+ */
38
+ declare const NON_REGULATED_FOLDERS: readonly ["docs/compliance", "docs/user-guide", "docs/legal"];
39
+ /**
40
+ * Find folder rule for a given file path
41
+ *
42
+ * Matches against FOLDER_RULES, checking for exact match or parent folder.
43
+ * Returns null if no rule matches.
44
+ */
45
+ declare function findFolderRule(filePath: string): {
46
+ rule: FolderRule;
47
+ folder: string;
48
+ } | null;
49
+ /**
50
+ * Infer document type from file path and document ID
51
+ *
52
+ * Uses folder rules to determine document type. For folders with multiple
53
+ * types (risk documents), infers from document ID prefix.
54
+ *
55
+ * @param filePath - File path within repository
56
+ * @param documentId - Document ID (e.g., "SRS-001")
57
+ * @returns Document type and optional category, or null if cannot be determined
58
+ */
59
+ declare function inferDocumentType(filePath: string, documentId: string): {
60
+ docType: DocumentType;
61
+ category?: string;
62
+ } | null;
63
+
64
+ export { type DocumentType as D, FOLDER_RULES as F, JSON_SBOM_FOLDERS as J, type LinkType as L, NON_REGULATED_FOLDERS as N, type FolderRule as a, findFolderRule as f, inferDocumentType as i };
@@ -1,59 +1 @@
1
- import { DocumentType } from '@pactosigna/shared';
2
-
3
- /**
4
- * Document Type Patterns
5
- *
6
- * Defines comprehensive folder-based document type inference rules.
7
- * Maps folder paths to expected document ID prefixes and document types.
8
- */
9
-
10
- interface FolderRule {
11
- /** Expected document ID prefixes for this folder */
12
- prefixes: string[];
13
- /** Document type(s) for documents in this folder */
14
- type: DocumentType | DocumentType[];
15
- /** Optional category for requirements (product, software, user) */
16
- category?: string;
17
- }
18
- /**
19
- * Folder rules mapping paths to expected document types and prefixes
20
- *
21
- * Rules are checked in order, first match wins.
22
- * Paths are normalized to lowercase and use forward slashes.
23
- */
24
- declare const FOLDER_RULES: Record<string, FolderRule>;
25
- /** Folders where .json SBOM files (CycloneDX/SPDX) are recognized alongside .md files */
26
- declare const JSON_SBOM_FOLDERS: readonly ["docs/cybersecurity/sbom"];
27
- /**
28
- * Folders excluded from document type validation.
29
- *
30
- * Files in these directories are not regulated QMS documents and are
31
- * automatically skipped by the directory validator.
32
- */
33
- declare const NON_REGULATED_FOLDERS: readonly ["docs/compliance", "docs/user-guide", "docs/legal"];
34
- /**
35
- * Find folder rule for a given file path
36
- *
37
- * Matches against FOLDER_RULES, checking for exact match or parent folder.
38
- * Returns null if no rule matches.
39
- */
40
- declare function findFolderRule(filePath: string): {
41
- rule: FolderRule;
42
- folder: string;
43
- } | null;
44
- /**
45
- * Infer document type from file path and document ID
46
- *
47
- * Uses folder rules to determine document type. For folders with multiple
48
- * types (risk documents), infers from document ID prefix.
49
- *
50
- * @param filePath - File path within repository
51
- * @param documentId - Document ID (e.g., "SRS-001")
52
- * @returns Document type and optional category, or null if cannot be determined
53
- */
54
- declare function inferDocumentType(filePath: string, documentId: string): {
55
- docType: DocumentType;
56
- category?: string;
57
- } | null;
58
-
59
- export { FOLDER_RULES, type FolderRule, JSON_SBOM_FOLDERS, NON_REGULATED_FOLDERS, findFolderRule, inferDocumentType };
1
+ export { F as FOLDER_RULES, a as FolderRule, J as JSON_SBOM_FOLDERS, N as NON_REGULATED_FOLDERS, f as findFolderRule, i as inferDocumentType } from './document-type-patterns-JuAGFi_j.js';