Skip to content

Commit 639dc3a

Browse files
Merge pull request #60 from DSACMS/DSACMS/nat/schema-update
Updated contractNumber type and feedbackMechanism type and generation
2 parents 2ea5ec2 + 4c7963e commit 639dc3a

6 files changed

Lines changed: 23 additions & 28 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The automated code.json generator calculates specific fields by analyzing your r
8282
8383
**dateMetaDataLastUpdated**: The generator sets this to the current timestamp each time it runs, providing a record of when the metadata was last refreshed. No configuration needed.
8484
85-
**feedbackMechanisms**: A list of containing your repository's issues URL in the format of {repositoryURL}/issues. If you already have a code.json file with existing feedback mechanisms, the generator preserves those values. No configuration needed.
85+
**feedbackMechanism**: The repository's issues URL in the format of {repositoryURL}/issues. If you already have a code.json file with existing feedback mechanisms, the generator preserves those values. No configuration needed.
8686
8787
## Project Vision
8888

code.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"softwareType": "standalone/backend",
3030
"languages": ["TypeScript", "JavaScript"],
3131
"maintenance": "internal",
32-
"contractNumber": "",
32+
"contractNumber": [],
3333
"date": {
3434
"created": "2025-02-07T16:29:38Z",
3535
"lastModified": "2025-06-06T17:48:49Z",
@@ -40,9 +40,7 @@
4040
"email": "opensource@cms.hhs.gov",
4141
"name": "CMS Open Source Team"
4242
},
43-
"feedbackMechanisms": [
44-
"https://github.com/DSACMS/automated-codejson-generator/issues"
45-
],
43+
"feedbackMechanism": "https://github.com/DSACMS/automated-codejson-generator/issues",
4644
"localisation": false,
4745
"repositoryType": "tools",
4846
"userInput": false,

dist/index.js

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/model.d.ts

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const baselineCodeJSON: CodeJSON = {
1313
URL: "",
1414
},
1515
],
16-
usageType: "",
16+
usageType: [],
1717
exemptionText: "",
1818
},
1919
organization: "",
@@ -32,7 +32,7 @@ const baselineCodeJSON: CodeJSON = {
3232
softwareType: "",
3333
languages: [],
3434
maintenance: "",
35-
contractNumber: "",
35+
contractNumber: [],
3636
date: {
3737
created: "",
3838
lastModified: "",
@@ -43,7 +43,8 @@ const baselineCodeJSON: CodeJSON = {
4343
email: "",
4444
name: "",
4545
},
46-
feedbackMechanisms: [],
46+
feedbackMechanism: "",
47+
AIUseCaseID: "0",
4748
localisation: false,
4849
repositoryType: "",
4950
userInput: false,
@@ -63,11 +64,7 @@ async function getMetaData(
6364
const partialCodeJSON = await helpers.calculateMetaData();
6465

6566
// preserve existing feedback mechanisms if they exist, otherwise default to GitHub Issues
66-
const existingMechanisms = existingCodeJSON?.feedbackMechanisms || [];
67-
const feedbackMechanisms =
68-
existingMechanisms.length > 0
69-
? existingMechanisms
70-
: [`${partialCodeJSON.repositoryURL}/issues`];
67+
const feedbackMechanism = existingCodeJSON?.feedbackMechanism || `${partialCodeJSON.repositoryURL}/issues`;
7168

7269
// only use the calculated description if its not empty, otherwise keep existing
7370
const shouldUpdateDescription =
@@ -101,7 +98,7 @@ async function getMetaData(
10198
metaDataLastUpdated:
10299
partialCodeJSON.date?.metaDataLastUpdated ?? new Date().toISOString(),
103100
},
104-
feedbackMechanisms,
101+
feedbackMechanism,
105102
};
106103
}
107104

src/model.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ export interface CodeJSON {
1717
softwareType: string;
1818
languages: string[]; // calculated
1919
maintenance: string;
20-
contractNumber: string;
20+
contractNumber: string[];
2121
date: Date; // calculated
2222
tags: string[]; // calculated
2323
contact: Contact;
24-
feedbackMechanisms: string[]; // semi-calculated
24+
feedbackMechanism: string; // calculated
25+
AIUseCaseID: string;
2526
localisation: boolean;
2627
repositoryType: string;
2728
userInput: boolean;
@@ -42,7 +43,7 @@ export interface ReuseFrequency {
4243

4344
export interface Permissions {
4445
license: License[];
45-
usageType: string;
46+
usageType: string[];
4647
exemptionText: string;
4748
}
4849

0 commit comments

Comments
 (0)