@floristcloud/api-lib 1.2.199 → 1.2.201
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/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/constant/error.js +7 -0
- package/build/enum/outbound-sync-intent.enum.js +1 -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/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/constant/error.ts +7 -0
- package/enum/outbound-sync-intent.enum.ts +1 -0
- package/package.json +1 -1
- 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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOneCOrdersSyncStatusContractQuery = void 0;
|
|
4
|
+
const get_one_c_orders_sync_status_request_schema_1 = require("../../../schemas/integration/one-c/get-one-c-orders-sync-status-request.schema");
|
|
5
|
+
const get_one_c_orders_sync_status_response_schema_1 = require("../../../schemas/integration/one-c/get-one-c-orders-sync-status-response.schema");
|
|
6
|
+
var GetOneCOrdersSyncStatusContractQuery;
|
|
7
|
+
(function (GetOneCOrdersSyncStatusContractQuery) {
|
|
8
|
+
GetOneCOrdersSyncStatusContractQuery.RequestSchema = get_one_c_orders_sync_status_request_schema_1.GetOneCOrdersSyncStatusRequestSchema;
|
|
9
|
+
GetOneCOrdersSyncStatusContractQuery.ResponseSchema = get_one_c_orders_sync_status_response_schema_1.GetOneCOrdersSyncStatusResponseSchema;
|
|
10
|
+
})(GetOneCOrdersSyncStatusContractQuery || (exports.GetOneCOrdersSyncStatusContractQuery = GetOneCOrdersSyncStatusContractQuery = {}));
|
|
@@ -19,6 +19,8 @@ __exportStar(require("./rotate-one-c-password.command"), exports);
|
|
|
19
19
|
__exportStar(require("./disconnect-one-c.command"), exports);
|
|
20
20
|
__exportStar(require("./get-one-c-status.query"), exports);
|
|
21
21
|
__exportStar(require("./get-one-c-order-exchange-state.query"), exports);
|
|
22
|
+
__exportStar(require("./get-one-c-orders-sync-status.query"), exports);
|
|
23
|
+
__exportStar(require("./retry-one-c-order-deletion.command"), exports);
|
|
22
24
|
__exportStar(require("./get-one-c-stock-conflict-list.query"), exports);
|
|
23
25
|
__exportStar(require("./get-one-c-stock-conflict-preview.query"), exports);
|
|
24
26
|
__exportStar(require("./resolve-one-c-stock-conflict.command"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryOneCOrderDeletionContractCommand = void 0;
|
|
4
|
+
const retry_one_c_order_deletion_response_schema_1 = require("../../../schemas/integration/one-c/retry-one-c-order-deletion-response.schema");
|
|
5
|
+
var RetryOneCOrderDeletionContractCommand;
|
|
6
|
+
(function (RetryOneCOrderDeletionContractCommand) {
|
|
7
|
+
RetryOneCOrderDeletionContractCommand.ResponseSchema = retry_one_c_order_deletion_response_schema_1.RetryOneCOrderDeletionResponseSchema;
|
|
8
|
+
})(RetryOneCOrderDeletionContractCommand || (exports.RetryOneCOrderDeletionContractCommand = RetryOneCOrderDeletionContractCommand = {}));
|
package/build/constant/error.js
CHANGED
|
@@ -1772,6 +1772,11 @@ exports.ERRORS = {
|
|
|
1772
1772
|
message: 'Another order is being created in MoySklad for this account; will retry shortly',
|
|
1773
1773
|
httpCode: 409,
|
|
1774
1774
|
},
|
|
1775
|
+
MOYSKLAD_DEMAND_WAITING_ORDER_PUSH: {
|
|
1776
|
+
code: 'MS023',
|
|
1777
|
+
message: 'The demand is waiting for the order to be pushed to MoySklad; will retry shortly',
|
|
1778
|
+
httpCode: 409,
|
|
1779
|
+
},
|
|
1775
1780
|
// 1C COMMERCEML INTEGRATION
|
|
1776
1781
|
ONE_C_NOT_CONNECTED: { code: 'OC001', message: '1C integration is not connected for this company', httpCode: 404 },
|
|
1777
1782
|
ONE_C_CONNECT_FAILED: { code: 'OC002', message: 'Failed to connect 1C integration', httpCode: 500 },
|
|
@@ -1823,6 +1828,8 @@ exports.ERRORS = {
|
|
|
1823
1828
|
},
|
|
1824
1829
|
ONE_C_ORDER_APPLY_EMPTY: { code: 'OC031', message: '1C order contains no lines', httpCode: 422 },
|
|
1825
1830
|
ONE_C_ORDER_APPLY_MIXED_PRICES: { code: 'OC032', message: '1C order contains one product at different prices', httpCode: 422 },
|
|
1831
|
+
ONE_C_ORDER_MANAGED_BY_ONE_C: { code: 'OC033', message: 'The order is managed by 1C and cannot be changed', httpCode: 409 },
|
|
1832
|
+
ONE_C_ORDER_DELETION_NOT_REQUESTED: { code: 'OC034', message: 'The order has no deletion request from 1C', httpCode: 409 },
|
|
1826
1833
|
// COMPANY INTEGRATION (общая запись интеграции компании)
|
|
1827
1834
|
COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
|
|
1828
1835
|
COMPANY_INTEGRATION_NOT_SAVED: { code: 'CINT002', message: 'Failed to save company integration', httpCode: 500 },
|
|
@@ -6,4 +6,5 @@ var OutboundSyncIntentEnum;
|
|
|
6
6
|
OutboundSyncIntentEnum["CREATE"] = "CREATE";
|
|
7
7
|
OutboundSyncIntentEnum["UPDATE"] = "UPDATE";
|
|
8
8
|
OutboundSyncIntentEnum["DELETE"] = "DELETE";
|
|
9
|
+
OutboundSyncIntentEnum["CREATE_DEMAND"] = "CREATE_DEMAND";
|
|
9
10
|
})(OutboundSyncIntentEnum || (exports.OutboundSyncIntentEnum = OutboundSyncIntentEnum = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOneCOrdersSyncStatusRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.GetOneCOrdersSyncStatusRequestSchema = zod_1.z.object({
|
|
6
|
+
orderUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(200),
|
|
7
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOneCOrdersSyncStatusResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const one_c_order_sync_status_schema_1 = require("./one-c-order-sync-status.schema");
|
|
6
|
+
exports.GetOneCOrdersSyncStatusResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: zod_1.z.object({
|
|
9
|
+
statuses: zod_1.z.array(one_c_order_sync_status_schema_1.OneCOrderSyncStatusSchema),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
@@ -32,3 +32,7 @@ __exportStar(require("./update-one-c-settings-request.schema"), exports);
|
|
|
32
32
|
__exportStar(require("./update-one-c-settings-response.schema"), exports);
|
|
33
33
|
__exportStar(require("./one-c-order-exchange-state.schema"), exports);
|
|
34
34
|
__exportStar(require("./get-one-c-order-exchange-state-response.schema"), exports);
|
|
35
|
+
__exportStar(require("./get-one-c-orders-sync-status-request.schema"), exports);
|
|
36
|
+
__exportStar(require("./get-one-c-orders-sync-status-response.schema"), exports);
|
|
37
|
+
__exportStar(require("./one-c-order-sync-status.schema"), exports);
|
|
38
|
+
__exportStar(require("./retry-one-c-order-deletion-response.schema"), exports);
|
|
@@ -32,4 +32,12 @@ exports.OneCOrderExchangeStateSchema = zod_1.z.object({
|
|
|
32
32
|
// Последнее применение состава из 1С не прошло (режим ONE_C): код ошибки и когда.
|
|
33
33
|
applyErrorCode: zod_1.z.string().nullable(),
|
|
34
34
|
applyErrorAt: zod_1.z.string().datetime().nullable(),
|
|
35
|
+
// 1С ведёт заказ и отправка подтверждена: заказ в FC не редактируется.
|
|
36
|
+
isEditLocked: zod_1.z.boolean(),
|
|
37
|
+
// Документ снят в 1С (пометка удаления или отмена), заказ ждёт удаления в FC.
|
|
38
|
+
deletionRequestedAt: zod_1.z.string().datetime().nullable(),
|
|
39
|
+
// Удаление не прошло: код причины и номер счёта или УПД, если причина в них.
|
|
40
|
+
deletionErrorCode: zod_1.z.string().nullable(),
|
|
41
|
+
deletionErrorDetail: zod_1.z.string().nullable(),
|
|
42
|
+
deletionErrorAt: zod_1.z.string().datetime().nullable(),
|
|
35
43
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OneCOrderSyncStatusSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// Заказ с ошибкой синхронизации с 1С: удаление по сигналу из 1С не прошло.
|
|
6
|
+
exports.OneCOrderSyncStatusSchema = zod_1.z.object({
|
|
7
|
+
orderUUID: zod_1.z.string().uuid(),
|
|
8
|
+
deletionErrorCode: zod_1.z.string(),
|
|
9
|
+
// Номер счёта или УПД, если причина в них.
|
|
10
|
+
deletionErrorDetail: zod_1.z.string().nullable(),
|
|
11
|
+
});
|
|
@@ -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,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
|
+
}
|
package/constant/error.ts
CHANGED
|
@@ -1843,6 +1843,11 @@ export const ERRORS = {
|
|
|
1843
1843
|
message: 'Another order is being created in MoySklad for this account; will retry shortly',
|
|
1844
1844
|
httpCode: 409,
|
|
1845
1845
|
},
|
|
1846
|
+
MOYSKLAD_DEMAND_WAITING_ORDER_PUSH: {
|
|
1847
|
+
code: 'MS023',
|
|
1848
|
+
message: 'The demand is waiting for the order to be pushed to MoySklad; will retry shortly',
|
|
1849
|
+
httpCode: 409,
|
|
1850
|
+
},
|
|
1846
1851
|
|
|
1847
1852
|
// 1C COMMERCEML INTEGRATION
|
|
1848
1853
|
ONE_C_NOT_CONNECTED: { code: 'OC001', message: '1C integration is not connected for this company', httpCode: 404 },
|
|
@@ -1895,6 +1900,8 @@ export const ERRORS = {
|
|
|
1895
1900
|
},
|
|
1896
1901
|
ONE_C_ORDER_APPLY_EMPTY: { code: 'OC031', message: '1C order contains no lines', httpCode: 422 },
|
|
1897
1902
|
ONE_C_ORDER_APPLY_MIXED_PRICES: { code: 'OC032', message: '1C order contains one product at different prices', httpCode: 422 },
|
|
1903
|
+
ONE_C_ORDER_MANAGED_BY_ONE_C: { code: 'OC033', message: 'The order is managed by 1C and cannot be changed', httpCode: 409 },
|
|
1904
|
+
ONE_C_ORDER_DELETION_NOT_REQUESTED: { code: 'OC034', message: 'The order has no deletion request from 1C', httpCode: 409 },
|
|
1898
1905
|
|
|
1899
1906
|
// COMPANY INTEGRATION (общая запись интеграции компании)
|
|
1900
1907
|
COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { OneCOrderSyncStatusSchema } from './one-c-order-sync-status.schema';
|
|
3
|
+
|
|
4
|
+
export const GetOneCOrdersSyncStatusResponseSchema = z.object({
|
|
5
|
+
message: z.string().optional(),
|
|
6
|
+
data: z.object({
|
|
7
|
+
statuses: z.array(OneCOrderSyncStatusSchema),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
@@ -16,3 +16,7 @@ export * from './update-one-c-settings-request.schema';
|
|
|
16
16
|
export * from './update-one-c-settings-response.schema';
|
|
17
17
|
export * from './one-c-order-exchange-state.schema';
|
|
18
18
|
export * from './get-one-c-order-exchange-state-response.schema';
|
|
19
|
+
export * from './get-one-c-orders-sync-status-request.schema';
|
|
20
|
+
export * from './get-one-c-orders-sync-status-response.schema';
|
|
21
|
+
export * from './one-c-order-sync-status.schema';
|
|
22
|
+
export * from './retry-one-c-order-deletion-response.schema';
|
|
@@ -31,4 +31,12 @@ export const OneCOrderExchangeStateSchema = z.object({
|
|
|
31
31
|
// Последнее применение состава из 1С не прошло (режим ONE_C): код ошибки и когда.
|
|
32
32
|
applyErrorCode: z.string().nullable(),
|
|
33
33
|
applyErrorAt: z.string().datetime().nullable(),
|
|
34
|
+
// 1С ведёт заказ и отправка подтверждена: заказ в FC не редактируется.
|
|
35
|
+
isEditLocked: z.boolean(),
|
|
36
|
+
// Документ снят в 1С (пометка удаления или отмена), заказ ждёт удаления в FC.
|
|
37
|
+
deletionRequestedAt: z.string().datetime().nullable(),
|
|
38
|
+
// Удаление не прошло: код причины и номер счёта или УПД, если причина в них.
|
|
39
|
+
deletionErrorCode: z.string().nullable(),
|
|
40
|
+
deletionErrorDetail: z.string().nullable(),
|
|
41
|
+
deletionErrorAt: z.string().datetime().nullable(),
|
|
34
42
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Заказ с ошибкой синхронизации с 1С: удаление по сигналу из 1С не прошло.
|
|
4
|
+
export const OneCOrderSyncStatusSchema = z.object({
|
|
5
|
+
orderUUID: z.string().uuid(),
|
|
6
|
+
deletionErrorCode: z.string(),
|
|
7
|
+
// Номер счёта или УПД, если причина в них.
|
|
8
|
+
deletionErrorDetail: z.string().nullable(),
|
|
9
|
+
});
|