npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ampsalesfunnels-functions

v1.1.3

Published

https://ampsalesfunnels.com - lib to support functions - Build blazingly fast sales funnels, learn coding, and get rich

Downloads

3

Readme

ampsalesfunnels-functions

Set with helper functions for the implementation of Netlify functions.

Functions

printEnv(additionalAMPSFVars, additionalNetlifyVars) ⇒ void

Kind: global function

| Param | Type | Description | | --- | --- | --- | | additionalAMPSFVars | Array.<string> | additional AMPSalesFunnels specific environment variables to print | | additionalNetlifyVars | Array.<string> | additional Netlify specific environment variables to print |

isProductionBasedOnHostname() ⇒ boolean

Kind: global function

getEnv(envName)

Kind: global function

| Param | Type | | --- | --- | | envName | * |

prepareFunction(event, context, dirname, additionalAMPSFVars, additionalNetlifyVars) ⇒ void

Kind: global function

| Param | Type | Description | | --- | --- | --- | | event | APIGatewayProxyEvent | | | context | any | | | dirname | string | path to the directory containing the function | | additionalAMPSFVars | Array.<string> | additional AMPSalesFunnels specific environment variables to print | | additionalNetlifyVars | Array.<string> | additional Netlify specific environment variables to print |

getAMPRedirectToFunctionResult(url) ⇒ *

Kind: global function

| Param | Type | Description | | --- | --- | --- | | url | string | url to redirect to |

getEmptyFunctionResult() ⇒ Object

Kind: global function

getMessageFunctionResult(message) ⇒ Object

Kind: global function

| Param | Type | Description | | --- | --- | --- | | message | string | the message to return in body: { "message": message } |

getObjectFunctionResult(obj) ⇒ *

Kind: global function

| Param | Type | Description | | --- | --- | --- | | obj | * | the obj to return in body: { ... } |

getErrorFunctionResult(statusCode, error) ⇒ Object

Kind: global function

| Param | Type | Description | | --- | --- | --- | | statusCode | number | status code | | error | Error | string | the error object (or a string), error message wil be returned in body: { "error": "message" } |

sendEmailWithMailgen(nodemailerTransporter, from, to, name, sku, dirname) ⇒ Promise.<void>

Kind: global function

| Param | Type | Description | | --- | --- | --- | | nodemailerTransporter | Transporter | the nodemailer transporter to use | | from | string | email address of the sender | | to | string | email address to send the mail to | | name | string | name of the customer | | sku | string | unique identifier for the product (stock-keeping unit) | | dirname | string | path to the directory containing the mailgen files |

makeQueryString(params) ⇒ string

Kind: global function
Returns: string - the query string

| Param | Type | Description | | --- | --- | --- | | params | Object.<string, string> | dictionary object with name-value pairs |

ifttt_event(key, eventname, value1, value2, value3)

Kind: global function
Category: IFTTT

| Param | Type | Description | | --- | --- | --- | | key | string | IFTTT key, available at https://ifttt.com/maker_webhooks/settings (after /use/) | | eventname | string | the name of the event to report | | value1 | string | first value | | value2 | string | second value | | value3 | string | third value |

log_event(production, eventname, valueA, valueB)

Kind: global function
Category: IFTTT

| Param | Type | Description | | --- | --- | --- | | production | boolean | true if production; false if sandbox | | eventname | string | the name of the event to report, can be ERROR, LOG, INTERESTED, SALE, ... | | valueA | string | first value | | valueB | string | second value |

log_event_error(production, functionFilename, name, email, message)

Kind: global function
Category: IFTTT

| Param | Type | Description | | --- | --- | --- | | production | boolean | true if production; false if sandbox | | functionFilename | string | filename of the function | | name | string | name of user | | email | string | email of user | | message | string | error message |

log_event_information(production, functionFilename, name, email, message)

Kind: global function
Category: IFTTT

| Param | Type | Description | | --- | --- | --- | | production | boolean | true if production; false if sandbox | | functionFilename | string | filename of the function | | name | string | name of user | | email | string | email of user | | message | string | message to log |

log_event_interest(production, name, email, sku, price)

Kind: global function
Category: IFTTT

| Param | Type | Default | Description | | --- | --- | --- | --- | | production | boolean | | true if production; false if sandbox | | name | string | | name of user | | email | string | | email of user | | sku | string | "unknown" | sku of the product user is interested in | | price | string | "unknown" | price of sku |

log_event_sale(production, name, email, sku, price)

Kind: global function
Category: IFTTT

| Param | Type | Default | Description | | --- | --- | --- | --- | | production | boolean | | true if production; false if sandbox | | name | string | | name of user | | email | string | | email of user | | sku | string | "unknown" | sku of the product user is interested in | | price | string | "unknown" | price of sku |

getPayPalBaseUrl(production) ⇒ string

Kind: global function
Returns: string - The PayPal base URL https://www.sandbox.paypal.com or https://www.paypal.com'
Category: PayPal

| Param | Type | Description | | --- | --- | --- | | production | boolean | in production mode if true; in sandbox mode if false |

getPayPalMerchantEmail(production) ⇒ string

Kind: global function
Returns: string - email address of merchant
Category: PayPal

| Param | Type | Description | | --- | --- | --- | | production | boolean | in production mode if true; in sandbox mode if false |

getPayPalIpnNotificationUrl(production) ⇒ string

Kind: global function
Returns: string - The IPN notification URL
Category: PayPal

| Param | Type | Description | | --- | --- | --- | | production | boolean | in production mode if true; in sandbox mode if false |

getPayPalProductUrl(sku, formData, customData, siteUrl, returnPage, cancelPage, logoUrl, dirname, production) ⇒ string

Kind: global function
Returns: string -

| Param | Type | Description | | --- | --- | --- | | sku | string | unique identifier for the product (stock-keeping unit) | | formData | object | form data as posted on the salesfunnel page | | customData | object | custom data to add to the PayPal URL | | siteUrl | string | url of the site hosting the salesfunnel page | | returnPage | string | relative url of page to go to when PayPal checkout completed, e.g. salesfunnel-thanks.html page) | | cancelPage | string | relative url of page to go to when PayPal flow is canceled (salesfunnel page) | | logoUrl | string | relative url to a 150x50 product log image used in PayPal checkout | | dirname | string | path to the directory containing the products.json file | | production | boolean | in production mode if true; in sandbox mode if false |

payPalIpnValidate(ipnMessage, production) ⇒ Promise.<void>

Kind: global function
Returns: Promise.<void> -

| Param | Type | Description | | --- | --- | --- | | ipnMessage | string | the body of the PayPal IPN message | | production | boolean | in production mode if true; in sandbox mode if false |

payPalIpnToOrder(body) ⇒ *

Kind: global function
Returns: * - an order object with all IPN fields
Category: PayPal

| Param | Type | Description | | --- | --- | --- | | body | string | POST body as PayPal sends to IPN endpoint |

=== © 2021 Dellariva Solutions