@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.
Files changed (77) hide show
  1. package/README.md +1 -1
  2. package/dist/byol/index.cjs +3802 -0
  3. package/dist/byol/index.cjs.map +1 -0
  4. package/dist/byol/index.d.cts +578 -0
  5. package/dist/byol/index.d.ts +578 -0
  6. package/dist/byol/index.js +2587 -0
  7. package/dist/byol/index.js.map +1 -0
  8. package/dist/chunk-3WK4EVQ3.js +842 -0
  9. package/dist/chunk-3WK4EVQ3.js.map +1 -0
  10. package/dist/{chunk-EOOEHZGC.js → chunk-HIL6RIDG.js} +107 -3
  11. package/dist/chunk-HIL6RIDG.js.map +1 -0
  12. package/dist/{chunk-VWFTOFTI.js → chunk-Y6XBNZGR.js} +8 -2
  13. package/dist/chunk-Y6XBNZGR.js.map +1 -0
  14. package/dist/client/index.cjs +112 -2
  15. package/dist/client/index.cjs.map +1 -1
  16. package/dist/client/index.d.cts +118 -6
  17. package/dist/client/index.d.ts +118 -6
  18. package/dist/client/index.js +13 -1
  19. package/dist/connections/index.cjs +1787 -0
  20. package/dist/connections/index.cjs.map +1 -0
  21. package/dist/connections/index.d.cts +78 -0
  22. package/dist/connections/index.d.ts +78 -0
  23. package/dist/connections/index.js +754 -0
  24. package/dist/connections/index.js.map +1 -0
  25. package/dist/hooks/index.cjs.map +1 -1
  26. package/dist/hooks/index.d.cts +2 -2
  27. package/dist/hooks/index.d.ts +2 -2
  28. package/dist/hooks/index.js +1 -1
  29. package/dist/index.cjs +7 -0
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +3 -3
  32. package/dist/index.d.ts +3 -3
  33. package/dist/index.js +3 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/opentofu/index.cjs +138 -0
  36. package/dist/opentofu/index.cjs.map +1 -0
  37. package/dist/opentofu/index.d.cts +131 -0
  38. package/dist/opentofu/index.d.ts +131 -0
  39. package/dist/opentofu/index.js +109 -0
  40. package/dist/opentofu/index.js.map +1 -0
  41. package/dist/pipeline/index.cjs +7 -0
  42. package/dist/pipeline/index.cjs.map +1 -1
  43. package/dist/pipeline/index.d.cts +9 -2
  44. package/dist/pipeline/index.d.ts +9 -2
  45. package/dist/pipeline/index.js +3 -1
  46. package/dist/pipeline-beeT8dje.d.cts +408 -0
  47. package/dist/pipeline-beeT8dje.d.ts +408 -0
  48. package/dist/ui/index.cjs +136 -0
  49. package/dist/ui/index.cjs.map +1 -1
  50. package/dist/ui/index.d.cts +109 -1
  51. package/dist/ui/index.d.ts +109 -1
  52. package/dist/ui/index.js +35 -677
  53. package/dist/ui/index.js.map +1 -1
  54. package/dist/{use-app-context-OQlcmq7t.d.cts → use-app-context-Byv_fam0.d.cts} +206 -4
  55. package/dist/{use-app-context-OQlcmq7t.d.ts → use-app-context-Byv_fam0.d.ts} +206 -4
  56. package/opentofu/README.md +114 -0
  57. package/opentofu/modules/aws/main.tf +1008 -0
  58. package/opentofu/modules/aws/outputs.tf +90 -0
  59. package/opentofu/modules/aws/variables.tf +437 -0
  60. package/opentofu/modules/aws/versions.tf +23 -0
  61. package/opentofu/modules/azure/main.tf +920 -0
  62. package/opentofu/modules/azure/outputs.tf +72 -0
  63. package/opentofu/modules/azure/variables.tf +498 -0
  64. package/opentofu/modules/azure/versions.tf +27 -0
  65. package/opentofu/modules/gcp/main.tf +645 -0
  66. package/opentofu/modules/gcp/outputs.tf +73 -0
  67. package/opentofu/modules/gcp/variables.tf +428 -0
  68. package/opentofu/modules/gcp/versions.tf +27 -0
  69. package/opentofu/modules/hetzner/main.tf +432 -0
  70. package/opentofu/modules/hetzner/outputs.tf +72 -0
  71. package/opentofu/modules/hetzner/variables.tf +423 -0
  72. package/opentofu/modules/hetzner/versions.tf +26 -0
  73. package/package.json +33 -1
  74. package/dist/chunk-EOOEHZGC.js.map +0 -1
  75. package/dist/chunk-VWFTOFTI.js.map +0 -1
  76. package/dist/pipeline-A-gSsPRR.d.cts +0 -189
  77. package/dist/pipeline-A-gSsPRR.d.ts +0 -189
