sumba 2.47.0 → 2.47.2

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 (262) hide show
  1. package/.github/FUNDING.yml +0 -0
  2. package/.github/workflows/repo-lockdown.yml +0 -0
  3. package/.jsdoc.conf.json +0 -0
  4. package/LICENSE +0 -0
  5. package/README.md +0 -0
  6. package/docs/Sumba.html +0 -0
  7. package/docs/data/search.json +0 -0
  8. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  9. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  10. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  11. package/docs/global.html +0 -0
  12. package/docs/index.html +0 -0
  13. package/docs/index.js.html +0 -0
  14. package/docs/lib_config.js.html +0 -0
  15. package/docs/lib_constant.js.html +0 -0
  16. package/docs/lib_token-schema.js.html +0 -0
  17. package/docs/scripts/core.js +0 -0
  18. package/docs/scripts/core.min.js +0 -0
  19. package/docs/scripts/resize.js +0 -0
  20. package/docs/scripts/search.js +0 -0
  21. package/docs/scripts/search.min.js +5 -5
  22. package/docs/scripts/third-party/Apache-License-2.0.txt +0 -0
  23. package/docs/scripts/third-party/fuse.js +0 -0
  24. package/docs/scripts/third-party/hljs-line-num-original.js +0 -0
  25. package/docs/scripts/third-party/hljs-line-num.js +0 -0
  26. package/docs/scripts/third-party/hljs-original.js +0 -0
  27. package/docs/scripts/third-party/hljs.js +0 -0
  28. package/docs/scripts/third-party/popper.js +0 -0
  29. package/docs/scripts/third-party/tippy.js +0 -0
  30. package/docs/scripts/third-party/tocbot.js +0 -0
  31. package/docs/scripts/third-party/tocbot.min.js +0 -0
  32. package/docs/static/bitcoin.jpeg +0 -0
  33. package/docs/static/home.md +0 -0
  34. package/docs/static/logo-ecosystem.png +0 -0
  35. package/docs/static/logo.png +0 -0
  36. package/docs/styles/clean-jsdoc-theme-base.css +0 -0
  37. package/docs/styles/clean-jsdoc-theme-dark.css +0 -0
  38. package/docs/styles/clean-jsdoc-theme-light.css +0 -0
  39. package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -0
  40. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
  41. package/docs/styles/clean-jsdoc-theme.min.css +0 -0
  42. package/extend/bajo/hook.js +300 -300
  43. package/extend/bajo/intl/en-US.json +0 -0
  44. package/extend/bajo/intl/id.json +0 -0
  45. package/extend/bajoCli/applet/create-new-site.js +21 -21
  46. package/extend/bajoCli/applet/populate-model-with-site.js +54 -54
  47. package/extend/bajoCli/applet/remove-site.js +20 -20
  48. package/extend/bajoCli/applet.js +0 -0
  49. package/extend/bajoTemplate/layout/centered.html +0 -0
  50. package/extend/bajoTemplate/layout/default.html +0 -0
  51. package/extend/bajoTemplate/layout/email.html +0 -0
  52. package/extend/bajoTemplate/layout/email.id.html +0 -0
  53. package/extend/bajoTemplate/layout/error.html +0 -0
  54. package/extend/bajoTemplate/layout/info.html +0 -0
  55. package/extend/bajoTemplate/partial/403.html +0 -0
  56. package/extend/bajoTemplate/partial/_admin/reset-user-password.html +0 -0
  57. package/extend/bajoTemplate/partial/_mail/help-contact-form.html +0 -0
  58. package/extend/bajoTemplate/partial/_mail/help-contact-form.id.html +0 -0
  59. package/extend/bajoTemplate/partial/_mail/mystuff-change-password.html +0 -0
  60. package/extend/bajoTemplate/partial/_mail/mystuff-change-password.id.html +0 -0
  61. package/extend/bajoTemplate/partial/_mail/mystuff-reset-api-key.html +0 -0
  62. package/extend/bajoTemplate/partial/_mail/mystuff-reset-api-key.id.html +0 -0
  63. package/extend/bajoTemplate/partial/_mail/user-activation-success.html +0 -0
  64. package/extend/bajoTemplate/partial/_mail/user-activation-success.id.html +0 -0
  65. package/extend/bajoTemplate/partial/_mail/user-forgot-password-changed.html +0 -0
  66. package/extend/bajoTemplate/partial/_mail/user-forgot-password-changed.id.html +0 -0
  67. package/extend/bajoTemplate/partial/_mail/user-forgot-password-link.html +0 -0
  68. package/extend/bajoTemplate/partial/_mail/user-forgot-password-link.id.html +0 -0
  69. package/extend/bajoTemplate/partial/_mail/user-signup-success-active.html +0 -0
  70. package/extend/bajoTemplate/partial/_mail/user-signup-success-active.id.html +0 -0
  71. package/extend/bajoTemplate/partial/_mail/user-signup-success.html +0 -0
  72. package/extend/bajoTemplate/partial/_mail/user-signup-success.id.html +0 -0
  73. package/extend/bajoTemplate/partial/api-key-modal.html +0 -0
  74. package/extend/bajoTemplate/partial/app-launcher.html +0 -0
  75. package/extend/bajoTemplate/partial/help/contact-form/form.html +0 -0
  76. package/extend/bajoTemplate/partial/help/contact-form/success.html +0 -0
  77. package/extend/bajoTemplate/partial/help/trouble-tickets/add.html +0 -0
  78. package/extend/bajoTemplate/partial/help/trouble-tickets/details.html +0 -0
  79. package/extend/bajoTemplate/partial/help/trouble-tickets/list.html +0 -0
  80. package/extend/bajoTemplate/partial/layout/address.html +0 -0
  81. package/extend/bajoTemplate/partial/layout/breadcrumb.html +0 -0
  82. package/extend/bajoTemplate/partial/layout/footer.html +0 -0
  83. package/extend/bajoTemplate/partial/layout/more-info.html +0 -0
  84. package/extend/bajoTemplate/partial/layout/more-info.id.html +0 -0
  85. package/extend/bajoTemplate/partial/layout/navbar.html +0 -0
  86. package/extend/bajoTemplate/partial/layout/sidebar.html +0 -0
  87. package/extend/bajoTemplate/partial/layout/socmed.html +0 -0
  88. package/extend/bajoTemplate/partial/list-item/change-password.html +0 -0
  89. package/extend/bajoTemplate/partial/list-item/forgot-password.html +0 -0
  90. package/extend/bajoTemplate/partial/list-item/goto-home.html +0 -0
  91. package/extend/bajoTemplate/partial/list-item/member-links.html +0 -0
  92. package/extend/bajoTemplate/partial/list-item/oauth-signin.html +0 -0
  93. package/extend/bajoTemplate/partial/list-item/signin.html +0 -0
  94. package/extend/bajoTemplate/partial/list-item/signout.html +0 -0
  95. package/extend/bajoTemplate/partial/list-item/user-signup.html +0 -0
  96. package/extend/bajoTemplate/partial/list-item/your-profile.html +0 -0
  97. package/extend/bajoTemplate/partial/signin.html +0 -0
  98. package/extend/bajoTemplate/partial/signout.html +0 -0
  99. package/extend/bajoTemplate/partial/user/activation.html +0 -0
  100. package/extend/bajoTemplate/partial/user/forgot-password-nomail.id.md +0 -0
  101. package/extend/bajoTemplate/partial/user/forgot-password-nomail.md +0 -0
  102. package/extend/bajoTemplate/partial/user/forgot-password.html +0 -0
  103. package/extend/bajoTemplate/partial/user/fpl-invalid.html +0 -0
  104. package/extend/bajoTemplate/partial/user/fpl-invalid.id.md +0 -0
  105. package/extend/bajoTemplate/partial/user/fpl-invalid.md +0 -0
  106. package/extend/bajoTemplate/partial/user/fpl.html +0 -0
  107. package/extend/bajoTemplate/partial/user/signup/form.html +0 -0
  108. package/extend/bajoTemplate/partial/user/signup/success-mail.id.md +0 -0
  109. package/extend/bajoTemplate/partial/user/signup/success-mail.md +0 -0
  110. package/extend/bajoTemplate/partial/user/signup/success-nomail.id.md +0 -0
  111. package/extend/bajoTemplate/partial/user/signup/success-nomail.md +0 -0
  112. package/extend/bajoTemplate/partial/user/signup/success.html +0 -0
  113. package/extend/bajoTemplate/partial/your-stuff/change-password.html +0 -0
  114. package/extend/bajoTemplate/partial/your-stuff/profile/edit.html +0 -0
  115. package/extend/bajoTemplate/partial/your-stuff/profile/view.html +0 -0
  116. package/extend/bajoTemplate/partial/your-stuff/reset-api-key.html +0 -0
  117. package/extend/bajoTemplate/template/403.html +0 -0
  118. package/extend/bajoTemplate/template/_admin/reset-user-password.html +0 -0
  119. package/extend/bajoTemplate/template/_mail/help-contact-form.html +0 -0
  120. package/extend/bajoTemplate/template/_mail/mystuff-change-password.html +0 -0
  121. package/extend/bajoTemplate/template/_mail/mystuff-reset-api-key.html +0 -0
  122. package/extend/bajoTemplate/template/_mail/user-activation-success.html +0 -0
  123. package/extend/bajoTemplate/template/_mail/user-forgot-password-changed.html +0 -0
  124. package/extend/bajoTemplate/template/_mail/user-forgot-password-link.html +0 -0
  125. package/extend/bajoTemplate/template/_mail/user-signup-success-active.html +0 -0
  126. package/extend/bajoTemplate/template/_mail/user-signup-success.html +0 -0
  127. package/extend/bajoTemplate/template/help/contact-form/form.html +0 -0
  128. package/extend/bajoTemplate/template/help/contact-form/success.html +0 -0
  129. package/extend/bajoTemplate/template/help/trouble-tickets/add.html +0 -0
  130. package/extend/bajoTemplate/template/help/trouble-tickets/details.html +0 -0
  131. package/extend/bajoTemplate/template/help/trouble-tickets/list.html +0 -0
  132. package/extend/bajoTemplate/template/info/about-us.md +0 -0
  133. package/extend/bajoTemplate/template/info/cookie-policy.md +0 -0
  134. package/extend/bajoTemplate/template/info/privacy.md +0 -0
  135. package/extend/bajoTemplate/template/info/terms-conditions.md +0 -0
  136. package/extend/bajoTemplate/template/signin.html +0 -0
  137. package/extend/bajoTemplate/template/signout.html +0 -0
  138. package/extend/bajoTemplate/template/user/activation.html +0 -0
  139. package/extend/bajoTemplate/template/user/forgot-password.html +0 -0
  140. package/extend/bajoTemplate/template/user/fpl-invalid.html +0 -0
  141. package/extend/bajoTemplate/template/user/fpl.html +0 -0
  142. package/extend/bajoTemplate/template/user/signup/form.html +0 -0
  143. package/extend/bajoTemplate/template/user/signup/success.html +0 -0
  144. package/extend/bajoTemplate/template/your-stuff/change-password.html +0 -0
  145. package/extend/bajoTemplate/template/your-stuff/profile/edit.html +0 -0
  146. package/extend/bajoTemplate/template/your-stuff/profile/view.html +0 -0
  147. package/extend/bajoTemplate/template/your-stuff/reset-api-key.html +0 -0
  148. package/extend/dobo/feature/address.js +0 -0
  149. package/extend/dobo/feature/category.js +0 -0
  150. package/extend/dobo/feature/country.js +0 -0
  151. package/extend/dobo/feature/email.js +0 -0
  152. package/extend/dobo/feature/lat-lng.js +0 -0
  153. package/extend/dobo/feature/lat.js +0 -0
  154. package/extend/dobo/feature/lng.js +0 -0
  155. package/extend/dobo/feature/notes.js +0 -0
  156. package/extend/dobo/feature/person-in-charge.js +0 -0
  157. package/extend/dobo/feature/phone.js +0 -0
  158. package/extend/dobo/feature/site-id.js +0 -0
  159. package/extend/dobo/feature/site-ids.js +0 -0
  160. package/extend/dobo/feature/slug.js +0 -0
  161. package/extend/dobo/feature/social.js +0 -0
  162. package/extend/dobo/feature/status.js +0 -0
  163. package/extend/dobo/feature/team-id.js +0 -0
  164. package/extend/dobo/feature/team-ids.js +0 -0
  165. package/extend/dobo/feature/ts.js +0 -0
  166. package/extend/dobo/feature/url.js +0 -0
  167. package/extend/dobo/feature/user-id.js +0 -0
  168. package/extend/dobo/fixture/contact-form-cat.json +0 -0
  169. package/extend/dobo/fixture/site.json +0 -0
  170. package/extend/dobo/fixture/team-user.json +0 -0
  171. package/extend/dobo/fixture/team.json +0 -0
  172. package/extend/dobo/fixture/ticket-cat.json +0 -0
  173. package/extend/dobo/fixture/user.json +0 -0
  174. package/extend/dobo/model.js +303 -303
  175. package/extend/dobo/model.json +161 -161
  176. package/extend/masohiSocketIo/middleware/server/auth.js +0 -0
  177. package/extend/sumba/route/anonymous.json +5 -5
  178. package/extend/sumba/route/secure.json +8 -8
  179. package/extend/waibuBootstrap/theme/component/widget/nav-dropdown-user.js +0 -0
  180. package/extend/waibuDb/schema/anonymous-guard.js +0 -0
  181. package/extend/waibuDb/schema/attrib-guard.js +0 -0
  182. package/extend/waibuDb/schema/contact-form-cat.json +0 -0
  183. package/extend/waibuDb/schema/contact-form.json +0 -0
  184. package/extend/waibuDb/schema/download.js +0 -0
  185. package/extend/waibuDb/schema/model-guard.js +0 -0
  186. package/extend/waibuDb/schema/secure-guard.js +0 -0
  187. package/extend/waibuDb/schema/site-setting.js +0 -0
  188. package/extend/waibuDb/schema/site.js +0 -0
  189. package/extend/waibuDb/schema/team-setting.js +0 -0
  190. package/extend/waibuDb/schema/team-user.js +0 -0
  191. package/extend/waibuDb/schema/team.json +0 -0
  192. package/extend/waibuDb/schema/ticket-cat.json +0 -0
  193. package/extend/waibuDb/schema/ticket.js +0 -0
  194. package/extend/waibuDb/schema/user-setting.js +0 -0
  195. package/extend/waibuDb/schema/user.js +0 -0
  196. package/extend/waibuMpa/extend/waibuAdmin/route/action-guard/@action.js +0 -0
  197. package/extend/waibuMpa/extend/waibuAdmin/route/anonymous-guard/@action.js +0 -0
  198. package/extend/waibuMpa/extend/waibuAdmin/route/attrib-guard/@action.js +0 -0
  199. package/extend/waibuMpa/extend/waibuAdmin/route/contact-form/@action.js +0 -0
  200. package/extend/waibuMpa/extend/waibuAdmin/route/contact-form-cat/@action.js +0 -0
  201. package/extend/waibuMpa/extend/waibuAdmin/route/download/@action.js +0 -0
  202. package/extend/waibuMpa/extend/waibuAdmin/route/query-guard/@action.js +0 -0
  203. package/extend/waibuMpa/extend/waibuAdmin/route/reset-user-password.js +0 -0
  204. package/extend/waibuMpa/extend/waibuAdmin/route/secure-guard/@action.js +0 -0
  205. package/extend/waibuMpa/extend/waibuAdmin/route/site-setting/@action.js +0 -0
  206. package/extend/waibuMpa/extend/waibuAdmin/route/site.js +0 -0
  207. package/extend/waibuMpa/extend/waibuAdmin/route/team/@action.js +0 -0
  208. package/extend/waibuMpa/extend/waibuAdmin/route/team-setting/@action.js +0 -0
  209. package/extend/waibuMpa/extend/waibuAdmin/route/team-user/@action.js +0 -0
  210. package/extend/waibuMpa/extend/waibuAdmin/route/ticket/@action.js +0 -0
  211. package/extend/waibuMpa/extend/waibuAdmin/route/ticket-cat/@action.js +0 -0
  212. package/extend/waibuMpa/extend/waibuAdmin/route/user/@action.js +0 -0
  213. package/extend/waibuMpa/extend/waibuAdmin/route/user-setting/@action.js +0 -0
  214. package/extend/waibuMpa/extend/waibuAdmin/route/x/cache/@action.js +0 -0
  215. package/extend/waibuMpa/extend/waibuAdmin/route/x/session/@action.js +0 -0
  216. package/extend/waibuMpa/extend/waibuAdmin/route/x/site/@action.js +0 -0
  217. package/extend/waibuMpa/extend/waibuAdmin/route/x/site-setting/@action.js +0 -0
  218. package/extend/waibuMpa/route/access-token.js +0 -0
  219. package/extend/waibuMpa/route/help/contact-form.js +0 -0
  220. package/extend/waibuMpa/route/help/trouble-tickets/add.js +0 -0
  221. package/extend/waibuMpa/route/help/trouble-tickets/details/@id.js +0 -0
  222. package/extend/waibuMpa/route/help/trouble-tickets/list.js +0 -0
  223. package/extend/waibuMpa/route/info/@item.js +0 -0
  224. package/extend/waibuMpa/route/signin.js +0 -0
  225. package/extend/waibuMpa/route/signout.js +0 -0
  226. package/extend/waibuMpa/route/user/activation.js +0 -0
  227. package/extend/waibuMpa/route/user/forgot-password/@fpl.js +0 -0
  228. package/extend/waibuMpa/route/user/forgot-password.js +0 -0
  229. package/extend/waibuMpa/route/user/signup.js +0 -0
  230. package/extend/waibuMpa/route/your-stuff/change-password.js +0 -0
  231. package/extend/waibuMpa/route/your-stuff/download/@action.js +0 -0
  232. package/extend/waibuMpa/route/your-stuff/download/get.js +0 -0
  233. package/extend/waibuMpa/route/your-stuff/profile/edit.js +0 -0
  234. package/extend/waibuMpa/route/your-stuff/profile.js +0 -0
  235. package/extend/waibuMpa/route/your-stuff/reset-api-key.js +0 -0
  236. package/extend/waibuRestApi/route/info/get.js +0 -0
  237. package/extend/waibuRestApi/route/manage/anonymous-guard/model-builder.json +0 -0
  238. package/extend/waibuRestApi/route/manage/secure-guard/model-builder.json +0 -0
  239. package/extend/waibuRestApi/route/manage/team/model-builder.json +0 -0
  240. package/extend/waibuRestApi/route/manage/ticket-cat/model-builder.json +0 -0
  241. package/extend/waibuRestApi/route/manage/user/model-builder.json +0 -0
  242. package/extend/waibuRestApi/route/user/access-token/@type/create.js +0 -0
  243. package/extend/waibuRestApi/route/user/api-key/get.js +0 -0
  244. package/extend/waibuRestApi/route/your-stuff/api-key/get.js +0 -0
  245. package/extend/waibuRestApi/route/your-stuff/api-key/update.js +0 -0
  246. package/extend/waibuRestApi/route/your-stuff/change-password/update.js +0 -0
  247. package/extend/waibuRestApi/route/your-stuff/profile/get.js +0 -0
  248. package/extend/waibuRestApi/route/your-stuff/profile/update.js +0 -0
  249. package/extend/waibuSocketIo/middleware/server/auth.js +0 -0
  250. package/extend/waibuStatic/asset/user-profile.png +0 -0
  251. package/index.js +2 -1
  252. package/lib/config.js +202 -202
  253. package/lib/constant.js +0 -0
  254. package/logo.png +0 -0
  255. package/package.json +1 -1
  256. package/wiki/CHANGES.md +391 -383
  257. package/wiki/CONFIG.md +0 -0
  258. package/wiki/CONTRIBUTING.md +0 -0
  259. package/wiki/DEV-GUIDE.md +0 -0
  260. package/wiki/ECOSYSTEM.md +0 -0
  261. package/wiki/GETTING-STARTED.md +0 -0
  262. package/wiki/USER-GUIDE.md +0 -0
