@company-semantics/contracts 19.1.0 → 20.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "19.1.0",
3
+ "version": "20.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
2
- export const SPEC_HASH = '814c99a18543' as const;
3
- export const SPEC_HASH_FULL = '814c99a18543f448daaed5312db276f7704a9b63710c512b1a298be5fc652105' as const;
2
+ export const SPEC_HASH = '79972d6725ff' as const;
3
+ export const SPEC_HASH_FULL = '79972d6725ff3dfd29ee68945c8006039eddc196eadaeb0bcd77abeeebf2b066' as const;
@@ -1338,14 +1338,14 @@ export interface paths {
1338
1338
  patch?: never;
1339
1339
  trace?: never;
1340
1340
  };
1341
- "/api/company-md/docs/{slug}": {
1341
+ "/api/company-md/docs/{id}": {
1342
1342
  parameters: {
1343
1343
  query?: never;
1344
1344
  header?: never;
1345
1345
  path?: never;
1346
1346
  cookie?: never;
1347
1347
  };
1348
- /** Get a company.md document by slug */
1348
+ /** Get a company.md document by id */
1349
1349
  get: operations["getCompanyMdDoc"];
1350
1350
  put?: never;
1351
1351
  post?: never;
@@ -1355,7 +1355,7 @@ export interface paths {
1355
1355
  patch?: never;
1356
1356
  trace?: never;
1357
1357
  };
1358
- "/api/company-md/docs/{slug}/content": {
1358
+ "/api/company-md/docs/{id}/content": {
1359
1359
  parameters: {
1360
1360
  query?: never;
1361
1361
  header?: never;
@@ -1372,7 +1372,7 @@ export interface paths {
1372
1372
  patch?: never;
1373
1373
  trace?: never;
1374
1374
  };
1375
- "/api/company-md/docs/{slug}/title": {
1375
+ "/api/company-md/docs/{id}/title": {
1376
1376
  parameters: {
1377
1377
  query?: never;
1378
1378
  header?: never;
@@ -1406,7 +1406,7 @@ export interface paths {
1406
1406
  patch?: never;
1407
1407
  trace?: never;
1408
1408
  };
1409
- "/api/company-md/docs/{slug}/context-bank": {
1409
+ "/api/company-md/docs/{id}/context-bank": {
1410
1410
  parameters: {
1411
1411
  query?: never;
1412
1412
  header?: never;
@@ -1440,7 +1440,7 @@ export interface paths {
1440
1440
  patch?: never;
1441
1441
  trace?: never;
1442
1442
  };
1443
- "/api/company-md/docs/{slug}/context-bank/associate": {
1443
+ "/api/company-md/docs/{id}/context-bank/associate": {
1444
1444
  parameters: {
1445
1445
  query?: never;
1446
1446
  header?: never;
@@ -1457,7 +1457,7 @@ export interface paths {
1457
1457
  patch?: never;
1458
1458
  trace?: never;
1459
1459
  };
1460
- "/api/company-md/docs/{slug}/context-bank/{contextDocSlug}": {
1460
+ "/api/company-md/docs/{id}/context-bank/{contextDocId}": {
1461
1461
  parameters: {
1462
1462
  query?: never;
1463
1463
  header?: never;
@@ -1474,7 +1474,7 @@ export interface paths {
1474
1474
  patch?: never;
1475
1475
  trace?: never;
1476
1476
  };
1477
- "/api/company-md/docs/{slug}/context-bank/{id}/order": {
1477
+ "/api/company-md/docs/{id}/context-bank/{contextDocId}/order": {
1478
1478
  parameters: {
1479
1479
  query?: never;
1480
1480
  header?: never;
@@ -1491,7 +1491,7 @@ export interface paths {
1491
1491
  patch: operations["reorderCompanyMdContextBankItem"];
1492
1492
  trace?: never;
1493
1493
  };
1494
- "/api/company-md/docs/{parentSlug}/context-bank/upload": {
1494
+ "/api/company-md/docs/{id}/context-bank/upload": {
1495
1495
  parameters: {
1496
1496
  query?: never;
1497
1497
  header?: never;
@@ -1508,7 +1508,7 @@ export interface paths {
1508
1508
  patch?: never;
1509
1509
  trace?: never;
1510
1510
  };
1511
- "/api/company-md/docs/{slug}/context-bank/retry": {
1511
+ "/api/company-md/docs/{id}/context-bank/retry": {
1512
1512
  parameters: {
1513
1513
  query?: never;
1514
1514
  header?: never;
@@ -1525,7 +1525,7 @@ export interface paths {
1525
1525
  patch?: never;
1526
1526
  trace?: never;
1527
1527
  };
1528
- "/api/company-md/docs/{slug}/transfer-owner": {
1528
+ "/api/company-md/docs/{id}/transfer-owner": {
1529
1529
  parameters: {
1530
1530
  query?: never;
1531
1531
  header?: never;
@@ -1593,7 +1593,7 @@ export interface paths {
1593
1593
  patch?: never;
1594
1594
  trace?: never;
1595
1595
  };
1596
- "/api/company-md/docs/{slug}/sharing": {
1596
+ "/api/company-md/docs/{id}/sharing": {
1597
1597
  parameters: {
1598
1598
  query?: never;
1599
1599
  header?: never;
@@ -1610,7 +1610,7 @@ export interface paths {
1610
1610
  patch?: never;
1611
1611
  trace?: never;
1612
1612
  };
1613
- "/api/company-md/docs/{slug}/sharing/policy": {
1613
+ "/api/company-md/docs/{id}/sharing/policy": {
1614
1614
  parameters: {
1615
1615
  query?: never;
1616
1616
  header?: never;
@@ -1627,7 +1627,7 @@ export interface paths {
1627
1627
  patch?: never;
1628
1628
  trace?: never;
1629
1629
  };
1630
- "/api/company-md/docs/{slug}/sharing/acl": {
1630
+ "/api/company-md/docs/{id}/sharing/acl": {
1631
1631
  parameters: {
1632
1632
  query?: never;
1633
1633
  header?: never;
@@ -1644,7 +1644,7 @@ export interface paths {
1644
1644
  patch?: never;
1645
1645
  trace?: never;
1646
1646
  };
1647
- "/api/company-md/docs/{slug}/sharing/acl/{aclId}": {
1647
+ "/api/company-md/docs/{id}/sharing/acl/{aclId}": {
1648
1648
  parameters: {
1649
1649
  query?: never;
1650
1650
  header?: never;
@@ -4187,10 +4187,10 @@ export interface components {
4187
4187
  };
4188
4188
  CreateContextDocRequest: {
4189
4189
  title: string;
4190
- parentDocSlug: string;
4190
+ parentDocId: string;
4191
4191
  };
4192
4192
  AssociateContextDocRequest: {
4193
- contextDocSlug: string;
4193
+ contextDocId: string;
4194
4194
  };
4195
4195
  TransferCompanyMdDocOwnerRequest: {
4196
4196
  /** Format: uuid */
@@ -7421,7 +7421,7 @@ export interface operations {
7421
7421
  query?: never;
7422
7422
  header?: never;
7423
7423
  path: {
7424
- slug: string;
7424
+ id: string;
7425
7425
  };
7426
7426
  cookie?: never;
7427
7427
  };
@@ -7443,7 +7443,7 @@ export interface operations {
7443
7443
  query?: never;
7444
7444
  header?: never;
7445
7445
  path: {
7446
- slug: string;
7446
+ id: string;
7447
7447
  };
7448
7448
  cookie?: never;
7449
7449
  };
@@ -7467,7 +7467,7 @@ export interface operations {
7467
7467
  query?: never;
7468
7468
  header?: never;
7469
7469
  path: {
7470
- slug: string;
7470
+ id: string;
7471
7471
  };
7472
7472
  cookie?: never;
7473
7473
  };
@@ -7515,7 +7515,7 @@ export interface operations {
7515
7515
  query?: never;
7516
7516
  header?: never;
7517
7517
  path: {
7518
- slug: string;
7518
+ id: string;
7519
7519
  };
7520
7520
  cookie?: never;
7521
7521
  };
@@ -7559,7 +7559,7 @@ export interface operations {
7559
7559
  query?: never;
7560
7560
  header?: never;
7561
7561
  path: {
7562
- slug: string;
7562
+ id: string;
7563
7563
  };
7564
7564
  cookie?: never;
7565
7565
  };
@@ -7583,8 +7583,8 @@ export interface operations {
7583
7583
  query?: never;
7584
7584
  header?: never;
7585
7585
  path: {
7586
- slug: string;
7587
- contextDocSlug: string;
7586
+ id: string;
7587
+ contextDocId: string;
7588
7588
  };
7589
7589
  cookie?: never;
7590
7590
  };
@@ -7604,8 +7604,8 @@ export interface operations {
7604
7604
  query?: never;
7605
7605
  header?: never;
7606
7606
  path: {
7607
- slug: string;
7608
7607
  id: string;
7608
+ contextDocId: string;
7609
7609
  };
7610
7610
  cookie?: never;
7611
7611
  };
@@ -7639,7 +7639,7 @@ export interface operations {
7639
7639
  query?: never;
7640
7640
  header?: never;
7641
7641
  path: {
7642
- parentSlug: string;
7642
+ id: string;
7643
7643
  };
7644
7644
  cookie?: never;
7645
7645
  };
@@ -7679,7 +7679,7 @@ export interface operations {
7679
7679
  query?: never;
7680
7680
  header?: never;
7681
7681
  path: {
7682
- slug: string;
7682
+ id: string;
7683
7683
  };
7684
7684
  cookie?: never;
7685
7685
  };
@@ -7692,7 +7692,7 @@ export interface operations {
7692
7692
  };
7693
7693
  content?: never;
7694
7694
  };
7695
- /** @description Retry limit exceeded or invalid slug */
7695
+ /** @description Retry limit exceeded or invalid doc */
7696
7696
  422: {
7697
7697
  headers: {
7698
7698
  [name: string]: unknown;
@@ -7706,7 +7706,7 @@ export interface operations {
7706
7706
  query?: never;
7707
7707
  header?: never;
7708
7708
  path: {
7709
- slug: string;
7709
+ id: string;
7710
7710
  };
7711
7711
  cookie?: never;
7712
7712
  };
@@ -7824,7 +7824,7 @@ export interface operations {
7824
7824
  query?: never;
7825
7825
  header?: never;
7826
7826
  path: {
7827
- slug: string;
7827
+ id: string;
7828
7828
  };
7829
7829
  cookie?: never;
7830
7830
  };
@@ -7846,7 +7846,7 @@ export interface operations {
7846
7846
  query?: never;
7847
7847
  header?: never;
7848
7848
  path: {
7849
- slug: string;
7849
+ id: string;
7850
7850
  };
7851
7851
  cookie?: never;
7852
7852
  };
@@ -7870,7 +7870,7 @@ export interface operations {
7870
7870
  query?: never;
7871
7871
  header?: never;
7872
7872
  path: {
7873
- slug: string;
7873
+ id: string;
7874
7874
  };
7875
7875
  cookie?: never;
7876
7876
  };
@@ -7894,7 +7894,7 @@ export interface operations {
7894
7894
  query?: never;
7895
7895
  header?: never;
7896
7896
  path: {
7897
- slug: string;
7897
+ id: string;
7898
7898
  aclId: string;
7899
7899
  };
7900
7900
  cookie?: never;
@@ -7919,7 +7919,7 @@ export interface operations {
7919
7919
  query?: never;
7920
7920
  header?: never;
7921
7921
  path: {
7922
- slug: string;
7922
+ id: string;
7923
7923
  aclId: string;
7924
7924
  };
7925
7925
  cookie?: never;
package/src/index.ts CHANGED
@@ -23,7 +23,12 @@ export type InsightConfidence = "low" | "medium" | "high";
23
23
  export type InvariantPhase = "observe" | "stabilize" | "enforce";
24
24
 
25
25
  // Integration partner categories — surface grouping in settings UIs
26
- export const INTEGRATION_CATEGORIES = ["Meetings", "Comms", "Docs"] as const;
26
+ export const INTEGRATION_CATEGORIES = [
27
+ "Meetings",
28
+ "Comms",
29
+ "Docs",
30
+ "HR",
31
+ ] as const;
27
32
  export type IntegrationCategory = (typeof INTEGRATION_CATEGORIES)[number];
28
33
 
29
34
  // System diagram types
@@ -838,3 +843,8 @@ export * from "./permissions";
838
843
  // Single source of truth for upload formats; the backend normalizer joins its
839
844
  // private dispatch fields locally, the app derives its accept-set + copy.
840
845
  export * from "./ingestion";
846
+
847
+ // Third-party integration vocabulary (PRD-00793)
848
+ // HrConnectionStatus / HrConnectInput — see ./integrations/schemas.ts.
849
+ // Pairs with the `HR` member of INTEGRATION_CATEGORIES above.
850
+ export * from "./integrations";
@@ -0,0 +1,46 @@
1
+ # integrations/
2
+
3
+ Shared vocabulary for third-party integration surfaces.
4
+
5
+ ## Purpose
6
+
7
+ The cross-repo contract for HR-system integrations. The backend owns the
8
+ provider sync and persistence; the app renders the connection state and submits
9
+ the connect form. Both repos share the same `HrConnectionStatus` projection and
10
+ `HrConnectInput` shape so the boundary stays stable across independent releases.
11
+
12
+ The `HR` member of `INTEGRATION_CATEGORIES` (package root) names this category
13
+ alongside `Meetings`, `Comms`, and `Docs`.
14
+
15
+ ## Invariants
16
+
17
+ - `HrConnectionStatusSchema` is a read projection: count and sync fields are
18
+ `null` until the first successful sync (a connected, never-synced integration).
19
+ - `HrConnectInputSchema` carries only the customer's provider `subdomain`; no
20
+ secrets or provider credentials live in contracts.
21
+ - Pure vocabulary — `zod` is the only runtime import (vocabulary-guard).
22
+
23
+ <!-- BEGIN GENERATED: readme-public-api — derived from code by `pnpm readme-api`. Do not edit. -->
24
+
25
+ ## Public API
26
+
27
+ - `HrConnectInput` _(type)_
28
+ - `HrConnectInputSchema` — Input submitted by the app to initiate an HR provider connection.
29
+ - `HrConnectionStatus` _(type)_
30
+ - `HrConnectionStatusSchema` — Health of the most recent HR provider sync.
31
+
32
+ <!-- END GENERATED: readme-public-api -->
33
+
34
+ <!-- BEGIN GENERATED: readme-dependencies — derived from code by `pnpm readme-api`. Do not edit. -->
35
+
36
+ ## Dependencies
37
+
38
+ **Internal domains:**
39
+
40
+ _None._
41
+
42
+ **External packages:**
43
+
44
+ - `zod`
45
+
46
+ <!-- END GENERATED: readme-dependencies -->
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Third-party integration vocabulary barrel (PRD-00793).
3
+ *
4
+ * @see ./schemas.ts for the full schema definitions and invariants.
5
+ */
6
+ export { HrConnectionStatusSchema, HrConnectInputSchema } from "./schemas";
7
+
8
+ export type { HrConnectionStatus, HrConnectInput } from "./schemas";
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Third-party integration shared vocabulary (PRD-00793).
3
+ *
4
+ * Zod schemas describing the cross-repo contract for HR-system integrations.
5
+ * The `HR` integration category joins the existing `INTEGRATION_CATEGORIES`
6
+ * tuple in the package root; these schemas describe the connection-status
7
+ * projection the backend exposes and the connect input the app submits.
8
+ *
9
+ * Lives in contracts because the integration surface crosses backend (which
10
+ * owns the provider sync + persistence) and app (which renders the connection
11
+ * state and the connect form), and breaking it would require coordinated
12
+ * releases (see the promotion rule in CLAUDE.md).
13
+ *
14
+ * Per the durable user preference `feedback_structured_metadata_not_json_strings`,
15
+ * descriptions live in `.meta({ description })` — structured metadata, not
16
+ * stringified JSON blobs on the schema.
17
+ */
18
+ import { z } from "zod";
19
+
20
+ // =============================================================================
21
+ // HR connection status
22
+ // =============================================================================
23
+
24
+ /**
25
+ * Health of the most recent HR provider sync. `null` when no sync has run yet
26
+ * (a freshly connected, never-synced integration).
27
+ */
28
+ export const HrConnectionStatusSchema = z
29
+ .object({
30
+ connected: z.boolean().meta({
31
+ description: "Whether an HR provider is currently connected.",
32
+ }),
33
+ employeeCount: z.number().int().nonnegative().nullable().meta({
34
+ description:
35
+ "Employees mirrored from the HR provider; null when never synced.",
36
+ }),
37
+ departmentCount: z.number().int().nonnegative().nullable().meta({
38
+ description:
39
+ "Departments mirrored from the HR provider; null when never synced.",
40
+ }),
41
+ lastSyncAt: z.string().datetime().nullable().meta({
42
+ description: "ISO timestamp of the last successful sync; null if never.",
43
+ }),
44
+ syncHealth: z.enum(["healthy", "degraded", "error"]).nullable().meta({
45
+ description:
46
+ "Health of the most recent sync; null when no sync has run yet.",
47
+ }),
48
+ })
49
+ .meta({
50
+ description: "Connection-status projection for an HR integration.",
51
+ });
52
+ export type HrConnectionStatus = z.infer<typeof HrConnectionStatusSchema>;
53
+
54
+ // =============================================================================
55
+ // HR connect input
56
+ // =============================================================================
57
+
58
+ /**
59
+ * Input submitted by the app to initiate an HR provider connection. The
60
+ * `subdomain` identifies the customer's tenant on the provider (e.g. the
61
+ * BambooHR company subdomain).
62
+ */
63
+ export const HrConnectInputSchema = z
64
+ .object({
65
+ subdomain: z.string().meta({
66
+ description: "Customer tenant subdomain on the HR provider.",
67
+ }),
68
+ })
69
+ .meta({
70
+ description: "Input to initiate an HR provider connection.",
71
+ });
72
+ export type HrConnectInput = z.infer<typeof HrConnectInputSchema>;