@@ -1,7 +1,7 @@
1
1
  import { ComponentType, LazyExoticComponent, Context } from 'react';
2
- import { B as InventoryItemInput, I as InventoryItem, v as ConnectivityProviderRef, x as CredentialInput, y as CredentialSummary, d as AppContextValue, p as AppPermissionsApi } from '../use-app-context-OQlcmq7t.js';
3
- export { b as AppBrandingDeclaration, w as Credential, P as PermissionCheckOptions, D as PermissionEntry } from '../use-app-context-OQlcmq7t.js';
4
- import { E as EnvironmentRef } from '../pipeline-A-gSsPRR.js';
2
+ import { F as InventoryItemInput, I as InventoryItem, y as ConnectivityProviderRef, B as CredentialInput, D as CredentialSummary, d as AppContextValue, r as AppPermissionsApi } from '../use-app-context-Byv_fam0.js';
3
+ export { b as AppBrandingDeclaration, z as Credential, P as PermissionCheckOptions, G as PermissionEntry } from '../use-app-context-Byv_fam0.js';
4
+ import { E as EnvironmentRef, B as TestConnectionResult } from '../pipeline-beeT8dje.js';
5
5
 
6
6
  /**
7
7
  * A platform Tool. Each installed app is upserted as a Tool keyed by its
@@ -18,8 +18,13 @@ interface Tool {
18
18
  * when creating an inventory item, so call this once and pass the id as
19
19
  * `toolId` to {@link addInventoryItem}. Returns null when no tool matches.
20
20
  *
21
- * GET /api/tools (the endpoint is paginated — `{ data, pagination }` — or a
22
- * bare array; both are handled).
21
+ * GET /api/tools (paginated — `{ data, pagination }` — or a bare array; both are
22
+ * handled). We MUST filter server-side by name: the list is paginated (default 20,
23
+ * ordered by createdAt) so once a tenant has enough apps installed, a bare
24
+ * client-side find over just the first page silently misses a real tool whose row
25
+ * fell to a later page — surfacing a false "no <app> tool found, install the app
26
+ * first" error for an app that is in fact installed. `search` is a case-insensitive
27
+ * contains match, so we still exact-match `tool.name === name` on the result.
23
28
  */
24
29
  declare function resolveTool(name: string): Promise<Tool | null>;
25
30
  /** List the customer's inventory (deployment targets). GET /api/components */
@@ -71,6 +76,113 @@ declare function updateCredential(id: string, input: Partial<CredentialInput>):
71
76
  /** Remove a credential. DELETE /api/credentials/:id. */
72
77
  declare function removeCredential(id: string): Promise<void>;
73
78
 
