sumba 2.0.0 → 2.1.0

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 (280) hide show
  1. package/.github/FUNDING.yml +13 -0
  2. package/.github/workflows/repo-lockdown.yml +24 -0
  3. package/.jsdoc.conf.json +45 -0
  4. package/LICENSE +1 -1
  5. package/README.md +40 -7
  6. package/docs/Sumba.html +3 -0
  7. package/docs/data/search.json +1 -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 +3 -0
  12. package/docs/index.html +3 -0
  13. package/docs/index.js.html +538 -0
  14. package/docs/scripts/core.js +726 -0
  15. package/docs/scripts/core.min.js +23 -0
  16. package/docs/scripts/resize.js +90 -0
  17. package/docs/scripts/search.js +265 -0
  18. package/docs/scripts/search.min.js +6 -0
  19. package/docs/scripts/third-party/Apache-License-2.0.txt +202 -0
  20. package/docs/scripts/third-party/fuse.js +9 -0
  21. package/docs/scripts/third-party/hljs-line-num-original.js +369 -0
  22. package/docs/scripts/third-party/hljs-line-num.js +1 -0
  23. package/docs/scripts/third-party/hljs-original.js +5171 -0
  24. package/docs/scripts/third-party/hljs.js +1 -0
  25. package/docs/scripts/third-party/popper.js +5 -0
  26. package/docs/scripts/third-party/tippy.js +1 -0
  27. package/docs/scripts/third-party/tocbot.js +672 -0
  28. package/docs/scripts/third-party/tocbot.min.js +1 -0
  29. package/docs/static/bitcoin.jpeg +0 -0
  30. package/docs/static/home.md +25 -0
  31. package/docs/static/logo-ecosystem.png +0 -0
  32. package/docs/static/logo.png +0 -0
  33. package/docs/styles/clean-jsdoc-theme-base.css +1159 -0
  34. package/docs/styles/clean-jsdoc-theme-dark.css +412 -0
  35. package/docs/styles/clean-jsdoc-theme-light.css +482 -0
  36. package/docs/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  37. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  38. package/docs/styles/clean-jsdoc-theme.min.css +1 -0
  39. package/extend/bajo/hook/{dobo.sumba-contact-form@after-record-create.js → dobo.sumba-contact-form@after-create-record.js} +3 -3
  40. package/extend/bajo/hook/{dobo.sumba-contact-form@before-record-create.js → dobo.sumba-contact-form@before-create-record.js} +3 -3
  41. package/extend/bajo/hook/{dobo.sumba-user@after-record-create.js → dobo.sumba-user@after-create-record.js} +3 -3
  42. package/extend/bajo/hook/dobo.sumba-user@after-record-validation.js +3 -3
  43. package/extend/bajo/hook/{dobo.sumba-user@after-record-update.js → dobo.sumba-user@after-update-record.js} +5 -5
  44. package/extend/bajo/hook/{dobo.sumba-user@before-record-create.js → dobo.sumba-user@before-create-record.js} +2 -2
  45. package/extend/bajo/hook/dobo.sumba-user@before-record-validation.js +3 -3
  46. package/extend/bajo/hook/{dobo.sumba-user@before-record-update.js → dobo.sumba-user@before-update-record.js} +2 -2
  47. package/extend/bajo/hook/dobo@before-count-record.js +8 -0
  48. package/extend/bajo/hook/{dobo@before-record-create.js → dobo@before-create-record.js} +6 -6
  49. package/extend/bajo/hook/dobo@before-find-one-record.js +8 -0
  50. package/extend/bajo/hook/{dobo@before-record-find.js → dobo@before-find-record.js} +10 -10
  51. package/extend/bajo/hook/dobo@before-get-record.js +23 -0
  52. package/extend/bajo/hook/dobo@before-remove-record.js +10 -0
  53. package/extend/bajo/hook/dobo@before-update-record.js +10 -0
  54. package/extend/bajo/hook/waibu-mpa.sumba@after-build-locals.js +0 -0
  55. package/extend/bajo/hook/waibu-mpa@pre-parsing.js +0 -0
  56. package/extend/bajo/hook/waibu-rest-api@pre-parsing.js +0 -0
  57. package/extend/bajo/hook/waibu-static@pre-parsing.js +0 -0
  58. package/extend/bajo/hook/waibu@after-app-boot.js +2 -2
  59. package/extend/bajo/hook/waibu@after-create-context.js +0 -0
  60. package/extend/bajo/hook/waibu@on-request.js +0 -0
  61. package/extend/bajo/intl/en-US.json +1 -0
  62. package/extend/bajo/intl/id.json +0 -0
  63. package/extend/bajoTemplate/layout/centered.html +0 -0
  64. package/extend/bajoTemplate/layout/default.html +0 -0
  65. package/extend/bajoTemplate/layout/error.html +0 -0
  66. package/extend/bajoTemplate/layout/info.html +0 -0
  67. package/extend/bajoTemplate/partial/403.html +0 -0
  68. package/extend/bajoTemplate/partial/_admin/reset-user-password.html +0 -0
  69. package/extend/bajoTemplate/partial/_mail/help-contact-form.html +0 -0
  70. package/extend/bajoTemplate/partial/_mail/help-contact-form.id.html +0 -0
  71. package/extend/bajoTemplate/partial/_mail/mystuff-change-password.html +0 -0
  72. package/extend/bajoTemplate/partial/_mail/mystuff-change-password.id.html +0 -0
  73. package/extend/bajoTemplate/partial/_mail/mystuff-reset-api-key.html +0 -0
  74. package/extend/bajoTemplate/partial/_mail/mystuff-reset-api-key.id.html +0 -0
  75. package/extend/bajoTemplate/partial/_mail/user-activation-success.html +0 -0
  76. package/extend/bajoTemplate/partial/_mail/user-activation-success.id.html +0 -0
  77. package/extend/bajoTemplate/partial/_mail/user-forgot-password-changed.html +0 -0
  78. package/extend/bajoTemplate/partial/_mail/user-forgot-password-changed.id.html +0 -0
  79. package/extend/bajoTemplate/partial/_mail/user-forgot-password-link.html +0 -0
  80. package/extend/bajoTemplate/partial/_mail/user-forgot-password-link.id.html +0 -0
  81. package/extend/bajoTemplate/partial/_mail/user-signup-success-active.html +0 -0
  82. package/extend/bajoTemplate/partial/_mail/user-signup-success-active.id.html +0 -0
  83. package/extend/bajoTemplate/partial/_mail/user-signup-success.html +0 -0
  84. package/extend/bajoTemplate/partial/_mail/user-signup-success.id.html +0 -0
  85. package/extend/bajoTemplate/partial/api-key-modal.html +0 -0
  86. package/extend/bajoTemplate/partial/app-launcher.html +0 -0
  87. package/extend/bajoTemplate/partial/help/contact-form/form.html +0 -0
  88. package/extend/bajoTemplate/partial/help/contact-form/success.html +0 -0
  89. package/extend/bajoTemplate/partial/help/trouble-tickets/add.html +0 -0
  90. package/extend/bajoTemplate/partial/help/trouble-tickets/details.html +0 -0
  91. package/extend/bajoTemplate/partial/help/trouble-tickets/list.html +0 -0
  92. package/extend/bajoTemplate/partial/layout/address.html +0 -0
  93. package/extend/bajoTemplate/partial/layout/breadcrumb.html +0 -0
  94. package/extend/bajoTemplate/partial/layout/footer.html +0 -0
  95. package/extend/bajoTemplate/partial/layout/more-info.html +0 -0
  96. package/extend/bajoTemplate/partial/layout/more-info.id.html +0 -0
  97. package/extend/bajoTemplate/partial/layout/navbar.html +0 -0
  98. package/extend/bajoTemplate/partial/layout/sidebar.html +0 -0
  99. package/extend/bajoTemplate/partial/layout/socmed.html +0 -0
  100. package/extend/bajoTemplate/partial/list-item/change-password.html +0 -0
  101. package/extend/bajoTemplate/partial/list-item/forgot-password.html +0 -0
  102. package/extend/bajoTemplate/partial/list-item/goto-home.html +0 -0
  103. package/extend/bajoTemplate/partial/list-item/member-links.html +0 -0
  104. package/extend/bajoTemplate/partial/list-item/oauth-signin.html +0 -0
  105. package/extend/bajoTemplate/partial/list-item/signin.html +0 -0
  106. package/extend/bajoTemplate/partial/list-item/signout.html +0 -0
  107. package/extend/bajoTemplate/partial/list-item/user-signup.html +0 -0
  108. package/extend/bajoTemplate/partial/list-item/your-profile.html +0 -0
  109. package/extend/bajoTemplate/partial/signin.html +0 -0
  110. package/extend/bajoTemplate/partial/signout.html +0 -0
  111. package/extend/bajoTemplate/partial/user/activation.html +0 -0
  112. package/extend/bajoTemplate/partial/user/forgot-password-nomail.id.md +0 -0
  113. package/extend/bajoTemplate/partial/user/forgot-password-nomail.md +0 -0
  114. package/extend/bajoTemplate/partial/user/forgot-password.html +0 -0
  115. package/extend/bajoTemplate/partial/user/fpl-invalid.html +0 -0
  116. package/extend/bajoTemplate/partial/user/fpl-invalid.id.md +0 -0
  117. package/extend/bajoTemplate/partial/user/fpl-invalid.md +0 -0
  118. package/extend/bajoTemplate/partial/user/fpl.html +0 -0
  119. package/extend/bajoTemplate/partial/user/signup/form.html +0 -0
  120. package/extend/bajoTemplate/partial/user/signup/success-mail.id.md +0 -0
  121. package/extend/bajoTemplate/partial/user/signup/success-mail.md +0 -0
  122. package/extend/bajoTemplate/partial/user/signup/success-nomail.id.md +0 -0
  123. package/extend/bajoTemplate/partial/user/signup/success-nomail.md +0 -0
  124. package/extend/bajoTemplate/partial/user/signup/success.html +0 -0
  125. package/extend/bajoTemplate/partial/your-stuff/change-password.html +0 -0
  126. package/extend/bajoTemplate/partial/your-stuff/profile/edit.html +0 -0
  127. package/extend/bajoTemplate/partial/your-stuff/profile/view.html +0 -0
  128. package/extend/bajoTemplate/partial/your-stuff/reset-api-key.html +0 -0
  129. package/extend/bajoTemplate/template/403.html +0 -0
  130. package/extend/bajoTemplate/template/_admin/reset-user-password.html +0 -0
  131. package/extend/bajoTemplate/template/_mail/help-contact-form.html +0 -0
  132. package/extend/bajoTemplate/template/_mail/mystuff-change-password.html +0 -0
  133. package/extend/bajoTemplate/template/_mail/mystuff-reset-api-key.html +0 -0
  134. package/extend/bajoTemplate/template/_mail/user-activation-success.html +0 -0
  135. package/extend/bajoTemplate/template/_mail/user-forgot-password-changed.html +0 -0
  136. package/extend/bajoTemplate/template/_mail/user-forgot-password-link.html +0 -0
  137. package/extend/bajoTemplate/template/_mail/user-signup-success-active.html +0 -0
  138. package/extend/bajoTemplate/template/_mail/user-signup-success.html +0 -0
  139. package/extend/bajoTemplate/template/help/contact-form/form.html +0 -0
  140. package/extend/bajoTemplate/template/help/contact-form/success.html +0 -0
  141. package/extend/bajoTemplate/template/help/trouble-tickets/add.html +0 -0
  142. package/extend/bajoTemplate/template/help/trouble-tickets/details.html +0 -0
  143. package/extend/bajoTemplate/template/help/trouble-tickets/list.html +0 -0
  144. package/extend/bajoTemplate/template/info/about-us.md +0 -0
  145. package/extend/bajoTemplate/template/info/cookie-policy.md +0 -0
  146. package/extend/bajoTemplate/template/info/privacy.md +0 -0
  147. package/extend/bajoTemplate/template/info/terms-conditions.md +0 -0
  148. package/extend/bajoTemplate/template/signin.html +0 -0
  149. package/extend/bajoTemplate/template/signout.html +0 -0
  150. package/extend/bajoTemplate/template/user/activation.html +0 -0
  151. package/extend/bajoTemplate/template/user/forgot-password.html +0 -0
  152. package/extend/bajoTemplate/template/user/fpl-invalid.html +0 -0
  153. package/extend/bajoTemplate/template/user/fpl.html +0 -0
  154. package/extend/bajoTemplate/template/user/signup/form.html +0 -0
  155. package/extend/bajoTemplate/template/user/signup/success.html +0 -0
  156. package/extend/bajoTemplate/template/your-stuff/change-password.html +0 -0
  157. package/extend/bajoTemplate/template/your-stuff/profile/edit.html +0 -0
  158. package/extend/bajoTemplate/template/your-stuff/profile/view.html +0 -0
  159. package/extend/bajoTemplate/template/your-stuff/reset-api-key.html +0 -0
  160. package/extend/dobo/feature/address.js +1 -1
  161. package/extend/dobo/feature/category.js +0 -0
  162. package/extend/dobo/feature/country.js +1 -1
  163. package/extend/dobo/feature/email.js +0 -0
  164. package/extend/dobo/feature/lat-lng.js +3 -3
  165. package/extend/dobo/feature/lat.js +2 -2
  166. package/extend/dobo/feature/lng.js +2 -2
  167. package/extend/dobo/feature/person-in-charge.js +0 -0
  168. package/extend/dobo/feature/phone.js +0 -0
  169. package/extend/dobo/feature/site-id.js +3 -3
  170. package/extend/dobo/feature/slug.js +7 -8
  171. package/extend/dobo/feature/social.js +0 -0
  172. package/extend/dobo/feature/status.js +2 -2
  173. package/extend/dobo/feature/team-id.js +3 -3
  174. package/extend/dobo/feature/ts.js +0 -0
  175. package/extend/dobo/feature/url.js +6 -6
  176. package/extend/dobo/feature/user-id.js +5 -5
  177. package/extend/dobo/fixture/contact-form-cat.json +0 -0
  178. package/extend/dobo/fixture/site.json +0 -4
  179. package/extend/dobo/fixture/team-user.json +0 -0
  180. package/extend/dobo/fixture/team.json +2 -1
  181. package/extend/dobo/fixture/ticket-cat.json +0 -0
  182. package/extend/dobo/fixture/user.json +0 -0
  183. package/extend/dobo/model/contact-form-cat.json +3 -0
  184. package/extend/dobo/model/contact-form.json +16 -0
  185. package/extend/dobo/model/download.json +19 -0
  186. package/extend/dobo/model/site-setting.json +8 -0
  187. package/extend/dobo/{schema → model}/site.json +4 -8
  188. package/extend/dobo/{schema → model}/team-user.json +5 -10
  189. package/extend/dobo/model/team.json +15 -0
  190. package/extend/dobo/model/ticket-cat.json +3 -0
  191. package/extend/dobo/model/ticket-detail.json +7 -0
  192. package/extend/dobo/model/ticket.json +18 -0
  193. package/extend/dobo/{schema → model}/user.json +14 -11
  194. package/extend/masohiSocketIo/middleware/server/auth.js +1 -1
  195. package/extend/sumba/route/anonymous.json +0 -0
  196. package/extend/sumba/route/secure.json +0 -0
  197. package/extend/waibuBootstrap/theme/component/factory/nav-dropdown-user.js +5 -5
  198. package/extend/waibuDb/schema/contact-form-cat.json +0 -0
  199. package/extend/waibuDb/schema/contact-form.json +0 -0
  200. package/extend/waibuDb/schema/download.js +1 -1
  201. package/extend/waibuDb/schema/site.json +2 -2
  202. package/extend/waibuDb/schema/team-user.js +2 -2
  203. package/extend/waibuDb/schema/team.json +0 -0
  204. package/extend/waibuDb/schema/ticket-cat.json +0 -0
  205. package/extend/waibuDb/schema/user.json +0 -0
  206. package/extend/waibuMpa/extend/waibuAdmin/route/contact-form/@action.js +0 -0
  207. package/extend/waibuMpa/extend/waibuAdmin/route/contact-form-cat/@action.js +0 -0
  208. package/extend/waibuMpa/extend/waibuAdmin/route/download/@action.js +0 -0
  209. package/extend/waibuMpa/extend/waibuAdmin/route/reset-user-password.js +5 -6
  210. package/extend/waibuMpa/extend/waibuAdmin/route/session/@action.js +0 -0
  211. package/extend/waibuMpa/extend/waibuAdmin/route/site.js +25 -0
  212. package/extend/waibuMpa/extend/waibuAdmin/route/team/@action.js +0 -0
  213. package/extend/waibuMpa/extend/waibuAdmin/route/team-user/@action.js +0 -0
  214. package/extend/waibuMpa/extend/waibuAdmin/route/ticket/@action.js +0 -0
  215. package/extend/waibuMpa/extend/waibuAdmin/route/ticket-cat/@action.js +0 -0
  216. package/extend/waibuMpa/extend/waibuAdmin/route/user/@action.js +0 -0
  217. package/extend/waibuMpa/route/access-token.js +1 -2
  218. package/extend/waibuMpa/route/help/contact-form.js +5 -5
  219. package/extend/waibuMpa/route/help/trouble-tickets/add.js +4 -4
  220. package/extend/waibuMpa/route/help/trouble-tickets/details/@id.js +5 -5
  221. package/extend/waibuMpa/route/help/trouble-tickets/list.js +2 -2
  222. package/extend/waibuMpa/route/info/@item.js +0 -0
  223. package/extend/waibuMpa/route/signin.js +0 -0
  224. package/extend/waibuMpa/route/signout.js +1 -14
  225. package/extend/waibuMpa/route/user/activation.js +4 -6
  226. package/extend/waibuMpa/route/user/forgot-password/@fpl.js +9 -10
  227. package/extend/waibuMpa/route/user/forgot-password.js +5 -7
  228. package/extend/waibuMpa/route/user/signup.js +4 -4
  229. package/extend/waibuMpa/route/your-stuff/change-password.js +5 -6
  230. package/extend/waibuMpa/route/your-stuff/download/@action.js +0 -0
  231. package/extend/waibuMpa/route/your-stuff/download/get.js +0 -0
  232. package/extend/waibuMpa/route/your-stuff/profile/edit.js +5 -5
  233. package/extend/waibuMpa/route/your-stuff/profile.js +2 -2
  234. package/extend/waibuMpa/route/your-stuff/reset-api-key.js +8 -9
  235. package/extend/waibuRestApi/route/info/get.js +2 -2
  236. package/extend/waibuRestApi/route/manage/team/model-builder.json +0 -0
  237. package/extend/waibuRestApi/route/manage/user/model-builder.json +0 -0
  238. package/extend/waibuRestApi/route/user/access-token/@type/create.js +0 -0
  239. package/extend/waibuRestApi/route/user/api-key/get.js +1 -2
  240. package/extend/waibuRestApi/route/your-stuff/api-key/get.js +1 -2
  241. package/extend/waibuRestApi/route/your-stuff/api-key/update.js +5 -6
  242. package/extend/waibuRestApi/route/your-stuff/change-password/update.js +2 -3
  243. package/extend/waibuRestApi/route/your-stuff/profile/get.js +2 -2
  244. package/extend/waibuRestApi/route/your-stuff/profile/update.js +3 -3
  245. package/extend/waibuSocketIo/middleware/server/auth.js +2 -3
  246. package/extend/waibuStatic/asset/user-profile.png +0 -0
  247. package/index.js +78 -54
  248. package/lib/check-iconset.js +4 -6
  249. package/lib/check-team.js +1 -1
  250. package/lib/check-theme.js +4 -7
  251. package/lib/check-user-id.js +4 -3
  252. package/lib/collect-redirects.js +0 -0
  253. package/lib/collect-routes.js +4 -4
  254. package/lib/collect-team.js +3 -3
  255. package/lib/lat-lng-hook.js +2 -2
  256. package/lib/password-rule.js +0 -0
  257. package/lib/reset-token.js +1 -1
  258. package/lib/token-schema.js +0 -0
  259. package/logo.png +0 -0
  260. package/package.json +41 -34
  261. package/wiki/CHANGES.md +6 -0
  262. package/wiki/CONFIG.md +2 -0
  263. package/wiki/CONTRIBUTING.md +5 -0
  264. package/wiki/DEV-GUIDE.md +1 -0
  265. package/wiki/ECOSYSTEM.md +28 -0
  266. package/wiki/GETTING-STARTED.md +1 -0
  267. package/wiki/USER-GUIDE.md +1 -0
  268. package/extend/bajo/hook/dobo@before-record-count.js +0 -8
  269. package/extend/bajo/hook/dobo@before-record-find-one.js +0 -8
  270. package/extend/bajo/hook/dobo@before-record-get.js +0 -23
  271. package/extend/bajo/hook/dobo@before-record-remove.js +0 -10
  272. package/extend/bajo/hook/dobo@before-record-update.js +0 -10
  273. package/extend/dobo/schema/contact-form-cat.json +0 -3
  274. package/extend/dobo/schema/contact-form.json +0 -20
  275. package/extend/dobo/schema/download.json +0 -24
  276. package/extend/dobo/schema/site-setting.json +0 -8
  277. package/extend/dobo/schema/team.json +0 -19
  278. package/extend/dobo/schema/ticket-cat.json +0 -3
  279. package/extend/dobo/schema/ticket-detail.json +0 -7
  280. package/extend/dobo/schema/ticket.json +0 -17
