sample event converter (v2)

Revision 2 of this benchmark created on


Description

AS sample event converter

Setup

const input = {
  "events": [
    {
      "event": "ANALYSIS_RESULT_UPLOAD_COMPLETE_SUCCESS",
      "artifactId": 879,
      "projectVersionId": 123,
      "filename": "scan__3_.fpr",
      "username": "abc"
    }
  ],
  "triggeredAt": "2024-11-18T13:30:24.839+00:00",
  "sscUrl": "https://foo.bar.com/ssc/",
  "webHookId": 6360029
};

const output = input.events.map(event => ({
  event_type: "fortify_scan_completed",
  client_payload: {
    artifactId: event.artifactId,
    projectVersionId: event.projectVersionId,
    filename: event.filename,
    username: event.username,
    sscUrl: input.sscUrl
  }
}));

console.log(JSON.stringify(output, null, 2));

Test runner

Ready to run.

Testing in
TestOps/sec
just run it
console.log(JSON.stringify(output, null, 2));
ready
run again
console.log(JSON.stringify(output, null, 2));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.