@infrascan/s3-connector 0.3.0 → 0.3.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/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { S3Client, PutObjectCommandOutput } from '@aws-sdk/client-s3';
|
|
2
|
+
import { Connector } from '@infrascan/shared-types';
|
|
2
3
|
import Cache from './cache.mjs';
|
|
3
4
|
|
|
4
5
|
interface ConstructorArgs {
|
|
@@ -7,7 +8,7 @@ interface ConstructorArgs {
|
|
|
7
8
|
bucket: string;
|
|
8
9
|
cacheLimit?: number;
|
|
9
10
|
}
|
|
10
|
-
declare class S3Connector {
|
|
11
|
+
declare class S3Connector implements Connector {
|
|
11
12
|
S3: S3Client;
|
|
12
13
|
prefix: string;
|
|
13
14
|
bucket: string;
|
|
@@ -23,7 +24,7 @@ declare class S3Connector {
|
|
|
23
24
|
* - /Lambda-listFunctions/1234567890/us-east-1.json can be listed by function which allows for cross account resolution
|
|
24
25
|
*/
|
|
25
26
|
buildFilePathForServiceCall(account: string, region: string, service: string, functionName: string): string;
|
|
26
|
-
onServiceScanCompleteCallback(account: string, region: string, service: string, functionName: string, functionState: any): Promise<
|
|
27
|
+
onServiceScanCompleteCallback(account: string, region: string, service: string, functionName: string, functionState: any): Promise<void>;
|
|
27
28
|
resolveStateForServiceFunction(account: string, region: string, service: string, functionCall: string): Promise<any>;
|
|
28
29
|
listObjectsForService(service: string, functionCall: string): Promise<Array<string>>;
|
|
29
30
|
getGlobalStateForServiceFunction(service: string, functionCall: string): Promise<Array<any | undefined>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { S3Client, PutObjectCommandOutput } from '@aws-sdk/client-s3';
|
|
2
|
+
import { Connector } from '@infrascan/shared-types';
|
|
2
3
|
import Cache from './cache.js';
|
|
3
4
|
|
|
4
5
|
interface ConstructorArgs {
|
|
@@ -7,7 +8,7 @@ interface ConstructorArgs {
|
|
|
7
8
|
bucket: string;
|
|
8
9
|
cacheLimit?: number;
|
|
9
10
|
}
|
|
10
|
-
declare class S3Connector {
|
|
11
|
+
declare class S3Connector implements Connector {
|
|
11
12
|
S3: S3Client;
|
|
12
13
|
prefix: string;
|
|
13
14
|
bucket: string;
|
|
@@ -23,7 +24,7 @@ declare class S3Connector {
|
|
|
23
24
|
* - /Lambda-listFunctions/1234567890/us-east-1.json can be listed by function which allows for cross account resolution
|
|
24
25
|
*/
|
|
25
26
|
buildFilePathForServiceCall(account: string, region: string, service: string, functionName: string): string;
|
|
26
|
-
onServiceScanCompleteCallback(account: string, region: string, service: string, functionName: string, functionState: any): Promise<
|
|
27
|
+
onServiceScanCompleteCallback(account: string, region: string, service: string, functionName: string, functionState: any): Promise<void>;
|
|
27
28
|
resolveStateForServiceFunction(account: string, region: string, service: string, functionCall: string): Promise<any>;
|
|
28
29
|
listObjectsForService(service: string, functionCall: string): Promise<Array<string>>;
|
|
29
30
|
getGlobalStateForServiceFunction(service: string, functionCall: string): Promise<Array<any | undefined>>;
|
package/dist/index.js
CHANGED
|
@@ -95,14 +95,14 @@ var S3Connector = class {
|
|
|
95
95
|
buildFilePathForServiceCall(account, region, service, functionName) {
|
|
96
96
|
return `${this.prefix}/${service}-${functionName}/${account}/${region}.json`;
|
|
97
97
|
}
|
|
98
|
-
onServiceScanCompleteCallback(account, region, service, functionName, functionState) {
|
|
98
|
+
async onServiceScanCompleteCallback(account, region, service, functionName, functionState) {
|
|
99
99
|
const filePath = this.buildFilePathForServiceCall(
|
|
100
100
|
account,
|
|
101
101
|
region,
|
|
102
102
|
service,
|
|
103
103
|
functionName
|
|
104
104
|
);
|
|
105
|
-
|
|
105
|
+
await this.recordServiceCall(filePath, functionState);
|
|
106
106
|
}
|
|
107
107
|
resolveStateForServiceFunction(account, region, service, functionCall) {
|
|
108
108
|
const filePath = this.buildFilePathForServiceCall(
|
package/dist/index.mjs
CHANGED
|
@@ -75,14 +75,14 @@ var S3Connector = class {
|
|
|
75
75
|
buildFilePathForServiceCall(account, region, service, functionName) {
|
|
76
76
|
return `${this.prefix}/${service}-${functionName}/${account}/${region}.json`;
|
|
77
77
|
}
|
|
78
|
-
onServiceScanCompleteCallback(account, region, service, functionName, functionState) {
|
|
78
|
+
async onServiceScanCompleteCallback(account, region, service, functionName, functionState) {
|
|
79
79
|
const filePath = this.buildFilePathForServiceCall(
|
|
80
80
|
account,
|
|
81
81
|
region,
|
|
82
82
|
service,
|
|
83
83
|
functionName
|
|
84
84
|
);
|
|
85
|
-
|
|
85
|
+
await this.recordServiceCall(filePath, functionState);
|
|
86
86
|
}
|
|
87
87
|
resolveStateForServiceFunction(account, region, service, functionCall) {
|
|
88
88
|
const filePath = this.buildFilePathForServiceCall(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrascan/s3-connector",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Connector for the Infrascan SDK to read and write state to an S3 bucket",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"license": "MPL-2.0",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@aws-sdk/util-stream-node": "^3.374.0",
|
|
35
|
-
"@infrascan/shared-types": "^0.6.
|
|
35
|
+
"@infrascan/shared-types": "^0.6.2",
|
|
36
36
|
"aws-sdk-client-mock": "^3.0.0",
|
|
37
37
|
"eslint-config-custom": "*",
|
|
38
|
-
"tap": "^
|
|
38
|
+
"tap": "^21",
|
|
39
39
|
"tsconfig": "*",
|
|
40
|
-
"typescript": "^5.
|
|
40
|
+
"typescript": "^5.4.5"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@aws-sdk/client-s3": "3.624.0",
|