@pactosigna/records 0.1.3 → 0.1.5
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/cli.js +113 -5
- package/dist/generate.d.ts.map +1 -1
- package/dist/generators/arc-generator.d.ts +4 -0
- package/dist/generators/arc-generator.d.ts.map +1 -0
- package/dist/generators/sdd-generator.d.ts +4 -0
- package/dist/generators/sdd-generator.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1996,7 +1996,11 @@ var RiskGapCodeSchema = z29.enum([
|
|
|
1996
1996
|
"unacceptable_no_benefit",
|
|
1997
1997
|
"preliminary_not_analyzed",
|
|
1998
1998
|
"missing_body_rationale",
|
|
1999
|
-
"orphaned_body_section"
|
|
1999
|
+
"orphaned_body_section",
|
|
2000
|
+
"architecture_no_risk_analysis",
|
|
2001
|
+
"security_hazard_no_asset_ref",
|
|
2002
|
+
"high_cia_no_security_hazard",
|
|
2003
|
+
"hazard_no_software_item"
|
|
2000
2004
|
]);
|
|
2001
2005
|
var RiskGapSeveritySchema = z29.enum(["error", "warning"]);
|
|
2002
2006
|
var MitigationSchema = z29.object({
|
|
@@ -2066,7 +2070,9 @@ var HazardSoftwareFrontmatterSchema = z29.object({
|
|
|
2066
2070
|
leads_to: z29.array(z29.string()).optional(),
|
|
2067
2071
|
hazard_category: z29.string().optional(),
|
|
2068
2072
|
detection_score: z29.number().int().min(1).max(5).optional(),
|
|
2069
|
-
detection_method: z29.string().optional()
|
|
2073
|
+
detection_method: z29.string().optional(),
|
|
2074
|
+
/** Reference to the HLD/SDD software item this hazard applies to (IEC 62304 §7.1) */
|
|
2075
|
+
software_item: z29.string().min(1).optional()
|
|
2070
2076
|
});
|
|
2071
2077
|
var HazardSecurityFrontmatterSchema = z29.object({
|
|
2072
2078
|
type: z29.literal("haz_soe_security"),
|
|
@@ -2078,7 +2084,9 @@ var HazardSecurityFrontmatterSchema = z29.object({
|
|
|
2078
2084
|
approvers: z29.array(z29.string()).optional(),
|
|
2079
2085
|
preliminary: z29.boolean().default(false),
|
|
2080
2086
|
leads_to: z29.array(z29.string()).optional(),
|
|
2081
|
-
hazard_category: z29.string().optional()
|
|
2087
|
+
hazard_category: z29.string().optional(),
|
|
2088
|
+
/** Reference to the HLD/SDD software item this security hazard applies to (IEC 62304 §7.1, IEC 81001-5-1) */
|
|
2089
|
+
software_item: z29.string().min(1).optional()
|
|
2082
2090
|
});
|
|
2083
2091
|
var HazardFrontmatterSchema = z29.discriminatedUnion("type", [
|
|
2084
2092
|
HazardSoftwareFrontmatterSchema,
|
|
@@ -2220,6 +2228,22 @@ var SoftwareTestPlanFrontmatterSchema = z52.object({
|
|
|
2220
2228
|
approvers: z52.array(z52.string()).optional()
|
|
2221
2229
|
});
|
|
2222
2230
|
var SoftwareItemTypeSchema = z62.enum(["system", "subsystem", "component", "unit"]);
|
|
2231
|
+
var AssetTypeSchema = z62.enum([
|
|
2232
|
+
"data_store",
|
|
2233
|
+
"api_endpoint",
|
|
2234
|
+
"background_worker",
|
|
2235
|
+
"auth_provider",
|
|
2236
|
+
"external_service",
|
|
2237
|
+
"user_interface",
|
|
2238
|
+
"message_queue",
|
|
2239
|
+
"network_boundary"
|
|
2240
|
+
]);
|
|
2241
|
+
var CiaImpactLevelSchema = z62.enum(["low", "medium", "high"]);
|
|
2242
|
+
var CiaImpactSchema = z62.object({
|
|
2243
|
+
confidentiality: CiaImpactLevelSchema.optional(),
|
|
2244
|
+
integrity: CiaImpactLevelSchema.optional(),
|
|
2245
|
+
availability: CiaImpactLevelSchema.optional()
|
|
2246
|
+
});
|
|
2223
2247
|
var SegregationSchema = z62.object({
|
|
2224
2248
|
mechanism: z62.string().min(1),
|
|
2225
2249
|
rationale: z62.string().min(1)
|
|
@@ -2242,7 +2266,11 @@ var ArchitectureFrontmatterSchema = z62.object({
|
|
|
2242
2266
|
/** Approver list — required for all regulated document types */
|
|
2243
2267
|
approvers: z62.array(z62.string()).min(1),
|
|
2244
2268
|
/** SRS requirement IDs this architecture item implements (IEC 62304 §5.3.1) */
|
|
2245
|
-
implements: z62.array(z62.string().min(1)).optional()
|
|
2269
|
+
implements: z62.array(z62.string().min(1)).optional(),
|
|
2270
|
+
/** IEC 81001-5-1 asset classification for this software item (optional, enables security gap detection) */
|
|
2271
|
+
asset_types: z62.array(AssetTypeSchema).optional(),
|
|
2272
|
+
/** CIA impact assessment — enables automated detection of high-value assets missing security analysis */
|
|
2273
|
+
cia_impact: CiaImpactSchema.optional()
|
|
2246
2274
|
});
|
|
2247
2275
|
var DetailedDesignFrontmatterSchema = z62.object({
|
|
2248
2276
|
id: z62.string().min(1),
|
|
@@ -2262,7 +2290,11 @@ var DetailedDesignFrontmatterSchema = z62.object({
|
|
|
2262
2290
|
/** Approver list — required for all regulated document types */
|
|
2263
2291
|
approvers: z62.array(z62.string()).min(1),
|
|
2264
2292
|
/** SRS requirement IDs this design item implements (IEC 62304 §5.4.2) */
|
|
2265
|
-
implements: z62.array(z62.string().min(1)).optional()
|
|
2293
|
+
implements: z62.array(z62.string().min(1)).optional(),
|
|
2294
|
+
/** IEC 81001-5-1 asset classification for this software item (optional, enables security gap detection) */
|
|
2295
|
+
asset_types: z62.array(AssetTypeSchema).optional(),
|
|
2296
|
+
/** CIA impact assessment — enables automated detection of high-value assets missing security analysis */
|
|
2297
|
+
cia_impact: CiaImpactSchema.optional()
|
|
2266
2298
|
});
|
|
2267
2299
|
var AnomalyCategorySchema = z72.enum([
|
|
2268
2300
|
"bug",
|
|
@@ -5241,6 +5273,80 @@ function generateRmr(input) {
|
|
|
5241
5273
|
});
|
|
5242
5274
|
}
|
|
5243
5275
|
|
|
5276
|
+
// src/generators/arc-generator.ts
|
|
5277
|
+
function generateArc(input) {
|
|
5278
|
+
const docs = readDocuments(input.rootDir, "docs/software/architecture");
|
|
5279
|
+
if (docs.length === 0) {
|
|
5280
|
+
console.warn("ARC: no approved/effective architecture documents found \u2014 skipping");
|
|
5281
|
+
return null;
|
|
5282
|
+
}
|
|
5283
|
+
const content = [];
|
|
5284
|
+
content.push({ text: "Table of Contents", style: "h2", margin: [0, 0, 0, 10] });
|
|
5285
|
+
content.push({
|
|
5286
|
+
ol: docs.map((d) => ({
|
|
5287
|
+
text: `${d.frontmatter.id}: ${d.frontmatter.title}`,
|
|
5288
|
+
margin: [0, 2, 0, 2]
|
|
5289
|
+
}))
|
|
5290
|
+
});
|
|
5291
|
+
content.push({ text: "", pageBreak: "after" });
|
|
5292
|
+
for (const doc of docs) {
|
|
5293
|
+
content.push({
|
|
5294
|
+
text: `${doc.frontmatter.id}: ${doc.frontmatter.title}`,
|
|
5295
|
+
style: "h2",
|
|
5296
|
+
margin: [0, 10, 0, 6]
|
|
5297
|
+
});
|
|
5298
|
+
content.push(...markdownToPdfmake(doc.body));
|
|
5299
|
+
content.push({ text: "", margin: [0, 20, 0, 0] });
|
|
5300
|
+
}
|
|
5301
|
+
return buildDocumentDefinition({
|
|
5302
|
+
config: input.config,
|
|
5303
|
+
rootDir: input.rootDir,
|
|
5304
|
+
recordTitle: "Software Architecture Description",
|
|
5305
|
+
recordId: "ARC",
|
|
5306
|
+
version: input.version,
|
|
5307
|
+
date: input.date,
|
|
5308
|
+
revisionHistory: input.revisionHistory,
|
|
5309
|
+
content
|
|
5310
|
+
});
|
|
5311
|
+
}
|
|
5312
|
+
|
|
5313
|
+
// src/generators/sdd-generator.ts
|
|
5314
|
+
function generateSdd(input) {
|
|
5315
|
+
const docs = readDocuments(input.rootDir, "docs/software/design");
|
|
5316
|
+
if (docs.length === 0) {
|
|
5317
|
+
console.warn("SDD: no approved/effective detailed design documents found \u2014 skipping");
|
|
5318
|
+
return null;
|
|
5319
|
+
}
|
|
5320
|
+
const content = [];
|
|
5321
|
+
content.push({ text: "Table of Contents", style: "h2", margin: [0, 0, 0, 10] });
|
|
5322
|
+
content.push({
|
|
5323
|
+
ol: docs.map((d) => ({
|
|
5324
|
+
text: `${d.frontmatter.id}: ${d.frontmatter.title}`,
|
|
5325
|
+
margin: [0, 2, 0, 2]
|
|
5326
|
+
}))
|
|
5327
|
+
});
|
|
5328
|
+
content.push({ text: "", pageBreak: "after" });
|
|
5329
|
+
for (const doc of docs) {
|
|
5330
|
+
content.push({
|
|
5331
|
+
text: `${doc.frontmatter.id}: ${doc.frontmatter.title}`,
|
|
5332
|
+
style: "h2",
|
|
5333
|
+
margin: [0, 10, 0, 6]
|
|
5334
|
+
});
|
|
5335
|
+
content.push(...markdownToPdfmake(doc.body));
|
|
5336
|
+
content.push({ text: "", margin: [0, 20, 0, 0] });
|
|
5337
|
+
}
|
|
5338
|
+
return buildDocumentDefinition({
|
|
5339
|
+
config: input.config,
|
|
5340
|
+
rootDir: input.rootDir,
|
|
5341
|
+
recordTitle: "Software Detailed Design",
|
|
5342
|
+
recordId: "SDD",
|
|
5343
|
+
version: input.version,
|
|
5344
|
+
date: input.date,
|
|
5345
|
+
revisionHistory: input.revisionHistory,
|
|
5346
|
+
content
|
|
5347
|
+
});
|
|
5348
|
+
}
|
|
5349
|
+
|
|
5244
5350
|
// src/github/changelog.ts
|
|
5245
5351
|
import { execFileSync } from "child_process";
|
|
5246
5352
|
import { resolve as resolve5 } from "path";
|
|
@@ -5296,6 +5402,8 @@ var RECORD_GENERATORS = [
|
|
|
5296
5402
|
{ name: "URS-User-Requirements-Specification", fn: generateUrs },
|
|
5297
5403
|
{ name: "PRS-Product-Requirements-Specification", fn: generatePrs },
|
|
5298
5404
|
{ name: "SRS-Software-Requirements-Specification", fn: generateSrs },
|
|
5405
|
+
{ name: "ARC-Software-Architecture-Description", fn: generateArc },
|
|
5406
|
+
{ name: "SDD-Software-Detailed-Design", fn: generateSdd },
|
|
5299
5407
|
{ name: "PTA-Product-Traceability-Analysis", fn: generatePta },
|
|
5300
5408
|
{ name: "RMR-Risk-Management-Report", fn: generateRmr }
|
|
5301
5409
|
];
|
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA8C1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arc-generator.d.ts","sourceRoot":"","sources":["../../src/generators/arc-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,oBAAoB,GAAG,IAAI,CAwC9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdd-generator.d.ts","sourceRoot":"","sources":["../../src/generators/sdd-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,oBAAoB,GAAG,IAAI,CAwC9E"}
|
package/dist/index.js
CHANGED
|
@@ -1119,6 +1119,80 @@ function generateRmr(input) {
|
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
|
+
// src/generators/arc-generator.ts
|
|
1123
|
+
function generateArc(input) {
|
|
1124
|
+
const docs = readDocuments(input.rootDir, "docs/software/architecture");
|
|
1125
|
+
if (docs.length === 0) {
|
|
1126
|
+
console.warn("ARC: no approved/effective architecture documents found \u2014 skipping");
|
|
1127
|
+
return null;
|
|
1128
|
+
}
|
|
1129
|
+
const content = [];
|
|
1130
|
+
content.push({ text: "Table of Contents", style: "h2", margin: [0, 0, 0, 10] });
|
|
1131
|
+
content.push({
|
|
1132
|
+
ol: docs.map((d) => ({
|
|
1133
|
+
text: `${d.frontmatter.id}: ${d.frontmatter.title}`,
|
|
1134
|
+
margin: [0, 2, 0, 2]
|
|
1135
|
+
}))
|
|
1136
|
+
});
|
|
1137
|
+
content.push({ text: "", pageBreak: "after" });
|
|
1138
|
+
for (const doc of docs) {
|
|
1139
|
+
content.push({
|
|
1140
|
+
text: `${doc.frontmatter.id}: ${doc.frontmatter.title}`,
|
|
1141
|
+
style: "h2",
|
|
1142
|
+
margin: [0, 10, 0, 6]
|
|
1143
|
+
});
|
|
1144
|
+
content.push(...markdownToPdfmake(doc.body));
|
|
1145
|
+
content.push({ text: "", margin: [0, 20, 0, 0] });
|
|
1146
|
+
}
|
|
1147
|
+
return buildDocumentDefinition({
|
|
1148
|
+
config: input.config,
|
|
1149
|
+
rootDir: input.rootDir,
|
|
1150
|
+
recordTitle: "Software Architecture Description",
|
|
1151
|
+
recordId: "ARC",
|
|
1152
|
+
version: input.version,
|
|
1153
|
+
date: input.date,
|
|
1154
|
+
revisionHistory: input.revisionHistory,
|
|
1155
|
+
content
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// src/generators/sdd-generator.ts
|
|
1160
|
+
function generateSdd(input) {
|
|
1161
|
+
const docs = readDocuments(input.rootDir, "docs/software/design");
|
|
1162
|
+
if (docs.length === 0) {
|
|
1163
|
+
console.warn("SDD: no approved/effective detailed design documents found \u2014 skipping");
|
|
1164
|
+
return null;
|
|
1165
|
+
}
|
|
1166
|
+
const content = [];
|
|
1167
|
+
content.push({ text: "Table of Contents", style: "h2", margin: [0, 0, 0, 10] });
|
|
1168
|
+
content.push({
|
|
1169
|
+
ol: docs.map((d) => ({
|
|
1170
|
+
text: `${d.frontmatter.id}: ${d.frontmatter.title}`,
|
|
1171
|
+
margin: [0, 2, 0, 2]
|
|
1172
|
+
}))
|
|
1173
|
+
});
|
|
1174
|
+
content.push({ text: "", pageBreak: "after" });
|
|
1175
|
+
for (const doc of docs) {
|
|
1176
|
+
content.push({
|
|
1177
|
+
text: `${doc.frontmatter.id}: ${doc.frontmatter.title}`,
|
|
1178
|
+
style: "h2",
|
|
1179
|
+
margin: [0, 10, 0, 6]
|
|
1180
|
+
});
|
|
1181
|
+
content.push(...markdownToPdfmake(doc.body));
|
|
1182
|
+
content.push({ text: "", margin: [0, 20, 0, 0] });
|
|
1183
|
+
}
|
|
1184
|
+
return buildDocumentDefinition({
|
|
1185
|
+
config: input.config,
|
|
1186
|
+
rootDir: input.rootDir,
|
|
1187
|
+
recordTitle: "Software Detailed Design",
|
|
1188
|
+
recordId: "SDD",
|
|
1189
|
+
version: input.version,
|
|
1190
|
+
date: input.date,
|
|
1191
|
+
revisionHistory: input.revisionHistory,
|
|
1192
|
+
content
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1122
1196
|
// src/github/changelog.ts
|
|
1123
1197
|
import { execFileSync } from "child_process";
|
|
1124
1198
|
import { resolve as resolve5 } from "path";
|
|
@@ -1174,6 +1248,8 @@ var RECORD_GENERATORS = [
|
|
|
1174
1248
|
{ name: "URS-User-Requirements-Specification", fn: generateUrs },
|
|
1175
1249
|
{ name: "PRS-Product-Requirements-Specification", fn: generatePrs },
|
|
1176
1250
|
{ name: "SRS-Software-Requirements-Specification", fn: generateSrs },
|
|
1251
|
+
{ name: "ARC-Software-Architecture-Description", fn: generateArc },
|
|
1252
|
+
{ name: "SDD-Software-Detailed-Design", fn: generateSdd },
|
|
1177
1253
|
{ name: "PTA-Product-Traceability-Analysis", fn: generatePta },
|
|
1178
1254
|
{ name: "RMR-Risk-Management-Report", fn: generateRmr }
|
|
1179
1255
|
];
|