Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idea-html2pdf

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idea-html2pdf - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

6

dist/src/html2pdf.d.ts
/// <reference types="node" />
import { Lambda } from 'aws-sdk';
import { S3, Lambda } from 'aws-sdk';
import { SafeString, HelperDelegate } from 'handlebars';
import { S3 } from 'idea-aws';
import { Languages, SignedURL } from 'idea-toolbox';

@@ -59,6 +58,5 @@ /**

* @param alternativeLambda an alternative lambda function to use to generate the PDF
* @param downloadOptions the parameters create the download link
* @return the URL to download the PDF
*/
createLink(params: HTML2PDFParameters, alternativeLambda?: string, downloadOptions?: any): Promise<SignedURL>;
createLink(params: HTML2PDFParameters, alternativeLambda?: string): Promise<SignedURL>;
/**

@@ -65,0 +63,0 @@ * Helper function to prepare Handlebar's helper for the `PDFTemplateSection` standard.

@@ -6,3 +6,2 @@ "use strict";

const handlebars_1 = require("handlebars");
const idea_aws_1 = require("idea-aws");
const idea_toolbox_1 = require("idea-toolbox");

@@ -26,3 +25,3 @@ // declare libs as global vars to be reused in warm starts by the Lambda function

if (!ideaWarmStart_s3)
ideaWarmStart_s3 = new idea_aws_1.S3();
ideaWarmStart_s3 = new aws_sdk_1.S3({ apiVersion: '2006-03-01', signatureVersion: 'v4' });
this.s3 = ideaWarmStart_s3;

@@ -91,3 +90,3 @@ if (!ideaWarmStart_lambda)

const s3params = JSON.parse(result.Payload);
const s3Obj = await this.s3.getObject(s3params);
const s3Obj = await this.s3.getObject(s3params).promise();
return s3Obj.Body;

@@ -104,8 +103,11 @@ }

* @param alternativeLambda an alternative lambda function to use to generate the PDF
* @param downloadOptions the parameters create the download link
* @return the URL to download the PDF
*/
async createLink(params, alternativeLambda, downloadOptions) {
async createLink(params, alternativeLambda) {
const pdfData = await this.create(params, alternativeLambda);
return this.s3.createDownloadURLFromData(pdfData, downloadOptions);
const Key = 'html2pdf'.concat(new Date().getTime().toString().concat(Math.random().toString(36).slice(2)), '.pdf');
const Bucket = 'idea-downloads';
const Expires = 60;
await this.s3.upload({ Bucket, Key, Body: pdfData }).promise();
return new idea_toolbox_1.SignedURL({ url: this.s3.getSignedUrl('getObject', { Bucket, Key, Expires }) });
}

@@ -112,0 +114,0 @@ /**

{
"name": "idea-html2pdf",
"version": "1.2.1",
"version": "1.3.0",
"description": "IDEA helper for generating a PDF from HTML contents",

@@ -35,3 +35,2 @@ "engines": {

"handlebars": "^4.7.7",
"idea-aws": "3.6.3",
"idea-toolbox": "6.3.2"

@@ -38,0 +37,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc