added thrift files
authorOwen Smith <owen@omsmith.ca>
Sun, 18 Nov 2012 20:26:12 +0000 (15:26 -0500)
committerOwen Smith <owen@omsmith.ca>
Sun, 18 Nov 2012 20:26:12 +0000 (15:26 -0500)
pos.thrift [new file with mode: 0644]
www/assets/js/Pos.js [new file with mode: 0644]
www/assets/js/pos_types.js [new file with mode: 0644]

diff --git a/pos.thrift b/pos.thrift
new file mode 100644 (file)
index 0000000..d550d66
--- /dev/null
@@ -0,0 +1,33 @@
+namespace cpp pos
+
+service Pos {
+       void ping(),
+
+       string getSalt(),
+
+       i32 getAccountFromHash(1:string dataToHash),
+       list<string> getHashesFromAccountId(1:i32 account),
+       list<string> getHashesFromAccountName(1:string account),
+
+       i32 getHashAccountBalance(1:string dataToHash),
+       i32 getIdAccountBalance(1:i32 account),
+       i32 getNameAccountBalance(1:string account),
+
+       i64 associateHashWithId(1:string auth, 2:string dataToHash, 3:i32 account),
+       i64 associateHashWithName(1:string auth, 2:string dataToHash, 3:string account),
+       i64 deassociateHash(1:string auth, 2:string dataToHash),
+
+       i32 getUPCPrice(1:i64 upc),
+       i64 setUPCPrice(1:string auth, 2:i64 upc, 3:i32 price),
+
+       i64 doTransactionOnHash(1:string auth, 2:string dataToHash, 3:i32 delta),
+       i64 doTransactionOnId(1:string auth, 2:i32 account, 3:i32 delta),
+       i64 doTransactionOnName(1:string auth, 2:string account, 3:i32 delta),
+       i64 revertTransaction(1:string auth, 2:i64 serial),
+
+       i32 getStock(1:i64 upc),
+       i64 doStockChange(1:string auth, 2:i64 upc, 3:i32 delta),
+
+       list<string> toString()
+}
+
diff --git a/www/assets/js/Pos.js b/www/assets/js/Pos.js
new file mode 100644 (file)
index 0000000..8273699
--- /dev/null
@@ -0,0 +1,3140 @@
+//
+// Autogenerated by Thrift Compiler (0.8.0)
+//
+// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+//
+
+
+//HELPER FUNCTIONS AND STRUCTURES
+
+Pos_ping_args = function(args) {
+};
+Pos_ping_args.prototype = {};
+Pos_ping_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    input.skip(ftype);
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_ping_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_ping_args');
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_ping_result = function(args) {
+};
+Pos_ping_result.prototype = {};
+Pos_ping_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    input.skip(ftype);
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_ping_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_ping_result');
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getSalt_args = function(args) {
+};
+Pos_getSalt_args.prototype = {};
+Pos_getSalt_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    input.skip(ftype);
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getSalt_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getSalt_args');
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getSalt_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getSalt_result.prototype = {};
+Pos_getSalt_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.STRING) {
+        this.success = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getSalt_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getSalt_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.STRING, 0);
+    output.writeString(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getAccountFromHash_args = function(args) {
+  this.dataToHash = null;
+  if (args) {
+    if (args.dataToHash !== undefined) {
+      this.dataToHash = args.dataToHash;
+    }
+  }
+};
+Pos_getAccountFromHash_args.prototype = {};
+Pos_getAccountFromHash_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.dataToHash = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getAccountFromHash_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getAccountFromHash_args');
+  if (this.dataToHash) {
+    output.writeFieldBegin('dataToHash', Thrift.Type.STRING, 1);
+    output.writeString(this.dataToHash);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getAccountFromHash_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getAccountFromHash_result.prototype = {};
+Pos_getAccountFromHash_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I32) {
+        this.success = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getAccountFromHash_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getAccountFromHash_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I32, 0);
+    output.writeI32(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountId_args = function(args) {
+  this.account = null;
+  if (args) {
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+  }
+};
+Pos_getHashesFromAccountId_args.prototype = {};
+Pos_getHashesFromAccountId_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.I32) {
+        this.account = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountId_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getHashesFromAccountId_args');
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.I32, 1);
+    output.writeI32(this.account);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountId_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getHashesFromAccountId_result.prototype = {};
+Pos_getHashesFromAccountId_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.LIST) {
+        var _size0 = 0;
+        var _rtmp34;
+        this.success = [];
+        var _etype3 = 0;
+        _rtmp34 = input.readListBegin();
+        _etype3 = _rtmp34.etype;
+        _size0 = _rtmp34.size;
+        for (var _i5 = 0; _i5 < _size0; ++_i5)
+        {
+          var elem6 = null;
+          elem6 = input.readString().value;
+          this.success.push(elem6);
+        }
+        input.readListEnd();
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountId_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getHashesFromAccountId_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.LIST, 0);
+    output.writeListBegin(Thrift.Type.STRING, this.success.length);
+    for (var iter7 in this.success)
+    {
+      if (this.success.hasOwnProperty(iter7))
+      {
+        iter7 = this.success[iter7];
+        output.writeString(iter7);
+      }
+    }
+    output.writeListEnd();
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountName_args = function(args) {
+  this.account = null;
+  if (args) {
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+  }
+};
+Pos_getHashesFromAccountName_args.prototype = {};
+Pos_getHashesFromAccountName_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.account = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountName_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getHashesFromAccountName_args');
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.STRING, 1);
+    output.writeString(this.account);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountName_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getHashesFromAccountName_result.prototype = {};
+Pos_getHashesFromAccountName_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.LIST) {
+        var _size8 = 0;
+        var _rtmp312;
+        this.success = [];
+        var _etype11 = 0;
+        _rtmp312 = input.readListBegin();
+        _etype11 = _rtmp312.etype;
+        _size8 = _rtmp312.size;
+        for (var _i13 = 0; _i13 < _size8; ++_i13)
+        {
+          var elem14 = null;
+          elem14 = input.readString().value;
+          this.success.push(elem14);
+        }
+        input.readListEnd();
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getHashesFromAccountName_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getHashesFromAccountName_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.LIST, 0);
+    output.writeListBegin(Thrift.Type.STRING, this.success.length);
+    for (var iter15 in this.success)
+    {
+      if (this.success.hasOwnProperty(iter15))
+      {
+        iter15 = this.success[iter15];
+        output.writeString(iter15);
+      }
+    }
+    output.writeListEnd();
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getHashAccountBalance_args = function(args) {
+  this.dataToHash = null;
+  if (args) {
+    if (args.dataToHash !== undefined) {
+      this.dataToHash = args.dataToHash;
+    }
+  }
+};
+Pos_getHashAccountBalance_args.prototype = {};
+Pos_getHashAccountBalance_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.dataToHash = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getHashAccountBalance_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getHashAccountBalance_args');
+  if (this.dataToHash) {
+    output.writeFieldBegin('dataToHash', Thrift.Type.STRING, 1);
+    output.writeString(this.dataToHash);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getHashAccountBalance_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getHashAccountBalance_result.prototype = {};
+Pos_getHashAccountBalance_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I32) {
+        this.success = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getHashAccountBalance_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getHashAccountBalance_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I32, 0);
+    output.writeI32(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getIdAccountBalance_args = function(args) {
+  this.account = null;
+  if (args) {
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+  }
+};
+Pos_getIdAccountBalance_args.prototype = {};
+Pos_getIdAccountBalance_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.I32) {
+        this.account = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getIdAccountBalance_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getIdAccountBalance_args');
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.I32, 1);
+    output.writeI32(this.account);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getIdAccountBalance_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getIdAccountBalance_result.prototype = {};
+Pos_getIdAccountBalance_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I32) {
+        this.success = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getIdAccountBalance_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getIdAccountBalance_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I32, 0);
+    output.writeI32(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getNameAccountBalance_args = function(args) {
+  this.account = null;
+  if (args) {
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+  }
+};
+Pos_getNameAccountBalance_args.prototype = {};
+Pos_getNameAccountBalance_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.account = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getNameAccountBalance_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getNameAccountBalance_args');
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.STRING, 1);
+    output.writeString(this.account);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getNameAccountBalance_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getNameAccountBalance_result.prototype = {};
+Pos_getNameAccountBalance_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I32) {
+        this.success = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getNameAccountBalance_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getNameAccountBalance_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I32, 0);
+    output.writeI32(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_associateHashWithId_args = function(args) {
+  this.auth = null;
+  this.dataToHash = null;
+  this.account = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.dataToHash !== undefined) {
+      this.dataToHash = args.dataToHash;
+    }
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+  }
+};
+Pos_associateHashWithId_args.prototype = {};
+Pos_associateHashWithId_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.STRING) {
+        this.dataToHash = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.I32) {
+        this.account = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_associateHashWithId_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_associateHashWithId_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.dataToHash) {
+    output.writeFieldBegin('dataToHash', Thrift.Type.STRING, 2);
+    output.writeString(this.dataToHash);
+    output.writeFieldEnd();
+  }
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.I32, 3);
+    output.writeI32(this.account);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_associateHashWithId_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_associateHashWithId_result.prototype = {};
+Pos_associateHashWithId_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_associateHashWithId_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_associateHashWithId_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_associateHashWithName_args = function(args) {
+  this.auth = null;
+  this.dataToHash = null;
+  this.account = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.dataToHash !== undefined) {
+      this.dataToHash = args.dataToHash;
+    }
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+  }
+};
+Pos_associateHashWithName_args.prototype = {};
+Pos_associateHashWithName_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.STRING) {
+        this.dataToHash = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.STRING) {
+        this.account = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_associateHashWithName_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_associateHashWithName_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.dataToHash) {
+    output.writeFieldBegin('dataToHash', Thrift.Type.STRING, 2);
+    output.writeString(this.dataToHash);
+    output.writeFieldEnd();
+  }
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.STRING, 3);
+    output.writeString(this.account);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_associateHashWithName_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_associateHashWithName_result.prototype = {};
+Pos_associateHashWithName_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_associateHashWithName_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_associateHashWithName_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_deassociateHash_args = function(args) {
+  this.auth = null;
+  this.dataToHash = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.dataToHash !== undefined) {
+      this.dataToHash = args.dataToHash;
+    }
+  }
+};
+Pos_deassociateHash_args.prototype = {};
+Pos_deassociateHash_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.STRING) {
+        this.dataToHash = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_deassociateHash_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_deassociateHash_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.dataToHash) {
+    output.writeFieldBegin('dataToHash', Thrift.Type.STRING, 2);
+    output.writeString(this.dataToHash);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_deassociateHash_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_deassociateHash_result.prototype = {};
+Pos_deassociateHash_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_deassociateHash_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_deassociateHash_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getUPCPrice_args = function(args) {
+  this.upc = null;
+  if (args) {
+    if (args.upc !== undefined) {
+      this.upc = args.upc;
+    }
+  }
+};
+Pos_getUPCPrice_args.prototype = {};
+Pos_getUPCPrice_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.I64) {
+        this.upc = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getUPCPrice_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getUPCPrice_args');
+  if (this.upc) {
+    output.writeFieldBegin('upc', Thrift.Type.I64, 1);
+    output.writeI64(this.upc);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getUPCPrice_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getUPCPrice_result.prototype = {};
+Pos_getUPCPrice_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I32) {
+        this.success = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getUPCPrice_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getUPCPrice_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I32, 0);
+    output.writeI32(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_setUPCPrice_args = function(args) {
+  this.auth = null;
+  this.upc = null;
+  this.price = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.upc !== undefined) {
+      this.upc = args.upc;
+    }
+    if (args.price !== undefined) {
+      this.price = args.price;
+    }
+  }
+};
+Pos_setUPCPrice_args.prototype = {};
+Pos_setUPCPrice_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.I64) {
+        this.upc = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.I32) {
+        this.price = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_setUPCPrice_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_setUPCPrice_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.upc) {
+    output.writeFieldBegin('upc', Thrift.Type.I64, 2);
+    output.writeI64(this.upc);
+    output.writeFieldEnd();
+  }
+  if (this.price) {
+    output.writeFieldBegin('price', Thrift.Type.I32, 3);
+    output.writeI32(this.price);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_setUPCPrice_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_setUPCPrice_result.prototype = {};
+Pos_setUPCPrice_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_setUPCPrice_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_setUPCPrice_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doTransactionOnHash_args = function(args) {
+  this.auth = null;
+  this.dataToHash = null;
+  this.delta = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.dataToHash !== undefined) {
+      this.dataToHash = args.dataToHash;
+    }
+    if (args.delta !== undefined) {
+      this.delta = args.delta;
+    }
+  }
+};
+Pos_doTransactionOnHash_args.prototype = {};
+Pos_doTransactionOnHash_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.STRING) {
+        this.dataToHash = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.I32) {
+        this.delta = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doTransactionOnHash_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doTransactionOnHash_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.dataToHash) {
+    output.writeFieldBegin('dataToHash', Thrift.Type.STRING, 2);
+    output.writeString(this.dataToHash);
+    output.writeFieldEnd();
+  }
+  if (this.delta) {
+    output.writeFieldBegin('delta', Thrift.Type.I32, 3);
+    output.writeI32(this.delta);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doTransactionOnHash_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_doTransactionOnHash_result.prototype = {};
+Pos_doTransactionOnHash_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doTransactionOnHash_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doTransactionOnHash_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doTransactionOnId_args = function(args) {
+  this.auth = null;
+  this.account = null;
+  this.delta = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+    if (args.delta !== undefined) {
+      this.delta = args.delta;
+    }
+  }
+};
+Pos_doTransactionOnId_args.prototype = {};
+Pos_doTransactionOnId_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.I32) {
+        this.account = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.I32) {
+        this.delta = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doTransactionOnId_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doTransactionOnId_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.I32, 2);
+    output.writeI32(this.account);
+    output.writeFieldEnd();
+  }
+  if (this.delta) {
+    output.writeFieldBegin('delta', Thrift.Type.I32, 3);
+    output.writeI32(this.delta);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doTransactionOnId_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_doTransactionOnId_result.prototype = {};
+Pos_doTransactionOnId_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doTransactionOnId_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doTransactionOnId_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doTransactionOnName_args = function(args) {
+  this.auth = null;
+  this.account = null;
+  this.delta = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.account !== undefined) {
+      this.account = args.account;
+    }
+    if (args.delta !== undefined) {
+      this.delta = args.delta;
+    }
+  }
+};
+Pos_doTransactionOnName_args.prototype = {};
+Pos_doTransactionOnName_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.STRING) {
+        this.account = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.I32) {
+        this.delta = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doTransactionOnName_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doTransactionOnName_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.account) {
+    output.writeFieldBegin('account', Thrift.Type.STRING, 2);
+    output.writeString(this.account);
+    output.writeFieldEnd();
+  }
+  if (this.delta) {
+    output.writeFieldBegin('delta', Thrift.Type.I32, 3);
+    output.writeI32(this.delta);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doTransactionOnName_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_doTransactionOnName_result.prototype = {};
+Pos_doTransactionOnName_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doTransactionOnName_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doTransactionOnName_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_revertTransaction_args = function(args) {
+  this.auth = null;
+  this.serial = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.serial !== undefined) {
+      this.serial = args.serial;
+    }
+  }
+};
+Pos_revertTransaction_args.prototype = {};
+Pos_revertTransaction_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.I64) {
+        this.serial = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_revertTransaction_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_revertTransaction_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.serial) {
+    output.writeFieldBegin('serial', Thrift.Type.I64, 2);
+    output.writeI64(this.serial);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_revertTransaction_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_revertTransaction_result.prototype = {};
+Pos_revertTransaction_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_revertTransaction_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_revertTransaction_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getStock_args = function(args) {
+  this.upc = null;
+  if (args) {
+    if (args.upc !== undefined) {
+      this.upc = args.upc;
+    }
+  }
+};
+Pos_getStock_args.prototype = {};
+Pos_getStock_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.I64) {
+        this.upc = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getStock_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getStock_args');
+  if (this.upc) {
+    output.writeFieldBegin('upc', Thrift.Type.I64, 1);
+    output.writeI64(this.upc);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_getStock_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_getStock_result.prototype = {};
+Pos_getStock_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I32) {
+        this.success = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_getStock_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_getStock_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I32, 0);
+    output.writeI32(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doStockChange_args = function(args) {
+  this.auth = null;
+  this.upc = null;
+  this.delta = null;
+  if (args) {
+    if (args.auth !== undefined) {
+      this.auth = args.auth;
+    }
+    if (args.upc !== undefined) {
+      this.upc = args.upc;
+    }
+    if (args.delta !== undefined) {
+      this.delta = args.delta;
+    }
+  }
+};
+Pos_doStockChange_args.prototype = {};
+Pos_doStockChange_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 1:
+      if (ftype == Thrift.Type.STRING) {
+        this.auth = input.readString().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 2:
+      if (ftype == Thrift.Type.I64) {
+        this.upc = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 3:
+      if (ftype == Thrift.Type.I32) {
+        this.delta = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doStockChange_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doStockChange_args');
+  if (this.auth) {
+    output.writeFieldBegin('auth', Thrift.Type.STRING, 1);
+    output.writeString(this.auth);
+    output.writeFieldEnd();
+  }
+  if (this.upc) {
+    output.writeFieldBegin('upc', Thrift.Type.I64, 2);
+    output.writeI64(this.upc);
+    output.writeFieldEnd();
+  }
+  if (this.delta) {
+    output.writeFieldBegin('delta', Thrift.Type.I32, 3);
+    output.writeI32(this.delta);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_doStockChange_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_doStockChange_result.prototype = {};
+Pos_doStockChange_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.I64) {
+        this.success = input.readI64().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_doStockChange_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_doStockChange_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.I64, 0);
+    output.writeI64(this.success);
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_toString_args = function(args) {
+};
+Pos_toString_args.prototype = {};
+Pos_toString_args.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    input.skip(ftype);
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_toString_args.prototype.write = function(output) {
+  output.writeStructBegin('Pos_toString_args');
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+Pos_toString_result = function(args) {
+  this.success = null;
+  if (args) {
+    if (args.success !== undefined) {
+      this.success = args.success;
+    }
+  }
+};
+Pos_toString_result.prototype = {};
+Pos_toString_result.prototype.read = function(input) {
+  input.readStructBegin();
+  while (true)
+  {
+    var ret = input.readFieldBegin();
+    var fname = ret.fname;
+    var ftype = ret.ftype;
+    var fid = ret.fid;
+    if (ftype == Thrift.Type.STOP) {
+      break;
+    }
+    switch (fid)
+    {
+      case 0:
+      if (ftype == Thrift.Type.LIST) {
+        var _size16 = 0;
+        var _rtmp320;
+        this.success = [];
+        var _etype19 = 0;
+        _rtmp320 = input.readListBegin();
+        _etype19 = _rtmp320.etype;
+        _size16 = _rtmp320.size;
+        for (var _i21 = 0; _i21 < _size16; ++_i21)
+        {
+          var elem22 = null;
+          elem22 = input.readString().value;
+          this.success.push(elem22);
+        }
+        input.readListEnd();
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 0:
+        input.skip(ftype);
+        break;
+      default:
+        input.skip(ftype);
+    }
+    input.readFieldEnd();
+  }
+  input.readStructEnd();
+  return;
+};
+
+Pos_toString_result.prototype.write = function(output) {
+  output.writeStructBegin('Pos_toString_result');
+  if (this.success) {
+    output.writeFieldBegin('success', Thrift.Type.LIST, 0);
+    output.writeListBegin(Thrift.Type.STRING, this.success.length);
+    for (var iter23 in this.success)
+    {
+      if (this.success.hasOwnProperty(iter23))
+      {
+        iter23 = this.success[iter23];
+        output.writeString(iter23);
+      }
+    }
+    output.writeListEnd();
+    output.writeFieldEnd();
+  }
+  output.writeFieldStop();
+  output.writeStructEnd();
+  return;
+};
+
+PosClient = function(input, output) {
+    this.input = input;
+    this.output = (!output) ? input : output;
+    this.seqid = 0;
+};
+PosClient.prototype = {};
+PosClient.prototype.ping = function(callback) {
+  if (callback === undefined) {
+    this.send_ping();
+    this.recv_ping();
+  } else {
+    var postData = this.send_ping(true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_ping);
+  }
+};
+
+PosClient.prototype.send_ping = function(callback) {
+  this.output.writeMessageBegin('ping', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_ping_args();
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_ping = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_ping_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  return;
+};
+PosClient.prototype.getSalt = function(callback) {
+  if (callback === undefined) {
+    this.send_getSalt();
+    return this.recv_getSalt();
+  } else {
+    var postData = this.send_getSalt(true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getSalt);
+  }
+};
+
+PosClient.prototype.send_getSalt = function(callback) {
+  this.output.writeMessageBegin('getSalt', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getSalt_args();
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getSalt = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getSalt_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getSalt failed: unknown result';
+};
+PosClient.prototype.getAccountFromHash = function(dataToHash, callback) {
+  if (callback === undefined) {
+    this.send_getAccountFromHash(dataToHash);
+    return this.recv_getAccountFromHash();
+  } else {
+    var postData = this.send_getAccountFromHash(dataToHash, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getAccountFromHash);
+  }
+};
+
+PosClient.prototype.send_getAccountFromHash = function(dataToHash, callback) {
+  this.output.writeMessageBegin('getAccountFromHash', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getAccountFromHash_args();
+  args.dataToHash = dataToHash;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getAccountFromHash = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getAccountFromHash_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getAccountFromHash failed: unknown result';
+};
+PosClient.prototype.getHashesFromAccountId = function(account, callback) {
+  if (callback === undefined) {
+    this.send_getHashesFromAccountId(account);
+    return this.recv_getHashesFromAccountId();
+  } else {
+    var postData = this.send_getHashesFromAccountId(account, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getHashesFromAccountId);
+  }
+};
+
+PosClient.prototype.send_getHashesFromAccountId = function(account, callback) {
+  this.output.writeMessageBegin('getHashesFromAccountId', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getHashesFromAccountId_args();
+  args.account = account;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getHashesFromAccountId = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getHashesFromAccountId_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getHashesFromAccountId failed: unknown result';
+};
+PosClient.prototype.getHashesFromAccountName = function(account, callback) {
+  if (callback === undefined) {
+    this.send_getHashesFromAccountName(account);
+    return this.recv_getHashesFromAccountName();
+  } else {
+    var postData = this.send_getHashesFromAccountName(account, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getHashesFromAccountName);
+  }
+};
+
+PosClient.prototype.send_getHashesFromAccountName = function(account, callback) {
+  this.output.writeMessageBegin('getHashesFromAccountName', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getHashesFromAccountName_args();
+  args.account = account;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getHashesFromAccountName = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getHashesFromAccountName_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getHashesFromAccountName failed: unknown result';
+};
+PosClient.prototype.getHashAccountBalance = function(dataToHash, callback) {
+  if (callback === undefined) {
+    this.send_getHashAccountBalance(dataToHash);
+    return this.recv_getHashAccountBalance();
+  } else {
+    var postData = this.send_getHashAccountBalance(dataToHash, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getHashAccountBalance);
+  }
+};
+
+PosClient.prototype.send_getHashAccountBalance = function(dataToHash, callback) {
+  this.output.writeMessageBegin('getHashAccountBalance', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getHashAccountBalance_args();
+  args.dataToHash = dataToHash;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getHashAccountBalance = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getHashAccountBalance_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getHashAccountBalance failed: unknown result';
+};
+PosClient.prototype.getIdAccountBalance = function(account, callback) {
+  if (callback === undefined) {
+    this.send_getIdAccountBalance(account);
+    return this.recv_getIdAccountBalance();
+  } else {
+    var postData = this.send_getIdAccountBalance(account, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getIdAccountBalance);
+  }
+};
+
+PosClient.prototype.send_getIdAccountBalance = function(account, callback) {
+  this.output.writeMessageBegin('getIdAccountBalance', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getIdAccountBalance_args();
+  args.account = account;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getIdAccountBalance = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getIdAccountBalance_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getIdAccountBalance failed: unknown result';
+};
+PosClient.prototype.getNameAccountBalance = function(account, callback) {
+  if (callback === undefined) {
+    this.send_getNameAccountBalance(account);
+    return this.recv_getNameAccountBalance();
+  } else {
+    var postData = this.send_getNameAccountBalance(account, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getNameAccountBalance);
+  }
+};
+
+PosClient.prototype.send_getNameAccountBalance = function(account, callback) {
+  this.output.writeMessageBegin('getNameAccountBalance', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getNameAccountBalance_args();
+  args.account = account;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getNameAccountBalance = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getNameAccountBalance_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getNameAccountBalance failed: unknown result';
+};
+PosClient.prototype.associateHashWithId = function(auth, dataToHash, account, callback) {
+  if (callback === undefined) {
+    this.send_associateHashWithId(auth, dataToHash, account);
+    return this.recv_associateHashWithId();
+  } else {
+    var postData = this.send_associateHashWithId(auth, dataToHash, account, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_associateHashWithId);
+  }
+};
+
+PosClient.prototype.send_associateHashWithId = function(auth, dataToHash, account, callback) {
+  this.output.writeMessageBegin('associateHashWithId', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_associateHashWithId_args();
+  args.auth = auth;
+  args.dataToHash = dataToHash;
+  args.account = account;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_associateHashWithId = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_associateHashWithId_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'associateHashWithId failed: unknown result';
+};
+PosClient.prototype.associateHashWithName = function(auth, dataToHash, account, callback) {
+  if (callback === undefined) {
+    this.send_associateHashWithName(auth, dataToHash, account);
+    return this.recv_associateHashWithName();
+  } else {
+    var postData = this.send_associateHashWithName(auth, dataToHash, account, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_associateHashWithName);
+  }
+};
+
+PosClient.prototype.send_associateHashWithName = function(auth, dataToHash, account, callback) {
+  this.output.writeMessageBegin('associateHashWithName', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_associateHashWithName_args();
+  args.auth = auth;
+  args.dataToHash = dataToHash;
+  args.account = account;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_associateHashWithName = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_associateHashWithName_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'associateHashWithName failed: unknown result';
+};
+PosClient.prototype.deassociateHash = function(auth, dataToHash, callback) {
+  if (callback === undefined) {
+    this.send_deassociateHash(auth, dataToHash);
+    return this.recv_deassociateHash();
+  } else {
+    var postData = this.send_deassociateHash(auth, dataToHash, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_deassociateHash);
+  }
+};
+
+PosClient.prototype.send_deassociateHash = function(auth, dataToHash, callback) {
+  this.output.writeMessageBegin('deassociateHash', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_deassociateHash_args();
+  args.auth = auth;
+  args.dataToHash = dataToHash;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_deassociateHash = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_deassociateHash_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'deassociateHash failed: unknown result';
+};
+PosClient.prototype.getUPCPrice = function(upc, callback) {
+  if (callback === undefined) {
+    this.send_getUPCPrice(upc);
+    return this.recv_getUPCPrice();
+  } else {
+    var postData = this.send_getUPCPrice(upc, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getUPCPrice);
+  }
+};
+
+PosClient.prototype.send_getUPCPrice = function(upc, callback) {
+  this.output.writeMessageBegin('getUPCPrice', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getUPCPrice_args();
+  args.upc = upc;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getUPCPrice = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getUPCPrice_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getUPCPrice failed: unknown result';
+};
+PosClient.prototype.setUPCPrice = function(auth, upc, price, callback) {
+  if (callback === undefined) {
+    this.send_setUPCPrice(auth, upc, price);
+    return this.recv_setUPCPrice();
+  } else {
+    var postData = this.send_setUPCPrice(auth, upc, price, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_setUPCPrice);
+  }
+};
+
+PosClient.prototype.send_setUPCPrice = function(auth, upc, price, callback) {
+  this.output.writeMessageBegin('setUPCPrice', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_setUPCPrice_args();
+  args.auth = auth;
+  args.upc = upc;
+  args.price = price;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_setUPCPrice = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_setUPCPrice_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'setUPCPrice failed: unknown result';
+};
+PosClient.prototype.doTransactionOnHash = function(auth, dataToHash, delta, callback) {
+  if (callback === undefined) {
+    this.send_doTransactionOnHash(auth, dataToHash, delta);
+    return this.recv_doTransactionOnHash();
+  } else {
+    var postData = this.send_doTransactionOnHash(auth, dataToHash, delta, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_doTransactionOnHash);
+  }
+};
+
+PosClient.prototype.send_doTransactionOnHash = function(auth, dataToHash, delta, callback) {
+  this.output.writeMessageBegin('doTransactionOnHash', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_doTransactionOnHash_args();
+  args.auth = auth;
+  args.dataToHash = dataToHash;
+  args.delta = delta;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_doTransactionOnHash = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_doTransactionOnHash_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'doTransactionOnHash failed: unknown result';
+};
+PosClient.prototype.doTransactionOnId = function(auth, account, delta, callback) {
+  if (callback === undefined) {
+    this.send_doTransactionOnId(auth, account, delta);
+    return this.recv_doTransactionOnId();
+  } else {
+    var postData = this.send_doTransactionOnId(auth, account, delta, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_doTransactionOnId);
+  }
+};
+
+PosClient.prototype.send_doTransactionOnId = function(auth, account, delta, callback) {
+  this.output.writeMessageBegin('doTransactionOnId', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_doTransactionOnId_args();
+  args.auth = auth;
+  args.account = account;
+  args.delta = delta;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_doTransactionOnId = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_doTransactionOnId_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'doTransactionOnId failed: unknown result';
+};
+PosClient.prototype.doTransactionOnName = function(auth, account, delta, callback) {
+  if (callback === undefined) {
+    this.send_doTransactionOnName(auth, account, delta);
+    return this.recv_doTransactionOnName();
+  } else {
+    var postData = this.send_doTransactionOnName(auth, account, delta, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_doTransactionOnName);
+  }
+};
+
+PosClient.prototype.send_doTransactionOnName = function(auth, account, delta, callback) {
+  this.output.writeMessageBegin('doTransactionOnName', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_doTransactionOnName_args();
+  args.auth = auth;
+  args.account = account;
+  args.delta = delta;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_doTransactionOnName = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_doTransactionOnName_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'doTransactionOnName failed: unknown result';
+};
+PosClient.prototype.revertTransaction = function(auth, serial, callback) {
+  if (callback === undefined) {
+    this.send_revertTransaction(auth, serial);
+    return this.recv_revertTransaction();
+  } else {
+    var postData = this.send_revertTransaction(auth, serial, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_revertTransaction);
+  }
+};
+
+PosClient.prototype.send_revertTransaction = function(auth, serial, callback) {
+  this.output.writeMessageBegin('revertTransaction', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_revertTransaction_args();
+  args.auth = auth;
+  args.serial = serial;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_revertTransaction = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_revertTransaction_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'revertTransaction failed: unknown result';
+};
+PosClient.prototype.getStock = function(upc, callback) {
+  if (callback === undefined) {
+    this.send_getStock(upc);
+    return this.recv_getStock();
+  } else {
+    var postData = this.send_getStock(upc, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_getStock);
+  }
+};
+
+PosClient.prototype.send_getStock = function(upc, callback) {
+  this.output.writeMessageBegin('getStock', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_getStock_args();
+  args.upc = upc;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_getStock = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_getStock_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'getStock failed: unknown result';
+};
+PosClient.prototype.doStockChange = function(auth, upc, delta, callback) {
+  if (callback === undefined) {
+    this.send_doStockChange(auth, upc, delta);
+    return this.recv_doStockChange();
+  } else {
+    var postData = this.send_doStockChange(auth, upc, delta, true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_doStockChange);
+  }
+};
+
+PosClient.prototype.send_doStockChange = function(auth, upc, delta, callback) {
+  this.output.writeMessageBegin('doStockChange', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_doStockChange_args();
+  args.auth = auth;
+  args.upc = upc;
+  args.delta = delta;
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_doStockChange = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_doStockChange_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'doStockChange failed: unknown result';
+};
+PosClient.prototype.toString = function(callback) {
+  if (callback === undefined) {
+    this.send_toString();
+    return this.recv_toString();
+  } else {
+    var postData = this.send_toString(true);
+    return this.output.getTransport()
+      .jqRequest(this, postData, arguments, this.recv_toString);
+  }
+};
+
+PosClient.prototype.send_toString = function(callback) {
+  this.output.writeMessageBegin('toString', Thrift.MessageType.CALL, this.seqid);
+  var args = new Pos_toString_args();
+  args.write(this.output);
+  this.output.writeMessageEnd();
+  return this.output.getTransport().flush(callback);
+};
+
+PosClient.prototype.recv_toString = function() {
+  var ret = this.input.readMessageBegin();
+  var fname = ret.fname;
+  var mtype = ret.mtype;
+  var rseqid = ret.rseqid;
+  if (mtype == Thrift.MessageType.EXCEPTION) {
+    var x = new Thrift.TApplicationException();
+    x.read(this.input);
+    this.input.readMessageEnd();
+    throw x;
+  }
+  var result = new Pos_toString_result();
+  result.read(this.input);
+  this.input.readMessageEnd();
+
+  if (null !== result.success) {
+    return result.success;
+  }
+  throw 'toString failed: unknown result';
+};
diff --git a/www/assets/js/pos_types.js b/www/assets/js/pos_types.js
new file mode 100644 (file)
index 0000000..e8018b9
--- /dev/null
@@ -0,0 +1,6 @@
+//
+// Autogenerated by Thrift Compiler (0.8.0)
+//
+// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+//
+