@infrascan/shared-types 0.6.1 → 0.7.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/CHANGELOG.md +12 -0
- package/package.json +3 -3
- package/src/graph.ts +4 -16
- package/src/plugins.ts +2 -2
- package/src/scan.ts +69 -17
- package/tsconfig.json +2 -1
- package/.eslintrc.js +0 -9
- package/typedoc.json +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @infrascan/shared-types
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#123](https://github.com/infrascan/infrascan/pull/123) [`d05dc6ffe36f6b219964407b63b002520cf89795`](https://github.com/infrascan/infrascan/commit/d05dc6ffe36f6b219964407b63b002520cf89795) Thanks [@lfarrel6](https://github.com/lfarrel6)! - Introduce informational node support
|
|
8
|
+
|
|
9
|
+
## 0.6.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#110](https://github.com/infrascan/infrascan/pull/110) [`6238e6eb0cd1299607dd788ab385215a1aee3c39`](https://github.com/infrascan/infrascan/commit/6238e6eb0cd1299607dd788ab385215a1aee3c39) Thanks [@lfarrel6](https://github.com/lfarrel6)! - Improve typescript interfaces — correct api for s3 connector to better adhere to interface, tidy up type imports for shared types lib
|
|
14
|
+
|
|
3
15
|
## 0.6.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrascan/shared-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Shared types for multiple infrascan packages",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"@aws-sdk/types": "3.609.0",
|
|
16
16
|
"eslint-config-custom": "*",
|
|
17
17
|
"tsconfig": "*",
|
|
18
|
-
"typescript": "^5.
|
|
18
|
+
"typescript": "^5.4.5"
|
|
19
19
|
}
|
|
20
|
-
}
|
|
20
|
+
}
|
package/src/graph.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseState } from "./scan";
|
|
1
|
+
import type { BaseState } from "./scan";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A node returned from a state selector before its been formatted for a graphing library
|
|
@@ -24,9 +24,9 @@ export interface SelectedEdge {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// Create Read/Write types inspired by kysely
|
|
27
|
-
export type ElementType<
|
|
28
|
-
readonly _read:
|
|
29
|
-
readonly _write:
|
|
27
|
+
export type ElementType<RType, WType> = {
|
|
28
|
+
readonly _read: RType;
|
|
29
|
+
readonly _write: WType;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -56,18 +56,6 @@ export interface Node extends BaseState<unknown> {
|
|
|
56
56
|
outgoingEdges: ElementRecord<string, Edge, string>;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export interface NodeOld {
|
|
60
|
-
id: string;
|
|
61
|
-
name: string;
|
|
62
|
-
metadata: Record<string, unknown>;
|
|
63
|
-
service?: string;
|
|
64
|
-
type?: string;
|
|
65
|
-
parent?: ElementType<Node, string>;
|
|
66
|
-
children?: ElementRecord<string, Node, string>;
|
|
67
|
-
incomingEdges: ElementRecord<string, Edge, string>;
|
|
68
|
-
outgoingEdges: ElementRecord<string, Edge, string>;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
59
|
export interface Edge {
|
|
72
60
|
id: string;
|
|
73
61
|
name?: string;
|
package/src/plugins.ts
CHANGED
package/src/scan.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AwsContext, Connector } from "./api";
|
|
1
|
+
import type { AwsContext, Connector } from "./api";
|
|
2
2
|
|
|
3
3
|
export interface CommandCallMetadata {
|
|
4
4
|
account: string;
|
|
@@ -35,22 +35,36 @@ export interface Coordinates {
|
|
|
35
35
|
z?: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Indicates how the node should be consumed.
|
|
40
|
+
*
|
|
41
|
+
* - Informational nodes are not likely to be useful when rendered, but may include useful insights for infrastructure comprehension. Informational nodes are unlikely to have edges.
|
|
42
|
+
* - Visual nodes should be considered a superset of informational nodes - they convey information and can be rendered in an obvious way.
|
|
43
|
+
*/
|
|
44
|
+
export type NodeClass = "informational" | "visual";
|
|
45
|
+
|
|
38
46
|
/**
|
|
39
47
|
* Details about the nodes position in the graph and how it relates to other components
|
|
40
48
|
*/
|
|
41
49
|
export interface GraphInfo {
|
|
42
50
|
/**
|
|
43
51
|
* The unique ID of the node in the graph
|
|
52
|
+
* @deprecated Use Resource.id instead
|
|
44
53
|
*/
|
|
45
54
|
id: string;
|
|
46
55
|
/**
|
|
47
56
|
* The human readable name of the node in the graph
|
|
57
|
+
* @deprecated Use Resource.name instead
|
|
48
58
|
*/
|
|
49
59
|
label: string;
|
|
50
60
|
/**
|
|
51
61
|
* The type of the node, used for assigning an icon in the graph
|
|
52
62
|
*/
|
|
53
63
|
nodeType: string;
|
|
64
|
+
/**
|
|
65
|
+
* Indicates if the node is intended to be rendered or used for infrastructure comprehension.
|
|
66
|
+
*/
|
|
67
|
+
nodeClass: NodeClass;
|
|
54
68
|
/**
|
|
55
69
|
* The ID of the parent node, optional.
|
|
56
70
|
*/
|
|
@@ -155,6 +169,57 @@ export interface DNS {
|
|
|
155
169
|
|
|
156
170
|
export type PublicIpStatus = "enabled" | "disabled";
|
|
157
171
|
|
|
172
|
+
export type AddressFamily = "ipv4" | "ipv6";
|
|
173
|
+
|
|
174
|
+
export interface ReservedAddresses {
|
|
175
|
+
family: AddressFamily;
|
|
176
|
+
cidrBlock: string;
|
|
177
|
+
cidrBlockAssociationSets?: [
|
|
178
|
+
{
|
|
179
|
+
associationId: string;
|
|
180
|
+
cidrBlock: string;
|
|
181
|
+
state: string;
|
|
182
|
+
stateMessage: string;
|
|
183
|
+
},
|
|
184
|
+
];
|
|
185
|
+
firstAddress?: string;
|
|
186
|
+
lastAddress?: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface IpRange {
|
|
190
|
+
family?: AddressFamily;
|
|
191
|
+
cidrBlock?: string;
|
|
192
|
+
description?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface ReferencedAwsSecurityGroup {
|
|
196
|
+
description?: string;
|
|
197
|
+
securityGroupId?: string;
|
|
198
|
+
securityGroupName?: string;
|
|
199
|
+
referencedAccountId?: string;
|
|
200
|
+
referencedVpcId?: string;
|
|
201
|
+
vpcPeeringStatus?: string;
|
|
202
|
+
vpcPeeringConnectionId?: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface PrefixLists {
|
|
206
|
+
description?: string;
|
|
207
|
+
prefixListId?: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface AwsNetworkingRules {
|
|
211
|
+
referencedSecurityGroups?: ReferencedAwsSecurityGroup[];
|
|
212
|
+
prefixLists?: PrefixLists[];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface NetworkRule {
|
|
216
|
+
fromPort?: number;
|
|
217
|
+
toPort?: number;
|
|
218
|
+
protocol?: string;
|
|
219
|
+
permittedIpRanges?: IpRange[];
|
|
220
|
+
awsConfig?: AwsNetworkingRules;
|
|
221
|
+
}
|
|
222
|
+
|
|
158
223
|
/**
|
|
159
224
|
* The network information for a scanned resource which aims to cover both resources being assigned an address
|
|
160
225
|
* and the networking resource itself (VPC, subnet)
|
|
@@ -185,26 +250,12 @@ export interface Network {
|
|
|
185
250
|
/**
|
|
186
251
|
* The IP ranges reserved for a networking resource (VPC, subnet)
|
|
187
252
|
*/
|
|
188
|
-
reservedAddresses?: [
|
|
189
|
-
{
|
|
190
|
-
family: "ipv4" | "ipv6";
|
|
191
|
-
cidrBlock: string;
|
|
192
|
-
cidrBlockAssociationSets?: [
|
|
193
|
-
{
|
|
194
|
-
associationId: string;
|
|
195
|
-
cidrBlock: string;
|
|
196
|
-
state: string;
|
|
197
|
-
stateMessage: string;
|
|
198
|
-
},
|
|
199
|
-
];
|
|
200
|
-
firstAddress: string;
|
|
201
|
-
lastAddress: string;
|
|
202
|
-
},
|
|
203
|
-
];
|
|
253
|
+
reservedAddresses?: ReservedAddresses[];
|
|
204
254
|
/**
|
|
205
255
|
* The information relating to a specific subnet
|
|
206
256
|
*/
|
|
207
257
|
subnet?: {
|
|
258
|
+
state?: string;
|
|
208
259
|
ipv6Only?: boolean;
|
|
209
260
|
availableAddressCount?: number;
|
|
210
261
|
};
|
|
@@ -223,6 +274,7 @@ export interface Network {
|
|
|
223
274
|
interfaceId?: string;
|
|
224
275
|
macAddress?: string;
|
|
225
276
|
};
|
|
277
|
+
rules?: NetworkRule[];
|
|
226
278
|
}
|
|
227
279
|
|
|
228
280
|
/**
|
package/tsconfig.json
CHANGED
package/.eslintrc.js
DELETED
package/typedoc.json
DELETED