How to use the @cumulus/cmrjs.getUrl function in @cumulus/cmrjs

To help you get started, we’ve selected a few @cumulus/cmrjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nasa / cumulus / example / spec / ingestGranule / IngestUMMGSuccessSpec.js View on Github external
it('has expected payload', () => {
      expect(granule.published).toBe(true);
      expect(granule.cmrLink).toEqual(`${getUrl('search')}granules.json?concept_id=${granule.cmrConceptId}`);

      // Set the expected CMR values since they're going to be different
      // every time this is run.
      const updatedExpectedPayload = cloneDeep(expectedPayload);
      updatedExpectedPayload.granules[0].cmrLink = granule.cmrLink;
      updatedExpectedPayload.granules[0].cmrConceptId = granule.cmrConceptId;

      expect(postToCmrOutput.payload).toEqual(updatedExpectedPayload);
    });
github nasa / cumulus / example / spec / ingestGranule / IngestUMMGSuccessSpec.js View on Github external
it('has expected payload', () => {
      expect(granule.published).toBe(true);
      expect(granule.cmrLink).toEqual(`${getUrl('search')}granules.json?concept_id=${granule.cmrConceptId}`);

      // Set the expected CMR values since they're going to be different
      // every time this is run.
      const updatedExpectedPayload = cloneDeep(expectedPayload);
      updatedExpectedPayload.granules[0].cmrLink = granule.cmrLink;
      updatedExpectedPayload.granules[0].cmrConceptId = granule.cmrConceptId;

      expect(postToCmrOutput.payload).toEqual(updatedExpectedPayload);
    });
github nasa / cumulus / example / spec / parallel / ingestGranule / IngestGranuleSuccessSpec.js View on Github external
it('has expected payload', () => {
      expect(granule.cmrLink).toEqual(`${getUrl('search', null, 'UAT')}granules.json?concept_id=${granule.cmrConceptId}`);
      const updatedGranule = expectedPayload.granules[0];
      const thisExpectedPayload = {
        ...expectedPayload,
        granules: [
          {
            ...updatedGranule,
            cmrConceptId: postToCmrOutput.payload.granules[0].cmrConceptId,
            cmrLink: postToCmrOutput.payload.granules[0].cmrLink,
            post_to_cmr_duration: postToCmrOutput.payload.granules[0].post_to_cmr_duration,
            sync_granule_duration: postToCmrOutput.payload.granules[0].sync_granule_duration
          }
        ]
      };
      expect(postToCmrOutput.payload).toEqual(thisExpectedPayload);
    });
github nasa / cumulus / packages / ingest / cmr.js View on Github external
creds.clientId,
    creds.username,
    password
  );

  const xml = cmrFile.metadata;
  const res = await cmr.ingestGranule(xml);
  const conceptId = res.result['concept-id'];

  log.info(`Published ${cmrFile.granuleId} to the CMR. conceptId: ${conceptId}`);

  return {
    granuleId: cmrFile.granuleId,
    filename: cmrFile.filename,
    conceptId,
    link: `${getUrl('search')}granules.json?concept_id=${res.result['concept-id']}`
  };
}