RequestSchema.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. const general = {
  7. title: 'General request schema',
  8. type: 'object',
  9. properties: {
  10. op: {
  11. type: 'string',
  12. enum: ['connect', 'subscribe', 'unsubscribe', 'update']
  13. }
  14. },
  15. required: ['op']
  16. };
  17. const connect = {
  18. title: 'Connect operation schema',
  19. type: 'object',
  20. properties: {
  21. op: 'connect',
  22. applicationId: {
  23. type: 'string'
  24. },
  25. javascriptKey: {
  26. type: 'string'
  27. },
  28. masterKey: {
  29. type: 'string'
  30. },
  31. clientKey: {
  32. type: 'string'
  33. },
  34. windowsKey: {
  35. type: 'string'
  36. },
  37. restAPIKey: {
  38. type: 'string'
  39. },
  40. sessionToken: {
  41. type: 'string'
  42. },
  43. installationId: {
  44. type: 'string'
  45. }
  46. },
  47. required: ['op', 'applicationId'],
  48. additionalProperties: false
  49. };
  50. const subscribe = {
  51. title: 'Subscribe operation schema',
  52. type: 'object',
  53. properties: {
  54. op: 'subscribe',
  55. requestId: {
  56. type: 'number'
  57. },
  58. query: {
  59. title: 'Query field schema',
  60. type: 'object',
  61. properties: {
  62. className: {
  63. type: 'string'
  64. },
  65. where: {
  66. type: 'object'
  67. },
  68. keys: {
  69. type: 'array',
  70. items: {
  71. type: 'string'
  72. },
  73. minItems: 1,
  74. uniqueItems: true
  75. },
  76. watch: {
  77. type: 'array',
  78. items: {
  79. type: 'string'
  80. },
  81. minItems: 1,
  82. uniqueItems: true
  83. }
  84. },
  85. required: ['where', 'className'],
  86. additionalProperties: false
  87. },
  88. sessionToken: {
  89. type: 'string'
  90. }
  91. },
  92. required: ['op', 'requestId', 'query'],
  93. additionalProperties: false
  94. };
  95. const update = {
  96. title: 'Update operation schema',
  97. type: 'object',
  98. properties: {
  99. op: 'update',
  100. requestId: {
  101. type: 'number'
  102. },
  103. query: {
  104. title: 'Query field schema',
  105. type: 'object',
  106. properties: {
  107. className: {
  108. type: 'string'
  109. },
  110. where: {
  111. type: 'object'
  112. },
  113. keys: {
  114. type: 'array',
  115. items: {
  116. type: 'string'
  117. },
  118. minItems: 1,
  119. uniqueItems: true
  120. },
  121. watch: {
  122. type: 'array',
  123. items: {
  124. type: 'string'
  125. },
  126. minItems: 1,
  127. uniqueItems: true
  128. }
  129. },
  130. required: ['where', 'className'],
  131. additionalProperties: false
  132. },
  133. sessionToken: {
  134. type: 'string'
  135. }
  136. },
  137. required: ['op', 'requestId', 'query'],
  138. additionalProperties: false
  139. };
  140. const unsubscribe = {
  141. title: 'Unsubscribe operation schema',
  142. type: 'object',
  143. properties: {
  144. op: 'unsubscribe',
  145. requestId: {
  146. type: 'number'
  147. }
  148. },
  149. required: ['op', 'requestId'],
  150. additionalProperties: false
  151. };
  152. const RequestSchema = {
  153. general: general,
  154. connect: connect,
  155. subscribe: subscribe,
  156. update: update,
  157. unsubscribe: unsubscribe
  158. };
  159. var _default = exports.default = RequestSchema;
  160. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJnZW5lcmFsIiwidGl0bGUiLCJ0eXBlIiwicHJvcGVydGllcyIsIm9wIiwiZW51bSIsInJlcXVpcmVkIiwiY29ubmVjdCIsImFwcGxpY2F0aW9uSWQiLCJqYXZhc2NyaXB0S2V5IiwibWFzdGVyS2V5IiwiY2xpZW50S2V5Iiwid2luZG93c0tleSIsInJlc3RBUElLZXkiLCJzZXNzaW9uVG9rZW4iLCJpbnN0YWxsYXRpb25JZCIsImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiwic3Vic2NyaWJlIiwicmVxdWVzdElkIiwicXVlcnkiLCJjbGFzc05hbWUiLCJ3aGVyZSIsImtleXMiLCJpdGVtcyI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dHJpbmcnLFxuICAgIH0sXG4gICAgc2Vzc2lvblRva2VuOiB7XG4gICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICB9LFxuICAgIGluc3RhbGxhdGlvbklkOiB7XG4gICAgICB0eXBlOiAnc3RyaW5nJyxcbiAgICB9LFxuICB9LFxuICByZXF1aXJlZDogWydvcCcsICdhcHBsaWNhdGlvbklkJ10sXG4gIGFkZGl0aW9uYWxQcm9wZXJ0aWVzOiBmYWxzZSxcbn07XG5cbmNvbnN0IHN1YnNjcmliZSA9IHtcbiAgdGl0bGU6ICdTdWJzY3JpYmUgb3BlcmF0aW9uIHNjaGVtYScsXG4gIHR5cGU6ICdvYmplY3QnLFxuICBwcm9wZXJ0aWVzOiB7XG4gICAgb3A6ICdzdWJzY3JpYmUnLFxuICAgIHJlcXVlc3RJZDoge1xuICAgICAgdHlwZTogJ251bWJlcicsXG4gICAgfSxcbiAgICBxdWVyeToge1xuICAgICAgdGl0bGU6ICdRdWVyeSBmaWVsZCBzY2hlbWEnLFxuICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgIGNsYXNzTmFtZToge1xuICAgICAgICAgIHR5cGU6ICdzdHJpbmcnLFxuICAgICAgICB9LFxuICAgICAgICB3aGVyZToge1xuICAgICAgICAgIHR5cGU6ICdvYmplY3QnLFxuICAgICAgICB9LFxuICAgICAgICBrZXlzOiB7XG4gICAgICAgICAgdHlwZTogJ2FycmF5JyxcbiAgICAgICAgICBpdGVtczoge1xuICAgICAgICAgICAgdHlwZTogJ3N0cmluZycsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBtaW5JdGVtczogMSxcbiAgICAgICAgICB1bmlxdWVJdGVtczogdHJ1ZSxcbiAgICAgICAgfSxcbiAgICAgICAgd2F0Y2g6IHtcbiAgICAgICAgICB0eXBlOiAnYXJyYXknLFxuICAgICAgICAgIGl0ZW1zOiB7XG4gICAgICAgICAgICB0eXBlOiAnc3RyaW5nJ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