@dmptool/utils 1.0.30 → 1.0.31
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/maDMP.d.ts +2 -1
- package/dist/maDMP.js +10 -5
- package/package.json +1 -1
package/dist/maDMP.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export declare const validateDMPToolExtensions: (logger: Logger, dmpId: string,
|
|
|
45
45
|
* @param domainName the domain name of the application/service website
|
|
46
46
|
* @param planId the ID of the plan to generate the DMP for
|
|
47
47
|
* @param env The environment from EnvironmentEnum (defaults to EnvironmentEnum.DEV)
|
|
48
|
+
* @param includeExtensions whether to include the DMP Tool extensions. Defaults to true.
|
|
48
49
|
* @returns a JSON representation of the DMP
|
|
49
50
|
*/
|
|
50
|
-
export declare function planToDMPCommonStandard(rdsConnectionParams: ConnectionParams, applicationName: string, domainName: string, env: EnvironmentEnum | undefined, planId: number): Promise<DMPToolDMPType | undefined>;
|
|
51
|
+
export declare function planToDMPCommonStandard(rdsConnectionParams: ConnectionParams, applicationName: string, domainName: string, env: EnvironmentEnum | undefined, planId: number, includeExtensions: true): Promise<DMPToolDMPType | undefined>;
|
package/dist/maDMP.js
CHANGED
|
@@ -935,9 +935,10 @@ const cleanRDACommonStandard = (plan, dmp) => {
|
|
|
935
935
|
* @param domainName the domain name of the application/service website
|
|
936
936
|
* @param planId the ID of the plan to generate the DMP for
|
|
937
937
|
* @param env The environment from EnvironmentEnum (defaults to EnvironmentEnum.DEV)
|
|
938
|
+
* @param includeExtensions whether to include the DMP Tool extensions. Defaults to true.
|
|
938
939
|
* @returns a JSON representation of the DMP
|
|
939
940
|
*/
|
|
940
|
-
async function planToDMPCommonStandard(rdsConnectionParams, applicationName, domainName, env = general_1.EnvironmentEnum.DEV, planId) {
|
|
941
|
+
async function planToDMPCommonStandard(rdsConnectionParams, applicationName, domainName, env = general_1.EnvironmentEnum.DEV, planId, includeExtensions) {
|
|
941
942
|
if (!rdsConnectionParams || !applicationName || !domainName || !planId) {
|
|
942
943
|
throw new Error('Invalid arguments provided to planToDMPCommonStandard');
|
|
943
944
|
}
|
|
@@ -1030,10 +1031,14 @@ async function planToDMPCommonStandard(rdsConnectionParams, applicationName, dom
|
|
|
1030
1031
|
}
|
|
1031
1032
|
const cleaned = cleanRDACommonStandard(plan, dmp);
|
|
1032
1033
|
// Generate the DMP Tool extensions to the RDA Common Standard
|
|
1033
|
-
const extensions =
|
|
1034
|
+
const extensions = includeExtensions
|
|
1035
|
+
? await buildDMPToolExtensions(rdsConnectionParams, applicationName, domainName, plan, project, funding)
|
|
1036
|
+
: undefined;
|
|
1034
1037
|
rdsConnectionParams.logger.debug({ applicationName, domainName, planId, env, dmpId: plan.dmpId }, 'Generated maDMP metadata record');
|
|
1035
1038
|
// Return the combined DMP metadata record
|
|
1036
|
-
return
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
+
return includeExtensions && extensions
|
|
1040
|
+
? {
|
|
1041
|
+
dmp: Object.assign(Object.assign({}, (0, exports.validateRDACommonStandard)(rdsConnectionParams.logger, cleaned).dmp), (0, exports.validateDMPToolExtensions)(rdsConnectionParams.logger, plan.dmpId, extensions))
|
|
1042
|
+
}
|
|
1043
|
+
: (0, exports.validateRDACommonStandard)(rdsConnectionParams.logger, cleaned);
|
|
1039
1044
|
}
|
package/package.json
CHANGED