const QUEUE_JOB_ORIGIN_KEY = "_jobOrigin";
function markQueueJobOrigin(payload, origin) {
  return { ...payload, [QUEUE_JOB_ORIGIN_KEY]: origin };
}
function readQueueJobOrigin(payload) {
  if (!payload || typeof payload !== "object") return null;
  const value = payload[QUEUE_JOB_ORIGIN_KEY];
  if (value === "inbound-webhook" || value === "scheduler") return value;
  return null;
}
function isTrustedWebhookDispatch(payload) {
  return readQueueJobOrigin(payload) === "inbound-webhook";
}
export {
  QUEUE_JOB_ORIGIN_KEY,
  isTrustedWebhookDispatch,
  markQueueJobOrigin,
  readQueueJobOrigin
};
//# sourceMappingURL=dispatchOrigin.js.map
