code: function sendChanges(changes, baseRevision, partial, onChangesAccepted) {
                  ++requestId;
                  acceptCallbacks[requestId.toString()] = onChangesAccepted;
  
                  // In this example, the server expects the following JSON format of the request:
                  //  {
                  //      type: "changes"
                  //      baseRevision: baseRevision,
                  //      changes: changes,
                  //      partial: partial,
                  //      requestId: id
                  //  }
                  //  To make the sample simplified, we assume the server has the exact same specification of how changes are structured.
                  //  In real world, you would have to pre-process the changes array to fit the server specification.
                  //  However, this example shows how to deal with the WebSocket to fullfill the API.
  
                  ws.send(JSON.stringify({
                      type: 'changes',
                      changes: changes,
                      partial: partial,
                      baseRevision: baseRevision,
                      requestId: requestId
                  }));
              }
docs: sendChanges() method: