@byline/client 3.6.0 → 3.8.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.
- package/dist/response.js +11 -0
- package/dist/types.d.ts +15 -0
- package/package.json +4 -4
package/dist/response.js
CHANGED
|
@@ -39,6 +39,17 @@ export function shapeDocument(raw) {
|
|
|
39
39
|
if (typeof raw.source_locale === 'string') {
|
|
40
40
|
shaped.sourceLocale = raw.source_locale;
|
|
41
41
|
}
|
|
42
|
+
// Version audit metadata — acting user + action (storage keys
|
|
43
|
+
// `created_by` / `event_type`).
|
|
44
|
+
// `created_by` is NULL on rows written before audit wiring or by
|
|
45
|
+
// internal tooling without a request context — omitted here, rendered as
|
|
46
|
+
// "unknown" by consumers. See docs/AUDIT.md — Workstream 1.
|
|
47
|
+
if (typeof raw.created_by === 'string') {
|
|
48
|
+
shaped.createdBy = raw.created_by;
|
|
49
|
+
}
|
|
50
|
+
if (typeof raw.event_type === 'string') {
|
|
51
|
+
shaped.eventType = raw.event_type;
|
|
52
|
+
}
|
|
42
53
|
// Locale advertising + availability metadata. Present on
|
|
43
54
|
// find / findById / findByPath; absent on version/history reads.
|
|
44
55
|
// Storage raw keys already match the surface names (passthrough) —
|
package/dist/types.d.ts
CHANGED
|
@@ -344,6 +344,21 @@ export interface ClientDocument<F = Record<string, any>> {
|
|
|
344
344
|
createdAt: Date;
|
|
345
345
|
/** When this version was last updated. */
|
|
346
346
|
updatedAt: Date;
|
|
347
|
+
/**
|
|
348
|
+
* The acting user's id that created **this version** (storage column
|
|
349
|
+
* `byline_document_versions.created_by`). Because versions are immutable,
|
|
350
|
+
* the creator of the current version is also "who last updated the
|
|
351
|
+
* document". Absent on rows written before audit wiring or by
|
|
352
|
+
* internal tooling without a request context. Raw id only — display-name
|
|
353
|
+
* resolution is an admin-realm concern (see docs/AUDIT.md — Workstream 1).
|
|
354
|
+
*/
|
|
355
|
+
createdBy?: string;
|
|
356
|
+
/**
|
|
357
|
+
* The lifecycle action that produced this version (storage column
|
|
358
|
+
* `event_type`): `create` / `update` / `restore` / `copy_to_locale` /
|
|
359
|
+
* `delete_locale`. Surfaced for audit rendering in history views.
|
|
360
|
+
*/
|
|
361
|
+
eventType?: string;
|
|
347
362
|
/** Reconstructed field data. */
|
|
348
363
|
fields: F;
|
|
349
364
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@byline/client",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.8.0",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.9.0"
|
|
8
8
|
},
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"npm-run-all": "^4.1.5",
|
|
41
|
-
"@byline/auth": "3.
|
|
42
|
-
"@byline/core": "3.
|
|
41
|
+
"@byline/auth": "3.8.0",
|
|
42
|
+
"@byline/core": "3.8.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@biomejs/biome": "2.4.15",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"tsx": "^4.22.3",
|
|
52
52
|
"typescript": "6.0.3",
|
|
53
53
|
"vitest": "^4.1.7",
|
|
54
|
-
"@byline/db-postgres": "3.
|
|
54
|
+
"@byline/db-postgres": "3.8.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public",
|