@ssyazilim/ss-shopping-schemas
v0.1.35
Published
Shared Zod schemas and TypeScript types for SS Software projects
Downloads
4,227
Readme
@ssyazilim/ss-shopping-schemas
Shared Zod schemas, TypeScript types and OpenAPI spec for SS Yazılım projects.
API Docs: https://ssyazilim.github.io/ss-shopping-schemas
Installation
npm install @ssyazilim/ss-shopping-schemasExports
The package has two entry points:
| Import | İçerik |
| -------------------------------------- | ----------------------------- |
| @ssyazilim/ss-shopping-schemas | Zod schemas, TypeScript types |
| @ssyazilim/ss-shopping-schemas/forms | Form schemas, locale types |
Usage
Schemas
import {
LoginUserSchema,
AddUserSchema,
PaginationQuerySchema,
ApiSuccessSchema,
ApiErrorSchema,
} from '@ssyazilim/ss-shopping-schemas';
// Validation
const result = LoginUserSchema.safeParse({ email: '[email protected]', password: '123' });Types
import type {
User,
UserRole,
AuthResponse,
AuthTokenPayload,
} from '@ssyazilim/ss-shopping-schemas';Forms
import type { ILocale } from '@ssyazilim/ss-shopping-schemas/forms';
import { tr, en } from '@ssyazilim/ss-shopping-schemas/forms';Schemas Reference
Full interactive documentation: https://ssyazilim.github.io/ss-shopping-schemas
Common
| Schema | Açıklama |
| ----------------------- | ------------------------------- |
| PaginationQuerySchema | page, limit |
| ListQuerySchema | page, limit, sort, text |
| DeleteModelSchema | selectedIds: string[] |
| ApiSuccessSchema | { success: { message } } |
| ApiErrorSchema | { error: { message } } |
Modüller
| Modül | Schemas |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Auth | LoginUserSchema, AddUserSchema, ActivateUserSchema, PasswordResetUserSchema, PasswordResetCompleteUserSchema |
| Address | AddAddressSchema, UpdateAddressSchema |
| Agreement | AgreementSchema, AddAgreementsSchema, UpdateAgreementSchema |
| Brand | BrandSchema, AddBrandsSchema, UpdateBrandSchema |
| Card | AddCardSchema |
| Cart | AddToCartSchema, SetQuantitySchema |
| Category | CategorySchema, AddCategorySchema, UpdateCategorySchema |
| Company | AddCompanySchema, UpdateCompanySchema |
| External | AddExternalSchema, UpdateExternalSchema, CheckSMTPSchema |
| Form | ContactMeSchema, ContactMeErrorSchema, ContactMeResumeSchema |
| Google | GeminiPromptSchema, TranslateSchema |
| GSM | SendSmsSchema |
| Minio Bucket | AddBucketConfigSchema, AddBucketVersionSchema |
| Minio Object | AddObjectSchema, DeleteObjectSchema, CopyObjectSchema, PresignedUrlSchema |
| Payment | AddPaymentSchema, SavePaymentSchema, CancelPaymentSchema, CheckInstallmentSchema |
| Post | PostSchema, AddPostsSchema, LikePostSchema, CommentPostSchema |
| Product | ProductSchema, AddProductsSchema, EditProductSchema, PriceSchema, ImagesSchema |
| Product Variant | VariantSchema, AddVariantSchema, AddVariantsMultiSchema, UpdateVariantSchema |
| Question | AddQuestionSchema, UpdateQuestionSchema |
| Review | AddReviewSchema |
| Shipping | AddShippingAddressSchema, AddShippingShipmentSchema, ShippingTemplateSchema, ShippingProviderSchema |
| Traffic | AnalyzeTrafficSchema |
| Translation | TranslationSchema, AddTranslationsSchema, UpdateTranslationSchema |
| User | CustomerSchema, AddCustomersSchema, EditUserSchema, UpdateCustomerSchema |
API Response Format
{ "success": { "message": "...", "data": {} } }Development
npm run build # dist/ üret
npm run typecheck # TypeScript kontrol
npm run test # Testleri çalıştır
npm run generate:openapi # openapi.json üret
npm run lint # ESLint
npm run format # PrettierVersiyon güncellenince CI otomatik olarak npm'e publish eder ve Swagger docs'u günceller.
