sprof 1.22.11 → 1.23.1

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.
@@ -26,10 +26,10 @@ declare const _default: {
26
26
  loading: boolean;
27
27
  empty: boolean;
28
28
  emptyText: string;
29
+ inline: boolean;
29
30
  loadingText: string;
30
31
  emptyIcon: string;
31
32
  retryLabel: string;
32
- inline: boolean;
33
33
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
34
34
  P: {};
35
35
  B: {};
@@ -59,10 +59,10 @@ declare const _default: {
59
59
  loading: boolean;
60
60
  empty: boolean;
61
61
  emptyText: string;
62
+ inline: boolean;
62
63
  loadingText: string;
63
64
  emptyIcon: string;
64
65
  retryLabel: string;
65
- inline: boolean;
66
66
  }>;
67
67
  __isFragment?: undefined;
68
68
  __isTeleport?: undefined;
@@ -91,10 +91,10 @@ declare const _default: {
91
91
  loading: boolean;
92
92
  empty: boolean;
93
93
  emptyText: string;
94
+ inline: boolean;
94
95
  loadingText: string;
95
96
  emptyIcon: string;
96
97
  retryLabel: string;
97
- inline: boolean;
98
98
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
99
99
  $slots: {
100
100
  loading?(_: {}): any;
@@ -163,10 +163,10 @@ export declare const Loading: StoryFn<{
163
163
  loading: boolean;
164
164
  empty: boolean;
165
165
  emptyText: string;
166
+ inline: boolean;
166
167
  loadingText: string;
167
168
  emptyIcon: string;
168
169
  retryLabel: string;
169
- inline: boolean;
170
170
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
171
171
  P: {};
172
172
  B: {};
@@ -196,10 +196,10 @@ export declare const Loading: StoryFn<{
196
196
  loading: boolean;
197
197
  empty: boolean;
198
198
  emptyText: string;
199
+ inline: boolean;
199
200
  loadingText: string;
200
201
  emptyIcon: string;
201
202
  retryLabel: string;
202
- inline: boolean;
203
203
  }>;
204
204
  __isFragment?: undefined;
205
205
  __isTeleport?: undefined;
@@ -228,10 +228,10 @@ export declare const Loading: StoryFn<{
228
228
  loading: boolean;
229
229
  empty: boolean;
230
230
  emptyText: string;
231
+ inline: boolean;
231
232
  loadingText: string;
232
233
  emptyIcon: string;
233
234
  retryLabel: string;
234
- inline: boolean;
235
235
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
236
236
  $slots: {
237
237
  loading?(_: {}): any;
@@ -267,10 +267,10 @@ export declare const Error: StoryFn<{
267
267
  loading: boolean;
268
268
  empty: boolean;
269
269
  emptyText: string;
270
+ inline: boolean;
270
271
  loadingText: string;
271
272
  emptyIcon: string;
272
273
  retryLabel: string;
273
- inline: boolean;
274
274
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
275
275
  P: {};
276
276
  B: {};
@@ -300,10 +300,10 @@ export declare const Error: StoryFn<{
300
300
  loading: boolean;
301
301
  empty: boolean;
302
302
  emptyText: string;
303
+ inline: boolean;
303
304
  loadingText: string;
304
305
  emptyIcon: string;
305
306
  retryLabel: string;
306
- inline: boolean;
307
307
  }>;
308
308
  __isFragment?: undefined;
309
309
  __isTeleport?: undefined;
@@ -332,10 +332,10 @@ export declare const Error: StoryFn<{
332
332
  loading: boolean;
333
333
  empty: boolean;
334
334
  emptyText: string;
335
+ inline: boolean;
335
336
  loadingText: string;
336
337
  emptyIcon: string;
337
338
  retryLabel: string;
338
- inline: boolean;
339
339
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
340
340
  $slots: {
341
341
  loading?(_: {}): any;
@@ -371,10 +371,10 @@ export declare const Empty: StoryFn<{
371
371
  loading: boolean;
372
372
  empty: boolean;
373
373
  emptyText: string;
374
+ inline: boolean;
374
375
  loadingText: string;
375
376
  emptyIcon: string;
376
377
  retryLabel: string;
377
- inline: boolean;
378
378
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
379
379
  P: {};
380
380
  B: {};
@@ -404,10 +404,10 @@ export declare const Empty: StoryFn<{
404
404
  loading: boolean;
405
405
  empty: boolean;
406
406
  emptyText: string;
407
+ inline: boolean;
407
408
  loadingText: string;
408
409
  emptyIcon: string;
409
410
  retryLabel: string;
410
- inline: boolean;
411
411
  }>;
412
412
  __isFragment?: undefined;
413
413
  __isTeleport?: undefined;
@@ -436,10 +436,10 @@ export declare const Empty: StoryFn<{
436
436
  loading: boolean;
437
437
  empty: boolean;
438
438
  emptyText: string;
439
+ inline: boolean;
439
440
  loadingText: string;
440
441
  emptyIcon: string;
441
442
  retryLabel: string;
442
- inline: boolean;
443
443
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
444
444
  $slots: {
445
445
  loading?(_: {}): any;
@@ -475,10 +475,10 @@ export declare const Ready: StoryFn<{
475
475
  loading: boolean;
476
476
  empty: boolean;
477
477
  emptyText: string;
478
+ inline: boolean;
478
479
  loadingText: string;
479
480
  emptyIcon: string;
480
481
  retryLabel: string;
481
- inline: boolean;
482
482
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
483
483
  P: {};
484
484
  B: {};
@@ -508,10 +508,10 @@ export declare const Ready: StoryFn<{
508
508
  loading: boolean;
509
509
  empty: boolean;
510
510
  emptyText: string;
511
+ inline: boolean;
511
512
  loadingText: string;
512
513
  emptyIcon: string;
513
514
  retryLabel: string;
514
- inline: boolean;
515
515
  }>;
516
516
  __isFragment?: undefined;
517
517
  __isTeleport?: undefined;
@@ -540,10 +540,10 @@ export declare const Ready: StoryFn<{
540
540
  loading: boolean;
541
541
  empty: boolean;
542
542
  emptyText: string;
543
+ inline: boolean;
543
544
  loadingText: string;
544
545
  emptyIcon: string;
545
546
  retryLabel: string;
546
- inline: boolean;
547
547
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
548
548
  $slots: {
549
549
  loading?(_: {}): any;
@@ -33,10 +33,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
33
33
  loading: boolean;
34
34
  empty: boolean;
35
35
  emptyText: string;
36
+ inline: boolean;
36
37
  loadingText: string;
37
38
  emptyIcon: string;
38
39
  retryLabel: string;
39
- inline: boolean;
40
40
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
41
41
  loading?(_: {}): any;
42
42
  error?(_: {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { default as PF } from './core/index';
2
2
  import * as PFM from './modules/index';
3
3
  export { PF, PFM };
4
+ export { PAuditList, PAuditJournal } from './modules/audit';
5
+ export type { AuditEntityLinks, AuditRow, AuditRevertMode } from './modules/audit';
4
6
  export { installSprof } from './install';
5
7
  export { setupClient, type SetupOptions } from './core/setup/index';
6
8
  export type {} from './global-components';
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Журнал изменений: общие типы и утилиты (sprof).
3
+ *
4
+ * ⚠️ ЗАЧЕМ ОБЩИЙ МОДУЛЬ (10.11.2026). Журнал появился в hr, и владелец прямо
5
+ * сказал: «это функционал, который должен распространиться на все сервисы
6
+ * рдкб — и портал тоже; я не должен указывать на одни и те же задачи».
7
+ * Поэтому UI тоже общий: одна страница + один таб «Журнал» для всех проектов.
8
+ *
9
+ * Серверная часть — `sprob/handlers/audit` (та же схема таблицы везде).
10
+ */
11
+ /** Изменённое поле в человекочитаемом виде (сервер считает сам). */
12
+ export interface AuditDeltaItem {
13
+ field: string;
14
+ label: string;
15
+ old: string;
16
+ new: string;
17
+ }
18
+ /** Строка журнала (см. `sprob/handlers/audit.Item`). */
19
+ export interface AuditRow {
20
+ id: string;
21
+ createdAt: string;
22
+ userName: string;
23
+ roleCode: string;
24
+ entity: string;
25
+ entityRus: string;
26
+ objectId: string;
27
+ code: string;
28
+ field: string;
29
+ fieldRus: string;
30
+ oldValue: string;
31
+ newValue: string;
32
+ operation: string;
33
+ delta: AuditDeltaItem[];
34
+ canRevert: boolean;
35
+ isRevert: boolean;
36
+ }
37
+ /** Страница журнала. */
38
+ export interface AuditPage {
39
+ count: number;
40
+ items: AuditRow[];
41
+ }
42
+ /** Режим отката: одно изменение или оно же со всеми более новыми. */
43
+ export type AuditRevertMode = 'single' | 'cascade';
44
+ /** Операция для фильтра. */
45
+ export interface AuditOperationOption {
46
+ value: string;
47
+ label: string;
48
+ }
49
+ /** Подпись операции. */
50
+ export declare const auditOperationLabel: (op: string, options?: AuditOperationOption[]) => string;
51
+ /** Цвет бейджа операции. */
52
+ export declare const auditOperationColor: (op: string) => string;
53
+ /** «2026-11-08 16:09:00» → «08.11.2026 16:09». */
54
+ export declare const auditFormatDate: (value: string) => string;
55
+ /**
56
+ * Значение в одну строку.
57
+ *
58
+ * ⚠️ В `new_value` нередко лежит JSON всего тела запроса: показываем как есть,
59
+ * но обрезаем — иначе строка таблицы растягивается на пол-экрана.
60
+ */
61
+ export declare const auditShort: (value: string, max?: number) => string;
62
+ /** Короткое описание изменения (для подтверждения отката). */
63
+ export declare const auditDeltaSummary: (row: AuditRow) => string;
64
+ /**
65
+ * Ссылка на объект журнала.
66
+ *
67
+ * ⚠️ Карта передаётся ПРОЕКТОМ (`entityLinks` в пропсах): имя сущности в
68
+ * журнале — это первый сегмент HTTP-пути (`worker-documents`), а не раздел
69
+ * фронта, и у каждого проекта свои адреса. Неизвестная сущность честно не
70
+ * получает ссылки.
71
+ */
72
+ export interface AuditEntityLink {
73
+ to: (id: string) => string;
74
+ title: string;
75
+ }
76
+ export type AuditEntityLinks = Record<string, AuditEntityLink>;
77
+ export declare const auditEntityLink: (links: AuditEntityLinks, entity: string, objectId: string) => AuditEntityLink | null;
@@ -0,0 +1,24 @@
1
+ import { AuditOperationOption } from '../audit.types';
2
+ /**
3
+ * Журнал изменений ОДНОГО объекта (общий компонент sprof).
4
+ *
5
+ * Данные — `GET /api/audit-log?objectId=…`; дельта и подписи считаются на
6
+ * сервере (`sprob/handlers/audit`), здесь только отображение.
7
+ */
8
+ type __VLS_Props = {
9
+ /** id объекта (или несколько — см. комментарий в шаблоне). */
10
+ objectId?: string | string[];
11
+ /** Сущности, которые показывать (пусто — все). */
12
+ entities?: string[];
13
+ /** Сколько записей грузить. */
14
+ limit?: number;
15
+ /** Подписи операций (можно не передавать — будут стандартные). */
16
+ operations?: AuditOperationOption[];
17
+ };
18
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
19
+ limit: number;
20
+ objectId: string | string[];
21
+ entities: string[];
22
+ operations: AuditOperationOption[];
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
24
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { AuditEntityLinks } from '../audit.types';
2
+ type __VLS_Props = {
3
+ /** Карта «сущность журнала → ссылка на карточку». */
4
+ entityLinks?: AuditEntityLinks;
5
+ /** Фиксированный фильтр по сущности (если страница открыта из раздела). */
6
+ entity?: string | null;
7
+ /** Сколько записей на странице. */
8
+ limit?: number;
9
+ };
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
+ limit: number;
12
+ entity: string | null;
13
+ entityLinks: AuditEntityLinks;
14
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
15
+ export default _default;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Журнал изменений — общий модуль sprof.
3
+ *
4
+ * ⚠️ ЗАЧЕМ (10.11.2026). Владелец: «журнал изменений — функционал, который
5
+ * должен распространиться на все сервисы рдкб — и портал тоже; я не должен
6
+ * указывать тебе на одни и те же задачи». Поэтому и бэкенд (`sprob/handlers/audit`),
7
+ * и UI живут в библиотеках: проект передаёт только карту ссылок на карточки.
8
+ *
9
+ * Использование в проекте:
10
+ *
11
+ * // страница
12
+ * <PAuditList :entity-links="links" />
13
+ * // таб «Журнал» внутри карточки
14
+ * <PAuditJournal :object-id="[item.id, item.humanId]" :entities="['humans', 'workers']" />
15
+ */
16
+ export { default as PAuditList } from './components/PAuditList.vue';
17
+ export { default as PAuditJournal } from './components/PAuditJournal.vue';
18
+ export * from './audit.types';