@floristcloud/api-lib 1.0.57 → 1.0.60
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/integration/index.js +1 -0
- package/build/commands/integration/telegram-staff/generate-telegram-staff-link.command.js +17 -0
- package/build/commands/integration/telegram-staff/get-telegram-staff-link-status.command.js +19 -0
- package/build/commands/integration/telegram-staff/index.js +19 -0
- package/build/commands/integration/telegram-staff/unlink-telegram-staff.command.js +16 -0
- package/build/enum/notification-channel.enum.js +1 -0
- package/build/enum/notification-type.enum.js +1 -0
- package/build/schemas/settings/settings.schema.js +3 -0
- package/commands/integration/index.ts +1 -0
- package/commands/integration/telegram-staff/generate-telegram-staff-link.command.ts +16 -0
- package/commands/integration/telegram-staff/get-telegram-staff-link-status.command.ts +18 -0
- package/commands/integration/telegram-staff/index.ts +3 -0
- package/commands/integration/telegram-staff/unlink-telegram-staff.command.ts +15 -0
- package/enum/notification-channel.enum.ts +1 -0
- package/enum/notification-type.enum.ts +1 -0
- package/package.json +1 -1
- package/schemas/settings/settings.schema.ts +3 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateTelegramStaffLinkContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const GenerateTelegramStaffLinkResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
link: zod_1.z.string(),
|
|
10
|
+
code: zod_1.z.string(),
|
|
11
|
+
})
|
|
12
|
+
.nullable(),
|
|
13
|
+
});
|
|
14
|
+
var GenerateTelegramStaffLinkContractCommand;
|
|
15
|
+
(function (GenerateTelegramStaffLinkContractCommand) {
|
|
16
|
+
GenerateTelegramStaffLinkContractCommand.ResponseSchema = GenerateTelegramStaffLinkResponseSchema;
|
|
17
|
+
})(GenerateTelegramStaffLinkContractCommand || (exports.GenerateTelegramStaffLinkContractCommand = GenerateTelegramStaffLinkContractCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetTelegramStaffLinkStatusContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const GetTelegramStaffLinkStatusResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
isLinked: zod_1.z.boolean(),
|
|
10
|
+
username: zod_1.z.string().nullable(),
|
|
11
|
+
firstName: zod_1.z.string().nullable(),
|
|
12
|
+
lastName: zod_1.z.string().nullable(),
|
|
13
|
+
})
|
|
14
|
+
.nullable(),
|
|
15
|
+
});
|
|
16
|
+
var GetTelegramStaffLinkStatusContractCommand;
|
|
17
|
+
(function (GetTelegramStaffLinkStatusContractCommand) {
|
|
18
|
+
GetTelegramStaffLinkStatusContractCommand.ResponseSchema = GetTelegramStaffLinkStatusResponseSchema;
|
|
19
|
+
})(GetTelegramStaffLinkStatusContractCommand || (exports.GetTelegramStaffLinkStatusContractCommand = GetTelegramStaffLinkStatusContractCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./generate-telegram-staff-link.command"), exports);
|
|
18
|
+
__exportStar(require("./get-telegram-staff-link-status.command"), exports);
|
|
19
|
+
__exportStar(require("./unlink-telegram-staff.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnlinkTelegramStaffContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const UnlinkTelegramStaffResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
success: zod_1.z.boolean(),
|
|
10
|
+
})
|
|
11
|
+
.nullable(),
|
|
12
|
+
});
|
|
13
|
+
var UnlinkTelegramStaffContractCommand;
|
|
14
|
+
(function (UnlinkTelegramStaffContractCommand) {
|
|
15
|
+
UnlinkTelegramStaffContractCommand.ResponseSchema = UnlinkTelegramStaffResponseSchema;
|
|
16
|
+
})(UnlinkTelegramStaffContractCommand || (exports.UnlinkTelegramStaffContractCommand = UnlinkTelegramStaffContractCommand = {}));
|
|
@@ -10,5 +10,6 @@ var NotificationChannelEnum;
|
|
|
10
10
|
NotificationChannelEnum["MAX"] = "MAX";
|
|
11
11
|
NotificationChannelEnum["EMAIL"] = "EMAIL";
|
|
12
12
|
NotificationChannelEnum["TELEGRAM_BOT"] = "TELEGRAM_BOT";
|
|
13
|
+
NotificationChannelEnum["TELEGRAM_STAFF_BOT"] = "TELEGRAM_STAFF_BOT";
|
|
13
14
|
NotificationChannelEnum["SYSTEM"] = "SYSTEM";
|
|
14
15
|
})(NotificationChannelEnum || (exports.NotificationChannelEnum = NotificationChannelEnum = {}));
|
|
@@ -8,4 +8,5 @@ var NotificationTypeEnum;
|
|
|
8
8
|
NotificationTypeEnum["ORDER_INVOICE"] = "ORDER_INVOICE";
|
|
9
9
|
NotificationTypeEnum["CART_EXPIRATION"] = "CART_EXPIRATION";
|
|
10
10
|
NotificationTypeEnum["WRITE_OFF_REJECTED"] = "WRITE_OFF_REJECTED";
|
|
11
|
+
NotificationTypeEnum["CLIENT_MESSAGE_TO_EMPLOYEE"] = "CLIENT_MESSAGE_TO_EMPLOYEE";
|
|
11
12
|
})(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
|
|
@@ -76,6 +76,7 @@ exports.SettingsSchema = zod_1.z.object({
|
|
|
76
76
|
loginImageKeyList: zod_1.z.array(zod_1.z.string()),
|
|
77
77
|
chatHasManagerMode: zod_1.z.nativeEnum(enum_1.ChatHasManagerModeEnum),
|
|
78
78
|
chatNoManagerMode: zod_1.z.nativeEnum(enum_1.ChatNoManagerModeEnum),
|
|
79
|
+
isMessengerEnabled: zod_1.z.boolean(),
|
|
79
80
|
importantMessage: exports.ImportantMessageSchema.nullable(),
|
|
80
81
|
});
|
|
81
82
|
exports.SettingsForAdminSchema = exports.SettingsSchema.extend({
|
|
@@ -146,6 +147,7 @@ exports.CreateSettingsSchema = zod_1.z.object({
|
|
|
146
147
|
deliveryPolicy: zod_1.z.string().nullable().optional(),
|
|
147
148
|
writeOffPolicy: zod_1.z.string().nullable().optional(),
|
|
148
149
|
disableOrders: zod_1.z.boolean().optional(),
|
|
150
|
+
isMessengerEnabled: zod_1.z.coerce.boolean().optional(),
|
|
149
151
|
loginImageKeyList: zod_1.z.array(zod_1.z.string()).optional(),
|
|
150
152
|
chatHasManagerMode: zod_1.z.nativeEnum(enum_1.ChatHasManagerModeEnum).default(enum_1.ChatHasManagerModeEnum.ALL_RW),
|
|
151
153
|
chatNoManagerMode: zod_1.z.nativeEnum(enum_1.ChatNoManagerModeEnum).default(enum_1.ChatNoManagerModeEnum.ANY_MANAGER),
|
|
@@ -198,6 +200,7 @@ exports.UpdateSettingsRequestSchema = zod_1.z.object({
|
|
|
198
200
|
deliveryPolicy: zod_1.z.string().nullable().optional(),
|
|
199
201
|
writeOffPolicy: zod_1.z.string().nullable().optional(),
|
|
200
202
|
disableOrders: zod_1.z.boolean().optional(),
|
|
203
|
+
isMessengerEnabled: zod_1.z.coerce.boolean().optional(),
|
|
201
204
|
bankHookEnabled: zod_1.z.coerce.boolean().optional(),
|
|
202
205
|
bankHookToken: zod_1.z.string().nullable().optional(),
|
|
203
206
|
loginImageKeyList: zod_1.z.array(zod_1.z.string()).optional(),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const GenerateTelegramStaffLinkResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z
|
|
6
|
+
.object({
|
|
7
|
+
link: z.string(),
|
|
8
|
+
code: z.string(),
|
|
9
|
+
})
|
|
10
|
+
.nullable(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export namespace GenerateTelegramStaffLinkContractCommand {
|
|
14
|
+
export const ResponseSchema = GenerateTelegramStaffLinkResponseSchema;
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const GetTelegramStaffLinkStatusResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z
|
|
6
|
+
.object({
|
|
7
|
+
isLinked: z.boolean(),
|
|
8
|
+
username: z.string().nullable(),
|
|
9
|
+
firstName: z.string().nullable(),
|
|
10
|
+
lastName: z.string().nullable(),
|
|
11
|
+
})
|
|
12
|
+
.nullable(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export namespace GetTelegramStaffLinkStatusContractCommand {
|
|
16
|
+
export const ResponseSchema = GetTelegramStaffLinkStatusResponseSchema;
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const UnlinkTelegramStaffResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z
|
|
6
|
+
.object({
|
|
7
|
+
success: z.boolean(),
|
|
8
|
+
})
|
|
9
|
+
.nullable(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export namespace UnlinkTelegramStaffContractCommand {
|
|
13
|
+
export const ResponseSchema = UnlinkTelegramStaffResponseSchema;
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -76,6 +76,7 @@ export const SettingsSchema = z.object({
|
|
|
76
76
|
loginImageKeyList: z.array(z.string()),
|
|
77
77
|
chatHasManagerMode: z.nativeEnum(ChatHasManagerModeEnum),
|
|
78
78
|
chatNoManagerMode: z.nativeEnum(ChatNoManagerModeEnum),
|
|
79
|
+
isMessengerEnabled: z.boolean(),
|
|
79
80
|
importantMessage: ImportantMessageSchema.nullable(),
|
|
80
81
|
});
|
|
81
82
|
|
|
@@ -150,6 +151,7 @@ export const CreateSettingsSchema = z.object({
|
|
|
150
151
|
deliveryPolicy: z.string().nullable().optional(),
|
|
151
152
|
writeOffPolicy: z.string().nullable().optional(),
|
|
152
153
|
disableOrders: z.boolean().optional(),
|
|
154
|
+
isMessengerEnabled: z.coerce.boolean().optional(),
|
|
153
155
|
loginImageKeyList: z.array(z.string()).optional(),
|
|
154
156
|
chatHasManagerMode: z.nativeEnum(ChatHasManagerModeEnum).default(ChatHasManagerModeEnum.ALL_RW),
|
|
155
157
|
chatNoManagerMode: z.nativeEnum(ChatNoManagerModeEnum).default(ChatNoManagerModeEnum.ANY_MANAGER),
|
|
@@ -205,6 +207,7 @@ export const UpdateSettingsRequestSchema = z.object({
|
|
|
205
207
|
deliveryPolicy: z.string().nullable().optional(),
|
|
206
208
|
writeOffPolicy: z.string().nullable().optional(),
|
|
207
209
|
disableOrders: z.boolean().optional(),
|
|
210
|
+
isMessengerEnabled: z.coerce.boolean().optional(),
|
|
208
211
|
bankHookEnabled: z.coerce.boolean().optional(),
|
|
209
212
|
bankHookToken: z.string().nullable().optional(),
|
|
210
213
|
loginImageKeyList: z.array(z.string()).optional(),
|