aivilife-contracts 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +23 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +22 -11
- package/dist/auth/index.mjs.map +1 -1
- package/dist/catalog/index.d.mts +2 -0
- package/dist/catalog/index.d.ts +2 -0
- package/dist/catalog/index.js +302 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalog/index.mjs +273 -0
- package/dist/catalog/index.mjs.map +1 -0
- package/dist/index-_kOAmyGe.d.mts +585 -0
- package/dist/index-_kOAmyGe.d.ts +585 -0
- package/dist/index.d.mts +9 -33
- package/dist/index.d.ts +9 -33
- package/dist/index.js +283 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +254 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{marketing.enums-DGUBL79s.d.mts → marketing.enums-pV5acC3L.d.mts} +10 -1
- package/dist/{marketing.enums-DGUBL79s.d.ts → marketing.enums-pV5acC3L.d.ts} +10 -1
- package/package.json +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
|
+
export { C as CreateExternalProductVideoRequest, a as CreateExternalProductVideoRequestSchema, b as CreateProductCategoryRequest, c as CreateProductCategoryRequestSchema, d as CreateProductRequest, e as CreateProductRequestSchema, f as CreateProductVariantRequest, g as CreateProductVariantRequestSchema, L as LimitSchema, h as LocalizedProductCategorySchema, i as LocalizedProductListResponse, j as LocalizedProductResponse, k as LocalizedProductSchema, P as PageSchema, l as PaginatedResponse, m as PaginatedResponseMeta, n as PaginationQuery, o as PaginationQuerySchema, p as ProductCategoryResponse, q as ProductCategorySchema, r as ProductCategoryTranslationInputSchema, s as ProductListQuery, t as ProductListQuerySchema, u as ProductListResponse, v as ProductMediaPublicIdParamSchema, w as ProductMediaResponse, x as ProductMediaRole, y as ProductMediaSchema, z as ProductMediaType, A as ProductPublicIdParamSchema, B as ProductResponse, D as ProductSchema, E as ProductSlugParamSchema, F as ProductStatus, G as ProductTranslationInputSchema, H as ProductUnit, I as ProductVariantInputSchema, J as ProductVariantPublicIdParamSchema, K as ProductVariantResponse, M as ProductVariantSchema, S as SortOrder, N as SortOrderSchema, U as UpdateProductCategoryRequest, O as UpdateProductCategoryRequestSchema, Q as UpdateProductMediaRequest, R as UpdateProductMediaRequestSchema, T as UpdateProductRequest, V as UpdateProductRequestSchema, W as UpdateProductVariantRequest, X as UpdateProductVariantRequestSchema, Y as UploadProductImageRequest, Z as UploadProductImageRequestSchema, _ as UploadProductVideoRequest, $ as UploadProductVideoRequestSchema } from './index-_kOAmyGe.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { U as UserRole, B as BinaryBranch } from './marketing.enums-
|
|
3
|
-
export { A as AuthUser, a as AuthUserSchema, b as BinaryBranchSchema, C as ConfirmEmail, c as ConfirmEmailSchema, F as ForgotPassword,
|
|
3
|
+
import { U as UserRole, B as BinaryBranch } from './marketing.enums-pV5acC3L.js';
|
|
4
|
+
export { A as AuthUser, a as AuthUserSchema, b as BinaryBranchSchema, C as ConfirmEmail, c as ConfirmEmailChange, d as ConfirmEmailChangeSchema, e as ConfirmEmailSchema, F as ForgotPassword, f as ForgotPasswordSchema, M as MarketingMemberStatus, g as MarketingMemberStatusSchema, R as RefreshResponse, h as RefreshResponseSchema, i as RegistrationAvailabilityRequest, j as RegistrationAvailabilityRequestSchema, k as RegistrationAvailabilityResponse, l as RegistrationAvailabilityResponseSchema, m as RegistrationEmailSchema, n as RegistrationLoginSchema, o as RegistrationPasswordSchema, p as RegistrationPhoneNumberSchema, q as RequestEmailChange, r as RequestEmailChangeSchema, s as RequestEmailVerification, t as RequestEmailVerificationSchema, u as ResetPassword, v as ResetPasswordSchema, S as SignInRequest, w as SignInRequestSchema, x as SignInResponse, y as SignInResponseSchema, z as SignUpRequest, D as SignUpRequestSchema } from './marketing.enums-pV5acC3L.js';
|
|
4
5
|
export { AppLocale, SupportedLocales } from './localization/index.js';
|
|
5
6
|
|
|
6
|
-
declare const PageSchema: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
7
|
-
declare const LimitSchema: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
8
|
-
declare const SortOrderSchema: z.ZodDefault<z.ZodEnum<{
|
|
9
|
-
asc: "asc";
|
|
10
|
-
desc: "desc";
|
|
11
|
-
}>>;
|
|
12
|
-
declare const PaginationQuerySchema: z.ZodObject<{
|
|
13
|
-
page: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
|
|
14
|
-
limit: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
|
|
17
|
-
type PaginationQuery = z.infer<typeof PaginationQuerySchema>;
|
|
18
|
-
type SortOrder = z.infer<typeof SortOrderSchema>;
|
|
19
|
-
type PaginatedResponseMeta = {
|
|
20
|
-
page: number;
|
|
21
|
-
limit: number;
|
|
22
|
-
total: number;
|
|
23
|
-
pageCount: number;
|
|
24
|
-
};
|
|
25
|
-
type PaginatedResponse<T> = {
|
|
26
|
-
items: T[];
|
|
27
|
-
meta: PaginatedResponseMeta;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
7
|
declare const DateFromSchema: z.ZodOptional<z.ZodString>;
|
|
31
8
|
declare const DateToSchema: z.ZodOptional<z.ZodString>;
|
|
32
9
|
declare const SearchSchema: z.ZodOptional<z.ZodString>;
|
|
@@ -96,12 +73,11 @@ declare const CreateUserRequestSchema: z.ZodObject<{
|
|
|
96
73
|
declare const UpdateUserRequestSchema: z.ZodObject<{
|
|
97
74
|
firstName: z.ZodOptional<z.ZodString>;
|
|
98
75
|
lastName: z.ZodOptional<z.ZodString>;
|
|
99
|
-
|
|
100
|
-
country: z.ZodOptional<z.ZodString>;
|
|
76
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
101
77
|
city: z.ZodOptional<z.ZodString>;
|
|
102
|
-
whatsappLink: z.ZodOptional<z.ZodNullable<z.
|
|
103
|
-
instagramLink: z.ZodOptional<z.ZodNullable<z.
|
|
104
|
-
telegramLink: z.ZodOptional<z.ZodNullable<z.
|
|
78
|
+
whatsappLink: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
79
|
+
instagramLink: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
80
|
+
telegramLink: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
105
81
|
displayCurrency: z.ZodOptional<z.ZodString>;
|
|
106
82
|
locale: z.ZodOptional<z.ZodEnum<{
|
|
107
83
|
readonly RU: "ru";
|
|
@@ -109,7 +85,7 @@ declare const UpdateUserRequestSchema: z.ZodObject<{
|
|
|
109
85
|
readonly UZ: "uz";
|
|
110
86
|
readonly EN: "en";
|
|
111
87
|
}>>;
|
|
112
|
-
}, z.core.$
|
|
88
|
+
}, z.core.$strict>;
|
|
113
89
|
declare const ChangePasswordRequestSchema: z.ZodObject<{
|
|
114
90
|
currentPassword: z.ZodString;
|
|
115
91
|
newPassword: z.ZodString;
|
|
@@ -587,4 +563,4 @@ declare const AppLocaleSchema: z.ZodEnum<{
|
|
|
587
563
|
readonly EN: "en";
|
|
588
564
|
}>;
|
|
589
565
|
|
|
590
|
-
export { AppLocaleSchema, type BaseListQuery, BaseListQuerySchema, BinaryBranch, type ChangePasswordRequest, ChangePasswordRequestSchema, type CitiesResponse, CitiesResponseSchema, type CityResponse, CityResponseSchema, type CountriesResponse, CountriesResponseSchema, type CountryResponse, CountryResponseSchema, type CreateCurrencyRequest, CreateCurrencyRequestSchema, type CreateMarketingInvitationRequest, CreateMarketingInvitationRequestSchema, type CreateMarketingInvitationResponse, CreateMarketingInvitationResponseSchema, CreateUserRequestSchema, type CreateWalletTransactionRequest, CreateWalletTransactionRequestSchema, type Currency, CurrencyCodeParamSchema, CurrencyCodeSchema, type CurrencyListResponse, CurrencyListResponseSchema, type CurrencyResponse, CurrencySchema, DateFromSchema, DateToSchema, type DbId, DbIdSchema, type ExchangeRate, type ExchangeRateListResponse, ExchangeRateListResponseSchema, type ExchangeRateResponse, ExchangeRateSchema, ExchangeRateSourceSchema, type FileIdParam, FileIdParamSchema, type GetCitiesQuery, GetCitiesQuerySchema, type GetUserWalletByTypeParams, GetUserWalletByTypeParamsSchema, GetUserWalletTransactionsParamsSchema, type GetUserWalletsParams, GetUserWalletsParamsSchema, INT4_MAX, type InvitationMarketingPlacement, InvitationMarketingPlacementSchema,
|
|
566
|
+
export { AppLocaleSchema, type BaseListQuery, BaseListQuerySchema, BinaryBranch, type ChangePasswordRequest, ChangePasswordRequestSchema, type CitiesResponse, CitiesResponseSchema, type CityResponse, CityResponseSchema, type CountriesResponse, CountriesResponseSchema, type CountryResponse, CountryResponseSchema, type CreateCurrencyRequest, CreateCurrencyRequestSchema, type CreateMarketingInvitationRequest, CreateMarketingInvitationRequestSchema, type CreateMarketingInvitationResponse, CreateMarketingInvitationResponseSchema, CreateUserRequestSchema, type CreateWalletTransactionRequest, CreateWalletTransactionRequestSchema, type Currency, CurrencyCodeParamSchema, CurrencyCodeSchema, type CurrencyListResponse, CurrencyListResponseSchema, type CurrencyResponse, CurrencySchema, DateFromSchema, DateToSchema, type DbId, DbIdSchema, type ExchangeRate, type ExchangeRateListResponse, ExchangeRateListResponseSchema, type ExchangeRateResponse, ExchangeRateSchema, ExchangeRateSourceSchema, type FileIdParam, FileIdParamSchema, type GetCitiesQuery, GetCitiesQuerySchema, type GetUserWalletByTypeParams, GetUserWalletByTypeParamsSchema, GetUserWalletTransactionsParamsSchema, type GetUserWalletsParams, GetUserWalletsParamsSchema, INT4_MAX, type InvitationMarketingPlacement, InvitationMarketingPlacementSchema, type ManualMarketingPlacement, ManualMarketingPlacementSchema, MarketingInvitationTokenSchema, type MarketingPlacementIdentity, MarketingPlacementIdentitySchema, type MarketingPlacementPreview, MarketingPlacementPreviewSchema, MarketingPublicIdentifierSchema, MoneyAmountSchema, MoneyAmountStringSchema, type MoneyView, MoneyViewSchema, RatePerBaseSchema, SearchSchema, type UpdateCurrencyRequest, UpdateCurrencyRequestSchema, type UpdateExchangeRateRequest, UpdateExchangeRateRequestSchema, UpdateUserRequestSchema, type UserCreateRequest, type UserFile, type UserFileList, UserFileListSchema, UserFileSchema, UserFileType, type UserListResponse, UserListResponseSchema, type UserResponse, UserRole, UserSchema, type UserUpdateRequest, WalletCurrency, WalletCurrencySchema, type WalletListResponse, WalletListResponseSchema, WalletOperationKeySchema, type WalletResponse, WalletSchema, WalletStatus, WalletStatusSchema, WalletTransactionDetailsListResponseSchema, type WalletTransactionDetailsResponse, WalletTransactionDetailsSchema, WalletTransactionDirection, WalletTransactionDirectionSchema, WalletTransactionListResponseSchema, WalletTransactionReason, WalletTransactionReasonSchema, type WalletTransactionResponse, WalletTransactionSchema, WalletTransactionSourceUserSchema, WalletTransactionStatus, WalletTransactionStatusSchema, type WalletTransactionsListQuery, WalletTransactionsListQuerySchema, WalletType, WalletTypeSchema };
|
package/dist/index.js
CHANGED
|
@@ -84,6 +84,12 @@ var SupportedLocales = Object.values(
|
|
|
84
84
|
var AppLocaleSchema = zod.z.enum(AppLocale);
|
|
85
85
|
|
|
86
86
|
// src/user/user.schemas.ts
|
|
87
|
+
var socialLink = (hosts) => zod.z.url().trim().max(255).refine((value) => {
|
|
88
|
+
const url = new URL(value);
|
|
89
|
+
return url.protocol === "https:" && hosts.some(
|
|
90
|
+
(host) => url.hostname === host || url.hostname === `www.${host}`
|
|
91
|
+
);
|
|
92
|
+
}, "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0443\u044E \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \u0441\u043E\u0446\u0438\u0430\u043B\u044C\u043D\u0443\u044E \u0441\u0435\u0442\u044C");
|
|
87
93
|
var UserSchema = zod.z.object({
|
|
88
94
|
id: zod.z.number().int().positive(),
|
|
89
95
|
firstName: zod.z.string().trim().max(255),
|
|
@@ -121,15 +127,16 @@ var CreateUserRequestSchema = zod.z.object({
|
|
|
121
127
|
var UpdateUserRequestSchema = zod.z.object({
|
|
122
128
|
firstName: zod.z.string().trim().min(1).max(255),
|
|
123
129
|
lastName: zod.z.string().trim().min(1).max(255),
|
|
124
|
-
|
|
125
|
-
country: zod.z.string().trim().min(1).max(255),
|
|
130
|
+
phoneNumber: zod.z.string().trim().min(7).max(20),
|
|
126
131
|
city: zod.z.string().trim().min(1).max(255),
|
|
127
|
-
whatsappLink:
|
|
128
|
-
instagramLink:
|
|
129
|
-
telegramLink:
|
|
132
|
+
whatsappLink: socialLink(["wa.me", "api.whatsapp.com"]).nullable(),
|
|
133
|
+
instagramLink: socialLink(["instagram.com"]).nullable(),
|
|
134
|
+
telegramLink: socialLink(["t.me", "telegram.me"]).nullable(),
|
|
130
135
|
displayCurrency: CurrencyCodeSchema,
|
|
131
136
|
locale: AppLocaleSchema
|
|
132
|
-
}).partial()
|
|
137
|
+
}).partial().strict().refine((value) => Object.keys(value).length > 0, {
|
|
138
|
+
message: "\u041F\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u043D\u043E \u043F\u043E\u043B\u0435 \u0434\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F"
|
|
139
|
+
});
|
|
133
140
|
var ChangePasswordRequestSchema = zod.z.object({
|
|
134
141
|
currentPassword: zod.z.string().trim().min(6).max(255),
|
|
135
142
|
newPassword: zod.z.string().trim().min(6).max(255)
|
|
@@ -222,10 +229,7 @@ var CreateMarketingInvitationResponseSchema = MarketingPlacementPreviewSchema.ex
|
|
|
222
229
|
// src/auth/sign-up.contract.ts
|
|
223
230
|
var RegistrationEmailSchema = zod.z.email("\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 email").trim().toLowerCase();
|
|
224
231
|
var RegistrationPhoneNumberSchema = zod.z.string().trim().regex(/^\+[1-9]\d{7,14}$/, "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u043C\u0435\u0436\u0434\u0443\u043D\u0430\u0440\u043E\u0434\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440");
|
|
225
|
-
var RegistrationLoginSchema = zod.z.string().trim().min(3, "\u041B\u043E\u0433\u0438\u043D \u0434\u043E\u043B\u0436\u0435\u043D \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u043D\u0435 \u043C\u0435\u043D\u0435\u0435 3 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432").max(255).regex(
|
|
226
|
-
/^[a-z0-9]+$/,
|
|
227
|
-
"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0441\u0442\u0440\u043E\u0447\u043D\u044B\u0435 \u043B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B \u0438 \u0446\u0438\u0444\u0440\u044B"
|
|
228
|
-
);
|
|
232
|
+
var RegistrationLoginSchema = zod.z.string().trim().min(3, "\u041B\u043E\u0433\u0438\u043D \u0434\u043E\u043B\u0436\u0435\u043D \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u043D\u0435 \u043C\u0435\u043D\u0435\u0435 3 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432").max(255).regex(/^[a-z0-9]+$/, "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0441\u0442\u0440\u043E\u0447\u043D\u044B\u0435 \u043B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B \u0438 \u0446\u0438\u0444\u0440\u044B");
|
|
229
233
|
var RegistrationPasswordSchema = zod.z.string().min(6, "\u041F\u0430\u0440\u043E\u043B\u044C \u0434\u043E\u043B\u0436\u0435\u043D \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u043D\u0435 \u043C\u0435\u043D\u0435\u0435 6 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432").max(255);
|
|
230
234
|
var SignUpBaseSchema = zod.z.object({
|
|
231
235
|
firstName: zod.z.string().trim().max(255),
|
|
@@ -277,6 +281,13 @@ var RequestEmailVerificationSchema = zod.z.object({
|
|
|
277
281
|
var ConfirmEmailSchema = zod.z.object({
|
|
278
282
|
token: ActionTokenSchema
|
|
279
283
|
});
|
|
284
|
+
var RequestEmailChangeSchema = zod.z.object({
|
|
285
|
+
newEmail: zod.z.email().trim(),
|
|
286
|
+
currentPassword: zod.z.string().trim().min(6).max(255)
|
|
287
|
+
});
|
|
288
|
+
var ConfirmEmailChangeSchema = zod.z.object({
|
|
289
|
+
token: ActionTokenSchema
|
|
290
|
+
});
|
|
280
291
|
var ForgotPasswordSchema = zod.z.object({
|
|
281
292
|
email: zod.z.email().trim()
|
|
282
293
|
});
|
|
@@ -459,6 +470,238 @@ var UpdateExchangeRateRequestSchema = zod.z.object({
|
|
|
459
470
|
ratePerBase: RatePerBaseSchema
|
|
460
471
|
});
|
|
461
472
|
|
|
473
|
+
// src/catalog/catalog.enums.ts
|
|
474
|
+
var ProductStatus = {
|
|
475
|
+
DRAFT: "DRAFT",
|
|
476
|
+
ACTIVE: "ACTIVE",
|
|
477
|
+
ARCHIVED: "ARCHIVED"
|
|
478
|
+
};
|
|
479
|
+
var ProductUnit = {
|
|
480
|
+
CAPSULE: "CAPSULE",
|
|
481
|
+
GRAM: "GRAM",
|
|
482
|
+
MILLILITER: "MILLILITER",
|
|
483
|
+
PIECE: "PIECE"
|
|
484
|
+
};
|
|
485
|
+
var ProductMediaType = {
|
|
486
|
+
IMAGE: "IMAGE",
|
|
487
|
+
UPLOADED_VIDEO: "UPLOADED_VIDEO",
|
|
488
|
+
EXTERNAL_VIDEO: "EXTERNAL_VIDEO"
|
|
489
|
+
};
|
|
490
|
+
var ProductMediaRole = {
|
|
491
|
+
COVER: "COVER",
|
|
492
|
+
GALLERY: "GALLERY"
|
|
493
|
+
};
|
|
494
|
+
var CodeSchema = zod.z.string().trim().toUpperCase().regex(/^[A-Z0-9][A-Z0-9_-]{1,63}$/);
|
|
495
|
+
var SlugSchema = zod.z.string().trim().toLowerCase().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(160);
|
|
496
|
+
var PublicIdSchema = zod.z.uuid();
|
|
497
|
+
var MoneySchema = zod.z.string().trim().regex(/^\d{1,16}(?:\.\d{1,2})?$/).refine((value) => Number(value) > 0, "\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0443\u043B\u044F");
|
|
498
|
+
var PvSchema = zod.z.string().trim().regex(/^\d{1,16}(?:\.\d{1,2})?$/).refine((value) => Number(value) > 0, "PV \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0443\u043B\u044F");
|
|
499
|
+
var PositiveDecimalSchema = zod.z.string().trim().regex(/^\d{1,9}(?:\.\d{1,3})?$/).refine((value) => Number(value) > 0, "\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0443\u043B\u044F");
|
|
500
|
+
var ProductCategoryTranslationInputSchema = zod.z.object({
|
|
501
|
+
locale: AppLocaleSchema,
|
|
502
|
+
name: zod.z.string().trim().min(1).max(120),
|
|
503
|
+
description: zod.z.string().trim().max(500).nullable().optional()
|
|
504
|
+
});
|
|
505
|
+
var ProductTranslationInputSchema = zod.z.object({
|
|
506
|
+
locale: AppLocaleSchema,
|
|
507
|
+
name: zod.z.string().trim().min(1).max(180),
|
|
508
|
+
shortDescription: zod.z.string().trim().min(1).max(500),
|
|
509
|
+
description: zod.z.string().trim().min(1).max(2e4),
|
|
510
|
+
composition: zod.z.string().trim().max(2e4).nullable().optional(),
|
|
511
|
+
usageInstructions: zod.z.string().trim().max(2e4).nullable().optional(),
|
|
512
|
+
features: zod.z.string().trim().max(2e4).nullable().optional(),
|
|
513
|
+
contraindications: zod.z.string().trim().max(2e4).nullable().optional(),
|
|
514
|
+
shelfLife: zod.z.string().trim().max(255).nullable().optional(),
|
|
515
|
+
packageContents: zod.z.string().trim().max(2e3).nullable().optional()
|
|
516
|
+
});
|
|
517
|
+
var UniqueLocalesSchema = (schema) => zod.z.array(schema).min(1).max(4).refine(
|
|
518
|
+
(items) => new Set(items.map((item) => item.locale)).size === items.length,
|
|
519
|
+
"\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u0434\u043B\u044F \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u044F\u0437\u044B\u043A\u0430 \u043C\u043E\u0436\u043D\u043E \u043F\u0435\u0440\u0435\u0434\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0440\u0430\u0437"
|
|
520
|
+
);
|
|
521
|
+
var CreateProductCategoryRequestSchema = zod.z.object({
|
|
522
|
+
code: CodeSchema,
|
|
523
|
+
slug: SlugSchema,
|
|
524
|
+
sortOrder: zod.z.number().int().min(0).max(1e6).default(0),
|
|
525
|
+
translations: UniqueLocalesSchema(ProductCategoryTranslationInputSchema)
|
|
526
|
+
});
|
|
527
|
+
var UpdateProductCategoryRequestSchema = zod.z.object({
|
|
528
|
+
slug: SlugSchema,
|
|
529
|
+
sortOrder: zod.z.number().int().min(0).max(1e6),
|
|
530
|
+
translations: UniqueLocalesSchema(ProductCategoryTranslationInputSchema),
|
|
531
|
+
version: zod.z.number().int().positive()
|
|
532
|
+
}).partial().required({ version: true });
|
|
533
|
+
var ProductVariantInputSchema = zod.z.object({
|
|
534
|
+
sku: CodeSchema,
|
|
535
|
+
barcode: zod.z.string().trim().min(1).max(64).nullable().optional(),
|
|
536
|
+
quantity: PositiveDecimalSchema,
|
|
537
|
+
unit: zod.z.enum(ProductUnit),
|
|
538
|
+
netWeightGrams: PositiveDecimalSchema.nullable().optional(),
|
|
539
|
+
priceUsd: MoneySchema,
|
|
540
|
+
pv: PvSchema,
|
|
541
|
+
shippingWeightGrams: PositiveDecimalSchema.nullable().optional(),
|
|
542
|
+
lengthMm: PositiveDecimalSchema.nullable().optional(),
|
|
543
|
+
widthMm: PositiveDecimalSchema.nullable().optional(),
|
|
544
|
+
heightMm: PositiveDecimalSchema.nullable().optional(),
|
|
545
|
+
isDefault: zod.z.boolean().default(false),
|
|
546
|
+
isActive: zod.z.boolean().default(true),
|
|
547
|
+
sortOrder: zod.z.number().int().min(0).max(1e6).default(0)
|
|
548
|
+
});
|
|
549
|
+
var CreateProductRequestSchema = zod.z.object({
|
|
550
|
+
code: CodeSchema,
|
|
551
|
+
slug: SlugSchema,
|
|
552
|
+
manufacturerCountryCode: zod.z.string().trim().toUpperCase().length(2),
|
|
553
|
+
manufacturerName: zod.z.string().trim().max(255).nullable().optional(),
|
|
554
|
+
sgr: zod.z.string().trim().max(255).nullable().optional(),
|
|
555
|
+
isFeatured: zod.z.boolean().default(false),
|
|
556
|
+
sortOrder: zod.z.number().int().min(0).max(1e6).default(0),
|
|
557
|
+
translations: UniqueLocalesSchema(ProductTranslationInputSchema),
|
|
558
|
+
categoryPublicIds: zod.z.array(PublicIdSchema).min(1).max(100),
|
|
559
|
+
primaryCategoryPublicId: PublicIdSchema,
|
|
560
|
+
variants: zod.z.array(ProductVariantInputSchema).min(1).max(100).refine(
|
|
561
|
+
(items) => items.filter((item) => item.isDefault).length === 1,
|
|
562
|
+
"\u0414\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u0440\u043E\u0432\u043D\u043E \u043E\u0434\u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044F"
|
|
563
|
+
)
|
|
564
|
+
}).refine(
|
|
565
|
+
(value) => value.categoryPublicIds.includes(value.primaryCategoryPublicId),
|
|
566
|
+
{
|
|
567
|
+
message: "\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0432 \u0441\u043F\u0438\u0441\u043A\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0439",
|
|
568
|
+
path: ["primaryCategoryPublicId"]
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
var UpdateProductRequestSchema = zod.z.object({
|
|
572
|
+
slug: SlugSchema,
|
|
573
|
+
manufacturerCountryCode: zod.z.string().trim().toUpperCase().length(2),
|
|
574
|
+
manufacturerName: zod.z.string().trim().max(255).nullable(),
|
|
575
|
+
sgr: zod.z.string().trim().max(255).nullable(),
|
|
576
|
+
isFeatured: zod.z.boolean(),
|
|
577
|
+
sortOrder: zod.z.number().int().min(0).max(1e6),
|
|
578
|
+
translations: UniqueLocalesSchema(ProductTranslationInputSchema),
|
|
579
|
+
categoryPublicIds: zod.z.array(PublicIdSchema).min(1).max(100),
|
|
580
|
+
primaryCategoryPublicId: PublicIdSchema,
|
|
581
|
+
version: zod.z.number().int().positive()
|
|
582
|
+
}).partial().required({ version: true }).refine(
|
|
583
|
+
(value) => !value.primaryCategoryPublicId || !value.categoryPublicIds || value.categoryPublicIds.includes(value.primaryCategoryPublicId),
|
|
584
|
+
{
|
|
585
|
+
message: "\u041E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0432 \u0441\u043F\u0438\u0441\u043A\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0439",
|
|
586
|
+
path: ["primaryCategoryPublicId"]
|
|
587
|
+
}
|
|
588
|
+
);
|
|
589
|
+
var CreateProductVariantRequestSchema = ProductVariantInputSchema;
|
|
590
|
+
var UpdateProductVariantRequestSchema = ProductVariantInputSchema.partial().extend({
|
|
591
|
+
version: zod.z.number().int().positive()
|
|
592
|
+
});
|
|
593
|
+
var ProductPublicIdParamSchema = zod.z.object({
|
|
594
|
+
publicId: PublicIdSchema
|
|
595
|
+
});
|
|
596
|
+
var ProductSlugParamSchema = zod.z.object({ slug: SlugSchema });
|
|
597
|
+
var ProductVariantPublicIdParamSchema = zod.z.object({
|
|
598
|
+
publicId: PublicIdSchema,
|
|
599
|
+
variantPublicId: PublicIdSchema
|
|
600
|
+
});
|
|
601
|
+
var ProductMediaPublicIdParamSchema = zod.z.object({
|
|
602
|
+
publicId: PublicIdSchema,
|
|
603
|
+
mediaPublicId: PublicIdSchema
|
|
604
|
+
});
|
|
605
|
+
var ProductListQuerySchema = BaseListQuerySchema.extend({
|
|
606
|
+
status: zod.z.enum(ProductStatus).optional(),
|
|
607
|
+
category: SlugSchema.optional(),
|
|
608
|
+
featured: zod.z.coerce.boolean().optional()
|
|
609
|
+
});
|
|
610
|
+
var CreateExternalProductVideoRequestSchema = zod.z.object({
|
|
611
|
+
url: zod.z.url().max(2e3).refine((value) => {
|
|
612
|
+
const url = new URL(value);
|
|
613
|
+
const host = url.hostname.toLowerCase().replace(/^www\./, "");
|
|
614
|
+
return url.protocol === "https:" && ["youtube.com", "youtu.be", "vimeo.com", "player.vimeo.com"].includes(
|
|
615
|
+
host
|
|
616
|
+
);
|
|
617
|
+
}, "\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E HTTPS-\u0441\u0441\u044B\u043B\u043A\u0438 YouTube \u0438 Vimeo"),
|
|
618
|
+
sortOrder: zod.z.number().int().min(0).max(1e6).default(0)
|
|
619
|
+
});
|
|
620
|
+
var UploadProductImageRequestSchema = zod.z.object({
|
|
621
|
+
role: zod.z.enum(ProductMediaRole).default(ProductMediaRole.GALLERY),
|
|
622
|
+
sortOrder: zod.z.coerce.number().int().min(0).max(1e6).default(0)
|
|
623
|
+
});
|
|
624
|
+
var UploadProductVideoRequestSchema = zod.z.object({
|
|
625
|
+
sortOrder: zod.z.coerce.number().int().min(0).max(1e6).default(0)
|
|
626
|
+
});
|
|
627
|
+
var UpdateProductMediaRequestSchema = zod.z.object({
|
|
628
|
+
role: zod.z.enum(ProductMediaRole).optional(),
|
|
629
|
+
sortOrder: zod.z.number().int().min(0).max(1e6).optional()
|
|
630
|
+
});
|
|
631
|
+
var ProductCategorySchema = zod.z.object({
|
|
632
|
+
publicId: PublicIdSchema,
|
|
633
|
+
code: CodeSchema,
|
|
634
|
+
slug: SlugSchema,
|
|
635
|
+
status: zod.z.enum(ProductStatus),
|
|
636
|
+
sortOrder: zod.z.number().int().nonnegative(),
|
|
637
|
+
version: zod.z.number().int().positive(),
|
|
638
|
+
translations: zod.z.array(ProductCategoryTranslationInputSchema),
|
|
639
|
+
createdAt: zod.z.string().datetime(),
|
|
640
|
+
updatedAt: zod.z.string().datetime()
|
|
641
|
+
});
|
|
642
|
+
var ProductVariantSchema = ProductVariantInputSchema.extend({
|
|
643
|
+
publicId: PublicIdSchema,
|
|
644
|
+
version: zod.z.number().int().positive(),
|
|
645
|
+
createdAt: zod.z.string().datetime(),
|
|
646
|
+
updatedAt: zod.z.string().datetime()
|
|
647
|
+
});
|
|
648
|
+
var ProductMediaSchema = zod.z.object({
|
|
649
|
+
publicId: PublicIdSchema,
|
|
650
|
+
type: zod.z.enum(ProductMediaType),
|
|
651
|
+
role: zod.z.enum(ProductMediaRole),
|
|
652
|
+
externalUrl: zod.z.string().nullable(),
|
|
653
|
+
contentUrl: zod.z.string().nullable(),
|
|
654
|
+
mimeType: zod.z.string().nullable(),
|
|
655
|
+
sizeBytes: zod.z.number().int().positive().nullable(),
|
|
656
|
+
originalName: zod.z.string().nullable(),
|
|
657
|
+
sortOrder: zod.z.number().int().nonnegative(),
|
|
658
|
+
createdAt: zod.z.string().datetime(),
|
|
659
|
+
updatedAt: zod.z.string().datetime()
|
|
660
|
+
});
|
|
661
|
+
var ProductSchema = zod.z.object({
|
|
662
|
+
publicId: PublicIdSchema,
|
|
663
|
+
code: CodeSchema,
|
|
664
|
+
slug: SlugSchema,
|
|
665
|
+
status: zod.z.enum(ProductStatus),
|
|
666
|
+
manufacturerCountryCode: zod.z.string().length(2),
|
|
667
|
+
manufacturerName: zod.z.string().nullable(),
|
|
668
|
+
sgr: zod.z.string().nullable(),
|
|
669
|
+
isFeatured: zod.z.boolean(),
|
|
670
|
+
sortOrder: zod.z.number().int().nonnegative(),
|
|
671
|
+
publishedAt: zod.z.string().datetime().nullable(),
|
|
672
|
+
version: zod.z.number().int().positive(),
|
|
673
|
+
translations: zod.z.array(ProductTranslationInputSchema),
|
|
674
|
+
categories: zod.z.array(ProductCategorySchema),
|
|
675
|
+
primaryCategoryPublicId: PublicIdSchema,
|
|
676
|
+
variants: zod.z.array(ProductVariantSchema),
|
|
677
|
+
media: zod.z.array(ProductMediaSchema),
|
|
678
|
+
createdAt: zod.z.string().datetime(),
|
|
679
|
+
updatedAt: zod.z.string().datetime()
|
|
680
|
+
});
|
|
681
|
+
var LocalizedProductCategorySchema = zod.z.object({
|
|
682
|
+
publicId: PublicIdSchema,
|
|
683
|
+
code: CodeSchema,
|
|
684
|
+
slug: SlugSchema,
|
|
685
|
+
name: zod.z.string(),
|
|
686
|
+
description: zod.z.string().nullable()
|
|
687
|
+
});
|
|
688
|
+
var LocalizedProductSchema = ProductSchema.omit({
|
|
689
|
+
translations: true,
|
|
690
|
+
categories: true,
|
|
691
|
+
version: true
|
|
692
|
+
}).extend({
|
|
693
|
+
name: zod.z.string(),
|
|
694
|
+
shortDescription: zod.z.string(),
|
|
695
|
+
description: zod.z.string(),
|
|
696
|
+
composition: zod.z.string().nullable(),
|
|
697
|
+
usageInstructions: zod.z.string().nullable(),
|
|
698
|
+
features: zod.z.string().nullable(),
|
|
699
|
+
contraindications: zod.z.string().nullable(),
|
|
700
|
+
shelfLife: zod.z.string().nullable(),
|
|
701
|
+
packageContents: zod.z.string().nullable(),
|
|
702
|
+
categories: zod.z.array(LocalizedProductCategorySchema)
|
|
703
|
+
});
|
|
704
|
+
|
|
462
705
|
exports.AppLocale = AppLocale;
|
|
463
706
|
exports.AppLocaleSchema = AppLocaleSchema;
|
|
464
707
|
exports.AuthUserSchema = AuthUserSchema;
|
|
@@ -468,12 +711,17 @@ exports.BinaryBranchSchema = BinaryBranchSchema;
|
|
|
468
711
|
exports.ChangePasswordRequestSchema = ChangePasswordRequestSchema;
|
|
469
712
|
exports.CitiesResponseSchema = CitiesResponseSchema;
|
|
470
713
|
exports.CityResponseSchema = CityResponseSchema;
|
|
714
|
+
exports.ConfirmEmailChangeSchema = ConfirmEmailChangeSchema;
|
|
471
715
|
exports.ConfirmEmailSchema = ConfirmEmailSchema;
|
|
472
716
|
exports.CountriesResponseSchema = CountriesResponseSchema;
|
|
473
717
|
exports.CountryResponseSchema = CountryResponseSchema;
|
|
474
718
|
exports.CreateCurrencyRequestSchema = CreateCurrencyRequestSchema;
|
|
719
|
+
exports.CreateExternalProductVideoRequestSchema = CreateExternalProductVideoRequestSchema;
|
|
475
720
|
exports.CreateMarketingInvitationRequestSchema = CreateMarketingInvitationRequestSchema;
|
|
476
721
|
exports.CreateMarketingInvitationResponseSchema = CreateMarketingInvitationResponseSchema;
|
|
722
|
+
exports.CreateProductCategoryRequestSchema = CreateProductCategoryRequestSchema;
|
|
723
|
+
exports.CreateProductRequestSchema = CreateProductRequestSchema;
|
|
724
|
+
exports.CreateProductVariantRequestSchema = CreateProductVariantRequestSchema;
|
|
477
725
|
exports.CreateUserRequestSchema = CreateUserRequestSchema;
|
|
478
726
|
exports.CreateWalletTransactionRequestSchema = CreateWalletTransactionRequestSchema;
|
|
479
727
|
exports.CurrencyCodeParamSchema = CurrencyCodeParamSchema;
|
|
@@ -495,6 +743,8 @@ exports.GetUserWalletsParamsSchema = GetUserWalletsParamsSchema;
|
|
|
495
743
|
exports.INT4_MAX = INT4_MAX;
|
|
496
744
|
exports.InvitationMarketingPlacementSchema = InvitationMarketingPlacementSchema;
|
|
497
745
|
exports.LimitSchema = LimitSchema;
|
|
746
|
+
exports.LocalizedProductCategorySchema = LocalizedProductCategorySchema;
|
|
747
|
+
exports.LocalizedProductSchema = LocalizedProductSchema;
|
|
498
748
|
exports.ManualMarketingPlacementSchema = ManualMarketingPlacementSchema;
|
|
499
749
|
exports.MarketingInvitationTokenSchema = MarketingInvitationTokenSchema;
|
|
500
750
|
exports.MarketingMemberStatus = MarketingMemberStatus;
|
|
@@ -507,6 +757,22 @@ exports.MoneyAmountStringSchema = MoneyAmountStringSchema;
|
|
|
507
757
|
exports.MoneyViewSchema = MoneyViewSchema;
|
|
508
758
|
exports.PageSchema = PageSchema;
|
|
509
759
|
exports.PaginationQuerySchema = PaginationQuerySchema;
|
|
760
|
+
exports.ProductCategorySchema = ProductCategorySchema;
|
|
761
|
+
exports.ProductCategoryTranslationInputSchema = ProductCategoryTranslationInputSchema;
|
|
762
|
+
exports.ProductListQuerySchema = ProductListQuerySchema;
|
|
763
|
+
exports.ProductMediaPublicIdParamSchema = ProductMediaPublicIdParamSchema;
|
|
764
|
+
exports.ProductMediaRole = ProductMediaRole;
|
|
765
|
+
exports.ProductMediaSchema = ProductMediaSchema;
|
|
766
|
+
exports.ProductMediaType = ProductMediaType;
|
|
767
|
+
exports.ProductPublicIdParamSchema = ProductPublicIdParamSchema;
|
|
768
|
+
exports.ProductSchema = ProductSchema;
|
|
769
|
+
exports.ProductSlugParamSchema = ProductSlugParamSchema;
|
|
770
|
+
exports.ProductStatus = ProductStatus;
|
|
771
|
+
exports.ProductTranslationInputSchema = ProductTranslationInputSchema;
|
|
772
|
+
exports.ProductUnit = ProductUnit;
|
|
773
|
+
exports.ProductVariantInputSchema = ProductVariantInputSchema;
|
|
774
|
+
exports.ProductVariantPublicIdParamSchema = ProductVariantPublicIdParamSchema;
|
|
775
|
+
exports.ProductVariantSchema = ProductVariantSchema;
|
|
510
776
|
exports.RatePerBaseSchema = RatePerBaseSchema;
|
|
511
777
|
exports.RefreshResponseSchema = RefreshResponseSchema;
|
|
512
778
|
exports.RegistrationAvailabilityRequestSchema = RegistrationAvailabilityRequestSchema;
|
|
@@ -515,6 +781,7 @@ exports.RegistrationEmailSchema = RegistrationEmailSchema;
|
|
|
515
781
|
exports.RegistrationLoginSchema = RegistrationLoginSchema;
|
|
516
782
|
exports.RegistrationPasswordSchema = RegistrationPasswordSchema;
|
|
517
783
|
exports.RegistrationPhoneNumberSchema = RegistrationPhoneNumberSchema;
|
|
784
|
+
exports.RequestEmailChangeSchema = RequestEmailChangeSchema;
|
|
518
785
|
exports.RequestEmailVerificationSchema = RequestEmailVerificationSchema;
|
|
519
786
|
exports.ResetPasswordSchema = ResetPasswordSchema;
|
|
520
787
|
exports.SearchSchema = SearchSchema;
|
|
@@ -525,7 +792,13 @@ exports.SortOrderSchema = SortOrderSchema;
|
|
|
525
792
|
exports.SupportedLocales = SupportedLocales;
|
|
526
793
|
exports.UpdateCurrencyRequestSchema = UpdateCurrencyRequestSchema;
|
|
527
794
|
exports.UpdateExchangeRateRequestSchema = UpdateExchangeRateRequestSchema;
|
|
795
|
+
exports.UpdateProductCategoryRequestSchema = UpdateProductCategoryRequestSchema;
|
|
796
|
+
exports.UpdateProductMediaRequestSchema = UpdateProductMediaRequestSchema;
|
|
797
|
+
exports.UpdateProductRequestSchema = UpdateProductRequestSchema;
|
|
798
|
+
exports.UpdateProductVariantRequestSchema = UpdateProductVariantRequestSchema;
|
|
528
799
|
exports.UpdateUserRequestSchema = UpdateUserRequestSchema;
|
|
800
|
+
exports.UploadProductImageRequestSchema = UploadProductImageRequestSchema;
|
|
801
|
+
exports.UploadProductVideoRequestSchema = UploadProductVideoRequestSchema;
|
|
529
802
|
exports.UserFileListSchema = UserFileListSchema;
|
|
530
803
|
exports.UserFileSchema = UserFileSchema;
|
|
531
804
|
exports.UserFileType = UserFileType;
|