in libs/newsletters-data-client/src/lib/schemas/newsletter-data-type.ts [100:185]
group: nonEmptyString().describe('Group'),
signUpHeadline: z.string().optional().describe('Sign up headline'),
signUpDescription: nonEmptyString().describe('Sign up description'),
signUpEmbedDescription: nonEmptyString().describe(
'Sign up embed description',
),
regionFocus: regionFocusEnumSchema.describe('Region focus'),
frequency: nonEmptyString().describe('Frequency'),
listId: z.number(),
listIdV1: z.number(),
campaignName: z.string().optional(),
campaignCode: z.string().optional(),
brazeSubscribeAttributeNameAlternate: z
.array(underscoreCasedString())
.optional(),
signupPage: urlPathString(
'Please add the path of the Guardian URL from the slash e.g. for https://www.theguardian.com/global/sign-up-for-newsletter just use /global/sign-up-for-newsletter',
)
.optional()
.describe('Path to Sign up page'),
exampleUrl: z.string().optional().describe('Example url'),
designBriefDoc: z.string().optional().describe('Design brief doc'),
figmaDesignUrl: z.string().url().optional().describe('Figma design url'),
figmaIncludesThrashers: z
.boolean()
.describe('Does the figma design include thrashers?'),
illustrationCircle: z.string().optional(),
illustrationCard: z
.string()
.url()
.optional()
.describe('URL of image the newsleter graphic/logo (5:3 format)'),
illustrationSquare: z
.string()
.url()
.optional()
.describe('URL of image the newsleter graphic/logo (1:1 format)'),
creationTimeStamp: z.number(),
cancellationTimeStamp: z.number().optional(),
seriesTag: tagPathString(
'Please add the path of the series tag e.g. for https://www.theguardian.com/world/series/first-edition just use world/series/first-edition. Can only include lower-case letters, number and dashes, separated by slashes',
)
.optional()
.describe('Series tag (path)'),
seriesTagDescription: z
.string()
.optional()
.describe('The Series tag description'),
composerTag: z.string().optional().describe('Composer tag(s)'),
composerCampaignTag: z
.string()
.optional()
.describe('Composer campaign tag description'),
launchDate: z.coerce.date().describe('Launch date'),
signUpPageDate: z.coerce.date().describe('Sign up page date'),
thrasherDate: z.coerce.date().describe('Thrasher date'),
privateUntilLaunch: z.boolean().describe('Needs to be private until launch?'),
onlineArticle: onlineArticleSchema.optional(),
renderingOptions: renderingOptionsSchema.optional(),
thrasherOptions: thrasherOptionsSchema.optional(),
mailSuccessDescription: z
.string()
.optional()
.describe('Sign-up success message'),
brazeCampaignCreationStatus: workflowStatusEnumSchema.describe(
'Braze campaign creation status',
),
ophanCampaignCreationStatus: workflowStatusEnumSchema
.optional()
.describe(
'Ophan campaign creation status',
),
signupPageCreationStatus: workflowStatusEnumSchema.describe(
'Sign up creation status',
),
tagCreationStatus: workflowStatusEnumSchema.describe('Tag creation status'),
});
/** NOT FINAL - this type a placeholder to test the data transformation structure */
export type NewsletterData = z.infer<typeof newsletterDataSchema>;
export function isNewsletterData(subject: unknown): subject is NewsletterData {