79
+ /**
80
+ * Test a Connection's endpoint + credential. The platform decrypts the secret,
81
+ * runs the owning app's connectivity-test handler in-process (the secret is
82
+ * never returned), and reports whether the endpoint + credentials actually work.
83
+ * A failed test resolves normally with `{ ok: false, message }` — it does not
84
+ * throw. Only transport/auth errors (401/404) surface as `{ ok: false }` too.
85
+ *
86
+ * @param appId the app that owns the connection, e.g. `splunk-cloud`
87
+ * @param credentialId the connection (credential) id
88
+ * @param opts.endpoint optional endpoint to test against instead of the one stored
89
+ * on the credential — e.g. an Access Server's reachable address
90
+ * (`<host>:<port>`). The host is scoped to the caller's tenant.
91
+ */
92
+ declare function testConnection(appId: string, credentialId: string, opts?: {
93
+ endpoint?: string;
94
+ }): Promise<TestConnectionResult>;
95
+ /** Result of running an app operation. Mirrors the server operation handler's return. */
96
+ interface OperationResult {
97
+ ok: boolean;
98
+ message: string;
99
+ details?: string[];
100
+ /** Optional structured payload (e.g. an export download URL, a job id). */
101
+ data?: Record<string, unknown>;
102
+ }
103
+ /**
104
+ * Run an app operation — a one-off action (restart, export, retry, …), NOT a
105
+ * configuration deploy. The platform decrypts the chosen connection's secret and
106
+ * runs the app's operation handler in-process (the secret is never returned). A
107
+ * failed operation resolves normally with `{ ok: false, message }` rather than
108
+ * throwing.
109
+ *
110
+ * @param appId the app that owns the operation, e.g. `splunk-cloud`
111
+ * @param operationId the operation id declared in the app manifest
112
+ * @param opts the connection (credentialId) to authenticate with, + params
113
+ */
114
+ declare function runOperation(appId: string, operationId: string, opts?: {
115
+ credentialId?: string;
116
+ params?: Record<string, unknown>;
117
+ }): Promise<OperationResult>;
118
+
119
+ /** The client-safe onboarding descriptor an app advertises in /apps/enabled. */
120
+ interface AppOnboardingDescriptor {
121
+ provider: string;
122
+ label: string;
123
+ brokered?: boolean;
124
+ requiredSettings?: string[];
125
+ }
126
+ /**
127
+ * Fetch an app's connection-onboarding descriptor from GET /api/apps/enabled,
128
+ * so the Connections UI can offer an "Integrate via OAuth" option without the
129
+ * app page having to pass it in. Returns null when the app declares no
130
+ * onboarding (its connections stay credential-only).
131
+ */
132
+ declare function fetchAppOnboarding(appId: string): Promise<AppOnboardingDescriptor | null>;
133
+ interface StartOnboardingInput {
134
+ /** The deployment scope (environment) the new connection belongs to. */
135
+ environmentId: string;
136
+ /** Display name for the new connection. */
137
+ connectionName: string;
138
+ /**
139
+ * Settings the admin supplies BEFORE consent (e.g. Sentinel's
140
+ * subscription_id / resource_group / workspace_name, or a cloud override).
141
+ */
142
+ settings?: Record<string, unknown>;
143
+ }
144
+ interface StartOnboardingResult {
145
+ /** Open this in the browser — the provider's hosted consent page. */
146
+ authorizeUrl: string;
147
+ provider: string;
148
+ }
149
+ /** Begin onboarding a connection. POST /api/apps/:appId/connections/onboard/start. */
150
+ declare function startOnboarding(appId: string, input: StartOnboardingInput): Promise<StartOnboardingResult>;
151
+ interface OnboardingStatus {
152
+ provider: string;
153
+ brokered: boolean;
154
+ tenantId: string | null;
155
+ cloud: string;
156
+ manualSteps: Array<{
157
+ type: string;
158
+ title: string;
159
+ description: string;
160
+ deepLink?: string;
161
+ cliCommand?: string;
162
+ verifiable: boolean;
163
+ }>;
164
+ verify?: {
165
+ effective: boolean;
166
+ message: string;
167
+ };
168
+ }
169
+ /**
170
+ * Read onboarding status for a connection, optionally running the verify probe
171
+ * for pending manual steps (e.g. the Sentinel role assignment).
172
+ * GET /api/apps/:appId/connections/:credentialId/onboard/status.
173
+ */
174
+ declare function getOnboardingStatus(appId: string, credentialId: string, opts?: {
175
+ verify?: boolean;
176
+ }): Promise<OnboardingStatus>;
177
+ /**
178
+ * Disconnect an onboarded connection (best-effort tenant-side teardown, then
179
+ * delete). POST /api/apps/:appId/connections/:credentialId/onboard/revoke.
180
+ */
181
+ declare function revokeOnboarding(appId: string, credentialId: string): Promise<{
182
+ cleaned: boolean;
183
+ message: string;
184
+ }>;
185
+
74
186
  /** Name of the global the platform installs before loading app bundles. */
