@company-semantics/contracts 53.0.1 → 55.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": "53.0.1",
3
+ "version": "55.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 = '691f7bd81d0c' as const;
3
- export const SPEC_HASH_FULL = '691f7bd81d0c34aebd47c457a170dd48443a3f9eb007312fa97af00d9a4ccf30' as const;
2
+ export const SPEC_HASH = '6eb28e0d82f9' as const;
3
+ export const SPEC_HASH_FULL = '6eb28e0d82f9d1d88e4fc954ece5377c85ddd6da30b6171c4d2aa75f347c09ed' as const;
@@ -4982,6 +4982,7 @@ export interface components {
4982
4982
  type: "company" | "department" | "team" | "cross_team" | "doc" | "goal" | "source" | "map" | "context_bank";
4983
4983
  canEdit: boolean;
4984
4984
  memberCount: number;
4985
+ openRoleCount: number;
4985
4986
  description?: string;
4986
4987
  orderKey?: string;
4987
4988
  /** @enum {string} */
@@ -58,6 +58,12 @@ const CompanyMdTreeNodeSchema = z.object({
58
58
  ]),
59
59
  canEdit: z.boolean(),
60
60
  memberCount: z.number().int(),
61
+ /**
62
+ * Active open roles (`open` + `hiring`) on this node's owning unit — the
63
+ * companion to `memberCount` in the "(N + M open)" split. DIRECT per-unit,
64
+ * not a subtree rollup, matching this projection's `memberCount` scope.
65
+ */
66
+ openRoleCount: z.number().int().min(0),
61
67
  description: z.string().optional(),
62
68
  /** Fractional-index key for ordered entity wrappers (unit/context). */
63
69
  orderKey: z.string().optional(),
@@ -28,15 +28,31 @@ import { z } from "zod";
28
28
  export const HrConnectionStatusSchema = z
29
29
  .object({
30
30
  connected: z.boolean().meta({
31
- description: "Whether an HR provider is currently connected.",
31
+ description:
32
+ "Whether an HR provider is currently connected AND usable. False " +
33
+ "whenever the integration cannot sync — read `credentialState` to " +
34
+ "tell a never-connected integration from one whose grant died.",
35
+ }),
36
+ credentialState: z.enum(["usable", "unusable", "absent"]).meta({
37
+ description:
38
+ "Why the integration is or is not working. 'usable' — a connection " +
39
+ "exists and its credential works (`connected` is true). 'unusable' " +
40
+ "— a connection exists but its credential cannot be used (expired " +
41
+ "or revoked grant); previously synced data remains, and the user " +
42
+ "must reconnect. 'absent' — no connection at all. Distinguishing " +
43
+ "'unusable' from 'absent' is the whole point: both leave " +
44
+ "`connected` false, but only one of them is the user's fault to fix " +
45
+ "by connecting for the first time.",
32
46
  }),
33
47
  connectionId: z
34
48
  .string()
35
49
  .nullable()
36
50
  .meta({
37
51
  description:
38
- "Stable id of the active connection — the handle the app passes to " +
39
- "`integration.disconnect`. Null when not connected.",
52
+ "Stable id of the connection row — the handle the app passes to " +
53
+ "`integration.disconnect`. Present whenever a connection exists, " +
54
+ "including when `credentialState` is 'unusable', so a dead " +
55
+ "integration can still be disconnected. Null only when 'absent'.",
40
56
  }),
41
57
  employeeCount: z.number().int().nonnegative().nullable().meta({
42
58
  description:
@@ -42,8 +42,13 @@ export type IntegrationProvider = "slack" | "google" | "zoom";
42
42
  * - 'google_drive' → provider='google', service='drive'
43
43
  * - 'google_meet' → provider='google', service='meet'
44
44
  * - 'zoom' → provider='zoom', service=''
45
+ * - 'bamboohr' → provider='bamboohr', service=''
46
+ *
47
+ * This union is the single definition of the vocabulary; the backend's
48
+ * `providers/integration-key.ts` must mirror it exactly.
45
49
  */
46
- export type IntegrationKey = "slack" | "google_drive" | "google_meet" | "zoom";
50
+ export type IntegrationKey =
51
+ "slack" | "google_drive" | "google_meet" | "zoom" | "bamboohr";
47
52
 
48
53
  /**
49
54
  * Content structure for integration artifacts.
@@ -168,6 +168,14 @@ export interface CompanyMdTreeNode extends CompanyMdNodeIdentity {
168
168
  readonly type: CompanyMdNodeType;
169
169
  readonly canEdit: boolean;
170
170
  readonly memberCount: number;
171
+ /**
172
+ * Active open roles (`open` + `hiring`) on this node's owning unit, the
173
+ * companion to `memberCount` in the "(N + M open)" people-count split.
174
+ * Unlike `OrgUnitTreeNode.openRoleCount` this is a DIRECT per-unit count,
175
+ * not a subtree rollup — it is paired with this projection's `memberCount`,
176
+ * which is itself direct, so the two halves of one badge share a scope.
177
+ */
178
+ readonly openRoleCount: number;
171
179
  readonly description?: string;
172
180
  /**
173
181
  * Fractional-index key for stable ordering. Present on ordered entity