@gen3/core 0.12.63 → 0.12.64
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/cjs/index.js +79 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/features/cedar/cedarApi.d.ts +198 -0
- package/dist/dts/features/cedar/cedarApi.d.ts.map +1 -0
- package/dist/dts/features/cedar/createCedarInstance.d.ts +4 -0
- package/dist/dts/features/cedar/createCedarInstance.d.ts.map +1 -0
- package/dist/dts/features/cedar/index.d.ts +3 -0
- package/dist/dts/features/cedar/index.d.ts.map +1 -0
- package/dist/dts/features/cedar/types.d.ts +25 -0
- package/dist/dts/features/cedar/types.d.ts.map +1 -0
- package/dist/dts/features/updateStudyInMDS/index.d.ts +4 -0
- package/dist/dts/features/updateStudyInMDS/index.d.ts.map +1 -0
- package/dist/dts/features/updateStudyInMDS/mdsApi.d.ts +173 -0
- package/dist/dts/features/updateStudyInMDS/mdsApi.d.ts.map +1 -0
- package/dist/dts/features/updateStudyInMDS/updateStudyInMDS.d.ts +3 -0
- package/dist/dts/features/updateStudyInMDS/updateStudyInMDS.d.ts.map +1 -0
- package/dist/dts/index.d.ts +2 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/index.js +76 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +396 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -4172,6 +4172,80 @@ const selectAuthzMappingData = toolkit.createSelector(selectAuthzMapping, (authz
|
|
|
4172
4172
|
mappings: []
|
|
4173
4173
|
});
|
|
4174
4174
|
|
|
4175
|
+
const createCEDARInstance = async (cedarWrapperURL, cedarUserUUID, metadataToRegister, createCedarQuery)=>{
|
|
4176
|
+
const STUDY_DATA_FIELD = 'gen3_discovery';
|
|
4177
|
+
// Deep clone to prevent mutating original metadata
|
|
4178
|
+
let updatedMetadataToRegister = JSON.parse(JSON.stringify(metadataToRegister));
|
|
4179
|
+
const payload = {
|
|
4180
|
+
cedar_user_uuid: cedarUserUUID,
|
|
4181
|
+
metadata: {
|
|
4182
|
+
study_metadata: {
|
|
4183
|
+
metadata_location: {
|
|
4184
|
+
nih_application_id: metadataToRegister[STUDY_DATA_FIELD]?.study_metadata?.metadata_location?.nih_application_id
|
|
4185
|
+
},
|
|
4186
|
+
minimal_info: {
|
|
4187
|
+
study_name: metadataToRegister[STUDY_DATA_FIELD]?.study_metadata?.minimal_info?.study_name,
|
|
4188
|
+
study_description: metadataToRegister[STUDY_DATA_FIELD]?.study_metadata?.minimal_info?.study_description
|
|
4189
|
+
}
|
|
4190
|
+
},
|
|
4191
|
+
clinicaltrials_gov: metadataToRegister.clinicaltrials_gov
|
|
4192
|
+
}
|
|
4193
|
+
};
|
|
4194
|
+
try {
|
|
4195
|
+
// Call the mutation trigger passed in from the component
|
|
4196
|
+
const data = await createCedarQuery({
|
|
4197
|
+
cedarWrapperURL,
|
|
4198
|
+
payload
|
|
4199
|
+
}).unwrap();
|
|
4200
|
+
updatedMetadataToRegister[STUDY_DATA_FIELD].study_metadata.metadata_location.cedar_study_level_metadata_template_instance_ID = data.cedar_instance_id || '';
|
|
4201
|
+
return updatedMetadataToRegister;
|
|
4202
|
+
} catch (err) {
|
|
4203
|
+
const errorMsg = JSON.stringify(err);
|
|
4204
|
+
return {
|
|
4205
|
+
error: `Request to create CEDAR instance failed: ${errorMsg}`
|
|
4206
|
+
};
|
|
4207
|
+
}
|
|
4208
|
+
};
|
|
4209
|
+
|
|
4210
|
+
const cedarApi = gen3Api.injectEndpoints({
|
|
4211
|
+
endpoints: (builder)=>({
|
|
4212
|
+
createCedarInstance: builder.mutation({
|
|
4213
|
+
query: ({ cedarWrapperURL, payload })=>({
|
|
4214
|
+
url: `${cedarWrapperURL}/create`,
|
|
4215
|
+
method: 'POST',
|
|
4216
|
+
body: payload
|
|
4217
|
+
})
|
|
4218
|
+
})
|
|
4219
|
+
})
|
|
4220
|
+
});
|
|
4221
|
+
const { useCreateCedarInstanceMutation } = cedarApi;
|
|
4222
|
+
|
|
4223
|
+
const updateStudyInMDS = async (mdsURL, metadataID, metadataToUpdate = {}, updateMdsQuery)=>{
|
|
4224
|
+
try {
|
|
4225
|
+
const response = await updateMdsQuery({
|
|
4226
|
+
mdsURL,
|
|
4227
|
+
metadataID,
|
|
4228
|
+
metadataToUpdate
|
|
4229
|
+
}).unwrap();
|
|
4230
|
+
return response;
|
|
4231
|
+
} catch (error) {
|
|
4232
|
+
throw new Error(`Request for update study data failed: ${error instanceof Error && error.message || lodash.toString(error)}`);
|
|
4233
|
+
}
|
|
4234
|
+
};
|
|
4235
|
+
|
|
4236
|
+
const mdsApi = gen3Api.injectEndpoints({
|
|
4237
|
+
endpoints: (builder)=>({
|
|
4238
|
+
updateStudyInMDS: builder.mutation({
|
|
4239
|
+
query: ({ mdsURL, metadataID, metadataToUpdate })=>({
|
|
4240
|
+
url: `${mdsURL}/metadata/${metadataID}?overwrite=true`,
|
|
4241
|
+
method: 'POST',
|
|
4242
|
+
body: metadataToUpdate
|
|
4243
|
+
})
|
|
4244
|
+
})
|
|
4245
|
+
})
|
|
4246
|
+
});
|
|
4247
|
+
const { useUpdateStudyInMDSMutation } = mdsApi;
|
|
4248
|
+
|
|
4175
4249
|
class CohortStorage {
|
|
4176
4250
|
constructor(config){
|
|
4177
4251
|
this.databaseName = config.databaseName;
|
|
@@ -7055,6 +7129,7 @@ exports.calculatePercentageAsString = calculatePercentageAsString;
|
|
|
7055
7129
|
exports.capitalize = capitalize$1;
|
|
7056
7130
|
exports.cartReducer = cartReducer;
|
|
7057
7131
|
exports.cartReducerPath = cartReducerPath;
|
|
7132
|
+
exports.cedarApi = cedarApi;
|
|
7058
7133
|
exports.clearActiveWorkspaceId = clearActiveWorkspaceId;
|
|
7059
7134
|
exports.clearCohortFilters = clearCohortFilters;
|
|
7060
7135
|
exports.clearJEGActiveKernels = clearJEGActiveKernels;
|
|
@@ -7073,6 +7148,7 @@ exports.convertToQueryString = convertToQueryString;
|
|
|
7073
7148
|
exports.coreStore = coreStore;
|
|
7074
7149
|
exports.createAppApiForRTKQ = createAppApiForRTKQ;
|
|
7075
7150
|
exports.createAppStore = createAppStore;
|
|
7151
|
+
exports.createCEDARInstance = createCEDARInstance;
|
|
7076
7152
|
exports.createGen3App = createGen3App;
|
|
7077
7153
|
exports.createGen3AppWithOwnStore = createGen3AppWithOwnStore;
|
|
7078
7154
|
exports.createNewCohort = createNewCohort;
|
|
@@ -7181,6 +7257,7 @@ exports.listifyMethodsFromMapping = listifyMethodsFromMapping;
|
|
|
7181
7257
|
exports.logoutFence = logoutFence;
|
|
7182
7258
|
exports.manifestApi = manifestApi;
|
|
7183
7259
|
exports.manifestTags = manifestTags;
|
|
7260
|
+
exports.mdsApi = mdsApi;
|
|
7184
7261
|
exports.nestedHistogramQueryStrForEachField = nestedHistogramQueryStrForEachField;
|
|
7185
7262
|
exports.normalizeRtkError = normalizeRtkError;
|
|
7186
7263
|
exports.notificationService = notificationService;
|
|
@@ -7286,6 +7363,7 @@ exports.trimFirstfieldNameToLabel = trimFirstfieldNameToLabel;
|
|
|
7286
7363
|
exports.updateCohortFilter = updateCohortFilter;
|
|
7287
7364
|
exports.updateCohortName = updateCohortName;
|
|
7288
7365
|
exports.updateJEGActionKernelStatus = updateJEGActionKernelStatus;
|
|
7366
|
+
exports.updateStudyInMDS = updateStudyInMDS;
|
|
7289
7367
|
exports.upsertManyJEGActiveKernels = upsertManyJEGActiveKernels;
|
|
7290
7368
|
exports.useAddCohortManifestMutation = useAddCohortManifestMutation;
|
|
7291
7369
|
exports.useAddFileManifestMutation = useAddFileManifestMutation;
|
|
@@ -7400,6 +7478,7 @@ exports.useRequestorStatusQuery = useRequestorStatusQuery;
|
|
|
7400
7478
|
exports.useSetCurrentPayModelMutation = useSetCurrentPayModelMutation;
|
|
7401
7479
|
exports.useSubmitSowerJobMutation = useSubmitSowerJobMutation;
|
|
7402
7480
|
exports.useTerminateWorkspaceMutation = useTerminateWorkspaceMutation;
|
|
7481
|
+
exports.useUpdateStudyInMDSMutation = useUpdateStudyInMDSMutation;
|
|
7403
7482
|
exports.useUserAuth = useUserAuth;
|
|
7404
7483
|
exports.useUserRequestQuery = useUserRequestQuery;
|
|
7405
7484
|
exports.useVennDiagramQuery = useVennDiagramQuery;
|