@xxmachina/common 19.0.0-preview.2 → 19.0.0-preview.21

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 (581) hide show
  1. package/_shared/meta/index.d.ts +1 -0
  2. package/_shared/meta/redis/redis.repository.d.ts +6 -3
  3. package/auth/auth.service.d.ts +3 -0
  4. package/azure-auth/auth.service.d.ts +3 -0
  5. package/domain/builder/command/command.builder.d.ts +1 -2
  6. package/domain/builder/command-action/command-action.builder.d.ts +1 -1
  7. package/domain/builder/index.d.ts +4 -0
  8. package/domain/builder/screen-item/screen-item.builder.d.ts +2 -2
  9. package/domain/index.d.ts +2 -1
  10. package/domain/models/index.d.ts +8 -2
  11. package/domain/models/links/index.d.ts +1 -0
  12. package/{domain/invoice → domain-invoice}/builders/email/email.builder.d.ts +1 -1
  13. package/domain-invoice/builders/index.d.ts +3 -0
  14. package/{domain/invoice → domain-invoice}/builders/message/message.builder.d.ts +1 -1
  15. package/{domain/invoice → domain-invoice}/builders/title/title.builder.d.ts +1 -1
  16. package/domain-invoice/index.d.ts +3 -0
  17. package/{domain/invoice → domain-invoice}/models/backoffice/invoice.d.ts +1 -1
  18. package/{domain/invoice → domain-invoice}/models/backoffice/order.d.ts +1 -1
  19. package/{domain/invoice → domain-invoice}/models/backoffice/partner.d.ts +1 -1
  20. package/{domain → domain-invoice}/resolvers/invoice.resolver.d.ts +1 -1
  21. package/fesm2022/xxmachina-common-_shared-auth-passports-anonymous.mjs +20 -0
  22. package/fesm2022/xxmachina-common-_shared-auth-passports-anonymous.mjs.map +1 -0
  23. package/fesm2022/xxmachina-common-_shared-auth-passports-firebase.mjs +41 -0
  24. package/fesm2022/xxmachina-common-_shared-auth-passports-firebase.mjs.map +1 -0
  25. package/fesm2022/xxmachina-common-_shared-auth-passports-internal.mjs +34 -0
  26. package/fesm2022/xxmachina-common-_shared-auth-passports-internal.mjs.map +1 -0
  27. package/fesm2022/xxmachina-common-_shared-auth-passports-msal.mjs +49 -0
  28. package/fesm2022/xxmachina-common-_shared-auth-passports-msal.mjs.map +1 -0
  29. package/fesm2022/xxmachina-common-_shared-auth.mjs +25 -0
  30. package/fesm2022/xxmachina-common-_shared-auth.mjs.map +1 -0
  31. package/fesm2022/xxmachina-common-_shared-meta-redis.mjs +99 -0
  32. package/fesm2022/xxmachina-common-_shared-meta-redis.mjs.map +1 -0
  33. package/fesm2022/xxmachina-common-_shared-meta.mjs +26 -0
  34. package/fesm2022/xxmachina-common-_shared-meta.mjs.map +1 -0
  35. package/fesm2022/xxmachina-common-auth.mjs +17 -0
  36. package/fesm2022/xxmachina-common-auth.mjs.map +1 -0
  37. package/fesm2022/xxmachina-common-azure-auth.mjs +160 -0
  38. package/fesm2022/xxmachina-common-azure-auth.mjs.map +1 -0
  39. package/{domain/builder/screen-item/screen-item.builder.js → fesm2022/xxmachina-common-domain-builder-screen-item.mjs} +10 -11
  40. package/fesm2022/xxmachina-common-domain-builder-screen-item.mjs.map +1 -0
  41. package/fesm2022/xxmachina-common-domain-builder.mjs +470 -0
  42. package/fesm2022/xxmachina-common-domain-builder.mjs.map +1 -0
  43. package/fesm2022/xxmachina-common-domain-invoice-builders.mjs +70 -0
  44. package/fesm2022/xxmachina-common-domain-invoice-builders.mjs.map +1 -0
  45. package/fesm2022/xxmachina-common-domain-invoice-models.mjs +427 -0
  46. package/fesm2022/xxmachina-common-domain-invoice-models.mjs.map +1 -0
  47. package/fesm2022/xxmachina-common-domain-invoice-resolvers.mjs +39 -0
  48. package/fesm2022/xxmachina-common-domain-invoice-resolvers.mjs.map +1 -0
  49. package/fesm2022/xxmachina-common-domain-invoice.mjs +8 -0
  50. package/fesm2022/xxmachina-common-domain-invoice.mjs.map +1 -0
  51. package/fesm2022/xxmachina-common-domain-models.mjs +783 -0
  52. package/fesm2022/xxmachina-common-domain-models.mjs.map +1 -0
  53. package/fesm2022/xxmachina-common-domain.mjs +7 -0
  54. package/fesm2022/xxmachina-common-domain.mjs.map +1 -0
  55. package/fesm2022/xxmachina-common-infra-converters-google.mjs +36 -0
  56. package/fesm2022/xxmachina-common-infra-converters-google.mjs.map +1 -0
  57. package/fesm2022/xxmachina-common-infra-external-data-connect.mjs +13 -0
  58. package/fesm2022/xxmachina-common-infra-external-data-connect.mjs.map +1 -0
  59. package/fesm2022/xxmachina-common-infra-external-quick-js.mjs +44 -0
  60. package/fesm2022/xxmachina-common-infra-external-quick-js.mjs.map +1 -0
  61. package/fesm2022/xxmachina-common-infra-external-resend.mjs +10 -0
  62. package/fesm2022/xxmachina-common-infra-external-resend.mjs.map +1 -0
  63. package/fesm2022/xxmachina-common-infra-external.mjs +36 -0
  64. package/fesm2022/xxmachina-common-infra-external.mjs.map +1 -0
  65. package/fesm2022/xxmachina-common-infra-query-firestore.mjs +34 -0
  66. package/fesm2022/xxmachina-common-infra-query-firestore.mjs.map +1 -0
  67. package/fesm2022/xxmachina-common-infra-query-hasura.mjs +20 -0
  68. package/fesm2022/xxmachina-common-infra-query-hasura.mjs.map +1 -0
  69. package/fesm2022/xxmachina-common-infra-repository-dataconnect.mjs +18 -0
  70. package/fesm2022/xxmachina-common-infra-repository-dataconnect.mjs.map +1 -0
  71. package/fesm2022/xxmachina-common-infra-repository-firestore.mjs +74 -0
  72. package/fesm2022/xxmachina-common-infra-repository-firestore.mjs.map +1 -0
  73. package/fesm2022/xxmachina-common-infra-repository-hasura.mjs +41 -0
  74. package/fesm2022/xxmachina-common-infra-repository-hasura.mjs.map +1 -0
  75. package/fesm2022/xxmachina-common-infra-repository-notion.mjs +112 -0
  76. package/fesm2022/xxmachina-common-infra-repository-notion.mjs.map +1 -0
  77. package/fesm2022/xxmachina-common-infra.mjs +377 -0
  78. package/fesm2022/xxmachina-common-infra.mjs.map +1 -0
  79. package/fesm2022/xxmachina-common-stores-firestore.mjs +33 -0
  80. package/fesm2022/xxmachina-common-stores-firestore.mjs.map +1 -0
  81. package/fesm2022/xxmachina-common-stores-hasura.mjs +32 -0
  82. package/fesm2022/xxmachina-common-stores-hasura.mjs.map +1 -0
  83. package/fesm2022/xxmachina-common-stores.mjs +16 -0
  84. package/fesm2022/xxmachina-common-stores.mjs.map +1 -0
  85. package/fesm2022/xxmachina-common-usecase-assistant.mjs +67 -0
  86. package/fesm2022/xxmachina-common-usecase-assistant.mjs.map +1 -0
  87. package/fesm2022/xxmachina-common-usecase-database.mjs +95 -0
  88. package/fesm2022/xxmachina-common-usecase-database.mjs.map +1 -0
  89. package/fesm2022/xxmachina-common-usecase-graphql.mjs +51 -0
  90. package/fesm2022/xxmachina-common-usecase-graphql.mjs.map +1 -0
  91. package/fesm2022/xxmachina-common-usecase-invoice.mjs +67 -0
  92. package/fesm2022/xxmachina-common-usecase-invoice.mjs.map +1 -0
  93. package/fesm2022/xxmachina-common-usecase-link.mjs +26 -0
  94. package/fesm2022/xxmachina-common-usecase-link.mjs.map +1 -0
  95. package/fesm2022/xxmachina-common-usecase-order.mjs +29 -0
  96. package/fesm2022/xxmachina-common-usecase-order.mjs.map +1 -0
  97. package/fesm2022/xxmachina-common-usecase-project.mjs +35 -0
  98. package/fesm2022/xxmachina-common-usecase-project.mjs.map +1 -0
  99. package/fesm2022/xxmachina-common-usecase-spec.mjs +45 -0
  100. package/fesm2022/xxmachina-common-usecase-spec.mjs.map +1 -0
  101. package/fesm2022/xxmachina-common-usecase.mjs +198 -0
  102. package/fesm2022/xxmachina-common-usecase.mjs.map +1 -0
  103. package/{utils/crypto.js → fesm2022/xxmachina-common-utils-crypto.mjs} +10 -12
  104. package/fesm2022/xxmachina-common-utils-crypto.mjs.map +1 -0
  105. package/{utils/extract-display-fields.js → fesm2022/xxmachina-common-utils.mjs} +7 -4
  106. package/fesm2022/xxmachina-common-utils.mjs.map +1 -0
  107. package/fesm2022/xxmachina-common.mjs +6 -0
  108. package/fesm2022/xxmachina-common.mjs.map +1 -0
  109. package/index.d.ts +1 -0
  110. package/{infrastructure → infra}/converters/google/google.converter.d.ts +4 -1
  111. package/{infrastructure → infra}/external/external.config.d.ts +2 -2
  112. package/{infrastructure → infra}/external/external.service.d.ts +4 -1
  113. package/{infrastructure → infra}/external/quick-js/quick-js.service.d.ts +3 -0
  114. package/infra/external/resend/resend.service.d.ts +2 -0
  115. package/{infrastructure → infra}/external/resend/resend.service.impl.d.ts +4 -8
  116. package/{infrastructure → infra}/infrastructure.config.d.ts +5 -5
  117. package/{infrastructure → infra}/infrastructure.service.d.ts +3 -0
  118. package/infra/query/firestore/index.d.ts +2 -0
  119. package/{infrastructure → infra}/query/firestore/query/query.query.d.ts +3 -0
  120. package/{infrastructure → infra}/query/firestore/resource/resource.query.d.ts +3 -0
  121. package/infra/query/hasura/index.d.ts +1 -0
  122. package/infra/query/hasura/resource/resource.query.d.ts +6 -0
  123. package/infra/repository/dataconnect/index.d.ts +2 -0
  124. package/{infrastructure → infra}/repository/dataconnect/invoice/invoice.repository.impl.d.ts +4 -1
  125. package/{infrastructure → infra}/repository/dataconnect/order/order.repository.impl.d.ts +4 -1
  126. package/infra/repository/firestore/firestore.repository.d.ts +8 -0
  127. package/infra/repository/firestore/index.d.ts +3 -0
  128. package/infra/repository/firestore/link/google/google.repository.d.ts +10 -0
  129. package/infra/repository/firestore/link/link.repository.d.ts +8 -0
  130. package/{infrastructure → infra}/repository/firestore/query/query.repository.d.ts +4 -1
  131. package/{infrastructure → infra}/repository/firestore/resource/resource.repository.d.ts +4 -1
  132. package/infra/repository/hasura/index.d.ts +2 -0
  133. package/{infrastructure → infra}/repository/hasura/query/query.repository.d.ts +3 -0
  134. package/{infrastructure → infra}/repository/hasura/resource/resource.repository.d.ts +3 -0
  135. package/{infrastructure → infra}/repository/notion/contract/contract.repository.d.ts +4 -1
  136. package/infra/repository/notion/index.d.ts +6 -0
  137. package/{infrastructure → infra}/repository/notion/invoice/invoice.repository.d.ts +4 -1
  138. package/{infrastructure → infra}/repository/notion/notion.repository.d.ts +3 -0
  139. package/{infrastructure → infra}/repository/notion/order/order.repository.d.ts +4 -1
  140. package/{infrastructure → infra}/repository/notion/partner/partner.repository.d.ts +4 -1
  141. package/{infrastructure → infra}/repository/redis/operator/operator.repository.d.ts +3 -0
  142. package/{infrastructure → infra}/repository/redis/project/project.repository.d.ts +3 -0
  143. package/{infrastructure → infra}/repository/redis/redis.service.d.ts +3 -0
  144. package/{infrastructure → infra}/repository/redis/spec/spec.repository.d.ts +5 -3
  145. package/infra/repository/redis/system/system.repository.d.ts +6 -0
  146. package/{infrastructure → infra}/repository/repository.config.d.ts +4 -4
  147. package/{infrastructure → infra}/repository/repository.service.d.ts +3 -0
  148. package/package.json +199 -13
  149. package/stores/firestore/firestore.store.d.ts +12 -0
  150. package/stores/firestore/index.d.ts +1 -0
  151. package/stores/hasura/hasura.store.d.ts +12 -0
  152. package/stores/hasura/index.d.ts +1 -0
  153. package/stores/index.d.ts +4 -28
  154. package/usecase/assistant/assistant.service.d.ts +4 -1
  155. package/usecase/database/database.service.d.ts +3 -0
  156. package/usecase/graphql/graphql.service.d.ts +3 -0
  157. package/usecase/invoice/invoice.service.d.ts +9 -13
  158. package/usecase/link/link.service.d.ts +5 -2
  159. package/usecase/order/order.service.d.ts +5 -2
  160. package/usecase/project/project.service.d.ts +4 -1
  161. package/usecase/spec/spec.service.d.ts +4 -1
  162. package/usecase/usecase.service.d.ts +3 -0
  163. package/utils/crypto/index.d.ts +1 -0
  164. package/README.md +0 -11
  165. package/_shared/auth/auth.module.js +0 -22
  166. package/_shared/auth/auth.module.js.map +0 -1
  167. package/_shared/auth/index.js +0 -5
  168. package/_shared/auth/index.js.map +0 -1
  169. package/_shared/auth/passports/anonymous/anonymous.strategy.js +0 -19
  170. package/_shared/auth/passports/anonymous/anonymous.strategy.js.map +0 -1
  171. package/_shared/auth/passports/anonymous/index.js +0 -5
  172. package/_shared/auth/passports/anonymous/index.js.map +0 -1
  173. package/_shared/auth/passports/firebase/firebase.guard.js +0 -23
  174. package/_shared/auth/passports/firebase/firebase.guard.js.map +0 -1
  175. package/_shared/auth/passports/firebase/firebase.strategy.js +0 -22
  176. package/_shared/auth/passports/firebase/firebase.strategy.js.map +0 -1
  177. package/_shared/auth/passports/firebase/index.js +0 -6
  178. package/_shared/auth/passports/firebase/index.js.map +0 -1
  179. package/_shared/auth/passports/internal/index.js +0 -5
  180. package/_shared/auth/passports/internal/index.js.map +0 -1
  181. package/_shared/auth/passports/internal/internal.strategy.js +0 -33
  182. package/_shared/auth/passports/internal/internal.strategy.js.map +0 -1
  183. package/_shared/auth/passports/msal/index.js +0 -6
  184. package/_shared/auth/passports/msal/index.js.map +0 -1
  185. package/_shared/auth/passports/msal/msal.guard.js +0 -13
  186. package/_shared/auth/passports/msal/msal.guard.js.map +0 -1
  187. package/_shared/auth/passports/msal/msal.strategy.js +0 -43
  188. package/_shared/auth/passports/msal/msal.strategy.js.map +0 -1
  189. package/_shared/meta/decorators.js +0 -25
  190. package/_shared/meta/decorators.js.map +0 -1
  191. package/_shared/meta/redis/index.js +0 -6
  192. package/_shared/meta/redis/index.js.map +0 -1
  193. package/_shared/meta/redis/redis.config.js +0 -10
  194. package/_shared/meta/redis/redis.config.js.map +0 -1
  195. package/_shared/meta/redis/redis.repository.js +0 -108
  196. package/_shared/meta/redis/redis.repository.js.map +0 -1
  197. package/auth/auth.service.js +0 -12
  198. package/auth/auth.service.js.map +0 -1
  199. package/auth/index.js +0 -5
  200. package/auth/index.js.map +0 -1
  201. package/azure-auth/auth.di.js +0 -56
  202. package/azure-auth/auth.di.js.map +0 -1
  203. package/azure-auth/auth.service.js +0 -115
  204. package/azure-auth/auth.service.js.map +0 -1
  205. package/azure-auth/index.js +0 -6
  206. package/azure-auth/index.js.map +0 -1
  207. package/domain/builder/command/command.builder.js +0 -30
  208. package/domain/builder/command/command.builder.js.map +0 -1
  209. package/domain/builder/command/index.js +0 -5
  210. package/domain/builder/command/index.js.map +0 -1
  211. package/domain/builder/command-action/command-action.builder.js +0 -139
  212. package/domain/builder/command-action/command-action.builder.js.map +0 -1
  213. package/domain/builder/command-action/index.js +0 -5
  214. package/domain/builder/command-action/index.js.map +0 -1
  215. package/domain/builder/er/er.builder.js +0 -112
  216. package/domain/builder/er/er.builder.js.map +0 -1
  217. package/domain/builder/er/index.js +0 -5
  218. package/domain/builder/er/index.js.map +0 -1
  219. package/domain/builder/screen-item/index.js +0 -5
  220. package/domain/builder/screen-item/index.js.map +0 -1
  221. package/domain/builder/screen-item/screen-item.builder.js.map +0 -1
  222. package/domain/index.js +0 -5
  223. package/domain/index.js.map +0 -1
  224. package/domain/invoice/builders/email/email.builder.js +0 -29
  225. package/domain/invoice/builders/email/email.builder.js.map +0 -1
  226. package/domain/invoice/builders/email/index.js +0 -5
  227. package/domain/invoice/builders/email/index.js.map +0 -1
  228. package/domain/invoice/builders/message/index.js +0 -5
  229. package/domain/invoice/builders/message/index.js.map +0 -1
  230. package/domain/invoice/builders/message/message.builder.js +0 -43
  231. package/domain/invoice/builders/message/message.builder.js.map +0 -1
  232. package/domain/invoice/builders/title/index.js +0 -5
  233. package/domain/invoice/builders/title/index.js.map +0 -1
  234. package/domain/invoice/builders/title/title.builder.js +0 -11
  235. package/domain/invoice/builders/title/title.builder.js.map +0 -1
  236. package/domain/invoice/models/backoffice/contract.js +0 -50
  237. package/domain/invoice/models/backoffice/contract.js.map +0 -1
  238. package/domain/invoice/models/backoffice/index.js +0 -9
  239. package/domain/invoice/models/backoffice/index.js.map +0 -1
  240. package/domain/invoice/models/backoffice/invoice-mail.js +0 -7
  241. package/domain/invoice/models/backoffice/invoice-mail.js.map +0 -1
  242. package/domain/invoice/models/backoffice/invoice.js +0 -91
  243. package/domain/invoice/models/backoffice/invoice.js.map +0 -1
  244. package/domain/invoice/models/backoffice/order.js +0 -157
  245. package/domain/invoice/models/backoffice/order.js.map +0 -1
  246. package/domain/invoice/models/backoffice/partner.js +0 -96
  247. package/domain/invoice/models/backoffice/partner.js.map +0 -1
  248. package/domain/invoice/models/index.js +0 -5
  249. package/domain/invoice/models/index.js.map +0 -1
  250. package/domain/models/agent/assistant.js +0 -31
  251. package/domain/models/agent/assistant.js.map +0 -1
  252. package/domain/models/agent/index.js +0 -5
  253. package/domain/models/agent/index.js.map +0 -1
  254. package/domain/models/bookmarklet/bookmarklet.js +0 -34
  255. package/domain/models/bookmarklet/bookmarklet.js.map +0 -1
  256. package/domain/models/bookmarklet/index.js +0 -5
  257. package/domain/models/bookmarklet/index.js.map +0 -1
  258. package/domain/models/calendar-utils.d.ts +0 -5
  259. package/domain/models/calendar-utils.js +0 -43
  260. package/domain/models/calendar-utils.js.map +0 -1
  261. package/domain/models/command/command.helper.js +0 -14
  262. package/domain/models/command/command.helper.js.map +0 -1
  263. package/domain/models/command/command.js +0 -40
  264. package/domain/models/command/command.js.map +0 -1
  265. package/domain/models/command/index.js +0 -6
  266. package/domain/models/command/index.js.map +0 -1
  267. package/domain/models/database/database.js +0 -7
  268. package/domain/models/database/database.js.map +0 -1
  269. package/domain/models/database/index.js +0 -5
  270. package/domain/models/database/index.js.map +0 -1
  271. package/domain/models/endpoint/endpoint.helper.js +0 -21
  272. package/domain/models/endpoint/endpoint.helper.js.map +0 -1
  273. package/domain/models/endpoint/index.js +0 -5
  274. package/domain/models/endpoint/index.js.map +0 -1
  275. package/domain/models/index.js +0 -12
  276. package/domain/models/index.js.map +0 -1
  277. package/domain/models/links/google/google.js +0 -47
  278. package/domain/models/links/google/google.js.map +0 -1
  279. package/domain/models/links/google/index.js +0 -5
  280. package/domain/models/links/google/index.js.map +0 -1
  281. package/domain/models/openapi/index.js +0 -6
  282. package/domain/models/openapi/index.js.map +0 -1
  283. package/domain/models/openapi/openapi.js +0 -87
  284. package/domain/models/openapi/openapi.js.map +0 -1
  285. package/domain/models/openapi/openapi.schema.js +0 -3
  286. package/domain/models/openapi/openapi.schema.js.map +0 -1
  287. package/domain/models/operators/assistancts/base.js +0 -13
  288. package/domain/models/operators/assistancts/base.js.map +0 -1
  289. package/domain/models/operators/assistancts/index.js +0 -5
  290. package/domain/models/operators/assistancts/index.js.map +0 -1
  291. package/domain/models/operators/base.js +0 -10
  292. package/domain/models/operators/base.js.map +0 -1
  293. package/domain/models/operators/index.js +0 -8
  294. package/domain/models/operators/index.js.map +0 -1
  295. package/domain/models/operators/systems/base.js +0 -3
  296. package/domain/models/operators/systems/base.js.map +0 -1
  297. package/domain/models/operators/systems/graphql.js +0 -3
  298. package/domain/models/operators/systems/graphql.js.map +0 -1
  299. package/domain/models/operators/systems/index.js +0 -7
  300. package/domain/models/operators/systems/index.js.map +0 -1
  301. package/domain/models/operators/systems/rest.js +0 -3
  302. package/domain/models/operators/systems/rest.js.map +0 -1
  303. package/domain/models/operators/workflows/index.js +0 -5
  304. package/domain/models/operators/workflows/index.js.map +0 -1
  305. package/domain/models/operators/workflows/workflow.js +0 -3
  306. package/domain/models/operators/workflows/workflow.js.map +0 -1
  307. package/domain/models/project.js +0 -9
  308. package/domain/models/project.js.map +0 -1
  309. package/domain/models/query/index.js +0 -6
  310. package/domain/models/query/index.js.map +0 -1
  311. package/domain/models/query/query.helper.js +0 -172
  312. package/domain/models/query/query.helper.js.map +0 -1
  313. package/domain/models/query/query.js +0 -122
  314. package/domain/models/query/query.js.map +0 -1
  315. package/domain/models/resource/index.js +0 -6
  316. package/domain/models/resource/index.js.map +0 -1
  317. package/domain/models/resource/resource.helper.js +0 -16
  318. package/domain/models/resource/resource.helper.js.map +0 -1
  319. package/domain/models/resource/resource.js +0 -73
  320. package/domain/models/resource/resource.js.map +0 -1
  321. package/domain/models/scheduler/index.js +0 -5
  322. package/domain/models/scheduler/index.js.map +0 -1
  323. package/domain/models/scheduler/schedule.js +0 -89
  324. package/domain/models/scheduler/schedule.js.map +0 -1
  325. package/domain/models/screen-item/index.js +0 -5
  326. package/domain/models/screen-item/index.js.map +0 -1
  327. package/domain/models/screen-item/screen-item.js +0 -3
  328. package/domain/models/screen-item/screen-item.js.map +0 -1
  329. package/domain/models/spec.js +0 -3
  330. package/domain/models/spec.js.map +0 -1
  331. package/domain/resolvers/index.js +0 -5
  332. package/domain/resolvers/index.js.map +0 -1
  333. package/domain/resolvers/invoice.resolver.js +0 -31
  334. package/domain/resolvers/invoice.resolver.js.map +0 -1
  335. package/infrastructure/converters/bookmarklet/bookmarklet.converter.d.ts +0 -0
  336. package/infrastructure/converters/bookmarklet/bookmarklet.converter.js +0 -1
  337. package/infrastructure/converters/bookmarklet/bookmarklet.converter.js.map +0 -1
  338. package/infrastructure/converters/google/google.converter.js +0 -27
  339. package/infrastructure/converters/google/google.converter.js.map +0 -1
  340. package/infrastructure/converters/google/index.js +0 -5
  341. package/infrastructure/converters/google/index.js.map +0 -1
  342. package/infrastructure/external/data-connect/data-connect.service.impl.d.ts +0 -7
  343. package/infrastructure/external/data-connect/data-connect.service.impl.js +0 -20
  344. package/infrastructure/external/data-connect/data-connect.service.impl.js.map +0 -1
  345. package/infrastructure/external/data-connect/data-connect.service.js +0 -11
  346. package/infrastructure/external/data-connect/data-connect.service.js.map +0 -1
  347. package/infrastructure/external/data-connect/index.js +0 -5
  348. package/infrastructure/external/data-connect/index.js.map +0 -1
  349. package/infrastructure/external/external.config.js +0 -13
  350. package/infrastructure/external/external.config.js.map +0 -1
  351. package/infrastructure/external/external.service.js +0 -23
  352. package/infrastructure/external/external.service.js.map +0 -1
  353. package/infrastructure/external/index.js +0 -6
  354. package/infrastructure/external/index.js.map +0 -1
  355. package/infrastructure/external/quick-js/index.js +0 -5
  356. package/infrastructure/external/quick-js/index.js.map +0 -1
  357. package/infrastructure/external/quick-js/quick-js.service.js +0 -44
  358. package/infrastructure/external/quick-js/quick-js.service.js.map +0 -1
  359. package/infrastructure/external/resend/index.js +0 -5
  360. package/infrastructure/external/resend/index.js.map +0 -1
  361. package/infrastructure/external/resend/resend.service.d.ts +0 -9
  362. package/infrastructure/external/resend/resend.service.impl.js +0 -27
  363. package/infrastructure/external/resend/resend.service.impl.js.map +0 -1
  364. package/infrastructure/external/resend/resend.service.js +0 -6
  365. package/infrastructure/external/resend/resend.service.js.map +0 -1
  366. package/infrastructure/index.js +0 -6
  367. package/infrastructure/index.js.map +0 -1
  368. package/infrastructure/infrastructure.config.js +0 -12
  369. package/infrastructure/infrastructure.config.js.map +0 -1
  370. package/infrastructure/infrastructure.service.js +0 -20
  371. package/infrastructure/infrastructure.service.js.map +0 -1
  372. package/infrastructure/query/firestore/query/index.js +0 -5
  373. package/infrastructure/query/firestore/query/index.js.map +0 -1
  374. package/infrastructure/query/firestore/query/query.query.js +0 -20
  375. package/infrastructure/query/firestore/query/query.query.js.map +0 -1
  376. package/infrastructure/query/firestore/resource/index.js +0 -5
  377. package/infrastructure/query/firestore/resource/index.js.map +0 -1
  378. package/infrastructure/query/firestore/resource/resource.query.js +0 -20
  379. package/infrastructure/query/firestore/resource/resource.query.js.map +0 -1
  380. package/infrastructure/query/hasura/resource/index.js +0 -5
  381. package/infrastructure/query/hasura/resource/index.js.map +0 -1
  382. package/infrastructure/query/hasura/resource/resource.query.d.ts +0 -3
  383. package/infrastructure/query/hasura/resource/resource.query.js +0 -14
  384. package/infrastructure/query/hasura/resource/resource.query.js.map +0 -1
  385. package/infrastructure/repository/dataconnect/invoice/index.js +0 -5
  386. package/infrastructure/repository/dataconnect/invoice/index.js.map +0 -1
  387. package/infrastructure/repository/dataconnect/invoice/invoice.repository.impl.js +0 -54
  388. package/infrastructure/repository/dataconnect/invoice/invoice.repository.impl.js.map +0 -1
  389. package/infrastructure/repository/dataconnect/invoice/invoice.repository.js +0 -11
  390. package/infrastructure/repository/dataconnect/invoice/invoice.repository.js.map +0 -1
  391. package/infrastructure/repository/dataconnect/order/index.js +0 -5
  392. package/infrastructure/repository/dataconnect/order/index.js.map +0 -1
  393. package/infrastructure/repository/dataconnect/order/order.repository.impl.js +0 -74
  394. package/infrastructure/repository/dataconnect/order/order.repository.impl.js.map +0 -1
  395. package/infrastructure/repository/dataconnect/order/order.repository.js +0 -11
  396. package/infrastructure/repository/dataconnect/order/order.repository.js.map +0 -1
  397. package/infrastructure/repository/firestore/bookmarklet/bookmarklet.repository.d.ts +0 -6
  398. package/infrastructure/repository/firestore/bookmarklet/bookmarklet.repository.js +0 -20
  399. package/infrastructure/repository/firestore/bookmarklet/bookmarklet.repository.js.map +0 -1
  400. package/infrastructure/repository/firestore/bookmarklet/index.d.ts +0 -1
  401. package/infrastructure/repository/firestore/bookmarklet/index.js +0 -5
  402. package/infrastructure/repository/firestore/bookmarklet/index.js.map +0 -1
  403. package/infrastructure/repository/firestore/firestore.repository.d.ts +0 -7
  404. package/infrastructure/repository/firestore/firestore.repository.js +0 -20
  405. package/infrastructure/repository/firestore/firestore.repository.js.map +0 -1
  406. package/infrastructure/repository/firestore/index.d.ts +0 -1
  407. package/infrastructure/repository/firestore/index.js +0 -5
  408. package/infrastructure/repository/firestore/index.js.map +0 -1
  409. package/infrastructure/repository/firestore/link/google/google.repository.d.ts +0 -7
  410. package/infrastructure/repository/firestore/link/google/google.repository.js +0 -19
  411. package/infrastructure/repository/firestore/link/google/google.repository.js.map +0 -1
  412. package/infrastructure/repository/firestore/link/google/index.js +0 -5
  413. package/infrastructure/repository/firestore/link/google/index.js.map +0 -1
  414. package/infrastructure/repository/firestore/link/index.js +0 -5
  415. package/infrastructure/repository/firestore/link/index.js.map +0 -1
  416. package/infrastructure/repository/firestore/link/link.repository.d.ts +0 -5
  417. package/infrastructure/repository/firestore/link/link.repository.js +0 -17
  418. package/infrastructure/repository/firestore/link/link.repository.js.map +0 -1
  419. package/infrastructure/repository/firestore/query/index.js +0 -5
  420. package/infrastructure/repository/firestore/query/index.js.map +0 -1
  421. package/infrastructure/repository/firestore/query/query.repository.js +0 -20
  422. package/infrastructure/repository/firestore/query/query.repository.js.map +0 -1
  423. package/infrastructure/repository/firestore/resource/index.js +0 -5
  424. package/infrastructure/repository/firestore/resource/index.js.map +0 -1
  425. package/infrastructure/repository/firestore/resource/resource.repository.js +0 -20
  426. package/infrastructure/repository/firestore/resource/resource.repository.js.map +0 -1
  427. package/infrastructure/repository/hasura/query/index.js +0 -5
  428. package/infrastructure/repository/hasura/query/index.js.map +0 -1
  429. package/infrastructure/repository/hasura/query/query.repository.js +0 -23
  430. package/infrastructure/repository/hasura/query/query.repository.js.map +0 -1
  431. package/infrastructure/repository/hasura/resource/index.js +0 -5
  432. package/infrastructure/repository/hasura/resource/index.js.map +0 -1
  433. package/infrastructure/repository/hasura/resource/resource.repository.js +0 -23
  434. package/infrastructure/repository/hasura/resource/resource.repository.js.map +0 -1
  435. package/infrastructure/repository/index.js +0 -6
  436. package/infrastructure/repository/index.js.map +0 -1
  437. package/infrastructure/repository/notion/contract/contract.config.js +0 -10
  438. package/infrastructure/repository/notion/contract/contract.config.js.map +0 -1
  439. package/infrastructure/repository/notion/contract/contract.repository.js +0 -22
  440. package/infrastructure/repository/notion/contract/contract.repository.js.map +0 -1
  441. package/infrastructure/repository/notion/contract/index.js +0 -6
  442. package/infrastructure/repository/notion/contract/index.js.map +0 -1
  443. package/infrastructure/repository/notion/index.d.ts +0 -2
  444. package/infrastructure/repository/notion/index.js +0 -6
  445. package/infrastructure/repository/notion/index.js.map +0 -1
  446. package/infrastructure/repository/notion/invoice/index.js +0 -6
  447. package/infrastructure/repository/notion/invoice/index.js.map +0 -1
  448. package/infrastructure/repository/notion/invoice/invoice.config.js +0 -10
  449. package/infrastructure/repository/notion/invoice/invoice.config.js.map +0 -1
  450. package/infrastructure/repository/notion/invoice/invoice.repository.js +0 -22
  451. package/infrastructure/repository/notion/invoice/invoice.repository.js.map +0 -1
  452. package/infrastructure/repository/notion/notion.config.js +0 -18
  453. package/infrastructure/repository/notion/notion.config.js.map +0 -1
  454. package/infrastructure/repository/notion/notion.repository.js +0 -26
  455. package/infrastructure/repository/notion/notion.repository.js.map +0 -1
  456. package/infrastructure/repository/notion/order/index.js +0 -5
  457. package/infrastructure/repository/notion/order/index.js.map +0 -1
  458. package/infrastructure/repository/notion/order/order.config.js +0 -10
  459. package/infrastructure/repository/notion/order/order.config.js.map +0 -1
  460. package/infrastructure/repository/notion/order/order.repository.js +0 -22
  461. package/infrastructure/repository/notion/order/order.repository.js.map +0 -1
  462. package/infrastructure/repository/notion/partner/index.js +0 -6
  463. package/infrastructure/repository/notion/partner/index.js.map +0 -1
  464. package/infrastructure/repository/notion/partner/partner.config.js +0 -10
  465. package/infrastructure/repository/notion/partner/partner.config.js.map +0 -1
  466. package/infrastructure/repository/notion/partner/partner.repository.js +0 -22
  467. package/infrastructure/repository/notion/partner/partner.repository.js.map +0 -1
  468. package/infrastructure/repository/redis/index.js +0 -6
  469. package/infrastructure/repository/redis/index.js.map +0 -1
  470. package/infrastructure/repository/redis/operator/index.js +0 -5
  471. package/infrastructure/repository/redis/operator/index.js.map +0 -1
  472. package/infrastructure/repository/redis/operator/operator.repository.js +0 -17
  473. package/infrastructure/repository/redis/operator/operator.repository.js.map +0 -1
  474. package/infrastructure/repository/redis/project/index.js +0 -5
  475. package/infrastructure/repository/redis/project/index.js.map +0 -1
  476. package/infrastructure/repository/redis/project/project.repository.js +0 -33
  477. package/infrastructure/repository/redis/project/project.repository.js.map +0 -1
  478. package/infrastructure/repository/redis/redis.config.js +0 -10
  479. package/infrastructure/repository/redis/redis.config.js.map +0 -1
  480. package/infrastructure/repository/redis/redis.service.js +0 -22
  481. package/infrastructure/repository/redis/redis.service.js.map +0 -1
  482. package/infrastructure/repository/redis/spec/index.js +0 -5
  483. package/infrastructure/repository/redis/spec/index.js.map +0 -1
  484. package/infrastructure/repository/redis/spec/spec.repository.js +0 -94
  485. package/infrastructure/repository/redis/spec/spec.repository.js.map +0 -1
  486. package/infrastructure/repository/redis/system/index.js +0 -5
  487. package/infrastructure/repository/redis/system/index.js.map +0 -1
  488. package/infrastructure/repository/redis/system/system.repository.d.ts +0 -3
  489. package/infrastructure/repository/redis/system/system.repository.js +0 -15
  490. package/infrastructure/repository/redis/system/system.repository.js.map +0 -1
  491. package/infrastructure/repository/repository.config.js +0 -12
  492. package/infrastructure/repository/repository.config.js.map +0 -1
  493. package/infrastructure/repository/repository.service.js +0 -20
  494. package/infrastructure/repository/repository.service.js.map +0 -1
  495. package/stores/index.js +0 -66
  496. package/stores/index.js.map +0 -1
  497. package/usecase/assistant/assistant.service.js +0 -72
  498. package/usecase/assistant/assistant.service.js.map +0 -1
  499. package/usecase/assistant/index.js +0 -5
  500. package/usecase/assistant/index.js.map +0 -1
  501. package/usecase/database/database.service.js +0 -103
  502. package/usecase/database/database.service.js.map +0 -1
  503. package/usecase/database/index.js +0 -5
  504. package/usecase/database/index.js.map +0 -1
  505. package/usecase/graphql/graphql.service.js +0 -49
  506. package/usecase/graphql/graphql.service.js.map +0 -1
  507. package/usecase/graphql/index.js +0 -5
  508. package/usecase/graphql/index.js.map +0 -1
  509. package/usecase/index.js +0 -5
  510. package/usecase/index.js.map +0 -1
  511. package/usecase/invoice/index.js +0 -5
  512. package/usecase/invoice/index.js.map +0 -1
  513. package/usecase/invoice/invoice.service.js +0 -69
  514. package/usecase/invoice/invoice.service.js.map +0 -1
  515. package/usecase/link/index.js +0 -5
  516. package/usecase/link/index.js.map +0 -1
  517. package/usecase/link/link.service.js +0 -20
  518. package/usecase/link/link.service.js.map +0 -1
  519. package/usecase/order/index.js +0 -5
  520. package/usecase/order/index.js.map +0 -1
  521. package/usecase/order/order.service.js +0 -27
  522. package/usecase/order/order.service.js.map +0 -1
  523. package/usecase/project/index.js +0 -5
  524. package/usecase/project/index.js.map +0 -1
  525. package/usecase/project/project.service.js +0 -37
  526. package/usecase/project/project.service.js.map +0 -1
  527. package/usecase/spec/index.js +0 -5
  528. package/usecase/spec/index.js.map +0 -1
  529. package/usecase/spec/spec.service.js +0 -49
  530. package/usecase/spec/spec.service.js.map +0 -1
  531. package/usecase/usecase.service.js +0 -24
  532. package/usecase/usecase.service.js.map +0 -1
  533. package/utils/crypto.js.map +0 -1
  534. package/utils/extract-display-fields.js.map +0 -1
  535. package/utils/index.js +0 -5
  536. package/utils/index.js.map +0 -1
  537. /package/{domain/invoice → domain-invoice}/builders/email/index.d.ts +0 -0
  538. /package/{domain/invoice → domain-invoice}/builders/message/index.d.ts +0 -0
  539. /package/{domain/invoice → domain-invoice}/builders/title/index.d.ts +0 -0
  540. /package/{domain/invoice → domain-invoice}/models/backoffice/contract.d.ts +0 -0
  541. /package/{domain/invoice → domain-invoice}/models/backoffice/index.d.ts +0 -0
  542. /package/{domain/invoice → domain-invoice}/models/backoffice/invoice-mail.d.ts +0 -0
  543. /package/{domain/invoice → domain-invoice}/models/index.d.ts +0 -0
  544. /package/{domain → domain-invoice}/resolvers/index.d.ts +0 -0
  545. /package/{infrastructure → infra}/converters/google/index.d.ts +0 -0
  546. /package/{infrastructure → infra}/external/data-connect/data-connect.service.d.ts +0 -0
  547. /package/{infrastructure → infra}/external/data-connect/index.d.ts +0 -0
  548. /package/{infrastructure → infra}/external/index.d.ts +0 -0
  549. /package/{infrastructure → infra}/external/quick-js/index.d.ts +0 -0
  550. /package/{infrastructure → infra}/external/resend/index.d.ts +0 -0
  551. /package/{infrastructure → infra}/index.d.ts +0 -0
  552. /package/{infrastructure → infra}/query/firestore/query/index.d.ts +0 -0
  553. /package/{infrastructure → infra}/query/firestore/resource/index.d.ts +0 -0
  554. /package/{infrastructure → infra}/query/hasura/resource/index.d.ts +0 -0
  555. /package/{infrastructure → infra}/repository/dataconnect/invoice/index.d.ts +0 -0
  556. /package/{infrastructure → infra}/repository/dataconnect/invoice/invoice.repository.d.ts +0 -0
  557. /package/{infrastructure → infra}/repository/dataconnect/order/index.d.ts +0 -0
  558. /package/{infrastructure → infra}/repository/dataconnect/order/order.repository.d.ts +0 -0
  559. /package/{infrastructure → infra}/repository/firestore/link/google/index.d.ts +0 -0
  560. /package/{infrastructure → infra}/repository/firestore/link/index.d.ts +0 -0
  561. /package/{infrastructure → infra}/repository/firestore/query/index.d.ts +0 -0
  562. /package/{infrastructure → infra}/repository/firestore/resource/index.d.ts +0 -0
  563. /package/{infrastructure → infra}/repository/hasura/query/index.d.ts +0 -0
  564. /package/{infrastructure → infra}/repository/hasura/resource/index.d.ts +0 -0
  565. /package/{infrastructure → infra}/repository/index.d.ts +0 -0
  566. /package/{infrastructure → infra}/repository/notion/contract/contract.config.d.ts +0 -0
  567. /package/{infrastructure → infra}/repository/notion/contract/index.d.ts +0 -0
  568. /package/{infrastructure → infra}/repository/notion/invoice/index.d.ts +0 -0
  569. /package/{infrastructure → infra}/repository/notion/invoice/invoice.config.d.ts +0 -0
  570. /package/{infrastructure → infra}/repository/notion/notion.config.d.ts +0 -0
  571. /package/{infrastructure → infra}/repository/notion/order/index.d.ts +0 -0
  572. /package/{infrastructure → infra}/repository/notion/order/order.config.d.ts +0 -0
  573. /package/{infrastructure → infra}/repository/notion/partner/index.d.ts +0 -0
  574. /package/{infrastructure → infra}/repository/notion/partner/partner.config.d.ts +0 -0
  575. /package/{infrastructure → infra}/repository/redis/index.d.ts +0 -0
  576. /package/{infrastructure → infra}/repository/redis/operator/index.d.ts +0 -0
  577. /package/{infrastructure → infra}/repository/redis/project/index.d.ts +0 -0
  578. /package/{infrastructure → infra}/repository/redis/redis.config.d.ts +0 -0
  579. /package/{infrastructure → infra}/repository/redis/spec/index.d.ts +0 -0
  580. /package/{infrastructure → infra}/repository/redis/system/index.d.ts +0 -0
  581. /package/utils/{crypto.d.ts → crypto/crypto.d.ts} +0 -0
