@lucern/sdk 1.0.11 → 1.0.13
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/CHANGELOG.md +10 -0
- package/README.md +24 -27
- package/dist/.generated +2 -0
- package/dist/accessControl.d.ts +19 -26
- package/dist/accessControl.js +195 -1423
- package/dist/adminClient.d.ts +52 -59
- package/dist/adminClient.js +364 -1142
- package/dist/answersClient.d.ts +5 -14
- package/dist/answersClient.js +19 -737
- package/dist/audience/index.d.ts +18 -18
- package/dist/audience/index.js +87 -90
- package/dist/audiencesClient.d.ts +19 -27
- package/dist/audiencesClient.js +107 -868
- package/dist/auditClient.d.ts +8 -15
- package/dist/auditClient.js +18 -791
- package/dist/authContext.d.ts +11 -16
- package/dist/authContext.js +122 -154
- package/dist/authDeviceClient.d.ts +8 -17
- package/dist/authDeviceClient.js +113 -102
- package/dist/beliefs/index.d.ts +16 -67
- package/dist/beliefs/index.js +20 -10181
- package/dist/beliefs/lifecycle.d.ts +10 -11
- package/dist/beliefs/lifecycle.js +78 -80
- package/dist/beliefsClient.d.ts +30 -35
- package/dist/beliefsClient.js +238 -994
- package/dist/boundaryClientSurface.d.ts +11 -16
- package/dist/boundaryClientSurface.js +49 -68
- package/dist/client.d.ts +82 -113
- package/dist/client.js +232 -10155
- package/dist/clientAssemblyTypes.d.ts +3 -3
- package/dist/clientAssemblyTypes.js +1 -2
- package/dist/clientConfig.d.ts +45 -59
- package/dist/clientConfig.js +1 -2
- package/dist/clientEvidenceCompat.d.ts +24 -14
- package/dist/clientEvidenceCompat.js +56 -64
- package/dist/clientGraphNamespaces.d.ts +3 -5
- package/dist/clientGraphNamespaces.js +170 -245
- package/dist/clientHelpers.d.ts +20 -25
- package/dist/clientHelpers.js +104 -127
- package/dist/clientKnowledgeNamespaces.d.ts +24 -54
- package/dist/clientKnowledgeNamespaces.js +506 -506
- package/dist/clientLocalHelpers.d.ts +11 -56
- package/dist/clientLocalHelpers.js +503 -732
- package/dist/clientPlatformNamespaces.d.ts +5 -53
- package/dist/clientPlatformNamespaces.js +229 -323
- package/dist/clientRuntime.d.ts +5 -53
- package/dist/clientRuntime.js +26 -30
- package/dist/clientWorkflowNamespaces.d.ts +6 -15
- package/dist/clientWorkflowNamespaces.js +529 -596
- package/dist/contextClient.d.ts +9 -17
- package/dist/contextClient.js +92 -805
- package/dist/contextFacade.d.ts +11 -2
- package/dist/contextFacade.js +10 -81
- package/dist/contextPackCompiler.d.ts +10 -11
- package/dist/contextPackCompiler.js +494 -1040
- package/dist/contextPackPolicy.d.ts +14 -15
- package/dist/contextPackPolicy.js +227 -305
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +169 -176
- package/dist/contextTypes.d.ts +14 -15
- package/dist/contextTypes.js +1 -2
- package/dist/contracts/api-enums.contract.d.ts +29 -30
- package/dist/contracts/api-enums.contract.js +162 -88
- package/dist/contracts/auth-session.contract.d.ts +13 -14
- package/dist/contracts/auth-session.contract.js +55 -52
- package/dist/contracts/context-pack.contract.d.ts +54 -55
- package/dist/contracts/context-pack.contract.js +160 -88
- package/dist/contracts/contextPack.d.ts +2 -1
- package/dist/contracts/contextPack.js +1 -97
- package/dist/contracts/index.d.ts +11 -12
- package/dist/contracts/index.js +10 -854
- package/dist/contracts/lens-filter.contract.d.ts +9 -10
- package/dist/contracts/lens-filter.contract.js +82 -58
- package/dist/contracts/lens-workflow.contract.d.ts +21 -23
- package/dist/contracts/lens-workflow.contract.js +48 -117
- package/dist/contracts/lensFilter.d.ts +2 -1
- package/dist/contracts/lensFilter.js +1 -71
- package/dist/contracts/lensWorkflow.d.ts +2 -2
- package/dist/contracts/lensWorkflow.js +1 -123
- package/dist/contracts/mcpTools.d.ts +16 -18
- package/dist/contracts/mcpTools.js +89 -123
- package/dist/contracts/prompt.contract.d.ts +4 -5
- package/dist/contracts/prompt.contract.js +23 -10
- package/dist/contracts/prompt.d.ts +2 -1
- package/dist/contracts/prompt.js +1 -11
- package/dist/contracts/sdk-tools.contract.d.ts +2 -1
- package/dist/contracts/sdk-tools.contract.js +1 -2
- package/dist/contracts/sdkTools.d.ts +2 -1
- package/dist/contracts/sdkTools.js +1 -26
- package/dist/contracts/tool-contracts.d.ts +2 -1
- package/dist/contracts/tool-contracts.js +1 -2
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -46
- package/dist/contracts/workflow-runtime.contract.js +241 -228
- package/dist/contracts/workflowRuntime.d.ts +2 -1
- package/dist/contracts/workflowRuntime.js +1 -244
- package/dist/contradictions/index.d.ts +8 -60
- package/dist/contradictions/index.js +11 -10175
- package/dist/control-plane.d.ts +17 -24
- package/dist/control-plane.js +124 -840
- package/dist/controlObjectOwnership.d.ts +19 -20
- package/dist/controlObjectOwnership.js +207 -201
- package/dist/coreClient.d.ts +23 -28
- package/dist/coreClient.js +567 -692
- package/dist/customTools.d.ts +17 -21
- package/dist/customTools.js +221 -221
- package/dist/decisions/index.d.ts +7 -58
- package/dist/decisions/index.js +14 -10177
- package/dist/decisionsClient.d.ts +25 -32
- package/dist/decisionsClient.js +113 -913
- package/dist/domainContext.d.ts +2 -1
- package/dist/domainContext.js +1 -2
- package/dist/edges/index.d.ts +21 -73
- package/dist/edges/index.js +12 -10176
- package/dist/embeddingsClient.d.ts +22 -30
- package/dist/embeddingsClient.js +73 -922
- package/dist/eventingClient.d.ts +23 -31
- package/dist/eventingClient.js +89 -918
- package/dist/events.d.ts +48 -49
- package/dist/events.js +257 -241
- package/dist/eventsCore.d.ts +20 -29
- package/dist/eventsCore.js +86 -830
- package/dist/evidence/index.d.ts +42 -61
- package/dist/evidence/index.js +13 -10176
- package/dist/evidenceClient.d.ts +13 -22
- package/dist/evidenceClient.js +34 -751
- package/dist/facade/context.d.ts +7 -8
- package/dist/facade/context.js +73 -72
- package/dist/functionSurface.d.ts +2 -156
- package/dist/functionSurface.js +1 -1460
- package/dist/functionSurfaceClient.d.ts +2 -9
- package/dist/functionSurfaceClient.js +1 -1460
- package/dist/gatewayFacades.d.ts +93 -296
- package/dist/gatewayFacades.factories.d.ts +209 -14
- package/dist/gatewayFacades.factories.js +545 -2228
- package/dist/gatewayFacades.js +284 -2627
- package/dist/generated/functionSurface.d.ts +149 -0
- package/dist/generated/functionSurface.js +749 -0
- package/dist/graphAnalysisClient.d.ts +41 -49
- package/dist/graphAnalysisClient.js +185 -974
- package/dist/graphClient.d.ts +53 -60
- package/dist/graphClient.js +219 -1090
- package/dist/graphIntel.d.ts +2 -4
- package/dist/graphIntel.js +1 -2
- package/dist/graphIntelligence.d.ts +4 -2
- package/dist/graphIntelligence.js +2 -46
- package/dist/graphRecommendationsClient.d.ts +15 -23
- package/dist/graphRecommendationsClient.js +70 -849
- package/dist/graphStateClassifierClient.d.ts +17 -25
- package/dist/graphStateClassifierClient.js +67 -908
- package/dist/harnessClient.d.ts +40 -47
- package/dist/harnessClient.js +198 -993
- package/dist/identityClient.d.ts +25 -33
- package/dist/identityClient.js +245 -1186
- package/dist/index.d.ts +73 -69
- package/dist/index.js +72 -13313
- package/dist/infisicalRuntime.d.ts +12 -14
- package/dist/infisicalRuntime.js +290 -297
- package/dist/jobsClient.d.ts +24 -32
- package/dist/jobsClient.js +101 -916
- package/dist/learningClient.d.ts +8 -16
- package/dist/learningClient.js +45 -809
- package/dist/lenses/index.d.ts +13 -65
- package/dist/lenses/index.js +11 -10175
- package/dist/mcpClient.d.ts +14 -23
- package/dist/mcpClient.js +115 -856
- package/dist/modelRuntimeClient.d.ts +18 -26
- package/dist/modelRuntimeClient.js +74 -894
- package/dist/nodes/index.d.ts +7 -58
- package/dist/nodes/index.js +14 -10177
- package/dist/ontologies/index.d.ts +21 -73
- package/dist/ontologies/index.js +14 -10178
- package/dist/ontologyClient.d.ts +23 -31
- package/dist/ontologyClient.js +138 -924
- package/dist/ontologyLinksClient.d.ts +16 -24
- package/dist/ontologyLinksClient.js +76 -886
- package/dist/opinion.d.ts +5 -6
- package/dist/opinion.js +21 -25
- package/dist/orgGraphSearchClient.d.ts +19 -27
- package/dist/orgGraphSearchClient.js +89 -857
- package/dist/packRuntime.d.ts +2 -2
- package/dist/packRuntime.js +1 -2
- package/dist/packsClient.d.ts +30 -37
- package/dist/packsClient.js +131 -906
- package/dist/policyClient.d.ts +21 -29
- package/dist/policyClient.js +267 -1026
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +9 -60
- package/dist/questions/index.js +15 -10178
- package/dist/realtime/index.d.ts +20 -16
- package/dist/realtime/index.js +30 -19
- package/dist/realtime/refs.d.ts +4 -6
- package/dist/realtime/refs.js +12 -7
- package/dist/realtime-refs.d.ts +1 -0
- package/dist/realtime-refs.js +1 -0
- package/dist/realtime.d.ts +1 -0
- package/dist/realtime.js +1 -0
- package/dist/reportsClient.d.ts +10 -19
- package/dist/reportsClient.js +48 -836
- package/dist/schemaClient.d.ts +16 -23
- package/dist/schemaClient.js +62 -832
- package/dist/sdkSurface.d.ts +18 -25
- package/dist/sdkSurface.js +135 -106
- package/dist/secrets.d.ts +2 -1
- package/dist/secrets.js +1 -2
- package/dist/sourcesClient.d.ts +11 -18
- package/dist/sourcesClient.js +18 -741
- package/dist/telemetryClient.d.ts +22 -30
- package/dist/telemetryClient.js +107 -931
- package/dist/toolRegistryClient.d.ts +27 -35
- package/dist/toolRegistryClient.js +116 -954
- package/dist/topics/index.d.ts +13 -64
- package/dist/topics/index.js +15 -10178
- package/dist/topicsClient.d.ts +19 -27
- package/dist/topicsClient.js +106 -894
- package/dist/types.d.ts +84 -87
- package/dist/types.js +1 -2
- package/dist/version.d.ts +2 -3
- package/dist/version.js +2 -5
- package/dist/workflowClient.d.ts +60 -65
- package/dist/workflowClient.js +343 -1219
- package/dist/worktrees/index.d.ts +16 -68
- package/dist/worktrees/index.js +14 -10178
- package/package.json +6 -6
- package/dist/accessControl.js.map +0 -1
- package/dist/adminClient.js.map +0 -1
- package/dist/answersClient.js.map +0 -1
- package/dist/audience/index.js.map +0 -1
- package/dist/audiencesClient.js.map +0 -1
- package/dist/auditClient.js.map +0 -1
- package/dist/authContext.js.map +0 -1
- package/dist/authDeviceClient.js.map +0 -1
- package/dist/beliefs/index.js.map +0 -1
- package/dist/beliefs/lifecycle.js.map +0 -1
- package/dist/beliefsClient.js.map +0 -1
- package/dist/boundaryClientSurface.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/clientAssemblyTypes.js.map +0 -1
- package/dist/clientConfig.js.map +0 -1
- package/dist/clientEvidenceCompat.js.map +0 -1
- package/dist/clientGraphNamespaces.js.map +0 -1
- package/dist/clientHelpers.js.map +0 -1
- package/dist/clientKnowledgeNamespaces.js.map +0 -1
- package/dist/clientLocalHelpers.js.map +0 -1
- package/dist/clientPlatformNamespaces.js.map +0 -1
- package/dist/clientRuntime.js.map +0 -1
- package/dist/clientWorkflowNamespaces.js.map +0 -1
- package/dist/contextClient.js.map +0 -1
- package/dist/contextFacade.js.map +0 -1
- package/dist/contextPackCompiler.js.map +0 -1
- package/dist/contextPackPolicy.js.map +0 -1
- package/dist/contextPackSchema.js.map +0 -1
- package/dist/contextTypes.js.map +0 -1
- package/dist/contracts/api-enums.contract.js.map +0 -1
- package/dist/contracts/auth-session.contract.js.map +0 -1
- package/dist/contracts/context-pack.contract.js.map +0 -1
- package/dist/contracts/contextPack.js.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/lens-filter.contract.js.map +0 -1
- package/dist/contracts/lens-workflow.contract.js.map +0 -1
- package/dist/contracts/lensFilter.js.map +0 -1
- package/dist/contracts/lensWorkflow.js.map +0 -1
- package/dist/contracts/mcpTools.js.map +0 -1
- package/dist/contracts/prompt.contract.js.map +0 -1
- package/dist/contracts/prompt.js.map +0 -1
- package/dist/contracts/sdk-tools.contract.js.map +0 -1
- package/dist/contracts/sdkTools.js.map +0 -1
- package/dist/contracts/tool-contracts.js.map +0 -1
- package/dist/contracts/workflow-runtime.contract.js.map +0 -1
- package/dist/contracts/workflowRuntime.js.map +0 -1
- package/dist/contradictions/index.js.map +0 -1
- package/dist/control-plane.js.map +0 -1
- package/dist/controlObjectOwnership.js.map +0 -1
- package/dist/coreClient.js.map +0 -1
- package/dist/customTools.js.map +0 -1
- package/dist/decisions/index.js.map +0 -1
- package/dist/decisionsClient.js.map +0 -1
- package/dist/domainContext.js.map +0 -1
- package/dist/edges/index.js.map +0 -1
- package/dist/embeddingsClient.js.map +0 -1
- package/dist/eventingClient.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/eventsCore.js.map +0 -1
- package/dist/evidence/index.js.map +0 -1
- package/dist/evidenceClient.js.map +0 -1
- package/dist/facade/context.js.map +0 -1
- package/dist/functionSurface.js.map +0 -1
- package/dist/functionSurfaceClient.js.map +0 -1
- package/dist/gatewayFacades.factories.js.map +0 -1
- package/dist/gatewayFacades.js.map +0 -1
- package/dist/graphAnalysisClient.js.map +0 -1
- package/dist/graphClient.js.map +0 -1
- package/dist/graphIntel.js.map +0 -1
- package/dist/graphIntelligence.js.map +0 -1
- package/dist/graphRecommendationsClient.js.map +0 -1
- package/dist/graphStateClassifierClient.js.map +0 -1
- package/dist/harnessClient.js.map +0 -1
- package/dist/identityClient.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infisicalRuntime.js.map +0 -1
- package/dist/jobsClient.js.map +0 -1
- package/dist/learningClient.js.map +0 -1
- package/dist/lenses/index.js.map +0 -1
- package/dist/mcpClient.js.map +0 -1
- package/dist/modelRuntimeClient.js.map +0 -1
- package/dist/nodes/index.js.map +0 -1
- package/dist/ontologies/index.js.map +0 -1
- package/dist/ontologyClient.js.map +0 -1
- package/dist/ontologyLinksClient.js.map +0 -1
- package/dist/opinion.js.map +0 -1
- package/dist/orgGraphSearchClient.js.map +0 -1
- package/dist/packRuntime.js.map +0 -1
- package/dist/packsClient.js.map +0 -1
- package/dist/policyClient.js.map +0 -1
- package/dist/questions/index.js.map +0 -1
- package/dist/realtime/index.js.map +0 -1
- package/dist/realtime/refs.js.map +0 -1
- package/dist/reportsClient.js.map +0 -1
- package/dist/schemaClient.js.map +0 -1
- package/dist/sdk-tools.contract-B4c1Zr1o.d.ts +0 -22
- package/dist/sdkSurface.js.map +0 -1
- package/dist/secrets.js.map +0 -1
- package/dist/sourcesClient.js.map +0 -1
- package/dist/telemetryClient.js.map +0 -1
- package/dist/tool-contracts-BUiL9P6z.d.ts +0 -22
- package/dist/toolRegistryClient.js.map +0 -1
- package/dist/topics/index.js.map +0 -1
- package/dist/topicsClient.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/workflowClient.js.map +0 -1
- package/dist/worktrees/index.js.map +0 -1
|
@@ -1,747 +1,518 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { mapOpinionHistoryEntriesFromGatewayData } from "./beliefsClient.js";
|
|
2
|
+
import { addEvidenceCompat, createEvidenceCompat, } from "./clientEvidenceCompat.js";
|
|
3
|
+
import { asNodeArray, matchesAuditNodeReference, normalizeCustomNamespace, normalizeCustomToolPayload, requireTopicId, requireTopicOrProjectId, sdkQueryString, } from "./clientHelpers.js";
|
|
4
|
+
import { randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
5
|
+
import { invokeRegisteredCustomTool, } from "./customTools.js";
|
|
6
|
+
import { asListItems, resolveTopicId } from "./sdkSurface.js";
|
|
7
|
+
export function createClientLocalHelpers(ctx) {
|
|
8
|
+
const { auditClient, beliefsFacade, customNamespaceCache, evidenceFacade, exposeGatewayData, graphClient, graphFacade, gateway, functionSurfaceClient, ontologyClient, ontologyLinksClient, searchFacade, } = ctx;
|
|
9
|
+
const invokeCustomTool = async (fullName, input = {}) => {
|
|
10
|
+
const payload = normalizeCustomToolPayload(input);
|
|
11
|
+
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
12
|
+
};
|
|
13
|
+
const getCustomNamespace = (namespace) => {
|
|
14
|
+
const normalized = normalizeCustomNamespace(namespace);
|
|
15
|
+
const cached = customNamespaceCache.get(normalized);
|
|
16
|
+
if (cached) {
|
|
17
|
+
return cached;
|
|
18
|
+
}
|
|
19
|
+
const proxy = new Proxy({}, {
|
|
20
|
+
get(_target, property) {
|
|
21
|
+
if (typeof property !== "string" || property === "then") {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
return async (input = {}) => invokeCustomTool(`${normalized}.${property}`, input);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
customNamespaceCache.set(normalized, proxy);
|
|
28
|
+
return proxy;
|
|
29
|
+
};
|
|
30
|
+
const extensionNamespaces = new Proxy({}, {
|
|
31
|
+
get(_target, namespace) {
|
|
32
|
+
if (typeof namespace !== "string" || namespace === "then") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
return getCustomNamespace(namespace);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const createEvidence = (args) => createEvidenceCompat(evidenceFacade, args);
|
|
39
|
+
const addEvidence = (args) => addEvidenceCompat(evidenceFacade, args);
|
|
40
|
+
async function listBeliefs(args) {
|
|
41
|
+
const response = await beliefsFacade.list({
|
|
42
|
+
topicId: requireTopicId(args),
|
|
43
|
+
status: args.status,
|
|
44
|
+
worktreeId: args.worktreeId,
|
|
45
|
+
minConfidence: args.minConfidence,
|
|
46
|
+
limit: args.limit,
|
|
47
|
+
cursor: args.cursor,
|
|
48
|
+
});
|
|
49
|
+
return Array.isArray(response.data.beliefs) ? response.data.beliefs : [];
|
|
19
50
|
}
|
|
20
|
-
|
|
21
|
-
|
|
51
|
+
async function searchBeliefs(args) {
|
|
52
|
+
const topicId = resolveTopicId(args);
|
|
53
|
+
if (!topicId) {
|
|
54
|
+
return { results: [] };
|
|
55
|
+
}
|
|
56
|
+
const response = await searchFacade.query({
|
|
57
|
+
q: args.query,
|
|
58
|
+
topicId,
|
|
59
|
+
types: ["belief"],
|
|
60
|
+
status: args.status,
|
|
61
|
+
minConfidence: args.minConfidence,
|
|
62
|
+
limit: args.limit,
|
|
63
|
+
});
|
|
64
|
+
const data = exposeGatewayData(response);
|
|
65
|
+
const groupedBeliefs = Array.isArray(data.beliefs)
|
|
66
|
+
? data.beliefs
|
|
67
|
+
: [];
|
|
68
|
+
const mergedResults = Array.isArray(data.results)
|
|
69
|
+
? data.results
|
|
70
|
+
: [];
|
|
71
|
+
const results = groupedBeliefs.length > 0
|
|
72
|
+
? groupedBeliefs
|
|
73
|
+
: mergedResults.filter((result) => result.type === "belief");
|
|
74
|
+
return { results };
|
|
22
75
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function generatePortableRequestId() {
|
|
40
|
-
if (typeof globalThis.crypto?.randomUUID === "function") {
|
|
41
|
-
return globalThis.crypto.randomUUID();
|
|
42
|
-
}
|
|
43
|
-
const bytes = fillRandomBytes(16);
|
|
44
|
-
bytes[6] = bytes[6] & 15 | 64;
|
|
45
|
-
bytes[8] = bytes[8] & 63 | 128;
|
|
46
|
-
const hex = Array.from(bytes, (value) => value.toString(16).padStart(2, "0"));
|
|
47
|
-
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(
|
|
48
|
-
6,
|
|
49
|
-
8
|
|
50
|
-
).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
51
|
-
}
|
|
52
|
-
var randomIdempotencyKey = generatePortableRequestId;
|
|
53
|
-
|
|
54
|
-
// src/sdkSurface.ts
|
|
55
|
-
function isRecord(value) {
|
|
56
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
57
|
-
}
|
|
58
|
-
function asRecord(value) {
|
|
59
|
-
return isRecord(value) ? value : {};
|
|
60
|
-
}
|
|
61
|
-
function cleanString(value) {
|
|
62
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
63
|
-
}
|
|
64
|
-
function resolveTopicId(value) {
|
|
65
|
-
return cleanString(value.topicId);
|
|
66
|
-
}
|
|
67
|
-
function resolveText(value) {
|
|
68
|
-
return cleanString(value.text) ?? cleanString(value.canonicalText);
|
|
69
|
-
}
|
|
70
|
-
function asListItems(data, legacyKey) {
|
|
71
|
-
if (Array.isArray(data)) {
|
|
72
|
-
return data;
|
|
73
|
-
}
|
|
74
|
-
const record = asRecord(data);
|
|
75
|
-
if (Array.isArray(record.items)) {
|
|
76
|
-
return record.items;
|
|
77
|
-
}
|
|
78
|
-
if (legacyKey && Array.isArray(record[legacyKey])) {
|
|
79
|
-
return record[legacyKey];
|
|
80
|
-
}
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// src/beliefsClient.ts
|
|
85
|
-
function asRecord2(value) {
|
|
86
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
87
|
-
}
|
|
88
|
-
function readString(value) {
|
|
89
|
-
if (typeof value !== "string") {
|
|
90
|
-
return void 0;
|
|
91
|
-
}
|
|
92
|
-
const normalized = value.trim();
|
|
93
|
-
return normalized.length > 0 ? normalized : void 0;
|
|
94
|
-
}
|
|
95
|
-
function readNumber(value) {
|
|
96
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
97
|
-
}
|
|
98
|
-
function clamp01(value) {
|
|
99
|
-
return Math.max(0, Math.min(1, value));
|
|
100
|
-
}
|
|
101
|
-
function normalizeOpinionTuple(record) {
|
|
102
|
-
const opinion = asRecord2(record.opinion);
|
|
103
|
-
const rawBelief = readNumber(opinion.b) ?? readNumber(record.belief);
|
|
104
|
-
const rawDisbelief = readNumber(opinion.d) ?? readNumber(record.disbelief);
|
|
105
|
-
const rawUncertainty = readNumber(opinion.u) ?? readNumber(record.uncertainty);
|
|
106
|
-
const rawBaseRate = readNumber(opinion.a) ?? readNumber(record.baseRate);
|
|
107
|
-
if (rawBelief === void 0 || rawDisbelief === void 0 || rawUncertainty === void 0 || rawBaseRate === void 0) {
|
|
108
|
-
throw new Error(
|
|
109
|
-
"Gateway opinion history entries must include belief, disbelief, uncertainty, and baseRate."
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
b: clamp01(rawBelief),
|
|
114
|
-
d: clamp01(rawDisbelief),
|
|
115
|
-
u: clamp01(rawUncertainty),
|
|
116
|
-
a: clamp01(rawBaseRate)
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function mapOpinionHistoryEntriesFromGatewayData(payload) {
|
|
120
|
-
const entries = Array.isArray(payload.entries) ? payload.entries : [];
|
|
121
|
-
return entries.map((value) => {
|
|
122
|
-
const record = asRecord2(value);
|
|
123
|
-
const tuple = normalizeOpinionTuple(record);
|
|
124
|
-
const projected = readNumber(record.confidence) ?? clamp01(tuple.b + tuple.a * tuple.u);
|
|
125
|
-
const triggeringEvidenceId = readString(record.triggeringEvidenceId);
|
|
126
|
-
const triggeringQuestionId = readString(record.triggeringQuestionId);
|
|
127
|
-
const triggeringAnswerId = readString(record.triggeringAnswerId);
|
|
128
|
-
const triggeringContradictionId = readString(
|
|
129
|
-
record.triggeringContradictionId
|
|
130
|
-
);
|
|
131
|
-
const triggeringWorktreeId = readString(record.triggeringWorktreeId);
|
|
132
|
-
const triggeringRef = triggeringEvidenceId ? { kind: "evidence", id: triggeringEvidenceId } : triggeringQuestionId ? { kind: "question", id: triggeringQuestionId } : triggeringAnswerId ? { kind: "answer", id: triggeringAnswerId } : triggeringContradictionId ? { kind: "contradiction", id: triggeringContradictionId } : triggeringWorktreeId ? { kind: "worktree", id: triggeringWorktreeId } : void 0;
|
|
133
|
-
const trigger = readString(record.trigger);
|
|
134
|
-
if (!trigger) {
|
|
135
|
-
throw new Error("Gateway opinion history entries must include trigger.");
|
|
76
|
+
async function searchResources(query, options = {}) {
|
|
77
|
+
const topicId = resolveTopicId(options);
|
|
78
|
+
if (!topicId) {
|
|
79
|
+
throw new Error("topicId is required");
|
|
80
|
+
}
|
|
81
|
+
return searchFacade
|
|
82
|
+
.query({
|
|
83
|
+
q: query,
|
|
84
|
+
topicId,
|
|
85
|
+
types: options.types,
|
|
86
|
+
status: options.status,
|
|
87
|
+
minConfidence: options.minConfidence,
|
|
88
|
+
limit: options.limit,
|
|
89
|
+
cursor: options.cursor,
|
|
90
|
+
})
|
|
91
|
+
.then(exposeGatewayData);
|
|
136
92
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
async function addEvidenceCompat(evidenceFacade, args) {
|
|
182
|
-
const created = await createEvidenceCompat(evidenceFacade, {
|
|
183
|
-
...args,
|
|
184
|
-
targetId: args.supports ? void 0 : args.targetId,
|
|
185
|
-
weight: args.supports ? void 0 : args.weight
|
|
186
|
-
});
|
|
187
|
-
if (!args.supports) {
|
|
188
|
-
return created.data;
|
|
189
|
-
}
|
|
190
|
-
const evidenceId = created.data.id;
|
|
191
|
-
if (typeof evidenceId !== "string" || evidenceId.length === 0) {
|
|
192
|
-
throw new Error("evidence create did not return an id");
|
|
193
|
-
}
|
|
194
|
-
const linked = await evidenceFacade.link({
|
|
195
|
-
evidenceId,
|
|
196
|
-
targetId: args.supports.nodeId,
|
|
197
|
-
weight: args.supports.weight,
|
|
198
|
-
rationale: args.supports.reasoning
|
|
199
|
-
});
|
|
200
|
-
return {
|
|
201
|
-
...created.data,
|
|
202
|
-
edgeId: linked.data.edgeId
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// src/clientHelpers.ts
|
|
207
|
-
function normalizeCustomNamespace(namespace) {
|
|
208
|
-
return namespace.trim() || "custom";
|
|
209
|
-
}
|
|
210
|
-
function normalizeCustomToolPayload(input) {
|
|
211
|
-
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
212
|
-
}
|
|
213
|
-
function asNodeArray(data) {
|
|
214
|
-
const rows = asListItems(data, "nodes");
|
|
215
|
-
if (rows.length > 0) {
|
|
216
|
-
return rows.filter(
|
|
217
|
-
(value) => Boolean(value) && typeof value === "object"
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
if (data && typeof data === "object") {
|
|
221
|
-
return [data];
|
|
222
|
-
}
|
|
223
|
-
return [];
|
|
224
|
-
}
|
|
225
|
-
function requireTopicId(args) {
|
|
226
|
-
const topicId = resolveTopicId(args);
|
|
227
|
-
if (!topicId) {
|
|
228
|
-
throw new Error("topicId is required");
|
|
229
|
-
}
|
|
230
|
-
return topicId;
|
|
231
|
-
}
|
|
232
|
-
function requireTopicOrProjectId(args) {
|
|
233
|
-
const topicId = args.topicId?.trim() || args.projectId?.trim() || void 0;
|
|
234
|
-
if (!topicId) {
|
|
235
|
-
throw new Error("topicId is required");
|
|
236
|
-
}
|
|
237
|
-
return topicId;
|
|
238
|
-
}
|
|
239
|
-
var AUDIT_NODE_REFERENCE_KEY_PATTERN = /(^|_)(id|nodeid|beliefid|resourceid|targetid|sourceid|subjectid|globalid|entityid|recordid|fromnodeid|tonodeid|linkednodeid|linkedbeliefid|nodeids|beliefids|resourceids)$/i;
|
|
240
|
-
function matchesAuditNodeReference(value, nodeId) {
|
|
241
|
-
if (Array.isArray(value)) {
|
|
242
|
-
return value.some((entry) => matchesAuditNodeReference(entry, nodeId));
|
|
243
|
-
}
|
|
244
|
-
if (!value || typeof value !== "object") {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
return Object.entries(value).some(([key, entry]) => {
|
|
248
|
-
if (typeof entry === "string" && entry === nodeId && AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key)) {
|
|
249
|
-
return true;
|
|
93
|
+
async function findContradictions(args) {
|
|
94
|
+
const topicId = resolveTopicId(args);
|
|
95
|
+
const response = topicId
|
|
96
|
+
? await graphClient.listNodes({
|
|
97
|
+
topicId,
|
|
98
|
+
nodeType: "contradiction",
|
|
99
|
+
limit: 500,
|
|
100
|
+
})
|
|
101
|
+
: args.nodeId
|
|
102
|
+
? await graphClient.listNodes({ nodeId: args.nodeId })
|
|
103
|
+
: { data: [] };
|
|
104
|
+
const contradictions = asNodeArray(response.data)
|
|
105
|
+
.filter((node) => {
|
|
106
|
+
const status = typeof node.metadata?.status === "string"
|
|
107
|
+
? node.metadata.status
|
|
108
|
+
: typeof node.status === "string"
|
|
109
|
+
? node.status
|
|
110
|
+
: "unresolved";
|
|
111
|
+
if (args.status && status !== args.status) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
})
|
|
116
|
+
.map((node) => ({
|
|
117
|
+
beliefA: typeof node.metadata?.beliefA === "string"
|
|
118
|
+
? node.metadata.beliefA
|
|
119
|
+
: "",
|
|
120
|
+
beliefB: typeof node.metadata?.beliefB === "string"
|
|
121
|
+
? node.metadata.beliefB
|
|
122
|
+
: "",
|
|
123
|
+
description: node.canonicalText ?? "",
|
|
124
|
+
severity: typeof node.metadata?.severity === "string"
|
|
125
|
+
? node.metadata.severity
|
|
126
|
+
: "medium",
|
|
127
|
+
status: typeof node.metadata?.status === "string"
|
|
128
|
+
? node.metadata.status
|
|
129
|
+
: "unresolved",
|
|
130
|
+
defeatType: typeof node.metadata?.defeatType === "string"
|
|
131
|
+
? node.metadata.defeatType
|
|
132
|
+
: "rebuts",
|
|
133
|
+
}));
|
|
134
|
+
return { contradictions };
|
|
250
135
|
}
|
|
251
|
-
|
|
252
|
-
|
|
136
|
+
async function queryLineage(nodeId, depth = 5) {
|
|
137
|
+
const response = await beliefsFacade.lineage(nodeId);
|
|
138
|
+
const lineage = Array.isArray(response.data.lineage)
|
|
139
|
+
? response.data.lineage
|
|
140
|
+
: [];
|
|
141
|
+
const chain = lineage.length > 0
|
|
142
|
+
? lineage
|
|
143
|
+
.slice(0, depth + 1)
|
|
144
|
+
.map((entry, index) => ({
|
|
145
|
+
nodeId: entry.nodeId ?? entry.beliefId ?? "",
|
|
146
|
+
relation: index === 0 ? "self" : "ancestor",
|
|
147
|
+
}))
|
|
148
|
+
: [{ nodeId, relation: "self" }];
|
|
149
|
+
return {
|
|
150
|
+
chain,
|
|
151
|
+
forkTree: {
|
|
152
|
+
nodeId,
|
|
153
|
+
parentCount: Math.max(0, lineage.length - 1),
|
|
154
|
+
childCount: 0,
|
|
155
|
+
children: [],
|
|
156
|
+
},
|
|
157
|
+
depth,
|
|
158
|
+
beliefId: response.data.beliefId,
|
|
159
|
+
lineage,
|
|
160
|
+
};
|
|
253
161
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
function sdkQueryString(input) {
|
|
258
|
-
const params = new URLSearchParams();
|
|
259
|
-
for (const [key, value] of Object.entries(input)) {
|
|
260
|
-
if (value === void 0 || value === null) {
|
|
261
|
-
continue;
|
|
162
|
+
async function getConfidenceHistory(nodeId) {
|
|
163
|
+
return beliefsFacade.confidenceHistory(nodeId).then(exposeGatewayData);
|
|
262
164
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
continue;
|
|
165
|
+
async function getOpinionHistory(nodeId) {
|
|
166
|
+
const response = await beliefsFacade.opinionHistory(nodeId);
|
|
167
|
+
return mapOpinionHistoryEntriesFromGatewayData(response.data);
|
|
268
168
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
`Custom tool "${fullName}" is not registered.`
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
return registered.invoke(params, context);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// src/clientLocalHelpers.ts
|
|
295
|
-
function createClientLocalHelpers(ctx) {
|
|
296
|
-
const {
|
|
297
|
-
auditClient,
|
|
298
|
-
beliefsFacade,
|
|
299
|
-
customNamespaceCache,
|
|
300
|
-
evidenceFacade,
|
|
301
|
-
exposeGatewayData,
|
|
302
|
-
graphClient,
|
|
303
|
-
graphFacade,
|
|
304
|
-
gateway,
|
|
305
|
-
functionSurfaceClient,
|
|
306
|
-
ontologyClient,
|
|
307
|
-
ontologyLinksClient,
|
|
308
|
-
searchFacade
|
|
309
|
-
} = ctx;
|
|
310
|
-
const invokeCustomTool = async (fullName, input = {}) => {
|
|
311
|
-
const payload = normalizeCustomToolPayload(input);
|
|
312
|
-
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
313
|
-
};
|
|
314
|
-
const getCustomNamespace = (namespace) => {
|
|
315
|
-
const normalized = normalizeCustomNamespace(namespace);
|
|
316
|
-
const cached = customNamespaceCache.get(normalized);
|
|
317
|
-
if (cached) {
|
|
318
|
-
return cached;
|
|
169
|
+
async function getAuditTrail(nodeId, limit = 50) {
|
|
170
|
+
const events = await auditClient.listEvents({ limit });
|
|
171
|
+
const entries = asListItems(events.data, "events")
|
|
172
|
+
.filter((event) => matchesAuditNodeReference(event, nodeId))
|
|
173
|
+
.slice(0, limit)
|
|
174
|
+
.map((event) => {
|
|
175
|
+
const row = event;
|
|
176
|
+
return {
|
|
177
|
+
action: typeof row.action === "string" ? row.action : "unknown",
|
|
178
|
+
actor: typeof row.actor === "string" ? row.actor : "unknown",
|
|
179
|
+
timestamp: typeof row.timestamp === "number" ? row.timestamp : Date.now(),
|
|
180
|
+
rationale: typeof row.rationale === "string"
|
|
181
|
+
? row.rationale
|
|
182
|
+
: "No rationale recorded.",
|
|
183
|
+
before: row.before ?? null,
|
|
184
|
+
after: row.after ?? null,
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
return { entries };
|
|
319
188
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
{
|
|
323
|
-
get(_target, property) {
|
|
324
|
-
if (typeof property !== "string" || property === "then") {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
return async (input = {}) => invokeCustomTool(`${normalized}.${property}`, input);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
);
|
|
331
|
-
customNamespaceCache.set(normalized, proxy);
|
|
332
|
-
return proxy;
|
|
333
|
-
};
|
|
334
|
-
const extensionNamespaces = new Proxy(
|
|
335
|
-
{},
|
|
336
|
-
{
|
|
337
|
-
get(_target, namespace) {
|
|
338
|
-
if (typeof namespace !== "string" || namespace === "then") {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
return getCustomNamespace(namespace);
|
|
342
|
-
}
|
|
189
|
+
async function bisectConfidence(nodeId, args) {
|
|
190
|
+
return beliefsFacade.bisect(nodeId, args).then(exposeGatewayData);
|
|
343
191
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
minConfidence: args.minConfidence,
|
|
353
|
-
limit: args.limit,
|
|
354
|
-
cursor: args.cursor
|
|
355
|
-
});
|
|
356
|
-
return Array.isArray(response.data.beliefs) ? response.data.beliefs : [];
|
|
357
|
-
}
|
|
358
|
-
async function searchBeliefs(args) {
|
|
359
|
-
const topicId = resolveTopicId(args);
|
|
360
|
-
if (!topicId) {
|
|
361
|
-
return { results: [] };
|
|
192
|
+
async function discoverTopics(input = {}) {
|
|
193
|
+
return gateway
|
|
194
|
+
.request({
|
|
195
|
+
path: "/api/platform/v1/context/discover",
|
|
196
|
+
method: "POST",
|
|
197
|
+
body: input,
|
|
198
|
+
})
|
|
199
|
+
.then(exposeGatewayData);
|
|
362
200
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
const data = exposeGatewayData(response);
|
|
372
|
-
const groupedBeliefs = Array.isArray(data.beliefs) ? data.beliefs : [];
|
|
373
|
-
const mergedResults = Array.isArray(data.results) ? data.results : [];
|
|
374
|
-
const results = groupedBeliefs.length > 0 ? groupedBeliefs : mergedResults.filter((result) => result.type === "belief");
|
|
375
|
-
return { results };
|
|
376
|
-
}
|
|
377
|
-
async function searchResources(query, options = {}) {
|
|
378
|
-
const topicId = resolveTopicId(options);
|
|
379
|
-
if (!topicId) {
|
|
380
|
-
throw new Error("topicId is required");
|
|
201
|
+
async function discoverEntityConnections(input = {}) {
|
|
202
|
+
return gateway
|
|
203
|
+
.request({
|
|
204
|
+
path: "/api/platform/v1/context/entity-connections",
|
|
205
|
+
method: "POST",
|
|
206
|
+
body: input,
|
|
207
|
+
})
|
|
208
|
+
.then(exposeGatewayData);
|
|
381
209
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
defeatType: typeof node.metadata?.defeatType === "string" ? node.metadata.defeatType : "rebuts"
|
|
412
|
-
}));
|
|
413
|
-
return { contradictions };
|
|
414
|
-
}
|
|
415
|
-
async function queryLineage(nodeId, depth = 5) {
|
|
416
|
-
const response = await beliefsFacade.lineage(nodeId);
|
|
417
|
-
const lineage = Array.isArray(response.data.lineage) ? response.data.lineage : [];
|
|
418
|
-
const chain = lineage.length > 0 ? lineage.slice(0, depth + 1).map((entry, index) => ({
|
|
419
|
-
nodeId: entry.nodeId ?? entry.beliefId ?? "",
|
|
420
|
-
relation: index === 0 ? "self" : "ancestor"
|
|
421
|
-
})) : [{ nodeId, relation: "self" }];
|
|
422
|
-
return {
|
|
423
|
-
chain,
|
|
424
|
-
forkTree: {
|
|
425
|
-
nodeId,
|
|
426
|
-
parentCount: Math.max(0, lineage.length - 1),
|
|
427
|
-
childCount: 0,
|
|
428
|
-
children: []
|
|
429
|
-
},
|
|
430
|
-
depth,
|
|
431
|
-
beliefId: response.data.beliefId,
|
|
432
|
-
lineage
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
async function getConfidenceHistory(nodeId) {
|
|
436
|
-
return beliefsFacade.confidenceHistory(nodeId).then(exposeGatewayData);
|
|
437
|
-
}
|
|
438
|
-
async function getOpinionHistory(nodeId) {
|
|
439
|
-
const response = await beliefsFacade.opinionHistory(nodeId);
|
|
440
|
-
return mapOpinionHistoryEntriesFromGatewayData(response.data);
|
|
441
|
-
}
|
|
442
|
-
async function getAuditTrail(nodeId, limit = 50) {
|
|
443
|
-
const events = await auditClient.listEvents({ limit });
|
|
444
|
-
const entries = asListItems(events.data, "events").filter((event) => matchesAuditNodeReference(event, nodeId)).slice(0, limit).map((event) => {
|
|
445
|
-
const row = event;
|
|
446
|
-
return {
|
|
447
|
-
action: typeof row.action === "string" ? row.action : "unknown",
|
|
448
|
-
actor: typeof row.actor === "string" ? row.actor : "unknown",
|
|
449
|
-
timestamp: typeof row.timestamp === "number" ? row.timestamp : Date.now(),
|
|
450
|
-
rationale: typeof row.rationale === "string" ? row.rationale : "No rationale recorded.",
|
|
451
|
-
before: row.before ?? null,
|
|
452
|
-
after: row.after ?? null
|
|
453
|
-
};
|
|
454
|
-
});
|
|
455
|
-
return { entries };
|
|
456
|
-
}
|
|
457
|
-
async function bisectConfidence(nodeId, args) {
|
|
458
|
-
return beliefsFacade.bisect(nodeId, args).then(exposeGatewayData);
|
|
459
|
-
}
|
|
460
|
-
async function discoverTopics(input = {}) {
|
|
461
|
-
return gateway.request({
|
|
462
|
-
path: "/api/platform/v1/context/discover",
|
|
463
|
-
method: "POST",
|
|
464
|
-
body: input
|
|
465
|
-
}).then(exposeGatewayData);
|
|
466
|
-
}
|
|
467
|
-
async function discoverEntityConnections(input = {}) {
|
|
468
|
-
return gateway.request({
|
|
469
|
-
path: "/api/platform/v1/context/entity-connections",
|
|
470
|
-
method: "POST",
|
|
471
|
-
body: input
|
|
472
|
-
}).then(exposeGatewayData);
|
|
473
|
-
}
|
|
474
|
-
async function triggerBeliefReview(input = {}) {
|
|
475
|
-
return gateway.request({
|
|
476
|
-
path: "/api/platform/v1/context/belief-review",
|
|
477
|
-
method: "POST",
|
|
478
|
-
body: input,
|
|
479
|
-
idempotencyKey: randomIdempotencyKey()
|
|
480
|
-
}).then(exposeGatewayData);
|
|
481
|
-
}
|
|
482
|
-
async function createContractCompat(input = {}) {
|
|
483
|
-
return gateway.request({
|
|
484
|
-
path: "/api/platform/v1/contracts",
|
|
485
|
-
method: "POST",
|
|
486
|
-
body: input,
|
|
487
|
-
idempotencyKey: randomIdempotencyKey()
|
|
488
|
-
}).then(exposeGatewayData);
|
|
489
|
-
}
|
|
490
|
-
async function evaluateContractCompat(input = {}) {
|
|
491
|
-
return gateway.request({
|
|
492
|
-
path: "/api/platform/v1/contracts/evaluate",
|
|
493
|
-
method: "POST",
|
|
494
|
-
body: input,
|
|
495
|
-
idempotencyKey: randomIdempotencyKey()
|
|
496
|
-
}).then(exposeGatewayData);
|
|
497
|
-
}
|
|
498
|
-
async function getContractStatusCompat(input = {}) {
|
|
499
|
-
return gateway.request({
|
|
500
|
-
path: "/api/platform/v1/contracts/status",
|
|
501
|
-
method: "POST",
|
|
502
|
-
body: input
|
|
503
|
-
}).then(exposeGatewayData);
|
|
504
|
-
}
|
|
505
|
-
async function listContractsCompat(input = {}) {
|
|
506
|
-
return gateway.request({
|
|
507
|
-
path: `/api/platform/v1/contracts${toQueryString({
|
|
508
|
-
beliefNodeId: typeof input.beliefNodeId === "string" ? input.beliefNodeId : void 0,
|
|
509
|
-
contractId: typeof input.contractId === "string" ? input.contractId : void 0,
|
|
510
|
-
status: typeof input.status === "string" ? input.status : void 0
|
|
511
|
-
})}`
|
|
512
|
-
}).then(exposeGatewayData);
|
|
513
|
-
}
|
|
514
|
-
async function createOntologyCompat(input = {}) {
|
|
515
|
-
const response = await ontologyClient.createDefinition(
|
|
516
|
-
input
|
|
517
|
-
);
|
|
518
|
-
const envelope = response;
|
|
519
|
-
return Object.assign({}, envelope, envelope.data);
|
|
520
|
-
}
|
|
521
|
-
async function updateOntologyCompat(input = {}) {
|
|
522
|
-
const id = typeof input.id === "string" ? input.id : "";
|
|
523
|
-
const { id: _id, ...rest } = input;
|
|
524
|
-
const response = await ontologyClient.updateDefinition(
|
|
525
|
-
id,
|
|
526
|
-
rest
|
|
527
|
-
);
|
|
528
|
-
const envelope = response;
|
|
529
|
-
return Object.assign({}, envelope, envelope.data);
|
|
530
|
-
}
|
|
531
|
-
async function archiveOntologyCompat(input = {}) {
|
|
532
|
-
const id = typeof input.id === "string" ? input.id : "";
|
|
533
|
-
const response = await ontologyClient.archiveDefinition(id);
|
|
534
|
-
const envelope = response;
|
|
535
|
-
return Object.assign({}, envelope, envelope.data);
|
|
536
|
-
}
|
|
537
|
-
async function createOntologyVersionCompat(input = {}) {
|
|
538
|
-
const ontologyId = typeof input.ontologyId === "string" ? input.ontologyId : "";
|
|
539
|
-
const { ontologyId: _ontologyId, ...rest } = input;
|
|
540
|
-
const response = await ontologyClient.createVersion(
|
|
541
|
-
ontologyId,
|
|
542
|
-
rest
|
|
543
|
-
);
|
|
544
|
-
const envelope = response;
|
|
545
|
-
return Object.assign({}, envelope, envelope.data);
|
|
546
|
-
}
|
|
547
|
-
async function publishOntologyVersionCompat(input = {}) {
|
|
548
|
-
return gateway.request({
|
|
549
|
-
path: "/api/platform/v1/ontologies/versions/publish",
|
|
550
|
-
method: "POST",
|
|
551
|
-
body: input,
|
|
552
|
-
idempotencyKey: randomIdempotencyKey()
|
|
553
|
-
}).then(exposeGatewayData);
|
|
554
|
-
}
|
|
555
|
-
async function deprecateOntologyVersionCompat(input = {}) {
|
|
556
|
-
return gateway.request({
|
|
557
|
-
path: "/api/platform/v1/ontologies/versions/deprecate",
|
|
558
|
-
method: "POST",
|
|
559
|
-
body: input,
|
|
560
|
-
idempotencyKey: randomIdempotencyKey()
|
|
561
|
-
}).then(exposeGatewayData);
|
|
562
|
-
}
|
|
563
|
-
async function resolveEffectiveOntologyCompat(input = {}) {
|
|
564
|
-
return gateway.request({
|
|
565
|
-
path: "/api/platform/v1/ontologies/effective",
|
|
566
|
-
method: "POST",
|
|
567
|
-
body: input
|
|
568
|
-
}).then(exposeGatewayData);
|
|
569
|
-
}
|
|
570
|
-
async function traceEntityImpactCompat(input = {}) {
|
|
571
|
-
return gateway.request({
|
|
572
|
-
path: "/api/platform/v1/graph/trace-entity-impact",
|
|
573
|
-
method: "POST",
|
|
574
|
-
body: input
|
|
575
|
-
}).then(exposeGatewayData);
|
|
576
|
-
}
|
|
577
|
-
const nodesNamespace = {
|
|
578
|
-
list: graphClient.listNodes,
|
|
579
|
-
get(input) {
|
|
580
|
-
return graphClient.getNode(
|
|
581
|
-
typeof input === "string" ? { nodeId: input } : input
|
|
582
|
-
);
|
|
583
|
-
},
|
|
584
|
-
create(input, idempotencyKey) {
|
|
585
|
-
return functionSurfaceClient.createEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
586
|
-
},
|
|
587
|
-
createEpistemicNode(input, idempotencyKey) {
|
|
588
|
-
return functionSurfaceClient.createEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
589
|
-
},
|
|
590
|
-
update(input, idempotencyKey) {
|
|
591
|
-
return functionSurfaceClient.updateEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
592
|
-
},
|
|
593
|
-
updateEpistemicNode(input, idempotencyKey) {
|
|
594
|
-
return functionSurfaceClient.updateEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
595
|
-
},
|
|
596
|
-
batchCreate(input, idempotencyKey) {
|
|
597
|
-
return functionSurfaceClient.batchCreateEpistemicNodes(input, idempotencyKey).then(exposeGatewayData);
|
|
598
|
-
},
|
|
599
|
-
batchCreateEpistemicNodes(input, idempotencyKey) {
|
|
600
|
-
return functionSurfaceClient.batchCreateEpistemicNodes(input, idempotencyKey).then(exposeGatewayData);
|
|
601
|
-
},
|
|
602
|
-
listByTopicAndType(input) {
|
|
603
|
-
return gateway.request({
|
|
604
|
-
path: `/api/platform/v1/nodes${sdkQueryString({
|
|
605
|
-
topicId: requireTopicOrProjectId(input),
|
|
606
|
-
nodeType: input.nodeType,
|
|
607
|
-
nodeTypes: input.nodeTypes,
|
|
608
|
-
query: input.query,
|
|
609
|
-
sourceText: input.sourceText,
|
|
610
|
-
limit: input.limit,
|
|
611
|
-
cursor: input.cursor
|
|
612
|
-
})}`
|
|
613
|
-
}).then(exposeGatewayData);
|
|
614
|
-
},
|
|
615
|
-
countByTopicAndType(input) {
|
|
616
|
-
return gateway.request({
|
|
617
|
-
path: `/api/platform/v1/nodes/count${sdkQueryString({
|
|
618
|
-
topicId: requireTopicOrProjectId(input),
|
|
619
|
-
nodeType: input.nodeType,
|
|
620
|
-
nodeTypes: input.nodeTypes,
|
|
621
|
-
query: input.query,
|
|
622
|
-
limit: input.limit
|
|
623
|
-
})}`
|
|
624
|
-
}).then(exposeGatewayData);
|
|
625
|
-
},
|
|
626
|
-
supersede(input, idempotencyKey) {
|
|
627
|
-
return functionSurfaceClient.supersedeEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
628
|
-
},
|
|
629
|
-
verify(input, idempotencyKey) {
|
|
630
|
-
return functionSurfaceClient.verifyEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
631
|
-
},
|
|
632
|
-
archive(input, idempotencyKey) {
|
|
633
|
-
return functionSurfaceClient.archiveEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
634
|
-
},
|
|
635
|
-
hardDelete: graphClient.hardDeleteNode
|
|
636
|
-
};
|
|
637
|
-
const publicationNamespace = {
|
|
638
|
-
create(input, idempotencyKey) {
|
|
639
|
-
return gateway.request({
|
|
640
|
-
path: "/api/platform/v1/publication",
|
|
641
|
-
method: "POST",
|
|
642
|
-
body: input,
|
|
643
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
644
|
-
}).then(exposeGatewayData);
|
|
645
|
-
},
|
|
646
|
-
update(publicationId, input, idempotencyKey) {
|
|
647
|
-
return gateway.request({
|
|
648
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
649
|
-
publicationId
|
|
650
|
-
)}`,
|
|
651
|
-
method: "PATCH",
|
|
652
|
-
body: input,
|
|
653
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
654
|
-
}).then(exposeGatewayData);
|
|
655
|
-
},
|
|
656
|
-
list(input = {}) {
|
|
657
|
-
return gateway.request({
|
|
658
|
-
path: `/api/platform/v1/publication${sdkQueryString(input)}`
|
|
659
|
-
}).then(exposeGatewayData);
|
|
660
|
-
},
|
|
661
|
-
getByTopic(input) {
|
|
662
|
-
const topicId = typeof input === "string" ? input : input.topicId;
|
|
663
|
-
const workspaceId = typeof input === "string" ? void 0 : input.workspaceId;
|
|
664
|
-
return gateway.request({
|
|
665
|
-
path: `/api/platform/v1/publication/by-topic/${encodeURIComponent(
|
|
666
|
-
topicId
|
|
667
|
-
)}${sdkQueryString({ workspaceId })}`
|
|
668
|
-
}).then(exposeGatewayData);
|
|
669
|
-
},
|
|
670
|
-
publish(publicationId, input = {}, idempotencyKey) {
|
|
671
|
-
return gateway.request({
|
|
672
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
673
|
-
publicationId
|
|
674
|
-
)}/publish`,
|
|
675
|
-
method: "POST",
|
|
676
|
-
body: input,
|
|
677
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
678
|
-
}).then(exposeGatewayData);
|
|
679
|
-
},
|
|
680
|
-
unpublish(publicationId, input = {}, idempotencyKey) {
|
|
681
|
-
return gateway.request({
|
|
682
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
683
|
-
publicationId
|
|
684
|
-
)}/unpublish`,
|
|
685
|
-
method: "POST",
|
|
686
|
-
body: input,
|
|
687
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
688
|
-
}).then(exposeGatewayData);
|
|
689
|
-
},
|
|
690
|
-
remove(publicationId, input = {}) {
|
|
691
|
-
return gateway.request({
|
|
692
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
693
|
-
publicationId
|
|
694
|
-
)}${sdkQueryString(input)}`,
|
|
695
|
-
method: "DELETE"
|
|
696
|
-
}).then(exposeGatewayData);
|
|
210
|
+
async function triggerBeliefReview(input = {}) {
|
|
211
|
+
return gateway
|
|
212
|
+
.request({
|
|
213
|
+
path: "/api/platform/v1/context/belief-review",
|
|
214
|
+
method: "POST",
|
|
215
|
+
body: input,
|
|
216
|
+
idempotencyKey: randomIdempotencyKey(),
|
|
217
|
+
})
|
|
218
|
+
.then(exposeGatewayData);
|
|
219
|
+
}
|
|
220
|
+
async function createContractCompat(input = {}) {
|
|
221
|
+
return gateway
|
|
222
|
+
.request({
|
|
223
|
+
path: "/api/platform/v1/contracts",
|
|
224
|
+
method: "POST",
|
|
225
|
+
body: input,
|
|
226
|
+
idempotencyKey: randomIdempotencyKey(),
|
|
227
|
+
})
|
|
228
|
+
.then(exposeGatewayData);
|
|
229
|
+
}
|
|
230
|
+
async function evaluateContractCompat(input = {}) {
|
|
231
|
+
return gateway
|
|
232
|
+
.request({
|
|
233
|
+
path: "/api/platform/v1/contracts/evaluate",
|
|
234
|
+
method: "POST",
|
|
235
|
+
body: input,
|
|
236
|
+
idempotencyKey: randomIdempotencyKey(),
|
|
237
|
+
})
|
|
238
|
+
.then(exposeGatewayData);
|
|
697
239
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}).then(exposeGatewayData);
|
|
240
|
+
async function getContractStatusCompat(input = {}) {
|
|
241
|
+
return gateway
|
|
242
|
+
.request({
|
|
243
|
+
path: "/api/platform/v1/contracts/status",
|
|
244
|
+
method: "POST",
|
|
245
|
+
body: input,
|
|
246
|
+
})
|
|
247
|
+
.then(exposeGatewayData);
|
|
707
248
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
249
|
+
async function listContractsCompat(input = {}) {
|
|
250
|
+
return gateway
|
|
251
|
+
.request({
|
|
252
|
+
path: `/api/platform/v1/contracts${toQueryString({
|
|
253
|
+
beliefNodeId: typeof input.beliefNodeId === "string"
|
|
254
|
+
? input.beliefNodeId
|
|
255
|
+
: undefined,
|
|
256
|
+
contractId: typeof input.contractId === "string" ? input.contractId : undefined,
|
|
257
|
+
status: typeof input.status === "string" ? input.status : undefined,
|
|
258
|
+
})}`,
|
|
259
|
+
})
|
|
260
|
+
.then(exposeGatewayData);
|
|
261
|
+
}
|
|
262
|
+
async function createOntologyCompat(input = {}) {
|
|
263
|
+
const response = await ontologyClient.createDefinition(input);
|
|
264
|
+
const envelope = response;
|
|
265
|
+
return Object.assign({}, envelope, envelope.data);
|
|
266
|
+
}
|
|
267
|
+
async function updateOntologyCompat(input = {}) {
|
|
268
|
+
const id = typeof input.id === "string" ? input.id : "";
|
|
269
|
+
const { id: _id, ...rest } = input;
|
|
270
|
+
const response = await ontologyClient.updateDefinition(id, rest);
|
|
271
|
+
const envelope = response;
|
|
272
|
+
return Object.assign({}, envelope, envelope.data);
|
|
273
|
+
}
|
|
274
|
+
async function archiveOntologyCompat(input = {}) {
|
|
275
|
+
const id = typeof input.id === "string" ? input.id : "";
|
|
276
|
+
const response = await ontologyClient.archiveDefinition(id);
|
|
277
|
+
const envelope = response;
|
|
278
|
+
return Object.assign({}, envelope, envelope.data);
|
|
279
|
+
}
|
|
280
|
+
async function createOntologyVersionCompat(input = {}) {
|
|
281
|
+
const ontologyId = typeof input.ontologyId === "string" ? input.ontologyId : "";
|
|
282
|
+
const { ontologyId: _ontologyId, ...rest } = input;
|
|
283
|
+
const response = await ontologyClient.createVersion(ontologyId, rest);
|
|
284
|
+
const envelope = response;
|
|
285
|
+
return Object.assign({}, envelope, envelope.data);
|
|
286
|
+
}
|
|
287
|
+
async function publishOntologyVersionCompat(input = {}) {
|
|
288
|
+
return gateway
|
|
289
|
+
.request({
|
|
290
|
+
path: "/api/platform/v1/ontologies/versions/publish",
|
|
291
|
+
method: "POST",
|
|
292
|
+
body: input,
|
|
293
|
+
idempotencyKey: randomIdempotencyKey(),
|
|
294
|
+
})
|
|
295
|
+
.then(exposeGatewayData);
|
|
296
|
+
}
|
|
297
|
+
async function deprecateOntologyVersionCompat(input = {}) {
|
|
298
|
+
return gateway
|
|
299
|
+
.request({
|
|
300
|
+
path: "/api/platform/v1/ontologies/versions/deprecate",
|
|
301
|
+
method: "POST",
|
|
302
|
+
body: input,
|
|
303
|
+
idempotencyKey: randomIdempotencyKey(),
|
|
304
|
+
})
|
|
305
|
+
.then(exposeGatewayData);
|
|
306
|
+
}
|
|
307
|
+
async function resolveEffectiveOntologyCompat(input = {}) {
|
|
308
|
+
return gateway
|
|
309
|
+
.request({
|
|
310
|
+
path: "/api/platform/v1/ontologies/effective",
|
|
311
|
+
method: "POST",
|
|
312
|
+
body: input,
|
|
313
|
+
})
|
|
314
|
+
.then(exposeGatewayData);
|
|
315
|
+
}
|
|
316
|
+
async function traceEntityImpactCompat(input = {}) {
|
|
317
|
+
return gateway
|
|
318
|
+
.request({
|
|
319
|
+
path: "/api/platform/v1/graph/trace-entity-impact",
|
|
320
|
+
method: "POST",
|
|
321
|
+
body: input,
|
|
322
|
+
})
|
|
323
|
+
.then(exposeGatewayData);
|
|
324
|
+
}
|
|
325
|
+
const nodesNamespace = {
|
|
326
|
+
list: graphClient.listNodes,
|
|
327
|
+
get(input) {
|
|
328
|
+
return graphClient.getNode(typeof input === "string" ? { nodeId: input } : input);
|
|
329
|
+
},
|
|
330
|
+
create(input, idempotencyKey) {
|
|
331
|
+
return functionSurfaceClient
|
|
332
|
+
.createEpistemicNode(input, idempotencyKey)
|
|
333
|
+
.then(exposeGatewayData);
|
|
334
|
+
},
|
|
335
|
+
createEpistemicNode(input, idempotencyKey) {
|
|
336
|
+
return functionSurfaceClient
|
|
337
|
+
.createEpistemicNode(input, idempotencyKey)
|
|
338
|
+
.then(exposeGatewayData);
|
|
339
|
+
},
|
|
340
|
+
update(input, idempotencyKey) {
|
|
341
|
+
return functionSurfaceClient
|
|
342
|
+
.updateEpistemicNode(input, idempotencyKey)
|
|
343
|
+
.then(exposeGatewayData);
|
|
344
|
+
},
|
|
345
|
+
updateEpistemicNode(input, idempotencyKey) {
|
|
346
|
+
return functionSurfaceClient
|
|
347
|
+
.updateEpistemicNode(input, idempotencyKey)
|
|
348
|
+
.then(exposeGatewayData);
|
|
349
|
+
},
|
|
350
|
+
batchCreate(input, idempotencyKey) {
|
|
351
|
+
return functionSurfaceClient
|
|
352
|
+
.batchCreateEpistemicNodes(input, idempotencyKey)
|
|
353
|
+
.then(exposeGatewayData);
|
|
354
|
+
},
|
|
355
|
+
batchCreateEpistemicNodes(input, idempotencyKey) {
|
|
356
|
+
return functionSurfaceClient
|
|
357
|
+
.batchCreateEpistemicNodes(input, idempotencyKey)
|
|
358
|
+
.then(exposeGatewayData);
|
|
359
|
+
},
|
|
360
|
+
listByTopicAndType(input) {
|
|
361
|
+
return gateway
|
|
362
|
+
.request({
|
|
363
|
+
path: `/api/platform/v1/nodes${sdkQueryString({
|
|
364
|
+
topicId: requireTopicOrProjectId(input),
|
|
365
|
+
nodeType: input.nodeType,
|
|
366
|
+
nodeTypes: input.nodeTypes,
|
|
367
|
+
query: input.query,
|
|
368
|
+
sourceText: input.sourceText,
|
|
369
|
+
limit: input.limit,
|
|
370
|
+
cursor: input.cursor,
|
|
371
|
+
})}`,
|
|
372
|
+
})
|
|
373
|
+
.then(exposeGatewayData);
|
|
374
|
+
},
|
|
375
|
+
countByTopicAndType(input) {
|
|
376
|
+
return gateway
|
|
377
|
+
.request({
|
|
378
|
+
path: `/api/platform/v1/nodes/count${sdkQueryString({
|
|
379
|
+
topicId: requireTopicOrProjectId(input),
|
|
380
|
+
nodeType: input.nodeType,
|
|
381
|
+
nodeTypes: input.nodeTypes,
|
|
382
|
+
query: input.query,
|
|
383
|
+
limit: input.limit,
|
|
384
|
+
})}`,
|
|
385
|
+
})
|
|
386
|
+
.then(exposeGatewayData);
|
|
387
|
+
},
|
|
388
|
+
supersede(input, idempotencyKey) {
|
|
389
|
+
return functionSurfaceClient
|
|
390
|
+
.supersedeEpistemicNode(input, idempotencyKey)
|
|
391
|
+
.then(exposeGatewayData);
|
|
392
|
+
},
|
|
393
|
+
verify(input, idempotencyKey) {
|
|
394
|
+
return functionSurfaceClient
|
|
395
|
+
.verifyEpistemicNode(input, idempotencyKey)
|
|
396
|
+
.then(exposeGatewayData);
|
|
397
|
+
},
|
|
398
|
+
archive(input, idempotencyKey) {
|
|
399
|
+
return functionSurfaceClient
|
|
400
|
+
.archiveEpistemicNode(input, idempotencyKey)
|
|
401
|
+
.then(exposeGatewayData);
|
|
402
|
+
},
|
|
403
|
+
hardDelete: graphClient.hardDeleteNode,
|
|
404
|
+
};
|
|
405
|
+
const publicationNamespace = {
|
|
406
|
+
create(input, idempotencyKey) {
|
|
407
|
+
return gateway
|
|
408
|
+
.request({
|
|
409
|
+
path: "/api/platform/v1/publication",
|
|
410
|
+
method: "POST",
|
|
411
|
+
body: input,
|
|
412
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
413
|
+
})
|
|
414
|
+
.then(exposeGatewayData);
|
|
415
|
+
},
|
|
416
|
+
update(publicationId, input, idempotencyKey) {
|
|
417
|
+
return gateway
|
|
418
|
+
.request({
|
|
419
|
+
path: `/api/platform/v1/publication/${encodeURIComponent(publicationId)}`,
|
|
420
|
+
method: "PATCH",
|
|
421
|
+
body: input,
|
|
422
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
423
|
+
})
|
|
424
|
+
.then(exposeGatewayData);
|
|
425
|
+
},
|
|
426
|
+
list(input = {}) {
|
|
427
|
+
return gateway
|
|
428
|
+
.request({
|
|
429
|
+
path: `/api/platform/v1/publication${sdkQueryString(input)}`,
|
|
430
|
+
})
|
|
431
|
+
.then(exposeGatewayData);
|
|
432
|
+
},
|
|
433
|
+
getByTopic(input) {
|
|
434
|
+
const topicId = typeof input === "string" ? input : input.topicId;
|
|
435
|
+
const workspaceId = typeof input === "string" ? undefined : input.workspaceId;
|
|
436
|
+
return gateway
|
|
437
|
+
.request({
|
|
438
|
+
path: `/api/platform/v1/publication/by-topic/${encodeURIComponent(topicId)}${sdkQueryString({ workspaceId })}`,
|
|
439
|
+
})
|
|
440
|
+
.then(exposeGatewayData);
|
|
441
|
+
},
|
|
442
|
+
publish(publicationId, input = {}, idempotencyKey) {
|
|
443
|
+
return gateway
|
|
444
|
+
.request({
|
|
445
|
+
path: `/api/platform/v1/publication/${encodeURIComponent(publicationId)}/publish`,
|
|
446
|
+
method: "POST",
|
|
447
|
+
body: input,
|
|
448
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
449
|
+
})
|
|
450
|
+
.then(exposeGatewayData);
|
|
451
|
+
},
|
|
452
|
+
unpublish(publicationId, input = {}, idempotencyKey) {
|
|
453
|
+
return gateway
|
|
454
|
+
.request({
|
|
455
|
+
path: `/api/platform/v1/publication/${encodeURIComponent(publicationId)}/unpublish`,
|
|
456
|
+
method: "POST",
|
|
457
|
+
body: input,
|
|
458
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
459
|
+
})
|
|
460
|
+
.then(exposeGatewayData);
|
|
461
|
+
},
|
|
462
|
+
remove(publicationId, input = {}) {
|
|
463
|
+
return gateway
|
|
464
|
+
.request({
|
|
465
|
+
path: `/api/platform/v1/publication/${encodeURIComponent(publicationId)}${sdkQueryString(input)}`,
|
|
466
|
+
method: "DELETE",
|
|
467
|
+
})
|
|
468
|
+
.then(exposeGatewayData);
|
|
469
|
+
},
|
|
470
|
+
};
|
|
471
|
+
const ontologyLinksNamespace = {
|
|
472
|
+
...ontologyLinksClient,
|
|
473
|
+
resolveThemeSource(input) {
|
|
474
|
+
return gateway
|
|
475
|
+
.request({
|
|
476
|
+
path: "/api/platform/v1/ontology-links/theme-source",
|
|
477
|
+
method: "POST",
|
|
478
|
+
body: input,
|
|
479
|
+
})
|
|
480
|
+
.then(exposeGatewayData);
|
|
481
|
+
},
|
|
482
|
+
};
|
|
483
|
+
return {
|
|
484
|
+
addEvidence,
|
|
485
|
+
archiveOntologyCompat,
|
|
486
|
+
bisectConfidence,
|
|
487
|
+
createContractCompat,
|
|
488
|
+
createEvidence,
|
|
489
|
+
createOntologyCompat,
|
|
490
|
+
createOntologyVersionCompat,
|
|
491
|
+
deprecateOntologyVersionCompat,
|
|
492
|
+
discoverEntityConnections,
|
|
493
|
+
discoverTopics,
|
|
494
|
+
evaluateContractCompat,
|
|
495
|
+
extensionNamespaces,
|
|
496
|
+
findContradictions,
|
|
497
|
+
getAuditTrail,
|
|
498
|
+
getConfidenceHistory,
|
|
499
|
+
getContractStatusCompat,
|
|
500
|
+
getCustomNamespace,
|
|
501
|
+
getOpinionHistory,
|
|
502
|
+
invokeCustomTool,
|
|
503
|
+
listBeliefs,
|
|
504
|
+
listContractsCompat,
|
|
505
|
+
nodesNamespace,
|
|
506
|
+
ontologyLinksNamespace,
|
|
507
|
+
publicationNamespace,
|
|
508
|
+
publishOntologyVersionCompat,
|
|
509
|
+
queryLineage,
|
|
510
|
+
resolveEffectiveOntologyCompat,
|
|
511
|
+
searchBeliefs,
|
|
512
|
+
searchResources,
|
|
513
|
+
traceEntityImpactCompat,
|
|
514
|
+
triggerBeliefReview,
|
|
515
|
+
updateOntologyCompat,
|
|
516
|
+
};
|
|
743
517
|
}
|
|
744
|
-
|
|
745
|
-
export { createClientLocalHelpers };
|
|
746
|
-
//# sourceMappingURL=clientLocalHelpers.js.map
|
|
747
518
|
//# sourceMappingURL=clientLocalHelpers.js.map
|