@comake/skl-js-engine 1.5.4 → 1.5.6

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 (306) hide show
  1. package/dist/JsExecutor/PermissionBuilder.d.ts +14 -0
  2. package/dist/JsExecutor/PermissionBuilder.d.ts.map +1 -0
  3. package/dist/JsExecutor/PermissionBuilder.js +58 -0
  4. package/dist/JsExecutor/PermissionBuilder.js.map +1 -0
  5. package/dist/JsExecutor/constants.d.ts +27 -0
  6. package/dist/JsExecutor/constants.d.ts.map +1 -0
  7. package/dist/JsExecutor/constants.js +30 -0
  8. package/dist/JsExecutor/constants.js.map +1 -0
  9. package/dist/JsExecutor/denoUtils.d.ts +10 -0
  10. package/dist/JsExecutor/denoUtils.d.ts.map +1 -0
  11. package/dist/JsExecutor/denoUtils.js +24 -0
  12. package/dist/JsExecutor/denoUtils.js.map +1 -0
  13. package/dist/JsExecutor/errors.d.ts +40 -0
  14. package/dist/JsExecutor/errors.d.ts.map +1 -0
  15. package/dist/JsExecutor/errors.js +67 -0
  16. package/dist/JsExecutor/errors.js.map +1 -0
  17. package/dist/JsExecutor/examples/basic/index.d.ts +1 -0
  18. package/dist/JsExecutor/examples/basic/index.d.ts.map +1 -0
  19. package/dist/JsExecutor/examples/basic/index.js +46 -0
  20. package/dist/JsExecutor/examples/basic/index.js.map +1 -0
  21. package/dist/JsExecutor/examples/basic/process.d.ts +1 -0
  22. package/dist/JsExecutor/examples/basic/process.d.ts.map +1 -0
  23. package/dist/JsExecutor/examples/basic/process.js +34 -0
  24. package/dist/JsExecutor/examples/basic/process.js.map +1 -0
  25. package/dist/JsExecutor/examples/jsExecutor/index.d.ts +2 -0
  26. package/dist/JsExecutor/examples/jsExecutor/index.d.ts.map +1 -0
  27. package/dist/JsExecutor/examples/jsExecutor/index.js +47 -0
  28. package/dist/JsExecutor/examples/jsExecutor/index.js.map +1 -0
  29. package/dist/JsExecutor/examples/jsExecutor/process.d.ts +2 -0
  30. package/dist/JsExecutor/examples/jsExecutor/process.d.ts.map +1 -0
  31. package/dist/JsExecutor/examples/jsExecutor/process.js +58 -0
  32. package/dist/JsExecutor/examples/jsExecutor/process.js.map +1 -0
  33. package/dist/JsExecutor/index.d.ts +7 -0
  34. package/dist/JsExecutor/index.d.ts.map +1 -0
  35. package/dist/JsExecutor/index.js +36 -0
  36. package/dist/JsExecutor/index.js.map +1 -0
  37. package/dist/JsExecutor/jsExecutor.d.ts +68 -0
  38. package/dist/JsExecutor/jsExecutor.d.ts.map +1 -0
  39. package/dist/JsExecutor/jsExecutor.js +171 -0
  40. package/dist/JsExecutor/jsExecutor.js.map +1 -0
  41. package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts +165 -0
  42. package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts.map +1 -0
  43. package/dist/JsExecutor/jsonRpc/JsonRpcClient.js +335 -0
  44. package/dist/JsExecutor/jsonRpc/JsonRpcClient.js.map +1 -0
  45. package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts +125 -0
  46. package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts.map +1 -0
  47. package/dist/JsExecutor/jsonRpc/JsonRpcServer.js +391 -0
  48. package/dist/JsExecutor/jsonRpc/JsonRpcServer.js.map +1 -0
  49. package/dist/JsExecutor/jsonRpc/index.d.ts +4 -0
  50. package/dist/JsExecutor/jsonRpc/index.d.ts.map +1 -0
  51. package/dist/JsExecutor/jsonRpc/index.js +23 -0
  52. package/dist/JsExecutor/jsonRpc/index.js.map +1 -0
  53. package/dist/JsExecutor/jsonRpc/types.d.ts +193 -0
  54. package/dist/JsExecutor/jsonRpc/types.d.ts.map +1 -0
  55. package/dist/JsExecutor/jsonRpc/types.js +37 -0
  56. package/dist/JsExecutor/jsonRpc/types.js.map +1 -0
  57. package/dist/JsExecutor/transport/Transport.d.ts +74 -0
  58. package/dist/JsExecutor/transport/Transport.d.ts.map +1 -0
  59. package/dist/JsExecutor/transport/Transport.js +14 -0
  60. package/dist/JsExecutor/transport/Transport.js.map +1 -0
  61. package/dist/JsExecutor/transport/base/BaseTransport.d.ts +51 -0
  62. package/dist/JsExecutor/transport/base/BaseTransport.d.ts.map +1 -0
  63. package/dist/JsExecutor/transport/base/BaseTransport.js +68 -0
  64. package/dist/JsExecutor/transport/base/BaseTransport.js.map +1 -0
  65. package/dist/JsExecutor/transport/index.d.ts +13 -0
  66. package/dist/JsExecutor/transport/index.d.ts.map +1 -0
  67. package/dist/JsExecutor/transport/index.js +36 -0
  68. package/dist/JsExecutor/transport/index.js.map +1 -0
  69. package/dist/JsExecutor/transport/process/ProcessManager.d.ts +96 -0
  70. package/dist/JsExecutor/transport/process/ProcessManager.d.ts.map +1 -0
  71. package/dist/JsExecutor/transport/process/ProcessManager.js +219 -0
  72. package/dist/JsExecutor/transport/process/ProcessManager.js.map +1 -0
  73. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts +87 -0
  74. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts.map +1 -0
  75. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js +219 -0
  76. package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js.map +1 -0
  77. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts +81 -0
  78. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts.map +1 -0
  79. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js +259 -0
  80. package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js.map +1 -0
  81. package/dist/JsExecutor/transport/utils/MessageUtils.d.ts +68 -0
  82. package/dist/JsExecutor/transport/utils/MessageUtils.d.ts.map +1 -0
  83. package/dist/JsExecutor/transport/utils/MessageUtils.js +135 -0
  84. package/dist/JsExecutor/transport/utils/MessageUtils.js.map +1 -0
  85. package/dist/JsExecutor/transport/utils/PollingUtils.d.ts +53 -0
  86. package/dist/JsExecutor/transport/utils/PollingUtils.d.ts.map +1 -0
  87. package/dist/JsExecutor/transport/utils/PollingUtils.js +92 -0
  88. package/dist/JsExecutor/transport/utils/PollingUtils.js.map +1 -0
  89. package/dist/JsExecutor/types.d.ts +113 -0
  90. package/dist/JsExecutor/types.d.ts.map +1 -0
  91. package/dist/JsExecutor/types.js +3 -0
  92. package/dist/JsExecutor/types.js.map +1 -0
  93. package/dist/SklEngine.d.ts +132 -0
  94. package/dist/SklEngine.d.ts.map +1 -0
  95. package/dist/SklEngine.js +1514 -0
  96. package/dist/SklEngine.js.map +1 -0
  97. package/dist/SklEngineOptions.d.ts +58 -0
  98. package/dist/SklEngineOptions.d.ts.map +1 -0
  99. package/dist/SklEngineOptions.js +3 -0
  100. package/dist/SklEngineOptions.js.map +1 -0
  101. package/dist/constants.d.ts +96 -0
  102. package/dist/constants.d.ts.map +1 -0
  103. package/dist/constants.js +103 -0
  104. package/dist/constants.js.map +1 -0
  105. package/dist/customCapabilities.d.ts +22 -0
  106. package/dist/customCapabilities.d.ts.map +1 -0
  107. package/dist/customCapabilities.js +45 -0
  108. package/dist/customCapabilities.js.map +1 -0
  109. package/dist/examples/customCapabilitiesExample.d.ts +2 -0
  110. package/dist/examples/customCapabilitiesExample.d.ts.map +1 -0
  111. package/dist/examples/customCapabilitiesExample.js +59 -0
  112. package/dist/examples/customCapabilitiesExample.js.map +1 -0
  113. package/dist/executor.js +216 -0
  114. package/dist/hooks/globalHooks.d.ts +50 -0
  115. package/dist/hooks/globalHooks.d.ts.map +1 -0
  116. package/dist/hooks/globalHooks.js +164 -0
  117. package/dist/hooks/globalHooks.js.map +1 -0
  118. package/dist/hooks/types.d.ts +9 -0
  119. package/dist/hooks/types.d.ts.map +1 -0
  120. package/dist/hooks/types.js +3 -0
  121. package/dist/hooks/types.js.map +1 -0
  122. package/dist/index.d.ts +41 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +68 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/logger.d.ts +35 -0
  127. package/dist/logger.d.ts.map +1 -0
  128. package/dist/logger.js +119 -0
  129. package/dist/logger.js.map +1 -0
  130. package/dist/mapping/Mapper.d.ts +13 -0
  131. package/dist/mapping/Mapper.d.ts.map +1 -0
  132. package/dist/mapping/Mapper.js +64 -0
  133. package/dist/mapping/Mapper.js.map +1 -0
  134. package/dist/storage/FindOperator.d.ts +19 -0
  135. package/dist/storage/FindOperator.d.ts.map +1 -0
  136. package/dist/storage/FindOperator.js +23 -0
  137. package/dist/storage/FindOperator.js.map +1 -0
  138. package/dist/storage/FindOptionsTypes.d.ts +79 -0
  139. package/dist/storage/FindOptionsTypes.d.ts.map +1 -0
  140. package/dist/storage/FindOptionsTypes.js +3 -0
  141. package/dist/storage/FindOptionsTypes.js.map +1 -0
  142. package/dist/storage/GroupOptionTypes.d.ts +29 -0
  143. package/dist/storage/GroupOptionTypes.d.ts.map +1 -0
  144. package/dist/storage/GroupOptionTypes.js +3 -0
  145. package/dist/storage/GroupOptionTypes.js.map +1 -0
  146. package/dist/storage/operator/And.d.ts +4 -0
  147. package/dist/storage/operator/And.d.ts.map +1 -0
  148. package/dist/storage/operator/And.js +13 -0
  149. package/dist/storage/operator/And.js.map +1 -0
  150. package/dist/storage/operator/Contains.d.ts +3 -0
  151. package/dist/storage/operator/Contains.d.ts.map +1 -0
  152. package/dist/storage/operator/Contains.js +13 -0
  153. package/dist/storage/operator/Contains.js.map +1 -0
  154. package/dist/storage/operator/Equal.d.ts +5 -0
  155. package/dist/storage/operator/Equal.d.ts.map +1 -0
  156. package/dist/storage/operator/Equal.js +13 -0
  157. package/dist/storage/operator/Equal.js.map +1 -0
  158. package/dist/storage/operator/Exists.d.ts +3 -0
  159. package/dist/storage/operator/Exists.d.ts.map +1 -0
  160. package/dist/storage/operator/Exists.js +10 -0
  161. package/dist/storage/operator/Exists.js.map +1 -0
  162. package/dist/storage/operator/GreaterThan.d.ts +4 -0
  163. package/dist/storage/operator/GreaterThan.d.ts.map +1 -0
  164. package/dist/storage/operator/GreaterThan.js +13 -0
  165. package/dist/storage/operator/GreaterThan.js.map +1 -0
  166. package/dist/storage/operator/GreaterThanOrEqual.d.ts +4 -0
  167. package/dist/storage/operator/GreaterThanOrEqual.d.ts.map +1 -0
  168. package/dist/storage/operator/GreaterThanOrEqual.js +13 -0
  169. package/dist/storage/operator/GreaterThanOrEqual.js.map +1 -0
  170. package/dist/storage/operator/In.d.ts +4 -0
  171. package/dist/storage/operator/In.d.ts.map +1 -0
  172. package/dist/storage/operator/In.js +13 -0
  173. package/dist/storage/operator/In.js.map +1 -0
  174. package/dist/storage/operator/Inverse.d.ts +3 -0
  175. package/dist/storage/operator/Inverse.d.ts.map +1 -0
  176. package/dist/storage/operator/Inverse.js +13 -0
  177. package/dist/storage/operator/Inverse.js.map +1 -0
  178. package/dist/storage/operator/InversePath.d.ts +7 -0
  179. package/dist/storage/operator/InversePath.d.ts.map +1 -0
  180. package/dist/storage/operator/InversePath.js +13 -0
  181. package/dist/storage/operator/InversePath.js.map +1 -0
  182. package/dist/storage/operator/InverseRelation.d.ts +9 -0
  183. package/dist/storage/operator/InverseRelation.d.ts.map +1 -0
  184. package/dist/storage/operator/InverseRelation.js +13 -0
  185. package/dist/storage/operator/InverseRelation.js.map +1 -0
  186. package/dist/storage/operator/InverseRelationOrder.d.ts +8 -0
  187. package/dist/storage/operator/InverseRelationOrder.d.ts.map +1 -0
  188. package/dist/storage/operator/InverseRelationOrder.js +13 -0
  189. package/dist/storage/operator/InverseRelationOrder.js.map +1 -0
  190. package/dist/storage/operator/LessThan.d.ts +4 -0
  191. package/dist/storage/operator/LessThan.d.ts.map +1 -0
  192. package/dist/storage/operator/LessThan.js +13 -0
  193. package/dist/storage/operator/LessThan.js.map +1 -0
  194. package/dist/storage/operator/LessThanOrEqual.d.ts +4 -0
  195. package/dist/storage/operator/LessThanOrEqual.d.ts.map +1 -0
  196. package/dist/storage/operator/LessThanOrEqual.js +13 -0
  197. package/dist/storage/operator/LessThanOrEqual.js.map +1 -0
  198. package/dist/storage/operator/Not.d.ts +3 -0
  199. package/dist/storage/operator/Not.d.ts.map +1 -0
  200. package/dist/storage/operator/Not.js +13 -0
  201. package/dist/storage/operator/Not.js.map +1 -0
  202. package/dist/storage/operator/OneOrMorePath.d.ts +7 -0
  203. package/dist/storage/operator/OneOrMorePath.d.ts.map +1 -0
  204. package/dist/storage/operator/OneOrMorePath.js +13 -0
  205. package/dist/storage/operator/OneOrMorePath.js.map +1 -0
  206. package/dist/storage/operator/Or.d.ts +4 -0
  207. package/dist/storage/operator/Or.d.ts.map +1 -0
  208. package/dist/storage/operator/Or.js +13 -0
  209. package/dist/storage/operator/Or.js.map +1 -0
  210. package/dist/storage/operator/Sequence.d.ts +3 -0
  211. package/dist/storage/operator/Sequence.d.ts.map +1 -0
  212. package/dist/storage/operator/Sequence.js +13 -0
  213. package/dist/storage/operator/Sequence.js.map +1 -0
  214. package/dist/storage/operator/SequencePath.d.ts +7 -0
  215. package/dist/storage/operator/SequencePath.d.ts.map +1 -0
  216. package/dist/storage/operator/SequencePath.js +13 -0
  217. package/dist/storage/operator/SequencePath.js.map +1 -0
  218. package/dist/storage/operator/ZeroOrMorePath.d.ts +7 -0
  219. package/dist/storage/operator/ZeroOrMorePath.d.ts.map +1 -0
  220. package/dist/storage/operator/ZeroOrMorePath.js +13 -0
  221. package/dist/storage/operator/ZeroOrMorePath.js.map +1 -0
  222. package/dist/storage/query-adapter/QueryAdapter.d.ts +99 -0
  223. package/dist/storage/query-adapter/QueryAdapter.d.ts.map +1 -0
  224. package/dist/storage/query-adapter/QueryAdapter.js +3 -0
  225. package/dist/storage/query-adapter/QueryAdapter.js.map +1 -0
  226. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.d.ts +40 -0
  227. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.d.ts.map +1 -0
  228. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.js +315 -0
  229. package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.js.map +1 -0
  230. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.d.ts +34 -0
  231. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.d.ts.map +1 -0
  232. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.js +3 -0
  233. package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.js.map +1 -0
  234. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.d.ts +104 -0
  235. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.d.ts.map +1 -0
  236. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.js +1210 -0
  237. package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.js.map +1 -0
  238. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.d.ts +44 -0
  239. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.d.ts.map +1 -0
  240. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.js +397 -0
  241. package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.js.map +1 -0
  242. package/dist/storage/query-adapter/sparql/VariableGenerator.d.ts +5 -0
  243. package/dist/storage/query-adapter/sparql/VariableGenerator.d.ts.map +1 -0
  244. package/dist/storage/query-adapter/sparql/VariableGenerator.js +14 -0
  245. package/dist/storage/query-adapter/sparql/VariableGenerator.js.map +1 -0
  246. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.d.ts +19 -0
  247. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.d.ts.map +1 -0
  248. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.js +90 -0
  249. package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.js.map +1 -0
  250. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.d.ts +27 -0
  251. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.d.ts.map +1 -0
  252. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.js +116 -0
  253. package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.js.map +1 -0
  254. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.d.ts +34 -0
  255. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.d.ts.map +1 -0
  256. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.js +3 -0
  257. package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.js.map +1 -0
  258. package/dist/tools/explain-findall-sparql.d.ts +2 -0
  259. package/dist/tools/explain-findall-sparql.d.ts.map +1 -0
  260. package/dist/tools/explain-findall-sparql.js +303 -0
  261. package/dist/tools/explain-findall-sparql.js.map +1 -0
  262. package/dist/util/PerformanceLogger.d.ts +28 -0
  263. package/dist/util/PerformanceLogger.d.ts.map +1 -0
  264. package/dist/util/PerformanceLogger.js +223 -0
  265. package/dist/util/PerformanceLogger.js.map +1 -0
  266. package/dist/util/ReadCacheHelper.d.ts +14 -0
  267. package/dist/util/ReadCacheHelper.d.ts.map +1 -0
  268. package/dist/util/ReadCacheHelper.js +61 -0
  269. package/dist/util/ReadCacheHelper.js.map +1 -0
  270. package/dist/util/SparqlUtil.d.ts +72 -0
  271. package/dist/util/SparqlUtil.d.ts.map +1 -0
  272. package/dist/util/SparqlUtil.js +456 -0
  273. package/dist/util/SparqlUtil.js.map +1 -0
  274. package/dist/util/TripleUtil.d.ts +10 -0
  275. package/dist/util/TripleUtil.d.ts.map +1 -0
  276. package/dist/util/TripleUtil.js +431 -0
  277. package/dist/util/TripleUtil.js.map +1 -0
  278. package/dist/util/Types.d.ts +275 -0
  279. package/dist/util/Types.d.ts.map +1 -0
  280. package/dist/util/Types.js +3 -0
  281. package/dist/util/Types.js.map +1 -0
  282. package/dist/util/Util.d.ts +26 -0
  283. package/dist/util/Util.d.ts.map +1 -0
  284. package/dist/util/Util.js +138 -0
  285. package/dist/util/Util.js.map +1 -0
  286. package/dist/util/Vocabularies/Shared.d.ts +13 -0
  287. package/dist/util/Vocabularies/Shared.d.ts.map +1 -0
  288. package/dist/util/Vocabularies/Shared.js +96 -0
  289. package/dist/util/Vocabularies/Shared.js.map +1 -0
  290. package/dist/util/Vocabularies/helper.d.ts +5 -0
  291. package/dist/util/Vocabularies/helper.d.ts.map +1 -0
  292. package/dist/util/Vocabularies/helper.js +10 -0
  293. package/dist/util/Vocabularies/helper.js.map +1 -0
  294. package/dist/util/Vocabularies/index.d.ts +8 -0
  295. package/dist/util/Vocabularies/index.d.ts.map +1 -0
  296. package/dist/util/Vocabularies/index.js +114 -0
  297. package/dist/util/Vocabularies/index.js.map +1 -0
  298. package/dist/util/safeJsonStringify.d.ts +1 -0
  299. package/dist/util/safeJsonStringify.d.ts.map +1 -0
  300. package/dist/util/safeJsonStringify.js +19 -0
  301. package/dist/util/safeJsonStringify.js.map +1 -0
  302. package/package.json +1 -1
  303. package/src/SklEngine.ts +6 -0
  304. package/src/storage/query-adapter/sparql/SparqlUpdateBuilder.ts +106 -1
  305. package/src/util/TripleUtil.ts +19 -0
  306. package/src/util/Types.ts +6 -0
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EngineConstants = exports.OPEN_API_RUNTIME_AUTHORIZATION = exports.RML_LIST = exports.PROP_ENTITY_VALUE = exports.PROP_ENTITY_TYPE = exports.PROP_ENTITY_ID = exports.SHACL_NAMESPACE = exports.SHACL = exports.XSD = exports.R2RML = exports.RDFS = exports.RDF = exports.OWL = exports.SKL_ENGINE_NAMESPACE = exports.SKL_DATA_NAMESPACE = exports.SKL_NAMESPACE = void 0;
4
+ const Vocabularies_1 = require("./util/Vocabularies");
5
+ const Shared_1 = require("./util/Vocabularies/Shared");
6
+ exports.SKL_NAMESPACE = Vocabularies_1.SKL_NAMESPACE;
7
+ exports.SKL_DATA_NAMESPACE = Vocabularies_1.SKL_DATA_NAMESPACE;
8
+ exports.SKL_ENGINE_NAMESPACE = Vocabularies_1.SKL_ENGINE_NAMESPACE;
9
+ exports.OWL = Shared_1.OWL;
10
+ exports.RDF = Shared_1.RDF;
11
+ exports.RDFS = Shared_1.RDFS;
12
+ exports.R2RML = Shared_1.R2RML;
13
+ exports.XSD = Shared_1.XSD;
14
+ exports.SHACL = Shared_1.SHACL;
15
+ exports.SHACL_NAMESPACE = Shared_1.SHACL_NAMESPACE;
16
+ exports.PROP_ENTITY_ID = '@id';
17
+ exports.PROP_ENTITY_TYPE = '@type';
18
+ exports.PROP_ENTITY_VALUE = '@value';
19
+ // RML constants
20
+ exports.RML_LIST = '@list';
21
+ exports.OPEN_API_RUNTIME_AUTHORIZATION = 'getOpenApiRuntimeAuthorization';
22
+ // eslint-disable-next-line @typescript-eslint/naming-convention
23
+ exports.EngineConstants = {
24
+ spec: {
25
+ capability: Vocabularies_1.SKL_SPECS.Capability,
26
+ capabilityMapping: Vocabularies_1.SKL_SPECS.CapabilityMapping,
27
+ triggerCapabilityMapping: Vocabularies_1.SKL_SPECS.TriggerCapabilityMapping,
28
+ invalidTokenErrorMatcher: Vocabularies_1.SKL_SPECS['integration/InvalidTokenErrorMatcher'],
29
+ jsonDataSource: Vocabularies_1.SKL_SPECS.JsonDataSource,
30
+ mapping: Vocabularies_1.SKL_SPECS.Mapping,
31
+ inputs: Vocabularies_1.SKL_SPECS.Inputs,
32
+ openApi: Vocabularies_1.SKL_SPECS.OpenAPI,
33
+ codeBlock: Vocabularies_1.SKL_SPECS.CodeBlock,
34
+ integrationAuthenticationCredential: Vocabularies_1.SKL_SPECS['integration/AuthenticationCredential'],
35
+ integrationInterface: Vocabularies_1.SKL_SPECS['integration/IntegrationInterface']
36
+ },
37
+ prop: {
38
+ capability: Vocabularies_1.SKL_PROPERTY.capability,
39
+ inputs: Vocabularies_1.SKL_PROPERTY.inputs,
40
+ outputs: Vocabularies_1.SKL_PROPERTY.outputs,
41
+ inputsContext: Vocabularies_1.SKL_PROPERTY.inputsContext,
42
+ outputsContext: Vocabularies_1.SKL_PROPERTY.outputsContext,
43
+ invalidTokenErrorMatcher: Vocabularies_1.SKL_PROPERTY['integration/invalidTokenErrorMatcher'],
44
+ invalidTokenErrorMatcherStatus: Vocabularies_1.SKL_PROPERTY['integration/invalidTokenErrorMatcherStatus'],
45
+ invalidTokenErrorMatcherMessageRegex: Vocabularies_1.SKL_PROPERTY['integration/invalidTokenErrorMatcherMessageRegex'],
46
+ refreshCapability: Vocabularies_1.SKL_PROPERTY['integration/refreshCapability'],
47
+ refreshToken: Vocabularies_1.SKL_PROPERTY['integration/credential/refreshToken'],
48
+ jwtBearerOptions: Vocabularies_1.SKL_PROPERTY['integration/credential/jwtBearerOptions'],
49
+ accessToken: Vocabularies_1.SKL_PROPERTY['integration/credential/accessToken'],
50
+ bearerToken: Vocabularies_1.SKL_PROPERTY['integration/credential/bearerToken'],
51
+ username: Vocabularies_1.SKL_PROPERTY['integration/username'],
52
+ password: Vocabularies_1.SKL_PROPERTY['integration/password'],
53
+ oneTimePassword: Vocabularies_1.SKL_PROPERTY['integration/oneTimePassword'],
54
+ apiKey: Vocabularies_1.SKL_PROPERTY['integration/apiKey'],
55
+ declarativeApiDescription: Vocabularies_1.SKL_PROPERTY['integration/declarativeApiDescription'],
56
+ overrideBasePath: Vocabularies_1.SKL_PROPERTY['integration/overrideBasePath'],
57
+ schemeName: Vocabularies_1.SKL_PROPERTY['integration/schemeName'],
58
+ oauthFlow: Vocabularies_1.SKL_PROPERTY['integration/oauthFlow'],
59
+ stage: Vocabularies_1.SKL_PROPERTY['integration/stage'],
60
+ operationId: Vocabularies_1.SKL_PROPERTY.operationId,
61
+ data: Vocabularies_1.SKL_PROPERTY.data,
62
+ source: Vocabularies_1.SKL_PROPERTY.source,
63
+ headers: Vocabularies_1.SKL_PROPERTY.headers,
64
+ object: Vocabularies_1.SKL_PROPERTY.object,
65
+ dataSource: Vocabularies_1.SKL_PROPERTY.dataSource,
66
+ series: Vocabularies_1.SKL_PROPERTY['mapping/series'],
67
+ parallel: Vocabularies_1.SKL_PROPERTY['mapping/parallel'],
68
+ inputsReference: Vocabularies_1.SKL_PROPERTY['mapping/inputsReference'],
69
+ inputsMapping: Vocabularies_1.SKL_PROPERTY['mapping/inputsMapping'],
70
+ inputsMappingFrame: Vocabularies_1.SKL_PROPERTY['mapping/inputsMappingFrame'],
71
+ inputsMappingRef: Vocabularies_1.SKL_PROPERTY['mapping/inputsMappingRef'],
72
+ inputsMappingFrameRef: Vocabularies_1.SKL_PROPERTY['mapping/inputsMappingFrameRef'],
73
+ outputsMapping: Vocabularies_1.SKL_PROPERTY['mapping/outputsMapping'],
74
+ outputsMappingFrame: Vocabularies_1.SKL_PROPERTY['mapping/outputsMappingFrame'],
75
+ preProcessingMapping: Vocabularies_1.SKL_PROPERTY['mapping/preProcessingMapping'],
76
+ preProcessingMappingFrame: Vocabularies_1.SKL_PROPERTY['mapping/preProcessingMappingFrame'],
77
+ operationMapping: Vocabularies_1.SKL_PROPERTY['mapping/operationMapping'],
78
+ type: Vocabularies_1.SKL_PROPERTY.type,
79
+ dateCreated: Vocabularies_1.SKL_PROPERTY.dateTimeCreated,
80
+ dateModified: Vocabularies_1.SKL_PROPERTY.dateTimeModified,
81
+ label: Vocabularies_1.SKL_PROPERTY.label,
82
+ identifier: Vocabularies_1.SKL_PROPERTY.identifier,
83
+ codeBody: Vocabularies_1.SKL_PROPERTY['content/codeBody'],
84
+ codeBlocks: Vocabularies_1.SKL_PROPERTY['content/codeBlocks'],
85
+ integration: Vocabularies_1.SKL_PROPERTY['integration/integration'],
86
+ accountOrUser: Vocabularies_1.SKL_PROPERTY.accountOrUser,
87
+ capabilityType: Vocabularies_1.SKL_PROPERTY.capabilityType
88
+ },
89
+ dataSource: {
90
+ update: Vocabularies_1.SKL_ENGINE.update,
91
+ findAll: Vocabularies_1.SKL_ENGINE.findAll,
92
+ findAllBy: Vocabularies_1.SKL_ENGINE.findAllBy,
93
+ find: Vocabularies_1.SKL_ENGINE.find,
94
+ findBy: Vocabularies_1.SKL_ENGINE.findBy,
95
+ exists: Vocabularies_1.SKL_ENGINE.exists,
96
+ existsResult: Vocabularies_1.SKL_ENGINE.existsResult,
97
+ count: Vocabularies_1.SKL_ENGINE.count,
98
+ countResult: Vocabularies_1.SKL_ENGINE.countResult,
99
+ save: Vocabularies_1.SKL_ENGINE.save,
100
+ destroy: Vocabularies_1.SKL_ENGINE.destroy
101
+ }
102
+ };
103
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,sDAO6B;AAC7B,uDAKoC;AAEvB,QAAA,aAAa,GAAG,4BAAmB,CAAC;AACpC,QAAA,kBAAkB,GAAG,iCAAwB,CAAC;AAC9C,QAAA,oBAAoB,GAAG,mCAA0B,CAAC;AAElD,QAAA,GAAG,GAAG,YAAS,CAAC;AAChB,QAAA,GAAG,GAAG,YAAS,CAAC;AAChB,QAAA,IAAI,GAAG,aAAU,CAAC;AAClB,QAAA,KAAK,GAAG,cAAW,CAAC;AACpB,QAAA,GAAG,GAAG,YAAS,CAAC;AAChB,QAAA,KAAK,GAAG,cAAW,CAAC;AACpB,QAAA,eAAe,GAAG,wBAAqB,CAAC;AACxC,QAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,gBAAgB;AAEH,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEnB,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAE/E,gEAAgE;AACnD,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE;QACJ,UAAU,EAAE,wBAAS,CAAC,UAAU;QAChC,iBAAiB,EAAE,wBAAS,CAAC,iBAAiB;QAC9C,wBAAwB,EAAE,wBAAS,CAAC,wBAAwB;QAC5D,wBAAwB,EAAE,wBAAS,CAAC,sCAAsC,CAAC;QAC3E,cAAc,EAAE,wBAAS,CAAC,cAAc;QACxC,OAAO,EAAE,wBAAS,CAAC,OA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AE;QACV,MAAM,EAAE,yBAAU,CAAC,MAAM;QACzB,OAAO,EAAE,yBAAU,CAAC,OAAO;QAC3B,SAAS,EAAE,yBAAU,CAAC,SAAS;QAC/B,IAAI,EAAE,yBAAU,CAAC,IAAI;QACrB,MAAM,EAAE,yBAAU,CAAC,MAAM;QACzB,MAAM,EAAE,yBAAU,CAAC,MAAM;QACzB,YAAY,EAAE,yBAAU,CAAC,YAAY;QACrC,KAAK,EAAE,yBAAU,CAAC,KAAK;QACvB,WAAW,EAAE,yBAAU,CAAC,WAAW;QACnC,IAAI,EAAE,yBAAU,CAAC,IAAI;QACrB,OAAO,EAAE,yBAAU,CAAC,OAAO;KAC5B;CACF,CAAC","sourcesContent":["import {\n SKL_DATA_NAMESPACE as SKL_DATA_NAMESPACE_VOCAB,\n SKL_ENGINE,\n SKL_ENGINE_NAMESPACE as SKL_ENGINE_NAMESPACE_VOCAB,\n SKL_NAMESPACE as SKL_NAMESPACE_VOCAB,\n SKL_PROPERTY,\n SKL_SPECS\n} from './util/Vocabularies';\nimport {\n OWL as OWL_VOCAB,\n R2RML as R2RML_VOCAB,\n RDF as RDF_VOCAB,\n RDFS as RDFS_VOCAB, SHACL as SHACL_VOCAB, SHACL_NAMESPACE as SHACL_NAMESPACE_VOCAB, XSD as XSD_VOCAB\n} from './util/Vocabularies/Shared';\n\nexport const SKL_NAMESPACE = SKL_NAMESPACE_VOCAB;\nexport const SKL_DATA_NAMESPACE = SKL_DATA_NAMESPACE_VOCAB;\nexport const SKL_ENGINE_NAMESPACE = SKL_ENGINE_NAMESPACE_VOCAB;\n\nexport const OWL = OWL_VOCAB;\nexport const RDF = RDF_VOCAB;\nexport const RDFS = RDFS_VOCAB;\nexport const R2RML = R2RML_VOCAB;\nexport const XSD = XSD_VOCAB;\nexport const SHACL = SHACL_VOCAB;\nexport const SHACL_NAMESPACE = SHACL_NAMESPACE_VOCAB;\nexport const PROP_ENTITY_ID = '@id';\nexport const PROP_ENTITY_TYPE = '@type';\nexport const PROP_ENTITY_VALUE = '@value';\n\n// RML constants\n\nexport const RML_LIST = '@list';\n\nexport const OPEN_API_RUNTIME_AUTHORIZATION = 'getOpenApiRuntimeAuthorization';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EngineConstants = {\n spec: {\n capability: SKL_SPECS.Capability,\n capabilityMapping: SKL_SPECS.CapabilityMapping,\n triggerCapabilityMapping: SKL_SPECS.TriggerCapabilityMapping,\n invalidTokenErrorMatcher: SKL_SPECS['integration/InvalidTokenErrorMatcher'],\n jsonDataSource: SKL_SPECS.JsonDataSource,\n mapping: SKL_SPECS.Mapping,\n inputs: SKL_SPECS.Inputs,\n openApi: SKL_SPECS.OpenAPI,\n codeBlock: SKL_SPECS.CodeBlock,\n integrationAuthenticationCredential: SKL_SPECS['integration/AuthenticationCredential'],\n integrationInterface: SKL_SPECS['integration/IntegrationInterface']\n },\n prop: {\n capability: SKL_PROPERTY.capability,\n inputs: SKL_PROPERTY.inputs,\n outputs: SKL_PROPERTY.outputs,\n inputsContext: SKL_PROPERTY.inputsContext,\n outputsContext: SKL_PROPERTY.outputsContext,\n invalidTokenErrorMatcher: SKL_PROPERTY['integration/invalidTokenErrorMatcher'],\n invalidTokenErrorMatcherStatus: SKL_PROPERTY['integration/invalidTokenErrorMatcherStatus'],\n invalidTokenErrorMatcherMessageRegex: SKL_PROPERTY['integration/invalidTokenErrorMatcherMessageRegex'],\n refreshCapability: SKL_PROPERTY['integration/refreshCapability'],\n refreshToken: SKL_PROPERTY['integration/credential/refreshToken'],\n jwtBearerOptions: SKL_PROPERTY['integration/credential/jwtBearerOptions'],\n accessToken: SKL_PROPERTY['integration/credential/accessToken'],\n bearerToken: SKL_PROPERTY['integration/credential/bearerToken'],\n username: SKL_PROPERTY['integration/username'],\n password: SKL_PROPERTY['integration/password'],\n oneTimePassword: SKL_PROPERTY['integration/oneTimePassword'],\n apiKey: SKL_PROPERTY['integration/apiKey'],\n declarativeApiDescription: SKL_PROPERTY['integration/declarativeApiDescription'],\n overrideBasePath: SKL_PROPERTY['integration/overrideBasePath'],\n schemeName: SKL_PROPERTY['integration/schemeName'],\n oauthFlow: SKL_PROPERTY['integration/oauthFlow'],\n stage: SKL_PROPERTY['integration/stage'],\n operationId: SKL_PROPERTY.operationId,\n\n data: SKL_PROPERTY.data,\n source: SKL_PROPERTY.source,\n headers: SKL_PROPERTY.headers,\n object: SKL_PROPERTY.object,\n dataSource: SKL_PROPERTY.dataSource,\n\n series: SKL_PROPERTY['mapping/series'],\n parallel: SKL_PROPERTY['mapping/parallel'],\n inputsReference: SKL_PROPERTY['mapping/inputsReference'],\n inputsMapping: SKL_PROPERTY['mapping/inputsMapping'],\n inputsMappingFrame: SKL_PROPERTY['mapping/inputsMappingFrame'],\n inputsMappingRef: SKL_PROPERTY['mapping/inputsMappingRef'],\n inputsMappingFrameRef: SKL_PROPERTY['mapping/inputsMappingFrameRef'],\n outputsMapping: SKL_PROPERTY['mapping/outputsMapping'],\n outputsMappingFrame: SKL_PROPERTY['mapping/outputsMappingFrame'],\n preProcessingMapping: SKL_PROPERTY['mapping/preProcessingMapping'],\n preProcessingMappingFrame: SKL_PROPERTY['mapping/preProcessingMappingFrame'],\n operationMapping: SKL_PROPERTY['mapping/operationMapping'],\n\n type: SKL_PROPERTY.type,\n dateCreated: SKL_PROPERTY.dateTimeCreated,\n dateModified: SKL_PROPERTY.dateTimeModified,\n label: SKL_PROPERTY.label,\n identifier: SKL_PROPERTY.identifier,\n codeBody: SKL_PROPERTY['content/codeBody'],\n codeBlocks: SKL_PROPERTY['content/codeBlocks'],\n integration: SKL_PROPERTY['integration/integration'],\n accountOrUser: SKL_PROPERTY.accountOrUser,\n\n capabilityType: SKL_PROPERTY.capabilityType\n },\n dataSource: {\n update: SKL_ENGINE.update,\n findAll: SKL_ENGINE.findAll,\n findAllBy: SKL_ENGINE.findAllBy,\n find: SKL_ENGINE.find,\n findBy: SKL_ENGINE.findBy,\n exists: SKL_ENGINE.exists,\n existsResult: SKL_ENGINE.existsResult,\n count: SKL_ENGINE.count,\n countResult: SKL_ENGINE.countResult,\n save: SKL_ENGINE.save,\n destroy: SKL_ENGINE.destroy\n }\n};\n"]}
@@ -0,0 +1,22 @@
1
+ import type { NodeObject } from 'jsonld';
2
+ import type { CapabilityConfig, JSONObject, OrArray } from './util/Types';
3
+ export declare type CustomCapabilityHandler = (args: JSONObject, sklEngine: any, capabilityConfig?: CapabilityConfig) => Promise<OrArray<NodeObject>>;
4
+ declare class GlobalCustomCapabilitiesRegistry {
5
+ private readonly customCapabilities;
6
+ register(capabilityId: string, handler: CustomCapabilityHandler): void;
7
+ unregister(capabilityId: string): boolean;
8
+ has(capabilityId: string): boolean;
9
+ execute(capabilityId: string, args: JSONObject, sklEngine: any, capabilityConfig?: CapabilityConfig): Promise<OrArray<NodeObject>>;
10
+ getAll(): string[];
11
+ clear(): void;
12
+ }
13
+ declare const globalCustomCapabilities: GlobalCustomCapabilitiesRegistry;
14
+ export declare const customCapabilities: {
15
+ register(capabilityId: string, handler: CustomCapabilityHandler): void;
16
+ unregister: (capabilityId: string) => boolean;
17
+ has: (capabilityId: string) => boolean;
18
+ getAll: () => string[];
19
+ clear: () => void;
20
+ };
21
+ export { globalCustomCapabilities };
22
+ //# sourceMappingURL=customCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customCapabilities.d.ts","sourceRoot":"","sources":["../src/customCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI1E,oBAAY,uBAAuB,GAAG,CACpC,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,GAAG,EACd,gBAAgB,CAAC,EAAE,gBAAgB,KAChC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AAGlC,cAAM,gCAAgC;IACpC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAmD;IAE/E,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAItE,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAIzC,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAI5B,OAAO,CAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,GAAG,EACd,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAQxB,MAAM,IAAI,MAAM,EAAE;IAIlB,KAAK,IAAI,IAAI;CAGrB;AAGD,QAAA,MAAM,wBAAwB,kCAAyC,CAAC;AAGxE,eAAO,MAAM,kBAAkB;2BACN,MAAM,WAAW,uBAAuB,GAAG,IAAI;+BAG3C,MAAM,KAAG,OAAO;wBACvB,MAAM,KAAG,OAAO;kBACxB,MAAM,EAAE;iBACT,IAAI;CAChB,CAAC;AAGF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.globalCustomCapabilities = exports.customCapabilities = void 0;
4
+ // Global custom capabilities registry
5
+ class GlobalCustomCapabilitiesRegistry {
6
+ constructor() {
7
+ this.customCapabilities = new Map();
8
+ }
9
+ register(capabilityId, handler) {
10
+ this.customCapabilities.set(capabilityId, handler);
11
+ }
12
+ unregister(capabilityId) {
13
+ return this.customCapabilities.delete(capabilityId);
14
+ }
15
+ has(capabilityId) {
16
+ return this.customCapabilities.has(capabilityId);
17
+ }
18
+ async execute(capabilityId, args, sklEngine, capabilityConfig) {
19
+ const handler = this.customCapabilities.get(capabilityId);
20
+ if (!handler) {
21
+ throw new Error(`Custom capability '${capabilityId}' not found`);
22
+ }
23
+ return await handler(args, sklEngine, capabilityConfig);
24
+ }
25
+ getAll() {
26
+ return [...this.customCapabilities.keys()];
27
+ }
28
+ clear() {
29
+ this.customCapabilities.clear();
30
+ }
31
+ }
32
+ // Global instance
33
+ const globalCustomCapabilities = new GlobalCustomCapabilitiesRegistry();
34
+ exports.globalCustomCapabilities = globalCustomCapabilities;
35
+ // Export functions for external use
36
+ exports.customCapabilities = {
37
+ register(capabilityId, handler) {
38
+ globalCustomCapabilities.register(capabilityId, handler);
39
+ },
40
+ unregister: (capabilityId) => globalCustomCapabilities.unregister(capabilityId),
41
+ has: (capabilityId) => globalCustomCapabilities.has(capabilityId),
42
+ getAll: () => globalCustomCapabilities.getAll(),
43
+ clear: () => globalCustomCapabilities.clear()
44
+ };
45
+ //# sourceMappingURL=customCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customCapabilities.js","sourceRoot":"","sources":["../src/customCapabilities.ts"],"names":[],"mappings":";;;AAWA,sCAAsC;AACtC,MAAM,gCAAgC;IAAtC;QACmB,uBAAkB,GAAyC,IAAI,GAAG,EAAE,CAAC;IAkCxF,CAAC;IAhCQ,QAAQ,CAAC,YAAoB,EAAE,OAAgC;QACpE,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAEM,UAAU,CAAC,YAAoB;QACpC,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;IAEM,GAAG,CAAC,YAAoB;QAC7B,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,OAAO,CAClB,YAAoB,EACpB,IAAgB,EAChB,SAAc,EACd,gBAAmC;QAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1D,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,sBAAsB,YAAY,aAAa,CAAC,CAAC;SAClE;QACD,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC1D,CAAC;IAEM,MAAM;QACX,OAAO,CAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAE,CAAC;IAC/C,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CACF;AAED,kBAAkB;AAClB,MAAM,wBAAwB,GAAG,IAAI,gCAAgC,EAAE,CAAC;AAc/D,4DAAwB;AAZjC,oCAAoC;AACvB,QAAA,kBAAkB,GAAG;IAChC,QAAQ,CAAC,YAAoB,EAAE,OAAgC;QAC7D,wBAAwB,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IACD,UAAU,EAAE,CAAC,YAAoB,EAAW,EAAE,CAAC,wBAAwB,CAAC,UAAU,CAAC,YAAY,CAAC;IAChG,GAAG,EAAE,CAAC,YAAoB,EAAW,EAAE,CAAC,wBAAwB,CAAC,GAAG,CAAC,YAAY,CAAC;IAClF,MAAM,EAAE,GAAa,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE;IACzD,KAAK,EAAE,GAAS,EAAE,CAAC,wBAAwB,CAAC,KAAK,EAAE;CACpD,CAAC","sourcesContent":["import type { NodeObject } from 'jsonld';\nimport type { CapabilityConfig, JSONObject, OrArray } from './util/Types';\n\n// Define the custom capability handler type\n// Using any to avoid circular dependency\nexport type CustomCapabilityHandler = (\n args: JSONObject,\n sklEngine: any,\n capabilityConfig?: CapabilityConfig\n) => Promise<OrArray<NodeObject>>;\n\n// Global custom capabilities registry\nclass GlobalCustomCapabilitiesRegistry {\n private readonly customCapabilities: Map<string, CustomCapabilityHandler> = new Map();\n\n public register(capabilityId: string, handler: CustomCapabilityHandler): void {\n this.customCapabilities.set(capabilityId, handler);\n }\n\n public unregister(capabilityId: string): boolean {\n return this.customCapabilities.delete(capabilityId);\n }\n\n public has(capabilityId: string): boolean {\n return this.customCapabilities.has(capabilityId);\n }\n\n public async execute(\n capabilityId: string,\n args: JSONObject,\n sklEngine: any,\n capabilityConfig?: CapabilityConfig\n ): Promise<OrArray<NodeObject>> {\n const handler = this.customCapabilities.get(capabilityId);\n if (!handler) {\n throw new Error(`Custom capability '${capabilityId}' not found`);\n }\n return await handler(args, sklEngine, capabilityConfig);\n }\n\n public getAll(): string[] {\n return [ ...this.customCapabilities.keys() ];\n }\n\n public clear(): void {\n this.customCapabilities.clear();\n }\n}\n\n// Global instance\nconst globalCustomCapabilities = new GlobalCustomCapabilitiesRegistry();\n\n// Export functions for external use\nexport const customCapabilities = {\n register(capabilityId: string, handler: CustomCapabilityHandler): void {\n globalCustomCapabilities.register(capabilityId, handler);\n },\n unregister: (capabilityId: string): boolean => globalCustomCapabilities.unregister(capabilityId),\n has: (capabilityId: string): boolean => globalCustomCapabilities.has(capabilityId),\n getAll: (): string[] => globalCustomCapabilities.getAll(),\n clear: (): void => globalCustomCapabilities.clear()\n};\n\n// Export the registry instance for internal use\nexport { globalCustomCapabilities };\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=customCapabilitiesExample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customCapabilitiesExample.d.ts","sourceRoot":"","sources":["../../src/examples/customCapabilitiesExample.ts"],"names":[],"mappings":"AA2EA,OAAO,EAAG,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/naming-convention */
3
+ /* eslint-disable no-console */
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const index_1 = require("../index");
6
+ // Example 1: Simple custom capability
7
+ index_1.customCapabilities.register('greetUser', async (args) => ({
8
+ '@type': 'GreetingResult',
9
+ '@value': `Hello, ${args.name}! Welcome to SKL Engine.`
10
+ }));
11
+ // Example 2: Custom capability that uses SKL Engine instance
12
+ index_1.customCapabilities.register('countEntitiesWithProcessing', async (args, sklEngine) => {
13
+ try {
14
+ // Use the SKL engine to count entities
15
+ const count = await sklEngine.count(args);
16
+ // Add some processing
17
+ const processedCount = count * 2;
18
+ return {
19
+ '@type': 'ProcessedCountResult',
20
+ '@value': {
21
+ originalCount: count,
22
+ processedCount,
23
+ timestamp: new Date().toISOString()
24
+ }
25
+ };
26
+ }
27
+ catch (error) {
28
+ return {
29
+ '@type': 'ErrorResult',
30
+ '@value': {
31
+ error: error instanceof Error ? error.message : 'Unknown error',
32
+ timestamp: new Date().toISOString()
33
+ }
34
+ };
35
+ }
36
+ });
37
+ // Example 3: Custom capability that returns multiple results
38
+ index_1.customCapabilities.register('generateMultipleGreetings', async (args) => {
39
+ const names = args.names || [];
40
+ return names.map((name, index) => ({
41
+ '@type': 'IndexedGreeting',
42
+ '@value': {
43
+ index,
44
+ message: `Hello, ${name}!`,
45
+ timestamp: new Date().toISOString()
46
+ }
47
+ }));
48
+ });
49
+ // Usage example:
50
+ console.log('Custom capabilities registered:');
51
+ console.log('- greetUser');
52
+ console.log('- countEntitiesWithProcessing');
53
+ console.log('- generateMultipleGreetings');
54
+ console.log('\nAll registered capabilities:', index_1.customCapabilities.getAll());
55
+ // Check if capabilities exist
56
+ console.log('\nCapability checks:');
57
+ console.log('greetUser exists:', index_1.customCapabilities.has('greetUser'));
58
+ console.log('nonExistent exists:', index_1.customCapabilities.has('nonExistent'));
59
+ //# sourceMappingURL=customCapabilitiesExample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customCapabilitiesExample.js","sourceRoot":"","sources":["../../src/examples/customCapabilitiesExample.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,+BAA+B;;AAI/B,oCAA8C;AAG9C,sCAAsC;AACtC,0BAAkB,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,EAAC,IAAgB,EAAuB,EAAE,CAAC,CAAC;IACxF,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,UAAU,IAAI,CAAC,IAAc,0BAA0B;CAClE,CAAC,CAAC,CA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AAC/C,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC3B,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAC7C,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAE3C,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,0BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;AAE3E,8BAA8B;AAC9B,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AACpC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,0BAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AACtE,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,0BAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-console */\n\nimport type { NodeObject } from 'jsonld';\nimport type { SKLEngine } from '../index';\nimport { customCapabilities } from '../index';\nimport type { JSONObject } from '../util/Types';\n\n// Example 1: Simple custom capability\ncustomCapabilities.register('greetUser', async(args: JSONObject): Promise<NodeObject> => ({\n '@type': 'GreetingResult',\n '@value': `Hello, ${args.name as string}! Welcome to SKL Engine.`\n}));\n\n// Example 2: Custom capability that uses SKL Engine instance\ncustomCapabilities.register(\n 'countEntitiesWithProcessing',\n async(args: JSONObject, sklEngine: SKLEngine): Promise<NodeObject> => {\n try {\n // Use the SKL engine to count entities\n const count = await sklEngine.count(args);\n\n // Add some processing\n const processedCount = count * 2;\n\n return {\n '@type': 'ProcessedCountResult',\n '@value': {\n originalCount: count,\n processedCount,\n timestamp: new Date().toISOString()\n }\n };\n } catch (error: unknown) {\n return {\n '@type': 'ErrorResult',\n '@value': {\n error: error instanceof Error ? error.message : 'Unknown error',\n timestamp: new Date().toISOString()\n }\n };\n }\n }\n);\n\n// Example 3: Custom capability that returns multiple results\ncustomCapabilities.register(\n 'generateMultipleGreetings',\n async(args: JSONObject): Promise<NodeObject[]> => {\n const names = args.names as string[] || [];\n\n return names.map((name, index) => ({\n '@type': 'IndexedGreeting',\n '@value': {\n index,\n message: `Hello, ${name}!`,\n timestamp: new Date().toISOString()\n }\n }));\n }\n);\n\n// Usage example:\nconsole.log('Custom capabilities registered:');\nconsole.log('- greetUser');\nconsole.log('- countEntitiesWithProcessing');\nconsole.log('- generateMultipleGreetings');\n\nconsole.log('\\nAll registered capabilities:', customCapabilities.getAll());\n\n// Check if capabilities exist\nconsole.log('\\nCapability checks:');\nconsole.log('greetUser exists:', customCapabilities.has('greetUser'));\nconsole.log('nonExistent exists:', customCapabilities.has('nonExistent'));\n\nexport { };\n\n"]}
@@ -0,0 +1,216 @@
1
+ // executor.ts - Updated for current Deno versions
2
+ // Set up process communication
3
+ const decoder = new TextDecoder();
4
+ const encoder = new TextEncoder();
5
+
6
+ // Function to safely stringify any value
7
+ function safeStringify(obj, indent = 2) {
8
+ const cache = new Set();
9
+ return JSON.stringify(
10
+ obj,
11
+ (key, value) => {
12
+ if (typeof value === 'object' && value !== null) {
13
+ if (cache.has(value)) {
14
+ return '[Circular Reference]';
15
+ }
16
+ cache.add(value);
17
+ }
18
+ // Handle special types that don't stringify well
19
+ if (value instanceof Error) {
20
+ return { name: value.name, message: value.message, stack: value.stack };
21
+ }
22
+ if (value instanceof RegExp || value instanceof Date) {
23
+ return value.toString();
24
+ }
25
+ if (typeof value === 'function') {
26
+ return `[Function: ${value.name || 'anonymous'}]`;
27
+ }
28
+ return value;
29
+ },
30
+ indent,
31
+ );
32
+ }
33
+
34
+ // Import available plugins
35
+
36
+ // import { toArrayBuffer } from 'https://deno.land/std/streams/mod.ts';
37
+ import { Buffer } from 'node:buffer';
38
+ import { arrayBuffer } from 'node:stream/consumers';
39
+
40
+ // Define utility functions
41
+ const utils = {
42
+ formatDate: (date, format = 'ISO') => {
43
+ const dateObj = date instanceof Date ? date : new Date(date);
44
+ if (format === 'ISO') return dateObj.toISOString();
45
+ if (format === 'UTC') return dateObj.toUTCString();
46
+ return dateObj.toString();
47
+ },
48
+
49
+ slugify: (text) => {
50
+ return text
51
+ .toLowerCase()
52
+ .replace(/\s+/g, '-')
53
+ .replace(/[^\w\-]+/g, '')
54
+ .replace(/\-\-+/g, '-');
55
+ },
56
+
57
+ groupBy: (array, key) => {
58
+ return array.reduce((result, item) => {
59
+ const groupKey = item[key];
60
+ if (!result[groupKey]) {
61
+ result[groupKey] = [];
62
+ }
63
+ result[groupKey].push(item);
64
+ return result;
65
+ }, {});
66
+ },
67
+ };
68
+
69
+ // Check if code contains a function definition
70
+ function containsNamedFunction(code, functionName) {
71
+ // Look for function declarations
72
+ const functionRegex = new RegExp(`function\\s+${functionName}\\s*\\(`, 'g');
73
+ if (functionRegex.test(code)) return true;
74
+
75
+ // Look for arrow functions or function expressions
76
+ const arrowFunctionRegex = new RegExp(`(const|let|var)\\s+${functionName}\\s*=\\s*(async\\s+)?\\(?.*\\)?\\s*=>`, 'g');
77
+ if (arrowFunctionRegex.test(code)) return true;
78
+
79
+ // Look for object method definitions
80
+ const methodRegex = new RegExp(`${functionName}\\s*\\(.*\\)\\s*{`, 'g');
81
+ if (methodRegex.test(code)) return true;
82
+
83
+ return false;
84
+ }
85
+
86
+ // Main execution function
87
+ async function executeCode() {
88
+ try {
89
+ // Read input from stdin - updated for current Deno versions
90
+ const logs = [];
91
+ const inputText = decoder.decode(await arrayBuffer(Deno.stdin.readable));
92
+ const decodedText = Buffer.from(inputText, 'base64');
93
+ const decodedData = decoder.decode(decodedText);
94
+
95
+ // Deno.writeTextFileSync('/Users/avneeshraghav/Downloads/deno.txt', decodedData);
96
+
97
+ const inputData = JSON.parse(decodedData);
98
+
99
+ // Extract execution details
100
+ const { code, args, functionName = 'main', skdsEndpointUrl } = inputData;
101
+
102
+ const sklEngine = new SKLEngine({
103
+ type: "sparql",
104
+ endpointUrl: skdsEndpointUrl,
105
+ });
106
+
107
+ // Setup execution environment
108
+
109
+ // Custom console implementation
110
+ const console = {
111
+ log: (...args) => {
112
+ logs.push(args.map((arg) => (typeof arg === 'object' ? safeStringify(arg) : String(arg))).join(' '));
113
+ },
114
+ error: (...args) => {
115
+ logs.push(
116
+ `ERROR: ${args.map((arg) => (typeof arg === 'object' ? safeStringify(arg) : String(arg))).join(' ')}`,
117
+ );
118
+ },
119
+ warn: (...args) => {
120
+ logs.push(`WARN: ${args.map((arg) => (typeof arg === 'object' ? safeStringify(arg) : String(arg))).join(' ')}`);
121
+ },
122
+ info: (...args) => {
123
+ logs.push(`INFO: ${args.map((arg) => (typeof arg === 'object' ? safeStringify(arg) : String(arg))).join(' ')}`);
124
+ },
125
+ };
126
+
127
+ // Result object
128
+ const result = {
129
+ logs,
130
+ error: null,
131
+ result: null,
132
+ executionTime: 0,
133
+ };
134
+
135
+ try {
136
+ const startTime = performance.now();
137
+
138
+ // Wrap code execution in an async function to allow top-level await
139
+ const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
140
+
141
+ // Determine how to handle the code
142
+ let finalCode = code;
143
+ const hasNamedFunction = containsNamedFunction(code, functionName);
144
+
145
+ // If no main function is defined, wrap the code
146
+ if (!hasNamedFunction) {
147
+ // Check if the code is a simple expression (no statements ending with ;)
148
+ const isSimpleExpression =
149
+ !code.includes(';') &&
150
+ !code.includes('function') &&
151
+ !code.includes('class') &&
152
+ !code.includes('if') &&
153
+ !code.includes('for') &&
154
+ !code.trim().startsWith('//');
155
+
156
+ if (isSimpleExpression) {
157
+ // For simple expressions, return the evaluated result directly
158
+ finalCode = `function ${functionName}() { return (${code}); }`;
159
+ } else {
160
+ // For code blocks, wrap everything in a function
161
+ finalCode = `function ${functionName}() {\n${code}\n}`;
162
+ }
163
+ }
164
+
165
+ // Create the execution function with the processed code
166
+ const executeFn = new AsyncFunction(
167
+ 'args',
168
+ 'console',
169
+ 'utils',
170
+ 'sklEngine',
171
+ `
172
+ ${finalCode}
173
+
174
+ // Return result from the specified function
175
+ if (typeof ${functionName} === 'function') {
176
+ return ${functionName}();
177
+ } else {
178
+ throw new Error("Function '${functionName}' is not defined");
179
+ }
180
+ `,
181
+ );
182
+
183
+ // Execute with the provided context
184
+ result.result = await executeFn(args, console, utils, sklEngine);
185
+ result.executionTime = performance.now() - startTime;
186
+ } catch (error) {
187
+ result.error = {
188
+ message: error.message || 'Unknown execution error',
189
+ name: error.name,
190
+ stack: error.stack,
191
+ };
192
+ }
193
+
194
+ // Write result to stdout - updated for current Deno versions
195
+ await Deno.stdout.write(encoder.encode(safeStringify(result)));
196
+ } catch (err) {
197
+ // Handle errors in the outer execution context
198
+ const errorResult = {
199
+ logs: [],
200
+ error: {
201
+ message: `Error in Deno execution context: ${err.message}`,
202
+ name: err.name,
203
+ stack: err.stack,
204
+ },
205
+ result: null,
206
+ executionTime: 0,
207
+ };
208
+ await Deno.stdout.write(encoder.encode(JSON.stringify(errorResult)));
209
+ }
210
+ }
211
+
212
+ // Execute and catch any top-level errors
213
+ executeCode().catch((err) => {
214
+ console.error('Fatal error:', err);
215
+ Deno.exit(1);
216
+ });
@@ -0,0 +1,50 @@
1
+ import type { CapabilityMapping, Entity } from '../util/Types';
2
+ import type { SklHookContext } from './types';
3
+ export declare const HookTypes: {
4
+ CREATE: symbol;
5
+ READ: symbol;
6
+ UPDATE: symbol;
7
+ DELETE: symbol;
8
+ EXECUTE_CAPABILITY_MAPPING: symbol;
9
+ };
10
+ export declare const HookStages: {
11
+ BEFORE: symbol;
12
+ AFTER: symbol;
13
+ ERROR: symbol;
14
+ };
15
+ export declare type GlobalBeforeHook = (context: SklHookContext) => Promise<void> | void;
16
+ export declare type GlobalAfterHook = (context: SklHookContext, result: any) => Promise<any> | any;
17
+ export declare type GlobalErrorHook = (context: SklHookContext, error: Error) => Promise<void> | void;
18
+ export declare type GlobalExecuteCapabilityHook = (context: SklHookContext, capabilityMapping: CapabilityMapping) => Promise<void> | void;
19
+ declare class GlobalHooksRegistry {
20
+ private readonly hooks;
21
+ constructor();
22
+ /**
23
+ * Register a hook with optional priority (higher runs first)
24
+ */
25
+ register(type: symbol, stage: symbol, hook: GlobalBeforeHook | GlobalAfterHook | GlobalErrorHook, priority?: number): symbol;
26
+ /**
27
+ * Unregister a hook by its ID
28
+ */
29
+ unregister(hookId: symbol): boolean;
30
+ /**
31
+ * Execute hooks for a specific operation and stage
32
+ */
33
+ execute(type: symbol, stage: symbol, context: SklHookContext, resultOrError?: any): Promise<any>;
34
+ registerBeforeCreate(hook: GlobalBeforeHook, priority?: number): symbol;
35
+ registerAfterCreate(hook: GlobalAfterHook, priority?: number): symbol;
36
+ registerErrorCreate(hook: GlobalErrorHook, priority?: number): symbol;
37
+ registerBeforeRead(hook: GlobalBeforeHook, priority?: number): symbol;
38
+ registerBeforeExecuteCapabilityMapping(hook: GlobalExecuteCapabilityHook, priority?: number): symbol;
39
+ registerAfterExecuteCapabilityMapping(hook: GlobalAfterHook, priority?: number): symbol;
40
+ registerErrorExecuteCapabilityMapping(hook: GlobalErrorHook, priority?: number): symbol;
41
+ executeBeforeCreate(entities: Entity[], extras?: Partial<SklHookContext>): Promise<void>;
42
+ executeAfterCreate(entities: Entity | Entity[], extras?: Partial<SklHookContext>): Promise<any>;
43
+ executeErrorCreate(entities: Entity[], error: Error, extras?: Partial<SklHookContext>): Promise<void>;
44
+ executeBeforeExecuteCapabilityMapping(entities: Entity[], capabilityMapping: CapabilityMapping, extras?: Partial<SklHookContext>): Promise<void>;
45
+ executeAfterExecuteCapabilityMapping(entities: Entity[], capabilityMapping: CapabilityMapping, result: any, extras?: Partial<SklHookContext>): Promise<any>;
46
+ executeErrorExecuteCapabilityMapping(entities: Entity[], capabilityMapping: CapabilityMapping, error: Error, extras?: Partial<SklHookContext>): Promise<void>;
47
+ }
48
+ export declare const globalHooks: GlobalHooksRegistry;
49
+ export {};
50
+ //# sourceMappingURL=globalHooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/globalHooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iB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