@floristcloud/api-lib 1.2.38 → 1.2.39
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/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
|
@@ -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',
|
|
@@ -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',
|