passkit-generator
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -487,3 +487,3 @@ # API Reference | ||
Unlike method-set properties or overrides, to set fields inside areas (*primaryFields*, *secondaryFields*, *auxiliaryFields*, *headerFields*, *backFields*), this library make available a dedicated interface that extends native Array, to let you perform all the operations you need on the fields. Still, **shouldOverride** option, will determine whether default inserted fields should be kept or not. | ||
Unlike method-set properties or overrides, to set fields inside _areas_ (*primaryFields*, *secondaryFields*, *auxiliaryFields*, *headerFields*, *backFields*), this library make available a dedicated interface that extends native Array, to let you perform all the operations you need on the fields. Fields already available in pass.json, will be automatically loaded in the library. Therefore, reading one of the _areas_, will also show those that were loaded. | ||
@@ -490,0 +490,0 @@ **Examples:** |
@@ -6,2 +6,7 @@ # Changelog | ||
## 2.0.1 | ||
Typescript version update; | ||
Update to webServiceURL schema regex and allowed all characters for authenticationToken; | ||
## 2.0.0 | ||
@@ -8,0 +13,0 @@ |
{ | ||
"name": "passkit-generator", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "The easiest way to generate custom Apple Wallet passes in Node.js", | ||
@@ -39,4 +39,4 @@ "main": "index.js", | ||
"jasmine": "^3.4.0", | ||
"typescript": "^3.5.2" | ||
"typescript": "^3.7.2" | ||
} | ||
} |
@@ -24,4 +24,2 @@ <div align="center"> | ||
This package comes with an [API documentation](./API.md), that makes available a series of methods to customize passes. | ||
> ⚠ Do not rely on branches outside "master", as might not be stable and will be removed once merged. | ||
@@ -36,2 +34,8 @@ | ||
### API Documentation | ||
This package comes with an [API documentation](./API.md), that makes available a series of methods to create and customize passes. | ||
___ | ||
### Looking for the previous major version? | ||
@@ -53,7 +57,11 @@ | ||
The first thing you'll have to do, is to start creating a model. A model will contain all the basic pass infos, like the thumbnails, the icon, and the background and **pass.json** containing all the static infos about the pass, like Team identifier, Pass type identifier, colors, etc. | ||
The first thing you'll have to do, is to start creating a model. A model contains all the basic pass data that compose the Pass identity. | ||
These data can be files (icon, thumbnails, ...), or pieces of information to be written in `pass.json` (Pass type identifier, Team Identifier, colors, ...). | ||
If starting from scratch, the preferred solution is to use the folder as model, as it will allow you to access easily all the files. Also, a buffer model is mainly designed for models that are ready to be used in your application. | ||
This package allows to use two kinds of models: **Folder Model** or **Buffer Model**. If starting from scratch, the preferred solution is to use the folder as model, as it will allow you to access easily all the files. Also, a buffer model is mainly designed for models that are ready to be used in your application. | ||
Let's suppose you have a file `model.zip` stored somewhere: you unzip it in runtime and then get the access to its files as buffers. Those buffers should be available for the rest of your application run-time and you shouldn't be in need to read them every time you are going to create a pass. | ||
> To keep a model in memory, the method [`createAbstractModel`](https://github.com/alexandercerutti/passkit-generator/blob/master/API.md#create-an-abstract-model) has been created. | ||
___ | ||
@@ -139,10 +147,11 @@ | ||
```typescript | ||
const { createPass, Pass } = require("passkit-generator"); | ||
// or, for typescript | ||
/** | ||
* Use `const { createPass } = require("passkit-generator");` | ||
* for usage in pure Node.js. Please note that `Pass` is only exported | ||
* as Typescript type. | ||
*/ | ||
import { createPass, Pass } from "passkit-generator"; | ||
let examplePass: Pass; | ||
try { | ||
examplePass = await createPass({ | ||
const examplePass = await createPass({ | ||
model: "./passModels/myFirstModel", | ||
@@ -149,0 +158,0 @@ certificates: { |
@@ -484,4 +484,4 @@ "use strict"; | ||
} | ||
exports.Pass = Pass; | ||
_a = passProps, _b = transitType; | ||
exports.Pass = Pass; | ||
/** | ||
@@ -488,0 +488,0 @@ * Automatically generates barcodes for all the types given common info |
@@ -30,4 +30,4 @@ "use strict"; | ||
// parsing url as set of words and nums followed by dots, optional port and any possible path after | ||
webServiceURL: joi_1.default.string().regex(/https?:\/\/(?:(?:[a-z0-9]+\.?)+(?::\d)?(?:\/[\S]+)*)*/), | ||
authenticationToken: joi_1.default.string().token().min(16), | ||
webServiceURL: joi_1.default.string().regex(/https?:\/\/(?:[a-z0-9]+\.?)+(?::\d{2,})?(?:\/[\S]+)*/), | ||
authenticationToken: joi_1.default.string().min(16), | ||
sharingProhibited: joi_1.default.boolean(), | ||
@@ -34,0 +34,0 @@ backgroundColor: joi_1.default.string().min(10).max(16), |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
138777
195
0