Im trying to extract data based on object values in javascript

{
      "id": 6,
      "createdAt": "2024-07-24T11:33:05.749Z",
      "updatedAt": "2024-07-24T11:33:05.749Z",
      "deletedAt": null,
      "name": "vendor_cashier",
      "permissions": [
        {
          "id": 18,
          "createdAt": "2024-07-24T11:33:05.683Z",
          "updatedAt": "2024-07-24T11:33:05.683Z",
          "deletedAt": null,
          "code": "can_read_pos_device"
        },
        {
          "id": 19,
          "createdAt": "2024-07-24T11:33:05.683Z",
          "updatedAt": "2024-07-24T11:33:05.683Z",
          "deletedAt": null,
          "code": "can_update_pos_device"
        }
      ]
    }

And I need the following sample:

{
   "name":"vendor_cashier",
   "page":"pos-device",
   "permissions":"(list)|(edit)|(show)"
}

I have been trying for hourst but can’t think of a solution, can someone help, and Thanks in advance