@comake/skl-js-engine 1.3.9 → 1.3.10
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.
- package/dist/JsExecutor/PermissionBuilder.d.ts +1 -0
- package/dist/JsExecutor/PermissionBuilder.d.ts.map +1 -0
- package/dist/JsExecutor/PermissionBuilder.js.map +1 -1
- package/dist/JsExecutor/constants.d.ts +1 -0
- package/dist/JsExecutor/constants.d.ts.map +1 -0
- package/dist/JsExecutor/constants.js.map +1 -1
- package/dist/JsExecutor/denoUtils.d.ts +1 -0
- package/dist/JsExecutor/denoUtils.d.ts.map +1 -0
- package/dist/JsExecutor/denoUtils.js.map +1 -1
- package/dist/JsExecutor/errors.d.ts +1 -0
- package/dist/JsExecutor/errors.d.ts.map +1 -0
- package/dist/JsExecutor/errors.js.map +1 -1
- package/dist/JsExecutor/examples/basic/index.d.ts +1 -0
- package/dist/JsExecutor/examples/basic/index.d.ts.map +1 -0
- package/dist/JsExecutor/examples/basic/index.js.map +1 -1
- package/dist/JsExecutor/examples/basic/process.d.ts +1 -0
- package/dist/JsExecutor/examples/basic/process.d.ts.map +1 -0
- package/dist/JsExecutor/examples/basic/process.js.map +1 -1
- package/dist/JsExecutor/examples/jsExecutor/index.d.ts +1 -0
- package/dist/JsExecutor/examples/jsExecutor/index.d.ts.map +1 -0
- package/dist/JsExecutor/examples/jsExecutor/index.js.map +1 -1
- package/dist/JsExecutor/examples/jsExecutor/process.d.ts +1 -0
- package/dist/JsExecutor/examples/jsExecutor/process.d.ts.map +1 -0
- package/dist/JsExecutor/examples/jsExecutor/process.js.map +1 -1
- package/dist/JsExecutor/index.d.ts +1 -0
- package/dist/JsExecutor/index.d.ts.map +1 -0
- package/dist/JsExecutor/index.js.map +1 -1
- package/dist/JsExecutor/jsExecutor.d.ts +1 -0
- package/dist/JsExecutor/jsExecutor.d.ts.map +1 -0
- package/dist/JsExecutor/jsExecutor.js.map +1 -1
- package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts +1 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts.map +1 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcClient.js.map +1 -1
- package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts +1 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts.map +1 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcServer.js.map +1 -1
- package/dist/JsExecutor/jsonRpc/index.d.ts +1 -0
- package/dist/JsExecutor/jsonRpc/index.d.ts.map +1 -0
- package/dist/JsExecutor/jsonRpc/index.js.map +1 -1
- package/dist/JsExecutor/jsonRpc/types.d.ts +1 -0
- package/dist/JsExecutor/jsonRpc/types.d.ts.map +1 -0
- package/dist/JsExecutor/jsonRpc/types.js.map +1 -1
- package/dist/JsExecutor/transport/Transport.d.ts +1 -0
- package/dist/JsExecutor/transport/Transport.d.ts.map +1 -0
- package/dist/JsExecutor/transport/Transport.js.map +1 -1
- package/dist/JsExecutor/transport/base/BaseTransport.d.ts +1 -0
- package/dist/JsExecutor/transport/base/BaseTransport.d.ts.map +1 -0
- package/dist/JsExecutor/transport/base/BaseTransport.js.map +1 -1
- package/dist/JsExecutor/transport/index.d.ts +1 -0
- package/dist/JsExecutor/transport/index.d.ts.map +1 -0
- package/dist/JsExecutor/transport/index.js.map +1 -1
- package/dist/JsExecutor/transport/process/ProcessManager.d.ts +1 -0
- package/dist/JsExecutor/transport/process/ProcessManager.d.ts.map +1 -0
- package/dist/JsExecutor/transport/process/ProcessManager.js.map +1 -1
- package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts +1 -0
- package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts.map +1 -0
- package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js.map +1 -1
- package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts +1 -0
- package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts.map +1 -0
- package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js.map +1 -1
- package/dist/JsExecutor/transport/utils/MessageUtils.d.ts +1 -0
- package/dist/JsExecutor/transport/utils/MessageUtils.d.ts.map +1 -0
- package/dist/JsExecutor/transport/utils/MessageUtils.js.map +1 -1
- package/dist/JsExecutor/transport/utils/PollingUtils.d.ts +1 -0
- package/dist/JsExecutor/transport/utils/PollingUtils.d.ts.map +1 -0
- package/dist/JsExecutor/transport/utils/PollingUtils.js.map +1 -1
- package/dist/JsExecutor/types.d.ts +1 -0
- package/dist/JsExecutor/types.d.ts.map +1 -0
- package/dist/JsExecutor/types.js.map +1 -1
- package/dist/SklEngine.d.ts +1 -0
- package/dist/SklEngine.d.ts.map +1 -0
- package/dist/SklEngine.js.map +1 -1
- package/dist/SklEngineOptions.d.ts +1 -0
- package/dist/SklEngineOptions.d.ts.map +1 -0
- package/dist/SklEngineOptions.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/customCapabilities.d.ts +1 -0
- package/dist/customCapabilities.d.ts.map +1 -0
- package/dist/customCapabilities.js.map +1 -1
- package/dist/examples/customCapabilitiesExample.d.ts +1 -0
- package/dist/examples/customCapabilitiesExample.d.ts.map +1 -0
- package/dist/examples/customCapabilitiesExample.js.map +1 -1
- package/dist/hooks/globalHooks.d.ts +1 -0
- package/dist/hooks/globalHooks.d.ts.map +1 -0
- package/dist/hooks/globalHooks.js.map +1 -1
- package/dist/hooks/types.d.ts +1 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js.map +1 -1
- package/dist/mapping/Mapper.d.ts +1 -0
- package/dist/mapping/Mapper.d.ts.map +1 -0
- package/dist/mapping/Mapper.js.map +1 -1
- package/dist/storage/FindOperator.d.ts +1 -0
- package/dist/storage/FindOperator.d.ts.map +1 -0
- package/dist/storage/FindOperator.js.map +1 -1
- package/dist/storage/FindOptionsTypes.d.ts +1 -0
- package/dist/storage/FindOptionsTypes.d.ts.map +1 -0
- package/dist/storage/FindOptionsTypes.js.map +1 -1
- package/dist/storage/GroupOptionTypes.d.ts +1 -0
- package/dist/storage/GroupOptionTypes.d.ts.map +1 -0
- package/dist/storage/GroupOptionTypes.js.map +1 -1
- package/dist/storage/operator/And.d.ts +1 -0
- package/dist/storage/operator/And.d.ts.map +1 -0
- package/dist/storage/operator/And.js.map +1 -1
- package/dist/storage/operator/Contains.d.ts +1 -0
- package/dist/storage/operator/Contains.d.ts.map +1 -0
- package/dist/storage/operator/Contains.js.map +1 -1
- package/dist/storage/operator/Equal.d.ts +1 -0
- package/dist/storage/operator/Equal.d.ts.map +1 -0
- package/dist/storage/operator/Equal.js.map +1 -1
- package/dist/storage/operator/Exists.d.ts +1 -0
- package/dist/storage/operator/Exists.d.ts.map +1 -0
- package/dist/storage/operator/Exists.js.map +1 -1
- package/dist/storage/operator/GreaterThan.d.ts +1 -0
- package/dist/storage/operator/GreaterThan.d.ts.map +1 -0
- package/dist/storage/operator/GreaterThan.js.map +1 -1
- package/dist/storage/operator/GreaterThanOrEqual.d.ts +1 -0
- package/dist/storage/operator/GreaterThanOrEqual.d.ts.map +1 -0
- package/dist/storage/operator/GreaterThanOrEqual.js.map +1 -1
- package/dist/storage/operator/In.d.ts +1 -0
- package/dist/storage/operator/In.d.ts.map +1 -0
- package/dist/storage/operator/In.js.map +1 -1
- package/dist/storage/operator/Inverse.d.ts +1 -0
- package/dist/storage/operator/Inverse.d.ts.map +1 -0
- package/dist/storage/operator/Inverse.js.map +1 -1
- package/dist/storage/operator/InversePath.d.ts +1 -0
- package/dist/storage/operator/InversePath.d.ts.map +1 -0
- package/dist/storage/operator/InversePath.js.map +1 -1
- package/dist/storage/operator/InverseRelation.d.ts +1 -0
- package/dist/storage/operator/InverseRelation.d.ts.map +1 -0
- package/dist/storage/operator/InverseRelation.js.map +1 -1
- package/dist/storage/operator/InverseRelationOrder.d.ts +1 -0
- package/dist/storage/operator/InverseRelationOrder.d.ts.map +1 -0
- package/dist/storage/operator/InverseRelationOrder.js.map +1 -1
- package/dist/storage/operator/LessThan.d.ts +1 -0
- package/dist/storage/operator/LessThan.d.ts.map +1 -0
- package/dist/storage/operator/LessThan.js.map +1 -1
- package/dist/storage/operator/LessThanOrEqual.d.ts +1 -0
- package/dist/storage/operator/LessThanOrEqual.d.ts.map +1 -0
- package/dist/storage/operator/LessThanOrEqual.js.map +1 -1
- package/dist/storage/operator/Not.d.ts +1 -0
- package/dist/storage/operator/Not.d.ts.map +1 -0
- package/dist/storage/operator/Not.js.map +1 -1
- package/dist/storage/operator/OneOrMorePath.d.ts +1 -0
- package/dist/storage/operator/OneOrMorePath.d.ts.map +1 -0
- package/dist/storage/operator/OneOrMorePath.js.map +1 -1
- package/dist/storage/operator/Sequence.d.ts +1 -0
- package/dist/storage/operator/Sequence.d.ts.map +1 -0
- package/dist/storage/operator/Sequence.js.map +1 -1
- package/dist/storage/operator/SequencePath.d.ts +1 -0
- package/dist/storage/operator/SequencePath.d.ts.map +1 -0
- package/dist/storage/operator/SequencePath.js.map +1 -1
- package/dist/storage/operator/ZeroOrMorePath.d.ts +1 -0
- package/dist/storage/operator/ZeroOrMorePath.d.ts.map +1 -0
- package/dist/storage/operator/ZeroOrMorePath.js.map +1 -1
- package/dist/storage/query-adapter/QueryAdapter.d.ts +1 -0
- package/dist/storage/query-adapter/QueryAdapter.d.ts.map +1 -0
- package/dist/storage/query-adapter/QueryAdapter.js.map +1 -1
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.js +16 -3
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapter.js.map +1 -1
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/SparqlQueryAdapterOptions.js.map +1 -1
- package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.js +7 -22
- package/dist/storage/query-adapter/sparql/SparqlQueryBuilder.js.map +1 -1
- package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/SparqlUpdateBuilder.js.map +1 -1
- package/dist/storage/query-adapter/sparql/VariableGenerator.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/VariableGenerator.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/VariableGenerator.js.map +1 -1
- package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.js.map +1 -1
- package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.js.map +1 -1
- package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.d.ts +1 -0
- package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.d.ts.map +1 -0
- package/dist/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.js.map +1 -1
- package/dist/util/PerformanceLogger.d.ts +1 -0
- package/dist/util/PerformanceLogger.d.ts.map +1 -0
- package/dist/util/PerformanceLogger.js.map +1 -1
- package/dist/util/SparqlUtil.d.ts +1 -0
- package/dist/util/SparqlUtil.d.ts.map +1 -0
- package/dist/util/SparqlUtil.js.map +1 -1
- package/dist/util/TripleUtil.d.ts +1 -0
- package/dist/util/TripleUtil.d.ts.map +1 -0
- package/dist/util/TripleUtil.js.map +1 -1
- package/dist/util/Types.d.ts +1 -0
- package/dist/util/Types.d.ts.map +1 -0
- package/dist/util/Types.js.map +1 -1
- package/dist/util/Util.d.ts +1 -0
- package/dist/util/Util.d.ts.map +1 -0
- package/dist/util/Util.js.map +1 -1
- package/dist/util/Vocabularies/Shared.d.ts +1 -0
- package/dist/util/Vocabularies/Shared.d.ts.map +1 -0
- package/dist/util/Vocabularies/Shared.js.map +1 -1
- package/dist/util/Vocabularies/helper.d.ts +1 -0
- package/dist/util/Vocabularies/helper.d.ts.map +1 -0
- package/dist/util/Vocabularies/helper.js.map +1 -1
- package/dist/util/Vocabularies/index.d.ts +1 -0
- package/dist/util/Vocabularies/index.d.ts.map +1 -0
- package/dist/util/Vocabularies/index.js.map +1 -1
- package/dist/util/safeJsonStringify.d.ts +1 -0
- package/dist/util/safeJsonStringify.d.ts.map +1 -0
- package/dist/util/safeJsonStringify.js.map +1 -1
- package/package.json +6 -3
- package/src/JsExecutor/PermissionBuilder.ts +60 -0
- package/src/JsExecutor/constants.ts +27 -0
- package/src/JsExecutor/denoUtils.ts +20 -0
- package/src/JsExecutor/errors.ts +63 -0
- package/src/JsExecutor/examples/basic/index.ts +54 -0
- package/src/JsExecutor/examples/basic/process.ts +39 -0
- package/src/JsExecutor/examples/jsExecutor/README.md +3 -0
- package/src/JsExecutor/examples/jsExecutor/index.ts +50 -0
- package/src/JsExecutor/examples/jsExecutor/process.ts +79 -0
- package/src/JsExecutor/index.ts +19 -0
- package/src/JsExecutor/jsExecutor.ts +194 -0
- package/src/JsExecutor/jsonRpc/JsonRpcClient.ts +422 -0
- package/src/JsExecutor/jsonRpc/JsonRpcServer.ts +454 -0
- package/src/JsExecutor/jsonRpc/index.ts +4 -0
- package/src/JsExecutor/jsonRpc/types.ts +231 -0
- package/src/JsExecutor/transport/README.md +67 -0
- package/src/JsExecutor/transport/Transport.ts +106 -0
- package/src/JsExecutor/transport/base/BaseTransport.ts +83 -0
- package/src/JsExecutor/transport/index.ts +56 -0
- package/src/JsExecutor/transport/process/ProcessManager.ts +281 -0
- package/src/JsExecutor/transport/stdio/ChildStdioTransport.ts +251 -0
- package/src/JsExecutor/transport/stdio/ParentStdioTransport.ts +308 -0
- package/src/JsExecutor/transport/utils/MessageUtils.ts +139 -0
- package/src/JsExecutor/transport/utils/PollingUtils.ts +114 -0
- package/src/JsExecutor/types.ts +130 -0
- package/src/SklEngine.ts +1828 -0
- package/src/SklEngineOptions.ts +28 -0
- package/src/constants.ts +120 -0
- package/src/customCapabilities.ts +65 -0
- package/src/examples/customCapabilitiesExample.ts +77 -0
- package/src/hooks/globalHooks.ts +238 -0
- package/src/hooks/types.ts +7 -0
- package/src/index.ts +45 -0
- package/src/logger.ts +144 -0
- package/src/mapping/Mapper.ts +52 -0
- package/src/storage/FindOperator.ts +55 -0
- package/src/storage/FindOptionsTypes.ts +107 -0
- package/src/storage/GroupOptionTypes.ts +32 -0
- package/src/storage/operator/And.ts +10 -0
- package/src/storage/operator/Contains.ts +9 -0
- package/src/storage/operator/Equal.ts +13 -0
- package/src/storage/operator/Exists.ts +6 -0
- package/src/storage/operator/GreaterThan.ts +12 -0
- package/src/storage/operator/GreaterThanOrEqual.ts +12 -0
- package/src/storage/operator/In.ts +12 -0
- package/src/storage/operator/Inverse.ts +11 -0
- package/src/storage/operator/InversePath.ts +17 -0
- package/src/storage/operator/InverseRelation.ts +18 -0
- package/src/storage/operator/InverseRelationOrder.ts +17 -0
- package/src/storage/operator/LessThan.ts +12 -0
- package/src/storage/operator/LessThanOrEqual.ts +12 -0
- package/src/storage/operator/Not.ts +11 -0
- package/src/storage/operator/OneOrMorePath.ts +17 -0
- package/src/storage/operator/Sequence.ts +11 -0
- package/src/storage/operator/SequencePath.ts +17 -0
- package/src/storage/operator/ZeroOrMorePath.ts +17 -0
- package/src/storage/query-adapter/QueryAdapter.ts +110 -0
- package/src/storage/query-adapter/sparql/SparqlQueryAdapter.ts +400 -0
- package/src/storage/query-adapter/sparql/SparqlQueryAdapterOptions.ts +38 -0
- package/src/storage/query-adapter/sparql/SparqlQueryBuilder.ts +1524 -0
- package/src/storage/query-adapter/sparql/SparqlUpdateBuilder.ts +347 -0
- package/src/storage/query-adapter/sparql/VariableGenerator.ts +8 -0
- package/src/storage/query-adapter/sparql/query-executor/InMemorySparqlQueryExecutor.ts +135 -0
- package/src/storage/query-adapter/sparql/query-executor/SparqlEndpointQueryExecutor.ts +146 -0
- package/src/storage/query-adapter/sparql/query-executor/SparqlQueryExecutor.ts +51 -0
- package/src/util/PerformanceLogger.ts +286 -0
- package/src/util/SparqlUtil.ts +516 -0
- package/src/util/TripleUtil.ts +412 -0
- package/src/util/Types.ts +399 -0
- package/src/util/Util.ts +116 -0
- package/src/util/Vocabularies/Shared.ts +99 -0
- package/src/util/Vocabularies/helper.ts +14 -0
- package/src/util/Vocabularies/index.ts +108 -0
- package/src/util/safeJsonStringify.ts +19 -0
- package/dist/JsExecutor/transport/StdioTransport.d.ts +0 -0
- package/dist/JsExecutor/transport/StdioTransport.js +0 -641
- package/dist/JsExecutor/transport/StdioTransport.js.map +0 -1
package/dist/util/Util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.js","sourceRoot":"","sources":["../../src/util/Util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uDAAoE;AACpE,+CAAiC;AAEjC,2BAAmC;AAEnC,iDAA0C;AAEnC,KAAK,UAAU,oBAAoB,CAAC,SAAc;IACvD,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC,CAAs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AC,EAAE;gBACJ,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAG,CAAC,IAAI,CAAe,CAAC;SACjD,CAAC;KACH;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AAVD,wCAUC;AAED,SAAgB,kBAAkB,CAAI,IAAY,EAAE,YAAe;IACjE,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACzB;IAAC,MAAM;QACN,OAAO,YAAY,CAAC;KACrB;AACH,CAAC;AAND,gDAMC;AAEY,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,kBAAG,CAAC,MAAM;IAClB,OAAO,EAAE,kBAAG,CAAC,OAAO;IACpB,OAAO,EAAE,kBAAG,CAAC,OAAO;IACpB,KAAK,EAAE,kBAAG,CAAC,KAAK;IAChB,MAAM,EAAE,kBAAG,CAAC,MAAM;IAClB,QAAQ,EAAE,kBAAG,CAAC,QAAQ;IACtB,IAAI,EAAE,kBAAG,CAAC,IAAI;CACf,CAAC;AAEF,SAAgB,cAAc,CAC5B,KAAQ,EACR,WAAyC,QAAQ;AACjD,gEAAgE;;IAEhE,OAAO;QACL,gEAAgE;QAChE,OAAO,EAAE,uBAAe,CAAC,QAAQ,CAAC;QAClC,gEAAgE;QAChE,QAAQ,EAAE,KAAK;KAChB,CAAC;AACJ,CAAC;AAXD,wCAWC","sourcesContent":["import type { ReferenceNodeObject } from '@comake/rmlmapper-js';\nimport { getIdFromNodeObjectIfDefined } from '@comake/rmlmapper-js';\nimport * as jsonld from 'jsonld';\nimport type { NodeObject, ValueObject } from 'jsonld';\nimport { Parser, Store } from 'n3';\nimport type { EntityFieldSingularValue, EntityFieldValue, JSONObject, RdfList } from './Types';\nimport { RDF, XSD } from './Vocabularies';\n\nexport async function convertJsonLdToQuads(jsonldDoc: any): Promise<Store> {\n const nquads = (await jsonld.toRDF(jsonldDoc, { format: 'application/n-quads' })) as unknown as string;\n const turtleParser = new Parser({ format: 'application/n-quads' });\n const store = new Store();\n turtleParser.parse(nquads).forEach((quad): void => {\n store.addQuad(quad);\n });\n return store;\n}\n\nexport function toJSON(jsonLd: NodeObject, convertBeyondFirstLevel = true): JSONObject {\n [ '@context', '@id', '@type' ].forEach((key): void => {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete jsonLd[key];\n });\n if (convertBeyondFirstLevel) {\n Object.keys(jsonLd).forEach((key): void => {\n if (Array.isArray(jsonLd[key])) {\n (jsonLd[key] as any[])!.forEach((item, index): void => {\n if (typeof item === 'object') {\n (jsonLd[key] as any[])[index] = toJSON(item);\n }\n });\n } else if (typeof jsonLd[key] === 'object') {\n jsonLd[key] = toJSON(jsonLd[key] as NodeObject);\n }\n });\n }\n return jsonLd as JSONObject;\n}\n\nexport function ensureArray<T>(arrayable: T | T[]): T[] {\n if (arrayable !== null && arrayable !== undefined) {\n return Array.isArray(arrayable) ? arrayable : [ arrayable ];\n }\n return [];\n}\n\nexport function getValueIfDefined<T>(fieldValue?: EntityFieldValue): T | undefined {\n if (fieldValue && Array.isArray(fieldValue)) {\n return fieldValue.map(\n (valueItem): EntityFieldSingularValue => getValueIfDefined<EntityFieldSingularValue>(valueItem)!\n ) as unknown as T;\n }\n if (fieldValue && typeof fieldValue === 'object') {\n return (fieldValue as ValueObject)['@value'] as unknown as T;\n }\n if (fieldValue !== undefined && fieldValue !== null) {\n return fieldValue as unknown as T;\n }\n}\n\nexport function isUrl(value: any): boolean {\n if (typeof value !== 'string') {\n return false;\n }\n try {\n // eslint-disable-next-line no-new\n new URL(value);\n return true;\n } catch {\n return false;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function rdfListToArray<T extends NodeObject>(list: { '@list': T[] } | RdfList<T>): T[] {\n if (!('@list' in list)) {\n return [\n list[RDF.first],\n ...getIdFromNodeObjectIfDefined(list[RDF.rest] as ReferenceNodeObject) === RDF.nil\n ? []\n : rdfListToArray(list[RDF.rest] as RdfList<T>)\n ];\n }\n return list['@list'];\n}\n\nexport function parseJSONOrDefault<T>(json: string, defaultValue: T): T {\n try {\n return JSON.parse(json);\n } catch {\n return defaultValue;\n }\n}\n\nexport const dataTypeMapping = {\n string: XSD.string,\n boolean: XSD.boolean,\n integer: XSD.integer,\n float: XSD.float,\n double: XSD.double,\n dateTime: XSD.dateTime,\n json: RDF.JSON\n};\n\nexport function getEntityValue<T>(\n value: T,\n dataType: keyof typeof dataTypeMapping = 'string'\n // eslint-disable-next-line @typescript-eslint/naming-convention\n): { '@type': string; '@value': T } {\n return {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n '@type': dataTypeMapping[dataType],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n '@value': value\n };\n}\n"]}
|
|
@@ -10,3 +10,4 @@ export declare const R2RML: import("./helper").Namespace<"TriplesMap", "http://w
|
|
|
10
10
|
export declare const XSD: import("./helper").Namespace<"string" | "boolean" | "label" | "integer" | "double" | "decimal" | "float" | "positiveInteger" | "negativeInteger" | "int" | "date" | "time" | "dateTime", "http://www.w3.org/2001/XMLSchema#">;
|
|
11
11
|
export declare const OWL: import("./helper").Namespace<"Restriction" | "onProperty" | "allValuesFrom" | "Class" | "intersectionOf" | "someValuesFrom" | "ObjectProperty", "https://www.w3.org/2002/07/owl#">;
|
|
12
12
|
export declare const SHACL: import("./helper").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#">;
|
|
13
|
+
//# sourceMappingURL=Shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shared.d.ts","sourceRoot":"","sources":["../../../src/util/Vocabularies/Shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,sCAAsC,CAAC;AACjE,eAAO,MAAM,aAAa,gDAAgD,CAAC;AAC3E,eAAO,MAAM,cAAc,0CAA0C,CAAC;AACtE,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAC7D,eAAO,MAAM,aAAa,oCAAoC,CAAC;AAC/D,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAE7D,eAAO,MAAM,GAAG,mJAAqG,CAAC;AAEtH,eAAO,MAAM,IAAI,oHAAgF,CAAC;AAElG,eAAO,MAAM,KAAK,2EAAqD,CAAC;AAExE,eAAO,MAAM,GAAG,+NAcd,CAAC;AAEH,eAAO,MAAM,GAAG,oLAQd,CAAC;AAEH,eAAO,MAAM,KAAK,62BAyDhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shared.js","sourceRoot":"","sources":["../../../src/util/Vocabularies/Shared.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAE9B,QAAA,aAAa,GAAG,mCAAmC,CAAC;AACpD,QAAA,aAAa,GAAG,6CAA6C,CAAC;AAC9D,QAAA,cAAc,GAAG,uCAAuC,CAAC;AACzD,QAAA,eAAe,GAAG,6BAA6B,CAAC;AAChD,QAAA,aAAa,GAAG,iCAAiC,CAAC;AAClD,QAAA,eAAe,GAAG,6BAA6B,CAAC;AAEhD,QAAA,GAAG,GAAG,IAAA,wBAAe,EAAC,qBAAa,EAAE,CAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAA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C;AAEU,QAAA,KAAK,GAAG,IAAA,wBAAe,EAAC,uBAAe,EAAE;IACpD,WAAW;IACX,eAAe;IACf,SAAS;IACT,KAAK;IACL,WAAW;IACX,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,UAAU;IACV,MAAM;IACN,MAAM;IACN,aAAa;IACb,UAAU;IACV,UAAU;IACV,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,UAAU;IACV,SAAS;IACT,aAAa;IACb,KAAK;IACL,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,kBAAkB;IAClB,UAAU;IACV,cAAc;IACd,cAAc;IACd,WAAW;IACX,UAAU;IACV,cAAc;IACd,cAAc;IACd,WAAW;IACX,UAAU;IACV,SAAS;IACT,OAAO;IACP,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,8BAA8B;IAC9B,YAAY;IACZ,MAAM;IACN,aAAa;IACb,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,MAAM;CACP,CAAC,CAAC","sourcesContent":["import { createNamespace } from './helper';\n\nexport const XSD_NAMESPACE = 'http://www.w3.org/2001/XMLSchema#';\nexport const RDF_NAMESPACE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\nexport const RDFS_NAMESPACE = 'http://www.w3.org/2000/01/rdf-schema#';\nexport const R2RML_NAMESPACE = 'http://www.w3.org/ns/r2rml#';\nexport const OWL_NAMESPACE = 'https://www.w3.org/2002/07/owl#';\nexport const SHACL_NAMESPACE = 'http://www.w3.org/ns/shacl#';\n\nexport const RDF = createNamespace(RDF_NAMESPACE, [ 'Property', 'type', 'datatype', 'JSON', 'first', 'rest', 'nil' ]);\n\nexport const RDFS = createNamespace(RDFS_NAMESPACE, [ 'subClassOf', 'label', 'range', 'domain' ]);\n\nexport const R2RML = createNamespace(R2RML_NAMESPACE, [ 'TriplesMap' ]);\n\nexport const XSD = createNamespace(XSD_NAMESPACE, [\n 'boolean',\n 'integer',\n 'double',\n 'decimal',\n 'string',\n 'float',\n 'positiveInteger',\n 'negativeInteger',\n 'int',\n 'date',\n 'time',\n 'dateTime',\n 'label'\n]);\n\nexport const OWL = createNamespace(OWL_NAMESPACE, [\n 'Restriction',\n 'onProperty',\n 'allValuesFrom',\n 'Class',\n 'intersectionOf',\n 'someValuesFrom',\n 'ObjectProperty'\n]);\n\nexport const SHACL = createNamespace(SHACL_NAMESPACE, [\n 'NodeShape',\n 'PropertyShape',\n 'Literal',\n 'IRI',\n 'BlankNode',\n 'BlankNodeOrIRI',\n 'BlankNodeOrLiteral',\n 'IRIOrLiteral',\n 'property',\n 'path',\n 'name',\n 'description',\n 'minCount',\n 'maxCount',\n 'targetNode',\n 'targetClass',\n 'targetSubjectsOf',\n 'targetObjectOf',\n 'severity',\n 'message',\n 'deactivated',\n 'and',\n 'or',\n 'class',\n 'closed',\n 'ignoredProperties',\n 'datatype',\n 'disjoint',\n 'equals',\n 'in',\n 'languageIn',\n 'lessThan',\n 'lessThanOrEquals',\n 'maxCount',\n 'maxExclusive',\n 'maxInclusive',\n 'maxLength',\n 'minCount',\n 'minExclusive',\n 'minInclusive',\n 'minLength',\n 'nodeKind',\n 'pattern',\n 'flags',\n 'qualifiedMaxCount',\n 'qualifiedMinCount',\n 'qualifiedValueShape',\n 'qualifiedValueShapesDisjoint',\n 'uniqueLang',\n 'xone',\n 'inversePath',\n 'zeroOrMorePath',\n 'oneOrMorePath',\n 'zeroOrOnePath',\n 'alternativePath',\n 'node'\n]);\n"]}
|
|
@@ -2,3 +2,4 @@ export declare type Namespace<T extends string, TBase extends string> = {
|
|
|
2
2
|
[key in T]: `${TBase}${key}`;
|
|
3
3
|
};
|
|
4
4
|
export declare function createNamespace<T extends string, TBase extends string>(baseUri: TBase, localNames: T[]): Namespace<T, TBase>;
|
|
5
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/util/Vocabularies/helper.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,IAAI;KAC7D,GAAG,IAAI,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,EAAE;CAC7B,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,EACpE,OAAO,EAAE,KAAK,EACd,UAAU,EAAE,CAAC,EAAE,GACd,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAMrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/util/Vocabularies/helper.ts"],"names":[],"mappings":";;;AAIA,SAAgB,eAAe,CAC7B,OAAc,EACd,UAAe;IAEf,OAAO,UAAU,CAAC,MAAM,CACtB,CAAC,GAAwB,EAAE,SAAS,EAAuB,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,GAAG,SAAS,EAAE,EAAE,CAAC;IACjH,2EAA2E;IAC3E,EAAyB,CAC1B,CAAC;AACJ,CAAC;AATD,0CASC"}
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/util/Vocabularies/helper.ts"],"names":[],"mappings":";;;AAIA,SAAgB,eAAe,CAC7B,OAAc,EACd,UAAe;IAEf,OAAO,UAAU,CAAC,MAAM,CACtB,CAAC,GAAwB,EAAE,SAAS,EAAuB,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,GAAG,SAAS,EAAE,EAAE,CAAC;IACjH,2EAA2E;IAC3E,EAAyB,CAC1B,CAAC;AACJ,CAAC;AATD,0CASC","sourcesContent":["export type Namespace<T extends string, TBase extends string> = {\n [key in T]: `${TBase}${key}`;\n};\n\nexport function createNamespace<T extends string, TBase extends string>(\n baseUri: TBase,\n localNames: T[]\n): Namespace<T, TBase> {\n return localNames.reduce(\n (obj: Namespace<T, TBase>, localName): Namespace<T, TBase> => ({ ...obj, [localName]: `${baseUri}${localName}` }),\n // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter\n {} as Namespace<T, TBase>\n );\n}\n"]}
|
|
@@ -5,3 +5,4 @@ export declare const SKL_ENGINE_NAMESPACE = "https://skl.ai/skl-engine/";
|
|
|
5
5
|
export declare const SKL_SPECS: import("./helper").Namespace<"Capability" | "CapabilityMapping" | "TriggerCapabilityMapping" | "integration/InvalidTokenErrorMatcher" | "JsonDataSource" | "Mapping" | "Inputs" | "OpenAPI" | "CodeBlock" | "integration/AuthenticationCredential" | "integration/IntegrationInterface", "https://skl.ai/">;
|
|
6
6
|
export declare const SKL_PROPERTY: import("./helper").Namespace<"object" | "type" | "label" | "capabilityType" | "capability" | "inputs" | "outputs" | "inputsContext" | "outputsContext" | "integration/invalidTokenErrorMatcher" | "integration/invalidTokenErrorMatcherStatus" | "integration/invalidTokenErrorMatcherMessageRegex" | "integration/credential/refreshToken" | "integration/credential/jwtBearerOptions" | "integration/credential/accessToken" | "integration/credential/bearerToken" | "integration/username" | "integration/password" | "integration/oneTimePassword" | "integration/apiKey" | "integration/declarativeApiDescription" | "integration/overrideBasePath" | "integration/schemeName" | "integration/oauthFlow" | "integration/stage" | "operationId" | "data" | "source" | "dataSource" | "headers" | "mapping/series" | "mapping/parallel" | "mapping/inputsReference" | "mapping/inputsMapping" | "mapping/inputsMappingFrame" | "mapping/inputsMappingRef" | "mapping/inputsMappingFrameRef" | "mapping/outputsMapping" | "mapping/outputsMappingFrame" | "mapping/preProcessingMapping" | "mapping/preProcessingMappingFrame" | "mapping/operationMapping" | "dateTimeCreated" | "dateTimeModified" | "identifier" | "content/codeBody" | "integration/integration" | "accountOrUser" | "content/codeBlocks", "https://skl.ai/">;
|
|
7
7
|
export declare const SKL_ENGINE: import("./helper").Namespace<"update" | "findAll" | "findAllBy" | "find" | "findBy" | "exists" | "existsResult" | "count" | "countResult" | "save" | "destroy", "https://skl.ai/skl-engine/">;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/Vocabularies/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AAEjE,eAAO,MAAM,SAAS,6SAYpB,CAAC;AAEH,eAAO,MAAM,YAAY,swCA0DvB,CAAC;AAeH,eAAO,MAAM,UAAU,+LAYrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/Vocabularies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA2C;AAE3C,2CAAyB;AAEZ,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AACzC,QAAA,oBAAoB,GAAG,4BAA4B,CAAC;AAEpD,QAAA,SAAS,GAAG,IAAA,wBAAe,EAAC,qBAAa,EAAE;IACtD,YAAY;IACZ,mBAAmB;IACnB,0BAA0B;IAC1B,sCAAsC;IACtC,gBAAgB;IAChB,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,sCAAsC;IACtC,kCAAkC;CACnC,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,IAAA,wBAAe,EAAC,qBAAa,EAAE;IAEzD,SAAS;IACT,gBAAgB;IAEhB,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,eAAe;IACf,gBAAgB;IAEhB,sCAAsC;IACtC,4CAA4C;IAC5C,kDAAkD;IAClD,qCAAqC;IACrC,yCAAyC;IACzC,oCAAoC;IACpC,oCAAoC;IACpC,sBAAsB;IACtB,sBAAsB;IACtB,6BAA6B;IAC7B,oBAAoB;IACpB,uCAAuC;IACvC,8BAA8B;IAC9B,wBAAwB;IACxB,uBAAuB;IACvB,mBAAmB;IACnB,aAAa;IAEb,MAAM;IACN,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,QAAQ;IAER,gBAAgB;IAChB,kBAAkB;IAClB,yBAAyB;IACzB,uBAAuB;IACvB,4BAA4B;IAC5B,0BAA0B;IAC1B,+BAA+B;IAC/B,wBAAwB;IACxB,6BAA6B;IAC7B,8BAA8B;IAC9B,mCAAmC;IACnC,0BAA0B;IAE1B,MAAM;IACN,iBAAiB;IACjB,kBAAkB;IAClB,OAAO;IACP,YAAY;IACZ,kBAAkB;IAClB,yBAAyB;IACzB,eAAe;IACf,oBAAoB;CACrB,CAAC,CAAC;AAEH,4EAA4E;AAC5E,kFAAkF;AAClF,iBAAiB;AACjB,aAAa;AACb,gBAAgB;AAChB,eAAe;AACf,cAAc;AACd,8BAA8B;AAC9B,MAAM;AAEN,gGAAgG;AAChG,qHAAqH;AAExG,QAAA,UAAU,GAAG,IAAA,wBAAe,EAAC,4BAAoB,EAAE;IAC9D,QAAQ;IACR,SAAS;IACT,WAAW;IACX,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,OAAO;IACP,aAAa;IACb,MAAM;IACN,SAAS;CACV,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/Vocabularies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA2C;AAE3C,2CAAyB;AAEZ,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AACzC,QAAA,oBAAoB,GAAG,4BAA4B,CAAC;AAEpD,QAAA,SAAS,GAAG,IAAA,wBAAe,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;IACR,cAAc;IACd,OAAO;IACP,aAAa;IACb,MAAM;IACN,SAAS;CACV,CAAC,CAAC","sourcesContent":["import { createNamespace } from './helper';\n\nexport * from './Shared';\n\nexport const SKL_NAMESPACE = 'https://skl.ai/';\nexport const SKL_DATA_NAMESPACE = 'https://skl.ai/d/';\nexport const SKL_ENGINE_NAMESPACE = 'https://skl.ai/skl-engine/';\n\nexport const SKL_SPECS = createNamespace(SKL_NAMESPACE, [\n 'Capability',\n 'CapabilityMapping',\n 'TriggerCapabilityMapping',\n 'integration/InvalidTokenErrorMatcher',\n 'JsonDataSource',\n 'Mapping',\n 'Inputs',\n 'OpenAPI',\n 'CodeBlock',\n 'integration/AuthenticationCredential',\n 'integration/IntegrationInterface'\n]);\n\nexport const SKL_PROPERTY = createNamespace(SKL_NAMESPACE, [\n\n // Review\n 'capabilityType',\n\n // Updated\n 'capability',\n 'inputs',\n 'outputs',\n 'inputsContext',\n 'outputsContext',\n\n 'integration/invalidTokenErrorMatcher',\n 'integration/invalidTokenErrorMatcherStatus',\n 'integration/invalidTokenErrorMatcherMessageRegex',\n 'integration/credential/refreshToken',\n 'integration/credential/jwtBearerOptions',\n 'integration/credential/accessToken',\n 'integration/credential/bearerToken',\n 'integration/username',\n 'integration/password',\n 'integration/oneTimePassword',\n 'integration/apiKey',\n 'integration/declarativeApiDescription',\n 'integration/overrideBasePath',\n 'integration/schemeName',\n 'integration/oauthFlow',\n 'integration/stage',\n 'operationId',\n\n 'data',\n 'source',\n 'dataSource',\n 'headers',\n 'object',\n\n 'mapping/series',\n 'mapping/parallel',\n 'mapping/inputsReference',\n 'mapping/inputsMapping',\n 'mapping/inputsMappingFrame',\n 'mapping/inputsMappingRef',\n 'mapping/inputsMappingFrameRef',\n 'mapping/outputsMapping',\n 'mapping/outputsMappingFrame',\n 'mapping/preProcessingMapping',\n 'mapping/preProcessingMappingFrame',\n 'mapping/operationMapping',\n\n 'type',\n 'dateTimeCreated',\n 'dateTimeModified',\n 'label',\n 'identifier',\n 'content/codeBody',\n 'integration/integration',\n 'accountOrUser',\n 'content/codeBlocks'\n]);\n\n// Export const SKLSO_INTEGRATION_NAMESPACE = 'https://skl.so/integration/';\n// Export const SKLSO_INTEGRATION = createNamespace(SKLSO_INTEGRATION_NAMESPACE, [\n// 'integration',\n// 'account',\n// 'credential',\n// 'interface',\n// 'username',\n// 'AuthenticationCredential',\n// ]);\n\n// export const SKLSO_INTEGRATION_INTERFACE_NAMESPACE = 'https://skl.so/integration/interface/';\n// export const SKLSO_INTEGRATION_INTERFACE = createNamespace(SKLSO_INTEGRATION_INTERFACE_NAMESPACE, ['RESTfulApi']);\n\nexport const SKL_ENGINE = createNamespace(SKL_ENGINE_NAMESPACE, [\n 'update',\n 'findAll',\n 'findAllBy',\n 'find',\n 'findBy',\n 'exists',\n 'existsResult',\n 'count',\n 'countResult',\n 'save',\n 'destroy'\n]);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=safeJsonStringify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeJsonStringify.d.ts","sourceRoot":"","sources":["../../src/util/safeJsonStringify.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeJsonStringify.js","sourceRoot":"","sources":["../../src/util/safeJsonStringify.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,8CAA8C;AAE9C,yCAAyC;AACzC,gCAAgC;AAChC,sDAAsD;AACtD,yDAAyD;AACzD,+BAA+B;AAC/B,mDAAmD;AACnD,kBAAkB;AAClB,UAAU;AACV,yBAAyB;AACzB,QAAQ;AACR,oBAAoB;AACpB,QAAQ;AACR,IAAI;AAEJ,6CAA6C;AAC7C,sCAAsC"}
|
|
1
|
+
{"version":3,"file":"safeJsonStringify.js","sourceRoot":"","sources":["../../src/util/safeJsonStringify.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,8CAA8C;AAE9C,yCAAyC;AACzC,gCAAgC;AAChC,sDAAsD;AACtD,yDAAyD;AACzD,+BAA+B;AAC/B,mDAAmD;AACnD,kBAAkB;AAClB,UAAU;AACV,yBAAyB;AACzB,QAAQ;AACR,oBAAoB;AACpB,QAAQ;AACR,IAAI;AAEJ,6CAA6C;AAC7C,sCAAsC","sourcesContent":["// // Preserve the native JSON.stringify\n// const nativeJSONStringify = JSON.stringify;\n\n// function stringifyCircular(obj: any) {\n// const seen = new WeakSet();\n// return nativeJSONStringify(obj, (key, value) => {\n// if (value !== null && typeof value === 'object') {\n// if (seen.has(value)) {\n// // Circular reference found, discard key\n// return;\n// }\n// seen.add(value);\n// }\n// return value;\n// });\n// }\n\n// global.JSON.stringify = stringifyCircular;\n// JSON.stringify = stringifyCircular;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comake/skl-js-engine",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"description": "Standard Knowledge Language Javascript Engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skl",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"email": "adler@comake.io"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "tsc && cp executor.js dist/",
|
|
24
|
+
"build": "tsc -p tsconfig.json && cp executor.js dist/",
|
|
25
|
+
"build:dev": "tsc -p tsconfig.dev.json && cp executor.js dist/",
|
|
26
|
+
"build:watch": "tsc -p tsconfig.dev.json --watch",
|
|
25
27
|
"jest": "jest --coverage",
|
|
26
28
|
"lint": "eslint . --cache --ignore-path .gitignore --ignore-pattern test/ --max-warnings 0 --fix",
|
|
27
29
|
"test": "npm run test:ts && npm run jest",
|
|
@@ -35,7 +37,8 @@
|
|
|
35
37
|
"main": "./dist/index.js",
|
|
36
38
|
"types": "./dist/index.d.ts",
|
|
37
39
|
"files": [
|
|
38
|
-
"dist"
|
|
40
|
+
"dist",
|
|
41
|
+
"src"
|
|
39
42
|
],
|
|
40
43
|
"commitlint": {
|
|
41
44
|
"extends": [
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { PermissionConfig } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Builds Deno permissions array based on options
|
|
5
|
+
* @param config - Permission configuration
|
|
6
|
+
* @returns Array of permission strings for Deno command
|
|
7
|
+
*/
|
|
8
|
+
export function buildDenoPermissions(config: PermissionConfig): string[] {
|
|
9
|
+
const permissions: string[] = [];
|
|
10
|
+
|
|
11
|
+
// Add network permissions if enabled
|
|
12
|
+
if (config.allowNetwork) {
|
|
13
|
+
if (config.allowedDomains.length > 0) {
|
|
14
|
+
permissions.push(`--allow-net=${config.allowedDomains.join(',')}`);
|
|
15
|
+
} else {
|
|
16
|
+
permissions.push('--allow-net');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Add env permissions if enabled
|
|
21
|
+
if (config.allowEnv) {
|
|
22
|
+
permissions.push('--allow-env');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Add read permissions if enabled
|
|
26
|
+
if (config.allowRead) {
|
|
27
|
+
permissions.push('--allow-read');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return permissions;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Basic domain validation
|
|
35
|
+
* @param domain - Domain to validate
|
|
36
|
+
* @returns True if domain format is valid
|
|
37
|
+
*/
|
|
38
|
+
function isValidDomain(domain: string): boolean {
|
|
39
|
+
// Basic domain validation - can be enhanced as needed
|
|
40
|
+
const domainRegex = /^[\dA-Za-z]([\dA-Za-z-]{0,61}[\dA-Za-z])?(\.[\dA-Za-z]([\dA-Za-z-]{0,61}[\dA-Za-z])?)*$/u;
|
|
41
|
+
return domainRegex.test(domain) && domain.length <= 253;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Validates permission configuration
|
|
46
|
+
* @param config - Permission configuration to validate
|
|
47
|
+
* @throws Error if configuration is invalid
|
|
48
|
+
*/
|
|
49
|
+
export function validatePermissionConfig(config: PermissionConfig): void {
|
|
50
|
+
if (config.allowedDomains.length > 0 && !config.allowNetwork) {
|
|
51
|
+
throw new Error('allowedDomains specified but allowNetwork is false');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Validate domain format
|
|
55
|
+
for (const domain of config.allowedDomains) {
|
|
56
|
+
if (!isValidDomain(domain)) {
|
|
57
|
+
throw new Error(`Invalid domain format: ${domain}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for JSExecutor configuration
|
|
3
|
+
*/
|
|
4
|
+
export const EXECUTION_CONSTANTS = {
|
|
5
|
+
defaultTimeout: 60 * 60 * 1000,
|
|
6
|
+
defaultFunctionName: 'main',
|
|
7
|
+
maxOutputLength: 500,
|
|
8
|
+
denoCommand: 'deno',
|
|
9
|
+
denoFlags: [ 'run', '--unstable-detect-cjs', '--quiet', '--unstable-sloppy-imports' ],
|
|
10
|
+
processSignals: {
|
|
11
|
+
term: 'SIGTERM'
|
|
12
|
+
}
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Default execution options
|
|
17
|
+
*/
|
|
18
|
+
export const DEFAULT_EXECUTION_OPTIONS = {
|
|
19
|
+
timeout: EXECUTION_CONSTANTS.defaultTimeout,
|
|
20
|
+
functionName: EXECUTION_CONSTANTS.defaultFunctionName,
|
|
21
|
+
allowNetwork: false,
|
|
22
|
+
allowedDomains: [],
|
|
23
|
+
allowEnv: true,
|
|
24
|
+
allowRead: false,
|
|
25
|
+
debugMode: false,
|
|
26
|
+
retries: 0
|
|
27
|
+
} as const;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { EXECUTION_CONSTANTS } from './constants';
|
|
4
|
+
import { ProcessSpawnError } from './errors';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Spawns a Deno process with the given arguments
|
|
8
|
+
* @param commandArgs - Command line arguments for Deno
|
|
9
|
+
* @returns The spawned child process
|
|
10
|
+
* @throws ProcessSpawnError if the process fails to spawn
|
|
11
|
+
*/
|
|
12
|
+
export function spawnDenoProcess(commandArgs: string[]): ChildProcess {
|
|
13
|
+
try {
|
|
14
|
+
return spawn(EXECUTION_CONSTANTS.denoCommand, commandArgs, {
|
|
15
|
+
stdio: [ 'pipe', 'pipe', 'pipe' ]
|
|
16
|
+
});
|
|
17
|
+
} catch (error: unknown) {
|
|
18
|
+
throw new ProcessSpawnError(error as Error);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error classes for better error handling in JSExecutor
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Error thrown when code execution times out
|
|
7
|
+
*/
|
|
8
|
+
export class ExecutionTimeoutError extends Error {
|
|
9
|
+
public constructor(timeout: number) {
|
|
10
|
+
super(`Execution timed out after ${timeout}ms`);
|
|
11
|
+
this.name = 'ExecutionTimeoutError';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Error thrown when the Deno process fails to spawn
|
|
17
|
+
*/
|
|
18
|
+
export class ProcessSpawnError extends Error {
|
|
19
|
+
public constructor(originalError: Error) {
|
|
20
|
+
super(`Failed to spawn Deno process: ${originalError.message}`);
|
|
21
|
+
this.name = 'ProcessSpawnError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown when the executor output cannot be parsed
|
|
27
|
+
*/
|
|
28
|
+
export class OutputParsingError extends Error {
|
|
29
|
+
public constructor(rawOutput: string, originalError: Error) {
|
|
30
|
+
super(`Failed to parse output: ${originalError.message}`);
|
|
31
|
+
this.name = 'OutputParsingError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Error thrown when code execution fails in general
|
|
37
|
+
*/
|
|
38
|
+
export class CodeExecutionError extends Error {
|
|
39
|
+
public constructor(message: string) {
|
|
40
|
+
super(`Failed to execute code: ${message}`);
|
|
41
|
+
this.name = 'CodeExecutionError';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Error thrown when the JSExecutor is not initialized
|
|
47
|
+
*/
|
|
48
|
+
export class NotInitializedError extends Error {
|
|
49
|
+
public constructor(message: string) {
|
|
50
|
+
super(message);
|
|
51
|
+
this.name = 'NotInitializedError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Error thrown when the JSExecutor is already initialized
|
|
57
|
+
*/
|
|
58
|
+
export class AlreadyInitializedError extends Error {
|
|
59
|
+
public constructor(message: string) {
|
|
60
|
+
super(message);
|
|
61
|
+
this.name = 'AlreadyInitializedError';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// /* eslint-disable func-style */
|
|
2
|
+
// /* eslint-disable no-console */
|
|
3
|
+
// import path from 'node:path';
|
|
4
|
+
// import { JsonRpcServer } from '../../transport/JsonRpcServer';
|
|
5
|
+
// import { StdioTransport } from '../../transport/StdioTransport';
|
|
6
|
+
|
|
7
|
+
// const server = new JsonRpcServer();
|
|
8
|
+
|
|
9
|
+
// // Register methods that the child process can call
|
|
10
|
+
// server.registerMethod('getTime', async(): Promise<{ result: string }> => {
|
|
11
|
+
// console.log('📅 Child requested current time');
|
|
12
|
+
// return {
|
|
13
|
+
// result: new Date().toISOString()
|
|
14
|
+
// };
|
|
15
|
+
// });
|
|
16
|
+
|
|
17
|
+
// // Handle notifications from child
|
|
18
|
+
// server.registerMethod('childNotification', async(params: { message: string; timestamp: string }): Promise<void> => {
|
|
19
|
+
// console.log('📨 Received notification from child:', params);
|
|
20
|
+
// // Notifications don't return responses
|
|
21
|
+
// });
|
|
22
|
+
|
|
23
|
+
// const stdioTransport = new StdioTransport(path.resolve(__dirname, './process.ts'), server);
|
|
24
|
+
// stdioTransport.setName('basic-example-parent');
|
|
25
|
+
|
|
26
|
+
// const main = async(): Promise<void> => {
|
|
27
|
+
// console.log('🚀 Starting parent process');
|
|
28
|
+
// await stdioTransport.initialize();
|
|
29
|
+
// console.log('✅ Child process initialized');
|
|
30
|
+
|
|
31
|
+
// // Example: Make some calls to the child process using the new ergonomic API
|
|
32
|
+
// try {
|
|
33
|
+
// // Test basic ping
|
|
34
|
+
// // const pingResult = await stdioTransport.request('ping');
|
|
35
|
+
// // console.log('🏓 Ping result:', pingResult);
|
|
36
|
+
|
|
37
|
+
// // // Test child calling back to parent
|
|
38
|
+
// const callParentResult = await stdioTransport.request('callParent');
|
|
39
|
+
// console.log('🔄 Child callback result:', callParentResult);
|
|
40
|
+
|
|
41
|
+
// // // Test child sending notification
|
|
42
|
+
// // const notifyResult = await stdioTransport.request('sendNotification');
|
|
43
|
+
// // console.log('📤 Notification test result:', notifyResult);
|
|
44
|
+
|
|
45
|
+
// // // Test execute code method
|
|
46
|
+
// // const executeResult = await stdioTransport.request('executeCode', 'console.log("Hello from executed code!")');
|
|
47
|
+
// // console.log('⚡ Execute result:', executeResult);
|
|
48
|
+
// await stdioTransport.close();
|
|
49
|
+
// } catch (error: unknown) {
|
|
50
|
+
// console.error('❌ Error testing child methods:', (error as Error).message);
|
|
51
|
+
// }
|
|
52
|
+
// };
|
|
53
|
+
|
|
54
|
+
// main().catch(console.error);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// /* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
|
|
3
|
+
// // @ts-nocheck
|
|
4
|
+
// import { BidirectionalStdioTransport } from '../../transport/StdioTransport.ts';
|
|
5
|
+
|
|
6
|
+
// // Create a single transport that handles both server and client functionality
|
|
7
|
+
// const transport = new BidirectionalStdioTransport();
|
|
8
|
+
// transport.setName('basic-example-process');
|
|
9
|
+
|
|
10
|
+
// // Register methods that the parent can call (server functionality)
|
|
11
|
+
// transport.registerMethod('executeCode', async(message: string): Promise<{ result: string }> => ({
|
|
12
|
+
// result: 'Hello from the process'
|
|
13
|
+
// }));
|
|
14
|
+
|
|
15
|
+
// transport.registerMethod('ping', async(): Promise<string> => 'pong');
|
|
16
|
+
|
|
17
|
+
// // Register a method that demonstrates calling back to the parent (client functionality)
|
|
18
|
+
// transport.registerMethod('callParent', async(): Promise<{ result: string }> => {
|
|
19
|
+
// try {
|
|
20
|
+
// // Call the parent's getTime method
|
|
21
|
+
// const result = await transport.request('getTime');
|
|
22
|
+
// return { result: `Parent getTime returned: ${JSON.stringify(result)}` };
|
|
23
|
+
// } catch (error: unknown) {
|
|
24
|
+
// return { result: `Error calling parent: ${(error as Error).message}` };
|
|
25
|
+
// }
|
|
26
|
+
// });
|
|
27
|
+
|
|
28
|
+
// // Register a method that sends notifications to parent
|
|
29
|
+
// transport.registerMethod('sendNotification', async(): Promise<{ result: string }> => {
|
|
30
|
+
// // Send a notification (no response expected)
|
|
31
|
+
// await transport.notify('childNotification', {
|
|
32
|
+
// message: 'Hello from child process',
|
|
33
|
+
// timestamp: new Date().toISOString()
|
|
34
|
+
// });
|
|
35
|
+
// return { result: 'Notification sent to parent' };
|
|
36
|
+
// });
|
|
37
|
+
|
|
38
|
+
// // Initialize the transport (this sets up stdio communication)
|
|
39
|
+
// await transport.initialize();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable func-style */
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { JSExecutor } from '../../jsExecutor';
|
|
6
|
+
|
|
7
|
+
const jsExecutor = new JSExecutor(path.resolve(__dirname, './process.ts'), {
|
|
8
|
+
async getTime(): Promise<string> {
|
|
9
|
+
return new Date().toISOString();
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const main = async(): Promise<void> => {
|
|
14
|
+
await jsExecutor.initialize();
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const result = await jsExecutor.execute(
|
|
18
|
+
`
|
|
19
|
+
async function main() {
|
|
20
|
+
// Using SKL accessor - this gets converted to request('getTime', ...)
|
|
21
|
+
return await SKL.getTime({}, {
|
|
22
|
+
timeout: 50000,
|
|
23
|
+
retries: 0
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Alternative: direct request call (still works)
|
|
27
|
+
// return await request('getTime', {}, {
|
|
28
|
+
// timeout: 50000,
|
|
29
|
+
// retries: 0
|
|
30
|
+
// });
|
|
31
|
+
}
|
|
32
|
+
`,
|
|
33
|
+
{},
|
|
34
|
+
{
|
|
35
|
+
timeout: 50000,
|
|
36
|
+
functionName: 'main',
|
|
37
|
+
retries: 0
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
console.log({ result });
|
|
42
|
+
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error({ error });
|
|
45
|
+
} finally {
|
|
46
|
+
await jsExecutor.shutdown();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
3
|
+
/* eslint-disable prefer-arrow-callback */
|
|
4
|
+
|
|
5
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
import { ChildStdioTransport } from '../../transport/stdio/ChildStdioTransport.ts';
|
|
8
|
+
|
|
9
|
+
interface ExecuteCodeMessage {
|
|
10
|
+
code: string;
|
|
11
|
+
args: Record<string, any>;
|
|
12
|
+
functionName?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Create a single transport that handles both server and client functionality
|
|
16
|
+
const transport = new ChildStdioTransport();
|
|
17
|
+
transport.setName('jsExecutor-example-process');
|
|
18
|
+
|
|
19
|
+
// Register methods that the parent can call (server functionality)
|
|
20
|
+
transport.registerMethod(
|
|
21
|
+
'executeCode',
|
|
22
|
+
async(message: ExecuteCodeMessage): Promise<{ result: string }> => {
|
|
23
|
+
const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor;
|
|
24
|
+
const executeCode = new AsyncFunction(
|
|
25
|
+
'args',
|
|
26
|
+
'console',
|
|
27
|
+
'request',
|
|
28
|
+
'SKL',
|
|
29
|
+
`
|
|
30
|
+
${message.code}
|
|
31
|
+
try {
|
|
32
|
+
if (typeof ${message.functionName} === 'function') {
|
|
33
|
+
return await ${message.functionName}(args);
|
|
34
|
+
}
|
|
35
|
+
throw new Error('Function name is not defined');
|
|
36
|
+
} catch (error) {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// Const sklEngine = new SKLEngine({
|
|
43
|
+
// skdsEndpointUrl: 'http://localhost:3000'
|
|
44
|
+
// });
|
|
45
|
+
|
|
46
|
+
// Create SKL proxy that converts method calls to request calls
|
|
47
|
+
const SKL = new Proxy({}, {
|
|
48
|
+
get(target, prop) {
|
|
49
|
+
if (typeof prop === 'string') {
|
|
50
|
+
return async(...args: any[]) => {
|
|
51
|
+
// Convert method call to request call
|
|
52
|
+
// SKL.getTime() becomes request('getTime', {}, options)
|
|
53
|
+
const [ params = {}, options = {} ] = args;
|
|
54
|
+
return await transport.request(prop, params, options);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const result = await executeCode(message.args, console, transport.request.bind(transport), SKL);
|
|
61
|
+
return { result };
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
transport.registerMethod('ping', async(): Promise<string> => 'pong');
|
|
66
|
+
|
|
67
|
+
// Register a method that demonstrates calling back to the parent (client functionality)
|
|
68
|
+
// transport.registerMethod('callParent', async(): Promise<{ result: string }> => {
|
|
69
|
+
// try {
|
|
70
|
+
// // Call the parent's getTime method
|
|
71
|
+
// const result = await transport.request('getTime');
|
|
72
|
+
// return { result: `Parent getTime returned: ${JSON.stringify(result)}` };
|
|
73
|
+
// } catch (error: unknown) {
|
|
74
|
+
// return { result: `Error calling parent: ${(error as Error).message}` };
|
|
75
|
+
// }
|
|
76
|
+
// });
|
|
77
|
+
|
|
78
|
+
// Initialize the transport (this sets up stdio communication)
|
|
79
|
+
await transport.initialize();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Main executor class
|
|
2
|
+
// Constants
|
|
3
|
+
export { DEFAULT_EXECUTION_OPTIONS, EXECUTION_CONSTANTS } from './constants';
|
|
4
|
+
// Error classes
|
|
5
|
+
export { CodeExecutionError, ExecutionTimeoutError, OutputParsingError, ProcessSpawnError } from './errors';
|
|
6
|
+
export { JSExecutor } from './jsExecutor';
|
|
7
|
+
// Utility functions (for advanced usage)
|
|
8
|
+
export { buildDenoPermissions, validatePermissionConfig } from './PermissionBuilder';
|
|
9
|
+
export * from './transport';
|
|
10
|
+
// Types and interfaces
|
|
11
|
+
export type {
|
|
12
|
+
ExecutionOptions,
|
|
13
|
+
ExecutionResult,
|
|
14
|
+
ExecutorInput,
|
|
15
|
+
ExecutorOutput,
|
|
16
|
+
PermissionConfig,
|
|
17
|
+
ProcessCommunicationData
|
|
18
|
+
} from './types';
|
|
19
|
+
|