Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c5c696e
GQL-118a: Add support for retrieving a collection revision
htranho Mar 18, 2026
7e40ca2
GQL-118: Update json key list, fix issue with non empty jsonKeys when…
htranho Mar 19, 2026
3d5d005
GQL-118: Remove debug logs
htranho Mar 19, 2026
61207d0
GQL-118: Fix issue with 'provider'
htranho Mar 20, 2026
4e4e4db
GQL-118: Add test for revisionId
htranho Mar 20, 2026
ab88041
GQL-118: Remove String conversion, remove error for not matching revi…
htranho Mar 20, 2026
55060f8
GQL-118: Refactoring
htranho Mar 21, 2026
cf41f3a
GQL-118: Remove throwing errors for list of json fields
htranho Mar 23, 2026
c89c92b
GQL-118: Remove error messages for list of fields
htranho Mar 23, 2026
2d0b588
GQL-118: Rorder revvisionId in list of CollectionInput
htranho Mar 23, 2026
538ae29
GQL-118: Add comment
htranho Mar 23, 2026
094e0c4
GQL-118: Add test for case of retrieving collection by revisionId
htranho Mar 23, 2026
ca8193a
GQL-118: Add tests
htranho Mar 23, 2026
29c4287
GQL-118: Get revisionId from requestInfo, empty out jsonKeys
htranho Mar 27, 2026
232c018
Merge branch 'main' into GQL-118-UMM
htranho Mar 27, 2026
db154ce
GQL-118: Update test for revisionId
htranho Mar 29, 2026
924f3a9
GQL-118: Add test for json only field
htranho Mar 29, 2026
084ed25
GQL-118: Add allRvisions to parameter list before calling cmrQuery
htranho Mar 30, 2026
ae8a41d
GQL-118: Add Notes to json only fields
htranho Mar 31, 2026
9dcb673
GQL-118: Add comment
htranho Apr 7, 2026
f49ea27
GQL-118: Remove 'providerId' as requested
htranho Apr 7, 2026
611ad91
GQL-118: Fix vulnerabilities
htranho Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 85 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"graphql-type-json": "^0.3.2",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"lodash": "^4.17.21",
"lodash": "^4.18.1",
"qs": "^6.12.0",
"snakecase-keys": "^6.0.0",
"stellate": "^2.11.1",
Expand Down
26 changes: 24 additions & 2 deletions src/cmr/concepts/concept.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,19 @@ export default class Concept {
fetchUmm(searchParams, requestedKeys, providedHeaders) {
this.logKeyRequest(requestedKeys, 'umm')

const { revisionId } = this.requestInfo

const params = pick(snakeCaseKeys(searchParams), this.getPermittedUmmSearchParams())

// Add all_revisions to params if revisionId is present and all_revisions is not set
if (revisionId && !params.all_revisions) {
params.all_revisions = true
}

// Construct the promise that will request data from the umm endpoint
return cmrQuery({
conceptType: this.getConceptType(),
params: pick(snakeCaseKeys(searchParams), this.getPermittedUmmSearchParams()),
params,
nonIndexedKeys: this.getNonIndexedKeys(),
headers: providedHeaders,
options: {
Expand Down Expand Up @@ -943,6 +952,7 @@ export default class Concept {
* @param {Array} ummKeys Array of the keys requested in the query
*/
async parseUmm(ummResponse, ummKeys) {
const { revisionId } = this.requestInfo
// Pull out the key mappings so we can retrieve the values below
const { ummKeyMappings } = this.requestInfo

Expand All @@ -961,14 +971,26 @@ export default class Concept {
items.forEach((item, itemIndex) => {
const normalizedItem = this.normalizeUmmItem(item)

// Filter out items that don't match the requested revisionId
// This is necessary because the umm endpoint returns multiple revisions
if (revisionId && normalizedItem.meta['revision-id'].toString() !== revisionId.toString()) {
return
}

// Creates unique item keys regardless of whether or not
// a user calls for data with similar conceptIds (as is the case with revisions)
const itemKey = this.generateUmmItemKey(itemIndex, normalizedItem)

this.setEssentialUmmValues(itemKey, normalizedItem)

this.setUmmItems(item, itemKey, ummKeys, ummKeyMappings,)
this.setUmmItems(item, itemKey, ummKeys, ummKeyMappings)
})

// Update the item count if we filtered out items
if (revisionId) {
const filteredItemCount = Object.keys(this.items).length
this.setUmmItemCount(filteredItemCount)
}
}

/**
Expand Down
Loading
Loading