@checkstack/common 0.0.2 → 0.0.3
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 +6 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/json-schema.ts +35 -0
- package/src/transport-client.ts +16 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic base JSON Schema property type.
|
|
3
|
+
* Uses a generic Self parameter for recursive properties to allow proper extension.
|
|
4
|
+
*/
|
|
5
|
+
export interface JsonSchemaPropertyCore<
|
|
6
|
+
Self = JsonSchemaPropertyCore<unknown>
|
|
7
|
+
> {
|
|
8
|
+
type?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
enum?: string[];
|
|
11
|
+
const?: string | number | boolean;
|
|
12
|
+
properties?: Record<string, Self>;
|
|
13
|
+
items?: Self;
|
|
14
|
+
required?: string[];
|
|
15
|
+
additionalProperties?: boolean | Self;
|
|
16
|
+
format?: string;
|
|
17
|
+
default?: unknown;
|
|
18
|
+
oneOf?: Self[];
|
|
19
|
+
anyOf?: Self[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Concrete base JSON Schema property type without extensions.
|
|
24
|
+
*/
|
|
25
|
+
export type JsonSchemaPropertyBase =
|
|
26
|
+
JsonSchemaPropertyCore<JsonSchemaPropertyBase>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Base JSON Schema type for object schemas.
|
|
30
|
+
*/
|
|
31
|
+
export interface JsonSchemaBase<TProp = JsonSchemaPropertyBase> {
|
|
32
|
+
type?: string;
|
|
33
|
+
properties?: Record<string, TProp>;
|
|
34
|
+
required?: string[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic transport client interface for remote command execution.
|
|
3
|
+
*
|
|
4
|
+
* Transport strategies (SSH, SNMP, WinRM) implement this interface to provide
|
|
5
|
+
* a consistent abstraction for collectors.
|
|
6
|
+
*
|
|
7
|
+
* @template TCommand - Command type (e.g., string for SSH, OidRequest for SNMP)
|
|
8
|
+
* @template TResult - Result type (e.g., { stdout, stderr, exitCode } for SSH)
|
|
9
|
+
*/
|
|
10
|
+
export interface TransportClient<TCommand, TResult> {
|
|
11
|
+
/**
|
|
12
|
+
* Execute a command on the remote host.
|
|
13
|
+
* The command and result types are defined by the transport implementation.
|
|
14
|
+
*/
|
|
15
|
+
exec(command: TCommand): Promise<TResult>;
|
|
16
|
+
}
|