mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 14:25:17 +00:00
Set colors to support hex
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import Joi from "joi";
|
import Joi from "joi";
|
||||||
|
import { RGB_HEX_COLOR_REGEX } from ".";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For a better description of every single field,
|
* For a better description of every single field,
|
||||||
@@ -105,7 +106,7 @@ const SeatSemantics = Joi.object<SemanticTagType.Seat>().keys({
|
|||||||
* For newly-introduced event tickets
|
* For newly-introduced event tickets
|
||||||
* in iOS 18
|
* in iOS 18
|
||||||
*/
|
*/
|
||||||
seatSectionColor: Joi.string(),
|
seatSectionColor: Joi.string().regex(RGB_HEX_COLOR_REGEX),
|
||||||
});
|
});
|
||||||
|
|
||||||
const LocationSemantics = Joi.object<SemanticTagType.Location>().keys({
|
const LocationSemantics = Joi.object<SemanticTagType.Location>().keys({
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import { CertificatesSchema } from "./Certificates";
|
|||||||
|
|
||||||
import * as Messages from "../messages";
|
import * as Messages from "../messages";
|
||||||
|
|
||||||
const RGB_COLOR_REGEX =
|
export const RGB_HEX_COLOR_REGEX =
|
||||||
/rgb\(\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*\)/;
|
/(#[a-fA-F0-9]{3,6}|rgb\(\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*,\s*(?:[01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\s*\))/;
|
||||||
|
|
||||||
const URL_REGEX = /https?:\/\/(?:[a-z0-9]+\.?)+(?::\d{2,})?(?:\/[\S]+)*/;
|
const URL_REGEX = /https?:\/\/(?:[a-z0-9]+\.?)+(?::\d{2,})?(?:\/[\S]+)*/;
|
||||||
|
|
||||||
@@ -311,9 +311,9 @@ export const OverridablePassProps = Joi.object<OverridablePassProps>({
|
|||||||
suppressStripShine: Joi.boolean(),
|
suppressStripShine: Joi.boolean(),
|
||||||
maxDistance: Joi.number().positive(),
|
maxDistance: Joi.number().positive(),
|
||||||
authenticationToken: Joi.string().min(16),
|
authenticationToken: Joi.string().min(16),
|
||||||
labelColor: Joi.string().regex(RGB_COLOR_REGEX),
|
labelColor: Joi.string().regex(RGB_HEX_COLOR_REGEX),
|
||||||
backgroundColor: Joi.string().regex(RGB_COLOR_REGEX),
|
backgroundColor: Joi.string().regex(RGB_HEX_COLOR_REGEX),
|
||||||
foregroundColor: Joi.string().regex(RGB_COLOR_REGEX),
|
foregroundColor: Joi.string().regex(RGB_HEX_COLOR_REGEX),
|
||||||
associatedStoreIdentifiers: Joi.array().items(Joi.number()),
|
associatedStoreIdentifiers: Joi.array().items(Joi.number()),
|
||||||
userInfo: Joi.alternatives(Joi.object().unknown(), Joi.array()),
|
userInfo: Joi.alternatives(Joi.object().unknown(), Joi.array()),
|
||||||
webServiceURL: Joi.string().regex(URL_REGEX),
|
webServiceURL: Joi.string().regex(URL_REGEX),
|
||||||
|
|||||||
Reference in New Issue
Block a user