Skip to content

Commit 1590655

Browse files
committed
deploy for 77ff93b
1 parent 14c5fbf commit 1590655

File tree

7 files changed

+52
-33
lines changed

7 files changed

+52
-33
lines changed

cjs/index.d.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export interface Input {
88
bulkEmail?: SendBulkEmailInput;
99
}
1010
export interface Output {
11-
email?: SendEmailOutput;
12-
error?: string;
13-
emails?: SendEmailOutput[];
14-
errors?: string[];
15-
bulkEmail?: SendBulkEmailOutput;
16-
bulkEmailError: string;
11+
email: SendEmailOutput | null;
12+
error: string | null;
13+
emails: SendEmailOutput[] | null;
14+
errors: string[] | null;
15+
bulkEmail: SendBulkEmailOutput | null;
16+
bulkEmailError: string | null;
1717
}
1818
export interface InvocationResponse {
1919
/**
@@ -30,7 +30,10 @@ export interface InvocationResponse {
3030
/** The last 4 KB of the execution log, which is base64 encoded. */
3131
logs?: string;
3232
/** The response from the function, or an error object. */
33-
payload?: Output;
33+
payload?: Output | {
34+
errorMessage: string;
35+
errorType: string;
36+
};
3437
/**
3538
* The version of the function that executed. When you invoke a function with an alias, this
3639
* indicates which version the alias resolved to.
@@ -43,5 +46,6 @@ export declare class LambdaSes {
4346
lambdaInstance: LambdaClient;
4447
functionName: string;
4548
constructor(lambdaInstance: LambdaClient, functionName?: string);
46-
invokeFunction(payload: Input, { InvocationType, LogType, ...input }?: Partial<Omit<InvokeCommandInput, "Payload" | "FunctionName">>): Promise<InvocationResponse>;
49+
send(payload: Input, { InvocationType, LogType, ...input }?: Partial<Omit<InvokeCommandInput, "Payload" | "FunctionName">>): Promise<InvocationResponse>;
4750
}
51+
export default LambdaSes;

cjs/index.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cjs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export interface Input {
88
bulkEmail?: SendBulkEmailInput;
99
}
1010
export interface Output {
11-
email?: SendEmailOutput;
12-
error?: string;
13-
emails?: SendEmailOutput[];
14-
errors?: string[];
15-
bulkEmail?: SendBulkEmailOutput;
16-
bulkEmailError: string;
11+
email: SendEmailOutput | null;
12+
error: string | null;
13+
emails: SendEmailOutput[] | null;
14+
errors: string[] | null;
15+
bulkEmail: SendBulkEmailOutput | null;
16+
bulkEmailError: string | null;
1717
}
1818
export interface InvocationResponse {
1919
/**
@@ -30,7 +30,10 @@ export interface InvocationResponse {
3030
/** The last 4 KB of the execution log, which is base64 encoded. */
3131
logs?: string;
3232
/** The response from the function, or an error object. */
33-
payload?: Output;
33+
payload?: Output | {
34+
errorMessage: string;
35+
errorType: string;
36+
};
3437
/**
3538
* The version of the function that executed. When you invoke a function with an alias, this
3639
* indicates which version the alias resolved to.
@@ -43,5 +46,6 @@ export declare class LambdaSes {
4346
lambdaInstance: LambdaClient;
4447
functionName: string;
4548
constructor(lambdaInstance: LambdaClient, functionName?: string);
46-
invokeFunction(payload: Input, { InvocationType, LogType, ...input }?: Partial<Omit<InvokeCommandInput, "Payload" | "FunctionName">>): Promise<InvocationResponse>;
49+
send(payload: Input, { InvocationType, LogType, ...input }?: Partial<Omit<InvokeCommandInput, "Payload" | "FunctionName">>): Promise<InvocationResponse>;
4750
}
51+
export default LambdaSes;

index.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export interface Input {
1616
}
1717

1818
export interface Output {
19-
email?: SendEmailOutput
20-
error?: string
21-
emails?: SendEmailOutput[]
22-
errors?: string[]
23-
bulkEmail?: SendBulkEmailOutput
24-
bulkEmailError: string
19+
email: SendEmailOutput | null
20+
error: string | null
21+
emails: SendEmailOutput[] | null
22+
errors: string[] | null
23+
bulkEmail: SendBulkEmailOutput | null
24+
bulkEmailError: string | null
2525
}
2626

2727
export interface InvocationResponse {
@@ -42,7 +42,12 @@ export interface InvocationResponse {
4242
logs?: string
4343

4444
/** The response from the function, or an error object. */
45-
payload?: Output
45+
payload?:
46+
| Output
47+
| {
48+
errorMessage: string
49+
errorType: string
50+
}
4651

4752
/**
4853
* The version of the function that executed. When you invoke a function with an alias, this
@@ -57,7 +62,7 @@ export interface InvocationResponse {
5762
export class LambdaSes {
5863
public constructor(public lambdaInstance: LambdaClient, public functionName = "lambda-ses") {}
5964

60-
public async invokeFunction(
65+
public async send(
6166
payload: Input,
6267
{
6368
InvocationType,
@@ -75,7 +80,9 @@ export class LambdaSes {
7580

7681
const result = await this.lambdaInstance.send(config)
7782

78-
const resultPayload = result.Payload?.toString()
83+
const resultPayload = result.Payload ? new TextDecoder().decode(result.Payload) : undefined
84+
85+
console.log(resultPayload)
7986

8087
return {
8188
status: result.StatusCode,
@@ -87,3 +94,5 @@ export class LambdaSes {
8794
}
8895
}
8996
}
97+
98+
export default LambdaSes

0 commit comments

Comments
 (0)