mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Renamed Personalization to Personalize
This commit is contained in:
@@ -394,11 +394,9 @@ export default class PKPass extends Bundle {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
validateJSONBuffer(buffer, Schemas.Personalization);
|
validateJSONBuffer(buffer, Schemas.Personalize);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(
|
console.warn(formatMessage(Messages.PERSONALIZE.INVALID, err));
|
||||||
formatMessage(Messages.PERSONALIZATION.INVALID, err),
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export const PASS_SOURCE = {
|
|||||||
JOIN: "The imported pass.json's properties will be joined with the current setted props. You might lose some data.",
|
JOIN: "The imported pass.json's properties will be joined with the current setted props. You might lose some data.",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const PERSONALIZATION = {
|
export const PERSONALIZE = {
|
||||||
INVALID:
|
INVALID:
|
||||||
"Cannot add personalization.json to bundle because it is invalid. %s",
|
"Cannot add personalization.json to bundle because it is invalid. %s",
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -2,22 +2,21 @@ import Joi from "joi";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @see https://developer.apple.com/documentation/walletpasses/personalize
|
* @see https://developer.apple.com/documentation/walletpasses/personalize
|
||||||
* @TODO Rename "Personalization" in "Personalize". This will be done in v3.0
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface Personalization {
|
|
||||||
description: string;
|
|
||||||
requiredPersonalizationFields: RequiredPersonalizationFields[];
|
|
||||||
termsAndConditions?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type RequiredPersonalizationFields =
|
type RequiredPersonalizationFields =
|
||||||
| "PKPassPersonalizationFieldName"
|
| "PKPassPersonalizationFieldName"
|
||||||
| "PKPassPersonalizationFieldPostalCode"
|
| "PKPassPersonalizationFieldPostalCode"
|
||||||
| "PKPassPersonalizationFieldEmailAddress"
|
| "PKPassPersonalizationFieldEmailAddress"
|
||||||
| "PKPassPersonalizationFieldPhoneNumber";
|
| "PKPassPersonalizationFieldPhoneNumber";
|
||||||
|
|
||||||
export const Personalization = Joi.object<Personalization>().keys({
|
export interface Personalize {
|
||||||
|
description: string;
|
||||||
|
requiredPersonalizationFields: RequiredPersonalizationFields[];
|
||||||
|
termsAndConditions?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Personalize = Joi.object<Personalize>().keys({
|
||||||
description: Joi.string().required(),
|
description: Joi.string().required(),
|
||||||
requiredPersonalizationFields: Joi.array()
|
requiredPersonalizationFields: Joi.array()
|
||||||
.items(
|
.items(
|
||||||
|
|||||||
Reference in New Issue
Block a user