@shophost/rest-api 2.0.67 → 2.0.69
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 +1 -1
- package/schema.prisma +1 -0
- package/scripts/shophost-rest-api.mjs +198 -1
- package/src/bootstrap.js +1 -1
- package/src/container.js +1 -1
- package/src/core/auth/auth.schema.js +1 -1
- package/src/core/auth/auth.util.js +1 -1
- package/src/core/auth/better-auth.lib.js +1 -1
- package/src/core/auth/generate-password-hash.util.js +1 -1
- package/src/core/auth/headers.schema.js +1 -1
- package/src/core/auth/user.schema.js +1 -1
- package/src/core/db/__generated__/client/browser.js +1 -1
- package/src/core/db/__generated__/client/client.js +1 -1
- package/src/core/db/__generated__/client/enums.js +1 -1
- package/src/core/db/__generated__/client/internal/class.js +789 -1
- package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +1 -0
- package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.d.ts +1 -0
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js +1 -1
- package/src/core/db/__generated__/client/models/OrganizationConfiguration.d.ts +41 -1
- package/src/core/db/index.js +1 -1
- package/src/core/email/components.js +1 -1
- package/src/core/exceptions/http-exception.js +1 -1
- package/src/core/hono/hono.js +1 -1
- package/src/core/lib/prisma.js +1 -1
- package/src/core/logging/pino.js +1 -1
- package/src/core/notifications/email.service.js +1 -1
- package/src/core/openapi/openapi.lib.js +1 -1
- package/src/core/utils/currency.util.js +1 -1
- package/src/core/utils/env.util.js +1 -1
- package/src/core/utils/object.util.js +1 -1
- package/src/core/utils/translations.util.js +1 -1
- package/src/core/utils/zod.util.js +1 -1
- package/src/db.js +1 -1
- package/src/features/access/access.handler.js +1 -1
- package/src/features/access/access.route.js +1 -1
- package/src/features/access/access.schema.js +1 -1
- package/src/features/access/access.service.js +1 -1
- package/src/features/analytics/analytics.handler.js +1 -1
- package/src/features/analytics/analytics.route.js +1 -1
- package/src/features/analytics/analytics.schema.js +1 -1
- package/src/features/analytics/analytics.service.js +1 -1
- package/src/features/cart/cart.handler.js +1 -1
- package/src/features/cart/cart.route.js +1 -1
- package/src/features/cart/cart.schema.js +1 -1
- package/src/features/cart/cart.service.js +1 -1
- package/src/features/cart/cart.util.js +1 -1
- package/src/features/customer/customer.handler.js +1 -1
- package/src/features/customer/customer.route.js +1 -1
- package/src/features/customer/customer.schema.js +1 -1
- package/src/features/customer/customer.service.js +1 -1
- package/src/features/file/file.handler.js +1 -1
- package/src/features/file/file.route.js +1 -1
- package/src/features/file/file.schema.js +1 -1
- package/src/features/file/file.service.js +1 -1
- package/src/features/health/health.handler.js +1 -1
- package/src/features/health/health.route.js +1 -1
- package/src/features/index.js +1 -1
- package/src/features/integration/integration-config.js +1 -1
- package/src/features/integration/integration-registry.js +1 -1
- package/src/features/integration/integration.handler.js +1 -1
- package/src/features/integration/integration.route.js +1 -1
- package/src/features/integration/integration.schema.js +1 -1
- package/src/features/integration/integration.service.js +1 -1
- package/src/features/inventory/inventory.service.js +1 -1
- package/src/features/location/location.handler.js +1 -1
- package/src/features/location/location.route.js +1 -1
- package/src/features/location/location.schema.js +1 -1
- package/src/features/location/location.service.js +1 -1
- package/src/features/manufacturer/manufacturer.handler.js +1 -1
- package/src/features/manufacturer/manufacturer.route.js +1 -1
- package/src/features/manufacturer/manufacturer.schema.js +1 -1
- package/src/features/manufacturer/manufacturer.service.js +1 -1
- package/src/features/order/emails/order-confirmation.email.js +1 -1
- package/src/features/order/emails/order-notification.email.js +1 -1
- package/src/features/order/fulfilment.schema.js +1 -1
- package/src/features/order/order-fulfillment.service.js +1 -1
- package/src/features/order/order.handler.js +1 -1
- package/src/features/order/order.route.js +1 -1
- package/src/features/order/order.schema.js +1 -1
- package/src/features/order/order.service.js +1 -1
- package/src/features/order/recipient.schema.js +1 -1
- package/src/features/organization/legal-entity.schema.js +1 -1
- package/src/features/organization/organization-configuration.schema.d.ts +2 -0
- package/src/features/organization/organization-configuration.schema.js +1 -1
- package/src/features/organization/organization.handler.js +1 -1
- package/src/features/organization/organization.route.d.ts +5 -0
- package/src/features/organization/organization.route.js +1 -1
- package/src/features/organization/organization.schema.d.ts +2 -0
- package/src/features/organization/organization.schema.js +1 -1
- package/src/features/organization/organization.service.d.ts +4 -0
- package/src/features/organization/organization.service.js +1 -1
- package/src/features/payment/payment-webhook.service.js +1 -1
- package/src/features/payment/payment.handler.js +1 -1
- package/src/features/payment/payment.route.js +1 -1
- package/src/features/payment/payment.schema.js +1 -1
- package/src/features/payment/payment.service.js +1 -1
- package/src/features/payment/stripe.service.js +1 -1
- package/src/features/product/product-modifier.schema.js +1 -1
- package/src/features/product/product.handler.js +1 -1
- package/src/features/product/product.route.js +1 -1
- package/src/features/product/product.schema.js +1 -1
- package/src/features/product/product.service.js +1 -1
- package/src/features/product-category/product-category.handler.js +1 -1
- package/src/features/product-category/product-category.route.js +1 -1
- package/src/features/product-category/product-category.schema.js +1 -1
- package/src/features/product-category/product-category.service.js +1 -1
- package/src/features/reservation/emails/reservation-cancellation.email.js +1 -1
- package/src/features/reservation/emails/reservation-confirmation.email.js +1 -1
- package/src/features/reservation/emails/reservation-email-date.d.ts +2 -0
- package/src/features/reservation/emails/reservation-email-date.js +1 -0
- package/src/features/reservation/emails/reservation-notification.email.js +1 -1
- package/src/features/reservation/emails/reservation-updated.email.js +1 -1
- package/src/features/reservation/reservation.handler.js +1 -1
- package/src/features/reservation/reservation.route.js +1 -1
- package/src/features/reservation/reservation.schema.js +1 -1
- package/src/features/reservation/reservation.service.js +1 -1
- package/src/features/shipping/shipping.handler.js +1 -1
- package/src/features/shipping/shipping.route.js +1 -1
- package/src/features/shipping/shipping.service.js +1 -1
- package/src/features/shipping-method/shipping-method.handler.js +1 -1
- package/src/features/shipping-method/shipping-method.route.js +1 -1
- package/src/features/shipping-method/shipping-method.schema.js +1 -1
- package/src/features/shipping-method/shipping-method.service.js +1 -1
- package/src/features/shipping-method/shipping-zone.schema.js +1 -1
- package/src/features/webhook/webhook.handler.js +1 -1
- package/src/features/webhook/webhook.route.js +1 -1
- package/src/index.js +1 -1
- package/src/integrations/next.js +1 -1
- package/src/schemas/address.schema.js +1 -1
- package/src/schemas/currency.schema.js +1 -1
- package/src/schemas/error.schema.js +1 -1
- package/src/schemas/index.d.ts +1 -0
- package/src/schemas/index.js +1 -1
- package/src/schemas/locales.schema.js +1 -1
- package/src/schemas/number.schema.js +1 -1
- package/src/schemas/pagination.schema.js +1 -1
- package/src/schemas/params.schema.js +1 -1
- package/src/schemas/queries.schema.js +1 -1
- package/src/schemas/time-zone.schema.d.ts +9 -0
- package/src/schemas/time-zone.schema.js +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{__awaiter as r}from"tslib";import{createApiRouter as h}from"../../core/hono/hono";import{shippingMethodRoute as p}from"./shipping-method.route";export const registerShippingMethodHandlers=a=>{const n=h();return n.openapi(p.createShippingMethod,i=>r(void 0,void 0,void 0,function*(){const o=i.get("auth"),t=i.req.valid("param"),e=i.req.valid("json"),d=yield o.isGranted("create"),s=yield a.createShippingMethod(t.organizationId,d.id,e);return i.json(s,201)})),n.openapi(p.getShippingMethod,i=>r(void 0,void 0,void 0,function*(){const o=i.get("auth"),t=i.req.valid("param");yield o.isGranted("read");const e=yield a.getShippingMethod(t.organizationId,t.id);return i.json(e,200)})),n.openapi(p.accessEligibility,i=>r(void 0,void 0,void 0,function*(){const o=i.get("auth"),t=i.req.valid("param"),e=yield o.getCurrentUser(),d=yield a.accessEligibility(e,t.organizationId);return i.json(d,200)})),n.openapi(p.getShippingMethods,i=>r(void 0,void 0,void 0,function*(){const o=i.get("auth"),t=i.req.valid("param"),e=i.req.valid("query");yield o.isGranted("read");const d=yield a.getShippingMethods(t.organizationId,Object.assign({},e));return i.json(d,200)})),n.openapi(p.updateShippingMethod,i=>r(void 0,void 0,void 0,function*(){const o=i.get("auth"),t=i.req.valid("param"),e=i.req.valid("json"),d=yield o.isGranted("update"),s=yield a.updateShippingMethod(t.organizationId,t.id,d.id,e);return i.json(s,200)})),n.openapi(p.deleteShippingMethod,i=>r(void 0,void 0,void 0,function*(){const o=i.get("auth"),t=i.req.valid("param"),e=yield o.isGranted("delete");return yield a.deleteShippingMethod(t.organizationId,t.id,e.id),i.body(null,204)})),n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";import{createApiRoute as t}from"../../core/hono/hono";import{CreateShippingMethodSchema as n,ErrorSchema as i,HeaderSchema as a,OrganizationParams as h,OrganizationWithIdParams as s,PaginationMetaSchema as d,PaginationQuerySchema as r,ShippingMethodSchema as o,UpdateShippingMethodSchema as g}from"../../schemas";const p=e.object({id:e.string().openapi({description:"ID of the shipping method",example:"clf9876543210abcdef",param:{in:"path",name:"id"}}),organizationId:e.string().openapi({description:"ID of the organization",example:"cju0z9k4z0000l1qg5z1z1z1z",param:{in:"path",name:"organizationId"}})}),m=t({headers:a,method:"GET",operationId:"getShippingMethod",path:"/:organizationId/shipping-methods/:id",pathParams:s,responses:{200:o,401:i,404:i},summary:"Get Shipping Method",tags:["ShippingMethod"]}),c=t({description:"Fetches a list of published shipping methods a user can use",headers:a,method:"GET",operationId:"accessEligibility",path:"/:organizationId/shipping-methods/access/eligibility",pathParams:h,responses:{200:e.array(o)},summary:"Get Eligible Shipping Methods",tags:["ShippingMethod"]}),S=t({description:"Fetches a paginated list of shipping methods for an organization",headers:a,method:"GET",operationId:"getShippingMethods",path:"/:organizationId/shipping-methods",pathParams:e.object({organizationId:e.string().openapi({description:"ID of the organization",example:"cju0z9k4z0000l1qg5z1z1z1z",param:{in:"path",name:"organizationId"}})}),query:r,responses:{200:e.object({list:e.array(o),meta:d}),400:i,401:i},summary:"Get Shipping Methods",tags:["ShippingMethod"]}),z=t({body:n,description:"Creates a new shipping method for an organization",headers:a,method:"POST",operationId:"createShippingMethod",path:"/:organizationId/shipping-methods",pathParams:e.object({organizationId:e.string().openapi({description:"ID of the organization",example:"cju0z9k4z0000l1qg5z1z1z1z",param:{in:"path",name:"organizationId"}})}),responses:{201:o,400:i,401:i,404:i},summary:"Create Shipping Method",tags:["ShippingMethod"]}),M=t({body:g,description:"Updates an existing shipping method",headers:a,method:"PUT",operationId:"updateShippingMethod",path:"/:organizationId/shipping-methods/:id",pathParams:p,responses:{200:o,400:i,401:i,404:i},summary:"Update Shipping Method",tags:["ShippingMethod"]}),l=t({description:"Soft deletes a shipping method",headers:a,method:"DELETE",operationId:"deleteShippingMethod",path:"/:organizationId/shipping-methods/:id",pathParams:p,responses:{204:null,400:i,401:i,404:i},summary:"Delete Shipping Method",tags:["ShippingMethod"]});export const shippingMethodRoute={getShippingMethod:m,accessEligibility:c,getShippingMethods:S,createShippingMethod:z,updateShippingMethod:M,deleteShippingMethod:l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";import{FileSchema as p}from"../file/file.schema";import{ShippingZoneSchema as i}from"./shipping-zone.schema";export const ShippingMethodSchema=e.object({id:e.string().openapi({example:"clf9876543210abcdef",description:"ID of the shipping method"}),title:e.string().min(1,"Title is required").openapi({example:"Standard Shipping",description:"Title of the shipping method"}),providerName:e.string().min(1,"Provider name is required").openapi({example:"FedEx",description:"Name of the shipping provider"}),providerLogo:p.nullable().optional().openapi({description:"Logo of the shipping provider"}),requireDateOfDelivery:e.coerce.boolean().optional().openapi({example:!0,description:"Whether the delivery time should be selected"}),shippingZones:e.array(i).openapi({description:"List of shipping zones for this shipping method"}),eligibleShippingZone:i.optional(),createdAt:e.date(),updatedAt:e.date()}).openapi("ShippingMethod"),CreateShippingMethodSchema=ShippingMethodSchema.pick({title:!0,providerName:!0,providerLogo:!0,requireDateOfDelivery:!0,shippingZones:!0}).extend({providerLogoId:e.string().cuid().optional().openapi({example:"clf9876543210abcdef",description:"ID reference to the provider logo file"})}).openapi("CreateShippingMethod"),UpdateShippingMethodSchema=CreateShippingMethodSchema.partial().openapi("UpdateShippingMethod");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{__awaiter as d}from"tslib";import{z as c}from"@hono/zod-openapi";import{HttpException as u}from"../../core/exceptions/http-exception";import{PaginationMetaSchema as l,ShippingMethodSchema as p}from"../../schemas";class v{constructor(e){this.prisma=e}findShippingMethod(e,t,i){return d(this,void 0,void 0,function*(){const n=yield this.prisma.shippingMethod.findUnique({where:{id:e,organizationId:t},include:i?.include});if(!n)throw new u(404,"Shipping method not found");return n})}findDistanceBetweenCoordinates(e,t){const i=g=>g*(Math.PI/180),r=i(t.latitude-e.latitude),s=i(t.longitude-e.longitude),o=i(e.latitude),h=i(t.latitude),a=Math.sin(r/2)*Math.sin(r/2)+Math.cos(o)*Math.cos(h)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}accessEligibility(e,t){return d(this,void 0,void 0,function*(){const i=yield this.prisma.organization.findUnique({where:{id:t},include:{address:!0}});if(!i)throw new u(404,"Organization not found");const n=yield this.prisma.address.findFirst({where:{users:{some:{id:e.id}},isDefault:!0}});if(!n)throw new u(404,"User shipping address not found");return(yield this.prisma.shippingMethod.findMany({where:{organizationId:t},include:{shippingZones:!0}})).map(s=>{const o=this.findDistanceBetweenCoordinates({latitude:i.address.latitude,longitude:i.address.longitude},{latitude:n.latitude,longitude:n.longitude}),h=s.shippingZones.find(({distanceUpto:a})=>o<=a);return p.parse(Object.assign(Object.assign({},s),{eligibleShippingZone:h}))})})}createShippingMethod(e,t,i){return d(this,void 0,void 0,function*(){const n=yield this.prisma.shippingMethod.create({data:{title:i.title,providerName:i.providerName,providerLogoId:i.providerLogoId,requireDateOfDelivery:i.requireDateOfDelivery,organizationId:e,shippingZones:{create:i.shippingZones},createdBy:t},include:{shippingZones:!0,providerLogo:!0}});return p.parse(n)})}getShippingMethod(e,t){return d(this,void 0,void 0,function*(){const i=yield this.findShippingMethod(t,e,{include:{providerLogo:!0,shippingZones:!0}});return p.parse(i)})}getShippingMethods(e,t){return d(this,void 0,void 0,function*(){const{page:i=1,limit:n=10,search:r}=t,[s,o]=yield this.prisma.shippingMethod.paginate({orderBy:{createdAt:"desc"},where:Object.assign({organizationId:e},r&&{title:{contains:r,mode:"insensitive"}}),include:{shippingZones:!0,providerLogo:!0}}).withPages({page:i,limit:n});return c.object({meta:l,list:c.array(p)}).parse({meta:o,list:s})})}updateShippingMethod(e,t,i,n){return d(this,void 0,void 0,function*(){yield this.findShippingMethod(t,e);const r=yield this.prisma.shippingMethod.update({where:{id:t,organizationId:e},data:{title:n.title,providerName:n.providerName,providerLogoId:n.providerLogoId,requireDateOfDelivery:n.requireDateOfDelivery,shippingZones:{deleteMany:{},create:n.shippingZones},updatedBy:i},include:{providerLogo:!0,shippingZones:!0}});return p.parse(r)})}deleteShippingMethod(e,t,i){return d(this,void 0,void 0,function*(){yield this.findShippingMethod(t,e),yield this.prisma.shippingMethod.update({where:{id:t,organizationId:e},data:{archivedAt:new Date,archivedBy:i}})})}}export{v as ShippingMethodService};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as i}from"@hono/zod-openapi";import{optionalNumber as p,requiredNumber as e}from"../../schemas/number.schema";export const ShippingZoneSchema=i.object({id:i.string().optional().openapi({example:"clf9876543210abcdef",description:"ID of the shipping zone"}),title:i.string().min(1,"Title is required").openapi({example:"Zone 1",description:"Title of the shipping zone"}),distanceUpto:e.openapi({example:10,description:"Ending distance for the shipping zone"}),price:e.openapi({example:5.99,description:"Price for shipping in this zone"}),minimumOrderAmount:p.openapi({example:50,description:"Minimum order amount for this shipping zone"}),eta:i.string().min(1,"ETA is required").openapi({example:"2-3 days",description:"Estimated time of arrival for this shipping zone"})}).openapi("ShippingZone");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{__awaiter as n}from"tslib";import{HttpException as i}from"../../core/exceptions/http-exception";import{createApiRouter as d}from"../../core/hono/hono";import{webhookRoutes as u}from"./webhook.route";export const registerWebhookHandlers=a=>{const t=d();return t.openapi(u.webhook,e=>n(void 0,void 0,void 0,function*(){try{const r=e.req.valid("param"),s=e.req.raw.headers.get("stripe-signature"),o=yield e.req.raw.text();return yield a.processWebhookEvent(r.provider,s,o),e.json({received:!0},200)}catch(r){if(console.error(r),r instanceof i)switch(r.status){case 400:case 401:return e.json({message:r.message,status:r.status},r.status);default:return e.json({message:"Internal Server Error",status:500},500)}return e.json({message:"Internal Server Error",status:500},500)}})),t.openapi(u.webhookByOrganization,e=>n(void 0,void 0,void 0,function*(){try{const r=e.req.valid("param"),s=e.req.raw.headers.get("stripe-signature"),o=yield e.req.raw.text();return yield a.processWebhookEvent(r.provider,s,o,r.organizationId),e.json({received:!0},200)}catch(r){if(console.error(r),r instanceof i)switch(r.status){case 400:case 401:return e.json({message:r.message,status:r.status},r.status);default:return e.json({message:"Internal Server Error",status:500},500)}return e.json({message:"Internal Server Error",status:500},500)}})),t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as o}from"@hono/zod-openapi";import{createApiRoute as r}from"../../core/hono/hono";import{ErrorSchema as e}from"../../schemas";const a=o.enum(["stripe","revolut"]).openapi({description:"Payment provider",example:"stripe",param:{in:"path",name:"provider"}}),t=r({description:"Receive webhook events from payment providers",method:"POST",operationId:"webhook",path:"/webhook/payment/:provider",pathParams:o.object({provider:a}),responses:{200:o.object({received:o.boolean()}),400:e,401:e,500:e},summary:"Process Event",tags:["Webhook"]}),i=r({description:"Receive webhook events from payment providers for a specific organization",method:"POST",operationId:"webhookByOrganization",path:"/webhook/payment/:provider/:organizationId",pathParams:o.object({provider:a,organizationId:o.string().openapi({description:"Organization ID",example:"clm1234567890abcdef",param:{in:"path",name:"organizationId"}})}),responses:{200:o.object({received:o.boolean()}),400:e,401:e,500:e},summary:"Process Event",tags:["Webhook"]});export const webhookRoutes={webhook:t,webhookByOrganization:i};
|
package/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"./schemas";export*from"./features";export{bootstrap}from"./bootstrap";export{generateOpenApiSpec}from"./core/openapi/openapi.lib";export{CartItemSchema}from"./features/cart/cart.schema";
|
package/src/integrations/next.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{PrismaNeon as d}from"@prisma/adapter-neon";import{toNextJsHandler as g}from"better-auth/next-js";import{bootstrap as f}from"../bootstrap";import{createAuthClient as b}from"../core/auth/better-auth.lib";import{createPrismaClient as h}from"../core/lib/prisma";import{generateOpenApiSpec as w}from"../core/openapi/openapi.lib";export const createNextHandler=r=>{var i;const o=(i=r.prisma)!==null&&i!==void 0?i:(()=>{if(!r.database)throw new Error("createNextHandler requires either a `prisma` client or `database` options.");return"adapter"in r.database?h(r.database):h({adapter:new d({connectionString:r.database.connectionString}),log:r.database.log})})(),c=new Map,u=t=>r.auth.baseURL?r.auth.baseURL:`${new URL(t.url).origin}/api/auth`,l=t=>{const e=c.get(t);if(e)return e;const a=b(Object.assign(Object.assign({prisma:o},r.auth),{baseURL:t}));return c.set(t,a),a},m=t=>{var e,a;const n=t.split("/").filter(Boolean);return n[0]==="organizations"?(e=n[1])!==null&&e!==void 0?e:"":(a=n[0])!==null&&a!==void 0?a:""},p=f({corsOptions:r.corsOptions,maps:r.maps,payment:r.payment,prisma:o,resolveAuth:(t,e)=>{const a=l(u(t)),n=m(e);return{getCurrentUser:()=>a.getCurrentUser(t.headers),isGranted:s=>a.isGranted(t.headers,n,s)}}});return t=>{if(t.url.includes("/api/auth")){const a=l(u(t)),{GET:n,POST:s}=g(a.auth.handler);switch(t.method){case"GET":return n(t);case"POST":return s(t)}}if(t.url.includes("/api/openapi.json"))return Response.json(w());const e=new URL(t.url);return e.pathname=e.pathname.replace(/^\/api/,"")||"/",p.fetch(new Request(e,t))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";export const AddressSchema=e.object({id:e.string().cuid().openapi({example:"clf9876543210abcdef",description:"The unique identifier of the address"}),firstname:e.string().optional().nullable().openapi({example:"John",description:"The first name of the recipient"}),lastname:e.string().optional().nullable().openapi({example:"Doe",description:"The last name of the recipient"}),phone:e.string().optional().nullable().openapi({example:"+1234567890",description:"Phone number of the recipient"}),addressLineOne:e.string().openapi({example:"123 Main Street",description:"The first line of the address"}),doorNumber:e.string().nullable().optional().openapi({description:"The door number of the address"}),addressLineTwo:e.string().nullable().optional().openapi({example:"Suite 100",description:"The second line of the address"}),zipCode:e.string().optional().openapi({example:"12345",description:"The postal code of the address"}),city:e.string().openapi({example:"New York",description:"The city of the address"}),country:e.string().openapi({example:"USA",description:"The country of the address"}),placeId:e.string().nullable().optional().openapi({example:"ChIJN1t_tKlj4AR4GeTYWZ7frY",description:"The Google Place ID for the address"}),deliveryInstructions:e.string().nullable().optional().openapi({example:"Leave at the door",description:"Delivery instructions for the address"})}).openapi("Address"),CreateAddressSchema=AddressSchema.pick({addressLineOne:!0,doorNumber:!0,addressLineTwo:!0,zipCode:!0,city:!0,country:!0,placeId:!0}).extend({placeId:e.string().min(1,"This field is required").openapi({example:"ChIJN1t_tKlj4AR4GeTYWZ7frY",description:"The Google Place ID for the address"})}).openapi("CreateAddress"),UpdateAddressSchema=CreateAddressSchema.partial().openapi("UpdateAddress"),ShippingAddressSchema=AddressSchema.extend({firstname:e.string().min(2,"First Name must be at least 2 characters").openapi({example:"John",description:"The first name of the recipient"}),lastname:e.string().min(1,"Last Name must be at least 2 characters").openapi({example:"Doe",description:"The last name of the recipient"}),phone:e.string().min(4).openapi({example:"+1234567890",description:"Phone number of the recepient"})}),CreateShippingAddressSchema=ShippingAddressSchema.pick({firstname:!0,lastname:!0,phone:!0,addressLineOne:!0,addressLineTwo:!0,doorNumber:!0,zipCode:!0,city:!0,country:!0,placeId:!0,deliveryInstructions:!0}).extend({placeId:e.string().min(1,"This field is required").openapi({example:"ChIJN1t_tKlj4AR4GeTYWZ7frY",description:"The Google Place ID for the address"})}),UpdateShippingAddressSchema=CreateShippingAddressSchema.partial().extend({placeId:e.string().min(1,"This field is required").openapi({example:"ChIJN1t_tKlj4AR4GeTYWZ7frY",description:"The Google Place ID for the address"})}).openapi("UpdateShippingAddress");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as l}from"@hono/zod-openapi";export const currencyOptions=[{value:"USD",label:"United States Dollar"},{value:"EUR",label:"Euro"},{value:"GBP",label:"British Pound Sterling"},{value:"JPY",label:"Japanese Yen"},{value:"AUD",label:"Australian Dollar"},{value:"CAD",label:"Canadian Dollar"},{value:"CHF",label:"Swiss Franc"},{value:"CNY",label:"Chinese Yuan"},{value:"SEK",label:"Swedish Krona"},{value:"NZD",label:"New Zealand Dollar"},{value:"MXN",label:"Mexican Peso"},{value:"SGD",label:"Singapore Dollar"},{value:"HKD",label:"Hong Kong Dollar"},{value:"NOK",label:"Norwegian Krone"},{value:"KRW",label:"South Korean Won"},{value:"TRY",label:"Turkish Lira"},{value:"RUB",label:"Russian Ruble"},{value:"INR",label:"Indian Rupee"},{value:"BRL",label:"Brazilian Real"},{value:"ZAR",label:"South African Rand"},{value:"DKK",label:"Danish Krone"},{value:"PLN",label:"Polish Z\u0142oty"},{value:"THB",label:"Thai Baht"},{value:"IDR",label:"Indonesian Rupiah"},{value:"HUF",label:"Hungarian Forint"},{value:"CZK",label:"Czech Koruna"},{value:"ILS",label:"Israeli New Shekel"},{value:"PHP",label:"Philippine Peso"},{value:"AED",label:"United Arab Emirates Dirham"},{value:"COP",label:"Colombian Peso"},{value:"SAR",label:"Saudi Riyal"},{value:"MYR",label:"Malaysian Ringgit"},{value:"RON",label:"Romanian Leu"}],currency=l.enum(["USD","EUR","GBP","JPY","AUD","CAD","CHF","CNY","SEK","NZD","MXN","SGD","HKD","NOK","KRW","TRY","RUB","INR","BRL","ZAR","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]).openapi({description:"The currency code for the transaction."});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";export const ErrorSchema=e.object({status:e.number().openapi({example:404,description:"The HTTP status code"}),message:e.string().openapi({example:"Not found",description:"The error message"})});
|
package/src/schemas/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "../features/order/fulfilment.schema";
|
|
|
22
22
|
export * from "../features/file/file.schema";
|
|
23
23
|
export * from "../features/order/recipient.schema";
|
|
24
24
|
export * from "./currency.schema";
|
|
25
|
+
export * from "./time-zone.schema";
|
|
25
26
|
export * from "../core/auth/auth.schema";
|
|
26
27
|
export * from "./address.schema";
|
|
27
28
|
export * from "./params.schema";
|
package/src/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"../features/analytics/analytics.schema";export*from"../features/access/access.schema";export*from"../features/cart/cart.schema";export*from"./error.schema";export*from"../core/auth/headers.schema";export*from"../features/integration/integration.schema";export*from"../features/product/product.schema";export*from"../core/auth/user.schema";export*from"./pagination.schema";export*from"../features/order/order.schema";export*from"../features/organization/organization.schema";export*from"../features/shipping-method/shipping-method.schema";export*from"../features/product-category/product-category.schema";export*from"../features/shipping-method/shipping-zone.schema";export*from"../features/product/product-modifier.schema";export*from"../features/organization/organization-configuration.schema";export*from"./number.schema";export*from"../features/manufacturer/manufacturer.schema";export*from"./locales.schema";export*from"../features/organization/legal-entity.schema";export*from"../features/order/fulfilment.schema";export*from"../features/file/file.schema";export*from"../features/order/recipient.schema";export*from"./currency.schema";export*from"./time-zone.schema";export*from"../core/auth/auth.schema";export*from"./address.schema";export*from"./params.schema";export*from"../features/location/location.schema";export*from"../features/payment/payment.schema";export*from"../features/reservation/reservation.schema";export*from"../features/customer/customer.schema";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x127aca=_0x8583,_0x474924=_0x8583;(function(_0x4b3740,_0x24c351){const _0x51d126=_0x8583,_0xb58e93=_0x8583,_0x2e4b28=_0x4b3740();while(!![]){try{const _0x210d41=-parseInt(_0x51d126(0x236))/0x1+-parseInt(_0xb58e93(0x26d))/0x2+-parseInt(_0x51d126(0x218))/0x3*(-parseInt(_0x51d126(0x27a))/0x4)+-parseInt(_0x51d126(0x262))/0x5*(parseInt(_0xb58e93(0x2a6))/0x6)+parseInt(_0xb58e93(0x226))/0x7+-parseInt(_0x51d126(0x283))/0x8+parseInt(_0xb58e93(0x1fb))/0x9*(parseInt(_0x51d126(0x2aa))/0xa);if(_0x210d41===_0x24c351)break;else _0x2e4b28['push'](_0x2e4b28['shift']());}catch(_0x51e4e5){_0x2e4b28['push'](_0x2e4b28['shift']());}}}(_0x3b00,0xdc3d2));import{z as _0x42aef0}from'@hono/zod-openapi';export const localeMap=new Map([['af',_0x127aca(0x28b)+'s'],['sq',_0x127aca(0x20a)],[_0x127aca(0x208),_0x474924(0x214)+_0x474924(0x2a5)],['ar_bh',_0x127aca(0x214)+_0x127aca(0x238)],[_0x474924(0x1fe),_0x127aca(0x214)+_0x127aca(0x1fc)],[_0x127aca(0x250),'Arabic\x20('+'Iraq)'],[_0x127aca(0x273),_0x474924(0x214)+_0x127aca(0x285)],[_0x127aca(0x2a8),_0x127aca(0x214)+'Kuwait)'],[_0x474924(0x1f7),_0x127aca(0x214)+_0x474924(0x2a1)],[_0x474924(0x258),_0x127aca(0x214)+_0x127aca(0x261)],[_0x127aca(0x1f5),_0x474924(0x214)+'Morocco)'],[_0x474924(0x20b),_0x127aca(0x214)+_0x127aca(0x294)],['ar_qa',_0x474924(0x214)+_0x127aca(0x29b)],[_0x127aca(0x222),'Arabic\x20('+_0x474924(0x23f)+_0x474924(0x293)],[_0x127aca(0x268),_0x474924(0x214)+_0x474924(0x1f1)],[_0x127aca(0x257),_0x127aca(0x214)+_0x127aca(0x223)],['ar_ae',_0x474924(0x214)+'U.A.E.)'],[_0x127aca(0x23a),_0x474924(0x214)+_0x127aca(0x291)],['eu',_0x127aca(0x259)],['be','Belarusi'+'an'],['bg','Bulgaria'+'n'],['ca','Catalan'],[_0x127aca(0x2a0),_0x127aca(0x266)+_0x474924(0x267)+_0x127aca(0x22c)],[_0x127aca(0x205),_0x474924(0x266)+_0x474924(0x254)],[_0x127aca(0x269),_0x474924(0x266)+_0x127aca(0x286)+'re)'],[_0x127aca(0x252),_0x474924(0x266)+'(Taiwan)'],['hr','Croatian'],['cs','Czech'],['da','Danish'],[_0x127aca(0x212),_0x474924(0x29c)+_0x127aca(0x239)],['nl',_0x127aca(0x25d)+_0x474924(0x29e)],['en',_0x474924(0x264)],['en_au',_0x127aca(0x281)+_0x127aca(0x248)+_0x474924(0x260)],[_0x474924(0x1f8),'English\x20'+_0x127aca(0x272)],[_0x127aca(0x24d),_0x127aca(0x281)+'(Canada)'],[_0x474924(0x24e),_0x474924(0x281)+_0x474924(0x292)+')'],[_0x127aca(0x2a9),_0x474924(0x281)+_0x474924(0x216)+')'],['en_nz',_0x474924(0x281)+_0x474924(0x1f0)+_0x474924(0x298)],[_0x474924(0x251),_0x127aca(0x281)+_0x127aca(0x1f3)+_0x127aca(0x200)],[_0x474924(0x277),_0x474924(0x281)+_0x127aca(0x284)+'d)'],[_0x127aca(0x21c),_0x474924(0x281)+'(United\x20'+_0x474924(0x28f)],[_0x127aca(0x296),_0x474924(0x281)+'(United\x20'+_0x474924(0x210)],['et',_0x474924(0x1ff)],['fo',_0x474924(0x22e)],['fa',_0x474924(0x235)],['fi',_0x474924(0x24c)],[_0x127aca(0x230),_0x127aca(0x220)+_0x127aca(0x244)],[_0x127aca(0x234),'French\x20('+_0x474924(0x26c)],[_0x127aca(0x24f),_0x474924(0x220)+'Luxembou'+_0x474924(0x229)],['fr',_0x127aca(0x220)+_0x474924(0x1f6)+')'],[_0x474924(0x29d),_0x474924(0x220)+_0x474924(0x23e)+_0x474924(0x27c)],['gd',_0x474924(0x209)+_0x127aca(0x204)+')'],[_0x474924(0x203),_0x127aca(0x2ad)+_0x474924(0x295)],[_0x474924(0x221),'German\x20('+_0x474924(0x256)+_0x127aca(0x23b)],[_0x127aca(0x22f),_0x474924(0x2ad)+_0x127aca(0x213)+_0x474924(0x229)],['de',_0x127aca(0x2ad)+_0x127aca(0x1f6)+')'],[_0x474924(0x21a),'German\x20('+_0x474924(0x23e)+_0x127aca(0x27c)],['el',_0x127aca(0x25f)],['he',_0x127aca(0x206)],['hi',_0x474924(0x233)],['hu',_0x474924(0x240)+'n'],['is','Icelandi'+'c'],['id',_0x474924(0x287)+'an'],['ga',_0x127aca(0x270)],['it',_0x474924(0x274)+_0x474924(0x25b)+'d)'],['it_ch',_0x127aca(0x274)+_0x474924(0x25a)+_0x127aca(0x298)],['ja',_0x127aca(0x2a7)],['ko',_0x127aca(0x1f2)],['ku',_0x474924(0x224)],['lv','Latvian'],['lt','Lithuani'+'an'],['mk','Macedoni'+'an\x20(FYRO'+'M)'],['ml',_0x127aca(0x280)+'m'],['ms','Malaysia'+'n'],['mt',_0x474924(0x247)],['no',_0x474924(0x26a)+'n'],['nb','Norwegia'+'n\x20(Bokmå'+'l)'],['nn','Norwegia'+_0x127aca(0x282)+_0x474924(0x26e)],['pl',_0x474924(0x290)],[_0x127aca(0x237),'Portugue'+_0x127aca(0x22a)+_0x127aca(0x1f9)],['pt','Portugue'+_0x127aca(0x297)+_0x127aca(0x242)],['pa',_0x474924(0x2a2)],['rm',_0x474924(0x253)+'omanic'],['ro',_0x127aca(0x232)],[_0x127aca(0x243),_0x127aca(0x232)+_0x474924(0x219)+_0x474924(0x28d)+_0x474924(0x27f)],['ru','Russian'],['ru_md',_0x127aca(0x1fa)+_0x127aca(0x215)+_0x474924(0x276)+_0x474924(0x25c)],['sr',_0x127aca(0x1ef)],['sk','Slovak'],['sl',_0x474924(0x231)+'n'],['sb',_0x474924(0x217)],[_0x474924(0x263),_0x127aca(0x289)+_0x474924(0x288)+'na)'],['es_bo',_0x474924(0x289)+_0x127aca(0x227)+')'],[_0x127aca(0x26b),'Spanish\x20'+_0x474924(0x241)],[_0x127aca(0x211),_0x474924(0x289)+_0x474924(0x28a)+'a)'],[_0x474924(0x20e),_0x474924(0x289)+_0x127aca(0x26f)+'ica)'],[_0x474924(0x271),_0x127aca(0x289)+_0x474924(0x1f4)+_0x127aca(0x23d)+_0x474924(0x27e)],['es_ec',_0x474924(0x289)+_0x127aca(0x21d)+')'],[_0x474924(0x22b),'Spanish\x20'+_0x127aca(0x299)+_0x127aca(0x24a)],[_0x127aca(0x23c),_0x474924(0x289)+_0x127aca(0x20c)+_0x474924(0x28c)],[_0x127aca(0x21f),_0x474924(0x289)+'(Hondura'+'s)'],[_0x474924(0x20f),_0x474924(0x289)+_0x127aca(0x27b)],['es','Spanish\x20'+_0x127aca(0x21e)],['sv',_0x127aca(0x28e)],[_0x127aca(0x25e),_0x127aca(0x2ac)+_0x127aca(0x249)+')'],['th',_0x127aca(0x225)],['tr',_0x127aca(0x22d)],['uk',_0x127aca(0x255)+'n'],['ur',_0x474924(0x245)],['vi',_0x127aca(0x207)+'se'],['cy',_0x474924(0x1fd)],['ji',_0x127aca(0x27d)],['zu',_0x474924(0x246)]]),localeOptions=Array[_0x127aca(0x2a4)](localeMap[_0x127aca(0x278)]())[_0x474924(0x201)](([_0x4809b0,_0x208c83])=>({'value':_0x4809b0,'label':_0x208c83})),locale=_0x42aef0[_0x127aca(0x29f)](['af','sq',_0x127aca(0x208),_0x127aca(0x21b),_0x474924(0x1fe),_0x474924(0x250),_0x127aca(0x273),_0x474924(0x2a8),'ar_lb','ar_ly',_0x474924(0x1f5),_0x127aca(0x20b),_0x474924(0x24b),'ar_sa',_0x127aca(0x268),_0x127aca(0x257),_0x474924(0x279),'ar_ye','eu','be','bg','ca',_0x474924(0x2a0),_0x127aca(0x205),'zh_sg',_0x474924(0x252),'hr','cs','da','nl_be','nl','en',_0x127aca(0x202),_0x474924(0x1f8),_0x474924(0x24d),_0x127aca(0x24e),_0x127aca(0x2a9),_0x127aca(0x265),_0x127aca(0x251),_0x127aca(0x277),_0x474924(0x21c),_0x127aca(0x296),'et','fo','fa','fi',_0x127aca(0x230),_0x474924(0x234),_0x474924(0x24f),'fr',_0x474924(0x29d),'gd',_0x474924(0x203),_0x127aca(0x221),_0x474924(0x22f),'de',_0x127aca(0x21a),'el','he','hi','hu','is','id','ga','it',_0x127aca(0x29a),'ja','ko','ku','lv','lt','mk','ml','ms','mt','no','nb','nn','pl','pt_br','pt','pa','rm','ro','ro_md','ru','ru_md','sr','sk','sl','sb',_0x127aca(0x263),_0x474924(0x20d),'es_cl',_0x474924(0x211),_0x127aca(0x20e),_0x474924(0x271),_0x474924(0x2a3),_0x474924(0x22b),_0x127aca(0x23c),_0x127aca(0x21f),'es_mx','es','sv','sv_fi','th','tr','uk','ur','vi','cy','ji','zu'])[_0x127aca(0x228)]({'description':_0x127aca(0x275)+'\x20locale\x20'+_0x127aca(0x2ab),'example':'en'});function _0x8583(_0x4d1116,_0x351352){_0x4d1116=_0x4d1116-0x1ef;const _0x3b009f=_0x3b00();let _0x85838a=_0x3b009f[_0x4d1116];if(_0x8583['VkThql']===undefined){var _0x266996=function(_0x2c882e){const _0x28254c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x42aef0='',_0x4809b0='';for(let _0x208c83=0x0,_0x54fe8b,_0x6e9f41,_0x255224=0x0;_0x6e9f41=_0x2c882e['charAt'](_0x255224++);~_0x6e9f41&&(_0x54fe8b=_0x208c83%0x4?_0x54fe8b*0x40+_0x6e9f41:_0x6e9f41,_0x208c83++%0x4)?_0x42aef0+=String['fromCharCode'](0xff&_0x54fe8b>>(-0x2*_0x208c83&0x6)):0x0){_0x6e9f41=_0x28254c['indexOf'](_0x6e9f41);}for(let _0x33c2f1=0x0,_0x127b3d=_0x42aef0['length'];_0x33c2f1<_0x127b3d;_0x33c2f1++){_0x4809b0+='%'+('00'+_0x42aef0['charCodeAt'](_0x33c2f1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4809b0);};_0x8583['fepwMo']=_0x266996,_0x8583['Mqvcth']={},_0x8583['VkThql']=!![];}const _0x479373=_0x3b009f[0x0],_0x3c72a6=_0x4d1116+_0x479373,_0x111853=_0x8583['Mqvcth'][_0x3c72a6];return!_0x111853?(_0x85838a=_0x8583['fepwMo'](_0x85838a),_0x8583['Mqvcth'][_0x3c72a6]=_0x85838a):_0x85838a=_0x111853,_0x85838a;}function _0x3b00(){const _0x6bd5d1=['yxjFAxe','zw5FEMe','EMHFDhC','uMHHzxrVlvi','kfbsqYK','vwTYywLUAwe','tgLLy2H0zw4','yxjFDg4','yxjFBhK','qMfZCxvL','kfn3Axr6zxi','kfn0yw5Kyxi','zg92ysK','rhv0y2GGkfm','C3zFzMK','r3jLzwS','AweP','tgLIEweP','otvUBLbyD3i','zxnFyxi','rw5NBgLZAa','zw5FBNO','q2HPBMvZzsa','keHVBMCGs28','yxjFC3K','EMHFC2C','tM9YD2vNAwe','zxnFy2W','q2fUywrHkq','nZG0nJmYsxHqrwPU','C2SP','kenVC3rHifi','sxjPC2G','zxnFzg8','kejLBgL6zsK','yxjFAM8','sxrHBgLHBIa','rw51BsbMB3i','yYbVzIbnB2W','zw5FDhq','zw50CMLLCW','yxjFywu','mtiZmZaWBMrAvgDk','ke1LEgLJBYK','yw5Kkq','wwLKzgLZAa','BgLJkq','BgrVDMeP','twfSyxLHBge','rw5NBgLZAca','BIaOtNLUB3i','mtmZnZmYntzXugfHr0K','kfrYAw5Pzge','sM9YzgfUkq','kfnPBMDHCg8','sw5KB25LC2K','kefYz2vUDgK','u3bHBMLZAca','kenVBg9TyMK','qwzYAwTHyw4','BgeP','AwmGB2yGtw8','u3DLzgLZAa','s2LUz2rVBsK','ug9SAxnO','wwvTzw4P','keLYzwXHBMq','ywjPysK','t21HBIK','qxvZDhjPysK','zw5FDxm','C2uGkfbVCNq','BgfUzcK','kevSifnHBhy','AxrFy2G','uwf0yxiP','rhv0y2GGkei','zNjFy2G','DgfUzgfYzcK','zw51Bq','EMHFAgS','tgvIyw5VBIK','uhvUAMfIAq','zxnFzwm','zNjVBq','qwXNzxjPysK','mZq5mde0t0P4svnS','sMfWyw5LC2u','yxjFA3C','zw5FAM0','nda5odG2mZbbCwjvrvi','DMfSDwvZ','u3DLzgLZAca','r2vYBwfUicG','u2vYyMLHBG','ke5LDYbAzwe','u3LYAweP','s29YzwfU','kfnVDxrOiee','kerVBwLUAwm','yxjFBwe','u3rHBMrHCMq','yxjFBgi','zw5FyNO','AwWP','uNvZC2LHBIa','ovPLqMXMEG','rwD5ChqP','v2vSC2G','yxjFzwC','rxn0B25Pyw4','zNjPy2eP','BwfW','zw5Fyxu','zgvFyxq','u2nVDgXHBMq','EMHFy24','sgvICMv3','vMLLDg5HBwu','yxjFzhO','r2fLBgLJicG','qwXIyw5Pyw4','yxjFB20','keD1yxrLBwe','zxnFyM8','zxnFy3i','zxnFBxG','u3rHDgvZkq','zxnFy28','BMXFyMu','thv4zw1IB3u','qxjHyMLJicG','kfjLChvIBgK','kePHBwfPy2e','u29YyMLHBG','mtvRugTLD2u','icHszxb1yMW','zgvFy2G','yxjFyMG','zw5Fz2i','kevJDwfKB3i','kfnWywLUkq','zxnFAg4','rNjLBMnOicG','zgvFBgK','yxjFC2e','vhvUAxnPysK','s3vYzgLZAa','vgHHAq','otuYodu4mLzrCM1zza','kejVBgL2Awe','B3bLBMfWAq','CMCP','C2uGkejYyxO','zxnFC3y','BMCP','vhvYA2LZAa','rMfLCM9LC2u','zgvFBhu','zNjFyMu','u2XVDMvUAwe','uM9Tyw5Pyw4','sgLUzgK','zNjFy2e','rMfYC2K','mtu0mJKZmKDttwfQvG','ChrFyNi','qMfOCMfPBIK','zwXNAxvTkq','yxjFEwu','C3rLAw4P','zxnFz3q','yw4GuMvWDwi','u3DPDhPLCMW','u2f1zgKGqxi','shvUz2fYAwe','kenOAwXLkq','DwDHBcK','CM9FBwq','qMvSz2L1BsK','vxjKDq','wNvSDq','twfSDgvZzq','kef1C3rYywW','kezPBMXHBMq','ywrVCIK','yxjFCwe','rMLUBMLZAa','zw5Fy2e','zw5FAwu','zNjFBhu'];_0x3b00=function(){return _0x6bd5d1;};return _0x3b00();}
|
|
1
|
+
import{z as n}from"@hono/zod-openapi";export const localeMap=new Map([["af","Afrikaans"],["sq","Albanian"],["ar_dz","Arabic (Algeria)"],["ar_bh","Arabic (Bahrain)"],["ar_eg","Arabic (Egypt)"],["ar_iq","Arabic (Iraq)"],["ar_jo","Arabic (Jordan)"],["ar_kw","Arabic (Kuwait)"],["ar_lb","Arabic (Lebanon)"],["ar_ly","Arabic (Libya)"],["ar_ma","Arabic (Morocco)"],["ar_om","Arabic (Oman)"],["ar_qa","Arabic (Qatar)"],["ar_sa","Arabic (Saudi Arabia)"],["ar_sy","Arabic (Syria)"],["ar_tn","Arabic (Tunisia)"],["ar_ae","Arabic (U.A.E.)"],["ar_ye","Arabic (Yemen)"],["eu","Basque"],["be","Belarusian"],["bg","Bulgarian"],["ca","Catalan"],["zh_hk","Chinese (Hong Kong)"],["zh_cn","Chinese (PRC)"],["zh_sg","Chinese (Singapore)"],["zh_tw","Chinese (Taiwan)"],["hr","Croatian"],["cs","Czech"],["da","Danish"],["nl_be","Dutch (Belgium)"],["nl","Dutch (Standard)"],["en","English"],["en_au","English (Australia)"],["en_bz","English (Belize)"],["en_ca","English (Canada)"],["en_ie","English (Ireland)"],["en_jm","English (Jamaica)"],["en_nz","English (New Zealand)"],["en_za","English (South Africa)"],["en_tt","English (Trinidad)"],["en_gb","English (United Kingdom)"],["en_us","English (United States)"],["et","Estonian"],["fo","Faeroese"],["fa","Farsi"],["fi","Finnish"],["fr_be","French (Belgium)"],["fr_ca","French (Canada)"],["fr_lu","French (Luxembourg)"],["fr","French (Standard)"],["fr_ch","French (Switzerland)"],["gd","Gaelic (Scotland)"],["de_at","German (Austria)"],["de_li","German (Liechtenstein)"],["de_lu","German (Luxembourg)"],["de","German (Standard)"],["de_ch","German (Switzerland)"],["el","Greek"],["he","Hebrew"],["hi","Hindi"],["hu","Hungarian"],["is","Icelandic"],["id","Indonesian"],["ga","Irish"],["it","Italian (Standard)"],["it_ch","Italian (Switzerland)"],["ja","Japanese"],["ko","Korean"],["ku","Kurdish"],["lv","Latvian"],["lt","Lithuanian"],["mk","Macedonian (FYROM)"],["ml","Malayalam"],["ms","Malaysian"],["mt","Maltese"],["no","Norwegian"],["nb","Norwegian (Bokm\xE5l)"],["nn","Norwegian (Nynorsk)"],["pl","Polish"],["pt_br","Portuguese (Brazil)"],["pt","Portuguese (Portugal)"],["pa","Punjabi"],["rm","Rhaeto-Romanic"],["ro","Romanian"],["ro_md","Romanian (Republic of Moldova)"],["ru","Russian"],["ru_md","Russian (Republic of Moldova)"],["sr","Serbian"],["sk","Slovak"],["sl","Slovenian"],["sb","Sorbian"],["es_ar","Spanish (Argentina)"],["es_bo","Spanish (Bolivia)"],["es_cl","Spanish (Chile)"],["es_co","Spanish (Colombia)"],["es_cr","Spanish (Costa Rica)"],["es_do","Spanish (Dominican Republic)"],["es_ec","Spanish (Ecuador)"],["es_sv","Spanish (El Salvador)"],["es_gt","Spanish (Guatemala)"],["es_hn","Spanish (Honduras)"],["es_mx","Spanish (Mexico)"],["es","Spanish (Spain)"],["sv","Swedish"],["sv_fi","Swedish (Finland)"],["th","Thai"],["tr","Turkish"],["uk","Ukrainian"],["ur","Urdu"],["vi","Vietnamese"],["cy","Welsh"],["ji","Yiddish"],["zu","Zulu"]]),localeOptions=Array.from(localeMap.entries()).map(([a,e])=>({value:a,label:e})),locale=n.enum(["af","sq","ar_dz","ar_bh","ar_eg","ar_iq","ar_jo","ar_kw","ar_lb","ar_ly","ar_ma","ar_om","ar_qa","ar_sa","ar_sy","ar_tn","ar_ae","ar_ye","eu","be","bg","ca","zh_hk","zh_cn","zh_sg","zh_tw","hr","cs","da","nl_be","nl","en","en_au","en_bz","en_ca","en_ie","en_jm","en_nz","en_za","en_tt","en_gb","en_us","et","fo","fa","fi","fr_be","fr_ca","fr_lu","fr","fr_ch","gd","de_at","de_li","de_lu","de","de_ch","el","he","hi","hu","is","id","ga","it","it_ch","ja","ko","ku","lv","lt","mk","ml","ms","mt","no","nb","nn","pl","pt_br","pt","pa","rm","ro","ro_md","ru","ru_md","sr","sk","sl","sb","es_ar","es_bo","es_cl","es_co","es_cr","es_do","es_ec","es_sv","es_gt","es_hn","es_mx","es","sv","sv_fi","th","tr","uk","ur","vi","cy","ji","zu"]).openapi({description:"Enum for locale values",example:"en"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as n}from"@hono/zod-openapi";export const optionalNumber=n.union([n.string(),n.number(),n.null()]).optional().transform(e=>{if(e==null||e==="")return null;if(typeof e=="number")return e;const r=Number(e);return isNaN(r)?e:r}).pipe(n.number().nonnegative({message:"This field must be a positive number"}).nullable().refine(e=>e===null||e>=0,{message:"Price must be positive"})),requiredNumber=n.coerce.number().min(.1,"This field must be positive").refine(e=>/^\d+(\.\d{1,2})?$/.test(e.toString()),{message:"This field can have a maximum of two decimal points"}),optionalInteger=n.union([n.string(),n.number(),n.null()]).optional().transform(e=>{if(e==null||e==="")return null;if(typeof e=="number")return e;const r=Number(e);return Number.isNaN(r)?e:r}).pipe(n.number().int({message:"This field must be a whole number"}).nonnegative({message:"This field must be zero or greater"}).nullable());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";import{locale as p}from"./locales.schema";export const PaginationQuerySchema=e.object({page:e.coerce.number().optional().default(1).openapi({example:1,description:"Page number"}),limit:e.coerce.number().optional().default(10).openapi({example:50,description:"Number of items per page"}),search:e.string().optional().openapi({example:"Apple",description:"Search query"}),published:e.coerce.boolean().optional().openapi({example:!0,description:"Whether to filter by published items"}),locale:p.optional()}),PaginationMetaSchema=e.object({isFirstPage:e.boolean().openapi({example:!0,description:"Whether the current page is the first page"}),isLastPage:e.boolean().openapi({example:!1,description:"Whether the current page is the last page"}),currentPage:e.number().openapi({example:1,description:"The current page number"}),previousPage:e.number().nullable().openapi({example:0,description:"The previous page number"}),nextPage:e.number().nullable().openapi({example:2,description:"The next page number"}),pageCount:e.number().openapi({example:5,description:"The total number of pages"}),totalCount:e.number().openapi({example:50,description:"The total number of items"})}).openapi("PaginationMeta");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as i}from"@hono/zod-openapi";export const OrganizationParams=i.object({organizationId:i.string().cuid().min(1,"organizationId is required").openapi({example:"ckel0e8qw00004n5p5w6fznym",description:"The organization ID"})}).openapi("OrganizationParams"),OrganizationWithIdParams=OrganizationParams.extend({id:i.string().cuid().min(1,"id is required").openapi({example:"ckel0e8qw00004n5p5w6fznym",description:"The organization ID"})}).openapi("OrganizationWithIdParams");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{z as o}from"@hono/zod-openapi";import{locale as e}from"./locales.schema";export const GetResourceQuerySchema=o.object({locale:e.optional().nullable()});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const DEFAULT_ORGANIZATION_TIME_ZONE = "Europe/Warsaw";
|
|
3
|
+
export declare const supportedTimeZones: readonly ["UTC", "Europe/Warsaw", "Europe/London", "Europe/Dublin", "Europe/Lisbon", "Europe/Madrid", "Europe/Paris", "Europe/Amsterdam", "Europe/Brussels", "Europe/Berlin", "Europe/Zurich", "Europe/Rome", "Europe/Prague", "Europe/Vienna", "Europe/Budapest", "Europe/Copenhagen", "Europe/Stockholm", "Europe/Oslo", "Europe/Helsinki", "Europe/Athens", "Europe/Bucharest", "Europe/Sofia", "Europe/Istanbul", "Europe/Kyiv", "Europe/Vilnius", "Europe/Riga", "Europe/Tallinn", "Europe/Moscow", "America/St_Johns", "America/Halifax", "America/New_York", "America/Toronto", "America/Chicago", "America/Winnipeg", "America/Denver", "America/Phoenix", "America/Edmonton", "America/Los_Angeles", "America/Vancouver", "America/Anchorage", "Pacific/Honolulu", "America/Mexico_City", "America/Bogota", "America/Lima", "America/Santiago", "America/Sao_Paulo", "America/Argentina/Buenos_Aires", "Africa/Casablanca", "Africa/Cairo", "Africa/Johannesburg", "Asia/Dubai", "Asia/Riyadh", "Asia/Jerusalem", "Asia/Tehran", "Asia/Karachi", "Asia/Kolkata", "Asia/Dhaka", "Asia/Bangkok", "Asia/Singapore", "Asia/Hong_Kong", "Asia/Shanghai", "Asia/Taipei", "Asia/Seoul", "Asia/Tokyo", "Australia/Perth", "Australia/Adelaide", "Australia/Sydney", "Pacific/Auckland"];
|
|
4
|
+
export declare const timeZoneOptions: {
|
|
5
|
+
value: "Europe/Warsaw" | "UTC" | "Europe/London" | "Europe/Dublin" | "Europe/Lisbon" | "Europe/Madrid" | "Europe/Paris" | "Europe/Amsterdam" | "Europe/Brussels" | "Europe/Berlin" | "Europe/Zurich" | "Europe/Rome" | "Europe/Prague" | "Europe/Vienna" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Stockholm" | "Europe/Oslo" | "Europe/Helsinki" | "Europe/Athens" | "Europe/Bucharest" | "Europe/Sofia" | "Europe/Istanbul" | "Europe/Kyiv" | "Europe/Vilnius" | "Europe/Riga" | "Europe/Tallinn" | "Europe/Moscow" | "America/St_Johns" | "America/Halifax" | "America/New_York" | "America/Toronto" | "America/Chicago" | "America/Winnipeg" | "America/Denver" | "America/Phoenix" | "America/Edmonton" | "America/Los_Angeles" | "America/Vancouver" | "America/Anchorage" | "Pacific/Honolulu" | "America/Mexico_City" | "America/Bogota" | "America/Lima" | "America/Santiago" | "America/Sao_Paulo" | "America/Argentina/Buenos_Aires" | "Africa/Casablanca" | "Africa/Cairo" | "Africa/Johannesburg" | "Asia/Dubai" | "Asia/Riyadh" | "Asia/Jerusalem" | "Asia/Tehran" | "Asia/Karachi" | "Asia/Kolkata" | "Asia/Dhaka" | "Asia/Bangkok" | "Asia/Singapore" | "Asia/Hong_Kong" | "Asia/Shanghai" | "Asia/Taipei" | "Asia/Seoul" | "Asia/Tokyo" | "Australia/Perth" | "Australia/Adelaide" | "Australia/Sydney" | "Pacific/Auckland";
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const isValidTimeZone: (value: string) => boolean;
|
|
9
|
+
export declare const defaultTimeZone: z.ZodString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as r}from"@hono/zod-openapi";export const DEFAULT_ORGANIZATION_TIME_ZONE="Europe/Warsaw",supportedTimeZones=["UTC","Europe/Warsaw","Europe/London","Europe/Dublin","Europe/Lisbon","Europe/Madrid","Europe/Paris","Europe/Amsterdam","Europe/Brussels","Europe/Berlin","Europe/Zurich","Europe/Rome","Europe/Prague","Europe/Vienna","Europe/Budapest","Europe/Copenhagen","Europe/Stockholm","Europe/Oslo","Europe/Helsinki","Europe/Athens","Europe/Bucharest","Europe/Sofia","Europe/Istanbul","Europe/Kyiv","Europe/Vilnius","Europe/Riga","Europe/Tallinn","Europe/Moscow","America/St_Johns","America/Halifax","America/New_York","America/Toronto","America/Chicago","America/Winnipeg","America/Denver","America/Phoenix","America/Edmonton","America/Los_Angeles","America/Vancouver","America/Anchorage","Pacific/Honolulu","America/Mexico_City","America/Bogota","America/Lima","America/Santiago","America/Sao_Paulo","America/Argentina/Buenos_Aires","Africa/Casablanca","Africa/Cairo","Africa/Johannesburg","Asia/Dubai","Asia/Riyadh","Asia/Jerusalem","Asia/Tehran","Asia/Karachi","Asia/Kolkata","Asia/Dhaka","Asia/Bangkok","Asia/Singapore","Asia/Hong_Kong","Asia/Shanghai","Asia/Taipei","Asia/Seoul","Asia/Tokyo","Australia/Perth","Australia/Adelaide","Australia/Sydney","Pacific/Auckland"];const i=new Set(supportedTimeZones);export const timeZoneOptions=supportedTimeZones.map(e=>({value:e,label:e.replace(/_/g," ")})),isValidTimeZone=e=>{const a=e.trim();if(!a)return!1;if(i.has(a))return!0;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}).format(new Date),!0}catch{return!1}},defaultTimeZone=r.string().trim().min(1,"Time zone is required").refine(isValidTimeZone,"Invalid time zone").openapi({example:DEFAULT_ORGANIZATION_TIME_ZONE,description:"Default IANA time zone for the organization"});
|