/** * Construct online access url for a given file. * * @param {Object} params - input parameters * @param {Object} params.file - file object * @param {string} params.distEndpoint - distribution endpoint from config * @param {Object} params.bucketTypes - map of bucket name to bucket type * @param {distributionBucketMap} params.distributionBucketMap - Object with bucket:tea-path mapping * for all distribution bucketss * @returns {(Object | undefined)} online access url object, undefined if no URL exists */ export function constructOnlineAccessUrl({ file, distEndpoint, bucketTypes, cmrGranuleUrlType, distributionBucketMap }: { file: Object; distEndpoint: string; bucketTypes: Object; distributionBucketMap: any; }): (Object | undefined); /** * Construct a list of online access urls. * * @param {Object} params - input parameters * @param {Array} params.files - array of file objects * @param {string} params.distEndpoint - distribution endpoint from config * @param {Object} params.bucketTypes - map of bucket name to bucket type * @param {distributionBucketMap} params.distributionBucketMap - Object with bucket:tea-path mapping * for all distribution bucketss * @returns {Array<{URL: string, URLDescription: string}>} * returns the list of online access url objects */ export function constructOnlineAccessUrls({ files, distEndpoint, bucketTypes, cmrGranuleUrlType, distributionBucketMap }: { files: Array; distEndpoint: string; bucketTypes: Object; distributionBucketMap: any; }): Array<{ URL: string; URLDescription: string; }>; export function generateEcho10XMLString(granule: any): string; export function generateFileUrl({ file, distEndpoint, cmrGranuleUrlType, distributionBucketMap }: { file: any; distEndpoint: any; cmrGranuleUrlType?: string | undefined; distributionBucketMap: any; }): Promise; /** helper to build an CMR settings object, used to initialize CMR * @param {Object} cmrConfig - CMR configuration object * @param {string} cmrConfig.oauthProvider - Oauth provider: launchpad or earthdata * @param {string} cmrConfig.provider - the CMR provider * @param {string} cmrConfig.clientId - Client id for CMR requests * @param {string} cmrConfig.passphraseSecretName - Launchpad passphrase secret name * @param {string} cmrConfig.api - Launchpad api * @param {string} cmrConfig.certificate - Launchpad certificate * @param {string} cmrConfig.username - EDL username * @param {string} cmrConfig.passwordSecretName - CMR password secret name * @returns {Object} object to create CMR instance - contains the provider, clientId, and either * launchpad token or EDL username and password */ export function getCmrSettings(cmrConfig?: { oauthProvider: string; provider: string; clientId: string; passphraseSecretName: string; api: string; certificate: string; username: string; passwordSecretName: string; }): Object; export function getFileDescription(file: any): string; export function getFilename(file: any): any; /** * Extract temporal information from granule object * * @param {Object} granule - granule object * @returns {Object} - temporal information (beginningDateTime, endingDateTime, productionDateTime, * lastUpdateDateTime) of the granule if available */ export function getGranuleTemporalInfo(granule: Object): Object; /** * Reduce granule object array to CMR files array * * @param {Array} granules - granule objects array * * @returns {Array} - CMR file object array: { filename, granuleId } */ export function granulesToCmrFileObjects(granules: Array): Array; /** * Returns True if this object can be determined to be a cmrMetadata object. * * @param {Object} fileobject * @returns {boolean} true if object references cmr metadata. */ export function isCMRFile(fileobject: Object): boolean; export function isCMRFilename(filename: any): any; export function isECHO10File(filename: any): any; export function isUMMGFile(filename: any): any; /** * Return cmr metadata object from a CMR Echo10XML file or CMR UMMG File. * @param {string} cmrFilename - s3 path to cmr file * @returns {Promise} - metadata object from the file. */ export function metadataObjectFromCMRFile(cmrFilename: string): Promise; /** * Determines what type of metadata object and posts either ECHO10XML or UMMG * JSON data to CMR. * * @param {Object} cmrPublishObject - * @param {string} cmrPublishObject.filename - the cmr filename * @param {Object} cmrPublishObject.metadataObject - the UMMG JSON cmr metadata * @param {Object} cmrPublishObject.granuleId - the metadata's granuleId * @param {Object} creds - credentials needed to post to CMR service * @param {string} creds.provider - the name of the Provider used on the CMR side * @param {string} creds.clientId - the clientId used to generate CMR token * @param {string} creds.username - the CMR username, not used if creds.token is provided * @param {string} creds.password - the CMR password, not used if creds.token is provided * @param {string} creds.token - the CMR or Launchpad token, * if not provided, CMR username and password are used to get a cmr token */ export function publish2CMR(cmrPublishObject: { filename: string; metadataObject: Object; granuleId: Object; }, creds: { provider: string; clientId: string; username: string; password: string; token: string; }): Promise; /** * Update CMR Metadata record with the information contained in updatedFiles * @param {Object} params - parameter object * @param {string} params.granuleId - granuleId * @param {Object} params.updatedFiles - list of file objects that might have different * information from the cmr metadatafile and the CMR service. * @param {string} params.distEndpoint - distribution endpoint URL * @param {boolean} params.published - boolean true if the data should be published to * the CMR service. * @param {distributionBucketMap} params.distributionBucketMap - Object with bucket:tea-path mapping * for all distribution buckets * @param {Object} params.bucketTypes - map of bucket names to bucket types */ export function reconcileCMRMetadata({ granuleId, updatedFiles, distEndpoint, published, distributionBucketMap, bucketTypes }: { granuleId: string; updatedFiles: Object; distEndpoint: string; published: boolean; distributionBucketMap: any; bucketTypes: Object; }): Promise; /** * Modifies cmr metadata file with file's URLs updated to their new locations. * * @param {Object} params - parameter object * @param {string} params.granuleId - granuleId * @param {Object} params.cmrFile - cmr xml file to be updated * @param {Array} params.files - array of file objects * @param {string} params.distEndpoint - distribution enpoint from config * @param {boolean} params.published - indicate if publish is needed * @param {Object} params.bucketTypes - map of bucket names to bucket types * @param {string} params.cmrGranuleUrlType - type of granule CMR url * @param {distributionBucketMap} params.distributionBucketMap - Object with bucket:tea-path mapping * for all distribution buckets * @returns {Promise} returns promise to publish metadata to CMR Service * or resolved promise if published === false. */ export function updateCMRMetadata({ granuleId, cmrFile, files, distEndpoint, published, bucketTypes, cmrGranuleUrlType, distributionBucketMap }: { granuleId: string; cmrFile: Object; files: Array; distEndpoint: string; published: boolean; bucketTypes: Object; cmrGranuleUrlType: string; distributionBucketMap: any; }): Promise; //# sourceMappingURL=cmr-utils.d.ts.map