Each academic discipline creates and uses primary and secondary sources differently; the definition of a primary source only makes sense in the context of a specific discipline or field of inquiry.
In the humanities and the arts, a primary document might be an original creative work.
It might be a part of the historical record written about, or in proximity to, an event.
In the sciences, it might be a publication of original research.
Here are two definitions that try to capture the elusive nature of primary documents:
A definition from Cornell: Primary sources are the main text or work that you are discussing (e.g. a sonnet by William Shakespeare; an opera by Mozart);
actual data or research results (e.g. a scientific article presenting original findings; statistics);
or historical documents (e.g. letters, pamphlets, political tracts, manifestoes).
["What is a Source?" Recognizing and Avoiding Plagarism. Cornell University. College of Arts and Sciences.]
A definition from Yale: "A primary source is firsthand testimony or direct evidence concerning a topic under investigation. The nature and value of a source cannot be determined without reference to the topic and questions it is meant to answer. The same document, or other piece of evidence, may be a primary source in one investigation and secondary in another. The search for primary sources does not, therefore, automatically include or exclude any category of records or documents."
[Yale University Library Primary Sources Research Colloquium in History]