@lucern/sdk 1.0.28 → 1.0.30
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 +15 -0
- package/dist/accessControl.d.ts +31 -31
- package/dist/accessControl.js +1 -0
- package/dist/adminClient.d.ts +74 -74
- package/dist/adminClient.js +38 -30
- package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
- package/dist/{answersClient.js → answers-client.js} +2 -2
- package/dist/audience/index.d.ts +12 -12
- package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
- package/dist/audiences-client.js +107 -0
- package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
- package/dist/{auditClient.js → audit-client.js} +8 -7
- package/dist/authContext.d.ts +26 -26
- package/dist/authDeviceClient.d.ts +11 -11
- package/dist/authDeviceClient.js +4 -6
- package/dist/beliefs/index.d.ts +56 -28
- package/dist/beliefs/index.js +2 -1
- package/dist/beliefsClient.d.ts +71 -63
- package/dist/beliefsClient.js +90 -67
- package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
- package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
- package/dist/client-assembly-types.d.ts +219 -0
- package/dist/client-assembly-types.js +2 -0
- package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
- package/dist/client-config.js +2 -0
- package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
- package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
- package/dist/client.d.ts +1906 -352
- package/dist/client.js +34 -30
- package/dist/clientGraphNamespaces.d.ts +35 -25
- package/dist/clientGraphNamespaces.js +11 -5
- package/dist/clientHelpers.js +8 -5
- package/dist/clientKnowledgeNamespaces.d.ts +124 -84
- package/dist/clientKnowledgeNamespaces.js +35 -34
- package/dist/clientLocalHelpers.d.ts +81 -52
- package/dist/clientLocalHelpers.js +193 -43
- package/dist/clientPlatformNamespaces.d.ts +1541 -150
- package/dist/clientPlatformNamespaces.js +10 -5
- package/dist/clientRuntime.d.ts +1 -1
- package/dist/clientRuntime.js +1 -1
- package/dist/clientWorkflowNamespaces.d.ts +211 -97
- package/dist/clientWorkflowNamespaces.js +22 -19
- package/dist/contextClient.d.ts +2 -2
- package/dist/contextClient.js +79 -50
- package/dist/contextFacade.d.ts +1 -1
- package/dist/contextFacade.js +2 -0
- package/dist/contextPackCompiler.d.ts +52 -52
- package/dist/contextPackCompiler.js +192 -122
- package/dist/contextPackPolicy.d.ts +22 -22
- package/dist/contextPackPolicy.js +21 -9
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +1 -0
- package/dist/contextTypes.d.ts +155 -155
- package/dist/contracts/api-enums.contract.js +2 -11
- package/dist/contracts/auth-session.contract.d.ts +16 -16
- package/dist/contracts/auth-session.contract.js +3 -2
- package/dist/contracts/context-pack.contract.d.ts +216 -216
- package/dist/contracts/contextPack.js +2 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +2 -1
- package/dist/contracts/lens-filter.contract.d.ts +8 -8
- package/dist/contracts/lens-filter.contract.js +10 -10
- package/dist/contracts/lens-workflow.contract.d.ts +32 -32
- package/dist/contracts/lens-workflow.contract.js +2 -1
- package/dist/contracts/lensFilter.js +2 -0
- package/dist/contracts/lensWorkflow.js +2 -0
- package/dist/contracts/mcpTools.d.ts +19 -19
- package/dist/contracts/mcpTools.js +3 -1
- package/dist/contracts/prompt.contract.d.ts +12 -12
- package/dist/contracts/prompt.js +1 -0
- package/dist/contracts/sdk-tools.contract.js +1 -0
- package/dist/contracts/sdkTools.js +2 -0
- package/dist/contracts/tool-contracts.js +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
- package/dist/contracts/workflow-runtime.contract.js +1 -5
- package/dist/contracts/workflowRuntime.js +2 -0
- package/dist/contradictions/index.d.ts +8 -8
- package/dist/contradictions/index.js +1 -0
- package/dist/control-plane.d.ts +10 -10
- package/dist/control-plane.js +2 -2
- package/dist/controlObjectOwnership.d.ts +11 -11
- package/dist/controlObjectOwnership.js +1 -0
- package/dist/coreClient.d.ts +51 -51
- package/dist/coreClient.js +269 -101
- package/dist/customTools.d.ts +19 -19
- package/dist/customTools.js +4 -2
- package/dist/decisions/index.d.ts +18 -18
- package/dist/decisions/index.js +1 -0
- package/dist/decisionsClient.d.ts +4 -4
- package/dist/decisionsClient.js +36 -27
- package/dist/edges/index.d.ts +20 -18
- package/dist/edges/index.js +1 -0
- package/dist/embeddingsClient.d.ts +29 -29
- package/dist/embeddingsClient.js +15 -8
- package/dist/eventingClient.d.ts +27 -27
- package/dist/eventingClient.js +10 -5
- package/dist/events.d.ts +83 -83
- package/dist/events.js +19 -15
- package/dist/eventsCore.d.ts +7 -7
- package/dist/eventsCore.js +11 -10
- package/dist/evidence/index.d.ts +23 -21
- package/dist/evidence/index.js +1 -0
- package/dist/evidenceClient.d.ts +23 -23
- package/dist/evidenceClient.js +10 -6
- package/dist/facade/context.d.ts +9 -9
- package/dist/facade/context.js +67 -41
- package/dist/functionSurface.js +2 -0
- package/dist/functionSurfaceClient.js +2 -0
- package/dist/gatewayFacades.d.ts +215 -215
- package/dist/gatewayFacades.factories.d.ts +23 -44
- package/dist/gatewayFacades.factories.js +63 -62
- package/dist/gatewayFacades.js +31 -32
- package/dist/graphAnalysisClient.d.ts +60 -60
- package/dist/graphAnalysisClient.js +19 -18
- package/dist/graphClient.d.ts +34 -34
- package/dist/graphClient.js +56 -35
- package/dist/graphIntel.js +2 -0
- package/dist/graphIntelligence.d.ts +2 -2
- package/dist/graphIntelligence.js +1 -1
- package/dist/graphRecommendationsClient.d.ts +24 -24
- package/dist/graphRecommendationsClient.js +12 -7
- package/dist/graphStateClassifierClient.d.ts +13 -13
- package/dist/graphStateClassifierClient.js +10 -5
- package/dist/harnessClient.d.ts +61 -61
- package/dist/harnessClient.js +44 -31
- package/dist/identityClient.d.ts +33 -59
- package/dist/identityClient.js +126 -98
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -19
- package/dist/infisicalRuntime.d.ts +11 -11
- package/dist/infisicalRuntime.js +20 -14
- package/dist/jobsClient.d.ts +28 -28
- package/dist/jobsClient.js +6 -3
- package/dist/learningClient.js +13 -8
- package/dist/lenses/index.d.ts +124 -28
- package/dist/lenses/index.js +1 -0
- package/dist/mcpClient.d.ts +1 -1
- package/dist/mcpClient.js +3 -3
- package/dist/modelRuntimeClient.d.ts +27 -27
- package/dist/modelRuntimeClient.js +10 -5
- package/dist/nodes/index.d.ts +9 -9
- package/dist/nodes/index.js +1 -0
- package/dist/ontologies/index.d.ts +68 -22
- package/dist/ontologies/index.js +1 -0
- package/dist/ontologyClient.js +24 -17
- package/dist/ontologyLinksClient.d.ts +35 -35
- package/dist/ontologyLinksClient.js +9 -6
- package/dist/opinion.d.ts +3 -3
- package/dist/opinion.js +12 -5
- package/dist/orgGraphSearchClient.d.ts +39 -39
- package/dist/orgGraphSearchClient.js +22 -13
- package/dist/packsClient.d.ts +1 -1
- package/dist/packsClient.js +28 -19
- package/dist/policyClient.d.ts +79 -68
- package/dist/policyClient.js +18 -12
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +38 -27
- package/dist/questions/index.js +1 -0
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -0
- package/dist/realtime/refs.d.ts +2 -2
- package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
- package/dist/{reportsClient.js → reports-client.js} +19 -13
- package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
- package/dist/{schemaClient.js → schema-client.js} +14 -11
- package/dist/sdkSurface.d.ts +12 -12
- package/dist/sdkSurface.js +14 -10
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.js +2 -1
- package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
- package/dist/{sourcesClient.js → sources-client.js} +4 -5
- package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
- package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
- package/dist/toolRegistryClient.d.ts +46 -46
- package/dist/toolRegistryClient.js +22 -11
- package/dist/topics/index.d.ts +23 -23
- package/dist/topics/index.js +2 -1
- package/dist/topicsClient.d.ts +6 -6
- package/dist/topicsClient.js +29 -18
- package/dist/types.d.ts +356 -355
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflowClient.d.ts +36 -35
- package/dist/workflowClient.js +88 -60
- package/dist/worktrees/index.d.ts +118 -32
- package/dist/worktrees/index.js +2 -1
- package/package.json +45 -5
- package/dist/audiencesClient.js +0 -115
- package/dist/clientAssemblyTypes.d.ts +0 -33
- package/dist/clientAssemblyTypes.js +0 -2
- package/dist/clientConfig.js +0 -2
|
@@ -4,23 +4,16 @@ export type OrgGraphSearchClientConfig = GatewayClientConfig;
|
|
|
4
4
|
export declare const ORG_GRAPH_SEARCH_FIELDS: readonly ["tenantId", "workspaceId", "query", "nodeTypes", "minConfidence", "limit", "cursor", "provenanceScope"];
|
|
5
5
|
export type OrgGraphProvenanceScope = "canonical" | "published" | "own_workspace" | "cross_workspace";
|
|
6
6
|
export type OrgGraphVisibility = "private" | "workspace" | "tenant" | "public";
|
|
7
|
-
export
|
|
7
|
+
export interface OrgGraphSearchProvenance {
|
|
8
|
+
metadata?: JsonObject | null;
|
|
9
|
+
publishedAt?: number;
|
|
10
|
+
publishedByPrincipalId?: string;
|
|
8
11
|
scope?: OrgGraphProvenanceScope | string;
|
|
9
12
|
source?: string;
|
|
10
13
|
sourceNodeId?: string;
|
|
11
14
|
sourceWorkspaceId?: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
metadata?: JsonObject | null;
|
|
15
|
-
};
|
|
16
|
-
export type OrgGraphSearchResult = {
|
|
17
|
-
nodeId: string;
|
|
18
|
-
globalId?: string;
|
|
19
|
-
topicId?: string;
|
|
20
|
-
sourceWorkspaceId?: string;
|
|
21
|
-
publishedAt?: number;
|
|
22
|
-
publishedByPrincipalId?: string;
|
|
23
|
-
visibility?: OrgGraphVisibility | string;
|
|
15
|
+
}
|
|
16
|
+
export interface OrgGraphSearchResult {
|
|
24
17
|
confidence?: number | null;
|
|
25
18
|
confidenceHistory?: Array<{
|
|
26
19
|
confidence?: number;
|
|
@@ -28,46 +21,53 @@ export type OrgGraphSearchResult = {
|
|
|
28
21
|
rationale?: string;
|
|
29
22
|
trigger?: string;
|
|
30
23
|
}>;
|
|
31
|
-
|
|
24
|
+
globalId?: string;
|
|
25
|
+
metadata?: JsonObject | null;
|
|
26
|
+
nodeId: string;
|
|
32
27
|
nodeType?: string;
|
|
28
|
+
provenance?: OrgGraphSearchProvenance;
|
|
29
|
+
publishedAt?: number;
|
|
30
|
+
publishedByPrincipalId?: string;
|
|
31
|
+
sourceWorkspaceId?: string;
|
|
33
32
|
text?: string;
|
|
34
33
|
title?: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
workspaceId: string;
|
|
40
|
-
query: string;
|
|
41
|
-
nodeTypes?: string[];
|
|
42
|
-
minConfidence?: number;
|
|
43
|
-
limit?: number;
|
|
34
|
+
topicId?: string;
|
|
35
|
+
visibility?: OrgGraphVisibility | string;
|
|
36
|
+
}
|
|
37
|
+
export interface OrgGraphSearchInput {
|
|
44
38
|
cursor?: string;
|
|
39
|
+
limit?: number;
|
|
40
|
+
minConfidence?: number;
|
|
41
|
+
nodeTypes?: string[];
|
|
45
42
|
provenanceScope?: OrgGraphProvenanceScope;
|
|
46
|
-
|
|
47
|
-
export type GetOrgGraphNodeInput = {
|
|
43
|
+
query: string;
|
|
48
44
|
tenantId: string;
|
|
49
45
|
workspaceId: string;
|
|
50
|
-
|
|
46
|
+
}
|
|
47
|
+
export interface GetOrgGraphNodeInput {
|
|
51
48
|
globalId?: string;
|
|
52
|
-
|
|
53
|
-
export type ListOrgGraphByProvenanceInput = {
|
|
49
|
+
nodeId?: string;
|
|
54
50
|
tenantId: string;
|
|
55
51
|
workspaceId: string;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
minConfidence?: number;
|
|
59
|
-
limit?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ListOrgGraphByProvenanceInput {
|
|
60
54
|
cursor?: string;
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
limit?: number;
|
|
56
|
+
minConfidence?: number;
|
|
57
|
+
nodeTypes?: string[];
|
|
58
|
+
provenanceScope: OrgGraphProvenanceScope;
|
|
63
59
|
tenantId: string;
|
|
64
60
|
workspaceId: string;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
minConfidence?: number;
|
|
68
|
-
limit?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ListPublishedFromWorkspaceInput {
|
|
69
63
|
cursor?: string;
|
|
70
|
-
|
|
64
|
+
limit?: number;
|
|
65
|
+
minConfidence?: number;
|
|
66
|
+
nodeTypes?: string[];
|
|
67
|
+
sourceWorkspaceId?: string;
|
|
68
|
+
tenantId: string;
|
|
69
|
+
workspaceId: string;
|
|
70
|
+
}
|
|
71
71
|
export type OrgGraphSearchResponse = ListResult<OrgGraphSearchResult, "results">;
|
|
72
72
|
export declare function createOrgGraphSearchClient(config?: OrgGraphSearchClientConfig): {
|
|
73
73
|
search(input: OrgGraphSearchInput): Promise<import("./coreClient").PlatformGatewaySuccess<OrgGraphSearchResponse>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
|
|
1
2
|
import { createGatewayRequestClient, toQueryString, } from "./coreClient.js";
|
|
2
3
|
import { createListResult, mapGatewayData } from "./sdkSurface.js";
|
|
3
4
|
export const ORG_GRAPH_SEARCH_FIELDS = [
|
|
@@ -47,28 +48,32 @@ function listQuery(input) {
|
|
|
47
48
|
cursor: input.cursor,
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function orgGraphSearchRows(data) {
|
|
51
52
|
const record = data && typeof data === "object" ? data : {};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (Array.isArray(record.results)) {
|
|
54
|
+
return record.results;
|
|
55
|
+
}
|
|
56
|
+
return Array.isArray(data) ? data : [];
|
|
57
|
+
}
|
|
58
|
+
function mapResults(data) {
|
|
59
|
+
return createListResult(orgGraphSearchRows(data), "results");
|
|
57
60
|
}
|
|
58
61
|
export function createOrgGraphSearchClient(config = {}) {
|
|
59
62
|
const gateway = createGatewayRequestClient(config);
|
|
60
63
|
return {
|
|
61
64
|
search(input) {
|
|
62
|
-
return gateway
|
|
65
|
+
return gateway
|
|
66
|
+
.request({
|
|
63
67
|
path: "/api/platform/v1/org-graph-search/search",
|
|
64
68
|
method: "POST",
|
|
65
69
|
body: searchBody(input),
|
|
66
|
-
})
|
|
70
|
+
})
|
|
71
|
+
.then((response) => mapGatewayData(response, mapResults));
|
|
67
72
|
},
|
|
68
73
|
getNode(input) {
|
|
69
74
|
const nodeId = input.nodeId?.trim();
|
|
70
75
|
const globalId = input.globalId?.trim();
|
|
71
|
-
if (!nodeId
|
|
76
|
+
if (!(nodeId || globalId)) {
|
|
72
77
|
throw new Error("nodeId or globalId is required");
|
|
73
78
|
}
|
|
74
79
|
const nodePath = encodeURIComponent(nodeId ?? globalId ?? "");
|
|
@@ -81,20 +86,24 @@ export function createOrgGraphSearchClient(config = {}) {
|
|
|
81
86
|
});
|
|
82
87
|
},
|
|
83
88
|
listByProvenance(input) {
|
|
84
|
-
return gateway
|
|
89
|
+
return gateway
|
|
90
|
+
.request({
|
|
85
91
|
path: `/api/platform/v1/org-graph-search/provenance${toQueryString({
|
|
86
92
|
...listQuery(input),
|
|
87
93
|
provenanceScope: input.provenanceScope,
|
|
88
94
|
})}`,
|
|
89
|
-
})
|
|
95
|
+
})
|
|
96
|
+
.then((response) => mapGatewayData(response, mapResults));
|
|
90
97
|
},
|
|
91
98
|
listPublishedFromWorkspace(input) {
|
|
92
|
-
return gateway
|
|
99
|
+
return gateway
|
|
100
|
+
.request({
|
|
93
101
|
path: `/api/platform/v1/org-graph-search/published${toQueryString({
|
|
94
102
|
...listQuery(input),
|
|
95
103
|
sourceWorkspaceId: input.sourceWorkspaceId,
|
|
96
104
|
})}`,
|
|
97
|
-
})
|
|
105
|
+
})
|
|
106
|
+
.then((response) => mapGatewayData(response, mapResults));
|
|
98
107
|
},
|
|
99
108
|
};
|
|
100
109
|
}
|
package/dist/packsClient.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GatewayClientConfig, type GatewayScope, LucernApiError } from "./coreClient";
|
|
2
2
|
import type { JsonObject } from "./types";
|
|
3
|
-
export { LucernApiError };
|
|
4
3
|
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
4
|
+
export { LucernApiError };
|
|
5
5
|
/** Configuration for the packs client. */
|
|
6
6
|
export type PacksClientConfig = GatewayClientConfig;
|
|
7
7
|
/** Input for installing a pack into a tenant or workspace scope. */
|
package/dist/packsClient.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
// biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
|
|
2
|
+
import { createGatewayRequestClient,
|
|
3
|
+
// biome-ignore lint/style/noExportedImports: packsClient preserves this legacy compatibility re-export while package root also exports coreClient.
|
|
4
|
+
LucernApiError, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
2
5
|
import { createListResult, mapGatewayData } from "./sdkSurface.js";
|
|
3
6
|
export { LucernApiError };
|
|
4
7
|
/**
|
|
@@ -12,15 +15,17 @@ export function createPacksClient(config = {}) {
|
|
|
12
15
|
/**
|
|
13
16
|
* List catalog entries for available packs.
|
|
14
17
|
*/
|
|
15
|
-
|
|
16
|
-
return gateway
|
|
18
|
+
listCatalog() {
|
|
19
|
+
return gateway
|
|
20
|
+
.request({
|
|
17
21
|
path: "/api/platform/v1/packs/catalog",
|
|
18
|
-
})
|
|
22
|
+
})
|
|
23
|
+
.then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "catalog")));
|
|
19
24
|
},
|
|
20
25
|
/**
|
|
21
26
|
* Get the discovery catalog for packs.
|
|
22
27
|
*/
|
|
23
|
-
|
|
28
|
+
getDiscoveryCatalog() {
|
|
24
29
|
return gateway.request({
|
|
25
30
|
path: "/api/platform/v1/packs/discovery",
|
|
26
31
|
});
|
|
@@ -28,7 +33,7 @@ export function createPacksClient(config = {}) {
|
|
|
28
33
|
/**
|
|
29
34
|
* Get discovery details for a specific pack.
|
|
30
35
|
*/
|
|
31
|
-
|
|
36
|
+
getDiscoveryDetail(packKey) {
|
|
32
37
|
return gateway.request({
|
|
33
38
|
path: `/api/platform/v1/packs/discovery/${encodeURIComponent(packKey)}`,
|
|
34
39
|
});
|
|
@@ -36,15 +41,17 @@ export function createPacksClient(config = {}) {
|
|
|
36
41
|
/**
|
|
37
42
|
* List pack states for the current scope.
|
|
38
43
|
*/
|
|
39
|
-
|
|
40
|
-
return gateway
|
|
44
|
+
listStates(query = {}) {
|
|
45
|
+
return gateway
|
|
46
|
+
.request({
|
|
41
47
|
path: `/api/platform/v1/packs/states${toQueryString(query)}`,
|
|
42
|
-
})
|
|
48
|
+
})
|
|
49
|
+
.then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "states")));
|
|
43
50
|
},
|
|
44
51
|
/**
|
|
45
52
|
* Get health details for a pack.
|
|
46
53
|
*/
|
|
47
|
-
|
|
54
|
+
getHealth(packKey, query = {}) {
|
|
48
55
|
return gateway.request({
|
|
49
56
|
path: `/api/platform/v1/packs/${encodeURIComponent(packKey)}/health${toQueryString(query)}`,
|
|
50
57
|
});
|
|
@@ -52,15 +59,17 @@ export function createPacksClient(config = {}) {
|
|
|
52
59
|
/**
|
|
53
60
|
* List pack telemetry entries.
|
|
54
61
|
*/
|
|
55
|
-
|
|
56
|
-
return gateway
|
|
62
|
+
listTelemetry(query = {}) {
|
|
63
|
+
return gateway
|
|
64
|
+
.request({
|
|
57
65
|
path: `/api/platform/v1/packs/telemetry${toQueryString(query)}`,
|
|
58
|
-
})
|
|
66
|
+
})
|
|
67
|
+
.then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "telemetry")));
|
|
59
68
|
},
|
|
60
69
|
/**
|
|
61
70
|
* Create a pack entitlement.
|
|
62
71
|
*/
|
|
63
|
-
|
|
72
|
+
createEntitlement(input, idempotencyKey) {
|
|
64
73
|
return gateway.request({
|
|
65
74
|
path: "/api/platform/v1/packs/entitlements",
|
|
66
75
|
method: "POST",
|
|
@@ -71,7 +80,7 @@ export function createPacksClient(config = {}) {
|
|
|
71
80
|
/**
|
|
72
81
|
* Install a pack.
|
|
73
82
|
*/
|
|
74
|
-
|
|
83
|
+
install(input, idempotencyKey) {
|
|
75
84
|
return gateway.request({
|
|
76
85
|
path: "/api/platform/v1/packs/install",
|
|
77
86
|
method: "POST",
|
|
@@ -82,7 +91,7 @@ export function createPacksClient(config = {}) {
|
|
|
82
91
|
/**
|
|
83
92
|
* Enable a pack.
|
|
84
93
|
*/
|
|
85
|
-
|
|
94
|
+
enable(input, idempotencyKey) {
|
|
86
95
|
return gateway.request({
|
|
87
96
|
path: "/api/platform/v1/packs/enable",
|
|
88
97
|
method: "POST",
|
|
@@ -93,7 +102,7 @@ export function createPacksClient(config = {}) {
|
|
|
93
102
|
/**
|
|
94
103
|
* Disable a pack.
|
|
95
104
|
*/
|
|
96
|
-
|
|
105
|
+
disable(input, idempotencyKey) {
|
|
97
106
|
return gateway.request({
|
|
98
107
|
path: "/api/platform/v1/packs/disable",
|
|
99
108
|
method: "POST",
|
|
@@ -104,7 +113,7 @@ export function createPacksClient(config = {}) {
|
|
|
104
113
|
/**
|
|
105
114
|
* Uninstall a pack.
|
|
106
115
|
*/
|
|
107
|
-
|
|
116
|
+
uninstall(input, idempotencyKey) {
|
|
108
117
|
return gateway.request({
|
|
109
118
|
path: "/api/platform/v1/packs/uninstall",
|
|
110
119
|
method: "POST",
|
|
@@ -115,7 +124,7 @@ export function createPacksClient(config = {}) {
|
|
|
115
124
|
/**
|
|
116
125
|
* Upgrade a pack.
|
|
117
126
|
*/
|
|
118
|
-
|
|
127
|
+
upgrade(input, idempotencyKey) {
|
|
119
128
|
return gateway.request({
|
|
120
129
|
path: "/api/platform/v1/packs/upgrade",
|
|
121
130
|
method: "POST",
|
package/dist/policyClient.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type GatewayScope
|
|
2
|
-
export { LucernApiError };
|
|
1
|
+
import { type GatewayClientConfig, type GatewayScope } from "./coreClient";
|
|
3
2
|
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
4
3
|
/** Configuration for the policy client. */
|
|
5
4
|
export type PolicyClientConfig = GatewayClientConfig;
|
|
@@ -7,16 +6,16 @@ export type PolicyClientConfig = GatewayClientConfig;
|
|
|
7
6
|
export type PermissionKind = "read" | "write";
|
|
8
7
|
/** Permission level for a write policy rule. */
|
|
9
8
|
export type WritePolicyPermission = "allow" | "deny" | "review_required";
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/** Topic row returned from policy-scoped topic filters. */
|
|
10
|
+
export interface PolicyTopicRecord {
|
|
11
|
+
isOwner?: boolean;
|
|
12
12
|
name?: string;
|
|
13
|
+
topicId?: string;
|
|
13
14
|
type?: string;
|
|
14
|
-
isOwner?: boolean;
|
|
15
15
|
[key: string]: unknown;
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
/** Structured explanation of how a policy decision was derived. */
|
|
18
|
-
export
|
|
19
|
-
summary?: string;
|
|
18
|
+
export interface PolicyDecisionExplanation {
|
|
20
19
|
matchedReasonCode?: string;
|
|
21
20
|
steps?: Array<{
|
|
22
21
|
stage?: string;
|
|
@@ -24,36 +23,37 @@ export type PolicyDecisionExplanation = {
|
|
|
24
23
|
reasonCode?: string;
|
|
25
24
|
detail?: string;
|
|
26
25
|
}>;
|
|
26
|
+
summary?: string;
|
|
27
27
|
[key: string]: unknown;
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
29
|
/** Result of a permission check against the policy engine. */
|
|
30
|
-
export
|
|
30
|
+
export interface PermissionDecision {
|
|
31
31
|
allowed?: boolean;
|
|
32
32
|
decision?: string;
|
|
33
|
-
|
|
34
|
-
principalId?: string;
|
|
35
|
-
topicId?: string;
|
|
33
|
+
explanation?: PolicyDecisionExplanation;
|
|
36
34
|
permission?: string;
|
|
37
35
|
policyVersion?: string;
|
|
36
|
+
principalId?: string;
|
|
37
|
+
reasonCode?: string;
|
|
38
|
+
topicId?: string;
|
|
38
39
|
traceId?: string | null;
|
|
39
|
-
|
|
40
|
-
};
|
|
40
|
+
}
|
|
41
41
|
/** A persisted write policy rule controlling mutation access. */
|
|
42
|
-
export
|
|
42
|
+
export interface WritePolicyRecord {
|
|
43
|
+
createdAt?: number;
|
|
44
|
+
createdBy?: string;
|
|
45
|
+
enabled?: boolean;
|
|
43
46
|
id?: string;
|
|
44
|
-
topicId?: string;
|
|
45
|
-
role?: string;
|
|
46
|
-
toolCategory?: string;
|
|
47
|
-
permission?: WritePolicyPermission;
|
|
48
47
|
maxWritesPerSession?: number;
|
|
49
|
-
|
|
48
|
+
permission?: WritePolicyPermission;
|
|
50
49
|
rationale?: string;
|
|
51
|
-
createdAt?: number;
|
|
52
|
-
updatedAt?: number;
|
|
53
|
-
createdBy?: string;
|
|
54
50
|
resolution?: string;
|
|
51
|
+
role?: string;
|
|
52
|
+
toolCategory?: string;
|
|
53
|
+
topicId?: string;
|
|
54
|
+
updatedAt?: number;
|
|
55
55
|
[key: string]: unknown;
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
/** Input for creating a write policy rule. */
|
|
58
58
|
export type WritePolicyCreateInput = GatewayScope & {
|
|
59
59
|
topicId?: string;
|
|
@@ -78,56 +78,67 @@ export type WritePolicyUpdateInput = GatewayScope & {
|
|
|
78
78
|
rationale?: string;
|
|
79
79
|
clearRationale?: boolean;
|
|
80
80
|
};
|
|
81
|
-
export
|
|
82
|
-
resource: string;
|
|
81
|
+
export interface TenantPolicyPermission {
|
|
83
82
|
actions: string[];
|
|
84
|
-
|
|
83
|
+
resource: string;
|
|
84
|
+
}
|
|
85
85
|
export type TenantPolicyKind = "role" | "object_classification";
|
|
86
86
|
export type TenantPolicyExternalAccess = "allowed" | "summaries" | "omitted";
|
|
87
|
-
export
|
|
88
|
-
policyKind?: TenantPolicyKind;
|
|
89
|
-
profileKey?: string;
|
|
90
|
-
objectTypes?: string[];
|
|
87
|
+
export interface TenantPolicyClassificationFields {
|
|
91
88
|
accessTier?: string;
|
|
92
|
-
exportClass?: string;
|
|
93
89
|
classificationKey?: string;
|
|
94
90
|
classificationLabels?: string[];
|
|
95
|
-
|
|
91
|
+
exportClass?: string;
|
|
96
92
|
externalAccess?: TenantPolicyExternalAccess;
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
export type TenantPolicyRecord = {
|
|
100
|
-
id?: string;
|
|
101
|
-
tenantId: string;
|
|
102
|
-
workspaceId?: string;
|
|
93
|
+
objectTypes?: string[];
|
|
103
94
|
policyKind?: TenantPolicyKind;
|
|
104
|
-
|
|
105
|
-
description?: string;
|
|
106
|
-
permissions: TenantPolicyPermission[];
|
|
107
|
-
groupBindings: string[];
|
|
95
|
+
policyTags?: string[];
|
|
108
96
|
profileKey?: string;
|
|
109
|
-
|
|
97
|
+
requiredGroupKey?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface TenantPolicyRecord {
|
|
110
100
|
accessTier?: string;
|
|
111
|
-
exportClass?: string;
|
|
112
101
|
classificationKey?: string;
|
|
113
102
|
classificationLabels?: string[];
|
|
114
|
-
|
|
103
|
+
createdAt?: number;
|
|
104
|
+
createdBy?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
exportClass?: string;
|
|
115
107
|
externalAccess?: TenantPolicyExternalAccess;
|
|
108
|
+
groupBindings: string[];
|
|
109
|
+
id?: string;
|
|
110
|
+
objectTypes?: string[];
|
|
111
|
+
permissions: TenantPolicyPermission[];
|
|
112
|
+
policyKind?: TenantPolicyKind;
|
|
113
|
+
policyTags?: string[];
|
|
114
|
+
profileKey?: string;
|
|
116
115
|
requiredGroupKey?: string;
|
|
117
|
-
|
|
116
|
+
roleName: string;
|
|
117
|
+
tenantId: string;
|
|
118
118
|
updatedAt?: number;
|
|
119
|
-
createdBy?: string;
|
|
120
119
|
updatedBy?: string;
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
workspaceId?: string;
|
|
121
|
+
}
|
|
122
|
+
/** Response envelope for accessible-topic policy queries. */
|
|
123
|
+
export interface AccessibleTopicsResponse {
|
|
124
|
+
deniedTopics: Array<{
|
|
125
|
+
topicId: string;
|
|
126
|
+
reasonCode: string;
|
|
127
|
+
}>;
|
|
123
128
|
permission: PermissionKind;
|
|
129
|
+
topics: PolicyTopicRecord[];
|
|
130
|
+
total: number;
|
|
131
|
+
}
|
|
132
|
+
/** Response envelope for topic permission filters. */
|
|
133
|
+
export interface FilterByPermissionResponse {
|
|
124
134
|
allowedTopicIds: string[];
|
|
135
|
+
count: number;
|
|
125
136
|
deniedTopics: Array<{
|
|
126
137
|
topicId: string;
|
|
127
138
|
reasonCode: string;
|
|
128
139
|
}>;
|
|
129
|
-
|
|
130
|
-
}
|
|
140
|
+
permission: PermissionKind;
|
|
141
|
+
}
|
|
131
142
|
/**
|
|
132
143
|
* Create the policy client for permission checks, grants, and write policies.
|
|
133
144
|
* @param config - Gateway transport configuration.
|
|
@@ -179,10 +190,10 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
179
190
|
data: {
|
|
180
191
|
policies: WritePolicyRecord[];
|
|
181
192
|
};
|
|
182
|
-
success: true;
|
|
183
193
|
correlationId: string;
|
|
184
|
-
policyTraceId: string | null;
|
|
185
194
|
idempotentReplay: boolean;
|
|
195
|
+
policyTraceId: string | null;
|
|
196
|
+
success: true;
|
|
186
197
|
}>;
|
|
187
198
|
/**
|
|
188
199
|
* Create a write policy rule.
|
|
@@ -193,10 +204,10 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
193
204
|
created: boolean;
|
|
194
205
|
policy: WritePolicyRecord | null;
|
|
195
206
|
};
|
|
196
|
-
success: true;
|
|
197
207
|
correlationId: string;
|
|
198
|
-
policyTraceId: string | null;
|
|
199
208
|
idempotentReplay: boolean;
|
|
209
|
+
policyTraceId: string | null;
|
|
210
|
+
success: true;
|
|
200
211
|
}>;
|
|
201
212
|
/**
|
|
202
213
|
* Update an existing write policy rule by identifier.
|
|
@@ -207,10 +218,10 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
207
218
|
updated: boolean;
|
|
208
219
|
policy: WritePolicyRecord | null;
|
|
209
220
|
};
|
|
210
|
-
success: true;
|
|
211
221
|
correlationId: string;
|
|
212
|
-
policyTraceId: string | null;
|
|
213
222
|
idempotentReplay: boolean;
|
|
223
|
+
policyTraceId: string | null;
|
|
224
|
+
success: true;
|
|
214
225
|
}>;
|
|
215
226
|
/**
|
|
216
227
|
* Delete a write policy rule by identifier.
|
|
@@ -226,10 +237,10 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
226
237
|
data: {
|
|
227
238
|
policies: TenantPolicyRecord[];
|
|
228
239
|
};
|
|
229
|
-
success: true;
|
|
230
240
|
correlationId: string;
|
|
231
|
-
policyTraceId: string | null;
|
|
232
241
|
idempotentReplay: boolean;
|
|
242
|
+
policyTraceId: string | null;
|
|
243
|
+
success: true;
|
|
233
244
|
}>;
|
|
234
245
|
/**
|
|
235
246
|
* Create a tenant role policy.
|
|
@@ -243,10 +254,10 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
243
254
|
data: {
|
|
244
255
|
policy: TenantPolicyRecord | null;
|
|
245
256
|
};
|
|
246
|
-
success: true;
|
|
247
257
|
correlationId: string;
|
|
248
|
-
policyTraceId: string | null;
|
|
249
258
|
idempotentReplay: boolean;
|
|
259
|
+
policyTraceId: string | null;
|
|
260
|
+
success: true;
|
|
250
261
|
}>;
|
|
251
262
|
/**
|
|
252
263
|
* Update a tenant role policy by identifier.
|
|
@@ -260,10 +271,10 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
260
271
|
data: {
|
|
261
272
|
policy: TenantPolicyRecord | null;
|
|
262
273
|
};
|
|
263
|
-
success: true;
|
|
264
274
|
correlationId: string;
|
|
265
|
-
policyTraceId: string | null;
|
|
266
275
|
idempotentReplay: boolean;
|
|
276
|
+
policyTraceId: string | null;
|
|
277
|
+
success: true;
|
|
267
278
|
}>;
|
|
268
279
|
/**
|
|
269
280
|
* Delete a tenant role policy by identifier.
|
|
@@ -291,17 +302,17 @@ export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
|
291
302
|
}): Promise<{
|
|
292
303
|
data: {
|
|
293
304
|
permission: PermissionKind;
|
|
294
|
-
topics:
|
|
305
|
+
topics: PolicyTopicRecord[];
|
|
295
306
|
total: number;
|
|
296
307
|
deniedTopics: {
|
|
297
308
|
topicId: string;
|
|
298
309
|
reasonCode: string;
|
|
299
310
|
}[];
|
|
300
311
|
};
|
|
301
|
-
success: true;
|
|
302
312
|
correlationId: string;
|
|
303
|
-
policyTraceId: string | null;
|
|
304
313
|
idempotentReplay: boolean;
|
|
314
|
+
policyTraceId: string | null;
|
|
315
|
+
success: true;
|
|
305
316
|
}>;
|
|
306
317
|
/**
|
|
307
318
|
* Filter topic identifiers by permission.
|