@lucern/sdk 0.2.0-alpha.7 → 0.2.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adminClient.d.ts +409 -0
- package/dist/adminClient.js +755 -0
- package/dist/adminClient.js.map +1 -0
- package/dist/answersClient.d.ts +23 -0
- package/dist/answersClient.js +333 -0
- package/dist/answersClient.js.map +1 -0
- package/dist/audiencesClient.d.ts +99 -0
- package/dist/audiencesClient.js +472 -0
- package/dist/audiencesClient.js.map +1 -0
- package/dist/auditClient.d.ts +29 -0
- package/dist/auditClient.js +386 -0
- package/dist/auditClient.js.map +1 -0
- package/dist/beliefsClient.d.ts +162 -0
- package/dist/beliefsClient.js +477 -0
- package/dist/beliefsClient.js.map +1 -0
- package/dist/client.d.ts +2378 -0
- package/dist/client.js +6134 -0
- package/dist/client.js.map +1 -0
- package/dist/contextClient.d.ts +27 -0
- package/dist/contextClient.js +396 -0
- package/dist/contextClient.js.map +1 -0
- package/dist/contextFacade.d.ts +2 -0
- package/dist/contextFacade.js +73 -0
- package/dist/contextFacade.js.map +1 -0
- package/dist/contextPackCompiler.d.ts +102 -0
- package/dist/contextPackCompiler.js +1091 -0
- package/dist/contextPackCompiler.js.map +1 -0
- package/dist/contextPackPolicy.d.ts +84 -0
- package/dist/contextPackPolicy.js +347 -0
- package/dist/contextPackPolicy.js.map +1 -0
- package/dist/contextPackSchema.d.ts +7 -0
- package/{src/contextPackSchema.ts → dist/contextPackSchema.js} +22 -70
- package/dist/contextPackSchema.js.map +1 -0
- package/dist/contextTypes.d.ts +135 -0
- package/dist/contextTypes.js +3 -0
- package/dist/contextTypes.js.map +1 -0
- package/dist/contracts/api-enums.contract.d.ts +81 -0
- package/dist/contracts/api-enums.contract.js +92 -0
- package/dist/contracts/api-enums.contract.js.map +1 -0
- package/dist/contracts/auth-session.contract.d.ts +55 -0
- package/dist/contracts/auth-session.contract.js +48 -0
- package/dist/contracts/auth-session.contract.js.map +1 -0
- package/dist/contracts/context-pack.contract.d.ts +492 -0
- package/dist/contracts/context-pack.contract.js +98 -0
- package/dist/contracts/context-pack.contract.js.map +1 -0
- package/dist/contracts/contextPack.d.ts +1 -0
- package/dist/contracts/contextPack.js +98 -0
- package/dist/contracts/contextPack.js.map +1 -0
- package/dist/contracts/index.d.ts +9 -0
- package/dist/contracts/index.js +4892 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/lens-filter.contract.d.ts +72 -0
- package/dist/contracts/lens-filter.contract.js +71 -0
- package/dist/contracts/lens-filter.contract.js.map +1 -0
- package/dist/contracts/lens-workflow.contract.d.ts +87 -0
- package/dist/contracts/lens-workflow.contract.js +123 -0
- package/dist/contracts/lens-workflow.contract.js.map +1 -0
- package/dist/contracts/lensFilter.d.ts +1 -0
- package/dist/contracts/lensFilter.js +71 -0
- package/dist/contracts/lensFilter.js.map +1 -0
- package/dist/contracts/lensWorkflow.d.ts +2 -0
- package/dist/contracts/lensWorkflow.js +123 -0
- package/dist/contracts/lensWorkflow.js.map +1 -0
- package/dist/contracts/mcp-tools.contract.d.ts +1 -0
- package/dist/contracts/mcp-tools.contract.js +2986 -0
- package/dist/contracts/mcp-tools.contract.js.map +1 -0
- package/dist/contracts/mcpTools.d.ts +1 -0
- package/dist/contracts/mcpTools.js +2986 -0
- package/dist/contracts/mcpTools.js.map +1 -0
- package/dist/contracts/prompt.contract.d.ts +26 -0
- package/dist/contracts/prompt.contract.js +12 -0
- package/dist/contracts/prompt.contract.js.map +1 -0
- package/dist/contracts/prompt.d.ts +1 -0
- package/dist/contracts/prompt.js +12 -0
- package/dist/contracts/prompt.js.map +1 -0
- package/dist/contracts/sdk-tools.contract.d.ts +2 -0
- package/dist/contracts/sdk-tools.contract.js +4134 -0
- package/dist/contracts/sdk-tools.contract.js.map +1 -0
- package/dist/contracts/sdkTools.d.ts +2 -0
- package/dist/contracts/sdkTools.js +4134 -0
- package/dist/contracts/sdkTools.js.map +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +163 -0
- package/dist/contracts/workflow-runtime.contract.js +245 -0
- package/dist/contracts/workflow-runtime.contract.js.map +1 -0
- package/dist/contracts/workflowRuntime.d.ts +1 -0
- package/dist/contracts/workflowRuntime.js +245 -0
- package/dist/contracts/workflowRuntime.js.map +1 -0
- package/dist/controlObjectOwnership.d.ts +310 -0
- package/{src/controlObjectOwnership.ts → dist/controlObjectOwnership.js} +53 -124
- package/dist/controlObjectOwnership.js.map +1 -0
- package/dist/coreClient.d.ts +144 -0
- package/dist/coreClient.js +339 -0
- package/dist/coreClient.js.map +1 -0
- package/dist/customTools.d.ts +88 -0
- package/dist/customTools.js +248 -0
- package/dist/customTools.js.map +1 -0
- package/dist/decisionsClient.d.ts +111 -0
- package/dist/decisionsClient.js +522 -0
- package/dist/decisionsClient.js.map +1 -0
- package/dist/domainContext.d.ts +1 -0
- package/dist/domainContext.js +3 -0
- package/dist/domainContext.js.map +1 -0
- package/dist/events.d.ts +178 -0
- package/dist/events.js +249 -0
- package/dist/events.js.map +1 -0
- package/dist/eventsCore.d.ts +49 -0
- package/dist/eventsCore.js +429 -0
- package/dist/eventsCore.js.map +1 -0
- package/dist/facade/context.d.ts +18 -0
- package/dist/facade/context.js +73 -0
- package/dist/facade/context.js.map +1 -0
- package/dist/gatewayFacades.d.ts +591 -0
- package/dist/gatewayFacades.js +1953 -0
- package/dist/gatewayFacades.js.map +1 -0
- package/dist/graphClient.d.ts +271 -0
- package/dist/graphClient.js +698 -0
- package/dist/graphClient.js.map +1 -0
- package/dist/harnessClient.d.ts +314 -0
- package/dist/harnessClient.js +607 -0
- package/dist/harnessClient.js.map +1 -0
- package/dist/identityClient.d.ts +140 -0
- package/dist/identityClient.js +497 -0
- package/dist/identityClient.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +11381 -0
- package/dist/index.js.map +1 -0
- package/dist/learningClient.d.ts +46 -0
- package/dist/learningClient.js +409 -0
- package/dist/learningClient.js.map +1 -0
- package/dist/mcpParityClient.d.ts +74 -0
- package/dist/mcpParityClient.js +516 -0
- package/dist/mcpParityClient.js.map +1 -0
- package/dist/mcpParitySurface.d.ts +12 -0
- package/{src/mcpParitySurface.ts → dist/mcpParitySurface.js} +9 -14
- package/dist/mcpParitySurface.js.map +1 -0
- package/dist/mcpTools-DPZxowDX.d.ts +254 -0
- package/dist/ontologyClient.d.ts +137 -0
- package/dist/ontologyClient.js +513 -0
- package/dist/ontologyClient.js.map +1 -0
- package/dist/packRuntime.d.ts +2 -0
- package/dist/packRuntime.js +3 -0
- package/dist/packRuntime.js.map +1 -0
- package/dist/packsClient.d.ts +131 -0
- package/dist/packsClient.js +525 -0
- package/dist/packsClient.js.map +1 -0
- package/dist/policyClient.d.ts +299 -0
- package/dist/policyClient.js +625 -0
- package/dist/policyClient.js.map +1 -0
- package/dist/realtime/index.d.ts +29 -0
- package/dist/realtime/index.js +23 -0
- package/dist/realtime/index.js.map +1 -0
- package/{src/realtime/refs.ts → dist/realtime/refs.d.ts} +5 -5
- package/dist/realtime/refs.js +9 -0
- package/dist/realtime/refs.js.map +1 -0
- package/dist/reportsClient.d.ts +41 -0
- package/dist/reportsClient.js +418 -0
- package/dist/reportsClient.js.map +1 -0
- package/dist/schemaClient.d.ts +64 -0
- package/dist/schemaClient.js +434 -0
- package/dist/schemaClient.js.map +1 -0
- package/dist/sdkSurface.d.ts +61 -0
- package/dist/sdkSurface.js +112 -0
- package/dist/sdkSurface.js.map +1 -0
- package/dist/sdkTools-CwXJDACb.d.ts +150 -0
- package/dist/topicsClient.d.ts +84 -0
- package/dist/topicsClient.js +492 -0
- package/dist/topicsClient.js.map +1 -0
- package/dist/types.d.ts +696 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/dist/workflowClient.d.ts +316 -0
- package/dist/workflowClient.js +830 -0
- package/dist/workflowClient.js.map +1 -0
- package/package.json +31 -7
- package/.turbo/turbo-build.log +0 -7
- package/.turbo/turbo-typecheck.log +0 -4
- package/examples/README.md +0 -69
- package/examples/contradiction.ts +0 -94
- package/examples/investigation-context.ts +0 -118
- package/examples/questions-and-tasks.ts +0 -55
- package/examples/quickstart.ts +0 -97
- package/examples/shared.ts +0 -318
- package/examples/strict-public-types.ts +0 -143
- package/examples/worktree-lifecycle.ts +0 -79
- package/src/README.md +0 -6
- package/src/adminClient.ts +0 -789
- package/src/answersClient.ts +0 -29
- package/src/audiencesClient.ts +0 -209
- package/src/auditClient.ts +0 -50
- package/src/beliefsClient.ts +0 -319
- package/src/client.ts +0 -2647
- package/src/contextClient.ts +0 -130
- package/src/contextFacade.ts +0 -15
- package/src/contextPackCompiler.ts +0 -828
- package/src/contextTypes.ts +0 -153
- package/src/contracts/api-enums.contract.ts +0 -202
- package/src/contracts/auth-session.contract.ts +0 -109
- package/src/contracts/context-pack.contract.ts +0 -700
- package/src/contracts/contextPack.ts +0 -1
- package/src/contracts/index.ts +0 -10
- package/src/contracts/lens-filter.contract.ts +0 -183
- package/src/contracts/lens-workflow.contract.ts +0 -162
- package/src/contracts/lensFilter.ts +0 -1
- package/src/contracts/lensWorkflow.ts +0 -1
- package/src/contracts/mcp-tools.contract.ts +0 -3636
- package/src/contracts/mcpTools.ts +0 -1
- package/src/contracts/prompt.contract.ts +0 -50
- package/src/contracts/prompt.ts +0 -1
- package/src/contracts/sdk-tools.contract.ts +0 -1457
- package/src/contracts/sdkTools.ts +0 -1
- package/src/contracts/workflow-runtime.contract.ts +0 -440
- package/src/contracts/workflowRuntime.ts +0 -1
- package/src/coreClient.ts +0 -570
- package/src/customTools.ts +0 -398
- package/src/decisionsClient.ts +0 -286
- package/src/domainContext.ts +0 -15
- package/src/events.ts +0 -531
- package/src/eventsCore.ts +0 -168
- package/src/facade/beliefs.ts +0 -83
- package/src/facade/context.ts +0 -110
- package/src/facade/contradictions.ts +0 -29
- package/src/facade/edges.ts +0 -30
- package/src/facade/events.ts +0 -23
- package/src/facade/evidence.ts +0 -41
- package/src/facade/graph.ts +0 -38
- package/src/facade/identity.ts +0 -16
- package/src/facade/ontologies.ts +0 -34
- package/src/facade/questions.ts +0 -59
- package/src/facade/search.ts +0 -16
- package/src/facade/tasks.ts +0 -37
- package/src/facade/topics.ts +0 -42
- package/src/facade/webhooks.ts +0 -58
- package/src/facade/worktrees.ts +0 -51
- package/src/gatewayFacades.ts +0 -1666
- package/src/graphClient.ts +0 -529
- package/src/harnessClient.ts +0 -585
- package/src/identityClient.ts +0 -278
- package/src/index.ts +0 -49
- package/src/learningClient.ts +0 -95
- package/src/mcpParityClient.ts +0 -240
- package/src/ontologyClient.ts +0 -275
- package/src/packRuntime.ts +0 -3
- package/src/packsClient.ts +0 -260
- package/src/policyClient.ts +0 -572
- package/src/promptCatalog.ts +0 -1
- package/src/realtime/index.ts +0 -51
- package/src/reportsClient.ts +0 -99
- package/src/schemaClient.ts +0 -129
- package/src/sdkSurface.ts +0 -190
- package/src/topicsClient.ts +0 -243
- package/src/types.ts +0 -807
- package/src/version.ts +0 -2
- package/src/workflowClient.ts +0 -826
- package/tsconfig.json +0 -9
package/src/ontologyClient.ts
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createGatewayRequestClient,
|
|
3
|
-
type GatewayClientConfig,
|
|
4
|
-
type GatewayScope,
|
|
5
|
-
randomIdempotencyKey,
|
|
6
|
-
toQueryString,
|
|
7
|
-
} from "./coreClient";
|
|
8
|
-
import { createListResult, mapGatewayData } from "./sdkSurface";
|
|
9
|
-
import type { JsonObject } from "./types";
|
|
10
|
-
|
|
11
|
-
/** Configuration for the ontology client. */
|
|
12
|
-
export type OntologyClientConfig = GatewayClientConfig;
|
|
13
|
-
|
|
14
|
-
/** Input for binding an ontology to a topic. */
|
|
15
|
-
export type OntologyBindingInput = GatewayScope & {
|
|
16
|
-
ontologyId: string;
|
|
17
|
-
topicId: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/** Input for creating an ontology definition. */
|
|
21
|
-
export type OntologyDefinitionInput = GatewayScope & {
|
|
22
|
-
ontologyKey: string;
|
|
23
|
-
name: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
tenantId?: string;
|
|
26
|
-
tier?: "platform" | "pack" | "tenant";
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/** Input for updating mutable fields on an ontology definition. */
|
|
30
|
-
export type OntologyDefinitionUpdateInput = GatewayScope & {
|
|
31
|
-
name?: string;
|
|
32
|
-
description?: string;
|
|
33
|
-
status?: "draft" | "active" | "deprecated";
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/** Input for creating a versioned snapshot of entity and edge type definitions. */
|
|
37
|
-
export type OntologyVersionInput = GatewayScope & {
|
|
38
|
-
version: string;
|
|
39
|
-
entityTypes: Array<{
|
|
40
|
-
value: string;
|
|
41
|
-
label: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
schema?: JsonObject;
|
|
44
|
-
subtypes?: Array<{ value: string; label: string; description?: string }>;
|
|
45
|
-
}>;
|
|
46
|
-
edgeTypes: Array<{
|
|
47
|
-
value: string;
|
|
48
|
-
label: string;
|
|
49
|
-
description?: string;
|
|
50
|
-
sourceTypes?: string[];
|
|
51
|
-
targetTypes?: string[];
|
|
52
|
-
constraintSeverity?: "warn" | "info";
|
|
53
|
-
}>;
|
|
54
|
-
releaseNotes?: string;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Create the ontology client for ontology definitions and versions.
|
|
59
|
-
* @param config - Gateway transport configuration.
|
|
60
|
-
* @returns An object with methods to manage ontology definitions, versions, and bindings.
|
|
61
|
-
*/
|
|
62
|
-
export function createOntologyClient(config: OntologyClientConfig = {}) {
|
|
63
|
-
const gateway = createGatewayRequestClient(config);
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
/**
|
|
67
|
-
* List ontology definitions matching optional filters.
|
|
68
|
-
*/
|
|
69
|
-
async list(
|
|
70
|
-
filters: GatewayScope & {
|
|
71
|
-
tenantId?: string;
|
|
72
|
-
tier?: string;
|
|
73
|
-
status?: string;
|
|
74
|
-
} = {}
|
|
75
|
-
) {
|
|
76
|
-
return gateway
|
|
77
|
-
.request<unknown>({
|
|
78
|
-
path: `/api/platform/v1/ontologies${toQueryString(filters)}`,
|
|
79
|
-
})
|
|
80
|
-
.then((response) =>
|
|
81
|
-
mapGatewayData(response, (data) => {
|
|
82
|
-
const record =
|
|
83
|
-
data && typeof data === "object" && !Array.isArray(data)
|
|
84
|
-
? (data as Record<string, unknown>)
|
|
85
|
-
: {};
|
|
86
|
-
const ontologies = Array.isArray(record.ontologies)
|
|
87
|
-
? record.ontologies
|
|
88
|
-
: Array.isArray(record.definitions)
|
|
89
|
-
? record.definitions
|
|
90
|
-
: Array.isArray(data)
|
|
91
|
-
? data
|
|
92
|
-
: [];
|
|
93
|
-
const total =
|
|
94
|
-
typeof record.total === "number" && Number.isFinite(record.total)
|
|
95
|
-
? record.total
|
|
96
|
-
: ontologies.length;
|
|
97
|
-
return {
|
|
98
|
-
...record,
|
|
99
|
-
...createListResult(ontologies, "definitions"),
|
|
100
|
-
ontologies,
|
|
101
|
-
total,
|
|
102
|
-
};
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Get an ontology definition by identifier.
|
|
109
|
-
*/
|
|
110
|
-
async get(id: string) {
|
|
111
|
-
return gateway.request<unknown>({
|
|
112
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
|
|
113
|
-
});
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Bind an ontology definition to a topic.
|
|
118
|
-
*/
|
|
119
|
-
async bind(input: OntologyBindingInput, idempotencyKey?: string) {
|
|
120
|
-
return gateway.request<unknown>({
|
|
121
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(input.ontologyId)}/bind`,
|
|
122
|
-
method: "POST",
|
|
123
|
-
body: {
|
|
124
|
-
topicId: input.topicId,
|
|
125
|
-
},
|
|
126
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* List ontology definitions.
|
|
132
|
-
*/
|
|
133
|
-
async listDefinitions(
|
|
134
|
-
filters: GatewayScope & {
|
|
135
|
-
tenantId?: string;
|
|
136
|
-
tier?: string;
|
|
137
|
-
status?: string;
|
|
138
|
-
} = {}
|
|
139
|
-
) {
|
|
140
|
-
return this.list(filters);
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Get an ontology definition.
|
|
145
|
-
*/
|
|
146
|
-
async getDefinition(id: string) {
|
|
147
|
-
return this.get(id);
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Create an ontology definition.
|
|
152
|
-
*/
|
|
153
|
-
async createDefinition(
|
|
154
|
-
input: OntologyDefinitionInput,
|
|
155
|
-
idempotencyKey?: string
|
|
156
|
-
) {
|
|
157
|
-
return gateway.request<unknown>({
|
|
158
|
-
path: "/api/platform/v1/ontologies",
|
|
159
|
-
method: "POST",
|
|
160
|
-
body: input,
|
|
161
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Update an ontology definition.
|
|
167
|
-
*/
|
|
168
|
-
async updateDefinition(
|
|
169
|
-
id: string,
|
|
170
|
-
input: OntologyDefinitionUpdateInput,
|
|
171
|
-
idempotencyKey?: string
|
|
172
|
-
) {
|
|
173
|
-
return gateway.request<unknown>({
|
|
174
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
|
|
175
|
-
method: "PATCH",
|
|
176
|
-
body: input,
|
|
177
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Archive an ontology definition.
|
|
183
|
-
*/
|
|
184
|
-
async archiveDefinition(id: string, idempotencyKey?: string) {
|
|
185
|
-
return gateway.request<unknown>({
|
|
186
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
|
|
187
|
-
method: "DELETE",
|
|
188
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
189
|
-
});
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* List versions for an ontology definition.
|
|
194
|
-
*/
|
|
195
|
-
async listVersions(
|
|
196
|
-
ontologyId: string,
|
|
197
|
-
filters: GatewayScope & { status?: string } = {}
|
|
198
|
-
) {
|
|
199
|
-
return gateway.request<unknown>({
|
|
200
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions${toQueryString(filters)}`,
|
|
201
|
-
}).then((response) =>
|
|
202
|
-
mapGatewayData(response, (data) =>
|
|
203
|
-
createListResult(Array.isArray(data) ? data : [], "versions")
|
|
204
|
-
)
|
|
205
|
-
);
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Create an ontology version.
|
|
210
|
-
*/
|
|
211
|
-
async createVersion(
|
|
212
|
-
ontologyId: string,
|
|
213
|
-
input: OntologyVersionInput,
|
|
214
|
-
idempotencyKey?: string
|
|
215
|
-
) {
|
|
216
|
-
return gateway.request<unknown>({
|
|
217
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions`,
|
|
218
|
-
method: "POST",
|
|
219
|
-
body: input,
|
|
220
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Publish an ontology version.
|
|
226
|
-
*/
|
|
227
|
-
async publishVersion(
|
|
228
|
-
ontologyId: string,
|
|
229
|
-
versionId: string,
|
|
230
|
-
idempotencyKey?: string
|
|
231
|
-
) {
|
|
232
|
-
return gateway.request<unknown>({
|
|
233
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions/${encodeURIComponent(versionId)}/publish`,
|
|
234
|
-
method: "POST",
|
|
235
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
236
|
-
});
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Deprecate an ontology version.
|
|
241
|
-
*/
|
|
242
|
-
async deprecateVersion(
|
|
243
|
-
ontologyId: string,
|
|
244
|
-
versionId: string,
|
|
245
|
-
idempotencyKey?: string
|
|
246
|
-
) {
|
|
247
|
-
return gateway.request<unknown>({
|
|
248
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions/${encodeURIComponent(versionId)}/deprecate`,
|
|
249
|
-
method: "POST",
|
|
250
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
251
|
-
});
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* List topics directly bound to a specific ontology definition.
|
|
256
|
-
* Uses the topics gateway with ontologyId filter.
|
|
257
|
-
*/
|
|
258
|
-
async listTopics(ontologyId: string) {
|
|
259
|
-
return gateway.request<unknown>({
|
|
260
|
-
path: `/api/platform/v1/topics?ontologyId=${encodeURIComponent(ontologyId)}`,
|
|
261
|
-
}).then((response) =>
|
|
262
|
-
mapGatewayData(response, (data) =>
|
|
263
|
-
createListResult(Array.isArray(data) ? data : [], "topics")
|
|
264
|
-
)
|
|
265
|
-
);
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @deprecated Use listTopics.
|
|
270
|
-
*/
|
|
271
|
-
async listTopicsByOntology(ontologyId: string) {
|
|
272
|
-
return this.listTopics(ontologyId);
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
}
|
package/src/packRuntime.ts
DELETED
package/src/packsClient.ts
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createGatewayRequestClient,
|
|
3
|
-
type GatewayClientConfig,
|
|
4
|
-
type GatewayScope,
|
|
5
|
-
LucernApiError,
|
|
6
|
-
randomIdempotencyKey,
|
|
7
|
-
toQueryString,
|
|
8
|
-
} from "./coreClient";
|
|
9
|
-
import { createListResult, mapGatewayData } from "./sdkSurface";
|
|
10
|
-
import type { JsonObject } from "./types";
|
|
11
|
-
|
|
12
|
-
export { LucernApiError };
|
|
13
|
-
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
14
|
-
|
|
15
|
-
/** Configuration for the packs client. */
|
|
16
|
-
export type PacksClientConfig = GatewayClientConfig;
|
|
17
|
-
|
|
18
|
-
/** Input for installing a pack into a tenant or workspace scope. */
|
|
19
|
-
export type PackInstallInput = GatewayScope & {
|
|
20
|
-
packKey: string;
|
|
21
|
-
version?: string;
|
|
22
|
-
autoEnable?: boolean;
|
|
23
|
-
metadata?: JsonObject;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/** Input for enabling a previously installed pack. */
|
|
27
|
-
export type PackEnableInput = GatewayScope & {
|
|
28
|
-
packKey: string;
|
|
29
|
-
metadata?: JsonObject;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/** Input for disabling an active pack. */
|
|
33
|
-
export type PackDisableInput = GatewayScope & {
|
|
34
|
-
packKey: string;
|
|
35
|
-
force?: boolean;
|
|
36
|
-
metadata?: JsonObject;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/** Input for uninstalling a pack from a tenant or workspace scope. */
|
|
40
|
-
export type PackUninstallInput = GatewayScope & {
|
|
41
|
-
packKey: string;
|
|
42
|
-
metadata?: JsonObject;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/** Input for upgrading a pack through the prepare/canary/commit/rollback lifecycle. */
|
|
46
|
-
export type PackUpgradeInput = GatewayScope & {
|
|
47
|
-
packKey: string;
|
|
48
|
-
mode: "prepare" | "canary" | "commit" | "rollback";
|
|
49
|
-
targetVersion?: string;
|
|
50
|
-
metadata?: JsonObject;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/** Input for creating or updating a pack entitlement record. */
|
|
54
|
-
export type PackEntitlementInput = GatewayScope & {
|
|
55
|
-
packKey: string;
|
|
56
|
-
status: "active" | "disabled" | "revoked";
|
|
57
|
-
allowedLifecycles?: Array<"active" | "beta" | "experimental">;
|
|
58
|
-
minVersion?: string;
|
|
59
|
-
maxVersion?: string;
|
|
60
|
-
metadata?: JsonObject;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Create the packs client for pack catalog, state, and entitlement operations.
|
|
65
|
-
* @param config - Gateway transport configuration.
|
|
66
|
-
* @returns An object with methods to manage pack lifecycle, telemetry, and entitlements.
|
|
67
|
-
*/
|
|
68
|
-
export function createPacksClient(config: PacksClientConfig = {}) {
|
|
69
|
-
const gateway = createGatewayRequestClient(config);
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
/**
|
|
73
|
-
* List catalog entries for available packs.
|
|
74
|
-
*/
|
|
75
|
-
async listCatalog() {
|
|
76
|
-
return gateway.request<unknown>({
|
|
77
|
-
path: "/api/platform/v1/packs/catalog",
|
|
78
|
-
}).then((response) =>
|
|
79
|
-
mapGatewayData(response, (data) =>
|
|
80
|
-
createListResult(Array.isArray(data) ? data : [], "catalog")
|
|
81
|
-
)
|
|
82
|
-
);
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated Use listCatalog.
|
|
87
|
-
*/
|
|
88
|
-
async getCatalog() {
|
|
89
|
-
return this.listCatalog();
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Get the discovery catalog for packs.
|
|
94
|
-
*/
|
|
95
|
-
async getDiscoveryCatalog() {
|
|
96
|
-
return gateway.request<unknown>({
|
|
97
|
-
path: "/api/platform/v1/packs/discovery",
|
|
98
|
-
});
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Get discovery details for a specific pack.
|
|
103
|
-
*/
|
|
104
|
-
async getDiscoveryDetail(packKey: string) {
|
|
105
|
-
return gateway.request<unknown>({
|
|
106
|
-
path: `/api/platform/v1/packs/discovery/${encodeURIComponent(packKey)}`,
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* List pack states for the current scope.
|
|
112
|
-
*/
|
|
113
|
-
async listStates(query: GatewayScope = {}) {
|
|
114
|
-
return gateway.request<unknown>({
|
|
115
|
-
path: `/api/platform/v1/packs/states${toQueryString(query)}`,
|
|
116
|
-
}).then((response) =>
|
|
117
|
-
mapGatewayData(response, (data) =>
|
|
118
|
-
createListResult(Array.isArray(data) ? data : [], "states")
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @deprecated Use listStates.
|
|
125
|
-
*/
|
|
126
|
-
async getStates(query: GatewayScope = {}) {
|
|
127
|
-
return this.listStates(query);
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Get health details for a pack.
|
|
132
|
-
*/
|
|
133
|
-
async getHealth(packKey: string, query: GatewayScope = {}) {
|
|
134
|
-
return gateway.request<unknown>({
|
|
135
|
-
path: `/api/platform/v1/packs/${encodeURIComponent(packKey)}/health${toQueryString(
|
|
136
|
-
query
|
|
137
|
-
)}`,
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* List pack telemetry entries.
|
|
143
|
-
*/
|
|
144
|
-
async listTelemetry(
|
|
145
|
-
query: GatewayScope & { lookbackHours?: number; limit?: number } = {}
|
|
146
|
-
) {
|
|
147
|
-
return gateway.request<unknown>({
|
|
148
|
-
path: `/api/platform/v1/packs/telemetry${toQueryString(query)}`,
|
|
149
|
-
}).then((response) =>
|
|
150
|
-
mapGatewayData(response, (data) =>
|
|
151
|
-
createListResult(Array.isArray(data) ? data : [], "telemetry")
|
|
152
|
-
)
|
|
153
|
-
);
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @deprecated Use listTelemetry.
|
|
158
|
-
*/
|
|
159
|
-
async getTelemetry(
|
|
160
|
-
query: GatewayScope & { lookbackHours?: number; limit?: number } = {}
|
|
161
|
-
) {
|
|
162
|
-
return this.listTelemetry(query);
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Create a pack entitlement.
|
|
167
|
-
*/
|
|
168
|
-
async createEntitlement(
|
|
169
|
-
input: PackEntitlementInput,
|
|
170
|
-
idempotencyKey?: string
|
|
171
|
-
) {
|
|
172
|
-
return gateway.request<unknown>({
|
|
173
|
-
path: "/api/platform/v1/packs/entitlements",
|
|
174
|
-
method: "POST",
|
|
175
|
-
body: input,
|
|
176
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
177
|
-
});
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Update a pack entitlement.
|
|
182
|
-
*/
|
|
183
|
-
async updateEntitlement(
|
|
184
|
-
input: PackEntitlementInput,
|
|
185
|
-
idempotencyKey?: string
|
|
186
|
-
) {
|
|
187
|
-
return this.createEntitlement(input, idempotencyKey);
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @deprecated Use createEntitlement or updateEntitlement.
|
|
192
|
-
*/
|
|
193
|
-
async upsertEntitlement(
|
|
194
|
-
input: PackEntitlementInput,
|
|
195
|
-
idempotencyKey?: string
|
|
196
|
-
) {
|
|
197
|
-
return this.createEntitlement(input, idempotencyKey);
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Install a pack.
|
|
202
|
-
*/
|
|
203
|
-
async install(input: PackInstallInput, idempotencyKey?: string) {
|
|
204
|
-
return gateway.request<unknown>({
|
|
205
|
-
path: "/api/platform/v1/packs/install",
|
|
206
|
-
method: "POST",
|
|
207
|
-
body: input,
|
|
208
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
209
|
-
});
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Enable a pack.
|
|
214
|
-
*/
|
|
215
|
-
async enable(input: PackEnableInput, idempotencyKey?: string) {
|
|
216
|
-
return gateway.request<unknown>({
|
|
217
|
-
path: "/api/platform/v1/packs/enable",
|
|
218
|
-
method: "POST",
|
|
219
|
-
body: input,
|
|
220
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Disable a pack.
|
|
226
|
-
*/
|
|
227
|
-
async disable(input: PackDisableInput, idempotencyKey?: string) {
|
|
228
|
-
return gateway.request<unknown>({
|
|
229
|
-
path: "/api/platform/v1/packs/disable",
|
|
230
|
-
method: "POST",
|
|
231
|
-
body: input,
|
|
232
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
233
|
-
});
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Uninstall a pack.
|
|
238
|
-
*/
|
|
239
|
-
async uninstall(input: PackUninstallInput, idempotencyKey?: string) {
|
|
240
|
-
return gateway.request<unknown>({
|
|
241
|
-
path: "/api/platform/v1/packs/uninstall",
|
|
242
|
-
method: "POST",
|
|
243
|
-
body: input,
|
|
244
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
245
|
-
});
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Upgrade a pack.
|
|
250
|
-
*/
|
|
251
|
-
async upgrade(input: PackUpgradeInput, idempotencyKey?: string) {
|
|
252
|
-
return gateway.request<unknown>({
|
|
253
|
-
path: "/api/platform/v1/packs/upgrade",
|
|
254
|
-
method: "POST",
|
|
255
|
-
body: input,
|
|
256
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
257
|
-
});
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
}
|