Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gatekeeper_technology/report-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Gatekeeper's report utils
Gatekeeper's pdf/email Utils - shared in NPM
Set-up
- Create a
.npmrcfile containing://registry.npmjs.org/:_authToken=<publish-npm-token>. You can find the publishnpm-tokenon onePassword.
Updating
- Put your code changes in
index.js. - Update the version number in the
package.json. - Describe your changes in the
README.mdchangelog. - Test your code before publishing:
- Navigate one directory back
- Open the terminal.
- Execute
npm install report-utils. - If any error fix them, otherwise you are good to go.
- Execute
cd report-utilsandnpm publishin the terminal. - Commit & Push your changes to GitHub.
Using this package in a JourneyApps CloudCode Task.
- In your CloudCode, open the
package.jsonfile and make sure you have the following code:
, where"dependencies": { "@gatekeeper_technology/report-utils": "<current-version-number>" }<current-version-number>is the version number saved in this repo'spackage.jsonfile. - In the JavaScript code add the following line at the top of the page:
const utils = require("@gatekeeper_technology/report-utils");. - Create a
.npmrcfile (in the CC task) containing://registry.npmjs.org/:_authToken=<read-only-npm-token>. You can find the read-onlynpm-tokenon 1Password. - You can check at the top of this repo's
index.jsfile to see which functions we export. We should update the list of functionality soon. - Happy coding!
Functionality
This package has three parts
- date_time_utils - Functions that format JavaScript datetime objects to a readable/printable format
- email_utils - These functions ensure that the specified email addresses do not violate any of the SendGrid v3 requirements and implements whitelisting
- photo_attachment_utils -
Changelog
[1.1.4]
Added
- areEqualDates
- areEqualDateTimes
- isToday
- getStartOfWeek
- getEndOfWeek
- getWeekNumber
- isFutureDate
- isPastDate
[1.1.3]
Fixed
- A bug where you cannot import the
report-utilspackage in the/mobileside of an App.
[1.1.2]
Changed
- [TESTING] Moved the
loadImageBase64function toindex.jsto see if the required("fs") problem is fixed.
[1.1.1]
Changed
- [TESTING] Moved the require("fs") out of the function.
[1.1.0]
Changed
- Refactored the file structure to separate the concerns.
- Replaced
displayPhotowithjourneyPhotoToBase64, it now has a more descriptive name - Replaced
loadPhotoOrSignaturewithgetPhotoOrSignatureData, it's now up to the developer to load the data into a data hash. - Replaced
loadSignatureBase64withencodeBase64ImagePNG, renamed function and changed the input parameter to the actual image data.
[1.00.07]
Added
index.js: Added the ability to specify in which environments to enable email whitelisting.
[1.00.06]
Changed
index.js: Emails are first trimmed and toLowerCase'd before checking if it is valid.
[1.00.05]
Changed
index.js: Changed the wayloadAttachmentsfunction receives retry_count value.
[1.00.04]
Fixed
index.js: a Bug where theloadPhotoOrSignaturefunction was out of date.
[1.00.03]
Changed
index.js: Emails check now convert all emails to lowercase before checking for duplicates.
[1.00.02]
Added
index.js: Added functiondisplayTimeWithSeconds.
Changed
index.js: improved javadocs commenting .
[1.00.01]
Changed
Readme.md: explanation improved.index.js: Added functionsdisplayDateTimeanddisplayTime.
[1.00.00]
Added
package.json: Added.index.js: Added and populated with Gatekeeper's handlebarUtil functions..npmignore: Added..gitignore: Added.README.md: Added with description, set-up and change-log.