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

serverless-escapia-robotify

v0.0.1

Published

Escapia automation

Downloads

13

Readme

serverless-escapia-robotify

Report Downloader

Supported Reports

  • Folio Balance Report: https://reports.escapia.com/ReportServer/Pages/ReportViewer.aspx?%2fEscapiaReports%2fAccounting%2fReservations%2fFolio+Balance+Report&rs%3aCommand=Render

How to download an Escapia report

To submit a report download request, publish an AWS SNS message with the following details:

  • TopicArn -- arn:aws:sns:us-east-2:673853704728:escapia-robotify-report-download-request
  • Message -- a stringified JSON object with the following properties:
    • transactionId (type: string) (optional) -- a unique Id to help track your download request
    • callingProgress (type: string) (optional) -- the name of your process, also used to help track your download request
    • reportType (type: string) (required) -- the type of report you're downloading; supported values include:
      • Folio Balance
    • fileFormat (type: string) (required) -- the file format of the downloaded report; known supported values include:
      • CSV
      • EXCELOPENXML
    • reportParams (type: object) (optional) -- report parameters; supported object properties/values include:
      • startDate (type: string) -- the start date of the report
      • endDate (type: string) -- the end date of the report

Example download request in Node:

const AWS = require('aws-sdk');
AWS.config.region = 'us-east-2';
AWS.config.apiVersions = {
    sns: '2010-03-31'
};
const sns = new AWS.SNS();

const downloadReport = (event, context, callback) => {
    let messagePayload = {
        "transactionId": "qWSN1UHlEkESAJAbO_wV-XXX",
        "callingProcess": "my kewl process",
        "reportType": "Folio Balance",
        "fileFormat": "CSV",
        "reportParams": {
            "startDate": "7/6/2019",
            "endDate": "7/16/2019"
        },
        "escapiaInstanceId": "1655"
    }

    let response = {
        statusCode: 200,
        headers: {
          "Access-Control-Allow-Origin": "*",
          "Access-Control-Allow-Credentials": true
        }
    };

    let params = {
        Message: JSON.stringify(messagePayload),
        TopicArn: 'arn:aws:sns:us-east-2:673853704728:escapia-robotify-report-download-request'
    };
    sns.publish(params, (err, data) => {
        if (err) {
            logger.debug(err);
            response.body = JSON.stringify({ success: false, message: err.message });
        }
        else {
            response.body = JSON.stringify({ success: true });
        }
        callback(null, response);
    });
};

To receive notification after the report has been uploaded to s3, subscribe to the following SNS ARN:

  • arn:aws:sns:us-east-2:673853704728:escapia-robotify-report-download-results

An example of the results SNS message:

{
    "transactionId": "qWSN1UHlEkESAJAbO_wV-XXX",
    "callingProcess": "my kewl process",
    "reportType": "Folio Balance",
    "success": true,
    "s3Bucket": robotify-escapia-reports,
    "s3Key": "qWSN1UHlEkESAJAbO_wV-XXX/Folio Balance Report.csv"
}

An example of SNS message to request the Charge Template Unit Scope report:

{
    "transactionId": "abcdefghijklm",
    "callingProcess": "my kewl process",
    "reportType": "Charge Template Unit Scope",
    "fileFormat": "CSV",
    "reportParams": {}
}

Airbnb Rate Reconciliation

In general, the robot follows the process documented here: https://turnkeyvr.screenstepslive.com/s/internal/m/77430/l/871336-finalize-airbnb-reservation

Additional details on the robot:

  • The robot runs every 10 - 15 minutes and processes up to 5 Cases per run
  • When the robot picks up Cases to process, it first updates the Case Status to "In Progress"
  • In the event of an error during Case processing (ex: Escapia fails to load a page) or a scenario that the robot isn't programmed to handle (ex: a Reservation with a security deposit):
    • The Case's Subject will be updated to "Finalize Airbnb reservation in Escapia - - ROBOTIFY FAILURE"
    • The Case's Status will be reset to "New"
    • The Case's Description will include some details on the specific error
  • When the robot successfully processes a Case:
    • The Case's Status will be set to "Closed"
    • The Case's Description will include notes on what the robot did to process the Case
  • When the robot believes it successfully processed a Case but isn't 100% sure:
    • The Case's Subject will be updated to "Finalize Airbnb reservation in Escapia - - REVIEW REQUIRED"
    • The Case's Status will be reset to "New"
    • The Case's Description will include some details on what needs to be reviewed
  • Smiles will not see these Cases in the "Res - Airbnb Pending Reconcile -Smiles" Case list view unless the Case Subject is "Finalize Airbnb reservation in Escapia - - ROBOTIFY FAILURE" or "Finalize Airbnb reservation in Escapia - - REVIEW REQUIRED". While there will be notes from the robot in the Case Description, in general Smiles should try to work the Case from the beginning of the process documented in ScreenSteps, and if they are unable to reconcile the Case they should escalate.