hvp-shared 8.0.0 → 9.1.0

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.
@@ -75,6 +75,22 @@ export declare enum DocumentStatus {
75
75
  draft = "draft",
76
76
  in_review = "in_review",
77
77
  published = "published",
78
+ /**
79
+ * Vigente pero desfasado: el contenido sigue aplicando, pero hay partes
80
+ * desactualizadas que conviene revisar. Visible en listas con un warning.
81
+ */
82
+ outdated = "outdated",
83
+ /**
84
+ * Retirado: el documento ya no aplica, fue reemplazado o descontinuado.
85
+ * Oculto por defecto en listas. ISO 9001 lo llama "obsolete".
86
+ */
87
+ obsolete = "obsolete",
88
+ /**
89
+ * Archivado-histórico: preservación de un documento cuya naturaleza es
90
+ * registro (grabaciones de reunión, comunicados pasados, etc.). Oculto por
91
+ * defecto. Distinto de `obsolete`: archived es preservación pasiva,
92
+ * obsolete es retiro activo.
93
+ */
78
94
  archived = "archived"
79
95
  }
80
96
  export declare const DOCUMENT_STATUS_LABELS: Record<DocumentStatus, string>;
@@ -109,12 +109,30 @@ var DocumentStatus;
109
109
  DocumentStatus["draft"] = "draft";
110
110
  DocumentStatus["in_review"] = "in_review";
111
111
  DocumentStatus["published"] = "published";
112
+ /**
113
+ * Vigente pero desfasado: el contenido sigue aplicando, pero hay partes
114
+ * desactualizadas que conviene revisar. Visible en listas con un warning.
115
+ */
116
+ DocumentStatus["outdated"] = "outdated";
117
+ /**
118
+ * Retirado: el documento ya no aplica, fue reemplazado o descontinuado.
119
+ * Oculto por defecto en listas. ISO 9001 lo llama "obsolete".
120
+ */
121
+ DocumentStatus["obsolete"] = "obsolete";
122
+ /**
123
+ * Archivado-histórico: preservación de un documento cuya naturaleza es
124
+ * registro (grabaciones de reunión, comunicados pasados, etc.). Oculto por
125
+ * defecto. Distinto de `obsolete`: archived es preservación pasiva,
126
+ * obsolete es retiro activo.
127
+ */
112
128
  DocumentStatus["archived"] = "archived";
113
129
  })(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
114
130
  exports.DOCUMENT_STATUS_LABELS = {
115
131
  [DocumentStatus.draft]: "Borrador",
116
132
  [DocumentStatus.in_review]: "En revisión",
117
133
  [DocumentStatus.published]: "Publicado",
134
+ [DocumentStatus.outdated]: "Desactualizado",
135
+ [DocumentStatus.obsolete]: "Obsoleto",
118
136
  [DocumentStatus.archived]: "Archivado",
119
137
  };
120
138
  // ─── Criticality ────────────────────────────────────────────────────────────
@@ -7,6 +7,14 @@
7
7
  * - Update requests are partial; Create requests are complete.
8
8
  */
9
9
  import { ChangeType, ContentType, Criticality, DocumentStatus, DocumentType, ExternalLinkProvider, Purpose } from "../../constants/document.enums";
10
+ /**
11
+ * Status values that callers may set via the generic status-change endpoint.
12
+ * `draft`, `in_review`, `published` follow the existing workflow endpoints
13
+ * (saveDraft / submitForReview / publish); `archived` keeps its `/archive`
14
+ * endpoint for backward compat. The generic endpoint covers the new
15
+ * lifecycle moves added in GH#22 SP2 plus return-to-published.
16
+ */
17
+ export type ChangeableDocumentStatus = DocumentStatus.outdated | DocumentStatus.obsolete | DocumentStatus.published;
10
18
  import { WebAppRole } from "../../constants/collaborator.constants";
11
19
  /**
12
20
  * One element of `audience[]`. Either a role or the `"all"` sentinel.
@@ -137,15 +145,37 @@ export interface PublishDocumentRequest {
137
145
  /**
138
146
  * Archive Document Request
139
147
  *
140
- * Marks the document as `archived`. Archived docs are hidden from default
141
- * lists but data is preserved. Restricted to admin for `legal_document` and
142
- * `brand_asset` types.
148
+ * Marks the document as `archived` (historical preservation). Archived docs
149
+ * are hidden from default lists but data is preserved. Restricted to admin
150
+ * for `legal_document` and `brand_asset` types.
151
+ *
152
+ * Use this only for *preservation* (meeting recordings, past events). For
153
+ * "retired / no longer applies" use the generic status endpoint with
154
+ * `obsolete`.
143
155
  *
144
156
  * @example POST /api/documents/:id/archive
145
157
  */
146
158
  export interface ArchiveDocumentRequest {
147
159
  reason?: string;
148
160
  }
161
+ /**
162
+ * Change Status Request
163
+ *
164
+ * Generic lifecycle transition for the new statuses introduced in GH#22 SP2:
165
+ * - `published → outdated` / `outdated → published`
166
+ * - `published → obsolete` / `outdated → obsolete`
167
+ * - `obsolete → published` (admin only — recovery)
168
+ *
169
+ * For `draft` / `in_review` use the existing workflow endpoints. For
170
+ * `archived` use `/archive` and `/unarchive`.
171
+ *
172
+ * @example POST /api/documents/:id/status
173
+ */
174
+ export interface ChangeStatusRequest {
175
+ status: ChangeableDocumentStatus;
176
+ /** Optional explanation, shown in the doc's audit trail. */
177
+ reason?: string;
178
+ }
149
179
  /**
150
180
  * Unarchive Document Request
151
181
  *
@@ -182,6 +212,17 @@ export interface ListDocumentsQuery {
182
212
  search?: string;
183
213
  requiredForOnboarding?: boolean;
184
214
  requiresAcknowledgment?: boolean;
215
+ /**
216
+ * If true, the response includes `obsolete` documents. Default: false (the
217
+ * server hides obsolete docs unless the caller asks for them). Ignored when
218
+ * `status` is set explicitly. Writer-only flag.
219
+ */
220
+ includeObsolete?: boolean;
221
+ /**
222
+ * If true, the response includes `archived` documents. Default: false.
223
+ * Ignored when `status` is set explicitly. Writer-only flag.
224
+ */
225
+ includeArchived?: boolean;
185
226
  limit?: number;
186
227
  skip?: number;
187
228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "8.0.0",
3
+ "version": "9.1.0",
4
4
  "description": "Shared types and utilities for HVP backend and frontend",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",