@@ -0,0 +1,470 @@
1
+ import { createAction } from '@ng-atomic/core';
2
+ import { flatten } from 'flat';
3
+ import { omitBy } from 'lodash-es';
4
+ import { createNavigateAction } from '@ng-atomic/components/frames/app';
5
+
6
+ class CommandBuilder {
7
+ buildFromOpenApi(openApi) {
8
+ return Object.keys(openApi.getPaths()).flatMap((path) => {
9
+ return openApi.getMethods(path).map((method, index) => ({
10
+ id: openApi.getOperationId(path, method) ?? `cmd-${index}`,
11
+ name: openApi.getSummary(path, method) ?? '',
12
+ description: openApi.getDescription(path, method) ?? '',
13
+ type: 'webApiRequest',
14
+ webApiRequest: {
15
+ path: path,
16
+ method: method.toLocaleUpperCase(),
17
+ contentType: openApi.getContentType(path, method),
18
+ responseContentType: openApi.getResponseContentType(path, method),
19
+ bodySchema: openApi.getRequestBodySchema(path, method),
20
+ serverUrl: openApi.getServerUrl(),
21
+ apiJsonUrl: openApi.apiJsonUrl,
22
+ security: openApi.getSecurity(path, method) ?? [],
23
+ }
24
+ }));
25
+ });
26
+ }
27
+ }
28
+
29
+ var ActionId;
30
+ (function (ActionId) {
31
+ ActionId["NAVIGATE_TO_COMMAND_PAGE"] = "[@xxmachina/common] Navigate To Command Page";
32
+ ActionId["EXECUTE_COMMAND"] = "[@xxmachina/common] Execute Command";
33
+ })(ActionId || (ActionId = {}));
34
+ class CommandActionsBuilder {
35
+ commands = [];
36
+ options = {};
37
+ item = null;
38
+ filterIds = null;
39
+ autoIds = [];
40
+ setCommands(commands) {
41
+ const newFactory = new CommandActionsBuilder();
42
+ newFactory.commands = [...commands];
43
+ newFactory.options = { ...this.options };
44
+ newFactory.item = this.item;
45
+ newFactory.filterIds = this.filterIds;
46
+ newFactory.autoIds = this.autoIds;
47
+ return newFactory;
48
+ }
49
+ setOptions(options) {
50
+ const newFactory = new CommandActionsBuilder();
51
+ newFactory.commands = [...this.commands];
52
+ newFactory.options = { ...this.options, ...options };
53
+ newFactory.item = this.item;
54
+ newFactory.filterIds = this.filterIds;
55
+ newFactory.autoIds = this.autoIds;
56
+ return newFactory;
57
+ }
58
+ setItem(item) {
59
+ const newFactory = new CommandActionsBuilder();
60
+ newFactory.commands = [...this.commands];
61
+ newFactory.options = { ...this.options };
62
+ newFactory.item = item;
63
+ newFactory.filterIds = this.filterIds;
64
+ newFactory.autoIds = this.autoIds;
65
+ return newFactory;
66
+ }
67
+ setFilterIds(filterIds = []) {
68
+ const newFactory = new CommandActionsBuilder();
69
+ newFactory.commands = [...this.commands];
70
+ newFactory.options = { ...this.options };
71
+ newFactory.item = this.item;
72
+ newFactory.filterIds = filterIds.map((id) => typeof id === 'string' ? id : id.id);
73
+ newFactory.autoIds = filterIds.filter((id) => typeof id !== 'string' && id.auto).map((id) => id.id);
74
+ return newFactory;
75
+ }
76
+ setAutoIds(autoIds) {
77
+ const newFactory = new CommandActionsBuilder();
78
+ newFactory.commands = [...this.commands];
79
+ newFactory.options = { ...this.options };
80
+ newFactory.item = this.item;
81
+ newFactory.filterIds = [...this.filterIds];
82
+ newFactory.autoIds = autoIds;
83
+ return newFactory;
84
+ }
85
+ applyFilter(commands) {
86
+ if (!this.filterIds)
87
+ return commands;
88
+ return this.filterIds.map((id) => commands.find((command) => command.id === id))
89
+ .filter((command) => !!command);
90
+ }
91
+ buildAction(id) {
92
+ const command = this.commands.find((command) => command.id === id);
93
+ if (!command)
94
+ throw new Error(`Command not found: ${id}`);
95
+ const actionId = this.autoIds.includes(command.id)
96
+ ? ActionId.EXECUTE_COMMAND
97
+ : ActionId.NAVIGATE_TO_COMMAND_PAGE;
98
+ const creator = createAction(actionId, command.webApiRequest.bodySchema, {
99
+ name: command.name,
100
+ icon: this.options.icon || 'default',
101
+ ...this.options,
102
+ });
103
+ return creator.create({
104
+ command,
105
+ body: this.item,
106
+ options: {
107
+ queryId: this.options.queryId,
108
+ confirm: this.options.confirm,
109
+ }
110
+ });
111
+ }
112
+ buildActions(item, navigationExtras = {}, overwrite = {}) {
113
+ const filteredCommands = this.applyFilter(this.commands);
114
+ return filteredCommands.map((command) => {
115
+ if (this.autoIds.includes(command.id)) {
116
+ return createAction(ActionId.EXECUTE_COMMAND, command.webApiRequest.bodySchema, {
117
+ name: command.name,
118
+ icon: this.options.icon || 'default',
119
+ }).create({
120
+ command,
121
+ body: this.item,
122
+ options: {
123
+ queryId: this.options.queryId,
124
+ confirm: this.options.confirm,
125
+ }
126
+ }, overwrite);
127
+ }
128
+ else {
129
+ const data = omitBy(flatten({ data: this.item, queryId: this.options.queryId }), value => typeof value === 'undefined');
130
+ return createNavigateAction(['commands', { skip: true }, command.id, data], navigationExtras, {
131
+ name: command.name,
132
+ icon: this.options.icon,
133
+ ...overwrite,
134
+ });
135
+ }
136
+ });
137
+ }
138
+ buildItemActions() {
139
+ return (item) => this.setItem(item).buildActions();
140
+ }
141
+ }
142
+ function createCommandNavigateAction(command, navigationExtras = {}, item = {}, options = {}, overwrite = {}) {
143
+ if (!command)
144
+ return null;
145
+ return new CommandActionsBuilder()
146
+ .setItem(item)
147
+ .setCommands([command])
148
+ .setOptions(options)
149
+ .setFilterIds([command.id])
150
+ .buildActions(item, navigationExtras, overwrite)[0];
151
+ }
152
+ function createCommandExecutionAction(command, item = {}, options = {}, overwrite = {}) {
153
+ if (!command)
154
+ return null;
155
+ return new CommandActionsBuilder()
156
+ .setItem(item)
157
+ .setCommands([command])
158
+ .setOptions(options)
159
+ .setFilterIds([command.id])
160
+ .setAutoIds([command.id])
161
+ .buildActions(item, undefined, overwrite)[0];
162
+ }
163
+
164
+ const NOTION_PROP_TYPE_MAP = {
165
+ people: 'string',
166
+ unique_id: 'string',
167
+ rich_text: 'string',
168
+ title: 'string',
169
+ text: 'string',
170
+ number: 'number',
171
+ select: 'enum',
172
+ status: 'enum',
173
+ multi_select: 'string',
174
+ date: 'date',
175
+ person: 'string',
176
+ files: 'string',
177
+ checkbox: 'boolean',
178
+ url: 'string',
179
+ email: 'string',
180
+ phone_number: 'string',
181
+ relation: 'string',
182
+ rollup: 'string',
183
+ created_time: 'date',
184
+ created_by: 'string',
185
+ last_edited_time: 'date',
186
+ last_edited_by: 'string',
187
+ };
188
+ const NOTION_KEY_MAP = {
189
+ 'relation': 'FK',
190
+ 'unique_id': 'UK',
191
+ };
192
+ class ErBuilder {
193
+ build(databases) {
194
+ const schemas = [];
195
+ const dbIdToName = databases.reduce((acc, db) => ({
196
+ ...acc,
197
+ [db.id]: db?.title?.[0]?.plain_text
198
+ }), {});
199
+ for (const database of databases) {
200
+ const schema = this.parseDatabaseSchema(database, database?.title?.[0]?.plain_text, dbIdToName);
201
+ schemas.push(schema);
202
+ }
203
+ return this.buildMermaidER(schemas);
204
+ }
205
+ parseDatabaseSchema(database, name = '', map = {}) {
206
+ const properties = database.properties;
207
+ const fields = [];
208
+ const relations = [];
209
+ Object.keys(properties)
210
+ .filter(propName => {
211
+ if (['formula', 'rollup', 'button'].includes(properties[propName].type))
212
+ return false;
213
+ return true;
214
+ })
215
+ .sort()
216
+ .forEach(propName => {
217
+ const prop = properties[propName];
218
+ const type = prop.type;
219
+ const mappedType = NOTION_PROP_TYPE_MAP[type];
220
+ const key = NOTION_KEY_MAP[type] ?? ' ';
221
+ const field = `${mappedType} ${type} ${key} "${propName}"`;
222
+ fields.push(field);
223
+ // リレーションシップの解析
224
+ if (type === 'relation') {
225
+ const relation = prop['relation'];
226
+ if (relation && relation.database_id) {
227
+ const targetDbId = relation.database_id;
228
+ const targetDbName = map[targetDbId] || 'Unknown';
229
+ relations.push({
230
+ source: name,
231
+ target: targetDbName,
232
+ label: propName,
233
+ type: '||--||', // リレーションのタイプを適宜設定
234
+ });
235
+ }
236
+ else if (relation && Array.isArray(relation)) {
237
+ relation.forEach(rel => {
238
+ const targetDbId = rel.database_id;
239
+ const targetDbName = map[targetDbId] || 'Unknown';
240
+ relations.push({
241
+ source: name,
242
+ target: targetDbName,
243
+ label: propName,
244
+ type: '||--o{',
245
+ });
246
+ });
247
+ }
248
+ }
249
+ });
250
+ return { name, fields, relations };
251
+ }
252
+ buildMermaidER(schemas) {
253
+ let mermaid = 'erDiagram\n';
254
+ // エンティティの定義
255
+ schemas.forEach(schema => {
256
+ mermaid += ` "${schema.name}" {\n`;
257
+ mermaid += schema.fields.map(field => ` ${field}`).join('\n');
258
+ mermaid += '\n }\n';
259
+ });
260
+ // リレーションシップの定義
261
+ schemas.forEach(schema => {
262
+ schema.relations.forEach(relation => {
263
+ mermaid += ` "${relation.source}" ${relation.type} "${relation.target}" : "${relation.label}"\n`;
264
+ });
265
+ });
266
+ return mermaid;
267
+ }
268
+ }
269
+
270
+ function buildPageItem(property, propName, dbName) {
271
+ switch (property.type) {
272
+ case 'select': return {
273
+ id: property.id,
274
+ name: propName,
275
+ type: '入力(単一選択)',
276
+ notionPropType: 'セレクト',
277
+ formula: '',
278
+ valueType: 'string',
279
+ dbName,
280
+ };
281
+ case 'multi_select': return {
282
+ id: property.id,
283
+ name: propName,
284
+ type: '入力(複数選択)',
285
+ notionPropType: 'マルチセレクト',
286
+ formula: '',
287
+ valueType: 'string',
288
+ dbName,
289
+ };
290
+ case 'relation': return {
291
+ id: property.id,
292
+ name: propName,
293
+ type: '入力(単一選択)',
294
+ notionPropType: 'リレーション',
295
+ formula: '',
296
+ valueType: 'string',
297
+ dbName,
298
+ };
299
+ case 'rollup': return {
300
+ id: property.id,
301
+ name: propName,
302
+ type: '表示',
303
+ notionPropType: 'ロールアップ',
304
+ formula: '',
305
+ valueType: 'string',
306
+ dbName,
307
+ };
308
+ case 'unique_id': return {
309
+ id: property.id,
310
+ name: propName,
311
+ type: '表示',
312
+ notionPropType: 'ユニークID',
313
+ formula: '',
314
+ valueType: 'string',
315
+ dbName,
316
+ };
317
+ case 'created_time': return {
318
+ id: property.id,
319
+ name: propName,
320
+ type: '表示',
321
+ notionPropType: '作成日時',
322
+ formula: '',
323
+ valueType: 'date',
324
+ dbName,
325
+ };
326
+ case 'created_by': return {
327
+ id: property.id,
328
+ name: propName,
329
+ type: '表示',
330
+ notionPropType: '作成者',
331
+ formula: '',
332
+ valueType: 'string',
333
+ dbName,
334
+ };
335
+ case 'rich_text': return {
336
+ id: property.id,
337
+ name: propName,
338
+ type: '入力(テキスト)',
339
+ notionPropType: 'テキスト',
340
+ formula: '',
341
+ valueType: 'string',
342
+ dbName,
343
+ };
344
+ case 'number': return {
345
+ id: property.id,
346
+ name: propName,
347
+ type: '入力(数値)',
348
+ notionPropType: '数値',
349
+ formula: '',
350
+ valueType: 'number',
351
+ dbName,
352
+ };
353
+ case 'date': return {
354
+ id: property.id,
355
+ name: propName,
356
+ type: '入力(日時)',
357
+ notionPropType: '日時',
358
+ formula: '',
359
+ valueType: 'date',
360
+ dbName,
361
+ };
362
+ case 'checkbox': return {
363
+ id: property.id,
364
+ name: propName,
365
+ type: '入力(複数選択)',
366
+ notionPropType: 'チェックボックス',
367
+ formula: '',
368
+ valueType: 'boolean',
369
+ dbName,
370
+ };
371
+ case 'title': return {
372
+ id: property.id,
373
+ name: propName,
374
+ type: '入力(テキスト)',
375
+ notionPropType: 'タイトル',
376
+ formula: '',
377
+ valueType: 'string',
378
+ dbName,
379
+ };
380
+ case 'people': return {
381
+ id: property.id,
382
+ name: propName,
383
+ type: '入力(単一選択)',
384
+ notionPropType: 'ユーザー',
385
+ formula: '',
386
+ valueType: 'string',
387
+ dbName,
388
+ };
389
+ case 'last_edited_time': return {
390
+ id: property.id,
391
+ name: propName,
392
+ type: '表示',
393
+ notionPropType: '最終更新日時',
394
+ formula: '',
395
+ valueType: 'date',
396
+ dbName,
397
+ };
398
+ case 'last_edited_by': return {
399
+ id: property.id,
400
+ name: propName,
401
+ type: '表示',
402
+ notionPropType: '最終更新者',
403
+ formula: '',
404
+ valueType: 'string',
405
+ dbName,
406
+ };
407
+ case 'status': return {
408
+ id: property.id,
409
+ name: propName,
410
+ type: '入力(単一選択)',
411
+ notionPropType: 'ステータス',
412
+ formula: '',
413
+ valueType: 'string',
414
+ dbName,
415
+ };
416
+ case 'formula': return {
417
+ id: property.id,
418
+ name: propName,
419
+ type: '表示',
420
+ notionPropType: '数式',
421
+ formula: '',
422
+ valueType: 'any',
423
+ dbName,
424
+ };
425
+ /* @ts-ignore */
426
+ case 'button': return {
427
+ id: property?.['id'] ?? '',
428
+ name: propName,
429
+ type: 'ボタン',
430
+ notionPropType: 'ボタン',
431
+ formula: '',
432
+ valueType: 'string',
433
+ dbName,
434
+ };
435
+ default: return {
436
+ id: property.id,
437
+ name: propName,
438
+ type: '不明',
439
+ notionPropType: property.type,
440
+ formula: '',
441
+ valueType: 'string',
442
+ dbName,
443
+ };
444
+ }
445
+ }
446
+ class ScreenItemBuilder {
447
+ build(database) {
448
+ const items = [];
449
+ Object.entries(database?.properties ?? {}).sort((a, b) => {
450
+ return a[0].localeCompare(b[0]);
451
+ }).filter(([propName, prop]) => {
452
+ // if (propName.startsWith('_')) return false;
453
+ // if (/^\d/.test(propName)) return false;
454
+ // if (propName.includes('旧エクセル')) return false;
455
+ // if (['formula', 'rollup', 'button'].includes(prop.type)) return false;
456
+ return true;
457
+ }).forEach(([propName, prop]) => {
458
+ const item = buildPageItem(prop, propName, database?.title?.[0]?.plain_text ?? '');
459
+ items.push(item);
460
+ });
461
+ return items;
462
+ }
463
+ }
464
+
465
+ /**
466
+ * Generated bundle index. Do not edit.
467
+ */
468
+
469
+ export { ActionId, CommandActionsBuilder, CommandBuilder, ErBuilder, ScreenItemBuilder, createCommandExecutionAction, createCommandNavigateAction };
470
+ //# sourceMappingURL=xxmachina-common-domain-builder.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-domain-builder.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/domain/builder/command/command.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain/builder/command-action/command-action.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain/builder/er/er.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain/builder/screen-item/screen-item.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain/builder/xxmachina-common-domain-builder.ts"],"sourcesContent":["import { Command, OpenApi } from '@xxmachina/common/domain/models';\n\nexport class CommandBuilder {\n buildFromOpenApi(openApi: OpenApi): Command[] {\n return Object.keys(openApi.getPaths()).flatMap((path) => {\n return openApi.getMethods(path).map((method, index: number) => ({\n id: openApi.getOperationId(path, method) ?? `cmd-${index}`,\n name: openApi.getSummary(path, method) ?? '',\n description: openApi.getDescription(path, method) ?? '',\n type: 'webApiRequest' as const,\n webApiRequest: {\n path: path,\n method: method.toLocaleUpperCase(),\n contentType: openApi.getContentType(path, method) as 'application/json' | 'multipart/form-data',\n responseContentType: openApi.getResponseContentType(path, method) as 'application/octet-stream' | 'unknown',\n bodySchema: openApi.getRequestBodySchema(path, method),\n serverUrl: openApi.getServerUrl(),\n apiJsonUrl: openApi.apiJsonUrl,\n security: openApi.getSecurity(path, method) ?? [],\n }\n }));\n });\n }\n}\n","import { Action, createAction, CreateActionsOptions } from '@ng-atomic/core';\nimport { flatten } from 'flat';\nimport { omitBy } from 'lodash-es';\nimport { createNavigateAction } from '@ng-atomic/components/frames/app';\nimport { NavigationExtras } from '@angular/router';\nimport { Command } from '@xxmachina/common/domain/models';\n\nexport enum ActionId {\n NAVIGATE_TO_COMMAND_PAGE = '[@xxmachina/common] Navigate To Command Page',\n EXECUTE_COMMAND = '[@xxmachina/common] Execute Command',\n}\n\nexport interface CommandActionFactoryOptions extends CreateActionsOptions {\n queryId?: string;\n confirm?: () => Promise<boolean> | boolean;\n}\n\nexport interface CommandActionPayload<P> {\n command: any;\n body: P;\n options?: {\n confirm?: () => Promise<boolean> | boolean;\n queryId?: string;\n };\n}\n\nexport class CommandActionsBuilder {\n private commands: Command[] = [];\n private options: CommandActionFactoryOptions = {};\n private item: any = null;\n private filterIds: string[] | null = null;\n private autoIds: string[] = [];\n\n setCommands(commands: Command[]): CommandActionsBuilder {\n const newFactory = new CommandActionsBuilder();\n newFactory.commands = [...commands];\n newFactory.options = { ...this.options };\n newFactory.item = this.item;\n newFactory.filterIds = this.filterIds;\n newFactory.autoIds = this.autoIds;\n return newFactory;\n }\n\n setOptions(options: Partial<CommandActionFactoryOptions>): CommandActionsBuilder {\n const newFactory = new CommandActionsBuilder();\n newFactory.commands = [...this.commands];\n newFactory.options = { ...this.options, ...options };\n newFactory.item = this.item;\n newFactory.filterIds = this.filterIds;\n newFactory.autoIds = this.autoIds;\n return newFactory;\n }\n\n setItem(item: any): CommandActionsBuilder {\n const newFactory = new CommandActionsBuilder();\n newFactory.commands = [...this.commands];\n newFactory.options = { ...this.options };\n newFactory.item = item;\n newFactory.filterIds = this.filterIds;\n newFactory.autoIds = this.autoIds;\n return newFactory;\n }\n\n setFilterIds(filterIds: (string | {id: string, auto: boolean})[] = []): CommandActionsBuilder {\n const newFactory = new CommandActionsBuilder();\n newFactory.commands = [...this.commands];\n newFactory.options = { ...this.options };\n newFactory.item = this.item;\n newFactory.filterIds = filterIds.map((id) => typeof id === 'string' ? id : id.id);\n newFactory.autoIds = filterIds.filter((id) => typeof id !== 'string' && id.auto).map((id) => (id as any).id);\n return newFactory;\n }\n\n setAutoIds(autoIds: string[]): CommandActionsBuilder {\n const newFactory = new CommandActionsBuilder();\n newFactory.commands = [...this.commands];\n newFactory.options = { ...this.options };\n newFactory.item = this.item;\n newFactory.filterIds = [...this.filterIds];\n newFactory.autoIds = autoIds;\n return newFactory;\n }\n\n private applyFilter(commands: Command[]): Command[] {\n if (!this.filterIds) return commands;\n return this.filterIds.map((id) => commands.find((command) => command.id === id)!)\n .filter((command) => !!command) as Command[];\n }\n\n buildAction(id: string): Action {\n const command = this.commands.find((command) => command.id === id);\n if (!command) throw new Error(`Command not found: ${id}`);\n const actionId = this.autoIds.includes(command.id)\n ? ActionId.EXECUTE_COMMAND\n : ActionId.NAVIGATE_TO_COMMAND_PAGE;\n const creator = createAction<CommandActionPayload<any>>(\n actionId,\n command.webApiRequest.bodySchema,\n {\n name: command.name,\n icon: this.options.icon || 'default',\n ...this.options,\n }\n );\n\n return creator.create({\n command,\n body: this.item,\n options: {\n queryId: this.options.queryId,\n confirm: this.options.confirm,\n }\n });\n }\n\n buildActions(item?: any, navigationExtras: NavigationExtras = {}, overwrite: Partial<Action> = {}): Action[] {\n const filteredCommands = this.applyFilter(this.commands);\n return filteredCommands.map((command) => {\n if (this.autoIds.includes(command.id)) {\n return createAction<CommandActionPayload<any>>(\n ActionId.EXECUTE_COMMAND,\n command.webApiRequest.bodySchema,\n {\n name: command.name,\n icon: this.options.icon || 'default',\n }\n ).create({\n command,\n body: this.item,\n options: {\n queryId: this.options.queryId,\n confirm: this.options.confirm,\n }\n }, overwrite);\n } else {\n const data = omitBy(flatten<object, object>({data: this.item, queryId: this.options.queryId}), value => typeof value === 'undefined');\n return createNavigateAction(['commands', {skip: true}, command.id, data], navigationExtras, {\n name: command.name,\n icon: this.options.icon,\n ...overwrite,\n });\n }\n });\n }\n\n buildItemActions<T>(): (item: T) => Action[] {\n return (item: T) => this.setItem(item).buildActions();\n }\n}\n\n\nexport function createCommandNavigateAction(\n command: Command,\n navigationExtras: NavigationExtras = {},\n item: any = {},\n options: CommandActionFactoryOptions = {},\n overwrite: Partial<Action> = {}\n): Action | null {\n if (!command) return null;\n return new CommandActionsBuilder()\n .setItem(item)\n .setCommands([command])\n .setOptions(options)\n .setFilterIds([command.id])\n .buildActions(item, navigationExtras, overwrite)[0];\n}\n\nexport function createCommandExecutionAction(\n command: Command,\n item: any = {},\n options: CommandActionFactoryOptions = {},\n overwrite: Partial<Action> = {}\n): Action | null {\n if (!command) return null;\n return new CommandActionsBuilder()\n .setItem(item)\n .setCommands([command])\n .setOptions(options)\n .setFilterIds([command.id])\n .setAutoIds([command.id])\n .buildActions(item, undefined, overwrite)[0];\n}\n","interface Schema {\n name: string;\n fields: string[];\n relations: Relation[];\n}\n\ninterface Relation {\n source: string;\n target: string;\n label?: string;\n type?: string; // 例: \"||--o{\"\n}\n\nconst NOTION_PROP_TYPE_MAP = {\n people: 'string',\n unique_id: 'string',\n rich_text: 'string',\n title: 'string',\n text: 'string',\n number: 'number',\n select: 'enum',\n status: 'enum',\n multi_select: 'string',\n date: 'date',\n person: 'string',\n files: 'string',\n checkbox: 'boolean',\n url: 'string',\n email: 'string',\n phone_number: 'string',\n relation: 'string',\n rollup: 'string',\n created_time: 'date',\n created_by: 'string',\n last_edited_time: 'date',\n last_edited_by: 'string',\n};\n\nconst NOTION_KEY_MAP = {\n 'relation': 'FK',\n 'unique_id': 'UK',\n}\n\nexport class ErBuilder {\n build(databases): string {\n const schemas = [];\n const dbIdToName = databases.reduce((acc, db) => ({\n ...acc,\n [db.id]: db?.title?.[0]?.plain_text\n }), {});\n for (const database of databases) {\n const schema = this.parseDatabaseSchema(database, database?.title?.[0]?.plain_text, dbIdToName);\n schemas.push(schema);\n }\n return this.buildMermaidER(schemas);\n }\n\n parseDatabaseSchema(\n database,\n name = '',\n map: { [key: string]: string } = {},\n ): Schema {\n const properties = database.properties;\n const fields: string[] = [];\n const relations: Relation[] = [];\n \n Object.keys(properties)\n .filter(propName => {\n if (['formula', 'rollup', 'button'].includes(properties[propName].type)) return false;\n return true;\n })\n .sort()\n .forEach(propName => {\n const prop = properties[propName];\n const type = prop.type as keyof typeof NOTION_PROP_TYPE_MAP;\n const mappedType = NOTION_PROP_TYPE_MAP[type];\n const key = NOTION_KEY_MAP[type] ?? ' ';\n const field = `${mappedType} ${type} ${key} \"${propName}\"`;\n fields.push(field);\n \n // リレーションシップの解析\n if (type === 'relation') {\n const relation = prop['relation'];\n if (relation && relation.database_id) {\n const targetDbId = relation.database_id;\n const targetDbName = map[targetDbId] || 'Unknown';\n relations.push({\n source: name,\n target: targetDbName,\n label: propName,\n type: '||--||', // リレーションのタイプを適宜設定\n });\n } else if (relation && Array.isArray(relation)) {\n relation.forEach(rel => {\n const targetDbId = rel.database_id;\n const targetDbName = map[targetDbId] || 'Unknown';\n relations.push({\n source: name,\n target: targetDbName,\n label: propName,\n type: '||--o{',\n });\n });\n }\n }\n });\n \n return { name, fields, relations };\n }\n\n buildMermaidER(schemas: Schema[]): string {\n let mermaid = 'erDiagram\\n';\n \n // エンティティの定義\n schemas.forEach(schema => {\n mermaid += ` \"${schema.name}\" {\\n`;\n mermaid += schema.fields.map(field => ` ${field}`).join('\\n');\n mermaid += '\\n }\\n';\n });\n \n // リレーションシップの定義\n schemas.forEach(schema => {\n schema.relations.forEach(relation => {\n mermaid += ` \"${relation.source}\" ${relation.type} \"${relation.target}\" : \"${relation.label}\"\\n`;\n });\n });\n \n return mermaid;\n }\n}","import { ScreenItem } from '@xxmachina/common/domain/models';\nimport type { GetDatabaseResponse } from '@notionhq/client/build/src/api-endpoints';\nimport { Database } from '@xxmachina/common/domain/models';\n\nfunction buildPageItem(\n property: GetDatabaseResponse['properties'][string],\n propName: string,\n dbName: string,\n): ScreenItem {\n switch (property.type) {\n case 'select': return {\n id: property.id,\n name: propName,\n type: '入力(単一選択)',\n notionPropType: 'セレクト',\n formula: '',\n valueType: 'string',\n dbName,\n };\n case 'multi_select': return {\n id: property.id,\n name: propName,\n type: '入力(複数選択)',\n notionPropType: 'マルチセレクト',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'relation': return {\n id: property.id,\n name: propName,\n type: '入力(単一選択)',\n notionPropType: 'リレーション',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'rollup': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: 'ロールアップ',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'unique_id': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: 'ユニークID',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'created_time': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: '作成日時',\n formula: '',\n valueType: 'date',\n dbName,\n }\n case 'created_by': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: '作成者',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'rich_text': return {\n id: property.id,\n name: propName,\n type: '入力(テキスト)',\n notionPropType: 'テキスト',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'number': return {\n id: property.id,\n name: propName,\n type: '入力(数値)',\n notionPropType: '数値',\n formula: '',\n valueType: 'number',\n dbName,\n }\n case 'date': return {\n id: property.id,\n name: propName,\n type: '入力(日時)',\n notionPropType: '日時',\n formula: '',\n valueType: 'date',\n dbName,\n }\n case 'checkbox': return {\n id: property.id,\n name: propName,\n type: '入力(複数選択)',\n notionPropType: 'チェックボックス',\n formula: '',\n valueType: 'boolean',\n dbName,\n }\n case 'title': return {\n id: property.id,\n name: propName,\n type: '入力(テキスト)',\n notionPropType: 'タイトル',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'people': return {\n id: property.id,\n name: propName,\n type: '入力(単一選択)',\n notionPropType: 'ユーザー',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'last_edited_time': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: '最終更新日時',\n formula: '',\n valueType: 'date',\n dbName,\n }\n case 'last_edited_by': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: '最終更新者',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'status': return {\n id: property.id,\n name: propName,\n type: '入力(単一選択)',\n notionPropType: 'ステータス',\n formula: '',\n valueType: 'string',\n dbName,\n }\n case 'formula': return {\n id: property.id,\n name: propName,\n type: '表示',\n notionPropType: '数式',\n formula: '',\n valueType: 'any',\n dbName,\n }\n /* @ts-ignore */\n case 'button': return {\n id: property?.['id'] ?? '',\n name: propName,\n type: 'ボタン',\n notionPropType: 'ボタン',\n formula: '',\n valueType: 'string',\n dbName,\n }\n default: return {\n id: property.id,\n name: propName,\n type: '不明',\n notionPropType: property.type,\n formula: '',\n valueType: 'string',\n dbName,\n };\n }\n}\n\nexport class ScreenItemBuilder {\n build(database: Database): ScreenItem[] {\n const items: ScreenItem[] = [];\n \n Object.entries(database?.properties ?? {}).sort((a, b) => {\n return a[0].localeCompare(b[0]);\n }).filter(([propName, prop]) => {\n // if (propName.startsWith('_')) return false;\n // if (/^\\d/.test(propName)) return false;\n // if (propName.includes('旧エクセル')) return false;\n // if (['formula', 'rollup', 'button'].includes(prop.type)) return false;\n return true;\n }).forEach(([propName, prop]) => {\n const item = buildPageItem(prop, propName, database?.title?.[0]?.plain_text ?? '');\n items.push(item);\n });\n \n return items;\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAEa,cAAc,CAAA;AACzB,IAAA,gBAAgB,CAAC,OAAgB,EAAA;AAC/B,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACtD,YAAA,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAa,MAAM;AAC9D,gBAAA,EAAE,EAAE,OAA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C,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC;AAClF,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAClB,SAAC,CAAC;AAEF,QAAA,OAAO,KAAK;;AAEf;;AC5MD;;AAEG;;;;"}
@@ -0,0 +1,70 @@
1
+ import { message } from '@nx-ddd/common';
2
+ import dayjs from 'dayjs';
3
+
4
+ class MessageBuilder {
5
+ getInvoiceRange(invoice) {
6
+ const start = (invoice?.orders ?? []).reduce((acc, order) => {
7
+ const startDate = order?.startDate ?? dayjs('2200-12-31');
8
+ return acc.isBefore(startDate) ? acc : startDate;
9
+ }, dayjs('2200-12-31'));
10
+ const end = (invoice?.orders ?? []).reduce((acc, order) => {
11
+ const endDate = order?.endDate ?? dayjs('1970-01-01');
12
+ return acc.isAfter(endDate) ? acc : endDate;
13
+ }, dayjs('1970-01-01'));
14
+ return { start, end };
15
+ }
16
+ getInvoicePeriod(invoice) {
17
+ const { start, end } = this.getInvoiceRange(invoice);
18
+ return `${start?.format('YYYY年M月D日') ?? ''}~${end?.format('YYYY年M月D日') ?? ''}`;
19
+ }
20
+ build(invoice) {
21
+ return message `${invoice?.customer?.name}
22
+ ${invoice?.customer?.billingContact ?? 'ご担当者'}様
23
+
24
+ お世話になっております。
25
+ ${'〇〇'}です。
26
+
27
+ ${this.getInvoicePeriod(invoice)}の請求書をご用意ができましたのでお送りさせていただきます。
28
+ ご確認のほど、よろしくお願いいたします。
29
+
30
+ ${invoice?.vendor?.type !== '個人事業主' ? invoice?.vendor?.name : ''}
31
+ ${invoice?.vendor?.contact}`;
32
+ }
33
+ }
34
+
35
+ class Email {
36
+ static EMPTY = {
37
+ to: '',
38
+ cc: '',
39
+ title: '',
40
+ body: '',
41
+ };
42
+ to;
43
+ cc;
44
+ title;
45
+ body;
46
+ }
47
+ class EmailBuilder {
48
+ mesageBuilder = new MessageBuilder();
49
+ build(invoice) {
50
+ return {
51
+ to: invoice?.customer?.billingEmail,
52
+ cc: invoice?.vendor?.email,
53
+ title: `[${invoice?.vendor?.name ?? '{{invoice.vendor.name}}'}] 請求書ご送付のお知らせ`,
54
+ body: this.mesageBuilder.build(invoice),
55
+ };
56
+ }
57
+ }
58
+
59
+ class TitleBuilder {
60
+ build(invoice) {
61
+ return `[${invoice?.customer?.name ?? '{{invoice.vendor.name}}'}様] invoice_${invoice?.dueDate?.toISOString()}`;
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Generated bundle index. Do not edit.
67
+ */
68
+
69
+ export { Email, EmailBuilder, MessageBuilder, TitleBuilder };
70
+ //# sourceMappingURL=xxmachina-common-domain-invoice-builders.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-domain-invoice-builders.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/domain-invoice/builders/message/message.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain-invoice/builders/email/email.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain-invoice/builders/title/title.builder.ts","../../../../../packages/@xxmachina/common/src/lib/domain-invoice/builders/xxmachina-common-domain-invoice-builders.ts"],"sourcesContent":["import { Invoice } from \"@xxmachina/common/domain-invoice/models\";\nimport { message } from '@nx-ddd/common';\nimport dayjs from \"dayjs\";\n\nexport class MessageBuilder {\n private getInvoiceRange(invoice: Invoice): {start: dayjs.Dayjs, end: dayjs.Dayjs} {\n const start = (invoice?.orders ?? []).reduce((acc, order) => {\n const startDate = order?.startDate ?? dayjs('2200-12-31');\n return acc.isBefore(startDate) ? acc : startDate;\n }, dayjs('2200-12-31'));\n const end = (invoice?.orders ?? []).reduce((acc, order) => {\n const endDate = order?.endDate ?? dayjs('1970-01-01');\n return acc.isAfter(endDate) ? acc : endDate;\n }, dayjs('1970-01-01'));\n return {start, end};\n }\n\n private getInvoicePeriod(invoice: Invoice): string {\n const {start, end} = this.getInvoiceRange(invoice);\n return `${start?.format('YYYY年M月D日') ?? ''}~${end?.format('YYYY年M月D日') ?? ''}`;\n }\n\n build(invoice: Invoice) {\n return message`${invoice?.customer?.name}\n ${invoice?.customer?.billingContact ?? 'ご担当者'}様\n \n お世話になっております。\n ${'〇〇'}です。\n \n ${this.getInvoicePeriod(invoice)}の請求書をご用意ができましたのでお送りさせていただきます。\n ご確認のほど、よろしくお願いいたします。\n \n ${invoice?.vendor?.type !== '個人事業主' ? invoice?.vendor?.name : ''}\n ${invoice?.vendor?.contact}`;\n }\n}\n","import { Invoice } from \"@xxmachina/common/domain-invoice/models\";\nimport { MessageBuilder } from \"../message\";\n\nexport class Email {\n static EMPTY = {\n to: '',\n cc: '',\n title: '',\n body: '',\n };\n\n to: string;\n cc: string;\n title: string;\n body: string;\n}\n\nexport class EmailBuilder {\n protected readonly mesageBuilder = new MessageBuilder();\n\n build(invoice: Invoice): Email {\n return {\n to: invoice?.customer?.billingEmail,\n cc: invoice?.vendor?.email,\n title: `[${invoice?.vendor?.name ?? '{{invoice.vendor.name}}'}] 請求書ご送付のお知らせ`,\n body: this.mesageBuilder.build(invoice),\n }\n }\n}","import { Invoice } from '@xxmachina/common/domain-invoice/models';\n\nexport class TitleBuilder {\n build(invoice: Invoice) {\n return `[${invoice?.customer?.name ?? '{{invoice.vendor.name}}'}様] invoice_${invoice?.dueDate?.toISOString()}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAIa,cAAc,CAAA;AACjB,IAAA,eAAe,CAAC,OAAgB,EAAA;AACtC,QAAA,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAI;YAC1D,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;AACzD,YAAA,OAAO,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,SAAS;AAClD,SAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;AACvB,QAAA,MAAM,GAAG,GAAG,CAAC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