@company-semantics/contracts 78.1.0 → 79.0.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/package.json +1 -1
- package/src/action-items/__tests__/vocabulary.test.ts +10 -0
- package/src/action-items/schemas.ts +10 -0
- package/src/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +3 -0
- package/src/user-notifications/__tests__/vocabulary.test.ts +26 -0
- package/src/user-notifications/schemas.ts +10 -0
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ function makeItem(over: Partial<Record<string, unknown>> = {}) {
|
|
|
31
31
|
title: "Maya Chen wants access",
|
|
32
32
|
detail: "Reviewing the cross-team roadmap",
|
|
33
33
|
contextLabel: "Sales.md",
|
|
34
|
+
provider: null,
|
|
34
35
|
href: "/@acme/md/doc-1?share=1&request=req-1",
|
|
35
36
|
createdAt: "2026-07-27T00:00:00.000Z",
|
|
36
37
|
...over,
|
|
@@ -139,6 +140,15 @@ describe("ActionItemSchema", () => {
|
|
|
139
140
|
expect(parsed.unitPath).toBeNull();
|
|
140
141
|
});
|
|
141
142
|
|
|
143
|
+
it("requires a provider — null when the item is about the product", () => {
|
|
144
|
+
const { provider: _omitted, ...withoutProvider } = makeItem();
|
|
145
|
+
expect(ActionItemSchema.safeParse(withoutProvider).success).toBe(false);
|
|
146
|
+
expect(
|
|
147
|
+
ActionItemSchema.safeParse(makeItem({ provider: "google_drive" }))
|
|
148
|
+
.success,
|
|
149
|
+
).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
|
|
142
152
|
it("rejects a kind outside the vocabulary", () => {
|
|
143
153
|
expect(() =>
|
|
144
154
|
ActionItemSchema.parse(makeItem({ kind: "org.invite" })),
|
|
@@ -69,6 +69,16 @@ export const ActionItemSchema = z.object({
|
|
|
69
69
|
detail: z.string().nullable(),
|
|
70
70
|
/** The thing it is about, as the user names it, e.g. "Sales.md". */
|
|
71
71
|
contextLabel: z.string(),
|
|
72
|
+
/**
|
|
73
|
+
* The external system this row is ABOUT, when it is about one — the open
|
|
74
|
+
* provider id the identity-link vocabulary uses system-wide ('bamboohr',
|
|
75
|
+
* 'google_drive', 'slack'). A surface shows that system's own mark.
|
|
76
|
+
*
|
|
77
|
+
* Set by the producer, because only it knows: an org's structure findings
|
|
78
|
+
* come from whichever HRIS it connected, which the kind cannot say.
|
|
79
|
+
* `null` when the row is about the product itself (a doc, a chat, billing).
|
|
80
|
+
*/
|
|
81
|
+
provider: z.string().min(1).nullable(),
|
|
72
82
|
/**
|
|
73
83
|
* Where to go to RESOLVE it — a RELATIVE app path, e.g.
|
|
74
84
|
* `/@acme/md/{docId}?share=1&request={id}`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
|
|
2
|
-
export const SPEC_HASH = '
|
|
3
|
-
export const SPEC_HASH_FULL = '
|
|
2
|
+
export const SPEC_HASH = '554ba5a13882' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = '554ba5a138827be4f4959d0a9d0199be36e129c9caacce47370121ffede938bf' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -7470,6 +7470,7 @@ export interface components {
|
|
|
7470
7470
|
title: string;
|
|
7471
7471
|
detail: string | null;
|
|
7472
7472
|
contextLabel: string;
|
|
7473
|
+
provider: string | null;
|
|
7473
7474
|
href: string;
|
|
7474
7475
|
createdAt: string;
|
|
7475
7476
|
}[];
|
|
@@ -7491,6 +7492,7 @@ export interface components {
|
|
|
7491
7492
|
title: string;
|
|
7492
7493
|
detail: string | null;
|
|
7493
7494
|
contextLabel: string;
|
|
7495
|
+
provider: string | null;
|
|
7494
7496
|
href: string;
|
|
7495
7497
|
createdAt: string;
|
|
7496
7498
|
};
|
|
@@ -7510,6 +7512,7 @@ export interface components {
|
|
|
7510
7512
|
title: string;
|
|
7511
7513
|
detail: string | null;
|
|
7512
7514
|
contextLabel: string;
|
|
7515
|
+
provider: string | null;
|
|
7513
7516
|
href: string | null;
|
|
7514
7517
|
createdAt: string;
|
|
7515
7518
|
readAt: string | null;
|
|
@@ -22,6 +22,7 @@ function makeNotification(over: Record<string, unknown> = {}) {
|
|
|
22
22
|
title: "Dev Patel approved your request",
|
|
23
23
|
detail: null,
|
|
24
24
|
contextLabel: "Q3 OKRs",
|
|
25
|
+
provider: null,
|
|
25
26
|
href: "/@acme/md/doc-1",
|
|
26
27
|
createdAt: "2026-07-30T12:00:00.000Z",
|
|
27
28
|
readAt: null,
|
|
@@ -138,6 +139,30 @@ describe("UserNotificationSchema", () => {
|
|
|
138
139
|
});
|
|
139
140
|
});
|
|
140
141
|
|
|
142
|
+
describe("provider — the external system a row is about", () => {
|
|
143
|
+
it("carries a provider id when the row is about one", () => {
|
|
144
|
+
expect(
|
|
145
|
+
UserNotificationSchema.safeParse(
|
|
146
|
+
makeNotification({ provider: "bamboohr" }),
|
|
147
|
+
).success,
|
|
148
|
+
).toBe(true);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("is REQUIRED — null says 'about the product', absence says nothing", () => {
|
|
152
|
+
const { provider: _omitted, ...withoutProvider } = makeNotification();
|
|
153
|
+
expect(UserNotificationSchema.safeParse(withoutProvider).success).toBe(
|
|
154
|
+
false,
|
|
155
|
+
);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("rejects an empty id — a mark nobody can look up", () => {
|
|
159
|
+
expect(
|
|
160
|
+
UserNotificationSchema.safeParse(makeNotification({ provider: "" }))
|
|
161
|
+
.success,
|
|
162
|
+
).toBe(false);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
141
166
|
describe("FeedItem discriminates on `row`", () => {
|
|
142
167
|
it("accepts an informational row", () => {
|
|
143
168
|
const parsed = FeedItemSchema.safeParse({
|
|
@@ -158,6 +183,7 @@ describe("FeedItem discriminates on `row`", () => {
|
|
|
158
183
|
title: "Maya Chen wants access",
|
|
159
184
|
detail: null,
|
|
160
185
|
contextLabel: "Q3 OKRs",
|
|
186
|
+
provider: null,
|
|
161
187
|
href: "/@acme/md/doc-1?share=1&request=req-1",
|
|
162
188
|
createdAt: "2026-07-30T12:00:00.000Z",
|
|
163
189
|
},
|
|
@@ -49,6 +49,16 @@ export const UserNotificationSchema = z.object({
|
|
|
49
49
|
detail: z.string().nullable(),
|
|
50
50
|
/** The thing it is about, as the user names it, e.g. "Sales.md". */
|
|
51
51
|
contextLabel: z.string(),
|
|
52
|
+
/**
|
|
53
|
+
* The external system this row is ABOUT, when it is about one — the open
|
|
54
|
+
* provider id the identity-link vocabulary uses system-wide ('bamboohr',
|
|
55
|
+
* 'google_drive', 'slack'). A surface shows that system's own mark.
|
|
56
|
+
*
|
|
57
|
+
* Set by the producer, because only it knows: an org's structure findings
|
|
58
|
+
* come from whichever HRIS it connected, which the kind cannot say.
|
|
59
|
+
* `null` when the row is about the product itself (a doc, a chat, billing).
|
|
60
|
+
*/
|
|
61
|
+
provider: z.string().min(1).nullable(),
|
|
52
62
|
/**
|
|
53
63
|
* Where to go to SEE it — a RELATIVE app path.
|
|
54
64
|
*
|