@lucern/sdk 0.2.0-alpha.4 → 0.2.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/.generated +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -8894
- package/dist/lib/platform/auth/credentials.d.ts +5 -0
- package/dist/lib/platform/auth/credentials.js +40 -0
- package/dist/lib/platform/sdk/adminClient.d.ts +404 -0
- package/dist/lib/platform/sdk/adminClient.js +384 -0
- package/dist/lib/platform/sdk/answersClient.d.ts +16 -0
- package/dist/lib/platform/sdk/answersClient.js +21 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/audiencesClient.d.ts +6 -0
- package/dist/lib/platform/sdk/audiencesClient.js +111 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/auditClient.d.ts +3 -0
- package/dist/lib/platform/sdk/auditClient.js +21 -0
- package/dist/lib/platform/sdk/beliefsClient.d.ts +157 -0
- package/dist/lib/platform/sdk/beliefsClient.js +124 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/client.d.ts +957 -146
- package/dist/lib/platform/sdk/client.js +1831 -0
- package/dist/lib/platform/sdk/contextClient.d.ts +21 -0
- package/dist/lib/platform/sdk/contextClient.js +86 -0
- package/dist/lib/platform/sdk/contextFacade.d.ts +10 -0
- package/dist/lib/platform/sdk/contextFacade.js +10 -0
- package/dist/{lucern/packages/domain-context/src/context-pack-compiler.d.ts → lib/platform/sdk/contextPackCompiler.d.ts} +2 -3
- package/dist/lib/platform/sdk/contextPackCompiler.js +534 -0
- package/dist/lib/platform/sdk/contextTypes.d.ts +133 -0
- package/dist/lib/platform/sdk/contextTypes.js +1 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/controlObjectOwnership.d.ts +15 -0
- package/dist/lib/platform/sdk/controlObjectOwnership.js +220 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/coreClient.d.ts +19 -0
- package/dist/lib/platform/sdk/coreClient.js +366 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/customTools.d.ts +21 -3
- package/dist/lib/platform/sdk/customTools.js +247 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/decisionsClient.d.ts +9 -0
- package/dist/lib/platform/sdk/decisionsClient.js +129 -0
- package/dist/lib/platform/sdk/domainContext.d.ts +1 -0
- package/dist/lib/platform/sdk/domainContext.js +1 -0
- package/dist/lib/platform/sdk/events.d.ts +176 -0
- package/dist/lib/platform/sdk/events.js +261 -0
- package/dist/lib/platform/sdk/eventsCore.d.ts +13 -0
- package/dist/lib/platform/sdk/eventsCore.js +13 -0
- package/dist/lib/platform/sdk/gatewayFacades.d.ts +586 -0
- package/dist/lib/platform/sdk/gatewayFacades.js +845 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/graphClient.d.ts +75 -0
- package/dist/lib/platform/sdk/graphClient.js +235 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/harnessClient.d.ts +90 -1
- package/dist/lib/platform/sdk/harnessClient.js +219 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/identityClient.d.ts +45 -15
- package/dist/lib/platform/sdk/identityClient.js +131 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/index.d.ts +24 -3
- package/dist/lib/platform/sdk/index.js +49 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/learningClient.d.ts +3 -0
- package/dist/lib/platform/sdk/learningClient.js +53 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/mcpParityClient.d.ts +1 -0
- package/dist/lib/platform/sdk/mcpParityClient.js +196 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/mcpParitySurface.d.ts +2 -0
- package/dist/lib/platform/sdk/mcpParitySurface.js +57 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/ontologyClient.d.ts +16 -0
- package/dist/lib/platform/sdk/ontologyClient.js +161 -0
- package/dist/lib/platform/sdk/packRuntime.d.ts +1 -0
- package/dist/lib/platform/sdk/packRuntime.js +1 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/packsClient.d.ts +25 -0
- package/dist/lib/platform/sdk/packsClient.js +157 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/policyClient.d.ts +90 -1
- package/dist/lib/platform/sdk/policyClient.js +277 -0
- package/dist/lib/platform/sdk/promptCatalog.d.ts +1 -0
- package/dist/lib/platform/sdk/promptCatalog.js +1 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/reportsClient.d.ts +3 -0
- package/dist/lib/platform/sdk/reportsClient.js +64 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/schemaClient.d.ts +5 -0
- package/dist/lib/platform/sdk/schemaClient.js +71 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/sdkSurface.d.ts +1 -0
- package/dist/lib/platform/sdk/sdkSurface.js +140 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/topicsClient.d.ts +33 -0
- package/dist/lib/platform/sdk/topicsClient.js +118 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/types.d.ts +224 -2
- package/dist/lib/platform/sdk/types.js +1 -0
- package/dist/lib/platform/sdk/version.js +2 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/workflowClient.d.ts +63 -2
- package/dist/lib/platform/sdk/workflowClient.js +366 -0
- package/dist/lucern/contracts/src/api-enums.contract.d.ts +58 -0
- package/dist/lucern/contracts/src/api-enums.contract.js +147 -0
- package/dist/lucern/contracts/src/auth-context.contract.d.ts +8 -0
- package/dist/lucern/contracts/src/auth-context.contract.js +8 -0
- package/dist/lucern/contracts/src/auth-session.contract.d.ts +5 -50
- package/dist/lucern/contracts/src/auth-session.contract.js +8 -0
- package/dist/lucern/contracts/src/auth.contract.d.ts +88 -0
- package/dist/lucern/contracts/src/auth.contract.js +57 -0
- package/dist/lucern/contracts/src/context-pack.contract.js +169 -0
- package/dist/lucern/contracts/src/convex-admin.contract.d.ts +5 -0
- package/dist/lucern/contracts/src/convex-admin.contract.js +1 -0
- package/dist/lucern/contracts/src/events-types.contract.d.ts +8 -0
- package/dist/lucern/contracts/src/events-types.contract.js +8 -0
- package/dist/lucern/{packages/events/src/types.d.ts → contracts/src/events.contract.d.ts} +25 -0
- package/dist/lucern/contracts/src/events.contract.js +159 -0
- package/dist/lucern/contracts/src/gateway.contract.d.ts +74 -0
- package/dist/lucern/contracts/src/gateway.contract.js +19 -0
- package/dist/lucern/contracts/src/ids.contract.js +24 -0
- package/dist/lucern/contracts/src/index.d.ts +29 -0
- package/dist/lucern/contracts/src/index.js +29 -0
- package/dist/lucern/contracts/src/lens-filter.contract.js +95 -0
- package/dist/lucern/contracts/src/lens-workflow.contract.js +54 -0
- package/dist/lucern/contracts/src/mcp-tools.contract.js +3281 -0
- package/dist/lucern/contracts/src/ontology-matching.contract.d.ts +8 -0
- package/dist/lucern/contracts/src/ontology-matching.contract.js +8 -0
- package/dist/lucern/contracts/src/prompt.contract.d.ts +24 -0
- package/dist/lucern/contracts/src/prompt.contract.js +24 -0
- package/dist/lucern/contracts/src/sdk-methods.contract.d.ts +358 -0
- package/dist/lucern/contracts/src/sdk-methods.contract.js +19 -0
- package/dist/lucern/contracts/src/sdk-tools.contract.d.ts +92 -0
- package/dist/lucern/contracts/src/sdk-tools.contract.js +1398 -0
- package/dist/lucern/contracts/src/text-matching.contract.js +277 -0
- package/dist/lucern/contracts/src/topic-scope.contract.d.ts +8 -0
- package/dist/lucern/contracts/src/topic-scope.contract.js +8 -0
- package/dist/lucern/contracts/src/workflow-runtime.contract.js +257 -0
- 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/package.json +18 -5
- package/dist/index.js.map +0 -1
- package/dist/lucern/mcp-server/src/context-pack-policy.d.ts +0 -119
- package/dist/lucern/mcp-server/src/context-pack-schema.d.ts +0 -18
- package/dist/lucern/modules/graph-primitives/src/ontology-matching.d.ts +0 -78
- package/dist/lucern/packages/client-core/src/beliefs.d.ts +0 -30
- package/dist/lucern/packages/client-core/src/context.d.ts +0 -29
- package/dist/lucern/packages/client-core/src/contradictions.d.ts +0 -11
- package/dist/lucern/packages/client-core/src/edges.d.ts +0 -11
- package/dist/lucern/packages/client-core/src/events.d.ts +0 -9
- package/dist/lucern/packages/client-core/src/evidence.d.ts +0 -21
- package/dist/lucern/packages/client-core/src/graph.d.ts +0 -17
- package/dist/lucern/packages/client-core/src/identity.d.ts +0 -7
- package/dist/lucern/packages/client-core/src/ontologies.d.ts +0 -13
- package/dist/lucern/packages/client-core/src/questions.d.ts +0 -39
- package/dist/lucern/packages/client-core/src/search.d.ts +0 -7
- package/dist/lucern/packages/client-core/src/tasks.d.ts +0 -13
- package/dist/lucern/packages/client-core/src/topics.d.ts +0 -17
- package/dist/lucern/packages/client-core/src/webhooks.d.ts +0 -35
- package/dist/lucern/packages/client-core/src/worktrees.d.ts +0 -17
- package/dist/lucern/packages/domain-beliefs/src/beliefs.d.ts +0 -283
- package/dist/lucern/packages/domain-beliefs/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-context/src/compile.d.ts +0 -11
- package/dist/lucern/packages/domain-context/src/index.d.ts +0 -4
- package/dist/lucern/packages/domain-context/src/ports.d.ts +0 -58
- package/dist/lucern/packages/domain-context/src/public-types.d.ts +0 -1
- package/dist/lucern/packages/domain-edges/src/contradictions.d.ts +0 -59
- package/dist/lucern/packages/domain-edges/src/edges.d.ts +0 -91
- package/dist/lucern/packages/domain-edges/src/index.d.ts +0 -2
- package/dist/lucern/packages/domain-evidence/src/evidence.d.ts +0 -115
- package/dist/lucern/packages/domain-evidence/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-graph/src/graph.d.ts +0 -150
- package/dist/lucern/packages/domain-identity/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-identity/src/whoami.d.ts +0 -13
- package/dist/lucern/packages/domain-ontologies/src/ontologies.d.ts +0 -123
- package/dist/lucern/packages/domain-questions/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-questions/src/questions.d.ts +0 -147
- package/dist/lucern/packages/domain-search/src/search.d.ts +0 -97
- package/dist/lucern/packages/domain-tasks/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-tasks/src/tasks.d.ts +0 -102
- package/dist/lucern/packages/domain-topics/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-topics/src/topics.d.ts +0 -147
- package/dist/lucern/packages/domain-worktrees/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-worktrees/src/worktrees.d.ts +0 -185
- package/dist/lucern/packages/events/src/index.d.ts +0 -4
- package/dist/lucern/packages/events/src/matching.d.ts +0 -3
- package/dist/lucern/packages/events/src/outbox.d.ts +0 -15
- package/dist/lucern/packages/events/src/webhooks.d.ts +0 -9
- package/dist/lucern/packages/sdk-typescript/src/facade/beliefs.d.ts +0 -15
- package/dist/lucern/packages/sdk-typescript/src/facade/context.d.ts +0 -12
- package/dist/lucern/packages/sdk-typescript/src/facade/contradictions.d.ts +0 -7
- package/dist/lucern/packages/sdk-typescript/src/facade/edges.d.ts +0 -7
- package/dist/lucern/packages/sdk-typescript/src/facade/events.d.ts +0 -6
- package/dist/lucern/packages/sdk-typescript/src/facade/evidence.d.ts +0 -21
- package/dist/lucern/packages/sdk-typescript/src/facade/graph.d.ts +0 -10
- package/dist/lucern/packages/sdk-typescript/src/facade/identity.d.ts +0 -5
- package/dist/lucern/packages/sdk-typescript/src/facade/ontologies.d.ts +0 -8
- package/dist/lucern/packages/sdk-typescript/src/facade/questions.d.ts +0 -39
- package/dist/lucern/packages/sdk-typescript/src/facade/search.d.ts +0 -5
- package/dist/lucern/packages/sdk-typescript/src/facade/tasks.d.ts +0 -8
- package/dist/lucern/packages/sdk-typescript/src/facade/topics.d.ts +0 -10
- package/dist/lucern/packages/sdk-typescript/src/facade/webhooks.d.ts +0 -16
- package/dist/lucern/packages/sdk-typescript/src/facade/worktrees.d.ts +0 -10
- package/dist/lucern/packages/sdk-typescript/src/index.d.ts +0 -28
- package/dist/packages/sdk/src/adminClient.d.ts +0 -89
- package/dist/packages/sdk/src/answersClient.d.ts +0 -5
- package/dist/packages/sdk/src/beliefsClient.d.ts +0 -52
- package/dist/packages/sdk/src/contextClient.d.ts +0 -9
- package/dist/packages/sdk/src/contracts/api-enums.contract.d.ts +0 -79
- /package/dist/{packages/sdk/src → lib/platform/sdk}/version.d.ts +0 -0
- /package/dist/lucern/{packages/client-core/src/ids.d.ts → contracts/src/ids.contract.d.ts} +0 -0
- /package/dist/lucern/{modules/graph-primitives/src/text-matching.d.ts → contracts/src/text-matching.contract.d.ts} +0 -0
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
2
|
+
import { createOntologyClient, } from "./ontologyClient.js";
|
|
3
|
+
import { createGraphClient } from "./graphClient.js";
|
|
4
|
+
import { createIdentityClient } from "./identityClient.js";
|
|
5
|
+
import { createTopicsClient, } from "./topicsClient.js";
|
|
6
|
+
function serializeTypes(types) {
|
|
7
|
+
return Array.isArray(types) && types.length > 0 ? types.join(",") : undefined;
|
|
8
|
+
}
|
|
9
|
+
export function createBeliefsFacade(config = {}) {
|
|
10
|
+
const gateway = createGatewayRequestClient(config);
|
|
11
|
+
return {
|
|
12
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
13
|
+
return gateway.request({
|
|
14
|
+
path: "/api/platform/v1/beliefs",
|
|
15
|
+
method: "POST",
|
|
16
|
+
body: input,
|
|
17
|
+
idempotencyKey,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
async get(id) {
|
|
21
|
+
return gateway.request({
|
|
22
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}`,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
async list(query) {
|
|
26
|
+
return gateway.request({
|
|
27
|
+
path: `/api/platform/v1/beliefs${toQueryString({
|
|
28
|
+
topicId: query.topicId,
|
|
29
|
+
status: query.status,
|
|
30
|
+
worktreeId: query.worktreeId,
|
|
31
|
+
minConfidence: query.minConfidence,
|
|
32
|
+
limit: query.limit,
|
|
33
|
+
cursor: query.cursor,
|
|
34
|
+
})}`,
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
async refine(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
38
|
+
return gateway.request({
|
|
39
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}`,
|
|
40
|
+
method: "PATCH",
|
|
41
|
+
body: input,
|
|
42
|
+
idempotencyKey,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
async fork(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
46
|
+
return gateway.request({
|
|
47
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}/fork`,
|
|
48
|
+
method: "POST",
|
|
49
|
+
body: input,
|
|
50
|
+
idempotencyKey,
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
async updateConfidence(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
54
|
+
return gateway.request({
|
|
55
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}/confidence`,
|
|
56
|
+
method: "POST",
|
|
57
|
+
body: input,
|
|
58
|
+
idempotencyKey,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
async updateStatus(input, idempotencyKey = randomIdempotencyKey()) {
|
|
62
|
+
return gateway.request({
|
|
63
|
+
path: "/api/platform/v1/beliefs/update-status",
|
|
64
|
+
method: "POST",
|
|
65
|
+
body: input,
|
|
66
|
+
idempotencyKey,
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
async updateRationale(input, idempotencyKey = randomIdempotencyKey()) {
|
|
70
|
+
return gateway.request({
|
|
71
|
+
path: "/api/platform/v1/beliefs/update-rationale",
|
|
72
|
+
method: "POST",
|
|
73
|
+
body: input,
|
|
74
|
+
idempotencyKey,
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
async linkBeliefs(input, idempotencyKey = randomIdempotencyKey()) {
|
|
78
|
+
return gateway.request({
|
|
79
|
+
path: "/api/platform/v1/beliefs/link",
|
|
80
|
+
method: "POST",
|
|
81
|
+
body: input,
|
|
82
|
+
idempotencyKey,
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
async unlinkEvidence(input, idempotencyKey = randomIdempotencyKey()) {
|
|
86
|
+
return gateway.request({
|
|
87
|
+
path: "/api/platform/v1/beliefs/unlink-evidence",
|
|
88
|
+
method: "POST",
|
|
89
|
+
body: input,
|
|
90
|
+
idempotencyKey,
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
async updateCriticality(input, idempotencyKey = randomIdempotencyKey()) {
|
|
94
|
+
return gateway.request({
|
|
95
|
+
path: "/api/platform/v1/beliefs/update-criticality",
|
|
96
|
+
method: "POST",
|
|
97
|
+
body: input,
|
|
98
|
+
idempotencyKey,
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
async batchUpdateCriticality(input, idempotencyKey = randomIdempotencyKey()) {
|
|
102
|
+
return gateway.request({
|
|
103
|
+
path: "/api/platform/v1/beliefs/batch-update-criticality",
|
|
104
|
+
method: "POST",
|
|
105
|
+
body: input,
|
|
106
|
+
idempotencyKey,
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
async reassignTopic(input, idempotencyKey = randomIdempotencyKey()) {
|
|
110
|
+
return gateway.request({
|
|
111
|
+
path: "/api/platform/v1/beliefs/reassign-topic",
|
|
112
|
+
method: "POST",
|
|
113
|
+
body: input,
|
|
114
|
+
idempotencyKey,
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
async archive(id, input = {}, idempotencyKey = randomIdempotencyKey()) {
|
|
118
|
+
return gateway.request({
|
|
119
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}`,
|
|
120
|
+
method: "DELETE",
|
|
121
|
+
body: input,
|
|
122
|
+
idempotencyKey,
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
async lineage(id) {
|
|
126
|
+
return gateway.request({
|
|
127
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}/lineage`,
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
async confidenceHistory(id) {
|
|
131
|
+
return gateway.request({
|
|
132
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}/confidence-history`,
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
async createContract(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
136
|
+
return gateway.request({
|
|
137
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}/contracts`,
|
|
138
|
+
method: "POST",
|
|
139
|
+
body: input,
|
|
140
|
+
idempotencyKey,
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
async bisect(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
144
|
+
return gateway.request({
|
|
145
|
+
path: `/api/platform/v1/beliefs/${encodeURIComponent(id)}/bisect`,
|
|
146
|
+
method: "POST",
|
|
147
|
+
body: input,
|
|
148
|
+
idempotencyKey,
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export function createContradictionsFacade(config = {}) {
|
|
154
|
+
const gateway = createGatewayRequestClient(config);
|
|
155
|
+
return {
|
|
156
|
+
async flag(input, idempotencyKey = randomIdempotencyKey()) {
|
|
157
|
+
return gateway.request({
|
|
158
|
+
path: "/api/platform/v1/contradictions",
|
|
159
|
+
method: "POST",
|
|
160
|
+
body: input,
|
|
161
|
+
idempotencyKey,
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
async list(query) {
|
|
165
|
+
return gateway.request({
|
|
166
|
+
path: `/api/platform/v1/contradictions${toQueryString({
|
|
167
|
+
topicId: query.topicId,
|
|
168
|
+
status: query.status,
|
|
169
|
+
limit: query.limit,
|
|
170
|
+
cursor: query.cursor,
|
|
171
|
+
})}`,
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
async get(id) {
|
|
175
|
+
return gateway.request({
|
|
176
|
+
path: `/api/platform/v1/contradictions/${encodeURIComponent(id)}`,
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export function createEdgesFacade(config = {}) {
|
|
182
|
+
const gateway = createGatewayRequestClient(config);
|
|
183
|
+
return {
|
|
184
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
185
|
+
return gateway.request({
|
|
186
|
+
path: "/api/platform/v1/edges",
|
|
187
|
+
method: "POST",
|
|
188
|
+
body: input,
|
|
189
|
+
idempotencyKey,
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
async list(query) {
|
|
193
|
+
return gateway.request({
|
|
194
|
+
path: `/api/platform/v1/edges${toQueryString({
|
|
195
|
+
sourceId: query.sourceId,
|
|
196
|
+
edgeType: query.edgeType,
|
|
197
|
+
limit: query.limit,
|
|
198
|
+
cursor: query.cursor,
|
|
199
|
+
})}`,
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
async traverse(input, idempotencyKey = randomIdempotencyKey()) {
|
|
203
|
+
return gateway.request({
|
|
204
|
+
path: "/api/platform/v1/edges/traverse",
|
|
205
|
+
method: "POST",
|
|
206
|
+
body: input,
|
|
207
|
+
idempotencyKey,
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
async update(input, idempotencyKey = randomIdempotencyKey()) {
|
|
211
|
+
return gateway.request({
|
|
212
|
+
path: "/api/platform/v1/edges/update",
|
|
213
|
+
method: "POST",
|
|
214
|
+
body: input,
|
|
215
|
+
idempotencyKey,
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
async remove(input, idempotencyKey = randomIdempotencyKey()) {
|
|
219
|
+
return gateway.request({
|
|
220
|
+
path: "/api/platform/v1/edges/remove",
|
|
221
|
+
method: "POST",
|
|
222
|
+
body: input,
|
|
223
|
+
idempotencyKey,
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
async removeBetween(input, idempotencyKey = randomIdempotencyKey()) {
|
|
227
|
+
return gateway.request({
|
|
228
|
+
path: "/api/platform/v1/edges/remove-between",
|
|
229
|
+
method: "POST",
|
|
230
|
+
body: input,
|
|
231
|
+
idempotencyKey,
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
async batchCreate(input, idempotencyKey = randomIdempotencyKey()) {
|
|
235
|
+
return gateway.request({
|
|
236
|
+
path: "/api/platform/v1/edges/batch",
|
|
237
|
+
method: "POST",
|
|
238
|
+
body: input,
|
|
239
|
+
idempotencyKey,
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
async delete(input, idempotencyKey = randomIdempotencyKey()) {
|
|
243
|
+
return gateway.request({
|
|
244
|
+
path: "/api/platform/v1/edges/delete",
|
|
245
|
+
method: "POST",
|
|
246
|
+
body: input,
|
|
247
|
+
idempotencyKey,
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
export function createEvidenceFacade(config = {}) {
|
|
253
|
+
const gateway = createGatewayRequestClient(config);
|
|
254
|
+
return {
|
|
255
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
256
|
+
return gateway.request({
|
|
257
|
+
path: "/api/platform/v1/evidence",
|
|
258
|
+
method: "POST",
|
|
259
|
+
body: input,
|
|
260
|
+
idempotencyKey,
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
async get(id) {
|
|
264
|
+
return gateway.request({
|
|
265
|
+
path: `/api/platform/v1/evidence/${encodeURIComponent(id)}`,
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
async list(query) {
|
|
269
|
+
return gateway.request({
|
|
270
|
+
path: `/api/platform/v1/evidence${toQueryString({
|
|
271
|
+
topicId: query.topicId,
|
|
272
|
+
targetId: query.targetId,
|
|
273
|
+
limit: query.limit,
|
|
274
|
+
cursor: query.cursor,
|
|
275
|
+
})}`,
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
async link(input, idempotencyKey = randomIdempotencyKey()) {
|
|
279
|
+
return gateway.request({
|
|
280
|
+
path: `/api/platform/v1/evidence/${encodeURIComponent(input.evidenceId)}/link`,
|
|
281
|
+
method: "POST",
|
|
282
|
+
body: {
|
|
283
|
+
targetId: input.targetId,
|
|
284
|
+
targetType: input.targetType,
|
|
285
|
+
weight: input.weight,
|
|
286
|
+
rationale: input.rationale,
|
|
287
|
+
},
|
|
288
|
+
idempotencyKey,
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
async search(query, idempotencyKey = randomIdempotencyKey()) {
|
|
292
|
+
return gateway.request({
|
|
293
|
+
path: "/api/platform/v1/evidence/search",
|
|
294
|
+
method: "POST",
|
|
295
|
+
body: query,
|
|
296
|
+
idempotencyKey,
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
async updateStatus(input, idempotencyKey = randomIdempotencyKey()) {
|
|
300
|
+
return gateway.request({
|
|
301
|
+
path: "/api/platform/v1/evidence/update-status",
|
|
302
|
+
method: "POST",
|
|
303
|
+
body: input,
|
|
304
|
+
idempotencyKey,
|
|
305
|
+
});
|
|
306
|
+
},
|
|
307
|
+
async update(input, idempotencyKey = randomIdempotencyKey()) {
|
|
308
|
+
return gateway.request({
|
|
309
|
+
path: "/api/platform/v1/evidence/update",
|
|
310
|
+
method: "POST",
|
|
311
|
+
body: input,
|
|
312
|
+
idempotencyKey,
|
|
313
|
+
});
|
|
314
|
+
},
|
|
315
|
+
async flagIncorrect(input, idempotencyKey = randomIdempotencyKey()) {
|
|
316
|
+
return gateway.request({
|
|
317
|
+
path: "/api/platform/v1/evidence/flag-incorrect",
|
|
318
|
+
method: "POST",
|
|
319
|
+
body: input,
|
|
320
|
+
idempotencyKey,
|
|
321
|
+
});
|
|
322
|
+
},
|
|
323
|
+
async remove(input, idempotencyKey = randomIdempotencyKey()) {
|
|
324
|
+
return gateway.request({
|
|
325
|
+
path: "/api/platform/v1/evidence/remove",
|
|
326
|
+
method: "POST",
|
|
327
|
+
body: input,
|
|
328
|
+
idempotencyKey,
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
async updateVerificationStatus(input, idempotencyKey = randomIdempotencyKey()) {
|
|
332
|
+
return gateway.request({
|
|
333
|
+
path: "/api/platform/v1/evidence/update-verification-status",
|
|
334
|
+
method: "POST",
|
|
335
|
+
body: input,
|
|
336
|
+
idempotencyKey,
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
export function createEventsFacade(config = {}) {
|
|
342
|
+
const gateway = createGatewayRequestClient(config);
|
|
343
|
+
return {
|
|
344
|
+
async list(query = {}) {
|
|
345
|
+
return gateway.request({
|
|
346
|
+
path: `/api/platform/v1/events${toQueryString({
|
|
347
|
+
topicId: query.topicId,
|
|
348
|
+
after: query.after,
|
|
349
|
+
types: serializeTypes(query.types),
|
|
350
|
+
startTime: query.startTime,
|
|
351
|
+
endTime: query.endTime,
|
|
352
|
+
limit: query.limit,
|
|
353
|
+
})}`,
|
|
354
|
+
});
|
|
355
|
+
},
|
|
356
|
+
async replay(input, idempotencyKey = randomIdempotencyKey()) {
|
|
357
|
+
return gateway.request({
|
|
358
|
+
path: "/api/platform/v1/events/replay",
|
|
359
|
+
method: "POST",
|
|
360
|
+
body: input,
|
|
361
|
+
idempotencyKey,
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
export function createGraphFacade(config = {}) {
|
|
367
|
+
const graphClient = createGraphClient(config);
|
|
368
|
+
const gateway = createGatewayRequestClient(config);
|
|
369
|
+
return {
|
|
370
|
+
async neighborhood(input) {
|
|
371
|
+
return graphClient.neighborhood({
|
|
372
|
+
globalId: input.globalId,
|
|
373
|
+
globalIds: Array.isArray(input.globalIds)
|
|
374
|
+
? input.globalIds.join(",")
|
|
375
|
+
: input.globalIds,
|
|
376
|
+
maxDepth: input.maxDepth,
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
async traverse(input) {
|
|
380
|
+
return graphClient.traverse(input);
|
|
381
|
+
},
|
|
382
|
+
async analyze(input = {}) {
|
|
383
|
+
return graphClient.analyze(input);
|
|
384
|
+
},
|
|
385
|
+
async bias(input = {}) {
|
|
386
|
+
return graphClient.bias(input);
|
|
387
|
+
},
|
|
388
|
+
async gaps(input) {
|
|
389
|
+
return graphClient.gaps(input);
|
|
390
|
+
},
|
|
391
|
+
async falsify(input, idempotencyKey = randomIdempotencyKey()) {
|
|
392
|
+
return gateway.request({
|
|
393
|
+
path: "/api/platform/v1/graph/falsify",
|
|
394
|
+
method: "POST",
|
|
395
|
+
body: input,
|
|
396
|
+
idempotencyKey,
|
|
397
|
+
});
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
export function createIdentityFacade(config = {}) {
|
|
402
|
+
const identityClient = createIdentityClient(config);
|
|
403
|
+
return {
|
|
404
|
+
async whoami() {
|
|
405
|
+
const response = await identityClient.whoami();
|
|
406
|
+
return Object.assign({}, response, response.data);
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
export function createOntologiesFacade(config = {}) {
|
|
411
|
+
const ontologyClient = createOntologyClient(config);
|
|
412
|
+
const gateway = createGatewayRequestClient(config);
|
|
413
|
+
return {
|
|
414
|
+
async get(id) {
|
|
415
|
+
return gateway.request({
|
|
416
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
|
|
417
|
+
});
|
|
418
|
+
},
|
|
419
|
+
async list(query = {}) {
|
|
420
|
+
return ontologyClient.list(query);
|
|
421
|
+
},
|
|
422
|
+
async bind(input, idempotencyKey) {
|
|
423
|
+
return gateway.request({
|
|
424
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(input.ontologyId)}/bind`,
|
|
425
|
+
method: "POST",
|
|
426
|
+
body: {
|
|
427
|
+
topicId: input.topicId,
|
|
428
|
+
},
|
|
429
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
430
|
+
});
|
|
431
|
+
},
|
|
432
|
+
async match(input, idempotencyKey) {
|
|
433
|
+
return gateway.request({
|
|
434
|
+
path: "/api/platform/v1/ontologies/match",
|
|
435
|
+
method: "POST",
|
|
436
|
+
body: input,
|
|
437
|
+
idempotencyKey,
|
|
438
|
+
});
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
export function createQuestionsFacade(config = {}) {
|
|
443
|
+
const gateway = createGatewayRequestClient(config);
|
|
444
|
+
return {
|
|
445
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
446
|
+
return gateway.request({
|
|
447
|
+
path: "/api/platform/v1/questions",
|
|
448
|
+
method: "POST",
|
|
449
|
+
body: input,
|
|
450
|
+
idempotencyKey,
|
|
451
|
+
});
|
|
452
|
+
},
|
|
453
|
+
async get(id) {
|
|
454
|
+
return gateway.request({
|
|
455
|
+
path: `/api/platform/v1/questions/${encodeURIComponent(id)}`,
|
|
456
|
+
});
|
|
457
|
+
},
|
|
458
|
+
async list(query) {
|
|
459
|
+
return gateway.request({
|
|
460
|
+
path: `/api/platform/v1/questions${toQueryString({
|
|
461
|
+
topicId: query.topicId,
|
|
462
|
+
status: query.status,
|
|
463
|
+
priority: query.priority,
|
|
464
|
+
worktreeId: query.worktreeId,
|
|
465
|
+
limit: query.limit,
|
|
466
|
+
cursor: query.cursor,
|
|
467
|
+
})}`,
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
async answer(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
471
|
+
return gateway.request({
|
|
472
|
+
path: `/api/platform/v1/questions/${encodeURIComponent(id)}/answer`,
|
|
473
|
+
method: "POST",
|
|
474
|
+
body: input,
|
|
475
|
+
idempotencyKey,
|
|
476
|
+
});
|
|
477
|
+
},
|
|
478
|
+
async refine(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
479
|
+
return gateway.request({
|
|
480
|
+
path: `/api/platform/v1/questions/${encodeURIComponent(id)}/refine`,
|
|
481
|
+
method: "POST",
|
|
482
|
+
body: input,
|
|
483
|
+
idempotencyKey,
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
async archive(id, input = {}, idempotencyKey = randomIdempotencyKey()) {
|
|
487
|
+
return gateway.request({
|
|
488
|
+
path: `/api/platform/v1/questions/${encodeURIComponent(id)}`,
|
|
489
|
+
method: "DELETE",
|
|
490
|
+
body: input,
|
|
491
|
+
idempotencyKey,
|
|
492
|
+
});
|
|
493
|
+
},
|
|
494
|
+
async updateStatus(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
495
|
+
return gateway.request({
|
|
496
|
+
path: `/api/platform/v1/questions/${encodeURIComponent(id)}/status`,
|
|
497
|
+
method: "PATCH",
|
|
498
|
+
body: input,
|
|
499
|
+
idempotencyKey,
|
|
500
|
+
});
|
|
501
|
+
},
|
|
502
|
+
async batchCreate(input, idempotencyKey = randomIdempotencyKey()) {
|
|
503
|
+
return gateway.request({
|
|
504
|
+
path: "/api/platform/v1/questions/batch",
|
|
505
|
+
method: "POST",
|
|
506
|
+
body: input,
|
|
507
|
+
idempotencyKey,
|
|
508
|
+
});
|
|
509
|
+
},
|
|
510
|
+
async add(input, idempotencyKey = randomIdempotencyKey()) {
|
|
511
|
+
return gateway.request({
|
|
512
|
+
path: "/api/platform/v1/questions/add",
|
|
513
|
+
method: "POST",
|
|
514
|
+
body: input,
|
|
515
|
+
idempotencyKey,
|
|
516
|
+
});
|
|
517
|
+
},
|
|
518
|
+
async updatePriority(input, idempotencyKey = randomIdempotencyKey()) {
|
|
519
|
+
return gateway.request({
|
|
520
|
+
path: "/api/platform/v1/questions/update-priority",
|
|
521
|
+
method: "POST",
|
|
522
|
+
body: input,
|
|
523
|
+
idempotencyKey,
|
|
524
|
+
});
|
|
525
|
+
},
|
|
526
|
+
async advanceToConviction(input, idempotencyKey = randomIdempotencyKey()) {
|
|
527
|
+
return gateway.request({
|
|
528
|
+
path: "/api/platform/v1/questions/advance-to-conviction",
|
|
529
|
+
method: "POST",
|
|
530
|
+
body: input,
|
|
531
|
+
idempotencyKey,
|
|
532
|
+
});
|
|
533
|
+
},
|
|
534
|
+
async updateConviction(input, idempotencyKey = randomIdempotencyKey()) {
|
|
535
|
+
return gateway.request({
|
|
536
|
+
path: "/api/platform/v1/questions/update-conviction",
|
|
537
|
+
method: "POST",
|
|
538
|
+
body: input,
|
|
539
|
+
idempotencyKey,
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
async finalizeConviction(input, idempotencyKey = randomIdempotencyKey()) {
|
|
543
|
+
return gateway.request({
|
|
544
|
+
path: "/api/platform/v1/questions/finalize-conviction",
|
|
545
|
+
method: "POST",
|
|
546
|
+
body: input,
|
|
547
|
+
idempotencyKey,
|
|
548
|
+
});
|
|
549
|
+
},
|
|
550
|
+
async update(input, idempotencyKey = randomIdempotencyKey()) {
|
|
551
|
+
return gateway.request({
|
|
552
|
+
path: "/api/platform/v1/questions/update",
|
|
553
|
+
method: "POST",
|
|
554
|
+
body: input,
|
|
555
|
+
idempotencyKey,
|
|
556
|
+
});
|
|
557
|
+
},
|
|
558
|
+
async delete(input, idempotencyKey = randomIdempotencyKey()) {
|
|
559
|
+
return gateway.request({
|
|
560
|
+
path: "/api/platform/v1/questions/delete",
|
|
561
|
+
method: "POST",
|
|
562
|
+
body: input,
|
|
563
|
+
idempotencyKey,
|
|
564
|
+
});
|
|
565
|
+
},
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
export function createSearchFacade(config = {}) {
|
|
569
|
+
const gateway = createGatewayRequestClient(config);
|
|
570
|
+
return {
|
|
571
|
+
async query(input) {
|
|
572
|
+
return gateway.request({
|
|
573
|
+
path: "/api/platform/v1/search",
|
|
574
|
+
method: "POST",
|
|
575
|
+
body: input,
|
|
576
|
+
});
|
|
577
|
+
},
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
export function createTasksFacade(config = {}) {
|
|
581
|
+
const gateway = createGatewayRequestClient(config);
|
|
582
|
+
return {
|
|
583
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
584
|
+
return gateway.request({
|
|
585
|
+
path: "/api/platform/v1/tasks",
|
|
586
|
+
method: "POST",
|
|
587
|
+
body: input,
|
|
588
|
+
idempotencyKey,
|
|
589
|
+
});
|
|
590
|
+
},
|
|
591
|
+
async update(input, idempotencyKey = randomIdempotencyKey()) {
|
|
592
|
+
return gateway.request({
|
|
593
|
+
path: `/api/platform/v1/tasks/${encodeURIComponent(input.id)}`,
|
|
594
|
+
method: "PATCH",
|
|
595
|
+
body: {
|
|
596
|
+
title: input.title,
|
|
597
|
+
description: input.description,
|
|
598
|
+
priority: input.priority,
|
|
599
|
+
status: input.status,
|
|
600
|
+
linkedBeliefId: input.linkedBeliefId,
|
|
601
|
+
linkedQuestionId: input.linkedQuestionId,
|
|
602
|
+
linkedWorktreeId: input.linkedWorktreeId,
|
|
603
|
+
metadata: input.metadata,
|
|
604
|
+
},
|
|
605
|
+
idempotencyKey,
|
|
606
|
+
});
|
|
607
|
+
},
|
|
608
|
+
async complete(input, idempotencyKey = randomIdempotencyKey()) {
|
|
609
|
+
return gateway.request({
|
|
610
|
+
path: `/api/platform/v1/tasks/${encodeURIComponent(input.id)}/complete`,
|
|
611
|
+
method: "POST",
|
|
612
|
+
body: {
|
|
613
|
+
outputSummary: input.outputSummary,
|
|
614
|
+
},
|
|
615
|
+
idempotencyKey,
|
|
616
|
+
});
|
|
617
|
+
},
|
|
618
|
+
async list(query) {
|
|
619
|
+
return gateway.request({
|
|
620
|
+
path: `/api/platform/v1/tasks${toQueryString({
|
|
621
|
+
topicId: query.topicId,
|
|
622
|
+
worktreeId: query.worktreeId,
|
|
623
|
+
status: query.status,
|
|
624
|
+
limit: query.limit,
|
|
625
|
+
})}`,
|
|
626
|
+
});
|
|
627
|
+
},
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
export function createTopicsFacade(config = {}) {
|
|
631
|
+
const topicsClient = createTopicsClient(config);
|
|
632
|
+
return {
|
|
633
|
+
async create(input, idempotencyKey) {
|
|
634
|
+
return topicsClient.create(input, idempotencyKey);
|
|
635
|
+
},
|
|
636
|
+
async get(id) {
|
|
637
|
+
return topicsClient.get(id);
|
|
638
|
+
},
|
|
639
|
+
async list(query = {}) {
|
|
640
|
+
return topicsClient.list(query);
|
|
641
|
+
},
|
|
642
|
+
async update(input, idempotencyKey) {
|
|
643
|
+
const { id, ...rest } = input;
|
|
644
|
+
return topicsClient.update(id, rest, idempotencyKey);
|
|
645
|
+
},
|
|
646
|
+
async tree(input) {
|
|
647
|
+
return topicsClient.getTree(input.id, {
|
|
648
|
+
maxDepth: input.maxDepth,
|
|
649
|
+
});
|
|
650
|
+
},
|
|
651
|
+
async coverage(input) {
|
|
652
|
+
return topicsClient.getCoverage(input.id, {
|
|
653
|
+
includeDescendants: input.includeDescendants,
|
|
654
|
+
maxDepth: input.maxDepth,
|
|
655
|
+
});
|
|
656
|
+
},
|
|
657
|
+
async remove(id, idempotencyKey = randomIdempotencyKey()) {
|
|
658
|
+
return topicsClient.remove(id, idempotencyKey);
|
|
659
|
+
},
|
|
660
|
+
async bulkCreate(input, idempotencyKey = randomIdempotencyKey()) {
|
|
661
|
+
return topicsClient.bulkCreate(input, idempotencyKey);
|
|
662
|
+
},
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
export function createWebhooksFacade(config = {}) {
|
|
666
|
+
const gateway = createGatewayRequestClient(config);
|
|
667
|
+
return {
|
|
668
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
669
|
+
return gateway.request({
|
|
670
|
+
path: "/api/platform/v1/webhooks",
|
|
671
|
+
method: "POST",
|
|
672
|
+
body: input,
|
|
673
|
+
idempotencyKey,
|
|
674
|
+
});
|
|
675
|
+
},
|
|
676
|
+
async list(query = {}) {
|
|
677
|
+
return gateway.request({
|
|
678
|
+
path: `/api/platform/v1/webhooks${toQueryString({
|
|
679
|
+
topicId: query.topicId,
|
|
680
|
+
})}`,
|
|
681
|
+
});
|
|
682
|
+
},
|
|
683
|
+
async get(id) {
|
|
684
|
+
return gateway.request({
|
|
685
|
+
path: `/api/platform/v1/webhooks/${encodeURIComponent(id)}`,
|
|
686
|
+
});
|
|
687
|
+
},
|
|
688
|
+
async update(id, input, idempotencyKey = randomIdempotencyKey()) {
|
|
689
|
+
return gateway.request({
|
|
690
|
+
path: `/api/platform/v1/webhooks/${encodeURIComponent(id)}`,
|
|
691
|
+
method: "PATCH",
|
|
692
|
+
body: input,
|
|
693
|
+
idempotencyKey,
|
|
694
|
+
});
|
|
695
|
+
},
|
|
696
|
+
async delete(id, idempotencyKey = randomIdempotencyKey()) {
|
|
697
|
+
return gateway.request({
|
|
698
|
+
path: `/api/platform/v1/webhooks/${encodeURIComponent(id)}`,
|
|
699
|
+
method: "DELETE",
|
|
700
|
+
idempotencyKey,
|
|
701
|
+
});
|
|
702
|
+
},
|
|
703
|
+
async test(id, input = {}, idempotencyKey = randomIdempotencyKey()) {
|
|
704
|
+
return gateway.request({
|
|
705
|
+
path: `/api/platform/v1/webhooks/${encodeURIComponent(id)}/test`,
|
|
706
|
+
method: "POST",
|
|
707
|
+
body: input,
|
|
708
|
+
idempotencyKey,
|
|
709
|
+
});
|
|
710
|
+
},
|
|
711
|
+
async deliveries(id, query = {}) {
|
|
712
|
+
return gateway.request({
|
|
713
|
+
path: `/api/platform/v1/webhooks/${encodeURIComponent(id)}/deliveries${toQueryString({
|
|
714
|
+
limit: query.limit,
|
|
715
|
+
})}`,
|
|
716
|
+
});
|
|
717
|
+
},
|
|
718
|
+
async health(id) {
|
|
719
|
+
return gateway.request({
|
|
720
|
+
path: `/api/platform/v1/webhooks/${encodeURIComponent(id)}/health`,
|
|
721
|
+
});
|
|
722
|
+
},
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
export function createWorktreesFacade(config = {}) {
|
|
726
|
+
const gateway = createGatewayRequestClient(config);
|
|
727
|
+
return {
|
|
728
|
+
async create(input, idempotencyKey = randomIdempotencyKey()) {
|
|
729
|
+
return gateway.request({
|
|
730
|
+
path: "/api/platform/v1/worktrees",
|
|
731
|
+
method: "POST",
|
|
732
|
+
body: input,
|
|
733
|
+
idempotencyKey,
|
|
734
|
+
});
|
|
735
|
+
},
|
|
736
|
+
async list(query) {
|
|
737
|
+
return gateway.request({
|
|
738
|
+
path: `/api/platform/v1/worktrees${toQueryString({
|
|
739
|
+
topicId: query.topicId,
|
|
740
|
+
status: query.status,
|
|
741
|
+
limit: query.limit,
|
|
742
|
+
})}`,
|
|
743
|
+
});
|
|
744
|
+
},
|
|
745
|
+
async activate(input, idempotencyKey = randomIdempotencyKey()) {
|
|
746
|
+
return gateway.request({
|
|
747
|
+
path: `/api/platform/v1/worktrees/${encodeURIComponent(input.id)}/activate`,
|
|
748
|
+
method: "POST",
|
|
749
|
+
body: {},
|
|
750
|
+
idempotencyKey,
|
|
751
|
+
});
|
|
752
|
+
},
|
|
753
|
+
async update(input, idempotencyKey = randomIdempotencyKey()) {
|
|
754
|
+
return gateway.request({
|
|
755
|
+
path: `/api/platform/v1/worktrees/${encodeURIComponent(input.id)}`,
|
|
756
|
+
method: "PATCH",
|
|
757
|
+
body: {
|
|
758
|
+
objective: input.objective,
|
|
759
|
+
hypothesis: input.hypothesis,
|
|
760
|
+
rationale: input.rationale,
|
|
761
|
+
track: input.track,
|
|
762
|
+
trackPosition: input.trackPosition,
|
|
763
|
+
executionBand: input.executionBand,
|
|
764
|
+
executionOrder: input.executionOrder,
|
|
765
|
+
dependsOn: input.dependsOn,
|
|
766
|
+
blocks: input.blocks,
|
|
767
|
+
gate: input.gate,
|
|
768
|
+
status: input.status,
|
|
769
|
+
topicId: input.topicId,
|
|
770
|
+
additionalTopicIds: input.additionalTopicIds,
|
|
771
|
+
proofArtifacts: input.proofArtifacts,
|
|
772
|
+
staffingHint: input.staffingHint,
|
|
773
|
+
lastReconciledAt: input.lastReconciledAt,
|
|
774
|
+
autoFixPolicy: input.autoFixPolicy,
|
|
775
|
+
lensId: input.lensId,
|
|
776
|
+
},
|
|
777
|
+
idempotencyKey,
|
|
778
|
+
});
|
|
779
|
+
},
|
|
780
|
+
async merge(input, idempotencyKey = randomIdempotencyKey()) {
|
|
781
|
+
return gateway.request({
|
|
782
|
+
path: `/api/platform/v1/worktrees/${encodeURIComponent(input.id)}/merge`,
|
|
783
|
+
method: "POST",
|
|
784
|
+
body: {
|
|
785
|
+
summary: input.summary,
|
|
786
|
+
outcomes: input.outcomes,
|
|
787
|
+
},
|
|
788
|
+
idempotencyKey,
|
|
789
|
+
});
|
|
790
|
+
},
|
|
791
|
+
async updateTargets(input, idempotencyKey = randomIdempotencyKey()) {
|
|
792
|
+
return gateway.request({
|
|
793
|
+
path: `/api/platform/v1/worktrees/${encodeURIComponent(input.id)}/targets`,
|
|
794
|
+
method: "POST",
|
|
795
|
+
body: {
|
|
796
|
+
addBeliefIds: input.addBeliefIds,
|
|
797
|
+
addQuestionIds: input.addQuestionIds,
|
|
798
|
+
removeBeliefIds: input.removeBeliefIds,
|
|
799
|
+
removeQuestionIds: input.removeQuestionIds,
|
|
800
|
+
},
|
|
801
|
+
idempotencyKey,
|
|
802
|
+
});
|
|
803
|
+
},
|
|
804
|
+
async complete(input, idempotencyKey = randomIdempotencyKey()) {
|
|
805
|
+
return gateway.request({
|
|
806
|
+
path: "/api/platform/v1/worktrees/complete",
|
|
807
|
+
method: "POST",
|
|
808
|
+
body: input,
|
|
809
|
+
idempotencyKey,
|
|
810
|
+
});
|
|
811
|
+
},
|
|
812
|
+
async advancePhase(input, idempotencyKey = randomIdempotencyKey()) {
|
|
813
|
+
return gateway.request({
|
|
814
|
+
path: "/api/platform/v1/worktrees/advance-phase",
|
|
815
|
+
method: "POST",
|
|
816
|
+
body: input,
|
|
817
|
+
idempotencyKey,
|
|
818
|
+
});
|
|
819
|
+
},
|
|
820
|
+
async setPhase(input, idempotencyKey = randomIdempotencyKey()) {
|
|
821
|
+
return gateway.request({
|
|
822
|
+
path: "/api/platform/v1/worktrees/set-phase",
|
|
823
|
+
method: "POST",
|
|
824
|
+
body: input,
|
|
825
|
+
idempotencyKey,
|
|
826
|
+
});
|
|
827
|
+
},
|
|
828
|
+
async patchState(input, idempotencyKey = randomIdempotencyKey()) {
|
|
829
|
+
return gateway.request({
|
|
830
|
+
path: "/api/platform/v1/worktrees/patch-state",
|
|
831
|
+
method: "POST",
|
|
832
|
+
body: input,
|
|
833
|
+
idempotencyKey,
|
|
834
|
+
});
|
|
835
|
+
},
|
|
836
|
+
async bulkCreate(input, idempotencyKey = randomIdempotencyKey()) {
|
|
837
|
+
return gateway.request({
|
|
838
|
+
path: "/api/platform/v1/worktrees/bulk",
|
|
839
|
+
method: "POST",
|
|
840
|
+
body: input,
|
|
841
|
+
idempotencyKey,
|
|
842
|
+
});
|
|
843
|
+
},
|
|
844
|
+
};
|
|
845
|
+
}
|