{
  "format": "aegisceptor-rules-part",
  "label": "Folder \"Demo Shop\"",
  "mapLocal": [
    {
      "id": "demo_login",
      "enabled": true,
      "group": "Demo Shop",
      "urlPattern": "example.com/api/login",
      "method": "POST",
      "statusCode": 200,
      "contentType": "application/json; charset=utf-8",
      "body": "{\n  \"token\": \"demo-token-{{uuid}}\",\n  \"user\": {\n    \"email\": \"{{body 'email'}}\",\n    \"name\": \"Demo User\"\n  },\n  \"expiresAt\": \"{{now}}\"\n}",
      "headers": "",
      "delayMs": 0,
      "responses": [
        {
          "id": "demo_login_wrong",
          "name": "Wrong password",
          "enabled": true,
          "statusCode": 401,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"error\": \"invalid_credentials\",\n  \"message\": \"Email or password is wrong.\"\n}",
          "delayMs": 0,
          "match": "all",
          "conditions": [
            {
              "source": "body",
              "key": "password",
              "operator": "not-equals",
              "value": "demo1234"
            }
          ]
        }
      ]
    },
    {
      "id": "demo_me",
      "enabled": true,
      "group": "Demo Shop",
      "urlPattern": "example.com/api/me",
      "method": "GET",
      "statusCode": 200,
      "contentType": "application/json; charset=utf-8",
      "body": "{\n  \"id\": \"u_1001\",\n  \"name\": \"Demo User\",\n  \"email\": \"demo@example.com\",\n  \"plan\": \"pro\"\n}",
      "headers": "",
      "delayMs": 0,
      "responses": [
        {
          "id": "demo_me_loggedout",
          "name": "Logged out",
          "enabled": true,
          "statusCode": 401,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"error\": \"unauthorized\"\n}",
          "delayMs": 0,
          "match": "all",
          "conditions": [
            {
              "source": "header",
              "key": "Authorization",
              "operator": "not-exists",
              "value": ""
            }
          ]
        }
      ]
    },
    {
      "id": "demo_products",
      "enabled": true,
      "group": "Demo Shop",
      "urlPattern": "example.com/api/products",
      "method": "GET",
      "statusCode": 200,
      "contentType": "application/json; charset=utf-8",
      "body": "{\n  \"page\": 1,\n  \"items\": [\n    {\n      \"id\": \"101\",\n      \"name\": \"Demo Mug\",\n      \"price\": 12.5\n    },\n    {\n      \"id\": \"102\",\n      \"name\": \"Demo T-shirt\",\n      \"price\": 20\n    },\n    {\n      \"id\": \"103\",\n      \"name\": \"Demo Sticker Pack\",\n      \"price\": 4\n    }\n  ]\n}",
      "headers": "",
      "delayMs": 0,
      "responses": [
        {
          "id": "demo_products_empty",
          "name": "Empty page",
          "enabled": true,
          "statusCode": 200,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"page\": 2,\n  \"items\": []\n}",
          "delayMs": 0,
          "match": "all",
          "conditions": [
            {
              "source": "query",
              "key": "page",
              "operator": "equals",
              "value": "2"
            }
          ]
        },
        {
          "id": "demo_products_slow",
          "name": "Slow network",
          "enabled": true,
          "statusCode": 200,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"page\": 1,\n  \"items\": [\n    {\n      \"id\": \"101\",\n      \"name\": \"Demo Mug\",\n      \"price\": 12.5\n    }\n  ]\n}",
          "delayMs": 3000,
          "match": "all",
          "conditions": [
            {
              "source": "header",
              "key": "X-Demo-Scenario",
              "operator": "equals",
              "value": "slow"
            }
          ]
        }
      ]
    },
    {
      "id": "demo_product",
      "enabled": true,
      "group": "Demo Shop",
      "urlPattern": "example.com/api/products/:id",
      "method": "GET",
      "statusCode": 200,
      "contentType": "application/json; charset=utf-8",
      "body": "{\n  \"id\": \"{{urlParam 'id'}}\",\n  \"name\": \"Demo product {{urlParam 'id'}}\",\n  \"price\": {{randomInt 5 50}},\n  \"inStock\": {{faker 'boolean'}}\n}",
      "headers": "",
      "delayMs": 0,
      "responses": [
        {
          "id": "demo_product_404",
          "name": "Not found",
          "enabled": true,
          "statusCode": 404,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"error\": \"not_found\"\n}",
          "delayMs": 0,
          "match": "all",
          "conditions": [
            {
              "source": "route",
              "key": "id",
              "operator": "equals",
              "value": "999"
            }
          ]
        }
      ]
    },
    {
      "id": "demo_checkout",
      "enabled": true,
      "group": "Demo Shop",
      "urlPattern": "example.com/api/checkout",
      "method": "POST",
      "statusCode": 201,
      "contentType": "application/json; charset=utf-8",
      "body": "{\n  \"orderId\": \"{{uuid}}\",\n  \"status\": \"paid\",\n  \"createdAt\": \"{{now}}\"\n}",
      "headers": "",
      "delayMs": 800,
      "responses": [
        {
          "id": "demo_checkout_declined",
          "name": "Card declined",
          "enabled": true,
          "statusCode": 402,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"error\": \"card_declined\",\n  \"message\": \"The demo card was declined.\"\n}",
          "delayMs": 0,
          "match": "all",
          "conditions": [
            {
              "source": "body",
              "key": "card.number",
              "operator": "equals",
              "value": "4000000000000002"
            }
          ]
        },
        {
          "id": "demo_checkout_error",
          "name": "Server error",
          "enabled": true,
          "statusCode": 500,
          "contentType": "application/json; charset=utf-8",
          "body": "{\n  \"error\": \"internal_error\"\n}",
          "delayMs": 0,
          "match": "any",
          "conditions": [
            {
              "source": "header",
              "key": "X-Demo-Scenario",
              "operator": "equals",
              "value": "error"
            },
            {
              "source": "query",
              "key": "fail",
              "operator": "exists",
              "value": ""
            }
          ]
        }
      ]
    },
    {
      "id": "demo_banners",
      "enabled": true,
      "group": "Demo Shop",
      "urlPattern": "example.com/api/banners/*",
      "method": "GET",
      "statusCode": 200,
      "contentType": "application/json; charset=utf-8",
      "body": "{\n  \"banners\": [\n    {\n      \"id\": \"b1\",\n      \"title\": \"Demo sale\",\n      \"image\": \"https://example.com/banner.png\"\n    }\n  ]\n}",
      "headers": "X-Demo: true\nCache-Control: no-store",
      "delayMs": 0,
      "responses": []
    }
  ]
}