@cumulus/cmrjs
Version:
A node SDK for CMR
37 lines • 1.5 kB
TypeScript
declare type UMMGGranule = {
GranuleUR: string;
DataGranule?: {
Identifiers?: {
Identifier: string;
IdentifierType: string;
IdentifierName?: string;
}[];
[key: string]: any;
};
[key: string]: unknown;
};
/**
* Updates a UMM-G metadata object with a new GranuleUR and ProducerGranuleId.
*
* This function:
* - Validates that the input is a valid UMM-G granule metadata object.
* - Performs a deep clone to preserve the original input.
* - Sets the GranuleUR to the specified value.
* - Ensures that the DataGranule.Identifiers array exists.
* - Adds or updates an entry of type "ProducerGranuleId" with the provided identifier.
*
* @param metadataObject - The parsed UMM-G metadata object to be modified.
* @param granuleUr - The new GranuleUR value to assign.
* @param producerGranuleId - The ProducerGranuleId to store in the Identifiers list.
* @param excludeDataGranule - Whether to add or update the DataGranule node in the metadata
* @returns A deep-cloned and updated copy of the UMM-G metadata object.
* @throws If the input does not match the expected UMM-G granule structure.
*/
export declare function updateUMMGGranuleURAndGranuleIdentifier({ metadataObject, granuleUr, producerGranuleId, excludeDataGranule, }: {
metadataObject: unknown;
granuleUr: string;
producerGranuleId: string;
excludeDataGranule?: boolean;
}): UMMGGranule;
export {};
//# sourceMappingURL=ummgModifiers.d.ts.map