@shophost/rest-api 2.0.39 → 2.0.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shophost/rest-api",
3
- "version": "2.0.39",
3
+ "version": "2.0.40",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "shophost-rest-api": "./scripts/shophost-rest-api.mjs"
@@ -1 +1 @@
1
- import{z as e}from"@hono/zod-openapi";import{validateRequiredForDefaultLocale as a}from"../../core/utils/zod.util";import{locale as o}from"../../schemas/locales.schema";export const ModifierSchema=e.object({id:e.string().cuid().optional(),title:e.string().min(1,"This field is required").openapi({example:"Large",description:"Title of the modifier"}),sku:e.coerce.string().optional().openapi({example:"csd9876543210abcdef",description:"Stock Keeping Unit identifier"}),price:e.coerce.number().optional().default(0).openapi({example:2.5,description:"Price of the modifier"})}).openapi("Modifier"),ModifierGroupSchema=e.object({id:e.string().cuid(),selectMin:e.coerce.number().min(0).openapi({example:1,description:"Minimum number of modifiers that can be selected"}),selectMax:e.coerce.number().min(0).openapi({example:1,description:"Maximum number of modifiers that can be selected"}),defaultLocale:o.optional(),modifiers:e.array(ModifierSchema).optional().openapi({}),translations:e.array(e.object({locale:o,title:e.string().optional().openapi({example:"Size",description:"Title of the modifier group"})}))}).openapi("ModifierGroup"),LocalizedModifierGroupSchema=ModifierGroupSchema.extend({title:e.string().default("").nullable()}).omit({translations:!0}).openapi("LocalizedModifierGroup"),CreateOrUpdateModifierGroupSchema=e.object({selectMin:e.coerce.number().min(0).openapi({example:1,description:"Minimum number of modifiers that can be selected"}),selectMax:e.coerce.number().min(0).openapi({example:1,description:"Maximum number of modifiers that can be selected"}),defaultLocale:o.optional(),modifiers:e.array(ModifierSchema).optional().openapi({}),translations:e.array(e.object({locale:o,title:e.string().optional().openapi({example:"Size",description:"Title of the modifier group"})}))}).refine(i=>i.selectMax>=i.selectMin,{message:"Maximum selections must be greater than or equal to minimum selections",path:["selectMax"]}).refine(i=>{var t;const r=((t=i.modifiers)===null||t===void 0?void 0:t.length)||0;return i.selectMax<=r},{message:"Maximum selections cannot exceed the total number of modifiers",path:["selectMax"]}).superRefine(a("title")).openapi("ModifierGroup");
1
+ import{z as e}from"@hono/zod-openapi";import{validateRequiredForDefaultLocale as a}from"../../core/utils/zod.util";import{locale as o}from"../../schemas/locales.schema";export const ModifierSchema=e.object({id:e.string().cuid().optional(),title:e.string().min(1,"This field is required").openapi({example:"Large",description:"Title of the modifier"}),sku:e.coerce.string().optional().openapi({example:"csd9876543210abcdef",description:"Stock Keeping Unit identifier"}),price:e.coerce.number().optional().default(0).openapi({example:2.5,description:"Price of the modifier"})}).openapi("Modifier"),ModifierGroupSchema=e.object({id:e.string().cuid(),selectMin:e.coerce.number().min(0).openapi({example:1,description:"Minimum number of modifiers that can be selected"}),selectMax:e.coerce.number().min(0).openapi({example:1,description:"Maximum number of modifiers that can be selected"}),defaultLocale:o.optional(),modifiers:e.array(ModifierSchema).optional().openapi({}),translations:e.array(e.object({locale:o,title:e.string().optional().openapi({example:"Size",description:"Title of the modifier group"})}))}).openapi("ModifierGroup"),LocalizedModifierGroupSchema=ModifierGroupSchema.extend({title:e.string().default("").nullable()}).omit({translations:!0}).openapi("LocalizedModifierGroup"),CreateOrUpdateModifierGroupSchema=e.object({selectMin:e.coerce.number().min(0).openapi({example:1,description:"Minimum number of modifiers that can be selected"}),selectMax:e.coerce.number().min(0).openapi({example:1,description:"Maximum number of modifiers that can be selected"}),defaultLocale:o.optional(),modifiers:e.array(ModifierSchema).optional().openapi({}),translations:e.array(e.object({locale:o,title:e.string().optional().openapi({example:"Size",description:"Title of the modifier group"})}))}).refine(i=>i.selectMax>=i.selectMin,{message:"Maximum selections must be greater than or equal to minimum selections",path:["selectMax"]}).refine(i=>{var t;const r=((t=i.modifiers)===null||t===void 0?void 0:t.length)||0;return i.selectMax<=r},{message:"Maximum selections cannot exceed the total number of modifiers",path:["selectMax"]}).superRefine(a("title")).openapi("CreateOrUpdateModifierGroup");
@@ -1 +1 @@
1
- {"version":3,"file":"product-modifier.schema.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/product/product-modifier.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC,OAAO,CAAC;QACzD,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,uBAAuB;KACrC,CAAC;IACF,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QACxC,OAAO,EAAE,qBAAqB;QAC9B,WAAW,EAAE,+BAA+B;KAC7C,CAAC;IACF,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACrD,OAAO,EAAE,GAAG;QACZ,WAAW,EAAE,uBAAuB;KACrC,CAAC;CACH,CAAC;KACD,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QA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AAC;QAC1C,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,kDAAkD;KAChE,CAAC;IACF,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACzD,YAAY,EAAE,CAAC,CAAC,KAAK,CACnB,CAAC,CAAC,MAAM,CAAC;QACP,MAAM;QACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;YACnC,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,6BAA6B;SAC3C,CAAC;KACH,CAAC,CACH;CACF,CAAC;KACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE;IAClD,OAAO,EACL,wEAAwE;IAC1E,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;;IACP,MAAM,aAAa,GAAG,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,MAAM,KAAI,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC,SAAS,IAAI,aAAa,CAAC;AACzC,CAAC,EACD;IACE,OAAO,EAAE,gEAAgE;IACzE,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CACF;KACA,WAAW,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC;KACtD,OAAO,CAAC,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"product-modifier.schema.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/product/product-modifier.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;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