@shophost/rest-api 2.0.29 → 2.0.31
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 +18 -13
- package/scripts/minify.mjs +110 -0
- package/src/app.js +1 -53
- package/src/core/auth/auth.schema.js +1 -41
- package/src/core/auth/auth.util.js +1 -44
- package/src/core/auth/better-auth.lib.js +1 -100
- package/src/core/auth/generate-password-hash.util.d.ts +0 -3
- package/src/core/auth/generate-password-hash.util.js +1 -30
- package/src/core/auth/headers.schema.js +1 -22
- package/src/core/auth/user.schema.js +1 -30
- package/src/core/db/__generated__/client/browser.d.ts +0 -128
- package/src/core/db/__generated__/client/browser.js +1 -18
- package/src/core/db/__generated__/client/client.d.ts +0 -143
- package/src/core/db/__generated__/client/client.js +1 -35
- package/src/core/db/__generated__/client/commonInputTypes.js +1 -11
- package/src/core/db/__generated__/client/enums.js +1 -200
- package/src/core/db/__generated__/client/internal/class.d.ts +0 -343
- package/src/core/db/__generated__/client/internal/class.js +1 -55
- package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +0 -234
- package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -541
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.d.ts +0 -15
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js +1 -512
- package/src/core/db/__generated__/client/models/Account.d.ts +0 -628
- package/src/core/db/__generated__/client/models/Account.js +1 -2
- package/src/core/db/__generated__/client/models/Address.d.ts +0 -701
- package/src/core/db/__generated__/client/models/Address.js +1 -2
- package/src/core/db/__generated__/client/models/Campaign.d.ts +0 -638
- package/src/core/db/__generated__/client/models/Campaign.js +1 -2
- package/src/core/db/__generated__/client/models/ClosingTimes.d.ts +0 -634
- package/src/core/db/__generated__/client/models/ClosingTimes.js +1 -2
- package/src/core/db/__generated__/client/models/File.d.ts +0 -752
- package/src/core/db/__generated__/client/models/File.js +1 -2
- package/src/core/db/__generated__/client/models/Invitation.d.ts +0 -628
- package/src/core/db/__generated__/client/models/Invitation.js +1 -2
- package/src/core/db/__generated__/client/models/LegalEntity.d.ts +0 -652
- package/src/core/db/__generated__/client/models/LegalEntity.js +1 -2
- package/src/core/db/__generated__/client/models/Manufacturer.d.ts +0 -679
- package/src/core/db/__generated__/client/models/Manufacturer.js +1 -2
- package/src/core/db/__generated__/client/models/ManufacturerTranslation.d.ts +0 -628
- package/src/core/db/__generated__/client/models/ManufacturerTranslation.js +1 -2
- package/src/core/db/__generated__/client/models/Member.d.ts +0 -628
- package/src/core/db/__generated__/client/models/Member.js +1 -2
- package/src/core/db/__generated__/client/models/Modifier.d.ts +0 -662
- package/src/core/db/__generated__/client/models/Modifier.js +1 -2
- package/src/core/db/__generated__/client/models/ModifierGroup.d.ts +0 -686
- package/src/core/db/__generated__/client/models/ModifierGroup.js +1 -2
- package/src/core/db/__generated__/client/models/ModifierGroupTranslation.d.ts +0 -628
- package/src/core/db/__generated__/client/models/ModifierGroupTranslation.js +1 -2
- package/src/core/db/__generated__/client/models/OpeningTimes.d.ts +0 -634
- package/src/core/db/__generated__/client/models/OpeningTimes.js +1 -2
- package/src/core/db/__generated__/client/models/Order.d.ts +0 -700
- package/src/core/db/__generated__/client/models/Order.js +1 -2
- package/src/core/db/__generated__/client/models/OrderItem.d.ts +0 -686
- package/src/core/db/__generated__/client/models/OrderItem.js +1 -2
- package/src/core/db/__generated__/client/models/OrderItemTranslation.d.ts +0 -628
- package/src/core/db/__generated__/client/models/OrderItemTranslation.js +1 -2
- package/src/core/db/__generated__/client/models/Organization.d.ts +0 -811
- package/src/core/db/__generated__/client/models/Organization.js +1 -2
- package/src/core/db/__generated__/client/models/OrganizationConfiguration.d.ts +0 -676
- package/src/core/db/__generated__/client/models/OrganizationConfiguration.js +1 -2
- package/src/core/db/__generated__/client/models/Payment.d.ts +0 -668
- package/src/core/db/__generated__/client/models/Payment.js +1 -2
- package/src/core/db/__generated__/client/models/PaymentSession.d.ts +0 -638
- package/src/core/db/__generated__/client/models/PaymentSession.js +1 -2
- package/src/core/db/__generated__/client/models/Product.d.ts +0 -746
- package/src/core/db/__generated__/client/models/Product.js +1 -2
- package/src/core/db/__generated__/client/models/ProductCategory.d.ts +0 -689
- package/src/core/db/__generated__/client/models/ProductCategory.js +1 -2
- package/src/core/db/__generated__/client/models/ProductCategoryTranslation.d.ts +0 -628
- package/src/core/db/__generated__/client/models/ProductCategoryTranslation.js +1 -2
- package/src/core/db/__generated__/client/models/ProductSnapshot.d.ts +0 -664
- package/src/core/db/__generated__/client/models/ProductSnapshot.js +1 -2
- package/src/core/db/__generated__/client/models/ProductTranslation.d.ts +0 -628
- package/src/core/db/__generated__/client/models/ProductTranslation.js +1 -2
- package/src/core/db/__generated__/client/models/Reservation.d.ts +0 -650
- package/src/core/db/__generated__/client/models/Reservation.js +1 -2
- package/src/core/db/__generated__/client/models/Session.d.ts +0 -628
- package/src/core/db/__generated__/client/models/Session.js +1 -2
- package/src/core/db/__generated__/client/models/ShippingMethod.d.ts +0 -679
- package/src/core/db/__generated__/client/models/ShippingMethod.js +1 -2
- package/src/core/db/__generated__/client/models/ShippingZone.d.ts +0 -638
- package/src/core/db/__generated__/client/models/ShippingZone.js +1 -2
- package/src/core/db/__generated__/client/models/User.d.ts +0 -736
- package/src/core/db/__generated__/client/models/User.js +1 -2
- package/src/core/db/__generated__/client/models/Verification.d.ts +0 -592
- package/src/core/db/__generated__/client/models/Verification.js +1 -2
- package/src/core/db/__generated__/client/models.js +1 -2
- package/src/core/db/index.js +1 -2
- package/src/core/exceptions/http-exception.js +1 -9
- package/src/core/hono/hono.js +1 -123
- package/src/core/lib/prisma.d.ts +9 -1
- package/src/core/lib/prisma.js +1 -11
- package/src/core/logging/pino.js +1 -5
- package/src/core/notifications/email.service.d.ts +0 -15
- package/src/core/notifications/email.service.js +1 -116
- package/src/core/openapi/openapi.lib.js +1 -26
- package/src/core/types/google-maps.types.js +1 -2
- package/src/core/utils/currency.util.js +1 -11
- package/src/core/utils/env.util.js +1 -8
- package/src/core/utils/object.util.d.ts +0 -10
- package/src/core/utils/object.util.js +1 -39
- package/src/core/utils/translations.util.js +0 -2
- package/src/core/utils/zod.util.d.ts +0 -12
- package/src/core/utils/zod.util.js +1 -85
- package/src/db.js +1 -3
- package/src/features/access/access.handler.js +1 -91
- package/src/features/access/access.route.js +1 -220
- package/src/features/access/access.schema.js +1 -108
- package/src/features/access/access.service.js +1 -294
- package/src/features/cart/cart.handler.js +1 -17
- package/src/features/cart/cart.route.js +1 -32
- package/src/features/cart/cart.schema.js +1 -39
- package/src/features/cart/cart.service.d.ts +0 -7
- package/src/features/cart/cart.service.js +1 -97
- package/src/features/cart/cart.util.js +1 -76
- package/src/features/file/file.handler.js +1 -23
- package/src/features/file/file.route.js +1 -34
- package/src/features/file/file.schema.js +1 -77
- package/src/features/file/file.service.d.ts +0 -6
- package/src/features/file/file.service.js +1 -66
- package/src/features/health/health.handler.js +1 -10
- package/src/features/health/health.route.js +1 -25
- package/src/features/index.js +1 -16
- package/src/features/location/location.handler.js +1 -25
- package/src/features/location/location.route.js +1 -56
- package/src/features/location/location.schema.js +1 -50
- package/src/features/location/location.service.d.ts +0 -3
- package/src/features/location/location.service.js +1 -141
- package/src/features/manufacturer/manufacturer.handler.js +1 -53
- package/src/features/manufacturer/manufacturer.route.js +1 -97
- package/src/features/manufacturer/manufacturer.schema.js +1 -125
- package/src/features/manufacturer/manufacturer.service.d.ts +0 -19
- package/src/features/manufacturer/manufacturer.service.js +1 -190
- package/src/features/order/emails/order-confirmation.email.js +1 -229
- package/src/features/order/emails/order-notification.email.js +1 -229
- package/src/features/order/fulfilment.schema.js +1 -3
- package/src/features/order/order.handler.js +1 -54
- package/src/features/order/order.route.js +1 -111
- package/src/features/order/order.schema.js +1 -158
- package/src/features/order/order.service.d.ts +0 -15
- package/src/features/order/order.service.js +1 -306
- package/src/features/order/recipient.schema.js +1 -38
- package/src/features/organization/legal-entity.schema.js +1 -83
- package/src/features/organization/organization-configuration.schema.js +1 -115
- package/src/features/organization/organization.handler.js +1 -48
- package/src/features/organization/organization.route.js +1 -84
- package/src/features/organization/organization.schema.js +1 -64
- package/src/features/organization/organization.service.d.ts +0 -15
- package/src/features/organization/organization.service.js +1 -334
- package/src/features/payment/payment.handler.js +1 -16
- package/src/features/payment/payment.route.js +1 -22
- package/src/features/payment/payment.schema.js +1 -46
- package/src/features/payment/payment.service.js +1 -100
- package/src/features/payment/stripe.service.js +1 -164
- package/src/features/product/product-modifier.schema.js +1 -84
- package/src/features/product/product.handler.js +1 -87
- package/src/features/product/product.route.js +1 -179
- package/src/features/product/product.schema.js +1 -143
- package/src/features/product/product.service.d.ts +0 -25
- package/src/features/product/product.service.js +1 -440
- package/src/features/product-category/product-category.handler.js +1 -59
- package/src/features/product-category/product-category.route.js +1 -139
- package/src/features/product-category/product-category.schema.js +1 -86
- package/src/features/product-category/product-category.service.d.ts +0 -22
- package/src/features/product-category/product-category.service.js +1 -220
- package/src/features/reservation/emails/reservation-cancellation.email.js +1 -82
- package/src/features/reservation/emails/reservation-confirmation.email.js +1 -82
- package/src/features/reservation/emails/reservation-notification.email.js +1 -93
- package/src/features/reservation/reservation.handler.js +1 -65
- package/src/features/reservation/reservation.route.js +1 -167
- package/src/features/reservation/reservation.schema.js +1 -51
- package/src/features/reservation/reservation.service.d.ts +0 -18
- package/src/features/reservation/reservation.service.js +1 -231
- package/src/features/shipping/shipping.handler.js +1 -32
- package/src/features/shipping/shipping.route.js +1 -51
- package/src/features/shipping/shipping.service.d.ts +0 -7
- package/src/features/shipping/shipping.service.js +1 -96
- package/src/features/shipping-method/shipping-method.handler.js +1 -60
- package/src/features/shipping-method/shipping-method.route.js +1 -144
- package/src/features/shipping-method/shipping-method.schema.js +1 -48
- package/src/features/shipping-method/shipping-method.service.d.ts +0 -25
- package/src/features/shipping-method/shipping-method.service.js +1 -229
- package/src/features/shipping-method/shipping-zone.schema.js +1 -31
- package/src/features/webhook/webhook.handler.js +1 -50
- package/src/features/webhook/webhook.route.js +1 -33
- package/src/index.js +1 -6
- package/src/integrations/next.js +1 -82
- package/src/schemas/address.schema.d.ts +0 -8
- package/src/schemas/address.schema.js +1 -112
- package/src/schemas/currency.schema.d.ts +0 -42
- package/src/schemas/currency.schema.js +1 -118
- package/src/schemas/error.schema.js +1 -12
- package/src/schemas/index.js +1 -29
- package/src/schemas/locales.schema.js +1 -238
- package/src/schemas/number.schema.js +1 -29
- package/src/schemas/pagination.schema.js +1 -54
- package/src/schemas/params.schema.js +1 -20
- package/src/schemas/queries.schema.js +1 -6
- package/src/test/global-setup.d.ts +1 -0
- package/src/test/global-setup.js +1 -0
- package/src/test/integration/api-fixtures.d.ts +4 -16
- package/src/test/integration/api-fixtures.js +1 -225
- package/src/test/integration/seed.d.ts +81 -0
- package/src/test/integration/seed.js +1 -0
- package/src/test/integration/test-helpers.d.ts +107 -924
- package/src/test/integration/test-helpers.js +1 -1100
- package/src/test/setup-test-env.d.ts +1 -1
- package/src/test/setup-test-env.js +1 -29
- package/src/app.js.map +0 -1
- package/src/core/auth/auth.schema.js.map +0 -1
- package/src/core/auth/auth.util.js.map +0 -1
- package/src/core/auth/better-auth.lib.js.map +0 -1
- package/src/core/auth/generate-password-hash.util.js.map +0 -1
- package/src/core/auth/headers.schema.js.map +0 -1
- package/src/core/auth/user.schema.js.map +0 -1
- package/src/core/db/__generated__/client/browser.js.map +0 -1
- package/src/core/db/__generated__/client/client.js.map +0 -1
- package/src/core/db/__generated__/client/commonInputTypes.js.map +0 -1
- package/src/core/db/__generated__/client/enums.js.map +0 -1
- package/src/core/db/__generated__/client/internal/class.js.map +0 -1
- package/src/core/db/__generated__/client/internal/prismaNamespace.js.map +0 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js.map +0 -1
- package/src/core/db/__generated__/client/models/Account.js.map +0 -1
- package/src/core/db/__generated__/client/models/Address.js.map +0 -1
- package/src/core/db/__generated__/client/models/Campaign.js.map +0 -1
- package/src/core/db/__generated__/client/models/ClosingTimes.js.map +0 -1
- package/src/core/db/__generated__/client/models/File.js.map +0 -1
- package/src/core/db/__generated__/client/models/Invitation.js.map +0 -1
- package/src/core/db/__generated__/client/models/LegalEntity.js.map +0 -1
- package/src/core/db/__generated__/client/models/Manufacturer.js.map +0 -1
- package/src/core/db/__generated__/client/models/ManufacturerTranslation.js.map +0 -1
- package/src/core/db/__generated__/client/models/Member.js.map +0 -1
- package/src/core/db/__generated__/client/models/Modifier.js.map +0 -1
- package/src/core/db/__generated__/client/models/ModifierGroup.js.map +0 -1
- package/src/core/db/__generated__/client/models/ModifierGroupTranslation.js.map +0 -1
- package/src/core/db/__generated__/client/models/OpeningTimes.js.map +0 -1
- package/src/core/db/__generated__/client/models/Order.js.map +0 -1
- package/src/core/db/__generated__/client/models/OrderItem.js.map +0 -1
- package/src/core/db/__generated__/client/models/OrderItemTranslation.js.map +0 -1
- package/src/core/db/__generated__/client/models/Organization.js.map +0 -1
- package/src/core/db/__generated__/client/models/OrganizationConfiguration.js.map +0 -1
- package/src/core/db/__generated__/client/models/Payment.js.map +0 -1
- package/src/core/db/__generated__/client/models/PaymentSession.js.map +0 -1
- package/src/core/db/__generated__/client/models/Product.js.map +0 -1
- package/src/core/db/__generated__/client/models/ProductCategory.js.map +0 -1
- package/src/core/db/__generated__/client/models/ProductCategoryTranslation.js.map +0 -1
- package/src/core/db/__generated__/client/models/ProductSnapshot.js.map +0 -1
- package/src/core/db/__generated__/client/models/ProductTranslation.js.map +0 -1
- package/src/core/db/__generated__/client/models/Reservation.js.map +0 -1
- package/src/core/db/__generated__/client/models/Session.js.map +0 -1
- package/src/core/db/__generated__/client/models/ShippingMethod.js.map +0 -1
- package/src/core/db/__generated__/client/models/ShippingZone.js.map +0 -1
- package/src/core/db/__generated__/client/models/User.js.map +0 -1
- package/src/core/db/__generated__/client/models/Verification.js.map +0 -1
- package/src/core/db/__generated__/client/models.js.map +0 -1
- package/src/core/db/index.js.map +0 -1
- package/src/core/exceptions/http-exception.js.map +0 -1
- package/src/core/hono/hono.js.map +0 -1
- package/src/core/lib/prisma.js.map +0 -1
- package/src/core/logging/pino.js.map +0 -1
- package/src/core/notifications/email.service.js.map +0 -1
- package/src/core/openapi/openapi.lib.js.map +0 -1
- package/src/core/types/google-maps.types.js.map +0 -1
- package/src/core/utils/currency.util.js.map +0 -1
- package/src/core/utils/env.util.js.map +0 -1
- package/src/core/utils/object.util.js.map +0 -1
- package/src/core/utils/translations.util.js.map +0 -1
- package/src/core/utils/zod.util.js.map +0 -1
- package/src/db.js.map +0 -1
- package/src/features/access/access.handler.js.map +0 -1
- package/src/features/access/access.route.js.map +0 -1
- package/src/features/access/access.schema.js.map +0 -1
- package/src/features/access/access.service.js.map +0 -1
- package/src/features/cart/cart.handler.js.map +0 -1
- package/src/features/cart/cart.route.js.map +0 -1
- package/src/features/cart/cart.schema.js.map +0 -1
- package/src/features/cart/cart.service.js.map +0 -1
- package/src/features/cart/cart.util.js.map +0 -1
- package/src/features/file/file.handler.js.map +0 -1
- package/src/features/file/file.route.js.map +0 -1
- package/src/features/file/file.schema.js.map +0 -1
- package/src/features/file/file.service.js.map +0 -1
- package/src/features/health/health.handler.js.map +0 -1
- package/src/features/health/health.route.js.map +0 -1
- package/src/features/index.js.map +0 -1
- package/src/features/location/location.handler.js.map +0 -1
- package/src/features/location/location.route.js.map +0 -1
- package/src/features/location/location.schema.js.map +0 -1
- package/src/features/location/location.service.js.map +0 -1
- package/src/features/manufacturer/manufacturer.handler.js.map +0 -1
- package/src/features/manufacturer/manufacturer.route.js.map +0 -1
- package/src/features/manufacturer/manufacturer.schema.js.map +0 -1
- package/src/features/manufacturer/manufacturer.service.js.map +0 -1
- package/src/features/order/emails/order-confirmation.email.js.map +0 -1
- package/src/features/order/emails/order-notification.email.js.map +0 -1
- package/src/features/order/fulfilment.schema.js.map +0 -1
- package/src/features/order/order.handler.js.map +0 -1
- package/src/features/order/order.route.js.map +0 -1
- package/src/features/order/order.schema.js.map +0 -1
- package/src/features/order/order.service.js.map +0 -1
- package/src/features/order/recipient.schema.js.map +0 -1
- package/src/features/organization/legal-entity.schema.js.map +0 -1
- package/src/features/organization/organization-configuration.schema.js.map +0 -1
- package/src/features/organization/organization.handler.js.map +0 -1
- package/src/features/organization/organization.route.js.map +0 -1
- package/src/features/organization/organization.schema.js.map +0 -1
- package/src/features/organization/organization.service.js.map +0 -1
- package/src/features/payment/payment.handler.js.map +0 -1
- package/src/features/payment/payment.route.js.map +0 -1
- package/src/features/payment/payment.schema.js.map +0 -1
- package/src/features/payment/payment.service.js.map +0 -1
- package/src/features/payment/stripe.service.js.map +0 -1
- package/src/features/product/product-modifier.schema.js.map +0 -1
- package/src/features/product/product.handler.js.map +0 -1
- package/src/features/product/product.route.js.map +0 -1
- package/src/features/product/product.schema.js.map +0 -1
- package/src/features/product/product.service.js.map +0 -1
- package/src/features/product-category/product-category.handler.js.map +0 -1
- package/src/features/product-category/product-category.route.js.map +0 -1
- package/src/features/product-category/product-category.schema.js.map +0 -1
- package/src/features/product-category/product-category.service.js.map +0 -1
- package/src/features/reservation/emails/reservation-cancellation.email.js.map +0 -1
- package/src/features/reservation/emails/reservation-confirmation.email.js.map +0 -1
- package/src/features/reservation/emails/reservation-notification.email.js.map +0 -1
- package/src/features/reservation/reservation.handler.js.map +0 -1
- package/src/features/reservation/reservation.route.js.map +0 -1
- package/src/features/reservation/reservation.schema.js.map +0 -1
- package/src/features/reservation/reservation.service.js.map +0 -1
- package/src/features/shipping/shipping.handler.js.map +0 -1
- package/src/features/shipping/shipping.route.js.map +0 -1
- package/src/features/shipping/shipping.service.js.map +0 -1
- package/src/features/shipping-method/shipping-method.handler.js.map +0 -1
- package/src/features/shipping-method/shipping-method.route.js.map +0 -1
- package/src/features/shipping-method/shipping-method.schema.js.map +0 -1
- package/src/features/shipping-method/shipping-method.service.js.map +0 -1
- package/src/features/shipping-method/shipping-zone.schema.js.map +0 -1
- package/src/features/webhook/webhook.handler.js.map +0 -1
- package/src/features/webhook/webhook.route.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/integrations/next.js.map +0 -1
- package/src/schemas/address.schema.js.map +0 -1
- package/src/schemas/currency.schema.js.map +0 -1
- package/src/schemas/error.schema.js.map +0 -1
- package/src/schemas/index.js.map +0 -1
- package/src/schemas/locales.schema.js.map +0 -1
- package/src/schemas/number.schema.js.map +0 -1
- package/src/schemas/pagination.schema.js.map +0 -1
- package/src/schemas/params.schema.js.map +0 -1
- package/src/schemas/queries.schema.js.map +0 -1
- package/src/test/integration/api-fixtures.js.map +0 -1
- package/src/test/integration/test-helpers.js.map +0 -1
- package/src/test/setup-test-env.js.map +0 -1
package/src/integrations/next.js
CHANGED
|
@@ -1,82 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { toNextJsHandler } from "better-auth/next-js";
|
|
3
|
-
import { buildApiApp } from "../app";
|
|
4
|
-
import { createAuthClient } from "../core/auth/better-auth.lib";
|
|
5
|
-
import { createPrismaClient, } from "../core/lib/prisma";
|
|
6
|
-
import { generateOpenApiSpec } from "../core/openapi/openapi.lib";
|
|
7
|
-
export const createNextHandler = (options) => {
|
|
8
|
-
var _a;
|
|
9
|
-
// Reuse a single client per route module unless a caller injects one.
|
|
10
|
-
const prisma = (_a = options.prisma) !== null && _a !== void 0 ? _a : (() => {
|
|
11
|
-
if (!options.database) {
|
|
12
|
-
throw new Error("createNextHandler requires either a `prisma` client or `database` options.");
|
|
13
|
-
}
|
|
14
|
-
if ("adapter" in options.database) {
|
|
15
|
-
return createPrismaClient(options.database);
|
|
16
|
-
}
|
|
17
|
-
return createPrismaClient({
|
|
18
|
-
adapter: new PrismaNeon({
|
|
19
|
-
connectionString: options.database.connectionString,
|
|
20
|
-
}),
|
|
21
|
-
log: options.database.log,
|
|
22
|
-
});
|
|
23
|
-
})();
|
|
24
|
-
const authClients = new Map();
|
|
25
|
-
const getRequestAuthBaseURL = (request) => {
|
|
26
|
-
if (options.auth.baseURL) {
|
|
27
|
-
return options.auth.baseURL;
|
|
28
|
-
}
|
|
29
|
-
const url = new URL(request.url);
|
|
30
|
-
return `${url.origin}/api/auth`;
|
|
31
|
-
};
|
|
32
|
-
const getAuth = (baseURL) => {
|
|
33
|
-
const cachedAuth = authClients.get(baseURL);
|
|
34
|
-
if (cachedAuth) {
|
|
35
|
-
return cachedAuth;
|
|
36
|
-
}
|
|
37
|
-
const auth = createAuthClient(Object.assign(Object.assign({ prisma }, options.auth), { baseURL }));
|
|
38
|
-
authClients.set(baseURL, auth);
|
|
39
|
-
return auth;
|
|
40
|
-
};
|
|
41
|
-
const getOrganizationIdFromPath = (path) => {
|
|
42
|
-
var _a, _b;
|
|
43
|
-
const segments = path.split("/").filter(Boolean);
|
|
44
|
-
if (segments[0] === "organizations") {
|
|
45
|
-
return (_a = segments[1]) !== null && _a !== void 0 ? _a : "";
|
|
46
|
-
}
|
|
47
|
-
return (_b = segments[0]) !== null && _b !== void 0 ? _b : "";
|
|
48
|
-
};
|
|
49
|
-
const app = buildApiApp({
|
|
50
|
-
corsOptions: options.corsOptions,
|
|
51
|
-
maps: options.maps,
|
|
52
|
-
payment: options.payment,
|
|
53
|
-
prisma,
|
|
54
|
-
resolveAuth: (request, path) => {
|
|
55
|
-
const auth = getAuth(getRequestAuthBaseURL(request));
|
|
56
|
-
const organizationId = getOrganizationIdFromPath(path);
|
|
57
|
-
return {
|
|
58
|
-
getCurrentUser: () => auth.getCurrentUser(request.headers),
|
|
59
|
-
isGranted: (accessLevel) => auth.isGranted(request.headers, organizationId, accessLevel),
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
return (request) => {
|
|
64
|
-
if (request.url.includes("/api/auth")) {
|
|
65
|
-
const auth = getAuth(getRequestAuthBaseURL(request));
|
|
66
|
-
const { GET, POST } = toNextJsHandler(auth.auth.handler);
|
|
67
|
-
switch (request.method) {
|
|
68
|
-
case "GET":
|
|
69
|
-
return GET(request);
|
|
70
|
-
case "POST":
|
|
71
|
-
return POST(request);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (request.url.includes("/api/openapi.json")) {
|
|
75
|
-
return Response.json(generateOpenApiSpec());
|
|
76
|
-
}
|
|
77
|
-
const url = new URL(request.url);
|
|
78
|
-
url.pathname = url.pathname.replace(/^\/api/, "") || "/";
|
|
79
|
-
return app.fetch(new Request(url, request));
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=next.js.map
|
|
1
|
+
import{PrismaNeon as e}from"@prisma/adapter-neon";import{toNextJsHandler as r}from"better-auth/next-js";import{buildApiApp as t}from"../app";import{createAuthClient as a}from"../core/auth/better-auth.lib";import{createPrismaClient as n}from"../core/lib/prisma";import{generateOpenApiSpec as o}from"../core/openapi/openapi.lib";export const createNextHandler=s=>{var i;const p=null!==(i=s.prisma)&&void 0!==i?i:(()=>{if(!s.database)throw new Error("createNextHandler requires either a `prisma` client or `database` options.");return"adapter"in s.database?n(s.database):n({adapter:new e({connectionString:s.database.connectionString}),log:s.database.log})})(),u=new Map,c=e=>s.auth.baseURL?s.auth.baseURL:`${new URL(e.url).origin}/api/auth`,l=e=>{const r=u.get(e);if(r)return r;const t=a(Object.assign(Object.assign({prisma:p},s.auth),{baseURL:e}));return u.set(e,t),t},m=t({corsOptions:s.corsOptions,maps:s.maps,payment:s.payment,prisma:p,resolveAuth:(e,r)=>{const t=l(c(e)),a=(e=>{var r,t;const a=e.split("/").filter(Boolean);return"organizations"===a[0]?null!==(r=a[1])&&void 0!==r?r:"":null!==(t=a[0])&&void 0!==t?t:""})(r);return{getCurrentUser:()=>t.getCurrentUser(e.headers),isGranted:r=>t.isGranted(e.headers,a,r)}}});return e=>{if(e.url.includes("/api/auth")){const t=l(c(e)),{GET:a,POST:n}=r(t.auth.handler);switch(e.method){case"GET":return a(e);case"POST":return n(e)}}if(e.url.includes("/api/openapi.json"))return Response.json(o());const t=new URL(e.url);return t.pathname=t.pathname.replace(/^\/api/,"")||"/",m.fetch(new Request(t,e))}};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
/**
|
|
3
|
-
* Address schema
|
|
4
|
-
* Represents a physical address
|
|
5
|
-
*/
|
|
6
2
|
export declare const AddressSchema: z.ZodObject<{
|
|
7
3
|
id: z.ZodString;
|
|
8
4
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -38,10 +34,6 @@ export declare const UpdateAddressSchema: z.ZodObject<{
|
|
|
38
34
|
export type Address = z.infer<typeof AddressSchema>;
|
|
39
35
|
export type CreateAddressInput = z.infer<typeof CreateAddressSchema>;
|
|
40
36
|
export type UpdateAddressInput = z.infer<typeof UpdateAddressSchema>;
|
|
41
|
-
/**
|
|
42
|
-
* Shipping address schema
|
|
43
|
-
* Extends the address schema with additional fields for shipping
|
|
44
|
-
*/
|
|
45
37
|
export declare const ShippingAddressSchema: z.ZodObject<{
|
|
46
38
|
id: z.ZodString;
|
|
47
39
|
addressLineOne: z.ZodString;
|
|
@@ -1,112 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* Address schema
|
|
4
|
-
* Represents a physical address
|
|
5
|
-
*/
|
|
6
|
-
export const AddressSchema = z
|
|
7
|
-
.object({
|
|
8
|
-
id: z.string().cuid().openapi({
|
|
9
|
-
example: "clf9876543210abcdef",
|
|
10
|
-
description: "The unique identifier of the address",
|
|
11
|
-
}),
|
|
12
|
-
firstname: z.string().optional().nullable().openapi({
|
|
13
|
-
example: "John",
|
|
14
|
-
description: "The first name of the recipient",
|
|
15
|
-
}),
|
|
16
|
-
lastname: z.string().optional().nullable().openapi({
|
|
17
|
-
example: "Doe",
|
|
18
|
-
description: "The last name of the recipient",
|
|
19
|
-
}),
|
|
20
|
-
phone: z.string().optional().nullable().openapi({
|
|
21
|
-
example: "+1234567890",
|
|
22
|
-
description: "Phone number of the recipient",
|
|
23
|
-
}),
|
|
24
|
-
addressLineOne: z.string().openapi({
|
|
25
|
-
example: "123 Main Street",
|
|
26
|
-
description: "The first line of the address",
|
|
27
|
-
}),
|
|
28
|
-
doorNumber: z.string().nullable().optional().openapi({
|
|
29
|
-
description: "The door number of the address",
|
|
30
|
-
}),
|
|
31
|
-
addressLineTwo: z.string().nullable().optional().openapi({
|
|
32
|
-
example: "Suite 100",
|
|
33
|
-
description: "The second line of the address",
|
|
34
|
-
}),
|
|
35
|
-
zipCode: z.string().optional().openapi({
|
|
36
|
-
example: "12345",
|
|
37
|
-
description: "The postal code of the address",
|
|
38
|
-
}),
|
|
39
|
-
city: z.string().openapi({
|
|
40
|
-
example: "New York",
|
|
41
|
-
description: "The city of the address",
|
|
42
|
-
}),
|
|
43
|
-
country: z.string().openapi({
|
|
44
|
-
example: "USA",
|
|
45
|
-
description: "The country of the address",
|
|
46
|
-
}),
|
|
47
|
-
placeId: z.string().openapi({
|
|
48
|
-
example: "ChIJN1t_tKlj4AR4GeTYWZ7frY",
|
|
49
|
-
description: "The Google Place ID for the address",
|
|
50
|
-
}),
|
|
51
|
-
deliveryInstructions: z.string().nullable().optional().openapi({
|
|
52
|
-
example: "Leave at the door",
|
|
53
|
-
description: "Delivery instructions for the address",
|
|
54
|
-
}),
|
|
55
|
-
})
|
|
56
|
-
.openapi("Address");
|
|
57
|
-
export const CreateAddressSchema = AddressSchema.pick({
|
|
58
|
-
addressLineOne: true,
|
|
59
|
-
doorNumber: true,
|
|
60
|
-
addressLineTwo: true,
|
|
61
|
-
zipCode: true,
|
|
62
|
-
city: true,
|
|
63
|
-
country: true,
|
|
64
|
-
placeId: true,
|
|
65
|
-
}).openapi("CreateAddress");
|
|
66
|
-
export const UpdateAddressSchema = CreateAddressSchema.partial().openapi("UpdateAddress");
|
|
67
|
-
/**
|
|
68
|
-
* Shipping address schema
|
|
69
|
-
* Extends the address schema with additional fields for shipping
|
|
70
|
-
*/
|
|
71
|
-
export const ShippingAddressSchema = AddressSchema.extend({
|
|
72
|
-
firstname: z
|
|
73
|
-
.string()
|
|
74
|
-
.min(2, "First Name must be at least 2 characters")
|
|
75
|
-
.openapi({
|
|
76
|
-
example: "John",
|
|
77
|
-
description: "The first name of the recipient",
|
|
78
|
-
}),
|
|
79
|
-
lastname: z
|
|
80
|
-
.string()
|
|
81
|
-
.min(1, "Last Name must be at least 2 characters")
|
|
82
|
-
.openapi({
|
|
83
|
-
example: "Doe",
|
|
84
|
-
description: "The last name of the recipient",
|
|
85
|
-
}),
|
|
86
|
-
phone: z.string().min(4).openapi({
|
|
87
|
-
example: "+1234567890",
|
|
88
|
-
description: "Phone number of the recepient",
|
|
89
|
-
}),
|
|
90
|
-
});
|
|
91
|
-
export const CreateShippingAddressSchema = ShippingAddressSchema.pick({
|
|
92
|
-
firstname: true,
|
|
93
|
-
lastname: true,
|
|
94
|
-
phone: true,
|
|
95
|
-
addressLineOne: true,
|
|
96
|
-
addressLineTwo: true,
|
|
97
|
-
doorNumber: true,
|
|
98
|
-
zipCode: true,
|
|
99
|
-
city: true,
|
|
100
|
-
country: true,
|
|
101
|
-
placeId: true,
|
|
102
|
-
deliveryInstructions: true,
|
|
103
|
-
});
|
|
104
|
-
export const UpdateShippingAddressSchema = CreateShippingAddressSchema.partial()
|
|
105
|
-
.extend({
|
|
106
|
-
placeId: z.string().min(1, "This field is required").openapi({
|
|
107
|
-
example: "ChIJN1t_tKlj4AR4GeTYWZ7frY",
|
|
108
|
-
description: "The Google Place ID for the address",
|
|
109
|
-
}),
|
|
110
|
-
})
|
|
111
|
-
.openapi("UpdateShippingAddress");
|
|
112
|
-
//# sourceMappingURL=address.schema.js.map
|
|
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().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");export const CreateAddressSchema=AddressSchema.pick({addressLineOne:!0,doorNumber:!0,addressLineTwo:!0,zipCode:!0,city:!0,country:!0,placeId:!0}).openapi("CreateAddress");export const UpdateAddressSchema=CreateAddressSchema.partial().openapi("UpdateAddress");export const 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"})});export const 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});export const 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");
|
|
@@ -3,48 +3,6 @@ export declare const currencyOptions: {
|
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
5
|
}[];
|
|
6
|
-
/**
|
|
7
|
-
* @swagger
|
|
8
|
-
* components:
|
|
9
|
-
* schemas:
|
|
10
|
-
* Currency:
|
|
11
|
-
* type: string
|
|
12
|
-
* enum:
|
|
13
|
-
* - USD
|
|
14
|
-
* - EUR
|
|
15
|
-
* - GBP
|
|
16
|
-
* - JPY
|
|
17
|
-
* - AUD
|
|
18
|
-
* - CAD
|
|
19
|
-
* - CHF
|
|
20
|
-
* - CNY
|
|
21
|
-
* - SEK
|
|
22
|
-
* - NZD
|
|
23
|
-
* - MXN
|
|
24
|
-
* - SGD
|
|
25
|
-
* - HKD
|
|
26
|
-
* - NOK
|
|
27
|
-
* - KRW
|
|
28
|
-
* - TRY
|
|
29
|
-
* - RUB
|
|
30
|
-
* - INR
|
|
31
|
-
* - BRL
|
|
32
|
-
* - ZAR
|
|
33
|
-
* - DKK
|
|
34
|
-
* - PLN
|
|
35
|
-
* - THB
|
|
36
|
-
* - IDR
|
|
37
|
-
* - HUF
|
|
38
|
-
* - CZK
|
|
39
|
-
* - ILS
|
|
40
|
-
* - PHP
|
|
41
|
-
* - AED
|
|
42
|
-
* - COP
|
|
43
|
-
* - SAR
|
|
44
|
-
* - MYR
|
|
45
|
-
* - RON
|
|
46
|
-
* description: The currency code for the transaction.
|
|
47
|
-
*/
|
|
48
6
|
export declare const currency: z.ZodEnum<{
|
|
49
7
|
USD: "USD";
|
|
50
8
|
EUR: "EUR";
|
|
@@ -1,118 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const currencyOptions = [
|
|
3
|
-
{ value: "USD", label: "United States Dollar" },
|
|
4
|
-
{ value: "EUR", label: "Euro" },
|
|
5
|
-
{ value: "GBP", label: "British Pound Sterling" },
|
|
6
|
-
{ value: "JPY", label: "Japanese Yen" },
|
|
7
|
-
{ value: "AUD", label: "Australian Dollar" },
|
|
8
|
-
{ value: "CAD", label: "Canadian Dollar" },
|
|
9
|
-
{ value: "CHF", label: "Swiss Franc" },
|
|
10
|
-
{ value: "CNY", label: "Chinese Yuan" },
|
|
11
|
-
{ value: "SEK", label: "Swedish Krona" },
|
|
12
|
-
{ value: "NZD", label: "New Zealand Dollar" },
|
|
13
|
-
{ value: "MXN", label: "Mexican Peso" },
|
|
14
|
-
{ value: "SGD", label: "Singapore Dollar" },
|
|
15
|
-
{ value: "HKD", label: "Hong Kong Dollar" },
|
|
16
|
-
{ value: "NOK", label: "Norwegian Krone" },
|
|
17
|
-
{ value: "KRW", label: "South Korean Won" },
|
|
18
|
-
{ value: "TRY", label: "Turkish Lira" },
|
|
19
|
-
{ value: "RUB", label: "Russian Ruble" },
|
|
20
|
-
{ value: "INR", label: "Indian Rupee" },
|
|
21
|
-
{ value: "BRL", label: "Brazilian Real" },
|
|
22
|
-
{ value: "ZAR", label: "South African Rand" },
|
|
23
|
-
{ value: "DKK", label: "Danish Krone" },
|
|
24
|
-
{ value: "PLN", label: "Polish Złoty" },
|
|
25
|
-
{ value: "THB", label: "Thai Baht" },
|
|
26
|
-
{ value: "IDR", label: "Indonesian Rupiah" },
|
|
27
|
-
{ value: "HUF", label: "Hungarian Forint" },
|
|
28
|
-
{ value: "CZK", label: "Czech Koruna" },
|
|
29
|
-
{ value: "ILS", label: "Israeli New Shekel" },
|
|
30
|
-
{ value: "PHP", label: "Philippine Peso" },
|
|
31
|
-
{ value: "AED", label: "United Arab Emirates Dirham" },
|
|
32
|
-
{ value: "COP", label: "Colombian Peso" },
|
|
33
|
-
{ value: "SAR", label: "Saudi Riyal" },
|
|
34
|
-
{ value: "MYR", label: "Malaysian Ringgit" },
|
|
35
|
-
{ value: "RON", label: "Romanian Leu" },
|
|
36
|
-
];
|
|
37
|
-
/**
|
|
38
|
-
* @swagger
|
|
39
|
-
* components:
|
|
40
|
-
* schemas:
|
|
41
|
-
* Currency:
|
|
42
|
-
* type: string
|
|
43
|
-
* enum:
|
|
44
|
-
* - USD
|
|
45
|
-
* - EUR
|
|
46
|
-
* - GBP
|
|
47
|
-
* - JPY
|
|
48
|
-
* - AUD
|
|
49
|
-
* - CAD
|
|
50
|
-
* - CHF
|
|
51
|
-
* - CNY
|
|
52
|
-
* - SEK
|
|
53
|
-
* - NZD
|
|
54
|
-
* - MXN
|
|
55
|
-
* - SGD
|
|
56
|
-
* - HKD
|
|
57
|
-
* - NOK
|
|
58
|
-
* - KRW
|
|
59
|
-
* - TRY
|
|
60
|
-
* - RUB
|
|
61
|
-
* - INR
|
|
62
|
-
* - BRL
|
|
63
|
-
* - ZAR
|
|
64
|
-
* - DKK
|
|
65
|
-
* - PLN
|
|
66
|
-
* - THB
|
|
67
|
-
* - IDR
|
|
68
|
-
* - HUF
|
|
69
|
-
* - CZK
|
|
70
|
-
* - ILS
|
|
71
|
-
* - PHP
|
|
72
|
-
* - AED
|
|
73
|
-
* - COP
|
|
74
|
-
* - SAR
|
|
75
|
-
* - MYR
|
|
76
|
-
* - RON
|
|
77
|
-
* description: The currency code for the transaction.
|
|
78
|
-
*/
|
|
79
|
-
export const currency = z
|
|
80
|
-
.enum([
|
|
81
|
-
"USD",
|
|
82
|
-
"EUR",
|
|
83
|
-
"GBP",
|
|
84
|
-
"JPY",
|
|
85
|
-
"AUD",
|
|
86
|
-
"CAD",
|
|
87
|
-
"CHF",
|
|
88
|
-
"CNY",
|
|
89
|
-
"SEK",
|
|
90
|
-
"NZD",
|
|
91
|
-
"MXN",
|
|
92
|
-
"SGD",
|
|
93
|
-
"HKD",
|
|
94
|
-
"NOK",
|
|
95
|
-
"KRW",
|
|
96
|
-
"TRY",
|
|
97
|
-
"RUB",
|
|
98
|
-
"INR",
|
|
99
|
-
"BRL",
|
|
100
|
-
"ZAR",
|
|
101
|
-
"DKK",
|
|
102
|
-
"PLN",
|
|
103
|
-
"THB",
|
|
104
|
-
"IDR",
|
|
105
|
-
"HUF",
|
|
106
|
-
"CZK",
|
|
107
|
-
"ILS",
|
|
108
|
-
"PHP",
|
|
109
|
-
"AED",
|
|
110
|
-
"COP",
|
|
111
|
-
"SAR",
|
|
112
|
-
"MYR",
|
|
113
|
-
"RON",
|
|
114
|
-
])
|
|
115
|
-
.openapi({
|
|
116
|
-
description: "The currency code for the transaction.",
|
|
117
|
-
});
|
|
118
|
-
//# sourceMappingURL=currency.schema.js.map
|
|
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łoty"},{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"}];export const 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,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const ErrorSchema = z.object({
|
|
3
|
-
status: z.number().openapi({
|
|
4
|
-
example: 404,
|
|
5
|
-
description: "The HTTP status code",
|
|
6
|
-
}),
|
|
7
|
-
message: z.string().openapi({
|
|
8
|
-
example: "Not found",
|
|
9
|
-
description: "The error message",
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=error.schema.js.map
|
|
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.js
CHANGED
|
@@ -1,29 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "../features/cart/cart.schema";
|
|
3
|
-
export * from "./error.schema";
|
|
4
|
-
export * from "../core/auth/headers.schema";
|
|
5
|
-
export * from "../features/product/product.schema";
|
|
6
|
-
export * from "../core/auth/user.schema";
|
|
7
|
-
export * from "./pagination.schema";
|
|
8
|
-
export * from "../features/order/order.schema";
|
|
9
|
-
export * from "../features/organization/organization.schema";
|
|
10
|
-
export * from "../features/shipping-method/shipping-method.schema";
|
|
11
|
-
export * from "../features/product-category/product-category.schema";
|
|
12
|
-
export * from "../features/shipping-method/shipping-zone.schema";
|
|
13
|
-
export * from "../features/product/product-modifier.schema";
|
|
14
|
-
export * from "../features/organization/organization-configuration.schema";
|
|
15
|
-
export * from "./number.schema";
|
|
16
|
-
export * from "../features/manufacturer/manufacturer.schema";
|
|
17
|
-
export * from "./locales.schema";
|
|
18
|
-
export * from "../features/organization/legal-entity.schema";
|
|
19
|
-
export * from "../features/order/fulfilment.schema";
|
|
20
|
-
export * from "../features/file/file.schema";
|
|
21
|
-
export * from "../features/order/recipient.schema";
|
|
22
|
-
export * from "./currency.schema";
|
|
23
|
-
export * from "../core/auth/auth.schema";
|
|
24
|
-
export * from "./address.schema";
|
|
25
|
-
export * from "./params.schema";
|
|
26
|
-
export * from "../features/location/location.schema";
|
|
27
|
-
export * from "../features/payment/payment.schema";
|
|
28
|
-
export * from "../features/reservation/reservation.schema";
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
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/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"../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";
|