@suiteop/storefront 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var zod = require('zod');
4
-
5
- var emailField=zod.z.string().trim().toLowerCase().pipe(zod.z.email("validation.email_invalid"));zod.z.string().trim().min(1,"validation.email_required").pipe(emailField);var trimmedEmailField=zod.z.string().trim().pipe(zod.z.email("validation.email_invalid"));var requiredTrimmedEmailField=zod.z.string().trim().min(1,"validation.email_required").pipe(trimmedEmailField);zod.z.string().nullish().transform((raw,ctx)=>{if(raw===void 0)return void 0;const trimmed=(raw??"").trim().toLowerCase();if(!trimmed)return null;if(!zod.z.email().safeParse(trimmed).success){ctx.addIssue({code:"custom",message:"validation.email_invalid"});return zod.z.NEVER}return trimmed});zod.z.uuid();var storefrontSiteSchema=zod.z.object({id:zod.z.uuid(),name:zod.z.string(),slug:zod.z.string(),isActive:zod.z.boolean(),enableWebChat:zod.z.boolean(),mapEmbedHost:zod.z.string().nullable(),countryCode:zod.z.string().nullish(),bookingsOpen:zod.z.boolean().optional()});var storefrontListingSummarySchema=zod.z.object({id:zod.z.uuid(),buildingId:zod.z.uuid(),sortOrder:zod.z.number().int(),name:zod.z.string(),coverImageUrl:zod.z.string().nullable(),city:zod.z.string().nullable(),state:zod.z.string().nullable(),bedroomCount:zod.z.number().int().nullable(),bathroomCount:zod.z.number().nullable(),maxGuests:zod.z.number().int().nullable(),averageRating:zod.z.number().nullable(),latitude:zod.z.number().nullable(),longitude:zod.z.number().nullable(),bookable:zod.z.boolean()});var storefrontListingSchema=storefrontListingSummarySchema.extend({buildingSlug:zod.z.string(),buildingAddress:zod.z.unknown(),description:zod.z.string().nullable(),amenities:zod.z.array(zod.z.string()),pictures:zod.z.unknown(),rooms:zod.z.unknown(),houseRules:zod.z.string().nullable(),checkInTime:zod.z.string().nullable(),checkOutTime:zod.z.string().nullable(),beds:zod.z.number().nullable(),fromPriceMinor:zod.z.number().int().nonnegative().nullish(),currency:zod.z.string().nullish(),countryCode:zod.z.string().nullish()});zod.z.object({location:zod.z.string().trim().min(1).max(200).optional(),building:zod.z.uuid().optional(),limit:zod.z.coerce.number().int().min(1).max(100).default(50),offset:zod.z.coerce.number().int().min(0).max(1e4).default(0)});var storefrontImageSchema=zod.z.object({url:zod.z.string(),alt:zod.z.string().nullable(),width:zod.z.number().int().nullable(),height:zod.z.number().int().nullable()});var storefrontBuildingSchema=zod.z.object({id:zod.z.uuid(),locationId:zod.z.uuid().nullable(),nameId:zod.z.uuid().nullable(),descriptionId:zod.z.uuid().nullable(),slug:zod.z.string(),imageId:zod.z.uuid().nullable(),latitude:zod.z.number().nullable(),longitude:zod.z.number().nullable(),address:zod.z.unknown(),name:zod.z.string().nullish(),description:zod.z.string().nullish(),imageUrl:zod.z.string().nullish(),images:zod.z.array(storefrontImageSchema).nullish(),sortOrder:zod.z.number().int().nullish(),listingCount:zod.z.number().int().nullish(),fields:zod.z.record(zod.z.string(),zod.z.record(zod.z.string(),zod.z.unknown())).nullish()});var storefrontLocationSchema=zod.z.object({id:zod.z.uuid(),type:zod.z.string(),parentId:zod.z.uuid().nullable(),nameId:zod.z.uuid().nullable(),slug:zod.z.string().nullable(),imageId:zod.z.uuid().nullable(),latitude:zod.z.number().nullable(),longitude:zod.z.number().nullable(),address:zod.z.unknown(),sortOrder:zod.z.number().int(),name:zod.z.string().nullish(),description:zod.z.string().nullish(),imageUrl:zod.z.string().nullish(),images:zod.z.array(storefrontImageSchema).nullish(),buildingCount:zod.z.number().int().nullish(),fields:zod.z.record(zod.z.string(),zod.z.record(zod.z.string(),zod.z.unknown())).nullish()});zod.z.object({locale:zod.z.string().max(35).optional().catch(void 0)});var storefrontReviewSchema=zod.z.object({id:zod.z.uuid(),listingId:zod.z.uuid().nullable(),reviewedAt:zod.z.string().nullable(),rating:zod.z.number().nullable(),publicReview:zod.z.string(),source:zod.z.string().nullable()});zod.z.object({listingId:zod.z.uuid().optional(),limit:zod.z.coerce.number().int().min(1).max(100).default(20),offset:zod.z.coerce.number().int().min(0).max(1e4).default(0)});zod.z.object({name:zod.z.string().trim().min(1,"validation.name_required").max(200,"validation.name_max_length"),email:requiredTrimmedEmailField,subject:zod.z.string().trim().min(1,"validation.title_required").max(300,"validation.title_max_length"),message:zod.z.string().trim().min(10,"validation.message_min_length").max(1e4,"validation.message_max_length")});var storefrontContactResultSchema=zod.z.object({sent:zod.z.literal(true)});var storefrontContentRefSchema=zod.z.object({kind:zod.z.string(),id:zod.z.uuid(),slug:zod.z.string().nullable()});var storefrontContentItemSchema=zod.z.object({id:zod.z.uuid(),type:zod.z.string(),slug:zod.z.string().nullable(),publishedAt:zod.z.string().nullable(),updatedAt:zod.z.string(),sortOrder:zod.z.number().int(),fields:zod.z.record(zod.z.string(),zod.z.unknown())});var storefrontContentFieldDefSchema=zod.z.object({key:zod.z.string(),type:zod.z.string()}).catchall(zod.z.unknown());var storefrontContentModelSchema=zod.z.object({version:zod.z.number().int(),types:zod.z.array(zod.z.object({key:zod.z.string(),kind:zod.z.string(),fields:zod.z.array(storefrontContentFieldDefSchema)}).catchall(zod.z.unknown()))});zod.z.object({limit:zod.z.coerce.number().int().min(1).max(100).default(20),offset:zod.z.coerce.number().int().min(0).max(1e4).default(0),locale:zod.z.string().max(35).optional().catch(void 0)});zod.z.string().regex(/^[a-z][a-z0-9_]{0,39}$/);zod.z.string().min(1).max(120).regex(/^[a-z0-9-]+$/);
6
-
7
- exports.requiredTrimmedEmailField = requiredTrimmedEmailField;
8
- exports.storefrontBuildingSchema = storefrontBuildingSchema;
9
- exports.storefrontContactResultSchema = storefrontContactResultSchema;
10
- exports.storefrontContentItemSchema = storefrontContentItemSchema;
11
- exports.storefrontContentModelSchema = storefrontContentModelSchema;
12
- exports.storefrontContentRefSchema = storefrontContentRefSchema;
13
- exports.storefrontImageSchema = storefrontImageSchema;
14
- exports.storefrontListingSchema = storefrontListingSchema;
15
- exports.storefrontListingSummarySchema = storefrontListingSummarySchema;
16
- exports.storefrontLocationSchema = storefrontLocationSchema;
17
- exports.storefrontReviewSchema = storefrontReviewSchema;
18
- exports.storefrontSiteSchema = storefrontSiteSchema;
@@ -1,5 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- var emailField=z.string().trim().toLowerCase().pipe(z.email("validation.email_invalid"));z.string().trim().min(1,"validation.email_required").pipe(emailField);var trimmedEmailField=z.string().trim().pipe(z.email("validation.email_invalid"));var requiredTrimmedEmailField=z.string().trim().min(1,"validation.email_required").pipe(trimmedEmailField);z.string().nullish().transform((raw,ctx)=>{if(raw===void 0)return void 0;const trimmed=(raw??"").trim().toLowerCase();if(!trimmed)return null;if(!z.email().safeParse(trimmed).success){ctx.addIssue({code:"custom",message:"validation.email_invalid"});return z.NEVER}return trimmed});z.uuid();var storefrontSiteSchema=z.object({id:z.uuid(),name:z.string(),slug:z.string(),isActive:z.boolean(),enableWebChat:z.boolean(),mapEmbedHost:z.string().nullable(),countryCode:z.string().nullish(),bookingsOpen:z.boolean().optional()});var storefrontListingSummarySchema=z.object({id:z.uuid(),buildingId:z.uuid(),sortOrder:z.number().int(),name:z.string(),coverImageUrl:z.string().nullable(),city:z.string().nullable(),state:z.string().nullable(),bedroomCount:z.number().int().nullable(),bathroomCount:z.number().nullable(),maxGuests:z.number().int().nullable(),averageRating:z.number().nullable(),latitude:z.number().nullable(),longitude:z.number().nullable(),bookable:z.boolean()});var storefrontListingSchema=storefrontListingSummarySchema.extend({buildingSlug:z.string(),buildingAddress:z.unknown(),description:z.string().nullable(),amenities:z.array(z.string()),pictures:z.unknown(),rooms:z.unknown(),houseRules:z.string().nullable(),checkInTime:z.string().nullable(),checkOutTime:z.string().nullable(),beds:z.number().nullable(),fromPriceMinor:z.number().int().nonnegative().nullish(),currency:z.string().nullish(),countryCode:z.string().nullish()});z.object({location:z.string().trim().min(1).max(200).optional(),building:z.uuid().optional(),limit:z.coerce.number().int().min(1).max(100).default(50),offset:z.coerce.number().int().min(0).max(1e4).default(0)});var storefrontImageSchema=z.object({url:z.string(),alt:z.string().nullable(),width:z.number().int().nullable(),height:z.number().int().nullable()});var storefrontBuildingSchema=z.object({id:z.uuid(),locationId:z.uuid().nullable(),nameId:z.uuid().nullable(),descriptionId:z.uuid().nullable(),slug:z.string(),imageId:z.uuid().nullable(),latitude:z.number().nullable(),longitude:z.number().nullable(),address:z.unknown(),name:z.string().nullish(),description:z.string().nullish(),imageUrl:z.string().nullish(),images:z.array(storefrontImageSchema).nullish(),sortOrder:z.number().int().nullish(),listingCount:z.number().int().nullish(),fields:z.record(z.string(),z.record(z.string(),z.unknown())).nullish()});var storefrontLocationSchema=z.object({id:z.uuid(),type:z.string(),parentId:z.uuid().nullable(),nameId:z.uuid().nullable(),slug:z.string().nullable(),imageId:z.uuid().nullable(),latitude:z.number().nullable(),longitude:z.number().nullable(),address:z.unknown(),sortOrder:z.number().int(),name:z.string().nullish(),description:z.string().nullish(),imageUrl:z.string().nullish(),images:z.array(storefrontImageSchema).nullish(),buildingCount:z.number().int().nullish(),fields:z.record(z.string(),z.record(z.string(),z.unknown())).nullish()});z.object({locale:z.string().max(35).optional().catch(void 0)});var storefrontReviewSchema=z.object({id:z.uuid(),listingId:z.uuid().nullable(),reviewedAt:z.string().nullable(),rating:z.number().nullable(),publicReview:z.string(),source:z.string().nullable()});z.object({listingId:z.uuid().optional(),limit:z.coerce.number().int().min(1).max(100).default(20),offset:z.coerce.number().int().min(0).max(1e4).default(0)});z.object({name:z.string().trim().min(1,"validation.name_required").max(200,"validation.name_max_length"),email:requiredTrimmedEmailField,subject:z.string().trim().min(1,"validation.title_required").max(300,"validation.title_max_length"),message:z.string().trim().min(10,"validation.message_min_length").max(1e4,"validation.message_max_length")});var storefrontContactResultSchema=z.object({sent:z.literal(true)});var storefrontContentRefSchema=z.object({kind:z.string(),id:z.uuid(),slug:z.string().nullable()});var storefrontContentItemSchema=z.object({id:z.uuid(),type:z.string(),slug:z.string().nullable(),publishedAt:z.string().nullable(),updatedAt:z.string(),sortOrder:z.number().int(),fields:z.record(z.string(),z.unknown())});var storefrontContentFieldDefSchema=z.object({key:z.string(),type:z.string()}).catchall(z.unknown());var storefrontContentModelSchema=z.object({version:z.number().int(),types:z.array(z.object({key:z.string(),kind:z.string(),fields:z.array(storefrontContentFieldDefSchema)}).catchall(z.unknown()))});z.object({limit:z.coerce.number().int().min(1).max(100).default(20),offset:z.coerce.number().int().min(0).max(1e4).default(0),locale:z.string().max(35).optional().catch(void 0)});z.string().regex(/^[a-z][a-z0-9_]{0,39}$/);z.string().min(1).max(120).regex(/^[a-z0-9-]+$/);
4
-
5
- export { requiredTrimmedEmailField, storefrontBuildingSchema, storefrontContactResultSchema, storefrontContentItemSchema, storefrontContentModelSchema, storefrontContentRefSchema, storefrontImageSchema, storefrontListingSchema, storefrontListingSummarySchema, storefrontLocationSchema, storefrontReviewSchema, storefrontSiteSchema };