hvp-shared 7.8.0 → 7.9.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.
@@ -18,13 +18,27 @@
18
18
  */
19
19
  export declare const AUDIENCE_ALL = "all";
20
20
  /**
21
- * High-level reason a document exists. The first axis of the 3-tier
22
- * classification (purpose → type → tags).
21
+ * High-level reason a document exists. First axis of the classification
22
+ * (purpose → type → tags). One purpose per audience:
23
+ *
24
+ * - `operational` — staff, day-to-day workflow
25
+ * - `reference` — staff, consultation / support material
26
+ * - `external` — public / clients (marketing, communication)
27
+ * - `archive` — historical records preserved deliberately
28
+ *
29
+ * Note: `resource` was the previous name of the catch-all bucket. It is
30
+ * deprecated in favor of two narrower purposes (`reference` + `external`)
31
+ * because mixing internal-staff and external-public content under one
32
+ * purpose led to incoherent search filtering. Kept in the enum for legacy
33
+ * data compatibility (migration script will not produce it for new docs).
23
34
  */
24
35
  export declare enum Purpose {
25
36
  operational = "operational",
26
- resource = "resource",
27
- archive = "archive"
37
+ reference = "reference",
38
+ external = "external",
39
+ archive = "archive",
40
+ /** @deprecated Use `reference` (internal staff) or `external` (clients/public) instead. */
41
+ resource = "resource"
28
42
  }
29
43
  export declare const PURPOSE_LABELS: Record<Purpose, string>;
30
44
  /**
@@ -23,19 +23,35 @@ exports.EXTERNAL_LINK_PROVIDER_LABELS = exports.ExternalLinkProvider = exports.C
23
23
  exports.AUDIENCE_ALL = "all";
24
24
  // ─── Purpose ────────────────────────────────────────────────────────────────
25
25
  /**
26
- * High-level reason a document exists. The first axis of the 3-tier
27
- * classification (purpose → type → tags).
26
+ * High-level reason a document exists. First axis of the classification
27
+ * (purpose → type → tags). One purpose per audience:
28
+ *
29
+ * - `operational` — staff, day-to-day workflow
30
+ * - `reference` — staff, consultation / support material
31
+ * - `external` — public / clients (marketing, communication)
32
+ * - `archive` — historical records preserved deliberately
33
+ *
34
+ * Note: `resource` was the previous name of the catch-all bucket. It is
35
+ * deprecated in favor of two narrower purposes (`reference` + `external`)
36
+ * because mixing internal-staff and external-public content under one
37
+ * purpose led to incoherent search filtering. Kept in the enum for legacy
38
+ * data compatibility (migration script will not produce it for new docs).
28
39
  */
29
40
  var Purpose;
30
41
  (function (Purpose) {
31
42
  Purpose["operational"] = "operational";
32
- Purpose["resource"] = "resource";
43
+ Purpose["reference"] = "reference";
44
+ Purpose["external"] = "external";
33
45
  Purpose["archive"] = "archive";
46
+ /** @deprecated Use `reference` (internal staff) or `external` (clients/public) instead. */
47
+ Purpose["resource"] = "resource";
34
48
  })(Purpose || (exports.Purpose = Purpose = {}));
35
49
  exports.PURPOSE_LABELS = {
36
50
  [Purpose.operational]: "Operativo",
37
- [Purpose.resource]: "Recurso",
51
+ [Purpose.reference]: "Consulta",
52
+ [Purpose.external]: "Externo / comunicación pública",
38
53
  [Purpose.archive]: "Archivo",
54
+ [Purpose.resource]: "Recurso (deprecated)",
39
55
  };
40
56
  // ─── DocumentType ───────────────────────────────────────────────────────────
41
57
  /**
@@ -77,6 +77,9 @@ export interface DocumentSummaryResponse {
77
77
  *
78
78
  * Full version row. Returned by the viewer, version history, and
79
79
  * acknowledgment lookups.
80
+ *
81
+ * A version has a single meaningful date — `publishedAt` — which is null while
82
+ * the version is draft / in_review and set when it transitions to `current`.
80
83
  */
81
84
  export interface DocumentVersionResponse {
82
85
  id: string;
@@ -91,10 +94,11 @@ export interface DocumentVersionResponse {
91
94
  } | null;
92
95
  changeType: ChangeType;
93
96
  changeNotes: string | null;
94
- createdAt: string;
95
- createdBy: string;
97
+ /** Set only when the version reached `current` (or was demoted to `superseded`). Null for draft / in_review. */
96
98
  publishedAt: string | null;
97
99
  publishedBy: string | null;
100
+ /** Author of this version row (typically who started the draft). */
101
+ createdBy?: string;
98
102
  }
99
103
  /**
100
104
  * Document Acknowledgment Response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "7.8.0",
3
+ "version": "7.9.1",
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",