@zeppos/zeus-cli 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/package.json +1 -1
  2. package/private-modules/zeppos-app-utils/dist/config/device-server.js +113 -0
  3. package/private-modules/zeppos-app-utils/dist/config/device.js +74 -1
  4. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/_package.json +14 -0
  5. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/i18n/en-US.po +2 -0
  6. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/index.js +13 -0
  7. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.js +10 -0
  8. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.json +59 -0
  9. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/assets/default/icon.png +0 -0
  10. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/i18n/en-US.po +2 -0
  11. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/index.js +7 -0
  12. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/i18n/en-US.po +2 -0
  13. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/index.js +7 -0
  14. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/watchface/index.js +13 -0
  15. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app-side/index.js +11 -0
  16. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.js +10 -0
  17. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.json +66 -0
  18. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/icon.png +0 -0
  19. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/image/logo.png +0 -0
  20. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/icon.png +0 -0
  21. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/image/logo.png +0 -0
  22. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/icon.png +0 -0
  23. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/image/logo.png +0 -0
  24. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.js +18 -0
  25. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.json +1 -0
  26. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.style.js +15 -0
  27. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.js +18 -0
  28. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.json +1 -0
  29. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.style.js +15 -0
  30. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.js +19 -0
  31. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.json +1 -0
  32. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.style.js +15 -0
  33. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/i18n/en-US.po +3 -0
  34. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/i18n/en-US.po +2 -0
  35. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/index.js +5 -0
  36. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/utils/index.js +3 -0
  37. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/jsconfig.json +14 -0
  38. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.js +7 -0
  39. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.json +51 -0
  40. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
  41. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
  42. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
  43. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
  44. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
  45. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
  46. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
  47. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
  48. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
  49. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
  50. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
  51. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
  52. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
  53. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
  54. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
  55. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
  56. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
  57. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/center.png +0 -0
  58. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/h.png +0 -0
  59. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/left.png +0 -0
  60. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/m.png +0 -0
  61. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/right.png +0 -0
  62. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/s.png +0 -0
  63. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/preview.png +0 -0
  64. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/second/second.png +0 -0
  65. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
  66. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
  67. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
  68. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
  69. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
  70. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
  71. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
  72. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
  73. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
  74. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
  75. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
  76. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
  77. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/1.png +0 -0
  78. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/2.png +0 -0
  79. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/3.png +0 -0
  80. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/4.png +0 -0
  81. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/5.png +0 -0
  82. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/6.png +0 -0
  83. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/7.png +0 -0
  84. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/1.png +0 -0
  85. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/2.png +0 -0
  86. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/3.png +0 -0
  87. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/4.png +0 -0
  88. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/5.png +0 -0
  89. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/6.png +0 -0
  90. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/7.png +0 -0
  91. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/buffer.js +11 -0
  92. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/device-polyfill.js +3 -0
  93. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/global.js +17 -0
  94. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/js-module.js +27 -0
  95. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/logger.js +21 -0
  96. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/setTimeout.js +59 -0
  97. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/gtr-3-pro/index.js +1 -0
  98. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/round/index.js +438 -0
  99. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/_package.json +14 -0
  100. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.js +28 -0
  101. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.json +51 -0
  102. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/consume.png +0 -0
  103. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/beer.png +0 -0
  104. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cake.png +0 -0
  105. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/chocolate.png +0 -0
  106. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/coffee.png +0 -0
  107. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cookies.png +0 -0
  108. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ham.png +0 -0
  109. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/hamburger.png +0 -0
  110. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ice cream.png +0 -0
  111. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/pizza.png +0 -0
  112. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/sausage.png +0 -0
  113. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/icon.png +0 -0
  114. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/multiply.png +0 -0
  115. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/selected.png +0 -0
  116. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/unselected.png +0 -0
  117. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/consume.png +0 -0
  118. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/beer.png +0 -0
  119. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/cake.png +0 -0
  120. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/chocolate.png +0 -0
  121. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/coffee.png +0 -0
  122. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/cookies.png +0 -0
  123. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/ham.png +0 -0
  124. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/hamburger.png +0 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/ice cream.png +0 -0
  126. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/pizza.png +0 -0
  127. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/food/sausage.png +0 -0
  128. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/icon.png +0 -0
  129. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/multiply.png +0 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/selected.png +0 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gts/unselected.png +0 -0
  132. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/food-list.js +113 -0
  133. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/index.js +126 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gts/food-list.js +113 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gts/index.js +126 -0
  136. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/en-US.po +42 -0
  137. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/zh-CN.po +42 -0
  138. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/constants.js +54 -0
  139. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/storage.js +42 -0
  140. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles-gts-3.js +141 -0
  141. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles.js +142 -0
  142. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/i18n/en-US.po +2 -0
  143. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/index.js +13 -0
  144. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.js +10 -0
  145. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.json +59 -0
  146. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/assets/default/icon.png +0 -0
  147. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/i18n/en-US.po +2 -0
  148. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/index.js +7 -0
  149. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/i18n/en-US.po +2 -0
  150. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/index.js +7 -0
  151. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/watchface/index.js +13 -0
  152. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/i18n/en-US.po +2 -0
  153. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/index.js +72 -0
  154. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.js +23 -0
  155. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.json +55 -0
  156. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common/icon.png +0 -0
  157. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.r/icon.png +0 -0
  158. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.s/icon.png +0 -0
  159. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/i18n/en-US.po +2 -0
  160. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/index.js +55 -0
  161. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/pages/i18n/en-US.po +2 -0
  162. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/pages/index.js +55 -0
  163. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/data.js +67 -0
  164. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/defer.js +35 -0
  165. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/device-polyfill.js +6 -0
  166. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/es6-promise.js +1149 -0
  167. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/event.js +42 -0
  168. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message-side.js +1145 -0
  169. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message.js +1151 -0
  170. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/constants.js +2 -0
  171. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/device.js +2 -0
  172. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app-side/index.js +11 -0
  173. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.js +10 -0
  174. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.json +66 -0
  175. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/icon.png +0 -0
  176. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/image/logo.png +0 -0
  177. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/icon.png +0 -0
  178. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/image/logo.png +0 -0
  179. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gtr/icon.png +0 -0
  180. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gtr/image/logo.png +0 -0
  181. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gts/icon.png +0 -0
  182. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gts/image/logo.png +0 -0
  183. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.js +17 -0
  184. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.json +1 -0
  185. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.r.layout.js +28 -0
  186. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.s.layout.js +28 -0
  187. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.style.js +18 -0
  188. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gtr/home/index.page.js +20 -0
  189. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gtr/home/index.page.json +1 -0
  190. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gtr/home/index.style.js +18 -0
  191. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gts/home/index.page.js +21 -0
  192. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gts/home/index.page.json +1 -0
  193. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gts/home/index.style.js +17 -0
  194. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/i18n/en-US.po +3 -0
  195. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/i18n/en-US.po +2 -0
  196. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/index.js +5 -0
  197. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/utils/index.js +3 -0
  198. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/jsconfig.json +14 -0
  199. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/.prettierrc.js +6 -0
  200. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app-side/index.js +48 -0
  201. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.js +25 -0
  202. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.json +70 -0
  203. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/assets/gt.s/icon.png +0 -0
  204. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/assets/gts/icon.png +0 -0
  205. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.js +155 -0
  206. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.json +1 -0
  207. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.style.js +93 -0
  208. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/i18n/en-US.po +9 -0
  209. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/i18n/en-US.po +5 -0
  210. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/index.js +145 -0
  211. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/data.js +67 -0
  212. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/defer.js +35 -0
  213. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/device-polyfill.js +6 -0
  214. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/es6-promise.js +1149 -0
  215. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/event.js +42 -0
  216. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message-side.js +1145 -0
  217. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message.js +1151 -0
  218. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/constants.js +3 -0
  219. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/fs.js +38 -0
  220. package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/index.js +38 -0
  221. package/private-modules/zeppos-app-utils/dist/tools/tools.js +14 -0
