@mossbear/protocol 0.1.0-alpha.29 → 0.1.0-alpha.30
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/contextKinds.d.ts +138 -0
- package/dist/contextKinds.d.ts.map +1 -0
- package/dist/contextKinds.js +121 -0
- package/dist/contextKinds.js.map +1 -0
- package/dist/contextKinds.test.d.ts +2 -0
- package/dist/contextKinds.test.d.ts.map +1 -0
- package/dist/contextKinds.test.js +154 -0
- package/dist/contextKinds.test.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +777 -28
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +457 -10
- package/dist/schemas.js.map +1 -1
- package/dist/schemas.test.js +189 -1
- package/dist/schemas.test.js.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +5 -6
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one table the context item-kind narrowings derive from.
|
|
3
|
+
*
|
|
4
|
+
* **Why this file exists.** `guide_files.content_type` is a free-text, nullable
|
|
5
|
+
* column (`apps/dashboard/src/database/schema-mossbear.ts:308`), narrowed on
|
|
6
|
+
* the wire in three different places — what an agent may *read* back
|
|
7
|
+
* (`ContextItemTypeSchema`), what it may *push* (`PushContentTypeSchema`), what
|
|
8
|
+
* it may *capture* into the inbox (`InboxContentTypeSchema`) — plus a lossy
|
|
9
|
+
* `contentType → itemType` mapping and a hand-written SQL inverse of that
|
|
10
|
+
* mapping in the items route. Each narrowing had a reason and none of them
|
|
11
|
+
* derived from a shared source, so adding a fourth kind meant editing five
|
|
12
|
+
* places and nothing failed if you missed one
|
|
13
|
+
* (`docs/design/context-system-review.md` → §2.3).
|
|
14
|
+
*
|
|
15
|
+
* Now one row per kind answers all of it declaratively. A new kind is a new row
|
|
16
|
+
* that must state whether it is pushable and capturable; it cannot be added and
|
|
17
|
+
* silently omitted from a narrowing, because no narrowing has its own list any
|
|
18
|
+
* more.
|
|
19
|
+
*
|
|
20
|
+
* **Strictly a re-derivation.** Every picklist below comes out equal to the
|
|
21
|
+
* literal it replaced, values and order alike — `contextKinds.test.ts` pins each
|
|
22
|
+
* one against a hand-written copy of today's values, so a row edit that would
|
|
23
|
+
* change the wire fails there rather than in a client. Which kinds are pushable
|
|
24
|
+
* and capturable are product decisions this table records; changing one is a
|
|
25
|
+
* separate, deliberate change to that row.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The `content_type` values that are addressable as context items on the wire.
|
|
29
|
+
*
|
|
30
|
+
* `contentType` doubles as the item's `type` in a response — for these kinds the
|
|
31
|
+
* two are the same string, which is why there is no separate `itemType` column
|
|
32
|
+
* here. Kinds *not* listed (`instructions`, `eval`, `script`, and a legacy NULL)
|
|
33
|
+
* are still stored in the column; they collapse onto
|
|
34
|
+
* {@link DEFAULT_CONTEXT_ITEM_TYPE} when serialized, and
|
|
35
|
+
* {@link contentTypeFilterForItemTypes} is what keeps SQL agreeing with that.
|
|
36
|
+
*
|
|
37
|
+
* Order is the wire order of the derived picklists and is load-bearing for the
|
|
38
|
+
* pin test; append rather than reorder.
|
|
39
|
+
*/
|
|
40
|
+
export declare const CONTEXT_CONTENT_KINDS: readonly [{
|
|
41
|
+
readonly contentType: "document";
|
|
42
|
+
readonly pushable: true;
|
|
43
|
+
readonly capturable: true;
|
|
44
|
+
}, {
|
|
45
|
+
readonly contentType: "reference";
|
|
46
|
+
readonly pushable: true;
|
|
47
|
+
readonly capturable: false;
|
|
48
|
+
}, {
|
|
49
|
+
readonly contentType: "asset";
|
|
50
|
+
readonly pushable: true;
|
|
51
|
+
readonly capturable: true;
|
|
52
|
+
}];
|
|
53
|
+
/**
|
|
54
|
+
* The item type of a `guides` row.
|
|
55
|
+
*
|
|
56
|
+
* A guide is not a `content_type` at all — it is a different table — which is
|
|
57
|
+
* why it is named here rather than added to the table above. It is readable as
|
|
58
|
+
* an item and deliberately neither pushable nor capturable: `PushContentType`'s
|
|
59
|
+
* doc comment on `PushContentTypeSchema` explains why a create cannot honor it.
|
|
60
|
+
*/
|
|
61
|
+
export declare const GUIDE_ITEM_TYPE = "guide";
|
|
62
|
+
/**
|
|
63
|
+
* What an unlisted or NULL `content_type` serializes as.
|
|
64
|
+
*
|
|
65
|
+
* The default arm exists so a stray row — one written before a kind was
|
|
66
|
+
* retired, or by a non-context surface — produces a schema-valid response
|
|
67
|
+
* instead of failing the read. It is what makes the mapping lossy, and so what
|
|
68
|
+
* forces {@link contentTypeFilterForItemTypes} to exist.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DEFAULT_CONTEXT_ITEM_TYPE = "document";
|
|
71
|
+
/** `content_type` values addressable as items, in wire order. */
|
|
72
|
+
export declare const CONTEXT_CONTENT_TYPES: ("document" | "reference" | "asset")[];
|
|
73
|
+
/** Item types an agent may read back, in wire order. */
|
|
74
|
+
export declare const CONTEXT_ITEM_TYPES: string[];
|
|
75
|
+
/** `content_type` values a caller may create through the context layer. */
|
|
76
|
+
export declare const PUSH_CONTENT_TYPES: ("document" | "reference" | "asset")[];
|
|
77
|
+
/** `content_type` values the inbox may capture. */
|
|
78
|
+
export declare const INBOX_CONTENT_TYPES: ("document" | "reference" | "asset")[];
|
|
79
|
+
/**
|
|
80
|
+
* Membership kinds in `bundle_items.item_type`.
|
|
81
|
+
*
|
|
82
|
+
* **A different axis from everything above, kept here because it is the other
|
|
83
|
+
* half of "what kind is this item".** `bundle_items.item_type` says which table
|
|
84
|
+
* `item_id` points at (`guides` or `guide_files`); it is not a narrowing of
|
|
85
|
+
* `content_type`, and a new *content* kind must not add a row here. The review
|
|
86
|
+
* that motivated this file counts it among the "five enums over one column"
|
|
87
|
+
* (§2.3) — that count is wrong, and the two axes are named separately below so
|
|
88
|
+
* a later reader does not merge them.
|
|
89
|
+
*/
|
|
90
|
+
export declare const BUNDLE_MEMBER_TYPES: readonly ["guide_file", "guide"];
|
|
91
|
+
/**
|
|
92
|
+
* The item type a stored `content_type` serializes as.
|
|
93
|
+
*
|
|
94
|
+
* Anything unrecognized — including NULL — is a {@link DEFAULT_CONTEXT_ITEM_TYPE},
|
|
95
|
+
* so a stray row never produces a schema-invalid response. That default is what
|
|
96
|
+
* makes this mapping non-injective: `contentType` cannot be recovered from an
|
|
97
|
+
* item's `type`, which is why filtering by type in SQL needs
|
|
98
|
+
* {@link contentTypeFilterForItemTypes} rather than an inverted lookup.
|
|
99
|
+
*/
|
|
100
|
+
export declare function contentTypeToItemType(contentType: string | null): (typeof CONTEXT_ITEM_TYPES)[number];
|
|
101
|
+
/**
|
|
102
|
+
* How to select the rows whose `content_type` serializes as one of
|
|
103
|
+
* `wantedItemTypes` — the inverse of {@link contentTypeToItemType}, as data.
|
|
104
|
+
*
|
|
105
|
+
* **Data rather than SQL because `packages/` never imports from the dashboard**
|
|
106
|
+
* (`CLAUDE.md` → Boundary Rules). The caller builds the predicate with its own
|
|
107
|
+
* query builder; what it must not have to re-derive is *which* content types
|
|
108
|
+
* belong in it, which is exactly the knowledge that drifted.
|
|
109
|
+
*
|
|
110
|
+
* The two variants are the whole contract, and the second one is why this
|
|
111
|
+
* returns a tagged shape instead of a bare array:
|
|
112
|
+
*
|
|
113
|
+
* - `{ kind: 'in' }` — match `content_type IN contentTypes`.
|
|
114
|
+
* - `{ kind: 'inOrUnlisted' }` — match
|
|
115
|
+
* `content_type IN contentTypes OR content_type NOT IN excluding OR content_type IS NULL`.
|
|
116
|
+
*
|
|
117
|
+
* **The `IS NULL` arm is part of what `inOrUnlisted` means, not an extra the
|
|
118
|
+
* caller adds.** In SQL a NULL column makes `IN` and `NOT IN` alike evaluate to
|
|
119
|
+
* NULL, so a plain `NOT IN ('reference','asset')` silently drops exactly the
|
|
120
|
+
* legacy NULL rows the serializer still calls documents — the route would then
|
|
121
|
+
* contradict itself about the same row (Codex, PR #562). Spelling the arm into
|
|
122
|
+
* the variant's definition is what stops the next caller reconstructing the
|
|
123
|
+
* predicate without it.
|
|
124
|
+
*
|
|
125
|
+
* `wantedItemTypes` values that are not item types at all (`guide`, or junk)
|
|
126
|
+
* simply match no kind; guides are not `guide_files` rows and are selected
|
|
127
|
+
* separately by their caller.
|
|
128
|
+
*/
|
|
129
|
+
export type ContentTypeFilter = {
|
|
130
|
+
kind: 'in';
|
|
131
|
+
contentTypes: string[];
|
|
132
|
+
} | {
|
|
133
|
+
kind: 'inOrUnlisted';
|
|
134
|
+
contentTypes: string[];
|
|
135
|
+
excluding: string[];
|
|
136
|
+
};
|
|
137
|
+
export declare function contentTypeFilterForItemTypes(wantedItemTypes: Iterable<string>): ContentTypeFilter;
|
|
138
|
+
//# sourceMappingURL=contextKinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextKinds.d.ts","sourceRoot":"","sources":["../src/contextKinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAQxB,CAAA;AAEV;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,aAAa,CAAA;AAenD,iEAAiE;AACjE,eAAO,MAAM,qBAAqB,wCAAkD,CAAA;AAEpF,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,UAA8C,CAAA;AAE7E,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,wCAAyB,CAAA;AAExD,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,wCAA2B,CAAA;AAE3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,kCAA2C,CAAA;AAE3E;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAGrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEzE,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,GAChC,iBAAiB,CAgBnB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one table the context item-kind narrowings derive from.
|
|
3
|
+
*
|
|
4
|
+
* **Why this file exists.** `guide_files.content_type` is a free-text, nullable
|
|
5
|
+
* column (`apps/dashboard/src/database/schema-mossbear.ts:308`), narrowed on
|
|
6
|
+
* the wire in three different places — what an agent may *read* back
|
|
7
|
+
* (`ContextItemTypeSchema`), what it may *push* (`PushContentTypeSchema`), what
|
|
8
|
+
* it may *capture* into the inbox (`InboxContentTypeSchema`) — plus a lossy
|
|
9
|
+
* `contentType → itemType` mapping and a hand-written SQL inverse of that
|
|
10
|
+
* mapping in the items route. Each narrowing had a reason and none of them
|
|
11
|
+
* derived from a shared source, so adding a fourth kind meant editing five
|
|
12
|
+
* places and nothing failed if you missed one
|
|
13
|
+
* (`docs/design/context-system-review.md` → §2.3).
|
|
14
|
+
*
|
|
15
|
+
* Now one row per kind answers all of it declaratively. A new kind is a new row
|
|
16
|
+
* that must state whether it is pushable and capturable; it cannot be added and
|
|
17
|
+
* silently omitted from a narrowing, because no narrowing has its own list any
|
|
18
|
+
* more.
|
|
19
|
+
*
|
|
20
|
+
* **Strictly a re-derivation.** Every picklist below comes out equal to the
|
|
21
|
+
* literal it replaced, values and order alike — `contextKinds.test.ts` pins each
|
|
22
|
+
* one against a hand-written copy of today's values, so a row edit that would
|
|
23
|
+
* change the wire fails there rather than in a client. Which kinds are pushable
|
|
24
|
+
* and capturable are product decisions this table records; changing one is a
|
|
25
|
+
* separate, deliberate change to that row.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The `content_type` values that are addressable as context items on the wire.
|
|
29
|
+
*
|
|
30
|
+
* `contentType` doubles as the item's `type` in a response — for these kinds the
|
|
31
|
+
* two are the same string, which is why there is no separate `itemType` column
|
|
32
|
+
* here. Kinds *not* listed (`instructions`, `eval`, `script`, and a legacy NULL)
|
|
33
|
+
* are still stored in the column; they collapse onto
|
|
34
|
+
* {@link DEFAULT_CONTEXT_ITEM_TYPE} when serialized, and
|
|
35
|
+
* {@link contentTypeFilterForItemTypes} is what keeps SQL agreeing with that.
|
|
36
|
+
*
|
|
37
|
+
* Order is the wire order of the derived picklists and is load-bearing for the
|
|
38
|
+
* pin test; append rather than reorder.
|
|
39
|
+
*/
|
|
40
|
+
export const CONTEXT_CONTENT_KINDS = [
|
|
41
|
+
{ contentType: 'document', pushable: true, capturable: true },
|
|
42
|
+
{ contentType: 'reference', pushable: true, capturable: false },
|
|
43
|
+
// `capturable` ahead of the upload path it is for: the inbox schema has
|
|
44
|
+
// admitted `asset` since it was written, with image upload still to land
|
|
45
|
+
// (`docs/plans/context-image-capture-plan.md:14`). The flag records today's
|
|
46
|
+
// wire, which is the only thing this table is allowed to record.
|
|
47
|
+
{ contentType: 'asset', pushable: true, capturable: true },
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* The item type of a `guides` row.
|
|
51
|
+
*
|
|
52
|
+
* A guide is not a `content_type` at all — it is a different table — which is
|
|
53
|
+
* why it is named here rather than added to the table above. It is readable as
|
|
54
|
+
* an item and deliberately neither pushable nor capturable: `PushContentType`'s
|
|
55
|
+
* doc comment on `PushContentTypeSchema` explains why a create cannot honor it.
|
|
56
|
+
*/
|
|
57
|
+
export const GUIDE_ITEM_TYPE = 'guide';
|
|
58
|
+
/**
|
|
59
|
+
* What an unlisted or NULL `content_type` serializes as.
|
|
60
|
+
*
|
|
61
|
+
* The default arm exists so a stray row — one written before a kind was
|
|
62
|
+
* retired, or by a non-context surface — produces a schema-valid response
|
|
63
|
+
* instead of failing the read. It is what makes the mapping lossy, and so what
|
|
64
|
+
* forces {@link contentTypeFilterForItemTypes} to exist.
|
|
65
|
+
*/
|
|
66
|
+
export const DEFAULT_CONTEXT_ITEM_TYPE = 'document';
|
|
67
|
+
// `Extract` rather than a bare boolean `filter`, because a bare one widens.
|
|
68
|
+
// `k.pushable` does not narrow `k`, so the derived arrays would type as *every*
|
|
69
|
+
// content type and `InboxContentType` would silently admit `reference` at the
|
|
70
|
+
// type level while still rejecting it at runtime — a wire narrowing that no
|
|
71
|
+
// longer narrows anything a compiler can see. The predicate keeps each derived
|
|
72
|
+
// picklist as tight as the literal it replaced.
|
|
73
|
+
const kindsWhere = (flag) => CONTEXT_CONTENT_KINDS.filter((k) => k[flag]).map((k) => k.contentType);
|
|
74
|
+
/** `content_type` values addressable as items, in wire order. */
|
|
75
|
+
export const CONTEXT_CONTENT_TYPES = CONTEXT_CONTENT_KINDS.map((k) => k.contentType);
|
|
76
|
+
/** Item types an agent may read back, in wire order. */
|
|
77
|
+
export const CONTEXT_ITEM_TYPES = [GUIDE_ITEM_TYPE, ...CONTEXT_CONTENT_TYPES];
|
|
78
|
+
/** `content_type` values a caller may create through the context layer. */
|
|
79
|
+
export const PUSH_CONTENT_TYPES = kindsWhere('pushable');
|
|
80
|
+
/** `content_type` values the inbox may capture. */
|
|
81
|
+
export const INBOX_CONTENT_TYPES = kindsWhere('capturable');
|
|
82
|
+
/**
|
|
83
|
+
* Membership kinds in `bundle_items.item_type`.
|
|
84
|
+
*
|
|
85
|
+
* **A different axis from everything above, kept here because it is the other
|
|
86
|
+
* half of "what kind is this item".** `bundle_items.item_type` says which table
|
|
87
|
+
* `item_id` points at (`guides` or `guide_files`); it is not a narrowing of
|
|
88
|
+
* `content_type`, and a new *content* kind must not add a row here. The review
|
|
89
|
+
* that motivated this file counts it among the "five enums over one column"
|
|
90
|
+
* (§2.3) — that count is wrong, and the two axes are named separately below so
|
|
91
|
+
* a later reader does not merge them.
|
|
92
|
+
*/
|
|
93
|
+
export const BUNDLE_MEMBER_TYPES = ['guide_file', GUIDE_ITEM_TYPE];
|
|
94
|
+
/**
|
|
95
|
+
* The item type a stored `content_type` serializes as.
|
|
96
|
+
*
|
|
97
|
+
* Anything unrecognized — including NULL — is a {@link DEFAULT_CONTEXT_ITEM_TYPE},
|
|
98
|
+
* so a stray row never produces a schema-invalid response. That default is what
|
|
99
|
+
* makes this mapping non-injective: `contentType` cannot be recovered from an
|
|
100
|
+
* item's `type`, which is why filtering by type in SQL needs
|
|
101
|
+
* {@link contentTypeFilterForItemTypes} rather than an inverted lookup.
|
|
102
|
+
*/
|
|
103
|
+
export function contentTypeToItemType(contentType) {
|
|
104
|
+
const kind = CONTEXT_CONTENT_KINDS.find((k) => k.contentType === contentType);
|
|
105
|
+
return kind ? kind.contentType : DEFAULT_CONTEXT_ITEM_TYPE;
|
|
106
|
+
}
|
|
107
|
+
export function contentTypeFilterForItemTypes(wantedItemTypes) {
|
|
108
|
+
const wanted = new Set(wantedItemTypes);
|
|
109
|
+
const contentTypes = CONTEXT_CONTENT_TYPES.filter((ct) => wanted.has(contentTypeToItemType(ct)));
|
|
110
|
+
if (!wanted.has(DEFAULT_CONTEXT_ITEM_TYPE))
|
|
111
|
+
return { kind: 'in', contentTypes };
|
|
112
|
+
return {
|
|
113
|
+
kind: 'inOrUnlisted',
|
|
114
|
+
contentTypes,
|
|
115
|
+
// The listed kinds that are *not* the default — i.e. every content type
|
|
116
|
+
// whose item type is something other than `document`. A row outside this
|
|
117
|
+
// set is a document by the default arm above, NULL included.
|
|
118
|
+
excluding: CONTEXT_CONTENT_TYPES.filter((ct) => contentTypeToItemType(ct) !== DEFAULT_CONTEXT_ITEM_TYPE),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//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test.d.ts","sourceRoot":"","sources":["../src/contextKinds.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { BUNDLE_MEMBER_TYPES, CONTEXT_CONTENT_TYPES, CONTEXT_ITEM_TYPES, INBOX_CONTENT_TYPES, PUSH_CONTENT_TYPES, contentTypeFilterForItemTypes, contentTypeToItemType, } from './contextKinds.js';
|
|
4
|
+
import { BundleMemberTypeSchema, ContextItemTypeSchema, InboxContentTypeSchema, PushContentTypeSchema, } from './schemas.js';
|
|
5
|
+
/**
|
|
6
|
+
* These are pins, not specifications. Each literal below is a hand-written copy
|
|
7
|
+
* of what the wire carried before `contextKinds.ts` existed, so a table edit
|
|
8
|
+
* that would change what a client sends or accepts fails here — where the
|
|
9
|
+
* change is visible and deliberate — rather than in a released CLI.
|
|
10
|
+
*
|
|
11
|
+
* Editing a literal in this file is therefore a wire change. If that is what you
|
|
12
|
+
* mean, the row in `CONTEXT_CONTENT_KINDS` and the pin move together and the
|
|
13
|
+
* commit says which clients are affected.
|
|
14
|
+
*/
|
|
15
|
+
describe('the derived picklists still carry the values they replaced', () => {
|
|
16
|
+
it('an agent reads back a guide, document, reference or asset', () => {
|
|
17
|
+
expect(CONTEXT_ITEM_TYPES).toEqual(['guide', 'document', 'reference', 'asset']);
|
|
18
|
+
expect(ContextItemTypeSchema.options).toEqual([
|
|
19
|
+
'guide',
|
|
20
|
+
'document',
|
|
21
|
+
'reference',
|
|
22
|
+
'asset',
|
|
23
|
+
]);
|
|
24
|
+
});
|
|
25
|
+
it('a caller may push a document, reference or asset — never a guide', () => {
|
|
26
|
+
expect(PUSH_CONTENT_TYPES).toEqual(['document', 'reference', 'asset']);
|
|
27
|
+
expect(PushContentTypeSchema.options).toEqual(['document', 'reference', 'asset']);
|
|
28
|
+
expect(v.safeParse(PushContentTypeSchema, 'guide').success).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
it('the inbox captures a document or an asset, and not a reference', () => {
|
|
31
|
+
expect(INBOX_CONTENT_TYPES).toEqual(['document', 'asset']);
|
|
32
|
+
expect(InboxContentTypeSchema.options).toEqual(['document', 'asset']);
|
|
33
|
+
expect(v.safeParse(InboxContentTypeSchema, 'reference').success).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
it('a bundle member is a guide_file or a guide', () => {
|
|
36
|
+
expect(BUNDLE_MEMBER_TYPES).toEqual(['guide_file', 'guide']);
|
|
37
|
+
expect(BundleMemberTypeSchema.options).toEqual(['guide_file', 'guide']);
|
|
38
|
+
});
|
|
39
|
+
it('membership kinds are a different axis from content kinds', () => {
|
|
40
|
+
// `guide_file` is a table, not a content type. If a content kind ever
|
|
41
|
+
// appears here the two axes have been merged and the narrowings above stop
|
|
42
|
+
// meaning what they say.
|
|
43
|
+
expect(CONTEXT_CONTENT_TYPES).not.toContain('guide_file');
|
|
44
|
+
for (const contentType of CONTEXT_CONTENT_TYPES) {
|
|
45
|
+
expect(BUNDLE_MEMBER_TYPES).not.toContain(contentType);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('an unrecognized content type still reads back as a document', () => {
|
|
50
|
+
it.each(['document', 'reference', 'asset'])('%s serializes as itself', (ct) => {
|
|
51
|
+
expect(contentTypeToItemType(ct)).toBe(ct);
|
|
52
|
+
});
|
|
53
|
+
// The kinds `guide_files.content_type` also holds, which no context read
|
|
54
|
+
// narrowing admits. Collapsing them is what keeps a stray row readable.
|
|
55
|
+
it.each(['instructions', 'eval', 'script', 'something-we-retired', ''])('%s collapses onto document', (ct) => {
|
|
56
|
+
expect(contentTypeToItemType(ct)).toBe('document');
|
|
57
|
+
});
|
|
58
|
+
it('a legacy NULL content type is a document too', () => {
|
|
59
|
+
expect(contentTypeToItemType(null)).toBe('document');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('filtering by item type selects exactly the rows that serialize as it', () => {
|
|
63
|
+
// The rows a real table would hold, including the legacy NULL and the content
|
|
64
|
+
// types no context narrowing admits. `expected` is what the serializer calls
|
|
65
|
+
// each one — computed from `contentTypeToItemType`, which is the mapping the
|
|
66
|
+
// SQL filter has to agree with.
|
|
67
|
+
const rows = [
|
|
68
|
+
'document',
|
|
69
|
+
'reference',
|
|
70
|
+
'asset',
|
|
71
|
+
'instructions',
|
|
72
|
+
'eval',
|
|
73
|
+
'script',
|
|
74
|
+
null,
|
|
75
|
+
];
|
|
76
|
+
/** Evaluates a `ContentTypeFilter` the way the SQL predicate does. */
|
|
77
|
+
function selects(filter) {
|
|
78
|
+
return (contentType) => {
|
|
79
|
+
// `IN` and `NOT IN` are both NULL — and so falsy — for a NULL column.
|
|
80
|
+
const isIn = (set) => contentType !== null && set.includes(contentType);
|
|
81
|
+
const isNotIn = (set) => contentType !== null && !set.includes(contentType);
|
|
82
|
+
if (filter.kind === 'in')
|
|
83
|
+
return isIn(filter.contentTypes);
|
|
84
|
+
return (isIn(filter.contentTypes) || isNotIn(filter.excluding) || contentType === null);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const cases = [
|
|
88
|
+
{ wanted: ['reference'], expected: ['reference'] },
|
|
89
|
+
{ wanted: ['asset'], expected: ['asset'] },
|
|
90
|
+
{ wanted: ['reference', 'asset'], expected: ['reference', 'asset'] },
|
|
91
|
+
// `document` drags in every unlisted type and the NULL, because that is
|
|
92
|
+
// what the serializer calls them.
|
|
93
|
+
{
|
|
94
|
+
wanted: ['document'],
|
|
95
|
+
expected: ['document', 'instructions', 'eval', 'script', null],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
wanted: ['document', 'reference'],
|
|
99
|
+
expected: ['document', 'reference', 'instructions', 'eval', 'script', null],
|
|
100
|
+
},
|
|
101
|
+
{ wanted: ['document', 'reference', 'asset'], expected: rows },
|
|
102
|
+
// A guide is not a `guide_files` row at all, so no content type matches.
|
|
103
|
+
{ wanted: ['guide'], expected: [] },
|
|
104
|
+
{ wanted: [], expected: [] },
|
|
105
|
+
];
|
|
106
|
+
it.each(cases)('?types=$wanted matches the rows the serializer agrees with', (c) => {
|
|
107
|
+
const matches = rows.filter(selects(contentTypeFilterForItemTypes(c.wanted)));
|
|
108
|
+
expect(matches).toEqual(c.expected);
|
|
109
|
+
});
|
|
110
|
+
it('never returns a row whose item type the caller did not ask for', () => {
|
|
111
|
+
for (const c of cases) {
|
|
112
|
+
const matched = rows.filter(selects(contentTypeFilterForItemTypes(c.wanted)));
|
|
113
|
+
for (const row of matched) {
|
|
114
|
+
expect(c.wanted).toContain(contentTypeToItemType(row));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
it('returns every row whose item type the caller did ask for', () => {
|
|
119
|
+
for (const c of cases) {
|
|
120
|
+
const matched = rows.filter(selects(contentTypeFilterForItemTypes(c.wanted)));
|
|
121
|
+
for (const row of rows) {
|
|
122
|
+
if (c.wanted.includes(contentTypeToItemType(row)))
|
|
123
|
+
expect(matched).toContain(row);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
it('reproduces the hand-written predicate the items route used to carry', () => {
|
|
128
|
+
// Transcribed from `app/api/v1/context/items+api.ts` before this change:
|
|
129
|
+
// const wanted = ['document','reference','asset']
|
|
130
|
+
// .filter((ct) => typeFilter.has(contentTypeToItemType(ct)))
|
|
131
|
+
// typeFilter.has('document')
|
|
132
|
+
// ? or(inArray(contentType, wanted),
|
|
133
|
+
// notInArray(contentType, ['reference','asset']),
|
|
134
|
+
// isNull(contentType))
|
|
135
|
+
// : inArray(contentType, wanted)
|
|
136
|
+
const previous = (typeFilter) => {
|
|
137
|
+
const wanted = ['document', 'reference', 'asset'].filter((ct) => typeFilter.has(contentTypeToItemType(ct)));
|
|
138
|
+
return (contentType) => {
|
|
139
|
+
const isIn = (set) => contentType !== null && set.includes(contentType);
|
|
140
|
+
if (!typeFilter.has('document'))
|
|
141
|
+
return isIn(wanted);
|
|
142
|
+
return (isIn(wanted) ||
|
|
143
|
+
(contentType !== null && !['reference', 'asset'].includes(contentType)) ||
|
|
144
|
+
contentType === null);
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
for (const c of cases) {
|
|
148
|
+
const now = rows.filter(selects(contentTypeFilterForItemTypes(c.wanted)));
|
|
149
|
+
const before = rows.filter(previous(new Set(c.wanted)));
|
|
150
|
+
expect(now).toEqual(before);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
//# sourceMappingURL=contextKinds.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextKinds.test.js","sourceRoot":"","sources":["../src/contextKinds.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,cAAc,CAAA;AAErB;;;;;;;;;GASG;AACH,QAAQ,CAAC,4DAA4D,EAAE,GAAG,EAAE;IAC1E,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;QAC/E,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;YAC5C,OAAO;YACP,UAAU;YACV,WAAW;YACX,OAAO;SACR,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC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AC,CAAC,CAAC,CAAA;YACvD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|