75
187
  declare const HOST_RUNTIME_GLOBAL = "__VELTRIX_APP_RUNTIME__";
76
188
  /**
@@ -141,4 +253,4 @@ interface AppClientModule {
141
253
  sidebarItems?: AppSidebarItem[];
142
254
  }
143
255
 
144
- export { type AppClientModule, AppPermissionsApi, type AppSidebarItem, ConnectivityProviderRef, CredentialInput, CredentialSummary, EnvironmentRef, HOST_RUNTIME_GLOBAL, InventoryItem, InventoryItemInput, type Tool, type VeltrixHostRuntime, addInventoryItem, authFetch, createCredential, getHostRuntime, listConnectivityProviders, listCredentials, listEnvironments, listInventory, removeCredential, removeInventoryItem, requireHostRuntime, resolveTool, updateCredential, updateInventoryItem };
256
+ export { type AppClientModule, type AppOnboardingDescriptor, AppPermissionsApi, type AppSidebarItem, ConnectivityProviderRef, CredentialInput, CredentialSummary, EnvironmentRef, HOST_RUNTIME_GLOBAL, InventoryItem, InventoryItemInput, type OnboardingStatus, type OperationResult, type StartOnboardingInput, type StartOnboardingResult, TestConnectionResult, type Tool, type VeltrixHostRuntime, addInventoryItem, authFetch, createCredential, fetchAppOnboarding, getHostRuntime, getOnboardingStatus, listConnectivityProviders, listCredentials, listEnvironments, listInventory, removeCredential, removeInventoryItem, requireHostRuntime, resolveTool, revokeOnboarding, runOperation, startOnboarding, testConnection, updateCredential, updateInventoryItem };
@@ -3,7 +3,9 @@ import {
3
3
  addInventoryItem,
4
4
  authFetch,
5
5
  createCredential,
6
+ fetchAppOnboarding,
6
7
  getHostRuntime,
8
+ getOnboardingStatus,
7
9
  listConnectivityProviders,
8
10
  listCredentials,
9
11
  listEnvironments,
@@ -12,15 +14,21 @@ import {
12
14
  removeInventoryItem,
13
15
  requireHostRuntime,
14
16
  resolveTool,
17
+ revokeOnboarding,
18
+ runOperation,
19
+ startOnboarding,
20
+ testConnection,
15
21
  updateCredential,
16
22
  updateInventoryItem
17
- } from "../chunk-EOOEHZGC.js";
23
+ } from "../chunk-HIL6RIDG.js";
18
24
  export {
19
25
  HOST_RUNTIME_GLOBAL,
20
26
  addInventoryItem,
21
27
  authFetch,
22
28
  createCredential,
29
+ fetchAppOnboarding,
23
30
  getHostRuntime,
31
+ getOnboardingStatus,
24
32
  listConnectivityProviders,
25
33
  listCredentials,
26
34
  listEnvironments,
@@ -29,6 +37,10 @@ export {
29
37
  removeInventoryItem,
30
38
  requireHostRuntime,
31
39
  resolveTool,
40
+ revokeOnboarding,
41
+ runOperation,
42
+ startOnboarding,
43
+ testConnection,
32
44
  updateCredential,
33
45
  updateInventoryItem
34
46
  };