@@ -0,0 +1,1149 @@
1
+ /*!
2
+ * @overview es6-promise - a tiny implementation of Promises/A+.
3
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
4
+ * @license Licensed under MIT license
5
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
6
+ * @version v4.2.8+1e68dce6
7
+ */
8
+
9
+ (function (global, factory) {
10
+ global.ES6Promise = factory();
11
+ }(globalThis, (function () { 'use strict';
12
+
13
+ function objectOrFunction(x) {
14
+ var type = typeof x;
15
+ return x !== null && (type === 'object' || type === 'function');
16
+ }
17
+
18
+ function isFunction(x) {
19
+ return typeof x === 'function';
20
+ }
21
+
22
+
23
+
24
+ var _isArray = void 0;
25
+ if (Array.isArray) {
26
+ _isArray = Array.isArray;
27
+ } else {
28
+ _isArray = function (x) {
29
+ return Object.prototype.toString.call(x) === '[object Array]';
30
+ };
31
+ }
32
+
33
+ var isArray = _isArray;
34
+
35
+ var len = 0;
36
+ var vertxNext = void 0;
37
+ var customSchedulerFn = void 0;
38
+
39
+ var asap = function asap(callback, arg) {
40
+ queue[len] = callback;
41
+ queue[len + 1] = arg;
42
+ len += 2;
43
+ if (len === 2) {
44
+ // If len is 2, that means that we need to schedule an async flush.
45
+ // If additional callbacks are queued before the queue is flushed, they
46
+ // will be processed by this flush that we are scheduling.
47
+ if (customSchedulerFn) {
48
+ customSchedulerFn(flush);
49
+ } else {
50
+ scheduleFlush();
51
+ }
52
+ }
53
+ };
54
+
55
+ function setScheduler(scheduleFn) {
56
+ customSchedulerFn = scheduleFn;
57
+ }
58
+
59
+ function setAsap(asapFn) {
60
+ asap = asapFn;
61
+ }
62
+
63
+ var browserWindow = typeof window !== 'undefined' ? window : undefined;
64
+ var browserGlobal = browserWindow || {};
65
+ var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
66
+ var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
67
+
68
+ // test for web worker but not in IE10
69
+ var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
70
+
71
+ // node
72
+ function useNextTick() {
73
+ // node version 0.10.x displays a deprecation warning when nextTick is used recursively
74
+ // see https://github.com/cujojs/when/issues/410 for details
75
+ return function () {
76
+ return process.nextTick(flush);
77
+ };
78
+ }
79
+
80
+ // vertx
81
+ function useVertxTimer() {
82
+ if (typeof vertxNext !== 'undefined') {
83
+ return function () {
84
+ vertxNext(flush);
85
+ };
86
+ }
87
+
88
+ return useSetTimeout();
89
+ }
90
+
91
+ function useMutationObserver() {
92
+ var iterations = 0;
93
+ var observer = new BrowserMutationObserver(flush);
94
+ var node = document.createTextNode('');
95
+ observer.observe(node, { characterData: true });
96
+
97
+ return function () {
98
+ node.data = iterations = ++iterations % 2;
99
+ };
100
+ }
101
+
102
+ // web worker
103
+ function useMessageChannel() {
104
+ var channel = new MessageChannel();
105
+ channel.port1.onmessage = flush;
106
+ return function () {
107
+ return channel.port2.postMessage(0);
108
+ };
109
+ }
110
+
111
+ function useSetTimeout() {
112
+ // Store setTimeout reference so es6-promise will be unaffected by
113
+ // other code modifying setTimeout (like sinon.useFakeTimers())
114
+ var globalSetTimeout = setTimeout;
115
+ return function () {
116
+ return globalSetTimeout(flush, 1);
117
+ };
118
+ }
119
+
120
+ var queue = new Array(1000);
121
+ function flush() {
122
+ for (var i = 0; i < len; i += 2) {
123
+ var callback = queue[i];
124
+ var arg = queue[i + 1];
125
+
126
+ callback(arg);
127
+
128
+ queue[i] = undefined;
129
+ queue[i + 1] = undefined;
130
+ }
131
+
132
+ len = 0;
133
+ }
134
+
135
+ function attemptVertx() {
136
+ try {
137
+ var vertx = Function('return this')().require('vertx');
138
+ vertxNext = vertx.runOnLoop || vertx.runOnContext;
139
+ return useVertxTimer();
140
+ } catch (e) {
141
+ return useSetTimeout();
142
+ }
143
+ }
144
+
145
+ var scheduleFlush = void 0;
146
+ // Decide what async method to use to triggering processing of queued callbacks:
147
+ if (isNode) {
148
+ scheduleFlush = useNextTick();
149
+ } else if (BrowserMutationObserver) {
150
+ scheduleFlush = useMutationObserver();
151
+ } else if (isWorker) {
152
+ scheduleFlush = useMessageChannel();
153
+ } else if (browserWindow === undefined && typeof require === 'function') {
154
+ scheduleFlush = attemptVertx();
155
+ } else {
156
+ scheduleFlush = useSetTimeout();
157
+ }
158
+
159
+ function then(onFulfillment, onRejection) {
160
+ var parent = this;
161
+
162
+ var child = new this.constructor(noop);
163
+
164
+ if (child[PROMISE_ID] === undefined) {
165
+ makePromise(child);
166
+ }
167
+
168
+ var _state = parent._state;
169
+
170
+
171
+ if (_state) {
172
+ var callback = arguments[_state - 1];
173
+ asap(function () {
174
+ return invokeCallback(_state, child, callback, parent._result);
175
+ });
176
+ } else {
177
+ subscribe(parent, child, onFulfillment, onRejection);
178
+ }
179
+
180
+ return child;
181
+ }
182
+
183
+ /**
184
+ `Promise.resolve` returns a promise that will become resolved with the
185
+ passed `value`. It is shorthand for the following:
186
+
187
+ ```javascript
188
+ let promise = new Promise(function(resolve, reject){
189
+ resolve(1);
190
+ });
191
+
192
+ promise.then(function(value){
193
+ // value === 1
194
+ });
195
+ ```
196
+
197
+ Instead of writing the above, your code now simply becomes the following:
198
+
199
+ ```javascript
200
+ let promise = Promise.resolve(1);
201
+
202
+ promise.then(function(value){
203
+ // value === 1
204
+ });
205
+ ```
206
+
207
+ @method resolve
208
+ @static
209
+ @param {Any} value value that the returned promise will be resolved with
210
+ Useful for tooling.
211
+ @return {Promise} a promise that will become fulfilled with the given
212
+ `value`
213
+ */
214
+ function resolve$1(object) {
215
+ /*jshint validthis:true */
216
+ var Constructor = this;
217
+
218
+ if (object && typeof object === 'object' && object.constructor === Constructor) {
219
+ return object;
220
+ }
221
+
222
+ var promise = new Constructor(noop);
223
+ resolve(promise, object);
224
+ return promise;
225
+ }
226
+
227
+ var PROMISE_ID = Math.random().toString(36).substring(2);
228
+
229
+ function noop() {}
230
+
231
+ var PENDING = void 0;
232
+ var FULFILLED = 1;
233
+ var REJECTED = 2;
234
+
235
+ function selfFulfillment() {
236
+ return new TypeError("You cannot resolve a promise with itself");
237
+ }
238
+
239
+ function cannotReturnOwn() {
240
+ return new TypeError('A promises callback cannot return that same promise.');
241
+ }
242
+
243
+ function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
244
+ try {
245
+ then$$1.call(value, fulfillmentHandler, rejectionHandler);
246
+ } catch (e) {
247
+ return e;
248
+ }
249
+ }
250
+
251
+ function handleForeignThenable(promise, thenable, then$$1) {
252
+ asap(function (promise) {
253
+ var sealed = false;
254
+ var error = tryThen(then$$1, thenable, function (value) {
255
+ if (sealed) {
256
+ return;
257
+ }
258
+ sealed = true;
259
+ if (thenable !== value) {
260
+ resolve(promise, value);
261
+ } else {
262
+ fulfill(promise, value);
263
+ }
264
+ }, function (reason) {
265
+ if (sealed) {
266
+ return;
267
+ }
268
+ sealed = true;
269
+
270
+ reject(promise, reason);
271
+ }, 'Settle: ' + (promise._label || ' unknown promise'));
272
+
273
+ if (!sealed && error) {
274
+ sealed = true;
275
+ reject(promise, error);
276
+ }
277
+ }, promise);
278
+ }
279
+
280
+ function handleOwnThenable(promise, thenable) {
281
+ if (thenable._state === FULFILLED) {
282
+ fulfill(promise, thenable._result);
283
+ } else if (thenable._state === REJECTED) {
284
+ reject(promise, thenable._result);
285
+ } else {
286
+ subscribe(thenable, undefined, function (value) {
287
+ return resolve(promise, value);
288
+ }, function (reason) {
289
+ return reject(promise, reason);
290
+ });
291
+ }
292
+ }
293
+
294
+ function handleMaybeThenable(promise, maybeThenable, then$$1) {
295
+ if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
296
+ handleOwnThenable(promise, maybeThenable);
297
+ } else {
298
+ if (then$$1 === undefined) {
299
+ fulfill(promise, maybeThenable);
300
+ } else if (isFunction(then$$1)) {
301
+ handleForeignThenable(promise, maybeThenable, then$$1);
302
+ } else {
303
+ fulfill(promise, maybeThenable);
304
+ }
305
+ }
306
+ }
307
+
308
+ function resolve(promise, value) {
309
+ if (promise === value) {
310
+ reject(promise, selfFulfillment());
311
+ } else if (objectOrFunction(value)) {
312
+ var then$$1 = void 0;
313
+ try {
314
+ then$$1 = value.then;
315
+ } catch (error) {
316
+ reject(promise, error);
317
+ return;
318
+ }
319
+ handleMaybeThenable(promise, value, then$$1);
320
+ } else {
321
+ fulfill(promise, value);
322
+ }
323
+ }
324
+
325
+ function publishRejection(promise) {
326
+ if (promise._onerror) {
327
+ promise._onerror(promise._result);
328
+ }
329
+
330
+ publish(promise);
331
+ }
332
+
333
+ function fulfill(promise, value) {
334
+ if (promise._state !== PENDING) {
335
+ return;
336
+ }
337
+
338
+ promise._result = value;
339
+ promise._state = FULFILLED;
340
+
341
+ if (promise._subscribers.length !== 0) {
342
+ asap(publish, promise);
343
+ }
344
+ }
345
+
346
+ function reject(promise, reason) {
347
+ if (promise._state !== PENDING) {
348
+ return;
349
+ }
350
+ promise._state = REJECTED;
351
+ promise._result = reason;
352
+
353
+ asap(publishRejection, promise);
354
+ }
355
+
356
+ function subscribe(parent, child, onFulfillment, onRejection) {
357
+ var _subscribers = parent._subscribers;
358
+ var length = _subscribers.length;
359
+
360
+
361
+ parent._onerror = null;
362
+
363
+ _subscribers[length] = child;
364
+ _subscribers[length + FULFILLED] = onFulfillment;
365
+ _subscribers[length + REJECTED] = onRejection;
366
+
367
+ if (length === 0 && parent._state) {
368
+ asap(publish, parent);
369
+ }
370
+ }
371
+
372
+ function publish(promise) {
373
+ var subscribers = promise._subscribers;
374
+ var settled = promise._state;
375
+
376
+ if (subscribers.length === 0) {
377
+ return;
378
+ }
379
+
380
+ var child = void 0,
381
+ callback = void 0,
382
+ detail = promise._result;
383
+
384
+ for (var i = 0; i < subscribers.length; i += 3) {
385
+ child = subscribers[i];
386
+ callback = subscribers[i + settled];
387
+
388
+ if (child) {
389
+ invokeCallback(settled, child, callback, detail);
390
+ } else {
391
+ callback(detail);
392
+ }
393
+ }
394
+
395
+ promise._subscribers.length = 0;
396
+ }
397
+
398
+ function invokeCallback(settled, promise, callback, detail) {
399
+ var hasCallback = isFunction(callback),
400
+ value = void 0,
401
+ error = void 0,
402
+ succeeded = true;
403
+
404
+ if (hasCallback) {
405
+ try {
406
+ value = callback(detail);
407
+ } catch (e) {
408
+ succeeded = false;
409
+ error = e;
410
+ }
411
+
412
+ if (promise === value) {
413
+ reject(promise, cannotReturnOwn());
414
+ return;
415
+ }
416
+ } else {
417
+ value = detail;
418
+ }
419
+
420
+ if (promise._state !== PENDING) {
421
+ // noop
422
+ } else if (hasCallback && succeeded) {
423
+ resolve(promise, value);
424
+ } else if (succeeded === false) {
425
+ reject(promise, error);
426
+ } else if (settled === FULFILLED) {
427
+ fulfill(promise, value);
428
+ } else if (settled === REJECTED) {
429
+ reject(promise, value);
430
+ }
431
+ }
432
+
433
+ function initializePromise(promise, resolver) {
434
+ try {
435
+ resolver(function resolvePromise(value) {
436
+ resolve(promise, value);
437
+ }, function rejectPromise(reason) {
438
+ reject(promise, reason);
439
+ });
440
+ } catch (e) {
441
+ reject(promise, e);
442
+ }
443
+ }
444
+
445
+ var id = 0;
446
+ function nextId() {
447
+ return id++;
448
+ }
449
+
450
+ function makePromise(promise) {
451
+ promise[PROMISE_ID] = id++;
452
+ promise._state = undefined;
453
+ promise._result = undefined;
454
+ promise._subscribers = [];
455
+ }
456
+
457
+ function validationError() {
458
+ return new Error('Array Methods must be provided an Array');
459
+ }
460
+
461
+ var Enumerator = function () {
462
+ function Enumerator(Constructor, input) {
463
+ this._instanceConstructor = Constructor;
464
+ this.promise = new Constructor(noop);
465
+
466
+ if (!this.promise[PROMISE_ID]) {
467
+ makePromise(this.promise);
468
+ }
469
+
470
+ if (isArray(input)) {
471
+ this.length = input.length;
472
+ this._remaining = input.length;
473
+
474
+ this._result = new Array(this.length);
475
+
476
+ if (this.length === 0) {
477
+ fulfill(this.promise, this._result);
478
+ } else {
479
+ this.length = this.length || 0;
480
+ this._enumerate(input);
481
+ if (this._remaining === 0) {
482
+ fulfill(this.promise, this._result);
483
+ }
484
+ }
485
+ } else {
486
+ reject(this.promise, validationError());
487
+ }
488
+ }
489
+
490
+ Enumerator.prototype._enumerate = function _enumerate(input) {
491
+ for (var i = 0; this._state === PENDING && i < input.length; i++) {
492
+ this._eachEntry(input[i], i);
493
+ }
494
+ };
495
+
496
+ Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
497
+ var c = this._instanceConstructor;
498
+ var resolve$$1 = c.resolve;
499
+
500
+
501
+ if (resolve$$1 === resolve$1) {
502
+ var _then = void 0;
503
+ var error = void 0;
504
+ var didError = false;
505
+ try {
506
+ _then = entry.then;
507
+ } catch (e) {
508
+ didError = true;
509
+ error = e;
510
+ }
511
+
512
+ if (_then === then && entry._state !== PENDING) {
513
+ this._settledAt(entry._state, i, entry._result);
514
+ } else if (typeof _then !== 'function') {
515
+ this._remaining--;
516
+ this._result[i] = entry;
517
+ } else if (c === Promise$1) {
518
+ var promise = new c(noop);
519
+ if (didError) {
520
+ reject(promise, error);
521
+ } else {
522
+ handleMaybeThenable(promise, entry, _then);
523
+ }
524
+ this._willSettleAt(promise, i);
525
+ } else {
526
+ this._willSettleAt(new c(function (resolve$$1) {
527
+ return resolve$$1(entry);
528
+ }), i);
529
+ }
530
+ } else {
531
+ this._willSettleAt(resolve$$1(entry), i);
532
+ }
533
+ };
534
+
535
+ Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
536
+ var promise = this.promise;
537
+
538
+
539
+ if (promise._state === PENDING) {
540
+ this._remaining--;
541
+
542
+ if (state === REJECTED) {
543
+ reject(promise, value);
544
+ } else {
545
+ this._result[i] = value;
546
+ }
547
+ }
548
+
549
+ if (this._remaining === 0) {
550
+ fulfill(promise, this._result);
551
+ }
552
+ };
553
+
554
+ Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
555
+ var enumerator = this;
556
+
557
+ subscribe(promise, undefined, function (value) {
558
+ return enumerator._settledAt(FULFILLED, i, value);
559
+ }, function (reason) {
560
+ return enumerator._settledAt(REJECTED, i, reason);
561
+ });
562
+ };
563
+
564
+ return Enumerator;
565
+ }();
566
+
567
+ /**
568
+ `Promise.all` accepts an array of promises, and returns a new promise which
569
+ is fulfilled with an array of fulfillment values for the passed promises, or
570
+ rejected with the reason of the first passed promise to be rejected. It casts all
571
+ elements of the passed iterable to promises as it runs this algorithm.
572
+
573
+ Example:
574
+
575
+ ```javascript
576
+ let promise1 = resolve(1);
577
+ let promise2 = resolve(2);
578
+ let promise3 = resolve(3);
579
+ let promises = [ promise1, promise2, promise3 ];
580
+
581
+ Promise.all(promises).then(function(array){
582
+ // The array here would be [ 1, 2, 3 ];
583
+ });
584
+ ```
585
+
586
+ If any of the `promises` given to `all` are rejected, the first promise
587
+ that is rejected will be given as an argument to the returned promises's
588
+ rejection handler. For example:
589
+
590
+ Example:
591
+
592
+ ```javascript
593
+ let promise1 = resolve(1);
594
+ let promise2 = reject(new Error("2"));
595
+ let promise3 = reject(new Error("3"));
596
+ let promises = [ promise1, promise2, promise3 ];
597
+
598
+ Promise.all(promises).then(function(array){
599
+ // Code here never runs because there are rejected promises!
600
+ }, function(error) {
601
+ // error.message === "2"
602
+ });
603
+ ```
604
+
605
+ @method all
606
+ @static
607
+ @param {Array} entries array of promises
608
+ @param {String} label optional string for labeling the promise.
609
+ Useful for tooling.
610
+ @return {Promise} promise that is fulfilled when all `promises` have been
611
+ fulfilled, or rejected if any of them become rejected.
612
+ @static
613
+ */
614
+ function all(entries) {
615
+ return new Enumerator(this, entries).promise;
616
+ }
617
+
618
+ /**
619
+ `Promise.race` returns a new promise which is settled in the same way as the
620
+ first passed promise to settle.
621
+
622
+ Example:
623
+
624
+ ```javascript
625
+ let promise1 = new Promise(function(resolve, reject){
626
+ setTimeout(function(){
627
+ resolve('promise 1');
628
+ }, 200);
629
+ });
630
+
631
+ let promise2 = new Promise(function(resolve, reject){
632
+ setTimeout(function(){
633
+ resolve('promise 2');
634
+ }, 100);
635
+ });
636
+
637
+ Promise.race([promise1, promise2]).then(function(result){
638
+ // result === 'promise 2' because it was resolved before promise1
639
+ // was resolved.
640
+ });
641
+ ```
642
+
643
+ `Promise.race` is deterministic in that only the state of the first
644
+ settled promise matters. For example, even if other promises given to the
645
+ `promises` array argument are resolved, but the first settled promise has
646
+ become rejected before the other promises became fulfilled, the returned
647
+ promise will become rejected:
648
+
649
+ ```javascript
650
+ let promise1 = new Promise(function(resolve, reject){
651
+ setTimeout(function(){
652
+ resolve('promise 1');
653
+ }, 200);
654
+ });
655
+
656
+ let promise2 = new Promise(function(resolve, reject){
657
+ setTimeout(function(){
658
+ reject(new Error('promise 2'));
659
+ }, 100);
660
+ });
661
+
662
+ Promise.race([promise1, promise2]).then(function(result){
663
+ // Code here never runs
664
+ }, function(reason){
665
+ // reason.message === 'promise 2' because promise 2 became rejected before
666
+ // promise 1 became fulfilled
667
+ });
668
+ ```
669
+
670
+ An example real-world use case is implementing timeouts:
671
+
672
+ ```javascript
673
+ Promise.race([ajax('foo.json'), timeout(5000)])
674
+ ```
675
+
676
+ @method race
677
+ @static
678
+ @param {Array} promises array of promises to observe
679
+ Useful for tooling.
680
+ @return {Promise} a promise which settles in the same way as the first passed
681
+ promise to settle.
682
+ */
683
+ function race(entries) {
684
+ /*jshint validthis:true */
685
+ var Constructor = this;
686
+
687
+ if (!isArray(entries)) {
688
+ return new Constructor(function (_, reject) {
689
+ return reject(new TypeError('You must pass an array to race.'));
690
+ });
691
+ } else {
692
+ return new Constructor(function (resolve, reject) {
693
+ var length = entries.length;
694
+ for (var i = 0; i < length; i++) {
695
+ Constructor.resolve(entries[i]).then(resolve, reject);
696
+ }
697
+ });
698
+ }
699
+ }
700
+
701
+ /**
702
+ `Promise.reject` returns a promise rejected with the passed `reason`.
703
+ It is shorthand for the following:
704
+
705
+ ```javascript
706
+ let promise = new Promise(function(resolve, reject){
707
+ reject(new Error('WHOOPS'));
708
+ });
709
+
710
+ promise.then(function(value){
711
+ // Code here doesn't run because the promise is rejected!
712
+ }, function(reason){
713
+ // reason.message === 'WHOOPS'
714
+ });
715
+ ```
716
+
717
+ Instead of writing the above, your code now simply becomes the following:
718
+
719
+ ```javascript
720
+ let promise = Promise.reject(new Error('WHOOPS'));
721
+
722
+ promise.then(function(value){
723
+ // Code here doesn't run because the promise is rejected!
724
+ }, function(reason){
725
+ // reason.message === 'WHOOPS'
726
+ });
727
+ ```
728
+
729
+ @method reject
730
+ @static
731
+ @param {Any} reason value that the returned promise will be rejected with.
732
+ Useful for tooling.
733
+ @return {Promise} a promise rejected with the given `reason`.
734
+ */
735
+ function reject$1(reason) {
736
+ /*jshint validthis:true */
737
+ var Constructor = this;
738
+ var promise = new Constructor(noop);
739
+ reject(promise, reason);
740
+ return promise;
741
+ }
742
+
743
+ function needsResolver() {
744
+ throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
745
+ }
746
+
747
+ function needsNew() {
748
+ throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
749
+ }
750
+
751
+ /**
752
+ Promise objects represent the eventual result of an asynchronous operation. The
753
+ primary way of interacting with a promise is through its `then` method, which
754
+ registers callbacks to receive either a promise's eventual value or the reason
755
+ why the promise cannot be fulfilled.
756
+
757
+ Terminology
758
+ -----------
759
+
760
+ - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
761
+ - `thenable` is an object or function that defines a `then` method.
762
+ - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
763
+ - `exception` is a value that is thrown using the throw statement.
764
+ - `reason` is a value that indicates why a promise was rejected.
765
+ - `settled` the final resting state of a promise, fulfilled or rejected.
766
+
767
+ A promise can be in one of three states: pending, fulfilled, or rejected.
768
+
769
+ Promises that are fulfilled have a fulfillment value and are in the fulfilled
770
+ state. Promises that are rejected have a rejection reason and are in the
771
+ rejected state. A fulfillment value is never a thenable.
772
+
773
+ Promises can also be said to *resolve* a value. If this value is also a
774
+ promise, then the original promise's settled state will match the value's
775
+ settled state. So a promise that *resolves* a promise that rejects will
776
+ itself reject, and a promise that *resolves* a promise that fulfills will
777
+ itself fulfill.
778
+
779
+
780
+ Basic Usage:
781
+ ------------
782
+
783
+ ```js
784
+ let promise = new Promise(function(resolve, reject) {
785
+ // on success
786
+ resolve(value);
787
+
788
+ // on failure
789
+ reject(reason);
790
+ });
791
+
792
+ promise.then(function(value) {
793
+ // on fulfillment
794
+ }, function(reason) {
795
+ // on rejection
796
+ });
797
+ ```
798
+
799
+ Advanced Usage:
800
+ ---------------
801
+
802
+ Promises shine when abstracting away asynchronous interactions such as
803
+ `XMLHttpRequest`s.
804
+
805
+ ```js
806
+ function getJSON(url) {
807
+ return new Promise(function(resolve, reject){
808
+ let xhr = new XMLHttpRequest();
809
+
810
+ xhr.open('GET', url);
811
+ xhr.onreadystatechange = handler;
812
+ xhr.responseType = 'json';
813
+ xhr.setRequestHeader('Accept', 'application/json');
814
+ xhr.send();
815
+
816
+ function handler() {
817
+ if (this.readyState === this.DONE) {
818
+ if (this.status === 200) {
819
+ resolve(this.response);
820
+ } else {
821
+ reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
822
+ }
823
+ }
824
+ };
825
+ });
826
+ }
827
+
828
+ getJSON('/posts.json').then(function(json) {
829
+ // on fulfillment
830
+ }, function(reason) {
831
+ // on rejection
832
+ });
833
+ ```
834
+
835
+ Unlike callbacks, promises are great composable primitives.
836
+
837
+ ```js
838
+ Promise.all([
839
+ getJSON('/posts'),
840
+ getJSON('/comments')
841
+ ]).then(function(values){
842
+ values[0] // => postsJSON
843
+ values[1] // => commentsJSON
844
+
845
+ return values;
846
+ });
847
+ ```
848
+
849
+ @class Promise
850
+ @param {Function} resolver
851
+ Useful for tooling.
852
+ @constructor
853
+ */
854
+
855
+ var Promise$1 = function () {
856
+ function Promise(resolver) {
857
+ this[PROMISE_ID] = nextId();
858
+ this._result = this._state = undefined;
859
+ this._subscribers = [];
860
+
861
+ if (noop !== resolver) {
862
+ typeof resolver !== 'function' && needsResolver();
863
+ this instanceof Promise ? initializePromise(this, resolver) : needsNew();
864
+ }
865
+ }
866
+
867
+ /**
868
+ The primary way of interacting with a promise is through its `then` method,
869
+ which registers callbacks to receive either a promise's eventual value or the
870
+ reason why the promise cannot be fulfilled.
871
+ ```js
872
+ findUser().then(function(user){
873
+ // user is available
874
+ }, function(reason){
875
+ // user is unavailable, and you are given the reason why
876
+ });
877
+ ```
878
+ Chaining
879
+ --------
880
+ The return value of `then` is itself a promise. This second, 'downstream'
881
+ promise is resolved with the return value of the first promise's fulfillment
882
+ or rejection handler, or rejected if the handler throws an exception.
883
+ ```js
884
+ findUser().then(function (user) {
885
+ return user.name;
886
+ }, function (reason) {
887
+ return 'default name';
888
+ }).then(function (userName) {
889
+ // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
890
+ // will be `'default name'`
891
+ });
892
+ findUser().then(function (user) {
893
+ throw new Error('Found user, but still unhappy');
894
+ }, function (reason) {
895
+ throw new Error('`findUser` rejected and we're unhappy');
896
+ }).then(function (value) {
897
+ // never reached
898
+ }, function (reason) {
899
+ // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
900
+ // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
901
+ });
902
+ ```
903
+ If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
904
+ ```js
905
+ findUser().then(function (user) {
906
+ throw new PedagogicalException('Upstream error');
907
+ }).then(function (value) {
908
+ // never reached
909
+ }).then(function (value) {
910
+ // never reached
911
+ }, function (reason) {
912
+ // The `PedgagocialException` is propagated all the way down to here
913
+ });
914
+ ```
915
+ Assimilation
916
+ ------------
917
+ Sometimes the value you want to propagate to a downstream promise can only be
918
+ retrieved asynchronously. This can be achieved by returning a promise in the
919
+ fulfillment or rejection handler. The downstream promise will then be pending
920
+ until the returned promise is settled. This is called *assimilation*.
921
+ ```js
922
+ findUser().then(function (user) {
923
+ return findCommentsByAuthor(user);
924
+ }).then(function (comments) {
925
+ // The user's comments are now available
926
+ });
927
+ ```
928
+ If the assimliated promise rejects, then the downstream promise will also reject.
929
+ ```js
930
+ findUser().then(function (user) {
931
+ return findCommentsByAuthor(user);
932
+ }).then(function (comments) {
933
+ // If `findCommentsByAuthor` fulfills, we'll have the value here
934
+ }, function (reason) {
935
+ // If `findCommentsByAuthor` rejects, we'll have the reason here
936
+ });
937
+ ```
938
+ Simple Example
939
+ --------------
940
+ Synchronous Example
941
+ ```javascript
942
+ let result;
943
+ try {
944
+ result = findResult();
945
+ // success
946
+ } catch(reason) {
947
+ // failure
948
+ }
949
+ ```
950
+ Errback Example
951
+ ```js
952
+ findResult(function(result, err){
953
+ if (err) {
954
+ // failure
955
+ } else {
956
+ // success
957
+ }
958
+ });
959
+ ```
960
+ Promise Example;
961
+ ```javascript
962
+ findResult().then(function(result){
963
+ // success
964
+ }, function(reason){
965
+ // failure
966
+ });
967
+ ```
968
+ Advanced Example
969
+ --------------
970
+ Synchronous Example
971
+ ```javascript
972
+ let author, books;
973
+ try {
974
+ author = findAuthor();
975
+ books = findBooksByAuthor(author);
976
+ // success
977
+ } catch(reason) {
978
+ // failure
979
+ }
980
+ ```
981
+ Errback Example
982
+ ```js
983
+ function foundBooks(books) {
984
+ }
985
+ function failure(reason) {
986
+ }
987
+ findAuthor(function(author, err){
988
+ if (err) {
989
+ failure(err);
990
+ // failure
991
+ } else {
992
+ try {
993
+ findBoooksByAuthor(author, function(books, err) {
994
+ if (err) {
995
+ failure(err);
996
+ } else {
997
+ try {
998
+ foundBooks(books);
999
+ } catch(reason) {
1000
+ failure(reason);
1001
+ }
1002
+ }
1003
+ });
1004
+ } catch(error) {
1005
+ failure(err);
1006
+ }
1007
+ // success
1008
+ }
1009
+ });
1010
+ ```
1011
+ Promise Example;
1012
+ ```javascript
1013
+ findAuthor().
1014
+ then(findBooksByAuthor).
1015
+ then(function(books){
1016
+ // found books
1017
+ }).catch(function(reason){
1018
+ // something went wrong
1019
+ });
1020
+ ```
1021
+ @method then
1022
+ @param {Function} onFulfilled
1023
+ @param {Function} onRejected
1024
+ Useful for tooling.
1025
+ @return {Promise}
1026
+ */
1027
+
1028
+ /**
1029
+ `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
1030
+ as the catch block of a try/catch statement.
1031
+ ```js
1032
+ function findAuthor(){
1033
+ throw new Error('couldn't find that author');
1034
+ }
1035
+ // synchronous
1036
+ try {
1037
+ findAuthor();
1038
+ } catch(reason) {
1039
+ // something went wrong
1040
+ }
1041
+ // async with promises
1042
+ findAuthor().catch(function(reason){
1043
+ // something went wrong
1044
+ });
1045
+ ```
1046
+ @method catch
1047
+ @param {Function} onRejection
1048
+ Useful for tooling.
1049
+ @return {Promise}
1050
+ */
1051
+
1052
+
1053
+ Promise.prototype.catch = function _catch(onRejection) {
1054
+ return this.then(null, onRejection);
1055
+ };
1056
+
1057
+ /**
1058
+ `finally` will be invoked regardless of the promise's fate just as native
1059
+ try/catch/finally behaves
1060
+
1061
+ Synchronous example:
1062
+
1063
+ ```js
1064
+ findAuthor() {
1065
+ if (Math.random() > 0.5) {
1066
+ throw new Error();
1067
+ }
1068
+ return new Author();
1069
+ }
1070
+
1071
+ try {
1072
+ return findAuthor(); // succeed or fail
1073
+ } catch(error) {
1074
+ return findOtherAuther();
1075
+ } finally {
1076
+ // always runs
1077
+ // doesn't affect the return value
1078
+ }
1079
+ ```
1080
+
1081
+ Asynchronous example:
1082
+
1083
+ ```js
1084
+ findAuthor().catch(function(reason){
1085
+ return findOtherAuther();
1086
+ }).finally(function(){
1087
+ // author was either found, or not
1088
+ });
1089
+ ```
1090
+
1091
+ @method finally
1092
+ @param {Function} callback
1093
+ @return {Promise}
1094
+ */
1095
+
1096
+
1097
+ Promise.prototype.finally = function _finally(callback) {
1098
+ var promise = this;
1099
+ var constructor = promise.constructor;
1100
+
1101
+ if (isFunction(callback)) {
1102
+ return promise.then(function (value) {
1103
+ return constructor.resolve(callback()).then(function () {
1104
+ return value;
1105
+ });
1106
+ }, function (reason) {
1107
+ return constructor.resolve(callback()).then(function () {
1108
+ throw reason;
1109
+ });
1110
+ });
1111
+ }
1112
+
1113
+ return promise.then(callback, callback);
1114
+ };
1115
+
1116
+ return Promise;
1117
+ }();
1118
+
1119
+ Promise$1.prototype.then = then;
1120
+ Promise$1.all = all;
1121
+ Promise$1.race = race;
1122
+ Promise$1.resolve = resolve$1;
1123
+ Promise$1.reject = reject$1;
1124
+ Promise$1._setScheduler = setScheduler;
1125
+ Promise$1._setAsap = setAsap;
1126
+ Promise$1._asap = asap;
1127
+ Promise$1.debug = function _debug() {
1128
+ return '[object ES6Promise]'
1129
+ };
1130
+
1131
+
1132
+ /*global self*/
1133
+ function polyfill() {
1134
+ var local = globalThis;
1135
+
1136
+ local.Promise = Promise$1;
1137
+ }
1138
+
1139
+ // Strange compat..
1140
+ Promise$1.polyfill = polyfill;
1141
+ Promise$1.Promise = Promise$1;
1142
+
1143
+ return Promise$1;
1144
+
1145
+ })));
1146
+
1147
+
1148
+
1149
+ //# sourceMappingURL=es6-promise.map