@company-semantics/contracts 10.0.0 → 12.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": "10.0.0",
3
+ "version": "12.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -115,7 +115,7 @@
115
115
  "zod": "^4.4.3"
116
116
  },
117
117
  "devDependencies": {
118
- "@types/node": "^22.19.19",
118
+ "@types/node": "^25.9.2",
119
119
  "husky": "^9.1.7",
120
120
  "lint-staged": "^17.0.7",
121
121
  "markdownlint-cli2": "^0.22.1",
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
2
- export const SPEC_HASH = '1173d8fa2df9' as const;
3
- export const SPEC_HASH_FULL = '1173d8fa2df90dbf7a46608635f61e69939616ed509f6109bdf478fc1cd4a9c0' as const;
2
+ export const SPEC_HASH = '8d48325678a4' as const;
3
+ export const SPEC_HASH_FULL = '8d48325678a4837e0921b96c4c80fd3fe898dbd26cabb48483e9a5f3f7f9e488' as const;
@@ -126,7 +126,7 @@ export interface paths {
126
126
  patch: operations["updateUserProfile"];
127
127
  trace?: never;
128
128
  };
129
- "/api/user/resync-slack-avatar": {
129
+ "/api/user/resync-slack-avatar/preview": {
130
130
  parameters: {
131
131
  query?: never;
132
132
  header?: never;
@@ -135,8 +135,25 @@ export interface paths {
135
135
  };
136
136
  get?: never;
137
137
  put?: never;
138
- /** Resync Slack avatar */
139
- post: operations["resyncSlackAvatar"];
138
+ /** Preview a Slack avatar resync (stages without persisting) */
139
+ post: operations["resyncSlackAvatarPreview"];
140
+ delete?: never;
141
+ options?: never;
142
+ head?: never;
143
+ patch?: never;
144
+ trace?: never;
145
+ };
146
+ "/api/user/resync-slack-avatar/commit": {
147
+ parameters: {
148
+ query?: never;
149
+ header?: never;
150
+ path?: never;
151
+ cookie?: never;
152
+ };
153
+ get?: never;
154
+ put?: never;
155
+ /** Commit a previewed Slack avatar resync */
156
+ post: operations["resyncSlackAvatarCommit"];
140
157
  delete?: never;
141
158
  options?: never;
142
159
  head?: never;
@@ -2870,6 +2887,32 @@ export interface components {
2870
2887
  preferredName?: string | null;
2871
2888
  primaryUnitId?: string | null;
2872
2889
  };
2890
+ ResyncSlackAvatarPreviewResponse: {
2891
+ /** @constant */
2892
+ success: true;
2893
+ avatar: {
2894
+ /** @enum {string} */
2895
+ source: "photo" | "initials";
2896
+ url?: string;
2897
+ initials: string;
2898
+ };
2899
+ candidateKey: string;
2900
+ contentSha256: string;
2901
+ };
2902
+ ResyncSlackAvatarCommitResponse: {
2903
+ /** @constant */
2904
+ success: true;
2905
+ avatar: {
2906
+ /** @enum {string} */
2907
+ source: "photo" | "initials";
2908
+ url?: string;
2909
+ initials: string;
2910
+ };
2911
+ };
2912
+ ResyncSlackAvatarCommitRequest: {
2913
+ candidateKey: string;
2914
+ contentSha256: string;
2915
+ };
2873
2916
  SamlCallbackRequest: {
2874
2917
  SAMLResponse: string;
2875
2918
  RelayState: string;
@@ -3748,6 +3791,7 @@ export interface components {
3748
3791
  /** @enum {string} */
3749
3792
  level: "root" | "department" | "team" | "context";
3750
3793
  content: string;
3794
+ contentRedacted?: boolean;
3751
3795
  /** @enum {string} */
3752
3796
  visibility: "private" | "unit" | "org";
3753
3797
  parentId: string | null;
@@ -4761,7 +4805,7 @@ export interface components {
4761
4805
  id: string;
4762
4806
  };
4763
4807
  /** @enum {string} */
4764
- access_level: "owner" | "editor" | "commenter" | "viewer";
4808
+ access_level: "meta" | "owner" | "editor" | "commenter" | "viewer";
4765
4809
  /** @enum {string} */
4766
4810
  source: "explicit" | "ownership" | "visibility" | "inheritance" | "migration";
4767
4811
  }[];
@@ -4788,7 +4832,7 @@ export interface components {
4788
4832
  /** Format: uuid */
4789
4833
  entity_id: string;
4790
4834
  /** @enum {string} */
4791
- access_level: "owner" | "editor" | "commenter" | "viewer";
4835
+ access_level: "meta" | "owner" | "editor" | "commenter" | "viewer";
4792
4836
  /** @enum {string} */
4793
4837
  source: "explicit" | "ownership" | "visibility" | "inheritance" | "migration";
4794
4838
  }[];
@@ -5097,7 +5141,7 @@ export interface operations {
5097
5141
  };
5098
5142
  };
5099
5143
  };
5100
- resyncSlackAvatar: {
5144
+ resyncSlackAvatarPreview: {
5101
5145
  parameters: {
5102
5146
  query?: never;
5103
5147
  header?: never;
@@ -5106,12 +5150,38 @@ export interface operations {
5106
5150
  };
5107
5151
  requestBody?: never;
5108
5152
  responses: {
5109
- /** @description Avatar resynced successfully */
5153
+ /** @description Slack avatar staged for preview; persist via /commit */
5110
5154
  200: {
5111
5155
  headers: {
5112
5156
  [name: string]: unknown;
5113
5157
  };
5114
- content?: never;
5158
+ content: {
5159
+ "application/json": components["schemas"]["ResyncSlackAvatarPreviewResponse"];
5160
+ };
5161
+ };
5162
+ };
5163
+ };
5164
+ resyncSlackAvatarCommit: {
5165
+ parameters: {
5166
+ query?: never;
5167
+ header?: never;
5168
+ path?: never;
5169
+ cookie?: never;
5170
+ };
5171
+ requestBody: {
5172
+ content: {
5173
+ "application/json": components["schemas"]["ResyncSlackAvatarCommitRequest"];
5174
+ };
5175
+ };
5176
+ responses: {
5177
+ /** @description Previewed Slack avatar persisted */
5178
+ 200: {
5179
+ headers: {
5180
+ [name: string]: unknown;
5181
+ };
5182
+ content: {
5183
+ "application/json": components["schemas"]["ResyncSlackAvatarCommitResponse"];
5184
+ };
5115
5185
  };
5116
5186
  };
5117
5187
  };
@@ -74,6 +74,12 @@ export const CompanyMdDocResponseSchema = z.object({
74
74
  title: z.string(),
75
75
  level: z.enum(["root", "department", "team", "context"]),
76
76
  content: z.string(),
77
+ /**
78
+ * When `true`, `content` is the redacted empty body (`''`) returned to a
79
+ * metadata-only (meta-tier) viewer who administers the doc but may not read
80
+ * its body (ADR-BE-245). Omitted/`false` on the normal full-content path.
81
+ */
82
+ contentRedacted: z.boolean().optional(),
77
83
  visibility: z.enum(["private", "unit", "org"]),
78
84
  parentId: z.string().nullable(),
79
85
  owningUnitId: z.string().nullable(),
@@ -119,6 +119,12 @@ export interface CompanyMdTreeNode extends CompanyMdNodeIdentity {
119
119
 
120
120
  export interface CompanyMdDocCore extends CompanyMdNodeIdentity {
121
121
  readonly content: string;
122
+ /**
123
+ * When `true`, `content` is the redacted empty body (`''`) returned to a
124
+ * metadata-only (meta-tier) viewer who administers the doc but may not read
125
+ * its body (ADR-BE-245). Omitted/`false` on the normal full-content path.
126
+ */
127
+ readonly contentRedacted?: boolean;
122
128
  }
123
129
 
124
130
  export interface CompanyMdDocCollaborators {
@@ -1,18 +1,25 @@
1
1
  /**
2
2
  * Permission Access Levels
3
3
  *
4
- * Canonical four-level access vocabulary for object permissions across
5
- * Company Semantics, modeled on the Google-Docs four-level scheme.
4
+ * Canonical access vocabulary for object permissions across
5
+ * Company Semantics, modeled on the Google-Docs four-level scheme plus a
6
+ * weakest `meta` tier below `viewer`.
6
7
  *
7
8
  * Authority: ADR-CTRL-085 (Rights Table). See ADR-CTRL-084 for how these
8
9
  * levels are materialized into `effective_acl_grants`, and ADR-CTRL-086 for
9
10
  * the aggregation rule (most-permissive across sources).
10
11
  *
11
12
  * The commenter level is currently a stub — see ADR-CTRL-087.
13
+ *
14
+ * `meta` is the metadata-only tier used for org-admin lifecycle access
15
+ * (ADR-BE-245). It is materialized/derived only — never an explicit
16
+ * `acl_grants` value — and sits strictly below `viewer`, so
17
+ * `isAtLeast('meta', 'viewer') === false`.
12
18
  */
13
19
  import { z } from "zod";
14
20
 
15
21
  export const ACCESS_LEVELS = [
22
+ "meta",
16
23
  "owner",
17
24
  "editor",
18
25
  "commenter",
@@ -27,10 +34,11 @@ export const AccessLevelSchema = z.enum(ACCESS_LEVELS);
27
34
  * Used by `highestGrant()` in AUTH-006 (PRD-00674) to aggregate across sources.
28
35
  */
29
36
  export const ACCESS_LEVEL_ORDER: Record<AccessLevel, number> = {
30
- viewer: 0,
31
- commenter: 1,
32
- editor: 2,
33
- owner: 3,
37
+ meta: 0,
38
+ viewer: 1,
39
+ commenter: 2,
40
+ editor: 3,
41
+ owner: 4,
34
42
  };
35
43
 
36
44
  /**