@floristcloud/api-lib 1.2.186 → 1.2.189

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.
@@ -167,6 +167,7 @@ __exportStar(require("./webshop-mode.enum"), exports);
167
167
  __exportStar(require("./write-off-report-date-basis.enum"), exports);
168
168
  __exportStar(require("./write-off-status.enum"), exports);
169
169
  __exportStar(require("./one-c-stock-conflict-status.enum"), exports);
170
+ __exportStar(require("./one-c-order-sync-mode.enum"), exports);
170
171
  __exportStar(require("./one-c-stock-conflict-line-action.enum"), exports);
171
172
  __exportStar(require("./one-c-stock-conflict-line-restriction.enum"), exports);
172
173
  __exportStar(require("./pre-order-conversion-match-kind.enum"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OneCOrderSyncModeEnum = void 0;
4
+ // До какого события в 1С FC передаёт изменения выгруженного заказа (FC-583). Перезапись заказа, с которым уже
5
+ // работают в 1С, — решение компании: в УНФ его ещё ограничивает настройка узла «Обновлять заказы», в УТ — только эта.
6
+ var OneCOrderSyncModeEnum;
7
+ (function (OneCOrderSyncModeEnum) {
8
+ // 1С сообщила «Проведен» — изменения больше не уходят.
9
+ OneCOrderSyncModeEnum["UNTIL_POSTED"] = "UNTIL_POSTED";
10
+ // 1С сообщила об отгрузке — изменения больше не уходят; проведённый заказ продолжает получать изменения.
11
+ OneCOrderSyncModeEnum["UNTIL_SHIPPED"] = "UNTIL_SHIPPED";
12
+ })(OneCOrderSyncModeEnum || (exports.OneCOrderSyncModeEnum = OneCOrderSyncModeEnum = {}));
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompanyLegalProfileIntegrationLinkSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.CompanyLegalProfileIntegrationLinkSchema = zod_1.z.object({ profileUUID: zod_1.z.uuid(), externalId: zod_1.z.uuid() });
5
+ // Идентификаторы МойСклада — 8-4-4-4-12, но не RFC 9562 (вариант `0`, например `…-0a80-…`): z.uuid() их отклоняет.
6
+ exports.CompanyLegalProfileIntegrationLinkSchema = zod_1.z.object({ profileUUID: zod_1.z.uuid(), externalId: zod_1.z.guid() });
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SaveCompanyLegalProfileIntegrationLinkRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.SaveCompanyLegalProfileIntegrationLinkRequestSchema = zod_1.z.object({ profileUUID: zod_1.z.uuid(), externalId: zod_1.z.uuid().nullable() });
5
+ // Идентификаторы МойСклада — 8-4-4-4-12, но не RFC 9562 (вариант `0`, например `…-0a80-…`): z.uuid() их отклоняет.
6
+ exports.SaveCompanyLegalProfileIntegrationLinkRequestSchema = zod_1.z.object({ profileUUID: zod_1.z.uuid(), externalId: zod_1.z.guid().nullable() });
@@ -27,5 +27,6 @@ __exportStar(require("./one-c-stock-conflict-preview.schema"), exports);
27
27
  __exportStar(require("./one-c-stock-conflict-resolution.schema"), exports);
28
28
  __exportStar(require("./resolve-one-c-stock-conflict-request.schema"), exports);
29
29
  __exportStar(require("./resolve-one-c-stock-conflict-response.schema"), exports);
30
+ __exportStar(require("./one-c-settings.schema"), exports);
30
31
  __exportStar(require("./update-one-c-settings-request.schema"), exports);
31
32
  __exportStar(require("./update-one-c-settings-response.schema"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OneCSettingsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const one_c_order_sync_mode_enum_1 = require("../../../enum/one-c-order-sync-mode.enum");
6
+ // Настройки интеграции 1С, которые меняет администратор компании.
7
+ exports.OneCSettingsSchema = zod_1.z.object({
8
+ isOrderMeasureUnitFromProduct: zod_1.z.boolean(),
9
+ // До какого события в 1С уходят изменения выгруженного заказа (FC-583).
10
+ orderSyncMode: zod_1.z.nativeEnum(one_c_order_sync_mode_enum_1.OneCOrderSyncModeEnum),
11
+ });
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OneCStatusSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const integration_status_enum_1 = require("../../../enum/integration-status.enum");
6
+ const one_c_order_sync_mode_enum_1 = require("../../../enum/one-c-order-sync-mode.enum");
6
7
  exports.OneCStatusSchema = zod_1.z.object({
7
8
  isConnected: zod_1.z.boolean(),
8
9
  isOrderMeasureUnitFromProduct: zod_1.z.boolean(),
10
+ orderSyncMode: zod_1.z.nativeEnum(one_c_order_sync_mode_enum_1.OneCOrderSyncModeEnum),
9
11
  status: zod_1.z.nativeEnum(integration_status_enum_1.IntegrationStatusEnum).nullable(),
10
12
  username: zod_1.z.string().nullable(),
11
13
  lastCheckauthAt: zod_1.z.string().datetime().nullable(),
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateOneCSettingsRequestSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.UpdateOneCSettingsRequestSchema = zod_1.z.object({ isOrderMeasureUnitFromProduct: zod_1.z.boolean() });
4
+ const one_c_settings_schema_1 = require("./one-c-settings.schema");
5
+ // Меняются только переданные настройки; пустой запрос — ошибка валидации. Поля перечислены явно: библиотека собирается
6
+ // под ES2016, Object.values в ней нет. Новая настройка добавляется и сюда.
7
+ exports.UpdateOneCSettingsRequestSchema = one_c_settings_schema_1.OneCSettingsSchema.partial().refine(settings => settings.isOrderMeasureUnitFromProduct !== undefined || settings.orderSyncMode !== undefined, { message: 'At least one setting is required' });
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateOneCSettingsResponseSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const update_one_c_settings_request_schema_1 = require("./update-one-c-settings-request.schema");
6
- exports.UpdateOneCSettingsResponseSchema = zod_1.z.object({ data: update_one_c_settings_request_schema_1.UpdateOneCSettingsRequestSchema });
5
+ const one_c_settings_schema_1 = require("./one-c-settings.schema");
6
+ exports.UpdateOneCSettingsResponseSchema = zod_1.z.object({ data: one_c_settings_schema_1.OneCSettingsSchema });
package/enum/index.ts CHANGED
@@ -151,6 +151,7 @@ export * from './webshop-mode.enum';
151
151
  export * from './write-off-report-date-basis.enum';
152
152
  export * from './write-off-status.enum';
153
153
  export * from './one-c-stock-conflict-status.enum';
154
+ export * from './one-c-order-sync-mode.enum';
154
155
  export * from './one-c-stock-conflict-line-action.enum';
155
156
  export * from './one-c-stock-conflict-line-restriction.enum';
156
157
  export * from './pre-order-conversion-match-kind.enum';
@@ -0,0 +1,8 @@
1
+ // До какого события в 1С FC передаёт изменения выгруженного заказа (FC-583). Перезапись заказа, с которым уже
2
+ // работают в 1С, — решение компании: в УНФ его ещё ограничивает настройка узла «Обновлять заказы», в УТ — только эта.
3
+ export enum OneCOrderSyncModeEnum {
4
+ // 1С сообщила «Проведен» — изменения больше не уходят.
5
+ UNTIL_POSTED = 'UNTIL_POSTED',
6
+ // 1С сообщила об отгрузке — изменения больше не уходят; проведённый заказ продолжает получать изменения.
7
+ UNTIL_SHIPPED = 'UNTIL_SHIPPED',
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.186",
3
+ "version": "1.2.189",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -1,2 +1,3 @@
1
1
  import { z } from 'zod';
2
- export const CompanyLegalProfileIntegrationLinkSchema = z.object({ profileUUID: z.uuid(), externalId: z.uuid() });
2
+ // Идентификаторы МойСклада — 8-4-4-4-12, но не RFC 9562 (вариант `0`, например `…-0a80-…`): z.uuid() их отклоняет.
3
+ export const CompanyLegalProfileIntegrationLinkSchema = z.object({ profileUUID: z.uuid(), externalId: z.guid() });
@@ -1,2 +1,3 @@
1
1
  import { z } from 'zod';
2
- export const SaveCompanyLegalProfileIntegrationLinkRequestSchema = z.object({ profileUUID: z.uuid(), externalId: z.uuid().nullable() });
2
+ // Идентификаторы МойСклада — 8-4-4-4-12, но не RFC 9562 (вариант `0`, например `…-0a80-…`): z.uuid() их отклоняет.
3
+ export const SaveCompanyLegalProfileIntegrationLinkRequestSchema = z.object({ profileUUID: z.uuid(), externalId: z.guid().nullable() });
@@ -11,5 +11,6 @@ export * from './one-c-stock-conflict-preview.schema';
11
11
  export * from './one-c-stock-conflict-resolution.schema';
12
12
  export * from './resolve-one-c-stock-conflict-request.schema';
13
13
  export * from './resolve-one-c-stock-conflict-response.schema';
14
+ export * from './one-c-settings.schema';
14
15
  export * from './update-one-c-settings-request.schema';
15
16
  export * from './update-one-c-settings-response.schema';
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { OneCOrderSyncModeEnum } from '../../../enum/one-c-order-sync-mode.enum';
3
+
4
+ // Настройки интеграции 1С, которые меняет администратор компании.
5
+ export const OneCSettingsSchema = z.object({
6
+ isOrderMeasureUnitFromProduct: z.boolean(),
7
+ // До какого события в 1С уходят изменения выгруженного заказа (FC-583).
8
+ orderSyncMode: z.nativeEnum(OneCOrderSyncModeEnum),
9
+ });
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { IntegrationStatusEnum } from '../../../enum/integration-status.enum';
3
+ import { OneCOrderSyncModeEnum } from '../../../enum/one-c-order-sync-mode.enum';
3
4
 
4
5
  export const OneCStatusSchema = z.object({
5
6
  isConnected: z.boolean(),
6
7
  isOrderMeasureUnitFromProduct: z.boolean(),
8
+ orderSyncMode: z.nativeEnum(OneCOrderSyncModeEnum),
7
9
  status: z.nativeEnum(IntegrationStatusEnum).nullable(),
8
10
  username: z.string().nullable(),
9
11
  lastCheckauthAt: z.string().datetime().nullable(),
@@ -1,3 +1,8 @@
1
- import { z } from 'zod';
1
+ import { OneCSettingsSchema } from './one-c-settings.schema';
2
2
 
3
- export const UpdateOneCSettingsRequestSchema = z.object({ isOrderMeasureUnitFromProduct: z.boolean() });
3
+ // Меняются только переданные настройки; пустой запрос — ошибка валидации. Поля перечислены явно: библиотека собирается
4
+ // под ES2016, Object.values в ней нет. Новая настройка добавляется и сюда.
5
+ export const UpdateOneCSettingsRequestSchema = OneCSettingsSchema.partial().refine(
6
+ settings => settings.isOrderMeasureUnitFromProduct !== undefined || settings.orderSyncMode !== undefined,
7
+ { message: 'At least one setting is required' },
8
+ );
@@ -1,4 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { UpdateOneCSettingsRequestSchema } from './update-one-c-settings-request.schema';
2
+ import { OneCSettingsSchema } from './one-c-settings.schema';
3
3
 
4
- export const UpdateOneCSettingsResponseSchema = z.object({ data: UpdateOneCSettingsRequestSchema });
4
+ export const UpdateOneCSettingsResponseSchema = z.object({ data: OneCSettingsSchema });