message: add create document support for tinylicious
diff: @@ -55,5 +55,37 @@ export function create(storage: IDocumentStorage): Router {
  });
  });
  + /**
  + * Creates a new document with initial summary.
  + */
  + router.post("/:tenantId", (request, response, next) => {
  + // Tenant and document
  + const tenantId = getParam(request.params, "tenantId");
  + const id = request.body.id;
  +
  + // Summary information
  + const summary = request.body.summary;
  +
  + // Protocol state
  + const sequenceNumber = request.body.sequenceNumber;
  + const values = request.body.values;
  +
  + const createP = storage.createDocument(
  + tenantId,
  + id,
  + summary,
  + sequenceNumber,
  + 1,
  + values);
  +
  + createP.then(
  + () => {
  + response.status(201).json(id);
  + },
  + (error) => {
  + response.status(400).json(error);
  + });
  + });
  +
  return router;
  }
  