@things-factory/operato-hub 6.2.101 → 6.2.102

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 (376) hide show
  1. package/package.json +4 -4
  2. package/dist-server/controllers/bizplace-initializer/codes.js +0 -21
  3. package/dist-server/controllers/bizplace-initializer/codes.js.map +0 -1
  4. package/dist-server/controllers/bizplace-initializer/dataset/codes.js +0 -402
  5. package/dist-server/controllers/bizplace-initializer/dataset/codes.js.map +0 -1
  6. package/dist-server/controllers/bizplace-initializer/dataset/groups.js +0 -24
  7. package/dist-server/controllers/bizplace-initializer/dataset/groups.js.map +0 -1
  8. package/dist-server/controllers/bizplace-initializer/dataset/index.js +0 -9
  9. package/dist-server/controllers/bizplace-initializer/dataset/index.js.map +0 -1
  10. package/dist-server/controllers/bizplace-initializer/dataset/menus.js +0 -504
  11. package/dist-server/controllers/bizplace-initializer/dataset/menus.js.map +0 -1
  12. package/dist-server/controllers/bizplace-initializer/dataset/roles-privileges.js +0 -406
  13. package/dist-server/controllers/bizplace-initializer/dataset/roles-privileges.js.map +0 -1
  14. package/dist-server/controllers/bizplace-initializer/dataset/settings.js +0 -94
  15. package/dist-server/controllers/bizplace-initializer/dataset/settings.js.map +0 -1
  16. package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain-roles.js +0 -26
  17. package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain-roles.js.map +0 -1
  18. package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain.js +0 -44
  19. package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain.js.map +0 -1
  20. package/dist-server/controllers/bizplace-initializer/groups.js +0 -18
  21. package/dist-server/controllers/bizplace-initializer/groups.js.map +0 -1
  22. package/dist-server/controllers/bizplace-initializer/index.js +0 -9
  23. package/dist-server/controllers/bizplace-initializer/index.js.map +0 -1
  24. package/dist-server/controllers/bizplace-initializer/menus.js +0 -28
  25. package/dist-server/controllers/bizplace-initializer/menus.js.map +0 -1
  26. package/dist-server/controllers/bizplace-initializer/settings.js +0 -16
  27. package/dist-server/controllers/bizplace-initializer/settings.js.map +0 -1
  28. package/dist-server/controllers/company-initializer/business-register.js +0 -48
  29. package/dist-server/controllers/company-initializer/business-register.js.map +0 -1
  30. package/dist-server/controllers/company-initializer/codes.js +0 -137
  31. package/dist-server/controllers/company-initializer/codes.js.map +0 -1
  32. package/dist-server/controllers/company-initializer/generate-company-roles.js +0 -117
  33. package/dist-server/controllers/company-initializer/generate-company-roles.js.map +0 -1
  34. package/dist-server/controllers/company-initializer/index.js +0 -10
  35. package/dist-server/controllers/company-initializer/index.js.map +0 -1
  36. package/dist-server/controllers/company-initializer/menus.js +0 -348
  37. package/dist-server/controllers/company-initializer/menus.js.map +0 -1
  38. package/dist-server/controllers/company-initializer/settings.js +0 -31
  39. package/dist-server/controllers/company-initializer/settings.js.map +0 -1
  40. package/dist-server/controllers/company-initializer/transporter.js +0 -18
  41. package/dist-server/controllers/company-initializer/transporter.js.map +0 -1
  42. package/dist-server/controllers/index.js +0 -1
  43. package/dist-server/controllers/index.js.map +0 -1
  44. package/dist-server/controllers/invitation.js +0 -119
  45. package/dist-server/controllers/invitation.js.map +0 -1
  46. package/dist-server/controllers/utils/make-invitation-token.js +0 -10
  47. package/dist-server/controllers/utils/make-invitation-token.js.map +0 -1
  48. package/dist-server/controllers/utils/save-invitation-token.js +0 -13
  49. package/dist-server/controllers/utils/save-invitation-token.js.map +0 -1
  50. package/dist-server/entities/index.js +0 -1
  51. package/dist-server/entities/index.js.map +0 -1
  52. package/dist-server/errors/index.js +0 -5
  53. package/dist-server/errors/index.js.map +0 -1
  54. package/dist-server/errors/validation-error.js +0 -14
  55. package/dist-server/errors/validation-error.js.map +0 -1
  56. package/dist-server/graphql/index.js +0 -11
  57. package/dist-server/graphql/index.js.map +0 -1
  58. package/dist-server/graphql/resolvers/generators/generate-bizplace.js +0 -38
  59. package/dist-server/graphql/resolvers/generators/generate-bizplace.js.map +0 -1
  60. package/dist-server/graphql/resolvers/generators/generate-company.js +0 -61
  61. package/dist-server/graphql/resolvers/generators/generate-company.js.map +0 -1
  62. package/dist-server/graphql/resolvers/generators/index.js +0 -8
  63. package/dist-server/graphql/resolvers/generators/index.js.map +0 -1
  64. package/dist-server/graphql/resolvers/generators/update-domain-extType.js +0 -46
  65. package/dist-server/graphql/resolvers/generators/update-domain-extType.js.map +0 -1
  66. package/dist-server/graphql/resolvers/index.js +0 -11
  67. package/dist-server/graphql/resolvers/index.js.map +0 -1
  68. package/dist-server/graphql/resolvers/invitations/index.js +0 -6
  69. package/dist-server/graphql/resolvers/invitations/index.js.map +0 -1
  70. package/dist-server/graphql/resolvers/invitations/partner-invitation.js +0 -52
  71. package/dist-server/graphql/resolvers/invitations/partner-invitation.js.map +0 -1
  72. package/dist-server/graphql/resolvers/oauth2/company-roles-by-scope.js +0 -33
  73. package/dist-server/graphql/resolvers/oauth2/company-roles-by-scope.js.map +0 -1
  74. package/dist-server/graphql/resolvers/oauth2/index.js +0 -6
  75. package/dist-server/graphql/resolvers/oauth2/index.js.map +0 -1
  76. package/dist-server/graphql/resolvers/synchronization/auto-update-all-marketplace-product-variation-quantity.js +0 -149
  77. package/dist-server/graphql/resolvers/synchronization/auto-update-all-marketplace-product-variation-quantity.js.map +0 -1
  78. package/dist-server/graphql/resolvers/synchronization/create-dat-shipments.js +0 -58
  79. package/dist-server/graphql/resolvers/synchronization/create-dat-shipments.js.map +0 -1
  80. package/dist-server/graphql/resolvers/synchronization/fetch-sync-invoices.js +0 -41
  81. package/dist-server/graphql/resolvers/synchronization/fetch-sync-invoices.js.map +0 -1
  82. package/dist-server/graphql/resolvers/synchronization/fetch-sync-products.js +0 -81
  83. package/dist-server/graphql/resolvers/synchronization/fetch-sync-products.js.map +0 -1
  84. package/dist-server/graphql/resolvers/synchronization/fetch-sync-purchase-orders.js +0 -57
  85. package/dist-server/graphql/resolvers/synchronization/fetch-sync-purchase-orders.js.map +0 -1
  86. package/dist-server/graphql/resolvers/synchronization/index.js +0 -16
  87. package/dist-server/graphql/resolvers/synchronization/index.js.map +0 -1
  88. package/dist-server/graphql/resolvers/synchronization/sellercraft-pack-marketplace-order.js +0 -68
  89. package/dist-server/graphql/resolvers/synchronization/sellercraft-pack-marketplace-order.js.map +0 -1
  90. package/dist-server/graphql/resolvers/synchronization/sync-all-products-to-sellercraft.js +0 -35
  91. package/dist-server/graphql/resolvers/synchronization/sync-all-products-to-sellercraft.js.map +0 -1
  92. package/dist-server/graphql/resolvers/synchronization/sync-products-from-account.js +0 -34
  93. package/dist-server/graphql/resolvers/synchronization/sync-products-from-account.js.map +0 -1
  94. package/dist-server/graphql/resolvers/synchronization/sync-products-to-account.js +0 -55
  95. package/dist-server/graphql/resolvers/synchronization/sync-products-to-account.js.map +0 -1
  96. package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js +0 -142
  97. package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js.map +0 -1
  98. package/dist-server/graphql/types/generators/generate-bizplace-input.js +0 -15
  99. package/dist-server/graphql/types/generators/generate-bizplace-input.js.map +0 -1
  100. package/dist-server/graphql/types/generators/generate-company-input.js +0 -15
  101. package/dist-server/graphql/types/generators/generate-company-input.js.map +0 -1
  102. package/dist-server/graphql/types/generators/index.js +0 -13
  103. package/dist-server/graphql/types/generators/index.js.map +0 -1
  104. package/dist-server/graphql/types/generators/update-domain-type-input.js +0 -12
  105. package/dist-server/graphql/types/generators/update-domain-type-input.js.map +0 -1
  106. package/dist-server/graphql/types/index.js +0 -12
  107. package/dist-server/graphql/types/index.js.map +0 -1
  108. package/dist-server/graphql/types/invitations/index.js +0 -9
  109. package/dist-server/graphql/types/invitations/index.js.map +0 -1
  110. package/dist-server/graphql/types/oauth2/company-role.js +0 -12
  111. package/dist-server/graphql/types/oauth2/company-role.js.map +0 -1
  112. package/dist-server/graphql/types/oauth2/index.js +0 -9
  113. package/dist-server/graphql/types/oauth2/index.js.map +0 -1
  114. package/dist-server/graphql/types/synchronization/index.js +0 -34
  115. package/dist-server/graphql/types/synchronization/index.js.map +0 -1
  116. package/dist-server/graphql/types/synchronization/sync-invoice-list.js +0 -12
  117. package/dist-server/graphql/types/synchronization/sync-invoice-list.js.map +0 -1
  118. package/dist-server/graphql/types/synchronization/sync-invoice-set.js +0 -42
  119. package/dist-server/graphql/types/synchronization/sync-invoice-set.js.map +0 -1
  120. package/dist-server/graphql/types/synchronization/sync-product-list.js +0 -12
  121. package/dist-server/graphql/types/synchronization/sync-product-list.js.map +0 -1
  122. package/dist-server/graphql/types/synchronization/sync-product-set.js +0 -12
  123. package/dist-server/graphql/types/synchronization/sync-product-set.js.map +0 -1
  124. package/dist-server/graphql/types/synchronization/sync-purchase-order-list.js +0 -12
  125. package/dist-server/graphql/types/synchronization/sync-purchase-order-list.js.map +0 -1
  126. package/dist-server/graphql/types/synchronization/sync-purchase-order-set.js +0 -32
  127. package/dist-server/graphql/types/synchronization/sync-purchase-order-set.js.map +0 -1
  128. package/dist-server/index.js +0 -29
  129. package/dist-server/index.js.map +0 -1
  130. package/dist-server/middlewares/business-middleware.js +0 -31
  131. package/dist-server/middlewares/business-middleware.js.map +0 -1
  132. package/dist-server/middlewares/index.js +0 -21
  133. package/dist-server/middlewares/index.js.map +0 -1
  134. package/dist-server/middlewares/store-middleware.js +0 -34
  135. package/dist-server/middlewares/store-middleware.js.map +0 -1
  136. package/dist-server/middlewares/warehouse-middleware.js +0 -34
  137. package/dist-server/middlewares/warehouse-middleware.js.map +0 -1
  138. package/dist-server/migrations/1597668478399-SeedBusinessDomain.js +0 -26
  139. package/dist-server/migrations/1597668478399-SeedBusinessDomain.js.map +0 -1
  140. package/dist-server/migrations/1597668478401-SeedBusinessRoles.js +0 -377
  141. package/dist-server/migrations/1597668478401-SeedBusinessRoles.js.map +0 -1
  142. package/dist-server/migrations/1608009991065-SeedUser.js +0 -52
  143. package/dist-server/migrations/1608009991065-SeedUser.js.map +0 -1
  144. package/dist-server/migrations/index.js +0 -12
  145. package/dist-server/migrations/index.js.map +0 -1
  146. package/dist-server/routers/api/index.js +0 -6
  147. package/dist-server/routers/api/index.js.map +0 -1
  148. package/dist-server/routers/api/restful-apis/unstable/add-contact-point.js +0 -74
  149. package/dist-server/routers/api/restful-apis/unstable/add-contact-point.js.map +0 -1
  150. package/dist-server/routers/api/restful-apis/unstable/add-draft-release-order.js +0 -171
  151. package/dist-server/routers/api/restful-apis/unstable/add-draft-release-order.js.map +0 -1
  152. package/dist-server/routers/api/restful-apis/unstable/add-inbound-order.js +0 -215
  153. package/dist-server/routers/api/restful-apis/unstable/add-inbound-order.js.map +0 -1
  154. package/dist-server/routers/api/restful-apis/unstable/add-marketplace-order.js +0 -142
  155. package/dist-server/routers/api/restful-apis/unstable/add-marketplace-order.js.map +0 -1
  156. package/dist-server/routers/api/restful-apis/unstable/add-products.js +0 -86
  157. package/dist-server/routers/api/restful-apis/unstable/add-products.js.map +0 -1
  158. package/dist-server/routers/api/restful-apis/unstable/add-release-order.js +0 -850
  159. package/dist-server/routers/api/restful-apis/unstable/add-release-order.js.map +0 -1
  160. package/dist-server/routers/api/restful-apis/unstable/add-sales-invoice.js +0 -127
  161. package/dist-server/routers/api/restful-apis/unstable/add-sales-invoice.js.map +0 -1
  162. package/dist-server/routers/api/restful-apis/unstable/bizplace.js +0 -43
  163. package/dist-server/routers/api/restful-apis/unstable/bizplace.js.map +0 -1
  164. package/dist-server/routers/api/restful-apis/unstable/cancel-marketplace-order.js +0 -61
  165. package/dist-server/routers/api/restful-apis/unstable/cancel-marketplace-order.js.map +0 -1
  166. package/dist-server/routers/api/restful-apis/unstable/cancel-release-order.js +0 -64
  167. package/dist-server/routers/api/restful-apis/unstable/cancel-release-order.js.map +0 -1
  168. package/dist-server/routers/api/restful-apis/unstable/get-contact-point-list.js +0 -101
  169. package/dist-server/routers/api/restful-apis/unstable/get-contact-point-list.js.map +0 -1
  170. package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-detail.js +0 -45
  171. package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-detail.js.map +0 -1
  172. package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-list.js +0 -122
  173. package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-list.js.map +0 -1
  174. package/dist-server/routers/api/restful-apis/unstable/get-delivery-orders.js +0 -162
  175. package/dist-server/routers/api/restful-apis/unstable/get-delivery-orders.js.map +0 -1
  176. package/dist-server/routers/api/restful-apis/unstable/get-goods-received-notes.js +0 -118
  177. package/dist-server/routers/api/restful-apis/unstable/get-goods-received-notes.js.map +0 -1
  178. package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-detail.js +0 -113
  179. package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-detail.js.map +0 -1
  180. package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-list.js +0 -123
  181. package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-list.js.map +0 -1
  182. package/dist-server/routers/api/restful-apis/unstable/get-inventory-overall-product-group.js +0 -86
  183. package/dist-server/routers/api/restful-apis/unstable/get-inventory-overall-product-group.js.map +0 -1
  184. package/dist-server/routers/api/restful-apis/unstable/get-inventory-product-group.js +0 -93
  185. package/dist-server/routers/api/restful-apis/unstable/get-inventory-product-group.js.map +0 -1
  186. package/dist-server/routers/api/restful-apis/unstable/get-marketplace-order-shipping-list.js +0 -144
  187. package/dist-server/routers/api/restful-apis/unstable/get-marketplace-order-shipping-list.js.map +0 -1
  188. package/dist-server/routers/api/restful-apis/unstable/get-marketplace-store-list.js +0 -77
  189. package/dist-server/routers/api/restful-apis/unstable/get-marketplace-store-list.js.map +0 -1
  190. package/dist-server/routers/api/restful-apis/unstable/get-onhand-inventories.js +0 -108
  191. package/dist-server/routers/api/restful-apis/unstable/get-onhand-inventories.js.map +0 -1
  192. package/dist-server/routers/api/restful-apis/unstable/get-partners.js +0 -24
  193. package/dist-server/routers/api/restful-apis/unstable/get-partners.js.map +0 -1
  194. package/dist-server/routers/api/restful-apis/unstable/get-products.js +0 -208
  195. package/dist-server/routers/api/restful-apis/unstable/get-products.js.map +0 -1
  196. package/dist-server/routers/api/restful-apis/unstable/get-release-order-detail.js +0 -123
  197. package/dist-server/routers/api/restful-apis/unstable/get-release-order-detail.js.map +0 -1
  198. package/dist-server/routers/api/restful-apis/unstable/get-release-order-list.js +0 -191
  199. package/dist-server/routers/api/restful-apis/unstable/get-release-order-list.js.map +0 -1
  200. package/dist-server/routers/api/restful-apis/unstable/get-warehouses.js +0 -20
  201. package/dist-server/routers/api/restful-apis/unstable/get-warehouses.js.map +0 -1
  202. package/dist-server/routers/api/restful-apis/unstable/index.js +0 -35
  203. package/dist-server/routers/api/restful-apis/unstable/index.js.map +0 -1
  204. package/dist-server/routers/api/restful-apis/unstable/reject-inbound-order.js +0 -33
  205. package/dist-server/routers/api/restful-apis/unstable/reject-inbound-order.js.map +0 -1
  206. package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-delivered.js +0 -43
  207. package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-delivered.js.map +0 -1
  208. package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-failed-delivery.js +0 -43
  209. package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-failed-delivery.js.map +0 -1
  210. package/dist-server/routers/api/restful-apis/unstable/update-marketplace-order.js +0 -91
  211. package/dist-server/routers/api/restful-apis/unstable/update-marketplace-order.js.map +0 -1
  212. package/dist-server/routers/api/restful-apis/unstable/update-marketplace-shipping-order.js +0 -86
  213. package/dist-server/routers/api/restful-apis/unstable/update-marketplace-shipping-order.js.map +0 -1
  214. package/dist-server/routers/api/restful-apis/unstable/update-release-order-details.js +0 -80
  215. package/dist-server/routers/api/restful-apis/unstable/update-release-order-details.js.map +0 -1
  216. package/dist-server/routers/api/restful-apis/v1/add-contact-point.js +0 -62
  217. package/dist-server/routers/api/restful-apis/v1/add-contact-point.js.map +0 -1
  218. package/dist-server/routers/api/restful-apis/v1/add-draft-release-order.js +0 -169
  219. package/dist-server/routers/api/restful-apis/v1/add-draft-release-order.js.map +0 -1
  220. package/dist-server/routers/api/restful-apis/v1/add-inbound-order.js +0 -212
  221. package/dist-server/routers/api/restful-apis/v1/add-inbound-order.js.map +0 -1
  222. package/dist-server/routers/api/restful-apis/v1/add-marketplace-order.js +0 -142
  223. package/dist-server/routers/api/restful-apis/v1/add-marketplace-order.js.map +0 -1
  224. package/dist-server/routers/api/restful-apis/v1/add-products.js +0 -86
  225. package/dist-server/routers/api/restful-apis/v1/add-products.js.map +0 -1
  226. package/dist-server/routers/api/restful-apis/v1/add-release-order.js +0 -772
  227. package/dist-server/routers/api/restful-apis/v1/add-release-order.js.map +0 -1
  228. package/dist-server/routers/api/restful-apis/v1/bizplace.js +0 -43
  229. package/dist-server/routers/api/restful-apis/v1/bizplace.js.map +0 -1
  230. package/dist-server/routers/api/restful-apis/v1/cancel-marketplace-order.js +0 -61
  231. package/dist-server/routers/api/restful-apis/v1/cancel-marketplace-order.js.map +0 -1
  232. package/dist-server/routers/api/restful-apis/v1/cancel-release-order.js +0 -64
  233. package/dist-server/routers/api/restful-apis/v1/cancel-release-order.js.map +0 -1
  234. package/dist-server/routers/api/restful-apis/v1/get-contact-point-list.js +0 -101
  235. package/dist-server/routers/api/restful-apis/v1/get-contact-point-list.js.map +0 -1
  236. package/dist-server/routers/api/restful-apis/v1/get-delivery-order-detail.js +0 -45
  237. package/dist-server/routers/api/restful-apis/v1/get-delivery-order-detail.js.map +0 -1
  238. package/dist-server/routers/api/restful-apis/v1/get-delivery-order-list.js +0 -122
  239. package/dist-server/routers/api/restful-apis/v1/get-delivery-order-list.js.map +0 -1
  240. package/dist-server/routers/api/restful-apis/v1/get-delivery-orders.js +0 -162
  241. package/dist-server/routers/api/restful-apis/v1/get-delivery-orders.js.map +0 -1
  242. package/dist-server/routers/api/restful-apis/v1/get-goods-received-notes.js +0 -118
  243. package/dist-server/routers/api/restful-apis/v1/get-goods-received-notes.js.map +0 -1
  244. package/dist-server/routers/api/restful-apis/v1/get-inbound-order-detail.js +0 -113
  245. package/dist-server/routers/api/restful-apis/v1/get-inbound-order-detail.js.map +0 -1
  246. package/dist-server/routers/api/restful-apis/v1/get-inbound-order-list.js +0 -123
  247. package/dist-server/routers/api/restful-apis/v1/get-inbound-order-list.js.map +0 -1
  248. package/dist-server/routers/api/restful-apis/v1/get-inventory-overall-product-group.js +0 -86
  249. package/dist-server/routers/api/restful-apis/v1/get-inventory-overall-product-group.js.map +0 -1
  250. package/dist-server/routers/api/restful-apis/v1/get-inventory-product-group.js +0 -99
  251. package/dist-server/routers/api/restful-apis/v1/get-inventory-product-group.js.map +0 -1
  252. package/dist-server/routers/api/restful-apis/v1/get-marketplace-order-shipping-list.js +0 -144
  253. package/dist-server/routers/api/restful-apis/v1/get-marketplace-order-shipping-list.js.map +0 -1
  254. package/dist-server/routers/api/restful-apis/v1/get-marketplace-store-list.js +0 -77
  255. package/dist-server/routers/api/restful-apis/v1/get-marketplace-store-list.js.map +0 -1
  256. package/dist-server/routers/api/restful-apis/v1/get-onhand-inventories.js +0 -108
  257. package/dist-server/routers/api/restful-apis/v1/get-onhand-inventories.js.map +0 -1
  258. package/dist-server/routers/api/restful-apis/v1/get-partners.js +0 -24
  259. package/dist-server/routers/api/restful-apis/v1/get-partners.js.map +0 -1
  260. package/dist-server/routers/api/restful-apis/v1/get-products.js +0 -208
  261. package/dist-server/routers/api/restful-apis/v1/get-products.js.map +0 -1
  262. package/dist-server/routers/api/restful-apis/v1/get-release-order-detail.js +0 -120
  263. package/dist-server/routers/api/restful-apis/v1/get-release-order-detail.js.map +0 -1
  264. package/dist-server/routers/api/restful-apis/v1/get-release-order-list.js +0 -189
  265. package/dist-server/routers/api/restful-apis/v1/get-release-order-list.js.map +0 -1
  266. package/dist-server/routers/api/restful-apis/v1/get-warehouses.js +0 -20
  267. package/dist-server/routers/api/restful-apis/v1/get-warehouses.js.map +0 -1
  268. package/dist-server/routers/api/restful-apis/v1/index.js +0 -34
  269. package/dist-server/routers/api/restful-apis/v1/index.js.map +0 -1
  270. package/dist-server/routers/api/restful-apis/v1/reject-inbound-order.js +0 -33
  271. package/dist-server/routers/api/restful-apis/v1/reject-inbound-order.js.map +0 -1
  272. package/dist-server/routers/api/restful-apis/v1/set-marketplace-order-delivered.js +0 -43
  273. package/dist-server/routers/api/restful-apis/v1/set-marketplace-order-delivered.js.map +0 -1
  274. package/dist-server/routers/api/restful-apis/v1/set-marketplace-order-failed-delivery.js +0 -43
  275. package/dist-server/routers/api/restful-apis/v1/set-marketplace-order-failed-delivery.js.map +0 -1
  276. package/dist-server/routers/api/restful-apis/v1/update-marketplace-order.js +0 -91
  277. package/dist-server/routers/api/restful-apis/v1/update-marketplace-order.js.map +0 -1
  278. package/dist-server/routers/api/restful-apis/v1/update-marketplace-shipping-order.js +0 -83
  279. package/dist-server/routers/api/restful-apis/v1/update-marketplace-shipping-order.js.map +0 -1
  280. package/dist-server/routers/api/restful-apis/v1/update-release-order-details.js +0 -80
  281. package/dist-server/routers/api/restful-apis/v1/update-release-order-details.js.map +0 -1
  282. package/dist-server/routers/api/restful-apis/v2/add-contact-point.js +0 -62
  283. package/dist-server/routers/api/restful-apis/v2/add-contact-point.js.map +0 -1
  284. package/dist-server/routers/api/restful-apis/v2/add-draft-release-order.js +0 -169
  285. package/dist-server/routers/api/restful-apis/v2/add-draft-release-order.js.map +0 -1
  286. package/dist-server/routers/api/restful-apis/v2/add-inbound-order.js +0 -212
  287. package/dist-server/routers/api/restful-apis/v2/add-inbound-order.js.map +0 -1
  288. package/dist-server/routers/api/restful-apis/v2/add-marketplace-order.js +0 -142
  289. package/dist-server/routers/api/restful-apis/v2/add-marketplace-order.js.map +0 -1
  290. package/dist-server/routers/api/restful-apis/v2/add-products.js +0 -86
  291. package/dist-server/routers/api/restful-apis/v2/add-products.js.map +0 -1
  292. package/dist-server/routers/api/restful-apis/v2/add-release-order.js +0 -772
  293. package/dist-server/routers/api/restful-apis/v2/add-release-order.js.map +0 -1
  294. package/dist-server/routers/api/restful-apis/v2/bizplace.js +0 -43
  295. package/dist-server/routers/api/restful-apis/v2/bizplace.js.map +0 -1
  296. package/dist-server/routers/api/restful-apis/v2/cancel-marketplace-order.js +0 -61
  297. package/dist-server/routers/api/restful-apis/v2/cancel-marketplace-order.js.map +0 -1
  298. package/dist-server/routers/api/restful-apis/v2/cancel-release-order.js +0 -64
  299. package/dist-server/routers/api/restful-apis/v2/cancel-release-order.js.map +0 -1
  300. package/dist-server/routers/api/restful-apis/v2/get-contact-point-list.js +0 -101
  301. package/dist-server/routers/api/restful-apis/v2/get-contact-point-list.js.map +0 -1
  302. package/dist-server/routers/api/restful-apis/v2/get-delivery-order-detail.js +0 -45
  303. package/dist-server/routers/api/restful-apis/v2/get-delivery-order-detail.js.map +0 -1
  304. package/dist-server/routers/api/restful-apis/v2/get-delivery-order-list.js +0 -122
  305. package/dist-server/routers/api/restful-apis/v2/get-delivery-order-list.js.map +0 -1
  306. package/dist-server/routers/api/restful-apis/v2/get-delivery-orders.js +0 -162
  307. package/dist-server/routers/api/restful-apis/v2/get-delivery-orders.js.map +0 -1
  308. package/dist-server/routers/api/restful-apis/v2/get-goods-received-notes.js +0 -118
  309. package/dist-server/routers/api/restful-apis/v2/get-goods-received-notes.js.map +0 -1
  310. package/dist-server/routers/api/restful-apis/v2/get-inbound-order-detail.js +0 -113
  311. package/dist-server/routers/api/restful-apis/v2/get-inbound-order-detail.js.map +0 -1
  312. package/dist-server/routers/api/restful-apis/v2/get-inbound-order-list.js +0 -123
  313. package/dist-server/routers/api/restful-apis/v2/get-inbound-order-list.js.map +0 -1
  314. package/dist-server/routers/api/restful-apis/v2/get-inventory-overall-product-group.js +0 -86
  315. package/dist-server/routers/api/restful-apis/v2/get-inventory-overall-product-group.js.map +0 -1
  316. package/dist-server/routers/api/restful-apis/v2/get-inventory-product-group.js +0 -99
  317. package/dist-server/routers/api/restful-apis/v2/get-inventory-product-group.js.map +0 -1
  318. package/dist-server/routers/api/restful-apis/v2/get-marketplace-order-shipping-list.js +0 -144
  319. package/dist-server/routers/api/restful-apis/v2/get-marketplace-order-shipping-list.js.map +0 -1
  320. package/dist-server/routers/api/restful-apis/v2/get-marketplace-store-list.js +0 -77
  321. package/dist-server/routers/api/restful-apis/v2/get-marketplace-store-list.js.map +0 -1
  322. package/dist-server/routers/api/restful-apis/v2/get-onhand-inventories.js +0 -108
  323. package/dist-server/routers/api/restful-apis/v2/get-onhand-inventories.js.map +0 -1
  324. package/dist-server/routers/api/restful-apis/v2/get-partners.js +0 -24
  325. package/dist-server/routers/api/restful-apis/v2/get-partners.js.map +0 -1
  326. package/dist-server/routers/api/restful-apis/v2/get-products.js +0 -208
  327. package/dist-server/routers/api/restful-apis/v2/get-products.js.map +0 -1
  328. package/dist-server/routers/api/restful-apis/v2/get-release-order-detail.js +0 -120
  329. package/dist-server/routers/api/restful-apis/v2/get-release-order-detail.js.map +0 -1
  330. package/dist-server/routers/api/restful-apis/v2/get-release-order-list.js +0 -189
  331. package/dist-server/routers/api/restful-apis/v2/get-release-order-list.js.map +0 -1
  332. package/dist-server/routers/api/restful-apis/v2/get-warehouses.js +0 -20
  333. package/dist-server/routers/api/restful-apis/v2/get-warehouses.js.map +0 -1
  334. package/dist-server/routers/api/restful-apis/v2/index.js +0 -34
  335. package/dist-server/routers/api/restful-apis/v2/index.js.map +0 -1
  336. package/dist-server/routers/api/restful-apis/v2/reject-inbound-order.js +0 -33
  337. package/dist-server/routers/api/restful-apis/v2/reject-inbound-order.js.map +0 -1
  338. package/dist-server/routers/api/restful-apis/v2/set-marketplace-order-delivered.js +0 -43
  339. package/dist-server/routers/api/restful-apis/v2/set-marketplace-order-delivered.js.map +0 -1
  340. package/dist-server/routers/api/restful-apis/v2/set-marketplace-order-failed-delivery.js +0 -43
  341. package/dist-server/routers/api/restful-apis/v2/set-marketplace-order-failed-delivery.js.map +0 -1
  342. package/dist-server/routers/api/restful-apis/v2/update-marketplace-order.js +0 -91
  343. package/dist-server/routers/api/restful-apis/v2/update-marketplace-order.js.map +0 -1
  344. package/dist-server/routers/api/restful-apis/v2/update-marketplace-shipping-order.js +0 -83
  345. package/dist-server/routers/api/restful-apis/v2/update-marketplace-shipping-order.js.map +0 -1
  346. package/dist-server/routers/api/restful-apis/v2/update-release-order-details.js +0 -80
  347. package/dist-server/routers/api/restful-apis/v2/update-release-order-details.js.map +0 -1
  348. package/dist-server/routers/auth-invitation-router.js +0 -23
  349. package/dist-server/routers/auth-invitation-router.js.map +0 -1
  350. package/dist-server/routers/business/bizplace-register-router.js +0 -23
  351. package/dist-server/routers/business/bizplace-register-router.js.map +0 -1
  352. package/dist-server/routers/business/business-register-router.js +0 -25
  353. package/dist-server/routers/business/business-register-router.js.map +0 -1
  354. package/dist-server/routers/business/index.js +0 -7
  355. package/dist-server/routers/business/index.js.map +0 -1
  356. package/dist-server/routers/business/path-base-business-router.js +0 -16
  357. package/dist-server/routers/business/path-base-business-router.js.map +0 -1
  358. package/dist-server/routes.js +0 -18
  359. package/dist-server/routes.js.map +0 -1
  360. package/dist-server/templates/account-unlock-email.js +0 -70
  361. package/dist-server/templates/account-unlock-email.js.map +0 -1
  362. package/dist-server/templates/invitation-email.js +0 -71
  363. package/dist-server/templates/invitation-email.js.map +0 -1
  364. package/dist-server/templates/reset-password-email.js +0 -70
  365. package/dist-server/templates/reset-password-email.js.map +0 -1
  366. package/dist-server/templates/verification-email.js +0 -71
  367. package/dist-server/templates/verification-email.js.map +0 -1
  368. package/dist-server/tsconfig.tsbuildinfo +0 -1
  369. package/dist-server/utils/build-map.js +0 -19
  370. package/dist-server/utils/build-map.js.map +0 -1
  371. package/dist-server/utils/get-warehouses.js +0 -117
  372. package/dist-server/utils/get-warehouses.js.map +0 -1
  373. package/dist-server/utils/index.js +0 -7
  374. package/dist-server/utils/index.js.map +0 -1
  375. package/dist-server/utils/order-no-generator.js +0 -11
  376. package/dist-server/utils/order-no-generator.js.map +0 -1
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getChildPackingSize = exports.syncProductsToSellercraftResolver = void 0;
4
- const biz_base_1 = require("@things-factory/biz-base");
5
- const env_1 = require("@things-factory/env");
6
- const integration_fulfillment_1 = require("@things-factory/integration-fulfillment");
7
- const integration_sellercraft_1 = require("@things-factory/integration-sellercraft");
8
- exports.syncProductsToSellercraftResolver = {
9
- async syncProductsToSellercraft(_, { sellercraftId, fulfillmentCenterId }, context) {
10
- var _a;
11
- try {
12
- const { domain, tx } = context.state;
13
- let page = 0;
14
- let hasMorePage = true;
15
- const limit = 50;
16
- const sellercraft = await tx
17
- .getRepository(integration_sellercraft_1.Sellercraft)
18
- .findOne({ where: { id: sellercraftId }, relations: ['domain'] });
19
- const customerDomain = sellercraft.domain;
20
- const fulfilmentCenter = await integration_fulfillment_1.FulfillmentAPI.getFulfillmentCenter(fulfillmentCenterId);
21
- const customerBizplace = await tx
22
- .getRepository(biz_base_1.Bizplace)
23
- .findOne({ where: { domain: { id: customerDomain.id } } });
24
- await tx.query(`
25
- create temp table temp_warehouse_product_inventory ON COMMIT DROP as (
26
- select p.id, p.sku as product_sku, p.name as product_name, p.description as product_description,
27
- pd.gtin, pd.uom, pd.packing_size, coalesce(pd.nett_weight, 0) as nett_weight, pd.width, pd."depth", pd.height,
28
- coalesce(src.qty, 0) as available_qty, coalesce(src.qty - src."remainQty", 0) as reserved_qty, coalesce(src."remainQty",0) as remain_qty
29
- from bizplaces b
30
- inner join companies c on c.id = b.company_id
31
- inner join domains d on d.id = c.domain_id
32
- inner join products p on p.domain_id = b.domain_id or p.domain_id = c.domain_id
33
- inner join product_details pd on pd.product_id = p.id
34
- left join (
35
- select wboi.* from warehouse_bizplace_onhand_inventories wboi
36
- inner join domains d on d.id = wboi."domainId"
37
- inner join fulfillment_centers fc on d.subdomain = fc.center_id
38
- where fc.id= $1
39
- and wboi."bizplaceId" = $2 and "groupType" = 'SINGLE'
40
- ) src on src."productId" = pd."product_id"
41
- and src."packingType" = pd."packing_type"
42
- and src."packingSize" = pd."packing_size"
43
- and src."uom" = pd."uom"
44
- where b.id = $2
45
- )
46
- `, [fulfilmentCenter.id, customerBizplace.id]);
47
- let total = await tx.query(`
48
- select count(*) from temp_warehouse_product_inventory
49
- `);
50
- while (hasMorePage) {
51
- hasMorePage = false;
52
- try {
53
- // const { items, total } = await FulfillmentAPI.getInventoryProductGroupOpenAPI(fulfilmentCenter, {
54
- // warehouseId: customerBizplace.id,
55
- // paginationEntriesPerPage: limit,
56
- // paginationOffset: page
57
- // })
58
- const items = await tx.query(`
59
- select * from temp_warehouse_product_inventory limit $1 offset $2
60
- `, [limit, page * limit]);
61
- let sellercraftInv = [];
62
- items.map(async (item) => {
63
- let packingSize = 1;
64
- sellercraftInv.push({
65
- sku: item.product_sku,
66
- gtin: item.gtin,
67
- stock: {
68
- quantity_total: item.available_qty * packingSize < 0 ? 0 : item.available_qty * packingSize,
69
- quantity_reserved: item.reserved_qty * packingSize < 0 ? 0 : item.reserved_qty * packingSize,
70
- unit_of_measure: 'EA'
71
- },
72
- package_weight_gm: item.nett_weight <= 0 ? 1 : item.nett_weight,
73
- package_dimensions: {
74
- length_mm: item.depth <= 0 ? 1 : item.depth,
75
- width_mm: item.width <= 0 ? 1 : item.width,
76
- height_mm: item.height <= 0 ? 1 : item.height
77
- }
78
- });
79
- });
80
- const delay = (ms) => {
81
- return new Promise(resolve => setTimeout(resolve, ms));
82
- };
83
- await delay(500);
84
- await integration_sellercraft_1.SellercraftAPI.updateProduct(sellercraft, { context, accountId: sellercraft.accountId, sellercraftInv });
85
- page++;
86
- hasMorePage = (((_a = total[0]) === null || _a === void 0 ? void 0 : _a.count) || 0) > page * limit;
87
- }
88
- catch (e) {
89
- env_1.logger.error(`[syncProductsToSellercraftResolver] sellercraftID:${sellercraftId} fulfillmentCenterId:${fulfillmentCenterId} page:${page} - ${e}`);
90
- }
91
- }
92
- }
93
- catch (e) {
94
- env_1.logger.error(`syncProductsToSellercraftResolver: ${e}`);
95
- }
96
- }
97
- };
98
- /**
99
- * @summary Check for product child qty at any scanned level
100
- * @description It will check every level of product detail by comparing scanned level and GAN registered level.
101
- * By getting the level that has relation, child qty will be retrieved
102
- * 1st level: PALLET -> 2 CARTONS (scan), 2nd level: CARTON -> 6 BAGS, 3rd level: BAG -> 10 UNITS, lowest: UNIT (order registered packing type)
103
- */
104
- async function getChildPackingSize(productDetails, defaultProductDetail, unmatchingProductDetail) {
105
- let hasChildRelation = Boolean(unmatchingProductDetail === null || unmatchingProductDetail === void 0 ? void 0 : unmatchingProductDetail.childProductDetail);
106
- let hasMatchingChild;
107
- let packingSize = 1;
108
- let currentChildProductDetail;
109
- if (hasChildRelation) {
110
- currentChildProductDetail = productDetails.find((productDetail) => productDetail.id === unmatchingProductDetail.childProductDetail.id);
111
- if (!currentChildProductDetail) {
112
- throw new Error(`Unable to find matching packing type for GTIN (${unmatchingProductDetail.gtin})`);
113
- }
114
- hasMatchingChild = Boolean(defaultProductDetail.id === currentChildProductDetail.id);
115
- if (hasMatchingChild) {
116
- packingSize = unmatchingProductDetail.packingSize;
117
- }
118
- else {
119
- packingSize = unmatchingProductDetail.packingSize * packingSize;
120
- }
121
- }
122
- else {
123
- throw new Error(`No child product result for GTIN (${unmatchingProductDetail.gtin})`);
124
- }
125
- while (hasChildRelation && !hasMatchingChild) {
126
- if (hasMatchingChild) {
127
- packingSize = currentChildProductDetail.packingSize * packingSize; // 12 x 10
128
- }
129
- else if (!hasMatchingChild && hasChildRelation) {
130
- packingSize = currentChildProductDetail.packingSize * packingSize; // 12 x 10
131
- currentChildProductDetail = productDetails.find((productDetail) => productDetail.id === currentChildProductDetail.childProductDetail.id);
132
- hasChildRelation = Boolean(currentChildProductDetail === null || currentChildProductDetail === void 0 ? void 0 : currentChildProductDetail.childProductDetail);
133
- hasMatchingChild = Boolean(defaultProductDetail.id === currentChildProductDetail.id);
134
- }
135
- else if (!hasChildRelation && !hasMatchingChild) {
136
- throw new Error(`Unable to find matching packing type for GTIN (${unmatchingProductDetail.gtin})`);
137
- }
138
- }
139
- return packingSize;
140
- }
141
- exports.getChildPackingSize = getChildPackingSize;
142
- //# sourceMappingURL=sync-products-to-sellercraft.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-products-to-sellercraft.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/sync-products-to-sellercraft.ts"],"names":[],"mappings":"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","sourcesContent":["import { Bizplace } from '@things-factory/biz-base'\nimport { logger } from '@things-factory/env'\nimport { FulfillmentAPI, FulfillmentCenter } from '@things-factory/integration-fulfillment'\nimport { Sellercraft, SellercraftAPI } from '@things-factory/integration-sellercraft'\nimport { ProductDetail } from '@things-factory/product-base'\nimport { Domain } from '@things-factory/shell'\n\nexport const syncProductsToSellercraftResolver = {\n async syncProductsToSellercraft(\n _: void,\n {\n sellercraftId,\n fulfillmentCenterId\n }: { sellercraftId: string; fulfillmentCenterId: string; toCreateSku: boolean },\n context: any\n ): Promise<void> {\n try {\n const { domain, tx } = context.state\n\n let page: number = 0\n let hasMorePage: boolean = true\n const limit: number = 50\n\n const sellercraft: Sellercraft = await tx\n .getRepository(Sellercraft)\n .findOne({ where: { id: sellercraftId }, relations: ['domain'] })\n const customerDomain: Domain = sellercraft.domain\n const fulfilmentCenter: FulfillmentCenter = await FulfillmentAPI.getFulfillmentCenter(fulfillmentCenterId)\n const customerBizplace: Bizplace = await tx\n .getRepository(Bizplace)\n .findOne({ where: { domain: { id: customerDomain.id } } })\n\n await tx.query(\n `\n create temp table temp_warehouse_product_inventory ON COMMIT DROP as (\n select p.id, p.sku as product_sku, p.name as product_name, p.description as product_description, \n pd.gtin, pd.uom, pd.packing_size, coalesce(pd.nett_weight, 0) as nett_weight, pd.width, pd.\"depth\", pd.height,\n coalesce(src.qty, 0) as available_qty, coalesce(src.qty - src.\"remainQty\", 0) as reserved_qty, coalesce(src.\"remainQty\",0) as remain_qty\n from bizplaces b\n inner join companies c on c.id = b.company_id \n inner join domains d on d.id = c.domain_id\n inner join products p on p.domain_id = b.domain_id or p.domain_id = c.domain_id \n inner join product_details pd on pd.product_id = p.id\n left join (\n select wboi.* from warehouse_bizplace_onhand_inventories wboi \n inner join domains d on d.id = wboi.\"domainId\"\n inner join fulfillment_centers fc on d.subdomain = fc.center_id \n where fc.id= $1 \n and wboi.\"bizplaceId\" = $2 and \"groupType\" = 'SINGLE'\n ) src on src.\"productId\" = pd.\"product_id\" \n and src.\"packingType\" = pd.\"packing_type\" \n and src.\"packingSize\" = pd.\"packing_size\" \n and src.\"uom\" = pd.\"uom\" \n where b.id = $2\n )\n `,\n [fulfilmentCenter.id, customerBizplace.id]\n )\n\n let total = await tx.query(`\n select count(*) from temp_warehouse_product_inventory \n `)\n\n while (hasMorePage) {\n hasMorePage = false\n try {\n // const { items, total } = await FulfillmentAPI.getInventoryProductGroupOpenAPI(fulfilmentCenter, {\n // warehouseId: customerBizplace.id,\n // paginationEntriesPerPage: limit,\n // paginationOffset: page\n // })\n\n const items = await tx.query(\n `\n select * from temp_warehouse_product_inventory limit $1 offset $2\n `,\n [limit, page * limit]\n )\n\n let sellercraftInv: any[] = []\n\n items.map(async item => {\n let packingSize: number = 1\n\n sellercraftInv.push({\n sku: item.product_sku,\n gtin: item.gtin,\n stock: {\n quantity_total: item.available_qty * packingSize < 0 ? 0 : item.available_qty * packingSize,\n quantity_reserved: item.reserved_qty * packingSize < 0 ? 0 : item.reserved_qty * packingSize,\n unit_of_measure: 'EA'\n },\n package_weight_gm: item.nett_weight <= 0 ? 1 : item.nett_weight,\n package_dimensions: {\n length_mm: item.depth <= 0 ? 1 : item.depth,\n width_mm: item.width <= 0 ? 1 : item.width,\n height_mm: item.height <= 0 ? 1 : item.height\n }\n })\n })\n\n const delay = (ms: number) => {\n return new Promise(resolve => setTimeout(resolve, ms))\n }\n\n await delay(500)\n\n await SellercraftAPI.updateProduct(sellercraft, { context, accountId: sellercraft.accountId, sellercraftInv })\n\n page++\n hasMorePage = (total[0]?.count || 0) > page * limit\n } catch (e) {\n logger.error(\n `[syncProductsToSellercraftResolver] sellercraftID:${sellercraftId} fulfillmentCenterId:${fulfillmentCenterId} page:${page} - ${e}`\n )\n }\n }\n } catch (e) {\n logger.error(`syncProductsToSellercraftResolver: ${e}`)\n }\n }\n}\n\n/**\n * @summary Check for product child qty at any scanned level\n * @description It will check every level of product detail by comparing scanned level and GAN registered level.\n * By getting the level that has relation, child qty will be retrieved\n * 1st level: PALLET -> 2 CARTONS (scan), 2nd level: CARTON -> 6 BAGS, 3rd level: BAG -> 10 UNITS, lowest: UNIT (order registered packing type)\n */\nexport async function getChildPackingSize(\n productDetails: ProductDetail[],\n defaultProductDetail: ProductDetail,\n unmatchingProductDetail: ProductDetail\n): Promise<number> {\n let hasChildRelation: boolean = Boolean(unmatchingProductDetail?.childProductDetail)\n let hasMatchingChild: boolean\n let packingSize: number = 1\n let currentChildProductDetail: ProductDetail\n\n if (hasChildRelation) {\n currentChildProductDetail = productDetails.find(\n (productDetail: ProductDetail) => productDetail.id === unmatchingProductDetail.childProductDetail.id\n )\n\n if (!currentChildProductDetail) {\n throw new Error(`Unable to find matching packing type for GTIN (${unmatchingProductDetail.gtin})`)\n }\n\n hasMatchingChild = Boolean(defaultProductDetail.id === currentChildProductDetail.id)\n if (hasMatchingChild) {\n packingSize = unmatchingProductDetail.packingSize\n } else {\n packingSize = unmatchingProductDetail.packingSize * packingSize\n }\n } else {\n throw new Error(`No child product result for GTIN (${unmatchingProductDetail.gtin})`)\n }\n\n while (hasChildRelation && !hasMatchingChild) {\n if (hasMatchingChild) {\n packingSize = currentChildProductDetail.packingSize * packingSize // 12 x 10\n } else if (!hasMatchingChild && hasChildRelation) {\n packingSize = currentChildProductDetail.packingSize * packingSize // 12 x 10\n currentChildProductDetail = productDetails.find(\n (productDetail: ProductDetail) => productDetail.id === currentChildProductDetail.childProductDetail.id\n )\n\n hasChildRelation = Boolean(currentChildProductDetail?.childProductDetail)\n hasMatchingChild = Boolean(defaultProductDetail.id === currentChildProductDetail.id)\n } else if (!hasChildRelation && !hasMatchingChild) {\n throw new Error(`Unable to find matching packing type for GTIN (${unmatchingProductDetail.gtin})`)\n }\n }\n\n return packingSize\n}\n"]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GenerateBizplaceInput = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.GenerateBizplaceInput = (0, graphql_tag_1.default) `
7
- input GenerateBizplaceInput {
8
- name: String!
9
- description: String
10
- address: String
11
- postalCode: String
12
- latlng: String
13
- }
14
- `;
15
- //# sourceMappingURL=generate-bizplace-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-bizplace-input.js","sourceRoot":"","sources":["../../../../server/graphql/types/generators/generate-bizplace-input.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,qBAAqB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;CAQvC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const GenerateBizplaceInput = gql`\n input GenerateBizplaceInput {\n name: String!\n description: String\n address: String\n postalCode: String\n latlng: String\n }\n`\n"]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GenerateCompanyInput = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.GenerateCompanyInput = (0, graphql_tag_1.default) `
7
- input GenerateCompanyInput {
8
- name: String!
9
- description: String
10
- address: String
11
- postalCode: String
12
- latlng: String
13
- }
14
- `;
15
- //# sourceMappingURL=generate-company-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-company-input.js","sourceRoot":"","sources":["../../../../server/graphql/types/generators/generate-company-input.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,oBAAoB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;CAQtC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const GenerateCompanyInput = gql`\n input GenerateCompanyInput {\n name: String!\n description: String\n address: String\n postalCode: String\n latlng: String\n }\n`\n"]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Types = exports.Mutation = void 0;
4
- const generate_company_input_1 = require("./generate-company-input");
5
- const generate_bizplace_input_1 = require("./generate-bizplace-input");
6
- const update_domain_type_input_1 = require("./update-domain-type-input");
7
- exports.Mutation = `
8
- generateCompany(businessInput: GenerateCompanyInput!): Company @transaction
9
- generateBizplace(bizplaceInput: GenerateBizplaceInput!): Bizplace @transaction
10
- updateDomainType(domainTypeInput: UpdateDomainTypeInput!): Domain @transaction
11
- `;
12
- exports.Types = [generate_company_input_1.GenerateCompanyInput, generate_bizplace_input_1.GenerateBizplaceInput, update_domain_type_input_1.UpdateDomainTypeInput];
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/generators/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAC/D,uEAAiE;AACjE,yEAAkE;AAErD,QAAA,QAAQ,GAAG;;;;CAIvB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,6CAAoB,EAAE,+CAAqB,EAAE,gDAAqB,CAAC,CAAA","sourcesContent":["import { GenerateCompanyInput } from './generate-company-input'\nimport { GenerateBizplaceInput } from './generate-bizplace-input'\nimport { UpdateDomainTypeInput } from './update-domain-type-input'\n\nexport const Mutation = `\n generateCompany(businessInput: GenerateCompanyInput!): Company @transaction\n generateBizplace(bizplaceInput: GenerateBizplaceInput!): Bizplace @transaction\n updateDomainType(domainTypeInput: UpdateDomainTypeInput!): Domain @transaction\n`\n\nexport const Types = [GenerateCompanyInput, GenerateBizplaceInput, UpdateDomainTypeInput]\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateDomainTypeInput = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.UpdateDomainTypeInput = (0, graphql_tag_1.default) `
7
- input UpdateDomainTypeInput {
8
- id: String!
9
- extType: String!
10
- }
11
- `;
12
- //# sourceMappingURL=update-domain-type-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-domain-type-input.js","sourceRoot":"","sources":["../../../../server/graphql/types/generators/update-domain-type-input.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,qBAAqB,GAAG,IAAA,qBAAG,EAAA;;;;;CAKvC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const UpdateDomainTypeInput = gql`\n input UpdateDomainTypeInput {\n id: String!\n extType: String!\n }\n`\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.types = exports.mutations = exports.queries = void 0;
4
- const tslib_1 = require("tslib");
5
- const Generators = tslib_1.__importStar(require("./generators"));
6
- const Invitations = tslib_1.__importStar(require("./invitations"));
7
- const Oauth2 = tslib_1.__importStar(require("./oauth2"));
8
- const Synchronization = tslib_1.__importStar(require("./synchronization"));
9
- exports.queries = [Synchronization.Query, Oauth2.Query];
10
- exports.mutations = [Generators.Mutation, Invitations.Mutation, Synchronization.Mutation];
11
- exports.types = [...Generators.Types, ...Synchronization.Types, ...Oauth2.Types];
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/types/index.ts"],"names":[],"mappings":";;;;AAAA,iEAA0C;AAC1C,mEAA4C;AAC5C,yDAAkC;AAClC,2EAAoD;AAEvC,QAAA,OAAO,GAAG,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;AAE/C,QAAA,SAAS,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;AAEjF,QAAA,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA","sourcesContent":["import * as Generators from './generators'\nimport * as Invitations from './invitations'\nimport * as Oauth2 from './oauth2'\nimport * as Synchronization from './synchronization'\n\nexport const queries = [Synchronization.Query, Oauth2.Query]\n\nexport const mutations = [Generators.Mutation, Invitations.Mutation, Synchronization.Mutation]\n\nexport const types = [...Generators.Types, ...Synchronization.Types, ...Oauth2.Types]\n"]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Mutation = void 0;
4
- exports.Mutation = `
5
- partnerInvitation(
6
- bizplaceName: String!
7
- ): Boolean
8
- `;
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/invitations/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAiB;;;;CAIrC,CAAA","sourcesContent":["export const Mutation = /* GraphQL */ `\n partnerInvitation(\n bizplaceName: String!\n ): Boolean\n`\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompanyRole = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.CompanyRole = (0, graphql_tag_1.default) `
7
- type CompanyRole {
8
- domain: Domain
9
- roles: [Role]
10
- }
11
- `;
12
- //# sourceMappingURL=company-role.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"company-role.js","sourceRoot":"","sources":["../../../../server/graphql/types/oauth2/company-role.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,WAAW,GAAG,IAAA,qBAAG,EAAA;;;;;CAK7B,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const CompanyRole = gql`\n type CompanyRole {\n domain: Domain\n roles: [Role]\n }\n`\n"]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Types = exports.Query = void 0;
4
- const company_role_1 = require("./company-role");
5
- exports.Query = `
6
- companyRolesByScope(scope: [String]!): [CompanyRole]
7
- `;
8
- exports.Types = [company_role_1.CompanyRole];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/oauth2/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE/B,QAAA,KAAK,GAAiB;;CAElC,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,0BAAW,CAAC,CAAA","sourcesContent":["import { CompanyRole } from './company-role'\n\nexport const Query = /* GraphQL */ `\n companyRolesByScope(scope: [String]!): [CompanyRole]\n`\n\nexport const Types = [CompanyRole]\n"]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Types = exports.Mutation = exports.Query = void 0;
4
- const sync_invoice_list_1 = require("./sync-invoice-list");
5
- const sync_invoice_set_1 = require("./sync-invoice-set");
6
- const sync_product_list_1 = require("./sync-product-list");
7
- const sync_product_set_1 = require("./sync-product-set");
8
- const sync_purchase_order_list_1 = require("./sync-purchase-order-list");
9
- const sync_purchase_order_set_1 = require("./sync-purchase-order-set");
10
- exports.Query = `
11
- fetchSyncProducts(accountId: String!, bizplaceId: String!, pagination: Pagination): SyncProductList
12
- fetchSyncPurchaseOrders(accountId: String!, warehouseId: String!, customerBizplaceId: String, fromDate: String, toDate: String): Boolean
13
- fetchSyncInvoices(accountId: String!, warehouseId: String!, customerBizplaceId: String!): Boolean
14
- `;
15
- exports.Mutation = `
16
- syncProductsToSellercraft(sellercraftId: String!, fulfillmentCenterId: String!): Boolean @transaction
17
- syncProductsFromAccount(accountId: String!, bizplaceId: String!): Boolean @transaction
18
- syncProductsToAccount(accountId: String!, bizplaceId: String!): Boolean @transaction
19
- syncAllProductsToSellercraft: Boolean @transaction
20
- sellercraftPackMarketplaceOrder: Boolean @transaction
21
- createDatShipments: Boolean @transaction
22
- autoUpdateAllMarketplaceProductVariationQuantity(companyDomainId: String, warehouseId: String): Boolean @transaction
23
- `;
24
- exports.Types = [
25
- sync_product_set_1.SyncProductSet,
26
- sync_product_list_1.SyncProductList,
27
- sync_purchase_order_set_1.SyncPurchaseOrderSet,
28
- sync_purchase_order_list_1.SyncPurchaseOrderList,
29
- ...sync_purchase_order_set_1.Types,
30
- sync_invoice_set_1.SyncInvoiceSet,
31
- sync_invoice_list_1.SyncInvoiceList,
32
- ...sync_invoice_set_1.Types
33
- ];
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,yDAAoE;AACpE,2DAAqD;AACrD,yDAAmD;AACnD,yEAAkE;AAClE,uEAAiF;AAEpE,QAAA,KAAK,GAAiB;;;;CAIlC,CAAA;AAEY,QAAA,QAAQ,GAAiB;;;;;;;;CAQrC,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,iCAAc;IACd,mCAAe;IACf,8CAAoB;IACpB,gDAAqB;IACrB,GAAG,+BAAM;IACT,iCAAc;IACd,mCAAe;IACf,GAAG,wBAAM;CACV,CAAA","sourcesContent":["import { SyncInvoiceList } from './sync-invoice-list'\nimport { SyncInvoiceSet, Types as iTypes } from './sync-invoice-set'\nimport { SyncProductList } from './sync-product-list'\nimport { SyncProductSet } from './sync-product-set'\nimport { SyncPurchaseOrderList } from './sync-purchase-order-list'\nimport { SyncPurchaseOrderSet, Types as pTypes } from './sync-purchase-order-set'\n\nexport const Query = /* GraphQL */ `\n fetchSyncProducts(accountId: String!, bizplaceId: String!, pagination: Pagination): SyncProductList\n fetchSyncPurchaseOrders(accountId: String!, warehouseId: String!, customerBizplaceId: String, fromDate: String, toDate: String): Boolean\n fetchSyncInvoices(accountId: String!, warehouseId: String!, customerBizplaceId: String!): Boolean\n`\n\nexport const Mutation = /* GraphQL */ `\n syncProductsToSellercraft(sellercraftId: String!, fulfillmentCenterId: String!): Boolean @transaction\n syncProductsFromAccount(accountId: String!, bizplaceId: String!): Boolean @transaction\n syncProductsToAccount(accountId: String!, bizplaceId: String!): Boolean @transaction\n syncAllProductsToSellercraft: Boolean @transaction\n sellercraftPackMarketplaceOrder: Boolean @transaction\n createDatShipments: Boolean @transaction\n autoUpdateAllMarketplaceProductVariationQuantity(companyDomainId: String, warehouseId: String): Boolean @transaction\n`\n\nexport const Types = [\n SyncProductSet,\n SyncProductList,\n SyncPurchaseOrderSet,\n SyncPurchaseOrderList,\n ...pTypes,\n SyncInvoiceSet,\n SyncInvoiceList,\n ...iTypes\n]\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SyncInvoiceList = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.SyncInvoiceList = (0, graphql_tag_1.default) `
7
- type SyncInvoiceList {
8
- items: [SyncInvoiceSet]
9
- total: Int
10
- }
11
- `;
12
- //# sourceMappingURL=sync-invoice-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-invoice-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/sync-invoice-list.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,eAAe,GAAG,IAAA,qBAAG,EAAA;;;;;CAKjC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const SyncInvoiceList = gql`\n type SyncInvoiceList {\n items: [SyncInvoiceSet]\n total: Int\n }\n`\n"]}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Types = exports.SyncInvoiceSet = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.SyncInvoiceSet = (0, graphql_tag_1.default) `
7
- type SyncInvoiceSet {
8
- refNo: String
9
- refNo2: String
10
- releaseDate: String
11
- deliverTo: InvoiceContact
12
- orderInventories: [InvoiceLineItems]
13
- exportOption: Boolean
14
- ownTransport: Boolean
15
- collectionOrderNo: String
16
- }
17
- `;
18
- const InvoiceContact = (0, graphql_tag_1.default) `
19
- type InvoiceContact {
20
- accountNo: String
21
- name: String
22
- companyName: String
23
- phone: String
24
- email: String
25
- address: String
26
- billingAddress: String
27
- }
28
- `;
29
- const InvoiceLineItems = (0, graphql_tag_1.default) `
30
- type InvoiceLineItems {
31
- product: InvoiceItemCode
32
- batchId: String
33
- releaseQty: Float
34
- }
35
- `;
36
- const InvoiceItemCode = (0, graphql_tag_1.default) `
37
- type InvoiceItemCode {
38
- sku: String
39
- }
40
- `;
41
- exports.Types = [InvoiceContact, InvoiceLineItems, InvoiceItemCode];
42
- //# sourceMappingURL=sync-invoice-set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-invoice-set.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/sync-invoice-set.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;CAWhC,CAAA;AACD,MAAM,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;CAUzB,CAAA;AACD,MAAM,gBAAgB,GAAG,IAAA,qBAAG,EAAA;;;;;;CAM3B,CAAA;AACD,MAAM,eAAe,GAAG,IAAA,qBAAG,EAAA;;;;CAI1B,CAAA;AACY,QAAA,KAAK,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const SyncInvoiceSet = gql`\n type SyncInvoiceSet {\n refNo: String\n refNo2: String\n releaseDate: String\n deliverTo: InvoiceContact\n orderInventories: [InvoiceLineItems]\n exportOption: Boolean\n ownTransport: Boolean\n collectionOrderNo: String\n }\n`\nconst InvoiceContact = gql`\n type InvoiceContact {\n accountNo: String\n name: String\n companyName: String\n phone: String\n email: String\n address: String\n billingAddress: String\n }\n`\nconst InvoiceLineItems = gql`\n type InvoiceLineItems {\n product: InvoiceItemCode\n batchId: String\n releaseQty: Float\n }\n`\nconst InvoiceItemCode = gql`\n type InvoiceItemCode {\n sku: String\n }\n`\nexport const Types = [InvoiceContact, InvoiceLineItems, InvoiceItemCode]\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SyncProductList = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.SyncProductList = (0, graphql_tag_1.default) `
7
- type SyncProductList {
8
- items: [SyncProductSet]
9
- total: Int
10
- }
11
- `;
12
- //# sourceMappingURL=sync-product-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-product-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/sync-product-list.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,eAAe,GAAG,IAAA,qBAAG,EAAA;;;;;CAKjC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const SyncProductList = gql`\n type SyncProductList {\n items: [SyncProductSet]\n total: Int\n }\n`\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SyncProductSet = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.SyncProductSet = (0, graphql_tag_1.default) `
7
- type SyncProductSet {
8
- platformProduct: Product
9
- bizplaceProduct: Product
10
- }
11
- `;
12
- //# sourceMappingURL=sync-product-set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-product-set.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/sync-product-set.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;CAKhC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const SyncProductSet = gql`\n type SyncProductSet {\n platformProduct: Product\n bizplaceProduct: Product\n }\n`\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SyncPurchaseOrderList = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.SyncPurchaseOrderList = (0, graphql_tag_1.default) `
7
- type SyncPurchaseOrderList {
8
- items: [SyncPurchaseOrderSet]
9
- total: Int
10
- }
11
- `;
12
- //# sourceMappingURL=sync-purchase-order-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-purchase-order-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/sync-purchase-order-list.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,qBAAqB,GAAG,IAAA,qBAAG,EAAA;;;;;CAKvC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const SyncPurchaseOrderList = gql`\n type SyncPurchaseOrderList {\n items: [SyncPurchaseOrderSet]\n total: Int\n }\n`\n"]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Types = exports.SyncPurchaseOrderSet = void 0;
4
- const tslib_1 = require("tslib");
5
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
- exports.SyncPurchaseOrderSet = (0, graphql_tag_1.default) `
7
- type SyncPurchaseOrderSet {
8
- refNo: String
9
- refNo2: String
10
- etaDate: String
11
- ownTransport: Boolean
12
- importCargo: Boolean
13
- container: Boolean
14
- orderProducts: [PurchaseOrderLineItems]
15
- }
16
- `;
17
- const PurchaseOrderLineItems = (0, graphql_tag_1.default) `
18
- type PurchaseOrderLineItems {
19
- product: PurchaseOrderItemCode
20
- batchId: String
21
- packQty: Float
22
- unitPrice: Float
23
- remark: String
24
- }
25
- `;
26
- const PurchaseOrderItemCode = (0, graphql_tag_1.default) `
27
- type PurchaseOrderItemCode {
28
- sku: String
29
- }
30
- `;
31
- exports.Types = [PurchaseOrderLineItems, PurchaseOrderItemCode];
32
- //# sourceMappingURL=sync-purchase-order-set.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-purchase-order-set.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/sync-purchase-order-set.ts"],"names":[],"mappings":";;;;AAAA,sEAA6B;AAEhB,QAAA,oBAAoB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;CAUtC,CAAA;AACD,MAAM,sBAAsB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;CAQjC,CAAA;AACD,MAAM,qBAAqB,GAAG,IAAA,qBAAG,EAAA;;;;CAIhC,CAAA;AACY,QAAA,KAAK,GAAG,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nexport const SyncPurchaseOrderSet = gql`\n type SyncPurchaseOrderSet {\n refNo: String\n refNo2: String\n etaDate: String\n ownTransport: Boolean\n importCargo: Boolean\n container: Boolean\n orderProducts: [PurchaseOrderLineItems]\n }\n`\nconst PurchaseOrderLineItems = gql`\n type PurchaseOrderLineItems {\n product: PurchaseOrderItemCode\n batchId: String\n packQty: Float\n unitPrice: Float\n remark: String\n }\n`\nconst PurchaseOrderItemCode = gql`\n type PurchaseOrderItemCode {\n sku: String\n }\n`\nexport const Types = [PurchaseOrderLineItems, PurchaseOrderItemCode]\n"]}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- require("./routers/api");
5
- require("./routes");
6
- const biz_base_1 = require("@things-factory/biz-base");
7
- const shell_1 = require("@things-factory/shell");
8
- tslib_1.__exportStar(require("./graphql"), exports);
9
- tslib_1.__exportStar(require("./middlewares"), exports);
10
- tslib_1.__exportStar(require("./migrations"), exports);
11
- process.on('bootstrap-module-start', async ({ app, config, schema }) => {
12
- process.superUserGranted = async (domain, user) => {
13
- if (!domain || !user) {
14
- return false;
15
- }
16
- if (domain.extType === 'company') {
17
- return domain.owner === user.id;
18
- }
19
- else {
20
- const { company } = await (0, shell_1.getRepository)(biz_base_1.Bizplace).findOne({
21
- where: { domain: { id: domain.id } },
22
- relations: ['company', 'company.domain']
23
- });
24
- const companyDomain = company.domain;
25
- return companyDomain.owner === user.id;
26
- }
27
- };
28
- });
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,yBAAsB;AACtB,oBAAiB;AAGjB,uDAAmD;AACnD,iDAA6D;AAE7D,oDAAyB;AACzB,wDAA6B;AAC7B,uDAA4B;AAU5B,OAAO,CAAC,EAAE,CAAC,wBAA+B,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAO,EAAE,EAAE;IACjF,OAAO,CAAC,gBAAgB,GAAG,KAAK,EAAE,MAAc,EAAE,IAAU,EAAoB,EAAE;QAChF,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE;YACpB,OAAO,KAAK,CAAA;SACb;QAED,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE;YAChC,OAAO,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,CAAA;SAChC;aAAM;YACL,MAAM,EAAE,OAAO,EAAE,GAAa,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;gBAClE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE;gBACpC,SAAS,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC;aACzC,CAAC,CAAA;YACF,MAAM,aAAa,GAAW,OAAO,CAAC,MAAM,CAAA;YAC5C,OAAO,aAAa,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,CAAA;SACvC;IACH,CAAC,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["import './routers/api'\nimport './routes'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-base'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nexport * from './graphql'\nexport * from './middlewares'\nexport * from './migrations'\n\ndeclare global {\n namespace NodeJS {\n interface Process {\n superUserGranted: (domain: Domain, user: User) => Promise<boolean>\n }\n }\n}\n\nprocess.on('bootstrap-module-start' as any, async ({ app, config, schema }: any) => {\n process.superUserGranted = async (domain: Domain, user: User): Promise<boolean> => {\n if (!domain || !user) {\n return false\n }\n\n if (domain.extType === 'company') {\n return domain.owner === user.id\n } else {\n const { company }: Bizplace = await getRepository(Bizplace).findOne({\n where: { domain: { id: domain.id } },\n relations: ['company', 'company.domain']\n })\n const companyDomain: Domain = company.domain\n return companyDomain.owner === user.id\n }\n }\n})\n"]}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.businessMiddleware = void 0;
4
- const auth_base_1 = require("@things-factory/auth-base");
5
- const biz_base_1 = require("@things-factory/biz-base");
6
- const shell_1 = require("@things-factory/shell");
7
- const debug = require('debug')('things-factory:operato-hub:business-middleware');
8
- async function businessMiddleware(context, next) {
9
- const { user } = context.state;
10
- debug('user', user === null || user === void 0 ? void 0 : user.email);
11
- if (user) {
12
- const domain = await (0, shell_1.getDomainFromURL)(context);
13
- const application = await (0, shell_1.getRepository)(auth_base_1.Application).findOne({ where: { id: user.reference } });
14
- let company;
15
- if (domain.extType === 'company') {
16
- company = await (0, shell_1.getRepository)(biz_base_1.Company).findOne({ where: { domain: { id: domain.id } }, relations: ['domain'] });
17
- }
18
- else {
19
- const bizplace = await (0, shell_1.getRepository)(biz_base_1.Bizplace).findOne({
20
- where: { domain: { id: domain.id } },
21
- relations: ['company', 'domain']
22
- });
23
- company = bizplace.company;
24
- }
25
- context.state.business = company;
26
- context.state.application = application;
27
- }
28
- await next();
29
- }
30
- exports.businessMiddleware = businessMiddleware;
31
- //# sourceMappingURL=business-middleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"business-middleware.js","sourceRoot":"","sources":["../../server/middlewares/business-middleware.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AACvD,uDAA4D;AAC5D,iDAA+E;AAE/E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,gDAAgD,CAAC,CAAA;AAEzE,KAAK,UAAU,kBAAkB,CAAC,OAAO,EAAE,IAAI;IACpD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE9B,KAAK,CAAC,MAAM,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,CAAA;IAE1B,IAAI,IAAI,EAAE;QACR,MAAM,MAAM,GAAW,MAAM,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAA;QACtD,MAAM,WAAW,GAAgB,MAAM,IAAA,qBAAa,EAAC,uBAAW,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QAE5G,IAAI,OAAgB,CAAA;QACpB,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE;YAChC,OAAO,GAAG,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;SAChH;aAAM;YACL,MAAM,QAAQ,GAAa,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;gBAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE;gBACpC,SAAS,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aACjC,CAAC,CAAA;YACF,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;SAC3B;QAED,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAA;QAChC,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,WAAW,CAAA;KACxC;IAED,MAAM,IAAI,EAAE,CAAA;AACd,CAAC;AAzBD,gDAyBC","sourcesContent":["import { Application } from '@things-factory/auth-base'\nimport { Bizplace, Company } from '@things-factory/biz-base'\nimport { Domain, getDomainFromURL, getRepository } from '@things-factory/shell'\n\nconst debug = require('debug')('things-factory:operato-hub:business-middleware')\n\nexport async function businessMiddleware(context, next) {\n const { user } = context.state\n\n debug('user', user?.email)\n\n if (user) {\n const domain: Domain = await getDomainFromURL(context)\n const application: Application = await getRepository(Application).findOne({ where: { id: user.reference } })\n\n let company: Company\n if (domain.extType === 'company') {\n company = await getRepository(Company).findOne({ where: { domain: { id: domain.id } }, relations: ['domain'] })\n } else {\n const bizplace: Bizplace = await getRepository(Bizplace).findOne({\n where: { domain: { id: domain.id } },\n relations: ['company', 'domain']\n })\n company = bizplace.company\n }\n\n context.state.business = company\n context.state.application = application\n }\n\n await next()\n}\n"]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initMiddlewares = void 0;
4
- const business_middleware_1 = require("./business-middleware");
5
- const debug = require('debug')('things-factory:operato-hub:index');
6
- function initMiddlewares(app) {
7
- /*
8
- * post:graphql 에 대해서는 businessMiddleware를 적용한다.
9
- * graphql app을 router에 적용하지 못하기 때문임.
10
- */
11
- app.use(async (context, next) => {
12
- const { method, path } = context;
13
- if (method == 'POST' && (path.startsWith('/graphql'))) {
14
- debug(method, path);
15
- return await (0, business_middleware_1.businessMiddleware)(context, next);
16
- }
17
- await next();
18
- });
19
- }
20
- exports.initMiddlewares = initMiddlewares;
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,kCAAkC,CAAC,CAAA;AAElE,SAAgB,eAAe,CAAC,GAAG;IACjC;;;OAGG;IACH,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC9B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;QAEhC,IAAI,MAAM,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE;YACrD,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACnB,OAAO,MAAM,IAAA,wCAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAA;SAC/C;QAED,MAAM,IAAI,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC;AAfD,0CAeC","sourcesContent":["import { businessMiddleware } from './business-middleware'\n\nconst debug = require('debug')('things-factory:operato-hub:index')\n\nexport function initMiddlewares(app) {\n /*\n * post:graphql 에 대해서는 businessMiddleware를 적용한다.\n * graphql app을 router에 적용하지 못하기 때문임.\n */\n app.use(async (context, next) => {\n const { method, path } = context\n\n if (method == 'POST' && (path.startsWith('/graphql'))) {\n debug(method, path)\n return await businessMiddleware(context, next)\n }\n\n await next()\n })\n}"]}