@comake/skl-js-engine 1.5.2 → 1.5.4

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 (304) hide show
  1. package/package.json +1 -1
  2. package/src/SklEngine.ts +8 -1
  3. package/src/util/TripleUtil.ts +22 -2
  4. package/dist/JsExecutor/PermissionBuilder.d.ts +0 -14
  5. package/dist/JsExecutor/PermissionBuilder.d.ts.map +0 -1
  6. package/dist/JsExecutor/PermissionBuilder.js +0 -58
  7. package/dist/JsExecutor/PermissionBuilder.js.map +0 -1
  8. package/dist/JsExecutor/constants.d.ts +0 -27
  9. package/dist/JsExecutor/constants.d.ts.map +0 -1
  10. package/dist/JsExecutor/constants.js +0 -30
  11. package/dist/JsExecutor/constants.js.map +0 -1
  12. package/dist/JsExecutor/denoUtils.d.ts +0 -10
  13. package/dist/JsExecutor/denoUtils.d.ts.map +0 -1
  14. package/dist/JsExecutor/denoUtils.js +0 -24
  15. package/dist/JsExecutor/denoUtils.js.map +0 -1
  16. package/dist/JsExecutor/errors.d.ts +0 -40
  17. package/dist/JsExecutor/errors.d.ts.map +0 -1
  18. package/dist/JsExecutor/errors.js +0 -67
  19. package/dist/JsExecutor/errors.js.map +0 -1
  20. package/dist/JsExecutor/examples/basic/index.d.ts +0 -1
  21. package/dist/JsExecutor/examples/basic/index.d.ts.map +0 -1
  22. package/dist/JsExecutor/examples/basic/index.js +0 -46
  23. package/dist/JsExecutor/examples/basic/index.js.map +0 -1
  24. package/dist/JsExecutor/examples/basic/process.d.ts +0 -1
  25. package/dist/JsExecutor/examples/basic/process.d.ts.map +0 -1
  26. package/dist/JsExecutor/examples/basic/process.js +0 -34
  27. package/dist/JsExecutor/examples/basic/process.js.map +0 -1
  28. package/dist/JsExecutor/examples/jsExecutor/index.d.ts +0 -2
  29. package/dist/JsExecutor/examples/jsExecutor/index.d.ts.map +0 -1
  30. package/dist/JsExecutor/examples/jsExecutor/index.js +0 -47
  31. package/dist/JsExecutor/examples/jsExecutor/index.js.map +0 -1
  32. package/dist/JsExecutor/examples/jsExecutor/process.d.ts +0 -2
  33. package/dist/JsExecutor/examples/jsExecutor/process.d.ts.map +0 -1
  34. package/dist/JsExecutor/examples/jsExecutor/process.js +0 -58
  35. package/dist/JsExecutor/examples/jsExecutor/process.js.map +0 -1
  36. package/dist/JsExecutor/index.d.ts +0 -7
  37. package/dist/JsExecutor/index.d.ts.map +0 -1
  38. package/dist/JsExecutor/index.js +0 -36
  39. package/dist/JsExecutor/index.js.map +0 -1
  40. package/dist/JsExecutor/jsExecutor.d.ts +0 -68
  41. package/dist/JsExecutor/jsExecutor.d.ts.map +0 -1
  42. package/dist/JsExecutor/jsExecutor.js +0 -171
  43. package/dist/JsExecutor/jsExecutor.js.map +0 -1
  44. package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts +0 -165
  45. package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts.map +0 -1
  46. package/dist/JsExecutor/jsonRpc/JsonRpcClient.js +0 -335
  47. package/dist/JsExecutor/jsonRpc/JsonRpcClient.js.map +0 -1
  48. package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts +0 -125
  49. package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts.map +0 -1
  50. package/dist/JsExecutor/jsonRpc/JsonRpcServer.js +0 -391
  51. package/dist/JsExecutor/jsonRpc/JsonRpcServer.js.map +0 -1
  52. package/dist/JsExecutor/jsonRpc/index.d.ts +0 -4
  53. package/dist/JsExecutor/jsonRpc/index.d.ts.map +0 -1
  54. package/dist/JsExecutor/jsonRpc/index.js +0 -23
  55. package/dist/JsExecutor/jsonRpc/index.js.map +0 -1
  56. package/dist/JsExecutor/jsonRpc/types.d.ts +0 -193
  57. package/dist/JsExecutor/jsonRpc/types.d.ts.map +0 -1
  58. package/dist/JsExecutor/jsonRpc/types.js +0 -37
  59. package/dist/JsExecutor/jsonRpc/types.js.map +0 -1
  60. package/dist/JsExecutor/transport/Transport.d.ts +0 -74
  61. package/dist/JsExecutor/transport/Transport.d.ts.map +0 -1
  62. package/dist/JsExecutor/transport/Transport.js +0 -14
  63. package/dist/JsExecutor/transport/Transport.js.map +0 -1
  64. package/dist/JsExecutor/transport/base/BaseTransport.d.ts +0 -51
  65. package/dist/JsExecutor/transport/base/BaseTransport.d.ts.map +0 -1
  66. package/dist/JsExecutor/transport/base/BaseTransport.js +0 -68
  67. package/dist/JsExecutor/transport/base/BaseTransport.js.map +0 -1
  68. package/dist/JsExecutor/transport/index.d.ts +0 -13
  69. package/dist/JsExecutor/transport/index.d.ts.map +0 -1
  70. package/dist/JsExecutor/transport/index.js +0 -36
  71. package/dist/JsExecutor/transport/index.js.map +0 -1
  72. package/dist/JsExecutor/transport/process/ProcessManager.d.ts +0 -96
  73. package/dist/JsExecutor/transport/process/ProcessManager.d.ts.map +0 -1
  74. package/dist/JsExecutor/transport/process/ProcessManager.js +0 -219
  75. package/dist/JsExecutor/transport/process/ProcessManager.js.map +0 -1
  76. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts +0 -87
  77. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts.map +0 -1
  78. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js +0 -219
  79. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js.map +0 -1
  80. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts +0 -81
  81. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts.map +0 -1
  82. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js +0 -259
  83. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js.map +0 -1
  84. package/dist/JsExecutor/transport/utils/MessageUtils.d.ts +0 -68
  85. package/dist/JsExecutor/transport/utils/MessageUtils.d.ts.map +0 -1
  86. package/dist/JsExecutor/transport/utils/MessageUtils.js +0 -135
  87. package/dist/JsExecutor/transport/utils/MessageUtils.js.map +0 -1
  88. package/dist/JsExecutor/transport/utils/PollingUtils.d.ts +0 -53
  89. package/dist/JsExecutor/transport/utils/PollingUtils.d.ts.map +0 -1
  90. package/dist/JsExecutor/transport/utils/PollingUtils.js +0 -92
  91. package/dist/JsExecutor/transport/utils/PollingUtils.js.map +0 -1
  92. package/dist/JsExecutor/types.d.ts +0 -113
  93. package/dist/JsExecutor/types.d.ts.map +0 -1
  94. package/dist/JsExecutor/types.js +0 -3
  95. package/dist/JsExecutor/types.js.map +0 -1
  96. package/dist/SklEngine.d.ts +0 -132
  97. package/dist/SklEngine.d.ts.map +0 -1
  98. package/dist/SklEngine.js +0 -1501
  99. package/dist/SklEngine.js.map +0 -1
  100. package/dist/SklEngineOptions.d.ts +0 -58
  101. package/dist/SklEngineOptions.d.ts.map +0 -1
  102. package/dist/SklEngineOptions.js +0 -3
  103. package/dist/SklEngineOptions.js.map +0 -1
  104. package/dist/constants.d.ts +0 -96
  105. package/dist/constants.d.ts.map +0 -1
  106. package/dist/constants.js +0 -103
  107. package/dist/constants.js.map +0 -1
  108. package/dist/customCapabilities.d.ts +0 -22
  109. package/dist/customCapabilities.d.ts.map +0 -1
  110. package/dist/customCapabilities.js +0 -45
  111. package/dist/customCapabilities.js.map +0 -1
  112. package/dist/examples/customCapabilitiesExample.d.ts +0 -2
  113. package/dist/examples/customCapabilitiesExample.d.ts.map +0 -1
  114. package/dist/examples/customCapabilitiesExample.js +0 -59
  115. package/dist/examples/customCapabilitiesExample.js.map +0 -1
  116. package/dist/executor.js +0 -216
  117. package/dist/hooks/globalHooks.d.ts +0 -50
  118. package/dist/hooks/globalHooks.d.ts.map +0 -1
  119. package/dist/hooks/globalHooks.js +0 -164
  120. package/dist/hooks/globalHooks.js.map +0 -1
  121. package/dist/hooks/types.d.ts +0 -9
  122. package/dist/hooks/types.d.ts.map +0 -1
  123. package/dist/hooks/types.js +0 -3
  124. package/dist/hooks/types.js.map +0 -1
  125. package/dist/index.d.ts +0 -41
  126. package/dist/index.d.ts.map +0 -1
  127. package/dist/index.js +0 -68
  128. package/dist/index.js.map +0 -1
  129. package/dist/logger.d.ts +0 -35
  130. package/dist/logger.d.ts.map +0 -1
  131. package/dist/logger.js +0 -119
  132. package/dist/logger.js.map +0 -1
  133. package/dist/mapping/Mapper.d.ts +0 -13
  134. package/dist/mapping/Mapper.d.ts.map +0 -1
  135. package/dist/mapping/Mapper.js +0 -64
  136. package/dist/mapping/Mapper.js.map +0 -1
  137. package/dist/storage/FindOperator.d.ts +0 -19
  138. package/dist/storage/FindOperator.d.ts.map +0 -1
  139. package/dist/storage/FindOperator.js +0 -23
  140. package/dist/storage/FindOperator.js.map +0 -1
  141. package/dist/storage/FindOptionsTypes.d.ts +0 -79
  142. package/dist/storage/FindOptionsTypes.d.ts.map +0 -1
  143. package/dist/storage/FindOptionsTypes.js +0 -3
  144. package/dist/storage/FindOptionsTypes.js.map +0 -1
  145. package/dist/storage/GroupOptionTypes.d.ts +0 -29
  146. package/dist/storage/GroupOptionTypes.d.ts.map +0 -1
  147. package/dist/storage/GroupOptionTypes.js +0 -3
  148. package/dist/storage/GroupOptionTypes.js.map +0 -1
  149. package/dist/storage/operator/And.d.ts +0 -4
  150. package/dist/storage/operator/And.d.ts.map +0 -1
  151. package/dist/storage/operator/And.js +0 -13
  152. package/dist/storage/operator/And.js.map +0 -1
  153. package/dist/storage/operator/Contains.d.ts +0 -3
  154. package/dist/storage/operator/Contains.d.ts.map +0 -1
  155. package/dist/storage/operator/Contains.js +0 -13
  156. package/dist/storage/operator/Contains.js.map +0 -1
  157. package/dist/storage/operator/Equal.d.ts +0 -5
  158. package/dist/storage/operator/Equal.d.ts.map +0 -1
  159. package/dist/storage/operator/Equal.js +0 -13
  160. package/dist/storage/operator/Equal.js.map +0 -1
  161. package/dist/storage/operator/Exists.d.ts +0 -3
  162. package/dist/storage/operator/Exists.d.ts.map +0 -1
  163. package/dist/storage/operator/Exists.js +0 -10
  164. package/dist/storage/operator/Exists.js.map +0 -1
  165. package/dist/storage/operator/GreaterThan.d.ts +0 -4
  166. package/dist/storage/operator/GreaterThan.d.ts.map +0 -1
  167. package/dist/storage/operator/GreaterThan.js +0 -13
  168. package/dist/storage/operator/GreaterThan.js.map +0 -1
  169. package/dist/storage/operator/GreaterThanOrEqual.d.ts +0 -4
  170. package/dist/storage/operator/GreaterThanOrEqual.d.ts.map +0 -1
  171. package/dist/storage/operator/GreaterThanOrEqual.js +0 -13
  172. package/dist/storage/operator/GreaterThanOrEqual.js.map +0 -1
  173. package/dist/storage/operator/In.d.ts +0 -4
  174. package/dist/storage/operator/In.d.ts.map +0 -1
  175. package/dist/storage/operator/In.js +0 -13
  176. package/dist/storage/operator/In.js.map +0 -1
  177. package/dist/storage/operator/Inverse.d.ts +0 -3
  178. package/dist/storage/operator/Inverse.d.ts.map +0 -1
  179. package/dist/storage/operator/Inverse.js +0 -13
  180. package/dist/storage/operator/Inverse.js.map +0 -1
  181. package/dist/storage/operator/InversePath.d.ts +0 -7
  182. package/dist/storage/operator/InversePath.d.ts.map +0 -1
  183. package/dist/storage/operator/InversePath.js +0 -13
  184. package/dist/storage/operator/InversePath.js.map +0 -1
  185. package/dist/storage/operator/InverseRelation.d.ts +0 -9
  186. package/dist/storage/operator/InverseRelation.d.ts.map +0 -1
  187. package/dist/storage/operator/InverseRelation.js +0 -13
  188. package/dist/storage/operator/InverseRelation.js.map +0 -1
  189. package/dist/storage/operator/InverseRelationOrder.d.ts +0 -8
  190. package/dist/storage/operator/InverseRelationOrder.d.ts.map +0 -1
  191. package/dist/storage/operator/InverseRelationOrder.js +0 -13
  192. package/dist/storage/operator/InverseRelationOrder.js.map +0 -1
  193. package/dist/storage/operator/LessThan.d.ts +0 -4
  194. package/dist/storage/operator/LessThan.d.ts.map +0 -1
  195. package/dist/storage/operator/LessThan.js +0 -13
  196. package/dist/storage/operator/LessThan.js.map +0 -1
  197. package/dist/storage/operator/LessThanOrEqual.d.ts +0 -4
  198. package/dist/storage/operator/LessThanOrEqual.d.ts.map +0 -1
  199. package/dist/storage/operator/LessThanOrEqual.js +0 -13
  200. package/dist/storage/operator/LessThanOrEqual.js.map +0 -1
  201. package/dist/storage/operator/Not.d.ts +0 -3
  202. package/dist/storage/operator/Not.d.ts.map +0 -1
  203. package/dist/storage/operator/Not.js +0 -13
  204. package/dist/storage/operator/Not.js.map +0 -1
  205. package/dist/storage/operator/OneOrMorePath.d.ts +0 -7
  206. package/dist/storage/operator/OneOrMorePath.d.ts.map +0 -1
  207. package/dist/storage/operator/OneOrMorePath.js +0 -13
  208. package/dist/storage/operator/OneOrMorePath.js.map +0 -1
  209. package/dist/storage/operator/Or.d.ts +0 -4
  210. package/dist/storage/operator/Or.d.ts.map +0 -1
  211. package/dist/storage/operator/Or.js +0 -13
  212. package/dist/storage/operator/Or.js.map +0 -1
  213. package/dist/storage/operator/Sequence.d.ts +0 -3
  214. package/dist/storage/operator/Sequence.d.ts.map +0 -1
  215. package/dist/storage/operator/Sequence.js +0 -13
  216. package/dist/storage/operator/Sequence.js.map +0 -1
  217. package/dist/storage/operator/SequencePath.d.ts +0 -7
  218. package/dist/storage/operator/SequencePath.d.ts.map +0 -1
  219. package/dist/storage/operator/SequencePath.js +0 -13
  220. package/dist/storage/operator/SequencePath.js.map +0 -1
  221. package/dist/storage/operator/ZeroOrMorePath.d.ts +0 -7
  222. package/dist/storage/operator/ZeroOrMorePath.d.ts.map +0 -1
  223. package/dist/storage/operator/ZeroOrMorePath.js +0 -13
  224. package/dist/storage/operator/ZeroOrMorePath.js.map +0 -1
  225. package/dist/storage/query-adapter/QueryAdapter.d.ts +0 -99
  226. package/dist/storage/query-adapter/QueryAdapter.d.ts.map +0 -1
  227. package/dist/storage/query-adapter/QueryAdapter.js +0 -3
  228. package/dist/storage/query-adapter/QueryAdapter.js.map +0 -1
  229. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.d.ts +0 -40
  230. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.d.ts.map +0 -1
  231. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.js +0 -315
  232. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.js.map +0 -1
  233. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.d.ts +0 -34
  234. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.d.ts.map +0 -1
  235. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.js +0 -3
  236. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.js.map +0 -1
  237. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.d.ts +0 -104
  238. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.d.ts.map +0 -1
  239. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.js +0 -1210
  240. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.js.map +0 -1
  241. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.d.ts +0 -41
  242. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.d.ts.map +0 -1
  243. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.js +0 -305
  244. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.js.map +0 -1
  245. package/dist/storage/query-adapter/sparql/VariableGenerator.d.ts +0 -5
  246. package/dist/storage/query-adapter/sparql/VariableGenerator.d.ts.map +0 -1
  247. package/dist/storage/query-adapter/sparql/VariableGenerator.js +0 -14
  248. package/dist/storage/query-adapter/sparql/VariableGenerator.js.map +0 -1
  249. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.d.ts +0 -19
  250. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.d.ts.map +0 -1
  251. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.js +0 -90
  252. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.js.map +0 -1
  253. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.d.ts +0 -27
  254. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.d.ts.map +0 -1
  255. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.js +0 -116
  256. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.js.map +0 -1
  257. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.d.ts +0 -34
  258. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.d.ts.map +0 -1
  259. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.js +0 -3
  260. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.js.map +0 -1
  261. package/dist/tools/explain-findall-sparql.d.ts +0 -2
  262. package/dist/tools/explain-findall-sparql.d.ts.map +0 -1
  263. package/dist/tools/explain-findall-sparql.js +0 -303
  264. package/dist/tools/explain-findall-sparql.js.map +0 -1
  265. package/dist/util/PerformanceLogger.d.ts +0 -28
  266. package/dist/util/PerformanceLogger.d.ts.map +0 -1
  267. package/dist/util/PerformanceLogger.js +0 -223
  268. package/dist/util/PerformanceLogger.js.map +0 -1
  269. package/dist/util/ReadCacheHelper.d.ts +0 -14
  270. package/dist/util/ReadCacheHelper.d.ts.map +0 -1
  271. package/dist/util/ReadCacheHelper.js +0 -61
  272. package/dist/util/ReadCacheHelper.js.map +0 -1
  273. package/dist/util/SparqlUtil.d.ts +0 -72
  274. package/dist/util/SparqlUtil.d.ts.map +0 -1
  275. package/dist/util/SparqlUtil.js +0 -456
  276. package/dist/util/SparqlUtil.js.map +0 -1
  277. package/dist/util/TripleUtil.d.ts +0 -10
  278. package/dist/util/TripleUtil.d.ts.map +0 -1
  279. package/dist/util/TripleUtil.js +0 -402
  280. package/dist/util/TripleUtil.js.map +0 -1
  281. package/dist/util/Types.d.ts +0 -271
  282. package/dist/util/Types.d.ts.map +0 -1
  283. package/dist/util/Types.js +0 -3
  284. package/dist/util/Types.js.map +0 -1
  285. package/dist/util/Util.d.ts +0 -26
  286. package/dist/util/Util.d.ts.map +0 -1
  287. package/dist/util/Util.js +0 -138
  288. package/dist/util/Util.js.map +0 -1
  289. package/dist/util/Vocabularies/Shared.d.ts +0 -13
  290. package/dist/util/Vocabularies/Shared.d.ts.map +0 -1
  291. package/dist/util/Vocabularies/Shared.js +0 -96
  292. package/dist/util/Vocabularies/Shared.js.map +0 -1
  293. package/dist/util/Vocabularies/helper.d.ts +0 -5
  294. package/dist/util/Vocabularies/helper.d.ts.map +0 -1
  295. package/dist/util/Vocabularies/helper.js +0 -10
  296. package/dist/util/Vocabularies/helper.js.map +0 -1
  297. package/dist/util/Vocabularies/index.d.ts +0 -8
  298. package/dist/util/Vocabularies/index.d.ts.map +0 -1
  299. package/dist/util/Vocabularies/index.js +0 -114
  300. package/dist/util/Vocabularies/index.js.map +0 -1
  301. package/dist/util/safeJsonStringify.d.ts +0 -1
  302. package/dist/util/safeJsonStringify.d.ts.map +0 -1
  303. package/dist/util/safeJsonStringify.js +0 -19
  304. package/dist/util/safeJsonStringify.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"SklEngine.js","sourceRoot":"","sources":["../src/SklEngine.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,0CAA0C;;;;;;AAS1C,mFAA8E;AAC9E,uDAAmG;AAEnG,kDAA0B;AAG1B,iDAAyC;AACzC,4EAAgD;AAEhD,2CAUqB;AACrB,6DAAgE;AAChE,qDAAyE;AAGzE,qCAAkC;AAClC,6CAA0C;AAK1C,sDAAmD;AACnD,8CAA2C;AAC3C,gEAA6D;AAC7D,gDAA6C;AAC7C,oEAAiE;AACjE,kEAA+D;AAC/D,sEAAmE;AAEnE,0FAAuF;AACvF,gEAA6D;AAC7D,4DAAkF;AAuBlF,sCAA2F;AAC3F,sDAAwE;AAWxE,MAAM,yBAAyB,GAAG,KAAM,CAAC;AACzC,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAM9D,MAAa,SAAS;IAepB,YAAmB,OAAyB;QAD3B,0BAAqB,GAAG,IAAI,uCAAqB,EAAE,CAAC;QAEnE,IAAI,CAAC,YAAY,GAAG,IAAI,u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AAM;oBACL,OAAO,CAAC,IAAI,CAAC,GAAG;wBACd,OAAO,EAAE,QAAQ;qBAClB,CAAC;iBACH;aACF;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA94DD,8BA84DC","sourcesContent":["/* eslint-disable no-div-regex */\n/* eslint-disable line-comment-position */\n\n/* eslint-disable no-inline-comments */\n/* eslint-disable require-unicode-regexp */\n \n \n \n/* eslint-disable @typescript-eslint/naming-convention */\nimport type { OpenApi, OpenApiClientConfiguration, OperationWithPathInfo } from '@comake/openapi-operation-executor';\nimport { OpenApiOperationExecutor } from '@comake/openapi-operation-executor';\nimport { getIdFromNodeObjectIfDefined, XSD, type ReferenceNodeObject } from '@comake/rmlmapper-js';\nimport type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport axios from 'axios';\nimport type { ContextDefinition, GraphObject, NodeObject } from 'jsonld';\nimport type { Frame } from 'jsonld/jsonld-spec';\nimport { JSONPath } from 'jsonpath-plus';\nimport SHACLValidator from 'rdf-validate-shacl';\nimport type ValidationReport from 'rdf-validate-shacl/src/validation-report';\nimport {\n EngineConstants,\n OPEN_API_RUNTIME_AUTHORIZATION,\n PROP_ENTITY_ID,\n PROP_ENTITY_TYPE,\n PROP_ENTITY_VALUE,\n RDF,\n RDFS,\n RML_LIST,\n SHACL\n} from './constants';\nimport { globalCustomCapabilities } from './customCapabilities';\nimport { globalHooks, HookStages, HookTypes } from './hooks/globalHooks';\nimport type { ExecutionOptions } from './JsExecutor';\nimport type { ICodeExecutor } from './JsExecutor/types';\nimport { Logger } from './logger';\nimport { Mapper } from './mapping/Mapper';\nimport type { ReadCacheOperation, ReadCachePolicy, ReadCacheStore, SklEngineOptions } from './SklEngineOptions';\nimport type { FindOperator } from './storage/FindOperator';\nimport type { FindAllOptions, FindOneOptions, FindOptionsWhere } from './storage/FindOptionsTypes';\nimport type { GroupByOptions, GroupByResponse } from './storage/GroupOptionTypes';\nimport { Exists } from './storage/operator/Exists';\nimport { In } from './storage/operator/In';\nimport { InversePath } from './storage/operator/InversePath';\nimport { Not } from './storage/operator/Not';\nimport { OneOrMorePath } from './storage/operator/OneOrMorePath';\nimport { SequencePath } from './storage/operator/SequencePath';\nimport { ZeroOrMorePath } from './storage/operator/ZeroOrMorePath';\nimport type { QueryAdapter, RawQueryResult } from './storage/query-adapter/QueryAdapter';\nimport { SparqlQueryAdapter } from './storage/query-adapter/sparql/SparqlQueryAdapter';\nimport { PerformanceLogger } from './util/PerformanceLogger';\nimport { buildReadCacheKey, ReadCacheSingleflight } from './util/ReadCacheHelper';\n// Import './util/safeJsonStringify';\nimport type {\n Callbacks,\n Capability,\n CapabilityConfig,\n CapabilityMapping,\n Entity,\n JSONObject,\n JSONValue,\n Mapping,\n MappingWithInputs,\n MappingWithInputsReference,\n MappingWithOutputsMapping,\n MappingWithParallel,\n MappingWithSeries,\n OperationResponse,\n OrArray,\n RdfList,\n SeriesCapabilityArgs,\n SKLEngineInterface,\n TriggerMapping\n} from './util/Types';\nimport { convertJsonLdToQuads, ensureArray, getValueIfDefined, toJSON } from './util/Util';\nimport { SKL_DATA_NAMESPACE, SKL_NAMESPACE } from './util/Vocabularies';\n\nexport type CapabilityHandler = <T extends OrArray<NodeObject> = OrArray<NodeObject>>(\n params: JSONObject,\n capabilityConfig?: CapabilityConfig\n) => Promise<T>;\nexport type CapabilityInterface = Record<string, CapabilityHandler>;\n\nexport type MappingResponseOption<T extends boolean> = T extends true ? JSONObject : NodeObject;\n\nexport type WriteOptions = { bypassHooks?: boolean };\nconst DEFAULT_READ_CACHE_TTL_MS = 60_000;\nconst READ_CACHE_ENVELOPE_MARKER = '__sklReadCacheEnvelopeV1';\ntype ReadCacheEnvelope<T> = {\n [READ_CACHE_ENVELOPE_MARKER]: true;\n value: T;\n};\n\nexport class SKLEngine implements SKLEngineInterface {\n private readonly queryAdapter: QueryAdapter;\n private readonly functions?: Record<string, (args: any | any[]) => any>;\n private readonly inputFiles?: Record<string, string>;\n private readonly globalCallbacks?: Callbacks;\n private readonly disableValidation?: boolean;\n public readonly capability: CapabilityInterface;\n private codeExecutor: ICodeExecutor | undefined;\n private readonly skdsEndpointUrl: string;\n private readonly scriptPath: string;\n private readonly logger: Logger;\n private readonly readCache?: ReadCacheStore;\n private readonly readCachePolicy?: ReadCachePolicy;\n private readonly readCacheNamespace?: string;\n private readonly readCacheSingleflight = new ReadCacheSingleflight();\n public constructor(options: SklEngineOptions) {\n this.queryAdapter = new SparqlQueryAdapter(options);\n this.disableValidation = options.disableValidation;\n this.globalCallbacks = options.callbacks;\n this.inputFiles = options.inputFiles;\n this.skdsEndpointUrl = (options as any).endpointUrl;\n this.scriptPath = (options as any).scriptPath;\n this.readCache = options.readCache;\n this.readCachePolicy = options.readCachePolicy;\n this.readCacheNamespace = options.readCacheNamespace;\n if (options.functions) {\n this.functions = Object.fromEntries(\n Object.entries(options.functions).map(([key, func]) => [\n key,\n (data: Record<string | number, any> = {}) => {\n // Add the SKL instance to the data object\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n data.skl = this;\n\n // Call the original function\n return func(data);\n }\n ])\n );\n }\n this.logger = Logger.getInstance(options.debugMode);\n\n // eslint-disable-next-line func-style\n const getCapabilityHandler =\n (getTarget: CapabilityInterface, property: string): CapabilityHandler =>\n async <T extends OrArray<NodeObject> = OrArray<NodeObject>>(\n capabilityArgs: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<T> =>\n this.executeCapabilityByName(property, capabilityArgs, capabilityConfig) as Promise<T>;\n this.capability = new Proxy({} as CapabilityInterface, { get: getCapabilityHandler });\n }\n\n public setCodeExecutor(codeExecutor: ICodeExecutor): void {\n this.codeExecutor = codeExecutor;\n }\n\n public async executeRawQuery<T extends RawQueryResult>(query: string): Promise<T[]> {\n return await this.queryAdapter.executeRawQuery<T>(query);\n }\n\n public async executeRawUpdate(query: string): Promise<void> {\n return await this.queryAdapter.executeRawUpdate(query);\n }\n\n public async executeRawConstructQuery(query: string, frame?: Frame): Promise<GraphObject> {\n return await this.queryAdapter.executeRawConstructQuery(query, frame);\n }\n\n private cloneForReadCache<T>(value: T): T {\n try {\n return structuredClone(value);\n } catch {\n return value;\n }\n }\n\n private wrapReadCacheValue<T>(value: T): ReadCacheEnvelope<T> {\n return {\n [READ_CACHE_ENVELOPE_MARKER]: true,\n value\n };\n }\n\n private isReadCacheEnvelope<T>(value: unknown): value is ReadCacheEnvelope<T> {\n if (!value || typeof value !== 'object') {\n return false;\n }\n return (value as Record<string, unknown>)[READ_CACHE_ENVELOPE_MARKER] === true;\n }\n\n private stripBypassCacheFromFindOneOptions(options?: FindOneOptions): FindOneOptions | undefined {\n if (!options) {\n return options;\n }\n const { bypassCache, ...rest } = options;\n return rest;\n }\n\n private stripBypassCacheFromFindAllOptions(options?: FindAllOptions): FindAllOptions | undefined {\n if (!options) {\n return options;\n }\n const { bypassCache, ...rest } = options;\n return rest;\n }\n\n private stripBypassCacheFromWhere(where?: FindOptionsWhere): FindOptionsWhere | undefined {\n if (!where) {\n return where;\n }\n const { bypassCache, ...rest } = where;\n return rest;\n }\n\n private async runReadWithCache<T>(params: {\n operation: ReadCacheOperation;\n args: readonly unknown[];\n bypassCache?: boolean;\n execute: () => Promise<T>;\n }): Promise<T> {\n if (params.bypassCache) {\n return await params.execute();\n }\n\n if (!this.readCache || !this.readCachePolicy) {\n return await params.execute();\n }\n\n const policyDecision = this.readCachePolicy({\n operation: params.operation,\n args: params.args,\n endpointUrl: this.skdsEndpointUrl,\n namespace: this.readCacheNamespace\n });\n if (!policyDecision.cache) {\n return await params.execute();\n }\n\n const ttlMs = policyDecision.ttlMs ?? DEFAULT_READ_CACHE_TTL_MS;\n if (ttlMs <= 0) {\n return await params.execute();\n }\n\n const cacheKey = buildReadCacheKey({\n operation: params.operation,\n args: params.args,\n endpointUrl: this.skdsEndpointUrl,\n namespace: this.readCacheNamespace,\n keyHint: policyDecision.keyHint\n });\n\n return await this.readCacheSingleflight.do(cacheKey, async() => {\n try {\n const cached = await this.readCache?.get(cacheKey);\n if (cached !== undefined) {\n if (this.isReadCacheEnvelope<T>(cached)) {\n return this.cloneForReadCache(cached.value);\n }\n return this.cloneForReadCache(cached as T);\n }\n } catch (error) {\n this.logger.debug('Read cache lookup failed; continuing without cache', error as any);\n }\n\n const result = await params.execute();\n\n try {\n await this.readCache?.set(cacheKey, this.wrapReadCacheValue(this.cloneForReadCache(result)), ttlMs);\n } catch (error) {\n this.logger.debug('Read cache write failed; continuing without cache', error as any);\n }\n\n return result;\n });\n }\n\n public async find(options?: FindOneOptions): Promise<Entity> {\n const bypassCache = options?.bypassCache;\n const optionsWithoutBypass = this.stripBypassCacheFromFindOneOptions(options);\n\n return PerformanceLogger.withSpanRoot('SklEngine.find', async() => {\n const context = {\n entities: [],\n operation: 'find',\n operationParameters: { options: optionsWithoutBypass },\n sklEngine: this\n };\n\n await globalHooks.execute(HookTypes.READ, HookStages.BEFORE, context);\n\n try {\n const entity = await this.runReadWithCache({\n operation: 'find',\n args: [optionsWithoutBypass],\n bypassCache,\n execute: async() => await this.queryAdapter.find(optionsWithoutBypass)\n });\n if (!entity) {\n throw new Error(`No schema found with fields matching ${JSON.stringify(optionsWithoutBypass)}`);\n }\n\n const updatedContext = { ...context, entities: [entity]};\n const afterHookResult = await globalHooks.execute(HookTypes.READ, HookStages.AFTER, updatedContext, entity);\n\n return afterHookResult || entity;\n } catch (error: unknown) {\n await globalHooks.execute(HookTypes.READ, HookStages.ERROR, context, error);\n throw error;\n }\n }, { options: optionsWithoutBypass });\n }\n\n public async findBy(where: FindOptionsWhere, notFoundErrorMessage?: string): Promise<Entity> {\n const bypassCache = where?.bypassCache;\n const whereWithoutBypass = this.stripBypassCacheFromWhere(where)!;\n\n return PerformanceLogger.withSpanRoot('SklEngine.findBy', async() => {\n const context = {\n entities: [],\n operation: 'findBy',\n operationParameters: { where: whereWithoutBypass },\n sklEngine: this\n };\n await globalHooks.execute(HookTypes.READ, HookStages.BEFORE, context);\n try {\n const entity = await this.runReadWithCache({\n operation: 'findBy',\n args: [whereWithoutBypass, notFoundErrorMessage],\n bypassCache,\n execute: async() => await this.queryAdapter.findBy(whereWithoutBypass)\n });\n if (entity) {\n const updatedContext = { ...context, entities: [entity]};\n await globalHooks.execute(HookTypes.READ, HookStages.AFTER, updatedContext, entity);\n return entity;\n }\n throw new Error(notFoundErrorMessage ?? `No schema found with fields matching ${JSON.stringify(whereWithoutBypass)}`);\n } catch (error: unknown) {\n await globalHooks.execute(HookTypes.READ, HookStages.ERROR, context, error);\n throw error;\n }\n }, { where: whereWithoutBypass });\n }\n\n public async findByIfExists(options: FindOptionsWhere): Promise<Entity | undefined> {\n try {\n const entity = await this.findBy(options);\n return entity;\n } catch {\n return undefined;\n }\n }\n\n public async findAll(options?: FindAllOptions): Promise<Entity[]> {\n const bypassCache = options?.bypassCache;\n const optionsWithoutBypass = this.stripBypassCacheFromFindAllOptions(options);\n\n return PerformanceLogger.withSpanRoot('SklEngine.findAll', async() => {\n const context = {\n entities: [],\n operation: 'findAll',\n operationParameters: { options: optionsWithoutBypass },\n sklEngine: this\n };\n await globalHooks.execute(HookTypes.READ, HookStages.BEFORE, context);\n try {\n const entities = await this.runReadWithCache({\n operation: 'findAll',\n args: [optionsWithoutBypass],\n bypassCache,\n execute: async() => await this.queryAdapter.findAll(optionsWithoutBypass)\n });\n const updatedContext = { ...context, entities };\n await globalHooks.execute(HookTypes.READ, HookStages.AFTER, updatedContext, entities);\n return entities;\n } catch (error: unknown) {\n await globalHooks.execute(HookTypes.READ, HookStages.ERROR, context, error);\n throw error;\n }\n }, { options: optionsWithoutBypass });\n }\n\n public async groupBy(options: GroupByOptions): Promise<GroupByResponse> {\n return PerformanceLogger.withSpanRoot('SklEngine.groupBy', async() => {\n const context = {\n entities: [],\n operation: 'groupBy',\n operationParameters: { options },\n sklEngine: this\n };\n await globalHooks.execute(HookTypes.READ, HookStages.BEFORE, context);\n try {\n const result = await this.queryAdapter.groupBy(options);\n const updatedContext = { ...context, result };\n await globalHooks.execute(HookTypes.READ, HookStages.AFTER, updatedContext, result);\n return result;\n } catch (error: unknown) {\n await globalHooks.execute(HookTypes.READ, HookStages.ERROR, context, error);\n throw error;\n }\n }, { options });\n }\n\n public async findAllBy(where: FindOptionsWhere): Promise<Entity[]> {\n return PerformanceLogger.withSpanRoot('SklEngine.findAllBy', async() => {\n const context = {\n entities: [],\n operation: 'findAllBy',\n operationParameters: { where },\n sklEngine: this\n };\n await globalHooks.execute(HookTypes.READ, HookStages.BEFORE, context);\n try {\n const entities = await this.queryAdapter.findAllBy(where);\n const updatedContext = { ...context, entities };\n await globalHooks.execute(HookTypes.READ, HookStages.AFTER, updatedContext, entities);\n return entities;\n } catch (error: unknown) {\n await globalHooks.execute(HookTypes.READ, HookStages.ERROR, context, error);\n throw error;\n }\n }, { where });\n }\n\n public async exists(options?: FindAllOptions): Promise<boolean> {\n return PerformanceLogger.withSpanRoot('SklEngine.exists', async() => this.queryAdapter.exists(options), { options });\n }\n\n public async count(options?: FindAllOptions): Promise<number> {\n const bypassCache = options?.bypassCache;\n const optionsWithoutBypass = this.stripBypassCacheFromFindAllOptions(options);\n\n return PerformanceLogger.withSpanRoot(\n 'SklEngine.count',\n async() =>\n await this.runReadWithCache({\n operation: 'count',\n args: [optionsWithoutBypass],\n bypassCache,\n execute: async() => await this.queryAdapter.count(optionsWithoutBypass)\n }),\n { options: optionsWithoutBypass }\n );\n }\n\n public async save(entity: Entity, options?: WriteOptions): Promise<Entity>;\n public async save(entities: Entity[], options?: WriteOptions): Promise<Entity[]>;\n public async save(entityOrEntities: Entity | Entity[], options?: WriteOptions): Promise<Entity | Entity[]> {\n return PerformanceLogger.withSpanRoot('SklEngine.save', async() => {\n const entityArray = Array.isArray(entityOrEntities) ? entityOrEntities : [entityOrEntities];\n const isSingleEntity = !Array.isArray(entityOrEntities);\n\n await globalHooks.executeBeforeCreate(entityArray, { sklEngine: this, bypassHooks: options?.bypassHooks });\n\n try {\n await this.validateEntitiesConformToObjectSchema(entityArray);\n const savedEntities = await this.queryAdapter.save(entityArray);\n await globalHooks.executeAfterCreate(savedEntities, { sklEngine: this, bypassHooks: options?.bypassHooks });\n return isSingleEntity ? savedEntities[0] : savedEntities;\n } catch (error) {\n await globalHooks.executeErrorCreate(entityArray, error as Error, { sklEngine: this, bypassHooks: options?.bypassHooks });\n throw error;\n }\n }, { entityCount: Array.isArray(entityOrEntities) ? entityOrEntities.length : 1 });\n }\n\n public async update(id: string, attributes: Partial<Entity>, options?: WriteOptions): Promise<void>;\n public async update(ids: string[], attributes: Partial<Entity>, options?: WriteOptions): Promise<void>;\n public async update(idOrIds: string | string[], attributes: Partial<Entity>, options?: WriteOptions): Promise<void> {\n return PerformanceLogger.withSpanRoot('SklEngine.update', async() => {\n const idArray = Array.isArray(idOrIds) ? idOrIds : [idOrIds];\n const isSingleEntity = !Array.isArray(idOrIds);\n\n await globalHooks.execute(HookTypes.UPDATE, HookStages.BEFORE, {\n entities: [],\n operation: 'update',\n operationParameters: { idArray, attributes },\n sklEngine: this,\n bypassHooks: options?.bypassHooks\n });\n\n try {\n if (idArray.length > 1) {\n await this.validateEntitiesWithIdsConformsToObjectSchemaForAttributes(idArray, attributes);\n } else {\n await this.validateEntityWithIdConformsToObjectSchemaForAttributes(idArray[0], attributes);\n }\n await this.queryAdapter.update(isSingleEntity ? idArray[0] : (idArray as any), attributes);\n\n await globalHooks.execute(HookTypes.UPDATE, HookStages.AFTER, {\n entities: [],\n operation: 'update',\n operationParameters: { idArray, attributes },\n sklEngine: this,\n bypassHooks: options?.bypassHooks\n });\n } catch (error: unknown) {\n await globalHooks.execute(HookTypes.UPDATE, HookStages.ERROR, {\n entities: [],\n operation: 'update',\n operationParameters: { idArray, attributes },\n sklEngine: this,\n bypassHooks: options?.bypassHooks\n }, error);\n throw error;\n }\n }, { idCount: Array.isArray(idOrIds) ? idOrIds.length : 1 });\n }\n\n public async validateEntitiesConformToObjectSchema(entities: Entity[]): Promise<void> {\n const entitiesByType = this.groupEntitiesByType(entities);\n for (const type of Object.keys(entitiesByType)) {\n const object = await this.findByIfExists({ id: type });\n if (object) {\n const parentObjects = await this.getSuperClassesOfObject(type);\n for (const currentObject of [object, ...parentObjects]) {\n const entitiesOfType = entitiesByType[type];\n const nounSchemaWithTarget = {\n ...currentObject,\n [SHACL.targetNode]: entitiesOfType.map(\n (entity): ReferenceNodeObject => ({ [PROP_ENTITY_ID]: entity[PROP_ENTITY_ID] })\n )\n };\n const report = await this.convertToQuadsAndValidateAgainstShape(entitiesOfType, nounSchemaWithTarget);\n if (!report.conforms) {\n const entityIds = entitiesOfType.map((entity): string => entity[PROP_ENTITY_ID]);\n this.throwValidationReportError(\n report,\n `Entity ${entityIds.join(', ')} does not conform to the ${currentObject[PROP_ENTITY_ID]} schema.`\n );\n }\n }\n }\n }\n }\n\n private groupEntitiesByType(entities: Entity[]): Record<string, Entity[]> {\n return entities.reduce((groupedEntities: Record<string, Entity[]>, entity): Record<string, Entity[]> => {\n const entityTypes = Array.isArray(entity[PROP_ENTITY_TYPE])\n ? entity[PROP_ENTITY_TYPE]\n : [entity[PROP_ENTITY_TYPE]];\n for (const type of entityTypes) {\n if (!groupedEntities[type]) {\n groupedEntities[type] = [];\n }\n groupedEntities[type].push(entity);\n }\n return groupedEntities;\n }, {});\n }\n\n private async getSuperClassesOfObject(object: string): Promise<Entity[]> {\n return await this.getParentsOfSelector(object);\n }\n\n private async getSuperClassesOfObjects(nouns: string[]): Promise<Entity[]> {\n return await this.getParentsOfSelector(In(nouns));\n }\n\n private async getParentsOfSelector(selector: string | FindOperator<any, any>): Promise<Entity[]> {\n return await this.findAll({\n where: {\n id: InversePath({\n subPath: OneOrMorePath({ subPath: RDFS.subClassOf as string }),\n value: selector\n })\n }\n });\n }\n\n private async validateEntityConformsToObjectSchema(entity: Entity): Promise<void> {\n const nounIds = Array.isArray(entity[PROP_ENTITY_TYPE]) ? entity[PROP_ENTITY_TYPE] : [entity[PROP_ENTITY_TYPE]];\n const directObjects = await this.findAllBy({ id: In(nounIds) });\n if (directObjects.length > 0) {\n const existingObjectIds = directObjects.map((object): string => object[PROP_ENTITY_ID]);\n const parentObjects = await this.getSuperClassesOfObjects(existingObjectIds);\n for (const currentObject of [...directObjects, ...parentObjects]) {\n const nounSchemaWithTarget = {\n ...currentObject,\n [SHACL.targetNode]: { [PROP_ENTITY_ID]: entity[PROP_ENTITY_ID] }\n };\n const report = await this.convertToQuadsAndValidateAgainstShape(entity, nounSchemaWithTarget);\n if (!report.conforms) {\n this.throwValidationReportError(\n report,\n `Entity ${entity[PROP_ENTITY_ID]} does not conform to the ${currentObject[PROP_ENTITY_ID]} schema.`\n );\n }\n }\n }\n }\n\n private async validateEntitiesWithIdsConformsToObjectSchemaForAttributes(\n ids: string[],\n attributes: Partial<Entity>\n ): Promise<void> {\n for (const id of ids) {\n await this.validateEntityWithIdConformsToObjectSchemaForAttributes(id, attributes);\n }\n }\n\n private async getObjectsAndParentObjectsOfEntity(id: string): Promise<Entity[]> {\n return await this.findAllBy({\n id: InversePath({\n subPath: SequencePath({\n subPath: [RDF.type, ZeroOrMorePath({ subPath: RDFS.subClassOf as string })]\n }),\n value: id\n })\n });\n }\n\n private async validateEntityWithIdConformsToObjectSchemaForAttributes(\n id: string,\n attributes: Partial<Entity>\n ): Promise<void> {\n const nouns = await this.getObjectsAndParentObjectsOfEntity(id);\n for (const currentObject of nouns) {\n if (SHACL.property in currentObject) {\n const nounProperties = ensureArray(currentObject[SHACL.property] as OrArray<NodeObject>).filter(\n (property): boolean => {\n const path = property[SHACL.path];\n if (typeof path === 'string' && path in attributes) {\n return true;\n }\n if (typeof path === 'object' && PROP_ENTITY_ID in path! && (path[PROP_ENTITY_ID] as string) in attributes) {\n return true;\n }\n return false;\n }\n );\n if (nounProperties.length > 0) {\n const nounSchemaWithTarget = {\n [PROP_ENTITY_TYPE]: SHACL.NodeShape,\n [SHACL.targetNode]: { [PROP_ENTITY_ID]: id },\n [SHACL.property]: nounProperties\n };\n const attributesWithId = { ...attributes, [PROP_ENTITY_ID]: id };\n const report = await this.convertToQuadsAndValidateAgainstShape(attributesWithId, nounSchemaWithTarget);\n if (!report.conforms) {\n this.throwValidationReportError(\n report,\n `Entity ${id} does not conform to the ${currentObject[PROP_ENTITY_ID]} schema.`\n );\n }\n }\n }\n }\n }\n\n public async delete(id: string, options?: WriteOptions): Promise<void>;\n public async delete(ids: string[], options?: WriteOptions): Promise<void>;\n public async delete(idOrIds: string | string[], options?: WriteOptions): Promise<void> {\n return PerformanceLogger.withSpanRoot('SklEngine.delete', async() => {\n const idArray = Array.isArray(idOrIds) ? idOrIds : [idOrIds];\n\n await globalHooks.execute(HookTypes.DELETE, HookStages.BEFORE, {\n entities: [],\n operation: 'delete',\n operationParameters: { idArray },\n sklEngine: this,\n bypassHooks: options?.bypassHooks\n });\n\n try {\n await this.queryAdapter.delete(idArray);\n\n await globalHooks.execute(HookTypes.DELETE, HookStages.AFTER, {\n entities: [],\n operation: 'delete',\n operationParameters: { idArray },\n sklEngine: this,\n bypassHooks: options?.bypassHooks\n });\n } catch (error) {\n await globalHooks.execute(HookTypes.DELETE, HookStages.ERROR, {\n entities: [],\n operation: 'delete',\n operationParameters: { idArray },\n sklEngine: this,\n bypassHooks: options?.bypassHooks\n }, error);\n throw error;\n }\n }, { idCount: Array.isArray(idOrIds) ? idOrIds.length : 1 });\n }\n\n public async destroy(entity: Entity): Promise<Entity>;\n public async destroy(entities: Entity[]): Promise<Entity[]>;\n public async destroy(entityOrEntities: Entity | Entity[]): Promise<Entity | Entity[]> {\n if (Array.isArray(entityOrEntities)) {\n return await this.queryAdapter.destroy(entityOrEntities);\n }\n return await this.queryAdapter.destroy(entityOrEntities);\n }\n\n public async destroyAll(): Promise<void> {\n return await this.queryAdapter.destroyAll();\n }\n\n public async performMapping(\n args: JSONValue,\n mapping: OrArray<NodeObject>,\n frame?: Record<string, any>,\n capabilityConfig?: CapabilityConfig,\n jsExecutionOptions?: ExecutionOptions\n ): Promise<NodeObject> {\n const mappingArray = ensureArray(mapping);\n const codeBlocks = mappingArray.filter(\n (mappingItem: NodeObject): boolean =>\n mappingItem[PROP_ENTITY_TYPE] === EngineConstants.spec.codeBlock &&\n this.isJavaScriptCode(getValueIfDefined(mappingItem[EngineConstants.prop.codeBody])!)\n );\n // FIXME: Handle if we can combine the codeb blocks with triples map.\n // As of now if there is any code block, triples map does not get executed.\n if (codeBlocks.length > 0) {\n return await this.executeCodeBlocks(codeBlocks, args, jsExecutionOptions ?? {});\n }\n\n const functions = {\n ...this.functions,\n ...capabilityConfig?.functions\n };\n const mapper = new Mapper({ functions });\n return await mapper.apply(args, mapping, frame ?? {});\n }\n\n public async executeTrigger(integration: string, payload: any): Promise<void> {\n const triggerToCapabilityMapping = await this.findTriggerCapabilityMapping(integration);\n const capabilityArgs = await this.performParameterMappingOnArgsIfDefined(\n payload,\n triggerToCapabilityMapping as Partial<MappingWithInputs> | Partial<MappingWithInputsReference>\n );\n const capabilityId = await this.performCapabilityMappingWithArgs(payload, triggerToCapabilityMapping);\n if (capabilityId) {\n const mappedCapability = (await this.findBy({ id: capabilityId })) as Capability;\n await this.executeCapability(mappedCapability, capabilityArgs);\n }\n }\n\n private async findTriggerCapabilityMapping(integration: string): Promise<TriggerMapping> {\n const triggerCapabilityMappingNew = (await this.findBy(\n {\n type: EngineConstants.spec.capabilityMapping,\n [EngineConstants.prop.capability]: integration,\n [EngineConstants.prop.capabilityType]: EngineConstants.spec.triggerCapabilityMapping\n },\n `Failed to find a Trigger Capability mapping for integration ${integration}`\n )) as TriggerMapping;\n if (triggerCapabilityMappingNew) {\n return triggerCapabilityMappingNew;\n }\n throw new Error(`Failed to find a Trigger Capability mapping for integration ${integration}`);\n }\n\n private async executeCapabilityByName(\n capabilityName: string,\n capabilityArgs: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n const capability = await this.findCapabilityWithName(capabilityName);\n return await this.executeCapability(capability, capabilityArgs, capabilityConfig);\n }\n\n private async findCapabilityWithName(capabilityName: string): Promise<Capability> {\n return (await this.findBy(\n { type: EngineConstants.spec.capability, [EngineConstants.prop.label]: capabilityName },\n `Failed to find the capability ${capabilityName} in the schema.`\n )) as Capability;\n }\n\n public async executeCapability(\n capability: Capability,\n capabilityArgs: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n this.globalCallbacks?.onCapabilityStart?.(capability[PROP_ENTITY_ID], capabilityArgs);\n if (capabilityConfig?.callbacks?.onCapabilityStart) {\n this.logger.debug('Capability arguments', capabilityArgs);\n capabilityConfig.callbacks.onCapabilityStart(capability[PROP_ENTITY_ID], capabilityArgs);\n }\n const { mapping, account } = await this.findMappingForCapabilityContextually(\n capability[PROP_ENTITY_ID],\n capabilityArgs\n );\n this.logger.debug('Mapping', JSON.stringify(mapping));\n const shouldValidate = this.shouldValidate(capabilityConfig);\n if (shouldValidate) {\n await this.assertCapabilityParamsMatchParameterSchemas(capabilityArgs, capability);\n }\n\n try {\n // Execute capability mapping before hook if appropriate -\n // works for any mapping that can be used as a verb mapping\n if (mapping) {\n await globalHooks.executeBeforeExecuteCapabilityMapping([capabilityArgs] as Entity[], mapping, { sklEngine: this });\n }\n\n const verbReturnValue = await this.executeMapping(mapping, capabilityArgs, capabilityConfig, account);\n\n if (shouldValidate) {\n await this.assertCapabilityReturnValueMatchesReturnTypeSchema(verbReturnValue, capability);\n }\n\n // Execute capability mapping after hook if appropriate\n if (mapping) {\n await globalHooks.executeAfterExecuteCapabilityMapping([capabilityArgs] as Entity[], mapping, verbReturnValue, { sklEngine: this });\n }\n\n this.globalCallbacks?.onCapabilityEnd?.(capability[PROP_ENTITY_ID], verbReturnValue);\n if (capabilityConfig?.callbacks?.onCapabilityEnd) {\n capabilityConfig.callbacks.onCapabilityEnd(capability[PROP_ENTITY_ID], verbReturnValue);\n }\n\n return verbReturnValue;\n } catch (error) {\n // Execute capability mapping error hook if appropriate\n if (mapping) {\n await globalHooks.executeErrorExecuteCapabilityMapping([capabilityArgs] as Entity[], mapping, error as Error, { sklEngine: this });\n }\n throw error;\n }\n }\n\n private async findMappingForCapabilityContextually(\n capabilityId: string,\n args: JSONObject\n ): Promise<{ mapping: CapabilityMapping; account?: Entity }> {\n if (args.mapping) {\n const mapping = await this.findByIfExists({ id: args.mapping as string });\n if (!mapping) {\n throw new Error(`Mapping ${args.mapping as string} not found.`);\n }\n return { mapping: mapping as CapabilityMapping };\n }\n if (args.object) {\n const mapping = await this.findCapabilityObjectMapping(capabilityId, args.object as string);\n if (mapping) {\n return { mapping };\n }\n }\n if (args.account) {\n const account = await this.findBy({ id: args.account as string });\n const integratedProductId = (account[EngineConstants.prop.integration] as ReferenceNodeObject)[PROP_ENTITY_ID];\n const mapping = await this.findCapabilityIntegrationMapping(capabilityId, integratedProductId);\n if (mapping) {\n return { mapping, account };\n }\n }\n\n const mappings = await this.findAllBy({\n type: EngineConstants.spec.capabilityMapping,\n [EngineConstants.prop.capability]: capabilityId,\n [EngineConstants.prop.integration]: Not(Exists()),\n [EngineConstants.prop.object]: Not(Exists())\n });\n if (mappings.length === 1) {\n return { mapping: mappings[0] as CapabilityMapping };\n }\n if (mappings.length > 1) {\n throw new Error('Multiple mappings found for capability, please specify one.');\n }\n if (args.object) {\n throw new Error(`Mapping between object ${args.object as string} and capability ${capabilityId} not found.`);\n }\n if (args.account) {\n throw new Error(`Mapping between account ${args.account as string} and capability ${capabilityId} not found.`);\n }\n throw new Error(`No mapping found.`);\n }\n\n public async executeMapping(\n mapping: Mapping,\n args: JSONObject,\n capabilityConfig?: CapabilityConfig,\n account?: Entity\n ): Promise<OrArray<NodeObject>> {\n args = await this.addPreProcessingMappingToArgs(mapping, args, capabilityConfig);\n let returnValue: OrArray<NodeObject>;\n // If (EngineConstants.prop.capability in mapping || EngineConstants.prop.capabilityMapping in mapping) {\n // const capabilityId = await this.performCapabilityMappingWithArgs(args, mapping, capabilityConfig);\n // const mappedArgs = await this.performParameterMappingOnArgsIfDefined(\n // { ...args, capabilityId },\n // mapping as MappingWithInputs,\n // capabilityConfig\n // );\n // Logger.getInstance().log('Mapped args', mappedArgs);\n // returnValue = await this.executeCapabilityMapping(mapping, args, mappedArgs, capabilityConfig);\n // } else {\n const mappedArgs = await this.performParameterMappingOnArgsIfDefined(\n args,\n mapping as MappingWithInputs,\n capabilityConfig\n );\n this.logger.debug('Mapped args', mappedArgs);\n if (EngineConstants.prop.operationId in mapping || EngineConstants.prop.operationMapping in mapping) {\n returnValue = (await this.executeOperationMapping(\n mapping,\n mappedArgs,\n args,\n account!,\n capabilityConfig\n )) as NodeObject;\n } else if (EngineConstants.prop.series in mapping) {\n returnValue = await this.executeSeriesMapping(mapping as MappingWithSeries, mappedArgs, capabilityConfig);\n } else if (EngineConstants.prop.parallel in mapping) {\n returnValue = await this.executeParallelMapping(mapping as MappingWithParallel, mappedArgs, capabilityConfig);\n } else {\n returnValue = mappedArgs;\n }\n // }\n return await this.performReturnValueMappingWithFrameIfDefined(\n returnValue as JSONValue,\n mapping as MappingWithOutputsMapping,\n capabilityConfig\n );\n }\n\n private shouldValidate(capabilityConfig?: CapabilityConfig): boolean {\n return capabilityConfig?.disableValidation === undefined\n ? this.disableValidation !== true\n : !capabilityConfig.disableValidation;\n }\n\n private async executeOperationMapping(\n mapping: Mapping,\n mappedArgs: JSONObject,\n originalArgs: JSONObject,\n account: Entity,\n capabilityConfig?: CapabilityConfig\n ): Promise<OperationResponse | OrArray<NodeObject>> {\n const integration = (mapping as CapabilityMapping)[EngineConstants.prop.integration]?.[PROP_ENTITY_ID];\n\n // If the mapping has an integration, it means that the operation is an integration operation\n if (integration) {\n const operationInfo = await this.performOperationMappingWithArgs(originalArgs, mapping, capabilityConfig);\n const response = await this.performOperation(operationInfo, mappedArgs, originalArgs, account, capabilityConfig);\n if (!this.ifCapabilityStreaming(capabilityConfig)) {\n this.logger.debug('Original response', JSON.stringify(response));\n }\n return response;\n }\n // If the mapping does not have an integration, it means that the operation is a capability operation\n return await this.executeCapabilityMapping(mapping, originalArgs, mappedArgs, capabilityConfig);\n }\n\n private async executeSeriesMapping(\n mapping: MappingWithSeries,\n args: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n const seriesCapabilityMappingsList = this.rdfListToArray(mapping[EngineConstants.prop.series]!);\n const seriesCapabilityArgs = {\n originalCapabilityParameters: args,\n previousCapabilityReturnValue: {},\n allStepsResults: []\n };\n\n return await this.executeSeriesFromList(seriesCapabilityMappingsList, seriesCapabilityArgs, capabilityConfig);\n }\n\n private rdfListToArray(list: { [RML_LIST]: CapabilityMapping[] } | RdfList<CapabilityMapping>): CapabilityMapping[] {\n if (!(RML_LIST in list)) {\n return [\n list[RDF.first],\n ...getIdFromNodeObjectIfDefined(list[RDF.rest] as ReferenceNodeObject) === RDF.nil\n ? []\n : this.rdfListToArray(list[RDF.rest] as RdfList<CapabilityMapping>)\n ];\n }\n return list[RML_LIST];\n }\n\n private async executeSeriesFromList(\n list: Mapping[],\n args: SeriesCapabilityArgs,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n const nextCapabilityMapping = list[0];\n const returnValue = await this.executeMapping(nextCapabilityMapping, args, capabilityConfig);\n if (list.length > 1) {\n return await this.executeSeriesFromList(\n list.slice(1),\n {\n ...args,\n previousCapabilityReturnValue: returnValue as JSONObject,\n allStepsResults: [...args.allStepsResults ?? [], returnValue as JSONObject]\n },\n capabilityConfig\n );\n }\n return returnValue;\n }\n\n private async executeCapabilityMapping(\n capabilityMapping: Mapping,\n originalArgs: JSONObject,\n mappedArgs: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n const capabilityId = await this.performCapabilityMappingWithArgs(originalArgs, capabilityMapping, capabilityConfig);\n if (capabilityId) {\n if (capabilityId === EngineConstants.dataSource.update) {\n await this.updateEntityFromcapabilityArgs(mappedArgs);\n return {};\n }\n if (capabilityId === EngineConstants.dataSource.save) {\n return await this.saveEntityOrEntitiesFromcapabilityArgs(mappedArgs);\n }\n if (capabilityId === EngineConstants.dataSource.destroy) {\n return await this.destroyEntityOrEntitiesFromcapabilityArgs(mappedArgs);\n }\n if (capabilityId === EngineConstants.dataSource.findAll) {\n return await this.findAll(mappedArgs);\n }\n if (capabilityId === EngineConstants.dataSource.find) {\n return await this.find(mappedArgs);\n }\n if (capabilityId === EngineConstants.dataSource.count) {\n return await this.countAndWrapValueFromcapabilityArgs(mappedArgs);\n }\n if (capabilityId === EngineConstants.dataSource.exists) {\n return await this.existsAndWrapValueFromcapabilityArgs(mappedArgs);\n }\n if (capabilityId === 'https://skl.ai/capability/execute-code') {\n const codeBlocks = ensureArray((capabilityMapping[EngineConstants.prop.codeBlocks] as any[]) ?? []).filter(\n (mappingItem: any): boolean =>\n mappingItem[PROP_ENTITY_TYPE] === EngineConstants.spec.codeBlock &&\n this.isJavaScriptCode(getValueIfDefined(mappingItem[EngineConstants.prop.codeBody])!)\n );\n return await this.executeCodeBlocks(codeBlocks, mappedArgs, {});\n }\n\n // Check for custom capabilities\n if (globalCustomCapabilities.has(capabilityId)) {\n return await globalCustomCapabilities.execute(capabilityId, mappedArgs, this, capabilityConfig);\n }\n\n return await this.findAndExecuteCapability(capabilityId, mappedArgs, capabilityConfig);\n }\n return {};\n }\n\n private async addPreProcessingMappingToArgs(\n capabilityMapping: Mapping,\n args: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<JSONObject> {\n if (EngineConstants.prop.preProcessingMapping in capabilityMapping) {\n const preMappingArgs = await this.performMapping(\n args,\n capabilityMapping[EngineConstants.prop.preProcessingMapping] as NodeObject,\n getValueIfDefined(capabilityMapping[EngineConstants.prop.preProcessingMappingFrame]),\n capabilityConfig\n );\n return { ...args, preProcessedParameters: preMappingArgs as JSONObject };\n }\n return args;\n }\n\n private replaceTypeAndId(entity: Record<string, any>): Record<string, any> {\n if (typeof entity !== 'object') {\n throw new Error('Entity is not an object');\n }\n const clonedEntity = structuredClone(entity);\n if (clonedEntity[EngineConstants.prop.type]) {\n clonedEntity[PROP_ENTITY_TYPE] = clonedEntity[EngineConstants.prop.type];\n }\n if (clonedEntity[EngineConstants.prop.identifier]) {\n clonedEntity[PROP_ENTITY_ID] = SKL_DATA_NAMESPACE + (clonedEntity[EngineConstants.prop.identifier] as string);\n }\n return clonedEntity;\n }\n\n private async updateEntityFromcapabilityArgs(args: Record<string, any>): Promise<void> {\n let ids = args.id ?? args.ids;\n if (!Array.isArray(ids)) {\n ids = [ids];\n }\n // FIX: Temporary fix for the issue where the id always getting prefixed with the namespace\n ids = ids.map((id: string) => (id.startsWith('http') ? id : `${SKL_DATA_NAMESPACE}${id}`));\n await this.update(ids, args.attributes);\n }\n\n private async saveEntityOrEntitiesFromcapabilityArgs(args: Record<string, any>): Promise<OrArray<Entity>> {\n if (args.entity && typeof args.entity === 'object') {\n args.entity = this.replaceTypeAndId(args.entity);\n }\n if (args.entities && Array.isArray(args.entities)) {\n args.entities = args.entities.map(this.replaceTypeAndId);\n }\n return await this.save(args.entity ?? args.entities);\n }\n\n private async destroyEntityOrEntitiesFromcapabilityArgs(args: Record<string, any>): Promise<OrArray<Entity>> {\n if (args.entity && typeof args.entity === 'object') {\n args.entity = this.replaceTypeAndId(args.entity);\n }\n if (args.entities && Array.isArray(args.entities)) {\n args.entities = args.entities.map(this.replaceTypeAndId);\n }\n return await this.destroy(args.entity ?? args.entities);\n }\n\n private async countAndWrapValueFromcapabilityArgs(args: Record<string, any>): Promise<NodeObject> {\n const count = await this.count(args);\n return {\n [EngineConstants.dataSource.countResult]: {\n [PROP_ENTITY_VALUE]: count,\n [PROP_ENTITY_TYPE]: XSD.integer\n }\n };\n }\n\n private async existsAndWrapValueFromcapabilityArgs(args: Record<string, any>): Promise<NodeObject> {\n const exists = await this.exists(args);\n return {\n [EngineConstants.dataSource.existsResult]: {\n [PROP_ENTITY_VALUE]: exists,\n [PROP_ENTITY_TYPE]: XSD.boolean\n }\n };\n }\n\n public async findAndExecuteCapability(\n capabilityId: string,\n args: Record<string, any>,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n const capability = (await this.findBy({ id: capabilityId })) as Capability;\n return await this.executeCapability(capability, args, capabilityConfig);\n }\n\n private async executeParallelMapping(\n mapping: MappingWithParallel,\n args: JSONObject,\n capabilityConfig?: CapabilityConfig\n ): Promise<NodeObject[]> {\n const parallelCapabilityMappings = ensureArray(\n mapping[EngineConstants.prop.parallel] as unknown as OrArray<CapabilityMapping>\n );\n const nestedReturnValues = await Promise.all<Promise<OrArray<NodeObject>>>(\n parallelCapabilityMappings.map(\n (capabilityMapping): Promise<OrArray<NodeObject>> =>\n this.executeMapping(capabilityMapping, args, capabilityConfig)\n )\n );\n return nestedReturnValues.flat();\n }\n\n private async findCapabilityIntegrationMapping(\n capabilityId: string,\n integratedProductId: string\n ): Promise<CapabilityMapping | undefined> {\n return (await this.findByIfExists({\n type: EngineConstants.spec.capabilityMapping,\n [EngineConstants.prop.capability]: capabilityId,\n [EngineConstants.prop.integration]: integratedProductId\n })) as CapabilityMapping;\n }\n\n private async performOperationMappingWithArgs(\n args: JSONValue,\n mapping: Mapping,\n capabilityConfig?: CapabilityConfig\n ): Promise<NodeObject> {\n if (mapping[EngineConstants.prop.operationId]) {\n return { [EngineConstants.prop.operationId]: mapping[EngineConstants.prop.operationId] };\n }\n if (mapping[EngineConstants.prop.dataSource]) {\n return { [EngineConstants.prop.dataSource]: mapping[EngineConstants.prop.dataSource] };\n }\n return await this.performMapping(\n args,\n mapping[EngineConstants.prop.operationMapping] as OrArray<NodeObject>,\n undefined,\n capabilityConfig\n );\n }\n\n private async performOperation(\n operationInfo: NodeObject,\n operationArgs: JSONObject,\n originalArgs: JSONObject,\n account: Entity,\n capabilityConfig?: CapabilityConfig,\n securityCredentials?: Entity\n ): Promise<OperationResponse> {\n if (operationInfo[EngineConstants.prop.schemeName]) {\n return await this.performOauthSecuritySchemeStageWithCredentials(\n operationInfo,\n operationArgs,\n account,\n securityCredentials\n );\n }\n if (operationInfo[EngineConstants.prop.dataSource]) {\n return await this.getDataFromDataSource(\n getIdFromNodeObjectIfDefined(operationInfo[EngineConstants.prop.dataSource] as string | ReferenceNodeObject)!,\n capabilityConfig\n );\n }\n if (operationInfo[EngineConstants.prop.operationId]) {\n const response = await this.performOpenapiOperationWithCredentials(\n getValueIfDefined(operationInfo[EngineConstants.prop.operationId])!,\n operationArgs,\n account,\n capabilityConfig\n );\n return this.axiosResponseAndParamsToOperationResponse(response, operationArgs, originalArgs);\n }\n throw new Error('Operation not supported.');\n }\n\n private axiosResponseAndParamsToOperationResponse(\n response: AxiosResponse,\n operationParameters: JSONObject,\n originalArgs: JSONObject\n ): OperationResponse {\n return {\n operationParameters,\n originalCapabilityParameters: originalArgs,\n data: response.data,\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n config: {\n headers: response.config.headers,\n method: response.config.method,\n url: response.config.url,\n data: response.config.data\n } as JSONObject\n };\n }\n\n private async performReturnValueMappingWithFrameIfDefined(\n returnValue: JSONValue,\n mapping: MappingWithOutputsMapping,\n capabilityConfig?: CapabilityConfig\n ): Promise<NodeObject> {\n if (EngineConstants.prop.outputsMapping in mapping) {\n return await this.performMapping(\n returnValue,\n mapping[EngineConstants.prop.outputsMapping],\n getValueIfDefined<JSONObject>(mapping[EngineConstants.prop.outputsMappingFrame]),\n capabilityConfig\n );\n }\n return returnValue as NodeObject;\n }\n\n private async performParameterMappingOnArgsIfDefined(\n args: JSONObject,\n mapping: Partial<MappingWithInputs> | Partial<MappingWithInputsReference>,\n capabilityConfig?: CapabilityConfig,\n convertToJsonDeep = false\n ): Promise<Record<string, any>> {\n if (EngineConstants.prop.inputsReference in mapping) {\n const reference = getValueIfDefined<string>(mapping[EngineConstants.prop.inputsReference])!;\n return this.getDataAtReference(reference, args);\n }\n\n if (EngineConstants.prop.inputsMappingRef in mapping) {\n const reference = getValueIfDefined<string>(mapping[EngineConstants.prop.inputsMappingRef])!;\n const referencedMapping = this.getDataAtReference(reference, args);\n\n if (!referencedMapping || referencedMapping?.length === 0) {\n return args;\n }\n\n // Handle inputsMappingFrameRef if present\n let frame;\n if (EngineConstants.prop.inputsMappingFrameRef in mapping) {\n const frameReference = getValueIfDefined<string>(mapping[EngineConstants.prop.inputsMappingFrameRef])!;\n frame = this.getDataAtReference(frameReference, args);\n } else {\n // Use direct frame if provided\n frame = getValueIfDefined(mapping[EngineConstants.prop.inputsMappingFrame]);\n }\n\n // Perform mapping with the referenced mapping and frame\n const mappedData = await this.performMapping(args, referencedMapping, frame, capabilityConfig);\n return toJSON(mappedData, convertToJsonDeep);\n }\n\n if (EngineConstants.prop.inputsMapping in mapping) {\n const mappedData = await this.performMapping(\n args,\n (mapping as MappingWithInputs)[EngineConstants.prop.inputsMapping]!,\n getValueIfDefined(mapping[EngineConstants.prop.inputsMappingFrame]),\n capabilityConfig\n );\n return toJSON(mappedData, convertToJsonDeep);\n }\n return args;\n }\n\n private getDataAtReference(reference: string, data: JSONObject): any {\n const results = JSONPath({\n path: reference,\n json: data,\n resultType: 'value'\n });\n const isArrayOfLengthOne = Array.isArray(results) && results.length === 1;\n let result = isArrayOfLengthOne ? results[0] : results;\n if (result && typeof result === 'object' && PROP_ENTITY_VALUE in result) {\n result = result[PROP_ENTITY_VALUE];\n }\n return result;\n }\n\n private async getIntegrationInterface(\n integratedProductId: string,\n integrationType = EngineConstants.spec.integrationInterface\n ): Promise<Entity | null> {\n if (integrationType === EngineConstants.spec.integrationInterface) {\n const integrationInterface = await this.findBy({\n type: integrationType,\n [EngineConstants.prop.type]: EngineConstants.spec.openApi,\n [EngineConstants.prop.integration]: integratedProductId\n });\n return integrationInterface;\n }\n // Add support for other integration types\n return null;\n }\n\n private async findSecurityCredentialsForAccountIfDefined(accountId: string): Promise<Entity | undefined> {\n return await this.findByIfExists({\n type: EngineConstants.spec.integrationAuthenticationCredential,\n [EngineConstants.prop.accountOrUser]: accountId\n });\n }\n\n private async findgetOpenApiRuntimeAuthorizationCapabilityIfDefined(): Promise<Capability | undefined> {\n return (await this.findByIfExists({\n type: EngineConstants.spec.capability,\n [EngineConstants.prop.label]: OPEN_API_RUNTIME_AUTHORIZATION\n })) as Capability;\n }\n\n private async findRefreshCapabilityForIntegration(integrationId: string): Promise<Capability> {\n const integration = await this.findByIfExists({ id: integrationId });\n const configuredRefreshCapability = integration?.[EngineConstants.prop.refreshCapability];\n if (configuredRefreshCapability) {\n const refreshCapabilityId = getIdFromNodeObjectIfDefined(\n configuredRefreshCapability as string | ReferenceNodeObject\n );\n if (!refreshCapabilityId) {\n throw new Error(`Integration ${integrationId} has an invalid refresh capability reference.`);\n }\n const refreshCapability = (await this.findByIfExists({ id: refreshCapabilityId })) as Capability | undefined;\n if (!refreshCapability) {\n throw new Error(\n `Refresh capability ${refreshCapabilityId} configured for integration ${integrationId} was not found.`\n );\n }\n return refreshCapability;\n }\n return await this.findCapabilityWithName('getOauthTokens');\n }\n\n private async getRuntimeCredentialsWithSecurityCredentials(\n securityCredentials: Entity,\n integrationId: string,\n openApiOperationInformation: OperationWithPathInfo,\n operationArgs: JSONObject\n ): Promise<JSONObject> {\n const getOpenApiRuntimeAuthorizationCapability = await this.findgetOpenApiRuntimeAuthorizationCapabilityIfDefined();\n if (!getOpenApiRuntimeAuthorizationCapability) {\n return {};\n }\n const mapping = await this.findCapabilityIntegrationMapping(\n getOpenApiRuntimeAuthorizationCapability[PROP_ENTITY_ID],\n integrationId\n );\n if (!mapping) {\n return {};\n }\n const args = {\n securityCredentials,\n openApiExecutorOperationWithPathInfo: openApiOperationInformation,\n operationArgs\n } as JSONObject;\n const operationInfoJsonLd = await this.performParameterMappingOnArgsIfDefined(args, mapping, undefined, true);\n const headers = getValueIfDefined<JSONObject>(operationInfoJsonLd[EngineConstants.prop.headers]);\n return headers ?? {};\n }\n\n private async createOpenApiOperationExecutorWithSpec(openApiDescription: OpenApi): Promise<OpenApiOperationExecutor> {\n const executor = new OpenApiOperationExecutor();\n await executor.setOpenapiSpec(openApiDescription);\n return executor;\n }\n\n private async findCapabilityObjectMapping(capabilityId: string, object: string): Promise<CapabilityMapping> {\n return (await this.findByIfExists({\n type: EngineConstants.spec.capabilityMapping,\n [EngineConstants.prop.capability]: capabilityId,\n [EngineConstants.prop.object]: InversePath({\n subPath: ZeroOrMorePath({ subPath: RDFS.subClassOf as string }),\n value: object\n })\n })) as CapabilityMapping;\n }\n\n private async performCapabilityMappingWithArgs(\n args: JSONValue,\n mapping: Mapping,\n capabilityConfig?: CapabilityConfig\n ): Promise<string | undefined> {\n if (mapping[EngineConstants.prop.operationId]) {\n return getValueIfDefined<string>(mapping[EngineConstants.prop.operationId])!;\n }\n if (mapping[EngineConstants.prop.operationId]) {\n return getValueIfDefined<string>(mapping[EngineConstants.prop.operationId])!;\n }\n const capabilityInfoJsonLd = await this.performMapping(\n args,\n mapping[EngineConstants.prop.operationMapping] as NodeObject,\n undefined,\n capabilityConfig\n );\n return getValueIfDefined<string>(capabilityInfoJsonLd[EngineConstants.prop.operationId])!;\n }\n\n private async assertCapabilityParamsMatchParameterSchemas(\n capabilityParams: any,\n capability: Capability\n ): Promise<void> {\n let parametersSchemaObject = capability[EngineConstants.prop.inputs];\n if (parametersSchemaObject?.[PROP_ENTITY_ID] && Object.keys(parametersSchemaObject).length === 1) {\n parametersSchemaObject = await this.findBy({ id: parametersSchemaObject[PROP_ENTITY_ID] });\n }\n if (capabilityParams && parametersSchemaObject) {\n const capabilityParamsAsJsonLd = {\n '@context': getValueIfDefined<ContextDefinition>(capability[EngineConstants.prop.inputsContext]),\n [PROP_ENTITY_TYPE]: EngineConstants.spec.inputs,\n ...capabilityParams\n };\n const report = await this.convertToQuadsAndValidateAgainstShape(capabilityParamsAsJsonLd, parametersSchemaObject);\n if (!report.conforms) {\n this.throwValidationReportError(\n report,\n `${getValueIfDefined(capability[EngineConstants.prop.label])} parameters do not conform to the schema`\n );\n }\n }\n }\n\n private async performOpenapiOperationWithCredentials(\n operationId: string,\n operationArgs: JSONObject,\n account: Entity,\n capabilityConfig?: CapabilityConfig\n ): Promise<AxiosResponse> {\n const integratedProductId = (account[EngineConstants.prop.integration] as ReferenceNodeObject)[PROP_ENTITY_ID];\n const restAPIInterface = await this.getIntegrationInterface(integratedProductId);\n if (!restAPIInterface) {\n throw new Error(`No integration interface found for integrated product ${integratedProductId}`);\n }\n const openApiDescription = getValueIfDefined<OpenApi>(\n restAPIInterface[EngineConstants.prop.declarativeApiDescription]\n )!;\n const openApiExecutor = await this.createOpenApiOperationExecutorWithSpec(openApiDescription);\n // eslint-disable-next-line @typescript-eslint/await-thenable\n const openApiOperationInformation = await openApiExecutor.getOperationWithPathInfoMatchingOperationId(operationId);\n const securityCredentials = await this.findSecurityCredentialsForAccountIfDefined(account[PROP_ENTITY_ID]);\n let runtimeAuthorization: JSONObject = {};\n if (securityCredentials) {\n const generatedRuntimeCredentials = await this.getRuntimeCredentialsWithSecurityCredentials(\n securityCredentials,\n integratedProductId,\n openApiOperationInformation,\n operationArgs\n );\n if (generatedRuntimeCredentials && Object.keys(generatedRuntimeCredentials).length > 0) {\n runtimeAuthorization = generatedRuntimeCredentials;\n }\n }\n const apiKey = [\n getValueIfDefined<string>(securityCredentials?.[EngineConstants.prop.apiKey]),\n this.getAuthorizationHeaderFromRuntimeCredentials(runtimeAuthorization)\n ].find(Boolean);\n const configuration = {\n accessToken: getValueIfDefined<string>(securityCredentials?.[EngineConstants.prop.accessToken]),\n bearerToken: getValueIfDefined<string>(securityCredentials?.[EngineConstants.prop.bearerToken]),\n apiKey,\n basePath: getValueIfDefined<string>(account[EngineConstants.prop.overrideBasePath]),\n username: getValueIfDefined<string>(securityCredentials?.[EngineConstants.prop.username]),\n password: getValueIfDefined<string>(securityCredentials?.[EngineConstants.prop.password])\n };\n let response;\n let executeOperationOptions: AxiosRequestConfig | undefined;\n try {\n const additionalHeaders = this.getHeadersFromRuntimeCredentials(runtimeAuthorization) as any;\n if (\n additionalHeaders &&\n typeof additionalHeaders === 'object' &&\n !Array.isArray(additionalHeaders) &&\n Object.keys(additionalHeaders).length > 0\n ) {\n executeOperationOptions = { headers: additionalHeaders };\n }\n if (this.ifCapabilityStreaming(capabilityConfig)) {\n executeOperationOptions = {\n ...executeOperationOptions,\n responseType: 'stream'\n };\n } else if (this.ifCapabilityBuffering(capabilityConfig)) {\n executeOperationOptions = {\n ...executeOperationOptions,\n responseType: 'arraybuffer'\n };\n }\n response = await openApiExecutor.executeOperation(\n operationId,\n configuration,\n operationArgs,\n executeOperationOptions\n );\n } catch (error: unknown) {\n if (\n axios.isAxiosError(error) &&\n await this.isInvalidTokenError(error, integratedProductId) &&\n securityCredentials\n ) {\n const refreshedConfiguration = await this.refreshSecurityCredentials(\n securityCredentials,\n integratedProductId,\n account,\n capabilityConfig\n );\n response = await openApiExecutor.executeOperation(\n operationId,\n refreshedConfiguration,\n operationArgs,\n executeOperationOptions\n );\n } else {\n throw error;\n }\n }\n return response;\n }\n\n private getHeadersFromRuntimeCredentials(runtimeCredentials: JSONObject): JSONObject {\n let returnValue: JSONObject = {};\n if (\n runtimeCredentials.headers &&\n typeof runtimeCredentials.headers === 'object' &&\n Object.keys(runtimeCredentials.headers).length > 0 &&\n !Array.isArray(runtimeCredentials.headers)\n ) {\n returnValue = runtimeCredentials.headers;\n }\n return returnValue;\n }\n\n private getAuthorizationHeaderFromRuntimeCredentials(runtimeCredentials: JSONObject): string | undefined {\n const headers = this.getHeadersFromRuntimeCredentials(runtimeCredentials);\n if (headers && 'Authorization' in headers) {\n const authorizationHeader = headers.Authorization;\n if (typeof authorizationHeader === 'string') {\n return authorizationHeader;\n }\n }\n return undefined;\n }\n\n private async isInvalidTokenError(error: AxiosError, integratedProductId: string): Promise<boolean> {\n const integrationInterface = await this.getIntegrationInterface(integratedProductId);\n if (!integrationInterface) {\n return false;\n }\n\n const errorMatcher = integrationInterface[EngineConstants.prop.invalidTokenErrorMatcher] as NodeObject;\n const errorMatcherStatus =\n errorMatcher && getValueIfDefined<string>(errorMatcher[EngineConstants.prop.invalidTokenErrorMatcherStatus]);\n const errorMatcherRegex =\n errorMatcher &&\n getValueIfDefined<string>(errorMatcher[EngineConstants.prop.invalidTokenErrorMatcherMessageRegex])!;\n if (errorMatcher && error.response?.status === errorMatcherStatus) {\n if (!errorMatcherRegex) {\n return true;\n }\n if (error.response?.statusText && new RegExp(errorMatcherRegex, 'u').test(error.response?.statusText)) {\n return true;\n }\n }\n\n return false;\n }\n\n private async refreshSecurityCredentials(\n securityCredentials: Entity,\n integrationId: string,\n account: Entity,\n capabilityConfig?: CapabilityConfig\n ): Promise<OpenApiClientConfiguration> {\n const refreshCapability = await this.findRefreshCapabilityForIntegration(integrationId);\n const mapping = await this.findCapabilityIntegrationMapping(refreshCapability[PROP_ENTITY_ID], integrationId);\n if (!mapping) {\n throw new Error(\n `No mapping found for capability ${refreshCapability[PROP_ENTITY_ID]} and integration ${integrationId}`\n );\n }\n const args = {\n refreshToken: getValueIfDefined<string>(securityCredentials[EngineConstants.prop.refreshToken])!,\n jwtBearerOptions: getValueIfDefined<string>(securityCredentials[EngineConstants.prop.jwtBearerOptions])!,\n securityCredentials: securityCredentials as unknown as JSONValue,\n account: account as unknown as JSONValue,\n integrationId\n } as JSONObject;\n const operationArgs = await this.performParameterMappingOnArgsIfDefined(args, mapping, capabilityConfig, true);\n const operationInfoJsonLd = await this.performOperationMappingWithArgs({}, mapping, capabilityConfig);\n const rawReturnValue = await this.performOperation(\n operationInfoJsonLd,\n operationArgs,\n args,\n account,\n capabilityConfig,\n securityCredentials\n );\n const mappedReturnValue = await this.performReturnValueMappingWithFrameIfDefined(\n rawReturnValue,\n mapping as MappingWithOutputsMapping,\n capabilityConfig\n );\n await this.assertCapabilityReturnValueMatchesReturnTypeSchema(mappedReturnValue, refreshCapability);\n const bearerToken = getValueIfDefined<string>(mappedReturnValue[EngineConstants.prop.bearerToken]);\n const accessToken = getValueIfDefined<string>(mappedReturnValue[EngineConstants.prop.accessToken]);\n const refreshToken = getValueIfDefined<string>(mappedReturnValue[EngineConstants.prop.refreshToken]);\n if (bearerToken) {\n securityCredentials[EngineConstants.prop.bearerToken] = bearerToken;\n }\n if (accessToken) {\n securityCredentials[EngineConstants.prop.accessToken] = accessToken;\n }\n if (refreshToken) {\n securityCredentials[EngineConstants.prop.refreshToken] = refreshToken;\n }\n await this.save(securityCredentials);\n return { accessToken, bearerToken };\n }\n\n private getOauthConfigurationFromSecurityCredentials(securityCredentialsSchema: Entity): OpenApiClientConfiguration {\n const username = getValueIfDefined<string>(securityCredentialsSchema[EngineConstants.prop.username]);\n const password = getValueIfDefined<string>(securityCredentialsSchema[EngineConstants.prop.password]);\n const accessToken = getValueIfDefined<string>(securityCredentialsSchema[EngineConstants.prop.accessToken]);\n return { username, password, accessToken };\n }\n\n private async assertCapabilityReturnValueMatchesReturnTypeSchema(\n returnValue: OrArray<NodeObject>,\n capability: Capability\n ): Promise<void> {\n let returnTypeSchemaObject = capability[EngineConstants.prop.outputs];\n if (returnTypeSchemaObject?.[PROP_ENTITY_ID] && Object.keys(returnTypeSchemaObject).length === 1) {\n returnTypeSchemaObject = await this.findBy({ id: returnTypeSchemaObject[PROP_ENTITY_ID] });\n }\n let report: ValidationReport | undefined;\n if (returnValue && returnTypeSchemaObject) {\n if (Array.isArray(returnValue)) {\n if (returnValue.some((valueItem): boolean => PROP_ENTITY_ID in valueItem)) {\n returnTypeSchemaObject[SHACL.targetNode] = returnValue.reduce(\n (nodes: ReferenceNodeObject[], outputItem): ReferenceNodeObject[] => {\n if (outputItem[PROP_ENTITY_ID]) {\n nodes.push({ [PROP_ENTITY_ID]: outputItem[PROP_ENTITY_ID] });\n }\n return nodes;\n },\n []\n );\n } else {\n const targetClasses = returnValue.reduce(\n (nodes: ReferenceNodeObject[], outputItem): ReferenceNodeObject[] => {\n if (outputItem[PROP_ENTITY_TYPE]) {\n const type = Array.isArray(outputItem[PROP_ENTITY_TYPE])\n ? outputItem[PROP_ENTITY_TYPE][0]\n : outputItem[PROP_ENTITY_TYPE];\n if (!nodes.includes({ [PROP_ENTITY_ID]: type })) {\n nodes.push({ [PROP_ENTITY_ID]: type });\n }\n }\n return nodes;\n },\n []\n );\n if (targetClasses.length > 0) {\n returnTypeSchemaObject[SHACL.targetClass] = targetClasses;\n }\n }\n report = await this.convertToQuadsAndValidateAgainstShape(returnValue, returnTypeSchemaObject);\n } else if (Object.keys(returnValue).length > 0) {\n if (returnValue[PROP_ENTITY_ID]) {\n returnTypeSchemaObject[SHACL.targetNode] = { [PROP_ENTITY_ID]: returnValue[PROP_ENTITY_ID] };\n } else if (returnValue[PROP_ENTITY_TYPE]) {\n returnTypeSchemaObject[SHACL.targetClass] = {\n [PROP_ENTITY_ID]: Array.isArray(returnValue[PROP_ENTITY_TYPE])\n ? returnValue[PROP_ENTITY_TYPE][0]\n : returnValue[PROP_ENTITY_TYPE]!\n };\n }\n report = await this.convertToQuadsAndValidateAgainstShape(returnValue, returnTypeSchemaObject);\n }\n }\n\n if (report && !report?.conforms) {\n throw new Error(\n `Return value ${\n Array.isArray(returnValue) ? 'array' : returnValue[PROP_ENTITY_ID]\n } does not conform to the schema`\n );\n }\n }\n\n private async convertToQuadsAndValidateAgainstShape(\n value: OrArray<NodeObject>,\n shape: NodeObject\n ): Promise<ValidationReport> {\n const valueAsQuads = await convertJsonLdToQuads(Array.isArray(value) ? value : [value]);\n const shapeQuads = await convertJsonLdToQuads(shape);\n const validator = new SHACLValidator(shapeQuads);\n return validator.validate(valueAsQuads);\n }\n\n private async performOauthSecuritySchemeStageWithCredentials(\n operationInfo: NodeObject,\n operationParameters: JSONObject,\n account: Entity,\n securityCredentials?: Entity\n ): Promise<OperationResponse> {\n const integratedProductId = (account[EngineConstants.prop.integration] as ReferenceNodeObject)[PROP_ENTITY_ID];\n const restAPIInterface = await this.getIntegrationInterface(integratedProductId);\n if (!restAPIInterface) {\n throw new Error(`No integration interface found for integrated product ${integratedProductId}`);\n }\n const openApiDescription = getValueIfDefined<OpenApi>(\n restAPIInterface[EngineConstants.prop.declarativeApiDescription]\n )!;\n securityCredentials ||= await this.findSecurityCredentialsForAccountIfDefined(account[PROP_ENTITY_ID]);\n let configuration: OpenApiClientConfiguration;\n if (securityCredentials) {\n configuration = this.getOauthConfigurationFromSecurityCredentials(securityCredentials);\n operationParameters.client_id = getValueIfDefined<string>(securityCredentials[EngineConstants.prop.username])!;\n } else {\n configuration = {};\n }\n const openApiExecutor = await this.createOpenApiOperationExecutorWithSpec(openApiDescription);\n const response = await openApiExecutor.executeSecuritySchemeStage(\n getValueIfDefined(operationInfo[EngineConstants.prop.schemeName])!,\n getValueIfDefined(operationInfo[EngineConstants.prop.oauthFlow])!,\n getValueIfDefined(operationInfo[EngineConstants.prop.stage])!,\n configuration,\n operationParameters\n );\n if ('codeVerifier' in response && 'authorizationUrl' in response) {\n return {\n data: response as unknown as JSONObject,\n operationParameters\n };\n }\n return this.axiosResponseAndParamsToOperationResponse(response, operationParameters, operationParameters);\n }\n\n private async getDataFromDataSource(\n dataSourceId: string,\n capabilityConfig?: CapabilityConfig\n ): Promise<OperationResponse> {\n const dataSource = await this.findBy({ id: dataSourceId });\n if (dataSource[PROP_ENTITY_TYPE] === EngineConstants.spec.jsonDataSource) {\n const data = this.getDataFromJsonDataSource(dataSource, capabilityConfig);\n return { data, operationParameters: {}};\n }\n throw new Error(`DataSource type ${dataSource[PROP_ENTITY_TYPE]} is not supported.`);\n }\n\n private getDataFromJsonDataSource(dataSource: NodeObject, capabilityConfig?: CapabilityConfig): JSONObject {\n if (dataSource[EngineConstants.prop.source]) {\n const sourceValue = getValueIfDefined<string>(dataSource[EngineConstants.prop.source])!;\n return this.getJsonDataFromSource(sourceValue, capabilityConfig);\n }\n return getValueIfDefined<JSONObject>(dataSource[EngineConstants.prop.data])!;\n }\n\n private getJsonDataFromSource(source: string, capabilityConfig?: CapabilityConfig): JSONObject {\n const inputFiles = {\n ...this.inputFiles,\n ...capabilityConfig?.inputFiles\n };\n if (source in inputFiles) {\n const file = inputFiles[source];\n if (typeof file === 'string') {\n return JSON.parse(file);\n }\n return file;\n }\n // eslint-disable-next-line unicorn/expiring-todo-comments\n // TODO add support for remote sources\n throw new Error(`Failed to get data from source ${source}`);\n }\n\n private throwValidationReportError(report: ValidationReport, errorMessage: string): void {\n const reportMessages = this.validationReportToMessages(report);\n throw new Error(`${errorMessage}\\n\\n${reportMessages.join('\\n')}`);\n }\n\n private validationReportToMessages(report: ValidationReport): string[] {\n const reportMessages = [];\n for (const result of report.results) {\n const pathValue = result.path?.value;\n if (result.message.length === 0) {\n const message = `${pathValue}: Invalid due to ${result.sourceConstraintComponent?.value}`;\n reportMessages.push(message);\n } else {\n const resultMessages = result.message.map((message): string => `${message.value}`).join(', ');\n const message = `${pathValue}: ${resultMessages}`;\n reportMessages.push(message);\n }\n }\n return reportMessages;\n }\n\n private ifCapabilityStreaming(capabilityConfig?: CapabilityConfig): boolean {\n return Boolean(capabilityConfig && 'stream' in capabilityConfig && capabilityConfig.stream);\n }\n\n private ifCapabilityBuffering(capabilityConfig?: CapabilityConfig): boolean {\n return Boolean(capabilityConfig && 'buffer' in capabilityConfig && capabilityConfig.buffer);\n }\n\n private isJavaScriptCode(text: string): boolean {\n if (!text) {\n return false;\n }\n // Trim the text to handle leading/trailing whitespace\n const trimmed = text.trim();\n\n // First, quickly check if it looks like JSON (starts with { or [)\n const looksLikeJson = /^\\s*[[{]/.test(trimmed) && /[\\]}]\\s*$/.test(trimmed);\n\n if (looksLikeJson) {\n try {\n // If it can be parsed as JSON, it's likely an RML mapping\n JSON.parse(trimmed);\n return false;\n } catch {\n // If it looks like JSON but can't be parsed, it might be code\n // Continue with other checks\n }\n }\n\n // Check for common JavaScript patterns that wouldn't appear in JSON\n const jsPatterns = [\n /function\\s+[$A-Z_a-z][\\w$]*\\s*\\(/, // Function declaration\n /const\\s+[$A-Z_a-z][\\w$]*/, // Const declaration\n /let\\s+[$A-Z_a-z][\\w$]*/, // Let declaration\n /var\\s+[$A-Z_a-z][\\w$]*/, // Var declaration\n /if\\s*\\(/, // If statement\n /for\\s*\\(/, // For loop\n /while\\s*\\(/, // While loop\n /=>|return |console\\./, // Arrow functions, return statements, console usage\n /import\\s+|export\\s+/, // ES6 imports/exports\n /class\\s+[$A-Z_a-z][\\w$]*/, // Class declaration\n /\\/\\/|\\/\\*|\\*\\// // Comments\n ];\n\n // If it matches any JS pattern, it's likely code\n return jsPatterns.some(pattern => pattern.test(trimmed));\n }\n\n private ensureNodeObject(result: any): NodeObject {\n // Handle null/undefined results\n if (result === null || result === undefined) {\n return {};\n }\n\n // If it's already a NodeObject with proper formatting, return as is\n if (\n typeof result === 'object' &&\n !Array.isArray(result) &&\n (result[PROP_ENTITY_ID] !== undefined ||\n result[PROP_ENTITY_TYPE] !== undefined ||\n result['@context'] !== undefined ||\n result['@graph'] !== undefined)\n ) {\n return result as NodeObject;\n }\n\n // Handle arrays - convert to @graph\n if (Array.isArray(result)) {\n // Check if items in array are already objects\n const convertedItems = result.map(item => {\n if (typeof item === 'object' && item !== null) {\n // Already object, but ensure it has @type if not present\n if (!item[PROP_ENTITY_TYPE] && !item[PROP_ENTITY_ID] && !item[PROP_ENTITY_VALUE]) {\n return { [PROP_ENTITY_TYPE]: 'skl:Result', ...item };\n }\n return item;\n }\n // Convert primitives to objects with @value\n return { [PROP_ENTITY_VALUE]: item };\n });\n\n return {\n '@context': {\n skl: SKL_NAMESPACE\n },\n '@graph': convertedItems\n };\n }\n\n // Handle primitive values (string, number, boolean)\n if (typeof result !== 'object') {\n return {\n [PROP_ENTITY_VALUE]: result\n };\n }\n\n // Handle plain objects (not arrays, not null)\n // If it's a plain object but not in NodeObject format, add @type\n return {\n [PROP_ENTITY_TYPE]: 'skl:Result',\n '@context': {\n skl: SKL_NAMESPACE\n },\n ...result\n };\n }\n\n private async executeCodeBlocks(\n codeBlocks: NodeObject[],\n args: JSONValue,\n executionOptions: ExecutionOptions\n ): Promise<NodeObject> {\n const results = [];\n let updatedArgs = (args as Record<string, any>) || {};\n for (const codeBlock of codeBlocks) {\n const code = getValueIfDefined(codeBlock[EngineConstants.prop.codeBody])!;\n if (code) {\n const result = await this.executeJavaScriptMapping(updatedArgs, code as string, executionOptions);\n updatedArgs = {\n ...updatedArgs,\n ...result\n };\n results.push(result);\n }\n }\n return results.length > 0 ? results[results.length - 1] : {};\n }\n\n private async executeJavaScriptMapping(\n args: JSONValue,\n code: string,\n _executionOptions: ExecutionOptions\n ): Promise<NodeObject> {\n try {\n // Configure execution options\n const executionOptions: ExecutionOptions = {\n timeout: 60 * 60 * 1000, // 1 hour\n functionName: 'main',\n allowNetwork: true,\n allowedDomains: [],\n allowEnv: true,\n debugMode: true,\n allowRead: true,\n ..._executionOptions\n };\n\n if (!this.codeExecutor) {\n throw new Error('Code executor not set. Please set a code executor using setCodeExecutor()');\n }\n\n // Execute the code\n const executionResult = await this.codeExecutor.execute(code, args as Record<string, any>, executionOptions);\n\n // Handle execution errors\n if (executionResult?.error) {\n throw new Error(`Code execution error: ${executionResult.error?.message ?? 'Unknown error'}`);\n }\n\n // This is a patch to return the output as it is without converting to NodeObject\n // This is needed for some api inputs. We can try doing this using the frame.\n if (executionResult?.result?.rawOutput) {\n return executionResult?.result?.rawOutput;\n }\n // Convert the result to a NodeObject\n return this.ensureNodeObject(executionResult?.result ?? executionResult);\n } catch (error: unknown) {\n throw new Error(\n `Failed to execute JavaScript mapping: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }\n\n // Expose global hooks to users\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n get hooks(): typeof globalHooks {\n return globalHooks;\n }\n\n public async prepareContextForType(typeSpecOrId: any): Promise<Record<string, any>> {\n const typeSpecs = [];\n if (typeof typeSpecOrId === 'string') {\n typeSpecs.push(\n await this.getSuperClassesOfObject(typeSpecOrId),\n await this.findBy({ id: typeSpecOrId })\n );\n } else {\n typeSpecs.push(typeSpecOrId);\n }\n const context: Record<string, any> = {};\n\n for (const typeSpec of typeSpecs) {\n const properties = typeSpec[SHACL.property] ?? [];\n for (const property of ensureArray(properties)) {\n const dataType = property[SHACL.datatype]?.['@id'];\n const nodeKind = property[SHACL.nodeKind]?.['@id'];\n const path = property[SHACL.path]?.['@id'];\n if (nodeKind === SHACL.IRI) {\n context[path] = {\n '@type': '@id'\n };\n } else {\n context[path] = {\n '@type': dataType\n };\n }\n }\n }\n return context;\n }\n}\n"]}
