@webda/core 4.0.0-beta.2 → 4.0.0-beta.3

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 (756) hide show
  1. package/README.md +252 -0
  2. package/lib/application/application.d.ts +437 -0
  3. package/lib/application/application.d.ts.map +1 -0
  4. package/lib/application/application.js +792 -0
  5. package/lib/application/application.js.map +1 -0
  6. package/lib/application/hooks.d.ts +34 -0
  7. package/lib/application/hooks.d.ts.map +1 -0
  8. package/lib/application/hooks.js +57 -0
  9. package/lib/application/hooks.js.map +1 -0
  10. package/lib/application/iapplication.d.ts +43 -0
  11. package/lib/application/iapplication.d.ts.map +1 -0
  12. package/lib/application/iapplication.js +2 -0
  13. package/lib/application/iapplication.js.map +1 -0
  14. package/lib/application/iconfiguration.d.ts +176 -0
  15. package/lib/application/iconfiguration.d.ts.map +1 -0
  16. package/lib/application/iconfiguration.js +8 -0
  17. package/lib/application/iconfiguration.js.map +1 -0
  18. package/lib/application/runner.d.ts +8 -0
  19. package/lib/application/runner.d.ts.map +1 -0
  20. package/lib/application/runner.js +26 -0
  21. package/lib/application/runner.js.map +1 -0
  22. package/lib/{unpackedapplication.d.ts → application/unpackedapplication.d.ts} +43 -23
  23. package/lib/application/unpackedapplication.d.ts.map +1 -0
  24. package/lib/application/unpackedapplication.js +492 -0
  25. package/lib/application/unpackedapplication.js.map +1 -0
  26. package/lib/bin/cli-phase.d.ts +28 -0
  27. package/lib/bin/cli-phase.d.ts.map +1 -0
  28. package/lib/bin/cli-phase.js +44 -0
  29. package/lib/bin/cli-phase.js.map +1 -0
  30. package/lib/bin/cli.d.ts +161 -0
  31. package/lib/bin/cli.d.ts.map +1 -0
  32. package/lib/bin/cli.js +828 -0
  33. package/lib/bin/cli.js.map +1 -0
  34. package/lib/bin/launcher.d.ts +3 -0
  35. package/lib/bin/launcher.d.ts.map +1 -0
  36. package/lib/bin/launcher.js +50 -0
  37. package/lib/bin/launcher.js.map +1 -0
  38. package/lib/cache/cache.d.ts +33 -0
  39. package/lib/cache/cache.d.ts.map +1 -0
  40. package/lib/cache/cache.js +8 -0
  41. package/lib/cache/cache.js.map +1 -0
  42. package/lib/{services/configuration.d.ts → configurations/configuration.service.d.ts} +58 -58
  43. package/lib/configurations/configuration.service.d.ts.map +1 -0
  44. package/lib/configurations/configuration.service.js +248 -0
  45. package/lib/configurations/configuration.service.js.map +1 -0
  46. package/lib/configurations/fileconfiguration.service.d.ts +30 -0
  47. package/lib/configurations/fileconfiguration.service.d.ts.map +1 -0
  48. package/lib/configurations/fileconfiguration.service.js +65 -0
  49. package/lib/configurations/fileconfiguration.service.js.map +1 -0
  50. package/lib/configurations/kubernetesconfiguration.service.d.ts +43 -0
  51. package/lib/configurations/kubernetesconfiguration.service.d.ts.map +1 -0
  52. package/lib/configurations/kubernetesconfiguration.service.js +83 -0
  53. package/lib/configurations/kubernetesconfiguration.service.js.map +1 -0
  54. package/lib/contexts/execution.d.ts +33 -0
  55. package/lib/contexts/execution.d.ts.map +1 -0
  56. package/lib/contexts/execution.js +73 -0
  57. package/lib/contexts/execution.js.map +1 -0
  58. package/lib/contexts/globalcontext.d.ts +29 -0
  59. package/lib/contexts/globalcontext.d.ts.map +1 -0
  60. package/lib/contexts/globalcontext.js +38 -0
  61. package/lib/contexts/globalcontext.js.map +1 -0
  62. package/lib/{utils → contexts}/httpcontext.d.ts +44 -19
  63. package/lib/contexts/httpcontext.d.ts.map +1 -0
  64. package/lib/{utils → contexts}/httpcontext.js +95 -27
  65. package/lib/contexts/httpcontext.js.map +1 -0
  66. package/lib/contexts/icontext.d.ts +236 -0
  67. package/lib/contexts/icontext.d.ts.map +1 -0
  68. package/lib/contexts/icontext.js +230 -0
  69. package/lib/contexts/icontext.js.map +1 -0
  70. package/lib/contexts/operationcontext.d.ts +179 -0
  71. package/lib/contexts/operationcontext.d.ts.map +1 -0
  72. package/lib/contexts/operationcontext.js +358 -0
  73. package/lib/contexts/operationcontext.js.map +1 -0
  74. package/lib/contexts/simplecontext.d.ts +31 -0
  75. package/lib/contexts/simplecontext.d.ts.map +1 -0
  76. package/lib/contexts/simplecontext.js +45 -0
  77. package/lib/contexts/simplecontext.js.map +1 -0
  78. package/lib/contexts/webcontext.d.ts +218 -0
  79. package/lib/contexts/webcontext.d.ts.map +1 -0
  80. package/lib/contexts/webcontext.js +389 -0
  81. package/lib/contexts/webcontext.js.map +1 -0
  82. package/lib/core/authorizer.d.ts +23 -0
  83. package/lib/core/authorizer.d.ts.map +1 -0
  84. package/lib/core/authorizer.js +17 -0
  85. package/lib/core/authorizer.js.map +1 -0
  86. package/lib/core/core.d.ts +225 -0
  87. package/lib/core/core.d.ts.map +1 -0
  88. package/lib/core/core.js +576 -0
  89. package/lib/core/core.js.map +1 -0
  90. package/lib/core/hooks.d.ts +72 -0
  91. package/lib/core/hooks.d.ts.map +1 -0
  92. package/lib/core/hooks.js +73 -0
  93. package/lib/core/hooks.js.map +1 -0
  94. package/lib/core/icore.d.ts +249 -0
  95. package/lib/core/icore.d.ts.map +1 -0
  96. package/lib/core/icore.js +15 -0
  97. package/lib/core/icore.js.map +1 -0
  98. package/lib/core/instancestorage.d.ts +61 -0
  99. package/lib/core/instancestorage.d.ts.map +1 -0
  100. package/lib/core/instancestorage.js +75 -0
  101. package/lib/core/instancestorage.js.map +1 -0
  102. package/lib/core/operations.d.ts +181 -0
  103. package/lib/core/operations.d.ts.map +1 -0
  104. package/lib/core/operations.js +559 -0
  105. package/lib/core/operations.js.map +1 -0
  106. package/lib/errors/errors.d.ts +126 -0
  107. package/lib/errors/errors.d.ts.map +1 -0
  108. package/lib/errors/errors.js +165 -0
  109. package/lib/errors/errors.js.map +1 -0
  110. package/lib/events/asynceventemitter.d.ts +159 -0
  111. package/lib/events/asynceventemitter.d.ts.map +1 -0
  112. package/lib/events/asynceventemitter.js +152 -0
  113. package/lib/events/asynceventemitter.js.map +1 -0
  114. package/lib/events/events.d.ts +112 -0
  115. package/lib/events/events.d.ts.map +1 -0
  116. package/lib/events/events.js +45 -0
  117. package/lib/events/events.js.map +1 -0
  118. package/lib/index.d.ts +82 -53
  119. package/lib/index.d.ts.map +1 -1
  120. package/lib/index.js +81 -62
  121. package/lib/index.js.map +1 -1
  122. package/lib/loggers/console.service.d.ts +24 -0
  123. package/lib/loggers/console.service.d.ts.map +1 -0
  124. package/lib/loggers/console.service.js +30 -0
  125. package/lib/loggers/console.service.js.map +1 -0
  126. package/lib/loggers/file.service.d.ts +25 -0
  127. package/lib/loggers/file.service.d.ts.map +1 -0
  128. package/lib/loggers/file.service.js +33 -0
  129. package/lib/loggers/file.service.js.map +1 -0
  130. package/lib/loggers/hooks.d.ts +20 -0
  131. package/lib/loggers/hooks.d.ts.map +1 -0
  132. package/lib/loggers/hooks.js +40 -0
  133. package/lib/loggers/hooks.js.map +1 -0
  134. package/lib/loggers/ilogger.d.ts +76 -0
  135. package/lib/loggers/ilogger.d.ts.map +1 -0
  136. package/lib/loggers/ilogger.js +108 -0
  137. package/lib/loggers/ilogger.js.map +1 -0
  138. package/lib/loggers/logger.d.ts +13 -0
  139. package/lib/loggers/logger.d.ts.map +1 -0
  140. package/lib/loggers/logger.js +18 -0
  141. package/lib/loggers/logger.js.map +1 -0
  142. package/lib/loggers/memory.service.d.ts +18 -0
  143. package/lib/loggers/memory.service.d.ts.map +1 -0
  144. package/lib/loggers/memory.service.js +21 -0
  145. package/lib/loggers/memory.service.js.map +1 -0
  146. package/lib/loggers/params.d.ts +47 -0
  147. package/lib/loggers/params.d.ts.map +1 -0
  148. package/lib/loggers/params.js +56 -0
  149. package/lib/loggers/params.js.map +1 -0
  150. package/lib/metrics/metrics.d.ts +25 -0
  151. package/lib/metrics/metrics.d.ts.map +1 -0
  152. package/lib/metrics/metrics.js +51 -0
  153. package/lib/metrics/metrics.js.map +1 -0
  154. package/lib/models/aclmodel.d.ts +20 -76
  155. package/lib/models/aclmodel.d.ts.map +1 -1
  156. package/lib/models/aclmodel.js +27 -203
  157. package/lib/models/aclmodel.js.map +1 -1
  158. package/lib/models/coremodel.model.d.ts +5 -0
  159. package/lib/models/coremodel.model.d.ts.map +1 -0
  160. package/lib/models/coremodel.model.js +5 -0
  161. package/lib/models/coremodel.model.js.map +1 -0
  162. package/lib/models/decorator.d.ts +63 -0
  163. package/lib/models/decorator.d.ts.map +1 -0
  164. package/lib/models/decorator.js +63 -0
  165. package/lib/models/decorator.js.map +1 -0
  166. package/lib/models/deployment.d.ts +1 -1
  167. package/lib/models/deployment.d.ts.map +1 -1
  168. package/lib/models/ident.model.d.ts +89 -0
  169. package/lib/models/ident.model.d.ts.map +1 -0
  170. package/lib/models/ident.model.js +115 -0
  171. package/lib/models/ident.model.js.map +1 -0
  172. package/lib/models/ownermodel.model.d.ts +68 -0
  173. package/lib/models/ownermodel.model.d.ts.map +1 -0
  174. package/lib/models/ownermodel.model.js +112 -0
  175. package/lib/models/ownermodel.model.js.map +1 -0
  176. package/lib/models/registry.model.d.ts +76 -0
  177. package/lib/models/registry.model.d.ts.map +1 -0
  178. package/lib/models/registry.model.js +104 -0
  179. package/lib/models/registry.model.js.map +1 -0
  180. package/lib/models/rolemodel.model.d.ts +28 -0
  181. package/lib/models/rolemodel.model.d.ts.map +1 -0
  182. package/lib/models/{rolemodel.js → rolemodel.model.js} +23 -5
  183. package/lib/models/rolemodel.model.js.map +1 -0
  184. package/lib/models/simpleuser.model.d.ts +78 -0
  185. package/lib/models/simpleuser.model.d.ts.map +1 -0
  186. package/lib/models/simpleuser.model.js +123 -0
  187. package/lib/models/simpleuser.model.js.map +1 -0
  188. package/lib/models/types.d.ts +113 -0
  189. package/lib/models/types.d.ts.map +1 -0
  190. package/lib/models/types.js +2 -0
  191. package/lib/models/types.js.map +1 -0
  192. package/lib/models/user.model.d.ts +103 -0
  193. package/lib/models/user.model.d.ts.map +1 -0
  194. package/lib/models/user.model.js +125 -0
  195. package/lib/models/user.model.js.map +1 -0
  196. package/lib/queues/{memoryqueue.d.ts → memoryqueue.service.d.ts} +26 -13
  197. package/lib/queues/memoryqueue.service.d.ts.map +1 -0
  198. package/lib/queues/{memoryqueue.js → memoryqueue.service.js} +55 -31
  199. package/lib/queues/memoryqueue.service.js.map +1 -0
  200. package/lib/queues/pubsubservice.d.ts +8 -6
  201. package/lib/queues/pubsubservice.d.ts.map +1 -1
  202. package/lib/queues/pubsubservice.js +5 -4
  203. package/lib/queues/pubsubservice.js.map +1 -1
  204. package/lib/queues/queueservice.d.ts +9 -11
  205. package/lib/queues/queueservice.d.ts.map +1 -1
  206. package/lib/queues/queueservice.js +41 -13
  207. package/lib/queues/queueservice.js.map +1 -1
  208. package/lib/rest/hooks.d.ts +8 -0
  209. package/lib/rest/hooks.d.ts.map +1 -0
  210. package/lib/rest/hooks.js +10 -0
  211. package/lib/rest/hooks.js.map +1 -0
  212. package/lib/rest/irest.d.ts +212 -0
  213. package/lib/rest/irest.d.ts.map +1 -0
  214. package/lib/rest/irest.js +39 -0
  215. package/lib/rest/irest.js.map +1 -0
  216. package/lib/rest/originfilter.d.ts +38 -0
  217. package/lib/rest/originfilter.d.ts.map +1 -0
  218. package/lib/rest/originfilter.js +61 -0
  219. package/lib/rest/originfilter.js.map +1 -0
  220. package/lib/rest/restoperationstransport.service.d.ts +193 -0
  221. package/lib/rest/restoperationstransport.service.d.ts.map +1 -0
  222. package/lib/rest/restoperationstransport.service.js +780 -0
  223. package/lib/rest/restoperationstransport.service.js.map +1 -0
  224. package/lib/rest/router.service.d.ts +244 -0
  225. package/lib/rest/router.service.d.ts.map +1 -0
  226. package/lib/rest/router.service.js +843 -0
  227. package/lib/rest/router.service.js.map +1 -0
  228. package/lib/schemas/hooks.d.ts +48 -0
  229. package/lib/schemas/hooks.d.ts.map +1 -0
  230. package/lib/schemas/hooks.js +152 -0
  231. package/lib/schemas/hooks.js.map +1 -0
  232. package/lib/services/audit.model.d.ts +208 -0
  233. package/lib/services/audit.model.d.ts.map +1 -0
  234. package/lib/services/audit.model.js +431 -0
  235. package/lib/services/audit.model.js.map +1 -0
  236. package/lib/services/{authentication.d.ts → authentication.service.d.ts} +140 -59
  237. package/lib/services/authentication.service.d.ts.map +1 -0
  238. package/lib/services/authentication.service.js +932 -0
  239. package/lib/services/authentication.service.js.map +1 -0
  240. package/lib/services/binary.service.d.ts +808 -0
  241. package/lib/services/binary.service.d.ts.map +1 -0
  242. package/lib/services/binary.service.js +1365 -0
  243. package/lib/services/binary.service.js.map +1 -0
  244. package/lib/services/cloudbinary.d.ts +17 -12
  245. package/lib/services/cloudbinary.d.ts.map +1 -1
  246. package/lib/services/cloudbinary.js +23 -17
  247. package/lib/services/cloudbinary.js.map +1 -1
  248. package/lib/services/command.d.ts +118 -0
  249. package/lib/services/command.d.ts.map +1 -0
  250. package/lib/services/command.js +97 -0
  251. package/lib/services/command.js.map +1 -0
  252. package/lib/services/cron.service.d.ts +142 -0
  253. package/lib/services/cron.service.d.ts.map +1 -0
  254. package/lib/services/cron.service.js +291 -0
  255. package/lib/services/cron.service.js.map +1 -0
  256. package/lib/services/{cryptoservice.d.ts → cryptoservice.service.d.ts} +75 -141
  257. package/lib/services/cryptoservice.service.d.ts.map +1 -0
  258. package/lib/services/cryptoservice.service.js +527 -0
  259. package/lib/services/cryptoservice.service.js.map +1 -0
  260. package/lib/services/debugmailer.service.d.ts +49 -0
  261. package/lib/services/debugmailer.service.d.ts.map +1 -0
  262. package/lib/services/{debugmailer.js → debugmailer.service.js} +25 -10
  263. package/lib/services/debugmailer.service.js.map +1 -0
  264. package/lib/services/domainservice.service.d.ts +203 -0
  265. package/lib/services/domainservice.service.d.ts.map +1 -0
  266. package/lib/services/domainservice.service.js +600 -0
  267. package/lib/services/domainservice.service.js.map +1 -0
  268. package/lib/services/httpserver.service.d.ts +248 -0
  269. package/lib/services/httpserver.service.d.ts.map +1 -0
  270. package/lib/services/httpserver.service.js +673 -0
  271. package/lib/services/httpserver.service.js.map +1 -0
  272. package/lib/services/iauthentication.d.ts +9 -0
  273. package/lib/services/iauthentication.d.ts.map +1 -0
  274. package/lib/services/iauthentication.js +2 -0
  275. package/lib/services/iauthentication.js.map +1 -0
  276. package/lib/services/icryptoservice.d.ts +127 -0
  277. package/lib/services/icryptoservice.d.ts.map +1 -0
  278. package/lib/services/icryptoservice.js +68 -0
  279. package/lib/services/icryptoservice.js.map +1 -0
  280. package/lib/services/imailer.d.ts +17 -0
  281. package/lib/services/imailer.d.ts.map +1 -0
  282. package/lib/services/imailer.js +2 -0
  283. package/lib/services/imailer.js.map +1 -0
  284. package/lib/services/iservice.d.ts +104 -0
  285. package/lib/services/iservice.d.ts.map +1 -0
  286. package/lib/services/iservice.js +63 -0
  287. package/lib/services/iservice.js.map +1 -0
  288. package/lib/services/mailer.service.d.ts +220 -0
  289. package/lib/services/mailer.service.d.ts.map +1 -0
  290. package/lib/services/mailer.service.js +251 -0
  291. package/lib/services/mailer.service.js.map +1 -0
  292. package/lib/services/{notificationservice.d.ts → notificationservice.service.d.ts} +10 -11
  293. package/lib/services/notificationservice.service.d.ts.map +1 -0
  294. package/lib/services/{notificationservice.js → notificationservice.service.js} +24 -12
  295. package/lib/services/notificationservice.service.js.map +1 -0
  296. package/lib/services/oauth.d.ts +52 -28
  297. package/lib/services/oauth.d.ts.map +1 -1
  298. package/lib/services/oauth.js +365 -254
  299. package/lib/services/oauth.js.map +1 -1
  300. package/lib/services/operationstransport.d.ts +65 -0
  301. package/lib/services/operationstransport.d.ts.map +1 -0
  302. package/lib/services/operationstransport.js +103 -0
  303. package/lib/services/operationstransport.js.map +1 -0
  304. package/lib/services/{prometheus.d.ts → prometheus.service.d.ts} +13 -12
  305. package/lib/services/prometheus.service.d.ts.map +1 -0
  306. package/lib/services/prometheus.service.js +203 -0
  307. package/lib/services/prometheus.service.js.map +1 -0
  308. package/lib/services/{resource.d.ts → resource.service.d.ts} +34 -15
  309. package/lib/services/resource.service.d.ts.map +1 -0
  310. package/lib/services/resource.service.js +301 -0
  311. package/lib/services/resource.service.js.map +1 -0
  312. package/lib/services/service.d.ts +87 -188
  313. package/lib/services/service.d.ts.map +1 -1
  314. package/lib/services/service.js +407 -422
  315. package/lib/services/service.js.map +1 -1
  316. package/lib/services/servicecommands.d.ts +99 -0
  317. package/lib/services/servicecommands.d.ts.map +1 -0
  318. package/lib/services/servicecommands.js +165 -0
  319. package/lib/services/servicecommands.js.map +1 -0
  320. package/lib/services/serviceparameters.d.ts +33 -0
  321. package/lib/services/serviceparameters.d.ts.map +1 -0
  322. package/lib/services/serviceparameters.js +79 -0
  323. package/lib/services/serviceparameters.js.map +1 -0
  324. package/lib/{utils → session}/cookie.d.ts +32 -19
  325. package/lib/session/cookie.d.ts.map +1 -0
  326. package/lib/{utils → session}/cookie.js +76 -23
  327. package/lib/session/cookie.js.map +1 -0
  328. package/lib/session/manager.model.d.ts +71 -0
  329. package/lib/session/manager.model.d.ts.map +1 -0
  330. package/lib/session/manager.model.js +155 -0
  331. package/lib/session/manager.model.js.map +1 -0
  332. package/lib/session/session.d.ts +57 -0
  333. package/lib/session/session.d.ts.map +1 -0
  334. package/lib/session/session.js +126 -0
  335. package/lib/session/session.js.map +1 -0
  336. package/lib/stores/istore.d.ts +99 -0
  337. package/lib/stores/istore.d.ts.map +1 -0
  338. package/lib/stores/istore.js +26 -0
  339. package/lib/stores/istore.js.map +1 -0
  340. package/lib/stores/memory.service.d.ts +114 -0
  341. package/lib/stores/memory.service.d.ts.map +1 -0
  342. package/lib/stores/memory.service.js +343 -0
  343. package/lib/stores/memory.service.js.map +1 -0
  344. package/lib/stores/store.d.ts +126 -626
  345. package/lib/stores/store.d.ts.map +1 -1
  346. package/lib/stores/store.js +257 -1117
  347. package/lib/stores/store.js.map +1 -1
  348. package/lib/templates/templates.d.ts +39 -0
  349. package/lib/templates/templates.d.ts.map +1 -0
  350. package/lib/templates/templates.js +92 -0
  351. package/lib/templates/templates.js.map +1 -0
  352. package/lib/test/application.d.ts +174 -0
  353. package/lib/test/application.d.ts.map +1 -0
  354. package/lib/test/application.js +288 -0
  355. package/lib/test/application.js.map +1 -0
  356. package/lib/test/asyncstorage.d.ts +16 -0
  357. package/lib/test/asyncstorage.d.ts.map +1 -0
  358. package/lib/test/asyncstorage.js +32 -0
  359. package/lib/test/asyncstorage.js.map +1 -0
  360. package/lib/test/core.d.ts +63 -0
  361. package/lib/test/core.d.ts.map +1 -0
  362. package/lib/test/core.js +190 -0
  363. package/lib/test/core.js.map +1 -0
  364. package/lib/test/index.d.ts +7 -0
  365. package/lib/test/index.d.ts.map +1 -0
  366. package/lib/test/index.js +8 -0
  367. package/lib/test/index.js.map +1 -0
  368. package/lib/test/internal.d.ts +34 -0
  369. package/lib/test/internal.d.ts.map +1 -0
  370. package/lib/test/internal.js +156 -0
  371. package/lib/test/internal.js.map +1 -0
  372. package/lib/test/objects.d.ts +318 -0
  373. package/lib/test/objects.d.ts.map +1 -0
  374. package/lib/test/objects.js +443 -0
  375. package/lib/test/objects.js.map +1 -0
  376. package/lib/utils/abstractdeployer.d.ts +4 -2
  377. package/lib/utils/abstractdeployer.d.ts.map +1 -1
  378. package/lib/utils/abstractdeployer.js +3 -0
  379. package/lib/utils/abstractdeployer.js.map +1 -1
  380. package/package.json +85 -60
  381. package/test/cachedapp/webda.config.json +1 -5
  382. package/test/config-cached.json +1 -5
  383. package/test/config.json +0 -9
  384. package/test/my-cnf.json +9 -0
  385. package/webda.module.json +3463 -2482
  386. package/lib/application.d.ts +0 -888
  387. package/lib/application.d.ts.map +0 -1
  388. package/lib/application.js +0 -768
  389. package/lib/application.js.map +0 -1
  390. package/lib/application.spec.d.ts +0 -2
  391. package/lib/application.spec.d.ts.map +0 -1
  392. package/lib/application.spec.js +0 -248
  393. package/lib/application.spec.js.map +0 -1
  394. package/lib/core.d.ts +0 -743
  395. package/lib/core.d.ts.map +0 -1
  396. package/lib/core.js +0 -1334
  397. package/lib/core.js.map +0 -1
  398. package/lib/core.spec.d.ts +0 -2
  399. package/lib/core.spec.d.ts.map +0 -1
  400. package/lib/core.spec.js +0 -790
  401. package/lib/core.spec.js.map +0 -1
  402. package/lib/errors.d.ts +0 -64
  403. package/lib/errors.d.ts.map +0 -1
  404. package/lib/errors.js +0 -97
  405. package/lib/errors.js.map +0 -1
  406. package/lib/errors.spec.d.ts +0 -2
  407. package/lib/errors.spec.d.ts.map +0 -1
  408. package/lib/errors.spec.js +0 -33
  409. package/lib/errors.spec.js.map +0 -1
  410. package/lib/models/aclmodel.spec.d.ts +0 -2
  411. package/lib/models/aclmodel.spec.d.ts.map +0 -1
  412. package/lib/models/aclmodel.spec.js +0 -187
  413. package/lib/models/aclmodel.spec.js.map +0 -1
  414. package/lib/models/coremodel.d.ts +0 -896
  415. package/lib/models/coremodel.d.ts.map +0 -1
  416. package/lib/models/coremodel.js +0 -1214
  417. package/lib/models/coremodel.js.map +0 -1
  418. package/lib/models/coremodel.spec.d.ts +0 -2
  419. package/lib/models/coremodel.spec.d.ts.map +0 -1
  420. package/lib/models/coremodel.spec.js +0 -464
  421. package/lib/models/coremodel.spec.js.map +0 -1
  422. package/lib/models/ident.d.ts +0 -68
  423. package/lib/models/ident.d.ts.map +0 -1
  424. package/lib/models/ident.js +0 -26
  425. package/lib/models/ident.js.map +0 -1
  426. package/lib/models/ident.spec.d.ts +0 -2
  427. package/lib/models/ident.spec.d.ts.map +0 -1
  428. package/lib/models/ident.spec.js +0 -24
  429. package/lib/models/ident.spec.js.map +0 -1
  430. package/lib/models/ownermodel.d.ts +0 -51
  431. package/lib/models/ownermodel.d.ts.map +0 -1
  432. package/lib/models/ownermodel.js +0 -65
  433. package/lib/models/ownermodel.js.map +0 -1
  434. package/lib/models/ownermodel.spec.d.ts +0 -2
  435. package/lib/models/ownermodel.spec.d.ts.map +0 -1
  436. package/lib/models/ownermodel.spec.js +0 -215
  437. package/lib/models/ownermodel.spec.js.map +0 -1
  438. package/lib/models/relations.d.ts +0 -182
  439. package/lib/models/relations.d.ts.map +0 -1
  440. package/lib/models/relations.js +0 -157
  441. package/lib/models/relations.js.map +0 -1
  442. package/lib/models/relations.spec.d.ts +0 -14
  443. package/lib/models/relations.spec.d.ts.map +0 -1
  444. package/lib/models/relations.spec.js +0 -217
  445. package/lib/models/relations.spec.js.map +0 -1
  446. package/lib/models/rolemodel.d.ts +0 -11
  447. package/lib/models/rolemodel.d.ts.map +0 -1
  448. package/lib/models/rolemodel.js.map +0 -1
  449. package/lib/models/rolemodel.spec.d.ts +0 -2
  450. package/lib/models/rolemodel.spec.d.ts.map +0 -1
  451. package/lib/models/rolemodel.spec.js +0 -90
  452. package/lib/models/rolemodel.spec.js.map +0 -1
  453. package/lib/models/simpleuser.d.ts +0 -47
  454. package/lib/models/simpleuser.d.ts.map +0 -1
  455. package/lib/models/simpleuser.js +0 -84
  456. package/lib/models/simpleuser.js.map +0 -1
  457. package/lib/models/test.d.ts +0 -11
  458. package/lib/models/test.d.ts.map +0 -1
  459. package/lib/models/test.js +0 -7
  460. package/lib/models/test.js.map +0 -1
  461. package/lib/models/user.d.ts +0 -67
  462. package/lib/models/user.d.ts.map +0 -1
  463. package/lib/models/user.js +0 -86
  464. package/lib/models/user.js.map +0 -1
  465. package/lib/models/user.spec.d.ts +0 -2
  466. package/lib/models/user.spec.d.ts.map +0 -1
  467. package/lib/models/user.spec.js +0 -89
  468. package/lib/models/user.spec.js.map +0 -1
  469. package/lib/queues/filequeue.d.ts +0 -59
  470. package/lib/queues/filequeue.d.ts.map +0 -1
  471. package/lib/queues/filequeue.js +0 -131
  472. package/lib/queues/filequeue.js.map +0 -1
  473. package/lib/queues/filequeue.spec.d.ts +0 -2
  474. package/lib/queues/filequeue.spec.d.ts.map +0 -1
  475. package/lib/queues/filequeue.spec.js +0 -84
  476. package/lib/queues/filequeue.spec.js.map +0 -1
  477. package/lib/queues/memoryqueue.d.ts.map +0 -1
  478. package/lib/queues/memoryqueue.js.map +0 -1
  479. package/lib/queues/memoryqueue.spec.d.ts +0 -2
  480. package/lib/queues/memoryqueue.spec.d.ts.map +0 -1
  481. package/lib/queues/memoryqueue.spec.js +0 -203
  482. package/lib/queues/memoryqueue.spec.js.map +0 -1
  483. package/lib/queues/queue.spec.d.ts +0 -6
  484. package/lib/queues/queue.spec.d.ts.map +0 -1
  485. package/lib/queues/queue.spec.js +0 -55
  486. package/lib/queues/queue.spec.js.map +0 -1
  487. package/lib/rest/restdomainservice.d.ts +0 -63
  488. package/lib/rest/restdomainservice.d.ts.map +0 -1
  489. package/lib/rest/restdomainservice.js +0 -687
  490. package/lib/rest/restdomainservice.js.map +0 -1
  491. package/lib/rest/restdomainservice.spec.d.ts +0 -2
  492. package/lib/rest/restdomainservice.spec.d.ts.map +0 -1
  493. package/lib/rest/restdomainservice.spec.js +0 -124
  494. package/lib/rest/restdomainservice.spec.js.map +0 -1
  495. package/lib/rest/router.d.ts +0 -174
  496. package/lib/rest/router.d.ts.map +0 -1
  497. package/lib/rest/router.js +0 -429
  498. package/lib/rest/router.js.map +0 -1
  499. package/lib/rest/router.spec.d.ts +0 -2
  500. package/lib/rest/router.spec.d.ts.map +0 -1
  501. package/lib/rest/router.spec.js +0 -255
  502. package/lib/rest/router.spec.js.map +0 -1
  503. package/lib/services/asyncevents.d.ts +0 -152
  504. package/lib/services/asyncevents.d.ts.map +0 -1
  505. package/lib/services/asyncevents.js +0 -217
  506. package/lib/services/asyncevents.js.map +0 -1
  507. package/lib/services/asyncevents.spec.d.ts +0 -2
  508. package/lib/services/asyncevents.spec.d.ts.map +0 -1
  509. package/lib/services/asyncevents.spec.js +0 -118
  510. package/lib/services/asyncevents.spec.js.map +0 -1
  511. package/lib/services/authentication.d.ts.map +0 -1
  512. package/lib/services/authentication.js +0 -773
  513. package/lib/services/authentication.js.map +0 -1
  514. package/lib/services/authentication.spec.d.ts +0 -2
  515. package/lib/services/authentication.spec.d.ts.map +0 -1
  516. package/lib/services/authentication.spec.js +0 -458
  517. package/lib/services/authentication.spec.js.map +0 -1
  518. package/lib/services/binary.d.ts +0 -477
  519. package/lib/services/binary.d.ts.map +0 -1
  520. package/lib/services/binary.js +0 -617
  521. package/lib/services/binary.js.map +0 -1
  522. package/lib/services/binary.spec.d.ts +0 -41
  523. package/lib/services/binary.spec.d.ts.map +0 -1
  524. package/lib/services/binary.spec.js +0 -151
  525. package/lib/services/binary.spec.js.map +0 -1
  526. package/lib/services/cloudbinary.spec.d.ts +0 -6
  527. package/lib/services/cloudbinary.spec.d.ts.map +0 -1
  528. package/lib/services/cloudbinary.spec.js +0 -66
  529. package/lib/services/cloudbinary.spec.js.map +0 -1
  530. package/lib/services/configuration.d.ts.map +0 -1
  531. package/lib/services/configuration.js +0 -193
  532. package/lib/services/configuration.js.map +0 -1
  533. package/lib/services/configuration.spec.d.ts +0 -2
  534. package/lib/services/configuration.spec.d.ts.map +0 -1
  535. package/lib/services/configuration.spec.js +0 -130
  536. package/lib/services/configuration.spec.js.map +0 -1
  537. package/lib/services/cron.d.ts +0 -74
  538. package/lib/services/cron.d.ts.map +0 -1
  539. package/lib/services/cron.js +0 -141
  540. package/lib/services/cron.js.map +0 -1
  541. package/lib/services/cron.spec.d.ts +0 -2
  542. package/lib/services/cron.spec.d.ts.map +0 -1
  543. package/lib/services/cron.spec.js +0 -76
  544. package/lib/services/cron.spec.js.map +0 -1
  545. package/lib/services/cryptoservice.d.ts.map +0 -1
  546. package/lib/services/cryptoservice.js +0 -433
  547. package/lib/services/cryptoservice.js.map +0 -1
  548. package/lib/services/cryptoservice.spec.d.ts +0 -2
  549. package/lib/services/cryptoservice.spec.d.ts.map +0 -1
  550. package/lib/services/cryptoservice.spec.js +0 -177
  551. package/lib/services/cryptoservice.spec.js.map +0 -1
  552. package/lib/services/debugmailer.d.ts +0 -36
  553. package/lib/services/debugmailer.d.ts.map +0 -1
  554. package/lib/services/debugmailer.js.map +0 -1
  555. package/lib/services/debugmailer.spec.d.ts +0 -2
  556. package/lib/services/debugmailer.spec.d.ts.map +0 -1
  557. package/lib/services/debugmailer.spec.js +0 -32
  558. package/lib/services/debugmailer.spec.js.map +0 -1
  559. package/lib/services/domainservice.d.ts +0 -272
  560. package/lib/services/domainservice.d.ts.map +0 -1
  561. package/lib/services/domainservice.js +0 -651
  562. package/lib/services/domainservice.js.map +0 -1
  563. package/lib/services/domainservice.spec.d.ts +0 -2
  564. package/lib/services/domainservice.spec.d.ts.map +0 -1
  565. package/lib/services/domainservice.spec.js +0 -592
  566. package/lib/services/domainservice.spec.js.map +0 -1
  567. package/lib/services/filebinary.d.ts +0 -136
  568. package/lib/services/filebinary.d.ts.map +0 -1
  569. package/lib/services/filebinary.js +0 -373
  570. package/lib/services/filebinary.js.map +0 -1
  571. package/lib/services/filebinary.spec.d.ts +0 -25
  572. package/lib/services/filebinary.spec.d.ts.map +0 -1
  573. package/lib/services/filebinary.spec.js +0 -428
  574. package/lib/services/filebinary.spec.js.map +0 -1
  575. package/lib/services/fileconfiguration.d.ts +0 -23
  576. package/lib/services/fileconfiguration.d.ts.map +0 -1
  577. package/lib/services/fileconfiguration.js +0 -48
  578. package/lib/services/fileconfiguration.js.map +0 -1
  579. package/lib/services/fileconfiguration.spec.d.ts +0 -2
  580. package/lib/services/fileconfiguration.spec.d.ts.map +0 -1
  581. package/lib/services/fileconfiguration.spec.js +0 -215
  582. package/lib/services/fileconfiguration.spec.js.map +0 -1
  583. package/lib/services/invitationservice.d.ts +0 -223
  584. package/lib/services/invitationservice.d.ts.map +0 -1
  585. package/lib/services/invitationservice.js +0 -529
  586. package/lib/services/invitationservice.js.map +0 -1
  587. package/lib/services/invitationservice.spec.d.ts +0 -2
  588. package/lib/services/invitationservice.spec.d.ts.map +0 -1
  589. package/lib/services/invitationservice.spec.js +0 -567
  590. package/lib/services/invitationservice.spec.js.map +0 -1
  591. package/lib/services/kubernetesconfiguration.d.ts +0 -27
  592. package/lib/services/kubernetesconfiguration.d.ts.map +0 -1
  593. package/lib/services/kubernetesconfiguration.js +0 -52
  594. package/lib/services/kubernetesconfiguration.js.map +0 -1
  595. package/lib/services/kubernetesconfiguration.spec.d.ts +0 -2
  596. package/lib/services/kubernetesconfiguration.spec.d.ts.map +0 -1
  597. package/lib/services/kubernetesconfiguration.spec.js +0 -206
  598. package/lib/services/kubernetesconfiguration.spec.js.map +0 -1
  599. package/lib/services/mailer.d.ts +0 -166
  600. package/lib/services/mailer.d.ts.map +0 -1
  601. package/lib/services/mailer.js +0 -176
  602. package/lib/services/mailer.js.map +0 -1
  603. package/lib/services/mailer.spec.d.ts +0 -2
  604. package/lib/services/mailer.spec.d.ts.map +0 -1
  605. package/lib/services/mailer.spec.js +0 -158
  606. package/lib/services/mailer.spec.js.map +0 -1
  607. package/lib/services/notificationservice.d.ts.map +0 -1
  608. package/lib/services/notificationservice.js.map +0 -1
  609. package/lib/services/notificationservice.spec.d.ts +0 -2
  610. package/lib/services/notificationservice.spec.d.ts.map +0 -1
  611. package/lib/services/notificationservice.spec.js +0 -83
  612. package/lib/services/notificationservice.spec.js.map +0 -1
  613. package/lib/services/oauth.spec.d.ts +0 -2
  614. package/lib/services/oauth.spec.d.ts.map +0 -1
  615. package/lib/services/oauth.spec.js +0 -208
  616. package/lib/services/oauth.spec.js.map +0 -1
  617. package/lib/services/prometheus.d.ts.map +0 -1
  618. package/lib/services/prometheus.js +0 -160
  619. package/lib/services/prometheus.js.map +0 -1
  620. package/lib/services/prometheus.spec.d.ts +0 -2
  621. package/lib/services/prometheus.spec.d.ts.map +0 -1
  622. package/lib/services/prometheus.spec.js +0 -76
  623. package/lib/services/prometheus.spec.js.map +0 -1
  624. package/lib/services/resource.d.ts.map +0 -1
  625. package/lib/services/resource.js +0 -170
  626. package/lib/services/resource.js.map +0 -1
  627. package/lib/services/resource.spec.d.ts +0 -2
  628. package/lib/services/resource.spec.d.ts.map +0 -1
  629. package/lib/services/resource.spec.js +0 -140
  630. package/lib/services/resource.spec.js.map +0 -1
  631. package/lib/services/service.spec.d.ts +0 -2
  632. package/lib/services/service.spec.d.ts.map +0 -1
  633. package/lib/services/service.spec.js +0 -286
  634. package/lib/services/service.spec.js.map +0 -1
  635. package/lib/stores/aggregator.d.ts +0 -48
  636. package/lib/stores/aggregator.d.ts.map +0 -1
  637. package/lib/stores/aggregator.js +0 -80
  638. package/lib/stores/aggregator.js.map +0 -1
  639. package/lib/stores/file.d.ts +0 -108
  640. package/lib/stores/file.d.ts.map +0 -1
  641. package/lib/stores/file.js +0 -188
  642. package/lib/stores/file.js.map +0 -1
  643. package/lib/stores/file.spec.d.ts +0 -13
  644. package/lib/stores/file.spec.d.ts.map +0 -1
  645. package/lib/stores/file.spec.js +0 -138
  646. package/lib/stores/file.spec.js.map +0 -1
  647. package/lib/stores/mapper.d.ts +0 -150
  648. package/lib/stores/mapper.d.ts.map +0 -1
  649. package/lib/stores/mapper.js +0 -293
  650. package/lib/stores/mapper.js.map +0 -1
  651. package/lib/stores/mapper.spec.d.ts +0 -2
  652. package/lib/stores/mapper.spec.d.ts.map +0 -1
  653. package/lib/stores/mapper.spec.js +0 -167
  654. package/lib/stores/mapper.spec.js.map +0 -1
  655. package/lib/stores/memory.d.ts +0 -152
  656. package/lib/stores/memory.d.ts.map +0 -1
  657. package/lib/stores/memory.js +0 -371
  658. package/lib/stores/memory.js.map +0 -1
  659. package/lib/stores/memory.spec.d.ts +0 -14
  660. package/lib/stores/memory.spec.d.ts.map +0 -1
  661. package/lib/stores/memory.spec.js +0 -263
  662. package/lib/stores/memory.spec.js.map +0 -1
  663. package/lib/stores/modelmapper.d.ts +0 -62
  664. package/lib/stores/modelmapper.d.ts.map +0 -1
  665. package/lib/stores/modelmapper.js +0 -197
  666. package/lib/stores/modelmapper.js.map +0 -1
  667. package/lib/stores/store.spec.d.ts +0 -57
  668. package/lib/stores/store.spec.d.ts.map +0 -1
  669. package/lib/stores/store.spec.js +0 -737
  670. package/lib/stores/store.spec.js.map +0 -1
  671. package/lib/test.d.ts +0 -265
  672. package/lib/test.d.ts.map +0 -1
  673. package/lib/test.js +0 -622
  674. package/lib/test.js.map +0 -1
  675. package/lib/unpackedapplication.d.ts.map +0 -1
  676. package/lib/unpackedapplication.js +0 -350
  677. package/lib/unpackedapplication.js.map +0 -1
  678. package/lib/utils/abstractdeployer.spec.d.ts +0 -2
  679. package/lib/utils/abstractdeployer.spec.d.ts.map +0 -1
  680. package/lib/utils/abstractdeployer.spec.js +0 -21
  681. package/lib/utils/abstractdeployer.spec.js.map +0 -1
  682. package/lib/utils/case.d.ts +0 -8
  683. package/lib/utils/case.d.ts.map +0 -1
  684. package/lib/utils/case.js +0 -43
  685. package/lib/utils/case.js.map +0 -1
  686. package/lib/utils/case.spec.d.ts +0 -2
  687. package/lib/utils/case.spec.d.ts.map +0 -1
  688. package/lib/utils/case.spec.js +0 -50
  689. package/lib/utils/case.spec.js.map +0 -1
  690. package/lib/utils/context.d.ts +0 -482
  691. package/lib/utils/context.d.ts.map +0 -1
  692. package/lib/utils/context.js +0 -739
  693. package/lib/utils/context.js.map +0 -1
  694. package/lib/utils/context.spec.d.ts +0 -10
  695. package/lib/utils/context.spec.d.ts.map +0 -1
  696. package/lib/utils/context.spec.js +0 -383
  697. package/lib/utils/context.spec.js.map +0 -1
  698. package/lib/utils/cookie.d.ts.map +0 -1
  699. package/lib/utils/cookie.js.map +0 -1
  700. package/lib/utils/cookie.spec.d.ts +0 -2
  701. package/lib/utils/cookie.spec.d.ts.map +0 -1
  702. package/lib/utils/cookie.spec.js +0 -88
  703. package/lib/utils/cookie.spec.js.map +0 -1
  704. package/lib/utils/esm.d.ts +0 -14
  705. package/lib/utils/esm.d.ts.map +0 -1
  706. package/lib/utils/esm.js +0 -19
  707. package/lib/utils/esm.js.map +0 -1
  708. package/lib/utils/httpcontext.d.ts.map +0 -1
  709. package/lib/utils/httpcontext.js.map +0 -1
  710. package/lib/utils/httpcontext.spec.d.ts +0 -5
  711. package/lib/utils/httpcontext.spec.d.ts.map +0 -1
  712. package/lib/utils/httpcontext.spec.js +0 -77
  713. package/lib/utils/httpcontext.spec.js.map +0 -1
  714. package/lib/utils/logger.d.ts +0 -92
  715. package/lib/utils/logger.d.ts.map +0 -1
  716. package/lib/utils/logger.js +0 -121
  717. package/lib/utils/logger.js.map +0 -1
  718. package/lib/utils/logger.spec.d.ts +0 -2
  719. package/lib/utils/logger.spec.d.ts.map +0 -1
  720. package/lib/utils/logger.spec.js +0 -48
  721. package/lib/utils/logger.spec.js.map +0 -1
  722. package/lib/utils/serializers.d.ts +0 -162
  723. package/lib/utils/serializers.d.ts.map +0 -1
  724. package/lib/utils/serializers.js +0 -420
  725. package/lib/utils/serializers.js.map +0 -1
  726. package/lib/utils/serializers.spec.d.ts +0 -2
  727. package/lib/utils/serializers.spec.d.ts.map +0 -1
  728. package/lib/utils/serializers.spec.js +0 -311
  729. package/lib/utils/serializers.spec.js.map +0 -1
  730. package/lib/utils/session.d.ts +0 -123
  731. package/lib/utils/session.d.ts.map +0 -1
  732. package/lib/utils/session.js +0 -156
  733. package/lib/utils/session.js.map +0 -1
  734. package/lib/utils/session.spec.d.ts +0 -2
  735. package/lib/utils/session.spec.d.ts.map +0 -1
  736. package/lib/utils/session.spec.js +0 -81
  737. package/lib/utils/session.spec.js.map +0 -1
  738. package/lib/utils/throttler.d.ts +0 -99
  739. package/lib/utils/throttler.d.ts.map +0 -1
  740. package/lib/utils/throttler.js +0 -160
  741. package/lib/utils/throttler.js.map +0 -1
  742. package/lib/utils/throttler.spec.d.ts +0 -2
  743. package/lib/utils/throttler.spec.d.ts.map +0 -1
  744. package/lib/utils/throttler.spec.js +0 -53
  745. package/lib/utils/throttler.spec.js.map +0 -1
  746. package/lib/utils/waiter.d.ts +0 -94
  747. package/lib/utils/waiter.d.ts.map +0 -1
  748. package/lib/utils/waiter.js +0 -148
  749. package/lib/utils/waiter.js.map +0 -1
  750. package/lib/utils/waiter.spec.d.ts +0 -2
  751. package/lib/utils/waiter.spec.d.ts.map +0 -1
  752. package/lib/utils/waiter.spec.js +0 -98
  753. package/lib/utils/waiter.spec.js.map +0 -1
  754. package/test/jsonutils/mdocs.yaml +0 -56
  755. package/test/jsonutils/test.json +0 -3
  756. package/test/jsonutils/test.yml +0 -5
