passkit-generator
Advanced tools
Comparing version 1.5.8 to 1.5.9
@@ -7,2 +7,20 @@ # Changelog | ||
___ | ||
## 1.5.9 | ||
[ [#7bad48107](/commit/7bad48107015aa8339037bc1069fd41a3efbf2d2) ] | ||
Removed check for changeMessage as per issue topic #15 | ||
[ [#fd5efded1](/commit/fd5efded1124b0f7de6c1e69d6a1a28e1bb7bf2b) ] | ||
Added pass.strings file concatenation with translations if it already exists | ||
in specific folder; | ||
[ [#d992b392c](/commit/d992b392c585dffcb32eb0720dfa4b103cfb926c) ] | ||
Small changes to messages; | ||
___ | ||
## 1.5.8 | ||
@@ -13,3 +31,3 @@ | ||
Now checking both static list and remote list before raising the error for missing files | ||
(thank you, Artsiom Aliakseyenka) | ||
(thank you, Artsiom Aliakseyenka); | ||
@@ -16,0 +34,0 @@ [ [#a62d8f35e](/commit/a62d8f35ea00021562ff4855dbb2e6a00001534a) ] |
{ | ||
"name": "passkit-generator", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"description": "The easiest way to generate custom Apple Wallet passes in Node.js", | ||
@@ -22,5 +22,5 @@ "main": "index.js", | ||
"debug": "^3.2.6", | ||
"got": "^9.3.2", | ||
"got": "^9.6.0", | ||
"joi": "^13.7.0", | ||
"moment": "^2.22.2", | ||
"moment": "^2.24.0", | ||
"node-forge": "^0.7.6" | ||
@@ -32,4 +32,4 @@ }, | ||
"devDependencies": { | ||
"jasmine": "^3.3.0" | ||
"jasmine": "^3.4.0" | ||
} | ||
} |
@@ -138,7 +138,7 @@ <div align="center"> | ||
// Adding some settings to be written inside pass.json | ||
pass.localize("en", { ... }); | ||
pass.barcode("36478105430"); // Random value | ||
examplePass.localize("en", { ... }); | ||
examplePass.barcode("36478105430"); // Random value | ||
// Generate the stream, which gets returned through a Promise | ||
pass.generate() | ||
examplePass.generate() | ||
.then(stream => { | ||
@@ -145,0 +145,0 @@ doSomethingWithTheStream(stream); |
const errors = { | ||
PASSFILE_VALIDATION_FAILED: "Validation of pass type failed. Pass file is not a valid buffer or (more probabily) does not respect the schema. Refer to https://apple.co/2Nvshvn to build a correct pass.", | ||
REQUIR_VALID_FAILED: "The options passed to Pass constructor does not meet the requirements. Refer to the documentation to compile them correctly.", | ||
MODEL_UNINITIALIZED: "Provided model ( %s ) matched but unitialized or may not contain icon. Refer to https://apple.co/2IhJr0Q, https://apple.co/2Nvshvn and documentation to fill the model correctly.", | ||
PASSFILE_VALIDATION_FAILED: "Validation of pass type failed. Pass file is not a valid buffer or (more probably) does not respect the schema.\nRefer to https://apple.co/2Nvshvn to build a correct pass.", | ||
REQUIR_VALID_FAILED: "The options passed to Pass constructor does not meet the requirements.\nRefer to the documentation to compile them correctly.", | ||
MODEL_UNINITIALIZED: "Provided model ( %s ) matched but unitialized or may not contain icon.\nRefer to https://apple.co/2IhJr0Q, https://apple.co/2Nvshvn and documentation to fill the model correctly.", | ||
MODEL_NOT_STRING: "A string model name must be provided in order to continue.", | ||
MODEL_NOT_FOUND: "Model %s not found. Provide a valid one to continue.", | ||
INVALID_CERTS: "Invalid certificate(s) loaded: %s. Please provide valid WWDR certificates and developer signer certificate and key (with passphrase). Refer to docs to obtain them.", | ||
INVALID_CERTS: "Invalid certificate(s) loaded: %s. Please provide valid WWDR certificates and developer signer certificate and key (with passphrase).\nRefer to docs to obtain them.", | ||
INVALID_CERT_PATH: "Invalid certificate loaded. %s does not exist.", | ||
TRSTYPE_REQUIRED: "Cannot proceed with pass creation. transitType field is required for boardingPasses.", | ||
OVV_KEYS_BADFORMAT: "Cannot proceed with pass creation due to bad keys format in overrides. Debug the app through `DEBUG=* node yourapp.js` to get more information about the error." | ||
OVV_KEYS_BADFORMAT: "Cannot proceed with pass creation due to bad keys format in overrides.", | ||
}; | ||
@@ -12,0 +12,0 @@ |
const fs = require("fs"); | ||
const path = require("path"); | ||
const { promisify } = require("util"); | ||
const { EOL } = require("os"); | ||
const stream = require("stream"); | ||
@@ -172,3 +173,3 @@ const moment = require("moment"); | ||
/* | ||
/** | ||
* if .string file buffer is empty, no translations were added | ||
@@ -178,5 +179,24 @@ * but still wanted to include the language | ||
if (strings.length) { | ||
if (!strings.length) { | ||
return; | ||
} | ||
/** | ||
* if there's already a buffer of the same folder and called | ||
* `pass.strings`, we'll merge the two buffers. We'll create | ||
* it otherwise. | ||
*/ | ||
const stringFilePath = path.join(`${l}.lproj`, "pass.strings"); | ||
const stringFileIndex = bundle.findIndex(file => file === stringFilePath); | ||
if (stringFileIndex > -1) { | ||
buffers[stringFileIndex] = Buffer.concat([ | ||
buffers[stringFileIndex], | ||
Buffer.from(EOL), | ||
strings | ||
]); | ||
} else { | ||
buffers.push(strings); | ||
bundle.push(path.join(`${l}.lproj`, `pass.strings`)); | ||
bundle.push(stringFilePath); | ||
} | ||
@@ -836,3 +856,3 @@ }); | ||
return Buffer.from(strings.join("\n"), "utf8"); | ||
return Buffer.from(strings.join(EOL), "utf8"); | ||
} | ||
@@ -839,0 +859,0 @@ |
@@ -42,3 +42,3 @@ const Joi = require("joi"); | ||
attributedValue: Joi.alternatives(Joi.string().allow(""), Joi.number(), Joi.date().iso()), | ||
changeMessage: Joi.string().allow("").regex(/%@/), | ||
changeMessage: Joi.string(), | ||
dataDetectorType: Joi.array().items(Joi.string().regex(/(PKDataDetectorTypePhoneNumber|PKDataDetectorTypeLink|PKDataDetectorTypeAddress|PKDataDetectorTypeCalendarEvent)/, "dataDetectorType")), | ||
@@ -45,0 +45,0 @@ label: Joi.string().allow(""), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102786
1346
Updatedgot@^9.6.0
Updatedmoment@^2.24.0