newAction function
Implementation
pb.Action newAction({required String name, required math.Random prng, String? note}) {
assert(name != null);
var action = pb.Action();
action.ensureCommon().ensureMetadata().name = name;
if (note != null && note.isNotEmpty) {
action.ensureCommon().ensureMetadata().note = note;
}
var ts = action.common.ensureTimestamp();
ts.ctime = ts.mtime = now();
action.common.uid = randomUid(prng);
return action;
}