  Symmetries corresponding to local transformations of the fundamental fields
that leave the action invariant give rise to (invertible) topological defects,
which obey group-like fusion rules. One can construct more general
(codimension-one) topological defects by specifying a map between
gauge-invariant operators from one side of the defect and such operators on the
other side. In this work, we apply such construction to Maxwell theory in four
dimensions and to the free compact scalar theory in two dimensions. In the case
of Maxwell theory, we show that a topological defect that mixes the field
strength $F$ and its Hodge dual $\star F$ can be at most an $SO(2)$ rotation.
For rational values of the bulk coupling and the $\theta$-angle we find an
explicit defect Lagrangian that realizes values of the $SO(2)$ angle $\varphi$
such that $\cos \varphi$ is also rational. We further determine the action of
such defects on Wilson and 't Hooft lines and show that they are in general
non-invertible. We repeat the analysis for the free compact scalar $\phi$ in
two dimensions. In this case we find only four discrete maps: the trivial one,
a $Z_2$ map $d\phi \rightarrow -d\phi$, a $\mathcal{T}$-duality-like map $d\phi
\rightarrow i \star d\phi$, and the product of the last two.
