@etainabl/nodejs-sdk 1.3.152 → 1.3.153

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.cts CHANGED
@@ -611,6 +611,7 @@ type FormattedConsumption = Omit<Consumption<string, string>, '_id'>;
611
611
  type FormattedReading = Omit<Reading<string, string>, '_id'>;
612
612
  type FormattedInvoice = Omit<Invoice<string, string>, '_id' | 's3Key'>;
613
613
  interface HandleErrorParams {
614
+ context: Context;
614
615
  etnApi: ReturnType<typeof _default$4>;
615
616
  automationRun: AutomationRun<string>;
616
617
  lambdaSource: string;
@@ -640,7 +641,7 @@ interface UploadCsv {
640
641
  declare function sendEmail(lambdaSource: string, context: Context, error: Error, destinations: string[]): Promise<_aws_sdk_client_ses.SendEmailCommandOutput>;
641
642
  declare function createCsv(data: (FormattedConsumption | FormattedReading | FormattedInvoice)[]): string;
642
643
  declare function uploadCsv({ csvContent, automationRun, s3Client, orgFilename, collectionType }: UploadCsv): Promise<string>;
643
- declare function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }: HandleErrorParams): Promise<void>;
644
+ declare function handleError({ context, etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }: HandleErrorParams): Promise<void>;
644
645
  declare function deleteMessage(queueUrl: string, receiptHandle: string, sqsClient?: SQSClient): Promise<void>;
645
646
 
646
647
  type integrations_CollectionType = CollectionType;
package/dist/index.d.ts CHANGED
@@ -611,6 +611,7 @@ type FormattedConsumption = Omit<Consumption<string, string>, '_id'>;
611
611
  type FormattedReading = Omit<Reading<string, string>, '_id'>;
612
612
  type FormattedInvoice = Omit<Invoice<string, string>, '_id' | 's3Key'>;
613
613
  interface HandleErrorParams {
614
+ context: Context;
614
615
  etnApi: ReturnType<typeof _default$4>;
615
616
  automationRun: AutomationRun<string>;
616
617
  lambdaSource: string;
@@ -640,7 +641,7 @@ interface UploadCsv {
640
641
  declare function sendEmail(lambdaSource: string, context: Context, error: Error, destinations: string[]): Promise<_aws_sdk_client_ses.SendEmailCommandOutput>;
641
642
  declare function createCsv(data: (FormattedConsumption | FormattedReading | FormattedInvoice)[]): string;
642
643
  declare function uploadCsv({ csvContent, automationRun, s3Client, orgFilename, collectionType }: UploadCsv): Promise<string>;
643
- declare function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }: HandleErrorParams): Promise<void>;
644
+ declare function handleError({ context, etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }: HandleErrorParams): Promise<void>;
644
645
  declare function deleteMessage(queueUrl: string, receiptHandle: string, sqsClient?: SQSClient): Promise<void>;
645
646
 
646
647
  type integrations_CollectionType = CollectionType;
package/dist/index.js CHANGED
@@ -25546,12 +25546,14 @@ async function uploadCsv({ csvContent, automationRun, s3Client, orgFilename, col
25546
25546
  throw new Error(error);
25547
25547
  }
25548
25548
  }
25549
- async function handleError({ etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }) {
25549
+ async function handleError({ context, etnApi, automationRun, error, lambdaSource, accountId, automation, messageId }) {
25550
25550
  await etnApi.createAutomationRunLog(automationRun._id, {
25551
25551
  message: error.message,
25552
25552
  status: "error",
25553
25553
  lambdaSource,
25554
- lambdaMessageId: messageId
25554
+ lambdaMessageId: messageId,
25555
+ lambdaLogStreamName: context.logStreamName,
25556
+ lambdaRequestId: context.awsRequestId
25555
25557
  });
25556
25558
  const { description, service } = automation;
25557
25559
  const message = automationRun.source?.fileName ? `Automation "${description || service}" FAILED while processing file: ${automationRun.source.fileName}` : `Automation "${description}" FAILED.`;