@@ -0,0 +1,559 @@
1
+ import { QueryValidator } from "@webda/ql";
2
+ import * as WebdaError from "../errors/errors.js";
3
+ import { validateSchema, ValidationError } from "../schemas/hooks.js";
4
+ import { useInstanceStorage } from "./instancestorage.js";
5
+ import { useApplication, useModel } from "../application/hooks.js";
6
+ import { useDynamicService, useModelMetadata, useService } from "./hooks.js";
7
+ import { emitCoreEvent } from "../events/events.js";
8
+ import { isGeneratorFunction } from "node:util/types";
9
+ import { runWithContext, useContext } from "../contexts/execution.js";
10
+ import { useLog } from "@webda/workout";
11
+ /**
12
+ * Check if an operation can be executed with the current context
13
+ * Not checking the input use `checkOperation` instead to check everything
14
+ * @param context - the execution context
15
+ * @param operationId - the operation identifier
16
+ * @throws OperationError if operation is unknown
17
+ * @param operation - the operation definition
18
+ * @returns true if operation can be executed
19
+ */
20
+ function checkOperationPermission(context, operationId, operation) {
21
+ if (!operation) {
22
+ throw new WebdaError.NotFound(`${operationId} Unknown`);
23
+ }
24
+ if (operation.permission) {
25
+ operation.permissionQuery ??= new QueryValidator(operation.permission);
26
+ return operation.permissionQuery.eval(context.getSession());
27
+ }
28
+ return true;
29
+ }
30
+ /**
31
+ * Check whether the context's session is allowed to call an operation
32
+ *
33
+ * Unlike {@link checkOperation}, this never throws: unknown operations and
34
+ * permission queries that cannot be evaluated return false.
35
+ *
36
+ * @param context - the execution context holding the session
37
+ * @param operationId - the operation identifier
38
+ * @returns true if the operation exists and its permission (if any) accepts the session
39
+ */
40
+ export function canCallOperation(context, operationId) {
41
+ const operation = useInstanceStorage().operations[operationId];
42
+ if (!operation) {
43
+ return false;
44
+ }
45
+ try {
46
+ return checkOperationPermission(context, operationId, operation);
47
+ }
48
+ catch {
49
+ return false;
50
+ }
51
+ }
52
+ /**
53
+ * Serialize a primary key to the canonical string identifying an operation subject.
54
+ *
55
+ * A single-field key is its string value; a composite key is the JSON array of its
56
+ * field values in `pkFields` order, so plain input objects and `getPrimaryKey()`
57
+ * results (including relation links) produce the same string.
58
+ * @param pkFields - the model primary key fields
59
+ * @param key - a scalar key, or an object holding the key fields
60
+ * @returns the canonical key, or undefined when a field is missing
61
+ */
62
+ export function serializeSubjectKey(pkFields, key) {
63
+ if (key === undefined || key === null) {
64
+ return undefined;
65
+ }
66
+ if (pkFields.length <= 1) {
67
+ const value = typeof key === "object" ? key[pkFields[0] ?? "uuid"] : key;
68
+ return value === undefined || value === null ? undefined : String(value);
69
+ }
70
+ if (typeof key !== "object") {
71
+ return undefined;
72
+ }
73
+ const values = pkFields.map(field => key[field]);
74
+ if (values.some(value => value === undefined || value === null)) {
75
+ return undefined;
76
+ }
77
+ return JSON.stringify(values.map(value => String(value)));
78
+ }
79
+ /**
80
+ * Turn a subject key sent by a client into a key usable with `Model.ref()`.
81
+ *
82
+ * Accepts the scalar value, an object of key fields, or for composite keys the
83
+ * canonical JSON array produced by `serializeSubjectKey`.
84
+ * @param pkFields - the model primary key fields
85
+ * @param key - the key as received
86
+ * @returns the key, or undefined when it does not match `pkFields`
87
+ */
88
+ export function parseSubjectKey(pkFields, key) {
89
+ if (key === undefined || key === null || key === "") {
90
+ return undefined;
91
+ }
92
+ if (pkFields.length <= 1) {
93
+ const value = typeof key === "object" ? key[pkFields[0] ?? "uuid"] : key;
94
+ return value === undefined || value === null || value === "" ? undefined : String(value);
95
+ }
96
+ let source = key;
97
+ if (typeof key === "string") {
98
+ try {
99
+ source = JSON.parse(key);
100
+ }
101
+ catch {
102
+ return undefined;
103
+ }
104
+ }
105
+ if (Array.isArray(source)) {
106
+ if (source.length !== pkFields.length) {
107
+ return undefined;
108
+ }
109
+ source = Object.fromEntries(pkFields.map((field, i) => [field, source[i]]));
110
+ }
111
+ if (typeof source !== "object" || source === null) {
112
+ return undefined;
113
+ }
114
+ if (pkFields.some(field => source[field] === undefined || source[field] === null)) {
115
+ return undefined;
116
+ }
117
+ return Object.fromEntries(pkFields.map(field => [field, String(source[field])]));
118
+ }
119
+ /**
120
+ * Context extension holding the subject an operation declared with `setOperationSubject`
121
+ */
122
+ const DECLARED_SUBJECT = "operationSubject";
123
+ /**
124
+ * Declare the object the current operation acts on, when the framework cannot
125
+ * derive it: a service operation such as `Publisher.PublishPost(postId)`.
126
+ * Listeners such as the audit log record it like a derived subject, and it
127
+ * takes precedence over one. Call it from the operation (or anything it calls);
128
+ * outside an operation it does nothing.
129
+ *
130
+ * @param subject - a model instance, or `{ model, key }` with a model class or
131
+ * identifier and its primary key (scalar, object of key fields, or canonical string)
132
+ * @throws Error if the model is unknown or the key does not match its primary key
133
+ */
134
+ export function setOperationSubject(subject) {
135
+ const context = useContext();
136
+ let operation;
137
+ try {
138
+ operation = context?.getExtension?.("operation");
139
+ }
140
+ catch {
141
+ // The global context has no extensions
142
+ }
143
+ if (!operation) {
144
+ return;
145
+ }
146
+ const instance = typeof subject.getPrimaryKey === "function" ? subject : undefined;
147
+ const modelRef = instance ? instance.constructor : subject.model;
148
+ const model = typeof modelRef === "string" ? useModel(modelRef) : modelRef;
149
+ const modelId = useApplication().getModelId(model);
150
+ const pkFields = useModelMetadata(model)?.PrimaryKey ?? ["uuid"];
151
+ const rawKey = instance ? instance.getPrimaryKey() : subject.key;
152
+ const key = serializeSubjectKey(pkFields, parseSubjectKey(pkFields, rawKey));
153
+ if (!modelId || key === undefined) {
154
+ throw new Error(`Invalid operation subject ${modelId ?? String(modelRef)}: ${JSON.stringify(rawKey)}`);
155
+ }
156
+ context.setExtension(DECLARED_SUBJECT, { model: modelId, key });
157
+ }
158
+ /**
159
+ * Find the object an operation targets
160
+ *
161
+ * - model instance operation: the model and the key it was called with
162
+ * - operation with `context.model` (DomainService CRUD, behaviors): the key fields from
163
+ * the resolved input or the request parameters, or for `Create` the created object
164
+ * - queries, static model operations and plain service operations: none
165
+ * @param context - the operation context
166
+ * @param operation - the operation definition
167
+ * @param args - the arguments the operation was called with
168
+ * @param result - the operation result, when it succeeded
169
+ * @returns the subject, or undefined when the operation has no single target
170
+ */
171
+ export function resolveOperationSubject(context, operation, args, result) {
172
+ const declared = context.getExtension?.(DECLARED_SUBJECT);
173
+ if (declared) {
174
+ return declared;
175
+ }
176
+ const instanceOperation = operation.model !== undefined;
177
+ if (instanceOperation && operation.static !== false) {
178
+ return undefined;
179
+ }
180
+ const modelRef = instanceOperation ? operation.model : operation.context?.model;
181
+ if (!modelRef) {
182
+ return undefined;
183
+ }
184
+ const model = typeof modelRef === "string" ? useModel(modelRef) : modelRef;
185
+ const modelId = useApplication().getModelId(model);
186
+ if (!modelId) {
187
+ return undefined;
188
+ }
189
+ const pkFields = operation.context?.pkFields ?? useModelMetadata(model)?.PrimaryKey ?? ["uuid"];
190
+ let key;
191
+ if (instanceOperation) {
192
+ key = serializeSubjectKey(pkFields, args[0]);
193
+ }
194
+ else if (result instanceof model && typeof result.getPrimaryKey === "function") {
195
+ // Create: the saved object holds the real key (generated, or different from the input)
196
+ key = serializeSubjectKey(pkFields, result.getPrimaryKey());
197
+ }
198
+ if (key === undefined && !instanceOperation) {
199
+ const input = context.getExtension("operationResolvedInput") ?? context.getParameters() ?? {};
200
+ // Behavior operations (Post.MainImage.Attach) route the key as `{uuid}` whatever the
201
+ // model's real primary key field is, and register no pkFields
202
+ key = serializeSubjectKey(pkFields, pkFields.length === 1 ? (input[pkFields[0]] ?? input.uuid) : input);
203
+ }
204
+ return key === undefined ? undefined : { model: modelId, key };
205
+ }
206
+ /**
207
+ * Resolve the subject of a running operation without ever failing the operation
208
+ * @param context - the operation context
209
+ * @param operationId - the operation identifier
210
+ * @param args - the arguments the operation was called with
211
+ * @param result - the operation result, when it succeeded
212
+ * @returns the subject, or undefined
213
+ */
214
+ function subjectOf(context, operationId, args, result) {
215
+ const operation = useInstanceStorage().operations[operationId];
216
+ if (!operation) {
217
+ return undefined;
218
+ }
219
+ try {
220
+ return resolveOperationSubject(context, operation, args, result);
221
+ }
222
+ catch {
223
+ return undefined;
224
+ }
225
+ }
226
+ /**
227
+ * Coerce string-shaped path/query params to the primitive type their schema
228
+ * declares. URL slots arrive as strings even when the operation method
229
+ * expects a number/boolean (e.g. `setMetadata(index: number, ...)` mounted
230
+ * at `{index}/{hash}` — `index` is the literal `"0"` until we coerce).
231
+ *
232
+ * We mutate `merged` in place (caller forwards the same object to
233
+ * `resolveArguments`). We do NOT use AJV's `coerceTypes` flag because that
234
+ * setting on the singleton AJV instance flips a global mode and silently
235
+ * widens type validation across every other call site (e.g. coercing
236
+ * `123` → `"123"` to satisfy a `string` schema), which is the wrong default
237
+ * for model validation.
238
+ * @param schema - operation input schema with `properties` describing the
239
+ * expected primitive types
240
+ * @param merged - merged params + body object to coerce in place
241
+ */
242
+ function coerceMergedToSchema(schema, merged) {
243
+ if (!schema?.properties)
244
+ return;
245
+ for (const [name, propSchema] of Object.entries(schema.properties)) {
246
+ const value = merged[name];
247
+ if (typeof value !== "string")
248
+ continue;
249
+ const target = propSchema?.type;
250
+ if (target === "number" || target === "integer") {
251
+ const n = Number(value);
252
+ if (!Number.isNaN(n))
253
+ merged[name] = n;
254
+ }
255
+ else if (target === "boolean") {
256
+ if (value === "true")
257
+ merged[name] = true;
258
+ else if (value === "false")
259
+ merged[name] = false;
260
+ }
261
+ }
262
+ }
263
+ /**
264
+ * Check if an operation can be executed with the current context.
265
+ * @param context - the execution context
266
+ * @param operationId - the operation identifier
267
+ */
268
+ async function checkOperation(context, operationId) {
269
+ const operations = useInstanceStorage().operations;
270
+ if (!checkOperationPermission(context, operationId, operations[operationId])) {
271
+ throw new WebdaError.Forbidden(`${operationId} PermissionDenied`);
272
+ }
273
+ try {
274
+ if (operations[operationId].input && operations[operationId].input !== "void") {
275
+ // Validate the merged (path params + request body) against the input schema.
276
+ // Path params (e.g., {uuid}, {hash}) are provided via context.getParameters()
277
+ // and must be merged with the body before validation because schemas like
278
+ // uuidRequest and binaryHashRequest declare them as required properties.
279
+ const params = context.getParameters() || {};
280
+ let body;
281
+ try {
282
+ body = await context.getInput();
283
+ }
284
+ catch {
285
+ // No body (e.g., GET request) — skip validation
286
+ }
287
+ // Merge path params with body (body overrides params for same keys)
288
+ const merged = { ...params, ...(typeof body === "object" && body !== null ? body : {}) };
289
+ // Coerce string path params (e.g. `"0"`) to the primitive type the
290
+ // schema declares before validation runs, so AJV doesn't reject
291
+ // `index: "0"` against `{ type: "number" }`. Mutates `merged` in
292
+ // place so `resolveArguments` sees the typed value too.
293
+ const app = useApplication();
294
+ const inputSchema = app.getSchema(operations[operationId].input);
295
+ coerceMergedToSchema(inputSchema, merged);
296
+ validateSchema(operations[operationId].input, merged);
297
+ context.setExtension("operationResolvedInput", merged);
298
+ }
299
+ }
300
+ catch (err) {
301
+ if (err instanceof ValidationError) {
302
+ // Include the failing attribute path (AJV `instancePath`) in the human
303
+ // message so the client can tell *which* field is invalid; attach the
304
+ // raw `errors[]` as structured `details` so consumers can map errors
305
+ // to fields without parsing the string.
306
+ const summary = err.errors
307
+ .map(e => {
308
+ const path = e.instancePath || (e.params && e.params.missingProperty
309
+ ? `/${e.params.missingProperty}`
310
+ : "/");
311
+ return `${path} ${e.message}`;
312
+ })
313
+ .join("; ");
314
+ throw new WebdaError.BadRequest(`${operationId} InvalidInput: ${summary}`, {
315
+ errors: err.errors
316
+ });
317
+ }
318
+ throw err;
319
+ }
320
+ }
321
+ /**
322
+ * Resolve method arguments from the OperationContext using the operation's input schema metadata.
323
+ *
324
+ * The REST transport merges path/query params into the context so that `context.getParameters()`
325
+ * contains URL-derived values (e.g., `{uuid}`) while `context.getInput()` contains the request
326
+ * body. This function merges both sources (body overrides params) and extracts arguments based
327
+ * on the `input` schema property names and order.
328
+ *
329
+ * @param context - the execution context
330
+ * @param operation - the operation definition
331
+ * @returns an array of resolved arguments to pass to the operation method
332
+ */
333
+ export async function resolveArguments(context, operation) {
334
+ // Prefer the merged-and-coerced object that `checkOperation` left on the
335
+ // context. Re-merging here would discard AJV's `coerceTypes` rewrites
336
+ // (e.g. string `"0"` from a `{index}` URL slot back to a `number`).
337
+ // Falls back to a fresh merge for code paths that bypass `checkOperation`
338
+ // (currently only `Test.Op` unit tests).
339
+ let merged = context.getExtension("operationResolvedInput");
340
+ let input;
341
+ try {
342
+ input = await context.getInput();
343
+ }
344
+ catch {
345
+ // No input (e.g., GET request)
346
+ }
347
+ if (!merged) {
348
+ const params = context.getParameters() || {};
349
+ merged = { ...params, ...(typeof input === "object" && input !== null ? input : {}) };
350
+ }
351
+ // Use input schema properties to determine argument order
352
+ if (operation.input && operation.input !== "void") {
353
+ const app = useApplication();
354
+ const schema = app.getSchema(operation.input);
355
+ if (schema?.properties) {
356
+ const propNames = Object.keys(schema.properties);
357
+ // Extract values by schema property names from the merged params + body
358
+ return propNames.map(name => merged[name]);
359
+ }
360
+ }
361
+ // No schema: pass input as single arg if present
362
+ if (input !== undefined && input !== null) {
363
+ return [input];
364
+ }
365
+ return [];
366
+ }
367
+ /**
368
+ * Call an operation within the framework
369
+ * @param context - the execution context
370
+ * @param operationId - the operation identifier
371
+ */
372
+ export async function callOperation(context, operationId) {
373
+ const operations = useInstanceStorage().operations;
374
+ useLog("DEBUG", "Call operation", operationId);
375
+ let callArgs = [];
376
+ let result;
377
+ // A nested operation declares its own subject; restore the caller's after
378
+ const callerSubject = context.getExtension(DECLARED_SUBJECT);
379
+ context.setExtension(DECLARED_SUBJECT, undefined);
380
+ try {
381
+ context.setExtension("operation", operationId);
382
+ await checkOperation(context, operationId);
383
+ context.setExtension("operationContext", operations[operationId].context || {});
384
+ await Promise.all([
385
+ emitCoreEvent("Webda.BeforeOperation", { context, operationId })
386
+ //emitCoreEvent(`${operationId}.Before`, <any>context.getExtension("event") || {})
387
+ ]);
388
+ // Resolve arguments from context using the operation's input schema
389
+ const args = await resolveArguments(context, operations[operationId]);
390
+ // When resolveArguments returns no typed arguments (no input schema),
391
+ // fall back to passing the context for backward compatibility with
392
+ // methods that still use the context-based calling convention.
393
+ callArgs = args.length > 0 ? args : [context];
394
+ // Call the method with resolved arguments, wrapped in runWithContext
395
+ // so that useContext() returns the operation context inside the method.
396
+ if (operations[operationId].service) {
397
+ result = await runWithContext(context, () => useService(operations[operationId].service)[operations[operationId].method](...callArgs));
398
+ }
399
+ else if (operations[operationId].model) {
400
+ const modelClass = useModel(operations[operationId].model);
401
+ if (operations[operationId].static === false) {
402
+ // Instance method — load the model instance and call the method on it
403
+ // The first argument should be the primary key (uuid)
404
+ const uuid = callArgs[0];
405
+ result = await runWithContext(context, async () => {
406
+ const instance = await modelClass.ref(uuid).get();
407
+ if (!instance || instance.isDeleted?.()) {
408
+ throw new WebdaError.NotFound("Object not found");
409
+ }
410
+ return instance[operations[operationId].method](...callArgs.slice(1));
411
+ });
412
+ }
413
+ else {
414
+ // Static/class method — call on the model class directly
415
+ result = await runWithContext(context, () => modelClass[operations[operationId].method](...callArgs));
416
+ }
417
+ }
418
+ else {
419
+ throw new Error(`${operationId} NoServiceOrModel`);
420
+ }
421
+ // Handle return value — only write if the method hasn't already
422
+ // written to the context (avoid duplicating the response body when
423
+ // both the method and callOperation try to write the same value).
424
+ if (result !== undefined && result !== null) {
425
+ if (typeof result[Symbol.asyncIterator] === "function") {
426
+ // AsyncGenerator — stream each yielded value; flag it so contexts
427
+ // (e.g. MCP) can tell streamed chunks from a single written result
428
+ context.setExtension("operationStreaming", true);
429
+ for await (const chunk of result) {
430
+ context.write(chunk);
431
+ }
432
+ }
433
+ else if (context.getOutput() === undefined) {
434
+ // Normal return — write to context only if nothing written yet
435
+ context.write(result);
436
+ }
437
+ }
438
+ await Promise.all([
439
+ emitCoreEvent("Webda.OperationSuccess", {
440
+ context,
441
+ operationId,
442
+ subject: subjectOf(context, operationId, callArgs, result)
443
+ })
444
+ //emitCoreEvent(operationId, <any>context.getExtension("event") || {})
445
+ ]);
446
+ }
447
+ catch (err) {
448
+ await Promise.all([
449
+ emitCoreEvent("Webda.OperationFailure", {
450
+ context,
451
+ operationId,
452
+ error: err,
453
+ subject: subjectOf(context, operationId, callArgs)
454
+ })
455
+ //emitCoreEvent(`${operationId}.Failure`, <any>context.getExtension("event") || {})
456
+ ]);
457
+ throw err;
458
+ }
459
+ finally {
460
+ context.setExtension("event", undefined);
461
+ context.setExtension(DECLARED_SUBJECT, callerSubject);
462
+ }
463
+ }
464
+ /**
465
+ * Get available operations
466
+ * @returns the result
467
+ */
468
+ export function listOperations() {
469
+ const list = {};
470
+ const operations = useInstanceStorage().operations;
471
+ Object.keys(operations).forEach(o => {
472
+ list[o] = {
473
+ ...operations[o]
474
+ };
475
+ delete list[o].service;
476
+ delete list[o].method;
477
+ });
478
+ return list;
479
+ }
480
+ /**
481
+ * Get available operations with full details including service/method.
482
+ * Intended for debug/introspection only.
483
+ * @returns operations map with all fields
484
+ */
485
+ export function listFullOperations() {
486
+ return { ...useInstanceStorage().operations };
487
+ }
488
+ /**
489
+ * Register a new operation within the app
490
+ * @param operationId - the operation identifier
491
+ * @param definition - the definition object
492
+ */
493
+ export function registerOperation(operationId, definition) {
494
+ // Check operation naming convention
495
+ if (!operationId.match(/^([A-Z][A-Za-z0-9]*\.)*([A-Z][a-zA-Z0-9]*)$/)) {
496
+ throw new Error(`OperationId ${operationId} must match ^([A-Z][A-Za-z0-9]*.)*([A-Z][a-zA-Z0-9]*)$`);
497
+ }
498
+ // Check if service and method exist
499
+ if (definition.model !== undefined) {
500
+ const model = useModel(definition.model);
501
+ if (!model || typeof model[definition.method] !== "function") {
502
+ throw new Error(`Operation ${operationId} service ${definition.service} method ${definition.method} not found`);
503
+ }
504
+ }
505
+ else if (definition.service !== undefined) {
506
+ const service = useDynamicService(definition.service);
507
+ if (!service || typeof service[definition.method] !== "function") {
508
+ throw new Error(`Operation ${operationId} service ${definition.service} method ${definition.method} not found`);
509
+ }
510
+ }
511
+ else {
512
+ throw new Error(`Operation ${operationId} must have a service or a model`);
513
+ }
514
+ const operations = useInstanceStorage().operations;
515
+ // Add the operation, defaulting input/output to "void" if not provided
516
+ operations[operationId] = {
517
+ ...definition,
518
+ id: operationId,
519
+ input: definition.input ?? "void",
520
+ output: definition.output ?? "void"
521
+ };
522
+ ["input", "output"]
523
+ .filter(key => operations[operationId][key] && operations[operationId][key] !== "void")
524
+ .forEach(key => {
525
+ if (!useApplication().getSchema(operations[operationId][key])) {
526
+ operations[operationId][key] = "void";
527
+ }
528
+ });
529
+ }
530
+ /**
531
+ * Decorator that registers a class method as an operation with optional configuration
532
+ * @param args - additional arguments
533
+ * @returns the result
534
+ */
535
+ function Operation(...args) {
536
+ const annotate = (target, context, options = {}) => {
537
+ context.metadata["webda.operations"] ??= [];
538
+ context.metadata["webda.operations"].push({
539
+ id: context.name,
540
+ ...options,
541
+ _methodName: context.name,
542
+ static: context.static,
543
+ generator: isGeneratorFunction(target)
544
+ });
545
+ const wrapper = function operationWrapper(...args) {
546
+ return target.call(this, ...args);
547
+ };
548
+ wrapper.__original = target;
549
+ return wrapper;
550
+ };
551
+ if (args.length === 2 && args[1] instanceof Object && args[1].kind === "method") {
552
+ return annotate(args[0], args[1]);
553
+ }
554
+ return (target, context) => {
555
+ return annotate(target, context, args[0]);
556
+ };
557
+ }
558
+ export { Operation };
559
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/core/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAItD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;;GAQG;A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