import {
	createTRPCRouter,
	protectedApiProcedure,
	publicProcedure,
} from "~/server/api/trpc";

export const testRouter = createTRPCRouter({
	testApi: protectedApiProcedure.query(async () => {
		return "Hello World!";
	}),
	testErr: publicProcedure.mutation(async () => {
		console.log("test console.log");
		console.info("test console.info");
		console.error("test console.error");
		throw new Error("This is a test error");
	}),

	/*
  PROTECTED API CALL EXAMPLE
  curl --location 'localhost:3000/api/trpc/test.testApi' \
--header 'Authorization: Basic aW5mb2FsbG9nZ2ktYWRtaW46Y3lZazI0dTlmUm41RHNxakZXcFRWOEdLQk53aFF2RXRiTW1IeEplVTczWlNhWHJkQ0xBUGc2TnREa0M0M1pRYTlkVktIYnhNdjdmV3B5NjVnRm1Bc0VSZVh3dVBZVEw4MmpKblNVaHJ6Y3FHa3F2c0hQeXhtRUFGellWU250R2VRVHIyNWRKYjNVTkNNdVJwZ3dhRFc2OVpoYzdLajhMZkI0WkNIUjlrWWZXVnNHcng3dHlncWR2YzgyU0ZYajU0TmhucG02UEVCTGJLVXVhTVRRSmVBM3dEZ1BTQ1h3RFZtaG5lZDZKOFpRM3F6TnNyNWJCdUx0SHh2RlRBS0d5NzRXMmZZOXBja2pNUlVFSllSa1ZQWndidkJ0VEt5MkY4VUxBc2V1bnpXajdHNWQ2UTNFeGZtTkNYcWc0TURhaEg5Y1NydVh5V3hMTkFzR1FUUFNGaEQ5SFlWekIzTWVnMnJrNUN2YWNmcThtZFo2dFVFNEtScHdibjdqSkFldjdXUmJWZ1BkbmNNTEt4d204eVQ5cFFaNEROVWthWWo2enRYZmhzQkhxRjVFckN1MzJHY2piM0g2S3h2V3N1OXA1ZmtQcmg3WkFSWE1MRGRTODJlbkZVNENxd3p0VGF5RW1HTlZnWUpC'
  
  */
});
