A possible interface is something like this.
oip.publishRecord({wif, template, payload})
where the template is the code of the main template. The payload is an Object with fields matching the template definitions in the file descriptor.
This API should build the signed message using protobuff internally and publish using the wif passed. All in one shot.