@floristcloud/api-lib 1.2.23 → 1.2.25
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/execute-moysklad-import.command.js +1 -0
- package/build/commands/integration/moysklad/scan-moysklad-import.query.js +4 -0
- package/build/constant/error.js +40 -0
- package/build/enum/index.js +2 -0
- package/build/enum/outbound-sync-intent.enum.js +9 -0
- package/build/enum/outbound-sync-status.enum.js +9 -0
- package/commands/integration/moysklad/execute-moysklad-import.command.ts +1 -0
- package/commands/integration/moysklad/scan-moysklad-import.query.ts +4 -0
- package/constant/error.ts +40 -0
- package/enum/index.ts +2 -0
- package/enum/outbound-sync-intent.enum.ts +5 -0
- package/enum/outbound-sync-status.enum.ts +5 -0
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ const ExecutableItemSchema = zod_1.z.object({
|
|
|
21
21
|
status: zod_1.z.enum(['new', 'known']),
|
|
22
22
|
internalUUID: zod_1.z.string().nullable(),
|
|
23
23
|
resolvedCategoryUUID: zod_1.z.string().nullable(),
|
|
24
|
+
resolvedImageUUID: zod_1.z.string().nullable(),
|
|
24
25
|
});
|
|
25
26
|
const ExecuteMoyskladImportRequestSchema = zod_1.z.object({
|
|
26
27
|
items: zod_1.z.array(ExecutableItemSchema),
|
|
@@ -6,6 +6,8 @@ const enum_1 = require("../../../enum");
|
|
|
6
6
|
const ScannedItemSchema = zod_1.z.object({
|
|
7
7
|
externalSourceId: zod_1.z.string(),
|
|
8
8
|
externalHref: zod_1.z.string(),
|
|
9
|
+
originalName: zod_1.z.string(),
|
|
10
|
+
normalizedName: zod_1.z.string(),
|
|
9
11
|
name: zod_1.z.string(),
|
|
10
12
|
article: zod_1.z.string().nullable(),
|
|
11
13
|
barcode: zod_1.z.string().nullable(),
|
|
@@ -23,6 +25,7 @@ const ScannedItemSchema = zod_1.z.object({
|
|
|
23
25
|
internalUUID: zod_1.z.string().nullable(),
|
|
24
26
|
resolvedCategoryUUID: zod_1.z.string().nullable(),
|
|
25
27
|
resolvedCategoryName: zod_1.z.string().nullable(),
|
|
28
|
+
resolvedImageUUID: zod_1.z.string().nullable(),
|
|
26
29
|
});
|
|
27
30
|
const CategoryMatchSchema = zod_1.z.object({
|
|
28
31
|
fcCategoryUUID: zod_1.z.string(),
|
|
@@ -50,6 +53,7 @@ const ScanMoyskladImportResponseSchema = zod_1.z.object({
|
|
|
50
53
|
withCountry: zod_1.z.number(),
|
|
51
54
|
withGrower: zod_1.z.number(),
|
|
52
55
|
withSize: zod_1.z.number(),
|
|
56
|
+
withImage: zod_1.z.number(),
|
|
53
57
|
}),
|
|
54
58
|
items: zod_1.z.array(ScannedItemSchema),
|
|
55
59
|
}),
|
package/build/constant/error.js
CHANGED
|
@@ -994,4 +994,44 @@ exports.ERRORS = {
|
|
|
994
994
|
message: 'MoySklad clients import is already in progress for this company',
|
|
995
995
|
httpCode: 409,
|
|
996
996
|
},
|
|
997
|
+
MOYSKLAD_CATALOG_TOO_LARGE: {
|
|
998
|
+
code: 'MS010',
|
|
999
|
+
message: 'MoySklad catalog exceeds the import size limit; archive unused items in MoySklad first',
|
|
1000
|
+
httpCode: 413,
|
|
1001
|
+
},
|
|
1002
|
+
MOYSKLAD_ORDER_CLIENT_NOT_LINKED: {
|
|
1003
|
+
code: 'MS011',
|
|
1004
|
+
message: 'Order client has no MoySklad link; import clients first',
|
|
1005
|
+
httpCode: 400,
|
|
1006
|
+
},
|
|
1007
|
+
MOYSKLAD_ORDER_PRODUCT_NOT_LINKED: {
|
|
1008
|
+
code: 'MS012',
|
|
1009
|
+
message: 'One or more order products have no MoySklad link',
|
|
1010
|
+
httpCode: 400,
|
|
1011
|
+
},
|
|
1012
|
+
MOYSKLAD_INTEGRATION_INCOMPLETE: {
|
|
1013
|
+
code: 'MS013',
|
|
1014
|
+
message: 'MoySklad integration is missing default organization or store',
|
|
1015
|
+
httpCode: 400,
|
|
1016
|
+
},
|
|
1017
|
+
MOYSKLAD_ORDER_LINK_MISSING: {
|
|
1018
|
+
code: 'MS014',
|
|
1019
|
+
message: 'No MoySklad link found for this order',
|
|
1020
|
+
httpCode: 404,
|
|
1021
|
+
},
|
|
1022
|
+
OUTBOUND_SYNC_STUCK_RECOVERED: {
|
|
1023
|
+
code: 'OS001',
|
|
1024
|
+
message: 'Outbound sync job recovered from stuck RUNNING state',
|
|
1025
|
+
httpCode: 500,
|
|
1026
|
+
},
|
|
1027
|
+
OUTBOUND_SYNC_UNEXPECTED_ERROR: {
|
|
1028
|
+
code: 'OS002',
|
|
1029
|
+
message: 'Outbound sync job failed with an unexpected error',
|
|
1030
|
+
httpCode: 500,
|
|
1031
|
+
},
|
|
1032
|
+
OUTBOUND_SYNC_UNSUPPORTED_ENTITY: {
|
|
1033
|
+
code: 'OS003',
|
|
1034
|
+
message: 'Outbound sync entity type is not supported by this provider',
|
|
1035
|
+
httpCode: 400,
|
|
1036
|
+
},
|
|
997
1037
|
};
|
package/build/enum/index.js
CHANGED
|
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./consignment-status.enum"), exports);
|
|
18
18
|
__exportStar(require("./integration-provider.enum"), exports);
|
|
19
19
|
__exportStar(require("./external-entity-type.enum"), exports);
|
|
20
|
+
__exportStar(require("./outbound-sync-intent.enum"), exports);
|
|
21
|
+
__exportStar(require("./outbound-sync-status.enum"), exports);
|
|
20
22
|
__exportStar(require("./order-type.enum"), exports);
|
|
21
23
|
__exportStar(require("./order-status.enum"), exports);
|
|
22
24
|
__exportStar(require("./order-restricted-status-list"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutboundSyncIntentEnum = void 0;
|
|
4
|
+
var OutboundSyncIntentEnum;
|
|
5
|
+
(function (OutboundSyncIntentEnum) {
|
|
6
|
+
OutboundSyncIntentEnum["CREATE"] = "CREATE";
|
|
7
|
+
OutboundSyncIntentEnum["UPDATE"] = "UPDATE";
|
|
8
|
+
OutboundSyncIntentEnum["DELETE"] = "DELETE";
|
|
9
|
+
})(OutboundSyncIntentEnum || (exports.OutboundSyncIntentEnum = OutboundSyncIntentEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutboundSyncStatusEnum = void 0;
|
|
4
|
+
var OutboundSyncStatusEnum;
|
|
5
|
+
(function (OutboundSyncStatusEnum) {
|
|
6
|
+
OutboundSyncStatusEnum["PENDING"] = "PENDING";
|
|
7
|
+
OutboundSyncStatusEnum["RUNNING"] = "RUNNING";
|
|
8
|
+
OutboundSyncStatusEnum["DEAD"] = "DEAD";
|
|
9
|
+
})(OutboundSyncStatusEnum || (exports.OutboundSyncStatusEnum = OutboundSyncStatusEnum = {}));
|
|
@@ -19,6 +19,7 @@ const ExecutableItemSchema = z.object({
|
|
|
19
19
|
status: z.enum(['new', 'known']),
|
|
20
20
|
internalUUID: z.string().nullable(),
|
|
21
21
|
resolvedCategoryUUID: z.string().nullable(),
|
|
22
|
+
resolvedImageUUID: z.string().nullable(),
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
const ExecuteMoyskladImportRequestSchema = z.object({
|
|
@@ -4,6 +4,8 @@ import { SalesUnitEnum } from '../../../enum';
|
|
|
4
4
|
const ScannedItemSchema = z.object({
|
|
5
5
|
externalSourceId: z.string(),
|
|
6
6
|
externalHref: z.string(),
|
|
7
|
+
originalName: z.string(),
|
|
8
|
+
normalizedName: z.string(),
|
|
7
9
|
name: z.string(),
|
|
8
10
|
article: z.string().nullable(),
|
|
9
11
|
barcode: z.string().nullable(),
|
|
@@ -21,6 +23,7 @@ const ScannedItemSchema = z.object({
|
|
|
21
23
|
internalUUID: z.string().nullable(),
|
|
22
24
|
resolvedCategoryUUID: z.string().nullable(),
|
|
23
25
|
resolvedCategoryName: z.string().nullable(),
|
|
26
|
+
resolvedImageUUID: z.string().nullable(),
|
|
24
27
|
});
|
|
25
28
|
|
|
26
29
|
const CategoryMatchSchema = z.object({
|
|
@@ -50,6 +53,7 @@ const ScanMoyskladImportResponseSchema = z.object({
|
|
|
50
53
|
withCountry: z.number(),
|
|
51
54
|
withGrower: z.number(),
|
|
52
55
|
withSize: z.number(),
|
|
56
|
+
withImage: z.number(),
|
|
53
57
|
}),
|
|
54
58
|
items: z.array(ScannedItemSchema),
|
|
55
59
|
}),
|
package/constant/error.ts
CHANGED
|
@@ -1054,4 +1054,44 @@ export const ERRORS = {
|
|
|
1054
1054
|
message: 'MoySklad clients import is already in progress for this company',
|
|
1055
1055
|
httpCode: 409,
|
|
1056
1056
|
},
|
|
1057
|
+
MOYSKLAD_CATALOG_TOO_LARGE: {
|
|
1058
|
+
code: 'MS010',
|
|
1059
|
+
message: 'MoySklad catalog exceeds the import size limit; archive unused items in MoySklad first',
|
|
1060
|
+
httpCode: 413,
|
|
1061
|
+
},
|
|
1062
|
+
MOYSKLAD_ORDER_CLIENT_NOT_LINKED: {
|
|
1063
|
+
code: 'MS011',
|
|
1064
|
+
message: 'Order client has no MoySklad link; import clients first',
|
|
1065
|
+
httpCode: 400,
|
|
1066
|
+
},
|
|
1067
|
+
MOYSKLAD_ORDER_PRODUCT_NOT_LINKED: {
|
|
1068
|
+
code: 'MS012',
|
|
1069
|
+
message: 'One or more order products have no MoySklad link',
|
|
1070
|
+
httpCode: 400,
|
|
1071
|
+
},
|
|
1072
|
+
MOYSKLAD_INTEGRATION_INCOMPLETE: {
|
|
1073
|
+
code: 'MS013',
|
|
1074
|
+
message: 'MoySklad integration is missing default organization or store',
|
|
1075
|
+
httpCode: 400,
|
|
1076
|
+
},
|
|
1077
|
+
MOYSKLAD_ORDER_LINK_MISSING: {
|
|
1078
|
+
code: 'MS014',
|
|
1079
|
+
message: 'No MoySklad link found for this order',
|
|
1080
|
+
httpCode: 404,
|
|
1081
|
+
},
|
|
1082
|
+
OUTBOUND_SYNC_STUCK_RECOVERED: {
|
|
1083
|
+
code: 'OS001',
|
|
1084
|
+
message: 'Outbound sync job recovered from stuck RUNNING state',
|
|
1085
|
+
httpCode: 500,
|
|
1086
|
+
},
|
|
1087
|
+
OUTBOUND_SYNC_UNEXPECTED_ERROR: {
|
|
1088
|
+
code: 'OS002',
|
|
1089
|
+
message: 'Outbound sync job failed with an unexpected error',
|
|
1090
|
+
httpCode: 500,
|
|
1091
|
+
},
|
|
1092
|
+
OUTBOUND_SYNC_UNSUPPORTED_ENTITY: {
|
|
1093
|
+
code: 'OS003',
|
|
1094
|
+
message: 'Outbound sync entity type is not supported by this provider',
|
|
1095
|
+
httpCode: 400,
|
|
1096
|
+
},
|
|
1057
1097
|
} as const;
|
package/enum/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './consignment-status.enum';
|
|
2
2
|
export * from './integration-provider.enum';
|
|
3
3
|
export * from './external-entity-type.enum';
|
|
4
|
+
export * from './outbound-sync-intent.enum';
|
|
5
|
+
export * from './outbound-sync-status.enum';
|
|
4
6
|
export * from './order-type.enum';
|
|
5
7
|
export * from './order-status.enum';
|
|
6
8
|
export * from './order-restricted-status-list';
|