@@ -1,58 +0,0 @@
1
- import type { SparqlQueryAdapterOptions } from './storage/query-adapter/sparql/SparqlQueryAdapterOptions';
2
- import type { Callbacks } from './util/Types';
3
- export declare type ReadCacheOperation = 'find' | 'findBy' | 'findAll' | 'count';
4
- export interface ReadCacheStore {
5
- get: (key: string) => Promise<unknown | undefined>;
6
- set: (key: string, value: unknown, ttlMs: number) => Promise<void>;
7
- delete?: (key: string) => Promise<void>;
8
- clear?: () => Promise<void>;
9
- }
10
- export interface ReadCachePolicyInput {
11
- operation: ReadCacheOperation;
12
- args: readonly unknown[];
13
- endpointUrl?: string;
14
- namespace?: string;
15
- }
16
- export interface ReadCachePolicyDecision {
17
- cache: boolean;
18
- ttlMs?: number;
19
- keyHint?: string;
20
- }
21
- export declare type ReadCachePolicy = (input: ReadCachePolicyInput) => ReadCachePolicyDecision;
22
- export declare type SklEngineOptions = SparqlQueryAdapterOptions & {
23
- /**
24
- * Callbacks to execute upon events.
25
- */
26
- readonly callbacks?: Callbacks;
27
- /**
28
- * Manually defined functions which can be used in mappings.
29
- */
30
- readonly functions?: Record<string, (args: any | any[]) => any>;
31
- /**
32
- * When true, disables validation of verb parameters and return values according to schemas
33
- */
34
- readonly disableValidation?: boolean;
35
- /**
36
- * An object containing files keyed on their title that can be used in mappings.
37
- */
38
- readonly inputFiles?: Record<string, string>;
39
- readonly debugMode?: boolean;
40
- /**
41
- * The path to the executor script.
42
- */
43
- readonly scriptPath?: string;
44
- /**
45
- * Optional read cache store used for select read operations.
46
- * Cache decisions are made by readCachePolicy.
47
- */
48
- readonly readCache?: ReadCacheStore;
49
- /**
50
- * Optional policy that decides whether a given read operation should be cached.
51
- */
52
- readonly readCachePolicy?: ReadCachePolicy;
53
- /**
54
- * Optional namespace to scope cache keys (for example tenant/account isolation).
55
- */
56
- readonly readCacheNamespace?: string;
57
- };
58
- //# sourceMappingURL=SklEngineOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SklEngineOptions.d.ts","sourceRoot":"","sources":["../src/SklEngineOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0DAA0D,CAAC;AAC1G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,oBAAY,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzE,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACnD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,eAAe,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,uBAAuB,CAAC;AAEvF,oBAAY,gBAAgB,GAAG,yBAAyB,GAAG;IACzD;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7C,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=SklEngineOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SklEngineOptions.js","sourceRoot":"","sources":["../src/SklEngineOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { SparqlQueryAdapterOptions } from './storage/query-adapter/sparql/SparqlQueryAdapterOptions';\nimport type { Callbacks } from './util/Types';\n\nexport type ReadCacheOperation = 'find' | 'findBy' | 'findAll' | 'count';\n\nexport interface ReadCacheStore {\n get: (key: string) => Promise<unknown | undefined>;\n set: (key: string, value: unknown, ttlMs: number) => Promise<void>;\n delete?: (key: string) => Promise<void>;\n clear?: () => Promise<void>;\n}\n\nexport interface ReadCachePolicyInput {\n operation: ReadCacheOperation;\n args: readonly unknown[];\n endpointUrl?: string;\n namespace?: string;\n}\n\nexport interface ReadCachePolicyDecision {\n cache: boolean;\n ttlMs?: number;\n keyHint?: string;\n}\n\nexport type ReadCachePolicy = (input: ReadCachePolicyInput) => ReadCachePolicyDecision;\n\nexport type SklEngineOptions = SparqlQueryAdapterOptions & {\n /**\n * Callbacks to execute upon events.\n */\n readonly callbacks?: Callbacks;\n /**\n * Manually defined functions which can be used in mappings.\n */\n readonly functions?: Record<string, (args: any | any[]) => any>;\n /**\n * When true, disables validation of verb parameters and return values according to schemas\n */\n readonly disableValidation?: boolean;\n /**\n * An object containing files keyed on their title that can be used in mappings.\n */\n readonly inputFiles?: Record<string, string>;\n\n readonly debugMode?: boolean;\n\n /**\n * The path to the executor script.\n */\n readonly scriptPath?: string;\n\n /**\n * Optional read cache store used for select read operations.\n * Cache decisions are made by readCachePolicy.\n */\n readonly readCache?: ReadCacheStore;\n\n /**\n * Optional policy that decides whether a given read operation should be cached.\n */\n readonly readCachePolicy?: ReadCachePolicy;\n\n /**\n * Optional namespace to scope cache keys (for example tenant/account isolation).\n */\n readonly readCacheNamespace?: string;\n};\n"]}
@@ -1,96 +0,0 @@
1
- export declare const SKL_NAMESPACE = "https://skl.ai/";
2
- export declare const SKL_DATA_NAMESPACE = "https://skl.ai/d/";
3
- export declare const SKL_ENGINE_NAMESPACE = "https://skl.ai/skl-engine/";
4
- export declare const OWL: import(".").Namespace<"Restriction" | "onProperty" | "allValuesFrom" | "Class" | "intersectionOf" | "someValuesFrom" | "ObjectProperty", "https://www.w3.org/2002/07/owl#">;
5
- export declare const RDF: import(".").Namespace<"Property" | "type" | "datatype" | "JSON" | "first" | "rest" | "nil", "http://www.w3.org/1999/02/22-rdf-syntax-ns#">;
6
- export declare const RDFS: import(".").Namespace<"subClassOf" | "label" | "range" | "domain", "http://www.w3.org/2000/01/rdf-schema#">;
7
- export declare const R2RML: import(".").Namespace<"TriplesMap", "http://www.w3.org/ns/r2rml#">;
8
- export declare const XSD: import(".").Namespace<"string" | "boolean" | "label" | "integer" | "double" | "decimal" | "float" | "positiveInteger" | "negativeInteger" | "int" | "date" | "time" | "dateTime", "http://www.w3.org/2001/XMLSchema#">;
9
- export declare const SHACL: import(".").Namespace<"datatype" | "NodeShape" | "PropertyShape" | "Literal" | "IRI" | "BlankNode" | "BlankNodeOrIRI" | "BlankNodeOrLiteral" | "IRIOrLiteral" | "property" | "path" | "name" | "description" | "minCount" | "maxCount" | "targetNode" | "targetClass" | "targetSubjectsOf" | "targetObjectOf" | "severity" | "message" | "deactivated" | "and" | "or" | "class" | "closed" | "ignoredProperties" | "disjoint" | "equals" | "in" | "languageIn" | "lessThan" | "lessThanOrEquals" | "maxExclusive" | "maxInclusive" | "maxLength" | "minExclusive" | "minInclusive" | "minLength" | "nodeKind" | "pattern" | "flags" | "qualifiedMaxCount" | "qualifiedMinCount" | "qualifiedValueShape" | "qualifiedValueShapesDisjoint" | "uniqueLang" | "xone" | "inversePath" | "zeroOrMorePath" | "oneOrMorePath" | "zeroOrOnePath" | "alternativePath" | "node", "http://www.w3.org/ns/shacl#">;
10
- export declare const SHACL_NAMESPACE = "http://www.w3.org/ns/shacl#";
11
- export declare const PROP_ENTITY_ID = "@id";
12
- export declare const PROP_ENTITY_TYPE = "@type";
13
- export declare const PROP_ENTITY_VALUE = "@value";
14
- export declare const RML_LIST = "@list";
15
- export declare const OPEN_API_RUNTIME_AUTHORIZATION = "getOpenApiRuntimeAuthorization";
16
- export declare const EngineConstants: {
17
- spec: {
18
- capability: "https://skl.ai/Capability";
19
- capabilityMapping: "https://skl.ai/CapabilityMapping";
20
- triggerCapabilityMapping: "https://skl.ai/TriggerCapabilityMapping";
21
- invalidTokenErrorMatcher: "https://skl.ai/integration/InvalidTokenErrorMatcher";
22
- jsonDataSource: "https://skl.ai/JsonDataSource";
23
- mapping: "https://skl.ai/Mapping";
24
- inputs: "https://skl.ai/Inputs";
25
- openApi: "https://skl.ai/OpenAPI";
26
- codeBlock: "https://skl.ai/CodeBlock";
27
- integrationAuthenticationCredential: "https://skl.ai/integration/AuthenticationCredential";
28
- integrationInterface: "https://skl.ai/integration/IntegrationInterface";
29
- };
30
- prop: {
31
- capability: "https://skl.ai/capability";
32
- inputs: "https://skl.ai/inputs";
33
- outputs: "https://skl.ai/outputs";
34
- inputsContext: "https://skl.ai/inputsContext";
35
- outputsContext: "https://skl.ai/outputsContext";
36
- invalidTokenErrorMatcher: "https://skl.ai/integration/invalidTokenErrorMatcher";
37
- invalidTokenErrorMatcherStatus: "https://skl.ai/integration/invalidTokenErrorMatcherStatus";
38
- invalidTokenErrorMatcherMessageRegex: "https://skl.ai/integration/invalidTokenErrorMatcherMessageRegex";
39
- refreshCapability: "https://skl.ai/integration/refreshCapability";
40
- refreshToken: "https://skl.ai/integration/credential/refreshToken";
41
- jwtBearerOptions: "https://skl.ai/integration/credential/jwtBearerOptions";
42
- accessToken: "https://skl.ai/integration/credential/accessToken";
43
- bearerToken: "https://skl.ai/integration/credential/bearerToken";
44
- username: "https://skl.ai/integration/username";
45
- password: "https://skl.ai/integration/password";
46
- oneTimePassword: "https://skl.ai/integration/oneTimePassword";
47
- apiKey: "https://skl.ai/integration/apiKey";
48
- declarativeApiDescription: "https://skl.ai/integration/declarativeApiDescription";
49
- overrideBasePath: "https://skl.ai/integration/overrideBasePath";
50
- schemeName: "https://skl.ai/integration/schemeName";
51
- oauthFlow: "https://skl.ai/integration/oauthFlow";
52
- stage: "https://skl.ai/integration/stage";
53
- operationId: "https://skl.ai/operationId";
54
- data: "https://skl.ai/data";
55
- source: "https://skl.ai/source";
56
- headers: "https://skl.ai/headers";
57
- object: "https://skl.ai/object";
58
- dataSource: "https://skl.ai/dataSource";
59
- series: "https://skl.ai/mapping/series";
60
- parallel: "https://skl.ai/mapping/parallel";
61
- inputsReference: "https://skl.ai/mapping/inputsReference";
62
- inputsMapping: "https://skl.ai/mapping/inputsMapping";
63
- inputsMappingFrame: "https://skl.ai/mapping/inputsMappingFrame";
64
- inputsMappingRef: "https://skl.ai/mapping/inputsMappingRef";
65
- inputsMappingFrameRef: "https://skl.ai/mapping/inputsMappingFrameRef";
66
- outputsMapping: "https://skl.ai/mapping/outputsMapping";
67
- outputsMappingFrame: "https://skl.ai/mapping/outputsMappingFrame";
68
- preProcessingMapping: "https://skl.ai/mapping/preProcessingMapping";
69
- preProcessingMappingFrame: "https://skl.ai/mapping/preProcessingMappingFrame";
70
- operationMapping: "https://skl.ai/mapping/operationMapping";
71
- type: "https://skl.ai/type";
72
- dateCreated: "https://skl.ai/dateTimeCreated";
73
- dateModified: "https://skl.ai/dateTimeModified";
74
- label: "https://skl.ai/label";
75
- identifier: "https://skl.ai/identifier";
76
- codeBody: "https://skl.ai/content/codeBody";
77
- codeBlocks: "https://skl.ai/content/codeBlocks";
78
- integration: "https://skl.ai/integration/integration";
79
- accountOrUser: "https://skl.ai/accountOrUser";
80
- capabilityType: "https://skl.ai/capabilityType";
81
- };
82
- dataSource: {
83
- update: "https://skl.ai/skl-engine/update";
84
- findAll: "https://skl.ai/skl-engine/findAll";
85
- findAllBy: "https://skl.ai/skl-engine/findAllBy";
86
- find: "https://skl.ai/skl-engine/find";
87
- findBy: "https://skl.ai/skl-engine/findBy";
88
- exists: "https://skl.ai/skl-engine/exists";
89
- existsResult: "https://skl.ai/skl-engine/existsResult";
90
- count: "https://skl.ai/skl-engine/count";
91
- countResult: "https://skl.ai/skl-engine/countResult";
92
- save: "https://skl.ai/skl-engine/save";
93
- destroy: "https://skl.ai/skl-engine/destroy";
94
- };
95
- };
96
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,oBAAsB,CAAC;AACjD,eAAO,MAAM,kBAAkB,sBAA2B,CAAC;AAC3D,eAAO,MAAM,oBAAoB,+BAA6B,CAAC;AAE/D,eAAO,MAAM,GAAG,6KAAY,CAAC;AAC7B,eAAO,MAAM,GAAG,4IAAY,CAAC;AAC7B,eAAO,MAAM,IAAI,6GAAa,CAAC;AAC/B,eAAO,MAAM,KAAK,oEAAc,CAAC;AACjC,eAAO,MAAM,GAAG,wNAAY,CAAC;AAC7B,eAAO,MAAM,KAAK,s2BAAc,CAAC;AACjC,eAAO,MAAM,eAAe,gCAAwB,CAAC;AACrD,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAI1C,eAAO,MAAM,QAAQ,UAAU,CAAC;AAEhC,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAG/E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmF3B,CAAC"}