@floristcloud/api-lib 1.2.38 → 1.2.40
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/moysklad/get-moysklad-status.query.js +8 -0
- package/build/commands/integration/moysklad/index.js +1 -0
- package/build/commands/integration/moysklad/retry-moysklad-order-sync.command.js +15 -0
- package/build/constant/error.js +10 -0
- package/build/schemas/settings/settings.schema.js +9 -0
- package/commands/integration/moysklad/get-moysklad-status.query.ts +8 -0
- package/commands/integration/moysklad/index.ts +1 -0
- package/commands/integration/moysklad/retry-moysklad-order-sync.command.ts +14 -0
- package/constant/error.ts +10 -0
- package/package.json +1 -1
- package/schemas/settings/settings.schema.ts +9 -0
|
@@ -25,6 +25,14 @@ const GetMoyskladStatusResponseSchema = zod_1.z.object({
|
|
|
25
25
|
errorMessage: zod_1.z.string(),
|
|
26
26
|
})
|
|
27
27
|
.nullable(),
|
|
28
|
+
hasAdminToken: zod_1.z.boolean(),
|
|
29
|
+
quickRefreshStatus: zod_1.z.enum(['PENDING', 'RUNNING', 'DEAD', 'IDLE']),
|
|
30
|
+
quickRefreshDeadInfo: zod_1.z
|
|
31
|
+
.object({
|
|
32
|
+
errorCode: zod_1.z.string(),
|
|
33
|
+
errorMessage: zod_1.z.string(),
|
|
34
|
+
})
|
|
35
|
+
.nullable(),
|
|
28
36
|
orderStateMapping: order_state_mapping_schema_1.MoyskladOrderStateMappingSchema,
|
|
29
37
|
}),
|
|
30
38
|
});
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./execute-moysklad-clients-import.command"), exports);
|
|
|
27
27
|
__exportStar(require("./get-order-sync-status.query"), exports);
|
|
28
28
|
__exportStar(require("./get-orders-batch-sync-status.query"), exports);
|
|
29
29
|
__exportStar(require("./sync-moysklad-stock.command"), exports);
|
|
30
|
+
__exportStar(require("./retry-moysklad-order-sync.command"), exports);
|
|
30
31
|
__exportStar(require("./get-moysklad-order-states.query"), exports);
|
|
31
32
|
__exportStar(require("./update-moysklad-order-state-mapping.command"), exports);
|
|
32
33
|
__exportStar(require("./order-state-mapping.schema"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryMoyskladOrderSyncContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const RetryMoyskladOrderSyncResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
jobUUID: zod_1.z.string().uuid(),
|
|
9
|
+
status: zod_1.z.literal('PENDING'),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
var RetryMoyskladOrderSyncContractCommand;
|
|
13
|
+
(function (RetryMoyskladOrderSyncContractCommand) {
|
|
14
|
+
RetryMoyskladOrderSyncContractCommand.ResponseSchema = RetryMoyskladOrderSyncResponseSchema;
|
|
15
|
+
})(RetryMoyskladOrderSyncContractCommand || (exports.RetryMoyskladOrderSyncContractCommand = RetryMoyskladOrderSyncContractCommand = {}));
|
package/build/constant/error.js
CHANGED
|
@@ -1045,6 +1045,16 @@ exports.ERRORS = {
|
|
|
1045
1045
|
message: 'Outbound sync entity type is not supported by this provider',
|
|
1046
1046
|
httpCode: 400,
|
|
1047
1047
|
},
|
|
1048
|
+
OUTBOUND_SYNC_DEAD_JOB_NOT_FOUND: {
|
|
1049
|
+
code: 'OS004',
|
|
1050
|
+
message: 'No DEAD sync job found for this entity',
|
|
1051
|
+
httpCode: 404,
|
|
1052
|
+
},
|
|
1053
|
+
OUTBOUND_SYNC_JOB_NOT_DEAD: {
|
|
1054
|
+
code: 'OS005',
|
|
1055
|
+
message: 'Latest sync job for this entity is not DEAD; cannot retry',
|
|
1056
|
+
httpCode: 409,
|
|
1057
|
+
},
|
|
1048
1058
|
MOYSKLAD_STOCK_SYNC_CAP_EXCEEDED: {
|
|
1049
1059
|
code: 'MS015',
|
|
1050
1060
|
message: 'MoySklad stock-sync concurrency cap exceeded; will retry shortly',
|
|
@@ -77,6 +77,9 @@ exports.SettingsSchema = zod_1.z.object({
|
|
|
77
77
|
chatHasManagerMode: zod_1.z.nativeEnum(enum_1.ChatHasManagerModeEnum),
|
|
78
78
|
chatNoManagerMode: zod_1.z.nativeEnum(enum_1.ChatNoManagerModeEnum),
|
|
79
79
|
isMessengerEnabled: zod_1.z.boolean(),
|
|
80
|
+
isWriteOffAcceptanceEnabled: zod_1.z.boolean(),
|
|
81
|
+
isInvoiceDownloadEnabled: zod_1.z.boolean(),
|
|
82
|
+
isBalanceVisible: zod_1.z.boolean(),
|
|
80
83
|
importantMessage: exports.ImportantMessageSchema.nullable(),
|
|
81
84
|
telegramStaffBotName: zod_1.z.string().nullable().optional(),
|
|
82
85
|
});
|
|
@@ -149,6 +152,9 @@ exports.CreateSettingsSchema = zod_1.z.object({
|
|
|
149
152
|
writeOffPolicy: zod_1.z.string().nullable().optional(),
|
|
150
153
|
disableOrders: zod_1.z.boolean().optional(),
|
|
151
154
|
isMessengerEnabled: zod_1.z.coerce.boolean().optional(),
|
|
155
|
+
isWriteOffAcceptanceEnabled: zod_1.z.coerce.boolean().optional(),
|
|
156
|
+
isInvoiceDownloadEnabled: zod_1.z.coerce.boolean().optional(),
|
|
157
|
+
isBalanceVisible: zod_1.z.coerce.boolean().optional(),
|
|
152
158
|
loginImageKeyList: zod_1.z.array(zod_1.z.string()).optional(),
|
|
153
159
|
chatHasManagerMode: zod_1.z.nativeEnum(enum_1.ChatHasManagerModeEnum).default(enum_1.ChatHasManagerModeEnum.ALL_RW),
|
|
154
160
|
chatNoManagerMode: zod_1.z.nativeEnum(enum_1.ChatNoManagerModeEnum).default(enum_1.ChatNoManagerModeEnum.ANY_MANAGER),
|
|
@@ -202,6 +208,9 @@ exports.UpdateSettingsRequestSchema = zod_1.z.object({
|
|
|
202
208
|
writeOffPolicy: zod_1.z.string().nullable().optional(),
|
|
203
209
|
disableOrders: zod_1.z.boolean().optional(),
|
|
204
210
|
isMessengerEnabled: zod_1.z.coerce.boolean().optional(),
|
|
211
|
+
isWriteOffAcceptanceEnabled: zod_1.z.coerce.boolean().optional(),
|
|
212
|
+
isInvoiceDownloadEnabled: zod_1.z.coerce.boolean().optional(),
|
|
213
|
+
isBalanceVisible: zod_1.z.coerce.boolean().optional(),
|
|
205
214
|
bankHookEnabled: zod_1.z.coerce.boolean().optional(),
|
|
206
215
|
bankHookToken: zod_1.z.string().nullable().optional(),
|
|
207
216
|
loginImageKeyList: zod_1.z.array(zod_1.z.string()).optional(),
|
|
@@ -23,6 +23,14 @@ const GetMoyskladStatusResponseSchema = z.object({
|
|
|
23
23
|
errorMessage: z.string(),
|
|
24
24
|
})
|
|
25
25
|
.nullable(),
|
|
26
|
+
hasAdminToken: z.boolean(),
|
|
27
|
+
quickRefreshStatus: z.enum(['PENDING', 'RUNNING', 'DEAD', 'IDLE']),
|
|
28
|
+
quickRefreshDeadInfo: z
|
|
29
|
+
.object({
|
|
30
|
+
errorCode: z.string(),
|
|
31
|
+
errorMessage: z.string(),
|
|
32
|
+
})
|
|
33
|
+
.nullable(),
|
|
26
34
|
orderStateMapping: MoyskladOrderStateMappingSchema,
|
|
27
35
|
}),
|
|
28
36
|
});
|
|
@@ -11,6 +11,7 @@ export * from './execute-moysklad-clients-import.command';
|
|
|
11
11
|
export * from './get-order-sync-status.query';
|
|
12
12
|
export * from './get-orders-batch-sync-status.query';
|
|
13
13
|
export * from './sync-moysklad-stock.command';
|
|
14
|
+
export * from './retry-moysklad-order-sync.command';
|
|
14
15
|
export * from './get-moysklad-order-states.query';
|
|
15
16
|
export * from './update-moysklad-order-state-mapping.command';
|
|
16
17
|
export * from './order-state-mapping.schema';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const RetryMoyskladOrderSyncResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
jobUUID: z.string().uuid(),
|
|
7
|
+
status: z.literal('PENDING'),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace RetryMoyskladOrderSyncContractCommand {
|
|
12
|
+
export const ResponseSchema = RetryMoyskladOrderSyncResponseSchema;
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
package/constant/error.ts
CHANGED
|
@@ -1105,6 +1105,16 @@ export const ERRORS = {
|
|
|
1105
1105
|
message: 'Outbound sync entity type is not supported by this provider',
|
|
1106
1106
|
httpCode: 400,
|
|
1107
1107
|
},
|
|
1108
|
+
OUTBOUND_SYNC_DEAD_JOB_NOT_FOUND: {
|
|
1109
|
+
code: 'OS004',
|
|
1110
|
+
message: 'No DEAD sync job found for this entity',
|
|
1111
|
+
httpCode: 404,
|
|
1112
|
+
},
|
|
1113
|
+
OUTBOUND_SYNC_JOB_NOT_DEAD: {
|
|
1114
|
+
code: 'OS005',
|
|
1115
|
+
message: 'Latest sync job for this entity is not DEAD; cannot retry',
|
|
1116
|
+
httpCode: 409,
|
|
1117
|
+
},
|
|
1108
1118
|
MOYSKLAD_STOCK_SYNC_CAP_EXCEEDED: {
|
|
1109
1119
|
code: 'MS015',
|
|
1110
1120
|
message: 'MoySklad stock-sync concurrency cap exceeded; will retry shortly',
|
package/package.json
CHANGED
|
@@ -77,6 +77,9 @@ export const SettingsSchema = z.object({
|
|
|
77
77
|
chatHasManagerMode: z.nativeEnum(ChatHasManagerModeEnum),
|
|
78
78
|
chatNoManagerMode: z.nativeEnum(ChatNoManagerModeEnum),
|
|
79
79
|
isMessengerEnabled: z.boolean(),
|
|
80
|
+
isWriteOffAcceptanceEnabled: z.boolean(),
|
|
81
|
+
isInvoiceDownloadEnabled: z.boolean(),
|
|
82
|
+
isBalanceVisible: z.boolean(),
|
|
80
83
|
importantMessage: ImportantMessageSchema.nullable(),
|
|
81
84
|
telegramStaffBotName: z.string().nullable().optional(),
|
|
82
85
|
});
|
|
@@ -153,6 +156,9 @@ export const CreateSettingsSchema = z.object({
|
|
|
153
156
|
writeOffPolicy: z.string().nullable().optional(),
|
|
154
157
|
disableOrders: z.boolean().optional(),
|
|
155
158
|
isMessengerEnabled: z.coerce.boolean().optional(),
|
|
159
|
+
isWriteOffAcceptanceEnabled: z.coerce.boolean().optional(),
|
|
160
|
+
isInvoiceDownloadEnabled: z.coerce.boolean().optional(),
|
|
161
|
+
isBalanceVisible: z.coerce.boolean().optional(),
|
|
156
162
|
loginImageKeyList: z.array(z.string()).optional(),
|
|
157
163
|
chatHasManagerMode: z.nativeEnum(ChatHasManagerModeEnum).default(ChatHasManagerModeEnum.ALL_RW),
|
|
158
164
|
chatNoManagerMode: z.nativeEnum(ChatNoManagerModeEnum).default(ChatNoManagerModeEnum.ANY_MANAGER),
|
|
@@ -209,6 +215,9 @@ export const UpdateSettingsRequestSchema = z.object({
|
|
|
209
215
|
writeOffPolicy: z.string().nullable().optional(),
|
|
210
216
|
disableOrders: z.boolean().optional(),
|
|
211
217
|
isMessengerEnabled: z.coerce.boolean().optional(),
|
|
218
|
+
isWriteOffAcceptanceEnabled: z.coerce.boolean().optional(),
|
|
219
|
+
isInvoiceDownloadEnabled: z.coerce.boolean().optional(),
|
|
220
|
+
isBalanceVisible: z.coerce.boolean().optional(),
|
|
212
221
|
bankHookEnabled: z.coerce.boolean().optional(),
|
|
213
222
|
bankHookToken: z.string().nullable().optional(),
|
|
214
223
|
loginImageKeyList: z.array(z.string()).optional(),
|