@@ -1,54 +1,54 @@
1
- async function populateModelWithSite (path, ...args) {
2
- const { getModel } = this.app.dobo
3
- const { importPkg } = this.app.bajo
4
- const { isArray, has } = this.app.lib._
5
- const confirm = await importPkg('bajoCli:@inquirer/confirm')
6
- let [modelName, alias, keys] = args
7
- if (!modelName) this.print.fatal('modelRequired')
8
- if (!alias) this.print.fatal('aliasRequired')
9
- const model = getModel(modelName, true)
10
- if (!model) this.print.fatal('modelNotFound%s', modelName)
11
- if (!model.hasProperty('siteId')) this.print.fatal('noSiteIdProperty%s', modelName)
12
- const answer = await confirm({ message: this.print.buildText('aboutToRebuildModelWithSite%s%s', modelName, alias), default: false })
13
- if (!answer) {
14
- this.print.fail('aborted')
15
- this.app.exit()
16
- }
17
- if (alias.includes(',')) alias = alias.split(',').map(item => item.trim())
18
- keys = keys ? keys.split(',').map(item => item.trim()) : []
19
- await this.app.dobo.start()
20
- try {
21
- const fixtures = await model.loadFixtures({ ignoreError: false, collectItems: true })
22
- const siteModel = getModel('SumbaSite')
23
- let sites = []
24
- if (['all', '*'].includes(alias)) {
25
- sites = await siteModel.findAllRecord({}, { dataOnly: true, fields: ['id', 'hostname'] })
26
- } else {
27
- if (!isArray(alias)) alias = [alias]
28
- sites = await siteModel.findAllRecord({ query: { alias: { $in: alias } } }, { dataOnly: true, fields: ['id', 'hostname'] })
29
- }
30
- await model.transaction(async (trx) => {
31
- for (const site of sites) {
32
- for (const fixture of fixtures) {
33
- const siteId = site.id + ''
34
- fixture.siteId = siteId
35
- const query = { siteId }
36
- for (const key of keys) {
37
- if (has(fixture, key)) query[key] = fixture[key]
38
- }
39
- const results = await model.findAllRecord({ query }, { fields: ['id'], trx })
40
- for (const rec of results) {
41
- await model.removeRecord(rec.id, { noCache: true, noResult: true, trx, throwNotFound: false })
42
- }
43
- await model.createRecord(fixture, { noCache: true, noResult: true, trx })
44
- }
45
- this.print.info('modelPopulated%s%s', site.hostname, fixtures.length)
46
- }
47
- })
48
- } catch (err) {
49
- this.print.fatal(err)
50
- }
51
- this.app.exit()
52
- }
53
-
54
- export default populateModelWithSite
1
+ async function populateModelWithSite (path, ...args) {
2
+ const { getModel } = this.app.dobo
3
+ const { importPkg } = this.app.bajo
4
+ const { isArray, has } = this.app.lib._
5
+ const confirm = await importPkg('bajoCli:@inquirer/confirm')
6
+ let [modelName, alias, keys] = args
7
+ if (!modelName) this.print.fatal('modelRequired')
8
+ if (!alias) this.print.fatal('aliasRequired')
9
+ const model = getModel(modelName, true)
10
+ if (!model) this.print.fatal('modelNotFound%s', modelName)
11
+ if (!model.hasProperty('siteId')) this.print.fatal('noSiteIdProperty%s', modelName)
12
+ const answer = await confirm({ message: this.print.buildText('aboutToRebuildModelWithSite%s%s', modelName, alias), default: false })
13
+ if (!answer) {
14
+ this.print.fail('aborted')
15
+ this.app.exit()
16
+ }
17
+ if (alias.includes(',')) alias = alias.split(',').map(item => item.trim())
18
+ keys = keys ? keys.split(',').map(item => item.trim()) : []
19
+ await this.app.dobo.start()
20
+ try {
21
+ const fixtures = await model.loadFixtures({ ignoreError: false, collectItems: true })
22
+ const siteModel = getModel('SumbaSite')
23
+ let sites = []
24
+ if (['all', '*'].includes(alias)) {
25
+ sites = await siteModel.findAllRecord({}, { dataOnly: true, fields: ['id', 'hostname'] })
26
+ } else {
27
+ if (!isArray(alias)) alias = [alias]
28
+ sites = await siteModel.findAllRecord({ query: { alias: { $in: alias } } }, { dataOnly: true, fields: ['id', 'hostname'] })
29
+ }
30
+ await model.transaction(async (trx) => {
31
+ for (const site of sites) {
32
+ for (const fixture of fixtures) {
33
+ const siteId = site.id + ''
34
+ fixture.siteId = siteId
35
+ const query = { siteId }
36
+ for (const key of keys) {
37
+ if (has(fixture, key)) query[key] = fixture[key]
38
+ }
39
+ const results = await model.findAllRecord({ query }, { fields: ['id'], trx })
40
+ for (const rec of results) {
41
+ await model.removeRecord(rec.id, { noCache: true, noResult: true, trx, throwNotFound: false })
42
+ }
43
+ await model.createRecord(fixture, { noCache: true, noResult: true, trx })
44
+ }
45
+ this.print.info('modelPopulated%s%s', site.hostname, fixtures.length)
46
+ }
47
+ })
48
+ } catch (err) {
49
+ this.print.fatal(err)
50
+ }
51
+ this.app.exit()
52
+ }
53
+
54
+ export default populateModelWithSite
@@ -1,20 +1,20 @@
1
- async function removeSite (path, ...args) {
2
- const { importPkg } = this.app.bajo
3
- const { removeSite } = this.app.sumba
4
- const confirm = await importPkg('bajoCli:@inquirer/confirm')
5
- const [alias] = args
6
- const answer = await confirm({ message: this.print.buildText('aboutToDeleteSite%s', alias), default: false })
7
- if (!answer) {
8
- this.print.fail('aborted')
9
- this.app.exit()
10
- }
11
- await this.app.dobo.start()
12
- try {
13
- await removeSite(alias, true)
14
- } catch (err) {
15
- this.print.fatal(err.message)
16
- }
17
- this.app.exit()
18
- }
19
-
20
- export default removeSite
1
+ async function removeSite (path, ...args) {
2
+ const { importPkg } = this.app.bajo
3
+ const { removeSite } = this.app.sumba
4
+ const confirm = await importPkg('bajoCli:@inquirer/confirm')
5
+ const [alias] = args
6
+ const answer = await confirm({ message: this.print.buildText('aboutToDeleteSite%s', alias), default: false })
7
+ if (!answer) {
8
+ this.print.fail('aborted')
9
+ this.app.exit()
10
+ }
11
+ await this.app.dobo.start()
12
+ try {
13
+ await removeSite(alias, true)
14
+ } catch (err) {
15
+ this.print.fatal(err.message)
16
+ }
17
+ this.app.exit()
18
+ }
19
+
20
+ export default removeSite
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes