@infrascan/shared-types 0.5.0 → 0.5.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @infrascan/shared-types
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#84](https://github.com/infrascan/infrascan/pull/84) [`437026c`](https://github.com/infrascan/infrascan/commit/437026cc278ec4b380bcaf3a7a675f3762ce3bea) Thanks [@lfarrel6](https://github.com/lfarrel6)! - Bump aws client sdk versions to remove vulnerable dependency
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrascan/shared-types",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Shared types for multiple infrascan packages",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "author": "Liam Farrelly <liam@l3f7.dev> (https://whoisli.am/)",
13
13
  "license": "MPL-2.0",
14
14
  "devDependencies": {
15
- "@aws-sdk/types": "3.428.0",
15
+ "@aws-sdk/types": "3.609.0",
16
16
  "eslint-config-custom": "*",
17
17
  "tsconfig": "*",
18
18
  "typescript": "^5.1.6"
package/src/api.ts CHANGED
@@ -1,4 +1,8 @@
1
- import type { AwsCredentialIdentityProvider, RetryStrategy, RetryStrategyV2 } from "@aws-sdk/types";
1
+ import type {
2
+ AwsCredentialIdentityProvider,
3
+ RetryStrategy,
4
+ RetryStrategyV2,
5
+ } from "@aws-sdk/types";
2
6
 
3
7
  import type { SelectedEdge, SelectedNode } from "./graph";
4
8
  import type { BaseEdgeResolver } from "./config";
@@ -73,7 +77,7 @@ export interface Connector {
73
77
  type ClientBuilder<T, P extends Provider> = (
74
78
  credentials: AwsCredentialIdentityProvider,
75
79
  context: ProviderContextMap[P],
76
- retryStrategy?: RetryStrategy | RetryStrategyV2
80
+ retryStrategy?: RetryStrategy | RetryStrategyV2,
77
81
  ) => T;
78
82
 
79
83
  type GetterFn<T, P extends Provider> = (
package/src/config.ts CHANGED
@@ -47,10 +47,8 @@ export type BaseScannerDefinition = {
47
47
  };
48
48
 
49
49
  type AsCommand<S extends string> = `${S}Command`;
50
- export type AvailableCommand<
51
- Serv extends object,
52
- Funcs extends string,
53
- > = AsCommand<Funcs> extends `${infer P}Command` & keyof Serv ? P : never;
50
+ export type AvailableCommand<Serv extends object, Funcs extends string> =
51
+ AsCommand<Funcs> extends `${infer P}Command` & keyof Serv ? P : never;
54
52
 
55
53
  export type StateSelector<
56
54
  ServiceName extends string,
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./api";
2
2
  export * from "./config";
3
3
  export * from "./graph";
4
- export * from "./scan";
5
- export * from "./plugins";
4
+ export * from "./plugins";
5
+ export * from "./scan";
package/src/plugins.ts CHANGED
@@ -2,25 +2,39 @@ import { Graph } from "./graph";
2
2
  import { AwsContext } from "./api";
3
3
 
4
4
  // All supported events to trigger a plugin
5
- export type GraphPluginEvents = "onServiceComplete" | "onRegionComplete" | "onAccountComplete" | "onGraphComplete";
5
+ export type GraphPluginEvents =
6
+ | "onServiceComplete"
7
+ | "onRegionComplete"
8
+ | "onAccountComplete"
9
+ | "onGraphComplete";
6
10
 
7
11
  /**
8
12
  * A plugin which is called everytime a service's nodes have been added to the graph.
9
13
  * Receives the current graph state, the service ID, and the current AWS Context.
10
14
  */
11
- export type OnServiceCompletePlugin = (graph: Graph, service: string, context: AwsContext) => void | Promise<void>;
15
+ export type OnServiceCompletePlugin = (
16
+ graph: Graph,
17
+ service: string,
18
+ context: AwsContext,
19
+ ) => void | Promise<void>;
12
20
 
13
21
  /**
14
22
  * A plugin which is called everytime a region's nodes have been added to the graph.
15
23
  * Receives the current graph state, and the current AWS Context.
16
24
  */
17
- export type OnRegionCompletePlugin = (graph: Graph, context: AwsContext) => void | Promise<void>;
25
+ export type OnRegionCompletePlugin = (
26
+ graph: Graph,
27
+ context: AwsContext,
28
+ ) => void | Promise<void>;
18
29
 
19
30
  /**
20
31
  * A plugin which is called everytime an account's nodes have been added to the graph.
21
32
  * Receives the current graph state, and the current AWS Context.
22
33
  */
23
- export type OnAccountCompletePlugin = (graph: Graph, context: AwsContext) => void | Promise<void>;
34
+ export type OnAccountCompletePlugin = (
35
+ graph: Graph,
36
+ context: AwsContext,
37
+ ) => void | Promise<void>;
24
38
 
25
39
  /**
26
40
  * A plugin which is called when the entire graph has been generated.
@@ -29,14 +43,14 @@ export type OnAccountCompletePlugin = (graph: Graph, context: AwsContext) => voi
29
43
  export type OnGraphCompletePlugin = (graph: Graph) => void | Promise<void>;
30
44
 
31
45
  export type PluginEventHandlerTypes = {
32
- "onServiceComplete": OnServiceCompletePlugin,
33
- "onRegionComplete": OnRegionCompletePlugin,
34
- "onAccountComplete": OnAccountCompletePlugin,
35
- "onGraphComplete": OnGraphCompletePlugin,
46
+ onServiceComplete: OnServiceCompletePlugin;
47
+ onRegionComplete: OnRegionCompletePlugin;
48
+ onAccountComplete: OnAccountCompletePlugin;
49
+ onGraphComplete: OnGraphCompletePlugin;
36
50
  };
37
51
 
38
52
  export interface GraphPlugin<E extends GraphPluginEvents> {
39
- id: string,
40
- event: E,
41
- handler: PluginEventHandlerTypes[E]
42
- }
53
+ id: string;
54
+ event: E;
55
+ handler: PluginEventHandlerTypes[E];
56
+ }