@8ms/helpers 2.4.10 → 2.4.11
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/_class/BaseClass.cjs +31 -21
- package/dist/_class/BaseClass.mjs +31 -21
- package/dist/_class/BaseNamespace.cjs +10 -9
- package/dist/_class/BaseNamespace.mjs +10 -9
- package/dist/api/ApiResponseClass.cjs +96 -96
- package/dist/api/ApiResponseClass.mjs +96 -96
- package/dist/aws/cloudWatchLog/server/AwsCloudWatchLogNamespace.cjs +70 -60
- package/dist/aws/cloudWatchLog/server/AwsCloudWatchLogNamespace.mjs +70 -60
- package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetricNamespace.cjs +30 -28
- package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetricNamespace.mjs +30 -28
- package/dist/aws/ec2/server/AwsEc2Namespace.cjs +29 -32
- package/dist/aws/ec2/server/AwsEc2Namespace.mjs +29 -32
- package/dist/aws/ecs/server/AwsEcsNamespace.cjs +92 -78
- package/dist/aws/ecs/server/AwsEcsNamespace.mjs +92 -78
- package/dist/aws/glue/server/AwsGlueNamespace.cjs +17 -17
- package/dist/aws/glue/server/AwsGlueNamespace.mjs +17 -17
- package/dist/aws/lambda/server/AwsLambdaNamespace.cjs +33 -31
- package/dist/aws/lambda/server/AwsLambdaNamespace.mjs +33 -31
- package/dist/aws/s3/server/AwsS3Namespace.cjs +280 -265
- package/dist/aws/s3/server/AwsS3Namespace.mjs +280 -265
- package/dist/aws/ses/server/AwsSesNamespace.cjs +27 -30
- package/dist/aws/ses/server/AwsSesNamespace.mjs +27 -30
- package/dist/aws/ses/server/SimpleEmail.cjs +202 -199
- package/dist/aws/ses/server/SimpleEmail.mjs +202 -199
- package/dist/aws/sqs/server/AwsSqsNamespace.cjs +35 -38
- package/dist/aws/sqs/server/AwsSqsNamespace.mjs +35 -38
- package/dist/aws/ssm/server/AwsSsmNamespace.cjs +24 -23
- package/dist/aws/ssm/server/AwsSsmNamespace.mjs +24 -23
- package/dist/date/index.cjs +1 -1
- package/dist/date/index.mjs +1 -1
- package/dist/drizzle/server/DrizzleNamespace.cjs +39 -42
- package/dist/drizzle/server/DrizzleNamespace.mjs +39 -42
- package/dist/googleAds/server/GoogleAdsNamespace.cjs +21 -24
- package/dist/googleAds/server/GoogleAdsNamespace.mjs +21 -24
- package/dist/googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.cjs +86 -70
- package/dist/googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.mjs +86 -70
- package/dist/googleCloud/sheets/server/GoogleCloudSheetsNamespace.cjs +22 -25
- package/dist/googleCloud/sheets/server/GoogleCloudSheetsNamespace.mjs +22 -25
- package/dist/googleCloud/storage/server/GoogleCloudStorageNamespace.cjs +44 -38
- package/dist/googleCloud/storage/server/GoogleCloudStorageNamespace.mjs +44 -38
- package/dist/googlePageSpeed/server/GooglePageSpeedNamespace.cjs +12 -15
- package/dist/googlePageSpeed/server/GooglePageSpeedNamespace.mjs +12 -15
- package/dist/littleWarden/server/LittleWardenNamespace.cjs +12 -15
- package/dist/littleWarden/server/LittleWardenNamespace.mjs +12 -15
- package/dist/onePassword/server/OnePasswordNamespace.cjs +30 -33
- package/dist/onePassword/server/OnePasswordNamespace.mjs +30 -33
- package/dist/openAi/server/OpenAiNamespace.cjs +20 -20
- package/dist/openAi/server/OpenAiNamespace.mjs +20 -20
- package/dist/prisma/server/PrismaNamespace.cjs +35 -38
- package/dist/prisma/server/PrismaNamespace.mjs +35 -38
- package/dist/snapchat/server/SnapchatNamespace.cjs +12 -12
- package/dist/snapchat/server/SnapchatNamespace.mjs +12 -12
- package/dist/upTimeRobot/server/UpTimeRobotNamespace.cjs +19 -19
- package/dist/upTimeRobot/server/UpTimeRobotNamespace.mjs +19 -19
- package/package.json +1 -1
|
@@ -4,86 +4,100 @@ const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs
|
|
|
4
4
|
require("../../server/index.cjs");
|
|
5
5
|
//#region src/aws/ecs/server/AwsEcsNamespace.ts
|
|
6
6
|
var AwsEcsNamespace = class extends require__class_BaseNamespace.BaseNamespace {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
apiResponse
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
await this.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (require_aws_server_isResponse200.isResponse200(apiResponse)) response = [...response, ...apiResponse.taskArns];
|
|
68
|
-
}
|
|
69
|
-
return response;
|
|
70
|
-
};
|
|
71
|
-
this.runTask = async (props) => {
|
|
72
|
-
await this.ensureInit();
|
|
73
|
-
const { RunTaskCommand } = await import("@aws-sdk/client-ecs");
|
|
74
|
-
let response = false;
|
|
75
|
-
const runtTaskCommand = new RunTaskCommand({
|
|
7
|
+
ensureInit = async () => {
|
|
8
|
+
if (!this.client) try {
|
|
9
|
+
const { ECSClient } = await import("@aws-sdk/client-ecs");
|
|
10
|
+
this.client = new ECSClient(this.config);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw new Error("AWS ECS Client not installed");
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListClustersCommand/
|
|
17
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListClustersCommandInput/
|
|
18
|
+
*/
|
|
19
|
+
getClusters = async (maxResults) => {
|
|
20
|
+
await this.ensureInit();
|
|
21
|
+
const { ListClustersCommand } = await import("@aws-sdk/client-ecs");
|
|
22
|
+
let response = [];
|
|
23
|
+
let apiResponse = null;
|
|
24
|
+
while (null === apiResponse || apiResponse?.nextToken) {
|
|
25
|
+
const listClustersCommand = new ListClustersCommand({
|
|
26
|
+
maxResults,
|
|
27
|
+
nextToken: apiResponse?.nextToken
|
|
28
|
+
});
|
|
29
|
+
apiResponse = await this.client.send(listClustersCommand);
|
|
30
|
+
if (require_aws_server_isResponse200.isResponse200(apiResponse)) response = [...response, ...apiResponse.clusterArns];
|
|
31
|
+
}
|
|
32
|
+
return response;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListTaskDefinitionsCommand/
|
|
36
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListTaskDefinitionsCommandInput/
|
|
37
|
+
*/
|
|
38
|
+
getTaskDefinitions = async (props) => {
|
|
39
|
+
await this.ensureInit();
|
|
40
|
+
const { ListTaskDefinitionsCommand } = await import("@aws-sdk/client-ecs");
|
|
41
|
+
let response = [];
|
|
42
|
+
let apiResponse = null;
|
|
43
|
+
while (null === apiResponse || apiResponse?.nextToken) {
|
|
44
|
+
const listTaskDefinitionsCommand = new ListTaskDefinitionsCommand({
|
|
45
|
+
maxResults: props?.maxResults,
|
|
46
|
+
familyPrefix: props?.familyPrefix,
|
|
47
|
+
sort: props?.sort,
|
|
48
|
+
status: props?.status,
|
|
49
|
+
nextToken: apiResponse?.nextToken
|
|
50
|
+
});
|
|
51
|
+
apiResponse = await this.client.send(listTaskDefinitionsCommand);
|
|
52
|
+
if (require_aws_server_isResponse200.isResponse200(apiResponse)) response = [...response, ...apiResponse.taskDefinitionArns];
|
|
53
|
+
}
|
|
54
|
+
return response;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListTasksCommand/
|
|
58
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListTasksCommandInput/
|
|
59
|
+
*/
|
|
60
|
+
getTasks = async (props) => {
|
|
61
|
+
await this.ensureInit();
|
|
62
|
+
const { ListTasksCommand } = await import("@aws-sdk/client-ecs");
|
|
63
|
+
let response = [];
|
|
64
|
+
let apiResponse = null;
|
|
65
|
+
while (null === apiResponse || apiResponse?.nextToken) {
|
|
66
|
+
const listTasksCommand = new ListTasksCommand({
|
|
76
67
|
cluster: props?.cluster,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
containerInstance: props?.containerInstance,
|
|
69
|
+
desiredStatus: props?.desiredStatus,
|
|
70
|
+
family: props?.family,
|
|
71
|
+
maxResults: props?.maxResults,
|
|
72
|
+
nextToken: apiResponse?.nextToken,
|
|
73
|
+
serviceName: props?.serviceName,
|
|
74
|
+
startedBy: props?.startedBy
|
|
81
75
|
});
|
|
82
|
-
|
|
83
|
-
if (require_aws_server_isResponse200.isResponse200(apiResponse)) response = apiResponse;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
76
|
+
apiResponse = await this.client.send(listTasksCommand);
|
|
77
|
+
if (require_aws_server_isResponse200.isResponse200(apiResponse)) response = [...response, ...apiResponse.taskArns];
|
|
78
|
+
}
|
|
79
|
+
return response;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Initialise and run a task
|
|
83
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/RunTaskCommand/
|
|
84
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/RunTaskCommandInput/
|
|
85
|
+
*/
|
|
86
|
+
runTask = async (props) => {
|
|
87
|
+
await this.ensureInit();
|
|
88
|
+
const { RunTaskCommand } = await import("@aws-sdk/client-ecs");
|
|
89
|
+
let response = false;
|
|
90
|
+
const runtTaskCommand = new RunTaskCommand({
|
|
91
|
+
cluster: props?.cluster,
|
|
92
|
+
launchType: props?.launchType,
|
|
93
|
+
networkConfiguration: props?.networkConfiguration,
|
|
94
|
+
overrides: props?.overrides,
|
|
95
|
+
taskDefinition: props?.taskDefinition
|
|
96
|
+
});
|
|
97
|
+
const apiResponse = await this.client.send(runtTaskCommand);
|
|
98
|
+
if (require_aws_server_isResponse200.isResponse200(apiResponse)) response = apiResponse;
|
|
99
|
+
return response;
|
|
100
|
+
};
|
|
87
101
|
};
|
|
88
102
|
//#endregion
|
|
89
103
|
exports.AwsEcsNamespace = AwsEcsNamespace;
|
|
@@ -3,86 +3,100 @@ import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
|
3
3
|
import "../../server/index.mjs";
|
|
4
4
|
//#region src/aws/ecs/server/AwsEcsNamespace.ts
|
|
5
5
|
var AwsEcsNamespace = class extends BaseNamespace {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
apiResponse
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
await this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (isResponse200(apiResponse)) response = [...response, ...apiResponse.taskArns];
|
|
67
|
-
}
|
|
68
|
-
return response;
|
|
69
|
-
};
|
|
70
|
-
this.runTask = async (props) => {
|
|
71
|
-
await this.ensureInit();
|
|
72
|
-
const { RunTaskCommand } = await import("@aws-sdk/client-ecs");
|
|
73
|
-
let response = false;
|
|
74
|
-
const runtTaskCommand = new RunTaskCommand({
|
|
6
|
+
ensureInit = async () => {
|
|
7
|
+
if (!this.client) try {
|
|
8
|
+
const { ECSClient } = await import("@aws-sdk/client-ecs");
|
|
9
|
+
this.client = new ECSClient(this.config);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw new Error("AWS ECS Client not installed");
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListClustersCommand/
|
|
16
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListClustersCommandInput/
|
|
17
|
+
*/
|
|
18
|
+
getClusters = async (maxResults) => {
|
|
19
|
+
await this.ensureInit();
|
|
20
|
+
const { ListClustersCommand } = await import("@aws-sdk/client-ecs");
|
|
21
|
+
let response = [];
|
|
22
|
+
let apiResponse = null;
|
|
23
|
+
while (null === apiResponse || apiResponse?.nextToken) {
|
|
24
|
+
const listClustersCommand = new ListClustersCommand({
|
|
25
|
+
maxResults,
|
|
26
|
+
nextToken: apiResponse?.nextToken
|
|
27
|
+
});
|
|
28
|
+
apiResponse = await this.client.send(listClustersCommand);
|
|
29
|
+
if (isResponse200(apiResponse)) response = [...response, ...apiResponse.clusterArns];
|
|
30
|
+
}
|
|
31
|
+
return response;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListTaskDefinitionsCommand/
|
|
35
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListTaskDefinitionsCommandInput/
|
|
36
|
+
*/
|
|
37
|
+
getTaskDefinitions = async (props) => {
|
|
38
|
+
await this.ensureInit();
|
|
39
|
+
const { ListTaskDefinitionsCommand } = await import("@aws-sdk/client-ecs");
|
|
40
|
+
let response = [];
|
|
41
|
+
let apiResponse = null;
|
|
42
|
+
while (null === apiResponse || apiResponse?.nextToken) {
|
|
43
|
+
const listTaskDefinitionsCommand = new ListTaskDefinitionsCommand({
|
|
44
|
+
maxResults: props?.maxResults,
|
|
45
|
+
familyPrefix: props?.familyPrefix,
|
|
46
|
+
sort: props?.sort,
|
|
47
|
+
status: props?.status,
|
|
48
|
+
nextToken: apiResponse?.nextToken
|
|
49
|
+
});
|
|
50
|
+
apiResponse = await this.client.send(listTaskDefinitionsCommand);
|
|
51
|
+
if (isResponse200(apiResponse)) response = [...response, ...apiResponse.taskDefinitionArns];
|
|
52
|
+
}
|
|
53
|
+
return response;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/ListTasksCommand/
|
|
57
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/ListTasksCommandInput/
|
|
58
|
+
*/
|
|
59
|
+
getTasks = async (props) => {
|
|
60
|
+
await this.ensureInit();
|
|
61
|
+
const { ListTasksCommand } = await import("@aws-sdk/client-ecs");
|
|
62
|
+
let response = [];
|
|
63
|
+
let apiResponse = null;
|
|
64
|
+
while (null === apiResponse || apiResponse?.nextToken) {
|
|
65
|
+
const listTasksCommand = new ListTasksCommand({
|
|
75
66
|
cluster: props?.cluster,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
containerInstance: props?.containerInstance,
|
|
68
|
+
desiredStatus: props?.desiredStatus,
|
|
69
|
+
family: props?.family,
|
|
70
|
+
maxResults: props?.maxResults,
|
|
71
|
+
nextToken: apiResponse?.nextToken,
|
|
72
|
+
serviceName: props?.serviceName,
|
|
73
|
+
startedBy: props?.startedBy
|
|
80
74
|
});
|
|
81
|
-
|
|
82
|
-
if (isResponse200(apiResponse)) response = apiResponse;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
75
|
+
apiResponse = await this.client.send(listTasksCommand);
|
|
76
|
+
if (isResponse200(apiResponse)) response = [...response, ...apiResponse.taskArns];
|
|
77
|
+
}
|
|
78
|
+
return response;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Initialise and run a task
|
|
82
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/RunTaskCommand/
|
|
83
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/RunTaskCommandInput/
|
|
84
|
+
*/
|
|
85
|
+
runTask = async (props) => {
|
|
86
|
+
await this.ensureInit();
|
|
87
|
+
const { RunTaskCommand } = await import("@aws-sdk/client-ecs");
|
|
88
|
+
let response = false;
|
|
89
|
+
const runtTaskCommand = new RunTaskCommand({
|
|
90
|
+
cluster: props?.cluster,
|
|
91
|
+
launchType: props?.launchType,
|
|
92
|
+
networkConfiguration: props?.networkConfiguration,
|
|
93
|
+
overrides: props?.overrides,
|
|
94
|
+
taskDefinition: props?.taskDefinition
|
|
95
|
+
});
|
|
96
|
+
const apiResponse = await this.client.send(runtTaskCommand);
|
|
97
|
+
if (isResponse200(apiResponse)) response = apiResponse;
|
|
98
|
+
return response;
|
|
99
|
+
};
|
|
86
100
|
};
|
|
87
101
|
//#endregion
|
|
88
102
|
export { AwsEcsNamespace };
|
|
@@ -4,23 +4,23 @@ const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs
|
|
|
4
4
|
require("../../server/index.cjs");
|
|
5
5
|
//#region src/aws/glue/server/AwsGlueNamespace.ts
|
|
6
6
|
var AwsGlueNamespace = class extends require__class_BaseNamespace.BaseNamespace {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
7
|
+
ensureInit = async () => {
|
|
8
|
+
if (!this.client) try {
|
|
9
|
+
const { GlueClient } = await import("@aws-sdk/client-glue");
|
|
10
|
+
this.client = new GlueClient(this.config);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw new Error("AWS Glue Client not installed");
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Invoke an AWS Glue Crawler by passing in the name of the Crawler.
|
|
17
|
+
*/
|
|
18
|
+
invoke = async (crawler) => {
|
|
19
|
+
await this.ensureInit();
|
|
20
|
+
const { StartCrawlerCommand } = await import("@aws-sdk/client-glue");
|
|
21
|
+
const command = new StartCrawlerCommand({ Name: crawler });
|
|
22
|
+
return require_aws_server_isResponse200.isResponse200(await this.client.send(command));
|
|
23
|
+
};
|
|
24
24
|
};
|
|
25
25
|
//#endregion
|
|
26
26
|
exports.AwsGlueNamespace = AwsGlueNamespace;
|
|
@@ -3,23 +3,23 @@ import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
|
3
3
|
import "../../server/index.mjs";
|
|
4
4
|
//#region src/aws/glue/server/AwsGlueNamespace.ts
|
|
5
5
|
var AwsGlueNamespace = class extends BaseNamespace {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
6
|
+
ensureInit = async () => {
|
|
7
|
+
if (!this.client) try {
|
|
8
|
+
const { GlueClient } = await import("@aws-sdk/client-glue");
|
|
9
|
+
this.client = new GlueClient(this.config);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw new Error("AWS Glue Client not installed");
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Invoke an AWS Glue Crawler by passing in the name of the Crawler.
|
|
16
|
+
*/
|
|
17
|
+
invoke = async (crawler) => {
|
|
18
|
+
await this.ensureInit();
|
|
19
|
+
const { StartCrawlerCommand } = await import("@aws-sdk/client-glue");
|
|
20
|
+
const command = new StartCrawlerCommand({ Name: crawler });
|
|
21
|
+
return isResponse200(await this.client.send(command));
|
|
22
|
+
};
|
|
23
23
|
};
|
|
24
24
|
//#endregion
|
|
25
25
|
export { AwsGlueNamespace };
|
|
@@ -6,38 +6,40 @@ const require_aws_server_isResponse200 = require("../../server/isResponse200.cjs
|
|
|
6
6
|
require("../../server/index.cjs");
|
|
7
7
|
//#region src/aws/lambda/server/AwsLambdaNamespace.ts
|
|
8
8
|
var AwsLambdaNamespace = class extends require__class_BaseNamespace.BaseNamespace {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const apiResponse = await this.client.send(command);
|
|
30
|
-
if (require_aws_server_isResponse200.isResponse200(apiResponse)) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
|
|
31
|
-
response = new TextDecoder("ascii").decode(apiResponse.Payload);
|
|
32
|
-
if (true === props.isJson) {
|
|
33
|
-
response = JSON.parse(response);
|
|
34
|
-
if ("string" === typeof response) response = JSON.parse(response);
|
|
35
|
-
if (void 0 !== response && void 0 !== response?.error && void 0 !== response?.state) response = new require_api_ApiResponseClass.ApiResponseClass().fromJson(response);
|
|
36
|
-
}
|
|
37
|
-
} else response = true;
|
|
38
|
-
return response;
|
|
9
|
+
ensureInit = async () => {
|
|
10
|
+
if (!this.client) try {
|
|
11
|
+
const { LambdaClient } = await import("@aws-sdk/client-lambda");
|
|
12
|
+
this.client = new LambdaClient(this.config);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
throw new Error("AWS Lambda Client not installed");
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
|
|
19
|
+
* Runs asynchronously, doesn't wait for function to fully end.
|
|
20
|
+
* Library: @aws-sdk/client-lambda
|
|
21
|
+
*/
|
|
22
|
+
invoke = async (props) => {
|
|
23
|
+
await this.ensureInit();
|
|
24
|
+
const { InvokeCommand } = await import("@aws-sdk/client-lambda");
|
|
25
|
+
let response = false;
|
|
26
|
+
const params = {
|
|
27
|
+
FunctionName: props.functionName,
|
|
28
|
+
InvocationType: true === props.awaitResponse ? "RequestResponse" : "Event"
|
|
39
29
|
};
|
|
40
|
-
|
|
30
|
+
if (void 0 !== props.payload) params["Payload"] = new Uint8Array(Buffer.from(JSON.stringify(props.payload)));
|
|
31
|
+
const command = new InvokeCommand(params);
|
|
32
|
+
const apiResponse = await this.client.send(command);
|
|
33
|
+
if (require_aws_server_isResponse200.isResponse200(apiResponse)) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
|
|
34
|
+
response = new TextDecoder("ascii").decode(apiResponse.Payload);
|
|
35
|
+
if (true === props.isJson) {
|
|
36
|
+
response = JSON.parse(response);
|
|
37
|
+
if ("string" === typeof response) response = JSON.parse(response);
|
|
38
|
+
if (void 0 !== response && void 0 !== response?.error && void 0 !== response?.state) response = new require_api_ApiResponseClass.ApiResponseClass().fromJson(response);
|
|
39
|
+
}
|
|
40
|
+
} else response = true;
|
|
41
|
+
return response;
|
|
42
|
+
};
|
|
41
43
|
};
|
|
42
44
|
//#endregion
|
|
43
45
|
exports.AwsLambdaNamespace = AwsLambdaNamespace;
|
|
@@ -5,38 +5,40 @@ import { isResponse200 } from "../../server/isResponse200.mjs";
|
|
|
5
5
|
import "../../server/index.mjs";
|
|
6
6
|
//#region src/aws/lambda/server/AwsLambdaNamespace.ts
|
|
7
7
|
var AwsLambdaNamespace = class extends BaseNamespace {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const apiResponse = await this.client.send(command);
|
|
29
|
-
if (isResponse200(apiResponse)) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
|
|
30
|
-
response = new TextDecoder("ascii").decode(apiResponse.Payload);
|
|
31
|
-
if (true === props.isJson) {
|
|
32
|
-
response = JSON.parse(response);
|
|
33
|
-
if ("string" === typeof response) response = JSON.parse(response);
|
|
34
|
-
if (void 0 !== response && void 0 !== response?.error && void 0 !== response?.state) response = new ApiResponseClass().fromJson(response);
|
|
35
|
-
}
|
|
36
|
-
} else response = true;
|
|
37
|
-
return response;
|
|
8
|
+
ensureInit = async () => {
|
|
9
|
+
if (!this.client) try {
|
|
10
|
+
const { LambdaClient } = await import("@aws-sdk/client-lambda");
|
|
11
|
+
this.client = new LambdaClient(this.config);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw new Error("AWS Lambda Client not installed");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
|
|
18
|
+
* Runs asynchronously, doesn't wait for function to fully end.
|
|
19
|
+
* Library: @aws-sdk/client-lambda
|
|
20
|
+
*/
|
|
21
|
+
invoke = async (props) => {
|
|
22
|
+
await this.ensureInit();
|
|
23
|
+
const { InvokeCommand } = await import("@aws-sdk/client-lambda");
|
|
24
|
+
let response = false;
|
|
25
|
+
const params = {
|
|
26
|
+
FunctionName: props.functionName,
|
|
27
|
+
InvocationType: true === props.awaitResponse ? "RequestResponse" : "Event"
|
|
38
28
|
};
|
|
39
|
-
|
|
29
|
+
if (void 0 !== props.payload) params["Payload"] = new Uint8Array(Buffer.from(JSON.stringify(props.payload)));
|
|
30
|
+
const command = new InvokeCommand(params);
|
|
31
|
+
const apiResponse = await this.client.send(command);
|
|
32
|
+
if (isResponse200(apiResponse)) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
|
|
33
|
+
response = new TextDecoder("ascii").decode(apiResponse.Payload);
|
|
34
|
+
if (true === props.isJson) {
|
|
35
|
+
response = JSON.parse(response);
|
|
36
|
+
if ("string" === typeof response) response = JSON.parse(response);
|
|
37
|
+
if (void 0 !== response && void 0 !== response?.error && void 0 !== response?.state) response = new ApiResponseClass().fromJson(response);
|
|
38
|
+
}
|
|
39
|
+
} else response = true;
|
|
40
|
+
return response;
|
|
41
|
+
};
|
|
40
42
|
};
|
|
41
43
|
//#endregion
|
|
42
44
|
export { AwsLambdaNamespace };
|