@fuzdev/fuz_app 0.166.0 → 0.167.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/actions/CLAUDE.md +1 -1
- package/dist/actions/action_codegen.d.ts +10 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +17 -8
- package/dist/auth/CLAUDE.md +10 -8
- package/dist/auth/cell_action_specs.d.ts +6092 -1092
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +96 -97
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +1 -0
- package/dist/auth/cell_audit_action_specs.d.ts +301 -69
- package/dist/auth/cell_audit_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_audit_action_specs.js +21 -16
- package/dist/auth/cell_audit_actions.js +2 -2
- package/dist/auth/cell_audit_events.d.ts +2 -2
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.d.ts +93 -30
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +15 -14
- package/dist/auth/cell_authorize.d.ts +3 -3
- package/dist/auth/cell_authorize.js +3 -3
- package/dist/auth/cell_data_schema.d.ts +17 -9
- package/dist/auth/cell_data_schema.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.js +9 -7
- package/dist/auth/cell_field_action_specs.d.ts +697 -130
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_field_action_specs.js +25 -27
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +2 -0
- package/dist/auth/cell_field_audit_metadata.d.ts +49 -13
- package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_field_audit_metadata.js +6 -6
- package/dist/auth/cell_grant_action_specs.d.ts +1044 -208
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.js +36 -33
- package/dist/auth/cell_grant_actions.js +2 -2
- package/dist/auth/cell_grant_audit_metadata.d.ts +188 -40
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +12 -11
- package/dist/auth/cell_item_action_specs.d.ts +949 -175
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_item_action_specs.js +30 -34
- package/dist/auth/cell_item_actions.js +1 -1
- package/dist/auth/cell_item_audit_metadata.d.ts +68 -19
- package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_item_audit_metadata.js +9 -9
- package/dist/auth/cell_relation_list_limit.d.ts +1 -2
- package/dist/auth/cell_relation_list_limit.d.ts.map +1 -1
- package/dist/auth/cell_relation_list_limit.js +3 -8
- package/dist/db/cell_moderation.d.ts +6 -7
- package/dist/db/cell_moderation.d.ts.map +1 -1
- package/dist/db/cell_moderation.js +6 -7
- package/dist/testing/cross_backend/cell_crud.js +2 -2
- package/dist/testing/cross_backend/cell_relations.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_item_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_item_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"cell_item_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_item_action_specs.ts"],"names":[],"mappings":"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"}
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
13
|
+
import { array, boolean, brand, literal, object, optional, pipe, regex } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
14
|
import { FRACTIONAL_INDEX_LENGTH_MAX, FRACTIONAL_INDEX_REGEX } from '@fuzdev/fuz_util/fractional_index.ts';
|
|
15
|
-
import { ActingActor } from '../
|
|
15
|
+
import { ActingActor, bounded_string, Timestamp, Uuid } from '../primitive_schemas_fuz.js';
|
|
16
16
|
import { CellRelationListLimit } from './cell_relation_list_limit.js';
|
|
17
17
|
// -- Error reasons ----------------------------------------------------------
|
|
18
18
|
/** Error reason — `cell_item_list` got neither or both of `parent_id` and `child_id`. */
|
|
@@ -37,24 +37,22 @@ export const ERROR_CELL_ITEM_POSITION_TAKEN = 'cell_item_position_taken';
|
|
|
37
37
|
* contract; the no-trailing-`'0'` invariant lives in the helper, not the
|
|
38
38
|
* wire.
|
|
39
39
|
*/
|
|
40
|
-
export const CellItemPosition = bounded_string({ min: 1, max: FRACTIONAL_INDEX_LENGTH_MAX })
|
|
41
|
-
.regex(FRACTIONAL_INDEX_REGEX)
|
|
42
|
-
.brand('CellItemPosition');
|
|
40
|
+
export const CellItemPosition = brand(pipe(bounded_string({ min: 1, max: FRACTIONAL_INDEX_LENGTH_MAX }), regex(FRACTIONAL_INDEX_REGEX)), 'CellItemPosition');
|
|
43
41
|
/**
|
|
44
42
|
* Wire-format for a `cell_item` row.
|
|
45
43
|
*
|
|
46
44
|
* `position` is branded `CellItemPosition` so consumers that round-trip
|
|
47
45
|
* the value back into a `position_after` / `position` input field don't
|
|
48
46
|
* need a cast at every call site. Wire ingress is validated by the
|
|
49
|
-
* `CellItemPosition`
|
|
47
|
+
* `CellItemPosition` schema (alphabet + length); wire egress trusts
|
|
50
48
|
* the DB CHECK constraint that backs `cell_item.position`, so the
|
|
51
49
|
* server-side `to_item_json` casts a raw string from `CellItemRow`.
|
|
52
50
|
*/
|
|
53
|
-
export const ItemJson =
|
|
51
|
+
export const ItemJson = object({
|
|
54
52
|
parent_id: Uuid,
|
|
55
53
|
position: CellItemPosition,
|
|
56
54
|
child_id: Uuid,
|
|
57
|
-
created_at:
|
|
55
|
+
created_at: Timestamp
|
|
58
56
|
});
|
|
59
57
|
// -- cell_item_insert -------------------------------------------------------
|
|
60
58
|
/**
|
|
@@ -63,37 +61,37 @@ export const ItemJson = z.strictObject({
|
|
|
63
61
|
* client-side. Returns `cell_item_position_taken` on `(parent_id,
|
|
64
62
|
* position)` unique violation; client refreshes bracket and retries.
|
|
65
63
|
*/
|
|
66
|
-
export const CellItemInsertInput =
|
|
67
|
-
parent_id:
|
|
68
|
-
child_id:
|
|
69
|
-
position:
|
|
64
|
+
export const CellItemInsertInput = object({
|
|
65
|
+
parent_id: meta(Uuid, { description: 'Cell to insert into.' }),
|
|
66
|
+
child_id: meta(Uuid, { description: 'Cell to insert as a child.' }),
|
|
67
|
+
position: meta(CellItemPosition, {
|
|
70
68
|
description: 'Fractional-indexing key. Client-computed via `fractional_index_between`.'
|
|
71
69
|
}),
|
|
72
70
|
acting: ActingActor
|
|
73
71
|
});
|
|
74
|
-
export const CellItemInsertOutput =
|
|
72
|
+
export const CellItemInsertOutput = object({ item: ItemJson });
|
|
75
73
|
// -- cell_item_move ---------------------------------------------------------
|
|
76
74
|
/**
|
|
77
75
|
* Input for `cell_item_move`. Move within the same parent (cross-parent
|
|
78
76
|
* moves are a future extension).
|
|
79
77
|
*/
|
|
80
|
-
export const CellItemMoveInput =
|
|
81
|
-
parent_id:
|
|
82
|
-
position:
|
|
83
|
-
new_position:
|
|
78
|
+
export const CellItemMoveInput = object({
|
|
79
|
+
parent_id: meta(Uuid, { description: 'Parent cell.' }),
|
|
80
|
+
position: meta(CellItemPosition, { description: 'Current position of the row to move.' }),
|
|
81
|
+
new_position: meta(CellItemPosition, { description: 'New fractional-indexing key.' }),
|
|
84
82
|
acting: ActingActor
|
|
85
83
|
});
|
|
86
|
-
export const CellItemMoveOutput =
|
|
84
|
+
export const CellItemMoveOutput = object({ item: ItemJson });
|
|
87
85
|
// -- cell_item_delete -------------------------------------------------------
|
|
88
86
|
/** Input for `cell_item_delete`. Idempotent on the slot key. */
|
|
89
|
-
export const CellItemDeleteInput =
|
|
90
|
-
parent_id:
|
|
91
|
-
position:
|
|
87
|
+
export const CellItemDeleteInput = object({
|
|
88
|
+
parent_id: meta(Uuid, { description: 'Parent cell.' }),
|
|
89
|
+
position: meta(CellItemPosition, { description: 'Slot to delete.' }),
|
|
92
90
|
acting: ActingActor
|
|
93
91
|
});
|
|
94
|
-
export const CellItemDeleteOutput =
|
|
95
|
-
ok:
|
|
96
|
-
deleted:
|
|
92
|
+
export const CellItemDeleteOutput = object({
|
|
93
|
+
ok: literal(true),
|
|
94
|
+
deleted: boolean
|
|
97
95
|
});
|
|
98
96
|
// -- cell_item_list ---------------------------------------------------------
|
|
99
97
|
/**
|
|
@@ -110,23 +108,21 @@ export const CellItemDeleteOutput = z.strictObject({
|
|
|
110
108
|
* `position_after` (return rows with `position > position_after`); the
|
|
111
109
|
* reverse listing has no cursor, oldest item first.
|
|
112
110
|
*/
|
|
113
|
-
export const CellItemListInput =
|
|
114
|
-
|
|
115
|
-
parent_id: Uuid.optional().meta({
|
|
111
|
+
export const CellItemListInput = meta(object({
|
|
112
|
+
parent_id: meta(optional(Uuid), {
|
|
116
113
|
description: 'List forward items whose parent is this cell.'
|
|
117
114
|
}),
|
|
118
|
-
child_id:
|
|
115
|
+
child_id: meta(optional(Uuid), {
|
|
119
116
|
description: 'List reverse parents whose child is this cell.'
|
|
120
117
|
}),
|
|
121
|
-
position_after:
|
|
118
|
+
position_after: meta(optional(CellItemPosition), {
|
|
122
119
|
description: 'Cursor for forward pagination — return rows whose position > this.'
|
|
123
120
|
}),
|
|
124
121
|
limit: CellRelationListLimit,
|
|
125
122
|
acting: ActingActor
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
items: z.array(ItemJson)
|
|
123
|
+
}), { empty_input_handler_guarded: true });
|
|
124
|
+
export const CellItemListOutput = object({
|
|
125
|
+
items: array(ItemJson)
|
|
130
126
|
});
|
|
131
127
|
// -- Action specs -----------------------------------------------------------
|
|
132
128
|
export const cell_item_insert_action_spec = {
|
|
@@ -40,7 +40,7 @@ export const to_item_json = (row) => ({
|
|
|
40
40
|
parent_id: row.parent_id,
|
|
41
41
|
// `cell.position` is a DB-shape string; brand at the wire boundary so
|
|
42
42
|
// consumers can round-trip it without casting (the DB CHECK constraint
|
|
43
|
-
// is the runtime validator on egress, the
|
|
43
|
+
// is the runtime validator on egress, the `CellItemPosition` schema is the validator
|
|
44
44
|
// on ingress).
|
|
45
45
|
position: row.position,
|
|
46
46
|
child_id: row.child_id,
|
|
@@ -6,30 +6,79 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
10
10
|
/** Metadata envelope for `cell_item_insert`. */
|
|
11
|
-
export declare const CellItemInsertAuditMetadata:
|
|
12
|
-
parent_id:
|
|
13
|
-
position:
|
|
14
|
-
child_id:
|
|
15
|
-
},
|
|
16
|
-
|
|
11
|
+
export declare const CellItemInsertAuditMetadata: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
12
|
+
parent_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
13
|
+
position: string;
|
|
14
|
+
child_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
15
|
+
} & Record<string, unknown>, {
|
|
16
|
+
parent_id: string;
|
|
17
|
+
position: string;
|
|
18
|
+
child_id: string;
|
|
19
|
+
} & Record<string, unknown>, "loose_object", {
|
|
20
|
+
parent_id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
21
|
+
readonly '~types'?: {
|
|
22
|
+
readonly input: string;
|
|
23
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
24
|
+
} | undefined;
|
|
25
|
+
};
|
|
26
|
+
position: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
27
|
+
child_id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
28
|
+
readonly '~types'?: {
|
|
29
|
+
readonly input: string;
|
|
30
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
export type CellItemInsertAuditMetadata = Infer<typeof CellItemInsertAuditMetadata>;
|
|
17
35
|
/**
|
|
18
36
|
* Metadata envelope for `cell_item_move`. Carries both old and new
|
|
19
37
|
* position so the audit trail shows the reorder without a join back to
|
|
20
38
|
* the live row.
|
|
21
39
|
*/
|
|
22
|
-
export declare const CellItemMoveAuditMetadata:
|
|
23
|
-
parent_id:
|
|
24
|
-
position_old:
|
|
25
|
-
position_new:
|
|
26
|
-
},
|
|
27
|
-
|
|
40
|
+
export declare const CellItemMoveAuditMetadata: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
41
|
+
parent_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
42
|
+
position_old: string;
|
|
43
|
+
position_new: string;
|
|
44
|
+
} & Record<string, unknown>, {
|
|
45
|
+
parent_id: string;
|
|
46
|
+
position_old: string;
|
|
47
|
+
position_new: string;
|
|
48
|
+
} & Record<string, unknown>, "loose_object", {
|
|
49
|
+
parent_id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
50
|
+
readonly '~types'?: {
|
|
51
|
+
readonly input: string;
|
|
52
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
53
|
+
} | undefined;
|
|
54
|
+
};
|
|
55
|
+
position_old: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
56
|
+
position_new: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
57
|
+
}>;
|
|
58
|
+
export type CellItemMoveAuditMetadata = Infer<typeof CellItemMoveAuditMetadata>;
|
|
28
59
|
/** Metadata envelope for `cell_item_delete`. */
|
|
29
|
-
export declare const CellItemDeleteAuditMetadata:
|
|
30
|
-
parent_id:
|
|
31
|
-
position:
|
|
32
|
-
child_id:
|
|
33
|
-
},
|
|
34
|
-
|
|
60
|
+
export declare const CellItemDeleteAuditMetadata: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
61
|
+
parent_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
62
|
+
position: string;
|
|
63
|
+
child_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
64
|
+
} & Record<string, unknown>, {
|
|
65
|
+
parent_id: string;
|
|
66
|
+
position: string;
|
|
67
|
+
child_id: string;
|
|
68
|
+
} & Record<string, unknown>, "loose_object", {
|
|
69
|
+
parent_id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
70
|
+
readonly '~types'?: {
|
|
71
|
+
readonly input: string;
|
|
72
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
73
|
+
} | undefined;
|
|
74
|
+
};
|
|
75
|
+
position: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
76
|
+
child_id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
77
|
+
readonly '~types'?: {
|
|
78
|
+
readonly input: string;
|
|
79
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
80
|
+
} | undefined;
|
|
81
|
+
};
|
|
82
|
+
}>;
|
|
83
|
+
export type CellItemDeleteAuditMetadata = Infer<typeof CellItemDeleteAuditMetadata>;
|
|
35
84
|
//# sourceMappingURL=cell_item_audit_metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_item_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_item_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"cell_item_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_item_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAIhF,gDAAgD;AAChD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;EAItC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;EAIpC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEhF,gDAAgD;AAChD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;EAItC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import { Uuid } from '../
|
|
9
|
+
import { loose_object, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
10
|
+
import { Uuid } from '../primitive_schemas_fuz.js';
|
|
11
11
|
/** Metadata envelope for `cell_item_insert`. */
|
|
12
|
-
export const CellItemInsertAuditMetadata =
|
|
12
|
+
export const CellItemInsertAuditMetadata = loose_object({
|
|
13
13
|
parent_id: Uuid,
|
|
14
|
-
position:
|
|
14
|
+
position: string,
|
|
15
15
|
child_id: Uuid
|
|
16
16
|
});
|
|
17
17
|
/**
|
|
@@ -19,14 +19,14 @@ export const CellItemInsertAuditMetadata = z.looseObject({
|
|
|
19
19
|
* position so the audit trail shows the reorder without a join back to
|
|
20
20
|
* the live row.
|
|
21
21
|
*/
|
|
22
|
-
export const CellItemMoveAuditMetadata =
|
|
22
|
+
export const CellItemMoveAuditMetadata = loose_object({
|
|
23
23
|
parent_id: Uuid,
|
|
24
|
-
position_old:
|
|
25
|
-
position_new:
|
|
24
|
+
position_old: string,
|
|
25
|
+
position_new: string
|
|
26
26
|
});
|
|
27
27
|
/** Metadata envelope for `cell_item_delete`. */
|
|
28
|
-
export const CellItemDeleteAuditMetadata =
|
|
28
|
+
export const CellItemDeleteAuditMetadata = loose_object({
|
|
29
29
|
parent_id: Uuid,
|
|
30
|
-
position:
|
|
30
|
+
position: string,
|
|
31
31
|
child_id: Uuid
|
|
32
32
|
});
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
|
-
import { z } from 'zod';
|
|
14
13
|
/** Cap on a relation-list page, forward and reverse alike. */
|
|
15
14
|
export declare const CELL_RELATION_LIST_LIMIT_MAX = 500;
|
|
16
15
|
/** The page size a relation list that omits `limit` gets, forward and reverse alike. */
|
|
17
16
|
export declare const CELL_RELATION_LIST_LIMIT_DEFAULT = 50;
|
|
18
17
|
/** The `limit` input of `cell_field_list` and `cell_item_list`. */
|
|
19
|
-
export declare const CellRelationListLimit:
|
|
18
|
+
export declare const CellRelationListLimit: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
20
19
|
//# sourceMappingURL=cell_relation_list_limit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_relation_list_limit.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_relation_list_limit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"cell_relation_list_limit.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_relation_list_limit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,8DAA8D;AAC9D,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,wFAAwF;AACxF,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,2SAKjC,CAAC"}
|
|
@@ -10,18 +10,13 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
14
|
+
import { integer, max_value, min_value, number, optional, pipe } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
15
|
/** Cap on a relation-list page, forward and reverse alike. */
|
|
15
16
|
export const CELL_RELATION_LIST_LIMIT_MAX = 500;
|
|
16
17
|
/** The page size a relation list that omits `limit` gets, forward and reverse alike. */
|
|
17
18
|
export const CELL_RELATION_LIST_LIMIT_DEFAULT = 50;
|
|
18
19
|
/** The `limit` input of `cell_field_list` and `cell_item_list`. */
|
|
19
|
-
export const CellRelationListLimit =
|
|
20
|
-
.number()
|
|
21
|
-
.int()
|
|
22
|
-
.positive()
|
|
23
|
-
.max(CELL_RELATION_LIST_LIMIT_MAX)
|
|
24
|
-
.optional()
|
|
25
|
-
.meta({
|
|
20
|
+
export const CellRelationListLimit = meta(optional(pipe(number, integer, min_value(1), max_value(CELL_RELATION_LIST_LIMIT_MAX))), {
|
|
26
21
|
description: `The most edges a page holds, each one whose other end the caller can view — forward and reverse alike: default ${CELL_RELATION_LIST_LIMIT_DEFAULT}, max ${CELL_RELATION_LIST_LIMIT_MAX}.`
|
|
27
22
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `cell.moderation` read rules, in pure and SQL form side by side.
|
|
3
3
|
*
|
|
4
|
-
* `moderation` is
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `moderation` is `null` or one of the three markers below: the create
|
|
5
|
+
* authorizer's verdict and `cell_moderate` write nothing else, and `CellJson`
|
|
6
|
+
* refuses any other on the wire. Each rule names the markers it admits.
|
|
7
7
|
*
|
|
8
8
|
* **Audience admission** — `cell_moderation_admits_audience` and
|
|
9
9
|
* `cell_moderation_admits_audience_sql`: unmoderated (`null`) or `'approved'`.
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
* **Stewardship** — `cell_moderation_is_stewardable` and
|
|
18
18
|
* `cell_moderation_is_stewardable_sql`: exactly `'pending'` or `'rejected'`, the
|
|
19
19
|
* states in which the governing root's manager reads a contribution its
|
|
20
|
-
* audience can't (`can_steward_cell`).
|
|
21
|
-
* nor stewardable, so only its owner and admins read it.
|
|
20
|
+
* audience can't (`can_steward_cell`).
|
|
22
21
|
*
|
|
23
22
|
* The pure and SQL forms are written once each here, next to each other, over
|
|
24
23
|
* the same literal constants; every predicate and query composes them rather
|
|
@@ -34,8 +33,8 @@ export declare const CELL_MODERATION_APPROVED = "approved";
|
|
|
34
33
|
export declare const CELL_MODERATION_REJECTED = "rejected";
|
|
35
34
|
/**
|
|
36
35
|
* Whether a cell's `moderation` marker admits it to an audience beyond its
|
|
37
|
-
* owner — unmoderated (`null`) or `'approved'`; `'pending'
|
|
38
|
-
*
|
|
36
|
+
* owner — unmoderated (`null`) or `'approved'`; `'pending'` and `'rejected'`
|
|
37
|
+
* do not.
|
|
39
38
|
*
|
|
40
39
|
* @param moderation - the cell's `moderation` column
|
|
41
40
|
* @returns whether the public and grant read arms may admit the cell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_moderation.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/cell_moderation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cell_moderation.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/cell_moderation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD,sDAAsD;AACtD,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,qDAAqD;AACrD,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,OACb,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC,GAAI,OAAO,MAAM,KAAG,MACmB,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,OACO,CAAC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,GAAI,OAAO,MAAM,KAAG,MACoB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `cell.moderation` read rules, in pure and SQL form side by side.
|
|
3
3
|
*
|
|
4
|
-
* `moderation` is
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `moderation` is `null` or one of the three markers below: the create
|
|
5
|
+
* authorizer's verdict and `cell_moderate` write nothing else, and `CellJson`
|
|
6
|
+
* refuses any other on the wire. Each rule names the markers it admits.
|
|
7
7
|
*
|
|
8
8
|
* **Audience admission** — `cell_moderation_admits_audience` and
|
|
9
9
|
* `cell_moderation_admits_audience_sql`: unmoderated (`null`) or `'approved'`.
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
* **Stewardship** — `cell_moderation_is_stewardable` and
|
|
18
18
|
* `cell_moderation_is_stewardable_sql`: exactly `'pending'` or `'rejected'`, the
|
|
19
19
|
* states in which the governing root's manager reads a contribution its
|
|
20
|
-
* audience can't (`can_steward_cell`).
|
|
21
|
-
* nor stewardable, so only its owner and admins read it.
|
|
20
|
+
* audience can't (`can_steward_cell`).
|
|
22
21
|
*
|
|
23
22
|
* The pure and SQL forms are written once each here, next to each other, over
|
|
24
23
|
* the same literal constants; every predicate and query composes them rather
|
|
@@ -34,8 +33,8 @@ export const CELL_MODERATION_APPROVED = 'approved';
|
|
|
34
33
|
export const CELL_MODERATION_REJECTED = 'rejected';
|
|
35
34
|
/**
|
|
36
35
|
* Whether a cell's `moderation` marker admits it to an audience beyond its
|
|
37
|
-
* owner — unmoderated (`null`) or `'approved'`; `'pending'
|
|
38
|
-
*
|
|
36
|
+
* owner — unmoderated (`null`) or `'approved'`; `'pending'` and `'rejected'`
|
|
37
|
+
* do not.
|
|
39
38
|
*
|
|
40
39
|
* @param moderation - the cell's `moderation` column
|
|
41
40
|
* @returns whether the public and grant read arms may admit the cell
|
|
@@ -14,7 +14,7 @@ import '../assert_dev_env.js';
|
|
|
14
14
|
*
|
|
15
15
|
* Drives the full lifecycle (create → get → update → delete → list, threading
|
|
16
16
|
* the created id) plus the authz matrix the wire contract guarantees. Every
|
|
17
|
-
* success response is parsed against the verb's declared
|
|
17
|
+
* success response is parsed against the verb's declared **output** schema
|
|
18
18
|
* (`CellCreateOutput` / `CellGetOutput` / …), so a TS↔Rust envelope drift —
|
|
19
19
|
* not just a `CellJson` field drift — fails the suite:
|
|
20
20
|
*
|
|
@@ -125,7 +125,7 @@ export const describe_cell_crud_cross_tests = (options) => {
|
|
|
125
125
|
assert.strictEqual(created.cell.created_by, owner.actor.id);
|
|
126
126
|
assert.strictEqual(created.cell.updated_by, null);
|
|
127
127
|
assert.strictEqual(created.cell.grant_count, 0);
|
|
128
|
-
// Byte-shape gate: `CellJson`'s `
|
|
128
|
+
// Byte-shape gate: `CellJson`'s `Timestamp` accepts a millisecond
|
|
129
129
|
// stamp too, so `expect_output` alone can't tell the two spines
|
|
130
130
|
// apart on the timestamp columns.
|
|
131
131
|
assert_iso8601_seconds(created.cell.created_at, 'cell_create.created_at');
|
|
@@ -8,7 +8,7 @@ import '../assert_dev_env.js';
|
|
|
8
8
|
* Like the CRUD suite (and ws / sse), these verbs are live-mounted on the
|
|
9
9
|
* spine RPC path but stay off the standard declared surface, so the generic
|
|
10
10
|
* `describe_rpc_round_trip_tests` never drives them. Every success response
|
|
11
|
-
* is parsed against the verb's declared
|
|
11
|
+
* is parsed against the verb's declared **output** schema, so a TS↔Rust
|
|
12
12
|
* envelope drift fails the suite — not just a payload-field drift.
|
|
13
13
|
*
|
|
14
14
|
* Coverage (gated on `capabilities.cell_relations`):
|
|
@@ -192,7 +192,7 @@ export const describe_cell_relations_cross_tests = (options) => {
|
|
|
192
192
|
});
|
|
193
193
|
test_if(capabilities.cell_relations, "cell_list shared_with other than 'me' → invalid_params", async () => {
|
|
194
194
|
const fixture = await setup_test();
|
|
195
|
-
// TS rejects at the schema (`
|
|
195
|
+
// TS rejects at the schema (`literal('me')`), Rust in the handler
|
|
196
196
|
// guard — both must land on -32602, so a caller can't widen the
|
|
197
197
|
// grant-driven branch to another actor on either spine.
|
|
198
198
|
const bad = await cross_rpc_call(fixture.fresh_transport(), rpc_path, 'cell_list', { shared_with: 'not-me' }, fixture.create_session_headers());
|