@floristcloud/api-lib 1.2.224 → 1.2.226
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/build/constant/client-registration.constant.js +11 -0
- package/build/constant/index.js +2 -0
- package/build/constant/write-off-image.constant.js +11 -0
- package/build/enum/notification-type.enum.js +3 -0
- package/build/schemas/client/register-client-webshop-request.schema.js +5 -4
- package/build/schemas/write-off/write-off-image.schema.js +4 -0
- package/constant/client-registration.constant.ts +8 -0
- package/constant/index.ts +2 -0
- package/constant/write-off-image.constant.ts +8 -0
- package/enum/notification-type.enum.ts +3 -0
- package/package.json +1 -1
- package/schemas/client/register-client-webshop-request.schema.ts +10 -4
- package/schemas/write-off/write-off-image.schema.ts +4 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLIENT_REGISTRATION_EMAIL_MAX_LENGTH = exports.CLIENT_REGISTRATION_PHONE_MAX_LENGTH = exports.CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH = exports.CLIENT_REGISTRATION_NAME_MAX_LENGTH = void 0;
|
|
4
|
+
// Потолки полей публичной заявки на регистрацию с витрины. Тело запроса до 1 МиБ, а данные заявки уходят
|
|
5
|
+
// в письма админам и в payload уведомлений — без границы туда попадает мегабайт текста.
|
|
6
|
+
exports.CLIENT_REGISTRATION_NAME_MAX_LENGTH = 255;
|
|
7
|
+
exports.CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH = 255;
|
|
8
|
+
// Номер с кодом страны и разделителями укладывается с запасом.
|
|
9
|
+
exports.CLIENT_REGISTRATION_PHONE_MAX_LENGTH = 32;
|
|
10
|
+
// Предел длины адреса по RFC 5321.
|
|
11
|
+
exports.CLIENT_REGISTRATION_EMAIL_MAX_LENGTH = 254;
|
package/build/constant/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./report.constant"), exports);
|
|
|
24
24
|
__exportStar(require("./oksm"), exports);
|
|
25
25
|
__exportStar(require("./okei"), exports);
|
|
26
26
|
__exportStar(require("./contact-phone.constant"), exports);
|
|
27
|
+
__exportStar(require("./client-registration.constant"), exports);
|
|
27
28
|
__exportStar(require("./settings.constant"), exports);
|
|
28
29
|
__exportStar(require("./consignment-product-enrichment.constant"), exports);
|
|
29
30
|
__exportStar(require("./attribute-normalization.constant"), exports);
|
|
@@ -34,3 +35,4 @@ __exportStar(require("./order-external-number.constant"), exports);
|
|
|
34
35
|
__exportStar(require("./discount-rules-pricing-type-list.constant"), exports);
|
|
35
36
|
__exportStar(require("./measure-unit-limits"), exports);
|
|
36
37
|
__exportStar(require("./product-resolution.constant"), exports);
|
|
38
|
+
__exportStar(require("./write-off-image.constant"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITE_OFF_IMAGE_RETENTION_DAYS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Retention policy for write-off photos (FC-632): 90 days from the record's creation. After that a photo counts as
|
|
6
|
+
* unavailable — clients show «фото удалено», the export gives no link, archives skip it.
|
|
7
|
+
*
|
|
8
|
+
* This is a policy, not a storage check. The lifecycle rule on `write-offs/` deletes new photos around this time
|
|
9
|
+
* (with up to a day of lag), while older photos under `images/` are not deleted by it and may still be in the bucket.
|
|
10
|
+
*/
|
|
11
|
+
exports.WRITE_OFF_IMAGE_RETENTION_DAYS = 90;
|
|
@@ -26,4 +26,7 @@ var NotificationTypeEnum;
|
|
|
26
26
|
NotificationTypeEnum["PRE_ORDER_CREATED"] = "PRE_ORDER_CREATED";
|
|
27
27
|
// Клиенту: рассылка сценария PRE_ORDER_COLLECTION_OPENED — открыт сбор предзаказов.
|
|
28
28
|
NotificationTypeEnum["PRE_ORDER_COLLECTION_OPENED"] = "PRE_ORDER_COLLECTION_OPENED";
|
|
29
|
+
// Админам: на витрине подана заявка с телефоном или email клиента, у которого нет учётной записи.
|
|
30
|
+
// Заявитель получает нейтральный ответ; привязывать заявку к клиенту автоматически нельзя — это захват аккаунта.
|
|
31
|
+
NotificationTypeEnum["CLIENT_REGISTRATION_CONFLICT"] = "CLIENT_REGISTRATION_CONFLICT";
|
|
29
32
|
})(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
|
|
@@ -4,11 +4,12 @@ exports.RegisterClientWebshopRequestSchema = void 0;
|
|
|
4
4
|
const password_schema_1 = require("../auth/password.schema");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const client_type_enum_1 = require("../../enum/client-type.enum");
|
|
7
|
+
const client_registration_constant_1 = require("../../constant/client-registration.constant");
|
|
7
8
|
exports.RegisterClientWebshopRequestSchema = zod_1.z.object({
|
|
8
|
-
name: zod_1.z.string(),
|
|
9
|
+
name: zod_1.z.string().max(client_registration_constant_1.CLIENT_REGISTRATION_NAME_MAX_LENGTH),
|
|
9
10
|
password: password_schema_1.PasswordSchema,
|
|
10
|
-
contactName: zod_1.z.string().nullable(),
|
|
11
|
-
phone: zod_1.z.string(),
|
|
12
|
-
email: zod_1.z.email().toLowerCase(),
|
|
11
|
+
contactName: zod_1.z.string().max(client_registration_constant_1.CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH).nullable(),
|
|
12
|
+
phone: zod_1.z.string().max(client_registration_constant_1.CLIENT_REGISTRATION_PHONE_MAX_LENGTH),
|
|
13
|
+
email: zod_1.z.email().max(client_registration_constant_1.CLIENT_REGISTRATION_EMAIL_MAX_LENGTH).toLowerCase(),
|
|
13
14
|
type: zod_1.z.nativeEnum(client_type_enum_1.ClientTypeEnum),
|
|
14
15
|
});
|
|
@@ -8,4 +8,8 @@ exports.WriteOffImageSchema = zod_1.z.object({
|
|
|
8
8
|
url: zod_1.z.string(),
|
|
9
9
|
createdAt: zod_1.z.date(),
|
|
10
10
|
deletedAt: zod_1.z.date().nullable(),
|
|
11
|
+
// Retention policy (WRITE_OFF_IMAGE_RETENTION_DAYS), not a storage check: once expired, treat the photo as
|
|
12
|
+
// unavailable whether or not the file is still in the bucket. The record itself stays.
|
|
13
|
+
fileExpiresAt: zod_1.z.date(),
|
|
14
|
+
isFileExpired: zod_1.z.boolean(),
|
|
11
15
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Потолки полей публичной заявки на регистрацию с витрины. Тело запроса до 1 МиБ, а данные заявки уходят
|
|
2
|
+
// в письма админам и в payload уведомлений — без границы туда попадает мегабайт текста.
|
|
3
|
+
export const CLIENT_REGISTRATION_NAME_MAX_LENGTH = 255;
|
|
4
|
+
export const CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH = 255;
|
|
5
|
+
// Номер с кодом страны и разделителями укладывается с запасом.
|
|
6
|
+
export const CLIENT_REGISTRATION_PHONE_MAX_LENGTH = 32;
|
|
7
|
+
// Предел длины адреса по RFC 5321.
|
|
8
|
+
export const CLIENT_REGISTRATION_EMAIL_MAX_LENGTH = 254;
|
package/constant/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './report.constant';
|
|
|
8
8
|
export * from './oksm';
|
|
9
9
|
export * from './okei';
|
|
10
10
|
export * from './contact-phone.constant';
|
|
11
|
+
export * from './client-registration.constant';
|
|
11
12
|
export * from './settings.constant';
|
|
12
13
|
export * from './consignment-product-enrichment.constant';
|
|
13
14
|
export * from './attribute-normalization.constant';
|
|
@@ -18,3 +19,4 @@ export * from './order-external-number.constant';
|
|
|
18
19
|
export * from './discount-rules-pricing-type-list.constant';
|
|
19
20
|
export * from './measure-unit-limits';
|
|
20
21
|
export * from './product-resolution.constant';
|
|
22
|
+
export * from './write-off-image.constant';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retention policy for write-off photos (FC-632): 90 days from the record's creation. After that a photo counts as
|
|
3
|
+
* unavailable — clients show «фото удалено», the export gives no link, archives skip it.
|
|
4
|
+
*
|
|
5
|
+
* This is a policy, not a storage check. The lifecycle rule on `write-offs/` deletes new photos around this time
|
|
6
|
+
* (with up to a day of lag), while older photos under `images/` are not deleted by it and may still be in the bucket.
|
|
7
|
+
*/
|
|
8
|
+
export const WRITE_OFF_IMAGE_RETENTION_DAYS = 90;
|
|
@@ -22,4 +22,7 @@ export enum NotificationTypeEnum {
|
|
|
22
22
|
PRE_ORDER_CREATED = 'PRE_ORDER_CREATED',
|
|
23
23
|
// Клиенту: рассылка сценария PRE_ORDER_COLLECTION_OPENED — открыт сбор предзаказов.
|
|
24
24
|
PRE_ORDER_COLLECTION_OPENED = 'PRE_ORDER_COLLECTION_OPENED',
|
|
25
|
+
// Админам: на витрине подана заявка с телефоном или email клиента, у которого нет учётной записи.
|
|
26
|
+
// Заявитель получает нейтральный ответ; привязывать заявку к клиенту автоматически нельзя — это захват аккаунта.
|
|
27
|
+
CLIENT_REGISTRATION_CONFLICT = 'CLIENT_REGISTRATION_CONFLICT',
|
|
25
28
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { PasswordSchema } from '../auth/password.schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { ClientTypeEnum } from '../../enum/client-type.enum';
|
|
4
|
+
import {
|
|
5
|
+
CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH,
|
|
6
|
+
CLIENT_REGISTRATION_EMAIL_MAX_LENGTH,
|
|
7
|
+
CLIENT_REGISTRATION_NAME_MAX_LENGTH,
|
|
8
|
+
CLIENT_REGISTRATION_PHONE_MAX_LENGTH,
|
|
9
|
+
} from '../../constant/client-registration.constant';
|
|
4
10
|
|
|
5
11
|
export const RegisterClientWebshopRequestSchema = z.object({
|
|
6
|
-
name: z.string(),
|
|
12
|
+
name: z.string().max(CLIENT_REGISTRATION_NAME_MAX_LENGTH),
|
|
7
13
|
password: PasswordSchema,
|
|
8
|
-
contactName: z.string().nullable(),
|
|
9
|
-
phone: z.string(),
|
|
10
|
-
email: z.email().toLowerCase(),
|
|
14
|
+
contactName: z.string().max(CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH).nullable(),
|
|
15
|
+
phone: z.string().max(CLIENT_REGISTRATION_PHONE_MAX_LENGTH),
|
|
16
|
+
email: z.email().max(CLIENT_REGISTRATION_EMAIL_MAX_LENGTH).toLowerCase(),
|
|
11
17
|
type: z.nativeEnum(ClientTypeEnum),
|
|
12
18
|
});
|
|
@@ -6,4 +6,8 @@ export const WriteOffImageSchema = z.object({
|
|
|
6
6
|
url: z.string(),
|
|
7
7
|
createdAt: z.date(),
|
|
8
8
|
deletedAt: z.date().nullable(),
|
|
9
|
+
// Retention policy (WRITE_OFF_IMAGE_RETENTION_DAYS), not a storage check: once expired, treat the photo as
|
|
10
|
+
// unavailable whether or not the file is still in the bucket. The record itself stays.
|
|
11
|
+
fileExpiresAt: z.date(),
|
|
12
|
+
isFileExpired: z.boolean(),
|
|
9
13
|
});
|