@@ -9,8 +9,8 @@ async function status (opts = {}) {
9
9
  values: opts.values ?? ['UNVERIFIED', 'ACTIVE', 'INACTIVE']
10
10
  }],
11
11
  hook: {
12
- beforeCreate: async function ({ body }) {
13
- const { isSet } = this.lib.aneka
12
+ beforeCreate: async function (body) {
13
+ const { isSet } = this.app.lib.aneka
14
14
  if (!isSet(body[opts.fieldName])) body[opts.fieldName] = opts.default
15
15
  }
16
16
  }
@@ -4,11 +4,11 @@ async function teamId (opts = {}) {
4
4
  name: 'teamId',
5
5
  type: 'string',
6
6
  maxLength: 50,
7
- rel: {
7
+ ref: {
8
8
  site: {
9
- schema: 'SumbaSite',
9
+ model: 'SumbaSite',
10
10
  propName: 'id',
11
- type: 'one-to-one'
11
+ type: '1:1'
12
12
  }
13
13
  },
14
14
  index: true
File without changes
@@ -1,5 +1,5 @@
1
- async function hook (schema, body, options) {
2
- const { isSet } = this.lib.aneka
1
+ async function hook (body, options) {
2
+ const { isSet } = this.app.lib.aneka
3
3
  let val = body[options.fieldName]
4
4
  if (!isSet(val)) return
5
5
  const [, ...params] = val.split('://')
@@ -16,11 +16,11 @@ async function url (opts = {}) {
16
16
  type: 'string'
17
17
  }],
18
18
  hook: {
19
- beforeCreate: async function ({ schema, body }) {
20
- await hook.call(this, schema, body, opts)
19
+ beforeCreate: async function (body) {
20
+ await hook.call(this, body, opts)
21
21
  },
22
- beforeUpdate: async function ({ schema, body }) {
23
- await hook.call(this, schema, body, opts)
22
+ beforeUpdate: async function (body) {
23
+ await hook.call(this, body, opts)
24
24
  }
25
25
  }
26
26
  }
@@ -5,16 +5,16 @@ async function userId (opts = {}) {
5
5
  name: opts.fieldName,
6
6
  type: 'string',
7
7
  maxLength: 50,
8
- rel: {
8
+ ref: {
9
9
  site: {
10
- schema: 'SumbaSite',
10
+ model: 'SumbaSite',
11
11
  propName: 'id',
12
- type: 'one-to-one'
12
+ type: '1:1'
13
13
  },
14
14
  user: {
15
- schema: 'SumbaUser',
15
+ model: 'SumbaUser',
16
16
  propName: 'id',
17
- type: 'one-to-one',
17
+ type: '1:1',
18
18
  fields: ['id', 'username', 'email', 'firstName', 'lastName']
19
19
  }
20
20
  },
File without changes
@@ -13,9 +13,5 @@
13
13
  "website": "http://www.your-domain.com",
14
14
  "phone": "+001-000000001",
15
15
  "waPhone": "+001-111111111",
16
- "socX": "XHandler",
17
- "socFacebook": "FBHandler",
18
- "socInstagram": "InstagramHandler",
19
- "socLinkedIn": "LIHandler",
20
16
  "status": "ACTIVE"
21
17
  }]
File without changes
@@ -2,5 +2,6 @@
2
2
  "alias": "administrator",
3
3
  "name": "Administrator",
4
4
  "siteId": "?:SumbaSite::alias:default",
5
- "status": "ENABLED"
5
+ "status": "ENABLED",
6
+ "_immutable": true
6
7
  }]
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ {
2
+ "features": ["sumba:category", "sumba:siteId"]
3
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "properties": [
3
+ "firstName,,50,true,true",
4
+ "lastName,,50,true,true",
5
+ "email,,50,true,true",
6
+ "cat,,50,true",
7
+ "subject,,255,,true",
8
+ "message,text"
9
+ ],
10
+ "features": [{
11
+ "name": "sumba:status",
12
+ "default": "NEW",
13
+ "values": ["NEW", "ACK"]
14
+ }, "sumba:userId", "sumba:siteId", "dobo:createdAt", "dobo:updatedAt"
15
+ ]
16
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "properties": [
3
+ "description,,50,true",
4
+ "file,text,,,true",
5
+ "type,,20,true",
6
+ "jobQueue,object",
7
+ {
8
+ "name": "size",
9
+ "type": "integer",
10
+ "default": 0,
11
+ "index": true
12
+ }
13
+ ],
14
+ "features": ["sumba:siteId", "sumba:userId", "dobo:createdAt", "dobo:updatedAt", {
15
+ "name": "sumba:status",
16
+ "default": "INQUEUE",
17
+ "values": ["INQUEUE", "PROCESSING", "COMPLETE", "FAIL"]
18
+ }]
19
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "properties": [
3
+ "ns,,50,true,true",
4
+ "key,,50,true,true",
5
+ "value,text"
6
+ ],
7
+ "features": ["sumba:siteId", "dobo:updatedAt"]
8
+ }
@@ -28,12 +28,8 @@
28
28
  "maxLength": 100,
29
29
  "rules": ["email"]
30
30
  }],
31
- "feature": {
32
- "sumba.personInCharge": true,
33
- "sumba.address": true,
34
- "sumba.social": true,
35
- "sumba.status": { "default": "ACTIVE" },
36
- "createdAt": true,
37
- "updatedAt": true
38
- }
31
+ "features": ["sumba:personInCharge", "sumba:address", "sumba:social", {
32
+ "name": "sumba:status",
33
+ "default": "ACTIVE"
34
+ }, "dobo:createdAt", "dobo:updatedAt"]
39
35
  }
