create-filegrc 0.21.12 → 0.21.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-filegrc",
3
- "version": "0.21.12",
3
+ "version": "0.21.14",
4
4
  "description": "Create a filegrc workspace for a SOC 2 program",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/defaults.js CHANGED
@@ -1133,7 +1133,7 @@ export function baselineRecordFiles(effectiveDate, starter = "security") {
1133
1133
  obligationId: obligation.id,
1134
1134
  activityDefinitionVersion: "1",
1135
1135
  recurrence: obligation.recurrence.mode === "calendar"
1136
- ? { ...obligation.recurrence, anchorDate: effectiveDate }
1136
+ ? { ...obligation.recurrence, anchorDate: starterCalendarAnchor(obligation.recurrence, effectiveDate) }
1137
1137
  : obligation.recurrence,
1138
1138
  ...(obligation.window ? { window: obligation.window } : {}),
1139
1139
  ...(starterObligationSelector(obligation.id) ? { selector: starterObligationSelector(obligation.id), completionCoverage: "point-in-time" } : {}),
@@ -1256,6 +1256,18 @@ function calendar(unit, interval, anchorDate) {
1256
1256
  };
1257
1257
  }
1258
1258
 
1259
+ function starterCalendarAnchor(recurrence, effectiveDate) {
1260
+ if (recurrence.anchorDate) return recurrence.anchorDate;
1261
+ if (recurrence.anchorMode === "activation" || recurrence.unit !== "month") return effectiveDate;
1262
+ if (recurrence.interval === 1) return `${effectiveDate.slice(0, 7)}-01`;
1263
+ if (recurrence.interval === 3) {
1264
+ const month = Number(effectiveDate.slice(5, 7));
1265
+ const quarterMonth = Math.floor((month - 1) / 3) * 3 + 1;
1266
+ return `${effectiveDate.slice(0, 4)}-${String(quarterMonth).padStart(2, "0")}-01`;
1267
+ }
1268
+ return effectiveDate;
1269
+ }
1270
+
1259
1271
  function event(eventType) {
1260
1272
  return { mode: "event", eventType };
1261
1273
  }
package/src/index.js CHANGED
@@ -524,13 +524,13 @@ async function runCombinedSetup(target, input) {
524
524
  async function writeMinimalLockfile(target, name, versionRange) {
525
525
  const lock = {
526
526
  name,
527
- version: "0.21.12",
527
+ version: "0.21.14",
528
528
  lockfileVersion: 3,
529
529
  requires: true,
530
530
  packages: {
531
531
  "": {
532
532
  name,
533
- version: "0.21.12",
533
+ version: "0.21.14",
534
534
  dependencies: { filegrc: versionRange }
535
535
  }
536
536
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "{{project_name}}",
3
- "version": "0.21.12",
3
+ "version": "0.21.14",
4
4
  "private": true,
5
5
  "description": "filegrc workspace for a SOC 2 program",
6
6
  "type": "module",