@@ -33,16 +33,22 @@ async function pnaEndpoint() {
33
33
const formattedNow = now . getFullYear ( ) + "-" + ( now . getMonth ( ) + 1 ) + "-" + now . getDate ( ) ;
34
34
35
35
pnaData [ "directory" ] = {
36
- id : query [ "id" ] ,
36
+ id : process . env . PNA_DIRECTORY ? process . env . PNA_DIRECTORY : "" ,
37
37
type : "Directory" ,
38
- name : "Framework id " + query [ "id" ] ,
38
+ name : process . env . PNA_DIRECTORY_NAME ? process . env . PNA_DIRECTORY_NAME : "" ,
39
39
dateCreated : formattedNow
40
40
} ;
41
41
pnaData [ "container" ] = {
42
42
id : ceasnEndpointFramework + query [ "id" ] ,
43
- type : "Framework" ,
43
+ type : "Collection" ,
44
+ fromDirectory : process . env . PNA_DIRECTORY ? process . env . PNA_DIRECTORY : "" ,
44
45
name : framework [ "name" ] ,
45
- description : framework [ "description" ]
46
+ description : framework [ "description" ] ,
47
+ attributionURL : framework [ "author" ] ? framework [ "author" ] : ( framework [ "ceterms:ownedBy" ] ? framework [ "ceterms:ownedBy" ] : "" ) ,
48
+ beneficiaryRights : framework [ "rights" ] ? framework [ "rights" ] : ( framework [ "license" ] ? framework [ "license" ] : "" ) ,
49
+ dataURL : ceasnEndpointFramework + query [ "id" ] ,
50
+ providerMetaModel : process . env . PNA_PROVIDER_META_MODEL ?process . env . PNA_PROVIDER_META_MODEL : "" ,
51
+ registryRights : process . env . PNA_REGISTRY_RIGHTS ? process . env . PNA_REGISTRY_RIGHTS : "" ,
46
52
} ;
47
53
48
54
if ( framework . competency == null ) framework . competency = [ ] ;
@@ -66,8 +72,8 @@ async function pnaEndpoint() {
66
72
type : "Competency" ,
67
73
containedIn : ceasnEndpointFramework + query [ "id" ] ,
68
74
competencyText : expanded [ "statement" ] ? expanded [ "statement" ] : ( expanded [ "name" ] ? expanded [ "name" ] : ( expanded [ "description" ] ? expanded [ "description" ] : "" ) ) ,
69
- dataUrl : ceasnEndpoint + ctid ,
70
- label : expanded [ "name" ] ? expanded [ "name" ] : ""
75
+ dataURL : ceasnEndpoint + ctid ,
76
+ competencyLabel : expanded [ "name" ] ? expanded [ "name" ] : ""
71
77
} ) ;
72
78
}
73
79
} ) . catch ( ( err ) => {
@@ -93,10 +99,10 @@ async function uploadToAws(data, name) {
93
99
94
100
const { S3Client, PutObjectCommand } = require ( "@aws-sdk/client-s3" ) ;
95
101
96
- const AWS_REGION = process . env . AWS_REGION ? process . env . AWS_REGION : "" ;
97
- const AWS_BUCKET = process . env . AWS_BUCKET ? process . env . AWS_BUCKET : "" ;
98
- const AWS_ACCESS_KEY_ID = process . env . AWS_ACCESS_KEY_ID ? process . env . AWS_ACCESS_KEY_ID : "" ;
99
- const AWS_SECRET_ACCESS_KEY = process . env . AWS_SECRET_ACCESS_KEY ? process . env . AWS_SECRET_ACCESS_KEY : "" ;
102
+ const AWS_REGION = process . env . PNA_AWS_REGION ? process . env . PNA_AWS_REGION : "" ;
103
+ const AWS_BUCKET = process . env . PNA_AWS_BUCKET ? process . env . PNA_AWS_BUCKET : "" ;
104
+ const AWS_ACCESS_KEY_ID = process . env . PNA_AWS_ACCESS_KEY_ID ? process . env . PNA_AWS_ACCESS_KEY_ID : "" ;
105
+ const AWS_SECRET_ACCESS_KEY = process . env . PNA_AWS_SECRET_ACCESS_KEY ? process . env . PNA_AWS_SECRET_ACCESS_KEY : "" ;
100
106
let success = false ;
101
107
102
108
try {
0 commit comments