@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,32 @@
1
+ import { inject } from '@angular/core';
2
+ import { AuthService } from '@xxmachina/common/auth';
3
+ import { map, distinctUntilChanged, switchMap, of } from 'rxjs';
4
+ import { QueryHasuraRepository, ResourceHasuraRepository } from '@xxmachina/common/infra/repository/hasura';
5
+
6
+ function getHasuraQueryStore() {
7
+ const repo = inject(QueryHasuraRepository);
8
+ const auth = inject(AuthService);
9
+ return {
10
+ list: () => auth.auth$.pipe(map(auth => !!auth), distinctUntilChanged(), switchMap((isAuthenticated) => isAuthenticated ? repo.listChanges() : of([]))),
11
+ create: (item) => repo.create(item),
12
+ update: (item) => repo.update(item).then(() => { }),
13
+ save: (item) => repo.save(item).then(() => item),
14
+ };
15
+ }
16
+ function getHasuraResourceStore() {
17
+ const repo = inject(ResourceHasuraRepository);
18
+ const auth = inject(AuthService);
19
+ return {
20
+ list: () => auth.auth$.pipe(map(auth => !!auth), distinctUntilChanged(), switchMap((isAuthenticated) => isAuthenticated ? repo.listChanges() : of([]))),
21
+ create: (item) => repo.create(item),
22
+ update: (item) => repo.update(item).then(() => { }),
23
+ save: (item) => repo.save(item).then(() => item),
24
+ };
25
+ }
26
+
27
+ /**
28
+ * Generated bundle index. Do not edit.
29
+ */
30
+
31
+ export { getHasuraQueryStore, getHasuraResourceStore };
32
+ //# sourceMappingURL=xxmachina-common-stores-hasura.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-stores-hasura.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/stores/hasura/hasura.store.ts","../../../../../packages/@xxmachina/common/src/lib/stores/hasura/xxmachina-common-stores-hasura.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { AuthService } from '@xxmachina/common/auth';\nimport { distinctUntilChanged, map, of, switchMap } from 'rxjs';\nimport { QueryHasuraRepository, ResourceHasuraRepository } from '@xxmachina/common/infra/repository/hasura';\n\nexport function getHasuraQueryStore() {\n const repo = inject(QueryHasuraRepository);\n const auth = inject(AuthService);\n return {\n list: () => auth.auth$.pipe(\n map(auth => !!auth),\n distinctUntilChanged(),\n switchMap((isAuthenticated) => isAuthenticated ? repo.listChanges() : of([])),\n ),\n create: (item: any) => repo.create(item),\n update: (item: any) => repo.update(item).then(() => {}),\n save: (item: any) => repo.save(item).then(() => item),\n };\n}\n\nexport function getHasuraResourceStore() {\n const repo = inject(ResourceHasuraRepository);\n const auth = inject(AuthService);\n\n return {\n list: () => auth.auth$.pipe(\n map(auth => !!auth),\n distinctUntilChanged(),\n switchMap((isAuthenticated) => isAuthenticated ? repo.listChanges() : of([])),\n ),\n create: (item: any) => repo.create(item),\n update: (item: any) => repo.update(item).then(() => {}),\n save: (item: any) => repo.save(item).then(() => item),\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;SAKg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,CAAC,IAAI,CAAC,MAAK,GAAG,CAAC;AACvD,QAAA,IAAI,EAAE,CAAC,IAAS,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC;KACtD;AACH;;AClCA;;AAEG;;;;"}
@@ -0,0 +1,16 @@
1
+ import { provideEntityStoreAdapter } from '@ng-atomic/common/stores/entities';
2
+ import { Query, Resource } from '@xxmachina/common/domain/models';
3
+
4
+ function provideQueryStore(useFactory) {
5
+ return provideEntityStoreAdapter(Query, useFactory);
6
+ }
7
+ function provideResourceStore(useFactory) {
8
+ return provideEntityStoreAdapter(Resource, useFactory);
9
+ }
10
+
11
+ /**
12
+ * Generated bundle index. Do not edit.
13
+ */
14
+
15
+ export { provideQueryStore, provideResourceStore };
16
+ //# sourceMappingURL=xxmachina-common-stores.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-stores.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/stores/index.ts","../../../../../packages/@xxmachina/common/src/lib/stores/xxmachina-common-stores.ts"],"sourcesContent":["import { EntityStoreAdapter, provideEntityStoreAdapter } from '@ng-atomic/common/stores/entities';\nimport { Resource, Query } from '@xxmachina/common/domain/models';\n\nexport function provideQueryStore(useFactory: () => EntityStoreAdapter<Query>) {\n return provideEntityStoreAdapter(Query, useFactory);\n}\n\nexport function provideResourceStore(useFactory: () => EntityStoreAdapter<Resource>) {\n return provideEntityStoreAdapter(Resource, useFactory);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGM,SAAU,iBAAiB,CAAC,UAA2C,EAAA;AAC3E,IAAA,OAAO,yBAAyB,CAAC,KAAK,EAAE,UAAU,CAAC;AACrD;AAEM,SAAU,oBAAoB,CAAC,UAA8C,EAAA;AACjF,IAAA,OAAO,yBAAyB,CAAC,QAAQ,EAAE,UAAU,CAAC;AACxD;;ACTA;;AAEG;;;;"}
@@ -0,0 +1,67 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i1 from '@xxmachina/common/infra';
4
+ import { hash } from '@xxmachina/common/utils/crypto';
5
+
6
+ class AssistantService {
7
+ infra;
8
+ constructor(infra) {
9
+ this.infra = infra;
10
+ }
11
+ async list() {
12
+ return await this.infra.repo.redis.operator.list();
13
+ }
14
+ async create(assistant) {
15
+ return this.infra.repo.redis.operator.create(assistant);
16
+ }
17
+ async update(assistant) {
18
+ return this.infra.repo.redis.operator.update(assistant);
19
+ }
20
+ async delete(assistantid) {
21
+ return this.infra.repo.redis.operator.delete(assistantid);
22
+ }
23
+ async operate(assistantId, input) {
24
+ const project = await this.infra.repo.redis.project.get('default');
25
+ const assistant = await this.infra.repo.redis.operator.get(assistantId);
26
+ const adapter = this.infra.external.getAiAdapter(project.settings.ai);
27
+ const embeddings = await adapter.embedding(input);
28
+ const specs = await this.infra.repo.redis.spec.search(assistant.id, embeddings);
29
+ const messages = [
30
+ { role: 'system', content: assistant.description },
31
+ ...specs.map(spec => [
32
+ { role: 'system', content: spec.input },
33
+ { role: 'assistant', content: spec.output },
34
+ ]).flat(),
35
+ { role: 'user', content: input },
36
+ ];
37
+ console.debug('messages', messages);
38
+ const output_ = await adapter.chatComplete(messages);
39
+ const output = this.scrape(assistant.outputInterfaceId, output_);
40
+ await this.infra.repo.redis.spec.create({
41
+ input, output, embeddings, id: hash(input), operatorId: assistant.id,
42
+ }).catch(() => { });
43
+ return output;
44
+ }
45
+ scrape(interface_, output) {
46
+ if (interface_ === 'interface:codeblock') {
47
+ const [_, ...lines] = (output.split('```')?.[1] ?? '').split('\n');
48
+ return `\`\`\`\n${lines.join('\n')}\n\`\`\``;
49
+ }
50
+ else {
51
+ return output;
52
+ }
53
+ }
54
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AssistantService, deps: [{ token: i1.InfrastructureService }], target: i0.ɵɵFactoryTarget.Injectable });
55
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AssistantService, providedIn: 'root' });
56
+ }
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AssistantService, decorators: [{
58
+ type: Injectable,
59
+ args: [{ providedIn: 'root' }]
60
+ }], ctorParameters: () => [{ type: i1.InfrastructureService }] });
61
+
62
+ /**
63
+ * Generated bundle index. Do not edit.
64
+ */
65
+
66
+ export { AssistantService };
67
+ //# sourceMappingURL=xxmachina-common-usecase-assistant.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-assistant.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/assistant/assistant.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/assistant/xxmachina-common-usecase-assistant.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { InfrastructureService } from \"@xxmachina/common/infra\";\nimport { AssistantOperator } from \"@xxmachina/common/domain/models\";\nimport { hash } from \"@xxmachina/common/utils/crypto\";\n\n\n@Injectable({providedIn: 'root'})\nexport class AssistantService {\n constructor(\n private infra: InfrastructureService,\n ) { }\n\n async list(): Promise<AssistantOperator[]> {\n return await this.infra.repo.redis.operator.list() as AssistantOperator[];\n }\n\n async create(assistant: AssistantOperator): Promise<AssistantOperator> {\n return this.infra.repo.redis.operator.create(assistant) as any;\n }\n\n async update(assistant: AssistantOperator): Promise<void> {\n return this.infra.repo.redis.operator.update(assistant);\n }\n\n async delete(assistantid: string): Promise<void> {\n return this.infra.repo.redis.operator.delete(assistantid);\n }\n\n async operate(assistantId: string, input: string): Promise<string> {\n const project = await this.infra.repo.redis.project.get('default');\n const assistant = await this.infra.repo.redis.operator.get(assistantId);\n const adapter = this.infra.external.getAiAdapter(project.settings.ai)\n const embeddings = await adapter.embedding(input);\n const specs = await this.infra.repo.redis.spec.search(assistant.id, embeddings);\n\n const messages = [\n {role: 'system', content: assistant.description},\n ...specs.map(spec => [\n {role: 'system', content: spec.input},\n {role: 'assistant', content: spec.output},\n ]).flat(),\n {role: 'user', content: input},\n ];\n\n console.debug('messages', messages);\n const output_ = await adapter.chatComplete(messages);\n const output = this.scrape(assistant.outputInterfaceId, output_);\n await this.infra.repo.redis.spec.create({\n input, output, embeddings, id: hash(input), operatorId: assistant.id,\n }).catch(() => {});\n\n return output;\n }\n\n private scrape(interface_: string, output: string): string {\n if (interface_ === 'interface:codeblock') {\n const [_, ...lines] = (output.split('```')?.[1] ?? '').split('\\n');\n return `\\`\\`\\`\\n${lines.join('\\n')}\\n\\`\\`\\``;\n } else {\n return output;\n }\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAOa,gBAAgB,CAAA;AAEjB,IAAA,KAAA;AADV,IAAA,WAAA,CACU,KAA4B,EAAA;QAA5B,IAAK,CAAA,KAAA,GAAL,KAAK;;AAGf,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAyB;;IAG3E,MAAM,MAAM,CAAC,SAA4B,EAAA;AACvC,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAQ;;IAGhE,MAAM,MAAM,CAAC,SAA4B,EAAA;AACvC,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC;;IAGzD,MAAM,MAAM,CAAC,WAAmB,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;;AAG3D,IAAA,MAAM,OAAO,CAAC,WAAmB,EAAE,KAAa,EAAA;AAC9C,QAAA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AAK,CAAC,IAAI,CAAC,MAAM,CAAC;AACtC,YAAA,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE;SACrE,CAAC,CAAC,KAAK,CAAC,MAAO,GAAC,CAAC;AAElB,QAAA,OAAO,MAAM;;IAGP,MAAM,CAAC,UAAkB,EAAE,MAAc,EAAA;AAC/C,QAAA,IAAI,UAAU,KAAK,qBAAqB,EAAE;YACxC,MAAM,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC;YAClE,OAAO,CAAA,QAAA,EAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU;;aACvC;AACL,YAAA,OAAO,MAAM;;;uGApDN,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADJ,MAAM,EAAA,CAAA;;2FAClB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;ACNhC;;AAEG;;;;"}
@@ -0,0 +1,95 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, Injectable } from '@angular/core';
3
+ import { ErBuilder } from '@xxmachina/common/domain/builder';
4
+ import { ScreenItemBuilder } from '@xxmachina/common/domain/builder/screen-item';
5
+ import { omit } from 'lodash-es';
6
+ import { injectNotion } from '@nx-ddd/notion';
7
+
8
+ function listDatabaseProperties(database, dbName) {
9
+ return new ScreenItemBuilder().build(database).map(item => ({ ...item, dbName }));
10
+ }
11
+ const DATABASE_CONFIG = new InjectionToken('DATABASE_CONFIG');
12
+ function provideDatabaseConfig(useFactory) {
13
+ return { provide: DATABASE_CONFIG, useFactory };
14
+ }
15
+ class DatabaseService {
16
+ config = inject(DATABASE_CONFIG);
17
+ notion = injectNotion();
18
+ async get(databaseId) {
19
+ return this.notion.retrieveDatabase(databaseId);
20
+ }
21
+ async update(databaseId, body) {
22
+ return this.notion.updateDatabase(databaseId, omit({
23
+ ...body.properties,
24
+ }, []));
25
+ }
26
+ async listDatabases() {
27
+ let start_cursor;
28
+ const databases = [];
29
+ while (true) {
30
+ const _databases = await this.notion.search({
31
+ filter: {
32
+ property: 'object',
33
+ value: 'database',
34
+ },
35
+ start_cursor,
36
+ });
37
+ for (const db of _databases.results) {
38
+ databases.push({
39
+ ...db,
40
+ _title: db['title']?.[0]?.plain_text,
41
+ });
42
+ }
43
+ if (!_databases.has_more)
44
+ break;
45
+ start_cursor = _databases.next_cursor;
46
+ }
47
+ const resolve = async (item) => ({ ...item, path: await this.getPath(item) });
48
+ return Promise.all(databases.map(db => resolve(db)));
49
+ }
50
+ async generateMermaidER() {
51
+ const databases = await this.listDatabases();
52
+ return new ErBuilder().build(databases);
53
+ }
54
+ async getPageItems(dbId, name) {
55
+ // const dbDetails = await this.notion.retrieveDatabase(dbId);
56
+ // const items = listDatabaseProperties(dbDetails, name);
57
+ // return items;
58
+ return [];
59
+ }
60
+ async getParent(parent) {
61
+ switch (parent.type) {
62
+ case 'database_id': return this.notion.retrieveDatabase(parent.database_id);
63
+ case 'page_id': return this.notion.retrievePage(parent.page_id);
64
+ case 'block_id': return this.notion.retrieveBlock(parent.block_id);
65
+ }
66
+ }
67
+ async getPath(obj) {
68
+ const objects = [obj];
69
+ return objects.map(obj => getTitle(obj)).filter(Boolean).reverse().join('/');
70
+ }
71
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DatabaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
72
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DatabaseService, providedIn: 'root' });
73
+ }
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DatabaseService, decorators: [{
75
+ type: Injectable,
76
+ args: [{ providedIn: 'root' }]
77
+ }] });
78
+ function getTitle(obj) {
79
+ if (obj.object === 'page') {
80
+ return obj.properties?.title?.title?.[0]?.plain_text;
81
+ }
82
+ else if (obj.object === 'database') {
83
+ return obj._title;
84
+ }
85
+ else {
86
+ return null;
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Generated bundle index. Do not edit.
92
+ */
93
+
94
+ export { DatabaseService, provideDatabaseConfig };
95
+ //# sourceMappingURL=xxmachina-common-usecase-database.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-database.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/database/database.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/database/xxmachina-common-usecase-database.ts"],"sourcesContent":["import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { ErBuilder } from '@xxmachina/common/domain/builder';\nimport { ScreenItemBuilder } from '@xxmachina/common/domain/builder/screen-item';\nimport { Database, ScreenItem } from '@xxmachina/common/domain/models';\nimport { omit } from 'lodash-es';\nimport { injectNotion } from '@nx-ddd/notion';\n\nfunction listDatabaseProperties(database: Database, dbName: string): ScreenItem[] {\n return new ScreenItemBuilder().build(database).map(item => ({...item, dbName}));\n}\n\nexport interface DatabaseConfig {\n notionApiKey: string;\n databaseIdToName: { [key: string]: string };\n}\n\nconst DATABASE_CONFIG = new InjectionToken<DatabaseConfig>('DATABASE_CONFIG');\n\nexport function provideDatabaseConfig(useFactory: () => DatabaseConfig) {\n return { provide: DATABASE_CONFIG, useFactory };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DatabaseService {\n protected config = inject(DATABASE_CONFIG);\n protected notion = injectNotion();\n\n async get(databaseId: string) {\n return this.notion.retrieveDatabase(databaseId);\n }\n\n async update(databaseId: string, body: any) {\n return this.notion.updateDatabase(databaseId, omit({\n ...body.properties,\n }, []));\n }\n\n async listDatabases() {\n let start_cursor;\n const databases = [];\n\n while (true) {\n const _databases = await this.notion.search({\n filter: {\n property: 'object',\n value: 'database',\n },\n start_cursor,\n });\n for (const db of _databases.results) {\n databases.push({\n ...db,\n _title: db['title']?.[0]?.plain_text,\n });\n }\n\n if (!_databases.has_more) break;\n start_cursor = _databases.next_cursor;\n }\n\n const resolve = async (item) => ({...item, path: await this.getPath(item)});\n\n return Promise.all(databases.map(db => resolve(db)));\n }\n\n async generateMermaidER(): Promise<string> {\n const databases = await this.listDatabases();\n return new ErBuilder().build(databases); \n }\n\n async getPageItems(dbId: string, name: string) {\n // const dbDetails = await this.notion.retrieveDatabase(dbId);\n // const items = listDatabaseProperties(dbDetails, name);\n // return items;\n return [];\n }\n\n async getParent(parent: {\n type: 'database_id',\n database_id: string\n } | {\n type: 'page_id',\n page_id: string\n } | {\n type: 'block_id',\n block_id: string\n }) {\n switch (parent.type) {\n case 'database_id': return this.notion.retrieveDatabase(parent.database_id)\n case 'page_id': return this.notion.retrievePage(parent.page_id);\n case 'block_id': return this.notion.retrieveBlock(parent.block_id);\n }\n }\n\n async getPath(obj: any) {\n const objects = [obj];\n return objects.map(obj => getTitle(obj)).filter(Boolean).reverse().join('/');\n }\n}\n\nfunction getTitle(obj: any) {\n if (obj.object === 'page') {\n return obj.properties?.title?.title?.[0]?.plain_text;\n } else if (obj.object === 'database') {\n return obj._title;\n } else {\n return null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAOA,SAAS,sBAAsB,CAAC,QAAkB,EAAE,MAAc,EAAA;I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AA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA;;2FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AA8ElC,SAAS,QAAQ,CAAC,GAAQ,EAAA;AACxB,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;AACzB,QAAA,OAAO,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,UAAU;;AAC/C,SAAA,IAAI,GAAG,CAAC,MAAM,KAAK,UAAU,EAAE;QACpC,OAAO,GAAG,CAAC,MAAM;;SACZ;AACL,QAAA,OAAO,IAAI;;AAEf;;AC5GA;;AAEG;;;;"}
@@ -0,0 +1,51 @@
1
+ import { __decorate, __metadata } from 'tslib';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, Injectable } from '@angular/core';
5
+ import { injectAnyFunc } from '@nx-ddd/any-func';
6
+ import { injectDataConnectService } from '@xxmachina/common/infra/external/data-connect';
7
+ import { IsString } from 'class-validator';
8
+
9
+ class Result {
10
+ query;
11
+ }
12
+ __decorate([
13
+ IsString(),
14
+ __metadata("design:type", String)
15
+ ], Result.prototype, "query", void 0);
16
+ class GraphqlService {
17
+ http = inject(HttpClient);
18
+ anyFunc = injectAnyFunc();
19
+ dc = injectDataConnectService();
20
+ constructor() { }
21
+ async graphql(query) {
22
+ // return lastValueFrom(this.http.post('http://localhost:3330/api/dataConnect', {query}));
23
+ return this.dc.executeGraphqlRead(query);
24
+ }
25
+ async makeQuery(instructions) {
26
+ const schemaQuery = `{ __schema { types { name fields { name type { name } } } } }`;
27
+ const schemaResult = await this.graphql(schemaQuery);
28
+ return this.anyFunc.call(instructions, Result, {
29
+ instructions: `
30
+ アシスタントはユーザーの要求を満たすGraphQLクエリを下記のサーバーのスキーマを元に生成します。
31
+
32
+ ${JSON.stringify(schemaResult, null, 2)}
33
+ `,
34
+ model: 'gpt-4o-mini',
35
+ validator: async (output) => this.graphql(output.query).then(() => []).catch(error => [error.message]),
36
+ }).then(result => result.query);
37
+ }
38
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: GraphqlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
39
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: GraphqlService, providedIn: 'root' });
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: GraphqlService, decorators: [{
42
+ type: Injectable,
43
+ args: [{ providedIn: 'root' }]
44
+ }], ctorParameters: () => [] });
45
+
46
+ /**
47
+ * Generated bundle index. Do not edit.
48
+ */
49
+
50
+ export { GraphqlService };
51
+ //# sourceMappingURL=xxmachina-common-usecase-graphql.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-graphql.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/graphql/graphql.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/graphql/xxmachina-common-usecase-graphql.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { injectAnyFunc } from '@nx-ddd/any-func';\nimport { injectDataConnectService } from '@xxmachina/common/infra/external/data-connect';\nimport { IsString } from 'class-validator';\n\nclass Result {\n @IsString()\n query: string;\n}\n\n@Injectable({providedIn: 'root'})\nexport class GraphqlService {\n protected http = inject(HttpClient);\n protected anyFunc = injectAnyFunc();\n protected dc = injectDataConnectService();\n\n constructor() {}\n\n async graphql(query: string) {\n // return lastValueFrom(this.http.post('http://localhost:3330/api/dataConnect', {query}));\n return this.dc.executeGraphqlRead(query);\n }\n\n async makeQuery(instructions: string) {\n const schemaQuery = `{ __schema { types { name fields { name type { name } } } } }`;\n const schemaResult = await this.graphql(schemaQuery);\n return this.anyFunc.call(instructions, Result, {\n instructions: `\n アシスタントはユーザーの要求を満たすGraphQLクエリを下記のサーバーのスキーマを元に生成します。\n\n ${JSON.stringify(schemaResult, null, 2)}\n `,\n model: 'gpt-4o-mini',\n validator: async (output) => this.graphql(output.query).then(() => []).catch(error => [error.message]),\n }).then(result => result.query);\n }\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAMA,MAAM,MAAM,CAAA;AAEV,IAAA,KAAK;AACN;AADC,UAAA,CAAA;AADC,IAAA,QAAQ,EAAE;;AACG,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;MAIH,cAAc,CAAA;AACf,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IACzB,OAAO,GAAG,aAAa,EAAE;IACzB,EAAE,GAAG,wBAAwB,EAAE;AAEzC,IAAA,WAAA,GAAA;IAEA,MAAM,OAAO,CAAC,KAAa,EAAA;;QAEzB,OAAO,IAAI,CAAC,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;;IAG1C,MAAM,SAAS,CAAC,YAAoB,EAAA;QAClC,MAAM,WAAW,GAAG,CAAA,6DAAA,CAA+D;QACnF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE;AAC7C,YAAA,YAAY,EAAE;;;UAGV,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AACxC,MAAA,CAAA;AACD,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,SAAS,EAAE,OAAO,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACvG,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC;;uGAvBtB,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADF,MAAM,EAAA,CAAA;;2FAClB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;ACXhC;;AAEG;;;;"}
@@ -0,0 +1,67 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { InvoiceRepository } from '@xxmachina/common/infra/repository/notion';
4
+ import { injectInvoiceRepository } from '@xxmachina/common/infra/repository/dataconnect';
5
+ import { CHROMIUM } from '@nx-ddd/common/infrastructure/externals/chromium';
6
+ import { makeDI } from '@nx-ddd/core';
7
+ import { RESEND_SERVICE } from '@xxmachina/common/infra/external/resend';
8
+
9
+ const INVOICE_CONFIG = makeDI('[@xxmachina/invoice] INVOICE_CONFIG', { optional: false });
10
+ class InvoiceService {
11
+ notion = inject(InvoiceRepository);
12
+ dataConnect = injectInvoiceRepository();
13
+ chromium = CHROMIUM.inject();
14
+ config = INVOICE_CONFIG.inject();
15
+ resend = RESEND_SERVICE.inject();
16
+ async sync() {
17
+ const invoices = await this.notion.list();
18
+ await this.dataConnect.deleteAll();
19
+ await this.dataConnect.createMany(invoices);
20
+ }
21
+ async makePdf(data) {
22
+ return this.chromium.start(async (browser) => {
23
+ const context = await browser.newContext({
24
+ deviceScaleFactor: 2,
25
+ });
26
+ const page = await context.newPage();
27
+ page.on('console', msg => console.log('PAGE LOG:', msg.text()));
28
+ page.on('pageerror', err => console.log('PAGE ERROR:', err.message));
29
+ const url = `${this.config.templateBaseUrl}?json=${encodeURIComponent(JSON.stringify(data))}`;
30
+ await page.goto(url, { waitUntil: 'networkidle' });
31
+ await page.evaluate(() => document.fonts.ready);
32
+ await page.waitForSelector('h1');
33
+ const title = await page.title();
34
+ const pdf = await page.pdf({ format: 'A4' });
35
+ return { pdf, title, name: `${title}.pdf` };
36
+ });
37
+ }
38
+ async sendMail(mail) {
39
+ const pdf = await this.makePdf(mail.invoice);
40
+ await this.resend.emails.send({
41
+ from: mail.from,
42
+ to: mail.to,
43
+ subject: mail.subject,
44
+ html: mail.content,
45
+ attachments: [
46
+ {
47
+ filename: pdf.name,
48
+ content: pdf.pdf,
49
+ contentType: 'application/pdf',
50
+ }
51
+ ]
52
+ });
53
+ }
54
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: InvoiceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
55
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: InvoiceService, providedIn: 'root' });
56
+ }
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: InvoiceService, decorators: [{
58
+ type: Injectable,
59
+ args: [{ providedIn: 'root' }]
60
+ }] });
61
+
62
+ /**
63
+ * Generated bundle index. Do not edit.
64
+ */
65
+
66
+ export { INVOICE_CONFIG, InvoiceService };
67
+ //# sourceMappingURL=xxmachina-common-usecase-invoice.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-invoice.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/invoice/invoice.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/invoice/xxmachina-common-usecase-invoice.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { InvoiceRepository as NotionRepository } from '@xxmachina/common/infra/repository/notion';\nimport { injectInvoiceRepository } from '@xxmachina/common/infra/repository/dataconnect';\nimport { CHROMIUM } from '@nx-ddd/common/infrastructure/externals/chromium';\nimport { makeDI } from '@nx-ddd/core';\nimport { RESEND_SERVICE } from '@xxmachina/common/infra/external/resend';\nimport { InvoiceMail } from '@xxmachina/common/domain-invoice/models';\n\nexport interface InvoiceConfig {\n templateBaseUrl: string;\n}\n\nexport const INVOICE_CONFIG = makeDI<InvoiceConfig>('[@xxmachina/invoice] INVOICE_CONFIG', {optional: false});\n\n@Injectable({ providedIn: 'root' })\nexport class InvoiceService {\n protected notion = inject(NotionRepository);\n protected dataConnect = injectInvoiceRepository();\n protected readonly chromium = CHROMIUM.inject();\n protected readonly config = INVOICE_CONFIG.inject();\n protected readonly resend = RESEND_SERVICE.inject();\n\n async sync() {\n const invoices = await this.notion.list();\n await this.dataConnect.deleteAll();\n await this.dataConnect.createMany(invoices);\n }\n\n async makePdf(data: object): Promise<{ pdf: Buffer, title: string, name: string }> {\n return this.chromium.start(async (browser) => {\n const context = await browser.newContext({\n deviceScaleFactor: 2,\n });\n const page = await context.newPage();\n page.on('console', msg => console.log('PAGE LOG:', msg.text()));\n page.on('pageerror', err => console.log('PAGE ERROR:', err.message));\n const url = `${this.config.templateBaseUrl}?json=${encodeURIComponent(JSON.stringify(data))}`;\n await page.goto(url, { waitUntil: 'networkidle' });\n await page.evaluate(() => document.fonts.ready);\n await page.waitForSelector('h1');\n const title = await page.title();\n const pdf = await page.pdf({ format: 'A4' });\n return { pdf, title, name: `${title}.pdf` };\n });\n }\n\n async sendMail(mail: InvoiceMail) {\n const pdf = await this.makePdf(mail.invoice);\n await this.resend.emails.send({\n from: mail.from,\n to: mail.to,\n subject: mail.subject,\n html: mail.content,\n attachments: [\n {\n filename: pdf.name,\n content: pdf.pdf,\n contentType: 'application/pdf',\n }\n ]\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NotionRepository"],"mappings":";;;;;;;;AAYO,MAAM,cAAc,GAAG,MAAM,CAAgB,qCAAqC,EAAE,EAAC,QAAQ,EAAE,KAAK,EAAC;MAG/F,cAAc,CAAA;AACf,IAAA,MAAM,GAAG,MAAM,CAACA,iBAAgB,CAAC;IACjC,WAAW,GAAG,uBAAuB,EAAE;AAC9B,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE;AAC5B,IAAA,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE;AAChC,IAAA,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE;AAEnD,IAAA,MAAM,IAAI,GAAA;QACR,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AACzC,QAAA,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;QAClC,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC;;IAG7C,MAAM,OAAO,CAAC,IAAY,EAAA;QACxB,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,OAAO,KAAI;AAC3C,YAAA,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;AACvC,gBAAA,iBAAiB,EAAE,CAAC;AACrB,aAAA,CAAC;AACF,YAAA,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE;YACpC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAC/D,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;AACpE,YAAA,MAAM,G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EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA;;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACdlC;;AAEG;;;;"}
@@ -0,0 +1,26 @@
1
+ import * as i1 from '@xxmachina/common/infra';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable } from '@angular/core';
4
+
5
+ class LinkService {
6
+ infra;
7
+ constructor(infra) {
8
+ this.infra = infra;
9
+ }
10
+ saveGoogleLink(google) {
11
+ return this.infra.repo.firestore.link.google.save(google);
12
+ }
13
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: LinkService, deps: [{ token: i1.InfrastructureService }], target: i0.ɵɵFactoryTarget.Injectable });
14
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: LinkService, providedIn: 'root' });
15
+ }
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: LinkService, decorators: [{
17
+ type: Injectable,
18
+ args: [{ providedIn: 'root' }]
19
+ }], ctorParameters: () => [{ type: i1.InfrastructureService }] });
20
+
21
+ /**
22
+ * Generated bundle index. Do not edit.
23
+ */
24
+
25
+ export { LinkService };
26
+ //# sourceMappingURL=xxmachina-common-usecase-link.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-link.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/link/link.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/link/xxmachina-common-usecase-link.ts"],"sourcesContent":["import { Google } from \"@xxmachina/common/domain/models\";\nimport { InfrastructureService } from \"@xxmachina/common/infra\";\nimport { Injectable } from \"@angular/core\";\n\n@Injectable({providedIn: 'root'})\nexport class LinkService {\n constructor(\n public infra: InfrastructureService,\n ) { }\n\n saveGoogleLink(google: Google) {\n return this.infra.repo.firestore.link.google.save(google);\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAKa,WAAW,CAAA;AAEb,IAAA,KAAA;AADT,IAAA,WAAA,CACS,KAA4B,EAAA;QAA5B,IAAK,CAAA,KAAA,GAAL,KAAK;;AAGd,IAAA,cAAc,CAAC,MAAc,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;;uGANhD,WAAW,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cADC,MAAM,EAAA,CAAA;;2FAClB,WAAW,EAAA,UAAA,EAAA,CAAA;kBADvB,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;ACJhC;;AAEG;;;;"}
@@ -0,0 +1,29 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { OrderRepository } from '@xxmachina/common/infra/repository/notion';
4
+ import { injectOrderRepository } from '@xxmachina/common/infra/repository/dataconnect';
5
+
6
+ class OrderService {
7
+ notion = inject(OrderRepository);
8
+ dataConnect = injectOrderRepository();
9
+ async sync() {
10
+ const orders = await this.notion.list();
11
+ await this.dataConnect.deleteAll();
12
+ await this.dataConnect.createMany(orders);
13
+ }
14
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: OrderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
15
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: OrderService, providedIn: 'root' });
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: OrderService, decorators: [{
18
+ type: Injectable,
19
+ args: [{
20
+ providedIn: 'root',
21
+ }]
22
+ }] });
23
+
24
+ /**
25
+ * Generated bundle index. Do not edit.
26
+ */
27
+
28
+ export { OrderService };
29
+ //# sourceMappingURL=xxmachina-common-usecase-order.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-order.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/order/order.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/order/xxmachina-common-usecase-order.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { OrderRepository as NotionRepository } from '@xxmachina/common/infra/repository/notion';\nimport { injectOrderRepository } from '@xxmachina/common/infra/repository/dataconnect';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class OrderService {\n protected notion = inject(NotionRepository);\n protected dataConnect = injectOrderRepository();\n\n async sync() {\n const orders = await this.notion.list();\n await this.dataConnect.deleteAll();\n await this.dataConnect.createMany(orders);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NotionRepository"],"mappings":";;;;;MAOa,YAAY,CAAA;AACb,IAAA,MAAM,GAAG,MAAM,CAACA,eAAgB,CAAC;IACjC,WAAW,GAAG,qBAAqB,EAAE;AAE/C,IAAA,MAAM,IAAI,GAAA;QACR,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AACvC,QAAA,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;QAClC,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC;;uGAPhC,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFX,MAAM,EAAA,CAAA;;2FAEP,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
@@ -0,0 +1,35 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i1 from '@xxmachina/common/infra';
4
+
5
+ class ProjectService {
6
+ infra;
7
+ constructor(infra) {
8
+ this.infra = infra;
9
+ }
10
+ async list() {
11
+ return await this.infra.repo.redis.project.list();
12
+ }
13
+ async get(projectId) {
14
+ return this.infra.repo.redis.project.get(projectId);
15
+ }
16
+ async create(project) {
17
+ return this.infra.repo.redis.project.create(project);
18
+ }
19
+ async update(project) {
20
+ return this.infra.repo.redis.project.update(project);
21
+ }
22
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ProjectService, deps: [{ token: i1.InfrastructureService }], target: i0.ɵɵFactoryTarget.Injectable });
23
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ProjectService, providedIn: 'root' });
24
+ }
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ProjectService, decorators: [{
26
+ type: Injectable,
27
+ args: [{ providedIn: 'root' }]
28
+ }], ctorParameters: () => [{ type: i1.InfrastructureService }] });
29
+
30
+ /**
31
+ * Generated bundle index. Do not edit.
32
+ */
33
+
34
+ export { ProjectService };
35
+ //# sourceMappingURL=xxmachina-common-usecase-project.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-project.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/project/project.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/project/xxmachina-common-usecase-project.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { Project } from \"@xxmachina/common/domain/models\";\nimport { InfrastructureService } from \"@xxmachina/common/infra\";\n\n\n@Injectable({providedIn: 'root'})\nexport class ProjectService {\n constructor(\n private infra: InfrastructureService,\n ) { }\n\n async list(): Promise<Project[]> {\n return await this.infra.repo.redis.project.list() as Project[];\n }\n\n async get(projectId: string): Promise<Project> {\n return this.infra.repo.redis.project.get(projectId);\n }\n\n async create(project: Project): Promise<Project> {\n return this.infra.repo.redis.project.create(project);\n }\n\n async update(project: Project): Promise<void> {\n return this.infra.repo.redis.project.update(project);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,cAAc,CAAA;AAEf,IAAA,KAAA;AADV,IAAA,WAAA,CACU,KAA4B,EAAA;QAA5B,IAAK,CAAA,KAAA,GAAL,KAAK;;AAGf,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAe;;IAGhE,MAAM,GAAG,CAAC,SAAiB,EAAA;AACzB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;IAGrD,MAAM,MAAM,CAAC,OAAgB,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;;IAGtD,MAAM,MAAM,CAAC,OAAgB,EAAA;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;;uGAlB3C,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADF,MAAM,EAAA,CAAA;;2FAClB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;ACLhC;;AAEG;;;;"}
@@ -0,0 +1,45 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as i1 from '@xxmachina/common/infra';
4
+ import { hash } from '@xxmachina/common/utils/crypto';
5
+
6
+ class SpecService {
7
+ infra;
8
+ constructor(infra) {
9
+ this.infra = infra;
10
+ }
11
+ async list() {
12
+ return this.infra.repo.redis.spec.list();
13
+ }
14
+ async get(id) {
15
+ return this.infra.repo.redis.spec.get(id);
16
+ }
17
+ async create(spec) {
18
+ const project = await this.infra.repo.redis.project.get('default');
19
+ const embeddings = await this.infra.external.getAiAdapter(project.settings.ai).embedding(spec.input);
20
+ return this.infra.repo.redis.spec.create({ ...spec, embeddings, id: hash(spec.input) });
21
+ }
22
+ async update(spec) {
23
+ const project = await this.infra.repo.redis.project.get('default');
24
+ const embeddings = await this.infra.external.getAiAdapter(project.settings.ai).embedding(spec.input);
25
+ if (spec.id !== hash(spec.input))
26
+ throw new Error('id is not match with input hash');
27
+ return this.infra.repo.redis.spec.update({ ...spec, embeddings });
28
+ }
29
+ async delete(id) {
30
+ return this.infra.repo.redis.spec.delete(id);
31
+ }
32
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SpecService, deps: [{ token: i1.InfrastructureService }], target: i0.ɵɵFactoryTarget.Injectable });
33
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SpecService, providedIn: 'root' });
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SpecService, decorators: [{
36
+ type: Injectable,
37
+ args: [{ providedIn: 'root' }]
38
+ }], ctorParameters: () => [{ type: i1.InfrastructureService }] });
39
+
40
+ /**
41
+ * Generated bundle index. Do not edit.
42
+ */
43
+
44
+ export { SpecService };
45
+ //# sourceMappingURL=xxmachina-common-usecase-spec.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xxmachina-common-usecase-spec.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/usecase/spec/spec.service.ts","../../../../../packages/@xxmachina/common/src/lib/usecase/spec/xxmachina-common-usecase-spec.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\nimport { InfrastructureService } from \"@xxmachina/common/infra\";\nimport { Spec } from \"@xxmachina/common/domain/models\";\nimport { hash } from \"@xxmachina/common/utils/crypto\";\n\n@Injectable({providedIn: 'root'})\nexport class SpecService {\n constructor(\n private infra: InfrastructureService,\n ) { }\n\n async list(): Promise<Spec[]> {\n return this.infra.repo.redis.spec.list();\n }\n\n async get(id: string): Promise<Spec> {\n return this.infra.repo.redis.spec.get(id);\n }\n\n async create(spec: Spec): Promise<Spec> {\n const project = await this.infra.repo.redis.project.get('default');\n const embeddings = await this.infra.external.getAiAdapter(project.settings.ai).embedding(spec.input);\n return this.infra.repo.redis.spec.create({...spec, embeddings, id: hash(spec.input)});\n }\n\n async update(spec: Partial<Spec>): Promise<void> {\n const project = await this.infra.repo.redis.project.get('default');\n const embeddings = await this.infra.external.getAiAdapter(project.settings.ai).embedding(spec.input);\n if (spec.id !== hash(spec.input)) throw new Error('id is not match with input hash');\n return this.infra.repo.redis.spec.update({...spec, embeddings});\n }\n\n async delete(id: string): Promise<void> {\n return this.infra.repo.redis.spec.delete(id);\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,WAAW,CAAA;AAEZ,IAAA,KAAA;AADV,IAAA,WAAA,CACU,KAA4B,EAAA;QAA5B,IAAK,CAAA,KAAA,GAAL,KAAK;;AAGf,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;;IAG1C,MAAM,GAAG,CAAC,EAAU,EAAA;AAClB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;;IAG3C,MAAM,MAAM,CAAC,IAAU,EAAA;AACrB,QAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QAClE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AACpG,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,GAAG,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC,CAAC;;IAGvF,MAAM,MAAM,CAAC,IAAmB,EAAA;AAC9B,QAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC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