message-options.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * This module defines all the arguments that may be passed to a message.
  3. *
  4. * Each argument may contain a field `__argName`, if the name of the field
  5. * should be different when sent to the server.
  6. *
  7. * The argument may also contain a field `__argType`, if the given
  8. * argument must be of that type. The types are the strings resulting from
  9. * calling `typeof <arg>` where `<arg>` is the argument.
  10. *
  11. * Other than that, the arguments are expected to follow the indicated
  12. * structure.
  13. */
  14. module.exports = {
  15. collapseKey: {
  16. __argName: "collapse_key",
  17. __argType: "string"
  18. },
  19. priority: {
  20. __argType: "string"
  21. },
  22. contentAvailable: {
  23. __argName: "content_available",
  24. __argType: "boolean"
  25. },
  26. mutableContent: {
  27. __argName: "mutable_content",
  28. __argType: "boolean"
  29. },
  30. delayWhileIdle: {
  31. __argName: "delay_while_idle",
  32. __argType: "boolean"
  33. },
  34. timeToLive: {
  35. __argName: "time_to_live",
  36. __argType: "number"
  37. },
  38. restrictedPackageName: {
  39. __argName: "restricted_package_name",
  40. __argType: "string"
  41. },
  42. dryRun: {
  43. __argName: "dry_run",
  44. __argType: "boolean"
  45. },
  46. data: {
  47. __argType: "object"
  48. },
  49. notification: {
  50. __argType: "object"
  51. //TODO: There are a lot of very specific arguments that could
  52. // be indicated here.
  53. }
  54. };