@@ -4,23 +4,18 @@
4
4
  "type": "string",
5
5
  "maxLength": 50,
6
6
  "required": true,
7
- "rel": {
7
+ "ref": {
8
8
  "team": {
9
- "schema": "SumbaTeam",
9
+ "model": "SumbaTeam",
10
10
  "propName": "id",
11
- "type": "one-to-one",
11
+ "type": "1:1",
12
12
  "fields": ["id", "name"]
13
13
  }
14
14
  }
15
15
  }],
16
16
  "indexes": [{
17
17
  "fields": ["userId", "siteId", "teamId"],
18
- "unique": true
18
+ "type": "unique"
19
19
  }],
20
- "feature": {
21
- "createdAt": true,
22
- "updatedAt": true,
23
- "sumba.siteId": true,
24
- "sumba.userId": true
25
- }
20
+ "features": ["dobo:createdAt", "dobo:updatedAt", "sumba:siteId", "sumba:userId"]
26
21
  }
@@ -0,0 +1,15 @@
1
+ {
2
+ "properties": [
3
+ "alias,,20,,true",
4
+ "name,,50,true,true"
5
+ ],
6
+ "indexes": [{
7
+ "fields": ["alias", "siteId"],
8
+ "type": "unique"
9
+ }],
10
+ "features": ["dobo:createdAt", "dobo:updatedAt", "dobo:immutable", "sumba:siteId", {
11
+ "name": "sumba:status",
12
+ "default": "ENABLED",
13
+ "values": ["ENABLED", "DISABLED"]
14
+ }]
15
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "features": ["sumba:category", "sumba:siteId"]
3
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "properties": [
3
+ "masterId,,255,true,true",
4
+ "message,text"
5
+ ],
6
+ "features": ["dobo:createdAt", "sumba:userId", "sumba:siteId"]
7
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "properties": [
3
+ "subject,,255,true,true",
4
+ "cat,,50,true",
5
+ "message,text,,,true"
6
+ ],
7
+ "features": [
8
+ "dobo:createdAt",
9
+ "dobo:updatedAt",
10
+ "sumba:siteId",
11
+ "sumba:userId",
12
+ {
13
+ "name": "sumba:status",
14
+ "default": "OPEN",
15
+ "values": ["OPEN", "CLOSED"]
16
+ }
17
+ ]
18
+ }
@@ -46,21 +46,24 @@
46
46
  "required": true,
