@dvsa/cvs-feature-flags 0.19.0 → 0.20.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.
package/README.md CHANGED
@@ -21,3 +21,40 @@ Feature flags for the Commercial Vehicle Services (CVS) system, published as a G
21
21
  ###### The code that will be published lives inside the ./src directory.
22
22
 
23
23
  If wishing to add new top level directories to the output, then they must be included in the `files` array inside `package.json` as well as included in the `clean:temp` command.
24
+
25
+
26
+ ### Naming conventions followed for RDS Migration
27
+
28
+ When adding a new RDS migration object, the following conventions should be adhered to:
29
+ 1. The object should be named `<domain>DB` e.g. "testFacilityDB", "defectDB", "testTypeDB"
30
+
31
+ 2. A typical object should follow this structure:
32
+ - `enabled`: A boolean indicating if the feature is enabled.
33
+ - `<function>readDDB`: A boolean indicating if reading from DynamoDB is enabled.
34
+ - `<function>readAurora`: A boolean indicating if reading from Aurora is enabled.
35
+ - `<function>writeDDB`: A boolean indicating if writing to DynamoDB is enabled.
36
+ - `<function>writeAurora`: A boolean indicating if writing to Aurora is enabled.
37
+
38
+ (*Note: If Reads/Writes aren't required, the omit the flag)
39
+
40
+ Example
41
+ ```json
42
+ testFacilityDB: {
43
+ enabled: true,
44
+
45
+ // these flags control the /test-station/{+proxy}
46
+ testStationReadDDB: true,
47
+ testStationReadAurora: false,
48
+
49
+ // The only writes that occur in "test stations" are via the put, therefore no need for distinct flags
50
+ testStationWriteDDB: true,
51
+ testStationWriteAurora: false,
52
+
53
+ // these flags control the /activities/{+proxy}
54
+ activityReadDDB: true,
55
+ activityReadAurora: false,
56
+ activityWriteDDB: true
57
+ activityWriteAurora: false
58
+ }
59
+
60
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvsa/cvs-feature-flags",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Common package to be used in CVS to manage feature flags",
5
5
  "author": "DVSA",
6
6
  "license": "ISC",
@@ -42,7 +42,7 @@
42
42
  "@types/aws-lambda": "^8.10.145",
43
43
  "@types/jest": "^29.5.14",
44
44
  "@types/lodash.merge": "^4.6.9",
45
- "@types/node": "^22.15.3",
45
+ "@types/node": "^22.15.16",
46
46
  "aws-sdk-client-mock": "^4.0.1",
47
47
  "aws-sdk-client-mock-jest": "^4.1.0",
48
48
  "husky": "^9.1.7",
package/profiles/vtx.d.ts CHANGED
@@ -17,6 +17,20 @@ declare const defaultFeatureFlags: {
17
17
  abandonedCerts: {
18
18
  enabled: boolean;
19
19
  };
20
+ /**
21
+ * Feature flags for the CVS test facility domain
22
+ */
23
+ testFacilityDB: {
24
+ enabled: boolean;
25
+ testStationReadDDB: boolean;
26
+ testStationReadAurora: boolean;
27
+ testStationWriteDDB: boolean;
28
+ testStationWriteAurora: boolean;
29
+ activityReadDDB: boolean;
30
+ activityReadAurora: boolean;
31
+ activityWriteDDB: boolean;
32
+ activityWriteAurora: boolean;
33
+ };
20
34
  };
21
35
  export type FeatureFlags = typeof defaultFeatureFlags;
22
36
  export declare const getProfile: () => Promise<FeatureFlags>;
package/profiles/vtx.js CHANGED
@@ -26,6 +26,23 @@ const defaultFeatureFlags = {
26
26
  abandonedCerts: {
27
27
  enabled: true,
28
28
  },
29
+ /**
30
+ * Feature flags for the CVS test facility domain
31
+ */
32
+ testFacilityDB: {
33
+ enabled: true,
34
+ // these flags control the /test-station/{+proxy}
35
+ testStationReadDDB: true,
36
+ testStationReadAurora: false,
37
+ // the only write that occurs in "test stations" are via the put-test-station, therefore no need for distinct flags
38
+ testStationWriteDDB: true,
39
+ testStationWriteAurora: false,
40
+ // these flags control the /activities/{+proxy}
41
+ activityReadDDB: true,
42
+ activityReadAurora: false,
43
+ activityWriteDDB: true,
44
+ activityWriteAurora: false,
45
+ },
29
46
  };
30
47
  const getProfile = async () => {
31
48
  const flags = await (0, feature_flags_1.getFeatureFlags)(__1.FeatureFlagsClientName.VTX);