[js] add constants for field names