47
47
  "index": true
48
48
  }],
49
- "globalRules": [{ "rule": "trim", "fields": ["username", "firstName", "lastName"] }],
49
+ "rules": [{ "rule": "trim", "fields": ["username", "firstName", "lastName"] }],
50
50
  "indexes": [{
51
51
  "fields": ["username", "siteId"],
52
- "unique": true
52
+ "type": "unique"
53
53
  }, {
54
54
  "fields": ["email", "siteId"],
55
- "unique": true
55
+ "type": "unique"
56
56
  }],
57
57
  "hidden": ["password", "token"],
58
- "feature": {
59
- "sumba.address": true,
60
- "sumba.social": true,
61
- "sumba.status": { "default": "UNVERIFIED" },
62
- "sumba.siteId": true,
63
- "createdAt": true,
64
- "updatedAt": true
65
- }
58
+ "features": [
59
+ "sumba:address",
60
+ "sumba:social",
61
+ {
62
+ "name": "sumba:status",
63
+ "default": "UNVERIFIED"
64
+ },
65
+ "sumba:siteId",
66
+ "dobo:createdAt",
67
+ "dobo:updatedAt"
68
+ ]
66
69
  }
@@ -1,7 +1,7 @@
1
1
  const auth = {
2
2
  level: 5,
3
3
  handler: async function (socket) {
4
- const { camelCase } = this.lib._
4
+ const { camelCase } = this.app.lib._
5
5
  const { req } = socket
6
6
  const { session } = req
7
7
  const site = await this.getSite(session.siteId)
File without changes
File without changes
@@ -1,8 +1,8 @@
1
1
  async function navDropdownUser () {
2
2
  return class NavDropdownUser extends this.baseFactory {
3
3
  build = async () => {
4
- const { has, omit, find, filter } = this.plugin.lib._
5
- const { routePath } = this.plugin.app.waibu
4
+ const { has, omit, find, filter } = this.app.lib._
5
+ const { routePath } = this.app.waibu
6
6
  const { req } = this.component
7
7
  const icon = this.component.req.iconset ? await this.component.buildTag({ tag: 'icon', attr: { name: 'person' } }) : ''
8
8
  let text = ''
@@ -14,7 +14,7 @@ async function navDropdownUser () {
14
14
  } else text = req.t('guest')
15
15
  }
16
16
  const html = []
17
- const attr = omit(this.params.attr, ['text'])
17
+ const attr = omit(this.params.attr, ['text', 'noMenu'])
18
18
  attr.dropdown = true
19
19
  attr.content = `${icon} ${text}`
20
20
  if (this.params.attr.noMenu) {
@@ -22,7 +22,7 @@ async function navDropdownUser () {
22
22
  delete attr.dropdownMenu
23
23
  attr.href = routePath(this.component.req.user ? 'sumba:/your-stuff/profile' : 'sumba:/signin')
24
24
  } else {
25
- const menu = find(this.plugin.app.sumba.config.waibuMpa.menuHandler, { title: 'account' })
25
+ const menu = find(this.app.sumba.config.waibuMpa.menuHandler, { title: 'account' })
26
26
  if (menu) {
27
27
  const items = filter(menu.children, c => {
28
28
  if (!has(c, 'visible')) return true
@@ -53,7 +53,7 @@ async function navDropdownUser () {
53
53
  }
54
54
  }
55
55
  this.params.noTag = true
56
- this.params.html = await this.component.buildTag({ tag: 'navItem', attr, html: html.join('\n') })
56
+ this.params.html = await this.component.buildTag({ tag: 'navItem', attr, html: html.join('\n'), noEscape: true })
57
57
  }
58
58
  }
59
59
  }
File without changes
File without changes
@@ -8,7 +8,7 @@ async function download () {
8
8
  return await this.component.buildSentence(sentence)
9
9
  },
10
10
  size: function (val, rec) {
11
- const { formatByte } = this.plugin.app.bajoExtra
11
+ const { formatByte } = this.app.bajoExtra
12
12
  return formatByte(rec.size)
13
13
  }
14
14
  }
@@ -6,7 +6,7 @@
6
6
  { "name": "General", "fields": ["hostname", "alias", "title", "orgName", "email", "status:4-md 6-sm"] },
7
7
  { "name": "Person In Charge", "fields": ["picName:3-md 6-sm:Name", "picRole:3-md 6-sm:Role", "picPhone:3-md 6-sm:Phone", "picEmail:3-md 6-sm:Email"] },
8
8
  { "name": "Address", "fields": ["address1:12", "address2:12", "city:6-md 8-sm", "zipCode:2-md 4-sm", "provinceState:4-md", "country:6-md", "phone:6-md", "website:12"] },
9
- { "name": "Social Media", "fields": ["socX:3-md 6-sm", "socInstagram:3-md 6-sm", "socFacebook:3-md 6-sm", "linkedIn:3-md 6-sm"] }
9
+ { "name": "Social Media", "fields": ["socX:3-md 6-sm", "socInstagram:3-md 6-sm", "socFacebook:3-md 6-sm", "socLinkedIn:3-md 6-sm"] }
10
10
  ],
11
11
  "widget": {
12
12
  "country": {
@@ -28,7 +28,7 @@
28
28
  "noCloneBtn": true,
29
29
  "detailsHref": "waibuAdmin:/site/site"
30
30
  },
31
- "readonly": ["id", "createdAt", "updatedAt"]
31
+ "readonly": ["id", "createdAt", "updatedAt", "hostname"]
32
32
  }
33
33
  }
34
34
  }
@@ -11,10 +11,10 @@ async function teamUser () {
11
11
  ],
12
12
  valueFormatter: {
13
13
  user: (val, rec) => {
14
- return rec._rel.user.username
14
+ return rec._ref.user.username
15
15
  },
16
16
  team: (val, rec) => {
17
- return rec._rel.team.name
17
+ return rec._ref.team.name
18
18
  }
19
19
  },
20
20
  widget: {
File without changes
File without changes
File without changes
@@ -5,10 +5,9 @@ const resetUserPassword = {
5
5
  title: 'resetUserPassword',
6
6
  handler: async function (req, reply) {
7
7
  const { importPkg } = this.app.bajo
8
- const { recordFindOne, recordUpdate } = this.app.dobo
9
- const { defaultsDeep } = this.lib.aneka
8
+ const { defaultsDeep } = this.app.lib.aneka
10
9
  const Joi = await importPkg('dobo:joi')
11
- const model = 'SumbaUser'
10
+ const model = this.app.dobo.getModel('SumbaUser')
12
11
  const form = defaultsDeep(req.body, { username: req.query.username })
13
12
  let error
14
13
  if (req.method === 'POST') {
@@ -22,11 +21,11 @@ const resetUserPassword = {
22
21
  try {
23
22
  await schema.validateAsync(req.body, this.app.dobo.config.validationParams)
24
23
  } catch (err) {
25
- throw this.error('validationError', { details: err.details, values: err.values, ns: this.name, statusCode: 422, code: 'DB_VALIDATION' })
24
+ throw this.error('validationError', { details: err.details, values: err.values, ns: this.ns, statusCode: 422, code: 'DB_VALIDATION' })
26
25
  }
27
- const rec = await recordFindOne(model, { query: { username: req.body.username } })
26
+ const rec = await model.findOneRecord({ query: { username: req.body.username } })
28
27
  if (!rec) throw this.error('unknownUser', { details: [{ field: 'username', error: 'unknownUser' }], statusCode: 400 })
29
- await recordUpdate(model, rec.id, { password: req.body.password }, { req, reply })
28
+ await model.updateRecord(rec.id, { password: req.body.password }, { req, reply })
30
29
  form.password = ''
31
30
  form.verifyPassword = ''
32
31
  } catch (err) {
@@ -9,7 +9,32 @@ const manageSite = {
9
9
  const template = `waibuDb.template:/crud/${req.query.edit ? 'edit' : 'details'}.html`
10
10
  const model = 'SumbaSite'
11
11
  req.params.id = req.site.id
12
+ req.query.id = req.site.id
12
13
  req.params.base = ''
14
+ /*
15
+ const options = {
16
+ schema: {
17
+ view: {
18
+ details: {
19
+ control: {
20
+ noBackBtn: true,
21
+ noCloneBtn: true,
22
+ noDeleteBtn: true,
23
+ editHref: '?edit=1'
24
+ }
25
+ },
26
+ edit: {
27
+ control: {
28
+ noDetailsBtn: true,
29
+ noCloneBtn: true,
30
+ noDeleteBtn: true,
31
+ backHref: '?details=1'
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ */
13
38
  return await action.call(this, { req, reply, model, template })
14
39
  }
15
40
  }
@@ -1,9 +1,8 @@
1
1
  const apiToken = {
2
2
  method: 'POST',
3
3
  handler: async function (req, reply) {
4
- const { recordGet } = this.app.dobo
5
4
  if (!req.user) return ''
6
- const rec = await recordGet('SumbaUser', req.user.id, { forceNoHidden: true, noCache: true })
5
+ const rec = await this.app.dobo.getModel('SumbaUser').getRecord(req.user.id, { forceNoHidden: true, noCache: true })
7
6
  return (await this.createJwtFromUserRecord(rec)).token
8
7
  }
9
8
  }
@@ -1,23 +1,23 @@
1
1
  const contactForm = {
2
2
  method: ['GET', 'POST'],
3
3
  handler: async function (req, reply) {
4
- const { defaultsDeep } = this.lib.aneka
5
- const { pick } = this.lib._
6
- const { recordCreate, recordFind } = this.app.waibuDb
4
+ const { defaultsDeep } = this.app.lib.aneka
5
+ const { pick } = this.app.lib._
6
+ const { createRecord, findRecord } = this.app.waibuDb
7
7
 
8
8
  const def = req.user ? pick(req.user, ['firstName', 'lastName', 'email']) : {}
9
9
  const form = defaultsDeep(req.body, def)
10
10
  let error
11
11
  if (req.method === 'POST') {
12
12
  try {
13
- const { data } = await recordCreate({ model: 'SumbaContactForm', req, reply, options: { noFlash: true } })
13
+ const { data } = await createRecord({ model: 'SumbaContactForm', req, reply, options: { noFlash: true } })
14
14
  req.flash('notify', req.t('contactFormSubmitted'))
15
15
  return await reply.view('sumba.template:/help/contact-form/success.html', { form: req.body, data })
16
16
  } catch (err) {
17
17
  error = err
18
18
  }
19
19
  }
20
- const cats = await recordFind({ model: 'SumbaContactFormCat', req, options: { sort: 'level:1+name:1', limit: -1, dataOnly: true } })
20
+ const cats = await findRecord({ model: 'SumbaContactFormCat', req, options: { sort: 'level:1+name:1', limit: -1, dataOnly: true } })
21
21
  return await reply.view('sumba.template:/help/contact-form/form.html', { form, error, cats })
22
22
  }
23
23
  }
@@ -3,20 +3,20 @@ const model = 'SumbaTicket'
3
3
  const add = {
4
4
  method: ['GET', 'POST'],
5
5
  handler: async function (req, reply) {
6
- const { defaultsDeep } = this.lib.aneka
7
- const { recordCreate, recordFind } = this.app.waibuDb
6
+ const { defaultsDeep } = this.app.lib.aneka
7
+ const { createRecord, findRecord } = this.app.waibuDb
8
8
  const options = {}
9
9
  const form = defaultsDeep(req.body, {})
10
10
  let error
11
11
  if (req.method === 'POST') {
12
12
  try {
13
- await recordCreate({ model, req, reply, options })
13
+ await createRecord({ model, req, reply, options })
14
14
  return reply.redirectTo('sumba:/help/trouble-tickets/list')
15
15
  } catch (err) {
16
16
  error = err
17
17
  }
18
18
  }
19
- const cats = await recordFind({ model: 'SumbaTicketCat', req, options: { sort: 'level:1+name:1', limit: -1, dataOnly: true } })
19
+ const cats = await findRecord({ model: 'SumbaTicketCat', req, options: { sort: 'level:1+name:1', limit: -1, dataOnly: true } })
20
20
  return await reply.view('sumba.template:/help/trouble-tickets/add.html', { form, error, cats })
21
21
  }
22
22
  }
@@ -3,18 +3,18 @@ const model = 'SumbaTicketDetail'
3
3
  const id = {
4
4
  method: ['GET', 'POST'],
5
5
  handler: async function (req, reply) {
6
- const { cloneDeep } = this.lib._
7
- const { recordCreate, recordFind, getSchemaExt } = this.app.waibuDb
6
+ const { cloneDeep } = this.app.lib._
7
+ const { createRecord, findRecord, getSchemaExt } = this.app.waibuDb
8
8
  const { schema } = await getSchemaExt(model, 'list')
9
9
 
10
- const master = (await recordFind({ model: 'SumbaTicket', req, options: { dataOnly: true, query: { id: req.params.id }, limit: 1 } }))[0]
10
+ const master = (await findRecord({ model: 'SumbaTicket', req, options: { dataOnly: true, query: { id: req.params.id }, limit: 1 } }))[0]
11
11
  if (!master) throw this.error('_notFound')
12
12
  const form = cloneDeep(req.body)
13
13
  let error
14
14
  if (req.method === 'POST') {
15
15
  try {
16
16
  form.masterId = master.id + ''
17
- await recordCreate({ model: 'SumbaTicketDetail', req, body: form })
17
+ await createRecord({ model: 'SumbaTicketDetail', req, body: form })
18
18
  return reply.redirectTo('sumba:/help/trouble-tickets/list')
19
19
  } catch (err) {
20
20
  error = err
@@ -22,7 +22,7 @@ const id = {
22
22
  }
23
23
  const query = { masterId: req.params.id + '' }
24
24
  const options = { count: true, query }
25
- const list = await recordFind({ model, req, options })
25
+ const list = await findRecord({ model, req, options })
26
26
  schema.view.disabled = ['update', 'remove']
27
27
  schema.view.fields = ['createdAt']
28
28
  schema.view.label = { createdAt: 'conversation' }
@@ -3,11 +3,11 @@ const model = 'SumbaTicket'
3
3
  const list = {
4
4
  method: ['GET'],
5
5
  handler: async function (req, reply) {
6
- const { recordFind, getSchemaExt } = this.app.waibuDb
6
+ const { findRecord, getSchemaExt } = this.app.waibuDb
7
7
  const { getExcerpt } = this.app.bajoTemplate
8
8
  const { schema } = await getSchemaExt(model, 'list')
9
9
  const options = { count: true }
10
- const list = await recordFind({ model, req, options })
10
+ const list = await findRecord({ model, req, options })
11
11
  schema.view.disabled = ['update', 'remove']
12
12
  schema.view.fields = ['createdAt', 'subject', 'status']
13
13
  schema.view.label = { subject: 'Your Message' }
File without changes
File without changes
@@ -1,23 +1,10 @@
1
1
  const signout = {
2
2
  method: ['GET', 'POST'],
3
3
  handler: async function (req, reply) {
4
- const { runHook } = this.app.bajo
5
- // const { isEmpty } = this.lib._
6
- const { getSessionId } = this.app.waibuMpa
7
-
8
4
  let { referer } = req.body || {}
9
5
  if (req.session.ref) referer = req.session.ref
10
6
  req.session.ref = null
11
- if (req.method === 'POST') {
12
- const sid = await getSessionId(req.headers.cookie)
13
- req.session.userId = null
14
- await runHook(`${this.name}:afterSignout`, sid, req)
15
- const { query, params } = req
16
- // const url = !isEmpty(referer) ? referer : this.config.redirect.home
17
- const url = this.config.redirect.afterSignout
18
- req.flash('notify', req.t('signoutSuccessfully'))
19
- return reply.redirectTo(url, { query, params })
20
- }
7
+ if (req.method === 'POST') return this.signout({ req, reply })
21
8
  return await reply.view('sumba.template:/signout.html', { form: { referer } })
22
9
  }
23
10
  }