@floristcloud/api-lib 1.2.198 → 1.2.200
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/commands/client-push/analyze-client-push-campaign.query.js +10 -0
- package/build/commands/client-push/execute-client-push-campaign.command.js +10 -0
- package/build/commands/client-push/get-client-push-campaign-list.query.js +10 -0
- package/build/commands/client-push/index.js +20 -0
- package/build/commands/client-push/send-client-order-push.command.js +10 -0
- package/build/commands/index.js +2 -0
- package/build/commands/integration/one-c/get-one-c-orders-sync-status.query.js +10 -0
- package/build/commands/integration/one-c/index.js +2 -0
- package/build/commands/integration/one-c/retry-one-c-order-deletion.command.js +8 -0
- package/build/commands/staff-push/create-staff-push-pairing.command.js +8 -0
- package/build/commands/staff-push/get-staff-device-list.query.js +8 -0
- package/build/commands/staff-push/index.js +22 -0
- package/build/commands/staff-push/pair-staff-device.command.js +10 -0
- package/build/commands/staff-push/refresh-staff-device.command.js +10 -0
- package/build/commands/staff-push/remove-staff-device.command.js +8 -0
- package/build/commands/staff-push/unpair-staff-device.command.js +10 -0
- package/build/constant/error.js +18 -0
- package/build/enum/client-catalog-push-template.enum.js +10 -0
- package/build/enum/client-order-push-type-list.js +6 -0
- package/build/enum/client-push-campaign-status.enum.js +10 -0
- package/build/enum/device-token-audience.enum.js +9 -0
- package/build/enum/index.js +4 -0
- package/build/enum/notification-type.enum.js +6 -0
- package/build/schemas/client-push/analyze-client-push-campaign-request.schema.js +10 -0
- package/build/schemas/client-push/analyze-client-push-campaign-response.schema.js +8 -0
- package/build/schemas/client-push/client-order-push-result.schema.js +7 -0
- package/build/schemas/client-push/client-order-push-type.schema.js +6 -0
- package/build/schemas/client-push/client-push-campaign-analysis.schema.js +13 -0
- package/build/schemas/client-push/client-push-campaign-client-list-target.schema.js +10 -0
- package/build/schemas/client-push/client-push-campaign-group-target.schema.js +9 -0
- package/build/schemas/client-push/client-push-campaign-max-recipients.constant.js +5 -0
- package/build/schemas/client-push/client-push-campaign-stats.schema.js +11 -0
- package/build/schemas/client-push/client-push-campaign-target.schema.js +8 -0
- package/build/schemas/client-push/client-push-campaign.schema.js +19 -0
- package/build/schemas/client-push/execute-client-push-campaign-request.schema.js +9 -0
- package/build/schemas/client-push/execute-client-push-campaign-response.schema.js +8 -0
- package/build/schemas/client-push/get-client-push-campaign-list-request.schema.js +7 -0
- package/build/schemas/client-push/get-client-push-campaign-list-response.schema.js +8 -0
- package/build/schemas/client-push/index.js +33 -0
- package/build/schemas/client-push/send-client-order-push-request.schema.js +9 -0
- package/build/schemas/client-push/send-client-order-push-response.schema.js +8 -0
- package/build/schemas/index.js +2 -0
- package/build/schemas/integration/one-c/get-one-c-orders-sync-status-request.schema.js +7 -0
- package/build/schemas/integration/one-c/get-one-c-orders-sync-status-response.schema.js +11 -0
- package/build/schemas/integration/one-c/index.js +4 -0
- package/build/schemas/integration/one-c/one-c-order-exchange-state.schema.js +8 -0
- package/build/schemas/integration/one-c/one-c-order-sync-status.schema.js +11 -0
- package/build/schemas/integration/one-c/retry-one-c-order-deletion-response.schema.js +10 -0
- package/build/schemas/staff-push/create-staff-push-pairing-response.schema.js +8 -0
- package/build/schemas/staff-push/get-staff-device-list-response.schema.js +8 -0
- package/build/schemas/staff-push/index.js +28 -0
- package/build/schemas/staff-push/pair-staff-device-request.schema.js +12 -0
- package/build/schemas/staff-push/pair-staff-device-response.schema.js +8 -0
- package/build/schemas/staff-push/refresh-staff-device-request.schema.js +12 -0
- package/build/schemas/staff-push/staff-device-pairing.schema.js +11 -0
- package/build/schemas/staff-push/staff-device.schema.js +12 -0
- package/build/schemas/staff-push/staff-push-pairing-code.schema.js +10 -0
- package/build/schemas/staff-push/staff-push-pairing-secret.schema.js +5 -0
- package/build/schemas/staff-push/staff-push-pairing.schema.js +11 -0
- package/build/schemas/staff-push/staff-push-success-response.schema.js +8 -0
- package/build/schemas/staff-push/unpair-staff-device-request.schema.js +9 -0
- package/commands/client-push/analyze-client-push-campaign.query.ts +11 -0
- package/commands/client-push/execute-client-push-campaign.command.ts +11 -0
- package/commands/client-push/get-client-push-campaign-list.query.ts +11 -0
- package/commands/client-push/index.ts +4 -0
- package/commands/client-push/send-client-order-push.command.ts +11 -0
- package/commands/index.ts +2 -0
- package/commands/integration/one-c/get-one-c-orders-sync-status.query.ts +11 -0
- package/commands/integration/one-c/index.ts +2 -0
- package/commands/integration/one-c/retry-one-c-order-deletion.command.ts +7 -0
- package/commands/staff-push/create-staff-push-pairing.command.ts +7 -0
- package/commands/staff-push/get-staff-device-list.query.ts +7 -0
- package/commands/staff-push/index.ts +6 -0
- package/commands/staff-push/pair-staff-device.command.ts +11 -0
- package/commands/staff-push/refresh-staff-device.command.ts +11 -0
- package/commands/staff-push/remove-staff-device.command.ts +7 -0
- package/commands/staff-push/unpair-staff-device.command.ts +11 -0
- package/constant/error.ts +20 -0
- package/enum/client-catalog-push-template.enum.ts +6 -0
- package/enum/client-order-push-type-list.ts +4 -0
- package/enum/client-push-campaign-status.enum.ts +6 -0
- package/enum/device-token-audience.enum.ts +5 -0
- package/enum/index.ts +4 -0
- package/enum/notification-type.enum.ts +6 -0
- package/package.json +1 -1
- package/schemas/client-push/analyze-client-push-campaign-request.schema.ts +8 -0
- package/schemas/client-push/analyze-client-push-campaign-response.schema.ts +6 -0
- package/schemas/client-push/client-order-push-result.schema.ts +5 -0
- package/schemas/client-push/client-order-push-type.schema.ts +4 -0
- package/schemas/client-push/client-push-campaign-analysis.schema.ts +11 -0
- package/schemas/client-push/client-push-campaign-client-list-target.schema.ts +8 -0
- package/schemas/client-push/client-push-campaign-group-target.schema.ts +7 -0
- package/schemas/client-push/client-push-campaign-max-recipients.constant.ts +2 -0
- package/schemas/client-push/client-push-campaign-stats.schema.ts +9 -0
- package/schemas/client-push/client-push-campaign-target.schema.ts +6 -0
- package/schemas/client-push/client-push-campaign.schema.ts +17 -0
- package/schemas/client-push/execute-client-push-campaign-request.schema.ts +7 -0
- package/schemas/client-push/execute-client-push-campaign-response.schema.ts +6 -0
- package/schemas/client-push/get-client-push-campaign-list-request.schema.ts +5 -0
- package/schemas/client-push/get-client-push-campaign-list-response.schema.ts +6 -0
- package/schemas/client-push/index.ts +17 -0
- package/schemas/client-push/send-client-order-push-request.schema.ts +7 -0
- package/schemas/client-push/send-client-order-push-response.schema.ts +6 -0
- package/schemas/index.ts +2 -0
- package/schemas/integration/one-c/get-one-c-orders-sync-status-request.schema.ts +5 -0
- package/schemas/integration/one-c/get-one-c-orders-sync-status-response.schema.ts +9 -0
- package/schemas/integration/one-c/index.ts +4 -0
- package/schemas/integration/one-c/one-c-order-exchange-state.schema.ts +8 -0
- package/schemas/integration/one-c/one-c-order-sync-status.schema.ts +9 -0
- package/schemas/integration/one-c/retry-one-c-order-deletion-response.schema.ts +8 -0
- package/schemas/staff-push/create-staff-push-pairing-response.schema.ts +6 -0
- package/schemas/staff-push/get-staff-device-list-response.schema.ts +6 -0
- package/schemas/staff-push/index.ts +12 -0
- package/schemas/staff-push/pair-staff-device-request.schema.ts +10 -0
- package/schemas/staff-push/pair-staff-device-response.schema.ts +6 -0
- package/schemas/staff-push/refresh-staff-device-request.schema.ts +10 -0
- package/schemas/staff-push/staff-device-pairing.schema.ts +9 -0
- package/schemas/staff-push/staff-device.schema.ts +10 -0
- package/schemas/staff-push/staff-push-pairing-code.schema.ts +8 -0
- package/schemas/staff-push/staff-push-pairing-secret.schema.ts +3 -0
- package/schemas/staff-push/staff-push-pairing.schema.ts +9 -0
- package/schemas/staff-push/staff-push-success-response.schema.ts +6 -0
- package/schemas/staff-push/unpair-staff-device-request.schema.ts +7 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryOneCOrderDeletionResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.RetryOneCOrderDeletionResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
success: zod_1.z.boolean(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateStaffPushPairingResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const staff_push_pairing_schema_1 = require("./staff-push-pairing.schema");
|
|
6
|
+
exports.CreateStaffPushPairingResponseSchema = zod_1.z.object({
|
|
7
|
+
data: staff_push_pairing_schema_1.StaffPushPairingSchema,
|
|
8
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetStaffDeviceListResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const staff_device_schema_1 = require("./staff-device.schema");
|
|
6
|
+
exports.GetStaffDeviceListResponseSchema = zod_1.z.object({
|
|
7
|
+
data: zod_1.z.array(staff_device_schema_1.StaffDeviceSchema),
|
|
8
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./staff-push-pairing.schema"), exports);
|
|
18
|
+
__exportStar(require("./create-staff-push-pairing-response.schema"), exports);
|
|
19
|
+
__exportStar(require("./staff-push-pairing-code.schema"), exports);
|
|
20
|
+
__exportStar(require("./staff-push-pairing-secret.schema"), exports);
|
|
21
|
+
__exportStar(require("./pair-staff-device-request.schema"), exports);
|
|
22
|
+
__exportStar(require("./staff-device-pairing.schema"), exports);
|
|
23
|
+
__exportStar(require("./pair-staff-device-response.schema"), exports);
|
|
24
|
+
__exportStar(require("./refresh-staff-device-request.schema"), exports);
|
|
25
|
+
__exportStar(require("./unpair-staff-device-request.schema"), exports);
|
|
26
|
+
__exportStar(require("./staff-device.schema"), exports);
|
|
27
|
+
__exportStar(require("./get-staff-device-list-response.schema"), exports);
|
|
28
|
+
__exportStar(require("./staff-push-success-response.schema"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PairStaffDeviceRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const device_platform_enum_1 = require("../../enum/device-platform.enum");
|
|
6
|
+
const staff_push_pairing_code_schema_1 = require("./staff-push-pairing-code.schema");
|
|
7
|
+
exports.PairStaffDeviceRequestSchema = zod_1.z.object({
|
|
8
|
+
pairingCode: staff_push_pairing_code_schema_1.StaffPushPairingCodeSchema,
|
|
9
|
+
token: zod_1.z.string().min(1),
|
|
10
|
+
platform: zod_1.z.nativeEnum(device_platform_enum_1.DevicePlatformEnum),
|
|
11
|
+
deviceId: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PairStaffDeviceResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const staff_device_pairing_schema_1 = require("./staff-device-pairing.schema");
|
|
6
|
+
exports.PairStaffDeviceResponseSchema = zod_1.z.object({
|
|
7
|
+
data: staff_device_pairing_schema_1.StaffDevicePairingSchema,
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefreshStaffDeviceRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const device_platform_enum_1 = require("../../enum/device-platform.enum");
|
|
6
|
+
const staff_push_pairing_secret_schema_1 = require("./staff-push-pairing-secret.schema");
|
|
7
|
+
exports.RefreshStaffDeviceRequestSchema = zod_1.z.object({
|
|
8
|
+
companyUUID: zod_1.z.string().uuid(),
|
|
9
|
+
pairingSecret: staff_push_pairing_secret_schema_1.StaffPushPairingSecretSchema,
|
|
10
|
+
token: zod_1.z.string().min(1),
|
|
11
|
+
platform: zod_1.z.nativeEnum(device_platform_enum_1.DevicePlatformEnum),
|
|
12
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaffDevicePairingSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// Что приложение хранит после подключения: секрет для обновления токена и отключения без сессии.
|
|
6
|
+
exports.StaffDevicePairingSchema = zod_1.z.object({
|
|
7
|
+
pairingSecret: zod_1.z.string(),
|
|
8
|
+
companyUUID: zod_1.z.string().uuid(),
|
|
9
|
+
userName: zod_1.z.string(),
|
|
10
|
+
companyName: zod_1.z.string(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaffDeviceSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const device_platform_enum_1 = require("../../enum/device-platform.enum");
|
|
6
|
+
// Подключённый телефон сотрудника в панели. updatedAt — последнее подключение или смена токена.
|
|
7
|
+
exports.StaffDeviceSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
platform: zod_1.z.nativeEnum(device_platform_enum_1.DevicePlatformEnum),
|
|
10
|
+
createdAt: zod_1.z.coerce.date(),
|
|
11
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaffPushPairingCodeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// Код из панели: регистр и пробелы, введённые на телефоне, не важны.
|
|
6
|
+
exports.StaffPushPairingCodeSchema = zod_1.z
|
|
7
|
+
.string()
|
|
8
|
+
.trim()
|
|
9
|
+
.transform(value => value.replace(/[\s-]/g, '').toUpperCase())
|
|
10
|
+
.pipe(zod_1.z.string().length(8));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaffPushPairingSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// Одноразовый код подключения телефона сотрудника; pairingLink открывает приложение (QR кодирует его же).
|
|
6
|
+
// Префикс pairing в именах полей — аудит-лог маскирует значения по имени ключа.
|
|
7
|
+
exports.StaffPushPairingSchema = zod_1.z.object({
|
|
8
|
+
pairingCode: zod_1.z.string(),
|
|
9
|
+
pairingLink: zod_1.z.string(),
|
|
10
|
+
expiresAt: zod_1.z.coerce.date(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaffPushSuccessResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const delete_data_response_schema_1 = require("../delete-data-response.schema");
|
|
6
|
+
exports.StaffPushSuccessResponseSchema = zod_1.z.object({
|
|
7
|
+
data: delete_data_response_schema_1.DeleteDataResponseSchema,
|
|
8
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnpairStaffDeviceRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const staff_push_pairing_secret_schema_1 = require("./staff-push-pairing-secret.schema");
|
|
6
|
+
exports.UnpairStaffDeviceRequestSchema = zod_1.z.object({
|
|
7
|
+
companyUUID: zod_1.z.string().uuid(),
|
|
8
|
+
pairingSecret: staff_push_pairing_secret_schema_1.StaffPushPairingSecretSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { AnalyzeClientPushCampaignRequestSchema } from '../../schemas/client-push/analyze-client-push-campaign-request.schema';
|
|
3
|
+
import { AnalyzeClientPushCampaignResponseSchema } from '../../schemas/client-push/analyze-client-push-campaign-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace AnalyzeClientPushCampaignContractQuery {
|
|
6
|
+
export const RequestSchema = AnalyzeClientPushCampaignRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = AnalyzeClientPushCampaignResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { ExecuteClientPushCampaignRequestSchema } from '../../schemas/client-push/execute-client-push-campaign-request.schema';
|
|
3
|
+
import { ExecuteClientPushCampaignResponseSchema } from '../../schemas/client-push/execute-client-push-campaign-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace ExecuteClientPushCampaignContractCommand {
|
|
6
|
+
export const RequestSchema = ExecuteClientPushCampaignRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ExecuteClientPushCampaignResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetClientPushCampaignListRequestSchema } from '../../schemas/client-push/get-client-push-campaign-list-request.schema';
|
|
3
|
+
import { GetClientPushCampaignListResponseSchema } from '../../schemas/client-push/get-client-push-campaign-list-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace GetClientPushCampaignListContractQuery {
|
|
6
|
+
export const RequestSchema = GetClientPushCampaignListRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = GetClientPushCampaignListResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { SendClientOrderPushRequestSchema } from '../../schemas/client-push/send-client-order-push-request.schema';
|
|
3
|
+
import { SendClientOrderPushResponseSchema } from '../../schemas/client-push/send-client-order-push-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace SendClientOrderPushContractCommand {
|
|
6
|
+
export const RequestSchema = SendClientOrderPushRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = SendClientOrderPushResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
package/commands/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export * from './pre-order-collection';
|
|
|
35
35
|
export * from './pre-order-collection-item';
|
|
36
36
|
export * from './pre-order-product';
|
|
37
37
|
export * from './product';
|
|
38
|
+
export * from './staff-push';
|
|
39
|
+
export * from './client-push';
|
|
38
40
|
export * from './product-configuration/create-product-configuration.command';
|
|
39
41
|
export * from './product-configuration/delete-product-configuration.command';
|
|
40
42
|
export * from './product-configuration/find-product-configuration-by-attributes.query';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetOneCOrdersSyncStatusRequestSchema } from '../../../schemas/integration/one-c/get-one-c-orders-sync-status-request.schema';
|
|
3
|
+
import { GetOneCOrdersSyncStatusResponseSchema } from '../../../schemas/integration/one-c/get-one-c-orders-sync-status-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace GetOneCOrdersSyncStatusContractQuery {
|
|
6
|
+
export const RequestSchema = GetOneCOrdersSyncStatusRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = GetOneCOrdersSyncStatusResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -3,6 +3,8 @@ export * from './rotate-one-c-password.command';
|
|
|
3
3
|
export * from './disconnect-one-c.command';
|
|
4
4
|
export * from './get-one-c-status.query';
|
|
5
5
|
export * from './get-one-c-order-exchange-state.query';
|
|
6
|
+
export * from './get-one-c-orders-sync-status.query';
|
|
7
|
+
export * from './retry-one-c-order-deletion.command';
|
|
6
8
|
export * from './get-one-c-stock-conflict-list.query';
|
|
7
9
|
export * from './get-one-c-stock-conflict-preview.query';
|
|
8
10
|
export * from './resolve-one-c-stock-conflict.command';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { RetryOneCOrderDeletionResponseSchema } from '../../../schemas/integration/one-c/retry-one-c-order-deletion-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace RetryOneCOrderDeletionContractCommand {
|
|
5
|
+
export const ResponseSchema = RetryOneCOrderDeletionResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { CreateStaffPushPairingResponseSchema } from '../../schemas/staff-push/create-staff-push-pairing-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace CreateStaffPushPairingContractCommand {
|
|
5
|
+
export const ResponseSchema = CreateStaffPushPairingResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetStaffDeviceListResponseSchema } from '../../schemas/staff-push/get-staff-device-list-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetStaffDeviceListContractQuery {
|
|
5
|
+
export const ResponseSchema = GetStaffDeviceListResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './create-staff-push-pairing.command';
|
|
2
|
+
export * from './pair-staff-device.command';
|
|
3
|
+
export * from './refresh-staff-device.command';
|
|
4
|
+
export * from './unpair-staff-device.command';
|
|
5
|
+
export * from './get-staff-device-list.query';
|
|
6
|
+
export * from './remove-staff-device.command';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { PairStaffDeviceRequestSchema } from '../../schemas/staff-push/pair-staff-device-request.schema';
|
|
3
|
+
import { PairStaffDeviceResponseSchema } from '../../schemas/staff-push/pair-staff-device-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace PairStaffDeviceContractCommand {
|
|
6
|
+
export const RequestSchema = PairStaffDeviceRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = PairStaffDeviceResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { RefreshStaffDeviceRequestSchema } from '../../schemas/staff-push/refresh-staff-device-request.schema';
|
|
3
|
+
import { StaffPushSuccessResponseSchema } from '../../schemas/staff-push/staff-push-success-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace RefreshStaffDeviceContractCommand {
|
|
6
|
+
export const RequestSchema = RefreshStaffDeviceRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = StaffPushSuccessResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { StaffPushSuccessResponseSchema } from '../../schemas/staff-push/staff-push-success-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace RemoveStaffDeviceContractCommand {
|
|
5
|
+
export const ResponseSchema = StaffPushSuccessResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { UnpairStaffDeviceRequestSchema } from '../../schemas/staff-push/unpair-staff-device-request.schema';
|
|
3
|
+
import { StaffPushSuccessResponseSchema } from '../../schemas/staff-push/staff-push-success-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace UnpairStaffDeviceContractCommand {
|
|
6
|
+
export const RequestSchema = UnpairStaffDeviceRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = StaffPushSuccessResponseSchema;
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
package/constant/error.ts
CHANGED
|
@@ -1697,6 +1697,24 @@ export const ERRORS = {
|
|
|
1697
1697
|
PUSH_NOTIFICATION_SEND_FAILED: { code: 'PN001', message: 'Failed to send push notification', httpCode: 500 },
|
|
1698
1698
|
PUSH_NOTIFICATION_NO_DEVICES: { code: 'PN002', message: 'No active devices found for user', httpCode: 404 },
|
|
1699
1699
|
|
|
1700
|
+
// STAFF PUSH (телефон сотрудника, подключённый кодом из панели)
|
|
1701
|
+
STAFF_PUSH_PAIRING_NOT_CREATED: { code: 'SPP001', message: 'Failed to create pairing code', httpCode: 500 },
|
|
1702
|
+
STAFF_PUSH_PAIRING_CODE_INVALID: { code: 'SPP002', message: 'Pairing code is invalid or expired', httpCode: 400 },
|
|
1703
|
+
STAFF_PUSH_PAIRING_FORBIDDEN: { code: 'SPP003', message: 'User cannot receive staff notifications', httpCode: 403 },
|
|
1704
|
+
STAFF_PUSH_DEVICE_NOT_PAIRED: { code: 'SPP004', message: 'Failed to pair staff device', httpCode: 500 },
|
|
1705
|
+
STAFF_PUSH_RATE_LIMIT_EXCEEDED: { code: 'SPP005', message: 'Too many pairing attempts', httpCode: 429 },
|
|
1706
|
+
STAFF_PUSH_DEVICE_LIST_NOT_FETCHED: { code: 'SPP006', message: 'Failed to get staff devices', httpCode: 500 },
|
|
1707
|
+
|
|
1708
|
+
// CLIENT PUSH (пуш клиенту по заказу и рассылка из каталога)
|
|
1709
|
+
CLIENT_PUSH_NOT_SENT: { code: 'CPN001', message: 'Failed to send push to client', httpCode: 500 },
|
|
1710
|
+
CLIENT_PUSH_CLIENT_HAS_NO_APP: { code: 'CPN002', message: 'Client has no mobile app connected', httpCode: 409 },
|
|
1711
|
+
CLIENT_PUSH_CAMPAIGN_NOT_ANALYZED: { code: 'CPC001', message: 'Failed to analyze client push campaign', httpCode: 500 },
|
|
1712
|
+
CLIENT_PUSH_CAMPAIGN_NOT_CREATED: { code: 'CPC002', message: 'Failed to create client push campaign', httpCode: 500 },
|
|
1713
|
+
CLIENT_PUSH_CAMPAIGN_NO_RECIPIENTS: { code: 'CPC003', message: 'No selected clients can receive the push now', httpCode: 400 },
|
|
1714
|
+
CLIENT_PUSH_CAMPAIGN_LIST_NOT_FETCHED: { code: 'CPC004', message: 'Failed to get client push campaigns', httpCode: 500 },
|
|
1715
|
+
CLIENT_PUSH_CAMPAIGN_TOO_MANY_RECIPIENTS: { code: 'CPC005', message: 'Too many clients selected for one campaign', httpCode: 400 },
|
|
1716
|
+
CLIENT_PUSH_CAMPAIGN_BUSY: { code: 'CPC006', message: 'Another campaign of the company is being started, try again', httpCode: 409 },
|
|
1717
|
+
|
|
1700
1718
|
// ACCOUNT DELETION REQUEST
|
|
1701
1719
|
ACCOUNT_DELETION_REQUEST_NOT_CREATED: { code: 'ADR001', message: 'Failed to create account deletion request', httpCode: 500 },
|
|
1702
1720
|
ACCOUNT_DELETION_REQUEST_NOT_FOUND: { code: 'ADR002', message: 'Account deletion request not found', httpCode: 404 },
|
|
@@ -1877,6 +1895,8 @@ export const ERRORS = {
|
|
|
1877
1895
|
},
|
|
1878
1896
|
ONE_C_ORDER_APPLY_EMPTY: { code: 'OC031', message: '1C order contains no lines', httpCode: 422 },
|
|
1879
1897
|
ONE_C_ORDER_APPLY_MIXED_PRICES: { code: 'OC032', message: '1C order contains one product at different prices', httpCode: 422 },
|
|
1898
|
+
ONE_C_ORDER_MANAGED_BY_ONE_C: { code: 'OC033', message: 'The order is managed by 1C and cannot be changed', httpCode: 409 },
|
|
1899
|
+
ONE_C_ORDER_DELETION_NOT_REQUESTED: { code: 'OC034', message: 'The order has no deletion request from 1C', httpCode: 409 },
|
|
1880
1900
|
|
|
1881
1901
|
// COMPANY INTEGRATION (общая запись интеграции компании)
|
|
1882
1902
|
COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NotificationTypeEnum } from './notification-type.enum';
|
|
2
|
+
|
|
3
|
+
// Типы пуша, которые сотрудник отправляет клиенту по конкретному заказу из панели.
|
|
4
|
+
export const ClientOrderPushTypeList = [NotificationTypeEnum.ORDER_STATUS, NotificationTypeEnum.ORDER_CREATED] as const;
|
package/enum/index.ts
CHANGED
|
@@ -9,6 +9,9 @@ export * from './category-status.enum';
|
|
|
9
9
|
export * from './chat-has-manager-mode.enum';
|
|
10
10
|
export * from './chat-no-manager-mode.enum';
|
|
11
11
|
export * from './client-contract-status.enum';
|
|
12
|
+
export * from './client-catalog-push-template.enum';
|
|
13
|
+
export * from './client-push-campaign-status.enum';
|
|
14
|
+
export * from './client-order-push-type-list';
|
|
12
15
|
export * from './client-import-entity-property.enum';
|
|
13
16
|
export * from './client-import-errors.enum';
|
|
14
17
|
export * from './client-legal-type.enum';
|
|
@@ -37,6 +40,7 @@ export * from './country-code.enum';
|
|
|
37
40
|
export * from './deleted-by-company-policy.enum';
|
|
38
41
|
export * from './delivery-route-status.enum';
|
|
39
42
|
export * from './device-platform.enum';
|
|
43
|
+
export * from './device-token-audience.enum';
|
|
40
44
|
export * from './discount-price-routing.enum';
|
|
41
45
|
export * from './discount-rules-apply-type.enum';
|
|
42
46
|
export * from './discount-rules-mode-type.enum';
|
|
@@ -12,4 +12,10 @@ export enum NotificationTypeEnum {
|
|
|
12
12
|
ACCOUNT_DELETION_REQUEST_REJECTED = 'ACCOUNT_DELETION_REQUEST_REJECTED',
|
|
13
13
|
// Админам: подтверждён конфликт «остаток 1С меньше резерва FC» или его рост (FC-560).
|
|
14
14
|
ONE_C_STOCK_CONFLICT = 'ONE_C_STOCK_CONFLICT',
|
|
15
|
+
// Сотруднику, ответственному за клиента: клиент оформил заказ в витрине или приложении.
|
|
16
|
+
CLIENT_ORDER_PLACED = 'CLIENT_ORDER_PLACED',
|
|
17
|
+
// Клиенту: сотрудник создал для него заказ.
|
|
18
|
+
ORDER_CREATED = 'ORDER_CREATED',
|
|
19
|
+
// Клиенту: рассылка из каталога по шаблону ClientCatalogPushTemplateEnum.
|
|
20
|
+
CATALOG_UPDATED = 'CATALOG_UPDATED',
|
|
15
21
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientCatalogPushTemplateEnum } from '../../enum/client-catalog-push-template.enum';
|
|
3
|
+
import { ClientPushCampaignTargetSchema } from './client-push-campaign-target.schema';
|
|
4
|
+
|
|
5
|
+
export const AnalyzeClientPushCampaignRequestSchema = z.object({
|
|
6
|
+
template: z.nativeEnum(ClientCatalogPushTemplateEnum),
|
|
7
|
+
target: ClientPushCampaignTargetSchema,
|
|
8
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Охват до отправки: total — выбранные клиенты, recipients — получат пуш, withoutApp — без приложения,
|
|
4
|
+
// recentlyNotified — с приложением, но рассылка уже приходила им в течение часа (повторно не отправляется).
|
|
5
|
+
export const ClientPushCampaignAnalysisSchema = z.object({
|
|
6
|
+
total: z.number().int(),
|
|
7
|
+
recipients: z.number().int(),
|
|
8
|
+
withoutApp: z.number().int(),
|
|
9
|
+
recentlyNotified: z.number().int(),
|
|
10
|
+
maxRecipients: z.number().int(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CLIENT_PUSH_CAMPAIGN_MAX_RECIPIENTS } from './client-push-campaign-max-recipients.constant';
|
|
3
|
+
|
|
4
|
+
export const ClientPushCampaignClientListTargetSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
clientUUIDList: z.array(z.string().uuid()).min(1).max(CLIENT_PUSH_CAMPAIGN_MAX_RECIPIENTS),
|
|
7
|
+
})
|
|
8
|
+
.strict();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Итоги рассылки: pending — ещё в очереди, delivered — пуш принят FCM хотя бы на одно устройство клиента,
|
|
4
|
+
// failed — не ушёл (устройство отключено или FCM отказал).
|
|
5
|
+
export const ClientPushCampaignStatsSchema = z.object({
|
|
6
|
+
pending: z.number().int(),
|
|
7
|
+
delivered: z.number().int(),
|
|
8
|
+
failed: z.number().int(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientPushCampaignGroupTargetSchema } from './client-push-campaign-group-target.schema';
|
|
3
|
+
import { ClientPushCampaignClientListTargetSchema } from './client-push-campaign-client-list-target.schema';
|
|
4
|
+
|
|
5
|
+
// Получатели рассылки: группа клиентов или конкретные клиенты — ровно одно из двух.
|
|
6
|
+
export const ClientPushCampaignTargetSchema = z.union([ClientPushCampaignGroupTargetSchema, ClientPushCampaignClientListTargetSchema]);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientCatalogPushTemplateEnum } from '../../enum/client-catalog-push-template.enum';
|
|
3
|
+
import { ClientPushCampaignStatusEnum } from '../../enum/client-push-campaign-status.enum';
|
|
4
|
+
import { ClientPushCampaignStatsSchema } from './client-push-campaign-stats.schema';
|
|
5
|
+
|
|
6
|
+
// Списка клиентов в ответе нет: он большой и шире того, что видит сотрудник с ограничением по клиентам.
|
|
7
|
+
// targetGroup — группа клиентов; null — рассылка по выбранному списку.
|
|
8
|
+
export const ClientPushCampaignSchema = z.object({
|
|
9
|
+
uuid: z.string().uuid(),
|
|
10
|
+
template: z.nativeEnum(ClientCatalogPushTemplateEnum),
|
|
11
|
+
targetGroup: z.string().nullable(),
|
|
12
|
+
recipientCount: z.number().int(),
|
|
13
|
+
status: z.nativeEnum(ClientPushCampaignStatusEnum),
|
|
14
|
+
createdByUserUUID: z.string().uuid(),
|
|
15
|
+
createdAt: z.coerce.date(),
|
|
16
|
+
stats: ClientPushCampaignStatsSchema,
|
|
17
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AnalyzeClientPushCampaignRequestSchema } from './analyze-client-push-campaign-request.schema';
|
|
3
|
+
|
|
4
|
+
// requestId — ключ идемпотентности от панели: повторное нажатие возвращает ту же рассылку.
|
|
5
|
+
export const ExecuteClientPushCampaignRequestSchema = AnalyzeClientPushCampaignRequestSchema.extend({
|
|
6
|
+
requestId: z.string().uuid(),
|
|
7
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './client-order-push-type.schema';
|
|
2
|
+
export * from './send-client-order-push-request.schema';
|
|
3
|
+
export * from './client-order-push-result.schema';
|
|
4
|
+
export * from './send-client-order-push-response.schema';
|
|
5
|
+
export * from './client-push-campaign-max-recipients.constant';
|
|
6
|
+
export * from './client-push-campaign-group-target.schema';
|
|
7
|
+
export * from './client-push-campaign-client-list-target.schema';
|
|
8
|
+
export * from './client-push-campaign-target.schema';
|
|
9
|
+
export * from './analyze-client-push-campaign-request.schema';
|
|
10
|
+
export * from './client-push-campaign-analysis.schema';
|
|
11
|
+
export * from './analyze-client-push-campaign-response.schema';
|
|
12
|
+
export * from './execute-client-push-campaign-request.schema';
|
|
13
|
+
export * from './client-push-campaign-stats.schema';
|
|
14
|
+
export * from './client-push-campaign.schema';
|
|
15
|
+
export * from './execute-client-push-campaign-response.schema';
|
|
16
|
+
export * from './get-client-push-campaign-list-request.schema';
|
|
17
|
+
export * from './get-client-push-campaign-list-response.schema';
|