@veltrixsecops/app-sdk 3.2.0 → 3.5.0
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 +1 -1
- package/dist/byol/index.cjs +3802 -0
- package/dist/byol/index.cjs.map +1 -0
- package/dist/byol/index.d.cts +578 -0
- package/dist/byol/index.d.ts +578 -0
- package/dist/byol/index.js +2587 -0
- package/dist/byol/index.js.map +1 -0
- package/dist/chunk-3WK4EVQ3.js +842 -0
- package/dist/chunk-3WK4EVQ3.js.map +1 -0
- package/dist/{chunk-EOOEHZGC.js → chunk-HIL6RIDG.js} +107 -3
- package/dist/chunk-HIL6RIDG.js.map +1 -0
- package/dist/{chunk-VWFTOFTI.js → chunk-Y6XBNZGR.js} +8 -2
- package/dist/chunk-Y6XBNZGR.js.map +1 -0
- package/dist/client/index.cjs +112 -2
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +118 -6
- package/dist/client/index.d.ts +118 -6
- package/dist/client/index.js +13 -1
- package/dist/connections/index.cjs +1787 -0
- package/dist/connections/index.cjs.map +1 -0
- package/dist/connections/index.d.cts +78 -0
- package/dist/connections/index.d.ts +78 -0
- package/dist/connections/index.js +754 -0
- package/dist/connections/index.js.map +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/opentofu/index.cjs +138 -0
- package/dist/opentofu/index.cjs.map +1 -0
- package/dist/opentofu/index.d.cts +131 -0
- package/dist/opentofu/index.d.ts +131 -0
- package/dist/opentofu/index.js +109 -0
- package/dist/opentofu/index.js.map +1 -0
- package/dist/pipeline/index.cjs +7 -0
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +9 -2
- package/dist/pipeline/index.d.ts +9 -2
- package/dist/pipeline/index.js +3 -1
- package/dist/pipeline-beeT8dje.d.cts +408 -0
- package/dist/pipeline-beeT8dje.d.ts +408 -0
- package/dist/ui/index.cjs +136 -0
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +109 -1
- package/dist/ui/index.d.ts +109 -1
- package/dist/ui/index.js +35 -677
- package/dist/ui/index.js.map +1 -1
- package/dist/{use-app-context-OQlcmq7t.d.cts → use-app-context-Byv_fam0.d.cts} +206 -4
- package/dist/{use-app-context-OQlcmq7t.d.ts → use-app-context-Byv_fam0.d.ts} +206 -4
- package/opentofu/README.md +114 -0
- package/opentofu/modules/aws/main.tf +1008 -0
- package/opentofu/modules/aws/outputs.tf +90 -0
- package/opentofu/modules/aws/variables.tf +437 -0
- package/opentofu/modules/aws/versions.tf +23 -0
- package/opentofu/modules/azure/main.tf +920 -0
- package/opentofu/modules/azure/outputs.tf +72 -0
- package/opentofu/modules/azure/variables.tf +498 -0
- package/opentofu/modules/azure/versions.tf +27 -0
- package/opentofu/modules/gcp/main.tf +645 -0
- package/opentofu/modules/gcp/outputs.tf +73 -0
- package/opentofu/modules/gcp/variables.tf +428 -0
- package/opentofu/modules/gcp/versions.tf +27 -0
- package/opentofu/modules/hetzner/main.tf +432 -0
- package/opentofu/modules/hetzner/outputs.tf +72 -0
- package/opentofu/modules/hetzner/variables.tf +423 -0
- package/opentofu/modules/hetzner/versions.tf +26 -0
- package/package.json +33 -1
- package/dist/chunk-EOOEHZGC.js.map +0 -1
- package/dist/chunk-VWFTOFTI.js.map +0 -1
- package/dist/pipeline-A-gSsPRR.d.cts +0 -189
- package/dist/pipeline-A-gSsPRR.d.ts +0 -189
package/dist/pipeline/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PipelineContext,
|
|
1
|
+
import { P as PipelineContext, I as ValidationResult, D as DeployContext, i as DeployResult, x as RollbackContext, z as RollbackResult, p as HealthCheckContext, r as HealthCheckResult, l as DriftContext, o as DriftResult, T as TestConnectionContext, B as TestConnectionResult } from '../pipeline-beeT8dje.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Define a validation handler for a configuration type.
|
|
@@ -50,4 +50,11 @@ declare function defineHealthChecker(handler: (ctx: HealthCheckContext) => Promi
|
|
|
50
50
|
*/
|
|
51
51
|
declare function defineDriftDetector(handler: (ctx: DriftContext) => Promise<DriftResult>): (ctx: DriftContext) => Promise<DriftResult>;
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Define a connection-test handler for an app. The platform runs it in-process
|
|
55
|
+
* with the decrypted credential to verify a Connection's endpoint + credentials
|
|
56
|
+
* before they're relied on for deployments.
|
|
57
|
+
*/
|
|
58
|
+
declare function defineConnectionTester(handler: (ctx: TestConnectionContext) => Promise<TestConnectionResult>): (ctx: TestConnectionContext) => Promise<TestConnectionResult>;
|
|
59
|
+
|
|
60
|
+
export { defineConnectionTester, defineDeployer, defineDriftDetector, defineHealthChecker, defineRollbackHandler, defineValidator };
|
package/dist/pipeline/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
defineConnectionTester,
|
|
2
3
|
defineDeployer,
|
|
3
4
|
defineDriftDetector,
|
|
4
5
|
defineHealthChecker,
|
|
5
6
|
defineRollbackHandler,
|
|
6
7
|
defineValidator
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-Y6XBNZGR.js";
|
|
8
9
|
export {
|
|
10
|
+
defineConnectionTester,
|
|
9
11
|
defineDeployer,
|
|
10
12
|
defineDriftDetector,
|
|
11
13
|
defineHealthChecker,
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
interface ValidationError {
|
|
2
|
+
field: string;
|
|
3
|
+
message: string;
|
|
4
|
+
code: string;
|
|
5
|
+
}
|
|
6
|
+
interface ValidationWarning {
|
|
7
|
+
field: string;
|
|
8
|
+
message: string;
|
|
9
|
+
code: string;
|
|
10
|
+
}
|
|
11
|
+
interface ValidationResult {
|
|
12
|
+
valid: boolean;
|
|
13
|
+
errors: ValidationError[];
|
|
14
|
+
warnings: ValidationWarning[];
|
|
15
|
+
}
|
|
16
|
+
interface DeployResult {
|
|
17
|
+
success: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
artifacts?: Record<string, unknown>;
|
|
20
|
+
rollbackData?: unknown;
|
|
21
|
+
}
|
|
22
|
+
interface RollbackResult {
|
|
23
|
+
success: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
}
|
|
26
|
+
interface HealthCheck {
|
|
27
|
+
name: string;
|
|
28
|
+
passed: boolean;
|
|
29
|
+
message: string;
|
|
30
|
+
latencyMs?: number;
|
|
31
|
+
}
|
|
32
|
+
interface HealthCheckResult {
|
|
33
|
+
healthy: boolean;
|
|
34
|
+
score: number;
|
|
35
|
+
checks: HealthCheck[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Best-effort attribution for a drifting change: WHO changed the target outside
|
|
39
|
+
* Veltrix, and WHEN, resolved from the tool's own audit/system log (e.g. Okta's
|
|
40
|
+
* System Log). All fields optional — a tool without an audit API, or a change we
|
|
41
|
+
* can't correlate, simply omits it.
|
|
42
|
+
*/
|
|
43
|
+
interface DriftActor {
|
|
44
|
+
/** Provider-native actor id (Okta user id, etc.). */
|
|
45
|
+
id?: string;
|
|
46
|
+
/** Human-facing name of who made the change. */
|
|
47
|
+
name?: string;
|
|
48
|
+
/** Actor email / login, when available. */
|
|
49
|
+
email?: string;
|
|
50
|
+
/** ISO timestamp the change was actually made (not when Veltrix detected it). */
|
|
51
|
+
at?: string;
|
|
52
|
+
/** Provider event type behind the change, e.g. "group.lifecycle.update". */
|
|
53
|
+
eventType?: string;
|
|
54
|
+
/** Where the attribution came from, e.g. "okta-system-log". */
|
|
55
|
+
source?: string;
|
|
56
|
+
}
|
|
57
|
+
interface DriftDiff {
|
|
58
|
+
field: string;
|
|
59
|
+
expected: unknown;
|
|
60
|
+
actual: unknown;
|
|
61
|
+
severity: 'info' | 'warning' | 'critical';
|
|
62
|
+
/** Who made this change + when, when the tool's audit log lets us attribute it. */
|
|
63
|
+
actor?: DriftActor;
|
|
64
|
+
}
|
|
65
|
+
interface DriftResult {
|
|
66
|
+
hasDrift: boolean;
|
|
67
|
+
diffs: DriftDiff[];
|
|
68
|
+
}
|
|
69
|
+
interface ComponentConfigStatus {
|
|
70
|
+
componentId: string;
|
|
71
|
+
hostname: string;
|
|
72
|
+
deployed: boolean;
|
|
73
|
+
version?: string;
|
|
74
|
+
lastDeployedAt?: string;
|
|
75
|
+
healthy?: boolean;
|
|
76
|
+
healthScore?: number;
|
|
77
|
+
}
|
|
78
|
+
interface ConfigStatus {
|
|
79
|
+
deployed: boolean;
|
|
80
|
+
version: string;
|
|
81
|
+
lastDeployedAt: string;
|
|
82
|
+
componentStatuses: ComponentConfigStatus[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* One item declared by a configuration — one object to create in the target
|
|
86
|
+
* tool (an index, an IOC, a host group). `fields` is flat across the item's
|
|
87
|
+
* presentational groups, so a handler reads every field the user filled in
|
|
88
|
+
* regardless of how the canvas laid them out.
|
|
89
|
+
*/
|
|
90
|
+
interface CanvasItemSnapshot {
|
|
91
|
+
/** Stable identity for diffs. Always set by the platform; optional so a
|
|
92
|
+
* handler's own test fixtures need not invent one. */
|
|
93
|
+
id?: string;
|
|
94
|
+
name: string;
|
|
95
|
+
fields: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
/** @deprecated Use {@link CanvasItemSnapshot}. A section IS one item. */
|
|
98
|
+
type CanvasSectionSnapshot = CanvasItemSnapshot;
|
|
99
|
+
interface CanvasSnapshot {
|
|
100
|
+
id: string;
|
|
101
|
+
canvasId: string;
|
|
102
|
+
version: number;
|
|
103
|
+
name: string;
|
|
104
|
+
toolType: string;
|
|
105
|
+
entityType: string;
|
|
106
|
+
/** The items to create in the target tool. One configuration can declare many. */
|
|
107
|
+
items: CanvasItemSnapshot[];
|
|
108
|
+
/** @deprecated Alias of {@link items}. */
|
|
109
|
+
sections: CanvasSectionSnapshot[];
|
|
110
|
+
snapshot: Record<string, unknown>;
|
|
111
|
+
}
|
|
112
|
+
type DeploymentStrategy = 'DIRECT' | 'CANARY' | 'BLUE_GREEN' | 'ROLLING';
|
|
113
|
+
interface EnvironmentRef {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
/** The type(s) this environment is classified as (production, staging, qa, …). */
|
|
117
|
+
environmentTypes?: string[];
|
|
118
|
+
}
|
|
119
|
+
interface UserRef {
|
|
120
|
+
id: string;
|
|
121
|
+
email: string;
|
|
122
|
+
name: string | null;
|
|
123
|
+
}
|
|
124
|
+
interface ComponentRef {
|
|
125
|
+
id: string;
|
|
126
|
+
hostname: string;
|
|
127
|
+
port: string;
|
|
128
|
+
type: string[];
|
|
129
|
+
toolId: string;
|
|
130
|
+
}
|
|
131
|
+
interface CredentialRef {
|
|
132
|
+
id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
username: string;
|
|
135
|
+
password: string;
|
|
136
|
+
apiToken: string | null;
|
|
137
|
+
certificate: string | null;
|
|
138
|
+
}
|
|
139
|
+
interface ConnectivityRef {
|
|
140
|
+
id: string;
|
|
141
|
+
status: string;
|
|
142
|
+
sshCommand: string | null;
|
|
143
|
+
httpsUrl: string | null;
|
|
144
|
+
tailscaleDeviceIP: string | null;
|
|
145
|
+
}
|
|
146
|
+
/** Provider-aware connectivity passed to handlers when a ConnectivityProvider is configured */
|
|
147
|
+
interface ConnectivityProviderRef {
|
|
148
|
+
id: string;
|
|
149
|
+
providerType: string;
|
|
150
|
+
name: string;
|
|
151
|
+
status: string;
|
|
152
|
+
config: Record<string, unknown>;
|
|
153
|
+
}
|
|
154
|
+
/** Summary of a deployment record, returned by PlatformDataApi */
|
|
155
|
+
interface DeploymentSummary {
|
|
156
|
+
id: string;
|
|
157
|
+
canvasId: string;
|
|
158
|
+
status: string;
|
|
159
|
+
healthScore: number | null;
|
|
160
|
+
startedAt: string;
|
|
161
|
+
completedAt: string | null;
|
|
162
|
+
environment: EnvironmentRef;
|
|
163
|
+
/**
|
|
164
|
+
* The app-owned rollback/identity data this deployment stored (DeployResult
|
|
165
|
+
* .rollbackData). A deploy handler reads its OWN prior data here — e.g. the
|
|
166
|
+
* external ids it assigned per canvas item — so the next deploy can match
|
|
167
|
+
* existing objects by stable id (supporting rename) instead of by name.
|
|
168
|
+
*/
|
|
169
|
+
rollbackData?: unknown;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Tenant-scoped, read-only access to platform data, provided on every
|
|
173
|
+
* handler context as `ctx.platform`. Apps must use this instead of
|
|
174
|
+
* querying the platform database directly — it is the only supported
|
|
175
|
+
* way to read platform records from an app.
|
|
176
|
+
*/
|
|
177
|
+
interface PlatformDataApi {
|
|
178
|
+
/** Latest deployment for a canvas, optionally filtered by status (e.g. 'SUCCEEDED'). */
|
|
179
|
+
getLatestDeployment(canvasId: string, opts?: {
|
|
180
|
+
status?: string;
|
|
181
|
+
}): Promise<DeploymentSummary | null>;
|
|
182
|
+
/** Components for the current customer, optionally filtered by component types. */
|
|
183
|
+
listComponents(filter?: {
|
|
184
|
+
types?: string[];
|
|
185
|
+
}): Promise<ComponentRef[]>;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* App-only token broker, provided on handler contexts as `ctx.identity` for
|
|
189
|
+
* connections onboarded through the platform's consent flow. It lets a handler
|
|
190
|
+
* mint an app-only access token for a customer tenant WITHOUT holding any
|
|
191
|
+
* secret of its own — the platform uses the central multi-tenant connector
|
|
192
|
+
* app's credentials, does the client-credentials exchange against the customer
|
|
193
|
+
* tenant, and caches (~1h).
|
|
194
|
+
*
|
|
195
|
+
* Dual token source (back-compatible): a brokered connection carries no secret,
|
|
196
|
+
* so its handler reads the token via `ctx.identity`; a BYO-secret connection
|
|
197
|
+
* keeps self-minting from `ctx.credential`. Detect brokered by the absence of a
|
|
198
|
+
* credential secret (and the presence of `ctx.identity`).
|
|
199
|
+
*/
|
|
200
|
+
interface IdentityBroker {
|
|
201
|
+
getAccessToken(opts: {
|
|
202
|
+
/** Consented customer Entra tenant id. */
|
|
203
|
+
tenantId: string;
|
|
204
|
+
/** Token audience, e.g. `https://graph.microsoft.com` (no `/.default`). */
|
|
205
|
+
resource: string;
|
|
206
|
+
/** Sovereign cloud override; defaults to the connection's cloud. */
|
|
207
|
+
cloud?: string;
|
|
208
|
+
}): Promise<string>;
|
|
209
|
+
}
|
|
210
|
+
interface PipelineContext {
|
|
211
|
+
appId: string;
|
|
212
|
+
customerId: string;
|
|
213
|
+
configTypeId: string;
|
|
214
|
+
canvas: CanvasSnapshot;
|
|
215
|
+
environment: EnvironmentRef;
|
|
216
|
+
user: UserRef;
|
|
217
|
+
settings: Record<string, unknown>;
|
|
218
|
+
platform: PlatformDataApi;
|
|
219
|
+
/**
|
|
220
|
+
* App-only token broker for brokered (consent-onboarded) connections.
|
|
221
|
+
* Optional so existing BYO-secret handlers and contexts are unaffected.
|
|
222
|
+
*/
|
|
223
|
+
identity?: IdentityBroker;
|
|
224
|
+
/**
|
|
225
|
+
* The resolved deploy target + decrypted credential for this config type's
|
|
226
|
+
* environment, when a connection exists. Present on deploy/rollback/etc. (where
|
|
227
|
+
* they are required), and now ALSO provided (best-effort) to `validate` so a
|
|
228
|
+
* validator can do LIVE checks against the target system (e.g. verifying a
|
|
229
|
+
* referenced id exists) — see the okta-identity live group-id validation.
|
|
230
|
+
* Both are optional/null on the base context: validate must still work with no
|
|
231
|
+
* connection (static-only), and a handler must null-check before using them.
|
|
232
|
+
*/
|
|
233
|
+
component?: ComponentRef | null;
|
|
234
|
+
credential?: CredentialRef | null;
|
|
235
|
+
}
|
|
236
|
+
/** One selectable option returned by an app's options provider. */
|
|
237
|
+
interface OptionItem {
|
|
238
|
+
/** The stored value (e.g. an Okta group id). */
|
|
239
|
+
value: string;
|
|
240
|
+
/** The human label shown in the picker (e.g. the group name). */
|
|
241
|
+
label: string;
|
|
242
|
+
/** Optional secondary text (e.g. the id, a type, a description). */
|
|
243
|
+
description?: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Context for an app "options provider" — the handler that powers a live
|
|
247
|
+
* `remote-multiselect` config field. The platform resolves the connection
|
|
248
|
+
* (decrypted credential + component) for the app/config type's environment and
|
|
249
|
+
* runs the provider in-process, so it can call the target system directly.
|
|
250
|
+
*/
|
|
251
|
+
interface OptionsProviderContext {
|
|
252
|
+
appId: string;
|
|
253
|
+
customerId: string;
|
|
254
|
+
configTypeId: string;
|
|
255
|
+
/** Which option set the field asked for — the field's `optionsSource`. */
|
|
256
|
+
source: string;
|
|
257
|
+
/** Optional free-text search entered in the field. */
|
|
258
|
+
query?: string;
|
|
259
|
+
component: ComponentRef | null;
|
|
260
|
+
credential: CredentialRef | null;
|
|
261
|
+
settings: Record<string, unknown>;
|
|
262
|
+
identity?: IdentityBroker;
|
|
263
|
+
}
|
|
264
|
+
/** An app handler that returns live options for a `remote-multiselect` field. */
|
|
265
|
+
type OptionsProvider = (ctx: OptionsProviderContext) => Promise<OptionItem[]>;
|
|
266
|
+
/**
|
|
267
|
+
* A file/command placement onto the target host, provided by the PLATFORM (never
|
|
268
|
+
* by the app) and present only when the component is reachable over managed ZTNA
|
|
269
|
+
* (Tailscale SSH) — otherwise `ctx.remote` is undefined and a handler falls back to
|
|
270
|
+
* whatever it can do over the tool's own API.
|
|
271
|
+
*
|
|
272
|
+
* The app passes TYPED INTENTS, not raw shell: the platform builds an allow-listed
|
|
273
|
+
* command server-side, constrains every path under the target's install root, runs
|
|
274
|
+
* it over the tenant's own managed tailnet, and audits it. Used e.g. to place a
|
|
275
|
+
* Splunk app into `etc/manager-apps` and run `apply cluster-bundle`.
|
|
276
|
+
*/
|
|
277
|
+
interface RemoteExecutor {
|
|
278
|
+
/** Resolved install base ($SPLUNK_HOME) on the target — build install paths off this. */
|
|
279
|
+
readonly homeDir: string;
|
|
280
|
+
/** Extract a gzipped-tar archive (e.g. a .spl) into an allow-listed remote directory. */
|
|
281
|
+
extractArchive(archive: Uint8Array, remoteDir: string): Promise<void>;
|
|
282
|
+
/**
|
|
283
|
+
* Write raw bytes (e.g. a .spl package) to an allow-listed staging path on the
|
|
284
|
+
* target — for a REST `apps/local` install by server-local path (splunkd only
|
|
285
|
+
* parses the form-encoded `name=<path>&filename=true` install, not a multipart
|
|
286
|
+
* upload). `remotePath` must be under `<homeDir>/var/run/veltrix`.
|
|
287
|
+
*/
|
|
288
|
+
putFile(bytes: Uint8Array, remotePath: string): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* SHA-256 every file under an allow-listed install directory (e.g.
|
|
291
|
+
* `<homeDir>/etc/apps/<app>`), returned as `{ path, sha256 }` with paths
|
|
292
|
+
* relative to that directory. For content drift: compare to the hashes of the
|
|
293
|
+
* files a deploy shipped. Read-only.
|
|
294
|
+
*/
|
|
295
|
+
hashTree(remoteDir: string): Promise<Array<{
|
|
296
|
+
path: string;
|
|
297
|
+
sha256: string;
|
|
298
|
+
}>>;
|
|
299
|
+
/**
|
|
300
|
+
* Read a single file's contents (UTF-8, size-capped) from under an allow-listed
|
|
301
|
+
* install directory — used to show the actual diff when a file's hash drifted.
|
|
302
|
+
* Read-only.
|
|
303
|
+
*/
|
|
304
|
+
readFile(remotePath: string): Promise<string>;
|
|
305
|
+
/** Run one allow-listed intent (bundle apply / deploy-server reload / probe). */
|
|
306
|
+
run(intent: RemoteIntent): Promise<RemoteResult>;
|
|
307
|
+
}
|
|
308
|
+
/** Allow-listed remote actions. The platform maps each to a fixed, argument-checked command. */
|
|
309
|
+
type RemoteIntent = {
|
|
310
|
+
action: 'applyClusterBundle';
|
|
311
|
+
} | {
|
|
312
|
+
action: 'reloadDeployServer';
|
|
313
|
+
} | {
|
|
314
|
+
action: 'applyShclusterBundle';
|
|
315
|
+
targetUri?: string;
|
|
316
|
+
} | {
|
|
317
|
+
action: 'splunkHome';
|
|
318
|
+
} | {
|
|
319
|
+
action: 'removePath';
|
|
320
|
+
path: string;
|
|
321
|
+
};
|
|
322
|
+
interface RemoteResult {
|
|
323
|
+
ok: boolean;
|
|
324
|
+
code: number | null;
|
|
325
|
+
stdout: string;
|
|
326
|
+
stderr: string;
|
|
327
|
+
}
|
|
328
|
+
interface DeployContext extends PipelineContext {
|
|
329
|
+
component: ComponentRef;
|
|
330
|
+
credential: CredentialRef | null;
|
|
331
|
+
connectivity: ConnectivityRef | null;
|
|
332
|
+
connectivityProvider: ConnectivityProviderRef | null;
|
|
333
|
+
/** Platform-provided remote file/command placement — present only for managed-ZTNA targets. */
|
|
334
|
+
remote?: RemoteExecutor;
|
|
335
|
+
previousConfig: CanvasSnapshot | null;
|
|
336
|
+
strategy: DeploymentStrategy;
|
|
337
|
+
canaryPercent?: number;
|
|
338
|
+
}
|
|
339
|
+
interface RollbackContext extends PipelineContext {
|
|
340
|
+
component: ComponentRef;
|
|
341
|
+
credential: CredentialRef | null;
|
|
342
|
+
connectivity: ConnectivityRef | null;
|
|
343
|
+
connectivityProvider: ConnectivityProviderRef | null;
|
|
344
|
+
/** Platform-provided remote placement — present only for managed-ZTNA targets. */
|
|
345
|
+
remote?: RemoteExecutor;
|
|
346
|
+
rollbackData: unknown;
|
|
347
|
+
targetVersion: CanvasSnapshot;
|
|
348
|
+
}
|
|
349
|
+
interface HealthCheckContext extends PipelineContext {
|
|
350
|
+
component: ComponentRef;
|
|
351
|
+
credential: CredentialRef | null;
|
|
352
|
+
connectivity: ConnectivityRef | null;
|
|
353
|
+
connectivityProvider: ConnectivityProviderRef | null;
|
|
354
|
+
}
|
|
355
|
+
interface DriftContext extends PipelineContext {
|
|
356
|
+
component: ComponentRef;
|
|
357
|
+
credential: CredentialRef | null;
|
|
358
|
+
connectivity: ConnectivityRef | null;
|
|
359
|
+
connectivityProvider: ConnectivityProviderRef | null;
|
|
360
|
+
deployedConfig: CanvasSnapshot;
|
|
361
|
+
/** Platform-provided remote read access — present only for managed-ZTNA targets. */
|
|
362
|
+
remote?: RemoteExecutor;
|
|
363
|
+
}
|
|
364
|
+
type ValidateHandler = (ctx: PipelineContext) => Promise<ValidationResult>;
|
|
365
|
+
type DeployHandler = (ctx: DeployContext) => Promise<DeployResult>;
|
|
366
|
+
type RollbackHandler = (ctx: RollbackContext) => Promise<RollbackResult>;
|
|
367
|
+
type HealthCheckHandler = (ctx: HealthCheckContext) => Promise<HealthCheckResult>;
|
|
368
|
+
type DriftDetectHandler = (ctx: DriftContext) => Promise<DriftResult>;
|
|
369
|
+
type GetStatusHandler = (ctx: PipelineContext) => Promise<ConfigStatus>;
|
|
370
|
+
/**
|
|
371
|
+
* Context for `testConnection` — a lightweight, standalone probe that verifies a
|
|
372
|
+
* Connection's endpoint + credential actually work, independent of any config or
|
|
373
|
+
* canvas. The platform decrypts the credential and runs this in-process, so
|
|
374
|
+
* `credential` carries real secrets. `endpoint` is the connection's target
|
|
375
|
+
* (credential endpoint, or the component hostname). Everything else is optional
|
|
376
|
+
* so an app can test with as little as an endpoint + credential.
|
|
377
|
+
*/
|
|
378
|
+
interface TestConnectionContext {
|
|
379
|
+
appId: string;
|
|
380
|
+
customerId: string;
|
|
381
|
+
/** The connection's target endpoint / base URL, e.g. `https://splunk.internal:8089`. */
|
|
382
|
+
endpoint: string | null;
|
|
383
|
+
credential: CredentialRef | null;
|
|
384
|
+
component: ComponentRef | null;
|
|
385
|
+
connectivity: ConnectivityRef | null;
|
|
386
|
+
connectivityProvider: ConnectivityProviderRef | null;
|
|
387
|
+
settings: Record<string, unknown>;
|
|
388
|
+
/**
|
|
389
|
+
* App-only token broker for brokered (consent-onboarded) connections. A
|
|
390
|
+
* brokered connection's `credential` carries no secret, so its test handler
|
|
391
|
+
* mints a token via `ctx.identity.getAccessToken({ tenantId, resource })`
|
|
392
|
+
* instead of the per-credential client-credentials path. Optional and
|
|
393
|
+
* back-compatible: BYO-secret handlers ignore it.
|
|
394
|
+
*/
|
|
395
|
+
identity?: IdentityBroker;
|
|
396
|
+
}
|
|
397
|
+
/** Outcome of a connection test. `ok` gates the ✓/✗; `details` are extra lines. */
|
|
398
|
+
interface TestConnectionResult {
|
|
399
|
+
ok: boolean;
|
|
400
|
+
message: string;
|
|
401
|
+
/** Optional supporting lines (HTTP status, server version, auth result…). */
|
|
402
|
+
details?: string[];
|
|
403
|
+
/** Round-trip latency in milliseconds, when measured. */
|
|
404
|
+
latencyMs?: number;
|
|
405
|
+
}
|
|
406
|
+
type TestConnectionHandler = (ctx: TestConnectionContext) => Promise<TestConnectionResult>;
|
|
407
|
+
|
|
408
|
+
export type { TestConnectionHandler as A, TestConnectionResult as B, CanvasItemSnapshot as C, DeployContext as D, EnvironmentRef as E, ValidationError as F, GetStatusHandler as G, HealthCheck as H, ValidationResult as I, ValidationWarning as J, OptionItem as O, PipelineContext as P, RemoteExecutor as R, TestConnectionContext as T, UserRef as U, ValidateHandler as V, CanvasSectionSnapshot as a, CanvasSnapshot as b, ComponentConfigStatus as c, ComponentRef as d, ConfigStatus as e, ConnectivityRef as f, CredentialRef as g, DeployHandler as h, DeployResult as i, DeploymentStrategy as j, DeploymentSummary as k, DriftContext as l, DriftDetectHandler as m, DriftDiff as n, DriftResult as o, HealthCheckContext as p, HealthCheckHandler as q, HealthCheckResult as r, OptionsProvider as s, OptionsProviderContext as t, PlatformDataApi as u, RemoteIntent as v, RemoteResult as w, RollbackContext as x, RollbackHandler as y, RollbackResult as z };
|